@bymax-one/nest-storage 1.1.0 → 1.1.1
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/CHANGELOG.md +61 -2
- package/README.md +11 -4
- package/dist/server/index.cjs +0 -3
- package/dist/server/index.d.cts +1 -3
- package/dist/server/index.d.ts +1 -3
- package/dist/server/index.mjs +1 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,70 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@bymax-one/nest-storage` are documented in this file.
|
|
4
4
|
|
|
5
|
-
The format follows [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/)
|
|
5
|
+
The format follows [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
|
|
7
|
+
Versioning is **not** strict [SemVer](https://semver.org/spec/v2.0.0.html) while this API is
|
|
8
|
+
pre-stable: breaking changes ship in minor and patch releases by explicit `@bymax-one` policy,
|
|
9
|
+
so a version number carries no compatibility information. The **Apply to a derived backend**
|
|
10
|
+
note on each entry is the compatibility contract — read it, not the number.
|
|
6
11
|
|
|
7
12
|
---
|
|
8
13
|
|
|
9
14
|
## [Unreleased]
|
|
10
15
|
|
|
16
|
+
## [1.1.1] - 2026-10-30
|
|
17
|
+
|
|
18
|
+
Apart from the removal below, nothing here changes the published bundle: the remaining entries are
|
|
19
|
+
development, test and CI tooling.
|
|
20
|
+
|
|
21
|
+
### Removed
|
|
22
|
+
|
|
23
|
+
- **`BYMAX_STORAGE_LOGGER` and `BYMAX_STORAGE_IDEMPOTENCY_CACHE` are no longer exported.**
|
|
24
|
+
Both were re-exported from the package barrel while being absent from the module's
|
|
25
|
+
`exports`: no provider ever registered `BYMAX_STORAGE_LOGGER`, and the idempotency cache is
|
|
26
|
+
registered but deliberately not exported. Injecting either raised
|
|
27
|
+
`UnknownDependenciesException` and the application failed to boot, so neither has ever been
|
|
28
|
+
usable as an injectable token from this library.
|
|
29
|
+
|
|
30
|
+
**Apply to a derived backend:** delete every *import* of these two names, not only the
|
|
31
|
+
injections. The reliable signal is the TypeScript error `TS2305: Module … has no exported
|
|
32
|
+
member '…'`, which fires in both module systems. At runtime the two differ, and only one is
|
|
33
|
+
loud: an ESM consumer fails at module-link time with `SyntaxError: The requested module does
|
|
34
|
+
not provide an export named '…'` before Nest bootstraps, while a CommonJS consumer — the
|
|
35
|
+
common case for a compiled NestJS application — silently receives `undefined` and fails later
|
|
36
|
+
with a confusing resolution error. Do not wait for a crash to find these; grep for the names.
|
|
37
|
+
|
|
38
|
+
One shape did work and is the one to migrate deliberately: registering the exported symbol as
|
|
39
|
+
**your own** provider (`{ provide: BYMAX_STORAGE_LOGGER, useValue: myLogger }`) and injecting
|
|
40
|
+
it in your own service. That never involved this library's DI container. Replace the symbol
|
|
41
|
+
with a token you own — `Symbol('MY_STORAGE_LOGGER')` — and nothing else changes.
|
|
42
|
+
|
|
43
|
+
For logging specifically: services here use `new Logger(ClassName)` from `@nestjs/common`, so
|
|
44
|
+
`app.useLogger(...)` redirects them all, which is what this token pretended to offer.
|
|
45
|
+
|
|
46
|
+
### Security
|
|
47
|
+
|
|
48
|
+
- Raised the floors of vulnerable transitive dev dependencies through `pnpm.overrides` in
|
|
49
|
+
`pnpm-workspace.yaml`: `browserslist`, `fast-uri`, `qs`, `undici`, `multer`, `brace-expansion`,
|
|
50
|
+
`handlebars`, `js-yaml`, `@grpc/grpc-js`, `body-parser`, `proxy-addr` and `zod`. Every one is
|
|
51
|
+
reached only through test, lint or mutation tooling; `dependencies` is empty, so none ships.
|
|
52
|
+
- `osv-scanner.toml` ignores `GHSA-gcqx-w48m-w2h4` (`deepmerge`, reached only through
|
|
53
|
+
`jest-config`) until 2027-01-27, because no patched release exists.
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- Moved the development toolchain to ESLint 10 and bumped the `dev-dependencies` groups.
|
|
58
|
+
- The E2E suite starts its S3 server from one image, pinned by digest, held in
|
|
59
|
+
`test/e2e/fixtures/minio-container.ts`; the CI workflow pre-pulls the reference it reads from
|
|
60
|
+
that file.
|
|
61
|
+
- Bumped the pinned CI actions (`actions/setup-node`, `actions/upload-artifact`,
|
|
62
|
+
`step-security/harden-runner`, `pnpm/action-setup`, `github/codeql-action/upload-sarif`) and moved
|
|
63
|
+
the OSV scan and the shared review-rules sync to their shared workflows.
|
|
64
|
+
|
|
65
|
+
### Tests
|
|
66
|
+
|
|
67
|
+
- `mapAwsError` is now asserted never to attach the caught error, on every branch.
|
|
68
|
+
|
|
11
69
|
## [1.1.0] - 2026-08-11
|
|
12
70
|
|
|
13
71
|
Coordinated ecosystem release aligning every `@bymax-one/*` package after the ioredis 6 /
|
|
@@ -275,4 +333,5 @@ have regressed from. They are kept because the reasoning is worth having.
|
|
|
275
333
|
[1.0.5]: https://github.com/bymaxone/nest-storage/compare/v1.0.4...v1.0.5
|
|
276
334
|
[1.0.6]: https://github.com/bymaxone/nest-storage/compare/v1.0.5...v1.0.6
|
|
277
335
|
[1.1.0]: https://github.com/bymaxone/nest-storage/compare/v1.0.6...v1.1.0
|
|
278
|
-
[
|
|
336
|
+
[1.1.1]: https://github.com/bymaxone/nest-storage/compare/v1.1.0...v1.1.1
|
|
337
|
+
[Unreleased]: https://github.com/bymaxone/nest-storage/compare/v1.1.1...HEAD
|
package/README.md
CHANGED
|
@@ -669,8 +669,11 @@ supply through it first: the guard below, then `keyPrefix`. The key you read bac
|
|
|
669
669
|
### DI tokens
|
|
670
670
|
|
|
671
671
|
`BYMAX_STORAGE_OPTIONS` · `BYMAX_STORAGE_S3_CLIENT` · `BYMAX_STORAGE_FILE_SCANNER` ·
|
|
672
|
-
`BYMAX_STORAGE_UPLOAD_VALIDATORS`
|
|
673
|
-
|
|
672
|
+
`BYMAX_STORAGE_UPLOAD_VALIDATORS` — all `Symbol()`, so no string token can collide with
|
|
673
|
+
them, and all four are in the module's `exports`, so injection resolves rather than raising
|
|
674
|
+
`UnknownDependenciesException`. Two of them are nullable by design: `BYMAX_STORAGE_S3_CLIENT`
|
|
675
|
+
is `null` until credentials are configured, and `BYMAX_STORAGE_FILE_SCANNER` is `null` when no
|
|
676
|
+
scanner is set, which is the default. Type them as `S3Client | null` and `IFileScanner | null`.
|
|
674
677
|
|
|
675
678
|
---
|
|
676
679
|
|
|
@@ -706,12 +709,16 @@ supply through it first: the guard below, then `keyPrefix`. The key you read bac
|
|
|
706
709
|
│
|
|
707
710
|
┌────────────────────┼────────────────────┐
|
|
708
711
|
│ │ │
|
|
709
|
-
|
|
712
|
+
ValidationService IFileScanner IdempotencyCache
|
|
710
713
|
MIME + size, then pre- and/or LRU, in-process,
|
|
711
|
-
|
|
714
|
+
IUploadValidator[] post-upload collapses a retry
|
|
712
715
|
(yours) (yours) within one instance
|
|
713
716
|
```
|
|
714
717
|
|
|
718
|
+
`SignedUrlService` stops at `KeyResolverService`: it signs a URL and never sees the body, so
|
|
719
|
+
validation, scanning and the idempotency cache apply to `StorageService` only. See the signed-PUT
|
|
720
|
+
caveat above.
|
|
721
|
+
|
|
715
722
|
One engine, six recipes. `providerRecipes` differ only in endpoint, region and the
|
|
716
723
|
handful of flags each provider needs (`forcePathStyle` for MinIO, `auto` region for
|
|
717
724
|
R2) — there is no per-provider code path, so a provider swap is a configuration
|
package/dist/server/index.cjs
CHANGED
|
@@ -22,7 +22,6 @@ var BYMAX_STORAGE_OPTIONS = /* @__PURE__ */ Symbol("BYMAX_STORAGE_OPTIONS");
|
|
|
22
22
|
var BYMAX_STORAGE_S3_CLIENT = /* @__PURE__ */ Symbol("BYMAX_STORAGE_S3_CLIENT");
|
|
23
23
|
var BYMAX_STORAGE_UPLOAD_VALIDATORS = /* @__PURE__ */ Symbol("BYMAX_STORAGE_UPLOAD_VALIDATORS");
|
|
24
24
|
var BYMAX_STORAGE_FILE_SCANNER = /* @__PURE__ */ Symbol("BYMAX_STORAGE_FILE_SCANNER");
|
|
25
|
-
var BYMAX_STORAGE_LOGGER = /* @__PURE__ */ Symbol("BYMAX_STORAGE_LOGGER");
|
|
26
25
|
var BYMAX_STORAGE_IDEMPOTENCY_CACHE = /* @__PURE__ */ Symbol("BYMAX_STORAGE_IDEMPOTENCY_CACHE");
|
|
27
26
|
|
|
28
27
|
// src/shared/constants/error-codes.constants.ts
|
|
@@ -1842,8 +1841,6 @@ var providerRecipes = {
|
|
|
1842
1841
|
};
|
|
1843
1842
|
|
|
1844
1843
|
exports.BYMAX_STORAGE_FILE_SCANNER = BYMAX_STORAGE_FILE_SCANNER;
|
|
1845
|
-
exports.BYMAX_STORAGE_IDEMPOTENCY_CACHE = BYMAX_STORAGE_IDEMPOTENCY_CACHE;
|
|
1846
|
-
exports.BYMAX_STORAGE_LOGGER = BYMAX_STORAGE_LOGGER;
|
|
1847
1844
|
exports.BYMAX_STORAGE_OPTIONS = BYMAX_STORAGE_OPTIONS;
|
|
1848
1845
|
exports.BYMAX_STORAGE_S3_CLIENT = BYMAX_STORAGE_S3_CLIENT;
|
|
1849
1846
|
exports.BYMAX_STORAGE_UPLOAD_VALIDATORS = BYMAX_STORAGE_UPLOAD_VALIDATORS;
|
package/dist/server/index.d.cts
CHANGED
|
@@ -1142,8 +1142,6 @@ declare const BYMAX_STORAGE_OPTIONS: unique symbol;
|
|
|
1142
1142
|
declare const BYMAX_STORAGE_S3_CLIENT: unique symbol;
|
|
1143
1143
|
declare const BYMAX_STORAGE_UPLOAD_VALIDATORS: unique symbol;
|
|
1144
1144
|
declare const BYMAX_STORAGE_FILE_SCANNER: unique symbol;
|
|
1145
|
-
declare const BYMAX_STORAGE_LOGGER: unique symbol;
|
|
1146
|
-
declare const BYMAX_STORAGE_IDEMPOTENCY_CACHE: unique symbol;
|
|
1147
1145
|
|
|
1148
1146
|
/**
|
|
1149
1147
|
* @fileoverview Provider-recipe contract — a factory that produces
|
|
@@ -1207,4 +1205,4 @@ declare class StorageException extends HttpException {
|
|
|
1207
1205
|
statusCode?: HttpStatus, details?: Record<string, unknown>);
|
|
1208
1206
|
}
|
|
1209
1207
|
|
|
1210
|
-
export { BYMAX_STORAGE_FILE_SCANNER,
|
|
1208
|
+
export { BYMAX_STORAGE_FILE_SCANNER, BYMAX_STORAGE_OPTIONS, BYMAX_STORAGE_S3_CLIENT, BYMAX_STORAGE_UPLOAD_VALIDATORS, BymaxStorageModule, type BymaxStorageModuleAsyncOptions, type BymaxStorageModuleOptions, type BymaxStorageModuleOptionsFactory, type CopyOptions, type DeleteManyOptions, type DeleteManyResult, type DownloadOptions, type FailedDeletion, type FileScanResult, type IFileScanner, type IUploadValidator, type ListOptions, type ListResult, type ListedObject, type MultipartUploadUrlsOptions, type MultipartUploadUrlsResult, NoOpFileScanner, NoOpUploadValidator, type ObjectMetadata, type ProviderRecipe, STORAGE_ERROR_CODES, type SignedGetUrlOptions, type SignedPutUrlOptions, type SignedUrlResult, SignedUrlService, type StorageErrorCode, StorageException, StorageService, type UploadOptions, type UploadResult, providerRecipes };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1142,8 +1142,6 @@ declare const BYMAX_STORAGE_OPTIONS: unique symbol;
|
|
|
1142
1142
|
declare const BYMAX_STORAGE_S3_CLIENT: unique symbol;
|
|
1143
1143
|
declare const BYMAX_STORAGE_UPLOAD_VALIDATORS: unique symbol;
|
|
1144
1144
|
declare const BYMAX_STORAGE_FILE_SCANNER: unique symbol;
|
|
1145
|
-
declare const BYMAX_STORAGE_LOGGER: unique symbol;
|
|
1146
|
-
declare const BYMAX_STORAGE_IDEMPOTENCY_CACHE: unique symbol;
|
|
1147
1145
|
|
|
1148
1146
|
/**
|
|
1149
1147
|
* @fileoverview Provider-recipe contract — a factory that produces
|
|
@@ -1207,4 +1205,4 @@ declare class StorageException extends HttpException {
|
|
|
1207
1205
|
statusCode?: HttpStatus, details?: Record<string, unknown>);
|
|
1208
1206
|
}
|
|
1209
1207
|
|
|
1210
|
-
export { BYMAX_STORAGE_FILE_SCANNER,
|
|
1208
|
+
export { BYMAX_STORAGE_FILE_SCANNER, BYMAX_STORAGE_OPTIONS, BYMAX_STORAGE_S3_CLIENT, BYMAX_STORAGE_UPLOAD_VALIDATORS, BymaxStorageModule, type BymaxStorageModuleAsyncOptions, type BymaxStorageModuleOptions, type BymaxStorageModuleOptionsFactory, type CopyOptions, type DeleteManyOptions, type DeleteManyResult, type DownloadOptions, type FailedDeletion, type FileScanResult, type IFileScanner, type IUploadValidator, type ListOptions, type ListResult, type ListedObject, type MultipartUploadUrlsOptions, type MultipartUploadUrlsResult, NoOpFileScanner, NoOpUploadValidator, type ObjectMetadata, type ProviderRecipe, STORAGE_ERROR_CODES, type SignedGetUrlOptions, type SignedPutUrlOptions, type SignedUrlResult, SignedUrlService, type StorageErrorCode, StorageException, StorageService, type UploadOptions, type UploadResult, providerRecipes };
|
package/dist/server/index.mjs
CHANGED
|
@@ -20,7 +20,6 @@ var BYMAX_STORAGE_OPTIONS = /* @__PURE__ */ Symbol("BYMAX_STORAGE_OPTIONS");
|
|
|
20
20
|
var BYMAX_STORAGE_S3_CLIENT = /* @__PURE__ */ Symbol("BYMAX_STORAGE_S3_CLIENT");
|
|
21
21
|
var BYMAX_STORAGE_UPLOAD_VALIDATORS = /* @__PURE__ */ Symbol("BYMAX_STORAGE_UPLOAD_VALIDATORS");
|
|
22
22
|
var BYMAX_STORAGE_FILE_SCANNER = /* @__PURE__ */ Symbol("BYMAX_STORAGE_FILE_SCANNER");
|
|
23
|
-
var BYMAX_STORAGE_LOGGER = /* @__PURE__ */ Symbol("BYMAX_STORAGE_LOGGER");
|
|
24
23
|
var BYMAX_STORAGE_IDEMPOTENCY_CACHE = /* @__PURE__ */ Symbol("BYMAX_STORAGE_IDEMPOTENCY_CACHE");
|
|
25
24
|
|
|
26
25
|
// src/shared/constants/error-codes.constants.ts
|
|
@@ -1839,4 +1838,4 @@ var providerRecipes = {
|
|
|
1839
1838
|
}
|
|
1840
1839
|
};
|
|
1841
1840
|
|
|
1842
|
-
export { BYMAX_STORAGE_FILE_SCANNER,
|
|
1841
|
+
export { BYMAX_STORAGE_FILE_SCANNER, BYMAX_STORAGE_OPTIONS, BYMAX_STORAGE_S3_CLIENT, BYMAX_STORAGE_UPLOAD_VALIDATORS, BymaxStorageModule, NoOpFileScanner, NoOpUploadValidator, STORAGE_ERROR_CODES, SignedUrlService, StorageException, StorageService, providerRecipes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bymax-one/nest-storage",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Provider-agnostic S3-compatible object storage for NestJS. Works with AWS S3, DigitalOcean Spaces, Cloudflare R2, Backblaze B2, MinIO, Wasabi.",
|
|
5
5
|
"author": "Bymax One <support@bymax.one>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"@aws-sdk/client-s3": "^3.1099.0",
|
|
101
101
|
"@aws-sdk/lib-storage": "^3.1099.0",
|
|
102
102
|
"@aws-sdk/s3-request-presigner": "^3.1099.0",
|
|
103
|
-
"@eslint/js": "^
|
|
103
|
+
"@eslint/js": "^10.0.1",
|
|
104
104
|
"@nestjs/common": "^11.1.28",
|
|
105
105
|
"@nestjs/core": "^11.1.28",
|
|
106
106
|
"@nestjs/platform-express": "^11.1.28",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@types/jest": "^30.0.0",
|
|
114
114
|
"@types/node": "^24.13.3",
|
|
115
115
|
"@types/supertest": "^7.2.1",
|
|
116
|
-
"eslint": "^9.
|
|
116
|
+
"eslint": "^10.9.1",
|
|
117
117
|
"eslint-config-prettier": "^10.1.8",
|
|
118
118
|
"jest": "^30.4.2",
|
|
119
119
|
"prettier": "^3.9.6",
|