UNPKG

2.1 kBTypeScriptView Raw
1import { DiffInterceptor } from './diff';
2export declare type Endpoint = string | {
3 url: string;
4 method?: 'get' | 'GET' | 'post' | 'POST';
5 headers?: {
6 [name: string]: string;
7 };
8};
9export interface SchemaPointer {
10 ref: string;
11 path: string;
12}
13export interface LegacyConfig {
14 diff?: boolean | Diff;
15 notifications?: Notifications;
16 endpoint?: Endpoint;
17 schema: SchemaPointer;
18}
19export interface Notifications {
20 slack?: string;
21 discord?: string;
22 webhook?: string;
23}
24interface Diff {
25 experimental_merge?: boolean;
26 annotations?: boolean;
27 failOnBreaking?: boolean;
28 approveLabel?: string;
29 intercept?: DiffInterceptor;
30 summaryLimit?: number;
31}
32interface Environment {
33 branch: string;
34 endpoint?: Endpoint;
35 diff?: Diff | boolean;
36 notifications?: Notifications | boolean;
37}
38export interface NormalizedEnvironment {
39 name: string;
40 schema: string;
41 branch: string;
42 endpoint?: Endpoint;
43 diff: Diff | false;
44 notifications: Notifications | false;
45}
46interface SingleEnvironmentConfig extends Environment {
47 schema: string;
48 others?: {
49 diff?: Diff | boolean;
50 notifications?: Notifications | boolean;
51 };
52}
53interface MultipleEnvironmentConfig {
54 schema: string;
55 diff?: Diff | boolean;
56 notifications?: Notifications | boolean;
57 env: {
58 [env: string]: Environment;
59 };
60 others?: {
61 diff?: Diff | boolean;
62 notifications?: Notifications | boolean;
63 };
64}
65export declare type Config = SingleEnvironmentConfig | MultipleEnvironmentConfig | LegacyConfig;
66export declare type NormalizedConfig = {
67 [env: string]: NormalizedEnvironment;
68};
69export declare type NormalizedLegacyConfig = {
70 __default: NormalizedEnvironment;
71};
72export declare const defaultConfigName = "__default";
73export declare const defaultFallbackBranch = "*";
74export declare function createConfig(rawConfig: Config, setConfigKind: (kind: 'legacy' | 'single' | 'multiple') => void, branches?: string[], fallbackBranch?: string): NormalizedEnvironment;
75export {};