runcloud 0.2.143 → 0.2.144
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/run-cloud.js +21 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/runcloud-0.2.144.tgz +0 -0
- package/runcloud-0.2.143.tgz +0 -0
|
@@ -1247,7 +1247,27 @@ function registerSimulatorCommands(program, platform) {
|
|
|
1247
1247
|
const asset = await pushAsset(path, { contentType, orgId: opts.orgId });
|
|
1248
1248
|
const api = client();
|
|
1249
1249
|
try {
|
|
1250
|
-
const
|
|
1250
|
+
const path = `/run-cloud/${platform}/${encodeURIComponent(id)}/gallery`;
|
|
1251
|
+
let result = await api.post(path, { assetId: asset.id, async: true });
|
|
1252
|
+
if (typeof result.operationId === 'string') {
|
|
1253
|
+
const operationId = result.operationId;
|
|
1254
|
+
if (!/^[a-zA-Z0-9-]{1,128}$/.test(operationId))
|
|
1255
|
+
throw new Error('Invalid gallery operation receipt');
|
|
1256
|
+
const signal = AbortSignal.timeout(11 * 60_000);
|
|
1257
|
+
while (result.status === 'pending') {
|
|
1258
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
1259
|
+
result = await api.get(`${path}/${encodeURIComponent(operationId)}`, { signal });
|
|
1260
|
+
if (result.operationId !== operationId)
|
|
1261
|
+
throw new Error('Gallery operation identity changed');
|
|
1262
|
+
}
|
|
1263
|
+
if (result.status !== 'completed' || result.ok !== true || !result.result) {
|
|
1264
|
+
throw new Error('Could not import the file into the device gallery');
|
|
1265
|
+
}
|
|
1266
|
+
result = { ...result.result, asset };
|
|
1267
|
+
}
|
|
1268
|
+
if (result.ok !== true || result.byteSize !== blob.size || result.contentType !== contentType) {
|
|
1269
|
+
throw new Error('The device did not confirm the gallery import');
|
|
1270
|
+
}
|
|
1251
1271
|
if (opts.json)
|
|
1252
1272
|
console.log(JSON.stringify(result, null, 2));
|
|
1253
1273
|
else
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.2.
|
|
1
|
+
export const CLI_VERSION = '0.2.144';
|
package/package.json
CHANGED
|
Binary file
|
package/runcloud-0.2.143.tgz
DELETED
|
Binary file
|