-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathorval.config.ts
37 lines (34 loc) · 877 Bytes
/
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
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'orval';
import { loadEnvConfig } from '@next/env';
import { accessToken, refreshToken } from './mocks/auth-mock';
loadEnvConfig(process.cwd());
export default defineConfig({
api: {
output: {
mock: true,
client: 'axios-functions',
target: 'src/shared/api/api.generated.ts',
mode: 'single',
override: {
mock: {
properties: {
access: accessToken,
refresh: refreshToken,
},
},
mutator: {
path: './src/shared/api/http-client.ts',
name: 'httpClient',
},
},
},
input: {
validation: true,
target: `${process.env.NEXT_PUBLIC_API_ENDPOINT}/api/v1/swagger-json`,
},
hooks: {
afterAllFilesWrite: 'yarn lint:fix',
},
},
});