@knocklabs/node 1.30.0 → 1.31.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 +13 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +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/workflow-recipient-runs.d.mts +202 -0
- package/resources/workflow-recipient-runs.d.mts.map +1 -0
- package/resources/workflow-recipient-runs.d.ts +202 -0
- package/resources/workflow-recipient-runs.d.ts.map +1 -0
- package/resources/workflow-recipient-runs.js +43 -0
- package/resources/workflow-recipient-runs.js.map +1 -0
- package/resources/workflow-recipient-runs.mjs +39 -0
- package/resources/workflow-recipient-runs.mjs.map +1 -0
- package/src/client.ts +22 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/workflow-recipient-runs.ts +255 -0
- 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,202 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as RecipientsAPI from "./recipients/recipients.mjs";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
+
import { ItemsCursor, type ItemsCursorParams, PagePromise } from "../core/pagination.mjs";
|
|
5
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* A workflow run represents an individual execution of a workflow for a specific recipient.
|
|
8
|
+
*/
|
|
9
|
+
export declare class WorkflowRecipientRuns extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Returns a paginated list of workflow recipient runs for the current environment.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // Automatically fetches more pages as needed.
|
|
16
|
+
* for await (const workflowRecipientRun of client.workflowRecipientRuns.list()) {
|
|
17
|
+
* // ...
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(query?: WorkflowRecipientRunListParams | null | undefined, options?: RequestOptions): PagePromise<WorkflowRecipientRunsItemsCursor, WorkflowRecipientRun>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns a single workflow recipient run with its associated events.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const workflowRecipientRunDetail =
|
|
28
|
+
* await client.workflowRecipientRuns.get('id');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
get(id: string, options?: RequestOptions): APIPromise<WorkflowRecipientRunDetail>;
|
|
32
|
+
}
|
|
33
|
+
export type WorkflowRecipientRunsItemsCursor = ItemsCursor<WorkflowRecipientRun>;
|
|
34
|
+
/**
|
|
35
|
+
* A workflow recipient run represents an individual execution of a workflow for a
|
|
36
|
+
* specific recipient.
|
|
37
|
+
*/
|
|
38
|
+
export interface WorkflowRecipientRun {
|
|
39
|
+
/**
|
|
40
|
+
* The unique identifier for the workflow recipient run (per-recipient).
|
|
41
|
+
*/
|
|
42
|
+
id: string;
|
|
43
|
+
/**
|
|
44
|
+
* The typename of the schema.
|
|
45
|
+
*/
|
|
46
|
+
__typename: string;
|
|
47
|
+
/**
|
|
48
|
+
* Timestamp when the resource was created.
|
|
49
|
+
*/
|
|
50
|
+
inserted_at: string;
|
|
51
|
+
/**
|
|
52
|
+
* A reference to a recipient, either a user identifier (string) or an object
|
|
53
|
+
* reference (ID, collection).
|
|
54
|
+
*/
|
|
55
|
+
recipient: RecipientsAPI.RecipientReference;
|
|
56
|
+
/**
|
|
57
|
+
* The current status of the workflow recipient run. One of `queued`, `processing`,
|
|
58
|
+
* `paused`, `completed`, or `cancelled`.
|
|
59
|
+
*/
|
|
60
|
+
status: 'queued' | 'processing' | 'paused' | 'completed' | 'cancelled';
|
|
61
|
+
/**
|
|
62
|
+
* Describes how the workflow was triggered.
|
|
63
|
+
*/
|
|
64
|
+
trigger_source: WorkflowRecipientRun.TriggerSource;
|
|
65
|
+
/**
|
|
66
|
+
* The timestamp when the resource was last updated.
|
|
67
|
+
*/
|
|
68
|
+
updated_at: string;
|
|
69
|
+
/**
|
|
70
|
+
* The key of the workflow that was executed.
|
|
71
|
+
*/
|
|
72
|
+
workflow: string;
|
|
73
|
+
/**
|
|
74
|
+
* The identifier for the top-level workflow run shared across all recipients in a
|
|
75
|
+
* single trigger.
|
|
76
|
+
*/
|
|
77
|
+
workflow_run_id: string;
|
|
78
|
+
/**
|
|
79
|
+
* A recipient of a notification, which is either a user or an object.
|
|
80
|
+
*/
|
|
81
|
+
actor?: RecipientsAPI.Recipient | null;
|
|
82
|
+
/**
|
|
83
|
+
* The number of errors encountered during the workflow recipient run.
|
|
84
|
+
*/
|
|
85
|
+
error_count?: number;
|
|
86
|
+
/**
|
|
87
|
+
* The tenant associated with the workflow recipient run.
|
|
88
|
+
*/
|
|
89
|
+
tenant?: string | null;
|
|
90
|
+
}
|
|
91
|
+
export declare namespace WorkflowRecipientRun {
|
|
92
|
+
/**
|
|
93
|
+
* Describes how the workflow was triggered.
|
|
94
|
+
*/
|
|
95
|
+
interface TriggerSource {
|
|
96
|
+
/**
|
|
97
|
+
* The type of trigger source. One of `api`, `audience`, `schedule`, `broadcast`,
|
|
98
|
+
* `workflow_step`, `integration`, or `rehearsal`.
|
|
99
|
+
*/
|
|
100
|
+
type: 'api' | 'audience' | 'schedule' | 'broadcast' | 'workflow_step' | 'integration' | 'rehearsal';
|
|
101
|
+
/**
|
|
102
|
+
* The key of the audience that triggered the workflow.
|
|
103
|
+
*/
|
|
104
|
+
audience_key?: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* The cancellation key provided when the workflow was triggered via the API.
|
|
107
|
+
*/
|
|
108
|
+
cancellation_key?: string | null;
|
|
109
|
+
/**
|
|
110
|
+
* The ID of the schedule that triggered the workflow.
|
|
111
|
+
*/
|
|
112
|
+
schedule_id?: string | null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A single workflow recipient run with its events.
|
|
117
|
+
*/
|
|
118
|
+
export interface WorkflowRecipientRunDetail extends WorkflowRecipientRun {
|
|
119
|
+
/**
|
|
120
|
+
* A list of events that occurred during the workflow recipient run.
|
|
121
|
+
*/
|
|
122
|
+
events: Array<WorkflowRecipientRunEvent>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* An event that occurred during a workflow recipient run.
|
|
126
|
+
*/
|
|
127
|
+
export interface WorkflowRecipientRunEvent {
|
|
128
|
+
/**
|
|
129
|
+
* The unique identifier for the event.
|
|
130
|
+
*/
|
|
131
|
+
id: string;
|
|
132
|
+
/**
|
|
133
|
+
* The typename of the schema.
|
|
134
|
+
*/
|
|
135
|
+
__typename: string;
|
|
136
|
+
/**
|
|
137
|
+
* The type of event that occurred.
|
|
138
|
+
*/
|
|
139
|
+
event: string;
|
|
140
|
+
/**
|
|
141
|
+
* Timestamp when the resource was created.
|
|
142
|
+
*/
|
|
143
|
+
inserted_at: string;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the event represents a successful or error state.
|
|
146
|
+
*/
|
|
147
|
+
status: 'ok' | 'error';
|
|
148
|
+
/**
|
|
149
|
+
* The attempt number of the workflow recipient run event. Increments for each
|
|
150
|
+
* retry.
|
|
151
|
+
*/
|
|
152
|
+
attempt?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Event-specific data associated with the event.
|
|
155
|
+
*/
|
|
156
|
+
data?: {
|
|
157
|
+
[key: string]: unknown;
|
|
158
|
+
} | null;
|
|
159
|
+
/**
|
|
160
|
+
* The reference of the workflow step associated with this event.
|
|
161
|
+
*/
|
|
162
|
+
step_ref?: string | null;
|
|
163
|
+
/**
|
|
164
|
+
* The type of workflow step associated with this event.
|
|
165
|
+
*/
|
|
166
|
+
step_type?: string | null;
|
|
167
|
+
}
|
|
168
|
+
export interface WorkflowRecipientRunListParams extends ItemsCursorParams {
|
|
169
|
+
/**
|
|
170
|
+
* Limits the results to workflow recipient runs started before the given date.
|
|
171
|
+
*/
|
|
172
|
+
ending_at?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Limits the results to workflow recipient runs that have errors.
|
|
175
|
+
*/
|
|
176
|
+
has_errors?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Limits the results to workflow recipient runs for the given recipient. Accepts a
|
|
179
|
+
* user ID string or an object reference with `id` and `collection`.
|
|
180
|
+
*/
|
|
181
|
+
recipient?: RecipientsAPI.RecipientReference;
|
|
182
|
+
/**
|
|
183
|
+
* Limits the results to workflow recipient runs started after the given date.
|
|
184
|
+
*/
|
|
185
|
+
starting_at?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Limits the results to workflow recipient runs with the given status.
|
|
188
|
+
*/
|
|
189
|
+
status?: Array<'queued' | 'processing' | 'paused' | 'completed' | 'cancelled'>;
|
|
190
|
+
/**
|
|
191
|
+
* Limits the results to workflow recipient runs for the given tenant.
|
|
192
|
+
*/
|
|
193
|
+
tenant?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Limits the results to workflow recipient runs for the given workflow key.
|
|
196
|
+
*/
|
|
197
|
+
workflow?: string;
|
|
198
|
+
}
|
|
199
|
+
export declare namespace WorkflowRecipientRuns {
|
|
200
|
+
export { type WorkflowRecipientRun as WorkflowRecipientRun, type WorkflowRecipientRunDetail as WorkflowRecipientRunDetail, type WorkflowRecipientRunEvent as WorkflowRecipientRunEvent, type WorkflowRecipientRunsItemsCursor as WorkflowRecipientRunsItemsCursor, type WorkflowRecipientRunListParams as WorkflowRecipientRunListParams, };
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=workflow-recipient-runs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-recipient-runs.d.mts","sourceRoot":"","sources":["../src/resources/workflow-recipient-runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,WAAW,EAAE;OACpD,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,8BAA8B,GAAG,IAAI,GAAG,SAAc,EAC7D,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gCAAgC,EAAE,oBAAoB,CAAC;IAOtE;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGlF;AAED,MAAM,MAAM,gCAAgC,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,EAAE,aAAa,CAAC,kBAAkB,CAAC;IAE5C;;;OAGG;IACH,MAAM,EAAE,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;IAEvE;;OAEG;IACH,cAAc,EAAE,oBAAoB,CAAC,aAAa,CAAC;IAEnD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,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AAW,8BAA+B,SAAQ,iBAAiB;IACvE;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;IAE/E;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,qBAAqB,CAAC;IAC7C,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;CACH"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import * as RecipientsAPI from "./recipients/recipients.js";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
+
import { ItemsCursor, type ItemsCursorParams, PagePromise } from "../core/pagination.js";
|
|
5
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
6
|
+
/**
|
|
7
|
+
* A workflow run represents an individual execution of a workflow for a specific recipient.
|
|
8
|
+
*/
|
|
9
|
+
export declare class WorkflowRecipientRuns extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Returns a paginated list of workflow recipient runs for the current environment.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // Automatically fetches more pages as needed.
|
|
16
|
+
* for await (const workflowRecipientRun of client.workflowRecipientRuns.list()) {
|
|
17
|
+
* // ...
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(query?: WorkflowRecipientRunListParams | null | undefined, options?: RequestOptions): PagePromise<WorkflowRecipientRunsItemsCursor, WorkflowRecipientRun>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns a single workflow recipient run with its associated events.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const workflowRecipientRunDetail =
|
|
28
|
+
* await client.workflowRecipientRuns.get('id');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
get(id: string, options?: RequestOptions): APIPromise<WorkflowRecipientRunDetail>;
|
|
32
|
+
}
|
|
33
|
+
export type WorkflowRecipientRunsItemsCursor = ItemsCursor<WorkflowRecipientRun>;
|
|
34
|
+
/**
|
|
35
|
+
* A workflow recipient run represents an individual execution of a workflow for a
|
|
36
|
+
* specific recipient.
|
|
37
|
+
*/
|
|
38
|
+
export interface WorkflowRecipientRun {
|
|
39
|
+
/**
|
|
40
|
+
* The unique identifier for the workflow recipient run (per-recipient).
|
|
41
|
+
*/
|
|
42
|
+
id: string;
|
|
43
|
+
/**
|
|
44
|
+
* The typename of the schema.
|
|
45
|
+
*/
|
|
46
|
+
__typename: string;
|
|
47
|
+
/**
|
|
48
|
+
* Timestamp when the resource was created.
|
|
49
|
+
*/
|
|
50
|
+
inserted_at: string;
|
|
51
|
+
/**
|
|
52
|
+
* A reference to a recipient, either a user identifier (string) or an object
|
|
53
|
+
* reference (ID, collection).
|
|
54
|
+
*/
|
|
55
|
+
recipient: RecipientsAPI.RecipientReference;
|
|
56
|
+
/**
|
|
57
|
+
* The current status of the workflow recipient run. One of `queued`, `processing`,
|
|
58
|
+
* `paused`, `completed`, or `cancelled`.
|
|
59
|
+
*/
|
|
60
|
+
status: 'queued' | 'processing' | 'paused' | 'completed' | 'cancelled';
|
|
61
|
+
/**
|
|
62
|
+
* Describes how the workflow was triggered.
|
|
63
|
+
*/
|
|
64
|
+
trigger_source: WorkflowRecipientRun.TriggerSource;
|
|
65
|
+
/**
|
|
66
|
+
* The timestamp when the resource was last updated.
|
|
67
|
+
*/
|
|
68
|
+
updated_at: string;
|
|
69
|
+
/**
|
|
70
|
+
* The key of the workflow that was executed.
|
|
71
|
+
*/
|
|
72
|
+
workflow: string;
|
|
73
|
+
/**
|
|
74
|
+
* The identifier for the top-level workflow run shared across all recipients in a
|
|
75
|
+
* single trigger.
|
|
76
|
+
*/
|
|
77
|
+
workflow_run_id: string;
|
|
78
|
+
/**
|
|
79
|
+
* A recipient of a notification, which is either a user or an object.
|
|
80
|
+
*/
|
|
81
|
+
actor?: RecipientsAPI.Recipient | null;
|
|
82
|
+
/**
|
|
83
|
+
* The number of errors encountered during the workflow recipient run.
|
|
84
|
+
*/
|
|
85
|
+
error_count?: number;
|
|
86
|
+
/**
|
|
87
|
+
* The tenant associated with the workflow recipient run.
|
|
88
|
+
*/
|
|
89
|
+
tenant?: string | null;
|
|
90
|
+
}
|
|
91
|
+
export declare namespace WorkflowRecipientRun {
|
|
92
|
+
/**
|
|
93
|
+
* Describes how the workflow was triggered.
|
|
94
|
+
*/
|
|
95
|
+
interface TriggerSource {
|
|
96
|
+
/**
|
|
97
|
+
* The type of trigger source. One of `api`, `audience`, `schedule`, `broadcast`,
|
|
98
|
+
* `workflow_step`, `integration`, or `rehearsal`.
|
|
99
|
+
*/
|
|
100
|
+
type: 'api' | 'audience' | 'schedule' | 'broadcast' | 'workflow_step' | 'integration' | 'rehearsal';
|
|
101
|
+
/**
|
|
102
|
+
* The key of the audience that triggered the workflow.
|
|
103
|
+
*/
|
|
104
|
+
audience_key?: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* The cancellation key provided when the workflow was triggered via the API.
|
|
107
|
+
*/
|
|
108
|
+
cancellation_key?: string | null;
|
|
109
|
+
/**
|
|
110
|
+
* The ID of the schedule that triggered the workflow.
|
|
111
|
+
*/
|
|
112
|
+
schedule_id?: string | null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A single workflow recipient run with its events.
|
|
117
|
+
*/
|
|
118
|
+
export interface WorkflowRecipientRunDetail extends WorkflowRecipientRun {
|
|
119
|
+
/**
|
|
120
|
+
* A list of events that occurred during the workflow recipient run.
|
|
121
|
+
*/
|
|
122
|
+
events: Array<WorkflowRecipientRunEvent>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* An event that occurred during a workflow recipient run.
|
|
126
|
+
*/
|
|
127
|
+
export interface WorkflowRecipientRunEvent {
|
|
128
|
+
/**
|
|
129
|
+
* The unique identifier for the event.
|
|
130
|
+
*/
|
|
131
|
+
id: string;
|
|
132
|
+
/**
|
|
133
|
+
* The typename of the schema.
|
|
134
|
+
*/
|
|
135
|
+
__typename: string;
|
|
136
|
+
/**
|
|
137
|
+
* The type of event that occurred.
|
|
138
|
+
*/
|
|
139
|
+
event: string;
|
|
140
|
+
/**
|
|
141
|
+
* Timestamp when the resource was created.
|
|
142
|
+
*/
|
|
143
|
+
inserted_at: string;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the event represents a successful or error state.
|
|
146
|
+
*/
|
|
147
|
+
status: 'ok' | 'error';
|
|
148
|
+
/**
|
|
149
|
+
* The attempt number of the workflow recipient run event. Increments for each
|
|
150
|
+
* retry.
|
|
151
|
+
*/
|
|
152
|
+
attempt?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Event-specific data associated with the event.
|
|
155
|
+
*/
|
|
156
|
+
data?: {
|
|
157
|
+
[key: string]: unknown;
|
|
158
|
+
} | null;
|
|
159
|
+
/**
|
|
160
|
+
* The reference of the workflow step associated with this event.
|
|
161
|
+
*/
|
|
162
|
+
step_ref?: string | null;
|
|
163
|
+
/**
|
|
164
|
+
* The type of workflow step associated with this event.
|
|
165
|
+
*/
|
|
166
|
+
step_type?: string | null;
|
|
167
|
+
}
|
|
168
|
+
export interface WorkflowRecipientRunListParams extends ItemsCursorParams {
|
|
169
|
+
/**
|
|
170
|
+
* Limits the results to workflow recipient runs started before the given date.
|
|
171
|
+
*/
|
|
172
|
+
ending_at?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Limits the results to workflow recipient runs that have errors.
|
|
175
|
+
*/
|
|
176
|
+
has_errors?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Limits the results to workflow recipient runs for the given recipient. Accepts a
|
|
179
|
+
* user ID string or an object reference with `id` and `collection`.
|
|
180
|
+
*/
|
|
181
|
+
recipient?: RecipientsAPI.RecipientReference;
|
|
182
|
+
/**
|
|
183
|
+
* Limits the results to workflow recipient runs started after the given date.
|
|
184
|
+
*/
|
|
185
|
+
starting_at?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Limits the results to workflow recipient runs with the given status.
|
|
188
|
+
*/
|
|
189
|
+
status?: Array<'queued' | 'processing' | 'paused' | 'completed' | 'cancelled'>;
|
|
190
|
+
/**
|
|
191
|
+
* Limits the results to workflow recipient runs for the given tenant.
|
|
192
|
+
*/
|
|
193
|
+
tenant?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Limits the results to workflow recipient runs for the given workflow key.
|
|
196
|
+
*/
|
|
197
|
+
workflow?: string;
|
|
198
|
+
}
|
|
199
|
+
export declare namespace WorkflowRecipientRuns {
|
|
200
|
+
export { type WorkflowRecipientRun as WorkflowRecipientRun, type WorkflowRecipientRunDetail as WorkflowRecipientRunDetail, type WorkflowRecipientRunEvent as WorkflowRecipientRunEvent, type WorkflowRecipientRunsItemsCursor as WorkflowRecipientRunsItemsCursor, type WorkflowRecipientRunListParams as WorkflowRecipientRunListParams, };
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=workflow-recipient-runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-recipient-runs.d.ts","sourceRoot":"","sources":["../src/resources/workflow-recipient-runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EA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AAkB,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;IAE/E;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,qBAAqB,CAAC;IAC7C,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;CACH"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.WorkflowRecipientRuns = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* A workflow run represents an individual execution of a workflow for a specific recipient.
|
|
10
|
+
*/
|
|
11
|
+
class WorkflowRecipientRuns extends resource_1.APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a paginated list of workflow recipient runs for the current environment.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* // Automatically fetches more pages as needed.
|
|
18
|
+
* for await (const workflowRecipientRun of client.workflowRecipientRuns.list()) {
|
|
19
|
+
* // ...
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
list(query = {}, options) {
|
|
24
|
+
return this._client.getAPIList('/v1/workflow_recipient_runs', (pagination_1.ItemsCursor), {
|
|
25
|
+
query,
|
|
26
|
+
...options,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns a single workflow recipient run with its associated events.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const workflowRecipientRunDetail =
|
|
35
|
+
* await client.workflowRecipientRuns.get('id');
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
get(id, options) {
|
|
39
|
+
return this._client.get((0, path_1.path) `/v1/workflow_recipient_runs/${id}`, options);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.WorkflowRecipientRuns = WorkflowRecipientRuns;
|
|
43
|
+
//# sourceMappingURL=workflow-recipient-runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-recipient-runs.js","sourceRoot":"","sources":["../src/resources/workflow-recipient-runs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAsF;AAEtF,oDAA8C;AAE9C;;GAEG;AACH,MAAa,qBAAsB,SAAQ,sBAAW;IACpD;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,CAAA,wBAAiC,CAAA,EAAE;YAC/F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAU,EAAE,OAAwB;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,+BAA+B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AAlCD,sDAkCC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { ItemsCursor } from "../core/pagination.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* A workflow run represents an individual execution of a workflow for a specific recipient.
|
|
7
|
+
*/
|
|
8
|
+
export class WorkflowRecipientRuns extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Returns a paginated list of workflow recipient runs for the current environment.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Automatically fetches more pages as needed.
|
|
15
|
+
* for await (const workflowRecipientRun of client.workflowRecipientRuns.list()) {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
list(query = {}, options) {
|
|
21
|
+
return this._client.getAPIList('/v1/workflow_recipient_runs', (ItemsCursor), {
|
|
22
|
+
query,
|
|
23
|
+
...options,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns a single workflow recipient run with its associated events.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const workflowRecipientRunDetail =
|
|
32
|
+
* await client.workflowRecipientRuns.get('id');
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
get(id, options) {
|
|
36
|
+
return this._client.get(path `/v1/workflow_recipient_runs/${id}`, options);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=workflow-recipient-runs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-recipient-runs.mjs","sourceRoot":"","sources":["../src/resources/workflow-recipient-runs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,WAAW,EAAuC;OAEpD,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,CAAA,WAAiC,CAAA,EAAE;YAC/F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAU,EAAE,OAAwB;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,+BAA+B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -37,6 +37,14 @@ import {
|
|
|
37
37
|
Audiences,
|
|
38
38
|
} from './resources/audiences';
|
|
39
39
|
import { BulkOperation, BulkOperations } from './resources/bulk-operations';
|
|
40
|
+
import {
|
|
41
|
+
WorkflowRecipientRun,
|
|
42
|
+
WorkflowRecipientRunDetail,
|
|
43
|
+
WorkflowRecipientRunEvent,
|
|
44
|
+
WorkflowRecipientRunListParams,
|
|
45
|
+
WorkflowRecipientRuns,
|
|
46
|
+
WorkflowRecipientRunsItemsCursor,
|
|
47
|
+
} from './resources/workflow-recipient-runs';
|
|
40
48
|
import {
|
|
41
49
|
WorkflowCancelParams,
|
|
42
50
|
WorkflowTriggerParams,
|
|
@@ -891,6 +899,10 @@ export class Knock {
|
|
|
891
899
|
* A workflow is a structured set of steps that is triggered to produce notifications sent over channels.
|
|
892
900
|
*/
|
|
893
901
|
workflows: API.Workflows = new API.Workflows(this);
|
|
902
|
+
/**
|
|
903
|
+
* A workflow run represents an individual execution of a workflow for a specific recipient.
|
|
904
|
+
*/
|
|
905
|
+
workflowRecipientRuns: API.WorkflowRecipientRuns = new API.WorkflowRecipientRuns(this);
|
|
894
906
|
/**
|
|
895
907
|
* A schedule is a per-recipient, timezone-aware configuration for when to invoke a workflow.
|
|
896
908
|
*/
|
|
@@ -911,6 +923,7 @@ Knock.Messages = Messages;
|
|
|
911
923
|
Knock.Providers = Providers;
|
|
912
924
|
Knock.Integrations = Integrations;
|
|
913
925
|
Knock.Workflows = Workflows;
|
|
926
|
+
Knock.WorkflowRecipientRuns = WorkflowRecipientRuns;
|
|
914
927
|
Knock.Schedules = Schedules;
|
|
915
928
|
Knock.Channels = Channels;
|
|
916
929
|
Knock.Audiences = Audiences;
|
|
@@ -1025,6 +1038,15 @@ export declare namespace Knock {
|
|
|
1025
1038
|
type WorkflowTriggerParams as WorkflowTriggerParams,
|
|
1026
1039
|
};
|
|
1027
1040
|
|
|
1041
|
+
export {
|
|
1042
|
+
WorkflowRecipientRuns as WorkflowRecipientRuns,
|
|
1043
|
+
type WorkflowRecipientRun as WorkflowRecipientRun,
|
|
1044
|
+
type WorkflowRecipientRunDetail as WorkflowRecipientRunDetail,
|
|
1045
|
+
type WorkflowRecipientRunEvent as WorkflowRecipientRunEvent,
|
|
1046
|
+
type WorkflowRecipientRunsItemsCursor as WorkflowRecipientRunsItemsCursor,
|
|
1047
|
+
type WorkflowRecipientRunListParams as WorkflowRecipientRunListParams,
|
|
1048
|
+
};
|
|
1049
|
+
|
|
1028
1050
|
export {
|
|
1029
1051
|
Schedules as Schedules,
|
|
1030
1052
|
type Schedule as Schedule,
|
package/src/resources/index.ts
CHANGED
|
@@ -93,6 +93,14 @@ export {
|
|
|
93
93
|
type UserSetPreferencesParams,
|
|
94
94
|
type UsersEntriesCursor,
|
|
95
95
|
} from './users/users';
|
|
96
|
+
export {
|
|
97
|
+
WorkflowRecipientRuns,
|
|
98
|
+
type WorkflowRecipientRun,
|
|
99
|
+
type WorkflowRecipientRunDetail,
|
|
100
|
+
type WorkflowRecipientRunEvent,
|
|
101
|
+
type WorkflowRecipientRunListParams,
|
|
102
|
+
type WorkflowRecipientRunsItemsCursor,
|
|
103
|
+
} from './workflow-recipient-runs';
|
|
96
104
|
export {
|
|
97
105
|
Workflows,
|
|
98
106
|
type WorkflowTriggerResponse,
|