@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.
- package/CHANGELOG.md +16 -0
- package/README.md +16 -1
- package/config/parameters.d.ts +1 -0
- package/config/parameters.js +4 -0
- package/dist/Applet/Generate/appletGenerateCommand.d.ts +44 -2
- package/dist/Applet/Generate/appletGenerateCommand.js +44 -35
- package/dist/Applet/Generate/appletGenerateCommand.js.map +1 -1
- package/dist/Applet/Start/appletStartCommand.d.ts +59 -2
- package/dist/Applet/Start/appletStartCommand.js +31 -22
- package/dist/Applet/Start/appletStartCommand.js.map +1 -1
- package/dist/Applet/Start/appletStartCommandHelper.d.ts +3 -2
- package/dist/Applet/Start/appletStartCommandHelper.js +5 -4
- package/dist/Applet/Start/appletStartCommandHelper.js.map +1 -1
- package/dist/Applet/Test/Upload/appletTestRunCommand.d.ts +52 -2
- package/dist/Applet/Test/Upload/appletTestRunCommand.js +44 -36
- package/dist/Applet/Test/Upload/appletTestRunCommand.js.map +1 -1
- package/dist/Applet/Test/Upload/appletTestRunFacade.js +2 -1
- package/dist/Applet/Test/Upload/appletTestRunFacade.js.map +1 -1
- package/dist/Applet/Test/Upload/appletTestUploadCommand.d.ts +42 -2
- package/dist/Applet/Test/Upload/appletTestUploadCommand.js +45 -37
- package/dist/Applet/Test/Upload/appletTestUploadCommand.js.map +1 -1
- package/dist/Applet/Test/Upload/appletTestUploadFacade.js +2 -1
- package/dist/Applet/Test/Upload/appletTestUploadFacade.js.map +1 -1
- package/dist/Applet/Test/appletTestCommand.d.ts +93 -2
- package/dist/Applet/Test/appletTestCommand.js +4 -2
- package/dist/Applet/Test/appletTestCommand.js.map +1 -1
- package/dist/Applet/Upload/appletUploadCommand.d.ts +63 -5
- package/dist/Applet/Upload/appletUploadCommand.js +142 -150
- package/dist/Applet/Upload/appletUploadCommand.js.map +1 -1
- package/dist/Applet/Upload/appletUploadCommandHelper.d.ts +17 -5
- package/dist/Applet/Upload/appletUploadCommandHelper.js +30 -47
- package/dist/Applet/Upload/appletUploadCommandHelper.js.map +1 -1
- package/dist/Applet/Upload/appletUploadFacade.d.ts +0 -7
- package/dist/Applet/Upload/appletUploadFacade.js +21 -23
- package/dist/Applet/Upload/appletUploadFacade.js.map +1 -1
- package/dist/Applet/Upload/appletUploadFacadeHelper.js +5 -4
- package/dist/Applet/Upload/appletUploadFacadeHelper.js.map +1 -1
- package/dist/Applet/appletCommand.d.ts +257 -2
- package/dist/Applet/appletCommand.js +4 -2
- package/dist/Applet/appletCommand.js.map +1 -1
- package/dist/Applet/appletFacade.d.ts +1 -3
- package/dist/Applet/appletFacade.js +28 -53
- package/dist/Applet/appletFacade.js.map +1 -1
- package/dist/Auth/loginCommand.d.ts +18 -2
- package/dist/Auth/loginCommand.js +16 -13
- package/dist/Auth/loginCommand.js.map +1 -1
- package/dist/Cache/tmpCache.js +1 -0
- package/dist/Cache/tmpCache.js.map +1 -1
- package/dist/Cli/helper.js +1 -0
- package/dist/Cli/helper.js.map +1 -1
- package/dist/Cli/packageVersion.d.ts +0 -6
- package/dist/Cli/packageVersion.js +10 -15
- package/dist/Cli/packageVersion.js.map +1 -1
- package/dist/Command/commandDefinition.d.ts +28 -0
- package/dist/Command/commandDefinition.js +8 -0
- package/dist/Command/commandDefinition.js.map +1 -0
- package/dist/Command/commandProcessor.d.ts +2 -10
- package/dist/Command/commandProcessor.js +13 -20
- package/dist/Command/commandProcessor.js.map +1 -1
- package/dist/Command/globalArgs.d.ts +2 -0
- package/dist/Command/globalArgs.js +16 -0
- package/dist/Command/globalArgs.js.map +1 -0
- package/dist/CommandLine/progressBarFactory.js +1 -0
- package/dist/CommandLine/progressBarFactory.js.map +1 -1
- package/dist/Device/Connect/connectCommand.d.ts +50 -2
- package/dist/Device/Connect/connectCommand.js +23 -18
- package/dist/Device/Connect/connectCommand.js.map +1 -1
- package/dist/Device/Connect/connectHelper.d.ts +0 -1
- package/dist/Device/Connect/connectHelper.js +39 -75
- package/dist/Device/Connect/connectHelper.js.map +1 -1
- package/dist/Device/Content/setContentCommand.d.ts +42 -2
- package/dist/Device/Content/setContentCommand.js +21 -13
- package/dist/Device/Content/setContentCommand.js.map +1 -1
- package/dist/Device/PowerAction/powerActionCommand.d.ts +42 -2
- package/dist/Device/PowerAction/powerActionCommand.js +17 -13
- package/dist/Device/PowerAction/powerActionCommand.js.map +1 -1
- package/dist/Device/deviceCommand.d.ts +129 -2
- package/dist/Device/deviceCommand.js +4 -2
- package/dist/Device/deviceCommand.js.map +1 -1
- package/dist/Device/deviceFacade.d.ts +11 -10
- package/dist/Device/deviceFacade.js +20 -15
- package/dist/Device/deviceFacade.js.map +1 -1
- package/dist/Emulator/createDomain.js +3 -2
- package/dist/Emulator/createDomain.js.map +1 -1
- package/dist/Emulator/emulatorFacade.d.ts +3 -1
- package/dist/Emulator/emulatorFacade.js +29 -27
- package/dist/Emulator/emulatorFacade.js.map +1 -1
- package/dist/Emulator/emulatorFactory.d.ts +3 -1
- package/dist/Emulator/emulatorFactory.js +19 -17
- package/dist/Emulator/emulatorFactory.js.map +1 -1
- package/dist/FileSystem/helper.js +21 -15
- package/dist/FileSystem/helper.js.map +1 -1
- package/dist/FileSystem/packageConfig.js +1 -0
- package/dist/FileSystem/packageConfig.js.map +1 -1
- package/dist/Firmware/Upload/firmwareUploadCommand.d.ts +48 -2
- package/dist/Firmware/Upload/firmwareUploadCommand.js +33 -20
- package/dist/Firmware/Upload/firmwareUploadCommand.js.map +1 -1
- package/dist/Firmware/Upload/firmwareUploadFacade.js +5 -4
- package/dist/Firmware/Upload/firmwareUploadFacade.js.map +1 -1
- package/dist/Firmware/Upload/firmwareUploadHelper.js +2 -2
- package/dist/Firmware/Upload/firmwareUploadHelper.js.map +1 -1
- package/dist/Firmware/firmwareCommand.d.ts +51 -2
- package/dist/Firmware/firmwareCommand.js +5 -8
- package/dist/Firmware/firmwareCommand.js.map +1 -1
- package/dist/Helper/localMachineHelper.d.ts +1 -0
- package/dist/Helper/localMachineHelper.js +94 -0
- package/dist/Helper/localMachineHelper.js.map +1 -0
- package/dist/Organization/Get/organizationGetCommand.d.ts +26 -2
- package/dist/Organization/Get/organizationGetCommand.js +11 -7
- package/dist/Organization/Get/organizationGetCommand.js.map +1 -1
- package/dist/Organization/List/organizationListCommand.d.ts +7 -2
- package/dist/Organization/List/organizationListCommand.js +6 -4
- package/dist/Organization/List/organizationListCommand.js.map +1 -1
- package/dist/Organization/SetDefault/organizationSetDefaultCommand.d.ts +18 -2
- package/dist/Organization/SetDefault/organizationSetDefaultCommand.js +12 -9
- package/dist/Organization/SetDefault/organizationSetDefaultCommand.js.map +1 -1
- package/dist/Organization/organizationCommand.d.ts +49 -2
- package/dist/Organization/organizationCommand.js +4 -2
- package/dist/Organization/organizationCommand.js.map +1 -1
- package/dist/Organization/organizationFacade.d.ts +20 -5
- package/dist/Organization/organizationFacade.js +60 -12
- package/dist/Organization/organizationFacade.js.map +1 -1
- package/dist/RunControl/runControlHelper.d.ts +1 -1
- package/dist/RunControl/runControlHelper.js +38 -14
- package/dist/RunControl/runControlHelper.js.map +1 -1
- package/dist/Stream/helper.js +1 -0
- package/dist/Stream/helper.js.map +1 -1
- package/dist/Timing/List/timingListCommand.d.ts +34 -2
- package/dist/Timing/List/timingListCommand.js +14 -10
- package/dist/Timing/List/timingListCommand.js.map +1 -1
- package/dist/Timing/timingCommand.d.ts +37 -2
- package/dist/Timing/timingCommand.js +4 -2
- package/dist/Timing/timingCommand.js.map +1 -1
- package/dist/generalCommand.d.ts +64 -0
- package/dist/generalCommand.js +46 -0
- package/dist/generalCommand.js.map +1 -0
- package/dist/helper.d.ts +6 -2
- package/dist/helper.js +13 -12
- package/dist/helper.js.map +1 -1
- package/dist/index.js +6 -18
- package/dist/index.js.map +1 -1
- package/package-lock.json +1094 -870
- package/package.json +14 -13
- package/dist/Command/ICommand.d.ts +0 -10
- package/dist/Command/ICommand.js +0 -3
- package/dist/Command/ICommand.js.map +0 -1
|
@@ -36,39 +36,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getAppletEntryFileRelativePath = exports.getAppletEntryFileAbsolutePath = exports.getAppletBinaryFileAbsolutePath = exports.getAppletDirectoryAbsolutePath = exports.DEFAULT_APPLET_BINARY_FILE_PATH = exports.DEFAULT_APPLET_ENTRY_FILE_PATH = exports.DEFAULT_APPLET_DIR_PATH = exports.APPLET_PATH_OPTION = exports.ENTRY_FILE_PATH_OPTION = void 0;
|
|
39
40
|
var fs = require("fs-extra");
|
|
40
41
|
var path = require("path");
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
organizationUid = config.defaultOrganizationUid;
|
|
55
|
-
}
|
|
56
|
-
if (!!organizationUid) return [3 /*break*/, 4];
|
|
57
|
-
return [4 /*yield*/, organizationFacade_1.getOrganizationUid(options)];
|
|
58
|
-
case 2:
|
|
59
|
-
organizationUid = _a.sent();
|
|
60
|
-
return [4 /*yield*/, runControlHelper_1.updateConfig({
|
|
61
|
-
defaultOrganizationUid: organizationUid,
|
|
62
|
-
})];
|
|
63
|
-
case 3:
|
|
64
|
-
_a.sent();
|
|
65
|
-
_a.label = 4;
|
|
66
|
-
case 4: return [2 /*return*/, organizationUid];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
exports.getOrganizationUidAndUpdateConfig = getOrganizationUidAndUpdateConfig;
|
|
42
|
+
exports.ENTRY_FILE_PATH_OPTION = {
|
|
43
|
+
name: 'entry-file-path',
|
|
44
|
+
type: String,
|
|
45
|
+
description: 'Path to the applet entry file. Relative to the command or absolute.',
|
|
46
|
+
};
|
|
47
|
+
exports.APPLET_PATH_OPTION = {
|
|
48
|
+
name: 'applet-path',
|
|
49
|
+
type: String,
|
|
50
|
+
description: 'Path to the applet file or the project folder depending on the entry file. Relative to the command or absolute.',
|
|
51
|
+
};
|
|
52
|
+
exports.DEFAULT_APPLET_DIR_PATH = '.';
|
|
53
|
+
exports.DEFAULT_APPLET_ENTRY_FILE_PATH = 'dist/index.html';
|
|
54
|
+
exports.DEFAULT_APPLET_BINARY_FILE_PATH = 'dist/index.html';
|
|
72
55
|
function getAppletDirectoryAbsolutePath(currentDirectory, options) {
|
|
73
56
|
return __awaiter(this, void 0, void 0, function () {
|
|
74
57
|
var appletDirectoryPath, appletDirectoryPathExists, isDirectory;
|
|
@@ -77,7 +60,7 @@ function getAppletDirectoryAbsolutePath(currentDirectory, options) {
|
|
|
77
60
|
case 0:
|
|
78
61
|
appletDirectoryPath = options['applet-path'];
|
|
79
62
|
if (!appletDirectoryPath) {
|
|
80
|
-
appletDirectoryPath =
|
|
63
|
+
appletDirectoryPath = exports.DEFAULT_APPLET_DIR_PATH;
|
|
81
64
|
}
|
|
82
65
|
if (!path.isAbsolute(appletDirectoryPath)) {
|
|
83
66
|
appletDirectoryPath = path.join(currentDirectory, appletDirectoryPath);
|
|
@@ -85,18 +68,18 @@ function getAppletDirectoryAbsolutePath(currentDirectory, options) {
|
|
|
85
68
|
if (appletDirectoryPath.length > 1 && appletDirectoryPath[appletDirectoryPath.length - 1] === '/') {
|
|
86
69
|
appletDirectoryPath = appletDirectoryPath.substring(0, appletDirectoryPath.length - 1);
|
|
87
70
|
}
|
|
88
|
-
console.log("\nUse applet project directory path: "
|
|
71
|
+
console.log("\nUse applet project directory path: ".concat(appletDirectoryPath));
|
|
89
72
|
return [4 /*yield*/, fs.pathExists(appletDirectoryPath)];
|
|
90
73
|
case 1:
|
|
91
74
|
appletDirectoryPathExists = _a.sent();
|
|
92
75
|
if (!appletDirectoryPathExists) {
|
|
93
|
-
throw new Error("Applet project directory not found: "
|
|
76
|
+
throw new Error("Applet project directory not found: ".concat(appletDirectoryPath));
|
|
94
77
|
}
|
|
95
78
|
return [4 /*yield*/, fs.stat(appletDirectoryPath)];
|
|
96
79
|
case 2:
|
|
97
80
|
isDirectory = (_a.sent()).isDirectory();
|
|
98
81
|
if (!isDirectory) {
|
|
99
|
-
throw new Error("Applet project path is not a directory: "
|
|
82
|
+
throw new Error("Applet project path is not a directory: ".concat(appletDirectoryPath));
|
|
100
83
|
}
|
|
101
84
|
return [2 /*return*/, appletDirectoryPath];
|
|
102
85
|
}
|
|
@@ -112,23 +95,23 @@ function getAppletBinaryFileAbsolutePath(currentDirectory, options) {
|
|
|
112
95
|
case 0:
|
|
113
96
|
appletBinaryFilePath = options['applet-path'];
|
|
114
97
|
if (!appletBinaryFilePath) {
|
|
115
|
-
appletBinaryFilePath =
|
|
98
|
+
appletBinaryFilePath = exports.DEFAULT_APPLET_BINARY_FILE_PATH;
|
|
116
99
|
}
|
|
117
100
|
if (!path.isAbsolute(appletBinaryFilePath)) {
|
|
118
101
|
appletBinaryFilePath = path.join(currentDirectory, appletBinaryFilePath);
|
|
119
102
|
}
|
|
120
|
-
console.log("\nUse applet binary file: "
|
|
103
|
+
console.log("\nUse applet binary file: ".concat(appletBinaryFilePath));
|
|
121
104
|
return [4 /*yield*/, fs.pathExists(appletBinaryFilePath)];
|
|
122
105
|
case 1:
|
|
123
106
|
appletBinaryFilePathExists = _a.sent();
|
|
124
107
|
if (!appletBinaryFilePathExists) {
|
|
125
|
-
throw new Error("Applet binary file not found: "
|
|
108
|
+
throw new Error("Applet binary file not found: ".concat(appletBinaryFilePath));
|
|
126
109
|
}
|
|
127
110
|
return [4 /*yield*/, fs.stat(appletBinaryFilePath)];
|
|
128
111
|
case 2:
|
|
129
112
|
isFile = (_a.sent()).isFile();
|
|
130
113
|
if (!isFile) {
|
|
131
|
-
throw new Error("Applet binary path is not a file: "
|
|
114
|
+
throw new Error("Applet binary path is not a file: ".concat(appletBinaryFilePath));
|
|
132
115
|
}
|
|
133
116
|
return [2 /*return*/, appletBinaryFilePath];
|
|
134
117
|
}
|
|
@@ -144,23 +127,23 @@ function getAppletEntryFileAbsolutePath(currentDirectory, options) {
|
|
|
144
127
|
case 0:
|
|
145
128
|
appletEntryFilePath = options['entry-file-path'];
|
|
146
129
|
if (!appletEntryFilePath) {
|
|
147
|
-
appletEntryFilePath =
|
|
130
|
+
appletEntryFilePath = exports.DEFAULT_APPLET_ENTRY_FILE_PATH;
|
|
148
131
|
}
|
|
149
132
|
if (!path.isAbsolute(appletEntryFilePath)) {
|
|
150
133
|
appletEntryFilePath = path.join(currentDirectory, appletEntryFilePath);
|
|
151
134
|
}
|
|
152
|
-
console.log("\nUse applet entry file: "
|
|
135
|
+
console.log("\nUse applet entry file: ".concat(appletEntryFilePath));
|
|
153
136
|
return [4 /*yield*/, fs.pathExists(appletEntryFilePath)];
|
|
154
137
|
case 1:
|
|
155
138
|
appletEntryFilePathExists = _a.sent();
|
|
156
139
|
if (!appletEntryFilePathExists) {
|
|
157
|
-
throw new Error("Applet entry file not found: "
|
|
140
|
+
throw new Error("Applet entry file not found: ".concat(appletEntryFilePath, " , did you forget to build your applet?"));
|
|
158
141
|
}
|
|
159
142
|
return [4 /*yield*/, fs.stat(appletEntryFilePath)];
|
|
160
143
|
case 2:
|
|
161
144
|
isFile = (_a.sent()).isFile();
|
|
162
145
|
if (!isFile) {
|
|
163
|
-
throw new Error("Applet entry path is not a file: "
|
|
146
|
+
throw new Error("Applet entry path is not a file: ".concat(appletEntryFilePath));
|
|
164
147
|
}
|
|
165
148
|
return [2 /*return*/, appletEntryFilePath];
|
|
166
149
|
}
|
|
@@ -172,16 +155,16 @@ function getAppletEntryFileRelativePath(entryFileAbsolutePath, appletDirectoryAb
|
|
|
172
155
|
var appletDirectoryAbsolutePathNormalized = path.normalize(appletDirectoryAbsolutePath);
|
|
173
156
|
var entryFileAbsolutePathNormalized = path.normalize(entryFileAbsolutePath);
|
|
174
157
|
if (!path.isAbsolute(entryFileAbsolutePathNormalized)) {
|
|
175
|
-
throw new Error("Internal Error: Try input relative entry file path. Current path: "
|
|
158
|
+
throw new Error("Internal Error: Try input relative entry file path. Current path: ".concat(entryFileAbsolutePathNormalized));
|
|
176
159
|
}
|
|
177
160
|
if (!path.isAbsolute(appletDirectoryAbsolutePathNormalized)) {
|
|
178
|
-
throw new Error("Internal Error: Try input relative applet directory path. Current path: "
|
|
161
|
+
throw new Error("Internal Error: Try input relative applet directory path. Current path: ".concat(appletDirectoryAbsolutePathNormalized));
|
|
179
162
|
}
|
|
180
163
|
var isEntryFileInAppletDir = entryFileAbsolutePathNormalized.startsWith(appletDirectoryAbsolutePathNormalized);
|
|
181
164
|
if (!isEntryFileInAppletDir) {
|
|
182
165
|
throw new Error("Applet entry file must be in the applet directory." +
|
|
183
|
-
|
|
184
|
-
|
|
166
|
+
"\nEntry file path: ".concat(entryFileAbsolutePathNormalized) +
|
|
167
|
+
"\nApplet directory path: ".concat(appletDirectoryAbsolutePathNormalized));
|
|
185
168
|
}
|
|
186
169
|
var entryFileRelativePath = entryFileAbsolutePathNormalized.substring(appletDirectoryAbsolutePathNormalized.length + 1);
|
|
187
170
|
return entryFileRelativePath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletUploadCommandHelper.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadCommandHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"appletUploadCommandHelper.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadCommandHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA+B;AAC/B,2BAA6B;AAGhB,QAAA,sBAAsB,GAAG;IACrC,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,qEAAqE;CACzE,CAAC;AAEE,QAAA,kBAAkB,GAAG;IACjC,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,MAAM;IAC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AAqC,CAAE,CAAC,CAAC;KACrE;IAED,IAAM,qBAAqB,GAAG,+BAA+B,CAAC,SAAS,CAAC,qCAAqC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE1H,OAAO,qBAAqB,CAAC;AAC9B,CAAC;AArBD,wEAqBC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import RestApi from '@signageos/sdk/dist/RestApi/RestApi';
|
|
2
2
|
import { ProgressBar } from '../../CommandLine/IProgressBar';
|
|
3
|
-
export declare const DEFAULT_APPLET_DIR_PATH = ".";
|
|
4
|
-
export declare const DEFAULT_APPLET_ENTRY_FILE_PATH = "dist/index.html";
|
|
5
|
-
export declare const DEFAULT_APPLET_BINARY_FILE_PATH = "dist/index.html";
|
|
6
3
|
export declare function updateSingleFileApplet(parameters: {
|
|
7
4
|
restApi: RestApi;
|
|
8
5
|
applet: {
|
|
9
6
|
uid: string;
|
|
10
7
|
version: string;
|
|
11
|
-
frontAppletVersion: string;
|
|
12
8
|
binaryFilePath: string;
|
|
13
9
|
};
|
|
14
10
|
}): Promise<void>;
|
|
@@ -17,7 +13,6 @@ export declare const updateMultiFileApplet: (parameters: {
|
|
|
17
13
|
applet: {
|
|
18
14
|
uid: string;
|
|
19
15
|
version: string;
|
|
20
|
-
frontAppletVersion: string;
|
|
21
16
|
entryFilePath: string;
|
|
22
17
|
directoryPath: string;
|
|
23
18
|
files: string[];
|
|
@@ -29,7 +24,6 @@ export declare const createSingleFileApplet: (parameters: {
|
|
|
29
24
|
applet: {
|
|
30
25
|
uid: string;
|
|
31
26
|
version: string;
|
|
32
|
-
frontAppletVersion: string;
|
|
33
27
|
binaryFilePath: string;
|
|
34
28
|
};
|
|
35
29
|
}) => Promise<void>;
|
|
@@ -38,7 +32,6 @@ export declare const createMultiFileFileApplet: (parameters: {
|
|
|
38
32
|
applet: {
|
|
39
33
|
uid: string;
|
|
40
34
|
version: string;
|
|
41
|
-
frontAppletVersion: string;
|
|
42
35
|
entryFilePath: string;
|
|
43
36
|
directoryPath: string;
|
|
44
37
|
files: 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.createMultiFileFileApplet = exports.createSingleFileApplet = exports.updateMultiFileApplet = exports.updateSingleFileApplet = void 0;
|
|
39
40
|
var path = require("path");
|
|
40
41
|
var fs = require("fs-extra");
|
|
41
42
|
var chalk_1 = require("chalk");
|
|
@@ -44,9 +45,6 @@ var NotFoundError_1 = require("@signageos/sdk/dist/RestApi/Error/NotFoundError")
|
|
|
44
45
|
var appletUploadFacadeHelper_1 = require("./appletUploadFacadeHelper");
|
|
45
46
|
var helper_1 = require("../../FileSystem/helper");
|
|
46
47
|
var debug = Debug('@signageos/cli:Applet:Upload:appletUploadFacade');
|
|
47
|
-
exports.DEFAULT_APPLET_DIR_PATH = '.';
|
|
48
|
-
exports.DEFAULT_APPLET_ENTRY_FILE_PATH = 'dist/index.html';
|
|
49
|
-
exports.DEFAULT_APPLET_BINARY_FILE_PATH = 'dist/index.html';
|
|
50
48
|
function updateSingleFileApplet(parameters) {
|
|
51
49
|
return __awaiter(this, void 0, void 0, function () {
|
|
52
50
|
var restApi, applet, appletBinary;
|
|
@@ -57,7 +55,6 @@ function updateSingleFileApplet(parameters) {
|
|
|
57
55
|
appletBinary = fs.createReadStream(applet.binaryFilePath, { encoding: 'utf8' });
|
|
58
56
|
return [4 /*yield*/, restApi.applet.version.update(applet.uid, applet.version, {
|
|
59
57
|
binary: appletBinary,
|
|
60
|
-
frontAppletVersion: applet.frontAppletVersion,
|
|
61
58
|
})];
|
|
62
59
|
case 1:
|
|
63
60
|
_a.sent();
|
|
@@ -67,19 +64,18 @@ function updateSingleFileApplet(parameters) {
|
|
|
67
64
|
});
|
|
68
65
|
}
|
|
69
66
|
exports.updateSingleFileApplet = updateSingleFileApplet;
|
|
70
|
-
|
|
67
|
+
var updateMultiFileApplet = function (parameters) { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
68
|
var restApi, applet, progressBar, currentAppletFiles, changedFilesCounter, appletEntryFilePosixPath, index, fileAbsolutePath, fileRelativePath, fileRelativePosixPath, fileSize, fileHash, fileType, currentFileHash, currentFileType, fileStream, error_1, _a, _b, _i, fileRelativePath, error_2;
|
|
72
69
|
return __generator(this, function (_c) {
|
|
73
70
|
switch (_c.label) {
|
|
74
71
|
case 0:
|
|
75
72
|
restApi = parameters.restApi, applet = parameters.applet, progressBar = parameters.progressBar;
|
|
76
|
-
return [4 /*yield*/, appletUploadFacadeHelper_1.getAppletFilesDictionary(restApi, applet.uid, applet.version)];
|
|
73
|
+
return [4 /*yield*/, (0, appletUploadFacadeHelper_1.getAppletFilesDictionary)(restApi, applet.uid, applet.version)];
|
|
77
74
|
case 1:
|
|
78
75
|
currentAppletFiles = _c.sent();
|
|
79
76
|
changedFilesCounter = 0;
|
|
80
77
|
appletEntryFilePosixPath = path.posix.normalize(applet.entryFilePath.replace(/\\/g, '/'));
|
|
81
78
|
return [4 /*yield*/, restApi.applet.version.update(applet.uid, applet.version, {
|
|
82
|
-
frontAppletVersion: applet.frontAppletVersion,
|
|
83
79
|
entryFile: appletEntryFilePosixPath,
|
|
84
80
|
})];
|
|
85
81
|
case 2:
|
|
@@ -89,15 +85,15 @@ exports.updateMultiFileApplet = function (parameters) { return __awaiter(void 0,
|
|
|
89
85
|
case 3:
|
|
90
86
|
if (!(index < applet.files.length)) return [3 /*break*/, 12];
|
|
91
87
|
fileAbsolutePath = applet.files[index];
|
|
92
|
-
fileRelativePath = appletUploadFacadeHelper_1.getAppletFileRelativePath(fileAbsolutePath, applet.directoryPath);
|
|
88
|
+
fileRelativePath = (0, appletUploadFacadeHelper_1.getAppletFileRelativePath)(fileAbsolutePath, applet.directoryPath);
|
|
93
89
|
fileRelativePosixPath = path.posix.normalize(fileRelativePath.replace(/\\/g, '/'));
|
|
94
90
|
return [4 /*yield*/, fs.stat(fileAbsolutePath)];
|
|
95
91
|
case 4:
|
|
96
92
|
fileSize = (_c.sent()).size;
|
|
97
|
-
return [4 /*yield*/, helper_1.computeFileMD5(fileAbsolutePath)];
|
|
93
|
+
return [4 /*yield*/, (0, helper_1.computeFileMD5)(fileAbsolutePath)];
|
|
98
94
|
case 5:
|
|
99
95
|
fileHash = _c.sent();
|
|
100
|
-
return [4 /*yield*/, helper_1.getFileType(fileAbsolutePath)];
|
|
96
|
+
return [4 /*yield*/, (0, helper_1.getFileType)(fileAbsolutePath)];
|
|
101
97
|
case 6:
|
|
102
98
|
fileType = _c.sent();
|
|
103
99
|
currentFileHash = currentAppletFiles[fileRelativePosixPath] ? currentAppletFiles[fileRelativePosixPath].hash : undefined;
|
|
@@ -109,7 +105,7 @@ exports.updateMultiFileApplet = function (parameters) { return __awaiter(void 0,
|
|
|
109
105
|
}
|
|
110
106
|
else {
|
|
111
107
|
changedFilesCounter++;
|
|
112
|
-
console.log(chalk_1.default.yellow(" Uploading "
|
|
108
|
+
console.log(chalk_1.default.yellow(" Uploading ".concat(fileAbsolutePath)));
|
|
113
109
|
}
|
|
114
110
|
if (progressBar) {
|
|
115
111
|
progressBar.init({ size: fileSize, name: fileRelativePath });
|
|
@@ -138,7 +134,7 @@ exports.updateMultiFileApplet = function (parameters) { return __awaiter(void 0,
|
|
|
138
134
|
case 10:
|
|
139
135
|
error_1 = _c.sent();
|
|
140
136
|
if (fileSize === 0) {
|
|
141
|
-
throw new Error("Empty files are temporarily disallowed "
|
|
137
|
+
throw new Error("Empty files are temporarily disallowed ".concat(fileAbsolutePath));
|
|
142
138
|
}
|
|
143
139
|
throw error_1;
|
|
144
140
|
case 11:
|
|
@@ -172,7 +168,7 @@ exports.updateMultiFileApplet = function (parameters) { return __awaiter(void 0,
|
|
|
172
168
|
* It's not expected behavior but the running CLI command shouldn't fail because of it.
|
|
173
169
|
* Probably it's caused by some other process interfering.
|
|
174
170
|
*/
|
|
175
|
-
debug("remove old file "
|
|
171
|
+
debug("remove old file ".concat(fileRelativePath, " failed"));
|
|
176
172
|
}
|
|
177
173
|
else {
|
|
178
174
|
throw error_2;
|
|
@@ -186,13 +182,14 @@ exports.updateMultiFileApplet = function (parameters) { return __awaiter(void 0,
|
|
|
186
182
|
return [3 /*break*/, 13];
|
|
187
183
|
case 19:
|
|
188
184
|
if (changedFilesCounter === 0) {
|
|
189
|
-
console.log("No files changed in "
|
|
185
|
+
console.log("No files changed in ".concat(chalk_1.default.yellow.bold(applet.directoryPath)));
|
|
190
186
|
}
|
|
191
187
|
return [2 /*return*/];
|
|
192
188
|
}
|
|
193
189
|
});
|
|
194
190
|
}); };
|
|
195
|
-
exports.
|
|
191
|
+
exports.updateMultiFileApplet = updateMultiFileApplet;
|
|
192
|
+
var createSingleFileApplet = function (parameters) { return __awaiter(void 0, void 0, void 0, function () {
|
|
196
193
|
var restApi, applet, appletBinary;
|
|
197
194
|
return __generator(this, function (_a) {
|
|
198
195
|
switch (_a.label) {
|
|
@@ -202,7 +199,7 @@ exports.createSingleFileApplet = function (parameters) { return __awaiter(void 0
|
|
|
202
199
|
return [4 /*yield*/, restApi.applet.version.create(applet.uid, {
|
|
203
200
|
binary: appletBinary,
|
|
204
201
|
version: applet.version,
|
|
205
|
-
frontAppletVersion: applet
|
|
202
|
+
frontAppletVersion: '', // Back compatibility requires to setup front-applet version in UI
|
|
206
203
|
})];
|
|
207
204
|
case 1:
|
|
208
205
|
_a.sent();
|
|
@@ -210,7 +207,8 @@ exports.createSingleFileApplet = function (parameters) { return __awaiter(void 0
|
|
|
210
207
|
}
|
|
211
208
|
});
|
|
212
209
|
}); };
|
|
213
|
-
exports.
|
|
210
|
+
exports.createSingleFileApplet = createSingleFileApplet;
|
|
211
|
+
var createMultiFileFileApplet = function (parameters) { return __awaiter(void 0, void 0, void 0, function () {
|
|
214
212
|
var restApi, applet, progressBar, appletEntryFilePosixPath, index, fileAbsolutePath, fileRelativePath, fileHash, fileType, fileSize, fileStream, filePosixPath, error_3;
|
|
215
213
|
return __generator(this, function (_a) {
|
|
216
214
|
switch (_a.label) {
|
|
@@ -219,7 +217,6 @@ exports.createMultiFileFileApplet = function (parameters) { return __awaiter(voi
|
|
|
219
217
|
appletEntryFilePosixPath = path.posix.normalize(applet.entryFilePath.replace(/\\/g, '/'));
|
|
220
218
|
return [4 /*yield*/, restApi.applet.version.create(applet.uid, {
|
|
221
219
|
version: applet.version,
|
|
222
|
-
frontAppletVersion: applet.frontAppletVersion,
|
|
223
220
|
entryFile: appletEntryFilePosixPath,
|
|
224
221
|
})];
|
|
225
222
|
case 1:
|
|
@@ -229,11 +226,11 @@ exports.createMultiFileFileApplet = function (parameters) { return __awaiter(voi
|
|
|
229
226
|
case 2:
|
|
230
227
|
if (!(index < applet.files.length)) return [3 /*break*/, 10];
|
|
231
228
|
fileAbsolutePath = applet.files[index];
|
|
232
|
-
fileRelativePath = appletUploadFacadeHelper_1.getAppletFileRelativePath(fileAbsolutePath, applet.directoryPath);
|
|
233
|
-
return [4 /*yield*/, helper_1.computeFileMD5(fileAbsolutePath)];
|
|
229
|
+
fileRelativePath = (0, appletUploadFacadeHelper_1.getAppletFileRelativePath)(fileAbsolutePath, applet.directoryPath);
|
|
230
|
+
return [4 /*yield*/, (0, helper_1.computeFileMD5)(fileAbsolutePath)];
|
|
234
231
|
case 3:
|
|
235
232
|
fileHash = _a.sent();
|
|
236
|
-
return [4 /*yield*/, helper_1.getFileType(fileAbsolutePath)];
|
|
233
|
+
return [4 /*yield*/, (0, helper_1.getFileType)(fileAbsolutePath)];
|
|
237
234
|
case 4:
|
|
238
235
|
fileType = _a.sent();
|
|
239
236
|
return [4 /*yield*/, fs.stat(fileAbsolutePath)];
|
|
@@ -253,7 +250,7 @@ exports.createMultiFileFileApplet = function (parameters) { return __awaiter(voi
|
|
|
253
250
|
_a.label = 6;
|
|
254
251
|
case 6:
|
|
255
252
|
_a.trys.push([6, 8, , 9]);
|
|
256
|
-
console.log(chalk_1.default.yellow(" Uploading "
|
|
253
|
+
console.log(chalk_1.default.yellow(" Uploading ".concat(fileAbsolutePath)));
|
|
257
254
|
return [4 /*yield*/, restApi.applet.version.file.create(applet.uid, applet.version, {
|
|
258
255
|
name: path.basename(filePosixPath),
|
|
259
256
|
path: filePosixPath,
|
|
@@ -268,7 +265,7 @@ exports.createMultiFileFileApplet = function (parameters) { return __awaiter(voi
|
|
|
268
265
|
case 8:
|
|
269
266
|
error_3 = _a.sent();
|
|
270
267
|
if (fileSize === 0) {
|
|
271
|
-
throw new Error("Empty files are temporarily disallowed "
|
|
268
|
+
throw new Error("Empty files are temporarily disallowed ".concat(fileAbsolutePath));
|
|
272
269
|
}
|
|
273
270
|
throw error_3;
|
|
274
271
|
case 9:
|
|
@@ -282,4 +279,5 @@ exports.createMultiFileFileApplet = function (parameters) { return __awaiter(voi
|
|
|
282
279
|
}
|
|
283
280
|
});
|
|
284
281
|
}); };
|
|
282
|
+
exports.createMultiFileFileApplet = createMultiFileFileApplet;
|
|
285
283
|
//# sourceMappingURL=appletUploadFacade.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletUploadFacade.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadFacade.ts"],"names":[],"mappings":"
|
|
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,kDAAsE;AAGtE,IAAM,KAAK,GAAG,KAAK,CAAC,iDAAiD,CAAC,CAAC;AAEvE,SAAsB,sBAAsB,CAAC,UAO5C;;;;;;oBACQ,OAAO,GAAa,UAAU,QAAvB,EAAE,MAAM,GAAK,UAAU,OAAf,CAAgB;oBACjC,YAAY,GAAG,EAAE,CAAC,gBAAgB,CAAC,MA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nB,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,UAAU;wBACnB,IAAI,EAAE,QAAQ;qBACd,CACD,EAAA;;gBAXD,SAWC,CAAC;;;;gBAGF,IAAI,QAAQ,KAAK,CAAC,EAAE;oBACnB,MAAM,IAAI,KAAK,CAAC,iDAA0C,gBAAgB,CAAE,CAAC,CAAC;iBAC9E;gBACD,MAAM,OAAK,CAAC;;gBAxCmC,KAAK,EAAE,CAAA;;;gBA6CxD,IAAI,WAAW,EAAE;oBAChB,WAAW,CAAC,GAAG,EAAE,CAAC;iBAClB;;;;KACD,CAAC;AArEW,QAAA,yBAAyB,6BAqEpC"}
|
|
@@ -36,21 +36,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getAppletFilesDictionary = exports.getAppletFileRelativePath = void 0;
|
|
39
40
|
var path = require("path");
|
|
40
41
|
function getAppletFileRelativePath(fileAbsolutePath, directoryAbsolutePath) {
|
|
41
42
|
var directoryAbsolutePathNormalized = path.normalize(directoryAbsolutePath);
|
|
42
43
|
var fileAbsolutePathNormalized = path.normalize(fileAbsolutePath);
|
|
43
44
|
if (!path.isAbsolute(fileAbsolutePathNormalized)) {
|
|
44
|
-
throw new Error("Internal Error: Got relative file path, but need absolute to continue. Current path: "
|
|
45
|
+
throw new Error("Internal Error: Got relative file path, but need absolute to continue. Current path: ".concat(fileAbsolutePathNormalized));
|
|
45
46
|
}
|
|
46
47
|
if (!path.isAbsolute(directoryAbsolutePathNormalized)) {
|
|
47
|
-
throw new Error("Internal Error: Try input absolute applet directory path. Current path: "
|
|
48
|
+
throw new Error("Internal Error: Try input absolute applet directory path. Current path: ".concat(directoryAbsolutePathNormalized));
|
|
48
49
|
}
|
|
49
50
|
var isFileInAppletDir = fileAbsolutePathNormalized.startsWith(directoryAbsolutePathNormalized);
|
|
50
51
|
if (!isFileInAppletDir) {
|
|
51
52
|
throw new Error("All project files must be in the project directory." +
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
"\nFile path: ".concat(fileAbsolutePathNormalized) +
|
|
54
|
+
"\nApplet directory path: ".concat(directoryAbsolutePathNormalized));
|
|
54
55
|
}
|
|
55
56
|
var fileRelativePath = fileAbsolutePathNormalized.substring(directoryAbsolutePathNormalized.length + 1);
|
|
56
57
|
return fileRelativePath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletUploadFacadeHelper.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadFacadeHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"appletUploadFacadeHelper.js","sourceRoot":"","sources":["../../../src/Applet/Upload/appletUploadFacadeHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA6B;AAI7B,SAAgB,yBAAyB,CAAC,gBAAwB,EAAE,qBAA6B;IAChG,IAAM,+BAA+B,GAAG,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC9E,IAAM,0BAA0B,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAEpE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAE;QACjD,MAAM,IAAI,KAAK,CAAC,+FAAwF,0BAA0B,CAAE,CAAC,CAAC;KACtI;IACD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC,EAAE;QACtD,MAAM,IAAI,KAAK,CAAC,kFAA2E,+BAA+B,CAAE,CAAC,CAAC;KAC9H;IAED,IAAM,iBAAiB,GAAG,0BAA0B,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IACjG,IAAI,CAAC,iBAAiB,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,qDAAqD;YACrE,uBAAgB,0BAA0B,CAAE;YAC5C,mCAA4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