@trycourier/courier 7.21.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 +16 -0
- package/client.d.mts +57 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +57 -0
- package/client.d.ts.map +1 -1
- package/client.js +57 -0
- package/client.js.map +1 -1
- package/client.mjs +57 -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/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 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -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 +59 -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/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 -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
|
@@ -10,6 +10,9 @@ const TemplatesAPI = tslib_1.__importStar(require("./templates/templates.js"));
|
|
|
10
10
|
const templates_1 = require("./templates/templates.js");
|
|
11
11
|
const headers_1 = require("../../internal/headers.js");
|
|
12
12
|
const path_1 = require("../../internal/utils/path.js");
|
|
13
|
+
/**
|
|
14
|
+
* Manage tenants — the organizations, teams, or accounts your users belong to — along with their users and default preferences.
|
|
15
|
+
*/
|
|
13
16
|
class Tenants extends resource_1.APIResource {
|
|
14
17
|
constructor() {
|
|
15
18
|
super(...arguments);
|
|
@@ -17,7 +20,8 @@ class Tenants extends resource_1.APIResource {
|
|
|
17
20
|
this.templates = new TemplatesAPI.Templates(this._client);
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
|
-
*
|
|
23
|
+
* Returns one tenant with its name, parent tenant id, default preferences,
|
|
24
|
+
* properties, and the user profile applied to its members.
|
|
21
25
|
*
|
|
22
26
|
* @example
|
|
23
27
|
* ```ts
|
|
@@ -28,7 +32,8 @@ class Tenants extends resource_1.APIResource {
|
|
|
28
32
|
return this._client.get((0, path_1.path) `/tenants/${tenantID}`, options);
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
31
|
-
*
|
|
35
|
+
* Creates or replaces a tenant from a name, parent, brand, properties, and default
|
|
36
|
+
* preferences supplied in the request body.
|
|
32
37
|
*
|
|
33
38
|
* @example
|
|
34
39
|
* ```ts
|
|
@@ -41,7 +46,8 @@ class Tenants extends resource_1.APIResource {
|
|
|
41
46
|
return this._client.put((0, path_1.path) `/tenants/${tenantID}`, { body, ...options });
|
|
42
47
|
}
|
|
43
48
|
/**
|
|
44
|
-
*
|
|
49
|
+
* Lists the workspace's tenants, each carrying a name, parent tenant, properties,
|
|
50
|
+
* and default preferences. Paged.
|
|
45
51
|
*
|
|
46
52
|
* @example
|
|
47
53
|
* ```ts
|
|
@@ -52,7 +58,8 @@ class Tenants extends resource_1.APIResource {
|
|
|
52
58
|
return this._client.get('/tenants', { query, ...options });
|
|
53
59
|
}
|
|
54
60
|
/**
|
|
55
|
-
*
|
|
61
|
+
* Deletes a tenant. Its members' workspace-level profiles and preferences live
|
|
62
|
+
* outside the tenant and are managed separately.
|
|
56
63
|
*
|
|
57
64
|
* @example
|
|
58
65
|
* ```ts
|
|
@@ -66,7 +73,8 @@ class Tenants extends resource_1.APIResource {
|
|
|
66
73
|
});
|
|
67
74
|
}
|
|
68
75
|
/**
|
|
69
|
-
*
|
|
76
|
+
* Returns the users belonging to a tenant with cursor paging. Use it to see who a
|
|
77
|
+
* tenant-scoped send will reach.
|
|
70
78
|
*
|
|
71
79
|
* @example
|
|
72
80
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,qFAA4D;AAC5D,8DAAwD;AACxD,+EAAsD;AACtD,wDAQ+B;AAE/B,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,qFAA4D;AAC5D,8DAAwD;AACxD,+EAAsD;AACtD,wDAQ+B;AAE/B,uDAAsD;AAEtD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAgF/E,CAAC;IA9EC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,EAAE,EAAE;YACrD,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;IAED;;;;;;;;;;OAUG;IACH,SAAS,CACP,QAAgB,EAChB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;CACF;AAlFD,0BAkFC;AAkVD,OAAO,CAAC,WAAW,GAAG,yBAAW,CAAC;AAClC,OAAO,CAAC,SAAS,GAAG,qBAAS,CAAC"}
|
|
@@ -6,6 +6,9 @@ import * as TemplatesAPI from "./templates/templates.mjs";
|
|
|
6
6
|
import { Templates, } from "./templates/templates.mjs";
|
|
7
7
|
import { buildHeaders } from "../../internal/headers.mjs";
|
|
8
8
|
import { path } from "../../internal/utils/path.mjs";
|
|
9
|
+
/**
|
|
10
|
+
* Manage tenants — the organizations, teams, or accounts your users belong to — along with their users and default preferences.
|
|
11
|
+
*/
|
|
9
12
|
export class Tenants extends APIResource {
|
|
10
13
|
constructor() {
|
|
11
14
|
super(...arguments);
|
|
@@ -13,7 +16,8 @@ export class Tenants extends APIResource {
|
|
|
13
16
|
this.templates = new TemplatesAPI.Templates(this._client);
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
19
|
+
* Returns one tenant with its name, parent tenant id, default preferences,
|
|
20
|
+
* properties, and the user profile applied to its members.
|
|
17
21
|
*
|
|
18
22
|
* @example
|
|
19
23
|
* ```ts
|
|
@@ -24,7 +28,8 @@ export class Tenants extends APIResource {
|
|
|
24
28
|
return this._client.get(path `/tenants/${tenantID}`, options);
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
|
-
*
|
|
31
|
+
* Creates or replaces a tenant from a name, parent, brand, properties, and default
|
|
32
|
+
* preferences supplied in the request body.
|
|
28
33
|
*
|
|
29
34
|
* @example
|
|
30
35
|
* ```ts
|
|
@@ -37,7 +42,8 @@ export class Tenants extends APIResource {
|
|
|
37
42
|
return this._client.put(path `/tenants/${tenantID}`, { body, ...options });
|
|
38
43
|
}
|
|
39
44
|
/**
|
|
40
|
-
*
|
|
45
|
+
* Lists the workspace's tenants, each carrying a name, parent tenant, properties,
|
|
46
|
+
* and default preferences. Paged.
|
|
41
47
|
*
|
|
42
48
|
* @example
|
|
43
49
|
* ```ts
|
|
@@ -48,7 +54,8 @@ export class Tenants extends APIResource {
|
|
|
48
54
|
return this._client.get('/tenants', { query, ...options });
|
|
49
55
|
}
|
|
50
56
|
/**
|
|
51
|
-
*
|
|
57
|
+
* Deletes a tenant. Its members' workspace-level profiles and preferences live
|
|
58
|
+
* outside the tenant and are managed separately.
|
|
52
59
|
*
|
|
53
60
|
* @example
|
|
54
61
|
* ```ts
|
|
@@ -62,7 +69,8 @@ export class Tenants extends APIResource {
|
|
|
62
69
|
});
|
|
63
70
|
}
|
|
64
71
|
/**
|
|
65
|
-
*
|
|
72
|
+
* Returns the users belonging to a tenant with cursor paging. Use it to see who a
|
|
73
|
+
* tenant-scoped send will reach.
|
|
66
74
|
*
|
|
67
75
|
* @example
|
|
68
76
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,KAAK,cAAc,sCAAkC;AAC5D,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,KAAK,YAAY,kCAA8B;AACtD,OAAO,EAOL,SAAS,GACV,kCAA8B;AAE/B,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,KAAK,cAAc,sCAAkC;AAC5D,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,KAAK,YAAY,kCAA8B;AACtD,OAAO,EAOL,SAAS,GACV,kCAA8B;AAE/B,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAgF/E,CAAC;IA9EC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE;YACrD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,SAAS,CACP,QAAgB,EAChB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;CACF;AAkVD,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC;AAClC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Store and retrieve the translation strings Courier uses to render localized template content.
|
|
6
|
+
*/
|
|
4
7
|
export declare class Translations extends APIResource {
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
9
|
+
* Returns the translation strings stored for one domain and locale, for use in
|
|
10
|
+
* localized notification content.
|
|
7
11
|
*/
|
|
8
12
|
retrieve(locale: string, params: TranslationRetrieveParams, options?: RequestOptions): APIPromise<string>;
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
14
|
+
* Uploads the translation strings for one domain and locale. Courier uses them to
|
|
15
|
+
* render localized content for recipients in that locale.
|
|
11
16
|
*/
|
|
12
17
|
update(locale: string, params: TranslationUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
13
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.mts","sourceRoot":"","sources":["../src/resources/translations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"translations.d.mts","sourceRoot":"","sources":["../src/resources/translations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAKzG;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAQpG;AAED,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Store and retrieve the translation strings Courier uses to render localized template content.
|
|
6
|
+
*/
|
|
4
7
|
export declare class Translations extends APIResource {
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
9
|
+
* Returns the translation strings stored for one domain and locale, for use in
|
|
10
|
+
* localized notification content.
|
|
7
11
|
*/
|
|
8
12
|
retrieve(locale: string, params: TranslationRetrieveParams, options?: RequestOptions): APIPromise<string>;
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
14
|
+
* Uploads the translation strings for one domain and locale. Courier uses them to
|
|
15
|
+
* render localized content for recipients in that locale.
|
|
11
16
|
*/
|
|
12
17
|
update(locale: string, params: TranslationUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
13
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../src/resources/translations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../src/resources/translations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAKzG;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAQpG;AAED,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -5,16 +5,21 @@ exports.Translations = 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
|
+
* Store and retrieve the translation strings Courier uses to render localized template content.
|
|
10
|
+
*/
|
|
8
11
|
class Translations extends resource_1.APIResource {
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* Returns the translation strings stored for one domain and locale, for use in
|
|
14
|
+
* localized notification content.
|
|
11
15
|
*/
|
|
12
16
|
retrieve(locale, params, options) {
|
|
13
17
|
const { domain } = params;
|
|
14
18
|
return this._client.get((0, path_1.path) `/translations/${domain}/${locale}`, options);
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
|
-
*
|
|
21
|
+
* Uploads the translation strings for one domain and locale. Courier uses them to
|
|
22
|
+
* render localized content for recipients in that locale.
|
|
18
23
|
*/
|
|
19
24
|
update(locale, params, options) {
|
|
20
25
|
const { domain, body } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../src/resources/translations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,YAAa,SAAQ,sBAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../src/resources/translations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;OAGG;IACH,QAAQ,CAAC,MAAc,EAAE,MAAiC,EAAE,OAAwB;QAClF,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,MAAM,IAAI,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,MAAc,EAAE,MAA+B,EAAE,OAAwB;QAC9E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,MAAM,IAAI,MAAM,EAAE,EAAE;YAC/D,IAAI,EAAE,IAAI;YACV,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;AAtBD,oCAsBC"}
|
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Store and retrieve the translation strings Courier uses to render localized template content.
|
|
7
|
+
*/
|
|
5
8
|
export class Translations extends APIResource {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Returns the translation strings stored for one domain and locale, for use in
|
|
11
|
+
* localized notification content.
|
|
8
12
|
*/
|
|
9
13
|
retrieve(locale, params, options) {
|
|
10
14
|
const { domain } = params;
|
|
11
15
|
return this._client.get(path `/translations/${domain}/${locale}`, options);
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
|
-
*
|
|
18
|
+
* Uploads the translation strings for one domain and locale. Courier uses them to
|
|
19
|
+
* render localized content for recipients in that locale.
|
|
15
20
|
*/
|
|
16
21
|
update(locale, params, options) {
|
|
17
22
|
const { domain, body } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.mjs","sourceRoot":"","sources":["../src/resources/translations.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"translations.mjs","sourceRoot":"","sources":["../src/resources/translations.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;OAGG;IACH,QAAQ,CAAC,MAAc,EAAE,MAAiC,EAAE,OAAwB;QAClF,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,MAAM,IAAI,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,MAAc,EAAE,MAA+B,EAAE,OAAwB;QAC9E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,MAAM,IAAI,MAAM,EAAE,EAAE;YAC/D,IAAI,EAAE,IAAI;YACV,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -2,9 +2,13 @@ import { APIResource } from "../../core/resource.mjs";
|
|
|
2
2
|
import * as Shared from "../shared.mjs";
|
|
3
3
|
import { APIPromise } from "../../core/api-promise.mjs";
|
|
4
4
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Read and write a single user's notification preferences, per topic and per channel.
|
|
7
|
+
*/
|
|
5
8
|
export declare class Preferences extends APIResource {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Returns a user's preference overrides with paging, one entry per subscription
|
|
11
|
+
* topic they have set a choice for.
|
|
8
12
|
*
|
|
9
13
|
* @example
|
|
10
14
|
* ```ts
|
|
@@ -15,23 +19,8 @@ export declare class Preferences extends APIResource {
|
|
|
15
19
|
*/
|
|
16
20
|
retrieve(userID: string, query?: PreferenceRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<PreferenceRetrieveResponse>;
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* listed topics are created or updated, and every existing override that is not
|
|
21
|
-
* included in the body is reset to its topic default. Submitting an empty `topics`
|
|
22
|
-
* array is a valid clear-all that resets every existing override.
|
|
23
|
-
*
|
|
24
|
-
* This operation is validation-atomic (all-or-nothing): structural validation
|
|
25
|
-
* fails fast with a single `400`, and if any topic is semantically invalid (an
|
|
26
|
-
* unknown topic, a `REQUIRED` topic that cannot be opted out, or a custom routing
|
|
27
|
-
* request that is not available on the workspace's plan) the request returns a
|
|
28
|
-
* single `400` aggregating every failure in `errors` and writes nothing. On
|
|
29
|
-
* success it returns `200` with `items` (the complete resulting override set) and
|
|
30
|
-
* `deleted` (the ids of the overrides that were reset to default).
|
|
31
|
-
*
|
|
32
|
-
* Every `topic_id` in the response — in `items`, `deleted`, and any `errors` — is
|
|
33
|
-
* returned in Courier's canonical topic id form, regardless of the form supplied
|
|
34
|
-
* in the request.
|
|
22
|
+
* Replaces a user's entire set of preference overrides. Any topic you leave out is
|
|
23
|
+
* reset to its default, so send the full set rather than a subset.
|
|
35
24
|
*
|
|
36
25
|
* @example
|
|
37
26
|
* ```ts
|
|
@@ -52,23 +41,8 @@ export declare class Preferences extends APIResource {
|
|
|
52
41
|
*/
|
|
53
42
|
bulkReplace(userID: string, params: PreferenceBulkReplaceParams, options?: RequestOptions): APIPromise<PreferenceBulkReplaceResponse>;
|
|
54
43
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* created or updated; any existing overrides for topics not listed are left
|
|
58
|
-
* untouched.
|
|
59
|
-
*
|
|
60
|
-
* Structural validation of the request body fails fast with a single `400`. Beyond
|
|
61
|
-
* that, each topic is processed independently (partial-success, not
|
|
62
|
-
* all-or-nothing): valid topics are written and returned in `items`, while topics
|
|
63
|
-
* that cannot be applied are collected in `errors` with a per-topic `reason` (for
|
|
64
|
-
* example an unknown topic, a `REQUIRED` topic that cannot be opted out, a custom
|
|
65
|
-
* routing request that is not available on the workspace's plan, or a write
|
|
66
|
-
* failure). The request therefore returns `200` with both lists whenever the body
|
|
67
|
-
* is structurally valid.
|
|
68
|
-
*
|
|
69
|
-
* Every `topic_id` in the response — in both `items` and `errors` — is returned in
|
|
70
|
-
* Courier's canonical topic id form, regardless of the form supplied in the
|
|
71
|
-
* request.
|
|
44
|
+
* Adds or updates a user's preferences for several subscription topics at once.
|
|
45
|
+
* Topics you leave out keep whatever they were set to before.
|
|
72
46
|
*
|
|
73
47
|
* @example
|
|
74
48
|
* ```ts
|
|
@@ -93,9 +67,8 @@ export declare class Preferences extends APIResource {
|
|
|
93
67
|
*/
|
|
94
68
|
bulkUpdate(userID: string, params: PreferenceBulkUpdateParams, options?: RequestOptions): APIPromise<PreferenceBulkUpdateResponse>;
|
|
95
69
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* preference that does not exist succeeds with no error.
|
|
70
|
+
* Removes a user's override for one subscription topic, resetting it to the
|
|
71
|
+
* effective default from the tenant or workspace.
|
|
99
72
|
*
|
|
100
73
|
* @example
|
|
101
74
|
* ```ts
|
|
@@ -106,7 +79,8 @@ export declare class Preferences extends APIResource {
|
|
|
106
79
|
*/
|
|
107
80
|
deleteTopic(topicID: string, params: PreferenceDeleteTopicParams, options?: RequestOptions): APIPromise<void>;
|
|
108
81
|
/**
|
|
109
|
-
*
|
|
82
|
+
* Returns a user's opt-in status and channel choices for one subscription topic,
|
|
83
|
+
* or the effective default if they have set no override.
|
|
110
84
|
*
|
|
111
85
|
* @example
|
|
112
86
|
* ```ts
|
|
@@ -118,7 +92,8 @@ export declare class Preferences extends APIResource {
|
|
|
118
92
|
*/
|
|
119
93
|
retrieveTopic(topicID: string, params: PreferenceRetrieveTopicParams, options?: RequestOptions): APIPromise<PreferenceRetrieveTopicResponse>;
|
|
120
94
|
/**
|
|
121
|
-
*
|
|
95
|
+
* Sets a user's opt-in status and channel choices for one subscription topic,
|
|
96
|
+
* overriding the tenant default for that topic only.
|
|
122
97
|
*
|
|
123
98
|
* @example
|
|
124
99
|
* ```ts
|
|
@@ -152,14 +127,35 @@ export interface BulkPreferenceTopic {
|
|
|
152
127
|
topic_id: string;
|
|
153
128
|
}
|
|
154
129
|
export interface TopicPreference {
|
|
130
|
+
/**
|
|
131
|
+
* The topic's default status, returned on reads. It applies whenever the user has
|
|
132
|
+
* no override of their own (status equals this value).
|
|
133
|
+
*/
|
|
155
134
|
default_status: Shared.PreferenceStatus;
|
|
135
|
+
/**
|
|
136
|
+
* The user's subscription status for this topic. OPTED_IN or OPTED_OUT reflect the
|
|
137
|
+
* user's own choice; REQUIRED is a topic-level default set in the preferences
|
|
138
|
+
* editor, not a user choice.
|
|
139
|
+
*/
|
|
156
140
|
status: Shared.PreferenceStatus;
|
|
141
|
+
/**
|
|
142
|
+
* The unique identifier of the subscription topic this preference applies to.
|
|
143
|
+
*/
|
|
157
144
|
topic_id: string;
|
|
145
|
+
/**
|
|
146
|
+
* The display name of the subscription topic, returned on reads.
|
|
147
|
+
*/
|
|
158
148
|
topic_name: string;
|
|
159
149
|
/**
|
|
160
|
-
* The
|
|
150
|
+
* The channels the user has chosen to receive this topic on, present only when
|
|
151
|
+
* has_custom_routing is true. One or more of: direct_message, email, push, sms,
|
|
152
|
+
* webhook, inbox.
|
|
161
153
|
*/
|
|
162
154
|
custom_routing?: Array<Shared.ChannelClassification> | null;
|
|
155
|
+
/**
|
|
156
|
+
* Whether the user has chosen specific delivery channels for this topic (listed in
|
|
157
|
+
* custom_routing) rather than the topic's default routing.
|
|
158
|
+
*/
|
|
163
159
|
has_custom_routing?: boolean | null;
|
|
164
160
|
}
|
|
165
161
|
export interface PreferenceRetrieveResponse {
|
|
@@ -258,6 +254,22 @@ export interface PreferenceBulkUpdateParams {
|
|
|
258
254
|
* Query param: Update the preferences of a user for this specific tenant context.
|
|
259
255
|
*/
|
|
260
256
|
tenant_id?: string | null;
|
|
257
|
+
/**
|
|
258
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
259
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
260
|
+
* response from the first request without performing the operation again
|
|
261
|
+
* (including the original status code and any error). Use it to safely retry
|
|
262
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
263
|
+
* is scoped to this endpoint.
|
|
264
|
+
*/
|
|
265
|
+
'Idempotency-Key'?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
268
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
269
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
270
|
+
* maximum is 1 year.
|
|
271
|
+
*/
|
|
272
|
+
'x-idempotency-expiration'?: string;
|
|
261
273
|
}
|
|
262
274
|
export declare namespace PreferenceBulkUpdateParams {
|
|
263
275
|
interface Topic {
|
|
@@ -318,11 +330,21 @@ export interface PreferenceUpdateOrCreateTopicParams {
|
|
|
318
330
|
}
|
|
319
331
|
export declare namespace PreferenceUpdateOrCreateTopicParams {
|
|
320
332
|
interface Topic {
|
|
333
|
+
/**
|
|
334
|
+
* The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level
|
|
335
|
+
* default, not a user choice; the API rejects opting a user out of a REQUIRED
|
|
336
|
+
* topic.
|
|
337
|
+
*/
|
|
321
338
|
status: Shared.PreferenceStatus;
|
|
322
339
|
/**
|
|
323
|
-
* The
|
|
340
|
+
* The channels to deliver this topic on when has_custom_routing is true. One or
|
|
341
|
+
* more of: direct_message, email, push, sms, webhook, inbox.
|
|
324
342
|
*/
|
|
325
343
|
custom_routing?: Array<Shared.ChannelClassification> | null;
|
|
344
|
+
/**
|
|
345
|
+
* Set to true to route this topic to the channels in custom_routing instead of the
|
|
346
|
+
* topic's default routing.
|
|
347
|
+
*/
|
|
326
348
|
has_custom_routing?: boolean | null;
|
|
327
349
|
}
|
|
328
350
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.d.mts","sourceRoot":"","sources":["../../src/resources/users/preferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE,qBAAa,WAAY,SAAQ,WAAW;IAC1C
|
|
1
|
+
{"version":3,"file":"preferences.d.mts","sourceRoot":"","sources":["../../src/resources/users/preferences.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,9 +2,13 @@ import { APIResource } from "../../core/resource.js";
|
|
|
2
2
|
import * as Shared from "../shared.js";
|
|
3
3
|
import { APIPromise } from "../../core/api-promise.js";
|
|
4
4
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Read and write a single user's notification preferences, per topic and per channel.
|
|
7
|
+
*/
|
|
5
8
|
export declare class Preferences extends APIResource {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Returns a user's preference overrides with paging, one entry per subscription
|
|
11
|
+
* topic they have set a choice for.
|
|
8
12
|
*
|
|
9
13
|
* @example
|
|
10
14
|
* ```ts
|
|
@@ -15,23 +19,8 @@ export declare class Preferences extends APIResource {
|
|
|
15
19
|
*/
|
|
16
20
|
retrieve(userID: string, query?: PreferenceRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<PreferenceRetrieveResponse>;
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* listed topics are created or updated, and every existing override that is not
|
|
21
|
-
* included in the body is reset to its topic default. Submitting an empty `topics`
|
|
22
|
-
* array is a valid clear-all that resets every existing override.
|
|
23
|
-
*
|
|
24
|
-
* This operation is validation-atomic (all-or-nothing): structural validation
|
|
25
|
-
* fails fast with a single `400`, and if any topic is semantically invalid (an
|
|
26
|
-
* unknown topic, a `REQUIRED` topic that cannot be opted out, or a custom routing
|
|
27
|
-
* request that is not available on the workspace's plan) the request returns a
|
|
28
|
-
* single `400` aggregating every failure in `errors` and writes nothing. On
|
|
29
|
-
* success it returns `200` with `items` (the complete resulting override set) and
|
|
30
|
-
* `deleted` (the ids of the overrides that were reset to default).
|
|
31
|
-
*
|
|
32
|
-
* Every `topic_id` in the response — in `items`, `deleted`, and any `errors` — is
|
|
33
|
-
* returned in Courier's canonical topic id form, regardless of the form supplied
|
|
34
|
-
* in the request.
|
|
22
|
+
* Replaces a user's entire set of preference overrides. Any topic you leave out is
|
|
23
|
+
* reset to its default, so send the full set rather than a subset.
|
|
35
24
|
*
|
|
36
25
|
* @example
|
|
37
26
|
* ```ts
|
|
@@ -52,23 +41,8 @@ export declare class Preferences extends APIResource {
|
|
|
52
41
|
*/
|
|
53
42
|
bulkReplace(userID: string, params: PreferenceBulkReplaceParams, options?: RequestOptions): APIPromise<PreferenceBulkReplaceResponse>;
|
|
54
43
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* created or updated; any existing overrides for topics not listed are left
|
|
58
|
-
* untouched.
|
|
59
|
-
*
|
|
60
|
-
* Structural validation of the request body fails fast with a single `400`. Beyond
|
|
61
|
-
* that, each topic is processed independently (partial-success, not
|
|
62
|
-
* all-or-nothing): valid topics are written and returned in `items`, while topics
|
|
63
|
-
* that cannot be applied are collected in `errors` with a per-topic `reason` (for
|
|
64
|
-
* example an unknown topic, a `REQUIRED` topic that cannot be opted out, a custom
|
|
65
|
-
* routing request that is not available on the workspace's plan, or a write
|
|
66
|
-
* failure). The request therefore returns `200` with both lists whenever the body
|
|
67
|
-
* is structurally valid.
|
|
68
|
-
*
|
|
69
|
-
* Every `topic_id` in the response — in both `items` and `errors` — is returned in
|
|
70
|
-
* Courier's canonical topic id form, regardless of the form supplied in the
|
|
71
|
-
* request.
|
|
44
|
+
* Adds or updates a user's preferences for several subscription topics at once.
|
|
45
|
+
* Topics you leave out keep whatever they were set to before.
|
|
72
46
|
*
|
|
73
47
|
* @example
|
|
74
48
|
* ```ts
|
|
@@ -93,9 +67,8 @@ export declare class Preferences extends APIResource {
|
|
|
93
67
|
*/
|
|
94
68
|
bulkUpdate(userID: string, params: PreferenceBulkUpdateParams, options?: RequestOptions): APIPromise<PreferenceBulkUpdateResponse>;
|
|
95
69
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* preference that does not exist succeeds with no error.
|
|
70
|
+
* Removes a user's override for one subscription topic, resetting it to the
|
|
71
|
+
* effective default from the tenant or workspace.
|
|
99
72
|
*
|
|
100
73
|
* @example
|
|
101
74
|
* ```ts
|
|
@@ -106,7 +79,8 @@ export declare class Preferences extends APIResource {
|
|
|
106
79
|
*/
|
|
107
80
|
deleteTopic(topicID: string, params: PreferenceDeleteTopicParams, options?: RequestOptions): APIPromise<void>;
|
|
108
81
|
/**
|
|
109
|
-
*
|
|
82
|
+
* Returns a user's opt-in status and channel choices for one subscription topic,
|
|
83
|
+
* or the effective default if they have set no override.
|
|
110
84
|
*
|
|
111
85
|
* @example
|
|
112
86
|
* ```ts
|
|
@@ -118,7 +92,8 @@ export declare class Preferences extends APIResource {
|
|
|
118
92
|
*/
|
|
119
93
|
retrieveTopic(topicID: string, params: PreferenceRetrieveTopicParams, options?: RequestOptions): APIPromise<PreferenceRetrieveTopicResponse>;
|
|
120
94
|
/**
|
|
121
|
-
*
|
|
95
|
+
* Sets a user's opt-in status and channel choices for one subscription topic,
|
|
96
|
+
* overriding the tenant default for that topic only.
|
|
122
97
|
*
|
|
123
98
|
* @example
|
|
124
99
|
* ```ts
|
|
@@ -152,14 +127,35 @@ export interface BulkPreferenceTopic {
|
|
|
152
127
|
topic_id: string;
|
|
153
128
|
}
|
|
154
129
|
export interface TopicPreference {
|
|
130
|
+
/**
|
|
131
|
+
* The topic's default status, returned on reads. It applies whenever the user has
|
|
132
|
+
* no override of their own (status equals this value).
|
|
133
|
+
*/
|
|
155
134
|
default_status: Shared.PreferenceStatus;
|
|
135
|
+
/**
|
|
136
|
+
* The user's subscription status for this topic. OPTED_IN or OPTED_OUT reflect the
|
|
137
|
+
* user's own choice; REQUIRED is a topic-level default set in the preferences
|
|
138
|
+
* editor, not a user choice.
|
|
139
|
+
*/
|
|
156
140
|
status: Shared.PreferenceStatus;
|
|
141
|
+
/**
|
|
142
|
+
* The unique identifier of the subscription topic this preference applies to.
|
|
143
|
+
*/
|
|
157
144
|
topic_id: string;
|
|
145
|
+
/**
|
|
146
|
+
* The display name of the subscription topic, returned on reads.
|
|
147
|
+
*/
|
|
158
148
|
topic_name: string;
|
|
159
149
|
/**
|
|
160
|
-
* The
|
|
150
|
+
* The channels the user has chosen to receive this topic on, present only when
|
|
151
|
+
* has_custom_routing is true. One or more of: direct_message, email, push, sms,
|
|
152
|
+
* webhook, inbox.
|
|
161
153
|
*/
|
|
162
154
|
custom_routing?: Array<Shared.ChannelClassification> | null;
|
|
155
|
+
/**
|
|
156
|
+
* Whether the user has chosen specific delivery channels for this topic (listed in
|
|
157
|
+
* custom_routing) rather than the topic's default routing.
|
|
158
|
+
*/
|
|
163
159
|
has_custom_routing?: boolean | null;
|
|
164
160
|
}
|
|
165
161
|
export interface PreferenceRetrieveResponse {
|
|
@@ -258,6 +254,22 @@ export interface PreferenceBulkUpdateParams {
|
|
|
258
254
|
* Query param: Update the preferences of a user for this specific tenant context.
|
|
259
255
|
*/
|
|
260
256
|
tenant_id?: string | null;
|
|
257
|
+
/**
|
|
258
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
259
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
260
|
+
* response from the first request without performing the operation again
|
|
261
|
+
* (including the original status code and any error). Use it to safely retry
|
|
262
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
263
|
+
* is scoped to this endpoint.
|
|
264
|
+
*/
|
|
265
|
+
'Idempotency-Key'?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
268
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
269
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
270
|
+
* maximum is 1 year.
|
|
271
|
+
*/
|
|
272
|
+
'x-idempotency-expiration'?: string;
|
|
261
273
|
}
|
|
262
274
|
export declare namespace PreferenceBulkUpdateParams {
|
|
263
275
|
interface Topic {
|
|
@@ -318,11 +330,21 @@ export interface PreferenceUpdateOrCreateTopicParams {
|
|
|
318
330
|
}
|
|
319
331
|
export declare namespace PreferenceUpdateOrCreateTopicParams {
|
|
320
332
|
interface Topic {
|
|
333
|
+
/**
|
|
334
|
+
* The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level
|
|
335
|
+
* default, not a user choice; the API rejects opting a user out of a REQUIRED
|
|
336
|
+
* topic.
|
|
337
|
+
*/
|
|
321
338
|
status: Shared.PreferenceStatus;
|
|
322
339
|
/**
|
|
323
|
-
* The
|
|
340
|
+
* The channels to deliver this topic on when has_custom_routing is true. One or
|
|
341
|
+
* more of: direct_message, email, push, sms, webhook, inbox.
|
|
324
342
|
*/
|
|
325
343
|
custom_routing?: Array<Shared.ChannelClassification> | null;
|
|
344
|
+
/**
|
|
345
|
+
* Set to true to route this topic to the channels in custom_routing instead of the
|
|
346
|
+
* topic's default routing.
|
|
347
|
+
*/
|
|
326
348
|
has_custom_routing?: boolean | null;
|
|
327
349
|
}
|
|
328
350
|
}
|