@dcupl/cli 0.0.21 → 0.0.22
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/functions/files/files-copy.d.ts +5 -0
- package/dist/functions/files/files-copy.js +43 -0
- package/dist/functions/files/files-copy.js.map +1 -0
- package/dist/functions/files/files-list-tags.d.ts +2 -0
- package/dist/functions/files/files-list-tags.js +39 -0
- package/dist/functions/files/files-list-tags.js.map +1 -0
- package/dist/functions/files/files-pull.d.ts +4 -0
- package/dist/functions/files/files-pull.js +50 -0
- package/dist/functions/files/files-pull.js.map +1 -0
- package/dist/functions/files/files-push.d.ts +4 -0
- package/dist/functions/files/files-push.js +89 -0
- package/dist/functions/files/files-push.js.map +1 -0
- package/dist/functions/generate/types/generate-types.d.ts +1 -0
- package/dist/functions/generate/types/generate-types.js +39 -0
- package/dist/functions/generate/types/generate-types.js.map +1 -0
- package/dist/functions/generate/types/generate.helper.d.ts +7 -0
- package/dist/functions/generate/types/generate.helper.js +102 -0
- package/dist/functions/generate/types/generate.helper.js.map +1 -0
- package/dist/functions/{config/config.common.d.ts → helper/config.helper.d.ts} +6 -0
- package/dist/functions/{config/config.common.js → helper/config.helper.js} +1 -1
- package/dist/functions/helper/config.helper.js.map +1 -0
- package/dist/functions/init.js +1 -1
- package/dist/functions/init.js.map +1 -1
- package/dist/functions/serve/app.service.js +2 -2
- package/dist/index.js +40 -8
- package/dist/index.js.map +1 -1
- package/files/common/.vscode/settings.json +1 -0
- package/files/common/dcupl.config.json +7 -1
- package/files/common/readme.md +1 -1
- package/files/demo/bookstore_01/dcupl/{example.dcupl.lc.json → dcupl.lc.json} +33 -7
- package/files/demo/bookstore_01/dcupl.config.json +8 -3
- package/files/empty/empty_01/dcupl/dcupl.lc.json +60 -0
- package/files/empty/empty_01/dcupl.config.json +8 -3
- package/package.json +11 -1
- package/dist/functions/config/config-pull.d.ts +0 -1
- package/dist/functions/config/config-pull.js +0 -43
- package/dist/functions/config/config-pull.js.map +0 -1
- package/dist/functions/config/config-push.d.ts +0 -1
- package/dist/functions/config/config-push.js +0 -48
- package/dist/functions/config/config-push.js.map +0 -1
- package/dist/functions/config/config.common.js.map +0 -1
- package/files/empty/empty_01/dcupl/example.dcupl.lc.json +0 -34
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyFiles = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
+
const kleur_1 = require("kleur");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const config_helper_1 = require("../helper/config.helper");
|
|
10
|
+
const emoji = require('node-emoji');
|
|
11
|
+
const copyFiles = (args) => {
|
|
12
|
+
inquirer_1.default.prompt([]).then(async () => {
|
|
13
|
+
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
14
|
+
const cliConfig = (0, config_helper_1.getConfigFileValue)(currentBasePath);
|
|
15
|
+
const secrets = (0, config_helper_1.getSecretFileValue)(currentBasePath);
|
|
16
|
+
if (!cliConfig || !secrets) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
console.log('');
|
|
20
|
+
console.log((0, kleur_1.bold)('copying files: '));
|
|
21
|
+
console.log('');
|
|
22
|
+
const apiUrl = cliConfig.consoleApiUrl || 'https://api.dcupl.com';
|
|
23
|
+
const fromTag = args?.from || 'draft';
|
|
24
|
+
const toTag = args?.to || 'published';
|
|
25
|
+
const config = {
|
|
26
|
+
method: 'post',
|
|
27
|
+
url: `${apiUrl}/projects/${cliConfig.projectId}/files/tags/${fromTag}/copy/${toTag}/?apikey=${secrets.apiKey}`,
|
|
28
|
+
};
|
|
29
|
+
console.log(config);
|
|
30
|
+
try {
|
|
31
|
+
await (0, axios_1.default)(config);
|
|
32
|
+
console.log(`${(0, kleur_1.bold)('files sucessfully copied')} ${emoji.get('rocket')}`);
|
|
33
|
+
console.log('');
|
|
34
|
+
console.log('Your files are publicly available on');
|
|
35
|
+
console.log(`https://cdn.dcupl.com/files/projects/${cliConfig.projectId}/${toTag}/...`);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.log(error);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.copyFiles = copyFiles;
|
|
43
|
+
//# sourceMappingURL=files-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files-copy.js","sourceRoot":"","sources":["../../../src/functions/files/files-copy.ts"],"names":[],"mappings":";;;;AAAA,0DAAkD;AAClD,gEAAgC;AAChC,iCAA6B;AAC7B,+BAA4B;AAE5B,2DAAiF;AAEjF,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAO7B,MAAM,SAAS,GAAG,CAAC,IAAsB,EAAE,EAAE;IAClD,kBAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;QAClC,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAE5C,MAAM,SAAS,GAAG,IAAA,kCAAkB,EAAC,eAAe,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,IAAA,kCAAkB,EAAC,eAAe,CAAC,CAAC;QAEpD,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE;YAC1B,OAAO;SACR;QAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,IAAA,YAAI,EAAC,iBAAiB,CAAC,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEhB,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,IAAI,uBAAuB,CAAC;QAElE,MAAM,OAAO,GAAG,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,EAAE,EAAE,IAAI,WAAW,CAAC;QAEtC,MAAM,MAAM,GAAuB;YACjC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,GAAG,MAAM,aAAa,SAAS,CAAC,SAAS,eAAe,OAAO,SAAS,KAAK,YAAY,OAAO,CAAC,MAAM,EAAE;SAC/G,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,IAAI;YACF,MAAM,IAAA,eAAK,EAAC,MAAM,CAAC,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,GAAG,IAAA,YAAI,EAAC,0BAA0B,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC1E,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;YACpD,OAAO,CAAC,GAAG,CAAC,wCAAwC,SAAS,CAAC,SAAS,IAAI,KAAK,MAAM,CAAC,CAAC;SACzF;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACpB;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAnCW,QAAA,SAAS,aAmCpB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listTags = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
+
const kleur_1 = require("kleur");
|
|
8
|
+
const lodash_1 = require("lodash");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const config_helper_1 = require("../helper/config.helper");
|
|
11
|
+
const emoji = require('node-emoji');
|
|
12
|
+
const listTags = (args) => {
|
|
13
|
+
inquirer_1.default.prompt([]).then(async () => {
|
|
14
|
+
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
15
|
+
const cliConfig = (0, config_helper_1.getConfigFileValue)(currentBasePath);
|
|
16
|
+
const secrets = (0, config_helper_1.getSecretFileValue)(currentBasePath);
|
|
17
|
+
if (!cliConfig || !secrets) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
console.log('');
|
|
21
|
+
console.log((0, kleur_1.bold)('listing files: '));
|
|
22
|
+
console.log(`ordered by 'protected' and 'changedAt'`);
|
|
23
|
+
console.log('');
|
|
24
|
+
const apiUrl = cliConfig.consoleApiUrl || 'https://api.dcupl.com';
|
|
25
|
+
const config = {
|
|
26
|
+
method: 'get',
|
|
27
|
+
url: `${apiUrl}/projects/${cliConfig.projectId}/files/tags/?apikey=${secrets.apiKey}`,
|
|
28
|
+
};
|
|
29
|
+
try {
|
|
30
|
+
const result = await (0, axios_1.default)(config);
|
|
31
|
+
console.table((0, lodash_1.orderBy)(result.data, ['protected', 'changedAt']), ['uid', 'createdAt', 'changedAt', 'protected']);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
console.log(error);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.listTags = listTags;
|
|
39
|
+
//# sourceMappingURL=files-list-tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files-list-tags.js","sourceRoot":"","sources":["../../../src/functions/files/files-list-tags.ts"],"names":[],"mappings":";;;;AAAA,0DAAkD;AAClD,gEAAgC;AAChC,iCAA6B;AAC7B,mCAAiC;AACjC,+BAA4B;AAE5B,2DAAiF;AAEjF,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAI7B,MAAM,QAAQ,GAAG,CAAC,IAA0B,EAAE,EAAE;IACrD,kBAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,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3
|
+
exports.pullFiles = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
6
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
7
|
+
const fs_extra_1 = require("fs-extra");
|
|
8
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const kleur_1 = require("kleur");
|
|
11
|
+
const config_helper_1 = require("../helper/config.helper");
|
|
12
|
+
const emoji = require('node-emoji');
|
|
13
|
+
const pullFiles = (args) => {
|
|
14
|
+
inquirer_1.default
|
|
15
|
+
.prompt([])
|
|
16
|
+
.then(async () => {
|
|
17
|
+
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
18
|
+
const cliConfig = (0, config_helper_1.getConfigFileValue)(currentBasePath);
|
|
19
|
+
const secrets = (0, config_helper_1.getSecretFileValue)(currentBasePath);
|
|
20
|
+
if (!cliConfig || !secrets) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const workspacePath = (0, path_1.join)(currentBasePath, 'dcupl');
|
|
24
|
+
const baseFolder = cliConfig.baseFolder || 'dcupl';
|
|
25
|
+
if (!(0, fs_extra_1.existsSync)(workspacePath)) {
|
|
26
|
+
console.log(`Error: There is folder at ${workspacePath} present`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
console.log('');
|
|
30
|
+
console.log((0, kleur_1.bold)('downloading files: '));
|
|
31
|
+
console.log('');
|
|
32
|
+
const apiUrl = cliConfig.consoleApiUrl || 'https://api.dcupl.com';
|
|
33
|
+
const tagId = args?.tag || 'draft';
|
|
34
|
+
const config = {
|
|
35
|
+
method: 'get',
|
|
36
|
+
responseType: 'arraybuffer',
|
|
37
|
+
url: `${apiUrl}/projects/${cliConfig.projectId}/files/tags/${tagId}/pull/?apikey=${secrets.apiKey}`,
|
|
38
|
+
};
|
|
39
|
+
try {
|
|
40
|
+
const response = await (0, axios_1.default)(config);
|
|
41
|
+
const zip = new adm_zip_1.default(response.data);
|
|
42
|
+
zip.extractAllTo(baseFolder, true);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.log(error);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.pullFiles = pullFiles;
|
|
50
|
+
//# sourceMappingURL=files-pull.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files-pull.js","sourceRoot":"","sources":["../../../src/functions/files/files-pull.ts"],"names":[],"mappings":";;;;AAAA,8DAA6B;AAC7B,0DAAkD;AAElD,uCAAsC;AACtC,gEAAgC;AAChC,+BAA4B;AAE5B,iCAA8C;AAE9C,2DAAiF;AAEjF,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAM7B,MAAM,SAAS,GAAG,CAAC,IAAsB,EAAE,EAAE;IAClD,kBAAQ;SACL,MAAM,CAAC,EAMP,CAAC;SACD,IAAI,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAE5C,MAAM,SAAS,GAAG,IAAA,kCAAkB,EAAC,eAAe,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,IAAA,kCAAkB,EAAC,eAAe,CAAC,CAAC;QAEpD,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE;YAC1B,OAAO;SACR;QAED,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,IAAI,OAAO,CAAC;QAEnD,IAAI,CAAC,IAAA,qBAAU,EAAC,aAAa,CAAC,EAAE;YAC9B,OAAO,CAAC,GAAG,CAAC,6BAA6B,aAAa,UAAU,CAAC,CAAC;YAClE,OAAO;SACR;QAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,IAAA,YAAI,EAAC,qBAAqB,CAAC,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEhB,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,IAAI,uBAAuB,CAAC;QAElE,MAAM,KAAK,GAAG,IAAI,EAAE,GAAG,IAAI,OAAO,CAAC;QAEnC,MAAM,MAAM,GAAuB;YACjC,MAAM,EAAE,KAAK;YACb,YAAY,EAAE,aAAa;YAC3B,GAAG,EAAE,GAAG,MAAM,aAAa,SAAS,CAAC,SAAS,eAAe,KAAK,iBAAiB,OAAO,CAAC,MAAM,EAAE;SACpG,CAAC;QAEF,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAK,EAAC,MAAM,CAAC,CAAC;YACrC,MAAM,GAAG,GAAG,IAAI,iBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAEtC,GAAG,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;SACpC;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACpB;IACH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAlDW,QAAA,SAAS,aAkDpB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pushFiles = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
6
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
7
|
+
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
8
|
+
const fs_extra_1 = require("fs-extra");
|
|
9
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const glob_1 = tslib_1.__importDefault(require("glob"));
|
|
12
|
+
const kleur_1 = require("kleur");
|
|
13
|
+
const lodash_1 = require("lodash");
|
|
14
|
+
const config_helper_1 = require("../helper/config.helper");
|
|
15
|
+
const emoji = require('node-emoji');
|
|
16
|
+
const pushFiles = (args) => {
|
|
17
|
+
inquirer_1.default
|
|
18
|
+
.prompt([])
|
|
19
|
+
.then(async ({}) => {
|
|
20
|
+
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
21
|
+
const cliConfig = (0, config_helper_1.getConfigFileValue)(currentBasePath);
|
|
22
|
+
const secrets = (0, config_helper_1.getSecretFileValue)(currentBasePath);
|
|
23
|
+
if (!cliConfig || !secrets) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const workspacePath = (0, path_1.join)(currentBasePath, 'dcupl');
|
|
27
|
+
if (!(0, fs_extra_1.existsSync)(workspacePath)) {
|
|
28
|
+
console.log(`Error: There is folder at ${workspacePath} present`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const zip = new adm_zip_1.default();
|
|
32
|
+
const includes = cliConfig.filesUpload?.include || ['**/*.json', '**/*.csv'];
|
|
33
|
+
const excludes = cliConfig.filesUpload?.exclude || [];
|
|
34
|
+
const baseFolder = cliConfig.baseFolder || 'dcupl';
|
|
35
|
+
const includedFiles = await Promise.all(includes.map((pattern) => getFiles(pattern, baseFolder)));
|
|
36
|
+
const excludedFiles = await Promise.all(excludes.map((pattern) => getFiles(pattern, baseFolder)));
|
|
37
|
+
const includedFilesFlat = (0, lodash_1.flatten)(includedFiles);
|
|
38
|
+
const excludedFilesFlat = (0, lodash_1.flatten)(excludedFiles);
|
|
39
|
+
const uniqFiles = (0, lodash_1.uniq)(includedFilesFlat);
|
|
40
|
+
const cleanFiles = (0, lodash_1.without)(uniqFiles, ...excludedFilesFlat);
|
|
41
|
+
const filesWithoutDcuplFolder = cleanFiles.map((file) => file.substring(baseFolder.length + 1));
|
|
42
|
+
cleanFiles.forEach((filePath, index) => zip.addFile(filesWithoutDcuplFolder[index], (0, fs_extra_1.readFileSync)(filePath)));
|
|
43
|
+
const zipBuffer = zip.toBuffer();
|
|
44
|
+
const form = new form_data_1.default();
|
|
45
|
+
form.append('dcupl', zipBuffer, { filename: 'dcupl' });
|
|
46
|
+
const apiUrl = cliConfig.consoleApiUrl || 'https://api.dcupl.com';
|
|
47
|
+
const defaultTagId = new Date().toISOString();
|
|
48
|
+
const tagId = args?.tag || defaultTagId;
|
|
49
|
+
const config = {
|
|
50
|
+
method: 'post',
|
|
51
|
+
url: `${apiUrl}/projects/${cliConfig.projectId}/files/tags/${tagId}/push/?apikey=${secrets.apiKey}`,
|
|
52
|
+
headers: form.getHeaders(),
|
|
53
|
+
data: form,
|
|
54
|
+
};
|
|
55
|
+
console.log('');
|
|
56
|
+
console.log((0, kleur_1.bold)('uploading the following files: '));
|
|
57
|
+
console.log('');
|
|
58
|
+
filesWithoutDcuplFolder.forEach((file) => console.log(file));
|
|
59
|
+
console.log('');
|
|
60
|
+
try {
|
|
61
|
+
await (0, axios_1.default)(config);
|
|
62
|
+
console.log(`${(0, kleur_1.bold)('files sucessfully uploaded')} ${emoji.get('rocket')}`);
|
|
63
|
+
console.log('');
|
|
64
|
+
console.log('Your files are publicly available on');
|
|
65
|
+
console.log(`https://cdn.dcupl.com/files/projects/${cliConfig.projectId}/${tagId}/${filesWithoutDcuplFolder[0]}`);
|
|
66
|
+
console.log(`https://cdn.dcupl.com/files/projects/${cliConfig.projectId}/${tagId}/${filesWithoutDcuplFolder[1]}`);
|
|
67
|
+
console.log('...');
|
|
68
|
+
console.log('');
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
console.log(error);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
exports.pushFiles = pushFiles;
|
|
76
|
+
const getFiles = (pattern, prefix) => {
|
|
77
|
+
return new Promise((resolve, reject) => {
|
|
78
|
+
if (prefix) {
|
|
79
|
+
pattern = (0, path_1.join)(prefix, pattern);
|
|
80
|
+
}
|
|
81
|
+
return (0, glob_1.default)(pattern, (err, matches) => {
|
|
82
|
+
if (err) {
|
|
83
|
+
return reject(err);
|
|
84
|
+
}
|
|
85
|
+
return resolve(matches);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=files-push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files-push.js","sourceRoot":"","sources":["../../../src/functions/files/files-push.ts"],"names":[],"mappings":";;;;AAAA,8DAA6B;AAC7B,0DAAkD;AAClD,kEAAiC;AACjC,uCAAoD;AACpD,gEAAgC;AAChC,+BAA4B;AAC5B,wDAAwB;AACxB,iCAA6B;AAC7B,mCAAgD;AAChD,2DAAiF;AAEjF,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAM7B,MAAM,SAAS,GAAG,CAAC,IAAsB,EAAE,EAAE;IAClD,kBAAQ;SACL,MAAM,CAAC,EAMP,CAAC;SACD,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;QACjB,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAE5C,MAAM,SAAS,GAAG,IAAA,kCAAkB,EAAC,eAAe,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,IAAA,kCAAkB,EAAC,eAAe,CAAC,CAAC;QAEpD,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE;YAC1B,OAAO;SACR;QAED,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QAErD,IAAI,CAAC,IAAA,qBAAU,EAAC,aAAa,CAAC,EAAE;YAC9B,OAAO,CAAC,GAAG,CAAC,6BAA6B,aAAa,UAAU,CAAC,CAAC;YAClE,OAAO;SACR;QAED,MAAM,GAAG,GAAG,IAAI,iBAAM,EAAE,CAAC;QAEzB,MAAM,QAAQ,GAAG,SAAS,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,CAAC,CAAC,CAAC,EAAE,CACrG,CAAC;YACF,OAAO,CAAC,GAAG,CACT,wCAAwC,SAAS,CAAC,SAAS,IAAI,KAAK,IAAI,uBAAuB,CAAC,CAAC,CAAC,EAAE,CACrG,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACjB;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACpB;IACH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAtFW,QAAA,SAAS,aAsFpB;AAEF,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAE,MAAc,EAAqB,EAAE;IACtE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,MAAM,EAAE;YACV,OAAO,GAAG,IAAA,WAAI,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SACjC;QAED,OAAO,IAAA,cAAI,EAAC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;YACpC,IAAI,GAAG,EAAE;gBACP,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;aACpB;YACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateTypesFn: () => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateTypesFn = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
6
|
+
const kleur_1 = require("kleur");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const config_helper_1 = require("../../helper/config.helper");
|
|
9
|
+
const generate_helper_1 = require("./generate.helper");
|
|
10
|
+
const generateTypesFn = () => {
|
|
11
|
+
inquirer_1.default.prompt([]).then(() => {
|
|
12
|
+
try {
|
|
13
|
+
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
14
|
+
const cliConfig = (0, config_helper_1.getConfigFileValue)(currentBasePath);
|
|
15
|
+
const modelFilesBasePath = cliConfig?.modelsBasePath || 'dcupl/models';
|
|
16
|
+
const models = (0, generate_helper_1.loadModelFiles)(currentBasePath, modelFilesBasePath);
|
|
17
|
+
const outputFolderName = 'types';
|
|
18
|
+
const outputFileName = 'dcupl.types.ts';
|
|
19
|
+
if (!models) {
|
|
20
|
+
console.log(`Error: Did not find any model files`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let output = '';
|
|
24
|
+
models.forEach((model) => {
|
|
25
|
+
const typeAsString = (0, generate_helper_1.generateTypescriptTypeFromModel)(model);
|
|
26
|
+
output += typeAsString;
|
|
27
|
+
output += '\n\n';
|
|
28
|
+
});
|
|
29
|
+
(0, generate_helper_1.writeTypeFile)(output, outputFolderName, outputFileName);
|
|
30
|
+
console.log(`Types sucessfully written to ${(0, kleur_1.bold)((0, path_1.join)(currentBasePath, outputFolderName, outputFileName))}`);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
console.log(`Error: Something went wrong: `);
|
|
34
|
+
console.dir(err);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.generateTypesFn = generateTypesFn;
|
|
39
|
+
//# sourceMappingURL=generate-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-types.js","sourceRoot":"","sources":["../../../../src/functions/generate/types/generate-types.ts"],"names":[],"mappings":";;;;AAAA,gEAAgC;AAChC,iCAA6B;AAC7B,+BAA4B;AAC5B,8DAAgE;AAEhE,uDAAmG;AAE5F,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,kBAAQ,CAAC,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'@dcupl/common';
|
|
2
|
+
export declare const loadModelFiles: (currentBasePath: string, modelFilesBasePath: string) => ModelDescription<string>[] | undefined;
|
|
3
|
+
export declare const getAllModelFilePaths: (modelBasePath: string) => string[];
|
|
4
|
+
export declare const loadModelFile: (modelFilePath: string) => ModelDescription[] | null;
|
|
5
|
+
export declare const generateTypescriptTypeFromModel: (model: ModelDescription) => string;
|
|
6
|
+
export declare const writeTypeFile: (typeOutput: string, outputFolderName: string, outputFileName: string) => void;
|
|
7
|
+
export declare const getFormatedTypeOutput: (typeOutput: string) => string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFormatedTypeOutput = exports.writeTypeFile = exports.generateTypescriptTypeFromModel = exports.loadModelFile = exports.getAllModelFilePaths = exports.loadModelFiles = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs_extra_1 = require("fs-extra");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const prettier_1 = tslib_1.__importDefault(require("prettier"));
|
|
8
|
+
const parser_typescript_js_1 = tslib_1.__importDefault(require("prettier/parser-typescript.js"));
|
|
9
|
+
const loadModelFiles = (currentBasePath, modelFilesBasePath) => {
|
|
10
|
+
const fullModelPath = (0, path_1.join)(currentBasePath, modelFilesBasePath);
|
|
11
|
+
if (!(0, fs_extra_1.existsSync)(fullModelPath)) {
|
|
12
|
+
console.log(`Error: Folder ${fullModelPath} does not exist`);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const filePaths = (0, exports.getAllModelFilePaths)(fullModelPath);
|
|
16
|
+
const files = filePaths
|
|
17
|
+
.map((filePath) => (0, exports.loadModelFile)(filePath))
|
|
18
|
+
.flat()
|
|
19
|
+
.filter(Boolean);
|
|
20
|
+
return files;
|
|
21
|
+
};
|
|
22
|
+
exports.loadModelFiles = loadModelFiles;
|
|
23
|
+
const getAllModelFilePaths = (modelBasePath) => {
|
|
24
|
+
const fileNames = (0, fs_extra_1.readdirSync)(modelBasePath);
|
|
25
|
+
return fileNames.map((fileName) => (0, path_1.join)(modelBasePath, fileName));
|
|
26
|
+
};
|
|
27
|
+
exports.getAllModelFilePaths = getAllModelFilePaths;
|
|
28
|
+
const loadModelFile = (modelFilePath) => {
|
|
29
|
+
if (!(0, fs_extra_1.existsSync)(modelFilePath)) {
|
|
30
|
+
console.log('Error: dcupl.config.json not found');
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const configFileAsString = (0, fs_extra_1.readFileSync)(modelFilePath, { encoding: 'utf-8' });
|
|
34
|
+
const configFile = JSON.parse(configFileAsString);
|
|
35
|
+
if (Array.isArray(configFile)) {
|
|
36
|
+
return configFile;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return [configFile];
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.loadModelFile = loadModelFile;
|
|
43
|
+
const generateTypescriptTypeFromModel = (model) => {
|
|
44
|
+
let output = '';
|
|
45
|
+
output += `export type ${model.key} = {`;
|
|
46
|
+
model.properties?.forEach((property) => {
|
|
47
|
+
output += `${property.key}: ${getTypescriptTypeForProperty(property)};`;
|
|
48
|
+
output += `\n`;
|
|
49
|
+
});
|
|
50
|
+
model.fields?.forEach((field) => {
|
|
51
|
+
output += `${field.key}: ${getTypescriptTypeForField(field)};`;
|
|
52
|
+
output += `\n`;
|
|
53
|
+
});
|
|
54
|
+
output += `}`;
|
|
55
|
+
return output;
|
|
56
|
+
};
|
|
57
|
+
exports.generateTypescriptTypeFromModel = generateTypescriptTypeFromModel;
|
|
58
|
+
const getTypescriptTypeForProperty = (property) => {
|
|
59
|
+
switch (property.datatype) {
|
|
60
|
+
case 'any':
|
|
61
|
+
return 'any';
|
|
62
|
+
case 'date':
|
|
63
|
+
return 'Date';
|
|
64
|
+
case 'float':
|
|
65
|
+
return 'Number';
|
|
66
|
+
case 'int':
|
|
67
|
+
return 'Number';
|
|
68
|
+
case 'json':
|
|
69
|
+
return 'any';
|
|
70
|
+
case 'string':
|
|
71
|
+
return 'string';
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const getTypescriptTypeForField = (field) => {
|
|
75
|
+
if (field.type === 'singleValued') {
|
|
76
|
+
return `${field.model} | string`;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return `${field.model}[] | string[]`;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const writeTypeFile = (typeOutput, outputFolderName, outputFileName) => {
|
|
83
|
+
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
84
|
+
const typesBasePath = (0, path_1.join)(currentBasePath, outputFolderName);
|
|
85
|
+
const fileBasePath = (0, path_1.join)(typesBasePath, outputFileName);
|
|
86
|
+
if (!(0, fs_extra_1.pathExistsSync)(typesBasePath)) {
|
|
87
|
+
(0, fs_extra_1.mkdirpSync)(typesBasePath);
|
|
88
|
+
}
|
|
89
|
+
(0, fs_extra_1.writeFileSync)(fileBasePath, (0, exports.getFormatedTypeOutput)(typeOutput), {
|
|
90
|
+
encoding: 'utf-8',
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
exports.writeTypeFile = writeTypeFile;
|
|
94
|
+
const getFormatedTypeOutput = (typeOutput) => {
|
|
95
|
+
let prettierOptions = {
|
|
96
|
+
parser: 'typescript',
|
|
97
|
+
plugins: [parser_typescript_js_1.default],
|
|
98
|
+
};
|
|
99
|
+
return prettier_1.default.format(typeOutput, prettierOptions);
|
|
100
|
+
};
|
|
101
|
+
exports.getFormatedTypeOutput = getFormatedTypeOutput;
|
|
102
|
+
//# sourceMappingURL=generate.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.helper.js","sourceRoot":"","sources":["../../../../src/functions/generate/types/generate.helper.ts"],"names":[],"mappings":";;;;AACA,uCAA4G;AAC5G,+BAA4B;AAE5B,gEAAgC;AAChC,iGAA6D;AAEtD,MAAM,cAAc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+
include?: string[];
|
|
9
|
+
exclude?: string[];
|
|
10
|
+
};
|
|
5
11
|
};
|
|
6
12
|
export declare type DcuplCliSecrets = {
|
|
7
13
|
apiKey: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.helper.js","sourceRoot":"","sources":["../../../src/functions/helper/config.helper.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AACpD,+BAAqC;AAiB9B,MAAM,kBAAkB,GAAG,CAChC,eAAuB,EACvB,cAAc,GAAG,mBAAmB,EACb,EAAE;IACzB,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IAE7D,IAAI,CAAC,IAAA,qBAAU,EAAC,cAAc,CAAC,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;KACb;IAED,MAAM,kBAAkB,GAAG,IAAA,uBAAY,EAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAmB,CAAC;IAEpE,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC;KACb;IAED,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE;QAC1B,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;KACb;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAzBW,QAAA,kBAAkB,sBAyB7B;AAEK,MAAM,kBAAkB,GAAG,CAChC,eAAuB,EACvB,eAAe,GAAG,oBAAoB,EACd,EAAE;IAC1B,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAE/D,IAAI,CAAC,IAAA,qBAAU,EAAC,eAAe,CAAC,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;KACb;IAED,MAAM,mBAAmB,GAAG,IAAA,uBAAY,EAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IACjF,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAoB,CAAC;IAEvE,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;QACvB,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;KACb;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B"}
|
package/dist/functions/init.js
CHANGED
|
@@ -84,7 +84,7 @@ const initFn = () => {
|
|
|
84
84
|
console.log(` - Go to ${(0, kleur_1.underline)((0, kleur_1.bold)((0, kleur_1.blue)('https://console.dcupl.com')))} and create your free account`);
|
|
85
85
|
console.log(` - Set your ${(0, kleur_1.bold)('projectId')} in the dcupl.config.json`);
|
|
86
86
|
console.log(` - Set your ${(0, kleur_1.bold)('apiKey')} in the dcupl.secrets.json`);
|
|
87
|
-
console.log(` - Push your local
|
|
87
|
+
console.log(` - Push your local workspace to the console using the CLI ${(0, kleur_1.bold)('dcupl files:push --tag my-first-push')}`);
|
|
88
88
|
console.log('');
|
|
89
89
|
console.log(`3) Start your server & check your data in the ${(0, kleur_1.bold)('Data Explorer Tab')}`);
|
|
90
90
|
console.log(` ${(0, kleur_1.blue)((0, kleur_1.bold)('npm run serve'))}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/functions/init.ts"],"names":[],"mappings":";;;;AAAA,uCAAyD;AACzD,gEAAgC;AAChC,iCAA8C;AAC9C,+BAAqC;AAE9B,MAAM,MAAM,GAAG,GAAG,EAAE;IACzB,kBAAQ;SACL,MAAM,CAAC;QACN;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,0BAA0B;SACpC;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,0DAA0D;YACnE,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,eAAe;oBACrB,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,IAAI;iBACd;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,KAAK,EAAE,WAAW;iBACnB;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/functions/init.ts"],"names":[],"mappings":";;;;AAAA,uCAAyD;AACzD,gEAAgC;AAChC,iCAA8C;AAC9C,+BAAqC;AAE9B,MAAM,MAAM,GAAG,GAAG,EAAE;IACzB,kBAAQ;SACL,MAAM,CAAC;QACN;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,0BAA0B;SACpC;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,0DAA0D;YACnE,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,eAAe;oBACrB,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,IAAI;iBACd;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,KAAK,EAAE,WAAW;iBACnB;aACF;SACF;KACF,CAAC;SACD,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE;QACrC,MAAM,YAAY,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAClD,MAAM,mBAAmB,GAAG,IAAA,WAAI,EAAC,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;QACxE,MAAM,mBAAmB,GAAG,IAAA,WAAI,EAAC,aAAa,EAAE,MAA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AAC,CAAC;QACzE,OAAO,CAAC,GAAG,CAAC,+DAA+D,IAAA,YAAI,EAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC;QAC3H,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,iDAAiD,IAAA,YAAI,EAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;QAC1F,OAAO,CAAC,GAAG,CAAC,MAAM,IAAA,YAAI,EAAC,IAAA,YAAI,EAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AA/FW,QAAA,MAAM,UA+FjB"}
|
|
@@ -6,11 +6,11 @@ const common_1 = require("@nestjs/common");
|
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const rxjs_1 = require("rxjs");
|
|
9
|
-
const
|
|
9
|
+
const config_helper_1 = require("../helper/config.helper");
|
|
10
10
|
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
11
11
|
let AppService = class AppService {
|
|
12
12
|
getConfig() {
|
|
13
|
-
const configFile = (0,
|
|
13
|
+
const configFile = (0, config_helper_1.getConfigFileValue)(currentBasePath);
|
|
14
14
|
if (configFile) {
|
|
15
15
|
return configFile;
|
|
16
16
|
}
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,13 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const yargs_1 = tslib_1.__importDefault(require("yargs"));
|
|
5
5
|
const helpers_1 = require("yargs/helpers");
|
|
6
6
|
const init_1 = require("./functions/init");
|
|
7
|
-
const config_push_1 = require("./functions/config/config-push");
|
|
8
|
-
const config_pull_1 = require("./functions/config/config-pull");
|
|
9
7
|
const main_1 = require("./functions/serve/main");
|
|
10
8
|
const welcome_1 = require("./functions/welcome");
|
|
9
|
+
const files_push_1 = require("./functions/files/files-push");
|
|
10
|
+
const generate_types_1 = require("./functions/generate/types/generate-types");
|
|
11
|
+
const files_pull_1 = require("./functions/files/files-pull");
|
|
12
|
+
const files_copy_1 = require("./functions/files/files-copy");
|
|
13
|
+
const files_list_tags_1 = require("./functions/files/files-list-tags");
|
|
11
14
|
const emoji = require('node-emoji');
|
|
12
15
|
(0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
13
16
|
.command(['welcome', 'hey', 'rocks', emoji.get('rocket')], 'You are awesome!', () => { }, (argv) => {
|
|
@@ -15,12 +18,6 @@ const emoji = require('node-emoji');
|
|
|
15
18
|
})
|
|
16
19
|
.command('init', 'Init a local project based on one of our starters', () => { }, (argv) => {
|
|
17
20
|
(0, init_1.initFn)();
|
|
18
|
-
})
|
|
19
|
-
.command('config:push', 'Upload a your local loader config to your dcupl console project', () => { }, (argv) => {
|
|
20
|
-
(0, config_push_1.pushConfig)();
|
|
21
|
-
})
|
|
22
|
-
.command('config:pull', 'Update your local loader config with your dcupl console project config', () => { }, (argv) => {
|
|
23
|
-
(0, config_pull_1.pullConfig)();
|
|
24
21
|
})
|
|
25
22
|
.command('serve [path]', 'Starts your local dev server', (args) => {
|
|
26
23
|
return args.option('port', { default: '8083' }).positional('path', {
|
|
@@ -29,6 +26,41 @@ const emoji = require('node-emoji');
|
|
|
29
26
|
});
|
|
30
27
|
}, (argv) => {
|
|
31
28
|
(0, main_1.bootstrap)(argv);
|
|
29
|
+
})
|
|
30
|
+
.command('generate:types', 'Generate Typescript types for your dcupl models', () => { }, (argv) => {
|
|
31
|
+
(0, generate_types_1.generateTypesFn)();
|
|
32
|
+
})
|
|
33
|
+
.command('files:push', 'Upload files to the dcupl cloud', (args) => {
|
|
34
|
+
return args.option('tag', {
|
|
35
|
+
describe: 'The name of your tag. Default is the current Date as ISO-string',
|
|
36
|
+
default: '',
|
|
37
|
+
});
|
|
38
|
+
}, (argv) => {
|
|
39
|
+
(0, files_push_1.pushFiles)(argv);
|
|
40
|
+
})
|
|
41
|
+
.command('files:pull', 'Download files from the dcupl cloud', (args) => {
|
|
42
|
+
return args.option('tag', {
|
|
43
|
+
describe: 'The name of your tag. Default is the current Date as ISO-string',
|
|
44
|
+
default: '',
|
|
45
|
+
});
|
|
46
|
+
}, (argv) => {
|
|
47
|
+
(0, files_pull_1.pullFiles)(argv);
|
|
48
|
+
})
|
|
49
|
+
.command('files:copy', 'Download files from the dcupl cloud', (args) => {
|
|
50
|
+
return args
|
|
51
|
+
.option('from', {
|
|
52
|
+
describe: 'The name of your tag. Default is the current Date as ISO-string',
|
|
53
|
+
default: '',
|
|
54
|
+
})
|
|
55
|
+
.option('to', {
|
|
56
|
+
describe: 'The name of your tag. Default is the current Date as ISO-string',
|
|
57
|
+
default: '',
|
|
58
|
+
});
|
|
59
|
+
}, (argv) => {
|
|
60
|
+
(0, files_copy_1.copyFiles)(argv);
|
|
61
|
+
})
|
|
62
|
+
.command('files:list', 'Lists all the uploaded tags ', () => { }, (argv) => {
|
|
63
|
+
(0, files_list_tags_1.listTags)(argv);
|
|
32
64
|
})
|
|
33
65
|
.demandCommand(1)
|
|
34
66
|
.parse();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,0DAA0B;AAC1B,2CAAwC;AAExC,2CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,0DAA0B;AAC1B,2CAAwC;AAExC,2CAA0C;AAC1C,iDAAmD;AACnD,iDAAgD;AAChD,6DAAyD;AACzD,8EAA4E;AAC5E,6DAAyD;AACzD,6DAAyD;AACzD,uEAA6D;AAE7D,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEpC,I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C,EACrC,CAAC,IAAI,EAAE,EAAE;IACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;QACxB,QAAQ,EAAE,iEAAiE;QAC3E,OAAO,EAAE,EAAE;KACZ,CAAC,CAAC;AACL,CAAC,EACD,CAAC,IAAI,EAAE,EAAE;IACP,IAAA,sBAAS,EAAC,IAAI,CAAC,CAAC;AAClB,CAAC,CACF;KACA,OAAO,CACN,YAAY,EACZ,qCAAqC,EACrC,CAAC,IAAI,EAAE,EAAE;IACP,OAAO,IAAI;SACR,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,iEAAiE;QAC3E,OAAO,EAAE,EAAE;KACZ,CAAC;SACD,MAAM,CAAC,IAAI,EAAE;QACZ,QAAQ,EAAE,iEAAiE;QAC3E,OAAO,EAAE,EAAE;KACZ,CAAC,CAAC;AACP,CAAC,EACD,CAAC,IAAI,EAAE,EAAE;IACP,IAAA,sBAAS,EAAC,IAAI,CAAC,CAAC;AAClB,CAAC,CACF;KACA,OAAO,CACN,YAAY,EACZ,8BAA8B,EAC9B,GAAG,EAAE,GAAE,CAAC,EACR,CAAC,IAAI,EAAE,EAAE;IACP,IAAA,0BAAQ,EAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CACF;KAEA,aAAa,CAAC,CAAC,CAAC;KAChB,KAAK,EAAE,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"projectId": "",
|
|
3
|
-
"loaderPath": "path/to/loader/
|
|
3
|
+
"loaderPath": "path/to/loader/dcupl.lc.json",
|
|
4
|
+
"modelsBasePath": "path/to/models/",
|
|
5
|
+
"baseFolder": "dcupl",
|
|
6
|
+
"filesUpload": {
|
|
7
|
+
"include": ["**/*.json", "**/*.csv"],
|
|
8
|
+
"exclude": []
|
|
9
|
+
}
|
|
4
10
|
}
|
package/files/common/readme.md
CHANGED
|
@@ -13,7 +13,7 @@ npm install
|
|
|
13
13
|
- Go to [https://console.dcupl.com](https://console.dcupl.com) and create your **free** account.
|
|
14
14
|
- Set your `projectId` in the dcupl.config.json
|
|
15
15
|
- Set your `apiKey` in the dcupl.secrets.json
|
|
16
|
-
- Push your local
|
|
16
|
+
- Push your local workspace to the console using the CLI `dcupl files:push --tag my-first-push`
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
### 3) Start your development server
|
|
@@ -1,20 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"presets": [
|
|
3
3
|
{
|
|
4
|
-
"key": "
|
|
5
|
-
"description": "My
|
|
6
|
-
"
|
|
4
|
+
"key": "localhost",
|
|
5
|
+
"description": "My localhost preset",
|
|
6
|
+
"variables": [
|
|
7
|
+
{
|
|
8
|
+
"key": "apiUrl",
|
|
9
|
+
"value": "http://localhost:8083"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"key": "draft",
|
|
15
|
+
"description": "My draft preset.",
|
|
16
|
+
"environmentKeys": ["default"],
|
|
17
|
+
"variables": [
|
|
18
|
+
{
|
|
19
|
+
"key": "apiUrl",
|
|
20
|
+
"value": "https://cdn.dcupl.com/files/projects/${projectId}/draft"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"key": "published",
|
|
26
|
+
"description": "My published preset.",
|
|
27
|
+
"environmentKeys": ["default"],
|
|
28
|
+
"variables": [
|
|
29
|
+
{
|
|
30
|
+
"key": "apiUrl",
|
|
31
|
+
"value": "https://cdn.dcupl.com/files/projects/${projectId}/published"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
7
34
|
}
|
|
8
35
|
],
|
|
9
36
|
"environments": [
|
|
10
37
|
{
|
|
11
38
|
"key": "default",
|
|
12
|
-
"description": "
|
|
39
|
+
"description": "The default environment containing variables that are used in multiple presets.",
|
|
13
40
|
"variables": [
|
|
14
41
|
{
|
|
15
|
-
"key": "
|
|
16
|
-
"value": "
|
|
17
|
-
"description": "The base url of our server"
|
|
42
|
+
"key": "projectId",
|
|
43
|
+
"value": ""
|
|
18
44
|
}
|
|
19
45
|
]
|
|
20
46
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"projectId": "",
|
|
3
|
+
"loaderPath": "dcupl/dcupl.lc.json",
|
|
4
|
+
"modelsBasePath": "dcupl/models",
|
|
5
|
+
"baseFolder": "dcupl",
|
|
6
|
+
"filesUpload": {
|
|
7
|
+
"include": ["**/*.json", "**/*.csv"],
|
|
8
|
+
"exclude": []
|
|
4
9
|
}
|
|
5
|
-
|
|
10
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"presets": [
|
|
3
|
+
{
|
|
4
|
+
"key": "localhost",
|
|
5
|
+
"description": "My localhost preset",
|
|
6
|
+
"variables": [
|
|
7
|
+
{
|
|
8
|
+
"key": "apiUrl",
|
|
9
|
+
"value": "http://localhost:8083"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"key": "draft",
|
|
15
|
+
"description": "My draft preset.",
|
|
16
|
+
"environmentKeys": ["default"],
|
|
17
|
+
"variables": [
|
|
18
|
+
{
|
|
19
|
+
"key": "apiUrl",
|
|
20
|
+
"value": "https://cdn.dcupl.com/files/projects/${projectId}/draft"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"key": "published",
|
|
26
|
+
"description": "My published preset.",
|
|
27
|
+
"environmentKeys": ["default"],
|
|
28
|
+
"variables": [
|
|
29
|
+
{
|
|
30
|
+
"key": "apiUrl",
|
|
31
|
+
"value": "https://cdn.dcupl.com/files/projects/${projectId}/published"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"environments": [
|
|
37
|
+
{
|
|
38
|
+
"key": "default",
|
|
39
|
+
"description": "The default environment containing variables that are used in multiple presets.",
|
|
40
|
+
"variables": [
|
|
41
|
+
{
|
|
42
|
+
"key": "projectId",
|
|
43
|
+
"value": ""
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"headers": [],
|
|
49
|
+
"resources": [
|
|
50
|
+
{
|
|
51
|
+
"url": "${apiUrl}/models/a.dcupl.json",
|
|
52
|
+
"type": "model"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"url": "${apiUrl}/data/a.data.json",
|
|
56
|
+
"type": "data",
|
|
57
|
+
"model": "modelA"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"projectId": "",
|
|
3
|
+
"loaderPath": "dcupl/dcupl.lc.json",
|
|
4
|
+
"modelsBasePath": "dcupl/models",
|
|
5
|
+
"baseFolder": "dcupl",
|
|
6
|
+
"filesUpload": {
|
|
7
|
+
"include": ["**/*.json", "**/*.csv"],
|
|
8
|
+
"exclude": []
|
|
4
9
|
}
|
|
5
|
-
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcupl/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "The official dcupl CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "npm run clean && tsc",
|
|
11
|
+
"build:watch": "npm run clean && tsc -w",
|
|
11
12
|
"clean": "rm -rf dist",
|
|
12
13
|
"global": "npm i -g && dcupl",
|
|
13
14
|
"start": "npm run build && npm run global",
|
|
@@ -22,23 +23,32 @@
|
|
|
22
23
|
"license": "ISC",
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@nestjs/cli": "^8.2.5",
|
|
26
|
+
"@types/adm-zip": "^0.5.0",
|
|
25
27
|
"@types/compression": "^1.7.2",
|
|
26
28
|
"@types/fs-extra": "^9.0.13",
|
|
29
|
+
"@types/glob": "^7.2.0",
|
|
27
30
|
"@types/inquirer": "^8.2.0",
|
|
31
|
+
"@types/prettier": "^2.6.3",
|
|
28
32
|
"@types/yargs": "^17.0.8",
|
|
29
33
|
"typescript": "^4.5.5"
|
|
30
34
|
},
|
|
31
35
|
"dependencies": {
|
|
36
|
+
"@dcupl/common": "^0.0.26",
|
|
32
37
|
"@nestjs/common": "^8.4.5",
|
|
33
38
|
"@nestjs/core": "^8.4.5",
|
|
34
39
|
"@nestjs/platform-express": "^8.4.5",
|
|
35
40
|
"@nestjs/serve-static": "^2.2.2",
|
|
41
|
+
"adm-zip": "^0.5.9",
|
|
36
42
|
"axios": "^0.27.2",
|
|
37
43
|
"compression": "^1.7.4",
|
|
44
|
+
"form-data": "^4.0.0",
|
|
38
45
|
"fs-extra": "^10.0.0",
|
|
46
|
+
"glob": "^8.0.3",
|
|
39
47
|
"inquirer": "^8.2.0",
|
|
40
48
|
"kleur": "^4.1.4",
|
|
49
|
+
"lodash": "^4.17.21",
|
|
41
50
|
"node-emoji": "^1.11.0",
|
|
51
|
+
"prettier": "^2.7.1",
|
|
42
52
|
"reflect-metadata": "^0.1.13",
|
|
43
53
|
"rxjs": "^7.5.5",
|
|
44
54
|
"serve-index": "^1.9.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const pullConfig: () => void;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pullConfig = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_extra_1 = require("fs-extra");
|
|
6
|
-
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
9
|
-
const config_common_1 = require("./config.common");
|
|
10
|
-
const pullConfig = () => {
|
|
11
|
-
inquirer_1.default.prompt([]).then(() => {
|
|
12
|
-
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
13
|
-
const cliConfig = (0, config_common_1.getConfigFileValue)(currentBasePath);
|
|
14
|
-
const secrets = (0, config_common_1.getSecretFileValue)(currentBasePath);
|
|
15
|
-
if (!cliConfig || !secrets) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const loaderFilePath = (0, path_1.join)(currentBasePath, cliConfig.loaderPath);
|
|
19
|
-
if (!(0, fs_extra_1.existsSync)(loaderFilePath)) {
|
|
20
|
-
console.log(`Error: There is no loader file at ${loaderFilePath} present`);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const apiUrl = cliConfig.consoleApiUrl || 'https://api.dcupl.com';
|
|
24
|
-
const config = {
|
|
25
|
-
method: 'get',
|
|
26
|
-
url: `${apiUrl}/projects/${cliConfig.projectId}/configuration?apikey=${secrets.apiKey}`,
|
|
27
|
-
headers: {
|
|
28
|
-
'Content-Type': 'application/json',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
(0, axios_1.default)(config)
|
|
32
|
-
.then(function (response) {
|
|
33
|
-
(0, fs_extra_1.writeFileSync)(loaderFilePath, JSON.stringify(response.data, null, 2), { encoding: 'utf-8' });
|
|
34
|
-
console.log(`${loaderFilePath} updated`);
|
|
35
|
-
})
|
|
36
|
-
.catch(function (error) {
|
|
37
|
-
console.log(error);
|
|
38
|
-
console.log(error?.response?.data);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
exports.pullConfig = pullConfig;
|
|
43
|
-
//# sourceMappingURL=config-pull.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-pull.js","sourceRoot":"","sources":["../../../src/functions/config/config-pull.ts"],"names":[],"mappings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AC3C,CAAC,CAAC;aACD,KAAK,CAAC,UAAU,KAAK;YACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AArCW,QAAA,UAAU,cAqCrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const pushConfig: () => void;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pushConfig = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_extra_1 = require("fs-extra");
|
|
6
|
-
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
9
|
-
const config_common_1 = require("./config.common");
|
|
10
|
-
const pushConfig = () => {
|
|
11
|
-
inquirer_1.default.prompt([]).then(() => {
|
|
12
|
-
const currentBasePath = (0, path_1.join)(process.cwd());
|
|
13
|
-
const cliConfig = (0, config_common_1.getConfigFileValue)(currentBasePath);
|
|
14
|
-
const secrets = (0, config_common_1.getSecretFileValue)(currentBasePath);
|
|
15
|
-
if (!cliConfig || !secrets) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const loaderFilePath = (0, path_1.join)(currentBasePath, cliConfig.loaderPath);
|
|
19
|
-
if (!(0, fs_extra_1.existsSync)(loaderFilePath)) {
|
|
20
|
-
console.log(`Error: There is no loader file at ${loaderFilePath} present`);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const loaderFileAsString = (0, fs_extra_1.readFileSync)(loaderFilePath, { encoding: 'utf-8' });
|
|
24
|
-
const loaderFile = JSON.parse(loaderFileAsString);
|
|
25
|
-
if (!loaderFile) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const apiUrl = cliConfig.consoleApiUrl || 'https://api.dcupl.com';
|
|
29
|
-
const config = {
|
|
30
|
-
method: 'post',
|
|
31
|
-
url: `${apiUrl}/projects/${cliConfig.projectId}/configuration/?apikey=${secrets.apiKey}`,
|
|
32
|
-
headers: {
|
|
33
|
-
'Content-Type': 'application/json',
|
|
34
|
-
},
|
|
35
|
-
data: loaderFile,
|
|
36
|
-
};
|
|
37
|
-
(0, axios_1.default)(config)
|
|
38
|
-
.then(function (response) {
|
|
39
|
-
console.log('config sucessfully uploaded');
|
|
40
|
-
})
|
|
41
|
-
.catch(function (error) {
|
|
42
|
-
console.log(error);
|
|
43
|
-
console.log(error?.response?.data);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
exports.pushConfig = pushConfig;
|
|
48
|
-
//# sourceMappingURL=config-push.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-push.js","sourceRoot":"","sources":["../../../src/functions/config/config-push.ts"],"names":[],"mappings":";;;;AAAA,uCAAoD;AACpD,gEAAgC;AAChC,+BAA4B;AAE5B,0DAAkD;AAClD,mDAAyE;AAElE,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,kBAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QAC5B,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAE5C,MAAM,SAAS,GAAG,IAAA,kCAAkB,EAAC,eAAe,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,IAAA,kCAAkB,EAAC,eAAe,CAAC,CAAC;QAEpD,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE;YAC1B,OAAO;SACR;QAED,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;QAEnE,IAAI,CAAC,IAAA,qBAAU,EAAC,cAAc,CAAC,EAAE;YAC/B,OAAO,CAAC,GAAG,CAAC,qCAAqC,cAAc,UAAU,CAAC,CAAC;YAC3E,OAAO;SACR;QAED,MAAM,kBAAkB,GAAG,IAAA,uBAAY,EAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAC/E,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAElD,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QAED,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,IAAI,uBAAuB,CAAC;QAElE,MAAM,MAAM,GAAuB;YACjC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,GAAG,MAAM,aAAa,SAAS,CAAC,SAAS,0BAA0B,OAAO,CAAC,MAAM,EAAE;YACxF,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,UAAU;SACjB,CAAC;QAEF,IAAA,eAAK,EAAC,MAAM,CAAC;aACV,IAAI,CAAC,UAAU,QAAQ;YACtB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC7C,CAAC,CAAC;aACD,KAAK,CAAC,UAAU,KAAK;YACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA7CW,QAAA,UAAU,cA6CrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.common.js","sourceRoot":"","sources":["../../../src/functions/config/config.common.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AACpD,+BAAqC;AAW9B,MAAM,kBAAkB,GAAG,CAChC,eAAuB,EACvB,cAAc,GAAG,mBAAmB,EACb,EAAE;IACzB,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AAC,CAAC;QAC5E,OAAO,IAAI,CAAC;KACb;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
{
|
|
4
|
-
"key": "default",
|
|
5
|
-
"description": "My default preset",
|
|
6
|
-
"environmentKeys": ["default"]
|
|
7
|
-
}
|
|
8
|
-
],
|
|
9
|
-
"environments": [
|
|
10
|
-
{
|
|
11
|
-
"key": "default",
|
|
12
|
-
"description": "My default environment for local development",
|
|
13
|
-
"variables": [
|
|
14
|
-
{
|
|
15
|
-
"key": "apiUrl",
|
|
16
|
-
"value": "http://localhost:8083"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"headers": [],
|
|
22
|
-
"resources": [
|
|
23
|
-
{
|
|
24
|
-
"url": "${apiUrl}/models/a.dcupl.json",
|
|
25
|
-
"type": "model"
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
"url": "${apiUrl}/data/a.data.json",
|
|
30
|
-
"type": "data",
|
|
31
|
-
"model": "modelA"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|