@trycourier/courier 7.20.0 → 7.22.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 +57 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +57 -3
- package/client.d.ts.map +1 -1
- package/client.js +57 -3
- package/client.js.map +1 -1
- package/client.mjs +57 -3
- 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/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 +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- 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 +59 -25
- 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/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 +1 -11
- 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
- package/resources/bulk.d.mts +0 -155
- package/resources/bulk.d.mts.map +0 -1
- package/resources/bulk.d.ts +0 -155
- package/resources/bulk.d.ts.map +0 -1
- package/resources/bulk.js +0 -58
- package/resources/bulk.js.map +0 -1
- package/resources/bulk.mjs +0 -54
- package/resources/bulk.mjs.map +0 -1
- package/src/resources/bulk.ts +0 -210
|
@@ -16,30 +16,77 @@ import { buildHeaders } from '../../internal/headers';
|
|
|
16
16
|
import { RequestOptions } from '../../internal/request-options';
|
|
17
17
|
import { path } from '../../internal/utils/path';
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Store the contact information Courier delivers to for each user — email, phone number, push tokens, and any custom data you send to.
|
|
21
|
+
*/
|
|
19
22
|
export class Profiles extends APIResource {
|
|
20
23
|
lists: ListsAPI.Lists = new ListsAPI.Lists(this._client);
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
26
|
+
* Merges the supplied values into a user's profile, creating it if absent and
|
|
27
|
+
* leaving any key you omit untouched. Prefer this for everyday writes.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const profile = await client.profiles.create('user_id', {
|
|
32
|
+
* profile: { foo: 'bar' },
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
25
35
|
*/
|
|
26
36
|
create(
|
|
27
37
|
userID: string,
|
|
28
|
-
|
|
38
|
+
params: ProfileCreateParams,
|
|
29
39
|
options?: RequestOptions,
|
|
30
40
|
): APIPromise<ProfileCreateResponse> {
|
|
31
|
-
|
|
41
|
+
const {
|
|
42
|
+
'Idempotency-Key': idempotencyKey,
|
|
43
|
+
'x-idempotency-expiration': xIdempotencyExpiration,
|
|
44
|
+
...body
|
|
45
|
+
} = params;
|
|
46
|
+
return this._client.post(path`/profiles/${userID}`, {
|
|
47
|
+
body,
|
|
48
|
+
...options,
|
|
49
|
+
headers: buildHeaders([
|
|
50
|
+
{
|
|
51
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
52
|
+
...(xIdempotencyExpiration != null ?
|
|
53
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
54
|
+
: undefined),
|
|
55
|
+
},
|
|
56
|
+
options?.headers,
|
|
57
|
+
]),
|
|
58
|
+
});
|
|
32
59
|
}
|
|
33
60
|
|
|
34
61
|
/**
|
|
35
|
-
* Returns
|
|
62
|
+
* Returns a user's stored profile and preferences, including the email address,
|
|
63
|
+
* phone number, and push tokens Courier can reach them on.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const profile = await client.profiles.retrieve('user_id');
|
|
68
|
+
* ```
|
|
36
69
|
*/
|
|
37
70
|
retrieve(userID: string, options?: RequestOptions): APIPromise<ProfileRetrieveResponse> {
|
|
38
71
|
return this._client.get(path`/profiles/${userID}`, options);
|
|
39
72
|
}
|
|
40
73
|
|
|
41
74
|
/**
|
|
42
|
-
*
|
|
75
|
+
* Applies a JSON Patch to a user profile, adding, removing, or replacing
|
|
76
|
+
* individual fields without sending the whole object.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* await client.profiles.update('user_id', {
|
|
81
|
+
* patch: [
|
|
82
|
+
* {
|
|
83
|
+
* op: 'op',
|
|
84
|
+
* path: 'path',
|
|
85
|
+
* value: 'value',
|
|
86
|
+
* },
|
|
87
|
+
* ],
|
|
88
|
+
* });
|
|
89
|
+
* ```
|
|
43
90
|
*/
|
|
44
91
|
update(userID: string, body: ProfileUpdateParams, options?: RequestOptions): APIPromise<void> {
|
|
45
92
|
return this._client.patch(path`/profiles/${userID}`, {
|
|
@@ -50,7 +97,13 @@ export class Profiles extends APIResource {
|
|
|
50
97
|
}
|
|
51
98
|
|
|
52
99
|
/**
|
|
53
|
-
* Deletes
|
|
100
|
+
* Deletes a user's profile and stored contact details. List subscriptions and
|
|
101
|
+
* preferences are separate resources, so remove those too if required.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* await client.profiles.delete('user_id');
|
|
106
|
+
* ```
|
|
54
107
|
*/
|
|
55
108
|
delete(userID: string, options?: RequestOptions): APIPromise<void> {
|
|
56
109
|
return this._client.delete(path`/profiles/${userID}`, {
|
|
@@ -60,11 +113,15 @@ export class Profiles extends APIResource {
|
|
|
60
113
|
}
|
|
61
114
|
|
|
62
115
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
116
|
+
* Overwrites a user profile in full, removing any key absent from the request
|
|
117
|
+
* body. Use the patch endpoint when changing a single field.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const response = await client.profiles.replace('user_id', {
|
|
122
|
+
* profile: { foo: 'bar' },
|
|
123
|
+
* });
|
|
124
|
+
* ```
|
|
68
125
|
*/
|
|
69
126
|
replace(
|
|
70
127
|
userID: string,
|
|
@@ -96,7 +153,28 @@ export interface ProfileReplaceResponse {
|
|
|
96
153
|
}
|
|
97
154
|
|
|
98
155
|
export interface ProfileCreateParams {
|
|
156
|
+
/**
|
|
157
|
+
* Body param
|
|
158
|
+
*/
|
|
99
159
|
profile: { [key: string]: unknown };
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
163
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
164
|
+
* response from the first request without performing the operation again
|
|
165
|
+
* (including the original status code and any error). Use it to safely retry
|
|
166
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
167
|
+
* is scoped to this endpoint.
|
|
168
|
+
*/
|
|
169
|
+
'Idempotency-Key'?: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
173
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
174
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
175
|
+
* maximum is 1 year.
|
|
176
|
+
*/
|
|
177
|
+
'x-idempotency-expiration'?: string;
|
|
100
178
|
}
|
|
101
179
|
|
|
102
180
|
export interface ProfileUpdateParams {
|
|
@@ -6,12 +6,18 @@ import * as ProvidersAPI from './providers';
|
|
|
6
6
|
import { APIPromise } from '../../core/api-promise';
|
|
7
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Configure the channel providers Courier delivers through, and browse the provider types it supports.
|
|
11
|
+
*/
|
|
9
12
|
export class Catalog extends APIResource {
|
|
10
13
|
/**
|
|
11
|
-
* Returns the
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* Returns the provider types Courier supports, each with a display name,
|
|
15
|
+
* description, and the configuration fields it requires.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const catalogs = await client.providers.catalog.list();
|
|
20
|
+
* ```
|
|
15
21
|
*/
|
|
16
22
|
list(
|
|
17
23
|
query: CatalogListParams | null | undefined = {},
|
|
@@ -9,38 +9,80 @@ import { buildHeaders } from '../../internal/headers';
|
|
|
9
9
|
import { RequestOptions } from '../../internal/request-options';
|
|
10
10
|
import { path } from '../../internal/utils/path';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Configure the channel providers Courier delivers through, and browse the provider types it supports.
|
|
14
|
+
*/
|
|
12
15
|
export class Providers extends APIResource {
|
|
13
16
|
catalog: CatalogAPI.Catalog = new CatalogAPI.Catalog(this._client);
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
19
|
+
* Configures a provider integration from a Courier provider key and its settings.
|
|
20
|
+
* Check the catalog endpoint for the schema each provider expects.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const provider = await client.providers.create({
|
|
25
|
+
* provider: 'provider',
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
18
28
|
*/
|
|
19
|
-
create(
|
|
20
|
-
|
|
29
|
+
create(params: ProviderCreateParams, options?: RequestOptions): APIPromise<Provider> {
|
|
30
|
+
const {
|
|
31
|
+
'Idempotency-Key': idempotencyKey,
|
|
32
|
+
'x-idempotency-expiration': xIdempotencyExpiration,
|
|
33
|
+
...body
|
|
34
|
+
} = params;
|
|
35
|
+
return this._client.post('/providers', {
|
|
36
|
+
body,
|
|
37
|
+
...options,
|
|
38
|
+
headers: buildHeaders([
|
|
39
|
+
{
|
|
40
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
41
|
+
...(xIdempotencyExpiration != null ?
|
|
42
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
43
|
+
: undefined),
|
|
44
|
+
},
|
|
45
|
+
options?.headers,
|
|
46
|
+
]),
|
|
47
|
+
});
|
|
21
48
|
}
|
|
22
49
|
|
|
23
50
|
/**
|
|
24
|
-
*
|
|
51
|
+
* Returns one configured provider by id, including its channel, provider key,
|
|
52
|
+
* alias, title, and current settings.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const provider = await client.providers.retrieve('id');
|
|
57
|
+
* ```
|
|
25
58
|
*/
|
|
26
59
|
retrieve(id: string, options?: RequestOptions): APIPromise<Provider> {
|
|
27
60
|
return this._client.get(path`/providers/${id}`, options);
|
|
28
61
|
}
|
|
29
62
|
|
|
30
63
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
64
|
+
* Replaces a provider's configuration in full, clearing any field you omit rather
|
|
65
|
+
* than merging it. Send the complete settings object.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const provider = await client.providers.update('id', {
|
|
70
|
+
* provider: 'provider',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
36
73
|
*/
|
|
37
74
|
update(id: string, body: ProviderUpdateParams, options?: RequestOptions): APIPromise<Provider> {
|
|
38
75
|
return this._client.put(path`/providers/${id}`, { body, ...options });
|
|
39
76
|
}
|
|
40
77
|
|
|
41
78
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
79
|
+
* Lists the provider integrations configured in the workspace, one entry per
|
|
80
|
+
* channel and provider key with its alias and settings.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const providers = await client.providers.list();
|
|
85
|
+
* ```
|
|
44
86
|
*/
|
|
45
87
|
list(
|
|
46
88
|
query: ProviderListParams | null | undefined = {},
|
|
@@ -50,8 +92,13 @@ export class Providers extends APIResource {
|
|
|
50
92
|
}
|
|
51
93
|
|
|
52
94
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
95
|
+
* Deletes a provider configuration, which fails while routing strategies or
|
|
96
|
+
* templates still reference it. Update those references first.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* await client.providers.delete('id');
|
|
101
|
+
* ```
|
|
55
102
|
*/
|
|
56
103
|
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
57
104
|
return this._client.delete(path`/providers/${id}`, {
|
|
@@ -168,27 +215,45 @@ export interface ProviderListResponse {
|
|
|
168
215
|
|
|
169
216
|
export interface ProviderCreateParams {
|
|
170
217
|
/**
|
|
171
|
-
* The provider key identifying the type (e.g. "sendgrid", "twilio").
|
|
172
|
-
* known Courier provider — see the catalog endpoint for valid keys.
|
|
218
|
+
* Body param: The provider key identifying the type (e.g. "sendgrid", "twilio").
|
|
219
|
+
* Must be a known Courier provider — see the catalog endpoint for valid keys.
|
|
173
220
|
*/
|
|
174
221
|
provider: string;
|
|
175
222
|
|
|
176
223
|
/**
|
|
177
|
-
* Optional alias for this configuration.
|
|
224
|
+
* Body param: Optional alias for this configuration.
|
|
178
225
|
*/
|
|
179
226
|
alias?: string;
|
|
180
227
|
|
|
181
228
|
/**
|
|
182
|
-
* Provider-specific settings (snake_case keys). Defaults to an empty
|
|
183
|
-
* omitted. Use the catalog endpoint to discover required fields for a
|
|
184
|
-
* provider — omitting a required field returns a 400 validation error.
|
|
229
|
+
* Body param: Provider-specific settings (snake_case keys). Defaults to an empty
|
|
230
|
+
* object when omitted. Use the catalog endpoint to discover required fields for a
|
|
231
|
+
* given provider — omitting a required field returns a 400 validation error.
|
|
185
232
|
*/
|
|
186
233
|
settings?: { [key: string]: unknown };
|
|
187
234
|
|
|
188
235
|
/**
|
|
189
|
-
* Optional display title. Omit to use "Default Configuration".
|
|
236
|
+
* Body param: Optional display title. Omit to use "Default Configuration".
|
|
190
237
|
*/
|
|
191
238
|
title?: string;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
242
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
243
|
+
* response from the first request without performing the operation again
|
|
244
|
+
* (including the original status code and any error). Use it to safely retry
|
|
245
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
246
|
+
* is scoped to this endpoint.
|
|
247
|
+
*/
|
|
248
|
+
'Idempotency-Key'?: string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
252
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
253
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
254
|
+
* maximum is 1 year.
|
|
255
|
+
*/
|
|
256
|
+
'x-idempotency-expiration'?: string;
|
|
192
257
|
}
|
|
193
258
|
|
|
194
259
|
export interface ProviderUpdateParams {
|
|
@@ -6,9 +6,13 @@ import { buildHeaders } from '../internal/headers';
|
|
|
6
6
|
import { RequestOptions } from '../internal/request-options';
|
|
7
7
|
import { path } from '../internal/utils/path';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Look up the messages Courier has accepted, inspect their delivery history and rendered output, and cancel, resend, or archive them.
|
|
11
|
+
*/
|
|
9
12
|
export class Requests extends APIResource {
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
14
|
+
* Archives a send request by its request id. Use it to remove test sends or
|
|
15
|
+
* superseded requests from the message list without deleting them.
|
|
12
16
|
*/
|
|
13
17
|
archive(requestID: string, options?: RequestOptions): APIPromise<void> {
|
|
14
18
|
return this._client.put(path`/requests/${requestID}/archive`, {
|
|
@@ -8,6 +8,9 @@ import { buildHeaders } from '../internal/headers';
|
|
|
8
8
|
import { RequestOptions } from '../internal/request-options';
|
|
9
9
|
import { path } from '../internal/utils/path';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Define reusable channel routing and failover strategies, and see which templates use them.
|
|
13
|
+
*/
|
|
11
14
|
export class RoutingStrategies extends APIResource {
|
|
12
15
|
/**
|
|
13
16
|
* Create a routing strategy. Requires a name and routing configuration at minimum.
|
|
@@ -28,15 +31,32 @@ export class RoutingStrategies extends APIResource {
|
|
|
28
31
|
* ```
|
|
29
32
|
*/
|
|
30
33
|
create(
|
|
31
|
-
|
|
34
|
+
params: RoutingStrategyCreateParams,
|
|
32
35
|
options?: RequestOptions,
|
|
33
36
|
): APIPromise<RoutingStrategyGetResponse> {
|
|
34
|
-
|
|
37
|
+
const {
|
|
38
|
+
'Idempotency-Key': idempotencyKey,
|
|
39
|
+
'x-idempotency-expiration': xIdempotencyExpiration,
|
|
40
|
+
...body
|
|
41
|
+
} = params;
|
|
42
|
+
return this._client.post('/routing-strategies', {
|
|
43
|
+
body,
|
|
44
|
+
...options,
|
|
45
|
+
headers: buildHeaders([
|
|
46
|
+
{
|
|
47
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
48
|
+
...(xIdempotencyExpiration != null ?
|
|
49
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
50
|
+
: undefined),
|
|
51
|
+
},
|
|
52
|
+
options?.headers,
|
|
53
|
+
]),
|
|
54
|
+
});
|
|
35
55
|
}
|
|
36
56
|
|
|
37
57
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
58
|
+
* Returns one routing strategy by id with its name, tags, channels, and the
|
|
59
|
+
* routing rules that decide provider order and fallback.
|
|
40
60
|
*
|
|
41
61
|
* @example
|
|
42
62
|
* ```ts
|
|
@@ -83,8 +103,8 @@ export class RoutingStrategies extends APIResource {
|
|
|
83
103
|
}
|
|
84
104
|
|
|
85
105
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
106
|
+
* Returns the notification templates using a routing strategy, with paging. Check
|
|
107
|
+
* this before changing a strategy that templates depend on.
|
|
88
108
|
*
|
|
89
109
|
* @example
|
|
90
110
|
* ```ts
|
|
@@ -323,34 +343,52 @@ export interface RoutingStrategySummary {
|
|
|
323
343
|
|
|
324
344
|
export interface RoutingStrategyCreateParams {
|
|
325
345
|
/**
|
|
326
|
-
* Human-readable name for the routing strategy.
|
|
346
|
+
* Body param: Human-readable name for the routing strategy.
|
|
327
347
|
*/
|
|
328
348
|
name: string;
|
|
329
349
|
|
|
330
350
|
/**
|
|
331
|
-
* Routing tree defining channel selection method and order.
|
|
351
|
+
* Body param: Routing tree defining channel selection method and order.
|
|
332
352
|
*/
|
|
333
353
|
routing: Shared.MessageRouting;
|
|
334
354
|
|
|
335
355
|
/**
|
|
336
|
-
* Per-channel delivery configuration. Defaults to empty if omitted.
|
|
356
|
+
* Body param: Per-channel delivery configuration. Defaults to empty if omitted.
|
|
337
357
|
*/
|
|
338
358
|
channels?: Shared.MessageChannels | null;
|
|
339
359
|
|
|
340
360
|
/**
|
|
341
|
-
* Optional description of the routing strategy.
|
|
361
|
+
* Body param: Optional description of the routing strategy.
|
|
342
362
|
*/
|
|
343
363
|
description?: string | null;
|
|
344
364
|
|
|
345
365
|
/**
|
|
346
|
-
* Per-provider delivery configuration. Defaults to empty if omitted.
|
|
366
|
+
* Body param: Per-provider delivery configuration. Defaults to empty if omitted.
|
|
347
367
|
*/
|
|
348
368
|
providers?: Shared.MessageProviders | null;
|
|
349
369
|
|
|
350
370
|
/**
|
|
351
|
-
* Optional tags for categorization.
|
|
371
|
+
* Body param: Optional tags for categorization.
|
|
352
372
|
*/
|
|
353
373
|
tags?: Array<string> | null;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
377
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
378
|
+
* response from the first request without performing the operation again
|
|
379
|
+
* (including the original status code and any error). Use it to safely retry
|
|
380
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
381
|
+
* is scoped to this endpoint.
|
|
382
|
+
*/
|
|
383
|
+
'Idempotency-Key'?: string;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
387
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
388
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
389
|
+
* maximum is 1 year.
|
|
390
|
+
*/
|
|
391
|
+
'x-idempotency-expiration'?: string;
|
|
354
392
|
}
|
|
355
393
|
|
|
356
394
|
export interface RoutingStrategyListParams {
|
package/src/resources/send.ts
CHANGED
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as Shared from './shared';
|
|
5
5
|
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { buildHeaders } from '../internal/headers';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Send a message to one or more recipients — users, lists, audiences, or tenants — across every channel you have configured.
|
|
11
|
+
*/
|
|
8
12
|
export class Send extends APIResource {
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
14
|
+
* Sends a message to one or more recipients and returns a requestId. Courier
|
|
15
|
+
* routes it to email, SMS, push, chat, or in-app based on your rules.
|
|
11
16
|
*
|
|
12
17
|
* @example
|
|
13
18
|
* ```ts
|
|
@@ -20,8 +25,25 @@ export class Send extends APIResource {
|
|
|
20
25
|
* });
|
|
21
26
|
* ```
|
|
22
27
|
*/
|
|
23
|
-
message(
|
|
24
|
-
|
|
28
|
+
message(params: SendMessageParams, options?: RequestOptions): APIPromise<SendMessageResponse> {
|
|
29
|
+
const {
|
|
30
|
+
'Idempotency-Key': idempotencyKey,
|
|
31
|
+
'x-idempotency-expiration': xIdempotencyExpiration,
|
|
32
|
+
...body
|
|
33
|
+
} = params;
|
|
34
|
+
return this._client.post('/send', {
|
|
35
|
+
body,
|
|
36
|
+
...options,
|
|
37
|
+
headers: buildHeaders([
|
|
38
|
+
{
|
|
39
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
40
|
+
...(xIdempotencyExpiration != null ?
|
|
41
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
42
|
+
: undefined),
|
|
43
|
+
},
|
|
44
|
+
options?.headers,
|
|
45
|
+
]),
|
|
46
|
+
});
|
|
25
47
|
}
|
|
26
48
|
}
|
|
27
49
|
|
|
@@ -37,10 +59,28 @@ export interface SendMessageResponse {
|
|
|
37
59
|
|
|
38
60
|
export interface SendMessageParams {
|
|
39
61
|
/**
|
|
40
|
-
* The message property has the following primary top-level properties.
|
|
41
|
-
* the destination and content of the message.
|
|
62
|
+
* Body param: The message property has the following primary top-level properties.
|
|
63
|
+
* They define the destination and content of the message.
|
|
42
64
|
*/
|
|
43
65
|
message: SendMessageParams.Message;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
69
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
70
|
+
* response from the first request without performing the operation again
|
|
71
|
+
* (including the original status code and any error). Use it to safely retry
|
|
72
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
73
|
+
* is scoped to this endpoint.
|
|
74
|
+
*/
|
|
75
|
+
'Idempotency-Key'?: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
79
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
80
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
81
|
+
* maximum is 1 year.
|
|
82
|
+
*/
|
|
83
|
+
'x-idempotency-expiration'?: string;
|
|
44
84
|
}
|
|
45
85
|
|
|
46
86
|
export namespace SendMessageParams {
|
|
@@ -7,9 +7,13 @@ import { buildHeaders } from '../../../internal/headers';
|
|
|
7
7
|
import { RequestOptions } from '../../../internal/request-options';
|
|
8
8
|
import { path } from '../../../internal/utils/path';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Manage tenants — the organizations, teams, or accounts your users belong to — along with their users and default preferences.
|
|
12
|
+
*/
|
|
10
13
|
export class Items extends APIResource {
|
|
11
14
|
/**
|
|
12
|
-
*
|
|
15
|
+
* Sets a tenant's default opt-in status for one subscription topic, which applies
|
|
16
|
+
* to every member unless a user sets their own override.
|
|
13
17
|
*
|
|
14
18
|
* @example
|
|
15
19
|
* ```ts
|
|
@@ -31,7 +35,8 @@ export class Items extends APIResource {
|
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
/**
|
|
34
|
-
*
|
|
38
|
+
* Removes a tenant's default preference for one subscription topic, addressed by
|
|
39
|
+
* tenant id and topic id.
|
|
35
40
|
*
|
|
36
41
|
* @example
|
|
37
42
|
* ```ts
|
|
@@ -10,11 +10,15 @@ import { buildHeaders } from '../../../internal/headers';
|
|
|
10
10
|
import { RequestOptions } from '../../../internal/request-options';
|
|
11
11
|
import { path } from '../../../internal/utils/path';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Manage the templates and template versions scoped to a single tenant, including the ones authored in the embedded designer.
|
|
15
|
+
*/
|
|
13
16
|
export class Templates extends APIResource {
|
|
14
17
|
versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client);
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
|
-
*
|
|
20
|
+
* Returns a tenant's notification template with its content, version, and created,
|
|
21
|
+
* updated, and published timestamps.
|
|
18
22
|
*
|
|
19
23
|
* @example
|
|
20
24
|
* ```ts
|
|
@@ -34,7 +38,8 @@ export class Templates extends APIResource {
|
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
|
-
*
|
|
41
|
+
* Lists a tenant's notification templates, each carrying its version and published
|
|
42
|
+
* timestamp. Paged.
|
|
38
43
|
*
|
|
39
44
|
* @example
|
|
40
45
|
* ```ts
|
|
@@ -52,12 +57,8 @@ export class Templates extends APIResource {
|
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
/**
|
|
55
|
-
* Deletes
|
|
56
|
-
*
|
|
57
|
-
* Returns **204 No Content** with an empty body on success.
|
|
58
|
-
*
|
|
59
|
-
* Returns **404** if there is no template with this ID for the tenant, including a
|
|
60
|
-
* second `DELETE` after a successful removal.
|
|
60
|
+
* Deletes a tenant's notification template by id. Sends for that tenant then use
|
|
61
|
+
* the workspace template registered under the same id.
|
|
61
62
|
*
|
|
62
63
|
* @example
|
|
63
64
|
* ```ts
|
|
@@ -75,10 +76,8 @@ export class Templates extends APIResource {
|
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
/**
|
|
78
|
-
* Publishes a
|
|
79
|
-
*
|
|
80
|
-
* The template must already exist in the tenant's notification map. If no version
|
|
81
|
-
* is specified, defaults to publishing the "latest" version.
|
|
79
|
+
* Publishes a version of a tenant's notification template, making it the content
|
|
80
|
+
* that tenant's sends render from until you publish another.
|
|
82
81
|
*
|
|
83
82
|
* @example
|
|
84
83
|
* ```ts
|
|
@@ -101,13 +100,8 @@ export class Templates extends APIResource {
|
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
/**
|
|
104
|
-
* Creates or updates a notification template
|
|
105
|
-
*
|
|
106
|
-
* If the template already exists for the tenant, it will be updated (200).
|
|
107
|
-
* Otherwise, a new template is created (201).
|
|
108
|
-
*
|
|
109
|
-
* Optionally publishes the template immediately if the `published` flag is set to
|
|
110
|
-
* true.
|
|
103
|
+
* Creates or updates a notification template scoped to one tenant, letting a
|
|
104
|
+
* tenant override the content the workspace template would send.
|
|
111
105
|
*
|
|
112
106
|
* @example
|
|
113
107
|
* ```ts
|
|
@@ -6,15 +6,13 @@ import { APIPromise } from '../../../core/api-promise';
|
|
|
6
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
7
7
|
import { path } from '../../../internal/utils/path';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Manage the templates and template versions scoped to a single tenant, including the ones authored in the embedded designer.
|
|
11
|
+
*/
|
|
9
12
|
export class Versions extends APIResource {
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Supports the following version formats:
|
|
14
|
-
*
|
|
15
|
-
* - `latest` - The most recent version of the template
|
|
16
|
-
* - `published` - The currently published version
|
|
17
|
-
* - `v{version}` - A specific version (e.g., "v1", "v2", "v1.0.0")
|
|
14
|
+
* Returns one version of a tenant template, addressed by version number or by
|
|
15
|
+
* latest, with its content and publish timestamp.
|
|
18
16
|
*
|
|
19
17
|
* @example
|
|
20
18
|
* ```ts
|