samva 0.27.0 → 0.28.1

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 (105) 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 +604 -95
  5. package/dist/client/types.gen.d.ts +1342 -479
  6. package/dist/effect/agents.d.ts +6 -8
  7. package/dist/effect/analytics.d.ts +1 -1
  8. package/dist/effect/api-keys.d.ts +6 -6
  9. package/dist/effect/attachments.d.ts +1 -1
  10. package/dist/effect/brands.d.ts +2 -0
  11. package/dist/effect/campaigns.d.ts +275 -25
  12. package/dist/effect/campaigns.js +7 -1
  13. package/dist/effect/contact-groups.d.ts +9 -9
  14. package/dist/effect/contacts.d.ts +74 -81
  15. package/dist/effect/contacts.js +7 -3
  16. package/dist/effect/conversations.d.ts +14 -6
  17. package/dist/effect/email.d.ts +34 -34
  18. package/dist/effect/errors.d.ts +1 -1
  19. package/dist/effect/errors.js +2 -2
  20. package/dist/effect/extension-installations.d.ts +3 -3
  21. package/dist/effect/extensions.d.ts +6 -6
  22. package/dist/effect/generated/agents.d.ts +6 -28
  23. package/dist/effect/generated/agents.js +2 -3
  24. package/dist/effect/generated/analytics.d.ts +3 -3
  25. package/dist/effect/generated/analytics.js +1 -1
  26. package/dist/effect/generated/api-keys.d.ts +6 -6
  27. package/dist/effect/generated/api-keys.js +2 -2
  28. package/dist/effect/generated/attachments.d.ts +3 -3
  29. package/dist/effect/generated/attachments.js +1 -1
  30. package/dist/effect/generated/brands.d.ts +16 -0
  31. package/dist/effect/generated/campaigns.d.ts +1181 -302
  32. package/dist/effect/generated/campaigns.js +169 -36
  33. package/dist/effect/generated/contact-events.d.ts +3 -3
  34. package/dist/effect/generated/contact-events.js +1 -1
  35. package/dist/effect/generated/contact-groups.d.ts +9 -9
  36. package/dist/effect/generated/contact-groups.js +7 -7
  37. package/dist/effect/generated/contacts.d.ts +2063 -290
  38. package/dist/effect/generated/contacts.js +343 -75
  39. package/dist/effect/generated/conversations.d.ts +14 -6
  40. package/dist/effect/generated/conversations.js +6 -6
  41. package/dist/effect/generated/email.d.ts +40 -40
  42. package/dist/effect/generated/email.js +15 -15
  43. package/dist/effect/generated/extension-installations.d.ts +3 -3
  44. package/dist/effect/generated/extension-installations.js +1 -1
  45. package/dist/effect/generated/extensions.d.ts +6 -6
  46. package/dist/effect/generated/extensions.js +2 -2
  47. package/dist/effect/generated/index.d.ts +5 -3
  48. package/dist/effect/generated/journeys.d.ts +9 -9
  49. package/dist/effect/generated/journeys.js +3 -3
  50. package/dist/effect/generated/mailboxes.d.ts +172 -124
  51. package/dist/effect/generated/mailboxes.js +22 -14
  52. package/dist/effect/generated/messages.d.ts +53 -29
  53. package/dist/effect/generated/messages.js +9 -5
  54. package/dist/effect/generated/namespaces.d.ts +3 -3
  55. package/dist/effect/generated/namespaces.js +1 -1
  56. package/dist/effect/generated/operations.d.ts +3 -3
  57. package/dist/effect/generated/operations.js +1 -1
  58. package/dist/effect/generated/organizations.d.ts +0 -9
  59. package/dist/effect/generated/organizations.js +1 -4
  60. package/dist/effect/generated/scheduled-messages.d.ts +69 -20
  61. package/dist/effect/generated/scheduled-messages.js +22 -3
  62. package/dist/effect/generated/shared.d.ts +396 -107
  63. package/dist/effect/generated/shared.js +170 -89
  64. package/dist/effect/generated/subscriptions.d.ts +4 -7
  65. package/dist/effect/generated/subscriptions.js +3 -4
  66. package/dist/effect/generated/templates.d.ts +71 -407
  67. package/dist/effect/generated/templates.js +23 -23
  68. package/dist/effect/generated/topic-forms.d.ts +656 -0
  69. package/dist/effect/generated/topic-forms.js +145 -0
  70. package/dist/effect/generated/{unsubscribe-groups.d.ts → topics.d.ts} +640 -435
  71. package/dist/effect/generated/topics.js +267 -0
  72. package/dist/effect/generated/webhooks.d.ts +6 -6
  73. package/dist/effect/generated/webhooks.js +2 -2
  74. package/dist/effect/generated-metadata.d.ts +78 -24
  75. package/dist/effect/generated-metadata.js +61 -27
  76. package/dist/effect/index.d.ts +2 -1
  77. package/dist/effect/index.js +4 -3
  78. package/dist/effect/internal/operation.js +3 -3
  79. package/dist/effect/internal/send.d.ts +4 -4
  80. package/dist/effect/journeys.d.ts +7 -7
  81. package/dist/effect/mailboxes.d.ts +137 -121
  82. package/dist/effect/messages.d.ts +19 -11
  83. package/dist/effect/namespaces.d.ts +3 -3
  84. package/dist/effect/operations.d.ts +3 -3
  85. package/dist/effect/scheduled-messages.d.ts +6 -6
  86. package/dist/effect/subscriptions.d.ts +1 -2
  87. package/dist/effect/templates.d.ts +13 -13
  88. package/dist/effect/topic-forms.d.ts +30 -0
  89. package/dist/effect/topic-forms.js +21 -0
  90. package/dist/effect/topics.d.ts +94 -0
  91. package/dist/effect/topics.js +29 -0
  92. package/dist/effect/webhooks.d.ts +6 -6
  93. package/dist/index.js +2 -2
  94. package/dist/package.js +1 -1
  95. package/dist/promises/errors.gen.d.ts +65 -8
  96. package/dist/promises/errors.gen.js +139 -7
  97. package/dist/promises/index.d.ts +5 -3
  98. package/dist/promises/index.js +7 -5
  99. package/dist/promises/types.gen.d.ts +1 -1
  100. package/dist/service-map.d.ts +74 -25
  101. package/dist/service-map.js +43 -12
  102. package/package.json +12 -8
  103. package/dist/effect/generated/unsubscribe-groups.js +0 -284
  104. package/dist/effect/unsubscribe-groups.d.ts +0 -74
  105. package/dist/effect/unsubscribe-groups.js +0 -29
@@ -1,13 +1,9 @@
1
1
  import { AbsoluteInstant } from "../runtime.js";
2
- import { ApiKeySecurityMiddleware, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, ContactGroupId, ContactId, ConversationId, Cursor, EmailContent, EmailDispatchContent, EmailDomainId, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, JsonValue, ResourceNotFoundError, SenderNotReadyError, SendsSeries, UnauthorizedError, UnsubscribeId, ValidationError } from "./shared.js";
2
+ import { ApiKeySecurityMiddleware, BillingProviderError, BrandAddressRequiredError, CampaignAudience, CampaignContentInput, CampaignContentMetadata, CampaignConversationRef, CampaignFooterRequiredError, CampaignFrom, CampaignId, CampaignReplyMailbox, CampaignRunId, ConflictError, ContactId, Cursor, DeliveryUnavailableError, EmailAttachments, EmailCustomHeaders, EmailDomainId, EmailFooterOverride, EmailTrackingOverrideV1, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MessageId, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, RenderLocale, RenderTimeZone, ReplyToAddresses, ResourceNotFoundError, SenderNotReadyError, SendsSeries, TemplateData, TemplateId, TemplateInputContractId, TemplatePublicationId, TopicId, UnauthorizedError, ValidationError } from "./shared.js";
3
3
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
4
4
  import * as Schema from "effect/Schema";
5
5
  //#region src/effect/generated/campaigns.ts
6
- const CampaignId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^camp_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
7
- expected: "a string matching the RegExp ^camp_[0-9a-hjkmnp-tv-z]{16,24}$",
8
- identifier: "CampaignId"
9
- })).pipe(Schema.brand("CampaignId"));
10
- const CampaignContentMetadata = /* @__PURE__ */ Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]).annotate({ identifier: "CampaignContentMetadata" });
6
+ const CampaignPolicy = /* @__PURE__ */ Schema.Struct({ pageSize: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(100).annotate({ expected: "a value greater than or equal to 100" })).check(Schema.isLessThanOrEqualTo(1e3).annotate({ expected: "a value less than or equal to 1000" })), Schema.Null])) }).annotate({ identifier: "CampaignPolicy" });
11
7
  const CampaignDefinitionSummary = /* @__PURE__ */ Schema.Struct({
12
8
  state: Schema.Union([
13
9
  Schema.Literal("editable"),
@@ -16,10 +12,6 @@ const CampaignDefinitionSummary = /* @__PURE__ */ Schema.Struct({
16
12
  ]),
17
13
  frozenAt: Schema.Union([Schema.String, Schema.Null])
18
14
  }).annotate({ identifier: "CampaignDefinitionSummary" });
19
- const CampaignRunId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^crun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
20
- expected: "a string matching the RegExp ^crun_[0-9a-hjkmnp-tv-z]{16,24}$",
21
- identifier: "CampaignRunId"
22
- })).pipe(Schema.brand("CampaignRunId"));
23
15
  const CampaignRunSkippedReason = /* @__PURE__ */ Schema.Struct({
24
16
  reason: Schema.Union([
25
17
  Schema.Literal("unsubscribed"),
@@ -30,7 +22,8 @@ const CampaignRunSkippedReason = /* @__PURE__ */ Schema.Struct({
30
22
  Schema.Literal("no_identity"),
31
23
  Schema.Literal("inactive"),
32
24
  Schema.Literal("run_cancelled"),
33
- Schema.Literal("run_failed")
25
+ Schema.Literal("run_failed"),
26
+ Schema.Literal("missing_merge_field")
34
27
  ]),
35
28
  count: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
36
29
  }).annotate({ identifier: "CampaignRunSkippedReason" });
@@ -38,17 +31,37 @@ const CampaignRecipientId = /* @__PURE__ */ Schema.String.check(Schema.isPattern
38
31
  expected: "a string matching the RegExp ^crcpt_[0-9a-hjkmnp-tv-z]{16,24}$",
39
32
  identifier: "CampaignRecipientId"
40
33
  })).pipe(Schema.brand("CampaignRecipientId"));
41
- const CampaignPolicy = /* @__PURE__ */ Schema.Struct({
42
- unsubscribeGroupId: Schema.optionalKey(Schema.Union([UnsubscribeId, Schema.Null])),
43
- pageSize: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(100).annotate({ expected: "a value greater than or equal to 100" })).check(Schema.isLessThanOrEqualTo(1e3).annotate({ expected: "a value less than or equal to 1000" })), Schema.Null]))
44
- }).annotate({ identifier: "CampaignPolicy" });
45
- const CampaignConversationRef = /* @__PURE__ */ Schema.Union([Schema.Union([ConversationId, Schema.Null]), Schema.Null]).annotate({ identifier: "CampaignConversationRef" });
46
- const CampaignAudience = /* @__PURE__ */ Schema.Struct({
47
- includeTags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
48
- excludeTags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
49
- 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])),
50
- 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]))
51
- }).annotate({ identifier: "CampaignAudience" });
34
+ const CampaignRunReportEngagement = /* @__PURE__ */ Schema.Struct({
35
+ measurement: Schema.Literal("directional"),
36
+ uniqueOpens: Schema.Finite.annotate({ description: "Directional unique recipients who opened, excluding machine events; not an exact measurement." }).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" })),
37
+ uniqueClicks: Schema.Finite.annotate({ description: "Directional unique recipients who clicked, excluding machine events; not an exact measurement." }).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" }))
38
+ }).annotate({ identifier: "CampaignRunReportEngagement" });
39
+ const CampaignRunReportSkippedReason = /* @__PURE__ */ Schema.Struct({
40
+ reason: Schema.Union([
41
+ Schema.Literal("unsubscribed"),
42
+ Schema.Literal("blocked"),
43
+ Schema.Literal("suppressed"),
44
+ Schema.Literal("opted_out"),
45
+ Schema.Literal("unreachable"),
46
+ Schema.Literal("no_identity"),
47
+ Schema.Literal("inactive"),
48
+ Schema.Literal("run_cancelled"),
49
+ Schema.Literal("run_failed"),
50
+ Schema.Literal("missing_merge_field")
51
+ ]),
52
+ count: 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" }))
53
+ }).annotate({ identifier: "CampaignRunReportSkippedReason" });
54
+ const CampaignPreview = /* @__PURE__ */ Schema.Struct({
55
+ subject: Schema.String,
56
+ preheader: Schema.optionalKey(Schema.String),
57
+ html: Schema.String.check(Schema.isMaxCodePoints(2097152).annotate({ expected: "a string with at most 2097152 code points" })).check(Schema.isMaxLength(2097152).annotate({ expected: "a value with a length of at most 2097152" })),
58
+ text: Schema.String.check(Schema.isMaxCodePoints(2097152).annotate({ expected: "a string with at most 2097152 code points" })).check(Schema.isMaxLength(2097152).annotate({ expected: "a value with a length of at most 2097152" }))
59
+ }).annotate({ identifier: "CampaignPreview" });
60
+ const CampaignTestSend = /* @__PURE__ */ Schema.Struct({ id: MessageId }).annotate({ identifier: "CampaignTestSend" });
61
+ const CampaignRunReportTopicUnsubscribes = /* @__PURE__ */ Schema.Struct({
62
+ topicId: TopicId,
63
+ count: 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" }))
64
+ }).annotate({ identifier: "CampaignRunReportTopicUnsubscribes" });
52
65
  const CampaignLatestRun = /* @__PURE__ */ Schema.Struct({
53
66
  id: CampaignRunId,
54
67
  status: Schema.Union([
@@ -92,25 +105,58 @@ const CampaignRecipientPage = /* @__PURE__ */ Schema.Struct({
92
105
  Schema.Literal("no_identity"),
93
106
  Schema.Literal("inactive"),
94
107
  Schema.Literal("run_cancelled"),
95
- Schema.Literal("run_failed")
108
+ Schema.Literal("run_failed"),
109
+ Schema.Literal("missing_merge_field")
96
110
  ]), Schema.Null]),
97
111
  createdAt: Schema.String,
98
112
  updatedAt: Schema.String
99
113
  })),
100
114
  nextCursor: Schema.Union([Schema.String, Schema.Null])
101
115
  }).annotate({ identifier: "CampaignRecipientPage" });
116
+ const CampaignRunReport = /* @__PURE__ */ Schema.Struct({
117
+ campaignId: CampaignId,
118
+ runId: CampaignRunId,
119
+ totalRecipients: 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" })),
120
+ dispatchedCount: 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" })),
121
+ failedCount: 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" })),
122
+ skippedCount: 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" })),
123
+ deliveredCount: 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" })),
124
+ hardBounceCount: 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" })),
125
+ softBounceCount: 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" })),
126
+ complaintCount: 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" })),
127
+ engagement: CampaignRunReportEngagement,
128
+ unsubscribesByTopic: Schema.Array(CampaignRunReportTopicUnsubscribes),
129
+ replyCount: 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" })),
130
+ skippedReasons: Schema.Array(CampaignRunReportSkippedReason)
131
+ }).annotate({ identifier: "CampaignRunReport" });
132
+ const CampaignEmailContent = /* @__PURE__ */ Schema.Struct({
133
+ subject: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
134
+ html: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
135
+ text: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
136
+ attachments: Schema.optionalKey(EmailAttachments),
137
+ publicationId: Schema.optionalKey(TemplatePublicationId),
138
+ inputContractId: Schema.optionalKey(TemplateInputContractId),
139
+ templateId: Schema.optionalKey(Schema.Union([TemplateId, Schema.Null])),
140
+ 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])),
141
+ templateData: Schema.optionalKey(TemplateData),
142
+ locale: Schema.optionalKey(RenderLocale),
143
+ timeZone: Schema.optionalKey(RenderTimeZone),
144
+ inReplyToMessageId: Schema.optionalKey(Schema.Union([MessageId, Schema.Null])),
145
+ replyTo: Schema.optionalKey(ReplyToAddresses),
146
+ 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." })),
147
+ tracking: Schema.optionalKey(EmailTrackingOverrideV1),
148
+ footer: Schema.optionalKey(EmailFooterOverride),
149
+ headers: Schema.optionalKey(Schema.Union([EmailCustomHeaders, Schema.Null])),
150
+ preheader: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
151
+ }).annotate({ identifier: "CampaignEmailContent" });
102
152
  const CampaignContent = /* @__PURE__ */ Schema.Struct({
103
153
  channel: Schema.Literal("email"),
104
- email: EmailContent,
154
+ email: CampaignEmailContent,
155
+ from: Schema.optionalKey(CampaignFrom),
156
+ replyMailboxId: Schema.optionalKey(CampaignReplyMailbox),
105
157
  conversationId: Schema.optionalKey(CampaignConversationRef),
106
158
  metadata: Schema.optionalKey(CampaignContentMetadata)
107
159
  }).annotate({ identifier: "CampaignContent" });
108
- const CampaignContentInput = /* @__PURE__ */ Schema.Struct({
109
- channel: Schema.Literal("email"),
110
- email: EmailDispatchContent,
111
- conversationId: Schema.optionalKey(CampaignConversationRef),
112
- metadata: Schema.optionalKey(CampaignContentMetadata)
113
- }).annotate({ identifier: "CampaignContentInput" });
114
160
  const CampaignListItem = /* @__PURE__ */ Schema.Struct({
115
161
  id: CampaignId,
116
162
  name: Schema.String,
@@ -194,7 +240,7 @@ const CampaignRunAction = /* @__PURE__ */ Schema.Struct({
194
240
  }).annotate({ identifier: "CampaignRunAction" });
195
241
  const CampaignsListQuery = /* @__PURE__ */ Schema.Struct({
196
242
  status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("draft"), Schema.Literal("archived")]), Schema.Null])),
197
- limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
243
+ limit: Schema.optionalKey(Schema.Union([Schema.Finite.annotate({ description: "Items per page, at most 100." }).check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null])),
198
244
  cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
199
245
  });
200
246
  const CampaignsList200 = CampaignPage;
@@ -259,7 +305,7 @@ const CampaignsListRunsQuery = /* @__PURE__ */ Schema.Struct({
259
305
  Schema.Literal("cancelled"),
260
306
  Schema.Literal("failed")
261
307
  ]), Schema.Null])),
262
- limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
308
+ limit: Schema.optionalKey(Schema.Union([Schema.Finite.annotate({ description: "Items per page, at most 100." }).check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null])),
263
309
  cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
264
310
  });
265
311
  const CampaignsListRuns200 = CampaignRunPage;
@@ -338,7 +384,7 @@ const CampaignsListRecipientsQuery = /* @__PURE__ */ Schema.Struct({
338
384
  Schema.Literal("failed"),
339
385
  Schema.Literal("skipped")
340
386
  ]), Schema.Null])),
341
- limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
387
+ limit: Schema.optionalKey(Schema.Union([Schema.Finite.annotate({ description: "Items per page, at most 100." }).check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null])),
342
388
  cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
343
389
  });
344
390
  const CampaignsListRecipients200 = CampaignRecipientPage;
@@ -348,6 +394,17 @@ const CampaignsListRecipients404 = ResourceNotFoundError;
348
394
  const CampaignsListRecipients422 = ValidationError;
349
395
  const CampaignsListRecipients500 = InternalError;
350
396
  const CampaignsListRecipients504 = GatewayTimeoutError;
397
+ const CampaignsGetRunReportPathParams = /* @__PURE__ */ Schema.Struct({
398
+ id: CampaignId,
399
+ runId: CampaignRunId
400
+ });
401
+ const CampaignsGetRunReport200 = CampaignRunReport;
402
+ const CampaignsGetRunReport401 = UnauthorizedError;
403
+ const CampaignsGetRunReport403 = ForbiddenError;
404
+ const CampaignsGetRunReport404 = ResourceNotFoundError;
405
+ const CampaignsGetRunReport422 = ValidationError;
406
+ const CampaignsGetRunReport500 = InternalError;
407
+ const CampaignsGetRunReport504 = GatewayTimeoutError;
351
408
  const CampaignsResumeRunPathParams = /* @__PURE__ */ Schema.Struct({
352
409
  id: CampaignId,
353
410
  runId: CampaignRunId
@@ -361,6 +418,44 @@ const CampaignsResumeRun422 = ValidationError;
361
418
  const CampaignsResumeRun500 = InternalError;
362
419
  const CampaignsResumeRun502 = ExternalServiceError;
363
420
  const CampaignsResumeRun504 = GatewayTimeoutError;
421
+ const CampaignsPreviewRequestJson = /* @__PURE__ */ Schema.Struct({
422
+ content: CampaignContentInput,
423
+ audience: CampaignAudience,
424
+ contactId: Schema.optionalKey(Schema.Union([ContactId, Schema.Null]))
425
+ });
426
+ const CampaignsPreview200 = CampaignPreview;
427
+ const CampaignsPreview401 = UnauthorizedError;
428
+ const CampaignsPreview403 = ForbiddenError;
429
+ const CampaignsPreview404 = ResourceNotFoundError;
430
+ const CampaignsPreview422 = ValidationError;
431
+ const CampaignsPreview500 = InternalError;
432
+ const CampaignsPreview504 = GatewayTimeoutError;
433
+ const CampaignsSendTestRequestJson = /* @__PURE__ */ Schema.Struct({
434
+ content: CampaignContentInput,
435
+ audience: CampaignAudience,
436
+ contactId: Schema.optionalKey(Schema.Union([ContactId, Schema.Null]))
437
+ });
438
+ const CampaignsSendTest200 = CampaignTestSend;
439
+ const CampaignsSendTest401 = UnauthorizedError;
440
+ const CampaignsSendTest402 = PaymentRequiredError;
441
+ const CampaignsSendTest403 = /* @__PURE__ */ Schema.Union([
442
+ ForbiddenError,
443
+ OnboardingReviewRequiredError,
444
+ FlagDisabledError
445
+ ]);
446
+ const CampaignsSendTest404 = ResourceNotFoundError;
447
+ const CampaignsSendTest409 = ConflictError;
448
+ const CampaignsSendTest422 = /* @__PURE__ */ Schema.Union([
449
+ ValidationError,
450
+ FromAddressRequiredError,
451
+ BrandAddressRequiredError,
452
+ CampaignFooterRequiredError
453
+ ]);
454
+ const CampaignsSendTest429 = RateLimitedError;
455
+ const CampaignsSendTest500 = InternalError;
456
+ const CampaignsSendTest502 = /* @__PURE__ */ Schema.Union([BillingProviderError, ExternalServiceError]);
457
+ const CampaignsSendTest503 = /* @__PURE__ */ Schema.Union([SenderNotReadyError, DeliveryUnavailableError]);
458
+ const CampaignsSendTest504 = GatewayTimeoutError;
364
459
  var CampaignsGroup = class extends HttpApiGroup.make("Campaigns").add(HttpApiEndpoint.get("campaignsList", "/v1/campaigns", {
365
460
  query: CampaignsListQuery,
366
461
  success: CampaignsList200,
@@ -493,7 +588,18 @@ var CampaignsGroup = class extends HttpApiGroup.make("Campaigns").add(HttpApiEnd
493
588
  CampaignsListRecipients500,
494
589
  CampaignsListRecipients504.pipe(HttpApiSchema.status(504))
495
590
  ]
496
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.listRecipients").annotate(OpenApi.Summary, "List campaign recipients").annotate(OpenApi.Description, "Returns a campaign run's recipients in the order the run admitted them, optionally filtered by status. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("campaignsResumeRun", "/v1/campaigns/:id/runs/:runId/resume", {
591
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.listRecipients").annotate(OpenApi.Summary, "List campaign recipients").annotate(OpenApi.Description, "Returns a campaign run's recipients in the order the run admitted them, optionally filtered by status. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.get("campaignsGetRunReport", "/v1/campaigns/:id/runs/:runId/report", {
592
+ params: CampaignsGetRunReportPathParams,
593
+ success: CampaignsGetRunReport200,
594
+ error: [
595
+ CampaignsGetRunReport401.pipe(HttpApiSchema.status(401)),
596
+ CampaignsGetRunReport403.pipe(HttpApiSchema.status(403)),
597
+ CampaignsGetRunReport404.pipe(HttpApiSchema.status(404)),
598
+ CampaignsGetRunReport422.pipe(HttpApiSchema.status(422)),
599
+ CampaignsGetRunReport500,
600
+ CampaignsGetRunReport504.pipe(HttpApiSchema.status(504))
601
+ ]
602
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.getRunReport").annotate(OpenApi.Summary, "Get a campaign run report").annotate(OpenApi.Description, "Returns delivery outcomes, topic unsubscribes, replies, and skip reasons for an email campaign run. Non-email runs return 404. Namespace-scoped reads require an existing audience topic in that namespace. Opens and clicks are directional counts of unique recipients excluding machine events, not exact measurements."), HttpApiEndpoint.post("campaignsResumeRun", "/v1/campaigns/:id/runs/:runId/resume", {
497
603
  params: CampaignsResumeRunPathParams,
498
604
  success: CampaignsResumeRun200,
499
605
  error: [
@@ -506,8 +612,35 @@ var CampaignsGroup = class extends HttpApiGroup.make("Campaigns").add(HttpApiEnd
506
612
  CampaignsResumeRun502.pipe(HttpApiSchema.status(502)),
507
613
  CampaignsResumeRun504.pipe(HttpApiSchema.status(504))
508
614
  ]
509
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.resumeRun").annotate(OpenApi.Summary, "Resume a campaign run").annotate(OpenApi.Description, "Resumes a paused campaign run and returns the updated run.")).annotate(OpenApi.Description, "Campaign drafts and scheduled campaign runs") {};
615
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.resumeRun").annotate(OpenApi.Summary, "Resume a campaign run").annotate(OpenApi.Description, "Resumes a paused campaign run and returns the updated run."), HttpApiEndpoint.post("campaignsPreview", "/v1/campaigns/preview", {
616
+ payload: CampaignsPreviewRequestJson,
617
+ success: CampaignsPreview200,
618
+ error: [
619
+ CampaignsPreview401.pipe(HttpApiSchema.status(401)),
620
+ CampaignsPreview403.pipe(HttpApiSchema.status(403)),
621
+ CampaignsPreview404.pipe(HttpApiSchema.status(404)),
622
+ CampaignsPreview422.pipe(HttpApiSchema.status(422)),
623
+ CampaignsPreview500,
624
+ CampaignsPreview504.pipe(HttpApiSchema.status(504))
625
+ ]
626
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.preview").annotate(OpenApi.Summary, "Preview a campaign email").annotate(OpenApi.Description, "Renders draft email content using the selected contact's fields and declared templateData fallbacks. Creates no campaign run or message. Omit contactId to preview the fallback data alone."), HttpApiEndpoint.post("campaignsSendTest", "/v1/campaigns/test-send", {
627
+ payload: CampaignsSendTestRequestJson,
628
+ success: CampaignsSendTest200,
629
+ error: [
630
+ CampaignsSendTest401.pipe(HttpApiSchema.status(401)),
631
+ CampaignsSendTest402.pipe(HttpApiSchema.status(402)),
632
+ CampaignsSendTest403.pipe(HttpApiSchema.status(403)),
633
+ CampaignsSendTest404.pipe(HttpApiSchema.status(404)),
634
+ CampaignsSendTest409.pipe(HttpApiSchema.status(409)),
635
+ CampaignsSendTest422.pipe(HttpApiSchema.status(422)),
636
+ CampaignsSendTest429.pipe(HttpApiSchema.status(429)),
637
+ CampaignsSendTest500,
638
+ CampaignsSendTest502.pipe(HttpApiSchema.status(502)),
639
+ CampaignsSendTest503.pipe(HttpApiSchema.status(503)),
640
+ CampaignsSendTest504.pipe(HttpApiSchema.status(504))
641
+ ]
642
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "campaigns.sendTest").annotate(OpenApi.Summary, "Send a campaign test").annotate(OpenApi.Description, "Sends one rendered draft email to the authenticated actor's email address, using optional contactId only for personalization. Creates no campaign run. Normal sending permissions, billing, and delivery policies apply.")).annotate(OpenApi.Description, "Campaign drafts and scheduled campaign runs") {};
510
643
  //#endregion
511
- export { Campaign, CampaignAudience, CampaignContent, CampaignContentInput, CampaignContentMetadata, CampaignConversationRef, CampaignDefinitionSummary, CampaignId, CampaignLatestRun, CampaignListItem, CampaignPage, CampaignPolicy, CampaignRecipientId, CampaignRecipientPage, CampaignRun, CampaignRunAction, CampaignRunId, CampaignRunPage, CampaignRunSkippedReason, CampaignsArchive200, CampaignsArchive401, CampaignsArchive403, CampaignsArchive404, CampaignsArchive409, CampaignsArchive422, CampaignsArchive500, CampaignsArchive504, CampaignsArchivePathParams, CampaignsCancelRun200, CampaignsCancelRun401, CampaignsCancelRun403, CampaignsCancelRun404, CampaignsCancelRun409, CampaignsCancelRun422, CampaignsCancelRun500, CampaignsCancelRun502, CampaignsCancelRun504, CampaignsCancelRunPathParams, CampaignsCreate201, CampaignsCreate401, CampaignsCreate403, CampaignsCreate422, CampaignsCreate500, CampaignsCreate504, CampaignsCreateRequestJson, CampaignsGet200, CampaignsGet401, CampaignsGet403, CampaignsGet404, CampaignsGet422, CampaignsGet500, CampaignsGet504, CampaignsGetPathParams, CampaignsGetRun200, CampaignsGetRun401, CampaignsGetRun403, CampaignsGetRun404, CampaignsGetRun422, CampaignsGetRun500, CampaignsGetRun504, CampaignsGetRunPathParams, CampaignsGroup, CampaignsList200, CampaignsList401, CampaignsList403, CampaignsList422, CampaignsList500, CampaignsList504, CampaignsListQuery, CampaignsListRecipients200, CampaignsListRecipients401, CampaignsListRecipients403, CampaignsListRecipients404, CampaignsListRecipients422, CampaignsListRecipients500, CampaignsListRecipients504, CampaignsListRecipientsPathParams, CampaignsListRecipientsQuery, CampaignsListRuns200, CampaignsListRuns401, CampaignsListRuns403, CampaignsListRuns404, CampaignsListRuns422, CampaignsListRuns500, CampaignsListRuns504, CampaignsListRunsPathParams, CampaignsListRunsQuery, CampaignsPauseRun200, CampaignsPauseRun401, CampaignsPauseRun403, CampaignsPauseRun404, CampaignsPauseRun409, CampaignsPauseRun422, CampaignsPauseRun500, CampaignsPauseRun502, CampaignsPauseRun504, CampaignsPauseRunPathParams, CampaignsResumeRun200, CampaignsResumeRun401, CampaignsResumeRun403, CampaignsResumeRun404, CampaignsResumeRun409, CampaignsResumeRun422, CampaignsResumeRun500, CampaignsResumeRun502, CampaignsResumeRun504, CampaignsResumeRunPathParams, CampaignsScheduleRun201, CampaignsScheduleRun401, CampaignsScheduleRun403, CampaignsScheduleRun404, CampaignsScheduleRun409, CampaignsScheduleRun422, CampaignsScheduleRun500, CampaignsScheduleRun502, CampaignsScheduleRun503, CampaignsScheduleRun504, CampaignsScheduleRunPathParams, CampaignsScheduleRunRequestJson, CampaignsUpdate200, CampaignsUpdate401, CampaignsUpdate403, CampaignsUpdate404, CampaignsUpdate409, CampaignsUpdate422, CampaignsUpdate500, CampaignsUpdate504, CampaignsUpdatePathParams, CampaignsUpdateRequestJson };
644
+ export { Campaign, CampaignContent, CampaignDefinitionSummary, CampaignEmailContent, CampaignLatestRun, CampaignListItem, CampaignPage, CampaignPolicy, CampaignPreview, CampaignRecipientId, CampaignRecipientPage, CampaignRun, CampaignRunAction, CampaignRunPage, CampaignRunReport, CampaignRunReportEngagement, CampaignRunReportSkippedReason, CampaignRunReportTopicUnsubscribes, CampaignRunSkippedReason, CampaignTestSend, CampaignsArchive200, CampaignsArchive401, CampaignsArchive403, CampaignsArchive404, CampaignsArchive409, CampaignsArchive422, CampaignsArchive500, CampaignsArchive504, CampaignsArchivePathParams, CampaignsCancelRun200, CampaignsCancelRun401, CampaignsCancelRun403, CampaignsCancelRun404, CampaignsCancelRun409, CampaignsCancelRun422, CampaignsCancelRun500, CampaignsCancelRun502, CampaignsCancelRun504, CampaignsCancelRunPathParams, CampaignsCreate201, CampaignsCreate401, CampaignsCreate403, CampaignsCreate422, CampaignsCreate500, CampaignsCreate504, CampaignsCreateRequestJson, CampaignsGet200, CampaignsGet401, CampaignsGet403, CampaignsGet404, CampaignsGet422, CampaignsGet500, CampaignsGet504, CampaignsGetPathParams, CampaignsGetRun200, CampaignsGetRun401, CampaignsGetRun403, CampaignsGetRun404, CampaignsGetRun422, CampaignsGetRun500, CampaignsGetRun504, CampaignsGetRunPathParams, CampaignsGetRunReport200, CampaignsGetRunReport401, CampaignsGetRunReport403, CampaignsGetRunReport404, CampaignsGetRunReport422, CampaignsGetRunReport500, CampaignsGetRunReport504, CampaignsGetRunReportPathParams, CampaignsGroup, CampaignsList200, CampaignsList401, CampaignsList403, CampaignsList422, CampaignsList500, CampaignsList504, CampaignsListQuery, CampaignsListRecipients200, CampaignsListRecipients401, CampaignsListRecipients403, CampaignsListRecipients404, CampaignsListRecipients422, CampaignsListRecipients500, CampaignsListRecipients504, CampaignsListRecipientsPathParams, CampaignsListRecipientsQuery, CampaignsListRuns200, CampaignsListRuns401, CampaignsListRuns403, CampaignsListRuns404, CampaignsListRuns422, CampaignsListRuns500, CampaignsListRuns504, CampaignsListRunsPathParams, CampaignsListRunsQuery, CampaignsPauseRun200, CampaignsPauseRun401, CampaignsPauseRun403, CampaignsPauseRun404, CampaignsPauseRun409, CampaignsPauseRun422, CampaignsPauseRun500, CampaignsPauseRun502, CampaignsPauseRun504, CampaignsPauseRunPathParams, CampaignsPreview200, CampaignsPreview401, CampaignsPreview403, CampaignsPreview404, CampaignsPreview422, CampaignsPreview500, CampaignsPreview504, CampaignsPreviewRequestJson, CampaignsResumeRun200, CampaignsResumeRun401, CampaignsResumeRun403, CampaignsResumeRun404, CampaignsResumeRun409, CampaignsResumeRun422, CampaignsResumeRun500, CampaignsResumeRun502, CampaignsResumeRun504, CampaignsResumeRunPathParams, CampaignsScheduleRun201, CampaignsScheduleRun401, CampaignsScheduleRun403, CampaignsScheduleRun404, CampaignsScheduleRun409, CampaignsScheduleRun422, CampaignsScheduleRun500, CampaignsScheduleRun502, CampaignsScheduleRun503, CampaignsScheduleRun504, CampaignsScheduleRunPathParams, CampaignsScheduleRunRequestJson, CampaignsSendTest200, CampaignsSendTest401, CampaignsSendTest402, CampaignsSendTest403, CampaignsSendTest404, CampaignsSendTest409, CampaignsSendTest422, CampaignsSendTest429, CampaignsSendTest500, CampaignsSendTest502, CampaignsSendTest503, CampaignsSendTest504, CampaignsSendTestRequestJson, CampaignsUpdate200, CampaignsUpdate401, CampaignsUpdate403, CampaignsUpdate404, CampaignsUpdate409, CampaignsUpdate422, CampaignsUpdate500, CampaignsUpdate504, CampaignsUpdatePathParams, CampaignsUpdateRequestJson };
512
645
 
513
646
  //# sourceMappingURL=campaigns.js.map
@@ -24,11 +24,11 @@ export declare const ContactEventsListEventsPathParams: Schema.Struct<{
24
24
  readonly id: Schema.brand<Schema.String, "ContactId">;
25
25
  }>;
26
26
  export type ContactEventsListEventsQuery = {
27
- readonly limit?: string | null;
27
+ readonly limit?: number | null;
28
28
  readonly cursor?: Cursor | null;
29
29
  };
30
30
  export declare const ContactEventsListEventsQuery: Schema.Struct<{
31
- readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
31
+ readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
32
32
  readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
33
33
  }>;
34
34
  export type ContactEventsListEvents200 = ContactEventPage;
@@ -59,7 +59,7 @@ export declare const ContactEventsListEvents504: typeof GatewayTimeoutError;
59
59
  declare const ContactEventsGroup_base: HttpApiGroup.HttpApiGroup<"Contact events", HttpApiEndpoint.HttpApiEndpoint<"contactEventsListEvents", "GET", "/v1/contacts/:id/events", Schema.toCodecStringTree<Schema.Struct<{
60
60
  readonly id: Schema.brand<Schema.String, "ContactId">;
61
61
  }>>, Schema.toCodecStringTree<Schema.Struct<{
62
- readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
62
+ readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
63
63
  readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
64
64
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
65
65
  readonly items: Schema.$Array<Schema.Struct<{
@@ -8,7 +8,7 @@ const ContactEventPage = /* @__PURE__ */ Schema.Struct({
8
8
  }).annotate({ identifier: "ContactEventPage" });
9
9
  const ContactEventsListEventsPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactId });
10
10
  const ContactEventsListEventsQuery = /* @__PURE__ */ Schema.Struct({
11
- limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
11
+ limit: Schema.optionalKey(Schema.Union([Schema.Finite.annotate({ description: "Items per page, at most 100." }).check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null])),
12
12
  cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
13
13
  });
14
14
  const ContactEventsListEvents200 = ContactEventPage;
@@ -97,16 +97,16 @@ export declare const ContactGroupMemberPage: Schema.Struct<{
97
97
  readonly nextCursor: Schema.Union<readonly [Schema.String, Schema.Null]>;
98
98
  }>;
99
99
  export type ContactGroupsListQuery = {
100
- readonly limit?: string | null;
100
+ readonly limit?: number | null;
101
101
  readonly cursor?: Cursor | null;
102
102
  readonly type?: "static" | "dynamic" | "smart" | ReadonlyArray<"static" | "dynamic" | "smart"> | null;
103
- readonly isActive?: string | null;
103
+ readonly isActive?: boolean | null;
104
104
  };
105
105
  export declare const ContactGroupsListQuery: Schema.Struct<{
106
- readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
106
+ readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
107
107
  readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
108
108
  readonly type: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"static">, Schema.Literal<"dynamic">, Schema.Literal<"smart">]>, Schema.$Array<Schema.Union<readonly [Schema.Literal<"static">, Schema.Literal<"dynamic">, Schema.Literal<"smart">]>>]>, Schema.Null]>>;
109
- readonly isActive: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
109
+ readonly isActive: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
110
110
  }>;
111
111
  export type ContactGroupsList200 = ContactGroupPage;
112
112
  export declare const ContactGroupsList200: Schema.Struct<{
@@ -389,11 +389,11 @@ export declare const ContactGroupsGetMembersPathParams: Schema.Struct<{
389
389
  readonly id: Schema.brand<Schema.String, "ContactGroupId">;
390
390
  }>;
391
391
  export type ContactGroupsGetMembersQuery = {
392
- readonly limit?: string | null;
392
+ readonly limit?: number | null;
393
393
  readonly cursor?: Cursor | null;
394
394
  };
395
395
  export declare const ContactGroupsGetMembersQuery: Schema.Struct<{
396
- readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
396
+ readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
397
397
  readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
398
398
  }>;
399
399
  export type ContactGroupsGetMembers200 = ContactGroupMemberPage;
@@ -916,7 +916,7 @@ declare const ContactGroupsGroup_base: HttpApiGroup.HttpApiGroup<"Contact Groups
916
916
  }>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"contactGroupsGetMembers", "GET", "/v1/contact-groups/:id/members", Schema.toCodecStringTree<Schema.Struct<{
917
917
  readonly id: Schema.brand<Schema.String, "ContactGroupId">;
918
918
  }>>, Schema.toCodecStringTree<Schema.Struct<{
919
- readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
919
+ readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
920
920
  readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
921
921
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
922
922
  readonly items: Schema.$Array<Schema.Struct<{
@@ -1033,10 +1033,10 @@ declare const ContactGroupsGroup_base: HttpApiGroup.HttpApiGroup<"Contact Groups
1033
1033
  readonly message: Schema.String;
1034
1034
  readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
1035
1035
  }>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"contactGroupsList", "GET", "/v1/contact-groups", never, Schema.toCodecStringTree<Schema.Struct<{
1036
- readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
1036
+ readonly limit: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
1037
1037
  readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
1038
1038
  readonly type: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"static">, Schema.Literal<"dynamic">, Schema.Literal<"smart">]>, Schema.$Array<Schema.Union<readonly [Schema.Literal<"static">, Schema.Literal<"dynamic">, Schema.Literal<"smart">]>>]>, Schema.Null]>>;
1039
- readonly isActive: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
1039
+ readonly isActive: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
1040
1040
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
1041
1041
  readonly items: Schema.$Array<Schema.Struct<{
1042
1042
  readonly id: Schema.brand<Schema.String, "ContactGroupId">;
@@ -57,7 +57,7 @@ const ContactGroupMemberPage = /* @__PURE__ */ Schema.Struct({
57
57
  nextCursor: Schema.Union([Schema.String, Schema.Null])
58
58
  }).annotate({ identifier: "ContactGroupMemberPage" });
59
59
  const ContactGroupsListQuery = /* @__PURE__ */ Schema.Struct({
60
- limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
60
+ limit: Schema.optionalKey(Schema.Union([Schema.Finite.annotate({ description: "Items per page, at most 100." }).check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null])),
61
61
  cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null])),
62
62
  type: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Union([
63
63
  Schema.Literal("static"),
@@ -68,7 +68,7 @@ const ContactGroupsListQuery = /* @__PURE__ */ Schema.Struct({
68
68
  Schema.Literal("dynamic"),
69
69
  Schema.Literal("smart")
70
70
  ]))]), Schema.Null])),
71
- isActive: Schema.optionalKey(Schema.Union([Schema.String.annotate({ contentMediaType: "application/json" }), Schema.Null]))
71
+ isActive: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
72
72
  });
73
73
  const ContactGroupsList200 = ContactGroupPage;
74
74
  const ContactGroupsList401 = UnauthorizedError;
@@ -240,7 +240,7 @@ const ContactGroupsEvaluateDynamic500 = InternalError;
240
240
  const ContactGroupsEvaluateDynamic504 = GatewayTimeoutError;
241
241
  const ContactGroupsGetMembersPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
242
242
  const ContactGroupsGetMembersQuery = /* @__PURE__ */ Schema.Struct({
243
- limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
243
+ limit: Schema.optionalKey(Schema.Union([Schema.Finite.annotate({ description: "Items per page, at most 100." }).check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null])),
244
244
  cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
245
245
  });
246
246
  const ContactGroupsGetMembers200 = ContactGroupMemberPage;
@@ -252,7 +252,7 @@ const ContactGroupsGetMembers500 = InternalError;
252
252
  const ContactGroupsGetMembers504 = GatewayTimeoutError;
253
253
  const ContactGroupsAddMembersPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
254
254
  const ContactGroupsAddMembersRequestJson = /* @__PURE__ */ Schema.Struct({
255
- contactIds: Schema.TupleWithRest(Schema.Tuple([ContactId]), [ContactId]),
255
+ contactIds: Schema.TupleWithRest(Schema.Tuple([ContactId]), [ContactId]).check(Schema.isMaxLength(1e3).annotate({ expected: "a value with a length of at most 1000" })),
256
256
  role: Schema.optionalKey(Schema.Union([Schema.Union([
257
257
  Schema.Literal("member"),
258
258
  Schema.Literal("moderator"),
@@ -270,7 +270,7 @@ const ContactGroupsAddMembers422 = ValidationError;
270
270
  const ContactGroupsAddMembers500 = InternalError;
271
271
  const ContactGroupsAddMembers504 = GatewayTimeoutError;
272
272
  const ContactGroupsRemoveMembersPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
273
- const ContactGroupsRemoveMembersRequestJson = /* @__PURE__ */ Schema.Struct({ contactIds: Schema.TupleWithRest(Schema.Tuple([ContactId]), [ContactId]) });
273
+ const ContactGroupsRemoveMembersRequestJson = /* @__PURE__ */ Schema.Struct({ contactIds: Schema.TupleWithRest(Schema.Tuple([ContactId]), [ContactId]).check(Schema.isMaxLength(1e3).annotate({ expected: "a value with a length of at most 1000" })) });
274
274
  const ContactGroupsRemoveMembers200 = /* @__PURE__ */ Schema.Struct({ removed: 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" })) });
275
275
  const ContactGroupsRemoveMembers401 = UnauthorizedError;
276
276
  const ContactGroupsRemoveMembers403 = ForbiddenError;
@@ -390,7 +390,7 @@ var ContactGroupsGroup = class extends HttpApiGroup.make("Contact Groups").add(H
390
390
  ContactGroupsAddMembers500,
391
391
  ContactGroupsAddMembers504.pipe(HttpApiSchema.status(504))
392
392
  ]
393
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.addMembers").annotate(OpenApi.Summary, "Add members to a contact group").annotate(OpenApi.Description, "Adds one or more contacts to a contact group, returning counts of added and skipped members."), HttpApiEndpoint.delete("contactGroupsRemoveMembers", "/v1/contact-groups/:id/members", {
393
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.addMembers").annotate(OpenApi.Summary, "Add members to a contact group").annotate(OpenApi.Description, "Adds one or more contacts to a contact group, returning counts of added and skipped members. One request carries at most 1000 ids."), HttpApiEndpoint.delete("contactGroupsRemoveMembers", "/v1/contact-groups/:id/members", {
394
394
  params: ContactGroupsRemoveMembersPathParams,
395
395
  payload: ContactGroupsRemoveMembersRequestJson,
396
396
  success: ContactGroupsRemoveMembers200,
@@ -402,7 +402,7 @@ var ContactGroupsGroup = class extends HttpApiGroup.make("Contact Groups").add(H
402
402
  ContactGroupsRemoveMembers500,
403
403
  ContactGroupsRemoveMembers504.pipe(HttpApiSchema.status(504))
404
404
  ]
405
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.removeMembers").annotate(OpenApi.Summary, "Remove members from a contact group").annotate(OpenApi.Description, "Removes one or more contacts from a contact group, returning the count of removed members."), HttpApiEndpoint.post("contactGroupsPreview", "/v1/contact-groups/preview", {
405
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.removeMembers").annotate(OpenApi.Summary, "Remove members from a contact group").annotate(OpenApi.Description, "Removes one or more contacts from a contact group, returning the count of removed members. One request carries at most 1000 ids."), HttpApiEndpoint.post("contactGroupsPreview", "/v1/contact-groups/preview", {
406
406
  payload: ContactGroupsPreviewRequestJson,
407
407
  success: ContactGroupsPreview200,
408
408
  error: [