samva 0.16.0 → 0.17.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 (127) hide show
  1. package/AGENTS.md +4 -1
  2. package/README.md +44 -1
  3. package/dist/analytics-CaqPRsry.js +207 -0
  4. package/dist/api-keys-Ce1Y4_Ip.js +274 -0
  5. package/dist/attachments-DYqVIraC.js +140 -0
  6. package/dist/brands-ZwuOGIWO.js +175 -0
  7. package/dist/campaigns-DZlz1E9E.js +522 -0
  8. package/dist/categories-CA4XIQAb.js +1011 -0
  9. package/dist/client/sdk.gen.d.ts +174 -3
  10. package/dist/client/types.gen.d.ts +1126 -11
  11. package/dist/client-DOzUrdTE.js +1115 -0
  12. package/dist/contact-groups-BLbFXnjq.js +446 -0
  13. package/dist/contacts-BbsoXXB4.js +787 -0
  14. package/dist/conversations-_sRHueML.js +494 -0
  15. package/dist/custom-fields-BHWbwlKn.js +176 -0
  16. package/dist/effect/analytics.js +2 -21
  17. package/dist/effect/api-keys.d.ts +1 -1
  18. package/dist/effect/api-keys.js +2 -28
  19. package/dist/effect/attachments.js +2 -17
  20. package/dist/effect/brands.d.ts +1 -1
  21. package/dist/effect/brands.js +3 -24
  22. package/dist/effect/campaigns.js +2 -33
  23. package/dist/effect/categories.js +1 -1
  24. package/dist/effect/client.d.ts +1 -1
  25. package/dist/effect/client.js +3 -4
  26. package/dist/effect/contact-groups.js +2 -29
  27. package/dist/effect/contacts.d.ts +52 -0
  28. package/dist/effect/contacts.js +2 -47
  29. package/dist/effect/conversations.js +2 -35
  30. package/dist/effect/custom-fields.js +2 -17
  31. package/dist/effect/email.d.ts +3 -2
  32. package/dist/effect/email.js +2 -137
  33. package/dist/effect/events.d.ts +121 -0
  34. package/dist/effect/events.js +3 -0
  35. package/dist/effect/extension-installations.js +2 -27
  36. package/dist/effect/extensions.js +2 -19
  37. package/dist/effect/feedback.d.ts +1 -1
  38. package/dist/effect/feedback.js +3 -13
  39. package/dist/effect/generated/analytics.d.ts +715 -0
  40. package/dist/effect/generated/api-keys.d.ts +1627 -0
  41. package/dist/effect/generated/attachments.d.ts +554 -0
  42. package/dist/effect/generated/brands.d.ts +1118 -0
  43. package/dist/effect/generated/campaigns.d.ts +3783 -0
  44. package/dist/effect/generated/contact-events.d.ts +158 -0
  45. package/dist/effect/generated/contact-groups.d.ts +1445 -0
  46. package/dist/effect/generated/contacts.d.ts +3789 -0
  47. package/dist/effect/generated/conversations.d.ts +2870 -0
  48. package/dist/effect/generated/custom-fields.d.ts +562 -0
  49. package/dist/effect/generated/email.d.ts +10622 -0
  50. package/dist/effect/generated/events.d.ts +463 -0
  51. package/dist/effect/generated/extension-installations.d.ts +1786 -0
  52. package/dist/effect/generated/extensions.d.ts +927 -0
  53. package/dist/effect/generated/feedback.d.ts +116 -0
  54. package/dist/effect/generated/index.d.ts +61 -0
  55. package/dist/effect/generated/journeys.d.ts +6135 -0
  56. package/dist/effect/generated/mailboxes.d.ts +13641 -0
  57. package/dist/effect/generated/media.d.ts +741 -0
  58. package/dist/effect/generated/messages.d.ts +2355 -0
  59. package/dist/effect/generated/namespaces.d.ts +654 -0
  60. package/dist/effect/generated/operations.d.ts +514 -0
  61. package/dist/effect/generated/organizations.d.ts +1111 -0
  62. package/dist/effect/generated/scheduled-messages.d.ts +1798 -0
  63. package/dist/effect/generated/shared.d.ts +3250 -0
  64. package/dist/effect/generated/subscriptions.d.ts +188 -0
  65. package/dist/effect/generated/templates.d.ts +8177 -0
  66. package/dist/effect/generated/unsubscribe-groups.d.ts +1153 -0
  67. package/dist/effect/generated/webhooks.d.ts +1697 -0
  68. package/dist/effect/generated/whoami.d.ts +291 -0
  69. package/dist/effect/generated-metadata.d.ts +1627 -0
  70. package/dist/effect/index.d.ts +3 -1
  71. package/dist/effect/index.js +29 -27
  72. package/dist/effect/internal/client.d.ts +10 -7
  73. package/dist/effect/internal/email-sender.d.ts +17 -0
  74. package/dist/effect/internal/operation.d.ts +12 -72
  75. package/dist/effect/internal/send.d.ts +60 -0
  76. package/dist/effect/journeys.d.ts +2153 -0
  77. package/dist/effect/journeys.js +2 -0
  78. package/dist/effect/mailboxes.d.ts +112 -112
  79. package/dist/effect/mailboxes.js +1 -1
  80. package/dist/effect/media.js +3 -1
  81. package/dist/effect/messages.d.ts +2 -2
  82. package/dist/effect/messages.js +3 -1
  83. package/dist/effect/namespaces.js +2 -19
  84. package/dist/effect/operations.js +2 -15
  85. package/dist/effect/organizations.js +2 -23
  86. package/dist/effect/retry.js +1 -1
  87. package/dist/effect/scheduled-messages.js +2 -19
  88. package/dist/effect/subscriptions.js +2 -9
  89. package/dist/effect/templates.d.ts +1 -1
  90. package/dist/effect/templates.js +3 -78
  91. package/dist/effect/unsubscribe-groups.js +2 -27
  92. package/dist/effect/webhooks.d.ts +9 -9
  93. package/dist/effect/webhooks.js +3 -33
  94. package/dist/effect/whoami.d.ts +8 -8
  95. package/dist/effect/whoami.js +2 -9
  96. package/dist/email-R0NAA9PW.js +2498 -0
  97. package/dist/events-CxbTUHYT.js +82 -0
  98. package/dist/extension-installations-CD94LPmk.js +407 -0
  99. package/dist/extensions-BKyNQLvu.js +220 -0
  100. package/dist/feedback-Bpa09JOS.js +52 -0
  101. package/dist/index.js +2 -2
  102. package/dist/{inline-attachments-Cegg6tTF.js → inline-attachments-Bi1hDltp.js} +2 -2
  103. package/dist/journeys-CARo_BJT.js +499 -0
  104. package/dist/mailboxes-BRDn7BIK.js +2470 -0
  105. package/dist/media-VrrtNnft.js +181 -0
  106. package/dist/namespaces-CcvEbG-y.js +152 -0
  107. package/dist/{operation-BTXjPrwf.js → operation-n_IYgNVK.js} +75 -90
  108. package/dist/operations-CmB3FHwf.js +93 -0
  109. package/dist/organizations-A-plufWc.js +252 -0
  110. package/dist/promises/index.d.ts +7 -3
  111. package/dist/promises/index.js +2 -2
  112. package/dist/promises/types.gen.d.ts +1 -1
  113. package/dist/{promises-KrA2nSLg.js → promises---Kbh-7z.js} +467 -3
  114. package/dist/runtime-P0l1_2-C.js +25 -0
  115. package/dist/scheduled-messages-DkKZRRaN.js +207 -0
  116. package/dist/send-Bxc0XfGE.js +722 -0
  117. package/dist/service-map.d.ts +85 -0
  118. package/dist/subscriptions-DEXYtMXg.js +67 -0
  119. package/dist/templates-DZomxsG7.js +2289 -0
  120. package/dist/unsubscribe-groups-Iqk4Isf9.js +291 -0
  121. package/dist/webhooks-CPXuu8Xf.js +530 -0
  122. package/dist/whoami-Ccz0jwlt.js +59 -0
  123. package/package.json +13 -3
  124. package/dist/categories-DV51kr2H.js +0 -187
  125. package/dist/client-BMUew5Wp.js +0 -13794
  126. package/dist/effect/generated.d.ts +0 -64004
  127. package/dist/mailboxes-Thp5z0oX.js +0 -161
@@ -0,0 +1,530 @@
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";
5
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
6
+ import * as Schema from "effect/Schema";
7
+ //#region src/effect/generated/webhooks.ts
8
+ const WebhookDeliveryCounts = /* @__PURE__ */ Schema.Struct({
9
+ total: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
10
+ pending: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
11
+ delivered: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
12
+ exhausted: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
13
+ cancelled: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
14
+ }).annotate({ identifier: "WebhookDeliveryCounts" });
15
+ const WebhookDeliveryId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^whdel_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
16
+ expected: "a string matching the RegExp ^whdel_[0-9a-hjkmnp-tv-z]{16,24}$",
17
+ identifier: "WebhookDeliveryId"
18
+ })).pipe(Schema.brand("WebhookDeliveryId"));
19
+ const WebhookAttemptId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^whatt_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
20
+ expected: "a string matching the RegExp ^whatt_[0-9a-hjkmnp-tv-z]{16,24}$",
21
+ identifier: "WebhookAttemptId"
22
+ })).pipe(Schema.brand("WebhookAttemptId"));
23
+ const WebhookEventId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^whevt_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
24
+ expected: "a string matching the RegExp ^whevt_[0-9a-hjkmnp-tv-z]{16,24}$",
25
+ identifier: "WebhookEventId"
26
+ })).pipe(Schema.brand("WebhookEventId"));
27
+ const WebhookDailyDeliveries = /* @__PURE__ */ Schema.Struct({
28
+ date: Schema.String,
29
+ pending: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
30
+ delivered: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
31
+ exhausted: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
32
+ cancelled: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
33
+ }).annotate({ identifier: "WebhookDailyDeliveries" });
34
+ const WebhookEndpoint = /* @__PURE__ */ Schema.Struct({
35
+ id: WebhookEndpointId,
36
+ name: Schema.String,
37
+ url: Schema.String,
38
+ eventTypes: Schema.Array(Schema.Union([
39
+ Schema.Literal("message.sent"),
40
+ Schema.Literal("message.delivered"),
41
+ Schema.Literal("message.read"),
42
+ Schema.Literal("message.failed"),
43
+ Schema.Literal("message.bounced"),
44
+ Schema.Literal("message.complained"),
45
+ Schema.Literal("message.received"),
46
+ Schema.Literal("message.opened"),
47
+ Schema.Literal("message.clicked"),
48
+ Schema.Literal("contact.created"),
49
+ Schema.Literal("contact.updated"),
50
+ Schema.Literal("contact.deleted"),
51
+ Schema.Literal("contact.subscribed"),
52
+ Schema.Literal("contact.unsubscribed"),
53
+ Schema.Literal("contact.resubscribed"),
54
+ Schema.Literal("conversation.created"),
55
+ Schema.Literal("conversation.updated"),
56
+ Schema.Literal("conversation.archived"),
57
+ Schema.Literal("webhook.created"),
58
+ Schema.Literal("webhook.updated"),
59
+ Schema.Literal("webhook.deleted"),
60
+ Schema.Literal("webhook.test"),
61
+ Schema.Literal("domain.updated"),
62
+ Schema.Literal("domain.warming.updated"),
63
+ Schema.Literal("mailbox.message.received"),
64
+ Schema.Literal("mailbox.message.sent"),
65
+ Schema.Literal("mailbox.action.pending_approval"),
66
+ Schema.Literal("mailbox.message.quarantined"),
67
+ Schema.Literal("mailbox.message.released"),
68
+ Schema.Literal("mailbox.message.discarded"),
69
+ Schema.Literal("journey.webhook")
70
+ ])),
71
+ channels: Schema.Union([Schema.Array(Schema.Literal("email")), Schema.Null]),
72
+ mailboxIds: Schema.Union([Schema.Array(MailboxId), Schema.Null]),
73
+ namespaceId: Schema.Union([NamespaceId, Schema.Null]),
74
+ status: Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]),
75
+ hasCustomHeaders: Schema.Boolean,
76
+ failureStartedAt: Schema.Union([Schema.String, Schema.Null]),
77
+ lastSucceededAt: Schema.Union([Schema.String, Schema.Null]),
78
+ createdAt: Schema.String,
79
+ updatedAt: Schema.String
80
+ }).annotate({ identifier: "WebhookEndpoint" });
81
+ const WebhookEndpointListItem = /* @__PURE__ */ Schema.Struct({
82
+ id: WebhookEndpointId,
83
+ name: Schema.String,
84
+ url: Schema.String,
85
+ eventTypes: Schema.Array(Schema.Union([
86
+ Schema.Literal("message.sent"),
87
+ Schema.Literal("message.delivered"),
88
+ Schema.Literal("message.read"),
89
+ Schema.Literal("message.failed"),
90
+ Schema.Literal("message.bounced"),
91
+ Schema.Literal("message.complained"),
92
+ Schema.Literal("message.received"),
93
+ Schema.Literal("message.opened"),
94
+ Schema.Literal("message.clicked"),
95
+ Schema.Literal("contact.created"),
96
+ Schema.Literal("contact.updated"),
97
+ Schema.Literal("contact.deleted"),
98
+ Schema.Literal("contact.subscribed"),
99
+ Schema.Literal("contact.unsubscribed"),
100
+ Schema.Literal("contact.resubscribed"),
101
+ Schema.Literal("conversation.created"),
102
+ Schema.Literal("conversation.updated"),
103
+ Schema.Literal("conversation.archived"),
104
+ Schema.Literal("webhook.created"),
105
+ Schema.Literal("webhook.updated"),
106
+ Schema.Literal("webhook.deleted"),
107
+ Schema.Literal("webhook.test"),
108
+ Schema.Literal("domain.updated"),
109
+ Schema.Literal("domain.warming.updated"),
110
+ Schema.Literal("mailbox.message.received"),
111
+ Schema.Literal("mailbox.message.sent"),
112
+ Schema.Literal("mailbox.action.pending_approval"),
113
+ Schema.Literal("mailbox.message.quarantined"),
114
+ Schema.Literal("mailbox.message.released"),
115
+ Schema.Literal("mailbox.message.discarded"),
116
+ Schema.Literal("journey.webhook")
117
+ ])),
118
+ channels: Schema.Union([Schema.Array(Schema.Literal("email")), Schema.Null]),
119
+ mailboxIds: Schema.Union([Schema.Array(MailboxId), Schema.Null]),
120
+ namespaceId: Schema.Union([NamespaceId, Schema.Null]),
121
+ status: Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]),
122
+ hasCustomHeaders: Schema.Boolean,
123
+ failureStartedAt: Schema.Union([Schema.String, Schema.Null]),
124
+ lastSucceededAt: Schema.Union([Schema.String, Schema.Null]),
125
+ createdAt: Schema.String,
126
+ updatedAt: Schema.String,
127
+ deliveries: WebhookDeliveryCounts
128
+ }).annotate({ identifier: "WebhookEndpointListItem" });
129
+ const WebhookDeliveryPage = /* @__PURE__ */ Schema.Struct({
130
+ items: Schema.Array(Schema.Struct({
131
+ id: WebhookDeliveryId,
132
+ eventId: WebhookEventId,
133
+ eventType: Schema.String,
134
+ occurredAt: Schema.String,
135
+ endpointId: WebhookEndpointId,
136
+ status: Schema.Union([
137
+ Schema.Literal("pending"),
138
+ Schema.Literal("delivered"),
139
+ Schema.Literal("exhausted"),
140
+ Schema.Literal("cancelled")
141
+ ]),
142
+ automaticAttempts: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
143
+ nextAttemptAt: Schema.Union([Schema.String, Schema.Null]),
144
+ completedAt: Schema.Union([Schema.String, Schema.Null]),
145
+ createdAt: Schema.String,
146
+ updatedAt: Schema.String,
147
+ attempts: Schema.Array(Schema.Struct({
148
+ id: WebhookAttemptId,
149
+ deliveryId: WebhookDeliveryId,
150
+ kind: Schema.Union([Schema.Literal("automatic"), Schema.Literal("manual")]),
151
+ attemptNumber: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })),
152
+ classification: Schema.Union([
153
+ Schema.Literal("success"),
154
+ Schema.Literal("http-error"),
155
+ Schema.Literal("network-error"),
156
+ Schema.Literal("timeout"),
157
+ Schema.Literal("cancelled")
158
+ ]),
159
+ attemptedAt: Schema.String,
160
+ responseStatus: Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null]),
161
+ responseHeaders: Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]),
162
+ durationMs: Schema.Union([Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })), Schema.Null]),
163
+ errorCode: Schema.Union([Schema.String, Schema.Null]),
164
+ errorMessage: Schema.Union([Schema.String, Schema.Null]),
165
+ createdAt: Schema.String
166
+ }))
167
+ })),
168
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
169
+ }).annotate({ identifier: "WebhookDeliveryPage" });
170
+ const WebhookStatsResponse = /* @__PURE__ */ Schema.Struct({
171
+ total: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
172
+ pending: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
173
+ delivered: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
174
+ exhausted: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
175
+ cancelled: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
176
+ daily: Schema.Array(WebhookDailyDeliveries)
177
+ }).annotate({ identifier: "WebhookStatsResponse" });
178
+ const WebhookEndpointPage = /* @__PURE__ */ Schema.Struct({
179
+ items: Schema.Array(WebhookEndpointListItem),
180
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
181
+ }).annotate({ identifier: "WebhookEndpointPage" });
182
+ const WebhooksListQuery = /* @__PURE__ */ Schema.Struct({
183
+ limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
184
+ cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null])),
185
+ search: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
186
+ status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]), Schema.Null]))
187
+ });
188
+ const WebhooksList200 = WebhookEndpointPage;
189
+ const WebhooksList401 = UnauthorizedError;
190
+ const WebhooksList403 = ForbiddenError;
191
+ const WebhooksList422 = ValidationError;
192
+ const WebhooksList500 = InternalError;
193
+ const WebhooksList504 = GatewayTimeoutError;
194
+ const WebhooksCreateRequestJson = /* @__PURE__ */ Schema.Struct({
195
+ name: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(100).annotate({ expected: "a string with at most 100 code points" })).check(Schema.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })),
196
+ url: Schema.String,
197
+ eventTypes: Schema.Array(Schema.Union([
198
+ Schema.Literal("message.sent"),
199
+ Schema.Literal("message.delivered"),
200
+ Schema.Literal("message.read"),
201
+ Schema.Literal("message.failed"),
202
+ Schema.Literal("message.bounced"),
203
+ Schema.Literal("message.complained"),
204
+ Schema.Literal("message.received"),
205
+ Schema.Literal("message.opened"),
206
+ Schema.Literal("message.clicked"),
207
+ Schema.Literal("contact.created"),
208
+ Schema.Literal("contact.updated"),
209
+ Schema.Literal("contact.deleted"),
210
+ Schema.Literal("contact.subscribed"),
211
+ Schema.Literal("contact.unsubscribed"),
212
+ Schema.Literal("contact.resubscribed"),
213
+ Schema.Literal("conversation.created"),
214
+ Schema.Literal("conversation.updated"),
215
+ Schema.Literal("conversation.archived"),
216
+ Schema.Literal("webhook.created"),
217
+ Schema.Literal("webhook.updated"),
218
+ Schema.Literal("webhook.deleted"),
219
+ Schema.Literal("webhook.test"),
220
+ Schema.Literal("domain.updated"),
221
+ Schema.Literal("domain.warming.updated"),
222
+ Schema.Literal("mailbox.message.received"),
223
+ Schema.Literal("mailbox.message.sent"),
224
+ Schema.Literal("mailbox.action.pending_approval"),
225
+ Schema.Literal("mailbox.message.quarantined"),
226
+ Schema.Literal("mailbox.message.released"),
227
+ Schema.Literal("mailbox.message.discarded"),
228
+ Schema.Literal("journey.webhook")
229
+ ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
230
+ channels: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Literal("email")).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null])),
231
+ mailboxIds: Schema.optionalKey(Schema.Union([Schema.TupleWithRest(Schema.Tuple([MailboxId]), [MailboxId]), Schema.Null])),
232
+ namespaceId: Schema.optionalKey(Schema.Union([NamespaceId, Schema.Null])),
233
+ headers: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null])),
234
+ status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]), Schema.Null]))
235
+ });
236
+ const WebhooksCreate201 = /* @__PURE__ */ Schema.Struct({
237
+ endpoint: WebhookEndpoint,
238
+ secret: SensitiveString
239
+ });
240
+ const WebhooksCreate401 = UnauthorizedError;
241
+ const WebhooksCreate402 = PaymentRequiredError;
242
+ const WebhooksCreate403 = ForbiddenError;
243
+ const WebhooksCreate404 = ResourceNotFoundError;
244
+ const WebhooksCreate409 = ConflictError;
245
+ const WebhooksCreate422 = ValidationError;
246
+ const WebhooksCreate500 = InternalError;
247
+ const WebhooksCreate502 = BillingProviderError;
248
+ const WebhooksCreate504 = GatewayTimeoutError;
249
+ const WebhooksGetPathParams = /* @__PURE__ */ Schema.Struct({ id: WebhookEndpointId });
250
+ const WebhooksGet200 = WebhookEndpoint;
251
+ const WebhooksGet401 = UnauthorizedError;
252
+ const WebhooksGet403 = ForbiddenError;
253
+ const WebhooksGet404 = ResourceNotFoundError;
254
+ const WebhooksGet422 = ValidationError;
255
+ const WebhooksGet500 = InternalError;
256
+ const WebhooksGet504 = GatewayTimeoutError;
257
+ const WebhooksRemovePathParams = /* @__PURE__ */ Schema.Struct({ id: WebhookEndpointId });
258
+ const WebhooksRemove200 = SuccessResponse;
259
+ const WebhooksRemove401 = UnauthorizedError;
260
+ const WebhooksRemove403 = ForbiddenError;
261
+ const WebhooksRemove404 = ResourceNotFoundError;
262
+ const WebhooksRemove422 = ValidationError;
263
+ const WebhooksRemove500 = InternalError;
264
+ const WebhooksRemove502 = BillingProviderError;
265
+ const WebhooksRemove504 = GatewayTimeoutError;
266
+ const WebhooksUpdatePathParams = /* @__PURE__ */ Schema.Struct({ id: WebhookEndpointId });
267
+ const WebhooksUpdateRequestJson = /* @__PURE__ */ Schema.Struct({
268
+ name: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(100).annotate({ expected: "a string with at most 100 code points" })).check(Schema.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), Schema.Null])),
269
+ url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
270
+ eventTypes: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([
271
+ Schema.Literal("message.sent"),
272
+ Schema.Literal("message.delivered"),
273
+ Schema.Literal("message.read"),
274
+ Schema.Literal("message.failed"),
275
+ Schema.Literal("message.bounced"),
276
+ Schema.Literal("message.complained"),
277
+ Schema.Literal("message.received"),
278
+ Schema.Literal("message.opened"),
279
+ Schema.Literal("message.clicked"),
280
+ Schema.Literal("contact.created"),
281
+ Schema.Literal("contact.updated"),
282
+ Schema.Literal("contact.deleted"),
283
+ Schema.Literal("contact.subscribed"),
284
+ Schema.Literal("contact.unsubscribed"),
285
+ Schema.Literal("contact.resubscribed"),
286
+ Schema.Literal("conversation.created"),
287
+ Schema.Literal("conversation.updated"),
288
+ Schema.Literal("conversation.archived"),
289
+ Schema.Literal("webhook.created"),
290
+ Schema.Literal("webhook.updated"),
291
+ Schema.Literal("webhook.deleted"),
292
+ Schema.Literal("webhook.test"),
293
+ Schema.Literal("domain.updated"),
294
+ Schema.Literal("domain.warming.updated"),
295
+ Schema.Literal("mailbox.message.received"),
296
+ Schema.Literal("mailbox.message.sent"),
297
+ Schema.Literal("mailbox.action.pending_approval"),
298
+ Schema.Literal("mailbox.message.quarantined"),
299
+ Schema.Literal("mailbox.message.released"),
300
+ Schema.Literal("mailbox.message.discarded"),
301
+ Schema.Literal("journey.webhook")
302
+ ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null])),
303
+ channels: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Array(Schema.Literal("email")).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null]), Schema.Null])),
304
+ mailboxIds: Schema.optionalKey(Schema.Union([Schema.Union([Schema.TupleWithRest(Schema.Tuple([MailboxId]), [MailboxId]), Schema.Null]), Schema.Null])),
305
+ namespaceId: Schema.optionalKey(Schema.Union([Schema.Union([NamespaceId, Schema.Null]), Schema.Null])),
306
+ headers: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null])),
307
+ status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]), Schema.Null]))
308
+ });
309
+ const WebhooksUpdate200 = WebhookEndpoint;
310
+ const WebhooksUpdate401 = UnauthorizedError;
311
+ const WebhooksUpdate403 = ForbiddenError;
312
+ const WebhooksUpdate404 = ResourceNotFoundError;
313
+ const WebhooksUpdate409 = ConflictError;
314
+ const WebhooksUpdate422 = ValidationError;
315
+ const WebhooksUpdate500 = InternalError;
316
+ const WebhooksUpdate504 = GatewayTimeoutError;
317
+ const WebhooksRetryDeliveryPathParams = /* @__PURE__ */ Schema.Struct({
318
+ id: WebhookEndpointId,
319
+ deliveryId: WebhookDeliveryId
320
+ });
321
+ const WebhooksRetryDelivery200 = /* @__PURE__ */ Schema.Struct({
322
+ accepted: Schema.Literal(true),
323
+ deliveryId: WebhookDeliveryId,
324
+ attemptId: WebhookAttemptId,
325
+ outcome: Schema.Union([Schema.Literal("succeeded"), Schema.Literal("failed")])
326
+ });
327
+ const WebhooksRetryDelivery401 = UnauthorizedError;
328
+ const WebhooksRetryDelivery403 = ForbiddenError;
329
+ const WebhooksRetryDelivery404 = ResourceNotFoundError;
330
+ const WebhooksRetryDelivery422 = ValidationError;
331
+ const WebhooksRetryDelivery429 = RateLimitedError;
332
+ const WebhooksRetryDelivery500 = InternalError;
333
+ const WebhooksRetryDelivery504 = GatewayTimeoutError;
334
+ const WebhooksGetLogsPathParams = /* @__PURE__ */ Schema.Struct({ id: WebhookEndpointId });
335
+ const WebhooksGetLogsQuery = /* @__PURE__ */ Schema.Struct({
336
+ limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
337
+ cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
338
+ });
339
+ const WebhooksGetLogs200 = WebhookDeliveryPage;
340
+ const WebhooksGetLogs401 = UnauthorizedError;
341
+ const WebhooksGetLogs403 = ForbiddenError;
342
+ const WebhooksGetLogs404 = ResourceNotFoundError;
343
+ const WebhooksGetLogs422 = ValidationError;
344
+ const WebhooksGetLogs500 = InternalError;
345
+ const WebhooksGetLogs504 = GatewayTimeoutError;
346
+ const WebhooksRegenerateSecretPathParams = /* @__PURE__ */ Schema.Struct({ id: WebhookEndpointId });
347
+ const WebhooksRegenerateSecret200 = /* @__PURE__ */ Schema.Struct({ secret: SensitiveString });
348
+ const WebhooksRegenerateSecret401 = UnauthorizedError;
349
+ const WebhooksRegenerateSecret403 = ForbiddenError;
350
+ const WebhooksRegenerateSecret404 = ResourceNotFoundError;
351
+ const WebhooksRegenerateSecret422 = ValidationError;
352
+ const WebhooksRegenerateSecret500 = InternalError;
353
+ const WebhooksRegenerateSecret504 = GatewayTimeoutError;
354
+ const WebhooksGetStatsPathParams = /* @__PURE__ */ Schema.Struct({ id: WebhookEndpointId });
355
+ const WebhooksGetStatsQuery = /* @__PURE__ */ Schema.Struct({
356
+ after: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
357
+ before: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
358
+ });
359
+ const WebhooksGetStats200 = WebhookStatsResponse;
360
+ const WebhooksGetStats401 = UnauthorizedError;
361
+ const WebhooksGetStats403 = ForbiddenError;
362
+ const WebhooksGetStats404 = ResourceNotFoundError;
363
+ const WebhooksGetStats422 = ValidationError;
364
+ const WebhooksGetStats500 = InternalError;
365
+ const WebhooksGetStats504 = GatewayTimeoutError;
366
+ const WebhooksTestPathParams = /* @__PURE__ */ Schema.Struct({ id: WebhookEndpointId });
367
+ const WebhooksTestRequestJson = /* @__PURE__ */ Schema.Struct({ data: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null])) });
368
+ const WebhooksTest202 = /* @__PURE__ */ Schema.Struct({
369
+ accepted: Schema.Literal(true),
370
+ eventId: WebhookEventId,
371
+ deliveryId: WebhookDeliveryId
372
+ });
373
+ const WebhooksTest401 = UnauthorizedError;
374
+ const WebhooksTest403 = ForbiddenError;
375
+ const WebhooksTest404 = ResourceNotFoundError;
376
+ const WebhooksTest422 = ValidationError;
377
+ const WebhooksTest500 = InternalError;
378
+ const WebhooksTest504 = GatewayTimeoutError;
379
+ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpoint.get("webhooksList", "/v1/webhooks", {
380
+ query: WebhooksListQuery,
381
+ success: WebhooksList200,
382
+ error: [
383
+ WebhooksList401.pipe(HttpApiSchema.status(401)),
384
+ WebhooksList403.pipe(HttpApiSchema.status(403)),
385
+ WebhooksList422.pipe(HttpApiSchema.status(422)),
386
+ WebhooksList500,
387
+ WebhooksList504.pipe(HttpApiSchema.status(504))
388
+ ]
389
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.list").annotate(OpenApi.Summary, "List webhooks").annotate(OpenApi.Description, "Returns the organization's webhook endpoints, oldest first, with each endpoint's delivery counts, optionally filtered by a search term matched against name and URL, and by status. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("webhooksCreate", "/v1/webhooks", {
390
+ payload: WebhooksCreateRequestJson,
391
+ success: WebhooksCreate201.pipe(HttpApiSchema.status(201)),
392
+ error: [
393
+ WebhooksCreate401.pipe(HttpApiSchema.status(401)),
394
+ WebhooksCreate402.pipe(HttpApiSchema.status(402)),
395
+ WebhooksCreate403.pipe(HttpApiSchema.status(403)),
396
+ WebhooksCreate404.pipe(HttpApiSchema.status(404)),
397
+ WebhooksCreate409.pipe(HttpApiSchema.status(409)),
398
+ WebhooksCreate422.pipe(HttpApiSchema.status(422)),
399
+ WebhooksCreate500,
400
+ WebhooksCreate502.pipe(HttpApiSchema.status(502)),
401
+ WebhooksCreate504.pipe(HttpApiSchema.status(504))
402
+ ]
403
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.create").annotate(OpenApi.Summary, "Create a webhook").annotate(OpenApi.Description, "Creates a signed webhook endpoint for Samva delivery and inbound events, stores subscriptions, and returns the endpoint and signing secret with a 201 response. `mailboxIds` and `namespaceId` confine mailbox events; when both are set, every mailbox must belong to the namespace."), HttpApiEndpoint.get("webhooksGet", "/v1/webhooks/:id", {
404
+ params: WebhooksGetPathParams,
405
+ success: WebhooksGet200,
406
+ error: [
407
+ WebhooksGet401.pipe(HttpApiSchema.status(401)),
408
+ WebhooksGet403.pipe(HttpApiSchema.status(403)),
409
+ WebhooksGet404.pipe(HttpApiSchema.status(404)),
410
+ WebhooksGet422.pipe(HttpApiSchema.status(422)),
411
+ WebhooksGet500,
412
+ WebhooksGet504.pipe(HttpApiSchema.status(504))
413
+ ]
414
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.get").annotate(OpenApi.Summary, "Get a webhook").annotate(OpenApi.Description, "Returns the configuration of the webhook endpoint with the given ID."), HttpApiEndpoint.delete("webhooksRemove", "/v1/webhooks/:id", {
415
+ params: WebhooksRemovePathParams,
416
+ success: WebhooksRemove200,
417
+ error: [
418
+ WebhooksRemove401.pipe(HttpApiSchema.status(401)),
419
+ WebhooksRemove403.pipe(HttpApiSchema.status(403)),
420
+ WebhooksRemove404.pipe(HttpApiSchema.status(404)),
421
+ WebhooksRemove422.pipe(HttpApiSchema.status(422)),
422
+ WebhooksRemove500,
423
+ WebhooksRemove502.pipe(HttpApiSchema.status(502)),
424
+ WebhooksRemove504.pipe(HttpApiSchema.status(504))
425
+ ]
426
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.remove").annotate(OpenApi.Summary, "Delete a webhook").annotate(OpenApi.Description, "Deletes a webhook endpoint so it no longer receives event deliveries."), HttpApiEndpoint.patch("webhooksUpdate", "/v1/webhooks/:id", {
427
+ params: WebhooksUpdatePathParams,
428
+ payload: WebhooksUpdateRequestJson,
429
+ success: WebhooksUpdate200,
430
+ error: [
431
+ WebhooksUpdate401.pipe(HttpApiSchema.status(401)),
432
+ WebhooksUpdate403.pipe(HttpApiSchema.status(403)),
433
+ WebhooksUpdate404.pipe(HttpApiSchema.status(404)),
434
+ WebhooksUpdate409.pipe(HttpApiSchema.status(409)),
435
+ WebhooksUpdate422.pipe(HttpApiSchema.status(422)),
436
+ WebhooksUpdate500,
437
+ WebhooksUpdate504.pipe(HttpApiSchema.status(504))
438
+ ]
439
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.update").annotate(OpenApi.Summary, "Update a webhook").annotate(OpenApi.Description, "Updates a webhook's name, URL, subscribed events, channels, custom headers, mailbox scope, or status and returns the updated endpoint. A change to `mailboxIds` or `namespaceId` is checked as the endpoint will stand afterward: every mailbox must belong to the namespace when both are set."), HttpApiEndpoint.post("webhooksRetryDelivery", "/v1/webhooks/:id/deliveries/:deliveryId/redeliver", {
440
+ params: WebhooksRetryDeliveryPathParams,
441
+ success: WebhooksRetryDelivery200,
442
+ error: [
443
+ WebhooksRetryDelivery401.pipe(HttpApiSchema.status(401)),
444
+ WebhooksRetryDelivery403.pipe(HttpApiSchema.status(403)),
445
+ WebhooksRetryDelivery404.pipe(HttpApiSchema.status(404)),
446
+ WebhooksRetryDelivery422.pipe(HttpApiSchema.status(422)),
447
+ WebhooksRetryDelivery429.pipe(HttpApiSchema.status(429)),
448
+ WebhooksRetryDelivery500,
449
+ WebhooksRetryDelivery504.pipe(HttpApiSchema.status(504))
450
+ ]
451
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.retryDelivery").annotate(OpenApi.Summary, "Retry a webhook delivery").annotate(OpenApi.Description, "Performs one immediate manual redelivery attempt and returns that attempt's identity and outcome without changing the automatic retry lifecycle."), HttpApiEndpoint.get("webhooksGetLogs", "/v1/webhooks/:id/logs", {
452
+ params: WebhooksGetLogsPathParams,
453
+ query: WebhooksGetLogsQuery,
454
+ success: WebhooksGetLogs200,
455
+ error: [
456
+ WebhooksGetLogs401.pipe(HttpApiSchema.status(401)),
457
+ WebhooksGetLogs403.pipe(HttpApiSchema.status(403)),
458
+ WebhooksGetLogs404.pipe(HttpApiSchema.status(404)),
459
+ WebhooksGetLogs422.pipe(HttpApiSchema.status(422)),
460
+ WebhooksGetLogs500,
461
+ WebhooksGetLogs504.pipe(HttpApiSchema.status(504))
462
+ ]
463
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.getLogs").annotate(OpenApi.Summary, "List webhook delivery logs").annotate(OpenApi.Description, "Returns a webhook endpoint's deliveries, newest first, each naming the event type and time it was made for, with its nested attempt diagnostics. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("webhooksRegenerateSecret", "/v1/webhooks/:id/rotate-secret", {
464
+ params: WebhooksRegenerateSecretPathParams,
465
+ success: WebhooksRegenerateSecret200,
466
+ error: [
467
+ WebhooksRegenerateSecret401.pipe(HttpApiSchema.status(401)),
468
+ WebhooksRegenerateSecret403.pipe(HttpApiSchema.status(403)),
469
+ WebhooksRegenerateSecret404.pipe(HttpApiSchema.status(404)),
470
+ WebhooksRegenerateSecret422.pipe(HttpApiSchema.status(422)),
471
+ WebhooksRegenerateSecret500,
472
+ WebhooksRegenerateSecret504.pipe(HttpApiSchema.status(504))
473
+ ]
474
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.regenerateSecret").annotate(OpenApi.Summary, "Rotate a webhook signing secret").annotate(OpenApi.Description, "Generates and returns a new signing secret. The previous secret remains valid for a 24-hour rotation overlap."), HttpApiEndpoint.get("webhooksGetStats", "/v1/webhooks/:id/stats", {
475
+ params: WebhooksGetStatsPathParams,
476
+ query: WebhooksGetStatsQuery,
477
+ success: WebhooksGetStats200,
478
+ error: [
479
+ WebhooksGetStats401.pipe(HttpApiSchema.status(401)),
480
+ WebhooksGetStats403.pipe(HttpApiSchema.status(403)),
481
+ WebhooksGetStats404.pipe(HttpApiSchema.status(404)),
482
+ WebhooksGetStats422.pipe(HttpApiSchema.status(422)),
483
+ WebhooksGetStats500,
484
+ WebhooksGetStats504.pipe(HttpApiSchema.status(504))
485
+ ]
486
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "webhooks.getStats").annotate(OpenApi.Summary, "Get webhook delivery statistics").annotate(OpenApi.Description, "Returns aggregate pending, delivered, exhausted, and cancelled delivery counts for a webhook endpoint over its whole retained history, plus the same counts per organization-local calendar day between `after` and `before`, a window of at most 90 days that defaults to the last 30 days. Deliveries are retained for 90 days, so the longest window is the whole history."), HttpApiEndpoint.post("webhooksTest", "/v1/webhooks/:id/test", {
487
+ params: WebhooksTestPathParams,
488
+ payload: WebhooksTestRequestJson,
489
+ success: WebhooksTest202.pipe(HttpApiSchema.status(202)),
490
+ error: [
491
+ WebhooksTest401.pipe(HttpApiSchema.status(401)),
492
+ WebhooksTest403.pipe(HttpApiSchema.status(403)),
493
+ WebhooksTest404.pipe(HttpApiSchema.status(404)),
494
+ WebhooksTest422.pipe(HttpApiSchema.status(422)),
495
+ WebhooksTest500,
496
+ WebhooksTest504.pipe(HttpApiSchema.status(504))
497
+ ]
498
+ }).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
+ //#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 };
529
+
530
+ //# sourceMappingURL=webhooks-CPXuu8Xf.js.map
@@ -0,0 +1,59 @@
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";
4
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
5
+ import * as Schema from "effect/Schema";
6
+ //#region src/effect/generated/whoami.ts
7
+ const WhoamiUser = /* @__PURE__ */ Schema.Struct({
8
+ id: Schema.String,
9
+ name: Schema.String,
10
+ email: Schema.String
11
+ }).annotate({ identifier: "WhoamiUser" });
12
+ const WhoamiOrganization = /* @__PURE__ */ Schema.Struct({
13
+ id: OrganizationId,
14
+ slug: Schema.String,
15
+ name: Schema.String
16
+ }).annotate({ identifier: "WhoamiOrganization" });
17
+ const WhoamiUserCredential = /* @__PURE__ */ Schema.Struct({
18
+ type: Schema.Literal("user"),
19
+ user: WhoamiUser,
20
+ role: Schema.Union([
21
+ Schema.Literal("member"),
22
+ Schema.Literal("admin"),
23
+ Schema.Literal("owner")
24
+ ])
25
+ }).annotate({ identifier: "WhoamiUserCredential" });
26
+ const WhoamiApiKeyCredential = /* @__PURE__ */ Schema.Struct({
27
+ type: Schema.Literal("apiKey"),
28
+ id: Schema.String,
29
+ name: Schema.String,
30
+ start: Schema.Union([Schema.String, Schema.Null]),
31
+ access: ApiKeyAccess
32
+ }).annotate({ identifier: "WhoamiApiKeyCredential" });
33
+ const WhoamiGet200 = /* @__PURE__ */ Schema.Struct({
34
+ organization: WhoamiOrganization,
35
+ credential: Schema.Union([WhoamiApiKeyCredential, WhoamiUserCredential])
36
+ }).annotate({ identifier: "Whoami" });
37
+ const WhoamiGet401 = UnauthorizedError;
38
+ const WhoamiGet403 = ForbiddenError;
39
+ const WhoamiGet422 = ValidationError;
40
+ const WhoamiGet500 = InternalError;
41
+ const WhoamiGet504 = GatewayTimeoutError;
42
+ var WhoamiGroup = class extends HttpApiGroup.make("Whoami").add(HttpApiEndpoint.get("whoamiGet", "/v1/whoami", {
43
+ success: WhoamiGet200,
44
+ error: [
45
+ WhoamiGet401.pipe(HttpApiSchema.status(401)),
46
+ WhoamiGet403.pipe(HttpApiSchema.status(403)),
47
+ WhoamiGet422.pipe(HttpApiSchema.status(422)),
48
+ WhoamiGet500,
49
+ WhoamiGet504.pipe(HttpApiSchema.status(504))
50
+ ]
51
+ }).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
+ //#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 };
58
+
59
+ //# sourceMappingURL=whoami-Ccz0jwlt.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "samva",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "TypeScript SDK for the Samva email API",
5
5
  "keywords": [
6
6
  "api-client",
@@ -33,6 +33,7 @@
33
33
  "LICENSE"
34
34
  ],
35
35
  "type": "module",
36
+ "sideEffects": false,
36
37
  "exports": {
37
38
  ".": {
38
39
  "types": "./dist/index.d.ts",
@@ -106,10 +107,18 @@
106
107
  "types": "./dist/effect/extensions.d.ts",
107
108
  "import": "./dist/effect/extensions.js"
108
109
  },
110
+ "./effect/events": {
111
+ "types": "./dist/effect/events.d.ts",
112
+ "import": "./dist/effect/events.js"
113
+ },
109
114
  "./effect/feedback": {
110
115
  "types": "./dist/effect/feedback.d.ts",
111
116
  "import": "./dist/effect/feedback.js"
112
117
  },
118
+ "./effect/journeys": {
119
+ "types": "./dist/effect/journeys.d.ts",
120
+ "import": "./dist/effect/journeys.js"
121
+ },
113
122
  "./effect/mailboxes": {
114
123
  "types": "./dist/effect/mailboxes.d.ts",
115
124
  "import": "./dist/effect/mailboxes.js"
@@ -175,18 +184,19 @@
175
184
  "prepack": "bun run build",
176
185
  "generate:openapi": "bun run scripts/openapi.ts",
177
186
  "generate:promises": "bun run codegen/generate-promises.ts && bun run scripts/generate-promise-errors.ts && oxfmt --config=../../oxfmt.config.ts src/client src/promises/errors.gen.ts src/promises/types.gen.ts",
178
- "generate:effect": "bun run codegen/generate-effect.ts && oxfmt --config=../../oxfmt.config.ts src/effect/generated.ts src/effect/generated-metadata.ts && bun run codegen/normalize-effect.ts",
187
+ "generate:effect": "bun run codegen/generate-effect.ts && oxfmt --config=../../oxfmt.config.ts src/effect/generated src/effect/generated-metadata.ts && bun run codegen/normalize-effect.ts",
179
188
  "generate": "bun generate:openapi && bun generate:promises && bun generate:effect",
180
189
  "test": "vitest run --root ../.. --project packages",
181
190
  "test:generation": "bun scripts/check-generation.ts",
182
191
  "test:packed": "bun run build && bun scripts/test-packed-consumers.ts",
183
192
  "test:tarball": "bun run build && bun scripts/check-tarball.ts",
193
+ "test:startup": "bun run build && bun scripts/check-startup.ts",
184
194
  "test:tree-shaking": "bun run build && bun scripts/check-tree-shaking.ts",
185
195
  "test:types": "tsc --noEmit --project tests/parity/tsconfig.json",
186
196
  "typecheck": "tsc --noEmit && tsc --noEmit -p codegen/tsconfig.json && tsc --noEmit -p tests/tsconfig.json"
187
197
  },
188
198
  "dependencies": {
189
- "@samva/webhooks": "0.16.0"
199
+ "@samva/webhooks": "0.17.0"
190
200
  },
191
201
  "devDependencies": {
192
202
  "@effect/openapi-generator": "4.0.0",