runcloud 0.2.138 → 0.2.139
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 +29 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/runcloud-0.2.139.tgz +0 -0
- package/runcloud-0.2.138.tgz +0 -0
|
@@ -1216,6 +1216,35 @@ function registerSimulatorCommands(program, platform) {
|
|
|
1216
1216
|
.description(`Capture the current display from ${article} ${label} session`)
|
|
1217
1217
|
.argument('<id>', 'session id')
|
|
1218
1218
|
.requiredOption('-o, --output <path>', 'PNG output path')).action((id, opts) => action(() => captureSimulatorScreenshot(platform, id, opts), opts));
|
|
1219
|
+
simulator
|
|
1220
|
+
.command('upload-media')
|
|
1221
|
+
.description('Add a JPEG, PNG, or MP4 to the device gallery')
|
|
1222
|
+
.argument('<id>', 'session id')
|
|
1223
|
+
.argument('<file>', 'photo or video path')
|
|
1224
|
+
.option('--org-id <id>', 'organization that owns the session')
|
|
1225
|
+
.option('--json', 'output JSON', false)
|
|
1226
|
+
.action((id, path, opts) => action(async () => {
|
|
1227
|
+
const types = { '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.png': 'image/png', '.mp4': 'video/mp4' };
|
|
1228
|
+
const contentType = types[extname(path).toLowerCase()];
|
|
1229
|
+
if (!contentType)
|
|
1230
|
+
throw new Error('Choose a JPEG, PNG, or MP4 file.');
|
|
1231
|
+
const { blob } = fileBlob(path, contentType);
|
|
1232
|
+
if (!blob.size || blob.size > 500 * 1024 * 1024)
|
|
1233
|
+
throw new Error('Media must be between 1 byte and 500 MB.');
|
|
1234
|
+
const asset = await pushAsset(path, { contentType, orgId: opts.orgId });
|
|
1235
|
+
const api = client();
|
|
1236
|
+
try {
|
|
1237
|
+
const result = await api.post(`/run-cloud/${platform}/${encodeURIComponent(id)}/gallery`, { assetId: asset.id });
|
|
1238
|
+
if (opts.json)
|
|
1239
|
+
console.log(JSON.stringify(result, null, 2));
|
|
1240
|
+
else
|
|
1241
|
+
console.log('Added to device gallery');
|
|
1242
|
+
}
|
|
1243
|
+
catch (error) {
|
|
1244
|
+
await api.delete(`/run-cloud/assets/${encodeURIComponent(String(asset.id))}`).catch(() => undefined);
|
|
1245
|
+
throw error;
|
|
1246
|
+
}
|
|
1247
|
+
}, opts));
|
|
1219
1248
|
const recording = simulator
|
|
1220
1249
|
.command('recording')
|
|
1221
1250
|
.alias('recordings')
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.2.
|
|
1
|
+
export const CLI_VERSION = '0.2.139';
|
package/package.json
CHANGED
|
Binary file
|
package/runcloud-0.2.138.tgz
DELETED
|
Binary file
|