samva 0.6.0 → 0.8.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 -2
- package/dist/{categories-4u9Az4No.js → categories-DvsHUJtX.js} +9 -1
- package/dist/client/sdk.gen.d.ts +119 -33
- package/dist/client/types.gen.d.ts +643 -142
- package/dist/{client-DCM6U0-I.js → client-ByJHYp7r.js} +612 -223
- package/dist/{client-attribution-DYUSAa76.js → client-attribution-N5A784Zo.js} +2 -2
- package/dist/effect/analytics.js +1 -1
- package/dist/effect/api-keys.js +1 -1
- package/dist/effect/attachments.js +1 -1
- package/dist/effect/brands.d.ts +212 -0
- package/dist/effect/brands.js +24 -0
- package/dist/effect/campaigns.d.ts +35 -1
- package/dist/effect/campaigns.js +1 -1
- package/dist/effect/categories.js +1 -1
- package/dist/effect/client.js +1 -1
- package/dist/effect/contact-groups.js +1 -1
- package/dist/effect/contacts.js +1 -1
- package/dist/effect/conversations.d.ts +21 -12
- package/dist/effect/conversations.js +1 -1
- package/dist/effect/custom-fields.js +1 -1
- package/dist/effect/email.d.ts +17 -6
- package/dist/effect/email.js +2 -2
- package/dist/effect/generated-metadata.d.ts +8 -0
- package/dist/effect/generated.d.ts +2880 -1661
- package/dist/effect/index.d.ts +2 -2
- package/dist/effect/index.js +4 -4
- package/dist/effect/internal/operation.d.ts +10 -4
- package/dist/effect/media.js +1 -1
- package/dist/effect/messages.d.ts +24 -6
- package/dist/effect/messages.js +1 -1
- package/dist/effect/operations.js +1 -1
- package/dist/effect/organizations.d.ts +5 -268
- package/dist/effect/organizations.js +4 -2
- package/dist/effect/retry.js +1 -1
- package/dist/effect/scheduled-messages.d.ts +16 -0
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/templates.d.ts +260 -38
- package/dist/effect/templates.js +7 -3
- package/dist/effect/unsubscribe-groups.d.ts +17 -0
- package/dist/effect/unsubscribe-groups.js +4 -2
- package/dist/effect/webhooks.d.ts +6 -6
- package/dist/effect/webhooks.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{operation-02YX3hY9.js → operation-D2nEeKBD.js} +34 -5
- package/dist/promises/errors.gen.d.ts +22 -4
- package/dist/promises/index.d.ts +3 -3
- package/dist/promises/index.js +2 -2
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-8MaPNAam.js → promises-DAv8ZtOX.js} +376 -52
- package/dist/service-map.d.ts +45 -6
- package/package.json +7 -7
- package/dist/effect/design.d.ts +0 -209
- package/dist/effect/design.js +0 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as clientAttribution, t as CLIENT_ATTRIBUTION_HEADER } from "./client-attribution-
|
|
1
|
+
import { n as clientAttribution, t as CLIENT_ATTRIBUTION_HEADER } from "./client-attribution-N5A784Zo.js";
|
|
2
2
|
import { n as buildMessagesSendPayload, r as replyToEmailsPayload, t as buildEmailSendPayload } from "./normalize-B79uJIeb.js";
|
|
3
3
|
//#region src/client/core/bodySerializer.gen.ts
|
|
4
4
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
@@ -1340,7 +1340,7 @@ var Campaigns = class {
|
|
|
1340
1340
|
/**
|
|
1341
1341
|
* Schedule a campaign run
|
|
1342
1342
|
*
|
|
1343
|
-
* Schedules an email campaign run at the absolute ISO-8601 instant in scheduledFor, or immediately when omitted. The optional idempotencyKey is scoped to the organization and replays return the original run.
|
|
1343
|
+
* Schedules an email campaign run at the absolute ISO-8601 instant in scheduledFor, or immediately when omitted. The optional idempotencyKey is scoped to the organization and replays return the original run. An email campaign must carry the brand footer: it is refused with CampaignFooterRequiredError when its footer is off and its template renders no BrandFooter, and with BrandAddressRequiredError when a brand that signs it off has no postal address.
|
|
1344
1344
|
*/
|
|
1345
1345
|
static scheduleRun(parameters, options) {
|
|
1346
1346
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -1673,16 +1673,23 @@ var Email = class {
|
|
|
1673
1673
|
/**
|
|
1674
1674
|
* List sending domains
|
|
1675
1675
|
*
|
|
1676
|
-
* Returns a paginated list of the organization's sending domains. 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.
|
|
1676
|
+
* Returns a paginated list of the organization's sending domains. `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.
|
|
1677
1677
|
*/
|
|
1678
1678
|
static listDomains(parameters, options) {
|
|
1679
|
-
const params = buildClientParams([parameters], [{ args: [
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1679
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
1680
|
+
{
|
|
1681
|
+
in: "query",
|
|
1682
|
+
key: "page"
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
in: "query",
|
|
1686
|
+
key: "limit"
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
in: "query",
|
|
1690
|
+
key: "sendable"
|
|
1691
|
+
}
|
|
1692
|
+
] }]);
|
|
1686
1693
|
return (options?.client ?? client).get({
|
|
1687
1694
|
security: [{
|
|
1688
1695
|
name: "x-api-key",
|
|
@@ -1696,7 +1703,7 @@ var Email = class {
|
|
|
1696
1703
|
/**
|
|
1697
1704
|
* Add a sending domain
|
|
1698
1705
|
*
|
|
1699
|
-
* 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.
|
|
1706
|
+
* 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.
|
|
1700
1707
|
*/
|
|
1701
1708
|
static addDomain(parameters, options) {
|
|
1702
1709
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -2056,7 +2063,7 @@ var Email = class {
|
|
|
2056
2063
|
/**
|
|
2057
2064
|
* Update a domain's send-settings config
|
|
2058
2065
|
*
|
|
2059
|
-
* Overrides the domain's open/click tracking, reply-to,
|
|
2066
|
+
* Overrides the domain's open/click tracking, reply-to, unsubscribe-group defaults, and the brand its mail uses for the settings cascade. An omitted field is left unchanged; null clears it back to the organization default. Returns the saved config.
|
|
2060
2067
|
*/
|
|
2061
2068
|
static updateDomainConfig(parameters, options) {
|
|
2062
2069
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -2083,6 +2090,10 @@ var Email = class {
|
|
|
2083
2090
|
{
|
|
2084
2091
|
in: "body",
|
|
2085
2092
|
key: "footerEnabled"
|
|
2093
|
+
},
|
|
2094
|
+
{
|
|
2095
|
+
in: "body",
|
|
2096
|
+
key: "brandSlug"
|
|
2086
2097
|
}
|
|
2087
2098
|
] }]);
|
|
2088
2099
|
return (options?.client ?? client).patch({
|
|
@@ -2248,9 +2259,9 @@ var Email = class {
|
|
|
2248
2259
|
});
|
|
2249
2260
|
}
|
|
2250
2261
|
/**
|
|
2251
|
-
* List
|
|
2262
|
+
* List senders
|
|
2252
2263
|
*
|
|
2253
|
-
* Returns a paginated list of
|
|
2264
|
+
* Returns a paginated list of senders, optionally filtered by verification status, active state, or default flag. 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.
|
|
2254
2265
|
*/
|
|
2255
2266
|
static listSenders(parameters, options) {
|
|
2256
2267
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -2286,9 +2297,9 @@ var Email = class {
|
|
|
2286
2297
|
});
|
|
2287
2298
|
}
|
|
2288
2299
|
/**
|
|
2289
|
-
* Add a sender
|
|
2300
|
+
* Add a sender
|
|
2290
2301
|
*
|
|
2291
|
-
* Creates a sender
|
|
2302
|
+
* Creates a sender. The required Idempotency-Key replays the original sender for an identical request and conflicts when reused with different input.
|
|
2292
2303
|
*/
|
|
2293
2304
|
static addSender(parameters, options) {
|
|
2294
2305
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -2331,7 +2342,7 @@ var Email = class {
|
|
|
2331
2342
|
/**
|
|
2332
2343
|
* Check sender verification status
|
|
2333
2344
|
*
|
|
2334
|
-
* Returns the current verification status of a sender
|
|
2345
|
+
* Returns the current verification status of a sender.
|
|
2335
2346
|
*/
|
|
2336
2347
|
static checkSenderVerification(parameters, options) {
|
|
2337
2348
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -2349,9 +2360,9 @@ var Email = class {
|
|
|
2349
2360
|
});
|
|
2350
2361
|
}
|
|
2351
2362
|
/**
|
|
2352
|
-
* Remove a sender
|
|
2363
|
+
* Remove a sender
|
|
2353
2364
|
*
|
|
2354
|
-
* Accepts sender removal and marks the sender inactive. It reports the `deleting` lifecycle until removal finishes.
|
|
2365
|
+
* Accepts sender removal and marks the sender inactive. A default sender can be removed when no other active sender remains in the organization. It reports the `deleting` lifecycle until removal finishes.
|
|
2355
2366
|
*/
|
|
2356
2367
|
static removeSender(parameters, options) {
|
|
2357
2368
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -2369,9 +2380,9 @@ var Email = class {
|
|
|
2369
2380
|
});
|
|
2370
2381
|
}
|
|
2371
2382
|
/**
|
|
2372
|
-
* Get a sender
|
|
2383
|
+
* Get a sender
|
|
2373
2384
|
*
|
|
2374
|
-
* Returns one sender
|
|
2385
|
+
* Returns one sender owned by the authenticated organization. Other organizations' ids are reported as not found.
|
|
2375
2386
|
*/
|
|
2376
2387
|
static getSender(parameters, options) {
|
|
2377
2388
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -4901,7 +4912,7 @@ var Unsubscribe = class {
|
|
|
4901
4912
|
/**
|
|
4902
4913
|
* List unsubscribe groups
|
|
4903
4914
|
*
|
|
4904
|
-
* Returns a paginated list of the organization's unsubscribe groups.
|
|
4915
|
+
* Returns a paginated list of the organization's unsubscribe groups, the default group first.
|
|
4905
4916
|
*/
|
|
4906
4917
|
static list(parameters, options) {
|
|
4907
4918
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -4952,7 +4963,7 @@ var Unsubscribe = class {
|
|
|
4952
4963
|
/**
|
|
4953
4964
|
* Delete an unsubscribe group
|
|
4954
4965
|
*
|
|
4955
|
-
* Permanently deletes an unsubscribe group by its ID.
|
|
4966
|
+
* Permanently deletes an unsubscribe group by its ID. The default group cannot be deleted; make another group the default first. A group a scheduled or running campaign uses cannot be deleted until that run finishes or is cancelled.
|
|
4956
4967
|
*/
|
|
4957
4968
|
static remove(parameters, options) {
|
|
4958
4969
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -5005,6 +5016,26 @@ var Unsubscribe = class {
|
|
|
5005
5016
|
});
|
|
5006
5017
|
}
|
|
5007
5018
|
/**
|
|
5019
|
+
* Make an unsubscribe group the default
|
|
5020
|
+
*
|
|
5021
|
+
* Makes this group the organization's default: campaigns that name no group, and whose template and sending domain name none, unsubscribe recipients from it.
|
|
5022
|
+
*/
|
|
5023
|
+
static setDefault(parameters, options) {
|
|
5024
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
5025
|
+
in: "path",
|
|
5026
|
+
key: "id"
|
|
5027
|
+
}] }]);
|
|
5028
|
+
return (options?.client ?? client).post({
|
|
5029
|
+
security: [{
|
|
5030
|
+
name: "x-api-key",
|
|
5031
|
+
type: "apiKey"
|
|
5032
|
+
}],
|
|
5033
|
+
url: "/v1/unsubscribe-groups/{id}/default",
|
|
5034
|
+
...options,
|
|
5035
|
+
...params
|
|
5036
|
+
});
|
|
5037
|
+
}
|
|
5038
|
+
/**
|
|
5008
5039
|
* Remove contacts from an unsubscribe group
|
|
5009
5040
|
*
|
|
5010
5041
|
* Removes one or more email addresses from an unsubscribe group and returns the number removed.
|
|
@@ -5338,6 +5369,10 @@ var Templates = class {
|
|
|
5338
5369
|
in: "query",
|
|
5339
5370
|
key: "search"
|
|
5340
5371
|
},
|
|
5372
|
+
{
|
|
5373
|
+
in: "query",
|
|
5374
|
+
key: "projectId"
|
|
5375
|
+
},
|
|
5341
5376
|
{
|
|
5342
5377
|
in: "query",
|
|
5343
5378
|
key: "sortBy"
|
|
@@ -5380,6 +5415,10 @@ var Templates = class {
|
|
|
5380
5415
|
in: "body",
|
|
5381
5416
|
key: "galleryTemplateId"
|
|
5382
5417
|
},
|
|
5418
|
+
{
|
|
5419
|
+
in: "body",
|
|
5420
|
+
key: "useBrand"
|
|
5421
|
+
},
|
|
5383
5422
|
{
|
|
5384
5423
|
in: "body",
|
|
5385
5424
|
key: "description"
|
|
@@ -5645,7 +5684,7 @@ var Templates = class {
|
|
|
5645
5684
|
/**
|
|
5646
5685
|
* Update a template
|
|
5647
5686
|
*
|
|
5648
|
-
* Updates template metadata. Source changes use the project workspace API.
|
|
5687
|
+
* Updates template metadata. Setting `entryPath` points the template at another file in its project and keeps its id, slug, and publications; move the file in Git separately. Source changes use the project workspace API.
|
|
5649
5688
|
*/
|
|
5650
5689
|
static update(parameters, options) {
|
|
5651
5690
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -5671,6 +5710,53 @@ var Templates = class {
|
|
|
5671
5710
|
});
|
|
5672
5711
|
}
|
|
5673
5712
|
/**
|
|
5713
|
+
* Add a template entry
|
|
5714
|
+
*
|
|
5715
|
+
* Registers a `.tsx` file under `templates/` or `emails/` in an existing template project as its own template and returns it with status 201. The file does not need to exist yet; publishing fails until a commit contains it. Repeating the call with the same entry path, name, and slug returns the existing template.
|
|
5716
|
+
*/
|
|
5717
|
+
static addEntry(parameters, options) {
|
|
5718
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
5719
|
+
{
|
|
5720
|
+
in: "path",
|
|
5721
|
+
key: "projectId"
|
|
5722
|
+
},
|
|
5723
|
+
{
|
|
5724
|
+
in: "body",
|
|
5725
|
+
key: "entryPath"
|
|
5726
|
+
},
|
|
5727
|
+
{
|
|
5728
|
+
in: "body",
|
|
5729
|
+
key: "name"
|
|
5730
|
+
},
|
|
5731
|
+
{
|
|
5732
|
+
in: "body",
|
|
5733
|
+
key: "slug"
|
|
5734
|
+
},
|
|
5735
|
+
{
|
|
5736
|
+
in: "body",
|
|
5737
|
+
key: "description"
|
|
5738
|
+
},
|
|
5739
|
+
{
|
|
5740
|
+
in: "body",
|
|
5741
|
+
key: "category"
|
|
5742
|
+
}
|
|
5743
|
+
] }]);
|
|
5744
|
+
return (options?.client ?? client).post({
|
|
5745
|
+
security: [{
|
|
5746
|
+
name: "x-api-key",
|
|
5747
|
+
type: "apiKey"
|
|
5748
|
+
}],
|
|
5749
|
+
url: "/v1/templates/projects/{projectId}/entries",
|
|
5750
|
+
...options,
|
|
5751
|
+
...params,
|
|
5752
|
+
headers: {
|
|
5753
|
+
"Content-Type": "application/json",
|
|
5754
|
+
...options?.headers,
|
|
5755
|
+
...params.headers
|
|
5756
|
+
}
|
|
5757
|
+
});
|
|
5758
|
+
}
|
|
5759
|
+
/**
|
|
5674
5760
|
* Patch template project files
|
|
5675
5761
|
*
|
|
5676
5762
|
* Applies revision-checked file patches to the shared project workspace overlay.
|
|
@@ -5758,6 +5844,53 @@ var Templates = class {
|
|
|
5758
5844
|
});
|
|
5759
5845
|
}
|
|
5760
5846
|
/**
|
|
5847
|
+
* Put a template project asset
|
|
5848
|
+
*
|
|
5849
|
+
* Writes one image or font (png, jpg, jpeg, gif, webp, or woff2) into the shared project workspace as an unsaved file; Save commits it. The JSON body carries the file as canonical base64 in `contentBase64`, at most 1 MiB decoded, and the bytes must match the extension in `path`. `replace` must be `false` to add a new file and `true` to change an existing one.
|
|
5850
|
+
*/
|
|
5851
|
+
static putWorkspaceAsset(parameters, options) {
|
|
5852
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
5853
|
+
{
|
|
5854
|
+
in: "path",
|
|
5855
|
+
key: "id"
|
|
5856
|
+
},
|
|
5857
|
+
{
|
|
5858
|
+
in: "body",
|
|
5859
|
+
key: "expectedRevision"
|
|
5860
|
+
},
|
|
5861
|
+
{
|
|
5862
|
+
in: "body",
|
|
5863
|
+
key: "path"
|
|
5864
|
+
},
|
|
5865
|
+
{
|
|
5866
|
+
in: "body",
|
|
5867
|
+
key: "contentBase64"
|
|
5868
|
+
},
|
|
5869
|
+
{
|
|
5870
|
+
in: "body",
|
|
5871
|
+
key: "replace"
|
|
5872
|
+
},
|
|
5873
|
+
{
|
|
5874
|
+
in: "body",
|
|
5875
|
+
key: "idempotencyKey"
|
|
5876
|
+
}
|
|
5877
|
+
] }]);
|
|
5878
|
+
return (options?.client ?? client).put({
|
|
5879
|
+
security: [{
|
|
5880
|
+
name: "x-api-key",
|
|
5881
|
+
type: "apiKey"
|
|
5882
|
+
}],
|
|
5883
|
+
url: "/v1/templates/{id}/workspace/assets",
|
|
5884
|
+
...options,
|
|
5885
|
+
...params,
|
|
5886
|
+
headers: {
|
|
5887
|
+
"Content-Type": "application/json",
|
|
5888
|
+
...options?.headers,
|
|
5889
|
+
...params.headers
|
|
5890
|
+
}
|
|
5891
|
+
});
|
|
5892
|
+
}
|
|
5893
|
+
/**
|
|
5761
5894
|
* Reconcile a template project workspace
|
|
5762
5895
|
*
|
|
5763
5896
|
* Fast-forwards or rebases the workspace onto the latest saved version, retaining file conflicts for explicit resolution.
|
|
@@ -6014,7 +6147,7 @@ var Templates = class {
|
|
|
6014
6147
|
/**
|
|
6015
6148
|
* Publish an exact template commit
|
|
6016
6149
|
*
|
|
6017
|
-
* Builds an exact Git commit and entry path, stores the immutable
|
|
6150
|
+
* 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.
|
|
6018
6151
|
*/
|
|
6019
6152
|
static publish(parameters, options) {
|
|
6020
6153
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -6037,6 +6170,10 @@ var Templates = class {
|
|
|
6037
6170
|
{
|
|
6038
6171
|
in: "body",
|
|
6039
6172
|
key: "expectedWorkspaceRevision"
|
|
6173
|
+
},
|
|
6174
|
+
{
|
|
6175
|
+
in: "body",
|
|
6176
|
+
key: "ifCurrentPublicationId"
|
|
6040
6177
|
}
|
|
6041
6178
|
] }]);
|
|
6042
6179
|
return (options?.client ?? client).post({
|
|
@@ -6247,38 +6384,147 @@ var Templates = class {
|
|
|
6247
6384
|
});
|
|
6248
6385
|
}
|
|
6249
6386
|
};
|
|
6250
|
-
var
|
|
6387
|
+
var Brands = class {
|
|
6251
6388
|
/**
|
|
6252
|
-
*
|
|
6389
|
+
* List brands
|
|
6253
6390
|
*
|
|
6254
|
-
* Returns the organization's
|
|
6391
|
+
* Returns the organization's brands, the default brand first.
|
|
6255
6392
|
*/
|
|
6256
|
-
static
|
|
6393
|
+
static list(options) {
|
|
6257
6394
|
return (options?.client ?? client).get({
|
|
6258
6395
|
security: [{
|
|
6259
6396
|
name: "x-api-key",
|
|
6260
6397
|
type: "apiKey"
|
|
6261
6398
|
}],
|
|
6262
|
-
url: "/v1/
|
|
6399
|
+
url: "/v1/brands",
|
|
6263
6400
|
...options
|
|
6264
6401
|
});
|
|
6265
6402
|
}
|
|
6266
6403
|
/**
|
|
6267
|
-
*
|
|
6404
|
+
* Create a brand
|
|
6268
6405
|
*
|
|
6269
|
-
*
|
|
6406
|
+
* Creates a brand. The CSS must parse as a brand theme; a rejected theme answers 422 with located findings under `fields.css`. With `isDefault`, the new brand becomes the default. An organization holds at most 12 brands; creating one more answers 409 with a `ConflictError`.
|
|
6270
6407
|
*/
|
|
6271
|
-
static
|
|
6408
|
+
static create(parameters, options) {
|
|
6409
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
6410
|
+
{
|
|
6411
|
+
in: "body",
|
|
6412
|
+
key: "slug"
|
|
6413
|
+
},
|
|
6414
|
+
{
|
|
6415
|
+
in: "body",
|
|
6416
|
+
key: "name"
|
|
6417
|
+
},
|
|
6418
|
+
{
|
|
6419
|
+
in: "body",
|
|
6420
|
+
key: "css"
|
|
6421
|
+
},
|
|
6422
|
+
{
|
|
6423
|
+
in: "body",
|
|
6424
|
+
key: "assets"
|
|
6425
|
+
},
|
|
6426
|
+
{
|
|
6427
|
+
in: "body",
|
|
6428
|
+
key: "footer"
|
|
6429
|
+
},
|
|
6430
|
+
{
|
|
6431
|
+
in: "body",
|
|
6432
|
+
key: "isDefault"
|
|
6433
|
+
}
|
|
6434
|
+
] }]);
|
|
6435
|
+
return (options?.client ?? client).post({
|
|
6436
|
+
security: [{
|
|
6437
|
+
name: "x-api-key",
|
|
6438
|
+
type: "apiKey"
|
|
6439
|
+
}],
|
|
6440
|
+
url: "/v1/brands",
|
|
6441
|
+
...options,
|
|
6442
|
+
...params,
|
|
6443
|
+
headers: {
|
|
6444
|
+
"Content-Type": "application/json",
|
|
6445
|
+
...options?.headers,
|
|
6446
|
+
...params.headers
|
|
6447
|
+
}
|
|
6448
|
+
});
|
|
6449
|
+
}
|
|
6450
|
+
/**
|
|
6451
|
+
* Delete a brand
|
|
6452
|
+
*
|
|
6453
|
+
* Deletes a brand. The default brand cannot be deleted; domains that used the deleted brand fall back to the default.
|
|
6454
|
+
*/
|
|
6455
|
+
static remove(parameters, options) {
|
|
6272
6456
|
const params = buildClientParams([parameters], [{ args: [{
|
|
6273
|
-
in: "
|
|
6274
|
-
key: "
|
|
6457
|
+
in: "path",
|
|
6458
|
+
key: "slug"
|
|
6275
6459
|
}] }]);
|
|
6276
|
-
return (options?.client ?? client).
|
|
6460
|
+
return (options?.client ?? client).delete({
|
|
6461
|
+
security: [{
|
|
6462
|
+
name: "x-api-key",
|
|
6463
|
+
type: "apiKey"
|
|
6464
|
+
}],
|
|
6465
|
+
url: "/v1/brands/{slug}",
|
|
6466
|
+
...options,
|
|
6467
|
+
...params
|
|
6468
|
+
});
|
|
6469
|
+
}
|
|
6470
|
+
/**
|
|
6471
|
+
* Get a brand
|
|
6472
|
+
*
|
|
6473
|
+
* Returns one brand by its slug.
|
|
6474
|
+
*/
|
|
6475
|
+
static get(parameters, options) {
|
|
6476
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
6477
|
+
in: "path",
|
|
6478
|
+
key: "slug"
|
|
6479
|
+
}] }]);
|
|
6480
|
+
return (options?.client ?? client).get({
|
|
6481
|
+
security: [{
|
|
6482
|
+
name: "x-api-key",
|
|
6483
|
+
type: "apiKey"
|
|
6484
|
+
}],
|
|
6485
|
+
url: "/v1/brands/{slug}",
|
|
6486
|
+
...options,
|
|
6487
|
+
...params
|
|
6488
|
+
});
|
|
6489
|
+
}
|
|
6490
|
+
/**
|
|
6491
|
+
* Update a brand
|
|
6492
|
+
*
|
|
6493
|
+
* Updates a brand. Each section given replaces that section whole. Published templates keep the brand they were built against until they are republished.
|
|
6494
|
+
*/
|
|
6495
|
+
static update(parameters, options) {
|
|
6496
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
6497
|
+
{
|
|
6498
|
+
in: "path",
|
|
6499
|
+
key: "slug"
|
|
6500
|
+
},
|
|
6501
|
+
{
|
|
6502
|
+
in: "body",
|
|
6503
|
+
key: "newSlug"
|
|
6504
|
+
},
|
|
6505
|
+
{
|
|
6506
|
+
in: "body",
|
|
6507
|
+
key: "name"
|
|
6508
|
+
},
|
|
6509
|
+
{
|
|
6510
|
+
in: "body",
|
|
6511
|
+
key: "css"
|
|
6512
|
+
},
|
|
6513
|
+
{
|
|
6514
|
+
in: "body",
|
|
6515
|
+
key: "assets"
|
|
6516
|
+
},
|
|
6517
|
+
{
|
|
6518
|
+
in: "body",
|
|
6519
|
+
key: "footer"
|
|
6520
|
+
}
|
|
6521
|
+
] }]);
|
|
6522
|
+
return (options?.client ?? client).patch({
|
|
6277
6523
|
security: [{
|
|
6278
6524
|
name: "x-api-key",
|
|
6279
6525
|
type: "apiKey"
|
|
6280
6526
|
}],
|
|
6281
|
-
url: "/v1/
|
|
6527
|
+
url: "/v1/brands/{slug}",
|
|
6282
6528
|
...options,
|
|
6283
6529
|
...params,
|
|
6284
6530
|
headers: {
|
|
@@ -6288,6 +6534,26 @@ var Design = class {
|
|
|
6288
6534
|
}
|
|
6289
6535
|
});
|
|
6290
6536
|
}
|
|
6537
|
+
/**
|
|
6538
|
+
* Make a brand the default
|
|
6539
|
+
*
|
|
6540
|
+
* Makes this brand the organization's default: bare `samva:brand` and domains without a brand resolve to it at their next build or send.
|
|
6541
|
+
*/
|
|
6542
|
+
static setDefault(parameters, options) {
|
|
6543
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
6544
|
+
in: "path",
|
|
6545
|
+
key: "slug"
|
|
6546
|
+
}] }]);
|
|
6547
|
+
return (options?.client ?? client).post({
|
|
6548
|
+
security: [{
|
|
6549
|
+
name: "x-api-key",
|
|
6550
|
+
type: "apiKey"
|
|
6551
|
+
}],
|
|
6552
|
+
url: "/v1/brands/{slug}/default",
|
|
6553
|
+
...options,
|
|
6554
|
+
...params
|
|
6555
|
+
});
|
|
6556
|
+
}
|
|
6291
6557
|
};
|
|
6292
6558
|
var Webhooks = class {
|
|
6293
6559
|
/**
|
|
@@ -6624,7 +6890,7 @@ var Organizations = class {
|
|
|
6624
6890
|
/**
|
|
6625
6891
|
* Update the current organization
|
|
6626
6892
|
*
|
|
6627
|
-
* Updates the current organization's profile, regional defaults,
|
|
6893
|
+
* Updates the current organization's profile, regional defaults, and reply-to default and returns the saved organization. `metadata` is merged into the stored value; every other field is replaced.
|
|
6628
6894
|
*/
|
|
6629
6895
|
static update(parameters, options) {
|
|
6630
6896
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -6652,18 +6918,10 @@ var Organizations = class {
|
|
|
6652
6918
|
in: "body",
|
|
6653
6919
|
key: "metadata"
|
|
6654
6920
|
},
|
|
6655
|
-
{
|
|
6656
|
-
in: "body",
|
|
6657
|
-
key: "design"
|
|
6658
|
-
},
|
|
6659
6921
|
{
|
|
6660
6922
|
in: "body",
|
|
6661
6923
|
key: "replyToDefault"
|
|
6662
6924
|
},
|
|
6663
|
-
{
|
|
6664
|
-
in: "body",
|
|
6665
|
-
key: "defaultUnsubscribeGroupId"
|
|
6666
|
-
},
|
|
6667
6925
|
{
|
|
6668
6926
|
in: "body",
|
|
6669
6927
|
key: "emailFooterEnabledDefault"
|
|
@@ -6685,6 +6943,21 @@ var Organizations = class {
|
|
|
6685
6943
|
});
|
|
6686
6944
|
}
|
|
6687
6945
|
/**
|
|
6946
|
+
* Get the current account profile
|
|
6947
|
+
*
|
|
6948
|
+
* Returns your identity in the organization authorized by your credential. The ID remains stable across reconnects and display-name changes. Removing and re-adding your membership creates a new ID.
|
|
6949
|
+
*/
|
|
6950
|
+
static getProfile(options) {
|
|
6951
|
+
return (options?.client ?? client).get({
|
|
6952
|
+
security: [{
|
|
6953
|
+
name: "x-api-key",
|
|
6954
|
+
type: "apiKey"
|
|
6955
|
+
}],
|
|
6956
|
+
url: "/v1/organizations/current/profile",
|
|
6957
|
+
...options
|
|
6958
|
+
});
|
|
6959
|
+
}
|
|
6960
|
+
/**
|
|
6688
6961
|
* Get organization usage
|
|
6689
6962
|
*
|
|
6690
6963
|
* Returns usage statistics for the current organization over the selected reporting period.
|
|
@@ -7026,6 +7299,20 @@ var BillingProviderError = class extends SamvaApiError {
|
|
|
7026
7299
|
Object.assign(this, payload);
|
|
7027
7300
|
}
|
|
7028
7301
|
};
|
|
7302
|
+
var BrandAddressRequiredError = class extends SamvaApiError {
|
|
7303
|
+
_tag = "BrandAddressRequiredError";
|
|
7304
|
+
constructor(payload, context = {}) {
|
|
7305
|
+
super(messageOf("BrandAddressRequiredError", payload), context);
|
|
7306
|
+
Object.assign(this, payload);
|
|
7307
|
+
}
|
|
7308
|
+
};
|
|
7309
|
+
var CampaignFooterRequiredError = class extends SamvaApiError {
|
|
7310
|
+
_tag = "CampaignFooterRequiredError";
|
|
7311
|
+
constructor(payload, context = {}) {
|
|
7312
|
+
super(messageOf("CampaignFooterRequiredError", payload), context);
|
|
7313
|
+
Object.assign(this, payload);
|
|
7314
|
+
}
|
|
7315
|
+
};
|
|
7029
7316
|
var ConflictError = class extends SamvaApiError {
|
|
7030
7317
|
_tag = "ConflictError";
|
|
7031
7318
|
constructor(payload, context = {}) {
|
|
@@ -7127,6 +7414,8 @@ var ValidationError = class extends SamvaApiError {
|
|
|
7127
7414
|
const constructors = {
|
|
7128
7415
|
AnalyticsQueryError,
|
|
7129
7416
|
BillingProviderError,
|
|
7417
|
+
BrandAddressRequiredError,
|
|
7418
|
+
CampaignFooterRequiredError,
|
|
7130
7419
|
ConflictError,
|
|
7131
7420
|
DeliveryUnavailableError,
|
|
7132
7421
|
EmailChannelError,
|
|
@@ -7169,6 +7458,35 @@ const payloadSchemas = {
|
|
|
7169
7458
|
"x-category": ["transient"],
|
|
7170
7459
|
"x-retryable": true
|
|
7171
7460
|
},
|
|
7461
|
+
BrandAddressRequiredError: {
|
|
7462
|
+
type: "object",
|
|
7463
|
+
properties: {
|
|
7464
|
+
_tag: {
|
|
7465
|
+
type: "string",
|
|
7466
|
+
enum: ["BrandAddressRequiredError"]
|
|
7467
|
+
},
|
|
7468
|
+
message: { type: "string" },
|
|
7469
|
+
brand: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
7470
|
+
},
|
|
7471
|
+
required: [
|
|
7472
|
+
"_tag",
|
|
7473
|
+
"message",
|
|
7474
|
+
"brand"
|
|
7475
|
+
],
|
|
7476
|
+
additionalProperties: false
|
|
7477
|
+
},
|
|
7478
|
+
CampaignFooterRequiredError: {
|
|
7479
|
+
type: "object",
|
|
7480
|
+
properties: {
|
|
7481
|
+
_tag: {
|
|
7482
|
+
type: "string",
|
|
7483
|
+
enum: ["CampaignFooterRequiredError"]
|
|
7484
|
+
},
|
|
7485
|
+
message: { type: "string" }
|
|
7486
|
+
},
|
|
7487
|
+
required: ["_tag", "message"],
|
|
7488
|
+
additionalProperties: false
|
|
7489
|
+
},
|
|
7172
7490
|
ConflictError: {
|
|
7173
7491
|
type: "object",
|
|
7174
7492
|
properties: {
|
|
@@ -7332,8 +7650,7 @@ const payloadSchemas = {
|
|
|
7332
7650
|
enum: [
|
|
7333
7651
|
"undecided",
|
|
7334
7652
|
"approved",
|
|
7335
|
-
"rejected"
|
|
7336
|
-
"exempt"
|
|
7653
|
+
"rejected"
|
|
7337
7654
|
]
|
|
7338
7655
|
},
|
|
7339
7656
|
stage: {
|
|
@@ -7501,6 +7818,13 @@ function fromApiError(error, context = {}) {
|
|
|
7501
7818
|
const Constructor = constructors[tag];
|
|
7502
7819
|
return new Constructor(error, context);
|
|
7503
7820
|
}
|
|
7821
|
+
if (context.response?.status === 504) {
|
|
7822
|
+
const retryAfter = Number(context.response.headers.get("retry-after"));
|
|
7823
|
+
return new GatewayTimeoutError({
|
|
7824
|
+
message: "The request did not finish in time. Retry with the same idempotency key.",
|
|
7825
|
+
retryAfterSeconds: Number.isInteger(retryAfter) && retryAfter > 0 ? retryAfter : 1
|
|
7826
|
+
}, context);
|
|
7827
|
+
}
|
|
7504
7828
|
return new SamvaTransportError(error, context);
|
|
7505
7829
|
}
|
|
7506
7830
|
//#endregion
|
|
@@ -7664,13 +7988,13 @@ function createClient(config) {
|
|
|
7664
7988
|
client: clientInstance,
|
|
7665
7989
|
messages: createBoundService(Messages, clientInstance),
|
|
7666
7990
|
scheduledMessages: createBoundService(ScheduledMessages, clientInstance),
|
|
7991
|
+
brands: createBoundService(Brands, clientInstance),
|
|
7667
7992
|
campaigns: createBoundService(Campaigns, clientInstance),
|
|
7668
7993
|
email: createBoundService(Email, clientInstance),
|
|
7669
7994
|
media: createBoundService(Media, clientInstance),
|
|
7670
7995
|
templates: createPromiseTemplatesTransport(clientInstance),
|
|
7671
7996
|
contacts: createBoundService(Contacts, clientInstance),
|
|
7672
7997
|
conversations: createBoundService(Conversations, clientInstance),
|
|
7673
|
-
design: createBoundService(Design, clientInstance),
|
|
7674
7998
|
webhooks: createBoundService(Webhooks, clientInstance),
|
|
7675
7999
|
operations: createBoundService(Operations, clientInstance),
|
|
7676
8000
|
apiKeys: createBoundService(ApiKeys, clientInstance),
|
|
@@ -7687,13 +8011,13 @@ function createClient(config) {
|
|
|
7687
8011
|
raw,
|
|
7688
8012
|
messages: createDirectService(promiseMessages),
|
|
7689
8013
|
scheduledMessages: createDirectService(raw.scheduledMessages),
|
|
8014
|
+
brands: createDirectService(raw.brands),
|
|
7690
8015
|
campaigns: createDirectService(raw.campaigns),
|
|
7691
8016
|
email: createDirectService(promiseEmail),
|
|
7692
8017
|
media: createDirectService(raw.media),
|
|
7693
8018
|
templates: createDirectService(raw.templates),
|
|
7694
8019
|
contacts: createDirectService(raw.contacts),
|
|
7695
8020
|
conversations: createDirectService(raw.conversations),
|
|
7696
|
-
design: createDirectService(raw.design),
|
|
7697
8021
|
webhooks: createDirectService(raw.webhooks),
|
|
7698
8022
|
operations: createDirectService(raw.operations),
|
|
7699
8023
|
apiKeys: createDirectService(raw.apiKeys),
|
|
@@ -7706,6 +8030,6 @@ function createClient(config) {
|
|
|
7706
8030
|
};
|
|
7707
8031
|
}
|
|
7708
8032
|
//#endregion
|
|
7709
|
-
export {
|
|
8033
|
+
export { fromApiError as S, ResourceNotFoundError as _, CampaignFooterRequiredError as a, UnauthorizedError as b, EmailChannelError as c, ForbiddenError as d, GatewayTimeoutError as f, RateLimitedError as g, PaymentRequiredError as h, BrandAddressRequiredError as i, ExternalServiceError as l, OnboardingReviewRequiredError as m, AnalyticsQueryError as n, ConflictError as o, InternalError as p, BillingProviderError as r, DeliveryUnavailableError as s, createClient as t, FlagDisabledError as u, SamvaApiError as v, ValidationError as x, SamvaTransportError as y };
|
|
7710
8034
|
|
|
7711
|
-
//# sourceMappingURL=promises-
|
|
8035
|
+
//# sourceMappingURL=promises-DAv8ZtOX.js.map
|