Skip to content

Commit 661ea9c

Browse files
committed
fix(hex,stripe): type run projectVersion as a string, send zero item quantities, mark nullable event fields
1 parent 3f9194a commit 661ea9c

8 files changed

Lines changed: 19 additions & 15 deletions

File tree

‎apps/docs/content/docs/integrations/hex.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Retrieve runs for a Hex project (API-triggered, scheduled, and app refresh runs)
273273
| ↳ `endTime` | string | Run end time |
274274
| ↳ `elapsedTime` | number | Elapsed run time in milliseconds |
275275
| ↳ `traceId` | string | Trace ID |
276-
| ↳ `projectVersion` | number | Project version that was run \(Hex returns it as a string, "draft" for notebook runs\) |
276+
| ↳ `projectVersion` | string | Project version that was run \("1", "2", ...; "draft" for notebook runs\) |
277277
| `total` | number | Total number of runs returned |
278278
| `traceId` | string | Top-level trace ID |
279279
| `nextPage` | string | Cursor for the next page of runs |
@@ -336,7 +336,7 @@ Check the status of a Hex project run by its run ID.
336336
| `endTime` | string | ISO 8601 run end time |
337337
| `elapsedTime` | number | Elapsed run time in milliseconds |
338338
| `traceId` | string | Trace ID for debugging |
339-
| `projectVersion` | number | Project version that was run \(Hex returns it as a string, "draft" for notebook runs\) |
339+
| `projectVersion` | string | Project version that was run \("1", "2", ...; "draft" for notebook runs\) |
340340

341341
</ReferenceDetails>
342342

‎apps/sim/blocks/blocks/hex.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('Hex block keeps stale subBlock values out of tool requests', () => {
8989
it('get queried tables keeps a cursor an agent passes directly', () => {
9090
const args = { operation: 'get_queried_tables', projectId: PROJECT_ID, after: 'tables-cursor' }
9191
const mapped = HexBlock.tools.config?.params?.(args, { operation: 'get_queried_tables' }) ?? {}
92-
const params = { apiKey: 'hex-token', operation: 'get_queried_tables', ...args, ...mapped }
92+
const params = { apiKey: 'hex-token', ...args, ...mapped }
9393
const url = getQueriedTablesTool.request.url
9494
const built = new URL(typeof url === 'function' ? url(params) : url)
9595
expect(built.searchParams.get('after')).toBe('tables-cursor')

‎apps/sim/blocks/blocks/hex.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,11 @@ Do not include any explanations, markdown formatting, or other text outside the
833833
runId: { type: 'string', description: 'Run UUID' },
834834
runUrl: { type: 'string', description: 'URL to view the run' },
835835
runStatusUrl: { type: 'string', description: 'URL to check run status' },
836-
projectVersion: { type: 'number', description: 'Project version number' },
836+
projectVersion: {
837+
type: 'number',
838+
description:
839+
'Project version: a number from Run Project; Get Run Status returns it as a string ("draft" for notebook runs)',
840+
},
837841
// Run status outputs
838842
status: {
839843
type: 'json',

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

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

‎apps/sim/tools/hex/get_project_runs.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const getProjectRunsTool: ToolConfig<HexGetProjectRunsParams, HexGetProje
8787
endTime: (r.endTime as string) ?? null,
8888
elapsedTime: (r.elapsedTime as number) ?? null,
8989
traceId: (r.traceId as string) ?? null,
90-
projectVersion: (r.projectVersion as number) ?? null,
90+
projectVersion: (r.projectVersion as string | undefined) ?? null,
9191
})),
9292
total: runs.length,
9393
traceId: data.traceId ?? null,
@@ -126,9 +126,8 @@ export const getProjectRunsTool: ToolConfig<HexGetProjectRunsParams, HexGetProje
126126
},
127127
traceId: { type: 'string', description: 'Trace ID', optional: true },
128128
projectVersion: {
129-
type: 'number',
130-
description:
131-
'Project version that was run (Hex returns it as a string, "draft" for notebook runs)',
129+
type: 'string',
130+
description: 'Project version that was run ("1", "2", ...; "draft" for notebook runs)',
132131
optional: true,
133132
},
134133
},

‎apps/sim/tools/hex/types.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ export const HEX_RUN_STATUS_OUTPUT_PROPERTIES = {
103103
elapsedTime: { type: 'number', description: 'Elapsed run time in milliseconds', optional: true },
104104
traceId: { type: 'string', description: 'Trace ID for debugging', optional: true },
105105
projectVersion: {
106-
type: 'number',
107-
description:
108-
'Project version that was run (Hex returns it as a string, "draft" for notebook runs)',
106+
type: 'string',
107+
description: 'Project version that was run ("1", "2", ...; "draft" for notebook runs)',
109108
optional: true,
110109
},
111110
} as const satisfies Record<string, OutputProperty>
@@ -217,7 +216,7 @@ export interface HexGetRunStatusResponse extends ToolResponse {
217216
endTime: string | null
218217
elapsedTime: number | null
219218
traceId: string | null
220-
projectVersion: number | null
219+
projectVersion: string | null
221220
}
222221
}
223222

@@ -258,7 +257,7 @@ export interface HexGetProjectRunsResponse extends ToolResponse {
258257
endTime: string | null
259258
elapsedTime: number | null
260259
traceId: string | null
261-
projectVersion: number | null
260+
projectVersion: string | null
262261
}>
263262
total: number
264263
traceId: string | null

‎apps/sim/tools/stripe/update_subscription.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const stripeUpdateSubscriptionTool: ToolConfig<
8282
params.items.forEach((item, index) => {
8383
if (item.id) formData.append(`items[${index}][id]`, item.id)
8484
if (item.price) formData.append(`items[${index}][price]`, item.price)
85-
if (item.quantity) {
85+
if (item.quantity != null && String(item.quantity).trim() !== '') {
8686
formData.append(`items[${index}][quantity]`, String(item.quantity))
8787
}
8888
if (item.deleted === true || String(item.deleted) === 'true')

‎apps/sim/triggers/stripe/webhook.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export const stripeWebhookTrigger: TriggerConfig = {
210210
},
211211
account: {
212212
type: 'string',
213+
nullable: true,
213214
description:
214215
'Connected account that originated the event (Connect events only; absent or null otherwise)',
215216
},
@@ -219,6 +220,7 @@ export const stripeWebhookTrigger: TriggerConfig = {
219220
},
220221
context: {
221222
type: 'string',
223+
nullable: true,
222224
description:
223225
'Authentication context needed to fetch the event or related object (null when not applicable)',
224226
},

0 commit comments

Comments
 (0)