@trycourier/courier 7.10.1 → 7.11.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 +35 -0
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js +12 -1
- package/client.js.map +1 -1
- package/client.mjs +12 -1
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts.map +1 -1
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/index.d.mts +2 -2
- package/internal/qs/index.d.mts.map +1 -1
- package/internal/qs/index.d.ts +2 -2
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/index.mjs.map +1 -1
- package/internal/qs/stringify.d.mts.map +1 -1
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/utils.d.mts.map +1 -1
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +10 -10
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +10 -10
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts.map +1 -1
- package/resources/audiences.mjs.map +1 -1
- package/resources/audit-events.d.mts.map +1 -1
- package/resources/audit-events.d.ts.map +1 -1
- package/resources/audit-events.mjs.map +1 -1
- package/resources/auth.d.mts.map +1 -1
- package/resources/auth.d.ts.map +1 -1
- package/resources/auth.mjs.map +1 -1
- package/resources/automations/automations.d.mts.map +1 -1
- package/resources/automations/automations.d.ts.map +1 -1
- package/resources/automations/automations.mjs.map +1 -1
- package/resources/automations/index.d.mts.map +1 -1
- package/resources/automations/index.d.ts.map +1 -1
- package/resources/automations/index.mjs.map +1 -1
- package/resources/automations/invoke.d.mts.map +1 -1
- package/resources/automations/invoke.d.ts.map +1 -1
- package/resources/automations/invoke.mjs.map +1 -1
- package/resources/automations.d.mts.map +1 -1
- package/resources/automations.d.ts.map +1 -1
- package/resources/automations.mjs.map +1 -1
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.mjs.map +1 -1
- package/resources/bulk.d.mts.map +1 -1
- package/resources/bulk.d.ts.map +1 -1
- package/resources/bulk.mjs.map +1 -1
- package/resources/inbound.d.mts.map +1 -1
- package/resources/inbound.d.ts.map +1 -1
- package/resources/inbound.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/journeys/index.d.mts +3 -0
- package/resources/journeys/index.d.mts.map +1 -0
- package/resources/journeys/index.d.ts +3 -0
- package/resources/journeys/index.d.ts.map +1 -0
- package/resources/journeys/index.js +9 -0
- package/resources/journeys/index.js.map +1 -0
- package/resources/journeys/index.mjs +4 -0
- package/resources/journeys/index.mjs.map +1 -0
- package/resources/journeys/journeys.d.mts +752 -0
- package/resources/journeys/journeys.d.mts.map +1 -0
- package/resources/journeys/journeys.d.ts +752 -0
- package/resources/journeys/journeys.d.ts.map +1 -0
- package/resources/journeys/journeys.js +148 -0
- package/resources/journeys/journeys.js.map +1 -0
- package/resources/journeys/journeys.mjs +143 -0
- package/resources/journeys/journeys.mjs.map +1 -0
- package/resources/journeys/templates.d.mts +219 -0
- package/resources/journeys/templates.d.mts.map +1 -0
- package/resources/journeys/templates.d.ts +219 -0
- package/resources/journeys/templates.d.ts.map +1 -0
- package/resources/journeys/templates.js +142 -0
- package/resources/journeys/templates.js.map +1 -0
- package/resources/journeys/templates.mjs +138 -0
- package/resources/journeys/templates.mjs.map +1 -0
- package/resources/journeys.d.mts +1 -142
- package/resources/journeys.d.mts.map +1 -1
- package/resources/journeys.d.ts +1 -142
- package/resources/journeys.d.ts.map +1 -1
- package/resources/journeys.js +2 -34
- package/resources/journeys.js.map +1 -1
- package/resources/journeys.mjs +1 -32
- package/resources/journeys.mjs.map +1 -1
- package/resources/lists/index.d.mts.map +1 -1
- package/resources/lists/index.d.ts.map +1 -1
- package/resources/lists/index.mjs.map +1 -1
- package/resources/lists/lists.d.mts.map +1 -1
- package/resources/lists/lists.d.ts.map +1 -1
- package/resources/lists/lists.mjs.map +1 -1
- package/resources/lists/subscriptions.d.mts.map +1 -1
- package/resources/lists/subscriptions.d.ts.map +1 -1
- package/resources/lists/subscriptions.mjs.map +1 -1
- package/resources/lists.d.mts.map +1 -1
- package/resources/lists.d.ts.map +1 -1
- package/resources/lists.mjs.map +1 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +13 -1
- package/resources/notifications/checks.d.mts.map +1 -1
- package/resources/notifications/checks.d.ts +13 -1
- package/resources/notifications/checks.d.ts.map +1 -1
- package/resources/notifications/checks.js +6 -0
- package/resources/notifications/checks.js.map +1 -1
- package/resources/notifications/checks.mjs +6 -0
- package/resources/notifications/checks.mjs.map +1 -1
- package/resources/notifications/index.d.mts +1 -1
- package/resources/notifications/index.d.mts.map +1 -1
- package/resources/notifications/index.d.ts +1 -1
- package/resources/notifications/index.d.ts.map +1 -1
- package/resources/notifications/index.mjs.map +1 -1
- package/resources/notifications/notifications.d.mts +48 -62
- package/resources/notifications/notifications.d.mts.map +1 -1
- package/resources/notifications/notifications.d.ts +48 -62
- package/resources/notifications/notifications.d.ts.map +1 -1
- package/resources/notifications/notifications.js +3 -3
- package/resources/notifications/notifications.js.map +1 -1
- package/resources/notifications/notifications.mjs +3 -3
- package/resources/notifications/notifications.mjs.map +1 -1
- package/resources/notifications.d.mts.map +1 -1
- package/resources/notifications.d.ts.map +1 -1
- package/resources/notifications.mjs.map +1 -1
- package/resources/profiles/index.d.mts.map +1 -1
- package/resources/profiles/index.d.ts.map +1 -1
- package/resources/profiles/index.mjs.map +1 -1
- package/resources/profiles/lists.d.mts.map +1 -1
- package/resources/profiles/lists.d.ts.map +1 -1
- package/resources/profiles/lists.mjs.map +1 -1
- package/resources/profiles/profiles.d.mts.map +1 -1
- package/resources/profiles/profiles.d.ts.map +1 -1
- package/resources/profiles/profiles.mjs.map +1 -1
- package/resources/profiles.d.mts.map +1 -1
- package/resources/profiles.d.ts.map +1 -1
- package/resources/profiles.mjs.map +1 -1
- package/resources/providers/catalog.d.mts.map +1 -1
- package/resources/providers/catalog.d.ts.map +1 -1
- package/resources/providers/catalog.mjs.map +1 -1
- package/resources/providers/index.d.mts.map +1 -1
- package/resources/providers/index.d.ts.map +1 -1
- package/resources/providers/index.mjs.map +1 -1
- package/resources/providers/providers.d.mts.map +1 -1
- package/resources/providers/providers.d.ts.map +1 -1
- package/resources/providers/providers.mjs.map +1 -1
- package/resources/providers.d.mts.map +1 -1
- package/resources/providers.d.ts.map +1 -1
- package/resources/providers.mjs.map +1 -1
- package/resources/requests.d.mts.map +1 -1
- package/resources/requests.d.ts.map +1 -1
- package/resources/requests.mjs.map +1 -1
- package/resources/routing-strategies.d.mts.map +1 -1
- package/resources/routing-strategies.d.ts.map +1 -1
- package/resources/routing-strategies.mjs.map +1 -1
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts.map +1 -1
- package/resources/send.mjs.map +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/tenants/index.d.mts +1 -1
- package/resources/tenants/index.d.mts.map +1 -1
- package/resources/tenants/index.d.ts +1 -1
- package/resources/tenants/index.d.ts.map +1 -1
- package/resources/tenants/index.js.map +1 -1
- package/resources/tenants/index.mjs.map +1 -1
- package/resources/tenants/preferences/index.d.mts.map +1 -1
- package/resources/tenants/preferences/index.d.ts.map +1 -1
- package/resources/tenants/preferences/index.mjs.map +1 -1
- package/resources/tenants/preferences/items.d.mts.map +1 -1
- package/resources/tenants/preferences/items.d.ts.map +1 -1
- package/resources/tenants/preferences/items.mjs.map +1 -1
- package/resources/tenants/preferences/preferences.d.mts.map +1 -1
- package/resources/tenants/preferences/preferences.d.ts.map +1 -1
- package/resources/tenants/preferences/preferences.mjs.map +1 -1
- package/resources/tenants/preferences.d.mts.map +1 -1
- package/resources/tenants/preferences.d.ts.map +1 -1
- package/resources/tenants/preferences.mjs.map +1 -1
- package/resources/tenants/templates/index.d.mts +1 -1
- package/resources/tenants/templates/index.d.mts.map +1 -1
- package/resources/tenants/templates/index.d.ts +1 -1
- package/resources/tenants/templates/index.d.ts.map +1 -1
- package/resources/tenants/templates/index.js.map +1 -1
- package/resources/tenants/templates/index.mjs.map +1 -1
- package/resources/tenants/templates/templates.d.mts +23 -1
- package/resources/tenants/templates/templates.d.mts.map +1 -1
- package/resources/tenants/templates/templates.d.ts +23 -1
- package/resources/tenants/templates/templates.d.ts.map +1 -1
- package/resources/tenants/templates/templates.js +23 -0
- package/resources/tenants/templates/templates.js.map +1 -1
- package/resources/tenants/templates/templates.mjs +23 -0
- package/resources/tenants/templates/templates.mjs.map +1 -1
- package/resources/tenants/templates/versions.d.mts.map +1 -1
- package/resources/tenants/templates/versions.d.ts.map +1 -1
- package/resources/tenants/templates/versions.mjs.map +1 -1
- package/resources/tenants/templates.d.mts.map +1 -1
- package/resources/tenants/templates.d.ts.map +1 -1
- package/resources/tenants/templates.mjs.map +1 -1
- package/resources/tenants/tenants.d.mts +2 -2
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +2 -2
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/tenants.d.mts.map +1 -1
- package/resources/tenants.d.ts.map +1 -1
- package/resources/tenants.mjs.map +1 -1
- package/resources/translations.d.mts.map +1 -1
- package/resources/translations.d.ts.map +1 -1
- package/resources/translations.mjs.map +1 -1
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/preferences.d.mts.map +1 -1
- package/resources/users/preferences.d.ts.map +1 -1
- package/resources/users/preferences.mjs.map +1 -1
- package/resources/users/tenants.d.mts.map +1 -1
- package/resources/users/tenants.d.ts.map +1 -1
- package/resources/users/tenants.mjs.map +1 -1
- package/resources/users/tokens.d.mts.map +1 -1
- package/resources/users/tokens.d.ts.map +1 -1
- package/resources/users/tokens.mjs.map +1 -1
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.mjs.map +1 -1
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts.map +1 -1
- package/resources/users.mjs.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +89 -11
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/index.ts +35 -2
- package/src/resources/journeys/index.ts +54 -0
- package/src/resources/journeys/journeys.ts +1047 -0
- package/src/resources/journeys/templates.ts +318 -0
- package/src/resources/journeys.ts +1 -172
- package/src/resources/notifications/checks.ts +13 -1
- package/src/resources/notifications/index.ts +1 -1
- package/src/resources/notifications/notifications.ts +55 -73
- package/src/resources/tenants/index.ts +1 -0
- package/src/resources/tenants/templates/index.ts +1 -0
- package/src/resources/tenants/templates/templates.ts +32 -0
- package/src/resources/tenants/tenants.ts +2 -0
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,752 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as JourneysAPI from "./journeys.js";
|
|
3
|
+
import * as Shared from "../shared.js";
|
|
4
|
+
import * as TemplatesAPI from "./templates.js";
|
|
5
|
+
import { TemplateArchiveParams, TemplateCreateParams, TemplateListParams, TemplateListVersionsParams, TemplatePublishParams, TemplateReplaceParams, TemplateRetrieveParams, Templates } from "./templates.js";
|
|
6
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
7
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
8
|
+
export declare class Journeys extends APIResource {
|
|
9
|
+
templates: TemplatesAPI.Templates;
|
|
10
|
+
/**
|
|
11
|
+
* Create a journey. Defaults to `DRAFT` state; pass `state: "PUBLISHED"` to
|
|
12
|
+
* publish on create. Send nodes are not allowed on `POST`. The standard flow is:
|
|
13
|
+
* create the journey shell here, add notification templates with
|
|
14
|
+
* `POST /journeys/{templateId}/templates`, then wire them into the journey with
|
|
15
|
+
* `PUT /journeys/{templateId}`. Call `POST /journeys/{templateId}/publish` to
|
|
16
|
+
* publish a draft after the fact.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const journeyResponse = await client.journeys.create({
|
|
21
|
+
* name: 'Welcome Journey',
|
|
22
|
+
* nodes: [
|
|
23
|
+
* {
|
|
24
|
+
* id: 'trigger-1',
|
|
25
|
+
* type: 'trigger',
|
|
26
|
+
* trigger_type: 'api',
|
|
27
|
+
* },
|
|
28
|
+
* { id: 'send-1', type: 'send' },
|
|
29
|
+
* ],
|
|
30
|
+
* enabled: true,
|
|
31
|
+
* state: 'DRAFT',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
create(body: JourneyCreateParams, options?: RequestOptions): APIPromise<JourneyResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* Fetch a journey by id. Pass `?version=draft` (default `published`) to retrieve
|
|
38
|
+
* the working draft, or `?version=vN` to retrieve a historical version.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const journeyResponse = await client.journeys.retrieve('x');
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
retrieve(templateID: string, query?: JourneyRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<JourneyResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Get the list of journeys.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const journeysListResponse = await client.journeys.list();
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
list(query?: JourneyListParams | null | undefined, options?: RequestOptions): APIPromise<JourneysListResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Archive a journey. Archived journeys cannot be invoked. Existing journey runs
|
|
57
|
+
* continue to completion.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* await client.journeys.archive('x');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
archive(templateID: string, options?: RequestOptions): APIPromise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Invoke a journey by id or alias to start a new run. The response includes a
|
|
67
|
+
* `runId` identifying the run.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const journeysInvokeResponse = await client.journeys.invoke(
|
|
72
|
+
* 'templateId',
|
|
73
|
+
* {
|
|
74
|
+
* data: { order_id: 'order-456', amount: 99.99 },
|
|
75
|
+
* user_id: 'user-123',
|
|
76
|
+
* },
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
invoke(templateID: string, body: JourneyInvokeParams, options?: RequestOptions): APIPromise<JourneysInvokeResponse>;
|
|
81
|
+
/**
|
|
82
|
+
* List published versions of a journey, ordered most recent first.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const journeyVersionsListResponse =
|
|
87
|
+
* await client.journeys.listVersions('x');
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
listVersions(templateID: string, options?: RequestOptions): APIPromise<JourneyVersionsListResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* Publish the current draft as a new version. Body is optional; pass
|
|
93
|
+
* `{ "version": "vN" }` to roll back to a prior version instead. Returns 404 if
|
|
94
|
+
* the journey has no draft to publish.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const journeyResponse = await client.journeys.publish('x');
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
publish(templateID: string, body?: JourneyPublishParams | null | undefined, options?: RequestOptions): APIPromise<JourneyResponse>;
|
|
102
|
+
/**
|
|
103
|
+
* Replace the journey draft. Updates the working draft only; call
|
|
104
|
+
* `POST /journeys/{templateId}/publish` to make it live, or pass
|
|
105
|
+
* `state: "PUBLISHED"` in this request to publish immediately. Send-node
|
|
106
|
+
* `template` ids must already exist and be scoped to this journey, and node ids
|
|
107
|
+
* must not be claimed by another journey.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const journeyResponse = await client.journeys.replace('x', {
|
|
112
|
+
* name: 'Welcome Journey v2',
|
|
113
|
+
* nodes: [],
|
|
114
|
+
* enabled: true,
|
|
115
|
+
* state: 'DRAFT',
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
replace(templateID: string, body: JourneyReplaceParams, options?: RequestOptions): APIPromise<JourneyResponse>;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Request body for creating a journey.
|
|
123
|
+
*/
|
|
124
|
+
export interface CreateJourneyRequest {
|
|
125
|
+
name: string;
|
|
126
|
+
nodes: Array<JourneyNode>;
|
|
127
|
+
enabled?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Lifecycle state of a journey.
|
|
130
|
+
*/
|
|
131
|
+
state?: JourneyState;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A journey template representing an automation workflow.
|
|
135
|
+
*/
|
|
136
|
+
export interface Journey {
|
|
137
|
+
/**
|
|
138
|
+
* The unique identifier of the journey.
|
|
139
|
+
*/
|
|
140
|
+
id: string;
|
|
141
|
+
/**
|
|
142
|
+
* The name of the journey.
|
|
143
|
+
*/
|
|
144
|
+
name: string;
|
|
145
|
+
/**
|
|
146
|
+
* The version of the journey (published or draft).
|
|
147
|
+
*/
|
|
148
|
+
version: 'published' | 'draft';
|
|
149
|
+
/**
|
|
150
|
+
* ISO 8601 timestamp when the journey was created.
|
|
151
|
+
*/
|
|
152
|
+
createdAt?: string;
|
|
153
|
+
/**
|
|
154
|
+
* ISO 8601 timestamp when the journey was last updated.
|
|
155
|
+
*/
|
|
156
|
+
updatedAt?: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Invoke an AI step with `user_prompt` and optional `web_search`. Returns a
|
|
160
|
+
* structured response conforming to `output_schema`.
|
|
161
|
+
*/
|
|
162
|
+
export interface JourneyAINode {
|
|
163
|
+
/**
|
|
164
|
+
* A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
|
|
165
|
+
*/
|
|
166
|
+
output_schema: {
|
|
167
|
+
[key: string]: unknown;
|
|
168
|
+
};
|
|
169
|
+
type: 'ai';
|
|
170
|
+
id?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
173
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
174
|
+
* express "no conditions".
|
|
175
|
+
*/
|
|
176
|
+
conditions?: JourneyConditionsField;
|
|
177
|
+
model?: string;
|
|
178
|
+
user_prompt?: string;
|
|
179
|
+
web_search?: boolean;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Trigger fired when the journey is invoked via the API. The optional `schema`
|
|
183
|
+
* field is a JSON Schema that validates the invocation payload.
|
|
184
|
+
*/
|
|
185
|
+
export interface JourneyAPIInvokeTriggerNode {
|
|
186
|
+
trigger_type: 'api-invoke';
|
|
187
|
+
type: 'trigger';
|
|
188
|
+
id?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
191
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
192
|
+
* express "no conditions".
|
|
193
|
+
*/
|
|
194
|
+
conditions?: JourneyConditionsField;
|
|
195
|
+
/**
|
|
196
|
+
* A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
|
|
197
|
+
*/
|
|
198
|
+
schema?: {
|
|
199
|
+
[key: string]: unknown;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* A single condition expressed as a positional tuple of strings.
|
|
204
|
+
*
|
|
205
|
+
* - Binary form (3 elements): `[path, operator, value]` where `operator` is one of
|
|
206
|
+
* `is equal`, `is not equal`, `contains`, `does not contain`, `starts with`,
|
|
207
|
+
* `ends with`, `greater than`, `greater than or equal`, `less than`,
|
|
208
|
+
* `less than or equal`.
|
|
209
|
+
*
|
|
210
|
+
* Example: `["user.tier", "is equal", "gold"]`.
|
|
211
|
+
*
|
|
212
|
+
* - Unary form (2 elements): `[path, operator]` where `operator` is one of
|
|
213
|
+
* `exists`, `does not exist`.
|
|
214
|
+
*
|
|
215
|
+
* Example: `["user.email", "exists"]`.
|
|
216
|
+
*
|
|
217
|
+
* The first element is a non-empty dot-path. The second element is the operator
|
|
218
|
+
* (must come from one of the two operator sets above). For the binary form, the
|
|
219
|
+
* third element is the comparison value (string). Runtime validation of the
|
|
220
|
+
* operator value and arity is performed by the backend; SDKs surface this as a
|
|
221
|
+
* string list.
|
|
222
|
+
*/
|
|
223
|
+
export type JourneyConditionAtom = Array<string>;
|
|
224
|
+
/**
|
|
225
|
+
* A leaf condition group. Exactly one of `AND` or `OR` must be present at runtime;
|
|
226
|
+
* each is a list of `JourneyConditionAtom` tuples.
|
|
227
|
+
*/
|
|
228
|
+
export interface JourneyConditionGroup {
|
|
229
|
+
AND?: Array<JourneyConditionAtom>;
|
|
230
|
+
OR?: Array<JourneyConditionAtom>;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* A nested condition group. Exactly one of `AND` or `OR` must be present at
|
|
234
|
+
* runtime; each is a list of `JourneyConditionGroup` items.
|
|
235
|
+
*/
|
|
236
|
+
export interface JourneyConditionNestedGroup {
|
|
237
|
+
AND?: Array<JourneyConditionGroup>;
|
|
238
|
+
OR?: Array<JourneyConditionGroup>;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
242
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
243
|
+
* express "no conditions".
|
|
244
|
+
*/
|
|
245
|
+
export type JourneyConditionsField = JourneyConditionAtom | JourneyConditionGroup | JourneyConditionNestedGroup;
|
|
246
|
+
/**
|
|
247
|
+
* Pause the journey run for a fixed `duration`.
|
|
248
|
+
*/
|
|
249
|
+
export interface JourneyDelayDurationNode {
|
|
250
|
+
duration: string;
|
|
251
|
+
mode: 'duration';
|
|
252
|
+
type: 'delay';
|
|
253
|
+
id?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
256
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
257
|
+
* express "no conditions".
|
|
258
|
+
*/
|
|
259
|
+
conditions?: JourneyConditionsField;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Pause the journey run `until` a specific time.
|
|
263
|
+
*/
|
|
264
|
+
export interface JourneyDelayUntilNode {
|
|
265
|
+
mode: 'until';
|
|
266
|
+
type: 'delay';
|
|
267
|
+
until: string;
|
|
268
|
+
id?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
271
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
272
|
+
* express "no conditions".
|
|
273
|
+
*/
|
|
274
|
+
conditions?: JourneyConditionsField;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Terminate the journey run.
|
|
278
|
+
*/
|
|
279
|
+
export interface JourneyExitNode {
|
|
280
|
+
type: 'exit';
|
|
281
|
+
id?: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Issue an HTTP GET or DELETE request and merge the response into the journey
|
|
285
|
+
* state per `merge_strategy`.
|
|
286
|
+
*/
|
|
287
|
+
export interface JourneyFetchGetDeleteNode {
|
|
288
|
+
/**
|
|
289
|
+
* Strategy for merging a fetch response into the journey run state.
|
|
290
|
+
*/
|
|
291
|
+
merge_strategy: JourneyMergeStrategy;
|
|
292
|
+
method: 'get' | 'delete';
|
|
293
|
+
type: 'fetch';
|
|
294
|
+
url: string;
|
|
295
|
+
id?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
298
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
299
|
+
* express "no conditions".
|
|
300
|
+
*/
|
|
301
|
+
conditions?: JourneyConditionsField;
|
|
302
|
+
headers?: {
|
|
303
|
+
[key: string]: string;
|
|
304
|
+
};
|
|
305
|
+
query_params?: {
|
|
306
|
+
[key: string]: string;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
|
|
310
|
+
*/
|
|
311
|
+
response_schema?: {
|
|
312
|
+
[key: string]: unknown;
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Issue an HTTP POST or PUT request with a `body` and merge the response into the
|
|
317
|
+
* journey state per `merge_strategy`.
|
|
318
|
+
*/
|
|
319
|
+
export interface JourneyFetchPostPutNode {
|
|
320
|
+
/**
|
|
321
|
+
* Strategy for merging a fetch response into the journey run state.
|
|
322
|
+
*/
|
|
323
|
+
merge_strategy: JourneyMergeStrategy;
|
|
324
|
+
method: 'post' | 'put';
|
|
325
|
+
type: 'fetch';
|
|
326
|
+
url: string;
|
|
327
|
+
id?: string;
|
|
328
|
+
body?: string;
|
|
329
|
+
/**
|
|
330
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
331
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
332
|
+
* express "no conditions".
|
|
333
|
+
*/
|
|
334
|
+
conditions?: JourneyConditionsField;
|
|
335
|
+
headers?: {
|
|
336
|
+
[key: string]: string;
|
|
337
|
+
};
|
|
338
|
+
query_params?: {
|
|
339
|
+
[key: string]: string;
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
|
|
343
|
+
*/
|
|
344
|
+
response_schema?: {
|
|
345
|
+
[key: string]: unknown;
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Strategy for merging a fetch response into the journey run state.
|
|
350
|
+
*/
|
|
351
|
+
export type JourneyMergeStrategy = 'overwrite' | 'soft-merge' | 'replace' | 'none';
|
|
352
|
+
/**
|
|
353
|
+
* A single node in a journey DAG. Discriminated by `type`, with a secondary
|
|
354
|
+
* discriminator on some variants (`trigger_type` for trigger, `mode` for delay,
|
|
355
|
+
* `method` for fetch, `scope` for throttle).
|
|
356
|
+
*/
|
|
357
|
+
export type JourneyNode = JourneyAPIInvokeTriggerNode | JourneySegmentTriggerNode | JourneySendNode | JourneyDelayDurationNode | JourneyDelayUntilNode | JourneyFetchGetDeleteNode | JourneyFetchPostPutNode | JourneyAINode | JourneyThrottleStaticNode | JourneyThrottleDynamicNode | JourneyExitNode | JourneyNode.JourneyBranchNode;
|
|
358
|
+
export declare namespace JourneyNode {
|
|
359
|
+
/**
|
|
360
|
+
* Branch node. Routes to the first entry in `paths[]` whose `conditions` match,
|
|
361
|
+
* else falls through to `default.nodes`.
|
|
362
|
+
*/
|
|
363
|
+
interface JourneyBranchNode {
|
|
364
|
+
default: JourneyBranchNode.Default;
|
|
365
|
+
paths: Array<JourneyBranchNode.Path>;
|
|
366
|
+
type: 'branch';
|
|
367
|
+
id?: string;
|
|
368
|
+
}
|
|
369
|
+
namespace JourneyBranchNode {
|
|
370
|
+
interface Default {
|
|
371
|
+
nodes: Array<JourneysAPI.JourneyNode>;
|
|
372
|
+
label?: string;
|
|
373
|
+
}
|
|
374
|
+
interface Path {
|
|
375
|
+
/**
|
|
376
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
377
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
378
|
+
* express "no conditions".
|
|
379
|
+
*/
|
|
380
|
+
conditions: JourneysAPI.JourneyConditionsField;
|
|
381
|
+
nodes: Array<JourneysAPI.JourneyNode>;
|
|
382
|
+
label?: string;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Request body for publishing a journey. Pass `version` to roll back to a prior
|
|
388
|
+
* version; omit to publish the current draft.
|
|
389
|
+
*/
|
|
390
|
+
export interface JourneyPublishRequest {
|
|
391
|
+
version?: string;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* A journey, with its current draft or published nodes and metadata.
|
|
395
|
+
*/
|
|
396
|
+
export interface JourneyResponse {
|
|
397
|
+
id: string;
|
|
398
|
+
created: number | null;
|
|
399
|
+
creator: string | null;
|
|
400
|
+
enabled: boolean;
|
|
401
|
+
name: string;
|
|
402
|
+
nodes: Array<JourneyNode>;
|
|
403
|
+
published: number | null;
|
|
404
|
+
/**
|
|
405
|
+
* Lifecycle state of a journey.
|
|
406
|
+
*/
|
|
407
|
+
state: JourneyState;
|
|
408
|
+
updated: number | null;
|
|
409
|
+
updater: string | null;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Trigger fired by a segment event (`identify`, `group`, or `track`).
|
|
413
|
+
*/
|
|
414
|
+
export interface JourneySegmentTriggerNode {
|
|
415
|
+
request_type: 'identify' | 'group' | 'track';
|
|
416
|
+
trigger_type: 'segment';
|
|
417
|
+
type: 'trigger';
|
|
418
|
+
id?: string;
|
|
419
|
+
/**
|
|
420
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
421
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
422
|
+
* express "no conditions".
|
|
423
|
+
*/
|
|
424
|
+
conditions?: JourneyConditionsField;
|
|
425
|
+
event_id?: string;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Send a notification template to the recipient. Optionally override the recipient
|
|
429
|
+
* address, delay the send, or attach `data`.
|
|
430
|
+
*/
|
|
431
|
+
export interface JourneySendNode {
|
|
432
|
+
message: JourneySendNode.Message;
|
|
433
|
+
type: 'send';
|
|
434
|
+
id?: string;
|
|
435
|
+
/**
|
|
436
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
437
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
438
|
+
* express "no conditions".
|
|
439
|
+
*/
|
|
440
|
+
conditions?: JourneyConditionsField;
|
|
441
|
+
}
|
|
442
|
+
export declare namespace JourneySendNode {
|
|
443
|
+
interface Message {
|
|
444
|
+
template: string;
|
|
445
|
+
data?: {
|
|
446
|
+
[key: string]: unknown;
|
|
447
|
+
};
|
|
448
|
+
delay?: Message.Delay;
|
|
449
|
+
to?: Message.To;
|
|
450
|
+
}
|
|
451
|
+
namespace Message {
|
|
452
|
+
interface Delay {
|
|
453
|
+
until: string;
|
|
454
|
+
timezone?: string;
|
|
455
|
+
}
|
|
456
|
+
interface To {
|
|
457
|
+
email_override?: string;
|
|
458
|
+
phone_number_override?: string;
|
|
459
|
+
user_id_override?: string;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Lifecycle state of a journey.
|
|
465
|
+
*/
|
|
466
|
+
export type JourneyState = 'DRAFT' | 'PUBLISHED';
|
|
467
|
+
/**
|
|
468
|
+
* Request body for creating a notification template scoped to a journey.
|
|
469
|
+
*/
|
|
470
|
+
export interface JourneyTemplateCreateRequest {
|
|
471
|
+
channel: string;
|
|
472
|
+
notification: JourneyTemplateCreateRequest.Notification;
|
|
473
|
+
providerKey?: string;
|
|
474
|
+
state?: string;
|
|
475
|
+
}
|
|
476
|
+
export declare namespace JourneyTemplateCreateRequest {
|
|
477
|
+
interface Notification {
|
|
478
|
+
brand: Notification.Brand | null;
|
|
479
|
+
content: Notification.Content;
|
|
480
|
+
name: string;
|
|
481
|
+
subscription: Notification.Subscription | null;
|
|
482
|
+
tags: Array<string>;
|
|
483
|
+
}
|
|
484
|
+
namespace Notification {
|
|
485
|
+
interface Brand {
|
|
486
|
+
id: string;
|
|
487
|
+
}
|
|
488
|
+
interface Content {
|
|
489
|
+
elements: Array<Shared.ElementalNode>;
|
|
490
|
+
version: '2022-01-01';
|
|
491
|
+
scope?: 'default' | 'strict';
|
|
492
|
+
}
|
|
493
|
+
interface Subscription {
|
|
494
|
+
topic_id: string;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* A journey-scoped notification template.
|
|
500
|
+
*/
|
|
501
|
+
export interface JourneyTemplateGetResponse {
|
|
502
|
+
id: string;
|
|
503
|
+
brand: JourneyTemplateGetResponse.Brand | null;
|
|
504
|
+
content: JourneyTemplateGetResponse.Content;
|
|
505
|
+
created: number;
|
|
506
|
+
creator: string;
|
|
507
|
+
name: string;
|
|
508
|
+
state: 'DRAFT' | 'PUBLISHED';
|
|
509
|
+
subscription: JourneyTemplateGetResponse.Subscription | null;
|
|
510
|
+
tags: Array<string>;
|
|
511
|
+
updated?: number;
|
|
512
|
+
updater?: string;
|
|
513
|
+
}
|
|
514
|
+
export declare namespace JourneyTemplateGetResponse {
|
|
515
|
+
interface Brand {
|
|
516
|
+
id: string;
|
|
517
|
+
}
|
|
518
|
+
interface Content {
|
|
519
|
+
elements: Array<Shared.ElementalNode>;
|
|
520
|
+
version: '2022-01-01';
|
|
521
|
+
scope?: 'default' | 'strict';
|
|
522
|
+
}
|
|
523
|
+
interface Subscription {
|
|
524
|
+
topic_id: string;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Paged list of journey-scoped notification templates.
|
|
529
|
+
*/
|
|
530
|
+
export interface JourneyTemplateListResponse {
|
|
531
|
+
paging: Shared.Paging;
|
|
532
|
+
results: Array<JourneyTemplateSummary>;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Request body for publishing a journey-scoped notification template. Pass
|
|
536
|
+
* `version` to roll back to a prior version; omit to publish the current draft.
|
|
537
|
+
*/
|
|
538
|
+
export interface JourneyTemplatePublishRequest {
|
|
539
|
+
version?: string;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Request body for replacing a journey-scoped notification template draft.
|
|
543
|
+
*/
|
|
544
|
+
export interface JourneyTemplateReplaceRequest {
|
|
545
|
+
notification: JourneyTemplateReplaceRequest.Notification;
|
|
546
|
+
state?: string;
|
|
547
|
+
}
|
|
548
|
+
export declare namespace JourneyTemplateReplaceRequest {
|
|
549
|
+
interface Notification {
|
|
550
|
+
brand: Notification.Brand | null;
|
|
551
|
+
content: Notification.Content;
|
|
552
|
+
name: string;
|
|
553
|
+
subscription: Notification.Subscription | null;
|
|
554
|
+
tags: Array<string>;
|
|
555
|
+
}
|
|
556
|
+
namespace Notification {
|
|
557
|
+
interface Brand {
|
|
558
|
+
id: string;
|
|
559
|
+
}
|
|
560
|
+
interface Content {
|
|
561
|
+
elements: Array<Shared.ElementalNode>;
|
|
562
|
+
version: '2022-01-01';
|
|
563
|
+
scope?: 'default' | 'strict';
|
|
564
|
+
}
|
|
565
|
+
interface Subscription {
|
|
566
|
+
topic_id: string;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Summary fields of a journey-scoped notification template returned in list
|
|
572
|
+
* responses.
|
|
573
|
+
*/
|
|
574
|
+
export interface JourneyTemplateSummary {
|
|
575
|
+
id: string;
|
|
576
|
+
created: number;
|
|
577
|
+
creator: string;
|
|
578
|
+
name: string;
|
|
579
|
+
state: string;
|
|
580
|
+
tags: Array<string>;
|
|
581
|
+
updated?: number;
|
|
582
|
+
updater?: string;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Throttle the journey by a dynamic `throttle_key`, allowing at most `max_allowed`
|
|
586
|
+
* invocations per `period`.
|
|
587
|
+
*/
|
|
588
|
+
export interface JourneyThrottleDynamicNode {
|
|
589
|
+
max_allowed: number;
|
|
590
|
+
period: string;
|
|
591
|
+
scope: 'dynamic';
|
|
592
|
+
throttle_key: string;
|
|
593
|
+
type: 'throttle';
|
|
594
|
+
id?: string;
|
|
595
|
+
/**
|
|
596
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
597
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
598
|
+
* express "no conditions".
|
|
599
|
+
*/
|
|
600
|
+
conditions?: JourneyConditionsField;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Throttle the journey by a static `scope` (`user` or `global`), allowing at most
|
|
604
|
+
* `max_allowed` invocations per `period`.
|
|
605
|
+
*/
|
|
606
|
+
export interface JourneyThrottleStaticNode {
|
|
607
|
+
max_allowed: number;
|
|
608
|
+
period: string;
|
|
609
|
+
scope: 'user' | 'global';
|
|
610
|
+
type: 'throttle';
|
|
611
|
+
id?: string;
|
|
612
|
+
/**
|
|
613
|
+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
614
|
+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
615
|
+
* express "no conditions".
|
|
616
|
+
*/
|
|
617
|
+
conditions?: JourneyConditionsField;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* A published version of a journey.
|
|
621
|
+
*/
|
|
622
|
+
export interface JourneyVersionItem {
|
|
623
|
+
created: number | null;
|
|
624
|
+
creator: string | null;
|
|
625
|
+
name: string;
|
|
626
|
+
published: number | null;
|
|
627
|
+
version: string;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Paged list of published journey versions, most recent first.
|
|
631
|
+
*/
|
|
632
|
+
export interface JourneyVersionsListResponse {
|
|
633
|
+
paging: Shared.Paging;
|
|
634
|
+
results: Array<JourneyVersionItem>;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Request body for invoking a journey. Requires either a user identifier or a
|
|
638
|
+
* profile with contact information. User identifiers can be provided via user_id
|
|
639
|
+
* field, or resolved from profile/data objects (user_id, userId, or anonymousId
|
|
640
|
+
* fields).
|
|
641
|
+
*/
|
|
642
|
+
export interface JourneysInvokeRequest {
|
|
643
|
+
/**
|
|
644
|
+
* Data payload passed to the journey. The expected shape can be predefined using
|
|
645
|
+
* the schema builder in the journey editor. This data is available in journey
|
|
646
|
+
* steps for condition evaluation and template variable interpolation. Can also
|
|
647
|
+
* contain user identifiers (user_id, userId, anonymousId) if not provided
|
|
648
|
+
* elsewhere.
|
|
649
|
+
*/
|
|
650
|
+
data?: {
|
|
651
|
+
[key: string]: unknown;
|
|
652
|
+
};
|
|
653
|
+
/**
|
|
654
|
+
* Profile data for the user. Can contain contact information (email,
|
|
655
|
+
* phone_number), user identifiers (user_id, userId, anonymousId), or any custom
|
|
656
|
+
* profile fields. Profile fields are merged with any existing stored profile for
|
|
657
|
+
* the user. Include context.tenant_id to load a tenant-scoped profile for
|
|
658
|
+
* multi-tenant scenarios.
|
|
659
|
+
*/
|
|
660
|
+
profile?: {
|
|
661
|
+
[key: string]: unknown;
|
|
662
|
+
};
|
|
663
|
+
/**
|
|
664
|
+
* A unique identifier for the user. If not provided, the system will attempt to
|
|
665
|
+
* resolve the user identifier from profile or data objects.
|
|
666
|
+
*/
|
|
667
|
+
user_id?: string;
|
|
668
|
+
}
|
|
669
|
+
export interface JourneysInvokeResponse {
|
|
670
|
+
/**
|
|
671
|
+
* A unique identifier for the journey run that was created.
|
|
672
|
+
*/
|
|
673
|
+
runId: string;
|
|
674
|
+
}
|
|
675
|
+
export interface JourneysListResponse {
|
|
676
|
+
/**
|
|
677
|
+
* A cursor token for pagination. Present when there are more results available.
|
|
678
|
+
*/
|
|
679
|
+
cursor?: string;
|
|
680
|
+
templates?: Array<Journey>;
|
|
681
|
+
}
|
|
682
|
+
export interface JourneyCreateParams {
|
|
683
|
+
name: string;
|
|
684
|
+
nodes: Array<JourneyNode>;
|
|
685
|
+
enabled?: boolean;
|
|
686
|
+
/**
|
|
687
|
+
* Lifecycle state of a journey.
|
|
688
|
+
*/
|
|
689
|
+
state?: JourneyState;
|
|
690
|
+
}
|
|
691
|
+
export interface JourneyRetrieveParams {
|
|
692
|
+
/**
|
|
693
|
+
* Version selector: `draft`, `published` (default), or `vN`.
|
|
694
|
+
*/
|
|
695
|
+
version?: string;
|
|
696
|
+
}
|
|
697
|
+
export interface JourneyListParams {
|
|
698
|
+
/**
|
|
699
|
+
* A cursor token for pagination. Use the cursor from the previous response to
|
|
700
|
+
* fetch the next page of results.
|
|
701
|
+
*/
|
|
702
|
+
cursor?: string;
|
|
703
|
+
/**
|
|
704
|
+
* The version of journeys to retrieve. Accepted values are published (for
|
|
705
|
+
* published journeys) or draft (for draft journeys). Defaults to published.
|
|
706
|
+
*/
|
|
707
|
+
version?: 'published' | 'draft';
|
|
708
|
+
}
|
|
709
|
+
export interface JourneyInvokeParams {
|
|
710
|
+
/**
|
|
711
|
+
* Data payload passed to the journey. The expected shape can be predefined using
|
|
712
|
+
* the schema builder in the journey editor. This data is available in journey
|
|
713
|
+
* steps for condition evaluation and template variable interpolation. Can also
|
|
714
|
+
* contain user identifiers (user_id, userId, anonymousId) if not provided
|
|
715
|
+
* elsewhere.
|
|
716
|
+
*/
|
|
717
|
+
data?: {
|
|
718
|
+
[key: string]: unknown;
|
|
719
|
+
};
|
|
720
|
+
/**
|
|
721
|
+
* Profile data for the user. Can contain contact information (email,
|
|
722
|
+
* phone_number), user identifiers (user_id, userId, anonymousId), or any custom
|
|
723
|
+
* profile fields. Profile fields are merged with any existing stored profile for
|
|
724
|
+
* the user. Include context.tenant_id to load a tenant-scoped profile for
|
|
725
|
+
* multi-tenant scenarios.
|
|
726
|
+
*/
|
|
727
|
+
profile?: {
|
|
728
|
+
[key: string]: unknown;
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
* A unique identifier for the user. If not provided, the system will attempt to
|
|
732
|
+
* resolve the user identifier from profile or data objects.
|
|
733
|
+
*/
|
|
734
|
+
user_id?: string;
|
|
735
|
+
}
|
|
736
|
+
export interface JourneyPublishParams {
|
|
737
|
+
version?: string;
|
|
738
|
+
}
|
|
739
|
+
export interface JourneyReplaceParams {
|
|
740
|
+
name: string;
|
|
741
|
+
nodes: Array<JourneyNode>;
|
|
742
|
+
enabled?: boolean;
|
|
743
|
+
/**
|
|
744
|
+
* Lifecycle state of a journey.
|
|
745
|
+
*/
|
|
746
|
+
state?: JourneyState;
|
|
747
|
+
}
|
|
748
|
+
export declare namespace Journeys {
|
|
749
|
+
export { type CreateJourneyRequest as CreateJourneyRequest, type Journey as Journey, type JourneyAINode as JourneyAINode, type JourneyAPIInvokeTriggerNode as JourneyAPIInvokeTriggerNode, type JourneyConditionAtom as JourneyConditionAtom, type JourneyConditionGroup as JourneyConditionGroup, type JourneyConditionNestedGroup as JourneyConditionNestedGroup, type JourneyConditionsField as JourneyConditionsField, type JourneyDelayDurationNode as JourneyDelayDurationNode, type JourneyDelayUntilNode as JourneyDelayUntilNode, type JourneyExitNode as JourneyExitNode, type JourneyFetchGetDeleteNode as JourneyFetchGetDeleteNode, type JourneyFetchPostPutNode as JourneyFetchPostPutNode, type JourneyMergeStrategy as JourneyMergeStrategy, type JourneyNode as JourneyNode, type JourneyPublishRequest as JourneyPublishRequest, type JourneyResponse as JourneyResponse, type JourneySegmentTriggerNode as JourneySegmentTriggerNode, type JourneySendNode as JourneySendNode, type JourneyState as JourneyState, type JourneyTemplateCreateRequest as JourneyTemplateCreateRequest, type JourneyTemplateGetResponse as JourneyTemplateGetResponse, type JourneyTemplateListResponse as JourneyTemplateListResponse, type JourneyTemplatePublishRequest as JourneyTemplatePublishRequest, type JourneyTemplateReplaceRequest as JourneyTemplateReplaceRequest, type JourneyTemplateSummary as JourneyTemplateSummary, type JourneyThrottleDynamicNode as JourneyThrottleDynamicNode, type JourneyThrottleStaticNode as JourneyThrottleStaticNode, type JourneyVersionItem as JourneyVersionItem, type JourneyVersionsListResponse as JourneyVersionsListResponse, type JourneysInvokeRequest as JourneysInvokeRequest, type JourneysInvokeResponse as JourneysInvokeResponse, type JourneysListResponse as JourneysListResponse, type JourneyCreateParams as JourneyCreateParams, type JourneyRetrieveParams as JourneyRetrieveParams, type JourneyListParams as JourneyListParams, type JourneyInvokeParams as JourneyInvokeParams, type JourneyPublishParams as JourneyPublishParams, type JourneyReplaceParams as JourneyReplaceParams, };
|
|
750
|
+
export { Templates as Templates, type TemplateCreateParams as TemplateCreateParams, type TemplateRetrieveParams as TemplateRetrieveParams, type TemplateListParams as TemplateListParams, type TemplateArchiveParams as TemplateArchiveParams, type TemplateListVersionsParams as TemplateListVersionsParams, type TemplatePublishParams as TemplatePublishParams, type TemplateReplaceParams as TemplateReplaceParams, };
|
|
751
|
+
}
|
|
752
|
+
//# sourceMappingURL=journeys.d.ts.map
|