@midwayjs/cos 4.0.0-beta.7 → 4.0.0-beta.8
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/manager.js +4 -0
- package/package.json +4 -4
package/dist/manager.js
CHANGED
|
@@ -14,11 +14,13 @@ const core_1 = require("@midwayjs/core");
|
|
|
14
14
|
const assert = require("assert");
|
|
15
15
|
const COS = require("cos-nodejs-sdk-v5");
|
|
16
16
|
let COSServiceFactory = class COSServiceFactory extends core_1.ServiceFactory {
|
|
17
|
+
cosConfig;
|
|
17
18
|
async init() {
|
|
18
19
|
await this.initClients(this.cosConfig, {
|
|
19
20
|
concurrent: true,
|
|
20
21
|
});
|
|
21
22
|
}
|
|
23
|
+
logger;
|
|
22
24
|
async createClient(config) {
|
|
23
25
|
assert.ok(config.SecretKey && config.SecretId, '[@midwayjs/cos] secretId secretKey is required on config');
|
|
24
26
|
this.logger.info('[midway:cos] init %s', config.SecretKey);
|
|
@@ -48,6 +50,8 @@ exports.COSServiceFactory = COSServiceFactory = __decorate([
|
|
|
48
50
|
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
49
51
|
], COSServiceFactory);
|
|
50
52
|
let COSService = class COSService {
|
|
53
|
+
serviceFactory;
|
|
54
|
+
instance;
|
|
51
55
|
async init() {
|
|
52
56
|
this.instance = this.serviceFactory.get(this.serviceFactory.getDefaultClientName?.() || 'default');
|
|
53
57
|
if (!this.instance) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/cos",
|
|
3
3
|
"description": "midway cos component",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.8",
|
|
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": "^4.0.0-beta.
|
|
14
|
-
"@midwayjs/mock": "^4.0.0-beta.
|
|
13
|
+
"@midwayjs/core": "^4.0.0-beta.8",
|
|
14
|
+
"@midwayjs/mock": "^4.0.0-beta.8",
|
|
15
15
|
"dotenv": "16.4.7"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"type": "git",
|
|
38
38
|
"url": "https://github.com/midwayjs/midway.git"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "355e55949fdd132b0bdcb4830222a0a027e92ded"
|
|
41
41
|
}
|