@capgo/cli
Version:
A CLI to upload to capgo servers
105 lines (104 loc) • 3.68 kB
TypeScript
import type { SupabaseClient } from '@supabase/supabase-js';
import type { Database } from '../types/supabase.types';
interface CheckVersionOptions {
silent?: boolean;
autoUnlink?: boolean;
channelName?: string;
requireMatch?: boolean;
apikey?: string;
supaHost?: string;
supaAnon?: string;
}
interface CapgoHttpOptions {
apikey: string;
silent?: boolean;
supaHost?: string;
supaAnon?: string;
}
export declare function checkVersionNotUsedInChannel(supabase: SupabaseClient<Database>, appid: string, versionData: Database['public']['Tables']['app_versions']['Row'], options?: CheckVersionOptions): Promise<void>;
export declare function createChannel(options: CapgoHttpOptions, update: {
app_id: string;
channel: string;
version?: string | null;
public?: boolean;
allow_device_self_set?: boolean;
[key: string]: unknown;
}): Promise<{
data: any;
error: Error | null;
}>;
export declare function delChannel(options: CapgoHttpOptions, name: string, appId: string, deleteBundle?: boolean): Promise<{
data: any;
error: Error | null;
}>;
export declare function findChannel(supabase: SupabaseClient<Database>, appId: string, name: string): import("@supabase/supabase-js").PostgrestBuilder<{
PostgrestVersion: "14.5";
}, {
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;
electron: boolean;
id: number;
ios: boolean;
name: string;
owner_org: string;
public: boolean;
auto_pause_action: string;
auto_pause_confidence: number;
auto_pause_cooldown_minutes: number;
auto_pause_enabled: boolean;
auto_pause_failure_rate_bps: number | null;
auto_pause_last_checked_at: string | null;
auto_pause_last_triggered_at: string | null;
auto_pause_min_attempts: number | null;
auto_pause_min_failures: number | null;
auto_pause_window_minutes: number;
rollout_cache_ttl_seconds: number;
rollout_enabled: boolean;
rollout_id: string;
rollout_pause_reason: string | null;
rollout_paused_at: string | null;
rollout_percentage_bps: number;
rollout_version: number | null;
rbac_id: string;
updated_at: string;
version: number | null;
}, false>;
export type ChannelLinkedVersion = {
id: number;
name: string;
};
export declare function findVersionsLinkedToChannel(supabase: SupabaseClient<Database>, appId: string, name: string): Promise<{
stable: ChannelLinkedVersion | null;
rollout: ChannelLinkedVersion | null;
}>;
export declare function isVersionLinkedToOtherChannel(supabase: SupabaseClient<Database>, appId: string, versionId: number, excludeChannelName: string): Promise<boolean>;
export type { Channel } from '../schemas/channel';
type Channel = import('../schemas/channel').Channel;
export declare function displayChannels(data: Channel[], silent?: boolean): void;
export declare function getActiveChannels(options: CapgoHttpOptions, appid: string): Promise<{
id: number;
name: string;
public: boolean;
ios: boolean;
android: boolean;
disable_auto_update: string;
disable_auto_update_under_native: boolean;
allow_device_self_set: boolean;
allow_emulator: boolean;
allow_device: boolean;
allow_dev: boolean;
allow_prod: boolean;
version?: {
[x: string]: unknown;
name?: string | undefined;
} | undefined;
}[]>;