@arcjet/decorate 1.9.0 → 1.10.0-rc.0
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/dist/index.d.ts +20 -21
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ArcjetDecision } from "@arcjet/protocol";
|
|
2
|
-
|
|
3
2
|
//#region src/index.d.ts
|
|
4
3
|
interface HeaderLike {
|
|
5
4
|
get(name: string): string | null;
|
|
@@ -16,28 +15,28 @@ interface OutgoingMessageLike {
|
|
|
16
15
|
setHeader: (name: string, value: ReadonlyArray<string> | number | string) => unknown;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
|
-
* Decorable value.
|
|
20
|
-
*
|
|
21
|
-
* Something that looks like `Headers` (Fetch),
|
|
22
|
-
* `OutgoingMessage` (Node.js), or
|
|
23
|
-
* `Response` (Fetch).
|
|
24
|
-
*/
|
|
18
|
+
* Decorable value.
|
|
19
|
+
*
|
|
20
|
+
* Something that looks like `Headers` (Fetch),
|
|
21
|
+
* `OutgoingMessage` (Node.js), or
|
|
22
|
+
* `Response` (Fetch).
|
|
23
|
+
*/
|
|
25
24
|
type ArcjetCanDecorate = HeaderLike | OutgoingMessageLike | ResponseLike;
|
|
26
25
|
/**
|
|
27
|
-
* Decorate something based on an Arcjet decision with rate limit headers.
|
|
28
|
-
*
|
|
29
|
-
* Sets `RateLimit-Policy` and `RateLimit` and conform to the
|
|
30
|
-
* [Rate Limit fields for
|
|
31
|
-
* HTTP](https://ietf-wg-httpapi.github.io/ratelimit-headers/draft-ietf-httpapi-ratelimit-headers.html)
|
|
32
|
-
* draft specification.
|
|
33
|
-
*
|
|
34
|
-
* @param value
|
|
35
|
-
* Decorable value.
|
|
36
|
-
* @param decision
|
|
37
|
-
* Decision from `protect()`.
|
|
38
|
-
* @returns
|
|
39
|
-
* Nothing.
|
|
40
|
-
*/
|
|
26
|
+
* Decorate something based on an Arcjet decision with rate limit headers.
|
|
27
|
+
*
|
|
28
|
+
* Sets `RateLimit-Policy` and `RateLimit` and conform to the
|
|
29
|
+
* [Rate Limit fields for
|
|
30
|
+
* HTTP](https://ietf-wg-httpapi.github.io/ratelimit-headers/draft-ietf-httpapi-ratelimit-headers.html)
|
|
31
|
+
* draft specification.
|
|
32
|
+
*
|
|
33
|
+
* @param value
|
|
34
|
+
* Decorable value.
|
|
35
|
+
* @param decision
|
|
36
|
+
* Decision from `protect()`.
|
|
37
|
+
* @returns
|
|
38
|
+
* Nothing.
|
|
39
|
+
*/
|
|
41
40
|
declare function setRateLimitHeaders(value: ArcjetCanDecorate, decision: ArcjetDecision): void;
|
|
42
41
|
//#endregion
|
|
43
42
|
export { ArcjetCanDecorate, setRateLimitHeaders };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcjet/decorate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0-rc.0",
|
|
4
4
|
"description": "Arcjet utilities for decorating responses with information",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arcjet",
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsdown",
|
|
45
|
-
"typecheck": "
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
46
|
"test-api": "node --test -- test/*.test.ts",
|
|
47
47
|
"test-coverage": "node --experimental-test-coverage --test -- test/*.test.ts",
|
|
48
48
|
"test": "npm run build && npm run test-coverage"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@arcjet/protocol": "1.
|
|
52
|
-
"@arcjet/sprintf": "1.
|
|
51
|
+
"@arcjet/protocol": "1.10.0-rc.0",
|
|
52
|
+
"@arcjet/sprintf": "1.10.0-rc.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/node": "22.
|
|
56
|
-
"tsdown": "0.22.
|
|
57
|
-
"typescript": "
|
|
55
|
+
"@types/node": "22.20.1",
|
|
56
|
+
"tsdown": "0.22.7",
|
|
57
|
+
"typescript": "7.0.2"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=22.21.0 <23 || >=24.5.0"
|