Skip to content

Commit 9e0cbdd

Browse files
committed
fix(integrations): keep saved tavily map and ketch vendors references valid
1 parent f7f2d55 commit 9e0cbdd

5 files changed

Lines changed: 24 additions & 3 deletions

File tree

‎apps/sim/tools/generated/tool-outputs.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/ketch/get_consent.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const getConsentTool: ToolConfig<KetchGetConsentParams, KetchGetConsentRe
104104
description:
105105
'List of vendor IDs for which the user has opted out (deprecated by Ketch in favor of vendorConsents)',
106106
optional: true,
107-
items: { type: 'string' },
107+
items: { type: 'string', open: true },
108108
},
109109
},
110110
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { isPathInSchema } from '@/executor/utils/block-reference'
3+
import { getConsentTool } from '@/tools/ketch/get_consent'
4+
import { mapTool } from '@/tools/tavily/map'
5+
import type { ToolConfig } from '@/tools/types'
6+
7+
/** References that validated against the production output schemas must keep validating. */
8+
const SAVED_REFERENCES: Array<[string, ToolConfig['outputs'], string[]]> = [
9+
['Tavily Map', mapTool.outputs, ['results[0]', 'url']],
10+
['Tavily Map', mapTool.outputs, ['results', '0', 'url']],
11+
['Ketch Get Consent', getConsentTool.outputs, ['vendors', 'someVendor']],
12+
['Ketch Get Consent', getConsentTool.outputs, ['vendors', 'someVendor', 'status']],
13+
]
14+
15+
describe('saved references into reshaped tool outputs', () => {
16+
it.each(SAVED_REFERENCES)('%s still accepts %j', (_name, outputs, path) => {
17+
expect(isPathInSchema(outputs, path)).toBe(true)
18+
})
19+
})

‎apps/sim/tools/tavily/map.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const mapTool: ToolConfig<TavilyMapParams, MapResponse> = {
138138
results: {
139139
type: 'array',
140140
description: 'URLs discovered during mapping',
141-
items: { type: 'string', description: 'Discovered URL' },
141+
items: { type: 'string', description: 'Discovered URL', open: true },
142142
},
143143
response_time: { type: 'number', description: 'Time taken for the map request in seconds' },
144144
request_id: {

‎apps/sim/tools/types.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ export interface OutputProperty {
8484
description?: string
8585
nullable?: boolean
8686
properties?: Record<string, OutputProperty>
87+
/** Any sub-path of an item is a valid reference, kept for references an older schema allowed. */
88+
open?: boolean
8789
}
8890
}
8991

0 commit comments

Comments
 (0)