@upstash/qstash 2.8.4 → 2.9.0-rc
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-5PQP3YLP.mjs → chunk-NU64UBMT.mjs} +1 -1
- package/{chunk-EZZS7N6P.mjs → chunk-PB5UCB6Z.mjs} +6 -9
- package/{chunk-RQPZUJXG.mjs → chunk-WOMVRJIB.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
package/solidjs.mjs
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-NU64UBMT.mjs";
|
|
2
2
|
import {
|
|
3
3
|
Receiver,
|
|
4
4
|
serve
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WOMVRJIB.mjs";
|
|
6
6
|
|
|
7
7
|
// platforms/solidjs.ts
|
|
8
8
|
var verifySignatureSolidjs = (handler, config) => {
|
|
9
9
|
const currentSigningKey = config?.currentSigningKey ?? process.env.QSTASH_CURRENT_SIGNING_KEY;
|
|
10
|
-
if (!currentSigningKey) {
|
|
11
|
-
throw new Error("currentSigningKey is required, either in the config or from the env");
|
|
12
|
-
}
|
|
13
10
|
const nextSigningKey = config?.nextSigningKey ?? process.env.QSTASH_NEXT_SIGNING_KEY;
|
|
14
|
-
if (!nextSigningKey) {
|
|
15
|
-
throw new Error(
|
|
11
|
+
if (!currentSigningKey && !nextSigningKey && !process.env.QSTASH_REGION) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
"currentSigningKey and nextSigningKey are required, either in the config or as env variables (QSTASH_CURRENT_SIGNING_KEY and QSTASH_NEXT_SIGNING_KEY)"
|
|
14
|
+
);
|
|
16
15
|
}
|
|
17
16
|
const receiver = new Receiver({
|
|
18
17
|
currentSigningKey,
|
|
@@ -26,12 +25,14 @@ var verifySignatureSolidjs = (handler, config) => {
|
|
|
26
25
|
if (typeof signature !== "string") {
|
|
27
26
|
throw new TypeError("`Upstash-Signature` header is not a string");
|
|
28
27
|
}
|
|
28
|
+
const upstashRegion = event.request.headers.get("upstash-region");
|
|
29
29
|
const cloneRequest = event.request.clone();
|
|
30
30
|
const body = await cloneRequest.text();
|
|
31
31
|
const isValid = await receiver.verify({
|
|
32
32
|
signature,
|
|
33
33
|
body,
|
|
34
|
-
clockTolerance: config?.clockTolerance
|
|
34
|
+
clockTolerance: config?.clockTolerance,
|
|
35
|
+
upstashRegion: upstashRegion ?? void 0
|
|
35
36
|
});
|
|
36
37
|
if (!isValid) {
|
|
37
38
|
return new Response("invalid signature", { status: 403 });
|
package/svelte.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RequestHandler } from '@sveltejs/kit';
|
|
2
|
-
import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-
|
|
2
|
+
import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BVG9vt90.mjs';
|
|
3
3
|
import 'neverthrow';
|
|
4
4
|
|
|
5
5
|
type VerifySignatureConfig = {
|
|
6
|
-
currentSigningKey
|
|
7
|
-
nextSigningKey
|
|
6
|
+
currentSigningKey?: string;
|
|
7
|
+
nextSigningKey?: string;
|
|
8
8
|
clockTolerance?: number;
|
|
9
9
|
};
|
|
10
|
-
declare const verifySignatureSvelte: <Parameters extends Partial<Record<string, string>> = Partial<Record<string, string>>, RouteId extends string | null = string | null>(handler: RequestHandler<Parameters, RouteId>, config
|
|
10
|
+
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
11
|
/**
|
|
12
12
|
* Serve method to serve a Upstash Workflow in a Nextjs project
|
|
13
13
|
*
|
package/svelte.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RequestHandler } from '@sveltejs/kit';
|
|
2
|
-
import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-
|
|
2
|
+
import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BVG9vt90.js';
|
|
3
3
|
import 'neverthrow';
|
|
4
4
|
|
|
5
5
|
type VerifySignatureConfig = {
|
|
6
|
-
currentSigningKey
|
|
7
|
-
nextSigningKey
|
|
6
|
+
currentSigningKey?: string;
|
|
7
|
+
nextSigningKey?: string;
|
|
8
8
|
clockTolerance?: number;
|
|
9
9
|
};
|
|
10
|
-
declare const verifySignatureSvelte: <Parameters extends Partial<Record<string, string>> = Partial<Record<string, string>>, RouteId extends string | null = string | null>(handler: RequestHandler<Parameters, RouteId>, config
|
|
10
|
+
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
11
|
/**
|
|
12
12
|
* Serve method to serve a Upstash Workflow in a Nextjs project
|
|
13
13
|
*
|