@trycourier/courier 7.25.0 → 7.25.2
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 +20 -0
- package/README.md +0 -3
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audiences.d.mts +46 -0
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +46 -0
- package/resources/audiences.d.ts.map +1 -1
- package/resources/audiences.js +46 -0
- package/resources/audiences.js.map +1 -1
- package/resources/audiences.mjs +46 -0
- package/resources/audiences.mjs.map +1 -1
- package/resources/automations/invoke.d.mts +5 -1
- package/resources/automations/invoke.d.mts.map +1 -1
- package/resources/automations/invoke.d.ts +5 -1
- package/resources/automations/invoke.d.ts.map +1 -1
- package/resources/automations/invoke.js +5 -1
- package/resources/automations/invoke.js.map +1 -1
- package/resources/automations/invoke.mjs +5 -1
- package/resources/automations/invoke.mjs.map +1 -1
- package/resources/brands.d.mts +4 -1
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +4 -1
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.js +4 -1
- package/resources/brands.js.map +1 -1
- package/resources/brands.mjs +4 -1
- package/resources/brands.mjs.map +1 -1
- package/resources/bulk.d.mts +199 -0
- package/resources/bulk.d.mts.map +1 -0
- package/resources/bulk.d.ts +199 -0
- package/resources/bulk.d.ts.map +1 -0
- package/resources/bulk.js +102 -0
- package/resources/bulk.js.map +1 -0
- package/resources/bulk.mjs +98 -0
- package/resources/bulk.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/lists/lists.d.mts +3 -1
- package/resources/lists/lists.d.mts.map +1 -1
- package/resources/lists/lists.d.ts +3 -1
- package/resources/lists/lists.d.ts.map +1 -1
- package/resources/lists/lists.js +3 -1
- package/resources/lists/lists.js.map +1 -1
- package/resources/lists/lists.mjs +3 -1
- package/resources/lists/lists.mjs.map +1 -1
- package/resources/lists/subscriptions.d.mts +13 -2
- package/resources/lists/subscriptions.d.mts.map +1 -1
- package/resources/lists/subscriptions.d.ts +13 -2
- package/resources/lists/subscriptions.d.ts.map +1 -1
- package/resources/lists/subscriptions.js +13 -2
- package/resources/lists/subscriptions.js.map +1 -1
- package/resources/lists/subscriptions.mjs +13 -2
- package/resources/lists/subscriptions.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +2 -2
- package/resources/notifications/checks.d.ts +2 -2
- package/resources/notifications/checks.js +2 -2
- package/resources/notifications/checks.mjs +2 -2
- package/resources/profiles/lists.d.mts +1 -1
- package/resources/profiles/lists.d.ts +1 -1
- package/resources/profiles/lists.js +1 -1
- package/resources/profiles/lists.mjs +1 -1
- package/resources/profiles/profiles.d.mts +12 -5
- package/resources/profiles/profiles.d.mts.map +1 -1
- package/resources/profiles/profiles.d.ts +12 -5
- package/resources/profiles/profiles.d.ts.map +1 -1
- package/resources/profiles/profiles.js +12 -5
- package/resources/profiles/profiles.js.map +1 -1
- package/resources/profiles/profiles.mjs +12 -5
- package/resources/profiles/profiles.mjs.map +1 -1
- package/resources/providers/providers.d.mts +6 -2
- package/resources/providers/providers.d.mts.map +1 -1
- package/resources/providers/providers.d.ts +6 -2
- package/resources/providers/providers.d.ts.map +1 -1
- package/resources/providers/providers.js +6 -2
- package/resources/providers/providers.js.map +1 -1
- package/resources/providers/providers.mjs +6 -2
- package/resources/providers/providers.mjs.map +1 -1
- package/resources/send.d.mts +2 -1
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts +2 -1
- package/resources/send.d.ts.map +1 -1
- package/resources/send.js +2 -1
- package/resources/send.js.map +1 -1
- package/resources/send.mjs +2 -1
- package/resources/send.mjs.map +1 -1
- package/resources/tenants/templates/templates.d.mts +7 -1
- package/resources/tenants/templates/templates.d.mts.map +1 -1
- package/resources/tenants/templates/templates.d.ts +7 -1
- package/resources/tenants/templates/templates.d.ts.map +1 -1
- package/resources/tenants/templates/templates.js +7 -1
- package/resources/tenants/templates/templates.js.map +1 -1
- package/resources/tenants/templates/templates.mjs +7 -1
- package/resources/tenants/templates/templates.mjs.map +1 -1
- package/resources/tenants/tenants.d.mts +3 -1
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +3 -1
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js +3 -1
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs +3 -1
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/translations.d.mts +16 -0
- package/resources/translations.d.mts.map +1 -1
- package/resources/translations.d.ts +16 -0
- package/resources/translations.d.ts.map +1 -1
- package/resources/translations.js +16 -0
- package/resources/translations.js.map +1 -1
- package/resources/translations.mjs +16 -0
- package/resources/translations.mjs.map +1 -1
- package/resources/users/tenants.d.mts +5 -1
- package/resources/users/tenants.d.mts.map +1 -1
- package/resources/users/tenants.d.ts +5 -1
- package/resources/users/tenants.d.ts.map +1 -1
- package/resources/users/tenants.js +5 -1
- package/resources/users/tenants.js.map +1 -1
- package/resources/users/tenants.mjs +5 -1
- package/resources/users/tenants.mjs.map +1 -1
- package/resources/users/tokens.d.mts +8 -1
- package/resources/users/tokens.d.mts.map +1 -1
- package/resources/users/tokens.d.ts +8 -1
- package/resources/users/tokens.d.ts.map +1 -1
- package/resources/users/tokens.js +8 -1
- package/resources/users/tokens.js.map +1 -1
- package/resources/users/tokens.mjs +8 -1
- package/resources/users/tokens.mjs.map +1 -1
- package/resources/workspace-preferences/topics.d.mts +5 -2
- package/resources/workspace-preferences/topics.d.mts.map +1 -1
- package/resources/workspace-preferences/topics.d.ts +5 -2
- package/resources/workspace-preferences/topics.d.ts.map +1 -1
- package/resources/workspace-preferences/topics.js +5 -2
- package/resources/workspace-preferences/topics.js.map +1 -1
- package/resources/workspace-preferences/topics.mjs +5 -2
- package/resources/workspace-preferences/topics.mjs.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.d.mts +8 -2
- package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.d.ts +8 -2
- package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.js +8 -2
- package/resources/workspace-preferences/workspace-preferences.js.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.mjs +8 -2
- package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -1
- package/src/client.ts +25 -0
- package/src/resources/audiences.ts +46 -0
- package/src/resources/automations/invoke.ts +5 -1
- package/src/resources/brands.ts +4 -1
- package/src/resources/bulk.ts +254 -0
- package/src/resources/index.ts +11 -0
- package/src/resources/lists/lists.ts +3 -1
- package/src/resources/lists/subscriptions.ts +13 -2
- package/src/resources/notifications/checks.ts +2 -2
- package/src/resources/profiles/lists.ts +1 -1
- package/src/resources/profiles/profiles.ts +12 -5
- package/src/resources/providers/providers.ts +6 -2
- package/src/resources/send.ts +2 -1
- package/src/resources/tenants/templates/templates.ts +7 -1
- package/src/resources/tenants/tenants.ts +3 -1
- package/src/resources/translations.ts +16 -0
- package/src/resources/users/tenants.ts +5 -1
- package/src/resources/users/tokens.ts +8 -1
- package/src/resources/workspace-preferences/topics.ts +5 -2
- package/src/resources/workspace-preferences/workspace-preferences.ts +8 -2
- 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/src/resources/send.ts
CHANGED
|
@@ -12,7 +12,8 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
12
12
|
export class Send extends APIResource {
|
|
13
13
|
/**
|
|
14
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.
|
|
15
|
+
* routes it to email, SMS, push, chat, or in-app based on your rules. Use the
|
|
16
|
+
* returned requestId to look up delivery status via the Messages API.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* ```ts
|
|
@@ -84,6 +84,7 @@ export class Templates extends APIResource {
|
|
|
84
84
|
* const postTenantTemplatePublishResponse =
|
|
85
85
|
* await client.tenants.templates.publish('template_id', {
|
|
86
86
|
* tenant_id: 'tenant_id',
|
|
87
|
+
* version: 'latest',
|
|
87
88
|
* });
|
|
88
89
|
* ```
|
|
89
90
|
*/
|
|
@@ -109,8 +110,13 @@ export class Templates extends APIResource {
|
|
|
109
110
|
* await client.tenants.templates.replace('template_id', {
|
|
110
111
|
* tenant_id: 'tenant_id',
|
|
111
112
|
* template: {
|
|
112
|
-
* content: {
|
|
113
|
+
* content: {
|
|
114
|
+
* version: '2022-01-01',
|
|
115
|
+
* elements: [{ type: 'text' }],
|
|
116
|
+
* },
|
|
117
|
+
* routing: { method: 'single', channels: ['email'] },
|
|
113
118
|
* },
|
|
119
|
+
* published: true,
|
|
114
120
|
* });
|
|
115
121
|
* ```
|
|
116
122
|
*/
|
|
@@ -47,7 +47,9 @@ export class Tenants extends APIResource {
|
|
|
47
47
|
* @example
|
|
48
48
|
* ```ts
|
|
49
49
|
* const tenant = await client.tenants.update('tenant_id', {
|
|
50
|
-
* name: '
|
|
50
|
+
* name: 'Acme Corp',
|
|
51
|
+
* brand_id: 'bnd_01kx4mrd0pfzw8wt7pn7p2fzag',
|
|
52
|
+
* properties: { plan: 'enterprise' },
|
|
51
53
|
* });
|
|
52
54
|
* ```
|
|
53
55
|
*/
|
|
@@ -13,6 +13,14 @@ export class Translations extends APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* Returns the translation strings stored for one domain and locale, for use in
|
|
15
15
|
* localized notification content.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const translation = await client.translations.retrieve(
|
|
20
|
+
* 'locale',
|
|
21
|
+
* { domain: 'domain' },
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
16
24
|
*/
|
|
17
25
|
retrieve(locale: string, params: TranslationRetrieveParams, options?: RequestOptions): APIPromise<string> {
|
|
18
26
|
const { domain } = params;
|
|
@@ -22,6 +30,14 @@ export class Translations extends APIResource {
|
|
|
22
30
|
/**
|
|
23
31
|
* Uploads the translation strings for one domain and locale. Courier uses them to
|
|
24
32
|
* render localized content for recipients in that locale.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* await client.translations.update('locale', {
|
|
37
|
+
* domain: 'domain',
|
|
38
|
+
* body: 'msgid "Hello"\nmsgstr "Hola"',
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
25
41
|
*/
|
|
26
42
|
update(locale: string, params: TranslationUpdateParams, options?: RequestOptions): APIPromise<void> {
|
|
27
43
|
const { domain, body } = params;
|
|
@@ -35,7 +35,10 @@ export class Tenants extends APIResource {
|
|
|
35
35
|
* @example
|
|
36
36
|
* ```ts
|
|
37
37
|
* await client.users.tenants.addMultiple('user_id', {
|
|
38
|
-
* tenants: [
|
|
38
|
+
* tenants: [
|
|
39
|
+
* { tenant_id: 'tenant_abc' },
|
|
40
|
+
* { tenant_id: 'tenant_def' },
|
|
41
|
+
* ],
|
|
39
42
|
* });
|
|
40
43
|
* ```
|
|
41
44
|
*/
|
|
@@ -55,6 +58,7 @@ export class Tenants extends APIResource {
|
|
|
55
58
|
* ```ts
|
|
56
59
|
* await client.users.tenants.addSingle('tenant_id', {
|
|
57
60
|
* user_id: 'user_id',
|
|
61
|
+
* profile: { role: 'admin' },
|
|
58
62
|
* });
|
|
59
63
|
* ```
|
|
60
64
|
*/
|
|
@@ -38,7 +38,13 @@ export class Tokens extends APIResource {
|
|
|
38
38
|
* ```ts
|
|
39
39
|
* await client.users.tokens.update('token', {
|
|
40
40
|
* user_id: 'user_id',
|
|
41
|
-
* patch: [
|
|
41
|
+
* patch: [
|
|
42
|
+
* {
|
|
43
|
+
* op: 'replace',
|
|
44
|
+
* path: '/expiry_date',
|
|
45
|
+
* value: '2024-12-31T00:00:00.000Z',
|
|
46
|
+
* },
|
|
47
|
+
* ],
|
|
42
48
|
* });
|
|
43
49
|
* ```
|
|
44
50
|
*/
|
|
@@ -108,6 +114,7 @@ export class Tokens extends APIResource {
|
|
|
108
114
|
* await client.users.tokens.addSingle('token', {
|
|
109
115
|
* user_id: 'user_id',
|
|
110
116
|
* provider_key: 'firebase-fcm',
|
|
117
|
+
* device: { app_id: 'com.example.app' },
|
|
111
118
|
* });
|
|
112
119
|
* ```
|
|
113
120
|
*/
|
|
@@ -122,8 +122,11 @@ export class Topics extends APIResource {
|
|
|
122
122
|
* 'topic_id',
|
|
123
123
|
* {
|
|
124
124
|
* section_id: 'section_id',
|
|
125
|
-
* default_status: '
|
|
126
|
-
* name: '
|
|
125
|
+
* default_status: 'OPTED_IN',
|
|
126
|
+
* name: 'Product Updates',
|
|
127
|
+
* allowed_preferences: ['channel_preferences'],
|
|
128
|
+
* include_unsubscribe_header: true,
|
|
129
|
+
* routing_options: ['email', 'inbox'],
|
|
127
130
|
* },
|
|
128
131
|
* );
|
|
129
132
|
* ```
|
|
@@ -108,7 +108,11 @@ export class WorkspacePreferences extends APIResource {
|
|
|
108
108
|
* @example
|
|
109
109
|
* ```ts
|
|
110
110
|
* const publishPreferencesResponse =
|
|
111
|
-
* await client.workspacePreferences.publish(
|
|
111
|
+
* await client.workspacePreferences.publish({
|
|
112
|
+
* brand_id: 'bnd_01kx4mrd0pfzw8wt7pn7p2fzag',
|
|
113
|
+
* description: 'Choose what you hear from us about.',
|
|
114
|
+
* heading: 'Notification Preferences',
|
|
115
|
+
* });
|
|
112
116
|
* ```
|
|
113
117
|
*/
|
|
114
118
|
publish(
|
|
@@ -143,7 +147,9 @@ export class WorkspacePreferences extends APIResource {
|
|
|
143
147
|
* ```ts
|
|
144
148
|
* const workspacePreferenceGetResponse =
|
|
145
149
|
* await client.workspacePreferences.replace('section_id', {
|
|
146
|
-
* name: '
|
|
150
|
+
* name: 'Account Notifications',
|
|
151
|
+
* has_custom_routing: true,
|
|
152
|
+
* routing_options: ['email', 'push'],
|
|
147
153
|
* });
|
|
148
154
|
* ```
|
|
149
155
|
*/
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '7.25.
|
|
1
|
+
export const VERSION = '7.25.2'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "7.25.
|
|
1
|
+
export declare const VERSION = "7.25.2";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "7.25.
|
|
1
|
+
export declare const VERSION = "7.25.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '7.25.
|
|
1
|
+
export const VERSION = '7.25.2'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|