@rockcarver/frodo-lib 0.12.0 → 0.12.2-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/CHANGELOG.md +22 -2
- package/cjs/api/AuthenticateApi.js +44 -14
- package/cjs/api/AuthenticateApi.js.map +1 -1
- package/cjs/api/BaseApi.js +171 -90
- package/cjs/api/BaseApi.js.map +1 -1
- package/cjs/api/CirclesOfTrustApi.js +87 -31
- package/cjs/api/CirclesOfTrustApi.js.map +1 -1
- package/cjs/api/EmailTemplateApi.js +48 -9
- package/cjs/api/EmailTemplateApi.js.map +1 -1
- package/cjs/api/IdmConfigApi.js +91 -25
- package/cjs/api/IdmConfigApi.js.map +1 -1
- package/cjs/api/LogApi.js +84 -29
- package/cjs/api/LogApi.js.map +1 -1
- package/cjs/api/ManagedObjectApi.js +66 -19
- package/cjs/api/ManagedObjectApi.js.map +1 -1
- package/cjs/api/NodeApi.js +190 -0
- package/cjs/api/NodeApi.js.map +1 -0
- package/cjs/api/NodeApi.test.js.map +1 -0
- package/cjs/api/OAuth2ClientApi.js +73 -27
- package/cjs/api/OAuth2ClientApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.js +82 -31
- package/cjs/api/OAuth2OIDCApi.js.map +1 -1
- package/cjs/api/OAuth2ProviderApi.js +39 -14
- package/cjs/api/OAuth2ProviderApi.js.map +1 -1
- package/cjs/api/RealmApi.js +100 -36
- package/cjs/api/RealmApi.js.map +1 -1
- package/cjs/api/Saml2Api.js +162 -74
- package/cjs/api/Saml2Api.js.map +1 -1
- package/cjs/api/ScriptApi.js +84 -29
- package/cjs/api/ScriptApi.js.map +1 -1
- package/cjs/api/SecretsApi.js +188 -69
- package/cjs/api/SecretsApi.js.map +1 -1
- package/cjs/api/ServerInfoApi.js +48 -14
- package/cjs/api/ServerInfoApi.js.map +1 -1
- package/cjs/api/SocialIdentityProvidersApi.js +103 -37
- package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
- package/cjs/api/StartupApi.js +74 -26
- package/cjs/api/StartupApi.js.map +1 -1
- package/cjs/api/StartupApi.test.js.map +1 -0
- package/cjs/api/ThemeApi.js +188 -96
- package/cjs/api/ThemeApi.js.map +1 -1
- package/cjs/api/TreeApi.js +96 -113
- package/cjs/api/TreeApi.js.map +1 -1
- package/cjs/api/TreeApi.test.js.map +1 -0
- package/cjs/api/VariablesApi.js +106 -39
- package/cjs/api/VariablesApi.js.map +1 -1
- package/cjs/api/utils/ApiUtils.js +41 -21
- package/cjs/api/utils/ApiUtils.js.map +1 -1
- package/cjs/api/utils/ApiUtils.test.js.map +1 -1
- package/cjs/api/utils/Base64.js +35 -10
- package/cjs/api/utils/Base64.js.map +1 -1
- package/cjs/index.js +126 -41
- package/cjs/index.js.map +1 -1
- package/cjs/index.test.js.map +1 -1
- package/cjs/ops/AdminOps.js +649 -480
- package/cjs/ops/AdminOps.js.map +1 -1
- package/cjs/ops/AuthenticateOps.js +302 -211
- package/cjs/ops/AuthenticateOps.js.map +1 -1
- package/cjs/ops/AuthenticateOps.test.js.map +1 -1
- package/cjs/ops/CirclesOfTrustOps.js +356 -219
- package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.js +200 -122
- package/cjs/ops/ConnectionProfileOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.js +301 -192
- package/cjs/ops/EmailTemplateOps.js.map +1 -1
- package/cjs/ops/IdmOps.js +190 -121
- package/cjs/ops/IdmOps.js.map +1 -1
- package/cjs/ops/IdpOps.js +327 -196
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/JourneyOps.js +1402 -1131
- package/cjs/ops/JourneyOps.js.map +1 -1
- package/cjs/ops/LogOps.js +125 -75
- package/cjs/ops/LogOps.js.map +1 -1
- package/cjs/ops/ManagedObjectOps.js +43 -16
- package/cjs/ops/ManagedObjectOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.js +155 -87
- package/cjs/ops/OAuth2ClientOps.js.map +1 -1
- package/cjs/ops/OrganizationOps.js +89 -56
- package/cjs/ops/OrganizationOps.js.map +1 -1
- package/cjs/ops/RealmOps.js +131 -83
- package/cjs/ops/RealmOps.js.map +1 -1
- package/cjs/ops/SamlOps.js +497 -331
- package/cjs/ops/SamlOps.js.map +1 -1
- package/cjs/ops/ScriptOps.js +215 -133
- package/cjs/ops/ScriptOps.js.map +1 -1
- package/cjs/ops/SecretsOps.js +269 -156
- package/cjs/ops/SecretsOps.js.map +1 -1
- package/cjs/ops/StartupOps.js +100 -75
- package/cjs/ops/StartupOps.js.map +1 -1
- package/cjs/ops/ThemeOps.js +373 -221
- package/cjs/ops/ThemeOps.js.map +1 -1
- package/cjs/ops/VariablesOps.js +168 -90
- package/cjs/ops/VariablesOps.js.map +1 -1
- package/cjs/ops/utils/Console.js +68 -33
- package/cjs/ops/utils/Console.js.map +1 -1
- package/cjs/ops/utils/DataProtection.js +100 -64
- package/cjs/ops/utils/DataProtection.js.map +1 -1
- package/cjs/ops/utils/DataProtection.test.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.js +86 -47
- package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.test.js.map +1 -1
- package/cjs/ops/utils/OpsUtils.js +47 -20
- package/cjs/ops/utils/OpsUtils.js.map +1 -1
- package/cjs/ops/utils/Wordwrap.js +10 -2
- package/cjs/ops/utils/Wordwrap.js.map +1 -1
- package/cjs/storage/SessionStorage.js +20 -8
- package/cjs/storage/SessionStorage.js.map +1 -1
- package/cjs/storage/StaticStorage.js +26 -10
- package/cjs/storage/StaticStorage.js.map +1 -1
- package/esm/api/BaseApi.mjs +35 -7
- package/esm/api/NodeApi.mjs +114 -0
- package/esm/api/NodeApi.test.mjs +105 -0
- package/esm/api/StartupApi.mjs +18 -8
- package/esm/api/StartupApi.test.mjs +56 -0
- package/esm/api/TreeApi.mjs +27 -99
- package/esm/api/TreeApi.test.mjs +175 -0
- package/esm/index.mjs +7 -5
- package/esm/ops/IdpOps.mjs +1 -1
- package/esm/ops/JourneyOps.mjs +165 -154
- package/esm/ops/StartupOps.mjs +59 -62
- package/esm/ops/utils/Console.mjs +3 -2
- package/package.json +7 -4
- package/types/api/AuthenticateApi.d.ts +2 -0
- package/types/api/AuthenticateApi.d.ts.map +1 -0
- package/types/api/BaseApi.d.ts +50 -0
- package/types/api/BaseApi.d.ts.map +1 -0
- package/types/api/CirclesOfTrustApi.d.ts +24 -0
- package/types/api/CirclesOfTrustApi.d.ts.map +1 -0
- package/types/api/EmailTemplateApi.d.ts +22 -0
- package/types/api/EmailTemplateApi.d.ts.map +1 -0
- package/types/api/IdmConfigApi.d.ts +39 -0
- package/types/api/IdmConfigApi.d.ts.map +1 -0
- package/types/api/LogApi.d.ts +4 -0
- package/types/api/LogApi.d.ts.map +1 -0
- package/types/api/ManagedObjectApi.d.ts +21 -0
- package/types/api/ManagedObjectApi.d.ts.map +1 -0
- package/types/api/NodeApi.d.ts +38 -0
- package/types/api/NodeApi.d.ts.map +1 -0
- package/types/api/OAuth2ClientApi.d.ts +18 -0
- package/types/api/OAuth2ClientApi.d.ts.map +1 -0
- package/types/api/OAuth2OIDCApi.d.ts +22 -0
- package/types/api/OAuth2OIDCApi.d.ts.map +1 -0
- package/types/api/OAuth2ProviderApi.d.ts +5 -0
- package/types/api/OAuth2ProviderApi.d.ts.map +1 -0
- package/types/api/RealmApi.d.ts +30 -0
- package/types/api/RealmApi.d.ts.map +1 -0
- package/types/api/Saml2Api.d.ts +52 -0
- package/types/api/Saml2Api.d.ts.map +1 -0
- package/types/api/ScriptApi.d.ts +24 -0
- package/types/api/ScriptApi.d.ts.map +1 -0
- package/types/api/SecretsApi.d.ts +10 -0
- package/types/api/SecretsApi.d.ts.map +1 -0
- package/types/api/ServerInfoApi.d.ts +10 -0
- package/types/api/ServerInfoApi.d.ts.map +1 -0
- package/types/api/SocialIdentityProvidersApi.d.ts +31 -0
- package/types/api/SocialIdentityProvidersApi.d.ts.map +1 -0
- package/types/api/StartupApi.d.ts +14 -0
- package/types/api/StartupApi.d.ts.map +1 -0
- package/types/api/ThemeApi.d.ts +54 -0
- package/types/api/ThemeApi.d.ts.map +1 -0
- package/types/api/TreeApi.d.ts +24 -0
- package/types/api/TreeApi.d.ts.map +1 -0
- package/types/api/VariablesApi.d.ts +32 -0
- package/types/api/VariablesApi.d.ts.map +1 -0
- package/types/api/utils/ApiUtils.d.ts +29 -0
- package/types/api/utils/ApiUtils.d.ts.map +1 -0
- package/types/api/utils/Base64.d.ts +30 -0
- package/types/api/utils/Base64.d.ts.map +1 -0
- package/types/index.d.ts +26 -0
- package/types/index.d.ts.map +1 -0
- package/types/ops/AdminOps.d.ts +11 -0
- package/types/ops/AdminOps.d.ts.map +1 -0
- package/types/ops/AuthenticateOps.d.ts +6 -0
- package/types/ops/AuthenticateOps.d.ts.map +1 -0
- package/types/ops/CirclesOfTrustOps.d.ts +40 -0
- package/types/ops/CirclesOfTrustOps.d.ts.map +1 -0
- package/types/ops/ConnectionProfileOps.d.ts +47 -0
- package/types/ops/ConnectionProfileOps.d.ts.map +1 -0
- package/types/ops/EmailTemplateOps.d.ts +40 -0
- package/types/ops/EmailTemplateOps.d.ts.map +1 -0
- package/types/ops/IdmOps.d.ts +27 -0
- package/types/ops/IdmOps.d.ts.map +1 -0
- package/types/ops/IdpOps.d.ts +45 -0
- package/types/ops/IdpOps.d.ts.map +1 -0
- package/types/ops/JourneyOps.d.ts +145 -0
- package/types/ops/JourneyOps.d.ts.map +1 -0
- package/types/ops/LogOps.d.ts +5 -0
- package/types/ops/LogOps.d.ts.map +1 -0
- package/types/ops/ManagedObjectOps.d.ts +14 -0
- package/types/ops/ManagedObjectOps.d.ts.map +1 -0
- package/types/ops/OAuth2ClientOps.d.ts +24 -0
- package/types/ops/OAuth2ClientOps.d.ts.map +1 -0
- package/types/ops/OrganizationOps.d.ts +11 -0
- package/types/ops/OrganizationOps.d.ts.map +1 -0
- package/types/ops/RealmOps.d.ts +22 -0
- package/types/ops/RealmOps.d.ts.map +1 -0
- package/types/ops/SamlOps.d.ts +51 -0
- package/types/ops/SamlOps.d.ts.map +1 -0
- package/types/ops/ScriptOps.d.ts +30 -0
- package/types/ops/ScriptOps.d.ts.map +1 -0
- package/types/ops/SecretsOps.d.ts +63 -0
- package/types/ops/SecretsOps.d.ts.map +1 -0
- package/types/ops/StartupOps.d.ts +25 -0
- package/types/ops/StartupOps.d.ts.map +1 -0
- package/types/ops/ThemeOps.d.ts +66 -0
- package/types/ops/ThemeOps.d.ts.map +1 -0
- package/types/ops/VariablesOps.d.ts +39 -0
- package/types/ops/VariablesOps.d.ts.map +1 -0
- package/types/ops/utils/Console.d.ts +63 -0
- package/types/ops/utils/Console.d.ts.map +1 -0
- package/types/ops/utils/DataProtection.d.ts +6 -0
- package/types/ops/utils/DataProtection.d.ts.map +1 -0
- package/types/ops/utils/ExportImportUtils.d.ts +22 -0
- package/types/ops/utils/ExportImportUtils.d.ts.map +1 -0
- package/types/ops/utils/OpsUtils.d.ts +27 -0
- package/types/ops/utils/OpsUtils.d.ts.map +1 -0
- package/types/ops/utils/Wordwrap.d.ts +1 -0
- package/types/ops/utils/Wordwrap.d.ts.map +1 -0
- package/types/storage/SessionStorage.d.ts +47 -0
- package/types/storage/SessionStorage.d.ts.map +1 -0
- package/types/storage/StaticStorage.d.ts +14 -0
- package/types/storage/StaticStorage.d.ts.map +1 -0
package/cjs/ops/ThemeOps.js
CHANGED
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.deleteThemeByNameCmd = deleteThemeByNameCmd;
|
|
7
|
+
exports.deleteThemeCmd = deleteThemeCmd;
|
|
8
|
+
exports.deleteThemesCmd = deleteThemesCmd;
|
|
9
|
+
exports.exportThemeById = exportThemeById;
|
|
10
|
+
exports.exportThemeByName = exportThemeByName;
|
|
11
|
+
exports.exportThemesToFile = exportThemesToFile;
|
|
12
|
+
exports.exportThemesToFiles = exportThemesToFiles;
|
|
13
|
+
exports.importFirstThemeFromFile = importFirstThemeFromFile;
|
|
14
|
+
exports.importThemeById = importThemeById;
|
|
15
|
+
exports.importThemeByName = importThemeByName;
|
|
16
|
+
exports.importThemesFromFile = importThemesFromFile;
|
|
17
|
+
exports.importThemesFromFiles = importThemesFromFiles;
|
|
18
|
+
exports.listThemes = listThemes;
|
|
19
|
+
|
|
20
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
21
|
+
|
|
22
|
+
var _ThemeApi = require("../api/ThemeApi");
|
|
23
|
+
|
|
24
|
+
var _Console = require("./utils/Console");
|
|
25
|
+
|
|
26
|
+
var _ExportImportUtils = require("./utils/ExportImportUtils");
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
30
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
31
|
+
|
|
32
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
33
|
+
|
|
5
34
|
/**
|
|
6
35
|
* List all the themes
|
|
7
36
|
* @param {boolean} long Long version, more fields
|
|
8
37
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const themeList = await getThemes();
|
|
12
|
-
themeList.sort((a, b) => a.name.localeCompare(b.name));
|
|
13
|
-
|
|
14
|
-
if (!long) {
|
|
15
|
-
themeList.forEach(theme => {
|
|
16
|
-
printMessage(`${theme.isDefault ? theme.name.brightCyan : theme.name}`, 'data');
|
|
17
|
-
});
|
|
18
|
-
} else {
|
|
19
|
-
const table = createTable(['Name'['brightCyan'], 'Id'['brightCyan'], 'Default'['brightCyan']]);
|
|
20
|
-
themeList.forEach(theme => {
|
|
21
|
-
table.push([`${theme.name}`, `${theme._id}`, `${theme.isDefault ? 'Yes'['brightGreen'] : ''}`]);
|
|
22
|
-
});
|
|
23
|
-
printMessage(table.toString(), 'data');
|
|
24
|
-
}
|
|
38
|
+
function listThemes() {
|
|
39
|
+
return _listThemes.apply(this, arguments);
|
|
25
40
|
}
|
|
26
41
|
/**
|
|
27
42
|
* Export theme by name to file
|
|
@@ -29,24 +44,30 @@ export async function listThemes(long = false) {
|
|
|
29
44
|
* @param {String} file optional export file name
|
|
30
45
|
*/
|
|
31
46
|
|
|
32
|
-
export async function exportThemeByName(name, file) {
|
|
33
|
-
let fileName = getTypedFilename(name, 'theme');
|
|
34
47
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
function _listThemes() {
|
|
49
|
+
_listThemes = _asyncToGenerator(function* () {
|
|
50
|
+
var long = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
51
|
+
var themeList = yield (0, _ThemeApi.getThemes)();
|
|
52
|
+
themeList.sort((a, b) => a.name.localeCompare(b.name));
|
|
38
53
|
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
if (!long) {
|
|
55
|
+
themeList.forEach(theme => {
|
|
56
|
+
(0, _Console.printMessage)("".concat(theme.isDefault ? theme.name.brightCyan : theme.name), 'data');
|
|
57
|
+
});
|
|
58
|
+
} else {
|
|
59
|
+
var table = (0, _Console.createTable)(['Name'['brightCyan'], 'Id'['brightCyan'], 'Default'['brightCyan']]);
|
|
60
|
+
themeList.forEach(theme => {
|
|
61
|
+
table.push(["".concat(theme.name), "".concat(theme._id), "".concat(theme.isDefault ? 'Yes'['brightGreen'] : '')]);
|
|
62
|
+
});
|
|
63
|
+
(0, _Console.printMessage)(table.toString(), 'data');
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return _listThemes.apply(this, arguments);
|
|
67
|
+
}
|
|
41
68
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
printMessage(`Theme ${name} not found!`, 'error');
|
|
45
|
-
} else {
|
|
46
|
-
updateProgressIndicator(`Writing file ${fileName}`);
|
|
47
|
-
saveToFile('theme', themeData, '_id', fileName);
|
|
48
|
-
stopProgressIndicator(`Successfully exported theme ${name}.`);
|
|
49
|
-
}
|
|
69
|
+
function exportThemeByName(_x, _x2) {
|
|
70
|
+
return _exportThemeByName.apply(this, arguments);
|
|
50
71
|
}
|
|
51
72
|
/**
|
|
52
73
|
* Export theme by uuid to file
|
|
@@ -54,62 +75,93 @@ export async function exportThemeByName(name, file) {
|
|
|
54
75
|
* @param {String} file optional export file name
|
|
55
76
|
*/
|
|
56
77
|
|
|
57
|
-
export async function exportThemeById(id, file) {
|
|
58
|
-
let fileName = getTypedFilename(id, 'theme');
|
|
59
78
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
79
|
+
function _exportThemeByName() {
|
|
80
|
+
_exportThemeByName = _asyncToGenerator(function* (name, file) {
|
|
81
|
+
var fileName = (0, _ExportImportUtils.getTypedFilename)(name, 'theme');
|
|
82
|
+
|
|
83
|
+
if (file) {
|
|
84
|
+
fileName = file;
|
|
85
|
+
}
|
|
63
86
|
|
|
64
|
-
|
|
65
|
-
|
|
87
|
+
(0, _Console.createProgressIndicator)(1, "Exporting ".concat(name));
|
|
88
|
+
var themeData = yield (0, _ThemeApi.getThemeByName)(name);
|
|
66
89
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
90
|
+
if (themeData.length === 0) {
|
|
91
|
+
(0, _Console.stopProgressIndicator)("Theme ".concat(name, " not found!"));
|
|
92
|
+
(0, _Console.printMessage)("Theme ".concat(name, " not found!"), 'error');
|
|
93
|
+
} else {
|
|
94
|
+
(0, _Console.updateProgressIndicator)("Writing file ".concat(fileName));
|
|
95
|
+
(0, _ExportImportUtils.saveToFile)('theme', themeData, '_id', fileName);
|
|
96
|
+
(0, _Console.stopProgressIndicator)("Successfully exported theme ".concat(name, "."));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return _exportThemeByName.apply(this, arguments);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function exportThemeById(_x3, _x4) {
|
|
103
|
+
return _exportThemeById.apply(this, arguments);
|
|
75
104
|
}
|
|
76
105
|
/**
|
|
77
106
|
* Export all themes to file
|
|
78
107
|
* @param {String} file optional export file name
|
|
79
108
|
*/
|
|
80
109
|
|
|
81
|
-
export async function exportThemesToFile(file) {
|
|
82
|
-
let fileName = getTypedFilename(`all${getRealmString()}Themes`, 'theme');
|
|
83
110
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
111
|
+
function _exportThemeById() {
|
|
112
|
+
_exportThemeById = _asyncToGenerator(function* (id, file) {
|
|
113
|
+
var fileName = (0, _ExportImportUtils.getTypedFilename)(id, 'theme');
|
|
87
114
|
|
|
88
|
-
|
|
89
|
-
|
|
115
|
+
if (file) {
|
|
116
|
+
fileName = file;
|
|
117
|
+
}
|
|
90
118
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
119
|
+
(0, _Console.createProgressIndicator)(1, "Exporting ".concat(id));
|
|
120
|
+
var themeData = yield (0, _ThemeApi.getTheme)(id);
|
|
94
121
|
|
|
95
|
-
|
|
96
|
-
|
|
122
|
+
if (themeData.length === 0) {
|
|
123
|
+
(0, _Console.stopProgressIndicator)("Theme ".concat(id, " not found!"));
|
|
124
|
+
(0, _Console.printMessage)("Theme ".concat(id, " not found!"), 'error');
|
|
125
|
+
} else {
|
|
126
|
+
(0, _Console.updateProgressIndicator)("Writing file ".concat(fileName));
|
|
127
|
+
(0, _ExportImportUtils.saveToFile)('theme', themeData, '_id', fileName);
|
|
128
|
+
(0, _Console.stopProgressIndicator)("Successfully exported theme ".concat(id, "."));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
return _exportThemeById.apply(this, arguments);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function exportThemesToFile(_x5) {
|
|
135
|
+
return _exportThemesToFile.apply(this, arguments);
|
|
97
136
|
}
|
|
98
137
|
/**
|
|
99
138
|
* Export all themes to separate files
|
|
100
139
|
*/
|
|
101
140
|
|
|
102
|
-
export async function exportThemesToFiles() {
|
|
103
|
-
const allThemesData = await getThemes();
|
|
104
|
-
createProgressIndicator(allThemesData.length, 'Exporting themes');
|
|
105
141
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
142
|
+
function _exportThemesToFile() {
|
|
143
|
+
_exportThemesToFile = _asyncToGenerator(function* (file) {
|
|
144
|
+
var fileName = (0, _ExportImportUtils.getTypedFilename)("all".concat((0, _ExportImportUtils.getRealmString)(), "Themes"), 'theme');
|
|
145
|
+
|
|
146
|
+
if (file) {
|
|
147
|
+
fileName = file;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
var allThemesData = yield (0, _ThemeApi.getThemes)();
|
|
151
|
+
(0, _Console.createProgressIndicator)(allThemesData.length, 'Exporting themes');
|
|
111
152
|
|
|
112
|
-
|
|
153
|
+
for (var themeData of allThemesData) {
|
|
154
|
+
(0, _Console.updateProgressIndicator)("Exporting theme ".concat(themeData.name));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
(0, _ExportImportUtils.saveToFile)('theme', allThemesData, '_id', fileName);
|
|
158
|
+
(0, _Console.stopProgressIndicator)("".concat(allThemesData.length, " themes exported to ").concat(fileName, "."));
|
|
159
|
+
});
|
|
160
|
+
return _exportThemesToFile.apply(this, arguments);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function exportThemesToFiles() {
|
|
164
|
+
return _exportThemesToFiles.apply(this, arguments);
|
|
113
165
|
}
|
|
114
166
|
/**
|
|
115
167
|
* Import theme by name from file
|
|
@@ -117,40 +169,25 @@ export async function exportThemesToFiles() {
|
|
|
117
169
|
* @param {String} file import file name
|
|
118
170
|
*/
|
|
119
171
|
|
|
120
|
-
export async function importThemeByName(name, file) {
|
|
121
|
-
fs.readFile(file, 'utf8', (err, data) => {
|
|
122
|
-
if (err) throw err;
|
|
123
|
-
const themeData = JSON.parse(data);
|
|
124
|
-
|
|
125
|
-
if (validateImport(themeData.meta)) {
|
|
126
|
-
createProgressIndicator(1, 'Importing theme...');
|
|
127
|
-
let found = false;
|
|
128
|
-
|
|
129
|
-
for (const id in themeData.theme) {
|
|
130
|
-
if ({}.hasOwnProperty.call(themeData.theme, id)) {
|
|
131
|
-
if (themeData.theme[id].name === name) {
|
|
132
|
-
found = true;
|
|
133
|
-
updateProgressIndicator(`Importing ${themeData.theme[id].name}`);
|
|
134
|
-
putThemeByName(name, themeData.theme[id]).then(result => {
|
|
135
|
-
if (result == null) {
|
|
136
|
-
stopProgressIndicator(`Error importing theme ${themeData.theme[id].name}`);
|
|
137
|
-
printMessage(`Error importing theme ${themeData.theme[id].name}`, 'error');
|
|
138
|
-
} else {
|
|
139
|
-
stopProgressIndicator(`Successfully imported theme ${name}.`);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
172
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
173
|
+
function _exportThemesToFiles() {
|
|
174
|
+
_exportThemesToFiles = _asyncToGenerator(function* () {
|
|
175
|
+
var allThemesData = yield (0, _ThemeApi.getThemes)();
|
|
176
|
+
(0, _Console.createProgressIndicator)(allThemesData.length, 'Exporting themes');
|
|
177
|
+
|
|
178
|
+
for (var themeData of allThemesData) {
|
|
179
|
+
(0, _Console.updateProgressIndicator)("Writing theme ".concat(themeData.name));
|
|
180
|
+
var fileName = (0, _ExportImportUtils.getTypedFilename)(themeData.name, 'theme');
|
|
181
|
+
(0, _ExportImportUtils.saveToFile)('theme', themeData, '_id', fileName);
|
|
152
182
|
}
|
|
183
|
+
|
|
184
|
+
(0, _Console.stopProgressIndicator)("".concat(allThemesData.length, " themes exported."));
|
|
153
185
|
});
|
|
186
|
+
return _exportThemesToFiles.apply(this, arguments);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function importThemeByName(_x6, _x7) {
|
|
190
|
+
return _importThemeByName.apply(this, arguments);
|
|
154
191
|
}
|
|
155
192
|
/**
|
|
156
193
|
* Import theme by uuid from file
|
|
@@ -158,183 +195,298 @@ export async function importThemeByName(name, file) {
|
|
|
158
195
|
* @param {String} file import file name
|
|
159
196
|
*/
|
|
160
197
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
198
|
+
|
|
199
|
+
function _importThemeByName() {
|
|
200
|
+
_importThemeByName = _asyncToGenerator(function* (name, file) {
|
|
201
|
+
_fs.default.readFile(file, 'utf8', (err, data) => {
|
|
202
|
+
if (err) throw err;
|
|
203
|
+
var themeData = JSON.parse(data);
|
|
204
|
+
|
|
205
|
+
if ((0, _ExportImportUtils.validateImport)(themeData.meta)) {
|
|
206
|
+
(0, _Console.createProgressIndicator)(1, 'Importing theme...');
|
|
207
|
+
var found = false;
|
|
208
|
+
|
|
209
|
+
var _loop = function _loop(id) {
|
|
210
|
+
if ({}.hasOwnProperty.call(themeData.theme, id)) {
|
|
211
|
+
if (themeData.theme[id].name === name) {
|
|
212
|
+
found = true;
|
|
213
|
+
(0, _Console.updateProgressIndicator)("Importing ".concat(themeData.theme[id].name));
|
|
214
|
+
(0, _ThemeApi.putThemeByName)(name, themeData.theme[id]).then(result => {
|
|
215
|
+
if (result == null) {
|
|
216
|
+
(0, _Console.stopProgressIndicator)("Error importing theme ".concat(themeData.theme[id].name));
|
|
217
|
+
(0, _Console.printMessage)("Error importing theme ".concat(themeData.theme[id].name), 'error');
|
|
218
|
+
} else {
|
|
219
|
+
(0, _Console.stopProgressIndicator)("Successfully imported theme ".concat(name, "."));
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return "break";
|
|
223
|
+
}
|
|
184
224
|
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
for (var id in themeData.theme) {
|
|
228
|
+
var _ret = _loop(id);
|
|
229
|
+
|
|
230
|
+
if (_ret === "break") break;
|
|
185
231
|
}
|
|
186
|
-
}
|
|
187
232
|
|
|
188
|
-
|
|
189
|
-
|
|
233
|
+
if (!found) {
|
|
234
|
+
(0, _Console.stopProgressIndicator)("Theme ".concat(name, " not found!"));
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
(0, _Console.printMessage)('Import validation failed...', 'error');
|
|
190
238
|
}
|
|
191
|
-
}
|
|
192
|
-
printMessage('Import validation failed...', 'error');
|
|
193
|
-
}
|
|
239
|
+
});
|
|
194
240
|
});
|
|
241
|
+
return _importThemeByName.apply(this, arguments);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function importThemeById(_x8, _x9) {
|
|
245
|
+
return _importThemeById.apply(this, arguments);
|
|
195
246
|
}
|
|
196
247
|
/**
|
|
197
248
|
* Import all themes from single file
|
|
198
249
|
* @param {String} file import file name
|
|
199
250
|
*/
|
|
200
251
|
|
|
201
|
-
export async function importThemesFromFile(file) {
|
|
202
|
-
fs.readFile(file, 'utf8', (err, data) => {
|
|
203
|
-
if (err) throw err;
|
|
204
|
-
const fileData = JSON.parse(data);
|
|
205
252
|
|
|
206
|
-
|
|
207
|
-
|
|
253
|
+
function _importThemeById() {
|
|
254
|
+
_importThemeById = _asyncToGenerator(function* (id, file) {
|
|
255
|
+
_fs.default.readFile(file, 'utf8', (err, data) => {
|
|
256
|
+
if (err) throw err;
|
|
257
|
+
var themeData = JSON.parse(data);
|
|
258
|
+
|
|
259
|
+
if ((0, _ExportImportUtils.validateImport)(themeData.meta)) {
|
|
260
|
+
(0, _Console.createProgressIndicator)(1, 'Importing theme...');
|
|
261
|
+
var found = false;
|
|
262
|
+
|
|
263
|
+
var _loop2 = function _loop2(themeId) {
|
|
264
|
+
if ({}.hasOwnProperty.call(themeData.theme, themeId)) {
|
|
265
|
+
if (themeId === id) {
|
|
266
|
+
found = true;
|
|
267
|
+
(0, _Console.updateProgressIndicator)("Importing ".concat(themeData.theme[themeId]._id));
|
|
268
|
+
(0, _ThemeApi.putTheme)(themeId, themeData.theme[themeId]).then(result => {
|
|
269
|
+
if (result == null) {
|
|
270
|
+
(0, _Console.stopProgressIndicator)("Error importing theme ".concat(themeData.theme[themeId]._id));
|
|
271
|
+
(0, _Console.printMessage)("Error importing theme ".concat(themeData.theme[themeId]._id), 'error');
|
|
272
|
+
} else {
|
|
273
|
+
(0, _Console.stopProgressIndicator)("Successfully imported theme ".concat(id, "."));
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
return "break";
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
for (var themeId in themeData.theme) {
|
|
282
|
+
var _ret2 = _loop2(themeId);
|
|
208
283
|
|
|
209
|
-
|
|
210
|
-
if ({}.hasOwnProperty.call(fileData.theme, id)) {
|
|
211
|
-
updateProgressIndicator(`Importing ${fileData.theme[id].name}`);
|
|
284
|
+
if (_ret2 === "break") break;
|
|
212
285
|
}
|
|
213
|
-
}
|
|
214
286
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
stopProgressIndicator(`Error importing ${Object.keys(fileData.theme).length} themes!`);
|
|
218
|
-
printMessage(`Error importing ${Object.keys(fileData.theme).length} themes from ${file}`, 'error');
|
|
219
|
-
} else {
|
|
220
|
-
stopProgressIndicator(`Successfully imported ${Object.keys(fileData.theme).length} themes.`);
|
|
287
|
+
if (!found) {
|
|
288
|
+
(0, _Console.stopProgressIndicator)("Theme ".concat(id, " not found!"));
|
|
221
289
|
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
290
|
+
} else {
|
|
291
|
+
(0, _Console.printMessage)('Import validation failed...', 'error');
|
|
292
|
+
}
|
|
293
|
+
});
|
|
226
294
|
});
|
|
295
|
+
return _importThemeById.apply(this, arguments);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function importThemesFromFile(_x10) {
|
|
299
|
+
return _importThemesFromFile.apply(this, arguments);
|
|
227
300
|
}
|
|
228
301
|
/**
|
|
229
302
|
* Import themes from separate files
|
|
230
303
|
*/
|
|
231
304
|
|
|
232
|
-
export async function importThemesFromFiles() {
|
|
233
|
-
const names = fs.readdirSync('.');
|
|
234
|
-
const jsonFiles = names.filter(name => name.toLowerCase().endsWith('.theme.json'));
|
|
235
|
-
createProgressIndicator(jsonFiles.length, 'Importing themes...');
|
|
236
|
-
let fileData = null;
|
|
237
|
-
let count = 0;
|
|
238
|
-
let total = 0;
|
|
239
|
-
let files = 0;
|
|
240
305
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
306
|
+
function _importThemesFromFile() {
|
|
307
|
+
_importThemesFromFile = _asyncToGenerator(function* (file) {
|
|
308
|
+
_fs.default.readFile(file, 'utf8', (err, data) => {
|
|
309
|
+
if (err) throw err;
|
|
310
|
+
var fileData = JSON.parse(data);
|
|
244
311
|
|
|
245
|
-
|
|
246
|
-
|
|
312
|
+
if ((0, _ExportImportUtils.validateImport)(fileData.meta)) {
|
|
313
|
+
(0, _Console.createProgressIndicator)(Object.keys(fileData.theme).length, 'Importing themes...');
|
|
247
314
|
|
|
248
|
-
|
|
315
|
+
for (var id in fileData.theme) {
|
|
316
|
+
if ({}.hasOwnProperty.call(fileData.theme, id)) {
|
|
317
|
+
(0, _Console.updateProgressIndicator)("Importing ".concat(fileData.theme[id].name));
|
|
318
|
+
}
|
|
319
|
+
}
|
|
249
320
|
|
|
250
|
-
|
|
251
|
-
|
|
321
|
+
(0, _ThemeApi.putThemes)(fileData.theme).then(result => {
|
|
322
|
+
if (result == null) {
|
|
323
|
+
(0, _Console.stopProgressIndicator)("Error importing ".concat(Object.keys(fileData.theme).length, " themes!"));
|
|
324
|
+
(0, _Console.printMessage)("Error importing ".concat(Object.keys(fileData.theme).length, " themes from ").concat(file), 'error');
|
|
325
|
+
} else {
|
|
326
|
+
(0, _Console.stopProgressIndicator)("Successfully imported ".concat(Object.keys(fileData.theme).length, " themes."));
|
|
327
|
+
}
|
|
328
|
+
});
|
|
252
329
|
} else {
|
|
253
|
-
|
|
254
|
-
total += count;
|
|
255
|
-
updateProgressIndicator(`Imported ${count} theme(s) from ${file}`);
|
|
330
|
+
(0, _Console.printMessage)('Import validation failed...', 'error');
|
|
256
331
|
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
return _importThemesFromFile.apply(this, arguments);
|
|
335
|
+
}
|
|
261
336
|
|
|
262
|
-
|
|
337
|
+
function importThemesFromFiles() {
|
|
338
|
+
return _importThemesFromFiles.apply(this, arguments);
|
|
263
339
|
}
|
|
264
340
|
/**
|
|
265
341
|
* Import first theme from file
|
|
266
342
|
* @param {String} file import file name
|
|
267
343
|
*/
|
|
268
344
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
345
|
+
|
|
346
|
+
function _importThemesFromFiles() {
|
|
347
|
+
_importThemesFromFiles = _asyncToGenerator(function* () {
|
|
348
|
+
var names = _fs.default.readdirSync('.');
|
|
349
|
+
|
|
350
|
+
var jsonFiles = names.filter(name => name.toLowerCase().endsWith('.theme.json'));
|
|
351
|
+
(0, _Console.createProgressIndicator)(jsonFiles.length, 'Importing themes...');
|
|
352
|
+
var fileData = null;
|
|
353
|
+
var count = 0;
|
|
354
|
+
var total = 0;
|
|
355
|
+
var files = 0;
|
|
356
|
+
|
|
357
|
+
for (var file of jsonFiles) {
|
|
358
|
+
var data = _fs.default.readFileSync(file, 'utf8');
|
|
359
|
+
|
|
360
|
+
fileData = JSON.parse(data);
|
|
361
|
+
|
|
362
|
+
if ((0, _ExportImportUtils.validateImport)(fileData.meta)) {
|
|
363
|
+
count = Object.keys(fileData.theme).length; // eslint-disable-next-line no-await-in-loop
|
|
364
|
+
|
|
365
|
+
var result = yield (0, _ThemeApi.putThemes)(fileData.theme);
|
|
366
|
+
|
|
367
|
+
if (result == null) {
|
|
368
|
+
(0, _Console.printMessage)("Error importing ".concat(count, " themes from ").concat(file), 'error');
|
|
369
|
+
} else {
|
|
370
|
+
files += 1;
|
|
371
|
+
total += count;
|
|
372
|
+
(0, _Console.updateProgressIndicator)("Imported ".concat(count, " theme(s) from ").concat(file));
|
|
289
373
|
}
|
|
374
|
+
} else {
|
|
375
|
+
(0, _Console.printMessage)("Validation of ".concat(file, " failed!"), 'error');
|
|
290
376
|
}
|
|
291
|
-
} else {
|
|
292
|
-
printMessage('Import validation failed...', 'error');
|
|
293
377
|
}
|
|
378
|
+
|
|
379
|
+
(0, _Console.stopProgressIndicator)("Finished importing ".concat(total, " theme(s) from ").concat(files, " file(s)."));
|
|
294
380
|
});
|
|
381
|
+
return _importThemesFromFiles.apply(this, arguments);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
function importFirstThemeFromFile(_x11) {
|
|
385
|
+
return _importFirstThemeFromFile.apply(this, arguments);
|
|
295
386
|
}
|
|
296
387
|
/**
|
|
297
388
|
* Delete theme by id
|
|
298
389
|
* @param {String} id theme id
|
|
299
390
|
*/
|
|
300
391
|
|
|
301
|
-
export async function deleteThemeCmd(id) {
|
|
302
|
-
createProgressIndicator(undefined, `Deleting ${id}...`, 'indeterminate');
|
|
303
392
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
393
|
+
function _importFirstThemeFromFile() {
|
|
394
|
+
_importFirstThemeFromFile = _asyncToGenerator(function* (file) {
|
|
395
|
+
_fs.default.readFile(file, 'utf8', (err, data) => {
|
|
396
|
+
if (err) throw err;
|
|
397
|
+
var themeData = JSON.parse(data);
|
|
398
|
+
|
|
399
|
+
if ((0, _ExportImportUtils.validateImport)(themeData.meta)) {
|
|
400
|
+
(0, _Console.createProgressIndicator)(1, 'Importing theme...');
|
|
401
|
+
|
|
402
|
+
var _loop3 = function _loop3(id) {
|
|
403
|
+
if ({}.hasOwnProperty.call(themeData.theme, id)) {
|
|
404
|
+
(0, _Console.updateProgressIndicator)("Importing ".concat(themeData.theme[id].name));
|
|
405
|
+
(0, _ThemeApi.putTheme)(id, themeData.theme[id]).then(result => {
|
|
406
|
+
if (result == null) {
|
|
407
|
+
(0, _Console.stopProgressIndicator)("Error importing theme ".concat(themeData.theme[id].name));
|
|
408
|
+
(0, _Console.printMessage)("Error importing theme ".concat(themeData.theme[id].name), 'error');
|
|
409
|
+
} else {
|
|
410
|
+
(0, _Console.stopProgressIndicator)("Successfully imported theme ".concat(themeData.theme[id].name));
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
return "break";
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
for (var id in themeData.theme) {
|
|
418
|
+
var _ret3 = _loop3(id);
|
|
419
|
+
|
|
420
|
+
if (_ret3 === "break") break;
|
|
421
|
+
}
|
|
422
|
+
} else {
|
|
423
|
+
(0, _Console.printMessage)('Import validation failed...', 'error');
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
return _importFirstThemeFromFile.apply(this, arguments);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function deleteThemeCmd(_x12) {
|
|
431
|
+
return _deleteThemeCmd.apply(this, arguments);
|
|
310
432
|
}
|
|
311
433
|
/**
|
|
312
434
|
* Delete theme by name
|
|
313
435
|
* @param {String} name theme name
|
|
314
436
|
*/
|
|
315
437
|
|
|
316
|
-
export async function deleteThemeByNameCmd(name) {
|
|
317
|
-
createProgressIndicator(undefined, `Deleting ${name}...`, 'indeterminate');
|
|
318
438
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
439
|
+
function _deleteThemeCmd() {
|
|
440
|
+
_deleteThemeCmd = _asyncToGenerator(function* (id) {
|
|
441
|
+
(0, _Console.createProgressIndicator)(undefined, "Deleting ".concat(id, "..."), 'indeterminate');
|
|
442
|
+
|
|
443
|
+
try {
|
|
444
|
+
yield (0, _ThemeApi.deleteTheme)(id);
|
|
445
|
+
(0, _Console.stopProgressIndicator)("Deleted ".concat(id, "."), 'success');
|
|
446
|
+
} catch (error) {
|
|
447
|
+
(0, _Console.stopProgressIndicator)("Error: ".concat(error.message), 'fail');
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
return _deleteThemeCmd.apply(this, arguments);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function deleteThemeByNameCmd(_x13) {
|
|
454
|
+
return _deleteThemeByNameCmd.apply(this, arguments);
|
|
325
455
|
}
|
|
326
456
|
/**
|
|
327
457
|
* Delete all themes
|
|
328
458
|
*/
|
|
329
459
|
|
|
330
|
-
export async function deleteThemesCmd() {
|
|
331
|
-
createProgressIndicator(undefined, `Deleting all realm themes...`, 'indeterminate');
|
|
332
460
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
461
|
+
function _deleteThemeByNameCmd() {
|
|
462
|
+
_deleteThemeByNameCmd = _asyncToGenerator(function* (name) {
|
|
463
|
+
(0, _Console.createProgressIndicator)(undefined, "Deleting ".concat(name, "..."), 'indeterminate');
|
|
464
|
+
|
|
465
|
+
try {
|
|
466
|
+
yield (0, _ThemeApi.deleteThemeByName)(name);
|
|
467
|
+
(0, _Console.stopProgressIndicator)("Deleted ".concat(name, "."), 'success');
|
|
468
|
+
} catch (error) {
|
|
469
|
+
(0, _Console.stopProgressIndicator)("Error: ".concat(error.message), 'fail');
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
return _deleteThemeByNameCmd.apply(this, arguments);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
function deleteThemesCmd() {
|
|
476
|
+
return _deleteThemesCmd.apply(this, arguments);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function _deleteThemesCmd() {
|
|
480
|
+
_deleteThemesCmd = _asyncToGenerator(function* () {
|
|
481
|
+
(0, _Console.createProgressIndicator)(undefined, "Deleting all realm themes...", 'indeterminate');
|
|
482
|
+
|
|
483
|
+
try {
|
|
484
|
+
yield (0, _ThemeApi.deleteThemes)();
|
|
485
|
+
(0, _Console.stopProgressIndicator)("Deleted all realm themes.", 'success');
|
|
486
|
+
} catch (error) {
|
|
487
|
+
(0, _Console.stopProgressIndicator)("Error: ".concat(error.message), 'fail');
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
return _deleteThemesCmd.apply(this, arguments);
|
|
339
491
|
}
|
|
340
492
|
//# sourceMappingURL=ThemeOps.js.map
|