-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
94 lines (87 loc) · 1.33 KB
/
types.ts
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
export interface XmlRoute {
'@url': string
'@method': 'GET' | 'POST' | 'PUT'
service?: {
'@class': string
'@method': string
}
resources: {
resource: {
'@ref': string
}
}
data?: {
parameter?: {
'@name': string
}
}
}
export interface Route {
type: XmlRoute['@method']
url: string
class?: string
method?: string
data?: string
auth?: string
}
interface PostmanEvent {
listen: string
script: {
type: string
exec: string[]
}
}
interface KeyValue {
key: string
value: string
}
export interface PostmanItem {
name: string
event?: PostmanEvent[]
response?: []
request: {
auth?: {
type: 'bearer'
bearer: {
key: 'token'
value: '{{customer_token}}' | '{{admin_token}}'
type: 'string'
}[]
}
method: XmlRoute['@method']
header?: string[]
description?: string
body?: {
mode: 'raw'
raw: string
options?: {
raw: {
language: 'json'
}
}
}
url: {
raw: string
host: string[]
path: string[]
query?: KeyValue[]
}
}
}
type Folder<T> = {
name: string
item: T[]
}
export type PostmanFolder = Folder<PostmanItem>
export interface PostmanCollection {
event?: PostmanEvent[]
variabile?: KeyValue[]
info: {
name: string
_postman_id?: string
description?: string
schema?: string
_exporter_id?: string
}
item: (PostmanItem | PostmanFolder)[]
}