samva 0.44.0 → 0.45.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 (93) hide show
  1. package/AGENTS.md +3 -0
  2. package/README.md +4 -0
  3. package/dist/client/sdk.gen.d.ts +281 -1
  4. package/dist/client/sdk.gen.js +856 -1
  5. package/dist/client/types.gen.d.ts +1858 -46
  6. package/dist/effect/agents.d.ts +86 -86
  7. package/dist/effect/agents.js +2 -2
  8. package/dist/effect/api-keys.d.ts +36 -36
  9. package/dist/effect/api-keys.js +2 -2
  10. package/dist/effect/attachments.d.ts +3 -3
  11. package/dist/effect/attachments.js +1 -1
  12. package/dist/effect/campaigns.d.ts +250 -250
  13. package/dist/effect/campaigns.js +3 -3
  14. package/dist/effect/categories.d.ts +23 -5
  15. package/dist/effect/categories.js +11 -20
  16. package/dist/effect/contact-groups.d.ts +44 -44
  17. package/dist/effect/contact-groups.js +3 -3
  18. package/dist/effect/contacts.d.ts +3 -3
  19. package/dist/effect/contacts.js +1 -1
  20. package/dist/effect/conversations.d.ts +53 -53
  21. package/dist/effect/conversations.js +1 -1
  22. package/dist/effect/email.d.ts +97 -97
  23. package/dist/effect/email.js +21 -21
  24. package/dist/effect/errors.d.ts +1 -1
  25. package/dist/effect/errors.js +2 -2
  26. package/dist/effect/extension-installations.d.ts +6 -6
  27. package/dist/effect/extension-installations.js +1 -1
  28. package/dist/effect/generated/analytics.d.ts +6 -0
  29. package/dist/effect/generated/analytics.js +4 -2
  30. package/dist/effect/generated/index.d.ts +9 -1
  31. package/dist/effect/generated/journeys.d.ts +1 -3
  32. package/dist/effect/generated/journeys.js +2 -6
  33. package/dist/effect/generated/messages.d.ts +1 -5
  34. package/dist/effect/generated/messages.js +2 -10
  35. package/dist/effect/generated/shared.d.ts +92 -2
  36. package/dist/effect/generated/shared.js +43 -2
  37. package/dist/effect/generated/template-registrations.d.ts +651 -0
  38. package/dist/effect/generated/template-registrations.js +138 -0
  39. package/dist/effect/generated/whats-app-flows.d.ts +1838 -0
  40. package/dist/effect/generated/whats-app-flows.js +338 -0
  41. package/dist/effect/generated/whats-app-setup-links.d.ts +705 -0
  42. package/dist/effect/generated/whats-app-setup-links.js +150 -0
  43. package/dist/effect/generated/whats-app.d.ts +2089 -0
  44. package/dist/effect/generated/whats-app.js +633 -0
  45. package/dist/effect/generated-metadata.d.ts +245 -0
  46. package/dist/effect/generated-metadata.js +221 -48
  47. package/dist/effect/index.d.ts +4 -0
  48. package/dist/effect/index.js +6 -2
  49. package/dist/effect/mailboxes.d.ts +298 -298
  50. package/dist/effect/mailboxes.js +3 -3
  51. package/dist/effect/media.d.ts +4 -4
  52. package/dist/effect/media.js +2 -2
  53. package/dist/effect/messages.d.ts +17 -17
  54. package/dist/effect/messages.js +4 -4
  55. package/dist/effect/namespaces.d.ts +5 -5
  56. package/dist/effect/namespaces.js +1 -1
  57. package/dist/effect/newsletter-issues.d.ts +8 -8
  58. package/dist/effect/newsletter-issues.js +2 -2
  59. package/dist/effect/newsletters.d.ts +3 -3
  60. package/dist/effect/newsletters.js +1 -1
  61. package/dist/effect/organizations.d.ts +10 -10
  62. package/dist/effect/organizations.js +1 -1
  63. package/dist/effect/runtime.d.ts +2 -0
  64. package/dist/effect/runtime.js +2 -1
  65. package/dist/effect/scheduled-messages.d.ts +839 -839
  66. package/dist/effect/scheduled-messages.js +1 -1
  67. package/dist/effect/template-registrations.d.ts +12 -0
  68. package/dist/effect/template-registrations.js +16 -0
  69. package/dist/effect/templates.d.ts +66 -66
  70. package/dist/effect/templates.js +13 -13
  71. package/dist/effect/topic-forms.d.ts +4 -4
  72. package/dist/effect/topic-forms.js +1 -1
  73. package/dist/effect/topics.d.ts +11 -11
  74. package/dist/effect/topics.js +2 -2
  75. package/dist/effect/webhooks.d.ts +18 -18
  76. package/dist/effect/webhooks.js +3 -3
  77. package/dist/effect/whatsapp-flows.d.ts +34 -0
  78. package/dist/effect/whatsapp-flows.js +30 -0
  79. package/dist/effect/whatsapp-setup-links.d.ts +66 -0
  80. package/dist/effect/whatsapp-setup-links.js +18 -0
  81. package/dist/effect/whatsapp.d.ts +51 -0
  82. package/dist/effect/whatsapp.js +34 -0
  83. package/dist/index.js +2 -2
  84. package/dist/package.js +1 -1
  85. package/dist/promises/client.d.ts +9 -1
  86. package/dist/promises/client.js +11 -3
  87. package/dist/promises/errors.gen.d.ts +38 -2
  88. package/dist/promises/errors.gen.js +160 -3
  89. package/dist/promises/index.js +2 -2
  90. package/dist/promises/types.gen.d.ts +1 -1
  91. package/dist/service-map.d.ts +917 -736
  92. package/dist/service-map.js +288 -235
  93. package/package.json +19 -3
@@ -0,0 +1,633 @@
1
+ import { NonEmptySensitiveString, SensitiveString } from "../runtime.js";
2
+ import { ApiKeySecurityMiddleware, BillingProviderError, CampaignId, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, JourneyId, MalformedRequestError, MessageDeliveryId, NamespaceId, PaymentRequiredError, ResourceNotFoundError, TemplateId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError } from "./shared.js";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
4
+ import * as Schema from "effect/Schema";
5
+ // src/effect/generated/whats-app.ts
6
+ const PaginationMeta = /* @__PURE__ */ (() => Schema.Struct({
7
+ page: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
8
+ limit: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
9
+ total: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
10
+ totalPages: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
11
+ }).annotate({ identifier: "PaginationMeta" }))();
12
+ const WhatsAppServiceWindowId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(new globalThis.RegExp("^wasw_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
13
+ expected: "a string matching the RegExp ^wasw_[0-9a-hjkmnp-tv-z]{16,24}$",
14
+ identifier: "WhatsAppServiceWindowId"
15
+ })).pipe(Schema.brand("WhatsAppServiceWindowId")))();
16
+ const MoneyAmount = /* @__PURE__ */ (() => Schema.Struct({
17
+ amount: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^\\d+\\.\\d+$", "u")).annotate({ expected: "a string matching the RegExp ^\\d+\\.\\d+$" })),
18
+ currency: Schema.String
19
+ }).annotate({ identifier: "MoneyAmount" }))();
20
+ const WhatsAppTemplateStatsSource = /* @__PURE__ */ (() => Schema.Union([
21
+ Schema.Struct({
22
+ type: Schema.Literal("campaign"),
23
+ campaignId: CampaignId
24
+ }),
25
+ Schema.Struct({
26
+ type: Schema.Literal("journey"),
27
+ journeyId: JourneyId,
28
+ nodeId: Schema.String
29
+ }),
30
+ Schema.Struct({ type: Schema.Literal("direct") })
31
+ ]).annotate({ identifier: "WhatsAppTemplateStatsSource" }))();
32
+ const WhatsAppTemplateStatsRow = /* @__PURE__ */ (() => Schema.Struct({
33
+ templateId: TemplateId,
34
+ templateSlug: Schema.String,
35
+ name: Schema.String,
36
+ language: Schema.String,
37
+ category: Schema.Union([Schema.Union([
38
+ Schema.Literal("marketing"),
39
+ Schema.Literal("utility"),
40
+ Schema.Literal("authentication")
41
+ ]), Schema.Null]),
42
+ source: WhatsAppTemplateStatsSource,
43
+ sent: 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" })),
44
+ delivered: 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" })),
45
+ read: 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" })),
46
+ failed: 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" })),
47
+ estimatedProviderCosts: Schema.Array(MoneyAmount)
48
+ }).annotate({ identifier: "WhatsAppTemplateStatsRow" }))();
49
+ const WhatsAppTemplateStats = /* @__PURE__ */ (() => Schema.Struct({ items: Schema.Array(WhatsAppTemplateStatsRow) }).annotate({ identifier: "WhatsAppTemplateStats" }))();
50
+ const WhatsappListBusinessAccountsQuery = /* @__PURE__ */ (() => Schema.Struct({
51
+ page: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(1e4).annotate({ expected: "a value less than or equal to 10000" })), Schema.Null])),
52
+ limit: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })), Schema.Null])),
53
+ isActive: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
54
+ verificationStatus: Schema.optionalKey(Schema.Union([
55
+ Schema.Literal("pending"),
56
+ Schema.Literal("verified"),
57
+ Schema.Literal("failed"),
58
+ Schema.Literal("suspended")
59
+ ])),
60
+ namespaceId: Schema.optionalKey(NamespaceId)
61
+ }))();
62
+ const WhatsappListBusinessAccounts200 = /* @__PURE__ */ (() => Schema.Struct({
63
+ items: Schema.Array(Schema.Struct({
64
+ id: WhatsAppBusinessAccountId,
65
+ organizationId: Schema.String,
66
+ namespaceId: Schema.Union([NamespaceId, Schema.Null]),
67
+ phoneNumber: Schema.String,
68
+ phoneNumberId: Schema.String,
69
+ displayName: Schema.String,
70
+ whatsappBusinessAccountId: Schema.String,
71
+ verificationStatus: Schema.Union([
72
+ Schema.Literal("pending"),
73
+ Schema.Literal("verified"),
74
+ Schema.Literal("failed"),
75
+ Schema.Literal("suspended")
76
+ ]),
77
+ credentialStatus: Schema.Union([Schema.Literal("active"), Schema.Literal("reconnect_required")]),
78
+ tokenExpiresAt: Schema.Union([Schema.String, Schema.Null]),
79
+ isDefault: Schema.Boolean,
80
+ webhookUrl: Schema.Union([Schema.String, Schema.Null]),
81
+ qualityRating: Schema.Union([
82
+ Schema.Literal("green"),
83
+ Schema.Literal("yellow"),
84
+ Schema.Literal("red"),
85
+ Schema.Literal("unknown")
86
+ ]),
87
+ messagingLimit: Schema.Union([Schema.String, Schema.Null]),
88
+ currentLimit: 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" })),
89
+ businessPortfolioId: Schema.Union([Schema.String, Schema.Null]),
90
+ businessAppConnectedAt: Schema.Union([Schema.String, Schema.Null]),
91
+ businessAppDisconnectedAt: Schema.Union([Schema.String, Schema.Null]),
92
+ businessAppDisconnectReason: Schema.Union([Schema.Union([
93
+ Schema.Literal("partnerRemoved"),
94
+ Schema.Literal("offboarded"),
95
+ Schema.Literal("accountDisconnected"),
96
+ Schema.Literal("businessDowngrade"),
97
+ Schema.Literal("changeNumber"),
98
+ Schema.Literal("companionInactivity"),
99
+ Schema.Literal("primaryInactivity"),
100
+ Schema.Literal("userReRegistered")
101
+ ]), Schema.Null]),
102
+ contactsSyncRequestedAt: Schema.Union([Schema.String, Schema.Null]),
103
+ historySyncStatus: Schema.Union([Schema.Union([
104
+ Schema.Literal("requested"),
105
+ Schema.Literal("importing"),
106
+ Schema.Literal("completed"),
107
+ Schema.Literal("declined")
108
+ ]), Schema.Null]),
109
+ historySyncProgress: Schema.Union([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(100).annotate({ expected: "a value less than or equal to 100" })), Schema.Null]),
110
+ isActive: Schema.Boolean,
111
+ createdAt: Schema.String,
112
+ updatedAt: Schema.String
113
+ })),
114
+ pagination: PaginationMeta
115
+ }))();
116
+ const WhatsappListBusinessAccounts400 = MalformedRequestError;
117
+ const WhatsappListBusinessAccounts401 = UnauthorizedError;
118
+ const WhatsappListBusinessAccounts403 = /* @__PURE__ */ (() => Schema.Union([ForbiddenError, FlagDisabledError]))();
119
+ const WhatsappListBusinessAccounts422 = ValidationError;
120
+ const WhatsappListBusinessAccounts500 = InternalError;
121
+ const WhatsappListBusinessAccounts504 = GatewayTimeoutError;
122
+ const WhatsappConnectBusinessAccountRequestJson = /* @__PURE__ */ (() => Schema.Struct({
123
+ code: NonEmptySensitiveString,
124
+ wabaId: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
125
+ phoneNumberId: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
126
+ namespaceId: Schema.optionalKey(Schema.Union([NamespaceId, Schema.Null]))
127
+ }))();
128
+ const WhatsappConnectBusinessAccount201 = /* @__PURE__ */ (() => Schema.Struct({
129
+ id: WhatsAppBusinessAccountId,
130
+ organizationId: Schema.String,
131
+ namespaceId: Schema.Union([NamespaceId, Schema.Null]),
132
+ phoneNumber: Schema.String,
133
+ phoneNumberId: Schema.String,
134
+ displayName: Schema.String,
135
+ whatsappBusinessAccountId: Schema.String,
136
+ verificationStatus: Schema.Union([
137
+ Schema.Literal("pending"),
138
+ Schema.Literal("verified"),
139
+ Schema.Literal("failed"),
140
+ Schema.Literal("suspended")
141
+ ]),
142
+ credentialStatus: Schema.Union([Schema.Literal("active"), Schema.Literal("reconnect_required")]),
143
+ tokenExpiresAt: Schema.Union([Schema.String, Schema.Null]),
144
+ isDefault: Schema.Boolean,
145
+ webhookUrl: Schema.Union([Schema.String, Schema.Null]),
146
+ qualityRating: Schema.Union([
147
+ Schema.Literal("green"),
148
+ Schema.Literal("yellow"),
149
+ Schema.Literal("red"),
150
+ Schema.Literal("unknown")
151
+ ]),
152
+ messagingLimit: Schema.Union([Schema.String, Schema.Null]),
153
+ currentLimit: 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" })),
154
+ businessPortfolioId: Schema.Union([Schema.String, Schema.Null]),
155
+ businessAppConnectedAt: Schema.Union([Schema.String, Schema.Null]),
156
+ businessAppDisconnectedAt: Schema.Union([Schema.String, Schema.Null]),
157
+ businessAppDisconnectReason: Schema.Union([Schema.Union([
158
+ Schema.Literal("partnerRemoved"),
159
+ Schema.Literal("offboarded"),
160
+ Schema.Literal("accountDisconnected"),
161
+ Schema.Literal("businessDowngrade"),
162
+ Schema.Literal("changeNumber"),
163
+ Schema.Literal("companionInactivity"),
164
+ Schema.Literal("primaryInactivity"),
165
+ Schema.Literal("userReRegistered")
166
+ ]), Schema.Null]),
167
+ contactsSyncRequestedAt: Schema.Union([Schema.String, Schema.Null]),
168
+ historySyncStatus: Schema.Union([Schema.Union([
169
+ Schema.Literal("requested"),
170
+ Schema.Literal("importing"),
171
+ Schema.Literal("completed"),
172
+ Schema.Literal("declined")
173
+ ]), Schema.Null]),
174
+ historySyncProgress: Schema.Union([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(100).annotate({ expected: "a value less than or equal to 100" })), Schema.Null]),
175
+ isActive: Schema.Boolean,
176
+ createdAt: Schema.String,
177
+ updatedAt: Schema.String
178
+ }))();
179
+ const WhatsappConnectBusinessAccount400 = MalformedRequestError;
180
+ const WhatsappConnectBusinessAccount401 = UnauthorizedError;
181
+ const WhatsappConnectBusinessAccount402 = PaymentRequiredError;
182
+ const WhatsappConnectBusinessAccount403 = /* @__PURE__ */ (() => Schema.Union([ForbiddenError, FlagDisabledError]))();
183
+ const WhatsappConnectBusinessAccount404 = ResourceNotFoundError;
184
+ const WhatsappConnectBusinessAccount409 = ConflictError;
185
+ const WhatsappConnectBusinessAccount422 = ValidationError;
186
+ const WhatsappConnectBusinessAccount500 = /* @__PURE__ */ (() => Schema.Union([InternalError, CredentialsError]))();
187
+ const WhatsappConnectBusinessAccount502 = /* @__PURE__ */ (() => Schema.Union([WhatsAppChannelError, BillingProviderError]))();
188
+ const WhatsappConnectBusinessAccount504 = GatewayTimeoutError;
189
+ const WhatsappGetBusinessAccountPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: WhatsAppBusinessAccountId }))();
190
+ const WhatsappGetBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struct({
191
+ id: WhatsAppBusinessAccountId,
192
+ organizationId: Schema.String,
193
+ namespaceId: Schema.Union([NamespaceId, Schema.Null]),
194
+ phoneNumber: Schema.String,
195
+ phoneNumberId: Schema.String,
196
+ displayName: Schema.String,
197
+ whatsappBusinessAccountId: Schema.String,
198
+ verificationStatus: Schema.Union([
199
+ Schema.Literal("pending"),
200
+ Schema.Literal("verified"),
201
+ Schema.Literal("failed"),
202
+ Schema.Literal("suspended")
203
+ ]),
204
+ credentialStatus: Schema.Union([Schema.Literal("active"), Schema.Literal("reconnect_required")]),
205
+ tokenExpiresAt: Schema.Union([Schema.String, Schema.Null]),
206
+ isDefault: Schema.Boolean,
207
+ webhookUrl: Schema.Union([Schema.String, Schema.Null]),
208
+ qualityRating: Schema.Union([
209
+ Schema.Literal("green"),
210
+ Schema.Literal("yellow"),
211
+ Schema.Literal("red"),
212
+ Schema.Literal("unknown")
213
+ ]),
214
+ messagingLimit: Schema.Union([Schema.String, Schema.Null]),
215
+ currentLimit: 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" })),
216
+ businessPortfolioId: Schema.Union([Schema.String, Schema.Null]),
217
+ businessAppConnectedAt: Schema.Union([Schema.String, Schema.Null]),
218
+ businessAppDisconnectedAt: Schema.Union([Schema.String, Schema.Null]),
219
+ businessAppDisconnectReason: Schema.Union([Schema.Union([
220
+ Schema.Literal("partnerRemoved"),
221
+ Schema.Literal("offboarded"),
222
+ Schema.Literal("accountDisconnected"),
223
+ Schema.Literal("businessDowngrade"),
224
+ Schema.Literal("changeNumber"),
225
+ Schema.Literal("companionInactivity"),
226
+ Schema.Literal("primaryInactivity"),
227
+ Schema.Literal("userReRegistered")
228
+ ]), Schema.Null]),
229
+ contactsSyncRequestedAt: Schema.Union([Schema.String, Schema.Null]),
230
+ historySyncStatus: Schema.Union([Schema.Union([
231
+ Schema.Literal("requested"),
232
+ Schema.Literal("importing"),
233
+ Schema.Literal("completed"),
234
+ Schema.Literal("declined")
235
+ ]), Schema.Null]),
236
+ historySyncProgress: Schema.Union([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(100).annotate({ expected: "a value less than or equal to 100" })), Schema.Null]),
237
+ isActive: Schema.Boolean,
238
+ createdAt: Schema.String,
239
+ updatedAt: Schema.String
240
+ }))();
241
+ const WhatsappGetBusinessAccount400 = MalformedRequestError;
242
+ const WhatsappGetBusinessAccount401 = UnauthorizedError;
243
+ const WhatsappGetBusinessAccount403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
244
+ const WhatsappGetBusinessAccount404 = ResourceNotFoundError;
245
+ const WhatsappGetBusinessAccount422 = ValidationError;
246
+ const WhatsappGetBusinessAccount500 = InternalError;
247
+ const WhatsappGetBusinessAccount504 = GatewayTimeoutError;
248
+ const WhatsappDisconnectBusinessAccountPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: WhatsAppBusinessAccountId }))();
249
+ const WhatsappDisconnectBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struct({ success: Schema.Literal(true) }))();
250
+ const WhatsappDisconnectBusinessAccount400 = MalformedRequestError;
251
+ const WhatsappDisconnectBusinessAccount401 = UnauthorizedError;
252
+ const WhatsappDisconnectBusinessAccount403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
253
+ const WhatsappDisconnectBusinessAccount404 = ResourceNotFoundError;
254
+ const WhatsappDisconnectBusinessAccount422 = ValidationError;
255
+ const WhatsappDisconnectBusinessAccount500 = InternalError;
256
+ const WhatsappDisconnectBusinessAccount504 = GatewayTimeoutError;
257
+ const WhatsappUpdateBusinessAccountPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: WhatsAppBusinessAccountId }))();
258
+ const WhatsappUpdateBusinessAccountRequestJson = /* @__PURE__ */ (() => Schema.Struct({
259
+ displayName: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null])),
260
+ webhookUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
261
+ }))();
262
+ const WhatsappUpdateBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struct({
263
+ id: WhatsAppBusinessAccountId,
264
+ organizationId: Schema.String,
265
+ namespaceId: Schema.Union([NamespaceId, Schema.Null]),
266
+ phoneNumber: Schema.String,
267
+ phoneNumberId: Schema.String,
268
+ displayName: Schema.String,
269
+ whatsappBusinessAccountId: Schema.String,
270
+ verificationStatus: Schema.Union([
271
+ Schema.Literal("pending"),
272
+ Schema.Literal("verified"),
273
+ Schema.Literal("failed"),
274
+ Schema.Literal("suspended")
275
+ ]),
276
+ credentialStatus: Schema.Union([Schema.Literal("active"), Schema.Literal("reconnect_required")]),
277
+ tokenExpiresAt: Schema.Union([Schema.String, Schema.Null]),
278
+ isDefault: Schema.Boolean,
279
+ webhookUrl: Schema.Union([Schema.String, Schema.Null]),
280
+ qualityRating: Schema.Union([
281
+ Schema.Literal("green"),
282
+ Schema.Literal("yellow"),
283
+ Schema.Literal("red"),
284
+ Schema.Literal("unknown")
285
+ ]),
286
+ messagingLimit: Schema.Union([Schema.String, Schema.Null]),
287
+ currentLimit: 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" })),
288
+ businessPortfolioId: Schema.Union([Schema.String, Schema.Null]),
289
+ businessAppConnectedAt: Schema.Union([Schema.String, Schema.Null]),
290
+ businessAppDisconnectedAt: Schema.Union([Schema.String, Schema.Null]),
291
+ businessAppDisconnectReason: Schema.Union([Schema.Union([
292
+ Schema.Literal("partnerRemoved"),
293
+ Schema.Literal("offboarded"),
294
+ Schema.Literal("accountDisconnected"),
295
+ Schema.Literal("businessDowngrade"),
296
+ Schema.Literal("changeNumber"),
297
+ Schema.Literal("companionInactivity"),
298
+ Schema.Literal("primaryInactivity"),
299
+ Schema.Literal("userReRegistered")
300
+ ]), Schema.Null]),
301
+ contactsSyncRequestedAt: Schema.Union([Schema.String, Schema.Null]),
302
+ historySyncStatus: Schema.Union([Schema.Union([
303
+ Schema.Literal("requested"),
304
+ Schema.Literal("importing"),
305
+ Schema.Literal("completed"),
306
+ Schema.Literal("declined")
307
+ ]), Schema.Null]),
308
+ historySyncProgress: Schema.Union([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(100).annotate({ expected: "a value less than or equal to 100" })), Schema.Null]),
309
+ isActive: Schema.Boolean,
310
+ createdAt: Schema.String,
311
+ updatedAt: Schema.String
312
+ }))();
313
+ const WhatsappUpdateBusinessAccount400 = MalformedRequestError;
314
+ const WhatsappUpdateBusinessAccount401 = UnauthorizedError;
315
+ const WhatsappUpdateBusinessAccount403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
316
+ const WhatsappUpdateBusinessAccount404 = ResourceNotFoundError;
317
+ const WhatsappUpdateBusinessAccount422 = ValidationError;
318
+ const WhatsappUpdateBusinessAccount500 = InternalError;
319
+ const WhatsappUpdateBusinessAccount504 = GatewayTimeoutError;
320
+ const WhatsappSetDefaultBusinessAccountPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: WhatsAppBusinessAccountId }))();
321
+ const WhatsappSetDefaultBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struct({
322
+ id: WhatsAppBusinessAccountId,
323
+ organizationId: Schema.String,
324
+ namespaceId: Schema.Union([NamespaceId, Schema.Null]),
325
+ phoneNumber: Schema.String,
326
+ phoneNumberId: Schema.String,
327
+ displayName: Schema.String,
328
+ whatsappBusinessAccountId: Schema.String,
329
+ verificationStatus: Schema.Union([
330
+ Schema.Literal("pending"),
331
+ Schema.Literal("verified"),
332
+ Schema.Literal("failed"),
333
+ Schema.Literal("suspended")
334
+ ]),
335
+ credentialStatus: Schema.Union([Schema.Literal("active"), Schema.Literal("reconnect_required")]),
336
+ tokenExpiresAt: Schema.Union([Schema.String, Schema.Null]),
337
+ isDefault: Schema.Boolean,
338
+ webhookUrl: Schema.Union([Schema.String, Schema.Null]),
339
+ qualityRating: Schema.Union([
340
+ Schema.Literal("green"),
341
+ Schema.Literal("yellow"),
342
+ Schema.Literal("red"),
343
+ Schema.Literal("unknown")
344
+ ]),
345
+ messagingLimit: Schema.Union([Schema.String, Schema.Null]),
346
+ currentLimit: 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" })),
347
+ businessPortfolioId: Schema.Union([Schema.String, Schema.Null]),
348
+ businessAppConnectedAt: Schema.Union([Schema.String, Schema.Null]),
349
+ businessAppDisconnectedAt: Schema.Union([Schema.String, Schema.Null]),
350
+ businessAppDisconnectReason: Schema.Union([Schema.Union([
351
+ Schema.Literal("partnerRemoved"),
352
+ Schema.Literal("offboarded"),
353
+ Schema.Literal("accountDisconnected"),
354
+ Schema.Literal("businessDowngrade"),
355
+ Schema.Literal("changeNumber"),
356
+ Schema.Literal("companionInactivity"),
357
+ Schema.Literal("primaryInactivity"),
358
+ Schema.Literal("userReRegistered")
359
+ ]), Schema.Null]),
360
+ contactsSyncRequestedAt: Schema.Union([Schema.String, Schema.Null]),
361
+ historySyncStatus: Schema.Union([Schema.Union([
362
+ Schema.Literal("requested"),
363
+ Schema.Literal("importing"),
364
+ Schema.Literal("completed"),
365
+ Schema.Literal("declined")
366
+ ]), Schema.Null]),
367
+ historySyncProgress: Schema.Union([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(100).annotate({ expected: "a value less than or equal to 100" })), Schema.Null]),
368
+ isActive: Schema.Boolean,
369
+ createdAt: Schema.String,
370
+ updatedAt: Schema.String
371
+ }))();
372
+ const WhatsappSetDefaultBusinessAccount400 = MalformedRequestError;
373
+ const WhatsappSetDefaultBusinessAccount401 = UnauthorizedError;
374
+ const WhatsappSetDefaultBusinessAccount403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
375
+ const WhatsappSetDefaultBusinessAccount404 = ResourceNotFoundError;
376
+ const WhatsappSetDefaultBusinessAccount422 = ValidationError;
377
+ const WhatsappSetDefaultBusinessAccount500 = InternalError;
378
+ const WhatsappSetDefaultBusinessAccount504 = GatewayTimeoutError;
379
+ const WhatsappSyncAccountStatusPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: WhatsAppBusinessAccountId }))();
380
+ const WhatsappSyncAccountStatus200 = /* @__PURE__ */ (() => Schema.Struct({
381
+ id: WhatsAppBusinessAccountId,
382
+ qualityRating: Schema.Union([
383
+ Schema.Literal("green"),
384
+ Schema.Literal("yellow"),
385
+ Schema.Literal("red"),
386
+ Schema.Literal("unknown")
387
+ ]),
388
+ messagingLimit: Schema.Union([Schema.String, Schema.Null]),
389
+ currentLimit: 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" })),
390
+ businessPortfolioId: Schema.Union([Schema.String, Schema.Null]),
391
+ verificationStatus: Schema.Union([
392
+ Schema.Literal("pending"),
393
+ Schema.Literal("verified"),
394
+ Schema.Literal("failed"),
395
+ Schema.Literal("suspended")
396
+ ]),
397
+ syncedAt: Schema.String
398
+ }))();
399
+ const WhatsappSyncAccountStatus400 = MalformedRequestError;
400
+ const WhatsappSyncAccountStatus401 = UnauthorizedError;
401
+ const WhatsappSyncAccountStatus403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
402
+ const WhatsappSyncAccountStatus404 = ResourceNotFoundError;
403
+ const WhatsappSyncAccountStatus422 = ValidationError;
404
+ const WhatsappSyncAccountStatus500 = /* @__PURE__ */ (() => Schema.Union([InternalError, CredentialsError]))();
405
+ const WhatsappSyncAccountStatus502 = WhatsAppChannelError;
406
+ const WhatsappSyncAccountStatus504 = GatewayTimeoutError;
407
+ const WhatsappGetMediaDownloadUrlPathParams = /* @__PURE__ */ (() => Schema.Struct({ deliveryId: MessageDeliveryId }))();
408
+ const WhatsappGetMediaDownloadUrl200 = /* @__PURE__ */ (() => Schema.Struct({
409
+ url: SensitiveString,
410
+ expiresAt: Schema.String
411
+ }))();
412
+ const WhatsappGetMediaDownloadUrl400 = MalformedRequestError;
413
+ const WhatsappGetMediaDownloadUrl401 = UnauthorizedError;
414
+ const WhatsappGetMediaDownloadUrl403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
415
+ const WhatsappGetMediaDownloadUrl404 = ResourceNotFoundError;
416
+ const WhatsappGetMediaDownloadUrl422 = ValidationError;
417
+ const WhatsappGetMediaDownloadUrl500 = InternalError;
418
+ const WhatsappGetMediaDownloadUrl504 = GatewayTimeoutError;
419
+ const WhatsappGetServiceWindowBillingQuery = /* @__PURE__ */ (() => Schema.Struct({ serviceWindowId: WhatsAppServiceWindowId }))();
420
+ const WhatsappGetServiceWindowBilling200 = /* @__PURE__ */ (() => Schema.Struct({
421
+ totalMessages: 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" })),
422
+ totalFreeMessages: 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" })),
423
+ totalPaidMessages: 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" })),
424
+ estimatedProviderCosts: Schema.Array(MoneyAmount)
425
+ }))();
426
+ const WhatsappGetServiceWindowBilling400 = MalformedRequestError;
427
+ const WhatsappGetServiceWindowBilling401 = UnauthorizedError;
428
+ const WhatsappGetServiceWindowBilling403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
429
+ const WhatsappGetServiceWindowBilling404 = ResourceNotFoundError;
430
+ const WhatsappGetServiceWindowBilling422 = ValidationError;
431
+ const WhatsappGetServiceWindowBilling500 = InternalError;
432
+ const WhatsappGetServiceWindowBilling504 = GatewayTimeoutError;
433
+ const WhatsappGetServiceWindowStatusQuery = /* @__PURE__ */ (() => Schema.Struct({
434
+ customerPhone: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^\\+[1-9]\\d{1,14}$", "u")).annotate({ expected: "a string matching the RegExp ^\\+[1-9]\\d{1,14}$" })),
435
+ businessPhone: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^\\+[1-9]\\d{1,14}$", "u")).annotate({ expected: "a string matching the RegExp ^\\+[1-9]\\d{1,14}$" }))
436
+ }))();
437
+ const WhatsappGetServiceWindowStatus200 = /* @__PURE__ */ (() => Schema.Struct({
438
+ serviceWindowId: WhatsAppServiceWindowId,
439
+ isServiceWindowActive: Schema.Boolean,
440
+ isFreeEntryPointActive: Schema.Boolean,
441
+ serviceWindowExpiresAt: Schema.Union([Schema.String, Schema.Null]),
442
+ freeEntryPointExpiresAt: Schema.Union([Schema.String, Schema.Null])
443
+ }))();
444
+ const WhatsappGetServiceWindowStatus400 = MalformedRequestError;
445
+ const WhatsappGetServiceWindowStatus401 = UnauthorizedError;
446
+ const WhatsappGetServiceWindowStatus403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
447
+ const WhatsappGetServiceWindowStatus404 = ResourceNotFoundError;
448
+ const WhatsappGetServiceWindowStatus422 = ValidationError;
449
+ const WhatsappGetServiceWindowStatus500 = InternalError;
450
+ const WhatsappGetServiceWindowStatus504 = GatewayTimeoutError;
451
+ const WhatsappGetStatsQuery = /* @__PURE__ */ (() => Schema.Struct({
452
+ startDate: Schema.optionalKey(Schema.String),
453
+ endDate: Schema.optionalKey(Schema.String)
454
+ }))();
455
+ const WhatsappGetStats200 = /* @__PURE__ */ (() => Schema.Struct({
456
+ totalSent: 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" })),
457
+ totalDelivered: 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" })),
458
+ totalRead: 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" })),
459
+ totalFailed: 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" })),
460
+ deliveryRate: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
461
+ readRate: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
462
+ failureRate: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" }))
463
+ }))();
464
+ const WhatsappGetStats400 = MalformedRequestError;
465
+ const WhatsappGetStats401 = UnauthorizedError;
466
+ const WhatsappGetStats403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
467
+ const WhatsappGetStats422 = ValidationError;
468
+ const WhatsappGetStats500 = InternalError;
469
+ const WhatsappGetStats504 = GatewayTimeoutError;
470
+ const WhatsappGetTemplateStatsQuery = /* @__PURE__ */ (() => Schema.Struct({
471
+ startDate: Schema.optionalKey(Schema.String),
472
+ endDate: Schema.optionalKey(Schema.String),
473
+ templateId: Schema.optionalKey(TemplateId),
474
+ campaignId: Schema.optionalKey(CampaignId),
475
+ journeyId: Schema.optionalKey(JourneyId)
476
+ }))();
477
+ const WhatsappGetTemplateStats200 = WhatsAppTemplateStats;
478
+ const WhatsappGetTemplateStats400 = MalformedRequestError;
479
+ const WhatsappGetTemplateStats401 = UnauthorizedError;
480
+ const WhatsappGetTemplateStats403 = /* @__PURE__ */ (() => Schema.Union([FlagDisabledError, ForbiddenError]))();
481
+ const WhatsappGetTemplateStats422 = ValidationError;
482
+ const WhatsappGetTemplateStats500 = InternalError;
483
+ const WhatsappGetTemplateStats504 = GatewayTimeoutError;
484
+ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpoint.get("whatsappListBusinessAccounts", "/v1/whatsapp/business-accounts", {
485
+ query: WhatsappListBusinessAccountsQuery,
486
+ success: WhatsappListBusinessAccounts200,
487
+ error: [
488
+ WhatsappListBusinessAccounts400.pipe(HttpApiSchema.status(400)),
489
+ WhatsappListBusinessAccounts401.pipe(HttpApiSchema.status(401)),
490
+ WhatsappListBusinessAccounts403.pipe(HttpApiSchema.status(403)),
491
+ WhatsappListBusinessAccounts422.pipe(HttpApiSchema.status(422)),
492
+ WhatsappListBusinessAccounts500,
493
+ WhatsappListBusinessAccounts504.pipe(HttpApiSchema.status(504))
494
+ ]
495
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.listBusinessAccounts").annotate(OpenApi.Summary, "List WhatsApp business accounts").annotate(OpenApi.Description, "Returns a paginated list of the organization's connected WhatsApp business accounts."), HttpApiEndpoint.post("whatsappConnectBusinessAccount", "/v1/whatsapp/business-accounts", {
496
+ payload: WhatsappConnectBusinessAccountRequestJson,
497
+ success: WhatsappConnectBusinessAccount201.pipe(HttpApiSchema.status(201)),
498
+ error: [
499
+ WhatsappConnectBusinessAccount400.pipe(HttpApiSchema.status(400)),
500
+ WhatsappConnectBusinessAccount401.pipe(HttpApiSchema.status(401)),
501
+ WhatsappConnectBusinessAccount402.pipe(HttpApiSchema.status(402)),
502
+ WhatsappConnectBusinessAccount403.pipe(HttpApiSchema.status(403)),
503
+ WhatsappConnectBusinessAccount404.pipe(HttpApiSchema.status(404)),
504
+ WhatsappConnectBusinessAccount409.pipe(HttpApiSchema.status(409)),
505
+ WhatsappConnectBusinessAccount422.pipe(HttpApiSchema.status(422)),
506
+ WhatsappConnectBusinessAccount500,
507
+ WhatsappConnectBusinessAccount502.pipe(HttpApiSchema.status(502)),
508
+ WhatsappConnectBusinessAccount504.pipe(HttpApiSchema.status(504))
509
+ ]
510
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.connectBusinessAccount").annotate(OpenApi.Summary, "Connect a WhatsApp business account").annotate(OpenApi.Description, "Completes embedded signup: exchanges its code for the business's Meta token, checks the token grants Samva both WhatsApp permissions over the WABA, subscribes Samva to the WABA's webhooks, and registers the phone number with the Cloud API. A number that stays on the WhatsApp Business app (coexistence) is already registered, so it skips registration and Samva asks Meta to sync its contacts and chat history. A number Meta has not verified yet connects as pending; sync it once verification finishes."), HttpApiEndpoint.get("whatsappGetBusinessAccount", "/v1/whatsapp/business-accounts/:accountId", {
511
+ params: WhatsappGetBusinessAccountPathParams,
512
+ success: WhatsappGetBusinessAccount200,
513
+ error: [
514
+ WhatsappGetBusinessAccount400.pipe(HttpApiSchema.status(400)),
515
+ WhatsappGetBusinessAccount401.pipe(HttpApiSchema.status(401)),
516
+ WhatsappGetBusinessAccount403.pipe(HttpApiSchema.status(403)),
517
+ WhatsappGetBusinessAccount404.pipe(HttpApiSchema.status(404)),
518
+ WhatsappGetBusinessAccount422.pipe(HttpApiSchema.status(422)),
519
+ WhatsappGetBusinessAccount500,
520
+ WhatsappGetBusinessAccount504.pipe(HttpApiSchema.status(504))
521
+ ]
522
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.getBusinessAccount").annotate(OpenApi.Summary, "Get a WhatsApp business account").annotate(OpenApi.Description, "Returns a single connected WhatsApp business account by its identifier."), HttpApiEndpoint.delete("whatsappDisconnectBusinessAccount", "/v1/whatsapp/business-accounts/:accountId", {
523
+ params: WhatsappDisconnectBusinessAccountPathParams,
524
+ success: WhatsappDisconnectBusinessAccount200,
525
+ error: [
526
+ WhatsappDisconnectBusinessAccount400.pipe(HttpApiSchema.status(400)),
527
+ WhatsappDisconnectBusinessAccount401.pipe(HttpApiSchema.status(401)),
528
+ WhatsappDisconnectBusinessAccount403.pipe(HttpApiSchema.status(403)),
529
+ WhatsappDisconnectBusinessAccount404.pipe(HttpApiSchema.status(404)),
530
+ WhatsappDisconnectBusinessAccount422.pipe(HttpApiSchema.status(422)),
531
+ WhatsappDisconnectBusinessAccount500,
532
+ WhatsappDisconnectBusinessAccount504.pipe(HttpApiSchema.status(504))
533
+ ]
534
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.disconnectBusinessAccount").annotate(OpenApi.Summary, "Disconnect a WhatsApp business account").annotate(OpenApi.Description, "Disconnects a WhatsApp business account from the organization."), HttpApiEndpoint.patch("whatsappUpdateBusinessAccount", "/v1/whatsapp/business-accounts/:accountId", {
535
+ params: WhatsappUpdateBusinessAccountPathParams,
536
+ payload: WhatsappUpdateBusinessAccountRequestJson,
537
+ success: WhatsappUpdateBusinessAccount200,
538
+ error: [
539
+ WhatsappUpdateBusinessAccount400.pipe(HttpApiSchema.status(400)),
540
+ WhatsappUpdateBusinessAccount401.pipe(HttpApiSchema.status(401)),
541
+ WhatsappUpdateBusinessAccount403.pipe(HttpApiSchema.status(403)),
542
+ WhatsappUpdateBusinessAccount404.pipe(HttpApiSchema.status(404)),
543
+ WhatsappUpdateBusinessAccount422.pipe(HttpApiSchema.status(422)),
544
+ WhatsappUpdateBusinessAccount500,
545
+ WhatsappUpdateBusinessAccount504.pipe(HttpApiSchema.status(504))
546
+ ]
547
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.updateBusinessAccount").annotate(OpenApi.Summary, "Update a WhatsApp business account").annotate(OpenApi.Description, "Updates the display name or webhook settings of a connected WhatsApp business account."), HttpApiEndpoint.post("whatsappSetDefaultBusinessAccount", "/v1/whatsapp/business-accounts/:accountId/set-default", {
548
+ params: WhatsappSetDefaultBusinessAccountPathParams,
549
+ success: WhatsappSetDefaultBusinessAccount200,
550
+ error: [
551
+ WhatsappSetDefaultBusinessAccount400.pipe(HttpApiSchema.status(400)),
552
+ WhatsappSetDefaultBusinessAccount401.pipe(HttpApiSchema.status(401)),
553
+ WhatsappSetDefaultBusinessAccount403.pipe(HttpApiSchema.status(403)),
554
+ WhatsappSetDefaultBusinessAccount404.pipe(HttpApiSchema.status(404)),
555
+ WhatsappSetDefaultBusinessAccount422.pipe(HttpApiSchema.status(422)),
556
+ WhatsappSetDefaultBusinessAccount500,
557
+ WhatsappSetDefaultBusinessAccount504.pipe(HttpApiSchema.status(504))
558
+ ]
559
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.setDefaultBusinessAccount").annotate(OpenApi.Summary, "Set the default WhatsApp business account").annotate(OpenApi.Description, "Marks a connected WhatsApp business account as the organization's default and returns it."), HttpApiEndpoint.post("whatsappSyncAccountStatus", "/v1/whatsapp/business-accounts/:accountId/sync", {
560
+ params: WhatsappSyncAccountStatusPathParams,
561
+ success: WhatsappSyncAccountStatus200,
562
+ error: [
563
+ WhatsappSyncAccountStatus400.pipe(HttpApiSchema.status(400)),
564
+ WhatsappSyncAccountStatus401.pipe(HttpApiSchema.status(401)),
565
+ WhatsappSyncAccountStatus403.pipe(HttpApiSchema.status(403)),
566
+ WhatsappSyncAccountStatus404.pipe(HttpApiSchema.status(404)),
567
+ WhatsappSyncAccountStatus422.pipe(HttpApiSchema.status(422)),
568
+ WhatsappSyncAccountStatus500,
569
+ WhatsappSyncAccountStatus502.pipe(HttpApiSchema.status(502)),
570
+ WhatsappSyncAccountStatus504.pipe(HttpApiSchema.status(504))
571
+ ]
572
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.syncAccountStatus").annotate(OpenApi.Summary, "Sync a WhatsApp business account status").annotate(OpenApi.Description, "Reads the number's quality rating, messaging limit, and registration from Meta, and registers the number with the Cloud API if it is verified but not yet registered."), HttpApiEndpoint.get("whatsappGetMediaDownloadUrl", "/v1/whatsapp/media/:deliveryId/download-url", {
573
+ params: WhatsappGetMediaDownloadUrlPathParams,
574
+ success: WhatsappGetMediaDownloadUrl200,
575
+ error: [
576
+ WhatsappGetMediaDownloadUrl400.pipe(HttpApiSchema.status(400)),
577
+ WhatsappGetMediaDownloadUrl401.pipe(HttpApiSchema.status(401)),
578
+ WhatsappGetMediaDownloadUrl403.pipe(HttpApiSchema.status(403)),
579
+ WhatsappGetMediaDownloadUrl404.pipe(HttpApiSchema.status(404)),
580
+ WhatsappGetMediaDownloadUrl422.pipe(HttpApiSchema.status(422)),
581
+ WhatsappGetMediaDownloadUrl500,
582
+ WhatsappGetMediaDownloadUrl504.pipe(HttpApiSchema.status(504))
583
+ ]
584
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.getMediaDownloadUrl").annotate(OpenApi.Summary, "Get a WhatsApp media download URL").annotate(OpenApi.Description, "Returns a short-lived URL for the media an inbound WhatsApp delivery carried, when Samva stored it."), HttpApiEndpoint.get("whatsappGetServiceWindowBilling", "/v1/whatsapp/service-window/billing", {
585
+ query: WhatsappGetServiceWindowBillingQuery,
586
+ success: WhatsappGetServiceWindowBilling200,
587
+ error: [
588
+ WhatsappGetServiceWindowBilling400.pipe(HttpApiSchema.status(400)),
589
+ WhatsappGetServiceWindowBilling401.pipe(HttpApiSchema.status(401)),
590
+ WhatsappGetServiceWindowBilling403.pipe(HttpApiSchema.status(403)),
591
+ WhatsappGetServiceWindowBilling404.pipe(HttpApiSchema.status(404)),
592
+ WhatsappGetServiceWindowBilling422.pipe(HttpApiSchema.status(422)),
593
+ WhatsappGetServiceWindowBilling500,
594
+ WhatsappGetServiceWindowBilling504.pipe(HttpApiSchema.status(504))
595
+ ]
596
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.getServiceWindowBilling").annotate(OpenApi.Summary, "Get WhatsApp service window billing").annotate(OpenApi.Description, "Returns message counts and the estimated Meta cost for a WhatsApp service window."), HttpApiEndpoint.get("whatsappGetServiceWindowStatus", "/v1/whatsapp/service-window/status", {
597
+ query: WhatsappGetServiceWindowStatusQuery,
598
+ success: WhatsappGetServiceWindowStatus200,
599
+ error: [
600
+ WhatsappGetServiceWindowStatus400.pipe(HttpApiSchema.status(400)),
601
+ WhatsappGetServiceWindowStatus401.pipe(HttpApiSchema.status(401)),
602
+ WhatsappGetServiceWindowStatus403.pipe(HttpApiSchema.status(403)),
603
+ WhatsappGetServiceWindowStatus404.pipe(HttpApiSchema.status(404)),
604
+ WhatsappGetServiceWindowStatus422.pipe(HttpApiSchema.status(422)),
605
+ WhatsappGetServiceWindowStatus500,
606
+ WhatsappGetServiceWindowStatus504.pipe(HttpApiSchema.status(504))
607
+ ]
608
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.getServiceWindowStatus").annotate(OpenApi.Summary, "Get WhatsApp service window status").annotate(OpenApi.Description, "Returns whether the service window and free entry point are active for a customer and business phone pair."), HttpApiEndpoint.get("whatsappGetStats", "/v1/whatsapp/stats", {
609
+ query: WhatsappGetStatsQuery,
610
+ success: WhatsappGetStats200,
611
+ error: [
612
+ WhatsappGetStats400.pipe(HttpApiSchema.status(400)),
613
+ WhatsappGetStats401.pipe(HttpApiSchema.status(401)),
614
+ WhatsappGetStats403.pipe(HttpApiSchema.status(403)),
615
+ WhatsappGetStats422.pipe(HttpApiSchema.status(422)),
616
+ WhatsappGetStats500,
617
+ WhatsappGetStats504.pipe(HttpApiSchema.status(504))
618
+ ]
619
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.getStats").annotate(OpenApi.Summary, "Get WhatsApp messaging stats").annotate(OpenApi.Description, "Returns aggregate WhatsApp delivery, read, and failure statistics for the organization."), HttpApiEndpoint.get("whatsappGetTemplateStats", "/v1/whatsapp/templates/stats", {
620
+ query: WhatsappGetTemplateStatsQuery,
621
+ success: WhatsappGetTemplateStats200,
622
+ error: [
623
+ WhatsappGetTemplateStats400.pipe(HttpApiSchema.status(400)),
624
+ WhatsappGetTemplateStats401.pipe(HttpApiSchema.status(401)),
625
+ WhatsappGetTemplateStats403.pipe(HttpApiSchema.status(403)),
626
+ WhatsappGetTemplateStats422.pipe(HttpApiSchema.status(422)),
627
+ WhatsappGetTemplateStats500,
628
+ WhatsappGetTemplateStats504.pipe(HttpApiSchema.status(504))
629
+ ]
630
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.getTemplateStats").annotate(OpenApi.Summary, "Get WhatsApp template stats").annotate(OpenApi.Description, "Returns sent, delivered, read, and failed counts and Meta's estimated cost for each WhatsApp template, split by what sent it: a campaign, a journey step, or a direct send. Filter by template, campaign, journey, or the time the message was created.")).annotate(OpenApi.Description, "WhatsApp Cloud API messaging, service windows, and business accounts") {};
631
+ export { MoneyAmount, PaginationMeta, WhatsAppGroup, WhatsAppServiceWindowId, WhatsAppTemplateStats, WhatsAppTemplateStatsRow, WhatsAppTemplateStatsSource, WhatsappConnectBusinessAccount201, WhatsappConnectBusinessAccount400, WhatsappConnectBusinessAccount401, WhatsappConnectBusinessAccount402, WhatsappConnectBusinessAccount403, WhatsappConnectBusinessAccount404, WhatsappConnectBusinessAccount409, WhatsappConnectBusinessAccount422, WhatsappConnectBusinessAccount500, WhatsappConnectBusinessAccount502, WhatsappConnectBusinessAccount504, WhatsappConnectBusinessAccountRequestJson, WhatsappDisconnectBusinessAccount200, WhatsappDisconnectBusinessAccount400, WhatsappDisconnectBusinessAccount401, WhatsappDisconnectBusinessAccount403, WhatsappDisconnectBusinessAccount404, WhatsappDisconnectBusinessAccount422, WhatsappDisconnectBusinessAccount500, WhatsappDisconnectBusinessAccount504, WhatsappDisconnectBusinessAccountPathParams, WhatsappGetBusinessAccount200, WhatsappGetBusinessAccount400, WhatsappGetBusinessAccount401, WhatsappGetBusinessAccount403, WhatsappGetBusinessAccount404, WhatsappGetBusinessAccount422, WhatsappGetBusinessAccount500, WhatsappGetBusinessAccount504, WhatsappGetBusinessAccountPathParams, WhatsappGetMediaDownloadUrl200, WhatsappGetMediaDownloadUrl400, WhatsappGetMediaDownloadUrl401, WhatsappGetMediaDownloadUrl403, WhatsappGetMediaDownloadUrl404, WhatsappGetMediaDownloadUrl422, WhatsappGetMediaDownloadUrl500, WhatsappGetMediaDownloadUrl504, WhatsappGetMediaDownloadUrlPathParams, WhatsappGetServiceWindowBilling200, WhatsappGetServiceWindowBilling400, WhatsappGetServiceWindowBilling401, WhatsappGetServiceWindowBilling403, WhatsappGetServiceWindowBilling404, WhatsappGetServiceWindowBilling422, WhatsappGetServiceWindowBilling500, WhatsappGetServiceWindowBilling504, WhatsappGetServiceWindowBillingQuery, WhatsappGetServiceWindowStatus200, WhatsappGetServiceWindowStatus400, WhatsappGetServiceWindowStatus401, WhatsappGetServiceWindowStatus403, WhatsappGetServiceWindowStatus404, WhatsappGetServiceWindowStatus422, WhatsappGetServiceWindowStatus500, WhatsappGetServiceWindowStatus504, WhatsappGetServiceWindowStatusQuery, WhatsappGetStats200, WhatsappGetStats400, WhatsappGetStats401, WhatsappGetStats403, WhatsappGetStats422, WhatsappGetStats500, WhatsappGetStats504, WhatsappGetStatsQuery, WhatsappGetTemplateStats200, WhatsappGetTemplateStats400, WhatsappGetTemplateStats401, WhatsappGetTemplateStats403, WhatsappGetTemplateStats422, WhatsappGetTemplateStats500, WhatsappGetTemplateStats504, WhatsappGetTemplateStatsQuery, WhatsappListBusinessAccounts200, WhatsappListBusinessAccounts400, WhatsappListBusinessAccounts401, WhatsappListBusinessAccounts403, WhatsappListBusinessAccounts422, WhatsappListBusinessAccounts500, WhatsappListBusinessAccounts504, WhatsappListBusinessAccountsQuery, WhatsappSetDefaultBusinessAccount200, WhatsappSetDefaultBusinessAccount400, WhatsappSetDefaultBusinessAccount401, WhatsappSetDefaultBusinessAccount403, WhatsappSetDefaultBusinessAccount404, WhatsappSetDefaultBusinessAccount422, WhatsappSetDefaultBusinessAccount500, WhatsappSetDefaultBusinessAccount504, WhatsappSetDefaultBusinessAccountPathParams, WhatsappSyncAccountStatus200, WhatsappSyncAccountStatus400, WhatsappSyncAccountStatus401, WhatsappSyncAccountStatus403, WhatsappSyncAccountStatus404, WhatsappSyncAccountStatus422, WhatsappSyncAccountStatus500, WhatsappSyncAccountStatus502, WhatsappSyncAccountStatus504, WhatsappSyncAccountStatusPathParams, WhatsappUpdateBusinessAccount200, WhatsappUpdateBusinessAccount400, WhatsappUpdateBusinessAccount401, WhatsappUpdateBusinessAccount403, WhatsappUpdateBusinessAccount404, WhatsappUpdateBusinessAccount422, WhatsappUpdateBusinessAccount500, WhatsappUpdateBusinessAccount504, WhatsappUpdateBusinessAccountPathParams, WhatsappUpdateBusinessAccountRequestJson };
632
+
633
+ //# sourceMappingURL=whats-app.js.map