r6-data.js 1.5.2 → 1.5.4
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 +15 -32
- package/index.js +18 -2
- package/package.json +4 -1
- package/tsconfig.json +4 -4
package/README.md
CHANGED
|
@@ -27,47 +27,30 @@ Visit the official website: **[r6data.eu](https://r6data.eu/)**
|
|
|
27
27
|
|
|
28
28
|
## TypeScript Support
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### TypeScript Import Examples
|
|
30
|
+
Full TypeScript support with complete type definitions and IntelliSense.
|
|
33
31
|
|
|
34
32
|
```typescript
|
|
35
|
-
// ES6
|
|
33
|
+
// ES6 imports
|
|
36
34
|
import * as r6 from 'r6-data.js';
|
|
35
|
+
import { getAccountInfo, AccountInfoParams, PlatformType } from 'r6-data.js';
|
|
37
36
|
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
```
|
|
37
|
+
// Usage with types
|
|
38
|
+
const params: AccountInfoParams = {
|
|
39
|
+
nameOnPlatform: 'PlayerName',
|
|
40
|
+
platformType: 'uplay' as PlatformType
|
|
41
|
+
};
|
|
55
42
|
|
|
56
|
-
|
|
43
|
+
const accountInfo = await r6.getAccountInfo(params);
|
|
44
|
+
```
|
|
57
45
|
|
|
58
46
|
```javascript
|
|
59
|
-
//
|
|
47
|
+
// CommonJS (still supported)
|
|
60
48
|
const r6 = require('r6-data.js');
|
|
61
49
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
platformType: 'uplay'
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
console.log('Account info:', accountInfo);
|
|
70
|
-
}
|
|
50
|
+
const accountInfo = await r6.getAccountInfo({
|
|
51
|
+
nameOnPlatform: 'PlayerName',
|
|
52
|
+
platformType: 'uplay'
|
|
53
|
+
});
|
|
71
54
|
```
|
|
72
55
|
|
|
73
56
|
## Getting Player Account Information
|
package/index.js
CHANGED
|
@@ -14,7 +14,8 @@ const createDiscordR6Webhook = require('./methods/createDiscordR6Webhook');
|
|
|
14
14
|
const getGameStats = require('./methods/getGameStats');
|
|
15
15
|
const getSeasonalStats = require('./methods/getSeasonalStats');
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// Export individual functions for named imports
|
|
18
|
+
module.exports = {
|
|
18
19
|
getMaps,
|
|
19
20
|
getOperators,
|
|
20
21
|
getRanks,
|
|
@@ -32,4 +33,19 @@ const r6Data = {
|
|
|
32
33
|
getSeasonalStats,
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
// Export individual functions as named exports for ES6 compatibility
|
|
37
|
+
module.exports.getMaps = getMaps;
|
|
38
|
+
module.exports.getOperators = getOperators;
|
|
39
|
+
module.exports.getRanks = getRanks;
|
|
40
|
+
module.exports.getSeasons = getSeasons;
|
|
41
|
+
module.exports.getServiceStatus = getServiceStatus;
|
|
42
|
+
module.exports.getAttachment = getAttachment;
|
|
43
|
+
module.exports.getCharms = getCharms;
|
|
44
|
+
module.exports.getWeapons = getWeapons;
|
|
45
|
+
module.exports.getUniversalSkins = getUniversalSkins;
|
|
46
|
+
module.exports.getSearchAll = getSearchAll;
|
|
47
|
+
module.exports.getAccountInfo = getAccountInfo;
|
|
48
|
+
module.exports.getPlayerStats = getPlayerStats;
|
|
49
|
+
module.exports.createDiscordR6Webhook = createDiscordR6Webhook;
|
|
50
|
+
module.exports.getGameStats = getGameStats;
|
|
51
|
+
module.exports.getSeasonalStats = getSeasonalStats;
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "r6-data.js",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "R6 (Rainbow Six Siege) API wrapper for player stats, operators, maps, ranks, seasons, and game data. Typescript support. Last Updated Y10S3",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"module": "index.js",
|
|
6
7
|
"exports": {
|
|
7
8
|
".": {
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"import": "./index.js",
|
|
8
11
|
"require": "./index.js",
|
|
9
12
|
"default": "./index.js"
|
|
10
13
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES2020",
|
|
4
|
-
"module": "
|
|
5
|
-
"moduleResolution": "
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
6
|
"esModuleInterop": true,
|
|
7
7
|
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"resolveJsonModule": true,
|
|
8
9
|
"strict": true,
|
|
9
10
|
"skipLibCheck": true,
|
|
10
11
|
"forceConsistentCasingInFileNames": true,
|
|
@@ -12,8 +13,7 @@
|
|
|
12
13
|
"declarationMap": true,
|
|
13
14
|
"outDir": "./dist",
|
|
14
15
|
"rootDir": "./",
|
|
15
|
-
"lib": ["ES2020"]
|
|
16
|
-
"types": ["node"]
|
|
16
|
+
"lib": ["ES2020"]
|
|
17
17
|
},
|
|
18
18
|
"include": [
|
|
19
19
|
"index.js",
|