@devicecloud.dev/dcd 4.1.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/cloud.d.ts +0 -3
- package/dist/commands/cloud.js +1 -36
- package/dist/constants.d.ts +0 -3
- package/dist/constants.js +3 -19
- package/dist/gateways/api-gateway.js +2 -1
- package/dist/methods.d.ts +0 -2
- package/dist/methods.js +1 -16
- package/oclif.manifest.json +4 -26
- package/package.json +1 -1
package/dist/commands/cloud.d.ts
CHANGED
|
@@ -9,8 +9,6 @@ export default class Cloud extends Command {
|
|
|
9
9
|
static enableJsonFlag: boolean;
|
|
10
10
|
static examples: string[];
|
|
11
11
|
static flags: {
|
|
12
|
-
'additional-app-binary-ids': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
-
'additional-app-files': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
12
|
'android-api-level': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
13
|
'android-device': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
14
|
apiKey: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -52,7 +50,6 @@ export default class Cloud extends Command {
|
|
|
52
50
|
'runner-type': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
53
51
|
'show-crosshairs': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
54
52
|
'skip-chrome-onboarding': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
55
|
-
'x86-arch': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
56
53
|
};
|
|
57
54
|
private versionCheck;
|
|
58
55
|
run(): Promise<any>;
|
package/dist/commands/cloud.js
CHANGED
|
@@ -71,7 +71,7 @@ class Cloud extends core_1.Command {
|
|
|
71
71
|
let jsonFile = false;
|
|
72
72
|
try {
|
|
73
73
|
const { args, flags, raw } = await this.parse(Cloud);
|
|
74
|
-
let { '
|
|
74
|
+
let { 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey: apiKeyFlag, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, 'artifacts-path': artifactsPath, 'junit-path': junitPath, 'allure-path': allurePath, 'html-path': htmlPath, async, config: configFile, debug, 'device-locale': deviceLocale, 'download-artifacts': downloadArtifacts, 'dry-run': dryRun, env, 'exclude-flows': excludeFlows, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'ignore-sha-check': ignoreShaCheck, 'include-tags': includeTags, 'ios-device': iOSDevice, 'ios-version': iOSVersion, json, 'json-file-name': jsonFileName, 'maestro-version': maestroVersion, metadata, mitmHost, mitmPath, 'moropo-v1-api-key': moropoApiKey, name, orientation, quiet, report, retry, 'runner-type': runnerType, ...rest } = flags;
|
|
75
75
|
// Resolve "latest" maestro version to actual version
|
|
76
76
|
const resolvedMaestroVersion = (0, constants_1.resolveMaestroVersion)(maestroVersion);
|
|
77
77
|
// Store debug flag for use in catch block
|
|
@@ -236,11 +236,8 @@ class Cloud extends core_1.Command {
|
|
|
236
236
|
if (runnerType === 'gpu1') {
|
|
237
237
|
this.log('Note: runnerType gpu1 is Android-only and requires contacting support to enable. Without support enablement, your runner type will revert to default.');
|
|
238
238
|
}
|
|
239
|
-
const additionalAppBinaryIds = nonFlatAdditionalAppBinaryIds?.flat();
|
|
240
|
-
const additionalAppFiles = nonFlatAdditionalAppFiles?.flat();
|
|
241
239
|
const { firstFile, secondFile } = args;
|
|
242
240
|
let finalBinaryId = appBinaryId;
|
|
243
|
-
let finalAdditionalBinaryIds = additionalAppBinaryIds;
|
|
244
241
|
const finalAppFile = appFile ?? firstFile;
|
|
245
242
|
let flowFile = flows ?? secondFile;
|
|
246
243
|
if (debug) {
|
|
@@ -249,8 +246,6 @@ class Cloud extends core_1.Command {
|
|
|
249
246
|
this.log(`DEBUG: App binary ID: ${appBinaryId || 'not provided'}`);
|
|
250
247
|
this.log(`DEBUG: App file: ${finalAppFile || 'not provided'}`);
|
|
251
248
|
this.log(`DEBUG: Flow file: ${flowFile || 'not provided'}`);
|
|
252
|
-
this.log(`DEBUG: Additional app binary IDs: ${additionalAppBinaryIds?.join(', ') || 'none'}`);
|
|
253
|
-
this.log(`DEBUG: Additional app files: ${additionalAppFiles?.join(', ') || 'none'}`);
|
|
254
249
|
}
|
|
255
250
|
if (appBinaryId) {
|
|
256
251
|
if (secondFile) {
|
|
@@ -368,10 +363,6 @@ class Cloud extends core_1.Command {
|
|
|
368
363
|
await (0, methods_1.verifyAppZip)(finalAppFile);
|
|
369
364
|
}
|
|
370
365
|
}
|
|
371
|
-
if (debug && additionalAppFiles?.length) {
|
|
372
|
-
this.log(`DEBUG: Verifying additional app files: ${additionalAppFiles.join(', ')}`);
|
|
373
|
-
}
|
|
374
|
-
await (0, methods_1.verifyAdditionalAppFiles)(additionalAppFiles);
|
|
375
366
|
const flagLogs = [];
|
|
376
367
|
const sensitiveFlags = new Set(['api-key', 'apiKey', 'moropo-v1-api-key']);
|
|
377
368
|
for (const [k, v] of Object.entries(flags)) {
|
|
@@ -401,9 +392,6 @@ class Cloud extends core_1.Command {
|
|
|
401
392
|
Submitting new job
|
|
402
393
|
→ Flow(s): ${flowFile}
|
|
403
394
|
→ App: ${appBinaryId || finalAppFile}
|
|
404
|
-
${additionalAppBinaryIds.length > 0 || additionalAppFiles.length > 0
|
|
405
|
-
? `→ Additional app(s): ${additionalAppBinaryIds} ${additionalAppFiles}`
|
|
406
|
-
: ''}
|
|
407
395
|
|
|
408
396
|
With options
|
|
409
397
|
→ ${flagLogs.join(`
|
|
@@ -439,21 +427,6 @@ class Cloud extends core_1.Command {
|
|
|
439
427
|
this.log(`DEBUG: Binary uploaded with ID: ${binaryId}`);
|
|
440
428
|
}
|
|
441
429
|
}
|
|
442
|
-
let uploadedBinaryIds = [];
|
|
443
|
-
if (additionalAppFiles?.length) {
|
|
444
|
-
if (debug) {
|
|
445
|
-
this.log(`DEBUG: Uploading additional binary files: ${additionalAppFiles.join(', ')}`);
|
|
446
|
-
}
|
|
447
|
-
uploadedBinaryIds = await (0, methods_1.uploadBinaries)(additionalAppFiles, apiUrl, apiKey, ignoreShaCheck, !json);
|
|
448
|
-
finalAdditionalBinaryIds = [
|
|
449
|
-
...finalAdditionalBinaryIds,
|
|
450
|
-
...uploadedBinaryIds,
|
|
451
|
-
];
|
|
452
|
-
if (debug) {
|
|
453
|
-
this.log(`DEBUG: Additional binaries uploaded with IDs: ${uploadedBinaryIds.join(', ')}`);
|
|
454
|
-
this.log(`DEBUG: Final additional binary IDs: ${finalAdditionalBinaryIds.join(', ')}`);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
430
|
const testFormData = new FormData();
|
|
458
431
|
// eslint-disable-next-line unicorn/no-array-reduce
|
|
459
432
|
const envObject = (env ?? []).reduce((acc, cur) => {
|
|
@@ -525,16 +498,8 @@ class Cloud extends core_1.Command {
|
|
|
525
498
|
report,
|
|
526
499
|
showCrosshairs: flags['show-crosshairs'],
|
|
527
500
|
skipChromeOnboarding: flags['skip-chrome-onboarding'],
|
|
528
|
-
uploadedBinaryIds,
|
|
529
501
|
version: this.config.version,
|
|
530
|
-
x86Arch,
|
|
531
502
|
};
|
|
532
|
-
if (finalAdditionalBinaryIds?.length > 0) {
|
|
533
|
-
config.additionalAppBinaryIds = finalAdditionalBinaryIds;
|
|
534
|
-
}
|
|
535
|
-
if (uploadedBinaryIds?.length > 0) {
|
|
536
|
-
config.uploadedBinaryIds = uploadedBinaryIds;
|
|
537
|
-
}
|
|
538
503
|
testFormData.set('config', JSON.stringify(config));
|
|
539
504
|
if (Object.keys(metadataObject).length > 0) {
|
|
540
505
|
const metadataPayload = { userMetadata: metadataObject };
|
package/dist/constants.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ export declare const DEFAULT_MAESTRO_VERSION = "1.41.0";
|
|
|
3
3
|
export declare const getLatestMaestroVersion: () => string;
|
|
4
4
|
export declare const resolveMaestroVersion: (version?: string) => string;
|
|
5
5
|
export declare const flags: {
|
|
6
|
-
'additional-app-binary-ids': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
-
'additional-app-files': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
6
|
'android-api-level': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
7
|
'android-device': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
8
|
apiKey: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -46,5 +44,4 @@ export declare const flags: {
|
|
|
46
44
|
'runner-type': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
47
45
|
'show-crosshairs': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
48
46
|
'skip-chrome-onboarding': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
49
|
-
'x86-arch': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
50
47
|
};
|
package/dist/constants.js
CHANGED
|
@@ -27,20 +27,6 @@ const resolveMaestroVersion = (version) => {
|
|
|
27
27
|
};
|
|
28
28
|
exports.resolveMaestroVersion = resolveMaestroVersion;
|
|
29
29
|
exports.flags = {
|
|
30
|
-
'additional-app-binary-ids': core_1.Flags.string({
|
|
31
|
-
default: [],
|
|
32
|
-
description: 'The ID of the additional app binary(s) previously uploaded to devicecloud.dev to install before execution',
|
|
33
|
-
multiple: true,
|
|
34
|
-
multipleNonGreedy: true,
|
|
35
|
-
parse: (input) => input.split(','),
|
|
36
|
-
}),
|
|
37
|
-
'additional-app-files': core_1.Flags.file({
|
|
38
|
-
default: [],
|
|
39
|
-
description: 'Additional app binary(s) to install before execution',
|
|
40
|
-
multiple: true,
|
|
41
|
-
multipleNonGreedy: true,
|
|
42
|
-
parse: (input) => input.split(','),
|
|
43
|
-
}),
|
|
44
30
|
'android-api-level': core_1.Flags.string({
|
|
45
31
|
description: '[Android only] Android API level to run your flow against',
|
|
46
32
|
options: Object.values(device_types_1.EAndroidApiLevels),
|
|
@@ -177,10 +163,12 @@ exports.flags = {
|
|
|
177
163
|
}),
|
|
178
164
|
mitmHost: core_1.Flags.string({
|
|
179
165
|
description: 'used for mitmproxy support, enterprise only, contact support if interested',
|
|
166
|
+
hidden: true,
|
|
180
167
|
}),
|
|
181
168
|
mitmPath: core_1.Flags.string({
|
|
182
169
|
dependsOn: ['mitmHost'],
|
|
183
170
|
description: 'used for mitmproxy support, enterprise only, contact support if interested',
|
|
171
|
+
hidden: true,
|
|
184
172
|
}),
|
|
185
173
|
'moropo-v1-api-key': core_1.Flags.string({
|
|
186
174
|
description: 'API key for Moropo v1 integration',
|
|
@@ -191,7 +179,7 @@ exports.flags = {
|
|
|
191
179
|
}),
|
|
192
180
|
orientation: core_1.Flags.string({
|
|
193
181
|
description: '[Android only] The orientation of the device to run your flow against in degrees',
|
|
194
|
-
options: ['0', '90'
|
|
182
|
+
options: ['0', '90'],
|
|
195
183
|
}),
|
|
196
184
|
quiet: core_1.Flags.boolean({
|
|
197
185
|
char: 'q',
|
|
@@ -219,8 +207,4 @@ exports.flags = {
|
|
|
219
207
|
default: false,
|
|
220
208
|
description: '[Android only] Skip Chrome browser onboarding screens when running tests',
|
|
221
209
|
}),
|
|
222
|
-
'x86-arch': core_1.Flags.boolean({
|
|
223
|
-
default: false,
|
|
224
|
-
description: '[iOS only, experimental] Run your flow against x86 architecture simulator instead of arm64',
|
|
225
|
-
}),
|
|
226
210
|
};
|
|
@@ -245,7 +245,8 @@ exports.ApiGateway = {
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
// Write the file using streaming for better memory efficiency
|
|
248
|
-
|
|
248
|
+
// Use 'w' flag to overwrite existing files instead of failing
|
|
249
|
+
const fileStream = createWriteStream(expandedPath, { flags: 'w' });
|
|
249
250
|
await finished(Readable.fromWeb(res.body).pipe(fileStream));
|
|
250
251
|
},
|
|
251
252
|
};
|
package/dist/methods.d.ts
CHANGED
|
@@ -8,8 +8,6 @@ export declare const extractAppMetadataAndroid: (appFilePath: string) => Promise
|
|
|
8
8
|
export declare const extractAppMetadataIosZip: (appFilePath: string) => Promise<TAppMetadata>;
|
|
9
9
|
export declare const extractAppMetadataIos: (appFolderPath: string) => Promise<TAppMetadata>;
|
|
10
10
|
export declare const uploadBinary: (filePath: string, apiUrl: string, apiKey: string, ignoreShaCheck?: boolean, log?: boolean) => Promise<string>;
|
|
11
|
-
export declare const uploadBinaries: (finalAppFiles: string[], apiUrl: string, apiKey: string, ignoreShaCheck?: boolean, log?: boolean) => Promise<string[]>;
|
|
12
|
-
export declare const verifyAdditionalAppFiles: (appFiles: string[] | undefined) => Promise<void>;
|
|
13
11
|
/**
|
|
14
12
|
* Writes JSON data to a file with error handling
|
|
15
13
|
* @param filePath - Path to the output JSON file
|
package/dist/methods.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatDurationSeconds = exports.writeJSONFile = exports.
|
|
3
|
+
exports.formatDurationSeconds = exports.writeJSONFile = exports.uploadBinary = exports.extractAppMetadataIos = exports.extractAppMetadataIosZip = exports.extractAppMetadataAndroid = exports.verifyAppZip = exports.compressFilesFromRelativePath = exports.compressFolderToBlob = exports.toBuffer = void 0;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
// required polyfill for node 18
|
|
6
6
|
const file_1 = require("@web-std/file");
|
|
@@ -201,21 +201,6 @@ const uploadBinary = async (filePath, apiUrl, apiKey, ignoreShaCheck = false, lo
|
|
|
201
201
|
return id;
|
|
202
202
|
};
|
|
203
203
|
exports.uploadBinary = uploadBinary;
|
|
204
|
-
const uploadBinaries = async (finalAppFiles, apiUrl, apiKey, ignoreShaCheck = false, log = true) => Promise.all(finalAppFiles.map((f) => (0, exports.uploadBinary)(f, apiUrl, apiKey, ignoreShaCheck, log)));
|
|
205
|
-
exports.uploadBinaries = uploadBinaries;
|
|
206
|
-
const verifyAdditionalAppFiles = async (appFiles) => {
|
|
207
|
-
if (appFiles?.length) {
|
|
208
|
-
if (!appFiles.every((f) => ['apk', '.app', '.zip'].some((ext) => f.endsWith(ext)))) {
|
|
209
|
-
throw new Error('App file must be a .apk for android or .app/.zip file for iOS');
|
|
210
|
-
}
|
|
211
|
-
await Promise.all(appFiles.map(async (f) => {
|
|
212
|
-
if (f.endsWith('.zip')) {
|
|
213
|
-
await (0, exports.verifyAppZip)(f);
|
|
214
|
-
}
|
|
215
|
-
}));
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
exports.verifyAdditionalAppFiles = verifyAdditionalAppFiles;
|
|
219
204
|
async function getFileHashFromFile(file) {
|
|
220
205
|
return new Promise((resolve, reject) => {
|
|
221
206
|
const hash = (0, node_crypto_1.createHash)('sha256');
|
package/oclif.manifest.json
CHANGED
|
@@ -25,22 +25,6 @@
|
|
|
25
25
|
"allowNo": false,
|
|
26
26
|
"type": "boolean"
|
|
27
27
|
},
|
|
28
|
-
"additional-app-binary-ids": {
|
|
29
|
-
"description": "The ID of the additional app binary(s) previously uploaded to devicecloud.dev to install before execution",
|
|
30
|
-
"name": "additional-app-binary-ids",
|
|
31
|
-
"default": [],
|
|
32
|
-
"hasDynamicHelp": false,
|
|
33
|
-
"multiple": true,
|
|
34
|
-
"type": "option"
|
|
35
|
-
},
|
|
36
|
-
"additional-app-files": {
|
|
37
|
-
"description": "Additional app binary(s) to install before execution",
|
|
38
|
-
"name": "additional-app-files",
|
|
39
|
-
"default": [],
|
|
40
|
-
"hasDynamicHelp": false,
|
|
41
|
-
"multiple": true,
|
|
42
|
-
"type": "option"
|
|
43
|
-
},
|
|
44
28
|
"android-api-level": {
|
|
45
29
|
"description": "[Android only] Android API level to run your flow against",
|
|
46
30
|
"name": "android-api-level",
|
|
@@ -339,6 +323,7 @@
|
|
|
339
323
|
},
|
|
340
324
|
"mitmHost": {
|
|
341
325
|
"description": "used for mitmproxy support, enterprise only, contact support if interested",
|
|
326
|
+
"hidden": true,
|
|
342
327
|
"name": "mitmHost",
|
|
343
328
|
"hasDynamicHelp": false,
|
|
344
329
|
"multiple": false,
|
|
@@ -349,6 +334,7 @@
|
|
|
349
334
|
"mitmHost"
|
|
350
335
|
],
|
|
351
336
|
"description": "used for mitmproxy support, enterprise only, contact support if interested",
|
|
337
|
+
"hidden": true,
|
|
352
338
|
"name": "mitmPath",
|
|
353
339
|
"hasDynamicHelp": false,
|
|
354
340
|
"multiple": false,
|
|
@@ -376,9 +362,7 @@
|
|
|
376
362
|
"multiple": false,
|
|
377
363
|
"options": [
|
|
378
364
|
"0",
|
|
379
|
-
"90"
|
|
380
|
-
"180",
|
|
381
|
-
"270"
|
|
365
|
+
"90"
|
|
382
366
|
],
|
|
383
367
|
"type": "option"
|
|
384
368
|
},
|
|
@@ -436,12 +420,6 @@
|
|
|
436
420
|
"name": "skip-chrome-onboarding",
|
|
437
421
|
"allowNo": false,
|
|
438
422
|
"type": "boolean"
|
|
439
|
-
},
|
|
440
|
-
"x86-arch": {
|
|
441
|
-
"description": "[iOS only, experimental] Run your flow against x86 architecture simulator instead of arm64",
|
|
442
|
-
"name": "x86-arch",
|
|
443
|
-
"allowNo": false,
|
|
444
|
-
"type": "boolean"
|
|
445
423
|
}
|
|
446
424
|
},
|
|
447
425
|
"hasDynamicHelp": false,
|
|
@@ -601,5 +579,5 @@
|
|
|
601
579
|
]
|
|
602
580
|
}
|
|
603
581
|
},
|
|
604
|
-
"version": "4.1.
|
|
582
|
+
"version": "4.1.1"
|
|
605
583
|
}
|