@midwayjs/cos 3.0.0-beta.9 → 3.0.3

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.default.js","sourceRoot":"","sources":["../src/config.default.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG;IACjB,OAAO,EAAE,EAAE;CACZ,CAAC","sourcesContent":["export const cos = {\n default: {},\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAoD;AACpD,uCAA8C;AAC9C,kDAAkD;AAUlD,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAC3B,KAAK,CAAC,OAAO,CAAC,SAAS;QACrB,MAAM,SAAS,CAAC,QAAQ,CAAC,2BAAiB,CAAC,CAAC;IAC9C,CAAC;CACF,CAAA;AAJY,gBAAgB;IAR5B,IAAA,yBAAa,EAAC;QACb,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE;YACb;gBACE,OAAO,EAAE,aAAa;aACvB;SACF;KACF,CAAC;GACW,gBAAgB,CAI5B;AAJY,4CAAgB","sourcesContent":["import { Configuration } from '@midwayjs/decorator';\nimport { COSServiceFactory } from './manager';\nimport * as defaultConfig from './config.default';\n\n@Configuration({\n namespace: 'cos',\n importConfigs: [\n {\n default: defaultConfig,\n },\n ],\n})\nexport class COSConfiguration {\n async onReady(container) {\n await container.getAsync(COSServiceFactory);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iDAAoE;AAA3D,8GAAA,gBAAgB,OAAiB;AAC1C,4CAA0B","sourcesContent":["export { COSConfiguration as Configuration } from './configuration';\nexport * from './manager';\n"]}
package/dist/manager.d.ts CHANGED
@@ -4,7 +4,7 @@ export declare class COSServiceFactory extends ServiceFactory<COS> {
4
4
  cosConfig: any;
5
5
  init(): Promise<void>;
6
6
  logger: any;
7
- createClient(config: any): Promise<COS>;
7
+ createClient(config: COS.COSOptions): Promise<COS>;
8
8
  getName(): string;
9
9
  }
10
10
  export declare class COSService implements COS {
package/dist/manager.js CHANGED
@@ -19,12 +19,9 @@ let COSServiceFactory = class COSServiceFactory extends core_1.ServiceFactory {
19
19
  await this.initClients(this.cosConfig);
20
20
  }
21
21
  async createClient(config) {
22
- assert(config.secretId && config.secretKey, '[@midwayjs/cos] secretId secretKey is required on config');
23
- this.logger.info('[@midwayjs/cos] init %s', config.secretId);
24
- return new COS({
25
- SecretId: config.secretId,
26
- SecretKey: config.secretKey,
27
- });
22
+ assert(config.SecretId && config.SecretId, '[@midwayjs/cos] secretId secretKey is required on config');
23
+ this.logger.info('[@midwayjs/cos] init %s', config.SecretKey);
24
+ return new COS(config);
28
25
  }
29
26
  getName() {
30
27
  return 'cos';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.js","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAQ6B;AAC7B,yCAA+E;AAC/E,iCAAiC;AACjC,yCAAyC;AAIzC,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,qBAAmB;IAKxD,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAKD,KAAK,CAAC,YAAY,CAAC,MAAsB;QACvC,MAAM,CACJ,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAClC,0DAA0D,CAC3D,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QAE9D,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AAvBC;IADC,IAAA,kBAAM,EAAC,KAAK,CAAC;;oDACJ;AAGV;IADC,IAAA,gBAAI,GAAE;;;;6CAGN;AAGD;IADC,IAAA,kBAAM,EAAC,YAAY,CAAC;;iDACd;AAVI,iBAAiB;IAF7B,IAAA,mBAAO,GAAE;IACT,IAAA,iBAAK,EAAC,qBAAS,CAAC,SAAS,CAAC;GACd,iBAAiB,CAyB7B;AAzBY,8CAAiB;AA6B9B,IAAa,UAAU,GAAvB,MAAa,UAAU;IAQrB,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACF,CAAA;AATC;IADC,IAAA,kBAAM,GAAE;8BACe,iBAAiB;kDAAC;AAM1C;IADC,IAAA,gBAAI,GAAE;;;;sCAGN;AAVU,UAAU;IAFtB,IAAA,mBAAO,GAAE;IACT,IAAA,iBAAK,EAAC,qBAAS,CAAC,SAAS,CAAC;GACd,UAAU,CAWtB;AAXY,gCAAU;AAkBvB,IAAA,oCAA6B,EAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC","sourcesContent":["import {\n Config,\n Init,\n Inject,\n Logger,\n Provide,\n Scope,\n ScopeEnum,\n} from '@midwayjs/decorator';\nimport { ServiceFactory, delegateTargetPrototypeMethod } from '@midwayjs/core';\nimport * as assert from 'assert';\nimport * as COS from 'cos-nodejs-sdk-v5';\n\n@Provide()\n@Scope(ScopeEnum.Singleton)\nexport class COSServiceFactory extends ServiceFactory<COS> {\n @Config('cos')\n cosConfig;\n\n @Init()\n async init() {\n await this.initClients(this.cosConfig);\n }\n\n @Logger('coreLogger')\n logger;\n\n async createClient(config: COS.COSOptions): Promise<COS> {\n assert(\n config.SecretId && config.SecretId,\n '[@midwayjs/cos] secretId secretKey is required on config'\n );\n this.logger.info('[@midwayjs/cos] init %s', config.SecretKey);\n\n return new COS(config);\n }\n\n getName() {\n return 'cos';\n }\n}\n\n@Provide()\n@Scope(ScopeEnum.Singleton)\nexport class COSService implements COS {\n @Inject()\n private serviceFactory: COSServiceFactory;\n\n // @ts-expect-error used\n private instance: COS;\n\n @Init()\n async init() {\n this.instance = this.serviceFactory.get('default');\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface COSService extends COS {\n // empty\n}\n\ndelegateTargetPrototypeMethod(COSService, [COS]);\n"]}
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@midwayjs/cos",
3
3
  "description": "midway cos component",
4
- "version": "3.0.0-beta.9",
4
+ "version": "3.0.3",
5
5
  "main": "dist/index",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
8
8
  "dist/**/*.js",
9
9
  "dist/**/*.d.ts",
10
- "index.d.ts"
10
+ "index.d.ts",
11
+ "dist/**/*.js.map"
11
12
  ],
12
13
  "devDependencies": {
13
- "@midwayjs/core": "^3.0.0-beta.9",
14
- "@midwayjs/decorator": "^3.0.0-beta.9",
15
- "@midwayjs/mock": "^3.0.0-beta.9",
16
- "dotenv": "^10.0.0"
14
+ "@midwayjs/core": "^3.0.2",
15
+ "@midwayjs/decorator": "^3.0.2",
16
+ "@midwayjs/mock": "^3.0.2",
17
+ "dotenv": "14.3.2"
17
18
  },
18
19
  "dependencies": {
19
20
  "cos-nodejs-sdk-v5": "^2.10.0"
@@ -26,8 +27,8 @@
26
27
  "license": "MIT",
27
28
  "scripts": {
28
29
  "build": "tsc",
29
- "test": "node --require=ts-node/register ../../node_modules/.bin/jest",
30
- "cov": "node --require=ts-node/register ../../node_modules/.bin/jest --coverage --forceExit",
30
+ "test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand",
31
+ "cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit",
31
32
  "ci": "npm run test",
32
33
  "lint": "mwts check"
33
34
  },
@@ -38,5 +39,5 @@
38
39
  "type": "git",
39
40
  "url": "https://github.com/midwayjs/midway.git"
40
41
  },
41
- "gitHead": "d23e4a4fee58097b98461625c428a37d55535cec"
42
+ "gitHead": "43a5971b284aa918d22d191236c5664b011f8d87"
42
43
  }
package/CHANGELOG.md DELETED
@@ -1,81 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
7
-
8
- **Note:** Version bump only for package @midwayjs/cos
9
-
10
-
11
-
12
-
13
-
14
- # [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
15
-
16
-
17
- ### Bug Fixes
18
-
19
- * express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([b9272e0](https://github.com/midwayjs/midway/commit/b9272e0971003443304b0c53815be31a0061b4bd))
20
-
21
-
22
-
23
-
24
-
25
- # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
26
-
27
- **Note:** Version bump only for package @midwayjs/cos
28
-
29
-
30
-
31
-
32
-
33
- # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
34
-
35
- **Note:** Version bump only for package @midwayjs/cos
36
-
37
-
38
-
39
-
40
-
41
- # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
42
-
43
- **Note:** Version bump only for package @midwayjs/cos
44
-
45
-
46
-
47
-
48
-
49
- # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
50
-
51
- **Note:** Version bump only for package @midwayjs/cos
52
-
53
-
54
-
55
-
56
-
57
- # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
58
-
59
-
60
- ### Features
61
-
62
- * add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
63
-
64
-
65
-
66
-
67
-
68
- # [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
69
-
70
- **Note:** Version bump only for package @midwayjs/cos
71
-
72
-
73
-
74
-
75
-
76
- # [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
77
-
78
-
79
- ### Features
80
-
81
- * add cos component ([#1271](https://github.com/midwayjs/midway/issues/1271)) ([c18e597](https://github.com/midwayjs/midway/commit/c18e597d55a6452188cc7daecd0062bf161028cc))