@signageos/cli 0.10.2 → 1.0.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 (146) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +16 -1
  3. package/config/parameters.d.ts +1 -0
  4. package/config/parameters.js +4 -0
  5. package/dist/Applet/Generate/appletGenerateCommand.d.ts +44 -2
  6. package/dist/Applet/Generate/appletGenerateCommand.js +44 -35
  7. package/dist/Applet/Generate/appletGenerateCommand.js.map +1 -1
  8. package/dist/Applet/Start/appletStartCommand.d.ts +59 -2
  9. package/dist/Applet/Start/appletStartCommand.js +31 -22
  10. package/dist/Applet/Start/appletStartCommand.js.map +1 -1
  11. package/dist/Applet/Start/appletStartCommandHelper.d.ts +3 -2
  12. package/dist/Applet/Start/appletStartCommandHelper.js +5 -4
  13. package/dist/Applet/Start/appletStartCommandHelper.js.map +1 -1
  14. package/dist/Applet/Test/Upload/appletTestRunCommand.d.ts +52 -2
  15. package/dist/Applet/Test/Upload/appletTestRunCommand.js +44 -36
  16. package/dist/Applet/Test/Upload/appletTestRunCommand.js.map +1 -1
  17. package/dist/Applet/Test/Upload/appletTestRunFacade.js +2 -1
  18. package/dist/Applet/Test/Upload/appletTestRunFacade.js.map +1 -1
  19. package/dist/Applet/Test/Upload/appletTestUploadCommand.d.ts +42 -2
  20. package/dist/Applet/Test/Upload/appletTestUploadCommand.js +45 -37
  21. package/dist/Applet/Test/Upload/appletTestUploadCommand.js.map +1 -1
  22. package/dist/Applet/Test/Upload/appletTestUploadFacade.js +2 -1
  23. package/dist/Applet/Test/Upload/appletTestUploadFacade.js.map +1 -1
  24. package/dist/Applet/Test/appletTestCommand.d.ts +93 -2
  25. package/dist/Applet/Test/appletTestCommand.js +4 -2
  26. package/dist/Applet/Test/appletTestCommand.js.map +1 -1
  27. package/dist/Applet/Upload/appletUploadCommand.d.ts +63 -5
  28. package/dist/Applet/Upload/appletUploadCommand.js +142 -150
  29. package/dist/Applet/Upload/appletUploadCommand.js.map +1 -1
  30. package/dist/Applet/Upload/appletUploadCommandHelper.d.ts +17 -5
  31. package/dist/Applet/Upload/appletUploadCommandHelper.js +30 -47
  32. package/dist/Applet/Upload/appletUploadCommandHelper.js.map +1 -1
  33. package/dist/Applet/Upload/appletUploadFacade.d.ts +0 -7
  34. package/dist/Applet/Upload/appletUploadFacade.js +21 -23
  35. package/dist/Applet/Upload/appletUploadFacade.js.map +1 -1
  36. package/dist/Applet/Upload/appletUploadFacadeHelper.js +5 -4
  37. package/dist/Applet/Upload/appletUploadFacadeHelper.js.map +1 -1
  38. package/dist/Applet/appletCommand.d.ts +257 -2
  39. package/dist/Applet/appletCommand.js +4 -2
  40. package/dist/Applet/appletCommand.js.map +1 -1
  41. package/dist/Applet/appletFacade.d.ts +1 -3
  42. package/dist/Applet/appletFacade.js +28 -53
  43. package/dist/Applet/appletFacade.js.map +1 -1
  44. package/dist/Auth/loginCommand.d.ts +18 -2
  45. package/dist/Auth/loginCommand.js +16 -13
  46. package/dist/Auth/loginCommand.js.map +1 -1
  47. package/dist/Cache/tmpCache.js +1 -0
  48. package/dist/Cache/tmpCache.js.map +1 -1
  49. package/dist/Cli/helper.js +1 -0
  50. package/dist/Cli/helper.js.map +1 -1
  51. package/dist/Cli/packageVersion.d.ts +0 -6
  52. package/dist/Cli/packageVersion.js +10 -15
  53. package/dist/Cli/packageVersion.js.map +1 -1
  54. package/dist/Command/commandDefinition.d.ts +28 -0
  55. package/dist/Command/commandDefinition.js +8 -0
  56. package/dist/Command/commandDefinition.js.map +1 -0
  57. package/dist/Command/commandProcessor.d.ts +2 -10
  58. package/dist/Command/commandProcessor.js +13 -20
  59. package/dist/Command/commandProcessor.js.map +1 -1
  60. package/dist/Command/globalArgs.d.ts +2 -0
  61. package/dist/Command/globalArgs.js +16 -0
  62. package/dist/Command/globalArgs.js.map +1 -0
  63. package/dist/CommandLine/progressBarFactory.js +1 -0
  64. package/dist/CommandLine/progressBarFactory.js.map +1 -1
  65. package/dist/Device/Connect/connectCommand.d.ts +50 -2
  66. package/dist/Device/Connect/connectCommand.js +23 -18
  67. package/dist/Device/Connect/connectCommand.js.map +1 -1
  68. package/dist/Device/Connect/connectHelper.d.ts +0 -1
  69. package/dist/Device/Connect/connectHelper.js +39 -75
  70. package/dist/Device/Connect/connectHelper.js.map +1 -1
  71. package/dist/Device/Content/setContentCommand.d.ts +42 -2
  72. package/dist/Device/Content/setContentCommand.js +21 -13
  73. package/dist/Device/Content/setContentCommand.js.map +1 -1
  74. package/dist/Device/PowerAction/powerActionCommand.d.ts +42 -2
  75. package/dist/Device/PowerAction/powerActionCommand.js +17 -13
  76. package/dist/Device/PowerAction/powerActionCommand.js.map +1 -1
  77. package/dist/Device/deviceCommand.d.ts +129 -2
  78. package/dist/Device/deviceCommand.js +4 -2
  79. package/dist/Device/deviceCommand.js.map +1 -1
  80. package/dist/Device/deviceFacade.d.ts +11 -10
  81. package/dist/Device/deviceFacade.js +20 -15
  82. package/dist/Device/deviceFacade.js.map +1 -1
  83. package/dist/Emulator/createDomain.js +3 -2
  84. package/dist/Emulator/createDomain.js.map +1 -1
  85. package/dist/Emulator/emulatorFacade.d.ts +3 -1
  86. package/dist/Emulator/emulatorFacade.js +29 -27
  87. package/dist/Emulator/emulatorFacade.js.map +1 -1
  88. package/dist/Emulator/emulatorFactory.d.ts +3 -1
  89. package/dist/Emulator/emulatorFactory.js +19 -17
  90. package/dist/Emulator/emulatorFactory.js.map +1 -1
  91. package/dist/FileSystem/helper.js +21 -15
  92. package/dist/FileSystem/helper.js.map +1 -1
  93. package/dist/FileSystem/packageConfig.js +1 -0
  94. package/dist/FileSystem/packageConfig.js.map +1 -1
  95. package/dist/Firmware/Upload/firmwareUploadCommand.d.ts +48 -2
  96. package/dist/Firmware/Upload/firmwareUploadCommand.js +33 -20
  97. package/dist/Firmware/Upload/firmwareUploadCommand.js.map +1 -1
  98. package/dist/Firmware/Upload/firmwareUploadFacade.js +5 -4
  99. package/dist/Firmware/Upload/firmwareUploadFacade.js.map +1 -1
  100. package/dist/Firmware/Upload/firmwareUploadHelper.js +2 -2
  101. package/dist/Firmware/Upload/firmwareUploadHelper.js.map +1 -1
  102. package/dist/Firmware/firmwareCommand.d.ts +51 -2
  103. package/dist/Firmware/firmwareCommand.js +5 -8
  104. package/dist/Firmware/firmwareCommand.js.map +1 -1
  105. package/dist/Helper/localMachineHelper.d.ts +1 -0
  106. package/dist/Helper/localMachineHelper.js +94 -0
  107. package/dist/Helper/localMachineHelper.js.map +1 -0
  108. package/dist/Organization/Get/organizationGetCommand.d.ts +26 -2
  109. package/dist/Organization/Get/organizationGetCommand.js +11 -7
  110. package/dist/Organization/Get/organizationGetCommand.js.map +1 -1
  111. package/dist/Organization/List/organizationListCommand.d.ts +7 -2
  112. package/dist/Organization/List/organizationListCommand.js +6 -4
  113. package/dist/Organization/List/organizationListCommand.js.map +1 -1
  114. package/dist/Organization/SetDefault/organizationSetDefaultCommand.d.ts +18 -2
  115. package/dist/Organization/SetDefault/organizationSetDefaultCommand.js +12 -9
  116. package/dist/Organization/SetDefault/organizationSetDefaultCommand.js.map +1 -1
  117. package/dist/Organization/organizationCommand.d.ts +49 -2
  118. package/dist/Organization/organizationCommand.js +4 -2
  119. package/dist/Organization/organizationCommand.js.map +1 -1
  120. package/dist/Organization/organizationFacade.d.ts +20 -5
  121. package/dist/Organization/organizationFacade.js +60 -12
  122. package/dist/Organization/organizationFacade.js.map +1 -1
  123. package/dist/RunControl/runControlHelper.d.ts +1 -1
  124. package/dist/RunControl/runControlHelper.js +38 -14
  125. package/dist/RunControl/runControlHelper.js.map +1 -1
  126. package/dist/Stream/helper.js +1 -0
  127. package/dist/Stream/helper.js.map +1 -1
  128. package/dist/Timing/List/timingListCommand.d.ts +34 -2
  129. package/dist/Timing/List/timingListCommand.js +14 -10
  130. package/dist/Timing/List/timingListCommand.js.map +1 -1
  131. package/dist/Timing/timingCommand.d.ts +37 -2
  132. package/dist/Timing/timingCommand.js +4 -2
  133. package/dist/Timing/timingCommand.js.map +1 -1
  134. package/dist/generalCommand.d.ts +64 -0
  135. package/dist/generalCommand.js +46 -0
  136. package/dist/generalCommand.js.map +1 -0
  137. package/dist/helper.d.ts +6 -2
  138. package/dist/helper.js +13 -12
  139. package/dist/helper.js.map +1 -1
  140. package/dist/index.js +6 -18
  141. package/dist/index.js.map +1 -1
  142. package/package-lock.json +1094 -870
  143. package/package.json +14 -13
  144. package/dist/Command/ICommand.d.ts +0 -10
  145. package/dist/Command/ICommand.js +0 -3
  146. package/dist/Command/ICommand.js.map +0 -1
@@ -1,2 +1,257 @@
1
- import ICommand from "../Command/ICommand";
2
- export declare const applet: ICommand;
1
+ export declare const applet: {
2
+ name: "applet";
3
+ description: string;
4
+ optionList: never[];
5
+ commands: ({
6
+ name: "generate";
7
+ description: string;
8
+ optionList: readonly [{
9
+ readonly name: "name";
10
+ readonly type: StringConstructor;
11
+ readonly description: `Applet name. Match RegExp: ${string}`;
12
+ }, {
13
+ readonly name: "applet-version";
14
+ readonly type: StringConstructor;
15
+ readonly description: "Applet initial version. Use semantic version";
16
+ readonly defaultValue: "0.0.0";
17
+ }, {
18
+ readonly name: "target-dir";
19
+ readonly type: StringConstructor;
20
+ readonly description: "Directory where will be the applet generated to";
21
+ }, {
22
+ readonly name: "npm-registry";
23
+ readonly type: StringConstructor;
24
+ readonly description: "NPM registry URL. If you have your private npm registry";
25
+ }];
26
+ commands: never[];
27
+ run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
28
+ readonly name: "name";
29
+ readonly type: StringConstructor;
30
+ readonly description: `Applet name. Match RegExp: ${string}`;
31
+ }, {
32
+ readonly name: "applet-version";
33
+ readonly type: StringConstructor;
34
+ readonly description: "Applet initial version. Use semantic version";
35
+ readonly defaultValue: "0.0.0";
36
+ }, {
37
+ readonly name: "target-dir";
38
+ readonly type: StringConstructor;
39
+ readonly description: "Directory where will be the applet generated to";
40
+ }, {
41
+ readonly name: "npm-registry";
42
+ readonly type: StringConstructor;
43
+ readonly description: "NPM registry URL. If you have your private npm registry";
44
+ }]>): Promise<void>;
45
+ } | {
46
+ name: "upload";
47
+ description: string;
48
+ optionList: readonly [{
49
+ readonly name: "applet-path";
50
+ readonly type: StringConstructor;
51
+ readonly description: "Path to the applet file or the project folder depending on the entry file. Relative to the command or absolute.";
52
+ }, {
53
+ readonly name: "entry-file-path";
54
+ readonly type: StringConstructor;
55
+ readonly description: "Path to the applet entry file. Relative to the command or absolute.";
56
+ }, {
57
+ readonly name: "no-default-organization";
58
+ readonly type: BooleanConstructor;
59
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
60
+ }, {
61
+ readonly name: "organization-uid";
62
+ readonly type: StringConstructor;
63
+ readonly description: "Organization UID";
64
+ }, {
65
+ readonly name: "update-package-config";
66
+ readonly type: BooleanConstructor;
67
+ readonly description: string;
68
+ }, {
69
+ readonly name: "yes";
70
+ readonly type: BooleanConstructor;
71
+ readonly description: "Allow to upload new applet or override existing version without confirmation step";
72
+ }, {
73
+ readonly name: "verbose";
74
+ readonly type: BooleanConstructor;
75
+ readonly description: "outputs all files to upload";
76
+ }];
77
+ commands: never[];
78
+ run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
79
+ readonly name: "applet-path";
80
+ readonly type: StringConstructor;
81
+ readonly description: "Path to the applet file or the project folder depending on the entry file. Relative to the command or absolute.";
82
+ }, {
83
+ readonly name: "entry-file-path";
84
+ readonly type: StringConstructor;
85
+ readonly description: "Path to the applet entry file. Relative to the command or absolute.";
86
+ }, {
87
+ readonly name: "no-default-organization";
88
+ readonly type: BooleanConstructor;
89
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
90
+ }, {
91
+ readonly name: "organization-uid";
92
+ readonly type: StringConstructor;
93
+ readonly description: "Organization UID";
94
+ }, {
95
+ readonly name: "update-package-config";
96
+ readonly type: BooleanConstructor;
97
+ readonly description: string;
98
+ }, {
99
+ readonly name: "yes";
100
+ readonly type: BooleanConstructor;
101
+ readonly description: "Allow to upload new applet or override existing version without confirmation step";
102
+ }, {
103
+ readonly name: "verbose";
104
+ readonly type: BooleanConstructor;
105
+ readonly description: "outputs all files to upload";
106
+ }]>): Promise<void>;
107
+ } | {
108
+ name: "start";
109
+ description: string;
110
+ optionList: readonly [{
111
+ readonly name: "no-default-organization";
112
+ readonly type: BooleanConstructor;
113
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
114
+ }, {
115
+ readonly name: "organization-uid";
116
+ readonly type: StringConstructor;
117
+ readonly description: "Organization UID";
118
+ }, {
119
+ readonly name: "port";
120
+ readonly type: NumberConstructor;
121
+ readonly description: "Port where will the applet run";
122
+ readonly defaultValue: 8090;
123
+ }, {
124
+ readonly name: "applet-path";
125
+ readonly type: StringConstructor;
126
+ readonly description: "Path to the applet file or the project folder depending on the entry file. Relative to the command or absolute.";
127
+ }, {
128
+ readonly name: "project-dir";
129
+ readonly type: StringConstructor;
130
+ readonly description: "Directory of the applet project";
131
+ }, {
132
+ readonly name: "entry-file-path";
133
+ readonly type: StringConstructor;
134
+ readonly description: "Path to the applet entry file. Relative to the command or absolute.";
135
+ }];
136
+ commands: never[];
137
+ run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
138
+ readonly name: "no-default-organization";
139
+ readonly type: BooleanConstructor;
140
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
141
+ }, {
142
+ readonly name: "organization-uid";
143
+ readonly type: StringConstructor;
144
+ readonly description: "Organization UID";
145
+ }, {
146
+ readonly name: "port";
147
+ readonly type: NumberConstructor;
148
+ readonly description: "Port where will the applet run";
149
+ readonly defaultValue: 8090;
150
+ }, {
151
+ readonly name: "applet-path";
152
+ readonly type: StringConstructor;
153
+ readonly description: "Path to the applet file or the project folder depending on the entry file. Relative to the command or absolute.";
154
+ }, {
155
+ readonly name: "project-dir";
156
+ readonly type: StringConstructor;
157
+ readonly description: "Directory of the applet project";
158
+ }, {
159
+ readonly name: "entry-file-path";
160
+ readonly type: StringConstructor;
161
+ readonly description: "Path to the applet entry file. Relative to the command or absolute.";
162
+ }]>): Promise<void>;
163
+ } | {
164
+ name: "test";
165
+ description: string;
166
+ optionList: never[];
167
+ commands: ({
168
+ name: "run";
169
+ description: string;
170
+ optionList: readonly [{
171
+ readonly name: "no-default-organization";
172
+ readonly type: BooleanConstructor;
173
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
174
+ }, {
175
+ readonly name: "device-uid";
176
+ readonly type: StringConstructor;
177
+ readonly description: "Device UID";
178
+ }, {
179
+ readonly name: "organization-uid";
180
+ readonly type: StringConstructor;
181
+ readonly description: "Organization UID";
182
+ }, {
183
+ readonly name: "test";
184
+ readonly type: StringConstructor;
185
+ readonly multiple: true;
186
+ readonly description: "Specify the test identifiers/files to be run. If not specified, all will be run.";
187
+ }, {
188
+ readonly name: "yes";
189
+ readonly type: BooleanConstructor;
190
+ readonly description: "Allow to run applet test without confirmation step";
191
+ }];
192
+ commands: never[];
193
+ run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
194
+ readonly name: "no-default-organization";
195
+ readonly type: BooleanConstructor;
196
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
197
+ }, {
198
+ readonly name: "device-uid";
199
+ readonly type: StringConstructor;
200
+ readonly description: "Device UID";
201
+ }, {
202
+ readonly name: "organization-uid";
203
+ readonly type: StringConstructor;
204
+ readonly description: "Organization UID";
205
+ }, {
206
+ readonly name: "test";
207
+ readonly type: StringConstructor;
208
+ readonly multiple: true;
209
+ readonly description: "Specify the test identifiers/files to be run. If not specified, all will be run.";
210
+ }, {
211
+ readonly name: "yes";
212
+ readonly type: BooleanConstructor;
213
+ readonly description: "Allow to run applet test without confirmation step";
214
+ }]>): Promise<void>;
215
+ } | {
216
+ name: "upload";
217
+ description: string;
218
+ optionList: readonly [{
219
+ readonly name: "no-default-organization";
220
+ readonly type: BooleanConstructor;
221
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
222
+ }, {
223
+ readonly name: "organization-uid";
224
+ readonly type: StringConstructor;
225
+ readonly description: "Organization UID";
226
+ }, {
227
+ readonly name: "yes";
228
+ readonly type: BooleanConstructor;
229
+ readonly description: "Allow to upload new applet test or override existing test without confirmation step";
230
+ }, {
231
+ readonly name: "verbose";
232
+ readonly type: BooleanConstructor;
233
+ readonly description: "outputs all files to upload";
234
+ }];
235
+ commands: never[];
236
+ run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
237
+ readonly name: "no-default-organization";
238
+ readonly type: BooleanConstructor;
239
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
240
+ }, {
241
+ readonly name: "organization-uid";
242
+ readonly type: StringConstructor;
243
+ readonly description: "Organization UID";
244
+ }, {
245
+ readonly name: "yes";
246
+ readonly type: BooleanConstructor;
247
+ readonly description: "Allow to upload new applet test or override existing test without confirmation step";
248
+ }, {
249
+ readonly name: "verbose";
250
+ readonly type: BooleanConstructor;
251
+ readonly description: "outputs all files to upload";
252
+ }]>): Promise<void>;
253
+ })[];
254
+ run(): Promise<never>;
255
+ })[];
256
+ run(): Promise<never>;
257
+ };
@@ -36,11 +36,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.applet = void 0;
39
40
  var appletGenerateCommand_1 = require("./Generate/appletGenerateCommand");
40
41
  var appletUploadCommand_1 = require("./Upload/appletUploadCommand");
41
42
  var appletStartCommand_1 = require("./Start/appletStartCommand");
42
43
  var appletTestCommand_1 = require("./Test/appletTestCommand");
43
- exports.applet = {
44
+ var commandDefinition_1 = require("../Command/commandDefinition");
45
+ exports.applet = (0, commandDefinition_1.createCommandDefinition)({
44
46
  name: 'applet',
45
47
  description: 'Applet management',
46
48
  optionList: [],
@@ -57,5 +59,5 @@ exports.applet = {
57
59
  });
58
60
  });
59
61
  },
60
- };
62
+ });
61
63
  //# sourceMappingURL=appletCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"appletCommand.js","sourceRoot":"","sources":["../../src/Applet/appletCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0EAAkE;AAClE,oEAA4D;AAC5D,iEAAyD;AACzD,8DAAsD;AAEzC,QAAA,MAAM,GAAa;IAC/B,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,mBAAmB;IAChC,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE;QACT,sCAAc;QACd,kCAAY;QACZ,gCAAW;QACX,8BAAU;KACV;IACK,GAAG;;;gBACR,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;;;KACnC;CACD,CAAC"}
1
+ {"version":3,"file":"appletCommand.js","sourceRoot":"","sources":["../../src/Applet/appletCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAAkE;AAClE,oEAA4D;AAC5D,iEAAyD;AACzD,8DAAsD;AACtD,kEAAuE;AAE1D,QAAA,MAAM,GAAG,IAAA,2CAAuB,EAAC;IAC7C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,mBAAmB;IAChC,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE;QACT,sCAAc;QACd,kCAAY;QACZ,gCAAW;QACX,8BAAU;KACV;IACK,GAAG;;;gBACR,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;;;KACnC;CACD,CAAC,CAAC"}
@@ -7,7 +7,5 @@ export interface IApplet {
7
7
  export declare function getApplet(directoryPath: string): Promise<IApplet>;
8
8
  export declare function getAppletName(directoryPath: string): Promise<string>;
9
9
  export declare function getAppletVersion(directoryPath: string): Promise<string>;
10
- export declare function tryGetAppletUid(directoryPath: string): Promise<string | undefined>;
11
- export declare function getAppletFrontAppletVersion(_directoryPath: string): Promise<string>;
12
- export declare function getAppletUid(restApi: RestApi): Promise<string>;
10
+ export declare function getAppletUid(restApi: RestApi): Promise<string | undefined>;
13
11
  export declare function getAppletVersionFromApi(restApi: RestApi, appletUid: string): Promise<string>;
@@ -36,6 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getAppletVersionFromApi = exports.getAppletUid = exports.getAppletVersion = exports.getAppletName = exports.getApplet = void 0;
39
40
  var path = require("path");
40
41
  var prompts = require("prompts");
41
42
  var parameters = require("../../config/parameters");
@@ -48,20 +49,20 @@ function getApplet(directoryPath) {
48
49
  switch (_e.label) {
49
50
  case 0:
50
51
  packageJSONPath = path.join(directoryPath, 'package.json');
51
- return [4 /*yield*/, packageConfig_1.loadPackage(directoryPath)];
52
+ return [4 /*yield*/, (0, packageConfig_1.loadPackage)(directoryPath)];
52
53
  case 1:
53
54
  packageJSONObject = _e.sent();
54
55
  if (!packageJSONObject) {
55
- throw new Error("No package.json found in: " + packageJSONPath);
56
+ throw new Error("No package.json found in: ".concat(packageJSONPath));
56
57
  }
57
58
  appletUid = (_a = parameters.applet.uid) !== null && _a !== void 0 ? _a : (_b = packageJSONObject.sos) === null || _b === void 0 ? void 0 : _b.appletUid;
58
59
  appletVersion = (_c = parameters.applet.version) !== null && _c !== void 0 ? _c : packageJSONObject.version;
59
60
  appletName = (_d = parameters.applet.name) !== null && _d !== void 0 ? _d : packageJSONObject.name;
60
61
  if (!appletVersion) {
61
- throw new Error("No \"version\" key found in: " + packageJSONPath + " nor SOS_APPLET_VERSION environment variable specified");
62
+ throw new Error("No \"version\" key found in: ".concat(packageJSONPath, " nor SOS_APPLET_VERSION environment variable specified"));
62
63
  }
63
64
  if (!appletName) {
64
- throw new Error("No \"name\" key found in: " + packageJSONPath + " nor SOS_APPLET_NAME environment variable specified");
65
+ throw new Error("No \"name\" key found in: ".concat(packageJSONPath, " nor SOS_APPLET_NAME environment variable specified"));
65
66
  }
66
67
  return [2 /*return*/, {
67
68
  uid: appletUid,
@@ -75,17 +76,12 @@ function getApplet(directoryPath) {
75
76
  exports.getApplet = getApplet;
76
77
  function getAppletName(directoryPath) {
77
78
  return __awaiter(this, void 0, void 0, function () {
78
- var packageJSONPath, applet;
79
+ var applet;
79
80
  return __generator(this, function (_a) {
80
81
  switch (_a.label) {
81
- case 0:
82
- packageJSONPath = path.join(directoryPath, 'package.json');
83
- return [4 /*yield*/, getApplet(directoryPath)];
82
+ case 0: return [4 /*yield*/, getApplet(directoryPath)];
84
83
  case 1:
85
84
  applet = _a.sent();
86
- if (!applet.name) {
87
- throw new Error("No \"name\" key found in: " + packageJSONPath);
88
- }
89
85
  return [2 /*return*/, applet.name];
90
86
  }
91
87
  });
@@ -93,25 +89,6 @@ function getAppletName(directoryPath) {
93
89
  }
94
90
  exports.getAppletName = getAppletName;
95
91
  function getAppletVersion(directoryPath) {
96
- var _a;
97
- return __awaiter(this, void 0, void 0, function () {
98
- var packageJSONObject, packageJSONPath;
99
- return __generator(this, function (_b) {
100
- switch (_b.label) {
101
- case 0: return [4 /*yield*/, packageConfig_1.loadPackage(directoryPath)];
102
- case 1:
103
- packageJSONObject = (_a = _b.sent()) !== null && _a !== void 0 ? _a : {};
104
- if (!packageJSONObject.version) {
105
- packageJSONPath = path.join(directoryPath, 'package.json');
106
- throw new Error("No \"version\" key found in: " + packageJSONPath);
107
- }
108
- return [2 /*return*/, packageJSONObject.version];
109
- }
110
- });
111
- });
112
- }
113
- exports.getAppletVersion = getAppletVersion;
114
- function tryGetAppletUid(directoryPath) {
115
92
  return __awaiter(this, void 0, void 0, function () {
116
93
  var applet;
117
94
  return __generator(this, function (_a) {
@@ -119,52 +96,50 @@ function tryGetAppletUid(directoryPath) {
119
96
  case 0: return [4 /*yield*/, getApplet(directoryPath)];
120
97
  case 1:
121
98
  applet = _a.sent();
122
- return [2 /*return*/, applet.uid];
99
+ return [2 /*return*/, applet.version];
123
100
  }
124
101
  });
125
102
  });
126
103
  }
127
- exports.tryGetAppletUid = tryGetAppletUid;
128
- function getAppletFrontAppletVersion(_directoryPath) {
129
- return __awaiter(this, void 0, void 0, function () {
130
- return __generator(this, function (_a) {
131
- return [2 /*return*/, '']; // TODO load from package.json when sos platform is supported
132
- });
133
- });
134
- }
135
- exports.getAppletFrontAppletVersion = getAppletFrontAppletVersion;
104
+ exports.getAppletVersion = getAppletVersion;
136
105
  function getAppletUid(restApi) {
137
106
  return __awaiter(this, void 0, void 0, function () {
138
- var currentDirectory, appletUid, applets, response;
107
+ var currentDirectory, currentApplet, appletUid, applets, candidatesOfApplets, response;
139
108
  return __generator(this, function (_a) {
140
109
  switch (_a.label) {
141
110
  case 0:
142
111
  currentDirectory = process.cwd();
143
- return [4 /*yield*/, tryGetAppletUid(currentDirectory)];
112
+ return [4 /*yield*/, getApplet(currentDirectory)];
144
113
  case 1:
145
- appletUid = _a.sent();
146
- if (!!appletUid) return [3 /*break*/, 4];
114
+ currentApplet = _a.sent();
115
+ appletUid = currentApplet.uid;
116
+ if (!!appletUid) return [3 /*break*/, 6];
147
117
  return [4 /*yield*/, restApi.applet.list()];
148
118
  case 2:
149
119
  applets = _a.sent();
120
+ candidatesOfApplets = applets.filter(function (applet) { return applet.name === currentApplet.name; });
121
+ if (!(candidatesOfApplets.length === 0)) return [3 /*break*/, 3];
122
+ appletUid = undefined;
123
+ return [3 /*break*/, 6];
124
+ case 3:
125
+ if (!(candidatesOfApplets.length > 1)) return [3 /*break*/, 5];
150
126
  return [4 /*yield*/, prompts({
151
127
  type: 'autocomplete',
152
128
  name: 'appletUid',
153
129
  message: "Select applet to use",
154
- choices: applets.map(function (applet) { return ({
155
- title: applet.name + " (" + applet.uid + ")",
130
+ choices: candidatesOfApplets.map(function (applet) { return ({
131
+ title: "".concat(applet.name, " (").concat(applet.uid, ")"),
156
132
  value: applet.uid,
157
133
  }); }),
158
134
  })];
159
- case 3:
135
+ case 4:
160
136
  response = _a.sent();
161
137
  appletUid = response.appletUid;
162
- _a.label = 4;
163
- case 4:
164
- if (!appletUid) {
165
- throw new Error('Missing argument --applet-uid <string>');
166
- }
167
- return [2 /*return*/, appletUid];
138
+ return [3 /*break*/, 6];
139
+ case 5:
140
+ appletUid = candidatesOfApplets[0].uid;
141
+ _a.label = 6;
142
+ case 6: return [2 /*return*/, appletUid];
168
143
  }
169
144
  });
170
145
  });
@@ -1 +1 @@
1
- {"version":3,"file":"appletFacade.js","sourceRoot":"","sources":["../../src/Applet/appletFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA6B;AAC7B,iCAAmC;AAGnC,oDAAsD;AACtD,6DAA0D;AAQ1D,SAAsB,SAAS,CAAC,aAAqB;;;;;;;oBAC9C,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;oBACvC,qBAAM,2BAAW,CAAC,aAAa,CAAC,EAAA;;oBAApD,iBAAiB,GAAG,SAAgC;oBAC1D,IAAI,CAAC,iBAAiB,EAAE;wBACvB,MAAM,IAAI,KAAK,CAAC,+BAA6B,eAAiB,CAAC,CAAC;qBAChE;oBAEK,SAAS,SAAG,UAAU,CAAC,MAAM,CAAC,GAAG,yCAAI,iBAAiB,CAAC,GAAG,0CAAE,SAAS,CAAC;oBACtE,aAAa,SAAG,UAAU,CAAC,MAAM,CAAC,OAAO,mCAAI,iBAAiB,CAAC,OAAO,CAAC;oBACvE,UAAU,SAAG,UAAU,CAAC,MAAM,CAAC,IAAI,mCAAI,iBAAiB,CAAC,IAAI,CAAC;oBAEpE,IAAI,CAAC,aAAa,EAAE;wBACnB,MAAM,IAAI,KAAK,CAAC,kCAA8B,eAAe,2DAAwD,CAAC,CAAC;qBACvH;oBACD,IAAI,CAAC,UAAU,EAAE;wBAChB,MAAM,IAAI,KAAK,CAAC,+BAA2B,eAAe,wDAAqD,CAAC,CAAC;qBACjH;oBAED,s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kB,IAAK,OAAA,CAAC;gCACzD,KAAK,EAAE,UAAG,MAAM,CAAC,IAAI,eAAK,MAAM,CAAC,GAAG,MAAG;gCACvC,KAAK,EAAE,MAAM,CAAC,GAAG;6BACjB,CAAC,EAHuD,CAGvD,CAAC;yBACH,CAAC,EAAA;;oBARI,QAAQ,GAAG,SAQf;oBACF,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;;;oBAE/B,SAAS,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;;wBAGzC,sBAAO,SAAS,EAAC;;;;CACjB;AA7BD,oCA6BC;AAED,SAAsB,uBAAuB,CAC3C,OAAgB,EAChB,SAAiB;;;;;wBAIK,qBAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAA;;oBAA7D,cAAc,GAAG,SAA4C;yBAC/D,CAAA,cAAc,CAAC,MAAM,KAAK,CAAC,CAAA,EAA3B,wBAA2B;oBAC9B,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;;wBAEzB,qBAAM,OAAO,CAAC;wBAC9B,IAAI,EAAE,cAAc;wBACpB,IAAI,EAAE,eAAe;wBACrB,OAAO,EAAE,8BAA8B;wBACvC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,CAAC;4BACxC,KAAK,EAAE,MAAM,CAAC,OAAO;4BACrB,KAAK,EAAE,MAAM,CAAC,OAAO;yBACrB,CAAC,EAHsC,CAGtC,CAAC;qBACH,CAAC,EAAA;;oBARI,QAAQ,GAAG,SAQf;oBACF,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;;wBAGxC,sBAAO,aAAa,EAAC;;;;CACrB;AAvBD,0DAuBC"}
@@ -1,2 +1,18 @@
1
- import ICommand from '../Command/ICommand';
2
- export declare const login: ICommand;
1
+ import { CommandLineOptions } from '../Command/commandDefinition';
2
+ declare const OPTION_LIST: readonly [{
3
+ readonly name: "username";
4
+ readonly type: StringConstructor;
5
+ readonly description: `Username or e-mail used for ${string}`;
6
+ }];
7
+ export declare const login: {
8
+ name: "login";
9
+ description: string;
10
+ optionList: readonly [{
11
+ readonly name: "username";
12
+ readonly type: StringConstructor;
13
+ readonly description: `Username or e-mail used for ${string}`;
14
+ }];
15
+ commands: never[];
16
+ run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
17
+ };
18
+ export {};
@@ -36,6 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.login = void 0;
39
40
  var chalk_1 = require("chalk");
40
41
  var prompts = require("prompts");
41
42
  var Debug = require("debug");
@@ -43,14 +44,16 @@ var os = require("os");
43
44
  var helper_1 = require("../helper");
44
45
  var runControlHelper_1 = require("../RunControl/runControlHelper");
45
46
  var parameters = require("../../config/parameters");
46
- var commandProcessor_1 = require("../Command/commandProcessor");
47
+ var commandDefinition_1 = require("../Command/commandDefinition");
48
+ var globalArgs_1 = require("../Command/globalArgs");
47
49
  var debug = Debug('@signageos/cli:Auth:login');
48
- exports.login = {
50
+ var OPTION_LIST = [
51
+ { name: 'username', type: String, description: "Username or e-mail used for ".concat(parameters.boxHost) },
52
+ ];
53
+ exports.login = (0, commandDefinition_1.createCommandDefinition)({
49
54
  name: 'login',
50
55
  description: 'Login account using username & password',
51
- optionList: [
52
- { name: 'username', type: String, description: "Username or e-mail used for " + parameters.boxHost },
53
- ],
56
+ optionList: OPTION_LIST,
54
57
  commands: [],
55
58
  run: function (options) {
56
59
  return __awaiter(this, void 0, void 0, function () {
@@ -63,7 +66,7 @@ exports.login = {
63
66
  return [4 /*yield*/, prompts({
64
67
  type: 'text',
65
68
  name: 'username',
66
- message: "Type your username or e-mail used for " + parameters.boxHost,
69
+ message: "Type your username or e-mail used for ".concat(parameters.boxHost),
67
70
  })];
68
71
  case 1:
69
72
  response = _b.sent();
@@ -76,26 +79,26 @@ exports.login = {
76
79
  return [4 /*yield*/, prompts({
77
80
  type: 'password',
78
81
  name: 'password',
79
- message: "Type your password used for " + parameters.boxHost,
82
+ message: "Type your password used for ".concat(parameters.boxHost),
80
83
  })];
81
84
  case 3:
82
85
  password = (_b.sent()).password;
83
86
  return [4 /*yield*/, getOrCreateApiSecurityToken(identification, password)];
84
87
  case 4:
85
88
  _a = _b.sent(), tokenId = _a.id, apiSecurityToken = _a.securityToken, name = _a.name;
86
- return [4 /*yield*/, runControlHelper_1.saveConfig({
89
+ return [4 /*yield*/, (0, runControlHelper_1.saveConfig)({
87
90
  identification: tokenId,
88
91
  apiSecurityToken: apiSecurityToken,
89
92
  })];
90
93
  case 5:
91
94
  _b.sent();
92
- console.log("User " + chalk_1.default.green(identification) + " has been logged in with token \"" + name + "\". Credentials are stored in " + chalk_1.default.blue(runControlHelper_1.getConfigFilePath()));
95
+ console.log("User ".concat(chalk_1.default.green(identification), " has been logged in with token \"").concat(name, "\". Credentials are stored in ").concat(chalk_1.default.blue((0, runControlHelper_1.getConfigFilePath)())));
93
96
  return [2 /*return*/];
94
97
  }
95
98
  });
96
99
  });
97
100
  },
98
- };
101
+ });
99
102
  function getOrCreateApiSecurityToken(identification, password) {
100
103
  return __awaiter(this, void 0, void 0, function () {
101
104
  var ACCOUNT_SECURITY_TOKEN_RESOURCE, options, tokenName, query, responseOfPost, bodyOfPost, _a, _b;
@@ -104,7 +107,7 @@ function getOrCreateApiSecurityToken(identification, password) {
104
107
  case 0:
105
108
  ACCOUNT_SECURITY_TOKEN_RESOURCE = 'account/security-token';
106
109
  options = {
107
- url: commandProcessor_1.getGlobalApiUrl(),
110
+ url: (0, globalArgs_1.getGlobalApiUrl)(),
108
111
  auth: { clientId: undefined, secret: undefined },
109
112
  version: 'v1',
110
113
  };
@@ -114,7 +117,7 @@ function getOrCreateApiSecurityToken(identification, password) {
114
117
  password: password,
115
118
  name: tokenName,
116
119
  };
117
- return [4 /*yield*/, helper_1.postResource(options, ACCOUNT_SECURITY_TOKEN_RESOURCE, query)];
120
+ return [4 /*yield*/, (0, helper_1.postResource)(options, ACCOUNT_SECURITY_TOKEN_RESOURCE, query)];
118
121
  case 1:
119
122
  responseOfPost = _c.sent();
120
123
  _b = (_a = JSON).parse;
@@ -140,6 +143,6 @@ function generateTokenName() {
140
143
  var hostname = os.hostname();
141
144
  var shortHostname = hostname.split('.')[0];
142
145
  var userInfo = os.userInfo();
143
- return userInfo.username + "@" + shortHostname;
146
+ return "".concat(userInfo.username, "@").concat(shortHostname);
144
147
  }
145
148
  //# sourceMappingURL=loginCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loginCommand.js","sourceRoot":"","sources":["../../src/Auth/loginCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA0B;AAC1B,iCAAmC;AACnC,6BAA+B;AAC/B,uBAAyB;AAEzB,oCAA0D;AAC1D,mEAA+E;AAC/E,oDAAsD;AAEtD,gEAA8D;AAC9D,IAAM,KAAK,GAAG,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAEpC,QAAA,KAAK,GAAa;IAC9B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,yCAAyC;IACtD,UAAU,EAAE;QACX,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,iCAA+B,UAAU,CAAC,OAAS,EAAE;KACpG;IACD,QAAQ,EAAE,EAAE;IACN,GAAG,EAAT,UAAU,OAA2B;;;;;;wBAChC,cAAc,GAAuB,OAAO,CAAC,QAAQ,CAAC;6BACtD,CAAC,cAAc,EAAf,wBAAe;wBACD,qBAAM,OAAO,CAAC;gCAC9B,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,UAAU;gCAChB,OAAO,EAAE,2CAAyC,UAAU,CAAC,OAAS;6BACtE,CAAC,EAAA;;wBAJI,QAAQ,GAAG,SAIf;wBACF,cAAc,GAAG,QAAQ,CAAC,QAAQ,CA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AAC,QAAQ,EAAE,CAAC;IAC/B,IAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAE/B,OAAO,UAAG,QAAQ,CAAC,QAAQ,cAAI,aAAa,CAAE,CAAC;AAChD,CAAC"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCacheValue = exports.getCachedValue = void 0;
3
4
  var os = require("os");
4
5
  var fs = require("fs-extra");
5
6
  var path = require("path");
@@ -1 +1 @@
1
- {"version":3,"file":"tmpCache.js","sourceRoot":"","sources":["../../src/Cache/tmpCache.ts"],"names":[],"mappings":";;AAAA,uBAAyB;AACzB,6BAA+B;AAC/B,2BAA6B;AAE7B,IAAM,aAAa,GAAG,WAAW,CAAC;AAElC,IAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC,CAAC;AAO5D,SAAgB,cAAc,CAAC,GAAW;IACzC,IAAI;QACH,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAChC,IAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;QACrD,IAAM,WAAW,GAAiB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzF,IAAI,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE;YACrC,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,WAAW,CAAC,KAAK,CAAC;KACzB;IAAC,OAAO,KAAK,EAAE;QACf,OAAO,IAAI,CAAC;KACZ;AACF,CAAC;AAZD,wCAYC;AAMD,SAAgB,gBAAgB,CAAC,GAAW,EAAE,KAAa,EAAE,OAAiB;IAC7E,IAA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OAAO,IAAI,CAAC;KACZ;AACF,CAAC;AAZD,wCAYC;AAMD,SAAgB,gBAAgB,CAAC,GAAW,EAAE,KAAa,EAAE,OAAiB;IAC7E,IAAI;QACH,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAChC,IAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;QACrD,IAAM,WAAW,GAAiB;YACjC,KAAK,OAAA;YACL,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU;SACnD,CAAC;QACF,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;KAC9D;IAAC,OAAO,KAAK,EAAE;QACf,eAAe;KACf;AACF,CAAC;AAZD,4CAYC;AAED,SAAS,UAAU,CAAC,QAAgB;IACnC,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC;AACxC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPackageVersion = exports.getPackageName = void 0;
3
4
  var parameters = require("../../config/parameters");
4
5
  function getPackageName() {
5
6
  return parameters.name;
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/Cli/helper.ts"],"names":[],"mappings":";;AAAA,oDAAsD;AAEtD,SAAgB,cAAc;IAC7B,OAAO,UAAU,CAAC,IAAI,CAAC;AACxB,CAAC;AAFD,wCAEC;AAED,SAAgB,iBAAiB;IAChC,OAAO,UAAU,CAAC,OAAO,CAAC;AAC3B,CAAC;AAFD,8CAEC"}
1
+ {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/Cli/helper.ts"],"names":[],"mappings":";;;AAAA,oDAAsD;AAEtD,SAAgB,cAAc;IAC7B,OAAO,UAAU,CAAC,IAAI,CAAC;AACxB,CAAC;AAFD,wCAEC;AAED,SAAgB,iBAAiB;IAChC,OAAO,UAAU,CAAC,OAAO,CAAC;AAC3B,CAAC;AAFD,8CAEC"}
@@ -1,9 +1,3 @@
1
- export declare const VERSION_OPTION: {
2
- name: string;
3
- alias: string;
4
- type: BooleanConstructor;
5
- description: string;
6
- };
7
1
  export declare function printVersion(): Promise<void>;
8
2
  export declare function printUpdateMessage(): Promise<void>;
9
3
  export declare function getLatestVersion(packageName: string): Promise<string | undefined>;