@capawesome/cli 4.0.5 → 4.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [4.1.0](https://github.com/capawesome-team/cli/compare/v4.0.5...v4.1.0) (2026-02-12)
6
+
7
+
8
+ ### Features
9
+
10
+ * add `apps:liveupdates:setnativeversions` command ([#114](https://github.com/capawesome-team/cli/issues/114)) ([1aaf740](https://github.com/capawesome-team/cli/commit/1aaf740fc99a0ecb90c8f5b5444a88da0fdd265e))
11
+
5
12
  ## [4.0.5](https://github.com/capawesome-team/cli/compare/v4.0.4...v4.0.5) (2026-02-12)
6
13
 
7
14
 
@@ -0,0 +1,88 @@
1
+ import appBuildsService from '../../../services/app-builds.js';
2
+ import authorizationService from '../../../services/authorization-service.js';
3
+ import { isInteractive } from '../../../utils/environment.js';
4
+ import { defineCommand, defineOptions } from '@robingenz/zli';
5
+ import consola from 'consola';
6
+ import { z } from 'zod';
7
+ export default defineCommand({
8
+ description: 'Set native version constraints on a web build.',
9
+ options: defineOptions(z.object({
10
+ appId: z
11
+ .string({
12
+ message: 'App ID must be a UUID.',
13
+ })
14
+ .uuid({
15
+ message: 'App ID must be a UUID.',
16
+ })
17
+ .optional()
18
+ .describe('The app ID of the build.'),
19
+ buildId: z
20
+ .string({
21
+ message: 'Build ID must be a UUID.',
22
+ })
23
+ .uuid({
24
+ message: 'Build ID must be a UUID.',
25
+ })
26
+ .optional()
27
+ .describe('The build ID to update.'),
28
+ androidEq: z.coerce
29
+ .string()
30
+ .optional()
31
+ .describe('The exact Android version code (`versionCode`) that the build supports.'),
32
+ androidMax: z.coerce
33
+ .string()
34
+ .optional()
35
+ .describe('The maximum Android version code (`versionCode`) that the build supports.'),
36
+ androidMin: z.coerce
37
+ .string()
38
+ .optional()
39
+ .describe('The minimum Android version code (`versionCode`) that the build supports.'),
40
+ iosEq: z
41
+ .string()
42
+ .optional()
43
+ .describe('The exact iOS bundle version (`CFBundleVersion`) that the build supports.'),
44
+ iosMax: z
45
+ .string()
46
+ .optional()
47
+ .describe('The maximum iOS bundle version (`CFBundleVersion`) that the build supports.'),
48
+ iosMin: z
49
+ .string()
50
+ .optional()
51
+ .describe('The minimum iOS bundle version (`CFBundleVersion`) that the build supports.'),
52
+ })),
53
+ action: async (options) => {
54
+ const { appId, buildId, androidEq, androidMax, androidMin, iosEq, iosMax, iosMin } = options;
55
+ if (!authorizationService.hasAuthorizationToken()) {
56
+ consola.error('You must be logged in to run this command. Please run the `login` command first.');
57
+ process.exit(1);
58
+ }
59
+ if (!appId) {
60
+ if (!isInteractive()) {
61
+ consola.error('You must provide an app ID when running in non-interactive environment.');
62
+ process.exit(1);
63
+ }
64
+ consola.error('You must provide an app ID with the `--app-id` flag.');
65
+ process.exit(1);
66
+ }
67
+ if (!buildId) {
68
+ if (!isInteractive()) {
69
+ consola.error('You must provide a build ID when running in non-interactive environment.');
70
+ process.exit(1);
71
+ }
72
+ consola.error('You must provide a build ID with the `--build-id` flag.');
73
+ process.exit(1);
74
+ }
75
+ consola.start('Setting native version constraints...');
76
+ await appBuildsService.update({
77
+ appId,
78
+ appBuildId: buildId,
79
+ eqAndroidAppVersionCode: androidEq,
80
+ maxAndroidAppVersionCode: androidMax,
81
+ minAndroidAppVersionCode: androidMin,
82
+ eqIosAppVersionCode: iosEq,
83
+ maxIosAppVersionCode: iosMax,
84
+ minIosAppVersionCode: iosMin,
85
+ });
86
+ consola.success('Native version constraints set successfully.');
87
+ },
88
+ });
package/dist/index.js CHANGED
@@ -52,6 +52,7 @@ const config = defineConfig({
52
52
  'apps:liveupdates:rollout': await import('./commands/apps/liveupdates/rollout.js').then((mod) => mod.default),
53
53
  'apps:liveupdates:upload': await import('./commands/apps/liveupdates/upload.js').then((mod) => mod.default),
54
54
  'apps:liveupdates:register': await import('./commands/apps/liveupdates/register.js').then((mod) => mod.default),
55
+ 'apps:liveupdates:setnativeversions': await import('./commands/apps/liveupdates/set-native-versions.js').then((mod) => mod.default),
55
56
  'apps:liveupdates:generatemanifest': await import('./commands/apps/liveupdates/generate-manifest.js').then((mod) => mod.default),
56
57
  'manifests:generate': await import('./commands/manifests/generate.js').then((mod) => mod.default),
57
58
  'organizations:create': await import('./commands/organizations/create.js').then((mod) => mod.default),
@@ -44,6 +44,15 @@ class AppBuildsServiceImpl {
44
44
  });
45
45
  return response.data;
46
46
  }
47
+ async update(dto) {
48
+ const { appId, appBuildId, ...bodyData } = dto;
49
+ const response = await this.httpClient.patch(`/v1/apps/${appId}/builds/${appBuildId}`, bodyData, {
50
+ headers: {
51
+ Authorization: `Bearer ${authorizationService.getCurrentAuthorizationToken()}`,
52
+ },
53
+ });
54
+ return response.data;
55
+ }
47
56
  async downloadArtifact(dto) {
48
57
  const { appId, appBuildId, artifactId } = dto;
49
58
  const response = await this.httpClient.get(`/v1/apps/${appId}/builds/${appBuildId}/artifacts/${artifactId}/download`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/cli",
3
- "version": "4.0.5",
3
+ "version": "4.1.0",
4
4
  "description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
5
5
  "type": "module",
6
6
  "scripts": {