1 | import { ClientID, ServiceID, ServiceSpecifier } from "../engine";
|
2 | import URI from "vscode-uri";
|
3 | import { WithRequired } from "apollo-env";
|
4 | import { ValidationRule } from "graphql/validation/ValidationContext";
|
5 | export interface EngineStatsWindow {
|
6 | to: number;
|
7 | from: number;
|
8 | }
|
9 | export declare const DefaultEngineStatsWindow: {
|
10 | to: number;
|
11 | from: number;
|
12 | };
|
13 | export interface HistoricalEngineStatsWindow extends EngineStatsWindow {
|
14 | }
|
15 | export declare type EndpointURI = string;
|
16 | export interface RemoteServiceConfig {
|
17 | name: ServiceID;
|
18 | url: EndpointURI;
|
19 | headers?: {
|
20 | [key: string]: string;
|
21 | };
|
22 | skipSSLValidation?: boolean;
|
23 | }
|
24 | export interface LocalServiceConfig {
|
25 | name: ServiceID;
|
26 | localSchemaFile: string | string[];
|
27 | }
|
28 | export interface EngineConfig {
|
29 | endpoint?: EndpointURI;
|
30 | readonly apiKey?: string;
|
31 | }
|
32 | export declare const DefaultEngineConfig: {
|
33 | endpoint: string;
|
34 | };
|
35 | export declare const DefaultConfigBase: {
|
36 | includes: string[];
|
37 | excludes: string[];
|
38 | };
|
39 | export interface ConfigBase {
|
40 | includes: string[];
|
41 | excludes: string[];
|
42 | }
|
43 | export declare type ClientServiceConfig = RemoteServiceConfig | LocalServiceConfig;
|
44 | export interface ClientConfigFormat extends ConfigBase {
|
45 | service?: ServiceSpecifier | ClientServiceConfig;
|
46 | name?: ClientID;
|
47 | referenceID?: string;
|
48 | version?: string;
|
49 | clientOnlyDirectives?: string[];
|
50 | clientSchemaDirectives?: string[];
|
51 | addTypename?: boolean;
|
52 | tagName?: string;
|
53 | statsWindow?: EngineStatsWindow;
|
54 | validationRules?: ValidationRule[] | ((rule: ValidationRule) => boolean);
|
55 | }
|
56 | export declare const DefaultClientConfig: {
|
57 | tagName: string;
|
58 | clientOnlyDirectives: string[];
|
59 | clientSchemaDirectives: string[];
|
60 | addTypename: boolean;
|
61 | statsWindow: {
|
62 | to: number;
|
63 | from: number;
|
64 | };
|
65 | includes: string[];
|
66 | excludes: string[];
|
67 | };
|
68 | export interface ServiceConfigFormat extends ConfigBase {
|
69 | name?: string;
|
70 | endpoint?: Exclude<RemoteServiceConfig, "name">;
|
71 | localSchemaFile?: string | string[];
|
72 | }
|
73 | export declare const DefaultServiceConfig: {
|
74 | endpoint: {
|
75 | url: string;
|
76 | };
|
77 | includes: string[];
|
78 | excludes: string[];
|
79 | };
|
80 | export interface ConfigBaseFormat {
|
81 | client?: ClientConfigFormat;
|
82 | service?: ServiceConfigFormat;
|
83 | engine?: EngineConfig;
|
84 | }
|
85 | export declare type ApolloConfigFormat = WithRequired<ConfigBaseFormat, "client"> | WithRequired<ConfigBaseFormat, "service">;
|
86 | export declare class ApolloConfig {
|
87 | rawConfig: ApolloConfigFormat;
|
88 | configURI?: URI | undefined;
|
89 | isClient: boolean;
|
90 | isService: boolean;
|
91 | engine: EngineConfig;
|
92 | service?: ServiceConfigFormat;
|
93 | client?: ClientConfigFormat;
|
94 | private _variant?;
|
95 | private _graphId?;
|
96 | constructor(rawConfig: ApolloConfigFormat, configURI?: URI | undefined);
|
97 | get configDirURI(): URI | undefined;
|
98 | get projects(): (ClientConfig | ServiceConfig)[];
|
99 | set variant(variant: string);
|
100 | get variant(): string;
|
101 | set graph(graphId: string | undefined);
|
102 | get graph(): string | undefined;
|
103 | setDefaults({ client, engine, service }: any): void;
|
104 | }
|
105 | export declare class ClientConfig extends ApolloConfig {
|
106 | client: ClientConfigFormat;
|
107 | }
|
108 | export declare class ServiceConfig extends ApolloConfig {
|
109 | service: ServiceConfigFormat;
|
110 | }
|
111 | //# sourceMappingURL=config.d.ts.map |
\ | No newline at end of file |