@capgo/cli 8.90.0 → 8.90.1

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 (74) hide show
  1. package/README.md +92 -92
  2. package/dist/index.js +926 -936
  3. package/dist/notify-app-ready-worker.js +197 -203
  4. package/dist/onboarding-worker.js +464 -465
  5. package/dist/package.json +8 -8
  6. package/dist/src/analytics/api-perf.d.ts +39 -0
  7. package/dist/src/analytics/error-category.d.ts +1 -1
  8. package/dist/src/analytics/org-resolver.d.ts +2 -6
  9. package/dist/src/analytics/track.d.ts +1 -3
  10. package/dist/src/api/app.d.ts +31 -19
  11. package/dist/src/api/channels.d.ts +25 -52
  12. package/dist/src/api/cli-data.d.ts +27 -0
  13. package/dist/src/api/http-error.d.ts +9 -0
  14. package/dist/src/api/preflight.d.ts +53 -0
  15. package/dist/src/api/versions.d.ts +15 -59
  16. package/dist/src/app/add.d.ts +5 -9
  17. package/dist/src/app/debug.d.ts +1 -2
  18. package/dist/src/app/default-channels.d.ts +7 -9
  19. package/dist/src/app/list.d.ts +3 -70
  20. package/dist/src/auth/session.d.ts +1 -2
  21. package/dist/src/build/onboarding/android/ui/app.d.ts +2 -3
  22. package/dist/src/build/onboarding/app-selection.d.ts +2 -4
  23. package/dist/src/build/onboarding/appflow/tail.d.ts +1 -1
  24. package/dist/src/build/onboarding/command.d.ts +2 -3
  25. package/dist/src/build/onboarding/login.d.ts +1 -2
  26. package/dist/src/build/onboarding/ui/app.d.ts +2 -3
  27. package/dist/src/build/onboarding/ui/appflow-app.d.ts +1 -1
  28. package/dist/src/build/onboarding/ui/shell.d.ts +2 -3
  29. package/dist/src/build/prescan/command.d.ts +1 -2
  30. package/dist/src/build/prescan/context.d.ts +2 -3
  31. package/dist/src/build/prescan/types.d.ts +3 -4
  32. package/dist/src/bundle/auto-bump-ai.d.ts +6 -9
  33. package/dist/src/bundle/finalize-upload.d.ts +2 -4
  34. package/dist/src/bundle/list.d.ts +1 -25
  35. package/dist/src/bundle/manifest-upload.d.ts +1 -1
  36. package/dist/src/bundle/unlink.d.ts +1 -2
  37. package/dist/src/bundle/upload.d.ts +3 -3
  38. package/dist/src/channel/add.d.ts +3 -4
  39. package/dist/src/init/builder-setup.d.ts +1 -1
  40. package/dist/src/init/channel-selection.d.ts +2 -3
  41. package/dist/src/init/onboarding-report.d.ts +2 -4
  42. package/dist/src/init/replay.d.ts +2 -3
  43. package/dist/src/login.d.ts +1 -2
  44. package/dist/src/mcp/tool-schemas.d.ts +5 -5
  45. package/dist/src/observe/command.d.ts +1 -2
  46. package/dist/src/onboarding/background-api.d.ts +1 -1
  47. package/dist/src/onboarding/background-check.d.ts +0 -1
  48. package/dist/src/onboarding/background.d.ts +1 -2
  49. package/dist/src/organization/add.d.ts +2 -24
  50. package/dist/src/organization/list.d.ts +4 -34
  51. package/dist/src/organization/set.d.ts +4 -6
  52. package/dist/src/preview/qr.d.ts +1 -2
  53. package/dist/src/recovery/app-id.d.ts +1 -2
  54. package/dist/src/schemas/account.d.ts +2 -2
  55. package/dist/src/schemas/app.d.ts +6 -6
  56. package/dist/src/schemas/base.d.ts +2 -2
  57. package/dist/src/schemas/build.d.ts +4 -4
  58. package/dist/src/schemas/bundle.d.ts +13 -13
  59. package/dist/src/schemas/channel.d.ts +10 -10
  60. package/dist/src/schemas/onboarding.d.ts +1 -1
  61. package/dist/src/schemas/organization.d.ts +8 -8
  62. package/dist/src/schemas/sdk.d.ts +52 -52
  63. package/dist/src/sdk.d.ts +19 -8
  64. package/dist/src/sdk.js +449 -484
  65. package/dist/src/shared/network-error.d.ts +2 -2
  66. package/dist/src/shared/two-factor-compliance.d.ts +1 -1
  67. package/dist/src/types/api.d.ts +214 -0
  68. package/dist/src/user/whoami.d.ts +3 -4
  69. package/dist/src/utils.d.ts +135 -10894
  70. package/dist/updater-installed-worker.js +184 -190
  71. package/package.json +8 -8
  72. package/skills/usage/SKILL.md +2 -2
  73. package/dist/src/analytics/supabase-perf.d.ts +0 -48
  74. package/dist/src/types/supabase.types.d.ts +0 -5588
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "8.90.0",
4
+ "version": "8.90.1",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -57,7 +57,6 @@
57
57
  "no-debug": "node dist/index.js",
58
58
  "dev-build": "SUPA_DB=development ncc build",
59
59
  "pack": "pkg",
60
- "types": "bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",
61
60
  "typecheck": "tsgo --project tsconfig.tsgo.json --noEmit",
62
61
  "lint": "bun run lint:ox",
63
62
  "lint:ox": "oxlint --config ../.oxlintrc.json src",
@@ -89,6 +88,7 @@
89
88
  "test:build-cancellation": "bun test/test-build-cancellation.mjs",
90
89
  "test:ci-prompts": "bun test/test-ci-prompts.mjs",
91
90
  "test:capgo-app-id-prompt": "bun test/test-capgo-app-id-prompt.mjs",
91
+ "test:bundle-soft-delete": "bun test/test-bundle-soft-delete.mjs",
92
92
  "test:ci-secrets": "bun test/test-ci-secrets.mjs",
93
93
  "test:android-onboarding-progress": "bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs",
94
94
  "test:android-keystore-action": "bun test/test-android-keystore-action.mjs",
@@ -101,12 +101,13 @@
101
101
  "test:authenticated-command-invocation": "bun test/test-authenticated-command-invocation.mjs",
102
102
  "test:analytics-error-category": "bun test/test-analytics-error-category.mjs",
103
103
  "test:analytics-org-resolver": "bun test/test-analytics-org-resolver.mjs",
104
- "test:supabase-perf": "bun test/test-supabase-perf.mjs",
104
+ "test:api-perf": "bun test/test-api-perf.mjs",
105
105
  "test:preview-qr": "bun test/test-preview-qr.mjs",
106
106
  "test:bundle-pages": "bun test test/test-bundle-pages.test.ts",
107
107
  "test:mcp-analytics": "bun test/test-mcp-analytics.mjs",
108
108
  "test:mcp-instructions": "bun test/test-mcp-instructions.mjs",
109
109
  "test:mcp-stdout-guard": "bun test/test-mcp-stdout-guard.mjs",
110
+ "test:mcp-host-fields": "bun test/test-mcp-host-fields.mjs",
110
111
  "test:mcp-platform-select": "bun test/test-mcp-platform-select.mjs",
111
112
  "test:mcp-explain-scopes": "bun test/test-mcp-explain-scopes.mjs",
112
113
  "test:mcp-oauth-reopen": "bun test/test-mcp-oauth-reopen.mjs",
@@ -124,7 +125,8 @@
124
125
  "test:doctor-analytics": "bun test/test-doctor-analytics.mjs",
125
126
  "test:posthog-exception": "bun test/test-posthog-exception.mjs",
126
127
  "test:cli-recovery": "bun test/test-cli-recovery.mjs",
127
- "test:create-supabase-client": "bun test/test-create-supabase-client.mjs",
128
+ "test:create-capgo-client": "bun test/test-create-capgo-client.mjs",
129
+ "test:no-supabase-sdk": "bun test/test-no-supabase-sdk.mjs",
128
130
  "test:onboarding-recovery": "bun test/test-onboarding-recovery.mjs",
129
131
  "test:onboarding-progress": "bun test/test-onboarding-progress.mjs",
130
132
  "test:onboarding-run-targets": "bun test/test-onboarding-run-targets.mjs",
@@ -145,7 +147,7 @@
145
147
  "test:init-monorepo-targeting": "bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs",
146
148
  "test:prompt-preferences": "bun test/test-prompt-preferences.mjs",
147
149
  "test:esm-sdk": "node test/test-sdk-esm.mjs",
148
- "test:auth-session": "bun test/test-auth-session.mjs",
150
+ "test:auth-session": "bun test/test-auth-session.mjs && bun test/test-auth-session-bad-key.mjs",
149
151
  "test:mcp": "node test/test-mcp.mjs",
150
152
  "test:mcp-no-key-handshake": "node test/test-mcp-no-key-handshake.mjs",
151
153
  "test:version-detection": "node test/test-get-installed-version.mjs",
@@ -195,7 +197,7 @@
195
197
  "test": "bun run build && bun scripts/run-test-suite.ts",
196
198
  "test:run": "bun scripts/run-test-suite.ts",
197
199
  "test:serial": "bun run build && bun scripts/run-test-suite.ts --serial",
198
- "test:suite": "bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:settings-parity && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && 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-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation && bun run test:setup-notices",
200
+ "test:suite": "bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-host-fields && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && 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-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:plan-validation && bun run test:setup-notices && bun run test:settings-parity",
199
201
  "test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
200
202
  "test:builder-project-discovery": "bun test/test-builder-project-discovery.mjs",
201
203
  "test:builder-app-selection": "bun test/test-builder-app-selection.mjs",
@@ -244,7 +246,6 @@
244
246
  "test:app-permission-helper": "bun test/test-app-permission-helper.mjs",
245
247
  "test:2fa-compliance-network": "bun test/test-2fa-compliance-network.mjs",
246
248
  "test:organization-set-api-host": "bun test/test-organization-set-api-host.mjs",
247
- "test:trial-warning": "bun test/test-trial-warning.mjs",
248
249
  "test:plan-validation": "bun test/test-plan-validation.mjs",
249
250
  "test:auto-bump-version": "bun test/test-auto-bump-version.mjs",
250
251
  "test:auto-bump-ai-diff": "bun test/test-auto-bump-ai-diff.mjs",
@@ -290,7 +291,6 @@
290
291
  "@sauber/table": "npm:@jsr/sauber__table",
291
292
  "@sinonjs/fake-timers": "15.4.0",
292
293
  "@std/semver": "npm:@jsr/std__semver@1.0.8",
293
- "@supabase/supabase-js": "^2.110.8",
294
294
  "@tanstack/intent": "^0.3.6",
295
295
  "@types/adm-zip": "^0.5.8",
296
296
  "@types/jsonwebtoken": "^9.0.10",
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Tags every Capgo API call made inside `fn` with `source`. The result is wrapped
3
+ * in `Promise.resolve()` inside `run()` so lazy thenables still start their fetch
4
+ * inside the async context.
5
+ */
6
+ export declare function withApiCallSource<T>(source: string, fn: () => T): Promise<Awaited<T>>;
7
+ export declare function getApiCallSource(): string | undefined;
8
+ export declare function enableApiInstrumentation(): void;
9
+ export declare function isApiInstrumentationEnabled(): boolean;
10
+ export interface ApiCallInfo {
11
+ url: string;
12
+ /** Capgo API route relative to the API host, e.g. `private/cli/preflight`. */
13
+ route?: string;
14
+ method: string;
15
+ status: number;
16
+ ok: boolean;
17
+ durationMs: number;
18
+ source?: string;
19
+ apikey?: string;
20
+ error?: unknown;
21
+ }
22
+ export type ApiCallRecorder = (info: ApiCallInfo) => void;
23
+ export declare function setApiCallRecorder(fn: ApiCallRecorder): void;
24
+ /** An API call slower than this is flagged `slow` regardless of status. */
25
+ export declare const SLOW_THRESHOLD_MS = 5000;
26
+ /**
27
+ * Turns a Capgo API route into a low-cardinality operation label. Query strings
28
+ * are discarded and only leading static segments are kept, so ids (app ids, etc.)
29
+ * never become labels: `private/cli/preflight` => `POST private/cli/preflight`.
30
+ */
31
+ export declare function deriveApiOperation(route: string, method: string): string;
32
+ /**
33
+ * A `fetch` wrapper for Capgo API calls. Times the real request (which runs
34
+ * regardless), captures the active source label, and hands the result to the
35
+ * injected recorder. Returns the real Response / rethrows the real error so the
36
+ * caller's behavior is never altered. Calls `globalThis.fetch` dynamically (not
37
+ * a captured ref) so it is testable and never self-recurses.
38
+ */
39
+ export declare function createTimedFetch(route?: string): typeof fetch;
@@ -5,7 +5,7 @@ export type CliErrorCategory = 'network_error' | 'timeout' | 'unauthorized' | 'f
5
5
  */
6
6
  export declare function categorizeCliError(error: unknown): CliErrorCategory;
7
7
  /**
8
- * Maps a non-2xx HTTP status to the same closed enum, for Supabase responses
8
+ * Maps a non-2xx HTTP status to the same closed enum, for API responses
9
9
  * where we have a status code but no thrown Error. Never leaks response bodies.
10
10
  */
11
11
  export declare function categorizeHttpStatus(status: number): CliErrorCategory;
@@ -1,15 +1,11 @@
1
- import { createSupabaseClient } from '../utils';
2
1
  export interface OrgResolverDeps {
3
- /** @deprecated Prefer fetchOwnerOrg; kept for existing unit tests. */
4
- createClient?: typeof createSupabaseClient;
5
2
  /** Injectable for tests; defaults to GET app via invokeCapgoCliApi. */
6
3
  fetchOwnerOrg?: (apikey: string, appId: string, signal?: AbortSignal) => Promise<string | undefined>;
7
- supaHost?: string;
8
- supaAnon?: string;
4
+ apiHost?: string;
9
5
  }
10
6
  /**
11
7
  * Resolves an app's owner organization id (`apps.owner_org`), promise-cached
12
- * per `(supaHost, apikey, appId)`. Returns undefined on any error — never throws.
8
+ * per `(apiHost, apikey, appId)`. Returns undefined on any error; never throws.
13
9
  * Extracted so the analytics layer and onboarding analytics share one path.
14
10
  */
15
11
  export declare function resolveOwnerOrgId(apikey: string, appId: string, deps?: OrgResolverDeps, signal?: AbortSignal): Promise<string | undefined>;
@@ -1,4 +1,3 @@
1
- import { withSupabaseSource } from './supabase-perf';
2
1
  export { getGlobalAnalyticsProps, getInvocationSource, setInvocationSource } from './global-props';
3
2
  export declare function isTelemetryDisabled(): boolean;
4
3
  export declare function flushAnalytics(timeoutMs?: number): Promise<void>;
@@ -57,5 +56,4 @@ type AnyAsyncFn = (...args: any[]) => Promise<any>;
57
56
  */
58
57
  export declare function withMcpToolTracking<H extends AnyAsyncFn>(toolName: string, handler: H): H;
59
58
  export declare function trackMcpServerStarted(hasApikey: boolean): void;
60
- export { withSupabaseSource };
61
- export { enableSupabaseInstrumentation } from './supabase-perf';
59
+ export { enableApiInstrumentation } from './api-perf';
@@ -1,22 +1,18 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { Database } from '../types/supabase.types';
1
+ import type { CapgoClient } from '../utils';
2
+ import type { AppRow } from '../types/api';
3
3
  export declare function checkAppExists(apikey: string, appid: string, options?: {
4
- supaHost?: string;
5
- supaAnon?: string;
4
+ apiHost?: string;
6
5
  }, silent?: boolean): Promise<boolean>;
7
- export type PendingOnboardingApp = Pick<Database['public']['Tables']['apps']['Row'], 'app_id' | 'name' | 'icon_url' | 'need_onboarding' | 'existing_app' | 'ios_store_url' | 'android_store_url'>;
8
- export type ExistingOrganizationApp = Pick<Database['public']['Tables']['apps']['Row'], 'app_id' | 'name' | 'owner_org' | 'need_onboarding'>;
6
+ export type PendingOnboardingApp = Pick<AppRow, 'app_id' | 'name' | 'icon_url' | 'need_onboarding' | 'existing_app' | 'ios_store_url' | 'android_store_url'>;
7
+ export type ExistingOrganizationApp = Pick<AppRow, 'app_id' | 'name' | 'owner_org' | 'need_onboarding'>;
9
8
  export declare function listPendingOnboardingApps(apikey: string, orgId: string, options?: {
10
- supaHost?: string;
11
- supaAnon?: string;
9
+ apiHost?: string;
12
10
  }): Promise<PendingOnboardingApp[]>;
13
11
  export declare function findAppInOrganization(apikey: string, orgId: string, appId: string, options?: {
14
- supaHost?: string;
15
- supaAnon?: string;
12
+ apiHost?: string;
16
13
  }): Promise<ExistingOrganizationApp | null>;
17
- export declare function completePendingOnboardingApp(_supabase: SupabaseClient<Database>, orgId: string, appId: string, apikey: string, options?: {
18
- supaHost?: string;
19
- supaAnon?: string;
14
+ export declare function completePendingOnboardingApp(_client: CapgoClient, orgId: string, appId: string, apikey: string, options?: {
15
+ apiHost?: string;
20
16
  }): Promise<void>;
21
17
  export interface AppOnboardingProgressPatch {
22
18
  source?: 'manual' | 'cli' | 'mcp' | 'ai';
@@ -27,22 +23,38 @@ export interface AppOnboardingProgressPatch {
27
23
  }>;
28
24
  }
29
25
  export declare function reportAppOnboardingProgress(apikey: string, appId: string, onboarding: AppOnboardingProgressPatch, options?: {
30
- supaHost?: string;
31
- supaAnon?: string;
26
+ apiHost?: string;
32
27
  }): Promise<void>;
33
28
  /**
34
29
  * Check multiple app IDs at once for batch validation (e.g., for suggestions)
35
30
  */
36
31
  export declare function checkAppIdsExist(apikey: string, appids: string[], options?: {
37
- supaHost?: string;
38
- supaAnon?: string;
32
+ apiHost?: string;
39
33
  }): Promise<{
40
34
  appid: string;
41
35
  exists: boolean;
42
36
  }[]>;
43
- export declare function check2FAComplianceForApp(supabase: SupabaseClient<Database>, appid: string, silent?: boolean): Promise<void>;
44
- export declare function checkAppExistsAndHasPermissionOrgErr(supabase: SupabaseClient<Database>, apikey: string, appid: string, requiredPermissionKey: string, silent?: boolean, skip2FACheck?: boolean, channelId?: number | null): Promise<boolean>;
37
+ /** Fail unless the org 2FA policy lets this key act on the app. */
38
+ export declare function check2FAComplianceForApp(client: CapgoClient, appid: string, silent?: boolean): Promise<void>;
39
+ /**
40
+ * Fail unless the app exists for this key and the key holds `requiredPermissionKey`
41
+ * (2FA policy included unless `skip2FACheck`). One backend preflight call.
42
+ */
43
+ export declare function checkAppExistsAndHasPermissionOrgErr(client: CapgoClient, _apikey: string, appid: string, requiredPermissionKey: string, silent?: boolean, skip2FACheck?: boolean, channelId?: number | null): Promise<boolean>;
45
44
  export type { AppOptions as Options } from '../schemas/app';
46
45
  export declare const newIconPath = "assets/icon.png";
47
46
  export declare function resolveAppSetIconPath(explicitIcon?: string): string | undefined;
48
47
  export declare function getAppIconStoragePath(organizationUid: string, appId: string): string;
48
+ export interface UploadAppIconResult {
49
+ path?: string;
50
+ conflict?: boolean;
51
+ error?: Error | null;
52
+ }
53
+ export declare function uploadAppIconHttp(apikey: string, params: {
54
+ appId: string;
55
+ orgId: string;
56
+ contentBase64: string;
57
+ contentType: string;
58
+ upsert?: boolean;
59
+ apiHost?: string;
60
+ }): Promise<UploadAppIconResult>;
@@ -1,21 +1,20 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
- import type { Database } from '../types/supabase.types';
1
+ import type { CapgoClient } from '../utils';
2
+ import type { AppVersionRow } from '../types/api';
3
+ import type { NativePackage } from '../schemas/common';
3
4
  interface CheckVersionOptions {
4
5
  silent?: boolean;
5
6
  autoUnlink?: boolean;
6
7
  channelName?: string;
7
8
  requireMatch?: boolean;
8
9
  apikey?: string;
9
- supaHost?: string;
10
- supaAnon?: string;
10
+ apiHost?: string;
11
11
  }
12
12
  interface CapgoHttpOptions {
13
13
  apikey: string;
14
14
  silent?: boolean;
15
- supaHost?: string;
16
- supaAnon?: string;
15
+ apiHost?: string;
17
16
  }
18
- export declare function checkVersionNotUsedInChannel(supabase: SupabaseClient<Database>, appid: string, versionData: Database['public']['Tables']['app_versions']['Row'], options?: CheckVersionOptions): Promise<void>;
17
+ export declare function checkVersionNotUsedInChannel(client: CapgoClient, appid: string, versionData: AppVersionRow, options?: CheckVersionOptions): Promise<void>;
19
18
  export declare function createChannel(options: CapgoHttpOptions, update: {
20
19
  app_id: string;
21
20
  channel: string;
@@ -31,62 +30,36 @@ export declare function delChannel(options: CapgoHttpOptions, name: string, appI
31
30
  data: any;
32
31
  error: Error | null;
33
32
  }>;
34
- export declare function findChannel(supabase: SupabaseClient<Database>, appId: string, name: string): import("@supabase/supabase-js").PostgrestBuilder<{
35
- PostgrestVersion: "14.5";
36
- }, {
37
- allow_dev: boolean;
38
- allow_device: boolean;
39
- allow_device_self_set: boolean;
40
- allow_emulator: boolean;
41
- allow_prod: boolean;
42
- android: boolean;
43
- app_id: string;
44
- created_at: string;
45
- created_by: string;
46
- disable_auto_update: Database["public"]["Enums"]["disable_update"];
47
- disable_auto_update_under_native: boolean;
48
- electron: boolean;
49
- id: number;
50
- ios: boolean;
51
- name: string;
52
- owner_org: string;
53
- paused_at: string | null;
54
- public: boolean;
55
- auto_pause_action: string;
56
- auto_pause_confidence: number;
57
- auto_pause_cooldown_minutes: number;
58
- auto_pause_enabled: boolean;
59
- auto_pause_failure_rate_bps: number | null;
60
- auto_pause_last_checked_at: string | null;
61
- auto_pause_last_triggered_at: string | null;
62
- auto_pause_min_attempts: number | null;
63
- auto_pause_min_failures: number | null;
64
- auto_pause_window_minutes: number;
65
- rollout_cache_ttl_seconds: number;
66
- rollout_enabled: boolean;
67
- rollout_id: string;
68
- rollout_pause_reason: string | null;
69
- rollout_paused_at: string | null;
70
- rollout_percentage_bps: number;
71
- rollout_version: number | null;
72
- rbac_id: string;
73
- update_package: Database["public"]["Enums"]["channel_update_package"];
74
- updated_at: string;
75
- version: number | null;
76
- }, false>;
33
+ export declare function findChannel(client: CapgoClient, appId: string, name: string): Promise<{
34
+ data: import("./cli-data").CliChannelRow | null;
35
+ error: null;
36
+ } | {
37
+ data: null;
38
+ error: Error;
39
+ }>;
77
40
  export interface ChannelLinkedVersion {
78
41
  id: number;
79
42
  name: string;
80
43
  }
81
- export declare function findVersionsLinkedToChannel(supabase: SupabaseClient<Database>, appId: string, name: string): Promise<{
44
+ export declare function findVersionsLinkedToChannel(client: CapgoClient, appId: string, name: string): Promise<{
82
45
  stable: ChannelLinkedVersion | null;
83
46
  rollout: ChannelLinkedVersion | null;
84
47
  }>;
85
- export declare function isVersionLinkedToOtherChannel(supabase: SupabaseClient<Database>, appId: string, versionId: number, excludeChannelName: string): Promise<boolean>;
48
+ export declare function isVersionLinkedToOtherChannel(client: CapgoClient, appId: string, versionId: number, excludeChannelName: string): Promise<boolean>;
86
49
  export type { Channel } from '../schemas/channel';
87
50
  type Channel = import('../schemas/channel').Channel;
88
51
  export declare function formatChannels(data: Channel[], columns?: number): string;
89
52
  export declare function displayChannels(data: Channel[], silent?: boolean): void;
53
+ export interface ChannelCompatibilityContext {
54
+ disable_auto_update: string;
55
+ version: {
56
+ id: number;
57
+ name: string;
58
+ min_update_version: string | null;
59
+ native_packages: NativePackage[];
60
+ } | null;
61
+ }
62
+ export declare function fetchChannelCompatibilityContext(options: CapgoHttpOptions, appId: string, channel: string): Promise<ChannelCompatibilityContext | null>;
90
63
  export declare function getActiveChannels(options: CapgoHttpOptions, appid: string): Promise<{
91
64
  id: number;
92
65
  name: string;
@@ -0,0 +1,27 @@
1
+ import type { ChannelRow } from '../types/api';
2
+ import type { CapgoApiTarget } from '../utils';
3
+ export interface CliLinkedVersion {
4
+ id: number;
5
+ name: string;
6
+ deleted: boolean;
7
+ }
8
+ export type CliChannelRow = ChannelRow & {
9
+ version_info: CliLinkedVersion | null;
10
+ rollout_version_info: CliLinkedVersion | null;
11
+ };
12
+ export declare function fetchCliChannels(client: CapgoApiTarget, appId: string, name?: string, filters?: {
13
+ linkedVersionId?: number;
14
+ }): Promise<CliChannelRow[]>;
15
+ export declare function fetchLatestBundle(client: CapgoApiTarget, appId: string): Promise<{
16
+ id: number;
17
+ name: string;
18
+ } | null>;
19
+ export declare function setBundlesDeleted(client: CapgoApiTarget, appId: string, names: string[], deleted: boolean): Promise<string[]>;
20
+ export declare function fetchBundleManifest(client: CapgoApiTarget, appVersionId: number): Promise<{
21
+ file_name: string | null;
22
+ file_hash: string | null;
23
+ }[]>;
24
+ export declare function isAppVisible(client: CapgoApiTarget, appId: string): Promise<boolean>;
25
+ export declare function createOrganization(client: CapgoApiTarget, name: string, managementEmail: string): Promise<{
26
+ id: string;
27
+ }>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Non-2xx response from the Capgo HTTP API.
3
+ * The upstream Response stays on `.context` so callers can read the JSON error payload.
4
+ */
5
+ export declare class CapgoApiHttpError extends Error {
6
+ readonly context: Response;
7
+ readonly status: number;
8
+ constructor(response: Response);
9
+ }
@@ -0,0 +1,53 @@
1
+ import type { CapgoClient } from '../utils';
2
+ /** What a command needs checked before it acts. The backend owns every rule. */
3
+ export interface CliPreflightRequest {
4
+ appId?: string;
5
+ orgId?: string;
6
+ channelId?: number | null;
7
+ /** RBAC permission the command needs, scoped to channel, app or org. */
8
+ permission?: string;
9
+ /** Enforce the org 2FA policy (default true). */
10
+ check2fa?: boolean;
11
+ /** Metered plan gate: `all` for usage commands, `upload` for storage-only. */
12
+ plan?: 'all' | 'upload';
13
+ /** Show org CLI warnings targeted at this CLI version. */
14
+ cliVersion?: string;
15
+ }
16
+ export interface CliPreflightResult {
17
+ userId: string | null;
18
+ orgId: string | null;
19
+ appId: string | null;
20
+ trialDaysLeft: number | null;
21
+ warnings: Array<{
22
+ message: string;
23
+ fatal: boolean;
24
+ }>;
25
+ }
26
+ export interface CliPreflightOptions {
27
+ silent?: boolean;
28
+ /** Print the unpaid-trial reminder (default true). */
29
+ warnTrial?: boolean;
30
+ /** Message for `app_not_found`; defaults to the `app add` hint. */
31
+ appNotFoundMessage?: string;
32
+ /** Logged message for `permission_denied`; defaults to the missing permission key. */
33
+ permissionDeniedMessage?: string;
34
+ /** Thrown error message for `permission_denied` (stable for telemetry); defaults to the logged one. */
35
+ permissionDeniedErrorMessage?: string;
36
+ /** Organization name for the 2FA denial banner. */
37
+ organizationName?: string;
38
+ telemetryFunctionName?: string;
39
+ }
40
+ /**
41
+ * One backend call before a command acts: 2FA policy, app visibility, RBAC
42
+ * permission, metered plan and org CLI warnings. Denials are rendered and thrown;
43
+ * the result carries what the command needs next. Returns null only when Capgo is
44
+ * unreachable after retries and 2FA was requested: the command continues and the
45
+ * backend still enforces every rule on the real action.
46
+ */
47
+ export declare function runCliPreflight(client: CapgoClient, request: CliPreflightRequest, options?: CliPreflightOptions): Promise<CliPreflightResult | null>;
48
+ /** Fail unless the org's 2FA policy lets this key act on it. */
49
+ export declare function check2FAAccessForOrg(client: CapgoClient, orgId: string, silent?: boolean): Promise<void>;
50
+ /** Fail unless the org plan allows usage (all metered actions); warns on unpaid trials. */
51
+ export declare function checkPlanValid(client: CapgoClient, orgId: string, appId?: string, warning?: boolean): Promise<void>;
52
+ /** Fail unless the org plan allows storage; warns on unpaid trials. */
53
+ export declare function checkPlanValidUpload(client: CapgoClient, orgId: string, appId?: string, warning?: boolean): Promise<void>;
@@ -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 {};