@upstash/qstash 2.7.10 → 2.8.0-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.
Files changed (54) hide show
  1. package/{chunk-HIWMJGFU.mjs → dist/chunk-KWSSCN6R.mjs} +39 -20
  2. package/{chunk-O2RN672L.mjs → dist/chunk-XLCNEVA2.mjs} +1 -1
  3. package/{client-orcgOcAm.d.mts → dist/client-DkrYCqaq.d.mts} +26 -17
  4. package/{client-orcgOcAm.d.ts → dist/client-DkrYCqaq.d.ts} +26 -17
  5. package/{cloudflare.d.mts → dist/cloudflare.d.mts} +1 -1
  6. package/{cloudflare.d.ts → dist/cloudflare.d.ts} +1 -1
  7. package/{chunk-KZOQ64Z6.js → dist/cloudflare.js} +265 -255
  8. package/{cloudflare.mjs → dist/cloudflare.mjs} +1 -1
  9. package/{h3.d.mts → dist/h3.d.mts} +1 -1
  10. package/{h3.d.ts → dist/h3.d.ts} +1 -1
  11. package/dist/h3.js +3338 -0
  12. package/{h3.mjs → dist/h3.mjs} +2 -2
  13. package/{hono.d.mts → dist/hono.d.mts} +1 -1
  14. package/{hono.d.ts → dist/hono.d.ts} +1 -1
  15. package/dist/hono.js +2958 -0
  16. package/{hono.mjs → dist/hono.mjs} +1 -1
  17. package/{index.d.mts → dist/index.d.mts} +2 -2
  18. package/{index.d.ts → dist/index.d.ts} +2 -2
  19. package/dist/index.js +1639 -0
  20. package/{index.mjs → dist/index.mjs} +1 -1
  21. package/{nextjs.d.mts → dist/nextjs.d.mts} +1 -1
  22. package/{nextjs.d.ts → dist/nextjs.d.ts} +1 -1
  23. package/dist/nextjs.js +4742 -0
  24. package/dist/nextjs.mjs +1802 -0
  25. package/dist/nuxt.js +832 -0
  26. package/{nuxt.mjs → dist/nuxt.mjs} +2 -2
  27. package/{solidjs.d.mts → dist/solidjs.d.mts} +1 -1
  28. package/{solidjs.d.ts → dist/solidjs.d.ts} +1 -1
  29. package/dist/solidjs.js +2991 -0
  30. package/{solidjs.mjs → dist/solidjs.mjs} +1 -1
  31. package/{svelte.d.mts → dist/svelte.d.mts} +1 -1
  32. package/{svelte.d.ts → dist/svelte.d.ts} +1 -1
  33. package/dist/svelte.js +2988 -0
  34. package/{svelte.mjs → dist/svelte.mjs} +1 -1
  35. package/{workflow.d.mts → dist/workflow.d.mts} +1 -1
  36. package/{workflow.d.ts → dist/workflow.d.ts} +1 -1
  37. package/dist/workflow.js +2954 -0
  38. package/{workflow.mjs → dist/workflow.mjs} +1 -1
  39. package/package.json +1 -1
  40. package/chunk-Q6JW7JKT.js +0 -403
  41. package/chunk-VN7YQ2UN.js +0 -1
  42. package/cloudflare.js +0 -37
  43. package/h3.js +0 -10
  44. package/hono.js +0 -22
  45. package/index.js +0 -43
  46. package/nextjs.js +0 -178
  47. package/nextjs.mjs +0 -178
  48. package/nuxt.js +0 -11
  49. package/solidjs.js +0 -56
  50. package/svelte.js +0 -53
  51. package/workflow.js +0 -18
  52. /package/{chunk-CIVGPRQN.mjs → dist/chunk-CIVGPRQN.mjs} +0 -0
  53. /package/{nuxt.d.mts → dist/nuxt.d.mts} +0 -0
  54. /package/{nuxt.d.ts → dist/nuxt.d.ts} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  WorkflowLogger,
7
7
  processOptions,
8
8
  serve
9
- } from "./chunk-HIWMJGFU.mjs";
9
+ } from "./chunk-KWSSCN6R.mjs";
10
10
  export {
11
11
  DisabledWorkflowContext,
12
12
  StepTypes,
package/package.json CHANGED
@@ -1 +1 @@
1
- {"version":"v2.7.10","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"},"./h3":{"types":"./h3.d.ts","import":"./h3.mjs","require":"./h3.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"},"./hono":{"types":"./hono.d.ts","import":"./hono.mjs","require":"./hono.js"},"./cloudflare":{"types":"./cloudflare.d.ts","import":"./cloudflare.mjs","require":"./cloudflare.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 src","fmt":"prettier --write .","lint":"tsc && eslint \"src/**/*.{js,ts,tsx}\" --quiet --fix"},"devDependencies":{"@commitlint/cli":"^19.2.2","@commitlint/config-conventional":"^19.2.2","@eslint/eslintrc":"^3.1.0","@eslint/js":"^9.10.0","@solidjs/start":"^1.0.6","@sveltejs/kit":"^2.5.18","@types/bun":"^1.1.1","@types/crypto-js":"^4.2.0","@typescript-eslint/eslint-plugin":"^8.4.0","@typescript-eslint/parser":"^8.4.0","ai":"^3.1.28","bun-types":"^1.1.7","eslint":"^9.10.0","eslint-plugin-unicorn":"^51.0.1","h3":"^1.12.0","hono":"^4.5.8","husky":"^9.0.10","neverthrow":"^7.0.1","next":"^14.0.2","prettier":"^3.2.5","tsup":"latest","typescript":"^5.4.5","undici-types":"^6.16.0","vitest":"latest"},"dependencies":{"crypto-js":">=4.2.0","jose":"^5.2.3"}}
1
+ { "version": "v2.8.0-canary", "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": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "files": [ "dist" ], "exports": { ".": { "import": "./dist/index.mjs", "require": "./dist/index.js" }, "./nextjs": { "import": "./dist/nextjs.mjs", "require": "./dist/nextjs.js" }, "./dist/nextjs": { "import": "./dist/nextjs.mjs", "require": "./dist/nextjs.js" }, "./h3": { "import": "./dist/h3.mjs", "require": "./dist/h3.js" }, "./nuxt": { "import": "./dist/nuxt.mjs", "require": "./dist/nuxt.js" }, "./svelte": { "import": "./dist/svelte.mjs", "require": "./dist/svelte.js" }, "./solidjs": { "import": "./dist/solidjs.mjs", "require": "./dist/solidjs.js" }, "./workflow": { "import": "./dist/workflow.mjs", "require": "./dist/workflow.js" }, "./hono": { "import": "./dist/hono.mjs", "require": "./dist/hono.js" }, "./cloudflare": { "import": "./dist/cloudflare.mjs", "require": "./dist/cloudflare.js" } }, "keywords": [ "qstash", "queue", "events", "serverless", "upstash" ], "scripts": { "build": "tsup", "test": "bun test src", "fmt": "prettier --write .", "lint": "tsc && eslint \"src/**/*.{js,ts,tsx}\" --quiet --fix", "prepare": "husky" }, "devDependencies": { "@commitlint/cli": "^19.2.2", "@commitlint/config-conventional": "^19.2.2", "@eslint/eslintrc": "^3.1.0", "@eslint/js": "^9.10.0", "@solidjs/start": "^1.0.6", "@sveltejs/kit": "^2.5.18", "@types/bun": "^1.1.1", "@types/crypto-js": "^4.2.0", "@typescript-eslint/eslint-plugin": "^8.4.0", "@typescript-eslint/parser": "^8.4.0", "ai": "^3.1.28", "bun-types": "^1.1.7", "eslint": "^9.10.0", "eslint-plugin-unicorn": "^51.0.1", "h3": "^1.12.0", "hono": "^4.5.8", "husky": "^9.0.10", "neverthrow": "^7.0.1", "next": "^14.0.2", "prettier": "^3.2.5", "tsup": "latest", "typescript": "^5.4.5", "undici-types": "^6.16.0", "vitest": "latest" }, "dependencies": { "crypto-js": ">=4.2.0", "jose": "^5.2.3" } }
package/chunk-Q6JW7JKT.js DELETED
@@ -1,403 +0,0 @@
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
-
3
-
4
- var _chunkKZOQ64Z6js = require('./chunk-KZOQ64Z6.js');
5
-
6
- // node_modules/defu/dist/defu.mjs
7
- function isPlainObject(value) {
8
- if (value === null || typeof value !== "object") {
9
- return false;
10
- }
11
- const prototype = Object.getPrototypeOf(value);
12
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
13
- return false;
14
- }
15
- if (Symbol.iterator in value) {
16
- return false;
17
- }
18
- if (Symbol.toStringTag in value) {
19
- return Object.prototype.toString.call(value) === "[object Module]";
20
- }
21
- return true;
22
- }
23
- function _defu(baseObject, defaults, namespace = ".", merger) {
24
- if (!isPlainObject(defaults)) {
25
- return _defu(baseObject, {}, namespace, merger);
26
- }
27
- const object = Object.assign({}, defaults);
28
- for (const key in baseObject) {
29
- if (key === "__proto__" || key === "constructor") {
30
- continue;
31
- }
32
- const value = baseObject[key];
33
- if (value === null || value === void 0) {
34
- continue;
35
- }
36
- if (merger && merger(object, key, value, namespace)) {
37
- continue;
38
- }
39
- if (Array.isArray(value) && Array.isArray(object[key])) {
40
- object[key] = [...value, ...object[key]];
41
- } else if (isPlainObject(value) && isPlainObject(object[key])) {
42
- object[key] = _defu(
43
- value,
44
- object[key],
45
- (namespace ? `${namespace}.` : "") + key.toString(),
46
- merger
47
- );
48
- } else {
49
- object[key] = value;
50
- }
51
- }
52
- return object;
53
- }
54
- function createDefu(merger) {
55
- return (...arguments_) => (
56
- // eslint-disable-next-line unicorn/no-array-reduce
57
- arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
58
- );
59
- }
60
- var defu = createDefu();
61
- var defuFn = createDefu((object, key, currentValue) => {
62
- if (object[key] !== void 0 && typeof currentValue === "function") {
63
- object[key] = currentValue(object[key]);
64
- return true;
65
- }
66
- });
67
- var defuArrayFn = createDefu((object, key, currentValue) => {
68
- if (Array.isArray(object[key]) && typeof currentValue === "function") {
69
- object[key] = currentValue(object[key]);
70
- return true;
71
- }
72
- });
73
-
74
- // node_modules/h3/dist/index.mjs
75
- function hasProp(obj, prop) {
76
- try {
77
- return prop in obj;
78
- } catch (e2) {
79
- return false;
80
- }
81
- }
82
- var __defProp$2 = Object.defineProperty;
83
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
84
- var __publicField$2 = (obj, key, value) => {
85
- __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
86
- return value;
87
- };
88
- var H3Error = class extends Error {
89
- constructor(message, opts = {}) {
90
- super(message, opts);
91
- __publicField$2(this, "statusCode", 500);
92
- __publicField$2(this, "fatal", false);
93
- __publicField$2(this, "unhandled", false);
94
- __publicField$2(this, "statusMessage");
95
- __publicField$2(this, "data");
96
- __publicField$2(this, "cause");
97
- if (opts.cause && !this.cause) {
98
- this.cause = opts.cause;
99
- }
100
- }
101
- toJSON() {
102
- const obj = {
103
- message: this.message,
104
- statusCode: sanitizeStatusCode(this.statusCode, 500)
105
- };
106
- if (this.statusMessage) {
107
- obj.statusMessage = sanitizeStatusMessage(this.statusMessage);
108
- }
109
- if (this.data !== void 0) {
110
- obj.data = this.data;
111
- }
112
- return obj;
113
- }
114
- };
115
- __publicField$2(H3Error, "__h3_error__", true);
116
- function createError(input) {
117
- if (typeof input === "string") {
118
- return new H3Error(input);
119
- }
120
- if (isError(input)) {
121
- return input;
122
- }
123
- const err = new H3Error(_nullishCoalesce(_nullishCoalesce(input.message, () => ( input.statusMessage)), () => ( "")), {
124
- cause: input.cause || input
125
- });
126
- if (hasProp(input, "stack")) {
127
- try {
128
- Object.defineProperty(err, "stack", {
129
- get() {
130
- return input.stack;
131
- }
132
- });
133
- } catch (e3) {
134
- try {
135
- err.stack = input.stack;
136
- } catch (e4) {
137
- }
138
- }
139
- }
140
- if (input.data) {
141
- err.data = input.data;
142
- }
143
- if (input.statusCode) {
144
- err.statusCode = sanitizeStatusCode(input.statusCode, err.statusCode);
145
- } else if (input.status) {
146
- err.statusCode = sanitizeStatusCode(input.status, err.statusCode);
147
- }
148
- if (input.statusMessage) {
149
- err.statusMessage = input.statusMessage;
150
- } else if (input.statusText) {
151
- err.statusMessage = input.statusText;
152
- }
153
- if (err.statusMessage) {
154
- const originalMessage = err.statusMessage;
155
- const sanitizedMessage = sanitizeStatusMessage(err.statusMessage);
156
- if (sanitizedMessage !== originalMessage) {
157
- console.warn(
158
- "[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default."
159
- );
160
- }
161
- }
162
- if (input.fatal !== void 0) {
163
- err.fatal = input.fatal;
164
- }
165
- if (input.unhandled !== void 0) {
166
- err.unhandled = input.unhandled;
167
- }
168
- return err;
169
- }
170
- function isError(input) {
171
- return _optionalChain([input, 'optionalAccess', _ => _.constructor, 'optionalAccess', _2 => _2.__h3_error__]) === true;
172
- }
173
- function isMethod(event, expected, allowHead) {
174
- if (allowHead && event.method === "HEAD") {
175
- return true;
176
- }
177
- if (typeof expected === "string") {
178
- if (event.method === expected) {
179
- return true;
180
- }
181
- } else if (expected.includes(event.method)) {
182
- return true;
183
- }
184
- return false;
185
- }
186
- function assertMethod(event, expected, allowHead) {
187
- if (!isMethod(event, expected, allowHead)) {
188
- throw createError({
189
- statusCode: 405,
190
- statusMessage: "HTTP method is not allowed."
191
- });
192
- }
193
- }
194
- function getRequestHeaders(event) {
195
- const _headers = {};
196
- for (const key in event.node.req.headers) {
197
- const val = event.node.req.headers[key];
198
- _headers[key] = Array.isArray(val) ? val.filter(Boolean).join(", ") : val;
199
- }
200
- return _headers;
201
- }
202
- function getRequestHeader(event, name) {
203
- const headers = getRequestHeaders(event);
204
- const value = headers[name.toLowerCase()];
205
- return value;
206
- }
207
- var getHeader = getRequestHeader;
208
- var RawBodySymbol = Symbol.for("h3RawBody");
209
- var ParsedBodySymbol = Symbol.for("h3ParsedBody");
210
- var PayloadMethods$1 = ["PATCH", "POST", "PUT", "DELETE"];
211
- function readRawBody(event, encoding = "utf8") {
212
- assertMethod(event, PayloadMethods$1);
213
- const _rawBody = event._requestBody || _optionalChain([event, 'access', _3 => _3.web, 'optionalAccess', _4 => _4.request, 'optionalAccess', _5 => _5.body]) || event.node.req[RawBodySymbol] || event.node.req.rawBody || event.node.req.body;
214
- if (_rawBody) {
215
- const promise2 = Promise.resolve(_rawBody).then((_resolved) => {
216
- if (Buffer.isBuffer(_resolved)) {
217
- return _resolved;
218
- }
219
- if (typeof _resolved.pipeTo === "function") {
220
- return new Promise((resolve, reject) => {
221
- const chunks = [];
222
- _resolved.pipeTo(
223
- new WritableStream({
224
- write(chunk) {
225
- chunks.push(chunk);
226
- },
227
- close() {
228
- resolve(Buffer.concat(chunks));
229
- },
230
- abort(reason) {
231
- reject(reason);
232
- }
233
- })
234
- ).catch(reject);
235
- });
236
- } else if (typeof _resolved.pipe === "function") {
237
- return new Promise((resolve, reject) => {
238
- const chunks = [];
239
- _resolved.on("data", (chunk) => {
240
- chunks.push(chunk);
241
- }).on("end", () => {
242
- resolve(Buffer.concat(chunks));
243
- }).on("error", reject);
244
- });
245
- }
246
- if (_resolved.constructor === Object) {
247
- return Buffer.from(JSON.stringify(_resolved));
248
- }
249
- return Buffer.from(_resolved);
250
- });
251
- return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
252
- }
253
- if (!Number.parseInt(event.node.req.headers["content-length"] || "") && !String(_nullishCoalesce(event.node.req.headers["transfer-encoding"], () => ( ""))).split(",").map((e) => e.trim()).filter(Boolean).includes("chunked")) {
254
- return Promise.resolve(void 0);
255
- }
256
- const promise = event.node.req[RawBodySymbol] = new Promise(
257
- (resolve, reject) => {
258
- const bodyData = [];
259
- event.node.req.on("error", (err) => {
260
- reject(err);
261
- }).on("data", (chunk) => {
262
- bodyData.push(chunk);
263
- }).on("end", () => {
264
- resolve(Buffer.concat(bodyData));
265
- });
266
- }
267
- );
268
- const result = encoding ? promise.then((buff) => buff.toString(encoding)) : promise;
269
- return result;
270
- }
271
- var DISALLOWED_STATUS_CHARS = /[^\u0009\u0020-\u007E]/g;
272
- function sanitizeStatusMessage(statusMessage = "") {
273
- return statusMessage.replace(DISALLOWED_STATUS_CHARS, "");
274
- }
275
- function sanitizeStatusCode(statusCode, defaultStatusCode = 200) {
276
- if (!statusCode) {
277
- return defaultStatusCode;
278
- }
279
- if (typeof statusCode === "string") {
280
- statusCode = Number.parseInt(statusCode, 10);
281
- }
282
- if (statusCode < 100 || statusCode > 999) {
283
- return defaultStatusCode;
284
- }
285
- return statusCode;
286
- }
287
- var getSessionPromise = Symbol("getSession");
288
- function defineEventHandler(handler) {
289
- if (typeof handler === "function") {
290
- handler.__is_handler__ = true;
291
- return handler;
292
- }
293
- const _hooks = {
294
- onRequest: _normalizeArray(handler.onRequest),
295
- onBeforeResponse: _normalizeArray(handler.onBeforeResponse)
296
- };
297
- const _handler = (event) => {
298
- return _callHandler(event, handler.handler, _hooks);
299
- };
300
- _handler.__is_handler__ = true;
301
- _handler.__resolve__ = handler.handler.__resolve__;
302
- _handler.__websocket__ = handler.websocket;
303
- return _handler;
304
- }
305
- function _normalizeArray(input) {
306
- return input ? Array.isArray(input) ? input : [input] : void 0;
307
- }
308
- async function _callHandler(event, handler, hooks) {
309
- if (hooks.onRequest) {
310
- for (const hook of hooks.onRequest) {
311
- await hook(event);
312
- if (event.handled) {
313
- return;
314
- }
315
- }
316
- }
317
- const body = await handler(event);
318
- const response = { body };
319
- if (hooks.onBeforeResponse) {
320
- for (const hook of hooks.onBeforeResponse) {
321
- await hook(event, response);
322
- }
323
- }
324
- return response.body;
325
- }
326
- var H3Headers = globalThis.Headers;
327
- var H3Response = globalThis.Response;
328
-
329
- // platforms/h3.ts
330
- var verifySignatureH3 = (handler, config) => {
331
- const currentSigningKey = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _6 => _6.currentSigningKey]), () => ( process.env.QSTASH_CURRENT_SIGNING_KEY));
332
- if (!currentSigningKey) {
333
- throw new Error(
334
- "currentSigningKey is required, either in the config or as env variable QSTASH_CURRENT_SIGNING_KEY"
335
- );
336
- }
337
- const nextSigningKey = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _7 => _7.nextSigningKey]), () => ( process.env.QSTASH_NEXT_SIGNING_KEY));
338
- if (!nextSigningKey) {
339
- throw new Error(
340
- "nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
341
- );
342
- }
343
- const receiver = new (0, _chunkKZOQ64Z6js.Receiver)({
344
- currentSigningKey,
345
- nextSigningKey
346
- });
347
- return defineEventHandler(async (event) => {
348
- const signature = getHeader(event, "upstash-signature");
349
- if (!signature) {
350
- return { status: 403, body: "`Upstash-Signature` header is missing" };
351
- }
352
- if (typeof signature !== "string") {
353
- throw new TypeError("`Upstash-Signature` header is not a string");
354
- }
355
- const body = await readRawBody(event);
356
- const isValid = await receiver.verify({
357
- signature,
358
- body: JSON.stringify(body),
359
- clockTolerance: _optionalChain([config, 'optionalAccess', _8 => _8.clockTolerance])
360
- });
361
- if (!isValid) {
362
- return { status: 403, body: "invalid signature" };
363
- }
364
- event._requestBody = body;
365
- return handler(event);
366
- });
367
- };
368
- function transformHeaders(headers) {
369
- const formattedHeaders = Object.entries(headers).map(([key, value]) => [
370
- key,
371
- Array.isArray(value) ? value.join(", ") : _nullishCoalesce(value, () => ( ""))
372
- ]);
373
- return formattedHeaders;
374
- }
375
- var serve2 = (routeFunction, options) => {
376
- const handler = defineEventHandler(async (event) => {
377
- const method = event.node.req.method;
378
- if (_optionalChain([method, 'optionalAccess', _9 => _9.toUpperCase, 'call', _10 => _10()]) !== "POST") {
379
- return {
380
- status: 405,
381
- body: "Only POST requests are allowed in worklfows"
382
- };
383
- }
384
- const request_ = event.node.req;
385
- const protocol = request_.headers["x-forwarded-proto"];
386
- const host = request_.headers.host;
387
- const url = `${protocol}://${host}${event.path}`;
388
- const headers = transformHeaders(request_.headers);
389
- const request = new Request(url, {
390
- headers,
391
- body: await readRawBody(event),
392
- method: "POST"
393
- });
394
- const serveHandler = _chunkKZOQ64Z6js.serve.call(void 0, routeFunction, options);
395
- return await serveHandler(request);
396
- });
397
- return handler;
398
- };
399
-
400
-
401
-
402
-
403
- exports.verifySignatureH3 = verifySignatureH3; exports.serve = serve2;
package/chunk-VN7YQ2UN.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
package/cloudflare.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkKZOQ64Z6js = require('./chunk-KZOQ64Z6.js');
4
-
5
- // platforms/cloudflare.ts
6
- var getArgs = (args) => {
7
- if (!Array.isArray(args) || args.length === 0) {
8
- throw new Error("No arguments passed to serve handler");
9
- }
10
- if (typeof args[0] === "object" && "request" in args[0] && "env" in args[0]) {
11
- return {
12
- request: args[0].request,
13
- env: args[0].env
14
- };
15
- }
16
- if (args.length > 1 && typeof args[1] === "object") {
17
- return {
18
- request: args[0],
19
- env: args[1]
20
- };
21
- }
22
- throw new Error("Could not derive handler arguments from input. Please check how serve is used.");
23
- };
24
- var serve2 = (routeFunction, options) => {
25
- const handler = async (...args) => {
26
- const { request, env } = getArgs(args);
27
- const serveHandler = _chunkKZOQ64Z6js.serve.call(void 0, routeFunction, {
28
- env,
29
- ...options
30
- });
31
- return await serveHandler(request);
32
- };
33
- return handler;
34
- };
35
-
36
-
37
- exports.serve = serve2;
package/h3.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkQ6JW7JKTjs = require('./chunk-Q6JW7JKT.js');
5
- require('./chunk-VN7YQ2UN.js');
6
- require('./chunk-KZOQ64Z6.js');
7
-
8
-
9
-
10
- exports.serve = _chunkQ6JW7JKTjs.serve; exports.verifySignatureH3 = _chunkQ6JW7JKTjs.verifySignatureH3;
package/hono.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkKZOQ64Z6js = require('./chunk-KZOQ64Z6.js');
4
-
5
- // platforms/hono.ts
6
- var serve2 = (routeFunction, options) => {
7
- const handler = async (context) => {
8
- const environment = context.env;
9
- const request = context.req.raw;
10
- const serveHandler = _chunkKZOQ64Z6js.serve.call(void 0, routeFunction, {
11
- // when hono is used without cf workers, it sends a DebugHTTPServer
12
- // object in `context.env`. don't pass env if this is the case:
13
- env: "QSTASH_TOKEN" in environment ? environment : void 0,
14
- ...options
15
- });
16
- return await serveHandler(request);
17
- };
18
- return handler;
19
- };
20
-
21
-
22
- exports.serve = serve2;
package/index.js DELETED
@@ -1,43 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-VN7YQ2UN.js');
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
- var _chunkKZOQ64Z6js = require('./chunk-KZOQ64Z6.js');
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
- exports.Chat = _chunkKZOQ64Z6js.Chat; exports.Client = _chunkKZOQ64Z6js.Client; exports.Messages = _chunkKZOQ64Z6js.Messages; exports.QStashWorkflowAbort = _chunkKZOQ64Z6js.QStashWorkflowAbort; exports.QStashWorkflowError = _chunkKZOQ64Z6js.QStashWorkflowError; exports.QstashChatRatelimitError = _chunkKZOQ64Z6js.QstashChatRatelimitError; exports.QstashDailyRatelimitError = _chunkKZOQ64Z6js.QstashDailyRatelimitError; exports.QstashError = _chunkKZOQ64Z6js.QstashError; exports.QstashRatelimitError = _chunkKZOQ64Z6js.QstashRatelimitError; exports.Receiver = _chunkKZOQ64Z6js.Receiver; exports.Schedules = _chunkKZOQ64Z6js.Schedules; exports.SignatureError = _chunkKZOQ64Z6js.SignatureError; exports.UrlGroups = _chunkKZOQ64Z6js.UrlGroups; exports.custom = _chunkKZOQ64Z6js.custom; exports.decodeBase64 = _chunkKZOQ64Z6js.decodeBase64; exports.formatWorkflowError = _chunkKZOQ64Z6js.formatWorkflowError; exports.openai = _chunkKZOQ64Z6js.openai; exports.setupAnalytics = _chunkKZOQ64Z6js.setupAnalytics; exports.upstash = _chunkKZOQ64Z6js.upstash;