@automate.ax/integration-contracts 0.99.0 → 0.99.2

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.
@@ -1,5 +1,11 @@
1
1
  import * as z from "zod";
2
- export declare const CLOSE_WEBHOOK_EVENT_SELECTIONS: readonly [readonly ["lead", "created"], readonly ["lead", "updated"], readonly ["lead", "deleted"], readonly ["lead", "merged"], readonly ["contact", "created"], readonly ["contact", "updated"], readonly ["contact", "deleted"], readonly ["opportunity", "created"], readonly ["opportunity", "updated"], readonly ["opportunity", "deleted"], readonly ["task.lead", "created"], readonly ["task.lead", "updated"], readonly ["task.lead", "deleted"], readonly ["task.lead", "completed"], readonly ["task.incoming_email", "created"], readonly ["task.incoming_email", "updated"], readonly ["task.incoming_email", "deleted"], readonly ["task.incoming_email", "completed"], readonly ["task.email_followup", "created"], readonly ["task.email_followup", "updated"], readonly ["task.email_followup", "deleted"], readonly ["task.email_followup", "completed"], readonly ["task.missed_call", "created"], readonly ["task.missed_call", "updated"], readonly ["task.missed_call", "deleted"], readonly ["task.missed_call", "completed"], readonly ["task.answered_detached_call", "created"], readonly ["task.answered_detached_call", "updated"], readonly ["task.answered_detached_call", "deleted"], readonly ["task.answered_detached_call", "completed"], readonly ["task.voicemail", "created"], readonly ["task.voicemail", "updated"], readonly ["task.voicemail", "deleted"], readonly ["task.voicemail", "completed"], readonly ["task.opportunity_due", "created"], readonly ["task.opportunity_due", "updated"], readonly ["task.opportunity_due", "deleted"], readonly ["task.opportunity_due", "completed"], readonly ["task.incoming_sms", "created"], readonly ["task.incoming_sms", "updated"], readonly ["task.incoming_sms", "deleted"], readonly ["task.incoming_sms", "completed"], readonly ["task.outbound_call", "created"], readonly ["task.outbound_call", "updated"], readonly ["task.outbound_call", "deleted"], readonly ["task.outbound_call", "completed"], readonly ["activity.email", "created"], readonly ["activity.email", "updated"], readonly ["activity.email", "deleted"], readonly ["activity.email", "sent"], readonly ["activity.email_thread", "created"], readonly ["activity.email_thread", "updated"], readonly ["activity.email_thread", "deleted"], readonly ["unsubscribed_email", "created"], readonly ["unsubscribed_email", "deleted"], readonly ["activity.call", "created"], readonly ["activity.call", "updated"], readonly ["activity.call", "deleted"], readonly ["activity.call", "answered"], readonly ["activity.call", "completed"], readonly ["activity.sms", "created"], readonly ["activity.sms", "updated"], readonly ["activity.sms", "deleted"], readonly ["activity.sms", "sent"], readonly ["activity.whatsapp_message", "created"], readonly ["activity.whatsapp_message", "updated"], readonly ["activity.whatsapp_message", "deleted"], readonly ["activity.note", "created"], readonly ["activity.note", "updated"], readonly ["activity.note", "deleted"], readonly ["activity.meeting", "created"], readonly ["activity.meeting", "updated"], readonly ["activity.meeting", "deleted"], readonly ["activity.meeting", "scheduled"], readonly ["activity.meeting", "started"], readonly ["activity.meeting", "completed"], readonly ["activity.meeting", "canceled"], readonly ["activity.form_submission", "created"], readonly ["activity.form_submission", "updated"], readonly ["activity.form_submission", "deleted"], readonly ["activity.lead_status_change", "created"], readonly ["activity.lead_status_change", "updated"], readonly ["activity.lead_status_change", "deleted"], readonly ["activity.opportunity_status_change", "created"], readonly ["activity.opportunity_status_change", "updated"], readonly ["activity.opportunity_status_change", "deleted"], readonly ["activity.task_completed", "created"], readonly ["activity.task_completed", "deleted"], readonly ["activity.lead_merge", "created"], readonly ["activity.lead_merge", "updated"], readonly ["activity.lead_merge", "deleted"], readonly ["import", "created"], readonly ["import", "updated"], readonly ["import", "completed"], readonly ["import", "reverting"], readonly ["import", "reverted"], readonly ["export.lead", "created"], readonly ["export.lead", "updated"], readonly ["export.lead", "completed"], readonly ["export.opportunity", "created"], readonly ["export.opportunity", "updated"], readonly ["export.opportunity", "completed"], readonly ["bulk_action.delete", "created"], readonly ["bulk_action.delete", "updated"], readonly ["bulk_action.delete", "completed"], readonly ["bulk_action.delete", "paused"], readonly ["bulk_action.edit", "created"], readonly ["bulk_action.edit", "updated"], readonly ["bulk_action.edit", "completed"], readonly ["bulk_action.edit", "paused"], readonly ["bulk_action.email", "created"], readonly ["bulk_action.email", "updated"], readonly ["bulk_action.email", "completed"], readonly ["bulk_action.email", "paused"], readonly ["bulk_action.sequence_subscription", "created"], readonly ["bulk_action.sequence_subscription", "updated"], readonly ["bulk_action.sequence_subscription", "completed"], readonly ["bulk_action.sequence_subscription", "paused"], readonly ["custom_fields.lead", "created"], readonly ["custom_fields.lead", "updated"], readonly ["custom_fields.lead", "deleted"], readonly ["custom_fields.contact", "created"], readonly ["custom_fields.contact", "updated"], readonly ["custom_fields.contact", "deleted"], readonly ["custom_fields.opportunity", "created"], readonly ["custom_fields.opportunity", "updated"], readonly ["custom_fields.opportunity", "deleted"], readonly ["custom_fields.activity", "created"], readonly ["custom_fields.activity", "updated"], readonly ["custom_fields.activity", "deleted"], readonly ["custom_fields.custom_object", "created"], readonly ["custom_fields.custom_object", "updated"], readonly ["custom_fields.custom_object", "deleted"], readonly ["custom_fields.shared", "created"], readonly ["custom_fields.shared", "updated"], readonly ["custom_fields.shared", "deleted"], readonly ["custom_activity_type", "created"], readonly ["custom_activity_type", "updated"], readonly ["custom_activity_type", "deleted"], readonly ["activity.custom_activity", "created"], readonly ["activity.custom_activity", "updated"], readonly ["activity.custom_activity", "deleted"], readonly ["custom_object_type", "created"], readonly ["custom_object_type", "updated"], readonly ["custom_object_type", "deleted"], readonly ["custom_object", "created"], readonly ["custom_object", "updated"], readonly ["custom_object", "deleted"], readonly ["status.lead", "created"], readonly ["status.lead", "updated"], readonly ["status.lead", "deleted"], readonly ["status.opportunity", "created"], readonly ["status.opportunity", "updated"], readonly ["status.opportunity", "deleted"], readonly ["membership", "activated"], readonly ["membership", "deactivated"], readonly ["group", "created"], readonly ["group", "updated"], readonly ["group", "deleted"], readonly ["saved_search", "created"], readonly ["saved_search", "updated"], readonly ["phone_number", "created"], readonly ["phone_number", "updated"], readonly ["phone_number", "deleted"], readonly ["email_template", "created"], readonly ["email_template", "updated"], readonly ["email_template", "deleted"], readonly ["sms_template", "created"], readonly ["sms_template", "updated"], readonly ["sms_template", "deleted"], readonly ["sequence", "created"], readonly ["sequence", "updated"], readonly ["sequence", "deleted"], readonly ["sequence_subscription", "created"], readonly ["sequence_subscription", "updated"], readonly ["sequence_subscription", "deleted"], readonly ["comment", "created"], readonly ["comment", "updated"], readonly ["comment", "deleted"], readonly ["comment_thread", "created"], readonly ["comment_thread", "updated"], readonly ["comment_thread", "deleted"]];
2
+ /**
3
+ * Object-action pairs accepted by Close's webhook subscription API.
4
+ *
5
+ * Close's Event Log also documents `activity.lead_merge` and
6
+ * `comment_thread.updated`, but the webhook subscription API rejects them.
7
+ */
8
+ export declare const CLOSE_WEBHOOK_EVENT_SELECTIONS: readonly [readonly ["lead", "created"], readonly ["lead", "updated"], readonly ["lead", "deleted"], readonly ["lead", "merged"], readonly ["contact", "created"], readonly ["contact", "updated"], readonly ["contact", "deleted"], readonly ["opportunity", "created"], readonly ["opportunity", "updated"], readonly ["opportunity", "deleted"], readonly ["task.lead", "created"], readonly ["task.lead", "updated"], readonly ["task.lead", "deleted"], readonly ["task.lead", "completed"], readonly ["task.incoming_email", "created"], readonly ["task.incoming_email", "updated"], readonly ["task.incoming_email", "deleted"], readonly ["task.incoming_email", "completed"], readonly ["task.email_followup", "created"], readonly ["task.email_followup", "updated"], readonly ["task.email_followup", "deleted"], readonly ["task.email_followup", "completed"], readonly ["task.missed_call", "created"], readonly ["task.missed_call", "updated"], readonly ["task.missed_call", "deleted"], readonly ["task.missed_call", "completed"], readonly ["task.answered_detached_call", "created"], readonly ["task.answered_detached_call", "updated"], readonly ["task.answered_detached_call", "deleted"], readonly ["task.answered_detached_call", "completed"], readonly ["task.voicemail", "created"], readonly ["task.voicemail", "updated"], readonly ["task.voicemail", "deleted"], readonly ["task.voicemail", "completed"], readonly ["task.opportunity_due", "created"], readonly ["task.opportunity_due", "updated"], readonly ["task.opportunity_due", "deleted"], readonly ["task.opportunity_due", "completed"], readonly ["task.incoming_sms", "created"], readonly ["task.incoming_sms", "updated"], readonly ["task.incoming_sms", "deleted"], readonly ["task.incoming_sms", "completed"], readonly ["task.outbound_call", "created"], readonly ["task.outbound_call", "updated"], readonly ["task.outbound_call", "deleted"], readonly ["task.outbound_call", "completed"], readonly ["activity.email", "created"], readonly ["activity.email", "updated"], readonly ["activity.email", "deleted"], readonly ["activity.email", "sent"], readonly ["activity.email_thread", "created"], readonly ["activity.email_thread", "updated"], readonly ["activity.email_thread", "deleted"], readonly ["unsubscribed_email", "created"], readonly ["unsubscribed_email", "deleted"], readonly ["activity.call", "created"], readonly ["activity.call", "updated"], readonly ["activity.call", "deleted"], readonly ["activity.call", "answered"], readonly ["activity.call", "completed"], readonly ["activity.sms", "created"], readonly ["activity.sms", "updated"], readonly ["activity.sms", "deleted"], readonly ["activity.sms", "sent"], readonly ["activity.whatsapp_message", "created"], readonly ["activity.whatsapp_message", "updated"], readonly ["activity.whatsapp_message", "deleted"], readonly ["activity.note", "created"], readonly ["activity.note", "updated"], readonly ["activity.note", "deleted"], readonly ["activity.meeting", "created"], readonly ["activity.meeting", "updated"], readonly ["activity.meeting", "deleted"], readonly ["activity.meeting", "scheduled"], readonly ["activity.meeting", "started"], readonly ["activity.meeting", "completed"], readonly ["activity.meeting", "canceled"], readonly ["activity.form_submission", "created"], readonly ["activity.form_submission", "updated"], readonly ["activity.form_submission", "deleted"], readonly ["activity.lead_status_change", "created"], readonly ["activity.lead_status_change", "updated"], readonly ["activity.lead_status_change", "deleted"], readonly ["activity.opportunity_status_change", "created"], readonly ["activity.opportunity_status_change", "updated"], readonly ["activity.opportunity_status_change", "deleted"], readonly ["activity.task_completed", "created"], readonly ["activity.task_completed", "deleted"], readonly ["import", "created"], readonly ["import", "updated"], readonly ["import", "completed"], readonly ["import", "reverting"], readonly ["import", "reverted"], readonly ["export.lead", "created"], readonly ["export.lead", "updated"], readonly ["export.lead", "completed"], readonly ["export.opportunity", "created"], readonly ["export.opportunity", "updated"], readonly ["export.opportunity", "completed"], readonly ["bulk_action.delete", "created"], readonly ["bulk_action.delete", "updated"], readonly ["bulk_action.delete", "completed"], readonly ["bulk_action.delete", "paused"], readonly ["bulk_action.edit", "created"], readonly ["bulk_action.edit", "updated"], readonly ["bulk_action.edit", "completed"], readonly ["bulk_action.edit", "paused"], readonly ["bulk_action.email", "created"], readonly ["bulk_action.email", "updated"], readonly ["bulk_action.email", "completed"], readonly ["bulk_action.email", "paused"], readonly ["bulk_action.sequence_subscription", "created"], readonly ["bulk_action.sequence_subscription", "updated"], readonly ["bulk_action.sequence_subscription", "completed"], readonly ["bulk_action.sequence_subscription", "paused"], readonly ["custom_fields.lead", "created"], readonly ["custom_fields.lead", "updated"], readonly ["custom_fields.lead", "deleted"], readonly ["custom_fields.contact", "created"], readonly ["custom_fields.contact", "updated"], readonly ["custom_fields.contact", "deleted"], readonly ["custom_fields.opportunity", "created"], readonly ["custom_fields.opportunity", "updated"], readonly ["custom_fields.opportunity", "deleted"], readonly ["custom_fields.activity", "created"], readonly ["custom_fields.activity", "updated"], readonly ["custom_fields.activity", "deleted"], readonly ["custom_fields.custom_object", "created"], readonly ["custom_fields.custom_object", "updated"], readonly ["custom_fields.custom_object", "deleted"], readonly ["custom_fields.shared", "created"], readonly ["custom_fields.shared", "updated"], readonly ["custom_fields.shared", "deleted"], readonly ["custom_activity_type", "created"], readonly ["custom_activity_type", "updated"], readonly ["custom_activity_type", "deleted"], readonly ["activity.custom_activity", "created"], readonly ["activity.custom_activity", "updated"], readonly ["activity.custom_activity", "deleted"], readonly ["custom_object_type", "created"], readonly ["custom_object_type", "updated"], readonly ["custom_object_type", "deleted"], readonly ["custom_object", "created"], readonly ["custom_object", "updated"], readonly ["custom_object", "deleted"], readonly ["status.lead", "created"], readonly ["status.lead", "updated"], readonly ["status.lead", "deleted"], readonly ["status.opportunity", "created"], readonly ["status.opportunity", "updated"], readonly ["status.opportunity", "deleted"], readonly ["membership", "activated"], readonly ["membership", "deactivated"], readonly ["group", "created"], readonly ["group", "updated"], readonly ["group", "deleted"], readonly ["saved_search", "created"], readonly ["saved_search", "updated"], readonly ["phone_number", "created"], readonly ["phone_number", "updated"], readonly ["phone_number", "deleted"], readonly ["email_template", "created"], readonly ["email_template", "updated"], readonly ["email_template", "deleted"], readonly ["sms_template", "created"], readonly ["sms_template", "updated"], readonly ["sms_template", "deleted"], readonly ["sequence", "created"], readonly ["sequence", "updated"], readonly ["sequence", "deleted"], readonly ["sequence_subscription", "created"], readonly ["sequence_subscription", "updated"], readonly ["sequence_subscription", "deleted"], readonly ["comment", "created"], readonly ["comment", "updated"], readonly ["comment", "deleted"], readonly ["comment_thread", "created"], readonly ["comment_thread", "deleted"]];
3
9
  export type CloseWebhookEventSelection = (typeof CLOSE_WEBHOOK_EVENT_SELECTIONS)[number];
4
10
  export declare const CLOSE_EVENT_SCHEMA: z.ZodObject<{
5
11
  action: z.ZodString;
@@ -1,6 +1,12 @@
1
1
  import * as z from "zod";
2
2
  import { CLOSE_OBJECT_SCHEMA } from "./api.js";
3
3
  import { CLOSE_CALL_SCHEMA, CLOSE_COMMENT_SCHEMA, CLOSE_DATE_SCHEMA, CLOSE_CONTACT_SCHEMA, CLOSE_EMAIL_SCHEMA, CLOSE_LEAD_SCHEMA, CLOSE_MEETING_SCHEMA, CLOSE_OPPORTUNITY_SCHEMA, CLOSE_SEQUENCE_SUBSCRIPTION_SCHEMA, CLOSE_SMS_SCHEMA, CLOSE_TASK_SCHEMA, } from "./schemas.js";
4
+ /**
5
+ * Object-action pairs accepted by Close's webhook subscription API.
6
+ *
7
+ * Close's Event Log also documents `activity.lead_merge` and
8
+ * `comment_thread.updated`, but the webhook subscription API rejects them.
9
+ */
4
10
  export const CLOSE_WEBHOOK_EVENT_SELECTIONS = [
5
11
  ["lead", "created"],
6
12
  ["lead", "updated"],
@@ -90,9 +96,6 @@ export const CLOSE_WEBHOOK_EVENT_SELECTIONS = [
90
96
  ["activity.opportunity_status_change", "deleted"],
91
97
  ["activity.task_completed", "created"],
92
98
  ["activity.task_completed", "deleted"],
93
- ["activity.lead_merge", "created"],
94
- ["activity.lead_merge", "updated"],
95
- ["activity.lead_merge", "deleted"],
96
99
  ["import", "created"],
97
100
  ["import", "updated"],
98
101
  ["import", "completed"],
@@ -182,7 +185,6 @@ export const CLOSE_WEBHOOK_EVENT_SELECTIONS = [
182
185
  ["comment", "updated"],
183
186
  ["comment", "deleted"],
184
187
  ["comment_thread", "created"],
185
- ["comment_thread", "updated"],
186
188
  ["comment_thread", "deleted"],
187
189
  ];
188
190
  export const CLOSE_EVENT_SCHEMA = z.object({
@@ -662,58 +662,44 @@ export declare const RESEND_CONTACT_TOPIC_SCHEMA: z.ZodObject<{
662
662
  }>;
663
663
  }, z.core.$strip>;
664
664
  export declare const RESEND_CONTACT_SEGMENT_DELETE_WIRE_SCHEMA: z.ZodObject<{
665
- contact_id: z.ZodString;
665
+ audienceId: z.ZodString;
666
666
  deleted: z.ZodBoolean;
667
- object: z.ZodLiteral<"contact_segment">;
668
- segment_id: z.ZodString;
667
+ id: z.ZodString;
669
668
  }, z.core.$strip>;
670
669
  export declare const RESEND_CONTACT_SEGMENT_MUTATION_WIRE_SCHEMA: z.ZodObject<{
671
- contact_id: z.ZodString;
672
- object: z.ZodLiteral<"contact_segment">;
673
- segment_id: z.ZodString;
670
+ audienceId: z.ZodString;
671
+ id: z.ZodString;
674
672
  }, z.core.$strip>;
675
673
  export declare const RESEND_CONTACT_SEGMENT_MUTATION_SCHEMA: z.ZodPipe<z.ZodObject<{
676
- contact_id: z.ZodString;
677
- object: z.ZodLiteral<"contact_segment">;
678
- segment_id: z.ZodString;
674
+ audienceId: z.ZodString;
675
+ id: z.ZodString;
679
676
  }, z.core.$strip>, z.ZodTransform<{
680
677
  contactId: string;
681
- segmentId: string;
682
678
  object: "contact_segment";
679
+ segmentId: string;
683
680
  }, {
684
- contact_id: string;
685
- object: "contact_segment";
686
- segment_id: string;
681
+ audienceId: string;
682
+ id: string;
687
683
  }>>;
688
684
  export declare const RESEND_CONTACT_SEGMENT_DELETE_SCHEMA: z.ZodPipe<z.ZodObject<{
689
- contact_id: z.ZodString;
685
+ audienceId: z.ZodString;
690
686
  deleted: z.ZodBoolean;
691
- object: z.ZodLiteral<"contact_segment">;
692
- segment_id: z.ZodString;
687
+ id: z.ZodString;
693
688
  }, z.core.$strip>, z.ZodTransform<{
694
689
  contactId: string;
690
+ object: "contact_segment";
695
691
  segmentId: string;
696
692
  deleted: boolean;
697
- object: "contact_segment";
698
693
  }, {
699
- contact_id: string;
694
+ audienceId: string;
700
695
  deleted: boolean;
701
- object: "contact_segment";
702
- segment_id: string;
696
+ id: string;
703
697
  }>>;
704
698
  export declare const RESEND_CONTACT_TOPICS_UPDATE_WIRE_SCHEMA: z.ZodObject<{
705
- contact_id: z.ZodString;
706
- object: z.ZodLiteral<"contact_topics">;
707
- topics: z.ZodArray<z.ZodObject<{
708
- id: z.ZodString;
709
- subscription: z.ZodEnum<{
710
- opt_in: "opt_in";
711
- opt_out: "opt_out";
712
- }>;
713
- }, z.core.$strip>>;
699
+ id: z.ZodString;
714
700
  }, z.core.$strip>;
715
- export declare const RESEND_CONTACT_TOPICS_UPDATE_SCHEMA: z.ZodPipe<z.ZodObject<{
716
- contact_id: z.ZodString;
701
+ export declare const RESEND_CONTACT_TOPICS_UPDATE_SCHEMA: z.ZodObject<{
702
+ contactId: z.ZodString;
717
703
  object: z.ZodLiteral<"contact_topics">;
718
704
  topics: z.ZodArray<z.ZodObject<{
719
705
  id: z.ZodString;
@@ -722,21 +708,7 @@ export declare const RESEND_CONTACT_TOPICS_UPDATE_SCHEMA: z.ZodPipe<z.ZodObject<
722
708
  opt_out: "opt_out";
723
709
  }>;
724
710
  }, z.core.$strip>>;
725
- }, z.core.$strip>, z.ZodTransform<{
726
- contactId: string;
727
- object: "contact_topics";
728
- topics: {
729
- id: string;
730
- subscription: "opt_in" | "opt_out";
731
- }[];
732
- }, {
733
- contact_id: string;
734
- object: "contact_topics";
735
- topics: {
736
- id: string;
737
- subscription: "opt_in" | "opt_out";
738
- }[];
739
- }>>;
711
+ }, z.core.$strip>;
740
712
  export declare const RESEND_EVENT_SEND_RESPONSE_SCHEMA: z.ZodObject<{
741
713
  event: z.ZodString;
742
714
  object: z.ZodLiteral<"event">;
@@ -197,28 +197,30 @@ export const RESEND_CONTACT_TOPIC_SCHEMA = z.object({
197
197
  subscription: z.enum(["opt_in", "opt_out"]),
198
198
  });
199
199
  export const RESEND_CONTACT_SEGMENT_DELETE_WIRE_SCHEMA = z.object({
200
- contact_id: z.string(),
200
+ audienceId: z.string(),
201
201
  deleted: z.boolean(),
202
- object: z.literal("contact_segment"),
203
- segment_id: z.string(),
202
+ id: z.string(),
204
203
  });
205
204
  export const RESEND_CONTACT_SEGMENT_MUTATION_WIRE_SCHEMA = z.object({
206
- contact_id: z.string(),
207
- object: z.literal("contact_segment"),
208
- segment_id: z.string(),
205
+ audienceId: z.string(),
206
+ id: z.string(),
209
207
  });
210
- export const RESEND_CONTACT_SEGMENT_MUTATION_SCHEMA = RESEND_CONTACT_SEGMENT_MUTATION_WIRE_SCHEMA.transform(({ contact_id: contactId, segment_id: segmentId, ...result }) => ({
211
- ...result,
208
+ export const RESEND_CONTACT_SEGMENT_MUTATION_SCHEMA = RESEND_CONTACT_SEGMENT_MUTATION_WIRE_SCHEMA.transform(({ audienceId: segmentId, id: contactId }) => ({
212
209
  contactId,
210
+ object: "contact_segment",
213
211
  segmentId,
214
212
  }));
215
- export const RESEND_CONTACT_SEGMENT_DELETE_SCHEMA = RESEND_CONTACT_SEGMENT_DELETE_WIRE_SCHEMA.transform(({ contact_id: contactId, segment_id: segmentId, ...result }) => ({
213
+ export const RESEND_CONTACT_SEGMENT_DELETE_SCHEMA = RESEND_CONTACT_SEGMENT_DELETE_WIRE_SCHEMA.transform(({ audienceId: segmentId, id: contactId, ...result }) => ({
216
214
  ...result,
217
215
  contactId,
216
+ object: "contact_segment",
218
217
  segmentId,
219
218
  }));
220
219
  export const RESEND_CONTACT_TOPICS_UPDATE_WIRE_SCHEMA = z.object({
221
- contact_id: z.string(),
220
+ id: z.string(),
221
+ });
222
+ export const RESEND_CONTACT_TOPICS_UPDATE_SCHEMA = z.object({
223
+ contactId: z.string(),
222
224
  object: z.literal("contact_topics"),
223
225
  topics: z
224
226
  .object({
@@ -227,7 +229,6 @@ export const RESEND_CONTACT_TOPICS_UPDATE_WIRE_SCHEMA = z.object({
227
229
  })
228
230
  .array(),
229
231
  });
230
- export const RESEND_CONTACT_TOPICS_UPDATE_SCHEMA = RESEND_CONTACT_TOPICS_UPDATE_WIRE_SCHEMA.transform(({ contact_id: contactId, ...result }) => ({ ...result, contactId }));
231
232
  export const RESEND_EVENT_SEND_RESPONSE_SCHEMA = z.object({
232
233
  event: z.string(),
233
234
  object: z.literal("event"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/integration-contracts",
3
- "version": "0.99.0",
3
+ "version": "0.99.2",
4
4
  "description": "Shared integration payload contracts and provider primitives for Automate.ax.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -48,7 +48,7 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "@automate.ax/codec": "0.99.0",
51
+ "@automate.ax/codec": "0.99.2",
52
52
  "@cfworker/json-schema": "^4.1.1",
53
53
  "@googleapis/calendar": "^15.0.0",
54
54
  "@googleapis/forms": "^6.0.1",
@@ -14,6 +14,12 @@ import {
14
14
  CLOSE_TASK_SCHEMA,
15
15
  } from "./schemas"
16
16
 
17
+ /**
18
+ * Object-action pairs accepted by Close's webhook subscription API.
19
+ *
20
+ * Close's Event Log also documents `activity.lead_merge` and
21
+ * `comment_thread.updated`, but the webhook subscription API rejects them.
22
+ */
17
23
  export const CLOSE_WEBHOOK_EVENT_SELECTIONS = [
18
24
  ["lead", "created"],
19
25
  ["lead", "updated"],
@@ -103,9 +109,6 @@ export const CLOSE_WEBHOOK_EVENT_SELECTIONS = [
103
109
  ["activity.opportunity_status_change", "deleted"],
104
110
  ["activity.task_completed", "created"],
105
111
  ["activity.task_completed", "deleted"],
106
- ["activity.lead_merge", "created"],
107
- ["activity.lead_merge", "updated"],
108
- ["activity.lead_merge", "deleted"],
109
112
  ["import", "created"],
110
113
  ["import", "updated"],
111
114
  ["import", "completed"],
@@ -195,7 +198,6 @@ export const CLOSE_WEBHOOK_EVENT_SELECTIONS = [
195
198
  ["comment", "updated"],
196
199
  ["comment", "deleted"],
197
200
  ["comment_thread", "created"],
198
- ["comment_thread", "updated"],
199
201
  ["comment_thread", "deleted"],
200
202
  ] as const
201
203
 
@@ -329,38 +329,41 @@ export const RESEND_CONTACT_TOPIC_SCHEMA = z.object({
329
329
  })
330
330
 
331
331
  export const RESEND_CONTACT_SEGMENT_DELETE_WIRE_SCHEMA = z.object({
332
- contact_id: z.string(),
332
+ audienceId: z.string(),
333
333
  deleted: z.boolean(),
334
- object: z.literal("contact_segment"),
335
- segment_id: z.string(),
334
+ id: z.string(),
336
335
  })
337
336
 
338
337
  export const RESEND_CONTACT_SEGMENT_MUTATION_WIRE_SCHEMA = z.object({
339
- contact_id: z.string(),
340
- object: z.literal("contact_segment"),
341
- segment_id: z.string(),
338
+ audienceId: z.string(),
339
+ id: z.string(),
342
340
  })
343
341
 
344
342
  export const RESEND_CONTACT_SEGMENT_MUTATION_SCHEMA =
345
343
  RESEND_CONTACT_SEGMENT_MUTATION_WIRE_SCHEMA.transform(
346
- ({ contact_id: contactId, segment_id: segmentId, ...result }) => ({
347
- ...result,
344
+ ({ audienceId: segmentId, id: contactId }) => ({
348
345
  contactId,
346
+ object: "contact_segment" as const,
349
347
  segmentId,
350
348
  }),
351
349
  )
352
350
 
353
351
  export const RESEND_CONTACT_SEGMENT_DELETE_SCHEMA =
354
352
  RESEND_CONTACT_SEGMENT_DELETE_WIRE_SCHEMA.transform(
355
- ({ contact_id: contactId, segment_id: segmentId, ...result }) => ({
353
+ ({ audienceId: segmentId, id: contactId, ...result }) => ({
356
354
  ...result,
357
355
  contactId,
356
+ object: "contact_segment" as const,
358
357
  segmentId,
359
358
  }),
360
359
  )
361
360
 
362
361
  export const RESEND_CONTACT_TOPICS_UPDATE_WIRE_SCHEMA = z.object({
363
- contact_id: z.string(),
362
+ id: z.string(),
363
+ })
364
+
365
+ export const RESEND_CONTACT_TOPICS_UPDATE_SCHEMA = z.object({
366
+ contactId: z.string(),
364
367
  object: z.literal("contact_topics"),
365
368
  topics: z
366
369
  .object({
@@ -370,11 +373,6 @@ export const RESEND_CONTACT_TOPICS_UPDATE_WIRE_SCHEMA = z.object({
370
373
  .array(),
371
374
  })
372
375
 
373
- export const RESEND_CONTACT_TOPICS_UPDATE_SCHEMA =
374
- RESEND_CONTACT_TOPICS_UPDATE_WIRE_SCHEMA.transform(
375
- ({ contact_id: contactId, ...result }) => ({ ...result, contactId }),
376
- )
377
-
378
376
  export const RESEND_EVENT_SEND_RESPONSE_SCHEMA = z.object({
379
377
  event: z.string(),
380
378
  object: z.literal("event"),