@signageos/cli 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +27 -1
  2. package/dist/Applet/Build/appletBuildCommand.d.ts +28 -2
  3. package/dist/Applet/Build/appletBuildCommand.js +27 -1
  4. package/dist/Applet/Generate/Templates/index.js.template +1 -1
  5. package/dist/Applet/Generate/Templates/tsconfig.js.template +1 -1
  6. package/dist/Applet/Generate/appletGenerateCommand.d.ts +29 -23
  7. package/dist/Applet/Generate/appletGenerateCommand.js +37 -31
  8. package/dist/Applet/Start/appletStartCommand.d.ts +44 -2
  9. package/dist/Applet/Start/appletStartCommand.js +44 -2
  10. package/dist/Applet/Test/Upload/appletTestRunCommand.d.ts +25 -2
  11. package/dist/Applet/Test/Upload/appletTestRunCommand.js +24 -1
  12. package/dist/Applet/Test/Upload/appletTestUploadCommand.d.ts +34 -4
  13. package/dist/Applet/Test/Upload/appletTestUploadCommand.js +32 -2
  14. package/dist/Applet/Test/appletTestCommand.d.ts +23 -6
  15. package/dist/Applet/Test/appletTestCommand.js +17 -0
  16. package/dist/Applet/Upload/appletUploadCommand.d.ts +46 -4
  17. package/dist/Applet/Upload/appletUploadCommand.js +44 -2
  18. package/dist/Applet/Upload/appletUploadFacade.js +3 -3
  19. package/dist/Applet/appletCommand.d.ts +42 -10
  20. package/dist/Applet/appletCommand.js +33 -1
  21. package/dist/Auth/loginCommand.d.ts +23 -2
  22. package/dist/Auth/loginCommand.js +42 -14
  23. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.d.ts +17 -0
  24. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.js +17 -0
  25. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.ts +17 -0
  26. package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.d.ts +17 -0
  27. package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.js +22 -5
  28. package/dist/Command/Autocomplete/autocompleteCommand.d.ts +18 -0
  29. package/dist/Command/Autocomplete/autocompleteCommand.js +19 -1
  30. package/dist/Command/autoComplete.js +2 -2
  31. package/dist/Command/globalArgs.d.ts +33 -0
  32. package/dist/Command/globalArgs.js +33 -0
  33. package/dist/CustomScript/Generate/customScriptGenerateCommand.d.ts +19 -0
  34. package/dist/CustomScript/Generate/customScriptGenerateCommand.js +20 -1
  35. package/dist/CustomScript/Upload/customScriptUploadCommand.d.ts +32 -2
  36. package/dist/CustomScript/Upload/customScriptUploadCommand.js +31 -1
  37. package/dist/CustomScript/customScriptCommand.d.ts +21 -1
  38. package/dist/CustomScript/customScriptCommand.js +20 -0
  39. package/dist/Device/Connect/connectCommand.d.ts +51 -2
  40. package/dist/Device/Connect/connectCommand.js +50 -1
  41. package/dist/Device/Content/setContentCommand.d.ts +28 -2
  42. package/dist/Device/Content/setContentCommand.js +27 -1
  43. package/dist/Device/PowerAction/powerActionCommand.d.ts +54 -2
  44. package/dist/Device/PowerAction/powerActionCommand.js +52 -0
  45. package/dist/Device/deviceCommand.d.ts +26 -6
  46. package/dist/Device/deviceCommand.js +21 -1
  47. package/dist/Device/deviceFacade.d.ts +1 -1
  48. package/dist/Firmware/Upload/firmwareUploadCommand.d.ts +42 -0
  49. package/dist/Firmware/Upload/firmwareUploadCommand.js +40 -6
  50. package/dist/Firmware/Upload/firmwareUploadFacade.js +1 -1
  51. package/dist/Firmware/firmwareCommand.d.ts +25 -0
  52. package/dist/Firmware/firmwareCommand.js +18 -1
  53. package/dist/Lib/childProcess.js +2 -2
  54. package/dist/Organization/Get/organizationGetCommand.d.ts +31 -2
  55. package/dist/Organization/Get/organizationGetCommand.js +31 -2
  56. package/dist/Organization/List/organizationListCommand.d.ts +20 -0
  57. package/dist/Organization/List/organizationListCommand.js +21 -1
  58. package/dist/Organization/SetDefault/organizationSetDefaultCommand.d.ts +24 -0
  59. package/dist/Organization/SetDefault/organizationSetDefaultCommand.js +25 -1
  60. package/dist/Organization/organizationCommand.d.ts +27 -2
  61. package/dist/Organization/organizationCommand.js +26 -1
  62. package/dist/Organization/organizationFacade.d.ts +2 -2
  63. package/dist/Organization/organizationFacade.js +3 -3
  64. package/dist/Timing/List/timingListCommand.d.ts +26 -2
  65. package/dist/Timing/List/timingListCommand.js +26 -2
  66. package/dist/Timing/timingCommand.d.ts +17 -2
  67. package/dist/Timing/timingCommand.js +15 -0
  68. package/dist/helper.d.ts +5 -5
  69. package/dist/helper.js +4 -6
  70. package/dist/index.js +23 -1
  71. package/docs/applet/build/index.md +74 -0
  72. package/docs/applet/generate/index.md +118 -0
  73. package/docs/applet/index.md +134 -0
  74. package/docs/applet/start/index.md +104 -0
  75. package/docs/applet/test/index.md +91 -0
  76. package/docs/applet/test/run/index.md +82 -0
  77. package/docs/applet/test/upload/index.md +80 -0
  78. package/docs/applet/upload/index.md +131 -0
  79. package/docs/autocomplete/index.md +92 -0
  80. package/docs/autocomplete/install/index.md +120 -0
  81. package/docs/autocomplete/uninstall/index.md +65 -0
  82. package/docs/custom-script/generate/index.md +66 -0
  83. package/docs/custom-script/index.md +96 -0
  84. package/docs/custom-script/upload/index.md +78 -0
  85. package/docs/device/connect/index.md +148 -0
  86. package/docs/device/index.md +105 -0
  87. package/docs/device/power-action/index.md +130 -0
  88. package/docs/device/set-content/index.md +72 -0
  89. package/docs/index.md +168 -0
  90. package/docs/login/index.md +122 -0
  91. package/docs/organization/get/index.md +79 -0
  92. package/docs/organization/index.md +105 -0
  93. package/docs/organization/list/index.md +65 -0
  94. package/docs/organization/set-default/index.md +74 -0
  95. package/docs/timing/index.md +78 -0
  96. package/docs/timing/list/index.md +71 -0
  97. package/package.json +29 -19
@@ -1,3 +1,20 @@
1
+ /**
2
+ * Provides commands for testing applets on the signageOS platform, including
3
+ * uploading test configurations and running remote tests on actual devices.
4
+ *
5
+ * @group Development:4
6
+ *
7
+ * @example
8
+ * ```bash
9
+ * # Upload test configuration
10
+ * sos applet test upload
11
+ *
12
+ * # Run tests remotely
13
+ * sos applet test run
14
+ * ```
15
+ *
16
+ * @since 0.10.0
17
+ */
1
18
  export declare const appletTest: {
2
19
  name: "test";
3
20
  description: string;
@@ -8,7 +25,7 @@ export declare const appletTest: {
8
25
  optionList: readonly [{
9
26
  readonly name: "no-default-organization";
10
27
  readonly type: BooleanConstructor;
11
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
28
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
12
29
  }, {
13
30
  readonly name: "device-uid";
14
31
  readonly type: StringConstructor;
@@ -35,7 +52,7 @@ export declare const appletTest: {
35
52
  run(options: import("../../Command/commandDefinition").CommandLineOptions<readonly [{
36
53
  readonly name: "no-default-organization";
37
54
  readonly type: BooleanConstructor;
38
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
55
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
39
56
  }, {
40
57
  readonly name: "device-uid";
41
58
  readonly type: StringConstructor;
@@ -64,7 +81,7 @@ export declare const appletTest: {
64
81
  optionList: readonly [{
65
82
  readonly name: "no-default-organization";
66
83
  readonly type: BooleanConstructor;
67
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
84
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
68
85
  }, {
69
86
  readonly name: "organization-uid";
70
87
  readonly type: StringConstructor;
@@ -80,13 +97,13 @@ export declare const appletTest: {
80
97
  }, {
81
98
  readonly name: "verbose";
82
99
  readonly type: BooleanConstructor;
83
- readonly description: "outputs all files to upload";
100
+ readonly description: "Outputs all files to upload";
84
101
  }];
85
102
  commands: never[];
86
103
  run(options: import("../../Command/commandDefinition").CommandLineOptions<readonly [{
87
104
  readonly name: "no-default-organization";
88
105
  readonly type: BooleanConstructor;
89
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
106
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
90
107
  }, {
91
108
  readonly name: "organization-uid";
92
109
  readonly type: StringConstructor;
@@ -102,7 +119,7 @@ export declare const appletTest: {
102
119
  }, {
103
120
  readonly name: "verbose";
104
121
  readonly type: BooleanConstructor;
105
- readonly description: "outputs all files to upload";
122
+ readonly description: "Outputs all files to upload";
106
123
  }]>): Promise<void>;
107
124
  })[];
108
125
  run(): Promise<never>;
@@ -13,6 +13,23 @@ exports.appletTest = void 0;
13
13
  const commandDefinition_1 = require("../../Command/commandDefinition");
14
14
  const appletTestRunCommand_1 = require("./Upload/appletTestRunCommand");
15
15
  const appletTestUploadCommand_1 = require("./Upload/appletTestUploadCommand");
16
+ /**
17
+ * Provides commands for testing applets on the signageOS platform, including
18
+ * uploading test configurations and running remote tests on actual devices.
19
+ *
20
+ * @group Development:4
21
+ *
22
+ * @example
23
+ * ```bash
24
+ * # Upload test configuration
25
+ * sos applet test upload
26
+ *
27
+ * # Run tests remotely
28
+ * sos applet test run
29
+ * ```
30
+ *
31
+ * @since 0.10.0
32
+ */
16
33
  exports.appletTest = (0, commandDefinition_1.createCommandDefinition)({
17
34
  name: 'test',
18
35
  description: 'Applet test management',
@@ -10,7 +10,7 @@ export declare const OPTION_LIST: readonly [{
10
10
  }, {
11
11
  readonly name: "no-default-organization";
12
12
  readonly type: BooleanConstructor;
13
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
13
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
14
14
  }, {
15
15
  readonly name: "organization-uid";
16
16
  readonly type: StringConstructor;
@@ -30,8 +30,50 @@ export declare const OPTION_LIST: readonly [{
30
30
  }, {
31
31
  readonly name: "verbose";
32
32
  readonly type: BooleanConstructor;
33
- readonly description: "outputs all files to upload";
33
+ readonly description: "Outputs all files to upload";
34
34
  }];
35
+ /**
36
+ * Uploads the current applet version to the signageOS platform, making it available
37
+ * for deployment to devices. The command supports both single-file and multi-file applets,
38
+ * with automatic version management and conflict detection.
39
+ *
40
+ * The upload process validates package.json requirements, creates or updates applet versions,
41
+ * and handles file packaging according to .sosignore, .npmignore, and .gitignore rules.
42
+ *
43
+ * @group Development:5
44
+ *
45
+ * @example
46
+ * ```bash
47
+ * # Upload applet from current directory
48
+ * sos applet upload
49
+ *
50
+ * # Upload with specific applet path
51
+ * sos applet upload --applet-path ./dist
52
+ *
53
+ * # Upload with custom entry file
54
+ * sos applet upload --entry-file-path src/main.js
55
+ *
56
+ * # Upload with organization override
57
+ * sos applet upload --organization-uid abc123def456
58
+ *
59
+ * # Skip confirmation prompts
60
+ * sos applet upload --yes
61
+ *
62
+ * # Verbose output with detailed file information
63
+ * sos applet upload --verbose
64
+ *
65
+ * # Update package.json with new applet UID
66
+ * sos applet upload --update-package-config
67
+ * ```
68
+ *
69
+ * @throws {Error} When package.json is missing or invalid
70
+ * @throws {Error} When applet path or entry file cannot be found
71
+ * @throws {Error} When organization or applet access is denied
72
+ * @throws {GatewayError} When upload fails due to server issues
73
+ * @throws {NotFoundError} When specified applet or organization doesn't exist
74
+ *
75
+ * @since 0.4.0
76
+ */
35
77
  export declare const appletUpload: {
36
78
  name: "upload";
37
79
  description: string;
@@ -46,7 +88,7 @@ export declare const appletUpload: {
46
88
  }, {
47
89
  readonly name: "no-default-organization";
48
90
  readonly type: BooleanConstructor;
49
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
91
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
50
92
  }, {
51
93
  readonly name: "organization-uid";
52
94
  readonly type: StringConstructor;
@@ -66,7 +108,7 @@ export declare const appletUpload: {
66
108
  }, {
67
109
  readonly name: "verbose";
68
110
  readonly type: BooleanConstructor;
69
- readonly description: "outputs all files to upload";
111
+ readonly description: "Outputs all files to upload";
70
112
  }];
71
113
  commands: never[];
72
114
  run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
@@ -50,9 +50,51 @@ exports.OPTION_LIST = [
50
50
  {
51
51
  name: 'verbose',
52
52
  type: Boolean,
53
- description: `outputs all files to upload`,
53
+ description: `Outputs all files to upload`,
54
54
  },
55
55
  ];
56
+ /**
57
+ * Uploads the current applet version to the signageOS platform, making it available
58
+ * for deployment to devices. The command supports both single-file and multi-file applets,
59
+ * with automatic version management and conflict detection.
60
+ *
61
+ * The upload process validates package.json requirements, creates or updates applet versions,
62
+ * and handles file packaging according to .sosignore, .npmignore, and .gitignore rules.
63
+ *
64
+ * @group Development:5
65
+ *
66
+ * @example
67
+ * ```bash
68
+ * # Upload applet from current directory
69
+ * sos applet upload
70
+ *
71
+ * # Upload with specific applet path
72
+ * sos applet upload --applet-path ./dist
73
+ *
74
+ * # Upload with custom entry file
75
+ * sos applet upload --entry-file-path src/main.js
76
+ *
77
+ * # Upload with organization override
78
+ * sos applet upload --organization-uid abc123def456
79
+ *
80
+ * # Skip confirmation prompts
81
+ * sos applet upload --yes
82
+ *
83
+ * # Verbose output with detailed file information
84
+ * sos applet upload --verbose
85
+ *
86
+ * # Update package.json with new applet UID
87
+ * sos applet upload --update-package-config
88
+ * ```
89
+ *
90
+ * @throws {Error} When package.json is missing or invalid
91
+ * @throws {Error} When applet path or entry file cannot be found
92
+ * @throws {Error} When organization or applet access is denied
93
+ * @throws {GatewayError} When upload fails due to server issues
94
+ * @throws {NotFoundError} When specified applet or organization doesn't exist
95
+ *
96
+ * @since 0.4.0
97
+ */
56
98
  exports.appletUpload = (0, commandDefinition_1.createCommandDefinition)({
57
99
  name: 'upload',
58
100
  description: 'Uploads current applet version',
@@ -90,9 +132,9 @@ exports.appletUpload = (0, commandDefinition_1.createCommandDefinition)({
90
132
  if (!(error instanceof appletErrors_1.AppletDoesNotExistError)) {
91
133
  throw error;
92
134
  }
93
- (0, log_1.log)('info', chalk_1.default.yellow(`applet uid is not present in package file, adding one.`));
94
135
  const createdApplet = yield restApi.applet.create({ name: appletName });
95
136
  appletUid = createdApplet.uid;
137
+ (0, log_1.log)('info', chalk_1.default.yellow(`Applet uid is not present in package file.`, chalk_1.default.blue(`\nCreated new uid:`), chalk_1.default.green(appletUid)), `\n`);
96
138
  }
97
139
  finally {
98
140
  if (updatePackageConfig) {
@@ -71,8 +71,8 @@ const updateMultiFileApplet = (parameters) => __awaiter(void 0, void 0, void 0,
71
71
  const { restApi, applet, progressBar } = parameters;
72
72
  const currentAppletFiles = yield (0, appletUploadFacadeHelper_1.getAppletFilesDictionary)(restApi, applet.uid, applet.version);
73
73
  let changedFilesCounter = 0;
74
- for (let index = 0; index < applet.files.length; index++) {
75
- const fileAbsolutePath = applet.files[index];
74
+ for (const element of applet.files) {
75
+ const fileAbsolutePath = element;
76
76
  if (!fileAbsolutePath) {
77
77
  continue;
78
78
  }
@@ -120,7 +120,7 @@ const updateMultiFileApplet = (parameters) => __awaiter(void 0, void 0, void 0,
120
120
  }
121
121
  }
122
122
  for (const fileRelativePath in currentAppletFiles) {
123
- if (currentAppletFiles.hasOwnProperty(fileRelativePath)) {
123
+ if (Object.prototype.hasOwnProperty.call(currentAppletFiles, fileRelativePath)) {
124
124
  try {
125
125
  yield restApi.applet.version.file.remove(applet.uid, applet.version, fileRelativePath, { build: false });
126
126
  }
@@ -1,3 +1,35 @@
1
+ /**
2
+ * Provides comprehensive commands for the complete applet development lifecycle including
3
+ * project generation, development, building, testing, uploading, and deployment to signageOS devices.
4
+ *
5
+ * @group Development:2
6
+ *
7
+ * @subcommands
8
+ * - `generate` - Create a new applet project with boilerplate code
9
+ * - `start` - Start local development server with hot reload
10
+ * - `build` - Build applet for production deployment
11
+ * - `upload` - Upload applet to signageOS platform
12
+ * - `test` - Run and upload applet tests
13
+ *
14
+ * @example
15
+ * ```bash
16
+ * # Create new applet project
17
+ * sos applet generate --name my-applet
18
+ *
19
+ * # Start development server
20
+ * sos applet start
21
+ *
22
+ * # Build for production
23
+ * sos applet build
24
+ *
25
+ * # Upload to platform
26
+ * sos applet upload
27
+ * ```
28
+ *
29
+ * @see {@link https://developers.signageos.io/docs/applets/ Applet Documentation}
30
+ *
31
+ * @since 0.1.0
32
+ */
1
33
  export declare const applet: {
2
34
  name: "applet";
3
35
  description: string;
@@ -42,7 +74,7 @@ export declare const applet: {
42
74
  }, {
43
75
  readonly name: "no-default-organization";
44
76
  readonly type: BooleanConstructor;
45
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
77
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
46
78
  }, {
47
79
  readonly name: "organization-uid";
48
80
  readonly type: StringConstructor;
@@ -62,7 +94,7 @@ export declare const applet: {
62
94
  }, {
63
95
  readonly name: "verbose";
64
96
  readonly type: BooleanConstructor;
65
- readonly description: "outputs all files to upload";
97
+ readonly description: "Outputs all files to upload";
66
98
  }];
67
99
  commands: never[];
68
100
  run(options: import("../Command/commandDefinition").CommandLineOptions<typeof import("./Upload/appletUploadCommand").OPTION_LIST>): Promise<void>;
@@ -72,7 +104,7 @@ export declare const applet: {
72
104
  optionList: readonly [{
73
105
  readonly name: "no-default-organization";
74
106
  readonly type: BooleanConstructor;
75
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
107
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
76
108
  }, {
77
109
  readonly name: "organization-uid";
78
110
  readonly type: StringConstructor;
@@ -130,7 +162,7 @@ export declare const applet: {
130
162
  optionList: readonly [{
131
163
  readonly name: "no-default-organization";
132
164
  readonly type: BooleanConstructor;
133
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
165
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
134
166
  }, {
135
167
  readonly name: "device-uid";
136
168
  readonly type: StringConstructor;
@@ -157,7 +189,7 @@ export declare const applet: {
157
189
  run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
158
190
  readonly name: "no-default-organization";
159
191
  readonly type: BooleanConstructor;
160
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
192
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
161
193
  }, {
162
194
  readonly name: "device-uid";
163
195
  readonly type: StringConstructor;
@@ -186,7 +218,7 @@ export declare const applet: {
186
218
  optionList: readonly [{
187
219
  readonly name: "no-default-organization";
188
220
  readonly type: BooleanConstructor;
189
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
221
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
190
222
  }, {
191
223
  readonly name: "organization-uid";
192
224
  readonly type: StringConstructor;
@@ -202,13 +234,13 @@ export declare const applet: {
202
234
  }, {
203
235
  readonly name: "verbose";
204
236
  readonly type: BooleanConstructor;
205
- readonly description: "outputs all files to upload";
237
+ readonly description: "Outputs all files to upload";
206
238
  }];
207
239
  commands: never[];
208
240
  run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
209
241
  readonly name: "no-default-organization";
210
242
  readonly type: BooleanConstructor;
211
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
243
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
212
244
  }, {
213
245
  readonly name: "organization-uid";
214
246
  readonly type: StringConstructor;
@@ -224,7 +256,7 @@ export declare const applet: {
224
256
  }, {
225
257
  readonly name: "verbose";
226
258
  readonly type: BooleanConstructor;
227
- readonly description: "outputs all files to upload";
259
+ readonly description: "Outputs all files to upload";
228
260
  }]>): Promise<void>;
229
261
  })[];
230
262
  run(): Promise<never>;
@@ -234,7 +266,7 @@ export declare const applet: {
234
266
  optionList: readonly [{
235
267
  readonly name: "no-default-organization";
236
268
  readonly type: BooleanConstructor;
237
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
269
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
238
270
  }, {
239
271
  readonly name: "organization-uid";
240
272
  readonly type: StringConstructor;
@@ -16,9 +16,41 @@ const appletStartCommand_1 = require("./Start/appletStartCommand");
16
16
  const appletTestCommand_1 = require("./Test/appletTestCommand");
17
17
  const commandDefinition_1 = require("../Command/commandDefinition");
18
18
  const appletBuildCommand_1 = require("./Build/appletBuildCommand");
19
+ /**
20
+ * Provides comprehensive commands for the complete applet development lifecycle including
21
+ * project generation, development, building, testing, uploading, and deployment to signageOS devices.
22
+ *
23
+ * @group Development:2
24
+ *
25
+ * @subcommands
26
+ * - `generate` - Create a new applet project with boilerplate code
27
+ * - `start` - Start local development server with hot reload
28
+ * - `build` - Build applet for production deployment
29
+ * - `upload` - Upload applet to signageOS platform
30
+ * - `test` - Run and upload applet tests
31
+ *
32
+ * @example
33
+ * ```bash
34
+ * # Create new applet project
35
+ * sos applet generate --name my-applet
36
+ *
37
+ * # Start development server
38
+ * sos applet start
39
+ *
40
+ * # Build for production
41
+ * sos applet build
42
+ *
43
+ * # Upload to platform
44
+ * sos applet upload
45
+ * ```
46
+ *
47
+ * @see {@link https://developers.signageos.io/docs/applets/ Applet Documentation}
48
+ *
49
+ * @since 0.1.0
50
+ */
19
51
  exports.applet = (0, commandDefinition_1.createCommandDefinition)({
20
52
  name: 'applet',
21
- description: 'Applet management',
53
+ description: 'Applet development and management operations',
22
54
  optionList: [],
23
55
  commands: [appletGenerateCommand_1.appletGenerate, appletUploadCommand_1.appletUpload, appletStartCommand_1.appletStart, appletTestCommand_1.appletTest, appletBuildCommand_1.appletBuild],
24
56
  run() {
@@ -2,7 +2,7 @@ import { CommandLineOptions } from '../Command/commandDefinition';
2
2
  declare const OPTION_LIST: readonly [{
3
3
  readonly name: "username";
4
4
  readonly type: StringConstructor;
5
- readonly description: `Username or e-mail used for ${string}`;
5
+ readonly description: "Username or e-mail used for authentication";
6
6
  }];
7
7
  /**
8
8
  * To explicitly enable auth0 authentication add flag --auth0-enabled to command line options
@@ -17,13 +17,34 @@ export declare const getIsAuth0OrLegacyEnabled: (options: any) => {
17
17
  isAuth0Enabled?: boolean;
18
18
  isLegacyEnabled?: boolean;
19
19
  };
20
+ /**
21
+ * Handles user authentication using username/email and password credentials.
22
+ * Supports both Auth0 and legacy authentication methods. Stores credentials
23
+ * securely in the ~/.sosrc configuration file for subsequent CLI operations.
24
+ *
25
+ * @group Authentication:1
26
+ *
27
+ * @example
28
+ * ```bash
29
+ * # Interactive login (prompts for username and password)
30
+ * sos login
31
+ *
32
+ * # Login with username specified
33
+ * sos login --username user@example.com
34
+ * ```
35
+ *
36
+ * @throws {Error} When username is missing and not provided interactively
37
+ * @throws {Error} When both Auth0 and legacy authentication flags are specified
38
+ *
39
+ * @since 0.3.0
40
+ */
20
41
  export declare const login: {
21
42
  name: "login";
22
43
  description: string;
23
44
  optionList: readonly [{
24
45
  readonly name: "username";
25
46
  readonly type: StringConstructor;
26
- readonly description: `Username or e-mail used for ${string}`;
47
+ readonly description: "Username or e-mail used for authentication";
27
48
  }];
28
49
  commands: never[];
29
50
  run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
@@ -58,7 +58,7 @@ const runControlHelper_1 = require("../RunControl/runControlHelper");
58
58
  const parameters_1 = require("../parameters");
59
59
  const commandDefinition_1 = require("../Command/commandDefinition");
60
60
  const Debug = (0, debug_1.default)('@signageos/cli:Auth:login');
61
- const OPTION_LIST = [{ name: 'username', type: String, description: `Username or e-mail used for ${parameters_1.parameters.boxHost}` }];
61
+ const OPTION_LIST = [{ name: 'username', type: String, description: `Username or e-mail used for authentication` }];
62
62
  /**
63
63
  * To explicitly enable auth0 authentication add flag --auth0-enabled to command line options
64
64
  * { _unknown: [ '--auth0-enabled' ], command: [ 'login' ] }
@@ -83,19 +83,45 @@ const getIsAuth0OrLegacyEnabled = (options) => {
83
83
  return queryParams;
84
84
  };
85
85
  exports.getIsAuth0OrLegacyEnabled = getIsAuth0OrLegacyEnabled;
86
+ /**
87
+ * Handles user authentication using username/email and password credentials.
88
+ * Supports both Auth0 and legacy authentication methods. Stores credentials
89
+ * securely in the ~/.sosrc configuration file for subsequent CLI operations.
90
+ *
91
+ * @group Authentication:1
92
+ *
93
+ * @example
94
+ * ```bash
95
+ * # Interactive login (prompts for username and password)
96
+ * sos login
97
+ *
98
+ * # Login with username specified
99
+ * sos login --username user@example.com
100
+ * ```
101
+ *
102
+ * @throws {Error} When username is missing and not provided interactively
103
+ * @throws {Error} When both Auth0 and legacy authentication flags are specified
104
+ *
105
+ * @since 0.3.0
106
+ */
86
107
  exports.login = (0, commandDefinition_1.createCommandDefinition)({
87
108
  name: 'login',
88
- description: 'Login account using username & password',
109
+ description: 'Authenticate user with signageOS',
89
110
  optionList: OPTION_LIST,
90
111
  commands: [],
91
112
  run(options) {
92
113
  return __awaiter(this, void 0, void 0, function* () {
93
114
  let identification = options.username;
115
+ const config = yield (0, runControlHelper_1.loadConfig)();
116
+ const apiUrl = (0, helper_1.getApiUrl)(config);
117
+ // Extract domain from API URL to show in prompts
118
+ const apiUrlObj = new URL(apiUrl);
119
+ const hostToDisplay = apiUrlObj.hostname;
94
120
  if (!identification) {
95
121
  const response = yield (0, prompts_1.default)({
96
122
  type: 'text',
97
123
  name: 'username',
98
- message: `Type your username or e-mail used for ${parameters_1.parameters.boxHost}`,
124
+ message: `Type your username or e-mail used for ${hostToDisplay}`,
99
125
  });
100
126
  identification = response.username;
101
127
  }
@@ -105,10 +131,8 @@ exports.login = (0, commandDefinition_1.createCommandDefinition)({
105
131
  const { password } = yield (0, prompts_1.default)({
106
132
  type: 'password',
107
133
  name: 'password',
108
- message: `Type your password used for ${parameters_1.parameters.boxHost}`,
134
+ message: `Type your password used for ${hostToDisplay}`,
109
135
  });
110
- const config = yield (0, runControlHelper_1.loadConfig)();
111
- const apiUrl = (0, helper_1.getApiUrl)(config);
112
136
  const authQueryParams = (0, exports.getIsAuth0OrLegacyEnabled)(options);
113
137
  const { id: tokenId, securityToken: apiSecurityToken, name, } = yield getOrCreateApiSecurityToken(Object.assign({ identification,
114
138
  password,
@@ -124,6 +148,7 @@ exports.login = (0, commandDefinition_1.createCommandDefinition)({
124
148
  });
125
149
  function getOrCreateApiSecurityToken(_a) {
126
150
  return __awaiter(this, arguments, void 0, function* ({ identification, password, apiUrl, isAuth0Enabled, isLegacyEnabled, }) {
151
+ var _b;
127
152
  const ACCOUNT_SECURITY_TOKEN_RESOURCE = 'account/security-token';
128
153
  const options = {
129
154
  url: apiUrl,
@@ -131,19 +156,22 @@ function getOrCreateApiSecurityToken(_a) {
131
156
  version: apiVersions_1.ApiVersions.V1,
132
157
  };
133
158
  const tokenName = generateTokenName();
134
- const query = Object.assign(Object.assign({ identification,
159
+ const requestBody = Object.assign(Object.assign({ identification,
135
160
  password, name: tokenName }, (isAuth0Enabled !== undefined ? { isAuth0AuthenticationEnabled: isAuth0Enabled } : {})), (isLegacyEnabled !== undefined ? { isLegacyAuthenticationEnabled: isLegacyEnabled } : {}));
136
- const responseOfPost = yield (0, helper_1.postResource)(options, ACCOUNT_SECURITY_TOKEN_RESOURCE, query);
137
- const bodyOfPost = JSON.parse(yield responseOfPost.text(), helper_1.deserializeJSON);
138
- Debug('POST security-token response', bodyOfPost);
139
- if (responseOfPost.status === 201) {
140
- return bodyOfPost;
161
+ const response = yield (0, helper_1.postResource)(options, ACCOUNT_SECURITY_TOKEN_RESOURCE, null, requestBody);
162
+ const responseBody = JSON.parse(yield response.text(), helper_1.deserializeJSON);
163
+ // Don't log sensitive response data
164
+ Debug('POST security-token response status', response.status);
165
+ if (response.status === 201) {
166
+ return responseBody;
141
167
  }
142
- else if (responseOfPost.status === 403) {
168
+ else if (response.status === 403) {
143
169
  throw new Error(`Incorrect username or password`);
144
170
  }
145
171
  else {
146
- throw new Error('Unknown error: ' + (bodyOfPost && bodyOfPost.message ? bodyOfPost.message : responseOfPost.status));
172
+ // Ensure password is not logged in error messages
173
+ const errorMessage = (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.message) !== null && _b !== void 0 ? _b : `HTTP status ${response.status}`;
174
+ throw new Error('Unknown error: ' + errorMessage);
147
175
  }
148
176
  });
149
177
  }
@@ -1,6 +1,23 @@
1
1
  import { ICommand, OptionList } from '../../commandDefinition';
2
2
  export declare const OPTION_LIST: readonly [];
3
3
  export declare const setRootCommand: (rootCommand: ICommand<string, OptionList>) => void;
4
+ /**
5
+ * Enables auto-completion functionality for the signageOS CLI in supported shells.
6
+ * This command adds auto-completion scripts and configuration to the user's shell
7
+ * profile, allowing tab completion for commands and sub-commands.
8
+ *
9
+ * @group Tools:1
10
+ *
11
+ * @example
12
+ * ```bash
13
+ * # Install auto-completion
14
+ * sos autocomplete install
15
+ * ```
16
+ *
17
+ * @see {@link ../uninstall/ Uninstall auto-completion command}
18
+ *
19
+ * @since 2.4.0
20
+ */
4
21
  export declare const installAutocomplete: {
5
22
  name: "install";
6
23
  description: string;
@@ -20,6 +20,23 @@ const setRootCommand = (rootCommand) => {
20
20
  rootCommandRef = rootCommand;
21
21
  };
22
22
  exports.setRootCommand = setRootCommand;
23
+ /**
24
+ * Enables auto-completion functionality for the signageOS CLI in supported shells.
25
+ * This command adds auto-completion scripts and configuration to the user's shell
26
+ * profile, allowing tab completion for commands and sub-commands.
27
+ *
28
+ * @group Tools:1
29
+ *
30
+ * @example
31
+ * ```bash
32
+ * # Install auto-completion
33
+ * sos autocomplete install
34
+ * ```
35
+ *
36
+ * @see {@link ../uninstall/ Uninstall auto-completion command}
37
+ *
38
+ * @since 2.4.0
39
+ */
23
40
  exports.installAutocomplete = (0, commandDefinition_1.createCommandDefinition)({
24
41
  name: 'install',
25
42
  description: 'Install command auto-completion for bash/zsh shells',
@@ -11,6 +11,23 @@ export const setRootCommand = (rootCommand: ICommand<string, OptionList>): void
11
11
  rootCommandRef = rootCommand;
12
12
  };
13
13
 
14
+ /**
15
+ * Enables auto-completion functionality for the signageOS CLI in supported shells.
16
+ * This command adds auto-completion scripts and configuration to the user's shell
17
+ * profile, allowing tab completion for commands and sub-commands.
18
+ *
19
+ * @group Tools:1
20
+ *
21
+ * @example
22
+ * ```bash
23
+ * # Install auto-completion
24
+ * sos autocomplete install
25
+ * ```
26
+ *
27
+ * @see {@link ../uninstall/ Uninstall auto-completion command}
28
+ *
29
+ * @since 2.4.0
30
+ */
14
31
  export const installAutocomplete = createCommandDefinition({
15
32
  name: 'install',
16
33
  description: 'Install command auto-completion for bash/zsh shells',