samva 0.19.0 → 0.21.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 (51) hide show
  1. package/dist/client/sdk.gen.d.ts +72 -16
  2. package/dist/client/sdk.gen.js +216 -36
  3. package/dist/client/types.gen.d.ts +411 -65
  4. package/dist/effect/api-keys.d.ts +7 -0
  5. package/dist/effect/campaigns.d.ts +66 -3
  6. package/dist/effect/contacts.d.ts +24 -4
  7. package/dist/effect/email.d.ts +22 -6
  8. package/dist/effect/errors.d.ts +1 -1
  9. package/dist/effect/errors.js +2 -2
  10. package/dist/effect/generated/api-keys.d.ts +15 -0
  11. package/dist/effect/generated/api-keys.js +2 -0
  12. package/dist/effect/generated/campaigns.d.ts +136 -4
  13. package/dist/effect/generated/campaigns.js +22 -1
  14. package/dist/effect/generated/contacts.d.ts +131 -1
  15. package/dist/effect/generated/contacts.js +17 -2
  16. package/dist/effect/generated/email.d.ts +162 -1
  17. package/dist/effect/generated/email.js +31 -11
  18. package/dist/effect/generated/journeys.d.ts +31 -61
  19. package/dist/effect/generated/journeys.js +9 -5
  20. package/dist/effect/generated/mailboxes.d.ts +274 -78
  21. package/dist/effect/generated/mailboxes.js +28 -20
  22. package/dist/effect/generated/messages.d.ts +4 -1
  23. package/dist/effect/generated/messages.js +2 -1
  24. package/dist/effect/generated/namespaces.d.ts +432 -2
  25. package/dist/effect/generated/namespaces.js +91 -4
  26. package/dist/effect/generated/shared.d.ts +38 -29
  27. package/dist/effect/generated/shared.js +28 -23
  28. package/dist/effect/generated/templates.d.ts +80 -1
  29. package/dist/effect/generated/templates.js +18 -6
  30. package/dist/effect/generated/webhooks.d.ts +120 -0
  31. package/dist/effect/generated/webhooks.js +27 -3
  32. package/dist/effect/generated-metadata.d.ts +20 -4
  33. package/dist/effect/generated-metadata.js +4 -4
  34. package/dist/effect/index.js +2 -2
  35. package/dist/effect/journeys.d.ts +12 -4
  36. package/dist/effect/mailboxes.d.ts +11 -11
  37. package/dist/effect/messages.d.ts +3 -0
  38. package/dist/effect/namespaces.d.ts +29 -0
  39. package/dist/effect/namespaces.js +7 -1
  40. package/dist/effect/templates.d.ts +28 -1
  41. package/dist/effect/webhooks.d.ts +7 -0
  42. package/dist/effect/webhooks.js +3 -1
  43. package/dist/index.js +2 -2
  44. package/dist/package.js +1 -1
  45. package/dist/promises/errors.gen.d.ts +2 -12
  46. package/dist/promises/errors.gen.js +1 -26
  47. package/dist/promises/index.js +2 -2
  48. package/dist/promises/types.gen.d.ts +1 -1
  49. package/dist/service-map.d.ts +20 -0
  50. package/dist/service-map.js +20 -0
  51. package/package.json +5 -3
@@ -41,6 +41,10 @@ var Messages = class {
41
41
  in: "query",
42
42
  key: "from"
43
43
  },
44
+ {
45
+ in: "query",
46
+ key: "namespaceId"
47
+ },
44
48
  {
45
49
  in: "query",
46
50
  key: "after"
@@ -1081,7 +1085,7 @@ var Email = class {
1081
1085
  /**
1082
1086
  * List sending domains
1083
1087
  *
1084
- * Returns the organization's sending domains, newest first. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. `sendable=true` lists only domains a send can use now: active, and verified, or verified before and degraded since. Each row carries `deliverability` (bounce and complaint rates over the last 24 hours, the window the 5% bounce limit is enforced over) and `series`, the last 14 days of daily email sends attributed to the domain, oldest first.
1088
+ * Returns the organization's sending domains, newest first. A namespace-scoped key lists only its namespace's domains; an organization-wide caller lists every domain, or one namespace's with `namespaceId`. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. `sendable=true` lists only domains a send can use now: active, and verified, or verified before and degraded since. Each row carries `deliverability` (bounce and complaint rates over the last 24 hours, the window the 5% bounce limit is enforced over) and `series`, the last 14 days of daily email sends attributed to the domain, oldest first.
1085
1089
  */
1086
1090
  static listDomains(parameters, options) {
1087
1091
  const params = buildClientParams([parameters], [{ args: [
@@ -1096,6 +1100,10 @@ var Email = class {
1096
1100
  {
1097
1101
  in: "query",
1098
1102
  key: "sendable"
1103
+ },
1104
+ {
1105
+ in: "query",
1106
+ key: "namespaceId"
1099
1107
  }
1100
1108
  ] }]);
1101
1109
  return (options?.client ?? client).get({
@@ -1111,16 +1119,23 @@ var Email = class {
1111
1119
  /**
1112
1120
  * Add a sending domain
1113
1121
  *
1114
- * Registers a domain for sending and returns it with the DNS records required to verify ownership and configure DKIM. Responds with 201. Supplying a connection attaches the domain to that DNS account; the domain must sit inside the zone given with it. When Samva cannot register another sending domain right now, this responds with 429 and no domain is created. A banned organization is refused with 403.
1122
+ * Registers a domain for sending and returns it with the DNS records required to verify ownership and configure DKIM. Responds with 201. Supplying a connection attaches the domain to that DNS account; the domain must sit inside the zone given with it. When Samva cannot register another sending domain right now, this responds with 429 and no domain is created. A banned organization is refused with 403. `namespaceId` places the domain in a namespace, and only that namespace's keys and organization-wide callers reach it; a namespace-scoped key always adds to its own namespace.
1115
1123
  */
1116
1124
  static addDomain(parameters, options) {
1117
- const params = buildClientParams([parameters], [{ args: [{
1118
- in: "body",
1119
- key: "domain"
1120
- }, {
1121
- in: "body",
1122
- key: "connection"
1123
- }] }]);
1125
+ const params = buildClientParams([parameters], [{ args: [
1126
+ {
1127
+ in: "body",
1128
+ key: "domain"
1129
+ },
1130
+ {
1131
+ in: "body",
1132
+ key: "connection"
1133
+ },
1134
+ {
1135
+ in: "body",
1136
+ key: "namespaceId"
1137
+ }
1138
+ ] }]);
1124
1139
  return (options?.client ?? client).post({
1125
1140
  security: [{
1126
1141
  name: "x-api-key",
@@ -1661,7 +1676,7 @@ var Email = class {
1661
1676
  /**
1662
1677
  * List senders
1663
1678
  *
1664
- * Returns senders, newest first, optionally filtered by verification status, active state, or default flag. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. Each row carries `deliverability` (bounce and complaint rates over the last 24 hours) and `series`, the last 14 days of daily email sends from the address, oldest first.
1679
+ * Returns senders, newest first. A namespace-scoped key lists only its namespace's senders; an organization-wide caller lists every sender, or one namespace's with `namespaceId`. Optionally filtered by verification status, active state, or default flag. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. Each row carries `deliverability` (bounce and complaint rates over the last 24 hours) and `series`, the last 14 days of daily email sends from the address, oldest first.
1665
1680
  */
1666
1681
  static listSenders(parameters, options) {
1667
1682
  const params = buildClientParams([parameters], [{ args: [
@@ -1684,6 +1699,10 @@ var Email = class {
1684
1699
  {
1685
1700
  in: "query",
1686
1701
  key: "isDefault"
1702
+ },
1703
+ {
1704
+ in: "query",
1705
+ key: "namespaceId"
1687
1706
  }
1688
1707
  ] }]);
1689
1708
  return (options?.client ?? client).get({
@@ -1699,7 +1718,7 @@ var Email = class {
1699
1718
  /**
1700
1719
  * Add a sender
1701
1720
  *
1702
- * Creates a sender. The required Idempotency-Key replays the original sender for an identical request and conflicts when reused with different input.
1721
+ * Creates a sender. A sender on a domain takes the domain's namespace, and a `namespaceId` that names another namespace is refused; a sender with no domain joins `namespaceId`, or its key's namespace. A namespace-scoped key cannot add a sender on a domain outside its namespace. The required Idempotency-Key replays the original sender for an identical request and conflicts when reused with different input.
1703
1722
  */
1704
1723
  static addSender(parameters, options) {
1705
1724
  const params = buildClientParams([parameters], [{ args: [
@@ -1722,6 +1741,10 @@ var Email = class {
1722
1741
  {
1723
1742
  in: "body",
1724
1743
  key: "replyToEmails"
1744
+ },
1745
+ {
1746
+ in: "body",
1747
+ key: "namespaceId"
1725
1748
  }
1726
1749
  ] }]);
1727
1750
  return (options?.client ?? client).post({
@@ -1800,9 +1823,9 @@ var Email = class {
1800
1823
  });
1801
1824
  }
1802
1825
  /**
1803
- * Set the organization default sender
1826
+ * Set the default sender
1804
1827
  *
1805
- * 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.
1828
+ * Marks a verified, active sender as the default of its scope, atomically clearing the previous default of the same scope: the organization level, or the sender's namespace. 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.
1806
1829
  */
1807
1830
  static setDefaultSender(parameters, options) {
1808
1831
  const params = buildClientParams([parameters], [{ args: [{
@@ -3419,6 +3442,10 @@ var Contacts = class {
3419
3442
  in: "query",
3420
3443
  key: "cursor"
3421
3444
  },
3445
+ {
3446
+ in: "query",
3447
+ key: "namespaceId"
3448
+ },
3422
3449
  {
3423
3450
  in: "query",
3424
3451
  key: "search"
@@ -3465,6 +3492,10 @@ var Contacts = class {
3465
3492
  */
3466
3493
  static create(parameters, options) {
3467
3494
  const params = buildClientParams([parameters], [{ args: [
3495
+ {
3496
+ in: "body",
3497
+ key: "namespaceId"
3498
+ },
3468
3499
  {
3469
3500
  in: "body",
3470
3501
  key: "name"
@@ -3532,6 +3563,10 @@ var Contacts = class {
3532
3563
  */
3533
3564
  static find(parameters, options) {
3534
3565
  const params = buildClientParams([parameters], [{ args: [
3566
+ {
3567
+ in: "body",
3568
+ key: "namespaceId"
3569
+ },
3535
3570
  {
3536
3571
  in: "body",
3537
3572
  key: "email"
@@ -3566,13 +3601,20 @@ var Contacts = class {
3566
3601
  * 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.
3567
3602
  */
3568
3603
  static findOrCreate(parameters, options) {
3569
- const params = buildClientParams([parameters], [{ args: [{
3570
- in: "body",
3571
- key: "lookup"
3572
- }, {
3573
- in: "body",
3574
- key: "create"
3575
- }] }]);
3604
+ const params = buildClientParams([parameters], [{ args: [
3605
+ {
3606
+ in: "body",
3607
+ key: "namespaceId"
3608
+ },
3609
+ {
3610
+ in: "body",
3611
+ key: "lookup"
3612
+ },
3613
+ {
3614
+ in: "body",
3615
+ key: "create"
3616
+ }
3617
+ ] }]);
3576
3618
  return (options?.client ?? client).post({
3577
3619
  security: [{
3578
3620
  name: "x-api-key",
@@ -3886,13 +3928,20 @@ var Contacts = class {
3886
3928
  * Creates contacts in bulk from a list of entries shaped like a create request, returning per-entry results with created, updated, skipped, and error counts. An entry whose identities match an existing contact is skipped, or updates it with `onConflict: "update"`.
3887
3929
  */
3888
3930
  static bulkImport(parameters, options) {
3889
- const params = buildClientParams([parameters], [{ args: [{
3890
- in: "body",
3891
- key: "contacts"
3892
- }, {
3893
- in: "body",
3894
- key: "onConflict"
3895
- }] }]);
3931
+ const params = buildClientParams([parameters], [{ args: [
3932
+ {
3933
+ in: "body",
3934
+ key: "namespaceId"
3935
+ },
3936
+ {
3937
+ in: "body",
3938
+ key: "contacts"
3939
+ },
3940
+ {
3941
+ in: "body",
3942
+ key: "onConflict"
3943
+ }
3944
+ ] }]);
3896
3945
  return (options?.client ?? client).post({
3897
3946
  security: [{
3898
3947
  name: "x-api-key",
@@ -5543,6 +5592,14 @@ var Templates = class {
5543
5592
  {
5544
5593
  in: "query",
5545
5594
  key: "projectId"
5595
+ },
5596
+ {
5597
+ in: "query",
5598
+ key: "namespaceId"
5599
+ },
5600
+ {
5601
+ in: "query",
5602
+ key: "shared"
5546
5603
  }
5547
5604
  ] }]);
5548
5605
  return (options?.client ?? client).get({
@@ -5594,6 +5651,14 @@ var Templates = class {
5594
5651
  in: "body",
5595
5652
  key: "isActive"
5596
5653
  },
5654
+ {
5655
+ in: "body",
5656
+ key: "namespaceId"
5657
+ },
5658
+ {
5659
+ in: "body",
5660
+ key: "shared"
5661
+ },
5597
5662
  {
5598
5663
  in: "body",
5599
5664
  key: "idempotencyKey"
@@ -6267,7 +6332,7 @@ var Templates = class {
6267
6332
  /**
6268
6333
  * Publish an exact template commit
6269
6334
  *
6270
- * Builds an exact Git commit and entry path, stores the immutable compiled IR and its assets, records the input contract it validates against, and makes that publication current.
6335
+ * Builds an exact Git commit and entry path, stores the immutable compiled IR and its assets, records the input contract it validates against, and makes that publication current. A commit that compiles to the same build as an existing publication makes that publication current again instead of recording another.
6271
6336
  */
6272
6337
  static publish(parameters, options) {
6273
6338
  const params = buildClientParams([parameters], [{ args: [
@@ -6766,7 +6831,7 @@ var Webhooks = class {
6766
6831
  /**
6767
6832
  * Create a webhook
6768
6833
  *
6769
- * Creates a signed webhook endpoint for Samva delivery and inbound events, stores subscriptions, and returns the endpoint and signing secret with a 201 response. `mailboxIds` and `namespaceId` confine mailbox events; when both are set, every mailbox must belong to the namespace.
6834
+ * Creates a signed webhook endpoint for Samva delivery and inbound events, stores subscriptions, and returns the endpoint and signing secret with a 201 response. `namespaceId` confines the endpoint to one namespace's events and `mailboxIds` to those mailboxes' events; when both are set, every mailbox must belong to the namespace.
6770
6835
  */
6771
6836
  static create(parameters, options) {
6772
6837
  const params = buildClientParams([parameters], [{ args: [
@@ -7048,6 +7113,26 @@ var Webhooks = class {
7048
7113
  ...params
7049
7114
  });
7050
7115
  }
7116
+ /**
7117
+ * Get a webhook signing secret
7118
+ *
7119
+ * Returns the endpoint's current signing secret and when a rotated-out secret stops verifying. It needs the same permission as rotating the secret.
7120
+ */
7121
+ static getSecret(parameters, options) {
7122
+ const params = buildClientParams([parameters], [{ args: [{
7123
+ in: "path",
7124
+ key: "id"
7125
+ }] }]);
7126
+ return (options?.client ?? client).get({
7127
+ security: [{
7128
+ name: "x-api-key",
7129
+ type: "apiKey"
7130
+ }],
7131
+ url: "/v1/webhooks/{id}/secret",
7132
+ ...options,
7133
+ ...params
7134
+ });
7135
+ }
7051
7136
  };
7052
7137
  var Organizations = class {
7053
7138
  /**
@@ -7553,7 +7638,7 @@ var Mailboxes = class {
7553
7638
  /**
7554
7639
  * Create a mailbox
7555
7640
  *
7556
- * 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.
7641
+ * Creates a mailbox with one endpoint and returns it with status 201; the caller gets an admin grant on it. 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. A phone endpoint's address is a number the organization connected on that channel, in E.164 form. The slug defaults to the address's local part, or a phone number's digits. 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.
7557
7642
  */
7558
7643
  static create(parameters, options) {
7559
7644
  const params = buildClientParams([parameters], [{ args: [
@@ -7671,7 +7756,7 @@ var Mailboxes = class {
7671
7756
  /**
7672
7757
  * Add an endpoint to a mailbox
7673
7758
  *
7674
- * 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.
7759
+ * 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: an email address must be under the organization's Samva-hosted mail domain or a verified domain with receiving enabled, a phone number must be one the organization connected on that channel, 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.
7675
7760
  */
7676
7761
  static createEndpoint(parameters, options) {
7677
7762
  const params = buildClientParams([parameters], [{ args: [
@@ -8698,7 +8783,7 @@ var Mailboxes = class {
8698
8783
  /**
8699
8784
  * Send a new message
8700
8785
  *
8701
- * 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.
8786
+ * Starts a new conversation from the mailbox's default endpoint on the channel the body names (email when omitted); a mailbox with no endpoint on that channel is refused (422). A message to a number joins the mailbox's thread with that number when it has one. 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.
8702
8787
  */
8703
8788
  static sendMessage(parameters, options) {
8704
8789
  const params = buildClientParams([parameters], [{ args: [
@@ -8871,7 +8956,7 @@ var Mailboxes = class {
8871
8956
  /**
8872
8957
  * Reply to a message
8873
8958
  *
8874
- * 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.
8959
+ * 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. On a phone channel the reply goes to the number on the other side of the thread.
8875
8960
  */
8876
8961
  static reply(parameters, options) {
8877
8962
  const params = buildClientParams([parameters], [{ args: [
@@ -8930,7 +9015,7 @@ var Mailboxes = class {
8930
9015
  /**
8931
9016
  * Reply to all recipients of a message
8932
9017
  *
8933
- * 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.
9018
+ * 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. A phone thread has one other side, so it answers like a reply.
8934
9019
  */
8935
9020
  static replyAll(parameters, options) {
8936
9021
  const params = buildClientParams([parameters], [{ args: [
@@ -9166,7 +9251,7 @@ var Mailboxes = class {
9166
9251
  /**
9167
9252
  * Create a draft
9168
9253
  *
9169
- * 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`.
9254
+ * 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. A phone channel's draft holds a recipient number and text. Send it with `POST /v1/mailboxes/{id}/drafts/{draftId}/send`.
9170
9255
  */
9171
9256
  static createDraft(parameters, options) {
9172
9257
  const params = buildClientParams([parameters], [{ args: [
@@ -9651,7 +9736,7 @@ var Namespaces = class {
9651
9736
  /**
9652
9737
  * Delete a namespace
9653
9738
  *
9654
- * Deletes an empty namespace. A namespace that still holds mailboxes, API keys, or webhook endpoints conflicts: remove them first.
9739
+ * Deletes an empty namespace. A namespace that still holds anything conflicts, and the error counts what remains: mailboxes, API keys, webhook endpoints filtered to it, domains, senders, contacts, or template projects. Delete each, or return it to organization level with `DELETE /v1/namespaces/{id}/resources/{type}/{resourceId}`; mailboxes, keys, and webhook endpoints cannot move and are deleted. Messages keep the namespace they ran in.
9655
9740
  */
9656
9741
  static remove(parameters, options) {
9657
9742
  const params = buildClientParams([parameters], [{ args: [{
@@ -9723,6 +9808,101 @@ var Namespaces = class {
9723
9808
  }
9724
9809
  });
9725
9810
  }
9811
+ /**
9812
+ * Move a resource into a namespace
9813
+ *
9814
+ * Moves a resource from organization level or another namespace into this one. A domain brings its senders; a sender on a domain cannot move alone (assign the domain); a contact brings its identities; a template brings every template in its project. A moved resource stops being a default. An address or external id the namespace already holds conflicts. Keys scoped to the old namespace stop reaching the resource at once. Mailboxes, API keys, and webhook endpoints keep the namespace they were created in.
9815
+ */
9816
+ static assignResource(parameters, options) {
9817
+ const params = buildClientParams([parameters], [{ args: [
9818
+ {
9819
+ in: "path",
9820
+ key: "id"
9821
+ },
9822
+ {
9823
+ in: "body",
9824
+ key: "type"
9825
+ },
9826
+ {
9827
+ in: "body",
9828
+ key: "resourceId"
9829
+ }
9830
+ ] }]);
9831
+ return (options?.client ?? client).post({
9832
+ security: [{
9833
+ name: "x-api-key",
9834
+ type: "apiKey"
9835
+ }],
9836
+ url: "/v1/namespaces/{id}/resources",
9837
+ ...options,
9838
+ ...params,
9839
+ headers: {
9840
+ "Content-Type": "application/json",
9841
+ ...options?.headers,
9842
+ ...params.headers
9843
+ }
9844
+ });
9845
+ }
9846
+ /**
9847
+ * Return a resource to organization level
9848
+ *
9849
+ * Moves a resource out of this namespace to organization level, with what follows it as in `POST /v1/namespaces/{id}/resources`. A resource in a different namespace is not found.
9850
+ */
9851
+ static removeResource(parameters, options) {
9852
+ const params = buildClientParams([parameters], [{ args: [
9853
+ {
9854
+ in: "path",
9855
+ key: "id"
9856
+ },
9857
+ {
9858
+ in: "path",
9859
+ key: "type"
9860
+ },
9861
+ {
9862
+ in: "path",
9863
+ key: "resourceId"
9864
+ }
9865
+ ] }]);
9866
+ return (options?.client ?? client).delete({
9867
+ security: [{
9868
+ name: "x-api-key",
9869
+ type: "apiKey"
9870
+ }],
9871
+ url: "/v1/namespaces/{id}/resources/{type}/{resourceId}",
9872
+ ...options,
9873
+ ...params
9874
+ });
9875
+ }
9876
+ /**
9877
+ * Get namespace usage
9878
+ *
9879
+ * Counts the messages the namespace sent and received in the window that count toward usage, by channel, with the same statuses as `GET /v1/organizations/usage`. A message counts toward the namespace it was sent or received in: that of the sender, mailbox, or key it used. The organization is billed for every namespace; read this to charge your own customer.
9880
+ */
9881
+ static getUsage(parameters, options) {
9882
+ const params = buildClientParams([parameters], [{ args: [
9883
+ {
9884
+ in: "path",
9885
+ key: "id"
9886
+ },
9887
+ {
9888
+ in: "query",
9889
+ key: "after"
9890
+ },
9891
+ {
9892
+ in: "query",
9893
+ key: "before"
9894
+ }
9895
+ ] }]);
9896
+ return (options?.client ?? client).get({
9897
+ security: [{
9898
+ name: "x-api-key",
9899
+ type: "apiKey"
9900
+ }],
9901
+ url: "/v1/namespaces/{id}/usage",
9902
+ ...options,
9903
+ ...params
9904
+ });
9905
+ }
9726
9906
  };
9727
9907
  var Extensions = class {
9728
9908
  /**