samva 0.14.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 +6 -0
  2. package/dist/{categories-BGUBFdH9.js → categories-DV51kr2H.js} +5 -1
  3. package/dist/client/sdk.gen.d.ts +74 -45
  4. package/dist/client/types.gen.d.ts +356 -212
  5. package/dist/{client-CZjhOKPM.js → client-BMUew5Wp.js} +307 -198
  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 +1477 -1250
  25. package/dist/effect/index.d.ts +2 -1
  26. package/dist/effect/index.js +6 -5
  27. package/dist/effect/mailboxes.d.ts +191 -92
  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-BrNnSMF2.js → inline-attachments-Cegg6tTF.js} +2 -2
  44. package/dist/{mailboxes-DT02zP7q.js → mailboxes-Thp5z0oX.js} +10 -4
  45. package/dist/{operation-g8nAzmIM.js → operation-BTXjPrwf.js} +18 -12
  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-BFRKhpSS.js → promises-KrA2nSLg.js} +224 -84
  51. package/dist/service-map.d.ts +21 -10
  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-BrNnSMF2.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 its addresses and returns it with status 201; the caller gets an admin grant on it. Each address must be under the organization's Samva-hosted mail domain or a verified domain with receiving enabled. The mailbox receives mail from now on; mail that arrived earlier is not added to it. Conflicts if an 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,19 +7715,15 @@ var Mailboxes = class {
7715
7715
  },
7716
7716
  {
7717
7717
  in: "body",
7718
- key: "displayName"
7719
- },
7720
- {
7721
- in: "body",
7722
- key: "slug"
7718
+ key: "endpoint"
7723
7719
  },
7724
7720
  {
7725
7721
  in: "body",
7726
- key: "addresses"
7722
+ key: "name"
7727
7723
  },
7728
7724
  {
7729
7725
  in: "body",
7730
- key: "defaultFrom"
7726
+ key: "slug"
7731
7727
  },
7732
7728
  {
7733
7729
  in: "body",
@@ -7752,7 +7748,7 @@ var Mailboxes = class {
7752
7748
  /**
7753
7749
  * Delete a mailbox
7754
7750
  *
7755
- * 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.
7756
7752
  */
7757
7753
  static remove(parameters, options) {
7758
7754
  const params = buildClientParams([parameters], [{ args: [{
@@ -7772,7 +7768,7 @@ var Mailboxes = class {
7772
7768
  /**
7773
7769
  * Get a mailbox
7774
7770
  *
7775
- * 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`.
7776
7772
  */
7777
7773
  static get(parameters, options) {
7778
7774
  const params = buildClientParams([parameters], [{ args: [{
@@ -7792,7 +7788,7 @@ var Mailboxes = class {
7792
7788
  /**
7793
7789
  * Update a mailbox
7794
7790
  *
7795
- * 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}`.
7796
7792
  */
7797
7793
  static update(parameters, options) {
7798
7794
  const params = buildClientParams([parameters], [{ args: [
@@ -7802,15 +7798,112 @@ var Mailboxes = class {
7802
7798
  },
7803
7799
  {
7804
7800
  in: "body",
7805
- key: "displayName"
7801
+ key: "name"
7806
7802
  },
7807
7803
  {
7808
7804
  in: "body",
7809
7805
  key: "metadata"
7806
+ }
7807
+ ] }]);
7808
+ return (options?.client ?? client).patch({
7809
+ security: [{
7810
+ name: "x-api-key",
7811
+ type: "apiKey"
7812
+ }],
7813
+ url: "/v1/mailboxes/{id}",
7814
+ ...options,
7815
+ ...params,
7816
+ headers: {
7817
+ "Content-Type": "application/json",
7818
+ ...options?.headers,
7819
+ ...params.headers
7820
+ }
7821
+ });
7822
+ }
7823
+ /**
7824
+ * Add an endpoint to a mailbox
7825
+ *
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.
7827
+ */
7828
+ static createEndpoint(parameters, options) {
7829
+ const params = buildClientParams([parameters], [{ args: [
7830
+ {
7831
+ in: "path",
7832
+ key: "id"
7833
+ },
7834
+ {
7835
+ in: "body",
7836
+ key: "channel"
7837
+ },
7838
+ {
7839
+ in: "body",
7840
+ key: "address"
7841
+ },
7842
+ {
7843
+ in: "body",
7844
+ key: "displayName"
7845
+ }
7846
+ ] }]);
7847
+ return (options?.client ?? client).post({
7848
+ security: [{
7849
+ name: "x-api-key",
7850
+ type: "apiKey"
7851
+ }],
7852
+ url: "/v1/mailboxes/{id}/endpoints",
7853
+ ...options,
7854
+ ...params,
7855
+ headers: {
7856
+ "Content-Type": "application/json",
7857
+ ...options?.headers,
7858
+ ...params.headers
7859
+ }
7860
+ });
7861
+ }
7862
+ /**
7863
+ * Remove an endpoint from a mailbox
7864
+ *
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
+ */
7867
+ static removeEndpoint(parameters, options) {
7868
+ const params = buildClientParams([parameters], [{ args: [{
7869
+ in: "path",
7870
+ key: "id"
7871
+ }, {
7872
+ in: "path",
7873
+ key: "endpointId"
7874
+ }] }]);
7875
+ return (options?.client ?? client).delete({
7876
+ security: [{
7877
+ name: "x-api-key",
7878
+ type: "apiKey"
7879
+ }],
7880
+ url: "/v1/mailboxes/{id}/endpoints/{endpointId}",
7881
+ ...options,
7882
+ ...params
7883
+ });
7884
+ }
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"
7810
7899
  },
7811
7900
  {
7812
7901
  in: "body",
7813
- key: "defaultFrom"
7902
+ key: "displayName"
7903
+ },
7904
+ {
7905
+ in: "body",
7906
+ key: "default"
7814
7907
  }
7815
7908
  ] }]);
7816
7909
  return (options?.client ?? client).patch({
@@ -7818,7 +7911,7 @@ var Mailboxes = class {
7818
7911
  name: "x-api-key",
7819
7912
  type: "apiKey"
7820
7913
  }],
7821
- url: "/v1/mailboxes/{id}",
7914
+ url: "/v1/mailboxes/{id}/endpoints/{endpointId}",
7822
7915
  ...options,
7823
7916
  ...params,
7824
7917
  headers: {
@@ -8757,7 +8850,7 @@ var Mailboxes = class {
8757
8850
  /**
8758
8851
  * Send a new message
8759
8852
  *
8760
- * 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.
8761
8854
  */
8762
8855
  static sendMessage(parameters, options) {
8763
8856
  const params = buildClientParams([parameters], [{ args: [
@@ -8769,6 +8862,10 @@ var Mailboxes = class {
8769
8862
  in: "path",
8770
8863
  key: "id"
8771
8864
  },
8865
+ {
8866
+ in: "body",
8867
+ key: "channel"
8868
+ },
8772
8869
  {
8773
8870
  in: "body",
8774
8871
  key: "to"
@@ -8820,7 +8917,7 @@ var Mailboxes = class {
8820
8917
  /**
8821
8918
  * Get a mailbox message
8822
8919
  *
8823
- * 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.
8824
8921
  */
8825
8922
  static getMessage(parameters, options) {
8826
8923
  const params = buildClientParams([parameters], [{ args: [{
@@ -8926,7 +9023,7 @@ var Mailboxes = class {
8926
9023
  /**
8927
9024
  * Reply to a message
8928
9025
  *
8929
- * 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.
8930
9027
  */
8931
9028
  static reply(parameters, options) {
8932
9029
  const params = buildClientParams([parameters], [{ args: [
@@ -8942,6 +9039,10 @@ var Mailboxes = class {
8942
9039
  in: "path",
8943
9040
  key: "messageId"
8944
9041
  },
9042
+ {
9043
+ in: "body",
9044
+ key: "channel"
9045
+ },
8945
9046
  {
8946
9047
  in: "body",
8947
9048
  key: "cc"
@@ -8981,7 +9082,7 @@ var Mailboxes = class {
8981
9082
  /**
8982
9083
  * Reply to all recipients of a message
8983
9084
  *
8984
- * 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.
8985
9086
  */
8986
9087
  static replyAll(parameters, options) {
8987
9088
  const params = buildClientParams([parameters], [{ args: [
@@ -8997,6 +9098,10 @@ var Mailboxes = class {
8997
9098
  in: "path",
8998
9099
  key: "messageId"
8999
9100
  },
9101
+ {
9102
+ in: "body",
9103
+ key: "channel"
9104
+ },
9000
9105
  {
9001
9106
  in: "body",
9002
9107
  key: "cc"
@@ -9036,7 +9141,7 @@ var Mailboxes = class {
9036
9141
  /**
9037
9142
  * Forward a message
9038
9143
  *
9039
- * 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.
9040
9145
  */
9041
9146
  static forward(parameters, options) {
9042
9147
  const params = buildClientParams([parameters], [{ args: [
@@ -9213,7 +9318,7 @@ var Mailboxes = class {
9213
9318
  /**
9214
9319
  * Create a draft
9215
9320
  *
9216
- * 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`.
9217
9322
  */
9218
9323
  static createDraft(parameters, options) {
9219
9324
  const params = buildClientParams([parameters], [{ args: [
@@ -9221,6 +9326,14 @@ var Mailboxes = class {
9221
9326
  in: "path",
9222
9327
  key: "id"
9223
9328
  },
9329
+ {
9330
+ in: "body",
9331
+ key: "channel"
9332
+ },
9333
+ {
9334
+ in: "body",
9335
+ key: "endpointId"
9336
+ },
9224
9337
  {
9225
9338
  in: "body",
9226
9339
  key: "to"
@@ -9588,7 +9701,7 @@ var Mailboxes = class {
9588
9701
  /**
9589
9702
  * List mailbox events
9590
9703
  *
9591
- * Returns mailbox audit records, newest first, filterable by when they happened (`after`, `before`). Audit event types: `mailbox.created`, `address.attached`, `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.
9592
9705
  */
9593
9706
  static listEvents(parameters, options) {
9594
9707
  const params = buildClientParams([parameters], [{ args: [
@@ -10269,6 +10382,13 @@ var InternalError = class extends SamvaApiError {
10269
10382
  Object.assign(this, payload);
10270
10383
  }
10271
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
+ };
10272
10392
  var MailboxSendConflictError = class extends SamvaApiError {
10273
10393
  _tag = "MailboxSendConflictError";
10274
10394
  constructor(payload, context = {}) {
@@ -10345,6 +10465,7 @@ const constructors = {
10345
10465
  ForbiddenError,
10346
10466
  GatewayTimeoutError,
10347
10467
  InternalError,
10468
+ MailboxChannelUnsupportedError,
10348
10469
  MailboxSendConflictError,
10349
10470
  MailboxSendRefusedError,
10350
10471
  OnboardingReviewRequiredError,
@@ -10555,6 +10676,23 @@ const payloadSchemas = {
10555
10676
  "x-category": ["transient"],
10556
10677
  "x-retryable": true
10557
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
+ },
10558
10696
  MailboxSendConflictError: {
10559
10697
  type: "object",
10560
10698
  properties: {
@@ -11571,7 +11709,7 @@ function createPromiseMessagesTransport(clientInstance) {
11571
11709
  const { idempotencyKey, requestOptions } = resolveIdempotencyKey(options);
11572
11710
  return sendWithUploads(clientInstance, buildMessagesSendPayload(input), requestOptions, (payload) => Messages.send({
11573
11711
  "idempotency-key": idempotencyKey,
11574
- emailSendMessagePayload: payload
11712
+ ...payload
11575
11713
  }, {
11576
11714
  ...requestOptions,
11577
11715
  client: clientInstance
@@ -11598,7 +11736,7 @@ function createPromiseEmailTransport(clientInstance) {
11598
11736
  const { idempotencyKey, requestOptions } = resolveIdempotencyKey(options);
11599
11737
  return sendWithUploads(clientInstance, buildEmailSendPayload(input), requestOptions, (payload) => Messages.send({
11600
11738
  "idempotency-key": idempotencyKey,
11601
- emailSendMessagePayload: payload
11739
+ ...payload
11602
11740
  }, {
11603
11741
  ...requestOptions,
11604
11742
  client: clientInstance
@@ -11693,6 +11831,7 @@ function createClient(config) {
11693
11831
  unsubscribeGroups: createBoundService(Unsubscribe, clientInstance),
11694
11832
  analytics: createBoundService(Analytics, clientInstance),
11695
11833
  feedback: createBoundService(Feedback, clientInstance),
11834
+ whoami: createBoundService(Whoami, clientInstance),
11696
11835
  mailboxes: createBoundService(Mailboxes, clientInstance),
11697
11836
  namespaces: createBoundService(Namespaces, clientInstance),
11698
11837
  extensions: createBoundService(Extensions, clientInstance),
@@ -11727,6 +11866,7 @@ function createClient(config) {
11727
11866
  unsubscribeGroups: createDirectService(raw.unsubscribeGroups),
11728
11867
  analytics: createDirectService(raw.analytics),
11729
11868
  feedback: createDirectService(raw.feedback),
11869
+ whoami: createDirectService(raw.whoami),
11730
11870
  mailboxes: Object.assign(createDirectService(raw.mailboxes), { events: (options) => new MailboxEventStream(streamConnection, options) }),
11731
11871
  namespaces: createDirectService(raw.namespaces),
11732
11872
  extensions: createDirectService(raw.extensions),
@@ -11734,6 +11874,6 @@ function createClient(config) {
11734
11874
  };
11735
11875
  }
11736
11876
  //#endregion
11737
- 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 };
11738
11878
 
11739
- //# sourceMappingURL=promises-BFRKhpSS.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,6 +282,9 @@ export declare const SDK_SERVICE_OPERATIONS: {
281
282
  readonly get: "mailboxesGet";
282
283
  readonly update: "mailboxesUpdate";
283
284
  readonly remove: "mailboxesRemove";
285
+ readonly createEndpoint: "mailboxesCreateEndpoint";
286
+ readonly updateEndpoint: "mailboxesUpdateEndpoint";
287
+ readonly removeEndpoint: "mailboxesRemoveEndpoint";
284
288
  readonly pause: "mailboxesPause";
285
289
  readonly resume: "mailboxesResume";
286
290
  readonly getAgentActivity: "mailboxesGetAgentActivity";
@@ -566,14 +570,6 @@ export declare const SDK_OPERATION_CALLS: {
566
570
  readonly kind: "path";
567
571
  readonly paths: readonly ["id"];
568
572
  };
569
- readonly emailSetDomainDefaultSender: {
570
- readonly kind: "pathPayload";
571
- readonly paths: readonly ["id"];
572
- };
573
- readonly emailClearDomainDefaultSender: {
574
- readonly kind: "path";
575
- readonly paths: readonly ["id"];
576
- };
577
573
  readonly emailUpdateDomainConfig: {
578
574
  readonly kind: "pathPayload";
579
575
  readonly paths: readonly ["id"];
@@ -992,6 +988,9 @@ export declare const SDK_OPERATION_CALLS: {
992
988
  readonly kind: "path";
993
989
  readonly paths: readonly ["id", "inputContractId"];
994
990
  };
991
+ readonly whoamiGet: {
992
+ readonly kind: "none";
993
+ };
995
994
  readonly webhooksList: {
996
995
  readonly kind: "params";
997
996
  };
@@ -1222,6 +1221,18 @@ export declare const SDK_OPERATION_CALLS: {
1222
1221
  readonly kind: "path";
1223
1222
  readonly paths: readonly ["id"];
1224
1223
  };
1224
+ readonly mailboxesCreateEndpoint: {
1225
+ readonly kind: "pathPayload";
1226
+ readonly paths: readonly ["id"];
1227
+ };
1228
+ readonly mailboxesUpdateEndpoint: {
1229
+ readonly kind: "pathPayload";
1230
+ readonly paths: readonly ["id", "endpointId"];
1231
+ };
1232
+ readonly mailboxesRemoveEndpoint: {
1233
+ readonly kind: "path";
1234
+ readonly paths: readonly ["id", "endpointId"];
1235
+ };
1225
1236
  readonly mailboxesPause: {
1226
1237
  readonly kind: "path";
1227
1238
  readonly paths: readonly ["id"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "samva",
3
- "version": "0.14.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.14.0"
189
+ "@samva/webhooks": "0.16.0"
186
190
  },
187
191
  "devDependencies": {
188
192
  "@effect/openapi-generator": "4.0.0",