@upstash/workflow 0.1.2 → 0.1.3-crpyto-canary
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 +9 -0
- package/astro.d.ts +9 -0
- package/astro.js +2128 -0
- package/astro.mjs +18 -0
- package/{chunk-EKVRVBHL.mjs → chunk-VIOVJ6QS.mjs} +36 -1
- package/cloudflare.d.mts +1 -1
- package/cloudflare.d.ts +1 -1
- package/cloudflare.js +1 -1
- package/cloudflare.mjs +1 -1
- package/express.d.mts +7 -0
- package/express.d.ts +7 -0
- package/express.js +26087 -0
- package/express.mjs +23967 -0
- package/h3.d.mts +1 -1
- package/h3.d.ts +1 -1
- package/h3.js +4 -1
- package/h3.mjs +4 -1
- package/hono.d.mts +1 -1
- package/hono.d.ts +1 -1
- package/hono.js +1 -1
- package/hono.mjs +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/nextjs.d.mts +1 -1
- package/nextjs.d.ts +1 -1
- package/nextjs.js +1 -1
- package/nextjs.mjs +1 -1
- package/package.json +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +1 -1
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +1 -1
- package/svelte.d.ts +1 -1
- package/svelte.js +1 -1
- package/svelte.mjs +1 -1
- package/{types-p7sxktVE.d.mts → types-CI-2skYU.d.mts} +5 -4
- package/{types-p7sxktVE.d.ts → types-CI-2skYU.d.ts} +5 -4
package/h3.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
|
-
import { R as RouteFunction, W as WorkflowServeOptions } from './types-
|
|
2
|
+
import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.mjs';
|
|
3
3
|
import '@upstash/qstash';
|
|
4
4
|
|
|
5
5
|
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish">) => {
|
package/h3.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
|
-
import { R as RouteFunction, W as WorkflowServeOptions } from './types-
|
|
2
|
+
import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.js';
|
|
3
3
|
import '@upstash/qstash';
|
|
4
4
|
|
|
5
5
|
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish">) => {
|
package/h3.js
CHANGED
|
@@ -253,6 +253,9 @@ function readRawBody(event, encoding = "utf8") {
|
|
|
253
253
|
if (_resolved.constructor === Object) {
|
|
254
254
|
return Buffer.from(JSON.stringify(_resolved));
|
|
255
255
|
}
|
|
256
|
+
if (_resolved instanceof URLSearchParams) {
|
|
257
|
+
return Buffer.from(_resolved.toString());
|
|
258
|
+
}
|
|
256
259
|
return Buffer.from(_resolved);
|
|
257
260
|
});
|
|
258
261
|
return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
|
|
@@ -1435,7 +1438,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
|
|
|
1435
1438
|
};
|
|
1436
1439
|
var sortSteps = (steps) => {
|
|
1437
1440
|
const getStepId = (step) => step.targetStep || step.stepId;
|
|
1438
|
-
return steps.
|
|
1441
|
+
return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
|
|
1439
1442
|
};
|
|
1440
1443
|
|
|
1441
1444
|
// src/client/utils.ts
|
package/h3.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
serve
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VIOVJ6QS.mjs";
|
|
4
4
|
|
|
5
5
|
// node_modules/defu/dist/defu.mjs
|
|
6
6
|
function isPlainObject(value) {
|
|
@@ -231,6 +231,9 @@ function readRawBody(event, encoding = "utf8") {
|
|
|
231
231
|
if (_resolved.constructor === Object) {
|
|
232
232
|
return Buffer.from(JSON.stringify(_resolved));
|
|
233
233
|
}
|
|
234
|
+
if (_resolved instanceof URLSearchParams) {
|
|
235
|
+
return Buffer.from(_resolved.toString());
|
|
236
|
+
}
|
|
234
237
|
return Buffer.from(_resolved);
|
|
235
238
|
});
|
|
236
239
|
return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
|
package/hono.d.mts
CHANGED
package/hono.d.ts
CHANGED
package/hono.js
CHANGED
|
@@ -1126,7 +1126,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
|
|
|
1126
1126
|
};
|
|
1127
1127
|
var sortSteps = (steps) => {
|
|
1128
1128
|
const getStepId = (step) => step.targetStep || step.stepId;
|
|
1129
|
-
return steps.
|
|
1129
|
+
return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
|
|
1130
1130
|
};
|
|
1131
1131
|
|
|
1132
1132
|
// src/client/utils.ts
|
package/hono.mjs
CHANGED
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteFunction, W as WorkflowServeOptions, N as NotifyResponse, a as Waiter, S as Step } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse, j as FailureFunctionPayload, F as FinishCondition, L as LogLevel, n as NotifyStepResponse, P as ParallelCallState, g as RawStep, k as RequiredExceptFields, i as StepFunction, f as StepType, e as StepTypes, h as SyncStepFunction, l as WaitRequest, m as WaitStepResponse, c as WorkflowClient, b as WorkflowContext, p as WorkflowLogger, o as WorkflowLoggerOptions, d as WorkflowReceiver } from './types-
|
|
1
|
+
import { R as RouteFunction, W as WorkflowServeOptions, N as NotifyResponse, a as Waiter, S as Step } from './types-CI-2skYU.mjs';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, D as Duration, j as FailureFunctionPayload, F as FinishCondition, L as LogLevel, n as NotifyStepResponse, P as ParallelCallState, g as RawStep, k as RequiredExceptFields, i as StepFunction, f as StepType, e as StepTypes, h as SyncStepFunction, l as WaitRequest, m as WaitStepResponse, c as WorkflowClient, b as WorkflowContext, p as WorkflowLogger, o as WorkflowLoggerOptions, d as WorkflowReceiver } from './types-CI-2skYU.mjs';
|
|
3
3
|
import { Client as Client$1, QstashError } from '@upstash/qstash';
|
|
4
4
|
|
|
5
5
|
/**
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteFunction, W as WorkflowServeOptions, N as NotifyResponse, a as Waiter, S as Step } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse, j as FailureFunctionPayload, F as FinishCondition, L as LogLevel, n as NotifyStepResponse, P as ParallelCallState, g as RawStep, k as RequiredExceptFields, i as StepFunction, f as StepType, e as StepTypes, h as SyncStepFunction, l as WaitRequest, m as WaitStepResponse, c as WorkflowClient, b as WorkflowContext, p as WorkflowLogger, o as WorkflowLoggerOptions, d as WorkflowReceiver } from './types-
|
|
1
|
+
import { R as RouteFunction, W as WorkflowServeOptions, N as NotifyResponse, a as Waiter, S as Step } from './types-CI-2skYU.js';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, D as Duration, j as FailureFunctionPayload, F as FinishCondition, L as LogLevel, n as NotifyStepResponse, P as ParallelCallState, g as RawStep, k as RequiredExceptFields, i as StepFunction, f as StepType, e as StepTypes, h as SyncStepFunction, l as WaitRequest, m as WaitStepResponse, c as WorkflowClient, b as WorkflowContext, p as WorkflowLogger, o as WorkflowLoggerOptions, d as WorkflowReceiver } from './types-CI-2skYU.js';
|
|
3
3
|
import { Client as Client$1, QstashError } from '@upstash/qstash';
|
|
4
4
|
|
|
5
5
|
/**
|
package/index.js
CHANGED
|
@@ -1132,7 +1132,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
|
|
|
1132
1132
|
};
|
|
1133
1133
|
var sortSteps = (steps) => {
|
|
1134
1134
|
const getStepId = (step) => step.targetStep || step.stepId;
|
|
1135
|
-
return steps.
|
|
1135
|
+
return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
|
|
1136
1136
|
};
|
|
1137
1137
|
|
|
1138
1138
|
// src/client/utils.ts
|
package/index.mjs
CHANGED
package/nextjs.d.mts
CHANGED
package/nextjs.d.ts
CHANGED
package/nextjs.js
CHANGED
|
@@ -1127,7 +1127,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
|
|
|
1127
1127
|
};
|
|
1128
1128
|
var sortSteps = (steps) => {
|
|
1129
1129
|
const getStepId = (step) => step.targetStep || step.stepId;
|
|
1130
|
-
return steps.
|
|
1130
|
+
return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
|
|
1131
1131
|
};
|
|
1132
1132
|
|
|
1133
1133
|
// src/client/utils.ts
|
package/nextjs.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/workflow","version":"v0.1.
|
|
1
|
+
{"name":"@upstash/workflow","version":"v0.1.3-crpyto-canary","description":"Durable, Reliable and Performant Serverless Functions","main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./*"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./dist/nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./h3":{"import":"./h3.mjs","require":"./h3.js"},"./svelte":{"import":"./svelte.mjs","require":"./svelte.js"},"./solidjs":{"import":"./solidjs.mjs","require":"./solidjs.js"},"./workflow":{"import":"./workflow.mjs","require":"./workflow.js"},"./hono":{"import":"./hono.mjs","require":"./hono.js"},"./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./astro":{"import":"./astro.mjs","require":"./astro.js"},"./express":{"import":"./express.mjs","require":"./express.js"}},"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test src","fmt":"prettier --write .","lint":"tsc && eslint \"{src,platforms}/**/*.{js,ts,tsx}\" --quiet --fix","check-exports":"bun run build && cd dist && attw -P"},"repository":{"type":"git","url":"git+https://github.com/upstash/workflow-ts.git"},"keywords":["upstash","qstash","workflow","serverless"],"author":"Cahid Arda Oz","license":"MIT","bugs":{"url":"https://github.com/upstash/workflow-ts/issues"},"homepage":"https://github.com/upstash/workflow-ts#readme","devDependencies":{"@commitlint/cli":"^19.5.0","@commitlint/config-conventional":"^19.5.0","@eslint/js":"^9.11.1","@solidjs/start":"^1.0.8","@sveltejs/kit":"^2.6.1","@types/bun":"^1.1.10","@types/express":"^5.0.0","astro":"^4.16.7","eslint":"^9.11.1","eslint-plugin-unicorn":"^55.0.0","express":"^4.21.1","globals":"^15.10.0","h3":"^1.12.0","hono":"^4.6.3","husky":"^9.1.6","next":"^14.2.14","prettier":"3.3.3","tsc":"^2.0.4","tsup":"^8.3.0","typescript":"5.4.5","typescript-eslint":"^8.8.0"},"dependencies":{"@upstash/qstash":"^2.7.12"},"directories":{"example":"examples"}}
|
package/solidjs.d.mts
CHANGED
package/solidjs.d.ts
CHANGED
package/solidjs.js
CHANGED
|
@@ -1126,7 +1126,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
|
|
|
1126
1126
|
};
|
|
1127
1127
|
var sortSteps = (steps) => {
|
|
1128
1128
|
const getStepId = (step) => step.targetStep || step.stepId;
|
|
1129
|
-
return steps.
|
|
1129
|
+
return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
|
|
1130
1130
|
};
|
|
1131
1131
|
|
|
1132
1132
|
// src/client/utils.ts
|
package/solidjs.mjs
CHANGED
package/svelte.d.mts
CHANGED
package/svelte.d.ts
CHANGED
package/svelte.js
CHANGED
|
@@ -1126,7 +1126,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
|
|
|
1126
1126
|
};
|
|
1127
1127
|
var sortSteps = (steps) => {
|
|
1128
1128
|
const getStepId = (step) => step.targetStep || step.stepId;
|
|
1129
|
-
return steps.
|
|
1129
|
+
return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
|
|
1130
1130
|
};
|
|
1131
1131
|
|
|
1132
1132
|
// src/client/utils.ts
|
package/svelte.mjs
CHANGED
|
@@ -340,7 +340,7 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
340
340
|
* @param duration sleep duration in seconds
|
|
341
341
|
* @returns undefined
|
|
342
342
|
*/
|
|
343
|
-
sleep(stepName: string, duration: number): Promise<void>;
|
|
343
|
+
sleep(stepName: string, duration: number | Duration): Promise<void>;
|
|
344
344
|
/**
|
|
345
345
|
* Stops the execution until the date time provided.
|
|
346
346
|
*
|
|
@@ -416,7 +416,7 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
416
416
|
* timeout is true if the wait times out, if notified it is false. eventData
|
|
417
417
|
* is the value passed to `client.notify`.
|
|
418
418
|
*/
|
|
419
|
-
waitForEvent(stepName: string, eventId: string, timeout: number): Promise<WaitStepResponse>;
|
|
419
|
+
waitForEvent(stepName: string, eventId: string, timeout: number | Duration): Promise<WaitStepResponse>;
|
|
420
420
|
notify(stepName: string, eventId: string, eventData: unknown): Promise<NotifyStepResponse>;
|
|
421
421
|
/**
|
|
422
422
|
* Adds steps to the executor. Needed so that it can be overwritten in
|
|
@@ -492,7 +492,7 @@ type Step<TResult = unknown, TBody = unknown> = {
|
|
|
492
492
|
/**
|
|
493
493
|
* sleep duration in seconds. Set when context.sleep is used.
|
|
494
494
|
*/
|
|
495
|
-
sleepFor?: number;
|
|
495
|
+
sleepFor?: number | Duration;
|
|
496
496
|
/**
|
|
497
497
|
* unix timestamp (in seconds) to wait until. Set when context.sleepUntil is used.
|
|
498
498
|
*/
|
|
@@ -675,5 +675,6 @@ type CallResponse = {
|
|
|
675
675
|
body: unknown;
|
|
676
676
|
header: Record<string, string[]>;
|
|
677
677
|
};
|
|
678
|
+
type Duration = `${bigint}s` | `${bigint}m` | `${bigint}h` | `${bigint}d`;
|
|
678
679
|
|
|
679
|
-
export { type AsyncStepFunction as A, type CallResponse as C, type FinishCondition as F, type LogLevel as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type Step as S, type WorkflowServeOptions as W, type Waiter as a, WorkflowContext as b, type WorkflowClient as c, type WorkflowReceiver as d, StepTypes as e, type StepType as f, type RawStep as g, type SyncStepFunction as h, type StepFunction as i, type FailureFunctionPayload as j, type RequiredExceptFields as k, type WaitRequest as l, type WaitStepResponse as m, type NotifyStepResponse as n, type WorkflowLoggerOptions as o, WorkflowLogger as p };
|
|
680
|
+
export { type AsyncStepFunction as A, type CallResponse as C, type Duration as D, type FinishCondition as F, type LogLevel as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type Step as S, type WorkflowServeOptions as W, type Waiter as a, WorkflowContext as b, type WorkflowClient as c, type WorkflowReceiver as d, StepTypes as e, type StepType as f, type RawStep as g, type SyncStepFunction as h, type StepFunction as i, type FailureFunctionPayload as j, type RequiredExceptFields as k, type WaitRequest as l, type WaitStepResponse as m, type NotifyStepResponse as n, type WorkflowLoggerOptions as o, WorkflowLogger as p };
|
|
@@ -340,7 +340,7 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
340
340
|
* @param duration sleep duration in seconds
|
|
341
341
|
* @returns undefined
|
|
342
342
|
*/
|
|
343
|
-
sleep(stepName: string, duration: number): Promise<void>;
|
|
343
|
+
sleep(stepName: string, duration: number | Duration): Promise<void>;
|
|
344
344
|
/**
|
|
345
345
|
* Stops the execution until the date time provided.
|
|
346
346
|
*
|
|
@@ -416,7 +416,7 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
416
416
|
* timeout is true if the wait times out, if notified it is false. eventData
|
|
417
417
|
* is the value passed to `client.notify`.
|
|
418
418
|
*/
|
|
419
|
-
waitForEvent(stepName: string, eventId: string, timeout: number): Promise<WaitStepResponse>;
|
|
419
|
+
waitForEvent(stepName: string, eventId: string, timeout: number | Duration): Promise<WaitStepResponse>;
|
|
420
420
|
notify(stepName: string, eventId: string, eventData: unknown): Promise<NotifyStepResponse>;
|
|
421
421
|
/**
|
|
422
422
|
* Adds steps to the executor. Needed so that it can be overwritten in
|
|
@@ -492,7 +492,7 @@ type Step<TResult = unknown, TBody = unknown> = {
|
|
|
492
492
|
/**
|
|
493
493
|
* sleep duration in seconds. Set when context.sleep is used.
|
|
494
494
|
*/
|
|
495
|
-
sleepFor?: number;
|
|
495
|
+
sleepFor?: number | Duration;
|
|
496
496
|
/**
|
|
497
497
|
* unix timestamp (in seconds) to wait until. Set when context.sleepUntil is used.
|
|
498
498
|
*/
|
|
@@ -675,5 +675,6 @@ type CallResponse = {
|
|
|
675
675
|
body: unknown;
|
|
676
676
|
header: Record<string, string[]>;
|
|
677
677
|
};
|
|
678
|
+
type Duration = `${bigint}s` | `${bigint}m` | `${bigint}h` | `${bigint}d`;
|
|
678
679
|
|
|
679
|
-
export { type AsyncStepFunction as A, type CallResponse as C, type FinishCondition as F, type LogLevel as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type Step as S, type WorkflowServeOptions as W, type Waiter as a, WorkflowContext as b, type WorkflowClient as c, type WorkflowReceiver as d, StepTypes as e, type StepType as f, type RawStep as g, type SyncStepFunction as h, type StepFunction as i, type FailureFunctionPayload as j, type RequiredExceptFields as k, type WaitRequest as l, type WaitStepResponse as m, type NotifyStepResponse as n, type WorkflowLoggerOptions as o, WorkflowLogger as p };
|
|
680
|
+
export { type AsyncStepFunction as A, type CallResponse as C, type Duration as D, type FinishCondition as F, type LogLevel as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type Step as S, type WorkflowServeOptions as W, type Waiter as a, WorkflowContext as b, type WorkflowClient as c, type WorkflowReceiver as d, StepTypes as e, type StepType as f, type RawStep as g, type SyncStepFunction as h, type StepFunction as i, type FailureFunctionPayload as j, type RequiredExceptFields as k, type WaitRequest as l, type WaitStepResponse as m, type NotifyStepResponse as n, type WorkflowLoggerOptions as o, WorkflowLogger as p };
|