samva 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/AGENTS.md +5 -0
  2. package/README.md +16 -3
  3. package/dist/{rolldown-runtime-D7D4PA-g.js → _virtual/_rolldown/runtime.js} +1 -1
  4. package/dist/client/client/client.gen.js +174 -0
  5. package/dist/client/client/utils.gen.js +177 -0
  6. package/dist/client/client.gen.js +8 -0
  7. package/dist/client/core/auth.gen.js +12 -0
  8. package/dist/client/core/bodySerializer.gen.js +6 -0
  9. package/dist/client/core/params.gen.js +77 -0
  10. package/dist/client/core/pathSerializer.gen.js +82 -0
  11. package/dist/client/core/serverSentEvents.gen.js +96 -0
  12. package/dist/client/core/utils.gen.js +78 -0
  13. package/dist/{promises---Kbh-7z.js → client/sdk.gen.js} +4 -2293
  14. package/dist/client-attribution.js +9 -0
  15. package/dist/effect/analytics.d.ts +6 -6
  16. package/dist/effect/analytics.js +23 -2
  17. package/dist/effect/api-keys.d.ts +12 -12
  18. package/dist/effect/api-keys.js +29 -2
  19. package/dist/effect/attachments.d.ts +4 -4
  20. package/dist/effect/attachments.js +19 -2
  21. package/dist/effect/brands.d.ts +6 -6
  22. package/dist/effect/brands.js +26 -3
  23. package/dist/effect/campaigns.d.ts +18 -18
  24. package/dist/effect/campaigns.js +35 -2
  25. package/dist/effect/categories.d.ts +2 -2
  26. package/dist/effect/categories.js +95 -1
  27. package/dist/effect/client.js +3 -3
  28. package/dist/effect/contact-groups.d.ts +14 -14
  29. package/dist/effect/contact-groups.js +31 -2
  30. package/dist/effect/contacts.d.ts +28 -28
  31. package/dist/effect/contacts.js +52 -2
  32. package/dist/effect/conversations.d.ts +17 -17
  33. package/dist/effect/conversations.js +37 -2
  34. package/dist/effect/custom-fields.d.ts +4 -4
  35. package/dist/effect/custom-fields.js +19 -2
  36. package/dist/effect/email.d.ts +75 -75
  37. package/dist/effect/email.js +140 -2
  38. package/dist/effect/errors.d.ts +2 -0
  39. package/dist/effect/errors.js +3 -0
  40. package/dist/effect/events.d.ts +2 -2
  41. package/dist/effect/events.js +17 -3
  42. package/dist/effect/extension-installations.d.ts +11 -11
  43. package/dist/effect/extension-installations.js +29 -2
  44. package/dist/effect/extensions.d.ts +9 -9
  45. package/dist/effect/extensions.js +21 -2
  46. package/dist/effect/feedback.d.ts +1 -1
  47. package/dist/effect/feedback.js +14 -3
  48. package/dist/{analytics-CaqPRsry.js → effect/generated/analytics.js} +4 -23
  49. package/dist/{api-keys-Ce1Y4_Ip.js → effect/generated/api-keys.js} +4 -29
  50. package/dist/{attachments-DYqVIraC.js → effect/generated/attachments.js} +3 -18
  51. package/dist/{brands-ZwuOGIWO.js → effect/generated/brands.js} +5 -25
  52. package/dist/{campaigns-DZlz1E9E.js → effect/generated/campaigns.js} +4 -35
  53. package/dist/effect/generated/contact-events.js +37 -0
  54. package/dist/{contact-groups-BLbFXnjq.js → effect/generated/contact-groups.js} +3 -30
  55. package/dist/{contacts-BbsoXXB4.js → effect/generated/contacts.js} +3 -81
  56. package/dist/{conversations-_sRHueML.js → effect/generated/conversations.js} +3 -36
  57. package/dist/{custom-fields-BHWbwlKn.js → effect/generated/custom-fields.js} +5 -19
  58. package/dist/{email-R0NAA9PW.js → effect/generated/email.js} +995 -1146
  59. package/dist/{events-CxbTUHYT.js → effect/generated/events.js} +3 -15
  60. package/dist/{extension-installations-CD94LPmk.js → effect/generated/extension-installations.js} +4 -29
  61. package/dist/{extensions-BKyNQLvu.js → effect/generated/extensions.js} +3 -20
  62. package/dist/{feedback-Bpa09JOS.js → effect/generated/feedback.js} +3 -12
  63. package/dist/{journeys-CARo_BJT.js → effect/generated/journeys.js} +3 -38
  64. package/dist/{mailboxes-BRDn7BIK.js → effect/generated/mailboxes.js} +793 -951
  65. package/dist/{media-VrrtNnft.js → effect/generated/media.js} +3 -3
  66. package/dist/effect/generated/messages.js +671 -0
  67. package/dist/{namespaces-CcvEbG-y.js → effect/generated/namespaces.js} +3 -20
  68. package/dist/{operations-CmB3FHwf.js → effect/generated/operations.js} +3 -16
  69. package/dist/{organizations-A-plufWc.js → effect/generated/organizations.js} +3 -24
  70. package/dist/{scheduled-messages-DkKZRRaN.js → effect/generated/scheduled-messages.js} +4 -21
  71. package/dist/effect/generated/shared.js +1053 -0
  72. package/dist/{subscriptions-DEXYtMXg.js → effect/generated/subscriptions.js} +3 -9
  73. package/dist/{templates-DZomxsG7.js → effect/generated/templates.js} +3 -78
  74. package/dist/{unsubscribe-groups-Iqk4Isf9.js → effect/generated/unsubscribe-groups.js} +5 -29
  75. package/dist/{webhooks-CPXuu8Xf.js → effect/generated/webhooks.js} +4 -34
  76. package/dist/{whoami-Ccz0jwlt.js → effect/generated/whoami.js} +5 -10
  77. package/dist/{categories-CA4XIQAb.js → effect/generated-metadata.js} +2 -94
  78. package/dist/effect/index.d.ts +1 -2
  79. package/dist/effect/index.js +32 -32
  80. package/dist/effect/internal/client.js +69 -0
  81. package/dist/effect/internal/email-sender.js +21 -0
  82. package/dist/effect/internal/mailbox-events.js +33 -0
  83. package/dist/effect/internal/operation.js +116 -0
  84. package/dist/effect/internal/send.js +56 -0
  85. package/dist/effect/journeys.d.ts +18 -18
  86. package/dist/effect/journeys.js +39 -2
  87. package/dist/effect/mailboxes.d.ts +191 -191
  88. package/dist/effect/mailboxes.js +135 -3
  89. package/dist/effect/media.d.ts +5 -5
  90. package/dist/effect/media.js +10 -10
  91. package/dist/effect/messages.d.ts +14 -14
  92. package/dist/effect/messages.js +15 -14
  93. package/dist/effect/namespaces.d.ts +7 -7
  94. package/dist/effect/namespaces.js +21 -2
  95. package/dist/effect/operations.d.ts +5 -5
  96. package/dist/effect/operations.js +17 -2
  97. package/dist/effect/organizations.d.ts +7 -7
  98. package/dist/effect/organizations.js +25 -2
  99. package/dist/effect/pagination.js +39 -0
  100. package/dist/effect/retry.js +3 -3
  101. package/dist/{runtime-P0l1_2-C.js → effect/runtime.js} +2 -2
  102. package/dist/effect/scheduled-messages.d.ts +7 -7
  103. package/dist/effect/scheduled-messages.js +21 -2
  104. package/dist/effect/subscriptions.d.ts +1 -1
  105. package/dist/effect/subscriptions.js +10 -2
  106. package/dist/effect/templates.d.ts +39 -39
  107. package/dist/effect/templates.js +80 -3
  108. package/dist/effect/unsubscribe-groups.d.ts +11 -11
  109. package/dist/effect/unsubscribe-groups.js +29 -2
  110. package/dist/effect/webhooks.d.ts +14 -14
  111. package/dist/effect/webhooks.js +35 -3
  112. package/dist/effect/whoami.d.ts +9 -9
  113. package/dist/effect/whoami.js +10 -2
  114. package/dist/index.js +4 -3
  115. package/dist/{inline-attachments-Bi1hDltp.js → inline-attachments.js} +13 -7
  116. package/dist/{mailbox-events-VKR4f3qq.js → mailbox-events.js} +2 -2
  117. package/dist/{normalize-B79uJIeb.js → normalize.js} +2 -2
  118. package/dist/package.js +6 -0
  119. package/dist/promises/errors.gen.js +1340 -0
  120. package/dist/promises/index.js +288 -3
  121. package/dist/{operation-n_IYgNVK.js → service-map.js} +2 -148
  122. package/package.json +6 -2
  123. package/dist/client-DOzUrdTE.js +0 -1115
  124. package/dist/send-Bxc0XfGE.js +0 -722
@@ -1,6 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { G as FlagDisabledError, Jt as UnauthorizedError, K as ForbiddenError, Lt as ResourceNotFoundError, Nt as PaymentRequiredError, O as DeliveryUnavailableError, Ot as OnboardingReviewRequiredError, Pt as RateLimitedError, U as ExternalServiceError, Y as InternalError, Yt as UnsubscribeId, _ as ContactGroupId, en as ValidationError, l as BillingProviderError, m as ConflictError, p as CampaignFooterRequiredError, q as GatewayTimeoutError, s as ApiKeySecurityMiddleware, u as BrandAddressRequiredError, zt as SenderNotReadyError } from "./client-DOzUrdTE.js";
3
- import { n as forGroup } from "./operation-n_IYgNVK.js";
1
+ import { ApiKeySecurityMiddleware, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, ContactGroupId, DeliveryUnavailableError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, UnauthorizedError, UnsubscribeId, ValidationError } from "./shared.js";
4
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
5
3
  import * as Schema from "effect/Schema";
6
4
  //#region src/effect/generated/subscriptions.ts
@@ -58,10 +56,6 @@ var SubscriptionsGroup = class extends HttpApiGroup.make("Subscriptions").add(Ht
58
56
  ]
59
57
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "subscriptions.subscribe").annotate(OpenApi.Summary, "Request subscription confirmation").annotate(OpenApi.Description, "Sends a confirmation email from your sender. Only the recipient's explicit confirmation adds them to the active static contact group and clears the optional unsubscribe group. The link expires after seven days and can be used once. A custom published email template receives confirmUrl. Sending follows ordinary sender, admission, billing, and brand-footer settings. Requires email send authority in addition to the declared contact grants, including the optional unsubscribe preference change.")).annotate(OpenApi.Description, "Recipient-confirmed contact list subscriptions") {};
60
58
  //#endregion
61
- //#region src/effect/subscriptions.ts
62
- var subscriptions_exports = /* @__PURE__ */ __exportAll({ subscribe: () => subscribe });
63
- const subscribe = forGroup(SubscriptionsGroup)("subscriptionsSubscribe");
64
- //#endregion
65
- export { subscriptions_exports as n, subscribe as t };
59
+ export { SubscribeResult, SubscriptionsGroup, SubscriptionsSubscribe200, SubscriptionsSubscribe401, SubscriptionsSubscribe402, SubscriptionsSubscribe403, SubscriptionsSubscribe404, SubscriptionsSubscribe409, SubscriptionsSubscribe422, SubscriptionsSubscribe429, SubscriptionsSubscribe500, SubscriptionsSubscribe502, SubscriptionsSubscribe503, SubscriptionsSubscribe504, SubscriptionsSubscribeRequestJson };
66
60
 
67
- //# sourceMappingURL=subscriptions-DEXYtMXg.js.map
61
+ //# sourceMappingURL=subscriptions.js.map
@@ -1,6 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { $t as UserId, D as Cursor, Ft as RenderLocale, Gt as TemplateInputContractId, Ht as SuccessResponse, It as RenderTimeZone, Jt as UnauthorizedError, K as ForbiddenError, Kt as TemplatePublicationId, Lt as ResourceNotFoundError, Mt as OrganizationId, T as CreateTemplatePayload, Ut as TemplateFromDefault, Wt as TemplateId, Y as InternalError, Zt as UpdateTemplatePayload, d as BrandAssets, en as ValidationError, et as JsonValue, f as BrandFooter, m as ConflictError, q as GatewayTimeoutError, s as ApiKeySecurityMiddleware } from "./client-DOzUrdTE.js";
3
- import { n as forGroup } from "./operation-n_IYgNVK.js";
1
+ import { ApiKeySecurityMiddleware, BrandAssets, BrandFooter, ConflictError, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, JsonValue, OrganizationId, RenderLocale, RenderTimeZone, ResourceNotFoundError, SuccessResponse, TemplateFromDefault, TemplateId, TemplateInputContractId, TemplatePublicationId, UnauthorizedError, UserId, ValidationError } from "./shared.js";
4
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
5
3
  import * as Schema from "effect/Schema";
6
4
  //#region src/effect/generated/templates.ts
@@ -2211,79 +2209,6 @@ var TemplatesGroup = class extends HttpApiGroup.make("Templates").add(HttpApiEnd
2211
2209
  ]
2212
2210
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "templates.addEntry").annotate(OpenApi.Summary, "Add a template entry").annotate(OpenApi.Description, "Registers a `.tsx` file under `templates/` or `emails/` in an existing template project as its own template and returns it with status 201. The file does not need to exist yet; publishing fails until a commit contains it. Repeating the call with the same entry path, name, and slug returns the existing template.")).annotate(OpenApi.Description, "Git-backed email template projects, workspace editing, immutable publications, and delivery defaults") {};
2213
2211
  //#endregion
2214
- //#region src/effect/templates.ts
2215
- var templates_exports = /* @__PURE__ */ __exportAll({
2216
- CreatePayload: () => CreateTemplatePayload,
2217
- UpdatePayload: () => UpdateTemplatePayload,
2218
- addEntry: () => addEntry,
2219
- attachFamilyMember: () => attachFamilyMember,
2220
- attachWorkspaceResource: () => attachWorkspaceResource,
2221
- checkWorkspace: () => checkWorkspace,
2222
- create: () => create,
2223
- createFamily: () => createFamily,
2224
- createFamilyFromTemplate: () => createFamilyFromTemplate,
2225
- deleteFamily: () => deleteFamily,
2226
- detachFamilyMember: () => detachFamilyMember,
2227
- diffWorkspace: () => diffWorkspace,
2228
- getById: () => getById,
2229
- getFamily: () => getFamily,
2230
- getGitRepository: () => getGitRepository,
2231
- getInputContract: () => getInputContract,
2232
- getPublication: () => getPublication,
2233
- issueGitCredential: () => issueGitCredential,
2234
- list: () => list,
2235
- listFamilies: () => listFamilies,
2236
- listInputContracts: () => listInputContracts,
2237
- openWorkspace: () => openWorkspace,
2238
- patchWorkspace: () => patchWorkspace,
2239
- publish: () => publish,
2240
- putWorkspaceAsset: () => putWorkspaceAsset,
2241
- remove: () => remove,
2242
- removeWorkspaceResource: () => removeWorkspaceResource,
2243
- renameFamily: () => renameFamily,
2244
- renderPublication: () => renderPublication,
2245
- renderWorkspaceFixture: () => renderWorkspaceFixture,
2246
- resolveWorkspaceConflict: () => resolveWorkspaceConflict,
2247
- restoreWorkspace: () => restoreWorkspace,
2248
- saveWorkspace: () => saveWorkspace,
2249
- update: () => update,
2250
- workspaceHistory: () => workspaceHistory
2251
- });
2252
- const make = forGroup(TemplatesGroup);
2253
- const list = make("templatesList");
2254
- const create = make("templatesCreate");
2255
- const addEntry = make("templatesAddEntry");
2256
- const listFamilies = make("templatesListFamilies");
2257
- const createFamily = make("templatesCreateFamily");
2258
- const getFamily = make("templatesGetFamily");
2259
- const deleteFamily = make("templatesDeleteFamily");
2260
- const renameFamily = make("templatesRenameFamily");
2261
- const createFamilyFromTemplate = make("templatesCreateFamilyFromTemplate");
2262
- const attachFamilyMember = make("templatesAttachFamilyMember");
2263
- const detachFamilyMember = make("templatesDetachFamilyMember");
2264
- const getById = make("templatesGetById");
2265
- const remove = make("templatesRemove");
2266
- const update = make("templatesUpdate");
2267
- const openWorkspace = make("templatesOpenWorkspace");
2268
- const getGitRepository = make("templatesGetGitRepository");
2269
- const issueGitCredential = make("templatesIssueGitCredential");
2270
- const patchWorkspace = make("templatesPatchWorkspace");
2271
- const putWorkspaceAsset = make("templatesPutWorkspaceAsset");
2272
- const resolveWorkspaceConflict = make("templatesResolveWorkspaceConflict");
2273
- const attachWorkspaceResource = make("templatesAttachWorkspaceResource");
2274
- const removeWorkspaceResource = make("templatesRemoveWorkspaceResource");
2275
- const restoreWorkspace = make("templatesRestoreWorkspace");
2276
- const saveWorkspace = make("templatesSaveWorkspace");
2277
- const checkWorkspace = make("templatesCheckWorkspace");
2278
- const renderWorkspaceFixture = make("templatesRenderWorkspaceFixture");
2279
- const publish = make("templatesPublish");
2280
- const getPublication = make("templatesGetPublication");
2281
- const renderPublication = make("templatesRenderPublication");
2282
- const listInputContracts = make("templatesListInputContracts");
2283
- const getInputContract = make("templatesGetInputContract");
2284
- const diffWorkspace = make("templatesDiffWorkspace");
2285
- const workspaceHistory = make("templatesWorkspaceHistory");
2286
- //#endregion
2287
- export { restoreWorkspace as A, putWorkspaceAsset as C, renderPublication as D, renameFamily as E, templates_exports as M, update as N, renderWorkspaceFixture as O, workspaceHistory as P, publish as S, removeWorkspaceResource as T, list as _, create as a, openWorkspace as b, deleteFamily as c, getById as d, getFamily as f, issueGitCredential as g, getPublication as h, checkWorkspace as i, saveWorkspace as j, resolveWorkspaceConflict as k, detachFamilyMember as l, getInputContract as m, attachFamilyMember as n, createFamily as o, getGitRepository as p, attachWorkspaceResource as r, createFamilyFromTemplate as s, addEntry as t, diffWorkspace as u, listFamilies as v, remove as w, patchWorkspace as x, listInputContracts as y };
2212
+ export { BrandFooterBlock, BrandRenderedFooter, Template, TemplateFamily, TemplateFamilyId, TemplateFamilyMember, TemplateFamilyPage, TemplateInputContractPage, TemplatePage, TemplateProjectId, TemplatePublicationBrand, TemplatePublicationRender, TemplateSummary, TemplatesAddEntry201, TemplatesAddEntry401, TemplatesAddEntry403, TemplatesAddEntry404, TemplatesAddEntry409, TemplatesAddEntry422, TemplatesAddEntry500, TemplatesAddEntry504, TemplatesAddEntryPathParams, TemplatesAddEntryRequestJson, TemplatesAttachFamilyMember200, TemplatesAttachFamilyMember401, TemplatesAttachFamilyMember403, TemplatesAttachFamilyMember404, TemplatesAttachFamilyMember409, TemplatesAttachFamilyMember422, TemplatesAttachFamilyMember500, TemplatesAttachFamilyMember504, TemplatesAttachFamilyMemberPathParams, TemplatesAttachWorkspaceResource200, TemplatesAttachWorkspaceResource401, TemplatesAttachWorkspaceResource403, TemplatesAttachWorkspaceResource404, TemplatesAttachWorkspaceResource409, TemplatesAttachWorkspaceResource422, TemplatesAttachWorkspaceResource500, TemplatesAttachWorkspaceResource504, TemplatesAttachWorkspaceResourcePathParams, TemplatesAttachWorkspaceResourceRequestJson, TemplatesCheckWorkspace200, TemplatesCheckWorkspace401, TemplatesCheckWorkspace403, TemplatesCheckWorkspace404, TemplatesCheckWorkspace409, TemplatesCheckWorkspace422, TemplatesCheckWorkspace500, TemplatesCheckWorkspace504, TemplatesCheckWorkspacePathParams, TemplatesCheckWorkspaceRequestJson, TemplatesCreate201, TemplatesCreate401, TemplatesCreate403, TemplatesCreate409, TemplatesCreate422, TemplatesCreate500, TemplatesCreate504, TemplatesCreateFamily201, TemplatesCreateFamily401, TemplatesCreateFamily403, TemplatesCreateFamily422, TemplatesCreateFamily500, TemplatesCreateFamily504, TemplatesCreateFamilyFromTemplate201, TemplatesCreateFamilyFromTemplate401, TemplatesCreateFamilyFromTemplate403, TemplatesCreateFamilyFromTemplate404, TemplatesCreateFamilyFromTemplate409, TemplatesCreateFamilyFromTemplate422, TemplatesCreateFamilyFromTemplate500, TemplatesCreateFamilyFromTemplate504, TemplatesCreateFamilyFromTemplatePathParams, TemplatesCreateFamilyFromTemplateRequestJson, TemplatesCreateFamilyRequestJson, TemplatesCreateRequestJson, TemplatesDeleteFamily200, TemplatesDeleteFamily401, TemplatesDeleteFamily403, TemplatesDeleteFamily404, TemplatesDeleteFamily422, TemplatesDeleteFamily500, TemplatesDeleteFamily504, TemplatesDeleteFamilyPathParams, TemplatesDetachFamilyMember200, TemplatesDetachFamilyMember401, TemplatesDetachFamilyMember403, TemplatesDetachFamilyMember404, TemplatesDetachFamilyMember409, TemplatesDetachFamilyMember422, TemplatesDetachFamilyMember500, TemplatesDetachFamilyMember504, TemplatesDetachFamilyMemberPathParams, TemplatesDiffWorkspace200, TemplatesDiffWorkspace401, TemplatesDiffWorkspace403, TemplatesDiffWorkspace404, TemplatesDiffWorkspace409, TemplatesDiffWorkspace422, TemplatesDiffWorkspace500, TemplatesDiffWorkspace504, TemplatesDiffWorkspacePathParams, TemplatesDiffWorkspaceRequestJson, TemplatesGetById200, TemplatesGetById401, TemplatesGetById403, TemplatesGetById404, TemplatesGetById422, TemplatesGetById500, TemplatesGetById504, TemplatesGetByIdPathParams, TemplatesGetFamily200, TemplatesGetFamily401, TemplatesGetFamily403, TemplatesGetFamily404, TemplatesGetFamily422, TemplatesGetFamily500, TemplatesGetFamily504, TemplatesGetFamilyPathParams, TemplatesGetGitRepository200, TemplatesGetGitRepository401, TemplatesGetGitRepository403, TemplatesGetGitRepository404, TemplatesGetGitRepository409, TemplatesGetGitRepository422, TemplatesGetGitRepository500, TemplatesGetGitRepository504, TemplatesGetGitRepositoryPathParams, TemplatesGetInputContract200, TemplatesGetInputContract401, TemplatesGetInputContract403, TemplatesGetInputContract404, TemplatesGetInputContract422, TemplatesGetInputContract500, TemplatesGetInputContract504, TemplatesGetInputContractPathParams, TemplatesGetPublication200, TemplatesGetPublication401, TemplatesGetPublication403, TemplatesGetPublication404, TemplatesGetPublication422, TemplatesGetPublication500, TemplatesGetPublication504, TemplatesGetPublicationPathParams, TemplatesGroup, TemplatesIssueGitCredential200, TemplatesIssueGitCredential401, TemplatesIssueGitCredential403, TemplatesIssueGitCredential404, TemplatesIssueGitCredential409, TemplatesIssueGitCredential422, TemplatesIssueGitCredential500, TemplatesIssueGitCredential504, TemplatesIssueGitCredentialPathParams, TemplatesIssueGitCredentialRequestJson, TemplatesList200, TemplatesList401, TemplatesList403, TemplatesList422, TemplatesList500, TemplatesList504, TemplatesListFamilies200, TemplatesListFamilies401, TemplatesListFamilies403, TemplatesListFamilies422, TemplatesListFamilies500, TemplatesListFamilies504, TemplatesListFamiliesQuery, TemplatesListInputContracts200, TemplatesListInputContracts401, TemplatesListInputContracts403, TemplatesListInputContracts404, TemplatesListInputContracts422, TemplatesListInputContracts500, TemplatesListInputContracts504, TemplatesListInputContractsPathParams, TemplatesListInputContractsQuery, TemplatesListQuery, TemplatesOpenWorkspace200, TemplatesOpenWorkspace401, TemplatesOpenWorkspace403, TemplatesOpenWorkspace404, TemplatesOpenWorkspace409, TemplatesOpenWorkspace422, TemplatesOpenWorkspace500, TemplatesOpenWorkspace504, TemplatesOpenWorkspacePathParams, TemplatesPatchWorkspace200, TemplatesPatchWorkspace401, TemplatesPatchWorkspace403, TemplatesPatchWorkspace404, TemplatesPatchWorkspace409, TemplatesPatchWorkspace422, TemplatesPatchWorkspace500, TemplatesPatchWorkspace504, TemplatesPatchWorkspacePathParams, TemplatesPatchWorkspaceRequestJson, TemplatesPublish201, TemplatesPublish401, TemplatesPublish403, TemplatesPublish404, TemplatesPublish409, TemplatesPublish422, TemplatesPublish500, TemplatesPublish504, TemplatesPublishPathParams, TemplatesPublishRequestJson, TemplatesPutWorkspaceAsset200, TemplatesPutWorkspaceAsset401, TemplatesPutWorkspaceAsset403, TemplatesPutWorkspaceAsset404, TemplatesPutWorkspaceAsset409, TemplatesPutWorkspaceAsset422, TemplatesPutWorkspaceAsset500, TemplatesPutWorkspaceAsset504, TemplatesPutWorkspaceAssetPathParams, TemplatesPutWorkspaceAssetRequestJson, TemplatesRemove200, TemplatesRemove401, TemplatesRemove403, TemplatesRemove404, TemplatesRemove422, TemplatesRemove500, TemplatesRemove504, TemplatesRemovePathParams, TemplatesRemoveWorkspaceResource200, TemplatesRemoveWorkspaceResource401, TemplatesRemoveWorkspaceResource403, TemplatesRemoveWorkspaceResource404, TemplatesRemoveWorkspaceResource409, TemplatesRemoveWorkspaceResource422, TemplatesRemoveWorkspaceResource500, TemplatesRemoveWorkspaceResource504, TemplatesRemoveWorkspaceResourcePathParams, TemplatesRemoveWorkspaceResourceRequestJson, TemplatesRenameFamily200, TemplatesRenameFamily401, TemplatesRenameFamily403, TemplatesRenameFamily404, TemplatesRenameFamily422, TemplatesRenameFamily500, TemplatesRenameFamily504, TemplatesRenameFamilyPathParams, TemplatesRenameFamilyRequestJson, TemplatesRenderPublication200, TemplatesRenderPublication401, TemplatesRenderPublication403, TemplatesRenderPublication404, TemplatesRenderPublication409, TemplatesRenderPublication422, TemplatesRenderPublication500, TemplatesRenderPublication504, TemplatesRenderPublicationPathParams, TemplatesRenderPublicationRequestJson, TemplatesRenderWorkspaceFixture200, TemplatesRenderWorkspaceFixture401, TemplatesRenderWorkspaceFixture403, TemplatesRenderWorkspaceFixture404, TemplatesRenderWorkspaceFixture409, TemplatesRenderWorkspaceFixture422, TemplatesRenderWorkspaceFixture500, TemplatesRenderWorkspaceFixture504, TemplatesRenderWorkspaceFixturePathParams, TemplatesRenderWorkspaceFixtureRequestJson, TemplatesResolveWorkspaceConflict200, TemplatesResolveWorkspaceConflict401, TemplatesResolveWorkspaceConflict403, TemplatesResolveWorkspaceConflict404, TemplatesResolveWorkspaceConflict409, TemplatesResolveWorkspaceConflict422, TemplatesResolveWorkspaceConflict500, TemplatesResolveWorkspaceConflict504, TemplatesResolveWorkspaceConflictPathParams, TemplatesResolveWorkspaceConflictRequestJson, TemplatesRestoreWorkspace200, TemplatesRestoreWorkspace401, TemplatesRestoreWorkspace403, TemplatesRestoreWorkspace404, TemplatesRestoreWorkspace409, TemplatesRestoreWorkspace422, TemplatesRestoreWorkspace500, TemplatesRestoreWorkspace504, TemplatesRestoreWorkspacePathParams, TemplatesRestoreWorkspaceRequestJson, TemplatesSaveWorkspace200, TemplatesSaveWorkspace401, TemplatesSaveWorkspace403, TemplatesSaveWorkspace404, TemplatesSaveWorkspace409, TemplatesSaveWorkspace422, TemplatesSaveWorkspace500, TemplatesSaveWorkspace504, TemplatesSaveWorkspacePathParams, TemplatesSaveWorkspaceRequestJson, TemplatesUpdate200, TemplatesUpdate401, TemplatesUpdate403, TemplatesUpdate404, TemplatesUpdate409, TemplatesUpdate422, TemplatesUpdate500, TemplatesUpdate504, TemplatesUpdatePathParams, TemplatesUpdateRequestJson, TemplatesWorkspaceHistory200, TemplatesWorkspaceHistory401, TemplatesWorkspaceHistory403, TemplatesWorkspaceHistory404, TemplatesWorkspaceHistory409, TemplatesWorkspaceHistory422, TemplatesWorkspaceHistory500, TemplatesWorkspaceHistory504, TemplatesWorkspaceHistoryPathParams, TemplatesWorkspaceHistoryQuery, VersionCursor };
2288
2213
 
2289
- //# sourceMappingURL=templates-DZomxsG7.js.map
2214
+ //# sourceMappingURL=templates.js.map
@@ -1,6 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { D as Cursor, Jt as UnauthorizedError, K as ForbiddenError, Lt as ResourceNotFoundError, Y as InternalError, Yt as UnsubscribeId, en as ValidationError, m as ConflictError, q as GatewayTimeoutError, s as ApiKeySecurityMiddleware } from "./client-DOzUrdTE.js";
3
- import { n as forGroup } from "./operation-n_IYgNVK.js";
1
+ import { ApiKeySecurityMiddleware, ConflictError, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, ResourceNotFoundError, UnauthorizedError, UnsubscribeId, ValidationError } from "./shared.js";
4
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
5
3
  import * as Schema from "effect/Schema";
6
4
  //#region src/effect/generated/unsubscribe-groups.ts
@@ -20,7 +18,7 @@ const UnsubscribeGroupMemberPage = /* @__PURE__ */ Schema.Struct({
20
18
  })),
21
19
  nextCursor: Schema.Union([Schema.String, Schema.Null])
22
20
  }).annotate({ identifier: "UnsubscribeGroupMemberPage" });
23
- const UnsubscribeList200 = /* @__PURE__ */ Schema.Struct({ items: Schema.Array(Schema.Struct({
21
+ const UnsubscribeGroupList = /* @__PURE__ */ Schema.Struct({ items: Schema.Array(Schema.Struct({
24
22
  id: UnsubscribeId,
25
23
  organizationId: Schema.String,
26
24
  name: Schema.String,
@@ -30,6 +28,7 @@ const UnsubscribeList200 = /* @__PURE__ */ Schema.Struct({ items: Schema.Array(S
30
28
  createdAt: Schema.String,
31
29
  updatedAt: Schema.String
32
30
  })).check(Schema.isMaxLength(200).annotate({ expected: "a value with a length of at most 200" })) }).annotate({ identifier: "UnsubscribeGroupList" });
31
+ const UnsubscribeList200 = UnsubscribeGroupList;
33
32
  const UnsubscribeList401 = UnauthorizedError;
34
33
  const UnsubscribeList403 = ForbiddenError;
35
34
  const UnsubscribeList422 = ValidationError;
@@ -263,29 +262,6 @@ var UnsubscribeGroupsGroup = class extends HttpApiGroup.make("Unsubscribe Groups
263
262
  ]
264
263
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "unsubscribe.checkSubscription").annotate(OpenApi.Summary, "Check unsubscribe group membership").annotate(OpenApi.Description, "Returns the unsubscribe groups that an email address has unsubscribed from, optionally limited to a specified set of groups.")).annotate(OpenApi.Description, "Manage unsubscribe groups and members") {};
265
264
  //#endregion
266
- //#region src/effect/unsubscribe-groups.ts
267
- var unsubscribe_groups_exports = /* @__PURE__ */ __exportAll({
268
- addEmails: () => addEmails,
269
- checkSubscription: () => checkSubscription,
270
- create: () => create,
271
- list: () => list,
272
- listMembers: () => listMembers,
273
- remove: () => remove,
274
- removeEmails: () => removeEmails,
275
- setDefault: () => setDefault,
276
- update: () => update
277
- });
278
- const make = forGroup(UnsubscribeGroupsGroup);
279
- const list = make("unsubscribeList");
280
- const create = make("unsubscribeCreate");
281
- const update = make("unsubscribeUpdate");
282
- const remove = make("unsubscribeRemove");
283
- const setDefault = make("unsubscribeSetDefault");
284
- const listMembers = make("unsubscribeListMembers");
285
- const addEmails = make("unsubscribeAddEmails");
286
- const removeEmails = make("unsubscribeRemoveEmails");
287
- const checkSubscription = make("unsubscribeCheckSubscription");
288
- //#endregion
289
- export { listMembers as a, setDefault as c, list as i, unsubscribe_groups_exports as l, checkSubscription as n, remove as o, create as r, removeEmails as s, addEmails as t, update as u };
265
+ export { UnsubscribeAddEmails200, UnsubscribeAddEmails401, UnsubscribeAddEmails403, UnsubscribeAddEmails404, UnsubscribeAddEmails422, UnsubscribeAddEmails500, UnsubscribeAddEmails504, UnsubscribeAddEmailsPathParams, UnsubscribeAddEmailsRequestJson, UnsubscribeCheckSubscription200, UnsubscribeCheckSubscription401, UnsubscribeCheckSubscription403, UnsubscribeCheckSubscription422, UnsubscribeCheckSubscription500, UnsubscribeCheckSubscription504, UnsubscribeCheckSubscriptionQuery, UnsubscribeCreate201, UnsubscribeCreate401, UnsubscribeCreate403, UnsubscribeCreate409, UnsubscribeCreate422, UnsubscribeCreate500, UnsubscribeCreate504, UnsubscribeCreateRequestJson, UnsubscribeGroupList, UnsubscribeGroupMemberPage, UnsubscribeGroupsGroup, UnsubscribeList200, UnsubscribeList401, UnsubscribeList403, UnsubscribeList422, UnsubscribeList500, UnsubscribeList504, UnsubscribeListMembers200, UnsubscribeListMembers401, UnsubscribeListMembers403, UnsubscribeListMembers404, UnsubscribeListMembers422, UnsubscribeListMembers500, UnsubscribeListMembers504, UnsubscribeListMembersPathParams, UnsubscribeListMembersQuery, UnsubscribeRemove200, UnsubscribeRemove401, UnsubscribeRemove403, UnsubscribeRemove404, UnsubscribeRemove409, UnsubscribeRemove422, UnsubscribeRemove500, UnsubscribeRemove504, UnsubscribeRemoveEmails200, UnsubscribeRemoveEmails401, UnsubscribeRemoveEmails403, UnsubscribeRemoveEmails404, UnsubscribeRemoveEmails422, UnsubscribeRemoveEmails500, UnsubscribeRemoveEmails504, UnsubscribeRemoveEmailsPathParams, UnsubscribeRemoveEmailsRequestJson, UnsubscribeRemovePathParams, UnsubscribeSetDefault200, UnsubscribeSetDefault401, UnsubscribeSetDefault403, UnsubscribeSetDefault404, UnsubscribeSetDefault422, UnsubscribeSetDefault500, UnsubscribeSetDefault504, UnsubscribeSetDefaultPathParams, UnsubscribeUpdate200, UnsubscribeUpdate401, UnsubscribeUpdate403, UnsubscribeUpdate404, UnsubscribeUpdate422, UnsubscribeUpdate500, UnsubscribeUpdate504, UnsubscribeUpdatePathParams, UnsubscribeUpdateRequestJson };
290
266
 
291
- //# sourceMappingURL=unsubscribe-groups-Iqk4Isf9.js.map
267
+ //# sourceMappingURL=unsubscribe-groups.js.map
@@ -1,7 +1,5 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { n as SensitiveString } from "./runtime-P0l1_2-C.js";
3
- import { D as Cursor, E as CreateWebhookPayload, Et as NamespaceId, Ht as SuccessResponse, Jt as UnauthorizedError, K as ForbiddenError, Lt as ResourceNotFoundError, Nt as PaymentRequiredError, Pt as RateLimitedError, Qt as UpdateWebhookPayload, Y as InternalError, ct as MailboxId, en as ValidationError, et as JsonValue, l as BillingProviderError, m as ConflictError, q as GatewayTimeoutError, qt as TestWebhookPayload, s as ApiKeySecurityMiddleware, tn as WebhookEndpointId } from "./client-DOzUrdTE.js";
4
- import { n as forGroup } from "./operation-n_IYgNVK.js";
1
+ import { SensitiveString } from "../runtime.js";
2
+ import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, JsonValue, MailboxId, NamespaceId, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SuccessResponse, UnauthorizedError, ValidationError, WebhookEndpointId } from "./shared.js";
5
3
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
6
4
  import * as Schema from "effect/Schema";
7
5
  //#region src/effect/generated/webhooks.ts
@@ -497,34 +495,6 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
497
495
  ]
498
496
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.test").annotate(OpenApi.Summary, "Send a test webhook delivery").annotate(OpenApi.Description, "Queues a signed webhook.test event through the normal delivery and retry lifecycle.")).annotate(OpenApi.Description, "Customer event webhook management, testing, and delivery logs") {};
499
497
  //#endregion
500
- //#region src/effect/webhooks.ts
501
- var webhooks_exports = /* @__PURE__ */ __exportAll({
502
- CreatePayload: () => CreateWebhookPayload,
503
- TestPayload: () => TestWebhookPayload,
504
- UpdatePayload: () => UpdateWebhookPayload,
505
- create: () => create,
506
- get: () => get,
507
- getLogs: () => getLogs,
508
- getStats: () => getStats,
509
- list: () => list,
510
- regenerateSecret: () => regenerateSecret,
511
- remove: () => remove,
512
- retryDelivery: () => retryDelivery,
513
- test: () => test,
514
- update: () => update
515
- });
516
- const make = forGroup(WebhooksGroup);
517
- const list = make("webhooksList");
518
- const create = make("webhooksCreate");
519
- const get = make("webhooksGet");
520
- const remove = make("webhooksRemove");
521
- const update = make("webhooksUpdate");
522
- const test = make("webhooksTest");
523
- const getLogs = make("webhooksGetLogs");
524
- const getStats = make("webhooksGetStats");
525
- const retryDelivery = make("webhooksRetryDelivery");
526
- const regenerateSecret = make("webhooksRegenerateSecret");
527
- //#endregion
528
- export { list as a, retryDelivery as c, webhooks_exports as d, getStats as i, test as l, get as n, regenerateSecret as o, getLogs as r, remove as s, create as t, update as u };
498
+ export { WebhookAttemptId, WebhookDailyDeliveries, WebhookDeliveryCounts, WebhookDeliveryId, WebhookDeliveryPage, WebhookEndpoint, WebhookEndpointListItem, WebhookEndpointPage, WebhookEventId, WebhookStatsResponse, WebhooksCreate201, WebhooksCreate401, WebhooksCreate402, WebhooksCreate403, WebhooksCreate404, WebhooksCreate409, WebhooksCreate422, WebhooksCreate500, WebhooksCreate502, WebhooksCreate504, WebhooksCreateRequestJson, WebhooksGet200, WebhooksGet401, WebhooksGet403, WebhooksGet404, WebhooksGet422, WebhooksGet500, WebhooksGet504, WebhooksGetLogs200, WebhooksGetLogs401, WebhooksGetLogs403, WebhooksGetLogs404, WebhooksGetLogs422, WebhooksGetLogs500, WebhooksGetLogs504, WebhooksGetLogsPathParams, WebhooksGetLogsQuery, WebhooksGetPathParams, WebhooksGetStats200, WebhooksGetStats401, WebhooksGetStats403, WebhooksGetStats404, WebhooksGetStats422, WebhooksGetStats500, WebhooksGetStats504, WebhooksGetStatsPathParams, WebhooksGetStatsQuery, WebhooksGroup, WebhooksList200, WebhooksList401, WebhooksList403, WebhooksList422, WebhooksList500, WebhooksList504, WebhooksListQuery, WebhooksRegenerateSecret200, WebhooksRegenerateSecret401, WebhooksRegenerateSecret403, WebhooksRegenerateSecret404, WebhooksRegenerateSecret422, WebhooksRegenerateSecret500, WebhooksRegenerateSecret504, WebhooksRegenerateSecretPathParams, WebhooksRemove200, WebhooksRemove401, WebhooksRemove403, WebhooksRemove404, WebhooksRemove422, WebhooksRemove500, WebhooksRemove502, WebhooksRemove504, WebhooksRemovePathParams, WebhooksRetryDelivery200, WebhooksRetryDelivery401, WebhooksRetryDelivery403, WebhooksRetryDelivery404, WebhooksRetryDelivery422, WebhooksRetryDelivery429, WebhooksRetryDelivery500, WebhooksRetryDelivery504, WebhooksRetryDeliveryPathParams, WebhooksTest202, WebhooksTest401, WebhooksTest403, WebhooksTest404, WebhooksTest422, WebhooksTest500, WebhooksTest504, WebhooksTestPathParams, WebhooksTestRequestJson, WebhooksUpdate200, WebhooksUpdate401, WebhooksUpdate403, WebhooksUpdate404, WebhooksUpdate409, WebhooksUpdate422, WebhooksUpdate500, WebhooksUpdate504, WebhooksUpdatePathParams, WebhooksUpdateRequestJson };
529
499
 
530
- //# sourceMappingURL=webhooks-CPXuu8Xf.js.map
500
+ //# sourceMappingURL=webhooks.js.map
@@ -1,6 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { Jt as UnauthorizedError, K as ForbiddenError, Mt as OrganizationId, Y as InternalError, a as ApiKeyAccess, en as ValidationError, q as GatewayTimeoutError, s as ApiKeySecurityMiddleware } from "./client-DOzUrdTE.js";
3
- import { n as forGroup } from "./operation-n_IYgNVK.js";
1
+ import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, OrganizationId, UnauthorizedError, ValidationError } from "./shared.js";
4
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
5
3
  import * as Schema from "effect/Schema";
6
4
  //#region src/effect/generated/whoami.ts
@@ -30,10 +28,11 @@ const WhoamiApiKeyCredential = /* @__PURE__ */ Schema.Struct({
30
28
  start: Schema.Union([Schema.String, Schema.Null]),
31
29
  access: ApiKeyAccess
32
30
  }).annotate({ identifier: "WhoamiApiKeyCredential" });
33
- const WhoamiGet200 = /* @__PURE__ */ Schema.Struct({
31
+ const Whoami = /* @__PURE__ */ Schema.Struct({
34
32
  organization: WhoamiOrganization,
35
33
  credential: Schema.Union([WhoamiApiKeyCredential, WhoamiUserCredential])
36
34
  }).annotate({ identifier: "Whoami" });
35
+ const WhoamiGet200 = Whoami;
37
36
  const WhoamiGet401 = UnauthorizedError;
38
37
  const WhoamiGet403 = ForbiddenError;
39
38
  const WhoamiGet422 = ValidationError;
@@ -50,10 +49,6 @@ var WhoamiGroup = class extends HttpApiGroup.make("Whoami").add(HttpApiEndpoint.
50
49
  ]
51
50
  }).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.") {};
52
51
  //#endregion
53
- //#region src/effect/whoami.ts
54
- var whoami_exports = /* @__PURE__ */ __exportAll({ get: () => get });
55
- const get = forGroup(WhoamiGroup)("whoamiGet");
56
- //#endregion
57
- export { whoami_exports as n, get as t };
52
+ export { Whoami, WhoamiApiKeyCredential, WhoamiGet200, WhoamiGet401, WhoamiGet403, WhoamiGet422, WhoamiGet500, WhoamiGet504, WhoamiGroup, WhoamiOrganization, WhoamiUser, WhoamiUserCredential };
58
53
 
59
- //# sourceMappingURL=whoami-Ccz0jwlt.js.map
54
+ //# sourceMappingURL=whoami.js.map
@@ -1,5 +1,3 @@
1
- import { Effect } from "effect";
2
- import * as Predicate$1 from "effect/Predicate";
3
1
  //#region src/effect/generated-metadata.ts
4
2
  const SamvaErrorMetadata = {
5
3
  AnalyticsQueryError: {
@@ -916,96 +914,6 @@ const SamvaOperations = {
916
914
  }
917
915
  };
918
916
  //#endregion
919
- //#region src/effect/categories.ts
920
- /**
921
- * Semantic error-category helpers for the Effect SDK.
922
- *
923
- * Every operation's error channel carries the server's real tagged errors
924
- * ({@link import("./index").ConflictError} …). These helpers let callers catch
925
- * or test by *category* — auth, validation, throttling, transient … — without
926
- * enumerating tags, and cover the raw transport/decode errors too. The category
927
- * assignments are generated from the OpenAPI category extensions.
928
- *
929
- * @example
930
- * ```ts
931
- * import { catchAuthError, isRetryable } from "samva/effect";
932
- *
933
- * samva.messages.send(input).pipe(
934
- * catchAuthError((error) => Effect.logError(`auth failed: ${error.message}`)),
935
- * Effect.retry({ while: isRetryable }),
936
- * );
937
- * ```
938
- */
939
- const emailChannelCategories = (reason) => {
940
- switch (reason) {
941
- case "auth": return ["auth"];
942
- case "rejected": return ["validation"];
943
- case "rate_limited": return ["throttling", "transient"];
944
- case "transport": return ["transient"];
945
- default: return [];
946
- }
947
- };
948
- const categoriesOf = (error) => {
949
- if (!Predicate$1.isObject(error) || typeof error._tag !== "string") return [];
950
- if (error._tag === "EmailChannelError") return emailChannelCategories(error.reason);
951
- return SamvaErrorMetadata[error._tag]?.categories ?? [];
952
- };
953
- const hasCategory = (error, category) => categoriesOf(error).includes(category);
954
- const isRetryableError = (error) => {
955
- if (!Predicate$1.isObject(error) || typeof error._tag !== "string") return false;
956
- if (error._tag === "EmailChannelError") return categoriesOf(error).includes("transient");
957
- return SamvaErrorMetadata[error._tag]?.retryable ?? false;
958
- };
959
- const categoryGuard = (category) => (error) => hasCategory(error, category);
960
- const isAuthError = categoryGuard("auth");
961
- const isValidationError = categoryGuard("validation");
962
- const isNotFoundError = categoryGuard("notFound");
963
- const isConflictError = categoryGuard("conflict");
964
- const isThrottlingError = categoryGuard("throttling");
965
- const isBillingError = categoryGuard("billing");
966
- /**
967
- * Network-level request failure (no HTTP response). Only `TransportError` is
968
- * transient/retryable: `EncodeError` and `InvalidUrlError` are deterministic
969
- * programmer errors (bad input, bad URL) that would fail identically on every
970
- * attempt — retrying them would loop forever.
971
- */
972
- const isRequestTransportError = (error) => {
973
- if (!Predicate$1.isTagged(error, "HttpClientError")) return false;
974
- const reason = error.reason;
975
- return Predicate$1.isObject(reason) && Predicate$1.isTagged(reason, "TransportError");
976
- };
977
- /** True for transient failures, including raw request-transport errors. */
978
- const isTransient = (error) => hasCategory(error, "transient") || isRequestTransportError(error);
979
- /** True when an error is declared safe to retry (throttling / transient / transport). */
980
- const isRetryable = (error) => isRetryableError(error) || isRequestTransportError(error);
981
- /**
982
- * Catch every error in `category`. The handler receives the category's error
983
- * union — including `EmailChannelError` where its `reason` can place it in the
984
- * category — while only total-membership classes are narrowed out of the error
985
- * channel (`EmailChannelError` stays: instances with other reasons pass through).
986
- */
987
- const catchCategory = (category, handler) => (effect) => {
988
- const inCategory = (error) => hasCategory(error, category);
989
- const outsideCategory = (error) => !hasCategory(error, category);
990
- return Effect.catch(effect, (error) => {
991
- if (inCategory(error)) return handler(error);
992
- if (outsideCategory(error)) return Effect.fail(error);
993
- return Effect.die(error);
994
- });
995
- };
996
- const catchAuthError = (handler) => catchCategory("auth", handler);
997
- const catchValidationError = (handler) => catchCategory("validation", handler);
998
- const catchNotFoundError = (handler) => catchCategory("notFound", handler);
999
- const catchConflictError = (handler) => catchCategory("conflict", handler);
1000
- const catchThrottlingError = (handler) => catchCategory("throttling", handler);
1001
- const catchBillingError = (handler) => catchCategory("billing", handler);
1002
- /**
1003
- * Catch transient failures — including raw request-transport errors — for
1004
- * fallback/degrade paths. The declared error channel is left intact because
1005
- * transient covers untyped transport errors as well.
1006
- */
1007
- const catchTransient = (handler) => (effect) => Effect.catchIf(effect, isTransient, handler);
1008
- //#endregion
1009
- export { isTransient as _, catchNotFoundError as a, catchValidationError as c, isAuthError as d, isBillingError as f, isThrottlingError as g, isRetryable as h, catchConflictError as i, categoriesOf as l, isNotFoundError as m, catchBillingError as n, catchThrottlingError as o, isConflictError as p, catchCategory as r, catchTransient as s, catchAuthError as t, hasCategory as u, isValidationError as v, SamvaOperations as y };
917
+ export { SamvaErrorMetadata, SamvaOperations };
1010
918
 
1011
- //# sourceMappingURL=categories-CA4XIQAb.js.map
919
+ //# sourceMappingURL=generated-metadata.js.map
@@ -45,8 +45,7 @@ export * as Templates from "./templates";
45
45
  export * as UnsubscribeGroups from "./unsubscribe-groups";
46
46
  export * as Webhooks from "./webhooks";
47
47
  export * as Whoami from "./whoami";
48
- export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxChannelUnsupportedError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, UnauthorizedError, ValidationError, DeliveryUnavailableError, } from "./generated/shared";
48
+ export * from "./errors";
49
49
  export { type ErrorCategory, categoriesOf, hasCategory, isAuthError, isValidationError, isNotFoundError, isConflictError, isThrottlingError, isBillingError, isTransient, isRetryable, catchCategory, catchAuthError, catchValidationError, catchNotFoundError, catchConflictError, catchThrottlingError, catchBillingError, catchTransient, } from "./categories";
50
- export { MediaUploadError } from "../inline-attachments";
51
50
  export type { CursorPageEnvelope } from "./pagination";
52
51
  export type { Json as JsonValue } from "effect/Schema";
@@ -1,33 +1,33 @@
1
- import { t as MediaUploadError } from "../inline-attachments-Bi1hDltp.js";
2
- import { G as FlagDisabledError, Jt as UnauthorizedError, K as ForbiddenError, Lt as ResourceNotFoundError, M as EmailChannelError, Nt as PaymentRequiredError, O as DeliveryUnavailableError, Ot as OnboardingReviewRequiredError, Pt as RateLimitedError, U as ExternalServiceError, Y as InternalError, en as ValidationError, i as AnalyticsQueryError, it as MailboxChannelUnsupportedError, l as BillingProviderError, m as ConflictError, mt as MailboxSendConflictError, p as CampaignFooterRequiredError, q as GatewayTimeoutError, u as BrandAddressRequiredError, vt as MailboxSendRefusedError, zt as SenderNotReadyError } from "../client-DOzUrdTE.js";
3
- import { t as analytics_exports } from "../analytics-CaqPRsry.js";
4
- import { _ as isTransient, a as catchNotFoundError, c as catchValidationError, d as isAuthError, f as isBillingError, g as isThrottlingError, h as isRetryable, i as catchConflictError, l as categoriesOf, m as isNotFoundError, n as catchBillingError, o as catchThrottlingError, p as isConflictError, r as catchCategory, s as catchTransient, t as catchAuthError, u as hasCategory, v as isValidationError } from "../categories-CA4XIQAb.js";
5
- import { t as retry_exports } from "./retry.js";
6
- import { t as api_keys_exports } from "../api-keys-Ce1Y4_Ip.js";
7
- import { t as attachments_exports } from "../attachments-DYqVIraC.js";
8
- import { t as brands_exports } from "../brands-ZwuOGIWO.js";
9
- import { n as campaigns_exports } from "../campaigns-DZlz1E9E.js";
10
- import { t as client_exports } from "./client.js";
11
- import { n as contact_groups_exports } from "../contact-groups-BLbFXnjq.js";
12
- import { s as contacts_exports } from "../contacts-BbsoXXB4.js";
13
- import { a as conversations_exports } from "../conversations-_sRHueML.js";
14
- import { n as custom_fields_exports } from "../custom-fields-BHWbwlKn.js";
15
- import { b as email_exports } from "../email-R0NAA9PW.js";
16
- import { r as extension_installations_exports } from "../extension-installations-CD94LPmk.js";
17
- import { t as extensions_exports } from "../extensions-BKyNQLvu.js";
18
- import { r as events_exports } from "../events-CxbTUHYT.js";
19
- import { t as feedback_exports } from "../feedback-Bpa09JOS.js";
20
- import { o as journeys_exports } from "../journeys-CARo_BJT.js";
21
- import { V as mailboxes_exports } from "../mailboxes-BRDn7BIK.js";
22
- import { t as media_exports } from "./media.js";
23
- import { t as messages_exports } from "./messages.js";
24
- import { i as namespaces_exports } from "../namespaces-CcvEbG-y.js";
25
- import { r as operations_exports } from "../operations-CmB3FHwf.js";
26
- import { s as organizations_exports } from "../organizations-A-plufWc.js";
27
- import { o as scheduled_messages_exports } from "../scheduled-messages-DkKZRRaN.js";
28
- import { n as subscriptions_exports } from "../subscriptions-DEXYtMXg.js";
29
- import { M as templates_exports } from "../templates-DZomxsG7.js";
30
- import { l as unsubscribe_groups_exports } from "../unsubscribe-groups-Iqk4Isf9.js";
31
- import { d as webhooks_exports } from "../webhooks-CPXuu8Xf.js";
32
- import { n as whoami_exports } from "../whoami-Ccz0jwlt.js";
1
+ import { MediaUploadError } from "../inline-attachments.js";
2
+ import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxChannelUnsupportedError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, UnauthorizedError, ValidationError } from "./generated/shared.js";
3
+ import { catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError } from "./categories.js";
4
+ import { retry_exports } from "./retry.js";
5
+ import { analytics_exports } from "./analytics.js";
6
+ import { api_keys_exports } from "./api-keys.js";
7
+ import { attachments_exports } from "./attachments.js";
8
+ import { brands_exports } from "./brands.js";
9
+ import { campaigns_exports } from "./campaigns.js";
10
+ import { client_exports } from "./client.js";
11
+ import { contact_groups_exports } from "./contact-groups.js";
12
+ import { contacts_exports } from "./contacts.js";
13
+ import { conversations_exports } from "./conversations.js";
14
+ import { custom_fields_exports } from "./custom-fields.js";
15
+ import { email_exports } from "./email.js";
16
+ import { extension_installations_exports } from "./extension-installations.js";
17
+ import { extensions_exports } from "./extensions.js";
18
+ import { events_exports } from "./events.js";
19
+ import { feedback_exports } from "./feedback.js";
20
+ import { journeys_exports } from "./journeys.js";
21
+ import { mailboxes_exports } from "./mailboxes.js";
22
+ import { media_exports } from "./media.js";
23
+ import { messages_exports } from "./messages.js";
24
+ import { namespaces_exports } from "./namespaces.js";
25
+ import { operations_exports } from "./operations.js";
26
+ import { organizations_exports } from "./organizations.js";
27
+ import { scheduled_messages_exports } from "./scheduled-messages.js";
28
+ import { subscriptions_exports } from "./subscriptions.js";
29
+ import { templates_exports } from "./templates.js";
30
+ import { unsubscribe_groups_exports } from "./unsubscribe-groups.js";
31
+ import { webhooks_exports } from "./webhooks.js";
32
+ import { whoami_exports } from "./whoami.js";
33
33
  export { analytics_exports as Analytics, AnalyticsQueryError, api_keys_exports as ApiKeys, attachments_exports as Attachments, BillingProviderError, BrandAddressRequiredError, brands_exports as Brands, CampaignFooterRequiredError, campaigns_exports as Campaigns, client_exports as Client, ConflictError, contact_groups_exports as ContactGroups, contacts_exports as Contacts, conversations_exports as Conversations, custom_fields_exports as CustomFields, DeliveryUnavailableError, email_exports as Email, EmailChannelError, events_exports as Events, extension_installations_exports as ExtensionInstallations, extensions_exports as Extensions, ExternalServiceError, feedback_exports as Feedback, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, journeys_exports as Journeys, MailboxChannelUnsupportedError, MailboxSendConflictError, MailboxSendRefusedError, mailboxes_exports as Mailboxes, media_exports as Media, MediaUploadError, messages_exports as Messages, namespaces_exports as Namespaces, OnboardingReviewRequiredError, operations_exports as Operations, organizations_exports as Organizations, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, retry_exports as Retry, scheduled_messages_exports as ScheduledMessages, SenderNotReadyError, subscriptions_exports as Subscriptions, templates_exports as Templates, UnauthorizedError, unsubscribe_groups_exports as UnsubscribeGroups, ValidationError, webhooks_exports as Webhooks, whoami_exports as Whoami, catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError };
@@ -0,0 +1,69 @@
1
+ import { CLIENT_ATTRIBUTION_HEADER, clientAttribution } from "../../client-attribution.js";
2
+ import { MediaUploadError, uploadContentType } from "../../inline-attachments.js";
3
+ import { ApiKeySecurityMiddleware } from "../generated/shared.js";
4
+ import { HttpApi, HttpApiClient, HttpApiMiddleware } from "effect/http-api";
5
+ import { Context, Effect, Layer, Redacted } from "effect";
6
+ import * as FetchHttpClient from "effect/http/FetchHttpClient";
7
+ import * as HttpClient from "effect/http/HttpClient";
8
+ import * as HttpClientRequest from "effect/http/HttpClientRequest";
9
+ //#region src/effect/internal/client.ts
10
+ const DEFAULT_BASE_URL = "https://api.samva.dev";
11
+ var Service = class extends Context.Service()("samva/Client") {};
12
+ const authHeaders = (config) => config.authToken !== void 0 ? { Authorization: `Bearer ${config.authToken}` } : { "x-api-key": Redacted.isRedacted(config.apiKey) ? Redacted.value(config.apiKey) : config.apiKey };
13
+ const AuthorizationClient = HttpApiMiddleware.layerClient(ApiKeySecurityMiddleware, ({ next, request }) => next(request));
14
+ const make = (config) => Effect.gen(function* () {
15
+ const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
16
+ const removesAttribution = Object.entries(config.headers ?? {}).some(([name, value]) => name.toLowerCase() === "x-samva-client" && value === void 0);
17
+ const storage = yield* HttpClient.HttpClient;
18
+ const httpClient = storage.pipe(HttpClient.mapRequest((request) => {
19
+ let attributed = HttpClientRequest.setHeader(request, CLIENT_ATTRIBUTION_HEADER, clientAttribution("typescript-effect"));
20
+ if (config.headers !== void 0) attributed = HttpClientRequest.setHeaders(attributed, config.headers);
21
+ if (removesAttribution) attributed = HttpClientRequest.removeHeader(attributed, CLIENT_ATTRIBUTION_HEADER);
22
+ return HttpClientRequest.setHeaders(attributed, authHeaders(config));
23
+ }));
24
+ const groups = /* @__PURE__ */ new Map();
25
+ const groupClient = (group) => {
26
+ const built = groups.get(group.identifier);
27
+ if (built !== void 0) return Effect.succeed(built);
28
+ return HttpApiClient.group(HttpApi.make("SamvaApi").add(group), {
29
+ group: group.identifier,
30
+ httpClient,
31
+ baseUrl
32
+ }).pipe(Effect.provide(AuthorizationClient), Effect.map((client) => {
33
+ const calls = client;
34
+ groups.set(group.identifier, calls);
35
+ return calls;
36
+ }));
37
+ };
38
+ const headers = removesAttribution ? {} : { [CLIENT_ATTRIBUTION_HEADER]: clientAttribution("typescript-effect") };
39
+ for (const [name, value] of Object.entries(config.headers ?? {})) if (value !== void 0) headers[name] = value;
40
+ const putUpload = (input) => storage.execute(HttpClientRequest.make(input.method)(input.url).pipe(HttpClientRequest.bodyUint8Array(input.bytes, uploadContentType(input.headers)), HttpClientRequest.setHeaders(input.headers))).pipe(Effect.mapError((cause) => new MediaUploadError({
41
+ filename: input.filename,
42
+ mediaId: input.mediaId,
43
+ cause
44
+ })), Effect.flatMap((response) => response.status >= 200 && response.status < 300 ? Effect.void : Effect.fail(new MediaUploadError({
45
+ filename: input.filename,
46
+ mediaId: input.mediaId,
47
+ status: response.status
48
+ }))));
49
+ return Service.of({
50
+ putUpload,
51
+ endpoint: (group, name) => Effect.flatMap(groupClient(group), (client) => {
52
+ const call = client[name];
53
+ return call === void 0 ? Effect.die(/* @__PURE__ */ new Error(`${name} is not an endpoint of ${group.identifier}`)) : Effect.succeed(call);
54
+ }),
55
+ connection: {
56
+ baseUrl,
57
+ headers: {
58
+ ...headers,
59
+ ...authHeaders(config)
60
+ }
61
+ }
62
+ });
63
+ });
64
+ const layer = (config) => Layer.effect(Service, make(config));
65
+ const layerFetch = (config) => layer(config).pipe(Layer.provide(FetchHttpClient.layer));
66
+ //#endregion
67
+ export { Service, layer, layerFetch };
68
+
69
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,21 @@
1
+ import { replyToEmailsPayload } from "../../normalize.js";
2
+ import { generateIdempotencyKey, withRetry } from "../retry.js";
3
+ import { callEndpoint, stripUndefined } from "./operation.js";
4
+ import { EmailGroup } from "../generated/email.js";
5
+ import { Effect } from "effect";
6
+ //#region src/effect/internal/email-sender.ts
7
+ const addEmailSender = Effect.fn("Email.addSender")(function* (input, options) {
8
+ const idempotencyKey = options?.idempotencyKey ?? (yield* generateIdempotencyKey);
9
+ const { replyToEmails, ...sender } = input;
10
+ return yield* withRetry(callEndpoint(EmailGroup, "emailAddSender", {
11
+ headers: { "idempotency-key": idempotencyKey },
12
+ payload: stripUndefined({
13
+ ...sender,
14
+ ...replyToEmailsPayload(replyToEmails)
15
+ })
16
+ }));
17
+ });
18
+ //#endregion
19
+ export { addEmailSender };
20
+
21
+ //# sourceMappingURL=email-sender.js.map
@@ -0,0 +1,33 @@
1
+ import { MailboxEventStream, MailboxEventStreamError } from "../../mailbox-events.js";
2
+ import { Service } from "./client.js";
3
+ import { Cause, Effect, Exit, Stream } from "effect";
4
+ //#region src/effect/internal/mailbox-events.ts
5
+ const toStreamError = (cause) => cause instanceof MailboxEventStreamError ? cause : new MailboxEventStreamError({
6
+ _tag: "StreamDisconnectedError",
7
+ message: String(cause)
8
+ });
9
+ /**
10
+ * The organization's mailbox events as a stream, resuming from `cursor`. An event counts as handled
11
+ * once the stream is pulled again, or once it ends successfully after the event (as `Stream.take`
12
+ * does); a failure or interruption leaves the event in hand unacknowledged, so a resume repeats it.
13
+ * The stream fails with a {@link MailboxEventStreamFailure}, which `Effect.catchTag` narrows by the
14
+ * `_tag` of the host's refusal.
15
+ */
16
+ const events = (options = {}) => Stream.scoped(Stream.unwrap(Effect.gen(function* () {
17
+ const client = yield* Service;
18
+ const iterator = (yield* Effect.acquireRelease(Effect.try({
19
+ try: () => new MailboxEventStream(client.connection, options),
20
+ catch: toStreamError
21
+ }), (opened, exit) => Effect.sync(() => {
22
+ if (Exit.isSuccess(exit)) opened.markHandled();
23
+ opened.close();
24
+ })))[Symbol.asyncIterator]();
25
+ return Stream.fromEffectRepeat(Effect.tryPromise({
26
+ try: () => iterator.next(),
27
+ catch: toStreamError
28
+ }).pipe(Effect.flatMap((next) => next.done ? Cause.done() : Effect.succeed(next.value))));
29
+ })));
30
+ //#endregion
31
+ export { events };
32
+
33
+ //# sourceMappingURL=mailbox-events.js.map