@sava-info-systems/api-maker-with-extensions 1.18.1 → 1.18.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.
- package/main.js +1 -1
- package/package.json +4 -4
- package/sandbox/sandbox.js +1 -1
- package/src/tools/local-client.js +1 -1215
|
@@ -1,1215 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EGitSyncType = exports.EAMModelNames = exports.EMongooseHookMethods = exports.EAPICategory = void 0;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path = require("path");
|
|
6
|
-
const child_process_1 = require("child_process");
|
|
7
|
-
const https = require("node:https");
|
|
8
|
-
const http = require("node:http");
|
|
9
|
-
// $$$$_change
|
|
10
|
-
class LocalClient {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.EL = false; // enable logs // $$$$_change
|
|
13
|
-
this.projectDirectory = '';
|
|
14
|
-
this.C = {
|
|
15
|
-
localClientPath: './local-client.config',
|
|
16
|
-
src: 'src',
|
|
17
|
-
repo: 'repo',
|
|
18
|
-
types: 'types',
|
|
19
|
-
amTypes: 'am-types',
|
|
20
|
-
versions: 'versions',
|
|
21
|
-
apis: 'apis',
|
|
22
|
-
listeners: 'listeners',
|
|
23
|
-
postHooks: 'post-hooks',
|
|
24
|
-
preHooks: 'pre-hooks',
|
|
25
|
-
dbInterfacesFile: 'db-interfaces.d.ts',
|
|
26
|
-
// Read
|
|
27
|
-
UtilityClassesReadF: 'Utility classes',
|
|
28
|
-
CustomApiReadF: 'Custom APIs',
|
|
29
|
-
SchedulersReadF: 'Schedulers',
|
|
30
|
-
WebSocketEventsReadF: 'WebSocket events',
|
|
31
|
-
SchemaReadF: 'Schemas',
|
|
32
|
-
DBMigrationsReadF: 'Database migrations',
|
|
33
|
-
ProcessInitializersReadF: 'Process initializers',
|
|
34
|
-
ProcessI18NReadF: 'i18ns',
|
|
35
|
-
DBMastersReadF: 'DB masters',
|
|
36
|
-
DBMasterStylesReadF: 'UI maker styles',
|
|
37
|
-
DBMasterUtilsReadF: 'DB master utils',
|
|
38
|
-
TestCasesReadF: 'Test cases',
|
|
39
|
-
ThirdPartyApiReadF: 'Third party APIs',
|
|
40
|
-
EventsReadF: 'Events',
|
|
41
|
-
InstanceApiHooksReadF: 'Instance API hooks',
|
|
42
|
-
SystemApiHooksReadF: 'System API hooks',
|
|
43
|
-
CollectionHooksReadF: 'Collection hooks',
|
|
44
|
-
DatabaseHooksReadF: 'Database hooks',
|
|
45
|
-
InstanceHooksReadF: 'Instance hooks',
|
|
46
|
-
// Write
|
|
47
|
-
CustomApisWriteF: 'custom-apis',
|
|
48
|
-
SchedulersWriteF: 'schedulers',
|
|
49
|
-
WebSocketEventsWriteF: 'web-socket-events',
|
|
50
|
-
SchemaWriteF: 'schemas',
|
|
51
|
-
DBMigrationsWriteF: 'db-migrations',
|
|
52
|
-
ProcessInitializersWriteF: 'process-initializers',
|
|
53
|
-
ProcessI18NWriteF: 'i18ns',
|
|
54
|
-
DBMastersWriteF: 'ui-maker-pages',
|
|
55
|
-
DBMasterStylesWriteF: 'ui-maker-styles',
|
|
56
|
-
DBMasterUtilsWriteF: 'ui-maker-utils',
|
|
57
|
-
TestCasesWriteF: 'tests',
|
|
58
|
-
ThirdPartyApiWriteF: 'third-party-apis',
|
|
59
|
-
EventsWriteF: 'events',
|
|
60
|
-
InstanceApiHooksWriteF: 'instance-api-hooks',
|
|
61
|
-
SystemApiHooksWriteF: 'system-api-hooks',
|
|
62
|
-
CollectionHooksWriteF: 'collection-hooks',
|
|
63
|
-
DatabaseHooksWriteF: 'database-hooks',
|
|
64
|
-
InstanceHooksWriteF: 'instance-hooks',
|
|
65
|
-
};
|
|
66
|
-
this.globalObj = {};
|
|
67
|
-
this.skipWatchInputs = false;
|
|
68
|
-
this.skipFileWritingForLocal = {};
|
|
69
|
-
this.nodeModulesCopied = false;
|
|
70
|
-
this.spinner = null;
|
|
71
|
-
this.sendDeletedEventToServerDebounce = this.debounce(this.sendDeletedEventToServerInternal, 500);
|
|
72
|
-
}
|
|
73
|
-
async start() {
|
|
74
|
-
if (!fs.existsSync(this.C.localClientPath + '.js')) {
|
|
75
|
-
this.printNotesToProvideLocalClient();
|
|
76
|
-
process.exit(1);
|
|
77
|
-
}
|
|
78
|
-
this.spinner = this.createSpinner();
|
|
79
|
-
this.config = require(this.C.localClientPath)();
|
|
80
|
-
await this.printNotes();
|
|
81
|
-
this.removeEmptyDirsSync(path.join(__dirname, this.C.src));
|
|
82
|
-
await this.createLCProjectDirectory();
|
|
83
|
-
setTimeout(this.startWatch.bind(this), 100);
|
|
84
|
-
await this.connectToServerViaWS();
|
|
85
|
-
console.log(`Open in IDE : ${this.projectDirectory}`);
|
|
86
|
-
}
|
|
87
|
-
async printNotes() {
|
|
88
|
-
console.log('\x1b[38;2;255;165;0m');
|
|
89
|
-
console.log('—————————————————————————————— Note ——————————————————————————————');
|
|
90
|
-
console.log(' Local client will push your local changes to API Maker server.');
|
|
91
|
-
console.log(' If you have any changes on server, they will be overridden.');
|
|
92
|
-
console.log('——————————————————————————————————————————————————————————————————');
|
|
93
|
-
console.log('\x1b[0m');
|
|
94
|
-
console.log('');
|
|
95
|
-
}
|
|
96
|
-
printNotesToProvideLocalClient() {
|
|
97
|
-
console.log('\x1b[38;2;255;165;0m');
|
|
98
|
-
console.log(` Please provide settings in : ${this.C.localClientPath}.js`);
|
|
99
|
-
console.log('\x1b[0m');
|
|
100
|
-
console.log('');
|
|
101
|
-
}
|
|
102
|
-
createSpinner() {
|
|
103
|
-
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
104
|
-
let i = 0;
|
|
105
|
-
let timer = null;
|
|
106
|
-
const classThis = this;
|
|
107
|
-
return {
|
|
108
|
-
start(label = 'Syncing..') {
|
|
109
|
-
if (timer)
|
|
110
|
-
return;
|
|
111
|
-
timer = setInterval(() => {
|
|
112
|
-
process.stdout.write(`\r${frames[i++ % frames.length]} ${label}`);
|
|
113
|
-
}, 100);
|
|
114
|
-
},
|
|
115
|
-
stop(finalMessage = 'Sync') {
|
|
116
|
-
if (timer) {
|
|
117
|
-
clearInterval(timer);
|
|
118
|
-
timer = null;
|
|
119
|
-
if (finalMessage)
|
|
120
|
-
process.stdout.write(`\r[${classThis.getCurrentTime()}] : ${finalMessage}\n`);
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
async createLCProjectDirectory() {
|
|
126
|
-
const mainFolder = path.basename(__dirname);
|
|
127
|
-
const createFolder = path.join(__dirname, '..', `${mainFolder}-lc`);
|
|
128
|
-
this.projectDirectory = createFolder;
|
|
129
|
-
fs.rmSync(createFolder, {
|
|
130
|
-
recursive: true,
|
|
131
|
-
force: true,
|
|
132
|
-
});
|
|
133
|
-
await fs.promises.mkdir(createFolder, { recursive: true });
|
|
134
|
-
}
|
|
135
|
-
async copyFilesToProjectDir(performNpmInstall) {
|
|
136
|
-
await this.createLCProjectDirectory();
|
|
137
|
-
// Create src folder
|
|
138
|
-
fs.mkdirSync(path.join(this.projectDirectory, this.C.src), { recursive: true });
|
|
139
|
-
// Copy package.json file
|
|
140
|
-
fs.cpSync(path.join(__dirname, 'package.json'), path.join(this.projectDirectory, 'package.json'));
|
|
141
|
-
// Copy .gitignore file
|
|
142
|
-
fs.cpSync(path.join(__dirname, '.gitignore'), path.join(this.projectDirectory, '.gitignore'));
|
|
143
|
-
// Copy tsconfig.json file
|
|
144
|
-
const tsConfigReadPath = path.join(__dirname, 'tsconfig.json');
|
|
145
|
-
const tsConfigObj = JSON.parse(await fs.promises.readFile(tsConfigReadPath, { encoding: 'utf8' }));
|
|
146
|
-
tsConfigObj.compilerOptions.baseUrl = './src';
|
|
147
|
-
tsConfigObj.compilerOptions.paths['*'].push('*');
|
|
148
|
-
await fs.promises.writeFile(path.join(this.projectDirectory, 'tsconfig.json'), JSON.stringify(tsConfigObj, null, 4), { encoding: 'utf8' });
|
|
149
|
-
// Copy am-types
|
|
150
|
-
await fs.promises.cp(path.join(__dirname, this.C.amTypes), path.join(this.projectDirectory, this.C.src, this.C.amTypes), { recursive: true });
|
|
151
|
-
// Copy db-interfaces
|
|
152
|
-
await fs.promises.cp(path.join(__dirname, this.C.src, this.config.adminUserPath, this.C.types, this.C.dbInterfacesFile), path.join(this.projectDirectory, this.C.src, this.C.amTypes, this.C.dbInterfacesFile), { recursive: true });
|
|
153
|
-
await this.copyUtilityClassesToAnotherDir();
|
|
154
|
-
await this.copyCustomApisToAnotherDir();
|
|
155
|
-
await this.copySchedulersToAnotherDir();
|
|
156
|
-
await this.copySchemasToAnotherDir();
|
|
157
|
-
await this.copyDBMigrationsToAnotherDir();
|
|
158
|
-
await this.copyProcessInitializersToAnotherDir();
|
|
159
|
-
await this.copyI18NToAnotherDir();
|
|
160
|
-
await this.copyTestCasesToAnotherDir();
|
|
161
|
-
await this.copyThirdPartyApisToAnotherDir();
|
|
162
|
-
await this.copyEventsToAnotherDir();
|
|
163
|
-
await this.copyInstanceApiHooksToAnotherDir();
|
|
164
|
-
await this.copySystemApiHooksToAnotherDir();
|
|
165
|
-
await this.copyWebSocketEventsToAnotherDir();
|
|
166
|
-
await this.copyCollectionHooksToAnotherDir();
|
|
167
|
-
await this.copyDatabaseHooksToAnotherDir();
|
|
168
|
-
await this.copyInstanceHooksToAnotherDir();
|
|
169
|
-
await this.copyDBMastersToAnotherDir();
|
|
170
|
-
await this.copyDBMasterStylesToAnotherDir();
|
|
171
|
-
await this.copyDBMasterUtilsToAnotherDir();
|
|
172
|
-
if (performNpmInstall)
|
|
173
|
-
await this.executeNpmRun('npm', ['install', '--force']);
|
|
174
|
-
fs.symlinkSync(path.join(__dirname, 'node_modules'), path.join(this.projectDirectory, 'node_modules'), 'dir'); // link "node_modules" directory
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* src/admin/Utility classes/utils - aws-s3-bucket - 1.0.0 - -- S3BucketUtility/utils - aws-s3-bucket - 1.0.0 - -- S3BucketUtility.yaml
|
|
178
|
-
* src/admin/Utility classes/utils - -- GeneralUtils/utils - -- GeneralUtils.yaml
|
|
179
|
-
* src/admin/Utility classes/utils - -- GeneralUtils/versions/-1/Original.ts
|
|
180
|
-
* src/admin/Utility classes/utils - -- GeneralUtils/versions/1.0.0/Second Utils.ts
|
|
181
|
-
*/
|
|
182
|
-
async copyUtilityClassesToAnotherDir() {
|
|
183
|
-
const readFolderName = this.C.UtilityClassesReadF;
|
|
184
|
-
const utilsBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
185
|
-
const utils = await this.readDirCustom(utilsBasePath, null);
|
|
186
|
-
for (const utilName of utils) {
|
|
187
|
-
const utilConfigPath = path.join(utilsBasePath, utilName, `${utilName}.yaml`);
|
|
188
|
-
if (!fs.existsSync(utilConfigPath))
|
|
189
|
-
continue;
|
|
190
|
-
const utilConfigContent = await fs.promises.readFile(utilConfigPath, { encoding: 'utf8' });
|
|
191
|
-
const utilsConfig = await this.parseYaml(utilConfigContent);
|
|
192
|
-
for (const version of utilsConfig.versions || []) {
|
|
193
|
-
if (version.isActive === true) {
|
|
194
|
-
const codeFilePath = path.join(utilsBasePath, utilName, this.C.versions, version.version, `${version.name}.ts`);
|
|
195
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, utilsConfig.folderPath, `${utilsConfig.name}.ts`);
|
|
196
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
197
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* src/admin/Custom APIs/Hello World/Hello World.yaml
|
|
204
|
-
* src/admin/Custom APIs/Hello World/Hello World.config.ts
|
|
205
|
-
* src/admin/Custom APIs/Hello World/versions/-1/Original.ts
|
|
206
|
-
* src/admin/Custom APIs/Hello World/versions/1.0.0/Second Version.ts
|
|
207
|
-
* src/admin/Custom APIs/Hello World/versions/1.0.0/pre-hooks/Hello world pre hook 1.ts
|
|
208
|
-
* src/admin/Custom APIs/Hello World/versions/1.0.0/post-hooks/Hello world post hook 1.ts
|
|
209
|
-
*/
|
|
210
|
-
async copyCustomApisToAnotherDir() {
|
|
211
|
-
const readFolderName = this.C.CustomApiReadF;
|
|
212
|
-
const writeFolderName = this.C.CustomApisWriteF;
|
|
213
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
214
|
-
const itemFolderNames = await this.readDirCustom(itemBasePath, null);
|
|
215
|
-
for (const itemFolderName of itemFolderNames) {
|
|
216
|
-
const itemConfigPath = path.join(itemBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
217
|
-
if (!fs.existsSync(itemConfigPath))
|
|
218
|
-
continue;
|
|
219
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
220
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
221
|
-
for (const version of itemConfig.versions || []) {
|
|
222
|
-
if (version.isActive === true) {
|
|
223
|
-
// Write code file
|
|
224
|
-
const versionBasePath = path.join(itemBasePath, itemFolderName, this.C.versions, version.version);
|
|
225
|
-
const codeFilePath = path.join(versionBasePath, `${version.name}.ts`);
|
|
226
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, itemConfig.path, `${itemConfig.name}.ts`);
|
|
227
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
228
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
229
|
-
// Write config file
|
|
230
|
-
const configFilePath = path.join(itemBasePath, itemFolderName, `${itemFolderName}.config.ts`);
|
|
231
|
-
const targetConfigFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, itemConfig.path, `${itemConfig.name}.config.ts`);
|
|
232
|
-
await fs.promises.link(configFilePath, targetConfigFilePath);
|
|
233
|
-
// Write pre hooks
|
|
234
|
-
for (const hookObj of version.preHooks) {
|
|
235
|
-
// Write code file
|
|
236
|
-
const codeFilePathHook = path.join(versionBasePath, this.C.preHooks, `${hookObj.name}.ts`);
|
|
237
|
-
const targetFilePathHook = path.join(this.projectDirectory, this.C.src, writeFolderName, itemConfig.path, this.C.preHooks, `${hookObj.name}.ts`);
|
|
238
|
-
await fs.promises.mkdir(path.dirname(targetFilePathHook), { recursive: true });
|
|
239
|
-
await fs.promises.link(codeFilePathHook, targetFilePathHook);
|
|
240
|
-
}
|
|
241
|
-
// Write post hooks
|
|
242
|
-
for (const hookObj of version.postHooks) {
|
|
243
|
-
// Write code file
|
|
244
|
-
const codeFilePathHook = path.join(versionBasePath, this.C.postHooks, `${hookObj.name}.ts`);
|
|
245
|
-
const targetFilePathHook = path.join(this.projectDirectory, this.C.src, writeFolderName, itemConfig.path, this.C.postHooks, `${hookObj.name}.ts`);
|
|
246
|
-
await fs.promises.mkdir(path.dirname(targetFilePathHook), { recursive: true });
|
|
247
|
-
await fs.promises.link(codeFilePathHook, targetFilePathHook);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* src/admin/Schedulers/Scheduler 1/Scheduler 1.yaml
|
|
255
|
-
* src/admin/Schedulers/Scheduler 1/versions/-1/Original.ts
|
|
256
|
-
*/
|
|
257
|
-
async copySchedulersToAnotherDir() {
|
|
258
|
-
const readFolderName = this.C.SchedulersReadF;
|
|
259
|
-
const writeFolderName = this.C.SchedulersWriteF;
|
|
260
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
261
|
-
const itemFolderNames = await this.readDirCustom(itemBasePath, null);
|
|
262
|
-
for (const itemFolderName of itemFolderNames) {
|
|
263
|
-
const itemConfigPath = path.join(itemBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
264
|
-
if (!fs.existsSync(itemConfigPath))
|
|
265
|
-
continue;
|
|
266
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
267
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
268
|
-
for (const version of itemConfig.versions || []) {
|
|
269
|
-
if (version.isActive === true) {
|
|
270
|
-
// Write code file
|
|
271
|
-
const codeFilePath = path.join(itemBasePath, itemFolderName, this.C.versions, version.version, `${version.name}.ts`);
|
|
272
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, `${itemConfig.name}.ts`);
|
|
273
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
274
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* src/admin/Schemas/mongodb -- test -- default/default.config.ts
|
|
281
|
-
* src/admin/Schemas/mongodb -- test -- default/mongodb -- test -- default.yaml
|
|
282
|
-
*/
|
|
283
|
-
async copySchemasToAnotherDir() {
|
|
284
|
-
const readFolderName = this.C.SchemaReadF;
|
|
285
|
-
const writeFolderName = this.C.SchemaWriteF;
|
|
286
|
-
const schemaBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
287
|
-
const itemFolderNames = await this.readDirCustom(schemaBasePath, null);
|
|
288
|
-
for (const itemFolderName of itemFolderNames) {
|
|
289
|
-
const itemConfigPath = path.join(schemaBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
290
|
-
if (!fs.existsSync(itemConfigPath))
|
|
291
|
-
continue;
|
|
292
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
293
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
294
|
-
const insAndDBFolderPath = path.join(this.projectDirectory, this.C.src, writeFolderName, itemConfig.instanceName, itemConfig.databaseName);
|
|
295
|
-
await fs.promises.mkdir(insAndDBFolderPath, { recursive: true });
|
|
296
|
-
const collectionReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.collectionName}.config.ts`);
|
|
297
|
-
const collectionWritePath = path.join(insAndDBFolderPath, `${itemConfig.collectionName}.config.ts`);
|
|
298
|
-
await fs.promises.link(collectionReadPath, collectionWritePath);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* src/admin/Database migrations/Migration 1/Migration 1.ts
|
|
303
|
-
* src/admin/Database migrations/Migration 1/Migration 1.yaml
|
|
304
|
-
*/
|
|
305
|
-
async copyDBMigrationsToAnotherDir() {
|
|
306
|
-
const readFolderName = this.C.DBMigrationsReadF;
|
|
307
|
-
const writeFolderName = this.C.DBMigrationsWriteF;
|
|
308
|
-
const schemaBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
309
|
-
const itemFolderNames = await this.readDirCustom(schemaBasePath, null);
|
|
310
|
-
for (const itemFolderName of itemFolderNames) {
|
|
311
|
-
const itemConfigPath = path.join(schemaBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
312
|
-
if (!fs.existsSync(itemConfigPath))
|
|
313
|
-
continue;
|
|
314
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
315
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
316
|
-
const migrationFolderPath = path.join(this.projectDirectory, this.C.src, writeFolderName);
|
|
317
|
-
await fs.promises.mkdir(migrationFolderPath, { recursive: true });
|
|
318
|
-
const migrationReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.name}.ts`);
|
|
319
|
-
const migrationWritePath = path.join(migrationFolderPath, `${itemConfig.name}.ts`);
|
|
320
|
-
await fs.promises.link(migrationReadPath, migrationWritePath);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* src/admin/Database migrations/Migration 1/Migration 1.ts
|
|
325
|
-
* src/admin/Database migrations/Migration 1/Migration 1.yaml
|
|
326
|
-
*/
|
|
327
|
-
async copyProcessInitializersToAnotherDir() {
|
|
328
|
-
const readFolderName = this.C.ProcessInitializersReadF;
|
|
329
|
-
const writeFolderName = this.C.ProcessInitializersWriteF;
|
|
330
|
-
const schemaBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
331
|
-
const itemFolderNames = await this.readDirCustom(schemaBasePath, null);
|
|
332
|
-
for (const itemFolderName of itemFolderNames) {
|
|
333
|
-
const itemConfigPath = path.join(schemaBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
334
|
-
if (!fs.existsSync(itemConfigPath))
|
|
335
|
-
continue;
|
|
336
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
337
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
338
|
-
const piFolderPath = path.join(this.projectDirectory, this.C.src, writeFolderName);
|
|
339
|
-
await fs.promises.mkdir(piFolderPath, { recursive: true });
|
|
340
|
-
const piReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.name}.ts`);
|
|
341
|
-
const piWritePath = path.join(piFolderPath, `${itemConfig.name}.ts`);
|
|
342
|
-
await fs.promises.link(piReadPath, piWritePath);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* src/admin/Database migrations/Migration 1/Migration 1.ts
|
|
347
|
-
* src/admin/Database migrations/Migration 1/Migration 1.yaml
|
|
348
|
-
*/
|
|
349
|
-
async copyI18NToAnotherDir() {
|
|
350
|
-
const readFolderName = this.C.ProcessI18NReadF;
|
|
351
|
-
const writeFolderName = this.C.ProcessI18NWriteF;
|
|
352
|
-
const schemaBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
353
|
-
const itemFolderNames = await this.readDirCustom(schemaBasePath, null);
|
|
354
|
-
for (const itemFolderName of itemFolderNames) {
|
|
355
|
-
const itemConfigPath = path.join(schemaBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
356
|
-
if (!fs.existsSync(itemConfigPath))
|
|
357
|
-
continue;
|
|
358
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
359
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
360
|
-
const piFolderPath = path.join(this.projectDirectory, this.C.src, writeFolderName);
|
|
361
|
-
await fs.promises.mkdir(piFolderPath, { recursive: true });
|
|
362
|
-
const piReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.name}.ts`);
|
|
363
|
-
const piWritePath = path.join(piFolderPath, `${itemConfig.name}.ts`);
|
|
364
|
-
await fs.promises.link(piReadPath, piWritePath);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* src/admin/DB masters/ui_page_1/ui_page_1.config.ts
|
|
369
|
-
* src/admin/DB masters/ui_page_1/ui_page_1.yaml
|
|
370
|
-
* src/admin/DB masters/ui_page_1/ui_page_1.ts
|
|
371
|
-
*/
|
|
372
|
-
async copyDBMastersToAnotherDir() {
|
|
373
|
-
const readFolderName = this.C.DBMastersReadF;
|
|
374
|
-
const writeFolderName = this.C.DBMastersWriteF;
|
|
375
|
-
const schemaBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
376
|
-
const itemFolderNames = await this.readDirCustom(schemaBasePath, null);
|
|
377
|
-
for (const itemFolderName of itemFolderNames) {
|
|
378
|
-
const itemConfigPath = path.join(schemaBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
379
|
-
if (!fs.existsSync(itemConfigPath))
|
|
380
|
-
continue;
|
|
381
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
382
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
383
|
-
const dbMasterFolderPath = path.join(this.projectDirectory, this.C.src, writeFolderName, itemConfig.name);
|
|
384
|
-
await fs.promises.mkdir(dbMasterFolderPath, { recursive: true });
|
|
385
|
-
// Write code file
|
|
386
|
-
const dbMasterReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.name}.ts`);
|
|
387
|
-
const dbMasterWritePath = path.join(dbMasterFolderPath, `${itemConfig.name}.ts`);
|
|
388
|
-
await fs.promises.link(dbMasterReadPath, dbMasterWritePath);
|
|
389
|
-
// Write config file
|
|
390
|
-
const dbMasterConfigReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.name}.config.ts`);
|
|
391
|
-
const dbMasterConfigWritePath = path.join(dbMasterFolderPath, `${itemConfig.name}.config.ts`);
|
|
392
|
-
await fs.promises.link(dbMasterConfigReadPath, dbMasterConfigWritePath);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* src/admin/UI maker styles/Style 1/Style 1.css
|
|
397
|
-
* src/admin/UI maker styles/Style 1/Style 1.yaml
|
|
398
|
-
*/
|
|
399
|
-
async copyDBMasterStylesToAnotherDir() {
|
|
400
|
-
const readFolderName = this.C.DBMasterStylesReadF;
|
|
401
|
-
const writeFolderName = this.C.DBMasterStylesWriteF;
|
|
402
|
-
const schemaBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
403
|
-
const itemFolderNames = await this.readDirCustom(schemaBasePath, null);
|
|
404
|
-
for (const itemFolderName of itemFolderNames) {
|
|
405
|
-
const itemConfigPath = path.join(schemaBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
406
|
-
if (!fs.existsSync(itemConfigPath))
|
|
407
|
-
continue;
|
|
408
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
409
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
410
|
-
const dbMasterFolderPath = path.join(this.projectDirectory, this.C.src, writeFolderName);
|
|
411
|
-
await fs.promises.mkdir(dbMasterFolderPath, { recursive: true });
|
|
412
|
-
// Write code file
|
|
413
|
-
const dbMasterReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.name}.css`);
|
|
414
|
-
const dbMasterWritePath = path.join(dbMasterFolderPath, `${itemConfig.name}.css`);
|
|
415
|
-
await fs.promises.link(dbMasterReadPath, dbMasterWritePath);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* src/admin/DB master utils/Utility 1/Utility 1.ts
|
|
420
|
-
* src/admin/DB master utils/Utility 1/Utility 1.yaml
|
|
421
|
-
*/
|
|
422
|
-
async copyDBMasterUtilsToAnotherDir() {
|
|
423
|
-
const readFolderName = this.C.DBMasterUtilsReadF;
|
|
424
|
-
const writeFolderName = this.C.DBMasterUtilsWriteF;
|
|
425
|
-
const schemaBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
426
|
-
const itemFolderNames = await this.readDirCustom(schemaBasePath, null);
|
|
427
|
-
for (const itemFolderName of itemFolderNames) {
|
|
428
|
-
const itemConfigPath = path.join(schemaBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
429
|
-
if (!fs.existsSync(itemConfigPath))
|
|
430
|
-
continue;
|
|
431
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
432
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
433
|
-
const dbMasterFolderPath = path.join(this.projectDirectory, this.C.src, writeFolderName);
|
|
434
|
-
await fs.promises.mkdir(dbMasterFolderPath, { recursive: true });
|
|
435
|
-
// Write code file
|
|
436
|
-
const dbMasterReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.name}.ts`);
|
|
437
|
-
const dbMasterWritePath = path.join(dbMasterFolderPath, `${itemConfig.name}.ts`);
|
|
438
|
-
await fs.promises.link(dbMasterReadPath, dbMasterWritePath);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* src/admin/Test cases/test1/test1.ts
|
|
443
|
-
* src/admin/Test cases/test1/test1.yaml
|
|
444
|
-
*/
|
|
445
|
-
async copyTestCasesToAnotherDir() {
|
|
446
|
-
const readFolderName = this.C.TestCasesReadF;
|
|
447
|
-
const writeFolderName = this.C.TestCasesWriteF;
|
|
448
|
-
const schemaBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
449
|
-
const itemFolderNames = await this.readDirCustom(schemaBasePath, null);
|
|
450
|
-
for (const itemFolderName of itemFolderNames) {
|
|
451
|
-
const itemConfigPath = path.join(schemaBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
452
|
-
if (!fs.existsSync(itemConfigPath))
|
|
453
|
-
continue;
|
|
454
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
455
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
456
|
-
const piFolderPath = path.join(this.projectDirectory, this.C.src, writeFolderName);
|
|
457
|
-
await fs.promises.mkdir(piFolderPath, { recursive: true });
|
|
458
|
-
const piReadPath = path.join(schemaBasePath, itemFolderName, `${itemConfig.name}.ts`);
|
|
459
|
-
const piWritePath = path.join(piFolderPath, `${itemConfig.name}.ts`);
|
|
460
|
-
await fs.promises.link(piReadPath, piWritePath);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* src/admin/Third party APIs/ftp-utility -- 1.0.0/apis/Append File/Append File.yaml
|
|
465
|
-
* src/admin/Third party APIs/ftp-utility -- 1.0.0/apis/Append File/Append File.config.ts
|
|
466
|
-
* src/admin/Third party APIs/ftp-utility -- 1.0.0/apis/Append File/versions/-1/Original.ts
|
|
467
|
-
*
|
|
468
|
-
* src/admin/Third party APIs/aws-s3-bucket -- 1.0.0/apis/Delete File/versions/-1/pre-hooks/delete file pre hook 1.ts
|
|
469
|
-
* src/admin/Third party APIs/aws-s3-bucket -- 1.0.0/apis/Delete File/versions/-1/post-hooks/delete file post hook 1.ts
|
|
470
|
-
*/
|
|
471
|
-
async copyThirdPartyApisToAnotherDir() {
|
|
472
|
-
const readFolderName = this.C.ThirdPartyApiReadF;
|
|
473
|
-
const writeFolderName = this.C.ThirdPartyApiWriteF;
|
|
474
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
475
|
-
if (!fs.existsSync(itemBasePath))
|
|
476
|
-
return;
|
|
477
|
-
const bundleNames = await this.readDirCustom(itemBasePath, null);
|
|
478
|
-
for (const bundleName of bundleNames) {
|
|
479
|
-
const itemBasePathApis = path.join(itemBasePath, bundleName, this.C.apis);
|
|
480
|
-
const apiNames = await this.readDirCustom(itemBasePathApis, null);
|
|
481
|
-
for (const apiName of apiNames) {
|
|
482
|
-
const itemConfigPath = path.join(itemBasePathApis, apiName, `${apiName}.yaml`);
|
|
483
|
-
if (!fs.existsSync(itemConfigPath))
|
|
484
|
-
continue;
|
|
485
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
486
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
487
|
-
for (const version of itemConfig.versions || []) {
|
|
488
|
-
if (version.isActive === true) {
|
|
489
|
-
// Write code file
|
|
490
|
-
const versionBasePath = path.join(itemBasePathApis, apiName, this.C.versions, version.version);
|
|
491
|
-
const codeFilePath = path.join(versionBasePath, `${version.name}.ts`);
|
|
492
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, bundleName, itemConfig.path, `${itemConfig.name}.ts`);
|
|
493
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
494
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
495
|
-
// Write config file
|
|
496
|
-
const configFilePath = path.join(itemBasePathApis, apiName, `${apiName}.config.ts`);
|
|
497
|
-
const targetConfigFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, bundleName, itemConfig.path, `${itemConfig.name}.config.ts`);
|
|
498
|
-
await fs.promises.link(configFilePath, targetConfigFilePath);
|
|
499
|
-
// Write pre hooks
|
|
500
|
-
for (const hookObj of version.preHooks) {
|
|
501
|
-
// Write code file
|
|
502
|
-
const codeFilePathHook = path.join(versionBasePath, this.C.preHooks, `${hookObj.name}.ts`);
|
|
503
|
-
const targetFilePathHook = path.join(this.projectDirectory, this.C.src, writeFolderName, bundleName, itemConfig.path, this.C.preHooks, `${hookObj.name}.ts`);
|
|
504
|
-
await fs.promises.mkdir(path.dirname(targetFilePathHook), { recursive: true });
|
|
505
|
-
await fs.promises.link(codeFilePathHook, targetFilePathHook);
|
|
506
|
-
}
|
|
507
|
-
// Write post hooks
|
|
508
|
-
for (const hookObj of version.postHooks) {
|
|
509
|
-
// Write code file
|
|
510
|
-
const codeFilePathHook = path.join(versionBasePath, this.C.postHooks, `${hookObj.name}.ts`);
|
|
511
|
-
const targetFilePathHook = path.join(this.projectDirectory, this.C.src, writeFolderName, bundleName, itemConfig.path, this.C.postHooks, `${hookObj.name}.ts`);
|
|
512
|
-
await fs.promises.mkdir(path.dirname(targetFilePathHook), { recursive: true });
|
|
513
|
-
await fs.promises.link(codeFilePathHook, targetFilePathHook);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
/**
|
|
521
|
-
* src/admin/Events/test - event/test - event.yaml
|
|
522
|
-
* src/admin/Events/test - event/listeners/One/versions/1.0.0/1.0.0.ts
|
|
523
|
-
*/
|
|
524
|
-
async copyEventsToAnotherDir() {
|
|
525
|
-
const readFolderName = this.C.EventsReadF;
|
|
526
|
-
const writeFolderName = this.C.EventsWriteF;
|
|
527
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
528
|
-
const eventNames = await this.readDirCustom(itemBasePath, null);
|
|
529
|
-
for (const eventName of eventNames) {
|
|
530
|
-
const itemConfigPath = path.join(itemBasePath, eventName, `${eventName}.yaml`);
|
|
531
|
-
if (!fs.existsSync(itemConfigPath))
|
|
532
|
-
continue;
|
|
533
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
534
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
535
|
-
const eventListenersPath = path.join(itemBasePath, eventName, this.C.listeners);
|
|
536
|
-
for (const eventListenerObj of itemConfig.eventListeners) {
|
|
537
|
-
for (const version of eventListenerObj.versions || []) {
|
|
538
|
-
if (version.isActive === true) {
|
|
539
|
-
// Write code file
|
|
540
|
-
const codeFilePath = path.join(eventListenersPath, eventListenerObj.name, this.C.versions, version.version, `${version.name}.ts`);
|
|
541
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, itemConfig.name, `${eventListenerObj.name}.ts`);
|
|
542
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
543
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* src/admin/Instance API hooks/mongodb -- test -- default -- GEN_GET_ALL/mongodb -- test -- default -- GEN_GET_ALL.yaml
|
|
551
|
-
* src/admin/Instance API hooks/mongodb -- test -- default -- GEN_GET_ALL/pre-hooks/Hook 1.ts
|
|
552
|
-
* src/admin/Instance API hooks/mongodb -- test -- default -- GEN_GET_ALL/post-hooks/Post hook 1.ts
|
|
553
|
-
*/
|
|
554
|
-
async copyInstanceApiHooksToAnotherDir() {
|
|
555
|
-
const readFolderName = this.C.InstanceApiHooksReadF;
|
|
556
|
-
const writeFolderName = this.C.InstanceApiHooksWriteF;
|
|
557
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
558
|
-
const hookNames = await this.readDirCustom(itemBasePath, null);
|
|
559
|
-
for (const hookName of hookNames) {
|
|
560
|
-
const itemConfigPath = path.join(itemBasePath, hookName, `${hookName}.yaml`);
|
|
561
|
-
if (!fs.existsSync(itemConfigPath))
|
|
562
|
-
continue;
|
|
563
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
564
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
565
|
-
const apiNamePath = path.join(itemBasePath, hookName);
|
|
566
|
-
const newFileName = `${itemConfig.instanceName}/${itemConfig.databaseName}/${itemConfig.collectionName}/${itemConfig.apiId.toLowerCase()}`;
|
|
567
|
-
for (const hookObj of itemConfig.preHooks) {
|
|
568
|
-
// Write code file
|
|
569
|
-
const codeFilePath = path.join(apiNamePath, this.C.preHooks, `${hookObj.name}.ts`);
|
|
570
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.preHooks, `${hookObj.name}.ts`);
|
|
571
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
572
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
573
|
-
}
|
|
574
|
-
for (const hookObj of itemConfig.postHooks) {
|
|
575
|
-
// Write code file
|
|
576
|
-
const codeFilePath = path.join(apiNamePath, this.C.postHooks, `${hookObj.name}.ts`);
|
|
577
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.postHooks, `${hookObj.name}.ts`);
|
|
578
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
579
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* src/admin/System API hooks/ENCRYPT_DATA/ENCRYPT_DATA.yaml
|
|
585
|
-
* src/admin/System API hooks/ENCRYPT_DATA/pre-hooks/System api pre hook 1.ts
|
|
586
|
-
* src/admin/System API hooks/ENCRYPT_DATA/post-hooks/System api post hook 1.ts
|
|
587
|
-
*/
|
|
588
|
-
async copySystemApiHooksToAnotherDir() {
|
|
589
|
-
const readFolderName = this.C.SystemApiHooksReadF;
|
|
590
|
-
const writeFolderName = this.C.SystemApiHooksWriteF;
|
|
591
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
592
|
-
const hookNames = await this.readDirCustom(itemBasePath, null);
|
|
593
|
-
for (const hookName of hookNames) {
|
|
594
|
-
const itemConfigPath = path.join(itemBasePath, hookName, `${hookName}.yaml`);
|
|
595
|
-
if (!fs.existsSync(itemConfigPath))
|
|
596
|
-
continue;
|
|
597
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
598
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
599
|
-
const apiNamePath = path.join(itemBasePath, hookName);
|
|
600
|
-
const newFileName = itemConfig.apiId.toLowerCase();
|
|
601
|
-
for (const hookObj of itemConfig.preHooks) {
|
|
602
|
-
// Write code file
|
|
603
|
-
const codeFilePath = path.join(apiNamePath, this.C.preHooks, `${hookObj.name}.ts`);
|
|
604
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.preHooks, `${hookObj.name}.ts`);
|
|
605
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
606
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
607
|
-
}
|
|
608
|
-
for (const hookObj of itemConfig.postHooks) {
|
|
609
|
-
// Write code file
|
|
610
|
-
const codeFilePath = path.join(apiNamePath, this.C.postHooks, `${hookObj.name}.ts`);
|
|
611
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.postHooks, `${hookObj.name}.ts`);
|
|
612
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
613
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
/**
|
|
618
|
-
* src/admin/WebSocket events/Custom APIs -- Hello World/versions/-1/Original.ts
|
|
619
|
-
* src/admin/WebSocket events/Custom APIs -- Hello World/Custom APIs -- Hello World.yaml
|
|
620
|
-
*/
|
|
621
|
-
async copyWebSocketEventsToAnotherDir() {
|
|
622
|
-
const readFolderName = this.C.WebSocketEventsReadF;
|
|
623
|
-
const writeFolderName = this.C.WebSocketEventsWriteF;
|
|
624
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
625
|
-
const itemFolderNames = await this.readDirCustom(itemBasePath, null);
|
|
626
|
-
for (const itemFolderName of itemFolderNames) {
|
|
627
|
-
const itemConfigPath = path.join(itemBasePath, itemFolderName, `${itemFolderName}.yaml`);
|
|
628
|
-
if (!fs.existsSync(itemConfigPath))
|
|
629
|
-
continue;
|
|
630
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
631
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
632
|
-
for (const version of itemConfig.versions || []) {
|
|
633
|
-
if (version.isActive === true) {
|
|
634
|
-
const codeFilePath = path.join(itemBasePath, itemFolderName, this.C.versions, version.version, `${version.name}.ts`);
|
|
635
|
-
let newFileName = '';
|
|
636
|
-
let category = '';
|
|
637
|
-
if (itemConfig.apiCategory === EAPICategory.INSTANCES) {
|
|
638
|
-
category = 'instances';
|
|
639
|
-
newFileName = `${itemConfig.instanceName}/${itemConfig.databaseName}/${itemConfig.collectionName}/${itemConfig.instanceApiName.toLowerCase()}`;
|
|
640
|
-
}
|
|
641
|
-
else if (itemConfig.apiCategory === EAPICategory.THIRD_PARTY_APIS) {
|
|
642
|
-
category = 'third-party-apis';
|
|
643
|
-
newFileName = `${itemConfig.tpInstalledApiBundleName}/${itemConfig.tpInstalledApiName}`;
|
|
644
|
-
}
|
|
645
|
-
else if (itemConfig.apiCategory === EAPICategory.CUSTOM_APIS) {
|
|
646
|
-
category = 'custom-apis';
|
|
647
|
-
newFileName = itemConfig.customApiName;
|
|
648
|
-
}
|
|
649
|
-
else if (itemConfig.apiCategory === EAPICategory.SYSTEM_APIS) {
|
|
650
|
-
category = 'system-apis';
|
|
651
|
-
newFileName = itemConfig.systemApiName.toLowerCase();
|
|
652
|
-
}
|
|
653
|
-
else if (itemConfig.apiCategory === EAPICategory.WEB_SOCKET_EVENT) {
|
|
654
|
-
category = 'ws-events';
|
|
655
|
-
newFileName = itemConfig.name;
|
|
656
|
-
}
|
|
657
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, category, `${newFileName}.ts`);
|
|
658
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
659
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
/**
|
|
665
|
-
* src/admin/Collection hooks/mongodb -- test -- default/mongodb -- test -- default.yaml
|
|
666
|
-
* src/admin/Collection hooks/mongodb -- test -- default/post-hooks/collection post hook 1.ts
|
|
667
|
-
* src/admin/Collection hooks/mongodb -- test -- default/pre-hooks/collection pre hook 1.ts
|
|
668
|
-
*/
|
|
669
|
-
async copyCollectionHooksToAnotherDir() {
|
|
670
|
-
const readFolderName = this.C.CollectionHooksReadF;
|
|
671
|
-
const writeFolderName = this.C.CollectionHooksWriteF;
|
|
672
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
673
|
-
const hookNames = await this.readDirCustom(itemBasePath, null);
|
|
674
|
-
for (const hookName of hookNames) {
|
|
675
|
-
const itemConfigPath = path.join(itemBasePath, hookName, `${hookName}.yaml`);
|
|
676
|
-
if (!fs.existsSync(itemConfigPath))
|
|
677
|
-
continue;
|
|
678
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
679
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
680
|
-
const apiNamePath = path.join(itemBasePath, hookName);
|
|
681
|
-
const newFileName = `${itemConfig.instanceName}/${itemConfig.databaseName}/${itemConfig.collectionName}`;
|
|
682
|
-
for (const hookObj of itemConfig.preHooks) {
|
|
683
|
-
// Write code file
|
|
684
|
-
const codeFilePath = path.join(apiNamePath, this.C.preHooks, `${hookObj.name}.ts`);
|
|
685
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.preHooks, `${hookObj.name}.ts`);
|
|
686
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
687
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
688
|
-
}
|
|
689
|
-
for (const hookObj of itemConfig.postHooks) {
|
|
690
|
-
// Write code file
|
|
691
|
-
const codeFilePath = path.join(apiNamePath, this.C.postHooks, `${hookObj.name}.ts`);
|
|
692
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.postHooks, `${hookObj.name}.ts`);
|
|
693
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
694
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* src/admin/Database hooks/mongodb -- test/mongodb -- test.yaml
|
|
700
|
-
* src/admin/Database hooks/mongodb -- test/pre-hooks/database pre hook 1.ts
|
|
701
|
-
* src/admin/Database hooks/mongodb -- test/post-hooks/database post hook 1.ts
|
|
702
|
-
*/
|
|
703
|
-
async copyDatabaseHooksToAnotherDir() {
|
|
704
|
-
const readFolderName = this.C.DatabaseHooksReadF;
|
|
705
|
-
const writeFolderName = this.C.DatabaseHooksWriteF;
|
|
706
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
707
|
-
const hookNames = await this.readDirCustom(itemBasePath, null);
|
|
708
|
-
for (const hookName of hookNames) {
|
|
709
|
-
const itemConfigPath = path.join(itemBasePath, hookName, `${hookName}.yaml`);
|
|
710
|
-
if (!fs.existsSync(itemConfigPath))
|
|
711
|
-
continue;
|
|
712
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
713
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
714
|
-
const apiNamePath = path.join(itemBasePath, hookName);
|
|
715
|
-
const newFileName = `${itemConfig.instanceName}/${itemConfig.databaseName}`;
|
|
716
|
-
for (const hookObj of itemConfig.preHooks) {
|
|
717
|
-
// Write code file
|
|
718
|
-
const codeFilePath = path.join(apiNamePath, this.C.preHooks, `${hookObj.name}.ts`);
|
|
719
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.preHooks, `${hookObj.name}.ts`);
|
|
720
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
721
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
722
|
-
}
|
|
723
|
-
for (const hookObj of itemConfig.postHooks) {
|
|
724
|
-
// Write code file
|
|
725
|
-
const codeFilePath = path.join(apiNamePath, this.C.postHooks, `${hookObj.name}.ts`);
|
|
726
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.postHooks, `${hookObj.name}.ts`);
|
|
727
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
728
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* src/admin/Instance hooks/mongodb/mongodb.yaml
|
|
734
|
-
* src/admin/Instance hooks/mongodb/pre-hooks/Mongodb instance pre hook.ts
|
|
735
|
-
* src/admin/Instance hooks/mongodb/post-hooks/Mongo instance post hook 1.ts
|
|
736
|
-
*/
|
|
737
|
-
async copyInstanceHooksToAnotherDir() {
|
|
738
|
-
const readFolderName = this.C.InstanceHooksReadF;
|
|
739
|
-
const writeFolderName = this.C.InstanceHooksWriteF;
|
|
740
|
-
const itemBasePath = path.join(__dirname, this.C.src, this.config.adminUserPath, readFolderName);
|
|
741
|
-
const hookNames = await this.readDirCustom(itemBasePath, null);
|
|
742
|
-
for (const hookName of hookNames) {
|
|
743
|
-
const itemConfigPath = path.join(itemBasePath, hookName, `${hookName}.yaml`);
|
|
744
|
-
if (!fs.existsSync(itemConfigPath))
|
|
745
|
-
continue;
|
|
746
|
-
const itemConfigContent = await fs.promises.readFile(itemConfigPath, { encoding: 'utf8' });
|
|
747
|
-
const itemConfig = await this.parseYaml(itemConfigContent);
|
|
748
|
-
const apiNamePath = path.join(itemBasePath, hookName);
|
|
749
|
-
const newFileName = `${itemConfig.instanceName}`;
|
|
750
|
-
for (const hookObj of itemConfig.preHooks) {
|
|
751
|
-
// Write code file
|
|
752
|
-
const codeFilePath = path.join(apiNamePath, this.C.preHooks, `${hookObj.name}.ts`);
|
|
753
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.preHooks, `${hookObj.name}.ts`);
|
|
754
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
755
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
756
|
-
}
|
|
757
|
-
for (const hookObj of itemConfig.postHooks) {
|
|
758
|
-
// Write code file
|
|
759
|
-
const codeFilePath = path.join(apiNamePath, this.C.postHooks, `${hookObj.name}.ts`);
|
|
760
|
-
const targetFilePath = path.join(this.projectDirectory, this.C.src, writeFolderName, newFileName, this.C.postHooks, `${hookObj.name}.ts`);
|
|
761
|
-
await fs.promises.mkdir(path.dirname(targetFilePath), { recursive: true });
|
|
762
|
-
await fs.promises.link(codeFilePath, targetFilePath);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
async executeNpmRun(command, args) {
|
|
767
|
-
return new Promise((resolve, reject) => {
|
|
768
|
-
const childProcess = (0, child_process_1.spawn)(command, args, {
|
|
769
|
-
stdio: 'inherit',
|
|
770
|
-
shell: true, // Allows execution in the system shell, which helps locate 'npm'
|
|
771
|
-
});
|
|
772
|
-
childProcess.on('close', (code) => {
|
|
773
|
-
if (code === 0)
|
|
774
|
-
resolve();
|
|
775
|
-
else {
|
|
776
|
-
const errorMsg = `'${command} ${args.join(' ')}' exited with code ${code}.`;
|
|
777
|
-
reject(new Error(errorMsg));
|
|
778
|
-
}
|
|
779
|
-
});
|
|
780
|
-
childProcess.on('error', (err) => {
|
|
781
|
-
console.error(`Failed to start the npm process: ${err.message}`);
|
|
782
|
-
reject(err);
|
|
783
|
-
});
|
|
784
|
-
});
|
|
785
|
-
}
|
|
786
|
-
async parseYaml(text) {
|
|
787
|
-
if (!this.globalObj.jsyaml) {
|
|
788
|
-
let cdnContent = await this.getContentFromWebURL('https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.js');
|
|
789
|
-
const globalObj = {};
|
|
790
|
-
cdnContent = cdnContent.replace(`Object.defineProperty(exports, '__esModule', { value: true });`, `Object.defineProperty(exports, '__esModule', { value: true }); globalObj.jsyaml = jsYaml;`);
|
|
791
|
-
// eslint-disable-next-line no-eval
|
|
792
|
-
eval(cdnContent);
|
|
793
|
-
this.globalObj.jsyaml = globalObj.jsyaml;
|
|
794
|
-
}
|
|
795
|
-
return this.globalObj.jsyaml.load(text);
|
|
796
|
-
}
|
|
797
|
-
getContentFromWebURL(fileUrl) {
|
|
798
|
-
return new Promise((resolve, reject) => {
|
|
799
|
-
const urlObj = new URL(fileUrl);
|
|
800
|
-
const client = urlObj.protocol === 'https:' ? https : http;
|
|
801
|
-
client.get(fileUrl, (res) => {
|
|
802
|
-
let data = '';
|
|
803
|
-
res.on('data', chunk => {
|
|
804
|
-
data += chunk;
|
|
805
|
-
});
|
|
806
|
-
res.on('end', () => {
|
|
807
|
-
resolve(data);
|
|
808
|
-
});
|
|
809
|
-
}).on('error', (err) => {
|
|
810
|
-
reject(err);
|
|
811
|
-
});
|
|
812
|
-
});
|
|
813
|
-
}
|
|
814
|
-
startWatch() {
|
|
815
|
-
const basePath = __dirname;
|
|
816
|
-
fs.watch(basePath, { recursive: true }, async (eventType, filename) => {
|
|
817
|
-
if (this.skipWatchInputs)
|
|
818
|
-
return; // It will be true when we are writing all data to disk
|
|
819
|
-
if (!filename || filename.endsWith('~') || filename.startsWith('.'))
|
|
820
|
-
return;
|
|
821
|
-
if (!filename.startsWith(this.C.src))
|
|
822
|
-
return;
|
|
823
|
-
if (this.EL)
|
|
824
|
-
console.log(`✓ Send : [${this.getCurrentTime()}] : ${filename}`);
|
|
825
|
-
const category = this.getCategoryOfPath(filename);
|
|
826
|
-
const changedFolder = this.getChangedFolder(category, filename);
|
|
827
|
-
if (!changedFolder)
|
|
828
|
-
return;
|
|
829
|
-
let folderChangedObj;
|
|
830
|
-
let shouldReplaceAllItemsOfCategory = false;
|
|
831
|
-
if (fs.existsSync(changedFolder)) {
|
|
832
|
-
if (!fs.existsSync(filename)) { // some file removed.
|
|
833
|
-
this.syncAllDataWithServer();
|
|
834
|
-
}
|
|
835
|
-
else {
|
|
836
|
-
const keysPrefix = path.join('/' + this.C.repo, changedFolder);
|
|
837
|
-
folderChangedObj = await this.serializeFolderWithBinary(changedFolder, keysPrefix);
|
|
838
|
-
this.sendToServer({
|
|
839
|
-
objType: EWSObjectType.LC_DATA_REQ_RES,
|
|
840
|
-
localClientWSReqRes: {
|
|
841
|
-
eventType: ELocalClientSubEventType.LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM,
|
|
842
|
-
folderChangedOnLocalSystem: folderChangedObj,
|
|
843
|
-
category,
|
|
844
|
-
shouldReplaceAllItemsOfCategory,
|
|
845
|
-
},
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
else {
|
|
850
|
-
const changedFolderDeleted = this.getChangedFolderForDeleted(category, filename);
|
|
851
|
-
const keysPrefix = path.join('/' + this.C.repo, changedFolderDeleted);
|
|
852
|
-
folderChangedObj = await this.serializeFolderWithBinary(changedFolderDeleted, keysPrefix);
|
|
853
|
-
shouldReplaceAllItemsOfCategory = true;
|
|
854
|
-
this.sendDeletedEventToServerDebounce(folderChangedObj, category, shouldReplaceAllItemsOfCategory);
|
|
855
|
-
}
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
getCurrentTime() {
|
|
859
|
-
const now = new Date();
|
|
860
|
-
const hours = String(now.getHours()).padStart(2, '0');
|
|
861
|
-
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
862
|
-
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
863
|
-
return `${hours}:${minutes}:${seconds}`;
|
|
864
|
-
}
|
|
865
|
-
sendDeletedEventToServerInternal(folderChangedObj, category, shouldReplaceAllItemsOfCategory) {
|
|
866
|
-
this.sendToServer({
|
|
867
|
-
objType: EWSObjectType.LC_DATA_REQ_RES,
|
|
868
|
-
localClientWSReqRes: {
|
|
869
|
-
eventType: ELocalClientSubEventType.LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM,
|
|
870
|
-
folderChangedOnLocalSystem: folderChangedObj,
|
|
871
|
-
category,
|
|
872
|
-
shouldReplaceAllItemsOfCategory,
|
|
873
|
-
},
|
|
874
|
-
});
|
|
875
|
-
}
|
|
876
|
-
debounce(fn, delay) {
|
|
877
|
-
let timer = null;
|
|
878
|
-
return function (...args) {
|
|
879
|
-
clearTimeout(timer);
|
|
880
|
-
timer = setTimeout(() => {
|
|
881
|
-
fn.apply(this, args);
|
|
882
|
-
}, delay);
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
getCategoryOfPath(filename) {
|
|
886
|
-
const changeBase = path.join(this.C.src, this.config.adminUserPath);
|
|
887
|
-
if (!filename.startsWith(changeBase))
|
|
888
|
-
return; // ignore files outside of src folder.
|
|
889
|
-
const segments = filename.split(path.sep).filter(o => !!o);
|
|
890
|
-
const category = segments[2];
|
|
891
|
-
for (const key in EGitSyncType)
|
|
892
|
-
if (EGitSyncType[key] === category)
|
|
893
|
-
return category;
|
|
894
|
-
}
|
|
895
|
-
getChangedFolder(category, filename) {
|
|
896
|
-
const segments = filename.split(path.sep);
|
|
897
|
-
let changedFolderPath = '';
|
|
898
|
-
if (category === EGitSyncType.THIRD_PARTY_APIS)
|
|
899
|
-
changedFolderPath = segments.slice(0, 6).join(path.sep);
|
|
900
|
-
else
|
|
901
|
-
changedFolderPath = segments.slice(0, 4).join(path.sep);
|
|
902
|
-
return changedFolderPath;
|
|
903
|
-
}
|
|
904
|
-
getChangedFolderForDeleted(category, filename) {
|
|
905
|
-
const segments = filename.split(path.sep);
|
|
906
|
-
return segments.slice(0, 3).join(path.sep);
|
|
907
|
-
}
|
|
908
|
-
async serializeFolderWithBinary(dirPath, pathPrefix) {
|
|
909
|
-
const result = {};
|
|
910
|
-
const localClient = this;
|
|
911
|
-
async function walk(currentPath) {
|
|
912
|
-
const entries = await localClient.readDirCustom(currentPath, { withFileTypes: true });
|
|
913
|
-
for (const entry of entries) {
|
|
914
|
-
const fullPath = path.join(currentPath, entry.name);
|
|
915
|
-
if (entry.isDirectory())
|
|
916
|
-
await walk(fullPath);
|
|
917
|
-
else { // Read as buffer and encode to base64
|
|
918
|
-
const content = fs.readFileSync(fullPath);
|
|
919
|
-
const relativePath = path.relative(dirPath, fullPath);
|
|
920
|
-
const objectKey = path.join(pathPrefix, relativePath);
|
|
921
|
-
result[objectKey] = {
|
|
922
|
-
encoding: 'base64',
|
|
923
|
-
content: content.toString('base64'),
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
await walk(dirPath);
|
|
929
|
-
return result;
|
|
930
|
-
}
|
|
931
|
-
startWatch_bak() {
|
|
932
|
-
const basePath = this.projectDirectory;
|
|
933
|
-
fs.watch(basePath, { recursive: true }, async (eventType, filename) => {
|
|
934
|
-
if (!filename || filename.endsWith('~'))
|
|
935
|
-
return;
|
|
936
|
-
if (this.skipWatchInputs)
|
|
937
|
-
return; // It will be true when we are writing all data to disk
|
|
938
|
-
const fullPath = path.join(basePath, filename);
|
|
939
|
-
console.log(`Event Type: ${eventType}, File: ${fullPath}`);
|
|
940
|
-
try {
|
|
941
|
-
const stats = await fs.promises.stat(fullPath);
|
|
942
|
-
if (stats.isFile()) {
|
|
943
|
-
if (eventType === 'rename') {
|
|
944
|
-
console.log(`🧩 ${filename} file was added.`);
|
|
945
|
-
}
|
|
946
|
-
else if (eventType === 'change') {
|
|
947
|
-
console.log(`✏️ ${filename} file was modified.`);
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
else if (stats.isDirectory()) {
|
|
951
|
-
if (eventType === 'rename') {
|
|
952
|
-
console.log(`🧩 ${filename} directory was added.`);
|
|
953
|
-
}
|
|
954
|
-
else if (eventType === 'change') {
|
|
955
|
-
console.log(`✏️ ${filename} directory was modified.`);
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
catch (e) {
|
|
960
|
-
if (e.code === 'ENOENT') {
|
|
961
|
-
if (fullPath.endsWith('~')) { // Do nothing as it is temporary file.
|
|
962
|
-
}
|
|
963
|
-
else {
|
|
964
|
-
console.log(`❌ Deleted: ${fullPath}`);
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
sendToServer(data) {
|
|
971
|
-
this.spinner.start();
|
|
972
|
-
try {
|
|
973
|
-
this.ws.send(JSON.stringify(data));
|
|
974
|
-
}
|
|
975
|
-
catch (e) {
|
|
976
|
-
console.log(e);
|
|
977
|
-
}
|
|
978
|
-
this.spinner.stop();
|
|
979
|
-
}
|
|
980
|
-
async connectToServerViaWS() {
|
|
981
|
-
console.log('Connecting to server...');
|
|
982
|
-
const authTokenInfo = 'ws-local-client-sync';
|
|
983
|
-
const am_authorization = this.config.syncToken;
|
|
984
|
-
const adminUserPath = this.config.adminUserPath;
|
|
985
|
-
const webSocketURL = this.config.webSocketURL;
|
|
986
|
-
this.ws = new WebSocket(`${webSocketURL}?authTokenInfo=${authTokenInfo}&authorization=${am_authorization}&user-path=${adminUserPath}`);
|
|
987
|
-
const registeredEvents = [];
|
|
988
|
-
const sendRegisterEvent = () => {
|
|
989
|
-
this.sendToServer({
|
|
990
|
-
objType: EWSObjectType.REGISTER,
|
|
991
|
-
onEvents: [{
|
|
992
|
-
eventType: 'LOCAL_CLIENT_SYNC_EVENTS',
|
|
993
|
-
}],
|
|
994
|
-
});
|
|
995
|
-
};
|
|
996
|
-
function cleanWS(wsTemp) {
|
|
997
|
-
wsTemp.onopen = null;
|
|
998
|
-
wsTemp.onmessage = null;
|
|
999
|
-
wsTemp.onerror = null;
|
|
1000
|
-
wsTemp.onclose = null;
|
|
1001
|
-
wsTemp.close();
|
|
1002
|
-
}
|
|
1003
|
-
this.ws.onmessage = async (event) => {
|
|
1004
|
-
const serverResp = JSON.parse(event.data);
|
|
1005
|
-
if (serverResp.type === EWSObjectType.CONNECTED && serverResp.response.connected)
|
|
1006
|
-
sendRegisterEvent();
|
|
1007
|
-
else if (serverResp.type === EWSObjectType.REGISTER) {
|
|
1008
|
-
if (serverResp?.response?.validOnEvents?.length) {
|
|
1009
|
-
for (const validEvent of serverResp.response.validOnEvents)
|
|
1010
|
-
registeredEvents.push(validEvent);
|
|
1011
|
-
console.log(`✅ Connected to server via WS`);
|
|
1012
|
-
this.syncAllDataWithServer();
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
else
|
|
1016
|
-
await this.processReceivedEvent(serverResp);
|
|
1017
|
-
};
|
|
1018
|
-
this.ws.onclose = (event) => {
|
|
1019
|
-
console.log('Connection closed.');
|
|
1020
|
-
cleanWS(this.ws);
|
|
1021
|
-
setTimeout(this.connectToServerViaWS.bind(this), 3000);
|
|
1022
|
-
};
|
|
1023
|
-
this.ws.onerror = () => {
|
|
1024
|
-
cleanWS(this.ws);
|
|
1025
|
-
setTimeout(this.connectToServerViaWS.bind(this), 3000);
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
syncAllDataWithServer() {
|
|
1029
|
-
this.sendToServer({
|
|
1030
|
-
objType: EWSObjectType.LC_DATA_REQ_RES,
|
|
1031
|
-
localClientWSReqRes: {
|
|
1032
|
-
eventType: ELocalClientSubEventType.LC_SEND_ALL_DATA,
|
|
1033
|
-
},
|
|
1034
|
-
});
|
|
1035
|
-
}
|
|
1036
|
-
async processReceivedEvent(serverResp) {
|
|
1037
|
-
if (this.EL)
|
|
1038
|
-
console.log(serverResp);
|
|
1039
|
-
if (serverResp.type === EWSObjectType.LC_DATA_REQ_RES) {
|
|
1040
|
-
if (serverResp.errors?.length) {
|
|
1041
|
-
console.error(serverResp.errors);
|
|
1042
|
-
return;
|
|
1043
|
-
}
|
|
1044
|
-
this.spinner.start();
|
|
1045
|
-
if (serverResp.response.eventType === ELocalClientSubEventType.LC_SEND_ALL_DATA) {
|
|
1046
|
-
fs.rmSync(path.join(__dirname, this.C.src), {
|
|
1047
|
-
recursive: true,
|
|
1048
|
-
force: true,
|
|
1049
|
-
});
|
|
1050
|
-
fs.mkdirSync(path.join(__dirname, this.C.src), { recursive: true });
|
|
1051
|
-
const resp = serverResp.response.eventData;
|
|
1052
|
-
await this.writeMemfsJsonToDisk(resp, __dirname);
|
|
1053
|
-
}
|
|
1054
|
-
else if (serverResp.response.eventType === ELocalClientSubEventType.LC_DATA_MODIFIED_IN_DATABASE) {
|
|
1055
|
-
const resp = serverResp.response.eventData;
|
|
1056
|
-
await this.writeMemfsJsonToDisk(resp.data, __dirname);
|
|
1057
|
-
}
|
|
1058
|
-
if (this.nodeModulesCopied === true)
|
|
1059
|
-
await this.copyFilesToProjectDir(false);
|
|
1060
|
-
else {
|
|
1061
|
-
await this.copyFilesToProjectDir(true);
|
|
1062
|
-
this.nodeModulesCopied = true;
|
|
1063
|
-
}
|
|
1064
|
-
this.spinner.stop();
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
async writeMemfsJsonToDisk(jsonData, targetRoot) {
|
|
1068
|
-
this.skipWatchInputs = true;
|
|
1069
|
-
const BATCH_SIZE = 1000;
|
|
1070
|
-
let batch = [];
|
|
1071
|
-
const flushBatch = async () => {
|
|
1072
|
-
if (batch.length > 0) {
|
|
1073
|
-
await Promise.all(batch);
|
|
1074
|
-
batch = [];
|
|
1075
|
-
}
|
|
1076
|
-
};
|
|
1077
|
-
for (const [filePath, contentObjTemp] of Object.entries(jsonData)) {
|
|
1078
|
-
if (!filePath.startsWith(`/${this.C.repo}/${this.C.src}`))
|
|
1079
|
-
continue;
|
|
1080
|
-
const contentObj = contentObjTemp;
|
|
1081
|
-
const filePathRepoRemoved = filePath.replace(`/${this.C.repo}`, '');
|
|
1082
|
-
if (this.skipFileWritingForLocal[filePathRepoRemoved])
|
|
1083
|
-
continue;
|
|
1084
|
-
const resolvedPath = path.join(targetRoot, filePathRepoRemoved.replace(/^\//, ''));
|
|
1085
|
-
const dir = path.dirname(resolvedPath);
|
|
1086
|
-
const task = async () => {
|
|
1087
|
-
await fs.promises.mkdir(dir, { recursive: true });
|
|
1088
|
-
await fs.promises.writeFile(resolvedPath, contentObj.content, { encoding: 'base64' });
|
|
1089
|
-
if (this.EL)
|
|
1090
|
-
console.log(`✓ Receive : [${this.getCurrentTime()}] : ${resolvedPath.replace(targetRoot, '')}`);
|
|
1091
|
-
};
|
|
1092
|
-
batch.push(task());
|
|
1093
|
-
if (batch.length >= BATCH_SIZE)
|
|
1094
|
-
await flushBatch();
|
|
1095
|
-
}
|
|
1096
|
-
await flushBatch(); // Flush any remaining tasks
|
|
1097
|
-
setTimeout(() => {
|
|
1098
|
-
this.skipWatchInputs = false;
|
|
1099
|
-
}, 1000);
|
|
1100
|
-
}
|
|
1101
|
-
removeEmptyDirsSync(dirPath) {
|
|
1102
|
-
if (!fs.existsSync(dirPath))
|
|
1103
|
-
return false;
|
|
1104
|
-
const entries = fs.readdirSync(dirPath);
|
|
1105
|
-
let isEmpty = true;
|
|
1106
|
-
for (const entry of entries) {
|
|
1107
|
-
const fullPath = path.join(dirPath, entry);
|
|
1108
|
-
const stat = fs.statSync(fullPath);
|
|
1109
|
-
if (stat.isDirectory()) {
|
|
1110
|
-
const removed = this.removeEmptyDirsSync(fullPath);
|
|
1111
|
-
if (!removed)
|
|
1112
|
-
isEmpty = false;
|
|
1113
|
-
}
|
|
1114
|
-
else
|
|
1115
|
-
isEmpty = false;
|
|
1116
|
-
}
|
|
1117
|
-
if (isEmpty) {
|
|
1118
|
-
fs.rmdirSync(dirPath);
|
|
1119
|
-
return true;
|
|
1120
|
-
}
|
|
1121
|
-
return false;
|
|
1122
|
-
}
|
|
1123
|
-
async readDirCustom(dirPath, options) {
|
|
1124
|
-
if (!fs.existsSync(dirPath))
|
|
1125
|
-
return [];
|
|
1126
|
-
return await fs.promises.readdir(dirPath, options);
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
new LocalClient().start().then();
|
|
1130
|
-
var EAPICategory;
|
|
1131
|
-
(function (EAPICategory) {
|
|
1132
|
-
EAPICategory["INSTANCES"] = "INSTANCES";
|
|
1133
|
-
EAPICategory["THIRD_PARTY_APIS"] = "THIRD_PARTY_APIS";
|
|
1134
|
-
EAPICategory["CUSTOM_APIS"] = "CUSTOM_APIS";
|
|
1135
|
-
EAPICategory["SYSTEM_APIS"] = "SYSTEM_APIS";
|
|
1136
|
-
EAPICategory["WEB_SOCKET_EVENT"] = "WEB_SOCKET_EVENT";
|
|
1137
|
-
})(EAPICategory = exports.EAPICategory || (exports.EAPICategory = {}));
|
|
1138
|
-
var EWSObjectType;
|
|
1139
|
-
(function (EWSObjectType) {
|
|
1140
|
-
EWSObjectType["REGISTER"] = "REGISTER";
|
|
1141
|
-
EWSObjectType["UNREGISTER"] = "UNREGISTER";
|
|
1142
|
-
EWSObjectType["CONNECTED"] = "CONNECTED";
|
|
1143
|
-
EWSObjectType["UNKNOWN"] = "UNKNOWN";
|
|
1144
|
-
EWSObjectType["TOKEN_VALIDATION"] = "TOKEN_VALIDATION";
|
|
1145
|
-
EWSObjectType["NOTIFICATION"] = "NOTIFICATION";
|
|
1146
|
-
// Below is only used for local client sync
|
|
1147
|
-
EWSObjectType["LC_DATA_REQ_RES"] = "LC_DATA_REQ_RES";
|
|
1148
|
-
})(EWSObjectType || (EWSObjectType = {}));
|
|
1149
|
-
var ELocalClientSubEventType;
|
|
1150
|
-
(function (ELocalClientSubEventType) {
|
|
1151
|
-
ELocalClientSubEventType["LC_SEND_ALL_DATA"] = "LC_SEND_ALL_DATA";
|
|
1152
|
-
ELocalClientSubEventType["LC_DATA_MODIFIED_IN_DATABASE"] = "LC_DATA_MODIFIED_IN_DATABASE";
|
|
1153
|
-
ELocalClientSubEventType["LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM"] = "LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM";
|
|
1154
|
-
})(ELocalClientSubEventType || (ELocalClientSubEventType = {}));
|
|
1155
|
-
var EMongooseHookMethods;
|
|
1156
|
-
(function (EMongooseHookMethods) {
|
|
1157
|
-
EMongooseHookMethods["POST"] = "POST";
|
|
1158
|
-
EMongooseHookMethods["PUT"] = "PUT";
|
|
1159
|
-
EMongooseHookMethods["PUT_REPLACE"] = "PUT_REPLACE";
|
|
1160
|
-
EMongooseHookMethods["DELETE"] = "DELETE";
|
|
1161
|
-
EMongooseHookMethods["DELETE_ALL"] = "DELETE_ALL";
|
|
1162
|
-
})(EMongooseHookMethods = exports.EMongooseHookMethods || (exports.EMongooseHookMethods = {}));
|
|
1163
|
-
// It only includes required
|
|
1164
|
-
var EAMModelNames;
|
|
1165
|
-
(function (EAMModelNames) {
|
|
1166
|
-
EAMModelNames["AmEvents"] = "am_events";
|
|
1167
|
-
EAMModelNames["WebSocketEvents"] = "am_web_socket_events";
|
|
1168
|
-
EAMModelNames["DBMasters"] = "am_db_masters";
|
|
1169
|
-
EAMModelNames["CustomApis"] = "am_custom_apis";
|
|
1170
|
-
EAMModelNames["InstanceApiSettings"] = "am_instance_api_settings";
|
|
1171
|
-
EAMModelNames["InstanceApiHooks"] = "am_instance_api_hooks";
|
|
1172
|
-
EAMModelNames["InstanceHooks"] = "am_instance_hooks";
|
|
1173
|
-
EAMModelNames["DatabaseHooks"] = "am_database_hooks";
|
|
1174
|
-
EAMModelNames["CollectionHooks"] = "am_collection_hooks";
|
|
1175
|
-
EAMModelNames["Schedulers"] = "am_schedulers";
|
|
1176
|
-
EAMModelNames["Schemas"] = "am_schemas";
|
|
1177
|
-
EAMModelNames["I18Ns"] = "am_i18ns";
|
|
1178
|
-
EAMModelNames["SystemApiSettings"] = "am_system_api_settings";
|
|
1179
|
-
EAMModelNames["SystemApiHooks"] = "am_system_api_hooks";
|
|
1180
|
-
EAMModelNames["am_tp_api_settings"] = "am_tp_api_settings";
|
|
1181
|
-
EAMModelNames["am_tp_installed_apis"] = "am_tp_installed_apis";
|
|
1182
|
-
EAMModelNames["am_tp_api_versions"] = "am_tp_api_versions";
|
|
1183
|
-
EAMModelNames["UtilityClasses"] = "am_utility_classes";
|
|
1184
|
-
EAMModelNames["DatabasesMigrations"] = "am_database_migrations";
|
|
1185
|
-
EAMModelNames["ProcessInitializers"] = "am_process_initializers";
|
|
1186
|
-
EAMModelNames["UIMakerUtils"] = "am_ui_maker_utils";
|
|
1187
|
-
EAMModelNames["UIMakerStyles"] = "am_ui_maker_styles";
|
|
1188
|
-
EAMModelNames["AmTestCases"] = "am_test_cases";
|
|
1189
|
-
})(EAMModelNames = exports.EAMModelNames || (exports.EAMModelNames = {}));
|
|
1190
|
-
// It includes required
|
|
1191
|
-
var EGitSyncType;
|
|
1192
|
-
(function (EGitSyncType) {
|
|
1193
|
-
EGitSyncType["CUSTOM_APIS"] = "Custom APIs";
|
|
1194
|
-
EGitSyncType["DB_MIGRATIONS"] = "Database migrations";
|
|
1195
|
-
EGitSyncType["PROCESS_INITIALIZERS"] = "Process initializers";
|
|
1196
|
-
EGitSyncType["EVENTS"] = "Events";
|
|
1197
|
-
EGitSyncType["I18NS"] = "i18ns";
|
|
1198
|
-
EGitSyncType["INSTANCE_API_HOOKS"] = "Instance API hooks";
|
|
1199
|
-
EGitSyncType["INSTANCE_HOOKS"] = "Instance hooks";
|
|
1200
|
-
EGitSyncType["DATABASE_HOOKS"] = "Database hooks";
|
|
1201
|
-
EGitSyncType["COLLECTION_HOOKS"] = "Collection hooks";
|
|
1202
|
-
EGitSyncType["INSTANCE_API_SETTINGS"] = "Instance API settings";
|
|
1203
|
-
EGitSyncType["SCHEDULERS"] = "Schedulers";
|
|
1204
|
-
EGitSyncType["SCHEMAS"] = "Schemas";
|
|
1205
|
-
EGitSyncType["SYSTEM_API_HOOKS"] = "System API hooks";
|
|
1206
|
-
EGitSyncType["SYSTEM_API_SETTINGS"] = "System API settings";
|
|
1207
|
-
EGitSyncType["TEST_CASES"] = "Test cases";
|
|
1208
|
-
EGitSyncType["THIRD_PARTY_APIS"] = "Third party APIs";
|
|
1209
|
-
EGitSyncType["THIRD_PARTY_API_SETTINGS"] = "Third party API settings";
|
|
1210
|
-
EGitSyncType["UTILITY_CLASSES"] = "Utility classes";
|
|
1211
|
-
EGitSyncType["EVENTS_WS"] = "WebSocket events";
|
|
1212
|
-
EGitSyncType["DB_MASTERS"] = "DB masters";
|
|
1213
|
-
EGitSyncType["UI_MAKER_UTILITY_CLASS"] = "DB master utils";
|
|
1214
|
-
EGitSyncType["UI_MAKER_STYLES"] = "UI maker styles";
|
|
1215
|
-
})(EGitSyncType = exports.EGitSyncType || (exports.EGitSyncType = {}));
|
|
1
|
+
function a0_0x4c1c(_0x2cfa24,_0x528d78){const _0xe4da4d=a0_0xe4da();return a0_0x4c1c=function(_0x4c1c8e,_0x290018){_0x4c1c8e=_0x4c1c8e-0x7f;let _0x2d0c6b=_0xe4da4d[_0x4c1c8e];return _0x2d0c6b;},a0_0x4c1c(_0x2cfa24,_0x528d78);}function a0_0xe4da(){const _0x29203e=['.ts','padStart','I18NS','./local-client.config','\x1b[36m','post-hooks','Error\x20during\x20shutdown','WebSocket\x20events','message','SIGTERM\x20received\x20—\x20shutting\x20down','collection-hooks','tests','collectionName','connectToServerViaWS','am_database_migrations','copyEventsToAnotherDir','552YmZmsc','writeMemfsJsonToDisk','filter','stringify','AmEvents','Schemas','data','✅\x20dependencies\x20installed','am-types','rmSync','REGISTER','COLLECTION_HOOKS','ThirdPartyApiReadF','baseUrl','18385VlRFws','web-socket-events','Test\x20cases','tsconfig.json','nodeModulesCopied','Third\x20party\x20APIs','Cannot\x20find\x20module\x20\x27','EventsWriteF','unlinkDir','fsLink','system-api-hooks','chokidar@4.0.3','am_instance_hooks','SYSTEM_API_SETTINGS','\x20Please\x20provide\x20settings\x20in\x20:\x20','apply','--force','validOnEvents','sendToServer','length','tpInstalledApiBundleName','DELETE','instance-api-hooks',']\x20:\x20','system-apis','InstanceApiSettings','SchemaReadF','unhandledRejection','serializeFolderWithBinary','copyInstanceHooksToAnotherDir','fsReadFile','utf8','CollectionHooks','close','am_custom_apis','code','am_schemas','startsWith','statSync','InstanceHooks','Instance\x20API\x20settings','3163860pLALvG','System\x20API\x20hooks','-lc','CONNECTED','onclose','database-hooks','resolve','InstanceApiHooksReadF','eventListeners','dirname','./src','PUT','projectDirectory','promises','SystemApiHooksReadF','⏳\x20dependencies\x20installation\x20process\x20started','exit','orangeStart','dbInterfacesFile','onopen','spawn','isActive','copyWebSocketEventsToAnotherDir','replace','Schedulers','path','DatabasesMigrations','src/tools','\x20Local\x20client\x20will\x20pull\x20your\x20server\x20changes\x20to\x20local\x20&\x20perform\x20sync\x20between\x20them.','log','eventType','executeNpmRun','copyDBMasterUtilsToAnotherDir','766371CsHcfv','fsMkDirSync','error','apis','CollectionHooksReadF','getChangedFolderForDeleted','child_process','instanceName','adminUserPath','eventData','Collection\x20hooks','am_ui_maker_utils','load','dir','parse','uncaughtException','join','am_database_hooks','npm','chokidar','watcher','SchedulersReadF','copyDBMigrationsToAnotherDir','amTypes','UI_MAKER_STYLES','am_collection_hooks','.config.ts','webSocketURL','copyCollectionHooksToAnotherDir','onerror','UIMakerStyles','syncToken','Utility\x20classes','versions','am_tp_api_settings','add','skipWatchInputs','unlink','debounce','db-interfaces.d.ts','SIGTERM','apiId','compilerOptions','config','LC_DATA_REQ_RES','——————————————————————————————————————————————————————————————————————————————————','DB\x20master\x20utils','db-migrations','getCategoryOfPath','preHooks','⏳\x20Connecting\x20to\x20server...','am_events','errors','WebSocketEventsReadF','isWSConnectedFirstTime','readFileSync','getHours','getSeconds','fsReadDir','SYSTEM_APIS','DBMasters','createLCProjectDirectory','mkdir','Watcher\x20error:','am_system_api_settings','DB_MIGRATIONS','PROCESS_INITIALIZERS','i18ns','INSTANCE_API_HOOKS','watch','6868590UqAIHf','name','start','UNKNOWN','then','DELETE_ALL','Process\x20initializers','fsMkDir','installRequiredPackages','System\x20API\x20settings','slice','Error\x20while\x20connecting\x20to\x20WS\x20server.','.js','shuttingDown','customApiName','sep','LOCAL_CLIENT_SYNC_EVENTS','existsSync','SystemApiHooksWriteF','⏳\x20node_modules\x20installation\x20process\x20started','readdirSync','instanceApiName','DBMasterUtilsWriteF','removeEmptyDirsSync','PUT_REPLACE','DATABASE_HOOKS','copyProcessInitializersToAnotherDir','colorEnd','Database\x20migrations','\x1b[38;2;255;165;0m','js-yaml@4.1.0','Third\x20party\x20API\x20settings','LC_DATA_MODIFIED_IN_DATABASE','src','438TywDgJ','MODULE_NOT_FOUND','am_instance_api_settings','am_system_api_hooks','getCurrentTime','readDirCustom','prototype','✅\x20Local\x20client\x20started...','am_instance_api_hooks','paths','response','DBMasterUtilsReadF','UI_MAKER_UTILITY_CLASS',']\x20:\x20[','--no-save','type','toLowerCase','syncAllDataWithServer','link','copySystemApiHooksToAnotherDir','readFile','getChangedFolder','Events','UIMakerUtils','push','CollectionHooksWriteF','onmessage','tpInstalledApiName','version','folderPath','Instance\x20API\x20hooks','DBMasterStylesReadF','base64','shutdownAndExit','databaseName','fsExistsSync','ProcessInitializers','watch\x20handler\x20error','exports','relative','package.json','am_web_socket_events','copySchedulersToAnotherDir','send','Instance\x20hooks','js-yaml','split','POST','parseYaml','NOTIFICATION','InstanceApiHooksWriteF','bind','CustomApis','instance-hooks','SIGINT','copyUtilityClassesToAnotherDir','types','AmTestCases','DBMigrationsReadF','schemas','UNREGISTER','copyTestCasesToAnotherDir','1136wZHsAA','✅\x20Connected\x20to\x20server\x20via\x20WS','InstanceApiHooks','third-party-apis','ws-events','SCHEMAS','apiCategory','startWatch','INSTANCES','getMinutes','cyanStart','postHooks','listeners','entries','&user-path=','change','DatabaseHooksWriteF','✅\x20node_modules\x20installed','\x1b[0m','addDir','beforeExit','DBMastersReadF','.yaml','ui-maker-styles','printNotesToProvideLocalClient','SYSTEM_API_HOOKS','copyI18NToAnotherDir','2818480zjSbEe','connected','Failed\x20to\x20start\x20the\x20npm\x20process:\x20','package-lock.json','localClientPath','am_tp_api_versions','UTILITY_CLASSES','normalizePath','schedulers','InstanceHooksWriteF','copyFilesToProjectDir','SchemaWriteF','InstanceHooksReadF','ThirdPartyApiWriteF','printNotes','am_i18ns','WebSocketEventsWriteF','I18Ns','copyDBMasterStylesToAnotherDir','copyCustomApisToAnotherDir','copySchemasToAnotherDir','am_schedulers','✓\x20Send\x20:\x20[','hasOwnProperty','keys','sendDeletedEventToServerDebounce','Node.js\x2022+\x20is\x20required.\x20Current\x20version:\x20','WEB_SOCKET_EVENT','EVENTS_WS','ui-maker-utils','normalize','UI\x20maker\x20styles','mkdirSync','skipFileWritingForLocal','symlinkSync','SchedulersWriteF','✓\x20Receive\x20:\x20[','instances','am_ui_maker_styles','am_utility_classes','copyInstanceApiHooksToAnotherDir','INSTANCE_API_SETTINGS','TestCasesReadF','sendDeletedEventToServerInternal','copyDatabaseHooksToAnotherDir','fsWriteFile','node_modules','2514896JYhxhr','DB\x20masters','cpSync','DBMastersWriteF','THIRD_PARTY_APIS','basename','writeFile','am_process_initializers','✳️\x20Open\x20folder\x20in\x20IDE\x20:\x20','ProcessI18NReadF','LC_SEND_ALL_DATA','repo','LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM','am_tp_installed_apis','Custom\x20APIs','?authTokenInfo=ws-local-client-sync&authorization=','custom-apis','UtilityClasses','invalidOnEvents','Please\x20run\x20using\x20administrator\x20privileges.','8POnAsz','——————————————————————————————————————\x20Note\x20——————————————————————————————————————','CUSTOM_APIS'];a0_0xe4da=function(){return _0x29203e;};return a0_0xe4da();}(function(_0x1043fc,_0xb819b7){const _0x250c10=a0_0x4c1c,_0x9ba7df=_0x1043fc();while(!![]){try{const _0x2d17d5=parseInt(_0x250c10(0x167))/0x1*(-parseInt(_0x250c10(0x1a5))/0x2)+parseInt(_0x250c10(0xff))/0x3*(-parseInt(_0x250c10(0x94))/0x4)+-parseInt(_0x250c10(0xb5))/0x5*(parseInt(_0x250c10(0xa7))/0x6)+parseInt(_0x250c10(0x1c0))/0x7+parseInt(_0x250c10(0x80))/0x8+parseInt(_0x250c10(0xde))/0x9+parseInt(_0x250c10(0x145))/0xa;if(_0x2d17d5===_0xb819b7)break;else _0x9ba7df['push'](_0x9ba7df['shift']());}catch(_0xdcbb38){_0x9ba7df['push'](_0x9ba7df['shift']());}}}(a0_0xe4da,0xa080b),((()=>{const _0x387c7d=a0_0x4c1c;var _0x82b200={0x3dc:(_0x58c2e0,_0x16d78a,_0x414903)=>{'use strict';const _0x525cba=a0_0x4c1c;var _0x34e753=_0x525cba(0xf9);_0x16d78a['_6']=_0x16d78a['EN']=_0x16d78a['Yl']=_0x16d78a['QX']=void 0x0;const _0x1c99e6=_0x414903(0x3a),_0x13a921=_0x414903(0x2a0),_0x15a12d=_0x414903(0x170);var _0x538f72,_0x30106e,_0x23e227,_0x2f378f,_0x136ed6,_0x272415;new class{constructor(){const _0x23eb12=_0x525cba;this['EL']=!0x1,this[_0x23eb12(0xea)]='',this['C']={'localClientPath':_0x23eb12(0x9a),'src':_0x23eb12(0x166),'repo':_0x23eb12(0x8b),'types':_0x23eb12(0x19f),'amTypes':_0x23eb12(0xaf),'versions':_0x23eb12(0x120),'apis':_0x23eb12(0x102),'listeners':'listeners','postHooks':_0x23eb12(0x9c),'preHooks':'pre-hooks','dbInterfacesFile':_0x23eb12(0x126),'UtilityClassesReadF':_0x23eb12(0x11f),'CustomApiReadF':'Custom\x20APIs','SchedulersReadF':_0x23eb12(0xf6),'WebSocketEventsReadF':_0x23eb12(0x9e),'SchemaReadF':_0x23eb12(0xac),'DBMigrationsReadF':'Database\x20migrations','ProcessInitializersReadF':_0x23eb12(0x14b),'ProcessI18NReadF':_0x23eb12(0x142),'DBMastersReadF':'DB\x20masters','DBMasterStylesReadF':'UI\x20maker\x20styles','DBMasterUtilsReadF':_0x23eb12(0x12d),'TestCasesReadF':_0x23eb12(0xb7),'ThirdPartyApiReadF':_0x23eb12(0xba),'EventsReadF':_0x23eb12(0x17d),'InstanceApiHooksReadF':_0x23eb12(0x185),'SystemApiHooksReadF':_0x23eb12(0xdf),'CollectionHooksReadF':_0x23eb12(0x109),'DatabaseHooksReadF':'Database\x20hooks','InstanceHooksReadF':_0x23eb12(0x193),'CustomApisWriteF':_0x23eb12(0x90),'SchedulersWriteF':_0x23eb12(0x1c8),'WebSocketEventsWriteF':_0x23eb12(0xb6),'SchemaWriteF':_0x23eb12(0x1a2),'DBMigrationsWriteF':_0x23eb12(0x12e),'ProcessInitializersWriteF':'process-initializers','ProcessI18NWriteF':_0x23eb12(0x142),'DBMastersWriteF':'ui-maker-pages','DBMasterStylesWriteF':_0x23eb12(0x1bc),'DBMasterUtilsWriteF':_0x23eb12(0x1dd),'TestCasesWriteF':_0x23eb12(0xa2),'ThirdPartyApiWriteF':_0x23eb12(0x1a8),'EventsWriteF':'events','InstanceApiHooksWriteF':_0x23eb12(0xcb),'SystemApiHooksWriteF':_0x23eb12(0xbf),'CollectionHooksWriteF':_0x23eb12(0xa1),'DatabaseHooksWriteF':_0x23eb12(0xe3),'InstanceHooksWriteF':_0x23eb12(0x19c)},this[_0x23eb12(0x123)]=!0x1,this[_0x23eb12(0x1e1)]={},this[_0x23eb12(0xb9)]=!0x1,this[_0x23eb12(0xef)]=_0x23eb12(0x162),this[_0x23eb12(0x1af)]=_0x23eb12(0x9b),this[_0x23eb12(0x160)]=_0x23eb12(0x1b7),this[_0x23eb12(0x135)]=!0x1,this[_0x23eb12(0x1d9)]=this[_0x23eb12(0x125)](this[_0x23eb12(0x1eb)],0x1f4);}async[_0x525cba(0x147)](){const _0x3dba76=_0x525cba;this['addProcessHooks'](),this['checkForNodeVersion'](),this[_0x3dba76(0x18a)](this['C']['localClientPath']+_0x3dba76(0x151))||(this[_0x3dba76(0x1bd)](),this[_0x3dba76(0x188)](0x1)['then']()),this[_0x3dba76(0x12a)]=_0x414903(0x300)(this['C'][_0x3dba76(0x1c4)])(),await this[_0x3dba76(0x1ce)](),this['removeEmptyDirsSync'](_0x13a921[_0x3dba76(0x10f)](_0x34e753,this['C'][_0x3dba76(0x166)])),await this[_0x3dba76(0x13c)](),await this[_0x3dba76(0x14d)](),await this['connectToServerViaWS']();}['checkForNodeVersion'](){const _0x574749=_0x525cba,_0x1dfbc8=process['version'];parseInt(_0x1dfbc8[_0x574749(0x195)]('.')[0x0][_0x574749(0xf5)]('v',''),0xa)<0x16&&(console['error'](this[_0x574749(0xef)]+_0x574749(0x1da)+_0x1dfbc8+this[_0x574749(0x160)]),this[_0x574749(0x188)](0x1)[_0x574749(0x149)]());}async[_0x525cba(0x1ce)](){const _0x419740=_0x525cba;console[_0x419740(0xfb)](this[_0x419740(0xef)]),console[_0x419740(0xfb)](_0x419740(0x95)),console[_0x419740(0xfb)](_0x419740(0xfa)),console[_0x419740(0xfb)](_0x419740(0x12c)),console[_0x419740(0xfb)](this['colorEnd']),console['log']('');}[_0x525cba(0x1bd)](){const _0x345674=_0x525cba;console[_0x345674(0xfb)]('\x1b[38;2;255;165;0m'),console['log'](_0x345674(0xc3)+this['C'][_0x345674(0x1c4)]+'.js'),console[_0x345674(0xfb)](_0x345674(0x1b7)),console[_0x345674(0xfb)]('');}async[_0x525cba(0x13c)](){const _0x61f417=_0x525cba,_0x4cf5fd=_0x13a921[_0x61f417(0x85)](_0x34e753),_0x36cf2e=_0x13a921[_0x61f417(0x10f)](_0x34e753,'..',_0x4cf5fd+_0x61f417(0xe0));this[_0x61f417(0xea)]=_0x36cf2e,_0x1c99e6[_0x61f417(0xb0)](_0x36cf2e,{'recursive':!0x0,'force':!0x0}),await this[_0x61f417(0x14c)](_0x36cf2e,{'recursive':!0x0});}async[_0x525cba(0x1ca)](_0x3846fd){const _0x4a5525=_0x525cba;await this[_0x4a5525(0x13c)](),this[_0x4a5525(0x100)](_0x13a921[_0x4a5525(0x10f)](this[_0x4a5525(0xea)],this['C'][_0x4a5525(0x166)]),{'recursive':!0x0}),_0x1c99e6[_0x4a5525(0x82)](_0x13a921[_0x4a5525(0x10f)](_0x34e753,_0x4a5525(0x18f)),_0x13a921[_0x4a5525(0x10f)](this[_0x4a5525(0xea)],_0x4a5525(0x18f))),_0x1c99e6[_0x4a5525(0x82)](_0x13a921[_0x4a5525(0x10f)](_0x34e753,'.gitignore'),_0x13a921[_0x4a5525(0x10f)](this[_0x4a5525(0xea)],'.gitignore'));const _0x551d9c=_0x13a921[_0x4a5525(0x10f)](_0x34e753,_0x4a5525(0xb8)),_0x3b66a5=JSON[_0x4a5525(0x10d)](await this[_0x4a5525(0xd3)](_0x551d9c,{'encoding':_0x4a5525(0xd4)}));_0x3b66a5[_0x4a5525(0x129)][_0x4a5525(0xb4)]=_0x4a5525(0xe8),_0x3b66a5[_0x4a5525(0x129)][_0x4a5525(0x170)]['*'][_0x4a5525(0x17f)]('*'),await this[_0x4a5525(0x1ed)](_0x13a921[_0x4a5525(0x10f)](this['projectDirectory'],_0x4a5525(0xb8)),JSON[_0x4a5525(0xaa)](_0x3b66a5,null,0x4),{'encoding':'utf8'}),await _0x1c99e6[_0x4a5525(0xeb)]['cp'](_0x13a921[_0x4a5525(0x10f)](_0x34e753,this['C']['amTypes']),_0x13a921['join'](this['projectDirectory'],this['C'][_0x4a5525(0x166)],this['C']['amTypes']),{'recursive':!0x0}),await _0x1c99e6['promises']['cp'](_0x13a921[_0x4a5525(0x10f)](_0x34e753,this['C'][_0x4a5525(0x166)],this[_0x4a5525(0x12a)][_0x4a5525(0x107)],this['C'][_0x4a5525(0x19f)],this['C'][_0x4a5525(0xf0)]),_0x13a921['join'](this[_0x4a5525(0xea)],this['C'][_0x4a5525(0x166)],this['C'][_0x4a5525(0x116)],this['C'][_0x4a5525(0xf0)]),{'recursive':!0x0}),await this[_0x4a5525(0x19e)](),await this[_0x4a5525(0x1d3)](),await this[_0x4a5525(0x191)](),await this[_0x4a5525(0x1d4)](),await this[_0x4a5525(0x115)](),await this[_0x4a5525(0x15f)](),await this[_0x4a5525(0x1bf)](),await this[_0x4a5525(0x1a4)](),await this['copyThirdPartyApisToAnotherDir'](),await this[_0x4a5525(0xa6)](),await this[_0x4a5525(0x1e8)](),await this[_0x4a5525(0x17a)](),await this['copyWebSocketEventsToAnotherDir'](),await this[_0x4a5525(0x11b)](),await this[_0x4a5525(0x1ec)](),await this[_0x4a5525(0xd2)](),await this['copyDBMastersToAnotherDir'](),await this[_0x4a5525(0x1d2)](),await this[_0x4a5525(0xfe)](),_0x3846fd&&(console[_0x4a5525(0xfb)](_0x4a5525(0x158)),await this[_0x4a5525(0xfd)](_0x4a5525(0x111),['install',_0x4a5525(0xc5)]),console[_0x4a5525(0xfb)](_0x4a5525(0x1b6)));try{_0x1c99e6[_0x4a5525(0x1e2)](_0x13a921[_0x4a5525(0x10f)](_0x34e753,_0x4a5525(0x7f)),_0x13a921['join'](this[_0x4a5525(0xea)],_0x4a5525(0x7f)),_0x4a5525(0x10c));}catch(_0x44dc31){console[_0x4a5525(0xfb)](_0x4a5525(0x93)),console[_0x4a5525(0xfb)](_0x44dc31),await this['shutdownAndExit'](0x1);}}async[_0x525cba(0x14d)](){const _0x12b7bc=_0x525cba;console[_0x12b7bc(0xfb)](_0x12b7bc(0xed));try{_0x1c99e6['unlinkSync'](_0x13a921[_0x12b7bc(0x10f)](_0x34e753,_0x12b7bc(0x1c3)));}catch(_0x167e5b){}await this['executeNpmRun'](_0x12b7bc(0x111),['install',_0x12b7bc(0x175),_0x12b7bc(0xc0),_0x12b7bc(0x163)]),console['log'](_0x12b7bc(0xae));}async[_0x525cba(0x19e)](){const _0x323b3e=_0x525cba,_0x2e8065=this['C']['UtilityClassesReadF'],_0x11d771=_0x13a921[_0x323b3e(0x10f)](_0x34e753,this['C'][_0x323b3e(0x166)],this[_0x323b3e(0x12a)][_0x323b3e(0x107)],_0x2e8065),_0x4f159c=await this[_0x323b3e(0x16c)](_0x11d771,null);for(const _0x5c8c38 of _0x4f159c){const _0x3624f7=_0x13a921[_0x323b3e(0x10f)](_0x11d771,_0x5c8c38,_0x5c8c38+_0x323b3e(0x1bb));if(!this[_0x323b3e(0x18a)](_0x3624f7))continue;const _0x21e9f2=await this[_0x323b3e(0xd3)](_0x3624f7,{'encoding':_0x323b3e(0xd4)}),_0x4011db=await this[_0x323b3e(0x197)](_0x21e9f2);for(const _0x40a19a of _0x4011db[_0x323b3e(0x120)]||[])if(!0x0===_0x40a19a[_0x323b3e(0xf3)]){const _0xf1fe46=_0x13a921[_0x323b3e(0x10f)](_0x11d771,_0x5c8c38,this['C']['versions'],_0x40a19a[_0x323b3e(0x183)],_0x40a19a[_0x323b3e(0x146)]+_0x323b3e(0x97)),_0x2ebfc7=_0x13a921[_0x323b3e(0x10f)](this[_0x323b3e(0xea)],this['C'][_0x323b3e(0x166)],_0x4011db[_0x323b3e(0x184)],_0x4011db['name']+_0x323b3e(0x97));await this[_0x323b3e(0x14c)](_0x13a921['dirname'](_0x2ebfc7),{'recursive':!0x0}),await this[_0x323b3e(0xbe)](_0xf1fe46,_0x2ebfc7);}}}async[_0x525cba(0x1d3)](){const _0x28437e=_0x525cba,_0x2eed06=this['C']['CustomApiReadF'],_0x409469=this['C']['CustomApisWriteF'],_0x19b6f3=_0x13a921[_0x28437e(0x10f)](_0x34e753,this['C'][_0x28437e(0x166)],this[_0x28437e(0x12a)][_0x28437e(0x107)],_0x2eed06),_0x1a90f7=await this[_0x28437e(0x16c)](_0x19b6f3,null);for(const _0x2fc6a9 of _0x1a90f7){const _0x5aab8a=_0x13a921[_0x28437e(0x10f)](_0x19b6f3,_0x2fc6a9,_0x2fc6a9+_0x28437e(0x1bb));if(!this[_0x28437e(0x18a)](_0x5aab8a))continue;const _0x1c7283=await this[_0x28437e(0xd3)](_0x5aab8a,{'encoding':'utf8'}),_0x88dd89=await this[_0x28437e(0x197)](_0x1c7283);for(const _0x4ebaa7 of _0x88dd89[_0x28437e(0x120)]||[])if(!0x0===_0x4ebaa7[_0x28437e(0xf3)]){const _0x40f599=_0x13a921['join'](_0x19b6f3,_0x2fc6a9,this['C'][_0x28437e(0x120)],_0x4ebaa7['version']),_0x47f0e8=_0x13a921[_0x28437e(0x10f)](_0x40f599,_0x4ebaa7[_0x28437e(0x146)]+_0x28437e(0x97)),_0x2f068b=_0x13a921[_0x28437e(0x10f)](this['projectDirectory'],this['C'][_0x28437e(0x166)],_0x409469,_0x88dd89[_0x28437e(0xf7)],_0x88dd89[_0x28437e(0x146)]+_0x28437e(0x97));await this['fsMkDir'](_0x13a921['dirname'](_0x2f068b),{'recursive':!0x0}),await this['fsLink'](_0x47f0e8,_0x2f068b);const _0x2062eb=_0x13a921[_0x28437e(0x10f)](_0x19b6f3,_0x2fc6a9,_0x2fc6a9+_0x28437e(0x119)),_0x312f4a=_0x13a921[_0x28437e(0x10f)](this[_0x28437e(0xea)],this['C'][_0x28437e(0x166)],_0x409469,_0x88dd89[_0x28437e(0xf7)],_0x88dd89[_0x28437e(0x146)]+_0x28437e(0x119));await this['fsLink'](_0x2062eb,_0x312f4a);for(const _0x87d566 of _0x4ebaa7[_0x28437e(0x130)]){const _0x24eedf=_0x13a921[_0x28437e(0x10f)](_0x40f599,this['C'][_0x28437e(0x130)],_0x87d566[_0x28437e(0x146)]+'.ts'),_0x21c9d5=_0x13a921[_0x28437e(0x10f)](this[_0x28437e(0xea)],this['C']['src'],_0x409469,_0x88dd89[_0x28437e(0xf7)],this['C']['preHooks'],_0x87d566[_0x28437e(0x146)]+_0x28437e(0x97));await this[_0x28437e(0x14c)](_0x13a921[_0x28437e(0xe7)](_0x21c9d5),{'recursive':!0x0}),await this[_0x28437e(0xbe)](_0x24eedf,_0x21c9d5);}for(const _0x1e683b of _0x4ebaa7[_0x28437e(0x1b0)]){const _0x372e10=_0x13a921['join'](_0x40f599,this['C'][_0x28437e(0x1b0)],_0x1e683b[_0x28437e(0x146)]+'.ts'),_0x2a0e1b=_0x13a921[_0x28437e(0x10f)](this['projectDirectory'],this['C'][_0x28437e(0x166)],_0x409469,_0x88dd89['path'],this['C']['postHooks'],_0x1e683b[_0x28437e(0x146)]+_0x28437e(0x97));await this[_0x28437e(0x14c)](_0x13a921[_0x28437e(0xe7)](_0x2a0e1b),{'recursive':!0x0}),await this[_0x28437e(0xbe)](_0x372e10,_0x2a0e1b);}}}}async[_0x525cba(0x191)](){const _0x434e68=_0x525cba,_0x23fd40=this['C'][_0x434e68(0x114)],_0x2aab44=this['C'][_0x434e68(0x1e3)],_0x2517cd=_0x13a921['join'](_0x34e753,this['C']['src'],this[_0x434e68(0x12a)][_0x434e68(0x107)],_0x23fd40),_0x5373c5=await this[_0x434e68(0x16c)](_0x2517cd,null);for(const _0x34aa51 of _0x5373c5){const _0x32f7a8=_0x13a921['join'](_0x2517cd,_0x34aa51,_0x34aa51+'.yaml');if(!this[_0x434e68(0x18a)](_0x32f7a8))continue;const _0x1b294d=await this[_0x434e68(0xd3)](_0x32f7a8,{'encoding':'utf8'}),_0x3fea56=await this[_0x434e68(0x197)](_0x1b294d);for(const _0x33a014 of _0x3fea56[_0x434e68(0x120)]||[])if(!0x0===_0x33a014['isActive']){const _0x22f207=_0x13a921[_0x434e68(0x10f)](_0x2517cd,_0x34aa51,this['C']['versions'],_0x33a014[_0x434e68(0x183)],_0x33a014[_0x434e68(0x146)]+'.ts'),_0x11dfd2=_0x13a921[_0x434e68(0x10f)](this[_0x434e68(0xea)],this['C'][_0x434e68(0x166)],_0x2aab44,_0x3fea56['name']+_0x434e68(0x97));await this[_0x434e68(0x14c)](_0x13a921[_0x434e68(0xe7)](_0x11dfd2),{'recursive':!0x0}),await this[_0x434e68(0xbe)](_0x22f207,_0x11dfd2);}}}async[_0x525cba(0x1d4)](){const _0x28d1c2=_0x525cba,_0x8218ce=this['C'][_0x28d1c2(0xcf)],_0x3e0d71=this['C'][_0x28d1c2(0x1cb)],_0x462b4d=_0x13a921[_0x28d1c2(0x10f)](_0x34e753,this['C'][_0x28d1c2(0x166)],this[_0x28d1c2(0x12a)][_0x28d1c2(0x107)],_0x8218ce),_0x231eed=await this['readDirCustom'](_0x462b4d,null);for(const _0x56f6dd of _0x231eed){const _0x288140=_0x13a921[_0x28d1c2(0x10f)](_0x462b4d,_0x56f6dd,_0x56f6dd+'.yaml');if(!this[_0x28d1c2(0x18a)](_0x288140))continue;const _0x58b7ab=await this[_0x28d1c2(0xd3)](_0x288140,{'encoding':_0x28d1c2(0xd4)}),_0x54c3a1=await this[_0x28d1c2(0x197)](_0x58b7ab),_0xbbed5a=_0x13a921[_0x28d1c2(0x10f)](this[_0x28d1c2(0xea)],this['C'][_0x28d1c2(0x166)],_0x3e0d71,_0x54c3a1['instanceName'],_0x54c3a1[_0x28d1c2(0x189)]);await this[_0x28d1c2(0x14c)](_0xbbed5a,{'recursive':!0x0});const _0x5d993f=_0x13a921[_0x28d1c2(0x10f)](_0x462b4d,_0x56f6dd,_0x54c3a1[_0x28d1c2(0xa3)]+'.config.ts'),_0x3fa64d=_0x13a921['join'](_0xbbed5a,_0x54c3a1['collectionName']+_0x28d1c2(0x119));await this[_0x28d1c2(0xbe)](_0x5d993f,_0x3fa64d);}}async['copyDBMigrationsToAnotherDir'](){const _0x456a52=_0x525cba,_0x235821=this['C'][_0x456a52(0x1a1)],_0x181af3=this['C']['DBMigrationsWriteF'],_0x50d995=_0x13a921['join'](_0x34e753,this['C'][_0x456a52(0x166)],this[_0x456a52(0x12a)]['adminUserPath'],_0x235821),_0x4c766f=await this[_0x456a52(0x16c)](_0x50d995,null);for(const _0x2a65bb of _0x4c766f){const _0x558c33=_0x13a921['join'](_0x50d995,_0x2a65bb,_0x2a65bb+_0x456a52(0x1bb));if(!this[_0x456a52(0x18a)](_0x558c33))continue;const _0x120864=await this['fsReadFile'](_0x558c33,{'encoding':_0x456a52(0xd4)}),_0x4e38d6=await this[_0x456a52(0x197)](_0x120864),_0x219dcd=_0x13a921[_0x456a52(0x10f)](this['projectDirectory'],this['C'][_0x456a52(0x166)],_0x181af3);await this[_0x456a52(0x14c)](_0x219dcd,{'recursive':!0x0});const _0x4da364=_0x13a921['join'](_0x50d995,_0x2a65bb,_0x4e38d6[_0x456a52(0x146)]+_0x456a52(0x97)),_0x360d7b=_0x13a921['join'](_0x219dcd,_0x4e38d6[_0x456a52(0x146)]+_0x456a52(0x97));await this[_0x456a52(0xbe)](_0x4da364,_0x360d7b);}}async[_0x525cba(0x15f)](){const _0x320881=_0x525cba,_0x4a5154=this['C']['ProcessInitializersReadF'],_0x3a214e=this['C']['ProcessInitializersWriteF'],_0xe3015d=_0x13a921['join'](_0x34e753,this['C'][_0x320881(0x166)],this['config'][_0x320881(0x107)],_0x4a5154),_0x5cfb0b=await this[_0x320881(0x16c)](_0xe3015d,null);for(const _0x35c257 of _0x5cfb0b){const _0x3a6d1a=_0x13a921[_0x320881(0x10f)](_0xe3015d,_0x35c257,_0x35c257+'.yaml');if(!this[_0x320881(0x18a)](_0x3a6d1a))continue;const _0x3729ac=await this['fsReadFile'](_0x3a6d1a,{'encoding':_0x320881(0xd4)}),_0x363e17=await this[_0x320881(0x197)](_0x3729ac),_0x1aac69=_0x13a921[_0x320881(0x10f)](this[_0x320881(0xea)],this['C'][_0x320881(0x166)],_0x3a214e);await this[_0x320881(0x14c)](_0x1aac69,{'recursive':!0x0});const _0x44f44e=_0x13a921[_0x320881(0x10f)](_0xe3015d,_0x35c257,_0x363e17['name']+'.ts'),_0x2af001=_0x13a921[_0x320881(0x10f)](_0x1aac69,_0x363e17[_0x320881(0x146)]+_0x320881(0x97));await this['fsLink'](_0x44f44e,_0x2af001);}}async[_0x525cba(0x1bf)](){const _0x41062d=_0x525cba,_0x286c21=this['C'][_0x41062d(0x89)],_0x1aa8a5=this['C']['ProcessI18NWriteF'],_0x295eee=_0x13a921['join'](_0x34e753,this['C'][_0x41062d(0x166)],this[_0x41062d(0x12a)][_0x41062d(0x107)],_0x286c21),_0x53fc71=await this[_0x41062d(0x16c)](_0x295eee,null);for(const _0x3846cb of _0x53fc71){const _0x52475a=_0x13a921[_0x41062d(0x10f)](_0x295eee,_0x3846cb,_0x3846cb+_0x41062d(0x1bb));if(!this[_0x41062d(0x18a)](_0x52475a))continue;const _0x225c64=await this[_0x41062d(0xd3)](_0x52475a,{'encoding':_0x41062d(0xd4)}),_0x8f74be=await this[_0x41062d(0x197)](_0x225c64),_0x314102=_0x13a921[_0x41062d(0x10f)](this[_0x41062d(0xea)],this['C'][_0x41062d(0x166)],_0x1aa8a5);await this[_0x41062d(0x14c)](_0x314102,{'recursive':!0x0});const _0x46259c=_0x13a921[_0x41062d(0x10f)](_0x295eee,_0x3846cb,_0x8f74be[_0x41062d(0x146)]+_0x41062d(0x97)),_0x4b9de3=_0x13a921[_0x41062d(0x10f)](_0x314102,_0x8f74be[_0x41062d(0x146)]+_0x41062d(0x97));await this[_0x41062d(0xbe)](_0x46259c,_0x4b9de3);}}async['copyDBMastersToAnotherDir'](){const _0x2e1f01=_0x525cba,_0x42fd20=this['C'][_0x2e1f01(0x1ba)],_0x490721=this['C'][_0x2e1f01(0x83)],_0x3dde89=_0x13a921[_0x2e1f01(0x10f)](_0x34e753,this['C'][_0x2e1f01(0x166)],this[_0x2e1f01(0x12a)][_0x2e1f01(0x107)],_0x42fd20),_0x5007f8=await this[_0x2e1f01(0x16c)](_0x3dde89,null);for(const _0x3b9727 of _0x5007f8){const _0x29874e=_0x13a921[_0x2e1f01(0x10f)](_0x3dde89,_0x3b9727,_0x3b9727+_0x2e1f01(0x1bb));if(!this[_0x2e1f01(0x18a)](_0x29874e))continue;const _0x3bd483=await this[_0x2e1f01(0xd3)](_0x29874e,{'encoding':_0x2e1f01(0xd4)}),_0x40babe=await this[_0x2e1f01(0x197)](_0x3bd483),_0x1a9f6c=_0x13a921[_0x2e1f01(0x10f)](this[_0x2e1f01(0xea)],this['C']['src'],_0x490721,_0x40babe[_0x2e1f01(0x146)]);await this[_0x2e1f01(0x14c)](_0x1a9f6c,{'recursive':!0x0});const _0xff3b52=_0x13a921[_0x2e1f01(0x10f)](_0x3dde89,_0x3b9727,_0x40babe[_0x2e1f01(0x146)]+_0x2e1f01(0x97)),_0x5ce676=_0x13a921[_0x2e1f01(0x10f)](_0x1a9f6c,_0x40babe[_0x2e1f01(0x146)]+_0x2e1f01(0x97));await this['fsLink'](_0xff3b52,_0x5ce676);const _0x3bcca1=_0x13a921[_0x2e1f01(0x10f)](_0x3dde89,_0x3b9727,_0x40babe[_0x2e1f01(0x146)]+_0x2e1f01(0x119)),_0x9ea501=_0x13a921[_0x2e1f01(0x10f)](_0x1a9f6c,_0x40babe[_0x2e1f01(0x146)]+'.config.ts');await this[_0x2e1f01(0xbe)](_0x3bcca1,_0x9ea501);}}async[_0x525cba(0x1d2)](){const _0x2905c6=_0x525cba,_0x204118=this['C'][_0x2905c6(0x186)],_0x3531f3=this['C']['DBMasterStylesWriteF'],_0x3e4cb8=_0x13a921[_0x2905c6(0x10f)](_0x34e753,this['C']['src'],this[_0x2905c6(0x12a)][_0x2905c6(0x107)],_0x204118),_0x4a37a9=await this[_0x2905c6(0x16c)](_0x3e4cb8,null);for(const _0x2c43d8 of _0x4a37a9){const _0x14c1db=_0x13a921['join'](_0x3e4cb8,_0x2c43d8,_0x2c43d8+'.yaml');if(!this[_0x2905c6(0x18a)](_0x14c1db))continue;const _0x501875=await this[_0x2905c6(0xd3)](_0x14c1db,{'encoding':_0x2905c6(0xd4)}),_0x50b2ed=await this[_0x2905c6(0x197)](_0x501875),_0x4a0cb1=_0x13a921[_0x2905c6(0x10f)](this[_0x2905c6(0xea)],this['C'][_0x2905c6(0x166)],_0x3531f3);await this[_0x2905c6(0x14c)](_0x4a0cb1,{'recursive':!0x0});const _0x176dc9=_0x13a921[_0x2905c6(0x10f)](_0x3e4cb8,_0x2c43d8,_0x50b2ed[_0x2905c6(0x146)]+'.css'),_0x502f8a=_0x13a921['join'](_0x4a0cb1,_0x50b2ed[_0x2905c6(0x146)]+'.css');await this[_0x2905c6(0xbe)](_0x176dc9,_0x502f8a);}}async[_0x525cba(0xfe)](){const _0x502098=_0x525cba,_0x7b93ca=this['C'][_0x502098(0x172)],_0x1a6475=this['C'][_0x502098(0x15b)],_0x539b20=_0x13a921[_0x502098(0x10f)](_0x34e753,this['C'][_0x502098(0x166)],this[_0x502098(0x12a)][_0x502098(0x107)],_0x7b93ca),_0x202ec2=await this[_0x502098(0x16c)](_0x539b20,null);for(const _0x5cfc17 of _0x202ec2){const _0x162229=_0x13a921['join'](_0x539b20,_0x5cfc17,_0x5cfc17+'.yaml');if(!this['fsExistsSync'](_0x162229))continue;const _0x14cde0=await this['fsReadFile'](_0x162229,{'encoding':_0x502098(0xd4)}),_0x5b9bfa=await this[_0x502098(0x197)](_0x14cde0),_0x1304e3=_0x13a921[_0x502098(0x10f)](this[_0x502098(0xea)],this['C'][_0x502098(0x166)],_0x1a6475);await this[_0x502098(0x14c)](_0x1304e3,{'recursive':!0x0});const _0x4cdded=_0x13a921[_0x502098(0x10f)](_0x539b20,_0x5cfc17,_0x5b9bfa[_0x502098(0x146)]+_0x502098(0x97)),_0x41e3de=_0x13a921[_0x502098(0x10f)](_0x1304e3,_0x5b9bfa[_0x502098(0x146)]+_0x502098(0x97));await this[_0x502098(0xbe)](_0x4cdded,_0x41e3de);}}async[_0x525cba(0x1a4)](){const _0x468ac5=_0x525cba,_0x3a9e82=this['C'][_0x468ac5(0x1ea)],_0xcc0a34=this['C']['TestCasesWriteF'],_0x367483=_0x13a921[_0x468ac5(0x10f)](_0x34e753,this['C'][_0x468ac5(0x166)],this[_0x468ac5(0x12a)][_0x468ac5(0x107)],_0x3a9e82),_0x1bd33c=await this[_0x468ac5(0x16c)](_0x367483,null);for(const _0x37dbe3 of _0x1bd33c){const _0x3c1bb6=_0x13a921[_0x468ac5(0x10f)](_0x367483,_0x37dbe3,_0x37dbe3+'.yaml');if(!this['fsExistsSync'](_0x3c1bb6))continue;const _0x141621=await this['fsReadFile'](_0x3c1bb6,{'encoding':_0x468ac5(0xd4)}),_0x17b78a=await this[_0x468ac5(0x197)](_0x141621),_0x2621ad=_0x13a921[_0x468ac5(0x10f)](this['projectDirectory'],this['C'][_0x468ac5(0x166)],_0xcc0a34);await this[_0x468ac5(0x14c)](_0x2621ad,{'recursive':!0x0});const _0x3109c3=_0x13a921[_0x468ac5(0x10f)](_0x367483,_0x37dbe3,_0x17b78a[_0x468ac5(0x146)]+_0x468ac5(0x97)),_0xea96fe=_0x13a921[_0x468ac5(0x10f)](_0x2621ad,_0x17b78a[_0x468ac5(0x146)]+'.ts');await this[_0x468ac5(0xbe)](_0x3109c3,_0xea96fe);}}async['copyThirdPartyApisToAnotherDir'](){const _0x21ec64=_0x525cba,_0x2e9def=this['C'][_0x21ec64(0xb3)],_0x2bc752=this['C'][_0x21ec64(0x1cd)],_0x35a566=_0x13a921[_0x21ec64(0x10f)](_0x34e753,this['C']['src'],this[_0x21ec64(0x12a)][_0x21ec64(0x107)],_0x2e9def);if(!this[_0x21ec64(0x18a)](_0x35a566))return;const _0x42bf80=await this[_0x21ec64(0x16c)](_0x35a566,null);for(const _0x57ccd6 of _0x42bf80){const _0x1a24ae=_0x13a921[_0x21ec64(0x10f)](_0x35a566,_0x57ccd6,this['C'][_0x21ec64(0x102)]),_0x5cfd0a=await this[_0x21ec64(0x16c)](_0x1a24ae,null);for(const _0x553ed2 of _0x5cfd0a){const _0x49ecca=_0x13a921['join'](_0x1a24ae,_0x553ed2,_0x553ed2+'.yaml');if(!this['fsExistsSync'](_0x49ecca))continue;const _0x1cd20f=await this[_0x21ec64(0xd3)](_0x49ecca,{'encoding':_0x21ec64(0xd4)}),_0x3cfaa8=await this[_0x21ec64(0x197)](_0x1cd20f);for(const _0x221f56 of _0x3cfaa8[_0x21ec64(0x120)]||[])if(!0x0===_0x221f56[_0x21ec64(0xf3)]){const _0x4aef48=_0x13a921[_0x21ec64(0x10f)](_0x1a24ae,_0x553ed2,this['C'][_0x21ec64(0x120)],_0x221f56[_0x21ec64(0x183)]),_0x140935=_0x13a921[_0x21ec64(0x10f)](_0x4aef48,_0x221f56['name']+_0x21ec64(0x97)),_0x184e8a=_0x13a921[_0x21ec64(0x10f)](this[_0x21ec64(0xea)],this['C'][_0x21ec64(0x166)],_0x2bc752,_0x57ccd6,_0x3cfaa8['path'],_0x3cfaa8[_0x21ec64(0x146)]+_0x21ec64(0x97));await this['fsMkDir'](_0x13a921['dirname'](_0x184e8a),{'recursive':!0x0}),await this[_0x21ec64(0xbe)](_0x140935,_0x184e8a);const _0x1c6ba1=_0x13a921[_0x21ec64(0x10f)](_0x1a24ae,_0x553ed2,_0x553ed2+_0x21ec64(0x119)),_0xe65370=_0x13a921[_0x21ec64(0x10f)](this['projectDirectory'],this['C'][_0x21ec64(0x166)],_0x2bc752,_0x57ccd6,_0x3cfaa8['path'],_0x3cfaa8['name']+_0x21ec64(0x119));await this[_0x21ec64(0xbe)](_0x1c6ba1,_0xe65370);for(const _0x2c1cbe of _0x221f56[_0x21ec64(0x130)]){const _0x4d6927=_0x13a921[_0x21ec64(0x10f)](_0x4aef48,this['C'][_0x21ec64(0x130)],_0x2c1cbe[_0x21ec64(0x146)]+_0x21ec64(0x97)),_0x2d5a91=_0x13a921[_0x21ec64(0x10f)](this[_0x21ec64(0xea)],this['C'][_0x21ec64(0x166)],_0x2bc752,_0x57ccd6,_0x3cfaa8[_0x21ec64(0xf7)],this['C']['preHooks'],_0x2c1cbe['name']+_0x21ec64(0x97));await this['fsMkDir'](_0x13a921['dirname'](_0x2d5a91),{'recursive':!0x0}),await this['fsLink'](_0x4d6927,_0x2d5a91);}for(const _0x79c3e4 of _0x221f56['postHooks']){const _0x20e476=_0x13a921[_0x21ec64(0x10f)](_0x4aef48,this['C'][_0x21ec64(0x1b0)],_0x79c3e4[_0x21ec64(0x146)]+_0x21ec64(0x97)),_0x2a19d3=_0x13a921['join'](this[_0x21ec64(0xea)],this['C'][_0x21ec64(0x166)],_0x2bc752,_0x57ccd6,_0x3cfaa8[_0x21ec64(0xf7)],this['C'][_0x21ec64(0x1b0)],_0x79c3e4[_0x21ec64(0x146)]+_0x21ec64(0x97));await this['fsMkDir'](_0x13a921[_0x21ec64(0xe7)](_0x2a19d3),{'recursive':!0x0}),await this['fsLink'](_0x20e476,_0x2a19d3);}}}}}async['copyEventsToAnotherDir'](){const _0x31a6af=_0x525cba,_0x5983bd=this['C']['EventsReadF'],_0x5bb4a4=this['C'][_0x31a6af(0xbc)],_0x39d6c5=_0x13a921[_0x31a6af(0x10f)](_0x34e753,this['C'][_0x31a6af(0x166)],this[_0x31a6af(0x12a)]['adminUserPath'],_0x5983bd),_0x251b84=await this[_0x31a6af(0x16c)](_0x39d6c5,null);for(const _0x159cd8 of _0x251b84){const _0x2742de=_0x13a921[_0x31a6af(0x10f)](_0x39d6c5,_0x159cd8,_0x159cd8+_0x31a6af(0x1bb));if(!this[_0x31a6af(0x18a)](_0x2742de))continue;const _0x57ae83=await this[_0x31a6af(0xd3)](_0x2742de,{'encoding':'utf8'}),_0x330684=await this[_0x31a6af(0x197)](_0x57ae83),_0x1bc4f6=_0x13a921['join'](_0x39d6c5,_0x159cd8,this['C'][_0x31a6af(0x1b1)]);for(const _0x3a889d of _0x330684[_0x31a6af(0xe6)])for(const _0x399fc0 of _0x3a889d[_0x31a6af(0x120)]||[])if(!0x0===_0x399fc0[_0x31a6af(0xf3)]){const _0x719597=_0x13a921['join'](_0x1bc4f6,_0x3a889d['name'],this['C']['versions'],_0x399fc0[_0x31a6af(0x183)],_0x399fc0[_0x31a6af(0x146)]+_0x31a6af(0x97)),_0x11cc4e=_0x13a921[_0x31a6af(0x10f)](this['projectDirectory'],this['C'][_0x31a6af(0x166)],_0x5bb4a4,_0x330684['name'],_0x3a889d[_0x31a6af(0x146)]+_0x31a6af(0x97));await this[_0x31a6af(0x14c)](_0x13a921[_0x31a6af(0xe7)](_0x11cc4e),{'recursive':!0x0}),await this[_0x31a6af(0xbe)](_0x719597,_0x11cc4e);}}}async[_0x525cba(0x1e8)](){const _0x1ba833=_0x525cba,_0x4752e4=this['C'][_0x1ba833(0xe5)],_0x138f9d=this['C'][_0x1ba833(0x199)],_0x38db84=_0x13a921[_0x1ba833(0x10f)](_0x34e753,this['C']['src'],this[_0x1ba833(0x12a)][_0x1ba833(0x107)],_0x4752e4),_0x401239=await this[_0x1ba833(0x16c)](_0x38db84,null);for(const _0xb970cb of _0x401239){const _0x110a5a=_0x13a921[_0x1ba833(0x10f)](_0x38db84,_0xb970cb,_0xb970cb+'.yaml');if(!this[_0x1ba833(0x18a)](_0x110a5a))continue;const _0x1aa3e2=await this[_0x1ba833(0xd3)](_0x110a5a,{'encoding':'utf8'}),_0x20ce35=await this['parseYaml'](_0x1aa3e2),_0xe26ea=_0x13a921[_0x1ba833(0x10f)](_0x38db84,_0xb970cb),_0x2821ee=_0x20ce35[_0x1ba833(0x106)]+'/'+_0x20ce35[_0x1ba833(0x189)]+'/'+_0x20ce35['collectionName']+'/'+_0x20ce35['apiId'][_0x1ba833(0x177)]();for(const _0x45cdcb of _0x20ce35[_0x1ba833(0x130)]){const _0xaa2c91=_0x13a921[_0x1ba833(0x10f)](_0xe26ea,this['C']['preHooks'],_0x45cdcb[_0x1ba833(0x146)]+_0x1ba833(0x97)),_0x5e4318=_0x13a921[_0x1ba833(0x10f)](this['projectDirectory'],this['C']['src'],_0x138f9d,_0x2821ee,this['C'][_0x1ba833(0x130)],_0x45cdcb['name']+_0x1ba833(0x97));await this[_0x1ba833(0x14c)](_0x13a921['dirname'](_0x5e4318),{'recursive':!0x0}),await this[_0x1ba833(0xbe)](_0xaa2c91,_0x5e4318);}for(const _0x18c431 of _0x20ce35['postHooks']){const _0x9e997b=_0x13a921[_0x1ba833(0x10f)](_0xe26ea,this['C']['postHooks'],_0x18c431[_0x1ba833(0x146)]+_0x1ba833(0x97)),_0x3883c5=_0x13a921[_0x1ba833(0x10f)](this[_0x1ba833(0xea)],this['C'][_0x1ba833(0x166)],_0x138f9d,_0x2821ee,this['C']['postHooks'],_0x18c431[_0x1ba833(0x146)]+_0x1ba833(0x97));await this[_0x1ba833(0x14c)](_0x13a921[_0x1ba833(0xe7)](_0x3883c5),{'recursive':!0x0}),await this[_0x1ba833(0xbe)](_0x9e997b,_0x3883c5);}}}async[_0x525cba(0x17a)](){const _0xc06c3=_0x525cba,_0x3508b0=this['C'][_0xc06c3(0xec)],_0x53345c=this['C'][_0xc06c3(0x157)],_0x4cb332=_0x13a921[_0xc06c3(0x10f)](_0x34e753,this['C'][_0xc06c3(0x166)],this[_0xc06c3(0x12a)][_0xc06c3(0x107)],_0x3508b0),_0x15b1fe=await this[_0xc06c3(0x16c)](_0x4cb332,null);for(const _0x74e9d0 of _0x15b1fe){const _0x3c42bf=_0x13a921[_0xc06c3(0x10f)](_0x4cb332,_0x74e9d0,_0x74e9d0+'.yaml');if(!this[_0xc06c3(0x18a)](_0x3c42bf))continue;const _0x139c4c=await this['fsReadFile'](_0x3c42bf,{'encoding':'utf8'}),_0x36f7e3=await this[_0xc06c3(0x197)](_0x139c4c),_0x534577=_0x13a921[_0xc06c3(0x10f)](_0x4cb332,_0x74e9d0),_0x1adc33=_0x36f7e3[_0xc06c3(0x128)][_0xc06c3(0x177)]();for(const _0xda84b of _0x36f7e3['preHooks']){const _0x2168a1=_0x13a921[_0xc06c3(0x10f)](_0x534577,this['C']['preHooks'],_0xda84b[_0xc06c3(0x146)]+_0xc06c3(0x97)),_0xa76075=_0x13a921[_0xc06c3(0x10f)](this['projectDirectory'],this['C'][_0xc06c3(0x166)],_0x53345c,_0x1adc33,this['C']['preHooks'],_0xda84b[_0xc06c3(0x146)]+_0xc06c3(0x97));await this[_0xc06c3(0x14c)](_0x13a921['dirname'](_0xa76075),{'recursive':!0x0}),await this[_0xc06c3(0xbe)](_0x2168a1,_0xa76075);}for(const _0x15721b of _0x36f7e3[_0xc06c3(0x1b0)]){const _0x34e9c0=_0x13a921[_0xc06c3(0x10f)](_0x534577,this['C']['postHooks'],_0x15721b[_0xc06c3(0x146)]+_0xc06c3(0x97)),_0x3d8f6c=_0x13a921[_0xc06c3(0x10f)](this[_0xc06c3(0xea)],this['C'][_0xc06c3(0x166)],_0x53345c,_0x1adc33,this['C'][_0xc06c3(0x1b0)],_0x15721b[_0xc06c3(0x146)]+_0xc06c3(0x97));await this[_0xc06c3(0x14c)](_0x13a921[_0xc06c3(0xe7)](_0x3d8f6c),{'recursive':!0x0}),await this[_0xc06c3(0xbe)](_0x34e9c0,_0x3d8f6c);}}}async[_0x525cba(0xf4)](){const _0x4c03e0=_0x525cba,_0x58bfea=this['C'][_0x4c03e0(0x134)],_0x30fd3b=this['C'][_0x4c03e0(0x1d0)],_0x4c80b0=_0x13a921[_0x4c03e0(0x10f)](_0x34e753,this['C']['src'],this['config'][_0x4c03e0(0x107)],_0x58bfea),_0x301a61=await this[_0x4c03e0(0x16c)](_0x4c80b0,null);for(const _0x225b96 of _0x301a61){const _0x982f16=_0x13a921[_0x4c03e0(0x10f)](_0x4c80b0,_0x225b96,_0x225b96+_0x4c03e0(0x1bb));if(!this[_0x4c03e0(0x18a)](_0x982f16))continue;const _0x4ee085=await this[_0x4c03e0(0xd3)](_0x982f16,{'encoding':'utf8'}),_0x4d1d21=await this['parseYaml'](_0x4ee085);for(const _0x4128e3 of _0x4d1d21[_0x4c03e0(0x120)]||[])if(!0x0===_0x4128e3[_0x4c03e0(0xf3)]){const _0x50cd14=_0x13a921[_0x4c03e0(0x10f)](_0x4c80b0,_0x225b96,this['C'][_0x4c03e0(0x120)],_0x4128e3[_0x4c03e0(0x183)],_0x4128e3[_0x4c03e0(0x146)]+_0x4c03e0(0x97));let _0xb2c6f2='',_0x4f4668='';_0x4d1d21[_0x4c03e0(0x1ab)]===_0x538f72[_0x4c03e0(0x1ad)]?(_0x4f4668=_0x4c03e0(0x1e5),_0xb2c6f2=_0x4d1d21[_0x4c03e0(0x106)]+'/'+_0x4d1d21['databaseName']+'/'+_0x4d1d21[_0x4c03e0(0xa3)]+'/'+_0x4d1d21[_0x4c03e0(0x15a)]['toLowerCase']()):_0x4d1d21[_0x4c03e0(0x1ab)]===_0x538f72[_0x4c03e0(0x84)]?(_0x4f4668=_0x4c03e0(0x1a8),_0xb2c6f2=_0x4d1d21[_0x4c03e0(0xc9)]+'/'+_0x4d1d21[_0x4c03e0(0x182)]):_0x4d1d21[_0x4c03e0(0x1ab)]===_0x538f72[_0x4c03e0(0x96)]?(_0x4f4668=_0x4c03e0(0x90),_0xb2c6f2=_0x4d1d21[_0x4c03e0(0x153)]):_0x4d1d21[_0x4c03e0(0x1ab)]===_0x538f72[_0x4c03e0(0x13a)]?(_0x4f4668=_0x4c03e0(0xcd),_0xb2c6f2=_0x4d1d21['systemApiName']['toLowerCase']()):_0x4d1d21[_0x4c03e0(0x1ab)]===_0x538f72[_0x4c03e0(0x1db)]&&(_0x4f4668=_0x4c03e0(0x1a9),_0xb2c6f2=_0x4d1d21[_0x4c03e0(0x146)]);const _0xde3179=_0x13a921['join'](this['projectDirectory'],this['C'][_0x4c03e0(0x166)],_0x30fd3b,_0x4f4668,_0xb2c6f2+'.ts');await this[_0x4c03e0(0x14c)](_0x13a921[_0x4c03e0(0xe7)](_0xde3179),{'recursive':!0x0}),await this[_0x4c03e0(0xbe)](_0x50cd14,_0xde3179);}}}async[_0x525cba(0x11b)](){const _0x249275=_0x525cba,_0x553d8a=this['C'][_0x249275(0x103)],_0x466f1b=this['C'][_0x249275(0x180)],_0x2d9b13=_0x13a921[_0x249275(0x10f)](_0x34e753,this['C'][_0x249275(0x166)],this[_0x249275(0x12a)][_0x249275(0x107)],_0x553d8a),_0xb80201=await this['readDirCustom'](_0x2d9b13,null);for(const _0x5aec9a of _0xb80201){const _0x557597=_0x13a921[_0x249275(0x10f)](_0x2d9b13,_0x5aec9a,_0x5aec9a+_0x249275(0x1bb));if(!this[_0x249275(0x18a)](_0x557597))continue;const _0x2a94df=await this['fsReadFile'](_0x557597,{'encoding':'utf8'}),_0x24a4b5=await this['parseYaml'](_0x2a94df),_0x4303b3=_0x13a921['join'](_0x2d9b13,_0x5aec9a),_0x8f2c0=_0x24a4b5[_0x249275(0x106)]+'/'+_0x24a4b5[_0x249275(0x189)]+'/'+_0x24a4b5['collectionName'];for(const _0xc8e74f of _0x24a4b5[_0x249275(0x130)]){const _0x55ae63=_0x13a921['join'](_0x4303b3,this['C'][_0x249275(0x130)],_0xc8e74f[_0x249275(0x146)]+_0x249275(0x97)),_0x2e0759=_0x13a921[_0x249275(0x10f)](this[_0x249275(0xea)],this['C'][_0x249275(0x166)],_0x466f1b,_0x8f2c0,this['C']['preHooks'],_0xc8e74f[_0x249275(0x146)]+_0x249275(0x97));await this[_0x249275(0x14c)](_0x13a921['dirname'](_0x2e0759),{'recursive':!0x0}),await this[_0x249275(0xbe)](_0x55ae63,_0x2e0759);}for(const _0x30662a of _0x24a4b5['postHooks']){const _0x19bd40=_0x13a921['join'](_0x4303b3,this['C'][_0x249275(0x1b0)],_0x30662a[_0x249275(0x146)]+_0x249275(0x97)),_0x5389e9=_0x13a921['join'](this[_0x249275(0xea)],this['C'][_0x249275(0x166)],_0x466f1b,_0x8f2c0,this['C']['postHooks'],_0x30662a['name']+'.ts');await this[_0x249275(0x14c)](_0x13a921[_0x249275(0xe7)](_0x5389e9),{'recursive':!0x0}),await this['fsLink'](_0x19bd40,_0x5389e9);}}}async['copyDatabaseHooksToAnotherDir'](){const _0xa62e43=_0x525cba,_0x278f4b=this['C']['DatabaseHooksReadF'],_0x1e46ba=this['C'][_0xa62e43(0x1b5)],_0x5cf281=_0x13a921['join'](_0x34e753,this['C'][_0xa62e43(0x166)],this['config'][_0xa62e43(0x107)],_0x278f4b),_0x43b1a5=await this[_0xa62e43(0x16c)](_0x5cf281,null);for(const _0x47ed38 of _0x43b1a5){const _0x53b7b3=_0x13a921['join'](_0x5cf281,_0x47ed38,_0x47ed38+_0xa62e43(0x1bb));if(!this[_0xa62e43(0x18a)](_0x53b7b3))continue;const _0x2cd1cc=await this[_0xa62e43(0xd3)](_0x53b7b3,{'encoding':_0xa62e43(0xd4)}),_0x68c07c=await this[_0xa62e43(0x197)](_0x2cd1cc),_0xb4dfa0=_0x13a921[_0xa62e43(0x10f)](_0x5cf281,_0x47ed38),_0x15848c=_0x68c07c['instanceName']+'/'+_0x68c07c['databaseName'];for(const _0x2c0d93 of _0x68c07c['preHooks']){const _0x1aa725=_0x13a921[_0xa62e43(0x10f)](_0xb4dfa0,this['C'][_0xa62e43(0x130)],_0x2c0d93['name']+_0xa62e43(0x97)),_0x2fa981=_0x13a921[_0xa62e43(0x10f)](this[_0xa62e43(0xea)],this['C'][_0xa62e43(0x166)],_0x1e46ba,_0x15848c,this['C']['preHooks'],_0x2c0d93[_0xa62e43(0x146)]+_0xa62e43(0x97));await this[_0xa62e43(0x14c)](_0x13a921['dirname'](_0x2fa981),{'recursive':!0x0}),await this[_0xa62e43(0xbe)](_0x1aa725,_0x2fa981);}for(const _0x15881b of _0x68c07c[_0xa62e43(0x1b0)]){const _0x4ddc08=_0x13a921[_0xa62e43(0x10f)](_0xb4dfa0,this['C'][_0xa62e43(0x1b0)],_0x15881b[_0xa62e43(0x146)]+_0xa62e43(0x97)),_0x5a39a7=_0x13a921[_0xa62e43(0x10f)](this['projectDirectory'],this['C'][_0xa62e43(0x166)],_0x1e46ba,_0x15848c,this['C'][_0xa62e43(0x1b0)],_0x15881b[_0xa62e43(0x146)]+_0xa62e43(0x97));await this[_0xa62e43(0x14c)](_0x13a921['dirname'](_0x5a39a7),{'recursive':!0x0}),await this[_0xa62e43(0xbe)](_0x4ddc08,_0x5a39a7);}}}async[_0x525cba(0xd2)](){const _0x2011ce=_0x525cba,_0x558edb=this['C'][_0x2011ce(0x1cc)],_0x1de5ea=this['C'][_0x2011ce(0x1c9)],_0xd032ca=_0x13a921['join'](_0x34e753,this['C'][_0x2011ce(0x166)],this[_0x2011ce(0x12a)][_0x2011ce(0x107)],_0x558edb),_0x1f255f=await this[_0x2011ce(0x16c)](_0xd032ca,null);for(const _0x4a2331 of _0x1f255f){const _0xf3ed51=_0x13a921[_0x2011ce(0x10f)](_0xd032ca,_0x4a2331,_0x4a2331+_0x2011ce(0x1bb));if(!this[_0x2011ce(0x18a)](_0xf3ed51))continue;const _0x10b576=await this[_0x2011ce(0xd3)](_0xf3ed51,{'encoding':_0x2011ce(0xd4)}),_0x2e023e=await this[_0x2011ce(0x197)](_0x10b576),_0x2143a0=_0x13a921[_0x2011ce(0x10f)](_0xd032ca,_0x4a2331),_0x18fd34=''+_0x2e023e[_0x2011ce(0x106)];for(const _0x3f5b2e of _0x2e023e['preHooks']){const _0x559e79=_0x13a921['join'](_0x2143a0,this['C'][_0x2011ce(0x130)],_0x3f5b2e[_0x2011ce(0x146)]+'.ts'),_0x57cbef=_0x13a921[_0x2011ce(0x10f)](this[_0x2011ce(0xea)],this['C'][_0x2011ce(0x166)],_0x1de5ea,_0x18fd34,this['C'][_0x2011ce(0x130)],_0x3f5b2e[_0x2011ce(0x146)]+_0x2011ce(0x97));await this['fsMkDir'](_0x13a921[_0x2011ce(0xe7)](_0x57cbef),{'recursive':!0x0}),await this[_0x2011ce(0xbe)](_0x559e79,_0x57cbef);}for(const _0x3a4525 of _0x2e023e[_0x2011ce(0x1b0)]){const _0x2305c4=_0x13a921['join'](_0x2143a0,this['C'][_0x2011ce(0x1b0)],_0x3a4525[_0x2011ce(0x146)]+'.ts'),_0x33f407=_0x13a921['join'](this[_0x2011ce(0xea)],this['C']['src'],_0x1de5ea,_0x18fd34,this['C']['postHooks'],_0x3a4525[_0x2011ce(0x146)]+'.ts');await this[_0x2011ce(0x14c)](_0x13a921[_0x2011ce(0xe7)](_0x33f407),{'recursive':!0x0}),await this['fsLink'](_0x2305c4,_0x33f407);}}}async[_0x525cba(0xfd)](_0x2698f9,_0x16bc3d){return new Promise((_0x300cad,_0x32052b)=>{const _0x3e6b63=a0_0x4c1c,_0x415867=(0x0,_0x15a12d[_0x3e6b63(0xf2)])(_0x2698f9,_0x16bc3d,{'shell':!0x0,'cwd':_0x34e753});_0x415867['on'](_0x3e6b63(0xd6),_0x4ad958=>{const _0x1f269f=_0x3e6b63;if(0x0===_0x4ad958)setTimeout(_0x300cad,0x1f4);else{const _0x23f1e4='\x27'+_0x2698f9+'\x20'+_0x16bc3d[_0x1f269f(0x10f)]('\x20')+'\x27\x20exited\x20with\x20code\x20'+_0x4ad958+'.';_0x32052b(new Error(_0x23f1e4));}}),_0x415867['on']('error',_0x4ba442=>{const _0x1e2458=_0x3e6b63;console[_0x1e2458(0x101)](_0x1e2458(0x1c2)+_0x4ba442[_0x1e2458(0x9f)]),_0x32052b(_0x4ba442);});});}async[_0x525cba(0x197)](_0x5d0295){const _0x3fa1e5=_0x525cba;return _0x414903(0x2f8)[_0x3fa1e5(0x10b)](_0x5d0295);}[_0x525cba(0x1ac)](){const _0x426417=_0x525cba,_0x1ef0ca=_0x414903(0x274),_0xadbe0a=_0x13a921['join'](_0x34e753),_0x2be8a1=_0x13a921[_0x426417(0x10f)](_0x34e753,this['C'][_0x426417(0x166)]),_0x2bf95a=_0x468972=>{const _0xb03f1c=_0x426417,_0x1dffd4=_0x13a921['relative'](_0xadbe0a,_0x468972);return!(_0x1dffd4&&!_0x1dffd4['startsWith']('.')&&!_0x1dffd4['endsWith']('~')&&_0x1dffd4[_0xb03f1c(0xda)](this['C'][_0xb03f1c(0x166)]));},_0x338661=_0x1ef0ca[_0x426417(0x144)](_0x2be8a1,{'persistent':!0x0,'ignoreInitial':!0x0,'depth':0x1/0x0,'awaitWriteFinish':{'stabilityThreshold':0xc8,'pollInterval':0x64}}),_0x2c2be6=async(_0x1affd1,_0x128692)=>{const _0x1eca56=_0x426417;try{if(this[_0x1eca56(0x123)])return;const _0x1ff8ff=_0x13a921[_0x1eca56(0x18e)](_0xadbe0a,_0x128692);if(!_0x128692||_0x2bf95a(_0x128692))return;console['log'](_0x1eca56(0x1d6)+this['getCurrentTime']()+_0x1eca56(0x174)+_0x1affd1+_0x1eca56(0xcc)+_0x1ff8ff);const _0x434108=this['getCategoryOfPath'](_0x1ff8ff),_0x493235=this[_0x1eca56(0x17c)](_0x434108,_0x1ff8ff);if(!_0x493235)return;let _0x49533b,_0x32dd36=!0x1;if(this[_0x1eca56(0x18a)](_0x493235)){if(this[_0x1eca56(0x18a)](_0x13a921[_0x1eca56(0x10f)](_0xadbe0a,_0x1ff8ff))){const _0x314f8e=_0x13a921[_0x1eca56(0x10f)](_0x13a921['sep']+this['C'][_0x1eca56(0x8b)],_0x493235);_0x49533b=await this[_0x1eca56(0xd1)](_0x493235,_0x314f8e),this[_0x1eca56(0xc7)]({'objType':_0x30106e[_0x1eca56(0x12b)],'localClientWSReqRes':{'eventType':_0x23e227['LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM'],'folderChangedOnLocalSystem':_0x49533b,'category':_0x434108,'shouldReplaceAllItemsOfCategory':_0x32dd36}});}else this[_0x1eca56(0x178)]();}else{const _0x165a82=this[_0x1eca56(0x104)](_0x434108,_0x1ff8ff),_0x1a9655=_0x13a921['join'](_0x13a921[_0x1eca56(0x154)]+this['C'][_0x1eca56(0x8b)],_0x165a82);_0x49533b=await this[_0x1eca56(0xd1)](_0x165a82,_0x1a9655),_0x32dd36=!0x0,this['sendDeletedEventToServerDebounce'](_0x49533b,_0x434108,_0x32dd36);}}catch(_0x3096e5){console[_0x1eca56(0x101)](_0x1eca56(0x18c),_0x3096e5);}};_0x338661['on']('add',_0x548d2a=>_0x2c2be6(_0x426417(0x122),_0x548d2a))['on'](_0x426417(0x1b4),_0x1b0a34=>_0x2c2be6(_0x426417(0x1b4),_0x1b0a34))['on'](_0x426417(0x124),_0x50480e=>_0x2c2be6(_0x426417(0x124),_0x50480e))['on'](_0x426417(0x1b8),_0x7acf1c=>_0x2c2be6(_0x426417(0x1b8),_0x7acf1c))['on'](_0x426417(0xbd),_0x48acb1=>_0x2c2be6(_0x426417(0xbd),_0x48acb1))['on']('error',_0x5550a7=>console[_0x426417(0x101)](_0x426417(0x13e),_0x5550a7)),this[_0x426417(0x113)]=_0x338661,console[_0x426417(0xfb)](_0x426417(0x16e));}['getCurrentTime'](){const _0x4d5513=_0x525cba,_0x27a0fe=new Date();return String(_0x27a0fe[_0x4d5513(0x137)]())[_0x4d5513(0x98)](0x2,'0')+':'+String(_0x27a0fe[_0x4d5513(0x1ae)]())[_0x4d5513(0x98)](0x2,'0')+':'+String(_0x27a0fe[_0x4d5513(0x138)]())[_0x4d5513(0x98)](0x2,'0');}[_0x525cba(0x1eb)](_0x2235fd,_0x560523,_0x119419){const _0xfc2567=_0x525cba;this[_0xfc2567(0xc7)]({'objType':_0x30106e[_0xfc2567(0x12b)],'localClientWSReqRes':{'eventType':_0x23e227[_0xfc2567(0x8c)],'folderChangedOnLocalSystem':_0x2235fd,'category':_0x560523,'shouldReplaceAllItemsOfCategory':_0x119419}});}[_0x525cba(0x125)](_0x46999a,_0x57b783){let _0x4a661e=null;return function(..._0x58e6ed){clearTimeout(_0x4a661e),_0x4a661e=setTimeout(()=>{const _0xbcbbe1=a0_0x4c1c;_0x46999a[_0xbcbbe1(0xc4)](this,_0x58e6ed);},_0x57b783);};}[_0x525cba(0x12f)](_0xc43ab2){const _0x5e5fbf=_0x525cba,_0x481f39=_0x13a921[_0x5e5fbf(0x10f)](this['C'][_0x5e5fbf(0x166)],this[_0x5e5fbf(0x12a)][_0x5e5fbf(0x107)]);if(!_0xc43ab2['startsWith'](_0x481f39))return;const _0xf1a94d=_0xc43ab2[_0x5e5fbf(0x195)](_0x13a921['sep'])[_0x5e5fbf(0xa9)](_0x3e0318=>!!_0x3e0318)[0x2];for(const _0xe480bd in _0x2f378f)if(_0x2f378f[_0xe480bd]===_0xf1a94d)return _0xf1a94d;}['getChangedFolder'](_0x4edba8,_0x192924){const _0x12d57b=_0x525cba,_0x2436ff=_0x192924[_0x12d57b(0x195)](_0x13a921[_0x12d57b(0x154)]);let _0x1244c3='';return _0x1244c3=_0x4edba8===_0x2f378f[_0x12d57b(0x84)]?_0x2436ff[_0x12d57b(0x14f)](0x0,0x6)[_0x12d57b(0x10f)](_0x13a921[_0x12d57b(0x154)]):_0x2436ff['slice'](0x0,0x4)[_0x12d57b(0x10f)](_0x13a921[_0x12d57b(0x154)]),_0x1244c3;}['getChangedFolderForDeleted'](_0x242cbc,_0x22779a){const _0x20ab79=_0x525cba;return _0x22779a['split'](_0x13a921[_0x20ab79(0x154)])[_0x20ab79(0x14f)](0x0,0x3)[_0x20ab79(0x10f)](_0x13a921['sep']);}async['serializeFolderWithBinary'](_0x3a29be,_0x378d78){const _0x328295={},_0x2c4e38=this;return await async function _0x3a88b3(_0x9dbdca){const _0x43d0d8=a0_0x4c1c,_0x3a807e=await _0x2c4e38[_0x43d0d8(0x16c)](_0x9dbdca,{'withFileTypes':!0x0});for(const _0x19679e of _0x3a807e){const _0x158090=_0x13a921[_0x43d0d8(0x10f)](_0x9dbdca,_0x19679e[_0x43d0d8(0x146)]),_0x2d54f8=_0x13a921[_0x43d0d8(0x1de)](_0x158090);if(_0x19679e['isDirectory']())await _0x3a88b3(_0x2d54f8);else{const _0x34a590=_0x1c99e6[_0x43d0d8(0x136)](_0x2d54f8),_0x433eec=_0x13a921[_0x43d0d8(0x18e)](_0x3a29be,_0x2d54f8),_0x2db17d=_0x13a921[_0x43d0d8(0x10f)](_0x378d78,_0x433eec)[_0x43d0d8(0x195)](_0x13a921[_0x43d0d8(0x154)])['join'](_0x13a921['posix'][_0x43d0d8(0x154)]);_0x328295[_0x2db17d]={'encoding':_0x43d0d8(0x187),'content':_0x34a590['toString'](_0x43d0d8(0x187))};}}}(_0x3a29be),_0x328295;}[_0x525cba(0xc7)](_0x1972dd){const _0xaab589=_0x525cba;try{this['ws'][_0xaab589(0x192)](JSON['stringify'](_0x1972dd));}catch(_0x388d93){console[_0xaab589(0xfb)](_0x388d93);}}async[_0x525cba(0xa4)](){const _0x476754=_0x525cba;console[_0x476754(0xfb)](_0x476754(0x131));const _0x26684d=this['config'][_0x476754(0x11e)],_0x4b48da=this[_0x476754(0x12a)][_0x476754(0x107)],_0x41c33b=this[_0x476754(0x12a)][_0x476754(0x11a)];this['ws']=new WebSocket(_0x41c33b+_0x476754(0x8f)+_0x26684d+_0x476754(0x1b3)+_0x4b48da);const _0x4d4992=[],_0x3775be=()=>{const _0x749c=_0x476754;this['sendToServer']({'objType':_0x30106e[_0x749c(0xb1)],'onEvents':[{'eventType':_0x749c(0x155)}]});};function _0x57aa80(_0xb6a327){const _0x18f82a=_0x476754;_0xb6a327[_0x18f82a(0xf1)]=null,_0xb6a327[_0x18f82a(0x181)]=null,_0xb6a327[_0x18f82a(0x11c)]=null,_0xb6a327[_0x18f82a(0xe2)]=null,_0xb6a327[_0x18f82a(0xd6)]();}this['ws'][_0x476754(0x181)]=async _0x278cf9=>{const _0x56536e=_0x476754,_0x3cad09=JSON[_0x56536e(0x10d)](_0x278cf9[_0x56536e(0xad)]);if(_0x3cad09[_0x56536e(0x176)]===_0x30106e[_0x56536e(0xe1)]&&_0x3cad09[_0x56536e(0x171)][_0x56536e(0x1c1)])_0x3775be();else{if(_0x3cad09[_0x56536e(0x176)]===_0x30106e[_0x56536e(0xb1)]){if(_0x3cad09?.['response']?.[_0x56536e(0xc6)]?.['length']){for(const _0xea0a1c of _0x3cad09['response'][_0x56536e(0xc6)])_0x4d4992['push'](_0xea0a1c);console[_0x56536e(0xfb)](_0x56536e(0x1a6)),!0x1===this[_0x56536e(0x135)]&&(this['isWSConnectedFirstTime']=!0x0,console[_0x56536e(0xfb)](this[_0x56536e(0x1af)]+_0x56536e(0x88)+this[_0x56536e(0xea)]+this[_0x56536e(0x160)])),this['syncAllDataWithServer']();}else{const _0xb3ef62=_0x3cad09['response']?.[_0x56536e(0x92)]?.[0x0]?.[_0x56536e(0x133)]?.[0x0]?.[_0x56536e(0x9f)]||_0x56536e(0x150);console[_0x56536e(0xfb)]('❌\x20'+_0xb3ef62),await this[_0x56536e(0x188)](0x1);}}else await this['processReceivedEvent'](_0x3cad09);}},this['ws'][_0x476754(0xe2)]=_0x4ecd1c=>{const _0x221294=_0x476754;console['log']('Connection\x20closed.'),_0x57aa80(this['ws']),setTimeout(this['connectToServerViaWS'][_0x221294(0x19a)](this),0xbb8);},this['ws'][_0x476754(0x11c)]=()=>{const _0xc3c066=_0x476754;_0x57aa80(this['ws']),setTimeout(this[_0xc3c066(0xa4)]['bind'](this),0xbb8);};}[_0x525cba(0x178)](){const _0x107ed0=_0x525cba;this[_0x107ed0(0xc7)]({'objType':_0x30106e[_0x107ed0(0x12b)],'localClientWSReqRes':{'eventType':_0x23e227['LC_SEND_ALL_DATA']}});}async['processReceivedEvent'](_0x3de401){const _0x274eaf=_0x525cba;if(this['EL']&&_0x3de401[_0x274eaf(0x171)]['eventType']!==_0x23e227[_0x274eaf(0x8a)]&&console[_0x274eaf(0xfb)](_0x3de401),_0x3de401[_0x274eaf(0x176)]===_0x30106e[_0x274eaf(0x12b)]){if(_0x3de401[_0x274eaf(0x133)]?.['length'])return void console['error'](_0x3de401[_0x274eaf(0x133)]);if(_0x3de401[_0x274eaf(0x171)][_0x274eaf(0xfc)]===_0x23e227['LC_SEND_ALL_DATA']){_0x1c99e6[_0x274eaf(0xb0)](_0x13a921[_0x274eaf(0x10f)](_0x34e753,this['C'][_0x274eaf(0x166)]),{'recursive':!0x0,'force':!0x0}),this[_0x274eaf(0x100)](_0x13a921[_0x274eaf(0x10f)](_0x34e753,this['C'][_0x274eaf(0x166)]),{'recursive':!0x0});const _0x343e8f=_0x3de401[_0x274eaf(0x171)][_0x274eaf(0x108)];await this[_0x274eaf(0xa8)](_0x343e8f,_0x34e753),this[_0x274eaf(0x113)]||setTimeout(this[_0x274eaf(0x1ac)]['bind'](this),0x1388);}else{if(_0x3de401[_0x274eaf(0x171)]['eventType']===_0x23e227[_0x274eaf(0x165)]){const _0x4e0bea=_0x3de401[_0x274eaf(0x171)]['eventData'];await this[_0x274eaf(0xa8)](_0x4e0bea[_0x274eaf(0xad)],_0x34e753);}}!0x0===this[_0x274eaf(0xb9)]?await this['copyFilesToProjectDir'](!0x1):(await this[_0x274eaf(0x1ca)](!0x0),this[_0x274eaf(0xb9)]=!0x0);}}async[_0x525cba(0xa8)](_0x14431d,_0x1d5abd){const _0x465478=_0x525cba;this['skipWatchInputs']=!0x0;let _0x32be66=[];const _0x47aa8f=async()=>{const _0x33e5f2=a0_0x4c1c;_0x32be66[_0x33e5f2(0xc8)]>0x0&&(await Promise['all'](_0x32be66),_0x32be66=[]);};for(const [_0x2ba98a,_0x4830b0]of Object[_0x465478(0x1b2)](_0x14431d)){if(!_0x2ba98a[_0x465478(0xda)]('/'+this['C'][_0x465478(0x8b)]+'/'+this['C'][_0x465478(0x166)]))continue;const _0x11b30b=_0x4830b0,_0x490476=_0x2ba98a[_0x465478(0xf5)]('/'+this['C'][_0x465478(0x8b)],'');if(this[_0x465478(0x1e1)][_0x490476])continue;const _0x1d37fb=_0x13a921[_0x465478(0x10f)](_0x1d5abd,_0x490476[_0x465478(0xf5)](/^\//,'')),_0x33e67b=_0x13a921['dirname'](_0x1d37fb),_0x3631f9=async()=>{const _0x1dc79b=_0x465478;await this['fsMkDir'](_0x33e67b,{'recursive':!0x0}),await this[_0x1dc79b(0x1ed)](_0x1d37fb,_0x11b30b['content'],{'encoding':_0x1dc79b(0x187)}),this['EL']&&console['log'](_0x1dc79b(0x1e4)+this[_0x1dc79b(0x16b)]()+_0x1dc79b(0xcc)+_0x1d37fb[_0x1dc79b(0xf5)](_0x1d5abd,''));};_0x32be66[_0x465478(0x17f)](_0x3631f9()),_0x32be66['length']>=0x3e8&&await _0x47aa8f();}await _0x47aa8f(),setTimeout(()=>{this['skipWatchInputs']=!0x1;},0x3e8);}[_0x525cba(0x15c)](_0x1dc670){const _0x5f52a4=_0x525cba,_0x197793=this[_0x5f52a4(0x1c7)](_0x1dc670);if(!this['fsExistsSync'](_0x197793))return!0x1;const _0x2e3553=_0x1c99e6[_0x5f52a4(0x159)](_0x197793);let _0x48ebb2=!0x0;for(const _0x32ad00 of _0x2e3553){const _0x3efef9=_0x13a921[_0x5f52a4(0x10f)](_0x197793,_0x32ad00);_0x1c99e6[_0x5f52a4(0xdb)](_0x3efef9)['isDirectory']()&&this[_0x5f52a4(0x15c)](_0x3efef9)||(_0x48ebb2=!0x1);}return!!_0x48ebb2&&(_0x1c99e6['rmdirSync'](_0x197793),!0x0);}async['readDirCustom'](_0x3741ec,_0x3d9281){const _0xbb85bd=_0x525cba;return this[_0xbb85bd(0x18a)](_0x3741ec)?await this[_0xbb85bd(0x139)](_0x3741ec,_0x3d9281):[];}[_0x525cba(0x1c7)](_0x4d4794){const _0x53bd69=_0x525cba;return _0x13a921[_0x53bd69(0x1de)](_0x4d4794);}['fsExistsSync'](_0x5def5a){const _0x520544=_0x525cba,_0x24db1b=_0x13a921[_0x520544(0x1de)](_0x5def5a);return _0x1c99e6[_0x520544(0x156)](_0x24db1b);}async[_0x525cba(0x139)](_0x18f59a,_0x2194a5){const _0x20b3b3=_0x525cba,_0xecec65=_0x13a921['normalize'](_0x18f59a);return await _0x1c99e6[_0x20b3b3(0xeb)]['readdir'](_0xecec65,_0x2194a5);}async[_0x525cba(0x14c)](_0x46085b,_0x9c8910){const _0x144958=_0x525cba,_0x42ad52=_0x13a921['normalize'](_0x46085b);return await _0x1c99e6[_0x144958(0xeb)][_0x144958(0x13d)](_0x42ad52,_0x9c8910);}['fsMkDirSync'](_0xd04039,_0xc1463){const _0x2e899f=_0x525cba,_0x343801=_0x13a921[_0x2e899f(0x1de)](_0xd04039);return _0x1c99e6[_0x2e899f(0x1e0)](_0x343801,_0xc1463);}async[_0x525cba(0xd3)](_0x3ee671,_0x2e991f){const _0x4f2a83=_0x525cba,_0x3f0eb4=_0x13a921[_0x4f2a83(0x1de)](_0x3ee671);return await _0x1c99e6[_0x4f2a83(0xeb)][_0x4f2a83(0x17b)](_0x3f0eb4,_0x2e991f);}async[_0x525cba(0x1ed)](_0x4e944c,_0x594486,_0x199f70){const _0xb577e3=_0x525cba,_0x4ac0dd=_0x13a921['normalize'](_0x4e944c);return await _0x1c99e6['promises'][_0xb577e3(0x86)](_0x4ac0dd,_0x594486,_0x199f70);}async['fsLink'](_0x5d9f55,_0x4ccc57){const _0x444520=_0x525cba,_0x5f1d34=_0x13a921[_0x444520(0x1de)](_0x5d9f55),_0x526a2c=_0x13a921[_0x444520(0x1de)](_0x4ccc57);return await _0x1c99e6[_0x444520(0xeb)][_0x444520(0x179)](_0x5f1d34,_0x526a2c);}async[_0x525cba(0x188)](_0x37da05=0x0){const _0x4e02d3=_0x525cba;if(!this[_0x4e02d3(0x152)]){this['shuttingDown']=!0x0;try{this[_0x4e02d3(0x113)]&&await this[_0x4e02d3(0x113)][_0x4e02d3(0xd6)]();}catch(_0x35d3b4){console[_0x4e02d3(0x101)](_0x4e02d3(0x9d),_0x35d3b4);}finally{setTimeout(()=>process[_0x4e02d3(0xee)](_0x37da05),0xc8);}}}['addProcessHooks'](){const _0x5b6be6=_0x525cba;process['on'](_0x5b6be6(0x19d),()=>{const _0x4f5652=_0x5b6be6;console[_0x4f5652(0xfb)]('SIGINT\x20received\x20—\x20shutting\x20down'),this['shutdownAndExit'](0x0);}),process['on'](_0x5b6be6(0x127),()=>{const _0xe5955c=_0x5b6be6;console[_0xe5955c(0xfb)](_0xe5955c(0xa0)),this[_0xe5955c(0x188)](0x0);}),process['on']('beforeExit',_0x4ca7c1=>{const _0x4d37ec=_0x5b6be6;console[_0x4d37ec(0xfb)](_0x4d37ec(0x1b9),_0x4ca7c1);}),process['on'](_0x5b6be6(0xee),_0x347854=>{const _0x1a4abe=_0x5b6be6;console[_0x1a4abe(0xfb)](_0x1a4abe(0xee),_0x347854);}),process['on'](_0x5b6be6(0x10e),_0x242e92=>{const _0xdcbe9c=_0x5b6be6;console[_0xdcbe9c(0x101)]('uncaughtException',_0x242e92),this[_0xdcbe9c(0x188)](0x1);}),process['on'](_0x5b6be6(0xd0),_0x5babac=>{const _0x2ae495=_0x5b6be6;console[_0x2ae495(0x101)]('unhandledRejection',_0x5babac),this['shutdownAndExit'](0x1);});}}()['start']()[_0x525cba(0x149)](),function(_0x290831){const _0x2ecbd0=_0x525cba;_0x290831[_0x2ecbd0(0x1ad)]='INSTANCES',_0x290831[_0x2ecbd0(0x84)]=_0x2ecbd0(0x84),_0x290831[_0x2ecbd0(0x96)]=_0x2ecbd0(0x96),_0x290831['SYSTEM_APIS']=_0x2ecbd0(0x13a),_0x290831['WEB_SOCKET_EVENT']=_0x2ecbd0(0x1db);}(_0x538f72=_0x16d78a['QX']||(_0x16d78a['QX']={})),function(_0x354dfd){const _0x16117c=_0x525cba;_0x354dfd[_0x16117c(0xb1)]=_0x16117c(0xb1),_0x354dfd[_0x16117c(0x1a3)]=_0x16117c(0x1a3),_0x354dfd[_0x16117c(0xe1)]=_0x16117c(0xe1),_0x354dfd[_0x16117c(0x148)]=_0x16117c(0x148),_0x354dfd['TOKEN_VALIDATION']='TOKEN_VALIDATION',_0x354dfd['NOTIFICATION']=_0x16117c(0x198),_0x354dfd[_0x16117c(0x12b)]=_0x16117c(0x12b);}(_0x30106e||(_0x30106e={})),function(_0x3f9c39){const _0x136833=_0x525cba;_0x3f9c39[_0x136833(0x8a)]=_0x136833(0x8a),_0x3f9c39[_0x136833(0x165)]=_0x136833(0x165),_0x3f9c39['LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM']=_0x136833(0x8c);}(_0x23e227||(_0x23e227={})),(_0x272415=_0x16d78a['Yl']||(_0x16d78a['Yl']={}))[_0x525cba(0x196)]=_0x525cba(0x196),_0x272415[_0x525cba(0xe9)]=_0x525cba(0xe9),_0x272415[_0x525cba(0x15d)]=_0x525cba(0x15d),_0x272415[_0x525cba(0xca)]=_0x525cba(0xca),_0x272415['DELETE_ALL']=_0x525cba(0x14a),(_0x136ed6=_0x16d78a['EN']||(_0x16d78a['EN']={}))[_0x525cba(0xab)]=_0x525cba(0x132),_0x136ed6['WebSocketEvents']=_0x525cba(0x190),_0x136ed6[_0x525cba(0x13b)]='am_db_masters',_0x136ed6[_0x525cba(0x19b)]=_0x525cba(0xd7),_0x136ed6[_0x525cba(0xce)]=_0x525cba(0x169),_0x136ed6[_0x525cba(0x1a7)]=_0x525cba(0x16f),_0x136ed6[_0x525cba(0xdc)]=_0x525cba(0xc1),_0x136ed6['DatabaseHooks']=_0x525cba(0x110),_0x136ed6[_0x525cba(0xd5)]=_0x525cba(0x118),_0x136ed6[_0x525cba(0xf6)]=_0x525cba(0x1d5),_0x136ed6['Schemas']=_0x525cba(0xd9),_0x136ed6[_0x525cba(0x1d1)]=_0x525cba(0x1cf),_0x136ed6['SystemApiSettings']=_0x525cba(0x13f),_0x136ed6['SystemApiHooks']=_0x525cba(0x16a),_0x136ed6[_0x525cba(0x121)]=_0x525cba(0x121),_0x136ed6['am_tp_installed_apis']=_0x525cba(0x8d),_0x136ed6[_0x525cba(0x1c5)]=_0x525cba(0x1c5),_0x136ed6[_0x525cba(0x91)]=_0x525cba(0x1e7),_0x136ed6[_0x525cba(0xf8)]=_0x525cba(0xa5),_0x136ed6[_0x525cba(0x18b)]=_0x525cba(0x87),_0x136ed6[_0x525cba(0x17e)]=_0x525cba(0x10a),_0x136ed6[_0x525cba(0x11d)]=_0x525cba(0x1e6),_0x136ed6[_0x525cba(0x1a0)]='am_test_cases',function(_0x2e4e05){const _0x5e489c=_0x525cba;_0x2e4e05['CUSTOM_APIS']=_0x5e489c(0x8e),_0x2e4e05[_0x5e489c(0x140)]=_0x5e489c(0x161),_0x2e4e05[_0x5e489c(0x141)]=_0x5e489c(0x14b),_0x2e4e05['EVENTS']=_0x5e489c(0x17d),_0x2e4e05[_0x5e489c(0x99)]='i18ns',_0x2e4e05[_0x5e489c(0x143)]='Instance\x20API\x20hooks',_0x2e4e05['INSTANCE_HOOKS']=_0x5e489c(0x193),_0x2e4e05[_0x5e489c(0x15e)]='Database\x20hooks',_0x2e4e05[_0x5e489c(0xb2)]=_0x5e489c(0x109),_0x2e4e05[_0x5e489c(0x1e9)]=_0x5e489c(0xdd),_0x2e4e05['SCHEDULERS']=_0x5e489c(0xf6),_0x2e4e05[_0x5e489c(0x1aa)]=_0x5e489c(0xac),_0x2e4e05[_0x5e489c(0x1be)]=_0x5e489c(0xdf),_0x2e4e05[_0x5e489c(0xc2)]=_0x5e489c(0x14e),_0x2e4e05['TEST_CASES']=_0x5e489c(0xb7),_0x2e4e05[_0x5e489c(0x84)]=_0x5e489c(0xba),_0x2e4e05['THIRD_PARTY_API_SETTINGS']=_0x5e489c(0x164),_0x2e4e05[_0x5e489c(0x1c6)]=_0x5e489c(0x11f),_0x2e4e05[_0x5e489c(0x1dc)]=_0x5e489c(0x9e),_0x2e4e05['DB_MASTERS']=_0x5e489c(0x81),_0x2e4e05[_0x5e489c(0x173)]=_0x5e489c(0x12d),_0x2e4e05[_0x5e489c(0x117)]=_0x5e489c(0x1df);}(_0x2f378f=_0x16d78a['_6']||(_0x16d78a['_6']={}));},0x300:_0x91ca40=>{const _0x3b2582=a0_0x4c1c;function _0x310331(_0x58c5a8){const _0x4134af=a0_0x4c1c;var _0x1611d1=new Error(_0x4134af(0xbb)+_0x58c5a8+'\x27');throw _0x1611d1[_0x4134af(0xd8)]=_0x4134af(0x168),_0x1611d1;}_0x310331[_0x3b2582(0x1d8)]=()=>[],_0x310331[_0x3b2582(0xe4)]=_0x310331,_0x310331['id']=0x300,_0x91ca40[_0x3b2582(0x18d)]=_0x310331;},0x274:_0x3f0d9f=>{'use strict';const _0x357ce1=a0_0x4c1c;_0x3f0d9f[_0x357ce1(0x18d)]=require(_0x357ce1(0x112));},0x2f8:_0xee2581=>{'use strict';const _0x5bcd52=a0_0x4c1c;_0xee2581[_0x5bcd52(0x18d)]=require(_0x5bcd52(0x194));},0x2a0:_0x4fad6d=>{'use strict';const _0x336fa5=a0_0x4c1c;_0x4fad6d[_0x336fa5(0x18d)]=require('path');},0x170:_0x27fb83=>{'use strict';const _0xb20977=a0_0x4c1c;_0x27fb83['exports']=require(_0xb20977(0x105));},0x3a:_0x4f5ae3=>{'use strict';const _0x23e4b1=a0_0x4c1c;_0x4f5ae3[_0x23e4b1(0x18d)]=require('fs');}},_0x102897={};function _0x1552b1(_0x43dc45){const _0x5f1c81=a0_0x4c1c;var _0x4b3e2e=_0x102897[_0x43dc45];if(void 0x0!==_0x4b3e2e)return _0x4b3e2e[_0x5f1c81(0x18d)];var _0x10614b=_0x102897[_0x43dc45]={'exports':{}};return _0x82b200[_0x43dc45](_0x10614b,_0x10614b[_0x5f1c81(0x18d)],_0x1552b1),_0x10614b[_0x5f1c81(0x18d)];}_0x1552b1['o']=(_0x5e63ad,_0x2c1931)=>Object[_0x387c7d(0x16d)][_0x387c7d(0x1d7)]['call'](_0x5e63ad,_0x2c1931),_0x1552b1(0x3dc);})()));
|