@upstash/qstash 2.7.5 → 2.7.6-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.
- package/README.md +10 -3
- package/chunk-B3NB4QLV.mjs +2920 -0
- package/chunk-IJ3475FO.mjs +403 -0
- package/chunk-IJ5AEYLN.js +1 -0
- package/chunk-NMSGEGBP.js +403 -0
- package/chunk-S7JMIMW4.mjs +0 -0
- package/chunk-WQZ4U6LJ.js +2920 -0
- package/{dist/workflow/index.d.mts → client-aUVEwn93.d.mts} +868 -800
- package/{dist/nextjs/index.d.mts → client-aUVEwn93.d.ts} +871 -743
- package/cloudflare.d.mts +33 -0
- package/cloudflare.d.ts +33 -0
- package/cloudflare.js +37 -0
- package/cloudflare.mjs +37 -0
- package/h3.d.mts +17 -0
- package/h3.d.ts +17 -0
- package/h3.js +10 -0
- package/h3.mjs +10 -0
- package/hono.d.mts +25 -0
- package/hono.d.ts +25 -0
- package/hono.js +22 -0
- package/hono.mjs +22 -0
- package/index.d.mts +54 -0
- package/index.d.ts +54 -0
- package/index.js +41 -0
- package/index.mjs +41 -0
- package/nextjs.d.mts +38 -0
- package/nextjs.d.ts +38 -0
- package/nextjs.js +178 -0
- package/nextjs.mjs +178 -0
- package/nuxt.d.mts +12 -0
- package/nuxt.d.ts +12 -0
- package/nuxt.js +11 -0
- package/nuxt.mjs +11 -0
- package/package.json +1 -1
- package/solidjs.d.mts +22 -0
- package/solidjs.d.ts +22 -0
- package/solidjs.js +56 -0
- package/solidjs.mjs +56 -0
- package/svelte.d.mts +24 -0
- package/svelte.d.ts +24 -0
- package/svelte.js +53 -0
- package/svelte.mjs +53 -0
- package/workflow.d.mts +2 -0
- package/workflow.d.ts +2 -0
- package/workflow.js +18 -0
- package/workflow.mjs +18 -0
- package/dist/base/index.d.mts +0 -1279
- package/dist/base/index.mjs +0 -2
- package/dist/cloudflare/index.d.mts +0 -1652
- package/dist/cloudflare/index.mjs +0 -11
- package/dist/h3/index.d.mts +0 -1637
- package/dist/h3/index.mjs +0 -11
- package/dist/hono/index.d.mts +0 -1645
- package/dist/hono/index.mjs +0 -11
- package/dist/nextjs/index.mjs +0 -11
- package/dist/solidjs/index.d.mts +0 -1642
- package/dist/solidjs/index.mjs +0 -11
- package/dist/svelte/index.d.mts +0 -1644
- package/dist/svelte/index.mjs +0 -11
- package/dist/workflow/index.mjs +0 -11
package/svelte.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-IJ5AEYLN.js');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkWQZ4U6LJjs = require('./chunk-WQZ4U6LJ.js');
|
|
6
|
+
|
|
7
|
+
// platforms/svelte.ts
|
|
8
|
+
var verifySignatureSvelte = (handler, config) => {
|
|
9
|
+
const currentSigningKey = config.currentSigningKey;
|
|
10
|
+
if (!currentSigningKey) {
|
|
11
|
+
throw new Error("currentSigningKey is required, either in the config or from the env");
|
|
12
|
+
}
|
|
13
|
+
const nextSigningKey = config.nextSigningKey;
|
|
14
|
+
if (!nextSigningKey) {
|
|
15
|
+
throw new Error("nextSigningKey is required, either in the config or from the env");
|
|
16
|
+
}
|
|
17
|
+
const receiver = new (0, _chunkWQZ4U6LJjs.Receiver)({
|
|
18
|
+
currentSigningKey,
|
|
19
|
+
nextSigningKey
|
|
20
|
+
});
|
|
21
|
+
const wrappedHandler = async (event) => {
|
|
22
|
+
const signature = event.request.headers.get("upstash-signature");
|
|
23
|
+
if (!signature) {
|
|
24
|
+
return new Response("`Upstash-Signature` header is missing", { status: 403 });
|
|
25
|
+
}
|
|
26
|
+
if (typeof signature !== "string") {
|
|
27
|
+
throw new TypeError("`Upstash-Signature` header is not a string");
|
|
28
|
+
}
|
|
29
|
+
const cloneRequest = event.request.clone();
|
|
30
|
+
const body = await cloneRequest.text();
|
|
31
|
+
const isValid = await receiver.verify({
|
|
32
|
+
signature,
|
|
33
|
+
body,
|
|
34
|
+
clockTolerance: config.clockTolerance
|
|
35
|
+
});
|
|
36
|
+
if (!isValid) {
|
|
37
|
+
return new Response("invalid signature", { status: 403 });
|
|
38
|
+
}
|
|
39
|
+
return handler(event);
|
|
40
|
+
};
|
|
41
|
+
return wrappedHandler;
|
|
42
|
+
};
|
|
43
|
+
var serve2 = (routeFunction, options) => {
|
|
44
|
+
const handler = async ({ request }) => {
|
|
45
|
+
const serveMethod = _chunkWQZ4U6LJjs.serve.call(void 0, routeFunction, options);
|
|
46
|
+
return await serveMethod(request);
|
|
47
|
+
};
|
|
48
|
+
return handler;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
exports.serve = serve2; exports.verifySignatureSvelte = verifySignatureSvelte;
|
package/svelte.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "./chunk-S7JMIMW4.mjs";
|
|
2
|
+
import {
|
|
3
|
+
Receiver,
|
|
4
|
+
serve
|
|
5
|
+
} from "./chunk-B3NB4QLV.mjs";
|
|
6
|
+
|
|
7
|
+
// platforms/svelte.ts
|
|
8
|
+
var verifySignatureSvelte = (handler, config) => {
|
|
9
|
+
const currentSigningKey = config.currentSigningKey;
|
|
10
|
+
if (!currentSigningKey) {
|
|
11
|
+
throw new Error("currentSigningKey is required, either in the config or from the env");
|
|
12
|
+
}
|
|
13
|
+
const nextSigningKey = config.nextSigningKey;
|
|
14
|
+
if (!nextSigningKey) {
|
|
15
|
+
throw new Error("nextSigningKey is required, either in the config or from the env");
|
|
16
|
+
}
|
|
17
|
+
const receiver = new Receiver({
|
|
18
|
+
currentSigningKey,
|
|
19
|
+
nextSigningKey
|
|
20
|
+
});
|
|
21
|
+
const wrappedHandler = async (event) => {
|
|
22
|
+
const signature = event.request.headers.get("upstash-signature");
|
|
23
|
+
if (!signature) {
|
|
24
|
+
return new Response("`Upstash-Signature` header is missing", { status: 403 });
|
|
25
|
+
}
|
|
26
|
+
if (typeof signature !== "string") {
|
|
27
|
+
throw new TypeError("`Upstash-Signature` header is not a string");
|
|
28
|
+
}
|
|
29
|
+
const cloneRequest = event.request.clone();
|
|
30
|
+
const body = await cloneRequest.text();
|
|
31
|
+
const isValid = await receiver.verify({
|
|
32
|
+
signature,
|
|
33
|
+
body,
|
|
34
|
+
clockTolerance: config.clockTolerance
|
|
35
|
+
});
|
|
36
|
+
if (!isValid) {
|
|
37
|
+
return new Response("invalid signature", { status: 403 });
|
|
38
|
+
}
|
|
39
|
+
return handler(event);
|
|
40
|
+
};
|
|
41
|
+
return wrappedHandler;
|
|
42
|
+
};
|
|
43
|
+
var serve2 = (routeFunction, options) => {
|
|
44
|
+
const handler = async ({ request }) => {
|
|
45
|
+
const serveMethod = serve(routeFunction, options);
|
|
46
|
+
return await serveMethod(request);
|
|
47
|
+
};
|
|
48
|
+
return handler;
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
serve2 as serve,
|
|
52
|
+
verifySignatureSvelte
|
|
53
|
+
};
|
package/workflow.d.mts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { af as AsyncStepFunction, a8 as DisabledWorkflowContext, F as FailureFunctionPayload, ai as FinishCondition, ak as LogLevel, ah as ParallelCallState, ad as RawStep, aj as RequiredExceptFields, a2 as RouteFunction, S as Step, ag as StepFunction, ac as StepType, ab as StepTypes, ae as SyncStepFunction, a4 as Workflow, a9 as WorkflowClient, a7 as WorkflowContext, am as WorkflowLogger, al as WorkflowLoggerOptions, aa as WorkflowReceiver, a3 as WorkflowServeOptions, a5 as processOptions, a6 as serve } from './client-aUVEwn93.mjs';
|
|
2
|
+
import 'neverthrow';
|
package/workflow.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { af as AsyncStepFunction, a8 as DisabledWorkflowContext, F as FailureFunctionPayload, ai as FinishCondition, ak as LogLevel, ah as ParallelCallState, ad as RawStep, aj as RequiredExceptFields, a2 as RouteFunction, S as Step, ag as StepFunction, ac as StepType, ab as StepTypes, ae as SyncStepFunction, a4 as Workflow, a9 as WorkflowClient, a7 as WorkflowContext, am as WorkflowLogger, al as WorkflowLoggerOptions, aa as WorkflowReceiver, a3 as WorkflowServeOptions, a5 as processOptions, a6 as serve } from './client-aUVEwn93.js';
|
|
2
|
+
import 'neverthrow';
|
package/workflow.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkWQZ4U6LJjs = require('./chunk-WQZ4U6LJ.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.DisabledWorkflowContext = _chunkWQZ4U6LJjs.DisabledWorkflowContext; exports.StepTypes = _chunkWQZ4U6LJjs.StepTypes; exports.Workflow = _chunkWQZ4U6LJjs.Workflow; exports.WorkflowContext = _chunkWQZ4U6LJjs.WorkflowContext; exports.WorkflowLogger = _chunkWQZ4U6LJjs.WorkflowLogger; exports.processOptions = _chunkWQZ4U6LJjs.processOptions; exports.serve = _chunkWQZ4U6LJjs.serve;
|
package/workflow.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DisabledWorkflowContext,
|
|
3
|
+
StepTypes,
|
|
4
|
+
Workflow,
|
|
5
|
+
WorkflowContext,
|
|
6
|
+
WorkflowLogger,
|
|
7
|
+
processOptions,
|
|
8
|
+
serve
|
|
9
|
+
} from "./chunk-B3NB4QLV.mjs";
|
|
10
|
+
export {
|
|
11
|
+
DisabledWorkflowContext,
|
|
12
|
+
StepTypes,
|
|
13
|
+
Workflow,
|
|
14
|
+
WorkflowContext,
|
|
15
|
+
WorkflowLogger,
|
|
16
|
+
processOptions,
|
|
17
|
+
serve
|
|
18
|
+
};
|