@upstash/qstash 0.0.17 → 0.0.18
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/esm/pkg/receiver.js +2 -2
- package/package.json +1 -1
- package/script/pkg/receiver.js +4 -4
- package/types/pkg/receiver.d.ts +6 -4
package/esm/pkg/receiver.js
CHANGED
|
@@ -6,9 +6,9 @@ export class SignatureError extends Error {
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Receiver offers a simlpe way to verify the signature of a request.
|
|
10
10
|
*/
|
|
11
|
-
export class
|
|
11
|
+
export class Receiver {
|
|
12
12
|
constructor(config) {
|
|
13
13
|
Object.defineProperty(this, "currentSigningKey", {
|
|
14
14
|
enumerable: true,
|
package/package.json
CHANGED
package/script/pkg/receiver.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Receiver = exports.SignatureError = void 0;
|
|
4
4
|
const deps_js_1 = require("../deps.js");
|
|
5
5
|
class SignatureError extends Error {
|
|
6
6
|
constructor(message) {
|
|
@@ -10,9 +10,9 @@ class SignatureError extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
exports.SignatureError = SignatureError;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Receiver offers a simlpe way to verify the signature of a request.
|
|
14
14
|
*/
|
|
15
|
-
class
|
|
15
|
+
class Receiver {
|
|
16
16
|
constructor(config) {
|
|
17
17
|
Object.defineProperty(this, "currentSigningKey", {
|
|
18
18
|
enumerable: true,
|
|
@@ -92,4 +92,4 @@ class Consumer {
|
|
|
92
92
|
return true;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
exports.
|
|
95
|
+
exports.Receiver = Receiver;
|
package/types/pkg/receiver.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare type SubtleCrypto = typeof crypto.subtle;
|
|
|
3
3
|
/**
|
|
4
4
|
* Necessary to verify the signature of a request.
|
|
5
5
|
*/
|
|
6
|
-
export declare type
|
|
6
|
+
export declare type ReceiverConfig = {
|
|
7
7
|
/**
|
|
8
8
|
* The current signing key. Get it from `https://console.upstash.com/qstash
|
|
9
9
|
*/
|
|
@@ -25,6 +25,8 @@ export declare type VerifyRequest = {
|
|
|
25
25
|
body: string | Uint8Array;
|
|
26
26
|
/**
|
|
27
27
|
* URL of the endpoint where the request was sent to.
|
|
28
|
+
*
|
|
29
|
+
* Omit empty to disable checking the url.
|
|
28
30
|
*/
|
|
29
31
|
url?: string;
|
|
30
32
|
};
|
|
@@ -32,13 +34,13 @@ export declare class SignatureError extends Error {
|
|
|
32
34
|
constructor(message: string);
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
|
-
*
|
|
37
|
+
* Receiver offers a simlpe way to verify the signature of a request.
|
|
36
38
|
*/
|
|
37
|
-
export declare class
|
|
39
|
+
export declare class Receiver {
|
|
38
40
|
private readonly currentSigningKey;
|
|
39
41
|
private readonly nextSigningKey;
|
|
40
42
|
private readonly subtleCrypto;
|
|
41
|
-
constructor(config:
|
|
43
|
+
constructor(config: ReceiverConfig);
|
|
42
44
|
/**
|
|
43
45
|
* Verify the signature of a request.
|
|
44
46
|
*
|