@capawesome/cli 4.0.5 → 4.1.0-dev.f5ef8ba.1771047437
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
|
|
|
@@ -40,6 +40,10 @@ export default defineCommand({
|
|
|
40
40
|
.describe('Exit immediately after creating the build without waiting for completion.'),
|
|
41
41
|
environment: z.string().optional().describe('The name of the environment to use for the build.'),
|
|
42
42
|
gitRef: z.string().optional().describe('The Git reference (branch, tag, or commit SHA) to build.'),
|
|
43
|
+
sourceUrl: z
|
|
44
|
+
.string()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('The URL to a hosted zip file containing the source code for the build.'),
|
|
43
47
|
ipa: z
|
|
44
48
|
.union([z.boolean(), z.string()])
|
|
45
49
|
.optional()
|
|
@@ -68,7 +72,7 @@ export default defineCommand({
|
|
|
68
72
|
yes: z.boolean().optional().describe('Skip confirmation prompts.'),
|
|
69
73
|
}), { y: 'yes' }),
|
|
70
74
|
action: async (options) => {
|
|
71
|
-
let { appId, platform, type, gitRef, environment, certificate, json, stack } = options;
|
|
75
|
+
let { appId, platform, type, gitRef, sourceUrl, environment, certificate, json, stack } = options;
|
|
72
76
|
// Check if the user is logged in
|
|
73
77
|
if (!authorizationService.hasAuthorizationToken()) {
|
|
74
78
|
consola.error('You must be logged in to run this command. Please run the `login` command first.');
|
|
@@ -79,6 +83,11 @@ export default defineCommand({
|
|
|
79
83
|
consola.error('The --detached flag cannot be used with --apk, --aab, --ipa, or --zip flags.');
|
|
80
84
|
process.exit(1);
|
|
81
85
|
}
|
|
86
|
+
// Validate that gitRef and sourceUrl are mutually exclusive
|
|
87
|
+
if (gitRef && sourceUrl) {
|
|
88
|
+
consola.error('The --gitRef and --sourceUrl flags are mutually exclusive. Please provide only one.');
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
82
91
|
// Prompt for app ID if not provided
|
|
83
92
|
if (!appId) {
|
|
84
93
|
if (!isInteractive()) {
|
|
@@ -136,10 +145,10 @@ export default defineCommand({
|
|
|
136
145
|
process.exit(1);
|
|
137
146
|
}
|
|
138
147
|
}
|
|
139
|
-
// Prompt for git ref if not provided
|
|
140
|
-
if (!gitRef) {
|
|
148
|
+
// Prompt for git ref if not provided and sourceUrl is not set
|
|
149
|
+
if (!gitRef && !sourceUrl) {
|
|
141
150
|
if (!isInteractive()) {
|
|
142
|
-
consola.error('You must provide a git ref when running in non-interactive environment.');
|
|
151
|
+
consola.error('You must provide a git ref or source URL when running in non-interactive environment.');
|
|
143
152
|
process.exit(1);
|
|
144
153
|
}
|
|
145
154
|
gitRef = await prompt('Enter the Git reference (branch, tag, or commit SHA):', {
|
|
@@ -219,6 +228,7 @@ export default defineCommand({
|
|
|
219
228
|
stack,
|
|
220
229
|
gitRef,
|
|
221
230
|
platform,
|
|
231
|
+
sourceUrl,
|
|
222
232
|
type,
|
|
223
233
|
});
|
|
224
234
|
consola.info(`Build ID: ${response.id}`);
|
|
@@ -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`, {
|