Commit 96f8426a authored by nanahira's avatar nanahira

remove workaround quester

parent 0b176f60
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
"@types/node": "^16.11.6", "@types/node": "^16.11.6",
"@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0", "@typescript-eslint/parser": "^4.33.0",
"axios": "^0.24.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^3.4.1",
...@@ -2195,15 +2194,6 @@ ...@@ -2195,15 +2194,6 @@
"integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
"peer": true "peer": true
}, },
"node_modules/axios": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
"integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.14.4"
}
},
"node_modules/balanced-match": { "node_modules/balanced-match": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
...@@ -9106,15 +9096,6 @@ ...@@ -9106,15 +9096,6 @@
"integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
"peer": true "peer": true
}, },
"axios": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
"integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==",
"dev": true,
"requires": {
"follow-redirects": "^1.14.4"
}
},
"balanced-match": { "balanced-match": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
......
...@@ -10,7 +10,6 @@ import { S3Client } from '@aws-sdk/client-s3'; ...@@ -10,7 +10,6 @@ import { S3Client } from '@aws-sdk/client-s3';
import { getSignedUrl } from './presign'; import { getSignedUrl } from './presign';
import { SRVProRoomInfo } from './def/srvpro'; import { SRVProRoomInfo } from './def/srvpro';
import moment from 'moment'; import moment from 'moment';
import axios, { AxiosRequestConfig } from 'axios';
import ProxyAgent from 'proxy-agent'; import ProxyAgent from 'proxy-agent';
export interface FromAndToTimeUnix { export interface FromAndToTimeUnix {
...@@ -251,38 +250,10 @@ export class YGOTournamentPlugin { ...@@ -251,38 +250,10 @@ export class YGOTournamentPlugin {
}); });
} }
// WTF fix for missing ctx.http.delete
private workaroundQuester(quester: Quester) {
const config = quester.config;
const options: AxiosRequestConfig = {
timeout: config.timeout,
headers: config.headers,
};
if (config.proxyAgent) {
const agent = new ProxyAgent(config.proxyAgent);
options.httpAgent = agent;
options.httpsAgent = agent;
}
quester.delete = async (url, params, headers) => {
const { data } = await axios.delete(url, {
...options,
...config,
params,
headers: {
...options.headers,
...headers,
},
});
return data;
};
}
initializeTournament() { initializeTournament() {
if (!this.config.isTournamentEnabled()) { if (!this.config.isTournamentEnabled()) {
return; return;
} }
this.workaroundQuester(this.ctx.http);
this.ctx.on('service/cache', () => { this.ctx.on('service/cache', () => {
this.ctx.cache.table('lateDeclarationTime', { maxAge: 3600 * 1000 }); this.ctx.cache.table('lateDeclarationTime', { maxAge: 3600 * 1000 });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment