samva 0.56.0 → 0.56.2

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 (256) hide show
  1. package/AGENTS.md +2 -2
  2. package/README.md +9 -8
  3. package/dist/agent/index.js +0 -2
  4. package/dist/agent/runtime.js +0 -2
  5. package/dist/agent/test.js +0 -2
  6. package/dist/client/client/client.gen.js +0 -2
  7. package/dist/client/client/utils.gen.js +0 -2
  8. package/dist/client/client.gen.js +0 -2
  9. package/dist/client/core/auth.gen.js +0 -2
  10. package/dist/client/core/bodySerializer.gen.js +0 -2
  11. package/dist/client/core/params.gen.js +0 -2
  12. package/dist/client/core/pathSerializer.gen.js +0 -2
  13. package/dist/client/core/serverSentEvents.gen.js +0 -2
  14. package/dist/client/core/utils.gen.js +0 -2
  15. package/dist/client/sdk.gen.js +0 -2
  16. package/dist/client-attribution.js +0 -2
  17. package/dist/effect/accounts.js +9 -12
  18. package/dist/effect/agents.js +16 -19
  19. package/dist/effect/analytics.js +9 -12
  20. package/dist/effect/api-keys.js +11 -14
  21. package/dist/effect/approval-requests.js +7 -10
  22. package/dist/effect/attachments.js +7 -10
  23. package/dist/effect/brands.js +9 -12
  24. package/dist/effect/campaigns.js +18 -21
  25. package/dist/effect/categories.js +0 -2
  26. package/dist/effect/client.js +0 -2
  27. package/dist/effect/contact-groups.js +13 -16
  28. package/dist/effect/contacts.js +29 -32
  29. package/dist/effect/conversations.js +16 -19
  30. package/dist/effect/custom-fields.js +7 -10
  31. package/dist/effect/descriptors/accounts.d.ts +50 -52
  32. package/dist/effect/descriptors/accounts.js +50 -54
  33. package/dist/effect/descriptors/agents.d.ts +113 -115
  34. package/dist/effect/descriptors/agents.js +120 -124
  35. package/dist/effect/descriptors/analytics.d.ts +47 -49
  36. package/dist/effect/descriptors/analytics.js +42 -46
  37. package/dist/effect/descriptors/api-keys.d.ts +69 -71
  38. package/dist/effect/descriptors/api-keys.js +73 -77
  39. package/dist/effect/descriptors/approval-requests.d.ts +34 -36
  40. package/dist/effect/descriptors/approval-requests.js +36 -40
  41. package/dist/effect/descriptors/attachments.d.ts +34 -36
  42. package/dist/effect/descriptors/attachments.js +36 -40
  43. package/dist/effect/descriptors/brands.d.ts +51 -53
  44. package/dist/effect/descriptors/brands.js +53 -57
  45. package/dist/effect/descriptors/campaigns.d.ts +130 -132
  46. package/dist/effect/descriptors/campaigns.js +137 -141
  47. package/dist/effect/descriptors/contact-groups.d.ts +86 -88
  48. package/dist/effect/descriptors/contact-groups.js +90 -94
  49. package/dist/effect/descriptors/contacts.d.ts +242 -244
  50. package/dist/effect/descriptors/contacts.js +227 -231
  51. package/dist/effect/descriptors/conversations.d.ts +114 -116
  52. package/dist/effect/descriptors/conversations.js +123 -127
  53. package/dist/effect/descriptors/custom-fields.d.ts +33 -35
  54. package/dist/effect/descriptors/custom-fields.js +33 -37
  55. package/dist/effect/descriptors/email.d.ts +623 -625
  56. package/dist/effect/descriptors/email.js +562 -580
  57. package/dist/effect/descriptors/events.d.ts +15 -17
  58. package/dist/effect/descriptors/events.js +14 -18
  59. package/dist/effect/descriptors/feedback.d.ts +7 -9
  60. package/dist/effect/descriptors/feedback.js +3 -5
  61. package/dist/effect/descriptors/integrations-catalog.d.ts +159 -161
  62. package/dist/effect/descriptors/integrations-catalog.js +142 -146
  63. package/dist/effect/descriptors/integrations.d.ts +60 -62
  64. package/dist/effect/descriptors/integrations.js +63 -67
  65. package/dist/effect/descriptors/journeys.d.ts +123 -125
  66. package/dist/effect/descriptors/journeys.js +133 -137
  67. package/dist/effect/descriptors/logs.d.ts +16 -18
  68. package/dist/effect/descriptors/logs.js +16 -20
  69. package/dist/effect/descriptors/mailboxes.d.ts +780 -782
  70. package/dist/effect/descriptors/mailboxes.js +795 -799
  71. package/dist/effect/descriptors/media.d.ts +43 -45
  72. package/dist/effect/descriptors/media.js +46 -50
  73. package/dist/effect/descriptors/messages.d.ts +86 -88
  74. package/dist/effect/descriptors/messages.js +83 -94
  75. package/dist/effect/descriptors/namespaces.d.ts +96 -98
  76. package/dist/effect/descriptors/namespaces.js +107 -111
  77. package/dist/effect/descriptors/newsletter-domains.d.ts +35 -37
  78. package/dist/effect/descriptors/newsletter-domains.js +39 -43
  79. package/dist/effect/descriptors/newsletter-issues.d.ts +98 -100
  80. package/dist/effect/descriptors/newsletter-issues.js +109 -113
  81. package/dist/effect/descriptors/newsletters.d.ts +43 -45
  82. package/dist/effect/descriptors/newsletters.js +46 -50
  83. package/dist/effect/descriptors/operations.d.ts +25 -27
  84. package/dist/effect/descriptors/operations.js +26 -30
  85. package/dist/effect/descriptors/organizations.d.ts +96 -98
  86. package/dist/effect/descriptors/organizations.js +86 -90
  87. package/dist/effect/descriptors/phone-numbers.d.ts +41 -43
  88. package/dist/effect/descriptors/phone-numbers.js +40 -44
  89. package/dist/effect/descriptors/policies.d.ts +26 -28
  90. package/dist/effect/descriptors/policies.js +29 -33
  91. package/dist/effect/descriptors/scheduled-messages.d.ts +42 -44
  92. package/dist/effect/descriptors/scheduled-messages.js +43 -47
  93. package/dist/effect/descriptors/subscriptions.d.ts +7 -9
  94. package/dist/effect/descriptors/subscriptions.js +3 -5
  95. package/dist/effect/descriptors/template-registrations.d.ts +26 -28
  96. package/dist/effect/descriptors/template-registrations.js +29 -33
  97. package/dist/effect/descriptors/template-share-links.d.ts +44 -46
  98. package/dist/effect/descriptors/template-share-links.js +49 -53
  99. package/dist/effect/descriptors/templates.d.ts +361 -363
  100. package/dist/effect/descriptors/templates.js +348 -352
  101. package/dist/effect/descriptors/topic-forms.d.ts +44 -46
  102. package/dist/effect/descriptors/topic-forms.js +49 -53
  103. package/dist/effect/descriptors/topics.d.ts +77 -79
  104. package/dist/effect/descriptors/topics.js +80 -84
  105. package/dist/effect/descriptors/webhooks.d.ts +96 -98
  106. package/dist/effect/descriptors/webhooks.js +103 -107
  107. package/dist/effect/descriptors/whats-app-flows.d.ts +86 -88
  108. package/dist/effect/descriptors/whats-app-flows.js +90 -94
  109. package/dist/effect/descriptors/whats-app-setup-links.d.ts +33 -35
  110. package/dist/effect/descriptors/whats-app-setup-links.js +33 -37
  111. package/dist/effect/descriptors/whats-app.d.ts +110 -112
  112. package/dist/effect/descriptors/whats-app.js +111 -115
  113. package/dist/effect/descriptors/whoami.d.ts +7 -9
  114. package/dist/effect/descriptors/whoami.js +3 -5
  115. package/dist/effect/email.js +66 -69
  116. package/dist/effect/events.js +5 -8
  117. package/dist/effect/feedback.js +4 -6
  118. package/dist/effect/generated/accounts.d.ts +144 -142
  119. package/dist/effect/generated/accounts.js +14 -11
  120. package/dist/effect/generated/agents.d.ts +1502 -1493
  121. package/dist/effect/generated/agents.js +28 -18
  122. package/dist/effect/generated/analytics.d.ts +55 -53
  123. package/dist/effect/generated/analytics.js +14 -11
  124. package/dist/effect/generated/api-keys.d.ts +216 -212
  125. package/dist/effect/generated/api-keys.js +18 -13
  126. package/dist/effect/generated/approval-requests.d.ts +60 -60
  127. package/dist/effect/generated/approval-requests.js +10 -9
  128. package/dist/effect/generated/attachments.d.ts +32 -32
  129. package/dist/effect/generated/attachments.js +10 -9
  130. package/dist/effect/generated/brands.d.ts +179 -177
  131. package/dist/effect/generated/brands.js +14 -11
  132. package/dist/effect/generated/campaigns.d.ts +1083 -1072
  133. package/dist/effect/generated/campaigns.js +32 -20
  134. package/dist/effect/generated/contact-events.d.ts +3 -6
  135. package/dist/effect/generated/contact-events.js +4 -6
  136. package/dist/effect/generated/contact-groups.d.ts +186 -180
  137. package/dist/effect/generated/contact-groups.js +22 -15
  138. package/dist/effect/generated/contacts.d.ts +1565 -1545
  139. package/dist/effect/generated/contacts.js +50 -29
  140. package/dist/effect/generated/conversations.d.ts +340 -331
  141. package/dist/effect/generated/conversations.js +28 -18
  142. package/dist/effect/generated/custom-fields.d.ts +63 -63
  143. package/dist/effect/generated/custom-fields.js +10 -9
  144. package/dist/effect/generated/email.d.ts +2731 -2671
  145. package/dist/effect/generated/email.js +130 -69
  146. package/dist/effect/generated/events.d.ts +160 -162
  147. package/dist/effect/generated/events.js +6 -7
  148. package/dist/effect/generated/feedback.d.ts +3 -6
  149. package/dist/effect/generated/feedback.js +4 -6
  150. package/dist/effect/generated/index.d.ts +174 -45
  151. package/dist/effect/generated/integrations-catalog.d.ts +459 -446
  152. package/dist/effect/generated/integrations-catalog.js +36 -22
  153. package/dist/effect/generated/integrations.d.ts +155 -152
  154. package/dist/effect/generated/integrations.js +16 -12
  155. package/dist/effect/generated/journeys.d.ts +864 -854
  156. package/dist/effect/generated/journeys.js +30 -19
  157. package/dist/effect/generated/logs.d.ts +147 -149
  158. package/dist/effect/generated/logs.js +6 -7
  159. package/dist/effect/generated/mailboxes.d.ts +7271 -7196
  160. package/dist/effect/generated/mailboxes.js +160 -84
  161. package/dist/effect/generated/media.d.ts +77 -76
  162. package/dist/effect/generated/media.js +12 -10
  163. package/dist/effect/generated/messages.d.ts +1092 -1086
  164. package/dist/effect/generated/messages.js +22 -15
  165. package/dist/effect/generated/namespaces.d.ts +184 -177
  166. package/dist/effect/generated/namespaces.js +24 -16
  167. package/dist/effect/generated/newsletter-domains.d.ts +57 -57
  168. package/dist/effect/generated/newsletter-domains.js +10 -9
  169. package/dist/effect/generated/newsletter-issues.d.ts +225 -218
  170. package/dist/effect/generated/newsletter-issues.js +24 -16
  171. package/dist/effect/generated/newsletters.d.ts +46 -45
  172. package/dist/effect/generated/newsletters.js +12 -10
  173. package/dist/effect/generated/operations.d.ts +79 -80
  174. package/dist/effect/generated/operations.js +8 -8
  175. package/dist/effect/generated/organizations.d.ts +438 -430
  176. package/dist/effect/generated/organizations.js +26 -17
  177. package/dist/effect/generated/phone-numbers.d.ts +87 -86
  178. package/dist/effect/generated/phone-numbers.js +12 -10
  179. package/dist/effect/generated/policies.d.ts +64 -65
  180. package/dist/effect/generated/policies.js +8 -8
  181. package/dist/effect/generated/scheduled-messages.d.ts +66 -65
  182. package/dist/effect/generated/scheduled-messages.js +12 -10
  183. package/dist/effect/generated/shared.d.ts +33 -33
  184. package/dist/effect/generated/shared.js +61 -63
  185. package/dist/effect/generated/subscriptions.d.ts +3 -6
  186. package/dist/effect/generated/subscriptions.js +4 -6
  187. package/dist/effect/generated/template-registrations.d.ts +135 -136
  188. package/dist/effect/generated/template-registrations.js +8 -8
  189. package/dist/effect/generated/template-share-links.d.ts +25 -24
  190. package/dist/effect/generated/template-share-links.js +12 -10
  191. package/dist/effect/generated/templates.d.ts +2678 -2645
  192. package/dist/effect/generated/templates.js +76 -42
  193. package/dist/effect/generated/topic-forms.d.ts +47 -46
  194. package/dist/effect/generated/topic-forms.js +12 -10
  195. package/dist/effect/generated/topics.d.ts +204 -199
  196. package/dist/effect/generated/topics.js +20 -14
  197. package/dist/effect/generated/webhooks.d.ts +268 -261
  198. package/dist/effect/generated/webhooks.js +24 -16
  199. package/dist/effect/generated/whats-app-flows.d.ts +250 -244
  200. package/dist/effect/generated/whats-app-flows.js +22 -15
  201. package/dist/effect/generated/whats-app-setup-links.d.ts +107 -107
  202. package/dist/effect/generated/whats-app-setup-links.js +10 -9
  203. package/dist/effect/generated/whats-app.d.ts +439 -430
  204. package/dist/effect/generated/whats-app.js +28 -18
  205. package/dist/effect/generated/whoami.d.ts +3 -6
  206. package/dist/effect/generated/whoami.js +4 -6
  207. package/dist/effect/generated-metadata.js +0 -2
  208. package/dist/effect/integrations-catalog.js +20 -23
  209. package/dist/effect/integrations.js +10 -13
  210. package/dist/effect/internal/client.d.ts +2 -1
  211. package/dist/effect/internal/client.js +3 -5
  212. package/dist/effect/internal/email-sender.js +5 -6
  213. package/dist/effect/internal/log-events.js +0 -2
  214. package/dist/effect/internal/mailbox-events.js +0 -2
  215. package/dist/effect/internal/operation.d.ts +11 -7
  216. package/dist/effect/internal/operation.js +17 -14
  217. package/dist/effect/internal/send.js +11 -10
  218. package/dist/effect/internal/timeout.js +0 -2
  219. package/dist/effect/journeys.js +17 -20
  220. package/dist/effect/logs.js +5 -8
  221. package/dist/effect/mailboxes.js +82 -85
  222. package/dist/effect/media.js +8 -11
  223. package/dist/effect/messages.js +12 -15
  224. package/dist/effect/namespaces.js +14 -17
  225. package/dist/effect/newsletter-domains.js +7 -10
  226. package/dist/effect/newsletter-issues.js +14 -17
  227. package/dist/effect/newsletters.js +8 -11
  228. package/dist/effect/operations.js +6 -9
  229. package/dist/effect/organizations.js +15 -18
  230. package/dist/effect/pagination.js +0 -2
  231. package/dist/effect/phone-numbers.js +8 -11
  232. package/dist/effect/policies.js +6 -9
  233. package/dist/effect/retry.js +0 -2
  234. package/dist/effect/runtime.js +3 -5
  235. package/dist/effect/scheduled-messages.js +8 -11
  236. package/dist/effect/subscriptions.js +4 -6
  237. package/dist/effect/template-registrations.js +6 -9
  238. package/dist/effect/template-share-links.js +8 -11
  239. package/dist/effect/templates.js +40 -43
  240. package/dist/effect/topic-forms.js +8 -11
  241. package/dist/effect/topics.js +12 -15
  242. package/dist/effect/webhooks.js +14 -17
  243. package/dist/effect/whatsapp-flows.js +13 -16
  244. package/dist/effect/whatsapp-setup-links.js +7 -10
  245. package/dist/effect/whatsapp.js +16 -19
  246. package/dist/effect/whoami.js +4 -6
  247. package/dist/inline-attachments.js +0 -2
  248. package/dist/mailbox-events.js +0 -2
  249. package/dist/normalize.js +0 -2
  250. package/dist/package.json.js +1 -3
  251. package/dist/promises/client.js +0 -2
  252. package/dist/promises/errors.gen.js +0 -2
  253. package/dist/promises/request.js +0 -2
  254. package/dist/request-id.js +0 -2
  255. package/dist/request-policy.js +0 -2
  256. package/package.json +3 -2
@@ -1,5 +1,5 @@
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
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
@@ -516,7 +516,7 @@ const WhatsappGetTemplateStats403 = ForbiddenError;
516
516
  const WhatsappGetTemplateStats422 = ValidationError;
517
517
  const WhatsappGetTemplateStats500 = InternalError;
518
518
  const WhatsappGetTemplateStats504 = GatewayTimeoutError;
519
- 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", {
520
520
  query: WhatsappListBusinessAccountsQuery,
521
521
  success: WhatsappListBusinessAccounts200,
522
522
  error: [
@@ -527,7 +527,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
527
527
  WhatsappListBusinessAccounts500,
528
528
  WhatsappListBusinessAccounts504.pipe(HttpApiSchema.status(504))
529
529
  ]
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."), 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", {
531
532
  payload: WhatsappConnectBusinessAccountRequestJson,
532
533
  success: WhatsappConnectBusinessAccount201.pipe(HttpApiSchema.status(201)),
533
534
  error: [
@@ -542,7 +543,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
542
543
  WhatsappConnectBusinessAccount502.pipe(HttpApiSchema.status(502)),
543
544
  WhatsappConnectBusinessAccount504.pipe(HttpApiSchema.status(504))
544
545
  ]
545
- }).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", {
546
548
  params: WhatsappGetBusinessAccountPathParams,
547
549
  success: WhatsappGetBusinessAccount200,
548
550
  error: [
@@ -554,7 +556,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
554
556
  WhatsappGetBusinessAccount500,
555
557
  WhatsappGetBusinessAccount504.pipe(HttpApiSchema.status(504))
556
558
  ]
557
- }).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", {
558
561
  params: WhatsappDisconnectBusinessAccountPathParams,
559
562
  success: WhatsappDisconnectBusinessAccount200,
560
563
  error: [
@@ -566,7 +569,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
566
569
  WhatsappDisconnectBusinessAccount500,
567
570
  WhatsappDisconnectBusinessAccount504.pipe(HttpApiSchema.status(504))
568
571
  ]
569
- }).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", {
570
574
  params: WhatsappUpdateBusinessAccountPathParams,
571
575
  payload: WhatsappUpdateBusinessAccountRequestJson,
572
576
  success: WhatsappUpdateBusinessAccount200,
@@ -579,7 +583,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
579
583
  WhatsappUpdateBusinessAccount500,
580
584
  WhatsappUpdateBusinessAccount504.pipe(HttpApiSchema.status(504))
581
585
  ]
582
- }).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("whatsappReleaseBusinessAccount", "/v1/whatsapp/business-accounts/:accountId/release", {
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", {
583
588
  params: WhatsappReleaseBusinessAccountPathParams,
584
589
  payload: WhatsappReleaseBusinessAccountRequestJson,
585
590
  success: WhatsappReleaseBusinessAccount200,
@@ -593,7 +598,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
593
598
  WhatsappReleaseBusinessAccount500,
594
599
  WhatsappReleaseBusinessAccount504.pipe(HttpApiSchema.status(504))
595
600
  ]
596
- }).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."), HttpApiEndpoint.post("whatsappSetDefaultBusinessAccount", "/v1/whatsapp/business-accounts/:accountId/set-default", {
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", {
597
603
  params: WhatsappSetDefaultBusinessAccountPathParams,
598
604
  success: WhatsappSetDefaultBusinessAccount200,
599
605
  error: [
@@ -605,7 +611,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
605
611
  WhatsappSetDefaultBusinessAccount500,
606
612
  WhatsappSetDefaultBusinessAccount504.pipe(HttpApiSchema.status(504))
607
613
  ]
608
- }).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", {
609
616
  params: WhatsappSyncAccountStatusPathParams,
610
617
  success: WhatsappSyncAccountStatus200,
611
618
  error: [
@@ -618,7 +625,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
618
625
  WhatsappSyncAccountStatus502.pipe(HttpApiSchema.status(502)),
619
626
  WhatsappSyncAccountStatus504.pipe(HttpApiSchema.status(504))
620
627
  ]
621
- }).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", {
622
630
  params: WhatsappGetMediaDownloadUrlPathParams,
623
631
  success: WhatsappGetMediaDownloadUrl200,
624
632
  error: [
@@ -630,7 +638,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
630
638
  WhatsappGetMediaDownloadUrl500,
631
639
  WhatsappGetMediaDownloadUrl504.pipe(HttpApiSchema.status(504))
632
640
  ]
633
- }).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", {
634
643
  query: WhatsappGetServiceWindowBillingQuery,
635
644
  success: WhatsappGetServiceWindowBilling200,
636
645
  error: [
@@ -642,7 +651,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
642
651
  WhatsappGetServiceWindowBilling500,
643
652
  WhatsappGetServiceWindowBilling504.pipe(HttpApiSchema.status(504))
644
653
  ]
645
- }).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", {
646
656
  query: WhatsappGetServiceWindowStatusQuery,
647
657
  success: WhatsappGetServiceWindowStatus200,
648
658
  error: [
@@ -654,7 +664,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
654
664
  WhatsappGetServiceWindowStatus500,
655
665
  WhatsappGetServiceWindowStatus504.pipe(HttpApiSchema.status(504))
656
666
  ]
657
- }).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", {
658
669
  query: WhatsappGetStatsQuery,
659
670
  success: WhatsappGetStats200,
660
671
  error: [
@@ -665,7 +676,8 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
665
676
  WhatsappGetStats500,
666
677
  WhatsappGetStats504.pipe(HttpApiSchema.status(504))
667
678
  ]
668
- }).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", {
669
681
  query: WhatsappGetTemplateStatsQuery,
670
682
  success: WhatsappGetTemplateStats200,
671
683
  error: [
@@ -676,7 +688,5 @@ var WhatsAppGroup = class extends HttpApiGroup.make("WhatsApp").add(HttpApiEndpo
676
688
  WhatsappGetTemplateStats500,
677
689
  WhatsappGetTemplateStats504.pipe(HttpApiSchema.status(504))
678
690
  ]
679
- }).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") {};
680
- 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, WhatsappReleaseBusinessAccount200, WhatsappReleaseBusinessAccount400, WhatsappReleaseBusinessAccount401, WhatsappReleaseBusinessAccount403, WhatsappReleaseBusinessAccount404, WhatsappReleaseBusinessAccount409, WhatsappReleaseBusinessAccount422, WhatsappReleaseBusinessAccount500, WhatsappReleaseBusinessAccount504, WhatsappReleaseBusinessAccountPathParams, WhatsappReleaseBusinessAccountRequestJson, 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 };
681
-
682
- //# sourceMappingURL=whats-app.js.map
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 };
@@ -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,5 @@ 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 };
56
-
57
- //# sourceMappingURL=whoami.js.map
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 };
@@ -1654,5 +1654,3 @@ const SamvaOperations = {
1654
1654
  }
1655
1655
  };
1656
1656
  export { SamvaErrorMetadata, SamvaOperations };
1657
-
1658
- //# sourceMappingURL=generated-metadata.js.map
@@ -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,21 @@ 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
-
45
- //# 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,11 @@ 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
-
25
- //# 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
  };
@@ -99,5 +99,3 @@ const layer = (config) => {
99
99
  };
100
100
  const layerFetch = (config) => layer(config).pipe(Layer.provide(FetchHttpClient.layer));
101
101
  export { Service, layer, layerFetch };
102
-
103
- //# sourceMappingURL=client.js.map
@@ -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,
@@ -20,5 +21,3 @@ const addEmailSender = Effect.fn("Email.addSender")(function* (input, options) {
20
21
  }), timeoutMs));
21
22
  });
22
23
  export { addEmailSender };
23
-
24
- //# sourceMappingURL=email-sender.js.map
@@ -49,5 +49,3 @@ const streamCursor = (options = {}) => Effect.gen(function* () {
49
49
  }).pipe(Effect.flatMap((result) => "error" in result ? Effect.fail(toStreamError(result.error)) : Effect.succeed(result.cursor)));
50
50
  });
51
51
  export { events, streamCursor };
52
-
53
- //# sourceMappingURL=log-events.js.map
@@ -29,5 +29,3 @@ const streamEvents = (open) => Stream.scoped(Stream.unwrap(Effect.gen(function*
29
29
  })));
30
30
  const events = (options = {}) => streamEvents((connection) => new MailboxEventStream(connection, options));
31
31
  export { events, streamEvents, toStreamError };
32
-
33
- //# sourceMappingURL=mailbox-events.js.map
@@ -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,18 @@ 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 };
84
-
85
- //# sourceMappingURL=operation.js.map
88
+ export { attemptTimeout, callEndpoint, endpointGroup, operation, stripUndefined };
@@ -1,13 +1,16 @@
1
1
  import { Effect } from "effect";
2
2
  import { mediaCreateBody, planInlineUploads, withUploadedAttachments } from "../../inline-attachments.js";
3
3
  import { buildEmailSendPayload, buildMessagesSendPayload } from "../../normalize.js";
4
- import { MediaGroup } from "../generated/media.js";
5
- import { MessagesGroup } from "../generated/messages.js";
4
+ import { MediaCompleteEndpoint, MediaCreateEndpoint } from "../generated/media.js";
5
+ import { MessagesSendEndpoint } from "../generated/messages.js";
6
6
  import { generateIdempotencyKey, withRetry } from "../retry.js";
7
7
  import { Service } from "./client.js";
8
- import { attemptTimeout, callEndpoint, stripUndefined } from "./operation.js";
8
+ import { attemptTimeout, callEndpoint, endpointGroup, stripUndefined } from "./operation.js";
9
9
  import { withTimeout } from "./timeout.js";
10
10
  // src/effect/internal/send.ts
11
+ const MessagesSend = /* @__PURE__ */ endpointGroup("Messages", MessagesSendEndpoint);
12
+ const MediaCreate = /* @__PURE__ */ endpointGroup("Media", MediaCreateEndpoint);
13
+ const MediaComplete = /* @__PURE__ */ endpointGroup("Media", MediaCompleteEndpoint);
11
14
  /**
12
15
  * Inline attachment content over the API's request cap travels as media instead: the largest
13
16
  * attachments are uploaded (create, put to the presigned URL, complete) and replaced by their
@@ -19,7 +22,7 @@ const uploadOversizedAttachments = (client, payload, timeoutMs, uploadTimeoutMs)
19
22
  if (plan.length === 0) return payload;
20
23
  const uploaded = /* @__PURE__ */ new Map();
21
24
  for (const upload of plan) {
22
- const created = yield* withTimeout(callEndpoint(MediaGroup, "mediaCreate", { payload: mediaCreateBody(upload) }), timeoutMs);
25
+ const created = yield* withTimeout(callEndpoint(MediaCreate, "mediaCreate", { payload: mediaCreateBody(upload) }), timeoutMs);
23
26
  yield* client.putUpload({
24
27
  filename: upload.filename,
25
28
  mediaId: created.id,
@@ -29,7 +32,7 @@ const uploadOversizedAttachments = (client, payload, timeoutMs, uploadTimeoutMs)
29
32
  bytes: upload.bytes,
30
33
  timeoutMs: uploadTimeoutMs
31
34
  });
32
- yield* withTimeout(callEndpoint(MediaGroup, "mediaComplete", { params: { id: created.id } }), timeoutMs);
35
+ yield* withTimeout(callEndpoint(MediaComplete, "mediaComplete", { params: { id: created.id } }), timeoutMs);
33
36
  uploaded.set(upload.index, {
34
37
  mediaId: created.id,
35
38
  upload
@@ -42,17 +45,15 @@ const sendPayload = (payload, options) => Effect.gen(function* () {
42
45
  const timeoutMs = attemptTimeout(options, client);
43
46
  const idempotencyKey = options?.idempotencyKey ?? client.idempotency?.("messagesSend") ?? (yield* generateIdempotencyKey);
44
47
  const prepared = yield* uploadOversizedAttachments(client, payload, timeoutMs, options?.uploadTimeoutMs);
45
- return yield* withRetry(withTimeout(callEndpoint(MessagesGroup, "messagesSend", {
48
+ return yield* withRetry(withTimeout(callEndpoint(MessagesSend, "messagesSend", {
46
49
  payload: stripUndefined(prepared),
47
50
  headers: { "idempotency-key": idempotencyKey }
48
51
  }), timeoutMs));
49
52
  });
50
- const sendMessage = Effect.fn("Messages.send")(function* (input, options) {
53
+ const sendMessage = /* @__PURE__ */ Effect.fn("Messages.send")(function* (input, options) {
51
54
  return yield* sendPayload(buildMessagesSendPayload(input), options);
52
55
  });
53
- const sendEmail = Effect.fn("Email.send")(function* (input, options) {
56
+ const sendEmail = /* @__PURE__ */ Effect.fn("Email.send")(function* (input, options) {
54
57
  return yield* sendPayload(buildEmailSendPayload(input), options);
55
58
  });
56
59
  export { sendEmail, sendMessage };
57
-
58
- //# sourceMappingURL=send.js.map
@@ -16,5 +16,3 @@ const withTimeout = (effect, timeoutMs) => timeoutMs === null ? effect : Effect.
16
16
  orElse: () => Effect.fail(new SamvaTimeoutError({ timeoutMs }))
17
17
  });
18
18
  export { SamvaTimeoutError, withTimeout };
19
-
20
- //# sourceMappingURL=timeout.js.map