@midwayjs/oss 3.5.3 → 3.7.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/dist/configuration.js +2 -2
- package/dist/manager.d.ts +1 -1
- package/dist/manager.js +13 -14
- package/package.json +6 -7
package/dist/configuration.js
CHANGED
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.OSSConfiguration = void 0;
|
|
10
|
-
const
|
|
10
|
+
const core_1 = require("@midwayjs/core");
|
|
11
11
|
const manager_1 = require("./manager");
|
|
12
12
|
let OSSConfiguration = class OSSConfiguration {
|
|
13
13
|
async onReady(container) {
|
|
@@ -15,7 +15,7 @@ let OSSConfiguration = class OSSConfiguration {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
OSSConfiguration = __decorate([
|
|
18
|
-
(0,
|
|
18
|
+
(0, core_1.Configuration)({
|
|
19
19
|
namespace: 'oss',
|
|
20
20
|
importConfigs: [
|
|
21
21
|
{
|
package/dist/manager.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as OSS from 'ali-oss';
|
|
2
1
|
import { ServiceFactory } from '@midwayjs/core';
|
|
2
|
+
import * as OSS from 'ali-oss';
|
|
3
3
|
import type { OSSServiceFactoryReturnType, OSSServiceFactoryCreateClientConfigType } from './interface';
|
|
4
4
|
export declare class OSSServiceFactory<T extends OSSServiceFactoryReturnType = OSSServiceFactoryReturnType> extends ServiceFactory<T> {
|
|
5
5
|
ossConfig: OSSServiceFactoryCreateClientConfigType;
|
package/dist/manager.js
CHANGED
|
@@ -10,10 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.OSSSTSService = exports.OSSService = exports.OSSServiceFactory = void 0;
|
|
13
|
-
const
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
14
|
const OSS = require("ali-oss");
|
|
15
15
|
const assert = require("assert");
|
|
16
|
-
const core_1 = require("@midwayjs/core");
|
|
17
16
|
function checkBucketConfig(config) {
|
|
18
17
|
assert(config.endpoint || config.region, "[midway:oss] Must set `endpoint` or `region` in oss's config");
|
|
19
18
|
assert(config.accessKeySecret && config.accessKeyId, "[midway:oss] Must set `accessKeyId` and `accessKeySecret` in oss's config");
|
|
@@ -44,18 +43,18 @@ let OSSServiceFactory = class OSSServiceFactory extends core_1.ServiceFactory {
|
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
45
|
__decorate([
|
|
47
|
-
(0,
|
|
46
|
+
(0, core_1.Config)('oss'),
|
|
48
47
|
__metadata("design:type", Object)
|
|
49
48
|
], OSSServiceFactory.prototype, "ossConfig", void 0);
|
|
50
49
|
__decorate([
|
|
51
|
-
(0,
|
|
50
|
+
(0, core_1.Init)(),
|
|
52
51
|
__metadata("design:type", Function),
|
|
53
52
|
__metadata("design:paramtypes", []),
|
|
54
53
|
__metadata("design:returntype", Promise)
|
|
55
54
|
], OSSServiceFactory.prototype, "init", null);
|
|
56
55
|
OSSServiceFactory = __decorate([
|
|
57
|
-
(0,
|
|
58
|
-
(0,
|
|
56
|
+
(0, core_1.Provide)(),
|
|
57
|
+
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
59
58
|
], OSSServiceFactory);
|
|
60
59
|
exports.OSSServiceFactory = OSSServiceFactory;
|
|
61
60
|
let OSSService = class OSSService {
|
|
@@ -67,18 +66,18 @@ let OSSService = class OSSService {
|
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
68
|
__decorate([
|
|
70
|
-
(0,
|
|
69
|
+
(0, core_1.Inject)(),
|
|
71
70
|
__metadata("design:type", OSSServiceFactory)
|
|
72
71
|
], OSSService.prototype, "serviceFactory", void 0);
|
|
73
72
|
__decorate([
|
|
74
|
-
(0,
|
|
73
|
+
(0, core_1.Init)(),
|
|
75
74
|
__metadata("design:type", Function),
|
|
76
75
|
__metadata("design:paramtypes", []),
|
|
77
76
|
__metadata("design:returntype", Promise)
|
|
78
77
|
], OSSService.prototype, "init", null);
|
|
79
78
|
OSSService = __decorate([
|
|
80
|
-
(0,
|
|
81
|
-
(0,
|
|
79
|
+
(0, core_1.Provide)(),
|
|
80
|
+
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
82
81
|
], OSSService);
|
|
83
82
|
exports.OSSService = OSSService;
|
|
84
83
|
(0, core_1.delegateTargetPrototypeMethod)(OSSService, [OSS]);
|
|
@@ -94,18 +93,18 @@ let OSSSTSService = class OSSSTSService {
|
|
|
94
93
|
}
|
|
95
94
|
};
|
|
96
95
|
__decorate([
|
|
97
|
-
(0,
|
|
96
|
+
(0, core_1.Inject)(),
|
|
98
97
|
__metadata("design:type", OSSServiceFactory)
|
|
99
98
|
], OSSSTSService.prototype, "serviceFactory", void 0);
|
|
100
99
|
__decorate([
|
|
101
|
-
(0,
|
|
100
|
+
(0, core_1.Init)(),
|
|
102
101
|
__metadata("design:type", Function),
|
|
103
102
|
__metadata("design:paramtypes", []),
|
|
104
103
|
__metadata("design:returntype", Promise)
|
|
105
104
|
], OSSSTSService.prototype, "init", null);
|
|
106
105
|
OSSSTSService = __decorate([
|
|
107
|
-
(0,
|
|
108
|
-
(0,
|
|
106
|
+
(0, core_1.Provide)(),
|
|
107
|
+
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
109
108
|
], OSSSTSService);
|
|
110
109
|
exports.OSSSTSService = OSSSTSService;
|
|
111
110
|
//# sourceMappingURL=manager.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/oss",
|
|
3
3
|
"description": "midway oss component",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.7.0",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
"index.d.ts"
|
|
11
11
|
],
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@midwayjs/core": "^3.
|
|
14
|
-
"@midwayjs/
|
|
15
|
-
"@
|
|
16
|
-
"
|
|
17
|
-
"dotenv": "16.0.2"
|
|
13
|
+
"@midwayjs/core": "^3.7.0",
|
|
14
|
+
"@midwayjs/mock": "^3.7.0",
|
|
15
|
+
"@types/ali-oss": "6.16.6",
|
|
16
|
+
"dotenv": "16.0.3"
|
|
18
17
|
},
|
|
19
18
|
"dependencies": {
|
|
20
19
|
"ali-oss": "^6.16.0"
|
|
@@ -39,5 +38,5 @@
|
|
|
39
38
|
"type": "git",
|
|
40
39
|
"url": "https://github.com/midwayjs/midway.git"
|
|
41
40
|
},
|
|
42
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "99386083ee26b386fd508b9c892091c914e77535"
|
|
43
42
|
}
|