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