@devicecloud.dev/dcd 2.3.3 → 3.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/dist/commands/cloud.d.ts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +2 -1
- package/dist/methods.js +14 -1
- package/dist/plan.js +4 -0
- package/oclif.manifest.json +4 -3
- 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,8 +139,8 @@ 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
|
+
'1.39.5',
|
|
143
144
|
],
|
|
144
145
|
}),
|
|
145
146
|
name: core_1.Flags.string({
|
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,8 @@ const uploadBinary = async (filePath, apiUrl, apiKey) => {
|
|
|
229
231
|
});
|
|
230
232
|
file = new file_1.File([binaryBlob], filePath);
|
|
231
233
|
}
|
|
234
|
+
const sha = await getFileHash(filePath);
|
|
235
|
+
console.log(`File hash (SHA-256): ${sha}`);
|
|
232
236
|
let metadata;
|
|
233
237
|
try {
|
|
234
238
|
metadata = filePath?.endsWith('.apk')
|
|
@@ -259,7 +263,7 @@ const uploadBinary = async (filePath, apiUrl, apiKey) => {
|
|
|
259
263
|
if (uploadToUrl.error)
|
|
260
264
|
throw new Error(uploadToUrl.error);
|
|
261
265
|
const { error } = await (0, exports.typeSafePost)(apiUrl, '/uploads/finaliseUpload', {
|
|
262
|
-
body: JSON.stringify({ id, metadata, path }),
|
|
266
|
+
body: JSON.stringify({ id, metadata, path, sha }),
|
|
263
267
|
headers: {
|
|
264
268
|
'content-type': 'application/json',
|
|
265
269
|
'x-app-api-key': apiKey,
|
|
@@ -286,3 +290,12 @@ const verifyAdditionalAppFiles = async (appFiles) => {
|
|
|
286
290
|
}
|
|
287
291
|
};
|
|
288
292
|
exports.verifyAdditionalAppFiles = verifyAdditionalAppFiles;
|
|
293
|
+
async function getFileHash(filePath) {
|
|
294
|
+
return new Promise((resolve, reject) => {
|
|
295
|
+
const hash = (0, node_crypto_1.createHash)('sha256');
|
|
296
|
+
const stream = (0, node_fs_2.createReadStream)(filePath);
|
|
297
|
+
stream.on('error', (err) => reject(err));
|
|
298
|
+
stream.on('data', (chunk) => hash.update(chunk));
|
|
299
|
+
stream.on('end', () => resolve(hash.digest('hex')));
|
|
300
|
+
});
|
|
301
|
+
}
|
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,8 +246,8 @@
|
|
|
245
246
|
"1.39.0",
|
|
246
247
|
"1.39.1",
|
|
247
248
|
"1.39.2",
|
|
248
|
-
"1.39.
|
|
249
|
-
"1.39.
|
|
249
|
+
"1.39.4",
|
|
250
|
+
"1.39.5"
|
|
250
251
|
],
|
|
251
252
|
"type": "option"
|
|
252
253
|
},
|
|
@@ -301,5 +302,5 @@
|
|
|
301
302
|
]
|
|
302
303
|
}
|
|
303
304
|
},
|
|
304
|
-
"version": "
|
|
305
|
+
"version": "3.0.0"
|
|
305
306
|
}
|