@trycourier/courier 7.8.0 → 7.9.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 +16 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +35 -0
- package/resources/notifications/checks.d.mts.map +1 -1
- package/resources/notifications/checks.d.ts +35 -0
- package/resources/notifications/checks.d.ts.map +1 -1
- package/resources/notifications/checks.js +35 -0
- package/resources/notifications/checks.js.map +1 -1
- package/resources/notifications/checks.mjs +35 -0
- package/resources/notifications/checks.mjs.map +1 -1
- package/resources/notifications/draft.d.mts +7 -0
- package/resources/notifications/draft.d.mts.map +1 -1
- package/resources/notifications/draft.d.ts +7 -0
- package/resources/notifications/draft.d.ts.map +1 -1
- package/resources/notifications/draft.js +7 -0
- package/resources/notifications/draft.js.map +1 -1
- package/resources/notifications/draft.mjs +7 -0
- package/resources/notifications/draft.mjs.map +1 -1
- package/resources/notifications/index.d.mts +1 -1
- package/resources/notifications/index.d.mts.map +1 -1
- package/resources/notifications/index.d.ts +1 -1
- package/resources/notifications/index.d.ts.map +1 -1
- package/resources/notifications/index.js.map +1 -1
- package/resources/notifications/index.mjs.map +1 -1
- package/resources/notifications/notifications.d.mts +369 -6
- package/resources/notifications/notifications.d.mts.map +1 -1
- package/resources/notifications/notifications.d.ts +369 -6
- package/resources/notifications/notifications.d.ts.map +1 -1
- package/resources/notifications/notifications.js +122 -0
- package/resources/notifications/notifications.js.map +1 -1
- package/resources/notifications/notifications.mjs +122 -0
- package/resources/notifications/notifications.mjs.map +1 -1
- package/resources/providers/catalog.d.mts +40 -0
- package/resources/providers/catalog.d.mts.map +1 -0
- package/resources/providers/catalog.d.ts +40 -0
- package/resources/providers/catalog.d.ts.map +1 -0
- package/resources/providers/catalog.js +18 -0
- package/resources/providers/catalog.js.map +1 -0
- package/resources/providers/catalog.mjs +14 -0
- package/resources/providers/catalog.mjs.map +1 -0
- package/resources/providers/index.d.mts +3 -0
- package/resources/providers/index.d.mts.map +1 -0
- package/resources/providers/index.d.ts +3 -0
- package/resources/providers/index.d.ts.map +1 -0
- package/resources/providers/index.js +9 -0
- package/resources/providers/index.js.map +1 -0
- package/resources/providers/index.mjs +4 -0
- package/resources/providers/index.mjs.map +1 -0
- package/resources/providers/providers.d.mts +182 -0
- package/resources/providers/providers.d.mts.map +1 -0
- package/resources/providers/providers.d.ts +182 -0
- package/resources/providers/providers.d.ts.map +1 -0
- package/resources/providers/providers.js +57 -0
- package/resources/providers/providers.js.map +1 -0
- package/resources/providers/providers.mjs +52 -0
- package/resources/providers/providers.mjs.map +1 -0
- package/resources/providers.d.mts +2 -0
- package/resources/providers.d.mts.map +1 -0
- package/resources/providers.d.ts +2 -0
- package/resources/providers.d.ts.map +1 -0
- package/resources/providers.js +6 -0
- package/resources/providers.js.map +1 -0
- package/resources/providers.mjs +3 -0
- package/resources/providers.mjs.map +1 -0
- package/resources/routing-strategies.d.mts +304 -0
- package/resources/routing-strategies.d.mts.map +1 -0
- package/resources/routing-strategies.d.ts +304 -0
- package/resources/routing-strategies.d.ts.map +1 -0
- package/resources/routing-strategies.js +94 -0
- package/resources/routing-strategies.js.map +1 -0
- package/resources/routing-strategies.mjs +90 -0
- package/resources/routing-strategies.mjs.map +1 -0
- package/resources/send.d.mts +2 -60
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts +2 -60
- package/resources/send.d.ts.map +1 -1
- package/resources/shared.d.mts +60 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +60 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/tenants/tenants.d.mts +2 -62
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +2 -62
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs.map +1 -1
- package/src/client.ts +84 -0
- package/src/resources/index.ts +35 -0
- package/src/resources/notifications/checks.ts +35 -0
- package/src/resources/notifications/draft.ts +7 -0
- package/src/resources/notifications/index.ts +14 -0
- package/src/resources/notifications/notifications.ts +474 -5
- package/src/resources/providers/catalog.ts +53 -0
- package/src/resources/providers/index.ts +12 -0
- package/src/resources/providers/providers.ts +240 -0
- package/src/resources/providers.ts +3 -0
- package/src/resources/routing-strategies.ts +394 -0
- package/src/resources/send.ts +2 -67
- package/src/resources/shared.ts +71 -1
- package/src/resources/tenants/tenants.ts +2 -69
- 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
|
@@ -55,7 +55,7 @@ export namespace SendMessageParams {
|
|
|
55
55
|
* Define run-time configuration for channels. Valid ChannelId's: email, sms, push,
|
|
56
56
|
* inbox, direct_message, banner, webhook.
|
|
57
57
|
*/
|
|
58
|
-
channels?:
|
|
58
|
+
channels?: Shared.MessageChannels | null;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Describes content that will work for email, inbox, push, chat, or any channel
|
|
@@ -75,7 +75,7 @@ export namespace SendMessageParams {
|
|
|
75
75
|
|
|
76
76
|
preferences?: Message.Preferences | null;
|
|
77
77
|
|
|
78
|
-
providers?:
|
|
78
|
+
providers?: Shared.MessageProviders | null;
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* Customize which channels/providers Courier may deliver the message through.
|
|
@@ -112,49 +112,6 @@ export namespace SendMessageParams {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export namespace Message {
|
|
115
|
-
export interface Channels {
|
|
116
|
-
/**
|
|
117
|
-
* Brand id used for rendering.
|
|
118
|
-
*/
|
|
119
|
-
brand_id?: string | null;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* JS conditional with access to data/profile.
|
|
123
|
-
*/
|
|
124
|
-
if?: string | null;
|
|
125
|
-
|
|
126
|
-
metadata?: Channels.Metadata | null;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Channel specific overrides.
|
|
130
|
-
*/
|
|
131
|
-
override?: { [key: string]: unknown } | null;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Providers enabled for this channel.
|
|
135
|
-
*/
|
|
136
|
-
providers?: Array<string> | null;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Defaults to `single`.
|
|
140
|
-
*/
|
|
141
|
-
routing_method?: 'all' | 'single' | null;
|
|
142
|
-
|
|
143
|
-
timeouts?: Channels.Timeouts | null;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export namespace Channels {
|
|
147
|
-
export interface Metadata {
|
|
148
|
-
utm?: Shared.Utm | null;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export interface Timeouts {
|
|
152
|
-
channel?: number | null;
|
|
153
|
-
|
|
154
|
-
provider?: number | null;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
115
|
export interface Delay {
|
|
159
116
|
/**
|
|
160
117
|
* The duration of the delay in milliseconds.
|
|
@@ -203,28 +160,6 @@ export namespace SendMessageParams {
|
|
|
203
160
|
subscription_topic_id: string;
|
|
204
161
|
}
|
|
205
162
|
|
|
206
|
-
export interface Providers {
|
|
207
|
-
/**
|
|
208
|
-
* JS conditional with access to data/profile.
|
|
209
|
-
*/
|
|
210
|
-
if?: string | null;
|
|
211
|
-
|
|
212
|
-
metadata?: Providers.Metadata | null;
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Provider-specific overrides.
|
|
216
|
-
*/
|
|
217
|
-
override?: { [key: string]: unknown } | null;
|
|
218
|
-
|
|
219
|
-
timeouts?: number | null;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export namespace Providers {
|
|
223
|
-
export interface Metadata {
|
|
224
|
-
utm?: Shared.Utm | null;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
163
|
/**
|
|
229
164
|
* Customize which channels/providers Courier may deliver the message through.
|
|
230
165
|
*/
|
package/src/resources/shared.ts
CHANGED
|
@@ -50,8 +50,43 @@ export interface AudienceRecipient {
|
|
|
50
50
|
filters?: Array<AudienceFilter> | null;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
export interface Channel {
|
|
54
|
+
/**
|
|
55
|
+
* Brand id used for rendering.
|
|
56
|
+
*/
|
|
57
|
+
brand_id?: string | null;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* JS conditional with access to data/profile.
|
|
61
|
+
*/
|
|
62
|
+
if?: string | null;
|
|
63
|
+
|
|
64
|
+
metadata?: ChannelMetadata | null;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Channel specific overrides.
|
|
68
|
+
*/
|
|
69
|
+
override?: { [key: string]: unknown } | null;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Providers enabled for this channel.
|
|
73
|
+
*/
|
|
74
|
+
providers?: Array<string> | null;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Defaults to `single`.
|
|
78
|
+
*/
|
|
79
|
+
routing_method?: 'all' | 'single' | null;
|
|
80
|
+
|
|
81
|
+
timeouts?: Timeouts | null;
|
|
82
|
+
}
|
|
83
|
+
|
|
53
84
|
export type ChannelClassification = 'direct_message' | 'email' | 'push' | 'sms' | 'webhook' | 'inbox';
|
|
54
85
|
|
|
86
|
+
export interface ChannelMetadata {
|
|
87
|
+
utm?: Utm | null;
|
|
88
|
+
}
|
|
89
|
+
|
|
55
90
|
export interface ChannelPreference {
|
|
56
91
|
channel: ChannelClassification;
|
|
57
92
|
}
|
|
@@ -144,6 +179,10 @@ export interface ElementalDividerNodeWithType extends ElementalBaseNode {
|
|
|
144
179
|
type?: 'divider';
|
|
145
180
|
}
|
|
146
181
|
|
|
182
|
+
export interface ElementalHTMLNodeWithType extends ElementalBaseNode {
|
|
183
|
+
type?: 'html';
|
|
184
|
+
}
|
|
185
|
+
|
|
147
186
|
export interface ElementalImageNodeWithType extends ElementalBaseNode {
|
|
148
187
|
type?: 'image';
|
|
149
188
|
}
|
|
@@ -171,7 +210,8 @@ export type ElementalNode =
|
|
|
171
210
|
| ElementalImageNodeWithType
|
|
172
211
|
| ElementalActionNodeWithType
|
|
173
212
|
| ElementalDividerNodeWithType
|
|
174
|
-
| ElementalQuoteNodeWithType
|
|
213
|
+
| ElementalQuoteNodeWithType
|
|
214
|
+
| ElementalHTMLNodeWithType;
|
|
175
215
|
|
|
176
216
|
export interface ElementalQuoteNodeWithType extends ElementalBaseNode {
|
|
177
217
|
type?: 'quote';
|
|
@@ -256,6 +296,8 @@ export interface ListRecipient {
|
|
|
256
296
|
list_id?: string | null;
|
|
257
297
|
}
|
|
258
298
|
|
|
299
|
+
export type MessageChannels = { [key: string]: Channel };
|
|
300
|
+
|
|
259
301
|
export interface MessageContext {
|
|
260
302
|
/**
|
|
261
303
|
* Tenant id used to load brand/default preferences/context.
|
|
@@ -263,6 +305,24 @@ export interface MessageContext {
|
|
|
263
305
|
tenant_id?: string | null;
|
|
264
306
|
}
|
|
265
307
|
|
|
308
|
+
export type MessageProviders = { [key: string]: MessageProvidersType };
|
|
309
|
+
|
|
310
|
+
export interface MessageProvidersType {
|
|
311
|
+
/**
|
|
312
|
+
* JS conditional with access to data/profile.
|
|
313
|
+
*/
|
|
314
|
+
if?: string | null;
|
|
315
|
+
|
|
316
|
+
metadata?: Metadata | null;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Provider-specific overrides.
|
|
320
|
+
*/
|
|
321
|
+
override?: { [key: string]: unknown } | null;
|
|
322
|
+
|
|
323
|
+
timeouts?: number | null;
|
|
324
|
+
}
|
|
325
|
+
|
|
266
326
|
export interface MessageRouting {
|
|
267
327
|
channels: Array<MessageRoutingChannel>;
|
|
268
328
|
|
|
@@ -271,6 +331,10 @@ export interface MessageRouting {
|
|
|
271
331
|
|
|
272
332
|
export type MessageRoutingChannel = string | MessageRouting;
|
|
273
333
|
|
|
334
|
+
export interface Metadata {
|
|
335
|
+
utm?: Utm | null;
|
|
336
|
+
}
|
|
337
|
+
|
|
274
338
|
export type MsTeams =
|
|
275
339
|
| SendToMsTeamsUserID
|
|
276
340
|
| SendToMsTeamsEmail
|
|
@@ -433,6 +497,12 @@ export interface SlackRecipient {
|
|
|
433
497
|
|
|
434
498
|
export type TextStyle = 'text' | 'h1' | 'h2' | 'subtext';
|
|
435
499
|
|
|
500
|
+
export interface Timeouts {
|
|
501
|
+
channel?: number | null;
|
|
502
|
+
|
|
503
|
+
provider?: number | null;
|
|
504
|
+
}
|
|
505
|
+
|
|
436
506
|
export interface Token {
|
|
437
507
|
token: string;
|
|
438
508
|
}
|
|
@@ -293,13 +293,13 @@ export interface TenantTemplateInput {
|
|
|
293
293
|
/**
|
|
294
294
|
* Channel-specific delivery configuration (email, SMS, push, etc.)
|
|
295
295
|
*/
|
|
296
|
-
channels?:
|
|
296
|
+
channels?: Shared.MessageChannels;
|
|
297
297
|
|
|
298
298
|
/**
|
|
299
299
|
* Provider-specific delivery configuration for routing to specific email/SMS
|
|
300
300
|
* providers
|
|
301
301
|
*/
|
|
302
|
-
providers?:
|
|
302
|
+
providers?: Shared.MessageProviders;
|
|
303
303
|
|
|
304
304
|
/**
|
|
305
305
|
* Message routing configuration for multi-channel delivery strategies
|
|
@@ -307,73 +307,6 @@ export interface TenantTemplateInput {
|
|
|
307
307
|
routing?: Shared.MessageRouting;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
export namespace TenantTemplateInput {
|
|
311
|
-
export interface Channels {
|
|
312
|
-
/**
|
|
313
|
-
* Brand id used for rendering.
|
|
314
|
-
*/
|
|
315
|
-
brand_id?: string | null;
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* JS conditional with access to data/profile.
|
|
319
|
-
*/
|
|
320
|
-
if?: string | null;
|
|
321
|
-
|
|
322
|
-
metadata?: Channels.Metadata | null;
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Channel specific overrides.
|
|
326
|
-
*/
|
|
327
|
-
override?: { [key: string]: unknown } | null;
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* Providers enabled for this channel.
|
|
331
|
-
*/
|
|
332
|
-
providers?: Array<string> | null;
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Defaults to `single`.
|
|
336
|
-
*/
|
|
337
|
-
routing_method?: 'all' | 'single' | null;
|
|
338
|
-
|
|
339
|
-
timeouts?: Channels.Timeouts | null;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
export namespace Channels {
|
|
343
|
-
export interface Metadata {
|
|
344
|
-
utm?: Shared.Utm | null;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
export interface Timeouts {
|
|
348
|
-
channel?: number | null;
|
|
349
|
-
|
|
350
|
-
provider?: number | null;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
export interface Providers {
|
|
355
|
-
/**
|
|
356
|
-
* JS conditional with access to data/profile.
|
|
357
|
-
*/
|
|
358
|
-
if?: string | null;
|
|
359
|
-
|
|
360
|
-
metadata?: Providers.Metadata | null;
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Provider-specific overrides.
|
|
364
|
-
*/
|
|
365
|
-
override?: { [key: string]: unknown } | null;
|
|
366
|
-
|
|
367
|
-
timeouts?: number | null;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
export namespace Providers {
|
|
371
|
-
export interface Metadata {
|
|
372
|
-
utm?: Shared.Utm | null;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
310
|
export interface TenantListResponse {
|
|
378
311
|
/**
|
|
379
312
|
* Set to true when there are more pages that can be retrieved.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '7.
|
|
1
|
+
export const VERSION = '7.9.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "7.
|
|
1
|
+
export declare const VERSION = "7.9.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "7.
|
|
1
|
+
export declare const VERSION = "7.9.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '7.
|
|
1
|
+
export const VERSION = '7.9.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|