@capgo/cli 8.90.0 → 8.90.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.
Files changed (75) hide show
  1. package/README.md +92 -92
  2. package/dist/index.js +1080 -1027
  3. package/dist/notify-app-ready-worker.js +201 -207
  4. package/dist/onboarding-worker.js +472 -473
  5. package/dist/package.json +19 -23
  6. package/dist/src/analytics/api-perf.d.ts +39 -0
  7. package/dist/src/analytics/cli-headers.d.ts +0 -1
  8. package/dist/src/analytics/error-category.d.ts +1 -1
  9. package/dist/src/analytics/org-resolver.d.ts +2 -6
  10. package/dist/src/analytics/track.d.ts +1 -3
  11. package/dist/src/api/app.d.ts +31 -19
  12. package/dist/src/api/channels.d.ts +25 -52
  13. package/dist/src/api/cli-data.d.ts +27 -0
  14. package/dist/src/api/http-error.d.ts +9 -0
  15. package/dist/src/api/preflight.d.ts +53 -0
  16. package/dist/src/api/versions.d.ts +15 -59
  17. package/dist/src/app/add.d.ts +5 -9
  18. package/dist/src/app/debug.d.ts +1 -2
  19. package/dist/src/app/default-channels.d.ts +7 -9
  20. package/dist/src/app/list.d.ts +3 -70
  21. package/dist/src/auth/session.d.ts +1 -2
  22. package/dist/src/build/onboarding/android/ui/app.d.ts +2 -3
  23. package/dist/src/build/onboarding/app-selection.d.ts +2 -4
  24. package/dist/src/build/onboarding/appflow/tail.d.ts +1 -1
  25. package/dist/src/build/onboarding/command.d.ts +2 -3
  26. package/dist/src/build/onboarding/login.d.ts +1 -2
  27. package/dist/src/build/onboarding/ui/app.d.ts +2 -3
  28. package/dist/src/build/onboarding/ui/appflow-app.d.ts +1 -1
  29. package/dist/src/build/onboarding/ui/shell.d.ts +2 -3
  30. package/dist/src/build/prescan/command.d.ts +1 -2
  31. package/dist/src/build/prescan/context.d.ts +2 -3
  32. package/dist/src/build/prescan/types.d.ts +3 -4
  33. package/dist/src/bundle/auto-bump-ai.d.ts +6 -9
  34. package/dist/src/bundle/finalize-upload.d.ts +2 -4
  35. package/dist/src/bundle/list.d.ts +1 -25
  36. package/dist/src/bundle/manifest-upload.d.ts +1 -1
  37. package/dist/src/bundle/unlink.d.ts +1 -2
  38. package/dist/src/bundle/upload.d.ts +3 -3
  39. package/dist/src/channel/add.d.ts +3 -4
  40. package/dist/src/init/builder-setup.d.ts +1 -1
  41. package/dist/src/init/channel-selection.d.ts +2 -3
  42. package/dist/src/init/onboarding-report.d.ts +2 -4
  43. package/dist/src/init/replay.d.ts +2 -3
  44. package/dist/src/login.d.ts +1 -2
  45. package/dist/src/mcp/tool-schemas.d.ts +5 -5
  46. package/dist/src/observe/command.d.ts +1 -2
  47. package/dist/src/onboarding/background-api.d.ts +1 -1
  48. package/dist/src/onboarding/background-check.d.ts +0 -1
  49. package/dist/src/onboarding/background.d.ts +1 -2
  50. package/dist/src/organization/add.d.ts +2 -24
  51. package/dist/src/organization/list.d.ts +4 -34
  52. package/dist/src/organization/set.d.ts +4 -6
  53. package/dist/src/preview/qr.d.ts +1 -2
  54. package/dist/src/recovery/app-id.d.ts +1 -2
  55. package/dist/src/schemas/account.d.ts +2 -2
  56. package/dist/src/schemas/app.d.ts +6 -6
  57. package/dist/src/schemas/base.d.ts +2 -2
  58. package/dist/src/schemas/build.d.ts +4 -4
  59. package/dist/src/schemas/bundle.d.ts +13 -13
  60. package/dist/src/schemas/channel.d.ts +10 -10
  61. package/dist/src/schemas/onboarding.d.ts +1 -1
  62. package/dist/src/schemas/organization.d.ts +8 -8
  63. package/dist/src/schemas/sdk.d.ts +52 -52
  64. package/dist/src/sdk.d.ts +19 -8
  65. package/dist/src/sdk.js +449 -484
  66. package/dist/src/shared/network-error.d.ts +2 -2
  67. package/dist/src/shared/two-factor-compliance.d.ts +1 -1
  68. package/dist/src/types/api.d.ts +214 -0
  69. package/dist/src/user/whoami.d.ts +3 -4
  70. package/dist/src/utils.d.ts +135 -10894
  71. package/dist/updater-installed-worker.js +183 -189
  72. package/package.json +19 -23
  73. package/skills/usage/SKILL.md +2 -2
  74. package/dist/src/analytics/supabase-perf.d.ts +0 -48
  75. package/dist/src/types/supabase.types.d.ts +0 -5588
@@ -1,11 +1,10 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { Database } from '../types/supabase.types';
1
+ import type { AppVersionInsert, AppVersionRow } from '../types/api';
2
+ import type { CapgoClient } from '../utils';
3
3
  import { invokeCapgoCliApi } from '../utils';
4
4
  interface VersionOptions {
5
5
  silent?: boolean;
6
6
  apikey?: string;
7
- supaHost?: string;
8
- supaAnon?: string;
7
+ apiHost?: string;
9
8
  /** Injectable for unit tests; defaults to invokeCapgoCliApi. */
10
9
  invoke?: typeof invokeCapgoCliApi;
11
10
  }
@@ -15,63 +14,20 @@ interface DeleteSpecificVersionOptions extends VersionOptions {
15
14
  interface CapgoHttpOptions {
16
15
  apikey: string;
17
16
  silent?: boolean;
18
- supaHost?: string;
19
- supaAnon?: string;
17
+ apiHost?: string;
20
18
  }
21
- export declare function deleteAppVersion(supabase: SupabaseClient<Database> | null, appid: string, bundle: string, options?: VersionOptions): Promise<void>;
22
- export declare function deleteSpecificVersion(supabase: SupabaseClient<Database>, appid: string, bundle: string, options?: DeleteSpecificVersionOptions): Promise<void>;
23
- export declare function displayBundles(data: (Database['public']['Tables']['app_versions']['Row'] & {
19
+ export type BundleVersionLookupRow = Pick<AppVersionRow, 'id' | 'name' | 'checksum' | 'deleted' | 'created_at'>;
20
+ export declare function fetchBundleVersionRow(apikey: string, appId: string, version: string, options?: VersionOptions & {
21
+ includeDeleted?: boolean;
22
+ }): Promise<BundleVersionLookupRow | null>;
23
+ export type UpsertAppVersionInput = Pick<AppVersionInsert, 'app_id' | 'name'> & Partial<Omit<AppVersionInsert, 'app_id' | 'name'>>;
24
+ export declare function upsertAppVersion(apikey: string, versionData: UpsertAppVersionInput, options?: VersionOptions): Promise<number>;
25
+ export declare function deleteAppVersion(client: CapgoClient | null, appid: string, bundle: string, options?: VersionOptions): Promise<void>;
26
+ export declare function deleteSpecificVersion(client: CapgoClient, appid: string, bundle: string, options?: DeleteSpecificVersionOptions): Promise<void>;
27
+ export declare function displayBundles(data: (AppVersionRow & {
24
28
  keep?: string;
25
29
  })[], silent?: boolean): void;
26
- export declare function getActiveAppVersions(apikeyOrClient: string | SupabaseClient<Database>, appid: string, options?: VersionOptions): Promise<{
27
- app_id: string;
28
- checksum: string | null;
29
- cli_version: string | null;
30
- comment: string | null;
31
- created_at: string | null;
32
- created_by_apikey_rbac_id: string | null;
33
- deleted: boolean;
34
- deleted_at: string | null;
35
- external_url: string | null;
36
- id: number;
37
- key_id: string | null;
38
- link: string | null;
39
- manifest: Database["public"]["CompositeTypes"]["manifest_entry"][] | null;
40
- manifest_count: number;
41
- min_update_version: string | null;
42
- name: string;
43
- native_packages: import("../types/supabase.types").Json[] | null;
44
- owner_org: string;
45
- r2_path: string | null;
46
- session_key: string | null;
47
- storage_provider: string;
48
- updated_at: string | null;
49
- user_id: string | null;
50
- }[]>;
30
+ export declare function getActiveAppVersions(apikeyOrClient: string | CapgoClient, appid: string, options?: VersionOptions): Promise<AppVersionRow[]>;
51
31
  export declare function getChannelsVersion(options: CapgoHttpOptions, appid: string): Promise<(number | null)[]>;
52
- export declare function getVersionData(apikeyOrClient: string | SupabaseClient<Database>, appid: string, bundle: string, options?: VersionOptions): Promise<{
53
- app_id: string;
54
- checksum: string | null;
55
- cli_version: string | null;
56
- comment: string | null;
57
- created_at: string | null;
58
- created_by_apikey_rbac_id: string | null;
59
- deleted: boolean;
60
- deleted_at: string | null;
61
- external_url: string | null;
62
- id: number;
63
- key_id: string | null;
64
- link: string | null;
65
- manifest: Database["public"]["CompositeTypes"]["manifest_entry"][] | null;
66
- manifest_count: number;
67
- min_update_version: string | null;
68
- name: string;
69
- native_packages: import("../types/supabase.types").Json[] | null;
70
- owner_org: string;
71
- r2_path: string | null;
72
- session_key: string | null;
73
- storage_provider: string;
74
- updated_at: string | null;
75
- user_id: string | null;
76
- }>;
32
+ export declare function getVersionData(apikeyOrClient: string | CapgoClient, appid: string, bundle: string, options?: VersionOptions): Promise<AppVersionRow>;
77
33
  export {};
@@ -2,10 +2,9 @@ import type { AppOptions } from '../schemas/app';
2
2
  import type { Organization } from '../utils';
3
3
  export declare function appGettingStartedUrl(appId: string, hostWeb?: string): string;
4
4
  export declare function formatAppGettingStartedMessage(appId: string, hostWeb?: string): string;
5
- export declare function shouldPrintAppGettingStartedUrl(hostWeb: string, usesCustomSupabase: boolean): boolean;
5
+ export declare function shouldPrintAppGettingStartedUrl(hostWeb: string, usesCustomApi: boolean): boolean;
6
6
  export declare function resolveAppGettingStartedMessage(appId: string, options?: {
7
- supaHost?: string;
8
- supaAnon?: string;
7
+ apiHost?: string;
9
8
  }): Promise<string | null>;
10
9
  export declare const reverseDomainRegex: RegExp;
11
10
  export type AppCreateSource = 'cli-direct' | 'onboarding' | 'mcp';
@@ -14,12 +13,10 @@ export declare function isStorageObjectConflict(error: unknown): boolean;
14
13
  export declare function isDuplicateAppCreateError(error: unknown, httpStatus?: number): boolean;
15
14
  export type AppAddDuplicateOutcome = 'duplicate_owned' | 'duplicate_taken' | 'not_duplicate';
16
15
  declare function isAppListedInOrganization(apikey: string, appId: string, ownerOrg: string, options?: {
17
- supaHost?: string;
18
- supaAnon?: string;
16
+ apiHost?: string;
19
17
  }): Promise<boolean | null>;
20
18
  declare function isAppInTargetOrganization(apikey: string, appId: string, ownerOrg: string, options?: {
21
- supaHost?: string;
22
- supaAnon?: string;
19
+ apiHost?: string;
23
20
  }): Promise<boolean | null>;
24
21
  export declare function resolveAppAddDuplicateOutcome(params: {
25
22
  apikey: string;
@@ -27,8 +24,7 @@ export declare function resolveAppAddDuplicateOutcome(params: {
27
24
  ownerOrg: string;
28
25
  createError: unknown;
29
26
  httpStatus?: number;
30
- supaHost?: string;
31
- supaAnon?: string;
27
+ apiHost?: string;
32
28
  }, deps?: {
33
29
  isAppInTargetOrganization?: typeof isAppInTargetOrganization;
34
30
  isAppListedInOrganization?: typeof isAppListedInOrganization;
@@ -1,5 +1,4 @@
1
1
  import type { AppDebugOptions } from '../schemas/app';
2
- import type { Database } from '../types/supabase.types';
3
2
  export declare function sendCliEvent(channel: string, orgId: string, apikey: string, event: string, appId?: string, tags?: Record<string, string | number | boolean>): Promise<void>;
4
3
  export declare function cancelCommand(channel: string, command: boolean | symbol, orgId: string, apikey: string): Promise<void>;
5
4
  interface Order {
@@ -18,7 +17,7 @@ interface QueryStats {
18
17
  interface LogData {
19
18
  app_id: string;
20
19
  device_id: string;
21
- action: Database['public']['Enums']['stats_action'];
20
+ action: string;
22
21
  version_id: number;
23
22
  version?: number;
24
23
  created_at: string;
@@ -1,10 +1,8 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { Database } from '../types/supabase.types';
3
- type CapgoSupabaseClient = SupabaseClient<Database>;
4
- export declare function assertChannelExists(supabase: CapgoSupabaseClient, appId: string, channelName: string): Promise<{
5
- id: number;
6
- name: string;
7
- }>;
8
- export declare function setDefaultDownloadChannel(supabase: CapgoSupabaseClient, appId: string, channelName: string): Promise<void>;
9
- export declare function disableDownloadChannels(supabase: CapgoSupabaseClient, appId: string): Promise<void>;
1
+ interface ChannelHttpOptions {
2
+ apikey: string;
3
+ apiHost?: string;
4
+ }
5
+ export declare function assertChannelExists(options: ChannelHttpOptions, appId: string, channelName: string): Promise<void>;
6
+ export declare function setDefaultDownloadChannel(options: ChannelHttpOptions, appId: string, channelName: string): Promise<void>;
7
+ export declare function disableDownloadChannels(options: ChannelHttpOptions, appId: string): Promise<void>;
10
8
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { OptionsBase } from '../schemas/base';
2
- import type { Database } from '../types/supabase.types';
2
+ import type { AppRow } from '../types/api';
3
3
  interface AppListOptions extends OptionsBase {
4
4
  filterByOrgId?: string;
5
5
  showOrg?: boolean;
@@ -8,77 +8,10 @@ interface AppListOptions extends OptionsBase {
8
8
  }
9
9
  export declare const APP_LIST_ORG_FILTER_WARNING = "You have passed \"--filter-by-org-id\". You might have access to more apps. Remove the filter to see all apps";
10
10
  export declare function getAppListPath(page: number, orgId?: string): string;
11
- type AppRow = Database['public']['Tables']['apps']['Row'];
12
11
  export declare function formatAppsCsv(data: AppRow[]): string;
13
12
  export declare function formatAppListText(data: AppRow[]): string;
14
13
  export declare function getAppListHeaders(options: AppListOptions): string[];
15
14
  export declare function getAppListRow(row: AppRow, options: AppListOptions, orgNames: Map<string, string>): string[];
16
- export declare function listAppInternal(options: AppListOptions, silent?: boolean): Promise<{
17
- allow_device_custom_id: boolean;
18
- allow_preview: boolean;
19
- android_store_url: string | null;
20
- app_id: string;
21
- build_timeout_seconds: number;
22
- build_timeout_updated_at: string;
23
- block_provider_infra_requests: boolean;
24
- channel_device_count: number;
25
- created_at: string | null;
26
- created_from_onboarding: boolean;
27
- default_upload_channel: string;
28
- device_data_collection: import("../types/supabase.types").Json;
29
- existing_app: boolean;
30
- expose_metadata: boolean;
31
- icon_url: string;
32
- id: string | null;
33
- ios_store_url: string | null;
34
- last_version: string | null;
35
- manifest_bundle_count: number;
36
- rollout_channel_count: number;
37
- rollout_paused_version_names: string[];
38
- name: string | null;
39
- need_onboarding: boolean;
40
- onboarding: import("../types/supabase.types").Json;
41
- onboarding_completed_at: string | null;
42
- owner_org: string;
43
- retention: number;
44
- stats_refresh_requested_at: string | null;
45
- stats_updated_at: string | null;
46
- transfer_history: import("../types/supabase.types").Json[] | null;
47
- updated_at: string | null;
48
- user_id: string | null;
49
- }[]>;
50
- export declare function listApp(options: AppListOptions, silent?: boolean): Promise<{
51
- allow_device_custom_id: boolean;
52
- allow_preview: boolean;
53
- android_store_url: string | null;
54
- app_id: string;
55
- build_timeout_seconds: number;
56
- build_timeout_updated_at: string;
57
- block_provider_infra_requests: boolean;
58
- channel_device_count: number;
59
- created_at: string | null;
60
- created_from_onboarding: boolean;
61
- default_upload_channel: string;
62
- device_data_collection: import("../types/supabase.types").Json;
63
- existing_app: boolean;
64
- expose_metadata: boolean;
65
- icon_url: string;
66
- id: string | null;
67
- ios_store_url: string | null;
68
- last_version: string | null;
69
- manifest_bundle_count: number;
70
- rollout_channel_count: number;
71
- rollout_paused_version_names: string[];
72
- name: string | null;
73
- need_onboarding: boolean;
74
- onboarding: import("../types/supabase.types").Json;
75
- onboarding_completed_at: string | null;
76
- owner_org: string;
77
- retention: number;
78
- stats_refresh_requested_at: string | null;
79
- stats_updated_at: string | null;
80
- transfer_history: import("../types/supabase.types").Json[] | null;
81
- updated_at: string | null;
82
- user_id: string | null;
83
- }[]>;
15
+ export declare function listAppInternal(options: AppListOptions, silent?: boolean): Promise<AppRow[]>;
16
+ export declare function listApp(options: AppListOptions, silent?: boolean): Promise<AppRow[]>;
84
17
  export {};
@@ -26,8 +26,7 @@ export interface LoginState {
26
26
  export interface SaveKeyOptions {
27
27
  /** Persist to `./.capgo` (project-local) instead of `~/.capgo` (global). */
28
28
  local?: boolean;
29
- supaHost?: string;
30
- supaAnon?: string;
29
+ apiHost?: string;
31
30
  }
32
31
  /**
33
32
  * Validate an API key against Capgo and, if valid, persist it (0o600).
@@ -8,9 +8,8 @@ interface AppProps {
8
8
  androidDir: string;
9
9
  /** Optional Capgo API key passed via -a/--apikey flag; takes precedence over saved key. */
10
10
  apikey?: string;
11
- supaHost?: string;
12
- /** Custom Supabase anon key for self-hosting (--supa-anon). */
13
- supaAnon?: string;
11
+ /** Capgo API override (--api-host); Capgo cloud when omitted. */
12
+ apiHost?: string;
14
13
  /** Correlation id for this onboarding run; emitted as `journey_id` on every analytics event. */
15
14
  journeyId: string;
16
15
  /** Reports the current step to the shell on every transition, so the caller can
@@ -1,13 +1,12 @@
1
1
  import type { CapacitorConfig } from '../../config';
2
- import { createSupabaseClient, invokeCapgoCliApi } from '../../utils.js';
2
+ import { invokeCapgoCliApi } from '../../utils.js';
3
3
  export interface BuilderVisibleApp {
4
4
  app_id: string;
5
5
  name: string | null;
6
6
  need_onboarding?: boolean | null;
7
7
  }
8
8
  export interface BuilderAppApiOptions {
9
- supaHost?: string;
10
- supaAnon?: string;
9
+ apiHost?: string;
11
10
  }
12
11
  export type AppSelectionErrorCode = 'list' | 'read' | 'missing' | 'build' | 'permission' | 'config' | 'api';
13
12
  export declare class AppSelectionError extends Error {
@@ -22,7 +21,6 @@ export declare function rankVisibleApps<T extends BuilderVisibleApp>(apps: T[],
22
21
  export declare function listVisibleBuilderApps(apikey: string, options?: BuilderAppApiOptions, request?: typeof invokeCapgoCliApi): Promise<BuilderVisibleApp[]>;
23
22
  export declare function verifyBuilderApp(apikey: string, appId: string, options?: BuilderAppApiOptions, dependencies?: {
24
23
  request?: typeof invokeCapgoCliApi;
25
- createClient?: typeof createSupabaseClient;
26
24
  }): Promise<void>;
27
25
  export declare function persistBuilderAppSelection(appId: string): Promise<boolean>;
28
26
  export declare const builderAppCreationUrl: string;
@@ -22,7 +22,7 @@ export interface AppflowTailDepsOptions {
22
22
  /** Capgo API key flag (overrides the saved key, like the native drivers). */
23
23
  apikey?: string;
24
24
  /** Gateway override threaded into the build request options. */
25
- supaHost?: string;
25
+ apiHost?: string;
26
26
  /** Builder journey id threaded into the build request options. */
27
27
  journeyId?: string;
28
28
  /** Build VIEWER sink — every requesting-build line streams here (fullscreen pane). */
@@ -5,9 +5,8 @@ export interface OnboardingBuilderOptions {
5
5
  appId?: string;
6
6
  apikey?: string;
7
7
  platform?: string;
8
- supaHost?: string;
9
- /** Custom Supabase anon key for self-hosting (--supa-anon). */
10
- supaAnon?: string;
8
+ /** Capgo API override (--api-host); Capgo cloud when omitted. */
9
+ apiHost?: string;
11
10
  /**
12
11
  * Offer the self-update prompt as the first wizard screen. ONLY the genuine
13
12
  * `build init` / `onboarding` entrypoint sets this. Other callers that reach
@@ -1,7 +1,6 @@
1
1
  import type { BrowserLoginSession } from '../../init/browser-login.js';
2
2
  export interface BuilderLoginOptions {
3
- supaHost?: string;
4
- supaAnon?: string;
3
+ apiHost?: string;
5
4
  }
6
5
  export interface BuilderLoginServices {
7
6
  browserAvailable: boolean;
@@ -35,9 +35,8 @@ interface AppProps {
35
35
  guidedHelperUsable: boolean;
36
36
  /** Optional Capgo API key passed via -a/--apikey flag; takes precedence over saved key */
37
37
  apikey?: string;
38
- supaHost?: string;
39
- /** Custom Supabase anon key for self-hosting (--supa-anon). */
40
- supaAnon?: string;
38
+ /** Capgo API override (--api-host); Capgo cloud when omitted. */
39
+ apiHost?: string;
41
40
  /** Correlation id for this onboarding run; emitted as `journey_id` on every analytics event. */
42
41
  journeyId: string;
43
42
  /** Reports the current step to the shell on every transition, so the caller can
@@ -8,7 +8,7 @@ export interface AppflowAppProps {
8
8
  /** Migration scope ('ios' | 'android') from the single-platform "migrating from Appflow?" gate. */
9
9
  scope: MigrationScope;
10
10
  apikey?: string;
11
- supaHost?: string;
11
+ apiHost?: string;
12
12
  journeyId: string;
13
13
  onStep?: (step: string) => void;
14
14
  onResult?: (result: OnboardingResult) => void;
@@ -32,9 +32,8 @@ export interface OnboardingShellProps {
32
32
  guidedHelperUsable: boolean;
33
33
  apikey?: string;
34
34
  loginServices: BuilderLoginServices;
35
- supaHost?: string;
36
- /** Custom Supabase anon key for self-hosting (--supa-anon). */
37
- supaAnon?: string;
35
+ /** Capgo API override (--api-host); Capgo cloud when omitted. */
36
+ apiHost?: string;
38
37
  /** Correlation id for this onboarding run; threaded into every analytics event the apps emit. */
39
38
  journeyId: string;
40
39
  /** Pre-resolved platform (--platform flag or the single existing native dir); skips the picker. */
@@ -9,8 +9,7 @@ export interface PrescanCommandOptions {
9
9
  failOnWarnings?: boolean;
10
10
  ignoreFatal?: boolean;
11
11
  verbose?: boolean;
12
- supaHost?: string;
13
- supaAnon?: string;
12
+ apiHost?: string;
14
13
  /** Test seam for hard-coded rollout deadlines; defaults to the current time. */
15
14
  now?: Date;
16
15
  /**
@@ -1,5 +1,4 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { Database } from '../../types/supabase.types';
1
+ import type { CapgoClient } from '../../utils';
3
2
  import type { Platform, ScanContext } from './types';
4
3
  export interface BuildScanContextArgs {
5
4
  appId?: string;
@@ -8,7 +7,7 @@ export interface BuildScanContextArgs {
8
7
  distributionMode?: 'app_store' | 'ad_hoc';
9
8
  androidFlavor?: string;
10
9
  apikey?: string;
11
- supabase?: SupabaseClient<Database>;
10
+ client?: CapgoClient;
12
11
  /** pre-merged credentials when called from build request (avoids double work) */
13
12
  credentials?: Record<string, string>;
14
13
  }
@@ -1,5 +1,4 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { Database } from '../../types/supabase.types';
1
+ import type { CapgoClient } from '../../utils';
3
2
  import type { CapacitorConfig } from '../../schemas/config';
4
3
  export type Severity = 'error' | 'warning' | 'info';
5
4
  export type Platform = 'ios' | 'android';
@@ -32,14 +31,14 @@ export interface ScanContext {
32
31
  distributionMode?: 'app_store' | 'ad_hoc';
33
32
  androidFlavor?: string;
34
33
  apikey?: string;
35
- supabase?: SupabaseClient<Database>;
34
+ client?: CapgoClient;
36
35
  }
37
36
  export interface PrescanCheck {
38
37
  id: string;
39
38
  platforms: Platform[];
40
39
  /** Findings from this check stay information-only until this UTC instant. */
41
40
  enforceAfter?: string;
42
- /** requires ctx.supabase; skipped (with notice) when absent */
41
+ /** requires ctx.client; skipped (with notice) when absent */
43
42
  remote?: boolean;
44
43
  appliesTo?: (ctx: ScanContext) => boolean;
45
44
  run: (ctx: ScanContext) => Promise<Finding[]>;
@@ -1,5 +1,4 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { Database } from '../types/supabase.types';
1
+ import type { CapgoClient } from '../utils';
3
2
  import type { AutoBumpLevel } from '../versionHelpers';
4
3
  export type ManifestEntry = {
5
4
  file: string;
@@ -20,8 +19,8 @@ export type AiBumpDecision = {
20
19
  reason: string;
21
20
  };
22
21
  export declare function diffManifests(local: ManifestEntry[], remote: ManifestEntry[]): ManifestDiff;
23
- export declare function fetchRemoteManifest(supabase: SupabaseClient<Database>, versionId: number): Promise<ManifestEntry[]>;
24
- export declare function resolveBaseVersionForAutoBump(supabase: SupabaseClient<Database>, appid: string, channels: string[]): Promise<{
22
+ export declare function fetchRemoteManifest(client: CapgoClient, versionId: number): Promise<ManifestEntry[]>;
23
+ export declare function resolveBaseVersionForAutoBump(client: CapgoClient, appid: string, channels: string[]): Promise<{
25
24
  name: string;
26
25
  id: number;
27
26
  } | null>;
@@ -34,17 +33,15 @@ export declare function requestAiBumpLevel(options: {
34
33
  summary: string;
35
34
  breaking?: boolean;
36
35
  };
37
- supaHost?: string;
38
- supaAnon?: string;
36
+ apiHost?: string;
39
37
  }): Promise<AiBumpDecision>;
40
38
  export declare function resolveAutoBumpLevelFromAi(ctx: {
41
- supabase: SupabaseClient<Database>;
39
+ client: CapgoClient;
42
40
  appid: string;
43
41
  channels: string[];
44
42
  path: string;
45
43
  apikey: string;
46
44
  options?: {
47
- supaHost?: string;
48
- supaAnon?: string;
45
+ apiHost?: string;
49
46
  };
50
47
  }): Promise<AiBumpDecision>;
@@ -3,8 +3,7 @@ interface FinalizeBundleOptions {
3
3
  apikey: string;
4
4
  appId: string;
5
5
  bundle: string;
6
- supaHost?: string;
7
- supaAnon?: string;
6
+ apiHost?: string;
8
7
  reporter: UploadReporter;
9
8
  }
10
9
  interface FinalizeInvokeOptions {
@@ -14,8 +13,7 @@ interface FinalizeInvokeOptions {
14
13
  app_id: string;
15
14
  name: string;
16
15
  };
17
- supaHost?: string;
18
- supaAnon?: string;
16
+ apiHost?: string;
19
17
  }
20
18
  interface FinalizeBundleDependencies {
21
19
  invoke: (path: string, options: FinalizeInvokeOptions) => Promise<{
@@ -1,26 +1,2 @@
1
1
  import type { OptionsBase } from '../schemas/base';
2
- export declare function listBundle(appId: string, options: OptionsBase, silent?: boolean): Promise<{
3
- app_id: string;
4
- checksum: string | null;
5
- cli_version: string | null;
6
- comment: string | null;
7
- created_at: string | null;
8
- created_by_apikey_rbac_id: string | null;
9
- deleted: boolean;
10
- deleted_at: string | null;
11
- external_url: string | null;
12
- id: number;
13
- key_id: string | null;
14
- link: string | null;
15
- manifest: import("../sdk").Database["public"]["CompositeTypes"]["manifest_entry"][] | null;
16
- manifest_count: number;
17
- min_update_version: string | null;
18
- name: string;
19
- native_packages: import("../types/supabase.types").Json[] | null;
20
- owner_org: string;
21
- r2_path: string | null;
22
- session_key: string | null;
23
- storage_provider: string;
24
- updated_at: string | null;
25
- user_id: string | null;
26
- }[]>;
2
+ export declare function listBundle(appId: string, options: OptionsBase, silent?: boolean): Promise<import("../sdk").AppVersionRow[]>;
@@ -71,5 +71,5 @@ export declare function manifestUploadFileHashFormat(encryptionEnabled: boolean,
71
71
  export declare function isManifestUploadAutoEnabled(userRequestedDelta: boolean, fullZipEnabled: boolean): boolean;
72
72
  type ManifestUploadInvoke = typeof invokeCapgoCliApi;
73
73
  export declare function resolveManifestUploadResponse(request: ManifestUploadRequest, input: unknown): ResolvedManifestUpload;
74
- export declare function requestManifestUpload(apikey: string, request: ManifestUploadRequest, options?: Pick<CapgoCliInvokeOptions, 'supaHost' | 'supaAnon'>, invoke?: ManifestUploadInvoke, sleep?: (ms: number) => Promise<void>): Promise<ResolvedManifestUpload>;
74
+ export declare function requestManifestUpload(apikey: string, request: ManifestUploadRequest, options?: Pick<CapgoCliInvokeOptions, 'apiHost'>, invoke?: ManifestUploadInvoke, sleep?: (ms: number) => Promise<void>): Promise<ResolvedManifestUpload>;
75
75
  export {};
@@ -2,8 +2,7 @@ interface BundleUnlinkOptions {
2
2
  bundle?: string;
3
3
  packageJson?: string;
4
4
  apikey?: string;
5
- supaHost?: string;
6
- supaAnon?: string;
5
+ apiHost?: string;
7
6
  }
8
7
  export declare function unlinkDeviceInternal(channel: string, appId: string, options: BundleUnlinkOptions, silent?: boolean): Promise<boolean>;
9
8
  export declare function unlinkDevice(channel: string, appId: string, options: BundleUnlinkOptions): Promise<void>;
@@ -2,8 +2,6 @@ import type { UploadBundleResult } from '../schemas/bundle';
2
2
  import type { UploadReporter, UploadSpinner } from './reporter';
3
3
  import type { OptionsUpload } from './upload_interface';
4
4
  import { CliUserError } from '../shared/cli-user-error';
5
- import { createSupabaseClient } from '../utils';
6
- type SupabaseType = Awaited<ReturnType<typeof createSupabaseClient>>;
7
5
  export type { UploadBundleResult };
8
6
  export type { UploadReporter, UploadSpinner };
9
7
  /**
@@ -19,7 +17,9 @@ export type { UploadReporter, UploadSpinner };
19
17
  */
20
18
  export declare class IncompatibleBundleError extends CliUserError {
21
19
  }
22
- export declare function getDefaultUploadChannel(appId: string, supabase: SupabaseType, hostWeb: string): Promise<string>;
20
+ export declare function getDefaultUploadChannel(appId: string, apikey: string, hostWeb: string, httpOptions?: {
21
+ apiHost?: string;
22
+ }): Promise<string>;
23
23
  export declare function uploadBundleInternal(preAppid: string, options: OptionsUpload, silent?: boolean, reporter?: UploadReporter): Promise<UploadBundleResult>;
24
24
  /**
25
25
  * Validate mutually-exclusive and dependent upload options, failing fast (via
@@ -1,11 +1,10 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
1
+ import type { CapgoClient } from '../utils';
2
2
  import type { ChannelAddOptions } from '../schemas/channel';
3
- import type { Database } from '../types/supabase.types';
4
- export declare function isChannelReadableByCaller(supabase: SupabaseClient<Database>, appId: string, channelName: string): Promise<boolean | null>;
3
+ export declare function isChannelReadableByCaller(client: CapgoClient, appId: string, channelName: string): Promise<boolean | null>;
5
4
  export type ChannelAddDuplicateOutcome = 'duplicate_readable' | 'duplicate_inaccessible' | 'not_duplicate';
6
5
  export declare function resolveChannelAddDuplicateOutcome(params: {
7
6
  createError: unknown;
8
- supabase: SupabaseClient<Database>;
7
+ client: CapgoClient;
9
8
  appId: string;
10
9
  channelName: string;
11
10
  }, deps?: {
@@ -2,7 +2,7 @@ import type { OnboardingBuilderOptions } from '../build/onboarding/command';
2
2
  import { invokeCapgoCliApi } from '../utils';
3
3
  type SetupOptions = {
4
4
  apikey: string;
5
- } & Pick<OnboardingBuilderOptions, 'supaHost' | 'supaAnon' | 'analytics'>;
5
+ } & Pick<OnboardingBuilderOptions, 'apiHost' | 'analytics'>;
6
6
  export declare function readBuilderOnlyAssignment(appId: string, options: SetupOptions, request?: typeof invokeCapgoCliApi): Promise<{
7
7
  version: number;
8
8
  path: "builder";
@@ -1,9 +1,8 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { Database } from '../types/supabase.types';
1
+ import type { CapgoClient } from '../utils';
3
2
  interface ChannelSelectionPrompts {
4
3
  reuseChannel: (name: string) => Promise<boolean>;
5
4
  chooseName: (existingNames: string[]) => Promise<string>;
6
5
  createChannel: (name: string) => Promise<void>;
7
6
  }
8
- export declare function selectOnboardingChannel(supabase: SupabaseClient<Database>, appId: string, preferredName: string, prompts: ChannelSelectionPrompts): Promise<string>;
7
+ export declare function selectOnboardingChannel(client: CapgoClient, appId: string, preferredName: string, prompts: ChannelSelectionPrompts): Promise<string>;
9
8
  export {};
@@ -1,13 +1,11 @@
1
1
  import type { InitOnboardingStepId } from './onboarding-steps';
2
2
  export declare function reportInitOnboardingStep(apikey: string, appId: string | undefined, stepNumber: number, status?: 'done' | 'skipped', options?: {
3
- supaHost?: string;
4
- supaAnon?: string;
3
+ apiHost?: string;
5
4
  outcome?: 'completed' | 'skipped' | 'in_progress';
6
5
  }): Promise<void>;
7
6
  export declare function reportInitOnboarding(apikey: string, appId: string, steps: Partial<Record<InitOnboardingStepId, {
8
7
  status: 'done' | 'skipped';
9
8
  }>>, options?: {
10
- supaHost?: string;
11
- supaAnon?: string;
9
+ apiHost?: string;
12
10
  outcome?: 'completed' | 'skipped' | 'in_progress' | 'switched_to_manual';
13
11
  }): Promise<void>;
@@ -46,8 +46,8 @@ interface StartInitReplayOptions {
46
46
  replayUrl?: string;
47
47
  rows?: number;
48
48
  sessionPrefix?: string;
49
- supaAnon?: string;
50
- supaHost?: string;
49
+ /** Custom Capgo API (--api-host): replays go to its /private/replay. */
50
+ apiHost?: string;
51
51
  throttleMs?: number;
52
52
  terminalPixelSize?: TerminalPixelSize;
53
53
  transport?: InitReplayTransport;
@@ -61,7 +61,6 @@ export declare function finishActiveCliReplay(): Promise<void>;
61
61
  export declare function isCliTelemetryDisabled(): boolean;
62
62
  export declare function shouldStartInitReplay(input: InitReplayGateInput): boolean;
63
63
  export declare function resolveCapgoReplayUrl(host?: string): string | undefined;
64
- export declare function resolveSupabaseReplayUrl(supaHost?: string): string | undefined;
65
64
  export declare function resolveReplayUrlForFlush(replayUrl: Promise<string | undefined>, timeoutMs?: number, onTimeout?: () => void): Promise<string | undefined>;
66
65
  export declare function getReplayViewportSize(cols?: number, rows?: number, terminalPixelSize?: TerminalPixelSize): {
67
66
  height: number;
@@ -1,8 +1,7 @@
1
1
  interface Options {
2
2
  apikey?: string;
3
3
  local: boolean;
4
- supaHost?: string;
5
- supaAnon?: string;
4
+ apiHost?: string;
6
5
  }
7
6
  export type LoginMethod = 'browser' | 'paste';
8
7
  type LoginMethodPrompt = (options: {