@signageos/cli 2.9.0 → 3.0.0-rc.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 (36) hide show
  1. package/dist/Applet/Generate/appletGenerateCommand.js +50 -58
  2. package/dist/Applet/Test/Upload/appletTestRunCommand.js +2 -1
  3. package/dist/Applet/Test/Upload/appletTestUploadCommand.js +2 -1
  4. package/dist/Applet/Upload/appletUploadFacadeHelper.js +2 -1
  5. package/dist/Applet/appletFacade.js +4 -2
  6. package/dist/CustomScript/Generate/customScriptGenerateCommand.js +6 -0
  7. package/dist/CustomScript/customScriptFacade.d.ts +17 -1
  8. package/dist/CustomScript/customScriptFacade.js +16 -5
  9. package/dist/Device/deviceFacade.js +2 -1
  10. package/dist/Emulator/emulatorFacade.js +7 -1
  11. package/dist/Lib/fileSystem.d.ts +5 -0
  12. package/dist/Lib/fileSystem.js +23 -0
  13. package/dist/Plugin/Generate/pluginGenerateCommand.js +6 -0
  14. package/dist/Plugin/Upload/pluginUploadCommand.js +1 -2
  15. package/dist/Plugin/pluginFacade.d.ts +14 -0
  16. package/dist/Plugin/pluginFacade.js +25 -2
  17. package/dist/Runner/Generate/runnerGenerateCommand.js +6 -0
  18. package/dist/Runner/Upload/runnerUploadCommand.js +6 -6
  19. package/dist/Runner/{runnerFacede.js → runnerFacade.js} +3 -1
  20. package/dist/helper/paginationHelper.d.ts +7 -0
  21. package/dist/helper/paginationHelper.js +32 -0
  22. package/dist/helper.d.ts +0 -1
  23. package/dist/helper.js +0 -20
  24. package/dist/index.js +1 -2
  25. package/docs/applet/generate/index.md +1 -1
  26. package/package.json +3 -6
  27. package/.env +0 -3
  28. package/dist/Firmware/Upload/firmwareUploadCommand.d.ts +0 -90
  29. package/dist/Firmware/Upload/firmwareUploadCommand.js +0 -207
  30. package/dist/Firmware/Upload/firmwareUploadFacade.d.ts +0 -10
  31. package/dist/Firmware/Upload/firmwareUploadFacade.js +0 -99
  32. package/dist/Firmware/Upload/firmwareUploadHelper.d.ts +0 -1
  33. package/dist/Firmware/Upload/firmwareUploadHelper.js +0 -48
  34. package/dist/Firmware/firmwareCommand.d.ts +0 -76
  35. package/dist/Firmware/firmwareCommand.js +0 -42
  36. /package/dist/Runner/{runnerFacede.d.ts → runnerFacade.d.ts} +0 -0
@@ -1,99 +0,0 @@
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
- })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
- var __importDefault = (this && this.__importDefault) || function (mod) {
45
- return (mod && mod.__esModule) ? mod : { "default": mod };
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.uploadFirmwareVersion = uploadFirmwareVersion;
49
- const path = __importStar(require("path"));
50
- const fs = __importStar(require("fs-extra"));
51
- const fileSystem_1 = require("../../Lib/fileSystem");
52
- const chalk_1 = __importDefault(require("chalk"));
53
- function uploadFirmwareVersion(parameters) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- const { restApi, firmware, pathArr, progressBar } = parameters;
56
- const sizes = yield Promise.all(pathArr.map((filePath) => __awaiter(this, void 0, void 0, function* () {
57
- const stat = yield fs.stat(filePath);
58
- return stat.size;
59
- })));
60
- // Process each file sequentially for cleaner output
61
- for (const index in pathArr) {
62
- const filePath = pathArr[index];
63
- if (!filePath) {
64
- continue;
65
- }
66
- const fileSize = sizes[Number.parseInt(index)];
67
- if (fileSize === undefined) {
68
- continue;
69
- }
70
- const fileName = path.basename(filePath);
71
- // Log with newline for cleaner output
72
- console.info(chalk_1.default.yellow(`Uploading ${filePath}\n`));
73
- if (progressBar) {
74
- progressBar.init({ size: fileSize, name: fileName });
75
- }
76
- const md5Hash = yield (0, fileSystem_1.getFileMD5Checksum)(filePath);
77
- const stream = fs.createReadStream(filePath);
78
- stream.pause();
79
- stream.on('data', (chunk) => {
80
- if (progressBar) {
81
- progressBar.update({ add: chunk.length, name: fileName });
82
- }
83
- });
84
- firmware.files.push({
85
- hash: md5Hash,
86
- content: stream,
87
- size: fileSize,
88
- });
89
- }
90
- try {
91
- yield restApi.firmwareVersion.create(firmware, parameters.force);
92
- }
93
- finally {
94
- if (progressBar) {
95
- progressBar.end();
96
- }
97
- }
98
- });
99
- }
@@ -1 +0,0 @@
1
- export default function validateFileExistenceSync(path: string): void;
@@ -1,48 +0,0 @@
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
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.default = validateFileExistenceSync;
37
- const fs = __importStar(require("fs-extra"));
38
- function validateFileExistenceSync(path) {
39
- if (fs.existsSync(path)) {
40
- const stats = fs.statSync(path);
41
- if (!stats.isFile()) {
42
- throw new Error(`${path} is not file.`);
43
- }
44
- }
45
- else {
46
- throw new Error(`${path} does not exist.`);
47
- }
48
- }
@@ -1,76 +0,0 @@
1
- /**
2
- * Provides commands for managing device firmware on the signageOS platform.
3
- * Firmware management includes uploading new firmware versions for different
4
- * device types and application platforms.
5
- *
6
- * @group Private
7
- *
8
- * @example
9
- * ```bash
10
- * # Upload firmware version
11
- * sos firmware upload
12
- * ```
13
- *
14
- * @see {@link ./upload/ Upload firmware version command}
15
- *
16
- * @since 0.6.0
17
- */
18
- export declare const firmware: {
19
- name: "firmware";
20
- description: string;
21
- optionList: never[];
22
- commands: {
23
- name: "upload";
24
- description: string;
25
- optionList: readonly [{
26
- readonly name: "application-type";
27
- readonly alias: "a";
28
- readonly type: StringConstructor;
29
- readonly description: "Application type for the firmware (e.g., linux, android, webos)";
30
- }, {
31
- readonly name: "firmware-version";
32
- readonly alias: "f";
33
- readonly type: StringConstructor;
34
- readonly description: "Version identifier for the firmware package";
35
- }, {
36
- readonly name: "firmware-type";
37
- readonly type: StringConstructor;
38
- readonly description: "Device model prefixed with brand (e.g., \"benq_sl550\", \"rpi4\", \"rpi\")";
39
- }, {
40
- readonly name: "src";
41
- readonly type: StringConstructor;
42
- readonly multiple: true;
43
- readonly description: "Path(s) to firmware file(s) to upload";
44
- }, {
45
- readonly name: "force";
46
- readonly type: BooleanConstructor;
47
- readonly description: "When firmware cannot be uploaded due to invalid firmware \"type\", do it anyways.";
48
- }];
49
- commands: never[];
50
- run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
51
- readonly name: "application-type";
52
- readonly alias: "a";
53
- readonly type: StringConstructor;
54
- readonly description: "Application type for the firmware (e.g., linux, android, webos)";
55
- }, {
56
- readonly name: "firmware-version";
57
- readonly alias: "f";
58
- readonly type: StringConstructor;
59
- readonly description: "Version identifier for the firmware package";
60
- }, {
61
- readonly name: "firmware-type";
62
- readonly type: StringConstructor;
63
- readonly description: "Device model prefixed with brand (e.g., \"benq_sl550\", \"rpi4\", \"rpi\")";
64
- }, {
65
- readonly name: "src";
66
- readonly type: StringConstructor;
67
- readonly multiple: true;
68
- readonly description: "Path(s) to firmware file(s) to upload";
69
- }, {
70
- readonly name: "force";
71
- readonly type: BooleanConstructor;
72
- readonly description: "When firmware cannot be uploaded due to invalid firmware \"type\", do it anyways.";
73
- }]>): Promise<void>;
74
- }[];
75
- run(): Promise<never>;
76
- };
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.firmware = void 0;
13
- const commandDefinition_1 = require("../Command/commandDefinition");
14
- const firmwareUploadCommand_1 = require("./Upload/firmwareUploadCommand");
15
- /**
16
- * Provides commands for managing device firmware on the signageOS platform.
17
- * Firmware management includes uploading new firmware versions for different
18
- * device types and application platforms.
19
- *
20
- * @group Private
21
- *
22
- * @example
23
- * ```bash
24
- * # Upload firmware version
25
- * sos firmware upload
26
- * ```
27
- *
28
- * @see {@link ./upload/ Upload firmware version command}
29
- *
30
- * @since 0.6.0
31
- */
32
- exports.firmware = (0, commandDefinition_1.createCommandDefinition)({
33
- name: 'firmware',
34
- description: 'Firmware management',
35
- optionList: [],
36
- commands: [firmwareUploadCommand_1.firmwareUpload],
37
- run() {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- throw new Error('Unknown command');
40
- });
41
- },
42
- });