@celljs/cloud 4.3.0 → 4.4.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/README.md CHANGED
@@ -1 +1,49 @@
1
- # Cell - cloud Component
1
+ # Cell - Cloud Component
2
+
3
+ Shared abstractions of the cloud packages: where credentials, region and account come from, and the `ObjectStorageService` interface that [`@celljs/oss`](../oss) and [`@celljs/cos`](../cos) implement.
4
+
5
+ ```bash
6
+ npm install @celljs/cloud
7
+ ```
8
+
9
+ ## Credentials, region, account
10
+
11
+ | Component | Default source |
12
+ | --- | --- |
13
+ | `CredentialsProvider` | `cloud.credentials`: `{ accessKeyId, accessKeySecret, token? }` |
14
+ | `RegionProvider` | `cloud.region` |
15
+ | `AccountProvider` | `cloud.account`: `{ id }` |
16
+ | `ClientOptionsProvider` | `cloud.client`: extra options of the vendor client |
17
+
18
+ ```yaml
19
+ cloud:
20
+ region: cn-hangzhou
21
+ credentials:
22
+ accessKeyId: "${env.ACCESS_KEY_ID}"
23
+ accessKeySecret: "${env.ACCESS_KEY_SECRET}"
24
+ ```
25
+
26
+ Keep credentials in environment variables (`${env.X}` in `cell.yml`); configuration is server-only. Bind your own provider (`rebind: true`) to read them from somewhere else, such as a secrets manager.
27
+
28
+ ## Object storage
29
+
30
+ `ObjectStorageService` has `createBucket`, `deleteBucket`, `listBuckets`, `listObjects`, `getObject`, `getStream`, `putObject`, `copyObject`, `deleteObject` and `headObject`, with the same request shapes for every vendor:
31
+
32
+ ```ts
33
+ import { Autowired, Component } from '@celljs/core';
34
+ import { ObjectStorageService } from '@celljs/cloud';
35
+
36
+ @Component()
37
+ export class Uploads {
38
+ @Autowired(ObjectStorageService)
39
+ protected readonly storage: ObjectStorageService<any>;
40
+
41
+ save(key: string, body: Buffer) {
42
+ return this.storage.putObject({ bucket: 'uploads', key, body });
43
+ }
44
+ }
45
+ ```
46
+
47
+ Install one implementation: `@celljs/oss` (Alibaba Cloud) or `@celljs/cos` (Tencent Cloud). `getRawCloudService()` returns the vendor's own client for anything else.
48
+
49
+ Deploying an application to a cloud platform does not need this package: see the presets of `cell deploy`.
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "properties": {
4
+ "cloud": {
5
+ "type": "object",
6
+ "description": "Cloud services; a service may have its own cloud.<name>.{account,client,region,credentials}.",
7
+ "properties": {
8
+ "account": {
9
+ "type": "object",
10
+ "additionalProperties": true
11
+ },
12
+ "client": {
13
+ "type": "object",
14
+ "additionalProperties": true
15
+ },
16
+ "region": {
17
+ "type": "string"
18
+ },
19
+ "credentials": {
20
+ "type": "object",
21
+ "description": "Credentials, from the environment.",
22
+ "additionalProperties": true
23
+ }
24
+ },
25
+ "additionalProperties": {
26
+ "type": "object",
27
+ "additionalProperties": true
28
+ }
29
+ }
30
+ }
31
+ }
@@ -15,19 +15,19 @@ import { RegionProvider } from './region-protocol.js';
15
15
  export class AbstractCloudService {
16
16
  async getRawCloudService() {
17
17
  if (!this._rawCloudService) {
18
- const accountProp = `cell.cloud.${this.name}.account`;
19
- const clientProp = `cell.cloud.${this.name}.client`;
20
- const regionProp = `cell.cloud.${this.name}.region`;
21
- const credentialsProp = `cell.cloud.${this.name}.credentials`;
18
+ const accountProp = `cloud.${this.name}.account`;
19
+ const clientProp = `cloud.${this.name}.client`;
20
+ const regionProp = `cloud.${this.name}.region`;
21
+ const credentialsProp = `cloud.${this.name}.credentials`;
22
22
  const account = ConfigUtil.get(accountProp) || await this.accountProvider.provide();
23
23
  const clientOptions = ConfigUtil.get(clientProp) || await this.clientOptionsProvider.provide() || { internal: true };
24
24
  const region = ConfigUtil.get(regionProp) || await this.regionProvider.provide();
25
25
  if (!region) {
26
- throw Error(`Please configure region through the properties "cell.cloud.region" or "${regionProp}"`);
26
+ throw Error(`Please configure region through the properties "cloud.region" or "${regionProp}"`);
27
27
  }
28
28
  const credentials = ConfigUtil.get(credentialsProp) || await this.credentialsProvider.provide();
29
29
  if (!credentials) {
30
- throw Error(`Please configure credentials through the properties "cell.cloud.credentials" or "${credentialsProp}"`);
30
+ throw Error(`Please configure credentials through the properties "cloud.credentials" or "${credentialsProp}"`);
31
31
  }
32
32
  this._rawCloudService = await this.doCreateRawCloudService(credentials, region, clientOptions, account);
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-protocol.js","sourceRoot":"","sources":["../../src/common/cloud-protocol.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAW,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAiB,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAe,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAYnD,MAAM,OAAgB,oBAAoB;IAkBtC,KAAK,CAAC,kBAAkB;QACpB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACzB,MAAM,WAAW,GAAG,cAAc,IAAI,CAAC,IAAI,UAAU,CAAC;YACtD,MAAM,UAAU,GAAG,cAAc,IAAI,CAAC,IAAI,SAAS,CAAC;YACpD,MAAM,UAAU,GAAG,cAAc,IAAI,CAAC,IAAI,SAAS,CAAC;YACpD,MAAM,eAAe,GAAG,cAAc,IAAI,CAAC,IAAI,cAAc,CAAC;YAE9D,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAU,WAAW,CAAC,IAAI,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;YAC7F,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAgB,UAAU,CAAC,IAAI,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpI,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAS,UAAU,C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kB,CAAC,eAAkB;QACjC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC5C,CAAC;CAIJ;AA1CsB;IADlB,SAAS,CAAC,cAAc,CAAC;;4DACwB;AAG/B;IADlB,SAAS,CAAC,mBAAmB,CAAC;;iEAC6B;AAGzC;IADlB,SAAS,CAAC,eAAe,CAAC;;6DACyB;AAGjC;IADlB,SAAS,CAAC,qBAAqB,CAAC;;mEAC+B"}
@@ -15,7 +15,7 @@ let DefaultAccountProvider = class DefaultAccountProvider {
15
15
  }
16
16
  };
17
17
  __decorate([
18
- Value('cell.cloud.account'),
18
+ Value('cloud.account'),
19
19
  __metadata("design:type", Object)
20
20
  ], DefaultAccountProvider.prototype, "account", void 0);
21
21
  DefaultAccountProvider = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"account-provider.js","sourceRoot":"","sources":["../../src/node/account-provider.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAW,MAAM,WAAW,CAAC;AAG9C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAK/B,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CAEJ,CAAA;AANsB;IADlB,KAAK,CAAC,oBAAoB,CAAC;;uDACQ;AAH3B,sBAAsB;IADlC,SAAS,CAAC,eAAe,CAAC;GACd,sBAAsB,CASlC"}
1
+ {"version":3,"file":"account-provider.js","sourceRoot":"","sources":["../../src/node/account-provider.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAW,MAAM,WAAW,CAAC;AAG9C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAK/B,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CAEJ,CAAA;AANsB;IADlB,KAAK,CAAC,eAAe,CAAC;;uDACa;AAH3B,sBAAsB;IADlC,SAAS,CAAC,eAAe,CAAC;GACd,sBAAsB,CASlC"}
@@ -15,7 +15,7 @@ let DefaultClientOptionsProvider = class DefaultClientOptionsProvider {
15
15
  }
16
16
  };
17
17
  __decorate([
18
- Value('cell.cloud.client'),
18
+ Value('cloud.client'),
19
19
  __metadata("design:type", Object)
20
20
  ], DefaultClientOptionsProvider.prototype, "clientOptions", void 0);
21
21
  DefaultClientOptionsProvider = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"client-options-provider.js","sourceRoot":"","sources":["../../src/node/client-options-provider.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAiB,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAG1D,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAKrC,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;CAEJ,CAAA;AANsB;IADlB,KAAK,CAAC,mBAAmB,CAAC;;mEACqB;AAHvC,4BAA4B;IADxC,SAAS,CAAC,qBAAqB,CAAC;GACpB,4BAA4B,CASxC"}
1
+ {"version":3,"file":"client-options-provider.js","sourceRoot":"","sources":["../../src/node/client-options-provider.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAiB,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAG1D,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAKrC,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;CAEJ,CAAA;AANsB;IADlB,KAAK,CAAC,cAAc,CAAC;;mEAC0B;AAHvC,4BAA4B;IADxC,SAAS,CAAC,qBAAqB,CAAC;GACpB,4BAA4B,CASxC"}
@@ -15,7 +15,7 @@ let DefaultCredentialsProvider = class DefaultCredentialsProvider {
15
15
  }
16
16
  };
17
17
  __decorate([
18
- Value('cell.cloud.credentials'),
18
+ Value('cloud.credentials'),
19
19
  __metadata("design:type", Object)
20
20
  ], DefaultCredentialsProvider.prototype, "credentials", void 0);
21
21
  DefaultCredentialsProvider = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"credentials-provider.js","sourceRoot":"","sources":["../../src/node/credentials-provider.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAe,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGtD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAKnC,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CAEJ,CAAA;AANsB;IADlB,KAAK,CAAC,wBAAwB,CAAC;;+DACY;AAHnC,0BAA0B;IADtC,SAAS,CAAC,mBAAmB,CAAC;GAClB,0BAA0B,CAStC"}
1
+ {"version":3,"file":"credentials-provider.js","sourceRoot":"","sources":["../../src/node/credentials-provider.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAe,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGtD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAKnC,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CAEJ,CAAA;AANsB;IADlB,KAAK,CAAC,mBAAmB,CAAC;;+DACiB;AAHnC,0BAA0B;IADtC,SAAS,CAAC,mBAAmB,CAAC;GAClB,0BAA0B,CAStC"}
@@ -15,7 +15,7 @@ let DefaultRegionProvider = class DefaultRegionProvider {
15
15
  }
16
16
  };
17
17
  __decorate([
18
- Value('cell.cloud.region'),
18
+ Value('cloud.region'),
19
19
  __metadata("design:type", String)
20
20
  ], DefaultRegionProvider.prototype, "region", void 0);
21
21
  DefaultRegionProvider = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"regin-provider.js","sourceRoot":"","sources":["../../src/node/regin-provider.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGpC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAK9B,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ,CAAA;AALsB;IADlB,KAAK,CAAC,mBAAmB,CAAC;;qDACO;AAHzB,qBAAqB;IADjC,SAAS,CAAC,cAAc,CAAC;GACb,qBAAqB,CAQjC"}
1
+ {"version":3,"file":"regin-provider.js","sourceRoot":"","sources":["../../src/node/regin-provider.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGpC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAK9B,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ,CAAA;AALsB;IADlB,KAAK,CAAC,cAAc,CAAC;;qDACY;AAHzB,qBAAqB;IADjC,SAAS,CAAC,cAAc,CAAC;GACb,qBAAqB,CAQjC"}
@@ -18,19 +18,19 @@ const region_protocol_1 = require("./region-protocol");
18
18
  class AbstractCloudService {
19
19
  async getRawCloudService() {
20
20
  if (!this._rawCloudService) {
21
- const accountProp = `cell.cloud.${this.name}.account`;
22
- const clientProp = `cell.cloud.${this.name}.client`;
23
- const regionProp = `cell.cloud.${this.name}.region`;
24
- const credentialsProp = `cell.cloud.${this.name}.credentials`;
21
+ const accountProp = `cloud.${this.name}.account`;
22
+ const clientProp = `cloud.${this.name}.client`;
23
+ const regionProp = `cloud.${this.name}.region`;
24
+ const credentialsProp = `cloud.${this.name}.credentials`;
25
25
  const account = core_1.ConfigUtil.get(accountProp) || await this.accountProvider.provide();
26
26
  const clientOptions = core_1.ConfigUtil.get(clientProp) || await this.clientOptionsProvider.provide() || { internal: true };
27
27
  const region = core_1.ConfigUtil.get(regionProp) || await this.regionProvider.provide();
28
28
  if (!region) {
29
- throw Error(`Please configure region through the properties "cell.cloud.region" or "${regionProp}"`);
29
+ throw Error(`Please configure region through the properties "cloud.region" or "${regionProp}"`);
30
30
  }
31
31
  const credentials = core_1.ConfigUtil.get(credentialsProp) || await this.credentialsProvider.provide();
32
32
  if (!credentials) {
33
- throw Error(`Please configure credentials through the properties "cell.cloud.credentials" or "${credentialsProp}"`);
33
+ throw Error(`Please configure credentials through the properties "cloud.credentials" or "${credentialsProp}"`);
34
34
  }
35
35
  this._rawCloudService = await this.doCreateRawCloudService(credentials, region, clientOptions, account);
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-protocol.js","sourceRoot":"","sources":["../../src/common/cloud-protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAqD;AACrD,yDAA8D;AAC9D,uDAAyE;AACzE,iEAA0E;AAC1E,uDAAmD;AAYnD;IAkBI,KAAK,CAAC,kBAAkB;QACpB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACzB,MAAM,WAAW,GAAG,cAAc,IAAI,CAAC,IAAI,UAAU,CAAC;YACtD,MAAM,UAAU,GAAG,cAAc,IAAI,CAAC,IAAI,SAAS,CAAC;YACpD,MAAM,UAAU,GAAG,cAAc,IAAI,CAAC,IAAI,SAAS,CAAC;YACpD,MAAM,eAAe,GAAG,cAAc,IAAI,CAAC,IAAI,cAAc,CAAC;YAE9D,MAAM,OAAO,GAAG,iBAAU,CAAC,GAAG,CAAU,WAAW,CAAC,IAAI,MAAM,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,CAAC;QAC5G,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,kBAAkB,CAAC,eAAkB;QACjC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC5C,CAAC;CAIJ;;AA1CsB;IADlB,IAAA,gBAAS,EAAC,gCAAc,CAAC;;4DACwB;AAG/B;IADlB,IAAA,gBAAS,EAAC,0CAAmB,CAAC;;iEAC6B;AAGzC;IADlB,IAAA,gBAAS,EAAC,kCAAe,CAAC;;6DACyB;AAGjC;IADlB,IAAA,gBAAS,EAAC,uCAAqB,CAAC;;mEAC+B"}
@@ -19,7 +19,7 @@ let DefaultAccountProvider = class DefaultAccountProvider {
19
19
  };
20
20
  exports.DefaultAccountProvider = DefaultAccountProvider;
21
21
  __decorate([
22
- (0, core_1.Value)('cell.cloud.account'),
22
+ (0, core_1.Value)('cloud.account'),
23
23
  __metadata("design:type", Object)
24
24
  ], DefaultAccountProvider.prototype, "account", void 0);
25
25
  exports.DefaultAccountProvider = DefaultAccountProvider = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"account-provider.js","sourceRoot":"","sources":["../../src/node/account-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAgD;AAChD,sCAAqD;AAG9C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAK/B,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CAEJ,CAAA;;AANsB;IADlB,IAAA,YAAK,EAAC,oBAAoB,CAAC;;uDACQ;iCAH3B,sBAAsB;IADlC,IAAA,gBAAS,EAAC,wBAAe,CAAC;GACd,sBAAsB,CASlC"}
1
+ {"version":3,"file":"account-provider.js","sourceRoot":"","sources":["../../src/node/account-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAgD;AAChD,sCAAqD;AAG9C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAK/B,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CAEJ,CAAA;;AANsB;IADlB,IAAA,YAAK,EAAC,eAAe,CAAC;;uDACa;iCAH3B,sBAAsB;IADlC,IAAA,gBAAS,EAAC,wBAAe,CAAC;GACd,sBAAsB,CASlC"}
@@ -19,7 +19,7 @@ let DefaultClientOptionsProvider = class DefaultClientOptionsProvider {
19
19
  };
20
20
  exports.DefaultClientOptionsProvider = DefaultClientOptionsProvider;
21
21
  __decorate([
22
- (0, core_1.Value)('cell.cloud.client'),
22
+ (0, core_1.Value)('cloud.client'),
23
23
  __metadata("design:type", Object)
24
24
  ], DefaultClientOptionsProvider.prototype, "clientOptions", void 0);
25
25
  exports.DefaultClientOptionsProvider = DefaultClientOptionsProvider = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"client-options-provider.js","sourceRoot":"","sources":["../../src/node/client-options-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAgD;AAChD,sCAAiE;AAG1D,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAKrC,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;CAEJ,CAAA;;AANsB;IADlB,IAAA,YAAK,EAAC,mBAAmB,CAAC;;mEACqB;uCAHvC,4BAA4B;IADxC,IAAA,gBAAS,EAAC,8BAAqB,CAAC;GACpB,4BAA4B,CASxC"}
1
+ {"version":3,"file":"client-options-provider.js","sourceRoot":"","sources":["../../src/node/client-options-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAgD;AAChD,sCAAiE;AAG1D,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAKrC,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;CAEJ,CAAA;;AANsB;IADlB,IAAA,YAAK,EAAC,cAAc,CAAC;;mEAC0B;uCAHvC,4BAA4B;IADxC,IAAA,gBAAS,EAAC,8BAAqB,CAAC;GACpB,4BAA4B,CASxC"}
@@ -19,7 +19,7 @@ let DefaultCredentialsProvider = class DefaultCredentialsProvider {
19
19
  };
20
20
  exports.DefaultCredentialsProvider = DefaultCredentialsProvider;
21
21
  __decorate([
22
- (0, core_1.Value)('cell.cloud.credentials'),
22
+ (0, core_1.Value)('cloud.credentials'),
23
23
  __metadata("design:type", Object)
24
24
  ], DefaultCredentialsProvider.prototype, "credentials", void 0);
25
25
  exports.DefaultCredentialsProvider = DefaultCredentialsProvider = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"credentials-provider.js","sourceRoot":"","sources":["../../src/node/credentials-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAgD;AAChD,sCAA6D;AAGtD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAKnC,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CAEJ,CAAA;;AANsB;IADlB,IAAA,YAAK,EAAC,wBAAwB,CAAC;;+DACY;qCAHnC,0BAA0B;IADtC,IAAA,gBAAS,EAAC,4BAAmB,CAAC;GAClB,0BAA0B,CAStC"}
1
+ {"version":3,"file":"credentials-provider.js","sourceRoot":"","sources":["../../src/node/credentials-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAgD;AAChD,sCAA6D;AAGtD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAKnC,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CAEJ,CAAA;;AANsB;IADlB,IAAA,YAAK,EAAC,mBAAmB,CAAC;;+DACiB;qCAHnC,0BAA0B;IADtC,IAAA,gBAAS,EAAC,4BAAmB,CAAC;GAClB,0BAA0B,CAStC"}
@@ -19,7 +19,7 @@ let DefaultRegionProvider = class DefaultRegionProvider {
19
19
  };
20
20
  exports.DefaultRegionProvider = DefaultRegionProvider;
21
21
  __decorate([
22
- (0, core_1.Value)('cell.cloud.region'),
22
+ (0, core_1.Value)('cloud.region'),
23
23
  __metadata("design:type", String)
24
24
  ], DefaultRegionProvider.prototype, "region", void 0);
25
25
  exports.DefaultRegionProvider = DefaultRegionProvider = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"regin-provider.js","sourceRoot":"","sources":["../../src/node/regin-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAgD;AAChD,sCAA2C;AAGpC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAK9B,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ,CAAA;;AALsB;IADlB,IAAA,YAAK,EAAC,mBAAmB,CAAC;;qDACO;gCAHzB,qBAAqB;IADjC,IAAA,gBAAS,EAAC,uBAAc,CAAC;GACb,qBAAqB,CAQjC"}
1
+ {"version":3,"file":"regin-provider.js","sourceRoot":"","sources":["../../src/node/regin-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAgD;AAChD,sCAA2C;AAGpC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAK9B,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ,CAAA;;AALsB;IADlB,IAAA,YAAK,EAAC,cAAc,CAAC;;qDACY;gCAHzB,qBAAqB;IADjC,IAAA,gBAAS,EAAC,uBAAc,CAAC;GACb,qBAAqB,CAQjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/cloud",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "cell-component"
@@ -23,7 +23,7 @@
23
23
  "lib",
24
24
  "esm",
25
25
  "src",
26
- "cell.yml"
26
+ "cell.schema.json"
27
27
  ],
28
28
  "scripts": {
29
29
  "build": "tsc -b && bun ../../scripts/build-esm.ts",
@@ -32,7 +32,7 @@
32
32
  "watch": "tsc -b -w --preserveWatchOutput"
33
33
  },
34
34
  "dependencies": {
35
- "@celljs/core": "4.3.0"
35
+ "@celljs/core": "4.4.0"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"
@@ -34,20 +34,20 @@ export abstract class AbstractCloudService<T extends RawCloudService> implements
34
34
 
35
35
  async getRawCloudService(): Promise<T> {
36
36
  if (!this._rawCloudService) {
37
- const accountProp = `cell.cloud.${this.name}.account`;
38
- const clientProp = `cell.cloud.${this.name}.client`;
39
- const regionProp = `cell.cloud.${this.name}.region`;
40
- const credentialsProp = `cell.cloud.${this.name}.credentials`;
37
+ const accountProp = `cloud.${this.name}.account`;
38
+ const clientProp = `cloud.${this.name}.client`;
39
+ const regionProp = `cloud.${this.name}.region`;
40
+ const credentialsProp = `cloud.${this.name}.credentials`;
41
41
 
42
42
  const account = ConfigUtil.get<Account>(accountProp) || await this.accountProvider.provide();
43
43
  const clientOptions = ConfigUtil.get<ClientOptions>(clientProp) || await this.clientOptionsProvider.provide() || { internal: true };
44
44
  const region = ConfigUtil.get<string>(regionProp) || await this.regionProvider.provide();
45
45
  if (!region) {
46
- throw Error(`Please configure region through the properties "cell.cloud.region" or "${regionProp}"`);
46
+ throw Error(`Please configure region through the properties "cloud.region" or "${regionProp}"`);
47
47
  }
48
48
  const credentials = ConfigUtil.get<Credentials>(credentialsProp) || await this.credentialsProvider.provide();
49
49
  if (!credentials) {
50
- throw Error(`Please configure credentials through the properties "cell.cloud.credentials" or "${credentialsProp}"`);
50
+ throw Error(`Please configure credentials through the properties "cloud.credentials" or "${credentialsProp}"`);
51
51
  }
52
52
 
53
53
  this._rawCloudService = await this.doCreateRawCloudService(credentials, region, clientOptions, account);
@@ -4,7 +4,7 @@ import { AccountProvider, Account } from '../common';
4
4
  @Component(AccountProvider)
5
5
  export class DefaultAccountProvider implements AccountProvider {
6
6
 
7
- @Value('cell.cloud.account')
7
+ @Value('cloud.account')
8
8
  protected readonly account: Account;
9
9
 
10
10
  async provide(): Promise<Account | undefined> {
@@ -4,7 +4,7 @@ import { ClientOptions, ClientOptionsProvider } from '../common';
4
4
  @Component(ClientOptionsProvider)
5
5
  export class DefaultClientOptionsProvider implements ClientOptionsProvider {
6
6
 
7
- @Value('cell.cloud.client')
7
+ @Value('cloud.client')
8
8
  protected readonly clientOptions: ClientOptions;
9
9
 
10
10
  async provide(): Promise<ClientOptions | undefined> {
@@ -4,7 +4,7 @@ import { Credentials, CredentialsProvider } from '../common';
4
4
  @Component(CredentialsProvider)
5
5
  export class DefaultCredentialsProvider implements CredentialsProvider {
6
6
 
7
- @Value('cell.cloud.credentials')
7
+ @Value('cloud.credentials')
8
8
  protected readonly credentials: Credentials;
9
9
 
10
10
  async provide(): Promise<Credentials | undefined> {
@@ -4,7 +4,7 @@ import { RegionProvider } from '../common';
4
4
  @Component(RegionProvider)
5
5
  export class DefaultRegionProvider implements RegionProvider {
6
6
 
7
- @Value('cell.cloud.region')
7
+ @Value('cloud.region')
8
8
  protected readonly region: string;
9
9
 
10
10
  async provide(): Promise<string | undefined> {
package/cell.yml DELETED
File without changes