@signageos/cli 2.3.2 → 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.
- package/README.md +53 -19
- package/dist/Applet/Generate/Templates/CHANGELOG.md.template +7 -0
- package/dist/Applet/Generate/Templates/README.md.template +3 -0
- package/dist/Applet/Generate/appletGenerateCommand.js +47 -13
- package/dist/Applet/Start/appletStartCommand.js +1 -1
- package/dist/Applet/Test/Upload/appletTestRunCommand.js +1 -1
- package/dist/Applet/Test/Upload/appletTestRunFacade.js +1 -2
- package/dist/Applet/Test/Upload/appletTestUploadCommand.js +5 -5
- package/dist/Applet/Test/Upload/appletTestUploadFacade.js +19 -10
- package/dist/Applet/Upload/appletUploadCommandHelper.js +36 -16
- package/dist/Applet/Upload/appletUploadFacade.js +19 -9
- package/dist/Applet/Upload/appletUploadFacadeHelper.js +19 -10
- package/dist/Applet/appletCommand.d.ts +3 -95
- package/dist/Applet/appletFacade.js +25 -15
- package/dist/Applet/appletServerHelper.js +2 -2
- package/dist/Auth/loginCommand.d.ts +2 -2
- package/dist/Auth/loginCommand.js +19 -9
- package/dist/Cache/tmpCache.js +19 -10
- package/dist/Cli/helper.js +2 -3
- package/dist/Cli/packageVersion.js +24 -15
- package/dist/Command/Autocomplete/Install/installAutocompleteCommand.d.ts +10 -0
- package/dist/Command/Autocomplete/Install/installAutocompleteCommand.js +39 -0
- package/dist/Command/Autocomplete/Install/installAutocompleteCommand.ts +30 -0
- package/dist/Command/Autocomplete/Install/sos-completion.sh +63 -0
- package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.d.ts +8 -0
- package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.js +120 -0
- package/dist/Command/Autocomplete/autocompleteCommand.d.ts +22 -0
- package/dist/Command/Autocomplete/autocompleteCommand.js +32 -0
- package/dist/Command/autoComplete.d.ts +4 -0
- package/dist/Command/autoComplete.js +184 -0
- package/dist/Command/commandDefinition.d.ts +9 -9
- package/dist/Command/commandDefinition.js +1 -2
- package/dist/Command/commandProcessor.js +3 -4
- package/dist/Command/globalArgs.js +2 -3
- package/dist/CommandLine/progressBarFactory.d.ts +1 -1
- package/dist/CommandLine/progressBarFactory.js +18 -9
- package/dist/CustomScript/Generate/customScriptGenerateFacade.js +19 -10
- package/dist/CustomScript/customScriptCommand.d.ts +1 -9
- package/dist/CustomScript/customScriptFacade.d.ts +2 -2
- package/dist/CustomScript/customScriptFacade.js +27 -18
- package/dist/Device/Connect/connectCommand.js +1 -1
- package/dist/Device/deviceFacade.js +4 -4
- package/dist/Emulator/createDomain.d.ts +0 -1
- package/dist/Emulator/createDomain.js +18 -9
- package/dist/Emulator/emulatorFacade.js +2 -3
- package/dist/Emulator/emulatorFactory.js +19 -10
- package/dist/Firmware/Upload/firmwareUploadFacade.js +18 -9
- package/dist/Firmware/Upload/firmwareUploadHelper.js +18 -8
- package/dist/Lib/archive.js +18 -9
- package/dist/Lib/childProcess.js +17 -7
- package/dist/Lib/fileSystem.js +21 -12
- package/dist/Lib/git.js +23 -14
- package/dist/Organization/organizationFacade.js +6 -6
- package/dist/RunControl/runControlHelper.js +3 -4
- package/dist/Timer/wait.js +1 -1
- package/dist/helper.d.ts +4 -4
- package/dist/helper.js +13 -13
- package/dist/index.js +4 -1
- package/package.json +43 -46
|
@@ -9,7 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.loadConfig = loadConfig;
|
|
13
|
+
exports.saveConfig = saveConfig;
|
|
14
|
+
exports.updateConfig = updateConfig;
|
|
13
15
|
const sosControlHelper_1 = require("@signageos/sdk/dist/SosHelper/sosControlHelper");
|
|
14
16
|
const globalArgs_1 = require("../Command/globalArgs");
|
|
15
17
|
/** The same as loadConfig in SDK, but respect CLI --profile argument */
|
|
@@ -19,7 +21,6 @@ function loadConfig() {
|
|
|
19
21
|
return yield (0, sosControlHelper_1.loadConfig)({ profile });
|
|
20
22
|
});
|
|
21
23
|
}
|
|
22
|
-
exports.loadConfig = loadConfig;
|
|
23
24
|
/** The same as saveConfig in SDK, but respect CLI --profile argument */
|
|
24
25
|
function saveConfig(newConfig) {
|
|
25
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -27,7 +28,6 @@ function saveConfig(newConfig) {
|
|
|
27
28
|
return yield (0, sosControlHelper_1.saveConfig)(newConfig, { profile });
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
|
-
exports.saveConfig = saveConfig;
|
|
31
31
|
/** The same as updateConfig in SDK, but respect CLI --profile argument */
|
|
32
32
|
function updateConfig(partialConfig) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -35,4 +35,3 @@ function updateConfig(partialConfig) {
|
|
|
35
35
|
return yield (0, sosControlHelper_1.updateConfig)(partialConfig, { profile });
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
exports.updateConfig = updateConfig;
|
package/dist/Timer/wait.js
CHANGED
package/dist/helper.d.ts
CHANGED
|
@@ -27,9 +27,9 @@ export interface IOptions {
|
|
|
27
27
|
}
|
|
28
28
|
export declare function createOptions(method: 'POST' | 'GET' | 'PUT' | 'DELETE', options: IOptions, data?: any): RequestInit;
|
|
29
29
|
export declare function createUri(options: IOptions, resource: string, queryParams?: any): string;
|
|
30
|
-
export declare function getResource(options: IOptions, path: string, query?: any): Promise<import("node-fetch").Response>;
|
|
31
|
-
export declare function postResource(options: IOptions, path: string, query?: any, data?: any): Promise<import("node-fetch").Response>;
|
|
32
|
-
export declare function putResource(options: IOptions, path: string, query?: any, data?: any): Promise<import("node-fetch").Response>;
|
|
33
|
-
export declare function deleteResource(options: IOptions, path: string): Promise<import("node-fetch").Response>;
|
|
30
|
+
export declare function getResource(options: IOptions, path: string, query?: any): Promise<import("node-fetch", { with: { "resolution-mode": "import" } }).Response>;
|
|
31
|
+
export declare function postResource(options: IOptions, path: string, query?: any, data?: any): Promise<import("node-fetch", { with: { "resolution-mode": "import" } }).Response>;
|
|
32
|
+
export declare function putResource(options: IOptions, path: string, query?: any, data?: any): Promise<import("node-fetch", { with: { "resolution-mode": "import" } }).Response>;
|
|
33
|
+
export declare function deleteResource(options: IOptions, path: string): Promise<import("node-fetch", { with: { "resolution-mode": "import" } }).Response>;
|
|
34
34
|
export declare function deserializeJSON(_key: string, value: any): any;
|
|
35
35
|
export {};
|
package/dist/helper.js
CHANGED
|
@@ -12,7 +12,19 @@ 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.
|
|
15
|
+
exports.AUTH_HEADER = void 0;
|
|
16
|
+
exports.loadApiUrl = loadApiUrl;
|
|
17
|
+
exports.getApiUrl = getApiUrl;
|
|
18
|
+
exports.createClientVersions = createClientVersions;
|
|
19
|
+
exports.createOrganizationRestApi = createOrganizationRestApi;
|
|
20
|
+
exports.createFirmwareVersionRestApi = createFirmwareVersionRestApi;
|
|
21
|
+
exports.createOptions = createOptions;
|
|
22
|
+
exports.createUri = createUri;
|
|
23
|
+
exports.getResource = getResource;
|
|
24
|
+
exports.postResource = postResource;
|
|
25
|
+
exports.putResource = putResource;
|
|
26
|
+
exports.deleteResource = deleteResource;
|
|
27
|
+
exports.deserializeJSON = deserializeJSON;
|
|
16
28
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
17
29
|
const querystring_1 = require("querystring");
|
|
18
30
|
// import { RequestInit } from 'node-fetch';
|
|
@@ -27,7 +39,6 @@ function loadApiUrl() {
|
|
|
27
39
|
return getApiUrl(config);
|
|
28
40
|
});
|
|
29
41
|
}
|
|
30
|
-
exports.loadApiUrl = loadApiUrl;
|
|
31
42
|
function getApiUrl(config) {
|
|
32
43
|
const apiUrl = (0, globalArgs_1.getGlobalApiUrl)() || config.apiUrl;
|
|
33
44
|
if (!apiUrl) {
|
|
@@ -35,13 +46,11 @@ function getApiUrl(config) {
|
|
|
35
46
|
}
|
|
36
47
|
return apiUrl;
|
|
37
48
|
}
|
|
38
|
-
exports.getApiUrl = getApiUrl;
|
|
39
49
|
function createClientVersions() {
|
|
40
50
|
return {
|
|
41
51
|
['signageOS_CLI']: parameters_1.parameters.version,
|
|
42
52
|
};
|
|
43
53
|
}
|
|
44
|
-
exports.createClientVersions = createClientVersions;
|
|
45
54
|
function createOrganizationRestApi(credentials) {
|
|
46
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
56
|
const options = {
|
|
@@ -57,7 +66,6 @@ function createOrganizationRestApi(credentials) {
|
|
|
57
66
|
return new RestApi_1.default(options, accountOptions);
|
|
58
67
|
});
|
|
59
68
|
}
|
|
60
|
-
exports.createOrganizationRestApi = createOrganizationRestApi;
|
|
61
69
|
function createFirmwareVersionRestApi() {
|
|
62
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
71
|
const config = yield (0, runControlHelper_1.loadConfig)();
|
|
@@ -77,7 +85,6 @@ function createFirmwareVersionRestApi() {
|
|
|
77
85
|
return new RestApi_1.default(options, accountOptions);
|
|
78
86
|
});
|
|
79
87
|
}
|
|
80
|
-
exports.createFirmwareVersionRestApi = createFirmwareVersionRestApi;
|
|
81
88
|
exports.AUTH_HEADER = 'X-Auth';
|
|
82
89
|
function createOptions(method, options, data) {
|
|
83
90
|
return {
|
|
@@ -86,27 +93,21 @@ function createOptions(method, options, data) {
|
|
|
86
93
|
body: typeof data !== 'undefined' ? JSON.stringify(data) : undefined,
|
|
87
94
|
};
|
|
88
95
|
}
|
|
89
|
-
exports.createOptions = createOptions;
|
|
90
96
|
function createUri(options, resource, queryParams) {
|
|
91
97
|
return [options.url, options.version, resource].join('/') + (typeof queryParams !== 'undefined' ? '?' + (0, querystring_1.stringify)(queryParams) : '');
|
|
92
98
|
}
|
|
93
|
-
exports.createUri = createUri;
|
|
94
99
|
function getResource(options, path, query) {
|
|
95
100
|
return (0, node_fetch_1.default)(createUri(options, path, query), createOptions('GET', options));
|
|
96
101
|
}
|
|
97
|
-
exports.getResource = getResource;
|
|
98
102
|
function postResource(options, path, query, data) {
|
|
99
103
|
return (0, node_fetch_1.default)(createUri(options, path, query), createOptions('POST', options, data));
|
|
100
104
|
}
|
|
101
|
-
exports.postResource = postResource;
|
|
102
105
|
function putResource(options, path, query, data) {
|
|
103
106
|
return (0, node_fetch_1.default)(createUri(options, path, query), createOptions('PUT', options, data));
|
|
104
107
|
}
|
|
105
|
-
exports.putResource = putResource;
|
|
106
108
|
function deleteResource(options, path) {
|
|
107
109
|
return (0, node_fetch_1.default)(createUri(options, path), createOptions('DELETE', options));
|
|
108
110
|
}
|
|
109
|
-
exports.deleteResource = deleteResource;
|
|
110
111
|
function deserializeJSON(_key, value) {
|
|
111
112
|
if (typeof value === 'string') {
|
|
112
113
|
const regexp = /^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d.\d\d\dZ$/.exec(value);
|
|
@@ -116,4 +117,3 @@ function deserializeJSON(_key, value) {
|
|
|
116
117
|
}
|
|
117
118
|
return value;
|
|
118
119
|
}
|
|
119
|
-
exports.deserializeJSON = deserializeJSON;
|
package/dist/index.js
CHANGED
|
@@ -20,17 +20,20 @@ const deviceCommand_1 = require("./Device/deviceCommand");
|
|
|
20
20
|
const generalCommand_1 = require("./generalCommand");
|
|
21
21
|
const commandDefinition_1 = require("./Command/commandDefinition");
|
|
22
22
|
const customScriptCommand_1 = require("./CustomScript/customScriptCommand");
|
|
23
|
+
const autocompleteCommand_1 = require("./Command/Autocomplete/autocompleteCommand");
|
|
23
24
|
const index = (0, commandDefinition_1.createCommandDefinition)({
|
|
24
25
|
name: 'sos',
|
|
25
26
|
description: 'signageOS',
|
|
26
27
|
optionList: generalCommand_1.GENERAL_OPTION_LIST,
|
|
27
|
-
commands: [appletCommand_1.applet, loginCommand_1.login, organizationCommand_1.organization, timingCommand_1.timing, firmwareCommand_1.firmware, deviceCommand_1.device, customScriptCommand_1.customScript],
|
|
28
|
+
commands: [appletCommand_1.applet, loginCommand_1.login, organizationCommand_1.organization, timingCommand_1.timing, firmwareCommand_1.firmware, deviceCommand_1.device, customScriptCommand_1.customScript, autocompleteCommand_1.autocomplete],
|
|
28
29
|
run() {
|
|
29
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
31
|
throw new Error('Unknown command');
|
|
31
32
|
});
|
|
32
33
|
},
|
|
33
34
|
});
|
|
35
|
+
// Initialize autocomplete with root command reference using dependency injection
|
|
36
|
+
(0, autocompleteCommand_1.initializeAutocomplete)(index);
|
|
34
37
|
(0, commandProcessor_1.processCommand)(index).catch((err) => {
|
|
35
38
|
throw new Error('Unknown error:', err);
|
|
36
39
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signageos/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
".env",
|
|
@@ -15,19 +15,22 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "npx check-engine@latest && tsc && npm run build:templates",
|
|
17
17
|
"build:templates": "node tools/include-templates.js",
|
|
18
|
-
"lint
|
|
19
|
-
"lint": "
|
|
18
|
+
"lint": "eslint --config ./eslint.config.mjs --ext .ts,.tsx,.js ./src/",
|
|
19
|
+
"lint:fix": "eslint --config ./eslint.config.mjs --fix --ext .ts,.tsx,.js ./src/",
|
|
20
|
+
"lint:prettier": "prettier \"(src|tests|tools)/**/*.+(ts|tsx|json|js)\" --check",
|
|
21
|
+
"lint:prettier:fix": "prettier \"(src|tests|tools)/**/*.+(ts|tsx|json|js)\" --write",
|
|
20
22
|
"clean": "rm -rf dist/*",
|
|
21
23
|
"clean-build": "npm run clean && npm run build && chmod +x dist/index.js",
|
|
22
24
|
"test": "env NODE_ENV=test mocha",
|
|
23
25
|
"test:windows": "cross-env NODE_ENV=test mocha",
|
|
24
26
|
"test:coverage": "c8 npm run test",
|
|
25
27
|
"watch": "tsc --watch",
|
|
26
|
-
"check": "npm run depcheck && npx --userconfig ./.npmrc @signageos/lib check-deps && npm run check-circular-deps",
|
|
28
|
+
"check": "npm run depcheck && npx --userconfig ./.npmrc @signageos/lib-ci check-deps && npm run check-circular-deps",
|
|
27
29
|
"check-circular-deps": "npx madge@5 --circular --extensions ts ./src/",
|
|
28
30
|
"depcheck": "depcheck --config .depcheckrc.json",
|
|
29
31
|
"typecheck": "tsc --noEmit",
|
|
30
|
-
"prettier:format": "prettier \"(src|tests|tools)/**/*.+(ts|js)\" --write"
|
|
32
|
+
"prettier:format": "prettier \"(src|tests|tools)/**/*.+(ts|js)\" --write",
|
|
33
|
+
"postinstall": "node -e \"try{require('./postinstall.js')}catch(e){}\""
|
|
31
34
|
},
|
|
32
35
|
"license": "MIT",
|
|
33
36
|
"engines": {
|
|
@@ -41,62 +44,56 @@
|
|
|
41
44
|
"@istanbuljs/nyc-config-typescript": "1.0.2",
|
|
42
45
|
"@signageos/codestyle": "1.0.0",
|
|
43
46
|
"@types/archiver": "6.0.3",
|
|
44
|
-
"@types/child-process-promise": "2.2.
|
|
45
|
-
"@types/cli-progress": "3.
|
|
46
|
-
"@types/command-line-args": "5.
|
|
47
|
-
"@types/command-line-usage": "5.0.
|
|
48
|
-
"@types/cors": "2.8.
|
|
47
|
+
"@types/child-process-promise": "2.2.6",
|
|
48
|
+
"@types/cli-progress": "3.11.6",
|
|
49
|
+
"@types/command-line-args": "5.2.3",
|
|
50
|
+
"@types/command-line-usage": "5.0.4",
|
|
51
|
+
"@types/cors": "2.8.17",
|
|
49
52
|
"@types/debug": "4.1.12",
|
|
50
|
-
"@types/express": "
|
|
51
|
-
"@types/fs-extra": "
|
|
52
|
-
"@types/mime": "
|
|
53
|
-
"@types/mocha": "
|
|
54
|
-
"@types/node": "
|
|
55
|
-
"@types/node-fetch": "2.
|
|
56
|
-
"@types/prompts": "2.
|
|
57
|
-
"@types/semver": "7.
|
|
58
|
-
"@types/sinon": "
|
|
59
|
-
"@types/unzipper": "0.10.
|
|
53
|
+
"@types/express": "5.0.1",
|
|
54
|
+
"@types/fs-extra": "11.0.4",
|
|
55
|
+
"@types/mime": "3.0.4",
|
|
56
|
+
"@types/mocha": "10.0.10",
|
|
57
|
+
"@types/node": "22.15.3",
|
|
58
|
+
"@types/node-fetch": "2.6.12",
|
|
59
|
+
"@types/prompts": "2.4.9",
|
|
60
|
+
"@types/semver": "7.7.0",
|
|
61
|
+
"@types/sinon": "17.0.4",
|
|
62
|
+
"@types/unzipper": "0.10.11",
|
|
60
63
|
"@types/which": "3.0.4",
|
|
61
|
-
"c8": "
|
|
64
|
+
"c8": "10.1.3",
|
|
62
65
|
"cross-env": "7.0.3",
|
|
63
|
-
"depcheck": "1.4.
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"eslint-plugin-no-null": "1.0.2",
|
|
67
|
-
"eslint-plugin-prettier": "5.2.6",
|
|
68
|
-
"eslint-plugin-unused-imports": "4.1.4",
|
|
69
|
-
"mocha": "8.4.0",
|
|
70
|
-
"rewiremock": "3.13.9",
|
|
66
|
+
"depcheck": "1.4.7",
|
|
67
|
+
"mocha": "11.2.2",
|
|
68
|
+
"rewiremock": "3.14.5",
|
|
71
69
|
"should": "13.2.3",
|
|
72
70
|
"sinon": "20.0.0",
|
|
73
|
-
"ts-node": "
|
|
74
|
-
"typescript": "
|
|
75
|
-
"typescript-eslint": "8.30.1",
|
|
71
|
+
"ts-node": "10.9.2",
|
|
72
|
+
"typescript": "5.8.3",
|
|
76
73
|
"unzipper": "0.12.3"
|
|
77
74
|
},
|
|
78
75
|
"dependencies": {
|
|
79
|
-
"@signageos/file": "0.1
|
|
76
|
+
"@signageos/file": "1.0.1",
|
|
80
77
|
"@signageos/sdk": "1.27.5",
|
|
81
78
|
"archiver": "7.0.1",
|
|
82
79
|
"chalk": "2.4.2",
|
|
83
80
|
"child-process-promise": "2.2.1",
|
|
84
|
-
"cli-progress": "3.
|
|
85
|
-
"command-line-args": "
|
|
86
|
-
"command-line-usage": "
|
|
81
|
+
"cli-progress": "3.12.0",
|
|
82
|
+
"command-line-args": "6.0.1",
|
|
83
|
+
"command-line-usage": "7.0.3",
|
|
87
84
|
"cors": "2.8.5",
|
|
88
|
-
"debug": "4.
|
|
89
|
-
"dotenv": "
|
|
90
|
-
"express": "
|
|
91
|
-
"fs-extra": "
|
|
92
|
-
"internal-ip": "
|
|
85
|
+
"debug": "4.4.0",
|
|
86
|
+
"dotenv": "16.5.0",
|
|
87
|
+
"express": "5.1.0",
|
|
88
|
+
"fs-extra": "11.3.0",
|
|
89
|
+
"internal-ip": "8.0.0",
|
|
93
90
|
"mime": "2.4.4",
|
|
94
|
-
"node-fetch": "
|
|
95
|
-
"prompts": "2.
|
|
96
|
-
"semver": "7.1
|
|
97
|
-
"serve-static": "
|
|
91
|
+
"node-fetch": "3.3.2",
|
|
92
|
+
"prompts": "2.4.2",
|
|
93
|
+
"semver": "7.7.1",
|
|
94
|
+
"serve-static": "2.2.0",
|
|
98
95
|
"which": "5.0.0",
|
|
99
|
-
"zod": "3.24.
|
|
96
|
+
"zod": "3.24.4"
|
|
100
97
|
},
|
|
101
98
|
"publishConfig": {
|
|
102
99
|
"registry": "https://registry.npmjs.org/",
|