@upstash/qstash 2.8.4 → 2.9.0
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/{chunk-EZZS7N6P.mjs → chunk-H5OAU75L.mjs} +6 -9
- package/{chunk-5PQP3YLP.mjs → chunk-M7SEEFAC.mjs} +1 -1
- package/{chunk-RQPZUJXG.mjs → chunk-QYBCXZKB.mjs} +640 -495
- package/{client-DKNfczbM.d.ts → client-BVG9vt90.d.mts} +17 -5
- package/{client-DKNfczbM.d.mts → client-BVG9vt90.d.ts} +17 -5
- package/cloudflare.d.mts +1 -1
- package/cloudflare.d.ts +1 -1
- package/cloudflare.js +812 -667
- package/cloudflare.mjs +1 -1
- package/h3.d.mts +1 -1
- package/h3.d.ts +1 -1
- package/h3.js +825 -683
- package/h3.mjs +3 -3
- package/hono.d.mts +1 -1
- package/hono.d.ts +1 -1
- package/hono.js +812 -667
- package/hono.mjs +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +637 -492
- package/index.mjs +2 -2
- package/nextjs.d.mts +1 -1
- package/nextjs.d.ts +1 -1
- package/nextjs.js +647 -511
- package/nextjs.mjs +16 -25
- package/nuxt.js +110 -12
- package/nuxt.mjs +3 -3
- package/package.json +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +828 -682
- package/solidjs.mjs +9 -8
- package/svelte.d.mts +4 -4
- package/svelte.d.ts +4 -4
- package/svelte.js +830 -684
- package/svelte.mjs +11 -10
- package/workflow.d.mts +1 -1
- package/workflow.d.ts +1 -1
- package/workflow.js +812 -667
- package/workflow.mjs +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Receiver,
|
|
3
3
|
serve
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QYBCXZKB.mjs";
|
|
5
5
|
|
|
6
6
|
// node_modules/defu/dist/defu.mjs
|
|
7
7
|
function isPlainObject(value) {
|
|
@@ -329,15 +329,10 @@ var H3Response = globalThis.Response;
|
|
|
329
329
|
// platforms/h3.ts
|
|
330
330
|
var verifySignatureH3 = (handler, config) => {
|
|
331
331
|
const currentSigningKey = config?.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
332
|
const nextSigningKey = config?.nextSigningKey ?? process.env.QSTASH_NEXT_SIGNING_KEY;
|
|
338
|
-
if (!nextSigningKey) {
|
|
333
|
+
if (!currentSigningKey && !nextSigningKey && !process.env.QSTASH_REGION) {
|
|
339
334
|
throw new Error(
|
|
340
|
-
"nextSigningKey
|
|
335
|
+
"currentSigningKey and nextSigningKey are required, either in the config or as env variables (QSTASH_CURRENT_SIGNING_KEY and QSTASH_NEXT_SIGNING_KEY)"
|
|
341
336
|
);
|
|
342
337
|
}
|
|
343
338
|
const receiver = new Receiver({
|
|
@@ -352,11 +347,13 @@ var verifySignatureH3 = (handler, config) => {
|
|
|
352
347
|
if (typeof signature !== "string") {
|
|
353
348
|
throw new TypeError("`Upstash-Signature` header is not a string");
|
|
354
349
|
}
|
|
350
|
+
const upstashRegion = getHeader(event, "upstash-region");
|
|
355
351
|
const body = await readRawBody(event);
|
|
356
352
|
const isValid = await receiver.verify({
|
|
357
353
|
signature,
|
|
358
354
|
body: JSON.stringify(body),
|
|
359
|
-
clockTolerance: config?.clockTolerance
|
|
355
|
+
clockTolerance: config?.clockTolerance,
|
|
356
|
+
upstashRegion: typeof upstashRegion === "string" ? upstashRegion : void 0
|
|
360
357
|
});
|
|
361
358
|
if (!isValid) {
|
|
362
359
|
return { status: 403, body: "invalid signature" };
|