@zola_do/seaweed 0.2.16 → 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 +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/seaweed-error-response.type.d.ts +9 -0
- package/dist/seaweed-error-response.type.js +3 -0
- package/dist/seaweed-error-response.type.js.map +1 -0
- package/dist/validate-seaweed-env.helper.d.ts +4 -0
- package/dist/validate-seaweed-env.helper.js +19 -0
- package/dist/validate-seaweed-env.helper.js.map +1 -0
- package/package.json +1 -1
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
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 @@
|
|
|
1
|
+
{"version":3,"file":"seaweed-error-response.type.js","sourceRoot":"","sources":["../src/seaweed-error-response.type.ts"],"names":[],"mappings":""}
|
|
@@ -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"}
|