@cdwr/fly-node
Version:
The flyctl node wrapper for programmatic deployments to fly.io.
94 lines (93 loc) • 3.39 kB
TypeScript
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: Array<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: Array<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: Array<ListCertForAllResponse>;
/**
* Mock `fly postgres list` response for testing.
*/
export declare const mockListPostgresResponse: Array<ListPostgresResponse>;
/**
* Mock `fly postgres users list` response for testing.
*/
export declare const mockListPostgresUsersResponse: Array<ListPostgresUsersResponse>;
/**
* Mock `fly secrets list` response for testing.
*/
export declare const mockListSecretForAppResponse: Array<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: Array<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;