@upstash/workflow 0.2.16 → 0.2.18
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/astro.d.mts +2 -2
- package/astro.d.ts +2 -2
- package/astro.js +201 -41
- package/astro.mjs +1 -1
- package/{chunk-TGEGSOSN.mjs → chunk-EHL7SSJF.mjs} +202 -41
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +201 -41
- package/cloudflare.mjs +1 -1
- package/express.d.mts +2 -2
- package/express.d.ts +2 -2
- package/express.js +7086 -7201
- package/express.mjs +6706 -6981
- package/h3.d.mts +2 -2
- package/h3.d.ts +2 -2
- package/h3.js +201 -41
- package/h3.mjs +1 -1
- package/hono.d.mts +2 -2
- package/hono.d.ts +2 -2
- package/hono.js +201 -41
- package/hono.mjs +1 -1
- package/index.d.mts +131 -11
- package/index.d.ts +131 -11
- package/index.js +218 -42
- package/index.mjs +27 -4
- package/nextjs.d.mts +2 -2
- package/nextjs.d.ts +2 -2
- package/nextjs.js +204 -41
- package/nextjs.mjs +4 -1
- package/package.json +1 -1
- package/{serve-many-AaKSQyi7.d.ts → serve-many-BObe3pdI.d.ts} +1 -1
- package/{serve-many-AFwJPR3S.d.mts → serve-many-CEUYWQvV.d.mts} +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +193 -39
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +2 -2
- package/svelte.d.ts +2 -2
- package/svelte.js +201 -41
- package/svelte.mjs +1 -1
- package/{types-Dd-3bPoU.d.ts → types-B7_5AkKQ.d.mts} +118 -14
- package/{types-Dd-3bPoU.d.mts → types-B7_5AkKQ.d.ts} +118 -14
package/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SDK_TELEMETRY,
|
|
3
3
|
StepTypes,
|
|
4
|
+
WORKFLOW_LABEL_HEADER,
|
|
4
5
|
WorkflowAbort,
|
|
5
6
|
WorkflowContext,
|
|
6
7
|
WorkflowError,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
prepareFlowControl,
|
|
14
15
|
serve,
|
|
15
16
|
triggerFirstInvocation
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EHL7SSJF.mjs";
|
|
17
18
|
|
|
18
19
|
// src/client/index.ts
|
|
19
20
|
import { Client as QStashClient } from "@upstash/qstash";
|
|
@@ -73,6 +74,20 @@ var DLQ = class _DLQ {
|
|
|
73
74
|
}
|
|
74
75
|
return workflowRuns[0];
|
|
75
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Retry the failure callback of a workflow run whose failureUrl/failureFunction
|
|
79
|
+
* request has failed.
|
|
80
|
+
*
|
|
81
|
+
* @param dlqId - The ID of the DLQ message to retry.
|
|
82
|
+
* @returns
|
|
83
|
+
*/
|
|
84
|
+
async retryFailureFunction({ dlqId }) {
|
|
85
|
+
const response = await this.client.http.request({
|
|
86
|
+
path: ["v2", "workflows", "dlq", "callback", dlqId],
|
|
87
|
+
method: "POST"
|
|
88
|
+
});
|
|
89
|
+
return response;
|
|
90
|
+
}
|
|
76
91
|
static handleDLQOptions(options) {
|
|
77
92
|
const { dlqId, flowControl, retries } = options;
|
|
78
93
|
const headers = {};
|
|
@@ -231,16 +246,21 @@ var Client = class {
|
|
|
231
246
|
const finalWorkflowRunId = getWorkflowRunId(option.workflowRunId);
|
|
232
247
|
const context = new WorkflowContext({
|
|
233
248
|
qstashClient: this.client,
|
|
234
|
-
// @ts-expect-error
|
|
235
|
-
headers: new Headers(
|
|
249
|
+
// @ts-expect-error header type mismatch because of bun
|
|
250
|
+
headers: new Headers({
|
|
251
|
+
...option.headers ?? {},
|
|
252
|
+
...option.label ? { [WORKFLOW_LABEL_HEADER]: option.label } : {}
|
|
253
|
+
}),
|
|
236
254
|
initialPayload: option.body,
|
|
237
255
|
steps: [],
|
|
238
256
|
url: option.url,
|
|
239
257
|
workflowRunId: finalWorkflowRunId,
|
|
240
258
|
retries: option.retries,
|
|
259
|
+
retryDelay: option.retryDelay,
|
|
241
260
|
telemetry: { sdk: SDK_TELEMETRY },
|
|
242
261
|
flowControl: option.flowControl,
|
|
243
|
-
failureUrl
|
|
262
|
+
failureUrl,
|
|
263
|
+
label: option.label
|
|
244
264
|
});
|
|
245
265
|
return {
|
|
246
266
|
workflowContext: context,
|
|
@@ -306,6 +326,9 @@ var Client = class {
|
|
|
306
326
|
if (workflowCreatedAt) {
|
|
307
327
|
urlParams.append("workflowCreatedAt", workflowCreatedAt.toString());
|
|
308
328
|
}
|
|
329
|
+
if (params?.label) {
|
|
330
|
+
urlParams.append("label", params.label);
|
|
331
|
+
}
|
|
309
332
|
const result = await this.client.http.request({
|
|
310
333
|
path: ["v2", "workflows", `events?${urlParams.toString()}`]
|
|
311
334
|
});
|
package/nextjs.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { R as RouteFunction, n as PublicServeOptions,
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { R as RouteFunction, n as PublicServeOptions, x as InvokableWorkflow } from './types-B7_5AkKQ.mjs';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-CEUYWQvV.mjs';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'ai';
|
package/nextjs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { R as RouteFunction, n as PublicServeOptions,
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { R as RouteFunction, n as PublicServeOptions, x as InvokableWorkflow } from './types-B7_5AkKQ.js';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-BObe3pdI.js';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'ai';
|