samva 0.34.0 → 0.35.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 (117) hide show
  1. package/README.md +1 -1
  2. package/dist/client/sdk.gen.d.ts +224 -250
  3. package/dist/client/sdk.gen.js +84 -210
  4. package/dist/client/types.gen.d.ts +2894 -401
  5. package/dist/effect/agents.d.ts +28 -13
  6. package/dist/effect/agents.js +5 -1
  7. package/dist/effect/analytics.d.ts +15 -15
  8. package/dist/effect/api-keys.d.ts +27 -18
  9. package/dist/effect/campaigns.d.ts +721 -65
  10. package/dist/effect/categories.d.ts +3 -3
  11. package/dist/effect/contact-groups.d.ts +15 -15
  12. package/dist/effect/contacts.d.ts +56 -52
  13. package/dist/effect/conversations.d.ts +45 -45
  14. package/dist/effect/email.d.ts +82 -82
  15. package/dist/effect/errors.d.ts +1 -1
  16. package/dist/effect/errors.js +2 -2
  17. package/dist/effect/extension-installations.d.ts +11 -11
  18. package/dist/effect/extensions.d.ts +16 -16
  19. package/dist/effect/generated/agents.d.ts +1063 -33
  20. package/dist/effect/generated/agents.js +133 -11
  21. package/dist/effect/generated/analytics.d.ts +109 -136
  22. package/dist/effect/generated/analytics.js +65 -36
  23. package/dist/effect/generated/api-keys.d.ts +240 -19
  24. package/dist/effect/generated/api-keys.js +24 -8
  25. package/dist/effect/generated/attachments.d.ts +89 -1
  26. package/dist/effect/generated/attachments.js +10 -2
  27. package/dist/effect/generated/brands.d.ts +133 -1
  28. package/dist/effect/generated/brands.js +22 -10
  29. package/dist/effect/generated/campaigns.d.ts +1442 -140
  30. package/dist/effect/generated/campaigns.js +82 -20
  31. package/dist/effect/generated/contact-events.d.ts +26 -4
  32. package/dist/effect/generated/contact-events.js +5 -3
  33. package/dist/effect/generated/contact-groups.d.ts +233 -13
  34. package/dist/effect/generated/contact-groups.js +33 -17
  35. package/dist/effect/generated/contacts.d.ts +634 -96
  36. package/dist/effect/generated/contacts.js +82 -20
  37. package/dist/effect/generated/conversations.d.ts +398 -106
  38. package/dist/effect/generated/conversations.js +96 -22
  39. package/dist/effect/generated/custom-fields.d.ts +89 -1
  40. package/dist/effect/generated/custom-fields.js +11 -3
  41. package/dist/effect/generated/email.d.ts +1447 -83
  42. package/dist/effect/generated/email.js +167 -43
  43. package/dist/effect/generated/events.d.ts +51 -7
  44. package/dist/effect/generated/events.js +9 -5
  45. package/dist/effect/generated/extension-installations.d.ts +208 -10
  46. package/dist/effect/generated/extension-installations.js +26 -8
  47. package/dist/effect/generated/extensions.d.ts +123 -13
  48. package/dist/effect/generated/extensions.js +20 -10
  49. package/dist/effect/generated/feedback.d.ts +23 -1
  50. package/dist/effect/generated/feedback.js +6 -4
  51. package/dist/effect/generated/journeys.d.ts +684 -16
  52. package/dist/effect/generated/journeys.js +37 -9
  53. package/dist/effect/generated/mailboxes.d.ts +3085 -627
  54. package/dist/effect/generated/mailboxes.js +340 -141
  55. package/dist/effect/generated/media.d.ts +125 -15
  56. package/dist/effect/generated/media.js +15 -2
  57. package/dist/effect/generated/messages.d.ts +2036 -117
  58. package/dist/effect/generated/messages.js +286 -54
  59. package/dist/effect/generated/namespaces.d.ts +209 -25
  60. package/dist/effect/generated/namespaces.js +27 -9
  61. package/dist/effect/generated/newsletter-domains.d.ts +98 -12
  62. package/dist/effect/generated/newsletter-domains.js +20 -13
  63. package/dist/effect/generated/newsletter-issues.d.ts +354 -19
  64. package/dist/effect/generated/newsletter-issues.js +162 -98
  65. package/dist/effect/generated/newsletters.d.ts +123 -13
  66. package/dist/effect/generated/newsletters.js +19 -9
  67. package/dist/effect/generated/operations.d.ts +76 -10
  68. package/dist/effect/generated/operations.js +12 -6
  69. package/dist/effect/generated/organizations.d.ts +287 -7
  70. package/dist/effect/generated/organizations.js +33 -5
  71. package/dist/effect/generated/scheduled-messages.d.ts +4427 -99
  72. package/dist/effect/generated/scheduled-messages.js +71 -12
  73. package/dist/effect/generated/shared.d.ts +2213 -190
  74. package/dist/effect/generated/shared.js +527 -76
  75. package/dist/effect/generated/subscriptions.d.ts +23 -1
  76. package/dist/effect/generated/subscriptions.js +6 -4
  77. package/dist/effect/generated/templates.d.ts +1718 -136
  78. package/dist/effect/generated/templates.js +421 -226
  79. package/dist/effect/generated/topic-forms.d.ts +111 -1
  80. package/dist/effect/generated/topic-forms.js +23 -13
  81. package/dist/effect/generated/topics.d.ts +353 -43
  82. package/dist/effect/generated/topics.js +67 -19
  83. package/dist/effect/generated/webhooks.d.ts +296 -38
  84. package/dist/effect/generated/webhooks.js +58 -16
  85. package/dist/effect/generated/whoami.d.ts +35 -1
  86. package/dist/effect/generated/whoami.js +4 -2
  87. package/dist/effect/generated-metadata.d.ts +20 -0
  88. package/dist/effect/generated-metadata.js +10 -0
  89. package/dist/effect/index.js +2 -2
  90. package/dist/effect/internal/client.js +1 -1
  91. package/dist/effect/internal/email-sender.d.ts +1 -1
  92. package/dist/effect/internal/send.d.ts +1 -1
  93. package/dist/effect/journeys.d.ts +105 -19
  94. package/dist/effect/mailboxes.d.ts +405 -174
  95. package/dist/effect/media.d.ts +1 -1
  96. package/dist/effect/messages.d.ts +40 -40
  97. package/dist/effect/namespaces.d.ts +15 -15
  98. package/dist/effect/newsletter-domains.d.ts +5 -5
  99. package/dist/effect/newsletters.d.ts +1 -1
  100. package/dist/effect/operations.d.ts +11 -11
  101. package/dist/effect/organizations.d.ts +2 -2
  102. package/dist/effect/scheduled-messages.d.ts +863 -8
  103. package/dist/effect/templates.d.ts +37 -37
  104. package/dist/effect/topics.d.ts +21 -21
  105. package/dist/effect/webhooks.d.ts +22 -22
  106. package/dist/index.js +2 -2
  107. package/dist/normalize.js +13 -1
  108. package/dist/package.js +1 -1
  109. package/dist/promises/client.d.ts +1 -1
  110. package/dist/promises/client.js +2 -2
  111. package/dist/promises/errors.gen.d.ts +22 -2
  112. package/dist/promises/errors.gen.js +60 -2
  113. package/dist/promises/index.js +2 -2
  114. package/dist/promises/types.gen.d.ts +1 -1
  115. package/dist/service-map.d.ts +9 -0
  116. package/dist/service-map.js +5 -0
  117. package/package.json +9 -8
@@ -72,40 +72,7 @@ var Messages = class {
72
72
  * 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.
73
73
  */
74
74
  static send(parameters, options) {
75
- const params = buildClientParams([parameters], [{ args: [
76
- {
77
- in: "body",
78
- key: "conversationId"
79
- },
80
- {
81
- in: "body",
82
- key: "metadata"
83
- },
84
- {
85
- in: "body",
86
- key: "channel"
87
- },
88
- {
89
- in: "body",
90
- key: "to"
91
- },
92
- {
93
- in: "body",
94
- key: "cc"
95
- },
96
- {
97
- in: "body",
98
- key: "bcc"
99
- },
100
- {
101
- in: "body",
102
- key: "from"
103
- },
104
- {
105
- in: "body",
106
- key: "email"
107
- }
108
- ] }]);
75
+ const params = { body: parameters };
109
76
  return requestWithPolicy(options?.client ?? client, "messagesSend", options, (headers) => (options?.client ?? client).post({
110
77
  security: [{
111
78
  name: "x-api-key",
@@ -114,7 +81,6 @@ var Messages = class {
114
81
  url: "/v1/messages",
115
82
  ...options,
116
83
  ...params,
117
- body: params.body ?? {},
118
84
  headers: {
119
85
  "Content-Type": "application/json",
120
86
  ...options?.headers,
@@ -2178,7 +2144,7 @@ var Email = class {
2178
2144
  /**
2179
2145
  * Update catch-all configuration
2180
2146
  *
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.
2147
+ * Updates a domain's catch-all webhook endpoint or unknown-address mailbox without disabling catch-all. The mailbox must be active, in the same organization, and have an email address on the domain. Omitted fields stay unchanged. `endpointId: null` removes the webhook endpoint, so unknown addresses reach the configured unknown-address mailbox or are dropped without a bounce when none is set. A webhook endpoint takes precedence over the unknown-address setting.
2182
2148
  */
2183
2149
  static updateCatchAllConfig(parameters, options) {
2184
2150
  const params = buildClientParams([parameters], [{ args: [
@@ -5221,6 +5187,22 @@ var Agents = class {
5221
5187
  }));
5222
5188
  }
5223
5189
  /**
5190
+ * List agent models
5191
+ *
5192
+ * Returns the models an agent can run on: the standard and max aliases, each with the model it points at today, then every catalog model an agent can pin. Each entry has its price per million tokens, the reasoning levels it accepts with an estimate of a typical reply at each, and whether your plan includes it. Pinning a catalog model needs the Growth or Scale plan.
5193
+ */
5194
+ static listModels(options) {
5195
+ return requestWithPolicy(options?.client ?? client, "agentsListModels", options, (headers) => (options?.client ?? client).get({
5196
+ security: [{
5197
+ name: "x-api-key",
5198
+ type: "apiKey"
5199
+ }],
5200
+ url: "/v1/agents/models",
5201
+ ...options,
5202
+ headers
5203
+ }));
5204
+ }
5205
+ /**
5224
5206
  * Delete an agent
5225
5207
  *
5226
5208
  * Deletes an agent with its draft and published versions. The endpoints it answered on stop being answered by an agent. A reply already running finishes on the version it started on.
@@ -5263,18 +5245,25 @@ var Agents = class {
5263
5245
  }));
5264
5246
  }
5265
5247
  /**
5266
- * Rename an agent
5248
+ * Update an agent
5267
5249
  *
5268
- * Renames an agent.
5250
+ * Renames an agent or sets its monthly spend cap. Both take effect at once, without publishing. At the cap the agent pauses and its conversations wait for your team until the month turns (UTC) or the cap is raised or removed.
5269
5251
  */
5270
5252
  static update(parameters, options) {
5271
- const params = buildClientParams([parameters], [{ args: [{
5272
- in: "path",
5273
- key: "id"
5274
- }, {
5275
- in: "body",
5276
- key: "name"
5277
- }] }]);
5253
+ const params = buildClientParams([parameters], [{ args: [
5254
+ {
5255
+ in: "path",
5256
+ key: "id"
5257
+ },
5258
+ {
5259
+ in: "body",
5260
+ key: "name"
5261
+ },
5262
+ {
5263
+ in: "body",
5264
+ key: "monthlySpendCapDollars"
5265
+ }
5266
+ ] }]);
5278
5267
  return requestWithPolicy(options?.client ?? client, "agentsUpdate", options, (headers) => (options?.client ?? client).patch({
5279
5268
  security: [{
5280
5269
  name: "x-api-key",
@@ -5298,7 +5287,7 @@ var Agents = class {
5298
5287
  /**
5299
5288
  * Replace an agent draft
5300
5289
  *
5301
- * Replaces the whole draft and returns the agent with a new revision. The request names the revision it read; a stale revision returns 409. Published versions, and the conversations answered on them, do not change. An endpoint answers for one agent at a time: a draft that names an endpoint another agent answers on returns 409.
5290
+ * Replaces the whole draft and returns the agent with a new revision. The request names the revision it read; a stale revision returns 409. Published versions, and the conversations answered on them, do not change. An endpoint answers for one agent at a time: a draft that names an endpoint another agent answers on returns 409. A draft that pins a catalog model returns 402 unless your plan is Growth or Scale, and 422 when the model is not available or does not support the reasoning level.
5302
5291
  */
5303
5292
  static replaceDraft(parameters, options) {
5304
5293
  const params = buildClientParams([parameters], [{ args: [
@@ -5369,6 +5358,27 @@ var Agents = class {
5369
5358
  }));
5370
5359
  }
5371
5360
  /**
5361
+ * Continue an agent on Standard
5362
+ *
5363
+ * Publishes the live version again with its model set to standard, as the next immutable version, then removes the monthly spend cap. Use it when the agent pauses at its cap on a pinned model and should keep answering on Standard. The draft is left as it is, so its unpublished changes stay unpublished. The live version's reasoning level is kept when Standard supports it, and is auto otherwise. A live version already on standard publishes nothing and answers published false; the cap is still removed. An agent with no published version returns 422; a version published while the request runs returns 409.
5364
+ */
5365
+ static continueOnStandard(parameters, options) {
5366
+ const params = buildClientParams([parameters], [{ args: [{
5367
+ in: "path",
5368
+ key: "id"
5369
+ }] }]);
5370
+ return requestWithPolicy(options?.client ?? client, "agentsContinueOnStandard", options, (headers) => (options?.client ?? client).post({
5371
+ security: [{
5372
+ name: "x-api-key",
5373
+ type: "apiKey"
5374
+ }],
5375
+ url: "/v1/agents/{id}/continue-on-standard",
5376
+ ...options,
5377
+ ...params,
5378
+ headers
5379
+ }));
5380
+ }
5381
+ /**
5372
5382
  * List published agent versions
5373
5383
  *
5374
5384
  * Returns an agent's published versions, newest first, without their definitions. Pass nextCursor back as cursor for the next page.
@@ -11098,48 +11108,11 @@ var Mailboxes = class {
11098
11108
  * 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.
11099
11109
  */
11100
11110
  static sendMessage(parameters, options) {
11101
- const params = buildClientParams([parameters], [{ args: [
11102
- {
11103
- in: "path",
11104
- key: "id"
11105
- },
11106
- {
11107
- in: "body",
11108
- key: "channel"
11109
- },
11110
- {
11111
- in: "body",
11112
- key: "to"
11113
- },
11114
- {
11115
- in: "body",
11116
- key: "cc"
11117
- },
11118
- {
11119
- in: "body",
11120
- key: "bcc"
11121
- },
11122
- {
11123
- in: "body",
11124
- key: "replyTo"
11125
- },
11126
- {
11127
- in: "body",
11128
- key: "subject"
11129
- },
11130
- {
11131
- in: "body",
11132
- key: "text"
11133
- },
11134
- {
11135
- in: "body",
11136
- key: "html"
11137
- },
11138
- {
11139
- in: "body",
11140
- key: "attachments"
11141
- }
11142
- ] }]);
11111
+ const params = buildClientParams([parameters], [{ args: [{
11112
+ in: "path",
11113
+ key: "id"
11114
+ }] }]);
11115
+ params.body = Object.fromEntries(Object.entries(parameters).filter(([key]) => !["id"].includes(key)));
11143
11116
  return requestWithPolicy(options?.client ?? client, "mailboxesSendMessage", options, (headers) => (options?.client ?? client).post({
11144
11117
  security: [{
11145
11118
  name: "x-api-key",
@@ -11148,7 +11121,6 @@ var Mailboxes = class {
11148
11121
  url: "/v1/mailboxes/{id}/messages",
11149
11122
  ...options,
11150
11123
  ...params,
11151
- body: params.body ?? {},
11152
11124
  headers: {
11153
11125
  "Content-Type": "application/json",
11154
11126
  ...options?.headers,
@@ -11276,40 +11248,14 @@ var Mailboxes = class {
11276
11248
  * 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.
11277
11249
  */
11278
11250
  static reply(parameters, options) {
11279
- const params = buildClientParams([parameters], [{ args: [
11280
- {
11281
- in: "path",
11282
- key: "id"
11283
- },
11284
- {
11285
- in: "path",
11286
- key: "messageId"
11287
- },
11288
- {
11289
- in: "body",
11290
- key: "channel"
11291
- },
11292
- {
11293
- in: "body",
11294
- key: "cc"
11295
- },
11296
- {
11297
- in: "body",
11298
- key: "bcc"
11299
- },
11300
- {
11301
- in: "body",
11302
- key: "text"
11303
- },
11304
- {
11305
- in: "body",
11306
- key: "html"
11307
- },
11308
- {
11309
- in: "body",
11310
- key: "attachments"
11311
- }
11312
- ] }]);
11251
+ const params = buildClientParams([parameters], [{ args: [{
11252
+ in: "path",
11253
+ key: "id"
11254
+ }, {
11255
+ in: "path",
11256
+ key: "messageId"
11257
+ }] }]);
11258
+ params.body = Object.fromEntries(Object.entries(parameters).filter(([key]) => !["id", "messageId"].includes(key)));
11313
11259
  return requestWithPolicy(options?.client ?? client, "mailboxesReply", options, (headers) => (options?.client ?? client).post({
11314
11260
  security: [{
11315
11261
  name: "x-api-key",
@@ -11318,7 +11264,6 @@ var Mailboxes = class {
11318
11264
  url: "/v1/mailboxes/{id}/messages/{messageId}/reply",
11319
11265
  ...options,
11320
11266
  ...params,
11321
- body: params.body ?? {},
11322
11267
  headers: {
11323
11268
  "Content-Type": "application/json",
11324
11269
  ...options?.headers,
@@ -11336,40 +11281,14 @@ var Mailboxes = class {
11336
11281
  * 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.
11337
11282
  */
11338
11283
  static replyAll(parameters, options) {
11339
- const params = buildClientParams([parameters], [{ args: [
11340
- {
11341
- in: "path",
11342
- key: "id"
11343
- },
11344
- {
11345
- in: "path",
11346
- key: "messageId"
11347
- },
11348
- {
11349
- in: "body",
11350
- key: "channel"
11351
- },
11352
- {
11353
- in: "body",
11354
- key: "cc"
11355
- },
11356
- {
11357
- in: "body",
11358
- key: "bcc"
11359
- },
11360
- {
11361
- in: "body",
11362
- key: "text"
11363
- },
11364
- {
11365
- in: "body",
11366
- key: "html"
11367
- },
11368
- {
11369
- in: "body",
11370
- key: "attachments"
11371
- }
11372
- ] }]);
11284
+ const params = buildClientParams([parameters], [{ args: [{
11285
+ in: "path",
11286
+ key: "id"
11287
+ }, {
11288
+ in: "path",
11289
+ key: "messageId"
11290
+ }] }]);
11291
+ params.body = Object.fromEntries(Object.entries(parameters).filter(([key]) => !["id", "messageId"].includes(key)));
11373
11292
  return requestWithPolicy(options?.client ?? client, "mailboxesReplyAll", options, (headers) => (options?.client ?? client).post({
11374
11293
  security: [{
11375
11294
  name: "x-api-key",
@@ -11378,7 +11297,6 @@ var Mailboxes = class {
11378
11297
  url: "/v1/mailboxes/{id}/messages/{messageId}/reply-all",
11379
11298
  ...options,
11380
11299
  ...params,
11381
- body: params.body ?? {},
11382
11300
  headers: {
11383
11301
  "Content-Type": "application/json",
11384
11302
  ...options?.headers,
@@ -11578,56 +11496,11 @@ var Mailboxes = class {
11578
11496
  * 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`.
11579
11497
  */
11580
11498
  static createDraft(parameters, options) {
11581
- const params = buildClientParams([parameters], [{ args: [
11582
- {
11583
- in: "path",
11584
- key: "id"
11585
- },
11586
- {
11587
- in: "body",
11588
- key: "channel"
11589
- },
11590
- {
11591
- in: "body",
11592
- key: "endpointId"
11593
- },
11594
- {
11595
- in: "body",
11596
- key: "to"
11597
- },
11598
- {
11599
- in: "body",
11600
- key: "cc"
11601
- },
11602
- {
11603
- in: "body",
11604
- key: "bcc"
11605
- },
11606
- {
11607
- in: "body",
11608
- key: "replyTo"
11609
- },
11610
- {
11611
- in: "body",
11612
- key: "subject"
11613
- },
11614
- {
11615
- in: "body",
11616
- key: "text"
11617
- },
11618
- {
11619
- in: "body",
11620
- key: "html"
11621
- },
11622
- {
11623
- in: "body",
11624
- key: "attachments"
11625
- },
11626
- {
11627
- in: "body",
11628
- key: "inReplyToMessageId"
11629
- }
11630
- ] }]);
11499
+ const params = buildClientParams([parameters], [{ args: [{
11500
+ in: "path",
11501
+ key: "id"
11502
+ }] }]);
11503
+ params.body = Object.fromEntries(Object.entries(parameters).filter(([key]) => !["id"].includes(key)));
11631
11504
  return requestWithPolicy(options?.client ?? client, "mailboxesCreateDraft", options, (headers) => (options?.client ?? client).post({
11632
11505
  security: [{
11633
11506
  name: "x-api-key",
@@ -11636,7 +11509,6 @@ var Mailboxes = class {
11636
11509
  url: "/v1/mailboxes/{id}/drafts",
11637
11510
  ...options,
11638
11511
  ...params,
11639
- body: params.body ?? {},
11640
11512
  headers: {
11641
11513
  "Content-Type": "application/json",
11642
11514
  ...options?.headers,
@@ -12835,11 +12707,13 @@ Object.assign(Journeys.listRuns, { operation: "journeysListRuns" });
12835
12707
  Object.assign(Journeys.getRun, { operation: "journeysGetRun" });
12836
12708
  Object.assign(Agents.list, { operation: "agentsList" });
12837
12709
  Object.assign(Agents.create, { operation: "agentsCreate" });
12710
+ Object.assign(Agents.listModels, { operation: "agentsListModels" });
12838
12711
  Object.assign(Agents.remove, { operation: "agentsRemove" });
12839
12712
  Object.assign(Agents.get, { operation: "agentsGet" });
12840
12713
  Object.assign(Agents.update, { operation: "agentsUpdate" });
12841
12714
  Object.assign(Agents.replaceDraft, { operation: "agentsReplaceDraft" });
12842
12715
  Object.assign(Agents.publish, { operation: "agentsPublish" });
12716
+ Object.assign(Agents.continueOnStandard, { operation: "agentsContinueOnStandard" });
12843
12717
  Object.assign(Agents.listVersions, { operation: "agentsListVersions" });
12844
12718
  Object.assign(Agents.getVersion, { operation: "agentsGetVersion" });
12845
12719
  Object.assign(Subscriptions.subscribe, { operation: "subscriptionsSubscribe" });