samva 0.34.0 → 0.36.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 (129) hide show
  1. package/AGENTS.md +17 -0
  2. package/README.md +2 -1
  3. package/dist/client/sdk.gen.d.ts +325 -331
  4. package/dist/client/sdk.gen.js +406 -454
  5. package/dist/client/types.gen.d.ts +3465 -750
  6. package/dist/effect/agents.d.ts +222 -17
  7. package/dist/effect/agents.js +7 -1
  8. package/dist/effect/analytics.d.ts +21 -15
  9. package/dist/effect/api-keys.d.ts +30 -24
  10. package/dist/effect/campaigns.d.ts +695 -39
  11. package/dist/effect/categories.d.ts +3 -3
  12. package/dist/effect/contact-groups.d.ts +15 -15
  13. package/dist/effect/contacts.d.ts +56 -52
  14. package/dist/effect/conversations.d.ts +51 -45
  15. package/dist/effect/email.d.ts +82 -82
  16. package/dist/effect/errors.d.ts +1 -1
  17. package/dist/effect/errors.js +2 -2
  18. package/dist/effect/extension-installations.d.ts +64 -12
  19. package/dist/effect/extensions.d.ts +16 -16
  20. package/dist/effect/generated/agents.d.ts +2902 -150
  21. package/dist/effect/generated/agents.js +219 -31
  22. package/dist/effect/generated/analytics.d.ts +127 -136
  23. package/dist/effect/generated/analytics.js +72 -37
  24. package/dist/effect/generated/api-keys.d.ts +243 -47
  25. package/dist/effect/generated/api-keys.js +27 -12
  26. package/dist/effect/generated/attachments.d.ts +89 -1
  27. package/dist/effect/generated/attachments.js +10 -2
  28. package/dist/effect/generated/brands.d.ts +133 -1
  29. package/dist/effect/generated/brands.js +22 -10
  30. package/dist/effect/generated/campaigns.d.ts +1467 -143
  31. package/dist/effect/generated/campaigns.js +84 -20
  32. package/dist/effect/generated/contact-events.d.ts +26 -4
  33. package/dist/effect/generated/contact-events.js +5 -3
  34. package/dist/effect/generated/contact-groups.d.ts +233 -13
  35. package/dist/effect/generated/contact-groups.js +33 -17
  36. package/dist/effect/generated/contacts.d.ts +634 -96
  37. package/dist/effect/generated/contacts.js +82 -20
  38. package/dist/effect/generated/conversations.d.ts +501 -108
  39. package/dist/effect/generated/conversations.js +106 -22
  40. package/dist/effect/generated/custom-fields.d.ts +89 -1
  41. package/dist/effect/generated/custom-fields.js +11 -3
  42. package/dist/effect/generated/email.d.ts +1447 -83
  43. package/dist/effect/generated/email.js +167 -43
  44. package/dist/effect/generated/events.d.ts +51 -7
  45. package/dist/effect/generated/events.js +9 -5
  46. package/dist/effect/generated/extension-installations.d.ts +1052 -77
  47. package/dist/effect/generated/extension-installations.js +45 -31
  48. package/dist/effect/generated/extensions.d.ts +123 -13
  49. package/dist/effect/generated/extensions.js +20 -10
  50. package/dist/effect/generated/feedback.d.ts +23 -1
  51. package/dist/effect/generated/feedback.js +6 -4
  52. package/dist/effect/generated/index.d.ts +3 -1
  53. package/dist/effect/generated/journeys.d.ts +684 -16
  54. package/dist/effect/generated/journeys.js +37 -9
  55. package/dist/effect/generated/mailboxes.d.ts +6169 -1734
  56. package/dist/effect/generated/mailboxes.js +549 -344
  57. package/dist/effect/generated/media.d.ts +125 -15
  58. package/dist/effect/generated/media.js +15 -2
  59. package/dist/effect/generated/messages.d.ts +2036 -117
  60. package/dist/effect/generated/messages.js +286 -54
  61. package/dist/effect/generated/namespaces.d.ts +215 -55
  62. package/dist/effect/generated/namespaces.js +30 -12
  63. package/dist/effect/generated/newsletter-domains.d.ts +98 -12
  64. package/dist/effect/generated/newsletter-domains.js +20 -13
  65. package/dist/effect/generated/newsletter-issues.d.ts +354 -19
  66. package/dist/effect/generated/newsletter-issues.js +162 -98
  67. package/dist/effect/generated/newsletters.d.ts +123 -13
  68. package/dist/effect/generated/newsletters.js +19 -9
  69. package/dist/effect/generated/operations.d.ts +76 -10
  70. package/dist/effect/generated/operations.js +12 -6
  71. package/dist/effect/generated/organizations.d.ts +287 -7
  72. package/dist/effect/generated/organizations.js +33 -5
  73. package/dist/effect/generated/policies.d.ts +953 -0
  74. package/dist/effect/generated/policies.js +116 -0
  75. package/dist/effect/generated/scheduled-messages.d.ts +4418 -49
  76. package/dist/effect/generated/scheduled-messages.js +77 -13
  77. package/dist/effect/generated/shared.d.ts +3213 -521
  78. package/dist/effect/generated/shared.js +713 -128
  79. package/dist/effect/generated/subscriptions.d.ts +23 -1
  80. package/dist/effect/generated/subscriptions.js +6 -4
  81. package/dist/effect/generated/templates.d.ts +2081 -693
  82. package/dist/effect/generated/templates.js +482 -267
  83. package/dist/effect/generated/topic-forms.d.ts +111 -1
  84. package/dist/effect/generated/topic-forms.js +23 -13
  85. package/dist/effect/generated/topics.d.ts +353 -43
  86. package/dist/effect/generated/topics.js +67 -19
  87. package/dist/effect/generated/webhooks.d.ts +318 -57
  88. package/dist/effect/generated/webhooks.js +68 -17
  89. package/dist/effect/generated/whoami.d.ts +35 -5
  90. package/dist/effect/generated/whoami.js +4 -2
  91. package/dist/effect/generated-metadata.d.ts +56 -32
  92. package/dist/effect/generated-metadata.js +137 -105
  93. package/dist/effect/index.d.ts +1 -0
  94. package/dist/effect/index.js +3 -2
  95. package/dist/effect/internal/client.js +1 -1
  96. package/dist/effect/internal/email-sender.d.ts +1 -1
  97. package/dist/effect/internal/operation.js +5 -32
  98. package/dist/effect/internal/send.d.ts +1 -1
  99. package/dist/effect/journeys.d.ts +169 -83
  100. package/dist/effect/mailboxes.d.ts +978 -301
  101. package/dist/effect/mailboxes.js +1 -11
  102. package/dist/effect/media.d.ts +1 -1
  103. package/dist/effect/messages.d.ts +40 -40
  104. package/dist/effect/namespaces.d.ts +15 -15
  105. package/dist/effect/newsletter-domains.d.ts +5 -5
  106. package/dist/effect/newsletters.d.ts +1 -1
  107. package/dist/effect/operations.d.ts +11 -11
  108. package/dist/effect/organizations.d.ts +2 -2
  109. package/dist/effect/policies.d.ts +65 -0
  110. package/dist/effect/policies.js +16 -0
  111. package/dist/effect/scheduled-messages.d.ts +869 -8
  112. package/dist/effect/templates.d.ts +43 -45
  113. package/dist/effect/templates.js +5 -3
  114. package/dist/effect/topics.d.ts +23 -23
  115. package/dist/effect/webhooks.d.ts +29 -26
  116. package/dist/index.js +2 -2
  117. package/dist/mailbox/test.js +11 -4
  118. package/dist/mailbox/types.d.ts +39 -3
  119. package/dist/normalize.js +13 -1
  120. package/dist/package.js +1 -1
  121. package/dist/promises/client.d.ts +4 -2
  122. package/dist/promises/client.js +5 -3
  123. package/dist/promises/errors.gen.d.ts +38 -2
  124. package/dist/promises/errors.gen.js +394 -34
  125. package/dist/promises/index.js +2 -2
  126. package/dist/promises/types.gen.d.ts +1 -1
  127. package/dist/service-map.d.ts +39 -28
  128. package/dist/service-map.js +220 -782
  129. package/package.json +13 -8
@@ -1,5 +1,5 @@
1
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";
2
+ import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, ForbiddenError, GatewayTimeoutError, InternalError, JsonValue, MailboxId, MalformedRequestError, NamespaceId, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SuccessResponse, UnauthorizedError, ValidationError, WebhookEndpointId } from "./shared.js";
3
3
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
4
4
  import * as Schema from "effect/Schema";
5
5
  // src/effect/generated/webhooks.ts
@@ -10,15 +10,15 @@ const WebhookDeliveryCounts = /* @__PURE__ */ (() => Schema.Struct({
10
10
  exhausted: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })),
11
11
  cancelled: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" }))
12
12
  }).annotate({ identifier: "WebhookDeliveryCounts" }))();
13
- const WebhookDeliveryId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^whdel_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
13
+ const WebhookDeliveryId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(new globalThis.RegExp("^whdel_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
14
14
  expected: "a string matching the RegExp ^whdel_[0-9a-hjkmnp-tv-z]{16,24}$",
15
15
  identifier: "WebhookDeliveryId"
16
16
  })).pipe(Schema.brand("WebhookDeliveryId")))();
17
- const WebhookAttemptId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^whatt_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
17
+ const WebhookAttemptId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(new globalThis.RegExp("^whatt_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
18
18
  expected: "a string matching the RegExp ^whatt_[0-9a-hjkmnp-tv-z]{16,24}$",
19
19
  identifier: "WebhookAttemptId"
20
20
  })).pipe(Schema.brand("WebhookAttemptId")))();
21
- const WebhookEventId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^whevt_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
21
+ const WebhookEventId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(new globalThis.RegExp("^whevt_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
22
22
  expected: "a string matching the RegExp ^whevt_[0-9a-hjkmnp-tv-z]{16,24}$",
23
23
  identifier: "WebhookEventId"
24
24
  })).pipe(Schema.brand("WebhookEventId")))();
@@ -64,6 +64,8 @@ const WebhookEndpoint = /* @__PURE__ */ (() => Schema.Struct({
64
64
  Schema.Literal("webhook.test"),
65
65
  Schema.Literal("domain.updated"),
66
66
  Schema.Literal("domain.warming.updated"),
67
+ Schema.Literal("email.sending.paused"),
68
+ Schema.Literal("email.sending.resumed"),
67
69
  Schema.Literal("template.registration.updated"),
68
70
  Schema.Literal("flow.registration.updated"),
69
71
  Schema.Literal("whatsapp.number.connected"),
@@ -79,7 +81,11 @@ const WebhookEndpoint = /* @__PURE__ */ (() => Schema.Struct({
79
81
  Schema.Literal("mailbox.message.failed"),
80
82
  Schema.Literal("journey.webhook")
81
83
  ])),
82
- channels: Schema.Union([Schema.Array(Schema.Literal("email")), Schema.Null]),
84
+ channels: Schema.Union([Schema.Array(Schema.Union([
85
+ Schema.Literal("sms"),
86
+ Schema.Literal("whatsapp"),
87
+ Schema.Literal("email")
88
+ ])), Schema.Null]),
83
89
  mailboxIds: Schema.Union([Schema.Array(MailboxId), Schema.Null]),
84
90
  namespaceId: Schema.Union([NamespaceId, Schema.Null]),
85
91
  status: Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]),
@@ -119,6 +125,8 @@ const WebhookEndpointListItem = /* @__PURE__ */ (() => Schema.Struct({
119
125
  Schema.Literal("webhook.test"),
120
126
  Schema.Literal("domain.updated"),
121
127
  Schema.Literal("domain.warming.updated"),
128
+ Schema.Literal("email.sending.paused"),
129
+ Schema.Literal("email.sending.resumed"),
122
130
  Schema.Literal("template.registration.updated"),
123
131
  Schema.Literal("flow.registration.updated"),
124
132
  Schema.Literal("whatsapp.number.connected"),
@@ -134,7 +142,11 @@ const WebhookEndpointListItem = /* @__PURE__ */ (() => Schema.Struct({
134
142
  Schema.Literal("mailbox.message.failed"),
135
143
  Schema.Literal("journey.webhook")
136
144
  ])),
137
- channels: Schema.Union([Schema.Array(Schema.Literal("email")), Schema.Null]),
145
+ channels: Schema.Union([Schema.Array(Schema.Union([
146
+ Schema.Literal("sms"),
147
+ Schema.Literal("whatsapp"),
148
+ Schema.Literal("email")
149
+ ])), Schema.Null]),
138
150
  mailboxIds: Schema.Union([Schema.Array(MailboxId), Schema.Null]),
139
151
  namespaceId: Schema.Union([NamespaceId, Schema.Null]),
140
152
  status: Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]),
@@ -198,7 +210,11 @@ const WebhookStatsResponse = /* @__PURE__ */ (() => Schema.Struct({
198
210
  delivered: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })),
199
211
  exhausted: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })),
200
212
  cancelled: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })),
201
- daily: Schema.Array(WebhookDailyDeliveries)
213
+ daily: Schema.Array(WebhookDailyDeliveries),
214
+ latestAttempt: Schema.Union([Schema.Struct({
215
+ errorCode: Schema.Union([Schema.String, Schema.Null]),
216
+ completedAt: Schema.String
217
+ }), Schema.Null])
202
218
  }).annotate({ identifier: "WebhookStatsResponse" }))();
203
219
  const WebhookEndpointPage = /* @__PURE__ */ (() => Schema.Struct({
204
220
  items: Schema.Array(WebhookEndpointListItem),
@@ -206,11 +222,13 @@ const WebhookEndpointPage = /* @__PURE__ */ (() => Schema.Struct({
206
222
  }).annotate({ identifier: "WebhookEndpointPage" }))();
207
223
  const WebhooksListQuery = /* @__PURE__ */ (() => Schema.Struct({
208
224
  limit: Schema.optionalKey(Schema.Union([Schema.Finite.annotate({ description: "Items per page, at most 100." }).check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null])),
209
- cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null])),
210
- search: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
211
- status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]), Schema.Null]))
225
+ cursor: Schema.optionalKey(Schema.String),
226
+ namespaceId: Schema.optionalKey(NamespaceId),
227
+ search: Schema.optionalKey(Schema.String),
228
+ status: Schema.optionalKey(Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]))
212
229
  }))();
213
230
  const WebhooksList200 = WebhookEndpointPage;
231
+ const WebhooksList400 = MalformedRequestError;
214
232
  const WebhooksList401 = UnauthorizedError;
215
233
  const WebhooksList403 = ForbiddenError;
216
234
  const WebhooksList422 = ValidationError;
@@ -245,6 +263,8 @@ const WebhooksCreateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
245
263
  Schema.Literal("webhook.test"),
246
264
  Schema.Literal("domain.updated"),
247
265
  Schema.Literal("domain.warming.updated"),
266
+ Schema.Literal("email.sending.paused"),
267
+ Schema.Literal("email.sending.resumed"),
248
268
  Schema.Literal("template.registration.updated"),
249
269
  Schema.Literal("flow.registration.updated"),
250
270
  Schema.Literal("whatsapp.number.connected"),
@@ -260,7 +280,11 @@ const WebhooksCreateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
260
280
  Schema.Literal("mailbox.message.failed"),
261
281
  Schema.Literal("journey.webhook")
262
282
  ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
263
- 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])),
283
+ channels: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([
284
+ Schema.Literal("sms"),
285
+ Schema.Literal("whatsapp"),
286
+ Schema.Literal("email")
287
+ ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null])),
264
288
  mailboxIds: Schema.optionalKey(Schema.Union([Schema.TupleWithRest(Schema.Tuple([MailboxId]), [MailboxId]), Schema.Null])),
265
289
  namespaceId: Schema.optionalKey(Schema.Union([NamespaceId, Schema.Null])),
266
290
  headers: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null])),
@@ -270,6 +294,7 @@ const WebhooksCreate201 = /* @__PURE__ */ (() => Schema.Struct({
270
294
  endpoint: WebhookEndpoint,
271
295
  secret: SensitiveString
272
296
  }))();
297
+ const WebhooksCreate400 = MalformedRequestError;
273
298
  const WebhooksCreate401 = UnauthorizedError;
274
299
  const WebhooksCreate402 = PaymentRequiredError;
275
300
  const WebhooksCreate403 = ForbiddenError;
@@ -281,6 +306,7 @@ const WebhooksCreate502 = BillingProviderError;
281
306
  const WebhooksCreate504 = GatewayTimeoutError;
282
307
  const WebhooksGetPathParams = /* @__PURE__ */ (() => Schema.Struct({ id: WebhookEndpointId }))();
283
308
  const WebhooksGet200 = WebhookEndpoint;
309
+ const WebhooksGet400 = MalformedRequestError;
284
310
  const WebhooksGet401 = UnauthorizedError;
285
311
  const WebhooksGet403 = ForbiddenError;
286
312
  const WebhooksGet404 = ResourceNotFoundError;
@@ -289,6 +315,7 @@ const WebhooksGet500 = InternalError;
289
315
  const WebhooksGet504 = GatewayTimeoutError;
290
316
  const WebhooksRemovePathParams = /* @__PURE__ */ (() => Schema.Struct({ id: WebhookEndpointId }))();
291
317
  const WebhooksRemove200 = SuccessResponse;
318
+ const WebhooksRemove400 = MalformedRequestError;
292
319
  const WebhooksRemove401 = UnauthorizedError;
293
320
  const WebhooksRemove403 = ForbiddenError;
294
321
  const WebhooksRemove404 = ResourceNotFoundError;
@@ -326,6 +353,8 @@ const WebhooksUpdateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
326
353
  Schema.Literal("webhook.test"),
327
354
  Schema.Literal("domain.updated"),
328
355
  Schema.Literal("domain.warming.updated"),
356
+ Schema.Literal("email.sending.paused"),
357
+ Schema.Literal("email.sending.resumed"),
329
358
  Schema.Literal("template.registration.updated"),
330
359
  Schema.Literal("flow.registration.updated"),
331
360
  Schema.Literal("whatsapp.number.connected"),
@@ -341,13 +370,18 @@ const WebhooksUpdateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
341
370
  Schema.Literal("mailbox.message.failed"),
342
371
  Schema.Literal("journey.webhook")
343
372
  ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null])),
344
- 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])),
373
+ channels: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Union([
374
+ Schema.Literal("sms"),
375
+ Schema.Literal("whatsapp"),
376
+ Schema.Literal("email")
377
+ ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })), Schema.Null])),
345
378
  mailboxIds: Schema.optionalKey(Schema.Union([Schema.TupleWithRest(Schema.Tuple([MailboxId]), [MailboxId]), Schema.Null])),
346
379
  namespaceId: Schema.optionalKey(Schema.Union([NamespaceId, Schema.Null])),
347
380
  headers: Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null])),
348
381
  status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("active"), Schema.Literal("disabled")]), Schema.Null]))
349
382
  }))();
350
383
  const WebhooksUpdate200 = WebhookEndpoint;
384
+ const WebhooksUpdate400 = MalformedRequestError;
351
385
  const WebhooksUpdate401 = UnauthorizedError;
352
386
  const WebhooksUpdate403 = ForbiddenError;
353
387
  const WebhooksUpdate404 = ResourceNotFoundError;
@@ -365,6 +399,7 @@ const WebhooksRetryDelivery200 = /* @__PURE__ */ (() => Schema.Struct({
365
399
  attemptId: WebhookAttemptId,
366
400
  outcome: Schema.Union([Schema.Literal("succeeded"), Schema.Literal("failed")])
367
401
  }))();
402
+ const WebhooksRetryDelivery400 = MalformedRequestError;
368
403
  const WebhooksRetryDelivery401 = UnauthorizedError;
369
404
  const WebhooksRetryDelivery403 = ForbiddenError;
370
405
  const WebhooksRetryDelivery404 = ResourceNotFoundError;
@@ -375,9 +410,10 @@ const WebhooksRetryDelivery504 = GatewayTimeoutError;
375
410
  const WebhooksGetLogsPathParams = /* @__PURE__ */ (() => Schema.Struct({ id: WebhookEndpointId }))();
376
411
  const WebhooksGetLogsQuery = /* @__PURE__ */ (() => Schema.Struct({
377
412
  limit: Schema.optionalKey(Schema.Union([Schema.Finite.annotate({ description: "Items per page, at most 100." }).check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null])),
378
- cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
413
+ cursor: Schema.optionalKey(Schema.String)
379
414
  }))();
380
415
  const WebhooksGetLogs200 = WebhookDeliveryPage;
416
+ const WebhooksGetLogs400 = MalformedRequestError;
381
417
  const WebhooksGetLogs401 = UnauthorizedError;
382
418
  const WebhooksGetLogs403 = ForbiddenError;
383
419
  const WebhooksGetLogs404 = ResourceNotFoundError;
@@ -386,6 +422,7 @@ const WebhooksGetLogs500 = InternalError;
386
422
  const WebhooksGetLogs504 = GatewayTimeoutError;
387
423
  const WebhooksRegenerateSecretPathParams = /* @__PURE__ */ (() => Schema.Struct({ id: WebhookEndpointId }))();
388
424
  const WebhooksRegenerateSecret200 = /* @__PURE__ */ (() => Schema.Struct({ secret: SensitiveString }))();
425
+ const WebhooksRegenerateSecret400 = MalformedRequestError;
389
426
  const WebhooksRegenerateSecret401 = UnauthorizedError;
390
427
  const WebhooksRegenerateSecret403 = ForbiddenError;
391
428
  const WebhooksRegenerateSecret404 = ResourceNotFoundError;
@@ -394,6 +431,7 @@ const WebhooksRegenerateSecret500 = InternalError;
394
431
  const WebhooksRegenerateSecret504 = GatewayTimeoutError;
395
432
  const WebhooksGetSecretPathParams = /* @__PURE__ */ (() => Schema.Struct({ id: WebhookEndpointId }))();
396
433
  const WebhooksGetSecret200 = WebhookSigningSecret;
434
+ const WebhooksGetSecret400 = MalformedRequestError;
397
435
  const WebhooksGetSecret401 = UnauthorizedError;
398
436
  const WebhooksGetSecret403 = ForbiddenError;
399
437
  const WebhooksGetSecret404 = ResourceNotFoundError;
@@ -402,10 +440,11 @@ const WebhooksGetSecret500 = InternalError;
402
440
  const WebhooksGetSecret504 = GatewayTimeoutError;
403
441
  const WebhooksGetStatsPathParams = /* @__PURE__ */ (() => Schema.Struct({ id: WebhookEndpointId }))();
404
442
  const WebhooksGetStatsQuery = /* @__PURE__ */ (() => Schema.Struct({
405
- after: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
406
- before: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
443
+ after: Schema.optionalKey(Schema.String),
444
+ before: Schema.optionalKey(Schema.String)
407
445
  }))();
408
446
  const WebhooksGetStats200 = WebhookStatsResponse;
447
+ const WebhooksGetStats400 = MalformedRequestError;
409
448
  const WebhooksGetStats401 = UnauthorizedError;
410
449
  const WebhooksGetStats403 = ForbiddenError;
411
450
  const WebhooksGetStats404 = ResourceNotFoundError;
@@ -419,6 +458,7 @@ const WebhooksTest202 = /* @__PURE__ */ (() => Schema.Struct({
419
458
  eventId: WebhookEventId,
420
459
  deliveryId: WebhookDeliveryId
421
460
  }))();
461
+ const WebhooksTest400 = MalformedRequestError;
422
462
  const WebhooksTest401 = UnauthorizedError;
423
463
  const WebhooksTest403 = ForbiddenError;
424
464
  const WebhooksTest404 = ResourceNotFoundError;
@@ -429,16 +469,18 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
429
469
  query: WebhooksListQuery,
430
470
  success: WebhooksList200,
431
471
  error: [
472
+ WebhooksList400.pipe(HttpApiSchema.status(400)),
432
473
  WebhooksList401.pipe(HttpApiSchema.status(401)),
433
474
  WebhooksList403.pipe(HttpApiSchema.status(403)),
434
475
  WebhooksList422.pipe(HttpApiSchema.status(422)),
435
476
  WebhooksList500,
436
477
  WebhooksList504.pipe(HttpApiSchema.status(504))
437
478
  ]
438
- }).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", {
479
+ }).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 namespace (`namespaceId`), 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", {
439
480
  payload: WebhooksCreateRequestJson,
440
481
  success: WebhooksCreate201.pipe(HttpApiSchema.status(201)),
441
482
  error: [
483
+ WebhooksCreate400.pipe(HttpApiSchema.status(400)),
442
484
  WebhooksCreate401.pipe(HttpApiSchema.status(401)),
443
485
  WebhooksCreate402.pipe(HttpApiSchema.status(402)),
444
486
  WebhooksCreate403.pipe(HttpApiSchema.status(403)),
@@ -453,6 +495,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
453
495
  params: WebhooksGetPathParams,
454
496
  success: WebhooksGet200,
455
497
  error: [
498
+ WebhooksGet400.pipe(HttpApiSchema.status(400)),
456
499
  WebhooksGet401.pipe(HttpApiSchema.status(401)),
457
500
  WebhooksGet403.pipe(HttpApiSchema.status(403)),
458
501
  WebhooksGet404.pipe(HttpApiSchema.status(404)),
@@ -464,6 +507,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
464
507
  params: WebhooksRemovePathParams,
465
508
  success: WebhooksRemove200,
466
509
  error: [
510
+ WebhooksRemove400.pipe(HttpApiSchema.status(400)),
467
511
  WebhooksRemove401.pipe(HttpApiSchema.status(401)),
468
512
  WebhooksRemove403.pipe(HttpApiSchema.status(403)),
469
513
  WebhooksRemove404.pipe(HttpApiSchema.status(404)),
@@ -477,6 +521,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
477
521
  payload: WebhooksUpdateRequestJson,
478
522
  success: WebhooksUpdate200,
479
523
  error: [
524
+ WebhooksUpdate400.pipe(HttpApiSchema.status(400)),
480
525
  WebhooksUpdate401.pipe(HttpApiSchema.status(401)),
481
526
  WebhooksUpdate403.pipe(HttpApiSchema.status(403)),
482
527
  WebhooksUpdate404.pipe(HttpApiSchema.status(404)),
@@ -489,6 +534,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
489
534
  params: WebhooksRetryDeliveryPathParams,
490
535
  success: WebhooksRetryDelivery200,
491
536
  error: [
537
+ WebhooksRetryDelivery400.pipe(HttpApiSchema.status(400)),
492
538
  WebhooksRetryDelivery401.pipe(HttpApiSchema.status(401)),
493
539
  WebhooksRetryDelivery403.pipe(HttpApiSchema.status(403)),
494
540
  WebhooksRetryDelivery404.pipe(HttpApiSchema.status(404)),
@@ -502,6 +548,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
502
548
  query: WebhooksGetLogsQuery,
503
549
  success: WebhooksGetLogs200,
504
550
  error: [
551
+ WebhooksGetLogs400.pipe(HttpApiSchema.status(400)),
505
552
  WebhooksGetLogs401.pipe(HttpApiSchema.status(401)),
506
553
  WebhooksGetLogs403.pipe(HttpApiSchema.status(403)),
507
554
  WebhooksGetLogs404.pipe(HttpApiSchema.status(404)),
@@ -513,6 +560,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
513
560
  params: WebhooksRegenerateSecretPathParams,
514
561
  success: WebhooksRegenerateSecret200,
515
562
  error: [
563
+ WebhooksRegenerateSecret400.pipe(HttpApiSchema.status(400)),
516
564
  WebhooksRegenerateSecret401.pipe(HttpApiSchema.status(401)),
517
565
  WebhooksRegenerateSecret403.pipe(HttpApiSchema.status(403)),
518
566
  WebhooksRegenerateSecret404.pipe(HttpApiSchema.status(404)),
@@ -524,6 +572,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
524
572
  params: WebhooksGetSecretPathParams,
525
573
  success: WebhooksGetSecret200,
526
574
  error: [
575
+ WebhooksGetSecret400.pipe(HttpApiSchema.status(400)),
527
576
  WebhooksGetSecret401.pipe(HttpApiSchema.status(401)),
528
577
  WebhooksGetSecret403.pipe(HttpApiSchema.status(403)),
529
578
  WebhooksGetSecret404.pipe(HttpApiSchema.status(404)),
@@ -536,6 +585,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
536
585
  query: WebhooksGetStatsQuery,
537
586
  success: WebhooksGetStats200,
538
587
  error: [
588
+ WebhooksGetStats400.pipe(HttpApiSchema.status(400)),
539
589
  WebhooksGetStats401.pipe(HttpApiSchema.status(401)),
540
590
  WebhooksGetStats403.pipe(HttpApiSchema.status(403)),
541
591
  WebhooksGetStats404.pipe(HttpApiSchema.status(404)),
@@ -548,6 +598,7 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
548
598
  payload: WebhooksTestRequestJson,
549
599
  success: WebhooksTest202.pipe(HttpApiSchema.status(202)),
550
600
  error: [
601
+ WebhooksTest400.pipe(HttpApiSchema.status(400)),
551
602
  WebhooksTest401.pipe(HttpApiSchema.status(401)),
552
603
  WebhooksTest403.pipe(HttpApiSchema.status(403)),
553
604
  WebhooksTest404.pipe(HttpApiSchema.status(404)),
@@ -556,6 +607,6 @@ var WebhooksGroup = class extends HttpApiGroup.make("Webhooks").add(HttpApiEndpo
556
607
  WebhooksTest504.pipe(HttpApiSchema.status(504))
557
608
  ]
558
609
  }).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") {};
559
- export { WebhookAttemptId, WebhookDailyDeliveries, WebhookDeliveryCounts, WebhookDeliveryId, WebhookDeliveryPage, WebhookEndpoint, WebhookEndpointListItem, WebhookEndpointPage, WebhookEventId, WebhookSigningSecret, 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, WebhooksGetSecret200, WebhooksGetSecret401, WebhooksGetSecret403, WebhooksGetSecret404, WebhooksGetSecret422, WebhooksGetSecret500, WebhooksGetSecret504, WebhooksGetSecretPathParams, 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 };
610
+ export { WebhookAttemptId, WebhookDailyDeliveries, WebhookDeliveryCounts, WebhookDeliveryId, WebhookDeliveryPage, WebhookEndpoint, WebhookEndpointListItem, WebhookEndpointPage, WebhookEventId, WebhookSigningSecret, WebhookStatsResponse, WebhooksCreate201, WebhooksCreate400, WebhooksCreate401, WebhooksCreate402, WebhooksCreate403, WebhooksCreate404, WebhooksCreate409, WebhooksCreate422, WebhooksCreate500, WebhooksCreate502, WebhooksCreate504, WebhooksCreateRequestJson, WebhooksGet200, WebhooksGet400, WebhooksGet401, WebhooksGet403, WebhooksGet404, WebhooksGet422, WebhooksGet500, WebhooksGet504, WebhooksGetLogs200, WebhooksGetLogs400, WebhooksGetLogs401, WebhooksGetLogs403, WebhooksGetLogs404, WebhooksGetLogs422, WebhooksGetLogs500, WebhooksGetLogs504, WebhooksGetLogsPathParams, WebhooksGetLogsQuery, WebhooksGetPathParams, WebhooksGetSecret200, WebhooksGetSecret400, WebhooksGetSecret401, WebhooksGetSecret403, WebhooksGetSecret404, WebhooksGetSecret422, WebhooksGetSecret500, WebhooksGetSecret504, WebhooksGetSecretPathParams, WebhooksGetStats200, WebhooksGetStats400, WebhooksGetStats401, WebhooksGetStats403, WebhooksGetStats404, WebhooksGetStats422, WebhooksGetStats500, WebhooksGetStats504, WebhooksGetStatsPathParams, WebhooksGetStatsQuery, WebhooksGroup, WebhooksList200, WebhooksList400, WebhooksList401, WebhooksList403, WebhooksList422, WebhooksList500, WebhooksList504, WebhooksListQuery, WebhooksRegenerateSecret200, WebhooksRegenerateSecret400, WebhooksRegenerateSecret401, WebhooksRegenerateSecret403, WebhooksRegenerateSecret404, WebhooksRegenerateSecret422, WebhooksRegenerateSecret500, WebhooksRegenerateSecret504, WebhooksRegenerateSecretPathParams, WebhooksRemove200, WebhooksRemove400, WebhooksRemove401, WebhooksRemove403, WebhooksRemove404, WebhooksRemove422, WebhooksRemove500, WebhooksRemove502, WebhooksRemove504, WebhooksRemovePathParams, WebhooksRetryDelivery200, WebhooksRetryDelivery400, WebhooksRetryDelivery401, WebhooksRetryDelivery403, WebhooksRetryDelivery404, WebhooksRetryDelivery422, WebhooksRetryDelivery429, WebhooksRetryDelivery500, WebhooksRetryDelivery504, WebhooksRetryDeliveryPathParams, WebhooksTest202, WebhooksTest400, WebhooksTest401, WebhooksTest403, WebhooksTest404, WebhooksTest422, WebhooksTest500, WebhooksTest504, WebhooksTestPathParams, WebhooksTestRequestJson, WebhooksUpdate200, WebhooksUpdate400, WebhooksUpdate401, WebhooksUpdate403, WebhooksUpdate404, WebhooksUpdate409, WebhooksUpdate422, WebhooksUpdate500, WebhooksUpdate504, WebhooksUpdatePathParams, WebhooksUpdateRequestJson };
560
611
 
561
612
  //# sourceMappingURL=webhooks.js.map
@@ -1,6 +1,6 @@
1
1
  import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
2
2
  import * as Schema from "effect/Schema";
3
- import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, OrganizationId, UnauthorizedError, ValidationError } from "./shared";
3
+ import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, OrganizationId, UnauthorizedError, ValidationError } from "./shared";
4
4
  export type WhoamiUser = {
5
5
  readonly id: string;
6
6
  readonly name: string;
@@ -54,8 +54,11 @@ export declare const WhoamiApiKeyCredential: Schema.Struct<{
54
54
  readonly resources: Schema.Struct<{
55
55
  readonly messages: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
56
56
  readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
57
+ readonly sms: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
58
+ readonly whatsapp: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
57
59
  readonly domains: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
58
60
  readonly phoneNumbers: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
61
+ readonly whatsappAccounts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
59
62
  readonly contacts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
60
63
  readonly conversations: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
61
64
  readonly templates: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
@@ -69,7 +72,6 @@ export declare const WhoamiApiKeyCredential: Schema.Struct<{
69
72
  readonly mailboxes: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
70
73
  readonly permissions: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>, readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>;
71
74
  readonly mailboxIds: Schema.optionalKey<Schema.Union<readonly [Schema.TupleWithRest<Schema.Tuple<readonly [Schema.brand<Schema.String, "MailboxId">]>, readonly [Schema.brand<Schema.String, "MailboxId">]>, Schema.Null]>>;
72
- readonly sendMode: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"send">, Schema.Literal<"approval">]>, Schema.Null]>>;
73
75
  }>, Schema.Null]>>;
74
76
  readonly namespaceId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "NamespaceId">, Schema.Null]>>;
75
77
  }>]>;
@@ -96,8 +98,11 @@ export declare const Whoami: Schema.Struct<{
96
98
  readonly resources: Schema.Struct<{
97
99
  readonly messages: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
98
100
  readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
101
+ readonly sms: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
102
+ readonly whatsapp: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
99
103
  readonly domains: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
100
104
  readonly phoneNumbers: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
105
+ readonly whatsappAccounts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
101
106
  readonly contacts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
102
107
  readonly conversations: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
103
108
  readonly templates: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
@@ -111,7 +116,6 @@ export declare const Whoami: Schema.Struct<{
111
116
  readonly mailboxes: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
112
117
  readonly permissions: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>, readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>;
113
118
  readonly mailboxIds: Schema.optionalKey<Schema.Union<readonly [Schema.TupleWithRest<Schema.Tuple<readonly [Schema.brand<Schema.String, "MailboxId">]>, readonly [Schema.brand<Schema.String, "MailboxId">]>, Schema.Null]>>;
114
- readonly sendMode: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"send">, Schema.Literal<"approval">]>, Schema.Null]>>;
115
119
  }>, Schema.Null]>>;
116
120
  readonly namespaceId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "NamespaceId">, Schema.Null]>>;
117
121
  }>]>;
@@ -144,8 +148,11 @@ export declare const WhoamiGet200: Schema.Struct<{
144
148
  readonly resources: Schema.Struct<{
145
149
  readonly messages: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
146
150
  readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
151
+ readonly sms: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
152
+ readonly whatsapp: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
147
153
  readonly domains: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
148
154
  readonly phoneNumbers: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
155
+ readonly whatsappAccounts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
149
156
  readonly contacts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
150
157
  readonly conversations: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
151
158
  readonly templates: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
@@ -159,7 +166,6 @@ export declare const WhoamiGet200: Schema.Struct<{
159
166
  readonly mailboxes: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
160
167
  readonly permissions: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>, readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>;
161
168
  readonly mailboxIds: Schema.optionalKey<Schema.Union<readonly [Schema.TupleWithRest<Schema.Tuple<readonly [Schema.brand<Schema.String, "MailboxId">]>, readonly [Schema.brand<Schema.String, "MailboxId">]>, Schema.Null]>>;
162
- readonly sendMode: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"send">, Schema.Literal<"approval">]>, Schema.Null]>>;
163
169
  }>, Schema.Null]>>;
164
170
  readonly namespaceId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "NamespaceId">, Schema.Null]>>;
165
171
  }>]>;
@@ -173,6 +179,8 @@ export declare const WhoamiGet200: Schema.Struct<{
173
179
  readonly role: Schema.Union<readonly [Schema.Literal<"mail_user">, Schema.Literal<"member">, Schema.Literal<"admin">, Schema.Literal<"owner">]>;
174
180
  }>]>;
175
181
  }>;
182
+ export type WhoamiGet400 = MalformedRequestError;
183
+ export declare const WhoamiGet400: typeof MalformedRequestError;
176
184
  export type WhoamiGet401 = UnauthorizedError;
177
185
  export declare const WhoamiGet401: typeof UnauthorizedError;
178
186
  export type WhoamiGet403 = ForbiddenError;
@@ -201,8 +209,11 @@ declare const WhoamiGroup_base: HttpApiGroup.HttpApiGroup<"Whoami", HttpApiEndpo
201
209
  readonly resources: Schema.Struct<{
202
210
  readonly messages: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
203
211
  readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
212
+ readonly sms: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
213
+ readonly whatsapp: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
204
214
  readonly domains: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
205
215
  readonly phoneNumbers: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
216
+ readonly whatsappAccounts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
206
217
  readonly contacts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
207
218
  readonly conversations: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
208
219
  readonly templates: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
@@ -216,7 +227,6 @@ declare const WhoamiGroup_base: HttpApiGroup.HttpApiGroup<"Whoami", HttpApiEndpo
216
227
  readonly mailboxes: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
217
228
  readonly permissions: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>, readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>;
218
229
  readonly mailboxIds: Schema.optionalKey<Schema.Union<readonly [Schema.TupleWithRest<Schema.Tuple<readonly [Schema.brand<Schema.String, "MailboxId">]>, readonly [Schema.brand<Schema.String, "MailboxId">]>, Schema.Null]>>;
219
- readonly sendMode: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"send">, Schema.Literal<"approval">]>, Schema.Null]>>;
220
230
  }>, Schema.Null]>>;
221
231
  readonly namespaceId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "NamespaceId">, Schema.Null]>>;
222
232
  }>]>;
@@ -257,6 +267,26 @@ declare const WhoamiGroup_base: HttpApiGroup.HttpApiGroup<"Whoami", HttpApiEndpo
257
267
  readonly _tag: Schema.tag<"GatewayTimeoutError">;
258
268
  readonly message: Schema.String;
259
269
  readonly retryAfterSeconds: Schema.Finite;
270
+ }>, never, never> | Schema.decodeTo<Schema.declareConstructor<MalformedRequestError, {
271
+ readonly _tag: "MalformedRequestError";
272
+ readonly message: string;
273
+ readonly fields: {
274
+ readonly [x: string]: readonly string[];
275
+ };
276
+ }, readonly [Schema.Struct<{
277
+ readonly _tag: Schema.tag<"MalformedRequestError">;
278
+ readonly message: Schema.String;
279
+ readonly fields: Schema.$Record<Schema.String, Schema.$Array<Schema.String>>;
280
+ }>], {
281
+ readonly _tag: "MalformedRequestError";
282
+ readonly message: string;
283
+ readonly fields: {
284
+ readonly [x: string]: readonly string[];
285
+ };
286
+ }>, Schema.Struct<{
287
+ readonly _tag: Schema.tag<"MalformedRequestError">;
288
+ readonly message: Schema.String;
289
+ readonly fields: Schema.$Record<Schema.String, Schema.$Array<Schema.String>>;
260
290
  }>, never, never> | Schema.decodeTo<Schema.declareConstructor<UnauthorizedError, {
261
291
  readonly _tag: "UnauthorizedError";
262
292
  readonly message: string;
@@ -1,4 +1,4 @@
1
- import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, OrganizationId, UnauthorizedError, ValidationError } from "./shared.js";
1
+ import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, OrganizationId, UnauthorizedError, ValidationError } from "./shared.js";
2
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
3
3
  import * as Schema from "effect/Schema";
4
4
  // src/effect/generated/whoami.ts
@@ -34,6 +34,7 @@ const Whoami = /* @__PURE__ */ (() => Schema.Struct({
34
34
  credential: Schema.Union([WhoamiApiKeyCredential, WhoamiUserCredential])
35
35
  }).annotate({ identifier: "Whoami" }))();
36
36
  const WhoamiGet200 = Whoami;
37
+ const WhoamiGet400 = MalformedRequestError;
37
38
  const WhoamiGet401 = UnauthorizedError;
38
39
  const WhoamiGet403 = ForbiddenError;
39
40
  const WhoamiGet422 = ValidationError;
@@ -42,6 +43,7 @@ const WhoamiGet504 = GatewayTimeoutError;
42
43
  var WhoamiGroup = class extends HttpApiGroup.make("Whoami").add(HttpApiEndpoint.get("whoamiGet", "/v1/whoami", {
43
44
  success: WhoamiGet200,
44
45
  error: [
46
+ WhoamiGet400.pipe(HttpApiSchema.status(400)),
45
47
  WhoamiGet401.pipe(HttpApiSchema.status(401)),
46
48
  WhoamiGet403.pipe(HttpApiSchema.status(403)),
47
49
  WhoamiGet422.pipe(HttpApiSchema.status(422)),
@@ -49,6 +51,6 @@ var WhoamiGroup = class extends HttpApiGroup.make("Whoami").add(HttpApiEndpoint.
49
51
  WhoamiGet504.pipe(HttpApiSchema.status(504))
50
52
  ]
51
53
  }).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
- export { Whoami, WhoamiApiKeyCredential, WhoamiGet200, WhoamiGet401, WhoamiGet403, WhoamiGet422, WhoamiGet500, WhoamiGet504, WhoamiGroup, WhoamiOrganization, WhoamiUser, WhoamiUserCredential };
54
+ export { Whoami, WhoamiApiKeyCredential, WhoamiGet200, WhoamiGet400, WhoamiGet401, WhoamiGet403, WhoamiGet422, WhoamiGet500, WhoamiGet504, WhoamiGroup, WhoamiOrganization, WhoamiUser, WhoamiUserCredential };
53
55
 
54
56
  //# sourceMappingURL=whoami.js.map