@signageos/cli 2.3.2 → 2.4.1

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 (59) hide show
  1. package/README.md +53 -19
  2. package/dist/Applet/Generate/Templates/CHANGELOG.md.template +7 -0
  3. package/dist/Applet/Generate/Templates/README.md.template +3 -0
  4. package/dist/Applet/Generate/appletGenerateCommand.js +47 -13
  5. package/dist/Applet/Start/appletStartCommand.js +1 -1
  6. package/dist/Applet/Test/Upload/appletTestRunCommand.js +1 -1
  7. package/dist/Applet/Test/Upload/appletTestRunFacade.js +1 -2
  8. package/dist/Applet/Test/Upload/appletTestUploadCommand.js +5 -5
  9. package/dist/Applet/Test/Upload/appletTestUploadFacade.js +19 -10
  10. package/dist/Applet/Upload/appletUploadCommandHelper.js +36 -16
  11. package/dist/Applet/Upload/appletUploadFacade.js +19 -9
  12. package/dist/Applet/Upload/appletUploadFacadeHelper.js +19 -10
  13. package/dist/Applet/appletCommand.d.ts +3 -95
  14. package/dist/Applet/appletFacade.js +25 -15
  15. package/dist/Applet/appletServerHelper.js +2 -2
  16. package/dist/Auth/loginCommand.d.ts +2 -2
  17. package/dist/Auth/loginCommand.js +19 -9
  18. package/dist/Cache/tmpCache.js +19 -10
  19. package/dist/Cli/helper.js +2 -3
  20. package/dist/Cli/packageVersion.js +24 -15
  21. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.d.ts +10 -0
  22. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.js +39 -0
  23. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.ts +30 -0
  24. package/dist/Command/Autocomplete/Install/sos-completion.sh +63 -0
  25. package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.d.ts +8 -0
  26. package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.js +120 -0
  27. package/dist/Command/Autocomplete/autocompleteCommand.d.ts +22 -0
  28. package/dist/Command/Autocomplete/autocompleteCommand.js +32 -0
  29. package/dist/Command/autoComplete.d.ts +4 -0
  30. package/dist/Command/autoComplete.js +184 -0
  31. package/dist/Command/commandDefinition.d.ts +9 -9
  32. package/dist/Command/commandDefinition.js +1 -2
  33. package/dist/Command/commandProcessor.js +3 -4
  34. package/dist/Command/globalArgs.js +2 -3
  35. package/dist/CommandLine/progressBarFactory.d.ts +1 -1
  36. package/dist/CommandLine/progressBarFactory.js +18 -9
  37. package/dist/CustomScript/Generate/customScriptGenerateFacade.js +19 -10
  38. package/dist/CustomScript/customScriptCommand.d.ts +1 -9
  39. package/dist/CustomScript/customScriptFacade.d.ts +2 -2
  40. package/dist/CustomScript/customScriptFacade.js +27 -18
  41. package/dist/Device/Connect/connectCommand.js +1 -1
  42. package/dist/Device/deviceFacade.js +4 -4
  43. package/dist/Emulator/createDomain.d.ts +0 -1
  44. package/dist/Emulator/createDomain.js +18 -9
  45. package/dist/Emulator/emulatorFacade.js +2 -3
  46. package/dist/Emulator/emulatorFactory.js +19 -10
  47. package/dist/Firmware/Upload/firmwareUploadFacade.js +18 -9
  48. package/dist/Firmware/Upload/firmwareUploadHelper.js +18 -8
  49. package/dist/Lib/archive.js +18 -9
  50. package/dist/Lib/childProcess.js +17 -7
  51. package/dist/Lib/fileSystem.js +21 -12
  52. package/dist/Lib/git.js +23 -14
  53. package/dist/Organization/organizationFacade.js +6 -6
  54. package/dist/RunControl/runControlHelper.js +3 -4
  55. package/dist/Timer/wait.js +1 -1
  56. package/dist/helper.d.ts +5 -5
  57. package/dist/helper.js +13 -13
  58. package/dist/index.js +4 -1
  59. package/package.json +43 -46
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,7 +45,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.uploadCode = exports.ensureCustomScriptVersion = exports.addToConfigFile = exports.getConfig = void 0;
48
+ exports.getConfig = getConfig;
49
+ exports.addToConfigFile = addToConfigFile;
50
+ exports.ensureCustomScriptVersion = ensureCustomScriptVersion;
51
+ exports.uploadCode = uploadCode;
39
52
  const path = __importStar(require("path"));
40
53
  const os = __importStar(require("os"));
41
54
  const fs = __importStar(require("fs-extra"));
@@ -80,7 +93,6 @@ function getConfig(workDir) {
80
93
  return ConfigSchema.parse(config);
81
94
  });
82
95
  }
83
- exports.getConfig = getConfig;
84
96
  /**
85
97
  * Add data to the config file .sosconfig.json
86
98
  */
@@ -92,7 +104,6 @@ function addToConfigFile(workDir, data) {
92
104
  yield fs.writeFile(filePath, JSON.stringify(newContent, undefined, '\t') + '\n');
93
105
  });
94
106
  }
95
- exports.addToConfigFile = addToConfigFile;
96
107
  function loadConfigFromFile(workDir) {
97
108
  return __awaiter(this, void 0, void 0, function* () {
98
109
  const filePath = getConfigFilePath(workDir);
@@ -132,7 +143,6 @@ function ensureCustomScriptVersion(restApi, config) {
132
143
  });
133
144
  });
134
145
  }
135
- exports.ensureCustomScriptVersion = ensureCustomScriptVersion;
136
146
  function ensureCustomScript(restApi, config) {
137
147
  return __awaiter(this, void 0, void 0, function* () {
138
148
  if (config.uid) {
@@ -140,7 +150,7 @@ function ensureCustomScript(restApi, config) {
140
150
  if (customScript) {
141
151
  yield restApi.customScript.update(customScript.uid, {
142
152
  name: config.name,
143
- title: config.name,
153
+ title: config.name, // TODO change
144
154
  description: config.description,
145
155
  dangerLevel: config.dangerLevel,
146
156
  });
@@ -159,7 +169,7 @@ function ensureCustomScript(restApi, config) {
159
169
  (0, log_1.log)('info', chalk_1.default.yellow(`Creating Custom Script "${config.name}"`));
160
170
  const createdCustomScript = yield restApi.customScript.create({
161
171
  name: config.name,
162
- title: config.name,
172
+ title: config.name, // TODO change
163
173
  description: config.description,
164
174
  dangerLevel: config.dangerLevel,
165
175
  });
@@ -169,8 +179,8 @@ function ensureCustomScript(restApi, config) {
169
179
  return createdCustomScript;
170
180
  });
171
181
  }
172
- function uploadCode({ restApi, workDir, platform, config, customScriptVersion, }) {
173
- return __awaiter(this, void 0, void 0, function* () {
182
+ function uploadCode(_a) {
183
+ return __awaiter(this, arguments, void 0, function* ({ restApi, workDir, platform, config, customScriptVersion, }) {
174
184
  const { mainFile, runtime } = config;
175
185
  const codeArchive = yield generateCustomScriptPlatformCodeArchive(workDir, config, customScriptVersion, platform);
176
186
  const customScriptVersionPlatform = yield restApi.customScript.version.platform.get({
@@ -204,9 +214,8 @@ function uploadCode({ restApi, workDir, platform, config, customScriptVersion, }
204
214
  }
205
215
  });
206
216
  }
207
- exports.uploadCode = uploadCode;
208
- function uploadCodeArchive({ restApi, customScriptVersion, platform, codeArchive, }) {
209
- return __awaiter(this, void 0, void 0, function* () {
217
+ function uploadCodeArchive(_a) {
218
+ return __awaiter(this, arguments, void 0, function* ({ restApi, customScriptVersion, platform, codeArchive, }) {
210
219
  const filePath = codeArchive.filePath;
211
220
  const fileSize = (yield fs.stat(filePath)).size;
212
221
  const fileStream = fs.createReadStream(filePath);
@@ -51,8 +51,8 @@ exports.connect = (0, commandDefinition_1.createCommandDefinition)({
51
51
  optionList: OPTION_LIST,
52
52
  commands: [],
53
53
  run: function (options) {
54
- var _a;
55
54
  return __awaiter(this, void 0, void 0, function* () {
55
+ var _a;
56
56
  const currentDirectory = process.cwd();
57
57
  const organizationUid = yield (0, organizationFacade_1.getOrganizationUidOrDefaultOrSelect)(options);
58
58
  const organization = yield (0, organizationFacade_1.getOrganization)(organizationUid);
@@ -12,7 +12,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.disconnectDevice = exports.getActionType = exports.getDeviceUid = exports.POWER_ACTION_TYPE_OPTION = exports.DEVICE_UID_OPTION = exports.typeMap = void 0;
15
+ exports.POWER_ACTION_TYPE_OPTION = exports.DEVICE_UID_OPTION = exports.typeMap = void 0;
16
+ exports.getDeviceUid = getDeviceUid;
17
+ exports.getActionType = getActionType;
18
+ exports.disconnectDevice = disconnectDevice;
16
19
  const debug_1 = __importDefault(require("debug"));
17
20
  const prompts_1 = __importDefault(require("prompts"));
18
21
  const helper_1 = require("../helper");
@@ -58,7 +61,6 @@ function getDeviceUid(restApi, options) {
58
61
  return deviceUid;
59
62
  });
60
63
  }
61
- exports.getDeviceUid = getDeviceUid;
62
64
  function getActionType(options) {
63
65
  return __awaiter(this, void 0, void 0, function* () {
64
66
  let action = options.type;
@@ -83,7 +85,6 @@ function getActionType(options) {
83
85
  return action;
84
86
  });
85
87
  }
86
- exports.getActionType = getActionType;
87
88
  function disconnectDevice(organization, deviceUid) {
88
89
  return __awaiter(this, void 0, void 0, function* () {
89
90
  const config = yield (0, runControlHelper_1.loadConfig)();
@@ -100,4 +101,3 @@ function disconnectDevice(organization, deviceUid) {
100
101
  return JSON.parse(yield responseOfPost.text(), helper_1.deserializeJSON);
101
102
  });
102
103
  }
103
- exports.disconnectDevice = disconnectDevice;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import * as http from 'http';
3
2
  interface IOptions {
4
3
  useLocalIp?: boolean;
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.createDomain = void 0;
36
+ exports.createDomain = createDomain;
27
37
  const url = __importStar(require("url"));
28
38
  const ip = __importStar(require("internal-ip"));
29
39
  function createDomain(options, server) {
@@ -43,4 +53,3 @@ function createDomain(options, server) {
43
53
  port,
44
54
  });
45
55
  }
46
- exports.createDomain = createDomain;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.loadEmulatorOrCreateNewAndReturnUid = void 0;
15
+ exports.loadEmulatorOrCreateNewAndReturnUid = loadEmulatorOrCreateNewAndReturnUid;
16
16
  const chalk_1 = __importDefault(require("chalk"));
17
17
  const prompts_1 = __importDefault(require("prompts"));
18
18
  const runControlHelper_1 = require("../RunControl/runControlHelper");
@@ -60,8 +60,8 @@ function createNewEmulator(restApi, organizationUid) {
60
60
  });
61
61
  }
62
62
  function loadEmulatorOrCreateNewAndReturnUid(organizationUid) {
63
- var _a, _b, _c, _d, _e, _f, _g, _h;
64
63
  return __awaiter(this, void 0, void 0, function* () {
64
+ var _a, _b, _c, _d, _e, _f, _g, _h;
65
65
  const config = yield (0, runControlHelper_1.loadConfig)();
66
66
  if (!config.identification || !config.apiSecurityToken) {
67
67
  throw new Error(`No authenticized account found. Try to login using ${chalk_1.default.green('sos login')}`);
@@ -106,4 +106,3 @@ function loadEmulatorOrCreateNewAndReturnUid(organizationUid) {
106
106
  return emulatorUid;
107
107
  });
108
108
  }
109
- exports.loadEmulatorOrCreateNewAndReturnUid = loadEmulatorOrCreateNewAndReturnUid;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.createEmulator = void 0;
48
+ exports.createEmulator = createEmulator;
39
49
  const path = __importStar(require("path"));
40
50
  const http = __importStar(require("http"));
41
51
  const url = __importStar(require("url"));
@@ -64,7 +74,7 @@ function createEmulator(params, organizationUid, dev) {
64
74
  organizationUid,
65
75
  binaryFilePath: `${APPLET_DIRECTORY_PATH}/${entryFileRelativePath}`,
66
76
  checksum: DUMMY_CHECKSUM,
67
- frontAppletVersion: '',
77
+ frontAppletVersion: '', // has bundled front applet
68
78
  frontAppletBinaryFile: '', // has bundled front applet
69
79
  };
70
80
  const app = (0, express_1.default)();
@@ -129,4 +139,3 @@ function createEmulator(params, organizationUid, dev) {
129
139
  };
130
140
  });
131
141
  }
132
- exports.createEmulator = createEmulator;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,7 +42,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
42
  });
33
43
  };
34
44
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.uploadFirmwareVersion = void 0;
45
+ exports.uploadFirmwareVersion = uploadFirmwareVersion;
36
46
  const path = __importStar(require("path"));
37
47
  const fs = __importStar(require("fs-extra"));
38
48
  const fileSystem_1 = require("../../Lib/fileSystem");
@@ -78,4 +88,3 @@ function uploadFirmwareVersion(parameters) {
78
88
  }
79
89
  });
80
90
  }
81
- exports.uploadFirmwareVersion = uploadFirmwareVersion;
@@ -15,14 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.default = validateFileExistenceSync;
26
37
  const fs = __importStar(require("fs-extra"));
27
38
  function validateFileExistenceSync(path) {
28
39
  if (fs.existsSync(path)) {
@@ -35,4 +46,3 @@ function validateFileExistenceSync(path) {
35
46
  throw new Error(`${path} does not exist.`);
36
47
  }
37
48
  }
38
- exports.default = validateFileExistenceSync;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.generateZip = void 0;
48
+ exports.generateZip = generateZip;
39
49
  const path = __importStar(require("path"));
40
50
  const fs = __importStar(require("fs-extra"));
41
51
  const archiver_1 = __importDefault(require("archiver"));
@@ -67,4 +77,3 @@ function generateZip(workDir, rootDir, outputPath) {
67
77
  yield outputPromise;
68
78
  });
69
79
  }
70
- exports.generateZip = generateZip;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.executeChildProcess = void 0;
27
37
  const child_process = __importStar(require("child_process"));
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,7 +45,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.getFileMD5Checksum = exports.isPathIncluded = exports.validateAllFormalities = exports.getFileType = void 0;
48
+ exports.getFileType = getFileType;
49
+ exports.validateAllFormalities = validateAllFormalities;
50
+ exports.isPathIncluded = isPathIncluded;
51
+ exports.getFileMD5Checksum = getFileMD5Checksum;
39
52
  const path = __importStar(require("path"));
40
53
  const file_1 = __importDefault(require("@signageos/file"));
41
54
  const crypto_1 = require("crypto");
@@ -51,7 +64,6 @@ function getFileType(filePath) {
51
64
  return (fileResult === null || fileResult === void 0 ? void 0 : fileResult.mimeType) ? fileResult.mimeType : DEFAULT_FILE_TYPE;
52
65
  });
53
66
  }
54
- exports.getFileType = getFileType;
55
67
  function validateAllFormalities(appletPath, entryFileAbsolutePath, appletFilePaths) {
56
68
  return __awaiter(this, void 0, void 0, function* () {
57
69
  const packageConfig = yield (0, packageConfig_1.loadPackage)(appletPath);
@@ -71,7 +83,6 @@ function validateAllFormalities(appletPath, entryFileAbsolutePath, appletFilePat
71
83
  }
72
84
  });
73
85
  }
74
- exports.validateAllFormalities = validateAllFormalities;
75
86
  /**
76
87
  * This is the platform/OS idependent way to check if a file is included in a list of files.
77
88
  * So there can be backslashes and slashes on Windows and only slashes on Linux/UNIX.
@@ -82,7 +93,6 @@ function isPathIncluded(filePaths, filePath) {
82
93
  const sanitizedFilePaths = filePaths.map((filePathItem) => filePathItem.replace(/\\/g, '/'));
83
94
  return sanitizedFilePaths.includes(sanitizedFilePath);
84
95
  }
85
- exports.isPathIncluded = isPathIncluded;
86
96
  function getFileMD5Checksum(filePath) {
87
97
  return __awaiter(this, void 0, void 0, function* () {
88
98
  const hash = (0, crypto_1.createHash)('md5');
@@ -94,4 +104,3 @@ function getFileMD5Checksum(filePath) {
94
104
  });
95
105
  });
96
106
  }
97
- exports.getFileMD5Checksum = getFileMD5Checksum;
package/dist/Lib/git.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,7 +42,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
42
  });
33
43
  };
34
44
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.cloneGitRepository = exports.initGitRepository = exports.throwErrorIfGitNotInstalled = exports.machineHasGit = void 0;
45
+ exports.machineHasGit = machineHasGit;
46
+ exports.throwErrorIfGitNotInstalled = throwErrorIfGitNotInstalled;
47
+ exports.initGitRepository = initGitRepository;
48
+ exports.cloneGitRepository = cloneGitRepository;
36
49
  const path = __importStar(require("path"));
37
50
  const childProcess_1 = require("./childProcess");
38
51
  function machineHasGit() {
@@ -46,7 +59,6 @@ function machineHasGit() {
46
59
  }
47
60
  });
48
61
  }
49
- exports.machineHasGit = machineHasGit;
50
62
  function throwErrorIfGitNotInstalled() {
51
63
  return __awaiter(this, void 0, void 0, function* () {
52
64
  if (!(yield machineHasGit())) {
@@ -54,18 +66,15 @@ function throwErrorIfGitNotInstalled() {
54
66
  }
55
67
  });
56
68
  }
57
- exports.throwErrorIfGitNotInstalled = throwErrorIfGitNotInstalled;
58
- function initGitRepository(relativePath, verbose = false) {
59
- return __awaiter(this, void 0, void 0, function* () {
69
+ function initGitRepository(relativePath_1) {
70
+ return __awaiter(this, arguments, void 0, function* (relativePath, verbose = false) {
60
71
  const absolutePath = path.resolve(relativePath);
61
72
  yield (0, childProcess_1.executeChildProcess)(`git init "${absolutePath}"`, verbose);
62
73
  });
63
74
  }
64
- exports.initGitRepository = initGitRepository;
65
75
  function cloneGitRepository(gitUrl, targetDir) {
66
76
  return __awaiter(this, void 0, void 0, function* () {
67
77
  const absolutePath = path.resolve(targetDir);
68
78
  yield (0, childProcess_1.executeChildProcess)(`git clone "${gitUrl}" "${absolutePath}"`, false);
69
79
  });
70
80
  }
71
- exports.cloneGitRepository = cloneGitRepository;
@@ -12,7 +12,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getOrganization = exports.getOrganizations = exports.selectOrganizationUid = exports.getOrganizationUidOrDefaultOrSelect = exports.ORGANIZATION_OPTIONS = exports.NO_DEFAULT_ORGANIZATION_OPTION = exports.ORGANIZATION_UID_OPTION = void 0;
15
+ exports.ORGANIZATION_OPTIONS = exports.NO_DEFAULT_ORGANIZATION_OPTION = exports.ORGANIZATION_UID_OPTION = void 0;
16
+ exports.getOrganizationUidOrDefaultOrSelect = getOrganizationUidOrDefaultOrSelect;
17
+ exports.selectOrganizationUid = selectOrganizationUid;
18
+ exports.getOrganizations = getOrganizations;
19
+ exports.getOrganization = getOrganization;
16
20
  const chalk_1 = __importDefault(require("chalk"));
17
21
  const debug_1 = __importDefault(require("debug"));
18
22
  const prompts_1 = __importDefault(require("prompts"));
@@ -36,7 +40,7 @@ function getOrganizationUidOrDefaultOrSelect(options) {
36
40
  }
37
41
  if (!organizationUid) {
38
42
  organizationUid = yield selectOrganizationUid(options);
39
- if (organizationUid) {
43
+ if (organizationUid && !options['no-default-organization']) {
40
44
  const response = yield (0, prompts_1.default)({
41
45
  type: 'confirm',
42
46
  name: 'setDefault',
@@ -53,7 +57,6 @@ function getOrganizationUidOrDefaultOrSelect(options) {
53
57
  return organizationUid;
54
58
  });
55
59
  }
56
- exports.getOrganizationUidOrDefaultOrSelect = getOrganizationUidOrDefaultOrSelect;
57
60
  function selectOrganizationUid(options) {
58
61
  return __awaiter(this, void 0, void 0, function* () {
59
62
  let organizationUid = options['organization-uid'];
@@ -77,7 +80,6 @@ function selectOrganizationUid(options) {
77
80
  return organizationUid;
78
81
  });
79
82
  }
80
- exports.selectOrganizationUid = selectOrganizationUid;
81
83
  function getOrganizations() {
82
84
  return __awaiter(this, void 0, void 0, function* () {
83
85
  const ORGANIZATION_RESOURCE = 'organization';
@@ -104,7 +106,6 @@ function getOrganizations() {
104
106
  }
105
107
  });
106
108
  }
107
- exports.getOrganizations = getOrganizations;
108
109
  function getOrganization(organizationUid) {
109
110
  return __awaiter(this, void 0, void 0, function* () {
110
111
  const ORGANIZATION_RESOURCE = 'organization';
@@ -131,4 +132,3 @@ function getOrganization(organizationUid) {
131
132
  }
132
133
  });
133
134
  }
134
- exports.getOrganization = getOrganization;