@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.mjs ADDED
@@ -0,0 +1,18 @@
1
+ import {
2
+ serve
3
+ } from "./chunk-VIOVJ6QS.mjs";
4
+
5
+ // platforms/astro.ts
6
+ function serve2(routeFunction, options) {
7
+ const POST = (apiContext) => {
8
+ const { handler } = serve(
9
+ (workflowContext) => routeFunction(workflowContext, apiContext),
10
+ options
11
+ );
12
+ return handler(apiContext.request);
13
+ };
14
+ return { POST };
15
+ }
16
+ export {
17
+ serve2 as serve
18
+ };
@@ -1,3 +1,35 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
1
33
  // src/error.ts
2
34
  import { QstashError } from "@upstash/qstash";
3
35
  var QStashWorkflowError = class extends QstashError {
@@ -1100,7 +1132,7 @@ var validateParallelSteps = (lazySteps, stepsFromRequest) => {
1100
1132
  };
1101
1133
  var sortSteps = (steps) => {
1102
1134
  const getStepId = (step) => step.targetStep || step.stepId;
1103
- return steps.toSorted((step, stepOther) => getStepId(step) - getStepId(stepOther));
1135
+ return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
1104
1136
  };
1105
1137
 
1106
1138
  // src/client/utils.ts
@@ -2162,6 +2194,9 @@ var Client3 = class {
2162
2194
  };
2163
2195
 
2164
2196
  export {
2197
+ __require,
2198
+ __commonJS,
2199
+ __toESM,
2165
2200
  QStashWorkflowError,
2166
2201
  QStashWorkflowAbort,
2167
2202
  StepTypes,
package/cloudflare.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.mjs';
1
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.mjs';
2
2
  import '@upstash/qstash';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as RouteFunction, W as WorkflowServeOptions } from './types-p7sxktVE.js';
1
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.js';
2
2
  import '@upstash/qstash';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.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.toSorted((step, stepOther) => getStepId(step) - getStepId(stepOther));
1129
+ return [...steps].sort((step, stepOther) => getStepId(step) - getStepId(stepOther));
1130
1130
  };
1131
1131
 
1132
1132
  // src/client/utils.ts
package/cloudflare.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serve
3
- } from "./chunk-EKVRVBHL.mjs";
3
+ } from "./chunk-VIOVJ6QS.mjs";
4
4
 
5
5
  // platforms/cloudflare.ts
6
6
  var getArgs = (args) => {
package/express.d.mts ADDED
@@ -0,0 +1,7 @@
1
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.mjs';
2
+ import { Router } from 'express';
3
+ import '@upstash/qstash';
4
+
5
+ declare function serve<TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<globalThis.Response, TInitialPayload>, "onStepFinish">): Router;
6
+
7
+ export { serve };
package/express.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CI-2skYU.js';
2
+ import { Router } from 'express';
3
+ import '@upstash/qstash';
4
+
5
+ declare function serve<TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<globalThis.Response, TInitialPayload>, "onStepFinish">): Router;
6
+
7
+ export { serve };