UNPKG

@cdwr/fly-node

Version:

The flyctl node wrapper for programmatic deployments to fly.io.

109 lines (108 loc) 3.69 kB
import type { CreateAppResponse, ListAppResponse, ListCertForAllResponse, ListCertForAppResponse, ListPostgresResponse, ListPostgresUsersResponse, ListSecretForAllResponse, ListSecretForAppResponse, StatusResponse } from './types'; /** * Mock definitions for the tests which are used in the mock rules and data. */ export declare const mockDefs: { /** Test api token */ token: string; /** Test organization used for all apps and configs */ org: string; /** Test app is deployed and attached to postgres */ testApp: string; /** Test config is available and the app is deployed with it */ testConfig: string; /** New app does not exist to begin with but will be created and deployed */ newApp: string; newConfig: string; /** New app with a generated name */ generatedAppName: string; /** Postgres cluster attached to test app */ postgresAttached: string; /** Postgres cluster never attached to any app */ postgresNotAttached: string; /** Unknown app that does not exist and will never be found */ unknownApp: string; /** Unknown config that does not exist */ unknownConfig: string; /** Test secret that exists in the app */ testSecret: string; }; /** * Mock `fly apps list` response for testing. */ export declare const mockAppsListResponse: ListAppResponse; /** * Mock `fly apps create` response for testing. * * @param app - The app name to use in the response (defaults to `mockDefs.testApp`) */ export declare const mockCreateAppResponse: (app?: string) => CreateAppResponse; /** * Mock `fly certs list` response for testing. */ export declare const mockListCertForAppResponse: ListCertForAppResponse; /** * Mock `fly certs list` response for all apps for testing. * * All apps from `mockAppsListResponse` gets the same certificates from `mockListCertForAppResponse` */ export declare const mockListCertForAllResponse: ListCertForAllResponse; /** * Mock `fly postgres list` response for testing. * * TODO: Mock the string response when there are no Postgres clusters. */ export declare const mockListPostgresResponse: ListPostgresResponse; /** * Mock `fly postgres users list` response for testing. */ export declare const mockListPostgresUsersResponse: ListPostgresUsersResponse; /** * Mock `fly secrets list` response for testing. */ export declare const mockListSecretForAppResponse: ListSecretForAppResponse; /** * Mock `fly secrets list` response for all apps for testing. * * All apps from `mockAppsListResponse` gets the same secrets from `mockListSecretForAppResponse` */ export declare const mockListSecretForAllResponse: ListSecretForAllResponse; /** * Mock `fly config show` response for testing. * * @param app - The app name to use in the response (defaults to `mockDefs.testApp`) */ export declare const mockShowConfigResponse: (app?: string) => { app: string; primaryRegion: string; build: { dockerfile: string; }; httpService: { internalPort: number; forceHttps: boolean; autoStopMachines: boolean; autoStartMachines: boolean; minMachinesRunning: number; processes: string[]; }; }; /** * Mock `fly status` response for testing. * * @param app - The app name to use in the response (defaults to `mockDefs.testApp`) */ export declare const mockStatusResponse: (app?: string) => StatusResponse; /** * Mock `fly version` response for testing. */ export declare const mockVersionResponse: { Name: string; Version: string; Commit: string; BranchName: string; BuildDate: string; OS: string; Architecture: string; Environment: string; };