r6-data.js 1.4.0 → 1.5.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/README.md +47 -4
- package/index.d.ts +92 -0
- package/methods/getGameStats.js +1 -0
- package/package.json +27 -3
- package/tsconfig.json +12 -0
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
# r6-data.js — Rainbow Six Siege (R6/R6S) Stats & Metadata API
|
|
2
|
+
|
|
2
3
|
Rainbow Six Siege API wrapper that gives infos about player's stats, maps, operators, ranks, seasons, charms etc. Last updated Y10S3
|
|
3
4
|
|
|
4
5
|
<div align="center">
|
|
@@ -14,9 +15,6 @@
|
|
|
14
15
|
|
|
15
16
|
## Installation
|
|
16
17
|
|
|
17
|
-
```sh
|
|
18
|
-
npm install r6-data.js
|
|
19
|
-
```
|
|
20
18
|
```sh
|
|
21
19
|
npm i r6-data.js
|
|
22
20
|
```
|
|
@@ -27,6 +25,51 @@ This is the website where you can directly track your stats and also check the a
|
|
|
27
25
|
|
|
28
26
|
Visit the official website: **[r6data.eu](https://r6data.eu/)**
|
|
29
27
|
|
|
28
|
+
## TypeScript Support
|
|
29
|
+
|
|
30
|
+
r6-data.js now includes full TypeScript support with complete type definitions! You can use it in TypeScript projects with full IntelliSense and type checking.
|
|
31
|
+
|
|
32
|
+
### TypeScript Import Examples
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// ES6 import syntax
|
|
36
|
+
import * as r6 from 'r6-data.js';
|
|
37
|
+
|
|
38
|
+
// Or import specific functions
|
|
39
|
+
import { getAccountInfo, getPlayerStats, getOperators } from 'r6-data.js';
|
|
40
|
+
|
|
41
|
+
// Import types for better type safety
|
|
42
|
+
import type { AccountInfoParams, PlayerStatsParams, PlatformType } from 'r6-data.js';
|
|
43
|
+
|
|
44
|
+
// Example usage with types
|
|
45
|
+
async function getPlayerData() {
|
|
46
|
+
const accountParams: AccountInfoParams = {
|
|
47
|
+
nameOnPlatform: 'PlayerName',
|
|
48
|
+
platformType: 'uplay' as PlatformType
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const accountInfo = await r6.getAccountInfo(accountParams);
|
|
52
|
+
console.log('Account info:', accountInfo);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### JavaScript (CommonJS) Import
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
// Traditional require syntax (still supported)
|
|
60
|
+
const r6 = require('r6-data.js');
|
|
61
|
+
|
|
62
|
+
// Example usage
|
|
63
|
+
async function getPlayerData() {
|
|
64
|
+
const accountInfo = await r6.getAccountInfo({
|
|
65
|
+
nameOnPlatform: 'PlayerName',
|
|
66
|
+
platformType: 'uplay'
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
console.log('Account info:', accountInfo);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
30
73
|
## Getting Player Account Information
|
|
31
74
|
|
|
32
75
|
The `getAccountInfo()` function allows you to retrieve player profile data from the official Rainbow Six Siege API. This function is specifically designed for retrieving account information such as player level, experience, clearance level, and profile settings.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// TypeScript declarations for r6-data.js (module-style, no ambient wrapper)
|
|
2
|
+
|
|
3
|
+
// ----- Types -----
|
|
4
|
+
export type PlatformType = "uplay" | "psn" | "xbl";
|
|
5
|
+
export type PlatformFamily = "pc" | "console";
|
|
6
|
+
export type BoardId = "casual" | "event" | "warmup" | "standard" | "ranked";
|
|
7
|
+
export type RankVersion = "v1" | "v2" | "v3" | "v4" | "v5" | "v6";
|
|
8
|
+
|
|
9
|
+
export interface AccountInfoParams {
|
|
10
|
+
nameOnPlatform: string;
|
|
11
|
+
platformType: PlatformType;
|
|
12
|
+
}
|
|
13
|
+
export interface PlayerStatsParams extends AccountInfoParams {
|
|
14
|
+
platform_families: PlatformFamily;
|
|
15
|
+
board_id?: BoardId;
|
|
16
|
+
}
|
|
17
|
+
export interface SeasonalStatsParams extends AccountInfoParams {}
|
|
18
|
+
|
|
19
|
+
export interface GetMapsParams {
|
|
20
|
+
name?: string; location?: string; releaseDate?: string; playlists?: string; mapReworked?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface GetOperatorsParams {
|
|
23
|
+
name?: string; safename?: string; realname?: string; birthplace?: string; age?: number; date_of_birth?: string; season_introduced?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface GetSeasonsParams {
|
|
26
|
+
name?: string; map?: string; operators?: string; weapons?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface GetAttachmentParams {
|
|
29
|
+
name?: string; style?: string; rarity?: string; availability?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GetCharmsParams {
|
|
32
|
+
name?: string; collection?: string; rarity?: string; availability?: string; bundle?: string; season?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface GetWeaponsParams { name?: string; }
|
|
35
|
+
export interface GetUniversalSkinsParams { name?: string; }
|
|
36
|
+
export interface GetRanksParams { version?: RankVersion; min_mmr?: number; max_mmr?: number; }
|
|
37
|
+
|
|
38
|
+
export interface SearchAllResult {
|
|
39
|
+
query: string;
|
|
40
|
+
summary: Record<string, number>;
|
|
41
|
+
results: {
|
|
42
|
+
operators: any[]; weapons: any[]; maps: any[]; seasons: any[]; charms: any[]; attachments: any[];
|
|
43
|
+
[k: string]: any;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface GameStats {
|
|
47
|
+
steam?: { concurrent?: number; estimate?: number };
|
|
48
|
+
crossPlatform?: { totalRegistered?: number; monthlyActive?: number; trendsEstimate?: number; platforms?: { pc?: number; playstation?: number; xbox?: number } };
|
|
49
|
+
ubisoft?: { onlineEstimate?: number };
|
|
50
|
+
lastUpdated?: string;
|
|
51
|
+
[k: string]: any;
|
|
52
|
+
}
|
|
53
|
+
export interface DiscordWebhookOptions {
|
|
54
|
+
playerName: string; title?: string; message?: string; color?: number; avatarUrl?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ----- Functions -----
|
|
58
|
+
export function getAccountInfo(params: AccountInfoParams): Promise<any>;
|
|
59
|
+
export function getPlayerStats(params: PlayerStatsParams): Promise<any>;
|
|
60
|
+
export function getSeasonalStats(params: SeasonalStatsParams): Promise<any>;
|
|
61
|
+
export function getServiceStatus(): Promise<any>;
|
|
62
|
+
export function getGameStats(): Promise<GameStats>;
|
|
63
|
+
export function getMaps(params?: GetMapsParams): Promise<any[]>;
|
|
64
|
+
export function getOperators(params?: GetOperatorsParams): Promise<any[]>;
|
|
65
|
+
export function getSeasons(params?: GetSeasonsParams): Promise<any[]>;
|
|
66
|
+
export function getAttachment(params?: GetAttachmentParams): Promise<any[]>;
|
|
67
|
+
export function getCharms(params?: GetCharmsParams): Promise<any[]>;
|
|
68
|
+
export function getWeapons(params?: GetWeaponsParams): Promise<any[]>;
|
|
69
|
+
export function getUniversalSkins(params?: GetUniversalSkinsParams): Promise<any[]>;
|
|
70
|
+
export function getRanks(params?: GetRanksParams): Promise<any[]>;
|
|
71
|
+
export function getSearchAll(query: string): Promise<SearchAllResult>;
|
|
72
|
+
export function createDiscordR6Webhook(webhookUrl: string, playerData: any, options: DiscordWebhookOptions): Promise<any>;
|
|
73
|
+
|
|
74
|
+
// ----- Default export -----
|
|
75
|
+
declare const r6Data: {
|
|
76
|
+
getAccountInfo: typeof getAccountInfo;
|
|
77
|
+
getPlayerStats: typeof getPlayerStats;
|
|
78
|
+
getSeasonalStats: typeof getSeasonalStats;
|
|
79
|
+
getServiceStatus: typeof getServiceStatus;
|
|
80
|
+
getGameStats: typeof getGameStats;
|
|
81
|
+
getMaps: typeof getMaps;
|
|
82
|
+
getOperators: typeof getOperators;
|
|
83
|
+
getSeasons: typeof getSeasons;
|
|
84
|
+
getAttachment: typeof getAttachment;
|
|
85
|
+
getCharms: typeof getCharms;
|
|
86
|
+
getWeapons: typeof getWeapons;
|
|
87
|
+
getUniversalSkins: typeof getUniversalSkins;
|
|
88
|
+
getRanks: typeof getRanks;
|
|
89
|
+
getSearchAll: typeof getSearchAll;
|
|
90
|
+
createDiscordR6Webhook: typeof createDiscordR6Webhook;
|
|
91
|
+
};
|
|
92
|
+
export default r6Data;
|
package/methods/getGameStats.js
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "r6-data.js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Rainbow Six Siege API wrapper for player's stats, maps, operators, ranks, seasons, charms etc. Last updated Y10S3",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"require": "./index.js",
|
|
9
|
+
"default": "./index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"index.js",
|
|
15
|
+
"index.d.ts",
|
|
16
|
+
"tsconfig.json",
|
|
17
|
+
"methods/",
|
|
18
|
+
"axiosInstance/",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
6
21
|
"scripts": {
|
|
7
|
-
"test": ""
|
|
22
|
+
"test": "node -e \"console.log('no tests yet')\"",
|
|
23
|
+
"lint": "eslint .",
|
|
24
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
8
25
|
},
|
|
9
26
|
"repository": {
|
|
10
27
|
"type": "git",
|
|
11
28
|
"url": "git+https://github.com/mazeor9/r6-data.js"
|
|
12
29
|
},
|
|
30
|
+
"homepage": "https://r6data.eu/",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/mazeor9/r6-data.js/issues"
|
|
33
|
+
},
|
|
34
|
+
"funding": "https://buymeacoffee.com/mazeor",
|
|
13
35
|
"keywords": [
|
|
14
36
|
"r6",
|
|
15
37
|
"rainbow six",
|
|
@@ -63,6 +85,8 @@
|
|
|
63
85
|
"ms": "^2.1.3"
|
|
64
86
|
},
|
|
65
87
|
"devDependencies": {
|
|
66
|
-
"@types/node": "^24.
|
|
88
|
+
"@types/node": "^24.8.0",
|
|
89
|
+
"eslint": "^9.37.0",
|
|
90
|
+
"typescript": "^5.9.3"
|
|
67
91
|
}
|
|
68
92
|
}
|