samva 0.18.0 → 0.20.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.
- package/README.md +2 -0
- package/dist/client/sdk.gen.d.ts +94 -36
- package/dist/client/sdk.gen.js +269 -55
- package/dist/client/types.gen.d.ts +497 -106
- package/dist/effect/campaigns.d.ts +35 -3
- package/dist/effect/contact-groups.d.ts +39 -3
- package/dist/effect/contacts.d.ts +240 -17
- package/dist/effect/contacts.js +3 -1
- package/dist/effect/conversations.d.ts +11 -11
- package/dist/effect/email.d.ts +22 -6
- package/dist/effect/errors.d.ts +1 -1
- package/dist/effect/errors.js +2 -2
- package/dist/effect/extension-installations.d.ts +12 -12
- package/dist/effect/extensions.d.ts +3 -3
- package/dist/effect/generated/campaigns.d.ts +73 -4
- package/dist/effect/generated/campaigns.js +18 -1
- package/dist/effect/generated/contact-groups.d.ts +33 -3
- package/dist/effect/generated/contacts.d.ts +608 -55
- package/dist/effect/generated/contacts.js +55 -10
- package/dist/effect/generated/conversations.d.ts +25 -25
- package/dist/effect/generated/conversations.js +1 -1
- package/dist/effect/generated/email.d.ts +162 -1
- package/dist/effect/generated/email.js +31 -11
- package/dist/effect/generated/extension-installations.d.ts +44 -44
- package/dist/effect/generated/extension-installations.js +6 -0
- package/dist/effect/generated/extensions.d.ts +10 -10
- package/dist/effect/generated/extensions.js +2 -0
- package/dist/effect/generated/journeys.d.ts +13 -61
- package/dist/effect/generated/journeys.js +5 -5
- package/dist/effect/generated/mailboxes.d.ts +584 -78
- package/dist/effect/generated/mailboxes.js +65 -24
- package/dist/effect/generated/messages.d.ts +35 -1
- package/dist/effect/generated/messages.js +9 -2
- package/dist/effect/generated/namespaces.d.ts +432 -2
- package/dist/effect/generated/namespaces.js +91 -4
- package/dist/effect/generated/organizations.d.ts +13 -11
- package/dist/effect/generated/organizations.js +7 -3
- package/dist/effect/generated/shared.d.ts +104 -49
- package/dist/effect/generated/shared.js +51 -28
- package/dist/effect/generated/templates.d.ts +44 -1
- package/dist/effect/generated/templates.js +9 -3
- package/dist/effect/generated/unsubscribe-groups.d.ts +173 -78
- package/dist/effect/generated/unsubscribe-groups.js +75 -58
- package/dist/effect/generated/webhooks.d.ts +19 -19
- package/dist/effect/generated/webhooks.js +8 -0
- package/dist/effect/generated-metadata.d.ts +22 -6
- package/dist/effect/generated-metadata.js +334 -329
- package/dist/effect/index.js +2 -2
- package/dist/effect/journeys.d.ts +4 -4
- package/dist/effect/mailboxes.d.ts +144 -12
- package/dist/effect/messages.d.ts +8 -0
- package/dist/effect/namespaces.d.ts +29 -0
- package/dist/effect/namespaces.js +7 -1
- package/dist/effect/organizations.d.ts +4 -4
- package/dist/effect/templates.d.ts +12 -1
- package/dist/effect/unsubscribe-groups.d.ts +29 -18
- package/dist/effect/unsubscribe-groups.js +5 -5
- package/dist/effect/webhooks.d.ts +8 -8
- package/dist/index.js +2 -2
- package/dist/mailbox-events.d.ts +31 -4
- package/dist/mailbox-events.js +39 -11
- package/dist/package.js +1 -1
- package/dist/promises/errors.gen.d.ts +2 -12
- package/dist/promises/errors.gen.js +1 -26
- package/dist/promises/index.d.ts +1 -1
- package/dist/promises/index.js +2 -2
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/service-map.d.ts +24 -4
- package/dist/service-map.js +26 -2
- package/package.json +2 -2
package/dist/client/sdk.gen.js
CHANGED
|
@@ -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
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
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,
|
|
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
|
|
1826
|
+
* Set the default sender
|
|
1804
1827
|
*
|
|
1805
|
-
* Marks a verified, active sender as the
|
|
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"
|
|
@@ -3528,10 +3559,14 @@ var Contacts = class {
|
|
|
3528
3559
|
/**
|
|
3529
3560
|
* Find a contact
|
|
3530
3561
|
*
|
|
3531
|
-
* Looks up a single contact by email address or external ID and returns null when no contact matches.
|
|
3562
|
+
* Looks up a single contact by exactly one of email address, phone number, or external ID and returns null when no contact matches. A phone number without `+` is read in the organization's default region.
|
|
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
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
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",
|
|
@@ -3704,7 +3746,7 @@ var Contacts = class {
|
|
|
3704
3746
|
},
|
|
3705
3747
|
{
|
|
3706
3748
|
in: "body",
|
|
3707
|
-
key: "
|
|
3749
|
+
key: "type"
|
|
3708
3750
|
},
|
|
3709
3751
|
{
|
|
3710
3752
|
in: "body",
|
|
@@ -3754,6 +3796,57 @@ var Contacts = class {
|
|
|
3754
3796
|
});
|
|
3755
3797
|
}
|
|
3756
3798
|
/**
|
|
3799
|
+
* Record contact consent
|
|
3800
|
+
*
|
|
3801
|
+
* Records the contact's consent on one channel at one of its addresses and returns the contact. `opted_out` stops every send on that channel to that address until the contact opts back in; `opted_in` is what channels that require opt-in check for. `source` and `capturedAt` say where and when the contact decided; `proof` keeps your evidence. A decision captured before the recorded one is ignored. A change publishes `contact.consent_changed`.
|
|
3802
|
+
*/
|
|
3803
|
+
static setConsent(parameters, options) {
|
|
3804
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
3805
|
+
{
|
|
3806
|
+
in: "path",
|
|
3807
|
+
key: "id"
|
|
3808
|
+
},
|
|
3809
|
+
{
|
|
3810
|
+
in: "path",
|
|
3811
|
+
key: "identityId"
|
|
3812
|
+
},
|
|
3813
|
+
{
|
|
3814
|
+
in: "path",
|
|
3815
|
+
key: "channel"
|
|
3816
|
+
},
|
|
3817
|
+
{
|
|
3818
|
+
in: "body",
|
|
3819
|
+
key: "status"
|
|
3820
|
+
},
|
|
3821
|
+
{
|
|
3822
|
+
in: "body",
|
|
3823
|
+
key: "source"
|
|
3824
|
+
},
|
|
3825
|
+
{
|
|
3826
|
+
in: "body",
|
|
3827
|
+
key: "capturedAt"
|
|
3828
|
+
},
|
|
3829
|
+
{
|
|
3830
|
+
in: "body",
|
|
3831
|
+
key: "proof"
|
|
3832
|
+
}
|
|
3833
|
+
] }]);
|
|
3834
|
+
return (options?.client ?? client).put({
|
|
3835
|
+
security: [{
|
|
3836
|
+
name: "x-api-key",
|
|
3837
|
+
type: "apiKey"
|
|
3838
|
+
}],
|
|
3839
|
+
url: "/v1/contacts/{id}/identities/{identityId}/consent/{channel}",
|
|
3840
|
+
...options,
|
|
3841
|
+
...params,
|
|
3842
|
+
headers: {
|
|
3843
|
+
"Content-Type": "application/json",
|
|
3844
|
+
...options?.headers,
|
|
3845
|
+
...params.headers
|
|
3846
|
+
}
|
|
3847
|
+
});
|
|
3848
|
+
}
|
|
3849
|
+
/**
|
|
3757
3850
|
* Remove contact tags
|
|
3758
3851
|
*
|
|
3759
3852
|
* Removes the given tags from the contact and returns the contact. A tag the contact does not have is ignored.
|
|
@@ -3835,13 +3928,20 @@ var Contacts = class {
|
|
|
3835
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"`.
|
|
3836
3929
|
*/
|
|
3837
3930
|
static bulkImport(parameters, options) {
|
|
3838
|
-
const params = buildClientParams([parameters], [{ args: [
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
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
|
+
] }]);
|
|
3845
3945
|
return (options?.client ?? client).post({
|
|
3846
3946
|
security: [{
|
|
3847
3947
|
name: "x-api-key",
|
|
@@ -5147,15 +5247,15 @@ var Unsubscribe = class {
|
|
|
5147
5247
|
/**
|
|
5148
5248
|
* Remove contacts from an unsubscribe group
|
|
5149
5249
|
*
|
|
5150
|
-
*
|
|
5250
|
+
* Returns contacts to an unsubscribe group's audience and returns the number removed. Each member is a contact ID, an email address, or a phone number; an address no contact holds is skipped.
|
|
5151
5251
|
*/
|
|
5152
|
-
static
|
|
5252
|
+
static removeMembers(parameters, options) {
|
|
5153
5253
|
const params = buildClientParams([parameters], [{ args: [{
|
|
5154
5254
|
in: "path",
|
|
5155
5255
|
key: "id"
|
|
5156
5256
|
}, {
|
|
5157
5257
|
in: "body",
|
|
5158
|
-
key: "
|
|
5258
|
+
key: "members"
|
|
5159
5259
|
}] }]);
|
|
5160
5260
|
return (options?.client ?? client).delete({
|
|
5161
5261
|
security: [{
|
|
@@ -5175,7 +5275,7 @@ var Unsubscribe = class {
|
|
|
5175
5275
|
/**
|
|
5176
5276
|
* List unsubscribe group members
|
|
5177
5277
|
*
|
|
5178
|
-
* Returns the
|
|
5278
|
+
* Returns the contacts that have left an unsubscribe group, newest first. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page.
|
|
5179
5279
|
*/
|
|
5180
5280
|
static listMembers(parameters, options) {
|
|
5181
5281
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -5205,9 +5305,9 @@ var Unsubscribe = class {
|
|
|
5205
5305
|
/**
|
|
5206
5306
|
* Add contacts to an unsubscribe group
|
|
5207
5307
|
*
|
|
5208
|
-
*
|
|
5308
|
+
* Moves contacts out of an unsubscribe group's audience and returns the number added and the number skipped. Leaving a group stops that group's sends to the contact on every channel. Each member is a contact ID, an email address, or a phone number; an address no contact holds gets a new contact, so an import from another email service needs no contacts first.
|
|
5209
5309
|
*/
|
|
5210
|
-
static
|
|
5310
|
+
static addMembers(parameters, options) {
|
|
5211
5311
|
const params = buildClientParams([parameters], [{ args: [
|
|
5212
5312
|
{
|
|
5213
5313
|
in: "path",
|
|
@@ -5215,7 +5315,7 @@ var Unsubscribe = class {
|
|
|
5215
5315
|
},
|
|
5216
5316
|
{
|
|
5217
5317
|
in: "body",
|
|
5218
|
-
key: "
|
|
5318
|
+
key: "members"
|
|
5219
5319
|
},
|
|
5220
5320
|
{
|
|
5221
5321
|
in: "body",
|
|
@@ -5240,16 +5340,27 @@ var Unsubscribe = class {
|
|
|
5240
5340
|
/**
|
|
5241
5341
|
* Check unsubscribe group membership
|
|
5242
5342
|
*
|
|
5243
|
-
* Returns the unsubscribe groups
|
|
5343
|
+
* Returns the unsubscribe groups a contact has left, optionally limited to a specified set of groups. Name the contact by exactly one of `contactId`, `email`, or `phone`. Membership belongs to the contact, so the answer is the same whichever identifier names it; `contactId` is null, and no groups are returned, when no contact holds the email or phone.
|
|
5244
5344
|
*/
|
|
5245
5345
|
static checkSubscription(parameters, options) {
|
|
5246
|
-
const params = buildClientParams([parameters], [{ args: [
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5346
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
5347
|
+
{
|
|
5348
|
+
in: "query",
|
|
5349
|
+
key: "contactId"
|
|
5350
|
+
},
|
|
5351
|
+
{
|
|
5352
|
+
in: "query",
|
|
5353
|
+
key: "email"
|
|
5354
|
+
},
|
|
5355
|
+
{
|
|
5356
|
+
in: "query",
|
|
5357
|
+
key: "phone"
|
|
5358
|
+
},
|
|
5359
|
+
{
|
|
5360
|
+
in: "query",
|
|
5361
|
+
key: "groupIds"
|
|
5362
|
+
}
|
|
5363
|
+
] }]);
|
|
5253
5364
|
return (options?.client ?? client).get({
|
|
5254
5365
|
security: [{
|
|
5255
5366
|
name: "x-api-key",
|
|
@@ -5481,6 +5592,10 @@ var Templates = class {
|
|
|
5481
5592
|
{
|
|
5482
5593
|
in: "query",
|
|
5483
5594
|
key: "projectId"
|
|
5595
|
+
},
|
|
5596
|
+
{
|
|
5597
|
+
in: "query",
|
|
5598
|
+
key: "namespaceId"
|
|
5484
5599
|
}
|
|
5485
5600
|
] }]);
|
|
5486
5601
|
return (options?.client ?? client).get({
|
|
@@ -5532,6 +5647,10 @@ var Templates = class {
|
|
|
5532
5647
|
in: "body",
|
|
5533
5648
|
key: "isActive"
|
|
5534
5649
|
},
|
|
5650
|
+
{
|
|
5651
|
+
in: "body",
|
|
5652
|
+
key: "namespaceId"
|
|
5653
|
+
},
|
|
5535
5654
|
{
|
|
5536
5655
|
in: "body",
|
|
5537
5656
|
key: "idempotencyKey"
|
|
@@ -7045,7 +7164,7 @@ var Organizations = class {
|
|
|
7045
7164
|
},
|
|
7046
7165
|
{
|
|
7047
7166
|
in: "body",
|
|
7048
|
-
key: "
|
|
7167
|
+
key: "defaultRegion"
|
|
7049
7168
|
},
|
|
7050
7169
|
{
|
|
7051
7170
|
in: "body",
|
|
@@ -7491,7 +7610,7 @@ var Mailboxes = class {
|
|
|
7491
7610
|
/**
|
|
7492
7611
|
* Create a mailbox
|
|
7493
7612
|
*
|
|
7494
|
-
* Creates a mailbox with one endpoint and returns it with status 201; the caller gets an admin grant on it.
|
|
7613
|
+
* 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.
|
|
7495
7614
|
*/
|
|
7496
7615
|
static create(parameters, options) {
|
|
7497
7616
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -7609,7 +7728,7 @@ var Mailboxes = class {
|
|
|
7609
7728
|
/**
|
|
7610
7729
|
* Add an endpoint to a mailbox
|
|
7611
7730
|
*
|
|
7612
|
-
* 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
|
|
7731
|
+
* 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.
|
|
7613
7732
|
*/
|
|
7614
7733
|
static createEndpoint(parameters, options) {
|
|
7615
7734
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -8636,7 +8755,7 @@ var Mailboxes = class {
|
|
|
8636
8755
|
/**
|
|
8637
8756
|
* Send a new message
|
|
8638
8757
|
*
|
|
8639
|
-
* Starts a new conversation from the mailbox's default endpoint on the channel the body names (email when omitted); a
|
|
8758
|
+
* 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.
|
|
8640
8759
|
*/
|
|
8641
8760
|
static sendMessage(parameters, options) {
|
|
8642
8761
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -8809,7 +8928,7 @@ var Mailboxes = class {
|
|
|
8809
8928
|
/**
|
|
8810
8929
|
* Reply to a message
|
|
8811
8930
|
*
|
|
8812
|
-
* 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.
|
|
8931
|
+
* 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.
|
|
8813
8932
|
*/
|
|
8814
8933
|
static reply(parameters, options) {
|
|
8815
8934
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -8868,7 +8987,7 @@ var Mailboxes = class {
|
|
|
8868
8987
|
/**
|
|
8869
8988
|
* Reply to all recipients of a message
|
|
8870
8989
|
*
|
|
8871
|
-
* 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.
|
|
8990
|
+
* 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.
|
|
8872
8991
|
*/
|
|
8873
8992
|
static replyAll(parameters, options) {
|
|
8874
8993
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -9104,7 +9223,7 @@ var Mailboxes = class {
|
|
|
9104
9223
|
/**
|
|
9105
9224
|
* Create a draft
|
|
9106
9225
|
*
|
|
9107
|
-
* 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.
|
|
9226
|
+
* 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`.
|
|
9108
9227
|
*/
|
|
9109
9228
|
static createDraft(parameters, options) {
|
|
9110
9229
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -9383,7 +9502,7 @@ var Mailboxes = class {
|
|
|
9383
9502
|
/**
|
|
9384
9503
|
* Cancel a mailbox send
|
|
9385
9504
|
*
|
|
9386
|
-
* Cancels a definitely unsent action and reopens its draft atomically. Only an authorized person who proposed the send or can approve actions may cancel. Accepted sends return 409 with their winning receipt and cannot be withdrawn. An uncertain send requires reconciliation and cannot be cancelled as unsent.
|
|
9505
|
+
* Cancels a definitely unsent action and reopens its draft atomically. Only an authorized person who proposed the send or can approve actions may cancel. Accepted sends return 409 with their winning receipt and cannot be withdrawn. An uncertain send requires reconciliation and cannot be cancelled as unsent. Cancelling a send held for approval records `resolution.outcome: cancelled` and publishes one `mailbox.action.resolved` event.
|
|
9387
9506
|
*/
|
|
9388
9507
|
static cancelAction(parameters, options) {
|
|
9389
9508
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -9429,7 +9548,7 @@ var Mailboxes = class {
|
|
|
9429
9548
|
/**
|
|
9430
9549
|
* Approve a mailbox action
|
|
9431
9550
|
*
|
|
9432
|
-
* Records approval of a send and returns 202 while it is pending. A send is queued for automatic retry within 15 minutes of approval; repeating approval does not extend this deadline. Accepted, completed, and notSent replays return 200. No expiry applies before approval. Only a person signed in or through OAuth may approve, and never the proposer. Non-send approvals execute synchronously and return 200 with their own execution states.
|
|
9551
|
+
* Records approval of a send and returns 202 while it is pending. A send is queued for automatic retry within 15 minutes of approval; repeating approval does not extend this deadline. Accepted, completed, and notSent replays return 200. No expiry applies before approval. Only a person signed in or through OAuth may approve, and never the proposer. Non-send approvals execute synchronously and return 200 with their own execution states. The action's `resolution` names the approver; approving a held send publishes one `mailbox.action.resolved` event.
|
|
9433
9552
|
*/
|
|
9434
9553
|
static approveAction(parameters, options) {
|
|
9435
9554
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -9452,7 +9571,7 @@ var Mailboxes = class {
|
|
|
9452
9571
|
/**
|
|
9453
9572
|
* Deny a mailbox action
|
|
9454
9573
|
*
|
|
9455
|
-
* Denies an action waiting for approval with a reason and returns it without executing it. Only a person signed in or through OAuth may deny, and never the one who proposed it.
|
|
9574
|
+
* Denies an action waiting for approval with a reason and returns it without executing it. Only a person signed in or through OAuth may deny, and never the one who proposed it. The action's `resolution` records the denier and reason; denying a held send publishes one `mailbox.action.resolved` event.
|
|
9456
9575
|
*/
|
|
9457
9576
|
static denyAction(parameters, options) {
|
|
9458
9577
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -9589,7 +9708,7 @@ var Namespaces = class {
|
|
|
9589
9708
|
/**
|
|
9590
9709
|
* Delete a namespace
|
|
9591
9710
|
*
|
|
9592
|
-
* Deletes an empty namespace. A namespace that still holds mailboxes, API keys, or webhook endpoints
|
|
9711
|
+
* 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.
|
|
9593
9712
|
*/
|
|
9594
9713
|
static remove(parameters, options) {
|
|
9595
9714
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -9661,6 +9780,101 @@ var Namespaces = class {
|
|
|
9661
9780
|
}
|
|
9662
9781
|
});
|
|
9663
9782
|
}
|
|
9783
|
+
/**
|
|
9784
|
+
* Move a resource into a namespace
|
|
9785
|
+
*
|
|
9786
|
+
* 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.
|
|
9787
|
+
*/
|
|
9788
|
+
static assignResource(parameters, options) {
|
|
9789
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
9790
|
+
{
|
|
9791
|
+
in: "path",
|
|
9792
|
+
key: "id"
|
|
9793
|
+
},
|
|
9794
|
+
{
|
|
9795
|
+
in: "body",
|
|
9796
|
+
key: "type"
|
|
9797
|
+
},
|
|
9798
|
+
{
|
|
9799
|
+
in: "body",
|
|
9800
|
+
key: "resourceId"
|
|
9801
|
+
}
|
|
9802
|
+
] }]);
|
|
9803
|
+
return (options?.client ?? client).post({
|
|
9804
|
+
security: [{
|
|
9805
|
+
name: "x-api-key",
|
|
9806
|
+
type: "apiKey"
|
|
9807
|
+
}],
|
|
9808
|
+
url: "/v1/namespaces/{id}/resources",
|
|
9809
|
+
...options,
|
|
9810
|
+
...params,
|
|
9811
|
+
headers: {
|
|
9812
|
+
"Content-Type": "application/json",
|
|
9813
|
+
...options?.headers,
|
|
9814
|
+
...params.headers
|
|
9815
|
+
}
|
|
9816
|
+
});
|
|
9817
|
+
}
|
|
9818
|
+
/**
|
|
9819
|
+
* Return a resource to organization level
|
|
9820
|
+
*
|
|
9821
|
+
* 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.
|
|
9822
|
+
*/
|
|
9823
|
+
static removeResource(parameters, options) {
|
|
9824
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
9825
|
+
{
|
|
9826
|
+
in: "path",
|
|
9827
|
+
key: "id"
|
|
9828
|
+
},
|
|
9829
|
+
{
|
|
9830
|
+
in: "path",
|
|
9831
|
+
key: "type"
|
|
9832
|
+
},
|
|
9833
|
+
{
|
|
9834
|
+
in: "path",
|
|
9835
|
+
key: "resourceId"
|
|
9836
|
+
}
|
|
9837
|
+
] }]);
|
|
9838
|
+
return (options?.client ?? client).delete({
|
|
9839
|
+
security: [{
|
|
9840
|
+
name: "x-api-key",
|
|
9841
|
+
type: "apiKey"
|
|
9842
|
+
}],
|
|
9843
|
+
url: "/v1/namespaces/{id}/resources/{type}/{resourceId}",
|
|
9844
|
+
...options,
|
|
9845
|
+
...params
|
|
9846
|
+
});
|
|
9847
|
+
}
|
|
9848
|
+
/**
|
|
9849
|
+
* Get namespace usage
|
|
9850
|
+
*
|
|
9851
|
+
* 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.
|
|
9852
|
+
*/
|
|
9853
|
+
static getUsage(parameters, options) {
|
|
9854
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
9855
|
+
{
|
|
9856
|
+
in: "path",
|
|
9857
|
+
key: "id"
|
|
9858
|
+
},
|
|
9859
|
+
{
|
|
9860
|
+
in: "query",
|
|
9861
|
+
key: "after"
|
|
9862
|
+
},
|
|
9863
|
+
{
|
|
9864
|
+
in: "query",
|
|
9865
|
+
key: "before"
|
|
9866
|
+
}
|
|
9867
|
+
] }]);
|
|
9868
|
+
return (options?.client ?? client).get({
|
|
9869
|
+
security: [{
|
|
9870
|
+
name: "x-api-key",
|
|
9871
|
+
type: "apiKey"
|
|
9872
|
+
}],
|
|
9873
|
+
url: "/v1/namespaces/{id}/usage",
|
|
9874
|
+
...options,
|
|
9875
|
+
...params
|
|
9876
|
+
});
|
|
9877
|
+
}
|
|
9664
9878
|
};
|
|
9665
9879
|
var Extensions = class {
|
|
9666
9880
|
/**
|