From 41d4badadafc4b5989d22200e58f09efe01ebeec Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Sat, 4 May 2024 15:15:37 +0200 Subject: [PATCH] feat(bundles): add new min and max options (#1) --- src/commands/apps/bundles/create.ts | 35 ++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/commands/apps/bundles/create.ts b/src/commands/apps/bundles/create.ts index d8d187d..f44db67 100644 --- a/src/commands/apps/bundles/create.ts +++ b/src/commands/apps/bundles/create.ts @@ -14,9 +14,13 @@ export default defineCommand({ description: 'Create a new app bundle.', }, args: { - path: { + androidMax: { type: 'string', - description: 'Path to the bundle to upload. Must be a folder (e.g. `www` or `dist`) or a zip file.', + description: 'The maximum Android version code (`versionCode`) that the bundle supports.', + }, + androidMin: { + type: 'string', + description: 'The minimum Android version code (`versionCode`) that the bundle supports.', }, appId: { type: 'string', @@ -26,6 +30,18 @@ export default defineCommand({ type: 'string', description: 'Channel to associate the bundle with.', }, + path: { + type: 'string', + description: 'Path to the bundle to upload. Must be a folder (e.g. `www` or `dist`) or a zip file.', + }, + iosMax: { + type: 'string', + description: 'The maximum iOS bundle version (`CFBundleVersion`) that the bundle supports.', + }, + iosMin: { + type: 'string', + description: 'The minimum iOS bundle version (`CFBundleVersion`) that the bundle supports.', + }, }, run: async (ctx) => { if (!authorizationService.hasAuthorizationToken()) { @@ -33,8 +49,9 @@ export default defineCommand({ return; } - let path = ctx.args.path; + const { androidMax, androidMin, iosMax, iosMin } = ctx.args; let appId = ctx.args.appId; + let path = ctx.args.path; let channelName = ctx.args.channel; if (!path) { path = await prompt('Enter the path to the app bundle:', { @@ -73,6 +90,18 @@ export default defineCommand({ if (channelName) { formData.append('channelName', channelName); } + if (androidMax) { + formData.append('maxAndroidAppVersionCode', androidMax); + } + if (androidMin) { + formData.append('minAndroidAppVersionCode', androidMin); + } + if (iosMax) { + formData.append('maxIosAppVersionCode', iosMax); + } + if (iosMin) { + formData.append('minIosAppVersionCode', iosMin); + } consola.start('Uploading...'); // Upload the bundle try {