samva 0.55.0 → 0.56.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 (235) hide show
  1. package/AGENTS.md +2 -2
  2. package/README.md +9 -8
  3. package/dist/client/sdk.gen.d.ts +13 -4
  4. package/dist/client/sdk.gen.js +32 -1
  5. package/dist/client/types.gen.d.ts +66 -6
  6. package/dist/effect/accounts.js +9 -10
  7. package/dist/effect/agents.js +16 -17
  8. package/dist/effect/analytics.js +9 -10
  9. package/dist/effect/api-keys.js +11 -12
  10. package/dist/effect/approval-requests.js +7 -8
  11. package/dist/effect/attachments.js +7 -8
  12. package/dist/effect/brands.js +9 -10
  13. package/dist/effect/campaigns.js +18 -19
  14. package/dist/effect/contact-groups.js +13 -14
  15. package/dist/effect/contacts.js +29 -30
  16. package/dist/effect/conversations.js +16 -17
  17. package/dist/effect/custom-fields.js +7 -8
  18. package/dist/effect/descriptors/accounts.d.ts +50 -52
  19. package/dist/effect/descriptors/accounts.js +50 -52
  20. package/dist/effect/descriptors/agents.d.ts +113 -115
  21. package/dist/effect/descriptors/agents.js +120 -122
  22. package/dist/effect/descriptors/analytics.d.ts +47 -49
  23. package/dist/effect/descriptors/analytics.js +42 -44
  24. package/dist/effect/descriptors/api-keys.d.ts +69 -71
  25. package/dist/effect/descriptors/api-keys.js +73 -75
  26. package/dist/effect/descriptors/approval-requests.d.ts +34 -36
  27. package/dist/effect/descriptors/approval-requests.js +36 -38
  28. package/dist/effect/descriptors/attachments.d.ts +34 -36
  29. package/dist/effect/descriptors/attachments.js +36 -38
  30. package/dist/effect/descriptors/brands.d.ts +51 -53
  31. package/dist/effect/descriptors/brands.js +53 -55
  32. package/dist/effect/descriptors/campaigns.d.ts +130 -132
  33. package/dist/effect/descriptors/campaigns.js +137 -139
  34. package/dist/effect/descriptors/contact-groups.d.ts +86 -88
  35. package/dist/effect/descriptors/contact-groups.js +90 -92
  36. package/dist/effect/descriptors/contacts.d.ts +242 -244
  37. package/dist/effect/descriptors/contacts.js +227 -229
  38. package/dist/effect/descriptors/conversations.d.ts +114 -116
  39. package/dist/effect/descriptors/conversations.js +123 -125
  40. package/dist/effect/descriptors/custom-fields.d.ts +33 -35
  41. package/dist/effect/descriptors/custom-fields.js +33 -35
  42. package/dist/effect/descriptors/email.d.ts +623 -625
  43. package/dist/effect/descriptors/email.js +562 -578
  44. package/dist/effect/descriptors/events.d.ts +15 -17
  45. package/dist/effect/descriptors/events.js +14 -16
  46. package/dist/effect/descriptors/feedback.d.ts +7 -9
  47. package/dist/effect/descriptors/feedback.js +3 -3
  48. package/dist/effect/descriptors/integrations-catalog.d.ts +159 -161
  49. package/dist/effect/descriptors/integrations-catalog.js +142 -144
  50. package/dist/effect/descriptors/integrations.d.ts +60 -62
  51. package/dist/effect/descriptors/integrations.js +63 -65
  52. package/dist/effect/descriptors/journeys.d.ts +123 -125
  53. package/dist/effect/descriptors/journeys.js +133 -135
  54. package/dist/effect/descriptors/logs.d.ts +16 -18
  55. package/dist/effect/descriptors/logs.js +16 -18
  56. package/dist/effect/descriptors/mailboxes.d.ts +780 -782
  57. package/dist/effect/descriptors/mailboxes.js +795 -797
  58. package/dist/effect/descriptors/media.d.ts +43 -45
  59. package/dist/effect/descriptors/media.js +46 -48
  60. package/dist/effect/descriptors/messages.d.ts +86 -88
  61. package/dist/effect/descriptors/messages.js +83 -92
  62. package/dist/effect/descriptors/namespaces.d.ts +96 -98
  63. package/dist/effect/descriptors/namespaces.js +107 -109
  64. package/dist/effect/descriptors/newsletter-domains.d.ts +35 -37
  65. package/dist/effect/descriptors/newsletter-domains.js +39 -41
  66. package/dist/effect/descriptors/newsletter-issues.d.ts +98 -100
  67. package/dist/effect/descriptors/newsletter-issues.js +109 -111
  68. package/dist/effect/descriptors/newsletters.d.ts +43 -45
  69. package/dist/effect/descriptors/newsletters.js +46 -48
  70. package/dist/effect/descriptors/operations.d.ts +25 -27
  71. package/dist/effect/descriptors/operations.js +26 -28
  72. package/dist/effect/descriptors/organizations.d.ts +96 -98
  73. package/dist/effect/descriptors/organizations.js +86 -88
  74. package/dist/effect/descriptors/phone-numbers.d.ts +41 -43
  75. package/dist/effect/descriptors/phone-numbers.js +40 -42
  76. package/dist/effect/descriptors/policies.d.ts +26 -28
  77. package/dist/effect/descriptors/policies.js +29 -31
  78. package/dist/effect/descriptors/scheduled-messages.d.ts +42 -44
  79. package/dist/effect/descriptors/scheduled-messages.js +43 -45
  80. package/dist/effect/descriptors/subscriptions.d.ts +7 -9
  81. package/dist/effect/descriptors/subscriptions.js +3 -3
  82. package/dist/effect/descriptors/template-registrations.d.ts +26 -28
  83. package/dist/effect/descriptors/template-registrations.js +29 -31
  84. package/dist/effect/descriptors/template-share-links.d.ts +44 -46
  85. package/dist/effect/descriptors/template-share-links.js +49 -51
  86. package/dist/effect/descriptors/templates.d.ts +361 -363
  87. package/dist/effect/descriptors/templates.js +348 -350
  88. package/dist/effect/descriptors/topic-forms.d.ts +44 -46
  89. package/dist/effect/descriptors/topic-forms.js +49 -51
  90. package/dist/effect/descriptors/topics.d.ts +77 -79
  91. package/dist/effect/descriptors/topics.js +80 -82
  92. package/dist/effect/descriptors/webhooks.d.ts +96 -98
  93. package/dist/effect/descriptors/webhooks.js +103 -105
  94. package/dist/effect/descriptors/whats-app-flows.d.ts +86 -88
  95. package/dist/effect/descriptors/whats-app-flows.js +90 -92
  96. package/dist/effect/descriptors/whats-app-setup-links.d.ts +33 -35
  97. package/dist/effect/descriptors/whats-app-setup-links.js +33 -35
  98. package/dist/effect/descriptors/whats-app.d.ts +111 -103
  99. package/dist/effect/descriptors/whats-app.js +111 -103
  100. package/dist/effect/descriptors/whoami.d.ts +7 -9
  101. package/dist/effect/descriptors/whoami.js +3 -3
  102. package/dist/effect/email.js +66 -67
  103. package/dist/effect/events.js +5 -6
  104. package/dist/effect/feedback.js +4 -4
  105. package/dist/effect/generated/accounts.d.ts +144 -142
  106. package/dist/effect/generated/accounts.js +14 -9
  107. package/dist/effect/generated/agents.d.ts +1502 -1493
  108. package/dist/effect/generated/agents.js +28 -16
  109. package/dist/effect/generated/analytics.d.ts +55 -53
  110. package/dist/effect/generated/analytics.js +14 -9
  111. package/dist/effect/generated/api-keys.d.ts +216 -212
  112. package/dist/effect/generated/api-keys.js +18 -11
  113. package/dist/effect/generated/approval-requests.d.ts +60 -60
  114. package/dist/effect/generated/approval-requests.js +10 -7
  115. package/dist/effect/generated/attachments.d.ts +32 -32
  116. package/dist/effect/generated/attachments.js +10 -7
  117. package/dist/effect/generated/brands.d.ts +179 -177
  118. package/dist/effect/generated/brands.js +14 -9
  119. package/dist/effect/generated/campaigns.d.ts +1083 -1072
  120. package/dist/effect/generated/campaigns.js +32 -18
  121. package/dist/effect/generated/contact-events.d.ts +3 -6
  122. package/dist/effect/generated/contact-events.js +4 -4
  123. package/dist/effect/generated/contact-groups.d.ts +186 -180
  124. package/dist/effect/generated/contact-groups.js +22 -13
  125. package/dist/effect/generated/contacts.d.ts +1565 -1545
  126. package/dist/effect/generated/contacts.js +50 -27
  127. package/dist/effect/generated/conversations.d.ts +340 -331
  128. package/dist/effect/generated/conversations.js +28 -16
  129. package/dist/effect/generated/custom-fields.d.ts +63 -63
  130. package/dist/effect/generated/custom-fields.js +10 -7
  131. package/dist/effect/generated/email.d.ts +2731 -2671
  132. package/dist/effect/generated/email.js +130 -67
  133. package/dist/effect/generated/events.d.ts +160 -162
  134. package/dist/effect/generated/events.js +6 -5
  135. package/dist/effect/generated/feedback.d.ts +3 -6
  136. package/dist/effect/generated/feedback.js +4 -4
  137. package/dist/effect/generated/index.d.ts +174 -45
  138. package/dist/effect/generated/integrations-catalog.d.ts +459 -446
  139. package/dist/effect/generated/integrations-catalog.js +36 -20
  140. package/dist/effect/generated/integrations.d.ts +155 -152
  141. package/dist/effect/generated/integrations.js +16 -10
  142. package/dist/effect/generated/journeys.d.ts +864 -854
  143. package/dist/effect/generated/journeys.js +30 -17
  144. package/dist/effect/generated/logs.d.ts +147 -149
  145. package/dist/effect/generated/logs.js +6 -5
  146. package/dist/effect/generated/mailboxes.d.ts +7271 -7196
  147. package/dist/effect/generated/mailboxes.js +160 -82
  148. package/dist/effect/generated/media.d.ts +77 -76
  149. package/dist/effect/generated/media.js +12 -8
  150. package/dist/effect/generated/messages.d.ts +1092 -1086
  151. package/dist/effect/generated/messages.js +22 -13
  152. package/dist/effect/generated/namespaces.d.ts +184 -177
  153. package/dist/effect/generated/namespaces.js +24 -14
  154. package/dist/effect/generated/newsletter-domains.d.ts +57 -57
  155. package/dist/effect/generated/newsletter-domains.js +10 -7
  156. package/dist/effect/generated/newsletter-issues.d.ts +225 -218
  157. package/dist/effect/generated/newsletter-issues.js +24 -14
  158. package/dist/effect/generated/newsletters.d.ts +46 -45
  159. package/dist/effect/generated/newsletters.js +12 -8
  160. package/dist/effect/generated/operations.d.ts +79 -80
  161. package/dist/effect/generated/operations.js +8 -6
  162. package/dist/effect/generated/organizations.d.ts +438 -430
  163. package/dist/effect/generated/organizations.js +26 -15
  164. package/dist/effect/generated/phone-numbers.d.ts +87 -86
  165. package/dist/effect/generated/phone-numbers.js +12 -8
  166. package/dist/effect/generated/policies.d.ts +64 -65
  167. package/dist/effect/generated/policies.js +8 -6
  168. package/dist/effect/generated/scheduled-messages.d.ts +66 -65
  169. package/dist/effect/generated/scheduled-messages.js +12 -8
  170. package/dist/effect/generated/shared.d.ts +37 -37
  171. package/dist/effect/generated/shared.js +63 -61
  172. package/dist/effect/generated/subscriptions.d.ts +3 -6
  173. package/dist/effect/generated/subscriptions.js +4 -4
  174. package/dist/effect/generated/template-registrations.d.ts +142 -134
  175. package/dist/effect/generated/template-registrations.js +9 -6
  176. package/dist/effect/generated/template-share-links.d.ts +25 -24
  177. package/dist/effect/generated/template-share-links.js +12 -8
  178. package/dist/effect/generated/templates.d.ts +2678 -2645
  179. package/dist/effect/generated/templates.js +76 -40
  180. package/dist/effect/generated/topic-forms.d.ts +47 -46
  181. package/dist/effect/generated/topic-forms.js +12 -8
  182. package/dist/effect/generated/topics.d.ts +204 -199
  183. package/dist/effect/generated/topics.js +20 -12
  184. package/dist/effect/generated/webhooks.d.ts +284 -277
  185. package/dist/effect/generated/webhooks.js +28 -14
  186. package/dist/effect/generated/whats-app-flows.d.ts +250 -244
  187. package/dist/effect/generated/whats-app-flows.js +22 -13
  188. package/dist/effect/generated/whats-app-setup-links.d.ts +107 -107
  189. package/dist/effect/generated/whats-app-setup-links.js +10 -7
  190. package/dist/effect/generated/whats-app.d.ts +482 -298
  191. package/dist/effect/generated/whats-app.js +58 -16
  192. package/dist/effect/generated/whoami.d.ts +3 -6
  193. package/dist/effect/generated/whoami.js +4 -4
  194. package/dist/effect/generated-metadata.d.ts +6 -0
  195. package/dist/effect/generated-metadata.js +1 -0
  196. package/dist/effect/integrations-catalog.js +20 -21
  197. package/dist/effect/integrations.js +10 -11
  198. package/dist/effect/internal/client.d.ts +2 -1
  199. package/dist/effect/internal/client.js +3 -3
  200. package/dist/effect/internal/email-sender.js +5 -4
  201. package/dist/effect/internal/operation.d.ts +11 -7
  202. package/dist/effect/internal/operation.js +17 -12
  203. package/dist/effect/internal/send.js +11 -8
  204. package/dist/effect/journeys.js +17 -18
  205. package/dist/effect/logs.js +5 -6
  206. package/dist/effect/mailboxes.js +82 -83
  207. package/dist/effect/media.js +8 -9
  208. package/dist/effect/messages.js +12 -13
  209. package/dist/effect/namespaces.js +14 -15
  210. package/dist/effect/newsletter-domains.js +7 -8
  211. package/dist/effect/newsletter-issues.js +14 -15
  212. package/dist/effect/newsletters.js +8 -9
  213. package/dist/effect/operations.js +6 -7
  214. package/dist/effect/organizations.js +15 -16
  215. package/dist/effect/phone-numbers.js +8 -9
  216. package/dist/effect/policies.js +6 -7
  217. package/dist/effect/runtime.js +3 -3
  218. package/dist/effect/scheduled-messages.js +8 -9
  219. package/dist/effect/subscriptions.js +4 -4
  220. package/dist/effect/template-registrations.js +6 -7
  221. package/dist/effect/template-share-links.js +8 -9
  222. package/dist/effect/templates.js +40 -41
  223. package/dist/effect/topic-forms.js +8 -9
  224. package/dist/effect/topics.js +12 -13
  225. package/dist/effect/webhooks.d.ts +4 -4
  226. package/dist/effect/webhooks.js +14 -15
  227. package/dist/effect/whatsapp-flows.js +13 -14
  228. package/dist/effect/whatsapp-setup-links.js +7 -8
  229. package/dist/effect/whatsapp.d.ts +6 -0
  230. package/dist/effect/whatsapp.js +18 -17
  231. package/dist/effect/whoami.js +4 -4
  232. package/dist/package.json.js +1 -1
  233. package/dist/promises/types.gen.d.ts +1 -1
  234. package/dist/service-map.d.ts +5 -0
  235. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
1
  import { NonEmptySensitiveString, SensitiveString } from "../runtime.js";
2
- import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
2
+ import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
3
3
  import * as Schema from "effect/Schema";
4
- import { ApiKeySecurityMiddleware, BillingProviderError, CampaignId, ConflictError, CredentialsError, ForbiddenError, GatewayTimeoutError, InternalError, JourneyId, MalformedRequestError, MessageDeliveryId, NamespaceId, PaymentRequiredError, ResourceNotFoundError, TemplateId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError } from "./shared.js";
4
+ import { ApiKeySecurityMiddleware, BillingProviderError, CampaignId, ConflictError, CredentialsError, ForbiddenError, GatewayTimeoutError, InternalError, JourneyId, MalformedRequestError, MessageDeliveryId, NamespaceId, OrganizationId, PaymentRequiredError, ResourceNotFoundError, TemplateId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError } from "./shared.js";
5
5
  // src/effect/generated/whats-app.ts
6
6
  const WhatsAppServiceWindowId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(new globalThis.RegExp("^wasw_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
7
7
  expected: "a string matching the RegExp ^wasw_[0-9a-hjkmnp-tv-z]{16,24}$",
@@ -107,6 +107,7 @@ const WhatsappListBusinessAccounts200 = /* @__PURE__ */ (() => Schema.Struct({
107
107
  ]), Schema.Null]),
108
108
  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]),
109
109
  isActive: Schema.Boolean,
110
+ releasedAt: Schema.optionalKey(Schema.String),
110
111
  createdAt: Schema.String,
111
112
  updatedAt: Schema.String
112
113
  })),
@@ -177,6 +178,7 @@ const WhatsappConnectBusinessAccount201 = /* @__PURE__ */ (() => Schema.Struct({
177
178
  ]), Schema.Null]),
178
179
  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]),
179
180
  isActive: Schema.Boolean,
181
+ releasedAt: Schema.optionalKey(Schema.String),
180
182
  createdAt: Schema.String,
181
183
  updatedAt: Schema.String
182
184
  }))();
@@ -244,6 +246,7 @@ const WhatsappGetBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struct({
244
246
  ]), Schema.Null]),
245
247
  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]),
246
248
  isActive: Schema.Boolean,
249
+ releasedAt: Schema.optionalKey(Schema.String),
247
250
  createdAt: Schema.String,
248
251
  updatedAt: Schema.String
249
252
  }))();
@@ -321,6 +324,7 @@ const WhatsappUpdateBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struct({
321
324
  ]), Schema.Null]),
322
325
  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]),
323
326
  isActive: Schema.Boolean,
327
+ releasedAt: Schema.optionalKey(Schema.String),
324
328
  createdAt: Schema.String,
325
329
  updatedAt: Schema.String
326
330
  }))();
@@ -331,6 +335,17 @@ const WhatsappUpdateBusinessAccount404 = ResourceNotFoundError;
331
335
  const WhatsappUpdateBusinessAccount422 = ValidationError;
332
336
  const WhatsappUpdateBusinessAccount500 = InternalError;
333
337
  const WhatsappUpdateBusinessAccount504 = GatewayTimeoutError;
338
+ const WhatsappReleaseBusinessAccountPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: WhatsAppBusinessAccountId }))();
339
+ const WhatsappReleaseBusinessAccountRequestJson = /* @__PURE__ */ (() => Schema.Struct({ targetOrganizationId: OrganizationId }))();
340
+ const WhatsappReleaseBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struct({ success: Schema.Literal(true) }))();
341
+ const WhatsappReleaseBusinessAccount400 = MalformedRequestError;
342
+ const WhatsappReleaseBusinessAccount401 = UnauthorizedError;
343
+ const WhatsappReleaseBusinessAccount403 = ForbiddenError;
344
+ const WhatsappReleaseBusinessAccount404 = ResourceNotFoundError;
345
+ const WhatsappReleaseBusinessAccount409 = ConflictError;
346
+ const WhatsappReleaseBusinessAccount422 = ValidationError;
347
+ const WhatsappReleaseBusinessAccount500 = InternalError;
348
+ const WhatsappReleaseBusinessAccount504 = GatewayTimeoutError;
334
349
  const WhatsappSetDefaultBusinessAccountPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: WhatsAppBusinessAccountId }))();
335
350
  const WhatsappSetDefaultBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struct({
336
351
  id: WhatsAppBusinessAccountId,
@@ -385,6 +400,7 @@ const WhatsappSetDefaultBusinessAccount200 = /* @__PURE__ */ (() => Schema.Struc
385
400
  ]), Schema.Null]),
386
401
  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]),
387
402
  isActive: Schema.Boolean,
403
+ releasedAt: Schema.optionalKey(Schema.String),
388
404
  createdAt: Schema.String,
389
405
  updatedAt: Schema.String
390
406
  }))();
@@ -500,7 +516,7 @@ const WhatsappGetTemplateStats403 = ForbiddenError;
500
516
  const WhatsappGetTemplateStats422 = ValidationError;
501
517
  const WhatsappGetTemplateStats500 = InternalError;
502
518
  const WhatsappGetTemplateStats504 = GatewayTimeoutError;
503
- var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpoint.get("whatsappListBusinessAccounts", "/v1/whatsapp/business-accounts", {
519
+ const WhatsappListBusinessAccountsEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.get("whatsappListBusinessAccounts", "/v1/whatsapp/business-accounts", {
504
520
  query: WhatsappListBusinessAccountsQuery,
505
521
  success: WhatsappListBusinessAccounts200,
506
522
  error: [
@@ -511,7 +527,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
511
527
  WhatsappListBusinessAccounts500,
512
528
  WhatsappListBusinessAccounts504.pipe(HttpApiSchema.status(504))
513
529
  ]
514
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.listBusinessAccounts").annotate(OpenApi.Summary, "List WhatsApp business accounts").annotate(OpenApi.Description, "Lists connected WhatsApp business accounts, newest first. Pass nextCursor back as cursor to continue."), HttpApiEndpoint.post("whatsappConnectBusinessAccount", "/v1/whatsapp/business-accounts", {
530
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.listBusinessAccounts").annotate(OpenApi.Summary, "List WhatsApp business accounts").annotate(OpenApi.Description, "Lists connected WhatsApp business accounts, newest first. Pass nextCursor back as cursor to continue."))();
531
+ const WhatsappConnectBusinessAccountEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.post("whatsappConnectBusinessAccount", "/v1/whatsapp/business-accounts", {
515
532
  payload: WhatsappConnectBusinessAccountRequestJson,
516
533
  success: WhatsappConnectBusinessAccount201.pipe(HttpApiSchema.status(201)),
517
534
  error: [
@@ -526,7 +543,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
526
543
  WhatsappConnectBusinessAccount502.pipe(HttpApiSchema.status(502)),
527
544
  WhatsappConnectBusinessAccount504.pipe(HttpApiSchema.status(504))
528
545
  ]
529
- }).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", {
546
+ }).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."))();
547
+ const WhatsappGetBusinessAccountEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.get("whatsappGetBusinessAccount", "/v1/whatsapp/business-accounts/:accountId", {
530
548
  params: WhatsappGetBusinessAccountPathParams,
531
549
  success: WhatsappGetBusinessAccount200,
532
550
  error: [
@@ -538,7 +556,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
538
556
  WhatsappGetBusinessAccount500,
539
557
  WhatsappGetBusinessAccount504.pipe(HttpApiSchema.status(504))
540
558
  ]
541
- }).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", {
559
+ }).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."))();
560
+ const WhatsappDisconnectBusinessAccountEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.delete("whatsappDisconnectBusinessAccount", "/v1/whatsapp/business-accounts/:accountId", {
542
561
  params: WhatsappDisconnectBusinessAccountPathParams,
543
562
  success: WhatsappDisconnectBusinessAccount200,
544
563
  error: [
@@ -550,7 +569,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
550
569
  WhatsappDisconnectBusinessAccount500,
551
570
  WhatsappDisconnectBusinessAccount504.pipe(HttpApiSchema.status(504))
552
571
  ]
553
- }).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", {
572
+ }).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."))();
573
+ const WhatsappUpdateBusinessAccountEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.patch("whatsappUpdateBusinessAccount", "/v1/whatsapp/business-accounts/:accountId", {
554
574
  params: WhatsappUpdateBusinessAccountPathParams,
555
575
  payload: WhatsappUpdateBusinessAccountRequestJson,
556
576
  success: WhatsappUpdateBusinessAccount200,
@@ -563,7 +583,23 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
563
583
  WhatsappUpdateBusinessAccount500,
564
584
  WhatsappUpdateBusinessAccount504.pipe(HttpApiSchema.status(504))
565
585
  ]
566
- }).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", {
586
+ }).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."))();
587
+ const WhatsappReleaseBusinessAccountEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.post("whatsappReleaseBusinessAccount", "/v1/whatsapp/business-accounts/:accountId/release", {
588
+ params: WhatsappReleaseBusinessAccountPathParams,
589
+ payload: WhatsappReleaseBusinessAccountRequestJson,
590
+ success: WhatsappReleaseBusinessAccount200,
591
+ error: [
592
+ WhatsappReleaseBusinessAccount400.pipe(HttpApiSchema.status(400)),
593
+ WhatsappReleaseBusinessAccount401.pipe(HttpApiSchema.status(401)),
594
+ WhatsappReleaseBusinessAccount403.pipe(HttpApiSchema.status(403)),
595
+ WhatsappReleaseBusinessAccount404.pipe(HttpApiSchema.status(404)),
596
+ WhatsappReleaseBusinessAccount409.pipe(HttpApiSchema.status(409)),
597
+ WhatsappReleaseBusinessAccount422.pipe(HttpApiSchema.status(422)),
598
+ WhatsappReleaseBusinessAccount500,
599
+ WhatsappReleaseBusinessAccount504.pipe(HttpApiSchema.status(504))
600
+ ]
601
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whatsapp.releaseBusinessAccount").annotate(OpenApi.Summary, "Release a WhatsApp number to another organization").annotate(OpenApi.Description, "Reserves a disconnected WhatsApp number for the named Samva organization. The recipient claims it through fresh Meta Embedded Signup for the same WhatsApp Business Account, Meta phone number ID, and E.164 number. The old account remains in history and cannot reconnect."))();
602
+ const WhatsappSetDefaultBusinessAccountEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.post("whatsappSetDefaultBusinessAccount", "/v1/whatsapp/business-accounts/:accountId/set-default", {
567
603
  params: WhatsappSetDefaultBusinessAccountPathParams,
568
604
  success: WhatsappSetDefaultBusinessAccount200,
569
605
  error: [
@@ -575,7 +611,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
575
611
  WhatsappSetDefaultBusinessAccount500,
576
612
  WhatsappSetDefaultBusinessAccount504.pipe(HttpApiSchema.status(504))
577
613
  ]
578
- }).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", {
614
+ }).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."))();
615
+ const WhatsappSyncAccountStatusEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.post("whatsappSyncAccountStatus", "/v1/whatsapp/business-accounts/:accountId/sync", {
579
616
  params: WhatsappSyncAccountStatusPathParams,
580
617
  success: WhatsappSyncAccountStatus200,
581
618
  error: [
@@ -588,7 +625,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
588
625
  WhatsappSyncAccountStatus502.pipe(HttpApiSchema.status(502)),
589
626
  WhatsappSyncAccountStatus504.pipe(HttpApiSchema.status(504))
590
627
  ]
591
- }).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", {
628
+ }).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."))();
629
+ const WhatsappGetMediaDownloadUrlEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.get("whatsappGetMediaDownloadUrl", "/v1/whatsapp/media/:deliveryId/download-url", {
592
630
  params: WhatsappGetMediaDownloadUrlPathParams,
593
631
  success: WhatsappGetMediaDownloadUrl200,
594
632
  error: [
@@ -600,7 +638,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
600
638
  WhatsappGetMediaDownloadUrl500,
601
639
  WhatsappGetMediaDownloadUrl504.pipe(HttpApiSchema.status(504))
602
640
  ]
603
- }).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", {
641
+ }).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."))();
642
+ const WhatsappGetServiceWindowBillingEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.get("whatsappGetServiceWindowBilling", "/v1/whatsapp/service-window/billing", {
604
643
  query: WhatsappGetServiceWindowBillingQuery,
605
644
  success: WhatsappGetServiceWindowBilling200,
606
645
  error: [
@@ -612,7 +651,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
612
651
  WhatsappGetServiceWindowBilling500,
613
652
  WhatsappGetServiceWindowBilling504.pipe(HttpApiSchema.status(504))
614
653
  ]
615
- }).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", {
654
+ }).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."))();
655
+ const WhatsappGetServiceWindowStatusEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.get("whatsappGetServiceWindowStatus", "/v1/whatsapp/service-window/status", {
616
656
  query: WhatsappGetServiceWindowStatusQuery,
617
657
  success: WhatsappGetServiceWindowStatus200,
618
658
  error: [
@@ -624,7 +664,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
624
664
  WhatsappGetServiceWindowStatus500,
625
665
  WhatsappGetServiceWindowStatus504.pipe(HttpApiSchema.status(504))
626
666
  ]
627
- }).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", {
667
+ }).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."))();
668
+ const WhatsappGetStatsEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.get("whatsappGetStats", "/v1/whatsapp/stats", {
628
669
  query: WhatsappGetStatsQuery,
629
670
  success: WhatsappGetStats200,
630
671
  error: [
@@ -635,7 +676,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
635
676
  WhatsappGetStats500,
636
677
  WhatsappGetStats504.pipe(HttpApiSchema.status(504))
637
678
  ]
638
- }).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", {
679
+ }).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."))();
680
+ const WhatsappGetTemplateStatsEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.get("whatsappGetTemplateStats", "/v1/whatsapp/templates/stats", {
639
681
  query: WhatsappGetTemplateStatsQuery,
640
682
  success: WhatsappGetTemplateStats200,
641
683
  error: [
@@ -646,7 +688,7 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
646
688
  WhatsappGetTemplateStats500,
647
689
  WhatsappGetTemplateStats504.pipe(HttpApiSchema.status(504))
648
690
  ]
649
- }).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") {};
650
- export { MoneyAmount, 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 };
691
+ }).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."))();
692
+ export { MoneyAmount, WhatsAppServiceWindowId, WhatsAppTemplateStats, WhatsAppTemplateStatsRow, WhatsAppTemplateStatsSource, WhatsappConnectBusinessAccount201, WhatsappConnectBusinessAccount400, WhatsappConnectBusinessAccount401, WhatsappConnectBusinessAccount402, WhatsappConnectBusinessAccount403, WhatsappConnectBusinessAccount404, WhatsappConnectBusinessAccount409, WhatsappConnectBusinessAccount422, WhatsappConnectBusinessAccount500, WhatsappConnectBusinessAccount502, WhatsappConnectBusinessAccount504, WhatsappConnectBusinessAccountEndpoint, WhatsappConnectBusinessAccountRequestJson, WhatsappDisconnectBusinessAccount200, WhatsappDisconnectBusinessAccount400, WhatsappDisconnectBusinessAccount401, WhatsappDisconnectBusinessAccount403, WhatsappDisconnectBusinessAccount404, WhatsappDisconnectBusinessAccount422, WhatsappDisconnectBusinessAccount500, WhatsappDisconnectBusinessAccount504, WhatsappDisconnectBusinessAccountEndpoint, WhatsappDisconnectBusinessAccountPathParams, WhatsappGetBusinessAccount200, WhatsappGetBusinessAccount400, WhatsappGetBusinessAccount401, WhatsappGetBusinessAccount403, WhatsappGetBusinessAccount404, WhatsappGetBusinessAccount422, WhatsappGetBusinessAccount500, WhatsappGetBusinessAccount504, WhatsappGetBusinessAccountEndpoint, WhatsappGetBusinessAccountPathParams, WhatsappGetMediaDownloadUrl200, WhatsappGetMediaDownloadUrl400, WhatsappGetMediaDownloadUrl401, WhatsappGetMediaDownloadUrl403, WhatsappGetMediaDownloadUrl404, WhatsappGetMediaDownloadUrl422, WhatsappGetMediaDownloadUrl500, WhatsappGetMediaDownloadUrl504, WhatsappGetMediaDownloadUrlEndpoint, WhatsappGetMediaDownloadUrlPathParams, WhatsappGetServiceWindowBilling200, WhatsappGetServiceWindowBilling400, WhatsappGetServiceWindowBilling401, WhatsappGetServiceWindowBilling403, WhatsappGetServiceWindowBilling404, WhatsappGetServiceWindowBilling422, WhatsappGetServiceWindowBilling500, WhatsappGetServiceWindowBilling504, WhatsappGetServiceWindowBillingEndpoint, WhatsappGetServiceWindowBillingQuery, WhatsappGetServiceWindowStatus200, WhatsappGetServiceWindowStatus400, WhatsappGetServiceWindowStatus401, WhatsappGetServiceWindowStatus403, WhatsappGetServiceWindowStatus404, WhatsappGetServiceWindowStatus422, WhatsappGetServiceWindowStatus500, WhatsappGetServiceWindowStatus504, WhatsappGetServiceWindowStatusEndpoint, WhatsappGetServiceWindowStatusQuery, WhatsappGetStats200, WhatsappGetStats400, WhatsappGetStats401, WhatsappGetStats403, WhatsappGetStats422, WhatsappGetStats500, WhatsappGetStats504, WhatsappGetStatsEndpoint, WhatsappGetStatsQuery, WhatsappGetTemplateStats200, WhatsappGetTemplateStats400, WhatsappGetTemplateStats401, WhatsappGetTemplateStats403, WhatsappGetTemplateStats422, WhatsappGetTemplateStats500, WhatsappGetTemplateStats504, WhatsappGetTemplateStatsEndpoint, WhatsappGetTemplateStatsQuery, WhatsappListBusinessAccounts200, WhatsappListBusinessAccounts400, WhatsappListBusinessAccounts401, WhatsappListBusinessAccounts403, WhatsappListBusinessAccounts422, WhatsappListBusinessAccounts500, WhatsappListBusinessAccounts504, WhatsappListBusinessAccountsEndpoint, WhatsappListBusinessAccountsQuery, WhatsappReleaseBusinessAccount200, WhatsappReleaseBusinessAccount400, WhatsappReleaseBusinessAccount401, WhatsappReleaseBusinessAccount403, WhatsappReleaseBusinessAccount404, WhatsappReleaseBusinessAccount409, WhatsappReleaseBusinessAccount422, WhatsappReleaseBusinessAccount500, WhatsappReleaseBusinessAccount504, WhatsappReleaseBusinessAccountEndpoint, WhatsappReleaseBusinessAccountPathParams, WhatsappReleaseBusinessAccountRequestJson, WhatsappSetDefaultBusinessAccount200, WhatsappSetDefaultBusinessAccount400, WhatsappSetDefaultBusinessAccount401, WhatsappSetDefaultBusinessAccount403, WhatsappSetDefaultBusinessAccount404, WhatsappSetDefaultBusinessAccount422, WhatsappSetDefaultBusinessAccount500, WhatsappSetDefaultBusinessAccount504, WhatsappSetDefaultBusinessAccountEndpoint, WhatsappSetDefaultBusinessAccountPathParams, WhatsappSyncAccountStatus200, WhatsappSyncAccountStatus400, WhatsappSyncAccountStatus401, WhatsappSyncAccountStatus403, WhatsappSyncAccountStatus404, WhatsappSyncAccountStatus422, WhatsappSyncAccountStatus500, WhatsappSyncAccountStatus502, WhatsappSyncAccountStatus504, WhatsappSyncAccountStatusEndpoint, WhatsappSyncAccountStatusPathParams, WhatsappUpdateBusinessAccount200, WhatsappUpdateBusinessAccount400, WhatsappUpdateBusinessAccount401, WhatsappUpdateBusinessAccount403, WhatsappUpdateBusinessAccount404, WhatsappUpdateBusinessAccount422, WhatsappUpdateBusinessAccount500, WhatsappUpdateBusinessAccount504, WhatsappUpdateBusinessAccountEndpoint, WhatsappUpdateBusinessAccountPathParams, WhatsappUpdateBusinessAccountRequestJson };
651
693
 
652
694
  //# sourceMappingURL=whats-app.js.map
@@ -1,4 +1,4 @@
1
- import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
1
+ import { HttpApiEndpoint } from "effect/http-api";
2
2
  import * as Schema from "effect/Schema";
3
3
  import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, OrganizationId, UnauthorizedError, ValidationError } from "./shared.js";
4
4
  export type WhoamiUser = {
@@ -195,7 +195,7 @@ export type WhoamiGet500 = InternalError;
195
195
  export declare const WhoamiGet500: typeof InternalError;
196
196
  export type WhoamiGet504 = GatewayTimeoutError;
197
197
  export declare const WhoamiGet504: typeof GatewayTimeoutError;
198
- declare const WhoamiGroup_base: HttpApiGroup.HttpApiGroup<"Whoami", HttpApiEndpoint.HttpApiEndpoint<"whoamiGet", "GET", "/v1/whoami", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
198
+ export declare const WhoamiGetEndpoint: HttpApiEndpoint.HttpApiEndpoint<"whoamiGet", "GET", "/v1/whoami", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
199
199
  readonly organization: Schema.Struct<{
200
200
  readonly id: Schema.brand<Schema.String, "OrganizationId">;
201
201
  readonly slug: Schema.String;
@@ -324,7 +324,4 @@ declare const WhoamiGroup_base: HttpApiGroup.HttpApiGroup<"Whoami", HttpApiEndpo
324
324
  readonly _tag: Schema.tag<"ValidationError">;
325
325
  readonly message: Schema.String;
326
326
  readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
327
- }>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never>, false>;
328
- export declare class WhoamiGroup extends WhoamiGroup_base {
329
- }
330
- export {};
327
+ }>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never>;
@@ -1,4 +1,4 @@
1
- import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
1
+ import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
2
2
  import * as Schema from "effect/Schema";
3
3
  import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, OrganizationId, UnauthorizedError, ValidationError } from "./shared.js";
4
4
  // src/effect/generated/whoami.ts
@@ -41,7 +41,7 @@ const WhoamiGet403 = ForbiddenError;
41
41
  const WhoamiGet422 = ValidationError;
42
42
  const WhoamiGet500 = InternalError;
43
43
  const WhoamiGet504 = GatewayTimeoutError;
44
- var WhoamiGroup = class extends HttpApiGroup.make("Whoami").add(HttpApiEndpoint.get("whoamiGet", "/v1/whoami", {
44
+ const WhoamiGetEndpoint = /* @__PURE__ */ (() => HttpApiEndpoint.get("whoamiGet", "/v1/whoami", {
45
45
  success: WhoamiGet200,
46
46
  error: [
47
47
  WhoamiGet400.pipe(HttpApiSchema.status(400)),
@@ -51,7 +51,7 @@ var WhoamiGroup = class extends HttpApiGroup.make("Whoami").add(HttpApiEndpoint.
51
51
  WhoamiGet500,
52
52
  WhoamiGet504.pipe(HttpApiSchema.status(504))
53
53
  ]
54
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whoami.get").annotate(OpenApi.Summary, "Get the calling credential").annotate(OpenApi.Description, "Returns the organization the request acts in and the credential it presents: an API key with its name, prefix, and access, or a signed-in user with their role. Any valid credential may call it, whatever its grants.")).annotate(OpenApi.Description, "The organization and credential behind the request.") {};
55
- export { Whoami, WhoamiApiKeyCredential, WhoamiGet200, WhoamiGet400, WhoamiGet401, WhoamiGet403, WhoamiGet422, WhoamiGet500, WhoamiGet504, WhoamiGroup, WhoamiOrganization, WhoamiUser, WhoamiUserCredential };
54
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whoami.get").annotate(OpenApi.Summary, "Get the calling credential").annotate(OpenApi.Description, "Returns the organization the request acts in and the credential it presents: an API key with its name, prefix, and access, or a signed-in user with their role. Any valid credential may call it, whatever its grants."))();
55
+ export { Whoami, WhoamiApiKeyCredential, WhoamiGet200, WhoamiGet400, WhoamiGet401, WhoamiGet403, WhoamiGet422, WhoamiGet500, WhoamiGet504, WhoamiGetEndpoint, WhoamiOrganization, WhoamiUser, WhoamiUserCredential };
56
56
 
57
57
  //# sourceMappingURL=whoami.js.map
@@ -2896,6 +2896,12 @@ export declare const SamvaOperations: {
2896
2896
  readonly idempotent: false;
2897
2897
  readonly paginated: false;
2898
2898
  };
2899
+ readonly whatsappReleaseBusinessAccount: {
2900
+ readonly group: "WhatsApp";
2901
+ readonly method: "POST";
2902
+ readonly idempotent: false;
2903
+ readonly paginated: false;
2904
+ };
2899
2905
  readonly whatsappSetDefaultBusinessAccount: {
2900
2906
  readonly group: "WhatsApp";
2901
2907
  readonly method: "POST";
@@ -1619,6 +1619,7 @@ const SamvaOperations = {
1619
1619
  whatsappGetBusinessAccount: operationMetadata154,
1620
1620
  whatsappDisconnectBusinessAccount: operationMetadata155,
1621
1621
  whatsappUpdateBusinessAccount: operationMetadata156,
1622
+ whatsappReleaseBusinessAccount: operationMetadata153,
1622
1623
  whatsappSetDefaultBusinessAccount: operationMetadata153,
1623
1624
  whatsappSyncAccountStatus: operationMetadata153,
1624
1625
  whatsappFlowsList: operationMetadata157,
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
- import { integrationCatalogOperations } from "./descriptors/integrations-catalog.js";
3
- import { IntegrationsCatalogGroup } from "./generated/integrations-catalog.js";
4
- import { forGroup } from "./internal/operation.js";
2
+ import { integrationCatalogList, integrationCatalogPrepare, integrationCatalogRecipeCatalog, integrationCatalogRecipeConnectionHandoff, integrationCatalogRecipePreview, integrationCatalogRecipeReadiness, integrationCatalogRecipeSetupActivate, integrationCatalogRecipeSetupGet, integrationCatalogRecipeSetupReplace, integrationCatalogRecipeSetupsList, integrationCatalogRecipeTest, integrationCatalogRecipeTestHandoff, integrationCatalogRecipeTestReceipt, integrationCatalogRecipeWhatsAppChallengeBegin, integrationCatalogRecipeWhatsAppChallengeConfirm, integrationCatalogRecipeWhatsAppChallengeGet, integrationCatalogSearch } from "./descriptors/integrations-catalog.js";
3
+ import { IntegrationCatalogListEndpoint, IntegrationCatalogPrepareEndpoint, IntegrationCatalogRecipeCatalogEndpoint, IntegrationCatalogRecipeConnectionHandoffEndpoint, IntegrationCatalogRecipePreviewEndpoint, IntegrationCatalogRecipeReadinessEndpoint, IntegrationCatalogRecipeSetupActivateEndpoint, IntegrationCatalogRecipeSetupGetEndpoint, IntegrationCatalogRecipeSetupReplaceEndpoint, IntegrationCatalogRecipeSetupsListEndpoint, IntegrationCatalogRecipeTestEndpoint, IntegrationCatalogRecipeTestHandoffEndpoint, IntegrationCatalogRecipeTestReceiptEndpoint, IntegrationCatalogRecipeWhatsAppChallengeBeginEndpoint, IntegrationCatalogRecipeWhatsAppChallengeConfirmEndpoint, IntegrationCatalogRecipeWhatsAppChallengeGetEndpoint, IntegrationCatalogSearchEndpoint } from "./generated/integrations-catalog.js";
4
+ import { operation } from "./internal/operation.js";
5
5
  // src/effect/integrations-catalog.ts
6
6
  var integrations_catalog_exports = /* @__PURE__ */ __exportAll({
7
7
  list: () => list,
@@ -22,24 +22,23 @@ var integrations_catalog_exports = /* @__PURE__ */ __exportAll({
22
22
  recipeWhatsAppChallengeGet: () => recipeWhatsAppChallengeGet,
23
23
  search: () => search
24
24
  });
25
- const make = /* @__PURE__ */ forGroup(IntegrationsCatalogGroup, integrationCatalogOperations);
26
- const recipeConnectionHandoff = /* @__PURE__ */ make("integrationCatalogRecipeConnectionHandoff");
27
- const recipeTestHandoff = /* @__PURE__ */ make("integrationCatalogRecipeTestHandoff");
28
- const recipeSetupsList = /* @__PURE__ */ make("integrationCatalogRecipeSetupsList");
29
- const recipeSetupGet = /* @__PURE__ */ make("integrationCatalogRecipeSetupGet");
30
- const recipeSetupReplace = /* @__PURE__ */ make("integrationCatalogRecipeSetupReplace");
31
- const recipeSetupActivate = /* @__PURE__ */ make("integrationCatalogRecipeSetupActivate");
32
- const recipePreview = /* @__PURE__ */ make("integrationCatalogRecipePreview");
33
- const recipeWhatsAppChallengeBegin = /* @__PURE__ */ make("integrationCatalogRecipeWhatsAppChallengeBegin");
34
- const recipeWhatsAppChallengeGet = /* @__PURE__ */ make("integrationCatalogRecipeWhatsAppChallengeGet");
35
- const recipeWhatsAppChallengeConfirm = /* @__PURE__ */ make("integrationCatalogRecipeWhatsAppChallengeConfirm");
36
- const recipeTest = /* @__PURE__ */ make("integrationCatalogRecipeTest");
37
- const recipeTestReceipt = /* @__PURE__ */ make("integrationCatalogRecipeTestReceipt");
38
- const recipeCatalog = /* @__PURE__ */ make("integrationCatalogRecipeCatalog");
39
- const recipeReadiness = /* @__PURE__ */ make("integrationCatalogRecipeReadiness");
40
- const prepare = /* @__PURE__ */ make("integrationCatalogPrepare");
41
- const search = /* @__PURE__ */ make("integrationCatalogSearch");
42
- const list = /* @__PURE__ */ make("integrationCatalogList");
25
+ const recipeConnectionHandoff = /* @__PURE__ */ operation("integrationCatalogRecipeConnectionHandoff", IntegrationCatalogRecipeConnectionHandoffEndpoint, integrationCatalogRecipeConnectionHandoff);
26
+ const recipeTestHandoff = /* @__PURE__ */ operation("integrationCatalogRecipeTestHandoff", IntegrationCatalogRecipeTestHandoffEndpoint, integrationCatalogRecipeTestHandoff);
27
+ const recipeSetupsList = /* @__PURE__ */ operation("integrationCatalogRecipeSetupsList", IntegrationCatalogRecipeSetupsListEndpoint, integrationCatalogRecipeSetupsList);
28
+ const recipeSetupGet = /* @__PURE__ */ operation("integrationCatalogRecipeSetupGet", IntegrationCatalogRecipeSetupGetEndpoint, integrationCatalogRecipeSetupGet);
29
+ const recipeSetupReplace = /* @__PURE__ */ operation("integrationCatalogRecipeSetupReplace", IntegrationCatalogRecipeSetupReplaceEndpoint, integrationCatalogRecipeSetupReplace);
30
+ const recipeSetupActivate = /* @__PURE__ */ operation("integrationCatalogRecipeSetupActivate", IntegrationCatalogRecipeSetupActivateEndpoint, integrationCatalogRecipeSetupActivate);
31
+ const recipePreview = /* @__PURE__ */ operation("integrationCatalogRecipePreview", IntegrationCatalogRecipePreviewEndpoint, integrationCatalogRecipePreview);
32
+ const recipeWhatsAppChallengeBegin = /* @__PURE__ */ operation("integrationCatalogRecipeWhatsAppChallengeBegin", IntegrationCatalogRecipeWhatsAppChallengeBeginEndpoint, integrationCatalogRecipeWhatsAppChallengeBegin);
33
+ const recipeWhatsAppChallengeGet = /* @__PURE__ */ operation("integrationCatalogRecipeWhatsAppChallengeGet", IntegrationCatalogRecipeWhatsAppChallengeGetEndpoint, integrationCatalogRecipeWhatsAppChallengeGet);
34
+ const recipeWhatsAppChallengeConfirm = /* @__PURE__ */ operation("integrationCatalogRecipeWhatsAppChallengeConfirm", IntegrationCatalogRecipeWhatsAppChallengeConfirmEndpoint, integrationCatalogRecipeWhatsAppChallengeConfirm);
35
+ const recipeTest = /* @__PURE__ */ operation("integrationCatalogRecipeTest", IntegrationCatalogRecipeTestEndpoint, integrationCatalogRecipeTest);
36
+ const recipeTestReceipt = /* @__PURE__ */ operation("integrationCatalogRecipeTestReceipt", IntegrationCatalogRecipeTestReceiptEndpoint, integrationCatalogRecipeTestReceipt);
37
+ const recipeCatalog = /* @__PURE__ */ operation("integrationCatalogRecipeCatalog", IntegrationCatalogRecipeCatalogEndpoint, integrationCatalogRecipeCatalog);
38
+ const recipeReadiness = /* @__PURE__ */ operation("integrationCatalogRecipeReadiness", IntegrationCatalogRecipeReadinessEndpoint, integrationCatalogRecipeReadiness);
39
+ const prepare = /* @__PURE__ */ operation("integrationCatalogPrepare", IntegrationCatalogPrepareEndpoint, integrationCatalogPrepare);
40
+ const search = /* @__PURE__ */ operation("integrationCatalogSearch", IntegrationCatalogSearchEndpoint, integrationCatalogSearch);
41
+ const list = /* @__PURE__ */ operation("integrationCatalogList", IntegrationCatalogListEndpoint, integrationCatalogList);
43
42
  export { integrations_catalog_exports, list, prepare, recipeCatalog, recipeConnectionHandoff, recipePreview, recipeReadiness, recipeSetupActivate, recipeSetupGet, recipeSetupReplace, recipeSetupsList, recipeTest, recipeTestHandoff, recipeTestReceipt, recipeWhatsAppChallengeBegin, recipeWhatsAppChallengeConfirm, recipeWhatsAppChallengeGet, search };
44
43
 
45
44
  //# sourceMappingURL=integrations-catalog.js.map
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
- import { integrationsOperations } from "./descriptors/integrations.js";
3
- import { IntegrationsGroup } from "./generated/integrations.js";
4
- import { forGroup } from "./internal/operation.js";
2
+ import { integrationsGet, integrationsInstall, integrationsList, integrationsListTools, integrationsReadTool, integrationsRemove, integrationsUpdate } from "./descriptors/integrations.js";
3
+ import { IntegrationsGetEndpoint, IntegrationsInstallEndpoint, IntegrationsListEndpoint, IntegrationsListToolsEndpoint, IntegrationsReadToolEndpoint, IntegrationsRemoveEndpoint, IntegrationsUpdateEndpoint } from "./generated/integrations.js";
4
+ import { operation } from "./internal/operation.js";
5
5
  // src/effect/integrations.ts
6
6
  var integrations_exports = /* @__PURE__ */ __exportAll({
7
7
  get: () => get,
@@ -12,14 +12,13 @@ var integrations_exports = /* @__PURE__ */ __exportAll({
12
12
  remove: () => remove,
13
13
  update: () => update
14
14
  });
15
- const make = /* @__PURE__ */ forGroup(IntegrationsGroup, integrationsOperations);
16
- const list = /* @__PURE__ */ make("integrationsList");
17
- const install = /* @__PURE__ */ make("integrationsInstall");
18
- const listTools = /* @__PURE__ */ make("integrationsListTools");
19
- const readTool = /* @__PURE__ */ make("integrationsReadTool");
20
- const get = /* @__PURE__ */ make("integrationsGet");
21
- const update = /* @__PURE__ */ make("integrationsUpdate");
22
- const remove = /* @__PURE__ */ make("integrationsRemove");
15
+ const list = /* @__PURE__ */ operation("integrationsList", IntegrationsListEndpoint, integrationsList);
16
+ const install = /* @__PURE__ */ operation("integrationsInstall", IntegrationsInstallEndpoint, integrationsInstall);
17
+ const listTools = /* @__PURE__ */ operation("integrationsListTools", IntegrationsListToolsEndpoint, integrationsListTools);
18
+ const readTool = /* @__PURE__ */ operation("integrationsReadTool", IntegrationsReadToolEndpoint, integrationsReadTool);
19
+ const get = /* @__PURE__ */ operation("integrationsGet", IntegrationsGetEndpoint, integrationsGet);
20
+ const update = /* @__PURE__ */ operation("integrationsUpdate", IntegrationsUpdateEndpoint, integrationsUpdate);
21
+ const remove = /* @__PURE__ */ operation("integrationsRemove", IntegrationsRemoveEndpoint, integrationsRemove);
23
22
  export { get, install, integrations_exports, list, listTools, readTool, remove, update };
24
23
 
25
24
  //# sourceMappingURL=integrations.js.map
@@ -55,7 +55,8 @@ export interface Interface {
55
55
  readonly timeoutMs?: number | null | undefined;
56
56
  /**
57
57
  * The generated call for one endpoint. A group's client is built on the first call to any of its
58
- * endpoints and reused, so a group the program never calls costs nothing.
58
+ * endpoints and reused for that group value, so a group the program never calls costs nothing.
59
+ * Operations pass one-endpoint groups, several of which share an identifier.
59
60
  */
60
61
  readonly endpoint: <Name extends Operation>(group: HttpApiGroup.Constraint, name: Name) => Effect.Effect<OperationCall<Name>>;
61
62
  /** The origin and headers a connection outside HTTP requests, such as the event stream, uses. */
@@ -49,9 +49,9 @@ const make = (config) => Effect.gen(function* () {
49
49
  if (removesAttribution) attributed = HttpClientRequest.removeHeader(attributed, CLIENT_ATTRIBUTION_HEADER);
50
50
  return HttpClientRequest.setHeaders(attributed, authHeaders(config));
51
51
  }));
52
- const groups = /* @__PURE__ */ new Map();
52
+ const groups = /* @__PURE__ */ new WeakMap();
53
53
  const groupClient = (group) => {
54
- const built = groups.get(group.identifier);
54
+ const built = groups.get(group);
55
55
  if (built !== void 0) return Effect.succeed(built);
56
56
  return HttpApiClient.group(HttpApi.make("SamvaApi").add(group).annotate(HttpApi.PayloadParseOptions, { onExcessProperty: "error" }), {
57
57
  group: group.identifier,
@@ -59,7 +59,7 @@ const make = (config) => Effect.gen(function* () {
59
59
  baseUrl
60
60
  }).pipe(Effect.provide(AuthorizationClient), Effect.map((client) => {
61
61
  const calls = client;
62
- groups.set(group.identifier, calls);
62
+ groups.set(group, calls);
63
63
  return calls;
64
64
  }));
65
65
  };
@@ -1,17 +1,18 @@
1
1
  import { Effect } from "effect";
2
2
  import { replyToEmailsPayload } from "../../normalize.js";
3
- import { EmailGroup } from "../generated/email.js";
3
+ import { EmailAddSenderEndpoint } from "../generated/email.js";
4
4
  import { generateIdempotencyKey, withRetry } from "../retry.js";
5
5
  import { Service } from "./client.js";
6
- import { attemptTimeout, callEndpoint, stripUndefined } from "./operation.js";
6
+ import { attemptTimeout, callEndpoint, endpointGroup, stripUndefined } from "./operation.js";
7
7
  import { withTimeout } from "./timeout.js";
8
8
  // src/effect/internal/email-sender.ts
9
- const addEmailSender = Effect.fn("Email.addSender")(function* (input, options) {
9
+ const EmailAddSender = /* @__PURE__ */ endpointGroup("Email", EmailAddSenderEndpoint);
10
+ const addEmailSender = /* @__PURE__ */ Effect.fn("Email.addSender")(function* (input, options) {
10
11
  const client = yield* Service;
11
12
  const timeoutMs = attemptTimeout(options, client);
12
13
  const idempotencyKey = options?.idempotencyKey ?? client.idempotency?.("emailAddSender") ?? (yield* generateIdempotencyKey);
13
14
  const { replyToEmails, ...sender } = input;
14
- return yield* withRetry(withTimeout(callEndpoint(EmailGroup, "emailAddSender", {
15
+ return yield* withRetry(withTimeout(callEndpoint(EmailAddSender, "emailAddSender", {
15
16
  headers: { "idempotency-key": idempotencyKey },
16
17
  payload: stripUndefined({
17
18
  ...sender,
@@ -1,5 +1,5 @@
1
1
  import { type Brand, Effect, Redacted, Stream } from "effect";
2
- import type { HttpApiGroup } from "effect/http-api";
2
+ import { type HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
3
3
  import type { SDK_OPERATION_CALLS } from "../../service-map.js";
4
4
  import { type FlatRaw, type Operation, type OperationResult } from "./client.js";
5
5
  export type { OperationResult };
@@ -37,8 +37,8 @@ export declare const attemptTimeout: (options: {
37
37
  readonly timeoutMs?: number | null | undefined;
38
38
  }) => number | null;
39
39
  /**
40
- * What one operation wrapper reads at runtime. `codegen/generate-registry.ts` emits a table of these
41
- * beside each domain, so a focused entry carries its own operations' descriptors and not the API's.
40
+ * What one operation wrapper reads at runtime. `codegen/generate-registry.ts` emits one binding per
41
+ * operation beside each domain, so a focused import carries only its own operations' descriptors.
42
42
  */
43
43
  interface OperationDescriptor {
44
44
  readonly group: string;
@@ -54,7 +54,6 @@ interface OperationDescriptor {
54
54
  readonly paths?: ReadonlyArray<string> | undefined;
55
55
  };
56
56
  }
57
- export type OperationDescriptors = Readonly<Record<string, OperationDescriptor>>;
58
57
  type OperationFunction<Name extends SdkOperation> = (typeof SDK_OPERATION_CALLS)[Name] extends {
59
58
  readonly kind: "none";
60
59
  } ? (input?: never, options?: OperationOptions) => OperationResult<Name> : {} extends Input<Name> ? (input?: Input<Name>, options?: OperationOptions) => OperationResult<Name> : (input: Input<Name>, options?: OperationOptions) => OperationResult<Name>;
@@ -77,9 +76,14 @@ type PaginationCompanions<Parameters, A, E, R> = {} extends Parameters ? {
77
76
  type WithPagination<Method> = Method extends (input: infer Parameters) => Effect.Effect<infer A, infer E, infer R> ? IsPaginated<A> extends true ? Method & PaginationCompanions<Parameters, A, E, R> : Method : Method;
78
77
  export declare const stripUndefined: <Value>(input: Value) => Value;
79
78
  /**
80
- * Operation factory for one API group. Each domain module binds its own group and descriptor table,
81
- * so importing it loads that group's schemas and metadata and nothing else.
79
+ * A group holding only `endpoint`, so the client built for it decodes that endpoint's schemas and
80
+ * nothing else. The client caches by group identity: bind each one once, at module scope.
82
81
  */
83
- export declare const forGroup: (group: HttpApiGroup.Constraint, descriptors: OperationDescriptors) => <Name extends SdkOperation>(operationName: Name) => WithPagination<OperationFunction<Name>>;
82
+ export declare const endpointGroup: (identifier: string, endpoint: HttpApiEndpoint.Top) => HttpApiGroup.Constraint;
83
+ /**
84
+ * One operation wrapper from its own endpoint and descriptor. Generated domain modules call this
85
+ * once per operation, so a bundler keeps only the operations a program imports.
86
+ */
87
+ export declare const operation: <Name extends SdkOperation>(operationName: Name, endpoint: HttpApiEndpoint.Top, descriptor: OperationDescriptor) => WithPagination<OperationFunction<Name>>;
84
88
  /** Call one endpoint with an already-shaped request, outside the direct-operation adapter. */
85
89
  export declare const callEndpoint: <Name extends SdkOperation>(group: HttpApiGroup.Constraint, name: Name, request: unknown) => OperationResult<Name>;
@@ -1,4 +1,5 @@
1
1
  import { Effect, Predicate } from "effect";
2
+ import { HttpApiGroup } from "effect/http-api";
2
3
  import { DEFAULT_TIMEOUT_MS, isRetrySafe, resolveTimeout } from "../../request-policy.js";
3
4
  import { streamCursorItems, streamCursorPages } from "../pagination.js";
4
5
  import { generateIdempotencyKey, withRetry } from "../retry.js";
@@ -51,14 +52,18 @@ const adapt = (descriptor, operationName, rawCall, input, idempotencyKey, timeou
51
52
  };
52
53
  const isCursorPageEnvelope = (value) => Predicate.isObject(value) && Array.isArray(value.items) && (value.nextCursor === null || typeof value.nextCursor === "string");
53
54
  /**
54
- * Operation factory for one API group. Each domain module binds its own group and descriptor table,
55
- * so importing it loads that group's schemas and metadata and nothing else.
55
+ * A group holding only `endpoint`, so the client built for it decodes that endpoint's schemas and
56
+ * nothing else. The client caches by group identity: bind each one once, at module scope.
56
57
  */
57
- const forGroup = (group, descriptors) => (operationName) => {
58
- const descriptor = descriptors[operationName];
59
- if (descriptor === void 0) throw new Error(`${operationName} has no descriptor in this entry`);
60
- if (descriptor.group !== group.identifier) throw new Error(`${operationName} is not an endpoint of ${group.identifier}`);
61
- return make(group, operationName, descriptor);
58
+ const endpointGroup = (identifier, endpoint) => HttpApiGroup.make(identifier).add(endpoint);
59
+ /**
60
+ * One operation wrapper from its own endpoint and descriptor. Generated domain modules call this
61
+ * once per operation, so a bundler keeps only the operations a program imports.
62
+ */
63
+ const operation = (operationName, endpoint, descriptor) => {
64
+ if (endpoint.identifier !== operationName) throw new Error(`${operationName} is bound to the ${endpoint.identifier} endpoint`);
65
+ let group;
66
+ return make(() => group ??= endpointGroup(descriptor.group, endpoint), operationName, descriptor);
62
67
  };
63
68
  /** Call one endpoint with an already-shaped request, outside the direct-operation adapter. */
64
69
  const callEndpoint = (group, name, request) => Effect.flatMap(Service, (client) => Effect.flatMap(client.endpoint(group, name), (call) => call(request)));
@@ -66,20 +71,20 @@ const make = (group, operationName, descriptor) => {
66
71
  const call = Effect.fn(traceName(descriptor, operationName))(function* (input, options) {
67
72
  const client = yield* Service;
68
73
  const timeoutMs = attemptTimeout(options, client);
69
- const rawCall = yield* client.endpoint(group, operationName);
74
+ const rawCall = yield* client.endpoint(group(), operationName);
70
75
  const idempotencyKey = descriptor.idempotent ? options?.idempotencyKey ?? client.idempotency?.(operationName) ?? (yield* generateIdempotencyKey) : void 0;
71
76
  return yield* adapt(descriptor, operationName, rawCall, input, idempotencyKey, timeoutMs);
72
77
  });
73
- const operation = call;
78
+ const wrapper = call;
74
79
  if (descriptor.paginated) {
75
80
  const list = (input) => Effect.filterOrElse(call(input), isCursorPageEnvelope, () => Effect.die(/* @__PURE__ */ new Error(`${operationName} did not return a cursor page envelope`)));
76
- Object.assign(operation, {
81
+ Object.assign(wrapper, {
77
82
  pages: (input) => streamCursorPages(list, input ?? {}),
78
83
  items: (input) => streamCursorItems(list, input ?? {})
79
84
  });
80
85
  }
81
- return operation;
86
+ return wrapper;
82
87
  };
83
- export { attemptTimeout, callEndpoint, forGroup, stripUndefined };
88
+ export { attemptTimeout, callEndpoint, endpointGroup, operation, stripUndefined };
84
89
 
85
90
  //# sourceMappingURL=operation.js.map