samva 0.1.1 → 0.3.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 (47) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +10 -3
  3. package/dist/client/sdk.gen.d.ts +333 -188
  4. package/dist/client/types.gen.d.ts +1452 -718
  5. package/dist/{client-DVALvDUe.js → client-BOghX8fr.js} +1990 -1631
  6. package/dist/effect/api-keys.d.ts +14 -14
  7. package/dist/effect/api-keys.js +1 -1
  8. package/dist/effect/campaigns.d.ts +233 -861
  9. package/dist/effect/campaigns.js +1 -1
  10. package/dist/effect/categories.d.ts +1 -1
  11. package/dist/effect/client.js +1 -1
  12. package/dist/effect/contacts.d.ts +131 -231
  13. package/dist/effect/contacts.js +1 -1
  14. package/dist/effect/conversations.d.ts +91 -208
  15. package/dist/effect/conversations.js +1 -1
  16. package/dist/effect/design.d.ts +11 -11
  17. package/dist/effect/design.js +1 -1
  18. package/dist/effect/email.d.ts +164 -168
  19. package/dist/effect/email.js +20 -18
  20. package/dist/effect/generated.d.ts +13753 -14935
  21. package/dist/effect/index.d.ts +1 -0
  22. package/dist/effect/index.js +3 -2
  23. package/dist/effect/internal/operation.d.ts +15 -113
  24. package/dist/effect/media.d.ts +80 -0
  25. package/dist/effect/media.js +19 -0
  26. package/dist/effect/messages.d.ts +41 -261
  27. package/dist/effect/messages.js +1 -1
  28. package/dist/effect/operations.d.ts +10 -10
  29. package/dist/effect/operations.js +1 -1
  30. package/dist/effect/organizations.d.ts +24 -42
  31. package/dist/effect/organizations.js +1 -1
  32. package/dist/effect/scheduled-messages.d.ts +43 -502
  33. package/dist/effect/scheduled-messages.js +1 -1
  34. package/dist/effect/templates.d.ts +312 -1542
  35. package/dist/effect/templates.js +26 -18
  36. package/dist/effect/webhooks.d.ts +26 -27
  37. package/dist/effect/webhooks.js +2 -2
  38. package/dist/index.js +1 -1
  39. package/dist/{normalize-LkWl4HUF.js → normalize-BKFjbR9t.js} +5 -13
  40. package/dist/normalize.d.ts +3 -33
  41. package/dist/{operation-UtKNITtG.js → operation-C2Q4cFJL.js} +67 -26
  42. package/dist/promises/index.d.ts +6 -14
  43. package/dist/promises/index.js +1 -1
  44. package/dist/promises/types.gen.d.ts +1 -1
  45. package/dist/{promises-QxEfMTho.js → promises-oiy7mOyu.js} +680 -157
  46. package/dist/service-map.d.ts +92 -40
  47. package/package.json +19 -14
@@ -27,88 +27,139 @@ const AbsoluteInstant = Schema.String.check(Schema.isPattern(ABSOLUTE_ISO_INSTAN
27
27
  //#endregion
28
28
  //#region src/effect/generated.ts
29
29
  const JsonValue = Schema$1.suspend(() => __recursive_JsonValue);
30
- const ActorId = Schema$1.String.pipe(Schema$1.brand("ActorId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^actor_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
31
- expected: "a string matching the RegExp ^actor_[0-9a-hjkmnp-tv-z]{16,24}$",
32
- identifier: "ActorId"
33
- }));
34
- const ApiKeyId = Schema$1.String.pipe(Schema$1.brand("ApiKeyId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^key_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
35
- expected: "a string matching the RegExp ^key_[0-9a-hjkmnp-tv-z]{16,24}$",
36
- identifier: "ApiKeyId"
37
- }));
38
- const Objects_ = Schema$1.Record(Schema$1.String, Schema$1.Array(Schema$1.String));
39
- const AttachmentId = Schema$1.String.pipe(Schema$1.brand("AttachmentId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
40
- expected: "a string matching the RegExp ^att_[0-9a-hjkmnp-tv-z]{16,24}$",
41
- identifier: "AttachmentId"
42
- }));
43
- var BillingProviderError = class extends Schema$1.TaggedErrorClass()("BillingProviderError", Schema$1.Struct({
30
+ const ApiKeyPermissions = Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.Array(Schema$1.String)), Schema$1.Null]).annotate({ identifier: "ApiKeyPermissions" });
31
+ const PaginationMeta = Schema$1.Struct({
32
+ page: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
33
+ limit: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
34
+ total: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
35
+ totalPages: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
36
+ }).annotate({ identifier: "PaginationMeta" });
37
+ var UnauthorizedError = class extends Schema$1.TaggedError()("UnauthorizedError", Schema$1.Struct({
44
38
  operation: Schema$1.String,
45
39
  message: Schema$1.String
46
40
  })) {};
47
- const BlockedEmailId = Schema$1.String.pipe(Schema$1.brand("BlockedEmailId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^blk_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
48
- expected: "a string matching the RegExp ^blk_[0-9a-hjkmnp-tv-z]{16,24}$",
49
- identifier: "BlockedEmailId"
50
- }));
51
- const BlockedEmailLogId = Schema$1.String.pipe(Schema$1.brand("BlockedEmailLogId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^blklog_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
52
- expected: "a string matching the RegExp ^blklog_[0-9a-hjkmnp-tv-z]{16,24}$",
53
- identifier: "BlockedEmailLogId"
41
+ var ForbiddenError = class extends Schema$1.TaggedError()("ForbiddenError", Schema$1.Struct({
42
+ operation: Schema$1.String,
43
+ message: Schema$1.String
44
+ })) {};
45
+ var InternalError = class extends Schema$1.TaggedError()("InternalError", Schema$1.Struct({
46
+ operation: Schema$1.String,
47
+ message: Schema$1.String
48
+ })) {};
49
+ var PaymentRequiredError = class extends Schema$1.TaggedError()("PaymentRequiredError", Schema$1.Struct({
50
+ operation: Schema$1.String,
51
+ resource: Schema$1.String,
52
+ currentUsage: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
53
+ limit: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
54
+ })) {};
55
+ var ResourceNotFoundError = class extends Schema$1.TaggedError()("ResourceNotFoundError", Schema$1.Struct({
56
+ operation: Schema$1.String,
57
+ resource: Schema$1.String,
58
+ id: Schema$1.String
59
+ })) {};
60
+ var ValidationError = class extends Schema$1.TaggedError()("ValidationError", Schema$1.Struct({
61
+ operation: Schema$1.String,
62
+ message: Schema$1.String,
63
+ fields: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.Array(Schema$1.String)), Schema$1.Null]))
64
+ })) {};
65
+ var BillingProviderError = class extends Schema$1.TaggedError()("BillingProviderError", Schema$1.Struct({
66
+ operation: Schema$1.String,
67
+ message: Schema$1.String
68
+ })) {};
69
+ const ApiKeyId = Schema$1.String.pipe(Schema$1.brand("ApiKeyId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^key_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
70
+ expected: "a string matching the RegExp ^key_[0-9a-hjkmnp-tv-z]{16,24}$",
71
+ identifier: "ApiKeyId"
54
72
  }));
55
- const BrandedTrackingDnsRecord = Schema$1.Struct({
56
- name: Schema$1.String,
57
- type: Schema$1.String,
58
- value: Schema$1.String
59
- }).annotate({ identifier: "BrandedTrackingDnsRecord" });
60
- const BulkUpdateResult = Schema$1.Struct({
61
- updated: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
62
- failed: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
63
- }).annotate({ identifier: "BulkUpdateResult" });
64
- const Objects_1 = Schema$1.Record(Schema$1.String, JsonValue);
73
+ const SuccessResponse = Schema$1.Struct({ success: Schema$1.Boolean }).annotate({ identifier: "SuccessResponse" });
65
74
  const CampaignId = Schema$1.String.pipe(Schema$1.brand("CampaignId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^camp_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
66
75
  expected: "a string matching the RegExp ^camp_[0-9a-hjkmnp-tv-z]{16,24}$",
67
76
  identifier: "CampaignId"
68
77
  }));
69
- const CampaignRecipientId = Schema$1.String.pipe(Schema$1.brand("CampaignRecipientId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^crcpt_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
70
- expected: "a string matching the RegExp ^crcpt_[0-9a-hjkmnp-tv-z]{16,24}$",
71
- identifier: "CampaignRecipientId"
78
+ const MediaId = Schema$1.String.pipe(Schema$1.brand("MediaId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^media_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
79
+ expected: "a string matching the RegExp ^media_[0-9a-hjkmnp-tv-z]{16,24}$",
80
+ identifier: "MediaId"
81
+ }));
82
+ const TemplateId = Schema$1.String.pipe(Schema$1.brand("TemplateId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
83
+ expected: "a string matching the RegExp ^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$",
84
+ identifier: "TemplateId"
85
+ }));
86
+ const JsonObject = Schema$1.Record(Schema$1.String, JsonValue).annotate({ identifier: "JsonObject" });
87
+ const MessageId = Schema$1.String.pipe(Schema$1.brand("MessageId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^msg_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
88
+ expected: "a string matching the RegExp ^msg_[0-9a-hjkmnp-tv-z]{16,24}$",
89
+ identifier: "MessageId"
90
+ }));
91
+ const ReplyToAddresses = Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]), Schema$1.Null]).annotate({ identifier: "ReplyToAddresses" });
92
+ const UnsubscribeId = Schema$1.String.pipe(Schema$1.brand("UnsubscribeId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^unsub_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
93
+ expected: "a string matching the RegExp ^unsub_[0-9a-hjkmnp-tv-z]{16,24}$",
94
+ identifier: "UnsubscribeId"
95
+ }));
96
+ const EmailTrackingOverrideV1 = Schema$1.Struct({
97
+ opens: Schema$1.optionalKey(Schema$1.Boolean.annotate({ description: "Override open tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking." })),
98
+ clicks: Schema$1.optionalKey(Schema$1.Boolean.annotate({ description: "Override click tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking." }))
99
+ }).annotate({
100
+ description: "Requested per-send engagement tracking policy. Recipient opt-out takes precedence, then explicit fields, organization defaults, and product defaults.",
101
+ identifier: "EmailTrackingOverrideV1"
102
+ });
103
+ const EmailFooterOverride = Schema$1.Struct({ enabled: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])) }).annotate({ identifier: "EmailFooterOverride" });
104
+ const ConversationId = Schema$1.String.pipe(Schema$1.brand("ConversationId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^conv_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
105
+ expected: "a string matching the RegExp ^conv_[0-9a-hjkmnp-tv-z]{16,24}$",
106
+ identifier: "ConversationId"
107
+ }));
108
+ const CampaignContentMetadata = Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]).annotate({ identifier: "CampaignContentMetadata" });
109
+ const ContactId = Schema$1.String.pipe(Schema$1.brand("ContactId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^contact_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
110
+ expected: "a string matching the RegExp ^contact_[0-9a-hjkmnp-tv-z]{16,24}$",
111
+ identifier: "ContactId"
112
+ }));
113
+ const ContactGroupId = Schema$1.String.pipe(Schema$1.brand("ContactGroupId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
114
+ expected: "a string matching the RegExp ^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$",
115
+ identifier: "ContactGroupId"
72
116
  }));
117
+ const CampaignDefinitionSummary = Schema$1.Struct({
118
+ state: Schema$1.Literals([
119
+ "editable",
120
+ "frozen",
121
+ "archived"
122
+ ]),
123
+ frozenAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
124
+ }).annotate({ identifier: "CampaignDefinitionSummary" });
73
125
  const CampaignRunId = Schema$1.String.pipe(Schema$1.brand("CampaignRunId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^crun_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
74
126
  expected: "a string matching the RegExp ^crun_[0-9a-hjkmnp-tv-z]{16,24}$",
75
127
  identifier: "CampaignRunId"
76
128
  }));
77
- var ConflictError = class extends Schema$1.TaggedErrorClass()("ConflictError", Schema$1.Struct({
129
+ var FlagDisabledError = class extends Schema$1.TaggedError()("FlagDisabledError", Schema$1.Struct({
130
+ operation: Schema$1.String,
131
+ flag: Schema$1.String
132
+ })) {};
133
+ var ConflictError = class extends Schema$1.TaggedError()("ConflictError", Schema$1.Struct({
78
134
  operation: Schema$1.String,
79
135
  message: Schema$1.String,
80
136
  resource: Schema$1.String,
81
137
  id: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
82
138
  })) {};
83
- const ContactGroupId = Schema$1.String.pipe(Schema$1.brand("ContactGroupId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
84
- expected: "a string matching the RegExp ^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$",
85
- identifier: "ContactGroupId"
139
+ var ExternalServiceError = class extends Schema$1.TaggedError()("ExternalServiceError", Schema$1.Struct({
140
+ operation: Schema$1.String,
141
+ message: Schema$1.String
142
+ })) {};
143
+ const CampaignRecipientId = Schema$1.String.pipe(Schema$1.brand("CampaignRecipientId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^crcpt_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
144
+ expected: "a string matching the RegExp ^crcpt_[0-9a-hjkmnp-tv-z]{16,24}$",
145
+ identifier: "CampaignRecipientId"
86
146
  }));
87
- const ContactId = Schema$1.String.pipe(Schema$1.brand("ContactId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^contact_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
88
- expected: "a string matching the RegExp ^contact_[0-9a-hjkmnp-tv-z]{16,24}$",
89
- identifier: "ContactId"
147
+ const OrganizationId = Schema$1.String.pipe(Schema$1.brand("OrganizationId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^org_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
148
+ expected: "a string matching the RegExp ^org_[0-9a-hjkmnp-tv-z]{16,24}$",
149
+ identifier: "OrganizationId"
90
150
  }));
91
151
  const ContactIdentity = Schema$1.Struct({
92
- channel: Schema$1.Literals([
93
- "sms",
94
- "whatsapp",
95
- "email"
96
- ]),
152
+ channel: Schema$1.Literal("email"),
97
153
  identifier: Schema$1.String,
98
154
  verified: Schema$1.Boolean
99
155
  }).annotate({ identifier: "ContactIdentity" });
156
+ const UnknownRecord = Schema$1.Record(Schema$1.String, JsonValue).annotate({ identifier: "UnknownRecord" });
100
157
  const ContactPreferences = Schema$1.Struct({
101
- preferredChannels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literals([
102
- "sms",
103
- "whatsapp",
104
- "email"
105
- ])), Schema$1.Null])),
158
+ preferredChannels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")), Schema$1.Null])),
106
159
  language: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
107
160
  timezone: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
108
161
  notifications: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
109
162
  email: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
110
- sms: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
111
- whatsapp: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
112
163
  quiet_hours: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
113
164
  start: Schema$1.String,
114
165
  end: Schema$1.String
@@ -120,9 +171,17 @@ const ContactPreferences = Schema$1.Struct({
120
171
  maxMessageLength: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]))
121
172
  }), Schema$1.Null]))
122
173
  }).annotate({ identifier: "ContactPreferences" });
123
- const ConversationId = Schema$1.String.pipe(Schema$1.brand("ConversationId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^conv_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
124
- expected: "a string matching the RegExp ^conv_[0-9a-hjkmnp-tv-z]{16,24}$",
125
- identifier: "ConversationId"
174
+ const ContactActivitySummary = Schema$1.Struct({
175
+ totalInteractions: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
176
+ lastActiveAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
177
+ }).annotate({ identifier: "ContactActivitySummary" });
178
+ const BulkUpdateResult = Schema$1.Struct({
179
+ updated: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
180
+ failed: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
181
+ }).annotate({ identifier: "BulkUpdateResult" });
182
+ const ActorId = Schema$1.String.pipe(Schema$1.brand("ActorId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^actor_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
183
+ expected: "a string matching the RegExp ^actor_[0-9a-hjkmnp-tv-z]{16,24}$",
184
+ identifier: "ActorId"
126
185
  }));
127
186
  const ConversationMetrics = Schema$1.Struct({
128
187
  messageCount: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
@@ -132,43 +191,42 @@ const ConversationMetrics = Schema$1.Struct({
132
191
  channelSwitches: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
133
192
  channelDistribution: Schema$1.Record(Schema$1.String, Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })))
134
193
  }).annotate({ identifier: "ConversationMetrics" });
135
- const CreateWebhookPayload = Schema$1.Struct({
136
- name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })),
137
- url: Schema$1.String,
138
- eventTypes: Schema$1.Array(Schema$1.Literals([
139
- "message.sent",
140
- "message.delivered",
141
- "message.read",
142
- "message.failed",
143
- "message.bounced",
144
- "message.complained",
145
- "message.received",
146
- "contact.created",
147
- "contact.updated",
148
- "contact.deleted",
149
- "conversation.started",
150
- "conversation.ended",
151
- "conversation.created",
152
- "conversation.updated",
153
- "conversation.archived",
154
- "template.created",
155
- "template.updated",
156
- "template.deleted",
157
- "template.approved",
158
- "template.rejected",
159
- "webhook.created",
160
- "webhook.updated",
161
- "webhook.deleted",
162
- "webhook.test"
163
- ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
164
- channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literals([
165
- "sms",
166
- "whatsapp",
167
- "email"
168
- ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
169
- headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])),
170
- status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals(["active", "disabled"]), Schema$1.Null]))
171
- }).annotate({ identifier: "CreateWebhookPayload" });
194
+ const MessageContact = Schema$1.Struct({
195
+ id: Schema$1.String,
196
+ name: Schema$1.String,
197
+ displayName: Schema$1.Union([Schema$1.String, Schema$1.Null]),
198
+ type: Schema$1.String,
199
+ identities: Schema$1.Array(Schema$1.Struct({
200
+ channel: Schema$1.Literal("email"),
201
+ identifier: Schema$1.String,
202
+ verified: Schema$1.Boolean
203
+ }))
204
+ }).annotate({ identifier: "MessageContact" });
205
+ const ThemeColors = Schema$1.Record(Schema$1.String, Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^#[0-9a-f]{6}$")).annotate({ expected: "a string matching the RegExp ^#[0-9a-f]{6}$" }))).annotate({ identifier: "ThemeColors" });
206
+ const BlockedEmailId = Schema$1.String.pipe(Schema$1.brand("BlockedEmailId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^blk_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
207
+ expected: "a string matching the RegExp ^blk_[0-9a-hjkmnp-tv-z]{16,24}$",
208
+ identifier: "BlockedEmailId"
209
+ }));
210
+ const SuccessResult = Schema$1.Struct({
211
+ success: Schema$1.Boolean,
212
+ message: Schema$1.String
213
+ }).annotate({ identifier: "SuccessResult" });
214
+ const BlockedEmailLogId = Schema$1.String.pipe(Schema$1.brand("BlockedEmailLogId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^blklog_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
215
+ expected: "a string matching the RegExp ^blklog_[0-9a-hjkmnp-tv-z]{16,24}$",
216
+ identifier: "BlockedEmailLogId"
217
+ }));
218
+ const EmailDomainId = Schema$1.String.pipe(Schema$1.brand("EmailDomainId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^dom_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
219
+ expected: "a string matching the RegExp ^dom_[0-9a-hjkmnp-tv-z]{16,24}$",
220
+ identifier: "EmailDomainId"
221
+ }));
222
+ const WebhookEndpointId = Schema$1.String.pipe(Schema$1.brand("WebhookEndpointId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^wep_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
223
+ expected: "a string matching the RegExp ^wep_[0-9a-hjkmnp-tv-z]{16,24}$",
224
+ identifier: "WebhookEndpointId"
225
+ }));
226
+ const EmailSenderId = Schema$1.String.pipe(Schema$1.brand("EmailSenderId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^sender_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
227
+ expected: "a string matching the RegExp ^sender_[0-9a-hjkmnp-tv-z]{16,24}$",
228
+ identifier: "EmailSenderId"
229
+ }));
172
230
  const DeliverabilityFacts = Schema$1.Struct({
173
231
  bounceRate: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })),
174
232
  complaintRate: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })),
@@ -179,18 +237,7 @@ const DeliverabilityFacts = Schema$1.Struct({
179
237
  "unknown"
180
238
  ])
181
239
  }).annotate({ identifier: "DeliverabilityFacts" });
182
- const EmailAddress = Schema$1.Struct({
183
- email: Schema$1.String,
184
- name: Schema$1.Union([Schema$1.String, Schema$1.Null])
185
- }).annotate({ identifier: "EmailAddress" });
186
- const Arrays_ = Schema$1.Array(Schema$1.Struct({
187
- filename: Schema$1.String,
188
- content: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
189
- url: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
190
- contentType: Schema$1.String,
191
- size: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
192
- }));
193
- var EmailChannelError = class extends Schema$1.TaggedErrorClass()("EmailChannelError", Schema$1.Struct({
240
+ var EmailChannelError = class extends Schema$1.TaggedError()("EmailChannelError", Schema$1.Struct({
194
241
  operation: Schema$1.String,
195
242
  reason: Schema$1.Literals([
196
243
  "transport",
@@ -201,166 +248,125 @@ var EmailChannelError = class extends Schema$1.TaggedErrorClass()("EmailChannelE
201
248
  message: Schema$1.String,
202
249
  statusCode: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })), Schema$1.Null]))
203
250
  })) {};
204
- const EmailDomainId = Schema$1.String.pipe(Schema$1.brand("EmailDomainId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^dom_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
205
- expected: "a string matching the RegExp ^dom_[0-9a-hjkmnp-tv-z]{16,24}$",
206
- identifier: "EmailDomainId"
251
+ const CustomTrackingDnsRecord = Schema$1.Struct({
252
+ name: Schema$1.String,
253
+ type: Schema$1.String,
254
+ value: Schema$1.String
255
+ }).annotate({ identifier: "CustomTrackingDnsRecord" });
256
+ const DomainConnectEligibility = Schema$1.Union([Schema$1.Struct({
257
+ eligible: Schema$1.Literal(false),
258
+ reason: Schema$1.Literals([
259
+ "no-record",
260
+ "no-settings",
261
+ "no-sync",
262
+ "no-template",
263
+ "unavailable"
264
+ ])
265
+ }), Schema$1.Struct({
266
+ eligible: Schema$1.Literal(true),
267
+ providerName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
268
+ })]).annotate({ identifier: "DomainConnectEligibility" });
269
+ const DomainConnectApplyUrlResult = Schema$1.Struct({ url: Schema$1.String }).annotate({ identifier: "DomainConnectApplyUrlResult" });
270
+ const CustomTrackingDomainConnectCompleteResult = Schema$1.Struct({ status: Schema$1.Literals([
271
+ "applied",
272
+ "cancelled",
273
+ "stale",
274
+ "invalid"
275
+ ]) }).annotate({ identifier: "CustomTrackingDomainConnectCompleteResult" });
276
+ const DomainConnectCompleteResult = Schema$1.Struct({ status: Schema$1.Literals([
277
+ "applied",
278
+ "cancelled",
279
+ "invalid"
280
+ ]) }).annotate({ identifier: "DomainConnectCompleteResult" });
281
+ const OperationId = Schema$1.String.pipe(Schema$1.brand("OperationId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^op_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
282
+ expected: "a string matching the RegExp ^op_[0-9a-hjkmnp-tv-z]{16,24}$",
283
+ identifier: "OperationId"
207
284
  }));
208
- const EmailDomainVerificationStatusResponse = Schema$1.Struct({
209
- domain: Schema$1.String,
210
- isVerified: Schema$1.Boolean,
211
- verificationStatus: Schema$1.String,
212
- mailFromStatus: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
213
- }).annotate({ identifier: "EmailDomainVerificationStatusResponse" });
214
- const EmailFooterOverride = Schema$1.Struct({ enabled: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])) }).annotate({ identifier: "EmailFooterOverride" });
285
+ var RateLimitedError = class extends Schema$1.TaggedError()("RateLimitedError", Schema$1.Struct({
286
+ operation: Schema$1.String,
287
+ retryAfterSeconds: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
288
+ })) {};
215
289
  const EmailForwardingRuleId = Schema$1.String.pipe(Schema$1.brand("EmailForwardingRuleId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^fwd_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
216
290
  expected: "a string matching the RegExp ^fwd_[0-9a-hjkmnp-tv-z]{16,24}$",
217
291
  identifier: "EmailForwardingRuleId"
218
292
  }));
219
- const Objects_2 = Schema$1.Struct({
220
- email: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
221
- name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
222
- });
223
- const EmailSenderId = Schema$1.String.pipe(Schema$1.brand("EmailSenderId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^sender_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
224
- expected: "a string matching the RegExp ^sender_[0-9a-hjkmnp-tv-z]{16,24}$",
225
- identifier: "EmailSenderId"
293
+ const ForwardingConditions = Schema$1.Struct({
294
+ subjectContains: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
295
+ fromContains: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
296
+ hasAttachments: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null]))
297
+ }).annotate({ identifier: "ForwardingConditions" });
298
+ const SuppressionId = Schema$1.String.pipe(Schema$1.brand("SuppressionId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^supp_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
299
+ expected: "a string matching the RegExp ^supp_[0-9a-hjkmnp-tv-z]{16,24}$",
300
+ identifier: "SuppressionId"
226
301
  }));
227
302
  const EmailTrackingDefaults = Schema$1.Struct({
228
303
  opens: Schema$1.Boolean,
229
304
  clicks: Schema$1.Boolean
230
305
  }).annotate({ identifier: "EmailTrackingDefaults" });
231
- const EmailTrackingOverrideV1 = Schema$1.Struct({
232
- opens: Schema$1.optionalKey(Schema$1.Boolean.annotate({ description: "Override open tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking." })),
233
- clicks: Schema$1.optionalKey(Schema$1.Boolean.annotate({ description: "Override click tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking." }))
234
- }).annotate({
235
- description: "Requested per-send engagement tracking policy. Recipient opt-out takes precedence, then explicit fields, organization defaults, and product defaults.",
236
- identifier: "EmailTrackingOverrideV1"
237
- });
238
- var ExternalServiceError = class extends Schema$1.TaggedErrorClass()("ExternalServiceError", Schema$1.Struct({
306
+ const TrackingRecipientEmail = Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$")).annotate({
307
+ expected: "a string matching the RegExp ^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
308
+ identifier: "TrackingRecipientEmail"
309
+ }));
310
+ const MediaUploadInstruction = Schema$1.Struct({
311
+ url: Schema$1.String,
312
+ method: Schema$1.Literal("PUT"),
313
+ headers: Schema$1.Record(Schema$1.String, Schema$1.String),
314
+ expiresAt: Schema$1.String
315
+ }).annotate({ identifier: "MediaUploadInstruction" });
316
+ const MediaDownloadUrl = Schema$1.Struct({
317
+ url: Schema$1.String,
318
+ expiresAt: Schema$1.String
319
+ }).annotate({ identifier: "MediaDownloadUrl" });
320
+ const MessageMetadata = Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]).annotate({ identifier: "MessageMetadata" });
321
+ const EmailSender = Schema$1.Union([Schema$1.Struct({
322
+ email: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
323
+ name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
324
+ }), Schema$1.Null]).annotate({ identifier: "EmailSender" });
325
+ var WebhookEnqueueError = class extends Schema$1.TaggedError()("WebhookEnqueueError", Schema$1.Struct({
239
326
  operation: Schema$1.String,
240
- message: Schema$1.String
241
- })) {};
242
- var FlagDisabledError = class extends Schema$1.TaggedErrorClass()("FlagDisabledError", Schema$1.Struct({
243
- operation: Schema$1.String,
244
- flag: Schema$1.String
245
- })) {};
246
- var ForbiddenError = class extends Schema$1.TaggedErrorClass()("ForbiddenError", Schema$1.Struct({
247
- operation: Schema$1.String,
248
- message: Schema$1.String
249
- })) {};
250
- const ForwardingConditions = Schema$1.Struct({
251
- subjectContains: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
252
- fromContains: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
253
- hasAttachments: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null]))
254
- }).annotate({ identifier: "ForwardingConditions" });
255
- var InternalError = class extends Schema$1.TaggedErrorClass()("InternalError", Schema$1.Struct({
256
- operation: Schema$1.String,
257
- message: Schema$1.String
327
+ reason: Schema$1.String,
328
+ details: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
258
329
  })) {};
259
- const JsonObject = Schema$1.Record(Schema$1.String, JsonValue).annotate({ identifier: "JsonObject" });
260
- const MessageContact = Schema$1.Struct({
261
- id: Schema$1.String,
262
- name: Schema$1.String,
263
- displayName: Schema$1.Union([Schema$1.String, Schema$1.Null]),
264
- type: Schema$1.String,
265
- identities: Schema$1.Array(Schema$1.Struct({
266
- channel: Schema$1.Literals([
267
- "sms",
268
- "whatsapp",
269
- "email"
270
- ]),
271
- identifier: Schema$1.String,
272
- verified: Schema$1.Boolean
273
- }))
274
- }).annotate({ identifier: "MessageContact" });
330
+ const EmailAddress = Schema$1.Struct({
331
+ email: Schema$1.String,
332
+ name: Schema$1.Union([Schema$1.String, Schema$1.Null])
333
+ }).annotate({ identifier: "EmailAddress" });
334
+ const AttachmentId = Schema$1.String.pipe(Schema$1.brand("AttachmentId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
335
+ expected: "a string matching the RegExp ^att_[0-9a-hjkmnp-tv-z]{16,24}$",
336
+ identifier: "AttachmentId"
337
+ }));
275
338
  const MessageEventId = Schema$1.String.pipe(Schema$1.brand("MessageEventId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^mevt_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
276
339
  expected: "a string matching the RegExp ^mevt_[0-9a-hjkmnp-tv-z]{16,24}$",
277
340
  identifier: "MessageEventId"
278
341
  }));
279
- const MessageId = Schema$1.String.pipe(Schema$1.brand("MessageId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^msg_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
280
- expected: "a string matching the RegExp ^msg_[0-9a-hjkmnp-tv-z]{16,24}$",
281
- identifier: "MessageId"
282
- }));
283
- const Objects_3 = Schema$1.Record(Schema$1.String, JsonValue);
284
- const OperationId = Schema$1.String.pipe(Schema$1.brand("OperationId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^op_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
285
- expected: "a string matching the RegExp ^op_[0-9a-hjkmnp-tv-z]{16,24}$",
286
- identifier: "OperationId"
342
+ const ScheduledMessageId = Schema$1.String.pipe(Schema$1.brand("ScheduledMessageId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^sched_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
343
+ expected: "a string matching the RegExp ^sched_[0-9a-hjkmnp-tv-z]{16,24}$",
344
+ identifier: "ScheduledMessageId"
287
345
  }));
288
346
  const OperationResource = Schema$1.Struct({
289
347
  type: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(80).annotate({ expected: "a value with a length of at most 80" })),
290
348
  id: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }))
291
349
  }).annotate({ identifier: "OperationResource" });
292
- const OrganizationId = Schema$1.String.pipe(Schema$1.brand("OrganizationId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^org_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
293
- expected: "a string matching the RegExp ^org_[0-9a-hjkmnp-tv-z]{16,24}$",
294
- identifier: "OrganizationId"
350
+ const UserId = Schema$1.String.pipe(Schema$1.brand("UserId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^user_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
351
+ expected: "a string matching the RegExp ^user_[0-9a-hjkmnp-tv-z]{16,24}$",
352
+ identifier: "UserId"
295
353
  }));
296
- const PaginationMeta = Schema$1.Struct({
297
- page: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
298
- limit: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
299
- total: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
300
- totalPages: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
301
- }).annotate({ identifier: "PaginationMeta" });
302
- var PaymentRequiredError = class extends Schema$1.TaggedErrorClass()("PaymentRequiredError", Schema$1.Struct({
303
- operation: Schema$1.String,
304
- resource: Schema$1.String,
305
- currentUsage: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
306
- limit: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
307
- })) {};
308
- var RateLimitedError = class extends Schema$1.TaggedErrorClass()("RateLimitedError", Schema$1.Struct({
309
- operation: Schema$1.String,
310
- retryAfterSeconds: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
311
- })) {};
312
- const Union_2 = Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]);
313
- var ResourceNotFoundError = class extends Schema$1.TaggedErrorClass()("ResourceNotFoundError", Schema$1.Struct({
314
- operation: Schema$1.String,
315
- resource: Schema$1.String,
316
- id: Schema$1.String
317
- })) {};
318
- const ScheduledMessageId = Schema$1.String.pipe(Schema$1.brand("ScheduledMessageId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^sched_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
319
- expected: "a string matching the RegExp ^sched_[0-9a-hjkmnp-tv-z]{16,24}$",
320
- identifier: "ScheduledMessageId"
354
+ const MailboxExtensionId = Schema$1.String.pipe(Schema$1.brand("MailboxExtensionId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^ext_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
355
+ expected: "a string matching the RegExp ^ext_[0-9a-hjkmnp-tv-z]{16,24}$",
356
+ identifier: "MailboxExtensionId"
321
357
  }));
322
- const SuccessResponse = Schema$1.Struct({ success: Schema$1.Boolean }).annotate({ identifier: "SuccessResponse" });
323
- const SuccessResult = Schema$1.Struct({
324
- success: Schema$1.Boolean,
325
- message: Schema$1.String
326
- }).annotate({ identifier: "SuccessResult" });
327
- const SuppressionId = Schema$1.String.pipe(Schema$1.brand("SuppressionId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^supp_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
328
- expected: "a string matching the RegExp ^supp_[0-9a-hjkmnp-tv-z]{16,24}$",
329
- identifier: "SuppressionId"
358
+ const TemplateSourceVersionId = Schema$1.String.pipe(Schema$1.brand("TemplateSourceVersionId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^src_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
359
+ expected: "a string matching the RegExp ^src_[0-9a-hjkmnp-tv-z]{16,24}$",
360
+ identifier: "TemplateSourceVersionId"
330
361
  }));
331
362
  const TemplateFamilyId = Schema$1.String.pipe(Schema$1.brand("TemplateFamilyId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^tfam_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
332
363
  expected: "a string matching the RegExp ^tfam_[0-9a-hjkmnp-tv-z]{16,24}$",
333
364
  identifier: "TemplateFamilyId"
334
365
  }));
335
- Schema$1.Struct({ name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })) }).annotate({ identifier: "TemplateFamilyName" });
336
366
  const TemplateFromDefault = Schema$1.Struct({
337
367
  email: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
338
368
  name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
339
369
  }).annotate({ identifier: "TemplateFromDefault" });
340
- const TemplateId = Schema$1.String.pipe(Schema$1.brand("TemplateId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
341
- expected: "a string matching the RegExp ^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$",
342
- identifier: "TemplateId"
343
- }));
344
- const TemplatePerformance = Schema$1.Struct({
345
- deliveryRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
346
- openRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
347
- clickRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
348
- responseRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
349
- conversionRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
350
- averageSatisfaction: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema$1.isLessThanOrEqualTo(5).annotate({ expected: "a value less than or equal to 5" })), Schema$1.Null])),
351
- totalSent: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
352
- totalDelivered: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
353
- totalOpened: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
354
- totalClicked: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
355
- totalResponses: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
356
- totalConversions: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
357
- lastUsedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
358
- usageCount: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null]))
359
- }).annotate({ identifier: "TemplatePerformance" });
360
- const TemplateSourceVersionId = Schema$1.String.pipe(Schema$1.brand("TemplateSourceVersionId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^src_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
361
- expected: "a string matching the RegExp ^src_[0-9a-hjkmnp-tv-z]{16,24}$",
362
- identifier: "TemplateSourceVersionId"
363
- }));
364
370
  const TemplateVariable = Schema$1.Struct({
365
371
  name: Schema$1.String,
366
372
  type: Schema$1.Literals([
@@ -390,21 +396,77 @@ const TemplateVariable = Schema$1.Struct({
390
396
  ]), Schema$1.Null]))
391
397
  }), Schema$1.Null]))
392
398
  }).annotate({ identifier: "TemplateVariable" });
393
- const TestWebhookPayload = Schema$1.Struct({ data: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null])) }).annotate({ identifier: "TestWebhookPayload" });
394
- const ThemeColors = Schema$1.Record(Schema$1.String, Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^#[0-9a-f]{6}$")).annotate({ expected: "a string matching the RegExp ^#[0-9a-f]{6}$" }))).annotate({ identifier: "ThemeColors" });
395
- const TrackingRecipientEmail = Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$")).annotate({
396
- expected: "a string matching the RegExp ^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
397
- identifier: "TrackingRecipientEmail"
399
+ const TemplatePerformance = Schema$1.Struct({
400
+ deliveryRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
401
+ openRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
402
+ clickRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
403
+ responseRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
404
+ conversionRate: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema$1.isLessThanOrEqualTo(1).annotate({ expected: "a value less than or equal to 1" })), Schema$1.Null])),
405
+ averageSatisfaction: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema$1.isLessThanOrEqualTo(5).annotate({ expected: "a value less than or equal to 5" })), Schema$1.Null])),
406
+ totalSent: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
407
+ totalDelivered: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
408
+ totalOpened: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
409
+ totalClicked: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
410
+ totalResponses: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
411
+ totalConversions: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null])),
412
+ lastUsedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
413
+ usageCount: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null]))
414
+ }).annotate({ identifier: "TemplatePerformance" });
415
+ const WebhookEventId = Schema$1.String.pipe(Schema$1.brand("WebhookEventId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^whevt_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
416
+ expected: "a string matching the RegExp ^whevt_[0-9a-hjkmnp-tv-z]{16,24}$",
417
+ identifier: "WebhookEventId"
398
418
  }));
399
- var UnauthorizedError = class extends Schema$1.TaggedErrorClass()("UnauthorizedError", Schema$1.Struct({
400
- operation: Schema$1.String,
401
- message: Schema$1.String
402
- })) {};
403
- const UnknownRecord = Schema$1.Record(Schema$1.String, JsonValue).annotate({ identifier: "UnknownRecord" });
404
- const UnsubscribeId = Schema$1.String.pipe(Schema$1.brand("UnsubscribeId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^unsub_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
405
- expected: "a string matching the RegExp ^unsub_[0-9a-hjkmnp-tv-z]{16,24}$",
406
- identifier: "UnsubscribeId"
419
+ const WebhookDeliveryId = Schema$1.String.pipe(Schema$1.brand("WebhookDeliveryId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^whdel_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
420
+ expected: "a string matching the RegExp ^whdel_[0-9a-hjkmnp-tv-z]{16,24}$",
421
+ identifier: "WebhookDeliveryId"
422
+ }));
423
+ const WebhookAttemptId = Schema$1.String.pipe(Schema$1.brand("WebhookAttemptId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^whatt_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
424
+ expected: "a string matching the RegExp ^whatt_[0-9a-hjkmnp-tv-z]{16,24}$",
425
+ identifier: "WebhookAttemptId"
407
426
  }));
427
+ Schema$1.Struct({
428
+ filename: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })),
429
+ contentType: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(127).annotate({ expected: "a value with a length of at most 127" })),
430
+ sizeBytes: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isLessThanOrEqualTo(26214400).annotate({ expected: "a value less than or equal to 26214400" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
431
+ purpose: Schema$1.Literals(["attachment", "avatar"]),
432
+ checksumSha256: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
433
+ }).annotate({ identifier: "CreateMediaPayload" });
434
+ const CreateWebhookPayload = Schema$1.Struct({
435
+ name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })),
436
+ url: Schema$1.String,
437
+ eventTypes: Schema$1.Array(Schema$1.Literals([
438
+ "message.sent",
439
+ "message.delivered",
440
+ "message.read",
441
+ "message.failed",
442
+ "message.bounced",
443
+ "message.complained",
444
+ "message.received",
445
+ "contact.created",
446
+ "contact.updated",
447
+ "contact.deleted",
448
+ "conversation.started",
449
+ "conversation.ended",
450
+ "conversation.created",
451
+ "conversation.updated",
452
+ "conversation.archived",
453
+ "template.created",
454
+ "template.updated",
455
+ "template.deleted",
456
+ "template.approved",
457
+ "template.rejected",
458
+ "webhook.created",
459
+ "webhook.updated",
460
+ "webhook.deleted",
461
+ "webhook.test",
462
+ "domain.updated"
463
+ ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
464
+ channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
465
+ headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])),
466
+ status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals(["active", "disabled"]), Schema$1.Null]))
467
+ }).annotate({ identifier: "CreateWebhookPayload" });
468
+ Schema$1.Struct({ name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })) }).annotate({ identifier: "TemplateFamilyName" });
469
+ const TestWebhookPayload = Schema$1.Struct({ data: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null])) }).annotate({ identifier: "TestWebhookPayload" });
408
470
  const UpdateWebhookPayload = Schema$1.Struct({
409
471
  name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), Schema$1.Null])),
410
472
  url: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
@@ -432,102 +494,82 @@ const UpdateWebhookPayload = Schema$1.Struct({
432
494
  "webhook.created",
433
495
  "webhook.updated",
434
496
  "webhook.deleted",
435
- "webhook.test"
497
+ "webhook.test",
498
+ "domain.updated"
436
499
  ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
437
- channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.Literals([
438
- "sms",
439
- "whatsapp",
440
- "email"
441
- ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null]), Schema$1.Null])),
500
+ channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null]), Schema$1.Null])),
442
501
  headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])),
443
502
  status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals(["active", "disabled"]), Schema$1.Null]))
444
503
  }).annotate({ identifier: "UpdateWebhookPayload" });
445
- const UserId = Schema$1.String.pipe(Schema$1.brand("UserId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^user_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
446
- expected: "a string matching the RegExp ^user_[0-9a-hjkmnp-tv-z]{16,24}$",
447
- identifier: "UserId"
448
- }));
449
- var ValidationError = class extends Schema$1.TaggedErrorClass()("ValidationError", Schema$1.Struct({
450
- operation: Schema$1.String,
451
- message: Schema$1.String,
452
- fields: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.Array(Schema$1.String)), Schema$1.Null]))
453
- })) {};
454
- const WebhookAttemptId = Schema$1.String.pipe(Schema$1.brand("WebhookAttemptId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^whatt_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
455
- expected: "a string matching the RegExp ^whatt_[0-9a-hjkmnp-tv-z]{16,24}$",
456
- identifier: "WebhookAttemptId"
457
- }));
458
- const WebhookDeliveryId = Schema$1.String.pipe(Schema$1.brand("WebhookDeliveryId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^whdel_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
459
- expected: "a string matching the RegExp ^whdel_[0-9a-hjkmnp-tv-z]{16,24}$",
460
- identifier: "WebhookDeliveryId"
461
- }));
462
- const WebhookEndpointId = Schema$1.String.pipe(Schema$1.brand("WebhookEndpointId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^wep_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
463
- expected: "a string matching the RegExp ^wep_[0-9a-hjkmnp-tv-z]{16,24}$",
464
- identifier: "WebhookEndpointId"
465
- }));
466
- var WebhookEnqueueError = class extends Schema$1.TaggedErrorClass()("WebhookEnqueueError", Schema$1.Struct({
467
- operation: Schema$1.String,
468
- reason: Schema$1.String,
469
- details: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
470
- })) {};
471
- const WebhookEventId = Schema$1.String.pipe(Schema$1.brand("WebhookEventId")).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^whevt_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
472
- expected: "a string matching the RegExp ^whevt_[0-9a-hjkmnp-tv-z]{16,24}$",
473
- identifier: "WebhookEventId"
474
- }));
475
- const ActorTracking = Schema$1.Struct({
476
- allActorIds: Schema$1.Array(ActorId),
477
- activeActorIds: Schema$1.Array(ActorId),
478
- actorHistory: Schema$1.Array(Schema$1.Struct({
479
- actorId: ActorId,
480
- actorType: Schema$1.Literals([
481
- "contact",
482
- "system",
483
- "sender_identity",
484
- "agent",
485
- "user"
486
- ]),
487
- joinedAt: Schema$1.String,
488
- leftAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
489
- role: Schema$1.Literals([
490
- "initiator",
491
- "responder",
492
- "observer"
493
- ]),
494
- addedBy: Schema$1.optionalKey(Schema$1.Union([ActorId, Schema$1.Null])),
495
- removedBy: Schema$1.optionalKey(Schema$1.Union([ActorId, Schema$1.Null])),
496
- reason: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
497
- })),
498
- primaryActorIds: Schema$1.Array(ActorId)
499
- }).annotate({ identifier: "ActorTracking" });
500
- const ApiKeyPermissions = Schema$1.Union([Objects_, Schema$1.Null]).annotate({ identifier: "ApiKeyPermissions" });
501
- const BrandedTrackingStatus = Schema$1.Struct({
502
- enabled: Schema$1.Boolean,
503
- brandedTracking: Schema$1.Union([Schema$1.Struct({
504
- status: Schema$1.Literals([
505
- "pending",
506
- "caa-blocked",
507
- "active",
508
- "teardown-scheduled",
509
- "disabled"
510
- ]),
511
- label: Schema$1.String,
512
- hostname: Schema$1.String,
513
- region: Schema$1.String,
514
- sslStatus: Schema$1.Union([Schema$1.String, Schema$1.Null]),
515
- dnsRecords: Schema$1.Struct({
516
- tracking: Schema$1.Union([BrandedTrackingDnsRecord, Schema$1.Null]),
517
- dcvDelegation: Schema$1.Union([BrandedTrackingDnsRecord, Schema$1.Null])
518
- }),
519
- caaBlocked: Schema$1.Boolean,
520
- verificationErrors: Schema$1.Array(Schema$1.String),
521
- teardownScheduledAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
522
- }), Schema$1.Null])
523
- }).annotate({ identifier: "BrandedTrackingStatus" });
524
- const CampaignContentMetadata = Schema$1.Union([Objects_1, Schema$1.Null]).annotate({ identifier: "CampaignContentMetadata" });
525
- const CampaignAudience = Schema$1.Struct({
526
- includeTags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
527
- excludeTags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
528
- contactIds: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(ContactId).check(Schema$1.isMaxLength(25e3).annotate({ expected: "a value with a length of at most 25000" })), Schema$1.Null])),
529
- groupIds: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(ContactGroupId).check(Schema$1.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), Schema$1.Null]))
530
- }).annotate({ identifier: "CampaignAudience" });
504
+ const ApiKey = Schema$1.Struct({
505
+ id: Schema$1.String,
506
+ name: Schema$1.String,
507
+ key: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
508
+ start: Schema$1.Union([Schema$1.String, Schema$1.Null]),
509
+ description: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
510
+ createdAt: Schema$1.String,
511
+ expiresAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
512
+ lastUsedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
513
+ isActive: Schema$1.Boolean,
514
+ permissions: Schema$1.optionalKey(ApiKeyPermissions),
515
+ roleName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
516
+ }).annotate({ identifier: "ApiKey" });
517
+ const ApiKeyWithSecret = Schema$1.Struct({
518
+ id: Schema$1.String,
519
+ name: Schema$1.String,
520
+ key: SensitiveString,
521
+ start: Schema$1.Union([Schema$1.String, Schema$1.Null]),
522
+ description: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
523
+ createdAt: Schema$1.String,
524
+ expiresAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
525
+ lastUsedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
526
+ isActive: Schema$1.Boolean,
527
+ permissions: Schema$1.optionalKey(ApiKeyPermissions),
528
+ roleName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
529
+ }).annotate({ identifier: "ApiKeyWithSecret" });
530
+ const EmailAttachment = Schema$1.Struct({
531
+ filename: Schema$1.String,
532
+ content: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$")).annotate({ expected: "a string matching the RegExp ^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$" })), Schema$1.Null])),
533
+ mediaId: Schema$1.optionalKey(Schema$1.Union([MediaId, Schema$1.Null])),
534
+ contentType: Schema$1.String,
535
+ size: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isLessThanOrEqualTo(26214400).annotate({ expected: "a value less than or equal to 26214400" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" }))
536
+ }).annotate({ identifier: "EmailAttachment" });
537
+ const TemplateSummary = Schema$1.Struct({
538
+ id: TemplateId,
539
+ name: Schema$1.String,
540
+ slug: Schema$1.String,
541
+ channel: Schema$1.Literal("email"),
542
+ origin: Schema$1.Literals(["dashboard", "tsx"]),
543
+ description: Schema$1.Union([Schema$1.String, Schema$1.Null]),
544
+ category: Schema$1.Union([Schema$1.Literals([
545
+ "transactional",
546
+ "marketing",
547
+ "support",
548
+ "notification",
549
+ "verification",
550
+ "reminder",
551
+ "alert"
552
+ ]), Schema$1.Null]),
553
+ status: Schema$1.Literals([
554
+ "draft",
555
+ "pending",
556
+ "approved",
557
+ "published",
558
+ "rejected",
559
+ "archived"
560
+ ]),
561
+ version: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
562
+ usageCount: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
563
+ lastUsedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
564
+ createdAt: Schema$1.String,
565
+ updatedAt: Schema$1.String
566
+ }).annotate({ identifier: "TemplateSummary" });
567
+ const TemplateData = Schema$1.Union([JsonObject, Schema$1.Null]).annotate({ identifier: "TemplateData" });
568
+ const CampaignPolicy = Schema$1.Struct({
569
+ unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([UnsubscribeId, Schema$1.Null])),
570
+ pageSize: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(100).annotate({ expected: "a value greater than or equal to 100" })).check(Schema$1.isLessThanOrEqualTo(1e3).annotate({ expected: "a value less than or equal to 1000" })), Schema$1.Null]))
571
+ }).annotate({ identifier: "CampaignPolicy" });
572
+ const CampaignConversationRef = Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null]).annotate({ identifier: "CampaignConversationRef" });
531
573
  const ContactAccessConfig = Schema$1.Struct({
532
574
  paymentRequired: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
533
575
  amount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
@@ -552,53 +594,133 @@ const ContactAccessConfig = Schema$1.Struct({
552
594
  outOfOfficeMessage: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
553
595
  }), Schema$1.Null]))
554
596
  }).annotate({ identifier: "ContactAccessConfig" });
555
- Schema$1.Struct({ contactIds: Schema$1.TupleWithRest(Schema$1.Tuple([ContactId]), [ContactId]) }).annotate({ identifier: "ConversationContacts" });
556
597
  const EmailRecipient = Schema$1.Union([Schema$1.Struct({ contactId: ContactId }), Schema$1.Struct({
557
598
  email: Schema$1.String,
558
599
  name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
559
600
  displayName: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null]))
560
601
  })]).annotate({ identifier: "EmailRecipient" });
561
- const SmsRecipient = Schema$1.Union([Schema$1.Struct({ contactId: ContactId }), Schema$1.Struct({
562
- phone: Schema$1.String,
563
- name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
564
- displayName: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null]))
565
- })]).annotate({ identifier: "SmsRecipient" });
566
- const WhatsAppRecipient = Schema$1.Union([Schema$1.Struct({ contactId: ContactId }), Schema$1.Struct({
567
- whatsapp: Schema$1.String,
568
- name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
569
- displayName: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null]))
570
- })]).annotate({ identifier: "WhatsAppRecipient" });
571
- const CampaignConversationRef = Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null]).annotate({ identifier: "CampaignConversationRef" });
572
- const EmailAttachments = Schema$1.Union([Arrays_, Schema$1.Null]).annotate({ identifier: "EmailAttachments" });
573
- const EmailSender = Schema$1.Union([Objects_2, Schema$1.Null]).annotate({ identifier: "EmailSender" });
574
- const EmailDomain = Schema$1.Struct({
575
- id: EmailDomainId,
576
- domain: Schema$1.String,
602
+ Schema$1.Struct({ contactIds: Schema$1.TupleWithRest(Schema$1.Tuple([ContactId]), [ContactId]) }).annotate({ identifier: "ConversationContacts" });
603
+ const CampaignAudience = Schema$1.Struct({
604
+ includeTags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
605
+ excludeTags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
606
+ contactIds: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(ContactId).check(Schema$1.isMaxLength(25e3).annotate({ expected: "a value with a length of at most 25000" })), Schema$1.Null])),
607
+ groupIds: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(ContactGroupId).check(Schema$1.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), Schema$1.Null]))
608
+ }).annotate({ identifier: "CampaignAudience" });
609
+ const CampaignLatestRun = Schema$1.Struct({
610
+ id: CampaignRunId,
577
611
  status: Schema$1.Literals([
578
- "pending",
579
- "verified",
612
+ "scheduled",
613
+ "resolving",
614
+ "dispatching",
615
+ "paused",
616
+ "completed",
617
+ "cancelled",
580
618
  "failed"
581
619
  ]),
582
- dkimSelector: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
583
- dkimPublicKey: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
584
- dnsRecords: Schema$1.Array(Schema$1.Struct({
585
- type: Schema$1.String,
586
- name: Schema$1.String,
587
- value: Schema$1.String,
588
- ttl: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
589
- description: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
590
- priority: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]))
591
- })),
592
- verifiedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
593
- isDefault: Schema$1.Boolean,
594
- defaultSenderId: Schema$1.Union([EmailSenderId, Schema$1.Null]),
595
- deliverability: DeliverabilityFacts,
620
+ scheduledFor: Schema$1.String,
621
+ completedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
622
+ totalRecipients: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
623
+ dispatchedCount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
624
+ failedCount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
625
+ skippedCount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
626
+ }).annotate({ identifier: "CampaignLatestRun" });
627
+ const Media = Schema$1.Struct({
628
+ id: MediaId,
629
+ organizationId: OrganizationId,
630
+ status: Schema$1.Literals([
631
+ "pending",
632
+ "uploading",
633
+ "processing",
634
+ "ready",
635
+ "failed",
636
+ "deleted"
637
+ ]),
638
+ filename: Schema$1.String,
639
+ contentType: Schema$1.String,
640
+ sizeBytes: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
641
+ width: Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]),
642
+ height: Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]),
643
+ durationMs: Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null]),
644
+ purpose: Schema$1.Literals(["attachment", "avatar"]),
645
+ checksumSha256: Schema$1.Union([Schema$1.String, Schema$1.Null]),
646
+ expiresAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
596
647
  createdAt: Schema$1.String,
597
- updatedAt: Schema$1.String
598
- }).annotate({ identifier: "EmailDomain" });
599
- const SmsTemplateData = Schema$1.Union([JsonObject, Schema$1.Null]).annotate({ identifier: "SmsTemplateData" });
600
- const TemplateData = Schema$1.Union([JsonObject, Schema$1.Null]).annotate({ identifier: "TemplateData" });
601
- const WhatsAppTemplateData = Schema$1.Union([JsonObject, Schema$1.Null]).annotate({ identifier: "WhatsAppTemplateData" });
648
+ confirmedAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
649
+ }).annotate({ identifier: "Media" });
650
+ const HumanProfile = Schema$1.Struct({
651
+ firstName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
652
+ lastName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
653
+ email: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
654
+ phone: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
655
+ company: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
656
+ jobTitle: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
657
+ location: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
658
+ country: Schema$1.String,
659
+ state: Schema$1.String,
660
+ city: Schema$1.String,
661
+ timezone: Schema$1.String
662
+ }), Schema$1.Null])),
663
+ customFields: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null])),
664
+ source: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
665
+ "api",
666
+ "import",
667
+ "manual",
668
+ "form"
669
+ ]), Schema$1.Null])),
670
+ sourceDetails: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null]))
671
+ }).annotate({ identifier: "HumanProfile" });
672
+ const ConversationMetadata = Schema$1.Struct({
673
+ source: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
674
+ tags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
675
+ customFields: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null]))
676
+ }).annotate({ identifier: "ConversationMetadata" });
677
+ const ConversationContext = Schema$1.Struct({
678
+ customerData: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null])),
679
+ previousConversations: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
680
+ sessionVariables: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null])),
681
+ workflowState: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
682
+ currentStep: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
683
+ completedSteps: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
684
+ pendingSteps: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
685
+ workflowData: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null]))
686
+ }), Schema$1.Null]))
687
+ }).annotate({ identifier: "ConversationContext" });
688
+ const ActorTracking = Schema$1.Struct({
689
+ allActorIds: Schema$1.Array(ActorId),
690
+ activeActorIds: Schema$1.Array(ActorId),
691
+ actorHistory: Schema$1.Array(Schema$1.Struct({
692
+ actorId: ActorId,
693
+ actorType: Schema$1.Literals([
694
+ "contact",
695
+ "system",
696
+ "sender_identity",
697
+ "agent",
698
+ "user"
699
+ ]),
700
+ joinedAt: Schema$1.String,
701
+ leftAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
702
+ role: Schema$1.Literals([
703
+ "initiator",
704
+ "responder",
705
+ "observer"
706
+ ]),
707
+ addedBy: Schema$1.optionalKey(Schema$1.Union([ActorId, Schema$1.Null])),
708
+ removedBy: Schema$1.optionalKey(Schema$1.Union([ActorId, Schema$1.Null])),
709
+ reason: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
710
+ })),
711
+ primaryActorIds: Schema$1.Array(ActorId)
712
+ }).annotate({ identifier: "ActorTracking" });
713
+ const ConversationParticipant = Schema$1.Struct({
714
+ actorId: ActorId,
715
+ actorType: Schema$1.Literals([
716
+ "contact",
717
+ "system",
718
+ "sender_identity",
719
+ "agent",
720
+ "user"
721
+ ]),
722
+ contact: MessageContact
723
+ }).annotate({ identifier: "ConversationParticipant" });
602
724
  const Message = Schema$1.Struct({
603
725
  id: Schema$1.String,
604
726
  organizationId: Schema$1.String,
@@ -606,11 +728,7 @@ const Message = Schema$1.Struct({
606
728
  parentMessageId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
607
729
  fromActorId: Schema$1.String,
608
730
  actorMetadata: Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]),
609
- channel: Schema$1.Literals([
610
- "sms",
611
- "whatsapp",
612
- "email"
613
- ]),
731
+ channel: Schema$1.Literal("email"),
614
732
  direction: Schema$1.Literals(["outbound", "inbound"]),
615
733
  content: JsonValue,
616
734
  metadata: Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]),
@@ -675,11 +793,7 @@ const Message = Schema$1.Struct({
675
793
  id: Schema$1.String,
676
794
  messageId: Schema$1.String,
677
795
  recipientId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
678
- channel: Schema$1.Literals([
679
- "sms",
680
- "whatsapp",
681
- "email"
682
- ]),
796
+ channel: Schema$1.Literal("email"),
683
797
  status: Schema$1.Literals([
684
798
  "pending",
685
799
  "scheduled",
@@ -751,201 +865,8 @@ const Message = Schema$1.Struct({
751
865
  processedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
752
866
  createdAt: Schema$1.String,
753
867
  updatedAt: Schema$1.String
754
- })),
755
- smsDeliveryDetails: Schema$1.Array(Schema$1.Struct({
756
- deliveryId: Schema$1.String,
757
- fromNumber: Schema$1.String,
758
- toNumber: Schema$1.String,
759
- segmentCount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
760
- encoding: Schema$1.String,
761
- dltTemplateId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
762
- dltEntityId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
763
- dltContentId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
764
- carrier: Schema$1.Union([Schema$1.String, Schema$1.Null]),
765
- numSegmentsReported: Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })), Schema$1.Null]),
766
- createdAt: Schema$1.String,
767
- updatedAt: Schema$1.String
768
- })),
769
- whatsappDeliveryDetails: Schema$1.Array(Schema$1.Struct({
770
- deliveryId: Schema$1.String,
771
- fromNumber: Schema$1.String,
772
- toNumber: Schema$1.String,
773
- messageType: Schema$1.Literals([
774
- "text",
775
- "image",
776
- "video",
777
- "audio",
778
- "document",
779
- "location",
780
- "contacts",
781
- "template",
782
- "interactive",
783
- "sticker",
784
- "reaction",
785
- "order",
786
- "button",
787
- "system",
788
- "unsupported"
789
- ]),
790
- templateName: Schema$1.Union([Schema$1.String, Schema$1.Null]),
791
- templateLanguage: Schema$1.Union([Schema$1.String, Schema$1.Null]),
792
- templateCategory: Schema$1.Union([Schema$1.String, Schema$1.Null]),
793
- templateParams: Schema$1.Union([JsonObject, Schema$1.Null]),
794
- mediaUrl: Schema$1.Union([Schema$1.String, Schema$1.Null]),
795
- mediaType: Schema$1.Union([Schema$1.String, Schema$1.Null]),
796
- mediaS3Key: Schema$1.Union([Schema$1.String, Schema$1.Null]),
797
- interactiveType: Schema$1.Union([Schema$1.String, Schema$1.Null]),
798
- contextMessageId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
799
- conversationType: Schema$1.Union([Schema$1.Literals([
800
- "marketing",
801
- "utility",
802
- "authentication",
803
- "service"
804
- ]), Schema$1.Null]),
805
- serviceWindowId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
806
- freeEntryPointId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
807
- isBillable: Schema$1.Boolean,
808
- pricing: Schema$1.Union([Schema$1.Struct({
809
- messageCost: Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\d+\\.\\d{4}$")).annotate({ expected: "a string matching the RegExp ^\\d+\\.\\d{4}$" })),
810
- reason: Schema$1.String,
811
- sentInServiceWindow: Schema$1.Boolean,
812
- sentInFreeEntryPoint: Schema$1.Boolean
813
- }), Schema$1.Null]),
814
- recipientId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
815
- createdAt: Schema$1.String,
816
- updatedAt: Schema$1.String
817
868
  }))
818
869
  }).annotate({ identifier: "Message" });
819
- const MessageMetadata = Schema$1.Union([Objects_3, Schema$1.Null]).annotate({ identifier: "MessageMetadata" });
820
- const Operation = Schema$1.Struct({
821
- id: OperationId,
822
- organizationId: Schema$1.String,
823
- kind: Schema$1.Literals(["email-domain-provisioning", "organization-deletion"]),
824
- subject: OperationResource,
825
- actor: Schema$1.Struct({
826
- type: Schema$1.Literals([
827
- "user",
828
- "api-key",
829
- "system"
830
- ]),
831
- id: Schema$1.String
832
- }),
833
- status: Schema$1.Literals([
834
- "pending",
835
- "running",
836
- "succeeded",
837
- "failed"
838
- ]),
839
- phase: Schema$1.Literals([
840
- "accepted",
841
- "dispatching",
842
- "provisioning",
843
- "deleting",
844
- "finalizing",
845
- "completed"
846
- ]),
847
- error: Schema$1.Union([Schema$1.Struct({
848
- code: Schema$1.Literals([
849
- "validation-failed",
850
- "conflict",
851
- "capacity-unavailable",
852
- "provider-unavailable",
853
- "timed-out",
854
- "internal"
855
- ]),
856
- message: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(240).annotate({ expected: "a value with a length of at most 240" }))
857
- }), Schema$1.Null]),
858
- createdAt: Schema$1.String,
859
- updatedAt: Schema$1.String,
860
- startedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
861
- completedAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
862
- }).annotate({ identifier: "Operation" });
863
- const OperationResourceLink = Schema$1.Struct({
864
- resource: OperationResource,
865
- href: Schema$1.String.check(Schema$1.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\/v1\\/")).annotate({ expected: "a string matching the RegExp ^\\/v1\\/" }))
866
- }).annotate({ identifier: "OperationResourceLink" });
867
- const ReplyToAddresses = Schema$1.Union([Union_2, Schema$1.Null]).annotate({ identifier: "ReplyToAddresses" });
868
- const SuppressionEntry = Schema$1.Struct({
869
- id: SuppressionId,
870
- email: Schema$1.String,
871
- type: Schema$1.Literals([
872
- "bounce",
873
- "complaint",
874
- "unsubscribe",
875
- "manual"
876
- ]),
877
- bounceType: Schema$1.Union([Schema$1.String, Schema$1.Null]),
878
- bounceSubType: Schema$1.Union([Schema$1.String, Schema$1.Null]),
879
- reason: Schema$1.Union([Schema$1.String, Schema$1.Null]),
880
- messageId: Schema$1.Union([MessageId, Schema$1.Null]),
881
- isActive: Schema$1.Boolean,
882
- expiresAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
883
- createdAt: Schema$1.String
884
- }).annotate({ identifier: "SuppressionEntry" });
885
- const TemplateSummary = Schema$1.Struct({
886
- id: TemplateId,
887
- name: Schema$1.String,
888
- slug: Schema$1.String,
889
- channel: Schema$1.Literals([
890
- "sms",
891
- "whatsapp",
892
- "email"
893
- ]),
894
- origin: Schema$1.Literals(["dashboard", "tsx"]),
895
- description: Schema$1.Union([Schema$1.String, Schema$1.Null]),
896
- category: Schema$1.Union([Schema$1.Literals([
897
- "transactional",
898
- "marketing",
899
- "support",
900
- "notification",
901
- "verification",
902
- "reminder",
903
- "alert"
904
- ]), Schema$1.Null]),
905
- status: Schema$1.Literals([
906
- "draft",
907
- "pending",
908
- "approved",
909
- "published",
910
- "rejected",
911
- "archived"
912
- ]),
913
- version: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
914
- usageCount: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
915
- lastUsedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
916
- createdAt: Schema$1.String,
917
- updatedAt: Schema$1.String
918
- }).annotate({ identifier: "TemplateSummary" });
919
- const TemplateFamily = Schema$1.Struct({
920
- id: TemplateFamilyId,
921
- organizationId: OrganizationId,
922
- name: Schema$1.String,
923
- members: Schema$1.Array(Schema$1.Struct({
924
- id: TemplateId,
925
- name: Schema$1.String,
926
- slug: Schema$1.String,
927
- channel: Schema$1.Literals([
928
- "sms",
929
- "whatsapp",
930
- "email"
931
- ]),
932
- variableSchema: Schema$1.Union([Schema$1.Array(TemplateVariable), Schema$1.Null]),
933
- status: Schema$1.Literals([
934
- "draft",
935
- "pending",
936
- "approved",
937
- "published",
938
- "rejected",
939
- "archived"
940
- ]),
941
- isActive: Schema$1.Boolean,
942
- version: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
943
- createdAt: Schema$1.String,
944
- updatedAt: Schema$1.String
945
- })),
946
- createdAt: Schema$1.String,
947
- updatedAt: Schema$1.String
948
- }).annotate({ identifier: "TemplateFamily" });
949
870
  const Design = Schema$1.Struct({
950
871
  theme: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
951
872
  colors: Schema$1.optionalKey(Schema$1.Union([ThemeColors, Schema$1.Null])),
@@ -998,101 +919,6 @@ const Design = Schema$1.Struct({
998
919
  customHtml: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
999
920
  }), Schema$1.Null]))
1000
921
  }).annotate({ identifier: "Design" });
1001
- const EmailRecipientTrackingPreference = Schema$1.Struct({
1002
- email: TrackingRecipientEmail,
1003
- optedOut: Schema$1.Boolean,
1004
- trackingOptedOutAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1005
- createdAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1006
- updatedAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
1007
- }).annotate({ identifier: "EmailRecipientTrackingPreference" });
1008
- const ConversationContext = Schema$1.Struct({
1009
- customerData: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null])),
1010
- previousConversations: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
1011
- sessionVariables: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null])),
1012
- workflowState: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
1013
- currentStep: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1014
- completedSteps: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
1015
- pendingSteps: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
1016
- workflowData: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null]))
1017
- }), Schema$1.Null]))
1018
- }).annotate({ identifier: "ConversationContext" });
1019
- const ConversationMetadata = Schema$1.Struct({
1020
- source: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1021
- tags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
1022
- customFields: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null]))
1023
- }).annotate({ identifier: "ConversationMetadata" });
1024
- const HumanProfile = Schema$1.Struct({
1025
- firstName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1026
- lastName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1027
- email: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1028
- phone: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1029
- company: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1030
- jobTitle: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1031
- location: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
1032
- country: Schema$1.String,
1033
- state: Schema$1.String,
1034
- city: Schema$1.String,
1035
- timezone: Schema$1.String
1036
- }), Schema$1.Null])),
1037
- customFields: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null])),
1038
- source: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1039
- "api",
1040
- "import",
1041
- "manual",
1042
- "form"
1043
- ]), Schema$1.Null])),
1044
- sourceDetails: Schema$1.optionalKey(Schema$1.Union([UnknownRecord, Schema$1.Null]))
1045
- }).annotate({ identifier: "HumanProfile" });
1046
- const CampaignPolicy = Schema$1.Struct({
1047
- unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([UnsubscribeId, Schema$1.Null])),
1048
- pageSize: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(100).annotate({ expected: "a value greater than or equal to 100" })).check(Schema$1.isLessThanOrEqualTo(1e3).annotate({ expected: "a value less than or equal to 1000" })), Schema$1.Null]))
1049
- }).annotate({ identifier: "CampaignPolicy" });
1050
- const TemplateCompliance = Schema$1.Struct({
1051
- dltTemplateId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1052
- dltStatus: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1053
- "pending",
1054
- "approved",
1055
- "rejected",
1056
- "expired"
1057
- ]), Schema$1.Null])),
1058
- dltApprovedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1059
- whatsappTemplateId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1060
- whatsappStatus: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1061
- "draft",
1062
- "pending",
1063
- "approved",
1064
- "published",
1065
- "rejected",
1066
- "archived"
1067
- ]), Schema$1.Null])),
1068
- whatsappApprovedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1069
- metaStatus: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1070
- submittedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
1071
- qualityScore: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1072
- rejectedReason: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1073
- lastSyncedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1074
- approvalStatus: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1075
- "draft",
1076
- "pending",
1077
- "approved",
1078
- "published",
1079
- "rejected",
1080
- "archived"
1081
- ]), Schema$1.Null])),
1082
- approvedBy: Schema$1.optionalKey(Schema$1.Union([UserId, Schema$1.Null])),
1083
- approvedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1084
- approvalNotes: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1085
- regulatoryRequirements: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Struct({
1086
- region: Schema$1.String,
1087
- requirement: Schema$1.String,
1088
- status: Schema$1.Literals([
1089
- "compliant",
1090
- "non_compliant",
1091
- "pending"
1092
- ]),
1093
- notes: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
1094
- })), Schema$1.Null]))
1095
- }).annotate({ identifier: "TemplateCompliance" });
1096
922
  const WebhookEndpoint = Schema$1.Struct({
1097
923
  id: WebhookEndpointId,
1098
924
  name: Schema$1.String,
@@ -1121,13 +947,10 @@ const WebhookEndpoint = Schema$1.Struct({
1121
947
  "webhook.created",
1122
948
  "webhook.updated",
1123
949
  "webhook.deleted",
1124
- "webhook.test"
950
+ "webhook.test",
951
+ "domain.updated"
1125
952
  ])),
1126
- channels: Schema$1.Union([Schema$1.Array(Schema$1.Literals([
1127
- "sms",
1128
- "whatsapp",
1129
- "email"
1130
- ])), Schema$1.Null]),
953
+ channels: Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")), Schema$1.Null]),
1131
954
  status: Schema$1.Literals(["active", "disabled"]),
1132
955
  hasCustomHeaders: Schema$1.Boolean,
1133
956
  failureStartedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
@@ -1135,164 +958,358 @@ const WebhookEndpoint = Schema$1.Struct({
1135
958
  createdAt: Schema$1.String,
1136
959
  updatedAt: Schema$1.String
1137
960
  }).annotate({ identifier: "WebhookEndpoint" });
1138
- const ApiKey = Schema$1.Struct({
1139
- id: Schema$1.String,
1140
- name: Schema$1.String,
1141
- key: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1142
- start: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1143
- description: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
961
+ const EmailDomain = Schema$1.Struct({
962
+ id: EmailDomainId,
963
+ domain: Schema$1.String,
964
+ phase: Schema$1.Literals([
965
+ "dns-setup",
966
+ "provider-setup",
967
+ "provider-verification",
968
+ "ready",
969
+ "degraded",
970
+ "failed"
971
+ ]),
972
+ dkimSelector: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
973
+ dkimPublicKey: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
974
+ dnsRecords: Schema$1.Array(Schema$1.Struct({
975
+ type: Schema$1.String,
976
+ name: Schema$1.String,
977
+ value: Schema$1.String,
978
+ ttl: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
979
+ description: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
980
+ priority: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]))
981
+ })),
982
+ verifiedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
983
+ isDefault: Schema$1.Boolean,
984
+ defaultSenderId: Schema$1.Union([EmailSenderId, Schema$1.Null]),
985
+ deliverability: DeliverabilityFacts,
1144
986
  createdAt: Schema$1.String,
1145
- expiresAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1146
- lastUsedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
987
+ updatedAt: Schema$1.String
988
+ }).annotate({ identifier: "EmailDomain" });
989
+ const CustomTrackingStatus = Schema$1.Struct({
990
+ enabled: Schema$1.Boolean,
991
+ customTracking: Schema$1.Union([Schema$1.Struct({
992
+ status: Schema$1.Literals([
993
+ "pending",
994
+ "caa-blocked",
995
+ "active",
996
+ "teardown-scheduled",
997
+ "disabled"
998
+ ]),
999
+ label: Schema$1.String,
1000
+ hostname: Schema$1.String,
1001
+ region: Schema$1.String,
1002
+ sslStatus: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1003
+ dnsRecords: Schema$1.Struct({
1004
+ tracking: Schema$1.Union([CustomTrackingDnsRecord, Schema$1.Null]),
1005
+ dcvDelegation: Schema$1.Union([CustomTrackingDnsRecord, Schema$1.Null])
1006
+ }),
1007
+ caaBlocked: Schema$1.Boolean,
1008
+ verificationErrors: Schema$1.Array(Schema$1.String),
1009
+ teardownScheduledAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
1010
+ }), Schema$1.Null])
1011
+ }).annotate({ identifier: "CustomTrackingStatus" });
1012
+ const EmailDomainVerification = Schema$1.Struct({
1013
+ domainId: EmailDomainId,
1014
+ domain: Schema$1.String,
1015
+ phase: Schema$1.Literals([
1016
+ "dns-setup",
1017
+ "provider-setup",
1018
+ "provider-verification",
1019
+ "ready",
1020
+ "degraded",
1021
+ "failed"
1022
+ ]),
1023
+ records: Schema$1.Array(Schema$1.Struct({
1024
+ record: Schema$1.Struct({
1025
+ type: Schema$1.Literals([
1026
+ "A",
1027
+ "AAAA",
1028
+ "CNAME",
1029
+ "MX",
1030
+ "NS",
1031
+ "SOA",
1032
+ "PTR",
1033
+ "SRV",
1034
+ "TXT",
1035
+ "CAA"
1036
+ ]),
1037
+ name: Schema$1.String,
1038
+ value: Schema$1.String,
1039
+ ttl: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1040
+ description: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1041
+ priority: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })), Schema$1.Null]))
1042
+ }),
1043
+ status: Schema$1.Literals([
1044
+ "unchecked",
1045
+ "missing",
1046
+ "mismatch",
1047
+ "found"
1048
+ ]),
1049
+ observedValues: Schema$1.Array(Schema$1.String),
1050
+ checkedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1051
+ resolutionFailure: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
1052
+ code: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1053
+ message: Schema$1.String
1054
+ }), Schema$1.Null]))
1055
+ })),
1056
+ provider: Schema$1.Union([Schema$1.Struct({
1057
+ identity: Schema$1.Literals([
1058
+ "pending",
1059
+ "verified",
1060
+ "failed",
1061
+ "unknown"
1062
+ ]),
1063
+ dkim: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1064
+ "pending",
1065
+ "verified",
1066
+ "failed",
1067
+ "unknown"
1068
+ ]), Schema$1.Null])),
1069
+ mailFrom: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1070
+ "pending",
1071
+ "verified",
1072
+ "failed",
1073
+ "unknown"
1074
+ ]), Schema$1.Null]))
1075
+ }), Schema$1.Null]),
1076
+ operationId: Schema$1.Union([OperationId, Schema$1.Null]),
1077
+ checkedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1078
+ nextCheckAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1079
+ failure: Schema$1.Union([Schema$1.Struct({
1080
+ code: Schema$1.String,
1081
+ message: Schema$1.String,
1082
+ failedAt: Schema$1.String
1083
+ }), Schema$1.Null])
1084
+ }).annotate({ identifier: "EmailDomainVerification" });
1085
+ const SuppressionEntry = Schema$1.Struct({
1086
+ id: SuppressionId,
1087
+ email: Schema$1.String,
1088
+ type: Schema$1.Literals([
1089
+ "bounce",
1090
+ "complaint",
1091
+ "unsubscribe",
1092
+ "manual"
1093
+ ]),
1094
+ bounceType: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1095
+ bounceSubType: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1096
+ reason: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1097
+ messageId: Schema$1.Union([MessageId, Schema$1.Null]),
1147
1098
  isActive: Schema$1.Boolean,
1148
- permissions: Schema$1.optionalKey(ApiKeyPermissions),
1149
- roleName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
1150
- }).annotate({ identifier: "ApiKey" });
1151
- const ApiKeyWithSecret = Schema$1.Struct({
1152
- id: Schema$1.String,
1099
+ expiresAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1100
+ createdAt: Schema$1.String
1101
+ }).annotate({ identifier: "SuppressionEntry" });
1102
+ const EmailRecipientTrackingPreference = Schema$1.Struct({
1103
+ email: TrackingRecipientEmail,
1104
+ optedOut: Schema$1.Boolean,
1105
+ trackingOptedOutAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1106
+ createdAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1107
+ updatedAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
1108
+ }).annotate({ identifier: "EmailRecipientTrackingPreference" });
1109
+ const CreatedMedia = Schema$1.Struct({
1110
+ id: MediaId,
1111
+ organizationId: OrganizationId,
1112
+ status: Schema$1.Literals([
1113
+ "pending",
1114
+ "uploading",
1115
+ "processing",
1116
+ "ready",
1117
+ "failed",
1118
+ "deleted"
1119
+ ]),
1120
+ filename: Schema$1.String,
1121
+ contentType: Schema$1.String,
1122
+ sizeBytes: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
1123
+ width: Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]),
1124
+ height: Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]),
1125
+ durationMs: Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null]),
1126
+ purpose: Schema$1.Literals(["attachment", "avatar"]),
1127
+ checksumSha256: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1128
+ expiresAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1129
+ createdAt: Schema$1.String,
1130
+ confirmedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1131
+ upload: MediaUploadInstruction
1132
+ }).annotate({ identifier: "CreatedMedia" });
1133
+ const Operation = Schema$1.Struct({
1134
+ id: OperationId,
1135
+ organizationId: Schema$1.String,
1136
+ kind: Schema$1.Literals(["email-domain-provisioning", "organization-deletion"]),
1137
+ subject: OperationResource,
1138
+ actor: Schema$1.Struct({
1139
+ type: Schema$1.Literals([
1140
+ "user",
1141
+ "api-key",
1142
+ "system"
1143
+ ]),
1144
+ id: Schema$1.String
1145
+ }),
1146
+ status: Schema$1.Literals([
1147
+ "pending",
1148
+ "running",
1149
+ "succeeded",
1150
+ "failed"
1151
+ ]),
1152
+ phase: Schema$1.Literals([
1153
+ "accepted",
1154
+ "dispatching",
1155
+ "provisioning",
1156
+ "deleting",
1157
+ "finalizing",
1158
+ "completed"
1159
+ ]),
1160
+ error: Schema$1.Union([Schema$1.Struct({
1161
+ code: Schema$1.Literals([
1162
+ "validation-failed",
1163
+ "conflict",
1164
+ "capacity-unavailable",
1165
+ "provider-rejected",
1166
+ "provider-unavailable",
1167
+ "timed-out",
1168
+ "internal"
1169
+ ]),
1170
+ message: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(240).annotate({ expected: "a value with a length of at most 240" }))
1171
+ }), Schema$1.Null]),
1172
+ createdAt: Schema$1.String,
1173
+ updatedAt: Schema$1.String,
1174
+ startedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1175
+ completedAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
1176
+ }).annotate({ identifier: "Operation" });
1177
+ const OperationResourceLink = Schema$1.Struct({
1178
+ resource: OperationResource,
1179
+ href: Schema$1.String.check(Schema$1.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\/v1\\/")).annotate({ expected: "a string matching the RegExp ^\\/v1\\/" }))
1180
+ }).annotate({ identifier: "OperationResourceLink" });
1181
+ const TemplateCompliance = Schema$1.Struct({
1182
+ metaStatus: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1183
+ submittedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
1184
+ qualityScore: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1185
+ rejectedReason: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1186
+ lastSyncedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1187
+ approvalStatus: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1188
+ "draft",
1189
+ "pending",
1190
+ "approved",
1191
+ "published",
1192
+ "rejected",
1193
+ "archived"
1194
+ ]), Schema$1.Null])),
1195
+ approvedBy: Schema$1.optionalKey(Schema$1.Union([UserId, Schema$1.Null])),
1196
+ approvedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1197
+ approvalNotes: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1198
+ regulatoryRequirements: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Struct({
1199
+ region: Schema$1.String,
1200
+ requirement: Schema$1.String,
1201
+ status: Schema$1.Literals([
1202
+ "compliant",
1203
+ "non_compliant",
1204
+ "pending"
1205
+ ]),
1206
+ notes: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
1207
+ })), Schema$1.Null]))
1208
+ }).annotate({ identifier: "TemplateCompliance" });
1209
+ const TemplateFamily = Schema$1.Struct({
1210
+ id: TemplateFamilyId,
1211
+ organizationId: OrganizationId,
1153
1212
  name: Schema$1.String,
1154
- key: SensitiveString,
1155
- start: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1156
- description: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1213
+ members: Schema$1.Array(Schema$1.Struct({
1214
+ id: TemplateId,
1215
+ name: Schema$1.String,
1216
+ slug: Schema$1.String,
1217
+ channel: Schema$1.Literal("email"),
1218
+ variableSchema: Schema$1.Union([Schema$1.Array(TemplateVariable), Schema$1.Null]),
1219
+ status: Schema$1.Literals([
1220
+ "draft",
1221
+ "pending",
1222
+ "approved",
1223
+ "published",
1224
+ "rejected",
1225
+ "archived"
1226
+ ]),
1227
+ isActive: Schema$1.Boolean,
1228
+ version: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1229
+ createdAt: Schema$1.String,
1230
+ updatedAt: Schema$1.String
1231
+ })),
1157
1232
  createdAt: Schema$1.String,
1158
- expiresAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1159
- lastUsedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1160
- isActive: Schema$1.Boolean,
1161
- permissions: Schema$1.optionalKey(ApiKeyPermissions),
1162
- roleName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
1163
- }).annotate({ identifier: "ApiKeyWithSecret" });
1164
- const Union_ = Schema$1.Union([Schema$1.Array(EmailRecipient), Schema$1.Null]);
1165
- const Union_1 = Schema$1.Union([Schema$1.Array(EmailRecipient), Schema$1.Null]);
1233
+ updatedAt: Schema$1.String
1234
+ }).annotate({ identifier: "TemplateFamily" });
1235
+ const EmailAttachments = Schema$1.Union([Schema$1.Array(EmailAttachment).check(Schema$1.isMaxLength(10).annotate({ expected: "a value with a length of at most 10" })), Schema$1.Null]).annotate({ identifier: "EmailAttachments" });
1166
1236
  const EmailRecipients = Schema$1.Array(EmailRecipient).check(Schema$1.isMinLength(1).annotate({
1167
1237
  expected: "a value with a length of at least 1",
1168
1238
  identifier: "EmailRecipients"
1169
1239
  }));
1170
- const SmsRecipients = Schema$1.Array(SmsRecipient).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(1).annotate({
1171
- expected: "a value with a length of at most 1",
1172
- identifier: "SmsRecipients"
1173
- }));
1174
- const WhatsAppRecipients = Schema$1.Array(WhatsAppRecipient).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(1).annotate({
1175
- expected: "a value with a length of at most 1",
1176
- identifier: "WhatsAppRecipients"
1177
- }));
1178
- const SmsContent = Schema$1.Struct({
1179
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1180
- templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
1181
- templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1182
- templateData: Schema$1.optionalKey(SmsTemplateData)
1183
- }).annotate({ identifier: "SmsContent" });
1184
- const SmsDispatchContent = Schema$1.Struct({
1185
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1186
- templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
1187
- templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1188
- templateData: Schema$1.optionalKey(SmsTemplateData)
1189
- }).annotate({ identifier: "SmsDispatchContent" });
1190
- const WhatsAppContent = Schema$1.Struct({
1191
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1192
- mediaUrl: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1193
- mediaType: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1194
- "image",
1195
- "video",
1196
- "audio",
1197
- "document"
1198
- ]), Schema$1.Null])),
1199
- templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
1200
- templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1201
- templateCategory: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1202
- "marketing",
1203
- "utility",
1204
- "authentication"
1205
- ]), Schema$1.Null])),
1206
- templateData: Schema$1.optionalKey(WhatsAppTemplateData)
1207
- }).annotate({ identifier: "WhatsAppContent" });
1208
- const WhatsAppDispatchContent = Schema$1.Struct({
1209
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1210
- mediaUrl: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1211
- mediaType: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1212
- "image",
1213
- "video",
1214
- "audio",
1215
- "document"
1216
- ]), Schema$1.Null])),
1217
- templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
1218
- templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1219
- templateCategory: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1220
- "marketing",
1221
- "utility",
1222
- "authentication"
1223
- ]), Schema$1.Null])),
1224
- templateData: Schema$1.optionalKey(WhatsAppTemplateData)
1225
- }).annotate({ identifier: "WhatsAppDispatchContent" });
1226
- const OperationAccepted = Schema$1.Struct({
1227
- operation: Operation,
1228
- links: Schema$1.Struct({
1229
- self: Schema$1.String.check(Schema$1.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\/v1\\/")).annotate({ expected: "a string matching the RegExp ^\\/v1\\/" })),
1230
- resource: OperationResourceLink
1231
- })
1232
- }).annotate({ identifier: "OperationAccepted" });
1233
- const EmailContent = Schema$1.Struct({
1234
- subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1235
- html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1236
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1237
- attachments: Schema$1.optionalKey(EmailAttachments),
1238
- templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
1239
- templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1240
- templateData: Schema$1.optionalKey(TemplateData),
1241
- inReplyToMessageId: Schema$1.optionalKey(Schema$1.Union([MessageId, Schema$1.Null])),
1242
- replyTo: Schema$1.optionalKey(ReplyToAddresses),
1243
- unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([UnsubscribeId, Schema$1.Null])),
1244
- tracking: Schema$1.optionalKey(EmailTrackingOverrideV1),
1245
- footer: Schema$1.optionalKey(EmailFooterOverride)
1246
- }).annotate({ identifier: "EmailContent" });
1247
- const EmailDispatchContent = Schema$1.Struct({
1248
- subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1249
- html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1250
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1251
- attachments: Schema$1.optionalKey(EmailAttachments),
1252
- templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
1253
- templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1254
- templateData: Schema$1.optionalKey(TemplateData),
1255
- inReplyToMessageId: Schema$1.optionalKey(Schema$1.Union([MessageId, Schema$1.Null])),
1256
- replyTo: Schema$1.optionalKey(ReplyToAddresses),
1257
- unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([UnsubscribeId, Schema$1.Null])),
1258
- tracking: Schema$1.optionalKey(EmailTrackingOverrideV1),
1259
- footer: Schema$1.optionalKey(EmailFooterOverride)
1260
- }).annotate({ identifier: "EmailDispatchContent" });
1261
- const DesignSettings = Schema$1.Struct({
1262
- design: Schema$1.Union([Design, Schema$1.Null]),
1263
- footerCompleteness: Schema$1.Struct({ missingAddress: Schema$1.Boolean })
1264
- }).annotate({ identifier: "DesignSettings" });
1265
- const Organization = Schema$1.Struct({
1266
- id: Schema$1.String,
1267
- billingAccountId: Schema$1.String,
1240
+ const EmailCcRecipients = Schema$1.Union([Schema$1.Union([Schema$1.Array(EmailRecipient), Schema$1.Null]), Schema$1.Null]).annotate({ identifier: "EmailCcRecipients" });
1241
+ const EmailBccRecipients = Schema$1.Union([Schema$1.Union([Schema$1.Array(EmailRecipient), Schema$1.Null]), Schema$1.Null]).annotate({ identifier: "EmailBccRecipients" });
1242
+ const CompletedMedia = Schema$1.Struct({
1243
+ media: Media,
1244
+ downloadUrl: Schema$1.String
1245
+ }).annotate({ identifier: "CompletedMedia" });
1246
+ const ContactListItem = Schema$1.Struct({
1247
+ id: ContactId,
1248
+ organizationId: OrganizationId,
1249
+ type: Schema$1.Literals(["human", "system"]),
1250
+ name: Schema$1.String,
1251
+ displayName: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1252
+ avatar: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1253
+ identities: Schema$1.Array(ContactIdentity),
1254
+ humanProfile: Schema$1.Union([HumanProfile, Schema$1.Null]),
1255
+ capabilities: Schema$1.Array(Schema$1.String),
1256
+ tags: Schema$1.Array(Schema$1.String),
1257
+ accessLevel: Schema$1.Literals([
1258
+ "public",
1259
+ "authenticated",
1260
+ "vip",
1261
+ "internal"
1262
+ ]),
1263
+ accessConfig: Schema$1.Union([ContactAccessConfig, Schema$1.Null]),
1264
+ preferences: Schema$1.Union([ContactPreferences, Schema$1.Null]),
1265
+ status: Schema$1.Literals([
1266
+ "active",
1267
+ "paused",
1268
+ "blocked",
1269
+ "archived"
1270
+ ]),
1271
+ statusReason: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1272
+ externalId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1273
+ metadata: Schema$1.Union([JsonObject, Schema$1.Null]),
1274
+ createdAt: Schema$1.String,
1275
+ updatedAt: Schema$1.String,
1276
+ createdBy: Schema$1.Union([ContactId, Schema$1.Null]),
1277
+ lastModifiedBy: Schema$1.Union([ContactId, Schema$1.Null]),
1278
+ engagement: ContactActivitySummary
1279
+ }).annotate({ identifier: "ContactListItem" });
1280
+ const Contact = Schema$1.Struct({
1281
+ id: ContactId,
1282
+ organizationId: OrganizationId,
1283
+ type: Schema$1.Literals(["human", "system"]),
1268
1284
  name: Schema$1.String,
1269
- slug: Schema$1.String,
1270
- defaultCurrency: Schema$1.String,
1271
- countryCode: Schema$1.String,
1272
- timezone: Schema$1.String,
1273
- billingEmail: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1274
- plan: Schema$1.String,
1275
- isActive: Schema$1.Boolean,
1285
+ displayName: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1286
+ avatar: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1287
+ identities: Schema$1.Array(ContactIdentity),
1288
+ humanProfile: Schema$1.Union([HumanProfile, Schema$1.Null]),
1289
+ capabilities: Schema$1.Array(Schema$1.String),
1290
+ tags: Schema$1.Array(Schema$1.String),
1291
+ accessLevel: Schema$1.Literals([
1292
+ "public",
1293
+ "authenticated",
1294
+ "vip",
1295
+ "internal"
1296
+ ]),
1297
+ accessConfig: Schema$1.Union([ContactAccessConfig, Schema$1.Null]),
1298
+ preferences: Schema$1.Union([ContactPreferences, Schema$1.Null]),
1299
+ status: Schema$1.Literals([
1300
+ "active",
1301
+ "paused",
1302
+ "blocked",
1303
+ "archived"
1304
+ ]),
1305
+ statusReason: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1306
+ externalId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1307
+ metadata: Schema$1.Union([JsonObject, Schema$1.Null]),
1276
1308
  createdAt: Schema$1.String,
1277
1309
  updatedAt: Schema$1.String,
1278
- metadata: Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]),
1279
- design: Schema$1.Union([Design, Schema$1.Null]),
1280
- replyToDefault: Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]),
1281
- defaultUnsubscribeGroupId: Schema$1.Union([UnsubscribeId, Schema$1.Null]),
1282
- emailFooterEnabledDefault: Schema$1.Union([Schema$1.Boolean, Schema$1.Null]),
1283
- messagesUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1284
- messagesUsedThisMonth: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1285
- smsUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1286
- smsUsedThisMonth: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1287
- whatsappUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1288
- whatsappUsedThisMonth: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1289
- emailUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1290
- emailUsedThisMonth: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1291
- contactsUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1292
- conversationsUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1293
- teamMembersUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1294
- messagesResetAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
1295
- }).annotate({ identifier: "Organization" });
1310
+ createdBy: Schema$1.Union([ContactId, Schema$1.Null]),
1311
+ lastModifiedBy: Schema$1.Union([ContactId, Schema$1.Null])
1312
+ }).annotate({ identifier: "Contact" });
1296
1313
  const Conversation = Schema$1.Struct({
1297
1314
  id: ConversationId,
1298
1315
  organizationId: OrganizationId,
@@ -1300,16 +1317,8 @@ const Conversation = Schema$1.Struct({
1300
1317
  description: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1301
1318
  externalId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1302
1319
  parentConversationId: Schema$1.Union([ConversationId, Schema$1.Null]),
1303
- channels: Schema$1.Array(Schema$1.Literals([
1304
- "sms",
1305
- "whatsapp",
1306
- "email"
1307
- ])),
1308
- primaryChannel: Schema$1.Literals([
1309
- "sms",
1310
- "whatsapp",
1311
- "email"
1312
- ]),
1320
+ channels: Schema$1.Array(Schema$1.Literal("email")),
1321
+ primaryChannel: Schema$1.Literal("email"),
1313
1322
  status: Schema$1.Literals([
1314
1323
  "active",
1315
1324
  "waiting",
@@ -1357,76 +1366,108 @@ const Conversation = Schema$1.Struct({
1357
1366
  updatedAt: Schema$1.String,
1358
1367
  createdBy: Schema$1.Union([ActorId, Schema$1.Null])
1359
1368
  }).annotate({ identifier: "Conversation" });
1360
- const Contact = Schema$1.Struct({
1361
- id: ContactId,
1369
+ const ConversationDetail = Schema$1.Struct({
1370
+ id: ConversationId,
1362
1371
  organizationId: OrganizationId,
1363
- type: Schema$1.Literals(["human", "system"]),
1364
- name: Schema$1.String,
1365
- displayName: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1366
- avatar: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1367
- identities: Schema$1.Array(ContactIdentity),
1368
- humanProfile: Schema$1.Union([HumanProfile, Schema$1.Null]),
1369
- capabilities: Schema$1.Array(Schema$1.String),
1370
- tags: Schema$1.Array(Schema$1.String),
1371
- engagement: UnknownRecord,
1372
- accessLevel: Schema$1.Literals([
1373
- "public",
1374
- "authenticated",
1375
- "vip",
1376
- "internal"
1377
- ]),
1378
- accessConfig: Schema$1.Union([ContactAccessConfig, Schema$1.Null]),
1379
- preferences: Schema$1.Union([ContactPreferences, Schema$1.Null]),
1372
+ title: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1373
+ description: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1374
+ externalId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1375
+ parentConversationId: Schema$1.Union([ConversationId, Schema$1.Null]),
1376
+ channels: Schema$1.Array(Schema$1.Literal("email")),
1377
+ primaryChannel: Schema$1.Literal("email"),
1380
1378
  status: Schema$1.Literals([
1381
1379
  "active",
1382
- "paused",
1383
- "blocked",
1380
+ "waiting",
1381
+ "resolved",
1382
+ "escalated",
1384
1383
  "archived"
1385
1384
  ]),
1386
1385
  statusReason: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1387
- externalId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1388
- metadata: Schema$1.Union([JsonObject, Schema$1.Null]),
1386
+ priority: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
1387
+ urgency: Schema$1.Literals([
1388
+ "low",
1389
+ "medium",
1390
+ "high",
1391
+ "critical"
1392
+ ]),
1393
+ complexity: Schema$1.Literals([
1394
+ "simple",
1395
+ "moderate",
1396
+ "complex"
1397
+ ]),
1398
+ metadata: Schema$1.Union([ConversationMetadata, Schema$1.Null]),
1399
+ actorTracking: ActorTracking,
1400
+ metrics: ConversationMetrics,
1401
+ context: Schema$1.Union([ConversationContext, Schema$1.Null]),
1402
+ tags: Schema$1.Array(Schema$1.String),
1403
+ categories: Schema$1.Array(Schema$1.String),
1404
+ isTest: Schema$1.Boolean,
1405
+ isInternal: Schema$1.Boolean,
1406
+ isPrivate: Schema$1.Boolean,
1407
+ startedAt: Schema$1.String,
1408
+ lastActivityAt: Schema$1.String,
1409
+ lastHumanActivityAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1410
+ resolvedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1411
+ archivedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1412
+ resolvedBy: Schema$1.Union([ActorId, Schema$1.Null]),
1413
+ resolutionType: Schema$1.Union([Schema$1.Literals([
1414
+ "automated",
1415
+ "human_assisted",
1416
+ "escalated",
1417
+ "abandoned",
1418
+ "timeout"
1419
+ ]), Schema$1.Null]),
1420
+ resolutionNotes: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1389
1421
  createdAt: Schema$1.String,
1390
1422
  updatedAt: Schema$1.String,
1391
- createdBy: Schema$1.Union([ContactId, Schema$1.Null]),
1392
- lastModifiedBy: Schema$1.Union([ContactId, Schema$1.Null])
1393
- }).annotate({ identifier: "Contact" });
1394
- const CreateTemplatePayload = Schema$1.Struct({
1395
- name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
1396
- slug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1397
- origin: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals(["dashboard", "tsx"]), Schema$1.Null])),
1398
- description: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
1399
- category: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literals([
1400
- "transactional",
1401
- "marketing",
1402
- "support",
1403
- "notification",
1404
- "verification",
1405
- "reminder",
1406
- "alert"
1407
- ]), Schema$1.Null]), Schema$1.Null])),
1408
- source: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
1409
- subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1410
- headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null]), Schema$1.Null])),
1411
- variableSchema: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(TemplateVariable), Schema$1.Null]), Schema$1.Null])),
1412
- compliance: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplateCompliance, Schema$1.Null]), Schema$1.Null])),
1413
- performance: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplatePerformance, Schema$1.Null]), Schema$1.Null])),
1414
- designOverrides: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Design, Schema$1.Null]), Schema$1.Null])),
1415
- isActive: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
1416
- isDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
1417
- version: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]))
1418
- }).annotate({ identifier: "CreateTemplatePayload" });
1423
+ createdBy: Schema$1.Union([ActorId, Schema$1.Null]),
1424
+ participants: Schema$1.Array(ConversationParticipant)
1425
+ }).annotate({ identifier: "ConversationDetail" });
1426
+ const DesignSettings = Schema$1.Struct({
1427
+ design: Schema$1.Union([Design, Schema$1.Null]),
1428
+ footerCompleteness: Schema$1.Struct({ missingAddress: Schema$1.Boolean })
1429
+ }).annotate({ identifier: "DesignSettings" });
1430
+ const Organization = Schema$1.Struct({
1431
+ id: Schema$1.String,
1432
+ billingAccountId: Schema$1.String,
1433
+ name: Schema$1.String,
1434
+ slug: Schema$1.String,
1435
+ defaultCurrency: Schema$1.String,
1436
+ countryCode: Schema$1.String,
1437
+ timezone: Schema$1.String,
1438
+ billingEmail: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1439
+ plan: Schema$1.String,
1440
+ isActive: Schema$1.Boolean,
1441
+ createdAt: Schema$1.String,
1442
+ updatedAt: Schema$1.String,
1443
+ metadata: Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]),
1444
+ design: Schema$1.Union([Design, Schema$1.Null]),
1445
+ replyToDefault: Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]),
1446
+ defaultUnsubscribeGroupId: Schema$1.Union([UnsubscribeId, Schema$1.Null]),
1447
+ emailFooterEnabledDefault: Schema$1.Union([Schema$1.Boolean, Schema$1.Null]),
1448
+ messagesUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1449
+ messagesUsedThisMonth: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1450
+ emailUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1451
+ emailUsedThisMonth: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1452
+ contactsUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1453
+ conversationsUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1454
+ teamMembersUsed: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1455
+ messagesResetAt: Schema$1.Union([Schema$1.String, Schema$1.Null])
1456
+ }).annotate({ identifier: "Organization" });
1457
+ const OperationAccepted = Schema$1.Struct({
1458
+ operation: Operation,
1459
+ links: Schema$1.Struct({
1460
+ self: Schema$1.String.check(Schema$1.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\/v1\\/")).annotate({ expected: "a string matching the RegExp ^\\/v1\\/" })),
1461
+ resource: OperationResourceLink
1462
+ })
1463
+ }).annotate({ identifier: "OperationAccepted" });
1419
1464
  const Template = Schema$1.Struct({
1420
1465
  id: TemplateId,
1421
1466
  organizationId: OrganizationId,
1422
1467
  name: Schema$1.String,
1423
1468
  slug: Schema$1.String,
1424
1469
  familyId: Schema$1.Union([TemplateFamilyId, Schema$1.Null]),
1425
- channel: Schema$1.Literals([
1426
- "sms",
1427
- "whatsapp",
1428
- "email"
1429
- ]),
1470
+ channel: Schema$1.Literal("email"),
1430
1471
  origin: Schema$1.Literals(["dashboard", "tsx"]),
1431
1472
  description: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1432
1473
  category: Schema$1.Union([Schema$1.String, Schema$1.Null]),
@@ -1436,99 +1477,11 @@ const Template = Schema$1.Struct({
1436
1477
  opens: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
1437
1478
  clicks: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null]))
1438
1479
  }), Schema$1.Null])),
1439
- source: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1440
1480
  email: Schema$1.Union([Schema$1.Struct({
1441
1481
  subject: Schema$1.String,
1442
1482
  preheader: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1443
1483
  headers: Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])
1444
1484
  }), Schema$1.Null]),
1445
- sms: Schema$1.Union([Schema$1.Struct({
1446
- body: Schema$1.String,
1447
- encoding: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1448
- estimatedSegments: Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })), Schema$1.Null]),
1449
- category: Schema$1.Union([Schema$1.Literals([
1450
- "transactional",
1451
- "promotional",
1452
- "service_implicit"
1453
- ]), Schema$1.Null])
1454
- }), Schema$1.Null]),
1455
- whatsapp: Schema$1.Union([Schema$1.Struct({
1456
- name: Schema$1.String,
1457
- language: Schema$1.String,
1458
- category: Schema$1.Literals([
1459
- "marketing",
1460
- "utility",
1461
- "authentication",
1462
- "service"
1463
- ]),
1464
- headerType: Schema$1.Union([Schema$1.Literals([
1465
- "text",
1466
- "image",
1467
- "video",
1468
- "document",
1469
- "none"
1470
- ]), Schema$1.Null]),
1471
- headerMediaType: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1472
- headerContent: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1473
- bodyContent: Schema$1.String,
1474
- footerContent: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1475
- components: Schema$1.Union([Schema$1.Array(Schema$1.Struct({
1476
- type: Schema$1.Literals([
1477
- "header",
1478
- "body",
1479
- "footer",
1480
- "button"
1481
- ]),
1482
- format: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
1483
- "TEXT",
1484
- "IMAGE",
1485
- "VIDEO",
1486
- "DOCUMENT"
1487
- ]), Schema$1.Null])),
1488
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1489
- example: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
1490
- header_text: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
1491
- body_text: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Array(Schema$1.String)), Schema$1.Null]))
1492
- }), Schema$1.Null])),
1493
- buttons: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Struct({
1494
- type: Schema$1.Literals([
1495
- "QUICK_REPLY",
1496
- "URL",
1497
- "PHONE_NUMBER",
1498
- "COPY_CODE"
1499
- ]),
1500
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1501
- url: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1502
- phone_number: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1503
- example: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
1504
- })), Schema$1.Null])),
1505
- parameters: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Struct({
1506
- type: Schema$1.Literals([
1507
- "text",
1508
- "currency",
1509
- "date_time",
1510
- "image",
1511
- "document",
1512
- "video"
1513
- ]),
1514
- text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1515
- currency: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
1516
- fallback_value: Schema$1.String,
1517
- code: Schema$1.String,
1518
- amount_1000: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
1519
- }), Schema$1.Null])),
1520
- date_time: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({ fallback_value: Schema$1.String }), Schema$1.Null])),
1521
- image: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({ link: Schema$1.String }), Schema$1.Null])),
1522
- document: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
1523
- link: Schema$1.String,
1524
- filename: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
1525
- }), Schema$1.Null])),
1526
- video: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({ link: Schema$1.String }), Schema$1.Null]))
1527
- })), Schema$1.Null]))
1528
- })), Schema$1.Null]),
1529
- buttons: Schema$1.Union([Schema$1.Array(Schema$1.Record(Schema$1.String, JsonValue)), Schema$1.Null]),
1530
- examples: Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null])
1531
- }), Schema$1.Null]),
1532
1485
  variableSchema: Schema$1.Union([Schema$1.Array(TemplateVariable), Schema$1.Null]),
1533
1486
  compliance: Schema$1.Union([TemplateCompliance, Schema$1.Null]),
1534
1487
  designOverrides: Schema$1.Union([Design, Schema$1.Null]),
@@ -1538,14 +1491,13 @@ const Template = Schema$1.Struct({
1538
1491
  isActive: Schema$1.Boolean,
1539
1492
  isDefault: Schema$1.Boolean,
1540
1493
  version: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
1541
- publishedSource: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
1542
1494
  publishedAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
1543
1495
  publishedBy: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
1544
1496
  createdAt: Schema$1.String,
1545
1497
  updatedAt: Schema$1.String
1546
1498
  }).annotate({ identifier: "Template" });
1547
- const UpdateTemplatePayload = Schema$1.Struct({ data: Schema$1.Struct({
1548
- name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1499
+ const CreateTemplatePayload = Schema$1.Struct({
1500
+ name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
1549
1501
  slug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1550
1502
  origin: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals(["dashboard", "tsx"]), Schema$1.Null])),
1551
1503
  description: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
@@ -1558,9 +1510,7 @@ const UpdateTemplatePayload = Schema$1.Struct({ data: Schema$1.Struct({
1558
1510
  "reminder",
1559
1511
  "alert"
1560
1512
  ]), Schema$1.Null]), Schema$1.Null])),
1561
- fromDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplateFromDefault, Schema$1.Null]), Schema$1.Null])),
1562
- replyToDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]), Schema$1.Null])),
1563
- source: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
1513
+ source: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
1564
1514
  subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1565
1515
  headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null]), Schema$1.Null])),
1566
1516
  variableSchema: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(TemplateVariable), Schema$1.Null]), Schema$1.Null])),
@@ -1570,79 +1520,75 @@ const UpdateTemplatePayload = Schema$1.Struct({ data: Schema$1.Struct({
1570
1520
  isActive: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
1571
1521
  isDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
1572
1522
  version: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]))
1573
- }) }).annotate({ identifier: "UpdateTemplatePayload" });
1574
- const EmailBccRecipients = Schema$1.Union([Union_, Schema$1.Null]).annotate({ identifier: "EmailBccRecipients" });
1575
- const EmailCcRecipients = Schema$1.Union([Union_1, Schema$1.Null]).annotate({ identifier: "EmailCcRecipients" });
1576
- const SmsCampaignContent = Schema$1.Struct({
1577
- channel: Schema$1.Literal("sms"),
1578
- sms: SmsContent,
1579
- conversationId: Schema$1.optionalKey(CampaignConversationRef),
1580
- metadata: Schema$1.optionalKey(CampaignContentMetadata)
1581
- }).annotate({ identifier: "SmsCampaignContent" });
1582
- const SmsSendMessagePayload = Schema$1.Struct({
1583
- conversationId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null])),
1584
- metadata: Schema$1.optionalKey(MessageMetadata),
1585
- channel: Schema$1.Literal("sms"),
1586
- to: SmsRecipients,
1587
- sms: SmsContent
1588
- }).annotate({
1589
- description: "SMS sending is coming soon. The payload is accepted by the contract today and the endpoint answers 403 until the channel launches for your organization.",
1590
- identifier: "SmsSendMessagePayload"
1591
- });
1592
- const SmsCampaignContentInput = Schema$1.Struct({
1593
- channel: Schema$1.Literal("sms"),
1594
- sms: SmsDispatchContent,
1595
- conversationId: Schema$1.optionalKey(CampaignConversationRef),
1596
- metadata: Schema$1.optionalKey(CampaignContentMetadata)
1597
- }).annotate({ identifier: "SmsCampaignContentInput" });
1598
- const SmsDispatchSendMessagePayload = Schema$1.Struct({
1599
- conversationId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null])),
1600
- metadata: Schema$1.optionalKey(MessageMetadata),
1601
- channel: Schema$1.Literal("sms"),
1602
- to: SmsRecipients,
1603
- sms: SmsDispatchContent
1604
- }).annotate({
1605
- description: "SMS sending is coming soon. The payload is accepted by the contract today and the endpoint answers 403 until the channel launches for your organization.",
1606
- identifier: "SmsDispatchSendMessagePayload"
1607
- });
1608
- const WhatsAppCampaignContent = Schema$1.Struct({
1609
- channel: Schema$1.Literal("whatsapp"),
1610
- whatsapp: WhatsAppContent,
1611
- conversationId: Schema$1.optionalKey(CampaignConversationRef),
1612
- metadata: Schema$1.optionalKey(CampaignContentMetadata)
1613
- }).annotate({ identifier: "WhatsAppCampaignContent" });
1614
- const WhatsAppSendMessagePayload = Schema$1.Struct({
1615
- conversationId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null])),
1616
- metadata: Schema$1.optionalKey(MessageMetadata),
1617
- channel: Schema$1.Literal("whatsapp"),
1618
- to: WhatsAppRecipients,
1619
- whatsapp: WhatsAppContent
1620
- }).annotate({
1621
- description: "WhatsApp sending is coming soon. The payload is accepted by the contract today and the endpoint answers 403 until the channel launches for your organization.",
1622
- identifier: "WhatsAppSendMessagePayload"
1623
- });
1624
- const WhatsAppCampaignContentInput = Schema$1.Struct({
1625
- channel: Schema$1.Literal("whatsapp"),
1626
- whatsapp: WhatsAppDispatchContent,
1627
- conversationId: Schema$1.optionalKey(CampaignConversationRef),
1628
- metadata: Schema$1.optionalKey(CampaignContentMetadata)
1629
- }).annotate({ identifier: "WhatsAppCampaignContentInput" });
1630
- const WhatsAppDispatchSendMessagePayload = Schema$1.Struct({
1631
- conversationId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null])),
1632
- metadata: Schema$1.optionalKey(MessageMetadata),
1633
- channel: Schema$1.Literal("whatsapp"),
1634
- to: WhatsAppRecipients,
1635
- whatsapp: WhatsAppDispatchContent
1636
- }).annotate({
1637
- description: "WhatsApp sending is coming soon. The payload is accepted by the contract today and the endpoint answers 403 until the channel launches for your organization.",
1638
- identifier: "WhatsAppDispatchSendMessagePayload"
1639
- });
1523
+ }).annotate({ identifier: "CreateTemplatePayload" });
1524
+ const UpdateTemplatePayload = Schema$1.Struct({ data: Schema$1.Struct({
1525
+ name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1526
+ slug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1527
+ origin: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals(["dashboard", "tsx"]), Schema$1.Null])),
1528
+ description: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
1529
+ category: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Literals([
1530
+ "transactional",
1531
+ "marketing",
1532
+ "support",
1533
+ "notification",
1534
+ "verification",
1535
+ "reminder",
1536
+ "alert"
1537
+ ]), Schema$1.Null]), Schema$1.Null])),
1538
+ fromDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplateFromDefault, Schema$1.Null]), Schema$1.Null])),
1539
+ replyToDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]), Schema$1.Null])),
1540
+ variableSchema: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(TemplateVariable), Schema$1.Null]), Schema$1.Null])),
1541
+ compliance: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplateCompliance, Schema$1.Null]), Schema$1.Null])),
1542
+ performance: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplatePerformance, Schema$1.Null]), Schema$1.Null])),
1543
+ designOverrides: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Design, Schema$1.Null]), Schema$1.Null])),
1544
+ isActive: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
1545
+ isDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
1546
+ version: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema$1.Null]))
1547
+ }) }).annotate({ identifier: "UpdateTemplatePayload" });
1548
+ const EmailContent = Schema$1.Struct({
1549
+ subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1550
+ html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1551
+ text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1552
+ attachments: Schema$1.optionalKey(EmailAttachments),
1553
+ templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
1554
+ templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1555
+ templateData: Schema$1.optionalKey(TemplateData),
1556
+ inReplyToMessageId: Schema$1.optionalKey(Schema$1.Union([MessageId, Schema$1.Null])),
1557
+ replyTo: Schema$1.optionalKey(ReplyToAddresses),
1558
+ unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([UnsubscribeId, Schema$1.Null])),
1559
+ tracking: Schema$1.optionalKey(EmailTrackingOverrideV1),
1560
+ footer: Schema$1.optionalKey(EmailFooterOverride)
1561
+ }).annotate({ identifier: "EmailContent" });
1562
+ const EmailDispatchContent = Schema$1.Struct({
1563
+ subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1564
+ html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1565
+ text: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
1566
+ attachments: Schema$1.optionalKey(EmailAttachments),
1567
+ templateId: Schema$1.optionalKey(Schema$1.Union([TemplateId, Schema$1.Null])),
1568
+ templateSlug: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema$1.Null])),
1569
+ templateData: Schema$1.optionalKey(TemplateData),
1570
+ inReplyToMessageId: Schema$1.optionalKey(Schema$1.Union([MessageId, Schema$1.Null])),
1571
+ replyTo: Schema$1.optionalKey(ReplyToAddresses),
1572
+ unsubscribeGroupId: Schema$1.optionalKey(Schema$1.Union([UnsubscribeId, Schema$1.Null])),
1573
+ tracking: Schema$1.optionalKey(EmailTrackingOverrideV1),
1574
+ footer: Schema$1.optionalKey(EmailFooterOverride)
1575
+ }).annotate({ identifier: "EmailDispatchContent" });
1640
1576
  const EmailCampaignContent = Schema$1.Struct({
1641
1577
  channel: Schema$1.Literal("email"),
1642
1578
  email: EmailContent,
1643
1579
  conversationId: Schema$1.optionalKey(CampaignConversationRef),
1644
1580
  metadata: Schema$1.optionalKey(CampaignContentMetadata)
1645
1581
  }).annotate({ identifier: "EmailCampaignContent" });
1582
+ const EmailSendMessagePayload = Schema$1.Struct({
1583
+ conversationId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null])),
1584
+ metadata: Schema$1.optionalKey(MessageMetadata),
1585
+ channel: Schema$1.Literal("email"),
1586
+ to: EmailRecipients,
1587
+ cc: Schema$1.optionalKey(EmailCcRecipients),
1588
+ bcc: Schema$1.optionalKey(EmailBccRecipients),
1589
+ from: Schema$1.optionalKey(EmailSender),
1590
+ email: EmailContent
1591
+ }).annotate({ identifier: "EmailSendMessagePayload" });
1646
1592
  const EmailCampaignContentInput = Schema$1.Struct({
1647
1593
  channel: Schema$1.Literal("email"),
1648
1594
  email: EmailDispatchContent,
@@ -1659,49 +1605,20 @@ const EmailDispatchSendMessagePayload = Schema$1.Struct({
1659
1605
  from: Schema$1.optionalKey(EmailSender),
1660
1606
  email: EmailDispatchContent
1661
1607
  }).annotate({ identifier: "EmailDispatchSendMessagePayload" });
1662
- const EmailSendMessagePayload = Schema$1.Struct({
1663
- conversationId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null])),
1664
- metadata: Schema$1.optionalKey(MessageMetadata),
1665
- channel: Schema$1.Literal("email"),
1666
- to: EmailRecipients,
1667
- cc: Schema$1.optionalKey(EmailCcRecipients),
1668
- bcc: Schema$1.optionalKey(EmailBccRecipients),
1669
- from: Schema$1.optionalKey(EmailSender),
1670
- email: EmailContent
1671
- }).annotate({ identifier: "EmailSendMessagePayload" });
1672
- const CampaignContent = Schema$1.Union([
1673
- EmailCampaignContent,
1674
- SmsCampaignContent,
1675
- WhatsAppCampaignContent
1676
- ]).annotate({ identifier: "CampaignContent" });
1677
- const CampaignContentInput = Schema$1.Union([
1678
- EmailCampaignContentInput,
1679
- SmsCampaignContentInput,
1680
- WhatsAppCampaignContentInput
1681
- ]).annotate({ identifier: "CampaignContentInput" });
1682
- const DispatchSendMessagePayload = Schema$1.Union([
1683
- EmailDispatchSendMessagePayload,
1684
- SmsDispatchSendMessagePayload,
1685
- WhatsAppDispatchSendMessagePayload
1686
- ]).annotate({ identifier: "DispatchSendMessagePayload" });
1687
- const SendMessagePayload = Schema$1.Union([
1688
- EmailSendMessagePayload,
1689
- SmsSendMessagePayload,
1690
- WhatsAppSendMessagePayload
1691
- ]).annotate({ identifier: "SendMessagePayload" });
1608
+ const CampaignContent = Schema$1.Union([EmailCampaignContent]).annotate({ identifier: "CampaignContent" });
1609
+ const SendMessagePayload = Schema$1.Union([EmailSendMessagePayload]).annotate({ identifier: "SendMessagePayload" });
1610
+ const CampaignContentInput = Schema$1.Union([EmailCampaignContentInput]).annotate({ identifier: "CampaignContentInput" });
1611
+ const DispatchSendMessagePayload = Schema$1.Union([EmailDispatchSendMessagePayload]).annotate({ identifier: "DispatchSendMessagePayload" });
1692
1612
  const Campaign = Schema$1.Struct({
1693
1613
  id: CampaignId,
1694
1614
  name: Schema$1.String,
1695
- channel: Schema$1.Literals([
1696
- "sms",
1697
- "whatsapp",
1698
- "email"
1699
- ]),
1615
+ channel: Schema$1.Literal("email"),
1700
1616
  content: CampaignContent,
1701
1617
  audience: CampaignAudience,
1702
1618
  policy: CampaignPolicy,
1703
- status: Schema$1.Literals(["draft", "archived"]),
1704
- createdBy: Schema$1.String,
1619
+ definition: CampaignDefinitionSummary,
1620
+ latestRun: Schema$1.Union([CampaignLatestRun, Schema$1.Null]),
1621
+ createdBy: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1705
1622
  actorEmail: Schema$1.String,
1706
1623
  memberRole: Schema$1.String,
1707
1624
  createdAt: Schema$1.String,
@@ -1732,7 +1649,7 @@ const CampaignRun = Schema$1.Struct({
1732
1649
  skippedCount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1733
1650
  failureReason: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1734
1651
  lastContactId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1735
- createdBy: Schema$1.String,
1652
+ createdBy: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1736
1653
  actorEmail: Schema$1.String,
1737
1654
  memberRole: Schema$1.String,
1738
1655
  createdAt: Schema$1.String,
@@ -1749,25 +1666,13 @@ const ScheduledMessage = Schema$1.Struct({
1749
1666
  ]),
1750
1667
  scheduledFor: Schema$1.String,
1751
1668
  timezone: Schema$1.String,
1752
- send: Schema$1.Union([SendMessagePayload, Schema$1.Struct({
1753
- kind: Schema$1.Literal("editor-session-snapshot"),
1754
- channel: Schema$1.Literals([
1755
- "email",
1756
- "sms",
1757
- "whatsapp"
1758
- ]),
1759
- sessionId: Schema$1.String,
1760
- revision: Schema$1.String,
1761
- templateId: TemplateId,
1762
- templateVersion: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
1763
- isTest: Schema$1.Boolean
1764
- })]),
1669
+ send: SendMessagePayload,
1765
1670
  messageId: Schema$1.Union([MessageId, Schema$1.Null]),
1766
1671
  idempotencyKey: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1767
1672
  referenceId: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1768
1673
  failureReason: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1769
1674
  attempts: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
1770
- createdBy: Schema$1.String,
1675
+ createdBy: Schema$1.Union([Schema$1.String, Schema$1.Null]),
1771
1676
  actorEmail: Schema$1.String,
1772
1677
  memberRole: Schema$1.String,
1773
1678
  createdAt: Schema$1.String,
@@ -1807,8 +1712,9 @@ const ApiKeysCreateRequestJson = Schema$1.Struct({
1807
1712
  const ApiKeysCreate201 = ApiKeyWithSecret;
1808
1713
  const ApiKeysCreate401 = UnauthorizedError;
1809
1714
  const ApiKeysCreate402 = PaymentRequiredError;
1810
- const ApiKeysCreate403 = ForbiddenError;
1715
+ const ApiKeysCreate403 = Schema$1.Union([ForbiddenError]);
1811
1716
  const ApiKeysCreate404 = ResourceNotFoundError;
1717
+ const ApiKeysCreate422 = ValidationError;
1812
1718
  const ApiKeysCreate500 = InternalError;
1813
1719
  const ApiKeysCreate502 = BillingProviderError;
1814
1720
  const ApiKeysGetPathParams = Schema$1.Struct({ id: ApiKeyId });
@@ -1865,8 +1771,9 @@ const ApiKeysRemove502 = BillingProviderError;
1865
1771
  const ApiKeysRotatePathParams = Schema$1.Struct({ id: ApiKeyId });
1866
1772
  const ApiKeysRotate200 = ApiKeyWithSecret;
1867
1773
  const ApiKeysRotate401 = UnauthorizedError;
1868
- const ApiKeysRotate403 = ForbiddenError;
1774
+ const ApiKeysRotate403 = Schema$1.Union([ForbiddenError]);
1869
1775
  const ApiKeysRotate404 = ResourceNotFoundError;
1776
+ const ApiKeysRotate422 = ValidationError;
1870
1777
  const ApiKeysRotate500 = InternalError;
1871
1778
  const ApiKeysGetStatsPathParams = Schema$1.Struct({ id: ApiKeyId });
1872
1779
  const ApiKeysGetStatsQuery = Schema$1.Struct({ period: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
@@ -1901,11 +1808,7 @@ const CampaignsList403 = ForbiddenError;
1901
1808
  const CampaignsList500 = InternalError;
1902
1809
  const CampaignsCreateRequestJson = Schema$1.Struct({
1903
1810
  name: Schema$1.String,
1904
- channel: Schema$1.Literals([
1905
- "sms",
1906
- "whatsapp",
1907
- "email"
1908
- ]),
1811
+ channel: Schema$1.Literal("email"),
1909
1812
  content: CampaignContentInput,
1910
1813
  audience: CampaignAudience,
1911
1814
  policy: Schema$1.optionalKey(Schema$1.Union([CampaignPolicy, Schema$1.Null]))
@@ -2081,7 +1984,7 @@ const ContactsListQuery = Schema$1.Struct({
2081
1984
  endDate: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2082
1985
  });
2083
1986
  const ContactsList200 = Schema$1.Struct({
2084
- items: Schema$1.Array(Contact),
1987
+ items: Schema$1.Array(ContactListItem),
2085
1988
  pagination: PaginationMeta
2086
1989
  });
2087
1990
  const ContactsList401 = UnauthorizedError;
@@ -2096,39 +1999,6 @@ const ContactsCreateRequestJson = Schema$1.Struct({
2096
1999
  humanProfile: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([HumanProfile, Schema$1.Null]), Schema$1.Null])),
2097
2000
  capabilities: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
2098
2001
  tags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
2099
- engagement: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2100
- totalInteractions: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2101
- lastActiveAt: Schema$1.String,
2102
- averageResponseTime: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2103
- satisfactionScore: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })), Schema$1.Null])),
2104
- channels: Schema$1.Struct({
2105
- sms: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2106
- sent: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2107
- received: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2108
- failed: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2109
- lastAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2110
- }), Schema$1.Null])),
2111
- whatsapp: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2112
- sent: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2113
- received: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2114
- failed: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2115
- lastAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2116
- }), Schema$1.Null])),
2117
- email: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2118
- sent: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2119
- received: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2120
- failed: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2121
- bounced: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2122
- lastAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2123
- }), Schema$1.Null]))
2124
- }),
2125
- performance: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2126
- successRate: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
2127
- escalationRate: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
2128
- resolutionRate: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
2129
- averageHandlingTime: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
2130
- }), Schema$1.Null]))
2131
- }), Schema$1.Null])),
2132
2002
  accessLevel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
2133
2003
  "public",
2134
2004
  "authenticated",
@@ -2179,39 +2049,6 @@ const ContactsUpdateRequestJson = Schema$1.Struct({
2179
2049
  humanProfile: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([HumanProfile, Schema$1.Null]), Schema$1.Null])),
2180
2050
  capabilities: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
2181
2051
  tags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
2182
- engagement: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2183
- totalInteractions: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2184
- lastActiveAt: Schema$1.String,
2185
- averageResponseTime: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2186
- satisfactionScore: Schema$1.optionalKey(Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })), Schema$1.Null])),
2187
- channels: Schema$1.Struct({
2188
- sms: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2189
- sent: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2190
- received: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2191
- failed: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2192
- lastAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2193
- }), Schema$1.Null])),
2194
- whatsapp: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2195
- sent: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2196
- received: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2197
- failed: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2198
- lastAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2199
- }), Schema$1.Null])),
2200
- email: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2201
- sent: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2202
- received: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2203
- failed: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2204
- bounced: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
2205
- lastAt: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2206
- }), Schema$1.Null]))
2207
- }),
2208
- performance: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
2209
- successRate: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
2210
- escalationRate: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
2211
- resolutionRate: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
2212
- averageHandlingTime: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
2213
- }), Schema$1.Null]))
2214
- }), Schema$1.Null])),
2215
2052
  accessLevel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
2216
2053
  "public",
2217
2054
  "authenticated",
@@ -2244,11 +2081,7 @@ const ContactsGetActivityTimelinePathParams = Schema$1.Struct({ id: ContactId })
2244
2081
  const ContactsGetActivityTimelineQuery = Schema$1.Struct({
2245
2082
  page: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2246
2083
  limit: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2247
- channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
2248
- "sms",
2249
- "whatsapp",
2250
- "email"
2251
- ]), Schema$1.Null]))
2084
+ channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literal("email"), Schema$1.Null]))
2252
2085
  });
2253
2086
  const ContactsGetActivityTimeline200 = Schema$1.Struct({
2254
2087
  items: Schema$1.Array(Schema$1.Struct({
@@ -2393,7 +2226,6 @@ const ContactsExport500 = InternalError;
2393
2226
  const ContactsFindRequestJson = Schema$1.Struct({
2394
2227
  email: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2395
2228
  phone: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2396
- whatsapp: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2397
2229
  externalId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2398
2230
  });
2399
2231
  const ContactsFind200 = Schema$1.Union([Contact, Schema$1.Null]);
@@ -2405,7 +2237,6 @@ const ContactsFind500 = InternalError;
2405
2237
  const ContactsFindOrCreateRequestJson = Schema$1.Struct({
2406
2238
  email: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2407
2239
  phone: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2408
- whatsapp: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2409
2240
  externalId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2410
2241
  name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2411
2242
  displayName: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null]))
@@ -2428,11 +2259,7 @@ const ConversationsListQuery = Schema$1.Struct({
2428
2259
  "escalated",
2429
2260
  "archived"
2430
2261
  ]), Schema$1.Null])),
2431
- channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
2432
- "sms",
2433
- "whatsapp",
2434
- "email"
2435
- ]), Schema$1.Null])),
2262
+ channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literal("email"), Schema$1.Null])),
2436
2263
  contactId: Schema$1.optionalKey(Schema$1.Union([ContactId, Schema$1.Null])),
2437
2264
  startDate: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2438
2265
  endDate: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
@@ -2449,16 +2276,8 @@ const ConversationsCreateRequestJson = Schema$1.Struct({
2449
2276
  description: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2450
2277
  externalId: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2451
2278
  parentConversationId: Schema$1.optionalKey(Schema$1.Union([ConversationId, Schema$1.Null])),
2452
- channels: Schema$1.Array(Schema$1.Literals([
2453
- "sms",
2454
- "whatsapp",
2455
- "email"
2456
- ])),
2457
- primaryChannel: Schema$1.Literals([
2458
- "sms",
2459
- "whatsapp",
2460
- "email"
2461
- ]),
2279
+ channels: Schema$1.Array(Schema$1.Literal("email")),
2280
+ primaryChannel: Schema$1.Literal("email"),
2462
2281
  status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
2463
2282
  "active",
2464
2283
  "waiting",
@@ -2495,7 +2314,7 @@ const ConversationsCreate403 = ForbiddenError;
2495
2314
  const ConversationsCreate422 = ValidationError;
2496
2315
  const ConversationsCreate500 = InternalError;
2497
2316
  const ConversationsGetByIdPathParams = Schema$1.Struct({ id: ConversationId });
2498
- const ConversationsGetById200 = Conversation;
2317
+ const ConversationsGetById200 = ConversationDetail;
2499
2318
  const ConversationsGetById401 = UnauthorizedError;
2500
2319
  const ConversationsGetById403 = ForbiddenError;
2501
2320
  const ConversationsGetById404 = ResourceNotFoundError;
@@ -2506,11 +2325,7 @@ const ConversationsUpdateRequestJson = Schema$1.Struct({
2506
2325
  description: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
2507
2326
  externalId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null])),
2508
2327
  parentConversationId: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([ConversationId, Schema$1.Null]), Schema$1.Null])),
2509
- primaryChannel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
2510
- "sms",
2511
- "whatsapp",
2512
- "email"
2513
- ]), Schema$1.Null])),
2328
+ primaryChannel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literal("email"), Schema$1.Null])),
2514
2329
  status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
2515
2330
  "active",
2516
2331
  "waiting",
@@ -2535,11 +2350,7 @@ const ConversationsUpdateRequestJson = Schema$1.Struct({
2535
2350
  metadata: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([ConversationMetadata, Schema$1.Null]), Schema$1.Null])),
2536
2351
  metrics: Schema$1.optionalKey(Schema$1.Union([ConversationMetrics, Schema$1.Null])),
2537
2352
  actorTracking: Schema$1.optionalKey(Schema$1.Union([ActorTracking, Schema$1.Null])),
2538
- channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literals([
2539
- "sms",
2540
- "whatsapp",
2541
- "email"
2542
- ])), Schema$1.Null])),
2353
+ channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")), Schema$1.Null])),
2543
2354
  tags: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
2544
2355
  categories: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null])),
2545
2356
  isTest: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])),
@@ -2770,15 +2581,6 @@ const EmailGetCatchAllStats401 = UnauthorizedError;
2770
2581
  const EmailGetCatchAllStats403 = ForbiddenError;
2771
2582
  const EmailGetCatchAllStats404 = ResourceNotFoundError;
2772
2583
  const EmailGetCatchAllStats500 = InternalError;
2773
- const EmailProvisionDomainHeaders = Schema$1.Struct({ "idempotency-key": Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })) });
2774
- const EmailProvisionDomainRequestJson = Schema$1.Struct({ domain: Schema$1.String });
2775
- const EmailProvisionDomain202 = OperationAccepted;
2776
- const EmailProvisionDomain401 = UnauthorizedError;
2777
- const EmailProvisionDomain403 = ForbiddenError;
2778
- const EmailProvisionDomain409 = ConflictError;
2779
- const EmailProvisionDomain422 = ValidationError;
2780
- const EmailProvisionDomain500 = InternalError;
2781
- const EmailProvisionDomain502 = EmailChannelError;
2782
2584
  const EmailListDomainsQuery = Schema$1.Struct({
2783
2585
  page: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2784
2586
  limit: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
@@ -2787,9 +2589,12 @@ const EmailListDomains200 = Schema$1.Struct({
2787
2589
  items: Schema$1.Array(Schema$1.Struct({
2788
2590
  id: EmailDomainId,
2789
2591
  domain: Schema$1.String,
2790
- status: Schema$1.Literals([
2791
- "pending",
2792
- "verified",
2592
+ phase: Schema$1.Literals([
2593
+ "dns-setup",
2594
+ "provider-setup",
2595
+ "provider-verification",
2596
+ "ready",
2597
+ "degraded",
2793
2598
  "failed"
2794
2599
  ]),
2795
2600
  dkimSelector: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
@@ -2824,27 +2629,6 @@ const EmailRemoveDomain403 = ForbiddenError;
2824
2629
  const EmailRemoveDomain404 = ResourceNotFoundError;
2825
2630
  const EmailRemoveDomain500 = InternalError;
2826
2631
  const EmailRemoveDomain502 = Schema$1.Union([EmailChannelError, BillingProviderError]);
2827
- const EmailGetBrandedTrackingPathParams = Schema$1.Struct({ id: EmailDomainId });
2828
- const EmailGetBrandedTracking200 = BrandedTrackingStatus;
2829
- const EmailGetBrandedTracking401 = UnauthorizedError;
2830
- const EmailGetBrandedTracking403 = ForbiddenError;
2831
- const EmailGetBrandedTracking500 = InternalError;
2832
- const EmailEnableBrandedTrackingPathParams = Schema$1.Struct({ id: EmailDomainId });
2833
- const EmailEnableBrandedTrackingRequestJson = Schema$1.Struct({ label: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])) });
2834
- const EmailEnableBrandedTracking200 = BrandedTrackingStatus;
2835
- const EmailEnableBrandedTracking401 = UnauthorizedError;
2836
- const EmailEnableBrandedTracking403 = Schema$1.Union([ForbiddenError, ForbiddenError]);
2837
- const EmailEnableBrandedTracking409 = ConflictError;
2838
- const EmailEnableBrandedTracking422 = ValidationError;
2839
- const EmailEnableBrandedTracking500 = InternalError;
2840
- const EmailEnableBrandedTracking502 = Schema$1.Union([EmailChannelError, BillingProviderError]);
2841
- const EmailDisableBrandedTrackingPathParams = Schema$1.Struct({ id: EmailDomainId });
2842
- const EmailDisableBrandedTracking200 = SuccessResult;
2843
- const EmailDisableBrandedTracking401 = UnauthorizedError;
2844
- const EmailDisableBrandedTracking403 = Schema$1.Union([ForbiddenError, ForbiddenError]);
2845
- const EmailDisableBrandedTracking409 = ConflictError;
2846
- const EmailDisableBrandedTracking500 = InternalError;
2847
- const EmailDisableBrandedTracking502 = EmailChannelError;
2848
2632
  const EmailUpdateDomainConfigPathParams = Schema$1.Struct({ id: EmailDomainId });
2849
2633
  const EmailUpdateDomainConfigRequestJson = Schema$1.Struct({
2850
2634
  openTracking: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Boolean, Schema$1.Null]), Schema$1.Null])),
@@ -2865,6 +2649,50 @@ const EmailUpdateDomainConfig401 = UnauthorizedError;
2865
2649
  const EmailUpdateDomainConfig403 = ForbiddenError;
2866
2650
  const EmailUpdateDomainConfig404 = ResourceNotFoundError;
2867
2651
  const EmailUpdateDomainConfig500 = InternalError;
2652
+ const EmailGetCustomTrackingPathParams = Schema$1.Struct({ id: EmailDomainId });
2653
+ const EmailGetCustomTracking200 = CustomTrackingStatus;
2654
+ const EmailGetCustomTracking401 = UnauthorizedError;
2655
+ const EmailGetCustomTracking403 = ForbiddenError;
2656
+ const EmailGetCustomTracking500 = InternalError;
2657
+ const EmailEnableCustomTrackingPathParams = Schema$1.Struct({ id: EmailDomainId });
2658
+ const EmailEnableCustomTrackingRequestJson = Schema$1.Struct({ label: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])) });
2659
+ const EmailEnableCustomTracking200 = CustomTrackingStatus;
2660
+ const EmailEnableCustomTracking401 = UnauthorizedError;
2661
+ const EmailEnableCustomTracking403 = Schema$1.Union([ForbiddenError]);
2662
+ const EmailEnableCustomTracking409 = ConflictError;
2663
+ const EmailEnableCustomTracking422 = ValidationError;
2664
+ const EmailEnableCustomTracking500 = InternalError;
2665
+ const EmailEnableCustomTracking502 = Schema$1.Union([EmailChannelError, BillingProviderError]);
2666
+ const EmailDisableCustomTrackingPathParams = Schema$1.Struct({ id: EmailDomainId });
2667
+ const EmailDisableCustomTracking200 = SuccessResult;
2668
+ const EmailDisableCustomTracking401 = UnauthorizedError;
2669
+ const EmailDisableCustomTracking403 = Schema$1.Union([ForbiddenError]);
2670
+ const EmailDisableCustomTracking409 = ConflictError;
2671
+ const EmailDisableCustomTracking500 = InternalError;
2672
+ const EmailDisableCustomTracking502 = EmailChannelError;
2673
+ const EmailGetCustomTrackingDomainConnectPathParams = Schema$1.Struct({ id: EmailDomainId });
2674
+ const EmailGetCustomTrackingDomainConnect200 = DomainConnectEligibility;
2675
+ const EmailGetCustomTrackingDomainConnect401 = UnauthorizedError;
2676
+ const EmailGetCustomTrackingDomainConnect403 = ForbiddenError;
2677
+ const EmailGetCustomTrackingDomainConnect404 = ResourceNotFoundError;
2678
+ const EmailGetCustomTrackingDomainConnect500 = InternalError;
2679
+ const EmailBuildCustomTrackingDomainConnectApplyUrlPathParams = Schema$1.Struct({ id: EmailDomainId });
2680
+ const EmailBuildCustomTrackingDomainConnectApplyUrl200 = DomainConnectApplyUrlResult;
2681
+ const EmailBuildCustomTrackingDomainConnectApplyUrl401 = UnauthorizedError;
2682
+ const EmailBuildCustomTrackingDomainConnectApplyUrl403 = ForbiddenError;
2683
+ const EmailBuildCustomTrackingDomainConnectApplyUrl404 = ResourceNotFoundError;
2684
+ const EmailBuildCustomTrackingDomainConnectApplyUrl422 = ValidationError;
2685
+ const EmailBuildCustomTrackingDomainConnectApplyUrl500 = InternalError;
2686
+ const EmailBuildCustomTrackingDomainConnectApplyUrl502 = EmailChannelError;
2687
+ const EmailCompleteCustomTrackingDomainConnectPathParams = Schema$1.Struct({ id: EmailDomainId });
2688
+ const EmailCompleteCustomTrackingDomainConnectRequestJson = Schema$1.Struct({
2689
+ state: Schema$1.String,
2690
+ error: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2691
+ });
2692
+ const EmailCompleteCustomTrackingDomainConnect200 = CustomTrackingDomainConnectCompleteResult;
2693
+ const EmailCompleteCustomTrackingDomainConnect401 = UnauthorizedError;
2694
+ const EmailCompleteCustomTrackingDomainConnect403 = ForbiddenError;
2695
+ const EmailCompleteCustomTrackingDomainConnect500 = InternalError;
2868
2696
  const EmailSetDefaultDomainPathParams = Schema$1.Struct({ id: EmailDomainId });
2869
2697
  const EmailSetDefaultDomain200 = SuccessResult;
2870
2698
  const EmailSetDefaultDomain401 = UnauthorizedError;
@@ -2887,18 +2715,15 @@ const EmailClearDomainDefaultSender403 = ForbiddenError;
2887
2715
  const EmailClearDomainDefaultSender404 = ResourceNotFoundError;
2888
2716
  const EmailClearDomainDefaultSender500 = InternalError;
2889
2717
  const EmailGetDomainConnectPathParams = Schema$1.Struct({ id: EmailDomainId });
2890
- const EmailGetDomainConnect200 = Schema$1.Struct({
2891
- eligible: Schema$1.Boolean,
2892
- reason: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
2893
- providerName: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2894
- });
2718
+ const EmailGetDomainConnectQuery = Schema$1.Struct({ mode: Schema$1.Literals(["send-only", "send-and-receive"]) });
2719
+ const EmailGetDomainConnect200 = DomainConnectEligibility;
2895
2720
  const EmailGetDomainConnect401 = UnauthorizedError;
2896
2721
  const EmailGetDomainConnect403 = ForbiddenError;
2897
2722
  const EmailGetDomainConnect404 = ResourceNotFoundError;
2898
2723
  const EmailGetDomainConnect500 = InternalError;
2899
2724
  const EmailBuildDomainConnectApplyUrlPathParams = Schema$1.Struct({ id: EmailDomainId });
2900
- const EmailBuildDomainConnectApplyUrlRequestJson = Schema$1.Struct({ inbound: Schema$1.optionalKey(Schema$1.Union([Schema$1.Boolean, Schema$1.Null])) });
2901
- const EmailBuildDomainConnectApplyUrl200 = Schema$1.Struct({ url: Schema$1.String });
2725
+ const EmailBuildDomainConnectApplyUrlRequestJson = Schema$1.Struct({ mode: Schema$1.Literals(["send-only", "send-and-receive"]) });
2726
+ const EmailBuildDomainConnectApplyUrl200 = DomainConnectApplyUrlResult;
2902
2727
  const EmailBuildDomainConnectApplyUrl401 = UnauthorizedError;
2903
2728
  const EmailBuildDomainConnectApplyUrl403 = ForbiddenError;
2904
2729
  const EmailBuildDomainConnectApplyUrl404 = ResourceNotFoundError;
@@ -2910,11 +2735,7 @@ const EmailCompleteDomainConnectRequestJson = Schema$1.Struct({
2910
2735
  state: Schema$1.String,
2911
2736
  error: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
2912
2737
  });
2913
- const EmailCompleteDomainConnect200 = Schema$1.Struct({ status: Schema$1.Literals([
2914
- "applied",
2915
- "cancelled",
2916
- "invalid"
2917
- ]) });
2738
+ const EmailCompleteDomainConnect200 = DomainConnectCompleteResult;
2918
2739
  const EmailCompleteDomainConnect401 = UnauthorizedError;
2919
2740
  const EmailCompleteDomainConnect403 = ForbiddenError;
2920
2741
  const EmailCompleteDomainConnect404 = ResourceNotFoundError;
@@ -2948,32 +2769,22 @@ const EmailDetectRegistrar200 = Schema$1.Struct({
2948
2769
  const EmailDetectRegistrar401 = UnauthorizedError;
2949
2770
  const EmailDetectRegistrar403 = ForbiddenError;
2950
2771
  const EmailDetectRegistrar500 = InternalError;
2951
- const EmailGetDomainStatusPathParams = Schema$1.Struct({ id: EmailDomainId });
2952
- const EmailGetDomainStatus200 = Schema$1.Struct({
2953
- domain: Schema$1.String,
2954
- status: Schema$1.Literals([
2955
- "pending",
2956
- "verified",
2957
- "failed"
2958
- ])
2959
- });
2960
- const EmailGetDomainStatus401 = UnauthorizedError;
2961
- const EmailGetDomainStatus403 = ForbiddenError;
2962
- const EmailGetDomainStatus404 = ResourceNotFoundError;
2963
- const EmailCheckDomainVerificationPathParams = Schema$1.Struct({ id: EmailDomainId });
2964
- const EmailCheckDomainVerification200 = EmailDomainVerificationStatusResponse;
2965
- const EmailCheckDomainVerification401 = UnauthorizedError;
2966
- const EmailCheckDomainVerification403 = ForbiddenError;
2967
- const EmailCheckDomainVerification404 = ResourceNotFoundError;
2968
- const EmailCheckDomainVerification500 = InternalError;
2969
- const EmailCheckDomainVerification502 = EmailChannelError;
2970
- const EmailVerifyDomainPathParams = Schema$1.Struct({ id: EmailDomainId });
2971
- const EmailVerifyDomain200 = Schema$1.Struct({ success: Schema$1.Literal(true) });
2972
- const EmailVerifyDomain401 = UnauthorizedError;
2973
- const EmailVerifyDomain403 = ForbiddenError;
2974
- const EmailVerifyDomain404 = ResourceNotFoundError;
2975
- const EmailVerifyDomain500 = InternalError;
2976
- const EmailVerifyDomain502 = EmailChannelError;
2772
+ const EmailGetDomainVerificationPathParams = Schema$1.Struct({ id: EmailDomainId });
2773
+ const EmailGetDomainVerification200 = EmailDomainVerification;
2774
+ const EmailGetDomainVerification401 = UnauthorizedError;
2775
+ const EmailGetDomainVerification403 = ForbiddenError;
2776
+ const EmailGetDomainVerification404 = ResourceNotFoundError;
2777
+ const EmailGetDomainVerification500 = InternalError;
2778
+ const EmailAdvanceDomainVerificationPathParams = Schema$1.Struct({ id: EmailDomainId });
2779
+ const EmailAdvanceDomainVerification200 = EmailDomainVerification;
2780
+ const EmailAdvanceDomainVerification401 = UnauthorizedError;
2781
+ const EmailAdvanceDomainVerification403 = ForbiddenError;
2782
+ const EmailAdvanceDomainVerification404 = ResourceNotFoundError;
2783
+ const EmailAdvanceDomainVerification409 = ConflictError;
2784
+ const EmailAdvanceDomainVerification422 = ValidationError;
2785
+ const EmailAdvanceDomainVerification429 = RateLimitedError;
2786
+ const EmailAdvanceDomainVerification500 = InternalError;
2787
+ const EmailAdvanceDomainVerification502 = EmailChannelError;
2977
2788
  const EmailListForwardingRulesQuery = Schema$1.Struct({
2978
2789
  domainId: Schema$1.optionalKey(Schema$1.Union([EmailDomainId, Schema$1.Null])),
2979
2790
  isActive: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.annotate({ contentMediaType: "application/json" }), Schema$1.Null])),
@@ -3258,14 +3069,49 @@ const EmailUpdateRecipientTrackingPreference401 = UnauthorizedError;
3258
3069
  const EmailUpdateRecipientTrackingPreference403 = ForbiddenError;
3259
3070
  const EmailUpdateRecipientTrackingPreference422 = ValidationError;
3260
3071
  const EmailUpdateRecipientTrackingPreference500 = InternalError;
3072
+ const MediaCreateRequestJson = Schema$1.Struct({
3073
+ filename: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })),
3074
+ contentType: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(127).annotate({ expected: "a value with a length of at most 127" })),
3075
+ sizeBytes: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isLessThanOrEqualTo(26214400).annotate({ expected: "a value less than or equal to 26214400" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
3076
+ purpose: Schema$1.Literals(["attachment", "avatar"]),
3077
+ checksumSha256: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
3078
+ });
3079
+ const MediaCreate201 = CreatedMedia;
3080
+ const MediaCreate401 = UnauthorizedError;
3081
+ const MediaCreate403 = ForbiddenError;
3082
+ const MediaCreate422 = ValidationError;
3083
+ const MediaCreate500 = InternalError;
3084
+ const MediaGetByIdPathParams = Schema$1.Struct({ mediaId: MediaId });
3085
+ const MediaGetById200 = Media;
3086
+ const MediaGetById401 = UnauthorizedError;
3087
+ const MediaGetById403 = ForbiddenError;
3088
+ const MediaGetById404 = ResourceNotFoundError;
3089
+ const MediaGetById500 = InternalError;
3090
+ const MediaRemovePathParams = Schema$1.Struct({ mediaId: MediaId });
3091
+ const MediaRemove200 = SuccessResponse;
3092
+ const MediaRemove401 = UnauthorizedError;
3093
+ const MediaRemove403 = ForbiddenError;
3094
+ const MediaRemove404 = ResourceNotFoundError;
3095
+ const MediaRemove422 = ValidationError;
3096
+ const MediaRemove500 = InternalError;
3097
+ const MediaCompletePathParams = Schema$1.Struct({ mediaId: MediaId });
3098
+ const MediaComplete200 = CompletedMedia;
3099
+ const MediaComplete401 = UnauthorizedError;
3100
+ const MediaComplete403 = ForbiddenError;
3101
+ const MediaComplete404 = ResourceNotFoundError;
3102
+ const MediaComplete422 = ValidationError;
3103
+ const MediaComplete500 = InternalError;
3104
+ const MediaDownloadUrlPathParams = Schema$1.Struct({ mediaId: MediaId });
3105
+ const MediaDownloadUrl200 = MediaDownloadUrl;
3106
+ const MediaDownloadUrl401 = UnauthorizedError;
3107
+ const MediaDownloadUrl403 = ForbiddenError;
3108
+ const MediaDownloadUrl404 = ResourceNotFoundError;
3109
+ const MediaDownloadUrl422 = ValidationError;
3110
+ const MediaDownloadUrl500 = InternalError;
3261
3111
  const MessagesListQuery = Schema$1.Struct({
3262
3112
  page: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3263
3113
  limit: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3264
- channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
3265
- "sms",
3266
- "whatsapp",
3267
- "email"
3268
- ]), Schema$1.Null])),
3114
+ channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literal("email"), Schema$1.Null])),
3269
3115
  status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
3270
3116
  "pending",
3271
3117
  "scheduled",
@@ -3291,19 +3137,11 @@ const MessagesList401 = UnauthorizedError;
3291
3137
  const MessagesList403 = ForbiddenError;
3292
3138
  const MessagesList500 = InternalError;
3293
3139
  const MessagesSendHeaders = Schema$1.Struct({ "idempotency-key": Schema$1.optionalKey(Schema$1.Union([Schema$1.String.annotate({ description: "Optional org-scoped key that makes a send idempotent. Repeating a request with the same key and identical payload replays the original 201 response; reusing the key with different content returns 409." }).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[\\s\\S]{1,255}$")).annotate({ expected: "a string matching the RegExp ^[\\s\\S]{1,255}$" })), Schema$1.Null])) });
3294
- const MessagesSendRequestJson = Schema$1.Union([
3295
- EmailSendMessagePayload,
3296
- SmsSendMessagePayload,
3297
- WhatsAppSendMessagePayload
3298
- ]);
3140
+ const MessagesSendRequestJson = Schema$1.Union([EmailSendMessagePayload]);
3299
3141
  const MessagesSend201 = Message;
3300
3142
  const MessagesSend401 = UnauthorizedError;
3301
3143
  const MessagesSend402 = PaymentRequiredError;
3302
- const MessagesSend403 = Schema$1.Union([
3303
- ForbiddenError,
3304
- FlagDisabledError,
3305
- ForbiddenError
3306
- ]);
3144
+ const MessagesSend403 = Schema$1.Union([FlagDisabledError, ForbiddenError]);
3307
3145
  const MessagesSend404 = ResourceNotFoundError;
3308
3146
  const MessagesSend409 = ConflictError;
3309
3147
  const MessagesSend422 = ValidationError;
@@ -3346,11 +3184,7 @@ const MessagesGetEmail200 = Schema$1.Struct({
3346
3184
  "bounced",
3347
3185
  "complained"
3348
3186
  ]),
3349
- channel: Schema$1.Literals([
3350
- "sms",
3351
- "whatsapp",
3352
- "email"
3353
- ]),
3187
+ channel: Schema$1.Literal("email"),
3354
3188
  direction: Schema$1.Literals(["outbound", "inbound"]),
3355
3189
  subject: Schema$1.Union([Schema$1.String, Schema$1.Null]),
3356
3190
  fromEmail: Schema$1.String,
@@ -3549,7 +3383,7 @@ const OperationsGet500 = InternalError;
3549
3383
  const OperationsRetryPathParams = Schema$1.Struct({ operationId: OperationId });
3550
3384
  const OperationsRetry202 = OperationAccepted;
3551
3385
  const OperationsRetry401 = UnauthorizedError;
3552
- const OperationsRetry403 = Schema$1.Union([ForbiddenError, ForbiddenError]);
3386
+ const OperationsRetry403 = Schema$1.Union([ForbiddenError]);
3553
3387
  const OperationsRetry404 = ResourceNotFoundError;
3554
3388
  const OperationsRetry409 = ConflictError;
3555
3389
  const OperationsRetry500 = InternalError;
@@ -3564,7 +3398,7 @@ const OrganizationsCreate502 = BillingProviderError;
3564
3398
  const OrganizationsBootstrapRequestJson = Schema$1.Struct({ name: Schema$1.String });
3565
3399
  const OrganizationsBootstrap200 = Organization;
3566
3400
  const OrganizationsBootstrap401 = UnauthorizedError;
3567
- const OrganizationsBootstrap403 = Schema$1.Union([ForbiddenError, ForbiddenError]);
3401
+ const OrganizationsBootstrap403 = Schema$1.Union([ForbiddenError]);
3568
3402
  const OrganizationsBootstrap422 = ValidationError;
3569
3403
  const OrganizationsBootstrap500 = InternalError;
3570
3404
  const OrganizationsBootstrap502 = BillingProviderError;
@@ -3597,7 +3431,7 @@ const OrganizationsDeleteHeaders = Schema$1.Struct({ "idempotency-key": Schema$1
3597
3431
  const OrganizationsDeleteRequestJson = Schema$1.Struct({ confirmationName: Schema$1.String });
3598
3432
  const OrganizationsDelete202 = OperationAccepted;
3599
3433
  const OrganizationsDelete401 = UnauthorizedError;
3600
- const OrganizationsDelete403 = Schema$1.Union([ForbiddenError, ForbiddenError]);
3434
+ const OrganizationsDelete403 = Schema$1.Union([ForbiddenError]);
3601
3435
  const OrganizationsDelete409 = ConflictError;
3602
3436
  const OrganizationsDelete422 = ValidationError;
3603
3437
  const OrganizationsDelete500 = InternalError;
@@ -3611,9 +3445,7 @@ const OrganizationsGetUsage200 = Schema$1.Struct({
3611
3445
  usage: Schema$1.Struct({
3612
3446
  periodStart: Schema$1.String,
3613
3447
  periodEnd: Schema$1.String,
3614
- smsCount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
3615
3448
  emailCount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
3616
- whatsappCount: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
3617
3449
  totalMessages: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" }))
3618
3450
  }),
3619
3451
  billing: Schema$1.Struct({
@@ -3627,6 +3459,500 @@ const OrganizationsGetUsage200 = Schema$1.Struct({
3627
3459
  const OrganizationsGetUsage401 = UnauthorizedError;
3628
3460
  const OrganizationsGetUsage403 = ForbiddenError;
3629
3461
  const OrganizationsGetUsage500 = InternalError;
3462
+ const TemplateDocumentsGetPathParams = Schema$1.Struct({ templateId: TemplateId });
3463
+ const TemplateDocumentsGet200 = Schema$1.Struct({
3464
+ templateId: TemplateId,
3465
+ organizationId: OrganizationId,
3466
+ channel: Schema$1.Literal("email"),
3467
+ source: Schema$1.String,
3468
+ revision: Schema$1.String,
3469
+ sourceDigest: Schema$1.String,
3470
+ createdAt: Schema$1.String,
3471
+ updatedAt: Schema$1.String,
3472
+ createdBy: Schema$1.Struct({
3473
+ userId: UserId,
3474
+ via: Schema$1.Literals([
3475
+ "api",
3476
+ "mcp",
3477
+ "agent"
3478
+ ])
3479
+ }),
3480
+ updatedBy: Schema$1.Struct({
3481
+ userId: UserId,
3482
+ via: Schema$1.Literals([
3483
+ "api",
3484
+ "mcp",
3485
+ "agent"
3486
+ ])
3487
+ })
3488
+ });
3489
+ const TemplateDocumentsGet401 = UnauthorizedError;
3490
+ const TemplateDocumentsGet403 = ForbiddenError;
3491
+ const TemplateDocumentsGet404 = ResourceNotFoundError;
3492
+ const TemplateDocumentsGet409 = ConflictError;
3493
+ const TemplateDocumentsGet422 = ValidationError;
3494
+ const TemplateDocumentsGet500 = InternalError;
3495
+ const TemplateDocumentsIssueAgentAdmissionPathParams = Schema$1.Struct({ templateId: TemplateId });
3496
+ const TemplateDocumentsIssueAgentAdmissionRequestJson = Schema$1.Struct({
3497
+ method: Schema$1.Literals([
3498
+ "GET",
3499
+ "HEAD",
3500
+ "POST"
3501
+ ]),
3502
+ route: Schema$1.Literals([
3503
+ "prompt",
3504
+ "read",
3505
+ "abort",
3506
+ "clear"
3507
+ ]),
3508
+ referenceDigest: Schema$1.optionalKey(Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[a-f0-9]{64}$")).annotate({ expected: "a string matching the RegExp ^[a-f0-9]{64}$" }))),
3509
+ research: Schema$1.optionalKey(Schema$1.Union([
3510
+ Schema$1.Struct({
3511
+ kind: Schema$1.Literal("query"),
3512
+ query: Schema$1.String.check(Schema$1.isMinLength(3).annotate({ expected: "a value with a length of at least 3" })).check(Schema$1.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" }))
3513
+ }),
3514
+ Schema$1.Struct({
3515
+ kind: Schema$1.Literal("url"),
3516
+ url: Schema$1.String.check(Schema$1.isMinLength(8).annotate({ expected: "a value with a length of at least 8" })).check(Schema$1.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" }))
3517
+ }),
3518
+ Schema$1.Struct({
3519
+ kind: Schema$1.Literal("styleguide"),
3520
+ domain: Schema$1.String.check(Schema$1.isMinLength(3).annotate({ expected: "a value with a length of at least 3" })).check(Schema$1.isMaxLength(253).annotate({ expected: "a value with a length of at most 253" }))
3521
+ })
3522
+ ])),
3523
+ competitorMessage: Schema$1.optionalKey(Schema$1.Struct({
3524
+ watchId: MailboxExtensionId,
3525
+ messageId: MessageId
3526
+ }))
3527
+ });
3528
+ const TemplateDocumentsIssueAgentAdmission200 = Schema$1.Struct({
3529
+ token: Schema$1.String,
3530
+ conversationId: Schema$1.String,
3531
+ snapshot: Schema$1.Struct({
3532
+ templateId: TemplateId,
3533
+ organizationId: OrganizationId,
3534
+ channel: Schema$1.Literal("email"),
3535
+ source: Schema$1.String,
3536
+ revision: Schema$1.String,
3537
+ sourceDigest: Schema$1.String
3538
+ }),
3539
+ reference: Schema$1.optionalKey(Schema$1.Union([
3540
+ Schema$1.Struct({
3541
+ version: Schema$1.Literal(1),
3542
+ referenceId: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" })),
3543
+ name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" })),
3544
+ description: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(2e3).annotate({ expected: "a value with a length of at most 2000" })),
3545
+ galleryPath: Schema$1.String.check(Schema$1.isMinLength(2).annotate({ expected: "a value with a length of at least 2" })).check(Schema$1.isMaxLength(512).annotate({ expected: "a value with a length of at most 512" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\/templates\\/[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^\\/templates\\/[a-z0-9]+(?:-[a-z0-9]+)*$" })),
3546
+ digest: Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[a-f0-9]{64}$")).annotate({ expected: "a string matching the RegExp ^[a-f0-9]{64}$" })),
3547
+ citation: Schema$1.Struct({
3548
+ kind: Schema$1.String,
3549
+ digest: Schema$1.String,
3550
+ locator: Schema$1.optionalKey(Schema$1.String)
3551
+ }),
3552
+ policy: Schema$1.Literal("samva-owned-source"),
3553
+ source: Schema$1.String.check(Schema$1.isMaxLength(5e5).annotate({ expected: "a value with a length of at most 500000" }))
3554
+ }),
3555
+ Schema$1.Struct({
3556
+ version: Schema$1.Literal(1),
3557
+ referenceId: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" })),
3558
+ name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" })),
3559
+ description: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(2e3).annotate({ expected: "a value with a length of at most 2000" })),
3560
+ galleryPath: Schema$1.String.check(Schema$1.isMinLength(2).annotate({ expected: "a value with a length of at least 2" })).check(Schema$1.isMaxLength(512).annotate({ expected: "a value with a length of at most 512" })).check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^\\/templates\\/[a-z0-9]+(?:-[a-z0-9]+)*$")).annotate({ expected: "a string matching the RegExp ^\\/templates\\/[a-z0-9]+(?:-[a-z0-9]+)*$" })),
3561
+ digest: Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[a-f0-9]{64}$")).annotate({ expected: "a string matching the RegExp ^[a-f0-9]{64}$" })),
3562
+ citation: Schema$1.Struct({
3563
+ kind: Schema$1.String,
3564
+ digest: Schema$1.String,
3565
+ locator: Schema$1.optionalKey(Schema$1.String)
3566
+ }),
3567
+ policy: Schema$1.Literal("reviewed-public-structure"),
3568
+ structure: Schema$1.Struct({
3569
+ nodes: Schema$1.Array(Schema$1.Struct({
3570
+ tag: Schema$1.String,
3571
+ depth: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3572
+ childIndex: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
3573
+ })).check(Schema$1.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" })),
3574
+ components: Schema$1.Array(Schema$1.Struct({
3575
+ tag: Schema$1.String,
3576
+ count: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" }))
3577
+ })).check(Schema$1.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })),
3578
+ palette: Schema$1.Array(Schema$1.String).check(Schema$1.isMaxLength(24).annotate({ expected: "a value with a length of at most 24" }))
3579
+ })
3580
+ }),
3581
+ Schema$1.Struct({
3582
+ version: Schema$1.Literal(1),
3583
+ policy: Schema$1.Literal("authorized-message-structure"),
3584
+ referenceId: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" })),
3585
+ name: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" })),
3586
+ description: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(2e3).annotate({ expected: "a value with a length of at most 2000" })),
3587
+ digest: Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[a-f0-9]{64}$")).annotate({ expected: "a string matching the RegExp ^[a-f0-9]{64}$" })),
3588
+ citation: Schema$1.Struct({
3589
+ kind: Schema$1.String,
3590
+ digest: Schema$1.String,
3591
+ locator: Schema$1.optionalKey(Schema$1.String)
3592
+ }),
3593
+ structure: Schema$1.Struct({
3594
+ sections: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3595
+ headings: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3596
+ images: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3597
+ links: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3598
+ buttons: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3599
+ textLength: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3600
+ subjectLength: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3601
+ palette: Schema$1.Array(Schema$1.String).check(Schema$1.isMaxLength(24).annotate({ expected: "a value with a length of at most 24" }))
3602
+ })
3603
+ }),
3604
+ Schema$1.Struct({
3605
+ version: Schema$1.Literal(1),
3606
+ policy: Schema$1.Literal("public-research"),
3607
+ request: Schema$1.Union([
3608
+ Schema$1.Struct({
3609
+ kind: Schema$1.Literal("query"),
3610
+ query: Schema$1.String.check(Schema$1.isMinLength(3).annotate({ expected: "a value with a length of at least 3" })).check(Schema$1.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" }))
3611
+ }),
3612
+ Schema$1.Struct({
3613
+ kind: Schema$1.Literal("url"),
3614
+ url: Schema$1.String.check(Schema$1.isMinLength(8).annotate({ expected: "a value with a length of at least 8" })).check(Schema$1.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" }))
3615
+ }),
3616
+ Schema$1.Struct({
3617
+ kind: Schema$1.Literal("styleguide"),
3618
+ domain: Schema$1.String.check(Schema$1.isMinLength(3).annotate({ expected: "a value with a length of at least 3" })).check(Schema$1.isMaxLength(253).annotate({ expected: "a value with a length of at most 253" }))
3619
+ })
3620
+ ]),
3621
+ digest: Schema$1.String.check(Schema$1.isPattern(/* @__PURE__ */ new RegExp("^[a-f0-9]{64}$")).annotate({ expected: "a string matching the RegExp ^[a-f0-9]{64}$" })),
3622
+ citations: Schema$1.Array(Schema$1.Struct({
3623
+ title: Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(300).annotate({ expected: "a value with a length of at most 300" })),
3624
+ url: Schema$1.String.check(Schema$1.isMinLength(8).annotate({ expected: "a value with a length of at least 8" })).check(Schema$1.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })),
3625
+ excerpts: Schema$1.Array(Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(1200).annotate({ expected: "a value with a length of at most 1200" }))).check(Schema$1.isMaxLength(4).annotate({ expected: "a value with a length of at most 4" }))
3626
+ })).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema$1.isMaxLength(4).annotate({ expected: "a value with a length of at most 4" })),
3627
+ citation: Schema$1.Struct({
3628
+ kind: Schema$1.String,
3629
+ digest: Schema$1.String,
3630
+ locator: Schema$1.optionalKey(Schema$1.String)
3631
+ })
3632
+ })
3633
+ ])),
3634
+ proposalBinding: Schema$1.optionalKey(Schema$1.String.check(Schema$1.isMaxLength(8192).annotate({ expected: "a value with a length of at most 8192" })))
3635
+ });
3636
+ const TemplateDocumentsIssueAgentAdmission401 = UnauthorizedError;
3637
+ const TemplateDocumentsIssueAgentAdmission403 = ForbiddenError;
3638
+ const TemplateDocumentsIssueAgentAdmission404 = ResourceNotFoundError;
3639
+ const TemplateDocumentsIssueAgentAdmission409 = ConflictError;
3640
+ const TemplateDocumentsIssueAgentAdmission422 = ValidationError;
3641
+ const TemplateDocumentsIssueAgentAdmission500 = InternalError;
3642
+ const TemplateDocumentsCompleteAgentConversationClearPathParams = Schema$1.Struct({ templateId: TemplateId });
3643
+ const TemplateDocumentsCompleteAgentConversationClearRequestJson = Schema$1.Struct({ conversationId: Schema$1.String });
3644
+ const TemplateDocumentsCompleteAgentConversationClear401 = UnauthorizedError;
3645
+ const TemplateDocumentsCompleteAgentConversationClear403 = ForbiddenError;
3646
+ const TemplateDocumentsCompleteAgentConversationClear404 = ResourceNotFoundError;
3647
+ const TemplateDocumentsCompleteAgentConversationClear409 = ConflictError;
3648
+ const TemplateDocumentsCompleteAgentConversationClear500 = InternalError;
3649
+ const TemplateDocumentsApplyAgentProposalPathParams = Schema$1.Struct({ templateId: TemplateId });
3650
+ const TemplateDocumentsApplyAgentProposalRequestJson = Schema$1.Struct({
3651
+ expectedRevision: Schema$1.String,
3652
+ sourceDigest: Schema$1.String,
3653
+ idempotencyKey: Schema$1.String,
3654
+ source: Schema$1.String,
3655
+ references: Schema$1.Array(Schema$1.Struct({
3656
+ kind: Schema$1.String,
3657
+ digest: Schema$1.String,
3658
+ locator: Schema$1.optionalKey(Schema$1.String)
3659
+ })).check(Schema$1.isMaxLength(1).annotate({ expected: "a value with a length of at most 1" })),
3660
+ proposalBinding: Schema$1.optionalKey(Schema$1.String.check(Schema$1.isMaxLength(8192).annotate({ expected: "a value with a length of at most 8192" })))
3661
+ });
3662
+ const TemplateDocumentsApplyAgentProposal200 = Schema$1.Struct({
3663
+ templateId: TemplateId,
3664
+ organizationId: OrganizationId,
3665
+ channel: Schema$1.Literal("email"),
3666
+ source: Schema$1.String,
3667
+ revision: Schema$1.String,
3668
+ sourceDigest: Schema$1.String,
3669
+ createdAt: Schema$1.String,
3670
+ updatedAt: Schema$1.String,
3671
+ createdBy: Schema$1.Struct({
3672
+ userId: UserId,
3673
+ via: Schema$1.Literals([
3674
+ "api",
3675
+ "mcp",
3676
+ "agent"
3677
+ ])
3678
+ }),
3679
+ updatedBy: Schema$1.Struct({
3680
+ userId: UserId,
3681
+ via: Schema$1.Literals([
3682
+ "api",
3683
+ "mcp",
3684
+ "agent"
3685
+ ])
3686
+ })
3687
+ });
3688
+ const TemplateDocumentsApplyAgentProposal401 = UnauthorizedError;
3689
+ const TemplateDocumentsApplyAgentProposal403 = ForbiddenError;
3690
+ const TemplateDocumentsApplyAgentProposal404 = ResourceNotFoundError;
3691
+ const TemplateDocumentsApplyAgentProposal409 = ConflictError;
3692
+ const TemplateDocumentsApplyAgentProposal422 = ValidationError;
3693
+ const TemplateDocumentsApplyAgentProposal500 = InternalError;
3694
+ const TemplateDocumentsPublishPathParams = Schema$1.Struct({ templateId: TemplateId });
3695
+ const TemplateDocumentsPublish200 = Schema$1.Struct({ versionId: Schema$1.String });
3696
+ const TemplateDocumentsPublish401 = UnauthorizedError;
3697
+ const TemplateDocumentsPublish403 = ForbiddenError;
3698
+ const TemplateDocumentsPublish404 = ResourceNotFoundError;
3699
+ const TemplateDocumentsPublish409 = ConflictError;
3700
+ const TemplateDocumentsPublish422 = ValidationError;
3701
+ const TemplateDocumentsPublish500 = InternalError;
3702
+ const TemplateDocumentsRenderPathParams = Schema$1.Struct({ templateId: TemplateId });
3703
+ const TemplateDocumentsRenderRequestJson = Schema$1.Struct({
3704
+ revision: Schema$1.String,
3705
+ variables: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]))
3706
+ });
3707
+ const TemplateDocumentsRender200 = Schema$1.Struct({
3708
+ channel: Schema$1.Literal("email"),
3709
+ subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3710
+ html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3711
+ text: Schema$1.String,
3712
+ missingVariables: Schema$1.Array(Schema$1.String)
3713
+ });
3714
+ const TemplateDocumentsRender401 = UnauthorizedError;
3715
+ const TemplateDocumentsRender403 = ForbiddenError;
3716
+ const TemplateDocumentsRender404 = ResourceNotFoundError;
3717
+ const TemplateDocumentsRender409 = ConflictError;
3718
+ const TemplateDocumentsRender422 = ValidationError;
3719
+ const TemplateDocumentsRender500 = InternalError;
3720
+ const TemplateDocumentsSavePathParams = Schema$1.Struct({ templateId: TemplateId });
3721
+ const TemplateDocumentsSaveRequestJson = Schema$1.Struct({ revision: Schema$1.String });
3722
+ const TemplateDocumentsSave200 = Schema$1.Struct({
3723
+ id: Schema$1.String,
3724
+ templateId: TemplateId,
3725
+ documentRevision: Schema$1.String,
3726
+ sourceDigest: Schema$1.String,
3727
+ compilerVersion: Schema$1.String,
3728
+ createdAt: Schema$1.String,
3729
+ versionId: Schema$1.String
3730
+ });
3731
+ const TemplateDocumentsSave401 = UnauthorizedError;
3732
+ const TemplateDocumentsSave403 = ForbiddenError;
3733
+ const TemplateDocumentsSave404 = ResourceNotFoundError;
3734
+ const TemplateDocumentsSave409 = ConflictError;
3735
+ const TemplateDocumentsSave422 = ValidationError;
3736
+ const TemplateDocumentsSave500 = InternalError;
3737
+ const TemplateDocumentsSendPathParams = Schema$1.Struct({ templateId: TemplateId });
3738
+ const TemplateDocumentsSendRequestJson = Schema$1.Struct({
3739
+ revision: Schema$1.String,
3740
+ to: Schema$1.Array(Schema$1.Struct({
3741
+ address: Schema$1.String,
3742
+ name: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
3743
+ })).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
3744
+ variables: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null])),
3745
+ schedule: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.String, Schema$1.Null]), Schema$1.Null]))
3746
+ });
3747
+ const TemplateDocumentsSend200 = Schema$1.Union([Schema$1.Struct({
3748
+ kind: Schema$1.Literal("sent"),
3749
+ messageId: Schema$1.String,
3750
+ acceptedAt: Schema$1.String
3751
+ }), Schema$1.Struct({
3752
+ kind: Schema$1.Literal("scheduled"),
3753
+ scheduledMessageId: Schema$1.String,
3754
+ scheduledFor: Schema$1.String
3755
+ })]);
3756
+ const TemplateDocumentsSend401 = UnauthorizedError;
3757
+ const TemplateDocumentsSend402 = PaymentRequiredError;
3758
+ const TemplateDocumentsSend403 = Schema$1.Union([FlagDisabledError, ForbiddenError]);
3759
+ const TemplateDocumentsSend404 = ResourceNotFoundError;
3760
+ const TemplateDocumentsSend409 = ConflictError;
3761
+ const TemplateDocumentsSend422 = ValidationError;
3762
+ const TemplateDocumentsSend429 = RateLimitedError;
3763
+ const TemplateDocumentsSend500 = Schema$1.Union([InternalError, WebhookEnqueueError]);
3764
+ const TemplateDocumentsSend502 = Schema$1.Union([ExternalServiceError, BillingProviderError]);
3765
+ const TemplateDocumentsTestSendPathParams = Schema$1.Struct({ templateId: TemplateId });
3766
+ const TemplateDocumentsTestSendRequestJson = Schema$1.Struct({
3767
+ revision: Schema$1.String,
3768
+ to: Schema$1.String,
3769
+ variables: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]))
3770
+ });
3771
+ const TemplateDocumentsTestSend200 = Schema$1.Struct({
3772
+ messageId: Schema$1.String,
3773
+ status: Schema$1.String,
3774
+ rendered: Schema$1.Struct({
3775
+ channel: Schema$1.Literal("email"),
3776
+ subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3777
+ html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3778
+ text: Schema$1.String,
3779
+ missingVariables: Schema$1.Array(Schema$1.String)
3780
+ })
3781
+ });
3782
+ const TemplateDocumentsTestSend401 = UnauthorizedError;
3783
+ const TemplateDocumentsTestSend402 = PaymentRequiredError;
3784
+ const TemplateDocumentsTestSend403 = ForbiddenError;
3785
+ const TemplateDocumentsTestSend404 = ResourceNotFoundError;
3786
+ const TemplateDocumentsTestSend409 = ConflictError;
3787
+ const TemplateDocumentsTestSend422 = ValidationError;
3788
+ const TemplateDocumentsTestSend429 = RateLimitedError;
3789
+ const TemplateDocumentsTestSend500 = Schema$1.Union([InternalError, WebhookEnqueueError]);
3790
+ const TemplateDocumentsTestSend502 = BillingProviderError;
3791
+ const TemplateDocumentsReplacePathParams = Schema$1.Struct({ templateId: TemplateId });
3792
+ const TemplateDocumentsReplaceRequestJson = Schema$1.Struct({
3793
+ expectedRevision: Schema$1.String,
3794
+ source: Schema$1.String
3795
+ });
3796
+ const TemplateDocumentsReplace200 = Schema$1.Struct({
3797
+ templateId: TemplateId,
3798
+ organizationId: OrganizationId,
3799
+ channel: Schema$1.Literal("email"),
3800
+ source: Schema$1.String,
3801
+ revision: Schema$1.String,
3802
+ sourceDigest: Schema$1.String,
3803
+ createdAt: Schema$1.String,
3804
+ updatedAt: Schema$1.String,
3805
+ createdBy: Schema$1.Struct({
3806
+ userId: UserId,
3807
+ via: Schema$1.Literals([
3808
+ "api",
3809
+ "mcp",
3810
+ "agent"
3811
+ ])
3812
+ }),
3813
+ updatedBy: Schema$1.Struct({
3814
+ userId: UserId,
3815
+ via: Schema$1.Literals([
3816
+ "api",
3817
+ "mcp",
3818
+ "agent"
3819
+ ])
3820
+ })
3821
+ });
3822
+ const TemplateDocumentsReplace401 = UnauthorizedError;
3823
+ const TemplateDocumentsReplace403 = ForbiddenError;
3824
+ const TemplateDocumentsReplace404 = ResourceNotFoundError;
3825
+ const TemplateDocumentsReplace409 = ConflictError;
3826
+ const TemplateDocumentsReplace422 = ValidationError;
3827
+ const TemplateDocumentsReplace500 = InternalError;
3828
+ const TemplateDocumentsSpamCheckPathParams = Schema$1.Struct({ templateId: TemplateId });
3829
+ const TemplateDocumentsSpamCheckRequestJson = Schema$1.Struct({
3830
+ revision: Schema$1.String,
3831
+ variables: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]))
3832
+ });
3833
+ const TemplateDocumentsSpamCheck200 = Schema$1.Struct({
3834
+ score: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3835
+ severity: Schema$1.Literals([
3836
+ "low",
3837
+ "medium",
3838
+ "high"
3839
+ ]),
3840
+ issues: Schema$1.Array(Schema$1.Struct({
3841
+ rule: Schema$1.String,
3842
+ description: Schema$1.String,
3843
+ severity: Schema$1.Literals([
3844
+ "low",
3845
+ "medium",
3846
+ "high"
3847
+ ]),
3848
+ score: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
3849
+ })),
3850
+ recommendations: Schema$1.Array(Schema$1.String)
3851
+ });
3852
+ const TemplateDocumentsSpamCheck401 = UnauthorizedError;
3853
+ const TemplateDocumentsSpamCheck403 = ForbiddenError;
3854
+ const TemplateDocumentsSpamCheck404 = ResourceNotFoundError;
3855
+ const TemplateDocumentsSpamCheck409 = ConflictError;
3856
+ const TemplateDocumentsSpamCheck422 = ValidationError;
3857
+ const TemplateDocumentsSpamCheck500 = InternalError;
3858
+ const TemplateDocumentsUnpublishPathParams = Schema$1.Struct({ templateId: TemplateId });
3859
+ const TemplateDocumentsUnpublish200 = Schema$1.Struct({ versionId: Schema$1.String });
3860
+ const TemplateDocumentsUnpublish401 = UnauthorizedError;
3861
+ const TemplateDocumentsUnpublish403 = ForbiddenError;
3862
+ const TemplateDocumentsUnpublish404 = ResourceNotFoundError;
3863
+ const TemplateDocumentsUnpublish409 = ConflictError;
3864
+ const TemplateDocumentsUnpublish422 = ValidationError;
3865
+ const TemplateDocumentsUnpublish500 = InternalError;
3866
+ const TemplateDocumentsVersionsPathParams = Schema$1.Struct({ templateId: TemplateId });
3867
+ const TemplateDocumentsVersions200 = Schema$1.Struct({ versions: Schema$1.Array(Schema$1.Struct({
3868
+ versionId: TemplateSourceVersionId,
3869
+ version: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })),
3870
+ status: Schema$1.String,
3871
+ isCurrent: Schema$1.Boolean,
3872
+ materializationId: Schema$1.String,
3873
+ documentRevision: Schema$1.String,
3874
+ sourceDigest: Schema$1.String,
3875
+ compilerVersion: Schema$1.String,
3876
+ publishedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
3877
+ archivedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
3878
+ createdAt: Schema$1.String
3879
+ })) });
3880
+ const TemplateDocumentsVersions401 = UnauthorizedError;
3881
+ const TemplateDocumentsVersions403 = ForbiddenError;
3882
+ const TemplateDocumentsVersions404 = ResourceNotFoundError;
3883
+ const TemplateDocumentsVersions409 = ConflictError;
3884
+ const TemplateDocumentsVersions422 = ValidationError;
3885
+ const TemplateDocumentsVersions500 = InternalError;
3886
+ const TemplateDocumentsRestorePathParams = Schema$1.Struct({
3887
+ templateId: TemplateId,
3888
+ versionId: TemplateSourceVersionId
3889
+ });
3890
+ const TemplateDocumentsRestoreRequestJson = Schema$1.Struct({ expectedRevision: Schema$1.String });
3891
+ const TemplateDocumentsRestore200 = Schema$1.Struct({
3892
+ templateId: TemplateId,
3893
+ organizationId: OrganizationId,
3894
+ channel: Schema$1.Literal("email"),
3895
+ source: Schema$1.String,
3896
+ revision: Schema$1.String,
3897
+ sourceDigest: Schema$1.String,
3898
+ createdAt: Schema$1.String,
3899
+ updatedAt: Schema$1.String,
3900
+ createdBy: Schema$1.Struct({
3901
+ userId: UserId,
3902
+ via: Schema$1.Literals([
3903
+ "api",
3904
+ "mcp",
3905
+ "agent"
3906
+ ])
3907
+ }),
3908
+ updatedBy: Schema$1.Struct({
3909
+ userId: UserId,
3910
+ via: Schema$1.Literals([
3911
+ "api",
3912
+ "mcp",
3913
+ "agent"
3914
+ ])
3915
+ })
3916
+ });
3917
+ const TemplateDocumentsRestore401 = UnauthorizedError;
3918
+ const TemplateDocumentsRestore403 = ForbiddenError;
3919
+ const TemplateDocumentsRestore404 = ResourceNotFoundError;
3920
+ const TemplateDocumentsRestore409 = ConflictError;
3921
+ const TemplateDocumentsRestore422 = ValidationError;
3922
+ const TemplateDocumentsRestore500 = InternalError;
3923
+ const TemplateDocumentsBootstrapRequestJson = Schema$1.Struct({ templateId: TemplateId });
3924
+ const TemplateDocumentsBootstrap200 = Schema$1.Struct({
3925
+ templateId: TemplateId,
3926
+ organizationId: OrganizationId,
3927
+ channel: Schema$1.Literal("email"),
3928
+ source: Schema$1.String,
3929
+ revision: Schema$1.String,
3930
+ sourceDigest: Schema$1.String,
3931
+ createdAt: Schema$1.String,
3932
+ updatedAt: Schema$1.String,
3933
+ createdBy: Schema$1.Struct({
3934
+ userId: UserId,
3935
+ via: Schema$1.Literals([
3936
+ "api",
3937
+ "mcp",
3938
+ "agent"
3939
+ ])
3940
+ }),
3941
+ updatedBy: Schema$1.Struct({
3942
+ userId: UserId,
3943
+ via: Schema$1.Literals([
3944
+ "api",
3945
+ "mcp",
3946
+ "agent"
3947
+ ])
3948
+ })
3949
+ });
3950
+ const TemplateDocumentsBootstrap401 = UnauthorizedError;
3951
+ const TemplateDocumentsBootstrap403 = ForbiddenError;
3952
+ const TemplateDocumentsBootstrap404 = ResourceNotFoundError;
3953
+ const TemplateDocumentsBootstrap409 = ConflictError;
3954
+ const TemplateDocumentsBootstrap422 = ValidationError;
3955
+ const TemplateDocumentsBootstrap500 = InternalError;
3630
3956
  const TemplatesListQuery = Schema$1.Struct({
3631
3957
  page: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3632
3958
  limit: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
@@ -3639,11 +3965,7 @@ const TemplatesListQuery = Schema$1.Struct({
3639
3965
  "reminder",
3640
3966
  "alert"
3641
3967
  ]), Schema$1.Null])),
3642
- channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
3643
- "sms",
3644
- "whatsapp",
3645
- "email"
3646
- ]), Schema$1.Null])),
3968
+ channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literal("email"), Schema$1.Null])),
3647
3969
  status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
3648
3970
  "draft",
3649
3971
  "pending",
@@ -3729,9 +4051,6 @@ const TemplatesUpdateRequestJson = Schema$1.Struct({ data: Schema$1.Struct({
3729
4051
  ]), Schema$1.Null]), Schema$1.Null])),
3730
4052
  fromDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplateFromDefault, Schema$1.Null]), Schema$1.Null])),
3731
4053
  replyToDefault: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.String), Schema$1.Null]), Schema$1.Null])),
3732
- source: Schema$1.optionalKey(Schema$1.Union([Schema$1.String.check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
3733
- subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3734
- headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null]), Schema$1.Null])),
3735
4054
  variableSchema: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(TemplateVariable), Schema$1.Null]), Schema$1.Null])),
3736
4055
  compliance: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplateCompliance, Schema$1.Null]), Schema$1.Null])),
3737
4056
  performance: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([TemplatePerformance, Schema$1.Null]), Schema$1.Null])),
@@ -3754,100 +4073,10 @@ const TemplatesApprove401 = UnauthorizedError;
3754
4073
  const TemplatesApprove403 = ForbiddenError;
3755
4074
  const TemplatesApprove404 = ResourceNotFoundError;
3756
4075
  const TemplatesApprove500 = InternalError;
3757
- const TemplatesDuplicatePathParams = Schema$1.Struct({ id: TemplateId });
3758
- const TemplatesDuplicate201 = Template;
3759
- const TemplatesDuplicate401 = UnauthorizedError;
3760
- const TemplatesDuplicate403 = ForbiddenError;
3761
- const TemplatesDuplicate404 = ResourceNotFoundError;
3762
- const TemplatesDuplicate409 = ConflictError;
3763
- const TemplatesDuplicate500 = InternalError;
3764
- const TemplatesPublishPathParams = Schema$1.Struct({ id: TemplateId });
3765
- const TemplatesPublish200 = Template;
3766
- const TemplatesPublish401 = UnauthorizedError;
3767
- const TemplatesPublish403 = ForbiddenError;
3768
- const TemplatesPublish404 = ResourceNotFoundError;
3769
- const TemplatesPublish409 = ConflictError;
3770
- const TemplatesPublish422 = ValidationError;
3771
- const TemplatesPublish500 = InternalError;
3772
- const TemplatesRenderPathParams = Schema$1.Struct({ id: TemplateId });
3773
- const TemplatesRenderRequestJson = Schema$1.Struct({ data: Schema$1.Struct({ variables: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])) }) });
3774
- const TemplatesRender200 = Schema$1.Struct({
3775
- channel: Schema$1.Literals([
3776
- "sms",
3777
- "whatsapp",
3778
- "email"
3779
- ]),
3780
- rendered: Schema$1.Struct({
3781
- subject: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3782
- html: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3783
- text: Schema$1.String
3784
- }),
3785
- sms: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
3786
- encoding: Schema$1.Union([Schema$1.String, Schema$1.Null]),
3787
- estimatedSegments: Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })), Schema$1.Null])
3788
- }), Schema$1.Null])),
3789
- whatsapp: Schema$1.optionalKey(Schema$1.Union([Schema$1.Struct({
3790
- name: Schema$1.String,
3791
- language: Schema$1.String,
3792
- category: Schema$1.String,
3793
- headerContent: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3794
- bodyContent: Schema$1.String,
3795
- footerContent: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3796
- buttons: Schema$1.Array(Schema$1.Record(Schema$1.String, JsonValue))
3797
- }), Schema$1.Null])),
3798
- missingVariables: Schema$1.Array(Schema$1.String),
3799
- errors: Schema$1.Array(Schema$1.String)
3800
- });
3801
- const TemplatesRender401 = UnauthorizedError;
3802
- const TemplatesRender403 = ForbiddenError;
3803
- const TemplatesRender404 = ResourceNotFoundError;
3804
- const TemplatesRender422 = ValidationError;
3805
- const TemplatesRender500 = InternalError;
3806
- const TemplatesUnpublishPathParams = Schema$1.Struct({ id: TemplateId });
3807
- const TemplatesUnpublish200 = Template;
3808
- const TemplatesUnpublish401 = UnauthorizedError;
3809
- const TemplatesUnpublish403 = ForbiddenError;
3810
- const TemplatesUnpublish404 = ResourceNotFoundError;
3811
- const TemplatesUnpublish422 = ValidationError;
3812
- const TemplatesUnpublish500 = InternalError;
3813
- const TemplatesVersionHistoryPathParams = Schema$1.Struct({ id: TemplateId });
3814
- const TemplatesVersionHistory200 = Schema$1.Struct({ versions: Schema$1.Array(Schema$1.Struct({
3815
- id: Schema$1.String,
3816
- version: Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })).check(Schema$1.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
3817
- status: Schema$1.String,
3818
- isCurrent: Schema$1.Boolean,
3819
- source: Schema$1.Union([Schema$1.String, Schema$1.Null]),
3820
- publishedAt: Schema$1.Union([Schema$1.String, Schema$1.Null]),
3821
- publishedBy: Schema$1.Union([Schema$1.String, Schema$1.Null]),
3822
- createdAt: Schema$1.String,
3823
- updatedAt: Schema$1.String
3824
- })) });
3825
- const TemplatesVersionHistory401 = UnauthorizedError;
3826
- const TemplatesVersionHistory403 = ForbiddenError;
3827
- const TemplatesVersionHistory404 = ResourceNotFoundError;
3828
- const TemplatesVersionHistory500 = InternalError;
3829
- const TemplatesRestoreVersionPathParams = Schema$1.Struct({
3830
- id: TemplateId,
3831
- versionId: TemplateSourceVersionId
3832
- });
3833
- const TemplatesRestoreVersion200 = Template;
3834
- const TemplatesRestoreVersion401 = UnauthorizedError;
3835
- const TemplatesRestoreVersion403 = ForbiddenError;
3836
- const TemplatesRestoreVersion404 = ResourceNotFoundError;
3837
- const TemplatesRestoreVersion409 = ConflictError;
3838
- const TemplatesRestoreVersion500 = InternalError;
3839
4076
  const TemplatesListDashboardQuery = Schema$1.Struct({
3840
4077
  page: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3841
4078
  limit: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
3842
- allowedChannels: Schema$1.Union([Schema$1.Literals([
3843
- "sms",
3844
- "whatsapp",
3845
- "email"
3846
- ]), Schema$1.Array(Schema$1.Literals([
3847
- "sms",
3848
- "whatsapp",
3849
- "email"
3850
- ]))]),
4079
+ allowedChannels: Schema$1.Union([Schema$1.Literal("email"), Schema$1.Array(Schema$1.Literal("email"))]),
3851
4080
  category: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
3852
4081
  "transactional",
3853
4082
  "marketing",
@@ -3857,11 +4086,7 @@ const TemplatesListDashboardQuery = Schema$1.Struct({
3857
4086
  "reminder",
3858
4087
  "alert"
3859
4088
  ]), Schema$1.Null])),
3860
- channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
3861
- "sms",
3862
- "whatsapp",
3863
- "email"
3864
- ]), Schema$1.Null])),
4089
+ channel: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literal("email"), Schema$1.Null])),
3865
4090
  status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals([
3866
4091
  "draft",
3867
4092
  "pending",
@@ -3938,11 +4163,7 @@ const TemplatesRenameFamily422 = ValidationError;
3938
4163
  const TemplatesRenameFamily500 = InternalError;
3939
4164
  const TemplatesAddFamilyChannelPathParams = Schema$1.Struct({
3940
4165
  familyId: TemplateFamilyId,
3941
- channel: Schema$1.Literals([
3942
- "sms",
3943
- "whatsapp",
3944
- "email"
3945
- ])
4166
+ channel: Schema$1.Literal("email")
3946
4167
  });
3947
4168
  const TemplatesAddFamilyChannel201 = TemplateFamily;
3948
4169
  const TemplatesAddFamilyChannel401 = UnauthorizedError;
@@ -3981,38 +4202,6 @@ const TemplatesCreateFamilyFromTemplate404 = ResourceNotFoundError;
3981
4202
  const TemplatesCreateFamilyFromTemplate409 = ConflictError;
3982
4203
  const TemplatesCreateFamilyFromTemplate422 = ValidationError;
3983
4204
  const TemplatesCreateFamilyFromTemplate500 = InternalError;
3984
- const TemplatesSpamCheckRequestJson = Schema$1.Union([Schema$1.Struct({
3985
- templateId: TemplateId,
3986
- inputs: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null]))
3987
- }), Schema$1.Struct({
3988
- subject: Schema$1.String,
3989
- html: Schema$1.String,
3990
- text: Schema$1.String
3991
- })]);
3992
- const TemplatesSpamCheck200 = Schema$1.Struct({
3993
- score: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
3994
- severity: Schema$1.Literals([
3995
- "low",
3996
- "medium",
3997
- "high"
3998
- ]),
3999
- issues: Schema$1.Array(Schema$1.Struct({
4000
- rule: Schema$1.String,
4001
- description: Schema$1.String,
4002
- severity: Schema$1.Literals([
4003
- "low",
4004
- "medium",
4005
- "high"
4006
- ]),
4007
- score: Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
4008
- })),
4009
- recommendations: Schema$1.Array(Schema$1.String)
4010
- });
4011
- const TemplatesSpamCheck401 = UnauthorizedError;
4012
- const TemplatesSpamCheck403 = ForbiddenError;
4013
- const TemplatesSpamCheck404 = ResourceNotFoundError;
4014
- const TemplatesSpamCheck422 = ValidationError;
4015
- const TemplatesSpamCheck500 = InternalError;
4016
4205
  const WebhooksListQuery = Schema$1.Struct({
4017
4206
  page: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
4018
4207
  limit: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
@@ -4052,13 +4241,10 @@ const WebhooksCreateRequestJson = Schema$1.Struct({
4052
4241
  "webhook.created",
4053
4242
  "webhook.updated",
4054
4243
  "webhook.deleted",
4055
- "webhook.test"
4244
+ "webhook.test",
4245
+ "domain.updated"
4056
4246
  ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
4057
- channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literals([
4058
- "sms",
4059
- "whatsapp",
4060
- "email"
4061
- ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
4247
+ channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
4062
4248
  headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])),
4063
4249
  status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals(["active", "disabled"]), Schema$1.Null]))
4064
4250
  });
@@ -4070,6 +4256,7 @@ const WebhooksCreate401 = UnauthorizedError;
4070
4256
  const WebhooksCreate402 = PaymentRequiredError;
4071
4257
  const WebhooksCreate403 = ForbiddenError;
4072
4258
  const WebhooksCreate409 = ConflictError;
4259
+ const WebhooksCreate422 = ValidationError;
4073
4260
  const WebhooksCreate500 = InternalError;
4074
4261
  const WebhooksCreate502 = BillingProviderError;
4075
4262
  const WebhooksGetPathParams = Schema$1.Struct({ id: WebhookEndpointId });
@@ -4113,13 +4300,10 @@ const WebhooksUpdateRequestJson = Schema$1.Struct({
4113
4300
  "webhook.created",
4114
4301
  "webhook.updated",
4115
4302
  "webhook.deleted",
4116
- "webhook.test"
4303
+ "webhook.test",
4304
+ "domain.updated"
4117
4305
  ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null])),
4118
- channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.Literals([
4119
- "sms",
4120
- "whatsapp",
4121
- "email"
4122
- ])).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null]), Schema$1.Null])),
4306
+ channels: Schema$1.optionalKey(Schema$1.Union([Schema$1.Union([Schema$1.Array(Schema$1.Literal("email")).check(Schema$1.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema$1.Null]), Schema$1.Null])),
4123
4307
  headers: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null])),
4124
4308
  status: Schema$1.optionalKey(Schema$1.Union([Schema$1.Literals(["active", "disabled"]), Schema$1.Null]))
4125
4309
  });
@@ -4128,6 +4312,7 @@ const WebhooksUpdate401 = UnauthorizedError;
4128
4312
  const WebhooksUpdate403 = ForbiddenError;
4129
4313
  const WebhooksUpdate404 = ResourceNotFoundError;
4130
4314
  const WebhooksUpdate409 = ConflictError;
4315
+ const WebhooksUpdate422 = ValidationError;
4131
4316
  const WebhooksUpdate500 = InternalError;
4132
4317
  const WebhooksTestPathParams = Schema$1.Struct({ id: WebhookEndpointId });
4133
4318
  const WebhooksTestRequestJson = Schema$1.Struct({ data: Schema$1.optionalKey(Schema$1.Union([Schema$1.Record(Schema$1.String, JsonValue), Schema$1.Null])) });
@@ -4188,7 +4373,6 @@ const WebhooksGetLogs200 = Schema$1.Struct({
4188
4373
  attemptedAt: Schema$1.String,
4189
4374
  responseStatus: Schema$1.Union([Schema$1.Finite.check(Schema$1.isInt().annotate({ expected: "an integer" })), Schema$1.Null]),
4190
4375
  responseHeaders: Schema$1.Union([Schema$1.Record(Schema$1.String, Schema$1.String), Schema$1.Null]),
4191
- responseBody: Schema$1.Union([Schema$1.String, Schema$1.Null]),
4192
4376
  durationMs: Schema$1.Union([Schema$1.Finite.check(Schema$1.isFinite().annotate({ expected: "a finite number" })).check(Schema$1.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema$1.Null]),
4193
4377
  errorCode: Schema$1.Union([Schema$1.String, Schema$1.Null]),
4194
4378
  errorMessage: Schema$1.Union([Schema$1.String, Schema$1.Null]),
@@ -4241,6 +4425,7 @@ var APIKeysGroup = class extends HttpApiGroup.make("API Keys").add(HttpApiEndpoi
4241
4425
  ApiKeysCreate402.pipe(HttpApiSchema.status(402)),
4242
4426
  ApiKeysCreate403.pipe(HttpApiSchema.status(403)),
4243
4427
  ApiKeysCreate404.pipe(HttpApiSchema.status(404)),
4428
+ ApiKeysCreate422.pipe(HttpApiSchema.status(422)),
4244
4429
  ApiKeysCreate500,
4245
4430
  ApiKeysCreate502.pipe(HttpApiSchema.status(502))
4246
4431
  ]
@@ -4300,9 +4485,10 @@ var APIKeysGroup = class extends HttpApiGroup.make("API Keys").add(HttpApiEndpoi
4300
4485
  ApiKeysRotate401.pipe(HttpApiSchema.status(401)),
4301
4486
  ApiKeysRotate403.pipe(HttpApiSchema.status(403)),
4302
4487
  ApiKeysRotate404.pipe(HttpApiSchema.status(404)),
4488
+ ApiKeysRotate422.pipe(HttpApiSchema.status(422)),
4303
4489
  ApiKeysRotate500
4304
4490
  ]
4305
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.rotate").annotate(OpenApi.Summary, "Rotate an API key").annotate(OpenApi.Description, "Deactivates the existing key and issues a replacement with the same name and permissions. Returns the new key, including the plaintext secret."), HttpApiEndpoint.get("apiKeysGetStats", "/v1/api-keys/:id/stats", {
4491
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.rotate").annotate(OpenApi.Summary, "Rotate an API key").annotate(OpenApi.Description, "Issues a replacement with the same owner, name, and permissions, then deactivates the existing key. Returns the new key, including the plaintext secret."), HttpApiEndpoint.get("apiKeysGetStats", "/v1/api-keys/:id/stats", {
4306
4492
  params: ApiKeysGetStatsPathParams,
4307
4493
  query: ApiKeysGetStatsQuery,
4308
4494
  success: ApiKeysGetStats200,
@@ -4572,7 +4758,7 @@ var ContactsGroup = class extends HttpApiGroup.make("Contacts").add(HttpApiEndpo
4572
4758
  ContactsFind422.pipe(HttpApiSchema.status(422)),
4573
4759
  ContactsFind500
4574
4760
  ]
4575
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.find").annotate(OpenApi.Summary, "Find a contact").annotate(OpenApi.Description, "Looks up a single contact by email, phone, WhatsApp, or external ID, returning null when no contact matches."), HttpApiEndpoint.post("contactsFindOrCreate", "/v1/contacts/find-or-create", {
4761
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.find").annotate(OpenApi.Summary, "Find a contact").annotate(OpenApi.Description, "Samva API operation."), HttpApiEndpoint.post("contactsFindOrCreate", "/v1/contacts/find-or-create", {
4576
4762
  payload: ContactsFindOrCreateRequestJson,
4577
4763
  success: ContactsFindOrCreate200,
4578
4764
  error: [
@@ -4654,7 +4840,7 @@ var ConversationsGroup = class extends HttpApiGroup.make("Conversations").add(Ht
4654
4840
  ConversationsListMessages404.pipe(HttpApiSchema.status(404)),
4655
4841
  ConversationsListMessages500
4656
4842
  ]
4657
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "conversations.listMessages").annotate(OpenApi.Summary, "List conversation messages").annotate(OpenApi.Description, "Returns the messages in a conversation using the canonical message schema and page-based pagination.")).annotate(OpenApi.Description, "Conversation management — create, update, and manage multi-channel conversations") {};
4843
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "conversations.listMessages").annotate(OpenApi.Summary, "List conversation messages").annotate(OpenApi.Description, "Returns the messages in a conversation using the canonical message schema and page-based pagination.")).annotate(OpenApi.Description, "Samva API operation.") {};
4658
4844
  var DesignGroup = class extends HttpApiGroup.make("Design").add(HttpApiEndpoint.get("designGet", "/v1/design", {
4659
4845
  success: DesignGet200,
4660
4846
  error: [
@@ -4773,19 +4959,7 @@ var EmailGroup = class extends HttpApiGroup.make("Email").add(HttpApiEndpoint.ge
4773
4959
  EmailGetCatchAllStats404.pipe(HttpApiSchema.status(404)),
4774
4960
  EmailGetCatchAllStats500
4775
4961
  ]
4776
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.getCatchAllStats").annotate(OpenApi.Summary, "Get catch-all statistics").annotate(OpenApi.Description, "Returns catch-all receiving counters for a domain, adding an aggregated breakdown when a date range is supplied."), HttpApiEndpoint.post("emailProvisionDomain", "/v1/email/domain-operations", {
4777
- headers: EmailProvisionDomainHeaders,
4778
- payload: EmailProvisionDomainRequestJson,
4779
- success: EmailProvisionDomain202.pipe(HttpApiSchema.status(202)),
4780
- error: [
4781
- EmailProvisionDomain401.pipe(HttpApiSchema.status(401)),
4782
- EmailProvisionDomain403.pipe(HttpApiSchema.status(403)),
4783
- EmailProvisionDomain409.pipe(HttpApiSchema.status(409)),
4784
- EmailProvisionDomain422.pipe(HttpApiSchema.status(422)),
4785
- EmailProvisionDomain500,
4786
- EmailProvisionDomain502.pipe(HttpApiSchema.status(502))
4787
- ]
4788
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.provisionDomain").annotate(OpenApi.Summary, "Provision a sending domain").annotate(OpenApi.Description, "Accepts durable provisioning for a sending domain. Repeating an identical request with the same Idempotency-Key returns the same organization-scoped operation."), HttpApiEndpoint.get("emailListDomains", "/v1/email/domains", {
4962
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.getCatchAllStats").annotate(OpenApi.Summary, "Get catch-all statistics").annotate(OpenApi.Description, "Returns catch-all receiving counters for a domain, adding an aggregated breakdown when a date range is supplied."), HttpApiEndpoint.get("emailListDomains", "/v1/email/domains", {
4789
4963
  query: EmailListDomainsQuery,
4790
4964
  success: EmailListDomains200,
4791
4965
  error: [
@@ -4822,37 +4996,7 @@ var EmailGroup = class extends HttpApiGroup.make("Email").add(HttpApiEndpoint.ge
4822
4996
  EmailRemoveDomain500,
4823
4997
  EmailRemoveDomain502.pipe(HttpApiSchema.status(502))
4824
4998
  ]
4825
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.removeDomain").annotate(OpenApi.Summary, "Remove a sending domain").annotate(OpenApi.Description, "Permanently deletes a sending domain from the organization."), HttpApiEndpoint.get("emailGetBrandedTracking", "/v1/email/domains/:id/branded-tracking", {
4826
- params: EmailGetBrandedTrackingPathParams,
4827
- success: EmailGetBrandedTracking200,
4828
- error: [
4829
- EmailGetBrandedTracking401.pipe(HttpApiSchema.status(401)),
4830
- EmailGetBrandedTracking403.pipe(HttpApiSchema.status(403)),
4831
- EmailGetBrandedTracking500
4832
- ]
4833
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.getBrandedTracking").annotate(OpenApi.Summary, "Get branded tracking status").annotate(OpenApi.Description, "Returns the branded tracking state for a sending domain: lifecycle status, the required DNS records, certificate and CAA readiness, and any scheduled teardown. `enabled` is false when no branded tracking domain is provisioned."), HttpApiEndpoint.post("emailEnableBrandedTracking", "/v1/email/domains/:id/branded-tracking", {
4834
- params: EmailEnableBrandedTrackingPathParams,
4835
- payload: EmailEnableBrandedTrackingRequestJson,
4836
- success: EmailEnableBrandedTracking200,
4837
- error: [
4838
- EmailEnableBrandedTracking401.pipe(HttpApiSchema.status(401)),
4839
- EmailEnableBrandedTracking403.pipe(HttpApiSchema.status(403)),
4840
- EmailEnableBrandedTracking409.pipe(HttpApiSchema.status(409)),
4841
- EmailEnableBrandedTracking422.pipe(HttpApiSchema.status(422)),
4842
- EmailEnableBrandedTracking500,
4843
- EmailEnableBrandedTracking502.pipe(HttpApiSchema.status(502))
4844
- ]
4845
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.enableBrandedTracking").annotate(OpenApi.Summary, "Enable a branded tracking domain").annotate(OpenApi.Description, "Provisions a branded tracking domain (default label `track`) for a verified sending domain so open/click links redirect through the customer's own subdomain. Requires the branded_tracking entitlement. Returns the resulting state including the two DNS records the customer must create."), HttpApiEndpoint.delete("emailDisableBrandedTracking", "/v1/email/domains/:id/branded-tracking", {
4846
- params: EmailDisableBrandedTrackingPathParams,
4847
- success: EmailDisableBrandedTracking200,
4848
- error: [
4849
- EmailDisableBrandedTracking401.pipe(HttpApiSchema.status(401)),
4850
- EmailDisableBrandedTracking403.pipe(HttpApiSchema.status(403)),
4851
- EmailDisableBrandedTracking409.pipe(HttpApiSchema.status(409)),
4852
- EmailDisableBrandedTracking500,
4853
- EmailDisableBrandedTracking502.pipe(HttpApiSchema.status(502))
4854
- ]
4855
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.disableBrandedTracking").annotate(OpenApi.Summary, "Disable a branded tracking domain").annotate(OpenApi.Description, "Tears down a domain's branded tracking and its managed resources. Sends immediately revert to the shared tracking host. Existing branded links in already-delivered mail stop working."), HttpApiEndpoint.patch("emailUpdateDomainConfig", "/v1/email/domains/:id/config", {
4999
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.removeDomain").annotate(OpenApi.Summary, "Remove a sending domain").annotate(OpenApi.Description, "Permanently deletes a sending domain from the organization."), HttpApiEndpoint.patch("emailUpdateDomainConfig", "/v1/email/domains/:id/config", {
4856
5000
  params: EmailUpdateDomainConfigPathParams,
4857
5001
  payload: EmailUpdateDomainConfigRequestJson,
4858
5002
  success: EmailUpdateDomainConfig200,
@@ -4862,7 +5006,66 @@ var EmailGroup = class extends HttpApiGroup.make("Email").add(HttpApiEndpoint.ge
4862
5006
  EmailUpdateDomainConfig404.pipe(HttpApiSchema.status(404)),
4863
5007
  EmailUpdateDomainConfig500
4864
5008
  ]
4865
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.updateDomainConfig").annotate(OpenApi.Summary, "Update a domain's send-settings config").annotate(OpenApi.Description, "Overrides the domain's open/click tracking, reply-to, and unsubscribe-group defaults for the settings cascade. An omitted field is left unchanged; null clears it back to the organization default. Returns the saved config."), HttpApiEndpoint.post("emailSetDefaultDomain", "/v1/email/domains/:id/default", {
5009
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.updateDomainConfig").annotate(OpenApi.Summary, "Update a domain's send-settings config").annotate(OpenApi.Description, "Overrides the domain's open/click tracking, reply-to, and unsubscribe-group defaults for the settings cascade. An omitted field is left unchanged; null clears it back to the organization default. Returns the saved config."), HttpApiEndpoint.get("emailGetCustomTracking", "/v1/email/domains/:id/custom-tracking", {
5010
+ params: EmailGetCustomTrackingPathParams,
5011
+ success: EmailGetCustomTracking200,
5012
+ error: [
5013
+ EmailGetCustomTracking401.pipe(HttpApiSchema.status(401)),
5014
+ EmailGetCustomTracking403.pipe(HttpApiSchema.status(403)),
5015
+ EmailGetCustomTracking500
5016
+ ]
5017
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.getCustomTracking").annotate(OpenApi.Summary, "Get custom tracking status").annotate(OpenApi.Description, "Returns the custom tracking state for a sending domain: lifecycle status, the required DNS records, certificate and CAA readiness, and any scheduled teardown. `enabled` is false when no custom tracking domain is provisioned."), HttpApiEndpoint.post("emailEnableCustomTracking", "/v1/email/domains/:id/custom-tracking", {
5018
+ params: EmailEnableCustomTrackingPathParams,
5019
+ payload: EmailEnableCustomTrackingRequestJson,
5020
+ success: EmailEnableCustomTracking200,
5021
+ error: [
5022
+ EmailEnableCustomTracking401.pipe(HttpApiSchema.status(401)),
5023
+ EmailEnableCustomTracking403.pipe(HttpApiSchema.status(403)),
5024
+ EmailEnableCustomTracking409.pipe(HttpApiSchema.status(409)),
5025
+ EmailEnableCustomTracking422.pipe(HttpApiSchema.status(422)),
5026
+ EmailEnableCustomTracking500,
5027
+ EmailEnableCustomTracking502.pipe(HttpApiSchema.status(502))
5028
+ ]
5029
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.enableCustomTracking").annotate(OpenApi.Summary, "Enable a custom tracking domain").annotate(OpenApi.Description, "Provisions a custom tracking domain (default label `track`) for a verified sending domain so open/click links redirect through the customer's own subdomain. Requires the custom_tracking_domain entitlement. Returns the resulting state including the two DNS records the customer must create."), HttpApiEndpoint.delete("emailDisableCustomTracking", "/v1/email/domains/:id/custom-tracking", {
5030
+ params: EmailDisableCustomTrackingPathParams,
5031
+ success: EmailDisableCustomTracking200,
5032
+ error: [
5033
+ EmailDisableCustomTracking401.pipe(HttpApiSchema.status(401)),
5034
+ EmailDisableCustomTracking403.pipe(HttpApiSchema.status(403)),
5035
+ EmailDisableCustomTracking409.pipe(HttpApiSchema.status(409)),
5036
+ EmailDisableCustomTracking500,
5037
+ EmailDisableCustomTracking502.pipe(HttpApiSchema.status(502))
5038
+ ]
5039
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.disableCustomTracking").annotate(OpenApi.Summary, "Disable a custom tracking domain").annotate(OpenApi.Description, "Tears down a domain's custom tracking and its managed resources. Sends immediately revert to the shared tracking host. Existing custom links in already-delivered mail stop working."), HttpApiEndpoint.get("emailGetCustomTrackingDomainConnect", "/v1/email/domains/:id/custom-tracking/domain-connect", {
5040
+ params: EmailGetCustomTrackingDomainConnectPathParams,
5041
+ success: EmailGetCustomTrackingDomainConnect200,
5042
+ error: [
5043
+ EmailGetCustomTrackingDomainConnect401.pipe(HttpApiSchema.status(401)),
5044
+ EmailGetCustomTrackingDomainConnect403.pipe(HttpApiSchema.status(403)),
5045
+ EmailGetCustomTrackingDomainConnect404.pipe(HttpApiSchema.status(404)),
5046
+ EmailGetCustomTrackingDomainConnect500
5047
+ ]
5048
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.getCustomTrackingDomainConnect").annotate(OpenApi.Summary, "Check automatic Custom Tracking Domain setup eligibility").annotate(OpenApi.Description, "Reports whether the domain's DNS provider supports Domain Connect for its current Custom Tracking Domain. Ineligible is a normal result and the exact manual CNAME records remain available."), HttpApiEndpoint.post("emailBuildCustomTrackingDomainConnectApplyUrl", "/v1/email/domains/:id/custom-tracking/domain-connect/apply-url", {
5049
+ params: EmailBuildCustomTrackingDomainConnectApplyUrlPathParams,
5050
+ success: EmailBuildCustomTrackingDomainConnectApplyUrl200,
5051
+ error: [
5052
+ EmailBuildCustomTrackingDomainConnectApplyUrl401.pipe(HttpApiSchema.status(401)),
5053
+ EmailBuildCustomTrackingDomainConnectApplyUrl403.pipe(HttpApiSchema.status(403)),
5054
+ EmailBuildCustomTrackingDomainConnectApplyUrl404.pipe(HttpApiSchema.status(404)),
5055
+ EmailBuildCustomTrackingDomainConnectApplyUrl422.pipe(HttpApiSchema.status(422)),
5056
+ EmailBuildCustomTrackingDomainConnectApplyUrl500,
5057
+ EmailBuildCustomTrackingDomainConnectApplyUrl502.pipe(HttpApiSchema.status(502))
5058
+ ]
5059
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.buildCustomTrackingDomainConnectApplyUrl").annotate(OpenApi.Summary, "Build an automatic Custom Tracking Domain apply URL").annotate(OpenApi.Description, "Builds the signed Domain Connect URL for the current customer-selected tracking host. The server derives the host and Cloudflare DCV UUID; exact manual CNAME records remain available."), HttpApiEndpoint.post("emailCompleteCustomTrackingDomainConnect", "/v1/email/domains/:id/custom-tracking/domain-connect/complete", {
5060
+ params: EmailCompleteCustomTrackingDomainConnectPathParams,
5061
+ payload: EmailCompleteCustomTrackingDomainConnectRequestJson,
5062
+ success: EmailCompleteCustomTrackingDomainConnect200,
5063
+ error: [
5064
+ EmailCompleteCustomTrackingDomainConnect401.pipe(HttpApiSchema.status(401)),
5065
+ EmailCompleteCustomTrackingDomainConnect403.pipe(HttpApiSchema.status(403)),
5066
+ EmailCompleteCustomTrackingDomainConnect500
5067
+ ]
5068
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.completeCustomTrackingDomainConnect").annotate(OpenApi.Summary, "Complete an automatic Custom Tracking Domain return").annotate(OpenApi.Description, "Validates the purpose- and revision-bound registrar state, then re-kicks the existing readiness reconciliation. The callback never declares the host ready or changes email tracking selection."), HttpApiEndpoint.post("emailSetDefaultDomain", "/v1/email/domains/:id/default", {
4866
5069
  params: EmailSetDefaultDomainPathParams,
4867
5070
  success: EmailSetDefaultDomain200,
4868
5071
  error: [
@@ -4894,6 +5097,7 @@ var EmailGroup = class extends HttpApiGroup.make("Email").add(HttpApiEndpoint.ge
4894
5097
  ]
4895
5098
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.clearDomainDefaultSender").annotate(OpenApi.Summary, "Clear a domain's default sender").annotate(OpenApi.Description, "Removes the domain's default sender so omitted-`from` sends fall through to the organization default sender."), HttpApiEndpoint.get("emailGetDomainConnect", "/v1/email/domains/:id/domain-connect", {
4896
5099
  params: EmailGetDomainConnectPathParams,
5100
+ query: EmailGetDomainConnectQuery,
4897
5101
  success: EmailGetDomainConnect200,
4898
5102
  error: [
4899
5103
  EmailGetDomainConnect401.pipe(HttpApiSchema.status(401)),
@@ -4913,7 +5117,7 @@ var EmailGroup = class extends HttpApiGroup.make("Email").add(HttpApiEndpoint.ge
4913
5117
  EmailBuildDomainConnectApplyUrl500,
4914
5118
  EmailBuildDomainConnectApplyUrl502.pipe(HttpApiSchema.status(502))
4915
5119
  ]
4916
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.buildDomainConnectApplyUrl").annotate(OpenApi.Summary, "Build a one-click DNS apply URL").annotate(OpenApi.Description, "Builds the signed Domain Connect apply URL that sends the customer to their DNS provider to apply Samva's sending records in one click. Pass inbound to also request the receiving MX records."), HttpApiEndpoint.post("emailCompleteDomainConnect", "/v1/email/domains/:id/domain-connect/complete", {
5120
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.buildDomainConnectApplyUrl").annotate(OpenApi.Summary, "Build a one-click DNS apply URL").annotate(OpenApi.Description, "Builds the signed Domain Connect apply URL for the selected sending-only or sending-and-receiving service. Manual DNS remains available for either mode."), HttpApiEndpoint.post("emailCompleteDomainConnect", "/v1/email/domains/:id/domain-connect/complete", {
4917
5121
  params: EmailCompleteDomainConnectPathParams,
4918
5122
  payload: EmailCompleteDomainConnectRequestJson,
4919
5123
  success: EmailCompleteDomainConnect200,
@@ -4944,35 +5148,29 @@ var EmailGroup = class extends HttpApiGroup.make("Email").add(HttpApiEndpoint.ge
4944
5148
  EmailDetectRegistrar403.pipe(HttpApiSchema.status(403)),
4945
5149
  EmailDetectRegistrar500
4946
5150
  ]
4947
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.detectRegistrar").annotate(OpenApi.Summary, "Detect a domain's registrar").annotate(OpenApi.Description, "Looks up the domain's nameservers to detect its DNS registrar and returns the provider, nameservers, and a link to its setup docs."), HttpApiEndpoint.get("emailGetDomainStatus", "/v1/email/domains/:id/status", {
4948
- params: EmailGetDomainStatusPathParams,
4949
- success: EmailGetDomainStatus200,
4950
- error: [
4951
- EmailGetDomainStatus401.pipe(HttpApiSchema.status(401)),
4952
- EmailGetDomainStatus403.pipe(HttpApiSchema.status(403)),
4953
- EmailGetDomainStatus404.pipe(HttpApiSchema.status(404))
4954
- ]
4955
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.getDomainStatus").annotate(OpenApi.Summary, "Get sending domain status").annotate(OpenApi.Description, "Returns the stored verification status of a sending domain without contacting the email provider."), HttpApiEndpoint.get("emailCheckDomainVerification", "/v1/email/domains/:id/verification", {
4956
- params: EmailCheckDomainVerificationPathParams,
4957
- success: EmailCheckDomainVerification200,
4958
- error: [
4959
- EmailCheckDomainVerification401.pipe(HttpApiSchema.status(401)),
4960
- EmailCheckDomainVerification403.pipe(HttpApiSchema.status(403)),
4961
- EmailCheckDomainVerification404.pipe(HttpApiSchema.status(404)),
4962
- EmailCheckDomainVerification500,
4963
- EmailCheckDomainVerification502.pipe(HttpApiSchema.status(502))
4964
- ]
4965
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.checkDomainVerification").annotate(OpenApi.Summary, "Check domain verification status").annotate(OpenApi.Description, "Re-checks a sending domain's verification live with the email provider and updates the stored status once it is verified."), HttpApiEndpoint.post("emailVerifyDomain", "/v1/email/domains/:id/verify", {
4966
- params: EmailVerifyDomainPathParams,
4967
- success: EmailVerifyDomain200,
4968
- error: [
4969
- EmailVerifyDomain401.pipe(HttpApiSchema.status(401)),
4970
- EmailVerifyDomain403.pipe(HttpApiSchema.status(403)),
4971
- EmailVerifyDomain404.pipe(HttpApiSchema.status(404)),
4972
- EmailVerifyDomain500,
4973
- EmailVerifyDomain502.pipe(HttpApiSchema.status(502))
4974
- ]
4975
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.verifyDomain").annotate(OpenApi.Summary, "Verify a sending domain").annotate(OpenApi.Description, "Initiates verification of a sending domain with the email provider and stores the DNS records needed to complete it."), HttpApiEndpoint.get("emailListForwardingRules", "/v1/email/forwarding", {
5151
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.detectRegistrar").annotate(OpenApi.Summary, "Detect a domain's registrar").annotate(OpenApi.Description, "Looks up the domain's nameservers to detect its DNS registrar and returns the provider, nameservers, and a link to its setup docs."), HttpApiEndpoint.get("emailGetDomainVerification", "/v1/email/domains/:id/verification", {
5152
+ params: EmailGetDomainVerificationPathParams,
5153
+ success: EmailGetDomainVerification200,
5154
+ error: [
5155
+ EmailGetDomainVerification401.pipe(HttpApiSchema.status(401)),
5156
+ EmailGetDomainVerification403.pipe(HttpApiSchema.status(403)),
5157
+ EmailGetDomainVerification404.pipe(HttpApiSchema.status(404)),
5158
+ EmailGetDomainVerification500
5159
+ ]
5160
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.getDomainVerification").annotate(OpenApi.Summary, "Get domain verification").annotate(OpenApi.Description, "Returns the stored DNS and provider lifecycle snapshot without calling a provider or mutating state."), HttpApiEndpoint.post("emailAdvanceDomainVerification", "/v1/email/domains/:id/verification", {
5161
+ params: EmailAdvanceDomainVerificationPathParams,
5162
+ success: EmailAdvanceDomainVerification200,
5163
+ error: [
5164
+ EmailAdvanceDomainVerification401.pipe(HttpApiSchema.status(401)),
5165
+ EmailAdvanceDomainVerification403.pipe(HttpApiSchema.status(403)),
5166
+ EmailAdvanceDomainVerification404.pipe(HttpApiSchema.status(404)),
5167
+ EmailAdvanceDomainVerification409.pipe(HttpApiSchema.status(409)),
5168
+ EmailAdvanceDomainVerification422.pipe(HttpApiSchema.status(422)),
5169
+ EmailAdvanceDomainVerification429.pipe(HttpApiSchema.status(429)),
5170
+ EmailAdvanceDomainVerification500,
5171
+ EmailAdvanceDomainVerification502.pipe(HttpApiSchema.status(502))
5172
+ ]
5173
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.advanceDomainVerification").annotate(OpenApi.Summary, "Advance domain verification").annotate(OpenApi.Description, "Observes the required DNS records and, once they match, idempotently starts provider provisioning for the staged domain."), HttpApiEndpoint.get("emailListForwardingRules", "/v1/email/forwarding", {
4976
5174
  query: EmailListForwardingRulesQuery,
4977
5175
  success: EmailListForwardingRules200,
4978
5176
  error: [
@@ -5128,6 +5326,55 @@ var EmailGroup = class extends HttpApiGroup.make("Email").add(HttpApiEndpoint.ge
5128
5326
  EmailUpdateRecipientTrackingPreference500
5129
5327
  ]
5130
5328
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "email.updateRecipientTrackingPreference").annotate(OpenApi.Summary, "Update a recipient tracking preference").annotate(OpenApi.Description, "Opts a normalized recipient email in or out of open and click tracking. Opt-out takes precedence over per-send overrides and organization defaults without changing suppression or send eligibility.")).annotate(OpenApi.Description, "Unified email domain for sending, domains, templates, threads, catch-all, blocking, forwarding, and onboarding") {};
5329
+ var MediaGroup = class extends HttpApiGroup.make("Media").add(HttpApiEndpoint.post("mediaCreate", "/v1/media", {
5330
+ payload: MediaCreateRequestJson,
5331
+ success: MediaCreate201.pipe(HttpApiSchema.status(201)),
5332
+ error: [
5333
+ MediaCreate401.pipe(HttpApiSchema.status(401)),
5334
+ MediaCreate403.pipe(HttpApiSchema.status(403)),
5335
+ MediaCreate422.pipe(HttpApiSchema.status(422)),
5336
+ MediaCreate500
5337
+ ]
5338
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "media.create").annotate(OpenApi.Summary, "Create a media object").annotate(OpenApi.Description, "Creates the media object in the pending state and returns it with the upload instruction — URL, method, and headers — for putting its bytes into storage."), HttpApiEndpoint.get("mediaGetById", "/v1/media/:mediaId", {
5339
+ params: MediaGetByIdPathParams,
5340
+ success: MediaGetById200,
5341
+ error: [
5342
+ MediaGetById401.pipe(HttpApiSchema.status(401)),
5343
+ MediaGetById403.pipe(HttpApiSchema.status(403)),
5344
+ MediaGetById404.pipe(HttpApiSchema.status(404)),
5345
+ MediaGetById500
5346
+ ]
5347
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "media.getById").annotate(OpenApi.Summary, "Get a media object").annotate(OpenApi.Description, "Returns the media object's metadata, including status, dimensions, and confirmation timestamps."), HttpApiEndpoint.delete("mediaRemove", "/v1/media/:mediaId", {
5348
+ params: MediaRemovePathParams,
5349
+ success: MediaRemove200,
5350
+ error: [
5351
+ MediaRemove401.pipe(HttpApiSchema.status(401)),
5352
+ MediaRemove403.pipe(HttpApiSchema.status(403)),
5353
+ MediaRemove404.pipe(HttpApiSchema.status(404)),
5354
+ MediaRemove422.pipe(HttpApiSchema.status(422)),
5355
+ MediaRemove500
5356
+ ]
5357
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "media.remove").annotate(OpenApi.Summary, "Delete a media object").annotate(OpenApi.Description, "Deletes a pending media object and the bytes stored for it. Fails if the media object is already ready."), HttpApiEndpoint.post("mediaComplete", "/v1/media/:mediaId/complete", {
5358
+ params: MediaCompletePathParams,
5359
+ success: MediaComplete200,
5360
+ error: [
5361
+ MediaComplete401.pipe(HttpApiSchema.status(401)),
5362
+ MediaComplete403.pipe(HttpApiSchema.status(403)),
5363
+ MediaComplete404.pipe(HttpApiSchema.status(404)),
5364
+ MediaComplete422.pipe(HttpApiSchema.status(422)),
5365
+ MediaComplete500
5366
+ ]
5367
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "media.complete").annotate(OpenApi.Summary, "Complete a media upload").annotate(OpenApi.Description, "Verifies the uploaded object exists in storage, marks the media object ready, and returns it with a download URL."), HttpApiEndpoint.get("mediaDownloadUrl", "/v1/media/:mediaId/url", {
5368
+ params: MediaDownloadUrlPathParams,
5369
+ success: MediaDownloadUrl200,
5370
+ error: [
5371
+ MediaDownloadUrl401.pipe(HttpApiSchema.status(401)),
5372
+ MediaDownloadUrl403.pipe(HttpApiSchema.status(403)),
5373
+ MediaDownloadUrl404.pipe(HttpApiSchema.status(404)),
5374
+ MediaDownloadUrl422.pipe(HttpApiSchema.status(422)),
5375
+ MediaDownloadUrl500
5376
+ ]
5377
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "media.downloadUrl").annotate(OpenApi.Summary, "Get a media download URL").annotate(OpenApi.Description, "Generates a presigned, time-limited download URL for a ready media object.")).annotate(OpenApi.Description, "Media objects and the presigned uploads that fill them") {};
5131
5378
  var MessagesGroup = class extends HttpApiGroup.make("Messages").add(HttpApiEndpoint.get("messagesList", "/v1/messages", {
5132
5379
  query: MessagesListQuery,
5133
5380
  success: MessagesList200,
@@ -5151,7 +5398,7 @@ var MessagesGroup = class extends HttpApiGroup.make("Messages").add(HttpApiEndpo
5151
5398
  MessagesSend500,
5152
5399
  MessagesSend502.pipe(HttpApiSchema.status(502))
5153
5400
  ]
5154
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "messages.send").annotate(OpenApi.Summary, "Send a message").annotate(OpenApi.Description, "Sends a message on the requested channel and returns the created message with a 201 Created status. `channel` selects the payload variant. Email sends today; the SMS and WhatsApp variants are coming soon and answer 403 until the channel launches for your organization, so integrating against them now costs no rewrite later. Repeating an identical request with the same optional `Idempotency-Key` header returns the original message; reusing the key for different content returns a conflict."), HttpApiEndpoint.get("messagesGet", "/v1/messages/:id", {
5401
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "messages.send").annotate(OpenApi.Summary, "Send a message").annotate(OpenApi.Description, "Sends a message on the requested channel and returns the created message with a 201 Created status. `channel` selects the payload variant. Repeating an identical request with the same optional `Idempotency-Key` header returns the original message; reusing the key for different content returns a conflict."), HttpApiEndpoint.get("messagesGet", "/v1/messages/:id", {
5155
5402
  params: MessagesGetPathParams,
5156
5403
  success: MessagesGet200,
5157
5404
  error: [
@@ -5179,7 +5426,7 @@ var MessagesGroup = class extends HttpApiGroup.make("Messages").add(HttpApiEndpo
5179
5426
  MessagesGetEmail404.pipe(HttpApiSchema.status(404)),
5180
5427
  MessagesGetEmail500
5181
5428
  ]
5182
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "messages.getEmail").annotate(OpenApi.Summary, "Get email message details").annotate(OpenApi.Description, "Returns the email projection of a message, optionally including signed S3 URLs for its raw MIME, HTML, and text content."), HttpApiEndpoint.get("messagesGetEvents", "/v1/messages/:id/events", {
5429
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "messages.getEmail").annotate(OpenApi.Summary, "Get email message details").annotate(OpenApi.Description, "Returns email delivery details for a message, optionally including signed URLs for its raw MIME, HTML, and text content."), HttpApiEndpoint.get("messagesGetEvents", "/v1/messages/:id/events", {
5183
5430
  params: MessagesGetEventsPathParams,
5184
5431
  success: MessagesGetEvents200,
5185
5432
  error: [
@@ -5197,7 +5444,7 @@ var MessagesGroup = class extends HttpApiGroup.make("Messages").add(HttpApiEndpo
5197
5444
  MessagesGetStatus404.pipe(HttpApiSchema.status(404)),
5198
5445
  MessagesGetStatus500
5199
5446
  ]
5200
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "messages.getStatus").annotate(OpenApi.Summary, "Get message delivery status").annotate(OpenApi.Description, "Returns the current delivery status of a message by its ID.")).annotate(OpenApi.Description, "Multichannel message management. The send payload is a channel union: email delivers today, the SMS and WhatsApp variants are published as coming soon and answer 403 until they launch, and the read models already span every channel a message can arrive on.") {};
5447
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "messages.getStatus").annotate(OpenApi.Summary, "Get message delivery status").annotate(OpenApi.Description, "Returns the current delivery status of a message by its ID.")).annotate(OpenApi.Description, "Samva API operation.") {};
5201
5448
  var ScheduledMessagesGroup = class extends HttpApiGroup.make("Scheduled Messages").add(HttpApiEndpoint.get("scheduledMessagesList", "/v1/messages/scheduled", {
5202
5449
  query: ScheduledMessagesListQuery,
5203
5450
  success: ScheduledMessagesList200,
@@ -5217,7 +5464,7 @@ var ScheduledMessagesGroup = class extends HttpApiGroup.make("Scheduled Messages
5217
5464
  ScheduledMessagesCreate500,
5218
5465
  ScheduledMessagesCreate502.pipe(HttpApiSchema.status(502))
5219
5466
  ]
5220
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "scheduledMessages.create").annotate(OpenApi.Summary, "Schedule a message").annotate(OpenApi.Description, "Schedules a message at the absolute ISO-8601 instant in scheduledFor. The send payload is the same channel union the immediate send accepts, with each channel's content checked at schedule time so a send that could never render fails now rather than hours later: email schedules today, and the SMS and WhatsApp variants are coming soon and answer 403 until the channel launches. Optional timezone is validated IANA display metadata only and never changes the execution instant."), HttpApiEndpoint.get("scheduledMessagesGet", "/v1/messages/scheduled/:id", {
5467
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "scheduledMessages.create").annotate(OpenApi.Summary, "Schedule a message").annotate(OpenApi.Description, "Schedules a message at the absolute ISO-8601 instant in scheduledFor. Optional timezone is validated IANA display metadata only and never changes the execution instant."), HttpApiEndpoint.get("scheduledMessagesGet", "/v1/messages/scheduled/:id", {
5221
5468
  params: ScheduledMessagesGetPathParams,
5222
5469
  success: ScheduledMessagesGet200,
5223
5470
  error: [
@@ -5324,6 +5571,187 @@ var OrganizationsGroup = class extends HttpApiGroup.make("Organizations").add(Ht
5324
5571
  OrganizationsGetUsage500
5325
5572
  ]
5326
5573
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "organizations.getUsage").annotate(OpenApi.Summary, "Get organization usage").annotate(OpenApi.Description, "Returns usage statistics for the current organization over the selected reporting period.")).annotate(OpenApi.Description, "Organization management and usage statistics") {};
5574
+ var TemplateDocumentsGroup = class extends HttpApiGroup.make("Template Documents").add(HttpApiEndpoint.get("templateDocumentsGet", "/v1/template-documents/:templateId", {
5575
+ params: TemplateDocumentsGetPathParams,
5576
+ success: TemplateDocumentsGet200,
5577
+ error: [
5578
+ TemplateDocumentsGet401.pipe(HttpApiSchema.status(401)),
5579
+ TemplateDocumentsGet403.pipe(HttpApiSchema.status(403)),
5580
+ TemplateDocumentsGet404.pipe(HttpApiSchema.status(404)),
5581
+ TemplateDocumentsGet409.pipe(HttpApiSchema.status(409)),
5582
+ TemplateDocumentsGet422.pipe(HttpApiSchema.status(422)),
5583
+ TemplateDocumentsGet500
5584
+ ]
5585
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.get").annotate(OpenApi.Summary, "Get a template document").annotate(OpenApi.Description, "Returns the current authoritative source, revision, and metadata for a template document."), HttpApiEndpoint.post("templateDocumentsIssueAgentAdmission", "/v1/template-documents/:templateId/agent-admission", {
5586
+ params: TemplateDocumentsIssueAgentAdmissionPathParams,
5587
+ payload: TemplateDocumentsIssueAgentAdmissionRequestJson,
5588
+ success: TemplateDocumentsIssueAgentAdmission200,
5589
+ error: [
5590
+ TemplateDocumentsIssueAgentAdmission401.pipe(HttpApiSchema.status(401)),
5591
+ TemplateDocumentsIssueAgentAdmission403.pipe(HttpApiSchema.status(403)),
5592
+ TemplateDocumentsIssueAgentAdmission404.pipe(HttpApiSchema.status(404)),
5593
+ TemplateDocumentsIssueAgentAdmission409.pipe(HttpApiSchema.status(409)),
5594
+ TemplateDocumentsIssueAgentAdmission422.pipe(HttpApiSchema.status(422)),
5595
+ TemplateDocumentsIssueAgentAdmission500
5596
+ ]
5597
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.issueAgentAdmission").annotate(OpenApi.Summary, "Issue an agent admission").annotate(OpenApi.Description, "Authorizes a bounded template-agent operation against the current document and returns the admission context."), HttpApiEndpoint.post("templateDocumentsCompleteAgentConversationClear", "/v1/template-documents/:templateId/agent-conversation/clear-completion", {
5598
+ params: TemplateDocumentsCompleteAgentConversationClearPathParams,
5599
+ payload: TemplateDocumentsCompleteAgentConversationClearRequestJson,
5600
+ success: HttpApiSchema.Empty(200),
5601
+ error: [
5602
+ TemplateDocumentsCompleteAgentConversationClear401.pipe(HttpApiSchema.status(401)),
5603
+ TemplateDocumentsCompleteAgentConversationClear403.pipe(HttpApiSchema.status(403)),
5604
+ TemplateDocumentsCompleteAgentConversationClear404.pipe(HttpApiSchema.status(404)),
5605
+ TemplateDocumentsCompleteAgentConversationClear409.pipe(HttpApiSchema.status(409)),
5606
+ TemplateDocumentsCompleteAgentConversationClear500
5607
+ ]
5608
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.completeAgentConversationClear").annotate(OpenApi.Summary, "Complete an agent conversation clear").annotate(OpenApi.Description, "Records completion of an admitted agent conversation-clear operation for the template document."), HttpApiEndpoint.post("templateDocumentsApplyAgentProposal", "/v1/template-documents/:templateId/agent-proposals/apply", {
5609
+ params: TemplateDocumentsApplyAgentProposalPathParams,
5610
+ payload: TemplateDocumentsApplyAgentProposalRequestJson,
5611
+ success: TemplateDocumentsApplyAgentProposal200,
5612
+ error: [
5613
+ TemplateDocumentsApplyAgentProposal401.pipe(HttpApiSchema.status(401)),
5614
+ TemplateDocumentsApplyAgentProposal403.pipe(HttpApiSchema.status(403)),
5615
+ TemplateDocumentsApplyAgentProposal404.pipe(HttpApiSchema.status(404)),
5616
+ TemplateDocumentsApplyAgentProposal409.pipe(HttpApiSchema.status(409)),
5617
+ TemplateDocumentsApplyAgentProposal422.pipe(HttpApiSchema.status(422)),
5618
+ TemplateDocumentsApplyAgentProposal500
5619
+ ]
5620
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.applyAgentProposal").annotate(OpenApi.Summary, "Apply an agent proposal").annotate(OpenApi.Description, "Applies an admitted agent-authored source proposal when its revision and source digest still match the document."), HttpApiEndpoint.post("templateDocumentsPublish", "/v1/template-documents/:templateId/publish", {
5621
+ params: TemplateDocumentsPublishPathParams,
5622
+ success: TemplateDocumentsPublish200,
5623
+ error: [
5624
+ TemplateDocumentsPublish401.pipe(HttpApiSchema.status(401)),
5625
+ TemplateDocumentsPublish403.pipe(HttpApiSchema.status(403)),
5626
+ TemplateDocumentsPublish404.pipe(HttpApiSchema.status(404)),
5627
+ TemplateDocumentsPublish409.pipe(HttpApiSchema.status(409)),
5628
+ TemplateDocumentsPublish422.pipe(HttpApiSchema.status(422)),
5629
+ TemplateDocumentsPublish500
5630
+ ]
5631
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.publish").annotate(OpenApi.Summary, "Publish a template document").annotate(OpenApi.Description, "Publishes the current saved template source version and returns its lifecycle receipt."), HttpApiEndpoint.post("templateDocumentsRender", "/v1/template-documents/:templateId/render", {
5632
+ params: TemplateDocumentsRenderPathParams,
5633
+ payload: TemplateDocumentsRenderRequestJson,
5634
+ success: TemplateDocumentsRender200,
5635
+ error: [
5636
+ TemplateDocumentsRender401.pipe(HttpApiSchema.status(401)),
5637
+ TemplateDocumentsRender403.pipe(HttpApiSchema.status(403)),
5638
+ TemplateDocumentsRender404.pipe(HttpApiSchema.status(404)),
5639
+ TemplateDocumentsRender409.pipe(HttpApiSchema.status(409)),
5640
+ TemplateDocumentsRender422.pipe(HttpApiSchema.status(422)),
5641
+ TemplateDocumentsRender500
5642
+ ]
5643
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.render").annotate(OpenApi.Summary, "Render a template document").annotate(OpenApi.Description, "Renders the specified document revision with optional variables and reports any missing variables."), HttpApiEndpoint.post("templateDocumentsSave", "/v1/template-documents/:templateId/save", {
5644
+ params: TemplateDocumentsSavePathParams,
5645
+ payload: TemplateDocumentsSaveRequestJson,
5646
+ success: TemplateDocumentsSave200,
5647
+ error: [
5648
+ TemplateDocumentsSave401.pipe(HttpApiSchema.status(401)),
5649
+ TemplateDocumentsSave403.pipe(HttpApiSchema.status(403)),
5650
+ TemplateDocumentsSave404.pipe(HttpApiSchema.status(404)),
5651
+ TemplateDocumentsSave409.pipe(HttpApiSchema.status(409)),
5652
+ TemplateDocumentsSave422.pipe(HttpApiSchema.status(422)),
5653
+ TemplateDocumentsSave500
5654
+ ]
5655
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.save").annotate(OpenApi.Summary, "Save a template document").annotate(OpenApi.Description, "Materializes the specified document revision as a durable template source version and returns its receipt."), HttpApiEndpoint.post("templateDocumentsSend", "/v1/template-documents/:templateId/send", {
5656
+ params: TemplateDocumentsSendPathParams,
5657
+ payload: TemplateDocumentsSendRequestJson,
5658
+ success: TemplateDocumentsSend200,
5659
+ error: [
5660
+ TemplateDocumentsSend401.pipe(HttpApiSchema.status(401)),
5661
+ TemplateDocumentsSend402.pipe(HttpApiSchema.status(402)),
5662
+ TemplateDocumentsSend403.pipe(HttpApiSchema.status(403)),
5663
+ TemplateDocumentsSend404.pipe(HttpApiSchema.status(404)),
5664
+ TemplateDocumentsSend409.pipe(HttpApiSchema.status(409)),
5665
+ TemplateDocumentsSend422.pipe(HttpApiSchema.status(422)),
5666
+ TemplateDocumentsSend429.pipe(HttpApiSchema.status(429)),
5667
+ TemplateDocumentsSend500,
5668
+ TemplateDocumentsSend502.pipe(HttpApiSchema.status(502))
5669
+ ]
5670
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.send").annotate(OpenApi.Summary, "Send a template document").annotate(OpenApi.Description, "Sends or schedules the specified document revision for one or more recipients with optional variables."), HttpApiEndpoint.post("templateDocumentsTestSend", "/v1/template-documents/:templateId/send-test", {
5671
+ params: TemplateDocumentsTestSendPathParams,
5672
+ payload: TemplateDocumentsTestSendRequestJson,
5673
+ success: TemplateDocumentsTestSend200,
5674
+ error: [
5675
+ TemplateDocumentsTestSend401.pipe(HttpApiSchema.status(401)),
5676
+ TemplateDocumentsTestSend402.pipe(HttpApiSchema.status(402)),
5677
+ TemplateDocumentsTestSend403.pipe(HttpApiSchema.status(403)),
5678
+ TemplateDocumentsTestSend404.pipe(HttpApiSchema.status(404)),
5679
+ TemplateDocumentsTestSend409.pipe(HttpApiSchema.status(409)),
5680
+ TemplateDocumentsTestSend422.pipe(HttpApiSchema.status(422)),
5681
+ TemplateDocumentsTestSend429.pipe(HttpApiSchema.status(429)),
5682
+ TemplateDocumentsTestSend500,
5683
+ TemplateDocumentsTestSend502.pipe(HttpApiSchema.status(502))
5684
+ ]
5685
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.testSend").annotate(OpenApi.Summary, "Send a template test").annotate(OpenApi.Description, "Renders the specified document revision and sends a test message to one recipient without publishing it."), HttpApiEndpoint.post("templateDocumentsReplace", "/v1/template-documents/:templateId/source", {
5686
+ params: TemplateDocumentsReplacePathParams,
5687
+ payload: TemplateDocumentsReplaceRequestJson,
5688
+ success: TemplateDocumentsReplace200,
5689
+ error: [
5690
+ TemplateDocumentsReplace401.pipe(HttpApiSchema.status(401)),
5691
+ TemplateDocumentsReplace403.pipe(HttpApiSchema.status(403)),
5692
+ TemplateDocumentsReplace404.pipe(HttpApiSchema.status(404)),
5693
+ TemplateDocumentsReplace409.pipe(HttpApiSchema.status(409)),
5694
+ TemplateDocumentsReplace422.pipe(HttpApiSchema.status(422)),
5695
+ TemplateDocumentsReplace500
5696
+ ]
5697
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.replace").annotate(OpenApi.Summary, "Replace template source").annotate(OpenApi.Description, "Replaces the editable SML source when the expected revision matches and returns the updated document snapshot."), HttpApiEndpoint.post("templateDocumentsSpamCheck", "/v1/template-documents/:templateId/spam-check", {
5698
+ params: TemplateDocumentsSpamCheckPathParams,
5699
+ payload: TemplateDocumentsSpamCheckRequestJson,
5700
+ success: TemplateDocumentsSpamCheck200,
5701
+ error: [
5702
+ TemplateDocumentsSpamCheck401.pipe(HttpApiSchema.status(401)),
5703
+ TemplateDocumentsSpamCheck403.pipe(HttpApiSchema.status(403)),
5704
+ TemplateDocumentsSpamCheck404.pipe(HttpApiSchema.status(404)),
5705
+ TemplateDocumentsSpamCheck409.pipe(HttpApiSchema.status(409)),
5706
+ TemplateDocumentsSpamCheck422.pipe(HttpApiSchema.status(422)),
5707
+ TemplateDocumentsSpamCheck500
5708
+ ]
5709
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.spamCheck").annotate(OpenApi.Summary, "Check a template document for spam").annotate(OpenApi.Description, "Renders and analyzes the specified document revision for spam risks, returning issues and recommendations."), HttpApiEndpoint.post("templateDocumentsUnpublish", "/v1/template-documents/:templateId/unpublish", {
5710
+ params: TemplateDocumentsUnpublishPathParams,
5711
+ success: TemplateDocumentsUnpublish200,
5712
+ error: [
5713
+ TemplateDocumentsUnpublish401.pipe(HttpApiSchema.status(401)),
5714
+ TemplateDocumentsUnpublish403.pipe(HttpApiSchema.status(403)),
5715
+ TemplateDocumentsUnpublish404.pipe(HttpApiSchema.status(404)),
5716
+ TemplateDocumentsUnpublish409.pipe(HttpApiSchema.status(409)),
5717
+ TemplateDocumentsUnpublish422.pipe(HttpApiSchema.status(422)),
5718
+ TemplateDocumentsUnpublish500
5719
+ ]
5720
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.unpublish").annotate(OpenApi.Summary, "Unpublish a template document").annotate(OpenApi.Description, "Unpublishes the current template source version and returns its lifecycle receipt."), HttpApiEndpoint.get("templateDocumentsVersions", "/v1/template-documents/:templateId/versions", {
5721
+ params: TemplateDocumentsVersionsPathParams,
5722
+ success: TemplateDocumentsVersions200,
5723
+ error: [
5724
+ TemplateDocumentsVersions401.pipe(HttpApiSchema.status(401)),
5725
+ TemplateDocumentsVersions403.pipe(HttpApiSchema.status(403)),
5726
+ TemplateDocumentsVersions404.pipe(HttpApiSchema.status(404)),
5727
+ TemplateDocumentsVersions409.pipe(HttpApiSchema.status(409)),
5728
+ TemplateDocumentsVersions422.pipe(HttpApiSchema.status(422)),
5729
+ TemplateDocumentsVersions500
5730
+ ]
5731
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.versions").annotate(OpenApi.Summary, "List template document versions").annotate(OpenApi.Description, "Returns the saved source-version history for a template document."), HttpApiEndpoint.post("templateDocumentsRestore", "/v1/template-documents/:templateId/versions/:versionId/restore", {
5732
+ params: TemplateDocumentsRestorePathParams,
5733
+ payload: TemplateDocumentsRestoreRequestJson,
5734
+ success: TemplateDocumentsRestore200,
5735
+ error: [
5736
+ TemplateDocumentsRestore401.pipe(HttpApiSchema.status(401)),
5737
+ TemplateDocumentsRestore403.pipe(HttpApiSchema.status(403)),
5738
+ TemplateDocumentsRestore404.pipe(HttpApiSchema.status(404)),
5739
+ TemplateDocumentsRestore409.pipe(HttpApiSchema.status(409)),
5740
+ TemplateDocumentsRestore422.pipe(HttpApiSchema.status(422)),
5741
+ TemplateDocumentsRestore500
5742
+ ]
5743
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.restore").annotate(OpenApi.Summary, "Restore a template document version").annotate(OpenApi.Description, "Restores a saved source version into the editable document when the expected revision matches."), HttpApiEndpoint.post("templateDocumentsBootstrap", "/v1/template-documents/bootstrap", {
5744
+ payload: TemplateDocumentsBootstrapRequestJson,
5745
+ success: TemplateDocumentsBootstrap200,
5746
+ error: [
5747
+ TemplateDocumentsBootstrap401.pipe(HttpApiSchema.status(401)),
5748
+ TemplateDocumentsBootstrap403.pipe(HttpApiSchema.status(403)),
5749
+ TemplateDocumentsBootstrap404.pipe(HttpApiSchema.status(404)),
5750
+ TemplateDocumentsBootstrap409.pipe(HttpApiSchema.status(409)),
5751
+ TemplateDocumentsBootstrap422.pipe(HttpApiSchema.status(422)),
5752
+ TemplateDocumentsBootstrap500
5753
+ ]
5754
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templateDocuments.bootstrap").annotate(OpenApi.Summary, "Bootstrap a template document").annotate(OpenApi.Description, "Creates or loads the authoritative editable document for a template and returns its current snapshot.")).annotate(OpenApi.Description, "Authenticated document-authoritative template drafting and explicit Save") {};
5327
5755
  var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEndpoint.get("templatesList", "/v1/templates", {
5328
5756
  query: TemplatesListQuery,
5329
5757
  success: TemplatesList200,
@@ -5351,7 +5779,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5351
5779
  TemplatesGetById404.pipe(HttpApiSchema.status(404)),
5352
5780
  TemplatesGetById500
5353
5781
  ]
5354
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.getById").annotate(OpenApi.Summary, "Get a template").annotate(OpenApi.Description, "Returns a single template by ID, including its SML source and compiled channel content."), HttpApiEndpoint.delete("templatesRemove", "/v1/templates/:id", {
5782
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.getById").annotate(OpenApi.Summary, "Get a template").annotate(OpenApi.Description, "Returns template metadata and compiled channel content. Read live SML through the template-document API."), HttpApiEndpoint.delete("templatesRemove", "/v1/templates/:id", {
5355
5783
  params: TemplatesRemovePathParams,
5356
5784
  success: TemplatesRemove200,
5357
5785
  error: [
@@ -5372,7 +5800,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5372
5800
  TemplatesUpdate422.pipe(HttpApiSchema.status(422)),
5373
5801
  TemplatesUpdate500
5374
5802
  ]
5375
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.update").annotate(OpenApi.Summary, "Update a template").annotate(OpenApi.Description, "Updates a template's metadata or SML source; a new source's root tag must match the template's existing channel. Returns the updated template."), HttpApiEndpoint.post("templatesApprove", "/v1/templates/:id/approve", {
5803
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.update").annotate(OpenApi.Summary, "Update a template").annotate(OpenApi.Description, "Updates template metadata. Source changes use the template-document revision API."), HttpApiEndpoint.post("templatesApprove", "/v1/templates/:id/approve", {
5376
5804
  params: TemplatesApprovePathParams,
5377
5805
  payload: TemplatesApproveRequestJson,
5378
5806
  success: TemplatesApprove200,
@@ -5382,68 +5810,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5382
5810
  TemplatesApprove404.pipe(HttpApiSchema.status(404)),
5383
5811
  TemplatesApprove500
5384
5812
  ]
5385
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.approve").annotate(OpenApi.Summary, "Approve a template").annotate(OpenApi.Description, "Records compliance approval for a template with optional notes and moves its status to approved unless it is already published or archived."), HttpApiEndpoint.post("templatesDuplicate", "/v1/templates/:id/duplicate", {
5386
- params: TemplatesDuplicatePathParams,
5387
- success: TemplatesDuplicate201.pipe(HttpApiSchema.status(201)),
5388
- error: [
5389
- TemplatesDuplicate401.pipe(HttpApiSchema.status(401)),
5390
- TemplatesDuplicate403.pipe(HttpApiSchema.status(403)),
5391
- TemplatesDuplicate404.pipe(HttpApiSchema.status(404)),
5392
- TemplatesDuplicate409.pipe(HttpApiSchema.status(409)),
5393
- TemplatesDuplicate500
5394
- ]
5395
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.duplicate").annotate(OpenApi.Summary, "Duplicate a template").annotate(OpenApi.Description, "Creates a copy of the template as a new draft template with a fresh slug. Returns the new template with status 201."), HttpApiEndpoint.post("templatesPublish", "/v1/templates/:id/publish", {
5396
- params: TemplatesPublishPathParams,
5397
- success: TemplatesPublish200,
5398
- error: [
5399
- TemplatesPublish401.pipe(HttpApiSchema.status(401)),
5400
- TemplatesPublish403.pipe(HttpApiSchema.status(403)),
5401
- TemplatesPublish404.pipe(HttpApiSchema.status(404)),
5402
- TemplatesPublish409.pipe(HttpApiSchema.status(409)),
5403
- TemplatesPublish422.pipe(HttpApiSchema.status(422)),
5404
- TemplatesPublish500
5405
- ]
5406
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.publish").annotate(OpenApi.Summary, "Publish a template").annotate(OpenApi.Description, "Compiles the template's current source and creates a new published version snapshot, recording the publisher. Returns the updated template."), HttpApiEndpoint.post("templatesRender", "/v1/templates/:id/render", {
5407
- params: TemplatesRenderPathParams,
5408
- payload: TemplatesRenderRequestJson,
5409
- success: TemplatesRender200,
5410
- error: [
5411
- TemplatesRender401.pipe(HttpApiSchema.status(401)),
5412
- TemplatesRender403.pipe(HttpApiSchema.status(403)),
5413
- TemplatesRender404.pipe(HttpApiSchema.status(404)),
5414
- TemplatesRender422.pipe(HttpApiSchema.status(422)),
5415
- TemplatesRender500
5416
- ]
5417
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.render").annotate(OpenApi.Summary, "Render a template").annotate(OpenApi.Description, "Renders a template with the provided variables and returns a channel-specific preview, along with any missing variables and errors. No message is sent."), HttpApiEndpoint.post("templatesUnpublish", "/v1/templates/:id/unpublish", {
5418
- params: TemplatesUnpublishPathParams,
5419
- success: TemplatesUnpublish200,
5420
- error: [
5421
- TemplatesUnpublish401.pipe(HttpApiSchema.status(401)),
5422
- TemplatesUnpublish403.pipe(HttpApiSchema.status(403)),
5423
- TemplatesUnpublish404.pipe(HttpApiSchema.status(404)),
5424
- TemplatesUnpublish422.pipe(HttpApiSchema.status(422)),
5425
- TemplatesUnpublish500
5426
- ]
5427
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.unpublish").annotate(OpenApi.Summary, "Unpublish a template").annotate(OpenApi.Description, "Reverts a published template by creating a new draft version from its current source. Returns the updated template."), HttpApiEndpoint.get("templatesVersionHistory", "/v1/templates/:id/versions", {
5428
- params: TemplatesVersionHistoryPathParams,
5429
- success: TemplatesVersionHistory200,
5430
- error: [
5431
- TemplatesVersionHistory401.pipe(HttpApiSchema.status(401)),
5432
- TemplatesVersionHistory403.pipe(HttpApiSchema.status(403)),
5433
- TemplatesVersionHistory404.pipe(HttpApiSchema.status(404)),
5434
- TemplatesVersionHistory500
5435
- ]
5436
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.versionHistory").annotate(OpenApi.Summary, "List template versions").annotate(OpenApi.Description, "Returns the template's version history, listing each source version with its status and publish metadata."), HttpApiEndpoint.post("templatesRestoreVersion", "/v1/templates/:id/versions/:versionId/restore", {
5437
- params: TemplatesRestoreVersionPathParams,
5438
- success: TemplatesRestoreVersion200,
5439
- error: [
5440
- TemplatesRestoreVersion401.pipe(HttpApiSchema.status(401)),
5441
- TemplatesRestoreVersion403.pipe(HttpApiSchema.status(403)),
5442
- TemplatesRestoreVersion404.pipe(HttpApiSchema.status(404)),
5443
- TemplatesRestoreVersion409.pipe(HttpApiSchema.status(409)),
5444
- TemplatesRestoreVersion500
5445
- ]
5446
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.restoreVersion").annotate(OpenApi.Summary, "Restore a template version").annotate(OpenApi.Description, "Recompiles an older version's source and restores it as a new draft version. Fails if the source no longer compiles or its channel differs."), HttpApiEndpoint.get("templatesListDashboard", "/v1/templates/dashboard", {
5813
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.approve").annotate(OpenApi.Summary, "Approve a template").annotate(OpenApi.Description, "Records compliance approval for a template with optional notes and moves its status to approved unless it is already published or archived."), HttpApiEndpoint.get("templatesListDashboard", "/v1/templates/dashboard", {
5447
5814
  query: TemplatesListDashboardQuery,
5448
5815
  success: TemplatesListDashboard200,
5449
5816
  error: [
@@ -5451,7 +5818,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5451
5818
  TemplatesListDashboard403.pipe(HttpApiSchema.status(403)),
5452
5819
  TemplatesListDashboard500
5453
5820
  ]
5454
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.listDashboard"), HttpApiEndpoint.get("templatesListFamilies", "/v1/templates/families", {
5821
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.listDashboard").annotate(OpenApi.Summary, "List templates for the dashboard").annotate(OpenApi.Description, "Returns a paginated dashboard view that groups related channel templates into families and leaves standalone templates ungrouped."), HttpApiEndpoint.get("templatesListFamilies", "/v1/templates/families", {
5455
5822
  query: TemplatesListFamiliesQuery,
5456
5823
  success: TemplatesListFamilies200,
5457
5824
  error: [
@@ -5459,7 +5826,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5459
5826
  TemplatesListFamilies403.pipe(HttpApiSchema.status(403)),
5460
5827
  TemplatesListFamilies500
5461
5828
  ]
5462
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.listFamilies"), HttpApiEndpoint.post("templatesCreateFamily", "/v1/templates/families", {
5829
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.listFamilies").annotate(OpenApi.Summary, "List template families").annotate(OpenApi.Description, "Returns a paginated list of the organization's template families and members."), HttpApiEndpoint.post("templatesCreateFamily", "/v1/templates/families", {
5463
5830
  payload: TemplatesCreateFamilyRequestJson,
5464
5831
  success: TemplatesCreateFamily201.pipe(HttpApiSchema.status(201)),
5465
5832
  error: [
@@ -5468,7 +5835,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5468
5835
  TemplatesCreateFamily422.pipe(HttpApiSchema.status(422)),
5469
5836
  TemplatesCreateFamily500
5470
5837
  ]
5471
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.createFamily"), HttpApiEndpoint.get("templatesGetFamily", "/v1/templates/families/:familyId", {
5838
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.createFamily").annotate(OpenApi.Summary, "Create a template family").annotate(OpenApi.Description, "Creates an empty template family with the supplied name and returns it with status 201."), HttpApiEndpoint.get("templatesGetFamily", "/v1/templates/families/:familyId", {
5472
5839
  params: TemplatesGetFamilyPathParams,
5473
5840
  success: TemplatesGetFamily200,
5474
5841
  error: [
@@ -5477,7 +5844,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5477
5844
  TemplatesGetFamily404.pipe(HttpApiSchema.status(404)),
5478
5845
  TemplatesGetFamily500
5479
5846
  ]
5480
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.getFamily"), HttpApiEndpoint.delete("templatesDeleteFamily", "/v1/templates/families/:familyId", {
5847
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.getFamily").annotate(OpenApi.Summary, "Get a template family").annotate(OpenApi.Description, "Returns a template family and its channel-specific member templates."), HttpApiEndpoint.delete("templatesDeleteFamily", "/v1/templates/families/:familyId", {
5481
5848
  params: TemplatesDeleteFamilyPathParams,
5482
5849
  success: TemplatesDeleteFamily200,
5483
5850
  error: [
@@ -5486,7 +5853,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5486
5853
  TemplatesDeleteFamily404.pipe(HttpApiSchema.status(404)),
5487
5854
  TemplatesDeleteFamily500
5488
5855
  ]
5489
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.deleteFamily"), HttpApiEndpoint.patch("templatesRenameFamily", "/v1/templates/families/:familyId", {
5856
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.deleteFamily").annotate(OpenApi.Summary, "Delete a template family").annotate(OpenApi.Description, "Deletes a template family without deleting its member templates."), HttpApiEndpoint.patch("templatesRenameFamily", "/v1/templates/families/:familyId", {
5490
5857
  params: TemplatesRenameFamilyPathParams,
5491
5858
  payload: TemplatesRenameFamilyRequestJson,
5492
5859
  success: TemplatesRenameFamily200,
@@ -5497,7 +5864,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5497
5864
  TemplatesRenameFamily422.pipe(HttpApiSchema.status(422)),
5498
5865
  TemplatesRenameFamily500
5499
5866
  ]
5500
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.renameFamily"), HttpApiEndpoint.post("templatesAddFamilyChannel", "/v1/templates/families/:familyId/channels/:channel", {
5867
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.renameFamily").annotate(OpenApi.Summary, "Rename a template family").annotate(OpenApi.Description, "Changes a template family's name and returns the updated family."), HttpApiEndpoint.post("templatesAddFamilyChannel", "/v1/templates/families/:familyId/channels/:channel", {
5501
5868
  params: TemplatesAddFamilyChannelPathParams,
5502
5869
  success: TemplatesAddFamilyChannel201.pipe(HttpApiSchema.status(201)),
5503
5870
  error: [
@@ -5508,7 +5875,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5508
5875
  TemplatesAddFamilyChannel422.pipe(HttpApiSchema.status(422)),
5509
5876
  TemplatesAddFamilyChannel500
5510
5877
  ]
5511
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.addFamilyChannel"), HttpApiEndpoint.post("templatesAttachFamilyMember", "/v1/templates/families/:familyId/members/:templateId", {
5878
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.addFamilyChannel").annotate(OpenApi.Summary, "Add a channel to a template family").annotate(OpenApi.Description, "Creates a template for the requested channel in the family and returns the updated family with status 201."), HttpApiEndpoint.post("templatesAttachFamilyMember", "/v1/templates/families/:familyId/members/:templateId", {
5512
5879
  params: TemplatesAttachFamilyMemberPathParams,
5513
5880
  success: TemplatesAttachFamilyMember200,
5514
5881
  error: [
@@ -5519,7 +5886,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5519
5886
  TemplatesAttachFamilyMember422.pipe(HttpApiSchema.status(422)),
5520
5887
  TemplatesAttachFamilyMember500
5521
5888
  ]
5522
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.attachFamilyMember"), HttpApiEndpoint.delete("templatesDetachFamilyMember", "/v1/templates/families/:familyId/members/:templateId", {
5889
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.attachFamilyMember").annotate(OpenApi.Summary, "Attach a template to a family").annotate(OpenApi.Description, "Adds an existing template as a channel member of the family and returns the updated family."), HttpApiEndpoint.delete("templatesDetachFamilyMember", "/v1/templates/families/:familyId/members/:templateId", {
5523
5890
  params: TemplatesDetachFamilyMemberPathParams,
5524
5891
  success: TemplatesDetachFamilyMember200,
5525
5892
  error: [
@@ -5529,7 +5896,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5529
5896
  TemplatesDetachFamilyMember409.pipe(HttpApiSchema.status(409)),
5530
5897
  TemplatesDetachFamilyMember500
5531
5898
  ]
5532
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.detachFamilyMember"), HttpApiEndpoint.post("templatesCreateFamilyFromTemplate", "/v1/templates/families/from-template/:templateId", {
5899
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.detachFamilyMember").annotate(OpenApi.Summary, "Detach a template from a family").annotate(OpenApi.Description, "Removes a member template from the family without deleting the template."), HttpApiEndpoint.post("templatesCreateFamilyFromTemplate", "/v1/templates/families/from-template/:templateId", {
5533
5900
  params: TemplatesCreateFamilyFromTemplatePathParams,
5534
5901
  payload: TemplatesCreateFamilyFromTemplateRequestJson,
5535
5902
  success: TemplatesCreateFamilyFromTemplate201.pipe(HttpApiSchema.status(201)),
@@ -5541,17 +5908,7 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
5541
5908
  TemplatesCreateFamilyFromTemplate422.pipe(HttpApiSchema.status(422)),
5542
5909
  TemplatesCreateFamilyFromTemplate500
5543
5910
  ]
5544
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.createFamilyFromTemplate"), HttpApiEndpoint.post("templatesSpamCheck", "/v1/templates/spam-check", {
5545
- payload: TemplatesSpamCheckRequestJson,
5546
- success: TemplatesSpamCheck200,
5547
- error: [
5548
- TemplatesSpamCheck401.pipe(HttpApiSchema.status(401)),
5549
- TemplatesSpamCheck403.pipe(HttpApiSchema.status(403)),
5550
- TemplatesSpamCheck404.pipe(HttpApiSchema.status(404)),
5551
- TemplatesSpamCheck422.pipe(HttpApiSchema.status(422)),
5552
- TemplatesSpamCheck500
5553
- ]
5554
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.spamCheck").annotate(OpenApi.Summary, "Spam-check a template or email content").annotate(OpenApi.Description, "Scores email content for spam risk, from either a stored email template or raw subject, HTML, and text. Returns a score, severity, issues, and recommendations.")).annotate(OpenApi.Description, "Single-channel SML template management, rendering, and compliance — the channel derives from the source's root tag") {};
5911
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.createFamilyFromTemplate").annotate(OpenApi.Summary, "Create a family from a template").annotate(OpenApi.Description, "Creates a template family containing the specified template and returns the new family with status 201.")).annotate(OpenApi.Description, "Samva API operation.") {};
5555
5912
  var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpoint.get("webhooksList", "/v1/webhooks", {
5556
5913
  query: WebhooksListQuery,
5557
5914
  success: WebhooksList200,
@@ -5568,6 +5925,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
5568
5925
  WebhooksCreate402.pipe(HttpApiSchema.status(402)),
5569
5926
  WebhooksCreate403.pipe(HttpApiSchema.status(403)),
5570
5927
  WebhooksCreate409.pipe(HttpApiSchema.status(409)),
5928
+ WebhooksCreate422.pipe(HttpApiSchema.status(422)),
5571
5929
  WebhooksCreate500,
5572
5930
  WebhooksCreate502.pipe(HttpApiSchema.status(502))
5573
5931
  ]
@@ -5599,6 +5957,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
5599
5957
  WebhooksUpdate403.pipe(HttpApiSchema.status(403)),
5600
5958
  WebhooksUpdate404.pipe(HttpApiSchema.status(404)),
5601
5959
  WebhooksUpdate409.pipe(HttpApiSchema.status(409)),
5960
+ WebhooksUpdate422.pipe(HttpApiSchema.status(422)),
5602
5961
  WebhooksUpdate500
5603
5962
  ]
5604
5963
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.update").annotate(OpenApi.Summary, "Update a webhook").annotate(OpenApi.Description, "Updates a webhook's name, URL, subscribed events, channels, custom headers, or status and returns the updated endpoint."), HttpApiEndpoint.post("webhooksTest", "/v1/webhooks/:id/test", {
@@ -5651,7 +6010,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
5651
6010
  WebhooksGetStats500
5652
6011
  ]
5653
6012
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.getStats").annotate(OpenApi.Summary, "Get webhook delivery statistics").annotate(OpenApi.Description, "Returns aggregate pending, delivered, exhausted, and cancelled delivery counts for a webhook endpoint.")).annotate(OpenApi.Description, "Customer event webhook management, testing, and delivery logs") {};
5654
- var SamvaApi = class extends HttpApi.make("SamvaApi").annotate(OpenApi.Title, "Samva SDK").annotate(OpenApi.Version, "1.0.0").annotate(OpenApi.Description, "Samva CPaaS API for programmatic messaging").add(APIKeysGroup, CampaignsGroup, ContactsGroup, ConversationsGroup, DesignGroup, EmailGroup, MessagesGroup, ScheduledMessagesGroup, OperationsGroup, OrganizationsGroup, TemplatesGroup, WebhooksGroup) {};
6013
+ var SamvaApi = class extends HttpApi.make("SamvaApi").annotate(OpenApi.Title, "Samva SDK").annotate(OpenApi.Version, "1.0.0").annotate(OpenApi.Description, "Samva email API for programmatic email delivery").add(APIKeysGroup, CampaignsGroup, ContactsGroup, ConversationsGroup, DesignGroup, EmailGroup, MediaGroup, MessagesGroup, ScheduledMessagesGroup, OperationsGroup, OrganizationsGroup, TemplateDocumentsGroup, TemplatesGroup, WebhooksGroup) {};
5655
6014
  //#endregion
5656
6015
  //#region src/effect/internal/client.ts
5657
6016
  const DEFAULT_BASE_URL = "https://api.samva.dev";
@@ -5685,4 +6044,4 @@ const raw = Effect.map(Service, (client) => client.raw);
5685
6044
  //#endregion
5686
6045
  export { ValidationError as C, UpdateWebhookPayload as S, SamvaApi as _, BillingProviderError as a, UnauthorizedError as b, CreateWebhookPayload as c, FlagDisabledError as d, ForbiddenError as f, ResourceNotFoundError as g, RateLimitedError as h, raw as i, EmailChannelError as l, PaymentRequiredError as m, layer as n, ConflictError as o, InternalError as p, layerFetch as r, CreateTemplatePayload as s, Service as t, ExternalServiceError as u, TestWebhookPayload as v, WebhookEnqueueError as w, UpdateTemplatePayload as x, TrackingRecipientEmail as y };
5687
6046
 
5688
- //# sourceMappingURL=client-DVALvDUe.js.map
6047
+ //# sourceMappingURL=client-BOghX8fr.js.map