UNPKG

2.85 kBTypeScriptView Raw
1import { Output } from './Output/index';
2import { Config } from './Config';
3import { Cluster, InternalRC, RC, Target, Targets } from './types/rc';
4import { Args, Region } from './types/common';
5export declare class Environment {
6 localRC: InternalRC;
7 globalRC: InternalRC;
8 out: Output;
9 config: Config;
10 args: Args;
11 activeCluster: string;
12 warningCache: {
13 [key: string]: boolean;
14 };
15 constructor(out: Output, config: Config);
16 readonly rc: RC;
17 readonly token: string;
18 readonly default: Target | null;
19 readonly allClusters: string[];
20 checkCluster(cluster: string): void;
21 setLocalTarget(name: string, value: string): void;
22 setLocalDefaultTarget(value: string): void;
23 getTarget(targetName?: string, silent?: boolean): Target;
24 getTargetWithName(targetName?: string): {
25 target: Target | null;
26 targetName: string | null;
27 };
28 getDefaultTargetName(cluster: string): string;
29 setActiveCluster(cluster: string): void;
30 isSharedCluster(cluster: string): boolean;
31 deleteIfExist(serviceIds: string[]): void;
32 /**
33 * This is used to migrate the old .graphcool and .graphcoolrc to the new format
34 */
35 migrateOldFormat(): void;
36 migrateLocalFile(): void;
37 migrateClusters(rcPath: string): void;
38 migrateGlobalFiles(): void;
39 loadYaml(file: string | null, filePath?: string | null): Promise<any>;
40 load(args: Args): Promise<void>;
41 loadRCs(localFile: string | null, globalFile: string | null, args?: Args): Promise<void>;
42 deserializeRCs(localFile: any, globalFile: any, localFilePath: string | null, globalFilePath: string | null): RC;
43 checkClusters(targets: Targets, clusters: string[], filePath: string | null): void;
44 deserializeTargets(targets: {
45 [key: string]: string;
46 }, filePath: string | null): Targets;
47 deserializeTarget(target: string, filePath?: string | null): Target;
48 resolveTargetAliases: (targets: any, allTargets: any) => any;
49 isTargetAlias: (target: string | Target) => boolean;
50 resolveTarget: (target: string, targets: {
51 [key: string]: string;
52 }) => string;
53 serializeRC(rc: InternalRC): string;
54 setToken(token: string | undefined): void;
55 saveLocalRC(): void;
56 saveGlobalRC(): void;
57 save(): void;
58 setGlobalCluster(name: string, cluster: Cluster): void;
59 setLocalDefaultCluster(cluster: string): void;
60 getRegionFromCluster(cluster: string): Region;
61 readonly clusterEndpoint: string;
62 simpleEndpoint(projectId: string): string;
63 importEndpoint(projectId: string): string;
64 exportEndpoint(projectId: string): string;
65 relayEndpoint(projectId: string): string;
66 fileEndpoint(projectId: string): string;
67 subscriptionEndpoint(projectId: string): string;
68 private setTestToken();
69 private subscriptionURL;
70}