@capgo/cli
Version:
A CLI to upload to capgo servers
1,376 lines • 132 kB
TypeScript
import type { InstallCommand, PackageManagerRunner, PackageManagerType } from '@capgo/find-package-manager';
import type { SemVer } from '@std/semver';
import type { SupabaseClient } from '@supabase/supabase-js';
import type { Buffer } from 'node:buffer';
import type { CapacitorConfig, ExtConfigPairs } from './config';
import type { Compatibility, CompatibilityDetails, NativePackage } from './schemas/common';
import type { Database } from './types/supabase.types';
import { spinner as spinnerC } from '@clack/prompts';
export declare const baseKey = ".capgo_key";
export declare const baseKeyV2 = ".capgo_key_v2";
export declare const baseKeyPub = ".capgo_key.pub";
export declare const baseKeyPubV2 = ".capgo_key_v2.pub";
export declare const defaultHost = "https://capgo.app";
export declare const defaultFileHost = "https://files.capgo.app";
export declare const defaultApiHost = "https://api.capgo.app";
export declare const defaultHostWeb = "https://console.capgo.app";
export declare const UPLOAD_TIMEOUT = 120000;
export declare const ALERT_UPLOAD_SIZE_BYTES: number;
export declare const MAX_UPLOAD_LENGTH_BYTES: number;
export declare const MAX_CHUNK_SIZE_BYTES: number;
export declare const PACKNAME = "package.json";
export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
export type Organization = ArrayElement<Database['public']['Functions']['get_orgs_v7']['Returns']>;
export declare const regexSemver: RegExp;
/**
* Format an error for display. If it's a security policy error,
* returns a human-readable message with actionable steps.
*/
export declare function formatError(error: any): string;
export declare function check2FAAccessForOrg(supabase: SupabaseClient<Database>, orgId: string, silent?: boolean): Promise<void>;
type TagKey = Lowercase<string>;
/** Tag Type */
type Tags = Record<TagKey, string | number | boolean>;
type Parser = 'markdown' | 'text';
/**
* Options for publishing LogSnag events
*/
interface TrackOptions {
/**
* Channel name
* example: "waitlist"
*/
channel: string;
/**
* Event name
* example: "User Joined"
*/
event: string;
/**
* Event description
* example: "joe@example.com joined waitlist"
*/
description?: string;
/**
* User ID
* example: "user-123"
*/
user_id?: string;
/**
* Event icon (emoji)
* must be a single emoji
* example: "🎉"
*/
icon?: string;
/**
* Event tags
* example: { username: "mattie" }
*/
tags?: Tags;
/**
* Send push notification
*/
notify?: boolean;
/**
* Parser for description
*/
parser?: Parser;
/**
* Event timestamp
*/
timestamp?: number | Date;
}
export type { OptionsBase } from './schemas/base';
export declare function wait(ms: number): Promise<unknown>;
interface PromptInteractivityOptions {
silent?: boolean;
stdinIsTTY?: boolean;
stdoutIsTTY?: boolean;
ci?: boolean;
}
export declare function canPromptInteractively({ silent, stdinIsTTY, stdoutIsTTY, ci, }?: PromptInteractivityOptions): boolean;
export declare function projectIsMonorepo(dir: string): boolean;
export declare function findRoot(dir: string): string;
export declare function getPackageScripts(f?: string, file?: string | undefined): Record<string, string>;
export declare function getBundleVersion(f?: string, file?: string | undefined): string;
/**
* Get the actual installed version of a package from node_modules (not from package.json)
* Uses multiple resolution strategies to find the installed version:
* 1. require.resolve - Works with all package managers
* 2. Walk up node_modules - Handles hoisted dependencies in monorepos
* 3. Native config files (iOS/Android) - For @capgo/capacitor-updater only
* 4. Fallback to declared version in package.json
*
* @param packageName - The package name to check
* @param rootDir - The root directory of the project
* @param packageJsonPath - Optional custom package.json path provided by user (takes priority if provided)
*/
export declare function getInstalledVersion(packageName: string, rootDir?: string, packageJsonPath?: string): Promise<string | null>;
export declare function getAllPackagesDependencies(f?: string, file?: string | undefined): Promise<Map<string, string>>;
export declare function getConfig(): Promise<{
config: {
[x: string]: unknown;
appId: string;
appName: string;
webDir: string;
plugins?: Record<string, any> | undefined;
android?: Record<string, any> | undefined;
};
path: string;
}>;
export declare function updateConfigbyKey(key: string, newConfig: any): Promise<ExtConfigPairs>;
export declare function updateConfigUpdater(newConfig: any): Promise<ExtConfigPairs>;
export declare function getLocalConfig(): Promise<CapgoConfig>;
interface CapgoConfig {
supaHost?: string;
supaKey?: string;
host: string;
hostWeb: string;
hostFilesApi: string;
hostApi: string;
}
export declare function getRemoteConfig(): Promise<CapgoConfig>;
interface CapgoFilesConfig {
partialUpload: boolean;
partialUploadForced: boolean;
TUSUpload: boolean;
TUSUploadForced: boolean;
maxUploadLength: number;
maxChunkSize: number;
alertUploadSize: number;
}
export declare function getRemoteFileConfig(): Promise<CapgoFilesConfig>;
export declare function createSupabaseClient(apikey: string, supaHost?: string, supaKey?: string): Promise<SupabaseClient<Database, "public", "public", {
Tables: {
apikeys: {
Row: {
created_at: string | null;
expires_at: string | null;
id: number;
key: string | null;
key_hash: string | null;
limited_to_apps: string[] | null;
limited_to_orgs: string[] | null;
mode: Database["public"]["Enums"]["key_mode"];
name: string;
updated_at: string | null;
user_id: string;
};
Insert: {
created_at?: string | null;
expires_at?: string | null;
id?: number;
key?: string | null;
key_hash?: string | null;
limited_to_apps?: string[] | null;
limited_to_orgs?: string[] | null;
mode: Database["public"]["Enums"]["key_mode"];
name: string;
updated_at?: string | null;
user_id: string;
};
Update: {
created_at?: string | null;
expires_at?: string | null;
id?: number;
key?: string | null;
key_hash?: string | null;
limited_to_apps?: string[] | null;
limited_to_orgs?: string[] | null;
mode?: Database["public"]["Enums"]["key_mode"];
name?: string;
updated_at?: string | null;
user_id?: string;
};
Relationships: [{
foreignKeyName: "apikeys_user_id_fkey";
columns: ["user_id"];
isOneToOne: false;
referencedRelation: "users";
referencedColumns: ["id"];
}];
};
app_metrics_cache: {
Row: {
cached_at: string;
end_date: string;
id: number;
org_id: string;
response: import("./types/supabase.types").Json;
start_date: string;
};
Insert: {
cached_at?: string;
end_date: string;
id?: number;
org_id: string;
response: import("./types/supabase.types").Json;
start_date: string;
};
Update: {
cached_at?: string;
end_date?: string;
id?: number;
org_id?: string;
response?: import("./types/supabase.types").Json;
start_date?: string;
};
Relationships: [{
foreignKeyName: "app_metrics_cache_org_id_fkey";
columns: ["org_id"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
app_versions: {
Row: {
app_id: string;
checksum: string | null;
cli_version: string | null;
comment: string | null;
created_at: string | null;
deleted: boolean;
external_url: string | null;
id: number;
key_id: string | null;
link: string | null;
manifest: Database["public"]["CompositeTypes"]["manifest_entry"][] | null;
manifest_count: number;
min_update_version: string | null;
name: string;
native_packages: import("./types/supabase.types").Json[] | null;
owner_org: string;
r2_path: string | null;
session_key: string | null;
storage_provider: string;
updated_at: string | null;
user_id: string | null;
};
Insert: {
app_id: string;
checksum?: string | null;
cli_version?: string | null;
comment?: string | null;
created_at?: string | null;
deleted?: boolean;
external_url?: string | null;
id?: number;
key_id?: string | null;
link?: string | null;
manifest?: Database["public"]["CompositeTypes"]["manifest_entry"][] | null;
manifest_count?: number;
min_update_version?: string | null;
name: string;
native_packages?: import("./types/supabase.types").Json[] | null;
owner_org: string;
r2_path?: string | null;
session_key?: string | null;
storage_provider?: string;
updated_at?: string | null;
user_id?: string | null;
};
Update: {
app_id?: string;
checksum?: string | null;
cli_version?: string | null;
comment?: string | null;
created_at?: string | null;
deleted?: boolean;
external_url?: string | null;
id?: number;
key_id?: string | null;
link?: string | null;
manifest?: Database["public"]["CompositeTypes"]["manifest_entry"][] | null;
manifest_count?: number;
min_update_version?: string | null;
name?: string;
native_packages?: import("./types/supabase.types").Json[] | null;
owner_org?: string;
r2_path?: string | null;
session_key?: string | null;
storage_provider?: string;
updated_at?: string | null;
user_id?: string | null;
};
Relationships: [{
foreignKeyName: "app_versions_app_id_fkey";
columns: ["app_id"];
isOneToOne: false;
referencedRelation: "apps";
referencedColumns: ["app_id"];
}, {
foreignKeyName: "owner_org_id_fkey";
columns: ["owner_org"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
app_versions_meta: {
Row: {
app_id: string;
checksum: string;
created_at: string | null;
id: number;
owner_org: string;
size: number;
updated_at: string | null;
};
Insert: {
app_id: string;
checksum: string;
created_at?: string | null;
id?: number;
owner_org: string;
size: number;
updated_at?: string | null;
};
Update: {
app_id?: string;
checksum?: string;
created_at?: string | null;
id?: number;
owner_org?: string;
size?: number;
updated_at?: string | null;
};
Relationships: [{
foreignKeyName: "app_versions_meta_app_id_fkey";
columns: ["app_id"];
isOneToOne: false;
referencedRelation: "apps";
referencedColumns: ["app_id"];
}, {
foreignKeyName: "app_versions_meta_id_fkey";
columns: ["id"];
isOneToOne: true;
referencedRelation: "app_versions";
referencedColumns: ["id"];
}, {
foreignKeyName: "owner_org_id_fkey";
columns: ["owner_org"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
apps: {
Row: {
android_store_url: string | null;
app_id: string;
channel_device_count: number;
created_at: string | null;
default_upload_channel: string;
existing_app: boolean;
expose_metadata: boolean;
icon_url: string;
id: string | null;
ios_store_url: string | null;
last_version: string | null;
manifest_bundle_count: number;
need_onboarding: boolean;
name: string | null;
owner_org: string;
retention: number;
transfer_history: import("./types/supabase.types").Json[] | null;
updated_at: string | null;
user_id: string | null;
};
Insert: {
android_store_url?: string | null;
app_id: string;
channel_device_count?: number;
created_at?: string | null;
default_upload_channel?: string;
existing_app?: boolean;
expose_metadata?: boolean;
icon_url: string;
id?: string | null;
ios_store_url?: string | null;
last_version?: string | null;
manifest_bundle_count?: number;
need_onboarding?: boolean;
name?: string | null;
owner_org: string;
retention?: number;
transfer_history?: import("./types/supabase.types").Json[] | null;
updated_at?: string | null;
user_id?: string | null;
};
Update: {
android_store_url?: string | null;
app_id?: string;
channel_device_count?: number;
created_at?: string | null;
default_upload_channel?: string;
existing_app?: boolean;
expose_metadata?: boolean;
icon_url?: string;
id?: string | null;
ios_store_url?: string | null;
last_version?: string | null;
manifest_bundle_count?: number;
need_onboarding?: boolean;
name?: string | null;
owner_org?: string;
retention?: number;
transfer_history?: import("./types/supabase.types").Json[] | null;
updated_at?: string | null;
user_id?: string | null;
};
Relationships: [{
foreignKeyName: "apps_user_id_fkey";
columns: ["user_id"];
isOneToOne: false;
referencedRelation: "users";
referencedColumns: ["id"];
}, {
foreignKeyName: "owner_org_id_fkey";
columns: ["owner_org"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
audit_logs: {
Row: {
changed_fields: string[] | null;
created_at: string;
id: number;
new_record: import("./types/supabase.types").Json | null;
old_record: import("./types/supabase.types").Json | null;
operation: string;
org_id: string;
record_id: string;
table_name: string;
user_id: string | null;
};
Insert: {
changed_fields?: string[] | null;
created_at?: string;
id?: number;
new_record?: import("./types/supabase.types").Json | null;
old_record?: import("./types/supabase.types").Json | null;
operation: string;
org_id: string;
record_id: string;
table_name: string;
user_id?: string | null;
};
Update: {
changed_fields?: string[] | null;
created_at?: string;
id?: number;
new_record?: import("./types/supabase.types").Json | null;
old_record?: import("./types/supabase.types").Json | null;
operation?: string;
org_id?: string;
record_id?: string;
table_name?: string;
user_id?: string | null;
};
Relationships: [{
foreignKeyName: "audit_logs_org_id_fkey";
columns: ["org_id"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}, {
foreignKeyName: "audit_logs_user_id_fkey";
columns: ["user_id"];
isOneToOne: false;
referencedRelation: "users";
referencedColumns: ["id"];
}];
};
bandwidth_usage: {
Row: {
app_id: string;
device_id: string;
file_size: number;
id: number;
timestamp: string;
};
Insert: {
app_id: string;
device_id: string;
file_size: number;
id?: number;
timestamp?: string;
};
Update: {
app_id?: string;
device_id?: string;
file_size?: number;
id?: number;
timestamp?: string;
};
Relationships: [];
};
build_logs: {
Row: {
billable_seconds: number;
build_id: string;
build_time_unit: number;
created_at: string;
id: string;
org_id: string;
platform: string;
user_id: string | null;
};
Insert: {
billable_seconds: number;
build_id: string;
build_time_unit: number;
created_at?: string;
id?: string;
org_id: string;
platform: string;
user_id?: string | null;
};
Update: {
billable_seconds?: number;
build_id?: string;
build_time_unit?: number;
created_at?: string;
id?: string;
org_id?: string;
platform?: string;
user_id?: string | null;
};
Relationships: [{
foreignKeyName: "build_logs_org_id_fkey";
columns: ["org_id"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
build_requests: {
Row: {
app_id: string;
build_config: import("./types/supabase.types").Json | null;
build_mode: string;
builder_job_id: string | null;
created_at: string;
id: string;
last_error: string | null;
owner_org: string;
platform: string;
requested_by: string;
status: string;
updated_at: string;
upload_expires_at: string;
upload_path: string;
upload_session_key: string;
upload_url: string;
};
Insert: {
app_id: string;
build_config?: import("./types/supabase.types").Json | null;
build_mode?: string;
builder_job_id?: string | null;
created_at?: string;
id?: string;
last_error?: string | null;
owner_org: string;
platform: string;
requested_by: string;
status?: string;
updated_at?: string;
upload_expires_at: string;
upload_path: string;
upload_session_key: string;
upload_url: string;
};
Update: {
app_id?: string;
build_config?: import("./types/supabase.types").Json | null;
build_mode?: string;
builder_job_id?: string | null;
created_at?: string;
id?: string;
last_error?: string | null;
owner_org?: string;
platform?: string;
requested_by?: string;
status?: string;
updated_at?: string;
upload_expires_at?: string;
upload_path?: string;
upload_session_key?: string;
upload_url?: string;
};
Relationships: [{
foreignKeyName: "build_requests_app_id_fkey";
columns: ["app_id"];
isOneToOne: false;
referencedRelation: "apps";
referencedColumns: ["app_id"];
}, {
foreignKeyName: "build_requests_owner_org_fkey";
columns: ["owner_org"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
capgo_credits_steps: {
Row: {
created_at: string;
id: number;
org_id: string | null;
price_per_unit: number;
step_max: number;
step_min: number;
type: string;
unit_factor: number;
updated_at: string;
};
Insert: {
created_at?: string;
id?: number;
org_id?: string | null;
price_per_unit: number;
step_max: number;
step_min: number;
type: string;
unit_factor?: number;
updated_at?: string;
};
Update: {
created_at?: string;
id?: number;
org_id?: string | null;
price_per_unit?: number;
step_max?: number;
step_min?: number;
type?: string;
unit_factor?: number;
updated_at?: string;
};
Relationships: [{
foreignKeyName: "capgo_credits_steps_org_id_fkey";
columns: ["org_id"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
channel_devices: {
Row: {
app_id: string;
channel_id: number;
created_at: string | null;
device_id: string;
id: number;
owner_org: string;
updated_at: string;
};
Insert: {
app_id: string;
channel_id: number;
created_at?: string | null;
device_id: string;
id?: number;
owner_org: string;
updated_at?: string;
};
Update: {
app_id?: string;
channel_id?: number;
created_at?: string | null;
device_id?: string;
id?: number;
owner_org?: string;
updated_at?: string;
};
Relationships: [{
foreignKeyName: "channel_devices_app_id_fkey";
columns: ["app_id"];
isOneToOne: false;
referencedRelation: "apps";
referencedColumns: ["app_id"];
}, {
foreignKeyName: "channel_devices_channel_id_fkey";
columns: ["channel_id"];
isOneToOne: false;
referencedRelation: "channels";
referencedColumns: ["id"];
}, {
foreignKeyName: "owner_org_id_fkey";
columns: ["owner_org"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
channels: {
Row: {
allow_dev: boolean;
allow_device: boolean;
allow_device_self_set: boolean;
allow_emulator: boolean;
allow_prod: boolean;
android: boolean;
app_id: string;
created_at: string;
created_by: string;
disable_auto_update: Database["public"]["Enums"]["disable_update"];
disable_auto_update_under_native: boolean;
id: number;
ios: boolean;
name: string;
owner_org: string;
public: boolean;
updated_at: string;
version: number;
};
Insert: {
allow_dev?: boolean;
allow_device?: boolean;
allow_device_self_set?: boolean;
allow_emulator?: boolean;
allow_prod?: boolean;
android?: boolean;
app_id: string;
created_at?: string;
created_by: string;
disable_auto_update?: Database["public"]["Enums"]["disable_update"];
disable_auto_update_under_native?: boolean;
id?: number;
ios?: boolean;
name: string;
owner_org: string;
public?: boolean;
updated_at?: string;
version: number;
};
Update: {
allow_dev?: boolean;
allow_device?: boolean;
allow_device_self_set?: boolean;
allow_emulator?: boolean;
allow_prod?: boolean;
android?: boolean;
app_id?: string;
created_at?: string;
created_by?: string;
disable_auto_update?: Database["public"]["Enums"]["disable_update"];
disable_auto_update_under_native?: boolean;
id?: number;
ios?: boolean;
name?: string;
owner_org?: string;
public?: boolean;
updated_at?: string;
version?: number;
};
Relationships: [{
foreignKeyName: "channels_app_id_fkey";
columns: ["app_id"];
isOneToOne: false;
referencedRelation: "apps";
referencedColumns: ["app_id"];
}, {
foreignKeyName: "channels_version_fkey";
columns: ["version"];
isOneToOne: false;
referencedRelation: "app_versions";
referencedColumns: ["id"];
}, {
foreignKeyName: "owner_org_id_fkey";
columns: ["owner_org"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
cron_tasks: {
Row: {
batch_size: number | null;
created_at: string;
description: string | null;
enabled: boolean;
hour_interval: number | null;
id: number;
minute_interval: number | null;
name: string;
payload: import("./types/supabase.types").Json | null;
run_at_hour: number | null;
run_at_minute: number | null;
run_at_second: number | null;
run_on_day: number | null;
run_on_dow: number | null;
second_interval: number | null;
target: string;
task_type: Database["public"]["Enums"]["cron_task_type"];
updated_at: string;
};
Insert: {
batch_size?: number | null;
created_at?: string;
description?: string | null;
enabled?: boolean;
hour_interval?: number | null;
id?: number;
minute_interval?: number | null;
name: string;
payload?: import("./types/supabase.types").Json | null;
run_at_hour?: number | null;
run_at_minute?: number | null;
run_at_second?: number | null;
run_on_day?: number | null;
run_on_dow?: number | null;
second_interval?: number | null;
target: string;
task_type?: Database["public"]["Enums"]["cron_task_type"];
updated_at?: string;
};
Update: {
batch_size?: number | null;
created_at?: string;
description?: string | null;
enabled?: boolean;
hour_interval?: number | null;
id?: number;
minute_interval?: number | null;
name?: string;
payload?: import("./types/supabase.types").Json | null;
run_at_hour?: number | null;
run_at_minute?: number | null;
run_at_second?: number | null;
run_on_day?: number | null;
run_on_dow?: number | null;
second_interval?: number | null;
target?: string;
task_type?: Database["public"]["Enums"]["cron_task_type"];
updated_at?: string;
};
Relationships: [];
};
daily_bandwidth: {
Row: {
app_id: string;
bandwidth: number;
date: string;
id: number;
};
Insert: {
app_id: string;
bandwidth: number;
date: string;
id?: number;
};
Update: {
app_id?: string;
bandwidth?: number;
date?: string;
id?: number;
};
Relationships: [];
};
daily_build_time: {
Row: {
app_id: string;
build_count: number;
build_time_unit: number;
date: string;
};
Insert: {
app_id: string;
build_count?: number;
build_time_unit?: number;
date: string;
};
Update: {
app_id?: string;
build_count?: number;
build_time_unit?: number;
date?: string;
};
Relationships: [{
foreignKeyName: "daily_build_time_app_id_fkey";
columns: ["app_id"];
isOneToOne: false;
referencedRelation: "apps";
referencedColumns: ["app_id"];
}];
};
daily_mau: {
Row: {
app_id: string;
date: string;
id: number;
mau: number;
};
Insert: {
app_id: string;
date: string;
id?: number;
mau: number;
};
Update: {
app_id?: string;
date?: string;
id?: number;
mau?: number;
};
Relationships: [];
};
daily_storage: {
Row: {
app_id: string;
date: string;
id: number;
storage: number;
};
Insert: {
app_id: string;
date: string;
id?: number;
storage: number;
};
Update: {
app_id?: string;
date?: string;
id?: number;
storage?: number;
};
Relationships: [];
};
daily_version: {
Row: {
app_id: string;
date: string;
fail: number | null;
get: number | null;
install: number | null;
uninstall: number | null;
version_id: number;
};
Insert: {
app_id: string;
date: string;
fail?: number | null;
get?: number | null;
install?: number | null;
uninstall?: number | null;
version_id: number;
};
Update: {
app_id?: string;
date?: string;
fail?: number | null;
get?: number | null;
install?: number | null;
uninstall?: number | null;
version_id?: number;
};
Relationships: [];
};
deleted_account: {
Row: {
created_at: string | null;
email: string;
id: string;
};
Insert: {
created_at?: string | null;
email?: string;
id?: string;
};
Update: {
created_at?: string | null;
email?: string;
id?: string;
};
Relationships: [];
};
deleted_apps: {
Row: {
app_id: string;
created_at: string | null;
deleted_at: string | null;
id: number;
owner_org: string;
};
Insert: {
app_id: string;
created_at?: string | null;
deleted_at?: string | null;
id?: number;
owner_org: string;
};
Update: {
app_id?: string;
created_at?: string | null;
deleted_at?: string | null;
id?: number;
owner_org?: string;
};
Relationships: [];
};
deploy_history: {
Row: {
app_id: string;
channel_id: number;
created_at: string | null;
created_by: string;
deployed_at: string | null;
id: number;
install_stats_email_sent_at: string | null;
owner_org: string;
updated_at: string | null;
version_id: number;
};
Insert: {
app_id: string;
channel_id: number;
created_at?: string | null;
created_by: string;
deployed_at?: string | null;
id?: number;
install_stats_email_sent_at?: string | null;
owner_org: string;
updated_at?: string | null;
version_id: number;
};
Update: {
app_id?: string;
channel_id?: number;
created_at?: string | null;
created_by?: string;
deployed_at?: string | null;
id?: number;
install_stats_email_sent_at?: string | null;
owner_org?: string;
updated_at?: string | null;
version_id?: number;
};
Relationships: [{
foreignKeyName: "deploy_history_app_id_fkey";
columns: ["app_id"];
isOneToOne: false;
referencedRelation: "apps";
referencedColumns: ["app_id"];
}, {
foreignKeyName: "deploy_history_channel_id_fkey";
columns: ["channel_id"];
isOneToOne: false;
referencedRelation: "channels";
referencedColumns: ["id"];
}, {
foreignKeyName: "deploy_history_created_by_fkey";
columns: ["created_by"];
isOneToOne: false;
referencedRelation: "users";
referencedColumns: ["id"];
}, {
foreignKeyName: "deploy_history_version_id_fkey";
columns: ["version_id"];
isOneToOne: false;
referencedRelation: "app_versions";
referencedColumns: ["id"];
}];
};
device_usage: {
Row: {
app_id: string;
device_id: string;
id: number;
org_id: string;
timestamp: string;
};
Insert: {
app_id: string;
device_id: string;
id?: number;
org_id: string;
timestamp?: string;
};
Update: {
app_id?: string;
device_id?: string;
id?: number;
org_id?: string;
timestamp?: string;
};
Relationships: [];
};
devices: {
Row: {
app_id: string;
custom_id: string;
default_channel: string | null;
device_id: string;
id: number;
is_emulator: boolean | null;
is_prod: boolean | null;
key_id: string | null;
os_version: string | null;
platform: Database["public"]["Enums"]["platform_os"];
plugin_version: string;
updated_at: string;
version: number | null;
version_build: string | null;
version_name: string;
};
Insert: {
app_id: string;
custom_id?: string;
default_channel?: string | null;
device_id: string;
id?: never;
is_emulator?: boolean | null;
is_prod?: boolean | null;
key_id?: string | null;
os_version?: string | null;
platform: Database["public"]["Enums"]["platform_os"];
plugin_version?: string;
updated_at: string;
version?: number | null;
version_build?: string | null;
version_name?: string;
};
Update: {
app_id?: string;
custom_id?: string;
default_channel?: string | null;
device_id?: string;
id?: never;
is_emulator?: boolean | null;
is_prod?: boolean | null;
key_id?: string | null;
os_version?: string | null;
platform?: Database["public"]["Enums"]["platform_os"];
plugin_version?: string;
updated_at?: string;
version?: number | null;
version_build?: string | null;
version_name?: string;
};
Relationships: [];
};
global_stats: {
Row: {
apps: number;
apps_active: number | null;
bundle_storage_gb: number;
canceled_orgs: number;
created_at: string | null;
credits_bought: number;
credits_consumed: number;
date_id: string;
devices_last_month: number | null;
mrr: number;
need_upgrade: number | null;
new_paying_orgs: number;
not_paying: number | null;
onboarded: number | null;
paying: number | null;
paying_monthly: number | null;
paying_yearly: number | null;
plan_enterprise: number | null;
plan_enterprise_monthly: number;
plan_enterprise_yearly: number;
plan_maker: number | null;
plan_maker_monthly: number;
plan_maker_yearly: number;
plan_solo: number | null;
plan_solo_monthly: number;
plan_solo_yearly: number;
plan_team: number | null;
plan_team_monthly: number;
plan_team_yearly: number;
registers_today: number;
revenue_enterprise: number;
revenue_maker: number;
revenue_solo: number;
revenue_team: number;
stars: number;
success_rate: number | null;
total_revenue: number;
trial: number | null;
updates: number;
updates_external: number | null;
updates_last_month: number | null;
users: number | null;
users_active: number | null;
};
Insert: {
apps: number;
apps_active?: number | null;
bundle_storage_gb?: number;
canceled_orgs?: number;
created_at?: string | null;
credits_bought?: number;
credits_consumed?: number;
date_id: string;
devices_last_month?: number | null;
mrr?: number;
need_upgrade?: number | null;
new_paying_orgs?: number;
not_paying?: number | null;
onboarded?: number | null;
paying?: number | null;
paying_monthly?: number | null;
paying_yearly?: number | null;
plan_enterprise?: number | null;
plan_enterprise_monthly?: number;
plan_enterprise_yearly?: number;
plan_maker?: number | null;
plan_maker_monthly?: number;
plan_maker_yearly?: number;
plan_solo?: number | null;
plan_solo_monthly?: number;
plan_solo_yearly?: number;
plan_team?: number | null;
plan_team_monthly?: number;
plan_team_yearly?: number;
registers_today?: number;
revenue_enterprise?: number;
revenue_maker?: number;
revenue_solo?: number;
revenue_team?: number;
stars: number;
success_rate?: number | null;
total_revenue?: number;
trial?: number | null;
updates: number;
updates_external?: number | null;
updates_last_month?: number | null;
users?: number | null;
users_active?: number | null;
};
Update: {
apps?: number;
apps_active?: number | null;
bundle_storage_gb?: number;
canceled_orgs?: number;
created_at?: string | null;
credits_bought?: number;
credits_consumed?: number;
date_id?: string;
devices_last_month?: number | null;
mrr?: number;
need_upgrade?: number | null;
new_paying_orgs?: number;
not_paying?: number | null;
onboarded?: number | null;
paying?: number | null;
paying_monthly?: number | null;
paying_yearly?: number | null;
plan_enterprise?: number | null;
plan_enterprise_monthly?: number;
plan_enterprise_yearly?: number;
plan_maker?: number | null;
plan_maker_monthly?: number;
plan_maker_yearly?: number;
plan_solo?: number | null;
plan_solo_monthly?: number;
plan_solo_yearly?: number;
plan_team?: number | null;
plan_team_monthly?: number;
plan_team_yearly?: number;
registers_today?: number;
revenue_enterprise?: number;
revenue_maker?: number;
revenue_solo?: number;
revenue_team?: number;
stars?: number;
success_rate?: number | null;
total_revenue?: number;
trial?: number | null;
updates?: number;
updates_external?: number | null;
updates_last_month?: number | null;
users?: number | null;
users_active?: number | null;
};
Relationships: [];
};
manifest: {
Row: {
app_version_id: number;
file_hash: string;
file_name: string;
file_size: number | null;
id: number;
s3_path: string;
};
Insert: {
app_version_id: number;
file_hash: string;
file_name: string;
file_size?: number | null;
id?: number;
s3_path: string;
};
Update: {
app_version_id?: number;
file_hash?: string;
file_name?: string;
file_size?: number | null;
id?: number;
s3_path?: string;
};
Relationships: [{
foreignKeyName: "manifest_app_version_id_fkey";
columns: ["app_version_id"];
isOneToOne: false;
referencedRelation: "app_versions";
referencedColumns: ["id"];
}];
};
notifications: {
Row: {
created_at: string | null;
event: string;
last_send_at: string;
owner_org: string;
total_send: number;
uniq_id: string;
updated_at: string | null;
};
Insert: {
created_at?: string | null;
event: string;
last_send_at?: string;
owner_org: string;
total_send?: number;
uniq_id: string;
updated_at?: string | null;
};
Update: {
created_at?: string | null;
event?: string;
last_send_at?: string;
owner_org?: string;
total_send?: number;
uniq_id?: string;
updated_at?: string | null;
};
Relationships: [{
foreignKeyName: "owner_org_id_fkey";
columns: ["owner_org"];
isOneToOne: false;
referencedRelation: "orgs";
referencedColumns: ["id"];
}];
};
org_users: {
Row: {
app_id: string | null;
channel_id: number | null;
created_at: string | null;
id: number;
org_id: string;
updated_at: string | null;
user_id: string;
user_right: Database["public"]["Enums"]["user_min_right"] | null;
};
Insert: {
app_id?: string | null;
ch