samva 0.29.1 → 0.31.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 (185) hide show
  1. package/AGENTS.md +23 -5
  2. package/README.md +166 -133
  3. package/dist/_virtual/_rolldown/runtime.js +1 -2
  4. package/dist/client/client/client.gen.js +1 -2
  5. package/dist/client/client/utils.gen.js +1 -2
  6. package/dist/client/client.gen.js +1 -2
  7. package/dist/client/core/auth.gen.js +1 -2
  8. package/dist/client/core/bodySerializer.gen.js +1 -2
  9. package/dist/client/core/params.gen.js +1 -2
  10. package/dist/client/core/pathSerializer.gen.js +1 -2
  11. package/dist/client/core/serverSentEvents.gen.js +1 -2
  12. package/dist/client/core/utils.gen.js +1 -2
  13. package/dist/client/sdk.gen.d.ts +218 -192
  14. package/dist/client/sdk.gen.js +2397 -1154
  15. package/dist/client/types.gen.d.ts +767 -376
  16. package/dist/client-attribution.js +1 -2
  17. package/dist/effect/agents.d.ts +33 -11
  18. package/dist/effect/agents.js +1 -2
  19. package/dist/effect/analytics.d.ts +6 -6
  20. package/dist/effect/analytics.js +1 -2
  21. package/dist/effect/api-keys.d.ts +8 -8
  22. package/dist/effect/api-keys.js +1 -2
  23. package/dist/effect/attachments.d.ts +4 -4
  24. package/dist/effect/attachments.js +1 -2
  25. package/dist/effect/brands.d.ts +6 -6
  26. package/dist/effect/brands.js +1 -2
  27. package/dist/effect/campaigns.d.ts +15 -16
  28. package/dist/effect/campaigns.js +1 -2
  29. package/dist/effect/categories.js +1 -2
  30. package/dist/effect/client.js +1 -2
  31. package/dist/effect/contact-groups.d.ts +10 -10
  32. package/dist/effect/contact-groups.js +1 -2
  33. package/dist/effect/contacts.d.ts +23 -24
  34. package/dist/effect/contacts.js +1 -2
  35. package/dist/effect/conversations.d.ts +16 -13
  36. package/dist/effect/conversations.js +1 -2
  37. package/dist/effect/custom-fields.d.ts +4 -4
  38. package/dist/effect/custom-fields.js +1 -2
  39. package/dist/effect/email.d.ts +61 -63
  40. package/dist/effect/email.js +1 -2
  41. package/dist/effect/events.d.ts +2 -4
  42. package/dist/effect/events.js +1 -2
  43. package/dist/effect/extension-installations.d.ts +9 -9
  44. package/dist/effect/extension-installations.js +1 -2
  45. package/dist/effect/extensions.d.ts +5 -5
  46. package/dist/effect/extensions.js +1 -2
  47. package/dist/effect/feedback.d.ts +1 -1
  48. package/dist/effect/feedback.js +1 -2
  49. package/dist/effect/generated/agents.d.ts +264 -22
  50. package/dist/effect/generated/agents.js +2 -3
  51. package/dist/effect/generated/analytics.js +1 -2
  52. package/dist/effect/generated/api-keys.js +1 -2
  53. package/dist/effect/generated/attachments.js +1 -2
  54. package/dist/effect/generated/brands.js +1 -2
  55. package/dist/effect/generated/campaigns.d.ts +160 -155
  56. package/dist/effect/generated/campaigns.js +7 -9
  57. package/dist/effect/generated/contact-events.js +1 -2
  58. package/dist/effect/generated/contact-groups.d.ts +26 -26
  59. package/dist/effect/generated/contact-groups.js +22 -19
  60. package/dist/effect/generated/contacts.d.ts +119 -90
  61. package/dist/effect/generated/contacts.js +32 -32
  62. package/dist/effect/generated/conversations.d.ts +26 -23
  63. package/dist/effect/generated/conversations.js +10 -10
  64. package/dist/effect/generated/custom-fields.d.ts +6 -6
  65. package/dist/effect/generated/custom-fields.js +3 -4
  66. package/dist/effect/generated/email.d.ts +38 -38
  67. package/dist/effect/generated/email.js +13 -14
  68. package/dist/effect/generated/events.d.ts +18 -9
  69. package/dist/effect/generated/events.js +8 -6
  70. package/dist/effect/generated/extension-installations.d.ts +2 -2
  71. package/dist/effect/generated/extension-installations.js +6 -3
  72. package/dist/effect/generated/extensions.js +1 -2
  73. package/dist/effect/generated/feedback.js +1 -2
  74. package/dist/effect/generated/index.d.ts +7 -5
  75. package/dist/effect/generated/journeys.js +1 -2
  76. package/dist/effect/generated/mailboxes.d.ts +44 -44
  77. package/dist/effect/generated/mailboxes.js +17 -18
  78. package/dist/effect/generated/media.js +1 -2
  79. package/dist/effect/generated/messages.d.ts +42 -42
  80. package/dist/effect/generated/messages.js +3 -4
  81. package/dist/effect/generated/namespaces.js +1 -2
  82. package/dist/effect/generated/{publication-domains.d.ts → newsletter-domains.d.ts} +304 -80
  83. package/dist/effect/generated/newsletter-domains.js +218 -0
  84. package/dist/effect/generated/{topic-issues.d.ts → newsletter-issues.d.ts} +330 -288
  85. package/dist/effect/generated/{topic-issues.js → newsletter-issues.js} +255 -246
  86. package/dist/effect/generated/newsletters.d.ts +741 -0
  87. package/dist/effect/generated/newsletters.js +143 -0
  88. package/dist/effect/generated/operations.js +1 -2
  89. package/dist/effect/generated/organizations.d.ts +9 -9
  90. package/dist/effect/generated/organizations.js +4 -5
  91. package/dist/effect/generated/scheduled-messages.d.ts +174 -169
  92. package/dist/effect/generated/scheduled-messages.js +7 -7
  93. package/dist/effect/generated/shared.d.ts +276 -208
  94. package/dist/effect/generated/shared.js +50 -36
  95. package/dist/effect/generated/subscriptions.js +1 -2
  96. package/dist/effect/generated/templates.d.ts +118 -67
  97. package/dist/effect/generated/templates.js +43 -35
  98. package/dist/effect/generated/topic-forms.d.ts +79 -19
  99. package/dist/effect/generated/topic-forms.js +13 -14
  100. package/dist/effect/generated/topics.d.ts +27 -65
  101. package/dist/effect/generated/topics.js +13 -20
  102. package/dist/effect/generated/webhooks.d.ts +9 -9
  103. package/dist/effect/generated/webhooks.js +4 -5
  104. package/dist/effect/generated/whoami.js +1 -2
  105. package/dist/effect/generated-metadata.d.ts +475 -70
  106. package/dist/effect/generated-metadata.js +642 -432
  107. package/dist/effect/index.d.ts +3 -2
  108. package/dist/effect/index.js +4 -3
  109. package/dist/effect/internal/client.d.ts +5 -0
  110. package/dist/effect/internal/client.js +9 -5
  111. package/dist/effect/internal/email-sender.d.ts +1 -1
  112. package/dist/effect/internal/email-sender.js +4 -3
  113. package/dist/effect/internal/mailbox-events.js +1 -2
  114. package/dist/effect/internal/operation.d.ts +4 -15
  115. package/dist/effect/internal/operation.js +21 -33
  116. package/dist/effect/internal/send.js +2 -3
  117. package/dist/effect/journeys.d.ts +14 -14
  118. package/dist/effect/journeys.js +1 -2
  119. package/dist/effect/mailboxes.d.ts +60 -70
  120. package/dist/effect/mailboxes.js +1 -2
  121. package/dist/effect/media.d.ts +5 -5
  122. package/dist/effect/media.js +1 -2
  123. package/dist/effect/messages.d.ts +9 -9
  124. package/dist/effect/messages.js +1 -2
  125. package/dist/effect/namespaces.d.ts +8 -8
  126. package/dist/effect/namespaces.js +1 -2
  127. package/dist/effect/newsletter-domains.d.ts +71 -0
  128. package/dist/effect/newsletter-domains.js +18 -0
  129. package/dist/effect/{topic-issues.d.ts → newsletter-issues.d.ts} +11 -15
  130. package/dist/effect/newsletter-issues.js +32 -0
  131. package/dist/effect/newsletters.d.ts +22 -0
  132. package/dist/effect/newsletters.js +20 -0
  133. package/dist/effect/operations.d.ts +3 -3
  134. package/dist/effect/operations.js +1 -2
  135. package/dist/effect/organizations.d.ts +8 -10
  136. package/dist/effect/organizations.js +1 -2
  137. package/dist/effect/pagination.js +1 -2
  138. package/dist/effect/retry.d.ts +4 -4
  139. package/dist/effect/retry.js +5 -6
  140. package/dist/effect/runtime.js +1 -2
  141. package/dist/effect/scheduled-messages.d.ts +5 -6
  142. package/dist/effect/scheduled-messages.js +1 -2
  143. package/dist/effect/subscriptions.d.ts +1 -1
  144. package/dist/effect/subscriptions.js +1 -2
  145. package/dist/effect/templates.d.ts +34 -43
  146. package/dist/effect/templates.js +1 -2
  147. package/dist/effect/topic-forms.d.ts +5 -5
  148. package/dist/effect/topic-forms.js +1 -2
  149. package/dist/effect/topics.d.ts +9 -13
  150. package/dist/effect/topics.js +1 -2
  151. package/dist/effect/webhooks.d.ts +11 -11
  152. package/dist/effect/webhooks.js +1 -2
  153. package/dist/effect/whoami.d.ts +1 -1
  154. package/dist/effect/whoami.js +1 -2
  155. package/dist/index.js +2 -2
  156. package/dist/inline-attachments.js +1 -2
  157. package/dist/mailbox/dispatch.d.ts +10 -0
  158. package/dist/mailbox/dispatch.js +66 -0
  159. package/dist/mailbox/index.d.ts +17 -0
  160. package/dist/mailbox/index.js +30 -0
  161. package/dist/mailbox/test.d.ts +25 -0
  162. package/dist/mailbox/test.js +174 -0
  163. package/dist/mailbox/types.d.ts +184 -0
  164. package/dist/mailbox/webhook.d.ts +10 -0
  165. package/dist/mailbox/webhook.js +41 -0
  166. package/dist/mailbox-events.js +1 -2
  167. package/dist/normalize.js +1 -2
  168. package/dist/package.js +2 -3
  169. package/dist/promises/client.d.ts +215 -0
  170. package/dist/promises/client.js +324 -0
  171. package/dist/promises/errors.gen.js +1 -2
  172. package/dist/promises/index.d.ts +2 -196
  173. package/dist/promises/index.js +3 -295
  174. package/dist/promises/request.d.ts +15 -0
  175. package/dist/promises/request.js +75 -0
  176. package/dist/promises/types.gen.d.ts +1 -1
  177. package/dist/request-policy.d.ts +3 -0
  178. package/dist/request-policy.js +16 -0
  179. package/dist/service-map.d.ts +78 -47
  180. package/dist/service-map.js +52 -32
  181. package/package.json +34 -18
  182. package/dist/effect/generated/publication-domains.js +0 -163
  183. package/dist/effect/publication-domains.d.ts +0 -14
  184. package/dist/effect/publication-domains.js +0 -17
  185. package/dist/effect/topic-issues.js +0 -33
@@ -1,7 +1,7 @@
1
- import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, ContactGroupId, ContactId, ContactIdentity, ContactIdentityId, ConversationId, Cursor, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, JsonObject, MessageId, NamespaceId, PaymentRequiredError, ResourceNotFoundError, TopicId, UnauthorizedError, ValidationError } from "./shared.js";
1
+ import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, ContactGroupId, ContactId, ContactIdentity, ContactIdentityId, ConversationId, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, JsonObject, MessageId, NamespaceId, PaymentRequiredError, ResourceNotFoundError, TopicId, 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
- //#region src/effect/generated/contacts.ts
4
+ // src/effect/generated/contacts.ts
5
5
  const ContactCustomFields = /* @__PURE__ */ (() => Schema.Record(Schema.String, Schema.Union([
6
6
  Schema.String,
7
7
  Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })),
@@ -111,11 +111,11 @@ const ContactProfile = /* @__PURE__ */ (() => Schema.Struct({
111
111
  ]), Schema.Null]))
112
112
  }).annotate({ identifier: "ContactProfile" }))();
113
113
  const ContactProfileUpdate = /* @__PURE__ */ (() => Schema.Struct({
114
- firstName: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
115
- lastName: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
116
- company: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
117
- jobTitle: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
118
- location: Schema.optionalKey(Schema.Union([Schema.Union([ContactLocation, Schema.Null]), Schema.Null])),
114
+ firstName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
115
+ lastName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
116
+ company: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
117
+ jobTitle: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
118
+ location: Schema.optionalKey(Schema.Union([ContactLocation, Schema.Null])),
119
119
  customFields: Schema.optionalKey(Schema.Union([ContactCustomFields, Schema.Null]))
120
120
  }).annotate({ identifier: "ContactProfileUpdate" }))();
121
121
  const ContactSummary = /* @__PURE__ */ (() => Schema.Struct({
@@ -263,11 +263,11 @@ const ContactsList504 = GatewayTimeoutError;
263
263
  const ContactsCreateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
264
264
  namespaceId: Schema.optionalKey(Schema.Union([NamespaceId, Schema.Null])),
265
265
  name: Schema.String,
266
- displayName: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
267
- avatar: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
266
+ displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
267
+ avatar: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
268
268
  identities: Schema.optionalKey(Schema.Union([Schema.Array(ContactIdentityInput), Schema.Null])),
269
- profile: Schema.optionalKey(Schema.Union([Schema.Union([ContactProfile, Schema.Null]), Schema.Null])),
270
- preferences: Schema.optionalKey(Schema.Union([Schema.Union([ContactPreferences, Schema.Null]), Schema.Null])),
269
+ profile: Schema.optionalKey(Schema.Union([ContactProfile, Schema.Null])),
270
+ preferences: Schema.optionalKey(Schema.Union([ContactPreferences, Schema.Null])),
271
271
  tags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
272
272
  status: Schema.optionalKey(Schema.Union([Schema.Union([
273
273
  Schema.Literal("active"),
@@ -275,9 +275,9 @@ const ContactsCreateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
275
275
  Schema.Literal("blocked"),
276
276
  Schema.Literal("archived")
277
277
  ]), Schema.Null])),
278
- statusReason: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
279
- externalId: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
280
- metadata: Schema.optionalKey(Schema.Union([Schema.Union([JsonObject, Schema.Null]), Schema.Null]))
278
+ statusReason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
279
+ externalId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
280
+ metadata: Schema.optionalKey(Schema.Union([JsonObject, Schema.Null]))
281
281
  }))();
282
282
  const ContactsCreate201 = Contact;
283
283
  const ContactsCreate401 = UnauthorizedError;
@@ -309,18 +309,18 @@ const ContactsRemove504 = GatewayTimeoutError;
309
309
  const ContactsUpdatePathParams = /* @__PURE__ */ (() => Schema.Struct({ id: ContactId }))();
310
310
  const ContactsUpdateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
311
311
  name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
312
- displayName: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
313
- avatar: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
312
+ displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
313
+ avatar: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
314
314
  profile: Schema.optionalKey(Schema.Union([ContactProfileUpdate, Schema.Null])),
315
- preferences: Schema.optionalKey(Schema.Union([Schema.Union([ContactPreferences, Schema.Null]), Schema.Null])),
315
+ preferences: Schema.optionalKey(Schema.Union([ContactPreferences, Schema.Null])),
316
316
  status: Schema.optionalKey(Schema.Union([Schema.Union([
317
317
  Schema.Literal("active"),
318
318
  Schema.Literal("paused"),
319
319
  Schema.Literal("blocked"),
320
320
  Schema.Literal("archived")
321
321
  ]), Schema.Null])),
322
- statusReason: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
323
- externalId: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
322
+ statusReason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
323
+ externalId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
324
324
  metadata: Schema.optionalKey(Schema.Union([JsonObject, Schema.Null]))
325
325
  }))();
326
326
  const ContactsUpdate200 = Contact;
@@ -519,11 +519,11 @@ const ContactsFindOrCreateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
519
519
  lookup: ContactLookup,
520
520
  create: Schema.optionalKey(Schema.Union([Schema.Struct({
521
521
  name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
522
- displayName: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
523
- avatar: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
522
+ displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
523
+ avatar: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
524
524
  identities: Schema.optionalKey(Schema.Union([Schema.Array(ContactIdentityInput), Schema.Null])),
525
- profile: Schema.optionalKey(Schema.Union([Schema.Union([ContactProfile, Schema.Null]), Schema.Null])),
526
- externalId: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null]))
525
+ profile: Schema.optionalKey(Schema.Union([ContactProfile, Schema.Null])),
526
+ externalId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
527
527
  }), Schema.Null]))
528
528
  }))();
529
529
  const ContactsFindOrCreate200 = /* @__PURE__ */ (() => Schema.Struct({
@@ -539,6 +539,7 @@ const ContactsFindOrCreate422 = ValidationError;
539
539
  const ContactsFindOrCreate500 = InternalError;
540
540
  const ContactsFindOrCreate502 = BillingProviderError;
541
541
  const ContactsFindOrCreate504 = GatewayTimeoutError;
542
+ const ContactsStartImportHeaders = /* @__PURE__ */ (() => Schema.Struct({ "idempotency-key": Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })), Schema.Null])) }))();
542
543
  const ContactsStartImportRequestJson = /* @__PURE__ */ (() => Schema.Union([Schema.Struct({
543
544
  mode: Schema.Literal("new"),
544
545
  input: Schema.Struct({
@@ -578,8 +579,7 @@ const ContactsStartImportRequestJson = /* @__PURE__ */ (() => Schema.Union([Sche
578
579
  suppressionFree: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]).annotate({ description: "The operator declares this beehiiv export was filtered to Suppression does not exist." }))
579
580
  })]).check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }))
580
581
  }),
581
- planHash: Schema.String,
582
- idempotencyKey: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isBetweenLength(1, 255).annotate({ expected: "a value with a length between 1 and 255" }))
582
+ planHash: Schema.String
583
583
  }), Schema.Struct({
584
584
  mode: Schema.Literal("resume"),
585
585
  jobId: ContactImportJobId,
@@ -629,7 +629,7 @@ const ContactsStartImport202 = /* @__PURE__ */ (() => Schema.Struct({
629
629
  }))();
630
630
  const ContactsStartImport401 = UnauthorizedError;
631
631
  const ContactsStartImport402 = PaymentRequiredError;
632
- const ContactsStartImport403 = /* @__PURE__ */ (() => Schema.Union([ForbiddenError, FlagDisabledError]))();
632
+ const ContactsStartImport403 = ForbiddenError;
633
633
  const ContactsStartImport404 = ResourceNotFoundError;
634
634
  const ContactsStartImport409 = ConflictError;
635
635
  const ContactsStartImport422 = ValidationError;
@@ -749,7 +749,7 @@ const ContactsPlanImport200 = /* @__PURE__ */ (() => Schema.Struct({
749
749
  diagnosticsTruncated: Schema.Boolean
750
750
  }))();
751
751
  const ContactsPlanImport401 = UnauthorizedError;
752
- const ContactsPlanImport403 = /* @__PURE__ */ (() => Schema.Union([ForbiddenError, FlagDisabledError]))();
752
+ const ContactsPlanImport403 = ForbiddenError;
753
753
  const ContactsPlanImport404 = ResourceNotFoundError;
754
754
  const ContactsPlanImport422 = ValidationError;
755
755
  const ContactsPlanImport500 = InternalError;
@@ -980,6 +980,7 @@ var ContactsGroup = class extends HttpApiGroup.make("Contacts").add(HttpApiEndpo
980
980
  ContactsFindOrCreate504.pipe(HttpApiSchema.status(504))
981
981
  ]
982
982
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.findOrCreate").annotate(OpenApi.Summary, "Find or create a contact").annotate(OpenApi.Description, "Looks up exactly one identifier through `lookup: { type, value }`. Returns `{ contact, created: false }` unchanged when it exists. Otherwise creates the lookup identity (or external ID), applies `create` attributes, and returns `{ contact, created: true }`. Additional addresses belong in `create.identities`, custom fields in `create.profile.customFields`; custom field keys must be defined and values must match their types. An external ID lookup cannot be contradicted by `create.externalId`. Creation returns HTTP 409 ConflictError if an externalId or address belongs to another contact; the conflicting field is named and no contact is created. Use the update endpoint to change an existing contact."), HttpApiEndpoint.post("contactsStartImport", "/v1/contacts/imports", {
983
+ headers: ContactsStartImportHeaders,
983
984
  payload: ContactsStartImportRequestJson,
984
985
  success: ContactsStartImport202.pipe(HttpApiSchema.status(202)),
985
986
  error: [
@@ -993,7 +994,7 @@ var ContactsGroup = class extends HttpApiGroup.make("Contacts").add(HttpApiEndpo
993
994
  ContactsStartImport502.pipe(HttpApiSchema.status(502)),
994
995
  ContactsStartImport504.pipe(HttpApiSchema.status(504))
995
996
  ]
996
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.startImport").annotate(OpenApi.Summary, "Start or resume a list migration").annotate(OpenApi.Description, "The complete encoded JSON request, including new-start metadata, must not exceed 3000000 bytes. Admits a durable import using the preview hash and an idempotency key, or resumes the same persisted input at its committed cursor. Imports never restore an existing unsubscribe, suppression or bounce. Namespace-scoped credentials cannot create organization-wide suppressions; those rows are conflicts and create no contact. New active contacts are billable and normal contact events apply. Requires listMigration for new admissions."), HttpApiEndpoint.get("contactsGetImportJob", "/v1/contacts/imports/:id", {
997
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.startImport").annotate(OpenApi.Summary, "Start or resume a list migration").annotate(OpenApi.Description, "The complete encoded JSON request, including new-start metadata, must not exceed 3000000 bytes. Admits a durable import using the preview hash and an Idempotency-Key header, or resumes the same persisted input at its committed cursor. The header is required for mode:new and optional for mode:resume. Only mode:new supports idempotent replay. Resume uses expectedGeneration and must not be automatically retried; read getImportJob after an ambiguous response. Imports never restore an existing unsubscribe, suppression or bounce. Namespace-scoped credentials cannot create organization-wide suppressions; those rows are conflicts and create no contact. New active contacts are billable and normal contact events apply."), HttpApiEndpoint.get("contactsGetImportJob", "/v1/contacts/imports/:id", {
997
998
  params: ContactsGetImportJobPathParams,
998
999
  success: ContactsGetImportJob200,
999
1000
  error: [
@@ -1004,7 +1005,7 @@ var ContactsGroup = class extends HttpApiGroup.make("Contacts").add(HttpApiEndpo
1004
1005
  ContactsGetImportJob500,
1005
1006
  ContactsGetImportJob504.pipe(HttpApiSchema.status(504))
1006
1007
  ]
1007
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.getImportJob").annotate(OpenApi.Summary, "Get list migration progress").annotate(OpenApi.Description, "Returns the visible import job's committed counts, generation, terminal failure and resumability. The job persists across worker restarts and page reloads. Admitted jobs remain readable when listMigration is disabled."), HttpApiEndpoint.post("contactsPlanImport", "/v1/contacts/imports/plan", {
1008
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.getImportJob").annotate(OpenApi.Summary, "Get list migration progress").annotate(OpenApi.Description, "Returns the visible import job's committed counts, generation, terminal failure and resumability. The job persists across worker restarts and page reloads."), HttpApiEndpoint.post("contactsPlanImport", "/v1/contacts/imports/plan", {
1008
1009
  payload: ContactsPlanImportRequestJson,
1009
1010
  success: ContactsPlanImport200,
1010
1011
  error: [
@@ -1015,8 +1016,7 @@ var ContactsGroup = class extends HttpApiGroup.make("Contacts").add(HttpApiEndpo
1015
1016
  ContactsPlanImport500,
1016
1017
  ContactsPlanImport504.pipe(HttpApiSchema.status(504))
1017
1018
  ]
1018
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.planImport").annotate(OpenApi.Summary, "Preview a list migration").annotate(OpenApi.Description, "The complete encoded JSON request must not exceed 3000000 bytes. Reads multiple declared export files without changing contacts. Restrictive evidence wins per address. Returns estimated counts and at most 100 diagnostics; processing rechecks current restrictions. Filenames never establish permission. Requires listMigration. Missing required columns refuse the file; unknown status values are conflicts and never subscribe a reader.")).annotate(OpenApi.Description, "Contact CRUD, bulk operations, engagement metrics, and activity timeline") {};
1019
- //#endregion
1020
- export { BulkUpdateResult, Contact, ContactActivityPage, ContactCustomFields, ContactGroupMembershipPage, ContactIdentityInput, ContactImportJobId, ContactListMembership, ContactLocation, ContactLookup, ContactPage, ContactPreferences, ContactProfile, ContactProfileUpdate, ContactSummary, ContactsAddIdentity200, ContactsAddIdentity401, ContactsAddIdentity403, ContactsAddIdentity404, ContactsAddIdentity409, ContactsAddIdentity422, ContactsAddIdentity500, ContactsAddIdentity504, ContactsAddIdentityPathParams, ContactsAddIdentityRequestJson, ContactsAddTags200, ContactsAddTags401, ContactsAddTags403, ContactsAddTags404, ContactsAddTags422, ContactsAddTags500, ContactsAddTags504, ContactsAddTagsPathParams, ContactsAddTagsRequestJson, ContactsBulkDelete200, ContactsBulkDelete401, ContactsBulkDelete403, ContactsBulkDelete422, ContactsBulkDelete500, ContactsBulkDelete502, ContactsBulkDelete504, ContactsBulkDeleteRequestJson, ContactsBulkUpdateStatus200, ContactsBulkUpdateStatus401, ContactsBulkUpdateStatus402, ContactsBulkUpdateStatus403, ContactsBulkUpdateStatus422, ContactsBulkUpdateStatus500, ContactsBulkUpdateStatus502, ContactsBulkUpdateStatus504, ContactsBulkUpdateStatusRequestJson, ContactsBulkUpdateTags200, ContactsBulkUpdateTags401, ContactsBulkUpdateTags403, ContactsBulkUpdateTags422, ContactsBulkUpdateTags500, ContactsBulkUpdateTags504, ContactsBulkUpdateTagsRequestJson, ContactsCreate201, ContactsCreate401, ContactsCreate402, ContactsCreate403, ContactsCreate404, ContactsCreate409, ContactsCreate422, ContactsCreate500, ContactsCreate502, ContactsCreate504, ContactsCreateRequestJson, ContactsExport200, ContactsExport401, ContactsExport403, ContactsExport422, ContactsExport500, ContactsExport504, ContactsExportRequestJson, ContactsFind200, ContactsFind401, ContactsFind403, ContactsFind404, ContactsFind409, ContactsFind422, ContactsFind500, ContactsFind504, ContactsFindOrCreate200, ContactsFindOrCreate401, ContactsFindOrCreate402, ContactsFindOrCreate403, ContactsFindOrCreate404, ContactsFindOrCreate409, ContactsFindOrCreate422, ContactsFindOrCreate500, ContactsFindOrCreate502, ContactsFindOrCreate504, ContactsFindOrCreateRequestJson, ContactsFindRequestJson, ContactsGet200, ContactsGet401, ContactsGet403, ContactsGet404, ContactsGet422, ContactsGet500, ContactsGet504, ContactsGetActivityTimeline200, ContactsGetActivityTimeline401, ContactsGetActivityTimeline403, ContactsGetActivityTimeline404, ContactsGetActivityTimeline422, ContactsGetActivityTimeline500, ContactsGetActivityTimeline504, ContactsGetActivityTimelinePathParams, ContactsGetActivityTimelineQuery, ContactsGetEngagement200, ContactsGetEngagement401, ContactsGetEngagement403, ContactsGetEngagement404, ContactsGetEngagement422, ContactsGetEngagement500, ContactsGetEngagement504, ContactsGetEngagementPathParams, ContactsGetGroupMemberships200, ContactsGetGroupMemberships401, ContactsGetGroupMemberships403, ContactsGetGroupMemberships404, ContactsGetGroupMemberships422, ContactsGetGroupMemberships500, ContactsGetGroupMemberships504, ContactsGetGroupMembershipsPathParams, ContactsGetGroupMembershipsQuery, ContactsGetImportJob200, ContactsGetImportJob401, ContactsGetImportJob403, ContactsGetImportJob404, ContactsGetImportJob422, ContactsGetImportJob500, ContactsGetImportJob504, ContactsGetImportJobPathParams, ContactsGetPathParams, ContactsGroup, ContactsList200, ContactsList401, ContactsList403, ContactsList422, ContactsList500, ContactsList504, ContactsListQuery, ContactsPlanImport200, ContactsPlanImport401, ContactsPlanImport403, ContactsPlanImport404, ContactsPlanImport422, ContactsPlanImport500, ContactsPlanImport504, ContactsPlanImportRequestJson, ContactsRemove200, ContactsRemove401, ContactsRemove403, ContactsRemove404, ContactsRemove422, ContactsRemove500, ContactsRemove502, ContactsRemove504, ContactsRemoveIdentity200, ContactsRemoveIdentity401, ContactsRemoveIdentity403, ContactsRemoveIdentity404, ContactsRemoveIdentity422, ContactsRemoveIdentity500, ContactsRemoveIdentity504, ContactsRemoveIdentityPathParams, ContactsRemovePathParams, ContactsRemoveTags200, ContactsRemoveTags401, ContactsRemoveTags403, ContactsRemoveTags404, ContactsRemoveTags422, ContactsRemoveTags500, ContactsRemoveTags504, ContactsRemoveTagsPathParams, ContactsRemoveTagsRequestJson, ContactsSetConsent200, ContactsSetConsent401, ContactsSetConsent403, ContactsSetConsent404, ContactsSetConsent422, ContactsSetConsent500, ContactsSetConsent504, ContactsSetConsentPathParams, ContactsSetConsentRequestJson, ContactsStartImport202, ContactsStartImport401, ContactsStartImport402, ContactsStartImport403, ContactsStartImport404, ContactsStartImport409, ContactsStartImport422, ContactsStartImport500, ContactsStartImport502, ContactsStartImport504, ContactsStartImportRequestJson, ContactsUpdate200, ContactsUpdate401, ContactsUpdate402, ContactsUpdate403, ContactsUpdate404, ContactsUpdate422, ContactsUpdate500, ContactsUpdate502, ContactsUpdate504, ContactsUpdatePathParams, ContactsUpdateRequestJson };
1019
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contacts.planImport").annotate(OpenApi.Summary, "Preview a list migration").annotate(OpenApi.Description, "The complete encoded JSON request must not exceed 3000000 bytes. Reads multiple declared export files without changing contacts. Restrictive evidence wins per address. Returns estimated counts and at most 100 diagnostics; processing rechecks current restrictions. Filenames never establish permission. Missing required columns refuse the file; unknown status values are conflicts and never subscribe a reader.")).annotate(OpenApi.Description, "Contact CRUD, bulk operations, engagement metrics, and activity timeline") {};
1020
+ export { BulkUpdateResult, Contact, ContactActivityPage, ContactCustomFields, ContactGroupMembershipPage, ContactIdentityInput, ContactImportJobId, ContactListMembership, ContactLocation, ContactLookup, ContactPage, ContactPreferences, ContactProfile, ContactProfileUpdate, ContactSummary, ContactsAddIdentity200, ContactsAddIdentity401, ContactsAddIdentity403, ContactsAddIdentity404, ContactsAddIdentity409, ContactsAddIdentity422, ContactsAddIdentity500, ContactsAddIdentity504, ContactsAddIdentityPathParams, ContactsAddIdentityRequestJson, ContactsAddTags200, ContactsAddTags401, ContactsAddTags403, ContactsAddTags404, ContactsAddTags422, ContactsAddTags500, ContactsAddTags504, ContactsAddTagsPathParams, ContactsAddTagsRequestJson, ContactsBulkDelete200, ContactsBulkDelete401, ContactsBulkDelete403, ContactsBulkDelete422, ContactsBulkDelete500, ContactsBulkDelete502, ContactsBulkDelete504, ContactsBulkDeleteRequestJson, ContactsBulkUpdateStatus200, ContactsBulkUpdateStatus401, ContactsBulkUpdateStatus402, ContactsBulkUpdateStatus403, ContactsBulkUpdateStatus422, ContactsBulkUpdateStatus500, ContactsBulkUpdateStatus502, ContactsBulkUpdateStatus504, ContactsBulkUpdateStatusRequestJson, ContactsBulkUpdateTags200, ContactsBulkUpdateTags401, ContactsBulkUpdateTags403, ContactsBulkUpdateTags422, ContactsBulkUpdateTags500, ContactsBulkUpdateTags504, ContactsBulkUpdateTagsRequestJson, ContactsCreate201, ContactsCreate401, ContactsCreate402, ContactsCreate403, ContactsCreate404, ContactsCreate409, ContactsCreate422, ContactsCreate500, ContactsCreate502, ContactsCreate504, ContactsCreateRequestJson, ContactsExport200, ContactsExport401, ContactsExport403, ContactsExport422, ContactsExport500, ContactsExport504, ContactsExportRequestJson, ContactsFind200, ContactsFind401, ContactsFind403, ContactsFind404, ContactsFind409, ContactsFind422, ContactsFind500, ContactsFind504, ContactsFindOrCreate200, ContactsFindOrCreate401, ContactsFindOrCreate402, ContactsFindOrCreate403, ContactsFindOrCreate404, ContactsFindOrCreate409, ContactsFindOrCreate422, ContactsFindOrCreate500, ContactsFindOrCreate502, ContactsFindOrCreate504, ContactsFindOrCreateRequestJson, ContactsFindRequestJson, ContactsGet200, ContactsGet401, ContactsGet403, ContactsGet404, ContactsGet422, ContactsGet500, ContactsGet504, ContactsGetActivityTimeline200, ContactsGetActivityTimeline401, ContactsGetActivityTimeline403, ContactsGetActivityTimeline404, ContactsGetActivityTimeline422, ContactsGetActivityTimeline500, ContactsGetActivityTimeline504, ContactsGetActivityTimelinePathParams, ContactsGetActivityTimelineQuery, ContactsGetEngagement200, ContactsGetEngagement401, ContactsGetEngagement403, ContactsGetEngagement404, ContactsGetEngagement422, ContactsGetEngagement500, ContactsGetEngagement504, ContactsGetEngagementPathParams, ContactsGetGroupMemberships200, ContactsGetGroupMemberships401, ContactsGetGroupMemberships403, ContactsGetGroupMemberships404, ContactsGetGroupMemberships422, ContactsGetGroupMemberships500, ContactsGetGroupMemberships504, ContactsGetGroupMembershipsPathParams, ContactsGetGroupMembershipsQuery, ContactsGetImportJob200, ContactsGetImportJob401, ContactsGetImportJob403, ContactsGetImportJob404, ContactsGetImportJob422, ContactsGetImportJob500, ContactsGetImportJob504, ContactsGetImportJobPathParams, ContactsGetPathParams, ContactsGroup, ContactsList200, ContactsList401, ContactsList403, ContactsList422, ContactsList500, ContactsList504, ContactsListQuery, ContactsPlanImport200, ContactsPlanImport401, ContactsPlanImport403, ContactsPlanImport404, ContactsPlanImport422, ContactsPlanImport500, ContactsPlanImport504, ContactsPlanImportRequestJson, ContactsRemove200, ContactsRemove401, ContactsRemove403, ContactsRemove404, ContactsRemove422, ContactsRemove500, ContactsRemove502, ContactsRemove504, ContactsRemoveIdentity200, ContactsRemoveIdentity401, ContactsRemoveIdentity403, ContactsRemoveIdentity404, ContactsRemoveIdentity422, ContactsRemoveIdentity500, ContactsRemoveIdentity504, ContactsRemoveIdentityPathParams, ContactsRemovePathParams, ContactsRemoveTags200, ContactsRemoveTags401, ContactsRemoveTags403, ContactsRemoveTags404, ContactsRemoveTags422, ContactsRemoveTags500, ContactsRemoveTags504, ContactsRemoveTagsPathParams, ContactsRemoveTagsRequestJson, ContactsSetConsent200, ContactsSetConsent401, ContactsSetConsent403, ContactsSetConsent404, ContactsSetConsent422, ContactsSetConsent500, ContactsSetConsent504, ContactsSetConsentPathParams, ContactsSetConsentRequestJson, ContactsStartImport202, ContactsStartImport401, ContactsStartImport402, ContactsStartImport403, ContactsStartImport404, ContactsStartImport409, ContactsStartImport422, ContactsStartImport500, ContactsStartImport502, ContactsStartImport504, ContactsStartImportHeaders, ContactsStartImportRequestJson, ContactsUpdate200, ContactsUpdate401, ContactsUpdate402, ContactsUpdate403, ContactsUpdate404, ContactsUpdate422, ContactsUpdate500, ContactsUpdate502, ContactsUpdate504, ContactsUpdatePathParams, ContactsUpdateRequestJson };
1021
1021
 
1022
1022
  //# sourceMappingURL=contacts.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 { ApiKeySecurityMiddleware, ContactId, ConversationId, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, JsonObject, JsonValue, MessagePage, ResourceNotFoundError, UnauthorizedError, ValidationError } from "./shared";
3
+ import { ApiKeySecurityMiddleware, ContactId, ConversationId, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, JsonObject, JsonValue, MailboxId, MessagePage, ResourceNotFoundError, UnauthorizedError, ValidationError } from "./shared";
4
4
  export type UnknownRecord = {
5
5
  readonly [x: string]: JsonValue;
6
6
  };
@@ -188,6 +188,7 @@ export type ConversationsListQuery = {
188
188
  readonly status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null;
189
189
  readonly channel?: "email" | null;
190
190
  readonly contactId?: ContactId | null;
191
+ readonly mailboxId?: MailboxId | null;
191
192
  readonly after?: string | null;
192
193
  readonly before?: string | null;
193
194
  };
@@ -197,6 +198,7 @@ export declare const ConversationsListQuery: Schema.Struct<{
197
198
  readonly status: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"active">, Schema.Literal<"waiting">, Schema.Literal<"resolved">, Schema.Literal<"escalated">, Schema.Literal<"archived">]>, Schema.Null]>>;
198
199
  readonly channel: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"email">, Schema.Null]>>;
199
200
  readonly contactId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "ContactId">, Schema.Null]>>;
201
+ readonly mailboxId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "MailboxId">, Schema.Null]>>;
200
202
  readonly after: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
201
203
  readonly before: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
202
204
  }>;
@@ -242,7 +244,7 @@ export type ConversationsCreateRequestJson = {
242
244
  readonly urgency?: "low" | "medium" | "high" | "critical" | null;
243
245
  readonly complexity?: "simple" | "moderate" | "complex" | null;
244
246
  readonly metadata?: JsonObject | null;
245
- readonly context?: ConversationContext | null | null;
247
+ readonly context?: ConversationContext | null;
246
248
  readonly tags?: ReadonlyArray<string> | null;
247
249
  readonly categories?: ReadonlyArray<string> | null;
248
250
  readonly isTest?: boolean | null;
@@ -262,7 +264,7 @@ export declare const ConversationsCreateRequestJson: Schema.Struct<{
262
264
  readonly urgency: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"low">, Schema.Literal<"medium">, Schema.Literal<"high">, Schema.Literal<"critical">]>, Schema.Null]>>;
263
265
  readonly complexity: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"simple">, Schema.Literal<"moderate">, Schema.Literal<"complex">]>, Schema.Null]>>;
264
266
  readonly metadata: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
265
- readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
267
+ readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
266
268
  readonly customerData: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
267
269
  readonly previousConversations: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
268
270
  readonly sessionVariables: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
@@ -272,7 +274,7 @@ export declare const ConversationsCreateRequestJson: Schema.Struct<{
272
274
  readonly pendingSteps: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
273
275
  readonly workflowData: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
274
276
  }>, Schema.Null]>>;
275
- }>, Schema.Null]>, Schema.Null]>>;
277
+ }>, Schema.Null]>>;
276
278
  readonly tags: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
277
279
  readonly categories: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
278
280
  readonly isTest: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
@@ -419,16 +421,16 @@ export declare const ConversationsUpdatePathParams: Schema.Struct<{
419
421
  }>;
420
422
  export type ConversationsUpdateRequestJson = {
421
423
  readonly title?: string | null;
422
- readonly description?: string | null | null;
423
- readonly externalId?: string | null | null;
424
- readonly parentConversationId?: ConversationId | null | null;
424
+ readonly description?: string | null;
425
+ readonly externalId?: string | null;
426
+ readonly parentConversationId?: ConversationId | null;
425
427
  readonly primaryChannel?: "email" | null;
426
428
  readonly status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null;
427
- readonly statusReason?: string | null | null;
429
+ readonly statusReason?: string | null;
428
430
  readonly priority?: number | null;
429
431
  readonly urgency?: "low" | "medium" | "high" | "critical" | null;
430
432
  readonly complexity?: "simple" | "moderate" | "complex" | null;
431
- readonly context?: ConversationContext | null | null;
433
+ readonly context?: ConversationContext | null;
432
434
  readonly metadata?: JsonObject | null;
433
435
  readonly isTest?: boolean | null;
434
436
  readonly isInternal?: boolean | null;
@@ -436,16 +438,16 @@ export type ConversationsUpdateRequestJson = {
436
438
  };
437
439
  export declare const ConversationsUpdateRequestJson: Schema.Struct<{
438
440
  readonly title: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
439
- readonly description: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
440
- readonly externalId: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
441
- readonly parentConversationId: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.brand<Schema.String, "ConversationId">, Schema.Null]>, Schema.Null]>>;
441
+ readonly description: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
442
+ readonly externalId: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
443
+ readonly parentConversationId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "ConversationId">, Schema.Null]>>;
442
444
  readonly primaryChannel: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"email">, Schema.Null]>>;
443
445
  readonly status: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"active">, Schema.Literal<"waiting">, Schema.Literal<"resolved">, Schema.Literal<"escalated">, Schema.Literal<"archived">]>, Schema.Null]>>;
444
- readonly statusReason: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
446
+ readonly statusReason: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
445
447
  readonly priority: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
446
448
  readonly urgency: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"low">, Schema.Literal<"medium">, Schema.Literal<"high">, Schema.Literal<"critical">]>, Schema.Null]>>;
447
449
  readonly complexity: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"simple">, Schema.Literal<"moderate">, Schema.Literal<"complex">]>, Schema.Null]>>;
448
- readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
450
+ readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
449
451
  readonly customerData: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
450
452
  readonly previousConversations: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
451
453
  readonly sessionVariables: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
@@ -455,7 +457,7 @@ export declare const ConversationsUpdateRequestJson: Schema.Struct<{
455
457
  readonly pendingSteps: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
456
458
  readonly workflowData: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
457
459
  }>, Schema.Null]>>;
458
- }>, Schema.Null]>, Schema.Null]>>;
460
+ }>, Schema.Null]>>;
459
461
  readonly metadata: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
460
462
  readonly isTest: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
461
463
  readonly isInternal: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
@@ -1731,7 +1733,7 @@ declare const ConversationsGroup_base: HttpApiGroup.HttpApiGroup<"Conversations"
1731
1733
  readonly urgency: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"low">, Schema.Literal<"medium">, Schema.Literal<"high">, Schema.Literal<"critical">]>, Schema.Null]>>;
1732
1734
  readonly complexity: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"simple">, Schema.Literal<"moderate">, Schema.Literal<"complex">]>, Schema.Null]>>;
1733
1735
  readonly metadata: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
1734
- readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1736
+ readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
1735
1737
  readonly customerData: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
1736
1738
  readonly previousConversations: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
1737
1739
  readonly sessionVariables: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
@@ -1741,7 +1743,7 @@ declare const ConversationsGroup_base: HttpApiGroup.HttpApiGroup<"Conversations"
1741
1743
  readonly pendingSteps: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
1742
1744
  readonly workflowData: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
1743
1745
  }>, Schema.Null]>>;
1744
- }>, Schema.Null]>, Schema.Null]>>;
1746
+ }>, Schema.Null]>>;
1745
1747
  readonly tags: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
1746
1748
  readonly categories: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
1747
1749
  readonly isTest: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
@@ -1995,6 +1997,7 @@ declare const ConversationsGroup_base: HttpApiGroup.HttpApiGroup<"Conversations"
1995
1997
  readonly status: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"active">, Schema.Literal<"waiting">, Schema.Literal<"resolved">, Schema.Literal<"escalated">, Schema.Literal<"archived">]>, Schema.Null]>>;
1996
1998
  readonly channel: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"email">, Schema.Null]>>;
1997
1999
  readonly contactId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "ContactId">, Schema.Null]>>;
2000
+ readonly mailboxId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "MailboxId">, Schema.Null]>>;
1998
2001
  readonly after: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
1999
2002
  readonly before: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
2000
2003
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
@@ -2718,16 +2721,16 @@ declare const ConversationsGroup_base: HttpApiGroup.HttpApiGroup<"Conversations"
2718
2721
  readonly id: Schema.brand<Schema.String, "ConversationId">;
2719
2722
  }>>, never, Schema.toCodecJson<Schema.Struct<{
2720
2723
  readonly title: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
2721
- readonly description: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
2722
- readonly externalId: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
2723
- readonly parentConversationId: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.brand<Schema.String, "ConversationId">, Schema.Null]>, Schema.Null]>>;
2724
+ readonly description: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
2725
+ readonly externalId: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
2726
+ readonly parentConversationId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "ConversationId">, Schema.Null]>>;
2724
2727
  readonly primaryChannel: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"email">, Schema.Null]>>;
2725
2728
  readonly status: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"active">, Schema.Literal<"waiting">, Schema.Literal<"resolved">, Schema.Literal<"escalated">, Schema.Literal<"archived">]>, Schema.Null]>>;
2726
- readonly statusReason: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
2729
+ readonly statusReason: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
2727
2730
  readonly priority: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
2728
2731
  readonly urgency: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"low">, Schema.Literal<"medium">, Schema.Literal<"high">, Schema.Literal<"critical">]>, Schema.Null]>>;
2729
2732
  readonly complexity: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"simple">, Schema.Literal<"moderate">, Schema.Literal<"complex">]>, Schema.Null]>>;
2730
- readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
2733
+ readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
2731
2734
  readonly customerData: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
2732
2735
  readonly previousConversations: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
2733
2736
  readonly sessionVariables: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
@@ -2737,7 +2740,7 @@ declare const ConversationsGroup_base: HttpApiGroup.HttpApiGroup<"Conversations"
2737
2740
  readonly pendingSteps: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
2738
2741
  readonly workflowData: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
2739
2742
  }>, Schema.Null]>>;
2740
- }>, Schema.Null]>, Schema.Null]>>;
2743
+ }>, Schema.Null]>>;
2741
2744
  readonly metadata: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.suspend<Schema.Codec<JsonValue, JsonValue, never, never>>>, Schema.Null]>>;
2742
2745
  readonly isTest: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
2743
2746
  readonly isInternal: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
@@ -1,7 +1,7 @@
1
- import { ApiKeySecurityMiddleware, ContactId, ConversationId, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, JsonObject, JsonValue, MessagePage, ResourceNotFoundError, UnauthorizedError, ValidationError } from "./shared.js";
1
+ import { ApiKeySecurityMiddleware, ContactId, ConversationId, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, JsonObject, JsonValue, MailboxId, MessagePage, ResourceNotFoundError, 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
- //#region src/effect/generated/conversations.ts
4
+ // src/effect/generated/conversations.ts
5
5
  const UnknownRecord = /* @__PURE__ */ (() => Schema.Record(Schema.String, JsonValue).annotate({ identifier: "UnknownRecord" }))();
6
6
  const ConversationSummary = /* @__PURE__ */ (() => Schema.Struct({
7
7
  id: ConversationId,
@@ -119,6 +119,7 @@ const ConversationsListQuery = /* @__PURE__ */ (() => Schema.Struct({
119
119
  ]), Schema.Null])),
120
120
  channel: Schema.optionalKey(Schema.Union([Schema.Literal("email"), Schema.Null])),
121
121
  contactId: Schema.optionalKey(Schema.Union([ContactId, Schema.Null])),
122
+ mailboxId: Schema.optionalKey(Schema.Union([MailboxId, Schema.Null])),
122
123
  after: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
123
124
  before: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
124
125
  }))();
@@ -156,7 +157,7 @@ const ConversationsCreateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
156
157
  Schema.Literal("complex")
157
158
  ]), Schema.Null])),
158
159
  metadata: Schema.optionalKey(Schema.Union([JsonObject, Schema.Null])),
159
- context: Schema.optionalKey(Schema.Union([Schema.Union([ConversationContext, Schema.Null]), Schema.Null])),
160
+ context: Schema.optionalKey(Schema.Union([ConversationContext, Schema.Null])),
160
161
  tags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
161
162
  categories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
162
163
  isTest: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
@@ -180,9 +181,9 @@ const ConversationsGetById504 = GatewayTimeoutError;
180
181
  const ConversationsUpdatePathParams = /* @__PURE__ */ (() => Schema.Struct({ id: ConversationId }))();
181
182
  const ConversationsUpdateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
182
183
  title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
183
- description: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
184
- externalId: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
185
- parentConversationId: Schema.optionalKey(Schema.Union([Schema.Union([ConversationId, Schema.Null]), Schema.Null])),
184
+ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
185
+ externalId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
186
+ parentConversationId: Schema.optionalKey(Schema.Union([ConversationId, Schema.Null])),
186
187
  primaryChannel: Schema.optionalKey(Schema.Union([Schema.Literal("email"), Schema.Null])),
187
188
  status: Schema.optionalKey(Schema.Union([Schema.Union([
188
189
  Schema.Literal("active"),
@@ -191,7 +192,7 @@ const ConversationsUpdateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
191
192
  Schema.Literal("escalated"),
192
193
  Schema.Literal("archived")
193
194
  ]), Schema.Null])),
194
- statusReason: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
195
+ statusReason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
195
196
  priority: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })), Schema.Null])),
196
197
  urgency: Schema.optionalKey(Schema.Union([Schema.Union([
197
198
  Schema.Literal("low"),
@@ -204,7 +205,7 @@ const ConversationsUpdateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
204
205
  Schema.Literal("moderate"),
205
206
  Schema.Literal("complex")
206
207
  ]), Schema.Null])),
207
- context: Schema.optionalKey(Schema.Union([Schema.Union([ConversationContext, Schema.Null]), Schema.Null])),
208
+ context: Schema.optionalKey(Schema.Union([ConversationContext, Schema.Null])),
208
209
  metadata: Schema.optionalKey(Schema.Union([JsonObject, Schema.Null])),
209
210
  isTest: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
210
211
  isInternal: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
@@ -313,7 +314,7 @@ var ConversationsGroup = class extends HttpApiGroup.make("Conversations").add(Ht
313
314
  ConversationsList500,
314
315
  ConversationsList504.pipe(HttpApiSchema.status(504))
315
316
  ]
316
- }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "conversations.list").annotate(OpenApi.Summary, "List conversations").annotate(OpenApi.Description, "Returns conversation summaries, most recently active first, filterable by status, channel, contact, and creation time (`after`, `before`). Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. A conversation that gains activity while you page moves ahead of the cursor, so a walk lists each conversation at most once. Read a conversation's contacts, metadata, and resolution with `GET /v1/conversations/{id}`."), HttpApiEndpoint.post("conversationsCreate", "/v1/conversations", {
317
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "conversations.list").annotate(OpenApi.Summary, "List conversations").annotate(OpenApi.Description, "Returns conversation summaries, most recently active first, filterable by status, channel, contact, mailbox, and creation time (`after`, `before`). Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. A conversation that gains activity while you page moves ahead of the cursor, so a walk lists each conversation at most once. Read a conversation's contacts, metadata, and resolution with `GET /v1/conversations/{id}`."), HttpApiEndpoint.post("conversationsCreate", "/v1/conversations", {
317
318
  payload: ConversationsCreateRequestJson,
318
319
  success: ConversationsCreate201.pipe(HttpApiSchema.status(201)),
319
320
  error: [
@@ -455,7 +456,6 @@ var ConversationsGroup = class extends HttpApiGroup.make("Conversations").add(Ht
455
456
  ConversationsRemoveTags504.pipe(HttpApiSchema.status(504))
456
457
  ]
457
458
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "conversations.removeTags").annotate(OpenApi.Summary, "Remove conversation tags").annotate(OpenApi.Description, "Removes the given tags from the conversation and returns the conversation. A tag the conversation does not have is ignored.")).annotate(OpenApi.Description, "Create, update, and list conversations with your contacts.") {};
458
- //#endregion
459
459
  export { Conversation, ConversationContact, ConversationContext, ConversationPage, ConversationSummary, ConversationsAddCategories200, ConversationsAddCategories401, ConversationsAddCategories403, ConversationsAddCategories404, ConversationsAddCategories422, ConversationsAddCategories500, ConversationsAddCategories504, ConversationsAddCategoriesPathParams, ConversationsAddCategoriesRequestJson, ConversationsAddChannels200, ConversationsAddChannels401, ConversationsAddChannels403, ConversationsAddChannels404, ConversationsAddChannels422, ConversationsAddChannels500, ConversationsAddChannels504, ConversationsAddChannelsPathParams, ConversationsAddChannelsRequestJson, ConversationsAddContacts200, ConversationsAddContacts401, ConversationsAddContacts403, ConversationsAddContacts404, ConversationsAddContacts422, ConversationsAddContacts500, ConversationsAddContacts504, ConversationsAddContactsPathParams, ConversationsAddContactsRequestJson, ConversationsAddTags200, ConversationsAddTags401, ConversationsAddTags403, ConversationsAddTags404, ConversationsAddTags422, ConversationsAddTags500, ConversationsAddTags504, ConversationsAddTagsPathParams, ConversationsAddTagsRequestJson, ConversationsCreate201, ConversationsCreate401, ConversationsCreate403, ConversationsCreate422, ConversationsCreate500, ConversationsCreate504, ConversationsCreateRequestJson, ConversationsGetById200, ConversationsGetById401, ConversationsGetById403, ConversationsGetById404, ConversationsGetById422, ConversationsGetById500, ConversationsGetById504, ConversationsGetByIdPathParams, ConversationsGroup, ConversationsList200, ConversationsList401, ConversationsList403, ConversationsList422, ConversationsList500, ConversationsList504, ConversationsListMessages200, ConversationsListMessages401, ConversationsListMessages403, ConversationsListMessages404, ConversationsListMessages422, ConversationsListMessages500, ConversationsListMessages504, ConversationsListMessagesPathParams, ConversationsListMessagesQuery, ConversationsListQuery, ConversationsRemoveCategories200, ConversationsRemoveCategories401, ConversationsRemoveCategories403, ConversationsRemoveCategories404, ConversationsRemoveCategories422, ConversationsRemoveCategories500, ConversationsRemoveCategories504, ConversationsRemoveCategoriesPathParams, ConversationsRemoveCategoriesRequestJson, ConversationsRemoveChannels200, ConversationsRemoveChannels401, ConversationsRemoveChannels403, ConversationsRemoveChannels404, ConversationsRemoveChannels422, ConversationsRemoveChannels500, ConversationsRemoveChannels504, ConversationsRemoveChannelsPathParams, ConversationsRemoveChannelsRequestJson, ConversationsRemoveContacts200, ConversationsRemoveContacts401, ConversationsRemoveContacts403, ConversationsRemoveContacts404, ConversationsRemoveContacts422, ConversationsRemoveContacts500, ConversationsRemoveContacts504, ConversationsRemoveContactsPathParams, ConversationsRemoveContactsRequestJson, ConversationsRemoveTags200, ConversationsRemoveTags401, ConversationsRemoveTags403, ConversationsRemoveTags404, ConversationsRemoveTags422, ConversationsRemoveTags500, ConversationsRemoveTags504, ConversationsRemoveTagsPathParams, ConversationsRemoveTagsRequestJson, ConversationsUpdate200, ConversationsUpdate401, ConversationsUpdate403, ConversationsUpdate404, ConversationsUpdate422, ConversationsUpdate500, ConversationsUpdate504, ConversationsUpdatePathParams, ConversationsUpdateRequestJson, UnknownRecord };
460
460
 
461
461
  //# sourceMappingURL=conversations.js.map
@@ -65,7 +65,7 @@ export type CustomFieldsCreateRequestJson = {
65
65
  readonly label: string;
66
66
  readonly type: "text" | "number" | "boolean" | "date" | "select";
67
67
  readonly options?: ReadonlyArray<string> | null;
68
- readonly defaultValue?: string | null | null;
68
+ readonly defaultValue?: string | null;
69
69
  readonly isRequired?: boolean | null;
70
70
  readonly sortOrder?: number | null;
71
71
  };
@@ -74,7 +74,7 @@ export declare const CustomFieldsCreateRequestJson: Schema.Struct<{
74
74
  readonly label: Schema.String;
75
75
  readonly type: Schema.Union<readonly [Schema.Literal<"text">, Schema.Literal<"number">, Schema.Literal<"boolean">, Schema.Literal<"date">, Schema.Literal<"select">]>;
76
76
  readonly options: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
77
- readonly defaultValue: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
77
+ readonly defaultValue: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
78
78
  readonly isRequired: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
79
79
  readonly sortOrder: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
80
80
  }>;
@@ -149,14 +149,14 @@ export declare const CustomFieldsUpdatePathParams: Schema.Struct<{
149
149
  export type CustomFieldsUpdateRequestJson = {
150
150
  readonly label?: string | null;
151
151
  readonly options?: ReadonlyArray<string> | null;
152
- readonly defaultValue?: string | null | null;
152
+ readonly defaultValue?: string | null;
153
153
  readonly isRequired?: boolean | null;
154
154
  readonly sortOrder?: number | null;
155
155
  };
156
156
  export declare const CustomFieldsUpdateRequestJson: Schema.Struct<{
157
157
  readonly label: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
158
158
  readonly options: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
159
- readonly defaultValue: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
159
+ readonly defaultValue: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
160
160
  readonly isRequired: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
161
161
  readonly sortOrder: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
162
162
  }>;
@@ -203,7 +203,7 @@ declare const CustomFieldsGroup_base: HttpApiGroup.HttpApiGroup<"Custom Fields",
203
203
  readonly label: Schema.String;
204
204
  readonly type: Schema.Union<readonly [Schema.Literal<"text">, Schema.Literal<"number">, Schema.Literal<"boolean">, Schema.Literal<"date">, Schema.Literal<"select">]>;
205
205
  readonly options: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
206
- readonly defaultValue: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
206
+ readonly defaultValue: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
207
207
  readonly isRequired: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
208
208
  readonly sortOrder: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
209
209
  }>>, never, Schema.toCodecJson<Schema.Struct<{
@@ -461,7 +461,7 @@ declare const CustomFieldsGroup_base: HttpApiGroup.HttpApiGroup<"Custom Fields",
461
461
  }>>, never, Schema.toCodecJson<Schema.Struct<{
462
462
  readonly label: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
463
463
  readonly options: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Null]>>;
464
- readonly defaultValue: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Null]>, Schema.Null]>>;
464
+ readonly defaultValue: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
465
465
  readonly isRequired: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
466
466
  readonly sortOrder: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Null]>>;
467
467
  }>>, never, Schema.toCodecJson<Schema.Struct<{
@@ -1,7 +1,7 @@
1
1
  import { ApiKeySecurityMiddleware, ConflictError, ForbiddenError, GatewayTimeoutError, InternalError, OrganizationId, ResourceNotFoundError, 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
- //#region src/effect/generated/custom-fields.ts
4
+ // src/effect/generated/custom-fields.ts
5
5
  const CustomFieldDefinitionId = /* @__PURE__ */ (() => Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^cfield_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
6
6
  expected: "a string matching the RegExp ^cfield_[0-9a-hjkmnp-tv-z]{16,24}$",
7
7
  identifier: "CustomFieldDefinitionId"
@@ -42,7 +42,7 @@ const CustomFieldsCreateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
42
42
  Schema.Literal("select")
43
43
  ]),
44
44
  options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
45
- defaultValue: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
45
+ defaultValue: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
46
46
  isRequired: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
47
47
  sortOrder: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })), Schema.Null]))
48
48
  }))();
@@ -83,7 +83,7 @@ const CustomFieldsUpdatePathParams = /* @__PURE__ */ (() => Schema.Struct({ id:
83
83
  const CustomFieldsUpdateRequestJson = /* @__PURE__ */ (() => Schema.Struct({
84
84
  label: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
85
85
  options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
86
- defaultValue: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
86
+ defaultValue: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
87
87
  isRequired: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])),
88
88
  sortOrder: Schema.optionalKey(Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })), Schema.Null]))
89
89
  }))();
@@ -156,7 +156,6 @@ var CustomFieldsGroup = class extends HttpApiGroup.make("Custom Fields").add(Htt
156
156
  CustomFieldsUpdate504.pipe(HttpApiSchema.status(504))
157
157
  ]
158
158
  }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "customFields.update").annotate(OpenApi.Summary, "Update a custom field").annotate(OpenApi.Description, "Updates an existing custom field definition and returns the updated field.")).annotate(OpenApi.Description, "Custom field definitions for contact metadata") {};
159
- //#endregion
160
159
  export { CustomFieldDefinitionId, CustomFieldList, CustomFieldsCreate201, CustomFieldsCreate401, CustomFieldsCreate403, CustomFieldsCreate409, CustomFieldsCreate422, CustomFieldsCreate500, CustomFieldsCreate504, CustomFieldsCreateRequestJson, CustomFieldsGroup, CustomFieldsList200, CustomFieldsList401, CustomFieldsList403, CustomFieldsList422, CustomFieldsList500, CustomFieldsList504, CustomFieldsRemove200, CustomFieldsRemove401, CustomFieldsRemove403, CustomFieldsRemove404, CustomFieldsRemove422, CustomFieldsRemove500, CustomFieldsRemove504, CustomFieldsRemovePathParams, CustomFieldsUpdate200, CustomFieldsUpdate401, CustomFieldsUpdate403, CustomFieldsUpdate404, CustomFieldsUpdate422, CustomFieldsUpdate500, CustomFieldsUpdate504, CustomFieldsUpdatePathParams, CustomFieldsUpdateRequestJson };
161
160
 
162
161
  //# sourceMappingURL=custom-fields.js.map