maidraw 0.11.14 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chu/index.d.ts +3 -5
- package/dist/chu/index.js +4 -38
- package/dist/chu/index.js.map +1 -1
- package/dist/chu/lib/adapter/index.d.ts +38 -24
- package/dist/chu/lib/adapter/index.js +4 -65
- package/dist/chu/lib/adapter/index.js.map +1 -1
- package/dist/chu/lib/adapter/kamaiTachi/index.d.ts +133 -26
- package/dist/chu/lib/adapter/kamaiTachi/index.js +265 -76
- package/dist/chu/lib/adapter/kamaiTachi/index.js.map +1 -1
- package/dist/chu/lib/adapter/lxns/index.d.ts +77 -17
- package/dist/chu/lib/adapter/lxns/index.js +71 -34
- package/dist/chu/lib/adapter/lxns/index.js.map +1 -1
- package/dist/chu/lib/database.d.ts +3 -1
- package/dist/chu/lib/database.js +22 -6
- package/dist/chu/lib/database.js.map +1 -1
- package/dist/chu/painter/best50/index.d.ts +36 -5
- package/dist/chu/painter/best50/index.js +41 -24
- package/dist/chu/painter/best50/index.js.map +1 -1
- package/dist/chu/painter/chart/index.d.ts +42 -5
- package/dist/chu/painter/chart/index.js +39 -20
- package/dist/chu/painter/chart/index.js.map +1 -1
- package/dist/chu/painter/index.d.ts +2 -2
- package/dist/chu/painter/index.js.map +1 -1
- package/dist/geki/index.d.ts +3 -5
- package/dist/geki/index.js +4 -38
- package/dist/geki/index.js.map +1 -1
- package/dist/geki/lib/adapter/index.d.ts +40 -26
- package/dist/geki/lib/adapter/index.js +4 -65
- package/dist/geki/lib/adapter/index.js.map +1 -1
- package/dist/geki/lib/adapter/kamaiTachi/index.d.ts +137 -30
- package/dist/geki/lib/adapter/kamaiTachi/index.js +281 -87
- package/dist/geki/lib/adapter/kamaiTachi/index.js.map +1 -1
- package/dist/geki/lib/database.d.ts +3 -1
- package/dist/geki/lib/database.js +24 -8
- package/dist/geki/lib/database.js.map +1 -1
- package/dist/geki/lib/util.d.ts +1 -1
- package/dist/geki/painter/best50/index.d.ts +36 -5
- package/dist/geki/painter/best50/index.js +43 -26
- package/dist/geki/painter/best50/index.js.map +1 -1
- package/dist/geki/painter/chart/index.d.ts +42 -5
- package/dist/geki/painter/chart/index.js +38 -19
- package/dist/geki/painter/chart/index.js.map +1 -1
- package/dist/geki/painter/index.d.ts +2 -2
- package/dist/geki/painter/index.js.map +1 -1
- package/dist/lib/adapter.d.ts +19 -0
- package/dist/lib/adapter.js +71 -0
- package/dist/lib/adapter.js.map +1 -0
- package/dist/lib/logger.d.ts +4 -0
- package/dist/lib/logger.js +49 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/painter.d.ts +15 -3
- package/dist/lib/painter.js.map +1 -1
- package/dist/lib/util.d.ts +10 -0
- package/dist/lib/util.js.map +1 -1
- package/dist/mai/index.d.ts +1 -5
- package/dist/mai/index.js +2 -38
- package/dist/mai/index.js.map +1 -1
- package/dist/mai/lib/adapter/divingFish/index.d.ts +80 -32
- package/dist/mai/lib/adapter/divingFish/index.js +51 -19
- package/dist/mai/lib/adapter/divingFish/index.js.map +1 -1
- package/dist/mai/lib/adapter/index.d.ts +37 -24
- package/dist/mai/lib/adapter/index.js +4 -65
- package/dist/mai/lib/adapter/index.js.map +1 -1
- package/dist/mai/lib/adapter/kamaiTachi/index.d.ts +124 -27
- package/dist/mai/lib/adapter/kamaiTachi/index.js +211 -61
- package/dist/mai/lib/adapter/kamaiTachi/index.js.map +1 -1
- package/dist/mai/lib/adapter/lxns/index.d.ts +121 -25
- package/dist/mai/lib/adapter/lxns/index.js +140 -45
- package/dist/mai/lib/adapter/lxns/index.js.map +1 -1
- package/dist/mai/lib/adapter/maishift/index.d.ts +92 -17
- package/dist/mai/lib/adapter/maishift/index.js +244 -57
- package/dist/mai/lib/adapter/maishift/index.js.map +1 -1
- package/dist/mai/lib/database.d.ts +3 -1
- package/dist/mai/lib/database.js +23 -7
- package/dist/mai/lib/database.js.map +1 -1
- package/dist/mai/painter/best50/index.d.ts +28 -6
- package/dist/mai/painter/best50/index.js +27 -14
- package/dist/mai/painter/best50/index.js.map +1 -1
- package/dist/mai/painter/chart/index.d.ts +42 -5
- package/dist/mai/painter/chart/index.js +39 -20
- package/dist/mai/painter/chart/index.js.map +1 -1
- package/dist/mai/painter/index.d.ts +2 -2
- package/dist/mai/painter/index.js +1 -1
- package/dist/mai/painter/index.js.map +1 -1
- package/dist/mai/painter/level50/index.d.ts +28 -6
- package/dist/mai/painter/level50/index.js +26 -13
- package/dist/mai/painter/level50/index.js.map +1 -1
- package/package.json +1 -1
package/dist/chu/index.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import Bunyan from "bunyan";
|
|
2
1
|
import * as database from "./lib/database";
|
|
3
2
|
import * as chart from "./painter/chart";
|
|
4
3
|
import * as bests from "./painter/best50";
|
|
5
4
|
import * as adapter from "./lib/adapter";
|
|
6
5
|
import * as lxns from "./lib/adapter/lxns";
|
|
7
6
|
import * as kamaiTachi from "./lib/adapter/kamaiTachi";
|
|
8
|
-
|
|
9
|
-
static logger: Bunyan;
|
|
10
|
-
}
|
|
7
|
+
import * as types from "./type";
|
|
11
8
|
export declare namespace Chuni {
|
|
9
|
+
export import Types = types;
|
|
12
10
|
export import Database = database.Database;
|
|
13
|
-
export import
|
|
11
|
+
export import ChunithmScoreAdapter = adapter.ChunithmScoreAdapter;
|
|
14
12
|
namespace Adapters {
|
|
15
13
|
export import KamaiTachi = kamaiTachi.KamaiTachi;
|
|
16
14
|
export import LXNS = lxns.LXNS;
|
package/dist/chu/index.js
CHANGED
|
@@ -22,54 +22,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.Chuni = void 0;
|
|
30
|
-
const bunyan_1 = __importDefault(require("bunyan"));
|
|
31
27
|
const database = __importStar(require("./lib/database"));
|
|
32
28
|
const chart = __importStar(require("./painter/chart"));
|
|
33
29
|
const bests = __importStar(require("./painter/best50"));
|
|
34
30
|
const adapter = __importStar(require("./lib/adapter"));
|
|
35
31
|
const lxns = __importStar(require("./lib/adapter/lxns"));
|
|
36
32
|
const kamaiTachi = __importStar(require("./lib/adapter/kamaiTachi"));
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
name: "maidraw.chuni",
|
|
40
|
-
streams: [
|
|
41
|
-
{
|
|
42
|
-
stream: process.stdout,
|
|
43
|
-
level: (() => {
|
|
44
|
-
switch (process.env.LOG_LEVEL) {
|
|
45
|
-
case "trace":
|
|
46
|
-
return bunyan_1.default.TRACE;
|
|
47
|
-
case "debug":
|
|
48
|
-
return bunyan_1.default.DEBUG;
|
|
49
|
-
case "info":
|
|
50
|
-
return bunyan_1.default.INFO;
|
|
51
|
-
case "warn":
|
|
52
|
-
return bunyan_1.default.WARN;
|
|
53
|
-
case "error":
|
|
54
|
-
return bunyan_1.default.ERROR;
|
|
55
|
-
case "fatal":
|
|
56
|
-
return bunyan_1.default.FATAL;
|
|
57
|
-
default:
|
|
58
|
-
return bunyan_1.default.INFO;
|
|
59
|
-
}
|
|
60
|
-
})(),
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
stream: process.stderr,
|
|
64
|
-
level: bunyan_1.default.ERROR,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
exports.Chuni = Chuni;
|
|
33
|
+
const types = __importStar(require("./type"));
|
|
34
|
+
var Chuni;
|
|
70
35
|
(function (Chuni) {
|
|
36
|
+
Chuni.Types = types;
|
|
71
37
|
Chuni.Database = database.Database;
|
|
72
|
-
Chuni.
|
|
38
|
+
Chuni.ChunithmScoreAdapter = adapter.ChunithmScoreAdapter;
|
|
73
39
|
let Adapters;
|
|
74
40
|
(function (Adapters) {
|
|
75
41
|
Adapters.KamaiTachi = kamaiTachi.KamaiTachi;
|
package/dist/chu/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chu/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chu/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yDAA2C;AAE3C,uDAAyC;AACzC,wDAA0C;AAE1C,uDAAyC;AACzC,yDAA2C;AAC3C,qEAAuD;AAEvD,8CAAgC;AAEhC,IAAiB,KAAK,CAerB;AAfD,WAAiB,KAAK;IACJ,WAAK,GAAG,KAAK,CAAC;IAEd,cAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAE7B,0BAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAClE,IAAiB,QAAQ,CAGxB;IAHD,WAAiB,QAAQ;QACP,mBAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACnC,aAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACnC,CAAC,EAHgB,QAAQ,GAAR,cAAQ,KAAR,cAAQ,QAGxB;IAED,IAAiB,QAAQ,CAGxB;IAHD,WAAiB,QAAQ;QACP,eAAM,GAAG,KAAK,CAAC,aAAa,CAAC;QAC7B,cAAK,GAAG,KAAK,CAAC,YAAY,CAAC;IAC7C,CAAC,EAHgB,QAAQ,GAAR,cAAQ,KAAR,cAAQ,QAGxB;AACL,CAAC,EAfgB,KAAK,qBAAL,KAAK,QAerB"}
|
|
@@ -1,39 +1,53 @@
|
|
|
1
1
|
import { IScore } from "../../type";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
private readonly MAX_LOG_LENGTH;
|
|
11
|
-
protected get<T>(endpoint: string, data?: any,
|
|
12
|
-
/**
|
|
13
|
-
* Cache TTL in milliseconds. Defaults to 30 minutes.
|
|
14
|
-
*/
|
|
15
|
-
cacheTTL?: number, options?: axios.AxiosRequestConfig): Promise<T | undefined>;
|
|
16
|
-
protected post<T>(endpoint: string, data?: any): Promise<T | undefined>;
|
|
17
|
-
abstract getPlayerRecent40(username: string): Promise<{
|
|
2
|
+
import { BaseScoreAdapter } from "../../../lib/adapter";
|
|
3
|
+
import Util from "../../../lib/util";
|
|
4
|
+
type IBaseResponseData = {
|
|
5
|
+
unknown: null;
|
|
6
|
+
};
|
|
7
|
+
type IRecent40ResponseData = IBaseResponseData & {
|
|
8
|
+
success: {
|
|
18
9
|
recent: IScore[];
|
|
19
10
|
best: IScore[];
|
|
20
|
-
}
|
|
21
|
-
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type IBest50ResponseData = IBaseResponseData & {
|
|
14
|
+
success: {
|
|
22
15
|
new: IScore[];
|
|
23
16
|
old: IScore[];
|
|
24
17
|
best?: IScore[];
|
|
25
|
-
}
|
|
26
|
-
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type IProfileResponseData = IBaseResponseData & {
|
|
21
|
+
success: {
|
|
27
22
|
name: string;
|
|
28
23
|
rating: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
type IProfilePictureResponseData = IBaseResponseData & {
|
|
27
|
+
success: Buffer;
|
|
28
|
+
};
|
|
29
|
+
type IScoreResponseData = IBaseResponseData & {
|
|
30
|
+
success: {
|
|
32
31
|
basic: IScore | null;
|
|
33
32
|
advanced: IScore | null;
|
|
34
33
|
expert: IScore | null;
|
|
35
34
|
master: IScore | null;
|
|
36
35
|
ultima: IScore | null;
|
|
37
36
|
worldsEnd: IScore | null;
|
|
38
|
-
}
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
type IResponseData = {
|
|
40
|
+
recent40: IRecent40ResponseData;
|
|
41
|
+
best50: IBest50ResponseData;
|
|
42
|
+
profile: IProfileResponseData;
|
|
43
|
+
profilePicture: IProfilePictureResponseData;
|
|
44
|
+
score: IScoreResponseData;
|
|
45
|
+
};
|
|
46
|
+
export declare abstract class ChunithmScoreAdapter<IExtraReturnTypes extends Partial<Record<keyof IResponseData, Record<string, unknown>>> = {}> extends BaseScoreAdapter {
|
|
47
|
+
abstract getPlayerRecent40(username: string): Promise<Util.ResponseOf<Util.MergeExtraTypes<IResponseData, IExtraReturnTypes>["recent40"]>>;
|
|
48
|
+
abstract getPlayerBest50(username: string): Promise<Util.ResponseOf<Util.MergeExtraTypes<IResponseData, IExtraReturnTypes>["best50"]>>;
|
|
49
|
+
abstract getPlayerInfo(username: string, type: "new" | "recents"): Promise<Util.ResponseOf<Util.MergeExtraTypes<IResponseData, IExtraReturnTypes>["profile"]>>;
|
|
50
|
+
abstract getPlayerProfilePicture(username: string): Promise<Util.ResponseOf<Util.MergeExtraTypes<IResponseData, IExtraReturnTypes>["profilePicture"]>>;
|
|
51
|
+
abstract getPlayerScore(username: string, chartId: number): Promise<Util.ResponseOf<Util.MergeExtraTypes<IResponseData, IExtraReturnTypes>["score"]>>;
|
|
39
52
|
}
|
|
53
|
+
export {};
|
|
@@ -1,69 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const memory_cache_1 = require("memory-cache");
|
|
10
|
-
class ScoreTrackerAdapter {
|
|
11
|
-
static _cache = new memory_cache_1.Cache();
|
|
12
|
-
get cache() {
|
|
13
|
-
return ScoreTrackerAdapter._cache;
|
|
14
|
-
}
|
|
15
|
-
axios;
|
|
16
|
-
constructor({ baseURL } = {}) {
|
|
17
|
-
this.axios = axios_1.default.create({ baseURL });
|
|
18
|
-
}
|
|
19
|
-
MAX_LOG_LENGTH = 1000;
|
|
20
|
-
async get(endpoint, data,
|
|
21
|
-
/**
|
|
22
|
-
* Cache TTL in milliseconds. Defaults to 30 minutes.
|
|
23
|
-
*/
|
|
24
|
-
cacheTTL = 30 * 60 * 1000, options = {}) {
|
|
25
|
-
const cacheKey = `${this.axios.defaults.baseURL}${endpoint}${data
|
|
26
|
-
? `-${JSON.stringify(data).substring(0, this.MAX_LOG_LENGTH)}`
|
|
27
|
-
: ""}`;
|
|
28
|
-
if (cacheTTL > 0) {
|
|
29
|
-
const cacheContent = await this.cache.get(cacheKey);
|
|
30
|
-
if (cacheContent) {
|
|
31
|
-
chu_1.Chuni.logger.trace(`GET ${endpoint}${data
|
|
32
|
-
? ` ${JSON.stringify(data).substring(0, this.MAX_LOG_LENGTH)}`
|
|
33
|
-
: ""}, cache HIT`);
|
|
34
|
-
return cacheContent;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const beginTimestamp = Date.now();
|
|
38
|
-
const res = await this.axios
|
|
39
|
-
.get(endpoint, { params: data, ...options })
|
|
40
|
-
.then(async (r) => {
|
|
41
|
-
if (cacheTTL > 0) {
|
|
42
|
-
await this.cache.put(cacheKey, r.data, cacheTTL);
|
|
43
|
-
}
|
|
44
|
-
return r.data;
|
|
45
|
-
})
|
|
46
|
-
.catch((e) => {
|
|
47
|
-
return e.response?.data || e;
|
|
48
|
-
});
|
|
49
|
-
const timeDifference = Date.now() - beginTimestamp;
|
|
50
|
-
chu_1.Chuni.logger.trace(`GET ${endpoint}${data
|
|
51
|
-
? ` ${JSON.stringify(data).substring(0, this.MAX_LOG_LENGTH)}`
|
|
52
|
-
: ""}, cache MISS, took ${timeDifference}ms`);
|
|
53
|
-
return res;
|
|
54
|
-
}
|
|
55
|
-
async post(endpoint, data) {
|
|
56
|
-
const beginTimestamp = Date.now();
|
|
57
|
-
const res = await this.axios
|
|
58
|
-
.post(endpoint, data)
|
|
59
|
-
.then((r) => r.data)
|
|
60
|
-
.catch((e) => e.response?.data);
|
|
61
|
-
const timeDifference = Date.now() - beginTimestamp;
|
|
62
|
-
chu_1.Chuni.logger.trace(`POST ${endpoint}${data
|
|
63
|
-
? ` ${JSON.stringify(data).substring(0, this.MAX_LOG_LENGTH)}`
|
|
64
|
-
: ""}, took ${timeDifference}ms`);
|
|
65
|
-
return res;
|
|
66
|
-
}
|
|
3
|
+
exports.ChunithmScoreAdapter = void 0;
|
|
4
|
+
const adapter_1 = require("../../../lib/adapter");
|
|
5
|
+
class ChunithmScoreAdapter extends adapter_1.BaseScoreAdapter {
|
|
67
6
|
}
|
|
68
|
-
exports.
|
|
7
|
+
exports.ChunithmScoreAdapter = ChunithmScoreAdapter;
|
|
69
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/chu/lib/adapter/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/chu/lib/adapter/index.ts"],"names":[],"mappings":";;;AACA,kDAAwD;AAgDxD,MAAsB,oBAIpB,SAAQ,0BAAgB;CAyCzB;AA7CD,oDA6CC"}
|
|
@@ -1,18 +1,52 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChunithmScoreAdapter } from "..";
|
|
2
2
|
import { IScore } from "../../../type";
|
|
3
|
-
|
|
3
|
+
type IBest50ResponseData = {
|
|
4
|
+
"invalid-user": {
|
|
5
|
+
username: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
type IRecent40ResponseData = IBest50ResponseData & {};
|
|
9
|
+
type IProfileResponseData = IBest50ResponseData & {
|
|
10
|
+
"invalid-type": {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type IProfilePictureResponseData = IBest50ResponseData & {};
|
|
15
|
+
type IScoreResponseData = IBest50ResponseData & {};
|
|
16
|
+
type IResponseData = {
|
|
17
|
+
recent40: IRecent40ResponseData;
|
|
18
|
+
best50: IBest50ResponseData;
|
|
19
|
+
profile: IProfileResponseData;
|
|
20
|
+
profilePicture: IProfilePictureResponseData;
|
|
21
|
+
score: IScoreResponseData;
|
|
22
|
+
};
|
|
23
|
+
export declare class KamaiTachi extends ChunithmScoreAdapter<IResponseData> {
|
|
4
24
|
private readonly CURRENT_VERSION;
|
|
5
25
|
constructor({ baseURL, currentVersion, }?: {
|
|
6
26
|
baseURL?: string;
|
|
7
27
|
currentVersion?: KamaiTachi.EGameVersions;
|
|
8
28
|
});
|
|
9
29
|
getPlayerScore(username: string, chartId: number): Promise<{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
30
|
+
readonly status: "invalid-user";
|
|
31
|
+
readonly message: string;
|
|
32
|
+
readonly data: {
|
|
33
|
+
readonly username: string;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
readonly status: "unknown";
|
|
37
|
+
readonly message: string;
|
|
38
|
+
readonly data: null;
|
|
39
|
+
} | {
|
|
40
|
+
readonly status: "success";
|
|
41
|
+
readonly message: "";
|
|
42
|
+
readonly data: {
|
|
43
|
+
readonly basic: IScore | null;
|
|
44
|
+
readonly advanced: IScore | null;
|
|
45
|
+
readonly expert: IScore | null;
|
|
46
|
+
readonly master: IScore | null;
|
|
47
|
+
readonly ultima: IScore | null;
|
|
48
|
+
readonly worldsEnd: IScore | null;
|
|
49
|
+
};
|
|
16
50
|
}>;
|
|
17
51
|
getPlayerPB(userId: string): Promise<KamaiTachi.IResponse<{
|
|
18
52
|
charts: KamaiTachi.IChart[];
|
|
@@ -29,20 +63,82 @@ export declare class KamaiTachi extends ScoreTrackerAdapter {
|
|
|
29
63
|
private toMaiDrawScore;
|
|
30
64
|
private getDatabaseVersion;
|
|
31
65
|
getPlayerBest50(userId: string, currentVersion?: KamaiTachi.EGameVersions, omnimix?: boolean): Promise<{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
66
|
+
readonly status: "invalid-user";
|
|
67
|
+
readonly message: string;
|
|
68
|
+
readonly data: {
|
|
69
|
+
readonly username: string;
|
|
70
|
+
};
|
|
71
|
+
} | {
|
|
72
|
+
readonly status: "unknown";
|
|
73
|
+
readonly message: string;
|
|
74
|
+
readonly data: null;
|
|
75
|
+
} | {
|
|
76
|
+
readonly status: "success";
|
|
77
|
+
readonly message: "";
|
|
78
|
+
readonly data: {
|
|
79
|
+
readonly new: IScore[];
|
|
80
|
+
readonly old: IScore[];
|
|
81
|
+
readonly best: IScore[];
|
|
82
|
+
};
|
|
83
|
+
}>;
|
|
36
84
|
getPlayerRecent40(userId: string, currentVersion?: KamaiTachi.EGameVersions, omnimix?: boolean): Promise<{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
85
|
+
readonly status: "invalid-user";
|
|
86
|
+
readonly message: string;
|
|
87
|
+
readonly data: {
|
|
88
|
+
readonly username: string;
|
|
89
|
+
};
|
|
90
|
+
} | {
|
|
91
|
+
readonly status: "unknown";
|
|
92
|
+
readonly message: string;
|
|
93
|
+
readonly data: null;
|
|
94
|
+
} | {
|
|
95
|
+
readonly status: "success";
|
|
96
|
+
readonly message: "";
|
|
97
|
+
readonly data: {
|
|
98
|
+
readonly recent: IScore[];
|
|
99
|
+
readonly best: IScore[];
|
|
100
|
+
};
|
|
101
|
+
}>;
|
|
40
102
|
getPlayerInfo(userId: string, type: "new" | "recents"): Promise<{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
103
|
+
readonly status: "invalid-user";
|
|
104
|
+
readonly message: string;
|
|
105
|
+
readonly data: {
|
|
106
|
+
readonly username: string;
|
|
107
|
+
};
|
|
108
|
+
} | {
|
|
109
|
+
readonly status: "unknown";
|
|
110
|
+
readonly message: string;
|
|
111
|
+
readonly data: null;
|
|
112
|
+
} | {
|
|
113
|
+
readonly status: "success";
|
|
114
|
+
readonly message: "";
|
|
115
|
+
readonly data: {
|
|
116
|
+
readonly name: string;
|
|
117
|
+
readonly rating: number;
|
|
118
|
+
};
|
|
119
|
+
} | {
|
|
120
|
+
readonly status: "invalid-type";
|
|
121
|
+
readonly message: string;
|
|
122
|
+
readonly data: {
|
|
123
|
+
readonly type: string;
|
|
124
|
+
};
|
|
125
|
+
}>;
|
|
44
126
|
private getPlayerProfileRaw;
|
|
45
|
-
getPlayerProfilePicture(userId: string): Promise<
|
|
127
|
+
getPlayerProfilePicture(userId: string): Promise<{
|
|
128
|
+
readonly status: "invalid-user";
|
|
129
|
+
readonly message: string;
|
|
130
|
+
readonly data: {
|
|
131
|
+
readonly username: string;
|
|
132
|
+
};
|
|
133
|
+
} | {
|
|
134
|
+
readonly status: "unknown";
|
|
135
|
+
readonly message: string;
|
|
136
|
+
readonly data: null;
|
|
137
|
+
} | {
|
|
138
|
+
readonly status: "success";
|
|
139
|
+
readonly message: "";
|
|
140
|
+
readonly data: Buffer;
|
|
141
|
+
}>;
|
|
46
142
|
chunithm(): KamaiTachi;
|
|
47
143
|
plus(): KamaiTachi;
|
|
48
144
|
air(): KamaiTachi;
|
|
@@ -67,12 +163,21 @@ export declare class KamaiTachi extends ScoreTrackerAdapter {
|
|
|
67
163
|
xverse(): KamaiTachi;
|
|
68
164
|
}
|
|
69
165
|
export declare namespace KamaiTachi {
|
|
70
|
-
interface
|
|
166
|
+
interface IBaseResponse {
|
|
71
167
|
success: boolean;
|
|
72
168
|
description: string;
|
|
169
|
+
}
|
|
170
|
+
export interface ISuccessResponse<T> extends IBaseResponse {
|
|
171
|
+
success: true;
|
|
172
|
+
description: string;
|
|
73
173
|
body: T;
|
|
74
174
|
}
|
|
75
|
-
interface
|
|
175
|
+
export interface IFailureResponse extends IBaseResponse {
|
|
176
|
+
success: false;
|
|
177
|
+
description: string;
|
|
178
|
+
}
|
|
179
|
+
export type IResponse<T> = ISuccessResponse<T> | IFailureResponse;
|
|
180
|
+
export interface IChart {
|
|
76
181
|
chartID: string;
|
|
77
182
|
data: {
|
|
78
183
|
inGameID: number;
|
|
@@ -85,7 +190,7 @@ export declare namespace KamaiTachi {
|
|
|
85
190
|
songID: number;
|
|
86
191
|
versions: string[];
|
|
87
192
|
}
|
|
88
|
-
interface ISong {
|
|
193
|
+
export interface ISong {
|
|
89
194
|
altTitles: string[];
|
|
90
195
|
artist: string;
|
|
91
196
|
data: {
|
|
@@ -96,7 +201,7 @@ export declare namespace KamaiTachi {
|
|
|
96
201
|
searchTerms: string[];
|
|
97
202
|
title: string;
|
|
98
203
|
}
|
|
99
|
-
interface IScore {
|
|
204
|
+
export interface IScore {
|
|
100
205
|
chartID: string;
|
|
101
206
|
userID: number;
|
|
102
207
|
calculatedData: {
|
|
@@ -139,7 +244,7 @@ export declare namespace KamaiTachi {
|
|
|
139
244
|
timeAchieved: number;
|
|
140
245
|
service: string;
|
|
141
246
|
}
|
|
142
|
-
interface IPb {
|
|
247
|
+
export interface IPb {
|
|
143
248
|
chartID: string;
|
|
144
249
|
userID: number;
|
|
145
250
|
calculatedData: {
|
|
@@ -187,7 +292,7 @@ export declare namespace KamaiTachi {
|
|
|
187
292
|
scoreID: string;
|
|
188
293
|
}[];
|
|
189
294
|
}
|
|
190
|
-
enum EGameVersions {
|
|
295
|
+
export enum EGameVersions {
|
|
191
296
|
CHUNITHM_XVERSE = "CHUNITHM X-VERSE",
|
|
192
297
|
CHUNITHM_VERSE = "CHUNITHM VERSE",
|
|
193
298
|
CHUNITHM_LUMINOUS_PLUS = "CHUNITHM LUMINOUS PLUS",
|
|
@@ -218,5 +323,7 @@ export declare namespace KamaiTachi {
|
|
|
218
323
|
* @param b Game version.
|
|
219
324
|
* @returns positive if a is newer, negative if b is newer, 0 if they are the same.
|
|
220
325
|
*/
|
|
221
|
-
function compareGameVersions(a: EGameVersions, b: EGameVersions): number;
|
|
326
|
+
export function compareGameVersions(a: EGameVersions, b: EGameVersions): number;
|
|
327
|
+
export {};
|
|
222
328
|
}
|
|
329
|
+
export {};
|