@knocklabs/node 1.29.1 → 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 +69 -0
- package/client.d.mts +31 -15
- package/client.d.mts.map +1 -1
- package/client.d.ts +31 -15
- package/client.d.ts.map +1 -1
- package/client.js +41 -43
- package/client.js.map +1 -1
- package/client.mjs +41 -43
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/query.d.mts +7 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +7 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +32 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +28 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +12 -1
- package/resources/audiences.d.mts +3 -0
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +3 -0
- package/resources/audiences.d.ts.map +1 -1
- package/resources/audiences.js +3 -0
- package/resources/audiences.js.map +1 -1
- package/resources/audiences.mjs +3 -0
- package/resources/audiences.mjs.map +1 -1
- package/resources/bulk-operations.d.mts +3 -0
- package/resources/bulk-operations.d.mts.map +1 -1
- package/resources/bulk-operations.d.ts +3 -0
- package/resources/bulk-operations.d.ts.map +1 -1
- package/resources/bulk-operations.js +3 -0
- package/resources/bulk-operations.js.map +1 -1
- package/resources/bulk-operations.mjs +3 -0
- package/resources/bulk-operations.mjs.map +1 -1
- package/resources/channels/bulk.d.mts +3 -0
- package/resources/channels/bulk.d.mts.map +1 -1
- package/resources/channels/bulk.d.ts +3 -0
- package/resources/channels/bulk.d.ts.map +1 -1
- package/resources/channels/bulk.js +3 -0
- package/resources/channels/bulk.js.map +1 -1
- package/resources/channels/bulk.mjs +3 -0
- package/resources/channels/bulk.mjs.map +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/messages/batch.d.mts +3 -0
- package/resources/messages/batch.d.mts.map +1 -1
- package/resources/messages/batch.d.ts +3 -0
- package/resources/messages/batch.d.ts.map +1 -1
- package/resources/messages/batch.js +3 -0
- package/resources/messages/batch.js.map +1 -1
- package/resources/messages/batch.mjs +3 -0
- package/resources/messages/batch.mjs.map +1 -1
- package/resources/messages/messages.d.mts +4 -1
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +4 -1
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +3 -0
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +3 -0
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/objects/bulk.d.mts +3 -0
- package/resources/objects/bulk.d.mts.map +1 -1
- package/resources/objects/bulk.d.ts +3 -0
- package/resources/objects/bulk.d.ts.map +1 -1
- package/resources/objects/bulk.js +3 -0
- package/resources/objects/bulk.js.map +1 -1
- package/resources/objects/bulk.mjs +3 -0
- package/resources/objects/bulk.mjs.map +1 -1
- package/resources/objects/objects.d.mts +16 -0
- package/resources/objects/objects.d.mts.map +1 -1
- package/resources/objects/objects.d.ts +16 -0
- package/resources/objects/objects.d.ts.map +1 -1
- package/resources/objects/objects.js +21 -0
- package/resources/objects/objects.js.map +1 -1
- package/resources/objects/objects.mjs +21 -0
- package/resources/objects/objects.mjs.map +1 -1
- package/resources/providers/ms-teams.d.mts +3 -0
- package/resources/providers/ms-teams.d.mts.map +1 -1
- package/resources/providers/ms-teams.d.ts +3 -0
- package/resources/providers/ms-teams.d.ts.map +1 -1
- package/resources/providers/ms-teams.js +3 -0
- package/resources/providers/ms-teams.js.map +1 -1
- package/resources/providers/ms-teams.mjs +3 -0
- package/resources/providers/ms-teams.mjs.map +1 -1
- package/resources/providers/slack.d.mts +3 -0
- package/resources/providers/slack.d.mts.map +1 -1
- package/resources/providers/slack.d.ts +3 -0
- package/resources/providers/slack.d.ts.map +1 -1
- package/resources/providers/slack.js +3 -0
- package/resources/providers/slack.js.map +1 -1
- package/resources/providers/slack.mjs +3 -0
- package/resources/providers/slack.mjs.map +1 -1
- package/resources/schedules/bulk.d.mts +3 -0
- package/resources/schedules/bulk.d.mts.map +1 -1
- package/resources/schedules/bulk.d.ts +3 -0
- package/resources/schedules/bulk.d.ts.map +1 -1
- package/resources/schedules/bulk.js +3 -0
- package/resources/schedules/bulk.js.map +1 -1
- package/resources/schedules/bulk.mjs +3 -0
- package/resources/schedules/bulk.mjs.map +1 -1
- package/resources/schedules/schedules.d.mts +3 -0
- package/resources/schedules/schedules.d.mts.map +1 -1
- package/resources/schedules/schedules.d.ts +3 -0
- package/resources/schedules/schedules.d.ts.map +1 -1
- package/resources/schedules/schedules.js +3 -0
- package/resources/schedules/schedules.js.map +1 -1
- package/resources/schedules/schedules.mjs +3 -0
- package/resources/schedules/schedules.mjs.map +1 -1
- package/resources/shared.d.mts +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/tenants/bulk.d.mts +3 -0
- package/resources/tenants/bulk.d.mts.map +1 -1
- package/resources/tenants/bulk.d.ts +3 -0
- package/resources/tenants/bulk.d.ts.map +1 -1
- package/resources/tenants/bulk.js +3 -0
- package/resources/tenants/bulk.js.map +1 -1
- package/resources/tenants/bulk.mjs +3 -0
- package/resources/tenants/bulk.mjs.map +1 -1
- package/resources/tenants/tenants.d.mts +3 -0
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +3 -0
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js +3 -0
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs +3 -0
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/users/bulk.d.mts +3 -0
- package/resources/users/bulk.d.mts.map +1 -1
- package/resources/users/bulk.d.ts +3 -0
- package/resources/users/bulk.d.ts.map +1 -1
- package/resources/users/bulk.js +3 -0
- package/resources/users/bulk.js.map +1 -1
- package/resources/users/bulk.mjs +3 -0
- package/resources/users/bulk.mjs.map +1 -1
- package/resources/users/feeds.d.mts +3 -0
- package/resources/users/feeds.d.mts.map +1 -1
- package/resources/users/feeds.d.ts +3 -0
- package/resources/users/feeds.d.ts.map +1 -1
- package/resources/users/feeds.js +3 -0
- package/resources/users/feeds.js.map +1 -1
- package/resources/users/feeds.mjs +3 -0
- package/resources/users/feeds.mjs.map +1 -1
- package/resources/users/guides.d.mts +7 -0
- package/resources/users/guides.d.mts.map +1 -1
- package/resources/users/guides.d.ts +7 -0
- package/resources/users/guides.d.ts.map +1 -1
- package/resources/users/guides.js +3 -0
- package/resources/users/guides.js.map +1 -1
- package/resources/users/guides.mjs +3 -0
- package/resources/users/guides.mjs.map +1 -1
- package/resources/users/users.d.mts +12 -0
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +12 -0
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js +17 -0
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs +17 -0
- package/resources/users/users.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/resources/workflows.d.mts +3 -0
- package/resources/workflows.d.mts.map +1 -1
- package/resources/workflows.d.ts +3 -0
- package/resources/workflows.d.ts.map +1 -1
- package/resources/workflows.js +3 -0
- package/resources/workflows.js.map +1 -1
- package/resources/workflows.mjs +3 -0
- package/resources/workflows.mjs.map +1 -1
- package/src/client.ts +60 -49
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/query.ts +31 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/audiences.ts +3 -0
- package/src/resources/bulk-operations.ts +3 -0
- package/src/resources/channels/bulk.ts +3 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/messages/batch.ts +3 -0
- package/src/resources/messages/messages.ts +4 -0
- package/src/resources/objects/bulk.ts +3 -0
- package/src/resources/objects/objects.ts +27 -0
- package/src/resources/providers/ms-teams.ts +3 -0
- package/src/resources/providers/slack.ts +3 -0
- package/src/resources/schedules/bulk.ts +3 -0
- package/src/resources/schedules/schedules.ts +3 -0
- package/src/resources/shared.ts +1 -0
- package/src/resources/tenants/bulk.ts +3 -0
- package/src/resources/tenants/tenants.ts +3 -0
- package/src/resources/users/bulk.ts +3 -0
- package/src/resources/users/feeds.ts +3 -0
- package/src/resources/users/guides.ts +8 -0
- package/src/resources/users/users.ts +18 -0
- package/src/resources/workflow-recipient-runs.ts +255 -0
- package/src/resources/workflows.ts +3 -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.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,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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MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,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,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"}
|
|
@@ -3,6 +3,9 @@ import * as RecipientsAPI from "./recipients/recipients.mjs";
|
|
|
3
3
|
import * as TenantsAPI from "./tenants/tenants.mjs";
|
|
4
4
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
5
5
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* A workflow is a structured set of steps that is triggered to produce notifications sent over channels.
|
|
8
|
+
*/
|
|
6
9
|
export declare class Workflows extends APIResource {
|
|
7
10
|
/**
|
|
8
11
|
* When invoked for a workflow using a specific workflow key and cancellation key,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.mts","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;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ChD;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|
package/resources/workflows.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import * as RecipientsAPI from "./recipients/recipients.js";
|
|
|
3
3
|
import * as TenantsAPI from "./tenants/tenants.js";
|
|
4
4
|
import { APIPromise } from "../core/api-promise.js";
|
|
5
5
|
import { RequestOptions } from "../internal/request-options.js";
|
|
6
|
+
/**
|
|
7
|
+
* A workflow is a structured set of steps that is triggered to produce notifications sent over channels.
|
|
8
|
+
*/
|
|
6
9
|
export declare class Workflows extends APIResource {
|
|
7
10
|
/**
|
|
8
11
|
* When invoked for a workflow using a specific workflow key and cancellation key,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,CACL,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;CAGvC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC;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I,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;CAGvC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;CAC7D;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAElD;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAE9C;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;;;;OAKG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAChD;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|
package/resources/workflows.js
CHANGED
|
@@ -5,6 +5,9 @@ exports.Workflows = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
const headers_1 = require("../internal/headers.js");
|
|
7
7
|
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* A workflow is a structured set of steps that is triggered to produce notifications sent over channels.
|
|
10
|
+
*/
|
|
8
11
|
class Workflows extends resource_1.APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* When invoked for a workflow using a specific workflow key and cancellation key,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,GAAW,EAAE,IAA0B,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,iBAAiB,GAAG,SAAS,EAAE;YAC1D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,CACL,GAAW,EACX,IAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,iBAAiB,GAAG,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AA1DD,8BA0DC"}
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;GAEG;AACH,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,GAAW,EAAE,IAA0B,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,iBAAiB,GAAG,SAAS,EAAE;YAC1D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,CACL,GAAW,EACX,IAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,iBAAiB,GAAG,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AA1DD,8BA0DC"}
|
package/resources/workflows.mjs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* A workflow is a structured set of steps that is triggered to produce notifications sent over channels.
|
|
7
|
+
*/
|
|
5
8
|
export class Workflows extends APIResource {
|
|
6
9
|
/**
|
|
7
10
|
* When invoked for a workflow using a specific workflow key and cancellation key,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.mjs","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,GAAW,EAAE,IAA0B,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,iBAAiB,GAAG,SAAS,EAAE;YAC1D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,CACL,GAAW,EACX,IAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,iBAAiB,GAAG,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"workflows.mjs","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,GAAW,EAAE,IAA0B,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,iBAAiB,GAAG,SAAS,EAAE;YAC1D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,CACL,GAAW,EACX,IAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,iBAAiB,GAAG,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
11
11
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
12
|
import * as Shims from './internal/shims';
|
|
13
13
|
import * as Opts from './internal/request-options';
|
|
14
|
-
import
|
|
14
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
15
15
|
import { VERSION } from './version';
|
|
16
16
|
import * as Errors from './core/error';
|
|
17
17
|
import * as Pagination from './core/pagination';
|
|
@@ -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,
|
|
@@ -332,47 +340,8 @@ export class Knock {
|
|
|
332
340
|
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
|
|
333
341
|
}
|
|
334
342
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
*
|
|
338
|
-
* We need to handle two types of arrays differently:
|
|
339
|
-
* 1. Simple arrays (primitives) → use 'brackets' format: `tags[]=tag1&tags[]=tag2`
|
|
340
|
-
* 2. Arrays of objects → use 'indices' format: `objects[0][id]=1&objects[0][collection]=teams`
|
|
341
|
-
*
|
|
342
|
-
* Why we can't use a single arrayFormat for everything:
|
|
343
|
-
* If we used 'indices' for simple arrays, `include: ["preferences"]` would serialize as
|
|
344
|
-
* `include[0]=preferences`, which the backend incorrectly parses as a map `{"0": "preferences"}`
|
|
345
|
-
* instead of an array `["preferences"]`.
|
|
346
|
-
*
|
|
347
|
-
* By separating them, we ensure the backend receives the correct data structure for each type.
|
|
348
|
-
*/
|
|
349
|
-
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
350
|
-
// Separate arrays of objects from other parameters
|
|
351
|
-
// Arrays of objects need 'indices' format (e.g., objects[0][id]=1)
|
|
352
|
-
// Simple arrays need 'brackets' format (e.g., tags[]=tag1)
|
|
353
|
-
const objectArrays: Record<string, unknown> = {};
|
|
354
|
-
const otherParams: Record<string, unknown> = {};
|
|
355
|
-
|
|
356
|
-
for (const key in query) {
|
|
357
|
-
const value = query[key];
|
|
358
|
-
if (Array.isArray(value) && value.length > 0 && typeof value[0] === 'object' && value[0] !== null) {
|
|
359
|
-
objectArrays[key] = value;
|
|
360
|
-
} else {
|
|
361
|
-
otherParams[key] = value;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// Stringify other params with 'brackets' format for simple arrays
|
|
366
|
-
const otherParamsString = qs.stringify(otherParams, { arrayFormat: 'brackets' });
|
|
367
|
-
|
|
368
|
-
// Stringify object arrays with 'indices' format
|
|
369
|
-
const objectArraysString = qs.stringify(objectArrays, { arrayFormat: 'indices' });
|
|
370
|
-
|
|
371
|
-
// Combine both parts
|
|
372
|
-
if (otherParamsString && objectArraysString) {
|
|
373
|
-
return `${otherParamsString}&${objectArraysString}`;
|
|
374
|
-
}
|
|
375
|
-
return otherParamsString || objectArraysString;
|
|
343
|
+
protected stringifyQuery(query: Record<string, unknown> | object): string {
|
|
344
|
+
return stringifyQuery(query);
|
|
376
345
|
}
|
|
377
346
|
|
|
378
347
|
private getUserAgent(): string {
|
|
@@ -404,12 +373,16 @@ export class Knock {
|
|
|
404
373
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
405
374
|
|
|
406
375
|
const defaultQuery = this.defaultQuery();
|
|
407
|
-
|
|
408
|
-
|
|
376
|
+
const pathQuery: Record<string, string> = {};
|
|
377
|
+
url.searchParams.forEach((value, key) => {
|
|
378
|
+
pathQuery[key] = value;
|
|
379
|
+
});
|
|
380
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
381
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
409
382
|
}
|
|
410
383
|
|
|
411
384
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
412
|
-
url.search = this.stringifyQuery(query
|
|
385
|
+
url.search = this.stringifyQuery(query);
|
|
413
386
|
}
|
|
414
387
|
|
|
415
388
|
return url.toString();
|
|
@@ -738,9 +711,9 @@ export class Knock {
|
|
|
738
711
|
}
|
|
739
712
|
}
|
|
740
713
|
|
|
741
|
-
// If the API asks us to wait a certain amount of time
|
|
742
|
-
//
|
|
743
|
-
if (
|
|
714
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
715
|
+
// says, but otherwise calculate a default
|
|
716
|
+
if (timeoutMillis === undefined) {
|
|
744
717
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
745
718
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
746
719
|
}
|
|
@@ -873,7 +846,7 @@ export class Knock {
|
|
|
873
846
|
) {
|
|
874
847
|
return {
|
|
875
848
|
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
876
|
-
body: this.stringifyQuery(body
|
|
849
|
+
body: this.stringifyQuery(body),
|
|
877
850
|
};
|
|
878
851
|
} else {
|
|
879
852
|
return this.#encoder({ body, headers });
|
|
@@ -900,16 +873,44 @@ export class Knock {
|
|
|
900
873
|
static toFile = Uploads.toFile;
|
|
901
874
|
|
|
902
875
|
recipients: API.Recipients = new API.Recipients(this);
|
|
876
|
+
/**
|
|
877
|
+
* A user is an individual from your system, represented in Knock. They are most commonly a recipient of a notification.
|
|
878
|
+
*/
|
|
903
879
|
users: API.Users = new API.Users(this);
|
|
880
|
+
/**
|
|
881
|
+
* An object represents a resource in your system that you want to map into Knock.
|
|
882
|
+
*/
|
|
904
883
|
objects: API.Objects = new API.Objects(this);
|
|
884
|
+
/**
|
|
885
|
+
* A tenant represents a top-level entity from your system, like a company, organization, account, or workspace.
|
|
886
|
+
*/
|
|
905
887
|
tenants: API.Tenants = new API.Tenants(this);
|
|
888
|
+
/**
|
|
889
|
+
* A bulk operation is a set of changes applied across zero or more records triggered via a call to the Knock API and performed asynchronously.
|
|
890
|
+
*/
|
|
906
891
|
bulkOperations: API.BulkOperations = new API.BulkOperations(this);
|
|
892
|
+
/**
|
|
893
|
+
* A message sent to a single recipient on a channel.
|
|
894
|
+
*/
|
|
907
895
|
messages: API.Messages = new API.Messages(this);
|
|
908
896
|
providers: API.Providers = new API.Providers(this);
|
|
909
897
|
integrations: API.Integrations = new API.Integrations(this);
|
|
898
|
+
/**
|
|
899
|
+
* A workflow is a structured set of steps that is triggered to produce notifications sent over channels.
|
|
900
|
+
*/
|
|
910
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);
|
|
906
|
+
/**
|
|
907
|
+
* A schedule is a per-recipient, timezone-aware configuration for when to invoke a workflow.
|
|
908
|
+
*/
|
|
911
909
|
schedules: API.Schedules = new API.Schedules(this);
|
|
912
910
|
channels: API.Channels = new API.Channels(this);
|
|
911
|
+
/**
|
|
912
|
+
* An Audience is a segment of users.
|
|
913
|
+
*/
|
|
913
914
|
audiences: API.Audiences = new API.Audiences(this);
|
|
914
915
|
}
|
|
915
916
|
|
|
@@ -922,6 +923,7 @@ Knock.Messages = Messages;
|
|
|
922
923
|
Knock.Providers = Providers;
|
|
923
924
|
Knock.Integrations = Integrations;
|
|
924
925
|
Knock.Workflows = Workflows;
|
|
926
|
+
Knock.WorkflowRecipientRuns = WorkflowRecipientRuns;
|
|
925
927
|
Knock.Schedules = Schedules;
|
|
926
928
|
Knock.Channels = Channels;
|
|
927
929
|
Knock.Audiences = Audiences;
|
|
@@ -1036,6 +1038,15 @@ export declare namespace Knock {
|
|
|
1036
1038
|
type WorkflowTriggerParams as WorkflowTriggerParams,
|
|
1037
1039
|
};
|
|
1038
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
|
+
|
|
1039
1050
|
export {
|
|
1040
1051
|
Schedules as Schedules,
|
|
1041
1052
|
type Schedule as Schedule,
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as qs from '../qs/stringify';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Stringify query parameters with smart array handling:
|
|
7
|
+
* 1. Simple arrays → 'brackets' format: `tags[]=tag1&tags[]=tag2`
|
|
8
|
+
* 2. Arrays of objects → 'indices' format: `objects[0][id]=1&objects[0][collection]=teams`
|
|
9
|
+
*/
|
|
10
|
+
export function stringifyQuery(query: object | Record<string, unknown>): string {
|
|
11
|
+
const record = query as Record<string, unknown>;
|
|
12
|
+
const objectArrays: Record<string, unknown> = {};
|
|
13
|
+
const otherParams: Record<string, unknown> = {};
|
|
14
|
+
|
|
15
|
+
for (const key in record) {
|
|
16
|
+
const value = record[key];
|
|
17
|
+
if (Array.isArray(value) && value.length > 0 && typeof value[0] === 'object' && value[0] !== null) {
|
|
18
|
+
objectArrays[key] = value;
|
|
19
|
+
} else {
|
|
20
|
+
otherParams[key] = value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const otherParamsString = qs.stringify(otherParams, { arrayFormat: 'brackets' });
|
|
25
|
+
const objectArraysString = qs.stringify(objectArrays, { arrayFormat: 'indices' });
|
|
26
|
+
|
|
27
|
+
if (otherParamsString && objectArraysString) {
|
|
28
|
+
return `${otherParamsString}&${objectArraysString}`;
|
|
29
|
+
}
|
|
30
|
+
return otherParamsString || objectArraysString;
|
|
31
|
+
}
|
package/src/internal/utils.ts
CHANGED
|
@@ -8,6 +8,9 @@ import { buildHeaders } from '../internal/headers';
|
|
|
8
8
|
import { RequestOptions } from '../internal/request-options';
|
|
9
9
|
import { path } from '../internal/utils/path';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* An Audience is a segment of users.
|
|
13
|
+
*/
|
|
11
14
|
export class Audiences extends APIResource {
|
|
12
15
|
/**
|
|
13
16
|
* Adds one or more members to the specified audience.
|
|
@@ -5,6 +5,9 @@ import { APIPromise } from '../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
import { path } from '../internal/utils/path';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A bulk operation is a set of changes applied across zero or more records triggered via a call to the Knock API and performed asynchronously.
|
|
10
|
+
*/
|
|
8
11
|
export class BulkOperations extends APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* Retrieves a bulk operation (if it exists) and displays the current state of it.
|
|
@@ -6,6 +6,9 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
6
6
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
7
|
import { path } from '../../internal/utils/path';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* A bulk operation is a set of changes applied across zero or more records triggered via a call to the Knock API and performed asynchronously.
|
|
11
|
+
*/
|
|
9
12
|
export class Bulk extends APIResource {
|
|
10
13
|
/**
|
|
11
14
|
* Bulk update the status of messages for a specific channel. The channel is
|
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,
|