samva 0.31.0 → 0.33.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 (47) hide show
  1. package/dist/client/sdk.gen.d.ts +77 -10
  2. package/dist/client/sdk.gen.js +244 -16
  3. package/dist/client/types.gen.d.ts +607 -34
  4. package/dist/effect/email.d.ts +3 -0
  5. package/dist/effect/errors.d.ts +1 -1
  6. package/dist/effect/errors.js +2 -2
  7. package/dist/effect/generated/campaigns.d.ts +131 -57
  8. package/dist/effect/generated/campaigns.js +27 -9
  9. package/dist/effect/generated/contact-groups.js +2 -2
  10. package/dist/effect/generated/contacts.js +6 -6
  11. package/dist/effect/generated/email.d.ts +17 -1
  12. package/dist/effect/generated/email.js +12 -8
  13. package/dist/effect/generated/mailboxes.d.ts +969 -16
  14. package/dist/effect/generated/mailboxes.js +264 -12
  15. package/dist/effect/generated/newsletter-issues.d.ts +199 -1
  16. package/dist/effect/generated/newsletter-issues.js +24 -2
  17. package/dist/effect/generated/newsletters.js +1 -1
  18. package/dist/effect/generated/organizations.d.ts +345 -2
  19. package/dist/effect/generated/organizations.js +65 -5
  20. package/dist/effect/generated/scheduled-messages.d.ts +25 -8
  21. package/dist/effect/generated/scheduled-messages.js +17 -9
  22. package/dist/effect/generated/shared.d.ts +90 -9
  23. package/dist/effect/generated/shared.js +14 -10
  24. package/dist/effect/generated/subscriptions.js +1 -1
  25. package/dist/effect/generated/templates.d.ts +307 -1
  26. package/dist/effect/generated/templates.js +38 -4
  27. package/dist/effect/generated/topics.js +2 -2
  28. package/dist/effect/generated/whoami.d.ts +5 -5
  29. package/dist/effect/generated/whoami.js +1 -0
  30. package/dist/effect/generated-metadata.d.ts +40 -0
  31. package/dist/effect/generated-metadata.js +10 -0
  32. package/dist/effect/index.js +2 -2
  33. package/dist/effect/internal/send.d.ts +1 -1
  34. package/dist/effect/mailboxes.d.ts +273 -0
  35. package/dist/effect/mailboxes.js +7 -1
  36. package/dist/effect/organizations.d.ts +6 -0
  37. package/dist/effect/organizations.js +7 -1
  38. package/dist/index.js +2 -2
  39. package/dist/package.js +1 -1
  40. package/dist/promises/client.js +2 -2
  41. package/dist/promises/errors.gen.d.ts +12 -2
  42. package/dist/promises/errors.gen.js +28 -1
  43. package/dist/promises/index.js +2 -2
  44. package/dist/promises/types.gen.d.ts +1 -1
  45. package/dist/service-map.d.ts +25 -0
  46. package/dist/service-map.js +9 -0
  47. package/package.json +8 -8
@@ -977,7 +977,7 @@ var Campaigns = class {
977
977
  /**
978
978
  * Resume a campaign run
979
979
  *
980
- * Resumes a paused campaign run and returns the updated run.
980
+ * Resumes a paused campaign run and returns the updated run. Campaigns need a paid plan: on Free this is refused with PaymentRequiredError.
981
981
  */
982
982
  static resumeRun(parameters, options) {
983
983
  const params = buildClientParams([parameters], [{ args: [{
@@ -1569,7 +1569,7 @@ var Email = class {
1569
1569
  /**
1570
1570
  * Enable inbound email for a domain
1571
1571
  *
1572
- * Enables inbound receiving for a verified domain and returns the recipient addresses it accepts. Set `catchAll` to route every address on the domain; that needs a destination: a webhook endpoint, supplied as `endpointId` or already configured on the domain, or at least one active forwarding rule that covers the domain. Mail that matches neither is rejected, never accepted and dropped.
1572
+ * Enables inbound receiving for a verified domain and returns the recipient addresses it accepts. Set `catchAll` to accept every address on the domain. No destination is required to enable receiving. With no webhook endpoint, mail reaches matching forwarding rules and active mailboxes; unknown addresses reach `unknownRecipientMailboxId` when configured, otherwise they are dropped without a bounce.
1573
1573
  */
1574
1574
  static enableReceiving(parameters, options) {
1575
1575
  const params = buildClientParams([parameters], [{ args: [
@@ -1617,7 +1617,7 @@ var Email = class {
1617
1617
  /**
1618
1618
  * Get receiving setup status
1619
1619
  *
1620
- * Reports each prerequisite for receiving a domain's mail at Samva, in order: sending verified, a destination (a webhook endpoint or an active forwarding rule), receiving enabled, and the inbound MX record. The MX answer is a live DNS lookup that names the current target when mail is routed elsewhere.
1620
+ * Reports sending verification, configured destinations (webhook endpoint, forwarding rules, and mailboxes), receiving enablement, and the inbound MX record. Receiving can be enabled before a destination is configured. The MX answer is a live DNS lookup that names the current target when mail is routed elsewhere.
1621
1621
  */
1622
1622
  static getReceivingStatus(parameters, options) {
1623
1623
  const params = buildClientParams([parameters], [{ args: [{
@@ -2103,7 +2103,7 @@ var Email = class {
2103
2103
  /**
2104
2104
  * Enable catch-all receiving
2105
2105
  *
2106
- * Enables catch-all inbound receiving for a verified domain. `endpointId` is one of the organization's webhook endpoints; every address on the domain delivers `message.received` to it. Omit it to deliver through forwarding rules alone, which needs at least one active forwarding rule covering the domain. Mail that matches neither a rule nor an endpoint is rejected as an unknown recipient. Responds with 201.
2106
+ * Enables catch-all inbound receiving for a verified domain without requiring a destination. `endpointId` is one of the organization's webhook endpoints; every address on the domain delivers `message.received` to it. Without an endpoint, forwarding rules and active mailboxes receive matching addresses. Unknown addresses reach `unknownRecipientMailboxId` when configured, otherwise they are dropped without a bounce. Responds with 201.
2107
2107
  */
2108
2108
  static enableCatchAll(parameters, options) {
2109
2109
  const params = buildClientParams([parameters], [{ args: [{
@@ -2157,7 +2157,7 @@ var Email = class {
2157
2157
  /**
2158
2158
  * Get catch-all configuration
2159
2159
  *
2160
- * Returns the catch-all receiving configuration for a domain, including the webhook endpoint that receives its inbound mail and its email counts.
2160
+ * Returns the catch-all receiving configuration for a domain, including its webhook endpoint, unknown-address mailbox (null means drop), and email counts.
2161
2161
  */
2162
2162
  static getCatchAllConfig(parameters, options) {
2163
2163
  const params = buildClientParams([parameters], [{ args: [{
@@ -2178,16 +2178,23 @@ var Email = class {
2178
2178
  /**
2179
2179
  * Update catch-all configuration
2180
2180
  *
2181
- * Updates a domain's catch-all receiving configuration: the webhook endpoint that receives its inbound mail.
2181
+ * Updates a domain's catch-all webhook endpoint or unknown-address mailbox. The mailbox must be active, in the same organization, and have an email address on the domain. Omitted fields stay unchanged; `unknownRecipientMailboxId: null` drops unknown addresses without a bounce. A webhook endpoint takes precedence over the unknown-address setting.
2182
2182
  */
2183
2183
  static updateCatchAllConfig(parameters, options) {
2184
- const params = buildClientParams([parameters], [{ args: [{
2185
- in: "body",
2186
- key: "domainId"
2187
- }, {
2188
- in: "body",
2189
- key: "endpointId"
2190
- }] }]);
2184
+ const params = buildClientParams([parameters], [{ args: [
2185
+ {
2186
+ in: "body",
2187
+ key: "domainId"
2188
+ },
2189
+ {
2190
+ in: "body",
2191
+ key: "endpointId"
2192
+ },
2193
+ {
2194
+ in: "body",
2195
+ key: "unknownRecipientMailboxId"
2196
+ }
2197
+ ] }]);
2191
2198
  return requestWithPolicy(options?.client ?? client, "emailUpdateCatchAllConfig", options, (headers) => (options?.client ?? client).patch({
2192
2199
  security: [{
2193
2200
  name: "x-api-key",
@@ -9198,6 +9205,71 @@ var Organizations = class {
9198
9205
  }));
9199
9206
  }
9200
9207
  /**
9208
+ * Assign a personal mailbox
9209
+ *
9210
+ * Assigns a personal address to an existing member. Only organization owners and admins may assign it; the member receives the sole user grant. Returns the mailbox ID without granting the assigner access.
9211
+ */
9212
+ static assignPersonalMailbox(parameters, options) {
9213
+ const params = buildClientParams([parameters], [{ args: [{
9214
+ in: "path",
9215
+ key: "userId"
9216
+ }, {
9217
+ in: "body",
9218
+ key: "mailboxAddress"
9219
+ }] }]);
9220
+ return requestWithPolicy(options?.client ?? client, "organizationsAssignPersonalMailbox", options, (headers) => (options?.client ?? client).post({
9221
+ security: [{
9222
+ name: "x-api-key",
9223
+ type: "apiKey"
9224
+ }],
9225
+ url: "/v1/organizations/members/{userId}/personal-mailbox",
9226
+ ...options,
9227
+ ...params,
9228
+ body: params.body ?? {},
9229
+ headers: {
9230
+ "Content-Type": "application/json",
9231
+ ...options?.headers,
9232
+ ...params.headers
9233
+ },
9234
+ headers: {
9235
+ "Content-Type": "application/json",
9236
+ ...headers
9237
+ }
9238
+ }));
9239
+ }
9240
+ /**
9241
+ * List members with personal mailboxes
9242
+ *
9243
+ * Returns the user IDs with a personal mailbox in this organization, including paused mailboxes. Only organization owners and admins may list assignments. This grants no mailbox access.
9244
+ */
9245
+ static listPersonalMailboxAssignments(options) {
9246
+ return requestWithPolicy(options?.client ?? client, "organizationsListPersonalMailboxAssignments", options, (headers) => (options?.client ?? client).get({
9247
+ security: [{
9248
+ name: "x-api-key",
9249
+ type: "apiKey"
9250
+ }],
9251
+ url: "/v1/organizations/personal-mailboxes/assignments",
9252
+ ...options,
9253
+ headers
9254
+ }));
9255
+ }
9256
+ /**
9257
+ * Get personal address domains
9258
+ *
9259
+ * Returns this organization's verified active receiving domains and a default domain. When none are available, returns the organization's hosted mail domain. Only organization owners and admins may read these options.
9260
+ */
9261
+ static getPersonalMailboxAddressOptions(options) {
9262
+ return requestWithPolicy(options?.client ?? client, "organizationsGetPersonalMailboxAddressOptions", options, (headers) => (options?.client ?? client).get({
9263
+ security: [{
9264
+ name: "x-api-key",
9265
+ type: "apiKey"
9266
+ }],
9267
+ url: "/v1/organizations/personal-mailboxes/address-options",
9268
+ ...options,
9269
+ headers
9270
+ }));
9271
+ }
9272
+ /**
9201
9273
  * Get organization trust tier and sending limits
9202
9274
  *
9203
9275
  * Returns the current trust tier, plan and probation sending limits, and measured probation graduation progress. Limits are additional to billing allowance, domain readiness, and enforcement. Graduation is evaluated on delivery events.
@@ -9681,7 +9753,7 @@ var Mailboxes = class {
9681
9753
  /**
9682
9754
  * Delete a mailbox
9683
9755
  *
9684
- * 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.
9756
+ * Deletes a mailbox with its endpoints, threads, drafts, and history. The messages it received retain their privacy. The mailbox leaves every API key scope and webhook endpoint filter that named it; a key or endpoint left with no mailbox is disabled. A signed-in organization owner may delete a former member's personal mailbox without reading it.
9685
9757
  */
9686
9758
  static remove(parameters, options) {
9687
9759
  const params = buildClientParams([parameters], [{ args: [{
@@ -10412,6 +10484,144 @@ var Mailboxes = class {
10412
10484
  }));
10413
10485
  }
10414
10486
  /**
10487
+ * List mailbox decisions awaiting you
10488
+ *
10489
+ * Returns held sends this caller can approve and quarantined messages this caller may release across their visible mailboxes. Counts cover all actionable items, independent of the current cursor page. Metadata only; isolated messages, self approvals, and decisions the credential cannot perform are excluded.
10490
+ */
10491
+ static getNeedsYou(parameters, options) {
10492
+ const params = buildClientParams([parameters], [{ args: [{
10493
+ in: "query",
10494
+ key: "limit"
10495
+ }, {
10496
+ in: "query",
10497
+ key: "cursor"
10498
+ }] }]);
10499
+ return requestWithPolicy(options?.client ?? client, "mailboxesGetNeedsYou", options, (headers) => (options?.client ?? client).get({
10500
+ security: [{
10501
+ name: "x-api-key",
10502
+ type: "apiKey"
10503
+ }],
10504
+ url: "/v1/mailboxes/needs-you",
10505
+ ...options,
10506
+ ...params,
10507
+ headers
10508
+ }));
10509
+ }
10510
+ /**
10511
+ * List your drafts across mailboxes
10512
+ *
10513
+ * Lists only the caller's own unsent drafts in mailboxes where they may write drafts, newest first. Repeat mailboxId to narrow the scope; kind selects personal or shared mailboxes and threadId narrows to one thread. Each row carries its mailbox identity. Teammates' and agents' drafts are excluded. Pass nextCursor as cursor for the next page.
10514
+ */
10515
+ static listOrganizationDrafts(parameters, options) {
10516
+ const params = buildClientParams([parameters], [{ args: [
10517
+ {
10518
+ in: "query",
10519
+ key: "limit"
10520
+ },
10521
+ {
10522
+ in: "query",
10523
+ key: "cursor"
10524
+ },
10525
+ {
10526
+ in: "query",
10527
+ key: "mailboxId"
10528
+ },
10529
+ {
10530
+ in: "query",
10531
+ key: "kind"
10532
+ },
10533
+ {
10534
+ in: "query",
10535
+ key: "threadId"
10536
+ }
10537
+ ] }]);
10538
+ return requestWithPolicy(options?.client ?? client, "mailboxesListOrganizationDrafts", options, (headers) => (options?.client ?? client).get({
10539
+ security: [{
10540
+ name: "x-api-key",
10541
+ type: "apiKey"
10542
+ }],
10543
+ url: "/v1/mailboxes/drafts",
10544
+ ...options,
10545
+ ...params,
10546
+ headers
10547
+ }));
10548
+ }
10549
+ /**
10550
+ * List threads across your mailboxes
10551
+ *
10552
+ * Lists only threads in mailboxes the caller can read, newest activity first. Repeat mailboxId to narrow the scope; kind selects personal or shared mailboxes. conversation selects the threads of one conversation (the conversationId a thread reports), one per readable mailbox it reached. state=active excludes the caller's Done and shared closed threads; state=done selects the caller's Done plus closed shared threads, without duplicates. Other filters and cursor pagination match the per-mailbox list.
10553
+ */
10554
+ static listOrganizationThreads(parameters, options) {
10555
+ const params = buildClientParams([parameters], [{ args: [
10556
+ {
10557
+ in: "query",
10558
+ key: "limit"
10559
+ },
10560
+ {
10561
+ in: "query",
10562
+ key: "cursor"
10563
+ },
10564
+ {
10565
+ in: "query",
10566
+ key: "after"
10567
+ },
10568
+ {
10569
+ in: "query",
10570
+ key: "before"
10571
+ },
10572
+ {
10573
+ in: "query",
10574
+ key: "q"
10575
+ },
10576
+ {
10577
+ in: "query",
10578
+ key: "state"
10579
+ },
10580
+ {
10581
+ in: "query",
10582
+ key: "folder"
10583
+ },
10584
+ {
10585
+ in: "query",
10586
+ key: "label"
10587
+ },
10588
+ {
10589
+ in: "query",
10590
+ key: "unread"
10591
+ },
10592
+ {
10593
+ in: "query",
10594
+ key: "starred"
10595
+ },
10596
+ {
10597
+ in: "query",
10598
+ key: "snoozed"
10599
+ },
10600
+ {
10601
+ in: "query",
10602
+ key: "mailboxId"
10603
+ },
10604
+ {
10605
+ in: "query",
10606
+ key: "kind"
10607
+ },
10608
+ {
10609
+ in: "query",
10610
+ key: "conversation"
10611
+ }
10612
+ ] }]);
10613
+ return requestWithPolicy(options?.client ?? client, "mailboxesListOrganizationThreads", options, (headers) => (options?.client ?? client).get({
10614
+ security: [{
10615
+ name: "x-api-key",
10616
+ type: "apiKey"
10617
+ }],
10618
+ url: "/v1/mailboxes/threads",
10619
+ ...options,
10620
+ ...params,
10621
+ headers
10622
+ }));
10623
+ }
10624
+ /**
10415
10625
  * List threads in a mailbox
10416
10626
  *
10417
10627
  * Returns thread summaries, most recent activity first. `after` and `before` filter by last activity, so an agent polling for new mail passes the last time it looked. `q` is a full-text search over subjects, senders, and message text; `folder`, `label`, `unread`, and `starred` narrow the list. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. A thread that gains activity while you page moves ahead of the cursor, so a walk lists each thread at most once.
@@ -10442,6 +10652,10 @@ var Mailboxes = class {
10442
10652
  in: "query",
10443
10653
  key: "q"
10444
10654
  },
10655
+ {
10656
+ in: "query",
10657
+ key: "state"
10658
+ },
10445
10659
  {
10446
10660
  in: "query",
10447
10661
  key: "folder"
@@ -10501,7 +10715,7 @@ var Mailboxes = class {
10501
10715
  /**
10502
10716
  * Update a mailbox thread
10503
10717
  *
10504
- * Updates the fields you name and keeps the rest. `folder` and `priority` are shared with everyone on the mailbox; `read`, `starred`, and `snoozedUntil` are the caller's own. Labels are not updated here: use `POST` and `DELETE` on `/v1/mailboxes/{id}/threads/{threadId}/labels`. Returns where the thread stands, not its messages: read those with `GET .../threads/{threadId}`.
10718
+ * Updates the fields you name and keeps the rest. `folder`, `priority`, and `closed` are shared with everyone on the mailbox; `done`, `read`, `starred`, and `snoozedUntil` are the caller's own. The Done list includes the caller's Done and shared closed conversations; changing `done` does not reopen Close. Personal mailboxes refuse `closed`; archive them with `folder: archived`. Neither Done nor Close publishes webhook or event-stream events. A new live message clears Done for all readers and reopens Close. Labels are not updated here: use `POST` and `DELETE` on `/v1/mailboxes/{id}/threads/{threadId}/labels`. Returns where the thread stands, not its messages: read those with `GET .../threads/{threadId}`.
10505
10719
  */
10506
10720
  static updateThread(parameters, options) {
10507
10721
  const params = buildClientParams([parameters], [{ args: [
@@ -10521,6 +10735,14 @@ var Mailboxes = class {
10521
10735
  in: "body",
10522
10736
  key: "priority"
10523
10737
  },
10738
+ {
10739
+ in: "body",
10740
+ key: "done"
10741
+ },
10742
+ {
10743
+ in: "body",
10744
+ key: "closed"
10745
+ },
10524
10746
  {
10525
10747
  in: "body",
10526
10748
  key: "read"
@@ -11664,7 +11886,7 @@ var Mailboxes = class {
11664
11886
  /**
11665
11887
  * Resume a mailbox send
11666
11888
  *
11667
- * Resumes the same action only after its previous execution is confirmed ended and safe continuation is possible. Only an authorized person who proposed the send or can approve actions may retry. Automatic waits need no manual Retry. This does not grant new approval, reset the original deadline, replace the message identity, or resubmit an accepted or uncertain send.
11889
+ * Resumes the same eligible action while preserving its content, message identity, existing retry delays and original deadline. A queued action can resume while cleanup from an ended send attempt waits. A send attempt that is still running or whose status is unknown cannot be retried. Only an authorized person who proposed the send or can approve actions may retry. Automatic waits need no manual Retry. This does not grant new approval or resubmit an accepted or uncertain send.
11668
11890
  */
11669
11891
  static retryAction(parameters, options) {
11670
11892
  const params = buildClientParams([parameters], [{ args: [{
@@ -12730,6 +12952,9 @@ Object.assign(Organizations.create, { operation: "organizationsCreate" });
12730
12952
  Object.assign(Organizations.get, { operation: "organizationsGet" });
12731
12953
  Object.assign(Organizations.update, { operation: "organizationsUpdate" });
12732
12954
  Object.assign(Organizations.getProfile, { operation: "organizationsGetProfile" });
12955
+ Object.assign(Organizations.assignPersonalMailbox, { operation: "organizationsAssignPersonalMailbox" });
12956
+ Object.assign(Organizations.listPersonalMailboxAssignments, { operation: "organizationsListPersonalMailboxAssignments" });
12957
+ Object.assign(Organizations.getPersonalMailboxAddressOptions, { operation: "organizationsGetPersonalMailboxAddressOptions" });
12733
12958
  Object.assign(Organizations.getTrustTier, { operation: "organizationsGetTrustTier" });
12734
12959
  Object.assign(Organizations.createAvatarUpload, { operation: "organizationsCreateAvatarUpload" });
12735
12960
  Object.assign(Organizations.getUsage, { operation: "organizationsGetUsage" });
@@ -12769,6 +12994,9 @@ Object.assign(Mailboxes.listLabels, { operation: "mailboxesListLabels" });
12769
12994
  Object.assign(Mailboxes.createLabel, { operation: "mailboxesCreateLabel" });
12770
12995
  Object.assign(Mailboxes.deleteLabel, { operation: "mailboxesDeleteLabel" });
12771
12996
  Object.assign(Mailboxes.updateLabel, { operation: "mailboxesUpdateLabel" });
12997
+ Object.assign(Mailboxes.getNeedsYou, { operation: "mailboxesGetNeedsYou" });
12998
+ Object.assign(Mailboxes.listOrganizationDrafts, { operation: "mailboxesListOrganizationDrafts" });
12999
+ Object.assign(Mailboxes.listOrganizationThreads, { operation: "mailboxesListOrganizationThreads" });
12772
13000
  Object.assign(Mailboxes.listThreads, { operation: "mailboxesListThreads" });
12773
13001
  Object.assign(Mailboxes.getThread, { operation: "mailboxesGetThread" });
12774
13002
  Object.assign(Mailboxes.updateThread, { operation: "mailboxesUpdateThread" });