@upstash/qstash 0.1.6 → 0.1.8

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.
Files changed (60) hide show
  1. package/README.md +9 -14
  2. package/esm/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/fnv32.js +0 -0
  3. package/esm/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/fnv64.js +0 -0
  4. package/esm/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/index.js +0 -0
  5. package/esm/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/util.js +0 -0
  6. package/esm/deps/deno.land/std@0.161.0/crypto/_wasm_crypto/lib/deno_std_wasm_crypto.generated.mjs +3253 -0
  7. package/esm/deps/deno.land/{std@0.149.0 → std@0.161.0/crypto}/_wasm_crypto/mod.js +0 -0
  8. package/esm/deps/deno.land/std@0.161.0/crypto/keystack.js +150 -0
  9. package/esm/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/mod.js +26 -8
  10. package/esm/deps/deno.land/std@0.161.0/crypto/timing_safe_equal.js +24 -0
  11. package/esm/deps/deno.land/std@0.161.0/crypto/util.js +27 -0
  12. package/esm/deps/deno.land/std@0.161.0/encoding/base64.js +122 -0
  13. package/esm/deps/deno.land/std@0.161.0/encoding/base64url.js +49 -0
  14. package/esm/deps/deno.land/std@0.161.0/encoding/hex.js +60 -0
  15. package/esm/deps/deno.land/std@0.161.0/fmt/colors.js +442 -0
  16. package/esm/deps/deno.land/std@0.161.0/testing/_diff.js +308 -0
  17. package/esm/deps/deno.land/std@0.161.0/testing/_format.js +23 -0
  18. package/esm/deps/deno.land/std@0.161.0/testing/asserts.js +615 -0
  19. package/esm/pkg/client/client.js +1 -1
  20. package/package.json +2 -2
  21. package/script/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/fnv32.js +0 -0
  22. package/script/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/fnv64.js +0 -0
  23. package/script/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/index.js +0 -0
  24. package/script/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/util.js +0 -0
  25. package/script/deps/deno.land/std@0.161.0/crypto/_wasm_crypto/lib/deno_std_wasm_crypto.generated.mjs +3261 -0
  26. package/script/deps/deno.land/{std@0.149.0 → std@0.161.0/crypto}/_wasm_crypto/mod.js +0 -0
  27. package/script/deps/deno.land/std@0.161.0/crypto/keystack.js +177 -0
  28. package/script/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/mod.js +30 -10
  29. package/script/deps/deno.land/std@0.161.0/crypto/timing_safe_equal.js +28 -0
  30. package/script/deps/deno.land/std@0.161.0/crypto/util.js +54 -0
  31. package/script/deps/deno.land/std@0.161.0/encoding/base64.js +127 -0
  32. package/script/deps/deno.land/std@0.161.0/encoding/base64url.js +77 -0
  33. package/script/deps/deno.land/std@0.161.0/encoding/hex.js +65 -0
  34. package/script/deps/deno.land/std@0.161.0/fmt/colors.js +516 -0
  35. package/script/deps/deno.land/std@0.161.0/testing/_diff.js +314 -0
  36. package/script/deps/deno.land/std@0.161.0/testing/_format.js +50 -0
  37. package/script/deps/deno.land/std@0.161.0/testing/asserts.js +641 -0
  38. package/script/pkg/client/client.js +1 -1
  39. package/types/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/fnv32.d.ts +0 -0
  40. package/types/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/fnv64.d.ts +0 -0
  41. package/types/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/index.d.ts +0 -0
  42. package/types/deps/deno.land/{std@0.149.0 → std@0.161.0}/crypto/_fnv/util.d.ts +0 -0
  43. package/types/deps/deno.land/{std@0.149.0 → std@0.161.0/crypto}/_wasm_crypto/lib/deno_std_wasm_crypto.generated.d.mts +0 -0
  44. package/types/deps/deno.land/{std@0.149.0 → std@0.161.0/crypto}/_wasm_crypto/mod.d.ts +0 -0
  45. package/types/deps/deno.land/std@0.161.0/crypto/keystack.d.ts +47 -0
  46. package/types/deps/deno.land/std@0.161.0/crypto/mod.d.ts +56 -0
  47. package/types/deps/deno.land/std@0.161.0/crypto/timing_safe_equal.d.ts +3 -0
  48. package/types/deps/deno.land/std@0.161.0/crypto/util.d.ts +16 -0
  49. package/types/deps/deno.land/std@0.161.0/encoding/base64.d.ts +11 -0
  50. package/types/deps/deno.land/std@0.161.0/encoding/base64url.d.ts +10 -0
  51. package/types/deps/deno.land/std@0.161.0/encoding/hex.d.ts +7 -0
  52. package/types/deps/deno.land/std@0.161.0/fmt/colors.d.ts +270 -0
  53. package/types/deps/deno.land/std@0.161.0/testing/_diff.d.ts +26 -0
  54. package/types/deps/deno.land/std@0.161.0/testing/_format.d.ts +1 -0
  55. package/types/deps/deno.land/std@0.161.0/testing/asserts.d.ts +160 -0
  56. package/types/pkg/client/messages.d.ts +1 -1
  57. package/types/pkg/receiver.d.ts +1 -1
  58. package/esm/deps/deno.land/std@0.149.0/_wasm_crypto/lib/deno_std_wasm_crypto.generated.mjs +0 -3159
  59. package/script/deps/deno.land/std@0.149.0/_wasm_crypto/lib/deno_std_wasm_crypto.generated.mjs +0 -3167
  60. package/types/deps/deno.land/std@0.149.0/crypto/mod.d.ts +0 -53
@@ -0,0 +1,47 @@
1
+ /** Types of data that can be signed cryptographically. */
2
+ export declare type Data = string | number[] | ArrayBuffer | Uint8Array;
3
+ /** Types of keys that can be used to sign data. */
4
+ export declare type Key = string | number[] | ArrayBuffer | Uint8Array;
5
+ /** A cryptographic key chain which allows signing of data to prevent tampering,
6
+ * but also allows for easy key rotation without needing to re-sign the data.
7
+ *
8
+ * Data is signed as SHA256 HMAC.
9
+ *
10
+ * This was inspired by [keygrip](https://github.com/crypto-utils/keygrip/).
11
+ *
12
+ * ### Example
13
+ *
14
+ * ```ts
15
+ * import { KeyStack } from "https://deno.land/std@$STD_VERSION/crypto/keystack.ts";
16
+ *
17
+ * const keyStack = new KeyStack(["hello", "world"]);
18
+ * const digest = await keyStack.sign("some data");
19
+ *
20
+ * const rotatedStack = new KeyStack(["deno", "says", "hello", "world"]);
21
+ * await rotatedStack.verify("some data", digest); // true
22
+ * ```
23
+ */
24
+ export declare class KeyStack {
25
+ #private;
26
+ get length(): number;
27
+ /** A class which accepts an array of keys that are used to sign and verify
28
+ * data and allows easy key rotation without invalidation of previously signed
29
+ * data.
30
+ *
31
+ * @param keys An iterable of keys, of which the index 0 will be used to sign
32
+ * data, but verification can happen against any key.
33
+ */
34
+ constructor(keys: Iterable<Key>);
35
+ /** Take `data` and return a SHA256 HMAC digest that uses the current 0 index
36
+ * of the `keys` passed to the constructor. This digest is in the form of a
37
+ * URL safe base64 encoded string. */
38
+ sign(data: Data): Promise<string>;
39
+ /** Given `data` and a `digest`, verify that one of the `keys` provided the
40
+ * constructor was used to generate the `digest`. Returns `true` if one of
41
+ * the keys was used, otherwise `false`. */
42
+ verify(data: Data, digest: string): Promise<boolean>;
43
+ /** Given `data` and a `digest`, return the current index of the key in the
44
+ * `keys` passed the constructor that was used to generate the digest. If no
45
+ * key can be found, the method returns `-1`. */
46
+ indexOf(data: Data, digest: string): Promise<number>;
47
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Extensions to the
3
+ * [Web Crypto](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API)
4
+ * supporting additional encryption APIs.
5
+ *
6
+ * Provides additional digest algorithms that are not part of the WebCrypto
7
+ * standard as well as a `subtle.digest` and `subtle.digestSync` methods. It
8
+ * also provide a `subtle.timingSafeEqual()` method to compare array buffers
9
+ * or data views in a way that isn't prone to timing based attacks.
10
+ *
11
+ * The "polyfill" delegates to `WebCrypto` where possible.
12
+ *
13
+ * The {@linkcode KeyStack} export implements the {@linkcode KeyRing} interface
14
+ * for managing rotatable keys for signing data to prevent tampering, like with
15
+ * HTTP cookies.
16
+ *
17
+ * @module
18
+ */
19
+ import * as dntShim from "../../../../_dnt.shims.js";
20
+ import { DigestAlgorithm as WasmDigestAlgorithm } from "./_wasm_crypto/mod.js";
21
+ export { type Data, type Key, KeyStack } from "./keystack.js";
22
+ export { toHashString } from "./util.js";
23
+ /** Extensions to the web standard `SubtleCrypto` interface. */
24
+ export interface StdSubtleCrypto extends dntShim.SubtleCrypto {
25
+ /**
26
+ * Returns a new `Promise` object that will digest `data` using the specified
27
+ * `AlgorithmIdentifier`.
28
+ */
29
+ digest(algorithm: DigestAlgorithm, data: dntShim.BufferSource | AsyncIterable<dntShim.BufferSource> | Iterable<dntShim.BufferSource>): Promise<ArrayBuffer>;
30
+ /**
31
+ * Returns a ArrayBuffer with the result of digesting `data` using the
32
+ * specified `AlgorithmIdentifier`.
33
+ */
34
+ digestSync(algorithm: DigestAlgorithm, data: dntShim.BufferSource | Iterable<dntShim.BufferSource>): ArrayBuffer;
35
+ /** Compare to array buffers or data views in a way that timing based attacks
36
+ * cannot gain information about the platform. */
37
+ timingSafeEqual(a: ArrayBufferLike | DataView, b: ArrayBufferLike | DataView): boolean;
38
+ }
39
+ /** Extensions to the Web {@linkcode Crypto} interface. */
40
+ export interface StdCrypto extends dntShim.Crypto {
41
+ readonly subtle: StdSubtleCrypto;
42
+ }
43
+ /**
44
+ * An wrapper for WebCrypto adding support for additional non-standard
45
+ * algorithms, but delegating to the runtime WebCrypto implementation whenever
46
+ * possible.
47
+ */
48
+ declare const stdCrypto: StdCrypto;
49
+ export declare type FNVAlgorithms = "FNV32" | "FNV32A" | "FNV64" | "FNV64A";
50
+ export declare type DigestAlgorithmName = WasmDigestAlgorithm | FNVAlgorithms;
51
+ export declare type DigestAlgorithmObject = {
52
+ name: DigestAlgorithmName;
53
+ length?: number;
54
+ };
55
+ export declare type DigestAlgorithm = DigestAlgorithmName | DigestAlgorithmObject;
56
+ export { stdCrypto as crypto };
@@ -0,0 +1,3 @@
1
+ /** Compare to array buffers or data views in a way that timing based attacks
2
+ * cannot gain information about the platform. */
3
+ export declare function timingSafeEqual(a: ArrayBufferView | ArrayBufferLike | DataView, b: ArrayBufferView | ArrayBufferLike | DataView): boolean;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Converts a hash to a string with a given encoding.
3
+ * @example
4
+ * ```ts
5
+ * import { crypto, toHashString } from "https://deno.land/std@$STD_VERSION/crypto/mod.ts";
6
+ *
7
+ * const hash = await crypto.subtle.digest("SHA-384", new TextEncoder().encode("You hear that Mr. Anderson?"));
8
+ *
9
+ * // Hex encoding by default
10
+ * console.log(toHashString(hash));
11
+ *
12
+ * // Or with base64 encoding
13
+ * console.log(toHashString(hash, "base64"));
14
+ * ```
15
+ */
16
+ export declare function toHashString(hash: ArrayBuffer, encoding?: "hex" | "base64"): string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
3
+ * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation
4
+ * @param data
5
+ */
6
+ export declare function encode(data: ArrayBuffer | string): string;
7
+ /**
8
+ * Decodes a given RFC4648 base64 encoded string
9
+ * @param b64
10
+ */
11
+ export declare function decode(b64: string): Uint8Array;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Encodes a given ArrayBuffer or string into a base64url representation
3
+ * @param data
4
+ */
5
+ export declare function encode(data: ArrayBuffer | string): string;
6
+ /**
7
+ * Converts given base64url encoded data back to original
8
+ * @param b64url
9
+ */
10
+ export declare function decode(b64url: string): Uint8Array;
@@ -0,0 +1,7 @@
1
+ /** Encodes `src` into `src.length * 2` bytes. */
2
+ export declare function encode(src: Uint8Array): Uint8Array;
3
+ /**
4
+ * Decodes `src` into `src.length / 2` bytes.
5
+ * If the input is malformed, an error will be thrown.
6
+ */
7
+ export declare function decode(src: Uint8Array): Uint8Array;
@@ -0,0 +1,270 @@
1
+ /** RGB 8-bits per channel. Each in range `0->255` or `0x00->0xff` */
2
+ interface Rgb {
3
+ r: number;
4
+ g: number;
5
+ b: number;
6
+ }
7
+ /**
8
+ * Set changing text color to enabled or disabled
9
+ * @param value
10
+ */
11
+ export declare function setColorEnabled(value: boolean): void;
12
+ /** Get whether text color change is enabled or disabled. */
13
+ export declare function getColorEnabled(): boolean;
14
+ /**
15
+ * Reset the text modified
16
+ * @param str text to reset
17
+ */
18
+ export declare function reset(str: string): string;
19
+ /**
20
+ * Make the text bold.
21
+ * @param str text to make bold
22
+ */
23
+ export declare function bold(str: string): string;
24
+ /**
25
+ * The text emits only a small amount of light.
26
+ * @param str text to dim
27
+ */
28
+ export declare function dim(str: string): string;
29
+ /**
30
+ * Make the text italic.
31
+ * @param str text to make italic
32
+ */
33
+ export declare function italic(str: string): string;
34
+ /**
35
+ * Make the text underline.
36
+ * @param str text to underline
37
+ */
38
+ export declare function underline(str: string): string;
39
+ /**
40
+ * Invert background color and text color.
41
+ * @param str text to invert its color
42
+ */
43
+ export declare function inverse(str: string): string;
44
+ /**
45
+ * Make the text hidden.
46
+ * @param str text to hide
47
+ */
48
+ export declare function hidden(str: string): string;
49
+ /**
50
+ * Put horizontal line through the center of the text.
51
+ * @param str text to strike through
52
+ */
53
+ export declare function strikethrough(str: string): string;
54
+ /**
55
+ * Set text color to black.
56
+ * @param str text to make black
57
+ */
58
+ export declare function black(str: string): string;
59
+ /**
60
+ * Set text color to red.
61
+ * @param str text to make red
62
+ */
63
+ export declare function red(str: string): string;
64
+ /**
65
+ * Set text color to green.
66
+ * @param str text to make green
67
+ */
68
+ export declare function green(str: string): string;
69
+ /**
70
+ * Set text color to yellow.
71
+ * @param str text to make yellow
72
+ */
73
+ export declare function yellow(str: string): string;
74
+ /**
75
+ * Set text color to blue.
76
+ * @param str text to make blue
77
+ */
78
+ export declare function blue(str: string): string;
79
+ /**
80
+ * Set text color to magenta.
81
+ * @param str text to make magenta
82
+ */
83
+ export declare function magenta(str: string): string;
84
+ /**
85
+ * Set text color to cyan.
86
+ * @param str text to make cyan
87
+ */
88
+ export declare function cyan(str: string): string;
89
+ /**
90
+ * Set text color to white.
91
+ * @param str text to make white
92
+ */
93
+ export declare function white(str: string): string;
94
+ /**
95
+ * Set text color to gray.
96
+ * @param str text to make gray
97
+ */
98
+ export declare function gray(str: string): string;
99
+ /**
100
+ * Set text color to bright black.
101
+ * @param str text to make bright-black
102
+ */
103
+ export declare function brightBlack(str: string): string;
104
+ /**
105
+ * Set text color to bright red.
106
+ * @param str text to make bright-red
107
+ */
108
+ export declare function brightRed(str: string): string;
109
+ /**
110
+ * Set text color to bright green.
111
+ * @param str text to make bright-green
112
+ */
113
+ export declare function brightGreen(str: string): string;
114
+ /**
115
+ * Set text color to bright yellow.
116
+ * @param str text to make bright-yellow
117
+ */
118
+ export declare function brightYellow(str: string): string;
119
+ /**
120
+ * Set text color to bright blue.
121
+ * @param str text to make bright-blue
122
+ */
123
+ export declare function brightBlue(str: string): string;
124
+ /**
125
+ * Set text color to bright magenta.
126
+ * @param str text to make bright-magenta
127
+ */
128
+ export declare function brightMagenta(str: string): string;
129
+ /**
130
+ * Set text color to bright cyan.
131
+ * @param str text to make bright-cyan
132
+ */
133
+ export declare function brightCyan(str: string): string;
134
+ /**
135
+ * Set text color to bright white.
136
+ * @param str text to make bright-white
137
+ */
138
+ export declare function brightWhite(str: string): string;
139
+ /**
140
+ * Set background color to black.
141
+ * @param str text to make its background black
142
+ */
143
+ export declare function bgBlack(str: string): string;
144
+ /**
145
+ * Set background color to red.
146
+ * @param str text to make its background red
147
+ */
148
+ export declare function bgRed(str: string): string;
149
+ /**
150
+ * Set background color to green.
151
+ * @param str text to make its background green
152
+ */
153
+ export declare function bgGreen(str: string): string;
154
+ /**
155
+ * Set background color to yellow.
156
+ * @param str text to make its background yellow
157
+ */
158
+ export declare function bgYellow(str: string): string;
159
+ /**
160
+ * Set background color to blue.
161
+ * @param str text to make its background blue
162
+ */
163
+ export declare function bgBlue(str: string): string;
164
+ /**
165
+ * Set background color to magenta.
166
+ * @param str text to make its background magenta
167
+ */
168
+ export declare function bgMagenta(str: string): string;
169
+ /**
170
+ * Set background color to cyan.
171
+ * @param str text to make its background cyan
172
+ */
173
+ export declare function bgCyan(str: string): string;
174
+ /**
175
+ * Set background color to white.
176
+ * @param str text to make its background white
177
+ */
178
+ export declare function bgWhite(str: string): string;
179
+ /**
180
+ * Set background color to bright black.
181
+ * @param str text to make its background bright-black
182
+ */
183
+ export declare function bgBrightBlack(str: string): string;
184
+ /**
185
+ * Set background color to bright red.
186
+ * @param str text to make its background bright-red
187
+ */
188
+ export declare function bgBrightRed(str: string): string;
189
+ /**
190
+ * Set background color to bright green.
191
+ * @param str text to make its background bright-green
192
+ */
193
+ export declare function bgBrightGreen(str: string): string;
194
+ /**
195
+ * Set background color to bright yellow.
196
+ * @param str text to make its background bright-yellow
197
+ */
198
+ export declare function bgBrightYellow(str: string): string;
199
+ /**
200
+ * Set background color to bright blue.
201
+ * @param str text to make its background bright-blue
202
+ */
203
+ export declare function bgBrightBlue(str: string): string;
204
+ /**
205
+ * Set background color to bright magenta.
206
+ * @param str text to make its background bright-magenta
207
+ */
208
+ export declare function bgBrightMagenta(str: string): string;
209
+ /**
210
+ * Set background color to bright cyan.
211
+ * @param str text to make its background bright-cyan
212
+ */
213
+ export declare function bgBrightCyan(str: string): string;
214
+ /**
215
+ * Set background color to bright white.
216
+ * @param str text to make its background bright-white
217
+ */
218
+ export declare function bgBrightWhite(str: string): string;
219
+ /**
220
+ * Set text color using paletted 8bit colors.
221
+ * https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
222
+ * @param str text color to apply paletted 8bit colors to
223
+ * @param color code
224
+ */
225
+ export declare function rgb8(str: string, color: number): string;
226
+ /**
227
+ * Set background color using paletted 8bit colors.
228
+ * https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
229
+ * @param str text color to apply paletted 8bit background colors to
230
+ * @param color code
231
+ */
232
+ export declare function bgRgb8(str: string, color: number): string;
233
+ /**
234
+ * Set text color using 24bit rgb.
235
+ * `color` can be a number in range `0x000000` to `0xffffff` or
236
+ * an `Rgb`.
237
+ *
238
+ * To produce the color magenta:
239
+ *
240
+ * ```ts
241
+ * import { rgb24 } from "https://deno.land/std@$STD_VERSION/fmt/colors.ts";
242
+ * rgb24("foo", 0xff00ff);
243
+ * rgb24("foo", {r: 255, g: 0, b: 255});
244
+ * ```
245
+ * @param str text color to apply 24bit rgb to
246
+ * @param color code
247
+ */
248
+ export declare function rgb24(str: string, color: number | Rgb): string;
249
+ /**
250
+ * Set background color using 24bit rgb.
251
+ * `color` can be a number in range `0x000000` to `0xffffff` or
252
+ * an `Rgb`.
253
+ *
254
+ * To produce the color magenta:
255
+ *
256
+ * ```ts
257
+ * import { bgRgb24 } from "https://deno.land/std@$STD_VERSION/fmt/colors.ts";
258
+ * bgRgb24("foo", 0xff00ff);
259
+ * bgRgb24("foo", {r: 255, g: 0, b: 255});
260
+ * ```
261
+ * @param str text color to apply 24bit rgb to
262
+ * @param color code
263
+ */
264
+ export declare function bgRgb24(str: string, color: number | Rgb): string;
265
+ /**
266
+ * Remove ANSI escape codes from the string.
267
+ * @param string to remove ANSI escape codes from
268
+ */
269
+ export declare function stripColor(string: string): string;
270
+ export {};
@@ -0,0 +1,26 @@
1
+ export declare enum DiffType {
2
+ removed = "removed",
3
+ common = "common",
4
+ added = "added"
5
+ }
6
+ export interface DiffResult<T> {
7
+ type: DiffType;
8
+ value: T;
9
+ details?: Array<DiffResult<T>>;
10
+ }
11
+ /**
12
+ * Renders the differences between the actual and expected values
13
+ * @param A Actual value
14
+ * @param B Expected value
15
+ */
16
+ export declare function diff<T>(A: T[], B: T[]): Array<DiffResult<T>>;
17
+ /**
18
+ * Renders the differences between the actual and expected strings
19
+ * Partially inspired from https://github.com/kpdecker/jsdiff
20
+ * @param A Actual string
21
+ * @param B Expected string
22
+ */
23
+ export declare function diffstr(A: string, B: string): DiffResult<string>[];
24
+ export declare function buildMessage(diffResult: ReadonlyArray<DiffResult<string>>, { stringDiff }?: {
25
+ stringDiff?: boolean | undefined;
26
+ }): string[];
@@ -0,0 +1 @@
1
+ export declare function format(v: unknown): string;
@@ -0,0 +1,160 @@
1
+ export declare class AssertionError extends Error {
2
+ name: string;
3
+ constructor(message: string);
4
+ }
5
+ /**
6
+ * Deep equality comparison used in assertions
7
+ * @param c actual value
8
+ * @param d expected value
9
+ */
10
+ export declare function equal(c: unknown, d: unknown): boolean;
11
+ /** Make an assertion, error will be thrown if `expr` does not have truthy value. */
12
+ export declare function assert(expr: unknown, msg?: string): asserts expr;
13
+ /** Make an assertion, error will be thrown if `expr` have truthy value. */
14
+ declare type Falsy = false | 0 | 0n | "" | null | undefined;
15
+ export declare function assertFalse(expr: unknown, msg?: string): asserts expr is Falsy;
16
+ /**
17
+ * Make an assertion that `actual` and `expected` are equal, deeply. If not
18
+ * deeply equal, then throw.
19
+ *
20
+ * Type parameter can be specified to ensure values under comparison have the same type.
21
+ * For example:
22
+ * ```ts
23
+ * import { assertEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
24
+ *
25
+ * assertEquals<number>(1, 2)
26
+ * ```
27
+ */
28
+ export declare function assertEquals<T>(actual: T, expected: T, msg?: string): void;
29
+ /**
30
+ * Make an assertion that `actual` and `expected` are not equal, deeply.
31
+ * If not then throw.
32
+ *
33
+ * Type parameter can be specified to ensure values under comparison have the same type.
34
+ * For example:
35
+ * ```ts
36
+ * import { assertNotEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
37
+ *
38
+ * assertNotEquals<number>(1, 2)
39
+ * ```
40
+ */
41
+ export declare function assertNotEquals<T>(actual: T, expected: T, msg?: string): void;
42
+ /**
43
+ * Make an assertion that `actual` and `expected` are strictly equal. If
44
+ * not then throw.
45
+ *
46
+ * ```ts
47
+ * import { assertStrictEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
48
+ *
49
+ * assertStrictEquals(1, 2)
50
+ * ```
51
+ */
52
+ export declare function assertStrictEquals<T>(actual: unknown, expected: T, msg?: string): asserts actual is T;
53
+ /**
54
+ * Make an assertion that `actual` and `expected` are not strictly equal.
55
+ * If the values are strictly equal then throw.
56
+ *
57
+ * ```ts
58
+ * import { assertNotStrictEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
59
+ *
60
+ * assertNotStrictEquals(1, 1)
61
+ * ```
62
+ */
63
+ export declare function assertNotStrictEquals<T>(actual: T, expected: T, msg?: string): void;
64
+ /**
65
+ * Make an assertion that `actual` and `expected` are almost equal numbers through
66
+ * a given tolerance. It can be used to take into account IEEE-754 double-precision
67
+ * floating-point representation limitations.
68
+ * If the values are not almost equal then throw.
69
+ *
70
+ * ```ts
71
+ * import { assertAlmostEquals, assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
72
+ *
73
+ * assertAlmostEquals(0.1, 0.2);
74
+ *
75
+ * // Using a custom tolerance value
76
+ * assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16);
77
+ * assertThrows(() => assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17));
78
+ * ```
79
+ */
80
+ export declare function assertAlmostEquals(actual: number, expected: number, tolerance?: number, msg?: string): void;
81
+ declare type AnyConstructor = new (...args: any[]) => any;
82
+ declare type GetConstructorType<T extends AnyConstructor> = T extends new (...args: any) => infer C ? C : never;
83
+ /**
84
+ * Make an assertion that `obj` is an instance of `type`.
85
+ * If not then throw.
86
+ */
87
+ export declare function assertInstanceOf<T extends AnyConstructor>(actual: unknown, expectedType: T, msg?: string): asserts actual is GetConstructorType<T>;
88
+ /**
89
+ * Make an assertion that `obj` is not an instance of `type`.
90
+ * If so, then throw.
91
+ */
92
+ export declare function assertNotInstanceOf<A, T>(actual: A, unexpectedType: new (...args: any[]) => T, msg?: string): asserts actual is Exclude<A, T>;
93
+ /**
94
+ * Make an assertion that actual is not null or undefined.
95
+ * If not then throw.
96
+ */
97
+ export declare function assertExists<T>(actual: T, msg?: string): asserts actual is NonNullable<T>;
98
+ /**
99
+ * Make an assertion that actual includes expected. If not
100
+ * then throw.
101
+ */
102
+ export declare function assertStringIncludes(actual: string, expected: string, msg?: string): void;
103
+ /**
104
+ * Make an assertion that `actual` includes the `expected` values.
105
+ * If not then an error will be thrown.
106
+ *
107
+ * Type parameter can be specified to ensure values under comparison have the same type.
108
+ * For example:
109
+ *
110
+ * ```ts
111
+ * import { assertArrayIncludes } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
112
+ *
113
+ * assertArrayIncludes<number>([1, 2], [2])
114
+ * ```
115
+ */
116
+ export declare function assertArrayIncludes<T>(actual: ArrayLike<T>, expected: ArrayLike<T>, msg?: string): void;
117
+ /**
118
+ * Make an assertion that `actual` match RegExp `expected`. If not
119
+ * then throw.
120
+ */
121
+ export declare function assertMatch(actual: string, expected: RegExp, msg?: string): void;
122
+ /**
123
+ * Make an assertion that `actual` not match RegExp `expected`. If match
124
+ * then throw.
125
+ */
126
+ export declare function assertNotMatch(actual: string, expected: RegExp, msg?: string): void;
127
+ /**
128
+ * Make an assertion that `actual` object is a subset of `expected` object, deeply.
129
+ * If not, then throw.
130
+ */
131
+ export declare function assertObjectMatch(actual: Record<PropertyKey, any>, expected: Record<PropertyKey, unknown>): void;
132
+ /**
133
+ * Forcefully throws a failed assertion
134
+ */
135
+ export declare function fail(msg?: string): never;
136
+ /**
137
+ * Make an assertion that `error` is an `Error`.
138
+ * If not then an error will be thrown.
139
+ * An error class and a string that should be included in the
140
+ * error message can also be asserted.
141
+ */
142
+ export declare function assertIsError<E extends Error = Error>(error: unknown, ErrorClass?: new (...args: any[]) => E, msgIncludes?: string, msg?: string): asserts error is E;
143
+ /** Executes a function, expecting it to throw. If it does not, then it
144
+ * throws. */
145
+ export declare function assertThrows(fn: () => unknown, msg?: string): unknown;
146
+ /** Executes a function, expecting it to throw. If it does not, then it
147
+ * throws. An error class and a string that should be included in the
148
+ * error message can also be asserted. */
149
+ export declare function assertThrows<E extends Error = Error>(fn: () => unknown, ErrorClass: new (...args: any[]) => E, msgIncludes?: string, msg?: string): E;
150
+ /** Executes a function which returns a promise, expecting it to reject. */
151
+ export declare function assertRejects(fn: () => PromiseLike<unknown>, msg?: string): Promise<unknown>;
152
+ /** Executes a function which returns a promise, expecting it to reject.
153
+ * If it does not, then it throws. An error class and a string that should be
154
+ * included in the error message can also be asserted. */
155
+ export declare function assertRejects<E extends Error = Error>(fn: () => PromiseLike<unknown>, ErrorClass: new (...args: any[]) => E, msgIncludes?: string, msg?: string): Promise<E>;
156
+ /** Use this to stub out methods that will throw when invoked. */
157
+ export declare function unimplemented(msg?: string): never;
158
+ /** Use this to assert unreachable code. */
159
+ export declare function unreachable(): never;
160
+ export {};
@@ -7,7 +7,7 @@ export declare type CancelMessageRequest = {
7
7
  id: string;
8
8
  };
9
9
  export declare type Message = {
10
- messaged: string;
10
+ messageId: string;
11
11
  header: Record<string, string[]>;
12
12
  body: string;
13
13
  } & ({
@@ -1,4 +1,4 @@
1
- import { crypto } from "../deps/deno.land/std@0.149.0/crypto/mod.js";
1
+ import { crypto } from "../deps/deno.land/std@0.161.0/crypto/mod.js";
2
2
  export declare type SubtleCrypto = typeof crypto.subtle;
3
3
  /**
4
4
  * Necessary to verify the signature of a request.