Skip to content

Commit

Permalink
added API
Browse files Browse the repository at this point in the history
  • Loading branch information
torikushiii committed Jun 20, 2024
1 parent e28c41c commit 0ef84f3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions gots/api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const definition = {
name: "API",
optionsType: "function",
options: (() => ({
mutableDefaults: true,
throwHttpErrors: true,
hooks: {
beforeError: [
(e) => new app.Error.GenericRequest({
body: e.response?.body ?? null,
statusCode: e.response?.statusCode,
statusMessage: e.response?.statusMessage,
hostname: e.options?.url?.hostname,
message: e.message,
stack: e.stack
})
]
}
})),
parent: "Global"
};

module.exports = definition;
2 changes: 2 additions & 0 deletions gots/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const API = require("./api/index.js");
const FakeAgent = require("./fake-agent/index.js");
const Global = require("./global/index.js");
const HoyoLab = require("./hoyolab/index.js");

const definitions = [
API,
FakeAgent,
Global,
HoyoLab
Expand Down

0 comments on commit 0ef84f3

Please sign in to comment.