Skip to content

Commit 62094cc

Browse files
committed
Merge remote-tracking branch 'origin/staging' into feat/servicenow-depth
# Conflicts: # apps/sim/tools/generated/tool-ids.ts # apps/sim/tools/generated/tool-metadata.ts # apps/sim/tools/generated/tool-outputs.ts
2 parents 0cb47da + 76318e4 commit 62094cc

156 files changed

Lines changed: 12345 additions & 1137 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/desktop/src/main/handoff.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,17 @@ describe('createHandoffManager', () => {
249249
const manager = createHandoffManager(deps, makeCallbacks())
250250
await manager.beginConnect('google-email', {
251251
workspaceId: 'workspace-1',
252+
draftId: 'draft-1',
252253
chatAttemptId: 'attempt-1',
253254
})
254-
const state = new URL(vi.mocked(deps.openExternal).mock.calls[0][0]).searchParams.get(
255-
'state'
256-
) as string
255+
const landing = new URL(vi.mocked(deps.openExternal).mock.calls[0][0])
256+
const state = landing.searchParams.get('state') as string
257+
258+
expect(landing.searchParams.get('draftId')).toBe('draft-1')
257259

258260
expect(manager.consumeConnect(state)).toEqual({
259261
workspaceId: 'workspace-1',
262+
draftId: 'draft-1',
260263
chatAttemptId: 'attempt-1',
261264
})
262265
expect(manager.consumeConnect(state)).toBeNull()

apps/desktop/src/main/handoff.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export interface HandoffManagerDeps {
6767
export interface ConnectScope {
6868
workspaceId?: string
6969
credentialId?: string
70+
draftId?: string
7071
chatAttemptId?: string
7172
}
7273

@@ -292,6 +293,7 @@ export function createHandoffManager(
292293
...(userId ? { user: userId } : {}),
293294
...(scope.workspaceId ? { workspaceId: scope.workspaceId } : {}),
294295
...(scope.credentialId ? { credentialId: scope.credentialId } : {}),
296+
...(scope.draftId ? { draftId: scope.draftId } : {}),
295297
},
296298
scope
297299
)

apps/desktop/src/main/ipc.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,21 +335,24 @@ describe('registerIpcHandlers', () => {
335335
expect(await handler?.(appEvent, 'slack')).toBe(true)
336336
expect(deps.beginOAuthConnect).toHaveBeenCalledWith('slack', {})
337337

338-
// Chip-initiated connects carry workspace/credential scope; malformed
338+
// Connects carry workspace/credential or exact-draft scope; malformed
339339
// scopes (wrong types, unsafe ids) are rejected before the handoff.
340340
expect(
341341
await handler?.(appEvent, 'slack', {
342342
workspaceId: 'ws1',
343343
credentialId: 'cred_1',
344+
draftId: 'draft_1',
344345
chatAttemptId: 'attempt_1',
345346
})
346347
).toBe(true)
347348
expect(deps.beginOAuthConnect).toHaveBeenCalledWith('slack', {
348349
workspaceId: 'ws1',
349350
credentialId: 'cred_1',
351+
draftId: 'draft_1',
350352
chatAttemptId: 'attempt_1',
351353
})
352354
expect(await handler?.(appEvent, 'slack', { workspaceId: 'ws/../evil' })).toBe(false)
355+
expect(await handler?.(appEvent, 'slack', { draftId: '../wrong' })).toBe(false)
353356
expect(await handler?.(appEvent, 'slack', { chatAttemptId: '../wrong' })).toBe(false)
354357
expect(await handler?.(appEvent, 'slack', 'not-an-object')).toBe(false)
355358
})

apps/desktop/src/main/ipc.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function parseDesktopScope(raw: unknown): string | null {
9595
export interface OAuthConnectScope {
9696
workspaceId?: string
9797
credentialId?: string
98+
draftId?: string
9899
chatAttemptId?: string
99100
}
100101

@@ -110,9 +111,10 @@ export function parseOAuthConnectScope(raw: unknown): OAuthConnectScope | undefi
110111
if (typeof raw !== 'object') {
111112
return undefined
112113
}
113-
const { workspaceId, credentialId, chatAttemptId } = raw as {
114+
const { workspaceId, credentialId, draftId, chatAttemptId } = raw as {
114115
workspaceId?: unknown
115116
credentialId?: unknown
117+
draftId?: unknown
116118
chatAttemptId?: unknown
117119
}
118120
if (
@@ -127,6 +129,9 @@ export function parseOAuthConnectScope(raw: unknown): OAuthConnectScope | undefi
127129
) {
128130
return undefined
129131
}
132+
if (draftId !== undefined && (typeof draftId !== 'string' || !ID_PATTERN.test(draftId))) {
133+
return undefined
134+
}
130135
if (
131136
chatAttemptId !== undefined &&
132137
(typeof chatAttemptId !== 'string' || !ID_PATTERN.test(chatAttemptId))
@@ -136,6 +141,7 @@ export function parseOAuthConnectScope(raw: unknown): OAuthConnectScope | undefi
136141
return {
137142
...(workspaceId !== undefined ? { workspaceId } : {}),
138143
...(credentialId !== undefined ? { credentialId } : {}),
144+
...(draftId !== undefined ? { draftId } : {}),
139145
...(chatAttemptId !== undefined ? { chatAttemptId } : {}),
140146
}
141147
}

apps/docs/components/icons.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8726,6 +8726,33 @@ export function BigQueryIcon(props: SVGProps<SVGSVGElement>) {
87268726
)
87278727
}
87288728

8729+
/**
8730+
* Splunk wordmark. The lettering is drawn with `currentColor` so it stays legible
8731+
* bare in both light and dark mode; the chevron keeps its brand green.
8732+
*/
8733+
export function SplunkIcon(props: SVGProps<SVGSVGElement>) {
8734+
return (
8735+
<svg
8736+
viewBox='0 0 48 48'
8737+
fillRule='evenodd'
8738+
clipRule='evenodd'
8739+
xmlns='http://www.w3.org/2000/svg'
8740+
{...props}
8741+
>
8742+
<path
8743+
fill='currentColor'
8744+
d='M13.432 18L13.5 28 15 28 15 18zM32 18v10.005h1.805c0 0 .015-3.609.035-3.608.019.001 2.69 3.743 2.716 3.733.027-.01 1.599-.576 1.599-.59 0-.014-2.684-3.441-2.684-3.448 0-.006 2.251-2.509 2.231-2.529-.06-.06-1.281-.586-1.314-.566-.018.011-2.582 2.796-2.582 2.796V18H32zM2.099 21.05c-.651.137-1.259.552-1.509 1.031-.23.44-.227 1.043.007 1.491.16.305.625.735 1.348 1.246.782.552 1.078.832 1.153 1.092.111.385-.06.752-.434.931-.187.089-.27.101-.603.086-.433-.02-.729-.132-1.172-.446-.14-.099-.269-.167-.285-.152-.016.016-.155.224-.311.466L.01 27.23l.109.081c.06.045.248.158.422.255 1.187.66 2.944.555 3.835-.229.475-.418.697-1.025.602-1.647-.089-.582-.409-.965-1.417-1.695-.791-.573-1.166-.889-1.253-1.059-.167-.326-.049-.643.307-.827.178-.092.251-.102.608-.087.347.015.453.041.741.179l.335.161.263-.41c.144-.224.252-.426.239-.445-.048-.071-.598-.299-.941-.391C3.402 20.995 2.521 20.961 2.099 21.05zM10.031 21.935c.788.369 1.212 1.528 1.041 2.852-.06.467-.227 1.032-.383 1.296-.159.268-.463.56-.705.675-.444.212-1.107.13-1.523-.187-.577-.442-.893-1.524-.772-2.649.111-1.032.483-1.684 1.133-1.986C9.156 21.781 9.7 21.781 10.031 21.935zM9.313 20.784c-.472.106-.85.319-1.254.705l-.366.35V21H6.814 6v5 5h1.693v-4.08l.324.319c.592.583 1.287.814 2.101.701.532-.074.904-.21 1.3-.475 1.111-.743 1.721-2.221 1.554-3.771-.158-1.467-.912-2.484-2.128-2.871C10.531 20.724 9.679 20.702 9.313 20.784zM16.258 21c0 0 .055 5.284.091 5.438.136.583.525 1.137.964 1.374.403.218.727.287 1.333.284.861-.004 1.386-.211 2.027-.8L21 27v1h1.742l-.023-7H21c0 0 .025 4.347 0 4.5-.1.611-.573 1.109-1.053 1.27-.287.096-.786.174-1.086.127C18.549 26.848 18.033 26.507 18 26v-4.977L16.258 21zM30.742 28c0 0-.055-5.284-.091-5.438-.136-.583-.525-1.137-.964-1.374-.403-.218-.727-.287-1.333-.284-.861.004-1.386.211-2.027.8L26 22v-1h-1.742l.023 7H26c0 0-.025-4.347 0-4.5.1-.611.573-1.109 1.053-1.27.287-.096.661-.17 1.086-.127C28.566 22.147 29.031 22.535 29 23v4.977L30.742 28z'
8745+
/>
8746+
<path
8747+
fill='#77b539'
8748+
fillRule='evenodd'
8749+
clipRule='evenodd'
8750+
d='M40 20.5L40 22 46 24 40 26.601 40 28 47 25 47 23z'
8751+
/>
8752+
</svg>
8753+
)
8754+
}
8755+
87298756
export function SnowflakeIcon(props: SVGProps<SVGSVGElement>) {
87308757
return (
87318758
<svg viewBox='0 0 146.36 139.16' xmlns='http://www.w3.org/2000/svg' {...props}>

apps/docs/components/ui/icon-mapping.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ import {
216216
SmartleadIcon,
217217
SmtpIcon,
218218
SnowflakeIcon,
219+
SplunkIcon,
219220
SportmonksIcon,
220221
SQSIcon,
221222
SquareIcon,
@@ -507,6 +508,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
507508
smartlead: SmartleadIcon,
508509
smtp: SmtpIcon,
509510
snowflake: SnowflakeIcon,
511+
splunk: SplunkIcon,
510512
sportmonks: SportmonksIcon,
511513
sqs: SQSIcon,
512514
square: SquareIcon,

apps/docs/content/docs/en/integrations/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
"smtp",
231231
"snowflake",
232232
"snowflake-service-account",
233+
"splunk",
233234
"sportmonks",
234235
"sqs",
235236
"square",

0 commit comments

Comments
 (0)