@signageos/cli 2.4.1 → 2.5.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 (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 +38 -32
  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
@@ -4,6 +4,30 @@ declare const OPTION_LIST: readonly [{
4
4
  readonly type: StringConstructor;
5
5
  readonly description: "Organization UID";
6
6
  }];
7
+ /**
8
+ * Sets a default organization that will be used automatically in subsequent CLI commands
9
+ * that require an organization context. This eliminates the need to specify the organization
10
+ * UID for each command. The default organization is stored in the ~/.sosrc configuration file.
11
+ *
12
+ * @group Management:3
13
+ *
14
+ * @example
15
+ * ```bash
16
+ * # Interactive selection of default organization
17
+ * sos organization set-default
18
+ *
19
+ * # Set specific organization as default
20
+ * sos organization set-default --organization-uid abc123
21
+ * ```
22
+ *
23
+ * @remarks
24
+ * The default organization can be overridden using the SOS_ORGANIZATION_UID environment variable
25
+ * or by using the --organization-uid flag in individual commands.
26
+ *
27
+ * @throws {Error} When organization UID is invalid or inaccessible
28
+ *
29
+ * @since 1.0.0
30
+ */
7
31
  export declare const organizationSetDefault: {
8
32
  name: "set-default";
9
33
  description: string;
@@ -21,9 +21,33 @@ const commandDefinition_1 = require("../../Command/commandDefinition");
21
21
  const log_1 = require("@signageos/sdk/dist/Console/log");
22
22
  const Debug = (0, debug_1.default)('@signageos/cli:Organization:get');
23
23
  const OPTION_LIST = [organizationFacade_1.ORGANIZATION_UID_OPTION];
24
+ /**
25
+ * Sets a default organization that will be used automatically in subsequent CLI commands
26
+ * that require an organization context. This eliminates the need to specify the organization
27
+ * UID for each command. The default organization is stored in the ~/.sosrc configuration file.
28
+ *
29
+ * @group Management:3
30
+ *
31
+ * @example
32
+ * ```bash
33
+ * # Interactive selection of default organization
34
+ * sos organization set-default
35
+ *
36
+ * # Set specific organization as default
37
+ * sos organization set-default --organization-uid abc123
38
+ * ```
39
+ *
40
+ * @remarks
41
+ * The default organization can be overridden using the SOS_ORGANIZATION_UID environment variable
42
+ * or by using the --organization-uid flag in individual commands.
43
+ *
44
+ * @throws {Error} When organization UID is invalid or inaccessible
45
+ *
46
+ * @since 1.0.0
47
+ */
24
48
  exports.organizationSetDefault = (0, commandDefinition_1.createCommandDefinition)({
25
49
  name: 'set-default',
26
- description: 'Set default organization to use',
50
+ description: 'Set a default organization for CLI operations',
27
51
  optionList: OPTION_LIST,
28
52
  commands: [],
29
53
  run(options) {
@@ -1,3 +1,28 @@
1
+ /**
2
+ * Provides commands to manage signageOS organizations including listing available organizations,
3
+ * retrieving organization details, and setting default organization for CLI operations.
4
+ *
5
+ * @group Management:6
6
+ *
7
+ * @subcommands
8
+ * - `list` - List all organizations accessible to the current user
9
+ * - `get` - Get details of a specific organization by UID
10
+ * - `set-default` - Set a default organization for CLI operations
11
+ *
12
+ * @example
13
+ * ```bash
14
+ * # List all organizations
15
+ * sos organization list
16
+ *
17
+ * # Get specific organization details
18
+ * sos organization get --organization-uid abc123
19
+ *
20
+ * # Set default organization
21
+ * sos organization set-default
22
+ * ```
23
+ *
24
+ * @since 0.3.0
25
+ */
1
26
  export declare const organization: {
2
27
  name: "organization";
3
28
  description: string;
@@ -14,7 +39,7 @@ export declare const organization: {
14
39
  optionList: readonly [{
15
40
  readonly name: "no-default-organization";
16
41
  readonly type: BooleanConstructor;
17
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
42
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
18
43
  }, {
19
44
  readonly name: "organization-uid";
20
45
  readonly type: StringConstructor;
@@ -24,7 +49,7 @@ export declare const organization: {
24
49
  run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
25
50
  readonly name: "no-default-organization";
26
51
  readonly type: BooleanConstructor;
27
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
52
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
28
53
  }, {
29
54
  readonly name: "organization-uid";
30
55
  readonly type: StringConstructor;
@@ -14,9 +14,34 @@ const organizationListCommand_1 = require("./List/organizationListCommand");
14
14
  const organizationGetCommand_1 = require("./Get/organizationGetCommand");
15
15
  const organizationSetDefaultCommand_1 = require("./SetDefault/organizationSetDefaultCommand");
16
16
  const commandDefinition_1 = require("../Command/commandDefinition");
17
+ /**
18
+ * Provides commands to manage signageOS organizations including listing available organizations,
19
+ * retrieving organization details, and setting default organization for CLI operations.
20
+ *
21
+ * @group Management:6
22
+ *
23
+ * @subcommands
24
+ * - `list` - List all organizations accessible to the current user
25
+ * - `get` - Get details of a specific organization by UID
26
+ * - `set-default` - Set a default organization for CLI operations
27
+ *
28
+ * @example
29
+ * ```bash
30
+ * # List all organizations
31
+ * sos organization list
32
+ *
33
+ * # Get specific organization details
34
+ * sos organization get --organization-uid abc123
35
+ *
36
+ * # Set default organization
37
+ * sos organization set-default
38
+ * ```
39
+ *
40
+ * @since 0.3.0
41
+ */
17
42
  exports.organization = (0, commandDefinition_1.createCommandDefinition)({
18
43
  name: 'organization',
19
- description: 'Organization management',
44
+ description: 'Organization management operations',
20
45
  optionList: [],
21
46
  commands: [organizationListCommand_1.organizationList, organizationGetCommand_1.organizationGet, organizationSetDefaultCommand_1.organizationSetDefault],
22
47
  run() {
@@ -15,7 +15,7 @@ export declare const ORGANIZATION_UID_OPTION: {
15
15
  export declare const NO_DEFAULT_ORGANIZATION_OPTION: {
16
16
  readonly name: "no-default-organization";
17
17
  readonly type: BooleanConstructor;
18
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
18
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
19
19
  };
20
20
  export declare const ORGANIZATION_OPTIONS: ({
21
21
  readonly name: "organization-uid";
@@ -24,7 +24,7 @@ export declare const ORGANIZATION_OPTIONS: ({
24
24
  } | {
25
25
  readonly name: "no-default-organization";
26
26
  readonly type: BooleanConstructor;
27
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
27
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
28
28
  })[];
29
29
  export declare function getOrganizationUidOrDefaultOrSelect(options: CommandLineOptions<[typeof ORGANIZATION_UID_OPTION, typeof NO_DEFAULT_ORGANIZATION_OPTION]>): Promise<string>;
30
30
  export declare function selectOrganizationUid(options: CommandLineOptions<[typeof ORGANIZATION_UID_OPTION]>): Promise<string>;
@@ -28,7 +28,7 @@ exports.ORGANIZATION_UID_OPTION = { name: 'organization-uid', type: String, desc
28
28
  exports.NO_DEFAULT_ORGANIZATION_OPTION = {
29
29
  name: 'no-default-organization',
30
30
  type: Boolean,
31
- description: 'Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default',
31
+ description: 'Prevent using the defaultOrganizationUid from ~/.sosrc',
32
32
  };
33
33
  exports.ORGANIZATION_OPTIONS = [exports.ORGANIZATION_UID_OPTION, exports.NO_DEFAULT_ORGANIZATION_OPTION];
34
34
  function getOrganizationUidOrDefaultOrSelect(options) {
@@ -102,7 +102,7 @@ function getOrganizations() {
102
102
  throw new Error(`Authentication error. Try to login using ${chalk_1.default.green('sos login')}`);
103
103
  }
104
104
  else {
105
- throw new Error('Unknown error: ' + (bodyOfGet && bodyOfGet.message ? bodyOfGet.message : responseOfGet.status));
105
+ throw new Error('Unknown error: ' + ((bodyOfGet === null || bodyOfGet === void 0 ? void 0 : bodyOfGet.message) ? bodyOfGet.message : responseOfGet.status));
106
106
  }
107
107
  });
108
108
  }
@@ -128,7 +128,7 @@ function getOrganization(organizationUid) {
128
128
  throw new Error(`Authentication error. Try to login using ${chalk_1.default.green('sos login')}`);
129
129
  }
130
130
  else {
131
- throw new Error('Unknown error: ' + (bodyOfGet && bodyOfGet.message ? bodyOfGet.message : responseOfGet.status));
131
+ throw new Error('Unknown error: ' + ((bodyOfGet === null || bodyOfGet === void 0 ? void 0 : bodyOfGet.message) ? bodyOfGet.message : responseOfGet.status));
132
132
  }
133
133
  });
134
134
  }
@@ -2,7 +2,7 @@ import { CommandLineOptions } from '../../Command/commandDefinition';
2
2
  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 which were set using command sos organization set-default";
5
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
6
6
  }, {
7
7
  readonly name: "organization-uid";
8
8
  readonly type: StringConstructor;
@@ -12,13 +12,37 @@ declare const OPTION_LIST: readonly [{
12
12
  readonly type: StringConstructor;
13
13
  readonly description: "Device UID";
14
14
  }];
15
+ /**
16
+ * Retrieves and displays all timing configurations that are currently assigned
17
+ * to a specific device. Timing configurations define when and how content
18
+ * (applets) should be displayed on devices, including scheduling and duration settings.
19
+ *
20
+ * @group Management:1
21
+ *
22
+ * @example
23
+ * ```bash
24
+ * # List timings for a specific device
25
+ * sos timing list --device-uid device123
26
+ *
27
+ * # List timings with organization override
28
+ * sos timing list --device-uid device123 --organization-uid org456
29
+ * ```
30
+ *
31
+ * @throws {Error} When device cannot be found or accessed
32
+ *
33
+ * @throws {Error} When organization access is denied
34
+ *
35
+ * @throws {Error} When timing list retrieval fails
36
+ *
37
+ * @since 0.3.0
38
+ */
15
39
  export declare const timingList: {
16
40
  name: "list";
17
41
  description: string;
18
42
  optionList: readonly [{
19
43
  readonly name: "no-default-organization";
20
44
  readonly type: BooleanConstructor;
21
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
45
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
22
46
  }, {
23
47
  readonly name: "organization-uid";
24
48
  readonly type: StringConstructor;
@@ -21,9 +21,33 @@ const helper_1 = require("../../helper");
21
21
  const commandDefinition_1 = require("../../Command/commandDefinition");
22
22
  const Debug = (0, debug_1.default)('@signageos/cli:Timing:list');
23
23
  const OPTION_LIST = [organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION, organizationFacade_1.ORGANIZATION_UID_OPTION, deviceFacade_1.DEVICE_UID_OPTION];
24
+ /**
25
+ * Retrieves and displays all timing configurations that are currently assigned
26
+ * to a specific device. Timing configurations define when and how content
27
+ * (applets) should be displayed on devices, including scheduling and duration settings.
28
+ *
29
+ * @group Management:1
30
+ *
31
+ * @example
32
+ * ```bash
33
+ * # List timings for a specific device
34
+ * sos timing list --device-uid device123
35
+ *
36
+ * # List timings with organization override
37
+ * sos timing list --device-uid device123 --organization-uid org456
38
+ * ```
39
+ *
40
+ * @throws {Error} When device cannot be found or accessed
41
+ *
42
+ * @throws {Error} When organization access is denied
43
+ *
44
+ * @throws {Error} When timing list retrieval fails
45
+ *
46
+ * @since 0.3.0
47
+ */
24
48
  exports.timingList = (0, commandDefinition_1.createCommandDefinition)({
25
49
  name: 'list',
26
- description: 'List timings assigned to device',
50
+ description: 'List timing configurations assigned to a device',
27
51
  optionList: OPTION_LIST,
28
52
  commands: [],
29
53
  run(options) {
@@ -36,7 +60,7 @@ exports.timingList = (0, commandDefinition_1.createCommandDefinition)({
36
60
  const timings = yield restApi.timing.getList({
37
61
  deviceUid,
38
62
  });
39
- console.log(chalk_1.default.yellow(JSON.stringify(timings, undefined, 2)));
63
+ console.info(chalk_1.default.yellow(JSON.stringify(timings, undefined, 2)));
40
64
  });
41
65
  },
42
66
  });
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Provides commands for managing timing configurations that control when and how
3
+ * applets are displayed on signageOS devices. Timing configurations define the
4
+ * relationship between devices, applets, and scheduling parameters.
5
+ *
6
+ * @group Management:4
7
+ *
8
+ * @example
9
+ * ```bash
10
+ * # List timing configurations
11
+ * sos timing list
12
+ * ```
13
+ *
14
+ * @since 0.3.0
15
+ */
1
16
  export declare const timing: {
2
17
  name: "timing";
3
18
  description: string;
@@ -8,7 +23,7 @@ export declare const timing: {
8
23
  optionList: readonly [{
9
24
  readonly name: "no-default-organization";
10
25
  readonly type: BooleanConstructor;
11
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
26
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
12
27
  }, {
13
28
  readonly name: "organization-uid";
14
29
  readonly type: StringConstructor;
@@ -22,7 +37,7 @@ export declare const timing: {
22
37
  run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
23
38
  readonly name: "no-default-organization";
24
39
  readonly type: BooleanConstructor;
25
- readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
40
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc";
26
41
  }, {
27
42
  readonly name: "organization-uid";
28
43
  readonly type: StringConstructor;
@@ -12,6 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.timing = void 0;
13
13
  const commandDefinition_1 = require("../Command/commandDefinition");
14
14
  const timingListCommand_1 = require("./List/timingListCommand");
15
+ /**
16
+ * Provides commands for managing timing configurations that control when and how
17
+ * applets are displayed on signageOS devices. Timing configurations define the
18
+ * relationship between devices, applets, and scheduling parameters.
19
+ *
20
+ * @group Management:4
21
+ *
22
+ * @example
23
+ * ```bash
24
+ * # List timing configurations
25
+ * sos timing list
26
+ * ```
27
+ *
28
+ * @since 0.3.0
29
+ */
15
30
  exports.timing = (0, commandDefinition_1.createCommandDefinition)({
16
31
  name: 'timing',
17
32
  description: 'Timing management',
package/dist/helper.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import fetch, { RequestInit } from 'node-fetch';
2
1
  import RestApi from '@signageos/sdk/dist/RestApi/RestApi';
3
2
  import { ApiVersions } from '@signageos/sdk/dist/RestApi/apiVersions';
4
3
  import { IConfig } from '@signageos/sdk/dist/SosHelper/sosControlHelper';
4
+ type RequestInit = globalThis.RequestInit;
5
5
  interface ICredentials {
6
6
  oauthClientId: string;
7
7
  oauthClientSecret: string;
@@ -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<fetch.Response>;
31
- export declare function postResource(options: IOptions, path: string, query?: any, data?: any): Promise<fetch.Response>;
32
- export declare function putResource(options: IOptions, path: string, query?: any, data?: any): Promise<fetch.Response>;
33
- export declare function deleteResource(options: IOptions, path: string): Promise<fetch.Response>;
30
+ export declare function getResource(options: IOptions, path: string, query?: any): Promise<Response>;
31
+ export declare function postResource(options: IOptions, path: string, query?: any, data?: any): Promise<Response>;
32
+ export declare function putResource(options: IOptions, path: string, query?: any, data?: any): Promise<Response>;
33
+ export declare function deleteResource(options: IOptions, path: string): Promise<Response>;
34
34
  export declare function deserializeJSON(_key: string, value: any): any;
35
35
  export {};
package/dist/helper.js CHANGED
@@ -25,9 +25,7 @@ exports.postResource = postResource;
25
25
  exports.putResource = putResource;
26
26
  exports.deleteResource = deleteResource;
27
27
  exports.deserializeJSON = deserializeJSON;
28
- const node_fetch_1 = __importDefault(require("node-fetch"));
29
28
  const querystring_1 = require("querystring");
30
- // import { RequestInit } from 'node-fetch';
31
29
  const RestApi_1 = __importDefault(require("@signageos/sdk/dist/RestApi/RestApi"));
32
30
  const runControlHelper_1 = require("./RunControl/runControlHelper");
33
31
  const apiVersions_1 = require("@signageos/sdk/dist/RestApi/apiVersions");
@@ -97,16 +95,16 @@ function createUri(options, resource, queryParams) {
97
95
  return [options.url, options.version, resource].join('/') + (typeof queryParams !== 'undefined' ? '?' + (0, querystring_1.stringify)(queryParams) : '');
98
96
  }
99
97
  function getResource(options, path, query) {
100
- return (0, node_fetch_1.default)(createUri(options, path, query), createOptions('GET', options));
98
+ return fetch(createUri(options, path, query), createOptions('GET', options));
101
99
  }
102
100
  function postResource(options, path, query, data) {
103
- return (0, node_fetch_1.default)(createUri(options, path, query), createOptions('POST', options, data));
101
+ return fetch(createUri(options, path, query), createOptions('POST', options, data));
104
102
  }
105
103
  function putResource(options, path, query, data) {
106
- return (0, node_fetch_1.default)(createUri(options, path, query), createOptions('PUT', options, data));
104
+ return fetch(createUri(options, path, query), createOptions('PUT', options, data));
107
105
  }
108
106
  function deleteResource(options, path) {
109
- return (0, node_fetch_1.default)(createUri(options, path), createOptions('DELETE', options));
107
+ return fetch(createUri(options, path), createOptions('DELETE', options));
110
108
  }
111
109
  function deserializeJSON(_key, value) {
112
110
  if (typeof value === 'string') {
package/dist/index.js CHANGED
@@ -21,9 +21,31 @@ const generalCommand_1 = require("./generalCommand");
21
21
  const commandDefinition_1 = require("./Command/commandDefinition");
22
22
  const customScriptCommand_1 = require("./CustomScript/customScriptCommand");
23
23
  const autocompleteCommand_1 = require("./Command/Autocomplete/autocompleteCommand");
24
+ /**
25
+ * The root command for the signageOS CLI tool that provides comprehensive management
26
+ * capabilities for applets, devices, organizations, and other signageOS resources.
27
+ * This command serves as the entry point for all CLI operations and coordinates
28
+ * access to all available command groups.
29
+ *
30
+ * @example
31
+ * ```bash
32
+ * # Show help and available commands
33
+ * sos --help
34
+ *
35
+ * # Show version information
36
+ * sos --version
37
+ *
38
+ * # Use custom API endpoint
39
+ * sos --api-url https://api.custom.signageos.io applet list
40
+ * ```
41
+ *
42
+ * @see {@link https://developers.signageos.io/docs/cli-setup/ CLI Setup}
43
+ *
44
+ * @since 0.1.0
45
+ */
24
46
  const index = (0, commandDefinition_1.createCommandDefinition)({
25
47
  name: 'sos',
26
- description: 'signageOS',
48
+ description: 'SignageOS CLI - The central command-line tool for deploying, managing, and debugging signageOS projects and devices',
27
49
  optionList: generalCommand_1.GENERAL_OPTION_LIST,
28
50
  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],
29
51
  run() {
@@ -0,0 +1,74 @@
1
+ ---
2
+ id: applet-build-index
3
+ title: build
4
+ sidebar_position: 22
5
+ ---
6
+ # build
7
+
8
+ Build applet locally for production deployment.
9
+
10
+
11
+ ## Description
12
+
13
+ Builds the applet into a distributable package using the signageOS SDK build system.
14
+ The build process compiles and bundles the applet code, assets, and dependencies
15
+ into a zip archive ready for upload to the signageOS platform.
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ sos applet build [options]
21
+ ```
22
+
23
+ ## Options
24
+
25
+ | Option | Description |
26
+ | --------------------------- | ---------------------------------------------------------------- |
27
+ | `--no-default-organization` | Prevent using the defaultOrganizationUid from ~/.sosrc (boolean) |
28
+ | `--organization-uid` | Organization UID (string) |
29
+ | `--applet-uid` | Applet UID (string) |
30
+
31
+ ## Examples
32
+
33
+ ```bash
34
+ # Build applet in current directory
35
+ sos applet build
36
+
37
+ # Build with specific organization
38
+ sos applet build --organization-uid abc123def456
39
+
40
+ # Build with specific applet UID
41
+ sos applet build --applet-uid my-applet-uid
42
+ ```
43
+
44
+ ## Since
45
+
46
+ 1.2.0
47
+
48
+ ## Global Options
49
+
50
+ All commands support the following global options:
51
+
52
+ | Option | Alias | Description |
53
+ |--------|-------|-------------|
54
+ | `--help` | `-h` | Display help information for any command |
55
+ | `--version` | `-v` | Display the installed version of the CLI |
56
+ | `--api-url` | `-u` | Override the API URL for REST requests |
57
+ | `--profile` | | Use a specific profile from ~/.sosrc config |
58
+
59
+ ### Examples
60
+
61
+ ```bash
62
+ # Show version
63
+ sos --version
64
+
65
+ # Get help for any command
66
+ sos applet --help
67
+ sos applet upload --help
68
+
69
+ # Use custom API endpoint
70
+ sos --api-url https://api.example.com applet upload
71
+
72
+ # Use specific profile
73
+ sos --profile production organization list
74
+ ```
@@ -0,0 +1,118 @@
1
+ ---
2
+ id: applet-generate-index
3
+ title: generate
4
+ sidebar_position: 21
5
+ ---
6
+ # generate
7
+
8
+ Generate new signageOS applet projects with boilerplate code
9
+
10
+
11
+ ## Description
12
+
13
+ Creates a new applet project with all necessary configuration files, dependencies,
14
+ and boilerplate code. Supports both TypeScript and JavaScript, multiple bundlers
15
+ (webpack/rspack), various package managers (npm/pnpm/yarn/bun), and includes
16
+ git repository initialization.
17
+
18
+ ## Usage
19
+
20
+ ```bash
21
+ sos applet generate [options]
22
+ ```
23
+
24
+ ## Options
25
+
26
+ | Option | Description | Default |
27
+ | ------------------ | ------------------------------------------------------------------------------- | ------- |
28
+ | `--name` | Applet name. Match RegExp: /^\w(\w|\d|-)*\w$/ (string) | |
29
+ | `--applet-version` | Applet initial version. Use semantic version (string) | `0.0.0` |
30
+ | `--target-dir` | Directory where will be the applet generated to (string) | |
31
+ | `--git` | Init applet as git repository "no" (default) or "yes" (string) | |
32
+ | `--packager` | Use preferred package manager "npm" (default), "pnpm", "yarn" or "bun" (string) | |
33
+ | `--npm-registry` | NPM registry URL. If you have your private npm registry (string) | |
34
+ | `--language` | Generate applet with "typescript" or "javascript" source code (string) | |
35
+ | `--bundler` | Generate applet with "webpack" (default) or "rspack" (string) | |
36
+
37
+ ## Examples
38
+
39
+ ```bash
40
+ # Interactive generation with prompts
41
+ sos applet generate
42
+
43
+ # Generate TypeScript applet with webpack
44
+ sos applet generate --name my-applet --language typescript --bundler webpack
45
+
46
+ # Generate with custom settings
47
+ sos applet generate --name my-app --target-dir ./projects --git yes --packager pnpm
48
+
49
+ # Generate with npm registry
50
+ sos applet generate --name my-applet --npm-registry https://registry.npmjs.org/ --packager npm
51
+
52
+ # Generate applet with specific configuration
53
+ sos applet generate --name my-applet --applet-version 1.0.0 --target-dir ./output --language typescript --bundler webpack --git yes
54
+ ```
55
+
56
+ ## Advanced Usage
57
+
58
+ ### Platform Notes
59
+
60
+ #### Windows Users
61
+
62
+ There is an unresolved issue with NPX tool on Windows when your username contains spaces (e.g., `John Doe`). To prevent this issue, run the following command in your Command Line (replace `John` with your real first name). Administrator privileges may be required:
63
+
64
+ ```cmd
65
+ npm config set cache "C:\Users\John~1\AppData\Roaming\npm-cache" --global
66
+ ```
67
+
68
+ For more details, see: https://stackoverflow.com/a/58354623/4609457
69
+
70
+ ### Development Workflow
71
+
72
+ ```bash
73
+ # Complete workflow from generation to deployment
74
+ sos applet generate --name my-sample-applet --language typescript --bundler webpack --git yes
75
+ cd my-sample-applet
76
+
77
+ # Start development with hot reload
78
+ npm start
79
+
80
+ # Build for production
81
+ npm run build
82
+
83
+ # Upload to platform
84
+ npm run upload
85
+ ```
86
+
87
+
88
+ ## Since
89
+
90
+ 0.1.0
91
+
92
+ ## Global Options
93
+
94
+ All commands support the following global options:
95
+
96
+ | Option | Alias | Description |
97
+ |--------|-------|-------------|
98
+ | `--help` | `-h` | Display help information for any command |
99
+ | `--version` | `-v` | Display the installed version of the CLI |
100
+ | `--api-url` | `-u` | Override the API URL for REST requests |
101
+ | `--profile` | | Use a specific profile from ~/.sosrc config |
102
+
103
+ ### Examples
104
+
105
+ ```bash
106
+ # Show version
107
+ sos --version
108
+
109
+ # Get help for any command
110
+ sos applet --help
111
+ sos applet upload --help
112
+
113
+ # Use custom API endpoint
114
+ sos --api-url https://api.example.com applet upload
115
+
116
+ # Use specific profile
117
+ sos --profile production organization list
118
+ ```