@decohere/http 0.0.1-dev.20261105.97 → 0.0.1-dev.20261106.132

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 (70) hide show
  1. package/es6/src/routing/services/route-registry.js +5 -0
  2. package/package.json +9 -14
  3. package/commonjs/src/app/app.js +0 -166
  4. package/commonjs/src/app/index.js +0 -19
  5. package/commonjs/src/app/module.js +0 -17
  6. package/commonjs/src/auth/ability.js +0 -54
  7. package/commonjs/src/auth/auth.config.js +0 -23
  8. package/commonjs/src/auth/auth.extensions.js +0 -106
  9. package/commonjs/src/auth/auth.types.js +0 -65
  10. package/commonjs/src/auth/casl-authorization.service.js +0 -36
  11. package/commonjs/src/auth/index.js +0 -23
  12. package/commonjs/src/auth/principal-provider.js +0 -19
  13. package/commonjs/src/auth/safe-outbound-url.js +0 -102
  14. package/commonjs/src/auth/token-service.js +0 -151
  15. package/commonjs/src/builder/builder.js +0 -95
  16. package/commonjs/src/builder/index.js +0 -18
  17. package/commonjs/src/const.js +0 -86
  18. package/commonjs/src/health/health.controller.js +0 -75
  19. package/commonjs/src/health/health.extensions.js +0 -50
  20. package/commonjs/src/health/index.js +0 -21
  21. package/commonjs/src/health/readiness.service.js +0 -67
  22. package/commonjs/src/health/readiness.types.js +0 -7
  23. package/commonjs/src/hosting/hosted-service-host.js +0 -88
  24. package/commonjs/src/hosting/hosted-service.js +0 -11
  25. package/commonjs/src/hosting/index.js +0 -19
  26. package/commonjs/src/http/http.compression.js +0 -27
  27. package/commonjs/src/http/http.extensions.js +0 -269
  28. package/commonjs/src/http/http.options.js +0 -26
  29. package/commonjs/src/http/http.options.store.js +0 -20
  30. package/commonjs/src/http/http.security.js +0 -27
  31. package/commonjs/src/http/http.static.js +0 -248
  32. package/commonjs/src/http/index.js +0 -22
  33. package/commonjs/src/index.js +0 -27
  34. package/commonjs/src/openapi/index.js +0 -45
  35. package/commonjs/src/openapi/openapi.generator.js +0 -103
  36. package/commonjs/src/openapi/openapi.types.js +0 -4
  37. package/commonjs/src/openapi/request-schema.js +0 -187
  38. package/commonjs/src/openapi/request-validator.js +0 -85
  39. package/commonjs/src/providers/fastify.provider.js +0 -391
  40. package/commonjs/src/providers/index.js +0 -18
  41. package/commonjs/src/routing/decorators/argument.decorator.js +0 -49
  42. package/commonjs/src/routing/decorators/auth.decorator.js +0 -70
  43. package/commonjs/src/routing/decorators/controller.decorator.js +0 -16
  44. package/commonjs/src/routing/decorators/field.decorator.js +0 -25
  45. package/commonjs/src/routing/decorators/index.js +0 -24
  46. package/commonjs/src/routing/decorators/request.decorator.js +0 -30
  47. package/commonjs/src/routing/decorators/response.decorator.js +0 -34
  48. package/commonjs/src/routing/decorators/route.decorator.js +0 -67
  49. package/commonjs/src/routing/filters/exception-filter-host.js +0 -145
  50. package/commonjs/src/routing/filters/exception-filter.js +0 -28
  51. package/commonjs/src/routing/http.types.js +0 -99
  52. package/commonjs/src/routing/index.js +0 -25
  53. package/commonjs/src/routing/middleware/http-access-log.middleware.js +0 -47
  54. package/commonjs/src/routing/middleware/middleware.js +0 -20
  55. package/commonjs/src/routing/middleware/request-id.js +0 -30
  56. package/commonjs/src/routing/path.util.js +0 -51
  57. package/commonjs/src/routing/pipes/index.js +0 -18
  58. package/commonjs/src/routing/pipes/pipes.js +0 -145
  59. package/commonjs/src/routing/services/index.js +0 -18
  60. package/commonjs/src/routing/services/route-argument-resolver.js +0 -77
  61. package/commonjs/src/routing/services/route-registry.js +0 -194
  62. package/commonjs/src/routing/services/router.js +0 -158
  63. package/commonjs/src/sse/index.js +0 -26
  64. package/commonjs/src/sse/sse.decorator.js +0 -42
  65. package/commonjs/src/sse/sse.encoder.js +0 -73
  66. package/commonjs/src/sse/sse.types.js +0 -36
  67. package/commonjs/src/sse/sse.wire.js +0 -40
  68. package/commonjs/src/testing/boot-module.js +0 -38
  69. package/commonjs/src/testing/index.js +0 -20
  70. package/commonjs/src/testing/sse-reader.js +0 -98
@@ -1,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "HostedServiceHost", {
6
- enumerable: true,
7
- get: function() {
8
- return HostedServiceHost;
9
- }
10
- });
11
- const _scribe = require("@decohere/scribe");
12
- class HostedServiceHost {
13
- logger = _scribe.scribe.logger(HostedServiceHost.name);
14
- types = [];
15
- controller = new AbortController();
16
- /** In start order; stopped in reverse. */ started = [];
17
- starting;
18
- stopping;
19
- add(...types) {
20
- this.types.push(...types);
21
- }
22
- get isEmpty() {
23
- return this.types.length === 0;
24
- }
25
- /**
26
- * Start every service in registration order. If one throws, the ones already started are
27
- * stopped and the error is rethrown. Stops launching more once {@link stop} has begun.
28
- */ start(container) {
29
- this.starting ??= this.startAll(container);
30
- return this.starting;
31
- }
32
- /** Abort the services' signal: background work should wind down. {@link stop} does this too. */ abort() {
33
- this.controller.abort();
34
- }
35
- /**
36
- * Abort the signal, wait for a start still in progress, then stop the started services in
37
- * reverse order. Every `stop()` runs even if one throws; the failures are rethrown after.
38
- */ stop() {
39
- this.stopping ??= this.stopAll();
40
- return this.stopping;
41
- }
42
- /** The started services that report readiness, for `GET /ready`. */ readinessChecks() {
43
- return this.started.filter((service)=>typeof service.check === "function").map((service)=>({
44
- name: service.constructor.name,
45
- check: ()=>service.check?.() ?? Promise.resolve()
46
- }));
47
- }
48
- async startAll(container) {
49
- const { signal } = this.controller;
50
- for (const type of this.types){
51
- if (signal.aborted) return;
52
- const service = container.resolve(type);
53
- try {
54
- await service.start(signal);
55
- } catch (error) {
56
- this.logger.error(`Hosted service ${type.name} failed to start`, error);
57
- // Not stop(): it waits for this start to settle.
58
- this.controller.abort();
59
- await this.stopStarted().catch(()=>{});
60
- throw error;
61
- }
62
- this.started.push(service);
63
- this.logger.debug(`Hosted service ${type.name} started`);
64
- }
65
- }
66
- async stopAll() {
67
- this.controller.abort();
68
- await Promise.allSettled([
69
- this.starting
70
- ]);
71
- await this.stopStarted();
72
- }
73
- /** Stop what is started, newest first. Takes each service off the list, so it runs once. */ async stopStarted() {
74
- const failures = [];
75
- for(let service = this.started.pop(); service != null; service = this.started.pop()){
76
- try {
77
- await service.stop?.();
78
- } catch (error) {
79
- this.logger.error(`Hosted service ${service.constructor.name} failed to stop`, error);
80
- failures.push(error);
81
- }
82
- }
83
- if (failures.length === 1) throw failures[0];
84
- if (failures.length > 1) {
85
- throw new AggregateError(failures, `${failures.length} hosted services failed to stop`);
86
- }
87
- }
88
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * Work that runs for the life of the app outside a request: a feed, a poller, a queue consumer.
3
- * Register it with `builder.withHostedService(Type)`; it is a singleton, so other services can
4
- * inject it by its class.
5
- *
6
- * The app starts hosted services in registration order before the HTTP server listens, and stops
7
- * them in reverse order when it stops (`app.dispose()`, SIGTERM or SIGINT, a Flux reboot).
8
- */ "use strict";
9
- Object.defineProperty(exports, "__esModule", {
10
- value: true
11
- });
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- _export_star(require("./hosted-service.js"), exports);
6
- _export_star(require("./hosted-service-host.js"), exports);
7
- function _export_star(from, to) {
8
- Object.keys(from).forEach(function(k) {
9
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
10
- Object.defineProperty(to, k, {
11
- enumerable: true,
12
- get: function() {
13
- return from[k];
14
- }
15
- });
16
- }
17
- });
18
- return from;
19
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * Response compression (`builder.withCompression`). Provider-neutral options and defaults;
3
- * the HTTP provider hands them to its compression plugin and the plugin owns the policy
4
- * (which responses are compressed, `Vary`, `HEAD`, streams). See ADR 0008.
5
- */ /** A content coding the HTTP package can offer. */ "use strict";
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
- function _export(target, all) {
10
- for(var name in all)Object.defineProperty(target, name, {
11
- enumerable: true,
12
- get: Object.getOwnPropertyDescriptor(all, name).get
13
- });
14
- }
15
- _export(exports, {
16
- get DEFAULT_COMPRESSION_ENCODINGS () {
17
- return DEFAULT_COMPRESSION_ENCODINGS;
18
- },
19
- get DEFAULT_COMPRESSION_THRESHOLD () {
20
- return DEFAULT_COMPRESSION_THRESHOLD;
21
- }
22
- });
23
- const DEFAULT_COMPRESSION_THRESHOLD = 1024;
24
- const DEFAULT_COMPRESSION_ENCODINGS = [
25
- "br",
26
- "gzip"
27
- ];
@@ -1,269 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "BuilderExtensions", {
6
- enumerable: true,
7
- get: function() {
8
- return BuilderExtensions;
9
- }
10
- });
11
- const _extensibility = require("@decohere/core/extensibility");
12
- const _scribe = require("@decohere/scribe");
13
- const _principalprovider = require("../auth/principal-provider.js");
14
- const _builder = require("../builder/builder.js");
15
- const _const = require("../const.js");
16
- const _exceptionfilterhost = require("../routing/filters/exception-filter-host.js");
17
- const _httpaccesslogmiddleware = require("../routing/middleware/http-access-log.middleware.js");
18
- const _routeregistry = require("../routing/services/route-registry.js");
19
- const _router = require("../routing/services/router.js");
20
- const _httpoptionsstore = require("./http.options.store.js");
21
- const _httpstatic = require("./http.static.js");
22
- function _ts_decorate(decorators, target, key, desc) {
23
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
24
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
25
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
26
- return c > 3 && r && Object.defineProperty(target, key, r), r;
27
- }
28
- function _ts_metadata(k, v) {
29
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
30
- }
31
- const httpProviderStore = new WeakMap();
32
- const controllersStore = new WeakMap();
33
- class BuilderExtensions {
34
- static withHttpProvider(builder, type) {
35
- httpProviderStore.set(builder, type);
36
- const httpOptions = (0, _httpoptionsstore.getOrCreateHttpOptions)(builder);
37
- builder.withServices((containerBuilder)=>{
38
- const logger = _scribe.scribe.logger("BuilderExtensions");
39
- logger.trace("Configuring Http Provider");
40
- const http = httpProviderStore.get(builder);
41
- if (!http) {
42
- return;
43
- }
44
- containerBuilder.registerSingleton(_const.HttpOptionsToken, httpOptions);
45
- containerBuilder.registerSingleton(_const.HttpProviderToken, http);
46
- containerBuilder.registerSingleton(_const.RouterToken, _router.Router);
47
- containerBuilder.registerSingleton(_const.RouteRegistryToken, _routeregistry.RouteRegistry);
48
- containerBuilder.registerSingleton(_const.ExceptionFilterHostToken, _exceptionfilterhost.ExceptionFilterHost);
49
- containerBuilder.registerRequestScoped(_const.IPrincipalProviderToken, _principalprovider.PrincipalProvider);
50
- for (const middlewareType of httpOptions.middlewareTypes){
51
- containerBuilder.registerSingleton(middlewareType);
52
- }
53
- for (const filterType of httpOptions.filterTypes){
54
- containerBuilder.registerSingleton(filterType);
55
- }
56
- const controllers = controllersStore.get(builder) || [];
57
- for (const controllerFn of controllers){
58
- containerBuilder.registerRequestScoped(controllerFn);
59
- }
60
- });
61
- builder.registerPostBuildStep((container)=>{
62
- const logger = _scribe.scribe.logger("BuilderExtensions");
63
- const registry = container.resolve(_const.RouteRegistryToken);
64
- const controllers = controllersStore.get(builder) || [];
65
- for (const controllerFn of controllers){
66
- logger.trace(`Add routes from ${controllerFn.name}`);
67
- registry.addController(controllerFn);
68
- }
69
- });
70
- return builder;
71
- }
72
- static withHttp(builder, type, options) {
73
- const accessLog = options?.accessLog !== false;
74
- if (accessLog) {
75
- const httpOptions = (0, _httpoptionsstore.getOrCreateHttpOptions)(builder);
76
- if (!httpOptions.middlewareTypes.includes(_httpaccesslogmiddleware.HttpAccessLogMiddleware)) {
77
- httpOptions.middlewareTypes = [
78
- ...httpOptions.middlewareTypes,
79
- _httpaccesslogmiddleware.HttpAccessLogMiddleware
80
- ];
81
- }
82
- }
83
- return BuilderExtensions.withHttpProvider(builder, type);
84
- }
85
- static withControllers(builder, ...controllers) {
86
- const existing = controllersStore.get(builder) || [];
87
- controllersStore.set(builder, [
88
- ...existing,
89
- ...controllers
90
- ]);
91
- return builder;
92
- }
93
- static withGlobalPrefix(builder, prefix) {
94
- (0, _httpoptionsstore.getOrCreateHttpOptions)(builder).globalPrefix = prefix;
95
- return builder;
96
- }
97
- static withCors(builder, options) {
98
- (0, _httpoptionsstore.getOrCreateHttpOptions)(builder).cors = options;
99
- return builder;
100
- }
101
- static withHelmet(builder, options = {}) {
102
- (0, _httpoptionsstore.getOrCreateHttpOptions)(builder).helmet = options;
103
- return builder;
104
- }
105
- static withRateLimit(builder, options = {}) {
106
- (0, _httpoptionsstore.getOrCreateHttpOptions)(builder).rateLimit = options;
107
- return builder;
108
- }
109
- static withCompression(builder, options = {}) {
110
- (0, _httpoptionsstore.getOrCreateHttpOptions)(builder).compression = options;
111
- return builder;
112
- }
113
- static withBodyLimit(builder, bytes) {
114
- (0, _httpoptionsstore.getOrCreateHttpOptions)(builder).bodyLimit = bytes;
115
- return builder;
116
- }
117
- static withMiddleware(builder, ...middlewares) {
118
- const httpOptions = (0, _httpoptionsstore.getOrCreateHttpOptions)(builder);
119
- httpOptions.middlewareTypes = [
120
- ...httpOptions.middlewareTypes,
121
- ...middlewares
122
- ];
123
- return builder;
124
- }
125
- static withExceptionFilters(builder, ...filters) {
126
- const httpOptions = (0, _httpoptionsstore.getOrCreateHttpOptions)(builder);
127
- httpOptions.filterTypes = [
128
- ...httpOptions.filterTypes,
129
- ...filters
130
- ];
131
- return builder;
132
- }
133
- static withOpenApi(builder, options) {
134
- (0, _httpoptionsstore.getOrCreateHttpOptions)(builder).openapi = {
135
- validateRequests: true,
136
- path: "/openapi.json",
137
- ...options
138
- };
139
- return builder;
140
- }
141
- static withStatic(builder, prefix, directory, options) {
142
- const httpOptions = (0, _httpoptionsstore.getOrCreateHttpOptions)(builder);
143
- httpOptions.statics = [
144
- ...httpOptions.statics,
145
- _httpstatic.staticFiles.toMount(prefix, directory, options)
146
- ];
147
- return builder;
148
- }
149
- }
150
- _ts_decorate([
151
- (0, _extensibility.extension)(_builder.Builder),
152
- _ts_metadata("design:type", Function),
153
- _ts_metadata("design:paramtypes", [
154
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
155
- typeof Thttp === "undefined" ? Object : Thttp
156
- ]),
157
- _ts_metadata("design:returntype", void 0)
158
- ], BuilderExtensions, "withHttpProvider", null);
159
- _ts_decorate([
160
- (0, _extensibility.extension)(_builder.Builder),
161
- _ts_metadata("design:type", Function),
162
- _ts_metadata("design:paramtypes", [
163
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
164
- typeof Thttp === "undefined" ? Object : Thttp,
165
- typeof WithHttpOptions === "undefined" ? Object : WithHttpOptions
166
- ]),
167
- _ts_metadata("design:returntype", void 0)
168
- ], BuilderExtensions, "withHttp", null);
169
- _ts_decorate([
170
- (0, _extensibility.extension)(_builder.Builder),
171
- _ts_metadata("design:type", Function),
172
- _ts_metadata("design:paramtypes", [
173
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
174
- Array
175
- ]),
176
- _ts_metadata("design:returntype", void 0)
177
- ], BuilderExtensions, "withControllers", null);
178
- _ts_decorate([
179
- (0, _extensibility.extension)(_builder.Builder),
180
- _ts_metadata("design:type", Function),
181
- _ts_metadata("design:paramtypes", [
182
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
183
- String
184
- ]),
185
- _ts_metadata("design:returntype", void 0)
186
- ], BuilderExtensions, "withGlobalPrefix", null);
187
- _ts_decorate([
188
- (0, _extensibility.extension)(_builder.Builder),
189
- _ts_metadata("design:type", Function),
190
- _ts_metadata("design:paramtypes", [
191
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
192
- typeof CorsOptions === "undefined" ? Object : CorsOptions
193
- ]),
194
- _ts_metadata("design:returntype", void 0)
195
- ], BuilderExtensions, "withCors", null);
196
- _ts_decorate([
197
- (0, _extensibility.extension)(_builder.Builder),
198
- _ts_metadata("design:type", Function),
199
- _ts_metadata("design:paramtypes", [
200
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
201
- typeof HelmetOptions === "undefined" ? Object : HelmetOptions
202
- ]),
203
- _ts_metadata("design:returntype", void 0)
204
- ], BuilderExtensions, "withHelmet", null);
205
- _ts_decorate([
206
- (0, _extensibility.extension)(_builder.Builder),
207
- _ts_metadata("design:type", Function),
208
- _ts_metadata("design:paramtypes", [
209
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
210
- typeof RateLimitOptions === "undefined" ? Object : RateLimitOptions
211
- ]),
212
- _ts_metadata("design:returntype", void 0)
213
- ], BuilderExtensions, "withRateLimit", null);
214
- _ts_decorate([
215
- (0, _extensibility.extension)(_builder.Builder),
216
- _ts_metadata("design:type", Function),
217
- _ts_metadata("design:paramtypes", [
218
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
219
- typeof CompressionOptions === "undefined" ? Object : CompressionOptions
220
- ]),
221
- _ts_metadata("design:returntype", void 0)
222
- ], BuilderExtensions, "withCompression", null);
223
- _ts_decorate([
224
- (0, _extensibility.extension)(_builder.Builder),
225
- _ts_metadata("design:type", Function),
226
- _ts_metadata("design:paramtypes", [
227
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
228
- Number
229
- ]),
230
- _ts_metadata("design:returntype", void 0)
231
- ], BuilderExtensions, "withBodyLimit", null);
232
- _ts_decorate([
233
- (0, _extensibility.extension)(_builder.Builder),
234
- _ts_metadata("design:type", Function),
235
- _ts_metadata("design:paramtypes", [
236
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
237
- Array
238
- ]),
239
- _ts_metadata("design:returntype", void 0)
240
- ], BuilderExtensions, "withMiddleware", null);
241
- _ts_decorate([
242
- (0, _extensibility.extension)(_builder.Builder),
243
- _ts_metadata("design:type", Function),
244
- _ts_metadata("design:paramtypes", [
245
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
246
- Array
247
- ]),
248
- _ts_metadata("design:returntype", void 0)
249
- ], BuilderExtensions, "withExceptionFilters", null);
250
- _ts_decorate([
251
- (0, _extensibility.extension)(_builder.Builder),
252
- _ts_metadata("design:type", Function),
253
- _ts_metadata("design:paramtypes", [
254
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
255
- typeof OpenApiOptions === "undefined" ? Object : OpenApiOptions
256
- ]),
257
- _ts_metadata("design:returntype", void 0)
258
- ], BuilderExtensions, "withOpenApi", null);
259
- _ts_decorate([
260
- (0, _extensibility.extension)(_builder.Builder),
261
- _ts_metadata("design:type", Function),
262
- _ts_metadata("design:paramtypes", [
263
- typeof _builder.Builder === "undefined" ? Object : _builder.Builder,
264
- String,
265
- String,
266
- typeof StaticOptions === "undefined" ? Object : StaticOptions
267
- ]),
268
- _ts_metadata("design:returntype", void 0)
269
- ], BuilderExtensions, "withStatic", null);
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "HttpOptions", {
6
- enumerable: true,
7
- get: function() {
8
- return HttpOptions;
9
- }
10
- });
11
- class HttpOptions {
12
- globalPrefix = "";
13
- /**
14
- * Controllers put under the global prefix although they declare `globalPrefix: false`
15
- * (`withHealth({ underGlobalPrefix: true })`).
16
- */ underGlobalPrefix = new Set();
17
- cors;
18
- openapi;
19
- /** `undefined` = helmet on with defaults; `false` = off; object = plugin options. */ helmet;
20
- /** `undefined` = rate-limit on with defaults; `false` = off; object = plugin options. */ rateLimit;
21
- /** `undefined` = compression on with defaults; `false` = off; object = options. See `withCompression`. */ compression;
22
- /** Request body size limit in bytes; `undefined` uses the 1 MiB default. */ bodyLimit;
23
- /** Built UIs served from this API, see `withStatic`. */ statics = [];
24
- middlewareTypes = [];
25
- filterTypes = [];
26
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "getOrCreateHttpOptions", {
6
- enumerable: true,
7
- get: function() {
8
- return getOrCreateHttpOptions;
9
- }
10
- });
11
- const _httpoptions = require("./http.options.js");
12
- const httpOptionsStore = new WeakMap();
13
- function getOrCreateHttpOptions(builder) {
14
- let options = httpOptionsStore.get(builder);
15
- if (options == null) {
16
- options = new _httpoptions.HttpOptions();
17
- httpOptionsStore.set(builder, options);
18
- }
19
- return options;
20
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * Default HTTP security settings applied by {@link FastifyProvider} when
3
- * `withHttpProvider` is used. Override via `withHelmet` / `withRateLimit` /
4
- * `withBodyLimit` (pass `false` to disable helmet or rate-limit).
5
- */ /** Fastify body size limit (bytes). Matches Fastify's built-in default, made explicit and overridable. */ "use strict";
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
- function _export(target, all) {
10
- for(var name in all)Object.defineProperty(target, name, {
11
- enumerable: true,
12
- get: Object.getOwnPropertyDescriptor(all, name).get
13
- });
14
- }
15
- _export(exports, {
16
- get DEFAULT_HTTP_BODY_LIMIT () {
17
- return DEFAULT_HTTP_BODY_LIMIT;
18
- },
19
- get DEFAULT_HTTP_RATE_LIMIT () {
20
- return DEFAULT_HTTP_RATE_LIMIT;
21
- }
22
- });
23
- const DEFAULT_HTTP_BODY_LIMIT = 1_048_576;
24
- const DEFAULT_HTTP_RATE_LIMIT = {
25
- max: 100,
26
- timeWindow: "1 minute"
27
- };