@capgo/cli 7.83.1 → 7.84.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/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.83.1",
4
+ "version": "7.84.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -6,13 +6,12 @@ interface SaveCredentialsOptions {
6
6
  outputRetention?: string;
7
7
  skipBuildNumberBump?: boolean;
8
8
  certificate?: string;
9
- provisioningProfile?: string;
10
- provisioningProfileProd?: string;
9
+ iosProvisioningProfile?: string[];
10
+ overwriteIosProvisioningMap?: boolean;
11
11
  p12Password?: string;
12
12
  appleKey?: string;
13
13
  appleKeyId?: string;
14
14
  appleIssuerId?: string;
15
- appleProfileName?: string;
16
15
  appleTeamId?: string;
17
16
  iosDistribution?: 'app_store' | 'ad_hoc';
18
17
  keystore?: string;
@@ -21,6 +20,21 @@ interface SaveCredentialsOptions {
21
20
  keystoreStorePassword?: string;
22
21
  playConfig?: string;
23
22
  }
23
+ /**
24
+ * Provisioning map entry: stores the base64-encoded profile and its extracted name
25
+ */
26
+ interface ProvisioningMapEntry {
27
+ profile: string;
28
+ name: string;
29
+ }
30
+ /**
31
+ * Build a provisioning map from --ios-provisioning-profile entries.
32
+ *
33
+ * Each entry is either:
34
+ * - "bundleId=path" (explicit bundle ID assignment)
35
+ * - "path" (auto-infer bundle ID by matching mobileprovision against pbxproj targets)
36
+ */
37
+ export declare function buildProvisioningMap(entries: string[], projectDir?: string): Record<string, ProvisioningMapEntry>;
24
38
  /**
25
39
  * Save build credentials locally
26
40
  *
@@ -51,4 +65,23 @@ export declare function clearCredentialsCommand(options: {
51
65
  * Use this to update specific credentials without providing all of them again
52
66
  */
53
67
  export declare function updateCredentialsCommand(options: SaveCredentialsOptions): Promise<void>;
68
+ /**
69
+ * Build a migration map from a single legacy base64 provisioning profile.
70
+ *
71
+ * Takes the legacy BUILD_PROVISION_PROFILE_BASE64 value and a bundle ID,
72
+ * extracts the profile name, and returns a JSON-serialized provisioning map.
73
+ */
74
+ export declare function buildMigrationMap(profileBase64: string, bundleId: string): string;
75
+ /**
76
+ * Migrate legacy provisioning profile credentials to the new map format.
77
+ *
78
+ * Reads saved credentials, finds the legacy BUILD_PROVISION_PROFILE_BASE64,
79
+ * discovers the main bundle ID from the local pbxproj, synthesizes the map,
80
+ * saves it, and removes old keys.
81
+ */
82
+ export declare function migrateCredentialsCommand(options: {
83
+ appId?: string;
84
+ platform?: string;
85
+ local?: boolean;
86
+ }): Promise<void>;
54
87
  export {};
@@ -50,6 +50,11 @@ export declare function convertFilesToCredentials(platform: 'ios' | 'android', f
50
50
  * Update saved credentials for a specific app and platform
51
51
  */
52
52
  export declare function updateSavedCredentials(appId: string, platform: 'ios' | 'android', credentials: Partial<BuildCredentials>, local?: boolean): Promise<void>;
53
+ /**
54
+ * Remove specific credential keys for an app/platform.
55
+ * Used during migration to clean up legacy keys.
56
+ */
57
+ export declare function removeSavedCredentialKeys(appId: string, platform: 'ios' | 'android', keys: string[], local?: boolean): Promise<void>;
53
58
  /**
54
59
  * Clear saved credentials for a specific app and/or platform
55
60
  */
@@ -0,0 +1,8 @@
1
+ export interface MobileprovisionInfo {
2
+ name: string;
3
+ uuid: string;
4
+ applicationIdentifier: string;
5
+ bundleId: string;
6
+ }
7
+ export declare function parseMobileprovision(filePath: string): MobileprovisionInfo;
8
+ export declare function parseMobileprovisionFromBase64(base64Content: string): MobileprovisionInfo;
@@ -0,0 +1,22 @@
1
+ export interface PbxTarget {
2
+ name: string;
3
+ bundleId: string;
4
+ productType: string;
5
+ }
6
+ /**
7
+ * Parse a pbxproj file's content and return all signable native targets
8
+ * with their resolved bundle identifiers.
9
+ */
10
+ export declare function findSignableTargets(pbxprojContent: string): PbxTarget[];
11
+ /**
12
+ * Search for an Xcode project.pbxproj file in standard locations:
13
+ * <searchDir>/ios/*.xcodeproj/project.pbxproj
14
+ * <searchDir>/*.xcodeproj/project.pbxproj
15
+ * Returns the first found path, or null.
16
+ */
17
+ export declare function findXcodeProject(searchDir: string): string | null;
18
+ /**
19
+ * Convenience: find the Xcode project in projectDir and read its pbxproj content.
20
+ * Returns null if no project is found.
21
+ */
22
+ export declare function readPbxproj(projectDir: string): string | null;
@@ -2,13 +2,12 @@ import { z } from 'zod';
2
2
  export declare const buildCredentialsSchema: z.ZodObject<{
3
3
  BUILD_CERTIFICATE_BASE64: z.ZodOptional<z.ZodString>;
4
4
  BUILD_PROVISION_PROFILE_BASE64: z.ZodOptional<z.ZodString>;
5
- BUILD_PROVISION_PROFILE_BASE64_PROD: z.ZodOptional<z.ZodString>;
6
5
  P12_PASSWORD: z.ZodOptional<z.ZodString>;
7
6
  APPLE_KEY_ID: z.ZodOptional<z.ZodString>;
8
7
  APPLE_ISSUER_ID: z.ZodOptional<z.ZodString>;
9
8
  APPLE_KEY_CONTENT: z.ZodOptional<z.ZodString>;
10
- APPLE_PROFILE_NAME: z.ZodOptional<z.ZodString>;
11
9
  APP_STORE_CONNECT_TEAM_ID: z.ZodOptional<z.ZodString>;
10
+ CAPGO_IOS_PROVISIONING_MAP: z.ZodOptional<z.ZodString>;
12
11
  ANDROID_KEYSTORE_FILE: z.ZodOptional<z.ZodString>;
13
12
  KEYSTORE_KEY_ALIAS: z.ZodOptional<z.ZodString>;
14
13
  KEYSTORE_KEY_PASSWORD: z.ZodOptional<z.ZodString>;
@@ -31,13 +30,10 @@ export declare const buildRequestOptionsSchema: z.ZodObject<{
31
30
  }>>;
32
31
  userId: z.ZodOptional<z.ZodString>;
33
32
  buildCertificateBase64: z.ZodOptional<z.ZodString>;
34
- buildProvisionProfileBase64: z.ZodOptional<z.ZodString>;
35
- buildProvisionProfileBase64Prod: z.ZodOptional<z.ZodString>;
36
33
  p12Password: z.ZodOptional<z.ZodString>;
37
34
  appleKeyId: z.ZodOptional<z.ZodString>;
38
35
  appleIssuerId: z.ZodOptional<z.ZodString>;
39
36
  appleKeyContent: z.ZodOptional<z.ZodString>;
40
- appleProfileName: z.ZodOptional<z.ZodString>;
41
37
  appStoreConnectTeamId: z.ZodOptional<z.ZodString>;
42
38
  iosScheme: z.ZodOptional<z.ZodString>;
43
39
  iosTarget: z.ZodOptional<z.ZodString>;
@@ -45,6 +41,8 @@ export declare const buildRequestOptionsSchema: z.ZodObject<{
45
41
  app_store: "app_store";
46
42
  ad_hoc: "ad_hoc";
47
43
  }>>;
44
+ iosProvisioningProfile: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
+ iosProvisioningMap: z.ZodOptional<z.ZodString>;
48
46
  androidKeystoreFile: z.ZodOptional<z.ZodString>;
49
47
  keystoreKeyAlias: z.ZodOptional<z.ZodString>;
50
48
  keystoreKeyPassword: z.ZodOptional<z.ZodString>;
@@ -108,8 +106,6 @@ export declare const buildOptionsPayloadSchema: z.ZodObject<{
108
106
  export type BuildOptionsPayload = z.infer<typeof buildOptionsPayloadSchema>;
109
107
  export declare const credentialFileSchema: z.ZodObject<{
110
108
  BUILD_CERTIFICATE_FILE: z.ZodOptional<z.ZodString>;
111
- BUILD_PROVISION_PROFILE_FILE: z.ZodOptional<z.ZodString>;
112
- BUILD_PROVISION_PROFILE_FILE_PROD: z.ZodOptional<z.ZodString>;
113
109
  APPLE_KEY_FILE: z.ZodOptional<z.ZodString>;
114
110
  ANDROID_KEYSTORE_PATH: z.ZodOptional<z.ZodString>;
115
111
  PLAY_CONFIG_JSON_PATH: z.ZodOptional<z.ZodString>;
@@ -119,13 +115,12 @@ export declare const savedCredentialsSchema: z.ZodObject<{
119
115
  ios: z.ZodOptional<z.ZodObject<{
120
116
  BUILD_CERTIFICATE_BASE64: z.ZodOptional<z.ZodOptional<z.ZodString>>;
121
117
  BUILD_PROVISION_PROFILE_BASE64: z.ZodOptional<z.ZodOptional<z.ZodString>>;
122
- BUILD_PROVISION_PROFILE_BASE64_PROD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
123
118
  P12_PASSWORD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
124
119
  APPLE_KEY_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
125
120
  APPLE_ISSUER_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
126
121
  APPLE_KEY_CONTENT: z.ZodOptional<z.ZodOptional<z.ZodString>>;
127
- APPLE_PROFILE_NAME: z.ZodOptional<z.ZodOptional<z.ZodString>>;
128
122
  APP_STORE_CONNECT_TEAM_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
123
+ CAPGO_IOS_PROVISIONING_MAP: z.ZodOptional<z.ZodOptional<z.ZodString>>;
129
124
  ANDROID_KEYSTORE_FILE: z.ZodOptional<z.ZodOptional<z.ZodString>>;
130
125
  KEYSTORE_KEY_ALIAS: z.ZodOptional<z.ZodOptional<z.ZodString>>;
131
126
  KEYSTORE_KEY_PASSWORD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -135,13 +130,12 @@ export declare const savedCredentialsSchema: z.ZodObject<{
135
130
  android: z.ZodOptional<z.ZodObject<{
136
131
  BUILD_CERTIFICATE_BASE64: z.ZodOptional<z.ZodOptional<z.ZodString>>;
137
132
  BUILD_PROVISION_PROFILE_BASE64: z.ZodOptional<z.ZodOptional<z.ZodString>>;
138
- BUILD_PROVISION_PROFILE_BASE64_PROD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
139
133
  P12_PASSWORD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
140
134
  APPLE_KEY_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
141
135
  APPLE_ISSUER_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
142
136
  APPLE_KEY_CONTENT: z.ZodOptional<z.ZodOptional<z.ZodString>>;
143
- APPLE_PROFILE_NAME: z.ZodOptional<z.ZodOptional<z.ZodString>>;
144
137
  APP_STORE_CONNECT_TEAM_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
138
+ CAPGO_IOS_PROVISIONING_MAP: z.ZodOptional<z.ZodOptional<z.ZodString>>;
145
139
  ANDROID_KEYSTORE_FILE: z.ZodOptional<z.ZodOptional<z.ZodString>>;
146
140
  KEYSTORE_KEY_ALIAS: z.ZodOptional<z.ZodOptional<z.ZodString>>;
147
141
  KEYSTORE_KEY_PASSWORD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -154,13 +148,12 @@ export declare const allCredentialsSchema: z.ZodRecord<z.ZodString, z.ZodObject<
154
148
  ios: z.ZodOptional<z.ZodObject<{
155
149
  BUILD_CERTIFICATE_BASE64: z.ZodOptional<z.ZodOptional<z.ZodString>>;
156
150
  BUILD_PROVISION_PROFILE_BASE64: z.ZodOptional<z.ZodOptional<z.ZodString>>;
157
- BUILD_PROVISION_PROFILE_BASE64_PROD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
158
151
  P12_PASSWORD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
159
152
  APPLE_KEY_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
160
153
  APPLE_ISSUER_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
161
154
  APPLE_KEY_CONTENT: z.ZodOptional<z.ZodOptional<z.ZodString>>;
162
- APPLE_PROFILE_NAME: z.ZodOptional<z.ZodOptional<z.ZodString>>;
163
155
  APP_STORE_CONNECT_TEAM_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
156
+ CAPGO_IOS_PROVISIONING_MAP: z.ZodOptional<z.ZodOptional<z.ZodString>>;
164
157
  ANDROID_KEYSTORE_FILE: z.ZodOptional<z.ZodOptional<z.ZodString>>;
165
158
  KEYSTORE_KEY_ALIAS: z.ZodOptional<z.ZodOptional<z.ZodString>>;
166
159
  KEYSTORE_KEY_PASSWORD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -170,13 +163,12 @@ export declare const allCredentialsSchema: z.ZodRecord<z.ZodString, z.ZodObject<
170
163
  android: z.ZodOptional<z.ZodObject<{
171
164
  BUILD_CERTIFICATE_BASE64: z.ZodOptional<z.ZodOptional<z.ZodString>>;
172
165
  BUILD_PROVISION_PROFILE_BASE64: z.ZodOptional<z.ZodOptional<z.ZodString>>;
173
- BUILD_PROVISION_PROFILE_BASE64_PROD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
174
166
  P12_PASSWORD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
175
167
  APPLE_KEY_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
176
168
  APPLE_ISSUER_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
177
169
  APPLE_KEY_CONTENT: z.ZodOptional<z.ZodOptional<z.ZodString>>;
178
- APPLE_PROFILE_NAME: z.ZodOptional<z.ZodOptional<z.ZodString>>;
179
170
  APP_STORE_CONNECT_TEAM_ID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
171
+ CAPGO_IOS_PROVISIONING_MAP: z.ZodOptional<z.ZodOptional<z.ZodString>>;
180
172
  ANDROID_KEYSTORE_FILE: z.ZodOptional<z.ZodOptional<z.ZodString>>;
181
173
  KEYSTORE_KEY_ALIAS: z.ZodOptional<z.ZodOptional<z.ZodString>>;
182
174
  KEYSTORE_KEY_PASSWORD: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -254,13 +254,12 @@ export declare const requestBuildOptionsSchema: z.ZodObject<{
254
254
  credentials: z.ZodOptional<z.ZodObject<{
255
255
  BUILD_CERTIFICATE_BASE64: z.ZodOptional<z.ZodString>;
256
256
  BUILD_PROVISION_PROFILE_BASE64: z.ZodOptional<z.ZodString>;
257
- BUILD_PROVISION_PROFILE_BASE64_PROD: z.ZodOptional<z.ZodString>;
258
257
  P12_PASSWORD: z.ZodOptional<z.ZodString>;
259
258
  APPLE_KEY_ID: z.ZodOptional<z.ZodString>;
260
259
  APPLE_ISSUER_ID: z.ZodOptional<z.ZodString>;
261
260
  APPLE_KEY_CONTENT: z.ZodOptional<z.ZodString>;
262
- APPLE_PROFILE_NAME: z.ZodOptional<z.ZodString>;
263
261
  APP_STORE_CONNECT_TEAM_ID: z.ZodOptional<z.ZodString>;
262
+ CAPGO_IOS_PROVISIONING_MAP: z.ZodOptional<z.ZodString>;
264
263
  ANDROID_KEYSTORE_FILE: z.ZodOptional<z.ZodString>;
265
264
  KEYSTORE_KEY_ALIAS: z.ZodOptional<z.ZodString>;
266
265
  KEYSTORE_KEY_PASSWORD: z.ZodOptional<z.ZodString>;
package/dist/src/sdk.d.ts CHANGED
@@ -2,14 +2,14 @@ import type { Channel } from './api/channels';
2
2
  import type { DecryptResult } from './bundle/decrypt';
3
3
  import type { EncryptResult } from './bundle/encrypt';
4
4
  import type { ZipResult } from './bundle/zip';
5
- import type { AccountIdOptions, AddAppOptions, AddChannelOptions, AddOrganizationOptions, AppInfo, BundleCompatibilityOptions, BundleInfo, CleanupOptions, CurrentBundleOptions, DecryptBundleOptions, DeleteOldKeyOptions, DeleteOrganizationOptions, DeviceStats, DoctorOptions, EncryptBundleOptions, GenerateKeyOptions, GetStatsOptions, ListOrganizationsOptions, LoginOptions, OrganizationInfo, ProbeOptions, RequestBuildOptions, SaveKeyOptions, SDKResult, SetSettingOptions, UpdateAppOptions, UpdateChannelOptions, UpdateOrganizationOptions, UploadOptions, UploadResult, ZipBundleOptions } from './schemas/sdk';
6
5
  import type { ProbeInternalResult } from './probe';
6
+ import type { AccountIdOptions, AddAppOptions, AddChannelOptions, AddOrganizationOptions, AppInfo, BundleCompatibilityOptions, BundleInfo, CleanupOptions, CurrentBundleOptions, DecryptBundleOptions, DeleteOldKeyOptions, DeleteOrganizationOptions, DeviceStats, DoctorOptions, EncryptBundleOptions, GenerateKeyOptions, GetStatsOptions, ListOrganizationsOptions, LoginOptions, OrganizationInfo, ProbeOptions, RequestBuildOptions, SaveKeyOptions, SDKResult, SetSettingOptions, UpdateAppOptions, UpdateChannelOptions, UpdateOrganizationOptions, UploadOptions, UploadResult, ZipBundleOptions } from './schemas/sdk';
7
7
  import { getInfoInternal } from './app/info';
8
8
  import { checkCompatibilityInternal } from './bundle/compatibility';
9
9
  export type DoctorInfo = Awaited<ReturnType<typeof getInfoInternal>>;
10
10
  type CompatibilityReport = Awaited<ReturnType<typeof checkCompatibilityInternal>>['finalCompatibility'];
11
11
  export type BundleCompatibilityEntry = CompatibilityReport[number];
12
- export type { BuildCredentials } from './build/request';
12
+ export type { UpdateProbeResult } from './app/updateProbe';
13
13
  /**
14
14
  * Capgo SDK for programmatic access to all CLI functionality.
15
15
  * Use this class to integrate Capgo operations directly into your application.
@@ -185,7 +185,7 @@ export declare class CapgoSDK {
185
185
  * lane: 'ios', // Must be exactly "ios" or "android"
186
186
  * credentials: {
187
187
  * BUILD_CERTIFICATE_BASE64: 'base64-cert...',
188
- * BUILD_PROVISION_PROFILE_BASE64: 'base64-profile...',
188
+ * CAPGO_IOS_PROVISIONING_MAP: '{"com.example.app":{"profile":"base64...","name":"match AppStore com.example.app"}}',
189
189
  * P12_PASSWORD: 'cert-password',
190
190
  * APPLE_KEY_ID: 'KEY123',
191
191
  * APPLE_ISSUER_ID: 'issuer-uuid',
@@ -484,10 +484,10 @@ export declare function getCapacitorConfig(): Promise<{
484
484
  };
485
485
  path: string;
486
486
  } | null>;
487
+ export type { BuildCredentials } from './build/request';
487
488
  export type { CapacitorConfig } from './config';
488
- export type { AccountIdOptions, AddAppOptions, AddChannelOptions, AddOrganizationOptions, AppInfo, BundleCompatibilityOptions, BundleInfo, CleanupOptions, CurrentBundleOptions, DecryptBundleOptions, DeleteOldKeyOptions, DeleteOrganizationOptions, DeviceStats, DoctorOptions, EncryptBundleOptions, GenerateKeyOptions, GetStatsOptions, ListOrganizationsOptions, LoginOptions, OrganizationInfo, ProbeOptions, RequestBuildOptions, SaveKeyOptions, SDKResult, SetSettingOptions, StatsOrder, UpdateAppOptions, UpdateChannelOptions, UpdateOrganizationOptions, UploadOptions, UploadResult, ZipBundleOptions, } from './schemas/sdk';
489
- export type { UpdateProbeResult } from './app/updateProbe';
490
489
  export type { ProbeInternalResult } from './probe';
490
+ export type { AccountIdOptions, AddAppOptions, AddChannelOptions, AddOrganizationOptions, AppInfo, BundleCompatibilityOptions, BundleInfo, CleanupOptions, CurrentBundleOptions, DecryptBundleOptions, DeleteOldKeyOptions, DeleteOrganizationOptions, DeviceStats, DoctorOptions, EncryptBundleOptions, GenerateKeyOptions, GetStatsOptions, ListOrganizationsOptions, LoginOptions, OrganizationInfo, ProbeOptions, RequestBuildOptions, SaveKeyOptions, SDKResult, SetSettingOptions, StatsOrder, UpdateAppOptions, UpdateChannelOptions, UpdateOrganizationOptions, UploadOptions, UploadResult, ZipBundleOptions, } from './schemas/sdk';
491
491
  export type { Database } from './types/supabase.types';
492
492
  export { createSupabaseClient } from './utils';
493
493
  export { formatApiErrorForCli, getSecurityPolicyMessage, isSecurityPolicyError, parseSecurityPolicyError, SECURITY_POLICY_ERRORS, SECURITY_POLICY_MESSAGES, } from './utils/security_policy_errors';