@zola_do/seaweed 0.2.17 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -440,3 +440,16 @@ ISC
440
440
  - [Contributing](../../CONTRIBUTING.md)
441
441
  - [Code of Conduct](../../CODE_OF_CONDUCT.md)
442
442
  - [Security Policy](../../SECURITY.md)
443
+
444
+
445
+ ## Configuration Validation
446
+
447
+ Validate S3-compatible storage settings before bootstrap:
448
+
449
+ ```typescript
450
+ import { validateSeaweedEnv } from '@zola_do/seaweed';
451
+
452
+ validateSeaweedEnv();
453
+ ```
454
+
455
+ Required variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_ENDPOINT`.
package/dist/index.d.ts CHANGED
@@ -3,3 +3,5 @@ export * from './types';
3
3
  export * from './services/storage.service';
4
4
  export * from './services/seaweed.zola-object-storage';
5
5
  export * from './exceptions';
6
+ export * from './validate-seaweed-env.helper';
7
+ export * from './seaweed-error-response.type';
package/dist/index.js CHANGED
@@ -19,4 +19,6 @@ __exportStar(require("./types"), exports);
19
19
  __exportStar(require("./services/storage.service"), exports);
20
20
  __exportStar(require("./services/seaweed.zola-object-storage"), exports);
21
21
  __exportStar(require("./exceptions"), exports);
22
+ __exportStar(require("./validate-seaweed-env.helper"), exports);
23
+ __exportStar(require("./seaweed-error-response.type"), exports);
22
24
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,0CAAwB;AACxB,6DAA2C;AAC3C,yEAAuD;AACvD,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,0CAAwB;AACxB,6DAA2C;AAC3C,yEAAuD;AACvD,+CAA6B;AAC7B,gEAA8C;AAC9C,gEAA8C"}
@@ -0,0 +1,9 @@
1
+ export type SeaweedErrorResponse = {
2
+ statusCode: number;
3
+ message: string | string[];
4
+ timestamp?: string;
5
+ path?: string;
6
+ error?: string;
7
+ bucketName?: string;
8
+ filepath?: string;
9
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=seaweed-error-response.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seaweed-error-response.type.js","sourceRoot":"","sources":["../src/seaweed-error-response.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export type ValidateSeaweedEnvOptions = {
2
+ required?: boolean;
3
+ };
4
+ export declare function validateSeaweedEnv(options?: ValidateSeaweedEnvOptions): void;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSeaweedEnv = validateSeaweedEnv;
4
+ function validateSeaweedEnv(options = {}) {
5
+ const { required = true } = options;
6
+ if (!required) {
7
+ return;
8
+ }
9
+ for (const key of [
10
+ 'AWS_ACCESS_KEY_ID',
11
+ 'AWS_SECRET_ACCESS_KEY',
12
+ 'AWS_ENDPOINT',
13
+ ]) {
14
+ if (!process.env[key]) {
15
+ throw new Error(`${key} is required`);
16
+ }
17
+ }
18
+ }
19
+ //# sourceMappingURL=validate-seaweed-env.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-seaweed-env.helper.js","sourceRoot":"","sources":["../src/validate-seaweed-env.helper.ts"],"names":[],"mappings":";;AAIA,gDAiBC;AAjBD,SAAgB,kBAAkB,CAChC,UAAqC,EAAE;IAEvC,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IACpC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO;IACT,CAAC;IAED,KAAK,MAAM,GAAG,IAAI;QAChB,mBAAmB;QACnB,uBAAuB;QACvB,cAAc;KACf,EAAE,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,cAAc,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zola_do/seaweed",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
4
4
  "description": "AWS S3-compatible storage for NestJS",
5
5
  "author": "zolaDO",
6
6
  "license": "ISC",