samva 0.3.0 → 0.4.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/AGENTS.md +1 -1
- package/README.md +5 -1
- package/dist/client/sdk.gen.d.ts +167 -184
- package/dist/client/types.gen.d.ts +1362 -662
- package/dist/{client-BOghX8fr.js → client-BmZK_uCt.js} +1797 -935
- package/dist/client-attribution-BslSOa_8.js +9 -0
- package/dist/client-attribution.d.ts +2 -0
- package/dist/effect/api-keys.d.ts +51 -51
- package/dist/effect/api-keys.js +1 -1
- package/dist/effect/campaigns.d.ts +253 -219
- package/dist/effect/campaigns.js +1 -1
- package/dist/effect/categories.d.ts +6 -6
- package/dist/effect/client.js +1 -1
- package/dist/effect/contacts.d.ts +225 -225
- package/dist/effect/contacts.js +1 -1
- package/dist/effect/conversations.d.ts +293 -293
- package/dist/effect/conversations.js +1 -1
- package/dist/effect/design.d.ts +76 -76
- package/dist/effect/design.js +1 -1
- package/dist/effect/email.d.ts +225 -213
- package/dist/effect/email.js +2 -2
- package/dist/effect/generated.d.ts +12174 -11888
- package/dist/effect/index.js +1 -1
- package/dist/effect/internal/client.d.ts +1 -1
- package/dist/effect/internal/operation.d.ts +20 -19
- package/dist/effect/media.d.ts +9 -9
- package/dist/effect/media.js +1 -1
- package/dist/effect/messages.d.ts +64 -61
- package/dist/effect/messages.js +1 -1
- package/dist/effect/operations.d.ts +17 -17
- package/dist/effect/operations.js +1 -1
- package/dist/effect/organizations.d.ts +162 -162
- package/dist/effect/organizations.js +1 -1
- package/dist/effect/runtime.d.ts +0 -2
- package/dist/effect/scheduled-messages.d.ts +290 -276
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/templates.d.ts +1371 -1554
- package/dist/effect/templates.js +40 -30
- package/dist/effect/webhooks.d.ts +47 -47
- package/dist/effect/webhooks.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{normalize-BKFjbR9t.js → normalize-BiIJnycv.js} +2 -3
- package/dist/{operation-C2Q4cFJL.js → operation-B1knNlxk.js} +65 -38
- package/dist/promises/index.d.ts +10 -8
- package/dist/promises/index.js +1 -1
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-oiy7mOyu.js → promises-n1opem5V.js} +293 -262
- package/dist/service-map.d.ts +70 -44
- package/package.json +13 -14
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as clientAttribution, t as CLIENT_ATTRIBUTION_HEADER } from "./client-attribution-BslSOa_8.js";
|
|
2
|
+
import { n as buildMessagesSendPayload, r as replyToEmailsPayload, t as buildEmailSendPayload } from "./normalize-BiIJnycv.js";
|
|
2
3
|
//#region src/client/core/bodySerializer.gen.ts
|
|
3
4
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
4
5
|
//#endregion
|
|
@@ -677,7 +678,7 @@ var Messages = class {
|
|
|
677
678
|
/**
|
|
678
679
|
* List messages
|
|
679
680
|
*
|
|
680
|
-
* Returns a paginated list of messages across all channels, with optional filters for channel, status, conversation, contact, and date range.
|
|
681
|
+
* Returns a paginated list of messages across all channels, with optional filters for channel, direction, status, conversation, contact, and date range.
|
|
681
682
|
*/
|
|
682
683
|
static list(parameters, options) {
|
|
683
684
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -693,6 +694,10 @@ var Messages = class {
|
|
|
693
694
|
in: "query",
|
|
694
695
|
key: "channel"
|
|
695
696
|
},
|
|
697
|
+
{
|
|
698
|
+
in: "query",
|
|
699
|
+
key: "direction"
|
|
700
|
+
},
|
|
696
701
|
{
|
|
697
702
|
in: "query",
|
|
698
703
|
key: "status"
|
|
@@ -973,7 +978,7 @@ var ScheduledMessages = class {
|
|
|
973
978
|
/**
|
|
974
979
|
* Schedule a message
|
|
975
980
|
*
|
|
976
|
-
* Schedules a message at the absolute ISO-8601
|
|
981
|
+
* Schedules a message for dispatch at the absolute ISO-8601 timestamp supplied in scheduledFor. Optional timezone is validated IANA display metadata only and never changes the execution instant.
|
|
977
982
|
*/
|
|
978
983
|
static create(parameters, options) {
|
|
979
984
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -1415,7 +1420,7 @@ var Email = class {
|
|
|
1415
1420
|
/**
|
|
1416
1421
|
* Get email tracking defaults
|
|
1417
1422
|
*
|
|
1418
|
-
* Returns the
|
|
1423
|
+
* Returns the workspace's independent defaults for open and click tracking, both enabled unless configured otherwise. Recipient opt-out takes precedence over these defaults.
|
|
1419
1424
|
*/
|
|
1420
1425
|
static getTrackingDefaults(options) {
|
|
1421
1426
|
return (options?.client ?? client).get({
|
|
@@ -1529,12 +1534,15 @@ var Email = class {
|
|
|
1529
1534
|
/**
|
|
1530
1535
|
* Add a sending domain
|
|
1531
1536
|
*
|
|
1532
|
-
* Registers a domain for sending and returns it with the DNS records required to verify ownership and configure DKIM. Responds with 201.
|
|
1537
|
+
* 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.
|
|
1533
1538
|
*/
|
|
1534
1539
|
static addDomain(parameters, options) {
|
|
1535
1540
|
const params = buildClientParams([parameters], [{ args: [{
|
|
1536
1541
|
in: "body",
|
|
1537
1542
|
key: "domain"
|
|
1543
|
+
}, {
|
|
1544
|
+
in: "body",
|
|
1545
|
+
key: "connection"
|
|
1538
1546
|
}] }]);
|
|
1539
1547
|
return (options?.client ?? client).post({
|
|
1540
1548
|
security: [{
|
|
@@ -1906,7 +1914,7 @@ var Email = class {
|
|
|
1906
1914
|
/**
|
|
1907
1915
|
* Disable a custom tracking domain
|
|
1908
1916
|
*
|
|
1909
|
-
*
|
|
1917
|
+
* Disables a domain's custom tracking, removes its managed resources, and immediately returns sends to the shared tracking host. Existing custom links in already-delivered mail stop working.
|
|
1910
1918
|
*/
|
|
1911
1919
|
static disableCustomTracking(parameters, options) {
|
|
1912
1920
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -2087,10 +2095,14 @@ var Email = class {
|
|
|
2087
2095
|
/**
|
|
2088
2096
|
* Add a sender identity
|
|
2089
2097
|
*
|
|
2090
|
-
*
|
|
2098
|
+
* Durably creates a sender identity. The required Idempotency-Key replays the original sender for an identical request and conflicts when reused with different input.
|
|
2091
2099
|
*/
|
|
2092
2100
|
static addSender(parameters, options) {
|
|
2093
2101
|
const params = buildClientParams([parameters], [{ args: [
|
|
2102
|
+
{
|
|
2103
|
+
in: "headers",
|
|
2104
|
+
key: "idempotency-key"
|
|
2105
|
+
},
|
|
2094
2106
|
{
|
|
2095
2107
|
in: "body",
|
|
2096
2108
|
key: "email"
|
|
@@ -2146,7 +2158,7 @@ var Email = class {
|
|
|
2146
2158
|
/**
|
|
2147
2159
|
* Remove a sender identity
|
|
2148
2160
|
*
|
|
2149
|
-
*
|
|
2161
|
+
* Accepts sender removal, marks it inactive, and retains its deleting lifecycle until provider identity and association cleanup is confirmed.
|
|
2150
2162
|
*/
|
|
2151
2163
|
static removeSender(parameters, options) {
|
|
2152
2164
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -3961,7 +3973,7 @@ var Templates = class {
|
|
|
3961
3973
|
/**
|
|
3962
3974
|
* Create a template
|
|
3963
3975
|
*
|
|
3964
|
-
* Creates
|
|
3976
|
+
* Creates an email template project from Samva's canonical TSX starter and returns its template entry with status 201.
|
|
3965
3977
|
*/
|
|
3966
3978
|
static create(parameters, options) {
|
|
3967
3979
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -3971,47 +3983,23 @@ var Templates = class {
|
|
|
3971
3983
|
},
|
|
3972
3984
|
{
|
|
3973
3985
|
in: "body",
|
|
3974
|
-
key: "
|
|
3975
|
-
},
|
|
3976
|
-
{
|
|
3977
|
-
in: "body",
|
|
3978
|
-
key: "origin"
|
|
3979
|
-
},
|
|
3980
|
-
{
|
|
3981
|
-
in: "body",
|
|
3982
|
-
key: "description"
|
|
3983
|
-
},
|
|
3984
|
-
{
|
|
3985
|
-
in: "body",
|
|
3986
|
-
key: "category"
|
|
3987
|
-
},
|
|
3988
|
-
{
|
|
3989
|
-
in: "body",
|
|
3990
|
-
key: "source"
|
|
3991
|
-
},
|
|
3992
|
-
{
|
|
3993
|
-
in: "body",
|
|
3994
|
-
key: "subject"
|
|
3995
|
-
},
|
|
3996
|
-
{
|
|
3997
|
-
in: "body",
|
|
3998
|
-
key: "headers"
|
|
3986
|
+
key: "projectName"
|
|
3999
3987
|
},
|
|
4000
3988
|
{
|
|
4001
3989
|
in: "body",
|
|
4002
|
-
key: "
|
|
3990
|
+
key: "slug"
|
|
4003
3991
|
},
|
|
4004
3992
|
{
|
|
4005
3993
|
in: "body",
|
|
4006
|
-
key: "
|
|
3994
|
+
key: "galleryTemplateId"
|
|
4007
3995
|
},
|
|
4008
3996
|
{
|
|
4009
3997
|
in: "body",
|
|
4010
|
-
key: "
|
|
3998
|
+
key: "description"
|
|
4011
3999
|
},
|
|
4012
4000
|
{
|
|
4013
4001
|
in: "body",
|
|
4014
|
-
key: "
|
|
4002
|
+
key: "category"
|
|
4015
4003
|
},
|
|
4016
4004
|
{
|
|
4017
4005
|
in: "body",
|
|
@@ -4019,11 +4007,7 @@ var Templates = class {
|
|
|
4019
4007
|
},
|
|
4020
4008
|
{
|
|
4021
4009
|
in: "body",
|
|
4022
|
-
key: "
|
|
4023
|
-
},
|
|
4024
|
-
{
|
|
4025
|
-
in: "body",
|
|
4026
|
-
key: "version"
|
|
4010
|
+
key: "idempotencyKey"
|
|
4027
4011
|
}
|
|
4028
4012
|
] }]);
|
|
4029
4013
|
return (options?.client ?? client).post({
|
|
@@ -4286,29 +4270,6 @@ var Templates = class {
|
|
|
4286
4270
|
});
|
|
4287
4271
|
}
|
|
4288
4272
|
/**
|
|
4289
|
-
* Add a channel to a template family
|
|
4290
|
-
*
|
|
4291
|
-
* Creates a template for the requested channel in the family and returns the updated family with status 201.
|
|
4292
|
-
*/
|
|
4293
|
-
static addFamilyChannel(parameters, options) {
|
|
4294
|
-
const params = buildClientParams([parameters], [{ args: [{
|
|
4295
|
-
in: "path",
|
|
4296
|
-
key: "familyId"
|
|
4297
|
-
}, {
|
|
4298
|
-
in: "path",
|
|
4299
|
-
key: "channel"
|
|
4300
|
-
}] }]);
|
|
4301
|
-
return (options?.client ?? client).post({
|
|
4302
|
-
security: [{
|
|
4303
|
-
name: "x-api-key",
|
|
4304
|
-
type: "apiKey"
|
|
4305
|
-
}],
|
|
4306
|
-
url: "/v1/templates/families/{familyId}/channels/{channel}",
|
|
4307
|
-
...options,
|
|
4308
|
-
...params
|
|
4309
|
-
});
|
|
4310
|
-
}
|
|
4311
|
-
/**
|
|
4312
4273
|
* Delete a template
|
|
4313
4274
|
*
|
|
4314
4275
|
* Deletes a template from the organization and returns a success flag.
|
|
@@ -4331,7 +4292,7 @@ var Templates = class {
|
|
|
4331
4292
|
/**
|
|
4332
4293
|
* Get a template
|
|
4333
4294
|
*
|
|
4334
|
-
* Returns template metadata and compiled channel content.
|
|
4295
|
+
* Returns template metadata, its project entry path, and compiled channel content. Open live project files through the workspace API.
|
|
4335
4296
|
*/
|
|
4336
4297
|
static getById(parameters, options) {
|
|
4337
4298
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -4351,7 +4312,7 @@ var Templates = class {
|
|
|
4351
4312
|
/**
|
|
4352
4313
|
* Update a template
|
|
4353
4314
|
*
|
|
4354
|
-
* Updates template metadata. Source changes use the
|
|
4315
|
+
* Updates template metadata. Source changes use the project workspace API.
|
|
4355
4316
|
*/
|
|
4356
4317
|
static update(parameters, options) {
|
|
4357
4318
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -4377,24 +4338,35 @@ var Templates = class {
|
|
|
4377
4338
|
});
|
|
4378
4339
|
}
|
|
4379
4340
|
/**
|
|
4380
|
-
*
|
|
4341
|
+
* Patch template project files
|
|
4381
4342
|
*
|
|
4382
|
-
*
|
|
4343
|
+
* Applies revision-checked file patches to the shared project workspace overlay.
|
|
4383
4344
|
*/
|
|
4384
|
-
static
|
|
4385
|
-
const params = buildClientParams([parameters], [{ args: [
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4345
|
+
static patchWorkspace(parameters, options) {
|
|
4346
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
4347
|
+
{
|
|
4348
|
+
in: "path",
|
|
4349
|
+
key: "id"
|
|
4350
|
+
},
|
|
4351
|
+
{
|
|
4352
|
+
in: "body",
|
|
4353
|
+
key: "expectedRevision"
|
|
4354
|
+
},
|
|
4355
|
+
{
|
|
4356
|
+
in: "body",
|
|
4357
|
+
key: "patches"
|
|
4358
|
+
},
|
|
4359
|
+
{
|
|
4360
|
+
in: "body",
|
|
4361
|
+
key: "idempotencyKey"
|
|
4362
|
+
}
|
|
4363
|
+
] }]);
|
|
4364
|
+
return (options?.client ?? client).patch({
|
|
4393
4365
|
security: [{
|
|
4394
4366
|
name: "x-api-key",
|
|
4395
4367
|
type: "apiKey"
|
|
4396
4368
|
}],
|
|
4397
|
-
url: "/v1/templates/{id}/
|
|
4369
|
+
url: "/v1/templates/{id}/workspace",
|
|
4398
4370
|
...options,
|
|
4399
4371
|
...params,
|
|
4400
4372
|
headers: {
|
|
@@ -4404,83 +4376,80 @@ var Templates = class {
|
|
|
4404
4376
|
}
|
|
4405
4377
|
});
|
|
4406
4378
|
}
|
|
4407
|
-
};
|
|
4408
|
-
var TemplateDocuments = class {
|
|
4409
4379
|
/**
|
|
4410
|
-
*
|
|
4380
|
+
* Open a template project workspace
|
|
4411
4381
|
*
|
|
4412
|
-
* Creates or
|
|
4382
|
+
* Creates or opens the shared project workspace at the current Artifact branch head and returns its effective files.
|
|
4413
4383
|
*/
|
|
4414
|
-
static
|
|
4384
|
+
static openWorkspace(parameters, options) {
|
|
4415
4385
|
const params = buildClientParams([parameters], [{ args: [{
|
|
4416
|
-
in: "
|
|
4417
|
-
key: "
|
|
4386
|
+
in: "path",
|
|
4387
|
+
key: "id"
|
|
4418
4388
|
}] }]);
|
|
4419
4389
|
return (options?.client ?? client).post({
|
|
4420
4390
|
security: [{
|
|
4421
4391
|
name: "x-api-key",
|
|
4422
4392
|
type: "apiKey"
|
|
4423
4393
|
}],
|
|
4424
|
-
url: "/v1/
|
|
4394
|
+
url: "/v1/templates/{id}/workspace",
|
|
4425
4395
|
...options,
|
|
4426
|
-
...params
|
|
4427
|
-
headers: {
|
|
4428
|
-
"Content-Type": "application/json",
|
|
4429
|
-
...options?.headers,
|
|
4430
|
-
...params.headers
|
|
4431
|
-
}
|
|
4396
|
+
...params
|
|
4432
4397
|
});
|
|
4433
4398
|
}
|
|
4434
4399
|
/**
|
|
4435
|
-
*
|
|
4400
|
+
* Diff a template project workspace
|
|
4436
4401
|
*
|
|
4437
|
-
* Returns
|
|
4402
|
+
* Returns exact added, modified, and deleted project files against the current Git base commit.
|
|
4438
4403
|
*/
|
|
4439
|
-
static
|
|
4404
|
+
static diffWorkspace(parameters, options) {
|
|
4440
4405
|
const params = buildClientParams([parameters], [{ args: [{
|
|
4441
4406
|
in: "path",
|
|
4442
|
-
key: "
|
|
4407
|
+
key: "id"
|
|
4408
|
+
}, {
|
|
4409
|
+
in: "body",
|
|
4410
|
+
key: "expectedRevision"
|
|
4443
4411
|
}] }]);
|
|
4444
|
-
return (options?.client ?? client).
|
|
4412
|
+
return (options?.client ?? client).post({
|
|
4445
4413
|
security: [{
|
|
4446
4414
|
name: "x-api-key",
|
|
4447
4415
|
type: "apiKey"
|
|
4448
4416
|
}],
|
|
4449
|
-
url: "/v1/
|
|
4417
|
+
url: "/v1/templates/{id}/workspace/diff",
|
|
4450
4418
|
...options,
|
|
4451
|
-
...params
|
|
4419
|
+
...params,
|
|
4420
|
+
headers: {
|
|
4421
|
+
"Content-Type": "application/json",
|
|
4422
|
+
...options?.headers,
|
|
4423
|
+
...params.headers
|
|
4424
|
+
}
|
|
4452
4425
|
});
|
|
4453
4426
|
}
|
|
4454
4427
|
/**
|
|
4455
|
-
*
|
|
4428
|
+
* Reconcile a template project workspace
|
|
4456
4429
|
*
|
|
4457
|
-
*
|
|
4430
|
+
* Fast-forwards or rebases the workspace onto the current Artifact branch head, retaining file conflicts for explicit resolution.
|
|
4458
4431
|
*/
|
|
4459
|
-
static
|
|
4432
|
+
static reconcileWorkspace(parameters, options) {
|
|
4460
4433
|
const params = buildClientParams([parameters], [{ args: [
|
|
4461
4434
|
{
|
|
4462
4435
|
in: "path",
|
|
4463
|
-
key: "
|
|
4464
|
-
},
|
|
4465
|
-
{
|
|
4466
|
-
in: "body",
|
|
4467
|
-
key: "method"
|
|
4436
|
+
key: "id"
|
|
4468
4437
|
},
|
|
4469
4438
|
{
|
|
4470
4439
|
in: "body",
|
|
4471
|
-
key: "
|
|
4440
|
+
key: "expectedRevision"
|
|
4472
4441
|
},
|
|
4473
4442
|
{
|
|
4474
4443
|
in: "body",
|
|
4475
|
-
key: "
|
|
4444
|
+
key: "assetResolution"
|
|
4476
4445
|
},
|
|
4477
4446
|
{
|
|
4478
4447
|
in: "body",
|
|
4479
|
-
key: "
|
|
4448
|
+
key: "expectedRemoteHead"
|
|
4480
4449
|
},
|
|
4481
4450
|
{
|
|
4482
4451
|
in: "body",
|
|
4483
|
-
key: "
|
|
4452
|
+
key: "idempotencyKey"
|
|
4484
4453
|
}
|
|
4485
4454
|
] }]);
|
|
4486
4455
|
return (options?.client ?? client).post({
|
|
@@ -4488,7 +4457,7 @@ var TemplateDocuments = class {
|
|
|
4488
4457
|
name: "x-api-key",
|
|
4489
4458
|
type: "apiKey"
|
|
4490
4459
|
}],
|
|
4491
|
-
url: "/v1/
|
|
4460
|
+
url: "/v1/templates/{id}/workspace/reconcile",
|
|
4492
4461
|
...options,
|
|
4493
4462
|
...params,
|
|
4494
4463
|
headers: {
|
|
@@ -4499,24 +4468,39 @@ var TemplateDocuments = class {
|
|
|
4499
4468
|
});
|
|
4500
4469
|
}
|
|
4501
4470
|
/**
|
|
4502
|
-
*
|
|
4471
|
+
* Resolve a template workspace conflict
|
|
4503
4472
|
*
|
|
4504
|
-
*
|
|
4473
|
+
* Resolves one conflicted file by keeping the draft, using main, or supplying edited source.
|
|
4505
4474
|
*/
|
|
4506
|
-
static
|
|
4507
|
-
const params = buildClientParams([parameters], [{ args: [
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4475
|
+
static resolveWorkspaceConflict(parameters, options) {
|
|
4476
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
4477
|
+
{
|
|
4478
|
+
in: "path",
|
|
4479
|
+
key: "id"
|
|
4480
|
+
},
|
|
4481
|
+
{
|
|
4482
|
+
in: "body",
|
|
4483
|
+
key: "expectedRevision"
|
|
4484
|
+
},
|
|
4485
|
+
{
|
|
4486
|
+
in: "body",
|
|
4487
|
+
key: "path"
|
|
4488
|
+
},
|
|
4489
|
+
{
|
|
4490
|
+
in: "body",
|
|
4491
|
+
key: "resolution"
|
|
4492
|
+
},
|
|
4493
|
+
{
|
|
4494
|
+
in: "body",
|
|
4495
|
+
key: "idempotencyKey"
|
|
4496
|
+
}
|
|
4497
|
+
] }]);
|
|
4514
4498
|
return (options?.client ?? client).post({
|
|
4515
4499
|
security: [{
|
|
4516
4500
|
name: "x-api-key",
|
|
4517
4501
|
type: "apiKey"
|
|
4518
4502
|
}],
|
|
4519
|
-
url: "/v1/
|
|
4503
|
+
url: "/v1/templates/{id}/workspace/conflicts",
|
|
4520
4504
|
...options,
|
|
4521
4505
|
...params,
|
|
4522
4506
|
headers: {
|
|
@@ -4527,15 +4511,15 @@ var TemplateDocuments = class {
|
|
|
4527
4511
|
});
|
|
4528
4512
|
}
|
|
4529
4513
|
/**
|
|
4530
|
-
*
|
|
4514
|
+
* Save a template project workspace
|
|
4531
4515
|
*
|
|
4532
|
-
*
|
|
4516
|
+
* Validates the effective project tree and creates one normal Git commit on the Artifact default branch.
|
|
4533
4517
|
*/
|
|
4534
|
-
static
|
|
4518
|
+
static saveWorkspace(parameters, options) {
|
|
4535
4519
|
const params = buildClientParams([parameters], [{ args: [
|
|
4536
4520
|
{
|
|
4537
4521
|
in: "path",
|
|
4538
|
-
key: "
|
|
4522
|
+
key: "id"
|
|
4539
4523
|
},
|
|
4540
4524
|
{
|
|
4541
4525
|
in: "body",
|
|
@@ -4543,23 +4527,15 @@ var TemplateDocuments = class {
|
|
|
4543
4527
|
},
|
|
4544
4528
|
{
|
|
4545
4529
|
in: "body",
|
|
4546
|
-
key: "
|
|
4530
|
+
key: "expectedHead"
|
|
4547
4531
|
},
|
|
4548
4532
|
{
|
|
4549
4533
|
in: "body",
|
|
4550
|
-
key: "
|
|
4534
|
+
key: "message"
|
|
4551
4535
|
},
|
|
4552
4536
|
{
|
|
4553
4537
|
in: "body",
|
|
4554
|
-
key: "
|
|
4555
|
-
},
|
|
4556
|
-
{
|
|
4557
|
-
in: "body",
|
|
4558
|
-
key: "references"
|
|
4559
|
-
},
|
|
4560
|
-
{
|
|
4561
|
-
in: "body",
|
|
4562
|
-
key: "proposalBinding"
|
|
4538
|
+
key: "idempotencyKey"
|
|
4563
4539
|
}
|
|
4564
4540
|
] }]);
|
|
4565
4541
|
return (options?.client ?? client).post({
|
|
@@ -4567,7 +4543,7 @@ var TemplateDocuments = class {
|
|
|
4567
4543
|
name: "x-api-key",
|
|
4568
4544
|
type: "apiKey"
|
|
4569
4545
|
}],
|
|
4570
|
-
url: "/v1/
|
|
4546
|
+
url: "/v1/templates/{id}/workspace/save",
|
|
4571
4547
|
...options,
|
|
4572
4548
|
...params,
|
|
4573
4549
|
headers: {
|
|
@@ -4578,15 +4554,15 @@ var TemplateDocuments = class {
|
|
|
4578
4554
|
});
|
|
4579
4555
|
}
|
|
4580
4556
|
/**
|
|
4581
|
-
*
|
|
4557
|
+
* Stage a historical template project tree
|
|
4582
4558
|
*
|
|
4583
|
-
*
|
|
4559
|
+
* Builds the template entry before atomically staging a reachable historical commit and its emitted source; a later Save appends a new commit without rewriting branch history.
|
|
4584
4560
|
*/
|
|
4585
|
-
static
|
|
4561
|
+
static restoreWorkspace(parameters, options) {
|
|
4586
4562
|
const params = buildClientParams([parameters], [{ args: [
|
|
4587
4563
|
{
|
|
4588
4564
|
in: "path",
|
|
4589
|
-
key: "
|
|
4565
|
+
key: "id"
|
|
4590
4566
|
},
|
|
4591
4567
|
{
|
|
4592
4568
|
in: "body",
|
|
@@ -4594,7 +4570,11 @@ var TemplateDocuments = class {
|
|
|
4594
4570
|
},
|
|
4595
4571
|
{
|
|
4596
4572
|
in: "body",
|
|
4597
|
-
key: "
|
|
4573
|
+
key: "commit"
|
|
4574
|
+
},
|
|
4575
|
+
{
|
|
4576
|
+
in: "body",
|
|
4577
|
+
key: "idempotencyKey"
|
|
4598
4578
|
}
|
|
4599
4579
|
] }]);
|
|
4600
4580
|
return (options?.client ?? client).post({
|
|
@@ -4602,7 +4582,7 @@ var TemplateDocuments = class {
|
|
|
4602
4582
|
name: "x-api-key",
|
|
4603
4583
|
type: "apiKey"
|
|
4604
4584
|
}],
|
|
4605
|
-
url: "/v1/
|
|
4585
|
+
url: "/v1/templates/{id}/workspace/restore",
|
|
4606
4586
|
...options,
|
|
4607
4587
|
...params,
|
|
4608
4588
|
headers: {
|
|
@@ -4613,59 +4593,47 @@ var TemplateDocuments = class {
|
|
|
4613
4593
|
});
|
|
4614
4594
|
}
|
|
4615
4595
|
/**
|
|
4616
|
-
*
|
|
4596
|
+
* List template project commit history
|
|
4617
4597
|
*
|
|
4618
|
-
*
|
|
4598
|
+
* Returns bounded history from the Artifact repository default branch.
|
|
4619
4599
|
*/
|
|
4620
|
-
static
|
|
4600
|
+
static workspaceHistory(parameters, options) {
|
|
4621
4601
|
const params = buildClientParams([parameters], [{ args: [{
|
|
4622
4602
|
in: "path",
|
|
4623
|
-
key: "
|
|
4603
|
+
key: "id"
|
|
4624
4604
|
}, {
|
|
4625
|
-
in: "
|
|
4626
|
-
key: "
|
|
4605
|
+
in: "query",
|
|
4606
|
+
key: "limit"
|
|
4627
4607
|
}] }]);
|
|
4628
|
-
return (options?.client ?? client).
|
|
4608
|
+
return (options?.client ?? client).get({
|
|
4629
4609
|
security: [{
|
|
4630
4610
|
name: "x-api-key",
|
|
4631
4611
|
type: "apiKey"
|
|
4632
4612
|
}],
|
|
4633
|
-
url: "/v1/
|
|
4613
|
+
url: "/v1/templates/{id}/workspace/history",
|
|
4634
4614
|
...options,
|
|
4635
|
-
...params
|
|
4636
|
-
headers: {
|
|
4637
|
-
"Content-Type": "application/json",
|
|
4638
|
-
...options?.headers,
|
|
4639
|
-
...params.headers
|
|
4640
|
-
}
|
|
4615
|
+
...params
|
|
4641
4616
|
});
|
|
4642
4617
|
}
|
|
4643
4618
|
/**
|
|
4644
|
-
*
|
|
4619
|
+
* Check a template project workspace
|
|
4645
4620
|
*
|
|
4646
|
-
*
|
|
4621
|
+
* Builds the template entry from the current effective workspace tree, including unsaved file patches, and returns what the template declares plus every compile and target-client finding. Nothing is written and no message is rendered.
|
|
4647
4622
|
*/
|
|
4648
|
-
static
|
|
4649
|
-
const params = buildClientParams([parameters], [{ args: [
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
key: "revision"
|
|
4657
|
-
},
|
|
4658
|
-
{
|
|
4659
|
-
in: "body",
|
|
4660
|
-
key: "variables"
|
|
4661
|
-
}
|
|
4662
|
-
] }]);
|
|
4623
|
+
static checkWorkspace(parameters, options) {
|
|
4624
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4625
|
+
in: "path",
|
|
4626
|
+
key: "id"
|
|
4627
|
+
}, {
|
|
4628
|
+
in: "body",
|
|
4629
|
+
key: "expectedRevision"
|
|
4630
|
+
}] }]);
|
|
4663
4631
|
return (options?.client ?? client).post({
|
|
4664
4632
|
security: [{
|
|
4665
4633
|
name: "x-api-key",
|
|
4666
4634
|
type: "apiKey"
|
|
4667
4635
|
}],
|
|
4668
|
-
url: "/v1/
|
|
4636
|
+
url: "/v1/templates/{id}/workspace/check",
|
|
4669
4637
|
...options,
|
|
4670
4638
|
...params,
|
|
4671
4639
|
headers: {
|
|
@@ -4676,23 +4644,23 @@ var TemplateDocuments = class {
|
|
|
4676
4644
|
});
|
|
4677
4645
|
}
|
|
4678
4646
|
/**
|
|
4679
|
-
*
|
|
4647
|
+
* Render a declared template workspace fixture
|
|
4680
4648
|
*
|
|
4681
|
-
* Renders
|
|
4649
|
+
* Renders one of the named inputs the template declares against the current effective workspace tree. Only declared fixtures render here; arbitrary input renders against a publication.
|
|
4682
4650
|
*/
|
|
4683
|
-
static
|
|
4651
|
+
static renderWorkspaceFixture(parameters, options) {
|
|
4684
4652
|
const params = buildClientParams([parameters], [{ args: [
|
|
4685
4653
|
{
|
|
4686
4654
|
in: "path",
|
|
4687
|
-
key: "
|
|
4655
|
+
key: "id"
|
|
4688
4656
|
},
|
|
4689
4657
|
{
|
|
4690
4658
|
in: "body",
|
|
4691
|
-
key: "
|
|
4659
|
+
key: "expectedRevision"
|
|
4692
4660
|
},
|
|
4693
4661
|
{
|
|
4694
4662
|
in: "body",
|
|
4695
|
-
key: "
|
|
4663
|
+
key: "fixture"
|
|
4696
4664
|
}
|
|
4697
4665
|
] }]);
|
|
4698
4666
|
return (options?.client ?? client).post({
|
|
@@ -4700,7 +4668,7 @@ var TemplateDocuments = class {
|
|
|
4700
4668
|
name: "x-api-key",
|
|
4701
4669
|
type: "apiKey"
|
|
4702
4670
|
}],
|
|
4703
|
-
url: "/v1/
|
|
4671
|
+
url: "/v1/templates/{id}/workspace/fixtures",
|
|
4704
4672
|
...options,
|
|
4705
4673
|
...params,
|
|
4706
4674
|
headers: {
|
|
@@ -4711,27 +4679,31 @@ var TemplateDocuments = class {
|
|
|
4711
4679
|
});
|
|
4712
4680
|
}
|
|
4713
4681
|
/**
|
|
4714
|
-
*
|
|
4682
|
+
* Publish an exact template commit
|
|
4715
4683
|
*
|
|
4716
|
-
*
|
|
4684
|
+
* Builds an exact Git commit and entry path, stores the immutable executable and its assets, records the input contract it validates against, and makes that publication current.
|
|
4717
4685
|
*/
|
|
4718
|
-
static
|
|
4686
|
+
static publish(parameters, options) {
|
|
4719
4687
|
const params = buildClientParams([parameters], [{ args: [
|
|
4720
4688
|
{
|
|
4721
4689
|
in: "path",
|
|
4722
|
-
key: "
|
|
4690
|
+
key: "id"
|
|
4691
|
+
},
|
|
4692
|
+
{
|
|
4693
|
+
in: "body",
|
|
4694
|
+
key: "projectId"
|
|
4723
4695
|
},
|
|
4724
4696
|
{
|
|
4725
4697
|
in: "body",
|
|
4726
|
-
key: "
|
|
4698
|
+
key: "commitSha"
|
|
4727
4699
|
},
|
|
4728
4700
|
{
|
|
4729
4701
|
in: "body",
|
|
4730
|
-
key: "
|
|
4702
|
+
key: "entryPath"
|
|
4731
4703
|
},
|
|
4732
4704
|
{
|
|
4733
4705
|
in: "body",
|
|
4734
|
-
key: "
|
|
4706
|
+
key: "expectedWorkspaceRevision"
|
|
4735
4707
|
}
|
|
4736
4708
|
] }]);
|
|
4737
4709
|
return (options?.client ?? client).post({
|
|
@@ -4739,7 +4711,7 @@ var TemplateDocuments = class {
|
|
|
4739
4711
|
name: "x-api-key",
|
|
4740
4712
|
type: "apiKey"
|
|
4741
4713
|
}],
|
|
4742
|
-
url: "/v1/
|
|
4714
|
+
url: "/v1/templates/{id}/publications",
|
|
4743
4715
|
...options,
|
|
4744
4716
|
...params,
|
|
4745
4717
|
headers: {
|
|
@@ -4750,126 +4722,180 @@ var TemplateDocuments = class {
|
|
|
4750
4722
|
});
|
|
4751
4723
|
}
|
|
4752
4724
|
/**
|
|
4753
|
-
*
|
|
4725
|
+
* Get a template publication
|
|
4754
4726
|
*
|
|
4755
|
-
*
|
|
4727
|
+
* Returns one immutable publication and its exact build receipt.
|
|
4756
4728
|
*/
|
|
4757
|
-
static
|
|
4758
|
-
const params = buildClientParams([parameters], [{ args: [
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
},
|
|
4767
|
-
{
|
|
4768
|
-
in: "body",
|
|
4769
|
-
key: "to"
|
|
4770
|
-
},
|
|
4771
|
-
{
|
|
4772
|
-
in: "body",
|
|
4773
|
-
key: "variables"
|
|
4774
|
-
},
|
|
4775
|
-
{
|
|
4776
|
-
in: "body",
|
|
4777
|
-
key: "schedule"
|
|
4778
|
-
}
|
|
4779
|
-
] }]);
|
|
4780
|
-
return (options?.client ?? client).post({
|
|
4729
|
+
static getPublication(parameters, options) {
|
|
4730
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4731
|
+
in: "path",
|
|
4732
|
+
key: "id"
|
|
4733
|
+
}, {
|
|
4734
|
+
in: "path",
|
|
4735
|
+
key: "publicationId"
|
|
4736
|
+
}] }]);
|
|
4737
|
+
return (options?.client ?? client).get({
|
|
4781
4738
|
security: [{
|
|
4782
4739
|
name: "x-api-key",
|
|
4783
4740
|
type: "apiKey"
|
|
4784
4741
|
}],
|
|
4785
|
-
url: "/v1/
|
|
4742
|
+
url: "/v1/templates/{id}/publications/{publicationId}",
|
|
4786
4743
|
...options,
|
|
4787
|
-
...params
|
|
4788
|
-
headers: {
|
|
4789
|
-
"Content-Type": "application/json",
|
|
4790
|
-
...options?.headers,
|
|
4791
|
-
...params.headers
|
|
4792
|
-
}
|
|
4744
|
+
...params
|
|
4793
4745
|
});
|
|
4794
4746
|
}
|
|
4795
4747
|
/**
|
|
4796
|
-
* List template
|
|
4748
|
+
* List a template's input contracts
|
|
4797
4749
|
*
|
|
4798
|
-
* Returns
|
|
4750
|
+
* Returns every immutable input contract this template has published under, newest version first. Send against a contract to follow later publications that validate input identically.
|
|
4799
4751
|
*/
|
|
4800
|
-
static
|
|
4752
|
+
static listInputContracts(parameters, options) {
|
|
4801
4753
|
const params = buildClientParams([parameters], [{ args: [{
|
|
4802
4754
|
in: "path",
|
|
4803
|
-
key: "
|
|
4755
|
+
key: "id"
|
|
4804
4756
|
}] }]);
|
|
4805
4757
|
return (options?.client ?? client).get({
|
|
4806
4758
|
security: [{
|
|
4807
4759
|
name: "x-api-key",
|
|
4808
4760
|
type: "apiKey"
|
|
4809
4761
|
}],
|
|
4810
|
-
url: "/v1/
|
|
4762
|
+
url: "/v1/templates/{id}/input-contracts",
|
|
4811
4763
|
...options,
|
|
4812
4764
|
...params
|
|
4813
4765
|
});
|
|
4814
4766
|
}
|
|
4815
4767
|
/**
|
|
4816
|
-
*
|
|
4768
|
+
* Get a template input contract
|
|
4817
4769
|
*
|
|
4818
|
-
*
|
|
4770
|
+
* Returns one immutable input contract and the published schema it validates against.
|
|
4819
4771
|
*/
|
|
4820
|
-
static
|
|
4772
|
+
static getInputContract(parameters, options) {
|
|
4821
4773
|
const params = buildClientParams([parameters], [{ args: [{
|
|
4822
4774
|
in: "path",
|
|
4823
|
-
key: "
|
|
4775
|
+
key: "id"
|
|
4776
|
+
}, {
|
|
4777
|
+
in: "path",
|
|
4778
|
+
key: "inputContractId"
|
|
4824
4779
|
}] }]);
|
|
4825
|
-
return (options?.client ?? client).
|
|
4780
|
+
return (options?.client ?? client).get({
|
|
4826
4781
|
security: [{
|
|
4827
4782
|
name: "x-api-key",
|
|
4828
4783
|
type: "apiKey"
|
|
4829
4784
|
}],
|
|
4830
|
-
url: "/v1/
|
|
4785
|
+
url: "/v1/templates/{id}/input-contracts/{inputContractId}",
|
|
4831
4786
|
...options,
|
|
4832
4787
|
...params
|
|
4833
4788
|
});
|
|
4834
4789
|
}
|
|
4835
4790
|
/**
|
|
4836
|
-
*
|
|
4791
|
+
* Get a template project Git repository
|
|
4837
4792
|
*
|
|
4838
|
-
*
|
|
4793
|
+
* Returns the credential-free HTTPS remote and default branch for the template project repository.
|
|
4839
4794
|
*/
|
|
4840
|
-
static
|
|
4795
|
+
static getGitRepository(parameters, options) {
|
|
4841
4796
|
const params = buildClientParams([parameters], [{ args: [{
|
|
4842
4797
|
in: "path",
|
|
4843
|
-
key: "
|
|
4798
|
+
key: "id"
|
|
4844
4799
|
}] }]);
|
|
4845
|
-
return (options?.client ?? client).
|
|
4800
|
+
return (options?.client ?? client).get({
|
|
4846
4801
|
security: [{
|
|
4847
4802
|
name: "x-api-key",
|
|
4848
4803
|
type: "apiKey"
|
|
4849
4804
|
}],
|
|
4850
|
-
url: "/v1/
|
|
4805
|
+
url: "/v1/templates/{id}/repository",
|
|
4851
4806
|
...options,
|
|
4852
4807
|
...params
|
|
4853
4808
|
});
|
|
4854
4809
|
}
|
|
4855
4810
|
/**
|
|
4856
|
-
*
|
|
4811
|
+
* Issue a template project Git credential
|
|
4812
|
+
*
|
|
4813
|
+
* Exchanges the caller's Samva authorization for a one-hour, repository-scoped Artifact Git credential.
|
|
4814
|
+
*/
|
|
4815
|
+
static issueGitCredential(parameters, options) {
|
|
4816
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4817
|
+
in: "path",
|
|
4818
|
+
key: "id"
|
|
4819
|
+
}, {
|
|
4820
|
+
in: "body",
|
|
4821
|
+
key: "scope"
|
|
4822
|
+
}] }]);
|
|
4823
|
+
return (options?.client ?? client).post({
|
|
4824
|
+
security: [{
|
|
4825
|
+
name: "x-api-key",
|
|
4826
|
+
type: "apiKey"
|
|
4827
|
+
}],
|
|
4828
|
+
url: "/v1/templates/{id}/repository/credentials",
|
|
4829
|
+
...options,
|
|
4830
|
+
...params,
|
|
4831
|
+
headers: {
|
|
4832
|
+
"Content-Type": "application/json",
|
|
4833
|
+
...options?.headers,
|
|
4834
|
+
...params.headers
|
|
4835
|
+
}
|
|
4836
|
+
});
|
|
4837
|
+
}
|
|
4838
|
+
/**
|
|
4839
|
+
* Attach a template workspace resource
|
|
4857
4840
|
*
|
|
4858
|
-
*
|
|
4841
|
+
* Adds or replaces one bounded persistent read-only resource and advances the workspace revision.
|
|
4859
4842
|
*/
|
|
4860
|
-
static
|
|
4843
|
+
static attachWorkspaceResource(parameters, options) {
|
|
4861
4844
|
const params = buildClientParams([parameters], [{ args: [
|
|
4862
4845
|
{
|
|
4863
4846
|
in: "path",
|
|
4864
|
-
key: "
|
|
4847
|
+
key: "id"
|
|
4848
|
+
},
|
|
4849
|
+
{
|
|
4850
|
+
in: "body",
|
|
4851
|
+
key: "expectedRevision"
|
|
4852
|
+
},
|
|
4853
|
+
{
|
|
4854
|
+
in: "body",
|
|
4855
|
+
key: "resource"
|
|
4856
|
+
},
|
|
4857
|
+
{
|
|
4858
|
+
in: "body",
|
|
4859
|
+
key: "idempotencyKey"
|
|
4860
|
+
}
|
|
4861
|
+
] }]);
|
|
4862
|
+
return (options?.client ?? client).post({
|
|
4863
|
+
security: [{
|
|
4864
|
+
name: "x-api-key",
|
|
4865
|
+
type: "apiKey"
|
|
4866
|
+
}],
|
|
4867
|
+
url: "/v1/templates/{id}/workspace/resources",
|
|
4868
|
+
...options,
|
|
4869
|
+
...params,
|
|
4870
|
+
headers: {
|
|
4871
|
+
"Content-Type": "application/json",
|
|
4872
|
+
...options?.headers,
|
|
4873
|
+
...params.headers
|
|
4874
|
+
}
|
|
4875
|
+
});
|
|
4876
|
+
}
|
|
4877
|
+
/**
|
|
4878
|
+
* Remove a template workspace resource
|
|
4879
|
+
*
|
|
4880
|
+
* Removes one persistent resource from mounted context and advances the workspace revision.
|
|
4881
|
+
*/
|
|
4882
|
+
static removeWorkspaceResource(parameters, options) {
|
|
4883
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
4884
|
+
{
|
|
4885
|
+
in: "path",
|
|
4886
|
+
key: "id"
|
|
4865
4887
|
},
|
|
4866
4888
|
{
|
|
4867
4889
|
in: "path",
|
|
4868
|
-
key: "
|
|
4890
|
+
key: "resourceId"
|
|
4869
4891
|
},
|
|
4870
4892
|
{
|
|
4871
4893
|
in: "body",
|
|
4872
4894
|
key: "expectedRevision"
|
|
4895
|
+
},
|
|
4896
|
+
{
|
|
4897
|
+
in: "body",
|
|
4898
|
+
key: "idempotencyKey"
|
|
4873
4899
|
}
|
|
4874
4900
|
] }]);
|
|
4875
4901
|
return (options?.client ?? client).post({
|
|
@@ -4877,7 +4903,7 @@ var TemplateDocuments = class {
|
|
|
4877
4903
|
name: "x-api-key",
|
|
4878
4904
|
type: "apiKey"
|
|
4879
4905
|
}],
|
|
4880
|
-
url: "/v1/
|
|
4906
|
+
url: "/v1/templates/{id}/workspace/resources/{resourceId}/remove",
|
|
4881
4907
|
...options,
|
|
4882
4908
|
...params,
|
|
4883
4909
|
headers: {
|
|
@@ -4964,7 +4990,7 @@ var Webhooks = class {
|
|
|
4964
4990
|
/**
|
|
4965
4991
|
* Create a webhook
|
|
4966
4992
|
*
|
|
4967
|
-
* Creates a webhook endpoint
|
|
4993
|
+
* Creates a signed webhook endpoint for Samva delivery and inbound events, stores subscriptions, and returns the endpoint and signing secret with a 201 response.
|
|
4968
4994
|
*/
|
|
4969
4995
|
static create(parameters, options) {
|
|
4970
4996
|
const params = buildClientParams([parameters], [{ args: [
|
|
@@ -5349,7 +5375,7 @@ var Organizations = class {
|
|
|
5349
5375
|
/**
|
|
5350
5376
|
* Delete the current workspace
|
|
5351
5377
|
*
|
|
5352
|
-
*
|
|
5378
|
+
* Starts an owner-authorized durable workspace deletion operation, confirming the workspace name in the request. Repeating the same request with the same Idempotency-Key returns the existing organization-scoped operation.
|
|
5353
5379
|
*/
|
|
5354
5380
|
static delete(parameters, options) {
|
|
5355
5381
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -6152,11 +6178,13 @@ function createPromiseEmailTransport(clientInstance) {
|
|
|
6152
6178
|
return Object.assign(boundEmail, {
|
|
6153
6179
|
addSender: (input, options) => {
|
|
6154
6180
|
const { replyToEmails, ...sender } = input;
|
|
6181
|
+
const { idempotencyKey = crypto.randomUUID(), ...requestOptions } = options ?? {};
|
|
6155
6182
|
return Email.addSender({
|
|
6183
|
+
"idempotency-key": idempotencyKey,
|
|
6156
6184
|
...sender,
|
|
6157
6185
|
...replyToEmailsPayload(replyToEmails)
|
|
6158
6186
|
}, {
|
|
6159
|
-
...
|
|
6187
|
+
...requestOptions,
|
|
6160
6188
|
client: clientInstance
|
|
6161
6189
|
});
|
|
6162
6190
|
},
|
|
@@ -6166,6 +6194,9 @@ function createPromiseEmailTransport(clientInstance) {
|
|
|
6166
6194
|
})
|
|
6167
6195
|
});
|
|
6168
6196
|
}
|
|
6197
|
+
function createPromiseTemplatesTransport(clientInstance) {
|
|
6198
|
+
return createBoundService(Templates, clientInstance);
|
|
6199
|
+
}
|
|
6169
6200
|
function createBoundService(service, clientInstance) {
|
|
6170
6201
|
const bound = {};
|
|
6171
6202
|
for (const key of Object.getOwnPropertyNames(service)) {
|
|
@@ -6214,17 +6245,19 @@ function createDirectService(service) {
|
|
|
6214
6245
|
}
|
|
6215
6246
|
/** Create a configured Promise client. */
|
|
6216
6247
|
function createClient(config) {
|
|
6217
|
-
const authHeaders = config.authToken ? { Authorization: `Bearer ${config.authToken}` } : { "X-API-Key": config.apiKey };
|
|
6248
|
+
const authHeaders = config.authToken !== void 0 ? { Authorization: `Bearer ${config.authToken}` } : { "X-API-Key": config.apiKey };
|
|
6218
6249
|
const clientInstance = createClient$1({
|
|
6219
6250
|
...config,
|
|
6220
6251
|
baseUrl: config.baseUrl ?? "https://api.samva.dev",
|
|
6221
|
-
headers: {
|
|
6222
|
-
...config.headers,
|
|
6223
|
-
...authHeaders
|
|
6224
|
-
},
|
|
6252
|
+
headers: mergeHeaders({ [CLIENT_ATTRIBUTION_HEADER]: clientAttribution("typescript-promise") }, config.headers, authHeaders),
|
|
6225
6253
|
responseStyle: "fields",
|
|
6226
6254
|
throwOnError: false
|
|
6227
6255
|
});
|
|
6256
|
+
clientInstance.interceptors.request.use((request) => {
|
|
6257
|
+
const headers = new Headers(request.headers);
|
|
6258
|
+
for (const [name, value] of Object.entries(authHeaders)) headers.set(name, value);
|
|
6259
|
+
return new Request(request, { headers });
|
|
6260
|
+
});
|
|
6228
6261
|
const raw = {
|
|
6229
6262
|
client: clientInstance,
|
|
6230
6263
|
messages: createBoundService(Messages, clientInstance),
|
|
@@ -6232,8 +6265,7 @@ function createClient(config) {
|
|
|
6232
6265
|
campaigns: createBoundService(Campaigns, clientInstance),
|
|
6233
6266
|
email: createBoundService(Email, clientInstance),
|
|
6234
6267
|
media: createBoundService(Media, clientInstance),
|
|
6235
|
-
templates:
|
|
6236
|
-
templateDocuments: createBoundService(TemplateDocuments, clientInstance),
|
|
6268
|
+
templates: createPromiseTemplatesTransport(clientInstance),
|
|
6237
6269
|
contacts: createBoundService(Contacts, clientInstance),
|
|
6238
6270
|
conversations: createBoundService(Conversations, clientInstance),
|
|
6239
6271
|
design: createBoundService(Design, clientInstance),
|
|
@@ -6252,7 +6284,6 @@ function createClient(config) {
|
|
|
6252
6284
|
email: createDirectService(promiseEmail),
|
|
6253
6285
|
media: createDirectService(raw.media),
|
|
6254
6286
|
templates: createDirectService(raw.templates),
|
|
6255
|
-
templateDocuments: createDirectService(raw.templateDocuments),
|
|
6256
6287
|
contacts: createDirectService(raw.contacts),
|
|
6257
6288
|
conversations: createDirectService(raw.conversations),
|
|
6258
6289
|
design: createDirectService(raw.design),
|
|
@@ -6265,4 +6296,4 @@ function createClient(config) {
|
|
|
6265
6296
|
//#endregion
|
|
6266
6297
|
export { fromApiError as _, ExternalServiceError as a, InternalError as c, ResourceNotFoundError as d, SamvaApiError as f, WebhookEnqueueError as g, ValidationError as h, EmailChannelError as i, PaymentRequiredError as l, UnauthorizedError as m, BillingProviderError as n, FlagDisabledError as o, SamvaTransportError as p, ConflictError as r, ForbiddenError as s, createClient as t, RateLimitedError as u };
|
|
6267
6298
|
|
|
6268
|
-
//# sourceMappingURL=promises-
|
|
6299
|
+
//# sourceMappingURL=promises-n1opem5V.js.map
|