@wise-old-man/utils 2.1.19 → 2.2.1
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/index.d.ts +9 -2
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,6 @@ export type Competition = {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
type Prisma_Base_Delta = {
|
|
27
|
-
id: number
|
|
28
27
|
playerId: number
|
|
29
28
|
period: Period
|
|
30
29
|
startedAt: Date
|
|
@@ -2144,6 +2143,14 @@ declare class PlayersClient extends BaseAPIClient {
|
|
|
2144
2143
|
* @returns A list of snapshots.
|
|
2145
2144
|
*/
|
|
2146
2145
|
getPlayerSnapshots(username: string, options?: TimeRangeFilter): Promise<FormattedSnapshot[]>;
|
|
2146
|
+
/**
|
|
2147
|
+
* Fetches all of the player's past snapshots' timeline.
|
|
2148
|
+
* @returns A list of timeseries data (value, date)
|
|
2149
|
+
*/
|
|
2150
|
+
getPlayerSnapshotTimeline(username: string, metric: Metric, options?: TimeRangeFilter): Promise<{
|
|
2151
|
+
value: number;
|
|
2152
|
+
date: Date;
|
|
2153
|
+
}[]>;
|
|
2147
2154
|
/**
|
|
2148
2155
|
* Fetches all of the player's approved name changes.
|
|
2149
2156
|
* @returns A list of name changes.
|
|
@@ -2254,7 +2261,7 @@ interface WOMClientOptions {
|
|
|
2254
2261
|
userAgent?: string;
|
|
2255
2262
|
baseAPIUrl?: string;
|
|
2256
2263
|
}
|
|
2257
|
-
declare class WOMClient {
|
|
2264
|
+
declare class WOMClient extends BaseAPIClient {
|
|
2258
2265
|
deltas: DeltasClient;
|
|
2259
2266
|
groups: GroupsClient;
|
|
2260
2267
|
players: PlayersClient;
|
package/dist/index.js
CHANGED
|
@@ -408,6 +408,13 @@ class PlayersClient extends BaseAPIClient {
|
|
|
408
408
|
getPlayerSnapshots(username, options) {
|
|
409
409
|
return this.getRequest(`/players/${username}/snapshots`, options);
|
|
410
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* Fetches all of the player's past snapshots' timeline.
|
|
413
|
+
* @returns A list of timeseries data (value, date)
|
|
414
|
+
*/
|
|
415
|
+
getPlayerSnapshotTimeline(username, metric, options) {
|
|
416
|
+
return this.getRequest(`/players/${username}/snapshots/timeline`, Object.assign(Object.assign({}, options), { metric }));
|
|
417
|
+
}
|
|
411
418
|
/**
|
|
412
419
|
* Fetches all of the player's approved name changes.
|
|
413
420
|
* @returns A list of name changes.
|
|
@@ -2518,7 +2525,7 @@ class CompetitionsClient extends BaseAPIClient {
|
|
|
2518
2525
|
}
|
|
2519
2526
|
}
|
|
2520
2527
|
|
|
2521
|
-
class WOMClient {
|
|
2528
|
+
class WOMClient extends BaseAPIClient {
|
|
2522
2529
|
constructor(options) {
|
|
2523
2530
|
const headers = {
|
|
2524
2531
|
'x-user-agent': (options === null || options === void 0 ? void 0 : options.userAgent) || config.defaultUserAgent
|
|
@@ -2530,6 +2537,7 @@ class WOMClient {
|
|
|
2530
2537
|
baseURL: (options === null || options === void 0 ? void 0 : options.baseAPIUrl) || config.baseAPIUrl,
|
|
2531
2538
|
headers
|
|
2532
2539
|
});
|
|
2540
|
+
super(axiosInstance);
|
|
2533
2541
|
this.deltas = new DeltasClient(axiosInstance);
|
|
2534
2542
|
this.groups = new GroupsClient(axiosInstance);
|
|
2535
2543
|
this.players = new PlayersClient(axiosInstance);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise-old-man/utils",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "A JavaScript/TypeScript client that interfaces and consumes the Wise Old Man API, an API that tracks and measures players' progress in Old School Runescape.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wiseoldman",
|