forked from danskernesdigitalebibliotek/dpl-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
orval.config.ts
148 lines (147 loc) · 3.72 KB
/
orval.config.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import { defineConfig } from "orval";
export default defineConfig({
materialList: {
output: {
mode: "split",
target: "src/core/material-list-api/material-list.ts",
schemas: "src/core/material-list-api/model",
client: "react-query",
override: {
mutator: {
path: "src/core/material-list-api/mutator/fetcher.ts",
name: "fetcher"
},
query: {
useQuery: true
}
},
prettier: true
},
input: {
target:
// This should come from a url that will be updated if there are any changes
"https://raw.githubusercontent.com/danskernesdigitalebibliotek/ddb-material-list/develop/spec/material-list-2.0.0.yaml",
converterOptions: {
indent: 2
}
}
},
coverService: {
output: {
mode: "split",
target: "src/core/cover-service-api/cover-service.ts",
schemas: "src/core/cover-service-api/model",
client: "react-query",
override: {
mutator: {
path: "src/core/cover-service-api/mutator/fetcher.ts",
name: "fetcher"
},
query: {
useQuery: true
}
},
prettier: true
},
input: {
target: "https://cover.dandigbib.org/spec.yaml",
converterOptions: {
indent: 2
}
}
},
fbsAdapter: {
output: {
mode: "split",
target: "src/core/fbs/fbs.ts",
schemas: "src/core/fbs/model",
client: "react-query",
override: {
mutator: {
path: "src/core/fbs/mutator/fetcher.ts",
name: "fetcher"
},
query: {
useQuery: true
},
operations: {
// The reason why we add this here is to be able to use "enabled" option in the
// getPatronInformationByPatronIdV2 query. This lets us call it conditionally.
getPatronInformationByPatronIdV2: {
requestOptions: false
}
}
},
prettier: true
},
input: {
target: "src/core/fbs/fbs-adapter.yaml",
converterOptions: {
indent: 2
}
}
},
publizonAdapter: {
output: {
mode: "split",
target: "src/core/publizon/publizon.ts",
schemas: "src/core/publizon/model",
client: "react-query",
override: {
mutator: {
path: "src/core/publizon/mutator/fetcher.ts",
name: "fetcher"
},
query: {
useQuery: true
},
operations: {
// The reason why we add this here is to be able to use "enabled" option in the
// useGetV1LoanstatusIdentifier query. This lets us call it conditionally.
getV1LoanstatusIdentifier: {
requestOptions: false
}
}
},
prettier: true
},
input: {
target: "src/core/publizon/publizon-adapter.yaml",
converterOptions: {
indent: 2
}
}
},
dplCms: {
output: {
mode: "split",
target: "src/core/dpl-cms/dpl-cms.ts",
schemas: "src/core/dpl-cms/model",
client: "react-query",
override: {
mutator: {
path: "src/core/dpl-cms/mutator/fetcher.ts",
name: "fetcher"
},
query: {
useQuery: true
},
operations: {
// The reason why we add this here is to be able to use "enabled" option in the
// proxy-url:GET query. This lets us call it conditionally.
"proxy-url:GET": {
requestOptions: false
}
}
},
prettier: true
},
input: {
target:
"https://raw.githubusercontent.com/danskernesdigitalebibliotek/dpl-cms/develop/openapi.json",
converterOptions: {
indent: 2
}
}
}
});