@encore.dev/sdk 2.0.0-beta.14 → 2.0.0-beta.16
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 +144 -90
- package/app_meta.ts +56 -54
- package/config/config.test.ts +47 -13
- package/config/config.ts +60 -57
- package/config/secrets.ts +47 -50
- package/config/value.ts +23 -26
- package/cron/mod.test.ts +12 -0
- package/cron/mod.ts +37 -22
- package/dist/app_meta.d.ts +52 -50
- package/dist/app_meta.d.ts.map +1 -1
- package/dist/app_meta.js +2 -2
- package/dist/app_meta.js.map +1 -1
- package/dist/config/config.d.ts +58 -55
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +8 -9
- package/dist/config/config.js.map +1 -1
- package/dist/config/secrets.d.ts +45 -50
- package/dist/config/secrets.d.ts.map +1 -1
- package/dist/config/secrets.js +11 -9
- package/dist/config/secrets.js.map +1 -1
- package/dist/config/value.d.ts +20 -23
- package/dist/config/value.d.ts.map +1 -1
- package/dist/config/value.js +20 -23
- package/dist/config/value.js.map +1 -1
- package/dist/cron/mod.d.ts +34 -20
- package/dist/cron/mod.d.ts.map +1 -1
- package/dist/cron/mod.js +13 -13
- package/dist/cron/mod.js.map +1 -1
- package/dist/frontends/mod.d.ts +20 -19
- package/dist/frontends/mod.d.ts.map +1 -1
- package/dist/frontends/mod.js +20 -19
- package/dist/frontends/mod.js.map +1 -1
- package/dist/gateway/errors.d.ts +28 -30
- package/dist/gateway/errors.d.ts.map +1 -1
- package/dist/gateway/errors.js +29 -31
- package/dist/gateway/errors.js.map +1 -1
- package/dist/gateway/match.d.ts +54 -54
- package/dist/gateway/match.d.ts.map +1 -1
- package/dist/gateway/match.js +56 -56
- package/dist/gateway/match.js.map +1 -1
- package/dist/gateway/middleware.d.ts +62 -64
- package/dist/gateway/middleware.d.ts.map +1 -1
- package/dist/gateway/middleware.js +1 -1
- package/dist/gateway/middleware.js.map +1 -1
- package/dist/gateway/mod.d.ts +64 -67
- package/dist/gateway/mod.d.ts.map +1 -1
- package/dist/gateway/mod.js +72 -76
- package/dist/gateway/mod.js.map +1 -1
- package/dist/gateway/request.d.ts +138 -134
- package/dist/gateway/request.d.ts.map +1 -1
- package/dist/gateway/request.js +117 -108
- package/dist/gateway/request.js.map +1 -1
- package/dist/gateway/serve.d.ts +29 -34
- package/dist/gateway/serve.d.ts.map +1 -1
- package/dist/gateway/serve.js +51 -56
- package/dist/gateway/serve.js.map +1 -1
- package/dist/gateways/mod.d.ts +23 -21
- package/dist/gateways/mod.d.ts.map +1 -1
- package/dist/gateways/mod.js +25 -23
- package/dist/gateways/mod.js.map +1 -1
- package/dist/internal/otel/http.d.ts +4 -2
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +32 -5
- package/dist/internal/otel/http.js.map +1 -1
- package/dist/internal/runtime/napi/napi.cjs +6 -5
- package/dist/internal/runtime/napi/napi.d.cts +58 -16
- package/dist/internal/runtime/shutdown.d.ts +75 -57
- package/dist/internal/runtime/shutdown.d.ts.map +1 -1
- package/dist/internal/runtime/shutdown.js +88 -84
- package/dist/internal/runtime/shutdown.js.map +1 -1
- package/dist/log/logger.d.ts +43 -37
- package/dist/log/logger.d.ts.map +1 -1
- package/dist/log/logger.js +26 -25
- package/dist/log/logger.js.map +1 -1
- package/dist/metrics/mod.d.ts +133 -114
- package/dist/metrics/mod.d.ts.map +1 -1
- package/dist/metrics/mod.js +109 -101
- package/dist/metrics/mod.js.map +1 -1
- package/dist/otel.d.ts +6 -3
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +6 -3
- package/dist/otel.js.map +1 -1
- package/dist/pubsub/subscription.d.ts +88 -116
- package/dist/pubsub/subscription.d.ts.map +1 -1
- package/dist/pubsub/subscription.js +14 -17
- package/dist/pubsub/subscription.js.map +1 -1
- package/dist/pubsub/topic.d.ts +86 -113
- package/dist/pubsub/topic.d.ts.map +1 -1
- package/dist/pubsub/topic.js +68 -82
- package/dist/pubsub/topic.js.map +1 -1
- package/dist/redaction/mod.d.ts +62 -0
- package/dist/redaction/mod.d.ts.map +1 -0
- package/dist/redaction/mod.js +102 -0
- package/dist/redaction/mod.js.map +1 -0
- package/dist/reqctx/mod.d.ts +83 -86
- package/dist/reqctx/mod.d.ts.map +1 -1
- package/dist/reqctx/mod.js +39 -41
- package/dist/reqctx/mod.js.map +1 -1
- package/dist/services/index.d.ts +76 -75
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +73 -71
- package/dist/services/index.js.map +1 -1
- package/dist/shutdown/mod.d.ts +26 -25
- package/dist/shutdown/mod.d.ts.map +1 -1
- package/dist/shutdown/mod.js +26 -25
- package/dist/shutdown/mod.js.map +1 -1
- package/dist/storage/clickhouse/database.d.ts +113 -115
- package/dist/storage/clickhouse/database.d.ts.map +1 -1
- package/dist/storage/clickhouse/database.js +65 -79
- package/dist/storage/clickhouse/database.js.map +1 -1
- package/dist/storage/clickhouse/errors.d.ts +25 -26
- package/dist/storage/clickhouse/errors.d.ts.map +1 -1
- package/dist/storage/clickhouse/errors.js +15 -17
- package/dist/storage/clickhouse/errors.js.map +1 -1
- package/dist/storage/clickhouse/mod.d.ts +10 -10
- package/dist/storage/clickhouse/mod.js +10 -10
- package/dist/storage/objects/bucket.d.ts +230 -203
- package/dist/storage/objects/bucket.d.ts.map +1 -1
- package/dist/storage/objects/bucket.js +146 -106
- package/dist/storage/objects/bucket.js.map +1 -1
- package/dist/storage/objects/error.d.ts +4 -4
- package/dist/storage/objects/error.js +4 -4
- package/dist/storage/objects/mod.d.ts +1 -1
- package/dist/storage/objects/mod.d.ts.map +1 -1
- package/dist/storage/objects/mod.js.map +1 -1
- package/dist/storage/objects/refs.d.ts +2 -5
- package/dist/storage/objects/refs.d.ts.map +1 -1
- package/dist/storage/objects/refs.js.map +1 -1
- package/dist/storage/postgres/database.d.ts +124 -149
- package/dist/storage/postgres/database.d.ts.map +1 -1
- package/dist/storage/postgres/database.js +98 -135
- package/dist/storage/postgres/database.js.map +1 -1
- package/dist/storage/postgres/errors.d.ts +42 -48
- package/dist/storage/postgres/errors.d.ts.map +1 -1
- package/dist/storage/postgres/errors.js +44 -51
- package/dist/storage/postgres/errors.js.map +1 -1
- package/dist/storage/postgres/interval.d.ts +19 -19
- package/dist/storage/postgres/interval.d.ts.map +1 -1
- package/dist/storage/postgres/interval.js +21 -21
- package/dist/storage/postgres/interval.js.map +1 -1
- package/dist/storage/redis/bitfield.d.ts +48 -23
- package/dist/storage/redis/bitfield.d.ts.map +1 -1
- package/dist/storage/redis/bitfield.js +38 -19
- package/dist/storage/redis/bitfield.js.map +1 -1
- package/dist/storage/redis/command.d.ts +16 -12
- package/dist/storage/redis/command.d.ts.map +1 -1
- package/dist/storage/redis/command.js +16 -12
- package/dist/storage/redis/command.js.map +1 -1
- package/dist/storage/redis/commands.d.ts +99 -100
- package/dist/storage/redis/commands.d.ts.map +1 -1
- package/dist/storage/redis/commands.js +84 -85
- package/dist/storage/redis/commands.js.map +1 -1
- package/dist/storage/redis/database.d.ts +138 -122
- package/dist/storage/redis/database.d.ts.map +1 -1
- package/dist/storage/redis/database.js +120 -101
- package/dist/storage/redis/database.js.map +1 -1
- package/dist/storage/redis/mod.d.ts +52 -48
- package/dist/storage/redis/mod.d.ts.map +1 -1
- package/dist/storage/redis/mod.js +52 -48
- package/dist/storage/redis/mod.js.map +1 -1
- package/dist/storage/redis/options.d.ts +26 -24
- package/dist/storage/redis/options.d.ts.map +1 -1
- package/dist/storage/redis/options.js.map +1 -1
- package/dist/storage/redis/pubsub.d.ts +16 -16
- package/dist/storage/redis/pubsub.d.ts.map +1 -1
- package/dist/storage/redis/pubsub.js +14 -14
- package/dist/storage/redis/pubsub.js.map +1 -1
- package/dist/storage/redis/reply.d.ts +80 -72
- package/dist/storage/redis/reply.d.ts.map +1 -1
- package/dist/storage/redis/reply.js +53 -46
- package/dist/storage/redis/reply.js.map +1 -1
- package/dist/storage/redis/scan.d.ts +4 -4
- package/dist/storage/redis/scan.d.ts.map +1 -1
- package/dist/storage/redis/scan.js +6 -6
- package/dist/storage/redis/scan.js.map +1 -1
- package/dist/storage/redis/script.d.ts +28 -21
- package/dist/storage/redis/script.d.ts.map +1 -1
- package/dist/storage/redis/script.js +29 -22
- package/dist/storage/redis/script.js.map +1 -1
- package/dist/storage/redis/target.d.ts +17 -1
- package/dist/storage/redis/target.d.ts.map +1 -1
- package/dist/storage/redis/target.js +30 -1
- package/dist/storage/redis/target.js.map +1 -1
- package/dist/storage/redis/wire.d.ts +6 -6
- package/dist/storage/redis/wire.d.ts.map +1 -1
- package/dist/storage/redis/wire.js +6 -6
- package/dist/storage/redis/wire.js.map +1 -1
- package/dist/testing/mod.d.ts +83 -88
- package/dist/testing/mod.d.ts.map +1 -1
- package/dist/testing/mod.js +75 -81
- package/dist/testing/mod.js.map +1 -1
- package/dist/testing/playwright.d.ts +28 -32
- package/dist/testing/playwright.d.ts.map +1 -1
- package/dist/testing/playwright.js +22 -27
- package/dist/testing/playwright.js.map +1 -1
- package/dist/testing/puppeteer.d.ts +11 -12
- package/dist/testing/puppeteer.d.ts.map +1 -1
- package/dist/testing/puppeteer.js +17 -18
- package/dist/testing/puppeteer.js.map +1 -1
- package/dist/testing/system.d.ts +72 -90
- package/dist/testing/system.d.ts.map +1 -1
- package/dist/testing/system.js +90 -107
- package/dist/testing/system.js.map +1 -1
- package/dist/tracing/http.d.ts +2 -1
- package/dist/tracing/http.d.ts.map +1 -1
- package/dist/tracing/http.js +2 -1
- package/dist/tracing/http.js.map +1 -1
- package/dist/tracing/node.d.ts.map +1 -1
- package/dist/tracing/node.js +1 -1
- package/dist/tracing/node.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/frontends/mod.test.ts +6 -2
- package/frontends/mod.ts +20 -19
- package/gateway/errors.ts +30 -32
- package/gateway/match.ts +61 -57
- package/gateway/middleware.ts +62 -64
- package/gateway/mod.ts +73 -76
- package/gateway/request.ts +143 -140
- package/gateway/serve.ts +58 -63
- package/gateways/mod.ts +25 -23
- package/internal/otel/http.test.ts +50 -0
- package/internal/otel/http.ts +40 -5
- package/internal/runtime/napi/napi.cjs +6 -5
- package/internal/runtime/napi/napi.d.cts +58 -16
- package/internal/runtime/shutdown.ts +113 -101
- package/log/logger.test.ts +8 -0
- package/log/logger.ts +48 -45
- package/metrics/mod.ts +138 -122
- package/otel.ts +6 -3
- package/package.json +6 -1
- package/pubsub/subscription.ts +93 -123
- package/pubsub/topic.ts +96 -130
- package/redaction/bridge.test.ts +99 -0
- package/redaction/mod.test.ts +188 -0
- package/redaction/mod.ts +226 -0
- package/reqctx/mod.ts +83 -86
- package/services/index.ts +78 -78
- package/shutdown/mod.ts +26 -25
- package/storage/clickhouse/database.ts +115 -129
- package/storage/clickhouse/errors.ts +27 -29
- package/storage/clickhouse/mod.ts +10 -10
- package/storage/objects/bucket.test.ts +168 -16
- package/storage/objects/bucket.ts +336 -247
- package/storage/objects/error.ts +4 -4
- package/storage/objects/mod.ts +1 -0
- package/storage/objects/refs.ts +2 -5
- package/storage/postgres/database.ts +131 -164
- package/storage/postgres/errors.ts +45 -52
- package/storage/postgres/interval.ts +21 -21
- package/storage/redis/bitfield.ts +51 -26
- package/storage/redis/command.ts +16 -12
- package/storage/redis/commands.ts +99 -100
- package/storage/redis/database.ts +145 -123
- package/storage/redis/mod.ts +52 -48
- package/storage/redis/options.ts +26 -24
- package/storage/redis/pubsub.ts +14 -14
- package/storage/redis/redis.test.ts +17 -2
- package/storage/redis/reply.ts +85 -77
- package/storage/redis/scan.ts +6 -6
- package/storage/redis/script.ts +29 -22
- package/storage/redis/target.ts +34 -1
- package/storage/redis/wire.ts +8 -8
- package/testing/mod.ts +99 -105
- package/testing/playwright.ts +32 -37
- package/testing/puppeteer.ts +22 -23
- package/testing/system.ts +117 -133
- package/tracing/http.ts +2 -1
- package/tracing/native.test.ts +158 -8
- package/tracing/node.ts +1 -0
package/dist/gateway/match.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Matchers that select which requests trigger a middleware.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* JavaScript
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Encore evaluates every {@link Matcher} natively before a request reaches
|
|
5
|
+
* JavaScript, so unmatched requests incur no JS overhead. Matchers inspect the
|
|
6
|
+
* original client request — header edits by earlier middleware do not affect
|
|
7
|
+
* which later middleware run — and a middleware does not need to read a field
|
|
8
|
+
* in order to match on it.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* {@link anyOf} and {@link not}:
|
|
10
|
+
* Combine matchers with `.and()`, `.or()`, and `.not()`, or with {@link allOf},
|
|
11
|
+
* {@link anyOf}, and {@link not}:
|
|
12
12
|
*
|
|
13
13
|
* ```typescript
|
|
14
14
|
* import { match } from "@encore.dev/sdk/gateway";
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
* @module
|
|
22
22
|
*/
|
|
23
23
|
/**
|
|
24
|
-
* A
|
|
25
|
-
* query parameters or cookies.
|
|
24
|
+
* A predicate over incoming requests (by service, route, method, path,
|
|
25
|
+
* headers, query parameters, or cookies). Construct matchers using the
|
|
26
|
+
* functions in this module.
|
|
26
27
|
*/
|
|
27
28
|
export class Matcher {
|
|
28
29
|
/** @internal */
|
|
@@ -31,28 +32,28 @@ export class Matcher {
|
|
|
31
32
|
constructor(expr) {
|
|
32
33
|
this.expr = expr;
|
|
33
34
|
}
|
|
34
|
-
/** Matches
|
|
35
|
+
/** Matches requests that satisfy both this matcher and `other`. */
|
|
35
36
|
and(other) {
|
|
36
37
|
return allOf(this, other);
|
|
37
38
|
}
|
|
38
|
-
/** Matches
|
|
39
|
+
/** Matches requests that satisfy either this matcher or `other`. */
|
|
39
40
|
or(other) {
|
|
40
41
|
return anyOf(this, other);
|
|
41
42
|
}
|
|
42
|
-
/** Matches
|
|
43
|
+
/** Matches requests that do not satisfy this matcher. */
|
|
43
44
|
not() {
|
|
44
45
|
return not(this);
|
|
45
46
|
}
|
|
46
|
-
/**
|
|
47
|
+
/** Serializes the matcher to the gateway core's JSON format. */
|
|
47
48
|
toJSON() {
|
|
48
49
|
return this.expr;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* this module
|
|
53
|
+
* A value condition for {@link header}, {@link query}, or {@link cookie}.
|
|
54
|
+
* When a field appears multiple times, any condition other than {@link absent}
|
|
55
|
+
* matches if at least one value satisfies it. Construct conditions using the
|
|
56
|
+
* functions in this module.
|
|
56
57
|
*/
|
|
57
58
|
export class Cond {
|
|
58
59
|
/** @internal */
|
|
@@ -61,7 +62,7 @@ export class Cond {
|
|
|
61
62
|
constructor(expr) {
|
|
62
63
|
this.expr = expr;
|
|
63
64
|
}
|
|
64
|
-
/**
|
|
65
|
+
/** Serializes the condition to the gateway core's JSON format. */
|
|
65
66
|
toJSON() {
|
|
66
67
|
return this.expr;
|
|
67
68
|
}
|
|
@@ -69,7 +70,7 @@ export class Cond {
|
|
|
69
70
|
function matchers(what, ms) {
|
|
70
71
|
return ms.map(m => {
|
|
71
72
|
if (!(m instanceof Matcher)) {
|
|
72
|
-
throw new TypeError(`match.${what}
|
|
73
|
+
throw new TypeError(`match.${what} expects Matcher arguments, got ${describe(m)}`);
|
|
73
74
|
}
|
|
74
75
|
return m.expr;
|
|
75
76
|
});
|
|
@@ -77,7 +78,7 @@ function matchers(what, ms) {
|
|
|
77
78
|
function strings(what, values) {
|
|
78
79
|
for (const v of values) {
|
|
79
80
|
if (typeof v !== 'string') {
|
|
80
|
-
throw new TypeError(`match.${what}
|
|
81
|
+
throw new TypeError(`match.${what} expects string arguments, got ${describe(v)}`);
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
return [...values];
|
|
@@ -89,58 +90,56 @@ function describe(v) {
|
|
|
89
90
|
? v.constructor.name
|
|
90
91
|
: typeof v;
|
|
91
92
|
}
|
|
92
|
-
/** Matches
|
|
93
|
-
* are none. */
|
|
93
|
+
/** Matches requests that satisfy every matcher in `ms` (matches all requests when empty). */
|
|
94
94
|
export function allOf(...ms) {
|
|
95
95
|
return new Matcher({ all: matchers('allOf', ms) });
|
|
96
96
|
}
|
|
97
|
-
/** Matches
|
|
97
|
+
/** Matches requests that satisfy at least one matcher in `ms` (matches no requests when empty). */
|
|
98
98
|
export function anyOf(...ms) {
|
|
99
99
|
return new Matcher({ anyOf: matchers('anyOf', ms) });
|
|
100
100
|
}
|
|
101
|
-
/** Matches
|
|
101
|
+
/** Matches requests that do not satisfy `m` (equivalent to `m.not()`). */
|
|
102
102
|
export function not(m) {
|
|
103
103
|
return new Matcher({ not: matchers('not', [m])[0] });
|
|
104
104
|
}
|
|
105
|
-
/** Matches
|
|
105
|
+
/** Matches requests routed to any of the given `services`. */
|
|
106
106
|
export function service(...services) {
|
|
107
107
|
return new Matcher({ service: strings('service', services) });
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
|
-
* Matches
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
110
|
+
* Matches requests routed to the route matching `template` (e.g.
|
|
111
|
+
* `/users/{id}`) and `method` (or any HTTP method if `method` is `undefined`).
|
|
112
|
+
* Path parameter names are ignored, matching router behavior (`/users/{userId}`
|
|
113
|
+
* matches the same route).
|
|
114
114
|
*/
|
|
115
115
|
export function route(method, template) {
|
|
116
116
|
return new Matcher({
|
|
117
117
|
route: method === undefined ? { template } : { method, template },
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
/** Matches
|
|
120
|
+
/** Matches requests using any of the given HTTP `methods` (e.g. `"POST"`). */
|
|
121
121
|
export function method(...methods) {
|
|
122
122
|
return new Matcher({ method: strings('method', methods) });
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
|
-
* Matches
|
|
126
|
-
*
|
|
127
|
-
* router.
|
|
125
|
+
* Matches requests whose raw (non-percent-decoded) path equals `path`.
|
|
126
|
+
* Trailing slashes are ignored, matching router behavior.
|
|
128
127
|
*/
|
|
129
128
|
export function path(path) {
|
|
130
129
|
return new Matcher({ path: { exact: path } });
|
|
131
130
|
}
|
|
132
131
|
/**
|
|
133
|
-
* Matches
|
|
134
|
-
* `/admin` matches `/admin` and `/admin/users`, not
|
|
132
|
+
* Matches requests whose path starts with `prefix` on whole-segment boundaries
|
|
133
|
+
* (for example, `/admin` matches `/admin` and `/admin/users`, but not
|
|
134
|
+
* `/administrators`).
|
|
135
135
|
*/
|
|
136
136
|
export function pathPrefix(prefix) {
|
|
137
137
|
return new Matcher({ path: { prefix } });
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
|
-
* Matches
|
|
141
|
-
*
|
|
142
|
-
* `/users
|
|
143
|
-
* `/users/1/posts/2`.
|
|
140
|
+
* Matches requests whose path matches `glob`, where `*` matches a single path
|
|
141
|
+
* segment and `**` matches zero or more segments (e.g. `/users/*` matches
|
|
142
|
+
* `/users/1`, and `/users/**` matches `/users` and `/users/1/posts/2`).
|
|
144
143
|
*/
|
|
145
144
|
export function pathGlob(glob) {
|
|
146
145
|
return new Matcher({ path: { glob } });
|
|
@@ -148,57 +147,58 @@ export function pathGlob(glob) {
|
|
|
148
147
|
function field(kind, name, cond) {
|
|
149
148
|
const c = cond ?? present();
|
|
150
149
|
if (!(c instanceof Cond)) {
|
|
151
|
-
throw new TypeError(`match.${kind}
|
|
150
|
+
throw new TypeError(`match.${kind} expects a Cond, got ${describe(c)}`);
|
|
152
151
|
}
|
|
153
152
|
return new Matcher({ [kind]: { name, cond: c.expr } });
|
|
154
153
|
}
|
|
155
154
|
/**
|
|
156
|
-
* Matches
|
|
157
|
-
*
|
|
155
|
+
* Matches requests whose header `name` satisfies `cond`, or is present when
|
|
156
|
+
* `cond` is omitted. Header names are case-insensitive; values are compared as
|
|
158
157
|
* sent.
|
|
159
158
|
*/
|
|
160
159
|
export function header(name, cond) {
|
|
161
160
|
return field('header', name, cond);
|
|
162
161
|
}
|
|
163
162
|
/**
|
|
164
|
-
* Matches
|
|
165
|
-
*
|
|
166
|
-
*
|
|
163
|
+
* Matches requests whose query parameter `name` satisfies `cond`, or is
|
|
164
|
+
* present when `cond` is omitted. Parameter names are case-sensitive; values
|
|
165
|
+
* are percent-decoded before comparison.
|
|
167
166
|
*/
|
|
168
167
|
export function query(name, cond) {
|
|
169
168
|
return field('query', name, cond);
|
|
170
169
|
}
|
|
171
170
|
/**
|
|
172
|
-
* Matches
|
|
173
|
-
*
|
|
171
|
+
* Matches requests whose cookie `name` satisfies `cond`, or is present when
|
|
172
|
+
* `cond` is omitted. Cookie names are case-sensitive; values are compared as
|
|
173
|
+
* sent.
|
|
174
174
|
*/
|
|
175
175
|
export function cookie(name, cond) {
|
|
176
176
|
return field('cookie', name, cond);
|
|
177
177
|
}
|
|
178
|
-
/**
|
|
178
|
+
/** Matches when the field is present. */
|
|
179
179
|
export function present() {
|
|
180
180
|
return new Cond({ present: true });
|
|
181
181
|
}
|
|
182
|
-
/**
|
|
182
|
+
/** Matches when the field is absent. */
|
|
183
183
|
export function absent() {
|
|
184
184
|
return new Cond({ absent: true });
|
|
185
185
|
}
|
|
186
|
-
/**
|
|
186
|
+
/** Matches when the field equals `value`. */
|
|
187
187
|
export function equals(value) {
|
|
188
188
|
return new Cond({ equals: value });
|
|
189
189
|
}
|
|
190
|
-
/**
|
|
190
|
+
/** Matches when the field starts with `prefix` (e.g. `"Bearer "`). */
|
|
191
191
|
export function prefix(prefix) {
|
|
192
192
|
return new Cond({ prefix });
|
|
193
193
|
}
|
|
194
|
-
/**
|
|
194
|
+
/** Matches when the field equals one of `values`. */
|
|
195
195
|
export function oneOf(...values) {
|
|
196
196
|
return new Cond({ oneOf: strings('oneOf', values) });
|
|
197
197
|
}
|
|
198
198
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
199
|
+
* Matches when `pattern` matches the field's entire value. Uses RE2 syntax
|
|
200
|
+
* (not JavaScript RegExp syntax) because Encore evaluates it natively. An
|
|
201
|
+
* invalid pattern causes `serve` to reject.
|
|
202
202
|
*/
|
|
203
203
|
export function regex(pattern) {
|
|
204
204
|
return new Cond({ regex: pattern });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match.js","sourceRoot":"","sources":["../../gateway/match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH
|
|
1
|
+
{"version":3,"file":"match.js","sourceRoot":"","sources":["../../gateway/match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH;;;;GAIG;AACH,MAAM,OAAO,OAAO;IAClB,gBAAgB;IACP,IAAI,CAAO;IAEpB,gBAAgB;IAChB,YAAY,IAAU;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,mEAAmE;IACnE,GAAG,CAAC,KAAc;QAChB,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,oEAAoE;IACpE,EAAE,CAAC,KAAc;QACf,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,yDAAyD;IACzD,GAAG;QACD,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,gEAAgE;IAChE,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,IAAI;IACf,gBAAgB;IACP,IAAI,CAAO;IAEpB,gBAAgB;IAChB,YAAY,IAAU;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,kEAAkE;IAClE,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,EAAsB;IACpD,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;Q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C5B,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,KAAK,CAAC,GAAG,MAAgB;IACvC,OAAO,IAAI,IAAI,CAAC,EAAC,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,EAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,OAAe;IACnC,OAAO,IAAI,IAAI,CAAC,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -2,32 +2,33 @@ import type { Rejection } from './errors.js';
|
|
|
2
2
|
import type { Matcher } from './match.js';
|
|
3
3
|
import type { Completed, Request, Response } from './request.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Determines how the gateway handles an `onRequest` failure (an uncaught error
|
|
6
|
+
* that is not a {@link Rejection}, or a timeout).
|
|
7
7
|
*
|
|
8
|
-
* - `"failClosed"
|
|
9
|
-
* Unavailable
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - `"failOpen"
|
|
14
|
-
*
|
|
15
|
-
*
|
|
8
|
+
* - `"failClosed"` (default): rejects the request — returning 503 Service
|
|
9
|
+
* Unavailable if the hook timed out or could not be dispatched to JavaScript
|
|
10
|
+
* (allowing clients to retry), and 500 Internal Server Error otherwise. Use
|
|
11
|
+
* this for authentication or authorization middleware so failures never grant
|
|
12
|
+
* access.
|
|
13
|
+
* - `"failOpen"`: lets the request through unmodified, as if the hook had
|
|
14
|
+
* succeeded. Use this for non-critical middleware such as a rate limiter
|
|
15
|
+
* backed by an unavailable store.
|
|
16
16
|
*/
|
|
17
17
|
export type ErrorPolicy = 'failClosed' | 'failOpen';
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
18
|
+
/**
|
|
19
|
+
* Return value of `onRequest`: return nothing to allow the request through, or
|
|
20
|
+
* a {@link Rejection} to answer it directly.
|
|
21
|
+
*/
|
|
20
22
|
export type Decision = void | undefined | Rejection;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* Middleware executed by the gateway on public requests before they reach a
|
|
25
|
+
* service, as responses return, and after requests finish.
|
|
24
26
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* `match
|
|
28
|
-
* each `onRequest` sees
|
|
29
|
-
*
|
|
30
|
-
* request through.
|
|
27
|
+
* Provide a plain object or class instance implementing only the hooks you
|
|
28
|
+
* need; unimplemented hooks incur no overhead. A middleware runs only on
|
|
29
|
+
* requests matching `match`. Middleware execute in the order passed to `serve`:
|
|
30
|
+
* each `onRequest` sees headers written by earlier middleware, and `onResponse`
|
|
31
|
+
* hooks run in reverse order only for middleware that let the request through.
|
|
31
32
|
*
|
|
32
33
|
* ```typescript
|
|
33
34
|
* class RateLimit implements gateway.Middleware {
|
|
@@ -36,73 +37,70 @@ export type Decision = void | undefined | Rejection;
|
|
|
36
37
|
* }
|
|
37
38
|
* ```
|
|
38
39
|
*
|
|
39
|
-
* `serve`
|
|
40
|
-
*
|
|
41
|
-
* `
|
|
42
|
-
* valid, and that the names are unique.
|
|
40
|
+
* Before starting, `serve` validates every middleware: it must define at least
|
|
41
|
+
* one hook, have unique kebab-case names, use valid settings, and not define
|
|
42
|
+
* unrecognized `on[A-Z]*` properties (catching misspelled hook names).
|
|
43
43
|
*/
|
|
44
44
|
export interface Middleware {
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `rate-limit`; a plain object needs one.
|
|
46
|
+
* Unique kebab-case identifier for this middleware, used in logs, traces,
|
|
47
|
+
* and {@link Completed.rejectedBy}. Defaults to the class name in kebab-case
|
|
48
|
+
* (e.g. `RateLimit` becomes `rate-limit`); required for plain objects.
|
|
50
49
|
*/
|
|
51
50
|
readonly name?: string;
|
|
52
|
-
/**
|
|
51
|
+
/** Requests that trigger this middleware. Matches all requests when unset. */
|
|
53
52
|
readonly match?: Matcher;
|
|
54
53
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* the object it was before the hook: see {@link Request.state}.
|
|
54
|
+
* Maximum time in milliseconds allowed for `onRequest` and `onResponse`,
|
|
55
|
+
* measured from when the gateway enqueues the hook. Defaults to 5000 ms.
|
|
56
|
+
*
|
|
57
|
+
* On expiry, {@link Request.signal} aborts, the gateway moves on without
|
|
58
|
+
* waiting, and `onError` decides the outcome (`"failClosed"` responds with
|
|
59
|
+
* 503). Hooks that expire before starting are skipped. When a hook fails or
|
|
60
|
+
* times out, its header edits and Request Context changes are discarded, and
|
|
61
|
+
* `state` reverts to its previous reference (see {@link Request.state}).
|
|
64
62
|
*/
|
|
65
63
|
readonly timeoutMs?: number;
|
|
66
|
-
/**
|
|
67
|
-
* unset. */
|
|
64
|
+
/** How `onRequest` failures affect the request. Defaults to `"failClosed"`. */
|
|
68
65
|
readonly onError?: ErrorPolicy;
|
|
69
66
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* ({@link Request.set})
|
|
73
|
-
* ({@link Request.
|
|
74
|
-
* ({@link Request.skip}).
|
|
67
|
+
* Runs before the request is forwarded. May modify headers
|
|
68
|
+
* ({@link Request.setHeader}), set Request Context fields
|
|
69
|
+
* ({@link Request.set}) or span attributes ({@link Request.setAttributes}),
|
|
70
|
+
* and skip later hooks ({@link Request.skip}).
|
|
75
71
|
*
|
|
76
|
-
*
|
|
77
|
-
* {@link Rejection} ({@link reject}
|
|
78
|
-
*
|
|
79
|
-
* other error fails the hook
|
|
72
|
+
* Return nothing to let the request through, or return/throw a
|
|
73
|
+
* {@link Rejection} ({@link reject} or {@link respond}) to answer the client
|
|
74
|
+
* immediately without calling later middleware or forwarding the request. Any
|
|
75
|
+
* other error fails the hook and is handled according to `onError`.
|
|
80
76
|
*/
|
|
81
77
|
onRequest?(req: Request): Decision | Promise<Decision>;
|
|
82
78
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
79
|
+
* Observes each chunk of the request body as it is forwarded (`end` is `true`
|
|
80
|
+
* on the final chunk). Forwarding does not wait on this hook; under heavy
|
|
81
|
+
* load, excess chunks may be dropped and logged.
|
|
86
82
|
*/
|
|
87
83
|
onRequestBody?(req: Request, chunk: Uint8Array, end: boolean): void | Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
* ({@link Response.setHeader}).
|
|
84
|
+
/**
|
|
85
|
+
* Runs with the response status and headers before they are sent to the
|
|
86
|
+
* client. May modify response headers ({@link Response.setHeader}).
|
|
87
|
+
*/
|
|
91
88
|
onResponse?(req: Request, resp: Response): void | Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
*
|
|
89
|
+
/**
|
|
90
|
+
* Observes each chunk of the response body, behaving like `onRequestBody`.
|
|
91
|
+
*/
|
|
94
92
|
onResponseBody?(req: Request, chunk: Uint8Array, end: boolean): void | Promise<void>;
|
|
95
93
|
/**
|
|
96
|
-
*
|
|
97
|
-
* response
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
94
|
+
* Runs asynchronously after the request completes (once the client has
|
|
95
|
+
* received the response or disconnected). Invoked for every matched request,
|
|
96
|
+
* even those rejected by another middleware, making it ideal for logging,
|
|
97
|
+
* metrics, or billing. Under heavy load, excess events may be dropped and
|
|
98
|
+
* logged.
|
|
101
99
|
*/
|
|
102
100
|
onComplete?(done: Completed): void | Promise<void>;
|
|
103
101
|
}
|
|
104
|
-
/**
|
|
102
|
+
/** Supported middleware hook names. @internal */
|
|
105
103
|
export declare const HOOKS: readonly ["onRequest", "onRequestBody", "onResponse", "onResponseBody", "onComplete"];
|
|
106
|
-
/**
|
|
104
|
+
/** Union of supported middleware hook names. @internal */
|
|
107
105
|
export type HookName = (typeof HOOKS)[number];
|
|
108
106
|
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../gateway/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,WAAW,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAEpD;
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../gateway/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,WAAW,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAE/B;;;;;;;;;;OAUG;IACH,SAAS,CAAC,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEvD;;;;OAIG;IACH,aAAa,CAAC,CACZ,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,OAAO,GACX,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE;;OAEG;IACH,cAAc,CAAC,CACb,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,OAAO,GACX,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;;;;;OAMG;IACH,UAAU,CAAC,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED,iDAAiD;AACjD,eAAO,MAAM,KAAK,uFAMR,CAAC;AAEX,0DAA0D;AAC1D,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../gateway/middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../gateway/middleware.ts"],"names":[],"mappings":"AAyHA,iDAAiD;AACjD,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,WAAW;IACX,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,YAAY;CACJ,CAAC"}
|