@midwayjs/cos 3.19.2 → 4.0.0-alpha.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/dist/configuration.js +2 -2
- package/dist/manager.js +6 -7
- package/package.json +6 -6
package/dist/configuration.js
CHANGED
|
@@ -15,7 +15,8 @@ let COSConfiguration = class COSConfiguration {
|
|
|
15
15
|
await container.getAsync(manager_1.COSServiceFactory);
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
COSConfiguration =
|
|
18
|
+
exports.COSConfiguration = COSConfiguration;
|
|
19
|
+
exports.COSConfiguration = COSConfiguration = __decorate([
|
|
19
20
|
(0, core_1.Configuration)({
|
|
20
21
|
namespace: 'cos',
|
|
21
22
|
importConfigs: [
|
|
@@ -25,5 +26,4 @@ COSConfiguration = __decorate([
|
|
|
25
26
|
],
|
|
26
27
|
})
|
|
27
28
|
], COSConfiguration);
|
|
28
|
-
exports.COSConfiguration = COSConfiguration;
|
|
29
29
|
//# sourceMappingURL=configuration.js.map
|
package/dist/manager.js
CHANGED
|
@@ -18,7 +18,7 @@ let COSServiceFactory = class COSServiceFactory extends core_1.ServiceFactory {
|
|
|
18
18
|
await this.initClients(this.cosConfig);
|
|
19
19
|
}
|
|
20
20
|
async createClient(config) {
|
|
21
|
-
assert(config.SecretKey && config.SecretId, '[@midwayjs/cos] secretId secretKey is required on config');
|
|
21
|
+
assert.ok(config.SecretKey && config.SecretId, '[@midwayjs/cos] secretId secretKey is required on config');
|
|
22
22
|
this.logger.info('[midway:cos] init %s', config.SecretKey);
|
|
23
23
|
return new COS(config);
|
|
24
24
|
}
|
|
@@ -26,6 +26,7 @@ let COSServiceFactory = class COSServiceFactory extends core_1.ServiceFactory {
|
|
|
26
26
|
return 'cos';
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
+
exports.COSServiceFactory = COSServiceFactory;
|
|
29
30
|
__decorate([
|
|
30
31
|
(0, core_1.Config)('cos'),
|
|
31
32
|
__metadata("design:type", Object)
|
|
@@ -40,20 +41,19 @@ __decorate([
|
|
|
40
41
|
(0, core_1.Logger)('coreLogger'),
|
|
41
42
|
__metadata("design:type", Object)
|
|
42
43
|
], COSServiceFactory.prototype, "logger", void 0);
|
|
43
|
-
COSServiceFactory = __decorate([
|
|
44
|
+
exports.COSServiceFactory = COSServiceFactory = __decorate([
|
|
44
45
|
(0, core_1.Provide)(),
|
|
45
46
|
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
46
47
|
], COSServiceFactory);
|
|
47
|
-
exports.COSServiceFactory = COSServiceFactory;
|
|
48
48
|
let COSService = class COSService {
|
|
49
49
|
async init() {
|
|
50
|
-
|
|
51
|
-
this.instance = this.serviceFactory.get(((_b = (_a = this.serviceFactory).getDefaultClientName) === null || _b === void 0 ? void 0 : _b.call(_a)) || 'default');
|
|
50
|
+
this.instance = this.serviceFactory.get(this.serviceFactory.getDefaultClientName?.() || 'default');
|
|
52
51
|
if (!this.instance) {
|
|
53
52
|
throw new core_1.MidwayCommonError('cos default instance not found.');
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
};
|
|
56
|
+
exports.COSService = COSService;
|
|
57
57
|
__decorate([
|
|
58
58
|
(0, core_1.Inject)(),
|
|
59
59
|
__metadata("design:type", COSServiceFactory)
|
|
@@ -64,10 +64,9 @@ __decorate([
|
|
|
64
64
|
__metadata("design:paramtypes", []),
|
|
65
65
|
__metadata("design:returntype", Promise)
|
|
66
66
|
], COSService.prototype, "init", null);
|
|
67
|
-
COSService = __decorate([
|
|
67
|
+
exports.COSService = COSService = __decorate([
|
|
68
68
|
(0, core_1.Provide)(),
|
|
69
69
|
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
70
70
|
], COSService);
|
|
71
|
-
exports.COSService = COSService;
|
|
72
71
|
(0, core_1.delegateTargetPrototypeMethod)(COSService, [COS]);
|
|
73
72
|
//# sourceMappingURL=manager.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/cos",
|
|
3
3
|
"description": "midway cos component",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0-alpha.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"index.d.ts"
|
|
11
11
|
],
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@midwayjs/core": "^
|
|
14
|
-
"@midwayjs/mock": "^
|
|
13
|
+
"@midwayjs/core": "^4.0.0-alpha.1",
|
|
14
|
+
"@midwayjs/mock": "^4.0.0-alpha.1",
|
|
15
15
|
"dotenv": "16.4.7"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc",
|
|
28
|
-
"test": "node
|
|
29
|
-
"cov": "node
|
|
28
|
+
"test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand",
|
|
29
|
+
"cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit",
|
|
30
30
|
"ci": "npm run test",
|
|
31
31
|
"lint": "mwts check"
|
|
32
32
|
},
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"type": "git",
|
|
38
38
|
"url": "https://github.com/midwayjs/midway.git"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372"
|
|
41
41
|
}
|