mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(sap-concur): align with live API on travel-profile, itineraries, and context types
- list_travel_profiles_summary: rename Status query to Active with 1/0 values, tighten LastModifiedDate format hint - list_itineraries / get_itinerary: use documented userid_type / userid_value / ItemsPerPage / Page query keys - create_report_comment: contextType allows MANAGER (move to EXPENSE_READ_CONTEXT_TYPE_OPS) - get_list_item: drop unused listId from block (tool only needs itemId) - Tighten description copy on list_expenses/get_itemizations/associate_attendees/remove_all_attendees Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
306cc57c9e
commit
b74fc86f80
@@ -44,6 +44,7 @@ const EXPENSE_READ_CONTEXT_TYPE_OPS = [
|
||||
'sap_concur_list_expenses',
|
||||
'sap_concur_get_expense',
|
||||
'sap_concur_get_itemizations',
|
||||
'sap_concur_create_report_comment',
|
||||
'sap_concur_list_report_comments',
|
||||
'sap_concur_list_exceptions',
|
||||
]
|
||||
@@ -59,7 +60,6 @@ const ATTENDEE_CONTEXT_TYPE_OPS = [
|
||||
'sap_concur_list_attendee_associations',
|
||||
'sap_concur_associate_attendees',
|
||||
'sap_concur_remove_all_attendees',
|
||||
'sap_concur_create_report_comment',
|
||||
]
|
||||
|
||||
const ALLOCATION_CONTEXT_TYPE_OPS = [
|
||||
@@ -928,7 +928,7 @@ export const SapConcurBlock: BlockConfig<SapConcurProxyResponse> = {
|
||||
placeholder: 'List ID',
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: ['sap_concur_get_list', 'sap_concur_list_list_items', 'sap_concur_get_list_item'],
|
||||
value: ['sap_concur_get_list', 'sap_concur_list_list_items'],
|
||||
},
|
||||
required: {
|
||||
field: 'operation',
|
||||
@@ -1080,7 +1080,7 @@ export const SapConcurBlock: BlockConfig<SapConcurProxyResponse> = {
|
||||
id: 'lastModifiedDate',
|
||||
title: 'Last Modified Date',
|
||||
type: 'short-input',
|
||||
placeholder: 'YYYY-MM-DD or 1900-01-01T12:00:00',
|
||||
placeholder: '1900-01-01T00:00:00 (UTC datetime)',
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: 'sap_concur_list_travel_profiles_summary',
|
||||
@@ -1110,8 +1110,8 @@ export const SapConcurBlock: BlockConfig<SapConcurProxyResponse> = {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Any', id: '' },
|
||||
{ label: 'Active', id: 'Active' },
|
||||
{ label: 'Inactive', id: 'Inactive' },
|
||||
{ label: 'Active', id: '1' },
|
||||
{ label: 'Inactive', id: '0' },
|
||||
],
|
||||
value: () => '',
|
||||
condition: { field: 'operation', value: 'sap_concur_list_travel_profiles_summary' },
|
||||
@@ -1684,7 +1684,6 @@ export const SapConcurBlock: BlockConfig<SapConcurProxyResponse> = {
|
||||
case 'sap_concur_get_list_item':
|
||||
return {
|
||||
...auth,
|
||||
listId: params.listId || undefined,
|
||||
itemId: params.itemId,
|
||||
}
|
||||
case 'sap_concur_list_budgets':
|
||||
@@ -1723,7 +1722,7 @@ export const SapConcurBlock: BlockConfig<SapConcurProxyResponse> = {
|
||||
page: params.travelProfilePage ? Number(params.travelProfilePage) : undefined,
|
||||
itemsPerPage: params.itemsPerPage ? Number(params.itemsPerPage) : undefined,
|
||||
active:
|
||||
params.travelProfileActive === 'Active' || params.travelProfileActive === 'Inactive'
|
||||
params.travelProfileActive === '1' || params.travelProfileActive === '0'
|
||||
? params.travelProfileActive
|
||||
: undefined,
|
||||
travelConfigs: params.travelConfigs || undefined,
|
||||
@@ -1886,7 +1885,10 @@ export const SapConcurBlock: BlockConfig<SapConcurProxyResponse> = {
|
||||
page: { type: 'number', description: 'Page number (lists/list_items)' },
|
||||
travelProfilePage: { type: 'number', description: 'Profile summary page number' },
|
||||
itemsPerPage: { type: 'number', description: 'Profile summary items per page' },
|
||||
travelProfileActive: { type: 'string', description: 'Status filter ("Active" or "Inactive")' },
|
||||
travelProfileActive: {
|
||||
type: 'string',
|
||||
description: 'Active filter ("1" for active, "0" for inactive)',
|
||||
},
|
||||
travelConfigs: { type: 'string', description: 'Comma-separated travel config ids' },
|
||||
searchText: { type: 'string', description: 'Locations v5 free-text search' },
|
||||
locCode: { type: 'string', description: 'Locations v5 location code' },
|
||||
|
||||
@@ -12,7 +12,7 @@ export const associateAttendeesTool: ToolConfig<AssociateAttendeesParams, SapCon
|
||||
id: 'sap_concur_associate_attendees',
|
||||
name: 'SAP Concur Associate Attendees',
|
||||
description:
|
||||
'Associate attendees with an expense (POST /expensereports/v4/users/{userId}/context/TRAVELER/reports/{reportId}/expenses/{expenseId}/attendees).',
|
||||
'Associate attendees with an expense (POST /expensereports/v4/users/{userId}/context/{contextType}/reports/{reportId}/expenses/{expenseId}/attendees).',
|
||||
version: '1.0.0',
|
||||
params: {
|
||||
datacenter: {
|
||||
|
||||
@@ -66,7 +66,7 @@ export const getItemizationsTool: ToolConfig<GetItemizationsParams, SapConcurPro
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Access context (TRAVELER per the v4 spec)',
|
||||
description: 'Access context: TRAVELER, MANAGER, or PROXY',
|
||||
},
|
||||
reportId: {
|
||||
type: 'string',
|
||||
|
||||
@@ -88,8 +88,8 @@ export const getItineraryTool: ToolConfig<GetItineraryParams, SapConcurProxyResp
|
||||
body: (params) => {
|
||||
const tripId = trimRequired(params.tripId, 'tripId')
|
||||
const query = buildListQuery({
|
||||
useridType: params.useridType,
|
||||
useridValue: params.useridValue,
|
||||
userid_type: params.useridType,
|
||||
userid_value: params.useridValue,
|
||||
systemFormat: params.systemFormat,
|
||||
})
|
||||
return {
|
||||
|
||||
@@ -66,7 +66,7 @@ export const listExpensesTool: ToolConfig<ListExpensesParams, SapConcurProxyResp
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Access context (TRAVELER per the v4 spec)',
|
||||
description: 'Access context: TRAVELER, MANAGER, or PROXY',
|
||||
},
|
||||
reportId: {
|
||||
type: 'string',
|
||||
|
||||
@@ -137,10 +137,10 @@ export const listItinerariesTool: ToolConfig<ListItinerariesParams, SapConcurPro
|
||||
startDate: params.startDate,
|
||||
endDate: params.endDate,
|
||||
bookingType: params.bookingType,
|
||||
useridType: params.useridType,
|
||||
useridValue: params.useridValue,
|
||||
itemsPerPage: params.itemsPerPage,
|
||||
page: params.page,
|
||||
userid_type: params.useridType,
|
||||
userid_value: params.useridValue,
|
||||
ItemsPerPage: params.itemsPerPage,
|
||||
Page: params.page,
|
||||
includeMetadata: params.includeMetadata,
|
||||
includeCanceledTrips: params.includeCanceledTrips,
|
||||
createdAfterDate: params.createdAfterDate,
|
||||
|
||||
@@ -67,7 +67,7 @@ export const listTravelProfilesSummaryTool: ToolConfig<
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Required ISO 8601 date (YYYY-MM-DD or full timestamp)',
|
||||
description: 'Required UTC datetime in YYYY-MM-DDThh:mm:ss format',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
@@ -86,7 +86,7 @@ export const listTravelProfilesSummaryTool: ToolConfig<
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Status filter (sent as Status query param): "Active" or "Inactive". Omit for all.',
|
||||
'Active filter (sent as Active query param): "1" (active) or "0" (inactive). Omit for all.',
|
||||
},
|
||||
travelConfigs: {
|
||||
type: 'string',
|
||||
@@ -105,7 +105,7 @@ export const listTravelProfilesSummaryTool: ToolConfig<
|
||||
LastModifiedDate: lastModifiedDate,
|
||||
Page: params.page,
|
||||
ItemsPerPage: params.itemsPerPage,
|
||||
Status: params.active,
|
||||
Active: params.active,
|
||||
travelConfigs: params.travelConfigs,
|
||||
})
|
||||
return {
|
||||
|
||||
@@ -12,7 +12,7 @@ export const removeAllAttendeesTool: ToolConfig<RemoveAllAttendeesParams, SapCon
|
||||
id: 'sap_concur_remove_all_attendees',
|
||||
name: 'SAP Concur Remove All Attendees',
|
||||
description:
|
||||
'Remove all attendees from an expense (DELETE /expensereports/v4/users/{userId}/context/TRAVELER/reports/{reportId}/expenses/{expenseId}/attendees).',
|
||||
'Remove all attendees from an expense (DELETE /expensereports/v4/users/{userId}/context/{contextType}/reports/{reportId}/expenses/{expenseId}/attendees).',
|
||||
version: '1.0.0',
|
||||
params: {
|
||||
datacenter: {
|
||||
|
||||
Reference in New Issue
Block a user