@builder6/core 0.6.5 → 0.7.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/config/default.config.d.ts +4 -0
- package/dist/config/default.config.js +6 -0
- package/dist/config/default.config.js.map +1 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.js +77 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/moleculer.config.d.ts +63 -0
- package/dist/config/moleculer.config.js +67 -0
- package/dist/config/moleculer.config.js.map +1 -0
- package/dist/files/files.controller.d.ts +11 -0
- package/dist/files/files.controller.js +170 -0
- package/dist/files/files.controller.js.map +1 -0
- package/dist/files/files.controller.spec.d.ts +1 -0
- package/dist/files/files.controller.spec.js +17 -0
- package/dist/files/files.controller.spec.js.map +1 -0
- package/dist/files/files.module.d.ts +2 -0
- package/dist/files/files.module.js +27 -0
- package/dist/files/files.module.js.map +1 -0
- package/dist/files/files.moleculer.d.ts +10 -0
- package/dist/files/files.moleculer.js +50 -0
- package/dist/files/files.moleculer.js.map +1 -0
- package/dist/files/files.service.d.ts +31 -0
- package/dist/files/files.service.js +210 -0
- package/dist/files/files.service.js.map +1 -0
- package/dist/files/files.service.spec.d.ts +1 -0
- package/dist/files/files.service.spec.js +17 -0
- package/dist/files/files.service.spec.js.map +1 -0
- package/dist/files/index.d.ts +3 -0
- package/dist/files/index.js +20 -0
- package/dist/files/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.d.ts +3 -0
- package/dist/plugin/index.js +20 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/moleculer.service.d.ts +11 -0
- package/dist/plugin/moleculer.service.js +96 -0
- package/dist/plugin/moleculer.service.js.map +1 -0
- package/dist/plugin/plugin.module.d.ts +22 -0
- package/dist/plugin/plugin.module.js +220 -0
- package/dist/plugin/plugin.module.js.map +1 -0
- package/dist/plugin/plugin.service.d.ts +2 -0
- package/dist/plugin/plugin.service.js +17 -0
- package/dist/plugin/plugin.service.js.map +1 -0
- package/dist/plugin/plugin.service.spec.d.ts +1 -0
- package/dist/plugin/plugin.service.spec.js +17 -0
- package/dist/plugin/plugin.service.spec.js.map +1 -0
- package/package.json +6 -3
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var PluginModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.PluginModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const fs = require("fs");
|
|
13
|
+
const path = require("path");
|
|
14
|
+
const childProcess = require("child_process");
|
|
15
|
+
const plugin_service_1 = require("./plugin.service");
|
|
16
|
+
const moleculer_service_1 = require("./moleculer.service");
|
|
17
|
+
const moleculer_1 = require("@builder6/moleculer");
|
|
18
|
+
const States = {
|
|
19
|
+
STOPPED: 'stopped',
|
|
20
|
+
LOADING: 'loading',
|
|
21
|
+
INSTALLING: 'installing',
|
|
22
|
+
STARTING: 'starting',
|
|
23
|
+
RUNNING: 'running',
|
|
24
|
+
SAFE: 'safe',
|
|
25
|
+
CRASHED: 'crashed',
|
|
26
|
+
STOPPING: 'stopping',
|
|
27
|
+
};
|
|
28
|
+
let PluginModule = PluginModule_1 = class PluginModule {
|
|
29
|
+
constructor() {
|
|
30
|
+
this.logger = new common_1.Logger(plugin_service_1.PluginService.name);
|
|
31
|
+
}
|
|
32
|
+
static forRootAsync() {
|
|
33
|
+
return {
|
|
34
|
+
module: PluginModule_1,
|
|
35
|
+
imports: [],
|
|
36
|
+
providers: [
|
|
37
|
+
{
|
|
38
|
+
provide: 'PLUGINS',
|
|
39
|
+
useFactory: async () => {
|
|
40
|
+
const modules = process.env.B6_PLUGIN_MODULES;
|
|
41
|
+
await this.updateNpmrc();
|
|
42
|
+
await this.installPackages();
|
|
43
|
+
const plugins = [];
|
|
44
|
+
if (modules) {
|
|
45
|
+
for (const module of modules.split(',')) {
|
|
46
|
+
const pluginModule = await this.loadPlugin(module);
|
|
47
|
+
plugins.push({
|
|
48
|
+
name: module,
|
|
49
|
+
module: pluginModule,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
this.plugins = plugins;
|
|
54
|
+
return plugins.map((plugin) => plugin.module);
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
exports: ['PLUGINS'],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
static loadPlugin(packageName) {
|
|
62
|
+
const packageModulePath = path.resolve(this.getPackagePath(packageName), './dist/plugin.module.js');
|
|
63
|
+
if (!fs.existsSync(packageModulePath)) {
|
|
64
|
+
this.logger.error(`Nestjs 插件 ${packageName} 缺少文件: ${packageModulePath}`);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.logger.log(`加载 Nestjs 插件: ${packageName} ...`);
|
|
68
|
+
const PluginModule = require(packageModulePath);
|
|
69
|
+
return PluginModule.default;
|
|
70
|
+
}
|
|
71
|
+
static getPackagePath(packageName) {
|
|
72
|
+
try {
|
|
73
|
+
return path.dirname(require.resolve(`${packageName}/package.json`, {
|
|
74
|
+
paths: [
|
|
75
|
+
path.join(process.env.B6_PLUGIN_DIR, 'node_modules'),
|
|
76
|
+
...module.paths,
|
|
77
|
+
],
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
console.error(e);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
static getPluginDir() {
|
|
86
|
+
const pluginsPath = path.resolve(process.cwd(), 'plugins');
|
|
87
|
+
if (!fs.existsSync(pluginsPath)) {
|
|
88
|
+
fs.mkdirSync(pluginsPath, { recursive: true });
|
|
89
|
+
console.log(`Plugins folder created at: ${pluginsPath}`);
|
|
90
|
+
}
|
|
91
|
+
return pluginsPath;
|
|
92
|
+
}
|
|
93
|
+
static getInstallPackages() {
|
|
94
|
+
if (this.install_packages) {
|
|
95
|
+
const pluginList = this.install_packages.split(',');
|
|
96
|
+
const pluginMap = {};
|
|
97
|
+
pluginList.forEach((plugin) => {
|
|
98
|
+
const match = plugin.match(/^(@[^@]+\/[^@]+|[^@]+)(?:@(.+))?$/);
|
|
99
|
+
if (match) {
|
|
100
|
+
const name = match[1];
|
|
101
|
+
const version = match[2] || 'latest';
|
|
102
|
+
pluginMap[name] = version;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return pluginMap;
|
|
106
|
+
}
|
|
107
|
+
return {};
|
|
108
|
+
}
|
|
109
|
+
static async updateNpmrc() {
|
|
110
|
+
const npmrcPath = path.join(this.getPluginDir(), '.npmrc');
|
|
111
|
+
if (this.npmrc) {
|
|
112
|
+
try {
|
|
113
|
+
fs.writeFileSync(npmrcPath, this.npmrc);
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
this.state = States.STOPPED;
|
|
117
|
+
this.logger.log('Unable to write .npmrc file');
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
if (fs.existsSync(npmrcPath)) {
|
|
123
|
+
try {
|
|
124
|
+
fs.unlinkSync(npmrcPath);
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
this.state = States.STOPPED;
|
|
128
|
+
this.logger.log('Unable to remove old .npmrc file');
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
static async installPackages() {
|
|
135
|
+
const pkgFilePath = path.join(this.getPluginDir(), 'package.json');
|
|
136
|
+
if (!fs.existsSync(pkgFilePath)) {
|
|
137
|
+
fs.writeFileSync(pkgFilePath, JSON.stringify({ name: 'b6-plugins', version: '0.0.0', dependencies: {} }, null, 2));
|
|
138
|
+
}
|
|
139
|
+
const packageContent = fs.readFileSync(pkgFilePath, { encoding: 'utf8' });
|
|
140
|
+
const pkg = JSON.parse(packageContent);
|
|
141
|
+
const existingDependencies = pkg.dependencies || {};
|
|
142
|
+
const wantedDependencies = this.getInstallPackages();
|
|
143
|
+
const existingModules = Object.keys(existingDependencies);
|
|
144
|
+
const wantedModules = Object.keys(wantedDependencies);
|
|
145
|
+
this.logger.log(`Plugin dependencies: ${existingModules}`);
|
|
146
|
+
let changed = false;
|
|
147
|
+
if (existingModules.length !== wantedModules.length) {
|
|
148
|
+
changed = true;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
existingModules.sort();
|
|
152
|
+
wantedModules.sort();
|
|
153
|
+
for (let i = 0; i < existingModules.length; i++) {
|
|
154
|
+
if (existingModules[i] !== wantedModules[i]) {
|
|
155
|
+
changed = true;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
if (existingDependencies[existingModules[i]] !==
|
|
159
|
+
wantedDependencies[wantedModules[i]]) {
|
|
160
|
+
changed = true;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (changed) {
|
|
166
|
+
this.state = States.INSTALLING;
|
|
167
|
+
this.logger.warn(`Install plugin dependencies: ${this.install_packages}`);
|
|
168
|
+
pkg.dependencies = wantedDependencies;
|
|
169
|
+
fs.writeFileSync(pkgFilePath, JSON.stringify(pkg, null, 2));
|
|
170
|
+
const npmEnv = Object.assign({}, process.env);
|
|
171
|
+
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
172
|
+
return new Promise((resolve, reject) => {
|
|
173
|
+
const child = childProcess.spawn(npmCommand, [
|
|
174
|
+
'install',
|
|
175
|
+
'--omit=dev',
|
|
176
|
+
'--no-audit',
|
|
177
|
+
'--no-update-notifier',
|
|
178
|
+
'--no-fund',
|
|
179
|
+
], {
|
|
180
|
+
windowsHide: true,
|
|
181
|
+
cwd: path.join(process.env.B6_PLUGIN_DIR),
|
|
182
|
+
env: npmEnv,
|
|
183
|
+
shell: true,
|
|
184
|
+
});
|
|
185
|
+
child.stdout.on('data', (data) => {
|
|
186
|
+
this.logger.log('[npm] ' + data);
|
|
187
|
+
});
|
|
188
|
+
child.stderr.on('data', (data) => {
|
|
189
|
+
this.logger.log('[npm] ' + data);
|
|
190
|
+
});
|
|
191
|
+
child.on('error', (err) => {
|
|
192
|
+
this.logger.log('[npm] ' + err.toString());
|
|
193
|
+
});
|
|
194
|
+
child.on('close', (code) => {
|
|
195
|
+
if (code === 0) {
|
|
196
|
+
resolve();
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
reject(new Error(`Failed to install project dependencies ret code: ${code} signal ${child.signalCode}`));
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}).catch((err) => {
|
|
203
|
+
fs.writeFileSync(pkgFilePath, packageContent);
|
|
204
|
+
throw err;
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
exports.PluginModule = PluginModule;
|
|
210
|
+
PluginModule.logger = new common_1.Logger(PluginModule_1.name);
|
|
211
|
+
PluginModule.plugins = [];
|
|
212
|
+
PluginModule.npmrc = process.env.B6_PLUGIN_NPMRC;
|
|
213
|
+
PluginModule.install_packages = process.env.B6_PLUGIN_INSTALL_PACKAGES;
|
|
214
|
+
exports.PluginModule = PluginModule = PluginModule_1 = __decorate([
|
|
215
|
+
(0, common_1.Module)({
|
|
216
|
+
imports: [moleculer_1.MoleculerModule.forRoot({})],
|
|
217
|
+
providers: [plugin_service_1.PluginService, moleculer_service_1.MoleculerPluginService],
|
|
218
|
+
})
|
|
219
|
+
], PluginModule);
|
|
220
|
+
//# sourceMappingURL=plugin.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.module.js","sourceRoot":"","sources":["../../src/plugin/plugin.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,yBAAyB;AACzB,6BAA6B;AAC7B,8CAA8C;AAC9C,qDAAiD;AACjD,2DAA6D;AAC7D,mDAAsD;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAMK,IAAM,YAAY,oBAAlB,MAAM,YAAY;IAAlB;QAIY,WAAM,GAAG,IAAI,eAAM,CAAC,8BAAa,CAAC,IAAI,CAAC,CAAC;IAuP3D,CAAC;IAhPC,MAAM,CAAC,YAAY;QACjB,OAAO;YACL,MAAM,EAAE,cAAY;YACpB,OAAO,EAAE,EAAE;YACX,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,SAAS;oBAClB,UAAU,EAAE,KAAK,IAAI,EAAE;wBACrB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;wBAC9C,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;wBACzB,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;wBAC7B,MAAM,OAAO,GAAG,EAAE,CAAC;wBACnB,IAAI,OAAO,EAAE,CAAC;4BACZ,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;gCACxC,MAAM,YAAY,GAAG,M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C,QAAQ,EAAE,CAAC,CAAC;gBAC7C,CAAC,CAAC,CAAC;gBACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;oBACzB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;wBACf,OAAO,EAAE,CAAC;oBACZ,CAAC;yBAAM,CAAC;wBACN,MAAM,CACJ,IAAI,KAAK,CACP,oDAAoD,IAAI,WAAW,KAAK,CAAC,UAAU,EAAE,CACtF,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBAGf,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;gBAC9C,MAAM,GAAG,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;;AA1PU,oCAAY;AACP,mBAAM,GAAG,IAAI,eAAM,CAAC,cAAY,CAAC,IAAI,CAAC,AAAhC,CAAiC;AACzC,oBAAO,GAAa,EAAE,AAAf,CAAgB;AAGtB,kBAAK,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,AAA9B,CAA+B;AACpC,6BAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,AAAzC,CAA0C;uBAN9D,YAAY;IAJxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,2BAAe,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACtC,SAAS,EAAE,CAAC,8BAAa,EAAE,0CAAsB,CAAC;KACnD,CAAC;GACW,YAAY,CA2PxB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PluginService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let PluginService = class PluginService {
|
|
12
|
+
};
|
|
13
|
+
exports.PluginService = PluginService;
|
|
14
|
+
exports.PluginService = PluginService = __decorate([
|
|
15
|
+
(0, common_1.Injectable)()
|
|
16
|
+
], PluginService);
|
|
17
|
+
//# sourceMappingURL=plugin.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.service.js","sourceRoot":"","sources":["../../src/plugin/plugin.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AAG7C,IAAM,aAAa,GAAnB,MAAM,aAAa;CACzB,CAAA;AADY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const testing_1 = require("@nestjs/testing");
|
|
4
|
+
const plugin_service_1 = require("./plugin.service");
|
|
5
|
+
describe('PluginService', () => {
|
|
6
|
+
let service;
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
const module = await testing_1.Test.createTestingModule({
|
|
9
|
+
providers: [plugin_service_1.PluginService],
|
|
10
|
+
}).compile();
|
|
11
|
+
service = module.get(plugin_service_1.PluginService);
|
|
12
|
+
});
|
|
13
|
+
it('should be defined', () => {
|
|
14
|
+
expect(service).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=plugin.service.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.service.spec.js","sourceRoot":"","sources":["../../src/plugin/plugin.service.spec.ts"],"names":[],"mappings":";;AAAA,6CAAsD;AACtD,qDAAiD;AAEjD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,OAAsB,CAAC;IAE3B,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YAC3D,SAAS,EAAE,CAAC,8BAAa,CAAC;SAC3B,CAAC,CAAC,OAAO,EAAE,CAAC;QAEb,OAAO,GAAG,MAAM,CAAC,GAAG,CAAgB,8BAAa,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder6/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@builder6/query-mongodb": "^0.7.0"
|
|
11
|
+
},
|
|
9
12
|
"scripts": {
|
|
10
|
-
"build": "rm -rf dist && tsc
|
|
13
|
+
"build": "rm -rf dist && tsc",
|
|
11
14
|
"build:watch": "rm -rf dist && tsc --watch"
|
|
12
15
|
},
|
|
13
16
|
"publishConfig": {
|
|
14
17
|
"access": "public"
|
|
15
18
|
},
|
|
16
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "b0e1429ea0940fa47cadb4abc340bb7498b15784"
|
|
17
20
|
}
|