@upstash/qstash 2.6.4-workflow-alpha.4 → 2.6.5

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/index.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkF6QRAN74js = require('./chunk-F6QRAN74.js');
6
5
 
7
6
 
8
7
 
@@ -13,12 +12,13 @@ var _chunkF6QRAN74js = require('./chunk-F6QRAN74.js');
13
12
 
14
13
 
15
14
 
15
+ var _chunkMZSHBRF6js = require('./chunk-MZSHBRF6.js');
16
16
 
17
17
 
18
18
 
19
+ var _chunkUUR7N6E6js = require('./chunk-UUR7N6E6.js');
19
20
 
20
21
 
21
- var _chunk5DADTJQLjs = require('./chunk-5DADTJQL.js');
22
22
 
23
23
 
24
24
 
@@ -33,8 +33,4 @@ var _chunk5DADTJQLjs = require('./chunk-5DADTJQL.js');
33
33
 
34
34
 
35
35
 
36
-
37
-
38
-
39
-
40
- exports.Chat = _chunk5DADTJQLjs.Chat; exports.Client = _chunk5DADTJQLjs.Client; exports.Messages = _chunk5DADTJQLjs.Messages; exports.QstashChatRatelimitError = _chunk5DADTJQLjs.QstashChatRatelimitError; exports.QstashDailyRatelimitError = _chunk5DADTJQLjs.QstashDailyRatelimitError; exports.QstashError = _chunk5DADTJQLjs.QstashError; exports.QstashRatelimitError = _chunk5DADTJQLjs.QstashRatelimitError; exports.QstashWorkflowAbort = _chunk5DADTJQLjs.QstashWorkflowAbort; exports.QstashWorkflowError = _chunk5DADTJQLjs.QstashWorkflowError; exports.Receiver = _chunk5DADTJQLjs.Receiver; exports.Schedules = _chunk5DADTJQLjs.Schedules; exports.SignatureError = _chunk5DADTJQLjs.SignatureError; exports.UrlGroups = _chunk5DADTJQLjs.UrlGroups; exports.custom = _chunkF6QRAN74js.custom; exports.formatWorkflowError = _chunk5DADTJQLjs.formatWorkflowError; exports.openai = _chunkF6QRAN74js.openai; exports.upstash = _chunkF6QRAN74js.upstash;
36
+ exports.Chat = _chunkMZSHBRF6js.Chat; exports.Client = _chunkMZSHBRF6js.Client; exports.Messages = _chunkMZSHBRF6js.Messages; exports.QstashChatRatelimitError = _chunkMZSHBRF6js.QstashChatRatelimitError; exports.QstashDailyRatelimitError = _chunkMZSHBRF6js.QstashDailyRatelimitError; exports.QstashError = _chunkMZSHBRF6js.QstashError; exports.QstashRatelimitError = _chunkMZSHBRF6js.QstashRatelimitError; exports.Receiver = _chunkUUR7N6E6js.Receiver; exports.Schedules = _chunkMZSHBRF6js.Schedules; exports.SignatureError = _chunkUUR7N6E6js.SignatureError; exports.UrlGroups = _chunkMZSHBRF6js.UrlGroups; exports.custom = _chunkMZSHBRF6js.custom; exports.openai = _chunkMZSHBRF6js.openai; exports.setupAnalytics = _chunkMZSHBRF6js.setupAnalytics; exports.upstash = _chunkMZSHBRF6js.upstash;
package/index.mjs CHANGED
@@ -1,8 +1,3 @@
1
- import {
2
- custom,
3
- openai,
4
- upstash
5
- } from "./chunk-TAUBWUPA.mjs";
6
1
  import {
7
2
  Chat,
8
3
  Client,
@@ -11,14 +6,17 @@ import {
11
6
  QstashDailyRatelimitError,
12
7
  QstashError,
13
8
  QstashRatelimitError,
14
- QstashWorkflowAbort,
15
- QstashWorkflowError,
16
- Receiver,
17
9
  Schedules,
18
- SignatureError,
19
10
  UrlGroups,
20
- formatWorkflowError
21
- } from "./chunk-YN3OQUF3.mjs";
11
+ custom,
12
+ openai,
13
+ setupAnalytics,
14
+ upstash
15
+ } from "./chunk-6HSNQRF3.mjs";
16
+ import {
17
+ Receiver,
18
+ SignatureError
19
+ } from "./chunk-CP4IU45K.mjs";
22
20
  export {
23
21
  Chat,
24
22
  Client,
@@ -27,14 +25,12 @@ export {
27
25
  QstashDailyRatelimitError,
28
26
  QstashError,
29
27
  QstashRatelimitError,
30
- QstashWorkflowAbort,
31
- QstashWorkflowError,
32
28
  Receiver,
33
29
  Schedules,
34
30
  SignatureError,
35
31
  UrlGroups,
36
32
  custom,
37
- formatWorkflowError,
38
33
  openai,
34
+ setupAnalytics,
39
35
  upstash
40
36
  };
package/nextjs.d.mts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { NextApiHandler } from 'next';
2
2
  import { NextRequest, NextFetchEvent, NextResponse } from 'next/server';
3
- import { $ as WorkflowServeParameters } from './client-Dgh4hlfZ.mjs';
4
- import 'neverthrow';
5
3
 
6
4
  type VerifySignatureConfig = {
7
5
  currentSigningKey?: string;
@@ -23,6 +21,5 @@ declare function verifySignature(handler: NextApiHandler, config?: VerifySignatu
23
21
  declare function verifySignatureEdge(handler: (request: NextRequest, nfe?: NextFetchEvent) => NextResponse | Promise<NextResponse>, config?: VerifySignatureConfig): (request: NextRequest, nfe: NextFetchEvent) => Promise<NextResponse<unknown>>;
24
22
  type VerifySignatureAppRouterResponse = NextResponse | Promise<NextResponse> | Response | Promise<Response>;
25
23
  declare function verifySignatureAppRouter(handler: ((request: Request) => VerifySignatureAppRouterResponse) | ((request: NextRequest) => VerifySignatureAppRouterResponse), config?: VerifySignatureConfig): (request: NextRequest | Request) => Promise<Response>;
26
- declare const serve: <TInitialPayload = unknown>({ routeFunction, options, }: WorkflowServeParameters<TInitialPayload, NextResponse, "onStepFinish">) => ((request: NextRequest) => Promise<NextResponse>);
27
24
 
28
- export { type VerifySignatureConfig, serve, verifySignature, verifySignatureAppRouter, verifySignatureEdge };
25
+ export { type VerifySignatureConfig, verifySignature, verifySignatureAppRouter, verifySignatureEdge };
package/nextjs.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { NextApiHandler } from 'next';
2
2
  import { NextRequest, NextFetchEvent, NextResponse } from 'next/server';
3
- import { $ as WorkflowServeParameters } from './client-Dgh4hlfZ.js';
4
- import 'neverthrow';
5
3
 
6
4
  type VerifySignatureConfig = {
7
5
  currentSigningKey?: string;
@@ -23,6 +21,5 @@ declare function verifySignature(handler: NextApiHandler, config?: VerifySignatu
23
21
  declare function verifySignatureEdge(handler: (request: NextRequest, nfe?: NextFetchEvent) => NextResponse | Promise<NextResponse>, config?: VerifySignatureConfig): (request: NextRequest, nfe: NextFetchEvent) => Promise<NextResponse<unknown>>;
24
22
  type VerifySignatureAppRouterResponse = NextResponse | Promise<NextResponse> | Response | Promise<Response>;
25
23
  declare function verifySignatureAppRouter(handler: ((request: Request) => VerifySignatureAppRouterResponse) | ((request: NextRequest) => VerifySignatureAppRouterResponse), config?: VerifySignatureConfig): (request: NextRequest | Request) => Promise<Response>;
26
- declare const serve: <TInitialPayload = unknown>({ routeFunction, options, }: WorkflowServeParameters<TInitialPayload, NextResponse, "onStepFinish">) => ((request: NextRequest) => Promise<NextResponse>);
27
24
 
28
- export { type VerifySignatureConfig, serve, verifySignature, verifySignatureAppRouter, verifySignatureEdge };
25
+ export { type VerifySignatureConfig, verifySignature, verifySignatureAppRouter, verifySignatureEdge };
package/nextjs.js CHANGED
@@ -1,8 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
-
4
-
5
- var _chunk5DADTJQLjs = require('./chunk-5DADTJQL.js');
3
+ var _chunkUUR7N6E6js = require('./chunk-UUR7N6E6.js');
6
4
 
7
5
  // platforms/nextjs.ts
8
6
  var _server = require('next/server');
@@ -20,7 +18,7 @@ function verifySignature(handler, config) {
20
18
  "nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
21
19
  );
22
20
  }
23
- const receiver = new (0, _chunk5DADTJQLjs.Receiver)({
21
+ const receiver = new (0, _chunkUUR7N6E6js.Receiver)({
24
22
  currentSigningKey,
25
23
  nextSigningKey
26
24
  });
@@ -72,7 +70,7 @@ function verifySignatureEdge(handler, config) {
72
70
  "nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
73
71
  );
74
72
  }
75
- const receiver = new (0, _chunk5DADTJQLjs.Receiver)({
73
+ const receiver = new (0, _chunkUUR7N6E6js.Receiver)({
76
74
  currentSigningKey,
77
75
  nextSigningKey
78
76
  });
@@ -112,7 +110,7 @@ function verifySignatureAppRouter(handler, config) {
112
110
  "nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
113
111
  );
114
112
  }
115
- const receiver = new (0, _chunk5DADTJQLjs.Receiver)({
113
+ const receiver = new (0, _chunkUUR7N6E6js.Receiver)({
116
114
  currentSigningKey,
117
115
  nextSigningKey
118
116
  });
@@ -139,30 +137,8 @@ function verifySignatureAppRouter(handler, config) {
139
137
  return handler(request);
140
138
  };
141
139
  }
142
- var serve2 = ({
143
- routeFunction,
144
- options
145
- }) => {
146
- const handler = _chunk5DADTJQLjs.serve.call(void 0, {
147
- routeFunction,
148
- options: {
149
- onStepFinish: (workflowRunId) => new (0, _server.NextResponse)(JSON.stringify({ workflowRunId }), { status: 200 }),
150
- ...options
151
- }
152
- });
153
- return async (request) => {
154
- try {
155
- return await handler(request);
156
- } catch (error) {
157
- return new (0, _server.NextResponse)(JSON.stringify(_chunk5DADTJQLjs.formatWorkflowError.call(void 0, error)), {
158
- status: 500
159
- });
160
- }
161
- };
162
- };
163
-
164
140
 
165
141
 
166
142
 
167
143
 
168
- exports.serve = serve2; exports.verifySignature = verifySignature; exports.verifySignatureAppRouter = verifySignatureAppRouter; exports.verifySignatureEdge = verifySignatureEdge;
144
+ exports.verifySignature = verifySignature; exports.verifySignatureAppRouter = verifySignatureAppRouter; exports.verifySignatureEdge = verifySignatureEdge;
package/nextjs.mjs CHANGED
@@ -1,8 +1,6 @@
1
1
  import {
2
- Receiver,
3
- formatWorkflowError,
4
- serve
5
- } from "./chunk-YN3OQUF3.mjs";
2
+ Receiver
3
+ } from "./chunk-CP4IU45K.mjs";
6
4
 
7
5
  // platforms/nextjs.ts
8
6
  import { NextResponse } from "next/server";
@@ -139,29 +137,7 @@ function verifySignatureAppRouter(handler, config) {
139
137
  return handler(request);
140
138
  };
141
139
  }
142
- var serve2 = ({
143
- routeFunction,
144
- options
145
- }) => {
146
- const handler = serve({
147
- routeFunction,
148
- options: {
149
- onStepFinish: (workflowRunId) => new NextResponse(JSON.stringify({ workflowRunId }), { status: 200 }),
150
- ...options
151
- }
152
- });
153
- return async (request) => {
154
- try {
155
- return await handler(request);
156
- } catch (error) {
157
- return new NextResponse(JSON.stringify(formatWorkflowError(error)), {
158
- status: 500
159
- });
160
- }
161
- };
162
- };
163
140
  export {
164
- serve2 as serve,
165
141
  verifySignature,
166
142
  verifySignatureAppRouter,
167
143
  verifySignatureEdge
package/nuxt.d.mts CHANGED
@@ -1,7 +1,5 @@
1
1
  import * as h3 from 'h3';
2
2
  import { H3Event } from 'h3';
3
- import { $ as WorkflowServeParameters } from './client-Dgh4hlfZ.mjs';
4
- import 'neverthrow';
5
3
 
6
4
  type VerifySignatureConfig = {
7
5
  currentSigningKey?: string;
@@ -9,9 +7,5 @@ type VerifySignatureConfig = {
9
7
  clockTolerance?: number;
10
8
  };
11
9
  declare const verifySignatureNuxt: (handler: (event: H3Event) => Promise<unknown>, config?: VerifySignatureConfig) => h3.EventHandler<h3.EventHandlerRequest, Promise<unknown>>;
12
- declare const serve: <TInitialPayload = unknown>({ routeFunction, options, }: WorkflowServeParameters<TInitialPayload, Response, "onStepFinish">) => h3.EventHandler<h3.EventHandlerRequest, Promise<Response | {
13
- status: number;
14
- body: string;
15
- }>>;
16
10
 
17
- export { serve, verifySignatureNuxt };
11
+ export { verifySignatureNuxt };
package/nuxt.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import * as h3 from 'h3';
2
2
  import { H3Event } from 'h3';
3
- import { $ as WorkflowServeParameters } from './client-Dgh4hlfZ.js';
4
- import 'neverthrow';
5
3
 
6
4
  type VerifySignatureConfig = {
7
5
  currentSigningKey?: string;
@@ -9,9 +7,5 @@ type VerifySignatureConfig = {
9
7
  clockTolerance?: number;
10
8
  };
11
9
  declare const verifySignatureNuxt: (handler: (event: H3Event) => Promise<unknown>, config?: VerifySignatureConfig) => h3.EventHandler<h3.EventHandlerRequest, Promise<unknown>>;
12
- declare const serve: <TInitialPayload = unknown>({ routeFunction, options, }: WorkflowServeParameters<TInitialPayload, Response, "onStepFinish">) => h3.EventHandler<h3.EventHandlerRequest, Promise<Response | {
13
- status: number;
14
- body: string;
15
- }>>;
16
10
 
17
- export { serve, verifySignatureNuxt };
11
+ export { verifySignatureNuxt };
package/nuxt.js CHANGED
@@ -1,9 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-F6QRAN74.js');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-MZSHBRF6.js');
2
2
 
3
3
 
4
-
5
-
6
- var _chunk5DADTJQLjs = require('./chunk-5DADTJQL.js');
4
+ var _chunkUUR7N6E6js = require('./chunk-UUR7N6E6.js');
7
5
 
8
6
  // platforms/nuxt.ts
9
7
  var _h3 = require('h3');
@@ -20,7 +18,7 @@ var verifySignatureNuxt = (handler, config) => {
20
18
  "nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
21
19
  );
22
20
  }
23
- const receiver = new (0, _chunk5DADTJQLjs.Receiver)({
21
+ const receiver = new (0, _chunkUUR7N6E6js.Receiver)({
24
22
  currentSigningKey,
25
23
  nextSigningKey
26
24
  });
@@ -45,48 +43,6 @@ var verifySignatureNuxt = (handler, config) => {
45
43
  return handler(event);
46
44
  });
47
45
  };
48
- function transformHeaders(headers) {
49
- const formattedHeaders = Object.entries(headers).map(([key, value]) => [
50
- key,
51
- Array.isArray(value) ? value.join(", ") : _nullishCoalesce(value, () => ( ""))
52
- ]);
53
- return formattedHeaders;
54
- }
55
- var serve2 = ({
56
- routeFunction,
57
- options
58
- }) => {
59
- const handler = _h3.defineEventHandler.call(void 0, async (event) => {
60
- const method = event.node.req.method;
61
- if (_optionalChain([method, 'optionalAccess', _4 => _4.toUpperCase, 'call', _5 => _5()]) !== "POST") {
62
- return {
63
- status: 405,
64
- body: "Only POST requests are allowed in worklfows"
65
- };
66
- }
67
- const request_ = event.node.req;
68
- const protocol = request_.headers["x-forwarded-proto"];
69
- const host = request_.headers.host;
70
- const url = `${protocol}://${host}${event.path}`;
71
- const headers = transformHeaders(request_.headers);
72
- const request = new Request(url, {
73
- headers,
74
- body: await _h3.readRawBody.call(void 0, event),
75
- method: "POST"
76
- });
77
- const serveHandler = _chunk5DADTJQLjs.serve.call(void 0, {
78
- routeFunction,
79
- options
80
- });
81
- try {
82
- return await serveHandler(request);
83
- } catch (error) {
84
- return new Response(JSON.stringify(_chunk5DADTJQLjs.formatWorkflowError.call(void 0, error)), { status: 500 });
85
- }
86
- });
87
- return handler;
88
- };
89
-
90
46
 
91
47
 
92
- exports.serve = serve2; exports.verifySignatureNuxt = verifySignatureNuxt;
48
+ exports.verifySignatureNuxt = verifySignatureNuxt;
package/nuxt.mjs CHANGED
@@ -1,9 +1,7 @@
1
- import "./chunk-TAUBWUPA.mjs";
1
+ import "./chunk-6HSNQRF3.mjs";
2
2
  import {
3
- Receiver,
4
- formatWorkflowError,
5
- serve
6
- } from "./chunk-YN3OQUF3.mjs";
3
+ Receiver
4
+ } from "./chunk-CP4IU45K.mjs";
7
5
 
8
6
  // platforms/nuxt.ts
9
7
  import { defineEventHandler, getHeader, readRawBody } from "h3";
@@ -45,48 +43,6 @@ var verifySignatureNuxt = (handler, config) => {
45
43
  return handler(event);
46
44
  });
47
45
  };
48
- function transformHeaders(headers) {
49
- const formattedHeaders = Object.entries(headers).map(([key, value]) => [
50
- key,
51
- Array.isArray(value) ? value.join(", ") : value ?? ""
52
- ]);
53
- return formattedHeaders;
54
- }
55
- var serve2 = ({
56
- routeFunction,
57
- options
58
- }) => {
59
- const handler = defineEventHandler(async (event) => {
60
- const method = event.node.req.method;
61
- if (method?.toUpperCase() !== "POST") {
62
- return {
63
- status: 405,
64
- body: "Only POST requests are allowed in worklfows"
65
- };
66
- }
67
- const request_ = event.node.req;
68
- const protocol = request_.headers["x-forwarded-proto"];
69
- const host = request_.headers.host;
70
- const url = `${protocol}://${host}${event.path}`;
71
- const headers = transformHeaders(request_.headers);
72
- const request = new Request(url, {
73
- headers,
74
- body: await readRawBody(event),
75
- method: "POST"
76
- });
77
- const serveHandler = serve({
78
- routeFunction,
79
- options
80
- });
81
- try {
82
- return await serveHandler(request);
83
- } catch (error) {
84
- return new Response(JSON.stringify(formatWorkflowError(error)), { status: 500 });
85
- }
86
- });
87
- return handler;
88
- };
89
46
  export {
90
- serve2 as serve,
91
47
  verifySignatureNuxt
92
48
  };
package/package.json CHANGED
@@ -1 +1 @@
1
- {"version":"v2.6.4-workflow-alpha.4","name":"@upstash/qstash","description":"Official Typescript client for QStash","author":"Andreas Thomas <dev@chronark.com>","license":"MIT","homepage":"https://github.com/upstash/sdk-qstash-ts#readme","repository":{"type":"git","url":"git+https://github.com/upstash/sdk-qstash-ts.git"},"bugs":{"url":"https://github.com/upstash/sdk-qstash-ts/issues"},"main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./**"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./nextjs":{"types":"./nextjs.d.ts","import":"./nextjs.mjs","require":"./nextjs.js"},"./dist/nextjs":{"types":"./nextjs.d.ts","import":"./nextjs.mjs","require":"./nextjs.js"},"./nuxt":{"types":"./nuxt.d.ts","import":"./nuxt.mjs","require":"./nuxt.js"},"./svelte":{"types":"./svelte.d.ts","import":"./svelte.mjs","require":"./svelte.js"},"./solidjs":{"types":"./solidjs.d.ts","import":"./solidjs.mjs","require":"./solidjs.js"},"./workflow":{"types":"./workflow.d.ts","import":"./workflow.mjs","require":"./workflow.js"}},"typesVersions":{"*":{"nextjs":["./nextjs.d.ts"]}},"keywords":["qstash","queue","events","serverless","upstash"],"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test","fmt":"prettier --write .","lint":"tsc && eslint \"src/**/*.{js,ts,tsx}\" --quiet --fix"},"devDependencies":{"@commitlint/cli":"^19.2.2","@commitlint/config-conventional":"^19.2.2","@types/bun":"^1.1.1","@types/crypto-js":"^4.2.0","@typescript-eslint/eslint-plugin":"^7.0.1","@typescript-eslint/parser":"^7.0.1","ai":"^3.1.28","bun-types":"^1.1.7","eslint":"^8","eslint-plugin-unicorn":"^51.0.1","husky":"^9.0.10","neverthrow":"^7.0.0","next":"^14.0.2","prettier":"^3.2.5","tsup":"latest","typescript":"^5.4.5","undici-types":"^6.16.0","vitest":"latest"},"dependencies":{"@solidjs/start":"^1.0.6","@sveltejs/kit":"^2.5.18","crypto-js":">=4.2.0","h3":"^1.12.0","jose":"^ 5.2.3"}}
1
+ {"version":"v2.6.5","name":"@upstash/qstash","description":"Official Typescript client for QStash","author":"Andreas Thomas <dev@chronark.com>","license":"MIT","homepage":"https://github.com/upstash/sdk-qstash-ts#readme","repository":{"type":"git","url":"git+https://github.com/upstash/sdk-qstash-ts.git"},"bugs":{"url":"https://github.com/upstash/sdk-qstash-ts/issues"},"main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./**"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./nextjs":{"import":"./nextjs.js","require":"./nextjs.js"},"./dist/nextjs":{"import":"./nextjs.js","require":"./nextjs.js"},"./nuxt":{"types":"./nuxt.d.ts","import":"./nuxt.mjs","require":"./nuxt.js"},"./svelte":{"types":"./svelte.d.ts","import":"./svelte.mjs","require":"./svelte.js"},"./solidjs":{"types":"./solidjs.d.ts","import":"./solidjs.mjs","require":"./solidjs.js"}},"typesVersions":{"*":{"nextjs":["./nextjs.d.ts"]}},"keywords":["qstash","queue","events","serverless","upstash"],"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test","fmt":"prettier --write .","lint":"tsc && eslint \"src/**/*.{js,ts,tsx}\" --quiet --fix"},"devDependencies":{"@commitlint/cli":"^19.2.2","@commitlint/config-conventional":"^19.2.2","@types/bun":"^1.1.1","@types/crypto-js":"^4.2.0","@typescript-eslint/eslint-plugin":"^7.0.1","@typescript-eslint/parser":"^7.0.1","ai":"^3.1.28","bun-types":"^1.1.7","eslint":"^8","eslint-plugin-unicorn":"^51.0.1","husky":"^9.0.10","next":"^14.0.2","prettier":"^3.2.5","tsup":"latest","typescript":"^5.4.5","undici-types":"^6.16.0","vitest":"latest"},"dependencies":{"@solidjs/start":"^1.0.6","@sveltejs/kit":"^2.5.18","crypto-js":">=4.2.0","h3":"^1.12.0","jose":"^ 5.2.3"}}
package/solidjs.d.mts CHANGED
@@ -1,6 +1,4 @@
1
- import { APIHandler, APIEvent } from '@solidjs/start/server';
2
- import { $ as WorkflowServeParameters } from './client-Dgh4hlfZ.mjs';
3
- import 'neverthrow';
1
+ import { APIHandler } from '@solidjs/start/server';
4
2
 
5
3
  type VerifySignatureConfig = {
6
4
  currentSigningKey?: string;
@@ -8,6 +6,5 @@ type VerifySignatureConfig = {
8
6
  clockTolerance?: number;
9
7
  };
10
8
  declare const verifySignatureSolidjs: (handler: APIHandler, config?: VerifySignatureConfig) => APIHandler;
11
- declare const serve: <TInitialPayload = unknown>({ routeFunction, options, }: WorkflowServeParameters<TInitialPayload, Response, "onStepFinish">) => (event: APIEvent) => Promise<Response>;
12
9
 
13
- export { serve, verifySignatureSolidjs };
10
+ export { verifySignatureSolidjs };
package/solidjs.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- import { APIHandler, APIEvent } from '@solidjs/start/server';
2
- import { $ as WorkflowServeParameters } from './client-Dgh4hlfZ.js';
3
- import 'neverthrow';
1
+ import { APIHandler } from '@solidjs/start/server';
4
2
 
5
3
  type VerifySignatureConfig = {
6
4
  currentSigningKey?: string;
@@ -8,6 +6,5 @@ type VerifySignatureConfig = {
8
6
  clockTolerance?: number;
9
7
  };
10
8
  declare const verifySignatureSolidjs: (handler: APIHandler, config?: VerifySignatureConfig) => APIHandler;
11
- declare const serve: <TInitialPayload = unknown>({ routeFunction, options, }: WorkflowServeParameters<TInitialPayload, Response, "onStepFinish">) => (event: APIEvent) => Promise<Response>;
12
9
 
13
- export { serve, verifySignatureSolidjs };
10
+ export { verifySignatureSolidjs };
package/solidjs.js CHANGED
@@ -1,9 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-F6QRAN74.js');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-MZSHBRF6.js');
2
2
 
3
3
 
4
-
5
-
6
- var _chunk5DADTJQLjs = require('./chunk-5DADTJQL.js');
4
+ var _chunkUUR7N6E6js = require('./chunk-UUR7N6E6.js');
7
5
 
8
6
  // platforms/solidjs.ts
9
7
  var verifySignatureSolidjs = (handler, config) => {
@@ -15,7 +13,7 @@ var verifySignatureSolidjs = (handler, config) => {
15
13
  if (!nextSigningKey) {
16
14
  throw new Error("nextSigningKey is required, either in the config or from the env");
17
15
  }
18
- const receiver = new (0, _chunk5DADTJQLjs.Receiver)({
16
+ const receiver = new (0, _chunkUUR7N6E6js.Receiver)({
19
17
  currentSigningKey,
20
18
  nextSigningKey
21
19
  });
@@ -40,29 +38,6 @@ var verifySignatureSolidjs = (handler, config) => {
40
38
  return handler(event);
41
39
  };
42
40
  };
43
- var serve2 = ({
44
- routeFunction,
45
- options
46
- }) => {
47
- const handler = async (event) => {
48
- const method = event.request.method;
49
- if (method.toUpperCase() !== "POST") {
50
- return new Response("Only POST requests are allowed in worklfows", { status: 405 });
51
- }
52
- const serveHandler = _chunk5DADTJQLjs.serve.call(void 0, {
53
- routeFunction,
54
- options
55
- });
56
- try {
57
- const result = await serveHandler(event.request);
58
- return result;
59
- } catch (error) {
60
- return new Response(JSON.stringify(_chunk5DADTJQLjs.formatWorkflowError.call(void 0, error)), { status: 500 });
61
- }
62
- };
63
- return handler;
64
- };
65
-
66
41
 
67
42
 
68
- exports.serve = serve2; exports.verifySignatureSolidjs = verifySignatureSolidjs;
43
+ exports.verifySignatureSolidjs = verifySignatureSolidjs;
package/solidjs.mjs CHANGED
@@ -1,9 +1,7 @@
1
- import "./chunk-TAUBWUPA.mjs";
1
+ import "./chunk-6HSNQRF3.mjs";
2
2
  import {
3
- Receiver,
4
- formatWorkflowError,
5
- serve
6
- } from "./chunk-YN3OQUF3.mjs";
3
+ Receiver
4
+ } from "./chunk-CP4IU45K.mjs";
7
5
 
8
6
  // platforms/solidjs.ts
9
7
  var verifySignatureSolidjs = (handler, config) => {
@@ -40,29 +38,6 @@ var verifySignatureSolidjs = (handler, config) => {
40
38
  return handler(event);
41
39
  };
42
40
  };
43
- var serve2 = ({
44
- routeFunction,
45
- options
46
- }) => {
47
- const handler = async (event) => {
48
- const method = event.request.method;
49
- if (method.toUpperCase() !== "POST") {
50
- return new Response("Only POST requests are allowed in worklfows", { status: 405 });
51
- }
52
- const serveHandler = serve({
53
- routeFunction,
54
- options
55
- });
56
- try {
57
- const result = await serveHandler(event.request);
58
- return result;
59
- } catch (error) {
60
- return new Response(JSON.stringify(formatWorkflowError(error)), { status: 500 });
61
- }
62
- };
63
- return handler;
64
- };
65
41
  export {
66
- serve2 as serve,
67
42
  verifySignatureSolidjs
68
43
  };
package/svelte.d.mts CHANGED
@@ -1,6 +1,4 @@
1
1
  import { RequestHandler } from '@sveltejs/kit';
2
- import { a0 as WorkflowServeParametersExtended } from './client-Dgh4hlfZ.mjs';
3
- import 'neverthrow';
4
2
 
5
3
  type VerifySignatureConfig = {
6
4
  currentSigningKey: string;
@@ -8,6 +6,5 @@ type VerifySignatureConfig = {
8
6
  clockTolerance?: number;
9
7
  };
10
8
  declare const verifySignatureSvelte: <Parameters extends Partial<Record<string, string>> = Partial<Record<string, string>>, RouteId extends string | null = string | null>(handler: RequestHandler<Parameters, RouteId>, config: VerifySignatureConfig) => RequestHandler<Parameters, RouteId>;
11
- declare const serve: <TInitialPayload = unknown>({ routeFunction, options, receiver, qstashClient, }: WorkflowServeParametersExtended<TInitialPayload, Response, "onStepFinish">) => RequestHandler;
12
9
 
13
- export { serve, verifySignatureSvelte };
10
+ export { verifySignatureSvelte };
package/svelte.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import { RequestHandler } from '@sveltejs/kit';
2
- import { a0 as WorkflowServeParametersExtended } from './client-Dgh4hlfZ.js';
3
- import 'neverthrow';
4
2
 
5
3
  type VerifySignatureConfig = {
6
4
  currentSigningKey: string;
@@ -8,6 +6,5 @@ type VerifySignatureConfig = {
8
6
  clockTolerance?: number;
9
7
  };
10
8
  declare const verifySignatureSvelte: <Parameters extends Partial<Record<string, string>> = Partial<Record<string, string>>, RouteId extends string | null = string | null>(handler: RequestHandler<Parameters, RouteId>, config: VerifySignatureConfig) => RequestHandler<Parameters, RouteId>;
11
- declare const serve: <TInitialPayload = unknown>({ routeFunction, options, receiver, qstashClient, }: WorkflowServeParametersExtended<TInitialPayload, Response, "onStepFinish">) => RequestHandler;
12
9
 
13
- export { serve, verifySignatureSvelte };
10
+ export { verifySignatureSvelte };
package/svelte.js CHANGED
@@ -1,9 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-F6QRAN74.js');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-MZSHBRF6.js');
2
2
 
3
3
 
4
-
5
-
6
- var _chunk5DADTJQLjs = require('./chunk-5DADTJQL.js');
4
+ var _chunkUUR7N6E6js = require('./chunk-UUR7N6E6.js');
7
5
 
8
6
  // platforms/svelte.ts
9
7
  var verifySignatureSvelte = (handler, config) => {
@@ -15,7 +13,7 @@ var verifySignatureSvelte = (handler, config) => {
15
13
  if (!nextSigningKey) {
16
14
  throw new Error("nextSigningKey is required, either in the config or from the env");
17
15
  }
18
- const receiver = new (0, _chunk5DADTJQLjs.Receiver)({
16
+ const receiver = new (0, _chunkUUR7N6E6js.Receiver)({
19
17
  currentSigningKey,
20
18
  nextSigningKey
21
19
  });
@@ -41,30 +39,6 @@ var verifySignatureSvelte = (handler, config) => {
41
39
  };
42
40
  return wrappedHandler;
43
41
  };
44
- var serve2 = ({
45
- routeFunction,
46
- options,
47
- receiver,
48
- qstashClient
49
- }) => {
50
- const handler = async ({ request }) => {
51
- const serveMethod = _chunk5DADTJQLjs.serve.call(void 0, {
52
- routeFunction,
53
- options: {
54
- qstashClient,
55
- receiver,
56
- ...options
57
- }
58
- });
59
- try {
60
- return await serveMethod(request);
61
- } catch (error) {
62
- return new Response(JSON.stringify(_chunk5DADTJQLjs.formatWorkflowError.call(void 0, error)), { status: 500 });
63
- }
64
- };
65
- return handler;
66
- };
67
-
68
42
 
69
43
 
70
- exports.serve = serve2; exports.verifySignatureSvelte = verifySignatureSvelte;
44
+ exports.verifySignatureSvelte = verifySignatureSvelte;