@trycourier/courier 7.21.0 → 7.23.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/CHANGELOG.md +24 -0
- package/client.d.mts +60 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +60 -0
- package/client.d.ts.map +1 -1
- package/client.js +60 -0
- package/client.js.map +1 -1
- package/client.mjs +60 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audiences.d.mts +13 -5
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +13 -5
- package/resources/audiences.d.ts.map +1 -1
- package/resources/audiences.js +13 -5
- package/resources/audiences.js.map +1 -1
- package/resources/audiences.mjs +13 -5
- package/resources/audiences.mjs.map +1 -1
- package/resources/audit-events.d.mts +7 -2
- package/resources/audit-events.d.mts.map +1 -1
- package/resources/audit-events.d.ts +7 -2
- package/resources/audit-events.d.ts.map +1 -1
- package/resources/audit-events.js +7 -2
- package/resources/audit-events.js.map +1 -1
- package/resources/audit-events.mjs +7 -2
- package/resources/audit-events.mjs.map +1 -1
- package/resources/auth.d.mts +5 -1
- package/resources/auth.d.mts.map +1 -1
- package/resources/auth.d.ts +5 -1
- package/resources/auth.d.ts.map +1 -1
- package/resources/auth.js +5 -1
- package/resources/auth.js.map +1 -1
- package/resources/auth.mjs +5 -1
- package/resources/auth.mjs.map +1 -1
- package/resources/automations/automations.d.mts +5 -1
- package/resources/automations/automations.d.mts.map +1 -1
- package/resources/automations/automations.d.ts +5 -1
- package/resources/automations/automations.d.ts.map +1 -1
- package/resources/automations/automations.js +5 -1
- package/resources/automations/automations.js.map +1 -1
- package/resources/automations/automations.mjs +5 -1
- package/resources/automations/automations.mjs.map +1 -1
- package/resources/automations/invoke.d.mts +74 -7
- package/resources/automations/invoke.d.mts.map +1 -1
- package/resources/automations/invoke.d.ts +74 -7
- package/resources/automations/invoke.d.ts.map +1 -1
- package/resources/automations/invoke.js +38 -9
- package/resources/automations/invoke.js.map +1 -1
- package/resources/automations/invoke.mjs +38 -9
- package/resources/automations/invoke.mjs.map +1 -1
- package/resources/brands.d.mts +42 -7
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +42 -7
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.js +28 -8
- package/resources/brands.js.map +1 -1
- package/resources/brands.mjs +28 -8
- package/resources/brands.mjs.map +1 -1
- package/resources/broadcasts.d.mts +381 -0
- package/resources/broadcasts.d.mts.map +1 -0
- package/resources/broadcasts.d.ts +381 -0
- package/resources/broadcasts.d.ts.map +1 -0
- package/resources/broadcasts.js +181 -0
- package/resources/broadcasts.js.map +1 -0
- package/resources/broadcasts.mjs +177 -0
- package/resources/broadcasts.mjs.map +1 -0
- package/resources/digests/schedules.d.mts +5 -3
- package/resources/digests/schedules.d.mts.map +1 -1
- package/resources/digests/schedules.d.ts +5 -3
- package/resources/digests/schedules.d.ts.map +1 -1
- package/resources/digests/schedules.js +5 -3
- package/resources/digests/schedules.js.map +1 -1
- package/resources/digests/schedules.mjs +5 -3
- package/resources/digests/schedules.mjs.map +1 -1
- package/resources/inbound.d.mts +5 -1
- package/resources/inbound.d.mts.map +1 -1
- package/resources/inbound.d.ts +5 -1
- package/resources/inbound.d.ts.map +1 -1
- package/resources/inbound.js +5 -1
- package/resources/inbound.js.map +1 -1
- package/resources/inbound.mjs +5 -1
- package/resources/inbound.mjs.map +1 -1
- package/resources/inbox/inbox.d.mts +10 -0
- package/resources/inbox/inbox.d.mts.map +1 -0
- package/resources/inbox/inbox.d.ts +10 -0
- package/resources/inbox/inbox.d.ts.map +1 -0
- package/resources/inbox/inbox.js +17 -0
- package/resources/inbox/inbox.js.map +1 -0
- package/resources/inbox/inbox.mjs +12 -0
- package/resources/inbox/inbox.mjs.map +1 -0
- package/resources/inbox/index.d.mts +3 -0
- package/resources/inbox/index.d.mts.map +1 -0
- package/resources/inbox/index.d.ts +3 -0
- package/resources/inbox/index.d.ts.map +1 -0
- package/resources/inbox/index.js +9 -0
- package/resources/inbox/index.js.map +1 -0
- package/resources/inbox/index.mjs +4 -0
- package/resources/inbox/index.mjs.map +1 -0
- package/resources/inbox/messages.d.mts +23 -0
- package/resources/inbox/messages.d.mts.map +1 -0
- package/resources/inbox/messages.d.ts +23 -0
- package/resources/inbox/messages.d.ts.map +1 -0
- package/resources/inbox/messages.js +34 -0
- package/resources/inbox/messages.js.map +1 -0
- package/resources/inbox/messages.mjs +30 -0
- package/resources/inbox/messages.mjs.map +1 -0
- package/resources/inbox.d.mts +2 -0
- package/resources/inbox.d.mts.map +1 -0
- package/resources/inbox.d.ts +2 -0
- package/resources/inbox.d.ts.map +1 -0
- package/resources/inbox.js +6 -0
- package/resources/inbox.js.map +1 -0
- package/resources/inbox.mjs +3 -0
- package/resources/inbox.mjs.map +1 -0
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/journeys/journeys.d.mts +130 -39
- package/resources/journeys/journeys.d.mts.map +1 -1
- package/resources/journeys/journeys.d.ts +130 -39
- package/resources/journeys/journeys.d.ts.map +1 -1
- package/resources/journeys/journeys.js +79 -34
- package/resources/journeys/journeys.js.map +1 -1
- package/resources/journeys/journeys.mjs +79 -34
- package/resources/journeys/journeys.mjs.map +1 -1
- package/resources/journeys/templates.d.mts +60 -17
- package/resources/journeys/templates.d.mts.map +1 -1
- package/resources/journeys/templates.d.ts +60 -17
- package/resources/journeys/templates.d.ts.map +1 -1
- package/resources/journeys/templates.js +41 -20
- package/resources/journeys/templates.js.map +1 -1
- package/resources/journeys/templates.mjs +41 -20
- package/resources/journeys/templates.mjs.map +1 -1
- package/resources/lists/lists.d.mts +40 -5
- package/resources/lists/lists.d.mts.map +1 -1
- package/resources/lists/lists.d.ts +40 -5
- package/resources/lists/lists.d.ts.map +1 -1
- package/resources/lists/lists.js +40 -5
- package/resources/lists/lists.js.map +1 -1
- package/resources/lists/lists.mjs +40 -5
- package/resources/lists/lists.mjs.map +1 -1
- package/resources/lists/subscriptions.d.mts +65 -5
- package/resources/lists/subscriptions.d.mts.map +1 -1
- package/resources/lists/subscriptions.d.ts +65 -5
- package/resources/lists/subscriptions.d.ts.map +1 -1
- package/resources/lists/subscriptions.js +57 -6
- package/resources/lists/subscriptions.js.map +1 -1
- package/resources/lists/subscriptions.mjs +57 -6
- package/resources/lists/subscriptions.mjs.map +1 -1
- package/resources/messages.d.mts +15 -14
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +15 -14
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +15 -14
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +15 -14
- package/resources/messages.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +9 -3
- package/resources/notifications/checks.d.mts.map +1 -1
- package/resources/notifications/checks.d.ts +9 -3
- package/resources/notifications/checks.d.ts.map +1 -1
- package/resources/notifications/checks.js +9 -3
- package/resources/notifications/checks.js.map +1 -1
- package/resources/notifications/checks.mjs +9 -3
- package/resources/notifications/checks.mjs.map +1 -1
- package/resources/notifications/notifications.d.mts +62 -29
- package/resources/notifications/notifications.d.mts.map +1 -1
- package/resources/notifications/notifications.d.ts +62 -29
- package/resources/notifications/notifications.d.ts.map +1 -1
- package/resources/notifications/notifications.js +49 -26
- package/resources/notifications/notifications.js.map +1 -1
- package/resources/notifications/notifications.mjs +49 -26
- package/resources/notifications/notifications.mjs.map +1 -1
- package/resources/profiles/lists.d.mts +49 -5
- package/resources/profiles/lists.d.mts.map +1 -1
- package/resources/profiles/lists.d.ts +49 -5
- package/resources/profiles/lists.d.ts.map +1 -1
- package/resources/profiles/lists.js +45 -6
- package/resources/profiles/lists.js.map +1 -1
- package/resources/profiles/lists.mjs +45 -6
- package/resources/profiles/lists.mjs.map +1 -1
- package/resources/profiles/profiles.d.mts +70 -11
- package/resources/profiles/profiles.d.mts.map +1 -1
- package/resources/profiles/profiles.d.ts +70 -11
- package/resources/profiles/profiles.d.ts.map +1 -1
- package/resources/profiles/profiles.js +65 -12
- package/resources/profiles/profiles.js.map +1 -1
- package/resources/profiles/profiles.mjs +65 -12
- package/resources/profiles/profiles.mjs.map +1 -1
- package/resources/providers/catalog.d.mts +10 -4
- package/resources/providers/catalog.d.mts.map +1 -1
- package/resources/providers/catalog.d.ts +10 -4
- package/resources/providers/catalog.d.ts.map +1 -1
- package/resources/providers/catalog.js +10 -4
- package/resources/providers/catalog.js.map +1 -1
- package/resources/providers/catalog.mjs +10 -4
- package/resources/providers/catalog.mjs.map +1 -1
- package/resources/providers/providers.d.mts +68 -22
- package/resources/providers/providers.d.mts.map +1 -1
- package/resources/providers/providers.d.ts +68 -22
- package/resources/providers/providers.d.ts.map +1 -1
- package/resources/providers/providers.js +57 -14
- package/resources/providers/providers.js.map +1 -1
- package/resources/providers/providers.mjs +57 -14
- package/resources/providers/providers.mjs.map +1 -1
- package/resources/requests.d.mts +5 -1
- package/resources/requests.d.mts.map +1 -1
- package/resources/requests.d.ts +5 -1
- package/resources/requests.d.ts.map +1 -1
- package/resources/requests.js +5 -1
- package/resources/requests.js.map +1 -1
- package/resources/requests.mjs +5 -1
- package/resources/requests.mjs.map +1 -1
- package/resources/routing-strategies.d.mts +30 -11
- package/resources/routing-strategies.d.mts.map +1 -1
- package/resources/routing-strategies.d.ts +30 -11
- package/resources/routing-strategies.d.ts.map +1 -1
- package/resources/routing-strategies.js +22 -6
- package/resources/routing-strategies.js.map +1 -1
- package/resources/routing-strategies.mjs +22 -6
- package/resources/routing-strategies.mjs.map +1 -1
- package/resources/send.d.mts +24 -4
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts +24 -4
- package/resources/send.d.ts.map +1 -1
- package/resources/send.js +21 -3
- package/resources/send.js.map +1 -1
- package/resources/send.mjs +21 -3
- package/resources/send.mjs.map +1 -1
- package/resources/tenants/preferences/items.d.mts +7 -2
- package/resources/tenants/preferences/items.d.mts.map +1 -1
- package/resources/tenants/preferences/items.d.ts +7 -2
- package/resources/tenants/preferences/items.d.ts.map +1 -1
- package/resources/tenants/preferences/items.js +7 -2
- package/resources/tenants/preferences/items.js.map +1 -1
- package/resources/tenants/preferences/items.mjs +7 -2
- package/resources/tenants/preferences/items.mjs.map +1 -1
- package/resources/tenants/templates/templates.d.mts +13 -19
- package/resources/tenants/templates/templates.d.mts.map +1 -1
- package/resources/tenants/templates/templates.d.ts +13 -19
- package/resources/tenants/templates/templates.d.ts.map +1 -1
- package/resources/tenants/templates/templates.js +13 -19
- package/resources/tenants/templates/templates.js.map +1 -1
- package/resources/tenants/templates/templates.mjs +13 -19
- package/resources/tenants/templates/templates.mjs.map +1 -1
- package/resources/tenants/templates/versions.d.mts +5 -7
- package/resources/tenants/templates/versions.d.mts.map +1 -1
- package/resources/tenants/templates/versions.d.ts +5 -7
- package/resources/tenants/templates/versions.d.ts.map +1 -1
- package/resources/tenants/templates/versions.js +5 -7
- package/resources/tenants/templates/versions.js.map +1 -1
- package/resources/tenants/templates/versions.mjs +5 -7
- package/resources/tenants/templates/versions.mjs.map +1 -1
- package/resources/tenants/tenants.d.mts +13 -5
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +13 -5
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js +13 -5
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs +13 -5
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/translations.d.mts +7 -2
- package/resources/translations.d.mts.map +1 -1
- package/resources/translations.d.ts +7 -2
- package/resources/translations.d.ts.map +1 -1
- package/resources/translations.js +7 -2
- package/resources/translations.js.map +1 -1
- package/resources/translations.mjs +7 -2
- package/resources/translations.mjs.map +1 -1
- package/resources/users/preferences.d.mts +64 -42
- package/resources/users/preferences.d.mts.map +1 -1
- package/resources/users/preferences.d.ts +64 -42
- package/resources/users/preferences.d.ts.map +1 -1
- package/resources/users/preferences.js +30 -42
- package/resources/users/preferences.js.map +1 -1
- package/resources/users/preferences.mjs +30 -42
- package/resources/users/preferences.mjs.map +1 -1
- package/resources/users/tenants.d.mts +13 -10
- package/resources/users/tenants.d.mts.map +1 -1
- package/resources/users/tenants.d.ts +13 -10
- package/resources/users/tenants.d.ts.map +1 -1
- package/resources/users/tenants.js +13 -10
- package/resources/users/tenants.js.map +1 -1
- package/resources/users/tenants.mjs +13 -10
- package/resources/users/tenants.mjs.map +1 -1
- package/resources/users/tokens.d.mts +15 -6
- package/resources/users/tokens.d.mts.map +1 -1
- package/resources/users/tokens.d.ts +15 -6
- package/resources/users/tokens.d.ts.map +1 -1
- package/resources/users/tokens.js +15 -6
- package/resources/users/tokens.js.map +1 -1
- package/resources/users/tokens.mjs +15 -6
- package/resources/users/tokens.mjs.map +1 -1
- package/resources/workspace-preferences/topics.d.mts +40 -18
- package/resources/workspace-preferences/topics.d.mts.map +1 -1
- package/resources/workspace-preferences/topics.d.ts +40 -18
- package/resources/workspace-preferences/topics.d.ts.map +1 -1
- package/resources/workspace-preferences/topics.js +26 -11
- package/resources/workspace-preferences/topics.js.map +1 -1
- package/resources/workspace-preferences/topics.mjs +26 -11
- package/resources/workspace-preferences/topics.mjs.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.d.mts +56 -19
- package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.d.ts +56 -19
- package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.js +41 -13
- package/resources/workspace-preferences/workspace-preferences.js.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.mjs +41 -13
- package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -1
- package/src/client.ts +96 -0
- package/src/resources/audiences.ts +13 -5
- package/src/resources/audit-events.ts +7 -2
- package/src/resources/auth.ts +5 -1
- package/src/resources/automations/automations.ts +5 -1
- package/src/resources/automations/invoke.ts +115 -9
- package/src/resources/brands.ts +62 -8
- package/src/resources/broadcasts.ts +489 -0
- package/src/resources/digests/schedules.ts +5 -3
- package/src/resources/inbound.ts +5 -1
- package/src/resources/inbox/inbox.ts +15 -0
- package/src/resources/inbox/index.ts +4 -0
- package/src/resources/inbox/messages.ts +40 -0
- package/src/resources/inbox.ts +3 -0
- package/src/resources/index.ts +18 -0
- package/src/resources/journeys/journeys.ts +212 -43
- package/src/resources/journeys/templates.ts +98 -20
- package/src/resources/lists/lists.ts +40 -5
- package/src/resources/lists/subscriptions.ts +82 -6
- package/src/resources/messages.ts +15 -14
- package/src/resources/notifications/checks.ts +9 -3
- package/src/resources/notifications/notifications.ts +102 -31
- package/src/resources/profiles/lists.ts +70 -6
- package/src/resources/profiles/profiles.ts +90 -12
- package/src/resources/providers/catalog.ts +10 -4
- package/src/resources/providers/providers.ts +86 -21
- package/src/resources/requests.ts +5 -1
- package/src/resources/routing-strategies.ts +50 -12
- package/src/resources/send.ts +45 -5
- package/src/resources/tenants/preferences/items.ts +7 -2
- package/src/resources/tenants/templates/templates.ts +13 -19
- package/src/resources/tenants/templates/versions.ts +5 -7
- package/src/resources/tenants/tenants.ts +13 -5
- package/src/resources/translations.ts +7 -2
- package/src/resources/users/preferences.ts +86 -44
- package/src/resources/users/tenants.ts +13 -10
- package/src/resources/users/tokens.ts +15 -6
- package/src/resources/workspace-preferences/topics.ts +60 -19
- package/src/resources/workspace-preferences/workspace-preferences.ts +96 -21
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -5,6 +5,9 @@ exports.Templates = void 0;
|
|
|
5
5
|
const resource_1 = require("../../core/resource.js");
|
|
6
6
|
const headers_1 = require("../../internal/headers.js");
|
|
7
7
|
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Build, version, publish, invoke, and cancel multi-step notification workflows, along with the templates scoped to them.
|
|
10
|
+
*/
|
|
8
11
|
class Templates extends resource_1.APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* Create a notification template scoped to this journey. Defaults to `DRAFT`
|
|
@@ -28,13 +31,25 @@ class Templates extends resource_1.APIResource {
|
|
|
28
31
|
* });
|
|
29
32
|
* ```
|
|
30
33
|
*/
|
|
31
|
-
create(templateID,
|
|
32
|
-
|
|
34
|
+
create(templateID, params, options) {
|
|
35
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-idempotency-expiration': xIdempotencyExpiration, ...body } = params;
|
|
36
|
+
return this._client.post((0, path_1.path) `/journeys/${templateID}/templates`, {
|
|
37
|
+
body,
|
|
38
|
+
...options,
|
|
39
|
+
headers: (0, headers_1.buildHeaders)([
|
|
40
|
+
{
|
|
41
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
42
|
+
...(xIdempotencyExpiration != null ?
|
|
43
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
44
|
+
: undefined),
|
|
45
|
+
},
|
|
46
|
+
options?.headers,
|
|
47
|
+
]),
|
|
48
|
+
});
|
|
33
49
|
}
|
|
34
50
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* historical version.
|
|
51
|
+
* Returns a journey's own notification template with its name, brand, subscription
|
|
52
|
+
* topic, and content. Defaults to the published version.
|
|
38
53
|
*
|
|
39
54
|
* @example
|
|
40
55
|
* ```ts
|
|
@@ -62,8 +77,8 @@ class Templates extends resource_1.APIResource {
|
|
|
62
77
|
return this._client.get((0, path_1.path) `/journeys/${templateID}/templates`, { query, ...options });
|
|
63
78
|
}
|
|
64
79
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
80
|
+
* Archives one journey's notification template, preventing further sends. Detach
|
|
81
|
+
* any send node referencing it beforehand.
|
|
67
82
|
*
|
|
68
83
|
* @example
|
|
69
84
|
* ```ts
|
|
@@ -80,8 +95,8 @@ class Templates extends resource_1.APIResource {
|
|
|
80
95
|
});
|
|
81
96
|
}
|
|
82
97
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
98
|
+
* Lists the published versions of a template that belongs to a journey, most
|
|
99
|
+
* recent first. Paged by cursor.
|
|
85
100
|
*
|
|
86
101
|
* @example
|
|
87
102
|
* ```ts
|
|
@@ -96,9 +111,8 @@ class Templates extends resource_1.APIResource {
|
|
|
96
111
|
return this._client.get((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}/versions`, options);
|
|
97
112
|
}
|
|
98
113
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* `{ "version": "vN" }`.
|
|
114
|
+
* Publishes a journey-scoped template's draft as a new version. Pass a version
|
|
115
|
+
* instead to roll back the template to an earlier publish.
|
|
102
116
|
*
|
|
103
117
|
* @example
|
|
104
118
|
* ```ts
|
|
@@ -108,11 +122,20 @@ class Templates extends resource_1.APIResource {
|
|
|
108
122
|
* ```
|
|
109
123
|
*/
|
|
110
124
|
publish(notificationID, params, options) {
|
|
111
|
-
const { templateId, ...body } = params;
|
|
125
|
+
const { templateId, 'Idempotency-Key': idempotencyKey, 'x-idempotency-expiration': xIdempotencyExpiration, ...body } = params;
|
|
112
126
|
return this._client.post((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}/publish`, {
|
|
113
127
|
body,
|
|
114
128
|
...options,
|
|
115
|
-
headers: (0, headers_1.buildHeaders)([
|
|
129
|
+
headers: (0, headers_1.buildHeaders)([
|
|
130
|
+
{
|
|
131
|
+
Accept: '*/*',
|
|
132
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
133
|
+
...(xIdempotencyExpiration != null ?
|
|
134
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
135
|
+
: undefined),
|
|
136
|
+
},
|
|
137
|
+
options?.headers,
|
|
138
|
+
]),
|
|
116
139
|
});
|
|
117
140
|
}
|
|
118
141
|
/**
|
|
@@ -165,7 +188,8 @@ class Templates extends resource_1.APIResource {
|
|
|
165
188
|
});
|
|
166
189
|
}
|
|
167
190
|
/**
|
|
168
|
-
*
|
|
191
|
+
* Replaces the draft content of one journey's notification template. Publish it
|
|
192
|
+
* before send nodes referencing it render the change.
|
|
169
193
|
*
|
|
170
194
|
* @example
|
|
171
195
|
* ```ts
|
|
@@ -187,11 +211,8 @@ class Templates extends resource_1.APIResource {
|
|
|
187
211
|
return this._client.put((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}`, { body, ...options });
|
|
188
212
|
}
|
|
189
213
|
/**
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* which can be used to detect changes between versions. Pass `?version=draft`
|
|
193
|
-
* (default `published`) to retrieve the working draft, or `?version=vN` for a
|
|
194
|
-
* historical version.
|
|
214
|
+
* Returns the Elemental elements and version of a journey-scoped template's
|
|
215
|
+
* content. Compare versions to see what changed between publishes.
|
|
195
216
|
*
|
|
196
217
|
* @example
|
|
197
218
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/resources/journeys/templates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CACJ,UAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/resources/journeys/templates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,uDAAsD;AAEtD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CACJ,UAAkB,EAClB,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EACJ,iBAAiB,EAAE,cAAc,EACjC,0BAA0B,EAAE,sBAAsB,EAClD,GAAG,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mjs";
|
|
4
4
|
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Build, version, publish, invoke, and cancel multi-step notification workflows, along with the templates scoped to them.
|
|
7
|
+
*/
|
|
5
8
|
export class Templates extends APIResource {
|
|
6
9
|
/**
|
|
7
10
|
* Create a notification template scoped to this journey. Defaults to `DRAFT`
|
|
@@ -25,13 +28,25 @@ export class Templates extends APIResource {
|
|
|
25
28
|
* });
|
|
26
29
|
* ```
|
|
27
30
|
*/
|
|
28
|
-
create(templateID,
|
|
29
|
-
|
|
31
|
+
create(templateID, params, options) {
|
|
32
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-idempotency-expiration': xIdempotencyExpiration, ...body } = params;
|
|
33
|
+
return this._client.post(path `/journeys/${templateID}/templates`, {
|
|
34
|
+
body,
|
|
35
|
+
...options,
|
|
36
|
+
headers: buildHeaders([
|
|
37
|
+
{
|
|
38
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
39
|
+
...(xIdempotencyExpiration != null ?
|
|
40
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
41
|
+
: undefined),
|
|
42
|
+
},
|
|
43
|
+
options?.headers,
|
|
44
|
+
]),
|
|
45
|
+
});
|
|
30
46
|
}
|
|
31
47
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* historical version.
|
|
48
|
+
* Returns a journey's own notification template with its name, brand, subscription
|
|
49
|
+
* topic, and content. Defaults to the published version.
|
|
35
50
|
*
|
|
36
51
|
* @example
|
|
37
52
|
* ```ts
|
|
@@ -59,8 +74,8 @@ export class Templates extends APIResource {
|
|
|
59
74
|
return this._client.get(path `/journeys/${templateID}/templates`, { query, ...options });
|
|
60
75
|
}
|
|
61
76
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
77
|
+
* Archives one journey's notification template, preventing further sends. Detach
|
|
78
|
+
* any send node referencing it beforehand.
|
|
64
79
|
*
|
|
65
80
|
* @example
|
|
66
81
|
* ```ts
|
|
@@ -77,8 +92,8 @@ export class Templates extends APIResource {
|
|
|
77
92
|
});
|
|
78
93
|
}
|
|
79
94
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
95
|
+
* Lists the published versions of a template that belongs to a journey, most
|
|
96
|
+
* recent first. Paged by cursor.
|
|
82
97
|
*
|
|
83
98
|
* @example
|
|
84
99
|
* ```ts
|
|
@@ -93,9 +108,8 @@ export class Templates extends APIResource {
|
|
|
93
108
|
return this._client.get(path `/journeys/${templateId}/templates/${notificationID}/versions`, options);
|
|
94
109
|
}
|
|
95
110
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* `{ "version": "vN" }`.
|
|
111
|
+
* Publishes a journey-scoped template's draft as a new version. Pass a version
|
|
112
|
+
* instead to roll back the template to an earlier publish.
|
|
99
113
|
*
|
|
100
114
|
* @example
|
|
101
115
|
* ```ts
|
|
@@ -105,11 +119,20 @@ export class Templates extends APIResource {
|
|
|
105
119
|
* ```
|
|
106
120
|
*/
|
|
107
121
|
publish(notificationID, params, options) {
|
|
108
|
-
const { templateId, ...body } = params;
|
|
122
|
+
const { templateId, 'Idempotency-Key': idempotencyKey, 'x-idempotency-expiration': xIdempotencyExpiration, ...body } = params;
|
|
109
123
|
return this._client.post(path `/journeys/${templateId}/templates/${notificationID}/publish`, {
|
|
110
124
|
body,
|
|
111
125
|
...options,
|
|
112
|
-
headers: buildHeaders([
|
|
126
|
+
headers: buildHeaders([
|
|
127
|
+
{
|
|
128
|
+
Accept: '*/*',
|
|
129
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
130
|
+
...(xIdempotencyExpiration != null ?
|
|
131
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
132
|
+
: undefined),
|
|
133
|
+
},
|
|
134
|
+
options?.headers,
|
|
135
|
+
]),
|
|
113
136
|
});
|
|
114
137
|
}
|
|
115
138
|
/**
|
|
@@ -162,7 +185,8 @@ export class Templates extends APIResource {
|
|
|
162
185
|
});
|
|
163
186
|
}
|
|
164
187
|
/**
|
|
165
|
-
*
|
|
188
|
+
* Replaces the draft content of one journey's notification template. Publish it
|
|
189
|
+
* before send nodes referencing it render the change.
|
|
166
190
|
*
|
|
167
191
|
* @example
|
|
168
192
|
* ```ts
|
|
@@ -184,11 +208,8 @@ export class Templates extends APIResource {
|
|
|
184
208
|
return this._client.put(path `/journeys/${templateId}/templates/${notificationID}`, { body, ...options });
|
|
185
209
|
}
|
|
186
210
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
* which can be used to detect changes between versions. Pass `?version=draft`
|
|
190
|
-
* (default `published`) to retrieve the working draft, or `?version=vN` for a
|
|
191
|
-
* historical version.
|
|
211
|
+
* Returns the Elemental elements and version of a journey-scoped template's
|
|
212
|
+
* content. Compare versions to see what changed between publishes.
|
|
192
213
|
*
|
|
193
214
|
* @example
|
|
194
215
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.mjs","sourceRoot":"","sources":["../../src/resources/journeys/templates.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAKlD,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CACJ,UAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"templates.mjs","sourceRoot":"","sources":["../../src/resources/journeys/templates.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAKlD,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;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scriptions.mjs";
|
|
|
4
4
|
import { SubscriptionAddParams, SubscriptionListParams, SubscriptionListResponse, SubscriptionSubscribeParams, SubscriptionSubscribeUserParams, SubscriptionUnsubscribeUserParams, Subscriptions } from "./subscriptions.mjs";
|
|
5
5
|
import { APIPromise } from "../../core/api-promise.mjs";
|
|
6
6
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Manage static groups of users that you subscribe explicitly, and send to them by list id or list pattern.
|
|
9
|
+
*/
|
|
7
10
|
export declare class Lists extends APIResource {
|
|
8
11
|
subscriptions: SubscriptionsAPI.Subscriptions;
|
|
9
12
|
/**
|
|
10
|
-
* Returns
|
|
13
|
+
* Returns one list by id with its name and created and updated timestamps. Fetch
|
|
14
|
+
* its subscribers separately with the subscriptions endpoint.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const subscriptionList = await client.lists.retrieve(
|
|
19
|
+
* 'list_id',
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
11
22
|
*/
|
|
12
23
|
retrieve(listID: string, options?: RequestOptions): APIPromise<SubscriptionList>;
|
|
13
24
|
/**
|
|
14
|
-
*
|
|
25
|
+
* Creates or replaces a list from a name and preferences. Subscribers are managed
|
|
26
|
+
* through the separate subscriptions endpoints.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* await client.lists.update('list_id', { name: 'name' });
|
|
31
|
+
* ```
|
|
15
32
|
*/
|
|
16
33
|
update(listID: string, body: ListUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
17
34
|
/**
|
|
18
|
-
* Returns
|
|
35
|
+
* Returns the workspace's lists, filterable by a pattern to fetch a subset such as
|
|
36
|
+
* every regional list. Paged by cursor.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const lists = await client.lists.list();
|
|
41
|
+
* ```
|
|
19
42
|
*/
|
|
20
43
|
list(query?: ListListParams | null | undefined, options?: RequestOptions): APIPromise<ListListResponse>;
|
|
21
44
|
/**
|
|
22
|
-
*
|
|
45
|
+
* Deletes a list, halting sends that target it. A previously deleted list can be
|
|
46
|
+
* brought back with the companion restore endpoint.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* await client.lists.delete('list_id');
|
|
51
|
+
* ```
|
|
23
52
|
*/
|
|
24
53
|
delete(listID: string, options?: RequestOptions): APIPromise<void>;
|
|
25
54
|
/**
|
|
26
|
-
*
|
|
55
|
+
* Restores a previously deleted list along with its subscribers, so a list removed
|
|
56
|
+
* by mistake can be brought back rather than rebuilt.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* await client.lists.restore('list_id');
|
|
61
|
+
* ```
|
|
27
62
|
*/
|
|
28
63
|
restore(listID: string, body: ListRestoreParams, options?: RequestOptions): APIPromise<void>;
|
|
29
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lists.d.mts","sourceRoot":"","sources":["../../src/resources/lists/lists.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,KAAK,gBAAgB,4BAAwB;AACpD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,EACjC,aAAa,EACd,4BAAwB;AACzB,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE,qBAAa,KAAM,SAAQ,WAAW;IACpC,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;IAEjG
|
|
1
|
+
{"version":3,"file":"lists.d.mts","sourceRoot":"","sources":["../../src/resources/lists/lists.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCA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IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAE/B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IAEb,WAAW,CAAC,EAAE,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;CAAG;AAIrC,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
|
@@ -4,26 +4,61 @@ import * as SubscriptionsAPI from "./subscriptions.js";
|
|
|
4
4
|
import { SubscriptionAddParams, SubscriptionListParams, SubscriptionListResponse, SubscriptionSubscribeParams, SubscriptionSubscribeUserParams, SubscriptionUnsubscribeUserParams, Subscriptions } from "./subscriptions.js";
|
|
5
5
|
import { APIPromise } from "../../core/api-promise.js";
|
|
6
6
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
/**
|
|
8
|
+
* Manage static groups of users that you subscribe explicitly, and send to them by list id or list pattern.
|
|
9
|
+
*/
|
|
7
10
|
export declare class Lists extends APIResource {
|
|
8
11
|
subscriptions: SubscriptionsAPI.Subscriptions;
|
|
9
12
|
/**
|
|
10
|
-
* Returns
|
|
13
|
+
* Returns one list by id with its name and created and updated timestamps. Fetch
|
|
14
|
+
* its subscribers separately with the subscriptions endpoint.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const subscriptionList = await client.lists.retrieve(
|
|
19
|
+
* 'list_id',
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
11
22
|
*/
|
|
12
23
|
retrieve(listID: string, options?: RequestOptions): APIPromise<SubscriptionList>;
|
|
13
24
|
/**
|
|
14
|
-
*
|
|
25
|
+
* Creates or replaces a list from a name and preferences. Subscribers are managed
|
|
26
|
+
* through the separate subscriptions endpoints.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* await client.lists.update('list_id', { name: 'name' });
|
|
31
|
+
* ```
|
|
15
32
|
*/
|
|
16
33
|
update(listID: string, body: ListUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
17
34
|
/**
|
|
18
|
-
* Returns
|
|
35
|
+
* Returns the workspace's lists, filterable by a pattern to fetch a subset such as
|
|
36
|
+
* every regional list. Paged by cursor.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const lists = await client.lists.list();
|
|
41
|
+
* ```
|
|
19
42
|
*/
|
|
20
43
|
list(query?: ListListParams | null | undefined, options?: RequestOptions): APIPromise<ListListResponse>;
|
|
21
44
|
/**
|
|
22
|
-
*
|
|
45
|
+
* Deletes a list, halting sends that target it. A previously deleted list can be
|
|
46
|
+
* brought back with the companion restore endpoint.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* await client.lists.delete('list_id');
|
|
51
|
+
* ```
|
|
23
52
|
*/
|
|
24
53
|
delete(listID: string, options?: RequestOptions): APIPromise<void>;
|
|
25
54
|
/**
|
|
26
|
-
*
|
|
55
|
+
* Restores a previously deleted list along with its subscribers, so a list removed
|
|
56
|
+
* by mistake can be brought back rather than rebuilt.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* await client.lists.restore('list_id');
|
|
61
|
+
* ```
|
|
27
62
|
*/
|
|
28
63
|
restore(listID: string, body: ListRestoreParams, options?: RequestOptions): APIPromise<void>;
|
|
29
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../src/resources/lists/lists.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,gBAAgB,2BAAwB;AACpD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,EACjC,aAAa,EACd,2BAAwB;AACzB,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,KAAM,SAAQ,WAAW;IACpC,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;IAEjG
|
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../src/resources/lists/lists.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,gBAAgB,2BAAwB;AACpD,OAAO,EACL,qB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AAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAE/B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IAEb,WAAW,CAAC,EAAE,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;CAAG;AAIrC,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
package/resources/lists/lists.js
CHANGED
|
@@ -8,19 +8,36 @@ const SubscriptionsAPI = tslib_1.__importStar(require("./subscriptions.js"));
|
|
|
8
8
|
const subscriptions_1 = require("./subscriptions.js");
|
|
9
9
|
const headers_1 = require("../../internal/headers.js");
|
|
10
10
|
const path_1 = require("../../internal/utils/path.js");
|
|
11
|
+
/**
|
|
12
|
+
* Manage static groups of users that you subscribe explicitly, and send to them by list id or list pattern.
|
|
13
|
+
*/
|
|
11
14
|
class Lists extends resource_1.APIResource {
|
|
12
15
|
constructor() {
|
|
13
16
|
super(...arguments);
|
|
14
17
|
this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
|
-
* Returns
|
|
20
|
+
* Returns one list by id with its name and created and updated timestamps. Fetch
|
|
21
|
+
* its subscribers separately with the subscriptions endpoint.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const subscriptionList = await client.lists.retrieve(
|
|
26
|
+
* 'list_id',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
18
29
|
*/
|
|
19
30
|
retrieve(listID, options) {
|
|
20
31
|
return this._client.get((0, path_1.path) `/lists/${listID}`, options);
|
|
21
32
|
}
|
|
22
33
|
/**
|
|
23
|
-
*
|
|
34
|
+
* Creates or replaces a list from a name and preferences. Subscribers are managed
|
|
35
|
+
* through the separate subscriptions endpoints.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* await client.lists.update('list_id', { name: 'name' });
|
|
40
|
+
* ```
|
|
24
41
|
*/
|
|
25
42
|
update(listID, body, options) {
|
|
26
43
|
return this._client.put((0, path_1.path) `/lists/${listID}`, {
|
|
@@ -30,13 +47,25 @@ class Lists extends resource_1.APIResource {
|
|
|
30
47
|
});
|
|
31
48
|
}
|
|
32
49
|
/**
|
|
33
|
-
* Returns
|
|
50
|
+
* Returns the workspace's lists, filterable by a pattern to fetch a subset such as
|
|
51
|
+
* every regional list. Paged by cursor.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const lists = await client.lists.list();
|
|
56
|
+
* ```
|
|
34
57
|
*/
|
|
35
58
|
list(query = {}, options) {
|
|
36
59
|
return this._client.get('/lists', { query, ...options });
|
|
37
60
|
}
|
|
38
61
|
/**
|
|
39
|
-
*
|
|
62
|
+
* Deletes a list, halting sends that target it. A previously deleted list can be
|
|
63
|
+
* brought back with the companion restore endpoint.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* await client.lists.delete('list_id');
|
|
68
|
+
* ```
|
|
40
69
|
*/
|
|
41
70
|
delete(listID, options) {
|
|
42
71
|
return this._client.delete((0, path_1.path) `/lists/${listID}`, {
|
|
@@ -45,7 +74,13 @@ class Lists extends resource_1.APIResource {
|
|
|
45
74
|
});
|
|
46
75
|
}
|
|
47
76
|
/**
|
|
48
|
-
*
|
|
77
|
+
* Restores a previously deleted list along with its subscribers, so a list removed
|
|
78
|
+
* by mistake can be brought back rather than rebuilt.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* await client.lists.restore('list_id');
|
|
83
|
+
* ```
|
|
49
84
|
*/
|
|
50
85
|
restore(listID, body, options) {
|
|
51
86
|
return this._client.put((0, path_1.path) `/lists/${listID}/restore`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/resources/lists/lists.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,6EAAoD;AACpD,sDAQyB;AAEzB,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/resources/lists/lists.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,6EAAoD;AACpD,sDAQyB;AAEzB,uDAAsD;AAEtD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,kBAAa,G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AAU,EAAE;YACtD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAnFD,sBAmFC;AA+CD,KAAK,CAAC,aAAa,GAAG,6BAAa,CAAC"}
|
|
@@ -4,19 +4,36 @@ import * as SubscriptionsAPI from "./subscriptions.mjs";
|
|
|
4
4
|
import { Subscriptions, } from "./subscriptions.mjs";
|
|
5
5
|
import { buildHeaders } from "../../internal/headers.mjs";
|
|
6
6
|
import { path } from "../../internal/utils/path.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Manage static groups of users that you subscribe explicitly, and send to them by list id or list pattern.
|
|
9
|
+
*/
|
|
7
10
|
export class Lists extends APIResource {
|
|
8
11
|
constructor() {
|
|
9
12
|
super(...arguments);
|
|
10
13
|
this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
|
-
* Returns
|
|
16
|
+
* Returns one list by id with its name and created and updated timestamps. Fetch
|
|
17
|
+
* its subscribers separately with the subscriptions endpoint.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const subscriptionList = await client.lists.retrieve(
|
|
22
|
+
* 'list_id',
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
14
25
|
*/
|
|
15
26
|
retrieve(listID, options) {
|
|
16
27
|
return this._client.get(path `/lists/${listID}`, options);
|
|
17
28
|
}
|
|
18
29
|
/**
|
|
19
|
-
*
|
|
30
|
+
* Creates or replaces a list from a name and preferences. Subscribers are managed
|
|
31
|
+
* through the separate subscriptions endpoints.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* await client.lists.update('list_id', { name: 'name' });
|
|
36
|
+
* ```
|
|
20
37
|
*/
|
|
21
38
|
update(listID, body, options) {
|
|
22
39
|
return this._client.put(path `/lists/${listID}`, {
|
|
@@ -26,13 +43,25 @@ export class Lists extends APIResource {
|
|
|
26
43
|
});
|
|
27
44
|
}
|
|
28
45
|
/**
|
|
29
|
-
* Returns
|
|
46
|
+
* Returns the workspace's lists, filterable by a pattern to fetch a subset such as
|
|
47
|
+
* every regional list. Paged by cursor.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const lists = await client.lists.list();
|
|
52
|
+
* ```
|
|
30
53
|
*/
|
|
31
54
|
list(query = {}, options) {
|
|
32
55
|
return this._client.get('/lists', { query, ...options });
|
|
33
56
|
}
|
|
34
57
|
/**
|
|
35
|
-
*
|
|
58
|
+
* Deletes a list, halting sends that target it. A previously deleted list can be
|
|
59
|
+
* brought back with the companion restore endpoint.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* await client.lists.delete('list_id');
|
|
64
|
+
* ```
|
|
36
65
|
*/
|
|
37
66
|
delete(listID, options) {
|
|
38
67
|
return this._client.delete(path `/lists/${listID}`, {
|
|
@@ -41,7 +70,13 @@ export class Lists extends APIResource {
|
|
|
41
70
|
});
|
|
42
71
|
}
|
|
43
72
|
/**
|
|
44
|
-
*
|
|
73
|
+
* Restores a previously deleted list along with its subscribers, so a list removed
|
|
74
|
+
* by mistake can be brought back rather than rebuilt.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* await client.lists.restore('list_id');
|
|
79
|
+
* ```
|
|
45
80
|
*/
|
|
46
81
|
restore(listID, body, options) {
|
|
47
82
|
return this._client.put(path `/lists/${listID}/restore`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lists.mjs","sourceRoot":"","sources":["../../src/resources/lists/lists.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,K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