@sava-info-systems/api-maker-with-extensions 1.18.1 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{1351.c372d4232c6551fb.js → 1351.48e08341fba9b889.js} +1 -1
- package/dist/{1417.336e9ca469a92f03.js → 1417.5caf023140e7c67f.js} +1 -1
- package/dist/1468.d42293f7d802a787.js +1 -0
- package/dist/1959.a22fe393419f10c5.js +1 -0
- package/dist/{2162.bb1f670dabb5c84a.js → 2162.3c94f3d66c6312d5.js} +1 -1
- package/dist/{2442.18887167a25c7dee.js → 2442.adbc5b49349bb569.js} +1 -1
- package/dist/{2818.dd50a60acfbaad6b.js → 2818.71176f4848a9419f.js} +1 -1
- package/dist/3488.ada60be2dbcd9845.js +1 -0
- package/dist/{3545.d415d4baf2d79163.js → 3545.b5585792e9fe1447.js} +1 -1
- package/dist/{3605.e398ec79072f4bf2.js → 3605.3c6cdf2a08c47301.js} +1 -1
- package/dist/{3611.59468f2dba2cd6df.js → 3611.9577d58af5f1f4aa.js} +1 -1
- package/dist/{3621.43633d73990c0546.js → 3621.412300a009ea6346.js} +1 -1
- package/dist/{3732.d698a74f1f0e24e6.js → 3732.b5ac36f1448e215c.js} +1 -1
- package/dist/{379.0d35e4e001b196b4.js → 379.d3e61f3350a595dc.js} +1 -1
- package/dist/{3929.a017182a7e24cf7f.js → 3929.9ac933e926943db2.js} +1 -1
- package/dist/{4092.b7a59976bb87bf26.js → 4092.71b0eccc0cb429f0.js} +1 -1
- package/dist/{4124.1dab3feb76c9c039.js → 4124.a8329e77343e7087.js} +1 -1
- package/dist/{4316.3745e74e3d9c2865.js → 4316.542be541e58dff84.js} +1 -1
- package/dist/4344.d8f42d425eaec852.js +1 -0
- package/dist/{4689.4f5958fddadc577e.js → 4689.e827720779e0cf34.js} +1 -1
- package/dist/{4709.bd58a5ca8c74f29c.js → 4709.262c34f60b50ebc9.js} +1 -1
- package/dist/{4774.088c1fbbb2988ee5.js → 4774.a4368f3ce2e778da.js} +1 -1
- package/dist/{4880.968e1ffff2f417d9.js → 4880.70ca405524206be7.js} +1 -1
- package/dist/{5011.f661999b271a98de.js → 5011.ed9a6465223f760d.js} +1 -1
- package/dist/{5090.fb3787137ba94607.js → 5090.c8bf74c35b0a5d26.js} +1 -1
- package/dist/{5140.05120f243608b828.js → 5140.581ccd2699e2a8a8.js} +1 -1
- package/dist/{5362.4514e2ffb27ce0ac.js → 5362.912e053f78479e90.js} +1 -1
- package/dist/{5442.454ac3ebe7c10659.js → 5442.186b40719e7c1da9.js} +1 -1
- package/dist/{5455.c1f4f3493ea016d4.js → 5455.a1d0d507419e3c59.js} +1 -1
- package/dist/5729.f0ee236ba6579a94.js +1 -0
- package/dist/{5826.650d402e8a957ea3.js → 5826.44efead20568788a.js} +1 -1
- package/dist/{6053.fa624fe98db9a213.js → 6053.67f38f7b35484475.js} +1 -1
- package/dist/6220.b6c29e6e3e717880.js +1 -0
- package/dist/{6415.6b8243526609c494.js → 6415.a48241737e134178.js} +1 -1
- package/dist/{6589.1003b792dd929437.js → 6589.b9c83295e466e464.js} +1 -1
- package/dist/{6679.e71f655f0e7e3e6c.js → 6679.c5073d3a60b67e2e.js} +1 -1
- package/dist/{6828.e0cfd2be83bbc047.js → 6828.36c6805f2b3c6f38.js} +1 -1
- package/dist/{6866.2b7ff38ea0ea8d8f.js → 6866.4dd76a41246a20be.js} +1 -1
- package/dist/{6882.c12e0aff75132b05.js → 6882.fe03a3df377ca119.js} +1 -1
- package/dist/{7014.8aa576d25335a412.js → 7014.5db4db60cc21782e.js} +1 -1
- package/dist/7152.dab3cc50472f703f.js +1 -0
- package/dist/{7367.bd5d43e22b265555.js → 7367.ba1e63db0f9b97f4.js} +1 -1
- package/dist/{7374.b0ad763987f68749.js → 7374.ebfe1004d1773912.js} +1 -1
- package/dist/{7597.9fe66d68836d18f4.js → 7597.177f15771dcdea42.js} +1 -1
- package/dist/7759.2b4ed39a62323abd.js +1 -0
- package/dist/{807.2ba5cc740aa4efa0.js → 807.dba59148bbbbe7fb.js} +1 -1
- package/dist/{8219.46ff63825141f651.js → 8219.2c97945d465ab185.js} +1 -1
- package/dist/{8447.17357e24b9438857.js → 8447.87b3cf73f79cd889.js} +1 -1
- package/dist/{8970.3abda875c6d7de4f.js → 8970.8eece52bbc1c316c.js} +1 -1
- package/dist/9036.876c1f0c1ce4e82b.js +1 -0
- package/dist/{9347.cb017d6396c7f64e.js → 9347.4e7d02eee86c5778.js} +1 -1
- package/dist/{9429.3ce31b960b639d09.js → 9429.9299aa0abda3dc76.js} +1 -1
- package/dist/{9785.edd131cfe4b5abdb.js → 9785.35cc7f0c3778344e.js} +1 -1
- package/dist/{9882.1e4cda6c65811bb5.js → 9882.a94c746b42e5fc0e.js} +1 -1
- package/dist/{9957.baf57c960e56a490.js → 9957.47ed0e74bdfeddd5.js} +1 -1
- package/dist/assets/schema-types/store-types.ts +1 -0
- package/dist/assets/schema-types/types.ts +1 -0
- package/dist/assets/styles/out/colors-dark.css +1 -1
- package/dist/assets/styles/out/styles.css +1 -1
- package/dist/assets/styles/styles.scss +2 -0
- package/dist/{common.2e05fdf2a25495d6.js → common.d4eb1616e93e21e1.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/main.ffc8631f3e17b1c3.js +1 -0
- package/dist/runtime.f7e0fa10d087fa0b.js +1 -0
- package/main.js +1 -1
- package/package.json +4 -4
- package/sandbox/Dockerfile +1 -0
- package/sandbox/assets/schema-types/store-types.js +1 -0
- package/sandbox/package.json +2 -1
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/store-types.ts +1 -0
- package/src/assets/schema-types/types.ts +1 -0
- package/src/tools/local-client.js +1 -1215
- package/dist/1468.7643522cc3e89857.js +0 -1
- package/dist/1959.59ee99be25f59755.js +0 -1
- package/dist/3488.7052042211d08d07.js +0 -1
- package/dist/4344.b6f194f896eb2205.js +0 -1
- package/dist/5729.9b201708284e16bc.js +0 -1
- package/dist/6220.7d7df941537ed662.js +0 -1
- package/dist/7152.4f047369765b7ac5.js +0 -1
- package/dist/7759.6c363b1156e3658a.js +0 -1
- package/dist/9036.18609df03a18bbdb.js +0 -1
- package/dist/main.b85e625cdc44b214.js +0 -1
- package/dist/runtime.f9839e08ff0d235d.js +0 -1
|
@@ -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_0x5c94(){const _0x2b48e6=['Database\x20migrations','EventsWriteF','basename','TOKEN_VALIDATION','copyDBMastersToAnotherDir','adminUserPath','Please\x20run\x20using\x20administrator\x20privileges.','Instance\x20hooks','UNKNOWN','config','entries','add','19144594sBTLlx','schedulers','SystemApiSettings','\x1b[38;2;255;165;0m','dbInterfacesFile','collection-hooks','ui-maker-pages','startWatch','ProcessInitializersWriteF','close','watcher','message','change','\x1b[36m','checkForNodeVersion','exports','\x27\x20exited\x20with\x20code\x20','LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM','DBMasterUtilsReadF','DatabasesMigrations','apiId','SIGINT\x20received\x20—\x20shutting\x20down','fsLink','mkdir','am_web_socket_events','isActive','instanceName','SCHEMAS','DELETE','instanceApiName','ProcessI18NWriteF','copyInstanceApiHooksToAnotherDir','relative','I18NS','CONNECTED','SystemApiHooksReadF','replace','response','UNREGISTER','.js','eventType','printNotes','24jKsIKS','copyDatabaseHooksToAnotherDir','PUT','parseYaml','prototype','UTILITY_CLASSES','TEST_CASES','isWSConnectedFirstTime','log','.yaml','Database\x20hooks','DB\x20master\x20utils','ProcessInitializers','errors','bind','dirname','ThirdPartyApiReadF','compilerOptions','am_tp_installed_apis','INSTANCE_HOOKS','readFile','SystemApiHooksWriteF','databaseName','ui-maker-styles','ProcessI18NReadF','Error\x20while\x20connecting\x20to\x20WS\x20server.','AmEvents','repo','custom-apis','keys','skipWatchInputs','TestCasesReadF','push','InstanceApiHooksWriteF','installRequiredPackages','Error\x20during\x20shutdown','UI_MAKER_STYLES','9gBKMVQ','SchemaReadF','executeNpmRun','posix','DELETE_ALL','versions','22lCisLN','WEB_SOCKET_EVENT','DB_MASTERS','customApiName','base64','readdirSync','SchemaWriteF','COLLECTION_HOOKS','syncAllDataWithServer','paths','fsReadFile','split','readDirCustom','Events','postHooks','am_database_migrations','debounce','SCHEDULERS','3943428RFHyoe','copyWebSocketEventsToAnotherDir','third-party-apis','tpInstalledApiName','UIMakerStyles','Custom\x20APIs','send','error','copyEventsToAnotherDir','mkdirSync','fsReadDir','DATABASE_HOOKS','6659268pFyyry','am_system_api_settings','normalize','CustomApis','fsMkDirSync','load','readFileSync','js-yaml','CollectionHooksWriteF','onerror','npm','listeners','unlink','EVENTS_WS','copyFilesToProjectDir','node_modules',']\x20:\x20','Collection\x20hooks','colorEnd','✅\x20Local\x20client\x20started...','onmessage','InstanceHooks','length','LC_SEND_ALL_DATA','AmTestCases','DBMigrationsReadF','getChangedFolder','Third\x20party\x20API\x20settings','\x20Local\x20client\x20will\x20pull\x20your\x20server\x20changes\x20to\x20local\x20&\x20perform\x20sync\x20between\x20them.','Utility\x20classes','version','parse','InstanceHooksWriteF','am_tp_api_versions','statSync','padStart','copyUtilityClassesToAnotherDir','join','instance-api-hooks','192269sikbvh','UIMakerUtils','toLowerCase','orangeStart','PROCESS_INITIALIZERS','filter','WebSocketEventsReadF','am_process_initializers','path','slice','db-interfaces.d.ts','preHooks','child_process','type','validOnEvents','data','\x1b[0m','watch','.css','sendDeletedEventToServerDebounce','getCurrentTime','writeMemfsJsonToDisk','Third\x20party\x20APIs','folderPath','post-hooks','5SQZTME','PUT_REPLACE','instances','INSTANCE_API_HOOKS','content','Cannot\x20find\x20module\x20\x27','⏳\x20Connecting\x20to\x20server...','MODULE_NOT_FOUND','DBMasterUtilsWriteF','resolve','addDir','removeEmptyDirsSync','install','✓\x20Receive\x20:\x20[','DBMasterStylesReadF','getCategoryOfPath','package-lock.json','INSTANCE_API_SETTINGS','——————————————————————————————————————————————————————————————————————————————————','Test\x20cases',']\x20:\x20[','System\x20API\x20hooks','am_custom_apis','INSTANCES','.gitignore','isDirectory','tsconfig.json','38pQfJvT','serializeFolderWithBinary','Instance\x20API\x20hooks','copyDBMigrationsToAnotherDir','SYSTEM_API_HOOKS','✅\x20dependencies\x20installed','fsWriteFile','baseUrl','copyInstanceHooksToAnotherDir','skipFileWritingForLocal','⏳\x20dependencies\x20installation\x20process\x20started','POST','copyI18NToAnotherDir','start','\x20Please\x20provide\x20settings\x20in\x20:\x20','nodeModulesCopied','13pMdnXI','package.json','LC_DATA_MODIFIED_IN_DATABASE','Failed\x20to\x20start\x20the\x20npm\x20process:\x20','am_schemas','unlinkDir','✅\x20node_modules\x20installed','shutdownAndExit','104UOVBoV','DBMigrationsWriteF','SchedulersReadF','am-types','.config.ts','apply','REGISTER','DB\x20masters','amTypes','all','instance-hooks','chokidar@4.0.3','sep','SchedulersWriteF','shuttingDown','copySchedulersToAnotherDir','sendToServer','InstanceApiHooks','copySystemApiHooksToAnotherDir','InstanceApiHooksReadF','NOTIFICATION','am_ui_maker_utils','23504UkThhn','DBMasterStylesWriteF','eventData','readdir','WebSocketEvents','-lc','types','collectionName','DB_MIGRATIONS','CUSTOM_APIS','DBMastersReadF','processReceivedEvent','connectToServerViaWS','i18ns','printNotesToProvideLocalClient','cpSync','code','am_utility_classes','Schemas','Watcher\x20error:','InstanceHooksReadF','.ts','spawn','then','copyThirdPartyApisToAnotherDir','am_instance_hooks','⏳\x20node_modules\x20installation\x20process\x20started','?authTokenInfo=ws-local-client-sync&authorization=','getHours','startsWith','promises','beforeExit','js-yaml@4.1.0','EVENTS','DBMasters','SYSTEM_APIS','apiCategory','rmdirSync','normalizePath','UtilityClasses','LOCAL_CLIENT_SYNC_EVENTS','localClientPath','Schedulers','endsWith','fsMkDir','systemApiName','Process\x20initializers','am_database_hooks','fsExistsSync','unhandledRejection','Connection\x20closed.','utf8','&user-path=','src','THIRD_PARTY_APIS','ui-maker-utils','copyCustomApisToAnotherDir','pre-hooks','unlinkSync','am_instance_api_hooks','createLCProjectDirectory','tpInstalledApiBundleName','am_db_masters','EventsReadF','✓\x20Send\x20:\x20[','chokidar','copyProcessInitializersToAnotherDir','SIGTERM\x20received\x20—\x20shutting\x20down','copyCollectionHooksToAnotherDir','sendDeletedEventToServerInternal','System\x20API\x20settings','UI\x20maker\x20styles','I18Ns','onclose','syncToken','copyDBMasterStylesToAnotherDir','name','watch\x20handler\x20error','invalidOnEvents','call','am_tp_api_settings','dir','addProcessHooks','8696dNNkAK','LC_DATA_REQ_RES','cyanStart','projectDirectory','UI_MAKER_UTILITY_CLASS','copyTestCasesToAnotherDir','exit','am_i18ns','web-socket-events','symlinkSync','eventListeners','8792030SOqdQZ','uncaughtException','CollectionHooks'];a0_0x5c94=function(){return _0x2b48e6;};return a0_0x5c94();}function a0_0xf806(_0x10b86b,_0x1b0e71){const _0x5c949a=a0_0x5c94();return a0_0xf806=function(_0xf806f6,_0x12850f){_0xf806f6=_0xf806f6-0xf4;let _0x1b87ba=_0x5c949a[_0xf806f6];return _0x1b87ba;},a0_0xf806(_0x10b86b,_0x1b0e71);}(function(_0xfae54d,_0x263f6a){const _0x17fb77=a0_0xf806,_0x20018e=_0xfae54d();while(!![]){try{const _0x2bb5b0=parseInt(_0x17fb77(0x24b))/0x1*(-parseInt(_0x17fb77(0x110))/0x2)+parseInt(_0x17fb77(0x1a7))/0x3*(-parseInt(_0x17fb77(0x163))/0x4)+parseInt(_0x17fb77(0x230))/0x5*(parseInt(_0x17fb77(0x1f0))/0x6)+parseInt(_0x17fb77(0x217))/0x7*(parseInt(_0x17fb77(0xfa))/0x8)+-parseInt(_0x17fb77(0x1cc))/0x9*(parseInt(_0x17fb77(0x16e))/0xa)+parseInt(_0x17fb77(0x1d2))/0xb*(-parseInt(_0x17fb77(0x1e4))/0xc)+parseInt(_0x17fb77(0x25b))/0xd*(parseInt(_0x17fb77(0x17d))/0xe);if(_0x2bb5b0===_0x263f6a)break;else _0x20018e['push'](_0x20018e['shift']());}catch(_0x4c9d65){_0x20018e['push'](_0x20018e['shift']());}}}(a0_0x5c94,0xcb9db),((()=>{const _0x276446=a0_0xf806;var _0x43be4e={0x3dc:(_0x1fa1b5,_0xe17e60,_0x5b58db)=>{'use strict';const _0x1b0e0f=a0_0xf806;var _0x2f0ddb='src/tools';_0xe17e60['_6']=_0xe17e60['EN']=_0xe17e60['Yl']=_0xe17e60['QX']=void 0x0;const _0x2a0ea6=_0x5b58db(0x3a),_0x38e9ea=_0x5b58db(0x2a0),_0x5ef9cc=_0x5b58db(0x170);var _0x513751,_0x9aed2c,_0x2bbdcd,_0x3c2731,_0x57bf68,_0xf11aa7;new class{constructor(){const _0x29dc8c=a0_0xf806;this['EL']=!0x1,this['projectDirectory']='',this['C']={'localClientPath':'./local-client.config','src':_0x29dc8c(0x145),'repo':_0x29dc8c(0x1c2),'types':_0x29dc8c(0x116),'amTypes':_0x29dc8c(0xfd),'versions':_0x29dc8c(0x1d1),'apis':'apis','listeners':_0x29dc8c(0x1fb),'postHooks':_0x29dc8c(0x22f),'preHooks':_0x29dc8c(0x149),'dbInterfacesFile':_0x29dc8c(0x221),'UtilityClassesReadF':_0x29dc8c(0x20d),'CustomApiReadF':_0x29dc8c(0x1e9),'SchedulersReadF':_0x29dc8c(0x13a),'WebSocketEventsReadF':'WebSocket\x20events','SchemaReadF':_0x29dc8c(0x122),'DBMigrationsReadF':_0x29dc8c(0x171),'ProcessInitializersReadF':_0x29dc8c(0x13e),'ProcessI18NReadF':_0x29dc8c(0x11d),'DBMastersReadF':'DB\x20masters','DBMasterStylesReadF':_0x29dc8c(0x157),'DBMasterUtilsReadF':_0x29dc8c(0x1b2),'TestCasesReadF':_0x29dc8c(0x243),'ThirdPartyApiReadF':'Third\x20party\x20APIs','EventsReadF':'Events','InstanceApiHooksReadF':_0x29dc8c(0x24d),'SystemApiHooksReadF':_0x29dc8c(0x245),'CollectionHooksReadF':_0x29dc8c(0x201),'DatabaseHooksReadF':_0x29dc8c(0x1b1),'InstanceHooksReadF':_0x29dc8c(0x178),'CustomApisWriteF':'custom-apis','SchedulersWriteF':_0x29dc8c(0x17e),'WebSocketEventsWriteF':_0x29dc8c(0x16b),'SchemaWriteF':'schemas','DBMigrationsWriteF':'db-migrations','ProcessInitializersWriteF':'process-initializers','ProcessI18NWriteF':'i18ns','DBMastersWriteF':_0x29dc8c(0x183),'DBMasterStylesWriteF':_0x29dc8c(0x1be),'DBMasterUtilsWriteF':_0x29dc8c(0x147),'TestCasesWriteF':'tests','ThirdPartyApiWriteF':_0x29dc8c(0x1e6),'EventsWriteF':'events','InstanceApiHooksWriteF':_0x29dc8c(0x216),'SystemApiHooksWriteF':'system-api-hooks','CollectionHooksWriteF':_0x29dc8c(0x182),'DatabaseHooksWriteF':'database-hooks','InstanceHooksWriteF':_0x29dc8c(0x104)},this[_0x29dc8c(0x1c5)]=!0x1,this[_0x29dc8c(0x254)]={},this[_0x29dc8c(0x25a)]=!0x1,this['orangeStart']=_0x29dc8c(0x180),this['cyanStart']=_0x29dc8c(0x18a),this[_0x29dc8c(0x202)]=_0x29dc8c(0x227),this[_0x29dc8c(0x1ae)]=!0x1,this[_0x29dc8c(0x22a)]=this[_0x29dc8c(0x1e2)](this[_0x29dc8c(0x155)],0x1f4);}async['start'](){const _0x460d5e=a0_0xf806;this[_0x460d5e(0x162)](),this['checkForNodeVersion'](),this[_0x460d5e(0x140)](this['C'][_0x460d5e(0x139)]+_0x460d5e(0x1a4))||(this[_0x460d5e(0x11e)](),this[_0x460d5e(0xf9)](0x1)[_0x460d5e(0x127)]()),this[_0x460d5e(0x17a)]=_0x5b58db(0x300)(this['C'][_0x460d5e(0x139)])(),await this['printNotes'](),this[_0x460d5e(0x23b)](_0x38e9ea[_0x460d5e(0x215)](_0x2f0ddb,this['C'][_0x460d5e(0x145)])),await this[_0x460d5e(0x14c)](),await this[_0x460d5e(0x1c9)](),await this[_0x460d5e(0x11c)]();}[_0x1b0e0f(0x18b)](){const _0x3bc29e=_0x1b0e0f,_0x4298c7=process['version'];parseInt(_0x4298c7[_0x3bc29e(0x1dd)]('.')[0x0][_0x3bc29e(0x1a1)]('v',''),0xa)<0x16&&(console['error'](this['orangeStart']+'Node.js\x2022+\x20is\x20required.\x20Current\x20version:\x20'+_0x4298c7+this['colorEnd']),this[_0x3bc29e(0xf9)](0x1)[_0x3bc29e(0x127)]());}async[_0x1b0e0f(0x1a6)](){const _0x3fa255=_0x1b0e0f;console[_0x3fa255(0x1af)](this[_0x3fa255(0x21a)]),console[_0x3fa255(0x1af)]('——————————————————————————————————————\x20Note\x20——————————————————————————————————————'),console[_0x3fa255(0x1af)](_0x3fa255(0x20c)),console[_0x3fa255(0x1af)](_0x3fa255(0x242)),console['log'](this[_0x3fa255(0x202)]),console[_0x3fa255(0x1af)]('');}[_0x1b0e0f(0x11e)](){const _0x3e1023=_0x1b0e0f;console[_0x3e1023(0x1af)](_0x3e1023(0x180)),console[_0x3e1023(0x1af)](_0x3e1023(0x259)+this['C'][_0x3e1023(0x139)]+_0x3e1023(0x1a4)),console[_0x3e1023(0x1af)](_0x3e1023(0x227)),console[_0x3e1023(0x1af)]('');}async[_0x1b0e0f(0x14c)](){const _0x5e6601=_0x1b0e0f,_0x18792f=_0x38e9ea[_0x5e6601(0x173)](_0x2f0ddb),_0x5ac93e=_0x38e9ea[_0x5e6601(0x215)](_0x2f0ddb,'..',_0x18792f+_0x5e6601(0x115));this['projectDirectory']=_0x5ac93e,_0x2a0ea6['rmSync'](_0x5ac93e,{'recursive':!0x0,'force':!0x0}),await this['fsMkDir'](_0x5ac93e,{'recursive':!0x0});}async[_0x1b0e0f(0x1fe)](_0x10d4cb){const _0x4fcd78=_0x1b0e0f;await this[_0x4fcd78(0x14c)](),this[_0x4fcd78(0x1f4)](_0x38e9ea[_0x4fcd78(0x215)](this[_0x4fcd78(0x166)],this['C'][_0x4fcd78(0x145)]),{'recursive':!0x0}),_0x2a0ea6[_0x4fcd78(0x11f)](_0x38e9ea['join'](_0x2f0ddb,_0x4fcd78(0x25c)),_0x38e9ea[_0x4fcd78(0x215)](this[_0x4fcd78(0x166)],_0x4fcd78(0x25c))),_0x2a0ea6[_0x4fcd78(0x11f)](_0x38e9ea[_0x4fcd78(0x215)](_0x2f0ddb,_0x4fcd78(0x248)),_0x38e9ea['join'](this['projectDirectory'],'.gitignore'));const _0x46e510=_0x38e9ea[_0x4fcd78(0x215)](_0x2f0ddb,_0x4fcd78(0x24a)),_0x1d9185=JSON[_0x4fcd78(0x20f)](await this[_0x4fcd78(0x1dc)](_0x46e510,{'encoding':'utf8'}));_0x1d9185[_0x4fcd78(0x1b8)][_0x4fcd78(0x252)]='./src',_0x1d9185['compilerOptions'][_0x4fcd78(0x1db)]['*'][_0x4fcd78(0x1c7)]('*'),await this['fsWriteFile'](_0x38e9ea[_0x4fcd78(0x215)](this[_0x4fcd78(0x166)],_0x4fcd78(0x24a)),JSON['stringify'](_0x1d9185,null,0x4),{'encoding':_0x4fcd78(0x143)}),await _0x2a0ea6[_0x4fcd78(0x12e)]['cp'](_0x38e9ea[_0x4fcd78(0x215)](_0x2f0ddb,this['C'][_0x4fcd78(0x102)]),_0x38e9ea[_0x4fcd78(0x215)](this['projectDirectory'],this['C'][_0x4fcd78(0x145)],this['C'][_0x4fcd78(0x102)]),{'recursive':!0x0}),await _0x2a0ea6[_0x4fcd78(0x12e)]['cp'](_0x38e9ea['join'](_0x2f0ddb,this['C'][_0x4fcd78(0x145)],this[_0x4fcd78(0x17a)][_0x4fcd78(0x176)],this['C'][_0x4fcd78(0x116)],this['C'][_0x4fcd78(0x181)]),_0x38e9ea[_0x4fcd78(0x215)](this['projectDirectory'],this['C'][_0x4fcd78(0x145)],this['C'][_0x4fcd78(0x102)],this['C']['dbInterfacesFile']),{'recursive':!0x0}),await this['copyUtilityClassesToAnotherDir'](),await this[_0x4fcd78(0x148)](),await this[_0x4fcd78(0x109)](),await this['copySchemasToAnotherDir'](),await this[_0x4fcd78(0x24e)](),await this[_0x4fcd78(0x152)](),await this[_0x4fcd78(0x257)](),await this[_0x4fcd78(0x168)](),await this[_0x4fcd78(0x128)](),await this[_0x4fcd78(0x1ec)](),await this[_0x4fcd78(0x19c)](),await this[_0x4fcd78(0x10c)](),await this['copyWebSocketEventsToAnotherDir'](),await this[_0x4fcd78(0x154)](),await this[_0x4fcd78(0x1a8)](),await this[_0x4fcd78(0x253)](),await this[_0x4fcd78(0x175)](),await this[_0x4fcd78(0x15b)](),await this['copyDBMasterUtilsToAnotherDir'](),_0x10d4cb&&(console[_0x4fcd78(0x1af)](_0x4fcd78(0x12a)),await this[_0x4fcd78(0x1ce)](_0x4fcd78(0x1fa),[_0x4fcd78(0x23c),'--force']),console['log'](_0x4fcd78(0xf8)));try{_0x2a0ea6[_0x4fcd78(0x16c)](_0x38e9ea['join'](_0x2f0ddb,_0x4fcd78(0x1ff)),_0x38e9ea['join'](this[_0x4fcd78(0x166)],_0x4fcd78(0x1ff)),_0x4fcd78(0x161));}catch(_0x55695a){console[_0x4fcd78(0x1af)](_0x4fcd78(0x177)),console[_0x4fcd78(0x1af)](_0x55695a),await this[_0x4fcd78(0xf9)](0x1);}}async[_0x1b0e0f(0x1c9)](){const _0x5852eb=_0x1b0e0f;console[_0x5852eb(0x1af)](_0x5852eb(0x255));try{_0x2a0ea6[_0x5852eb(0x14a)](_0x38e9ea[_0x5852eb(0x215)](_0x2f0ddb,_0x5852eb(0x240)));}catch(_0x26a97c){}await this[_0x5852eb(0x1ce)](_0x5852eb(0x1fa),[_0x5852eb(0x23c),'--no-save',_0x5852eb(0x105),_0x5852eb(0x130)]),console[_0x5852eb(0x1af)](_0x5852eb(0x250));}async[_0x1b0e0f(0x214)](){const _0x35c257=_0x1b0e0f,_0x440752=this['C']['UtilityClassesReadF'],_0x119bdd=_0x38e9ea[_0x35c257(0x215)](_0x2f0ddb,this['C'][_0x35c257(0x145)],this['config']['adminUserPath'],_0x440752),_0xd60d01=await this['readDirCustom'](_0x119bdd,null);for(const _0x1f5303 of _0xd60d01){const _0x25bebe=_0x38e9ea['join'](_0x119bdd,_0x1f5303,_0x1f5303+_0x35c257(0x1b0));if(!this['fsExistsSync'](_0x25bebe))continue;const _0x4dcb23=await this[_0x35c257(0x1dc)](_0x25bebe,{'encoding':'utf8'}),_0x4bc5fd=await this['parseYaml'](_0x4dcb23);for(const _0x4702dc of _0x4bc5fd['versions']||[])if(!0x0===_0x4702dc[_0x35c257(0x196)]){const _0xea658b=_0x38e9ea[_0x35c257(0x215)](_0x119bdd,_0x1f5303,this['C']['versions'],_0x4702dc['version'],_0x4702dc['name']+_0x35c257(0x125)),_0x1dbfb1=_0x38e9ea[_0x35c257(0x215)](this['projectDirectory'],this['C'][_0x35c257(0x145)],_0x4bc5fd[_0x35c257(0x22e)],_0x4bc5fd[_0x35c257(0x15c)]+_0x35c257(0x125));await this[_0x35c257(0x13c)](_0x38e9ea[_0x35c257(0x1b6)](_0x1dbfb1),{'recursive':!0x0}),await this[_0x35c257(0x193)](_0xea658b,_0x1dbfb1);}}}async[_0x1b0e0f(0x148)](){const _0x5c759c=_0x1b0e0f,_0x486156=this['C']['CustomApiReadF'],_0x3defb0=this['C']['CustomApisWriteF'],_0x45b0f4=_0x38e9ea[_0x5c759c(0x215)](_0x2f0ddb,this['C'][_0x5c759c(0x145)],this[_0x5c759c(0x17a)][_0x5c759c(0x176)],_0x486156),_0x2b567d=await this['readDirCustom'](_0x45b0f4,null);for(const _0x304eae of _0x2b567d){const _0x2a8bdb=_0x38e9ea[_0x5c759c(0x215)](_0x45b0f4,_0x304eae,_0x304eae+_0x5c759c(0x1b0));if(!this[_0x5c759c(0x140)](_0x2a8bdb))continue;const _0x31e05d=await this['fsReadFile'](_0x2a8bdb,{'encoding':_0x5c759c(0x143)}),_0x129b82=await this[_0x5c759c(0x1aa)](_0x31e05d);for(const _0x42c5b3 of _0x129b82[_0x5c759c(0x1d1)]||[])if(!0x0===_0x42c5b3[_0x5c759c(0x196)]){const _0x3f5ade=_0x38e9ea[_0x5c759c(0x215)](_0x45b0f4,_0x304eae,this['C'][_0x5c759c(0x1d1)],_0x42c5b3[_0x5c759c(0x20e)]),_0x56c0b3=_0x38e9ea['join'](_0x3f5ade,_0x42c5b3[_0x5c759c(0x15c)]+_0x5c759c(0x125)),_0x5170c7=_0x38e9ea[_0x5c759c(0x215)](this[_0x5c759c(0x166)],this['C'][_0x5c759c(0x145)],_0x3defb0,_0x129b82[_0x5c759c(0x21f)],_0x129b82[_0x5c759c(0x15c)]+'.ts');await this[_0x5c759c(0x13c)](_0x38e9ea[_0x5c759c(0x1b6)](_0x5170c7),{'recursive':!0x0}),await this[_0x5c759c(0x193)](_0x56c0b3,_0x5170c7);const _0x1cda01=_0x38e9ea[_0x5c759c(0x215)](_0x45b0f4,_0x304eae,_0x304eae+_0x5c759c(0xfe)),_0x358c9f=_0x38e9ea['join'](this[_0x5c759c(0x166)],this['C']['src'],_0x3defb0,_0x129b82[_0x5c759c(0x21f)],_0x129b82[_0x5c759c(0x15c)]+_0x5c759c(0xfe));await this[_0x5c759c(0x193)](_0x1cda01,_0x358c9f);for(const _0x43ce4c of _0x42c5b3['preHooks']){const _0x2e4319=_0x38e9ea['join'](_0x3f5ade,this['C']['preHooks'],_0x43ce4c[_0x5c759c(0x15c)]+_0x5c759c(0x125)),_0x52cec0=_0x38e9ea[_0x5c759c(0x215)](this[_0x5c759c(0x166)],this['C'][_0x5c759c(0x145)],_0x3defb0,_0x129b82[_0x5c759c(0x21f)],this['C']['preHooks'],_0x43ce4c[_0x5c759c(0x15c)]+_0x5c759c(0x125));await this[_0x5c759c(0x13c)](_0x38e9ea['dirname'](_0x52cec0),{'recursive':!0x0}),await this[_0x5c759c(0x193)](_0x2e4319,_0x52cec0);}for(const _0x3a2277 of _0x42c5b3[_0x5c759c(0x1e0)]){const _0x51d788=_0x38e9ea[_0x5c759c(0x215)](_0x3f5ade,this['C'][_0x5c759c(0x1e0)],_0x3a2277['name']+_0x5c759c(0x125)),_0x236f21=_0x38e9ea['join'](this[_0x5c759c(0x166)],this['C'][_0x5c759c(0x145)],_0x3defb0,_0x129b82[_0x5c759c(0x21f)],this['C']['postHooks'],_0x3a2277['name']+'.ts');await this[_0x5c759c(0x13c)](_0x38e9ea[_0x5c759c(0x1b6)](_0x236f21),{'recursive':!0x0}),await this[_0x5c759c(0x193)](_0x51d788,_0x236f21);}}}}async[_0x1b0e0f(0x109)](){const _0x127b86=_0x1b0e0f,_0x353713=this['C'][_0x127b86(0xfc)],_0x2692b9=this['C'][_0x127b86(0x107)],_0x48470a=_0x38e9ea['join'](_0x2f0ddb,this['C']['src'],this['config'][_0x127b86(0x176)],_0x353713),_0x4c49cc=await this[_0x127b86(0x1de)](_0x48470a,null);for(const _0x4e6033 of _0x4c49cc){const _0x8d1333=_0x38e9ea[_0x127b86(0x215)](_0x48470a,_0x4e6033,_0x4e6033+_0x127b86(0x1b0));if(!this[_0x127b86(0x140)](_0x8d1333))continue;const _0x407ab5=await this[_0x127b86(0x1dc)](_0x8d1333,{'encoding':_0x127b86(0x143)}),_0x574eb0=await this[_0x127b86(0x1aa)](_0x407ab5);for(const _0x2c3aa1 of _0x574eb0[_0x127b86(0x1d1)]||[])if(!0x0===_0x2c3aa1[_0x127b86(0x196)]){const _0x37c870=_0x38e9ea[_0x127b86(0x215)](_0x48470a,_0x4e6033,this['C'][_0x127b86(0x1d1)],_0x2c3aa1['version'],_0x2c3aa1[_0x127b86(0x15c)]+_0x127b86(0x125)),_0x4940ae=_0x38e9ea['join'](this[_0x127b86(0x166)],this['C'][_0x127b86(0x145)],_0x2692b9,_0x574eb0[_0x127b86(0x15c)]+_0x127b86(0x125));await this[_0x127b86(0x13c)](_0x38e9ea[_0x127b86(0x1b6)](_0x4940ae),{'recursive':!0x0}),await this[_0x127b86(0x193)](_0x37c870,_0x4940ae);}}}async['copySchemasToAnotherDir'](){const _0xb6c7d9=_0x1b0e0f,_0xb35e1d=this['C'][_0xb6c7d9(0x1cd)],_0xb54fa5=this['C'][_0xb6c7d9(0x1d8)],_0x243e37=_0x38e9ea[_0xb6c7d9(0x215)](_0x2f0ddb,this['C'][_0xb6c7d9(0x145)],this[_0xb6c7d9(0x17a)][_0xb6c7d9(0x176)],_0xb35e1d),_0x5913eb=await this['readDirCustom'](_0x243e37,null);for(const _0x293b64 of _0x5913eb){const _0x3c516d=_0x38e9ea[_0xb6c7d9(0x215)](_0x243e37,_0x293b64,_0x293b64+_0xb6c7d9(0x1b0));if(!this[_0xb6c7d9(0x140)](_0x3c516d))continue;const _0x4d2f8c=await this[_0xb6c7d9(0x1dc)](_0x3c516d,{'encoding':_0xb6c7d9(0x143)}),_0x44a149=await this['parseYaml'](_0x4d2f8c),_0x2427ef=_0x38e9ea[_0xb6c7d9(0x215)](this[_0xb6c7d9(0x166)],this['C']['src'],_0xb54fa5,_0x44a149['instanceName'],_0x44a149[_0xb6c7d9(0x1bd)]);await this['fsMkDir'](_0x2427ef,{'recursive':!0x0});const _0x3a1d7e=_0x38e9ea[_0xb6c7d9(0x215)](_0x243e37,_0x293b64,_0x44a149['collectionName']+_0xb6c7d9(0xfe)),_0x6dd559=_0x38e9ea[_0xb6c7d9(0x215)](_0x2427ef,_0x44a149[_0xb6c7d9(0x117)]+'.config.ts');await this[_0xb6c7d9(0x193)](_0x3a1d7e,_0x6dd559);}}async['copyDBMigrationsToAnotherDir'](){const _0x184917=_0x1b0e0f,_0x429fbe=this['C'][_0x184917(0x209)],_0x46f647=this['C'][_0x184917(0xfb)],_0x2bc7b9=_0x38e9ea[_0x184917(0x215)](_0x2f0ddb,this['C'][_0x184917(0x145)],this[_0x184917(0x17a)][_0x184917(0x176)],_0x429fbe),_0x4d89f1=await this['readDirCustom'](_0x2bc7b9,null);for(const _0x407d9c of _0x4d89f1){const _0x337f93=_0x38e9ea['join'](_0x2bc7b9,_0x407d9c,_0x407d9c+_0x184917(0x1b0));if(!this[_0x184917(0x140)](_0x337f93))continue;const _0x2a3f20=await this[_0x184917(0x1dc)](_0x337f93,{'encoding':_0x184917(0x143)}),_0xcfb8ab=await this[_0x184917(0x1aa)](_0x2a3f20),_0xbf879c=_0x38e9ea[_0x184917(0x215)](this[_0x184917(0x166)],this['C'][_0x184917(0x145)],_0x46f647);await this[_0x184917(0x13c)](_0xbf879c,{'recursive':!0x0});const _0x361824=_0x38e9ea[_0x184917(0x215)](_0x2bc7b9,_0x407d9c,_0xcfb8ab[_0x184917(0x15c)]+'.ts'),_0x128dbc=_0x38e9ea[_0x184917(0x215)](_0xbf879c,_0xcfb8ab[_0x184917(0x15c)]+_0x184917(0x125));await this['fsLink'](_0x361824,_0x128dbc);}}async[_0x1b0e0f(0x152)](){const _0x502da5=_0x1b0e0f,_0x56c9d6=this['C']['ProcessInitializersReadF'],_0xc92182=this['C'][_0x502da5(0x185)],_0x2ddab5=_0x38e9ea[_0x502da5(0x215)](_0x2f0ddb,this['C']['src'],this[_0x502da5(0x17a)][_0x502da5(0x176)],_0x56c9d6),_0x46622c=await this[_0x502da5(0x1de)](_0x2ddab5,null);for(const _0x342a0f of _0x46622c){const _0xb088be=_0x38e9ea[_0x502da5(0x215)](_0x2ddab5,_0x342a0f,_0x342a0f+_0x502da5(0x1b0));if(!this[_0x502da5(0x140)](_0xb088be))continue;const _0x449f8c=await this[_0x502da5(0x1dc)](_0xb088be,{'encoding':_0x502da5(0x143)}),_0xf20bcc=await this[_0x502da5(0x1aa)](_0x449f8c),_0x3bed9f=_0x38e9ea['join'](this[_0x502da5(0x166)],this['C']['src'],_0xc92182);await this[_0x502da5(0x13c)](_0x3bed9f,{'recursive':!0x0});const _0x58e1c4=_0x38e9ea[_0x502da5(0x215)](_0x2ddab5,_0x342a0f,_0xf20bcc[_0x502da5(0x15c)]+_0x502da5(0x125)),_0x46c648=_0x38e9ea[_0x502da5(0x215)](_0x3bed9f,_0xf20bcc['name']+'.ts');await this[_0x502da5(0x193)](_0x58e1c4,_0x46c648);}}async[_0x1b0e0f(0x257)](){const _0x17349a=_0x1b0e0f,_0x295464=this['C'][_0x17349a(0x1bf)],_0x98303b=this['C'][_0x17349a(0x19b)],_0xee1664=_0x38e9ea[_0x17349a(0x215)](_0x2f0ddb,this['C'][_0x17349a(0x145)],this[_0x17349a(0x17a)][_0x17349a(0x176)],_0x295464),_0x4858c6=await this['readDirCustom'](_0xee1664,null);for(const _0x54f304 of _0x4858c6){const _0x567594=_0x38e9ea[_0x17349a(0x215)](_0xee1664,_0x54f304,_0x54f304+_0x17349a(0x1b0));if(!this[_0x17349a(0x140)](_0x567594))continue;const _0x18ca76=await this[_0x17349a(0x1dc)](_0x567594,{'encoding':'utf8'}),_0x154ed3=await this[_0x17349a(0x1aa)](_0x18ca76),_0x2ccfa3=_0x38e9ea['join'](this[_0x17349a(0x166)],this['C'][_0x17349a(0x145)],_0x98303b);await this[_0x17349a(0x13c)](_0x2ccfa3,{'recursive':!0x0});const _0x2dc15c=_0x38e9ea['join'](_0xee1664,_0x54f304,_0x154ed3[_0x17349a(0x15c)]+_0x17349a(0x125)),_0x51d101=_0x38e9ea[_0x17349a(0x215)](_0x2ccfa3,_0x154ed3[_0x17349a(0x15c)]+_0x17349a(0x125));await this[_0x17349a(0x193)](_0x2dc15c,_0x51d101);}}async[_0x1b0e0f(0x175)](){const _0xd59868=_0x1b0e0f,_0x247e6e=this['C'][_0xd59868(0x11a)],_0x3f82f8=this['C']['DBMastersWriteF'],_0x41bd47=_0x38e9ea['join'](_0x2f0ddb,this['C']['src'],this[_0xd59868(0x17a)][_0xd59868(0x176)],_0x247e6e),_0x1ce0ba=await this[_0xd59868(0x1de)](_0x41bd47,null);for(const _0x248dd6 of _0x1ce0ba){const _0x1b05c0=_0x38e9ea[_0xd59868(0x215)](_0x41bd47,_0x248dd6,_0x248dd6+'.yaml');if(!this[_0xd59868(0x140)](_0x1b05c0))continue;const _0x4f330d=await this[_0xd59868(0x1dc)](_0x1b05c0,{'encoding':'utf8'}),_0x883eed=await this[_0xd59868(0x1aa)](_0x4f330d),_0xa9bc2b=_0x38e9ea[_0xd59868(0x215)](this[_0xd59868(0x166)],this['C']['src'],_0x3f82f8,_0x883eed[_0xd59868(0x15c)]);await this['fsMkDir'](_0xa9bc2b,{'recursive':!0x0});const _0x509ba5=_0x38e9ea[_0xd59868(0x215)](_0x41bd47,_0x248dd6,_0x883eed[_0xd59868(0x15c)]+_0xd59868(0x125)),_0x5392a3=_0x38e9ea['join'](_0xa9bc2b,_0x883eed['name']+'.ts');await this['fsLink'](_0x509ba5,_0x5392a3);const _0x47c4c7=_0x38e9ea[_0xd59868(0x215)](_0x41bd47,_0x248dd6,_0x883eed[_0xd59868(0x15c)]+_0xd59868(0xfe)),_0x147664=_0x38e9ea[_0xd59868(0x215)](_0xa9bc2b,_0x883eed['name']+'.config.ts');await this[_0xd59868(0x193)](_0x47c4c7,_0x147664);}}async[_0x1b0e0f(0x15b)](){const _0x1f9447=_0x1b0e0f,_0x43eb55=this['C'][_0x1f9447(0x23e)],_0x201678=this['C'][_0x1f9447(0x111)],_0xebb512=_0x38e9ea[_0x1f9447(0x215)](_0x2f0ddb,this['C'][_0x1f9447(0x145)],this['config']['adminUserPath'],_0x43eb55),_0x26c289=await this['readDirCustom'](_0xebb512,null);for(const _0x507de1 of _0x26c289){const _0x1ebe20=_0x38e9ea[_0x1f9447(0x215)](_0xebb512,_0x507de1,_0x507de1+_0x1f9447(0x1b0));if(!this[_0x1f9447(0x140)](_0x1ebe20))continue;const _0x4e5767=await this[_0x1f9447(0x1dc)](_0x1ebe20,{'encoding':_0x1f9447(0x143)}),_0x1684a5=await this[_0x1f9447(0x1aa)](_0x4e5767),_0x4938cb=_0x38e9ea[_0x1f9447(0x215)](this[_0x1f9447(0x166)],this['C'][_0x1f9447(0x145)],_0x201678);await this['fsMkDir'](_0x4938cb,{'recursive':!0x0});const _0x26cb3f=_0x38e9ea[_0x1f9447(0x215)](_0xebb512,_0x507de1,_0x1684a5[_0x1f9447(0x15c)]+_0x1f9447(0x229)),_0x793030=_0x38e9ea['join'](_0x4938cb,_0x1684a5['name']+_0x1f9447(0x229));await this['fsLink'](_0x26cb3f,_0x793030);}}async['copyDBMasterUtilsToAnotherDir'](){const _0x805b07=_0x1b0e0f,_0x48360b=this['C'][_0x805b07(0x18f)],_0x3d8d85=this['C'][_0x805b07(0x238)],_0x40c4b8=_0x38e9ea[_0x805b07(0x215)](_0x2f0ddb,this['C'][_0x805b07(0x145)],this[_0x805b07(0x17a)]['adminUserPath'],_0x48360b),_0x56fe50=await this['readDirCustom'](_0x40c4b8,null);for(const _0x4825d8 of _0x56fe50){const _0x11d455=_0x38e9ea[_0x805b07(0x215)](_0x40c4b8,_0x4825d8,_0x4825d8+'.yaml');if(!this[_0x805b07(0x140)](_0x11d455))continue;const _0x5c5f0f=await this[_0x805b07(0x1dc)](_0x11d455,{'encoding':_0x805b07(0x143)}),_0x4f8930=await this[_0x805b07(0x1aa)](_0x5c5f0f),_0x555815=_0x38e9ea[_0x805b07(0x215)](this[_0x805b07(0x166)],this['C'][_0x805b07(0x145)],_0x3d8d85);await this['fsMkDir'](_0x555815,{'recursive':!0x0});const _0x5b10d9=_0x38e9ea[_0x805b07(0x215)](_0x40c4b8,_0x4825d8,_0x4f8930['name']+'.ts'),_0x15a477=_0x38e9ea[_0x805b07(0x215)](_0x555815,_0x4f8930['name']+_0x805b07(0x125));await this[_0x805b07(0x193)](_0x5b10d9,_0x15a477);}}async[_0x1b0e0f(0x168)](){const _0xd6fb09=_0x1b0e0f,_0xac8114=this['C'][_0xd6fb09(0x1c6)],_0x4e85ce=this['C']['TestCasesWriteF'],_0x280d6e=_0x38e9ea['join'](_0x2f0ddb,this['C'][_0xd6fb09(0x145)],this[_0xd6fb09(0x17a)][_0xd6fb09(0x176)],_0xac8114),_0x1a6c78=await this['readDirCustom'](_0x280d6e,null);for(const _0x73ae6a of _0x1a6c78){const _0x4d9ec2=_0x38e9ea['join'](_0x280d6e,_0x73ae6a,_0x73ae6a+_0xd6fb09(0x1b0));if(!this[_0xd6fb09(0x140)](_0x4d9ec2))continue;const _0x55d046=await this[_0xd6fb09(0x1dc)](_0x4d9ec2,{'encoding':_0xd6fb09(0x143)}),_0xa15687=await this[_0xd6fb09(0x1aa)](_0x55d046),_0x32273d=_0x38e9ea[_0xd6fb09(0x215)](this[_0xd6fb09(0x166)],this['C'][_0xd6fb09(0x145)],_0x4e85ce);await this[_0xd6fb09(0x13c)](_0x32273d,{'recursive':!0x0});const _0x3b6df9=_0x38e9ea[_0xd6fb09(0x215)](_0x280d6e,_0x73ae6a,_0xa15687[_0xd6fb09(0x15c)]+_0xd6fb09(0x125)),_0x1b920e=_0x38e9ea[_0xd6fb09(0x215)](_0x32273d,_0xa15687[_0xd6fb09(0x15c)]+_0xd6fb09(0x125));await this['fsLink'](_0x3b6df9,_0x1b920e);}}async[_0x1b0e0f(0x128)](){const _0xfca5b6=_0x1b0e0f,_0x589646=this['C'][_0xfca5b6(0x1b7)],_0x389c59=this['C']['ThirdPartyApiWriteF'],_0x2c7dd7=_0x38e9ea[_0xfca5b6(0x215)](_0x2f0ddb,this['C'][_0xfca5b6(0x145)],this[_0xfca5b6(0x17a)][_0xfca5b6(0x176)],_0x589646);if(!this[_0xfca5b6(0x140)](_0x2c7dd7))return;const _0x518fa0=await this['readDirCustom'](_0x2c7dd7,null);for(const _0x57fd1d of _0x518fa0){const _0xb5bcd8=_0x38e9ea[_0xfca5b6(0x215)](_0x2c7dd7,_0x57fd1d,this['C']['apis']),_0xf9dc4e=await this['readDirCustom'](_0xb5bcd8,null);for(const _0x208c21 of _0xf9dc4e){const _0x366541=_0x38e9ea[_0xfca5b6(0x215)](_0xb5bcd8,_0x208c21,_0x208c21+_0xfca5b6(0x1b0));if(!this[_0xfca5b6(0x140)](_0x366541))continue;const _0x384af6=await this[_0xfca5b6(0x1dc)](_0x366541,{'encoding':_0xfca5b6(0x143)}),_0x243a2a=await this[_0xfca5b6(0x1aa)](_0x384af6);for(const _0x2cca29 of _0x243a2a[_0xfca5b6(0x1d1)]||[])if(!0x0===_0x2cca29[_0xfca5b6(0x196)]){const _0x277631=_0x38e9ea['join'](_0xb5bcd8,_0x208c21,this['C'][_0xfca5b6(0x1d1)],_0x2cca29[_0xfca5b6(0x20e)]),_0x443bae=_0x38e9ea['join'](_0x277631,_0x2cca29[_0xfca5b6(0x15c)]+_0xfca5b6(0x125)),_0x59f308=_0x38e9ea[_0xfca5b6(0x215)](this[_0xfca5b6(0x166)],this['C'][_0xfca5b6(0x145)],_0x389c59,_0x57fd1d,_0x243a2a[_0xfca5b6(0x21f)],_0x243a2a[_0xfca5b6(0x15c)]+_0xfca5b6(0x125));await this['fsMkDir'](_0x38e9ea[_0xfca5b6(0x1b6)](_0x59f308),{'recursive':!0x0}),await this[_0xfca5b6(0x193)](_0x443bae,_0x59f308);const _0x95d7d0=_0x38e9ea[_0xfca5b6(0x215)](_0xb5bcd8,_0x208c21,_0x208c21+'.config.ts'),_0x2f9556=_0x38e9ea[_0xfca5b6(0x215)](this[_0xfca5b6(0x166)],this['C']['src'],_0x389c59,_0x57fd1d,_0x243a2a['path'],_0x243a2a['name']+_0xfca5b6(0xfe));await this[_0xfca5b6(0x193)](_0x95d7d0,_0x2f9556);for(const _0x1a12fe of _0x2cca29[_0xfca5b6(0x222)]){const _0x152df2=_0x38e9ea[_0xfca5b6(0x215)](_0x277631,this['C'][_0xfca5b6(0x222)],_0x1a12fe[_0xfca5b6(0x15c)]+'.ts'),_0x1de727=_0x38e9ea['join'](this[_0xfca5b6(0x166)],this['C'][_0xfca5b6(0x145)],_0x389c59,_0x57fd1d,_0x243a2a[_0xfca5b6(0x21f)],this['C'][_0xfca5b6(0x222)],_0x1a12fe['name']+_0xfca5b6(0x125));await this['fsMkDir'](_0x38e9ea[_0xfca5b6(0x1b6)](_0x1de727),{'recursive':!0x0}),await this[_0xfca5b6(0x193)](_0x152df2,_0x1de727);}for(const _0x23e95c of _0x2cca29[_0xfca5b6(0x1e0)]){const _0x4a22ee=_0x38e9ea[_0xfca5b6(0x215)](_0x277631,this['C'][_0xfca5b6(0x1e0)],_0x23e95c[_0xfca5b6(0x15c)]+_0xfca5b6(0x125)),_0x1f1ad5=_0x38e9ea['join'](this[_0xfca5b6(0x166)],this['C']['src'],_0x389c59,_0x57fd1d,_0x243a2a[_0xfca5b6(0x21f)],this['C'][_0xfca5b6(0x1e0)],_0x23e95c[_0xfca5b6(0x15c)]+_0xfca5b6(0x125));await this[_0xfca5b6(0x13c)](_0x38e9ea[_0xfca5b6(0x1b6)](_0x1f1ad5),{'recursive':!0x0}),await this['fsLink'](_0x4a22ee,_0x1f1ad5);}}}}}async[_0x1b0e0f(0x1ec)](){const _0xd89e84=_0x1b0e0f,_0x1f6d8a=this['C'][_0xd89e84(0x14f)],_0x4b7c69=this['C'][_0xd89e84(0x172)],_0x498fdc=_0x38e9ea['join'](_0x2f0ddb,this['C']['src'],this[_0xd89e84(0x17a)][_0xd89e84(0x176)],_0x1f6d8a),_0x3aff67=await this[_0xd89e84(0x1de)](_0x498fdc,null);for(const _0x550fe4 of _0x3aff67){const _0x302eac=_0x38e9ea[_0xd89e84(0x215)](_0x498fdc,_0x550fe4,_0x550fe4+_0xd89e84(0x1b0));if(!this[_0xd89e84(0x140)](_0x302eac))continue;const _0x2d9420=await this[_0xd89e84(0x1dc)](_0x302eac,{'encoding':'utf8'}),_0x450fec=await this[_0xd89e84(0x1aa)](_0x2d9420),_0x17d6a4=_0x38e9ea[_0xd89e84(0x215)](_0x498fdc,_0x550fe4,this['C'][_0xd89e84(0x1fb)]);for(const _0x2d3ec2 of _0x450fec[_0xd89e84(0x16d)])for(const _0x3b42d7 of _0x2d3ec2[_0xd89e84(0x1d1)]||[])if(!0x0===_0x3b42d7[_0xd89e84(0x196)]){const _0x39c48d=_0x38e9ea['join'](_0x17d6a4,_0x2d3ec2['name'],this['C'][_0xd89e84(0x1d1)],_0x3b42d7[_0xd89e84(0x20e)],_0x3b42d7[_0xd89e84(0x15c)]+_0xd89e84(0x125)),_0x6871b5=_0x38e9ea[_0xd89e84(0x215)](this[_0xd89e84(0x166)],this['C']['src'],_0x4b7c69,_0x450fec[_0xd89e84(0x15c)],_0x2d3ec2['name']+_0xd89e84(0x125));await this[_0xd89e84(0x13c)](_0x38e9ea[_0xd89e84(0x1b6)](_0x6871b5),{'recursive':!0x0}),await this[_0xd89e84(0x193)](_0x39c48d,_0x6871b5);}}}async['copyInstanceApiHooksToAnotherDir'](){const _0x3e5a19=_0x1b0e0f,_0x242cda=this['C'][_0x3e5a19(0x10d)],_0x4cd538=this['C'][_0x3e5a19(0x1c8)],_0x396a73=_0x38e9ea[_0x3e5a19(0x215)](_0x2f0ddb,this['C'][_0x3e5a19(0x145)],this[_0x3e5a19(0x17a)][_0x3e5a19(0x176)],_0x242cda),_0x17dc98=await this[_0x3e5a19(0x1de)](_0x396a73,null);for(const _0x27cb58 of _0x17dc98){const _0x531845=_0x38e9ea[_0x3e5a19(0x215)](_0x396a73,_0x27cb58,_0x27cb58+_0x3e5a19(0x1b0));if(!this[_0x3e5a19(0x140)](_0x531845))continue;const _0x422b04=await this[_0x3e5a19(0x1dc)](_0x531845,{'encoding':_0x3e5a19(0x143)}),_0x227a51=await this[_0x3e5a19(0x1aa)](_0x422b04),_0x146a18=_0x38e9ea[_0x3e5a19(0x215)](_0x396a73,_0x27cb58),_0x4d8af2=_0x227a51[_0x3e5a19(0x197)]+'/'+_0x227a51[_0x3e5a19(0x1bd)]+'/'+_0x227a51['collectionName']+'/'+_0x227a51[_0x3e5a19(0x191)][_0x3e5a19(0x219)]();for(const _0xd0e9b9 of _0x227a51[_0x3e5a19(0x222)]){const _0x468a8d=_0x38e9ea[_0x3e5a19(0x215)](_0x146a18,this['C'][_0x3e5a19(0x222)],_0xd0e9b9['name']+'.ts'),_0x346ae6=_0x38e9ea[_0x3e5a19(0x215)](this[_0x3e5a19(0x166)],this['C'][_0x3e5a19(0x145)],_0x4cd538,_0x4d8af2,this['C']['preHooks'],_0xd0e9b9[_0x3e5a19(0x15c)]+_0x3e5a19(0x125));await this['fsMkDir'](_0x38e9ea[_0x3e5a19(0x1b6)](_0x346ae6),{'recursive':!0x0}),await this[_0x3e5a19(0x193)](_0x468a8d,_0x346ae6);}for(const _0x261ab7 of _0x227a51[_0x3e5a19(0x1e0)]){const _0x115103=_0x38e9ea['join'](_0x146a18,this['C'][_0x3e5a19(0x1e0)],_0x261ab7['name']+_0x3e5a19(0x125)),_0x2493d8=_0x38e9ea[_0x3e5a19(0x215)](this[_0x3e5a19(0x166)],this['C'][_0x3e5a19(0x145)],_0x4cd538,_0x4d8af2,this['C']['postHooks'],_0x261ab7['name']+'.ts');await this['fsMkDir'](_0x38e9ea[_0x3e5a19(0x1b6)](_0x2493d8),{'recursive':!0x0}),await this[_0x3e5a19(0x193)](_0x115103,_0x2493d8);}}}async[_0x1b0e0f(0x10c)](){const _0x58d9bf=_0x1b0e0f,_0x284007=this['C'][_0x58d9bf(0x1a0)],_0x1c2f7f=this['C'][_0x58d9bf(0x1bc)],_0x3bebf8=_0x38e9ea[_0x58d9bf(0x215)](_0x2f0ddb,this['C'][_0x58d9bf(0x145)],this[_0x58d9bf(0x17a)][_0x58d9bf(0x176)],_0x284007),_0x31ae92=await this[_0x58d9bf(0x1de)](_0x3bebf8,null);for(const _0x350a72 of _0x31ae92){const _0x39b5c5=_0x38e9ea['join'](_0x3bebf8,_0x350a72,_0x350a72+_0x58d9bf(0x1b0));if(!this[_0x58d9bf(0x140)](_0x39b5c5))continue;const _0x5b4c7f=await this[_0x58d9bf(0x1dc)](_0x39b5c5,{'encoding':_0x58d9bf(0x143)}),_0x5810a9=await this['parseYaml'](_0x5b4c7f),_0x3aa1f0=_0x38e9ea[_0x58d9bf(0x215)](_0x3bebf8,_0x350a72),_0x3f566e=_0x5810a9[_0x58d9bf(0x191)][_0x58d9bf(0x219)]();for(const _0x1fa38d of _0x5810a9[_0x58d9bf(0x222)]){const _0x40d59a=_0x38e9ea[_0x58d9bf(0x215)](_0x3aa1f0,this['C']['preHooks'],_0x1fa38d[_0x58d9bf(0x15c)]+_0x58d9bf(0x125)),_0x18eb4c=_0x38e9ea[_0x58d9bf(0x215)](this[_0x58d9bf(0x166)],this['C']['src'],_0x1c2f7f,_0x3f566e,this['C'][_0x58d9bf(0x222)],_0x1fa38d[_0x58d9bf(0x15c)]+_0x58d9bf(0x125));await this[_0x58d9bf(0x13c)](_0x38e9ea[_0x58d9bf(0x1b6)](_0x18eb4c),{'recursive':!0x0}),await this[_0x58d9bf(0x193)](_0x40d59a,_0x18eb4c);}for(const _0x42f01c of _0x5810a9['postHooks']){const _0x21687d=_0x38e9ea[_0x58d9bf(0x215)](_0x3aa1f0,this['C'][_0x58d9bf(0x1e0)],_0x42f01c['name']+_0x58d9bf(0x125)),_0x50fdc3=_0x38e9ea[_0x58d9bf(0x215)](this[_0x58d9bf(0x166)],this['C'][_0x58d9bf(0x145)],_0x1c2f7f,_0x3f566e,this['C'][_0x58d9bf(0x1e0)],_0x42f01c[_0x58d9bf(0x15c)]+_0x58d9bf(0x125));await this[_0x58d9bf(0x13c)](_0x38e9ea[_0x58d9bf(0x1b6)](_0x50fdc3),{'recursive':!0x0}),await this[_0x58d9bf(0x193)](_0x21687d,_0x50fdc3);}}}async[_0x1b0e0f(0x1e5)](){const _0xdfa899=_0x1b0e0f,_0x582352=this['C'][_0xdfa899(0x21d)],_0x1c5289=this['C']['WebSocketEventsWriteF'],_0x4b080c=_0x38e9ea[_0xdfa899(0x215)](_0x2f0ddb,this['C'][_0xdfa899(0x145)],this[_0xdfa899(0x17a)]['adminUserPath'],_0x582352),_0x357aae=await this[_0xdfa899(0x1de)](_0x4b080c,null);for(const _0x3308ba of _0x357aae){const _0x3b3f77=_0x38e9ea['join'](_0x4b080c,_0x3308ba,_0x3308ba+'.yaml');if(!this[_0xdfa899(0x140)](_0x3b3f77))continue;const _0xe7ed80=await this[_0xdfa899(0x1dc)](_0x3b3f77,{'encoding':_0xdfa899(0x143)}),_0x22cf5f=await this['parseYaml'](_0xe7ed80);for(const _0x131fe3 of _0x22cf5f['versions']||[])if(!0x0===_0x131fe3[_0xdfa899(0x196)]){const _0x3172d2=_0x38e9ea['join'](_0x4b080c,_0x3308ba,this['C'][_0xdfa899(0x1d1)],_0x131fe3[_0xdfa899(0x20e)],_0x131fe3[_0xdfa899(0x15c)]+_0xdfa899(0x125));let _0x909451='',_0x3bc7c6='';_0x22cf5f[_0xdfa899(0x134)]===_0x513751[_0xdfa899(0x247)]?(_0x3bc7c6=_0xdfa899(0x232),_0x909451=_0x22cf5f['instanceName']+'/'+_0x22cf5f[_0xdfa899(0x1bd)]+'/'+_0x22cf5f[_0xdfa899(0x117)]+'/'+_0x22cf5f[_0xdfa899(0x19a)][_0xdfa899(0x219)]()):_0x22cf5f[_0xdfa899(0x134)]===_0x513751[_0xdfa899(0x146)]?(_0x3bc7c6=_0xdfa899(0x1e6),_0x909451=_0x22cf5f[_0xdfa899(0x14d)]+'/'+_0x22cf5f[_0xdfa899(0x1e7)]):_0x22cf5f[_0xdfa899(0x134)]===_0x513751[_0xdfa899(0x119)]?(_0x3bc7c6=_0xdfa899(0x1c3),_0x909451=_0x22cf5f[_0xdfa899(0x1d5)]):_0x22cf5f[_0xdfa899(0x134)]===_0x513751[_0xdfa899(0x133)]?(_0x3bc7c6='system-apis',_0x909451=_0x22cf5f[_0xdfa899(0x13d)][_0xdfa899(0x219)]()):_0x22cf5f['apiCategory']===_0x513751[_0xdfa899(0x1d3)]&&(_0x3bc7c6='ws-events',_0x909451=_0x22cf5f[_0xdfa899(0x15c)]);const _0x5ade84=_0x38e9ea[_0xdfa899(0x215)](this[_0xdfa899(0x166)],this['C'][_0xdfa899(0x145)],_0x1c5289,_0x3bc7c6,_0x909451+_0xdfa899(0x125));await this[_0xdfa899(0x13c)](_0x38e9ea[_0xdfa899(0x1b6)](_0x5ade84),{'recursive':!0x0}),await this['fsLink'](_0x3172d2,_0x5ade84);}}}async[_0x1b0e0f(0x154)](){const _0xe1b6bf=_0x1b0e0f,_0xd61f3b=this['C']['CollectionHooksReadF'],_0x257b42=this['C'][_0xe1b6bf(0x1f8)],_0x4d2bf8=_0x38e9ea['join'](_0x2f0ddb,this['C'][_0xe1b6bf(0x145)],this['config'][_0xe1b6bf(0x176)],_0xd61f3b),_0x204171=await this[_0xe1b6bf(0x1de)](_0x4d2bf8,null);for(const _0x1925bd of _0x204171){const _0x5d4927=_0x38e9ea[_0xe1b6bf(0x215)](_0x4d2bf8,_0x1925bd,_0x1925bd+_0xe1b6bf(0x1b0));if(!this[_0xe1b6bf(0x140)](_0x5d4927))continue;const _0x373253=await this[_0xe1b6bf(0x1dc)](_0x5d4927,{'encoding':_0xe1b6bf(0x143)}),_0x35fd98=await this[_0xe1b6bf(0x1aa)](_0x373253),_0x179482=_0x38e9ea[_0xe1b6bf(0x215)](_0x4d2bf8,_0x1925bd),_0x4c973a=_0x35fd98['instanceName']+'/'+_0x35fd98[_0xe1b6bf(0x1bd)]+'/'+_0x35fd98[_0xe1b6bf(0x117)];for(const _0x46e1dc of _0x35fd98[_0xe1b6bf(0x222)]){const _0x4ff95e=_0x38e9ea['join'](_0x179482,this['C'][_0xe1b6bf(0x222)],_0x46e1dc[_0xe1b6bf(0x15c)]+_0xe1b6bf(0x125)),_0x522e16=_0x38e9ea[_0xe1b6bf(0x215)](this[_0xe1b6bf(0x166)],this['C'][_0xe1b6bf(0x145)],_0x257b42,_0x4c973a,this['C'][_0xe1b6bf(0x222)],_0x46e1dc[_0xe1b6bf(0x15c)]+_0xe1b6bf(0x125));await this['fsMkDir'](_0x38e9ea[_0xe1b6bf(0x1b6)](_0x522e16),{'recursive':!0x0}),await this['fsLink'](_0x4ff95e,_0x522e16);}for(const _0x57982b of _0x35fd98['postHooks']){const _0x240765=_0x38e9ea[_0xe1b6bf(0x215)](_0x179482,this['C']['postHooks'],_0x57982b[_0xe1b6bf(0x15c)]+_0xe1b6bf(0x125)),_0x5a681e=_0x38e9ea[_0xe1b6bf(0x215)](this[_0xe1b6bf(0x166)],this['C'][_0xe1b6bf(0x145)],_0x257b42,_0x4c973a,this['C']['postHooks'],_0x57982b['name']+_0xe1b6bf(0x125));await this[_0xe1b6bf(0x13c)](_0x38e9ea[_0xe1b6bf(0x1b6)](_0x5a681e),{'recursive':!0x0}),await this[_0xe1b6bf(0x193)](_0x240765,_0x5a681e);}}}async[_0x1b0e0f(0x1a8)](){const _0x435173=_0x1b0e0f,_0x29827e=this['C']['DatabaseHooksReadF'],_0x4bb643=this['C']['DatabaseHooksWriteF'],_0x12368c=_0x38e9ea[_0x435173(0x215)](_0x2f0ddb,this['C']['src'],this[_0x435173(0x17a)][_0x435173(0x176)],_0x29827e),_0x26a4fe=await this[_0x435173(0x1de)](_0x12368c,null);for(const _0x429e80 of _0x26a4fe){const _0x454c45=_0x38e9ea[_0x435173(0x215)](_0x12368c,_0x429e80,_0x429e80+_0x435173(0x1b0));if(!this[_0x435173(0x140)](_0x454c45))continue;const _0xa9e253=await this[_0x435173(0x1dc)](_0x454c45,{'encoding':_0x435173(0x143)}),_0x2029c5=await this[_0x435173(0x1aa)](_0xa9e253),_0x2eec6d=_0x38e9ea[_0x435173(0x215)](_0x12368c,_0x429e80),_0x466b7c=_0x2029c5[_0x435173(0x197)]+'/'+_0x2029c5[_0x435173(0x1bd)];for(const _0x1ae5df of _0x2029c5['preHooks']){const _0xfa9713=_0x38e9ea[_0x435173(0x215)](_0x2eec6d,this['C'][_0x435173(0x222)],_0x1ae5df[_0x435173(0x15c)]+'.ts'),_0x41fd85=_0x38e9ea[_0x435173(0x215)](this['projectDirectory'],this['C'][_0x435173(0x145)],_0x4bb643,_0x466b7c,this['C']['preHooks'],_0x1ae5df[_0x435173(0x15c)]+'.ts');await this[_0x435173(0x13c)](_0x38e9ea['dirname'](_0x41fd85),{'recursive':!0x0}),await this['fsLink'](_0xfa9713,_0x41fd85);}for(const _0x38d8b8 of _0x2029c5[_0x435173(0x1e0)]){const _0x297bc0=_0x38e9ea[_0x435173(0x215)](_0x2eec6d,this['C']['postHooks'],_0x38d8b8['name']+_0x435173(0x125)),_0x14dbc9=_0x38e9ea['join'](this[_0x435173(0x166)],this['C'][_0x435173(0x145)],_0x4bb643,_0x466b7c,this['C'][_0x435173(0x1e0)],_0x38d8b8['name']+_0x435173(0x125));await this[_0x435173(0x13c)](_0x38e9ea[_0x435173(0x1b6)](_0x14dbc9),{'recursive':!0x0}),await this[_0x435173(0x193)](_0x297bc0,_0x14dbc9);}}}async[_0x1b0e0f(0x253)](){const _0x56a549=_0x1b0e0f,_0x4f2483=this['C'][_0x56a549(0x124)],_0x5892cd=this['C'][_0x56a549(0x210)],_0x143460=_0x38e9ea['join'](_0x2f0ddb,this['C'][_0x56a549(0x145)],this[_0x56a549(0x17a)][_0x56a549(0x176)],_0x4f2483),_0x1f4e2d=await this[_0x56a549(0x1de)](_0x143460,null);for(const _0x3a059b of _0x1f4e2d){const _0xf625f7=_0x38e9ea[_0x56a549(0x215)](_0x143460,_0x3a059b,_0x3a059b+'.yaml');if(!this[_0x56a549(0x140)](_0xf625f7))continue;const _0x4b25fe=await this[_0x56a549(0x1dc)](_0xf625f7,{'encoding':'utf8'}),_0x4d2318=await this[_0x56a549(0x1aa)](_0x4b25fe),_0x376bf1=_0x38e9ea['join'](_0x143460,_0x3a059b),_0x47ff80=''+_0x4d2318[_0x56a549(0x197)];for(const _0x5d0849 of _0x4d2318['preHooks']){const _0x28b44d=_0x38e9ea[_0x56a549(0x215)](_0x376bf1,this['C'][_0x56a549(0x222)],_0x5d0849[_0x56a549(0x15c)]+_0x56a549(0x125)),_0x5a1ca2=_0x38e9ea[_0x56a549(0x215)](this['projectDirectory'],this['C']['src'],_0x5892cd,_0x47ff80,this['C'][_0x56a549(0x222)],_0x5d0849[_0x56a549(0x15c)]+_0x56a549(0x125));await this[_0x56a549(0x13c)](_0x38e9ea[_0x56a549(0x1b6)](_0x5a1ca2),{'recursive':!0x0}),await this['fsLink'](_0x28b44d,_0x5a1ca2);}for(const _0x42192d of _0x4d2318[_0x56a549(0x1e0)]){const _0x534767=_0x38e9ea[_0x56a549(0x215)](_0x376bf1,this['C'][_0x56a549(0x1e0)],_0x42192d[_0x56a549(0x15c)]+'.ts'),_0x55f40c=_0x38e9ea['join'](this['projectDirectory'],this['C'][_0x56a549(0x145)],_0x5892cd,_0x47ff80,this['C'][_0x56a549(0x1e0)],_0x42192d[_0x56a549(0x15c)]+_0x56a549(0x125));await this[_0x56a549(0x13c)](_0x38e9ea[_0x56a549(0x1b6)](_0x55f40c),{'recursive':!0x0}),await this['fsLink'](_0x534767,_0x55f40c);}}}async['executeNpmRun'](_0x561a7f,_0x310ae1){return new Promise((_0x6d0c20,_0x5c6d7d)=>{const _0x14fd30=a0_0xf806,_0xd80c11=(0x0,_0x5ef9cc[_0x14fd30(0x126)])(_0x561a7f,_0x310ae1,{'shell':!0x0,'cwd':_0x2f0ddb});_0xd80c11['on'](_0x14fd30(0x186),_0x580130=>{const _0x26be0f=_0x14fd30;if(0x0===_0x580130)setTimeout(_0x6d0c20,0x1f4);else{const _0x161973='\x27'+_0x561a7f+'\x20'+_0x310ae1[_0x26be0f(0x215)]('\x20')+_0x26be0f(0x18d)+_0x580130+'.';_0x5c6d7d(new Error(_0x161973));}}),_0xd80c11['on'](_0x14fd30(0x1eb),_0x42d425=>{const _0x35f851=_0x14fd30;console[_0x35f851(0x1eb)](_0x35f851(0xf5)+_0x42d425['message']),_0x5c6d7d(_0x42d425);});});}async[_0x1b0e0f(0x1aa)](_0x481a25){const _0x293547=_0x1b0e0f;return _0x5b58db(0x2f8)[_0x293547(0x1f5)](_0x481a25);}['startWatch'](){const _0x1e5584=_0x1b0e0f,_0x45aa9b=_0x5b58db(0x274),_0x4dd164=_0x38e9ea[_0x1e5584(0x215)](_0x2f0ddb),_0x18a67d=_0x38e9ea[_0x1e5584(0x215)](_0x2f0ddb,this['C']['src']),_0x167a93=_0x27a7de=>{const _0x1fb553=_0x1e5584,_0x2027b2=_0x38e9ea[_0x1fb553(0x19d)](_0x4dd164,_0x27a7de);return!(_0x2027b2&&!_0x2027b2[_0x1fb553(0x12d)]('.')&&!_0x2027b2[_0x1fb553(0x13b)]('~')&&_0x2027b2[_0x1fb553(0x12d)](this['C']['src']));},_0x4663d8=_0x45aa9b[_0x1e5584(0x228)](_0x18a67d,{'persistent':!0x0,'ignoreInitial':!0x0,'depth':0x1/0x0,'awaitWriteFinish':{'stabilityThreshold':0xc8,'pollInterval':0x64}}),_0xa479b6=async(_0x52d1de,_0x3ebfd8)=>{const _0x27b84f=_0x1e5584;try{if(this['skipWatchInputs'])return;const _0x5bcabc=_0x38e9ea[_0x27b84f(0x19d)](_0x4dd164,_0x3ebfd8);if(!_0x3ebfd8||_0x167a93(_0x3ebfd8))return;console['log'](_0x27b84f(0x150)+this[_0x27b84f(0x22b)]()+_0x27b84f(0x244)+_0x52d1de+_0x27b84f(0x200)+_0x5bcabc);const _0xd2396f=this[_0x27b84f(0x23f)](_0x5bcabc),_0x94d74e=this['getChangedFolder'](_0xd2396f,_0x5bcabc);if(!_0x94d74e)return;let _0xb2db3c,_0xb4d772=!0x1;if(this[_0x27b84f(0x140)](_0x94d74e)){if(this[_0x27b84f(0x140)](_0x38e9ea[_0x27b84f(0x215)](_0x4dd164,_0x5bcabc))){const _0x4aa34b=_0x38e9ea[_0x27b84f(0x215)](_0x38e9ea['sep']+this['C'][_0x27b84f(0x1c2)],_0x94d74e);_0xb2db3c=await this[_0x27b84f(0x24c)](_0x94d74e,_0x4aa34b),this[_0x27b84f(0x10a)]({'objType':_0x9aed2c['LC_DATA_REQ_RES'],'localClientWSReqRes':{'eventType':_0x2bbdcd[_0x27b84f(0x18e)],'folderChangedOnLocalSystem':_0xb2db3c,'category':_0xd2396f,'shouldReplaceAllItemsOfCategory':_0xb4d772}});}else this['syncAllDataWithServer']();}else{const _0xab7e41=this['getChangedFolderForDeleted'](_0xd2396f,_0x5bcabc),_0xf68d29=_0x38e9ea[_0x27b84f(0x215)](_0x38e9ea[_0x27b84f(0x106)]+this['C'][_0x27b84f(0x1c2)],_0xab7e41);_0xb2db3c=await this[_0x27b84f(0x24c)](_0xab7e41,_0xf68d29),_0xb4d772=!0x0,this[_0x27b84f(0x22a)](_0xb2db3c,_0xd2396f,_0xb4d772);}}catch(_0x280f3c){console['error'](_0x27b84f(0x15d),_0x280f3c);}};_0x4663d8['on'](_0x1e5584(0x17c),_0x4b2000=>_0xa479b6(_0x1e5584(0x17c),_0x4b2000))['on'](_0x1e5584(0x189),_0x8973b2=>_0xa479b6(_0x1e5584(0x189),_0x8973b2))['on'](_0x1e5584(0x1fc),_0x46dff3=>_0xa479b6(_0x1e5584(0x1fc),_0x46dff3))['on']('addDir',_0xdefe6e=>_0xa479b6(_0x1e5584(0x23a),_0xdefe6e))['on'](_0x1e5584(0xf7),_0x520cdd=>_0xa479b6('unlinkDir',_0x520cdd))['on'](_0x1e5584(0x1eb),_0x5a1333=>console[_0x1e5584(0x1eb)](_0x1e5584(0x123),_0x5a1333)),this[_0x1e5584(0x187)]=_0x4663d8,console['log'](_0x1e5584(0x203));}[_0x1b0e0f(0x22b)](){const _0x2a17bd=_0x1b0e0f,_0x539898=new Date();return String(_0x539898[_0x2a17bd(0x12c)]())['padStart'](0x2,'0')+':'+String(_0x539898['getMinutes']())[_0x2a17bd(0x213)](0x2,'0')+':'+String(_0x539898['getSeconds']())[_0x2a17bd(0x213)](0x2,'0');}[_0x1b0e0f(0x155)](_0x451d08,_0xde9b21,_0x348743){const _0x52cdb6=_0x1b0e0f;this[_0x52cdb6(0x10a)]({'objType':_0x9aed2c[_0x52cdb6(0x164)],'localClientWSReqRes':{'eventType':_0x2bbdcd[_0x52cdb6(0x18e)],'folderChangedOnLocalSystem':_0x451d08,'category':_0xde9b21,'shouldReplaceAllItemsOfCategory':_0x348743}});}[_0x1b0e0f(0x1e2)](_0x252969,_0x2e19de){let _0x313a3b=null;return function(..._0x3617ec){clearTimeout(_0x313a3b),_0x313a3b=setTimeout(()=>{const _0xa792a5=a0_0xf806;_0x252969[_0xa792a5(0xff)](this,_0x3617ec);},_0x2e19de);};}[_0x1b0e0f(0x23f)](_0x2d0e6b){const _0x2f0625=_0x1b0e0f,_0x5be140=_0x38e9ea['join'](this['C']['src'],this[_0x2f0625(0x17a)]['adminUserPath']);if(!_0x2d0e6b[_0x2f0625(0x12d)](_0x5be140))return;const _0xb55273=_0x2d0e6b[_0x2f0625(0x1dd)](_0x38e9ea[_0x2f0625(0x106)])[_0x2f0625(0x21c)](_0x5be318=>!!_0x5be318)[0x2];for(const _0x447d2d in _0x3c2731)if(_0x3c2731[_0x447d2d]===_0xb55273)return _0xb55273;}[_0x1b0e0f(0x20a)](_0xb45b99,_0x30837d){const _0x33f96e=_0x1b0e0f,_0x40f2ca=_0x30837d[_0x33f96e(0x1dd)](_0x38e9ea[_0x33f96e(0x106)]);let _0x3dfe39='';return _0x3dfe39=_0xb45b99===_0x3c2731[_0x33f96e(0x146)]?_0x40f2ca[_0x33f96e(0x220)](0x0,0x6)[_0x33f96e(0x215)](_0x38e9ea[_0x33f96e(0x106)]):_0x40f2ca['slice'](0x0,0x4)['join'](_0x38e9ea[_0x33f96e(0x106)]),_0x3dfe39;}['getChangedFolderForDeleted'](_0x3981e4,_0x3fe8d5){const _0x1c0a8b=_0x1b0e0f;return _0x3fe8d5['split'](_0x38e9ea[_0x1c0a8b(0x106)])[_0x1c0a8b(0x220)](0x0,0x3)[_0x1c0a8b(0x215)](_0x38e9ea['sep']);}async[_0x1b0e0f(0x24c)](_0x5207a6,_0xcfe9c5){const _0x502def={},_0x339b76=this;return await async function _0x243560(_0x34642e){const _0xad5eff=a0_0xf806,_0x591b08=await _0x339b76[_0xad5eff(0x1de)](_0x34642e,{'withFileTypes':!0x0});for(const _0x3ef60e of _0x591b08){const _0x1f8623=_0x38e9ea['join'](_0x34642e,_0x3ef60e[_0xad5eff(0x15c)]),_0x211225=_0x38e9ea['normalize'](_0x1f8623);if(_0x3ef60e[_0xad5eff(0x249)]())await _0x243560(_0x211225);else{const _0x2951af=_0x2a0ea6[_0xad5eff(0x1f6)](_0x211225),_0x4217f6=_0x38e9ea['relative'](_0x5207a6,_0x211225),_0x24700f=_0x38e9ea[_0xad5eff(0x215)](_0xcfe9c5,_0x4217f6)['split'](_0x38e9ea['sep'])['join'](_0x38e9ea[_0xad5eff(0x1cf)][_0xad5eff(0x106)]);_0x502def[_0x24700f]={'encoding':_0xad5eff(0x1d6),'content':_0x2951af['toString'](_0xad5eff(0x1d6))};}}}(_0x5207a6),_0x502def;}['sendToServer'](_0x2a6c15){const _0x1e45e6=_0x1b0e0f;try{this['ws'][_0x1e45e6(0x1ea)](JSON['stringify'](_0x2a6c15));}catch(_0x53208b){console[_0x1e45e6(0x1af)](_0x53208b);}}async['connectToServerViaWS'](){const _0x5d30bf=_0x1b0e0f;console[_0x5d30bf(0x1af)](_0x5d30bf(0x236));const _0x2a1d73=this[_0x5d30bf(0x17a)][_0x5d30bf(0x15a)],_0x9dd911=this['config'][_0x5d30bf(0x176)],_0x4e73d3=this['config']['webSocketURL'];this['ws']=new WebSocket(_0x4e73d3+_0x5d30bf(0x12b)+_0x2a1d73+_0x5d30bf(0x144)+_0x9dd911);const _0x59d7aa=[],_0x277dc3=()=>{const _0x47c61c=_0x5d30bf;this[_0x47c61c(0x10a)]({'objType':_0x9aed2c['REGISTER'],'onEvents':[{'eventType':_0x47c61c(0x138)}]});};function _0x422d47(_0x295dcc){const _0x3c82af=_0x5d30bf;_0x295dcc['onopen']=null,_0x295dcc[_0x3c82af(0x204)]=null,_0x295dcc['onerror']=null,_0x295dcc[_0x3c82af(0x159)]=null,_0x295dcc[_0x3c82af(0x186)]();}this['ws'][_0x5d30bf(0x204)]=async _0x317940=>{const _0x527937=_0x5d30bf,_0x5bc60e=JSON['parse'](_0x317940[_0x527937(0x226)]);if(_0x5bc60e[_0x527937(0x224)]===_0x9aed2c['CONNECTED']&&_0x5bc60e[_0x527937(0x1a2)]['connected'])_0x277dc3();else{if(_0x5bc60e[_0x527937(0x224)]===_0x9aed2c['REGISTER']){if(_0x5bc60e?.[_0x527937(0x1a2)]?.[_0x527937(0x225)]?.[_0x527937(0x206)]){for(const _0xbf5848 of _0x5bc60e['response'][_0x527937(0x225)])_0x59d7aa[_0x527937(0x1c7)](_0xbf5848);console['log']('✅\x20Connected\x20to\x20server\x20via\x20WS'),!0x1===this[_0x527937(0x1ae)]&&(this['isWSConnectedFirstTime']=!0x0,console[_0x527937(0x1af)](this[_0x527937(0x165)]+'✳️\x20Open\x20folder\x20in\x20IDE\x20:\x20'+this[_0x527937(0x166)]+this['colorEnd'])),this['syncAllDataWithServer']();}else{const _0x4af29a=_0x5bc60e[_0x527937(0x1a2)]?.[_0x527937(0x15e)]?.[0x0]?.[_0x527937(0x1b4)]?.[0x0]?.[_0x527937(0x188)]||_0x527937(0x1c0);console[_0x527937(0x1af)]('❌\x20'+_0x4af29a),await this[_0x527937(0xf9)](0x1);}}else await this['processReceivedEvent'](_0x5bc60e);}},this['ws'][_0x5d30bf(0x159)]=_0x4b8b01=>{const _0x3a8b20=_0x5d30bf;console[_0x3a8b20(0x1af)](_0x3a8b20(0x142)),_0x422d47(this['ws']),setTimeout(this[_0x3a8b20(0x11c)][_0x3a8b20(0x1b5)](this),0xbb8);},this['ws'][_0x5d30bf(0x1f9)]=()=>{const _0x4e3e41=_0x5d30bf;_0x422d47(this['ws']),setTimeout(this[_0x4e3e41(0x11c)][_0x4e3e41(0x1b5)](this),0xbb8);};}[_0x1b0e0f(0x1da)](){const _0x326c58=_0x1b0e0f;this[_0x326c58(0x10a)]({'objType':_0x9aed2c['LC_DATA_REQ_RES'],'localClientWSReqRes':{'eventType':_0x2bbdcd[_0x326c58(0x207)]}});}async[_0x1b0e0f(0x11b)](_0x9ceebb){const _0x401a46=_0x1b0e0f;if(this['EL']&&_0x9ceebb[_0x401a46(0x1a2)][_0x401a46(0x1a5)]!==_0x2bbdcd[_0x401a46(0x207)]&&console[_0x401a46(0x1af)](_0x9ceebb),_0x9ceebb[_0x401a46(0x224)]===_0x9aed2c[_0x401a46(0x164)]){if(_0x9ceebb['errors']?.[_0x401a46(0x206)])return void console[_0x401a46(0x1eb)](_0x9ceebb[_0x401a46(0x1b4)]);if(_0x9ceebb[_0x401a46(0x1a2)]['eventType']===_0x2bbdcd['LC_SEND_ALL_DATA']){_0x2a0ea6['rmSync'](_0x38e9ea[_0x401a46(0x215)](_0x2f0ddb,this['C']['src']),{'recursive':!0x0,'force':!0x0}),this[_0x401a46(0x1f4)](_0x38e9ea[_0x401a46(0x215)](_0x2f0ddb,this['C'][_0x401a46(0x145)]),{'recursive':!0x0});const _0x4914e5=_0x9ceebb['response']['eventData'];await this[_0x401a46(0x22c)](_0x4914e5,_0x2f0ddb),this[_0x401a46(0x187)]||setTimeout(this[_0x401a46(0x184)]['bind'](this),0x1388);}else{if(_0x9ceebb[_0x401a46(0x1a2)]['eventType']===_0x2bbdcd[_0x401a46(0xf4)]){const _0x24ab3e=_0x9ceebb[_0x401a46(0x1a2)][_0x401a46(0x112)];await this['writeMemfsJsonToDisk'](_0x24ab3e[_0x401a46(0x226)],_0x2f0ddb);}}!0x0===this[_0x401a46(0x25a)]?await this[_0x401a46(0x1fe)](!0x1):(await this[_0x401a46(0x1fe)](!0x0),this[_0x401a46(0x25a)]=!0x0);}}async[_0x1b0e0f(0x22c)](_0x2b93c5,_0x8144c5){const _0xc8966d=_0x1b0e0f;this[_0xc8966d(0x1c5)]=!0x0;let _0x322f20=[];const _0x29bdde=async()=>{const _0x435824=_0xc8966d;_0x322f20[_0x435824(0x206)]>0x0&&(await Promise[_0x435824(0x103)](_0x322f20),_0x322f20=[]);};for(const [_0x52afa1,_0x52864d]of Object[_0xc8966d(0x17b)](_0x2b93c5)){if(!_0x52afa1[_0xc8966d(0x12d)]('/'+this['C']['repo']+'/'+this['C']['src']))continue;const _0x5b4019=_0x52864d,_0xbc1a9f=_0x52afa1[_0xc8966d(0x1a1)]('/'+this['C'][_0xc8966d(0x1c2)],'');if(this[_0xc8966d(0x254)][_0xbc1a9f])continue;const _0x307b96=_0x38e9ea['join'](_0x8144c5,_0xbc1a9f[_0xc8966d(0x1a1)](/^\//,'')),_0x545ae6=_0x38e9ea[_0xc8966d(0x1b6)](_0x307b96),_0x5f5192=async()=>{const _0x5644c2=_0xc8966d;await this[_0x5644c2(0x13c)](_0x545ae6,{'recursive':!0x0}),await this[_0x5644c2(0x251)](_0x307b96,_0x5b4019[_0x5644c2(0x234)],{'encoding':_0x5644c2(0x1d6)}),this['EL']&&console[_0x5644c2(0x1af)](_0x5644c2(0x23d)+this['getCurrentTime']()+_0x5644c2(0x200)+_0x307b96[_0x5644c2(0x1a1)](_0x8144c5,''));};_0x322f20[_0xc8966d(0x1c7)](_0x5f5192()),_0x322f20[_0xc8966d(0x206)]>=0x3e8&&await _0x29bdde();}await _0x29bdde(),setTimeout(()=>{this['skipWatchInputs']=!0x1;},0x3e8);}[_0x1b0e0f(0x23b)](_0x39b251){const _0x39108a=_0x1b0e0f,_0x42438b=this[_0x39108a(0x136)](_0x39b251);if(!this[_0x39108a(0x140)](_0x42438b))return!0x1;const _0x4f44a4=_0x2a0ea6[_0x39108a(0x1d7)](_0x42438b);let _0x4bef91=!0x0;for(const _0x1984a8 of _0x4f44a4){const _0x206172=_0x38e9ea[_0x39108a(0x215)](_0x42438b,_0x1984a8);_0x2a0ea6[_0x39108a(0x212)](_0x206172)[_0x39108a(0x249)]()&&this[_0x39108a(0x23b)](_0x206172)||(_0x4bef91=!0x1);}return!!_0x4bef91&&(_0x2a0ea6[_0x39108a(0x135)](_0x42438b),!0x0);}async[_0x1b0e0f(0x1de)](_0x494dc6,_0x136159){const _0x5412c9=_0x1b0e0f;return this[_0x5412c9(0x140)](_0x494dc6)?await this[_0x5412c9(0x1ee)](_0x494dc6,_0x136159):[];}[_0x1b0e0f(0x136)](_0x44a42c){return _0x38e9ea['normalize'](_0x44a42c);}[_0x1b0e0f(0x140)](_0x3f6537){const _0x39fc10=_0x38e9ea['normalize'](_0x3f6537);return _0x2a0ea6['existsSync'](_0x39fc10);}async[_0x1b0e0f(0x1ee)](_0x450d21,_0x263137){const _0x4271ba=_0x1b0e0f,_0x4ee0cc=_0x38e9ea[_0x4271ba(0x1f2)](_0x450d21);return await _0x2a0ea6[_0x4271ba(0x12e)][_0x4271ba(0x113)](_0x4ee0cc,_0x263137);}async['fsMkDir'](_0x1b53a1,_0x33720d){const _0x469ba6=_0x1b0e0f,_0x1b1b89=_0x38e9ea[_0x469ba6(0x1f2)](_0x1b53a1);return await _0x2a0ea6[_0x469ba6(0x12e)][_0x469ba6(0x194)](_0x1b1b89,_0x33720d);}['fsMkDirSync'](_0x435266,_0x2cc0db){const _0x274fae=_0x1b0e0f,_0x514502=_0x38e9ea[_0x274fae(0x1f2)](_0x435266);return _0x2a0ea6[_0x274fae(0x1ed)](_0x514502,_0x2cc0db);}async[_0x1b0e0f(0x1dc)](_0xd3da2f,_0xd9909b){const _0x22ade3=_0x1b0e0f,_0x34aade=_0x38e9ea[_0x22ade3(0x1f2)](_0xd3da2f);return await _0x2a0ea6[_0x22ade3(0x12e)][_0x22ade3(0x1bb)](_0x34aade,_0xd9909b);}async['fsWriteFile'](_0x5b4369,_0x13a188,_0x1579a5){const _0x2bcd4b=_0x1b0e0f,_0x5ec6fc=_0x38e9ea[_0x2bcd4b(0x1f2)](_0x5b4369);return await _0x2a0ea6['promises']['writeFile'](_0x5ec6fc,_0x13a188,_0x1579a5);}async[_0x1b0e0f(0x193)](_0x335866,_0x4f42c9){const _0x3ed2e3=_0x1b0e0f,_0x4782ac=_0x38e9ea[_0x3ed2e3(0x1f2)](_0x335866),_0x3f5949=_0x38e9ea[_0x3ed2e3(0x1f2)](_0x4f42c9);return await _0x2a0ea6['promises']['link'](_0x4782ac,_0x3f5949);}async[_0x1b0e0f(0xf9)](_0x53ed26=0x0){const _0x49883f=_0x1b0e0f;if(!this[_0x49883f(0x108)]){this['shuttingDown']=!0x0;try{this[_0x49883f(0x187)]&&await this[_0x49883f(0x187)][_0x49883f(0x186)]();}catch(_0x24a7c3){console[_0x49883f(0x1eb)](_0x49883f(0x1ca),_0x24a7c3);}finally{setTimeout(()=>process[_0x49883f(0x169)](_0x53ed26),0xc8);}}}[_0x1b0e0f(0x162)](){const _0x447c24=_0x1b0e0f;process['on']('SIGINT',()=>{const _0x441bda=a0_0xf806;console[_0x441bda(0x1af)](_0x441bda(0x192)),this[_0x441bda(0xf9)](0x0);}),process['on']('SIGTERM',()=>{const _0x145fb1=a0_0xf806;console[_0x145fb1(0x1af)](_0x145fb1(0x153)),this[_0x145fb1(0xf9)](0x0);}),process['on'](_0x447c24(0x12f),_0x4e96d0=>{const _0x2459ea=_0x447c24;console[_0x2459ea(0x1af)](_0x2459ea(0x12f),_0x4e96d0);}),process['on'](_0x447c24(0x169),_0x33e198=>{const _0xbc283c=_0x447c24;console[_0xbc283c(0x1af)](_0xbc283c(0x169),_0x33e198);}),process['on'](_0x447c24(0x16f),_0x59c188=>{const _0x18b91d=_0x447c24;console['error'](_0x18b91d(0x16f),_0x59c188),this[_0x18b91d(0xf9)](0x1);}),process['on'](_0x447c24(0x141),_0x37d910=>{const _0x3199c3=_0x447c24;console['error'](_0x3199c3(0x141),_0x37d910),this[_0x3199c3(0xf9)](0x1);});}}()[_0x1b0e0f(0x258)]()[_0x1b0e0f(0x127)](),function(_0x3e0e24){const _0x380864=_0x1b0e0f;_0x3e0e24[_0x380864(0x247)]=_0x380864(0x247),_0x3e0e24[_0x380864(0x146)]=_0x380864(0x146),_0x3e0e24[_0x380864(0x119)]=_0x380864(0x119),_0x3e0e24[_0x380864(0x133)]=_0x380864(0x133),_0x3e0e24[_0x380864(0x1d3)]=_0x380864(0x1d3);}(_0x513751=_0xe17e60['QX']||(_0xe17e60['QX']={})),function(_0x3c0f12){const _0x576717=_0x1b0e0f;_0x3c0f12[_0x576717(0x100)]=_0x576717(0x100),_0x3c0f12[_0x576717(0x1a3)]=_0x576717(0x1a3),_0x3c0f12[_0x576717(0x19f)]=_0x576717(0x19f),_0x3c0f12[_0x576717(0x179)]=_0x576717(0x179),_0x3c0f12[_0x576717(0x174)]=_0x576717(0x174),_0x3c0f12[_0x576717(0x10e)]='NOTIFICATION',_0x3c0f12[_0x576717(0x164)]='LC_DATA_REQ_RES';}(_0x9aed2c||(_0x9aed2c={})),function(_0x2db121){const _0x5e659d=_0x1b0e0f;_0x2db121[_0x5e659d(0x207)]=_0x5e659d(0x207),_0x2db121[_0x5e659d(0xf4)]=_0x5e659d(0xf4),_0x2db121[_0x5e659d(0x18e)]='LC_FOLDER_CHANGED_ON_LOCAL_SYSTEM';}(_0x2bbdcd||(_0x2bbdcd={})),(_0xf11aa7=_0xe17e60['Yl']||(_0xe17e60['Yl']={}))[_0x1b0e0f(0x256)]='POST',_0xf11aa7[_0x1b0e0f(0x1a9)]=_0x1b0e0f(0x1a9),_0xf11aa7[_0x1b0e0f(0x231)]='PUT_REPLACE',_0xf11aa7['DELETE']=_0x1b0e0f(0x199),_0xf11aa7[_0x1b0e0f(0x1d0)]='DELETE_ALL',(_0x57bf68=_0xe17e60['EN']||(_0xe17e60['EN']={}))[_0x1b0e0f(0x1c1)]='am_events',_0x57bf68[_0x1b0e0f(0x114)]=_0x1b0e0f(0x195),_0x57bf68[_0x1b0e0f(0x132)]=_0x1b0e0f(0x14e),_0x57bf68[_0x1b0e0f(0x1f3)]=_0x1b0e0f(0x246),_0x57bf68['InstanceApiSettings']='am_instance_api_settings',_0x57bf68[_0x1b0e0f(0x10b)]=_0x1b0e0f(0x14b),_0x57bf68[_0x1b0e0f(0x205)]=_0x1b0e0f(0x129),_0x57bf68['DatabaseHooks']=_0x1b0e0f(0x13f),_0x57bf68[_0x1b0e0f(0x170)]='am_collection_hooks',_0x57bf68[_0x1b0e0f(0x13a)]='am_schedulers',_0x57bf68[_0x1b0e0f(0x122)]=_0x1b0e0f(0xf6),_0x57bf68[_0x1b0e0f(0x158)]=_0x1b0e0f(0x16a),_0x57bf68[_0x1b0e0f(0x17f)]=_0x1b0e0f(0x1f1),_0x57bf68['SystemApiHooks']='am_system_api_hooks',_0x57bf68[_0x1b0e0f(0x160)]=_0x1b0e0f(0x160),_0x57bf68[_0x1b0e0f(0x1b9)]='am_tp_installed_apis',_0x57bf68[_0x1b0e0f(0x211)]=_0x1b0e0f(0x211),_0x57bf68[_0x1b0e0f(0x137)]=_0x1b0e0f(0x121),_0x57bf68[_0x1b0e0f(0x190)]=_0x1b0e0f(0x1e1),_0x57bf68[_0x1b0e0f(0x1b3)]=_0x1b0e0f(0x21e),_0x57bf68[_0x1b0e0f(0x218)]=_0x1b0e0f(0x10f),_0x57bf68[_0x1b0e0f(0x1e8)]='am_ui_maker_styles',_0x57bf68[_0x1b0e0f(0x208)]='am_test_cases',function(_0x20be71){const _0x483e14=_0x1b0e0f;_0x20be71[_0x483e14(0x119)]='Custom\x20APIs',_0x20be71[_0x483e14(0x118)]='Database\x20migrations',_0x20be71[_0x483e14(0x21b)]=_0x483e14(0x13e),_0x20be71[_0x483e14(0x131)]=_0x483e14(0x1df),_0x20be71[_0x483e14(0x19e)]=_0x483e14(0x11d),_0x20be71[_0x483e14(0x233)]='Instance\x20API\x20hooks',_0x20be71[_0x483e14(0x1ba)]=_0x483e14(0x178),_0x20be71[_0x483e14(0x1ef)]='Database\x20hooks',_0x20be71[_0x483e14(0x1d9)]=_0x483e14(0x201),_0x20be71[_0x483e14(0x241)]='Instance\x20API\x20settings',_0x20be71[_0x483e14(0x1e3)]=_0x483e14(0x13a),_0x20be71[_0x483e14(0x198)]=_0x483e14(0x122),_0x20be71[_0x483e14(0x24f)]='System\x20API\x20hooks',_0x20be71['SYSTEM_API_SETTINGS']=_0x483e14(0x156),_0x20be71[_0x483e14(0x1ad)]=_0x483e14(0x243),_0x20be71[_0x483e14(0x146)]=_0x483e14(0x22d),_0x20be71['THIRD_PARTY_API_SETTINGS']=_0x483e14(0x20b),_0x20be71[_0x483e14(0x1ac)]=_0x483e14(0x20d),_0x20be71[_0x483e14(0x1fd)]='WebSocket\x20events',_0x20be71[_0x483e14(0x1d4)]=_0x483e14(0x101),_0x20be71[_0x483e14(0x167)]=_0x483e14(0x1b2),_0x20be71[_0x483e14(0x1cb)]='UI\x20maker\x20styles';}(_0x3c2731=_0xe17e60['_6']||(_0xe17e60['_6']={}));},0x300:_0x15623e=>{const _0x36397e=a0_0xf806;function _0x5a6ffb(_0x1052a7){const _0x51aa07=a0_0xf806;var _0x85eab4=new Error(_0x51aa07(0x235)+_0x1052a7+'\x27');throw _0x85eab4[_0x51aa07(0x120)]=_0x51aa07(0x237),_0x85eab4;}_0x5a6ffb[_0x36397e(0x1c4)]=()=>[],_0x5a6ffb[_0x36397e(0x239)]=_0x5a6ffb,_0x5a6ffb['id']=0x300,_0x15623e[_0x36397e(0x18c)]=_0x5a6ffb;},0x274:_0x28ba46=>{'use strict';const _0x405d6c=a0_0xf806;_0x28ba46[_0x405d6c(0x18c)]=require(_0x405d6c(0x151));},0x2f8:_0xde3eb0=>{'use strict';const _0x530e29=a0_0xf806;_0xde3eb0['exports']=require(_0x530e29(0x1f7));},0x2a0:_0x2960f5=>{'use strict';const _0x278fc3=a0_0xf806;_0x2960f5[_0x278fc3(0x18c)]=require(_0x278fc3(0x21f));},0x170:_0x1d03d8=>{'use strict';const _0x13d612=a0_0xf806;_0x1d03d8[_0x13d612(0x18c)]=require(_0x13d612(0x223));},0x3a:_0x1bab4c=>{'use strict';const _0x19a4cb=a0_0xf806;_0x1bab4c[_0x19a4cb(0x18c)]=require('fs');}},_0x133dcc={};function _0x3c0e75(_0x2bbce5){const _0xd8c48a=a0_0xf806;var _0x47a3d6=_0x133dcc[_0x2bbce5];if(void 0x0!==_0x47a3d6)return _0x47a3d6[_0xd8c48a(0x18c)];var _0x490354=_0x133dcc[_0x2bbce5]={'exports':{}};return _0x43be4e[_0x2bbce5](_0x490354,_0x490354[_0xd8c48a(0x18c)],_0x3c0e75),_0x490354[_0xd8c48a(0x18c)];}_0x3c0e75['o']=(_0x1a9bda,_0x932bbf)=>Object[_0x276446(0x1ab)]['hasOwnProperty'][_0x276446(0x15f)](_0x1a9bda,_0x932bbf),_0x3c0e75(0x3dc);})()));
|