@signageos/cli 2.4.1 → 2.6.0-rc.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 +27 -1
- package/dist/Applet/Build/appletBuildCommand.d.ts +28 -2
- package/dist/Applet/Build/appletBuildCommand.js +27 -1
- package/dist/Applet/Generate/Templates/index.js.template +1 -1
- package/dist/Applet/Generate/Templates/tsconfig.js.template +1 -1
- package/dist/Applet/Generate/appletGenerateCommand.d.ts +29 -23
- package/dist/Applet/Generate/appletGenerateCommand.js +38 -32
- package/dist/Applet/Start/appletStartCommand.d.ts +44 -2
- package/dist/Applet/Start/appletStartCommand.js +44 -2
- package/dist/Applet/Test/Upload/appletTestRunCommand.d.ts +25 -2
- package/dist/Applet/Test/Upload/appletTestRunCommand.js +24 -1
- package/dist/Applet/Test/Upload/appletTestUploadCommand.d.ts +34 -4
- package/dist/Applet/Test/Upload/appletTestUploadCommand.js +32 -2
- package/dist/Applet/Test/appletTestCommand.d.ts +23 -6
- package/dist/Applet/Test/appletTestCommand.js +17 -0
- package/dist/Applet/Upload/appletUploadCommand.d.ts +46 -4
- package/dist/Applet/Upload/appletUploadCommand.js +44 -2
- package/dist/Applet/Upload/appletUploadFacade.js +3 -3
- package/dist/Applet/appletCommand.d.ts +42 -10
- package/dist/Applet/appletCommand.js +33 -1
- package/dist/Auth/loginCommand.d.ts +23 -2
- package/dist/Auth/loginCommand.js +42 -14
- package/dist/Command/Autocomplete/Install/installAutocompleteCommand.d.ts +17 -0
- package/dist/Command/Autocomplete/Install/installAutocompleteCommand.js +17 -0
- package/dist/Command/Autocomplete/Install/installAutocompleteCommand.ts +17 -0
- package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.d.ts +17 -0
- package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.js +22 -5
- package/dist/Command/Autocomplete/autocompleteCommand.d.ts +18 -0
- package/dist/Command/Autocomplete/autocompleteCommand.js +19 -1
- package/dist/Command/autoComplete.js +2 -2
- package/dist/Command/globalArgs.d.ts +33 -0
- package/dist/Command/globalArgs.js +33 -0
- package/dist/CustomScript/Generate/customScriptGenerateCommand.d.ts +19 -0
- package/dist/CustomScript/Generate/customScriptGenerateCommand.js +20 -1
- package/dist/CustomScript/Upload/customScriptUploadCommand.d.ts +32 -2
- package/dist/CustomScript/Upload/customScriptUploadCommand.js +31 -1
- package/dist/CustomScript/customScriptCommand.d.ts +21 -1
- package/dist/CustomScript/customScriptCommand.js +20 -0
- package/dist/CustomScript/customScriptFacade.d.ts +5 -5
- package/dist/CustomScript/customScriptFacade.js +5 -4
- package/dist/Device/Connect/connectCommand.d.ts +51 -2
- package/dist/Device/Connect/connectCommand.js +50 -1
- package/dist/Device/Content/setContentCommand.d.ts +28 -2
- package/dist/Device/Content/setContentCommand.js +27 -1
- package/dist/Device/PowerAction/powerActionCommand.d.ts +54 -2
- package/dist/Device/PowerAction/powerActionCommand.js +52 -0
- package/dist/Device/deviceCommand.d.ts +26 -6
- package/dist/Device/deviceCommand.js +21 -1
- package/dist/Device/deviceFacade.d.ts +1 -1
- package/dist/Firmware/Upload/firmwareUploadCommand.d.ts +42 -0
- package/dist/Firmware/Upload/firmwareUploadCommand.js +40 -6
- package/dist/Firmware/Upload/firmwareUploadFacade.js +1 -1
- package/dist/Firmware/firmwareCommand.d.ts +25 -0
- package/dist/Firmware/firmwareCommand.js +18 -1
- package/dist/Lib/childProcess.js +2 -2
- package/dist/Organization/Get/organizationGetCommand.d.ts +31 -2
- package/dist/Organization/Get/organizationGetCommand.js +31 -2
- package/dist/Organization/List/organizationListCommand.d.ts +20 -0
- package/dist/Organization/List/organizationListCommand.js +21 -1
- package/dist/Organization/SetDefault/organizationSetDefaultCommand.d.ts +24 -0
- package/dist/Organization/SetDefault/organizationSetDefaultCommand.js +25 -1
- package/dist/Organization/organizationCommand.d.ts +27 -2
- package/dist/Organization/organizationCommand.js +26 -1
- package/dist/Organization/organizationFacade.d.ts +2 -2
- package/dist/Organization/organizationFacade.js +3 -3
- package/dist/Plugin/Generate/pluginGenerateCommand.d.ts +7 -0
- package/dist/Plugin/Generate/pluginGenerateCommand.js +38 -0
- package/dist/Plugin/Generate/pluginGenerateFacade.d.ts +12 -0
- package/dist/Plugin/Generate/pluginGenerateFacade.js +106 -0
- package/dist/Plugin/Upload/pluginUploadCommand.d.ts +25 -0
- package/dist/Plugin/Upload/pluginUploadCommand.js +70 -0
- package/dist/Plugin/pluginCommand.d.ts +27 -0
- package/dist/Plugin/pluginCommand.js +26 -0
- package/dist/Plugin/pluginFacade.d.ts +62 -0
- package/dist/Plugin/pluginFacade.js +251 -0
- package/dist/Runner/Generate/runnerGenerateCommand.d.ts +7 -0
- package/dist/Runner/Generate/runnerGenerateCommand.js +38 -0
- package/dist/Runner/Generate/runnerGenerateFacade.d.ts +12 -0
- package/dist/Runner/Generate/runnerGenerateFacade.js +107 -0
- package/dist/Runner/Upload/runnerUploadCommand.d.ts +25 -0
- package/dist/Runner/Upload/runnerUploadCommand.js +72 -0
- package/dist/Runner/runnerCommand.d.ts +27 -0
- package/dist/Runner/runnerCommand.js +26 -0
- package/dist/Runner/runnerFacede.d.ts +15 -0
- package/dist/Runner/runnerFacede.js +234 -0
- package/dist/Timing/List/timingListCommand.d.ts +26 -2
- package/dist/Timing/List/timingListCommand.js +26 -2
- package/dist/Timing/timingCommand.d.ts +17 -2
- package/dist/Timing/timingCommand.js +15 -0
- package/dist/helper.d.ts +5 -5
- package/dist/helper.js +4 -6
- package/dist/index.js +26 -2
- package/docs/applet/build/index.md +74 -0
- package/docs/applet/generate/index.md +118 -0
- package/docs/applet/index.md +134 -0
- package/docs/applet/start/index.md +104 -0
- package/docs/applet/test/index.md +91 -0
- package/docs/applet/test/run/index.md +82 -0
- package/docs/applet/test/upload/index.md +80 -0
- package/docs/applet/upload/index.md +131 -0
- package/docs/autocomplete/index.md +92 -0
- package/docs/autocomplete/install/index.md +120 -0
- package/docs/autocomplete/uninstall/index.md +65 -0
- package/docs/custom-script/generate/index.md +66 -0
- package/docs/custom-script/index.md +96 -0
- package/docs/custom-script/upload/index.md +78 -0
- package/docs/device/connect/index.md +148 -0
- package/docs/device/index.md +105 -0
- package/docs/device/power-action/index.md +130 -0
- package/docs/device/set-content/index.md +72 -0
- package/docs/index.md +170 -0
- package/docs/login/index.md +122 -0
- package/docs/organization/get/index.md +79 -0
- package/docs/organization/index.md +105 -0
- package/docs/organization/list/index.md +65 -0
- package/docs/organization/set-default/index.md +74 -0
- package/docs/plugin/generate/index.md +43 -0
- package/docs/plugin/index.md +72 -0
- package/docs/plugin/upload/index.md +50 -0
- package/docs/runner/generate/index.md +43 -0
- package/docs/runner/index.md +72 -0
- package/docs/runner/upload/index.md +50 -0
- package/docs/timing/index.md +78 -0
- package/docs/timing/list/index.md +71 -0
- package/package.json +29 -19
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
export declare const OPTION_LIST: readonly [];
|
|
2
|
+
/**
|
|
3
|
+
* Removes the signageOS CLI auto-completion functionality from the user's shell configuration.
|
|
4
|
+
* This command reverses the changes made by the install command, removing auto-completion
|
|
5
|
+
* scripts and configuration entries from shell profile files.
|
|
6
|
+
*
|
|
7
|
+
* @group Tools:2
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```bash
|
|
11
|
+
* # Uninstall auto-completion
|
|
12
|
+
* sos autocomplete uninstall
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @see {@link ../install/ Install auto-completion command}
|
|
16
|
+
*
|
|
17
|
+
* @since 2.4.0
|
|
18
|
+
*/
|
|
2
19
|
export declare const uninstallAutocomplete: {
|
|
3
20
|
name: "uninstall";
|
|
4
21
|
description: string;
|
|
@@ -47,6 +47,23 @@ const fs = __importStar(require("fs"));
|
|
|
47
47
|
const path = __importStar(require("path"));
|
|
48
48
|
const commandDefinition_1 = require("../../commandDefinition");
|
|
49
49
|
exports.OPTION_LIST = [];
|
|
50
|
+
/**
|
|
51
|
+
* Removes the signageOS CLI auto-completion functionality from the user's shell configuration.
|
|
52
|
+
* This command reverses the changes made by the install command, removing auto-completion
|
|
53
|
+
* scripts and configuration entries from shell profile files.
|
|
54
|
+
*
|
|
55
|
+
* @group Tools:2
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```bash
|
|
59
|
+
* # Uninstall auto-completion
|
|
60
|
+
* sos autocomplete uninstall
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @see {@link ../install/ Install auto-completion command}
|
|
64
|
+
*
|
|
65
|
+
* @since 2.4.0
|
|
66
|
+
*/
|
|
50
67
|
exports.uninstallAutocomplete = (0, commandDefinition_1.createCommandDefinition)({
|
|
51
68
|
name: 'uninstall',
|
|
52
69
|
description: 'Uninstall command auto-completion for bash/zsh shells',
|
|
@@ -66,11 +83,11 @@ exports.uninstallAutocomplete = (0, commandDefinition_1.createCommandDefinition)
|
|
|
66
83
|
try {
|
|
67
84
|
yield fs.promises.access(completionFilePath);
|
|
68
85
|
yield fs.promises.unlink(completionFilePath);
|
|
69
|
-
console.
|
|
86
|
+
console.info(`✅ Removed completion script: ${completionFilePath}`);
|
|
70
87
|
}
|
|
71
88
|
catch (error) {
|
|
72
89
|
if (error.code === 'ENOENT') {
|
|
73
|
-
console.
|
|
90
|
+
console.info(`ℹ️ Completion script not found at: ${completionFilePath}`);
|
|
74
91
|
}
|
|
75
92
|
else {
|
|
76
93
|
throw error;
|
|
@@ -95,7 +112,7 @@ exports.uninstallAutocomplete = (0, commandDefinition_1.createCommandDefinition)
|
|
|
95
112
|
}
|
|
96
113
|
if (content !== originalContent) {
|
|
97
114
|
fs.writeFileSync(configFilePath, content, 'utf8');
|
|
98
|
-
console.
|
|
115
|
+
console.info(`✅ Removed source line from ${configFile}`);
|
|
99
116
|
configModified = true;
|
|
100
117
|
}
|
|
101
118
|
}
|
|
@@ -108,8 +125,8 @@ exports.uninstallAutocomplete = (0, commandDefinition_1.createCommandDefinition)
|
|
|
108
125
|
if (!configModified) {
|
|
109
126
|
console.info(`ℹ️ No shell configuration files were modified`);
|
|
110
127
|
}
|
|
111
|
-
console.
|
|
112
|
-
console.
|
|
128
|
+
console.info('\nAuto-completion for signageOS CLI has been uninstalled.');
|
|
129
|
+
console.info('You may need to restart your terminal or run "source ~/.bashrc" (or equivalent) for changes to take effect.');
|
|
113
130
|
}
|
|
114
131
|
catch (error) {
|
|
115
132
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { ICommand, OptionList } from '../commandDefinition';
|
|
2
2
|
export declare const OPTION_LIST: readonly [];
|
|
3
3
|
export declare const initializeAutocomplete: (rootCommand: ICommand<string, OptionList>) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Provides commands for installing and managing shell auto-completion for the signageOS CLI.
|
|
6
|
+
* Auto-completion enhances developer productivity by providing intelligent command and
|
|
7
|
+
* sub-command suggestions in supported shells (bash, zsh, fish).
|
|
8
|
+
*
|
|
9
|
+
* @group Tools:7
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```bash
|
|
13
|
+
* # Install auto-completion for current shell
|
|
14
|
+
* sos autocomplete install
|
|
15
|
+
*
|
|
16
|
+
* # Uninstall auto-completion
|
|
17
|
+
* sos autocomplete uninstall
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @since 2.4.0
|
|
21
|
+
*/
|
|
4
22
|
export declare const autocomplete: {
|
|
5
23
|
name: "autocomplete";
|
|
6
24
|
description: string;
|
|
@@ -19,9 +19,27 @@ const initializeAutocomplete = (rootCommand) => {
|
|
|
19
19
|
(0, installAutocompleteCommand_1.setRootCommand)(rootCommand);
|
|
20
20
|
};
|
|
21
21
|
exports.initializeAutocomplete = initializeAutocomplete;
|
|
22
|
+
/**
|
|
23
|
+
* Provides commands for installing and managing shell auto-completion for the signageOS CLI.
|
|
24
|
+
* Auto-completion enhances developer productivity by providing intelligent command and
|
|
25
|
+
* sub-command suggestions in supported shells (bash, zsh, fish).
|
|
26
|
+
*
|
|
27
|
+
* @group Tools:7
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```bash
|
|
31
|
+
* # Install auto-completion for current shell
|
|
32
|
+
* sos autocomplete install
|
|
33
|
+
*
|
|
34
|
+
* # Uninstall auto-completion
|
|
35
|
+
* sos autocomplete uninstall
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @since 2.4.0
|
|
39
|
+
*/
|
|
22
40
|
exports.autocomplete = (0, commandDefinition_1.createCommandDefinition)({
|
|
23
41
|
name: 'autocomplete',
|
|
24
|
-
description: '
|
|
42
|
+
description: 'CLI auto-completion management',
|
|
25
43
|
optionList: exports.OPTION_LIST,
|
|
26
44
|
commands: [installAutocompleteCommand_1.installAutocomplete, uninstallAutocompleteCommand_1.uninstallAutocomplete],
|
|
27
45
|
run() {
|
|
@@ -82,7 +82,7 @@ function generateCompletionScript(rootCommand) {
|
|
|
82
82
|
}
|
|
83
83
|
// Replace placeholders in the shell script
|
|
84
84
|
script = script.replace(/\${TOPLEVEL_COMMANDS}/g, topLevelCommands);
|
|
85
|
-
script = script.replace(/
|
|
85
|
+
script = script.replace(/ {4}# COMMAND_SCHEMA_CASES will be replaced with actual cases during generation/g, commandCases);
|
|
86
86
|
return script;
|
|
87
87
|
}
|
|
88
88
|
function installAutoCompletion(rootCommand) {
|
|
@@ -176,7 +176,7 @@ function displayInstallationMessage(completionFilePath, config) {
|
|
|
176
176
|
message.push('\nUsage examples:');
|
|
177
177
|
message.push(' sos [TAB] # Show all top-level commands');
|
|
178
178
|
message.push(' sos applet [TAB] # Show all applet subcommands');
|
|
179
|
-
console.
|
|
179
|
+
console.info(message.join('\n'));
|
|
180
180
|
}
|
|
181
181
|
// Create a standalone completion setup command
|
|
182
182
|
function setupCompletion(rootCommand) {
|
|
@@ -1,2 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract global API URL option from command line arguments.
|
|
3
|
+
* Parses the global --api-url option that can be used to override the default
|
|
4
|
+
* signageOS REST API endpoint for all CLI operations. This is useful for testing
|
|
5
|
+
* against different environments or custom API deployments.
|
|
6
|
+
*
|
|
7
|
+
* @returns The API URL if specified, undefined otherwise
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```bash
|
|
11
|
+
* # Use custom API URL
|
|
12
|
+
* sos --api-url https://api.custom.signageos.io applet list
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
1
15
|
export declare function getGlobalApiUrl(): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Extract global profile option from command line arguments.
|
|
18
|
+
* Parses the global --profile option that specifies which authentication profile
|
|
19
|
+
* to use for CLI operations. Profiles allow management of multiple signageOS
|
|
20
|
+
* environments or accounts from the same machine.
|
|
21
|
+
*
|
|
22
|
+
* @returns The profile name if specified, falls back to default profile
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```bash
|
|
26
|
+
* # Use specific profile
|
|
27
|
+
* sos --profile production applet list
|
|
28
|
+
*
|
|
29
|
+
* # Use staging profile
|
|
30
|
+
* sos --profile staging device connect
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
*/
|
|
2
35
|
export declare function getGlobalProfile(): string;
|
|
@@ -7,10 +7,43 @@ exports.getGlobalApiUrl = getGlobalApiUrl;
|
|
|
7
7
|
exports.getGlobalProfile = getGlobalProfile;
|
|
8
8
|
const command_line_args_1 = __importDefault(require("command-line-args"));
|
|
9
9
|
const generalCommand_1 = require("../generalCommand");
|
|
10
|
+
/**
|
|
11
|
+
* Extract global API URL option from command line arguments.
|
|
12
|
+
* Parses the global --api-url option that can be used to override the default
|
|
13
|
+
* signageOS REST API endpoint for all CLI operations. This is useful for testing
|
|
14
|
+
* against different environments or custom API deployments.
|
|
15
|
+
*
|
|
16
|
+
* @returns The API URL if specified, undefined otherwise
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```bash
|
|
20
|
+
* # Use custom API URL
|
|
21
|
+
* sos --api-url https://api.custom.signageos.io applet list
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
10
24
|
function getGlobalApiUrl() {
|
|
11
25
|
const options = (0, command_line_args_1.default)([generalCommand_1.API_URL_OPTION], { partial: true });
|
|
12
26
|
return options[generalCommand_1.API_URL_OPTION.name];
|
|
13
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Extract global profile option from command line arguments.
|
|
30
|
+
* Parses the global --profile option that specifies which authentication profile
|
|
31
|
+
* to use for CLI operations. Profiles allow management of multiple signageOS
|
|
32
|
+
* environments or accounts from the same machine.
|
|
33
|
+
*
|
|
34
|
+
* @returns The profile name if specified, falls back to default profile
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```bash
|
|
38
|
+
* # Use specific profile
|
|
39
|
+
* sos --profile production applet list
|
|
40
|
+
*
|
|
41
|
+
* # Use staging profile
|
|
42
|
+
* sos --profile staging device connect
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @since 1.0.0
|
|
46
|
+
*/
|
|
14
47
|
function getGlobalProfile() {
|
|
15
48
|
const options = (0, command_line_args_1.default)([generalCommand_1.PROFILE_OPTION], { partial: true });
|
|
16
49
|
return options[generalCommand_1.PROFILE_OPTION.name];
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a new custom script project with boilerplate code and configuration files.
|
|
3
|
+
* This command sets up a complete development environment for custom script development,
|
|
4
|
+
* including necessary dependencies and project structure.
|
|
5
|
+
*
|
|
6
|
+
* @group Development:1
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```bash
|
|
10
|
+
* # Generate custom script project
|
|
11
|
+
* sos custom-script generate
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://developers.signageos.io/docs/custom-scripts/ Custom Scripts Documentation}
|
|
15
|
+
*
|
|
16
|
+
* @see {@link ../upload/ Upload custom script command}
|
|
17
|
+
*
|
|
18
|
+
* @since 2.2.0
|
|
19
|
+
*/
|
|
1
20
|
export declare const customScriptGenerate: {
|
|
2
21
|
name: "generate";
|
|
3
22
|
description: string;
|
|
@@ -19,9 +19,28 @@ const commandDefinition_1 = require("../../Command/commandDefinition");
|
|
|
19
19
|
const customScriptFacade_1 = require("../customScriptFacade");
|
|
20
20
|
const customScriptGenerateFacade_1 = require("./customScriptGenerateFacade");
|
|
21
21
|
const git_1 = require("../../Lib/git");
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new custom script project with boilerplate code and configuration files.
|
|
24
|
+
* This command sets up a complete development environment for custom script development,
|
|
25
|
+
* including necessary dependencies and project structure.
|
|
26
|
+
*
|
|
27
|
+
* @group Development:1
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```bash
|
|
31
|
+
* # Generate custom script project
|
|
32
|
+
* sos custom-script generate
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see {@link https://developers.signageos.io/docs/custom-scripts/ Custom Scripts Documentation}
|
|
36
|
+
*
|
|
37
|
+
* @see {@link ../upload/ Upload custom script command}
|
|
38
|
+
*
|
|
39
|
+
* @since 2.2.0
|
|
40
|
+
*/
|
|
22
41
|
exports.customScriptGenerate = (0, commandDefinition_1.createCommandDefinition)({
|
|
23
42
|
name: 'generate',
|
|
24
|
-
description: '
|
|
43
|
+
description: 'Generate a local repository for developing a Custom Script',
|
|
25
44
|
optionList: [],
|
|
26
45
|
commands: [],
|
|
27
46
|
run() {
|
|
@@ -2,19 +2,49 @@ import { CommandLineOptions } from '../../Command/commandDefinition';
|
|
|
2
2
|
export declare const OPTION_LIST: readonly [{
|
|
3
3
|
readonly name: "no-default-organization";
|
|
4
4
|
readonly type: BooleanConstructor;
|
|
5
|
-
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc
|
|
5
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
|
|
6
6
|
}, {
|
|
7
7
|
readonly name: "organization-uid";
|
|
8
8
|
readonly type: StringConstructor;
|
|
9
9
|
readonly description: "Organization UID";
|
|
10
10
|
}];
|
|
11
|
+
/**
|
|
12
|
+
* Uploads custom script code and configuration to the signageOS platform based on
|
|
13
|
+
* the .sosconfig.json configuration file. Custom Scripts enable advanced device
|
|
14
|
+
* functionality beyond standard applets, including system-level operations and
|
|
15
|
+
* device-specific configurations for multiple platforms.
|
|
16
|
+
*
|
|
17
|
+
* @group Development:2
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```bash
|
|
21
|
+
* # Upload custom script from current directory
|
|
22
|
+
* sos custom-script upload
|
|
23
|
+
*
|
|
24
|
+
* # Upload with specific organization
|
|
25
|
+
* sos custom-script upload --organization-uid abc123def456
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @throws {Error} When .sosconfig.json is missing or invalid
|
|
29
|
+
* @throws {Error} When script platform configuration is missing
|
|
30
|
+
* @throws {Error} When organization access is denied
|
|
31
|
+
* @throws {Error} When script upload fails
|
|
32
|
+
*
|
|
33
|
+
* @see {@link https://developers.signageos.io/docs/custom-scripts/ Custom Scripts Documentation}
|
|
34
|
+
*
|
|
35
|
+
* @see {@link ../generate/ Generate custom script project}
|
|
36
|
+
*
|
|
37
|
+
* @see {@link ../ Custom Script management commands}
|
|
38
|
+
*
|
|
39
|
+
* @since 1.8.0
|
|
40
|
+
*/
|
|
11
41
|
export declare const customScriptUpload: {
|
|
12
42
|
name: "upload";
|
|
13
43
|
description: string;
|
|
14
44
|
optionList: readonly [{
|
|
15
45
|
readonly name: "no-default-organization";
|
|
16
46
|
readonly type: BooleanConstructor;
|
|
17
|
-
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc
|
|
47
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
|
|
18
48
|
}, {
|
|
19
49
|
readonly name: "organization-uid";
|
|
20
50
|
readonly type: StringConstructor;
|
|
@@ -23,9 +23,39 @@ const organizationFacade_1 = require("../../Organization/organizationFacade");
|
|
|
23
23
|
const customScriptFacade_1 = require("../customScriptFacade");
|
|
24
24
|
const Debug = (0, debug_1.default)('@signageos/cli:CustomScript:Upload:Command');
|
|
25
25
|
exports.OPTION_LIST = [organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION, organizationFacade_1.ORGANIZATION_UID_OPTION];
|
|
26
|
+
/**
|
|
27
|
+
* Uploads custom script code and configuration to the signageOS platform based on
|
|
28
|
+
* the .sosconfig.json configuration file. Custom Scripts enable advanced device
|
|
29
|
+
* functionality beyond standard applets, including system-level operations and
|
|
30
|
+
* device-specific configurations for multiple platforms.
|
|
31
|
+
*
|
|
32
|
+
* @group Development:2
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```bash
|
|
36
|
+
* # Upload custom script from current directory
|
|
37
|
+
* sos custom-script upload
|
|
38
|
+
*
|
|
39
|
+
* # Upload with specific organization
|
|
40
|
+
* sos custom-script upload --organization-uid abc123def456
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @throws {Error} When .sosconfig.json is missing or invalid
|
|
44
|
+
* @throws {Error} When script platform configuration is missing
|
|
45
|
+
* @throws {Error} When organization access is denied
|
|
46
|
+
* @throws {Error} When script upload fails
|
|
47
|
+
*
|
|
48
|
+
* @see {@link https://developers.signageos.io/docs/custom-scripts/ Custom Scripts Documentation}
|
|
49
|
+
*
|
|
50
|
+
* @see {@link ../generate/ Generate custom script project}
|
|
51
|
+
*
|
|
52
|
+
* @see {@link ../ Custom Script management commands}
|
|
53
|
+
*
|
|
54
|
+
* @since 1.8.0
|
|
55
|
+
*/
|
|
26
56
|
exports.customScriptUpload = (0, commandDefinition_1.createCommandDefinition)({
|
|
27
57
|
name: 'upload',
|
|
28
|
-
description: '
|
|
58
|
+
description: 'Upload custom script to the signageOS platform',
|
|
29
59
|
optionList: exports.OPTION_LIST,
|
|
30
60
|
commands: [],
|
|
31
61
|
run(options) {
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides commands for developing and deploying custom scripts to signageOS devices.
|
|
3
|
+
* Custom Scripts enable advanced device functionality beyond standard applets,
|
|
4
|
+
* including system-level operations and device-specific configurations.
|
|
5
|
+
*
|
|
6
|
+
* @group Development:5
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```bash
|
|
10
|
+
* # Generate new custom script project
|
|
11
|
+
* sos custom-script generate
|
|
12
|
+
*
|
|
13
|
+
* # Upload custom script to platform
|
|
14
|
+
* sos custom-script upload
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @see {@link https://developers.signageos.io/docs/custom-scripts/ Custom Scripts Documentation}
|
|
18
|
+
*
|
|
19
|
+
* @since 1.8.0
|
|
20
|
+
*/
|
|
1
21
|
export declare const customScript: {
|
|
2
22
|
name: "custom-script";
|
|
3
23
|
description: string;
|
|
@@ -8,7 +28,7 @@ export declare const customScript: {
|
|
|
8
28
|
optionList: readonly [{
|
|
9
29
|
readonly name: "no-default-organization";
|
|
10
30
|
readonly type: BooleanConstructor;
|
|
11
|
-
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc
|
|
31
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
|
|
12
32
|
}, {
|
|
13
33
|
readonly name: "organization-uid";
|
|
14
34
|
readonly type: StringConstructor;
|
|
@@ -13,6 +13,26 @@ exports.customScript = void 0;
|
|
|
13
13
|
const commandDefinition_1 = require("../Command/commandDefinition");
|
|
14
14
|
const customScriptUploadCommand_1 = require("./Upload/customScriptUploadCommand");
|
|
15
15
|
const customScriptGenerateCommand_1 = require("./Generate/customScriptGenerateCommand");
|
|
16
|
+
/**
|
|
17
|
+
* Provides commands for developing and deploying custom scripts to signageOS devices.
|
|
18
|
+
* Custom Scripts enable advanced device functionality beyond standard applets,
|
|
19
|
+
* including system-level operations and device-specific configurations.
|
|
20
|
+
*
|
|
21
|
+
* @group Development:5
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```bash
|
|
25
|
+
* # Generate new custom script project
|
|
26
|
+
* sos custom-script generate
|
|
27
|
+
*
|
|
28
|
+
* # Upload custom script to platform
|
|
29
|
+
* sos custom-script upload
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://developers.signageos.io/docs/custom-scripts/ Custom Scripts Documentation}
|
|
33
|
+
*
|
|
34
|
+
* @since 1.8.0
|
|
35
|
+
*/
|
|
16
36
|
exports.customScript = (0, commandDefinition_1.createCommandDefinition)({
|
|
17
37
|
name: 'custom-script',
|
|
18
38
|
description: 'Custom Script management',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import RestApi from '@signageos/sdk/dist/RestApi/RestApi';
|
|
3
3
|
import { ICustomScriptVersion } from '@signageos/sdk/dist/RestApi/CustomScript/Version/ICustomScriptVersion';
|
|
4
|
-
declare const PlatformSchema: z.ZodObject<{
|
|
4
|
+
export declare const PlatformSchema: z.ZodObject<{
|
|
5
5
|
/** List of files/directories that are part of the custom script for a particular platform. */
|
|
6
6
|
rootDir: z.ZodString;
|
|
7
7
|
/** Main file of the particular platform script that will be executed. */
|
|
@@ -23,7 +23,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
23
23
|
name: z.ZodString;
|
|
24
24
|
version: z.ZodString;
|
|
25
25
|
description: z.ZodOptional<z.ZodString>;
|
|
26
|
-
dangerLevel: z.ZodString
|
|
26
|
+
dangerLevel: z.ZodOptional<z.ZodString>;
|
|
27
27
|
/**
|
|
28
28
|
* Config of individual custom script implementations for each target platform.
|
|
29
29
|
*
|
|
@@ -50,7 +50,6 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
50
50
|
}, "strip", z.ZodTypeAny, {
|
|
51
51
|
version: string;
|
|
52
52
|
name: string;
|
|
53
|
-
dangerLevel: string;
|
|
54
53
|
platforms: Record<string, {
|
|
55
54
|
rootDir: string;
|
|
56
55
|
mainFile: string;
|
|
@@ -59,10 +58,10 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
59
58
|
configDefinition: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
|
|
60
59
|
description?: string | undefined;
|
|
61
60
|
uid?: string | undefined;
|
|
61
|
+
dangerLevel?: string | undefined;
|
|
62
62
|
}, {
|
|
63
63
|
version: string;
|
|
64
64
|
name: string;
|
|
65
|
-
dangerLevel: string;
|
|
66
65
|
platforms: Record<string, {
|
|
67
66
|
rootDir: string;
|
|
68
67
|
mainFile: string;
|
|
@@ -71,6 +70,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
71
70
|
configDefinition: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
|
|
72
71
|
description?: string | undefined;
|
|
73
72
|
uid?: string | undefined;
|
|
73
|
+
dangerLevel?: string | undefined;
|
|
74
74
|
}>;
|
|
75
75
|
export type CustomScriptConfig = z.infer<typeof ConfigSchema>;
|
|
76
76
|
/**
|
|
@@ -87,7 +87,6 @@ export interface CodeArchive {
|
|
|
87
87
|
export declare function getConfig(workDir: string): Promise<{
|
|
88
88
|
version: string;
|
|
89
89
|
name: string;
|
|
90
|
-
dangerLevel: string;
|
|
91
90
|
platforms: Record<string, {
|
|
92
91
|
rootDir: string;
|
|
93
92
|
mainFile: string;
|
|
@@ -96,6 +95,7 @@ export declare function getConfig(workDir: string): Promise<{
|
|
|
96
95
|
configDefinition: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
|
|
97
96
|
description?: string | undefined;
|
|
98
97
|
uid?: string | undefined;
|
|
98
|
+
dangerLevel?: string | undefined;
|
|
99
99
|
}>;
|
|
100
100
|
/**
|
|
101
101
|
* Add data to the config file .sosconfig.json
|
|
@@ -45,6 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.PlatformSchema = void 0;
|
|
48
49
|
exports.getConfig = getConfig;
|
|
49
50
|
exports.addToConfigFile = addToConfigFile;
|
|
50
51
|
exports.ensureCustomScriptVersion = ensureCustomScriptVersion;
|
|
@@ -61,7 +62,7 @@ const fileSystem_1 = require("../Lib/fileSystem");
|
|
|
61
62
|
const runtimeFileSystem_1 = require("@signageos/sdk/dist/Development/runtimeFileSystem");
|
|
62
63
|
const CONFIG_FILE_NAME = '.sosconfig.json';
|
|
63
64
|
const CUSTOM_SCRIPTS_BUILDS_DIRNAME = 'custom_scripts_builds';
|
|
64
|
-
|
|
65
|
+
exports.PlatformSchema = z.strictObject({
|
|
65
66
|
/** List of files/directories that are part of the custom script for a particular platform. */
|
|
66
67
|
rootDir: z.string(),
|
|
67
68
|
/** Main file of the particular platform script that will be executed. */
|
|
@@ -74,14 +75,14 @@ const ConfigSchema = z.object({
|
|
|
74
75
|
name: z.string(),
|
|
75
76
|
version: z.string(),
|
|
76
77
|
description: z.string().optional(),
|
|
77
|
-
dangerLevel: z.string(),
|
|
78
|
+
dangerLevel: z.string().optional(),
|
|
78
79
|
/**
|
|
79
80
|
* Config of individual custom script implementations for each target platform.
|
|
80
81
|
*
|
|
81
82
|
* A Custom Script is only a virtual unit that consists of multiple platform-specific scripts.
|
|
82
83
|
* This record is a mapping of platform names to their respective platform-specific scripts.
|
|
83
84
|
*/
|
|
84
|
-
platforms: z.record(z.string(), PlatformSchema),
|
|
85
|
+
platforms: z.record(z.string(), exports.PlatformSchema),
|
|
85
86
|
configDefinition: z.array(z.object({}).passthrough()), // outsource validation to API because it's a bit complex
|
|
86
87
|
});
|
|
87
88
|
/**
|
|
@@ -171,7 +172,7 @@ function ensureCustomScript(restApi, config) {
|
|
|
171
172
|
name: config.name,
|
|
172
173
|
title: config.name, // TODO change
|
|
173
174
|
description: config.description,
|
|
174
|
-
dangerLevel: config.dangerLevel,
|
|
175
|
+
dangerLevel: config.dangerLevel ? config.dangerLevel : 'normal', // default to 'normal' if not provided
|
|
175
176
|
});
|
|
176
177
|
// TODO ask for permission or read from CLI arg
|
|
177
178
|
(0, log_1.log)('info', chalk_1.default.yellow('Adding Custom Script uid to the config file'));
|
|
@@ -7,7 +7,7 @@ export declare const USE_FORWARD_SERVER_OPTION: {
|
|
|
7
7
|
declare const OPTION_LIST: readonly [{
|
|
8
8
|
readonly name: "no-default-organization";
|
|
9
9
|
readonly type: BooleanConstructor;
|
|
10
|
-
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc
|
|
10
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
|
|
11
11
|
}, {
|
|
12
12
|
readonly name: "organization-uid";
|
|
13
13
|
readonly type: StringConstructor;
|
|
@@ -56,13 +56,62 @@ declare const OPTION_LIST: readonly [{
|
|
|
56
56
|
readonly type: StringConstructor;
|
|
57
57
|
readonly description: "Path to the applet file or the project folder depending on the entry file. Relative to the command or absolute.";
|
|
58
58
|
}];
|
|
59
|
+
/**
|
|
60
|
+
* Establishes a connection between a signageOS device and the local development environment,
|
|
61
|
+
* allowing real-time testing and debugging of applets during development. Supports both
|
|
62
|
+
* local network (LAN) and forward server connections for different network configurations.
|
|
63
|
+
*
|
|
64
|
+
* The command sets up a development server and configures the device to load the applet
|
|
65
|
+
* from the local machine, enabling hot reload and live debugging capabilities.
|
|
66
|
+
*
|
|
67
|
+
* @group Management:1
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```bash
|
|
71
|
+
* # Connect device with basic configuration
|
|
72
|
+
* sos device connect --device-uid device123 --applet-uid my-applet
|
|
73
|
+
*
|
|
74
|
+
* # Connect with custom server port
|
|
75
|
+
* sos device connect --device-uid device123 --server-port 8080
|
|
76
|
+
*
|
|
77
|
+
* # Connect using forward server (for remote devices)
|
|
78
|
+
* sos device connect --device-uid device123 --use-forward-server
|
|
79
|
+
*
|
|
80
|
+
* # Connect with hot reload enabled
|
|
81
|
+
* sos device connect --device-uid device123 --hot-reload
|
|
82
|
+
*
|
|
83
|
+
* # Connect with custom organization
|
|
84
|
+
* sos device connect --device-uid device123 --organization-uid org456
|
|
85
|
+
*
|
|
86
|
+
* # Connect with custom public URL
|
|
87
|
+
* sos device connect --device-uid device123 --server-public-url https://my-domain.com
|
|
88
|
+
*
|
|
89
|
+
* # Connect and run in background
|
|
90
|
+
* sos device connect --device-uid device123 --detach
|
|
91
|
+
*
|
|
92
|
+
* # Force connection (terminate existing servers)
|
|
93
|
+
* sos device connect --device-uid device123 --force
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @throws {Error} When device or applet cannot be found or accessed
|
|
97
|
+
*
|
|
98
|
+
* @throws {Error} When network connection to device fails
|
|
99
|
+
*
|
|
100
|
+
* @throws {Error} When development server cannot be started
|
|
101
|
+
*
|
|
102
|
+
* @throws {Error} When hot reload configuration is invalid
|
|
103
|
+
*
|
|
104
|
+
* @see {@link https://developers.signageos.io/docs/applets/connect-to-device-cli/ Device Connection and Development Documentation}
|
|
105
|
+
*
|
|
106
|
+
* @since 0.9.0
|
|
107
|
+
*/
|
|
59
108
|
export declare const connect: {
|
|
60
109
|
name: "connect";
|
|
61
110
|
description: string;
|
|
62
111
|
optionList: readonly [{
|
|
63
112
|
readonly name: "no-default-organization";
|
|
64
113
|
readonly type: BooleanConstructor;
|
|
65
|
-
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc
|
|
114
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
|
|
66
115
|
}, {
|
|
67
116
|
readonly name: "organization-uid";
|
|
68
117
|
readonly type: StringConstructor;
|