@signageos/cli 1.7.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/Applet/Start/appletStartCommand.d.ts +20 -0
- package/dist/Applet/Start/appletStartCommand.js +27 -26
- package/dist/Applet/Start/appletStartCommand.js.map +1 -1
- package/dist/Applet/Upload/appletUploadCommand.js +2 -2
- package/dist/Applet/Upload/appletUploadCommand.js.map +1 -1
- package/dist/Applet/Upload/appletUploadFacade.js +5 -5
- package/dist/Applet/Upload/appletUploadFacade.js.map +1 -1
- package/dist/Applet/appletCommand.d.ts +20 -0
- package/dist/Applet/appletServerHelper.d.ts +18 -0
- package/dist/Applet/appletServerHelper.js +20 -1
- package/dist/Applet/appletServerHelper.js.map +1 -1
- package/dist/CustomScript/Upload/customScriptUploadCommand.d.ts +25 -0
- package/dist/CustomScript/Upload/customScriptUploadCommand.js +143 -0
- package/dist/CustomScript/Upload/customScriptUploadCommand.js.map +1 -0
- package/dist/CustomScript/customScriptCommand.d.ts +29 -0
- package/dist/{Stream/helper.js → CustomScript/customScriptCommand.js} +16 -22
- package/dist/CustomScript/customScriptCommand.js.map +1 -0
- package/dist/CustomScript/customScriptFacade.d.ts +112 -0
- package/dist/CustomScript/customScriptFacade.js +390 -0
- package/dist/CustomScript/customScriptFacade.js.map +1 -0
- package/dist/Device/Connect/connectCommand.d.ts +38 -0
- package/dist/Device/Connect/connectCommand.js +51 -21
- package/dist/Device/Connect/connectCommand.js.map +1 -1
- package/dist/Device/deviceCommand.d.ts +38 -0
- package/dist/Emulator/emulatorFactory.js +3 -3
- package/dist/Emulator/emulatorFactory.js.map +1 -1
- package/dist/Firmware/Upload/firmwareUploadFacade.js +3 -4
- package/dist/Firmware/Upload/firmwareUploadFacade.js.map +1 -1
- package/dist/Lib/archive.d.ts +8 -0
- package/dist/Lib/archive.js +85 -0
- package/dist/Lib/archive.js.map +1 -0
- package/dist/{FileSystem/helper.d.ts → Lib/fileSystem.d.ts} +1 -1
- package/dist/{FileSystem/helper.js → Lib/fileSystem.js} +19 -18
- package/dist/Lib/fileSystem.js.map +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/parameters.d.ts +1 -0
- package/dist/parameters.js +1 -0
- package/dist/parameters.js.map +1 -1
- package/package.json +9 -5
- package/dist/FileSystem/helper.js.map +0 -1
- package/dist/Stream/helper.d.ts +0 -2
- package/dist/Stream/helper.js.map +0 -1
package/README.md
CHANGED
|
@@ -15,10 +15,7 @@ and [gitbash](https://gitforwindows.org/), run it in [windows terminal](https://
|
|
|
15
15
|
## Test
|
|
16
16
|
```bash
|
|
17
17
|
cp .env.amy .env
|
|
18
|
-
# Unit tests
|
|
19
18
|
npm test
|
|
20
|
-
# Integration tests (against AMY environment)
|
|
21
|
-
npm run test-integration
|
|
22
19
|
```
|
|
23
20
|
|
|
24
21
|
## API reference
|
|
@@ -140,6 +137,8 @@ sos applet start
|
|
|
140
137
|
| --server-port *(optional)* | The custom server port for local machine server. | {RANDOM_PORT} |
|
|
141
138
|
| --hot-reload *(optional)* | Enable hot reload and build of applet | false |
|
|
142
139
|
| --force *(optional)* | Force start applet server of hot reload even if it is already running on a different port. Kill the running server first. | false |
|
|
140
|
+
| --detach *(optional)* | Run the applet HTTP server in the background (detached proccess) | false |
|
|
141
|
+
| --forward-server-url *(optional)* | Custom forward server URL for `sos device connect` command. | https://forward.signageos.io |
|
|
143
142
|
|
|
144
143
|
#### Applet Tests Upload
|
|
145
144
|
```bash
|
|
@@ -268,6 +267,10 @@ sos device connect
|
|
|
268
267
|
| --use-forward-server *(optional)* | Use forward server to connect to the device instead of the local network (LAN) (https://forward.signageos.io/{random-hash}). It's useful when the device is not in the same network as the local machine. | false |
|
|
269
268
|
| --server-port *(optional)* | The custom server port for local machine server. | {RANDOM_PORT} |
|
|
270
269
|
| --force *(optional)* | Force start applet server even if it is already running on a different port. Kill the running server first. | false |
|
|
270
|
+
| --applet-path *(optional)* | Root path of applet project | ${PWD}/dist |
|
|
271
|
+
| --detach *(optional)* | Run the applet HTTP server in the background (detached proccess) | false |
|
|
272
|
+
| --forward-server-url *(optional)* | Custom forward server URL. | https://forward.signageos.io |
|
|
273
|
+
| --hot-reload *(optional)* | Enable hot reload and build of applet | false |
|
|
271
274
|
|
|
272
275
|
## Debugging
|
|
273
276
|
|
|
@@ -37,6 +37,16 @@ export declare const OPTION_LIST: readonly [{
|
|
|
37
37
|
readonly name: "force";
|
|
38
38
|
readonly type: BooleanConstructor;
|
|
39
39
|
readonly description: "Force start applet server even if it is already running on a different port. Kill the running server first.";
|
|
40
|
+
}, {
|
|
41
|
+
readonly name: "detach";
|
|
42
|
+
readonly type: BooleanConstructor;
|
|
43
|
+
readonly description: "Detach the applet HTTP server process from the terminal. Useful when want to run more commands reusing the same http server for current applet.";
|
|
44
|
+
readonly defaultValue: false;
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "forward-server-url";
|
|
47
|
+
readonly type: StringConstructor;
|
|
48
|
+
readonly description: "Url of forward server to connect to the device instead of the local network (LAN).";
|
|
49
|
+
readonly defaultValue: string | undefined;
|
|
40
50
|
}];
|
|
41
51
|
export declare const appletStart: {
|
|
42
52
|
name: "start";
|
|
@@ -79,6 +89,16 @@ export declare const appletStart: {
|
|
|
79
89
|
readonly name: "force";
|
|
80
90
|
readonly type: BooleanConstructor;
|
|
81
91
|
readonly description: "Force start applet server even if it is already running on a different port. Kill the running server first.";
|
|
92
|
+
}, {
|
|
93
|
+
readonly name: "detach";
|
|
94
|
+
readonly type: BooleanConstructor;
|
|
95
|
+
readonly description: "Detach the applet HTTP server process from the terminal. Useful when want to run more commands reusing the same http server for current applet.";
|
|
96
|
+
readonly defaultValue: false;
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "forward-server-url";
|
|
99
|
+
readonly type: StringConstructor;
|
|
100
|
+
readonly description: "Url of forward server to connect to the device instead of the local network (LAN).";
|
|
101
|
+
readonly defaultValue: string | undefined;
|
|
82
102
|
}];
|
|
83
103
|
commands: never[];
|
|
84
104
|
run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
|
|
@@ -47,6 +47,7 @@ var dist_1 = require("@signageos/sdk/dist");
|
|
|
47
47
|
var wait_1 = require("../../Timer/wait");
|
|
48
48
|
var appletServerHelper_1 = require("../appletServerHelper");
|
|
49
49
|
var log_1 = require("@signageos/sdk/dist/Console/log");
|
|
50
|
+
var parameters_1 = require("../../parameters");
|
|
50
51
|
var DEFAULT_PORT = 8090;
|
|
51
52
|
var PORT_OPTION = {
|
|
52
53
|
name: 'port',
|
|
@@ -54,22 +55,18 @@ var PORT_OPTION = {
|
|
|
54
55
|
description: "Port where will the applet run",
|
|
55
56
|
defaultValue: DEFAULT_PORT,
|
|
56
57
|
};
|
|
57
|
-
var HOT_RELOAD_OPTION = {
|
|
58
|
-
name: 'hot-reload',
|
|
59
|
-
type: Boolean,
|
|
60
|
-
description: "Enable hot reload and build of applet",
|
|
61
|
-
defaultValue: false,
|
|
62
|
-
};
|
|
63
58
|
exports.OPTION_LIST = [
|
|
64
59
|
organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION,
|
|
65
60
|
organizationFacade_1.ORGANIZATION_UID_OPTION,
|
|
66
61
|
PORT_OPTION,
|
|
67
62
|
appletUploadCommandHelper_1.APPLET_PATH_OPTION,
|
|
68
63
|
appletUploadCommandHelper_1.ENTRY_FILE_PATH_OPTION,
|
|
69
|
-
HOT_RELOAD_OPTION,
|
|
64
|
+
appletServerHelper_1.HOT_RELOAD_OPTION,
|
|
70
65
|
appletServerHelper_1.SERVER_PORT_OPTION,
|
|
71
66
|
appletServerHelper_1.SERVER_PUBLIC_URL_OPTION,
|
|
72
67
|
appletServerHelper_1.SERVER_FORCE_OPTION,
|
|
68
|
+
appletServerHelper_1.DETACH_PROCESS_OPTION,
|
|
69
|
+
appletServerHelper_1.FORWARD_SERVER_URL_OPTION,
|
|
73
70
|
];
|
|
74
71
|
exports.appletStart = (0, commandDefinition_1.createCommandDefinition)({
|
|
75
72
|
name: 'start',
|
|
@@ -77,58 +74,62 @@ exports.appletStart = (0, commandDefinition_1.createCommandDefinition)({
|
|
|
77
74
|
optionList: exports.OPTION_LIST,
|
|
78
75
|
commands: [],
|
|
79
76
|
run: function (options) {
|
|
80
|
-
var _a;
|
|
77
|
+
var _a, _b;
|
|
81
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
-
var currentDirectory, organizationUid, entryFileAbsolutePath, appletPath, entryFileRelativePath, emulatorUid, dev, emulatorServerPort, hotReloadEnabled, appletPort, appletPublicUrl, appletUid, appletVersion, e_1, appletHotReload, createEmulatorParams, emulator, stopServer;
|
|
83
|
-
var
|
|
79
|
+
var currentDirectory, organizationUid, entryFileAbsolutePath, appletPath, entryFileRelativePath, emulatorUid, dev, emulatorServerPort, hotReloadEnabled, appletPort, appletPublicUrl, detachProcess, forwardServerUrl, appletUid, appletVersion, e_1, appletHotReload, createEmulatorParams, emulator, stopServer;
|
|
80
|
+
var _c;
|
|
84
81
|
var _this = this;
|
|
85
|
-
return __generator(this, function (
|
|
86
|
-
switch (
|
|
82
|
+
return __generator(this, function (_d) {
|
|
83
|
+
switch (_d.label) {
|
|
87
84
|
case 0:
|
|
88
85
|
currentDirectory = process.cwd();
|
|
89
86
|
return [4 /*yield*/, (0, organizationFacade_1.getOrganizationUidOrDefaultOrSelect)(options)];
|
|
90
87
|
case 1:
|
|
91
|
-
organizationUid =
|
|
88
|
+
organizationUid = _d.sent();
|
|
92
89
|
return [4 /*yield*/, (0, appletUploadCommandHelper_1.getAppletEntryFileAbsolutePath)(currentDirectory, options)];
|
|
93
90
|
case 2:
|
|
94
|
-
entryFileAbsolutePath =
|
|
91
|
+
entryFileAbsolutePath = _d.sent();
|
|
95
92
|
return [4 /*yield*/, (0, appletUploadCommandHelper_1.getAppletDirectoryAbsolutePath)(currentDirectory, options)];
|
|
96
93
|
case 3:
|
|
97
|
-
appletPath =
|
|
94
|
+
appletPath = _d.sent();
|
|
98
95
|
entryFileRelativePath = (0, appletUploadCommandHelper_1.getAppletEntryFileRelativePath)(entryFileAbsolutePath, appletPath);
|
|
99
96
|
return [4 /*yield*/, (0, emulatorFacade_1.loadEmulatorOrCreateNewAndReturnUid)(organizationUid)];
|
|
100
97
|
case 4:
|
|
101
|
-
emulatorUid =
|
|
98
|
+
emulatorUid = _d.sent();
|
|
102
99
|
dev = (0, dist_1.createDevelopment)({
|
|
103
100
|
organizationUid: organizationUid,
|
|
104
101
|
});
|
|
105
102
|
emulatorServerPort = (_a = options[PORT_OPTION.name]) !== null && _a !== void 0 ? _a : DEFAULT_PORT;
|
|
106
|
-
hotReloadEnabled = options[HOT_RELOAD_OPTION.name];
|
|
103
|
+
hotReloadEnabled = options[appletServerHelper_1.HOT_RELOAD_OPTION.name];
|
|
107
104
|
appletPort = options[appletServerHelper_1.SERVER_PORT_OPTION.name];
|
|
108
105
|
appletPublicUrl = options[appletServerHelper_1.SERVER_PUBLIC_URL_OPTION.name];
|
|
109
|
-
|
|
106
|
+
detachProcess = options[appletServerHelper_1.DETACH_PROCESS_OPTION.name];
|
|
107
|
+
forwardServerUrl = (_b = options[appletServerHelper_1.FORWARD_SERVER_URL_OPTION.name]) !== null && _b !== void 0 ? _b : parameters_1.parameters.forwardServerUrl;
|
|
108
|
+
_d.label = 5;
|
|
110
109
|
case 5:
|
|
111
|
-
|
|
110
|
+
_d.trys.push([5, 7, , 8]);
|
|
112
111
|
return [4 /*yield*/, dev.applet.identification.getAppletUidAndVersion(appletPath)];
|
|
113
112
|
case 6:
|
|
114
|
-
(
|
|
113
|
+
(_c = _d.sent(), appletUid = _c.appletUid, appletVersion = _c.appletVersion);
|
|
115
114
|
return [3 /*break*/, 8];
|
|
116
115
|
case 7:
|
|
117
|
-
e_1 =
|
|
116
|
+
e_1 = _d.sent();
|
|
118
117
|
(0, log_1.log)('warning', chalk_1.default.yellow('Applet is not uploaded yet. It cannot be developed on real device.'));
|
|
119
118
|
return [3 /*break*/, 8];
|
|
120
119
|
case 8: return [4 /*yield*/, (0, appletServerHelper_1.killAppletServerIfRunningAndForceOption)(dev, options, appletUid, appletVersion, appletPort)];
|
|
121
120
|
case 9:
|
|
122
|
-
|
|
121
|
+
_d.sent();
|
|
123
122
|
if (!hotReloadEnabled) return [3 /*break*/, 11];
|
|
124
123
|
return [4 /*yield*/, dev.applet.startHotReload({
|
|
125
124
|
appletPath: appletPath,
|
|
126
125
|
port: appletPort,
|
|
127
126
|
publicUrl: appletPublicUrl,
|
|
127
|
+
detachProcess: detachProcess,
|
|
128
|
+
forwardServerUrl: forwardServerUrl,
|
|
128
129
|
})];
|
|
129
130
|
case 10:
|
|
130
|
-
appletHotReload =
|
|
131
|
-
|
|
131
|
+
appletHotReload = _d.sent();
|
|
132
|
+
_d.label = 11;
|
|
132
133
|
case 11:
|
|
133
134
|
createEmulatorParams = {
|
|
134
135
|
emulatorUid: emulatorUid,
|
|
@@ -140,7 +141,7 @@ exports.appletStart = (0, commandDefinition_1.createCommandDefinition)({
|
|
|
140
141
|
};
|
|
141
142
|
return [4 /*yield*/, (0, emulatorFactory_1.createEmulator)(createEmulatorParams, organizationUid, dev)];
|
|
142
143
|
case 12:
|
|
143
|
-
emulator =
|
|
144
|
+
emulator = _d.sent();
|
|
144
145
|
stopServer = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
145
146
|
return __generator(this, function (_a) {
|
|
146
147
|
switch (_a.label) {
|
|
@@ -160,7 +161,7 @@ exports.appletStart = (0, commandDefinition_1.createCommandDefinition)({
|
|
|
160
161
|
console.info('Press Ctrl+C to stop');
|
|
161
162
|
return [4 /*yield*/, (0, wait_1.default)(1e9)];
|
|
162
163
|
case 13:
|
|
163
|
-
|
|
164
|
+
_d.sent(); // Wait forever
|
|
164
165
|
return [2 /*return*/];
|
|
165
166
|
}
|
|
166
167
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletStartCommand.js","sourceRoot":"","sources":["../../../src/Applet/Start/appletStartCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA0B;AAC1B,kEAAgE;AAChE,iFAM6C;AAC7C,gEAAoF;AACpF,qEAA8F;AAC9F,4EAI+C;AAC/C,4CAAwD;AAExD,yCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"appletStartCommand.js","sourceRoot":"","sources":["../../../src/Applet/Start/appletStartCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA0B;AAC1B,kEAAgE;AAChE,iFAM6C;AAC7C,gEAAoF;AACpF,qEAA8F;AAC9F,4EAI+C;AAC/C,4CAAwD;AAExD,yCAAoC;AACpC,4DAQ+B;AAC/B,uDAAsD;AACtD,+CAA8C;AAE9C,IAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,IAAM,WAAW,GAAG;IACnB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,gCAAgC;IAC7C,YAAY,EAAE,YAAY;CACjB,CAAC;AAEE,QAAA,WAAW,GAAG;IAC1B,mDAA8B;IAC9B,4CAAuB;IACvB,WAAW;IACX,8CAAkB;IAClB,kDAAsB;IACtB,sCAAiB;IACjB,uCAAkB;IAClB,6CAAwB;IACxB,wCAAmB;IACnB,0CAAqB;IACrB,8CAAyB;CAChB,CAAC;AAEE,QAAA,WAAW,GAAG,IAAA,2CAAuB,EAAC;IAClD,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,sBAAsB;IACnC,UAAU,EAAE,mBAAW;IACvB,QAAQ,EAAE,EAAE;IACN,GAAG,EAAT,UAAU,OAA+C;;;;;;;;;wBAClD,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;wBAEf,qBAAM,IAAA,wDAAmC,EAAC,OAAO,CAAC,EAAA;;wBAApE,eAAe,GAAG,SAAkD;wBAC5C,qBAAM,IAAA,0DAA8B,EAAC,gBAAg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F,gBAAgB,EAAhB,yBAAgB;wBACD,qBAAM,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC;gCACjD,UAAU,EAAE,UAAU;gCACtB,IAAI,EAAE,UAAU;gCAChB,SAAS,EAAE,eAAe;gCAC1B,aAAa,eAAA;gCACb,gBAAgB,kBAAA;6BAChB,CAAC,EAAA;;wBANF,eAAe,GAAG,SAMhB,CAAC;;;wBAGE,oBAAoB,GAAG;4BAC5B,WAAW,aAAA;4BACX,SAAS,WAAA;4BACT,aAAa,eAAA;4BACb,UAAU,YAAA;4BACV,qBAAqB,uBAAA;4BACrB,kBAAkB,oBAAA;yBAClB,CAAC;wBACe,qBAAM,IAAA,gCAAc,EAAC,oBAAoB,EAAE,eAAe,EAAE,GAAG,CAAC,EAAA;;wBAA3E,QAAQ,GAAG,SAAgE;wBAE3E,UAAU,GAAG;;;4CAClB,qBAAM,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,EAAE,CAAA,EAAA;;wCAA7B,SAA6B,CAAC;wCAC9B,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;wCAArB,SAAqB,CAAC;wCACtB,OAAO,CAAC,IAAI,EAAE,CAAC;;;;6BACf,CAAC;wBACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;wBACjC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;wBAElC,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;wBACrC,qBAAM,IAAA,cAAI,EAAC,GAAG,CAAC,EAAA;;wBAAf,SAAe,CAAC,CAAC,eAAe;;;;;KAChC;CACD,CAAC,CAAC"}
|
|
@@ -70,7 +70,7 @@ var organizationFacade_1 = require("../../Organization/organizationFacade");
|
|
|
70
70
|
var appletFacade_1 = require("../appletFacade");
|
|
71
71
|
var appletUploadFacade_1 = require("./appletUploadFacade");
|
|
72
72
|
var appletUploadCommandHelper_1 = require("./appletUploadCommandHelper");
|
|
73
|
-
var
|
|
73
|
+
var fileSystem_1 = require("../../Lib/fileSystem");
|
|
74
74
|
var progressBarFactory_1 = require("../../CommandLine/progressBarFactory");
|
|
75
75
|
var packageConfig_1 = require("@signageos/sdk/dist/FileSystem/packageConfig");
|
|
76
76
|
var commandDefinition_1 = require("../../Command/commandDefinition");
|
|
@@ -200,7 +200,7 @@ exports.appletUpload = (0, commandDefinition_1.createCommandDefinition)({
|
|
|
200
200
|
})];
|
|
201
201
|
case 23:
|
|
202
202
|
appletFilePaths = _b.sent();
|
|
203
|
-
return [4 /*yield*/, (0,
|
|
203
|
+
return [4 /*yield*/, (0, fileSystem_1.validateAllFormalities)(appletDirectoryPath, appletEntryFilePath, appletFilePaths)];
|
|
204
204
|
case 24:
|
|
205
205
|
_b.sent();
|
|
206
206
|
appletFiles.push.apply(appletFiles, __spreadArray([], __read(appletFilePaths), false));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletUploadCommand.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA0B;AAC1B,iCAAmC;AACnC,uCAAyD;AACzD,+CAA8C;AAC9C,4EAK+C;AAC/C,gDAA6E;AAC7E,2DAAwI;AACxI,yEAOqC;AACrC,
|
|
1
|
+
{"version":3,"file":"appletUploadCommand.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA0B;AAC1B,iCAAmC;AACnC,uCAAyD;AACzD,+CAA8C;AAC9C,4EAK+C;AAC/C,gDAA6E;AAC7E,2DAAwI;AACxI,yEAOqC;AACrC,mDAA8D;AAC9D,2EAAyE;AACzE,8EAA6E;AAC7E,qEAA8F;AAC9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1D,CAAC"}
|
|
@@ -43,7 +43,7 @@ var chalk_1 = require("chalk");
|
|
|
43
43
|
var Debug = require("debug");
|
|
44
44
|
var NotFoundError_1 = require("@signageos/sdk/dist/RestApi/Error/NotFoundError");
|
|
45
45
|
var appletUploadFacadeHelper_1 = require("./appletUploadFacadeHelper");
|
|
46
|
-
var
|
|
46
|
+
var fileSystem_1 = require("../../Lib/fileSystem");
|
|
47
47
|
var log_1 = require("@signageos/sdk/dist/Console/log");
|
|
48
48
|
var debug = Debug('@signageos/cli:Applet:Upload:appletUploadFacade');
|
|
49
49
|
function updateSingleFileApplet(parameters) {
|
|
@@ -86,10 +86,10 @@ var updateMultiFileApplet = function (parameters) { return __awaiter(void 0, voi
|
|
|
86
86
|
return [4 /*yield*/, fs.stat(fileAbsolutePath)];
|
|
87
87
|
case 3:
|
|
88
88
|
fileSize = (_c.sent()).size;
|
|
89
|
-
return [4 /*yield*/, (0,
|
|
89
|
+
return [4 /*yield*/, (0, fileSystem_1.getFileMD5Checksum)(fileAbsolutePath)];
|
|
90
90
|
case 4:
|
|
91
91
|
fileHash = _c.sent();
|
|
92
|
-
return [4 /*yield*/, (0,
|
|
92
|
+
return [4 /*yield*/, (0, fileSystem_1.getFileType)(fileAbsolutePath)];
|
|
93
93
|
case 5:
|
|
94
94
|
fileType = _c.sent();
|
|
95
95
|
currentFileHash = currentAppletFiles[fileRelativePosixPath] ? currentAppletFiles[fileRelativePosixPath].hash : undefined;
|
|
@@ -239,10 +239,10 @@ var createMultiFileFileApplet = function (parameters) { return __awaiter(void 0,
|
|
|
239
239
|
switch (_a.label) {
|
|
240
240
|
case 0:
|
|
241
241
|
fileRelativePath = (0, appletUploadFacadeHelper_1.getAppletFileRelativePath)(fileAbsolutePath, applet.directoryPath);
|
|
242
|
-
return [4 /*yield*/, (0,
|
|
242
|
+
return [4 /*yield*/, (0, fileSystem_1.getFileMD5Checksum)(fileAbsolutePath)];
|
|
243
243
|
case 1:
|
|
244
244
|
fileHash = _a.sent();
|
|
245
|
-
return [4 /*yield*/, (0,
|
|
245
|
+
return [4 /*yield*/, (0, fileSystem_1.getFileType)(fileAbsolutePath)];
|
|
246
246
|
case 2:
|
|
247
247
|
fileType = _a.sent();
|
|
248
248
|
return [4 /*yield*/, fs.stat(fileAbsolutePath)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletUploadFacade.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA6B;AAC7B,6BAA+B;AAC/B,+BAA0B;AAC1B,6BAA+B;AAE/B,iFAA4E;AAC5E,uEAAiG;AACjG,
|
|
1
|
+
{"version":3,"file":"appletUploadFacade.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA6B;AAC7B,6BAA+B;AAC/B,+BAA0B;AAC1B,6BAA+B;AAE/B,iFAA4E;AAC5E,uEAAiG;AACjG,mDAAuE;AAEvE,uDAAsD;AAEtD,IAAM,KAAK,GAAG,KAAK,CAAC,iDAAiD,CAAC,CAAC;AAEvE,SAAsB,sBAAsB,CAAC,UAS5C;;;;;;oBACQ,OAAO,GAAa,UAAU,QAAvB,EAAE,MAAM,GAAK,UAAU,OAAf,CAAgB;oBACjC,YAAY,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;oBACtF,qBAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE;4BAC/D,MAAM,EAAE,YAAY;4BACpB,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;yBAC7C,CAAC,EAAA;;oBAHF,SAGE,CAAC;;;;;CACH;AAhBD,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AAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CACxC,MAAM,CAAC,GAAG,EACV,MAAM,CAAC,OAAO,EACd;4CACC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;4CAClC,IAAI,EAAE,aAAa;4CACnB,IAAI,EAAE,QAAQ;4CACd,IAAI,EAAE,QAAQ;4CACd,OAAO,EAAE,UAAU;4CACnB,IAAI,EAAE,QAAQ;yCACd,EACD,EAAE,KAAK,EAAE,KAAK,EAAE,CAChB,EAAC;;;yBACF,CAAC,CACF,EAAA;;gBAxCD,SAwCC,CAAC;;;gBAEF,IAAI,WAAW,EAAE;oBAChB,WAAW,CAAC,GAAG,EAAE,CAAC;iBAClB;;;YAGF,yGAAyG;YACzG,qBAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE;oBAC/D,SAAS,EAAE,wBAAwB;iBACnC,CAAC,EAAA;;gBAHF,yGAAyG;gBACzG,SAEE,CAAC;;;;KACH,CAAC;AAvEW,QAAA,yBAAyB,6BAuEpC"}
|
|
@@ -171,6 +171,16 @@ export declare const applet: {
|
|
|
171
171
|
readonly name: "force";
|
|
172
172
|
readonly type: BooleanConstructor;
|
|
173
173
|
readonly description: "Force start applet server even if it is already running on a different port. Kill the running server first.";
|
|
174
|
+
}, {
|
|
175
|
+
readonly name: "detach";
|
|
176
|
+
readonly type: BooleanConstructor;
|
|
177
|
+
readonly description: "Detach the applet HTTP server process from the terminal. Useful when want to run more commands reusing the same http server for current applet.";
|
|
178
|
+
readonly defaultValue: false;
|
|
179
|
+
}, {
|
|
180
|
+
readonly name: "forward-server-url";
|
|
181
|
+
readonly type: StringConstructor;
|
|
182
|
+
readonly description: "Url of forward server to connect to the device instead of the local network (LAN).";
|
|
183
|
+
readonly defaultValue: string | undefined;
|
|
174
184
|
}];
|
|
175
185
|
commands: never[];
|
|
176
186
|
run(options: import("../Command/commandDefinition").CommandLineOptions<readonly [{
|
|
@@ -211,6 +221,16 @@ export declare const applet: {
|
|
|
211
221
|
readonly name: "force";
|
|
212
222
|
readonly type: BooleanConstructor;
|
|
213
223
|
readonly description: "Force start applet server even if it is already running on a different port. Kill the running server first.";
|
|
224
|
+
}, {
|
|
225
|
+
readonly name: "detach";
|
|
226
|
+
readonly type: BooleanConstructor;
|
|
227
|
+
readonly description: "Detach the applet HTTP server process from the terminal. Useful when want to run more commands reusing the same http server for current applet.";
|
|
228
|
+
readonly defaultValue: false;
|
|
229
|
+
}, {
|
|
230
|
+
readonly name: "forward-server-url";
|
|
231
|
+
readonly type: StringConstructor;
|
|
232
|
+
readonly description: "Url of forward server to connect to the device instead of the local network (LAN).";
|
|
233
|
+
readonly defaultValue: string | undefined;
|
|
214
234
|
}]>): Promise<void>;
|
|
215
235
|
} | {
|
|
216
236
|
name: "test";
|
|
@@ -15,4 +15,22 @@ export declare const SERVER_FORCE_OPTION: {
|
|
|
15
15
|
readonly type: BooleanConstructor;
|
|
16
16
|
readonly description: "Force start applet server even if it is already running on a different port. Kill the running server first.";
|
|
17
17
|
};
|
|
18
|
+
export declare const DETACH_PROCESS_OPTION: {
|
|
19
|
+
readonly name: "detach";
|
|
20
|
+
readonly type: BooleanConstructor;
|
|
21
|
+
readonly description: "Detach the applet HTTP server process from the terminal. Useful when want to run more commands reusing the same http server for current applet.";
|
|
22
|
+
readonly defaultValue: false;
|
|
23
|
+
};
|
|
24
|
+
export declare const FORWARD_SERVER_URL_OPTION: {
|
|
25
|
+
readonly name: "forward-server-url";
|
|
26
|
+
readonly type: StringConstructor;
|
|
27
|
+
readonly description: "Url of forward server to connect to the device instead of the local network (LAN).";
|
|
28
|
+
readonly defaultValue: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
export declare const HOT_RELOAD_OPTION: {
|
|
31
|
+
readonly name: "hot-reload";
|
|
32
|
+
readonly type: BooleanConstructor;
|
|
33
|
+
readonly description: "Enable hot reload and build of applet";
|
|
34
|
+
readonly defaultValue: false;
|
|
35
|
+
};
|
|
18
36
|
export declare function killAppletServerIfRunningAndForceOption(dev: Development, options: CommandLineOptions<[typeof SERVER_FORCE_OPTION]>, appletUid: string | undefined, appletVersion: string | undefined, appletPort: number | undefined): Promise<void>;
|
|
@@ -36,8 +36,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.killAppletServerIfRunningAndForceOption = exports.SERVER_FORCE_OPTION = exports.SERVER_PORT_OPTION = exports.SERVER_PUBLIC_URL_OPTION = void 0;
|
|
39
|
+
exports.killAppletServerIfRunningAndForceOption = exports.HOT_RELOAD_OPTION = exports.FORWARD_SERVER_URL_OPTION = exports.DETACH_PROCESS_OPTION = exports.SERVER_FORCE_OPTION = exports.SERVER_PORT_OPTION = exports.SERVER_PUBLIC_URL_OPTION = void 0;
|
|
40
40
|
var log_1 = require("@signageos/sdk/dist/Console/log");
|
|
41
|
+
var parameters_1 = require("../parameters");
|
|
41
42
|
exports.SERVER_PUBLIC_URL_OPTION = {
|
|
42
43
|
name: 'server-public-url',
|
|
43
44
|
type: String,
|
|
@@ -53,6 +54,24 @@ exports.SERVER_FORCE_OPTION = {
|
|
|
53
54
|
type: Boolean,
|
|
54
55
|
description: 'Force start applet server even if it is already running on a different port. Kill the running server first.',
|
|
55
56
|
};
|
|
57
|
+
exports.DETACH_PROCESS_OPTION = {
|
|
58
|
+
name: 'detach',
|
|
59
|
+
type: Boolean,
|
|
60
|
+
description: 'Detach the applet HTTP server process from the terminal. Useful when want to run more commands reusing the same http server for current applet.',
|
|
61
|
+
defaultValue: false,
|
|
62
|
+
};
|
|
63
|
+
exports.FORWARD_SERVER_URL_OPTION = {
|
|
64
|
+
name: 'forward-server-url',
|
|
65
|
+
type: String,
|
|
66
|
+
description: 'Url of forward server to connect to the device instead of the local network (LAN).',
|
|
67
|
+
defaultValue: parameters_1.parameters.forwardServerUrl,
|
|
68
|
+
};
|
|
69
|
+
exports.HOT_RELOAD_OPTION = {
|
|
70
|
+
name: 'hot-reload',
|
|
71
|
+
type: Boolean,
|
|
72
|
+
description: "Enable hot reload and build of applet",
|
|
73
|
+
defaultValue: false,
|
|
74
|
+
};
|
|
56
75
|
function killAppletServerIfRunningAndForceOption(dev, options, appletUid, appletVersion, appletPort) {
|
|
57
76
|
return __awaiter(this, void 0, void 0, function () {
|
|
58
77
|
var force, runningAppletPort;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletServerHelper.js","sourceRoot":"","sources":["../../src/Applet/appletServerHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAsD;
|
|
1
|
+
{"version":3,"file":"appletServerHelper.js","sourceRoot":"","sources":["../../src/Applet/appletServerHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAsD;AAGtD,4CAA2C;AAE9B,QAAA,wBAAwB,GAAG;IACvC,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,iGAAiG;CACrG,CAAC;AAEE,QAAA,kBAAkB,GAAG;IACjC,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,4GAA4G;CAChH,CAAC;AAEE,QAAA,mBAAmB,GAAG;IAClC,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,6GAA6G;CACjH,CAAC;AAEE,QAAA,qBAAqB,GAAG;IACpC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,WAAW,EACV,iJAAiJ;IAClJ,YAAY,EAAE,KAAK;CACV,CAAC;AAEE,QAAA,yBAAyB,GAAG;IACxC,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,oFAAoF;IACjG,YAAY,EAAE,uBAAU,CAAC,gBAAgB;CAChC,CAAC;AAEE,QAAA,iBAAiB,GAAG;IAChC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,uCAAuC;IACpD,YAAY,EAAE,KAAK;CACV,CAAC;AAEX,SAAsB,uCAAuC,CAC5D,GAAgB,EAChB,OAAyD,EACzD,SAA6B,EAC7B,aAAiC,EACjC,UAA8B;;;;;;oBAE9B,IAAI,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE;wBACjC,sBAAO;qBACP;oBAEK,KAAK,GAAG,OAAO,CAAC,2BAAmB,CAAC,IAAI,CAAC,CAAC;oBAEtB,qBAAM,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,aAAa,CAAC,EAAA;;oBAAnF,iBAAiB,GAAG,SAA+D;yBACrF,CAAA,iBAAiB,IAAI,iBAAiB,KAAK,UAAU,CAAA,EAArD,wBAAqD;yBACpD,CAAC,KAAK,EAAN,wBAAM;oBACT,IAAA,SAAG,EACF,SAAS,EACT,mDAA4C,iBAAiB,kEAA+D,CAC5H,CAAC;;wBAEF,qBAAM,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,EAAE,aAAa,CAAC,EAAA;;oBAAlE,SAAkE,CAAC;;;;;;CAGrE;AAxBD,0FAwBC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CommandLineOptions } from '../../Command/commandDefinition';
|
|
2
|
+
export declare const OPTION_LIST: readonly [{
|
|
3
|
+
readonly name: "no-default-organization";
|
|
4
|
+
readonly type: BooleanConstructor;
|
|
5
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
|
|
6
|
+
}, {
|
|
7
|
+
readonly name: "organization-uid";
|
|
8
|
+
readonly type: StringConstructor;
|
|
9
|
+
readonly description: "Organization UID";
|
|
10
|
+
}];
|
|
11
|
+
export declare const customScriptUpload: {
|
|
12
|
+
name: "upload";
|
|
13
|
+
description: string;
|
|
14
|
+
optionList: readonly [{
|
|
15
|
+
readonly name: "no-default-organization";
|
|
16
|
+
readonly type: BooleanConstructor;
|
|
17
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
|
|
18
|
+
}, {
|
|
19
|
+
readonly name: "organization-uid";
|
|
20
|
+
readonly type: StringConstructor;
|
|
21
|
+
readonly description: "Organization UID";
|
|
22
|
+
}];
|
|
23
|
+
commands: never[];
|
|
24
|
+
run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.customScriptUpload = exports.OPTION_LIST = void 0;
|
|
51
|
+
var chalk_1 = require("chalk");
|
|
52
|
+
var util_1 = require("util");
|
|
53
|
+
var debug_1 = require("debug");
|
|
54
|
+
var log_1 = require("@signageos/sdk/dist/Console/log");
|
|
55
|
+
var commandDefinition_1 = require("../../Command/commandDefinition");
|
|
56
|
+
var helper_1 = require("../../helper");
|
|
57
|
+
var organizationFacade_1 = require("../../Organization/organizationFacade");
|
|
58
|
+
var customScriptFacade_1 = require("../customScriptFacade");
|
|
59
|
+
var debug = (0, debug_1.default)('@signageos/cli:CustomScript:Upload:Command');
|
|
60
|
+
exports.OPTION_LIST = [organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION, organizationFacade_1.ORGANIZATION_UID_OPTION];
|
|
61
|
+
exports.customScriptUpload = (0, commandDefinition_1.createCommandDefinition)({
|
|
62
|
+
name: 'upload',
|
|
63
|
+
description: 'Uploads current custom script version',
|
|
64
|
+
optionList: exports.OPTION_LIST,
|
|
65
|
+
commands: [],
|
|
66
|
+
run: function (options) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
+
var currentDirectory, organizationUid, organization, restApi, config, customScriptVersion, _a, _b, platform, e_1_1;
|
|
69
|
+
var e_1, _c;
|
|
70
|
+
return __generator(this, function (_d) {
|
|
71
|
+
switch (_d.label) {
|
|
72
|
+
case 0:
|
|
73
|
+
currentDirectory = process.cwd();
|
|
74
|
+
return [4 /*yield*/, (0, organizationFacade_1.getOrganizationUidOrDefaultOrSelect)(options)];
|
|
75
|
+
case 1:
|
|
76
|
+
organizationUid = _d.sent();
|
|
77
|
+
return [4 /*yield*/, (0, organizationFacade_1.getOrganization)(organizationUid)];
|
|
78
|
+
case 2:
|
|
79
|
+
organization = _d.sent();
|
|
80
|
+
return [4 /*yield*/, (0, helper_1.createOrganizationRestApi)(organization)];
|
|
81
|
+
case 3:
|
|
82
|
+
restApi = _d.sent();
|
|
83
|
+
return [4 /*yield*/, (0, customScriptFacade_1.getConfig)(currentDirectory)];
|
|
84
|
+
case 4:
|
|
85
|
+
config = _d.sent();
|
|
86
|
+
return [4 /*yield*/, (0, customScriptFacade_1.ensureCustomScriptVersion)(restApi, config)];
|
|
87
|
+
case 5:
|
|
88
|
+
customScriptVersion = _d.sent();
|
|
89
|
+
_d.label = 6;
|
|
90
|
+
case 6:
|
|
91
|
+
_d.trys.push([6, 11, 12, 13]);
|
|
92
|
+
_a = __values(Object.keys(config.platforms)), _b = _a.next();
|
|
93
|
+
_d.label = 7;
|
|
94
|
+
case 7:
|
|
95
|
+
if (!!_b.done) return [3 /*break*/, 10];
|
|
96
|
+
platform = _b.value;
|
|
97
|
+
return [4 /*yield*/, (0, customScriptFacade_1.uploadCode)({
|
|
98
|
+
restApi: restApi,
|
|
99
|
+
workDir: currentDirectory,
|
|
100
|
+
platform: platform,
|
|
101
|
+
config: config.platforms[platform],
|
|
102
|
+
customScriptVersion: customScriptVersion,
|
|
103
|
+
})];
|
|
104
|
+
case 8:
|
|
105
|
+
_d.sent();
|
|
106
|
+
_d.label = 9;
|
|
107
|
+
case 9:
|
|
108
|
+
_b = _a.next();
|
|
109
|
+
return [3 /*break*/, 7];
|
|
110
|
+
case 10: return [3 /*break*/, 13];
|
|
111
|
+
case 11:
|
|
112
|
+
e_1_1 = _d.sent();
|
|
113
|
+
e_1 = { error: e_1_1 };
|
|
114
|
+
return [3 /*break*/, 13];
|
|
115
|
+
case 12:
|
|
116
|
+
try {
|
|
117
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
118
|
+
}
|
|
119
|
+
finally { if (e_1) throw e_1.error; }
|
|
120
|
+
return [7 /*endfinally*/];
|
|
121
|
+
case 13:
|
|
122
|
+
if (!!(0, util_1.isDeepStrictEqual)(customScriptVersion.configDefinition, config.configDefinition)) return [3 /*break*/, 15];
|
|
123
|
+
debug('Config definition is different, updating custom script version.');
|
|
124
|
+
return [4 /*yield*/, restApi.customScript.version.update({
|
|
125
|
+
customScriptUid: customScriptVersion.customScriptUid,
|
|
126
|
+
version: customScriptVersion.version,
|
|
127
|
+
configDefinition: config.configDefinition,
|
|
128
|
+
})];
|
|
129
|
+
case 14:
|
|
130
|
+
_d.sent();
|
|
131
|
+
return [3 /*break*/, 16];
|
|
132
|
+
case 15:
|
|
133
|
+
debug('Config definition is the same, skipping update.');
|
|
134
|
+
_d.label = 16;
|
|
135
|
+
case 16:
|
|
136
|
+
(0, log_1.log)('info', "Custom Script ".concat(chalk_1.default.green(config.name), " version ").concat(chalk_1.default.green(config.version), " has been uploaded."));
|
|
137
|
+
return [2 /*return*/];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=customScriptUploadCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customScriptUploadCommand.js","sourceRoot":"","sources":["../../../src/CustomScript/Upload/customScriptUploadCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA0B;AAC1B,6BAAyC;AACzC,+BAA0B;AAC1B,uDAAsD;AACtD,qEAA8F;AAC9F,uCAAyD;AACzD,4EAK+C;AAC/C,4DAAyF;AAEzF,IAAM,KAAK,GAAG,IAAA,eAAK,EAAC,4CAA4C,CAAC,CAAC;AAErD,QAAA,WAAW,GAAG,CAAC,mDAA8B,EAAE,4CAAuB,CAAU,CAAC;AAEjF,QAAA,kBAAkB,GAAG,IAAA,2CAAuB,EAAC;IACzD,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,uCAAuC;IACpD,UAAU,EAAE,mBAAW;IACvB,QAAQ,EAAE,EAAE;IACN,GAAG,EAAT,UAAU,OAA+C;;;;;;;wBAClD,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;wBACf,qBAAM,IAAA,wDAAmC,EAAC,OAAO,CAAC,EAAA;;wBAApE,e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