samva 0.15.0 → 0.16.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 (52) hide show
  1. package/README.md +2 -0
  2. package/dist/{categories-BGUBFdH9.js → categories-DV51kr2H.js} +5 -1
  3. package/dist/client/sdk.gen.d.ts +61 -47
  4. package/dist/client/types.gen.d.ts +265 -207
  5. package/dist/{client-CDg7zJs0.js → client-BMUew5Wp.js} +300 -232
  6. package/dist/effect/analytics.js +1 -1
  7. package/dist/effect/api-keys.d.ts +1 -0
  8. package/dist/effect/api-keys.js +5 -2
  9. package/dist/effect/attachments.js +1 -1
  10. package/dist/effect/brands.js +2 -2
  11. package/dist/effect/campaigns.js +1 -1
  12. package/dist/effect/categories.js +1 -1
  13. package/dist/effect/client.js +1 -1
  14. package/dist/effect/contact-groups.js +1 -1
  15. package/dist/effect/contacts.js +1 -1
  16. package/dist/effect/conversations.js +1 -1
  17. package/dist/effect/custom-fields.js +1 -1
  18. package/dist/effect/email.d.ts +0 -18
  19. package/dist/effect/email.js +3 -7
  20. package/dist/effect/extension-installations.js +1 -1
  21. package/dist/effect/extensions.js +1 -1
  22. package/dist/effect/feedback.js +2 -2
  23. package/dist/effect/generated-metadata.d.ts +4 -0
  24. package/dist/effect/generated.d.ts +1586 -1641
  25. package/dist/effect/index.d.ts +2 -1
  26. package/dist/effect/index.js +6 -5
  27. package/dist/effect/mailboxes.d.ts +144 -94
  28. package/dist/effect/mailboxes.js +2 -2
  29. package/dist/effect/media.js +1 -1
  30. package/dist/effect/messages.js +1 -1
  31. package/dist/effect/namespaces.js +1 -1
  32. package/dist/effect/operations.js +1 -1
  33. package/dist/effect/organizations.js +1 -1
  34. package/dist/effect/retry.js +1 -1
  35. package/dist/effect/scheduled-messages.js +1 -1
  36. package/dist/effect/subscriptions.js +1 -1
  37. package/dist/effect/templates.js +2 -2
  38. package/dist/effect/unsubscribe-groups.js +1 -1
  39. package/dist/effect/webhooks.js +2 -2
  40. package/dist/effect/whoami.d.ts +46 -0
  41. package/dist/effect/whoami.js +9 -0
  42. package/dist/index.js +3 -3
  43. package/dist/{inline-attachments-UxLeyytJ.js → inline-attachments-Cegg6tTF.js} +2 -2
  44. package/dist/{mailboxes-BH_JPmOE.js → mailboxes-Thp5z0oX.js} +10 -8
  45. package/dist/{operation-BZ5Xov-x.js → operation-BTXjPrwf.js} +13 -15
  46. package/dist/promises/errors.gen.d.ts +12 -2
  47. package/dist/promises/index.d.ts +3 -1
  48. package/dist/promises/index.js +3 -3
  49. package/dist/promises/types.gen.d.ts +1 -1
  50. package/dist/{promises-Cd6Jamqk.js → promises-KrA2nSLg.js} +174 -88
  51. package/dist/service-map.d.ts +16 -15
  52. package/package.json +6 -2
@@ -1,4 +1,4 @@
1
- import { a as withUploadedAttachments, n as mediaCreateBody, o as CLIENT_ATTRIBUTION_HEADER, r as planInlineUploads, s as clientAttribution, t as MediaUploadError } from "./inline-attachments-UxLeyytJ.js";
1
+ import { a as withUploadedAttachments, n as mediaCreateBody, o as CLIENT_ATTRIBUTION_HEADER, r as planInlineUploads, s as clientAttribution, t as MediaUploadError } from "./inline-attachments-Cegg6tTF.js";
2
2
  import { t as MailboxEventStream } from "./mailbox-events-VKR4f3qq.js";
3
3
  import { n as buildMessagesSendPayload, r as replyToEmailsPayload, t as buildEmailSendPayload } from "./normalize-B79uJIeb.js";
4
4
  //#region src/client/core/bodySerializer.gen.ts
@@ -740,13 +740,44 @@ var Messages = class {
740
740
  * Sends a message on the requested channel and returns its receipt (id, status, and why it waits when it does) with a 201 Created status. Requires `messages:create` or the send permission of the channel it sends on, such as `email:send`. `channel` selects the payload variant. Repeating an identical request with the same optional `Idempotency-Key` header returns the original receipt; reusing the key for different content returns a conflict.
741
741
  */
742
742
  static send(parameters, options) {
743
- const params = buildClientParams([parameters], [{ args: [{
744
- in: "headers",
745
- key: "idempotency-key"
746
- }, {
747
- key: "emailSendMessagePayload",
748
- map: "body"
749
- }] }]);
743
+ const params = buildClientParams([parameters], [{ args: [
744
+ {
745
+ in: "headers",
746
+ key: "idempotency-key"
747
+ },
748
+ {
749
+ in: "body",
750
+ key: "conversationId"
751
+ },
752
+ {
753
+ in: "body",
754
+ key: "metadata"
755
+ },
756
+ {
757
+ in: "body",
758
+ key: "channel"
759
+ },
760
+ {
761
+ in: "body",
762
+ key: "to"
763
+ },
764
+ {
765
+ in: "body",
766
+ key: "cc"
767
+ },
768
+ {
769
+ in: "body",
770
+ key: "bcc"
771
+ },
772
+ {
773
+ in: "body",
774
+ key: "from"
775
+ },
776
+ {
777
+ in: "body",
778
+ key: "email"
779
+ }
780
+ ] }]);
750
781
  return (options?.client ?? client).post({
751
782
  security: [{
752
783
  name: "x-api-key",
@@ -2066,7 +2097,7 @@ var Email = class {
2066
2097
  /**
2067
2098
  * Set the default sending domain
2068
2099
  *
2069
- * Marks a verified domain as the organization's default sending domain, atomically clearing any previous default. Omitted-`from` sends resolve through the default domain's default sender.
2100
+ * Marks a verified domain as the organization's default sending domain, atomically clearing any previous default. Provisioning and inbound routing prefer the default domain when several apply. It does not choose the `from` of omitted-`from` sends; those use the organization default sender.
2070
2101
  */
2071
2102
  static setDefaultDomain(parameters, options) {
2072
2103
  const params = buildClientParams([parameters], [{ args: [{
@@ -2084,54 +2115,6 @@ var Email = class {
2084
2115
  });
2085
2116
  }
2086
2117
  /**
2087
- * Clear a domain's default sender
2088
- *
2089
- * Removes the domain's default sender so omitted-`from` sends fall through to the organization default sender.
2090
- */
2091
- static clearDomainDefaultSender(parameters, options) {
2092
- const params = buildClientParams([parameters], [{ args: [{
2093
- in: "path",
2094
- key: "id"
2095
- }] }]);
2096
- return (options?.client ?? client).delete({
2097
- security: [{
2098
- name: "x-api-key",
2099
- type: "apiKey"
2100
- }],
2101
- url: "/v1/email/domains/{id}/default-sender",
2102
- ...options,
2103
- ...params
2104
- });
2105
- }
2106
- /**
2107
- * Set a domain's default sender
2108
- *
2109
- * Sets the default sender used for omitted-`from` sends from this domain. The sender must belong to the domain and be verified and active.
2110
- */
2111
- static setDomainDefaultSender(parameters, options) {
2112
- const params = buildClientParams([parameters], [{ args: [{
2113
- in: "path",
2114
- key: "id"
2115
- }, {
2116
- in: "body",
2117
- key: "senderId"
2118
- }] }]);
2119
- return (options?.client ?? client).put({
2120
- security: [{
2121
- name: "x-api-key",
2122
- type: "apiKey"
2123
- }],
2124
- url: "/v1/email/domains/{id}/default-sender",
2125
- ...options,
2126
- ...params,
2127
- headers: {
2128
- "Content-Type": "application/json",
2129
- ...options?.headers,
2130
- ...params.headers
2131
- }
2132
- });
2133
- }
2134
- /**
2135
2118
  * Update a domain's send-settings config
2136
2119
  *
2137
2120
  * Overrides the domain's open/click tracking, reply-to, unsubscribe-group defaults, and the brand its mail uses for the settings cascade. An omitted field is left unchanged; null clears it back to the organization default. Returns the saved config.
@@ -2493,7 +2476,7 @@ var Email = class {
2493
2476
  /**
2494
2477
  * Set the organization default sender
2495
2478
  *
2496
- * Marks a verified, active sender as the organization default, atomically clearing any previous default. Used for omitted-`from` sends when no default domain sender applies.
2479
+ * Marks a verified, active sender as the organization default, atomically clearing any previous default. Omitted-`from` sends use it when neither the request nor the template names a `from`; with no default, the organization's sole verified sender is used.
2497
2480
  */
2498
2481
  static setDefaultSender(parameters, options) {
2499
2482
  const params = buildClientParams([parameters], [{ args: [{
@@ -7667,11 +7650,28 @@ var Feedback = class {
7667
7650
  });
7668
7651
  }
7669
7652
  };
7653
+ var Whoami = class {
7654
+ /**
7655
+ * Get the calling credential
7656
+ *
7657
+ * 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.
7658
+ */
7659
+ static get(options) {
7660
+ return (options?.client ?? client).get({
7661
+ security: [{
7662
+ name: "x-api-key",
7663
+ type: "apiKey"
7664
+ }],
7665
+ url: "/v1/whoami",
7666
+ ...options
7667
+ });
7668
+ }
7669
+ };
7670
7670
  var Mailboxes = class {
7671
7671
  /**
7672
7672
  * List mailboxes
7673
7673
  *
7674
- * Returns summaries of the mailboxes the caller can read, newest first, filterable by creation time (`after`, `before`). Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. Read a mailbox's addresses and metadata with `GET /v1/mailboxes/{id}`.
7674
+ * Returns summaries of the mailboxes the caller can read, newest first, filterable by creation time (`after`, `before`). Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. Read a mailbox's endpoints and metadata with `GET /v1/mailboxes/{id}`.
7675
7675
  */
7676
7676
  static list(parameters, options) {
7677
7677
  const params = buildClientParams([parameters], [{ args: [
@@ -7705,7 +7705,7 @@ var Mailboxes = class {
7705
7705
  /**
7706
7706
  * Create a mailbox
7707
7707
  *
7708
- * Creates a mailbox with one address and returns it with status 201; the caller gets an admin grant on it. The address must be under the organization's Samva-hosted mail domain or a verified domain with receiving enabled, and the mailbox sends from it. The slug defaults to the address's local part. Pass `slug` when that is taken or not a valid slug. The mailbox receives mail from now on; mail that arrived earlier is not added to it. Conflicts if the address or slug is already in use. Returns 402 when the organization is at its plan's mailbox allowance or at its mailbox storage allowance; incoming mail is still received past the storage allowance.
7708
+ * Creates a mailbox with one endpoint and returns it with status 201; the caller gets an admin grant on it. Email is the channel a mailbox endpoint uses today; another channel is refused (422). An email endpoint's address must be under the organization's Samva-hosted mail domain or a verified domain with receiving enabled, and the mailbox sends from it. The slug defaults to the address's local part. Pass `slug` when that is taken or not a valid slug. The mailbox receives mail from now on; mail that arrived earlier is not added to it. Conflicts if the address or slug is already in use. Returns 402 when the organization is at its plan's mailbox allowance or at its mailbox storage allowance; incoming mail is still received past the storage allowance.
7709
7709
  */
7710
7710
  static create(parameters, options) {
7711
7711
  const params = buildClientParams([parameters], [{ args: [
@@ -7715,7 +7715,7 @@ var Mailboxes = class {
7715
7715
  },
7716
7716
  {
7717
7717
  in: "body",
7718
- key: "address"
7718
+ key: "endpoint"
7719
7719
  },
7720
7720
  {
7721
7721
  in: "body",
@@ -7748,7 +7748,7 @@ var Mailboxes = class {
7748
7748
  /**
7749
7749
  * Delete a mailbox
7750
7750
  *
7751
- * Deletes a mailbox with its addresses, threads, drafts, and history. The messages it received stay with the organization. The mailbox leaves every API key scope and webhook endpoint filter that named it; a key or endpoint left with no mailbox is disabled.
7751
+ * Deletes a mailbox with its endpoints, threads, drafts, and history. The messages it received stay with the organization. The mailbox leaves every API key scope and webhook endpoint filter that named it; a key or endpoint left with no mailbox is disabled.
7752
7752
  */
7753
7753
  static remove(parameters, options) {
7754
7754
  const params = buildClientParams([parameters], [{ args: [{
@@ -7768,7 +7768,7 @@ var Mailboxes = class {
7768
7768
  /**
7769
7769
  * Get a mailbox
7770
7770
  *
7771
- * Returns a mailbox with its addresses, metadata, and the identity it sends from. Its grants are `GET /v1/mailboxes/{id}/grants` and its send policies `GET /v1/mailboxes/{id}/policies`.
7771
+ * Returns a mailbox with its endpoints and metadata; each endpoint says whether it is the mailbox's default on its channel. Its grants are `GET /v1/mailboxes/{id}/grants` and its send policies `GET /v1/mailboxes/{id}/policies`.
7772
7772
  */
7773
7773
  static get(parameters, options) {
7774
7774
  const params = buildClientParams([parameters], [{ args: [{
@@ -7788,7 +7788,7 @@ var Mailboxes = class {
7788
7788
  /**
7789
7789
  * Update a mailbox
7790
7790
  *
7791
- * Updates the fields you name and keeps the rest. `metadata` merges into the stored metadata by key, and a `null` value deletes that key. `defaultFrom` must be one of the mailbox's addresses.
7791
+ * Updates the fields you name and keeps the rest. `metadata` merges into the stored metadata by key, and a `null` value deletes that key. Change an endpoint's sender name or default with `PATCH /v1/mailboxes/{id}/endpoints/{endpointId}`.
7792
7792
  */
7793
7793
  static update(parameters, options) {
7794
7794
  const params = buildClientParams([parameters], [{ args: [
@@ -7803,10 +7803,6 @@ var Mailboxes = class {
7803
7803
  {
7804
7804
  in: "body",
7805
7805
  key: "metadata"
7806
- },
7807
- {
7808
- in: "body",
7809
- key: "defaultFrom"
7810
7806
  }
7811
7807
  ] }]);
7812
7808
  return (options?.client ?? client).patch({
@@ -7825,16 +7821,20 @@ var Mailboxes = class {
7825
7821
  });
7826
7822
  }
7827
7823
  /**
7828
- * Add an address to a mailbox
7824
+ * Add an endpoint to a mailbox
7829
7825
  *
7830
- * Adds an address to a mailbox and returns the mailbox with status 201. The address follows the same rules as the address of a new mailbox: it must be under the organization's Samva-hosted mail domain or a verified domain with receiving enabled, and no mailbox may already hold it (409). Mail sent to it reaches the mailbox from now on; the mailbox keeps sending from its current default address until you change `defaultFrom`.
7826
+ * Adds an endpoint to a mailbox and returns the mailbox with status 201. It follows the same rules as the endpoint of a new mailbox: email is the channel a mailbox endpoint uses today (422 otherwise), the address must be under the organization's Samva-hosted mail domain or a verified domain with receiving enabled, and no mailbox may already hold it (409). Messages sent to it reach the mailbox from now on. It becomes the default on its channel only when the mailbox has no endpoint there yet.
7831
7827
  */
7832
- static createAddress(parameters, options) {
7828
+ static createEndpoint(parameters, options) {
7833
7829
  const params = buildClientParams([parameters], [{ args: [
7834
7830
  {
7835
7831
  in: "path",
7836
7832
  key: "id"
7837
7833
  },
7834
+ {
7835
+ in: "body",
7836
+ key: "channel"
7837
+ },
7838
7838
  {
7839
7839
  in: "body",
7840
7840
  key: "address"
@@ -7849,7 +7849,7 @@ var Mailboxes = class {
7849
7849
  name: "x-api-key",
7850
7850
  type: "apiKey"
7851
7851
  }],
7852
- url: "/v1/mailboxes/{id}/addresses",
7852
+ url: "/v1/mailboxes/{id}/endpoints",
7853
7853
  ...options,
7854
7854
  ...params,
7855
7855
  headers: {
@@ -7860,29 +7860,68 @@ var Mailboxes = class {
7860
7860
  });
7861
7861
  }
7862
7862
  /**
7863
- * Remove an address from a mailbox
7863
+ * Remove an endpoint from a mailbox
7864
7864
  *
7865
- * Removes an address from a mailbox and returns the mailbox. Mail sent to the address stops reaching the mailbox; its existing threads and messages stay. A mailbox keeps at least one address, so removing the last one is refused (422). When the removed address was the default `From`, the mailbox sends from its oldest remaining address, without a sender name of its own.
7865
+ * Removes an endpoint from a mailbox and returns the mailbox. Messages sent to it stop reaching the mailbox; its existing threads and messages stay, and replies in them leave from the mailbox's default endpoint on their channel. A mailbox keeps at least one endpoint, so removing the last one is refused (422). When the removed endpoint was the default on its channel, the oldest remaining endpoint there becomes the default.
7866
7866
  */
7867
- static removeAddress(parameters, options) {
7867
+ static removeEndpoint(parameters, options) {
7868
7868
  const params = buildClientParams([parameters], [{ args: [{
7869
7869
  in: "path",
7870
7870
  key: "id"
7871
7871
  }, {
7872
7872
  in: "path",
7873
- key: "addressId"
7873
+ key: "endpointId"
7874
7874
  }] }]);
7875
7875
  return (options?.client ?? client).delete({
7876
7876
  security: [{
7877
7877
  name: "x-api-key",
7878
7878
  type: "apiKey"
7879
7879
  }],
7880
- url: "/v1/mailboxes/{id}/addresses/{addressId}",
7880
+ url: "/v1/mailboxes/{id}/endpoints/{endpointId}",
7881
7881
  ...options,
7882
7882
  ...params
7883
7883
  });
7884
7884
  }
7885
7885
  /**
7886
+ * Update a mailbox endpoint
7887
+ *
7888
+ * Updates the fields you name and keeps the rest, and returns the mailbox. `displayName` is the name messages sent from the endpoint carry; null falls back to the mailbox's name. `default: true` makes the endpoint the one the mailbox starts new conversations from on its channel; replies always leave from the endpoint of their thread.
7889
+ */
7890
+ static updateEndpoint(parameters, options) {
7891
+ const params = buildClientParams([parameters], [{ args: [
7892
+ {
7893
+ in: "path",
7894
+ key: "id"
7895
+ },
7896
+ {
7897
+ in: "path",
7898
+ key: "endpointId"
7899
+ },
7900
+ {
7901
+ in: "body",
7902
+ key: "displayName"
7903
+ },
7904
+ {
7905
+ in: "body",
7906
+ key: "default"
7907
+ }
7908
+ ] }]);
7909
+ return (options?.client ?? client).patch({
7910
+ security: [{
7911
+ name: "x-api-key",
7912
+ type: "apiKey"
7913
+ }],
7914
+ url: "/v1/mailboxes/{id}/endpoints/{endpointId}",
7915
+ ...options,
7916
+ ...params,
7917
+ headers: {
7918
+ "Content-Type": "application/json",
7919
+ ...options?.headers,
7920
+ ...params.headers
7921
+ }
7922
+ });
7923
+ }
7924
+ /**
7886
7925
  * Pause a mailbox
7887
7926
  *
7888
7927
  * Stops the mailbox sending and stops new inbound mail reaching it. Mail that arrives while it is paused is not added when it resumes. Resume it with `POST /v1/mailboxes/{id}/resume`.
@@ -8811,7 +8850,7 @@ var Mailboxes = class {
8811
8850
  /**
8812
8851
  * Send a new message
8813
8852
  *
8814
- * Records a send action and returns 202 with its current receipt and a Location for action status. An installation, grant, or policy may require approval; otherwise the send is queued. Observe the same action through acceptance and mailbox completion. A policy refusal returns 403 with the recorded receipt.
8853
+ * Starts a new conversation from the mailbox's default endpoint on the channel the body names (email when omitted); a channel the mailbox cannot send on yet is refused (422). Records a send action and returns 202 with its current receipt and a Location for action status. An installation, grant, or policy may require approval; otherwise the send is queued. Observe the same action through acceptance and mailbox completion. A policy refusal returns 403 with the recorded receipt.
8815
8854
  */
8816
8855
  static sendMessage(parameters, options) {
8817
8856
  const params = buildClientParams([parameters], [{ args: [
@@ -8823,6 +8862,10 @@ var Mailboxes = class {
8823
8862
  in: "path",
8824
8863
  key: "id"
8825
8864
  },
8865
+ {
8866
+ in: "body",
8867
+ key: "channel"
8868
+ },
8826
8869
  {
8827
8870
  in: "body",
8828
8871
  key: "to"
@@ -8874,7 +8917,7 @@ var Mailboxes = class {
8874
8917
  /**
8875
8918
  * Get a mailbox message
8876
8919
  *
8877
- * Returns a message in the mailbox with its text, sanitized HTML, `replyText` (what the sender wrote, without quoted history), authentication verdicts, and attachments.
8920
+ * Returns a message in the mailbox, discriminated by `channel`. An email has its text, sanitized HTML, `replyText` (what the sender wrote, without quoted history), authentication verdicts, and attachments.
8878
8921
  */
8879
8922
  static getMessage(parameters, options) {
8880
8923
  const params = buildClientParams([parameters], [{ args: [{
@@ -8980,7 +9023,7 @@ var Mailboxes = class {
8980
9023
  /**
8981
9024
  * Reply to a message
8982
9025
  *
8983
- * Replies to the message's Reply-To address, or its sender, in the same thread. The server sets the recipients, subject, and threading headers.
9026
+ * Replies to the message's Reply-To address, or its sender, in the same thread and from the thread's endpoint. The server sets the recipients, subject, and threading headers. The body's `channel` must match the thread's.
8984
9027
  */
8985
9028
  static reply(parameters, options) {
8986
9029
  const params = buildClientParams([parameters], [{ args: [
@@ -8996,6 +9039,10 @@ var Mailboxes = class {
8996
9039
  in: "path",
8997
9040
  key: "messageId"
8998
9041
  },
9042
+ {
9043
+ in: "body",
9044
+ key: "channel"
9045
+ },
8999
9046
  {
9000
9047
  in: "body",
9001
9048
  key: "cc"
@@ -9035,7 +9082,7 @@ var Mailboxes = class {
9035
9082
  /**
9036
9083
  * Reply to all recipients of a message
9037
9084
  *
9038
- * Replies to the sender and every other recipient of the message except the mailbox itself, in the same thread.
9085
+ * Replies to the sender and every other recipient of the message except the mailbox itself, in the same thread and from the thread's endpoint.
9039
9086
  */
9040
9087
  static replyAll(parameters, options) {
9041
9088
  const params = buildClientParams([parameters], [{ args: [
@@ -9051,6 +9098,10 @@ var Mailboxes = class {
9051
9098
  in: "path",
9052
9099
  key: "messageId"
9053
9100
  },
9101
+ {
9102
+ in: "body",
9103
+ key: "channel"
9104
+ },
9054
9105
  {
9055
9106
  in: "body",
9056
9107
  key: "cc"
@@ -9090,7 +9141,7 @@ var Mailboxes = class {
9090
9141
  /**
9091
9142
  * Forward a message
9092
9143
  *
9093
- * Forwards the message to new recipients as a new conversation, with the original quoted below the caller's text and its attachments attached ahead of any the caller adds. The combined attachments must fit the email attachment limits.
9144
+ * Forwards an email to new recipients as a new conversation from the thread's endpoint, with the original quoted below the caller's text and its attachments attached ahead of any the caller adds. The combined attachments must fit the email attachment limits.
9094
9145
  */
9095
9146
  static forward(parameters, options) {
9096
9147
  const params = buildClientParams([parameters], [{ args: [
@@ -9267,7 +9318,7 @@ var Mailboxes = class {
9267
9318
  /**
9268
9319
  * Create a draft
9269
9320
  *
9270
- * Saves a draft of a new message, or of a reply when `inReplyToMessageId` names a message in the mailbox, and returns it with status 201. Send it with `POST /v1/mailboxes/{id}/drafts/{draftId}/send`.
9321
+ * Saves a draft of a new message, or of a reply when `inReplyToMessageId` names a message in the mailbox, and returns it with status 201. Email drafts are the kind a mailbox saves today; another channel is refused (422). Send it with `POST /v1/mailboxes/{id}/drafts/{draftId}/send`.
9271
9322
  */
9272
9323
  static createDraft(parameters, options) {
9273
9324
  const params = buildClientParams([parameters], [{ args: [
@@ -9275,6 +9326,14 @@ var Mailboxes = class {
9275
9326
  in: "path",
9276
9327
  key: "id"
9277
9328
  },
9329
+ {
9330
+ in: "body",
9331
+ key: "channel"
9332
+ },
9333
+ {
9334
+ in: "body",
9335
+ key: "endpointId"
9336
+ },
9278
9337
  {
9279
9338
  in: "body",
9280
9339
  key: "to"
@@ -9642,7 +9701,7 @@ var Mailboxes = class {
9642
9701
  /**
9643
9702
  * List mailbox events
9644
9703
  *
9645
- * Returns mailbox audit records, newest first, filterable by when they happened (`after`, `before`). Audit event types: `mailbox.created`, `address.attached`, `address.detached`, `email.received`, `email.released`, `email.sent`, `thread.created`, `action.proposed`, `action.policy_decided`, `action.approval_requested`, `action.approval_resolved`, `action.accepted`, `action.executed`, `action.failed`. Thread and draft changes have no dedicated audit event types. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page.
9704
+ * Returns mailbox audit records, newest first, filterable by when they happened (`after`, `before`). Audit event types: `mailbox.created`, `endpoint.attached`, `endpoint.detached`, `message.received`, `message.released`, `message.sent`, `thread.created`, `action.proposed`, `action.policy_decided`, `action.approval_requested`, `action.approval_resolved`, `action.accepted`, `action.executed`, `action.failed`. Thread and draft changes have no dedicated audit event types. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page.
9646
9705
  */
9647
9706
  static listEvents(parameters, options) {
9648
9707
  const params = buildClientParams([parameters], [{ args: [
@@ -10323,6 +10382,13 @@ var InternalError = class extends SamvaApiError {
10323
10382
  Object.assign(this, payload);
10324
10383
  }
10325
10384
  };
10385
+ var MailboxChannelUnsupportedError = class extends SamvaApiError {
10386
+ _tag = "MailboxChannelUnsupportedError";
10387
+ constructor(payload, context = {}) {
10388
+ super(messageOf("MailboxChannelUnsupportedError", payload), context);
10389
+ Object.assign(this, payload);
10390
+ }
10391
+ };
10326
10392
  var MailboxSendConflictError = class extends SamvaApiError {
10327
10393
  _tag = "MailboxSendConflictError";
10328
10394
  constructor(payload, context = {}) {
@@ -10399,6 +10465,7 @@ const constructors = {
10399
10465
  ForbiddenError,
10400
10466
  GatewayTimeoutError,
10401
10467
  InternalError,
10468
+ MailboxChannelUnsupportedError,
10402
10469
  MailboxSendConflictError,
10403
10470
  MailboxSendRefusedError,
10404
10471
  OnboardingReviewRequiredError,
@@ -10609,6 +10676,23 @@ const payloadSchemas = {
10609
10676
  "x-category": ["transient"],
10610
10677
  "x-retryable": true
10611
10678
  },
10679
+ MailboxChannelUnsupportedError: {
10680
+ type: "object",
10681
+ properties: {
10682
+ _tag: {
10683
+ type: "string",
10684
+ enum: ["MailboxChannelUnsupportedError"]
10685
+ },
10686
+ message: { type: "string" },
10687
+ channel: { type: "string" }
10688
+ },
10689
+ required: [
10690
+ "_tag",
10691
+ "message",
10692
+ "channel"
10693
+ ],
10694
+ additionalProperties: false
10695
+ },
10612
10696
  MailboxSendConflictError: {
10613
10697
  type: "object",
10614
10698
  properties: {
@@ -11625,7 +11709,7 @@ function createPromiseMessagesTransport(clientInstance) {
11625
11709
  const { idempotencyKey, requestOptions } = resolveIdempotencyKey(options);
11626
11710
  return sendWithUploads(clientInstance, buildMessagesSendPayload(input), requestOptions, (payload) => Messages.send({
11627
11711
  "idempotency-key": idempotencyKey,
11628
- emailSendMessagePayload: payload
11712
+ ...payload
11629
11713
  }, {
11630
11714
  ...requestOptions,
11631
11715
  client: clientInstance
@@ -11652,7 +11736,7 @@ function createPromiseEmailTransport(clientInstance) {
11652
11736
  const { idempotencyKey, requestOptions } = resolveIdempotencyKey(options);
11653
11737
  return sendWithUploads(clientInstance, buildEmailSendPayload(input), requestOptions, (payload) => Messages.send({
11654
11738
  "idempotency-key": idempotencyKey,
11655
- emailSendMessagePayload: payload
11739
+ ...payload
11656
11740
  }, {
11657
11741
  ...requestOptions,
11658
11742
  client: clientInstance
@@ -11747,6 +11831,7 @@ function createClient(config) {
11747
11831
  unsubscribeGroups: createBoundService(Unsubscribe, clientInstance),
11748
11832
  analytics: createBoundService(Analytics, clientInstance),
11749
11833
  feedback: createBoundService(Feedback, clientInstance),
11834
+ whoami: createBoundService(Whoami, clientInstance),
11750
11835
  mailboxes: createBoundService(Mailboxes, clientInstance),
11751
11836
  namespaces: createBoundService(Namespaces, clientInstance),
11752
11837
  extensions: createBoundService(Extensions, clientInstance),
@@ -11781,6 +11866,7 @@ function createClient(config) {
11781
11866
  unsubscribeGroups: createDirectService(raw.unsubscribeGroups),
11782
11867
  analytics: createDirectService(raw.analytics),
11783
11868
  feedback: createDirectService(raw.feedback),
11869
+ whoami: createDirectService(raw.whoami),
11784
11870
  mailboxes: Object.assign(createDirectService(raw.mailboxes), { events: (options) => new MailboxEventStream(streamConnection, options) }),
11785
11871
  namespaces: createDirectService(raw.namespaces),
11786
11872
  extensions: createDirectService(raw.extensions),
@@ -11788,6 +11874,6 @@ function createClient(config) {
11788
11874
  };
11789
11875
  }
11790
11876
  //#endregion
11791
- export { UnauthorizedError as C, SenderNotReadyError as S, fromApiError as T, PaymentRequiredError as _, CampaignFooterRequiredError as a, SamvaApiError as b, EmailChannelError as c, ForbiddenError as d, GatewayTimeoutError as f, OnboardingReviewRequiredError as g, MailboxSendRefusedError as h, BrandAddressRequiredError as i, ExternalServiceError as l, MailboxSendConflictError as m, AnalyticsQueryError as n, ConflictError as o, InternalError as p, BillingProviderError as r, DeliveryUnavailableError as s, createClient as t, FlagDisabledError as u, RateLimitedError as v, ValidationError as w, SamvaTransportError as x, ResourceNotFoundError as y };
11877
+ export { SenderNotReadyError as C, fromApiError as E, SamvaTransportError as S, ValidationError as T, OnboardingReviewRequiredError as _, CampaignFooterRequiredError as a, ResourceNotFoundError as b, EmailChannelError as c, ForbiddenError as d, GatewayTimeoutError as f, MailboxSendRefusedError as g, MailboxSendConflictError as h, BrandAddressRequiredError as i, ExternalServiceError as l, MailboxChannelUnsupportedError as m, AnalyticsQueryError as n, ConflictError as o, InternalError as p, BillingProviderError as r, DeliveryUnavailableError as s, createClient as t, FlagDisabledError as u, PaymentRequiredError as v, UnauthorizedError as w, SamvaApiError as x, RateLimitedError as y };
11792
11878
 
11793
- //# sourceMappingURL=promises-Cd6Jamqk.js.map
11879
+ //# sourceMappingURL=promises-KrA2nSLg.js.map
@@ -118,8 +118,6 @@ export declare const SDK_SERVICE_OPERATIONS: {
118
118
  readonly getDomainById: "emailGetDomainById";
119
119
  readonly removeDomain: "emailRemoveDomain";
120
120
  readonly setDefaultDomain: "emailSetDefaultDomain";
121
- readonly setDomainDefaultSender: "emailSetDomainDefaultSender";
122
- readonly clearDomainDefaultSender: "emailClearDomainDefaultSender";
123
121
  readonly updateDomainConfig: "emailUpdateDomainConfig";
124
122
  readonly detectRegistrar: "emailDetectRegistrar";
125
123
  readonly getDomainConnect: "emailGetDomainConnect";
@@ -263,6 +261,9 @@ export declare const SDK_SERVICE_OPERATIONS: {
263
261
  readonly removeEmails: "unsubscribeRemoveEmails";
264
262
  readonly checkSubscription: "unsubscribeCheckSubscription";
265
263
  };
264
+ readonly whoami: {
265
+ readonly get: "whoamiGet";
266
+ };
266
267
  readonly webhooks: {
267
268
  readonly list: "webhooksList";
268
269
  readonly create: "webhooksCreate";
@@ -281,8 +282,9 @@ export declare const SDK_SERVICE_OPERATIONS: {
281
282
  readonly get: "mailboxesGet";
282
283
  readonly update: "mailboxesUpdate";
283
284
  readonly remove: "mailboxesRemove";
284
- readonly createAddress: "mailboxesCreateAddress";
285
- readonly removeAddress: "mailboxesRemoveAddress";
285
+ readonly createEndpoint: "mailboxesCreateEndpoint";
286
+ readonly updateEndpoint: "mailboxesUpdateEndpoint";
287
+ readonly removeEndpoint: "mailboxesRemoveEndpoint";
286
288
  readonly pause: "mailboxesPause";
287
289
  readonly resume: "mailboxesResume";
288
290
  readonly getAgentActivity: "mailboxesGetAgentActivity";
@@ -568,14 +570,6 @@ export declare const SDK_OPERATION_CALLS: {
568
570
  readonly kind: "path";
569
571
  readonly paths: readonly ["id"];
570
572
  };
571
- readonly emailSetDomainDefaultSender: {
572
- readonly kind: "pathPayload";
573
- readonly paths: readonly ["id"];
574
- };
575
- readonly emailClearDomainDefaultSender: {
576
- readonly kind: "path";
577
- readonly paths: readonly ["id"];
578
- };
579
573
  readonly emailUpdateDomainConfig: {
580
574
  readonly kind: "pathPayload";
581
575
  readonly paths: readonly ["id"];
@@ -994,6 +988,9 @@ export declare const SDK_OPERATION_CALLS: {
994
988
  readonly kind: "path";
995
989
  readonly paths: readonly ["id", "inputContractId"];
996
990
  };
991
+ readonly whoamiGet: {
992
+ readonly kind: "none";
993
+ };
997
994
  readonly webhooksList: {
998
995
  readonly kind: "params";
999
996
  };
@@ -1224,13 +1221,17 @@ export declare const SDK_OPERATION_CALLS: {
1224
1221
  readonly kind: "path";
1225
1222
  readonly paths: readonly ["id"];
1226
1223
  };
1227
- readonly mailboxesCreateAddress: {
1224
+ readonly mailboxesCreateEndpoint: {
1228
1225
  readonly kind: "pathPayload";
1229
1226
  readonly paths: readonly ["id"];
1230
1227
  };
1231
- readonly mailboxesRemoveAddress: {
1228
+ readonly mailboxesUpdateEndpoint: {
1229
+ readonly kind: "pathPayload";
1230
+ readonly paths: readonly ["id", "endpointId"];
1231
+ };
1232
+ readonly mailboxesRemoveEndpoint: {
1232
1233
  readonly kind: "path";
1233
- readonly paths: readonly ["id", "addressId"];
1234
+ readonly paths: readonly ["id", "endpointId"];
1234
1235
  };
1235
1236
  readonly mailboxesPause: {
1236
1237
  readonly kind: "path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "samva",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "TypeScript SDK for the Samva email API",
5
5
  "keywords": [
6
6
  "api-client",
@@ -154,6 +154,10 @@
154
154
  "types": "./dist/effect/webhooks.d.ts",
155
155
  "import": "./dist/effect/webhooks.js"
156
156
  },
157
+ "./effect/whoami": {
158
+ "types": "./dist/effect/whoami.d.ts",
159
+ "import": "./dist/effect/whoami.js"
160
+ },
157
161
  "./webhooks": {
158
162
  "types": "./dist/webhooks/promise.d.ts",
159
163
  "import": "./dist/webhooks/promise.js"
@@ -182,7 +186,7 @@
182
186
  "typecheck": "tsc --noEmit && tsc --noEmit -p codegen/tsconfig.json && tsc --noEmit -p tests/tsconfig.json"
183
187
  },
184
188
  "dependencies": {
185
- "@samva/webhooks": "0.15.0"
189
+ "@samva/webhooks": "0.16.0"
186
190
  },
187
191
  "devDependencies": {
188
192
  "@effect/openapi-generator": "4.0.0",