@trycourier/courier 7.7.1 → 7.8.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 +21 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +9 -5
- package/client.js.map +1 -1
- package/client.mjs +9 -5
- package/client.mjs.map +1 -1
- package/package.json +12 -1
- 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.d.mts +143 -0
- package/resources/journeys.d.mts.map +1 -0
- package/resources/journeys.d.ts +143 -0
- package/resources/journeys.d.ts.map +1 -0
- package/resources/journeys.js +38 -0
- package/resources/journeys.js.map +1 -0
- package/resources/journeys.mjs +34 -0
- package/resources/journeys.mjs.map +1 -0
- package/resources/messages.d.mts +20 -20
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +20 -20
- package/resources/messages.d.ts.map +1 -1
- package/src/client.ts +27 -5
- package/src/resources/index.ts +9 -0
- package/src/resources/journeys.ts +174 -0
- package/src/resources/messages.ts +24 -24
- 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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
export declare class Journeys extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get the list of journeys.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const journeysListResponse = await client.journeys.list();
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
list(query?: JourneyListParams | null | undefined, options?: RequestOptions): APIPromise<JourneysListResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Invoke a journey run from a journey template.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const journeysInvokeResponse = await client.journeys.invoke(
|
|
20
|
+
* 'templateId',
|
|
21
|
+
* {
|
|
22
|
+
* data: { order_id: 'order-456', amount: 99.99 },
|
|
23
|
+
* user_id: 'user-123',
|
|
24
|
+
* },
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
invoke(templateID: string, body: JourneyInvokeParams, options?: RequestOptions): APIPromise<JourneysInvokeResponse>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A journey template representing an automation workflow.
|
|
32
|
+
*/
|
|
33
|
+
export interface Journey {
|
|
34
|
+
/**
|
|
35
|
+
* The unique identifier of the journey.
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* The name of the journey.
|
|
40
|
+
*/
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* The version of the journey (published or draft).
|
|
44
|
+
*/
|
|
45
|
+
version: 'published' | 'draft';
|
|
46
|
+
/**
|
|
47
|
+
* ISO 8601 timestamp when the journey was created.
|
|
48
|
+
*/
|
|
49
|
+
createdAt?: string;
|
|
50
|
+
/**
|
|
51
|
+
* ISO 8601 timestamp when the journey was last updated.
|
|
52
|
+
*/
|
|
53
|
+
updatedAt?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Request body for invoking a journey. Requires either a user identifier or a
|
|
57
|
+
* profile with contact information. User identifiers can be provided via user_id
|
|
58
|
+
* field, or resolved from profile/data objects (user_id, userId, or anonymousId
|
|
59
|
+
* fields).
|
|
60
|
+
*/
|
|
61
|
+
export interface JourneysInvokeRequest {
|
|
62
|
+
/**
|
|
63
|
+
* Data payload passed to the journey. The expected shape can be predefined using
|
|
64
|
+
* the schema builder in the journey editor. This data is available in journey
|
|
65
|
+
* steps for condition evaluation and template variable interpolation. Can also
|
|
66
|
+
* contain user identifiers (user_id, userId, anonymousId) if not provided
|
|
67
|
+
* elsewhere.
|
|
68
|
+
*/
|
|
69
|
+
data?: {
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Profile data for the user. Can contain contact information (email,
|
|
74
|
+
* phone_number), user identifiers (user_id, userId, anonymousId), or any custom
|
|
75
|
+
* profile fields. Profile fields are merged with any existing stored profile for
|
|
76
|
+
* the user. Include context.tenant_id to load a tenant-scoped profile for
|
|
77
|
+
* multi-tenant scenarios.
|
|
78
|
+
*/
|
|
79
|
+
profile?: {
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A unique identifier for the user. If not provided, the system will attempt to
|
|
84
|
+
* resolve the user identifier from profile or data objects.
|
|
85
|
+
*/
|
|
86
|
+
user_id?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface JourneysInvokeResponse {
|
|
89
|
+
/**
|
|
90
|
+
* A unique identifier for the journey run that was created.
|
|
91
|
+
*/
|
|
92
|
+
runId: string;
|
|
93
|
+
}
|
|
94
|
+
export interface JourneysListResponse {
|
|
95
|
+
/**
|
|
96
|
+
* A cursor token for pagination. Present when there are more results available.
|
|
97
|
+
*/
|
|
98
|
+
cursor?: string;
|
|
99
|
+
templates?: Array<Journey>;
|
|
100
|
+
}
|
|
101
|
+
export interface JourneyListParams {
|
|
102
|
+
/**
|
|
103
|
+
* A cursor token for pagination. Use the cursor from the previous response to
|
|
104
|
+
* fetch the next page of results.
|
|
105
|
+
*/
|
|
106
|
+
cursor?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The version of journeys to retrieve. Accepted values are published (for
|
|
109
|
+
* published journeys) or draft (for draft journeys). Defaults to published.
|
|
110
|
+
*/
|
|
111
|
+
version?: 'published' | 'draft';
|
|
112
|
+
}
|
|
113
|
+
export interface JourneyInvokeParams {
|
|
114
|
+
/**
|
|
115
|
+
* Data payload passed to the journey. The expected shape can be predefined using
|
|
116
|
+
* the schema builder in the journey editor. This data is available in journey
|
|
117
|
+
* steps for condition evaluation and template variable interpolation. Can also
|
|
118
|
+
* contain user identifiers (user_id, userId, anonymousId) if not provided
|
|
119
|
+
* elsewhere.
|
|
120
|
+
*/
|
|
121
|
+
data?: {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Profile data for the user. Can contain contact information (email,
|
|
126
|
+
* phone_number), user identifiers (user_id, userId, anonymousId), or any custom
|
|
127
|
+
* profile fields. Profile fields are merged with any existing stored profile for
|
|
128
|
+
* the user. Include context.tenant_id to load a tenant-scoped profile for
|
|
129
|
+
* multi-tenant scenarios.
|
|
130
|
+
*/
|
|
131
|
+
profile?: {
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* A unique identifier for the user. If not provided, the system will attempt to
|
|
136
|
+
* resolve the user identifier from profile or data objects.
|
|
137
|
+
*/
|
|
138
|
+
user_id?: string;
|
|
139
|
+
}
|
|
140
|
+
export declare namespace Journeys {
|
|
141
|
+
export { type Journey as Journey, type JourneysInvokeRequest as JourneysInvokeRequest, type JourneysInvokeResponse as JourneysInvokeResponse, type JourneysListResponse as JourneysListResponse, type JourneyListParams as JourneyListParams, type JourneyInvokeParams as JourneyInvokeParams, };
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=journeys.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journeys.d.mts","sourceRoot":"","sources":["../src/resources/journeys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;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AAW,mBAAmB;IAClC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAElC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAErC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class Journeys extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get the list of journeys.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const journeysListResponse = await client.journeys.list();
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
list(query?: JourneyListParams | null | undefined, options?: RequestOptions): APIPromise<JourneysListResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Invoke a journey run from a journey template.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const journeysInvokeResponse = await client.journeys.invoke(
|
|
20
|
+
* 'templateId',
|
|
21
|
+
* {
|
|
22
|
+
* data: { order_id: 'order-456', amount: 99.99 },
|
|
23
|
+
* user_id: 'user-123',
|
|
24
|
+
* },
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
invoke(templateID: string, body: JourneyInvokeParams, options?: RequestOptions): APIPromise<JourneysInvokeResponse>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A journey template representing an automation workflow.
|
|
32
|
+
*/
|
|
33
|
+
export interface Journey {
|
|
34
|
+
/**
|
|
35
|
+
* The unique identifier of the journey.
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* The name of the journey.
|
|
40
|
+
*/
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* The version of the journey (published or draft).
|
|
44
|
+
*/
|
|
45
|
+
version: 'published' | 'draft';
|
|
46
|
+
/**
|
|
47
|
+
* ISO 8601 timestamp when the journey was created.
|
|
48
|
+
*/
|
|
49
|
+
createdAt?: string;
|
|
50
|
+
/**
|
|
51
|
+
* ISO 8601 timestamp when the journey was last updated.
|
|
52
|
+
*/
|
|
53
|
+
updatedAt?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Request body for invoking a journey. Requires either a user identifier or a
|
|
57
|
+
* profile with contact information. User identifiers can be provided via user_id
|
|
58
|
+
* field, or resolved from profile/data objects (user_id, userId, or anonymousId
|
|
59
|
+
* fields).
|
|
60
|
+
*/
|
|
61
|
+
export interface JourneysInvokeRequest {
|
|
62
|
+
/**
|
|
63
|
+
* Data payload passed to the journey. The expected shape can be predefined using
|
|
64
|
+
* the schema builder in the journey editor. This data is available in journey
|
|
65
|
+
* steps for condition evaluation and template variable interpolation. Can also
|
|
66
|
+
* contain user identifiers (user_id, userId, anonymousId) if not provided
|
|
67
|
+
* elsewhere.
|
|
68
|
+
*/
|
|
69
|
+
data?: {
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Profile data for the user. Can contain contact information (email,
|
|
74
|
+
* phone_number), user identifiers (user_id, userId, anonymousId), or any custom
|
|
75
|
+
* profile fields. Profile fields are merged with any existing stored profile for
|
|
76
|
+
* the user. Include context.tenant_id to load a tenant-scoped profile for
|
|
77
|
+
* multi-tenant scenarios.
|
|
78
|
+
*/
|
|
79
|
+
profile?: {
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A unique identifier for the user. If not provided, the system will attempt to
|
|
84
|
+
* resolve the user identifier from profile or data objects.
|
|
85
|
+
*/
|
|
86
|
+
user_id?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface JourneysInvokeResponse {
|
|
89
|
+
/**
|
|
90
|
+
* A unique identifier for the journey run that was created.
|
|
91
|
+
*/
|
|
92
|
+
runId: string;
|
|
93
|
+
}
|
|
94
|
+
export interface JourneysListResponse {
|
|
95
|
+
/**
|
|
96
|
+
* A cursor token for pagination. Present when there are more results available.
|
|
97
|
+
*/
|
|
98
|
+
cursor?: string;
|
|
99
|
+
templates?: Array<Journey>;
|
|
100
|
+
}
|
|
101
|
+
export interface JourneyListParams {
|
|
102
|
+
/**
|
|
103
|
+
* A cursor token for pagination. Use the cursor from the previous response to
|
|
104
|
+
* fetch the next page of results.
|
|
105
|
+
*/
|
|
106
|
+
cursor?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The version of journeys to retrieve. Accepted values are published (for
|
|
109
|
+
* published journeys) or draft (for draft journeys). Defaults to published.
|
|
110
|
+
*/
|
|
111
|
+
version?: 'published' | 'draft';
|
|
112
|
+
}
|
|
113
|
+
export interface JourneyInvokeParams {
|
|
114
|
+
/**
|
|
115
|
+
* Data payload passed to the journey. The expected shape can be predefined using
|
|
116
|
+
* the schema builder in the journey editor. This data is available in journey
|
|
117
|
+
* steps for condition evaluation and template variable interpolation. Can also
|
|
118
|
+
* contain user identifiers (user_id, userId, anonymousId) if not provided
|
|
119
|
+
* elsewhere.
|
|
120
|
+
*/
|
|
121
|
+
data?: {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Profile data for the user. Can contain contact information (email,
|
|
126
|
+
* phone_number), user identifiers (user_id, userId, anonymousId), or any custom
|
|
127
|
+
* profile fields. Profile fields are merged with any existing stored profile for
|
|
128
|
+
* the user. Include context.tenant_id to load a tenant-scoped profile for
|
|
129
|
+
* multi-tenant scenarios.
|
|
130
|
+
*/
|
|
131
|
+
profile?: {
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* A unique identifier for the user. If not provided, the system will attempt to
|
|
136
|
+
* resolve the user identifier from profile or data objects.
|
|
137
|
+
*/
|
|
138
|
+
user_id?: string;
|
|
139
|
+
}
|
|
140
|
+
export declare namespace Journeys {
|
|
141
|
+
export { type Journey as Journey, type JourneysInvokeRequest as JourneysInvokeRequest, type JourneysInvokeResponse as JourneysInvokeResponse, type JourneysListResponse as JourneysListResponse, type JourneyListParams as JourneyListParams, type JourneyInvokeParams as JourneyInvokeParams, };
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=journeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journeys.d.ts","sourceRoot":"","sources":["../src/resources/journeys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAInC;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;CAGtC;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG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BAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Journeys = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const path_1 = require("../internal/utils/path.js");
|
|
7
|
+
class Journeys extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get the list of journeys.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const journeysListResponse = await client.journeys.list();
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
list(query = {}, options) {
|
|
17
|
+
return this._client.get('/journeys', { query, ...options });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Invoke a journey run from a journey template.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const journeysInvokeResponse = await client.journeys.invoke(
|
|
25
|
+
* 'templateId',
|
|
26
|
+
* {
|
|
27
|
+
* data: { order_id: 'order-456', amount: 99.99 },
|
|
28
|
+
* user_id: 'user-123',
|
|
29
|
+
* },
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
invoke(templateID, body, options) {
|
|
34
|
+
return this._client.post((0, path_1.path) `/journeys/${templateID}/invoke`, { body, ...options });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.Journeys = Journeys;
|
|
38
|
+
//# sourceMappingURL=journeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journeys.js","sourceRoot":"","sources":["../src/resources/journeys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;OAOG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,UAAkB,EAClB,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;CACF;AArCD,4BAqCC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { path } from "../internal/utils/path.mjs";
|
|
4
|
+
export class Journeys extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get the list of journeys.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const journeysListResponse = await client.journeys.list();
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
list(query = {}, options) {
|
|
14
|
+
return this._client.get('/journeys', { query, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Invoke a journey run from a journey template.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const journeysInvokeResponse = await client.journeys.invoke(
|
|
22
|
+
* 'templateId',
|
|
23
|
+
* {
|
|
24
|
+
* data: { order_id: 'order-456', amount: 99.99 },
|
|
25
|
+
* user_id: 'user-123',
|
|
26
|
+
* },
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
invoke(templateID, body, options) {
|
|
31
|
+
return this._client.post(path `/journeys/${templateID}/invoke`, { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=journeys.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journeys.mjs","sourceRoot":"","sources":["../src/resources/journeys.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;OAOG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,UAAkB,EAClB,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,UAAU,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;CACF"}
|
package/resources/messages.d.mts
CHANGED
|
@@ -34,16 +34,6 @@ export interface MessageDetails {
|
|
|
34
34
|
* from a send).
|
|
35
35
|
*/
|
|
36
36
|
id: string;
|
|
37
|
-
/**
|
|
38
|
-
* A UTC timestamp at which the recipient clicked on a tracked link for the first
|
|
39
|
-
* time. Stored as a millisecond representation of the Unix epoch.
|
|
40
|
-
*/
|
|
41
|
-
clicked: number;
|
|
42
|
-
/**
|
|
43
|
-
* A UTC timestamp at which the Integration provider delivered the message. Stored
|
|
44
|
-
* as a millisecond representation of the Unix epoch.
|
|
45
|
-
*/
|
|
46
|
-
delivered: number;
|
|
47
37
|
/**
|
|
48
38
|
* A UTC timestamp at which Courier received the message request. Stored as a
|
|
49
39
|
* millisecond representation of the Unix epoch.
|
|
@@ -57,32 +47,42 @@ export interface MessageDetails {
|
|
|
57
47
|
* A unique identifier associated with the notification of the delivered message.
|
|
58
48
|
*/
|
|
59
49
|
notification: string;
|
|
60
|
-
/**
|
|
61
|
-
* A UTC timestamp at which the recipient opened a message for the first time.
|
|
62
|
-
* Stored as a millisecond representation of the Unix epoch.
|
|
63
|
-
*/
|
|
64
|
-
opened: number;
|
|
65
50
|
/**
|
|
66
51
|
* A unique identifier associated with the recipient of the delivered message.
|
|
67
52
|
*/
|
|
68
53
|
recipient: string;
|
|
69
|
-
/**
|
|
70
|
-
* A UTC timestamp at which Courier passed the message to the Integration provider.
|
|
71
|
-
* Stored as a millisecond representation of the Unix epoch.
|
|
72
|
-
*/
|
|
73
|
-
sent: number;
|
|
74
54
|
/**
|
|
75
55
|
* The current status of the message.
|
|
76
56
|
*/
|
|
77
57
|
status: 'CANCELED' | 'CLICKED' | 'DELAYED' | 'DELIVERED' | 'DIGESTED' | 'ENQUEUED' | 'FILTERED' | 'OPENED' | 'ROUTED' | 'SENT' | 'SIMULATED' | 'THROTTLED' | 'UNDELIVERABLE' | 'UNMAPPED' | 'UNROUTABLE';
|
|
58
|
+
/**
|
|
59
|
+
* A UTC timestamp at which the recipient clicked on a tracked link for the first
|
|
60
|
+
* time. Stored as a millisecond representation of the Unix epoch.
|
|
61
|
+
*/
|
|
62
|
+
clicked?: number;
|
|
63
|
+
/**
|
|
64
|
+
* A UTC timestamp at which the Integration provider delivered the message. Stored
|
|
65
|
+
* as a millisecond representation of the Unix epoch.
|
|
66
|
+
*/
|
|
67
|
+
delivered?: number;
|
|
78
68
|
/**
|
|
79
69
|
* A message describing the error that occurred.
|
|
80
70
|
*/
|
|
81
71
|
error?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* A UTC timestamp at which the recipient opened a message for the first time.
|
|
74
|
+
* Stored as a millisecond representation of the Unix epoch.
|
|
75
|
+
*/
|
|
76
|
+
opened?: number;
|
|
82
77
|
/**
|
|
83
78
|
* The reason for the current status of the message.
|
|
84
79
|
*/
|
|
85
80
|
reason?: 'BOUNCED' | 'FAILED' | 'FILTERED' | 'NO_CHANNELS' | 'NO_PROVIDERS' | 'OPT_IN_REQUIRED' | 'PROVIDER_ERROR' | 'UNPUBLISHED' | 'UNSUBSCRIBED' | null;
|
|
81
|
+
/**
|
|
82
|
+
* A UTC timestamp at which Courier passed the message to the Integration provider.
|
|
83
|
+
* Stored as a millisecond representation of the Unix epoch.
|
|
84
|
+
*/
|
|
85
|
+
sent?: number;
|
|
86
86
|
}
|
|
87
87
|
export interface MessageRetrieveResponse extends MessageDetails {
|
|
88
88
|
providers?: Array<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAI1F;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAI/E;;OAEG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIxF;;OAEG;IACH,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,S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;IAE1B;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE9B;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE3B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/messages.d.ts
CHANGED
|
@@ -34,16 +34,6 @@ export interface MessageDetails {
|
|
|
34
34
|
* from a send).
|
|
35
35
|
*/
|
|
36
36
|
id: string;
|
|
37
|
-
/**
|
|
38
|
-
* A UTC timestamp at which the recipient clicked on a tracked link for the first
|
|
39
|
-
* time. Stored as a millisecond representation of the Unix epoch.
|
|
40
|
-
*/
|
|
41
|
-
clicked: number;
|
|
42
|
-
/**
|
|
43
|
-
* A UTC timestamp at which the Integration provider delivered the message. Stored
|
|
44
|
-
* as a millisecond representation of the Unix epoch.
|
|
45
|
-
*/
|
|
46
|
-
delivered: number;
|
|
47
37
|
/**
|
|
48
38
|
* A UTC timestamp at which Courier received the message request. Stored as a
|
|
49
39
|
* millisecond representation of the Unix epoch.
|
|
@@ -57,32 +47,42 @@ export interface MessageDetails {
|
|
|
57
47
|
* A unique identifier associated with the notification of the delivered message.
|
|
58
48
|
*/
|
|
59
49
|
notification: string;
|
|
60
|
-
/**
|
|
61
|
-
* A UTC timestamp at which the recipient opened a message for the first time.
|
|
62
|
-
* Stored as a millisecond representation of the Unix epoch.
|
|
63
|
-
*/
|
|
64
|
-
opened: number;
|
|
65
50
|
/**
|
|
66
51
|
* A unique identifier associated with the recipient of the delivered message.
|
|
67
52
|
*/
|
|
68
53
|
recipient: string;
|
|
69
|
-
/**
|
|
70
|
-
* A UTC timestamp at which Courier passed the message to the Integration provider.
|
|
71
|
-
* Stored as a millisecond representation of the Unix epoch.
|
|
72
|
-
*/
|
|
73
|
-
sent: number;
|
|
74
54
|
/**
|
|
75
55
|
* The current status of the message.
|
|
76
56
|
*/
|
|
77
57
|
status: 'CANCELED' | 'CLICKED' | 'DELAYED' | 'DELIVERED' | 'DIGESTED' | 'ENQUEUED' | 'FILTERED' | 'OPENED' | 'ROUTED' | 'SENT' | 'SIMULATED' | 'THROTTLED' | 'UNDELIVERABLE' | 'UNMAPPED' | 'UNROUTABLE';
|
|
58
|
+
/**
|
|
59
|
+
* A UTC timestamp at which the recipient clicked on a tracked link for the first
|
|
60
|
+
* time. Stored as a millisecond representation of the Unix epoch.
|
|
61
|
+
*/
|
|
62
|
+
clicked?: number;
|
|
63
|
+
/**
|
|
64
|
+
* A UTC timestamp at which the Integration provider delivered the message. Stored
|
|
65
|
+
* as a millisecond representation of the Unix epoch.
|
|
66
|
+
*/
|
|
67
|
+
delivered?: number;
|
|
78
68
|
/**
|
|
79
69
|
* A message describing the error that occurred.
|
|
80
70
|
*/
|
|
81
71
|
error?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* A UTC timestamp at which the recipient opened a message for the first time.
|
|
74
|
+
* Stored as a millisecond representation of the Unix epoch.
|
|
75
|
+
*/
|
|
76
|
+
opened?: number;
|
|
82
77
|
/**
|
|
83
78
|
* The reason for the current status of the message.
|
|
84
79
|
*/
|
|
85
80
|
reason?: 'BOUNCED' | 'FAILED' | 'FILTERED' | 'NO_CHANNELS' | 'NO_PROVIDERS' | 'OPT_IN_REQUIRED' | 'PROVIDER_ERROR' | 'UNPUBLISHED' | 'UNSUBSCRIBED' | null;
|
|
81
|
+
/**
|
|
82
|
+
* A UTC timestamp at which Courier passed the message to the Integration provider.
|
|
83
|
+
* Stored as a millisecond representation of the Unix epoch.
|
|
84
|
+
*/
|
|
85
|
+
sent?: number;
|
|
86
86
|
}
|
|
87
87
|
export interface MessageRetrieveResponse extends MessageDetails {
|
|
88
88
|
providers?: Array<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAI1F;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAI/E;;OAEG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIxF;;OAEG;IACH,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU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CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE9B;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE3B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/src/client.ts
CHANGED
|
@@ -67,6 +67,15 @@ import {
|
|
|
67
67
|
InboundBulkMessageUser,
|
|
68
68
|
} from './resources/bulk';
|
|
69
69
|
import { Inbound, InboundTrackEventParams, InboundTrackEventResponse } from './resources/inbound';
|
|
70
|
+
import {
|
|
71
|
+
Journey,
|
|
72
|
+
JourneyInvokeParams,
|
|
73
|
+
JourneyListParams,
|
|
74
|
+
Journeys,
|
|
75
|
+
JourneysInvokeRequest,
|
|
76
|
+
JourneysInvokeResponse,
|
|
77
|
+
JourneysListResponse,
|
|
78
|
+
} from './resources/journeys';
|
|
70
79
|
import {
|
|
71
80
|
MessageContentResponse,
|
|
72
81
|
MessageDetails,
|
|
@@ -364,8 +373,9 @@ export class Courier {
|
|
|
364
373
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
365
374
|
|
|
366
375
|
const defaultQuery = this.defaultQuery();
|
|
367
|
-
|
|
368
|
-
|
|
376
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
377
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
378
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
369
379
|
}
|
|
370
380
|
|
|
371
381
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
@@ -674,9 +684,9 @@ export class Courier {
|
|
|
674
684
|
}
|
|
675
685
|
}
|
|
676
686
|
|
|
677
|
-
// If the API asks us to wait a certain amount of time
|
|
678
|
-
//
|
|
679
|
-
if (
|
|
687
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
688
|
+
// says, but otherwise calculate a default
|
|
689
|
+
if (timeoutMillis === undefined) {
|
|
680
690
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
681
691
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
682
692
|
}
|
|
@@ -839,6 +849,7 @@ export class Courier {
|
|
|
839
849
|
auditEvents: API.AuditEvents = new API.AuditEvents(this);
|
|
840
850
|
auth: API.Auth = new API.Auth(this);
|
|
841
851
|
automations: API.Automations = new API.Automations(this);
|
|
852
|
+
journeys: API.Journeys = new API.Journeys(this);
|
|
842
853
|
brands: API.Brands = new API.Brands(this);
|
|
843
854
|
bulk: API.Bulk = new API.Bulk(this);
|
|
844
855
|
inbound: API.Inbound = new API.Inbound(this);
|
|
@@ -857,6 +868,7 @@ Courier.Audiences = Audiences;
|
|
|
857
868
|
Courier.AuditEvents = AuditEvents;
|
|
858
869
|
Courier.Auth = Auth;
|
|
859
870
|
Courier.Automations = Automations;
|
|
871
|
+
Courier.Journeys = Journeys;
|
|
860
872
|
Courier.Brands = Brands;
|
|
861
873
|
Courier.Bulk = Bulk;
|
|
862
874
|
Courier.Inbound = Inbound;
|
|
@@ -910,6 +922,16 @@ export declare namespace Courier {
|
|
|
910
922
|
type AutomationListParams as AutomationListParams,
|
|
911
923
|
};
|
|
912
924
|
|
|
925
|
+
export {
|
|
926
|
+
Journeys as Journeys,
|
|
927
|
+
type Journey as Journey,
|
|
928
|
+
type JourneysInvokeRequest as JourneysInvokeRequest,
|
|
929
|
+
type JourneysInvokeResponse as JourneysInvokeResponse,
|
|
930
|
+
type JourneysListResponse as JourneysListResponse,
|
|
931
|
+
type JourneyListParams as JourneyListParams,
|
|
932
|
+
type JourneyInvokeParams as JourneyInvokeParams,
|
|
933
|
+
};
|
|
934
|
+
|
|
913
935
|
export {
|
|
914
936
|
Brands as Brands,
|
|
915
937
|
type Brand as Brand,
|
package/src/resources/index.ts
CHANGED
|
@@ -58,6 +58,15 @@ export {
|
|
|
58
58
|
type BulkListUsersParams,
|
|
59
59
|
} from './bulk';
|
|
60
60
|
export { Inbound, type InboundTrackEventResponse, type InboundTrackEventParams } from './inbound';
|
|
61
|
+
export {
|
|
62
|
+
Journeys,
|
|
63
|
+
type Journey,
|
|
64
|
+
type JourneysInvokeRequest,
|
|
65
|
+
type JourneysInvokeResponse,
|
|
66
|
+
type JourneysListResponse,
|
|
67
|
+
type JourneyListParams,
|
|
68
|
+
type JourneyInvokeParams,
|
|
69
|
+
} from './journeys';
|
|
61
70
|
export {
|
|
62
71
|
Lists,
|
|
63
72
|
type PutSubscriptionsRecipient,
|