@trycourier/courier 6.6.1-alpha0 → 6.7.0-alpha10
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 +124 -0
- package/README.md +11 -11
- package/client.d.mts +48 -20
- package/client.d.mts.map +1 -1
- package/client.d.ts +48 -20
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +3 -3
- package/client.mjs.map +1 -1
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/internal/tslib.js +6 -6
- package/package.json +1 -1
- package/resources/audiences.d.mts +30 -52
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +30 -52
- package/resources/audiences.d.ts.map +1 -1
- package/resources/audiences.js.map +1 -1
- package/resources/audiences.mjs.map +1 -1
- package/resources/audit-events.d.mts +5 -9
- package/resources/audit-events.d.mts.map +1 -1
- package/resources/audit-events.d.ts +5 -9
- package/resources/audit-events.d.ts.map +1 -1
- package/resources/auth.d.mts +2 -2
- package/resources/auth.d.mts.map +1 -1
- package/resources/auth.d.ts +2 -2
- package/resources/auth.d.ts.map +1 -1
- package/resources/automations/automations.d.mts +5 -252
- package/resources/automations/automations.d.mts.map +1 -1
- package/resources/automations/automations.d.ts +5 -252
- package/resources/automations/automations.d.ts.map +1 -1
- package/resources/automations/automations.js +0 -42
- package/resources/automations/automations.js.map +1 -1
- package/resources/automations/automations.mjs +1 -43
- package/resources/automations/automations.mjs.map +1 -1
- package/resources/automations/index.d.mts +2 -2
- package/resources/automations/index.d.mts.map +1 -1
- package/resources/automations/index.d.ts +2 -2
- package/resources/automations/index.d.ts.map +1 -1
- package/resources/automations/index.js.map +1 -1
- package/resources/automations/index.mjs +2 -2
- package/resources/automations/index.mjs.map +1 -1
- package/resources/automations/invoke.d.mts +122 -9
- package/resources/automations/invoke.d.mts.map +1 -1
- package/resources/automations/invoke.d.ts +122 -9
- package/resources/automations/invoke.d.ts.map +1 -1
- package/resources/automations/invoke.js +45 -0
- package/resources/automations/invoke.js.map +1 -1
- package/resources/automations/invoke.mjs +45 -0
- package/resources/automations/invoke.mjs.map +1 -1
- package/resources/brands.d.mts +76 -52
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +76 -52
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.js.map +1 -1
- package/resources/brands.mjs.map +1 -1
- package/resources/bulk.d.mts +36 -127
- package/resources/bulk.d.mts.map +1 -1
- package/resources/bulk.d.ts +36 -127
- package/resources/bulk.d.ts.map +1 -1
- package/resources/bulk.js.map +1 -1
- package/resources/bulk.mjs.map +1 -1
- package/resources/inbound.d.mts +1 -1
- package/resources/inbound.d.ts +1 -1
- package/resources/index.d.mts +11 -10
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +11 -10
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -0
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/lists/index.d.mts +2 -2
- package/resources/lists/index.d.mts.map +1 -1
- package/resources/lists/index.d.ts +2 -2
- package/resources/lists/index.d.ts.map +1 -1
- package/resources/lists/index.js.map +1 -1
- package/resources/lists/index.mjs +1 -1
- package/resources/lists/index.mjs.map +1 -1
- package/resources/lists/lists.d.mts +19 -13
- package/resources/lists/lists.d.mts.map +1 -1
- package/resources/lists/lists.d.ts +19 -13
- package/resources/lists/lists.d.ts.map +1 -1
- package/resources/lists/lists.js +7 -2
- package/resources/lists/lists.js.map +1 -1
- package/resources/lists/lists.mjs +7 -2
- package/resources/lists/lists.mjs.map +1 -1
- package/resources/lists/subscriptions.d.mts +8 -52
- package/resources/lists/subscriptions.d.mts.map +1 -1
- package/resources/lists/subscriptions.d.ts +8 -52
- package/resources/lists/subscriptions.d.ts.map +1 -1
- package/resources/lists/subscriptions.js.map +1 -1
- package/resources/lists/subscriptions.mjs.map +1 -1
- package/resources/messages.d.mts +8 -8
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +8 -8
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +5 -12
- package/resources/notifications/checks.d.mts.map +1 -1
- package/resources/notifications/checks.d.ts +5 -12
- package/resources/notifications/checks.d.ts.map +1 -1
- package/resources/notifications/checks.js.map +1 -1
- package/resources/notifications/checks.mjs.map +1 -1
- package/resources/notifications/index.d.mts +2 -2
- package/resources/notifications/index.d.mts.map +1 -1
- package/resources/notifications/index.d.ts +2 -2
- 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 +13 -11
- package/resources/notifications/notifications.d.mts.map +1 -1
- package/resources/notifications/notifications.d.ts +13 -11
- package/resources/notifications/notifications.d.ts.map +1 -1
- package/resources/notifications/notifications.js.map +1 -1
- package/resources/notifications/notifications.mjs.map +1 -1
- package/resources/profiles/index.d.mts +1 -1
- package/resources/profiles/index.d.mts.map +1 -1
- package/resources/profiles/index.d.ts +1 -1
- package/resources/profiles/index.d.ts.map +1 -1
- package/resources/profiles/index.js.map +1 -1
- package/resources/profiles/index.mjs.map +1 -1
- package/resources/profiles/lists.d.mts +5 -11
- package/resources/profiles/lists.d.mts.map +1 -1
- package/resources/profiles/lists.d.ts +5 -11
- package/resources/profiles/lists.d.ts.map +1 -1
- package/resources/profiles/profiles.d.mts +7 -3
- package/resources/profiles/profiles.d.mts.map +1 -1
- package/resources/profiles/profiles.d.ts +7 -3
- package/resources/profiles/profiles.d.ts.map +1 -1
- package/resources/profiles/profiles.js.map +1 -1
- package/resources/profiles/profiles.mjs.map +1 -1
- package/resources/send.d.mts +127 -745
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts +127 -745
- package/resources/send.d.ts.map +1 -1
- package/resources/send.js +12 -1
- package/resources/send.js.map +1 -1
- package/resources/send.mjs +12 -1
- package/resources/send.mjs.map +1 -1
- package/resources/shared.d.mts +245 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +245 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/{src/resources/tenants/default-preferences.ts → resources/shared.mjs} +2 -2
- package/resources/shared.mjs.map +1 -0
- package/resources/tenants/index.d.mts +3 -1
- package/resources/tenants/index.d.mts.map +1 -1
- package/resources/tenants/index.d.ts +3 -1
- package/resources/tenants/index.d.ts.map +1 -1
- package/resources/tenants/index.js +5 -1
- package/resources/tenants/index.js.map +1 -1
- package/resources/tenants/index.mjs +2 -0
- package/resources/tenants/index.mjs.map +1 -1
- package/resources/tenants/templates.d.mts +91 -0
- package/resources/tenants/templates.d.mts.map +1 -0
- package/resources/tenants/templates.d.ts +91 -0
- package/resources/tenants/templates.d.ts.map +1 -0
- package/resources/tenants/templates.js +38 -0
- package/resources/tenants/templates.js.map +1 -0
- package/resources/tenants/templates.mjs +34 -0
- package/resources/tenants/templates.mjs.map +1 -0
- package/resources/tenants/tenant-default-preferences/index.d.mts +3 -0
- package/resources/tenants/tenant-default-preferences/index.d.mts.map +1 -0
- package/resources/tenants/tenant-default-preferences/index.d.ts +3 -0
- package/resources/tenants/tenant-default-preferences/index.d.ts.map +1 -0
- package/resources/tenants/tenant-default-preferences/index.js +9 -0
- package/resources/tenants/tenant-default-preferences/index.js.map +1 -0
- package/resources/tenants/tenant-default-preferences/index.mjs +4 -0
- package/resources/tenants/tenant-default-preferences/index.mjs.map +1 -0
- package/resources/tenants/{default-preferences → tenant-default-preferences}/items.d.mts +5 -18
- package/resources/tenants/tenant-default-preferences/items.d.mts.map +1 -0
- package/resources/tenants/{default-preferences → tenant-default-preferences}/items.d.ts +5 -18
- package/resources/tenants/tenant-default-preferences/items.d.ts.map +1 -0
- package/resources/tenants/{default-preferences → tenant-default-preferences}/items.js +2 -2
- package/resources/tenants/tenant-default-preferences/items.js.map +1 -0
- package/resources/tenants/{default-preferences → tenant-default-preferences}/items.mjs +2 -2
- package/resources/tenants/tenant-default-preferences/items.mjs.map +1 -0
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.mts +10 -0
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.mts.map +1 -0
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.ts +10 -0
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.ts.map +1 -0
- package/resources/tenants/{default-preferences/default-preferences.js → tenant-default-preferences/tenant-default-preferences.js} +5 -5
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.js.map +1 -0
- package/resources/tenants/{default-preferences/default-preferences.mjs → tenant-default-preferences/tenant-default-preferences.mjs} +4 -4
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.mjs.map +1 -0
- package/resources/tenants/tenant-default-preferences.d.mts +2 -0
- package/resources/tenants/tenant-default-preferences.d.mts.map +1 -0
- package/resources/tenants/tenant-default-preferences.d.ts +2 -0
- package/resources/tenants/tenant-default-preferences.d.ts.map +1 -0
- package/resources/tenants/{default-preferences.js → tenant-default-preferences.js} +2 -2
- package/resources/tenants/tenant-default-preferences.js.map +1 -0
- package/resources/tenants/tenant-default-preferences.mjs +3 -0
- package/resources/tenants/tenant-default-preferences.mjs.map +1 -0
- package/resources/tenants/tenants.d.mts +66 -7
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +66 -7
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js +8 -2
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs +8 -2
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/users/index.d.mts +3 -3
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts +3 -3
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.js.map +1 -1
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/preferences.d.mts +8 -11
- package/resources/users/preferences.d.mts.map +1 -1
- package/resources/users/preferences.d.ts +8 -11
- package/resources/users/preferences.d.ts.map +1 -1
- package/resources/users/preferences.js.map +1 -1
- package/resources/users/preferences.mjs.map +1 -1
- package/resources/users/tenants.d.mts +4 -21
- package/resources/users/tenants.d.mts.map +1 -1
- package/resources/users/tenants.d.ts +4 -21
- package/resources/users/tenants.d.ts.map +1 -1
- package/resources/users/tenants.js.map +1 -1
- package/resources/users/tenants.mjs.map +1 -1
- package/resources/users/tokens.d.mts +22 -23
- package/resources/users/tokens.d.mts.map +1 -1
- package/resources/users/tokens.d.ts +22 -23
- package/resources/users/tokens.d.ts.map +1 -1
- package/resources/users/tokens.js +14 -15
- package/resources/users/tokens.js.map +1 -1
- package/resources/users/tokens.mjs +14 -15
- package/resources/users/tokens.mjs.map +1 -1
- package/resources/users/users.d.mts +6 -6
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +6 -6
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs.map +1 -1
- package/src/client.ts +81 -56
- package/src/internal/to-file.ts +1 -1
- package/src/resources/audiences.ts +45 -90
- package/src/resources/audit-events.ts +7 -13
- package/src/resources/auth.ts +2 -16
- package/src/resources/automations/automations.ts +6 -342
- package/src/resources/automations/index.ts +2 -12
- package/src/resources/automations/invoke.ts +163 -14
- package/src/resources/brands.ts +119 -53
- package/src/resources/bulk.ts +28 -148
- package/src/resources/inbound.ts +1 -1
- package/src/resources/index.ts +24 -30
- package/src/resources/lists/index.ts +9 -3
- package/src/resources/lists/lists.ts +27 -16
- package/src/resources/lists/subscriptions.ts +7 -65
- package/src/resources/messages.ts +10 -7
- package/src/resources/notifications/checks.ts +4 -17
- package/src/resources/notifications/index.ts +2 -4
- package/src/resources/notifications/notifications.ts +13 -14
- package/src/resources/profiles/index.ts +1 -0
- package/src/resources/profiles/lists.ts +5 -13
- package/src/resources/profiles/profiles.ts +9 -2
- package/src/resources/send.ts +122 -928
- package/src/resources/shared.ts +305 -0
- package/src/resources/tenants/index.ts +10 -0
- package/src/resources/tenants/templates.ts +124 -0
- package/src/resources/tenants/tenant-default-preferences/index.ts +4 -0
- package/src/resources/tenants/{default-preferences → tenant-default-preferences}/items.ts +5 -27
- package/src/resources/tenants/{default-preferences/default-preferences.ts → tenant-default-preferences/tenant-default-preferences.ts} +4 -12
- package/src/resources/tenants/tenant-default-preferences.ts +3 -0
- package/src/resources/tenants/tenants.ts +89 -8
- package/src/resources/users/index.ts +2 -4
- package/src/resources/users/preferences.ts +7 -12
- package/src/resources/users/tenants.ts +3 -23
- package/src/resources/users/tokens.ts +33 -34
- package/src/resources/users/users.ts +4 -8
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/tenants/default-preferences/default-preferences.d.mts +0 -10
- package/resources/tenants/default-preferences/default-preferences.d.mts.map +0 -1
- package/resources/tenants/default-preferences/default-preferences.d.ts +0 -10
- package/resources/tenants/default-preferences/default-preferences.d.ts.map +0 -1
- package/resources/tenants/default-preferences/default-preferences.js.map +0 -1
- package/resources/tenants/default-preferences/default-preferences.mjs.map +0 -1
- package/resources/tenants/default-preferences/index.d.mts +0 -3
- package/resources/tenants/default-preferences/index.d.mts.map +0 -1
- package/resources/tenants/default-preferences/index.d.ts +0 -3
- package/resources/tenants/default-preferences/index.d.ts.map +0 -1
- package/resources/tenants/default-preferences/index.js +0 -9
- package/resources/tenants/default-preferences/index.js.map +0 -1
- package/resources/tenants/default-preferences/index.mjs +0 -4
- package/resources/tenants/default-preferences/index.mjs.map +0 -1
- package/resources/tenants/default-preferences/items.d.mts.map +0 -1
- package/resources/tenants/default-preferences/items.d.ts.map +0 -1
- package/resources/tenants/default-preferences/items.js.map +0 -1
- package/resources/tenants/default-preferences/items.mjs.map +0 -1
- package/resources/tenants/default-preferences.d.mts +0 -2
- package/resources/tenants/default-preferences.d.mts.map +0 -1
- package/resources/tenants/default-preferences.d.ts +0 -2
- package/resources/tenants/default-preferences.d.ts.map +0 -1
- package/resources/tenants/default-preferences.js.map +0 -1
- package/resources/tenants/default-preferences.mjs +0 -3
- package/resources/tenants/default-preferences.mjs.map +0 -1
- package/src/resources/tenants/default-preferences/index.ts +0 -10
|
@@ -1,54 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import * as InvokeAPI from "./invoke.mjs";
|
|
4
|
-
import { Invoke
|
|
5
|
-
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
import { Invoke } from "./invoke.mjs";
|
|
6
5
|
export class Automations extends APIResource {
|
|
7
6
|
constructor() {
|
|
8
7
|
super(...arguments);
|
|
9
8
|
this.invoke = new InvokeAPI.Invoke(this._client);
|
|
10
9
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a
|
|
13
|
-
* series of automation steps. For information about what steps are available,
|
|
14
|
-
* checkout the ad hoc automation guide
|
|
15
|
-
* [here](https://www.courier.com/docs/automations/steps/).
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```ts
|
|
19
|
-
* const automationInvokeResponse =
|
|
20
|
-
* await client.automations.invokeAdHoc({
|
|
21
|
-
* automation: {
|
|
22
|
-
* cancelation_token: 'delay-send--user-yes--abc-123',
|
|
23
|
-
* steps: [
|
|
24
|
-
* { action: 'delay', until: '20240408T080910.123' },
|
|
25
|
-
* {
|
|
26
|
-
* action: 'send',
|
|
27
|
-
* template: '64TP5HKPFTM8VTK1Y75SJDQX9JK0',
|
|
28
|
-
* },
|
|
29
|
-
* ],
|
|
30
|
-
* },
|
|
31
|
-
* data: { name: 'Foo' },
|
|
32
|
-
* profile: { tenant_id: 'abc-123' },
|
|
33
|
-
* recipient: 'user-yes',
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
invokeAdHoc(body, options) {
|
|
38
|
-
return this._client.post('/automations/invoke', { body, ...options });
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Invoke an automation run from an automation template.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```ts
|
|
45
|
-
* const automationInvokeResponse =
|
|
46
|
-
* await client.automations.invokeByTemplate('templateId');
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
invokeByTemplate(templateID, body, options) {
|
|
50
|
-
return this._client.post(path `/automations/${templateID}/invoke`, { body, ...options });
|
|
51
|
-
}
|
|
52
10
|
}
|
|
53
11
|
Automations.Invoke = Invoke;
|
|
54
12
|
//# sourceMappingURL=automations.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automations.mjs","sourceRoot":"","sources":["../../src/resources/automations/automations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"automations.mjs","sourceRoot":"","sources":["../../src/resources/automations/automations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,MAAM,EAAyD;AAExE,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;CAAA;AAMD,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Automations, type
|
|
2
|
-
export { Invoke, type
|
|
1
|
+
export { Automations, type AutomationInvokeResponse } from "./automations.mjs";
|
|
2
|
+
export { Invoke, type InvokeInvokeAdHocParams, type InvokeInvokeByTemplateParams } from "./invoke.mjs";
|
|
3
3
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/automations/index.ts"],"names":[],"mappings":"OAEO,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/automations/index.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE,KAAK,wBAAwB,EAAE;OAC9C,EAAE,MAAM,EAAE,KAAK,uBAAuB,EAAE,KAAK,4BAA4B,EAAE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Automations, type
|
|
2
|
-
export { Invoke, type
|
|
1
|
+
export { Automations, type AutomationInvokeResponse } from "./automations.js";
|
|
2
|
+
export { Invoke, type InvokeInvokeAdHocParams, type InvokeInvokeByTemplateParams } from "./invoke.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/automations/index.ts"],"names":[],"mappings":"OAEO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/automations/index.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE,KAAK,wBAAwB,EAAE;OAC9C,EAAE,MAAM,EAAE,KAAK,uBAAuB,EAAE,KAAK,4BAA4B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/automations/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/automations/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA2E;AAAlE,0GAAA,WAAW,OAAA;AACpB,sCAAmG;AAA1F,gGAAA,MAAM,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
export { Automations
|
|
3
|
-
export { Invoke
|
|
2
|
+
export { Automations } from "./automations.mjs";
|
|
3
|
+
export { Invoke } from "./invoke.mjs";
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/automations/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/automations/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAiC;OAC9C,EAAE,MAAM,EAAmE"}
|
|
@@ -1,24 +1,137 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as AutomationsAPI from "./automations.mjs";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
2
5
|
export declare class Invoke extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a
|
|
8
|
+
* series of automation steps. For information about what steps are available,
|
|
9
|
+
* checkout the ad hoc automation guide
|
|
10
|
+
* [here](https://www.courier.com/docs/automations/steps/).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const automationInvokeResponse =
|
|
15
|
+
* await client.automations.invoke.invokeAdHoc({
|
|
16
|
+
* automation: {
|
|
17
|
+
* cancelation_token: 'delay-send--user-yes--abc-123',
|
|
18
|
+
* steps: [
|
|
19
|
+
* { action: 'delay', until: '20240408T080910.123' },
|
|
20
|
+
* {
|
|
21
|
+
* action: 'send',
|
|
22
|
+
* template: '64TP5HKPFTM8VTK1Y75SJDQX9JK0',
|
|
23
|
+
* },
|
|
24
|
+
* ],
|
|
25
|
+
* },
|
|
26
|
+
* data: { name: 'Foo' },
|
|
27
|
+
* profile: { tenant_id: 'abc-123' },
|
|
28
|
+
* recipient: 'user-yes',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
invokeAdHoc(body: InvokeInvokeAdHocParams, options?: RequestOptions): APIPromise<AutomationsAPI.AutomationInvokeResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Invoke an automation run from an automation template.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const automationInvokeResponse =
|
|
39
|
+
* await client.automations.invoke.invokeByTemplate(
|
|
40
|
+
* 'templateId',
|
|
41
|
+
* { recipient: 'recipient' },
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
invokeByTemplate(templateID: string, body: InvokeInvokeByTemplateParams, options?: RequestOptions): APIPromise<AutomationsAPI.AutomationInvokeResponse>;
|
|
3
46
|
}
|
|
4
|
-
export interface
|
|
47
|
+
export interface InvokeInvokeAdHocParams {
|
|
48
|
+
automation: InvokeInvokeAdHocParams.Automation;
|
|
5
49
|
brand?: string | null;
|
|
6
50
|
data?: {
|
|
7
51
|
[key: string]: unknown;
|
|
8
52
|
} | null;
|
|
9
|
-
profile?:
|
|
53
|
+
profile?: {
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
} | null;
|
|
10
56
|
recipient?: string | null;
|
|
11
57
|
template?: string | null;
|
|
12
58
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
59
|
+
export declare namespace InvokeInvokeAdHocParams {
|
|
60
|
+
interface Automation {
|
|
61
|
+
steps: Array<Automation.AutomationDelayStep | Automation.AutomationSendStep | Automation.AutomationSendListStep | Automation.AutomationUpdateProfileStep | Automation.AutomationCancelStep | Automation.AutomationFetchDataStep | Automation.AutomationInvokeStep>;
|
|
62
|
+
cancelation_token?: string | null;
|
|
63
|
+
}
|
|
64
|
+
namespace Automation {
|
|
65
|
+
interface AutomationDelayStep {
|
|
66
|
+
action: 'delay';
|
|
67
|
+
duration?: string | null;
|
|
68
|
+
until?: string | null;
|
|
69
|
+
}
|
|
70
|
+
interface AutomationSendStep {
|
|
71
|
+
action: 'send';
|
|
72
|
+
brand?: string | null;
|
|
73
|
+
data?: {
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
} | null;
|
|
76
|
+
profile?: {
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
} | null;
|
|
79
|
+
recipient?: string | null;
|
|
80
|
+
template?: string | null;
|
|
81
|
+
}
|
|
82
|
+
interface AutomationSendListStep {
|
|
83
|
+
action: 'send-list';
|
|
84
|
+
list: string;
|
|
85
|
+
brand?: string | null;
|
|
86
|
+
data?: {
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
} | null;
|
|
89
|
+
}
|
|
90
|
+
interface AutomationUpdateProfileStep {
|
|
91
|
+
action: 'update-profile';
|
|
92
|
+
profile: {
|
|
93
|
+
[key: string]: unknown;
|
|
94
|
+
};
|
|
95
|
+
merge?: 'none' | 'overwrite' | 'soft-merge' | 'replace' | null;
|
|
96
|
+
recipient_id?: string | null;
|
|
97
|
+
}
|
|
98
|
+
interface AutomationCancelStep {
|
|
99
|
+
action: 'cancel';
|
|
100
|
+
cancelation_token: string;
|
|
101
|
+
}
|
|
102
|
+
interface AutomationFetchDataStep {
|
|
103
|
+
action: 'fetch-data';
|
|
104
|
+
webhook: AutomationFetchDataStep.Webhook;
|
|
105
|
+
merge_strategy?: 'replace' | 'overwrite' | 'soft-merge' | null;
|
|
106
|
+
}
|
|
107
|
+
namespace AutomationFetchDataStep {
|
|
108
|
+
interface Webhook {
|
|
109
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
110
|
+
url: string;
|
|
111
|
+
body?: string | null;
|
|
112
|
+
headers?: {
|
|
113
|
+
[key: string]: string;
|
|
114
|
+
} | null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
interface AutomationInvokeStep {
|
|
118
|
+
action: 'invoke';
|
|
119
|
+
template: string;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
15
122
|
}
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
|
|
123
|
+
export interface InvokeInvokeByTemplateParams {
|
|
124
|
+
recipient: string | null;
|
|
125
|
+
brand?: string | null;
|
|
126
|
+
data?: {
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
} | null;
|
|
129
|
+
profile?: {
|
|
130
|
+
[key: string]: unknown;
|
|
131
|
+
} | null;
|
|
132
|
+
template?: string | null;
|
|
19
133
|
}
|
|
20
|
-
export type MergeAlgorithm = 'replace' | 'none' | 'overwrite' | 'soft-merge';
|
|
21
134
|
export declare namespace Invoke {
|
|
22
|
-
export { type
|
|
135
|
+
export { type InvokeInvokeAdHocParams as InvokeInvokeAdHocParams, type InvokeInvokeByTemplateParams as InvokeInvokeByTemplateParams, };
|
|
23
136
|
}
|
|
24
137
|
//# sourceMappingURL=invoke.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.d.mts","sourceRoot":"","sources":["../../src/resources/automations/invoke.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"invoke.d.mts","sourceRoot":"","sources":["../../src/resources/automations/invoke.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,WAAW,CACT,IAAI,EAAE,uBAAuB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,cAAc,CAAC,wBAAwB,CAAC;IAItD;;;;;;;;;;;OAWG;IACH,gBAAgB,CACd,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,4BA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M,GAAG,MAAM,CAAA;iBAAE,GAAG,IAAI,CAAC;aAC5C;SACF;QAED,UAAiB,oBAAoB;YACnC,MAAM,EAAE,QAAQ,CAAC;YAEjB,QAAQ,EAAE,MAAM,CAAC;SAClB;KACF;CACF;AAED,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAEzC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAE5C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -1,24 +1,137 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as AutomationsAPI from "./automations.js";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
2
5
|
export declare class Invoke extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a
|
|
8
|
+
* series of automation steps. For information about what steps are available,
|
|
9
|
+
* checkout the ad hoc automation guide
|
|
10
|
+
* [here](https://www.courier.com/docs/automations/steps/).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const automationInvokeResponse =
|
|
15
|
+
* await client.automations.invoke.invokeAdHoc({
|
|
16
|
+
* automation: {
|
|
17
|
+
* cancelation_token: 'delay-send--user-yes--abc-123',
|
|
18
|
+
* steps: [
|
|
19
|
+
* { action: 'delay', until: '20240408T080910.123' },
|
|
20
|
+
* {
|
|
21
|
+
* action: 'send',
|
|
22
|
+
* template: '64TP5HKPFTM8VTK1Y75SJDQX9JK0',
|
|
23
|
+
* },
|
|
24
|
+
* ],
|
|
25
|
+
* },
|
|
26
|
+
* data: { name: 'Foo' },
|
|
27
|
+
* profile: { tenant_id: 'abc-123' },
|
|
28
|
+
* recipient: 'user-yes',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
invokeAdHoc(body: InvokeInvokeAdHocParams, options?: RequestOptions): APIPromise<AutomationsAPI.AutomationInvokeResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Invoke an automation run from an automation template.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const automationInvokeResponse =
|
|
39
|
+
* await client.automations.invoke.invokeByTemplate(
|
|
40
|
+
* 'templateId',
|
|
41
|
+
* { recipient: 'recipient' },
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
invokeByTemplate(templateID: string, body: InvokeInvokeByTemplateParams, options?: RequestOptions): APIPromise<AutomationsAPI.AutomationInvokeResponse>;
|
|
3
46
|
}
|
|
4
|
-
export interface
|
|
47
|
+
export interface InvokeInvokeAdHocParams {
|
|
48
|
+
automation: InvokeInvokeAdHocParams.Automation;
|
|
5
49
|
brand?: string | null;
|
|
6
50
|
data?: {
|
|
7
51
|
[key: string]: unknown;
|
|
8
52
|
} | null;
|
|
9
|
-
profile?:
|
|
53
|
+
profile?: {
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
} | null;
|
|
10
56
|
recipient?: string | null;
|
|
11
57
|
template?: string | null;
|
|
12
58
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
59
|
+
export declare namespace InvokeInvokeAdHocParams {
|
|
60
|
+
interface Automation {
|
|
61
|
+
steps: Array<Automation.AutomationDelayStep | Automation.AutomationSendStep | Automation.AutomationSendListStep | Automation.AutomationUpdateProfileStep | Automation.AutomationCancelStep | Automation.AutomationFetchDataStep | Automation.AutomationInvokeStep>;
|
|
62
|
+
cancelation_token?: string | null;
|
|
63
|
+
}
|
|
64
|
+
namespace Automation {
|
|
65
|
+
interface AutomationDelayStep {
|
|
66
|
+
action: 'delay';
|
|
67
|
+
duration?: string | null;
|
|
68
|
+
until?: string | null;
|
|
69
|
+
}
|
|
70
|
+
interface AutomationSendStep {
|
|
71
|
+
action: 'send';
|
|
72
|
+
brand?: string | null;
|
|
73
|
+
data?: {
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
} | null;
|
|
76
|
+
profile?: {
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
} | null;
|
|
79
|
+
recipient?: string | null;
|
|
80
|
+
template?: string | null;
|
|
81
|
+
}
|
|
82
|
+
interface AutomationSendListStep {
|
|
83
|
+
action: 'send-list';
|
|
84
|
+
list: string;
|
|
85
|
+
brand?: string | null;
|
|
86
|
+
data?: {
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
} | null;
|
|
89
|
+
}
|
|
90
|
+
interface AutomationUpdateProfileStep {
|
|
91
|
+
action: 'update-profile';
|
|
92
|
+
profile: {
|
|
93
|
+
[key: string]: unknown;
|
|
94
|
+
};
|
|
95
|
+
merge?: 'none' | 'overwrite' | 'soft-merge' | 'replace' | null;
|
|
96
|
+
recipient_id?: string | null;
|
|
97
|
+
}
|
|
98
|
+
interface AutomationCancelStep {
|
|
99
|
+
action: 'cancel';
|
|
100
|
+
cancelation_token: string;
|
|
101
|
+
}
|
|
102
|
+
interface AutomationFetchDataStep {
|
|
103
|
+
action: 'fetch-data';
|
|
104
|
+
webhook: AutomationFetchDataStep.Webhook;
|
|
105
|
+
merge_strategy?: 'replace' | 'overwrite' | 'soft-merge' | null;
|
|
106
|
+
}
|
|
107
|
+
namespace AutomationFetchDataStep {
|
|
108
|
+
interface Webhook {
|
|
109
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
110
|
+
url: string;
|
|
111
|
+
body?: string | null;
|
|
112
|
+
headers?: {
|
|
113
|
+
[key: string]: string;
|
|
114
|
+
} | null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
interface AutomationInvokeStep {
|
|
118
|
+
action: 'invoke';
|
|
119
|
+
template: string;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
15
122
|
}
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
|
|
123
|
+
export interface InvokeInvokeByTemplateParams {
|
|
124
|
+
recipient: string | null;
|
|
125
|
+
brand?: string | null;
|
|
126
|
+
data?: {
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
} | null;
|
|
129
|
+
profile?: {
|
|
130
|
+
[key: string]: unknown;
|
|
131
|
+
} | null;
|
|
132
|
+
template?: string | null;
|
|
19
133
|
}
|
|
20
|
-
export type MergeAlgorithm = 'replace' | 'none' | 'overwrite' | 'soft-merge';
|
|
21
134
|
export declare namespace Invoke {
|
|
22
|
-
export { type
|
|
135
|
+
export { type InvokeInvokeAdHocParams as InvokeInvokeAdHocParams, type InvokeInvokeByTemplateParams as InvokeInvokeByTemplateParams, };
|
|
23
136
|
}
|
|
24
137
|
//# sourceMappingURL=invoke.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../src/resources/automations/invoke.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../src/resources/automations/invoke.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,WAAW,CACT,IAAI,EAAE,uBAAu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AO,GAAG,QAAQ,CAAC;gBAEpD,GAAG,EAAE,MAAM,CAAC;gBAEZ,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;gBAErB,OAAO,CAAC,EAAE;oBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;iBAAE,GAAG,IAAI,CAAC;aAC5C;SACF;QAED,UAAiB,oBAAoB;YACnC,MAAM,EAAE,QAAQ,CAAC;YAEjB,QAAQ,EAAE,MAAM,CAAC;SAClB;KACF;CACF;AAED,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAEzC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAE5C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -3,7 +3,52 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Invoke = void 0;
|
|
5
5
|
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
6
7
|
class Invoke extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a
|
|
10
|
+
* series of automation steps. For information about what steps are available,
|
|
11
|
+
* checkout the ad hoc automation guide
|
|
12
|
+
* [here](https://www.courier.com/docs/automations/steps/).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const automationInvokeResponse =
|
|
17
|
+
* await client.automations.invoke.invokeAdHoc({
|
|
18
|
+
* automation: {
|
|
19
|
+
* cancelation_token: 'delay-send--user-yes--abc-123',
|
|
20
|
+
* steps: [
|
|
21
|
+
* { action: 'delay', until: '20240408T080910.123' },
|
|
22
|
+
* {
|
|
23
|
+
* action: 'send',
|
|
24
|
+
* template: '64TP5HKPFTM8VTK1Y75SJDQX9JK0',
|
|
25
|
+
* },
|
|
26
|
+
* ],
|
|
27
|
+
* },
|
|
28
|
+
* data: { name: 'Foo' },
|
|
29
|
+
* profile: { tenant_id: 'abc-123' },
|
|
30
|
+
* recipient: 'user-yes',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
invokeAdHoc(body, options) {
|
|
35
|
+
return this._client.post('/automations/invoke', { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Invoke an automation run from an automation template.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const automationInvokeResponse =
|
|
43
|
+
* await client.automations.invoke.invokeByTemplate(
|
|
44
|
+
* 'templateId',
|
|
45
|
+
* { recipient: 'recipient' },
|
|
46
|
+
* );
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
invokeByTemplate(templateID, body, options) {
|
|
50
|
+
return this._client.post((0, path_1.path) `/automations/${templateID}/invoke`, { body, ...options });
|
|
51
|
+
}
|
|
7
52
|
}
|
|
8
53
|
exports.Invoke = Invoke;
|
|
9
54
|
//# sourceMappingURL=invoke.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../../src/resources/automations/invoke.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;
|
|
1
|
+
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../../src/resources/automations/invoke.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAiD;AAEjD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,WAAW,CACT,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,gBAAgB,CACd,UAAkB,EAClB,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,UAAU,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;CACF;AArDD,wBAqDC"}
|
|
@@ -1,5 +1,50 @@
|
|
|
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 { path } from "../../internal/utils/path.mjs";
|
|
3
4
|
export class Invoke extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a
|
|
7
|
+
* series of automation steps. For information about what steps are available,
|
|
8
|
+
* checkout the ad hoc automation guide
|
|
9
|
+
* [here](https://www.courier.com/docs/automations/steps/).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const automationInvokeResponse =
|
|
14
|
+
* await client.automations.invoke.invokeAdHoc({
|
|
15
|
+
* automation: {
|
|
16
|
+
* cancelation_token: 'delay-send--user-yes--abc-123',
|
|
17
|
+
* steps: [
|
|
18
|
+
* { action: 'delay', until: '20240408T080910.123' },
|
|
19
|
+
* {
|
|
20
|
+
* action: 'send',
|
|
21
|
+
* template: '64TP5HKPFTM8VTK1Y75SJDQX9JK0',
|
|
22
|
+
* },
|
|
23
|
+
* ],
|
|
24
|
+
* },
|
|
25
|
+
* data: { name: 'Foo' },
|
|
26
|
+
* profile: { tenant_id: 'abc-123' },
|
|
27
|
+
* recipient: 'user-yes',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
invokeAdHoc(body, options) {
|
|
32
|
+
return this._client.post('/automations/invoke', { body, ...options });
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Invoke an automation run from an automation template.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const automationInvokeResponse =
|
|
40
|
+
* await client.automations.invoke.invokeByTemplate(
|
|
41
|
+
* 'templateId',
|
|
42
|
+
* { recipient: 'recipient' },
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
invokeByTemplate(templateID, body, options) {
|
|
47
|
+
return this._client.post(path `/automations/${templateID}/invoke`, { body, ...options });
|
|
48
|
+
}
|
|
4
49
|
}
|
|
5
50
|
//# sourceMappingURL=invoke.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.mjs","sourceRoot":"","sources":["../../src/resources/automations/invoke.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"invoke.mjs","sourceRoot":"","sources":["../../src/resources/automations/invoke.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,WAAW,CACT,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,gBAAgB,CACd,UAAkB,EAClB,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,UAAU,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;CACF"}
|