@upstash/qstash 0.0.12 → 0.0.17
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 +34 -28
- package/esm/entrypoints/cloudflare.js +3 -3
- package/esm/entrypoints/nextjs.js +13 -10
- package/esm/entrypoints/nodejs.js +13 -0
- package/esm/pkg/client/client.js +1 -1
- package/esm/pkg/client/http.js +1 -1
- package/esm/pkg/{consumer.js → receiver.js} +1 -2
- package/package.json +28 -14
- package/script/entrypoints/cloudflare.js +5 -5
- package/script/entrypoints/nextjs.js +13 -10
- package/script/entrypoints/nodejs.js +43 -0
- package/script/pkg/client/client.js +1 -1
- package/script/pkg/client/http.js +1 -1
- package/script/pkg/{consumer.js → receiver.js} +1 -2
- package/types/deps/deno.land/std@0.147.0/crypto/mod.d.ts +2 -2
- package/types/entrypoints/cloudflare.d.ts +3 -3
- package/types/entrypoints/nodejs.d.ts +5 -0
- package/types/pkg/client/client.d.ts +1 -1
- package/types/pkg/client/http.d.ts +1 -1
- package/types/pkg/{consumer.d.ts → receiver.d.ts} +1 -1
package/README.md
CHANGED
|
@@ -23,11 +23,18 @@ See
|
|
|
23
23
|
[the list of APIs](https://docs.upstash.com/features/restapi#rest---redis-api-compatibility)
|
|
24
24
|
supported.
|
|
25
25
|
|
|
26
|
+
## Status of the SDK
|
|
27
|
+
|
|
28
|
+
It is currently in beta and we are actively collecting feedback from the
|
|
29
|
+
community. Please report any issues you encounter or feature requests in the
|
|
30
|
+
[GitHub issues](https://github.com/upstash/sdk-qstash-ts/issues) or talk to us
|
|
31
|
+
on [Discord](https://discord.gg/w9SenAtbme). Thank you!
|
|
32
|
+
|
|
26
33
|
## How does qStash work?
|
|
27
34
|
|
|
28
|
-
qStash is the message broker between your serverless apps. You send
|
|
35
|
+
qStash is the message broker between your serverless apps. You send aa HTTP
|
|
29
36
|
request to qStash, that includes a destination, a payload and optional settings.
|
|
30
|
-
We store your message durable and will deliver it to the destination
|
|
37
|
+
We store your message durable and will deliver it to the destination API via
|
|
31
38
|
HTTP. In case the destination is not ready to receive the message, we will retry
|
|
32
39
|
the message later, to guarentee at-least-once delivery.
|
|
33
40
|
|
|
@@ -47,43 +54,51 @@ npm install @upstash/qstash
|
|
|
47
54
|
import { Redis } from "https://deno.land/x/upstash_qstash/mod.ts";
|
|
48
55
|
```
|
|
49
56
|
|
|
50
|
-
###
|
|
57
|
+
### Get your authorization token
|
|
51
58
|
|
|
52
|
-
Go to [upstash](https://console.upstash.com/qstash) and
|
|
59
|
+
Go to [upstash](https://console.upstash.com/qstash) and copy the token.
|
|
53
60
|
|
|
54
61
|
## Basic Usage:
|
|
55
62
|
|
|
56
63
|
### Publishing a message
|
|
57
64
|
|
|
58
65
|
```ts
|
|
59
|
-
import { Client } from "@upstash/qstash"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
import { Client } from "@upstash/qstash";
|
|
67
|
+
/**
|
|
68
|
+
* Import a fetch polyfill only if you are using node prior to v18.
|
|
69
|
+
* This is not necessary for nextjs, deno or cloudflare workers.
|
|
70
|
+
*/
|
|
71
|
+
import "isomorphic-fetch";
|
|
72
|
+
|
|
73
|
+
const c = new Client({
|
|
74
|
+
token: "<QSTASH_TOKEN>",
|
|
75
|
+
});
|
|
68
76
|
|
|
69
|
-
|
|
77
|
+
const res = await c.publishJSON({
|
|
78
|
+
destination: "https://my-api...",
|
|
79
|
+
body: {
|
|
80
|
+
hello: "world",
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
console.log(res);
|
|
84
|
+
// { messageId: "msg_xxxxxxxxxxxxxxxx" }
|
|
70
85
|
```
|
|
71
86
|
|
|
72
|
-
###
|
|
87
|
+
### Receiving a message
|
|
73
88
|
|
|
74
89
|
How to consume a message depends on your http server. QStash does not receive
|
|
75
90
|
the http request directly, but should be called by you as the first step in your
|
|
76
91
|
handler function.
|
|
77
92
|
|
|
78
93
|
```ts
|
|
79
|
-
import {
|
|
94
|
+
import { Receiver } from "@upstash/qstash";
|
|
80
95
|
|
|
81
|
-
const
|
|
96
|
+
const r = new Receiver({
|
|
82
97
|
currentSigningKey: "..",
|
|
83
98
|
nextSigningKey: "..",
|
|
84
99
|
});
|
|
85
100
|
|
|
86
|
-
const isValid = await
|
|
101
|
+
const isValid = await r.verify({
|
|
87
102
|
/**
|
|
88
103
|
* The signature from the `Upstash-Signature` header.
|
|
89
104
|
*/
|
|
@@ -103,17 +118,8 @@ const isValid = await c.verify({
|
|
|
103
118
|
|
|
104
119
|
## Docs
|
|
105
120
|
|
|
106
|
-
See [the documentation](https://docs.upstash.com/
|
|
121
|
+
See [the documentation](https://docs.upstash.com/qstash) for details.
|
|
107
122
|
|
|
108
123
|
## Contributing
|
|
109
124
|
|
|
110
125
|
### [Install Deno](https://deno.land/#installation)
|
|
111
|
-
|
|
112
|
-
### Running tests
|
|
113
|
-
|
|
114
|
-
```sh
|
|
115
|
-
QSTASH_TOKEN=".." deno test -A
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
```
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// dnt-shim-ignore
|
|
2
|
-
import * as
|
|
2
|
+
import * as r from "../pkg/receiver.js";
|
|
3
3
|
export * from "../pkg/client/client.js";
|
|
4
|
-
export class
|
|
4
|
+
export class Receiver extends r.Receiver {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
8
8
|
// dnt-shim-ignore
|
|
9
|
-
subtleCrypto: crypto.subtle
|
|
9
|
+
subtleCrypto: crypto.subtle,
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
|
2
|
-
|
|
3
|
-
import { buffer } from "micro";
|
|
4
|
-
import { Consumer } from "../pkg/consumer.js";
|
|
2
|
+
import { Receiver } from "../pkg/receiver.js";
|
|
5
3
|
export function verifySignature(handler, config) {
|
|
6
4
|
const currentSigningKey = config?.currentSigningKey ??
|
|
7
5
|
// @ts-ignore Deno can't compile
|
|
@@ -15,10 +13,10 @@ export function verifySignature(handler, config) {
|
|
|
15
13
|
if (!nextSigningKey) {
|
|
16
14
|
throw new Error("nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY");
|
|
17
15
|
}
|
|
18
|
-
const
|
|
16
|
+
const receiver = new Receiver({
|
|
19
17
|
currentSigningKey,
|
|
20
18
|
nextSigningKey,
|
|
21
|
-
subtleCrypto: dntShim.crypto.subtle
|
|
19
|
+
subtleCrypto: dntShim.crypto.subtle,
|
|
22
20
|
});
|
|
23
21
|
return async (req, res) => {
|
|
24
22
|
const signature = req.headers["upstash-signature"];
|
|
@@ -28,10 +26,16 @@ export function verifySignature(handler, config) {
|
|
|
28
26
|
if (typeof signature !== "string") {
|
|
29
27
|
throw new Error("`Upstash-Signature` header is not a string");
|
|
30
28
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const chunks = [];
|
|
30
|
+
for await (const chunk of req) {
|
|
31
|
+
chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
32
|
+
}
|
|
33
|
+
const body = Buffer.concat(chunks).toString("utf-8");
|
|
34
|
+
// const url = config?.url ?? new URL(
|
|
35
|
+
// req.url!,
|
|
36
|
+
// `https://${process.env.VERCEL_URL}`,
|
|
37
|
+
// ).href;
|
|
38
|
+
const isValid = await receiver.verify({ signature, body });
|
|
35
39
|
if (!isValid) {
|
|
36
40
|
res.status(400);
|
|
37
41
|
res.send("Invalid signature");
|
|
@@ -47,7 +51,6 @@ export function verifySignature(handler, config) {
|
|
|
47
51
|
}
|
|
48
52
|
catch {
|
|
49
53
|
req.body = body;
|
|
50
|
-
console.log("body is not json");
|
|
51
54
|
}
|
|
52
55
|
return handler(req, res);
|
|
53
56
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// dnt-shim-ignore
|
|
2
|
+
import * as dntShim from "../_dnt.shims.js";
|
|
3
|
+
import * as r from "../pkg/receiver.js";
|
|
4
|
+
export * from "../pkg/client/client.js";
|
|
5
|
+
export class Receiver extends r.Receiver {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super({
|
|
8
|
+
...config,
|
|
9
|
+
// use the shimmed one from deno
|
|
10
|
+
subtleCrypto: dntShim.crypto.subtle,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
package/esm/pkg/client/client.js
CHANGED
package/esm/pkg/client/http.js
CHANGED
|
@@ -43,7 +43,7 @@ export class HttpClient {
|
|
|
43
43
|
}
|
|
44
44
|
async request(req) {
|
|
45
45
|
const headers = new Headers(req.headers);
|
|
46
|
-
headers.set("
|
|
46
|
+
headers.set("Authorization", this.authorization);
|
|
47
47
|
const requestOptions = {
|
|
48
48
|
method: req.method,
|
|
49
49
|
headers,
|
|
@@ -63,11 +63,10 @@ export class Consumer {
|
|
|
63
63
|
throw new SignatureError("signature does not match");
|
|
64
64
|
}
|
|
65
65
|
const p = JSON.parse(new TextDecoder().decode(base64Url.decode(payload)));
|
|
66
|
-
console.log(JSON.stringify(p, null, 2));
|
|
67
66
|
if (p.iss !== "Upstash") {
|
|
68
67
|
throw new SignatureError(`invalid issuer: ${p.iss}`);
|
|
69
68
|
}
|
|
70
|
-
if (p.sub !== req.url) {
|
|
69
|
+
if (typeof req.url !== "undefined" && p.sub !== req.url) {
|
|
71
70
|
throw new SignatureError(`invalid subject: ${p.sub}, want: ${req.url}`);
|
|
72
71
|
}
|
|
73
72
|
const now = Math.floor(Date.now() / 1000);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"module": "./esm/entrypoints/
|
|
3
|
-
"main": "./script/entrypoints/
|
|
4
|
-
"types": "./types/entrypoints/
|
|
2
|
+
"module": "./esm/entrypoints/nodejs.js",
|
|
3
|
+
"main": "./script/entrypoints/nodejs.js",
|
|
4
|
+
"types": "./types/entrypoints/nodejs.d.ts",
|
|
5
5
|
"name": "@upstash/qstash",
|
|
6
|
-
"version": "v0.0.
|
|
6
|
+
"version": "v0.0.17",
|
|
7
7
|
"description": "Official Deno/Typescript client for qStash",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -22,28 +22,42 @@
|
|
|
22
22
|
"url": "https://github.com/upstash/sdk-qstash-ts/issues"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/upstash/sdk-qstash-ts#readme",
|
|
25
|
-
"peerDependencies": {
|
|
26
|
-
"micro": "latest"
|
|
27
|
-
},
|
|
28
25
|
"typesVersions": {
|
|
29
26
|
"*": {
|
|
30
|
-
"
|
|
31
|
-
|
|
27
|
+
"nodejs": [
|
|
28
|
+
"./types/entrypoints/nodejs.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"cloudflare": [
|
|
31
|
+
"./types/entrypoints/cloudflare.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"nextjs": [
|
|
34
|
+
"./types/entrypoints/nextjs.d.ts"
|
|
35
|
+
]
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
38
|
"exports": {
|
|
35
|
-
"
|
|
36
|
-
"import": "./esm/entrypoints/
|
|
37
|
-
"require": "./script/entrypoints/
|
|
38
|
-
"types": "./types/entrypoints/
|
|
39
|
+
".": {
|
|
40
|
+
"import": "./esm/entrypoints/nodejs.js",
|
|
41
|
+
"require": "./script/entrypoints/nodejs.js",
|
|
42
|
+
"types": "./types/entrypoints/nodejs.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"./nodejs": {
|
|
45
|
+
"import": "./esm/entrypoints/nodejs.js",
|
|
46
|
+
"require": "./script/entrypoints/nodejs.js",
|
|
47
|
+
"types": "./types/entrypoints/nodejs.d.ts"
|
|
39
48
|
},
|
|
40
49
|
"./cloudflare": {
|
|
41
50
|
"import": "./esm/entrypoints/cloudflare.js",
|
|
42
51
|
"require": "./script/entrypoints/cloudflare.js",
|
|
43
52
|
"types": "./types/entrypoints/cloudflare.d.ts"
|
|
53
|
+
},
|
|
54
|
+
"./nextjs": {
|
|
55
|
+
"import": "./esm/entrypoints/nextjs.js",
|
|
56
|
+
"require": "./script/entrypoints/nextjs.js",
|
|
57
|
+
"types": "./types/entrypoints/nextjs.d.ts"
|
|
44
58
|
}
|
|
45
59
|
},
|
|
46
60
|
"dependencies": {
|
|
47
|
-
"@deno/shim-crypto": "~0.3.
|
|
61
|
+
"@deno/shim-crypto": "~0.3.0"
|
|
48
62
|
}
|
|
49
63
|
}
|
|
@@ -27,16 +27,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
27
27
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.
|
|
31
|
-
const
|
|
30
|
+
exports.Receiver = void 0;
|
|
31
|
+
const r = __importStar(require("../pkg/receiver.js"));
|
|
32
32
|
__exportStar(require("../pkg/client/client.js"), exports);
|
|
33
|
-
class
|
|
33
|
+
class Receiver extends r.Receiver {
|
|
34
34
|
constructor(config) {
|
|
35
35
|
super({
|
|
36
36
|
...config,
|
|
37
37
|
// dnt-shim-ignore
|
|
38
|
-
subtleCrypto: crypto.subtle
|
|
38
|
+
subtleCrypto: crypto.subtle,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
exports.
|
|
42
|
+
exports.Receiver = Receiver;
|
|
@@ -25,9 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.verifySignature = void 0;
|
|
27
27
|
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
28
|
-
|
|
29
|
-
const micro_1 = require("micro");
|
|
30
|
-
const consumer_js_1 = require("../pkg/consumer.js");
|
|
28
|
+
const receiver_js_1 = require("../pkg/receiver.js");
|
|
31
29
|
function verifySignature(handler, config) {
|
|
32
30
|
const currentSigningKey = config?.currentSigningKey ??
|
|
33
31
|
// @ts-ignore Deno can't compile
|
|
@@ -41,10 +39,10 @@ function verifySignature(handler, config) {
|
|
|
41
39
|
if (!nextSigningKey) {
|
|
42
40
|
throw new Error("nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY");
|
|
43
41
|
}
|
|
44
|
-
const
|
|
42
|
+
const receiver = new receiver_js_1.Receiver({
|
|
45
43
|
currentSigningKey,
|
|
46
44
|
nextSigningKey,
|
|
47
|
-
subtleCrypto: dntShim.crypto.subtle
|
|
45
|
+
subtleCrypto: dntShim.crypto.subtle,
|
|
48
46
|
});
|
|
49
47
|
return async (req, res) => {
|
|
50
48
|
const signature = req.headers["upstash-signature"];
|
|
@@ -54,10 +52,16 @@ function verifySignature(handler, config) {
|
|
|
54
52
|
if (typeof signature !== "string") {
|
|
55
53
|
throw new Error("`Upstash-Signature` header is not a string");
|
|
56
54
|
}
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
const chunks = [];
|
|
56
|
+
for await (const chunk of req) {
|
|
57
|
+
chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
58
|
+
}
|
|
59
|
+
const body = Buffer.concat(chunks).toString("utf-8");
|
|
60
|
+
// const url = config?.url ?? new URL(
|
|
61
|
+
// req.url!,
|
|
62
|
+
// `https://${process.env.VERCEL_URL}`,
|
|
63
|
+
// ).href;
|
|
64
|
+
const isValid = await receiver.verify({ signature, body });
|
|
61
65
|
if (!isValid) {
|
|
62
66
|
res.status(400);
|
|
63
67
|
res.send("Invalid signature");
|
|
@@ -73,7 +77,6 @@ function verifySignature(handler, config) {
|
|
|
73
77
|
}
|
|
74
78
|
catch {
|
|
75
79
|
req.body = body;
|
|
76
|
-
console.log("body is not json");
|
|
77
80
|
}
|
|
78
81
|
return handler(req, res);
|
|
79
82
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Receiver = void 0;
|
|
30
|
+
// dnt-shim-ignore
|
|
31
|
+
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
32
|
+
const r = __importStar(require("../pkg/receiver.js"));
|
|
33
|
+
__exportStar(require("../pkg/client/client.js"), exports);
|
|
34
|
+
class Receiver extends r.Receiver {
|
|
35
|
+
constructor(config) {
|
|
36
|
+
super({
|
|
37
|
+
...config,
|
|
38
|
+
// use the shimmed one from deno
|
|
39
|
+
subtleCrypto: dntShim.crypto.subtle,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.Receiver = Receiver;
|
|
@@ -46,7 +46,7 @@ class HttpClient {
|
|
|
46
46
|
}
|
|
47
47
|
async request(req) {
|
|
48
48
|
const headers = new Headers(req.headers);
|
|
49
|
-
headers.set("
|
|
49
|
+
headers.set("Authorization", this.authorization);
|
|
50
50
|
const requestOptions = {
|
|
51
51
|
method: req.method,
|
|
52
52
|
headers,
|
|
@@ -67,11 +67,10 @@ class Consumer {
|
|
|
67
67
|
throw new SignatureError("signature does not match");
|
|
68
68
|
}
|
|
69
69
|
const p = JSON.parse(new TextDecoder().decode(deps_js_1.base64Url.decode(payload)));
|
|
70
|
-
console.log(JSON.stringify(p, null, 2));
|
|
71
70
|
if (p.iss !== "Upstash") {
|
|
72
71
|
throw new SignatureError(`invalid issuer: ${p.iss}`);
|
|
73
72
|
}
|
|
74
|
-
if (p.sub !== req.url) {
|
|
73
|
+
if (typeof req.url !== "undefined" && p.sub !== req.url) {
|
|
75
74
|
throw new SignatureError(`invalid subject: ${p.sub}, want: ${req.url}`);
|
|
76
75
|
}
|
|
77
76
|
const now = Math.floor(Date.now() / 1000);
|
|
@@ -23,7 +23,7 @@ declare const stdCrypto: {
|
|
|
23
23
|
encrypt: (algorithm: dntShim.AlgorithmIdentifier | dntShim.RsaOaepParams | dntShim.AesCtrParams | dntShim.AesCbcParams | dntShim.AesGcmParams, key: dntShim.CryptoKey, data: dntShim.BufferSource) => Promise<any>;
|
|
24
24
|
exportKey: {
|
|
25
25
|
(format: "jwk", key: dntShim.CryptoKey): Promise<dntShim.JsonWebKey>;
|
|
26
|
-
(format: "
|
|
26
|
+
(format: "raw" | "pkcs8" | "spki", key: dntShim.CryptoKey): Promise<ArrayBuffer>;
|
|
27
27
|
};
|
|
28
28
|
generateKey: {
|
|
29
29
|
(algorithm: dntShim.RsaHashedKeyGenParams | dntShim.EcKeyGenParams, extractable: boolean, keyUsages: readonly dntShim.KeyUsage[]): Promise<dntShim.CryptoKeyPair>;
|
|
@@ -32,7 +32,7 @@ declare const stdCrypto: {
|
|
|
32
32
|
};
|
|
33
33
|
importKey: {
|
|
34
34
|
(format: "jwk", keyData: dntShim.JsonWebKey, algorithm: dntShim.AlgorithmIdentifier | dntShim.HmacImportParams | dntShim.RsaHashedImportParams | dntShim.EcKeyImportParams | dntShim.AesKeyAlgorithm, extractable: boolean, keyUsages: readonly dntShim.KeyUsage[]): Promise<dntShim.CryptoKey>;
|
|
35
|
-
(format: "
|
|
35
|
+
(format: "raw" | "pkcs8" | "spki", keyData: dntShim.BufferSource, algorithm: dntShim.AlgorithmIdentifier | dntShim.HmacImportParams | dntShim.RsaHashedImportParams | dntShim.EcKeyImportParams | dntShim.AesKeyAlgorithm, extractable: boolean, keyUsages: dntShim.KeyUsage[]): Promise<dntShim.CryptoKey>;
|
|
36
36
|
};
|
|
37
37
|
sign: (algorithm: dntShim.AlgorithmIdentifier | dntShim.RsaPssParams | dntShim.EcdsaParams, key: dntShim.CryptoKey, data: dntShim.BufferSource) => Promise<ArrayBuffer>;
|
|
38
38
|
unwrapKey: (format: dntShim.KeyFormat, wrappedKey: dntShim.BufferSource, unwrappingKey: dntShim.CryptoKey, unwrapAlgorithm: dntShim.AlgorithmIdentifier | dntShim.RsaOaepParams | dntShim.AesCtrParams | dntShim.AesCbcParams | dntShim.AesGcmParams, unwrappedKeyAlgorithm: dntShim.AlgorithmIdentifier | dntShim.HmacImportParams | dntShim.RsaHashedImportParams | dntShim.EcKeyImportParams | dntShim.AesKeyAlgorithm, extractable: boolean, keyUsages: dntShim.KeyUsage[]) => Promise<dntShim.CryptoKey>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as r from "../pkg/receiver.js";
|
|
2
2
|
export * from "../pkg/client/client.js";
|
|
3
|
-
export declare class
|
|
4
|
-
constructor(config: Omit<
|
|
3
|
+
export declare class Receiver extends r.Receiver {
|
|
4
|
+
constructor(config: Omit<r.ReceiverConfig, "crypto">);
|
|
5
5
|
}
|
|
@@ -4,7 +4,7 @@ import { Messages } from "./messages.js";
|
|
|
4
4
|
import { Schedules } from "./schedules.js";
|
|
5
5
|
import { Endpoints } from "./endpoints.js";
|
|
6
6
|
import type { Log } from "./types.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { BodyInit, HeadersInit } from "../../deps/raw.githubusercontent.com/microsoft/TypeScript/main/lib/lib.dom";
|
|
8
8
|
export declare type ClientConfig = {
|
|
9
9
|
/**
|
|
10
10
|
* Url of the qstash api server.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BodyInit, HeadersInit } from "../../deps/raw.githubusercontent.com/microsoft/TypeScript/main/lib/lib.dom";
|
|
2
2
|
export declare type UpstashRequest = {
|
|
3
3
|
/**
|
|
4
4
|
* The path to the resource.
|