theokit 0.71.0 → 0.72.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/{actions-virtual-module-2SM6YMTM.js → actions-virtual-module-6LND2WHL.js} +4 -4
- package/dist/{actions-virtual-module-5LRBP6YK.js → actions-virtual-module-WP47EKD7.js} +3 -3
- package/dist/adapters/agent-mount.js +2 -2
- package/dist/{agent-4FXJXZFD.js → agent-KUP3XA2S.js} +2 -2
- package/dist/{app-typed-client-LIIPHLO6.js → app-typed-client-6VIHSYJH.js} +3 -3
- package/dist/{app-typed-client-JFPV4YLS.js → app-typed-client-IMRSVARP.js} +4 -4
- package/dist/{aws-lambda-MUGK4WNZ.js → aws-lambda-7AZNJGWU.js} +6 -4
- package/dist/{aws-lambda-MUGK4WNZ.js.map → aws-lambda-7AZNJGWU.js.map} +1 -1
- package/dist/{build-KCIH3HI6.js → build-4J24BAEC.js} +7 -7
- package/dist/build-4J24BAEC.js.map +1 -0
- package/dist/{bun-JWZ2UOLJ.js → bun-NKVHOFSJ.js} +6 -4
- package/dist/{bun-JWZ2UOLJ.js.map → bun-NKVHOFSJ.js.map} +1 -1
- package/dist/{chunk-PGDBSK2L.js → chunk-7CHPOMP5.js} +2 -2
- package/dist/{chunk-FWEXQ2BR.js → chunk-BZ6DFSKG.js} +8 -8
- package/dist/{chunk-IGCOTLQI.js → chunk-C5CAL3DX.js} +136 -5
- package/dist/{chunk-IGCOTLQI.js.map → chunk-C5CAL3DX.js.map} +1 -1
- package/dist/{chunk-OSBGZYXZ.js → chunk-D2R5SJEL.js} +16 -2
- package/dist/chunk-D2R5SJEL.js.map +1 -0
- package/dist/{chunk-5XXXJ6DT.js → chunk-EZHDAVAF.js} +23 -7
- package/dist/chunk-EZHDAVAF.js.map +1 -0
- package/dist/{chunk-3DGIANAN.js → chunk-FJEKQ4FT.js} +1 -1
- package/dist/{chunk-3DGIANAN.js.map → chunk-FJEKQ4FT.js.map} +1 -1
- package/dist/{chunk-KI4DOTN4.js → chunk-G7U7FQVC.js} +3 -1
- package/dist/chunk-G7U7FQVC.js.map +1 -0
- package/dist/{chunk-6AGXDYVE.js → chunk-IB5VIXLR.js} +2 -2
- package/dist/{chunk-3NAKOWTX.js → chunk-IVGQMV3S.js} +2 -2
- package/dist/{chunk-Q4NSUGMS.js → chunk-JJXBRY2U.js} +74 -6
- package/dist/chunk-JJXBRY2U.js.map +1 -0
- package/dist/{chunk-DSPEN7ZJ.js → chunk-LJNMSKFL.js} +4 -4
- package/dist/{chunk-MS4A7N77.js → chunk-PEL3MJLM.js} +2 -2
- package/dist/{chunk-V6VARIR3.js → chunk-RDG5GMDW.js} +9 -9
- package/dist/{chunk-TNI4MARH.js → chunk-SFGGRC35.js} +23 -6
- package/dist/chunk-SFGGRC35.js.map +1 -0
- package/dist/{chunk-FFS7IRZF.js → chunk-SZWGXHY3.js} +2 -2
- package/dist/{chunk-SX7ZAHNE.js → chunk-WBB3MEEN.js} +16 -2
- package/dist/chunk-WBB3MEEN.js.map +1 -0
- package/dist/{chunk-TMQ52AZR.js → chunk-X2LFNDJQ.js} +2 -2
- package/dist/{chunk-NZDGV4YJ.js → chunk-YCF3N4JS.js} +2 -2
- package/dist/cli/index.js +9 -9
- package/dist/{cloudflare-XO43ZIQF.js → cloudflare-4M4XVNUH.js} +5 -3
- package/dist/{cloudflare-XO43ZIQF.js.map → cloudflare-4M4XVNUH.js.map} +1 -1
- package/dist/{config-support-O4REYSK5.js → config-support-SB5NDQZB.js} +11 -5
- package/dist/{config-support-O4REYSK5.js.map → config-support-SB5NDQZB.js.map} +1 -1
- package/dist/{deno-deploy-EUQDK2RC.js → deno-deploy-IVACZ62D.js} +11 -5
- package/dist/deno-deploy-IVACZ62D.js.map +1 -0
- package/dist/{dev-CD4YU5FN.js → dev-JZVHEYN4.js} +9 -9
- package/dist/index.d.ts +12 -2
- package/dist/index.js +4 -4
- package/dist/{info-2H7I55YN.js → info-SUX7QVA3.js} +4 -4
- package/dist/{internal-api-TMLSNYMP.js → internal-api-3IZVNNGB.js} +3 -3
- package/dist/{internal-api-WAKX6AZW.js → internal-api-BNDRCEPZ.js} +4 -4
- package/dist/{load-config-VMKOV44Y.js → load-config-52H3EKAA.js} +4 -4
- package/dist/{mcp-HS26ZCU4.js → mcp-HCXHATU3.js} +3 -3
- package/dist/{netlify-LEYEQZK6.js → netlify-3HEWV375.js} +6 -4
- package/dist/{netlify-LEYEQZK6.js.map → netlify-3HEWV375.js.map} +1 -1
- package/dist/{node-OSVPYQ3D.js → node-QUGTW6XV.js} +2 -2
- package/dist/{observability-bootstrap-YQKMEYW7.js → observability-bootstrap-FP6LMMJE.js} +3 -3
- package/dist/{openapi-N4CXRUNT.js → openapi-Q53YOBIU.js} +4 -4
- package/dist/{preview-YDJSRJ2K.js → preview-FSUPVADO.js} +3 -3
- package/dist/{rate-limit-BdNDZ3vt.d.ts → rate-limit-fULgvzCz.d.ts} +11 -1
- package/dist/{rate-limit-store-BEJnhWdw.d.ts → rate-limit-store-n1wD4Yk4.d.ts} +48 -1
- package/dist/registry-SDBODRU6.js +23 -0
- package/dist/{routes-ECCDRHXZ.js → routes-FDF4SLOB.js} +4 -4
- package/dist/{schema-ND7GHPQK.js → schema-LHNWUR4V.js} +3 -3
- package/dist/{schemas-QCMSKQDK.js → schemas-2R2J64ZH.js} +2 -2
- package/dist/server/auth/index.d.ts +1 -1
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +10 -4
- package/dist/server/index.js.map +1 -1
- package/dist/server/rate-limit/index.d.ts +96 -14
- package/dist/server/rate-limit/index.js +10 -4
- package/dist/server/storage/index.js +1 -1
- package/dist/{server-boundary-RX2AFU5U.js → server-boundary-P52I6YMH.js} +4 -4
- package/dist/{server-boundary-NZPP33G6.js → server-boundary-WUKORSW2.js} +3 -3
- package/dist/{start-TYXS5I4M.js → start-LCA67RES.js} +14 -11
- package/dist/start-LCA67RES.js.map +1 -0
- package/dist/{static-7OJNB7D2.js → static-NQPLPAB6.js} +6 -2
- package/dist/{static-7OJNB7D2.js.map → static-NQPLPAB6.js.map} +1 -1
- package/dist/{theo-cloud-3ET4G5T6.js → theo-cloud-HMFNZ3FS.js} +3 -1
- package/dist/{theo-cloud-3ET4G5T6.js.map → theo-cloud-HMFNZ3FS.js.map} +1 -1
- package/dist/{vercel-HTAWCNAG.js → vercel-5PMYEEKF.js} +6 -4
- package/dist/{vercel-HTAWCNAG.js.map → vercel-5PMYEEKF.js.map} +1 -1
- package/dist/vite-plugin/index.d.ts +2 -2
- package/dist/vite-plugin/index.js +4 -4
- package/dist/{vite-plugin-DDILUFYY.js → vite-plugin-WFA7NPYK.js} +8 -8
- package/package.json +1 -1
- package/dist/build-KCIH3HI6.js.map +0 -1
- package/dist/chunk-5XXXJ6DT.js.map +0 -1
- package/dist/chunk-KI4DOTN4.js.map +0 -1
- package/dist/chunk-OSBGZYXZ.js.map +0 -1
- package/dist/chunk-Q4NSUGMS.js.map +0 -1
- package/dist/chunk-SX7ZAHNE.js.map +0 -1
- package/dist/chunk-TNI4MARH.js.map +0 -1
- package/dist/deno-deploy-EUQDK2RC.js.map +0 -1
- package/dist/registry-4JHCZ6EF.js +0 -23
- package/dist/start-TYXS5I4M.js.map +0 -1
- /package/dist/{actions-virtual-module-2SM6YMTM.js.map → actions-virtual-module-6LND2WHL.js.map} +0 -0
- /package/dist/{actions-virtual-module-5LRBP6YK.js.map → actions-virtual-module-WP47EKD7.js.map} +0 -0
- /package/dist/{agent-4FXJXZFD.js.map → agent-KUP3XA2S.js.map} +0 -0
- /package/dist/{app-typed-client-LIIPHLO6.js.map → app-typed-client-6VIHSYJH.js.map} +0 -0
- /package/dist/{app-typed-client-JFPV4YLS.js.map → app-typed-client-IMRSVARP.js.map} +0 -0
- /package/dist/{chunk-PGDBSK2L.js.map → chunk-7CHPOMP5.js.map} +0 -0
- /package/dist/{chunk-FWEXQ2BR.js.map → chunk-BZ6DFSKG.js.map} +0 -0
- /package/dist/{chunk-6AGXDYVE.js.map → chunk-IB5VIXLR.js.map} +0 -0
- /package/dist/{chunk-3NAKOWTX.js.map → chunk-IVGQMV3S.js.map} +0 -0
- /package/dist/{chunk-DSPEN7ZJ.js.map → chunk-LJNMSKFL.js.map} +0 -0
- /package/dist/{chunk-MS4A7N77.js.map → chunk-PEL3MJLM.js.map} +0 -0
- /package/dist/{chunk-V6VARIR3.js.map → chunk-RDG5GMDW.js.map} +0 -0
- /package/dist/{chunk-FFS7IRZF.js.map → chunk-SZWGXHY3.js.map} +0 -0
- /package/dist/{chunk-TMQ52AZR.js.map → chunk-X2LFNDJQ.js.map} +0 -0
- /package/dist/{chunk-NZDGV4YJ.js.map → chunk-YCF3N4JS.js.map} +0 -0
- /package/dist/{dev-CD4YU5FN.js.map → dev-JZVHEYN4.js.map} +0 -0
- /package/dist/{info-2H7I55YN.js.map → info-SUX7QVA3.js.map} +0 -0
- /package/dist/{internal-api-TMLSNYMP.js.map → internal-api-3IZVNNGB.js.map} +0 -0
- /package/dist/{internal-api-WAKX6AZW.js.map → internal-api-BNDRCEPZ.js.map} +0 -0
- /package/dist/{load-config-VMKOV44Y.js.map → load-config-52H3EKAA.js.map} +0 -0
- /package/dist/{mcp-HS26ZCU4.js.map → mcp-HCXHATU3.js.map} +0 -0
- /package/dist/{node-OSVPYQ3D.js.map → node-QUGTW6XV.js.map} +0 -0
- /package/dist/{observability-bootstrap-YQKMEYW7.js.map → observability-bootstrap-FP6LMMJE.js.map} +0 -0
- /package/dist/{openapi-N4CXRUNT.js.map → openapi-Q53YOBIU.js.map} +0 -0
- /package/dist/{preview-YDJSRJ2K.js.map → preview-FSUPVADO.js.map} +0 -0
- /package/dist/{registry-4JHCZ6EF.js.map → registry-SDBODRU6.js.map} +0 -0
- /package/dist/{routes-ECCDRHXZ.js.map → routes-FDF4SLOB.js.map} +0 -0
- /package/dist/{schema-ND7GHPQK.js.map → schema-LHNWUR4V.js.map} +0 -0
- /package/dist/{schemas-QCMSKQDK.js.map → schemas-2R2J64ZH.js.map} +0 -0
- /package/dist/{server-boundary-RX2AFU5U.js.map → server-boundary-P52I6YMH.js.map} +0 -0
- /package/dist/{server-boundary-NZPP33G6.js.map → server-boundary-WUKORSW2.js.map} +0 -0
- /package/dist/{vite-plugin-DDILUFYY.js.map → vite-plugin-WFA7NPYK.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IncomingMessage } from 'node:http';
|
|
2
|
-
import { R as RateLimitConfig, a as RateLimitResult } from '../../rate-limit-
|
|
3
|
-
export { c as createRateLimiter, b as createRateLimiterWeb } from '../../rate-limit-
|
|
4
|
-
import { R as RateLimitStore } from '../../rate-limit-store-
|
|
5
|
-
export { I as InMemoryStore, a as RateLimitState } from '../../rate-limit-store-
|
|
2
|
+
import { R as RateLimitConfig, a as RateLimitResult } from '../../rate-limit-fULgvzCz.js';
|
|
3
|
+
export { c as createRateLimiter, b as createRateLimiterWeb } from '../../rate-limit-fULgvzCz.js';
|
|
4
|
+
import { R as RateLimitStore, B as BakedStoreDeclaration } from '../../rate-limit-store-n1wD4Yk4.js';
|
|
5
|
+
export { I as InMemoryStore, a as RateLimitState, s as slidingCount } from '../../rate-limit-store-n1wD4Yk4.js';
|
|
6
6
|
import { CanActivate } from '@theokit/http';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -73,8 +73,20 @@ interface RouteRateLimitConfig {
|
|
|
73
73
|
keyBy?: KeyByMode;
|
|
74
74
|
/** Cookie name used by keyBy='session'. Defaults to 'theo_session'. */
|
|
75
75
|
cookieName?: string;
|
|
76
|
-
/**
|
|
77
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Optional shared store (for multi-route correlation). Default per-limiter InMemoryStore.
|
|
78
|
+
*
|
|
79
|
+
* B-257 widened this to a union, and the second arm is not a store this runner uses. A deployed
|
|
80
|
+
* entry's BUILD-time declaration — `{ module, factory, options }` from
|
|
81
|
+
* `config/schemas/rate-limit.ts` — lands on the same key, because `theokit start` hands the
|
|
82
|
+
* parsed config straight to `createRouteRateLimiter`. `runtimeStore()` below discriminates on
|
|
83
|
+
* `incr` and drops the declaration.
|
|
84
|
+
*
|
|
85
|
+
* The union is declared rather than the parameter widened at the call site: a cast there would
|
|
86
|
+
* make the collision invisible to every other reader of this type, and the collision is the fact
|
|
87
|
+
* worth carrying.
|
|
88
|
+
*/
|
|
89
|
+
store?: RateLimitStore | BakedStoreDeclaration;
|
|
78
90
|
/**
|
|
79
91
|
* How many reverse proxies sit in front of the app, for `keyBy: 'ip'`. Default `false` — trust
|
|
80
92
|
* none and key on the socket address.
|
|
@@ -104,13 +116,6 @@ declare function matchRoutePattern(path: string, pattern: string | RegExp): bool
|
|
|
104
116
|
* than sharing an empty bucket.
|
|
105
117
|
*/
|
|
106
118
|
declare function deriveKey(req: IncomingMessage, keyBy: KeyByMode, cookieName: string, trustProxy?: TrustProxy): Promise<string>;
|
|
107
|
-
/**
|
|
108
|
-
* Per-route rate limiter factory. Returns a sync checker compatible with
|
|
109
|
-
* the existing api-middleware shape.
|
|
110
|
-
*
|
|
111
|
-
* Backwards-compatibility (ADR D2): a flat `{ windowMs, max }` config is
|
|
112
|
-
* accepted and treated as `default` (no per-route variants).
|
|
113
|
-
*/
|
|
114
119
|
declare function createRouteRateLimiter(config: RouteRateLimitConfig | RateLimitConfig): (req: IncomingMessage) => Promise<RateLimitResult>;
|
|
115
120
|
/**
|
|
116
121
|
* T5a.2 Phase D slice 1/3 — Web-Standards rate-limiter inputs context.
|
|
@@ -290,4 +295,81 @@ interface RateLimitedOptions extends RateLimitConfig {
|
|
|
290
295
|
*/
|
|
291
296
|
declare function RateLimited(options: RateLimitedOptions): new () => CanActivate;
|
|
292
297
|
|
|
293
|
-
|
|
298
|
+
/**
|
|
299
|
+
* A rate limiter that AWAITS the store it was given — B-257, decided by
|
|
300
|
+
* [ADR 0018](../../../../../docs/adr/0018-a-durable-rate-limit-gets-its-own-path-beside-the-sync-facade.md).
|
|
301
|
+
*
|
|
302
|
+
* ## Why this is new surface rather than a reshaped `createRateLimiterWeb`
|
|
303
|
+
*
|
|
304
|
+
* That facade declares `opts.store` and then refuses anything that is not an `InMemoryStore`
|
|
305
|
+
* (`rate-limit.ts:110`, throwing at `:118-121`), because its closure returns `RateLimitResult`
|
|
306
|
+
* synchronously and cannot await. Every durable store is network-backed and therefore async, so the
|
|
307
|
+
* declared seam rejects exactly the class of store the problem requires.
|
|
308
|
+
*
|
|
309
|
+
* Changing that signature would spend a breaking change on a **promise owed** — the symbol is
|
|
310
|
+
* recorded as one in `docs/api/rate-limit-subpath-surface.md:25` — reached through `theokit/server`,
|
|
311
|
+
* an umbrella the same row records as **DEPRECATED, removal at `0.x+2`**. A break on a path that
|
|
312
|
+
* disappears two minors later costs a break's full price for two minors of use. The path beside it
|
|
313
|
+
* costs two code paths for one concept, which is bounded and reversible: when the umbrella goes, the
|
|
314
|
+
* facade can follow.
|
|
315
|
+
*
|
|
316
|
+
* So the facade keeps its signature, its guard and its throw. Its error message stays accurate.
|
|
317
|
+
*
|
|
318
|
+
* ## What this does NOT do
|
|
319
|
+
*
|
|
320
|
+
* It ships no store. `rate-limit-store.ts:5-7` names Redis and Cloudflare KV as what a deployment
|
|
321
|
+
* OPTS INTO, and `docs/adr/0017:32-34` states the principle: *"a framework that shipped one would be
|
|
322
|
+
* choosing everybody's datastore."* This is the path by which an application reaches a store it
|
|
323
|
+
* brought.
|
|
324
|
+
*
|
|
325
|
+
* `unstorage` is not a shortcut: its declared surface (`server/storage/use-unstorage.ts:32-40`) has
|
|
326
|
+
* no atomic increment, so a read-then-write over it is the race `rate-limit-store.ts:10-12` exists
|
|
327
|
+
* to prevent.
|
|
328
|
+
*/
|
|
329
|
+
declare function createDurableRateLimiterWeb(config: RateLimitConfig, opts: {
|
|
330
|
+
store: RateLimitStore;
|
|
331
|
+
}): (clientIp: string) => Promise<RateLimitResult>;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* The limiter's wiring, as a REAL file the compiler reads.
|
|
335
|
+
*
|
|
336
|
+
* ## Why it lives in `server/` and not beside the adapter that emits its call
|
|
337
|
+
*
|
|
338
|
+
* It was written under `adapters/entries/` first, and `/code-quality` refused it: the declared rule
|
|
339
|
+
* `adapters-may-only-depend-on-core-router-services` lets `adapters/` reach `core/`, `router/`,
|
|
340
|
+
* `services/` and `config/`, and nothing else. The plan had asserted "architecture boundary crossed:
|
|
341
|
+
* none" without checking that rule, and the gate was right — this file is RUNTIME wiring. It builds
|
|
342
|
+
* the limiter a request is answered by; it does not participate in the build. `server/` is where the
|
|
343
|
+
* thing it wires already lives.
|
|
344
|
+
*
|
|
345
|
+
* B-262 — this file exists because of a measurement taken while implementing the task that preceded
|
|
346
|
+
* it. The first design moved the limiter's import inside the emitted string, from
|
|
347
|
+
* `theokit/server/rate-limit` to a bundler virtual id, and claimed that gave `tsc` sight of the
|
|
348
|
+
* symbol. It does not: `renderCloudflareWorkerEntry` RETURNS a 215-line string, and
|
|
349
|
+
* `tsconfig.json` includes the package-source include pattern — source, never build output. **No string is
|
|
350
|
+
* type-checked, whatever its import says.**
|
|
351
|
+
*
|
|
352
|
+
* B-257 paid the bill for that invisibility: `createDurableRateLimiterWeb` was used at module scope
|
|
353
|
+
* in an emitted entry and never imported, the entry threw when it LOADED, and the compiler reported
|
|
354
|
+
* nothing. The only instrument that caught it was a test that loads and drives the generated entry.
|
|
355
|
+
*
|
|
356
|
+
* Deleting either import below fails `npx tsc --noEmit`, naming the symbol, before any test runs.
|
|
357
|
+
* That is the whole reason this is a file rather than a fragment.
|
|
358
|
+
*
|
|
359
|
+
* ## What stays emitted, and why it must
|
|
360
|
+
*
|
|
361
|
+
* The VALUES — the window, the max, the store the app named — exist only at build time, so they
|
|
362
|
+
* cannot live here. They arrive as arguments. The adapter emits the call; this file holds the
|
|
363
|
+
* decision the call is made of.
|
|
364
|
+
*/
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* The limiter a deployed entry should use, given what the app declared.
|
|
368
|
+
*
|
|
369
|
+
* Always async, whichever branch runs. The sync facade returns a value and the durable one returns a
|
|
370
|
+
* Promise, and an entry that had to know which it got would be an entry whose call site changes with
|
|
371
|
+
* the config — the shape that produced B-257's `await` defect. One signature removes the question.
|
|
372
|
+
*/
|
|
373
|
+
declare function buildRateLimiter(config: RateLimitConfig, store: RateLimitStore | undefined): (clientIp: string) => Promise<RateLimitResult>;
|
|
374
|
+
|
|
375
|
+
export { BakedStoreDeclaration, type DeriveKeyRequestContext, type KeyByMode, RateLimitConfig, RateLimitResult, RateLimitStore, RateLimited, type RateLimitedKeyBy, type RateLimitedOptions, type RouteRateLimitConfig, type TrustProxy, buildRateLimiter, createDurableRateLimiterWeb, createRouteRateLimiter, createRouteRateLimiterWeb, deriveKey, deriveKeyFromRequest, matchRoutePattern, resolveClientIp, resolveClientIpFromRequest };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RateLimited,
|
|
3
|
+
buildRateLimiter,
|
|
4
|
+
createDurableRateLimiterWeb,
|
|
3
5
|
createRouteRateLimiter,
|
|
4
6
|
createRouteRateLimiterWeb,
|
|
5
7
|
deriveKey,
|
|
@@ -7,17 +9,20 @@ import {
|
|
|
7
9
|
matchRoutePattern,
|
|
8
10
|
resolveClientIp,
|
|
9
11
|
resolveClientIpFromRequest
|
|
10
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-JJXBRY2U.js";
|
|
11
13
|
import {
|
|
12
14
|
InMemoryStore,
|
|
13
15
|
createRateLimiter,
|
|
14
|
-
createRateLimiterWeb
|
|
15
|
-
|
|
16
|
+
createRateLimiterWeb,
|
|
17
|
+
slidingCount
|
|
18
|
+
} from "../../chunk-SFGGRC35.js";
|
|
16
19
|
import "../../chunk-4FWBKX6G.js";
|
|
17
20
|
import "../../chunk-XTHN6JBX.js";
|
|
18
21
|
export {
|
|
19
22
|
InMemoryStore,
|
|
20
23
|
RateLimited,
|
|
24
|
+
buildRateLimiter,
|
|
25
|
+
createDurableRateLimiterWeb,
|
|
21
26
|
createRateLimiter,
|
|
22
27
|
createRateLimiterWeb,
|
|
23
28
|
createRouteRateLimiter,
|
|
@@ -26,6 +31,7 @@ export {
|
|
|
26
31
|
deriveKeyFromRequest,
|
|
27
32
|
matchRoutePattern,
|
|
28
33
|
resolveClientIp,
|
|
29
|
-
resolveClientIpFromRequest
|
|
34
|
+
resolveClientIpFromRequest,
|
|
35
|
+
slidingCount
|
|
30
36
|
};
|
|
31
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,11 +3,11 @@ import "tsx/esm";
|
|
|
3
3
|
import {
|
|
4
4
|
resolveTheoRootDir
|
|
5
5
|
} from "./chunk-FDOOBTXJ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-EZHDAVAF.js";
|
|
7
7
|
import "./chunk-BINRCILF.js";
|
|
8
8
|
import "./chunk-QD5X56I3.js";
|
|
9
9
|
import "./chunk-WSMLSIS5.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-PEL3MJLM.js";
|
|
11
11
|
import "./chunk-C27VRUVN.js";
|
|
12
12
|
import "./chunk-7UZZHCRN.js";
|
|
13
13
|
import "./chunk-RCFD5W5V.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-NO6HA4FG.js";
|
|
18
18
|
import "./chunk-Z7CJHDLS.js";
|
|
19
19
|
import "./chunk-U5PWXS3J.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-D2R5SJEL.js";
|
|
21
21
|
import "./chunk-VQIUTCK2.js";
|
|
22
22
|
|
|
23
23
|
// src/vite-plugin/server-boundary.ts
|
|
@@ -131,4 +131,4 @@ export {
|
|
|
131
131
|
ServerOnlyImportError,
|
|
132
132
|
serverOnlyImportBoundary
|
|
133
133
|
};
|
|
134
|
-
//# sourceMappingURL=server-boundary-
|
|
134
|
+
//# sourceMappingURL=server-boundary-P52I6YMH.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
resolveTheoRootDir
|
|
3
3
|
} from "./chunk-7NRFZBAL.js";
|
|
4
4
|
import "./chunk-JMN4COMK.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-WBB3MEEN.js";
|
|
6
6
|
import "./chunk-WSOAN4KN.js";
|
|
7
7
|
import "./chunk-ENSFCKP6.js";
|
|
8
8
|
import "./chunk-KOG5K26V.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-ZDCCILMP.js";
|
|
|
17
17
|
import "./chunk-CHTAWXC2.js";
|
|
18
18
|
import "./chunk-AVQU5CQF.js";
|
|
19
19
|
import "./chunk-VSLTKX5L.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-SFGGRC35.js";
|
|
21
21
|
import "./chunk-4ERYQBL6.js";
|
|
22
22
|
import {
|
|
23
23
|
ACTION_SCHEMAS_DIR
|
|
@@ -147,4 +147,4 @@ export {
|
|
|
147
147
|
ServerOnlyImportError,
|
|
148
148
|
serverOnlyImportBoundary
|
|
149
149
|
};
|
|
150
|
-
//# sourceMappingURL=server-boundary-
|
|
150
|
+
//# sourceMappingURL=server-boundary-WUKORSW2.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-46FM5AFZ.js";
|
|
13
13
|
import {
|
|
14
14
|
initCacheEngineFromConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YCF3N4JS.js";
|
|
16
16
|
import {
|
|
17
17
|
preflightNodeAndBindings
|
|
18
18
|
} from "./chunk-KTMQUYED.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
resolveTransformer,
|
|
30
30
|
serveMatchedAuxRoute,
|
|
31
31
|
serveThroughPluginLifecycle
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-7CHPOMP5.js";
|
|
33
33
|
import "./chunk-BDH5GKFZ.js";
|
|
34
34
|
import {
|
|
35
35
|
findRootDiv
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
mountAgent,
|
|
46
46
|
readAgentPolicy,
|
|
47
47
|
writeWebResponseToServerResponse
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-EZHDAVAF.js";
|
|
49
49
|
import {
|
|
50
50
|
getApprovalRegistry,
|
|
51
51
|
resolveProvider
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
createObservabilityPluginFromConfig,
|
|
65
65
|
extractTraceId,
|
|
66
66
|
generateNewTraceContext
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-PEL3MJLM.js";
|
|
68
68
|
import {
|
|
69
69
|
logRequest,
|
|
70
70
|
warnOnce
|
|
@@ -85,14 +85,14 @@ import {
|
|
|
85
85
|
import "./chunk-Z7CJHDLS.js";
|
|
86
86
|
import {
|
|
87
87
|
loadConfig
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-SZWGXHY3.js";
|
|
89
89
|
import {
|
|
90
90
|
loadEnv
|
|
91
91
|
} from "./chunk-3QPVEJ7D.js";
|
|
92
92
|
import "./chunk-U5PWXS3J.js";
|
|
93
|
-
import "./chunk-
|
|
93
|
+
import "./chunk-X2LFNDJQ.js";
|
|
94
94
|
import "./chunk-ZNZISJDZ.js";
|
|
95
|
-
import "./chunk-
|
|
95
|
+
import "./chunk-D2R5SJEL.js";
|
|
96
96
|
import "./chunk-VQIUTCK2.js";
|
|
97
97
|
|
|
98
98
|
// src/cli/commands/start/index.ts
|
|
@@ -271,10 +271,13 @@ async function deriveKey(req, keyBy, cookieName, trustProxy = false) {
|
|
|
271
271
|
return `ip:${ip}`;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
+
function runtimeStore(store) {
|
|
275
|
+
return typeof store?.incr === "function" ? store : void 0;
|
|
276
|
+
}
|
|
274
277
|
function createRouteRateLimiter(config) {
|
|
275
278
|
const isFlat = "windowMs" in config && "max" in config && !("default" in config) && !("routes" in config);
|
|
276
279
|
const cfg = isFlat ? { default: config } : config;
|
|
277
|
-
const store = cfg.store ?? new InMemoryStore();
|
|
280
|
+
const store = runtimeStore(cfg.store) ?? new InMemoryStore();
|
|
278
281
|
if (!(store instanceof InMemoryStore)) {
|
|
279
282
|
throw new Error(
|
|
280
283
|
"createRouteRateLimiter: async RateLimitStore implementations require a dedicated async middleware path. Use the InMemoryStore default for the sync facade."
|
|
@@ -433,7 +436,7 @@ async function configureStorageManagerFromConfig(storageConfig) {
|
|
|
433
436
|
if (storageConfig === void 0 || storageConfig === null) return;
|
|
434
437
|
try {
|
|
435
438
|
const { getStorageManager } = await import("./storage-manager-3O5PDO6O.js");
|
|
436
|
-
const { storageSchema } = await import("./schema-
|
|
439
|
+
const { storageSchema } = await import("./schema-LHNWUR4V.js");
|
|
437
440
|
const parsed = storageSchema.parse(storageConfig);
|
|
438
441
|
getStorageManager().configure(parsed);
|
|
439
442
|
} catch (err) {
|
|
@@ -512,7 +515,7 @@ function installGracefulShutdown(server) {
|
|
|
512
515
|
});
|
|
513
516
|
}
|
|
514
517
|
try {
|
|
515
|
-
const { getObservabilityAdapter } = await import("./observability-bootstrap-
|
|
518
|
+
const { getObservabilityAdapter } = await import("./observability-bootstrap-FP6LMMJE.js");
|
|
516
519
|
await getObservabilityAdapter()?.shutdown();
|
|
517
520
|
} catch (err) {
|
|
518
521
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -1428,4 +1431,4 @@ export {
|
|
|
1428
1431
|
resolveSsrEntry,
|
|
1429
1432
|
startCommand
|
|
1430
1433
|
};
|
|
1431
|
-
//# sourceMappingURL=start-
|
|
1434
|
+
//# sourceMappingURL=start-LCA67RES.js.map
|