-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathapi.config.cjs
42 lines (34 loc) · 1000 Bytes
/
api.config.cjs
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
//? NOTE: Orval does not support ESM configs at the moment
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { resolve } = require("path");
const apiPath = resolve(__dirname, "./src/common/api");
const clientPath = "internal/client.generated.ts";
const targetPaths = {
indexer: resolve(apiPath, "indexer", clientPath),
"intear-prices": resolve(apiPath, "intear-prices", clientPath),
};
module.exports = {
/**
* Docs: https://test-dev.potlock.io/api/schema/swagger-ui
*/
indexer: {
input: "https://test-dev.potlock.io/api/schema",
output: {
target: targetPaths.indexer,
client: "swr",
},
hooks: {
afterAllFilesWrite: `eslint --fix ${targetPaths.indexer}`,
},
},
"intear-prices": {
input: "https://prices.intear.tech/openapi",
output: {
target: targetPaths["intear-prices"],
client: "swr",
},
hooks: {
afterAllFilesWrite: `eslint --fix ${targetPaths["intear-prices"]}`,
},
},
};