@upstash/workflow 0.2.22-rc → 0.3.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/README.md +39 -0
- package/astro.d.mts +3 -5
- package/astro.d.ts +3 -5
- package/astro.js +126 -397
- package/astro.mjs +1 -1
- package/{chunk-CAQSUCHB.mjs → chunk-AGYYZKP7.mjs} +94 -400
- package/cloudflare.d.mts +3 -5
- package/cloudflare.d.ts +3 -5
- package/cloudflare.js +126 -397
- package/cloudflare.mjs +1 -1
- package/express.d.mts +3 -5
- package/express.d.ts +3 -5
- package/express.js +128 -398
- package/express.mjs +3 -2
- package/h3.d.mts +3 -5
- package/h3.d.ts +3 -5
- package/h3.js +136 -410
- package/h3.mjs +11 -14
- package/hono.d.mts +4 -6
- package/hono.d.ts +4 -6
- package/hono.js +126 -397
- package/hono.mjs +1 -1
- package/index.d.mts +11 -5
- package/index.d.ts +11 -5
- package/index.js +130 -433
- package/index.mjs +5 -6
- package/nextjs.d.mts +4 -6
- package/nextjs.d.ts +4 -6
- package/nextjs.js +128 -398
- package/nextjs.mjs +3 -2
- package/package.json +1 -1
- package/{serve-many-BNusWYgt.d.mts → serve-many-DEwKPF6H.d.mts} +1 -1
- package/{serve-many-CXqQP3RI.d.ts → serve-many-DVtHRxeg.d.ts} +1 -1
- package/solidjs.d.mts +1 -3
- package/solidjs.d.ts +1 -3
- package/solidjs.js +126 -397
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +4 -6
- package/svelte.d.ts +4 -6
- package/svelte.js +126 -397
- package/svelte.mjs +1 -1
- package/tanstack.d.mts +3 -5
- package/tanstack.d.ts +3 -5
- package/tanstack.js +126 -397
- package/tanstack.mjs +1 -1
- package/{types-Q3dM0UlR.d.ts → types-DESkn7K9.d.mts} +15 -306
- package/{types-Q3dM0UlR.d.mts → types-DESkn7K9.d.ts} +15 -306
package/index.mjs
CHANGED
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
WorkflowError,
|
|
8
8
|
WorkflowLogger,
|
|
9
9
|
WorkflowNonRetryableError,
|
|
10
|
-
|
|
10
|
+
WorkflowRetryAfterError,
|
|
11
11
|
getWorkflowRunId,
|
|
12
12
|
makeGetWaitersRequest,
|
|
13
13
|
makeNotifyRequest,
|
|
14
14
|
prepareFlowControl,
|
|
15
15
|
serve,
|
|
16
16
|
triggerFirstInvocation
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AGYYZKP7.mjs";
|
|
18
18
|
|
|
19
19
|
// src/client/index.ts
|
|
20
20
|
import { Client as QStashClient } from "@upstash/qstash";
|
|
@@ -246,7 +246,6 @@ var Client = class {
|
|
|
246
246
|
const finalWorkflowRunId = getWorkflowRunId(option.workflowRunId);
|
|
247
247
|
const context = new WorkflowContext({
|
|
248
248
|
qstashClient: this.client,
|
|
249
|
-
// @ts-expect-error header type mismatch because of bun
|
|
250
249
|
headers: new Headers({
|
|
251
250
|
...option.headers ?? {},
|
|
252
251
|
...option.label ? { [WORKFLOW_LABEL_HEADER]: option.label } : {}
|
|
@@ -257,14 +256,14 @@ var Client = class {
|
|
|
257
256
|
workflowRunId: finalWorkflowRunId,
|
|
258
257
|
retries: option.retries,
|
|
259
258
|
retryDelay: option.retryDelay,
|
|
260
|
-
telemetry: { sdk: SDK_TELEMETRY },
|
|
259
|
+
telemetry: option.disableTelemetry ? void 0 : { sdk: SDK_TELEMETRY },
|
|
261
260
|
flowControl: option.flowControl,
|
|
262
261
|
failureUrl,
|
|
263
262
|
label: option.label
|
|
264
263
|
});
|
|
265
264
|
return {
|
|
266
265
|
workflowContext: context,
|
|
267
|
-
telemetry: { sdk: SDK_TELEMETRY },
|
|
266
|
+
telemetry: option.disableTelemetry ? void 0 : { sdk: SDK_TELEMETRY },
|
|
268
267
|
delay: option.delay,
|
|
269
268
|
notBefore: option.notBefore,
|
|
270
269
|
keepTriggerConfig: option.keepTriggerConfig
|
|
@@ -348,6 +347,6 @@ export {
|
|
|
348
347
|
WorkflowError,
|
|
349
348
|
WorkflowLogger,
|
|
350
349
|
WorkflowNonRetryableError,
|
|
351
|
-
|
|
350
|
+
WorkflowRetryAfterError,
|
|
352
351
|
serve
|
|
353
352
|
};
|
package/nextjs.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { R as RouteFunction, n as PublicServeOptions, y as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { R as RouteFunction, n as PublicServeOptions, y as InvokableWorkflow } from './types-DESkn7K9.mjs';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-DEwKPF6H.mjs';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
|
-
import 'ai';
|
|
7
|
-
import '@ai-sdk/openai';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Serve method to serve a Upstash Workflow in a Nextjs project
|
|
@@ -18,14 +16,14 @@ import '@ai-sdk/openai';
|
|
|
18
16
|
declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => {
|
|
19
17
|
POST: (request: Request) => Promise<Response>;
|
|
20
18
|
};
|
|
21
|
-
declare const createWorkflow: <TInitialPayload, TResult>(
|
|
19
|
+
declare const createWorkflow: <TInitialPayload, TResult>(...params: Parameters<typeof serve<TInitialPayload, TResult>>) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
22
20
|
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
|
|
23
21
|
POST: (request: Request) => Promise<any>;
|
|
24
22
|
};
|
|
25
23
|
declare const servePagesRouter: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => {
|
|
26
24
|
handler: NextApiHandler;
|
|
27
25
|
};
|
|
28
|
-
declare const createWorkflowPagesRouter: <TInitialPayload, TResult>(
|
|
26
|
+
declare const createWorkflowPagesRouter: <TInitialPayload, TResult>(...params: Parameters<typeof servePagesRouter<TInitialPayload, TResult>>) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
29
27
|
declare const serveManyPagesRouter: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
|
|
30
28
|
handler: (req: NextApiRequest, res: NextApiResponse<any>) => Promise<any>;
|
|
31
29
|
};
|
package/nextjs.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { R as RouteFunction, n as PublicServeOptions, y as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { R as RouteFunction, n as PublicServeOptions, y as InvokableWorkflow } from './types-DESkn7K9.js';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-DVtHRxeg.js';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
|
-
import 'ai';
|
|
7
|
-
import '@ai-sdk/openai';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Serve method to serve a Upstash Workflow in a Nextjs project
|
|
@@ -18,14 +16,14 @@ import '@ai-sdk/openai';
|
|
|
18
16
|
declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => {
|
|
19
17
|
POST: (request: Request) => Promise<Response>;
|
|
20
18
|
};
|
|
21
|
-
declare const createWorkflow: <TInitialPayload, TResult>(
|
|
19
|
+
declare const createWorkflow: <TInitialPayload, TResult>(...params: Parameters<typeof serve<TInitialPayload, TResult>>) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
22
20
|
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
|
|
23
21
|
POST: (request: Request) => Promise<any>;
|
|
24
22
|
};
|
|
25
23
|
declare const servePagesRouter: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => {
|
|
26
24
|
handler: NextApiHandler;
|
|
27
25
|
};
|
|
28
|
-
declare const createWorkflowPagesRouter: <TInitialPayload, TResult>(
|
|
26
|
+
declare const createWorkflowPagesRouter: <TInitialPayload, TResult>(...params: Parameters<typeof servePagesRouter<TInitialPayload, TResult>>) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
29
27
|
declare const serveManyPagesRouter: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
|
|
30
28
|
handler: (req: NextApiRequest, res: NextApiResponse<any>) => Promise<any>;
|
|
31
29
|
};
|