samva 0.17.0 → 0.19.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 (143) hide show
  1. package/AGENTS.md +5 -0
  2. package/README.md +18 -3
  3. package/dist/{rolldown-runtime-D7D4PA-g.js → _virtual/_rolldown/runtime.js} +1 -1
  4. package/dist/client/client/client.gen.js +174 -0
  5. package/dist/client/client/utils.gen.js +177 -0
  6. package/dist/client/client.gen.js +8 -0
  7. package/dist/client/core/auth.gen.js +12 -0
  8. package/dist/client/core/bodySerializer.gen.js +6 -0
  9. package/dist/client/core/params.gen.js +77 -0
  10. package/dist/client/core/pathSerializer.gen.js +82 -0
  11. package/dist/client/core/serverSentEvents.gen.js +96 -0
  12. package/dist/client/core/utils.gen.js +78 -0
  13. package/dist/client/sdk.gen.d.ts +39 -23
  14. package/dist/{promises---Kbh-7z.js → client/sdk.gen.js} +87 -2314
  15. package/dist/client/types.gen.d.ts +175 -44
  16. package/dist/client-attribution.js +9 -0
  17. package/dist/effect/analytics.d.ts +6 -6
  18. package/dist/effect/analytics.js +23 -2
  19. package/dist/effect/api-keys.d.ts +12 -12
  20. package/dist/effect/api-keys.js +29 -2
  21. package/dist/effect/attachments.d.ts +4 -4
  22. package/dist/effect/attachments.js +19 -2
  23. package/dist/effect/brands.d.ts +6 -6
  24. package/dist/effect/brands.js +26 -3
  25. package/dist/effect/campaigns.d.ts +18 -18
  26. package/dist/effect/campaigns.js +35 -2
  27. package/dist/effect/categories.d.ts +2 -2
  28. package/dist/effect/categories.js +95 -1
  29. package/dist/effect/client.js +3 -3
  30. package/dist/effect/contact-groups.d.ts +53 -17
  31. package/dist/effect/contact-groups.js +31 -2
  32. package/dist/effect/contacts.d.ts +244 -41
  33. package/dist/effect/contacts.js +54 -2
  34. package/dist/effect/conversations.d.ts +28 -28
  35. package/dist/effect/conversations.js +37 -2
  36. package/dist/effect/custom-fields.d.ts +4 -4
  37. package/dist/effect/custom-fields.js +19 -2
  38. package/dist/effect/email.d.ts +75 -75
  39. package/dist/effect/email.js +140 -2
  40. package/dist/effect/errors.d.ts +2 -0
  41. package/dist/effect/errors.js +3 -0
  42. package/dist/effect/events.d.ts +2 -2
  43. package/dist/effect/events.js +17 -3
  44. package/dist/effect/extension-installations.d.ts +23 -23
  45. package/dist/effect/extension-installations.js +29 -2
  46. package/dist/effect/extensions.d.ts +12 -12
  47. package/dist/effect/extensions.js +21 -2
  48. package/dist/effect/feedback.d.ts +1 -1
  49. package/dist/effect/feedback.js +14 -3
  50. package/dist/{analytics-CaqPRsry.js → effect/generated/analytics.js} +4 -23
  51. package/dist/{api-keys-Ce1Y4_Ip.js → effect/generated/api-keys.js} +4 -29
  52. package/dist/{attachments-DYqVIraC.js → effect/generated/attachments.js} +3 -18
  53. package/dist/{brands-ZwuOGIWO.js → effect/generated/brands.js} +5 -25
  54. package/dist/{campaigns-DZlz1E9E.js → effect/generated/campaigns.js} +4 -35
  55. package/dist/effect/generated/contact-events.js +37 -0
  56. package/dist/effect/generated/contact-groups.d.ts +33 -3
  57. package/dist/{contact-groups-BLbFXnjq.js → effect/generated/contact-groups.js} +3 -30
  58. package/dist/effect/generated/contacts.d.ts +477 -54
  59. package/dist/{contacts-BbsoXXB4.js → effect/generated/contacts.js} +41 -89
  60. package/dist/effect/generated/conversations.d.ts +25 -25
  61. package/dist/{conversations-_sRHueML.js → effect/generated/conversations.js} +4 -37
  62. package/dist/{custom-fields-BHWbwlKn.js → effect/generated/custom-fields.js} +5 -19
  63. package/dist/{email-R0NAA9PW.js → effect/generated/email.js} +995 -1146
  64. package/dist/{events-CxbTUHYT.js → effect/generated/events.js} +3 -15
  65. package/dist/effect/generated/extension-installations.d.ts +44 -44
  66. package/dist/{extension-installations-CD94LPmk.js → effect/generated/extension-installations.js} +10 -29
  67. package/dist/effect/generated/extensions.d.ts +10 -10
  68. package/dist/{extensions-BKyNQLvu.js → effect/generated/extensions.js} +5 -20
  69. package/dist/{feedback-Bpa09JOS.js → effect/generated/feedback.js} +3 -12
  70. package/dist/{journeys-CARo_BJT.js → effect/generated/journeys.js} +3 -38
  71. package/dist/effect/generated/mailboxes.d.ts +310 -0
  72. package/dist/{mailboxes-BRDn7BIK.js → effect/generated/mailboxes.js} +829 -954
  73. package/dist/{media-VrrtNnft.js → effect/generated/media.js} +3 -3
  74. package/dist/effect/generated/messages.d.ts +31 -0
  75. package/dist/effect/generated/messages.js +677 -0
  76. package/dist/{namespaces-CcvEbG-y.js → effect/generated/namespaces.js} +3 -20
  77. package/dist/{operations-CmB3FHwf.js → effect/generated/operations.js} +3 -16
  78. package/dist/effect/generated/organizations.d.ts +13 -11
  79. package/dist/{organizations-A-plufWc.js → effect/generated/organizations.js} +9 -26
  80. package/dist/{scheduled-messages-DkKZRRaN.js → effect/generated/scheduled-messages.js} +4 -21
  81. package/dist/effect/generated/shared.d.ts +70 -20
  82. package/dist/effect/generated/shared.js +1073 -0
  83. package/dist/{subscriptions-DEXYtMXg.js → effect/generated/subscriptions.js} +3 -9
  84. package/dist/{templates-DZomxsG7.js → effect/generated/templates.js} +3 -78
  85. package/dist/effect/generated/unsubscribe-groups.d.ts +173 -78
  86. package/dist/{unsubscribe-groups-Iqk4Isf9.js → effect/generated/unsubscribe-groups.js} +77 -84
  87. package/dist/effect/generated/webhooks.d.ts +19 -19
  88. package/dist/{webhooks-CPXuu8Xf.js → effect/generated/webhooks.js} +12 -34
  89. package/dist/{whoami-Ccz0jwlt.js → effect/generated/whoami.js} +5 -10
  90. package/dist/effect/generated-metadata.d.ts +7 -2
  91. package/dist/effect/generated-metadata.js +925 -0
  92. package/dist/effect/index.d.ts +1 -2
  93. package/dist/effect/index.js +32 -32
  94. package/dist/effect/internal/client.js +69 -0
  95. package/dist/effect/internal/email-sender.js +21 -0
  96. package/dist/effect/internal/mailbox-events.js +33 -0
  97. package/dist/effect/internal/operation.js +116 -0
  98. package/dist/effect/internal/send.js +56 -0
  99. package/dist/effect/journeys.d.ts +18 -18
  100. package/dist/effect/journeys.js +39 -2
  101. package/dist/effect/mailboxes.d.ts +314 -182
  102. package/dist/effect/mailboxes.js +135 -3
  103. package/dist/effect/media.d.ts +5 -5
  104. package/dist/effect/media.js +10 -10
  105. package/dist/effect/messages.d.ts +19 -14
  106. package/dist/effect/messages.js +15 -14
  107. package/dist/effect/namespaces.d.ts +7 -7
  108. package/dist/effect/namespaces.js +21 -2
  109. package/dist/effect/operations.d.ts +5 -5
  110. package/dist/effect/operations.js +17 -2
  111. package/dist/effect/organizations.d.ts +11 -11
  112. package/dist/effect/organizations.js +25 -2
  113. package/dist/effect/pagination.js +39 -0
  114. package/dist/effect/retry.js +3 -3
  115. package/dist/{runtime-P0l1_2-C.js → effect/runtime.js} +2 -2
  116. package/dist/effect/scheduled-messages.d.ts +7 -7
  117. package/dist/effect/scheduled-messages.js +21 -2
  118. package/dist/effect/subscriptions.d.ts +1 -1
  119. package/dist/effect/subscriptions.js +10 -2
  120. package/dist/effect/templates.d.ts +39 -39
  121. package/dist/effect/templates.js +80 -3
  122. package/dist/effect/unsubscribe-groups.d.ts +39 -28
  123. package/dist/effect/unsubscribe-groups.js +29 -2
  124. package/dist/effect/webhooks.d.ts +22 -22
  125. package/dist/effect/webhooks.js +35 -3
  126. package/dist/effect/whoami.d.ts +9 -9
  127. package/dist/effect/whoami.js +10 -2
  128. package/dist/index.js +4 -3
  129. package/dist/{inline-attachments-Bi1hDltp.js → inline-attachments.js} +13 -7
  130. package/dist/mailbox-events.d.ts +31 -4
  131. package/dist/{mailbox-events-VKR4f3qq.js → mailbox-events.js} +41 -13
  132. package/dist/{normalize-B79uJIeb.js → normalize.js} +2 -2
  133. package/dist/package.js +6 -0
  134. package/dist/promises/errors.gen.js +1340 -0
  135. package/dist/promises/index.d.ts +1 -1
  136. package/dist/promises/index.js +288 -3
  137. package/dist/promises/types.gen.d.ts +1 -1
  138. package/dist/service-map.d.ts +9 -4
  139. package/dist/{operation-n_IYgNVK.js → service-map.js} +12 -150
  140. package/package.json +6 -2
  141. package/dist/categories-CA4XIQAb.js +0 -1011
  142. package/dist/client-DOzUrdTE.js +0 -1115
  143. package/dist/send-Bxc0XfGE.js +0 -722
@@ -0,0 +1,1073 @@
1
+ import { AbsoluteInstant, SensitiveString } from "../runtime.js";
2
+ import { HttpApiMiddleware, HttpApiSecurity } from "effect/http-api";
3
+ import * as Schema from "effect/Schema";
4
+ //#region src/effect/generated/shared.ts
5
+ const JsonValue = Schema.suspend(() => __recursive_JsonValue);
6
+ var AnalyticsQueryError = class extends Schema.TaggedError()("AnalyticsQueryError", Schema.Struct({ message: Schema.String })) {};
7
+ var UnauthorizedError = class extends Schema.TaggedError()("UnauthorizedError", Schema.Struct({ message: Schema.String })) {};
8
+ var ForbiddenError = class extends Schema.TaggedError()("ForbiddenError", Schema.Struct({ message: Schema.String })) {};
9
+ var ValidationError = class extends Schema.TaggedError()("ValidationError", Schema.Struct({
10
+ message: Schema.String,
11
+ fields: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.Array(Schema.String)), Schema.Null]))
12
+ })) {};
13
+ var InternalError = class extends Schema.TaggedError()("InternalError", Schema.Struct({ message: Schema.String })) {};
14
+ var GatewayTimeoutError = class extends Schema.TaggedError()("GatewayTimeoutError", Schema.Struct({
15
+ message: Schema.String,
16
+ retryAfterSeconds: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
17
+ })) {};
18
+ const Cursor = /* @__PURE__ */ Schema.String.annotate({ identifier: "Cursor" });
19
+ const ApiKeyResourceAccess = /* @__PURE__ */ Schema.Struct({
20
+ messages: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
21
+ email: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
22
+ domains: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
23
+ phoneNumbers: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
24
+ contacts: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
25
+ conversations: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
26
+ templates: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
27
+ webhooks: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
28
+ apiKeys: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
29
+ organization: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
30
+ billing: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null])),
31
+ analytics: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("read"), Schema.Literal("write")]), Schema.Null]))
32
+ }).annotate({ identifier: "ApiKeyResourceAccess" });
33
+ const MailboxId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^mbx_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
34
+ expected: "a string matching the RegExp ^mbx_[0-9a-hjkmnp-tv-z]{16,24}$",
35
+ identifier: "MailboxId"
36
+ })).pipe(Schema.brand("MailboxId"));
37
+ const MailboxSendMode = /* @__PURE__ */ Schema.Union([Schema.Literal("send"), Schema.Literal("approval")]).annotate({
38
+ description: "How the grantee's sends execute: `send` runs them within account limits; `approval` holds each one until a different member approves it.",
39
+ identifier: "MailboxSendMode"
40
+ });
41
+ const NamespaceId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^ns_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
42
+ expected: "a string matching the RegExp ^ns_[0-9a-hjkmnp-tv-z]{16,24}$",
43
+ identifier: "NamespaceId"
44
+ })).pipe(Schema.brand("NamespaceId"));
45
+ var PaymentRequiredError = class extends Schema.TaggedError()("PaymentRequiredError", Schema.Struct({
46
+ message: Schema.String,
47
+ resource: Schema.String,
48
+ currentUsage: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
49
+ limit: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
50
+ })) {};
51
+ var ResourceNotFoundError = class extends Schema.TaggedError()("ResourceNotFoundError", Schema.Struct({
52
+ resource: Schema.String,
53
+ id: Schema.String,
54
+ message: Schema.String
55
+ })) {};
56
+ var RateLimitedError = class extends Schema.TaggedError()("RateLimitedError", Schema.Struct({
57
+ message: Schema.String,
58
+ retryAfterSeconds: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
59
+ })) {};
60
+ var BillingProviderError = class extends Schema.TaggedError()("BillingProviderError", Schema.Struct({ message: Schema.String })) {};
61
+ const ApiKeyId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^key_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
62
+ expected: "a string matching the RegExp ^key_[0-9a-hjkmnp-tv-z]{16,24}$",
63
+ identifier: "ApiKeyId"
64
+ })).pipe(Schema.brand("ApiKeyId"));
65
+ const SuccessResponse = /* @__PURE__ */ Schema.Struct({ success: Schema.Boolean }).annotate({ identifier: "SuccessResponse" });
66
+ const MessageId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^msg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
67
+ expected: "a string matching the RegExp ^msg_[0-9a-hjkmnp-tv-z]{16,24}$",
68
+ identifier: "MessageId"
69
+ })).pipe(Schema.brand("MessageId"));
70
+ const AttachmentId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
71
+ expected: "a string matching the RegExp ^att_[0-9a-hjkmnp-tv-z]{16,24}$",
72
+ identifier: "AttachmentId"
73
+ })).pipe(Schema.brand("AttachmentId"));
74
+ const OrganizationId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^org_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
75
+ expected: "a string matching the RegExp ^org_[0-9a-hjkmnp-tv-z]{16,24}$",
76
+ identifier: "OrganizationId"
77
+ })).pipe(Schema.brand("OrganizationId"));
78
+ const BrandAssets = /* @__PURE__ */ Schema.Struct({
79
+ logoUrl: 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])),
80
+ logoDarkUrl: 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])),
81
+ iconUrl: 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]))
82
+ }).annotate({ identifier: "BrandAssets" });
83
+ const BrandAddress = /* @__PURE__ */ Schema.Struct({
84
+ street1: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
85
+ street2: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
86
+ city: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
87
+ region: Schema.String,
88
+ postalCode: Schema.String,
89
+ country: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }))
90
+ }).annotate({ identifier: "BrandAddress" });
91
+ const BrandSocialLink = /* @__PURE__ */ Schema.Struct({
92
+ 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" })),
93
+ 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" }))
94
+ }).annotate({ identifier: "BrandSocialLink" });
95
+ var ConflictError = class extends Schema.TaggedError()("ConflictError", Schema.Struct({
96
+ message: Schema.String,
97
+ resource: Schema.String,
98
+ id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
99
+ })) {};
100
+ const MediaId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^media_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
101
+ expected: "a string matching the RegExp ^media_[0-9a-hjkmnp-tv-z]{16,24}$",
102
+ identifier: "MediaId"
103
+ })).pipe(Schema.brand("MediaId"));
104
+ const TemplatePublicationId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^tpub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
105
+ expected: "a string matching the RegExp ^tpub_[0-9a-hjkmnp-tv-z]{16,24}$",
106
+ identifier: "TemplatePublicationId"
107
+ })).pipe(Schema.brand("TemplatePublicationId"));
108
+ const TemplateInputContractId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^tcon_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
109
+ expected: "a string matching the RegExp ^tcon_[0-9a-hjkmnp-tv-z]{16,24}$",
110
+ identifier: "TemplateInputContractId"
111
+ })).pipe(Schema.brand("TemplateInputContractId"));
112
+ const TemplateId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
113
+ expected: "a string matching the RegExp ^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$",
114
+ identifier: "TemplateId"
115
+ })).pipe(Schema.brand("TemplateId"));
116
+ const JsonObject = /* @__PURE__ */ Schema.Record(Schema.String, JsonValue).annotate({ identifier: "JsonObject" });
117
+ const RenderLocale = /* @__PURE__ */ Schema.String.check(Schema.isMaxCodePoints(64).annotate({
118
+ expected: "a string with at most 64 code points",
119
+ identifier: "RenderLocale"
120
+ })).check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" }));
121
+ const RenderTimeZone = /* @__PURE__ */ Schema.String.check(Schema.isMaxCodePoints(64).annotate({
122
+ expected: "a string with at most 64 code points",
123
+ identifier: "RenderTimeZone"
124
+ })).check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" }));
125
+ const ReplyToAddresses = /* @__PURE__ */ Schema.Union([Schema.Union([Schema.Array(Schema.String), Schema.Null]), Schema.Null]).annotate({ identifier: "ReplyToAddresses" });
126
+ const UnsubscribeId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^unsub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
127
+ expected: "a string matching the RegExp ^unsub_[0-9a-hjkmnp-tv-z]{16,24}$",
128
+ identifier: "UnsubscribeId"
129
+ })).pipe(Schema.brand("UnsubscribeId"));
130
+ const EmailTrackingOverrideV1 = /* @__PURE__ */ Schema.Struct({
131
+ 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." })),
132
+ 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." }))
133
+ }).annotate({
134
+ description: "Requested per-send engagement tracking policy. Recipient opt-out takes precedence, then explicit fields, organization defaults, and product defaults.",
135
+ identifier: "EmailTrackingOverrideV1"
136
+ });
137
+ const EmailFooterOverride = /* @__PURE__ */ Schema.Struct({ enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ identifier: "EmailFooterOverride" });
138
+ const ConversationId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^conv_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
139
+ expected: "a string matching the RegExp ^conv_[0-9a-hjkmnp-tv-z]{16,24}$",
140
+ identifier: "ConversationId"
141
+ })).pipe(Schema.brand("ConversationId"));
142
+ const ContactId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^contact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
143
+ expected: "a string matching the RegExp ^contact_[0-9a-hjkmnp-tv-z]{16,24}$",
144
+ identifier: "ContactId"
145
+ })).pipe(Schema.brand("ContactId"));
146
+ const ContactGroupId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
147
+ expected: "a string matching the RegExp ^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$",
148
+ identifier: "ContactGroupId"
149
+ })).pipe(Schema.brand("ContactGroupId"));
150
+ 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" }))).annotate({
151
+ 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.",
152
+ identifier: "SendsSeries"
153
+ });
154
+ var FlagDisabledError = class extends Schema.TaggedError()("FlagDisabledError", Schema.Struct({
155
+ flag: Schema.String,
156
+ message: Schema.String
157
+ })) {};
158
+ const EmailDomainId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^dom_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
159
+ expected: "a string matching the RegExp ^dom_[0-9a-hjkmnp-tv-z]{16,24}$",
160
+ identifier: "EmailDomainId"
161
+ })).pipe(Schema.brand("EmailDomainId"));
162
+ var BrandAddressRequiredError = class extends Schema.TaggedError()("BrandAddressRequiredError", Schema.Struct({
163
+ message: Schema.String,
164
+ brand: Schema.Union([Schema.String, Schema.Null])
165
+ })) {};
166
+ var CampaignFooterRequiredError = class extends Schema.TaggedError()("CampaignFooterRequiredError", Schema.Struct({ message: Schema.String })) {};
167
+ var ExternalServiceError = class extends Schema.TaggedError()("ExternalServiceError", Schema.Struct({ message: Schema.String })) {};
168
+ var SenderNotReadyError = class extends Schema.TaggedError()("SenderNotReadyError", Schema.Struct({
169
+ message: Schema.String,
170
+ sender: Schema.String,
171
+ retryAfterSeconds: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })), Schema.Null]))
172
+ })) {};
173
+ const ContactIdentityId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^cident_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
174
+ expected: "a string matching the RegExp ^cident_[0-9a-hjkmnp-tv-z]{16,24}$",
175
+ identifier: "ContactIdentityId"
176
+ })).pipe(Schema.brand("ContactIdentityId"));
177
+ const WebhookEndpointId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^wep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
178
+ expected: "a string matching the RegExp ^wep_[0-9a-hjkmnp-tv-z]{16,24}$",
179
+ identifier: "WebhookEndpointId"
180
+ })).pipe(Schema.brand("WebhookEndpointId"));
181
+ var EmailChannelError = class extends Schema.TaggedError()("EmailChannelError", Schema.Struct({
182
+ reason: Schema.Union([
183
+ Schema.Literal("transport"),
184
+ Schema.Literal("rejected"),
185
+ Schema.Literal("rate_limited"),
186
+ Schema.Literal("auth")
187
+ ]),
188
+ message: Schema.String,
189
+ statusCode: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })), Schema.Null]))
190
+ })) {};
191
+ const OperationId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^op_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
192
+ expected: "a string matching the RegExp ^op_[0-9a-hjkmnp-tv-z]{16,24}$",
193
+ identifier: "OperationId"
194
+ })).pipe(Schema.brand("OperationId"));
195
+ const EmailSenderId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^sender_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
196
+ expected: "a string matching the RegExp ^sender_[0-9a-hjkmnp-tv-z]{16,24}$",
197
+ identifier: "EmailSenderId"
198
+ })).pipe(Schema.brand("EmailSenderId"));
199
+ const ExtensionId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^ext_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
200
+ expected: "a string matching the RegExp ^ext_[0-9a-hjkmnp-tv-z]{16,24}$",
201
+ identifier: "ExtensionId"
202
+ })).pipe(Schema.brand("ExtensionId"));
203
+ const ExtensionVersionId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^extver_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
204
+ expected: "a string matching the RegExp ^extver_[0-9a-hjkmnp-tv-z]{16,24}$",
205
+ identifier: "ExtensionVersionId"
206
+ })).pipe(Schema.brand("ExtensionVersionId"));
207
+ const UserId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^user_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
208
+ expected: "a string matching the RegExp ^user_[0-9a-hjkmnp-tv-z]{16,24}$",
209
+ identifier: "UserId"
210
+ })).pipe(Schema.brand("UserId"));
211
+ const FeedbackContext = /* @__PURE__ */ Schema.Struct({
212
+ operation: Schema.optionalKey(Schema.Union([Schema.String.annotate({ description: "The operation the report is about, as an SDK method, MCP tool, CLI command, or `METHOD /path` (for example `POST /v1/messages`)." }).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" })), Schema.Null])),
213
+ resourceId: Schema.optionalKey(Schema.Union([Schema.String.annotate({ description: "The id of the resource involved, such as a message or domain id." }).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" })), Schema.Null]))
214
+ }).annotate({ identifier: "FeedbackContext" });
215
+ const JourneyName = /* @__PURE__ */ 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.isPattern(/* @__PURE__ */ new RegExp("^\\S[\\s\\S]*\\S$|^\\S$|^$", "u")).annotate({
216
+ expected: "a string matching the RegExp ^\\S[\\s\\S]*\\S$|^\\S$|^$",
217
+ identifier: "JourneyName"
218
+ })).check(Schema.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" }));
219
+ const JourneyCustomEventName = /* @__PURE__ */ Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({
220
+ expected: "a string with at most 255 code points",
221
+ identifier: "JourneyCustomEventName"
222
+ })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$")).annotate({ expected: "a string matching the RegExp ^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$" }));
223
+ const JourneyContactCreatedTrigger = /* @__PURE__ */ Schema.Struct({ type: Schema.Literal("contact.created") }).annotate({ identifier: "JourneyContactCreatedTrigger" });
224
+ const JourneyTagAddedTrigger = /* @__PURE__ */ Schema.Struct({
225
+ type: Schema.Literal("contact.tag_added"),
226
+ tag: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }))
227
+ }).annotate({ identifier: "JourneyTagAddedTrigger" });
228
+ const JourneyNodeId = /* @__PURE__ */ Schema.String.check(Schema.isMinLength(1).annotate({
229
+ expected: "a value with a length of at least 1",
230
+ identifier: "JourneyNodeId"
231
+ }));
232
+ const JourneyWaitConfig = /* @__PURE__ */ Schema.Struct({ durationSeconds: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(7776e3).annotate({ expected: "a value less than or equal to 7776000" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })) }).annotate({ identifier: "JourneyWaitConfig" });
233
+ const JourneyEmptyConfig = /* @__PURE__ */ Schema.Record(Schema.String, Schema.Never).annotate({ identifier: "JourneyEmptyConfig" });
234
+ const JourneyTagPredicate = /* @__PURE__ */ Schema.Struct({
235
+ type: Schema.Literal("tag"),
236
+ tag: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
237
+ present: Schema.Boolean
238
+ }).annotate({ identifier: "JourneyTagPredicate" });
239
+ const JourneyContactProperty = /* @__PURE__ */ Schema.Union([
240
+ Schema.Literal("name"),
241
+ Schema.Literal("displayName"),
242
+ Schema.Literal("externalId"),
243
+ Schema.Literal("status"),
244
+ Schema.Literal("profile.firstName"),
245
+ Schema.Literal("profile.lastName"),
246
+ Schema.Literal("profile.company"),
247
+ Schema.Literal("profile.jobTitle"),
248
+ Schema.Literal("profile.source"),
249
+ Schema.Literal("profile.location.country"),
250
+ Schema.Literal("profile.location.state"),
251
+ Schema.Literal("profile.location.city"),
252
+ Schema.Literal("profile.location.timezone")
253
+ ]).annotate({ identifier: "JourneyContactProperty" });
254
+ const JourneyEqualityComparison = /* @__PURE__ */ Schema.Struct({
255
+ operator: Schema.Union([Schema.Literal("eq"), Schema.Literal("neq")]),
256
+ value: Schema.Union([
257
+ Schema.String,
258
+ Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
259
+ Schema.Boolean,
260
+ Schema.Null
261
+ ])
262
+ }).annotate({ identifier: "JourneyEqualityComparison" });
263
+ const JourneyNumericComparison = /* @__PURE__ */ Schema.Struct({
264
+ operator: Schema.Union([
265
+ Schema.Literal("gt"),
266
+ Schema.Literal("gte"),
267
+ Schema.Literal("lt"),
268
+ Schema.Literal("lte")
269
+ ]),
270
+ value: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
271
+ }).annotate({ identifier: "JourneyNumericComparison" });
272
+ const JourneyStringComparison = /* @__PURE__ */ Schema.Struct({
273
+ operator: Schema.Union([
274
+ Schema.Literal("contains"),
275
+ Schema.Literal("not_contains"),
276
+ Schema.Literal("starts_with"),
277
+ Schema.Literal("ends_with")
278
+ ]),
279
+ value: Schema.String
280
+ }).annotate({ identifier: "JourneyStringComparison" });
281
+ const JourneyPresenceComparison = /* @__PURE__ */ Schema.Struct({ operator: Schema.Union([Schema.Literal("exists"), Schema.Literal("not_exists")]) }).annotate({ identifier: "JourneyPresenceComparison" });
282
+ const JourneyUpdateTagsConfig = /* @__PURE__ */ Schema.Struct({
283
+ add: Schema.Array(Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }))),
284
+ remove: Schema.Array(Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })))
285
+ }).annotate({ identifier: "JourneyUpdateTagsConfig" });
286
+ const MailboxChannel = /* @__PURE__ */ Schema.Literal("email").annotate({
287
+ description: "The channel an endpoint, thread, or message belongs to.",
288
+ identifier: "MailboxChannel"
289
+ });
290
+ const MailboxMetadata = /* @__PURE__ */ Schema.Record(Schema.String, Schema.String.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" }))).check(Schema.isPropertyNames(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" }))).annotate({
291
+ expected: "an object with property names matching the schema",
292
+ identifier: "MailboxMetadata"
293
+ }));
294
+ const MailboxEndpointId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
295
+ expected: "a string matching the RegExp ^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$",
296
+ identifier: "MailboxEndpointId"
297
+ })).pipe(Schema.brand("MailboxEndpointId"));
298
+ var MailboxChannelUnsupportedError = class extends Schema.TaggedError()("MailboxChannelUnsupportedError", Schema.Struct({
299
+ message: Schema.String,
300
+ channel: Schema.String
301
+ })) {};
302
+ const MailboxMetadataPatch = /* @__PURE__ */ Schema.Record(Schema.String, Schema.Union([Schema.String.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])).check(Schema.isPropertyNames(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" }))).annotate({
303
+ expected: "an object with property names matching the schema",
304
+ identifier: "MailboxMetadataPatch"
305
+ }));
306
+ const MailboxThreadId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^thread_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
307
+ expected: "a string matching the RegExp ^thread_[0-9a-hjkmnp-tv-z]{16,24}$",
308
+ identifier: "MailboxThreadId"
309
+ })).pipe(Schema.brand("MailboxThreadId"));
310
+ const MailboxActionId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
311
+ expected: "a string matching the RegExp ^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$",
312
+ identifier: "MailboxActionId"
313
+ })).pipe(Schema.brand("MailboxActionId"));
314
+ const MailboxDraftId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^mdraft_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
315
+ expected: "a string matching the RegExp ^mdraft_[0-9a-hjkmnp-tv-z]{16,24}$",
316
+ identifier: "MailboxDraftId"
317
+ })).pipe(Schema.brand("MailboxDraftId"));
318
+ const MailboxPolicyId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
319
+ expected: "a string matching the RegExp ^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$",
320
+ identifier: "MailboxPolicyId"
321
+ })).pipe(Schema.brand("MailboxPolicyId"));
322
+ const MailboxSendError = /* @__PURE__ */ Schema.Union([
323
+ Schema.Struct({
324
+ _tag: Schema.Literal("SenderNotReadyError"),
325
+ message: Schema.String,
326
+ sender: Schema.String,
327
+ retryAfterSeconds: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })), Schema.Null]))
328
+ }),
329
+ Schema.Struct({
330
+ _tag: Schema.Literal("RateLimitedError"),
331
+ message: Schema.String,
332
+ retryAfterSeconds: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
333
+ }),
334
+ Schema.Struct({
335
+ _tag: Schema.Literal("OnboardingReviewRequiredError"),
336
+ message: Schema.String,
337
+ code: Schema.Union([
338
+ Schema.Literal("review_required"),
339
+ Schema.Literal("review_in_progress"),
340
+ Schema.Literal("information_required"),
341
+ Schema.Literal("review_rejected"),
342
+ Schema.Literal("identity_review_required"),
343
+ Schema.Literal("identity_review_rejected"),
344
+ Schema.Literal("identity_changed")
345
+ ]),
346
+ decision: Schema.Union([
347
+ Schema.Literal("undecided"),
348
+ Schema.Literal("approved"),
349
+ Schema.Literal("rejected")
350
+ ]),
351
+ stage: Schema.Union([
352
+ Schema.Literal("collecting"),
353
+ Schema.Literal("automated_review"),
354
+ Schema.Literal("manual_review"),
355
+ Schema.Literal("information_requested"),
356
+ Schema.Literal("complete")
357
+ ]),
358
+ nextAction: Schema.Union([
359
+ Schema.Literal("wait_for_review"),
360
+ Schema.Literal("provide_information"),
361
+ Schema.Literal("verify_sending_identity"),
362
+ Schema.Literal("reapply"),
363
+ Schema.Literal("contact_support")
364
+ ]),
365
+ identityId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
366
+ }),
367
+ Schema.Struct({
368
+ _tag: Schema.Literal("PaymentRequiredError"),
369
+ message: Schema.String,
370
+ resource: Schema.String,
371
+ currentUsage: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
372
+ limit: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
373
+ }),
374
+ Schema.Struct({
375
+ _tag: Schema.Literal("ValidationError"),
376
+ message: Schema.String,
377
+ fields: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.Array(Schema.String)), Schema.Null]))
378
+ }),
379
+ Schema.Struct({
380
+ _tag: Schema.Literal("ForbiddenError"),
381
+ message: Schema.String
382
+ }),
383
+ Schema.Struct({
384
+ _tag: Schema.Literal("ResourceNotFoundError"),
385
+ resource: Schema.String,
386
+ id: Schema.String,
387
+ message: Schema.String
388
+ })
389
+ ]).annotate({ identifier: "MailboxSendError" });
390
+ var OnboardingReviewRequiredError = class extends Schema.TaggedError()("OnboardingReviewRequiredError", Schema.Struct({
391
+ message: Schema.String,
392
+ code: Schema.Union([
393
+ Schema.Literal("review_required"),
394
+ Schema.Literal("review_in_progress"),
395
+ Schema.Literal("information_required"),
396
+ Schema.Literal("review_rejected"),
397
+ Schema.Literal("identity_review_required"),
398
+ Schema.Literal("identity_review_rejected"),
399
+ Schema.Literal("identity_changed")
400
+ ]),
401
+ decision: Schema.Union([
402
+ Schema.Literal("undecided"),
403
+ Schema.Literal("approved"),
404
+ Schema.Literal("rejected")
405
+ ]),
406
+ stage: Schema.Union([
407
+ Schema.Literal("collecting"),
408
+ Schema.Literal("automated_review"),
409
+ Schema.Literal("manual_review"),
410
+ Schema.Literal("information_requested"),
411
+ Schema.Literal("complete")
412
+ ]),
413
+ nextAction: Schema.Union([
414
+ Schema.Literal("wait_for_review"),
415
+ Schema.Literal("provide_information"),
416
+ Schema.Literal("verify_sending_identity"),
417
+ Schema.Literal("reapply"),
418
+ Schema.Literal("contact_support")
419
+ ]),
420
+ identityId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
421
+ })) {};
422
+ const MailboxThreadFolder = /* @__PURE__ */ Schema.Union([
423
+ Schema.Literal("inbox"),
424
+ Schema.Literal("assigned"),
425
+ Schema.Literal("pending"),
426
+ Schema.Literal("sent"),
427
+ Schema.Literal("archived"),
428
+ Schema.Literal("trash")
429
+ ]).annotate({ identifier: "MailboxThreadFolder" });
430
+ const MailboxGrantRole = /* @__PURE__ */ Schema.Union([
431
+ Schema.Literal("admin"),
432
+ Schema.Literal("collaborator"),
433
+ Schema.Literal("viewer")
434
+ ]).annotate({ identifier: "MailboxGrantRole" });
435
+ const MailboxLabelId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^label_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
436
+ expected: "a string matching the RegExp ^label_[0-9a-hjkmnp-tv-z]{16,24}$",
437
+ identifier: "MailboxLabelId"
438
+ })).pipe(Schema.brand("MailboxLabelId"));
439
+ const MailboxPolicyOutcomeKind = /* @__PURE__ */ Schema.Union([Schema.Literal("requireApproval"), Schema.Literal("deny")]).annotate({ identifier: "MailboxPolicyOutcomeKind" });
440
+ const MailboxThreadPriority = /* @__PURE__ */ Schema.Union([
441
+ Schema.Literal("low"),
442
+ Schema.Literal("normal"),
443
+ Schema.Literal("high"),
444
+ Schema.Literal("urgent")
445
+ ]).annotate({ identifier: "MailboxThreadPriority" });
446
+ const MessageMetadata = /* @__PURE__ */ Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]).annotate({ identifier: "MessageMetadata" });
447
+ const EmailSender = /* @__PURE__ */ Schema.Union([Schema.Struct({
448
+ email: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
449
+ name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
450
+ }), Schema.Null]).annotate({ identifier: "EmailSender" });
451
+ var DeliveryUnavailableError = class extends Schema.TaggedError()("DeliveryUnavailableError", Schema.Struct({
452
+ message: Schema.String,
453
+ retryAfterSeconds: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
454
+ })) {};
455
+ const IanaTimezone = /* @__PURE__ */ Schema.String.annotate({ identifier: "IanaTimezone" });
456
+ const NamespaceMetadata = /* @__PURE__ */ Schema.Record(Schema.String, Schema.String).annotate({
457
+ description: "Your own labels for the namespace, such as the id of your customer it serves. Samva stores them and never reads them.",
458
+ identifier: "NamespaceMetadata"
459
+ });
460
+ const OperationResource = /* @__PURE__ */ Schema.Struct({
461
+ type: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(80).annotate({ expected: "a string with at most 80 code points" })).check(Schema.isMaxLength(80).annotate({ expected: "a value with a length of at most 80" })),
462
+ id: 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" }))
463
+ }).annotate({ identifier: "OperationResource" });
464
+ const TemplateFromDefault = /* @__PURE__ */ Schema.Struct({
465
+ email: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
466
+ name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
467
+ }).annotate({ identifier: "TemplateFromDefault" });
468
+ const CreateTemplatePayload = /* @__PURE__ */ Schema.Struct({
469
+ 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" })),
470
+ projectName: Schema.optionalKey(Schema.Union([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" })), Schema.Null])),
471
+ slug: Schema.optionalKey(Schema.Union([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]+)*$" })), Schema.Null])),
472
+ galleryTemplateId: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).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])),
473
+ useBrand: Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ description: "With `galleryTemplateId`: whether the new project's `theme.css` imports the organization's default brand (`@import \"samva:brand\";`) over the starter's look. Defaults to false." }), Schema.Null])),
474
+ description: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
475
+ category: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Union([
476
+ Schema.Literal("transactional"),
477
+ Schema.Literal("marketing"),
478
+ Schema.Literal("support"),
479
+ Schema.Literal("notification"),
480
+ Schema.Literal("verification"),
481
+ Schema.Literal("reminder"),
482
+ Schema.Literal("alert")
483
+ ]), Schema.Null]), Schema.Null])),
484
+ isActive: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
485
+ 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" }))
486
+ }).annotate({ identifier: "CreateTemplatePayload" });
487
+ const TestWebhookPayload = /* @__PURE__ */ Schema.Struct({ data: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null])) }).annotate({ identifier: "TestWebhookPayload" });
488
+ const ApiKeyMailboxAccess = /* @__PURE__ */ Schema.Struct({
489
+ permissions: Schema.TupleWithRest(Schema.Tuple([Schema.Union([
490
+ Schema.Literal("read"),
491
+ Schema.Literal("update"),
492
+ Schema.Literal("send"),
493
+ Schema.Literal("quarantine.read")
494
+ ])]), [Schema.Union([
495
+ Schema.Literal("read"),
496
+ Schema.Literal("update"),
497
+ Schema.Literal("send"),
498
+ Schema.Literal("quarantine.read")
499
+ ])]).annotate({ description: "`read` reads mailboxes, threads, and messages; `update` changes thread state, labels, drafts, and notes; `send` sends and replies; `quarantine.read` reads quarantined mail." }),
500
+ 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." })),
501
+ 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." }))
502
+ }).annotate({ identifier: "ApiKeyMailboxAccess" });
503
+ const CreateWebhookPayload = /* @__PURE__ */ Schema.Struct({
504
+ 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" })),
505
+ url: Schema.String,
506
+ eventTypes: Schema.Array(Schema.Union([
507
+ Schema.Literal("message.sent"),
508
+ Schema.Literal("message.delivered"),
509
+ Schema.Literal("message.read"),
510
+ Schema.Literal("message.failed"),
511
+ Schema.Literal("message.bounced"),
512
+ Schema.Literal("message.complained"),
513
+ Schema.Literal("message.received"),
514
+ Schema.Literal("message.opened"),
515
+ Schema.Literal("message.clicked"),
516
+ Schema.Literal("contact.created"),
517
+ Schema.Literal("contact.updated"),
518
+ Schema.Literal("contact.deleted"),
519
+ Schema.Literal("contact.subscribed"),
520
+ Schema.Literal("contact.unsubscribed"),
521
+ Schema.Literal("contact.resubscribed"),
522
+ Schema.Literal("contact.consent_changed"),
523
+ Schema.Literal("conversation.created"),
524
+ Schema.Literal("conversation.updated"),
525
+ Schema.Literal("conversation.archived"),
526
+ Schema.Literal("webhook.created"),
527
+ Schema.Literal("webhook.updated"),
528
+ Schema.Literal("webhook.deleted"),
529
+ Schema.Literal("webhook.test"),
530
+ Schema.Literal("domain.updated"),
531
+ Schema.Literal("domain.warming.updated"),
532
+ Schema.Literal("mailbox.message.received"),
533
+ Schema.Literal("mailbox.message.sent"),
534
+ Schema.Literal("mailbox.action.pending_approval"),
535
+ Schema.Literal("mailbox.action.resolved"),
536
+ Schema.Literal("mailbox.message.quarantined"),
537
+ Schema.Literal("mailbox.message.released"),
538
+ Schema.Literal("mailbox.message.discarded"),
539
+ Schema.Literal("journey.webhook")
540
+ ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
541
+ channels: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Literal("email")).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null])),
542
+ mailboxIds: Schema.optionalKey(Schema.Union([Schema.TupleWithRest(Schema.Tuple([MailboxId]), [MailboxId]), Schema.Null])),
543
+ namespaceId: Schema.optionalKey(Schema.Union([NamespaceId, Schema.Null])),
544
+ headers: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null])),
545
+ status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]), Schema.Null]))
546
+ }).annotate({ identifier: "CreateWebhookPayload" });
547
+ const UpdateWebhookPayload = /* @__PURE__ */ Schema.Struct({
548
+ name: Schema.optionalKey(Schema.Union([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" })), Schema.Null])),
549
+ url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
550
+ eventTypes: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([
551
+ Schema.Literal("message.sent"),
552
+ Schema.Literal("message.delivered"),
553
+ Schema.Literal("message.read"),
554
+ Schema.Literal("message.failed"),
555
+ Schema.Literal("message.bounced"),
556
+ Schema.Literal("message.complained"),
557
+ Schema.Literal("message.received"),
558
+ Schema.Literal("message.opened"),
559
+ Schema.Literal("message.clicked"),
560
+ Schema.Literal("contact.created"),
561
+ Schema.Literal("contact.updated"),
562
+ Schema.Literal("contact.deleted"),
563
+ Schema.Literal("contact.subscribed"),
564
+ Schema.Literal("contact.unsubscribed"),
565
+ Schema.Literal("contact.resubscribed"),
566
+ Schema.Literal("contact.consent_changed"),
567
+ Schema.Literal("conversation.created"),
568
+ Schema.Literal("conversation.updated"),
569
+ Schema.Literal("conversation.archived"),
570
+ Schema.Literal("webhook.created"),
571
+ Schema.Literal("webhook.updated"),
572
+ Schema.Literal("webhook.deleted"),
573
+ Schema.Literal("webhook.test"),
574
+ Schema.Literal("domain.updated"),
575
+ Schema.Literal("domain.warming.updated"),
576
+ Schema.Literal("mailbox.message.received"),
577
+ Schema.Literal("mailbox.message.sent"),
578
+ Schema.Literal("mailbox.action.pending_approval"),
579
+ Schema.Literal("mailbox.action.resolved"),
580
+ Schema.Literal("mailbox.message.quarantined"),
581
+ Schema.Literal("mailbox.message.released"),
582
+ Schema.Literal("mailbox.message.discarded"),
583
+ Schema.Literal("journey.webhook")
584
+ ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null])),
585
+ channels: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Array(Schema.Literal("email")).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null]), Schema.Null])),
586
+ mailboxIds: Schema.optionalKey(Schema.Union([Schema.Union([Schema.TupleWithRest(Schema.Tuple([MailboxId]), [MailboxId]), Schema.Null]), Schema.Null])),
587
+ namespaceId: Schema.optionalKey(Schema.Union([Schema.Union([NamespaceId, Schema.Null]), Schema.Null])),
588
+ headers: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null])),
589
+ status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]), Schema.Null]))
590
+ }).annotate({ identifier: "UpdateWebhookPayload" });
591
+ const MessageSummary = /* @__PURE__ */ Schema.Struct({
592
+ id: MessageId,
593
+ channel: Schema.Literal("email"),
594
+ direction: Schema.Union([Schema.Literal("outbound"), Schema.Literal("inbound")]),
595
+ status: Schema.Union([
596
+ Schema.Literal("pending"),
597
+ Schema.Literal("scheduled"),
598
+ Schema.Literal("queued"),
599
+ Schema.Literal("processing"),
600
+ Schema.Literal("sent"),
601
+ Schema.Literal("delivered"),
602
+ Schema.Literal("read"),
603
+ Schema.Literal("failed"),
604
+ Schema.Literal("bounced"),
605
+ Schema.Literal("complained")
606
+ ]),
607
+ from: Schema.Union([Schema.String, Schema.Null]),
608
+ to: Schema.Array(Schema.String),
609
+ subject: Schema.Union([Schema.String, Schema.Null]),
610
+ waitReason: Schema.Union([Schema.Union([
611
+ Schema.Literal("rate"),
612
+ Schema.Literal("daily-quota"),
613
+ Schema.Literal("domain-health"),
614
+ Schema.Literal("sending-paused"),
615
+ Schema.Literal("upstream-unavailable"),
616
+ Schema.Literal("retry"),
617
+ Schema.Literal("campaign-paused"),
618
+ Schema.Literal("domain-warming"),
619
+ Schema.Literal("onboarding-review"),
620
+ Schema.Literal("content-review"),
621
+ Schema.Literal("screening-unavailable")
622
+ ]), Schema.Null]),
623
+ createdAt: Schema.String
624
+ }).annotate({ identifier: "MessageSummary" });
625
+ const BrandFooter = /* @__PURE__ */ Schema.Struct({
626
+ 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])),
627
+ address: Schema.optionalKey(Schema.Union([BrandAddress, Schema.Null])),
628
+ 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]))
629
+ }).annotate({ identifier: "BrandFooter" });
630
+ const EmailAttachment = /* @__PURE__ */ Schema.Struct({
631
+ filename: Schema.String,
632
+ content: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
633
+ mediaId: Schema.optionalKey(Schema.Union([MediaId, Schema.Null])),
634
+ contentType: Schema.String,
635
+ size: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(26214400).annotate({ expected: "a value less than or equal to 26214400" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" }))
636
+ }).annotate({ identifier: "EmailAttachment" });
637
+ const TemplateData = /* @__PURE__ */ Schema.Union([JsonObject, Schema.Null]).annotate({ identifier: "TemplateData" });
638
+ const ContactConsent = /* @__PURE__ */ Schema.Struct({
639
+ status: Schema.Union([Schema.Literal("opted_in"), Schema.Literal("opted_out")]),
640
+ source: Schema.String,
641
+ capturedAt: Schema.String,
642
+ proof: Schema.Union([JsonObject, Schema.Null])
643
+ }).annotate({ identifier: "ContactConsent" });
644
+ const JourneyWebhookConfig = /* @__PURE__ */ Schema.Struct({ data: Schema.optionalKey(JsonObject) }).annotate({ identifier: "JourneyWebhookConfig" });
645
+ const SkippedRecipient = /* @__PURE__ */ Schema.Struct({
646
+ address: Schema.String,
647
+ reason: Schema.Union([
648
+ Schema.Literal("bounce"),
649
+ Schema.Literal("complaint"),
650
+ Schema.Literal("unsubscribe"),
651
+ Schema.Literal("manual"),
652
+ Schema.Literal("group-unsubscribe")
653
+ ]),
654
+ unsubscribeGroupId: Schema.optionalKey(Schema.Union([UnsubscribeId, Schema.Null]))
655
+ }).annotate({ identifier: "SkippedRecipient" });
656
+ const ContactEvent = /* @__PURE__ */ Schema.Struct({
657
+ id: Schema.String,
658
+ contactId: ContactId,
659
+ name: Schema.String,
660
+ source: Schema.Union([Schema.Literal("api"), Schema.Literal("samva")]),
661
+ properties: JsonObject,
662
+ occurredAt: Schema.String,
663
+ recordedAt: Schema.String
664
+ }).annotate({ identifier: "ContactEvent" });
665
+ const ContactEventReference = /* @__PURE__ */ Schema.Union([
666
+ Schema.Struct({
667
+ id: ContactId,
668
+ externalId: Schema.optionalKey(Schema.Never),
669
+ email: Schema.optionalKey(Schema.Never)
670
+ }),
671
+ Schema.Struct({
672
+ externalId: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
673
+ id: Schema.optionalKey(Schema.Never),
674
+ email: Schema.optionalKey(Schema.Never)
675
+ }),
676
+ Schema.Struct({
677
+ email: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", "u")).annotate({ expected: "a string matching the RegExp ^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$" })),
678
+ id: Schema.optionalKey(Schema.Never),
679
+ externalId: Schema.optionalKey(Schema.Never)
680
+ })
681
+ ]).annotate({ identifier: "ContactEventReference" });
682
+ const EmailRecipient = /* @__PURE__ */ Schema.Union([Schema.Struct({ contactId: ContactId }), Schema.Struct({
683
+ email: Schema.String,
684
+ name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
685
+ displayName: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null]))
686
+ })]).annotate({ identifier: "EmailRecipient" });
687
+ const JourneyGroupJoinedTrigger = /* @__PURE__ */ Schema.Struct({
688
+ type: Schema.Literal("contact.joined_group"),
689
+ groupId: ContactGroupId
690
+ }).annotate({ identifier: "JourneyGroupJoinedTrigger" });
691
+ const JourneySendEmailConfig = /* @__PURE__ */ Schema.Struct({
692
+ 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]+)*$" }))]),
693
+ senderId: Schema.optionalKey(EmailSenderId),
694
+ templateData: Schema.optionalKey(JsonObject)
695
+ }).annotate({ identifier: "JourneySendEmailConfig" });
696
+ const ExtensionVersionRef = /* @__PURE__ */ Schema.Struct({
697
+ id: ExtensionVersionId,
698
+ version: Schema.String
699
+ }).annotate({ identifier: "ExtensionVersionRef" });
700
+ const SendFeedback = /* @__PURE__ */ Schema.Struct({
701
+ message: Schema.String.annotate({ description: "What happened and what you expected, in plain language (at most 4000 characters)." }).check(Schema.isMaxCodePoints(4e3).annotate({ expected: "a string with at most 4000 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("\\S", "u")).annotate({ expected: "a string matching the RegExp \\S" })).check(Schema.isMaxLength(4e3).annotate({ expected: "a value with a length of at most 4000" })),
702
+ category: Schema.optionalKey(Schema.Union([Schema.Union([
703
+ Schema.Literal("bug"),
704
+ Schema.Literal("confusing"),
705
+ Schema.Literal("missing"),
706
+ Schema.Literal("other")
707
+ ]).annotate({ description: "`bug`: the API behaved wrongly. `confusing`: a response, error, or doc was hard to act on. `missing`: a capability or field you needed does not exist. `other`: anything else." }), Schema.Null])),
708
+ context: Schema.optionalKey(Schema.Union([FeedbackContext, Schema.Null]))
709
+ }).annotate({ identifier: "SendFeedback" });
710
+ const JourneyCustomEventTrigger = /* @__PURE__ */ Schema.Struct({
711
+ type: Schema.Literal("event"),
712
+ eventName: JourneyCustomEventName
713
+ }).annotate({ identifier: "JourneyCustomEventTrigger" });
714
+ const JourneyEventName = /* @__PURE__ */ Schema.Union([JourneyCustomEventName, Schema.Union([
715
+ Schema.Literal("contact.created"),
716
+ Schema.Literal("contact.tag_added"),
717
+ Schema.Literal("contact.joined_group")
718
+ ])]).annotate({ identifier: "JourneyEventName" });
719
+ const JourneyNextEdge = /* @__PURE__ */ Schema.Struct({ nodeId: JourneyNodeId }).annotate({ identifier: "JourneyNextEdge" });
720
+ const JourneyWaitEventEdge = /* @__PURE__ */ Schema.Struct({
721
+ nodeId: JourneyNodeId,
722
+ outcome: Schema.Union([Schema.Literal("matched"), Schema.Literal("timed_out")])
723
+ }).annotate({ identifier: "JourneyWaitEventEdge" });
724
+ const JourneyExitNode = /* @__PURE__ */ Schema.Struct({
725
+ type: Schema.Literal("exit"),
726
+ config: JourneyEmptyConfig,
727
+ next: Schema.Tuple([])
728
+ }).annotate({ identifier: "JourneyExitNode" });
729
+ const JourneyComparison = /* @__PURE__ */ Schema.Union([
730
+ JourneyEqualityComparison,
731
+ JourneyNumericComparison,
732
+ JourneyStringComparison,
733
+ JourneyPresenceComparison
734
+ ]).annotate({ identifier: "JourneyComparison" });
735
+ const CreateMailboxEndpointPayload = /* @__PURE__ */ Schema.Struct({
736
+ channel: MailboxChannel,
737
+ address: Schema.String,
738
+ displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
739
+ }).annotate({ identifier: "CreateMailboxEndpointPayload" });
740
+ const MailboxActionDecision = /* @__PURE__ */ Schema.Struct({
741
+ outcome: Schema.Union([
742
+ Schema.Literal("allow"),
743
+ Schema.Literal("requireApproval"),
744
+ Schema.Literal("deny")
745
+ ]),
746
+ reason: Schema.Union([Schema.String, Schema.Null]),
747
+ policyId: Schema.Union([MailboxPolicyId, Schema.Null]),
748
+ source: Schema.Union([Schema.Union([
749
+ Schema.Literal("grant"),
750
+ Schema.Literal("installation"),
751
+ Schema.Literal("policy")
752
+ ]), Schema.Null]),
753
+ decidedAt: Schema.String
754
+ }).annotate({ identifier: "MailboxActionDecision" });
755
+ const MailboxSendOutcome = /* @__PURE__ */ Schema.Struct({
756
+ code: Schema.String,
757
+ message: Schema.String,
758
+ error: Schema.optionalKey(Schema.Union([MailboxSendError, Schema.Null]))
759
+ }).annotate({ identifier: "MailboxSendOutcome" });
760
+ const Operation = /* @__PURE__ */ Schema.Struct({
761
+ id: OperationId,
762
+ organizationId: Schema.String,
763
+ kind: Schema.Union([Schema.Literal("email-domain-provisioning"), Schema.Literal("organization-deletion")]),
764
+ subject: OperationResource,
765
+ actor: Schema.Struct({
766
+ type: Schema.Union([
767
+ Schema.Literal("user"),
768
+ Schema.Literal("api-key"),
769
+ Schema.Literal("system")
770
+ ]),
771
+ id: Schema.String
772
+ }),
773
+ status: Schema.Union([
774
+ Schema.Literal("pending"),
775
+ Schema.Literal("running"),
776
+ Schema.Literal("succeeded"),
777
+ Schema.Literal("failed")
778
+ ]),
779
+ phase: Schema.Union([
780
+ Schema.Literal("accepted"),
781
+ Schema.Literal("dispatching"),
782
+ Schema.Literal("provisioning"),
783
+ Schema.Literal("deleting"),
784
+ Schema.Literal("finalizing"),
785
+ Schema.Literal("completed")
786
+ ]),
787
+ error: Schema.Union([Schema.Struct({
788
+ code: Schema.Union([
789
+ Schema.Literal("validation-failed"),
790
+ Schema.Literal("conflict"),
791
+ Schema.Literal("capacity-unavailable"),
792
+ Schema.Literal("rejected"),
793
+ Schema.Literal("unavailable"),
794
+ Schema.Literal("timed-out"),
795
+ Schema.Literal("internal")
796
+ ]),
797
+ message: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(240).annotate({ expected: "a string with at most 240 code points" })).check(Schema.isMaxLength(240).annotate({ expected: "a value with a length of at most 240" }))
798
+ }), Schema.Null]),
799
+ createdAt: Schema.String,
800
+ updatedAt: Schema.String,
801
+ startedAt: Schema.Union([Schema.String, Schema.Null]),
802
+ completedAt: Schema.Union([Schema.String, Schema.Null])
803
+ }).annotate({ identifier: "Operation" });
804
+ const OperationResourceLink = /* @__PURE__ */ Schema.Struct({
805
+ resource: OperationResource,
806
+ href: Schema.String.check(Schema.isMaxCodePoints(500).annotate({ expected: "a string with at most 500 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^\\/v1\\/", "u")).annotate({ expected: "a string matching the RegExp ^\\/v1\\/" })).check(Schema.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" }))
807
+ }).annotate({ identifier: "OperationResourceLink" });
808
+ const UpdateTemplatePayload = /* @__PURE__ */ Schema.Struct({ data: Schema.Struct({
809
+ name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
810
+ slug: Schema.optionalKey(Schema.Union([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]+)*$" })), Schema.Null])),
811
+ entryPath: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(1024).annotate({ expected: "a string with at most 1024 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^(?!\\/)(?!.*\\\\)(?!.*(?:^|\\/)\\.{1,2}(?:\\/|$))(?!.*(?:^|\\/)\\.git(?:\\/|$))(?:templates|emails)\\/.+\\.tsx$", "u")).annotate({ expected: "a string matching the RegExp ^(?!\\/)(?!.*\\\\)(?!.*(?:^|\\/)\\.{1,2}(?:\\/|$))(?!.*(?:^|\\/)\\.git(?:\\/|$))(?:templates|emails)\\/.+\\.tsx$" })).check(Schema.isMaxLength(1024).annotate({ expected: "a value with a length of at most 1024" })), Schema.Null])),
812
+ description: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
813
+ category: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Union([
814
+ Schema.Literal("transactional"),
815
+ Schema.Literal("marketing"),
816
+ Schema.Literal("support"),
817
+ Schema.Literal("notification"),
818
+ Schema.Literal("verification"),
819
+ Schema.Literal("reminder"),
820
+ Schema.Literal("alert")
821
+ ]), Schema.Null]), Schema.Null])),
822
+ fromDefault: Schema.optionalKey(Schema.Union([Schema.Union([TemplateFromDefault, Schema.Null]), Schema.Null])),
823
+ replyToDefault: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Array(Schema.String), Schema.Null]), Schema.Null])),
824
+ isActive: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
825
+ }) }).annotate({ identifier: "UpdateTemplatePayload" });
826
+ const ApiKeyAccess = /* @__PURE__ */ Schema.Union([Schema.Struct({ mode: Schema.Literal("full") }), Schema.Struct({
827
+ mode: Schema.Literal("restricted"),
828
+ resources: ApiKeyResourceAccess,
829
+ mailboxes: Schema.optionalKey(Schema.Union([ApiKeyMailboxAccess, Schema.Null])),
830
+ namespaceId: Schema.optionalKey(Schema.Union([NamespaceId, Schema.Null]).annotate({ description: "Confines the key to one namespace: it reaches only that namespace's mailboxes. A key scoped to a namespace or to listed mailboxes holds mailbox access only." }))
831
+ })]).annotate({ identifier: "ApiKeyAccess" });
832
+ const MessagePage = /* @__PURE__ */ Schema.Struct({
833
+ items: Schema.Array(MessageSummary),
834
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
835
+ }).annotate({ identifier: "MessagePage" });
836
+ const CreateBrand = /* @__PURE__ */ Schema.Struct({
837
+ 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])?$" })),
838
+ 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" })),
839
+ css: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(32768).annotate({ expected: "a string with at most 32768 code points" })).check(Schema.isMaxLength(32768).annotate({ expected: "a value with a length of at most 32768" })), Schema.Null])),
840
+ assets: Schema.optionalKey(Schema.Union([BrandAssets, Schema.Null])),
841
+ footer: Schema.optionalKey(Schema.Union([BrandFooter, Schema.Null])),
842
+ isDefault: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
843
+ }).annotate({ identifier: "CreateBrand" });
844
+ const UpdateBrand = /* @__PURE__ */ Schema.Struct({
845
+ newSlug: Schema.optionalKey(Schema.Union([Schema.String.annotate({ description: "Renames the brand. Projects importing `samva:brand/<old slug>` stop building until they import the new slug." }).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])?$" })), Schema.Null])),
846
+ name: Schema.optionalKey(Schema.Union([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" })), Schema.Null])),
847
+ css: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(32768).annotate({ expected: "a string with at most 32768 code points" })).check(Schema.isMaxLength(32768).annotate({ expected: "a value with a length of at most 32768" })), Schema.Null])),
848
+ assets: Schema.optionalKey(Schema.Union([BrandAssets, Schema.Null])),
849
+ footer: Schema.optionalKey(Schema.Union([BrandFooter, Schema.Null]))
850
+ }).annotate({ identifier: "UpdateBrand" });
851
+ const EmailAttachments = /* @__PURE__ */ Schema.Union([Schema.Array(EmailAttachment).check(Schema.isMaxLength(10).annotate({ expected: "a value with a length of at most 10" })), Schema.Null]).annotate({ identifier: "EmailAttachments" });
852
+ const ContactIdentityChannel = /* @__PURE__ */ Schema.Struct({
853
+ channel: Schema.Literal("email"),
854
+ reachability: Schema.Union([
855
+ Schema.Literal("unknown"),
856
+ Schema.Literal("reachable"),
857
+ Schema.Literal("unreachable")
858
+ ]),
859
+ consent: Schema.Union([ContactConsent, Schema.Null])
860
+ }).annotate({ identifier: "ContactIdentityChannel" });
861
+ const CreateEventPayload = /* @__PURE__ */ Schema.Struct({
862
+ contact: ContactEventReference,
863
+ name: 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" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$")).annotate({ expected: "a string matching the RegExp ^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$" })),
864
+ properties: Schema.optionalKey(Schema.Union([JsonObject, Schema.Null])),
865
+ occurredAt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
866
+ idempotencyKey: Schema.optionalKey(Schema.Union([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" })), Schema.Null]))
867
+ }).annotate({ identifier: "CreateEventPayload" });
868
+ const EmailRecipients = /* @__PURE__ */ Schema.Array(EmailRecipient).check(Schema.isMinLength(1).annotate({
869
+ expected: "a value with a length of at least 1",
870
+ identifier: "EmailRecipients"
871
+ }));
872
+ const EmailCcRecipients = /* @__PURE__ */ Schema.Union([Schema.Union([Schema.Array(EmailRecipient), Schema.Null]), Schema.Null]).annotate({ identifier: "EmailCcRecipients" });
873
+ const EmailBccRecipients = /* @__PURE__ */ Schema.Union([Schema.Union([Schema.Array(EmailRecipient), Schema.Null]), Schema.Null]).annotate({ identifier: "EmailBccRecipients" });
874
+ const JourneyTrigger = /* @__PURE__ */ Schema.Union([
875
+ JourneyCustomEventTrigger,
876
+ JourneyContactCreatedTrigger,
877
+ JourneyTagAddedTrigger,
878
+ JourneyGroupJoinedTrigger
879
+ ]).annotate({ identifier: "JourneyTrigger" });
880
+ const JourneyWaitForEventConfig = /* @__PURE__ */ Schema.Struct({
881
+ eventName: JourneyEventName,
882
+ timeoutSeconds: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(7776e3).annotate({ expected: "a value less than or equal to 7776000" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" }))
883
+ }).annotate({ identifier: "JourneyWaitForEventConfig" });
884
+ const JourneyEventPredicate = /* @__PURE__ */ Schema.Struct({
885
+ type: Schema.Literal("event"),
886
+ eventName: JourneyEventName,
887
+ occurred: Schema.Boolean
888
+ }).annotate({ identifier: "JourneyEventPredicate" });
889
+ const JourneyGoal = /* @__PURE__ */ Schema.Struct({ eventName: JourneyEventName }).annotate({ identifier: "JourneyGoal" });
890
+ const JourneySendEmailNode = /* @__PURE__ */ Schema.Struct({
891
+ type: Schema.Literal("send_email"),
892
+ config: JourneySendEmailConfig,
893
+ next: Schema.Tuple([JourneyNextEdge])
894
+ }).annotate({ identifier: "JourneySendEmailNode" });
895
+ const JourneyWaitNode = /* @__PURE__ */ Schema.Struct({
896
+ type: Schema.Literal("wait"),
897
+ config: JourneyWaitConfig,
898
+ next: Schema.Tuple([JourneyNextEdge])
899
+ }).annotate({ identifier: "JourneyWaitNode" });
900
+ const JourneyUpdateTagsNode = /* @__PURE__ */ Schema.Struct({
901
+ type: Schema.Literal("update_tags"),
902
+ config: JourneyUpdateTagsConfig,
903
+ next: Schema.Tuple([JourneyNextEdge])
904
+ }).annotate({ identifier: "JourneyUpdateTagsNode" });
905
+ const JourneyWebhookNode = /* @__PURE__ */ Schema.Struct({
906
+ type: Schema.Literal("webhook"),
907
+ config: JourneyWebhookConfig,
908
+ next: Schema.Tuple([JourneyNextEdge])
909
+ }).annotate({ identifier: "JourneyWebhookNode" });
910
+ const JourneyPropertyPredicate = /* @__PURE__ */ Schema.Struct({
911
+ type: Schema.Literal("property"),
912
+ field: JourneyContactProperty,
913
+ comparison: JourneyComparison
914
+ }).annotate({ identifier: "JourneyPropertyPredicate" });
915
+ const JourneyCustomFieldPredicate = /* @__PURE__ */ Schema.Struct({
916
+ type: Schema.Literal("custom_field"),
917
+ key: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
918
+ comparison: JourneyComparison
919
+ }).annotate({ identifier: "JourneyCustomFieldPredicate" });
920
+ const MailboxSendReceipt = /* @__PURE__ */ Schema.Struct({
921
+ actionId: MailboxActionId,
922
+ draftId: Schema.Union([MailboxDraftId, Schema.Null]),
923
+ messageId: Schema.Union([MessageId, Schema.Null]),
924
+ threadId: Schema.Union([MailboxThreadId, Schema.Null]),
925
+ state: Schema.Union([
926
+ Schema.Literal("approvalRequired"),
927
+ Schema.Literal("queued"),
928
+ Schema.Literal("accepted"),
929
+ Schema.Literal("completed"),
930
+ Schema.Literal("notSent"),
931
+ Schema.Literal("uncertain")
932
+ ]),
933
+ acceptedAt: Schema.Union([Schema.String, Schema.Null]),
934
+ waitReason: Schema.Union([Schema.Union([
935
+ Schema.Literal("rate"),
936
+ Schema.Literal("daily-quota"),
937
+ Schema.Literal("domain-health"),
938
+ Schema.Literal("sending-paused"),
939
+ Schema.Literal("upstream-unavailable"),
940
+ Schema.Literal("retry"),
941
+ Schema.Literal("campaign-paused"),
942
+ Schema.Literal("domain-warming"),
943
+ Schema.Literal("onboarding-review"),
944
+ Schema.Literal("content-review"),
945
+ Schema.Literal("screening-unavailable")
946
+ ]), Schema.Null]),
947
+ reviewExpectedAt: Schema.Union([Schema.String, Schema.Null]),
948
+ skippedRecipients: Schema.Array(SkippedRecipient),
949
+ executeUntil: Schema.Union([Schema.String, Schema.Null]),
950
+ retryAt: Schema.Union([Schema.String, Schema.Null]),
951
+ problem: Schema.Union([MailboxSendOutcome, Schema.Null]),
952
+ retryEligible: Schema.Boolean,
953
+ decision: Schema.Union([MailboxActionDecision, Schema.Null]),
954
+ createdAt: Schema.String,
955
+ updatedAt: Schema.String
956
+ }).annotate({ identifier: "MailboxSendReceipt" });
957
+ const OperationAccepted = /* @__PURE__ */ Schema.Struct({
958
+ operation: Operation,
959
+ links: Schema.Struct({
960
+ self: Schema.String.check(Schema.isMaxCodePoints(500).annotate({ expected: "a string with at most 500 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^\\/v1\\/", "u")).annotate({ expected: "a string matching the RegExp ^\\/v1\\/" })).check(Schema.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" })),
961
+ resource: OperationResourceLink
962
+ })
963
+ }).annotate({ identifier: "OperationAccepted" });
964
+ const EmailContent = /* @__PURE__ */ Schema.Struct({
965
+ subject: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
966
+ html: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
967
+ text: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
968
+ attachments: Schema.optionalKey(EmailAttachments),
969
+ publicationId: Schema.optionalKey(TemplatePublicationId),
970
+ inputContractId: Schema.optionalKey(TemplateInputContractId),
971
+ templateId: Schema.optionalKey(Schema.Union([TemplateId, Schema.Null])),
972
+ templateSlug: Schema.optionalKey(Schema.Union([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]+)*$" })), Schema.Null])),
973
+ templateData: Schema.optionalKey(TemplateData),
974
+ locale: Schema.optionalKey(RenderLocale),
975
+ timeZone: Schema.optionalKey(RenderTimeZone),
976
+ inReplyToMessageId: Schema.optionalKey(Schema.Union([MessageId, Schema.Null])),
977
+ replyTo: Schema.optionalKey(ReplyToAddresses),
978
+ 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." })),
979
+ tracking: Schema.optionalKey(EmailTrackingOverrideV1),
980
+ footer: Schema.optionalKey(EmailFooterOverride)
981
+ }).annotate({ identifier: "EmailContent" });
982
+ const EmailDispatchContent = /* @__PURE__ */ Schema.Struct({
983
+ subject: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
984
+ html: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
985
+ text: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
986
+ attachments: Schema.optionalKey(EmailAttachments),
987
+ publicationId: Schema.optionalKey(TemplatePublicationId),
988
+ inputContractId: Schema.optionalKey(TemplateInputContractId),
989
+ templateId: Schema.optionalKey(Schema.Union([TemplateId, Schema.Null])),
990
+ templateSlug: Schema.optionalKey(Schema.Union([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]+)*$" })), Schema.Null])),
991
+ templateData: Schema.optionalKey(TemplateData),
992
+ locale: Schema.optionalKey(RenderLocale),
993
+ timeZone: Schema.optionalKey(RenderTimeZone),
994
+ inReplyToMessageId: Schema.optionalKey(Schema.Union([MessageId, Schema.Null])),
995
+ replyTo: Schema.optionalKey(ReplyToAddresses),
996
+ 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." })),
997
+ tracking: Schema.optionalKey(EmailTrackingOverrideV1),
998
+ footer: Schema.optionalKey(EmailFooterOverride)
999
+ }).annotate({ identifier: "EmailDispatchContent" });
1000
+ const ContactIdentity = /* @__PURE__ */ Schema.Struct({
1001
+ id: ContactIdentityId,
1002
+ type: Schema.Union([Schema.Literal("email"), Schema.Literal("phone")]),
1003
+ identifier: Schema.String,
1004
+ verified: Schema.Boolean,
1005
+ channels: Schema.Array(ContactIdentityChannel)
1006
+ }).annotate({ identifier: "ContactIdentity" });
1007
+ const JourneyWaitForEventNode = /* @__PURE__ */ Schema.Struct({
1008
+ type: Schema.Literal("wait_for_event"),
1009
+ config: JourneyWaitForEventConfig,
1010
+ next: Schema.Tuple([JourneyWaitEventEdge, JourneyWaitEventEdge])
1011
+ }).annotate({ identifier: "JourneyWaitForEventNode" });
1012
+ const JourneyPredicate = /* @__PURE__ */ Schema.Union([
1013
+ JourneyTagPredicate,
1014
+ JourneyPropertyPredicate,
1015
+ JourneyCustomFieldPredicate,
1016
+ JourneyEventPredicate
1017
+ ]).annotate({ identifier: "JourneyPredicate" });
1018
+ var MailboxSendRefusedError = class extends Schema.TaggedError()("MailboxSendRefusedError", Schema.Struct({
1019
+ message: Schema.String,
1020
+ receipt: MailboxSendReceipt
1021
+ })) {};
1022
+ var MailboxSendConflictError = class extends Schema.TaggedError()("MailboxSendConflictError", Schema.Struct({
1023
+ message: Schema.String,
1024
+ resource: Schema.String,
1025
+ id: MailboxActionId,
1026
+ receipt: MailboxSendReceipt
1027
+ })) {};
1028
+ const JourneyCondition = /* @__PURE__ */ Schema.Struct({
1029
+ match: Schema.Union([Schema.Literal("all"), Schema.Literal("any")]),
1030
+ predicates: Schema.TupleWithRest(Schema.Tuple([JourneyPredicate]), [JourneyPredicate])
1031
+ }).annotate({ identifier: "JourneyCondition" });
1032
+ const JourneyBranchEdge = /* @__PURE__ */ Schema.Struct({
1033
+ nodeId: JourneyNodeId,
1034
+ condition: Schema.optionalKey(JourneyCondition)
1035
+ }).annotate({ identifier: "JourneyBranchEdge" });
1036
+ const JourneyBranchNode = /* @__PURE__ */ Schema.Struct({
1037
+ type: Schema.Literal("branch"),
1038
+ config: JourneyEmptyConfig,
1039
+ next: Schema.Array(JourneyBranchEdge).check(Schema.isMinLength(2).annotate({ expected: "a value with a length of at least 2" }))
1040
+ }).annotate({ identifier: "JourneyBranchNode" });
1041
+ const JourneyNode = /* @__PURE__ */ Schema.Union([
1042
+ JourneySendEmailNode,
1043
+ JourneyWaitNode,
1044
+ JourneyWaitForEventNode,
1045
+ JourneyBranchNode,
1046
+ JourneyUpdateTagsNode,
1047
+ JourneyWebhookNode,
1048
+ JourneyExitNode
1049
+ ]).annotate({ identifier: "JourneyNode" });
1050
+ const JourneyDefinition = /* @__PURE__ */ Schema.Struct({
1051
+ trigger: JourneyTrigger,
1052
+ rootNodeId: JourneyNodeId,
1053
+ nodes: Schema.Record(Schema.String, JourneyNode).check(Schema.isMinProperties(1).annotate({ expected: "a value with at least 1 entry" })).check(Schema.isMaxProperties(200).annotate({ expected: "a value with at most 200 entries" })),
1054
+ goal: Schema.optionalKey(JourneyGoal),
1055
+ reentry: Schema.optionalKey(Schema.Boolean)
1056
+ }).annotate({ identifier: "JourneyDefinition" });
1057
+ const __recursive_JsonValue = Schema.Union([
1058
+ Schema.String,
1059
+ Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
1060
+ Schema.Boolean,
1061
+ Schema.Null,
1062
+ Schema.Array(Schema.suspend(() => JsonValue)),
1063
+ Schema.Record(Schema.String, Schema.suspend(() => JsonValue))
1064
+ ]).annotate({ identifier: "JsonValue" });
1065
+ const ApiKeySecurity = HttpApiSecurity.apiKey({
1066
+ key: "x-api-key",
1067
+ in: "header"
1068
+ });
1069
+ var ApiKeySecurityMiddleware = class extends HttpApiMiddleware.Service()("apiKey security", { security: { apiKey: ApiKeySecurity } }) {};
1070
+ //#endregion
1071
+ 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, EmailDispatchContent, EmailDomainId, EmailFooterOverride, EmailRecipient, EmailRecipients, EmailSender, EmailSenderId, EmailTrackingOverrideV1, ExtensionId, ExtensionVersionId, ExtensionVersionRef, ExternalServiceError, FeedbackContext, FlagDisabledError, ForbiddenError, 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, MailboxChannelUnsupportedError, 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, OnboardingReviewRequiredError, Operation, OperationAccepted, OperationId, OperationResource, OperationResourceLink, OrganizationId, PaymentRequiredError, RateLimitedError, RenderLocale, RenderTimeZone, ReplyToAddresses, ResourceNotFoundError, SendFeedback, SenderNotReadyError, SendsSeries, SkippedRecipient, SuccessResponse, TemplateData, TemplateFromDefault, TemplateId, TemplateInputContractId, TemplatePublicationId, TestWebhookPayload, UnauthorizedError, UnsubscribeId, UpdateBrand, UpdateTemplatePayload, UpdateWebhookPayload, UserId, ValidationError, WebhookEndpointId, AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, SensitiveString as __SamvaRuntimeSensitiveString };
1072
+
1073
+ //# sourceMappingURL=shared.js.map