@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 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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase
4
- } from "./chunk-OLNSY3BB.mjs";
4
+ } from "./chunk-U6XFLG7W.mjs";
5
5
 
6
6
  // platforms/astro.ts
7
7
  function serve(routeFunction, options) {
@@ -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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase
4
- } from "./chunk-OLNSY3BB.mjs";
4
+ } from "./chunk-U6XFLG7W.mjs";
5
5
 
6
6
  // platforms/cloudflare.ts
7
7
  var getArgs = (args) => {
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_.headers["content-type"]?.includes("text/plain")) {
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-OLNSY3BB.mjs";
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_.headers["content-type"]?.includes("text/plain")) {
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase
4
- } from "./chunk-OLNSY3BB.mjs";
4
+ } from "./chunk-U6XFLG7W.mjs";
5
5
 
6
6
  // node_modules/defu/dist/defu.mjs
7
7
  function isPlainObject(value) {
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase
4
- } from "./chunk-OLNSY3BB.mjs";
4
+ } from "./chunk-U6XFLG7W.mjs";
5
5
 
6
6
  // platforms/hono.ts
7
7
  var serve = (routeFunction, options) => {
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
@@ -9,7 +9,7 @@ import {
9
9
  makeNotifyRequest,
10
10
  serve,
11
11
  triggerFirstInvocation
12
- } from "./chunk-OLNSY3BB.mjs";
12
+ } from "./chunk-U6XFLG7W.mjs";
13
13
 
14
14
  // src/client/index.ts
15
15
  import { Client as QStashClient } from "@upstash/qstash";
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase
4
- } from "./chunk-OLNSY3BB.mjs";
4
+ } from "./chunk-U6XFLG7W.mjs";
5
5
 
6
6
  // platforms/nextjs.ts
7
7
  var serve = (routeFunction, options) => {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@upstash/workflow","version":"v0.2.6","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"}}
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase
4
- } from "./chunk-OLNSY3BB.mjs";
4
+ } from "./chunk-U6XFLG7W.mjs";
5
5
 
6
6
  // platforms/solidjs.ts
7
7
  var serve = (routeFunction, options) => {
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
  }
package/svelte.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase
4
- } from "./chunk-OLNSY3BB.mjs";
4
+ } from "./chunk-U6XFLG7W.mjs";
5
5
 
6
6
  // platforms/svelte.ts
7
7
  var serve = (routeFunction, options) => {