@upstash/workflow 0.2.6 → 0.2.7
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.js +3 -0
- package/astro.mjs +1 -1
- package/{chunk-OLNSY3BB.mjs → chunk-U6XFLG7W.mjs} +3 -0
- package/cloudflare.js +3 -0
- package/cloudflare.mjs +1 -1
- package/express.js +9 -1
- package/express.mjs +7 -2
- package/h3.js +3 -0
- package/h3.mjs +1 -1
- package/hono.js +3 -0
- package/hono.mjs +1 -1
- package/index.js +3 -0
- package/index.mjs +1 -1
- package/nextjs.js +3 -0
- package/nextjs.mjs +1 -1
- package/package.json +1 -1
- package/solidjs.js +3 -0
- package/solidjs.mjs +1 -1
- package/svelte.js +3 -0
- package/svelte.mjs +1 -1
package/astro.js
CHANGED
|
@@ -759,6 +759,9 @@ var triggerFirstInvocation = async ({
|
|
|
759
759
|
retries: workflowContext.retries,
|
|
760
760
|
telemetry
|
|
761
761
|
});
|
|
762
|
+
if (workflowContext.headers.get("content-type")) {
|
|
763
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
764
|
+
}
|
|
762
765
|
if (useJSONContent) {
|
|
763
766
|
headers["content-type"] = "application/json";
|
|
764
767
|
}
|
package/astro.mjs
CHANGED
|
@@ -772,6 +772,9 @@ var triggerFirstInvocation = async ({
|
|
|
772
772
|
retries: workflowContext.retries,
|
|
773
773
|
telemetry
|
|
774
774
|
});
|
|
775
|
+
if (workflowContext.headers.get("content-type")) {
|
|
776
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
777
|
+
}
|
|
775
778
|
if (useJSONContent) {
|
|
776
779
|
headers["content-type"] = "application/json";
|
|
777
780
|
}
|
package/cloudflare.js
CHANGED
|
@@ -759,6 +759,9 @@ var triggerFirstInvocation = async ({
|
|
|
759
759
|
retries: workflowContext.retries,
|
|
760
760
|
telemetry
|
|
761
761
|
});
|
|
762
|
+
if (workflowContext.headers.get("content-type")) {
|
|
763
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
764
|
+
}
|
|
762
765
|
if (useJSONContent) {
|
|
763
766
|
headers["content-type"] = "application/json";
|
|
764
767
|
}
|
package/cloudflare.mjs
CHANGED
package/express.js
CHANGED
|
@@ -24431,6 +24431,9 @@ var triggerFirstInvocation = async ({
|
|
|
24431
24431
|
retries: workflowContext.retries,
|
|
24432
24432
|
telemetry
|
|
24433
24433
|
});
|
|
24434
|
+
if (workflowContext.headers.get("content-type")) {
|
|
24435
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
24436
|
+
}
|
|
24434
24437
|
if (useJSONContent) {
|
|
24435
24438
|
headers["content-type"] = "application/json";
|
|
24436
24439
|
}
|
|
@@ -26541,6 +26544,9 @@ var serveBase = (routeFunction, telemetry, options) => {
|
|
|
26541
26544
|
|
|
26542
26545
|
// platforms/express.ts
|
|
26543
26546
|
var import_express = __toESM(require_express2());
|
|
26547
|
+
var isEmptyRequest = (req) => {
|
|
26548
|
+
return req.headers["content-type"] === "application/json" && req.headers["content-length"] === "0";
|
|
26549
|
+
};
|
|
26544
26550
|
function serve(routeFunction, options) {
|
|
26545
26551
|
const router = (0, import_express.Router)();
|
|
26546
26552
|
const handler = async (request_, res) => {
|
|
@@ -26549,7 +26555,9 @@ function serve(routeFunction, options) {
|
|
|
26549
26555
|
return;
|
|
26550
26556
|
}
|
|
26551
26557
|
let requestBody;
|
|
26552
|
-
if (request_
|
|
26558
|
+
if (isEmptyRequest(request_)) {
|
|
26559
|
+
requestBody = "";
|
|
26560
|
+
} else if (request_.headers["content-type"]?.includes("text/plain")) {
|
|
26553
26561
|
requestBody = request_.body;
|
|
26554
26562
|
} else if (request_.headers["content-type"]?.includes("application/json")) {
|
|
26555
26563
|
requestBody = JSON.stringify(request_.body);
|
package/express.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__require,
|
|
5
5
|
__toESM,
|
|
6
6
|
serveBase
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-U6XFLG7W.mjs";
|
|
8
8
|
|
|
9
9
|
// node_modules/depd/index.js
|
|
10
10
|
var require_depd = __commonJS({
|
|
@@ -23667,6 +23667,9 @@ var require_express2 = __commonJS({
|
|
|
23667
23667
|
|
|
23668
23668
|
// platforms/express.ts
|
|
23669
23669
|
var import_express = __toESM(require_express2());
|
|
23670
|
+
var isEmptyRequest = (req) => {
|
|
23671
|
+
return req.headers["content-type"] === "application/json" && req.headers["content-length"] === "0";
|
|
23672
|
+
};
|
|
23670
23673
|
function serve(routeFunction, options) {
|
|
23671
23674
|
const router = (0, import_express.Router)();
|
|
23672
23675
|
const handler = async (request_, res) => {
|
|
@@ -23675,7 +23678,9 @@ function serve(routeFunction, options) {
|
|
|
23675
23678
|
return;
|
|
23676
23679
|
}
|
|
23677
23680
|
let requestBody;
|
|
23678
|
-
if (request_
|
|
23681
|
+
if (isEmptyRequest(request_)) {
|
|
23682
|
+
requestBody = "";
|
|
23683
|
+
} else if (request_.headers["content-type"]?.includes("text/plain")) {
|
|
23679
23684
|
requestBody = request_.body;
|
|
23680
23685
|
} else if (request_.headers["content-type"]?.includes("application/json")) {
|
|
23681
23686
|
requestBody = JSON.stringify(request_.body);
|
package/h3.js
CHANGED
|
@@ -1071,6 +1071,9 @@ var triggerFirstInvocation = async ({
|
|
|
1071
1071
|
retries: workflowContext.retries,
|
|
1072
1072
|
telemetry
|
|
1073
1073
|
});
|
|
1074
|
+
if (workflowContext.headers.get("content-type")) {
|
|
1075
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
1076
|
+
}
|
|
1074
1077
|
if (useJSONContent) {
|
|
1075
1078
|
headers["content-type"] = "application/json";
|
|
1076
1079
|
}
|
package/h3.mjs
CHANGED
package/hono.js
CHANGED
|
@@ -759,6 +759,9 @@ var triggerFirstInvocation = async ({
|
|
|
759
759
|
retries: workflowContext.retries,
|
|
760
760
|
telemetry
|
|
761
761
|
});
|
|
762
|
+
if (workflowContext.headers.get("content-type")) {
|
|
763
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
764
|
+
}
|
|
762
765
|
if (useJSONContent) {
|
|
763
766
|
headers["content-type"] = "application/json";
|
|
764
767
|
}
|
package/hono.mjs
CHANGED
package/index.js
CHANGED
|
@@ -772,6 +772,9 @@ var triggerFirstInvocation = async ({
|
|
|
772
772
|
retries: workflowContext.retries,
|
|
773
773
|
telemetry
|
|
774
774
|
});
|
|
775
|
+
if (workflowContext.headers.get("content-type")) {
|
|
776
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
777
|
+
}
|
|
775
778
|
if (useJSONContent) {
|
|
776
779
|
headers["content-type"] = "application/json";
|
|
777
780
|
}
|
package/index.mjs
CHANGED
package/nextjs.js
CHANGED
|
@@ -760,6 +760,9 @@ var triggerFirstInvocation = async ({
|
|
|
760
760
|
retries: workflowContext.retries,
|
|
761
761
|
telemetry
|
|
762
762
|
});
|
|
763
|
+
if (workflowContext.headers.get("content-type")) {
|
|
764
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
765
|
+
}
|
|
763
766
|
if (useJSONContent) {
|
|
764
767
|
headers["content-type"] = "application/json";
|
|
765
768
|
}
|
package/nextjs.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/workflow","version":"v0.2.
|
|
1
|
+
{"name":"@upstash/workflow","version":"v0.2.7","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","tsup":"^8.3.0","typescript":"^5.7.2","typescript-eslint":"^8.18.0"},"dependencies":{"@ai-sdk/openai":"^1.0.15","@upstash/qstash":"^2.7.20","ai":"^4.0.30","zod":"^3.24.1"},"directories":{"example":"examples"}}
|
package/solidjs.js
CHANGED
|
@@ -759,6 +759,9 @@ var triggerFirstInvocation = async ({
|
|
|
759
759
|
retries: workflowContext.retries,
|
|
760
760
|
telemetry
|
|
761
761
|
});
|
|
762
|
+
if (workflowContext.headers.get("content-type")) {
|
|
763
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
764
|
+
}
|
|
762
765
|
if (useJSONContent) {
|
|
763
766
|
headers["content-type"] = "application/json";
|
|
764
767
|
}
|
package/solidjs.mjs
CHANGED
package/svelte.js
CHANGED
|
@@ -759,6 +759,9 @@ var triggerFirstInvocation = async ({
|
|
|
759
759
|
retries: workflowContext.retries,
|
|
760
760
|
telemetry
|
|
761
761
|
});
|
|
762
|
+
if (workflowContext.headers.get("content-type")) {
|
|
763
|
+
headers["content-type"] = workflowContext.headers.get("content-type");
|
|
764
|
+
}
|
|
762
765
|
if (useJSONContent) {
|
|
763
766
|
headers["content-type"] = "application/json";
|
|
764
767
|
}
|