@devicecloud.dev/dcd 2.3.4 → 3.0.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 +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/methods.js +19 -1
- package/dist/plan.js +4 -0
- package/oclif.manifest.json +2 -2
- package/package.json +1 -1
package/dist/commands/cloud.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export default class Cloud extends Command {
|
|
|
49
49
|
'include-tags': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
50
50
|
'ios-device': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
51
51
|
'ios-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
52
|
-
'maestro-version': import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
52
|
+
'maestro-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
53
53
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
54
54
|
orientation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
55
55
|
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
package/dist/constants.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const flags: {
|
|
|
19
19
|
'include-tags': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
20
|
'ios-device': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
21
|
'ios-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
-
'maestro-version': import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
22
|
+
'maestro-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
23
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
24
|
orientation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
25
|
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
package/dist/constants.js
CHANGED
|
@@ -121,6 +121,7 @@ exports.flags = {
|
|
|
121
121
|
}),
|
|
122
122
|
'maestro-version': core_1.Flags.string({
|
|
123
123
|
aliases: ['maestroVersion'],
|
|
124
|
+
default: '1.39.5',
|
|
124
125
|
description: 'Maestro version to run your flow against',
|
|
125
126
|
options: [
|
|
126
127
|
'1.36.0',
|
|
@@ -138,7 +139,6 @@ exports.flags = {
|
|
|
138
139
|
'1.39.0',
|
|
139
140
|
'1.39.1',
|
|
140
141
|
'1.39.2',
|
|
141
|
-
'1.39.3',
|
|
142
142
|
'1.39.4',
|
|
143
143
|
'1.39.5',
|
|
144
144
|
],
|
package/dist/methods.js
CHANGED
|
@@ -16,6 +16,8 @@ const node_stream_1 = require("node:stream");
|
|
|
16
16
|
const promises_2 = require("node:stream/promises");
|
|
17
17
|
const StreamZip = require("node-stream-zip");
|
|
18
18
|
const plist_1 = require("plist");
|
|
19
|
+
const node_crypto_1 = require("node:crypto");
|
|
20
|
+
const node_fs_2 = require("node:fs");
|
|
19
21
|
const cloud_1 = require("./commands/cloud");
|
|
20
22
|
const PERMITTED_EXTENSIONS = new Set([
|
|
21
23
|
'yml',
|
|
@@ -229,6 +231,13 @@ const uploadBinary = async (filePath, apiUrl, apiKey) => {
|
|
|
229
231
|
});
|
|
230
232
|
file = new file_1.File([binaryBlob], filePath);
|
|
231
233
|
}
|
|
234
|
+
let sha = undefined;
|
|
235
|
+
try {
|
|
236
|
+
sha = await getFileHash(filePath);
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
// do nothing
|
|
240
|
+
}
|
|
232
241
|
let metadata;
|
|
233
242
|
try {
|
|
234
243
|
metadata = filePath?.endsWith('.apk')
|
|
@@ -259,7 +268,7 @@ const uploadBinary = async (filePath, apiUrl, apiKey) => {
|
|
|
259
268
|
if (uploadToUrl.error)
|
|
260
269
|
throw new Error(uploadToUrl.error);
|
|
261
270
|
const { error } = await (0, exports.typeSafePost)(apiUrl, '/uploads/finaliseUpload', {
|
|
262
|
-
body: JSON.stringify({ id, metadata, path }),
|
|
271
|
+
body: JSON.stringify({ id, metadata, path, sha }),
|
|
263
272
|
headers: {
|
|
264
273
|
'content-type': 'application/json',
|
|
265
274
|
'x-app-api-key': apiKey,
|
|
@@ -286,3 +295,12 @@ const verifyAdditionalAppFiles = async (appFiles) => {
|
|
|
286
295
|
}
|
|
287
296
|
};
|
|
288
297
|
exports.verifyAdditionalAppFiles = verifyAdditionalAppFiles;
|
|
298
|
+
async function getFileHash(filePath) {
|
|
299
|
+
return new Promise((resolve, reject) => {
|
|
300
|
+
const hash = (0, node_crypto_1.createHash)('sha256');
|
|
301
|
+
const stream = (0, node_fs_2.createReadStream)(filePath);
|
|
302
|
+
stream.on('error', (err) => reject(err));
|
|
303
|
+
stream.on('data', (chunk) => hash.update(chunk));
|
|
304
|
+
stream.on('end', () => resolve(hash.digest('hex')));
|
|
305
|
+
});
|
|
306
|
+
}
|
package/dist/plan.js
CHANGED
|
@@ -77,6 +77,10 @@ async function plan(input, includeTags, excludeTags, excludeFlows) {
|
|
|
77
77
|
(file.endsWith('.yaml') || file.endsWith('.yml')))
|
|
78
78
|
.map((file) => path.resolve(input, file));
|
|
79
79
|
}
|
|
80
|
+
else {
|
|
81
|
+
// workspace config has no flows, so we need to remove the config file from the test list
|
|
82
|
+
unfilteredFlowFiles = unfilteredFlowFiles.filter((file) => !file.endsWith('config.yaml') && !file.endsWith('config.yml'));
|
|
83
|
+
}
|
|
80
84
|
if (unfilteredFlowFiles.length === 0) {
|
|
81
85
|
const error = workspaceConfig.flows
|
|
82
86
|
? new Error(`Flow inclusion pattern(s) did not match any Flow files:\n${workspaceConfig.flows.join('\n')}`)
|
package/oclif.manifest.json
CHANGED
|
@@ -227,6 +227,7 @@
|
|
|
227
227
|
],
|
|
228
228
|
"description": "Maestro version to run your flow against",
|
|
229
229
|
"name": "maestro-version",
|
|
230
|
+
"default": "1.39.5",
|
|
230
231
|
"hasDynamicHelp": false,
|
|
231
232
|
"multiple": false,
|
|
232
233
|
"options": [
|
|
@@ -245,7 +246,6 @@
|
|
|
245
246
|
"1.39.0",
|
|
246
247
|
"1.39.1",
|
|
247
248
|
"1.39.2",
|
|
248
|
-
"1.39.3",
|
|
249
249
|
"1.39.4",
|
|
250
250
|
"1.39.5"
|
|
251
251
|
],
|
|
@@ -302,5 +302,5 @@
|
|
|
302
302
|
]
|
|
303
303
|
}
|
|
304
304
|
},
|
|
305
|
-
"version": "
|
|
305
|
+
"version": "3.0.1"
|
|
306
306
|
}
|