@upstash/workflow 1.3.3 → 1.4.0-rc
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 +3 -2
- package/astro.d.ts +3 -2
- package/astro.js +587 -139
- package/astro.mjs +3 -1
- package/{chunk-WEQGCISK.mjs → chunk-UH6O5IJY.mjs} +749 -301
- package/cloudflare.d.mts +3 -2
- package/cloudflare.d.ts +3 -2
- package/cloudflare.js +587 -139
- package/cloudflare.mjs +3 -1
- package/express.d.mts +3 -2
- package/express.d.ts +3 -2
- package/express.js +588 -139
- package/express.mjs +4 -1
- package/h3.d.mts +3 -2
- package/h3.d.ts +3 -2
- package/h3.js +587 -139
- package/h3.mjs +3 -1
- package/hono.d.mts +3 -2
- package/hono.d.ts +3 -2
- package/hono.js +587 -139
- package/hono.mjs +3 -1
- package/index.d.mts +25 -6
- package/index.d.ts +25 -6
- package/index.js +610 -141
- package/index.mjs +26 -3
- package/nextjs.d.mts +3 -2
- package/nextjs.d.ts +3 -2
- package/nextjs.js +588 -139
- package/nextjs.mjs +4 -1
- package/package.json +1 -1
- package/react-router.d.mts +3 -2
- package/react-router.d.ts +3 -2
- package/react-router.js +587 -139
- package/react-router.mjs +3 -1
- package/{serve-many-iJF1IUXk.d.ts → serve-many-BCtZg31b.d.ts} +1 -1
- package/{serve-many-CG3BFvO3.d.mts → serve-many-CbIV7145.d.mts} +1 -1
- package/solidjs.d.mts +2 -1
- package/solidjs.d.ts +2 -1
- package/solidjs.js +587 -139
- package/solidjs.mjs +3 -1
- package/svelte.d.mts +3 -2
- package/svelte.d.ts +3 -2
- package/svelte.js +587 -139
- package/svelte.mjs +3 -1
- package/tanstack.d.mts +3 -2
- package/tanstack.d.ts +3 -2
- package/tanstack.js +587 -139
- package/tanstack.mjs +3 -1
- package/{types-CekOpKvz.d.ts → types-ffLPVG5_.d.mts} +248 -8
- package/{types-CekOpKvz.d.mts → types-ffLPVG5_.d.ts} +248 -8
package/index.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
assertNonEmptyId,
|
|
12
12
|
buildBulkActionQueryParameters,
|
|
13
13
|
getWorkflowRunId,
|
|
14
|
+
isInstanceOf,
|
|
14
15
|
loggingMiddleware,
|
|
15
16
|
makeGetWaitersRequest,
|
|
16
17
|
makeNotifyRequest,
|
|
@@ -22,12 +23,13 @@ import {
|
|
|
22
23
|
triggerFirstInvocation,
|
|
23
24
|
validateFlowControl,
|
|
24
25
|
validateLabel
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-UH6O5IJY.mjs";
|
|
26
27
|
|
|
27
28
|
// src/client/index.ts
|
|
28
|
-
import { Client as
|
|
29
|
+
import { Client as QStashClient2 } from "@upstash/qstash";
|
|
29
30
|
|
|
30
31
|
// src/client/dlq.ts
|
|
32
|
+
import { QstashError } from "@upstash/qstash";
|
|
31
33
|
function buildResumeRestartHeaders(options) {
|
|
32
34
|
const headers = {};
|
|
33
35
|
if (options?.flowControl) {
|
|
@@ -145,6 +147,27 @@ var DLQ = class {
|
|
|
145
147
|
});
|
|
146
148
|
return response;
|
|
147
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Cancel the in-progress failure function (failureUrl/failureFunction) call
|
|
152
|
+
* of a workflow run.
|
|
153
|
+
*
|
|
154
|
+
* Fails if the run has no failure function call in progress.
|
|
155
|
+
*
|
|
156
|
+
* @param dlqId - The ID of the DLQ message whose failure function call will be canceled
|
|
157
|
+
*/
|
|
158
|
+
async cancelFailureFunction({ dlqId }) {
|
|
159
|
+
assertNonEmptyId(dlqId, "DLQ id");
|
|
160
|
+
try {
|
|
161
|
+
await this.client.http.request({
|
|
162
|
+
path: ["v2", "workflows", "dlq", "callback", dlqId],
|
|
163
|
+
method: "DELETE",
|
|
164
|
+
parseResponseAsJson: false
|
|
165
|
+
});
|
|
166
|
+
} catch (error) {
|
|
167
|
+
if (isInstanceOf(error, QstashError) && error.status === 302) return;
|
|
168
|
+
throw error;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
148
171
|
/**
|
|
149
172
|
* Delete DLQ messages.
|
|
150
173
|
*
|
|
@@ -186,7 +209,7 @@ var DLQ = class {
|
|
|
186
209
|
var Client = class {
|
|
187
210
|
client;
|
|
188
211
|
constructor(clientConfig) {
|
|
189
|
-
this.client = new
|
|
212
|
+
this.client = new QStashClient2(clientConfig);
|
|
190
213
|
}
|
|
191
214
|
async cancel(request) {
|
|
192
215
|
if (typeof request === "object" && !Array.isArray(request) && ("ids" in request || "urlStartingWith" in request)) {
|
package/nextjs.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { c as RouteFunction, d as WorkflowServeOptions, I as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { c as RouteFunction, d as WorkflowServeOptions, I as InvokableWorkflow } from './types-ffLPVG5_.mjs';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-CbIV7145.mjs';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
|
+
import 'neverthrow';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Serve method to serve a Upstash Workflow in a Nextjs project
|
package/nextjs.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { c as RouteFunction, d as WorkflowServeOptions, I as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { c as RouteFunction, d as WorkflowServeOptions, I as InvokableWorkflow } from './types-ffLPVG5_.js';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-BCtZg31b.js';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
|
+
import 'neverthrow';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Serve method to serve a Upstash Workflow in a Nextjs project
|