@retab/node 1.0.93 → 1.0.94
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.
|
@@ -20,7 +20,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
20
20
|
* @param workflowId - The ID of the workflow to run
|
|
21
21
|
* @param documents - Mapping of start node IDs to their input documents
|
|
22
22
|
* @param jsonInputs - Mapping of start_json node IDs to their input JSON data
|
|
23
|
-
* @param textInputs - Mapping of start_text node IDs to their input text
|
|
24
23
|
* @param options - Optional request options
|
|
25
24
|
* @returns The created workflow run with status "running"
|
|
26
25
|
*
|
|
@@ -34,18 +33,14 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
34
33
|
* jsonInputs: {
|
|
35
34
|
* "json-node-1": { key: "value" },
|
|
36
35
|
* },
|
|
37
|
-
* textInputs: {
|
|
38
|
-
* "text-node-1": "Hello, world!",
|
|
39
|
-
* }
|
|
40
36
|
* });
|
|
41
37
|
* console.log(`Run started: ${run.id}, status: ${run.status}`);
|
|
42
38
|
* ```
|
|
43
39
|
*/
|
|
44
|
-
create({ workflowId, documents, jsonInputs,
|
|
40
|
+
create({ workflowId, documents, jsonInputs, }: {
|
|
45
41
|
workflowId: string;
|
|
46
42
|
documents?: Record<string, MIMEDataInput>;
|
|
47
43
|
jsonInputs?: Record<string, Record<string, unknown>>;
|
|
48
|
-
textInputs?: Record<string, string>;
|
|
49
44
|
}, options?: RequestOptions): Promise<WorkflowRun>;
|
|
50
45
|
/**
|
|
51
46
|
* Get a workflow run by ID.
|
|
@@ -200,7 +195,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
200
195
|
* @param workflowId - The ID of the workflow to run
|
|
201
196
|
* @param documents - Mapping of start node IDs to their input documents
|
|
202
197
|
* @param jsonInputs - Mapping of start_json node IDs to their input JSON data
|
|
203
|
-
* @param textInputs - Mapping of start_text node IDs to their input text
|
|
204
198
|
* @param pollIntervalMs - Milliseconds between polls (default: 2000)
|
|
205
199
|
* @param timeoutMs - Maximum time to wait in milliseconds (default: 600000)
|
|
206
200
|
* @param options - Optional request options
|
|
@@ -218,11 +212,10 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
218
212
|
* }
|
|
219
213
|
* ```
|
|
220
214
|
*/
|
|
221
|
-
createAndWait({ workflowId, documents, jsonInputs,
|
|
215
|
+
createAndWait({ workflowId, documents, jsonInputs, pollIntervalMs, timeoutMs, }: {
|
|
222
216
|
workflowId: string;
|
|
223
217
|
documents?: Record<string, MIMEDataInput>;
|
|
224
218
|
jsonInputs?: Record<string, Record<string, unknown>>;
|
|
225
|
-
textInputs?: Record<string, string>;
|
|
226
219
|
pollIntervalMs?: number;
|
|
227
220
|
timeoutMs?: number;
|
|
228
221
|
}, options?: RequestOptions): Promise<WorkflowRun>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/api/workflows/runs/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACH,aAAa,EAEb,WAAW,EAEX,aAAa,EAEb,sBAAsB,EAEtB,sBAAsB,EAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,MAAM,mBAAmB,CAAC;AAQpD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,iBAAiB;IACnD,KAAK,EAAE,mBAAmB,CAAC;gBAEtB,MAAM,EAAE,iBAAiB;IAKrC
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/api/workflows/runs/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACH,aAAa,EAEb,WAAW,EAEX,aAAa,EAEb,sBAAsB,EAEtB,sBAAsB,EAEzB,MAAM,mBAAmB,CAAC;AAC3B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AAQ,EACR,YAAY,EACZ,SAAS,GACZ,EAAE;QACC,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,OAAO,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;QAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,EACD,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,sBAAsB,CAAC;IAkBlC;;;;;;;;;;;;;;;;;;;OAmBG;IACG,iBAAiB,CACnB,KAAK,EAAE,MAAM,EACb,EACI,cAAqB,EACrB,SAAkB,GACrB,GAAE;QACC,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;KACjB,GACP,OAAO,CAAC,WAAW,CAAC;IAuBvB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,aAAa,CACf,EACI,UAAU,EACV,SAAS,EACT,UAAU,EACV,cAAqB,EACrB,SAAkB,GACrB,EAAE;QACC,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC1C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACrD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,EACD,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,WAAW,CAAC;CAO1B"}
|
|
@@ -26,7 +26,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
26
26
|
* @param workflowId - The ID of the workflow to run
|
|
27
27
|
* @param documents - Mapping of start node IDs to their input documents
|
|
28
28
|
* @param jsonInputs - Mapping of start_json node IDs to their input JSON data
|
|
29
|
-
* @param textInputs - Mapping of start_text node IDs to their input text
|
|
30
29
|
* @param options - Optional request options
|
|
31
30
|
* @returns The created workflow run with status "running"
|
|
32
31
|
*
|
|
@@ -40,14 +39,11 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
40
39
|
* jsonInputs: {
|
|
41
40
|
* "json-node-1": { key: "value" },
|
|
42
41
|
* },
|
|
43
|
-
* textInputs: {
|
|
44
|
-
* "text-node-1": "Hello, world!",
|
|
45
|
-
* }
|
|
46
42
|
* });
|
|
47
43
|
* console.log(`Run started: ${run.id}, status: ${run.status}`);
|
|
48
44
|
* ```
|
|
49
45
|
*/
|
|
50
|
-
async create({ workflowId, documents, jsonInputs,
|
|
46
|
+
async create({ workflowId, documents, jsonInputs, }, options) {
|
|
51
47
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
48
|
const body = {};
|
|
53
49
|
if (documents) {
|
|
@@ -67,9 +63,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
67
63
|
if (jsonInputs) {
|
|
68
64
|
body.json_inputs = jsonInputs;
|
|
69
65
|
}
|
|
70
|
-
if (textInputs) {
|
|
71
|
-
body.text_inputs = textInputs;
|
|
72
|
-
}
|
|
73
66
|
return this._fetchJson(ZWorkflowRun, {
|
|
74
67
|
url: `/v1/workflows/${workflowId}/run`,
|
|
75
68
|
method: "POST",
|
|
@@ -300,7 +293,6 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
300
293
|
* @param workflowId - The ID of the workflow to run
|
|
301
294
|
* @param documents - Mapping of start node IDs to their input documents
|
|
302
295
|
* @param jsonInputs - Mapping of start_json node IDs to their input JSON data
|
|
303
|
-
* @param textInputs - Mapping of start_text node IDs to their input text
|
|
304
296
|
* @param pollIntervalMs - Milliseconds between polls (default: 2000)
|
|
305
297
|
* @param timeoutMs - Maximum time to wait in milliseconds (default: 600000)
|
|
306
298
|
* @param options - Optional request options
|
|
@@ -318,8 +310,8 @@ export default class APIWorkflowRuns extends CompositionClient {
|
|
|
318
310
|
* }
|
|
319
311
|
* ```
|
|
320
312
|
*/
|
|
321
|
-
async createAndWait({ workflowId, documents, jsonInputs,
|
|
322
|
-
const run = await this.create({ workflowId, documents, jsonInputs
|
|
313
|
+
async createAndWait({ workflowId, documents, jsonInputs, pollIntervalMs = 2000, timeoutMs = 600000, }, options) {
|
|
314
|
+
const run = await this.create({ workflowId, documents, jsonInputs }, options);
|
|
323
315
|
return this.waitForCompletion(run.id, { pollIntervalMs, timeoutMs });
|
|
324
316
|
}
|
|
325
317
|
}
|