@upstash/workflow 0.1.2 → 0.1.3-crpyto-canary-2

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/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-p7sxktVE.mjs';
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-p7sxktVE.js';
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
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // platforms/h3.ts
@@ -253,6 +263,9 @@ function readRawBody(event, encoding = "utf8") {
253
263
  if (_resolved.constructor === Object) {
254
264
  return Buffer.from(JSON.stringify(_resolved));
255
265
  }
266
+ if (_resolved instanceof URLSearchParams) {
267
+ return Buffer.from(_resolved.toString());
268
+ }
256
269
  return Buffer.from(_resolved);
257
270
  });
258
271
  return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
@@ -1435,7 +1448,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
1435
1448
  };
1436
1449
  var sortSteps = (steps) => {
1437
1450
  const getStepId = (step) => step.targetStep || step.stepId;
1438
- return steps.toSorted((step, stepOther) => getStepId(step) - getStepId(stepOther));
1451
+ return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
1439
1452
  };
1440
1453
 
1441
1454
  // src/client/utils.ts
@@ -2008,10 +2021,11 @@ var WorkflowLogger = class _WorkflowLogger {
2008
2021
  };
2009
2022
 
2010
2023
  // src/utils.ts
2024
+ var import_crypto = __toESM(require("crypto"));
2011
2025
  var NANOID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
2012
2026
  var NANOID_LENGTH = 21;
2013
2027
  function nanoid() {
2014
- return [...crypto.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
2028
+ return [...import_crypto.default.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
2015
2029
  }
2016
2030
  function decodeBase64(base64) {
2017
2031
  try {
package/h3.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-EKVRVBHL.mjs";
3
+ } from "./chunk-3FILROVK.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
@@ -1,5 +1,5 @@
1
1
  import { Context } from 'hono';
2
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.mjs';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.mjs';
3
3
  import '@upstash/qstash';
4
4
 
5
5
  type WorkflowBindings = {
package/hono.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Context } from 'hono';
2
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.js';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.js';
3
3
  import '@upstash/qstash';
4
4
 
5
5
  type WorkflowBindings = {
package/hono.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // platforms/hono.ts
@@ -1126,7 +1136,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
1126
1136
  };
1127
1137
  var sortSteps = (steps) => {
1128
1138
  const getStepId = (step) => step.targetStep || step.stepId;
1129
- return steps.toSorted((step, stepOther) => getStepId(step) - getStepId(stepOther));
1139
+ return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
1130
1140
  };
1131
1141
 
1132
1142
  // src/client/utils.ts
@@ -1699,10 +1709,11 @@ var WorkflowLogger = class _WorkflowLogger {
1699
1709
  };
1700
1710
 
1701
1711
  // src/utils.ts
1712
+ var import_crypto = __toESM(require("crypto"));
1702
1713
  var NANOID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
1703
1714
  var NANOID_LENGTH = 21;
1704
1715
  function nanoid() {
1705
- return [...crypto.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1716
+ return [...import_crypto.default.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1706
1717
  }
1707
1718
  function decodeBase64(base64) {
1708
1719
  try {
package/hono.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-EKVRVBHL.mjs";
3
+ } from "./chunk-3FILROVK.mjs";
4
4
 
5
5
  // platforms/hono.ts
6
6
  var serve2 = (routeFunction, options) => {
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-p7sxktVE.mjs';
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-p7sxktVE.mjs';
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-p7sxktVE.js';
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-p7sxktVE.js';
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
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/index.ts
@@ -1132,7 +1142,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
1132
1142
  };
1133
1143
  var sortSteps = (steps) => {
1134
1144
  const getStepId = (step) => step.targetStep || step.stepId;
1135
- return steps.toSorted((step, stepOther) => getStepId(step) - getStepId(stepOther));
1145
+ return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
1136
1146
  };
1137
1147
 
1138
1148
  // src/client/utils.ts
@@ -1712,10 +1722,11 @@ var WorkflowLogger = class _WorkflowLogger {
1712
1722
  };
1713
1723
 
1714
1724
  // src/utils.ts
1725
+ var import_crypto = __toESM(require("crypto"));
1715
1726
  var NANOID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
1716
1727
  var NANOID_LENGTH = 21;
1717
1728
  function nanoid() {
1718
- return [...crypto.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1729
+ return [...import_crypto.default.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1719
1730
  }
1720
1731
  function decodeBase64(base64) {
1721
1732
  try {
package/index.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  WorkflowContext,
7
7
  WorkflowLogger,
8
8
  serve
9
- } from "./chunk-EKVRVBHL.mjs";
9
+ } from "./chunk-3FILROVK.mjs";
10
10
  export {
11
11
  Client,
12
12
  QStashWorkflowAbort,
package/nextjs.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { NextApiHandler } from 'next';
2
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.mjs';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.mjs';
3
3
  import '@upstash/qstash';
4
4
 
5
5
  /**
package/nextjs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { NextApiHandler } from 'next';
2
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.js';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.js';
3
3
  import '@upstash/qstash';
4
4
 
5
5
  /**
package/nextjs.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // platforms/nextjs.ts
@@ -1127,7 +1137,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
1127
1137
  };
1128
1138
  var sortSteps = (steps) => {
1129
1139
  const getStepId = (step) => step.targetStep || step.stepId;
1130
- return steps.toSorted((step, stepOther) => getStepId(step) - getStepId(stepOther));
1140
+ return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
1131
1141
  };
1132
1142
 
1133
1143
  // src/client/utils.ts
@@ -1700,10 +1710,11 @@ var WorkflowLogger = class _WorkflowLogger {
1700
1710
  };
1701
1711
 
1702
1712
  // src/utils.ts
1713
+ var import_crypto = __toESM(require("crypto"));
1703
1714
  var NANOID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
1704
1715
  var NANOID_LENGTH = 21;
1705
1716
  function nanoid() {
1706
- return [...crypto.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1717
+ return [...import_crypto.default.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1707
1718
  }
1708
1719
  function decodeBase64(base64) {
1709
1720
  try {
package/nextjs.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-EKVRVBHL.mjs";
3
+ } from "./chunk-3FILROVK.mjs";
4
4
 
5
5
  // platforms/nextjs.ts
6
6
  var serve2 = (routeFunction, options) => {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@upstash/workflow","version":"v0.1.2","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"}},"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","eslint":"^9.11.1","eslint-plugin-unicorn":"^55.0.0","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"}}
1
+ {"name":"@upstash/workflow","version":"v0.1.3-crpyto-canary-2","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
@@ -1,5 +1,5 @@
1
1
  import { APIEvent } from '@solidjs/start/server';
2
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.mjs';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.mjs';
3
3
  import '@upstash/qstash';
4
4
 
5
5
  /**
package/solidjs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { APIEvent } from '@solidjs/start/server';
2
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.js';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.js';
3
3
  import '@upstash/qstash';
4
4
 
5
5
  /**
package/solidjs.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // platforms/solidjs.ts
@@ -1126,7 +1136,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
1126
1136
  };
1127
1137
  var sortSteps = (steps) => {
1128
1138
  const getStepId = (step) => step.targetStep || step.stepId;
1129
- return steps.toSorted((step, stepOther) => getStepId(step) - getStepId(stepOther));
1139
+ return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
1130
1140
  };
1131
1141
 
1132
1142
  // src/client/utils.ts
@@ -1699,10 +1709,11 @@ var WorkflowLogger = class _WorkflowLogger {
1699
1709
  };
1700
1710
 
1701
1711
  // src/utils.ts
1712
+ var import_crypto = __toESM(require("crypto"));
1702
1713
  var NANOID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
1703
1714
  var NANOID_LENGTH = 21;
1704
1715
  function nanoid() {
1705
- return [...crypto.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1716
+ return [...import_crypto.default.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1706
1717
  }
1707
1718
  function decodeBase64(base64) {
1708
1719
  try {
package/solidjs.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-EKVRVBHL.mjs";
3
+ } from "./chunk-3FILROVK.mjs";
4
4
 
5
5
  // platforms/solidjs.ts
6
6
  var serve2 = (routeFunction, options) => {
package/svelte.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler } from '@sveltejs/kit';
2
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.mjs';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.mjs';
3
3
  import '@upstash/qstash';
4
4
 
5
5
  /**
package/svelte.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler } from '@sveltejs/kit';
2
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.js';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.js';
3
3
  import '@upstash/qstash';
4
4
 
5
5
  /**
package/svelte.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // platforms/svelte.ts
@@ -1126,7 +1136,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
1126
1136
  };
1127
1137
  var sortSteps = (steps) => {
1128
1138
  const getStepId = (step) => step.targetStep || step.stepId;
1129
- return steps.toSorted((step, stepOther) => getStepId(step) - getStepId(stepOther));
1139
+ return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
1130
1140
  };
1131
1141
 
1132
1142
  // src/client/utils.ts
@@ -1699,10 +1709,11 @@ var WorkflowLogger = class _WorkflowLogger {
1699
1709
  };
1700
1710
 
1701
1711
  // src/utils.ts
1712
+ var import_crypto = __toESM(require("crypto"));
1702
1713
  var NANOID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
1703
1714
  var NANOID_LENGTH = 21;
1704
1715
  function nanoid() {
1705
- return [...crypto.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1716
+ return [...import_crypto.default.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
1706
1717
  }
1707
1718
  function decodeBase64(base64) {
1708
1719
  try {
package/svelte.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-EKVRVBHL.mjs";
3
+ } from "./chunk-3FILROVK.mjs";
4
4
 
5
5
  // platforms/svelte.ts
6
6
  var serve2 = (routeFunction, options) => {
@@ -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 };