@lenne.tech/nest-server 12.8.8 → 12.9.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/.claude/rules/architecture.md +1 -1
- package/.claude/rules/configurable-features.md +1 -0
- package/.claude/rules/testing.md +4 -4
- package/CLAUDE.md +2 -2
- package/FRAMEWORK-API.md +7 -1
- package/bin/check-unified-field-types.js +15 -3
- package/dist/core/common/decorators/unified-field.decorator.js +10 -11
- package/dist/core/common/decorators/unified-field.decorator.js.map +1 -1
- package/dist/core/common/helpers/idle-stream.helper.d.ts +14 -0
- package/dist/core/common/helpers/idle-stream.helper.js +94 -0
- package/dist/core/common/helpers/idle-stream.helper.js.map +1 -0
- package/dist/core/common/interfaces/server-options.interface.d.ts +6 -0
- package/dist/core/common/services/core-s3.service.d.ts +27 -1
- package/dist/core/common/services/core-s3.service.js +89 -3
- package/dist/core/common/services/core-s3.service.js.map +1 -1
- package/dist/core/modules/file/core-file.controller.d.ts +16 -0
- package/dist/core/modules/file/core-file.controller.js +215 -8
- package/dist/core/modules/file/core-file.controller.js.map +1 -1
- package/dist/core/modules/file/core-file.service.d.ts +5 -0
- package/dist/core/modules/file/core-file.service.js +17 -7
- package/dist/core/modules/file/core-file.service.js.map +1 -1
- package/dist/core/modules/file/interfaces/file-service-options.interface.d.ts +2 -0
- package/dist/core/modules/file/s3-file.helper.d.ts +4 -1
- package/dist/core/modules/file/s3-file.helper.js +2 -2
- package/dist/core/modules/file/s3-file.helper.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -3
- package/dist/main.js.map +1 -1
- package/docs/REQUEST-LIFECYCLE.md +6 -6
- package/migration-guides/12.8.6-to-12.8.7.md +3 -3
- package/migration-guides/12.8.8-to-12.8.9.md +149 -0
- package/migration-guides/12.8.x-to-12.9.x.md +105 -0
- package/package.json +4 -4
- package/src/core/common/decorators/unified-field.decorator.ts +20 -22
- package/src/core/common/helpers/idle-stream.helper.ts +192 -0
- package/src/core/common/interfaces/server-options.interface.ts +78 -0
- package/src/core/common/services/core-s3.service.ts +186 -3
- package/src/core/modules/file/INTEGRATION-CHECKLIST.md +15 -14
- package/src/core/modules/file/README.md +48 -0
- package/src/core/modules/file/core-file.controller.ts +356 -10
- package/src/core/modules/file/core-file.service.ts +46 -7
- package/src/core/modules/file/interfaces/file-service-options.interface.ts +22 -0
- package/src/core/modules/file/s3-file.helper.ts +6 -2
- package/src/index.ts +1 -0
- package/src/main.ts +3 -3
|
@@ -257,7 +257,7 @@ Full background, failure analysis and the mistakes table: `.claude/rules/better-
|
|
|
257
257
|
- `@UnifiedField()` - Single decorator for GraphQL, Swagger, and validation (replaces separate `@Field`, `@ApiProperty`, `@IsOptional`, etc.)
|
|
258
258
|
- Automatic input property whitelisting — properties without `@UnifiedField` are stripped (default) or rejected
|
|
259
259
|
- `@UnifiedField({ exclude: true })` — explicitly exclude a property from input (hidden from schema, rejected at runtime)
|
|
260
|
-
- Without `type`, `@UnifiedField` takes the type from `design:type`, and the SWC dev start writes that per file: a union with `null` / `undefined`, a type alias or `boolean | null` become `Object` where the tsc build writes `Number` / `String` / `Boolean` — the dev API
|
|
260
|
+
- Without `type`, `@UnifiedField` takes the type from `design:type`, and the SWC dev start writes that per file: a union with `null` / `undefined`, a type alias or `boolean | null` become `Object` where the tsc build writes `Number` / `String` / `Boolean` — the dev API validated the field as a nested object. Since 12.9.0 such a field (and any other whose `design:type` is only `Object`: `any`, `Record`, an interface, a mixed enum) is refused at boot unless it sets `type`, `isAny` or `enum` (12.8.7 warned). For an enum SWC writes the enum object; `designTypeOf()` reads it as `String` / `Number` like tsc (12.8.7 — before, an enum field with `mongoose` crashed the schema build). Declare `type` for anything but `number`, `string`, `boolean`, `Date`, an enum, a value-imported class or an in-place string literal union. `bin/check-unified-field-types.js` (package bin `nest-check-unified-field-types`; `check:unified-field-types`, part of `check`; `-- --fix` in `check:fix`) finds every such field and writes the declared type — the one tsc uses, except under `strictNullChecks` (marked `[changes the deployed build]`)
|
|
261
261
|
- `@UnifiedField({ exclude: false })` — explicitly re-enable a property excluded by a parent class
|
|
262
262
|
- Configurable via `security.mapAndValidatePipe.nonWhitelistedFields`: `'strip'` (default), `'error'`, or `false`
|
|
263
263
|
- Custom decorator parameters (`@CurrentUser()`, `@RESTServiceOptions()`, etc.) and basic types (`String`, `Number`, etc.) are skipped — no validation or whitelist check
|
|
@@ -342,6 +342,7 @@ This pattern is currently applied to:
|
|
|
342
342
|
| File Access Roles | `file.downloadRoles`, `file.uploadRoles`, `file.deleteRoles` | Config-Driven Role List | `[RoleEnum.ADMIN]` each. **These are the only breaking change a single-replica project gets in 11.33.0** — six members moved from `@Roles(S_EVERYONE)` to these knobs: `GET /files/id/:id`, `GET /files/:filename` and `getFileInfo` (`downloadRoles`), `uploadFile` / `uploadFiles` (`uploadRoles`), `deleteFile` (`deleteRoles`). Plain role STRINGS, not `RoleEnum` members, so project roles work (`['company-admin', 'editor']`). Applied at boot by `applyFileRoles()` via `Reflect.defineMetadata('roles', …)` on the base-class methods — the same runtime mechanism `CorePermissionsModule` uses, because the value is only known from config. **`[]`, a non-array, or an array holding a non-string is REJECTED with a warning and the default applies** — an all-empty role set reads to the guards as "no roles required" and would OPEN the route, the exact opposite of the intent. **ADMIN is always unioned in**: both `CoreFileController` and `CoreFileResolver` carry a class-level `@Roles(RoleEnum.ADMIN)` and the guards UNION class + handler metadata, so these knobs can grant but never exclude admins. Both classes also carry `@SkipTenantCheck()` — GridFS and the S3 metadata collection are reached outside Mongoose, so `mongooseTenantPlugin` never scopes them and a role name alone cannot express a per-tenant rule; roles resolve against `user.roles`, never `membership.role`. **A subclass that OVERRIDES a member opts out permanently** (decorator metadata lives on the function object, and an override is a different function) — inherit the member instead. **Since 11.35.1 that opt-out is REPORTED**: `CoreFileAccessAuditInitializer` reads the roles off the class the project actually registered at `onApplicationBootstrap` (the earliest point at which the route table exists, which is why it is a provider and not part of `applyFileRoles()`) and warns when a member is open beyond ADMIN for a reason the configuration cannot explain — the case the construction-time warning below is structurally blind to. It only REPORTS: overwriting an override's metadata, the way `TusModule.applyRoles()` does, would silently relax a route a project pinned on purpose. Roles are the coarse filter only; per-file rules belong in `CoreFileService.checkRights()`, which now receives `currentUser` and can read raw metadata via `getRawFileInfo()`. **Since 11.35.0 a reused FILENAME resolves to the most recent file** in all three stores (`uploadDate` desc, `_id` tie-break) and every by-name read path resolves a document and then reads by ID — under GridFS the by-name metadata lookup answered the oldest document while `openDownloadStreamByName()` served the newest, so a per-file rule approved one file and the bytes of another came back. Consequence: `duplicateById()` keeps the source's filename and the copy carries no metadata, so the copy now wins the name and an `ownerId` rule refuses it — give the copy its own metadata or its own name. **Since 11.35.0 `CoreFileService` WARNS at construction** when `multiTenancy` is active AND a knob names a role other than ADMIN AND `checkRights()` is not overridden — the file stores are reached outside Mongoose, so these role names resolve against `user.roles` (global) and every holder reaches every tenant's files; only `checkRights()` can narrow that. Silent on the admin-only default and silent when a per-file rule exists. Implementation: `src/core/modules/file/file-roles.config.ts` (`FILE_ROLE_DEFAULTS`, `FILE_ROLE_MEMBERS`, the three warnings, the shared `hasDeclaredFilePolicy()` silencer) + `file-roles.helper.ts` (`applyFileRoles`) + `core-file-access-audit.initializer.ts` (the registered-class audit) |
|
|
343
343
|
| TUS Roles | `tus.roles` | Config-Driven Role List | `[RoleEnum.S_USER]` (was `S_EVERYONE` — breaking). A TUS upload writes into the SAME store the download routes guard, and the termination extension (on by default) can delete from it, so anonymous writes into a store only privileged callers may read is the wrong way round. Applied by `TusModule.applyRoles()` onto the registered controller class **and** onto `handleTus` / `handleTusWithId`. Same rejection rule as the file roles: `[]` / non-array / non-string → warning + `DEFAULT_TUS_CONFIG.roles`. **`OPTIONS` is deliberately exempt**: `handleTusOptions` / `handleTusOptionsWithId` keep their own handler-level `@Roles(RoleEnum.S_EVERYONE)`, because that is the CORS preflight — browsers send it WITHOUT credentials, and it returns server capabilities only. Gating it would make every browser upload fail before the first byte. `CoreTusController` also carries `@SkipTenantCheck()`. A custom controller is covered as long as it INHERITS the handlers; one that re-declares `@All()` / `@Roles()` carries its own metadata and thereby opts out — the documented way to hard-code a policy config must not be able to change. **Set `roles: [RoleEnum.S_EVERYONE]` explicitly if you accept attachments on a public form.** **Since 11.35.0 `tus.roles` is no longer the only gate**: `onUploadCreate` records the authenticated creator under `TUS_OWNER_METADATA_KEY` (`ltOwnerId`, always OVERWRITING any client-supplied value) and `onIncomingRequest` refuses HEAD/PATCH/DELETE naming an upload the caller does not own — with **404**, the file module's refusal policy. Before that, any authenticated caller who learned an upload id could APPEND BYTES to somebody else's upload, which are then migrated into the file store under the victim's filename. The finished file also gains `metadata.ownerId`, without which the documented per-file ownership rule could never authorize a tus-uploaded file (admin-only in practice). An OWNER-LESS upload stays reachable — uploads predating 11.35.0 have none, and neither does a deliberately public form. `readRequestUserId()` / `assertUploadOwnership()` are `protected`. **Since 11.41.9 the tenant is recorded too, but ONLY with `multiTenancy` configured** (not `enabled: false`) and a tenant guard registered: `onUploadCreate` validates the tenant header against the caller's active memberships through `core-tenant-context.registry.ts` (the routes carry `@SkipTenantCheck()`, so the guard did not), refuses a non-member with **403**, writes it under `TUS_TENANT_METADATA_KEY` (`ltTenantId`, always overwritten like the owner key) and the finished file gains `metadata.tenantId`. No header → tenant-less, as before; without `multiTenancy` nothing is read or written. A project hooks in through `TusModule.forRoot({ service })` (a `CoreTusService` subclass, constructed by the module as `(connection, options)` — project providers come from `options.moduleRef` at call time) and the `protected onUploadCreate(req, upload)`, the one point where `Upload-Length` is known and nothing is stored yet; an override must return `super.onUploadCreate()`. Note that `@tus/server` v2 hands its hooks a WHATWG `ServerRequest`, so a guard's `req.user` is reachable only via `runtime.node.req`. **CORS (11.42.1)**: the tus handler's `Access-Control-Allow-Origin` comes from `buildCorsConfig()` (or `tus.allowedOrigins`), plus `allowedCredentials` — without it `@tus/server` answered `*`, which browsers refuse on a credentialed request, so cookie-authenticated uploads across split app/API origins failed in every browser while the server answered 201; no credentialed CORS configured → the `*` default stays. **compression (11.42.2)**: `@tus/server` finishes responses with `res.end(callback)`, which `compression`'s two-argument `res.end(chunk, encoding)` patch reads as a chunk (`ERR_INVALID_ARG_TYPE … Received function`); with the starter's `filter: () => true, threshold: 0` every finished upload HUNG without an answer AFTER the file was stored (headers already sent, so no error response could follow). `CoreTusService` wraps `server.handle()` and normalises `res.end` per response (`normalizeEndCallback()`, callback on `finish`/`close`), so no `main.ts` change is needed. Implementation: `src/core/modules/tus/tus.module.ts`, `src/core/modules/tus/core-tus.service.ts`, `src/core/modules/tus/tus.constants.ts` |
|
|
344
344
|
| File Storage | `file.storage` + `file.storageDir` + `s3` | Explicit Enum with DERIVED default | `'filesystem' \| 'gridfs' \| 's3'`. **Unset → derived**, most capable first: `'s3'` when `s3.bucket` is set, else `'filesystem'` with `database: false` or when `database` routes the file metadata to a SQL source (`fileMetadataSqlSource()`; GridFS would put bytes and metadata into MongoDB — an explicit `'gridfs'` keeps working), else `'gridfs'` when `mongoose.uri` is set, else `'filesystem'`. **Set → enforced**: an unavailable store FAILS THE BOOT (`assertFileStorageAvailable()`), it never falls back — a silent fallback puts files in a store the operator does not believe they are in, unrecoverably. A DERIVED driver is enforced too (`s3.bucket` set but `s3Service` not forwarded to `super()` → boot error). Metadata stays queryable whichever driver holds the bytes (`fs.files` / `s3-files` / `filesystem-files`, the latter two as the tables `s3_files` / `filesystem_files` when `database` routes them to a SQL source) — `findFileInfo()` and `checkRights()` need it. Reads consult ALL stores so switching drivers is forward-only with no migration; writes go to the active driver only. `'filesystem'` is pod-local: not shared between replicas, lost on restart unless `storageDir` is a mounted volume. `s3`: `bucket` (required — the one thing S3 cannot default, hence the eligibility test), `region: 'us-east-1'`, `forcePathStyle: false`, `autoCreateBucket: false` (off by design: production buckets come from infrastructure code, whose credentials usually cannot CreateBucket), `stagingBucket: bucket`, `presignedDownloads: false` (`true`/`{}` → `expiresInSeconds: 300`), `endpoint` (MinIO/RustFS), `accessKeyId`/`secretAccessKey` (omit → AWS default credential chain), `enabled: false` to pre-configure. Requires the OPTIONAL peer `@aws-sdk/client-s3`, plus `@aws-sdk/s3-request-presigner` for presigned downloads. **Uploads are never buffered on the S3 path** (11.41.7): a known length (`FileUploadSource.size`, TUS, a buffer) goes up as one streamed PutObject up to `CoreS3Service.MAX_SINGLE_PUT_BYTES` (5 GiB — AWS S3 refuses more in one request, `EntityTooLarge`) and as a multipart upload above it, an unknown one — every GraphQL and streamed REST upload — as a multipart upload via the OPTIONAL peer `@aws-sdk/lib-storage`. Missing peer → one boot warning and the old in-memory buffering, NOT a boot failure (multipart optimises a path that works without it). `size` must be the file's EXACT length — never a multipart request's `Content-Length`; anything but a positive integer counts as unknown (`isKnownUploadSize()`), and the recorded length of an unknown-length upload comes from a HEAD of the stored object. `presignedDownloads` makes `GET /files/id/:id` answer `302` to a time-limited S3 URL instead of streaming — the URL is a bearer capability, authorized once at issue time. The resolved driver is logged at boot (`[CoreFileStorage] File storage: …`) |
|
|
345
|
+
| S3 Connection Pool & Download Guard | `s3.maxSockets`, `s3.connectionTimeoutMs`, `s3.socketTimeoutMs`, `s3.downloadIdleTimeoutMs`; `file.downloadIdleTimeoutMs`, `file.downloadCaching` | Numeric — invalid → default, never off (Family C without opt-out) + Explicit Enum | **12.8.9, after a production outage**: S3 downloads delivered with a bare `stream.pipe(res)` kept their sockets when clients aborted; after 50 the SDK's pool was full, every S3 request waited forever (health check green), heap OOM hours later. Since then: `CoreS3Service` builds its client with OWN agents (`maxSockets` **200**, keep-alive), `connectionTimeout` **15 000** per attempt (the SDK starts it when the request is CREATED, so it also bounds the wait for a free socket — a short value fails healthy downloads under load; the SDK retries a timed-out attempt, 3 attempts in all, so a download that gets no socket answers **503** + `Retry-After: 5` after about 46 s — keep 3 × the value below the reverse proxy's read timeout, commonly 60 s), `socketTimeout` **120 000** (inactivity backstop for every request, uploads and copies included). The SDK's `requestTimeout` stops at the headers and its socket timeout destroys the body WITH an error (a process crash without a listener), so the real guard is `guardIdleStream()` (`common/helpers/idle-stream.helper.ts`): every stream from `getObject()` (`s3.downloadIdleTimeoutMs`, 30 000) and from `CoreFileService.getFileStream()` / `getFileStreamByName()` (`file.downloadIdleTimeoutMs`, 30 000 — GridFS cursors, file handles) is destroyed after that long WITHOUT READ PROGRESS, measured on the consumer side (`_read`) and at the source; a slow reader that keeps reading is never cut off; code that opens a stream and reads it LATE (an archive appending every file first) breaks — per call `downloadIdleTimeoutMs: false` (`FileServiceOptions`) / `getObject(key, { idleTimeoutMs: false })` opts out. `pipeFileToResponse()` destroys the source when the client goes — the response's `close`, the request's `close` (before its end and while the response is unfinished — Node closes a request whose body was read to the end by itself, a POST export stays deliverable) or the socket's `end`/`close`: measured under a k6 abort storm, about one in six aborted downloads never got a `close` on the response and reported it only through the request or the socket — and at once when it had ALREADY gone (`isResponseGone()`: response destroyed/closed OR request destroyed before its end OR socket destroyed; a client that gave up while waiting for a socket — the avalanche path); the routes pass an `abortSignal` (`downloadAbortSignal()`, exported: response close or request close) down to `GetObjectCommand`, check for a gone client before opening the store and destroy a stream that arrives late. An exhausted pool is logged as an ERROR once per minute with numbers (`getSocketPoolStats()` exposes them); deliberately NOT a health-check failure. `file.downloadCaching`: `'none'` (default, `private, no-store`) or `'revalidate'` (`private, no-cache` — the browser revalidates every use, `304` after the rights check without a store read); both send a WEAK `ETag` `W/"<id>"` (bytes under an id never change, but a `compression` middleware sends a gzip and an identity representation of the same file — RFC 9110 §8.8.3 forbids one strong validator for both; `If-None-Match` compares weakly) and `Content-Length`. The reference `src/main.ts` uses `compression.filter` (no gzip for JPEG/PNG/PDF/ZIP). Pinned by `tests/unit/idle-stream.spec.ts`, `tests/unit/core-file.controller.spec.ts`, `tests/unit/download-idle-opt-out.spec.ts` and `tests/s3-download-resilience.e2e-spec.ts` (real RustFS: dropped streams, abort storm with bare `pipe()`, clients giving up while waiting, 500 parallel downloads with `maxSockets: 4`, slow reader; mutations `idle-guard-*`, `s3-get-object-*`, `pipe-file-to-response-*`, `download-route-keeps-late-stream`, `file-stream-drops-idle-opt-out`). Implementation: `core-s3.service.ts`, `core-file.controller.ts`, `core-file.service.ts` |
|
|
345
346
|
| TUS S3 Staging | `tus.s3Staging` | Explicit Boolean (default ON when S3 configured) | `true` when `s3` is configured, otherwise inert. Stages in-progress uploads in `s3.stagingBucket` via `@tus/s3-store` instead of `tus.uploadDir` on local disk, so resumable uploads survive replica restarts and need no sticky sessions. Set `false` to force local disk. Missing OPTIONAL peer `@tus/s3-store` → warning + fall back to local disk (NOT a boot failure). **Give the staging bucket a lifecycle rule expiring incomplete multipart uploads** — the framework's own expiration cleanup is skipped in S3 mode (S3 is the right place for that policy), so aborted uploads otherwise accumulate parts nothing removes |
|
|
346
347
|
| TUS Configuration Source, Path & Extensions | `tus` (server config) / `TusModule.forRoot({ config })` | Enabled by Default + explicit-config-wins | **Since 11.42.9 `TusModule.forRoot()` without `config` reads the server config's `tus` key** (`ConfigService.get('tus')`, the zero-config rule `CoreBetterAuthModule.forRoot()` follows); an explicit `config` wins. Before, the key was never read: `tus: false`, `allowedTypes`, `maxSize`, `roles` in `config.env.ts` did nothing — real projects had upload restrictions they believed were enforced. **`path`** has three readings (`applyPath()`): unset → follows the controller's route; a new route (`/uploads`) → mounts the registered controller there (writes `PATH_METADATA`, config wins like the roles; the declared route is remembered per class and restored by a later `forRoot()` without `path`); a path ENDING with the controller's route (`/api/tus`, `/files/tus`) → the PUBLIC URL: the controller stays and upload URLs use it. The third reading is load-bearing: it was the only working setting under a global prefix or a prefix-stripping proxy before 11.42.9, and treating it as a route doubled the prefix (`/api/api/tus`, 404 on every upload — caught in the second pre-release review). The upload URL (`Location`) is built from the path the creation request arrived at (`uploadCollectionPath(req)`), or from `path` when that is longer and ends with it (proxy strip); `@tus/server` built it from `path` alone, which broke every resume below a global prefix, a URI version or a project route. **`relativeLocation`** (new): the framework owns `generateUrl`, which takes precedence over `@tus/server`'s option of that name, so it is honoured from `tus.relativeLocation` AND from the tus server's own options (a vendored core may pass it there). **Extensions**: `@tus/server` consults no flag, so `creation`, `creationWithUpload` and `termination` are enforced by `CoreTusService` — the store's advertised `extensions` are narrowed, and `assertExtensionEnabled()` answers 501 inside the server's `onIncomingRequest` / `onUploadCreate` options (not in the overridable hook, so an override without `super` cannot reopen it). `checksum` / `concatenation` have no effect: neither built-in store supports them. `configure(false)` now yields a DISABLED config (before it kept the defaults and started a tus server behind a module with no endpoint). Implementation: `tus.module.ts`, `core-tus.service.ts` |
|
|
347
348
|
| Health Check | `healthCheck` | Presence Implies Enabled | Absent → no endpoints. Any object registers `GET /health-check` + the `healthCheck` query; **`enabled: false` leaves them out (honoured since 11.42.9 — before, it was declared and ignored)**. Individual checks under `configs.*` each have their own `enabled`. Implementation: `core.module.ts` |
|
package/.claude/rules/testing.md
CHANGED
|
@@ -412,7 +412,7 @@ pnpm run check:mutations -- --id=<id> # one mutation
|
|
|
412
412
|
pnpm run check:mutations -- --list # the registry, without running anything
|
|
413
413
|
pnpm run check:mutations -- --allow-dirty # when the fix and its evidence share a working tree
|
|
414
414
|
pnpm run check:mutations -- --jobs=4 # N mutations at a time (default: 2, or 4 on >=12 cores)
|
|
415
|
-
pnpm run check:mutations -- --no-infra # only the
|
|
415
|
+
pnpm run check:mutations -- --no-infra # only the 436 that need no MongoDB
|
|
416
416
|
pnpm run check:mutations -- --since=<ref> # only mutations touching files changed since <ref>
|
|
417
417
|
pnpm run check:mutations -- --shard=2/4 # this job's quarter of the selection (CI splits the full run)
|
|
418
418
|
```
|
|
@@ -432,7 +432,7 @@ when the registry, a vitest config or a setup file changed, since those can move
|
|
|
432
432
|
commit, and in CI alongside the publish without blocking it. The price of caching is a cache that
|
|
433
433
|
has to model each spec's full dependency closure correctly, and getting that wrong produces a stale
|
|
434
434
|
PASS for a test that has since gone vacuous — exactly what the gate is there to prevent. Bad trade
|
|
435
|
-
at
|
|
435
|
+
at 674 mutations.
|
|
436
436
|
|
|
437
437
|
**Decided 2026-10-03 (repo owner): keep the full run.** Measured at 128 mutations, the CI job for
|
|
438
438
|
11.41.6 took **14 minutes**. The trigger to revisit is that wall time, not the mutation count —
|
|
@@ -503,9 +503,9 @@ exactly the environment where the answer matters.
|
|
|
503
503
|
|
|
504
504
|
### The cost is vitest's cold start, not the tests
|
|
505
505
|
|
|
506
|
-
Worth knowing before optimising the wrong thing: the specs behind all
|
|
506
|
+
Worth knowing before optimising the wrong thing: the specs behind all 238 e2e mutations add up to
|
|
507
507
|
**~40 seconds**. The step takes ~740s. The remaining ~700s is paying vitest's startup — process
|
|
508
|
-
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation,
|
|
508
|
+
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 674 times.
|
|
509
509
|
That work is largely single-threaded I/O and barely scales with cores: the full registry measures
|
|
510
510
|
**744s on a 12-core laptop and 777s on a 4-vCPU CI runner**.
|
|
511
511
|
|
package/CLAUDE.md
CHANGED
|
@@ -189,8 +189,8 @@ pnpm run check:swc-tdz # SWC→CJS build, loads EVERY module as its own entry p
|
|
|
189
189
|
# import cycle — tsc, vitest and oxlint are all blind to it.
|
|
190
190
|
# See .claude/rules/architecture.md → "DI Token Placement (SWC-Safe)"
|
|
191
191
|
pnpm run check:unified-field-types # Every @UnifiedField without type/isAny/enum whose type the SWC dev start and
|
|
192
|
-
# the tsc build read differently (a union with null, a type alias)
|
|
193
|
-
#
|
|
192
|
+
# the tsc build read differently (a union with null, a type alias) — refused at boot
|
|
193
|
+
# since 12.9.0. `-- --fix` writes the type tsc uses. Shipped to projects as
|
|
194
194
|
# bin `nest-check-unified-field-types`; see .claude/rules/architecture.md → "Input Validation"
|
|
195
195
|
|
|
196
196
|
# Package Development
|
package/FRAMEWORK-API.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lenne.tech/nest-server — Framework API Reference
|
|
2
2
|
|
|
3
|
-
> Auto-generated from source code as of 2026-11-11 (v12.
|
|
3
|
+
> Auto-generated from source code as of 2026-11-11 (v12.9.0)
|
|
4
4
|
> File: `FRAMEWORK-API.md` — compact, machine-readable API surface for Claude Code
|
|
5
5
|
|
|
6
6
|
## CoreModule.forRoot()
|
|
@@ -167,6 +167,8 @@ When `passkey` is enabled, `trustedOrigins` is required (compile-time enforcemen
|
|
|
167
167
|
|
|
168
168
|
- `access?`: `"authenticated" | "custom" | "owner" | "public" | "tenant"` (default: `'custom'`) — WHICH PROJECT CLASS this deployment is — the per-file rule, as a declaration instead of code.
|
|
169
169
|
- `deleteRoles?`: `string[]` (default: `['admin']`) — Roles allowed to DELETE files (`deleteFile` mutation).
|
|
170
|
+
- `downloadCaching?`: `"none" | "revalidate"` (default: `'none'`) — Browser caching of file downloads (`GET /files/id/:id`, `GET /files/:filename`).
|
|
171
|
+
- `downloadIdleTimeoutMs?`: `number` (default: `30000`) — Time in milliseconds a download stream from `CoreFileService.getFileStream()` / `getFileStreamByName()` may
|
|
170
172
|
- `downloadRoles?`: `string[]` (default: `['admin']`) — Roles allowed to DOWNLOAD files and read file info
|
|
171
173
|
- `storage?`: `"filesystem" | "gridfs" | "s3"` (default: `derived — see above`) — Storage driver for CoreFileService. Three equivalent options:
|
|
172
174
|
- `storageDir?`: `string` (default: `'uploads/files'`) — Directory for the `'filesystem'` storage driver.
|
|
@@ -189,12 +191,16 @@ When `passkey` is enabled, `trustedOrigins` is required (compile-time enforcemen
|
|
|
189
191
|
- `accessKeyId?`: `string` (default: `undefined`) — Access key ID.
|
|
190
192
|
- `autoCreateBucket?`: `boolean` (default: `false`) — Create the configured buckets at startup when they do not exist.
|
|
191
193
|
- `bucket`: `string` — Bucket for files stored via CoreFileService
|
|
194
|
+
- `connectionTimeoutMs?`: `number` (default: `15000`) — Upper bound in milliseconds for ONE attempt of a request to get a socket: the time it WAITS for a free socket of
|
|
195
|
+
- `downloadIdleTimeoutMs?`: `number` (default: `30000`) — Time in milliseconds a download stream from S3 (`CoreS3Service.getObject()`, and with it
|
|
192
196
|
- `enabled?`: `boolean` (default: `true (when config object is present)`) — Whether S3 is enabled.
|
|
193
197
|
- `endpoint?`: `string` (default: `undefined`) — Custom endpoint URL for S3-compatible services (MinIO, RustFS, ...).
|
|
194
198
|
- `forcePathStyle?`: `boolean` (default: `false`) — Use path-style addressing (required by most self-hosted S3 services).
|
|
199
|
+
- `maxSockets?`: `number` (default: `200`) — Maximum number of concurrent sockets to the S3 endpoint (per protocol). Requests beyond it wait for a
|
|
195
200
|
- `presignedDownloads?`: `boolean | { enabled?: boolean; expiresInSeconds?: number; }` (default: `false`) — Serve downloads as presigned URL redirects instead of streaming
|
|
196
201
|
- `region?`: `string` (default: `'us-east-1'`) — AWS region
|
|
197
202
|
- `secretAccessKey?`: `string` (default: `undefined`) — Secret access key.
|
|
203
|
+
- `socketTimeoutMs?`: `number` (default: `120000`) — Time in milliseconds a socket to S3 may stay without any traffic before the SDK destroys it — the
|
|
198
204
|
- `stagingBucket?`: `string` (default: `same as `bucket``) — Bucket used as staging area for resumable TUS uploads.
|
|
199
205
|
|
|
200
206
|
### ITusConfig
|
|
@@ -247,13 +247,25 @@ function emitsTheSameType(ts, checker, node) {
|
|
|
247
247
|
return false;
|
|
248
248
|
}
|
|
249
249
|
const target = symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol;
|
|
250
|
-
// An enum: SWC writes the enum object, which @UnifiedField reads as String / Number like tsc does (12.8.7)
|
|
250
|
+
// An enum: SWC writes the enum object, which @UnifiedField reads as String / Number like tsc does (12.8.7) — but only
|
|
251
|
+
// an enum whose members are all strings or all numbers; tsc writes Object for a mixed one, and so does the decorator
|
|
251
252
|
if (target.flags & ts.SymbolFlags.Enum) {
|
|
252
|
-
return
|
|
253
|
+
return isHomogeneousEnum(ts, checker, target);
|
|
253
254
|
}
|
|
254
255
|
return isLibDate(target) || (target.flags & ts.SymbolFlags.Class) !== 0;
|
|
255
256
|
}
|
|
256
257
|
|
|
258
|
+
/** Whether every member of the enum is a string, or every member a number (what @UnifiedField reads as String / Number). */
|
|
259
|
+
function isHomogeneousEnum(ts, checker, enumSymbol) {
|
|
260
|
+
const values = (enumSymbol.declarations ?? [])
|
|
261
|
+
.filter((declaration) => ts.isEnumDeclaration(declaration))
|
|
262
|
+
.flatMap((declaration) => declaration.members.map((member) => checker.getConstantValue(member)));
|
|
263
|
+
return (
|
|
264
|
+
values.length > 0 &&
|
|
265
|
+
(values.every((value) => typeof value === 'string') || values.every((value) => typeof value === 'number'))
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
257
269
|
function everyMember(type, predicate) {
|
|
258
270
|
return type.isUnion() ? type.types.every(predicate) : predicate(type);
|
|
259
271
|
}
|
|
@@ -461,7 +473,7 @@ function analyze(ts, program, cwd, include) {
|
|
|
461
473
|
if (
|
|
462
474
|
sourceFile.isDeclarationFile ||
|
|
463
475
|
fileName.includes(`${path.sep}node_modules${path.sep}`) ||
|
|
464
|
-
|
|
476
|
+
// Spec and test files are checked too (12.9.0): @UnifiedField refuses such a field at boot wherever it is declared
|
|
465
477
|
!roots.some((root) => fileName.startsWith(root))
|
|
466
478
|
) {
|
|
467
479
|
continue;
|
|
@@ -93,18 +93,17 @@ function designTypeOf(metadataType) {
|
|
|
93
93
|
}
|
|
94
94
|
return metadataType;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
function warnIfAmbiguousMetadataType(metadataType, propertyHint) {
|
|
96
|
+
function assertExplicitTypeForObjectMetadata(metadataType, propertyHint) {
|
|
98
97
|
const ambiguous = metadataType === Object || (typeof metadataType === 'object' && metadataType !== null);
|
|
99
|
-
if (!ambiguous
|
|
98
|
+
if (!ambiguous)
|
|
100
99
|
return;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'Date / <Class>, type: () => Object for a free-form object, or isAny: true.
|
|
106
|
-
'--fix` (vendor mode: `node ./bin/check-unified-field-types.js --fix`) writes
|
|
107
|
-
'
|
|
100
|
+
throw new Error(`[@UnifiedField] "${propertyHint}" has no explicit type, and the compiler metadata says only "Object", which ` +
|
|
101
|
+
'names no type — and the SWC dev start and the tsc build can write different ones here (a union with ' +
|
|
102
|
+
'null/undefined, a type alias, an interface, a mixed enum, a class not yet defined because of an import ' +
|
|
103
|
+
'cycle). Declare it: type: () => Number / String / ' +
|
|
104
|
+
'Boolean / Date / <Class>, type: () => Object for a free-form object, or isAny: true. ' +
|
|
105
|
+
'`nest-check-unified-field-types --fix` (vendor mode: `node ./bin/check-unified-field-types.js --fix`) writes ' +
|
|
106
|
+
'the declared type where it can resolve one and names the rest. See migration-guides/12.8.x-to-12.9.x.md.');
|
|
108
107
|
}
|
|
109
108
|
export function UnifiedField(opts = {}) {
|
|
110
109
|
const isLongForm = opts.enum ? isEnumOptionsObject(opts.enum) : false;
|
|
@@ -172,7 +171,7 @@ export function UnifiedField(opts = {}) {
|
|
|
172
171
|
throw new Error(`Array field '${String(propertyKey)}' of '${String(target)}' must have an explicit type`);
|
|
173
172
|
}
|
|
174
173
|
if (!userType && !opts.isAny && !normalizedEnum) {
|
|
175
|
-
|
|
174
|
+
assertExplicitTypeForObjectMetadata(metadataType, `${target.constructor?.name || '?'}.${key}`);
|
|
176
175
|
}
|
|
177
176
|
const resolvedTypeFn = () => {
|
|
178
177
|
if (userType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-field.decorator.js","sourceRoot":"","sources":["../../../../src/core/common/decorators/unified-field.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,SAAS,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,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W,CAAC,IAAI,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAEhC,OAAO,CACL,CAAC,IAAI;QACH,OAAO,IAAI,KAAK,UAAU;QAC1B,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,KAAK,UAAU;QAC/C,OAAO,IAAI,CAAC,SAAS,EAAE,UAAU,KAAK,UAAU;QAChD,OAAO,IAAI,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU,CAAC;QACrD,IAAI,YAAY,iBAAiB,CAClC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAO;IAC1B,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC"}
|
|
1
|
+
{"version":3,"file":"unified-field.decorator.js","sourceRoot":"","sources":["../../../../src/core/common/decorators/unified-field.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,SAAS,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,cAAc,GAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAkB,MAAM,2BAA2B,CAAC;AASvE,OAAO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AED,SAAS,WAAW,CAAC,EAAO;IAC1B,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Readable } from 'stream';
|
|
2
|
+
export declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 30000;
|
|
3
|
+
export declare const MAX_TIMER_DELAY_MS = 2147483647;
|
|
4
|
+
export declare class StreamIdleTimeoutError extends Error {
|
|
5
|
+
readonly idleMs: number;
|
|
6
|
+
readonly code = "LT_STREAM_IDLE_TIMEOUT";
|
|
7
|
+
constructor(idleMs: number);
|
|
8
|
+
}
|
|
9
|
+
export interface GuardIdleStreamOptions {
|
|
10
|
+
idleMs?: false | number;
|
|
11
|
+
onIdle?: (idleMs: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function isIdleGuardedStream(stream: unknown): boolean;
|
|
14
|
+
export declare function guardIdleStream(source: Readable, options?: GuardIdleStreamOptions): Readable;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { PassThrough } from 'stream';
|
|
2
|
+
const IDLE_GUARDED = Symbol('lt.idleGuardedStream');
|
|
3
|
+
export const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 30_000;
|
|
4
|
+
export const MAX_TIMER_DELAY_MS = 2_147_483_647;
|
|
5
|
+
export class StreamIdleTimeoutError extends Error {
|
|
6
|
+
idleMs;
|
|
7
|
+
code = 'LT_STREAM_IDLE_TIMEOUT';
|
|
8
|
+
constructor(idleMs) {
|
|
9
|
+
super(`Download stream made no read progress for ${idleMs} ms and was closed to release its resources`);
|
|
10
|
+
this.idleMs = idleMs;
|
|
11
|
+
this.name = 'StreamIdleTimeoutError';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class IdleGuardStream extends PassThrough {
|
|
15
|
+
onConsumerRead;
|
|
16
|
+
read(size) {
|
|
17
|
+
this.onConsumerRead?.();
|
|
18
|
+
return super.read(size);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function isIdleGuardedStream(stream) {
|
|
22
|
+
return !!stream && stream[IDLE_GUARDED] === true;
|
|
23
|
+
}
|
|
24
|
+
export function guardIdleStream(source, options = {}) {
|
|
25
|
+
if (isIdleGuardedStream(source)) {
|
|
26
|
+
return source;
|
|
27
|
+
}
|
|
28
|
+
const idleMs = options.idleMs === false
|
|
29
|
+
? undefined
|
|
30
|
+
: typeof options.idleMs === 'number' && Number.isFinite(options.idleMs) && options.idleMs > 0
|
|
31
|
+
? Math.min(options.idleMs, MAX_TIMER_DELAY_MS)
|
|
32
|
+
: DEFAULT_STREAM_IDLE_TIMEOUT_MS;
|
|
33
|
+
const guarded = new IdleGuardStream();
|
|
34
|
+
Object.defineProperty(guarded, IDLE_GUARDED, { enumerable: false, value: true });
|
|
35
|
+
let timer;
|
|
36
|
+
const stopTimer = () => {
|
|
37
|
+
if (timer) {
|
|
38
|
+
clearTimeout(timer);
|
|
39
|
+
timer = undefined;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
let pipeErrorListeners = 0;
|
|
43
|
+
const hasConsumerErrorListener = () => guarded.listenerCount('error') > pipeErrorListeners;
|
|
44
|
+
const destroyGuarded = (error) => {
|
|
45
|
+
if (guarded.destroyed) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
guarded.destroy(error && hasConsumerErrorListener() ? error : undefined);
|
|
49
|
+
};
|
|
50
|
+
const destroySource = () => {
|
|
51
|
+
if (!source.destroyed) {
|
|
52
|
+
source.destroy();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const onIdle = () => {
|
|
56
|
+
timer = undefined;
|
|
57
|
+
if (source.readableEnded || guarded.destroyed) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
options.onIdle?.(idleMs);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
}
|
|
65
|
+
destroySource();
|
|
66
|
+
destroyGuarded(new StreamIdleTimeoutError(idleMs));
|
|
67
|
+
};
|
|
68
|
+
if (idleMs !== undefined) {
|
|
69
|
+
timer = setTimeout(onIdle, idleMs);
|
|
70
|
+
timer.unref?.();
|
|
71
|
+
}
|
|
72
|
+
guarded.onConsumerRead = () => timer?.refresh();
|
|
73
|
+
source.on('data', () => timer?.refresh());
|
|
74
|
+
source.once('end', stopTimer);
|
|
75
|
+
source.once('close', stopTimer);
|
|
76
|
+
source.on('error', (error) => {
|
|
77
|
+
stopTimer();
|
|
78
|
+
destroyGuarded(error);
|
|
79
|
+
});
|
|
80
|
+
guarded.once('close', () => {
|
|
81
|
+
stopTimer();
|
|
82
|
+
if (!source.readableEnded) {
|
|
83
|
+
destroySource();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const before = guarded.listenerCount('error');
|
|
87
|
+
source.pipe(guarded);
|
|
88
|
+
pipeErrorListeners = guarded.listenerCount('error') - before;
|
|
89
|
+
source.once('end', () => {
|
|
90
|
+
pipeErrorListeners = 0;
|
|
91
|
+
});
|
|
92
|
+
return guarded;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=idle-stream.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idle-stream.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/idle-stream.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAQrC,MAAM,YAAY,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAUpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAMrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAMhD,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAG1B;IAFZ,IAAI,GAAG,wBAAwB,CAAC;IAEzC,YAAqB,MAAc;QACjC,KAAK,CAAC,6CAA6C,MAAM,6CA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,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAC1C,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC9B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;QAClC,SAAS,EAAE,CAAC;QACZ,cAAc,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;QACzB,SAAS,EAAE,CAAC;QAEZ,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;YAC1B,aAAa,EAAE,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrB,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;IAE7D,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;QACtB,kBAAkB,GAAG,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -142,6 +142,8 @@ export interface IErrorCode {
|
|
|
142
142
|
export interface IFileConfig {
|
|
143
143
|
access?: 'authenticated' | 'custom' | 'owner' | 'public' | 'tenant';
|
|
144
144
|
deleteRoles?: string[];
|
|
145
|
+
downloadCaching?: 'none' | 'revalidate';
|
|
146
|
+
downloadIdleTimeoutMs?: number;
|
|
145
147
|
downloadRoles?: string[];
|
|
146
148
|
storage?: 'filesystem' | 'gridfs' | 's3';
|
|
147
149
|
storageDir?: string;
|
|
@@ -462,15 +464,19 @@ export interface IS3Config {
|
|
|
462
464
|
accessKeyId?: string;
|
|
463
465
|
autoCreateBucket?: boolean;
|
|
464
466
|
bucket: string;
|
|
467
|
+
connectionTimeoutMs?: number;
|
|
468
|
+
downloadIdleTimeoutMs?: number;
|
|
465
469
|
enabled?: boolean;
|
|
466
470
|
endpoint?: string;
|
|
467
471
|
forcePathStyle?: boolean;
|
|
472
|
+
maxSockets?: number;
|
|
468
473
|
presignedDownloads?: boolean | {
|
|
469
474
|
enabled?: boolean;
|
|
470
475
|
expiresInSeconds?: number;
|
|
471
476
|
};
|
|
472
477
|
region?: string;
|
|
473
478
|
secretAccessKey?: string;
|
|
479
|
+
socketTimeoutMs?: number;
|
|
474
480
|
stagingBucket?: string;
|
|
475
481
|
}
|
|
476
482
|
export interface ISync {
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { Logger, OnApplicationShutdown, OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { Agent as HttpAgent } from 'http';
|
|
3
|
+
import { Agent as HttpsAgent } from 'https';
|
|
2
4
|
import { ConfigService } from './config.service.js';
|
|
3
5
|
import type { IS3Config } from '../interfaces/server-options.interface.js';
|
|
4
6
|
import type { S3Client } from '@aws-sdk/client-s3';
|
|
5
7
|
import type { Readable } from 'stream';
|
|
8
|
+
export interface S3SocketPoolStats {
|
|
9
|
+
active: number;
|
|
10
|
+
free: number;
|
|
11
|
+
maxSockets: number;
|
|
12
|
+
waiting: number;
|
|
13
|
+
}
|
|
6
14
|
export type NormalizedS3Config = Omit<IS3Config, 'enabled' | 'presignedDownloads'> & {
|
|
7
15
|
bucket: string;
|
|
16
|
+
connectionTimeoutMs: number;
|
|
17
|
+
downloadIdleTimeoutMs: number;
|
|
8
18
|
forcePathStyle: boolean;
|
|
19
|
+
maxSockets: number;
|
|
9
20
|
presignedDownloads?: {
|
|
10
21
|
expiresInSeconds: number;
|
|
11
22
|
};
|
|
12
23
|
region: string;
|
|
24
|
+
socketTimeoutMs: number;
|
|
13
25
|
stagingBucket: string;
|
|
14
26
|
};
|
|
15
27
|
export declare class CoreS3Service implements OnApplicationShutdown, OnModuleInit {
|
|
@@ -20,11 +32,22 @@ export declare class CoreS3Service implements OnApplicationShutdown, OnModuleIni
|
|
|
20
32
|
protected sdk?: typeof import('@aws-sdk/client-s3');
|
|
21
33
|
protected presigner?: typeof import('@aws-sdk/s3-request-presigner');
|
|
22
34
|
protected multipartUploader?: null | typeof import('@aws-sdk/lib-storage');
|
|
35
|
+
protected agents?: {
|
|
36
|
+
http: HttpAgent;
|
|
37
|
+
https: HttpsAgent;
|
|
38
|
+
};
|
|
39
|
+
protected poolMonitor?: NodeJS.Timeout;
|
|
40
|
+
protected lastPoolReportAt: number;
|
|
41
|
+
protected idleClosedSinceReport: number;
|
|
23
42
|
constructor(configService: ConfigService);
|
|
24
43
|
protected clampPresignedExpiry(seconds: number): number;
|
|
25
44
|
get enabled(): boolean;
|
|
26
45
|
getConfig(): NormalizedS3Config | undefined;
|
|
27
46
|
onModuleInit(): Promise<void>;
|
|
47
|
+
protected buildRequestHandlerOptions(): Record<string, unknown>;
|
|
48
|
+
getSocketPoolStats(): S3SocketPoolStats | undefined;
|
|
49
|
+
protected startPoolMonitor(): void;
|
|
50
|
+
protected checkSocketPool(): void;
|
|
28
51
|
protected verifyBuckets(): Promise<void>;
|
|
29
52
|
protected bucketExists(bucket: string): Promise<boolean>;
|
|
30
53
|
getClient(): S3Client;
|
|
@@ -41,7 +64,10 @@ export declare class CoreS3Service implements OnApplicationShutdown, OnModuleIni
|
|
|
41
64
|
protected copySource(bucket: string, key: string): string;
|
|
42
65
|
protected isStream(body: unknown): body is Readable;
|
|
43
66
|
protected collect(stream: Readable): Promise<Buffer>;
|
|
44
|
-
getObject(key: string
|
|
67
|
+
getObject(key: string, options?: {
|
|
68
|
+
abortSignal?: AbortSignal;
|
|
69
|
+
idleTimeoutMs?: false | number;
|
|
70
|
+
}): Promise<{
|
|
45
71
|
body: Readable;
|
|
46
72
|
contentLength?: number;
|
|
47
73
|
contentType?: string;
|