@zeppos/zeus-cli 1.3.0-beta.6 → 1.3.0-beta.7
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/modules/build.js +2 -2
- package/package.json +2 -2
- package/private-modules/zeppos-app-utils/dist/config/device-server.js +113 -0
- package/private-modules/zeppos-app-utils/dist/config/device.js +356 -365
- package/private-modules/zeppos-app-utils/dist/tools/tools.js +14 -0
- package/private-modules/zeppos-app-utils/package.json +1 -1
package/modules/build.js
CHANGED
|
@@ -126,9 +126,9 @@ var chooseBuildTargetsV3Config = function (mode, args) {
|
|
|
126
126
|
targetDevices = {};
|
|
127
127
|
Object.values(deviceTargets).forEach(function (device) {
|
|
128
128
|
var _a;
|
|
129
|
-
var _b = device.apiLevelLimit || {},
|
|
129
|
+
var _b = device.apiLevelLimit || {}, min = _b.min, max = _b.max;
|
|
130
130
|
if (usefulScreenTypes.includes((0, lodash_1.get)(device, 'screen.type', '')) || (0, lodash_1.find)(device.platforms, function (o) { return usefulDeviceSource.includes("".concat(o.deviceSource)); })) {
|
|
131
|
-
if ((0, tools_1.compareVersion)(min, apiLevel) >= 0 && (0, tools_1.compareVersion)(max, apiLevel)
|
|
131
|
+
if ((0, tools_1.compareVersion)(min || '1.0.0', apiLevel) >= 0 && (0, tools_1.compareVersion)(max || '99.99.99', apiLevel) < 0) {
|
|
132
132
|
Object.assign(targetDevices, (_a = {},
|
|
133
133
|
_a[device.deviceName] = device,
|
|
134
134
|
_a));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeppos/zeus-cli",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
3
|
+
"version": "1.3.0-beta.7",
|
|
4
4
|
"description": "zeus mini-program tools",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"author": "zepp",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"qrcode-terminal": "^0.12.0",
|
|
22
22
|
"vorpal": "^1.12.0",
|
|
23
23
|
"yargs": "^17.5.1",
|
|
24
|
-
"@zeppos/zpm": "^2.9.
|
|
24
|
+
"@zeppos/zpm": "^2.9.18-beta",
|
|
25
25
|
"axios": "^0.27.2",
|
|
26
26
|
"chalk": "^4.1.2",
|
|
27
27
|
"chokidar": "^3.5.3",
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
exports.__esModule = true;
|
|
29
|
+
exports.DeviceScreenType = void 0;
|
|
30
|
+
var axios_1 = __importDefault(require("axios"));
|
|
31
|
+
var os = __importStar(require("os"));
|
|
32
|
+
var path = __importStar(require("path"));
|
|
33
|
+
var fs = __importStar(require("fs"));
|
|
34
|
+
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
35
|
+
var lodash_1 = require("lodash");
|
|
36
|
+
var LOCAL_CACHE_DEVICE_PATH = path.resolve(os.homedir(), ".zepp/.zeus_device");
|
|
37
|
+
var serverPath = 'https://upload-cdn.zepp.com/zeppos/devkit/zeus/devices.json';
|
|
38
|
+
var DeviceScreenType;
|
|
39
|
+
(function (DeviceScreenType) {
|
|
40
|
+
DeviceScreenType["R"] = "r";
|
|
41
|
+
DeviceScreenType["S"] = "s";
|
|
42
|
+
DeviceScreenType["B"] = "b";
|
|
43
|
+
})(DeviceScreenType = exports.DeviceScreenType || (exports.DeviceScreenType = {}));
|
|
44
|
+
var shapeMap = {
|
|
45
|
+
square: DeviceScreenType.S,
|
|
46
|
+
round: DeviceScreenType.R,
|
|
47
|
+
bar: DeviceScreenType.B
|
|
48
|
+
};
|
|
49
|
+
var localContent = {};
|
|
50
|
+
if (fs.existsSync(LOCAL_CACHE_DEVICE_PATH)) {
|
|
51
|
+
try {
|
|
52
|
+
localContent = fs_extra_1["default"].readJsonSync(LOCAL_CACHE_DEVICE_PATH);
|
|
53
|
+
}
|
|
54
|
+
catch (_e) { }
|
|
55
|
+
}
|
|
56
|
+
var now = Date.now().valueOf();
|
|
57
|
+
if (!((0, lodash_1.get)(localContent, 'expiredTime') > now)) {
|
|
58
|
+
axios_1["default"].get(serverPath).then(function (res) {
|
|
59
|
+
if (res.status === 200) {
|
|
60
|
+
var data = res.data;
|
|
61
|
+
if (!(0, lodash_1.isEmpty)(data)) {
|
|
62
|
+
fs_extra_1["default"].writeJsonSync(LOCAL_CACHE_DEVICE_PATH, {
|
|
63
|
+
devices: data,
|
|
64
|
+
expiredTime: now + 24 * 60 * 60 * 1000
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
var deviceList = (0, lodash_1.get)(localContent, 'devices', []);
|
|
71
|
+
var deviceGroup = (0, lodash_1.groupBy)(deviceList, 'productName');
|
|
72
|
+
var deviceInfo = {};
|
|
73
|
+
Object.values(deviceGroup).forEach(function (devices) {
|
|
74
|
+
var _a;
|
|
75
|
+
var info = {
|
|
76
|
+
deviceName: '',
|
|
77
|
+
platforms: [],
|
|
78
|
+
screen: {
|
|
79
|
+
type: DeviceScreenType.R,
|
|
80
|
+
width: 0,
|
|
81
|
+
height: 0
|
|
82
|
+
},
|
|
83
|
+
apiLevelLimit: {
|
|
84
|
+
min: '1.0.0'
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var deviceInnerName = devices.reduce(function (acc, cur) {
|
|
88
|
+
!info.deviceName && (info.deviceName = cur.productName);
|
|
89
|
+
var screenType = (0, lodash_1.get)(shapeMap, (0, lodash_1.get)(cur, 'value.shape'));
|
|
90
|
+
var _a = (0, lodash_1.get)(cur, 'value.screen.size', '').split('*'), width = _a[0], height = _a[1];
|
|
91
|
+
if (screenType) {
|
|
92
|
+
info.screen.type = screenType;
|
|
93
|
+
}
|
|
94
|
+
if (width && height) {
|
|
95
|
+
info.screen.width = Number(width);
|
|
96
|
+
info.screen.height = Number(height);
|
|
97
|
+
}
|
|
98
|
+
info.platforms.push({
|
|
99
|
+
name: cur.code,
|
|
100
|
+
deviceSource: cur.deviceSource
|
|
101
|
+
});
|
|
102
|
+
Object.assign(info.apiLevelLimit, {
|
|
103
|
+
min: (0, lodash_1.get)(cur, 'value.os.apiLevelLimitMin', '1.0.0'),
|
|
104
|
+
max: (0, lodash_1.get)(cur, 'value.os.apiLevelLimitMax', '')
|
|
105
|
+
});
|
|
106
|
+
return cur.code.length < acc.length ? cur.code : acc;
|
|
107
|
+
}, devices[0].code);
|
|
108
|
+
var lowerName = (0, lodash_1.toLower)(deviceInnerName.replace(/[^a-zA-Z]/g, ''));
|
|
109
|
+
lowerName && Object.assign(deviceInfo, (_a = {},
|
|
110
|
+
_a[lowerName] = info,
|
|
111
|
+
_a));
|
|
112
|
+
});
|
|
113
|
+
exports["default"] = deviceInfo;
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
2
16
|
var _a;
|
|
3
17
|
exports.__esModule = true;
|
|
4
18
|
exports.deviceInternalCodeName = exports.OSV2DeviceTargetNames = exports.OSV2Devices = exports.deviceTargets = exports.DeviceScreenType = exports.DeviceSource = exports.DevicePlatformName = exports.DeviceTarget = void 0;
|
|
19
|
+
var lodash_1 = require("lodash");
|
|
20
|
+
var device_server_1 = __importDefault(require("./device-server"));
|
|
21
|
+
var tools_1 = require("../tools/tools");
|
|
5
22
|
var DeviceTarget;
|
|
6
23
|
(function (DeviceTarget) {
|
|
7
24
|
DeviceTarget["MADRID"] = "madrid";
|
|
@@ -16,8 +33,8 @@ var DeviceTarget;
|
|
|
16
33
|
DeviceTarget["ANDES"] = "andes";
|
|
17
34
|
DeviceTarget["MONACO"] = "monaco";
|
|
18
35
|
DeviceTarget["SWIFT"] = "swift";
|
|
19
|
-
DeviceTarget["SWORDFISH"] = "
|
|
20
|
-
DeviceTarget["CHEETAH"] = "
|
|
36
|
+
DeviceTarget["SWORDFISH"] = "swordfishw";
|
|
37
|
+
DeviceTarget["CHEETAH"] = "cheetahw";
|
|
21
38
|
DeviceTarget["HANNOVER"] = "hannover";
|
|
22
39
|
DeviceTarget["ETNA"] = "etna";
|
|
23
40
|
DeviceTarget["ALTAI"] = "altai";
|
|
@@ -100,386 +117,360 @@ var DeviceScreenType;
|
|
|
100
117
|
DeviceScreenType["S"] = "s";
|
|
101
118
|
DeviceScreenType["B"] = "b";
|
|
102
119
|
})(DeviceScreenType = exports.DeviceScreenType || (exports.DeviceScreenType = {}));
|
|
103
|
-
exports.deviceTargets = (_a = {},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
height: 480
|
|
124
|
-
},
|
|
125
|
-
apiLevelLimit: {
|
|
126
|
-
min: '1.0.0',
|
|
127
|
-
max: '1.99.99'
|
|
128
|
-
}
|
|
120
|
+
exports.deviceTargets = __assign((_a = {}, _a[DeviceTarget.MADRID] = {
|
|
121
|
+
deviceName: 'GTR3 Pro',
|
|
122
|
+
platforms: [
|
|
123
|
+
{
|
|
124
|
+
name: DevicePlatformName.MADRID,
|
|
125
|
+
deviceSource: DeviceSource.MADRID
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: DevicePlatformName.MADRIDW,
|
|
129
|
+
deviceSource: DeviceSource.MADRIDW
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: DevicePlatformName.Madrid2,
|
|
133
|
+
deviceSource: DeviceSource.Madrid2
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
screen: {
|
|
137
|
+
type: DeviceScreenType.R,
|
|
138
|
+
width: 480,
|
|
139
|
+
height: 480
|
|
129
140
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
141
|
+
apiLevelLimit: {
|
|
142
|
+
min: '1.0.0',
|
|
143
|
+
max: '1.99.99'
|
|
144
|
+
}
|
|
145
|
+
}, _a[DeviceTarget.VERONA] = {
|
|
146
|
+
deviceName: 'GTR3',
|
|
147
|
+
platforms: [
|
|
148
|
+
{
|
|
149
|
+
name: DevicePlatformName.VERONA,
|
|
150
|
+
deviceSource: DeviceSource.VERONA
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: DevicePlatformName.VERONAW,
|
|
154
|
+
deviceSource: DeviceSource.VERONAW
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
screen: {
|
|
158
|
+
type: DeviceScreenType.R,
|
|
159
|
+
width: 454,
|
|
160
|
+
height: 454
|
|
151
161
|
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
162
|
+
apiLevelLimit: {
|
|
163
|
+
min: '1.0.0',
|
|
164
|
+
max: '1.99.99'
|
|
165
|
+
}
|
|
166
|
+
}, _a[DeviceTarget.ZURICH] = {
|
|
167
|
+
deviceName: 'GTS3',
|
|
168
|
+
platforms: [
|
|
169
|
+
{
|
|
170
|
+
name: DevicePlatformName.ZURICH,
|
|
171
|
+
deviceSource: DeviceSource.ZURICH
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: DevicePlatformName.ZURICHW,
|
|
175
|
+
deviceSource: DeviceSource.ZURICHW
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
screen: {
|
|
179
|
+
type: DeviceScreenType.S,
|
|
180
|
+
width: 390,
|
|
181
|
+
height: 450
|
|
173
182
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
183
|
+
apiLevelLimit: {
|
|
184
|
+
min: '1.0.0',
|
|
185
|
+
max: '1.99.99'
|
|
186
|
+
}
|
|
187
|
+
}, _a[DeviceTarget.TEIDE] = {
|
|
188
|
+
deviceName: 'T-Rex2',
|
|
189
|
+
platforms: [
|
|
190
|
+
{
|
|
191
|
+
name: DevicePlatformName.TEIDE,
|
|
192
|
+
deviceSource: DeviceSource.TEIDE
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: DevicePlatformName.TEIDEW,
|
|
196
|
+
deviceSource: DeviceSource.TEIDEW
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
screen: {
|
|
200
|
+
type: DeviceScreenType.R,
|
|
201
|
+
width: 454,
|
|
202
|
+
height: 454
|
|
195
203
|
},
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
204
|
+
apiLevelLimit: {
|
|
205
|
+
min: '1.0.0',
|
|
206
|
+
max: '1.99.99'
|
|
207
|
+
}
|
|
208
|
+
}, _a[DeviceTarget.PROVENCE] = {
|
|
209
|
+
deviceName: 'GTS4 mini',
|
|
210
|
+
platforms: [
|
|
211
|
+
{
|
|
212
|
+
name: DevicePlatformName.PROVENCE,
|
|
213
|
+
deviceSource: DeviceSource.PROVENCE
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: DevicePlatformName.PROVENCEW,
|
|
217
|
+
deviceSource: DeviceSource.PROVENCEW
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
screen: {
|
|
221
|
+
type: DeviceScreenType.S,
|
|
222
|
+
width: 336,
|
|
223
|
+
height: 384
|
|
217
224
|
},
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
225
|
+
apiLevelLimit: {
|
|
226
|
+
min: '1.0.0',
|
|
227
|
+
max: '1.99.99'
|
|
228
|
+
}
|
|
229
|
+
}, _a[DeviceTarget.BARI] = {
|
|
230
|
+
deviceName: 'Amazfit Band 7',
|
|
231
|
+
platforms: [
|
|
232
|
+
{
|
|
233
|
+
name: DevicePlatformName.BARI_NFC,
|
|
234
|
+
deviceSource: DeviceSource.BARI_NFC
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: DevicePlatformName.BARI,
|
|
238
|
+
deviceSource: DeviceSource.BARI
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: DevicePlatformName.BARI_W,
|
|
242
|
+
deviceSource: DeviceSource.BARI_W
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
screen: {
|
|
246
|
+
type: DeviceScreenType.B,
|
|
247
|
+
width: 194,
|
|
248
|
+
height: 368
|
|
243
249
|
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
250
|
+
apiLevelLimit: {
|
|
251
|
+
min: '1.0.0',
|
|
252
|
+
max: '1.99.99'
|
|
253
|
+
}
|
|
254
|
+
}, _a[DeviceTarget.BERLIN] = {
|
|
255
|
+
deviceName: 'GTR 4',
|
|
256
|
+
platforms: [
|
|
257
|
+
{
|
|
258
|
+
name: DevicePlatformName.BERLIN,
|
|
259
|
+
deviceSource: DeviceSource.BERLIN
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: DevicePlatformName.BERLIN_W,
|
|
263
|
+
deviceSource: DeviceSource.BERLIN_W
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
screen: {
|
|
267
|
+
type: DeviceScreenType.R,
|
|
268
|
+
width: 466,
|
|
269
|
+
height: 466
|
|
264
270
|
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
271
|
+
apiLevelLimit: {
|
|
272
|
+
min: '1.0.0'
|
|
273
|
+
}
|
|
274
|
+
}, _a[DeviceTarget.LILLE] = {
|
|
275
|
+
deviceName: 'GTS 4',
|
|
276
|
+
platforms: [
|
|
277
|
+
{
|
|
278
|
+
name: DevicePlatformName.LILLE,
|
|
279
|
+
deviceSource: DeviceSource.LILLE
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: DevicePlatformName.LILLE_W,
|
|
283
|
+
deviceSource: DeviceSource.LILLE_W
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
screen: {
|
|
287
|
+
type: DeviceScreenType.S,
|
|
288
|
+
width: 390,
|
|
289
|
+
height: 450
|
|
285
290
|
},
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
max: '1.99.99'
|
|
306
|
-
}
|
|
291
|
+
apiLevelLimit: {
|
|
292
|
+
min: '1.0.0'
|
|
293
|
+
}
|
|
294
|
+
}, _a[DeviceTarget.VIENNA] = {
|
|
295
|
+
deviceName: 'Falcon',
|
|
296
|
+
platforms: [
|
|
297
|
+
{
|
|
298
|
+
name: DevicePlatformName.VIENNA,
|
|
299
|
+
deviceSource: DeviceSource.VIENNA
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: DevicePlatformName.VIENNA_W,
|
|
303
|
+
deviceSource: DeviceSource.VIENNA_W
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
screen: {
|
|
307
|
+
type: DeviceScreenType.R,
|
|
308
|
+
width: 416,
|
|
309
|
+
height: 416
|
|
307
310
|
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
311
|
+
apiLevelLimit: {
|
|
312
|
+
min: '1.0.0',
|
|
313
|
+
max: '1.99.99'
|
|
314
|
+
}
|
|
315
|
+
}, _a[DeviceTarget.ANDES] = {
|
|
316
|
+
deviceName: 'T-Rex Ultra',
|
|
317
|
+
platforms: [
|
|
318
|
+
{
|
|
319
|
+
name: DevicePlatformName.ANDES,
|
|
320
|
+
deviceSource: DeviceSource.ANDES
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: DevicePlatformName.ANDES_W,
|
|
324
|
+
deviceSource: DeviceSource.ANDES_W
|
|
325
|
+
},
|
|
326
|
+
],
|
|
327
|
+
screen: {
|
|
328
|
+
type: DeviceScreenType.R,
|
|
329
|
+
width: 454,
|
|
330
|
+
height: 454
|
|
328
331
|
},
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
332
|
+
apiLevelLimit: {
|
|
333
|
+
min: '1.0.0'
|
|
334
|
+
}
|
|
335
|
+
}, _a[DeviceTarget.MONACO] = {
|
|
336
|
+
deviceName: 'GTR 5',
|
|
337
|
+
platforms: [
|
|
338
|
+
{
|
|
339
|
+
name: DevicePlatformName.MONACO,
|
|
340
|
+
deviceSource: DeviceSource.MONACO
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: DevicePlatformName.MONACO_WN,
|
|
344
|
+
deviceSource: DeviceSource.MONACO_WN
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: DevicePlatformName.MONACO_W,
|
|
348
|
+
deviceSource: DeviceSource.MONACO_W
|
|
349
|
+
},
|
|
350
|
+
],
|
|
351
|
+
screen: {
|
|
352
|
+
type: DeviceScreenType.R,
|
|
353
|
+
width: 480,
|
|
354
|
+
height: 480
|
|
353
355
|
},
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}
|
|
356
|
+
apiLevelLimit: {
|
|
357
|
+
min: '1.0.0'
|
|
358
|
+
}
|
|
359
|
+
}, _a[DeviceTarget.SWIFT] = {
|
|
360
|
+
deviceName: 'Runner (Round)',
|
|
361
|
+
platforms: [
|
|
362
|
+
{
|
|
363
|
+
name: DevicePlatformName.SWIFT,
|
|
364
|
+
deviceSource: DeviceSource.SWIFT
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: DevicePlatformName.SWIFT_W,
|
|
368
|
+
deviceSource: DeviceSource.SWIFT_W
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
screen: {
|
|
372
|
+
type: DeviceScreenType.R,
|
|
373
|
+
width: 454,
|
|
374
|
+
height: 454
|
|
374
375
|
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
376
|
+
apiLevelLimit: {
|
|
377
|
+
min: '1.0.0'
|
|
378
|
+
}
|
|
379
|
+
}, _a[DeviceTarget.SWORDFISH] = {
|
|
380
|
+
deviceName: 'Runner (Square)',
|
|
381
|
+
platforms: [
|
|
382
|
+
{
|
|
383
|
+
name: DevicePlatformName.SWORDFISH_W,
|
|
384
|
+
deviceSource: DeviceSource.SWORDFISH_W
|
|
385
|
+
},
|
|
386
|
+
],
|
|
387
|
+
screen: {
|
|
388
|
+
type: DeviceScreenType.S,
|
|
389
|
+
width: 390,
|
|
390
|
+
height: 450
|
|
391
391
|
},
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
392
|
+
apiLevelLimit: {
|
|
393
|
+
min: '1.0.0'
|
|
394
|
+
}
|
|
395
|
+
}, _a[DeviceTarget.CHEETAH] = {
|
|
396
|
+
deviceName: 'Runner Pro',
|
|
397
|
+
platforms: [
|
|
398
|
+
{
|
|
399
|
+
name: DevicePlatformName.CHEETAH_W,
|
|
400
|
+
deviceSource: DeviceSource.CHEETAH_W
|
|
401
|
+
},
|
|
402
|
+
],
|
|
403
|
+
screen: {
|
|
404
|
+
type: DeviceScreenType.R,
|
|
405
|
+
width: 480,
|
|
406
|
+
height: 480
|
|
408
407
|
},
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
408
|
+
apiLevelLimit: {
|
|
409
|
+
min: '1.0.0'
|
|
410
|
+
}
|
|
411
|
+
}, _a[DeviceTarget.HANNOVER] = {
|
|
412
|
+
deviceName: 'GTS 5 Active',
|
|
413
|
+
platforms: [
|
|
414
|
+
{
|
|
415
|
+
name: DevicePlatformName.HANNOVER,
|
|
416
|
+
deviceSource: DeviceSource.HANNOVER
|
|
417
|
+
},
|
|
418
|
+
],
|
|
419
|
+
screen: {
|
|
420
|
+
type: DeviceScreenType.S,
|
|
421
|
+
width: 390,
|
|
422
|
+
height: 450
|
|
425
423
|
},
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
424
|
+
apiLevelLimit: {
|
|
425
|
+
min: '1.0.0'
|
|
426
|
+
}
|
|
427
|
+
}, _a[DeviceTarget.ETNA] = {
|
|
428
|
+
deviceName: 'GTR Shock',
|
|
429
|
+
platforms: [
|
|
430
|
+
{
|
|
431
|
+
name: DevicePlatformName.ETNA,
|
|
432
|
+
deviceSource: DeviceSource.ETNA
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
name: DevicePlatformName.ETNA_W,
|
|
436
|
+
deviceSource: DeviceSource.ETNA_W
|
|
437
|
+
},
|
|
438
|
+
],
|
|
439
|
+
screen: {
|
|
440
|
+
type: DeviceScreenType.S,
|
|
441
|
+
width: 360,
|
|
442
|
+
height: 360
|
|
446
443
|
},
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
444
|
+
apiLevelLimit: {
|
|
445
|
+
min: '1.0.0'
|
|
446
|
+
}
|
|
447
|
+
}, _a[DeviceTarget.ALTAI] = {
|
|
448
|
+
deviceName: 'Bip 5s',
|
|
449
|
+
platforms: [
|
|
450
|
+
{
|
|
451
|
+
name: DevicePlatformName.ALTAI,
|
|
452
|
+
deviceSource: DeviceSource.ALTAI
|
|
453
|
+
},
|
|
454
|
+
],
|
|
455
|
+
screen: {
|
|
456
|
+
type: DeviceScreenType.S,
|
|
457
|
+
width: 320,
|
|
458
|
+
height: 380
|
|
463
459
|
},
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
DeviceSource.HANNOVER,
|
|
479
|
-
DeviceSource.ETNA,
|
|
480
|
-
DeviceSource.ETNA_W,
|
|
481
|
-
DeviceSource.ALTAI
|
|
482
|
-
];
|
|
460
|
+
apiLevelLimit: {
|
|
461
|
+
min: '1.0.0'
|
|
462
|
+
}
|
|
463
|
+
}, _a), device_server_1["default"]);
|
|
464
|
+
exports.OSV2Devices = Object.values(exports.deviceTargets).reduce(function (targetDevices, target) {
|
|
465
|
+
var _a = target.platforms, platforms = _a === void 0 ? [] : _a, _b = target.apiLevelLimit, apiLevelLimit = _b === void 0 ? {} : _b;
|
|
466
|
+
var min = apiLevelLimit.min, max = apiLevelLimit.max;
|
|
467
|
+
if (!(0, lodash_1.isEmpty)(platforms) &&
|
|
468
|
+
(0, tools_1.compareVersion)(min || '1.0.0', '2.0.0') >= 0 &&
|
|
469
|
+
(0, tools_1.compareVersion)(max || '99.99.99', '2.0.0') < 0) {
|
|
470
|
+
targetDevices.push.apply(targetDevices, platforms.reduce(function (list, o) { return (0, lodash_1.compact)(list.concat([o.deviceSource])); }, []));
|
|
471
|
+
}
|
|
472
|
+
return targetDevices;
|
|
473
|
+
}, []);
|
|
483
474
|
exports.OSV2DeviceTargetNames = Object.keys(exports.deviceTargets).reduce(function (targetNames, target) {
|
|
484
475
|
var flag = true;
|
|
485
476
|
var _a = exports.deviceTargets[target].platforms, platforms = _a === void 0 ? [] : _a;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.compareVersion = exports.versionToCode = void 0;
|
|
4
|
+
var versionToCode = function (version) {
|
|
5
|
+
if (!version)
|
|
6
|
+
return 0;
|
|
7
|
+
var _a = version.split('.').map(function (val) { return Number(val); }), _b = _a[0], p0 = _b === void 0 ? 0 : _b, _c = _a[1], p1 = _c === void 0 ? 0 : _c, _d = _a[2], p2 = _d === void 0 ? 0 : _d;
|
|
8
|
+
return p0 * 10000 + p1 * 100 + p2;
|
|
9
|
+
};
|
|
10
|
+
exports.versionToCode = versionToCode;
|
|
11
|
+
var compareVersion = function (version1, version2) {
|
|
12
|
+
return (0, exports.versionToCode)(version2) - (0, exports.versionToCode)(version1);
|
|
13
|
+
};
|
|
14
|
+
exports.compareVersion = compareVersion;
|