@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
|
@@ -3,6 +3,9 @@ import * as Shared from "./shared.js";
|
|
|
3
3
|
import * as NotificationsAPI from "./notifications/notifications.js";
|
|
4
4
|
import { APIPromise } from "../core/api-promise.js";
|
|
5
5
|
import { RequestOptions } from "../internal/request-options.js";
|
|
6
|
+
/**
|
|
7
|
+
* Define reusable channel routing and failover strategies, and see which templates use them.
|
|
8
|
+
*/
|
|
6
9
|
export declare class RoutingStrategies extends APIResource {
|
|
7
10
|
/**
|
|
8
11
|
* Create a routing strategy. Requires a name and routing configuration at minimum.
|
|
@@ -22,10 +25,10 @@ export declare class RoutingStrategies extends APIResource {
|
|
|
22
25
|
* });
|
|
23
26
|
* ```
|
|
24
27
|
*/
|
|
25
|
-
create(
|
|
28
|
+
create(params: RoutingStrategyCreateParams, options?: RequestOptions): APIPromise<RoutingStrategyGetResponse>;
|
|
26
29
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
30
|
+
* Returns one routing strategy by id with its name, tags, channels, and the
|
|
31
|
+
* routing rules that decide provider order and fallback.
|
|
29
32
|
*
|
|
30
33
|
* @example
|
|
31
34
|
* ```ts
|
|
@@ -57,8 +60,8 @@ export declare class RoutingStrategies extends APIResource {
|
|
|
57
60
|
*/
|
|
58
61
|
archive(id: string, options?: RequestOptions): APIPromise<void>;
|
|
59
62
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
63
|
+
* Returns the notification templates using a routing strategy, with paging. Check
|
|
64
|
+
* this before changing a strategy that templates depend on.
|
|
62
65
|
*
|
|
63
66
|
* @example
|
|
64
67
|
* ```ts
|
|
@@ -248,29 +251,45 @@ export interface RoutingStrategySummary {
|
|
|
248
251
|
}
|
|
249
252
|
export interface RoutingStrategyCreateParams {
|
|
250
253
|
/**
|
|
251
|
-
* Human-readable name for the routing strategy.
|
|
254
|
+
* Body param: Human-readable name for the routing strategy.
|
|
252
255
|
*/
|
|
253
256
|
name: string;
|
|
254
257
|
/**
|
|
255
|
-
* Routing tree defining channel selection method and order.
|
|
258
|
+
* Body param: Routing tree defining channel selection method and order.
|
|
256
259
|
*/
|
|
257
260
|
routing: Shared.MessageRouting;
|
|
258
261
|
/**
|
|
259
|
-
* Per-channel delivery configuration. Defaults to empty if omitted.
|
|
262
|
+
* Body param: Per-channel delivery configuration. Defaults to empty if omitted.
|
|
260
263
|
*/
|
|
261
264
|
channels?: Shared.MessageChannels | null;
|
|
262
265
|
/**
|
|
263
|
-
* Optional description of the routing strategy.
|
|
266
|
+
* Body param: Optional description of the routing strategy.
|
|
264
267
|
*/
|
|
265
268
|
description?: string | null;
|
|
266
269
|
/**
|
|
267
|
-
* Per-provider delivery configuration. Defaults to empty if omitted.
|
|
270
|
+
* Body param: Per-provider delivery configuration. Defaults to empty if omitted.
|
|
268
271
|
*/
|
|
269
272
|
providers?: Shared.MessageProviders | null;
|
|
270
273
|
/**
|
|
271
|
-
* Optional tags for categorization.
|
|
274
|
+
* Body param: Optional tags for categorization.
|
|
272
275
|
*/
|
|
273
276
|
tags?: Array<string> | null;
|
|
277
|
+
/**
|
|
278
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
279
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
280
|
+
* response from the first request without performing the operation again
|
|
281
|
+
* (including the original status code and any error). Use it to safely retry
|
|
282
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
283
|
+
* is scoped to this endpoint.
|
|
284
|
+
*/
|
|
285
|
+
'Idempotency-Key'?: string;
|
|
286
|
+
/**
|
|
287
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
288
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
289
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
290
|
+
* maximum is 1 year.
|
|
291
|
+
*/
|
|
292
|
+
'x-idempotency-expiration'?: string;
|
|
274
293
|
}
|
|
275
294
|
export interface RoutingStrategyListParams {
|
|
276
295
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing-strategies.d.ts","sourceRoot":"","sources":["../src/resources/routing-strategies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,KAAK,gBAAgB,yCAAsC;AAClE,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,iBAAkB,SAAQ,WAAW;IAChD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,
|
|
1
|
+
{"version":3,"file":"routing-strategies.d.ts","sourceRoot":"","sources":["../src/resources/routing-strategies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,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sC,IAAI,sCAAsC,EACrF,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -5,6 +5,9 @@ exports.RoutingStrategies = 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
|
+
* Define reusable channel routing and failover strategies, and see which templates use them.
|
|
10
|
+
*/
|
|
8
11
|
class RoutingStrategies extends resource_1.APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* Create a routing strategy. Requires a name and routing configuration at minimum.
|
|
@@ -24,12 +27,25 @@ class RoutingStrategies extends resource_1.APIResource {
|
|
|
24
27
|
* });
|
|
25
28
|
* ```
|
|
26
29
|
*/
|
|
27
|
-
create(
|
|
28
|
-
|
|
30
|
+
create(params, options) {
|
|
31
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-idempotency-expiration': xIdempotencyExpiration, ...body } = params;
|
|
32
|
+
return this._client.post('/routing-strategies', {
|
|
33
|
+
body,
|
|
34
|
+
...options,
|
|
35
|
+
headers: (0, headers_1.buildHeaders)([
|
|
36
|
+
{
|
|
37
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
38
|
+
...(xIdempotencyExpiration != null ?
|
|
39
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
40
|
+
: undefined),
|
|
41
|
+
},
|
|
42
|
+
options?.headers,
|
|
43
|
+
]),
|
|
44
|
+
});
|
|
29
45
|
}
|
|
30
46
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
47
|
+
* Returns one routing strategy by id with its name, tags, channels, and the
|
|
48
|
+
* routing rules that decide provider order and fallback.
|
|
33
49
|
*
|
|
34
50
|
* @example
|
|
35
51
|
* ```ts
|
|
@@ -70,8 +86,8 @@ class RoutingStrategies extends resource_1.APIResource {
|
|
|
70
86
|
});
|
|
71
87
|
}
|
|
72
88
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
89
|
+
* Returns the notification templates using a routing strategy, with paging. Check
|
|
90
|
+
* this before changing a strategy that templates depend on.
|
|
75
91
|
*
|
|
76
92
|
* @example
|
|
77
93
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing-strategies.js","sourceRoot":"","sources":["../src/resources/routing-strategies.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,iBAAkB,SAAQ,sBAAW;IAChD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,
|
|
1
|
+
{"version":3,"file":"routing-strategies.js","sourceRoot":"","sources":["../src/resources/routing-strategies.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;GAEG;AACH,MAAa,iBAAkB,SAAQ,sBAAW;IAChD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,MAAmC,EACnC,OAAwB;QAExB,MAAM,EACJ,iBAAiB,EAAE,cAAc,EACjC,0BAA0B,EAAE,sBAAsB,EAClD,GAAG,IAAI,EACR,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE;YAC9C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC/E,GAAG,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC;wBAClC,EAAE,0BAA0B,EAAE,sBAAsB,EAAE;wBACxD,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC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
3
3
|
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Define reusable channel routing and failover strategies, and see which templates use them.
|
|
7
|
+
*/
|
|
5
8
|
export class RoutingStrategies extends APIResource {
|
|
6
9
|
/**
|
|
7
10
|
* Create a routing strategy. Requires a name and routing configuration at minimum.
|
|
@@ -21,12 +24,25 @@ export class RoutingStrategies extends APIResource {
|
|
|
21
24
|
* });
|
|
22
25
|
* ```
|
|
23
26
|
*/
|
|
24
|
-
create(
|
|
25
|
-
|
|
27
|
+
create(params, options) {
|
|
28
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-idempotency-expiration': xIdempotencyExpiration, ...body } = params;
|
|
29
|
+
return this._client.post('/routing-strategies', {
|
|
30
|
+
body,
|
|
31
|
+
...options,
|
|
32
|
+
headers: buildHeaders([
|
|
33
|
+
{
|
|
34
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
35
|
+
...(xIdempotencyExpiration != null ?
|
|
36
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
37
|
+
: undefined),
|
|
38
|
+
},
|
|
39
|
+
options?.headers,
|
|
40
|
+
]),
|
|
41
|
+
});
|
|
26
42
|
}
|
|
27
43
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
44
|
+
* Returns one routing strategy by id with its name, tags, channels, and the
|
|
45
|
+
* routing rules that decide provider order and fallback.
|
|
30
46
|
*
|
|
31
47
|
* @example
|
|
32
48
|
* ```ts
|
|
@@ -67,8 +83,8 @@ export class RoutingStrategies extends APIResource {
|
|
|
67
83
|
});
|
|
68
84
|
}
|
|
69
85
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
86
|
+
* Returns the notification templates using a routing strategy, with paging. Check
|
|
87
|
+
* this before changing a strategy that templates depend on.
|
|
72
88
|
*
|
|
73
89
|
* @example
|
|
74
90
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing-strategies.mjs","sourceRoot":"","sources":["../src/resources/routing-strategies.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,
|
|
1
|
+
{"version":3,"file":"routing-strategies.mjs","sourceRoot":"","sources":["../src/resources/routing-strategies.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,MAAmC,EACnC,OAAwB;QAExB,MAAM,EACJ,iBAAiB,EAAE,cAAc,EACjC,0BAA0B,EAAE,sBAAsB,EAClD,GAAG,IAAI,EACR,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE;YAC9C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC/E,GAAG,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC;wBAClC,EAAE,0BAA0B,EAAE,sBAAsB,EAAE;wBACxD,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAAsD,EAAE,EACxD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAU,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,uBAAuB,EAAE,EAAE,EAAE;YAC1D,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;;;;;;;;;OASG;IACH,iBAAiB,CACf,EAAU,EACV,QAAmE,EAAE,EACrE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,EAAE,gBAAgB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CACL,EAAU,EACV,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF"}
|
package/resources/send.d.mts
CHANGED
|
@@ -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
|
+
* Send a message to one or more recipients — users, lists, audiences, or tenants — across every channel you have configured.
|
|
7
|
+
*/
|
|
5
8
|
export declare class Send extends APIResource {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Sends a message to one or more recipients and returns a requestId. Courier
|
|
11
|
+
* routes it to email, SMS, push, chat, or in-app based on your rules.
|
|
8
12
|
*
|
|
9
13
|
* @example
|
|
10
14
|
* ```ts
|
|
@@ -17,7 +21,7 @@ export declare class Send extends APIResource {
|
|
|
17
21
|
* });
|
|
18
22
|
* ```
|
|
19
23
|
*/
|
|
20
|
-
message(
|
|
24
|
+
message(params: SendMessageParams, options?: RequestOptions): APIPromise<SendMessageResponse>;
|
|
21
25
|
}
|
|
22
26
|
export interface SendMessageResponse {
|
|
23
27
|
/**
|
|
@@ -30,10 +34,26 @@ export interface SendMessageResponse {
|
|
|
30
34
|
}
|
|
31
35
|
export interface SendMessageParams {
|
|
32
36
|
/**
|
|
33
|
-
* The message property has the following primary top-level properties.
|
|
34
|
-
* the destination and content of the message.
|
|
37
|
+
* Body param: The message property has the following primary top-level properties.
|
|
38
|
+
* They define the destination and content of the message.
|
|
35
39
|
*/
|
|
36
40
|
message: SendMessageParams.Message;
|
|
41
|
+
/**
|
|
42
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
43
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
44
|
+
* response from the first request without performing the operation again
|
|
45
|
+
* (including the original status code and any error). Use it to safely retry
|
|
46
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
47
|
+
* is scoped to this endpoint.
|
|
48
|
+
*/
|
|
49
|
+
'Idempotency-Key'?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
52
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
53
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
54
|
+
* maximum is 1 year.
|
|
55
|
+
*/
|
|
56
|
+
'x-idempotency-expiration'?: string;
|
|
37
57
|
}
|
|
38
58
|
export declare namespace SendMessageParams {
|
|
39
59
|
/**
|
package/resources/send.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.mts","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,MAAM,qBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAA4B;
|
|
1
|
+
{"version":3,"file":"send.d.mts","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,MAAM,qBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;GAEG;AACH,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;CAoB9F;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC;IAEnC;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,yBAAiB,iBAAiB,CAAC;IACjC;;;OAGG;IACH,UAAiB,OAAO;QACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAEzB;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,CA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AE,MAAM,GAAG,MAAM,CAAA;aAAE,GAAG,IAAI,CAAC;SAC7C;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACzG"}
|
package/resources/send.d.ts
CHANGED
|
@@ -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
|
+
* Send a message to one or more recipients — users, lists, audiences, or tenants — across every channel you have configured.
|
|
7
|
+
*/
|
|
5
8
|
export declare class Send extends APIResource {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Sends a message to one or more recipients and returns a requestId. Courier
|
|
11
|
+
* routes it to email, SMS, push, chat, or in-app based on your rules.
|
|
8
12
|
*
|
|
9
13
|
* @example
|
|
10
14
|
* ```ts
|
|
@@ -17,7 +21,7 @@ export declare class Send extends APIResource {
|
|
|
17
21
|
* });
|
|
18
22
|
* ```
|
|
19
23
|
*/
|
|
20
|
-
message(
|
|
24
|
+
message(params: SendMessageParams, options?: RequestOptions): APIPromise<SendMessageResponse>;
|
|
21
25
|
}
|
|
22
26
|
export interface SendMessageResponse {
|
|
23
27
|
/**
|
|
@@ -30,10 +34,26 @@ export interface SendMessageResponse {
|
|
|
30
34
|
}
|
|
31
35
|
export interface SendMessageParams {
|
|
32
36
|
/**
|
|
33
|
-
* The message property has the following primary top-level properties.
|
|
34
|
-
* the destination and content of the message.
|
|
37
|
+
* Body param: The message property has the following primary top-level properties.
|
|
38
|
+
* They define the destination and content of the message.
|
|
35
39
|
*/
|
|
36
40
|
message: SendMessageParams.Message;
|
|
41
|
+
/**
|
|
42
|
+
* Header param: A unique key that makes this request idempotent. If Courier
|
|
43
|
+
* receives another request with the same `Idempotency-Key`, it returns the stored
|
|
44
|
+
* response from the first request without performing the operation again
|
|
45
|
+
* (including the original status code and any error). Use it to safely retry
|
|
46
|
+
* `POST` requests after network failures without risking duplicate sends. The key
|
|
47
|
+
* is scoped to this endpoint.
|
|
48
|
+
*/
|
|
49
|
+
'Idempotency-Key'?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
52
|
+
* timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
53
|
+
* `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
54
|
+
* maximum is 1 year.
|
|
55
|
+
*/
|
|
56
|
+
'x-idempotency-expiration'?: string;
|
|
37
57
|
}
|
|
38
58
|
export declare namespace SendMessageParams {
|
|
39
59
|
/**
|
package/resources/send.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,+BAA4B;
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;GAEG;AACH,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;CAoB9F;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW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UAAiB,OAAO;YACtB,OAAO,CAAC,EAAE;gBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;aAAE,GAAG,IAAI,CAAC;YAE3C,QAAQ,CAAC,EAAE,eAAe,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC;YAEvE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAE3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAExB,QAAQ,CAAC,EAAE;gBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;aAAE,GAAG,IAAI,CAAC;SAC7C;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACzG"}
|
package/resources/send.js
CHANGED
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Send = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
/**
|
|
8
|
+
* Send a message to one or more recipients — users, lists, audiences, or tenants — across every channel you have configured.
|
|
9
|
+
*/
|
|
6
10
|
class Send extends resource_1.APIResource {
|
|
7
11
|
/**
|
|
8
|
-
*
|
|
12
|
+
* Sends a message to one or more recipients and returns a requestId. Courier
|
|
13
|
+
* routes it to email, SMS, push, chat, or in-app based on your rules.
|
|
9
14
|
*
|
|
10
15
|
* @example
|
|
11
16
|
* ```ts
|
|
@@ -18,8 +23,21 @@ class Send extends resource_1.APIResource {
|
|
|
18
23
|
* });
|
|
19
24
|
* ```
|
|
20
25
|
*/
|
|
21
|
-
message(
|
|
22
|
-
|
|
26
|
+
message(params, options) {
|
|
27
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-idempotency-expiration': xIdempotencyExpiration, ...body } = params;
|
|
28
|
+
return this._client.post('/send', {
|
|
29
|
+
body,
|
|
30
|
+
...options,
|
|
31
|
+
headers: (0, headers_1.buildHeaders)([
|
|
32
|
+
{
|
|
33
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
34
|
+
...(xIdempotencyExpiration != null ?
|
|
35
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
36
|
+
: undefined),
|
|
37
|
+
},
|
|
38
|
+
options?.headers,
|
|
39
|
+
]),
|
|
40
|
+
});
|
|
23
41
|
}
|
|
24
42
|
}
|
|
25
43
|
exports.Send = Send;
|
package/resources/send.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAGnD;;GAEG;AACH,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,MAAyB,EAAE,OAAwB;QACzD,MAAM,EACJ,iBAAiB,EAAE,cAAc,EACjC,0BAA0B,EAAE,sBAAsB,EAClD,GAAG,IAAI,EACR,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE;YAChC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC/E,GAAG,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC;wBAClC,EAAE,0BAA0B,EAAE,sBAAsB,EAAE;wBACxD,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AApCD,oBAoCC"}
|
package/resources/send.mjs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Send a message to one or more recipients — users, lists, audiences, or tenants — across every channel you have configured.
|
|
6
|
+
*/
|
|
3
7
|
export class Send extends APIResource {
|
|
4
8
|
/**
|
|
5
|
-
*
|
|
9
|
+
* Sends a message to one or more recipients and returns a requestId. Courier
|
|
10
|
+
* routes it to email, SMS, push, chat, or in-app based on your rules.
|
|
6
11
|
*
|
|
7
12
|
* @example
|
|
8
13
|
* ```ts
|
|
@@ -15,8 +20,21 @@ export class Send extends APIResource {
|
|
|
15
20
|
* });
|
|
16
21
|
* ```
|
|
17
22
|
*/
|
|
18
|
-
message(
|
|
19
|
-
|
|
23
|
+
message(params, options) {
|
|
24
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-idempotency-expiration': xIdempotencyExpiration, ...body } = params;
|
|
25
|
+
return this._client.post('/send', {
|
|
26
|
+
body,
|
|
27
|
+
...options,
|
|
28
|
+
headers: buildHeaders([
|
|
29
|
+
{
|
|
30
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
31
|
+
...(xIdempotencyExpiration != null ?
|
|
32
|
+
{ 'x-idempotency-expiration': xIdempotencyExpiration }
|
|
33
|
+
: undefined),
|
|
34
|
+
},
|
|
35
|
+
options?.headers,
|
|
36
|
+
]),
|
|
37
|
+
});
|
|
20
38
|
}
|
|
21
39
|
}
|
|
22
40
|
//# sourceMappingURL=send.mjs.map
|
package/resources/send.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.mjs","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;
|
|
1
|
+
{"version":3,"file":"send.mjs","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAGnD;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,MAAyB,EAAE,OAAwB;QACzD,MAAM,EACJ,iBAAiB,EAAE,cAAc,EACjC,0BAA0B,EAAE,sBAAsB,EAClD,GAAG,IAAI,EACR,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE;YAChC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC/E,GAAG,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC;wBAClC,EAAE,0BAA0B,EAAE,sBAAsB,EAAE;wBACxD,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,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
|
+
* Manage tenants — the organizations, teams, or accounts your users belong to — along with their users and default preferences.
|
|
7
|
+
*/
|
|
5
8
|
export declare class Items extends APIResource {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Sets a tenant's default opt-in status for one subscription topic, which applies
|
|
11
|
+
* to every member unless a user sets their own override.
|
|
8
12
|
*
|
|
9
13
|
* @example
|
|
10
14
|
* ```ts
|
|
@@ -18,7 +22,8 @@ export declare class Items extends APIResource {
|
|
|
18
22
|
*/
|
|
19
23
|
update(topicID: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
25
|
+
* Removes a tenant's default preference for one subscription topic, addressed by
|
|
26
|
+
* tenant id and topic id.
|
|
22
27
|
*
|
|
23
28
|
* @example
|
|
24
29
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.d.mts","sourceRoot":"","sources":["../../../src/resources/tenants/preferences/items.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,MAAM,yBAAqB;AACvC,OAAO,EAAE,UAAU,EAAE,sCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"items.d.mts","sourceRoot":"","sources":["../../../src/resources/tenants/preferences/items.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,MAAM,yBAAqB;AACvC,OAAO,EAAE,UAAU,EAAE,sCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAS7F;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAO9F;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;IAE9C;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC;IAE5D;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,CAAC;CACjG"}
|
|
@@ -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
|
+
* Manage tenants — the organizations, teams, or accounts your users belong to — along with their users and default preferences.
|
|
7
|
+
*/
|
|
5
8
|
export declare class Items extends APIResource {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Sets a tenant's default opt-in status for one subscription topic, which applies
|
|
11
|
+
* to every member unless a user sets their own override.
|
|
8
12
|
*
|
|
9
13
|
* @example
|
|
10
14
|
* ```ts
|
|
@@ -18,7 +22,8 @@ export declare class Items extends APIResource {
|
|
|
18
22
|
*/
|
|
19
23
|
update(topicID: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
25
|
+
* Removes a tenant's default preference for one subscription topic, addressed by
|
|
26
|
+
* tenant id and topic id.
|
|
22
27
|
*
|
|
23
28
|
* @example
|
|
24
29
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../src/resources/tenants/preferences/items.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,MAAM,wBAAqB;AACvC,OAAO,EAAE,UAAU,EAAE,qCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../src/resources/tenants/preferences/items.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,MAAM,wBAAqB;AACvC,OAAO,EAAE,UAAU,EAAE,qCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAS7F;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAO9F;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;IAE9C;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC;IAE5D;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,CAAC;CACjG"}
|
|
@@ -5,9 +5,13 @@ exports.Items = 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
|
+
* Manage tenants — the organizations, teams, or accounts your users belong to — along with their users and default preferences.
|
|
10
|
+
*/
|
|
8
11
|
class Items extends resource_1.APIResource {
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* Sets a tenant's default opt-in status for one subscription topic, which applies
|
|
14
|
+
* to every member unless a user sets their own override.
|
|
11
15
|
*
|
|
12
16
|
* @example
|
|
13
17
|
* ```ts
|
|
@@ -28,7 +32,8 @@ class Items extends resource_1.APIResource {
|
|
|
28
32
|
});
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
31
|
-
*
|
|
35
|
+
* Removes a tenant's default preference for one subscription topic, addressed by
|
|
36
|
+
* tenant id and topic id.
|
|
32
37
|
*
|
|
33
38
|
* @example
|
|
34
39
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../src/resources/tenants/preferences/items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,KAAM,SAAQ,sBAAW;IACpC
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../src/resources/tenants/preferences/items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,OAAe,EAAE,MAAwB,EAAE,OAAwB;QACxE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,SAAS,8BAA8B,OAAO,EAAE,EAAE;YACxF,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAe,EAAE,MAAwB,EAAE,OAAwB;QACxE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,YAAY,SAAS,8BAA8B,OAAO,EAAE,EAAE;YAC3F,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;AA1CD,sBA0CC"}
|
|
@@ -2,9 +2,13 @@
|
|
|
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
|
+
* Manage tenants — the organizations, teams, or accounts your users belong to — along with their users and default preferences.
|
|
7
|
+
*/
|
|
5
8
|
export class Items extends APIResource {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Sets a tenant's default opt-in status for one subscription topic, which applies
|
|
11
|
+
* to every member unless a user sets their own override.
|
|
8
12
|
*
|
|
9
13
|
* @example
|
|
10
14
|
* ```ts
|
|
@@ -25,7 +29,8 @@ export class Items extends APIResource {
|
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
28
|
-
*
|
|
32
|
+
* Removes a tenant's default preference for one subscription topic, addressed by
|
|
33
|
+
* tenant id and topic id.
|
|
29
34
|
*
|
|
30
35
|
* @example
|
|
31
36
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.mjs","sourceRoot":"","sources":["../../../src/resources/tenants/preferences/items.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"items.mjs","sourceRoot":"","sources":["../../../src/resources/tenants/preferences/items.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,OAAe,EAAE,MAAwB,EAAE,OAAwB;QACxE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,SAAS,8BAA8B,OAAO,EAAE,EAAE;YACxF,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,C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