@signageos/cli 2.3.1 → 2.4.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.
Files changed (146) hide show
  1. package/README.md +54 -19
  2. package/dist/Applet/Build/appletBuildCommand.js +28 -72
  3. package/dist/Applet/Generate/Templates/CHANGELOG.md.template +7 -0
  4. package/dist/Applet/Generate/Templates/README.md.template +3 -0
  5. package/dist/Applet/Generate/Templates/rspack.config.mjs.template +12 -12
  6. package/dist/Applet/Generate/appletGenerateCommand.d.ts +23 -62
  7. package/dist/Applet/Generate/appletGenerateCommand.js +432 -365
  8. package/dist/Applet/Start/appletStartCommand.js +70 -132
  9. package/dist/Applet/Test/Upload/appletTestRunCommand.js +90 -178
  10. package/dist/Applet/Test/Upload/appletTestRunFacade.js +5 -29
  11. package/dist/Applet/Test/Upload/appletTestUploadCommand.js +99 -224
  12. package/dist/Applet/Test/Upload/appletTestUploadFacade.js +51 -105
  13. package/dist/Applet/Test/appletTestCommand.js +6 -36
  14. package/dist/Applet/Upload/appletUploadCommand.js +199 -305
  15. package/dist/Applet/Upload/appletUploadCommandHelper.js +129 -144
  16. package/dist/Applet/Upload/appletUploadFacade.d.ts +2 -2
  17. package/dist/Applet/Upload/appletUploadFacade.js +184 -265
  18. package/dist/Applet/Upload/appletUploadFacadeHelper.js +51 -55
  19. package/dist/Applet/appletCommand.d.ts +25 -157
  20. package/dist/Applet/appletCommand.js +9 -39
  21. package/dist/Applet/appletErrors.js +5 -24
  22. package/dist/Applet/appletFacade.js +122 -147
  23. package/dist/Applet/appletServerHelper.js +18 -55
  24. package/dist/Auth/loginCommand.d.ts +2 -2
  25. package/dist/Auth/loginCommand.js +105 -136
  26. package/dist/Cache/tmpCache.js +47 -16
  27. package/dist/Cli/helper.js +3 -5
  28. package/dist/Cli/packageVersion.js +99 -131
  29. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.d.ts +10 -0
  30. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.js +39 -0
  31. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.ts +30 -0
  32. package/dist/Command/Autocomplete/Install/sos-completion.sh +63 -0
  33. package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.d.ts +8 -0
  34. package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.js +120 -0
  35. package/dist/Command/Autocomplete/autocompleteCommand.d.ts +22 -0
  36. package/dist/Command/Autocomplete/autocompleteCommand.js +32 -0
  37. package/dist/Command/autoComplete.d.ts +4 -0
  38. package/dist/Command/autoComplete.js +184 -0
  39. package/dist/Command/commandDefinition.d.ts +9 -9
  40. package/dist/Command/commandDefinition.js +1 -3
  41. package/dist/Command/commandProcessor.js +41 -131
  42. package/dist/Command/globalArgs.js +9 -8
  43. package/dist/CommandLine/IProgressBar.js +0 -1
  44. package/dist/CommandLine/progressBarFactory.d.ts +1 -1
  45. package/dist/CommandLine/progressBarFactory.js +42 -13
  46. package/dist/CustomScript/Generate/customScriptGenerateCommand.js +17 -56
  47. package/dist/CustomScript/Generate/customScriptGenerateFacade.js +94 -109
  48. package/dist/CustomScript/Upload/customScriptUploadCommand.js +44 -120
  49. package/dist/CustomScript/customScriptCommand.d.ts +1 -9
  50. package/dist/CustomScript/customScriptCommand.js +6 -36
  51. package/dist/CustomScript/customScriptFacade.d.ts +2 -2
  52. package/dist/CustomScript/customScriptFacade.js +187 -297
  53. package/dist/Device/Connect/connectCommand.js +73 -137
  54. package/dist/Device/Content/setContentCommand.js +33 -78
  55. package/dist/Device/PowerAction/powerActionCommand.js +22 -65
  56. package/dist/Device/deviceCommand.js +7 -37
  57. package/dist/Device/deviceFacade.js +71 -127
  58. package/dist/Emulator/IEmulator.js +0 -1
  59. package/dist/Emulator/createDomain.d.ts +0 -1
  60. package/dist/Emulator/createDomain.js +44 -14
  61. package/dist/Emulator/emulatorFacade.js +75 -133
  62. package/dist/Emulator/emulatorFactory.js +123 -126
  63. package/dist/Firmware/Upload/firmwareUploadCommand.js +133 -221
  64. package/dist/Firmware/Upload/firmwareUploadFacade.js +75 -112
  65. package/dist/Firmware/Upload/firmwareUploadHelper.js +38 -6
  66. package/dist/Firmware/firmwareCommand.js +5 -35
  67. package/dist/Lib/archive.js +56 -62
  68. package/dist/Lib/childProcess.js +37 -5
  69. package/dist/Lib/fileSystem.js +76 -87
  70. package/dist/Lib/git.d.ts +1 -1
  71. package/dist/Lib/git.js +58 -87
  72. package/dist/Organization/Get/organizationGetCommand.js +14 -50
  73. package/dist/Organization/List/organizationListCommand.js +12 -46
  74. package/dist/Organization/SetDefault/organizationSetDefaultCommand.js +18 -56
  75. package/dist/Organization/organizationCommand.js +7 -37
  76. package/dist/Organization/organizationFacade.js +102 -177
  77. package/dist/RunControl/runControlHelper.js +14 -64
  78. package/dist/Timer/wait.js +2 -3
  79. package/dist/Timing/List/timingListCommand.js +20 -62
  80. package/dist/Timing/timingCommand.js +5 -35
  81. package/dist/generalCommand.js +1 -2
  82. package/dist/helper.d.ts +4 -4
  83. package/dist/helper.js +61 -122
  84. package/dist/index.js +19 -46
  85. package/dist/parameters.js +17 -40
  86. package/package.json +52 -57
  87. package/dist/Applet/Build/appletBuildCommand.js.map +0 -1
  88. package/dist/Applet/Generate/appletGenerateCommand.js.map +0 -1
  89. package/dist/Applet/Start/appletStartCommand.js.map +0 -1
  90. package/dist/Applet/Test/Upload/appletTestRunCommand.js.map +0 -1
  91. package/dist/Applet/Test/Upload/appletTestRunFacade.js.map +0 -1
  92. package/dist/Applet/Test/Upload/appletTestUploadCommand.js.map +0 -1
  93. package/dist/Applet/Test/Upload/appletTestUploadFacade.js.map +0 -1
  94. package/dist/Applet/Test/appletTestCommand.js.map +0 -1
  95. package/dist/Applet/Upload/appletUploadCommand.js.map +0 -1
  96. package/dist/Applet/Upload/appletUploadCommandHelper.js.map +0 -1
  97. package/dist/Applet/Upload/appletUploadFacade.js.map +0 -1
  98. package/dist/Applet/Upload/appletUploadFacadeHelper.js.map +0 -1
  99. package/dist/Applet/appletCommand.js.map +0 -1
  100. package/dist/Applet/appletErrors.js.map +0 -1
  101. package/dist/Applet/appletFacade.js.map +0 -1
  102. package/dist/Applet/appletServerHelper.js.map +0 -1
  103. package/dist/Auth/loginCommand.js.map +0 -1
  104. package/dist/Cache/tmpCache.js.map +0 -1
  105. package/dist/Cli/helper.js.map +0 -1
  106. package/dist/Cli/packageVersion.js.map +0 -1
  107. package/dist/Command/commandDefinition.js.map +0 -1
  108. package/dist/Command/commandProcessor.js.map +0 -1
  109. package/dist/Command/globalArgs.js.map +0 -1
  110. package/dist/CommandLine/IProgressBar.js.map +0 -1
  111. package/dist/CommandLine/progressBarFactory.js.map +0 -1
  112. package/dist/CustomScript/Generate/customScriptGenerateCommand.js.map +0 -1
  113. package/dist/CustomScript/Generate/customScriptGenerateFacade.js.map +0 -1
  114. package/dist/CustomScript/Upload/customScriptUploadCommand.js.map +0 -1
  115. package/dist/CustomScript/customScriptCommand.js.map +0 -1
  116. package/dist/CustomScript/customScriptFacade.js.map +0 -1
  117. package/dist/Device/Connect/connectCommand.js.map +0 -1
  118. package/dist/Device/Content/setContentCommand.js.map +0 -1
  119. package/dist/Device/PowerAction/powerActionCommand.js.map +0 -1
  120. package/dist/Device/deviceCommand.js.map +0 -1
  121. package/dist/Device/deviceFacade.js.map +0 -1
  122. package/dist/Emulator/IEmulator.js.map +0 -1
  123. package/dist/Emulator/createDomain.js.map +0 -1
  124. package/dist/Emulator/emulatorFacade.js.map +0 -1
  125. package/dist/Emulator/emulatorFactory.js.map +0 -1
  126. package/dist/Firmware/Upload/firmwareUploadCommand.js.map +0 -1
  127. package/dist/Firmware/Upload/firmwareUploadFacade.js.map +0 -1
  128. package/dist/Firmware/Upload/firmwareUploadHelper.js.map +0 -1
  129. package/dist/Firmware/firmwareCommand.js.map +0 -1
  130. package/dist/Lib/archive.js.map +0 -1
  131. package/dist/Lib/childProcess.js.map +0 -1
  132. package/dist/Lib/fileSystem.js.map +0 -1
  133. package/dist/Lib/git.js.map +0 -1
  134. package/dist/Organization/Get/organizationGetCommand.js.map +0 -1
  135. package/dist/Organization/List/organizationListCommand.js.map +0 -1
  136. package/dist/Organization/SetDefault/organizationSetDefaultCommand.js.map +0 -1
  137. package/dist/Organization/organizationCommand.js.map +0 -1
  138. package/dist/Organization/organizationFacade.js.map +0 -1
  139. package/dist/RunControl/runControlHelper.js.map +0 -1
  140. package/dist/Timer/wait.js.map +0 -1
  141. package/dist/Timing/List/timingListCommand.js.map +0 -1
  142. package/dist/Timing/timingCommand.js.map +0 -1
  143. package/dist/generalCommand.js.map +0 -1
  144. package/dist/helper.js.map +0 -1
  145. package/dist/index.js.map +0 -1
  146. package/dist/parameters.js.map +0 -1
package/dist/Lib/git.js CHANGED
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,102 +41,40 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
42
  });
10
43
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
44
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.cloneGitRepository = exports.initGitRepository = exports.throwErrorIfGitNotInstalled = exports.machineHasGit = void 0;
40
- var path = require("path");
41
- var childProcess_1 = require("./childProcess");
45
+ exports.machineHasGit = machineHasGit;
46
+ exports.throwErrorIfGitNotInstalled = throwErrorIfGitNotInstalled;
47
+ exports.initGitRepository = initGitRepository;
48
+ exports.cloneGitRepository = cloneGitRepository;
49
+ const path = __importStar(require("path"));
50
+ const childProcess_1 = require("./childProcess");
42
51
  function machineHasGit() {
43
- return __awaiter(this, void 0, void 0, function () {
44
- var result, error_1;
45
- return __generator(this, function (_a) {
46
- switch (_a.label) {
47
- case 0:
48
- _a.trys.push([0, 2, , 3]);
49
- return [4 /*yield*/, (0, childProcess_1.executeChildProcess)('git --version', true)];
50
- case 1:
51
- result = _a.sent();
52
- return [2 /*return*/, result.includes('git version')];
53
- case 2:
54
- error_1 = _a.sent();
55
- return [2 /*return*/, false];
56
- case 3: return [2 /*return*/];
57
- }
58
- });
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ try {
54
+ const result = yield (0, childProcess_1.executeChildProcess)('git --version', true);
55
+ return result.includes('git version');
56
+ }
57
+ catch (_a) {
58
+ return false;
59
+ }
59
60
  });
60
61
  }
61
- exports.machineHasGit = machineHasGit;
62
62
  function throwErrorIfGitNotInstalled() {
63
- return __awaiter(this, void 0, void 0, function () {
64
- return __generator(this, function (_a) {
65
- switch (_a.label) {
66
- case 0: return [4 /*yield*/, machineHasGit()];
67
- case 1:
68
- if (!(_a.sent())) {
69
- throw new Error('Git is not installed on this machine. Please install Git to use this feature.');
70
- }
71
- return [2 /*return*/];
72
- }
73
- });
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ if (!(yield machineHasGit())) {
65
+ throw new Error('Git is not installed on this machine. Please install Git to use this feature.');
66
+ }
74
67
  });
75
68
  }
76
- exports.throwErrorIfGitNotInstalled = throwErrorIfGitNotInstalled;
77
- function initGitRepository(relativePath) {
78
- return __awaiter(this, void 0, void 0, function () {
79
- var absolutePath;
80
- return __generator(this, function (_a) {
81
- switch (_a.label) {
82
- case 0:
83
- absolutePath = path.resolve(relativePath);
84
- return [4 /*yield*/, (0, childProcess_1.executeChildProcess)("git init \"".concat(absolutePath, "\""), false)];
85
- case 1:
86
- _a.sent();
87
- return [2 /*return*/];
88
- }
89
- });
69
+ function initGitRepository(relativePath_1) {
70
+ return __awaiter(this, arguments, void 0, function* (relativePath, verbose = false) {
71
+ const absolutePath = path.resolve(relativePath);
72
+ yield (0, childProcess_1.executeChildProcess)(`git init "${absolutePath}"`, verbose);
90
73
  });
91
74
  }
92
- exports.initGitRepository = initGitRepository;
93
75
  function cloneGitRepository(gitUrl, targetDir) {
94
- return __awaiter(this, void 0, void 0, function () {
95
- var absolutePath;
96
- return __generator(this, function (_a) {
97
- switch (_a.label) {
98
- case 0:
99
- absolutePath = path.resolve(targetDir);
100
- return [4 /*yield*/, (0, childProcess_1.executeChildProcess)("git clone \"".concat(gitUrl, "\" \"").concat(absolutePath, "\""), false)];
101
- case 1:
102
- _a.sent();
103
- return [2 /*return*/];
104
- }
105
- });
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const absolutePath = path.resolve(targetDir);
78
+ yield (0, childProcess_1.executeChildProcess)(`git clone "${gitUrl}" "${absolutePath}"`, false);
106
79
  });
107
80
  }
108
- exports.cloneGitRepository = cloneGitRepository;
109
- //# sourceMappingURL=git.js.map
@@ -8,64 +8,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
13
  };
38
14
  Object.defineProperty(exports, "__esModule", { value: true });
39
15
  exports.organizationGet = void 0;
40
- var chalk_1 = require("chalk");
41
- var Debug = require("debug");
42
- var commandDefinition_1 = require("../../Command/commandDefinition");
43
- var organizationFacade_1 = require("../organizationFacade");
44
- var debug = Debug('@signageos/cli:Organization:get');
45
- var OPTION_LIST = [organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION, organizationFacade_1.ORGANIZATION_UID_OPTION];
16
+ const chalk_1 = __importDefault(require("chalk"));
17
+ const debug_1 = __importDefault(require("debug"));
18
+ const commandDefinition_1 = require("../../Command/commandDefinition");
19
+ const organizationFacade_1 = require("../organizationFacade");
20
+ const Debug = (0, debug_1.default)('@signageos/cli:Organization:get');
21
+ const OPTION_LIST = [organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION, organizationFacade_1.ORGANIZATION_UID_OPTION];
46
22
  exports.organizationGet = (0, commandDefinition_1.createCommandDefinition)({
47
23
  name: 'get',
48
24
  description: 'Get one organization by UID',
49
25
  optionList: OPTION_LIST,
50
26
  commands: [],
51
- run: function (options) {
52
- return __awaiter(this, void 0, void 0, function () {
53
- var organizationUid, organization;
54
- return __generator(this, function (_a) {
55
- switch (_a.label) {
56
- case 0:
57
- debug('Organization get');
58
- return [4 /*yield*/, (0, organizationFacade_1.getOrganizationUidOrDefaultOrSelect)(options)];
59
- case 1:
60
- organizationUid = _a.sent();
61
- return [4 /*yield*/, (0, organizationFacade_1.getOrganization)(organizationUid)];
62
- case 2:
63
- organization = _a.sent();
64
- console.log(chalk_1.default.yellow(JSON.stringify(organization, undefined, 2)));
65
- return [2 /*return*/];
66
- }
67
- });
27
+ run(options) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ Debug('Organization get');
30
+ const organizationUid = yield (0, organizationFacade_1.getOrganizationUidOrDefaultOrSelect)(options);
31
+ const organization = yield (0, organizationFacade_1.getOrganization)(organizationUid);
32
+ console.log(chalk_1.default.yellow(JSON.stringify(organization, undefined, 2)));
68
33
  });
69
34
  },
70
35
  });
71
- //# sourceMappingURL=organizationGetCommand.js.map
@@ -8,60 +8,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
13
  };
38
14
  Object.defineProperty(exports, "__esModule", { value: true });
39
15
  exports.organizationList = void 0;
40
- var chalk_1 = require("chalk");
41
- var Debug = require("debug");
42
- var commandDefinition_1 = require("../../Command/commandDefinition");
43
- var organizationFacade_1 = require("../organizationFacade");
44
- var debug = Debug('@signageos/cli:Organization:list');
16
+ const chalk_1 = __importDefault(require("chalk"));
17
+ const debug_1 = __importDefault(require("debug"));
18
+ const commandDefinition_1 = require("../../Command/commandDefinition");
19
+ const organizationFacade_1 = require("../organizationFacade");
20
+ const Debug = (0, debug_1.default)('@signageos/cli:Organization:list');
45
21
  exports.organizationList = (0, commandDefinition_1.createCommandDefinition)({
46
22
  name: 'list',
47
23
  description: 'List organizations for logged account',
48
24
  optionList: [],
49
25
  commands: [],
50
- run: function () {
51
- return __awaiter(this, void 0, void 0, function () {
52
- var organizations;
53
- return __generator(this, function (_a) {
54
- switch (_a.label) {
55
- case 0:
56
- debug('Organization list');
57
- return [4 /*yield*/, (0, organizationFacade_1.getOrganizations)()];
58
- case 1:
59
- organizations = _a.sent();
60
- console.log(chalk_1.default.yellow(JSON.stringify(organizations, undefined, 2)));
61
- return [2 /*return*/];
62
- }
63
- });
26
+ run() {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ Debug('Organization list');
29
+ const organizations = yield (0, organizationFacade_1.getOrganizations)();
30
+ console.log(chalk_1.default.yellow(JSON.stringify(organizations, undefined, 2)));
64
31
  });
65
32
  },
66
33
  });
67
- //# sourceMappingURL=organizationListCommand.js.map
@@ -8,71 +8,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
13
  };
38
14
  Object.defineProperty(exports, "__esModule", { value: true });
39
15
  exports.organizationSetDefault = void 0;
40
- var chalk_1 = require("chalk");
41
- var Debug = require("debug");
42
- var organizationFacade_1 = require("../organizationFacade");
43
- var runControlHelper_1 = require("../../RunControl/runControlHelper");
44
- var commandDefinition_1 = require("../../Command/commandDefinition");
45
- var log_1 = require("@signageos/sdk/dist/Console/log");
46
- var debug = Debug('@signageos/cli:Organization:get');
47
- var OPTION_LIST = [organizationFacade_1.ORGANIZATION_UID_OPTION];
16
+ const chalk_1 = __importDefault(require("chalk"));
17
+ const debug_1 = __importDefault(require("debug"));
18
+ const organizationFacade_1 = require("../organizationFacade");
19
+ const runControlHelper_1 = require("../../RunControl/runControlHelper");
20
+ const commandDefinition_1 = require("../../Command/commandDefinition");
21
+ const log_1 = require("@signageos/sdk/dist/Console/log");
22
+ const Debug = (0, debug_1.default)('@signageos/cli:Organization:get');
23
+ const OPTION_LIST = [organizationFacade_1.ORGANIZATION_UID_OPTION];
48
24
  exports.organizationSetDefault = (0, commandDefinition_1.createCommandDefinition)({
49
25
  name: 'set-default',
50
26
  description: 'Set default organization to use',
51
27
  optionList: OPTION_LIST,
52
28
  commands: [],
53
- run: function (options) {
54
- return __awaiter(this, void 0, void 0, function () {
55
- var defaultOrganizationUid, organization;
56
- return __generator(this, function (_a) {
57
- switch (_a.label) {
58
- case 0:
59
- debug('Organization set default');
60
- return [4 /*yield*/, (0, organizationFacade_1.selectOrganizationUid)(options)];
61
- case 1:
62
- defaultOrganizationUid = _a.sent();
63
- return [4 /*yield*/, (0, organizationFacade_1.getOrganization)(defaultOrganizationUid)];
64
- case 2:
65
- organization = _a.sent();
66
- return [4 /*yield*/, (0, runControlHelper_1.updateConfig)({
67
- defaultOrganizationUid: defaultOrganizationUid,
68
- })];
69
- case 3:
70
- _a.sent();
71
- (0, log_1.log)('info', "Organization ".concat(chalk_1.default.green("".concat(organization.title, " (").concat(organization.name, ", ").concat(organization.uid, ")")), " has been set as default"));
72
- return [2 /*return*/];
73
- }
29
+ run(options) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ Debug('Organization set default');
32
+ const defaultOrganizationUid = yield (0, organizationFacade_1.selectOrganizationUid)(options);
33
+ const organization = yield (0, organizationFacade_1.getOrganization)(defaultOrganizationUid);
34
+ yield (0, runControlHelper_1.updateConfig)({
35
+ defaultOrganizationUid,
74
36
  });
37
+ (0, log_1.log)('info', `Organization ${chalk_1.default.green(`${organization.title} (${organization.name}, ${organization.uid})`)} has been set as default`);
75
38
  });
76
39
  },
77
40
  });
78
- //# sourceMappingURL=organizationSetDefaultCommand.js.map
@@ -8,50 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
11
  Object.defineProperty(exports, "__esModule", { value: true });
39
12
  exports.organization = void 0;
40
- var organizationListCommand_1 = require("./List/organizationListCommand");
41
- var organizationGetCommand_1 = require("./Get/organizationGetCommand");
42
- var organizationSetDefaultCommand_1 = require("./SetDefault/organizationSetDefaultCommand");
43
- var commandDefinition_1 = require("../Command/commandDefinition");
13
+ const organizationListCommand_1 = require("./List/organizationListCommand");
14
+ const organizationGetCommand_1 = require("./Get/organizationGetCommand");
15
+ const organizationSetDefaultCommand_1 = require("./SetDefault/organizationSetDefaultCommand");
16
+ const commandDefinition_1 = require("../Command/commandDefinition");
44
17
  exports.organization = (0, commandDefinition_1.createCommandDefinition)({
45
18
  name: 'organization',
46
19
  description: 'Organization management',
47
20
  optionList: [],
48
21
  commands: [organizationListCommand_1.organizationList, organizationGetCommand_1.organizationGet, organizationSetDefaultCommand_1.organizationSetDefault],
49
- run: function () {
50
- return __awaiter(this, void 0, void 0, function () {
51
- return __generator(this, function (_a) {
52
- throw new Error('Unknown command');
53
- });
22
+ run() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ throw new Error('Unknown command');
54
25
  });
55
26
  },
56
27
  });
57
- //# sourceMappingURL=organizationCommand.js.map