samva 0.6.0 → 0.7.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 +91 -18
- package/dist/client/types.gen.d.ts +510 -94
- package/dist/{client-DCM6U0-I.js → client-5O8KsY5Z.js} +490 -165
- package/dist/{client-attribution-DYUSAa76.js → client-attribution-27MNycCV.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 +1 -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 +12 -3
- 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 +2742 -1810
- 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 +22 -6
- package/dist/effect/messages.js +1 -1
- package/dist/effect/operations.js +1 -1
- package/dist/effect/organizations.d.ts +0 -264
- package/dist/effect/organizations.js +1 -1
- package/dist/effect/retry.js +1 -1
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/templates.d.ts +230 -0
- package/dist/effect/templates.js +7 -3
- package/dist/effect/unsubscribe-groups.js +1 -1
- package/dist/effect/webhooks.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{operation-02YX3hY9.js → operation-Cb5V9FJ7.js} +29 -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-C2yyw-pf.js} +329 -36
- package/dist/service-map.d.ts +36 -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-27MNycCV.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({
|
|
@@ -5338,6 +5349,10 @@ var Templates = class {
|
|
|
5338
5349
|
in: "query",
|
|
5339
5350
|
key: "search"
|
|
5340
5351
|
},
|
|
5352
|
+
{
|
|
5353
|
+
in: "query",
|
|
5354
|
+
key: "projectId"
|
|
5355
|
+
},
|
|
5341
5356
|
{
|
|
5342
5357
|
in: "query",
|
|
5343
5358
|
key: "sortBy"
|
|
@@ -5380,6 +5395,10 @@ var Templates = class {
|
|
|
5380
5395
|
in: "body",
|
|
5381
5396
|
key: "galleryTemplateId"
|
|
5382
5397
|
},
|
|
5398
|
+
{
|
|
5399
|
+
in: "body",
|
|
5400
|
+
key: "useBrand"
|
|
5401
|
+
},
|
|
5383
5402
|
{
|
|
5384
5403
|
in: "body",
|
|
5385
5404
|
key: "description"
|
|
@@ -5645,7 +5664,7 @@ var Templates = class {
|
|
|
5645
5664
|
/**
|
|
5646
5665
|
* Update a template
|
|
5647
5666
|
*
|
|
5648
|
-
* Updates template metadata. Source changes use the project workspace API.
|
|
5667
|
+
* 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
5668
|
*/
|
|
5650
5669
|
static update(parameters, options) {
|
|
5651
5670
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -5671,6 +5690,53 @@ var Templates = class {
|
|
|
5671
5690
|
});
|
|
5672
5691
|
}
|
|
5673
5692
|
/**
|
|
5693
|
+
* Add a template entry
|
|
5694
|
+
*
|
|
5695
|
+
* Registers an `emails*.tsx` file 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.
|
|
5696
|
+
*/
|
|
5697
|
+
static addEntry(parameters, options) {
|
|
5698
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
5699
|
+
{
|
|
5700
|
+
in: "path",
|
|
5701
|
+
key: "projectId"
|
|
5702
|
+
},
|
|
5703
|
+
{
|
|
5704
|
+
in: "body",
|
|
5705
|
+
key: "entryPath"
|
|
5706
|
+
},
|
|
5707
|
+
{
|
|
5708
|
+
in: "body",
|
|
5709
|
+
key: "name"
|
|
5710
|
+
},
|
|
5711
|
+
{
|
|
5712
|
+
in: "body",
|
|
5713
|
+
key: "slug"
|
|
5714
|
+
},
|
|
5715
|
+
{
|
|
5716
|
+
in: "body",
|
|
5717
|
+
key: "description"
|
|
5718
|
+
},
|
|
5719
|
+
{
|
|
5720
|
+
in: "body",
|
|
5721
|
+
key: "category"
|
|
5722
|
+
}
|
|
5723
|
+
] }]);
|
|
5724
|
+
return (options?.client ?? client).post({
|
|
5725
|
+
security: [{
|
|
5726
|
+
name: "x-api-key",
|
|
5727
|
+
type: "apiKey"
|
|
5728
|
+
}],
|
|
5729
|
+
url: "/v1/templates/projects/{projectId}/entries",
|
|
5730
|
+
...options,
|
|
5731
|
+
...params,
|
|
5732
|
+
headers: {
|
|
5733
|
+
"Content-Type": "application/json",
|
|
5734
|
+
...options?.headers,
|
|
5735
|
+
...params.headers
|
|
5736
|
+
}
|
|
5737
|
+
});
|
|
5738
|
+
}
|
|
5739
|
+
/**
|
|
5674
5740
|
* Patch template project files
|
|
5675
5741
|
*
|
|
5676
5742
|
* Applies revision-checked file patches to the shared project workspace overlay.
|
|
@@ -5758,6 +5824,53 @@ var Templates = class {
|
|
|
5758
5824
|
});
|
|
5759
5825
|
}
|
|
5760
5826
|
/**
|
|
5827
|
+
* Put a template project asset
|
|
5828
|
+
*
|
|
5829
|
+
* 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.
|
|
5830
|
+
*/
|
|
5831
|
+
static putWorkspaceAsset(parameters, options) {
|
|
5832
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
5833
|
+
{
|
|
5834
|
+
in: "path",
|
|
5835
|
+
key: "id"
|
|
5836
|
+
},
|
|
5837
|
+
{
|
|
5838
|
+
in: "body",
|
|
5839
|
+
key: "expectedRevision"
|
|
5840
|
+
},
|
|
5841
|
+
{
|
|
5842
|
+
in: "body",
|
|
5843
|
+
key: "path"
|
|
5844
|
+
},
|
|
5845
|
+
{
|
|
5846
|
+
in: "body",
|
|
5847
|
+
key: "contentBase64"
|
|
5848
|
+
},
|
|
5849
|
+
{
|
|
5850
|
+
in: "body",
|
|
5851
|
+
key: "replace"
|
|
5852
|
+
},
|
|
5853
|
+
{
|
|
5854
|
+
in: "body",
|
|
5855
|
+
key: "idempotencyKey"
|
|
5856
|
+
}
|
|
5857
|
+
] }]);
|
|
5858
|
+
return (options?.client ?? client).put({
|
|
5859
|
+
security: [{
|
|
5860
|
+
name: "x-api-key",
|
|
5861
|
+
type: "apiKey"
|
|
5862
|
+
}],
|
|
5863
|
+
url: "/v1/templates/{id}/workspace/assets",
|
|
5864
|
+
...options,
|
|
5865
|
+
...params,
|
|
5866
|
+
headers: {
|
|
5867
|
+
"Content-Type": "application/json",
|
|
5868
|
+
...options?.headers,
|
|
5869
|
+
...params.headers
|
|
5870
|
+
}
|
|
5871
|
+
});
|
|
5872
|
+
}
|
|
5873
|
+
/**
|
|
5761
5874
|
* Reconcile a template project workspace
|
|
5762
5875
|
*
|
|
5763
5876
|
* Fast-forwards or rebases the workspace onto the latest saved version, retaining file conflicts for explicit resolution.
|
|
@@ -6037,6 +6150,10 @@ var Templates = class {
|
|
|
6037
6150
|
{
|
|
6038
6151
|
in: "body",
|
|
6039
6152
|
key: "expectedWorkspaceRevision"
|
|
6153
|
+
},
|
|
6154
|
+
{
|
|
6155
|
+
in: "body",
|
|
6156
|
+
key: "ifCurrentPublicationId"
|
|
6040
6157
|
}
|
|
6041
6158
|
] }]);
|
|
6042
6159
|
return (options?.client ?? client).post({
|
|
@@ -6247,38 +6364,147 @@ var Templates = class {
|
|
|
6247
6364
|
});
|
|
6248
6365
|
}
|
|
6249
6366
|
};
|
|
6250
|
-
var
|
|
6367
|
+
var Brands = class {
|
|
6251
6368
|
/**
|
|
6252
|
-
*
|
|
6369
|
+
* List brands
|
|
6253
6370
|
*
|
|
6254
|
-
* Returns the organization's
|
|
6371
|
+
* Returns the organization's brands, the default brand first.
|
|
6255
6372
|
*/
|
|
6256
|
-
static
|
|
6373
|
+
static list(options) {
|
|
6257
6374
|
return (options?.client ?? client).get({
|
|
6258
6375
|
security: [{
|
|
6259
6376
|
name: "x-api-key",
|
|
6260
6377
|
type: "apiKey"
|
|
6261
6378
|
}],
|
|
6262
|
-
url: "/v1/
|
|
6379
|
+
url: "/v1/brands",
|
|
6263
6380
|
...options
|
|
6264
6381
|
});
|
|
6265
6382
|
}
|
|
6266
6383
|
/**
|
|
6267
|
-
*
|
|
6384
|
+
* Create a brand
|
|
6268
6385
|
*
|
|
6269
|
-
*
|
|
6386
|
+
* 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
6387
|
*/
|
|
6271
|
-
static
|
|
6388
|
+
static create(parameters, options) {
|
|
6389
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
6390
|
+
{
|
|
6391
|
+
in: "body",
|
|
6392
|
+
key: "slug"
|
|
6393
|
+
},
|
|
6394
|
+
{
|
|
6395
|
+
in: "body",
|
|
6396
|
+
key: "name"
|
|
6397
|
+
},
|
|
6398
|
+
{
|
|
6399
|
+
in: "body",
|
|
6400
|
+
key: "css"
|
|
6401
|
+
},
|
|
6402
|
+
{
|
|
6403
|
+
in: "body",
|
|
6404
|
+
key: "assets"
|
|
6405
|
+
},
|
|
6406
|
+
{
|
|
6407
|
+
in: "body",
|
|
6408
|
+
key: "footer"
|
|
6409
|
+
},
|
|
6410
|
+
{
|
|
6411
|
+
in: "body",
|
|
6412
|
+
key: "isDefault"
|
|
6413
|
+
}
|
|
6414
|
+
] }]);
|
|
6415
|
+
return (options?.client ?? client).post({
|
|
6416
|
+
security: [{
|
|
6417
|
+
name: "x-api-key",
|
|
6418
|
+
type: "apiKey"
|
|
6419
|
+
}],
|
|
6420
|
+
url: "/v1/brands",
|
|
6421
|
+
...options,
|
|
6422
|
+
...params,
|
|
6423
|
+
headers: {
|
|
6424
|
+
"Content-Type": "application/json",
|
|
6425
|
+
...options?.headers,
|
|
6426
|
+
...params.headers
|
|
6427
|
+
}
|
|
6428
|
+
});
|
|
6429
|
+
}
|
|
6430
|
+
/**
|
|
6431
|
+
* Delete a brand
|
|
6432
|
+
*
|
|
6433
|
+
* Deletes a brand. The default brand cannot be deleted; domains that used the deleted brand fall back to the default.
|
|
6434
|
+
*/
|
|
6435
|
+
static remove(parameters, options) {
|
|
6272
6436
|
const params = buildClientParams([parameters], [{ args: [{
|
|
6273
|
-
in: "
|
|
6274
|
-
key: "
|
|
6437
|
+
in: "path",
|
|
6438
|
+
key: "slug"
|
|
6275
6439
|
}] }]);
|
|
6276
|
-
return (options?.client ?? client).
|
|
6440
|
+
return (options?.client ?? client).delete({
|
|
6277
6441
|
security: [{
|
|
6278
6442
|
name: "x-api-key",
|
|
6279
6443
|
type: "apiKey"
|
|
6280
6444
|
}],
|
|
6281
|
-
url: "/v1/
|
|
6445
|
+
url: "/v1/brands/{slug}",
|
|
6446
|
+
...options,
|
|
6447
|
+
...params
|
|
6448
|
+
});
|
|
6449
|
+
}
|
|
6450
|
+
/**
|
|
6451
|
+
* Get a brand
|
|
6452
|
+
*
|
|
6453
|
+
* Returns one brand by its slug.
|
|
6454
|
+
*/
|
|
6455
|
+
static get(parameters, options) {
|
|
6456
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
6457
|
+
in: "path",
|
|
6458
|
+
key: "slug"
|
|
6459
|
+
}] }]);
|
|
6460
|
+
return (options?.client ?? client).get({
|
|
6461
|
+
security: [{
|
|
6462
|
+
name: "x-api-key",
|
|
6463
|
+
type: "apiKey"
|
|
6464
|
+
}],
|
|
6465
|
+
url: "/v1/brands/{slug}",
|
|
6466
|
+
...options,
|
|
6467
|
+
...params
|
|
6468
|
+
});
|
|
6469
|
+
}
|
|
6470
|
+
/**
|
|
6471
|
+
* Update a brand
|
|
6472
|
+
*
|
|
6473
|
+
* Updates a brand. Each section given replaces that section whole. Published templates keep the brand they were built against until they are republished.
|
|
6474
|
+
*/
|
|
6475
|
+
static update(parameters, options) {
|
|
6476
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
6477
|
+
{
|
|
6478
|
+
in: "path",
|
|
6479
|
+
key: "slug"
|
|
6480
|
+
},
|
|
6481
|
+
{
|
|
6482
|
+
in: "body",
|
|
6483
|
+
key: "newSlug"
|
|
6484
|
+
},
|
|
6485
|
+
{
|
|
6486
|
+
in: "body",
|
|
6487
|
+
key: "name"
|
|
6488
|
+
},
|
|
6489
|
+
{
|
|
6490
|
+
in: "body",
|
|
6491
|
+
key: "css"
|
|
6492
|
+
},
|
|
6493
|
+
{
|
|
6494
|
+
in: "body",
|
|
6495
|
+
key: "assets"
|
|
6496
|
+
},
|
|
6497
|
+
{
|
|
6498
|
+
in: "body",
|
|
6499
|
+
key: "footer"
|
|
6500
|
+
}
|
|
6501
|
+
] }]);
|
|
6502
|
+
return (options?.client ?? client).patch({
|
|
6503
|
+
security: [{
|
|
6504
|
+
name: "x-api-key",
|
|
6505
|
+
type: "apiKey"
|
|
6506
|
+
}],
|
|
6507
|
+
url: "/v1/brands/{slug}",
|
|
6282
6508
|
...options,
|
|
6283
6509
|
...params,
|
|
6284
6510
|
headers: {
|
|
@@ -6288,6 +6514,26 @@ var Design = class {
|
|
|
6288
6514
|
}
|
|
6289
6515
|
});
|
|
6290
6516
|
}
|
|
6517
|
+
/**
|
|
6518
|
+
* Make a brand the default
|
|
6519
|
+
*
|
|
6520
|
+
* Makes this brand the organization's default: bare `samva:brand` and domains without a brand resolve to it at their next build or send.
|
|
6521
|
+
*/
|
|
6522
|
+
static setDefault(parameters, options) {
|
|
6523
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
6524
|
+
in: "path",
|
|
6525
|
+
key: "slug"
|
|
6526
|
+
}] }]);
|
|
6527
|
+
return (options?.client ?? client).post({
|
|
6528
|
+
security: [{
|
|
6529
|
+
name: "x-api-key",
|
|
6530
|
+
type: "apiKey"
|
|
6531
|
+
}],
|
|
6532
|
+
url: "/v1/brands/{slug}/default",
|
|
6533
|
+
...options,
|
|
6534
|
+
...params
|
|
6535
|
+
});
|
|
6536
|
+
}
|
|
6291
6537
|
};
|
|
6292
6538
|
var Webhooks = class {
|
|
6293
6539
|
/**
|
|
@@ -6624,7 +6870,7 @@ var Organizations = class {
|
|
|
6624
6870
|
/**
|
|
6625
6871
|
* Update the current organization
|
|
6626
6872
|
*
|
|
6627
|
-
* Updates the current organization's profile, regional defaults,
|
|
6873
|
+
* Updates the current organization's profile, regional defaults, reply-to, and unsubscribe-group defaults and returns the saved organization. `metadata` is merged into the stored value; every other field is replaced.
|
|
6628
6874
|
*/
|
|
6629
6875
|
static update(parameters, options) {
|
|
6630
6876
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -6652,10 +6898,6 @@ var Organizations = class {
|
|
|
6652
6898
|
in: "body",
|
|
6653
6899
|
key: "metadata"
|
|
6654
6900
|
},
|
|
6655
|
-
{
|
|
6656
|
-
in: "body",
|
|
6657
|
-
key: "design"
|
|
6658
|
-
},
|
|
6659
6901
|
{
|
|
6660
6902
|
in: "body",
|
|
6661
6903
|
key: "replyToDefault"
|
|
@@ -7026,6 +7268,20 @@ var BillingProviderError = class extends SamvaApiError {
|
|
|
7026
7268
|
Object.assign(this, payload);
|
|
7027
7269
|
}
|
|
7028
7270
|
};
|
|
7271
|
+
var BrandAddressRequiredError = class extends SamvaApiError {
|
|
7272
|
+
_tag = "BrandAddressRequiredError";
|
|
7273
|
+
constructor(payload, context = {}) {
|
|
7274
|
+
super(messageOf("BrandAddressRequiredError", payload), context);
|
|
7275
|
+
Object.assign(this, payload);
|
|
7276
|
+
}
|
|
7277
|
+
};
|
|
7278
|
+
var CampaignFooterRequiredError = class extends SamvaApiError {
|
|
7279
|
+
_tag = "CampaignFooterRequiredError";
|
|
7280
|
+
constructor(payload, context = {}) {
|
|
7281
|
+
super(messageOf("CampaignFooterRequiredError", payload), context);
|
|
7282
|
+
Object.assign(this, payload);
|
|
7283
|
+
}
|
|
7284
|
+
};
|
|
7029
7285
|
var ConflictError = class extends SamvaApiError {
|
|
7030
7286
|
_tag = "ConflictError";
|
|
7031
7287
|
constructor(payload, context = {}) {
|
|
@@ -7127,6 +7383,8 @@ var ValidationError = class extends SamvaApiError {
|
|
|
7127
7383
|
const constructors = {
|
|
7128
7384
|
AnalyticsQueryError,
|
|
7129
7385
|
BillingProviderError,
|
|
7386
|
+
BrandAddressRequiredError,
|
|
7387
|
+
CampaignFooterRequiredError,
|
|
7130
7388
|
ConflictError,
|
|
7131
7389
|
DeliveryUnavailableError,
|
|
7132
7390
|
EmailChannelError,
|
|
@@ -7169,6 +7427,35 @@ const payloadSchemas = {
|
|
|
7169
7427
|
"x-category": ["transient"],
|
|
7170
7428
|
"x-retryable": true
|
|
7171
7429
|
},
|
|
7430
|
+
BrandAddressRequiredError: {
|
|
7431
|
+
type: "object",
|
|
7432
|
+
properties: {
|
|
7433
|
+
_tag: {
|
|
7434
|
+
type: "string",
|
|
7435
|
+
enum: ["BrandAddressRequiredError"]
|
|
7436
|
+
},
|
|
7437
|
+
message: { type: "string" },
|
|
7438
|
+
brand: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
7439
|
+
},
|
|
7440
|
+
required: [
|
|
7441
|
+
"_tag",
|
|
7442
|
+
"message",
|
|
7443
|
+
"brand"
|
|
7444
|
+
],
|
|
7445
|
+
additionalProperties: false
|
|
7446
|
+
},
|
|
7447
|
+
CampaignFooterRequiredError: {
|
|
7448
|
+
type: "object",
|
|
7449
|
+
properties: {
|
|
7450
|
+
_tag: {
|
|
7451
|
+
type: "string",
|
|
7452
|
+
enum: ["CampaignFooterRequiredError"]
|
|
7453
|
+
},
|
|
7454
|
+
message: { type: "string" }
|
|
7455
|
+
},
|
|
7456
|
+
required: ["_tag", "message"],
|
|
7457
|
+
additionalProperties: false
|
|
7458
|
+
},
|
|
7172
7459
|
ConflictError: {
|
|
7173
7460
|
type: "object",
|
|
7174
7461
|
properties: {
|
|
@@ -7332,8 +7619,7 @@ const payloadSchemas = {
|
|
|
7332
7619
|
enum: [
|
|
7333
7620
|
"undecided",
|
|
7334
7621
|
"approved",
|
|
7335
|
-
"rejected"
|
|
7336
|
-
"exempt"
|
|
7622
|
+
"rejected"
|
|
7337
7623
|
]
|
|
7338
7624
|
},
|
|
7339
7625
|
stage: {
|
|
@@ -7501,6 +7787,13 @@ function fromApiError(error, context = {}) {
|
|
|
7501
7787
|
const Constructor = constructors[tag];
|
|
7502
7788
|
return new Constructor(error, context);
|
|
7503
7789
|
}
|
|
7790
|
+
if (context.response?.status === 504) {
|
|
7791
|
+
const retryAfter = Number(context.response.headers.get("retry-after"));
|
|
7792
|
+
return new GatewayTimeoutError({
|
|
7793
|
+
message: "The request did not finish in time. Retry with the same idempotency key.",
|
|
7794
|
+
retryAfterSeconds: Number.isInteger(retryAfter) && retryAfter > 0 ? retryAfter : 1
|
|
7795
|
+
}, context);
|
|
7796
|
+
}
|
|
7504
7797
|
return new SamvaTransportError(error, context);
|
|
7505
7798
|
}
|
|
7506
7799
|
//#endregion
|
|
@@ -7664,13 +7957,13 @@ function createClient(config) {
|
|
|
7664
7957
|
client: clientInstance,
|
|
7665
7958
|
messages: createBoundService(Messages, clientInstance),
|
|
7666
7959
|
scheduledMessages: createBoundService(ScheduledMessages, clientInstance),
|
|
7960
|
+
brands: createBoundService(Brands, clientInstance),
|
|
7667
7961
|
campaigns: createBoundService(Campaigns, clientInstance),
|
|
7668
7962
|
email: createBoundService(Email, clientInstance),
|
|
7669
7963
|
media: createBoundService(Media, clientInstance),
|
|
7670
7964
|
templates: createPromiseTemplatesTransport(clientInstance),
|
|
7671
7965
|
contacts: createBoundService(Contacts, clientInstance),
|
|
7672
7966
|
conversations: createBoundService(Conversations, clientInstance),
|
|
7673
|
-
design: createBoundService(Design, clientInstance),
|
|
7674
7967
|
webhooks: createBoundService(Webhooks, clientInstance),
|
|
7675
7968
|
operations: createBoundService(Operations, clientInstance),
|
|
7676
7969
|
apiKeys: createBoundService(ApiKeys, clientInstance),
|
|
@@ -7687,13 +7980,13 @@ function createClient(config) {
|
|
|
7687
7980
|
raw,
|
|
7688
7981
|
messages: createDirectService(promiseMessages),
|
|
7689
7982
|
scheduledMessages: createDirectService(raw.scheduledMessages),
|
|
7983
|
+
brands: createDirectService(raw.brands),
|
|
7690
7984
|
campaigns: createDirectService(raw.campaigns),
|
|
7691
7985
|
email: createDirectService(promiseEmail),
|
|
7692
7986
|
media: createDirectService(raw.media),
|
|
7693
7987
|
templates: createDirectService(raw.templates),
|
|
7694
7988
|
contacts: createDirectService(raw.contacts),
|
|
7695
7989
|
conversations: createDirectService(raw.conversations),
|
|
7696
|
-
design: createDirectService(raw.design),
|
|
7697
7990
|
webhooks: createDirectService(raw.webhooks),
|
|
7698
7991
|
operations: createDirectService(raw.operations),
|
|
7699
7992
|
apiKeys: createDirectService(raw.apiKeys),
|
|
@@ -7706,6 +7999,6 @@ function createClient(config) {
|
|
|
7706
7999
|
};
|
|
7707
8000
|
}
|
|
7708
8001
|
//#endregion
|
|
7709
|
-
export {
|
|
8002
|
+
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
8003
|
|
|
7711
|
-
//# sourceMappingURL=promises-
|
|
8004
|
+
//# sourceMappingURL=promises-C2yyw-pf.js.map
|
package/dist/service-map.d.ts
CHANGED
|
@@ -29,6 +29,14 @@ export declare const SDK_SERVICE_OPERATIONS: {
|
|
|
29
29
|
readonly remove: "attachmentsRemove";
|
|
30
30
|
readonly downloadUrl: "attachmentsDownloadUrl";
|
|
31
31
|
};
|
|
32
|
+
readonly brands: {
|
|
33
|
+
readonly list: "brandsList";
|
|
34
|
+
readonly create: "brandsCreate";
|
|
35
|
+
readonly get: "brandsGet";
|
|
36
|
+
readonly update: "brandsUpdate";
|
|
37
|
+
readonly remove: "brandsRemove";
|
|
38
|
+
readonly setDefault: "brandsSetDefault";
|
|
39
|
+
};
|
|
32
40
|
readonly campaigns: {
|
|
33
41
|
readonly list: "campaignsList";
|
|
34
42
|
readonly create: "campaignsCreate";
|
|
@@ -87,10 +95,6 @@ export declare const SDK_SERVICE_OPERATIONS: {
|
|
|
87
95
|
readonly update: "customFieldsUpdate";
|
|
88
96
|
readonly remove: "customFieldsRemove";
|
|
89
97
|
};
|
|
90
|
-
readonly design: {
|
|
91
|
-
readonly get: "designGet";
|
|
92
|
-
readonly update: "designUpdate";
|
|
93
|
-
};
|
|
94
98
|
readonly email: {
|
|
95
99
|
readonly send: "messagesSend";
|
|
96
100
|
readonly getTrackingDefaults: "emailGetTrackingDefaults";
|
|
@@ -194,6 +198,7 @@ export declare const SDK_SERVICE_OPERATIONS: {
|
|
|
194
198
|
readonly templates: {
|
|
195
199
|
readonly list: "templatesList";
|
|
196
200
|
readonly create: "templatesCreate";
|
|
201
|
+
readonly addEntry: "templatesAddEntry";
|
|
197
202
|
readonly listFamilies: "templatesListFamilies";
|
|
198
203
|
readonly createFamily: "templatesCreateFamily";
|
|
199
204
|
readonly getFamily: "templatesGetFamily";
|
|
@@ -209,6 +214,7 @@ export declare const SDK_SERVICE_OPERATIONS: {
|
|
|
209
214
|
readonly getGitRepository: "templatesGetGitRepository";
|
|
210
215
|
readonly issueGitCredential: "templatesIssueGitCredential";
|
|
211
216
|
readonly patchWorkspace: "templatesPatchWorkspace";
|
|
217
|
+
readonly putWorkspaceAsset: "templatesPutWorkspaceAsset";
|
|
212
218
|
readonly resolveWorkspaceConflict: "templatesResolveWorkspaceConflict";
|
|
213
219
|
readonly attachWorkspaceResource: "templatesAttachWorkspaceResource";
|
|
214
220
|
readonly removeWorkspaceResource: "templatesRemoveWorkspaceResource";
|
|
@@ -249,12 +255,28 @@ export declare const SDK_SERVICE_OPERATIONS: {
|
|
|
249
255
|
};
|
|
250
256
|
/** How each generated Effect operation is adapted to the Promise facade's direct input shape. */
|
|
251
257
|
export declare const SDK_OPERATION_CALLS: {
|
|
252
|
-
readonly
|
|
258
|
+
readonly brandsList: {
|
|
253
259
|
readonly kind: "none";
|
|
254
260
|
};
|
|
255
|
-
readonly
|
|
261
|
+
readonly brandsCreate: {
|
|
256
262
|
readonly kind: "payload";
|
|
257
263
|
};
|
|
264
|
+
readonly brandsGet: {
|
|
265
|
+
readonly kind: "path";
|
|
266
|
+
readonly paths: readonly ["slug"];
|
|
267
|
+
};
|
|
268
|
+
readonly brandsUpdate: {
|
|
269
|
+
readonly kind: "pathPayload";
|
|
270
|
+
readonly paths: readonly ["slug"];
|
|
271
|
+
};
|
|
272
|
+
readonly brandsRemove: {
|
|
273
|
+
readonly kind: "path";
|
|
274
|
+
readonly paths: readonly ["slug"];
|
|
275
|
+
};
|
|
276
|
+
readonly brandsSetDefault: {
|
|
277
|
+
readonly kind: "path";
|
|
278
|
+
readonly paths: readonly ["slug"];
|
|
279
|
+
};
|
|
258
280
|
readonly operationsList: {
|
|
259
281
|
readonly kind: "params";
|
|
260
282
|
};
|
|
@@ -680,6 +702,10 @@ export declare const SDK_OPERATION_CALLS: {
|
|
|
680
702
|
readonly templatesCreate: {
|
|
681
703
|
readonly kind: "payload";
|
|
682
704
|
};
|
|
705
|
+
readonly templatesAddEntry: {
|
|
706
|
+
readonly kind: "pathPayload";
|
|
707
|
+
readonly paths: readonly ["projectId"];
|
|
708
|
+
};
|
|
683
709
|
readonly templatesListFamilies: {
|
|
684
710
|
readonly kind: "params";
|
|
685
711
|
};
|
|
@@ -738,6 +764,10 @@ export declare const SDK_OPERATION_CALLS: {
|
|
|
738
764
|
readonly kind: "pathPayload";
|
|
739
765
|
readonly paths: readonly ["id"];
|
|
740
766
|
};
|
|
767
|
+
readonly templatesPutWorkspaceAsset: {
|
|
768
|
+
readonly kind: "pathPayload";
|
|
769
|
+
readonly paths: readonly ["id"];
|
|
770
|
+
};
|
|
741
771
|
readonly templatesResolveWorkspaceConflict: {
|
|
742
772
|
readonly kind: "pathPayload";
|
|
743
773
|
readonly paths: readonly ["id"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "samva",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "TypeScript SDK for the Samva email API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-client",
|
|
@@ -62,6 +62,10 @@
|
|
|
62
62
|
"types": "./dist/effect/attachments.d.ts",
|
|
63
63
|
"import": "./dist/effect/attachments.js"
|
|
64
64
|
},
|
|
65
|
+
"./effect/brands": {
|
|
66
|
+
"types": "./dist/effect/brands.d.ts",
|
|
67
|
+
"import": "./dist/effect/brands.js"
|
|
68
|
+
},
|
|
65
69
|
"./effect/campaigns": {
|
|
66
70
|
"types": "./dist/effect/campaigns.d.ts",
|
|
67
71
|
"import": "./dist/effect/campaigns.js"
|
|
@@ -86,10 +90,6 @@
|
|
|
86
90
|
"types": "./dist/effect/custom-fields.d.ts",
|
|
87
91
|
"import": "./dist/effect/custom-fields.js"
|
|
88
92
|
},
|
|
89
|
-
"./effect/design": {
|
|
90
|
-
"types": "./dist/effect/design.d.ts",
|
|
91
|
-
"import": "./dist/effect/design.js"
|
|
92
|
-
},
|
|
93
93
|
"./effect/email": {
|
|
94
94
|
"types": "./dist/effect/email.d.ts",
|
|
95
95
|
"import": "./dist/effect/email.js"
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"build": "NODE_OPTIONS=\"$NODE_OPTIONS --max-old-space-size=8192\" tsdown && tsc --project tsconfig.build.json",
|
|
147
147
|
"prepack": "bun run build",
|
|
148
148
|
"generate:openapi": "bun run scripts/openapi.ts",
|
|
149
|
-
"generate:promises": "bun run
|
|
149
|
+
"generate:promises": "bun run codegen/generate-promises.ts && bun run scripts/generate-promise-errors.ts && oxfmt --config=../../oxfmt.config.ts src/client src/promises/errors.gen.ts src/promises/types.gen.ts",
|
|
150
150
|
"generate:effect": "bun run codegen/generate-effect.ts && oxfmt --config=../../oxfmt.config.ts src/effect/generated.ts src/effect/generated-metadata.ts && bun run codegen/normalize-effect.ts",
|
|
151
151
|
"generate": "bun generate:openapi && bun generate:promises && bun generate:effect",
|
|
152
152
|
"test:generation": "bun scripts/check-generation.ts",
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"typecheck": "tsc --noEmit && tsc --noEmit -p codegen/tsconfig.json && tsc --noEmit -p tests/tsconfig.json"
|
|
158
158
|
},
|
|
159
159
|
"dependencies": {
|
|
160
|
-
"@samva/webhooks": "0.
|
|
160
|
+
"@samva/webhooks": "0.7.0"
|
|
161
161
|
},
|
|
162
162
|
"devDependencies": {
|
|
163
163
|
"@effect/openapi-generator": "4.0.0-rc.117",
|