samva 0.26.0 → 0.28.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 (107) hide show
  1. package/AGENTS.md +7 -0
  2. package/README.md +14 -7
  3. package/dist/client/sdk.gen.d.ts +322 -143
  4. package/dist/client/sdk.gen.js +1085 -332
  5. package/dist/client/types.gen.d.ts +1342 -479
  6. package/dist/effect/agents.d.ts +119 -0
  7. package/dist/effect/agents.js +29 -0
  8. package/dist/effect/analytics.d.ts +1 -1
  9. package/dist/effect/analytics.js +1 -1
  10. package/dist/effect/api-keys.d.ts +6 -6
  11. package/dist/effect/attachments.d.ts +1 -1
  12. package/dist/effect/brands.d.ts +2 -0
  13. package/dist/effect/campaigns.d.ts +275 -25
  14. package/dist/effect/campaigns.js +7 -1
  15. package/dist/effect/contact-groups.d.ts +9 -9
  16. package/dist/effect/contacts.d.ts +74 -81
  17. package/dist/effect/contacts.js +7 -3
  18. package/dist/effect/conversations.d.ts +14 -6
  19. package/dist/effect/email.d.ts +34 -34
  20. package/dist/effect/errors.d.ts +1 -1
  21. package/dist/effect/errors.js +2 -2
  22. package/dist/effect/extension-installations.d.ts +3 -3
  23. package/dist/effect/extensions.d.ts +6 -6
  24. package/dist/effect/generated/agents.d.ts +6 -28
  25. package/dist/effect/generated/agents.js +270 -0
  26. package/dist/effect/generated/analytics.d.ts +3 -3
  27. package/dist/effect/generated/analytics.js +1 -1
  28. package/dist/effect/generated/api-keys.d.ts +6 -6
  29. package/dist/effect/generated/api-keys.js +2 -2
  30. package/dist/effect/generated/attachments.d.ts +3 -3
  31. package/dist/effect/generated/attachments.js +1 -1
  32. package/dist/effect/generated/brands.d.ts +16 -0
  33. package/dist/effect/generated/campaigns.d.ts +1181 -302
  34. package/dist/effect/generated/campaigns.js +169 -36
  35. package/dist/effect/generated/contact-events.d.ts +3 -3
  36. package/dist/effect/generated/contact-events.js +1 -1
  37. package/dist/effect/generated/contact-groups.d.ts +9 -9
  38. package/dist/effect/generated/contact-groups.js +7 -7
  39. package/dist/effect/generated/contacts.d.ts +2063 -290
  40. package/dist/effect/generated/contacts.js +343 -75
  41. package/dist/effect/generated/conversations.d.ts +14 -6
  42. package/dist/effect/generated/conversations.js +6 -6
  43. package/dist/effect/generated/email.d.ts +55 -70
  44. package/dist/effect/generated/email.js +18 -21
  45. package/dist/effect/generated/extension-installations.d.ts +3 -3
  46. package/dist/effect/generated/extension-installations.js +1 -1
  47. package/dist/effect/generated/extensions.d.ts +6 -6
  48. package/dist/effect/generated/extensions.js +2 -2
  49. package/dist/effect/generated/index.d.ts +5 -3
  50. package/dist/effect/generated/journeys.d.ts +9 -9
  51. package/dist/effect/generated/journeys.js +3 -3
  52. package/dist/effect/generated/mailboxes.d.ts +466 -712
  53. package/dist/effect/generated/mailboxes.js +22 -14
  54. package/dist/effect/generated/messages.d.ts +53 -29
  55. package/dist/effect/generated/messages.js +9 -5
  56. package/dist/effect/generated/namespaces.d.ts +3 -3
  57. package/dist/effect/generated/namespaces.js +1 -1
  58. package/dist/effect/generated/operations.d.ts +3 -3
  59. package/dist/effect/generated/operations.js +1 -1
  60. package/dist/effect/generated/organizations.d.ts +0 -9
  61. package/dist/effect/generated/organizations.js +1 -4
  62. package/dist/effect/generated/scheduled-messages.d.ts +69 -20
  63. package/dist/effect/generated/scheduled-messages.js +22 -3
  64. package/dist/effect/generated/shared.d.ts +431 -177
  65. package/dist/effect/generated/shared.js +216 -108
  66. package/dist/effect/generated/subscriptions.d.ts +4 -7
  67. package/dist/effect/generated/subscriptions.js +3 -4
  68. package/dist/effect/generated/templates.d.ts +71 -407
  69. package/dist/effect/generated/templates.js +23 -23
  70. package/dist/effect/generated/topic-forms.d.ts +656 -0
  71. package/dist/effect/generated/topic-forms.js +145 -0
  72. package/dist/effect/generated/{unsubscribe-groups.d.ts → topics.d.ts} +640 -435
  73. package/dist/effect/generated/topics.js +267 -0
  74. package/dist/effect/generated/webhooks.d.ts +6 -6
  75. package/dist/effect/generated/webhooks.js +2 -2
  76. package/dist/effect/generated-metadata.d.ts +78 -24
  77. package/dist/effect/generated-metadata.js +61 -27
  78. package/dist/effect/index.d.ts +3 -1
  79. package/dist/effect/index.js +5 -3
  80. package/dist/effect/internal/operation.js +4 -3
  81. package/dist/effect/internal/send.d.ts +4 -4
  82. package/dist/effect/journeys.d.ts +119 -119
  83. package/dist/effect/mailboxes.d.ts +137 -121
  84. package/dist/effect/messages.d.ts +19 -11
  85. package/dist/effect/namespaces.d.ts +3 -3
  86. package/dist/effect/operations.d.ts +3 -3
  87. package/dist/effect/scheduled-messages.d.ts +6 -6
  88. package/dist/effect/subscriptions.d.ts +1 -2
  89. package/dist/effect/templates.d.ts +13 -13
  90. package/dist/effect/topic-forms.d.ts +30 -0
  91. package/dist/effect/topic-forms.js +21 -0
  92. package/dist/effect/topics.d.ts +94 -0
  93. package/dist/effect/topics.js +29 -0
  94. package/dist/effect/webhooks.d.ts +6 -6
  95. package/dist/index.js +2 -2
  96. package/dist/package.js +1 -1
  97. package/dist/promises/errors.gen.d.ts +65 -8
  98. package/dist/promises/errors.gen.js +139 -7
  99. package/dist/promises/index.d.ts +7 -3
  100. package/dist/promises/index.js +9 -5
  101. package/dist/promises/types.gen.d.ts +1 -1
  102. package/dist/service-map.d.ts +117 -23
  103. package/dist/service-map.js +71 -10
  104. package/package.json +17 -9
  105. package/dist/effect/generated/unsubscribe-groups.js +0 -284
  106. package/dist/effect/unsubscribe-groups.d.ts +0 -74
  107. package/dist/effect/unsubscribe-groups.js +0 -29
@@ -19,19 +19,34 @@ var GatewayTimeoutError = class extends Schema.TaggedError()("GatewayTimeoutErro
19
19
  message: Schema.String,
20
20
  retryAfterSeconds: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
21
21
  })) {};
22
- Schema.isMaxLength(120).annotate({ expected: "a value with a length of at most 120" });
22
+ const AgentName = /* @__PURE__ */ Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(120).annotate({ expected: "a string with at most 120 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^\\S[\\s\\S]*\\S$|^\\S$|^$", "u")).annotate({
23
+ expected: "a string matching the RegExp ^\\S[\\s\\S]*\\S$|^\\S$|^$",
24
+ identifier: "AgentName"
25
+ })).check(Schema.isMaxLength(120).annotate({ expected: "a value with a length of at most 120" }));
23
26
  const MailboxEndpointId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
24
27
  expected: "a string matching the RegExp ^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$",
25
28
  identifier: "MailboxEndpointId"
26
29
  })).pipe(Schema.brand("MailboxEndpointId"));
27
- Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z]{2,8}_[0-9a-z]{16}$", "u")).annotate({
30
+ const AgentIntegrationReference = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z]{2,8}_[0-9a-z]{16}$", "u")).annotate({
28
31
  expected: "a string matching the RegExp ^[a-z]{2,8}_[0-9a-z]{16}$",
29
32
  identifier: "AgentIntegrationReference"
30
- });
31
- Schema.isPattern(/* @__PURE__ */ new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d$", "u")).annotate({
33
+ }));
34
+ const AgentMode = /* @__PURE__ */ Schema.Union([Schema.Literal("live"), Schema.Literal("supervised")]).annotate({ identifier: "AgentMode" });
35
+ const AgentModel = /* @__PURE__ */ Schema.Union([Schema.Literal("standard"), Schema.Literal("max")]).annotate({ identifier: "AgentModel" });
36
+ const TimeZone = /* @__PURE__ */ Schema.String.annotate({ identifier: "TimeZone" });
37
+ const Weekday = /* @__PURE__ */ Schema.Union([
38
+ Schema.Literal("monday"),
39
+ Schema.Literal("tuesday"),
40
+ Schema.Literal("wednesday"),
41
+ Schema.Literal("thursday"),
42
+ Schema.Literal("friday"),
43
+ Schema.Literal("saturday"),
44
+ Schema.Literal("sunday")
45
+ ]).annotate({ identifier: "Weekday" });
46
+ const ClockTime = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d$", "u")).annotate({
32
47
  expected: "a string matching the RegExp ^(?:[01]\\d|2[0-3]):[0-5]\\d$",
33
48
  identifier: "ClockTime"
34
- });
49
+ }));
35
50
  var ResourceNotFoundError = class extends Schema.TaggedError()("ResourceNotFoundError", Schema.Struct({
36
51
  resource: Schema.String,
37
52
  id: Schema.String,
@@ -112,6 +127,10 @@ const BrandSocialLink = /* @__PURE__ */ Schema.Struct({
112
127
  label: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" })).check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })),
113
128
  url: Schema.String.check(Schema.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^https:\\/\\/[^\\s]+$", "u")).annotate({ expected: "a string matching the RegExp ^https:\\/\\/[^\\s]+$" })).check(Schema.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" }))
114
129
  }).annotate({ identifier: "BrandSocialLink" });
130
+ const CampaignId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^camp_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
131
+ expected: "a string matching the RegExp ^camp_[0-9a-hjkmnp-tv-z]{16,24}$",
132
+ identifier: "CampaignId"
133
+ })).pipe(Schema.brand("CampaignId"));
115
134
  const MediaId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^media_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
116
135
  expected: "a string matching the RegExp ^media_[0-9a-hjkmnp-tv-z]{16,24}$",
117
136
  identifier: "MediaId"
@@ -138,10 +157,10 @@ const RenderTimeZone = /* @__PURE__ */ Schema.String.check(Schema.isMaxCodePoint
138
157
  identifier: "RenderTimeZone"
139
158
  })).check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" }));
140
159
  const ReplyToAddresses = /* @__PURE__ */ Schema.Union([Schema.Union([Schema.Array(Schema.String), Schema.Null]), Schema.Null]).annotate({ identifier: "ReplyToAddresses" });
141
- const UnsubscribeId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^unsub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
160
+ const TopicId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^unsub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
142
161
  expected: "a string matching the RegExp ^unsub_[0-9a-hjkmnp-tv-z]{16,24}$",
143
- identifier: "UnsubscribeId"
144
- })).pipe(Schema.brand("UnsubscribeId"));
162
+ identifier: "TopicId"
163
+ })).pipe(Schema.brand("TopicId"));
145
164
  const EmailTrackingOverrideV1 = /* @__PURE__ */ Schema.Struct({
146
165
  opens: Schema.optionalKey(Schema.Boolean.annotate({ description: "Override open tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking." })),
147
166
  clicks: Schema.optionalKey(Schema.Boolean.annotate({ description: "Override click tracking for this send. Omit to inherit the organization default. A recipient tracking opt-out always disables tracking." }))
@@ -154,10 +173,15 @@ const EmailCustomHeaders = /* @__PURE__ */ Schema.Record(Schema.String, Schema.S
154
173
  expected: "a value with at most 11 entries",
155
174
  identifier: "EmailCustomHeaders"
156
175
  }));
176
+ const CampaignFrom = /* @__PURE__ */ Schema.Union([Schema.Struct({
177
+ email: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
178
+ name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
179
+ }), Schema.Null]).annotate({ identifier: "CampaignFrom" });
157
180
  const ConversationId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^conv_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
158
181
  expected: "a string matching the RegExp ^conv_[0-9a-hjkmnp-tv-z]{16,24}$",
159
182
  identifier: "ConversationId"
160
183
  })).pipe(Schema.brand("ConversationId"));
184
+ const CampaignContentMetadata = /* @__PURE__ */ Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]).annotate({ identifier: "CampaignContentMetadata" });
161
185
  const ContactId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^contact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
162
186
  expected: "a string matching the RegExp ^contact_[0-9a-hjkmnp-tv-z]{16,24}$",
163
187
  identifier: "ContactId"
@@ -166,6 +190,10 @@ const ContactGroupId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @
166
190
  expected: "a string matching the RegExp ^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$",
167
191
  identifier: "ContactGroupId"
168
192
  })).pipe(Schema.brand("ContactGroupId"));
193
+ const CampaignRunId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^crun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
194
+ expected: "a string matching the RegExp ^crun_[0-9a-hjkmnp-tv-z]{16,24}$",
195
+ identifier: "CampaignRunId"
196
+ })).pipe(Schema.brand("CampaignRunId"));
169
197
  const SendsSeries = /* @__PURE__ */ Schema.Array(Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" }))).annotate({
170
198
  description: "Daily email sends for the last 14 calendar days in the organization's own timezone, oldest first and zero-filled. Always fourteen entries; an entity that has never sent reports fourteen zeroes.",
171
199
  identifier: "SendsSeries"
@@ -193,6 +221,42 @@ var SenderNotReadyError = class extends Schema.TaggedError()("SenderNotReadyErro
193
221
  sender: Schema.String,
194
222
  retryAfterSeconds: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })), Schema.Null]))
195
223
  })) {};
224
+ var OnboardingReviewRequiredError = class extends Schema.TaggedError()("OnboardingReviewRequiredError", Schema.Struct({
225
+ message: Schema.String,
226
+ code: Schema.Union([
227
+ Schema.Literal("review_required"),
228
+ Schema.Literal("review_in_progress"),
229
+ Schema.Literal("information_required"),
230
+ Schema.Literal("review_rejected"),
231
+ Schema.Literal("identity_review_required"),
232
+ Schema.Literal("identity_review_rejected"),
233
+ Schema.Literal("identity_changed")
234
+ ]),
235
+ decision: Schema.Union([
236
+ Schema.Literal("undecided"),
237
+ Schema.Literal("approved"),
238
+ Schema.Literal("rejected")
239
+ ]),
240
+ stage: Schema.Union([
241
+ Schema.Literal("collecting"),
242
+ Schema.Literal("automated_review"),
243
+ Schema.Literal("manual_review"),
244
+ Schema.Literal("information_requested"),
245
+ Schema.Literal("complete")
246
+ ]),
247
+ nextAction: Schema.Union([
248
+ Schema.Literal("wait_for_review"),
249
+ Schema.Literal("provide_information"),
250
+ Schema.Literal("verify_sending_identity"),
251
+ Schema.Literal("reapply"),
252
+ Schema.Literal("contact_support")
253
+ ]),
254
+ identityId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
255
+ })) {};
256
+ var DeliveryUnavailableError = class extends Schema.TaggedError()("DeliveryUnavailableError", Schema.Struct({
257
+ message: Schema.String,
258
+ retryAfterSeconds: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
259
+ })) {};
196
260
  const ContactIdentityId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^cident_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
197
261
  expected: "a string matching the RegExp ^cident_[0-9a-hjkmnp-tv-z]{16,24}$",
198
262
  identifier: "ContactIdentityId"
@@ -335,19 +399,16 @@ const MailboxPolicyId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/*
335
399
  identifier: "MailboxPolicyId"
336
400
  })).pipe(Schema.brand("MailboxPolicyId"));
337
401
  const MailboxSendError = /* @__PURE__ */ Schema.Union([
338
- Schema.Struct({
339
- _tag: Schema.Literal("SenderNotReadyError"),
402
+ Schema.TaggedStruct("SenderNotReadyError", {
340
403
  message: Schema.String,
341
404
  sender: Schema.String,
342
405
  retryAfterSeconds: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })), Schema.Null]))
343
406
  }),
344
- Schema.Struct({
345
- _tag: Schema.Literal("RateLimitedError"),
407
+ Schema.TaggedStruct("RateLimitedError", {
346
408
  message: Schema.String,
347
409
  retryAfterSeconds: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
348
410
  }),
349
- Schema.Struct({
350
- _tag: Schema.Literal("OnboardingReviewRequiredError"),
411
+ Schema.TaggedStruct("OnboardingReviewRequiredError", {
351
412
  message: Schema.String,
352
413
  code: Schema.Union([
353
414
  Schema.Literal("review_required"),
@@ -379,61 +440,23 @@ const MailboxSendError = /* @__PURE__ */ Schema.Union([
379
440
  ]),
380
441
  identityId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
381
442
  }),
382
- Schema.Struct({
383
- _tag: Schema.Literal("PaymentRequiredError"),
443
+ Schema.TaggedStruct("PaymentRequiredError", {
384
444
  message: Schema.String,
385
445
  resource: Schema.String,
386
446
  currentUsage: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
387
447
  limit: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
388
448
  }),
389
- Schema.Struct({
390
- _tag: Schema.Literal("ValidationError"),
449
+ Schema.TaggedStruct("ValidationError", {
391
450
  message: Schema.String,
392
451
  fields: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.Array(Schema.String)), Schema.Null]))
393
452
  }),
394
- Schema.Struct({
395
- _tag: Schema.Literal("ForbiddenError"),
396
- message: Schema.String
397
- }),
398
- Schema.Struct({
399
- _tag: Schema.Literal("ResourceNotFoundError"),
453
+ Schema.TaggedStruct("ForbiddenError", { message: Schema.String }),
454
+ Schema.TaggedStruct("ResourceNotFoundError", {
400
455
  resource: Schema.String,
401
456
  id: Schema.String,
402
457
  message: Schema.String
403
458
  })
404
459
  ]).annotate({ identifier: "MailboxSendError" });
405
- var OnboardingReviewRequiredError = class extends Schema.TaggedError()("OnboardingReviewRequiredError", Schema.Struct({
406
- message: Schema.String,
407
- code: Schema.Union([
408
- Schema.Literal("review_required"),
409
- Schema.Literal("review_in_progress"),
410
- Schema.Literal("information_required"),
411
- Schema.Literal("review_rejected"),
412
- Schema.Literal("identity_review_required"),
413
- Schema.Literal("identity_review_rejected"),
414
- Schema.Literal("identity_changed")
415
- ]),
416
- decision: Schema.Union([
417
- Schema.Literal("undecided"),
418
- Schema.Literal("approved"),
419
- Schema.Literal("rejected")
420
- ]),
421
- stage: Schema.Union([
422
- Schema.Literal("collecting"),
423
- Schema.Literal("automated_review"),
424
- Schema.Literal("manual_review"),
425
- Schema.Literal("information_requested"),
426
- Schema.Literal("complete")
427
- ]),
428
- nextAction: Schema.Union([
429
- Schema.Literal("wait_for_review"),
430
- Schema.Literal("provide_information"),
431
- Schema.Literal("verify_sending_identity"),
432
- Schema.Literal("reapply"),
433
- Schema.Literal("contact_support")
434
- ]),
435
- identityId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
436
- })) {};
437
460
  const MailboxThreadFolder = /* @__PURE__ */ Schema.Union([
438
461
  Schema.Literal("inbox"),
439
462
  Schema.Literal("assigned"),
@@ -463,10 +486,6 @@ const EmailSender = /* @__PURE__ */ Schema.Union([Schema.Struct({
463
486
  email: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
464
487
  name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
465
488
  }), Schema.Null]).annotate({ identifier: "EmailSender" });
466
- var DeliveryUnavailableError = class extends Schema.TaggedError()("DeliveryUnavailableError", Schema.Struct({
467
- message: Schema.String,
468
- retryAfterSeconds: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
469
- })) {};
470
489
  const IanaTimezone = /* @__PURE__ */ Schema.String.annotate({ identifier: "IanaTimezone" });
471
490
  const NamespaceMetadata = /* @__PURE__ */ Schema.Record(Schema.String, Schema.String).annotate({
472
491
  description: "Your own labels for the namespace, such as the id of your customer it serves. Samva stores them and never reads them.",
@@ -490,6 +509,44 @@ const TemplateTrackingDefault = /* @__PURE__ */ Schema.Struct({
490
509
  opens: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
491
510
  clicks: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
492
511
  }).annotate({ identifier: "TemplateTrackingDefault" });
512
+ var TemplateSourceError = class extends Schema.TaggedError()("TemplateSourceError", Schema.Struct({
513
+ message: Schema.String,
514
+ diagnostics: Schema.Array(Schema.Struct({
515
+ code: Schema.String,
516
+ severity: Schema.Union([
517
+ Schema.Literal("error"),
518
+ Schema.Literal("warning"),
519
+ Schema.Literal("info")
520
+ ]),
521
+ message: Schema.String,
522
+ origins: Schema.Array(Schema.Struct({
523
+ fileName: Schema.String,
524
+ lineNumber: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })),
525
+ columnNumber: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" }))
526
+ })),
527
+ clients: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
528
+ notes: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
529
+ provenance: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
530
+ fixtures: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
531
+ occurrences: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Array(Schema.Struct({
532
+ fileName: Schema.String,
533
+ lineNumber: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })),
534
+ columnNumber: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" }))
535
+ }))), Schema.Null])),
536
+ compatibility: Schema.optionalKey(Schema.Union([Schema.Struct({
537
+ assessment: Schema.Union([
538
+ Schema.Literal("risk"),
539
+ Schema.Literal("degradation"),
540
+ Schema.Literal("unverified"),
541
+ Schema.Literal("not-applicable")
542
+ ]),
543
+ title: Schema.String
544
+ }), Schema.Null]))
545
+ })),
546
+ revision: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
547
+ })) {};
548
+ const TopicContactByEmail = /* @__PURE__ */ Schema.Struct({ email: Schema.String }).annotate({ identifier: "TopicContactByEmail" });
549
+ const TopicContactByPhone = /* @__PURE__ */ Schema.Struct({ phone: Schema.String }).annotate({ identifier: "TopicContactByPhone" });
493
550
  const TestWebhookPayload = /* @__PURE__ */ Schema.Struct({ data: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null])) }).annotate({ identifier: "TestWebhookPayload" });
494
551
  const CreateTemplatePayload = /* @__PURE__ */ Schema.Struct({
495
552
  name: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(200).annotate({ expected: "a string with at most 200 code points" })).check(Schema.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" })),
@@ -512,6 +569,15 @@ const CreateTemplatePayload = /* @__PURE__ */ Schema.Struct({
512
569
  shared: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]).annotate({ description: "Share the new organization-level project with every namespace: namespace-scoped keys read and send its entries but cannot change them. Defaults to false. Not with `namespaceId`, and not from a namespace-scoped key." })),
513
570
  idempotencyKey: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }))
514
571
  }).annotate({ identifier: "CreateTemplatePayload" });
572
+ const WorkingHoursRange = /* @__PURE__ */ Schema.Struct({
573
+ day: Weekday,
574
+ opens: ClockTime,
575
+ closes: ClockTime
576
+ }).annotate({ identifier: "WorkingHoursRange" });
577
+ const CampaignReplyMailbox = /* @__PURE__ */ Schema.Union([Schema.Union([MailboxId, Schema.Null]), Schema.Null]).annotate({
578
+ description: "Omit to inherit the topic mailbox; null disables mailbox inheritance. An explicit email.replyTo overrides an inherited mailbox.",
579
+ identifier: "CampaignReplyMailbox"
580
+ });
515
581
  const CreateWebhookPayload = /* @__PURE__ */ Schema.Struct({
516
582
  name: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(100).annotate({ expected: "a string with at most 100 code points" })).check(Schema.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })),
517
583
  url: Schema.String,
@@ -627,42 +693,9 @@ const ApiKeyMailboxAccess = /* @__PURE__ */ Schema.Struct({
627
693
  mailboxIds: Schema.optionalKey(Schema.Union([Schema.TupleWithRest(Schema.Tuple([MailboxId]), [MailboxId]), Schema.Null]).annotate({ description: "The mailboxes the key may act on. Omit to reach every mailbox the owner can." })),
628
694
  sendMode: Schema.optionalKey(Schema.Union([MailboxSendMode, Schema.Null]).annotate({ description: "Defaults to `send`. With `approval`, each send waits until a person other than the key approves it." }))
629
695
  }).annotate({ identifier: "ApiKeyMailboxAccess" });
630
- const MessageSummary = /* @__PURE__ */ Schema.Struct({
631
- id: MessageId,
632
- channel: Schema.Literal("email"),
633
- direction: Schema.Union([Schema.Literal("outbound"), Schema.Literal("inbound")]),
634
- status: Schema.Union([
635
- Schema.Literal("pending"),
636
- Schema.Literal("scheduled"),
637
- Schema.Literal("queued"),
638
- Schema.Literal("processing"),
639
- Schema.Literal("sent"),
640
- Schema.Literal("delivered"),
641
- Schema.Literal("read"),
642
- Schema.Literal("failed"),
643
- Schema.Literal("bounced"),
644
- Schema.Literal("complained")
645
- ]),
646
- from: Schema.Union([Schema.String, Schema.Null]),
647
- to: Schema.Array(Schema.String),
648
- subject: Schema.Union([Schema.String, Schema.Null]),
649
- waitReason: Schema.Union([Schema.Union([
650
- Schema.Literal("rate"),
651
- Schema.Literal("daily-quota"),
652
- Schema.Literal("domain-health"),
653
- Schema.Literal("sending-paused"),
654
- Schema.Literal("upstream-unavailable"),
655
- Schema.Literal("retry"),
656
- Schema.Literal("campaign-paused"),
657
- Schema.Literal("domain-warming"),
658
- Schema.Literal("onboarding-review"),
659
- Schema.Literal("content-review"),
660
- Schema.Literal("screening-unavailable")
661
- ]), Schema.Null]),
662
- createdAt: Schema.String
663
- }).annotate({ identifier: "MessageSummary" });
664
696
  const BrandFooter = /* @__PURE__ */ Schema.Struct({
665
697
  companyName: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })), Schema.Null])),
698
+ websiteUrl: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^https:\\/\\/[^\\s]+$", "u")).annotate({ expected: "a string matching the RegExp ^https:\\/\\/[^\\s]+$" })).check(Schema.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })), Schema.Null])),
666
699
  address: Schema.optionalKey(Schema.Union([BrandAddress, Schema.Null])),
667
700
  socialLinks: Schema.optionalKey(Schema.Union([Schema.Array(BrandSocialLink).check(Schema.isMaxLength(12).annotate({ expected: "a value with a length of at most 12" })), Schema.Null]))
668
701
  }).annotate({ identifier: "BrandFooter" });
@@ -688,10 +721,11 @@ const SkippedRecipient = /* @__PURE__ */ Schema.Struct({
688
721
  Schema.Literal("complaint"),
689
722
  Schema.Literal("unsubscribe"),
690
723
  Schema.Literal("manual"),
691
- Schema.Literal("group-unsubscribe")
724
+ Schema.Literal("topic-unsubscribe")
692
725
  ]),
693
- unsubscribeGroupId: Schema.optionalKey(Schema.Union([UnsubscribeId, Schema.Null]))
726
+ topicId: Schema.optionalKey(Schema.Union([TopicId, Schema.Null]))
694
727
  }).annotate({ identifier: "SkippedRecipient" });
728
+ const CampaignConversationRef = /* @__PURE__ */ Schema.Union([Schema.Union([ConversationId, Schema.Null]), Schema.Null]).annotate({ identifier: "CampaignConversationRef" });
695
729
  const ContactEvent = /* @__PURE__ */ Schema.Struct({
696
730
  id: Schema.String,
697
731
  contactId: ContactId,
@@ -723,10 +757,56 @@ const EmailRecipient = /* @__PURE__ */ Schema.Union([Schema.Struct({ contactId:
723
757
  name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
724
758
  displayName: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null]))
725
759
  })]).annotate({ identifier: "EmailRecipient" });
760
+ const TopicContactById = /* @__PURE__ */ Schema.Struct({ contactId: ContactId }).annotate({ identifier: "TopicContactById" });
761
+ const CampaignAudience = /* @__PURE__ */ Schema.Struct({
762
+ topicId: TopicId,
763
+ includeTags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
764
+ excludeTags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
765
+ contactIds: Schema.optionalKey(Schema.Union([Schema.Array(ContactId).check(Schema.isMaxLength(25e3).annotate({ expected: "a value with a length of at most 25000" })), Schema.Null])),
766
+ groupIds: Schema.optionalKey(Schema.Union([Schema.Array(ContactGroupId).check(Schema.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), Schema.Null]))
767
+ }).annotate({ identifier: "CampaignAudience" });
726
768
  const JourneyGroupJoinedTrigger = /* @__PURE__ */ Schema.Struct({
727
769
  type: Schema.Literal("contact.joined_group"),
728
770
  groupId: ContactGroupId
729
771
  }).annotate({ identifier: "JourneyGroupJoinedTrigger" });
772
+ const MessageSummary = /* @__PURE__ */ Schema.Struct({
773
+ id: MessageId,
774
+ campaign: Schema.optionalKey(Schema.Union([Schema.Struct({
775
+ campaignId: CampaignId,
776
+ runId: CampaignRunId
777
+ }), Schema.Null])),
778
+ channel: Schema.Literal("email"),
779
+ direction: Schema.Union([Schema.Literal("outbound"), Schema.Literal("inbound")]),
780
+ status: Schema.Union([
781
+ Schema.Literal("pending"),
782
+ Schema.Literal("scheduled"),
783
+ Schema.Literal("queued"),
784
+ Schema.Literal("processing"),
785
+ Schema.Literal("sent"),
786
+ Schema.Literal("delivered"),
787
+ Schema.Literal("read"),
788
+ Schema.Literal("failed"),
789
+ Schema.Literal("bounced"),
790
+ Schema.Literal("complained")
791
+ ]),
792
+ from: Schema.Union([Schema.String, Schema.Null]),
793
+ to: Schema.Array(Schema.String),
794
+ subject: Schema.Union([Schema.String, Schema.Null]),
795
+ waitReason: Schema.Union([Schema.Union([
796
+ Schema.Literal("rate"),
797
+ Schema.Literal("daily-quota"),
798
+ Schema.Literal("domain-health"),
799
+ Schema.Literal("sending-paused"),
800
+ Schema.Literal("upstream-unavailable"),
801
+ Schema.Literal("retry"),
802
+ Schema.Literal("campaign-paused"),
803
+ Schema.Literal("domain-warming"),
804
+ Schema.Literal("onboarding-review"),
805
+ Schema.Literal("content-review"),
806
+ Schema.Literal("screening-unavailable")
807
+ ]), Schema.Null]),
808
+ createdAt: Schema.String
809
+ }).annotate({ identifier: "MessageSummary" });
730
810
  const JourneySendEmailConfig = /* @__PURE__ */ Schema.Struct({
731
811
  template: Schema.Union([TemplateId, Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$", "u")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" }))]),
732
812
  senderId: Schema.optionalKey(EmailSenderId),
@@ -864,16 +944,16 @@ const UpdateTemplatePayload = /* @__PURE__ */ Schema.Struct({ data: Schema.Struc
864
944
  isActive: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
865
945
  shared: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]).annotate({ description: "Share the template's project with every namespace, or stop sharing it. Applies to every entry in the project. Only an organization-level project is shared." }))
866
946
  }) }).annotate({ identifier: "UpdateTemplatePayload" });
947
+ const WorkingHours = /* @__PURE__ */ Schema.Struct({
948
+ timeZone: TimeZone,
949
+ ranges: Schema.Array(WorkingHoursRange).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxLength(28).annotate({ expected: "a value with a length of at most 28" }))
950
+ }).annotate({ identifier: "WorkingHours" });
867
951
  const ApiKeyAccess = /* @__PURE__ */ Schema.Union([Schema.Struct({ mode: Schema.Literal("full") }), Schema.Struct({
868
952
  mode: Schema.Literal("restricted"),
869
953
  resources: ApiKeyResourceAccess,
870
954
  mailboxes: Schema.optionalKey(Schema.Union([ApiKeyMailboxAccess, Schema.Null])),
871
955
  namespaceId: Schema.optionalKey(Schema.Union([NamespaceId, Schema.Null]).annotate({ description: "Confines the key to one namespace: it reaches only that namespace's domains, senders, numbers, mailboxes, contacts, templates, and messages, never organization-level ones, and only endpoints that confine to a namespace (others answer 403). It holds grants only on `mailboxes`, `messages`, `email`, `domains`, `contacts`, and `templates`. A key scoped to listed mailboxes holds mailbox access only." }))
872
956
  })]).annotate({ identifier: "ApiKeyAccess" });
873
- const MessagePage = /* @__PURE__ */ Schema.Struct({
874
- items: Schema.Array(MessageSummary),
875
- nextCursor: Schema.Union([Schema.String, Schema.Null])
876
- }).annotate({ identifier: "MessagePage" });
877
957
  const CreateBrand = /* @__PURE__ */ Schema.Struct({
878
958
  slug: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" })),
879
959
  name: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(120).annotate({ expected: "a string with at most 120 code points" })).check(Schema.isMaxLength(120).annotate({ expected: "a value with a length of at most 120" })),
@@ -912,6 +992,15 @@ const EmailRecipients = /* @__PURE__ */ Schema.Array(EmailRecipient).check(Schem
912
992
  }));
913
993
  const EmailCcRecipients = /* @__PURE__ */ Schema.Union([Schema.Union([Schema.Array(EmailRecipient), Schema.Null]), Schema.Null]).annotate({ identifier: "EmailCcRecipients" });
914
994
  const EmailBccRecipients = /* @__PURE__ */ Schema.Union([Schema.Union([Schema.Array(EmailRecipient), Schema.Null]), Schema.Null]).annotate({ identifier: "EmailBccRecipients" });
995
+ const TopicContactRef = /* @__PURE__ */ Schema.Union([
996
+ TopicContactById,
997
+ TopicContactByEmail,
998
+ TopicContactByPhone
999
+ ]).annotate({ identifier: "TopicContactRef" });
1000
+ const MessagePage = /* @__PURE__ */ Schema.Struct({
1001
+ items: Schema.Array(MessageSummary),
1002
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
1003
+ }).annotate({ identifier: "MessagePage" });
915
1004
  const JourneyTrigger = /* @__PURE__ */ Schema.Union([
916
1005
  JourneyCustomEventTrigger,
917
1006
  JourneyContactCreatedTrigger,
@@ -1002,7 +1091,17 @@ const OperationAccepted = /* @__PURE__ */ Schema.Struct({
1002
1091
  resource: OperationResourceLink
1003
1092
  })
1004
1093
  }).annotate({ identifier: "OperationAccepted" });
1005
- const EmailContent = /* @__PURE__ */ Schema.Struct({
1094
+ const AgentDefinition = /* @__PURE__ */ Schema.Struct({
1095
+ instructions: Schema.String.check(Schema.isMaxCodePoints(2e4).annotate({ expected: "a string with at most 20000 code points" })).check(Schema.isMaxLength(2e4).annotate({ expected: "a value with a length of at most 20000" })),
1096
+ knowledge: Schema.String.check(Schema.isMaxCodePoints(1e5).annotate({ expected: "a string with at most 100000 code points" })).check(Schema.isMaxLength(1e5).annotate({ expected: "a value with a length of at most 100000" })),
1097
+ endpointIds: Schema.Array(MailboxEndpointId).check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })),
1098
+ integrationIds: Schema.Array(AgentIntegrationReference).check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })),
1099
+ mode: AgentMode,
1100
+ model: AgentModel,
1101
+ workingHours: Schema.Union([WorkingHours, Schema.Null]),
1102
+ takeoverTimeoutMinutes: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(10080).annotate({ expected: "a value less than or equal to 10080" }))
1103
+ }).annotate({ identifier: "AgentDefinition" });
1104
+ const CampaignEmailInput = /* @__PURE__ */ Schema.Struct({
1006
1105
  subject: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1007
1106
  html: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1008
1107
  text: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
@@ -1016,12 +1115,13 @@ const EmailContent = /* @__PURE__ */ Schema.Struct({
1016
1115
  timeZone: Schema.optionalKey(RenderTimeZone),
1017
1116
  inReplyToMessageId: Schema.optionalKey(Schema.Union([MessageId, Schema.Null])),
1018
1117
  replyTo: Schema.optionalKey(ReplyToAddresses),
1019
- unsubscribeGroupId: Schema.optionalKey(Schema.Union([Schema.Union([UnsubscribeId, Schema.Null]), Schema.Null]).annotate({ description: "The unsubscribe group for this send. Omit to inherit the template group; null disables group inheritance for a direct send. Campaigns require a group." })),
1118
+ topicId: Schema.optionalKey(Schema.Union([Schema.Union([TopicId, Schema.Null]), Schema.Null]).annotate({ description: "The topic for this send. Omit to inherit the template topic; null disables topic inheritance for a direct send. Campaigns require a topic." })),
1020
1119
  tracking: Schema.optionalKey(EmailTrackingOverrideV1),
1021
1120
  footer: Schema.optionalKey(EmailFooterOverride),
1022
- headers: Schema.optionalKey(Schema.Union([EmailCustomHeaders, Schema.Null]))
1023
- }).annotate({ identifier: "EmailContent" });
1024
- const EmailDispatchContent = /* @__PURE__ */ Schema.Struct({
1121
+ headers: Schema.optionalKey(Schema.Union([EmailCustomHeaders, Schema.Null])),
1122
+ preheader: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
1123
+ }).annotate({ identifier: "CampaignEmailInput" });
1124
+ const EmailContent = /* @__PURE__ */ Schema.Struct({
1025
1125
  subject: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1026
1126
  html: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1027
1127
  text: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
@@ -1035,11 +1135,11 @@ const EmailDispatchContent = /* @__PURE__ */ Schema.Struct({
1035
1135
  timeZone: Schema.optionalKey(RenderTimeZone),
1036
1136
  inReplyToMessageId: Schema.optionalKey(Schema.Union([MessageId, Schema.Null])),
1037
1137
  replyTo: Schema.optionalKey(ReplyToAddresses),
1038
- unsubscribeGroupId: Schema.optionalKey(Schema.Union([Schema.Union([UnsubscribeId, Schema.Null]), Schema.Null]).annotate({ description: "The unsubscribe group for this send. Omit to inherit the template group; null disables group inheritance for a direct send. Campaigns require a group." })),
1138
+ topicId: Schema.optionalKey(Schema.Union([Schema.Union([TopicId, Schema.Null]), Schema.Null]).annotate({ description: "The topic for this send. Omit to inherit the template topic; null disables topic inheritance for a direct send. Campaigns require a topic." })),
1039
1139
  tracking: Schema.optionalKey(EmailTrackingOverrideV1),
1040
1140
  footer: Schema.optionalKey(EmailFooterOverride),
1041
1141
  headers: Schema.optionalKey(Schema.Union([EmailCustomHeaders, Schema.Null]))
1042
- }).annotate({ identifier: "EmailDispatchContent" });
1142
+ }).annotate({ identifier: "EmailContent" });
1043
1143
  const ContactIdentity = /* @__PURE__ */ Schema.Struct({
1044
1144
  id: ContactIdentityId,
1045
1145
  type: Schema.Union([Schema.Literal("email"), Schema.Literal("phone")]),
@@ -1068,6 +1168,14 @@ var MailboxSendConflictError = class extends Schema.TaggedError()("MailboxSendCo
1068
1168
  id: MailboxActionId,
1069
1169
  receipt: MailboxSendReceipt
1070
1170
  })) {};
1171
+ const CampaignContentInput = /* @__PURE__ */ Schema.Struct({
1172
+ channel: Schema.Literal("email"),
1173
+ email: CampaignEmailInput,
1174
+ from: Schema.optionalKey(CampaignFrom),
1175
+ replyMailboxId: Schema.optionalKey(CampaignReplyMailbox),
1176
+ conversationId: Schema.optionalKey(CampaignConversationRef),
1177
+ metadata: Schema.optionalKey(CampaignContentMetadata)
1178
+ }).annotate({ identifier: "CampaignContentInput" });
1071
1179
  const JourneyCondition = /* @__PURE__ */ Schema.Struct({
1072
1180
  match: Schema.Union([Schema.Literal("all"), Schema.Literal("any")]),
1073
1181
  predicates: Schema.TupleWithRest(Schema.Tuple([JourneyPredicate]), [JourneyPredicate])
@@ -1111,6 +1219,6 @@ const ApiKeySecurity = HttpApiSecurity.apiKey({
1111
1219
  });
1112
1220
  var ApiKeySecurityMiddleware = class extends HttpApiMiddleware.Service()("apiKey security", { security: { apiKey: ApiKeySecurity } }) {};
1113
1221
  //#endregion
1114
- export { AnalyticsQueryError, ApiKeyAccess, ApiKeyId, ApiKeyMailboxAccess, ApiKeyResourceAccess, ApiKeySecurity, ApiKeySecurityMiddleware, AttachmentId, BillingProviderError, BrandAddress, BrandAddressRequiredError, BrandAssets, BrandFooter, BrandSocialLink, CampaignFooterRequiredError, ConflictError, ContactConsent, ContactEvent, ContactEventReference, ContactGroupId, ContactId, ContactIdentity, ContactIdentityChannel, ContactIdentityId, ConversationId, CreateBrand, CreateEventPayload, CreateMailboxEndpointPayload, CreateTemplatePayload, CreateWebhookPayload, Cursor, DeliveryUnavailableError, EmailAttachment, EmailAttachments, EmailBccRecipients, EmailCcRecipients, EmailChannelError, EmailContent, EmailCustomHeaders, EmailDispatchContent, EmailDomainId, EmailFooterOverride, EmailRecipient, EmailRecipients, EmailSender, EmailSenderId, EmailTrackingOverrideV1, ExtensionId, ExtensionVersionId, ExtensionVersionRef, ExternalServiceError, FeedbackContext, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, IanaTimezone, InternalError, JourneyBranchEdge, JourneyBranchNode, JourneyComparison, JourneyCondition, JourneyContactCreatedTrigger, JourneyContactProperty, JourneyCustomEventName, JourneyCustomEventTrigger, JourneyCustomFieldPredicate, JourneyDefinition, JourneyEmptyConfig, JourneyEqualityComparison, JourneyEventName, JourneyEventPredicate, JourneyExitNode, JourneyGoal, JourneyGroupJoinedTrigger, JourneyName, JourneyNextEdge, JourneyNode, JourneyNodeId, JourneyNumericComparison, JourneyPredicate, JourneyPresenceComparison, JourneyPropertyPredicate, JourneySendEmailConfig, JourneySendEmailNode, JourneyStringComparison, JourneyTagAddedTrigger, JourneyTagPredicate, JourneyTrigger, JourneyUpdateTagsConfig, JourneyUpdateTagsNode, JourneyWaitConfig, JourneyWaitEventEdge, JourneyWaitForEventConfig, JourneyWaitForEventNode, JourneyWaitNode, JourneyWebhookConfig, JourneyWebhookNode, JsonObject, JsonValue, MailboxActionDecision, MailboxActionId, MailboxChannel, MailboxDraftId, MailboxEndpointId, MailboxGrantRole, MailboxId, MailboxLabelId, MailboxMetadata, MailboxMetadataPatch, MailboxPolicyId, MailboxPolicyOutcomeKind, MailboxSendConflictError, MailboxSendError, MailboxSendMode, MailboxSendOutcome, MailboxSendReceipt, MailboxSendRefusedError, MailboxThreadFolder, MailboxThreadId, MailboxThreadPriority, MediaId, MessageId, MessageMetadata, MessagePage, MessageSummary, NamespaceId, NamespaceMetadata, NamespaceResourceType, OnboardingReviewRequiredError, Operation, OperationAccepted, OperationId, OperationResource, OperationResourceLink, OrganizationId, PaymentRequiredError, RateLimitedError, RenderLocale, RenderTimeZone, ReplyToAddresses, ResourceNotFoundError, SendFeedback, SenderNotReadyError, SendsSeries, SkippedRecipient, SuccessResponse, TemplateData, TemplateFromDefault, TemplateId, TemplateInputContractId, TemplatePublicationId, TemplateTrackingDefault, TestWebhookPayload, UnauthorizedError, UnsubscribeId, UpdateBrand, UpdateTemplatePayload, UpdateWebhookPayload, UserId, ValidationError, VersionCursor, WebhookEndpointId, AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, SensitiveString as __SamvaRuntimeSensitiveString };
1222
+ export { AgentDefinition, AgentIntegrationReference, AgentMode, AgentModel, AgentName, AnalyticsQueryError, ApiKeyAccess, ApiKeyId, ApiKeyMailboxAccess, ApiKeyResourceAccess, ApiKeySecurity, ApiKeySecurityMiddleware, AttachmentId, BillingProviderError, BrandAddress, BrandAddressRequiredError, BrandAssets, BrandFooter, BrandSocialLink, CampaignAudience, CampaignContentInput, CampaignContentMetadata, CampaignConversationRef, CampaignEmailInput, CampaignFooterRequiredError, CampaignFrom, CampaignId, CampaignReplyMailbox, CampaignRunId, ClockTime, ConflictError, ContactConsent, ContactEvent, ContactEventReference, ContactGroupId, ContactId, ContactIdentity, ContactIdentityChannel, ContactIdentityId, ConversationId, CreateBrand, CreateEventPayload, CreateMailboxEndpointPayload, CreateTemplatePayload, CreateWebhookPayload, Cursor, DeliveryUnavailableError, EmailAttachment, EmailAttachments, EmailBccRecipients, EmailCcRecipients, EmailChannelError, EmailContent, EmailCustomHeaders, EmailDomainId, EmailFooterOverride, EmailRecipient, EmailRecipients, EmailSender, EmailSenderId, EmailTrackingOverrideV1, ExtensionId, ExtensionVersionId, ExtensionVersionRef, ExternalServiceError, FeedbackContext, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, IanaTimezone, InternalError, JourneyBranchEdge, JourneyBranchNode, JourneyComparison, JourneyCondition, JourneyContactCreatedTrigger, JourneyContactProperty, JourneyCustomEventName, JourneyCustomEventTrigger, JourneyCustomFieldPredicate, JourneyDefinition, JourneyEmptyConfig, JourneyEqualityComparison, JourneyEventName, JourneyEventPredicate, JourneyExitNode, JourneyGoal, JourneyGroupJoinedTrigger, JourneyName, JourneyNextEdge, JourneyNode, JourneyNodeId, JourneyNumericComparison, JourneyPredicate, JourneyPresenceComparison, JourneyPropertyPredicate, JourneySendEmailConfig, JourneySendEmailNode, JourneyStringComparison, JourneyTagAddedTrigger, JourneyTagPredicate, JourneyTrigger, JourneyUpdateTagsConfig, JourneyUpdateTagsNode, JourneyWaitConfig, JourneyWaitEventEdge, JourneyWaitForEventConfig, JourneyWaitForEventNode, JourneyWaitNode, JourneyWebhookConfig, JourneyWebhookNode, JsonObject, JsonValue, MailboxActionDecision, MailboxActionId, MailboxChannel, MailboxDraftId, MailboxEndpointId, MailboxGrantRole, MailboxId, MailboxLabelId, MailboxMetadata, MailboxMetadataPatch, MailboxPolicyId, MailboxPolicyOutcomeKind, MailboxSendConflictError, MailboxSendError, MailboxSendMode, MailboxSendOutcome, MailboxSendReceipt, MailboxSendRefusedError, MailboxThreadFolder, MailboxThreadId, MailboxThreadPriority, MediaId, MessageId, MessageMetadata, MessagePage, MessageSummary, NamespaceId, NamespaceMetadata, NamespaceResourceType, OnboardingReviewRequiredError, Operation, OperationAccepted, OperationId, OperationResource, OperationResourceLink, OrganizationId, PaymentRequiredError, RateLimitedError, RenderLocale, RenderTimeZone, ReplyToAddresses, ResourceNotFoundError, SendFeedback, SenderNotReadyError, SendsSeries, SkippedRecipient, SuccessResponse, TemplateData, TemplateFromDefault, TemplateId, TemplateInputContractId, TemplatePublicationId, TemplateSourceError, TemplateTrackingDefault, TestWebhookPayload, TimeZone, TopicContactByEmail, TopicContactById, TopicContactByPhone, TopicContactRef, TopicId, UnauthorizedError, UpdateBrand, UpdateTemplatePayload, UpdateWebhookPayload, UserId, ValidationError, VersionCursor, WebhookEndpointId, Weekday, WorkingHours, WorkingHoursRange, AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, SensitiveString as __SamvaRuntimeSensitiveString };
1115
1223
 
1116
1224
  //# sourceMappingURL=shared.js.map
@@ -1,6 +1,6 @@
1
1
  import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
2
2
  import * as Schema from "effect/Schema";
3
- import { ApiKeySecurityMiddleware, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, ContactGroupId, DeliveryUnavailableError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, UnauthorizedError, UnsubscribeId, ValidationError } from "./shared";
3
+ import { ApiKeySecurityMiddleware, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, TopicId, UnauthorizedError, ValidationError } from "./shared";
4
4
  export type SubscribeResult = {
5
5
  readonly success: boolean;
6
6
  readonly expiresAt: string;
@@ -11,24 +11,22 @@ export declare const SubscribeResult: Schema.Struct<{
11
11
  }>;
12
12
  export type SubscriptionsSubscribeRequestJson = {
13
13
  readonly email: string;
14
- readonly contactGroupId: ContactGroupId;
14
+ readonly topicId: TopicId;
15
15
  readonly from: {
16
16
  readonly email: string;
17
17
  readonly name?: string | null;
18
18
  };
19
- readonly unsubscribeGroupId?: UnsubscribeId | null;
20
19
  readonly templateSlug?: string | null;
21
20
  readonly consentIp?: string | null;
22
21
  readonly consentSource?: string | null;
23
22
  };
24
23
  export declare const SubscriptionsSubscribeRequestJson: Schema.Struct<{
25
24
  readonly email: Schema.String;
26
- readonly contactGroupId: Schema.brand<Schema.String, "ContactGroupId">;
25
+ readonly topicId: Schema.brand<Schema.String, "TopicId">;
27
26
  readonly from: Schema.Struct<{
28
27
  readonly email: Schema.String;
29
28
  readonly name: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
30
29
  }>;
31
- readonly unsubscribeGroupId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "UnsubscribeId">, Schema.Null]>>;
32
30
  readonly templateSlug: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
33
31
  readonly consentIp: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
34
32
  readonly consentSource: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
@@ -62,12 +60,11 @@ export type SubscriptionsSubscribe504 = GatewayTimeoutError;
62
60
  export declare const SubscriptionsSubscribe504: typeof GatewayTimeoutError;
63
61
  declare const SubscriptionsGroup_base: HttpApiGroup.HttpApiGroup<"Subscriptions", HttpApiEndpoint.HttpApiEndpoint<"subscriptionsSubscribe", "POST", "/v1/subscriptions", never, never, Schema.toCodecJson<Schema.Struct<{
64
62
  readonly email: Schema.String;
65
- readonly contactGroupId: Schema.brand<Schema.String, "ContactGroupId">;
63
+ readonly topicId: Schema.brand<Schema.String, "TopicId">;
66
64
  readonly from: Schema.Struct<{
67
65
  readonly email: Schema.String;
68
66
  readonly name: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
69
67
  }>;
70
- readonly unsubscribeGroupId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "UnsubscribeId">, Schema.Null]>>;
71
68
  readonly templateSlug: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
72
69
  readonly consentIp: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
73
70
  readonly consentSource: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
@@ -1,4 +1,4 @@
1
- import { ApiKeySecurityMiddleware, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, ContactGroupId, DeliveryUnavailableError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, UnauthorizedError, UnsubscribeId, ValidationError } from "./shared.js";
1
+ import { ApiKeySecurityMiddleware, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, TopicId, UnauthorizedError, ValidationError } from "./shared.js";
2
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
3
3
  import * as Schema from "effect/Schema";
4
4
  //#region src/effect/generated/subscriptions.ts
@@ -8,12 +8,11 @@ const SubscribeResult = /* @__PURE__ */ Schema.Struct({
8
8
  }).annotate({ identifier: "SubscribeResult" });
9
9
  const SubscriptionsSubscribeRequestJson = /* @__PURE__ */ Schema.Struct({
10
10
  email: Schema.String.annotate({ description: "The recipient email address; confirmation proves consent for this address." }).check(Schema.isMaxCodePoints(320).annotate({ expected: "a string with at most 320 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", "u")).annotate({ expected: "a string matching the RegExp ^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$" })).check(Schema.isMaxLength(320).annotate({ expected: "a value with a length of at most 320" })),
11
- contactGroupId: ContactGroupId,
11
+ topicId: TopicId,
12
12
  from: Schema.Struct({
13
13
  email: Schema.String,
14
14
  name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
15
15
  }).annotate({ description: "Your verified email sender. The ordinary send pipeline selects its domain and customer brand." }),
16
- unsubscribeGroupId: Schema.optionalKey(Schema.Union([UnsubscribeId, Schema.Null]).annotate({ description: "Clear this unsubscribe group after confirmation; all other opt-outs remain." })),
17
16
  templateSlug: Schema.optionalKey(Schema.Union([Schema.String.annotate({ description: "A published email template slug receiving confirmUrl. Omit it to send the default confirmation email." }).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$", "u")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" })), Schema.Null])),
18
17
  consentIp: Schema.optionalKey(Schema.Union([Schema.String.annotate({ description: "The recipient IP recorded by your server when they requested subscription." }).check(Schema.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" })), Schema.Null])),
19
18
  consentSource: Schema.optionalKey(Schema.Union([Schema.String.annotate({ description: "The signup page or source recorded by your server when consent was requested." }).check(Schema.isMaxCodePoints(512).annotate({ expected: "a string with at most 512 code points" })).check(Schema.isMaxLength(512).annotate({ expected: "a value with a length of at most 512" })), Schema.Null]))
@@ -55,7 +54,7 @@ var SubscriptionsGroup = class extends HttpApiGroup.make("Subscriptions").add(Ht
55
54
  SubscriptionsSubscribe503.pipe(HttpApiSchema.status(503)),
56
55
  SubscriptionsSubscribe504.pipe(HttpApiSchema.status(504))
57
56
  ]
58
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "subscriptions.subscribe").annotate(OpenApi.Summary, "Request subscription confirmation").annotate(OpenApi.Description, "Sends a confirmation email from your sender. Only the recipient's explicit confirmation adds them to the active static contact group and clears the optional unsubscribe group. The link expires after seven days and can be used once. A custom published email template receives confirmUrl. Sending follows ordinary sender, admission, billing, and brand-footer settings. Requires email send authority in addition to the declared contact grants, including the optional unsubscribe preference change.")).annotate(OpenApi.Description, "Recipient-confirmed contact list subscriptions") {};
57
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "subscriptions.subscribe").annotate(OpenApi.Summary, "Request subscription confirmation").annotate(OpenApi.Description, "Sends a confirmation email from your sender. Only the recipient's explicit confirmation creates their contact and subscribes them to the named topic. The link expires after seven days and can be used once. A custom published email template receives confirmUrl. Sending follows ordinary sender, admission, billing, and brand-footer settings. Requires email send authority in addition to the declared contact grants, including the topic subscription change.")).annotate(OpenApi.Description, "Recipient-confirmed topic subscriptions") {};
59
58
  //#endregion
60
59
  export { SubscribeResult, SubscriptionsGroup, SubscriptionsSubscribe200, SubscriptionsSubscribe401, SubscriptionsSubscribe402, SubscriptionsSubscribe403, SubscriptionsSubscribe404, SubscriptionsSubscribe409, SubscriptionsSubscribe422, SubscriptionsSubscribe429, SubscriptionsSubscribe500, SubscriptionsSubscribe502, SubscriptionsSubscribe503, SubscriptionsSubscribe504, SubscriptionsSubscribeRequestJson };
61
60