Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
78 lines (66 loc) · 1.37 KB
/
Copy pathtypes.ts
File metadata and controls
78 lines (66 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
export enum SourceType {
REGEX_FILTER = 'regexFilter',
URL_FILTER = 'urlFilter',
}
export enum TargetType {
REGEX_SUBSTITUTION = 'regexSubstitution',
URL = 'url',
}
export enum RuleType {
Redirect = 'redirect',
SourceMap = 'sourceMap',
CORS = 'cors',
}
export interface BaseRule {
id: string
type: RuleType
source: string
sourceType?: SourceType
enabled?: boolean
}
export interface RedirectRule extends BaseRule {
target: string
targetType?: TargetType
}
export interface SourceMapRule extends BaseRule {
sourceMapUrl: string
}
export interface CorsRule extends BaseRule {
allowOrigin?: string;
allowCredentials?: boolean;
allowMethods?: string;
allowHeaders?: string;
maxAge?: number;
}
export type Rule = RedirectRule | SourceMapRule | CorsRule;
export interface RuleGroup {
id: string
name: string
rules: Rule[]
enabled?: boolean
}
export interface ISyncStatus {
loading?: boolean
success?: string
error?: string
}
export interface RuleStoreSnapshot {
enabled: boolean
groups: RuleGroup[]
revision: number
}
export interface RuleMutationResult {
success: true
revision: number
before: RuleStoreSnapshot
after: RuleStoreSnapshot
dnrApplied: boolean
auditId: string
}
export interface RuleServiceCommand {
action: string
requestId?: string
expectedRevision?: number
confirm?: boolean
[key: string]: unknown
}