@capgo/cli 7.107.0 → 7.108.2

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.107.0",
4
+ "version": "7.108.2",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -75,8 +75,10 @@
75
75
  "test:checksum": "bun test/test-checksum-algorithm.mjs",
76
76
  "test:build-needed": "bun test/test-build-needed.mjs",
77
77
  "test:ci-prompts": "bun test/test-ci-prompts.mjs",
78
+ "test:ci-secrets": "bun test/test-ci-secrets.mjs",
78
79
  "test:posthog-exception": "bun test/test-posthog-exception.mjs",
79
80
  "test:onboarding-recovery": "bun test/test-onboarding-recovery.mjs",
81
+ "test:onboarding-progress": "bun test/test-onboarding-progress.mjs",
80
82
  "test:onboarding-run-targets": "bun test/test-onboarding-run-targets.mjs",
81
83
  "test:run-device-command": "bun test/test-run-device-command.mjs",
82
84
  "test:init-app-conflict": "bun test/test-init-app-conflict.mjs",
@@ -91,7 +93,7 @@
91
93
  "test:macos-signing": "bun test/test-macos-signing.mjs",
92
94
  "test:apple-api-import-helpers": "bun test/test-apple-api-import-helpers.mjs",
93
95
  "test:manifest-path-encoding": "bun test/test-manifest-path-encoding.mjs",
94
- "test": "bun run build && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-render-markdown",
96
+ "test": "bun run build && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-render-markdown",
95
97
  "test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
96
98
  "test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
97
99
  "test:ai-analyze-flow": "bun test/test-ai-analyze-flow.mjs",
@@ -7,12 +7,6 @@ interface CheckVersionOptions {
7
7
  requireMatch?: boolean;
8
8
  }
9
9
  export declare function checkVersionNotUsedInChannel(supabase: SupabaseClient<Database>, appid: string, versionData: Database['public']['Tables']['app_versions']['Row'], options?: CheckVersionOptions): Promise<void>;
10
- interface FindUnknownOptions {
11
- silent?: boolean;
12
- }
13
- export declare function findUnknownVersion(supabase: SupabaseClient<Database>, appId: string, options?: FindUnknownOptions): Promise<{
14
- id: number;
15
- }>;
16
10
  export declare function createChannel(supabase: SupabaseClient<Database>, update: Database['public']['Tables']['channels']['Insert']): import("@supabase/postgrest-js").PostgrestBuilder<{
17
11
  PostgrestVersion: "14.1";
18
12
  }, {
@@ -35,7 +29,7 @@ export declare function createChannel(supabase: SupabaseClient<Database>, update
35
29
  public: boolean;
36
30
  rbac_id: string;
37
31
  updated_at: string;
38
- version: number;
32
+ version: number | null;
39
33
  }, false>;
40
34
  export declare function delChannel(supabase: SupabaseClient<Database>, name: string, appId: string, _userId: string): import("@supabase/postgrest-js").PostgrestBuilder<{
41
35
  PostgrestVersion: "14.1";
@@ -62,7 +56,7 @@ export declare function findChannel(supabase: SupabaseClient<Database>, appId: s
62
56
  public: boolean;
63
57
  rbac_id: string;
64
58
  updated_at: string;
65
- version: number;
59
+ version: number | null;
66
60
  }, false>;
67
61
  export declare function delChannelDevices(supabase: SupabaseClient<Database>, appId: string, channelId: number): import("@supabase/postgrest-js").PostgrestFilterBuilder<{
68
62
  PostgrestVersion: "14.1";
@@ -731,7 +725,7 @@ export declare function delChannelDevices(supabase: SupabaseClient<Database>, ap
731
725
  public: boolean;
732
726
  rbac_id: string;
733
727
  updated_at: string;
734
- version: number;
728
+ version: number | null;
735
729
  };
736
730
  Insert: {
737
731
  allow_dev?: boolean;
@@ -753,7 +747,7 @@ export declare function delChannelDevices(supabase: SupabaseClient<Database>, ap
753
747
  public?: boolean;
754
748
  rbac_id?: string;
755
749
  updated_at?: string;
756
- version: number;
750
+ version?: number | null;
757
751
  };
758
752
  Update: {
759
753
  allow_dev?: boolean;
@@ -775,7 +769,7 @@ export declare function delChannelDevices(supabase: SupabaseClient<Database>, ap
775
769
  public?: boolean;
776
770
  rbac_id?: string;
777
771
  updated_at?: string;
778
- version?: number;
772
+ version?: number | null;
779
773
  };
780
774
  Relationships: [{
781
775
  foreignKeyName: "channels_app_id_fkey";
@@ -2956,7 +2950,7 @@ export declare function delChannelDevices(supabase: SupabaseClient<Database>, ap
2956
2950
  Args: {
2957
2951
  appid: string;
2958
2952
  };
2959
- Returns: number;
2953
+ Returns: number | null;
2960
2954
  };
2961
2955
  cleanup_expired_apikeys: {
2962
2956
  Args: never;
@@ -5217,7 +5211,7 @@ export declare function delChannelDevices(supabase: SupabaseClient<Database>, ap
5217
5211
  export declare function findBundleIdByChannelName(supabase: SupabaseClient<Database>, appId: string, name: string): PromiseLike<{
5218
5212
  id: number;
5219
5213
  name: string;
5220
- } | undefined>;
5214
+ } | null | undefined>;
5221
5215
  export type { Channel } from '../schemas/channel';
5222
5216
  type Channel = import('../schemas/channel').Channel;
5223
5217
  export declare function displayChannels(data: Channel[], silent?: boolean): void;
@@ -35,7 +35,7 @@ export declare function getActiveAppVersions(supabase: SupabaseClient<Database>,
35
35
  updated_at: string | null;
36
36
  user_id: string | null;
37
37
  }[]>;
38
- export declare function getChannelsVersion(supabase: SupabaseClient<Database>, appid: string, options?: VersionOptions): Promise<number[]>;
38
+ export declare function getChannelsVersion(supabase: SupabaseClient<Database>, appid: string, options?: VersionOptions): Promise<(number | null)[]>;
39
39
  export declare function getVersionData(supabase: SupabaseClient<Database>, appid: string, bundle: string, options?: VersionOptions): Promise<{
40
40
  app_id: string;
41
41
  checksum: string | null;
@@ -1,4 +1,4 @@
1
- export type AndroidOnboardingStep = 'welcome' | 'credentials-exist' | 'backing-up' | 'no-platform' | 'keystore-method-select' | 'keystore-explainer' | 'keystore-existing-path' | 'keystore-existing-picker' | 'keystore-existing-store-password' | 'keystore-existing-detecting-alias' | 'keystore-existing-alias-select' | 'keystore-existing-alias' | 'keystore-existing-key-password' | 'keystore-new-alias' | 'keystore-new-password-method' | 'keystore-new-store-password' | 'keystore-new-key-password' | 'keystore-new-cn' | 'keystore-generating' | 'google-sign-in' | 'google-sign-in-running' | 'play-developer-id-input' | 'gcp-projects-loading' | 'gcp-projects-select' | 'gcp-project-create-name' | 'android-package-select' | 'gcp-setup-running' | 'saving-credentials' | 'ask-build' | 'requesting-build' | 'build-complete' | 'error';
1
+ export type AndroidOnboardingStep = 'welcome' | 'credentials-exist' | 'backing-up' | 'no-platform' | 'keystore-method-select' | 'keystore-explainer' | 'keystore-existing-path' | 'keystore-existing-picker' | 'keystore-existing-store-password' | 'keystore-existing-detecting-alias' | 'keystore-existing-alias-select' | 'keystore-existing-alias' | 'keystore-existing-key-password' | 'keystore-new-alias' | 'keystore-new-password-method' | 'keystore-new-store-password' | 'keystore-new-key-password' | 'keystore-new-cn' | 'keystore-generating' | 'google-sign-in' | 'google-sign-in-running' | 'play-developer-id-input' | 'gcp-projects-loading' | 'gcp-projects-select' | 'gcp-project-create-name' | 'android-package-select' | 'gcp-setup-running' | 'saving-credentials' | 'detecting-ci-secrets' | 'ci-secrets-setup' | 'ci-secrets-target-select' | 'ask-ci-secrets' | 'checking-ci-secrets' | 'confirm-ci-secret-overwrite' | 'uploading-ci-secrets' | 'ci-secrets-failed' | 'ask-build' | 'requesting-build' | 'build-complete' | 'error';
2
2
  export type KeystoreMethod = 'existing' | 'generate';
3
3
  export interface KeystoreReady {
4
4
  keystorePath: string;
@@ -0,0 +1,40 @@
1
+ import type { BuildCredentials } from '../../schemas/build.js';
2
+ export type CiSecretProvider = 'github' | 'gitlab';
3
+ export interface CiSecretEntry {
4
+ key: string;
5
+ value: string;
6
+ masked: boolean;
7
+ }
8
+ export interface CiSecretTarget {
9
+ provider: CiSecretProvider;
10
+ label: string;
11
+ cli: 'gh' | 'glab';
12
+ }
13
+ export interface CiSecretDiscovery {
14
+ targets: CiSecretTarget[];
15
+ setup: CiSecretSetupAdvice[];
16
+ notes: string[];
17
+ }
18
+ export interface CiSecretSetupAdvice {
19
+ target: CiSecretTarget;
20
+ reason: 'not-installed' | 'not-authenticated';
21
+ message: string;
22
+ commands: string[];
23
+ }
24
+ interface CommandRunOptions {
25
+ input?: string;
26
+ }
27
+ export interface CommandRunResult {
28
+ status: number | null;
29
+ stdout: string;
30
+ stderr: string;
31
+ error?: Error;
32
+ }
33
+ export type CommandRunner = (command: string, args: string[], options?: CommandRunOptions) => CommandRunResult;
34
+ export declare function runCommand(command: string, args: string[], options?: CommandRunOptions): CommandRunResult;
35
+ export declare function createCiSecretEntries(credentials: Partial<BuildCredentials>): CiSecretEntry[];
36
+ export declare function detectCiSecretTargets(runner?: CommandRunner): CiSecretDiscovery;
37
+ export declare function getCiSecretTargetLabel(target: CiSecretTarget | null | undefined): string;
38
+ export declare function listExistingCiSecretKeys(target: CiSecretTarget, keys: string[], runner?: CommandRunner): string[];
39
+ export declare function uploadCiSecrets(target: CiSecretTarget, entries: CiSecretEntry[], existingKeys?: string[], runner?: CommandRunner): void;
40
+ export {};
@@ -21,3 +21,30 @@ export declare function deleteProgress(appId: string, baseDir?: string): Promise
21
21
  * the Apple 3-cert-limit error for users at the limit).
22
22
  */
23
23
  export declare function getResumeStep(progress: OnboardingProgress | null): OnboardingStep;
24
+ /**
25
+ * Pure routing decision used by the `import-scanning` useEffect to skip
26
+ * questions the user already answered on a previous attempt.
27
+ *
28
+ * The shipped flow always sent users to `import-distribution-mode` after
29
+ * scanning, and the distribution-mode picker always sent app_store users to
30
+ * `api-key-instructions`. That re-asked the .p8 file path on resume even
31
+ * though `keyId` / `issuerId` / `p8Path` were already saved in progress —
32
+ * exposed by users seeing "✔ API Key verified — Key: X" (hydrated log)
33
+ * alongside "How do you want to provide the .p8 file?" on the same screen.
34
+ *
35
+ * IMPORTANT — we intentionally do NOT short-circuit on
36
+ * `completedSteps.apiKeyVerified`. Going through `verifying-key` on every
37
+ * resume is a brief network round-trip that catches two failure modes a
38
+ * short-circuit would silently allow:
39
+ * 1. The user moved/deleted the saved .p8 between runs — `verifying-key`
40
+ * surfaces this via NeedP8Error and routes back to the .p8 input.
41
+ * 2. The key was revoked on Apple's side — `verifying-key` gets a 401 and
42
+ * the user gets a clear error instead of a late failure inside
43
+ * `saving-credentials` (after the Keychain ACL prompt has already
44
+ * fired for the .p12 export).
45
+ *
46
+ * Exported so the routing decision can be unit-tested without rendering Ink.
47
+ *
48
+ * Returns the step to land on after a successful Keychain scan.
49
+ */
50
+ export declare function getImportEntryStep(progress: OnboardingProgress | null): OnboardingStep;
@@ -1,5 +1,5 @@
1
1
  export type Platform = 'ios' | 'android';
2
- export type OnboardingStep = 'welcome' | 'platform-select' | 'adding-platform' | 'credentials-exist' | 'backing-up' | 'setup-method-select' | 'import-scanning' | 'import-distribution-mode' | 'import-pick-identity' | 'import-pick-profile' | 'import-no-match-recovery' | 'import-fetching-profile' | 'import-create-profile-only' | 'import-export-warning' | 'import-compiling-helper' | 'import-exporting' | 'api-key-instructions' | 'p8-method-select' | 'input-p8-path' | 'input-key-id' | 'input-issuer-id' | 'verifying-key' | 'creating-certificate' | 'cert-limit-prompt' | 'revoking-certificate' | 'creating-profile' | 'duplicate-profile-prompt' | 'deleting-duplicate-profiles' | 'saving-credentials' | 'ask-build' | 'requesting-build' | 'build-complete' | 'no-platform' | 'error';
2
+ export type OnboardingStep = 'welcome' | 'platform-select' | 'adding-platform' | 'credentials-exist' | 'backing-up' | 'setup-method-select' | 'import-scanning' | 'import-distribution-mode' | 'import-pick-identity' | 'import-pick-profile' | 'import-no-match-recovery' | 'import-fetching-profile' | 'import-create-profile-only' | 'import-export-warning' | 'import-compiling-helper' | 'import-exporting' | 'api-key-instructions' | 'p8-method-select' | 'input-p8-path' | 'input-key-id' | 'input-issuer-id' | 'verifying-key' | 'creating-certificate' | 'cert-limit-prompt' | 'revoking-certificate' | 'creating-profile' | 'duplicate-profile-prompt' | 'deleting-duplicate-profiles' | 'saving-credentials' | 'detecting-ci-secrets' | 'ci-secrets-setup' | 'ci-secrets-target-select' | 'ask-ci-secrets' | 'checking-ci-secrets' | 'confirm-ci-secret-overwrite' | 'uploading-ci-secrets' | 'ci-secrets-failed' | 'ask-build' | 'requesting-build' | 'build-complete' | 'no-platform' | 'error';
3
3
  export interface ApiKeyData {
4
4
  keyId: string;
5
5
  issuerId: string;
@@ -19,6 +19,6 @@ export declare function addChannelInternal(channelId: string, appId: string, opt
19
19
  public: boolean;
20
20
  rbac_id: string;
21
21
  updated_at: string;
22
- version: number;
22
+ version: number | null;
23
23
  }>;
24
24
  export declare function addChannel(channelId: string, appId: string, options: ChannelAddOptions): Promise<void>;