@automate.ax/integration-contracts 0.147.1 → 0.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/calcom/events.d.ts +1067 -11
  2. package/dist/calcom/events.js +66 -32
  3. package/dist/close/events.d.ts +4 -4
  4. package/dist/close/schemas.d.ts +6 -6
  5. package/dist/google-drive/index.d.ts +3 -3
  6. package/dist/kit/api.d.ts +78 -0
  7. package/dist/kit/api.js +386 -0
  8. package/dist/kit/events.d.ts +437 -0
  9. package/dist/kit/events.js +285 -0
  10. package/dist/kit/index.d.ts +6 -0
  11. package/dist/kit/index.js +5 -0
  12. package/dist/kit/openapi-operations.generated.d.ts +5 -0
  13. package/dist/kit/openapi-operations.generated.js +5 -0
  14. package/dist/kit/openapi-types.generated.d.ts +9485 -0
  15. package/dist/kit/openapi-types.generated.js +1 -0
  16. package/dist/kit/operation-manifest.d.ts +657 -0
  17. package/dist/kit/operation-manifest.js +98 -0
  18. package/dist/kit/schemas.d.ts +42 -0
  19. package/dist/kit/schemas.js +43 -0
  20. package/dist/kit/types.d.ts +41 -0
  21. package/dist/kit/types.js +1 -0
  22. package/dist/krisp/api.d.ts +61 -0
  23. package/dist/krisp/api.js +170 -0
  24. package/dist/krisp/index.d.ts +2 -0
  25. package/dist/krisp/index.js +2 -0
  26. package/dist/krisp/schemas.d.ts +145 -0
  27. package/dist/krisp/schemas.js +97 -0
  28. package/dist/notion/schemas.d.ts +108 -108
  29. package/dist/resend/action-schemas.d.ts +14 -14
  30. package/dist/triggers.d.ts +2 -1
  31. package/package.json +15 -2
  32. package/src/calcom/events.ts +149 -30
  33. package/src/kit/api.ts +523 -0
  34. package/src/kit/events.ts +352 -0
  35. package/src/kit/index.ts +6 -0
  36. package/src/kit/openapi-operations.generated.ts +7 -0
  37. package/src/kit/openapi-types.generated.ts +9710 -0
  38. package/src/kit/operation-manifest.ts +771 -0
  39. package/src/kit/schemas.ts +93 -0
  40. package/src/kit/types.ts +87 -0
  41. package/src/krisp/api.ts +215 -0
  42. package/src/krisp/index.ts +2 -0
  43. package/src/krisp/schemas.ts +122 -0
  44. package/src/triggers.ts +2 -0
@@ -6,11 +6,11 @@ export declare const RESEND_EMAIL_STATUS_SCHEMA: z.ZodEnum<{
6
6
  delivered: "delivered";
7
7
  clicked: "clicked";
8
8
  opened: "opened";
9
+ bounced: "bounced";
10
+ complained: "complained";
9
11
  scheduled: "scheduled";
10
12
  queued: "queued";
11
13
  suppressed: "suppressed";
12
- bounced: "bounced";
13
- complained: "complained";
14
14
  delivery_delayed: "delivery_delayed";
15
15
  }>;
16
16
  export declare const RESEND_TAG_SCHEMA: z.ZodObject<{
@@ -81,11 +81,11 @@ export declare const RESEND_EMAIL_SUMMARY_WIRE_SCHEMA: z.ZodObject<{
81
81
  delivered: "delivered";
82
82
  clicked: "clicked";
83
83
  opened: "opened";
84
+ bounced: "bounced";
85
+ complained: "complained";
84
86
  scheduled: "scheduled";
85
87
  queued: "queued";
86
88
  suppressed: "suppressed";
87
- bounced: "bounced";
88
- complained: "complained";
89
89
  delivery_delayed: "delivery_delayed";
90
90
  }>;
91
91
  message_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -108,11 +108,11 @@ export declare const RESEND_EMAIL_SUMMARY_SCHEMA: z.ZodPipe<z.ZodObject<{
108
108
  delivered: "delivered";
109
109
  clicked: "clicked";
110
110
  opened: "opened";
111
+ bounced: "bounced";
112
+ complained: "complained";
111
113
  scheduled: "scheduled";
112
114
  queued: "queued";
113
115
  suppressed: "suppressed";
114
- bounced: "bounced";
115
- complained: "complained";
116
116
  delivery_delayed: "delivery_delayed";
117
117
  }>;
118
118
  message_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -123,7 +123,7 @@ export declare const RESEND_EMAIL_SUMMARY_SCHEMA: z.ZodPipe<z.ZodObject<{
123
123
  topic_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
124
124
  }, z.core.$strip>, z.ZodTransform<{
125
125
  createdAt: string;
126
- lastEvent: "failed" | "canceled" | "sent" | "delivered" | "clicked" | "opened" | "scheduled" | "queued" | "suppressed" | "bounced" | "complained" | "delivery_delayed";
126
+ lastEvent: "failed" | "canceled" | "sent" | "delivered" | "clicked" | "opened" | "bounced" | "complained" | "scheduled" | "queued" | "suppressed" | "delivery_delayed";
127
127
  messageId: string | null | undefined;
128
128
  replyTo: string[] | null | undefined;
129
129
  scheduledAt: string | null | undefined;
@@ -138,7 +138,7 @@ export declare const RESEND_EMAIL_SUMMARY_SCHEMA: z.ZodPipe<z.ZodObject<{
138
138
  created_at: string;
139
139
  from: string;
140
140
  id: string;
141
- last_event: "failed" | "canceled" | "sent" | "delivered" | "clicked" | "opened" | "scheduled" | "queued" | "suppressed" | "bounced" | "complained" | "delivery_delayed";
141
+ last_event: "failed" | "canceled" | "sent" | "delivered" | "clicked" | "opened" | "bounced" | "complained" | "scheduled" | "queued" | "suppressed" | "delivery_delayed";
142
142
  subject: string;
143
143
  to: string[];
144
144
  bcc?: string[] | null | undefined;
@@ -159,11 +159,11 @@ export declare const RESEND_EMAIL_WIRE_SCHEMA: z.ZodObject<{
159
159
  delivered: "delivered";
160
160
  clicked: "clicked";
161
161
  opened: "opened";
162
+ bounced: "bounced";
163
+ complained: "complained";
162
164
  scheduled: "scheduled";
163
165
  queued: "queued";
164
166
  suppressed: "suppressed";
165
- bounced: "bounced";
166
- complained: "complained";
167
167
  delivery_delayed: "delivery_delayed";
168
168
  }>;
169
169
  message_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -193,11 +193,11 @@ export declare const RESEND_EMAIL_SCHEMA: z.ZodPipe<z.ZodObject<{
193
193
  delivered: "delivered";
194
194
  clicked: "clicked";
195
195
  opened: "opened";
196
+ bounced: "bounced";
197
+ complained: "complained";
196
198
  scheduled: "scheduled";
197
199
  queued: "queued";
198
200
  suppressed: "suppressed";
199
- bounced: "bounced";
200
- complained: "complained";
201
201
  delivery_delayed: "delivery_delayed";
202
202
  }>;
203
203
  message_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -217,7 +217,7 @@ export declare const RESEND_EMAIL_SCHEMA: z.ZodPipe<z.ZodObject<{
217
217
  text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
218
  }, z.core.$strip>, z.ZodTransform<{
219
219
  createdAt: string;
220
- lastEvent: "failed" | "canceled" | "sent" | "delivered" | "clicked" | "opened" | "scheduled" | "queued" | "suppressed" | "bounced" | "complained" | "delivery_delayed";
220
+ lastEvent: "failed" | "canceled" | "sent" | "delivered" | "clicked" | "opened" | "bounced" | "complained" | "scheduled" | "queued" | "suppressed" | "delivery_delayed";
221
221
  messageId: string | null | undefined;
222
222
  replyTo: string[] | null | undefined;
223
223
  scheduledAt: string | null | undefined;
@@ -239,7 +239,7 @@ export declare const RESEND_EMAIL_SCHEMA: z.ZodPipe<z.ZodObject<{
239
239
  created_at: string;
240
240
  from: string;
241
241
  id: string;
242
- last_event: "failed" | "canceled" | "sent" | "delivered" | "clicked" | "opened" | "scheduled" | "queued" | "suppressed" | "bounced" | "complained" | "delivery_delayed";
242
+ last_event: "failed" | "canceled" | "sent" | "delivered" | "clicked" | "opened" | "bounced" | "complained" | "scheduled" | "queued" | "suppressed" | "delivery_delayed";
243
243
  subject: string;
244
244
  to: string[];
245
245
  object: "email";
@@ -22,6 +22,7 @@ import type { googleAdsTriggerContracts } from "./google-ads/index.js";
22
22
  import type { googleSheetsTriggerContracts } from "./google-sheets/index.js";
23
23
  import type { hubspotTriggerContracts } from "./hubspot/index.js";
24
24
  import type { highLevelTriggerContracts } from "./highlevel/index.js";
25
+ import type { kitTriggerContracts } from "./kit/index.js";
25
26
  import type { linearTriggerContracts } from "./linear/index.js";
26
27
  import type { millionVerifierTriggerContracts } from "./millionverifier/index.js";
27
28
  import type { metaAdsTriggerContracts } from "./meta-ads/index.js";
@@ -38,7 +39,7 @@ import type { vercelTriggerContracts } from "./vercel/index.js";
38
39
  import type { webflowTriggerContracts } from "./webflow/index.js";
39
40
  import type { whatsappTriggerContracts } from "./whatsapp/index.js";
40
41
  import type { z } from "zod";
41
- export type TriggerContractMap = typeof airtableTriggerContracts & typeof anthropicTriggerContracts & typeof apifyTriggerContracts & typeof axiomTriggerContracts & typeof automateTriggerContracts & typeof asanaTriggerContracts & typeof brevoTriggerContracts & typeof calcomTriggerContracts & typeof convexTriggerContracts & typeof discordTriggerContracts & typeof closeTriggerContracts & typeof clickUpTriggerContracts & typeof calendlyTriggerContracts & typeof cloudflareTriggerContracts & typeof githubTriggerContracts & typeof gmailTriggerContracts & typeof googleCalendarTriggerContracts & typeof googleDriveTriggerContracts & typeof googleFormsTriggerContracts & typeof googleMeetTriggerContracts & typeof googleAdsTriggerContracts & typeof googleSheetsTriggerContracts & typeof hubspotTriggerContracts & typeof highLevelTriggerContracts & typeof linearTriggerContracts & typeof millionVerifierTriggerContracts & typeof metaAdsTriggerContracts & typeof notionTriggerContracts & typeof outlookTriggerContracts & typeof redditTriggerContracts & typeof resendTriggerContracts & typeof slackTriggerContracts & typeof stripeTriggerContracts & typeof teamsTriggerContracts & typeof tallyTriggerContracts & typeof trelloTriggerContracts & typeof vercelTriggerContracts & typeof webflowTriggerContracts & typeof whatsappTriggerContracts;
42
+ export type TriggerContractMap = typeof airtableTriggerContracts & typeof anthropicTriggerContracts & typeof apifyTriggerContracts & typeof axiomTriggerContracts & typeof automateTriggerContracts & typeof asanaTriggerContracts & typeof brevoTriggerContracts & typeof calcomTriggerContracts & typeof convexTriggerContracts & typeof discordTriggerContracts & typeof closeTriggerContracts & typeof clickUpTriggerContracts & typeof calendlyTriggerContracts & typeof cloudflareTriggerContracts & typeof githubTriggerContracts & typeof gmailTriggerContracts & typeof googleCalendarTriggerContracts & typeof googleDriveTriggerContracts & typeof googleFormsTriggerContracts & typeof googleMeetTriggerContracts & typeof googleAdsTriggerContracts & typeof googleSheetsTriggerContracts & typeof hubspotTriggerContracts & typeof highLevelTriggerContracts & typeof kitTriggerContracts & typeof linearTriggerContracts & typeof millionVerifierTriggerContracts & typeof metaAdsTriggerContracts & typeof notionTriggerContracts & typeof outlookTriggerContracts & typeof redditTriggerContracts & typeof resendTriggerContracts & typeof slackTriggerContracts & typeof stripeTriggerContracts & typeof teamsTriggerContracts & typeof tallyTriggerContracts & typeof trelloTriggerContracts & typeof vercelTriggerContracts & typeof webflowTriggerContracts & typeof whatsappTriggerContracts;
42
43
  export type IntegrationTriggerType = keyof TriggerContractMap;
43
44
  /** Canonical authoring configuration for one integration trigger type. */
44
45
  export type TriggerConfig<TType extends IntegrationTriggerType> = z.input<TriggerContractMap[TType]["configSchema"]> extends Record<string, never> ? object : z.input<TriggerContractMap[TType]["configSchema"]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/integration-contracts",
3
- "version": "0.147.1",
3
+ "version": "0.150.0",
4
4
  "description": "Shared integration payload contracts and provider primitives for Automate.ax.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,6 +28,7 @@
28
28
  "./calendly": "./src/calendly/index.ts",
29
29
  "./brevo": "./src/brevo/index.ts",
30
30
  "./calcom": "./src/calcom/index.ts",
31
+ "./kit": "./src/kit/index.ts",
31
32
  "./cloudflare": "./src/cloudflare/index.ts",
32
33
  "./meta-ads": "./src/meta-ads/index.ts",
33
34
  "./convex": "./src/convex/index.ts",
@@ -46,6 +47,7 @@
46
47
  "./highlevel": "./src/highlevel/index.ts",
47
48
  "./jobnimbus": "./src/jobnimbus/index.ts",
48
49
  "./linear": "./src/linear/index.ts",
50
+ "./krisp": "./src/krisp/index.ts",
49
51
  "./millionverifier": "./src/millionverifier/index.ts",
50
52
  "./notion": "./src/notion/index.ts",
51
53
  "./outlook": "./src/outlook/index.ts",
@@ -69,7 +71,7 @@
69
71
  },
70
72
  "dependencies": {
71
73
  "@anthropic-ai/sdk": "0.123.0",
72
- "@automate.ax/codec": "0.147.1",
74
+ "@automate.ax/codec": "0.150.0",
73
75
  "@cfworker/json-schema": "^4.1.1",
74
76
  "@googleapis/calendar": "^16.0.0",
75
77
  "@googleapis/forms": "^6.0.1",
@@ -106,6 +108,7 @@
106
108
  "generate:github": "bun scripts/generate-github-webhook-schemas.ts",
107
109
  "generate:calcom": "bun scripts/generate-calcom-openapi.ts",
108
110
  "generate:highlevel": "bun scripts/generate-highlevel-openapi.ts",
111
+ "generate:kit": "bun scripts/generate-kit-openapi.ts",
109
112
  "generate:tally": "bun scripts/generate-tally-openapi.ts",
110
113
  "typecheck": "resource-broker run --pool automate-ax-validation --limit 2 --weight 1 -- tsc --noEmit",
111
114
  "lint": "oxlint --type-aware --threads=2 && bun --bun eslint . --cache --cache-strategy content",
@@ -175,6 +178,11 @@
175
178
  "types": "./dist/calcom/index.d.ts",
176
179
  "default": "./dist/calcom/index.js"
177
180
  },
181
+ "./kit": {
182
+ "bun": "./src/kit/index.ts",
183
+ "types": "./dist/kit/index.d.ts",
184
+ "default": "./dist/kit/index.js"
185
+ },
178
186
  "./cloudflare": {
179
187
  "bun": "./src/cloudflare/index.ts",
180
188
  "types": "./dist/cloudflare/index.d.ts",
@@ -265,6 +273,11 @@
265
273
  "types": "./dist/linear/index.d.ts",
266
274
  "default": "./dist/linear/index.js"
267
275
  },
276
+ "./krisp": {
277
+ "bun": "./src/krisp/index.ts",
278
+ "types": "./dist/krisp/index.d.ts",
279
+ "default": "./dist/krisp/index.js"
280
+ },
268
281
  "./millionverifier": {
269
282
  "bun": "./src/millionverifier/index.ts",
270
283
  "types": "./dist/millionverifier/index.d.ts",
@@ -330,7 +330,42 @@ export type CalcomEvent<
330
330
  }
331
331
  : never
332
332
 
333
- export const CALCOM_TRIGGER_CONFIG_SCHEMA = z.object({})
333
+ export const CALCOM_USER_WEBHOOK_SCOPE_SCHEMA = z.object({
334
+ type: z.literal("user"),
335
+ })
336
+ export const CALCOM_TEAM_WEBHOOK_SCOPE_SCHEMA = z.object({
337
+ eventTypeId: z.number().int().positive(),
338
+ teamId: z.number().int().positive(),
339
+ type: z.literal("team"),
340
+ })
341
+ export const CALCOM_ORGANIZATION_WEBHOOK_SCOPE_SCHEMA = z.object({
342
+ organizationId: z.number().int().positive(),
343
+ type: z.literal("organization"),
344
+ })
345
+ export const CALCOM_WEBHOOK_SCOPE_SCHEMA = z.discriminatedUnion("type", [
346
+ CALCOM_USER_WEBHOOK_SCOPE_SCHEMA,
347
+ CALCOM_TEAM_WEBHOOK_SCOPE_SCHEMA,
348
+ CALCOM_ORGANIZATION_WEBHOOK_SCOPE_SCHEMA,
349
+ ])
350
+ export type CalcomWebhookScope = z.output<typeof CALCOM_WEBHOOK_SCOPE_SCHEMA>
351
+
352
+ export const CALCOM_USER_TRIGGER_CONFIG_SCHEMA = z.object({
353
+ scope: CALCOM_USER_WEBHOOK_SCOPE_SCHEMA.optional(),
354
+ })
355
+ export const CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA = z.object({
356
+ scope: z
357
+ .discriminatedUnion("type", [
358
+ CALCOM_USER_WEBHOOK_SCOPE_SCHEMA,
359
+ CALCOM_TEAM_WEBHOOK_SCOPE_SCHEMA,
360
+ ])
361
+ .optional(),
362
+ })
363
+ export const CALCOM_ORGANIZATION_TRIGGER_CONFIG_SCHEMA = z.object({
364
+ scope: CALCOM_ORGANIZATION_WEBHOOK_SCOPE_SCHEMA,
365
+ })
366
+ export const CALCOM_BROAD_TRIGGER_CONFIG_SCHEMA = z.object({
367
+ scope: CALCOM_WEBHOOK_SCOPE_SCHEMA.optional(),
368
+ })
334
369
 
335
370
  export const CALCOM_EVENT_SCHEMA: z.ZodType<CalcomEvent> =
336
371
  z.custom<CalcomEvent>((value) => {
@@ -398,8 +433,14 @@ function isCalcomWrappedTriggerType(
398
433
  return Object.hasOwn(CALCOM_PAYLOAD_SCHEMAS, type)
399
434
  }
400
435
 
436
+ type CalcomTriggerConfigSchema =
437
+ | typeof CALCOM_BROAD_TRIGGER_CONFIG_SCHEMA
438
+ | typeof CALCOM_ORGANIZATION_TRIGGER_CONFIG_SCHEMA
439
+ | typeof CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA
440
+ | typeof CALCOM_USER_TRIGGER_CONFIG_SCHEMA
441
+
401
442
  type CalcomTriggerContract<TEvent> = {
402
- readonly configSchema: typeof CALCOM_TRIGGER_CONFIG_SCHEMA
443
+ readonly configSchema: CalcomTriggerConfigSchema
403
444
  readonly eventSchema: z.ZodType<TEvent>
404
445
  }
405
446
 
@@ -444,59 +485,137 @@ type CalcomSemanticContracts = {
444
485
  >
445
486
  } & { readonly "calcom.event": CalcomTriggerContract<CalcomEvent> }
446
487
 
447
- export const calcomTriggerContracts: CalcomSemanticContracts = {
488
+ export const calcomTriggerContracts = {
448
489
  "calcom.afterGuestsCalVideoNoShow": contract(
449
490
  "AFTER_GUESTS_CAL_VIDEO_NO_SHOW",
491
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
492
+ ),
493
+ "calcom.afterHostsCalVideoNoShow": contract(
494
+ "AFTER_HOSTS_CAL_VIDEO_NO_SHOW",
495
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
496
+ ),
497
+ "calcom.booking.cancelled": contract(
498
+ "BOOKING_CANCELLED",
499
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
500
+ ),
501
+ "calcom.booking.created": contract(
502
+ "BOOKING_CREATED",
503
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
504
+ ),
505
+ "calcom.booking.locationUpdated": contract(
506
+ "BOOKING_LOCATION_UPDATED",
507
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
508
+ ),
509
+ "calcom.booking.noShowUpdated": contract(
510
+ "BOOKING_NO_SHOW_UPDATED",
511
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
512
+ ),
513
+ "calcom.booking.paid": contract(
514
+ "BOOKING_PAID",
515
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
516
+ ),
517
+ "calcom.booking.paymentInitiated": contract(
518
+ "BOOKING_PAYMENT_INITIATED",
519
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
520
+ ),
521
+ "calcom.booking.reassigned": contract(
522
+ "BOOKING_REASSIGNED",
523
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
524
+ ),
525
+ "calcom.booking.rejected": contract(
526
+ "BOOKING_REJECTED",
527
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
528
+ ),
529
+ "calcom.booking.requested": contract(
530
+ "BOOKING_REQUESTED",
531
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
532
+ ),
533
+ "calcom.booking.rescheduled": contract(
534
+ "BOOKING_RESCHEDULED",
535
+ CALCOM_TEAM_TRIGGER_CONFIG_SCHEMA,
536
+ ),
537
+ "calcom.calendarEntryRejected": contract(
538
+ "CALENDAR_ENTRY_REJECTED",
539
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
540
+ ),
541
+ "calcom.delegationCredential.error": contract(
542
+ "DELEGATION_CREDENTIAL_ERROR",
543
+ CALCOM_ORGANIZATION_TRIGGER_CONFIG_SCHEMA,
450
544
  ),
451
- "calcom.afterHostsCalVideoNoShow": contract("AFTER_HOSTS_CAL_VIDEO_NO_SHOW"),
452
- "calcom.booking.cancelled": contract("BOOKING_CANCELLED"),
453
- "calcom.booking.created": contract("BOOKING_CREATED"),
454
- "calcom.booking.locationUpdated": contract("BOOKING_LOCATION_UPDATED"),
455
- "calcom.booking.noShowUpdated": contract("BOOKING_NO_SHOW_UPDATED"),
456
- "calcom.booking.paid": contract("BOOKING_PAID"),
457
- "calcom.booking.paymentInitiated": contract("BOOKING_PAYMENT_INITIATED"),
458
- "calcom.booking.reassigned": contract("BOOKING_REASSIGNED"),
459
- "calcom.booking.rejected": contract("BOOKING_REJECTED"),
460
- "calcom.booking.requested": contract("BOOKING_REQUESTED"),
461
- "calcom.booking.rescheduled": contract("BOOKING_RESCHEDULED"),
462
- "calcom.calendarEntryRejected": contract("CALENDAR_ENTRY_REJECTED"),
463
- "calcom.delegationCredential.error": contract("DELEGATION_CREDENTIAL_ERROR"),
464
545
  "calcom.delegationCredential.rotationRequired": contract(
465
546
  "DELEGATION_CREDENTIAL_ROTATION_REQUIRED",
547
+ CALCOM_ORGANIZATION_TRIGGER_CONFIG_SCHEMA,
466
548
  ),
467
549
  "calcom.delegationCredential.secretRotated": contract(
468
550
  "DELEGATION_CREDENTIAL_SECRET_ROTATED",
551
+ CALCOM_ORGANIZATION_TRIGGER_CONFIG_SCHEMA,
469
552
  ),
470
553
  "calcom.delegationCredential.secretRotationFailed": contract(
471
554
  "DELEGATION_CREDENTIAL_SECRET_ROTATION_FAILED",
555
+ CALCOM_ORGANIZATION_TRIGGER_CONFIG_SCHEMA,
472
556
  ),
473
557
  "calcom.event": {
474
- configSchema: CALCOM_TRIGGER_CONFIG_SCHEMA,
558
+ configSchema: CALCOM_BROAD_TRIGGER_CONFIG_SCHEMA,
475
559
  eventSchema: CALCOM_EVENT_SCHEMA,
476
560
  },
477
- "calcom.form.submitted": contract("FORM_SUBMITTED"),
478
- "calcom.form.submittedWithoutEvent": contract("FORM_SUBMITTED_NO_EVENT"),
479
- "calcom.instantMeeting.accepted": contract("INSTANT_MEETING_ACCEPTED"),
480
- "calcom.instantMeeting.created": contract("INSTANT_MEETING"),
481
- "calcom.meeting.ended": contract("MEETING_ENDED"),
482
- "calcom.meeting.started": contract("MEETING_STARTED"),
483
- "calcom.outOfOffice.created": contract("OOO_CREATED"),
484
- "calcom.recording.ready": contract("RECORDING_READY"),
561
+ "calcom.form.submitted": contract(
562
+ "FORM_SUBMITTED",
563
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
564
+ ),
565
+ "calcom.form.submittedWithoutEvent": contract(
566
+ "FORM_SUBMITTED_NO_EVENT",
567
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
568
+ ),
569
+ "calcom.instantMeeting.accepted": contract(
570
+ "INSTANT_MEETING_ACCEPTED",
571
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
572
+ ),
573
+ "calcom.instantMeeting.created": contract(
574
+ "INSTANT_MEETING",
575
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
576
+ ),
577
+ "calcom.meeting.ended": contract(
578
+ "MEETING_ENDED",
579
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
580
+ ),
581
+ "calcom.meeting.started": contract(
582
+ "MEETING_STARTED",
583
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
584
+ ),
585
+ "calcom.outOfOffice.created": contract(
586
+ "OOO_CREATED",
587
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
588
+ ),
589
+ "calcom.recording.ready": contract(
590
+ "RECORDING_READY",
591
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
592
+ ),
485
593
  "calcom.recording.transcriptionGenerated": contract(
486
594
  "RECORDING_TRANSCRIPTION_GENERATED",
595
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
487
596
  ),
488
- "calcom.routingForm.fallbackHit": contract("ROUTING_FORM_FALLBACK_HIT"),
489
- "calcom.wrongAssignmentReported": contract("WRONG_ASSIGNMENT_REPORT"),
490
- }
597
+ "calcom.routingForm.fallbackHit": contract(
598
+ "ROUTING_FORM_FALLBACK_HIT",
599
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
600
+ ),
601
+ "calcom.wrongAssignmentReported": contract(
602
+ "WRONG_ASSIGNMENT_REPORT",
603
+ CALCOM_USER_TRIGGER_CONFIG_SCHEMA,
604
+ ),
605
+ } as const satisfies CalcomSemanticContracts
491
606
 
492
607
  /**
493
608
  * Builds one trigger contract for an exact Cal.com provider event.
494
609
  *
495
610
  * @param type Exact Cal.com provider event type.
611
+ * @param configSchema Trigger configuration schema.
496
612
  */
497
- function contract<TType extends CalcomWebhookTriggerType>(type: TType) {
613
+ function contract<
614
+ TType extends CalcomWebhookTriggerType,
615
+ TConfigSchema extends CalcomTriggerConfigSchema,
616
+ >(type: TType, configSchema: TConfigSchema) {
498
617
  return {
499
- configSchema: CALCOM_TRIGGER_CONFIG_SCHEMA,
618
+ configSchema,
500
619
  eventSchema: calcomSemanticEventSchema(type),
501
620
  }
502
621
  }