├── .eslintrc.json
├── .github
└── ISSUE_TEMPLATE
│ ├── BUG_REPORT.yml
│ ├── FEATURE_REQUEST.yml
│ └── config.yml
├── .gitignore
├── .prettierignore
├── .prettierrc
├── LICENSE
├── README.md
├── SECURITY.md
├── TODO.md
├── jest.config.js
├── package.json
├── packages
└── @valapi
│ ├── auth
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── __tests__
│ │ │ ├── client.ts
│ │ │ └── core.ts
│ │ ├── client
│ │ │ ├── Auth.ts
│ │ │ ├── AuthInstance.ts
│ │ │ └── AuthRequest.ts
│ │ ├── index.ts
│ │ └── utils
│ │ │ └── cookie.ts
│ ├── tsconfig.json
│ └── typedoc.json
│ ├── crosshair
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── __tests__
│ │ │ └── crosshair.ts
│ │ └── index.ts
│ ├── tsconfig.json
│ └── typedoc.json
│ ├── lib
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── __tests__
│ │ │ ├── region.ts
│ │ │ ├── resource.ts
│ │ │ ├── util.ts
│ │ │ └── version.ts
│ │ ├── client
│ │ │ ├── ValError.ts
│ │ │ └── ValRegion.ts
│ │ ├── index.ts
│ │ ├── resources
│ │ │ ├── CrosshairColor.ts
│ │ │ ├── CrosshairHexColor.ts
│ │ │ ├── ItemTypeId.ts
│ │ │ ├── Locale.ts
│ │ │ ├── QueueId.ts
│ │ │ └── Region.ts
│ │ └── utils
│ │ │ ├── ValEncryption.ts
│ │ │ └── ValVersion.ts
│ ├── tsconfig.json
│ └── typedoc.json
│ ├── riot-api
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── __tests__
│ │ │ ├── api.ts
│ │ │ └── region.ts
│ │ ├── client
│ │ │ ├── RiotApi.ts
│ │ │ ├── RiotApiRegionURL.ts
│ │ │ └── RiotApiService.ts
│ │ ├── index.ts
│ │ └── service
│ │ │ ├── AccountV1.ts
│ │ │ ├── ContentV1.ts
│ │ │ ├── MatchV1.ts
│ │ │ ├── RankedV1.ts
│ │ │ └── StatusV1.ts
│ ├── tsconfig.json
│ └── typedoc.json
│ ├── valorant-api.com
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── __tests__
│ │ │ └── api.ts
│ │ ├── client
│ │ │ ├── ValorantApiCom.ts
│ │ │ └── ValorantApiComService.ts
│ │ ├── index.ts
│ │ └── service
│ │ │ ├── Agents.ts
│ │ │ ├── Buddies.ts
│ │ │ ├── Bundles.ts
│ │ │ ├── Ceremonies.ts
│ │ │ ├── CompetitiveTiers.ts
│ │ │ ├── ContentTiers.ts
│ │ │ ├── Contracts.ts
│ │ │ ├── Currencies.ts
│ │ │ ├── Events.ts
│ │ │ ├── Gamemodes.ts
│ │ │ ├── Gear.ts
│ │ │ ├── Internal.ts
│ │ │ ├── LevelBorders.ts
│ │ │ ├── Maps.ts
│ │ │ ├── Missions.ts
│ │ │ ├── Objectives.ts
│ │ │ ├── PlayerCards.ts
│ │ │ ├── PlayerTitles.ts
│ │ │ ├── Seasons.ts
│ │ │ ├── Sprays.ts
│ │ │ ├── Themes.ts
│ │ │ ├── Version.ts
│ │ │ └── Weapons.ts
│ ├── tsconfig.json
│ └── typedoc.json
│ └── web-client
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ ├── __tests__
│ │ ├── api.ts
│ │ └── region.ts
│ ├── client
│ │ ├── WebClient.ts
│ │ ├── WebClientRegionURL.ts
│ │ └── WebClientService.ts
│ ├── index.ts
│ └── service
│ │ ├── AccountXP.ts
│ │ ├── Configuration.ts
│ │ ├── Content.ts
│ │ ├── ContractDefinitions.ts
│ │ ├── Contracts.ts
│ │ ├── CoreGame.ts
│ │ ├── DailyTicket.ts
│ │ ├── Favorites.ts
│ │ ├── Latency.ts
│ │ ├── MMR.ts
│ │ ├── MassRewards.ts
│ │ ├── Match.ts
│ │ ├── NameService.ts
│ │ ├── Party.ts
│ │ ├── Personalization.ts
│ │ ├── PreGame.ts
│ │ ├── Premier.ts
│ │ ├── Restrictions.ts
│ │ ├── Session.ts
│ │ └── Store.ts
│ ├── tsconfig.json
│ └── typedoc.json
├── tsconfig.base.json
├── tsconfig.json
├── tsconfig.test.json
├── typedoc.base.json
└── typedoc.json
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "env": {
4 | "es6": true,
5 | "es2021": true,
6 | "node": true
7 | },
8 | "extends": [
9 | "eslint:recommended",
10 | "plugin:@typescript-eslint/recommended"
11 | ],
12 | "parser": "@typescript-eslint/parser",
13 | "parserOptions": {
14 | "ecmaVersion": "latest",
15 | "sourceType": "module"
16 | },
17 | "ignorePatterns": [
18 | "build",
19 | "*.js",
20 | "*.d.ts"
21 | ],
22 | "plugins": [
23 | "@typescript-eslint"
24 | ],
25 | "rules": {
26 | "@typescript-eslint/no-explicit-any": "off",
27 | "@typescript-eslint/no-namespace": "off",
28 | "@typescript-eslint/no-unused-vars": "warn",
29 |
30 | "no-console": "error",
31 | "no-debugger": "error",
32 | "no-var": "error",
33 | "no-eval": "error",
34 | "no-implied-eval": "error",
35 | "no-new-func": "error",
36 | "no-caller": "error",
37 | "no-delete-var": "error",
38 | "no-invalid-this": "error",
39 | "prefer-arrow-callback": "error",
40 | "prefer-const": "error",
41 | "prefer-template": "error",
42 |
43 | "semi": "warn",
44 | "new-cap": "warn",
45 | "spaced-comment": "warn",
46 | "brace-style": "warn",
47 | "curly": "warn",
48 | "guard-for-in": "warn",
49 | "no-empty-pattern": "warn",
50 | "no-new-wrappers": "warn",
51 | "valid-typeof": "warn"
52 | },
53 | "settings": {
54 | "allowDefinitionFiles": true
55 | }
56 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/BUG_REPORT.yml:
--------------------------------------------------------------------------------
1 | name: 'Bug Report'
2 | description: What is wrong or needs fixing?
3 | labels: ['bug']
4 | assignees: [ 'KTNG-3' ]
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | - Do not share your personal information (token, username, password)
10 | - Make sure it's an issue
11 | - type: textarea
12 | id: description
13 | attributes:
14 | label: 'Description'
15 | description: 'Explain your problem'
16 | render: Markdown
17 | validations:
18 | required: true
19 | - type: textarea
20 | id: code
21 | attributes:
22 | label: 'Code'
23 | description: 'Example of your code'
24 | render: TypeScript
25 | validations:
26 | required: true
27 | - type: textarea
28 | id: error
29 | attributes:
30 | label: 'Error'
31 | description: 'The error that you get'
32 | validations:
33 | required: false
34 | - type: input
35 | id: platform
36 | attributes:
37 | label: 'Platform'
38 | placeholder: 'e.g. Windows 10, repl.it'
39 | - type: input
40 | id: nodejs
41 | attributes:
42 | label: 'Node.js Version'
43 | description: 'node --version'
44 | placeholder: 'e.g. 18.14.0'
45 | - type: input
46 | id: valapi
47 | attributes:
48 | label: '@valapi Version'
49 | description: 'npm --version @valapi/lib'
50 | placeholder: 'e.g. 1.4.2'
51 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml:
--------------------------------------------------------------------------------
1 | name: 'Feature Request'
2 | description: I need something new
3 | labels: [ enhancement, question ]
4 | assignees: [ 'KTNG-3' ]
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | - Do not share your personal information (token, username, password)
10 | - type: textarea
11 | id: description
12 | attributes:
13 | label: 'What do you need?'
14 | description: 'Explain what is your need, is that problem?'
15 | render: Markdown
16 | validations:
17 | required: true
18 | - type: textarea
19 | id: code
20 | attributes:
21 | label: 'Code'
22 | description: 'Example of your code'
23 | render: TypeScript
24 | validations:
25 | required: false
26 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Discord Server
4 | about: 'Q & A'
5 | url: 'https://discord.gg/pbyWbUYjyt'
6 | - name: 'Documentation'
7 | about: 'Generated Documentation'
8 | url: 'https://valapi.github.io/guide'
9 | - name: 'Guide'
10 | about: 'Basic usage'
11 | url: 'https://valapi.github.io/guide'
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .git/
2 |
3 | # nodejs
4 | npm-debug.log*
5 | package-lock.json
6 | node_modules/
7 |
8 | # env
9 | .env
10 | .env.development.local
11 | .env.test.local
12 | .env.production.local
13 | .env.local
14 |
15 | # vscode
16 | .vscode/
17 |
18 | # log
19 | logs
20 | *.log
21 | npm-debug.log*
22 |
23 | # temp, cache
24 | .npm
25 | .eslintcache
26 | *.tgz
27 | *.tsbuildinfo
28 |
29 | *.cache
30 | cache/
31 |
32 | *.tmp
33 | *.temp
34 | temp/
35 |
36 | # project
37 | build/
38 | docs/
39 |
40 | # test
41 | test/
42 | tests/
43 |
44 | coverage/
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .git/
2 |
3 | # nodejs
4 | npm-debug.log*
5 | package.json
6 |
7 | # log
8 | logs
9 | *.log
10 | npm-debug.log*
11 |
12 | # temp, cache
13 | .npm
14 | .eslintcache
15 | *.tgz
16 | *.tsbuildinfo
17 |
18 | # project
19 | LICENSE
20 |
21 | build/
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 200,
3 | "tabWidth": 4,
4 | "singleQuote": false,
5 | "trailingComma": "none",
6 | "arrowParens": "avoid"
7 | }
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Ing Project
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [githubrepo_image]: https://github.com/valapi/.github/blob/main/128_valapi.png?raw=true
2 | [githubrepo_url]: https://github.com/valapi
3 | [license_image]: https://badgen.net/badge/license/MIT/blue
4 | [license_url]: https://github.com/valapi/.github/blob/main/LICENSE
5 | [github_image]: https://badgen.net/badge/icon/github?icon=github&label
6 | [github_url]: https://github.com/valapi/node-valapi
7 | [discord_image]: https://badgen.net/badge/icon/discord?icon=discord&label
8 | [discord_url]: https://discord.gg/pbyWbUYjyt
9 |
10 |
11 |
12 | # node-valapi
13 |
14 | [![Profile][githubrepo_image]][github_url]
15 |
16 | NodeJS packages that make more easier to use Valorant API
17 |
18 | [![LICENSE][license_image]][license_url]
19 | [![Github][github_image]][github_url]
20 | [![Discord][discord_image]][discord_url]
21 |
22 | Documentation: [valapi.github.io/docs](https://valapi.github.io/docs)
23 |
24 | Guide: [valapi.github.io/guide](https://valapi.github.io/guide)
25 |
26 |
27 |
28 | ---
29 |
30 | > - **node-valapi** isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
31 | > - **node-valapi** was created under [Riot Games' "Legal Jibber Jabber"](https://www.riotgames.com/en/legal) policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.
32 | > - [MIT License][license_url]
33 |
34 | ## Projects
35 |
36 | - [@valapi/auth](./packages/@valapi/auth)
37 | - [@valapi/crosshair](./packages/@valapi/crosshair)
38 | - [@valapi/lib](./packages/@valapi/lib)
39 | - [@valapi/riot-api](./packages/@valapi/riot-api)
40 | - [@valapi/valorant-api.com](./packages/@valapi/valorant-api.com)
41 | - [@valapi/web-client](./packages/@valapi/web-client)
42 |
43 | ## Release
44 |
45 | ```bash
46 | npm run build
47 | ```
48 |
49 | ```bash
50 | npm publish --workspaces
51 | ```
52 |
53 | Delete compiled files *(after build)*
54 |
55 | ```bash
56 | npm run clean
57 | ```
58 |
59 | ## Testing
60 |
61 | ```bash
62 | npm run test
63 | ```
64 |
65 | **dotenv**
66 |
67 | Regions: [valapi.github.io/guide/lib/region](https://valapi.github.io/guide/packages/lib/region.html)
68 |
69 | ```dosini
70 | # multi-factor must be "disable"
71 | VAL_REGION="na"
72 | VAL_USER="RiotUsername"
73 | VAL_PASS="Passowrd"
74 |
75 | # https://developer.riotgames.com
76 | VAL_RIOT_API="API_KEY_123"
77 | ```
78 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security
2 |
3 | ## Reporting a bug
4 |
5 | If you have a security issue please report it to our maintainer
6 |
7 | ## Contact
8 |
9 | - Mail: kawinth.ingproject@gmail.com
10 | - Discord: kawtn_
11 | - Discord Server: https://discord.gg/pbyWbUYjyt
--------------------------------------------------------------------------------
/TODO.md:
--------------------------------------------------------------------------------
1 | ### Package
2 |
3 | | Name | Progression |
4 | | ---------- | ----------- |
5 | | Rate Limit | Missing |
6 |
7 | **@/crosshair**
8 |
9 | | Type | Name | Progression |
10 | | ----- | ------------ | ----------- |
11 | | Utils | ValCrosshair | Pre-alpha |
12 |
13 | ### Typescript
14 |
15 | **@/web-client**
16 |
17 | | Type | Name | Progression |
18 | | ------- | ------------------- | ----------- |
19 | | Service | AccountXP | Done |
20 | | Service | Config | Done |
21 | | Service | Content | Not Done |
22 | | Service | ContractDefinitions | Not Done |
23 | | Service | Contracts | Not Done |
24 | | Service | CoreGame | Not Done |
25 | | Service | DailyTicket | Done |
26 | | Service | DisplayNameService | Done |
27 | | Service | Favorites | Done |
28 | | Service | Latency | Done |
29 | | Service | MassRewards | Done |
30 | | Service | Match | Not Done |
31 | | Service | MMR | Done |
32 | | Service | Party | Missing |
33 | | Service | Personalization | Not Done |
34 | | Service | PreGame | Not Done |
35 | | Service | Premier | Missing |
36 | | Service | Restrictions | Not Done |
37 | | Service | Session | Done |
38 | | Service | Store | Done |
39 |
40 | -----------
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('ts-jest').JestConfigWithTsJest} */
2 | module.exports = {
3 | transform: {
4 | "^.+\\.tsx?$": [
5 | "ts-jest",
6 | {
7 | tsconfig: "tsconfig.test.json"
8 | },
9 | ],
10 | },
11 | testEnvironment: "node",
12 | clearMocks: true,
13 | collectCoverage: true,
14 | coverageDirectory: "coverage",
15 | setupFiles: [
16 | "dotenv/config"
17 | ],
18 | // 3 minute
19 | testTimeout: 3 * 60 * 1000
20 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "workspaces": [
3 | "packages/@valapi/auth",
4 | "packages/@valapi/crosshair",
5 | "packages/@valapi/lib",
6 | "packages/@valapi/riot-api",
7 | "packages/@valapi/valorant-api.com",
8 | "packages/@valapi/web-client"
9 | ],
10 | "private": true,
11 | "name": "node-valapi",
12 | "version": "1.0.0",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/valapi/node-valapi.git"
16 | },
17 | "author": "ing3kth (https://github.com/KTNG-3)",
18 | "license": "MIT",
19 | "devDependencies": {
20 | "@types/bun": "^1.1.6",
21 | "@types/express": "^4.17.21",
22 | "@types/jest": "^29.5.12",
23 | "@types/node": "^22.1.0",
24 | "@typescript-eslint/eslint-plugin": "^7.7.1",
25 | "@typescript-eslint/parser": "^7.7.1",
26 | "dotenv": "^16.4.5",
27 | "eslint": "^8.57.0",
28 | "express": "^4.19.2",
29 | "jest": "29.7.0",
30 | "prettier": "^3.3.3",
31 | "rimraf": "^5.0.9",
32 | "ts-jest": "^29.2.4",
33 | "ts-node": "^10.9.2",
34 | "typedoc": "^0.26.5",
35 | "typescript": "^5.5.4"
36 | },
37 | "scripts": {
38 | "test": "jest --detectOpenHandles",
39 | "format": "prettier --config ./.prettierrc --ignore-path ./.prettierignore --write \"packages/**/*\"",
40 | "lint": "npx eslint packages",
41 | "compile": "npx tsc --build tsconfig.json",
42 | "compile:clean": "npm exec --workspaces -- rimraf \"build\" \"tsconfig.tsbuildinfo\"",
43 | "docs": "typedoc",
44 | "docs:clean": "rimraf \"docs\"",
45 | "clean": "npm run compile:clean && npm run docs:clean",
46 | "build": "npm run clean && npm run format && npm run lint && npm run compile"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 5.0.0-beta.2
2 |
3 | Fix serializer
4 |
5 | ### Typescript
6 |
7 | **Add**
8 |
9 | - `RequestConfig.certificate`
10 |
11 | # 5.0.0-beta.1
12 |
13 | **_[Blocked by Cloudflare #9](https://github.com/valapi/node-valapi/issues/9)_**
14 |
15 | **Add**
16 |
17 | - `AuthRequest.certificate`
18 | - `Auth.captcha()`
19 | - `Auth.multifactor(loginCode)`
20 |
21 | _utils_
22 |
23 | - `getResponseCookies(response)`
24 |
25 | _static_
26 |
27 | - `AuthRequest.newUserAgent(build, app?, os?)`
28 |
29 | _packages_
30 |
31 | - [x] `npmjs/selfsigned`
32 |
33 | **Change**
34 |
35 | - ~~`Auth.login(username, password)`~~ **-->** `Auth.login({ username, password, captcha })`
36 |
37 | ### Typescript
38 |
39 | **Add**
40 |
41 | - `RequestConfig.build`
42 | - `Config.sdk`
43 | - `AuthUserInfo.login_token`
44 |
45 | **Remove**
46 |
47 | - `RequestConfig.userAgent`
48 |
49 | # 5.0.0-beta.0
50 |
51 | **Change**
52 |
53 | - ~~`AuthInstance.fromJSON(user)`~~
54 | - **-->** `new AuthInstance(user?)`
55 | - **-->** `new Auth({ user })`
56 |
57 | ### Typescript
58 |
59 | **Change**
60 |
61 | - ~~`UserAuthInfo`~~ **-->** `AuthUserInfo`
62 | - ~~`AuthConfig`~~ **-->** `Config`
63 | - ~~`AuthPromiseResponse`~~ **-->** `PromiseResponse`
64 | - ~~`AuthResponse`~~ **-->** `Response`
65 | - ~~`AuthRequestPlatform`~~ **-->** `ClientPlatform`
66 | - ~~`AuthRequestConfig`~~ **-->** `RequestConfig`
67 |
68 | # 5.0.0-alpha.0
69 |
70 | **Add**
71 |
72 | - `AuthRequest`
73 |
74 | **Change**
75 |
76 | - ~~`AuthClient`~~ **-->** `Auth`
77 | - ~~`AuthClient.refresh()`~~ **-->** `Auth.reauthorize()`
78 | - ~~`AuthService.fromUrl(TokenUrl)`~~ **-->** `Auth.uriTokenization(url)`
79 | - ~~`AuthService.fromToken(token)`~~
80 | - **-->** `Auth.entitlementsTokenization()`
81 | - **-->** `Auth.regionTokenization()`
82 | - ~~`Cookie.authorize()`~~ **-->** `Auth.authorize(ignoreCookie = false)`
83 | - ~~`User.loginform(username, password)`~~ **-->** `Auth.login(username, password)`
84 | - ~~`AuthCore`~~ **-->** `AuthInstance`
85 | - ~~`AuthCore.getSubject(token)`~~ **-->** `AuthInstance.subject`
86 | - ~~`AuthCore.getExpirationDate(token)`~~ **-->** `AuthInstance.expirationDate`
87 | - ~~`AuthCore.authenticationInfo.isMultifactor`~~ **-->** `AuthInstance.isMultifactor`
88 |
89 | **Remove**
90 |
91 | - `AuthClient.verify()`
92 | - `AuthClient.fromCookie()`
93 | - `AuthService`
94 | - `Cookie`
95 | - `Multifactor`
96 | - `User`
97 | - `AuthCore.authenticationInfo`
98 |
99 | _static_
100 |
101 | - `AuthClient.fromCookie()`
102 | - `AuthClient.fromJSON()`
103 | - `AuthCore.fromJSON()`
104 | - `AuthCore.Default`
105 | - `AuthService.fromJSON()`
106 |
107 | ### Typescript
108 |
109 | **Add**
110 |
111 | - `EntitlementsTokenResponse`
112 | - `RegionTokenResponse`
113 | - `UserTokenParse`
114 | - `AuthPromiseResponse`
115 | - `AuthResponse`
116 | - `AuthRequestConfig`
117 |
118 | **Change**
119 |
120 | - ~~`AuthService.TokenResponse`~~ **-->** `AuthRequestResponse`
121 | - ~~`AuthCore.Json`~~ **-->** `UserAuthInfo`
122 | - ~~`AuthCore.ClientPlatfrom`~~ **-->** `AuthRequestPlatfrom`
123 | - ~~`AuthCore.Config`~~ **-->** `AuthConfig`
124 |
125 | **Remove**
126 |
127 | - `AuthCore.JsonRegion`
128 | - `AuthCore.JsonAuthenticationInfoMessage`
129 | - `AuthCore.JsonAuthenticationInfo`
130 |
131 | # 3.2.1-beta
132 |
133 | **Add**
134 |
135 | - `.userAgent`
136 |
137 | **Change**
138 |
139 | - `.client.version` **-->** `.version`
140 | - `.client.platform` **-->** `.platform`
141 |
142 | # 3.2.0
143 |
144 | **Add**
145 |
146 | - `AuthCore.authenticationInfo`
147 |
148 | **Remove**
149 |
150 | - `AuthCore.isMultifactorAccount`
151 | - `AuthCore.isAuthenticationError`
152 |
153 | ### Typescript
154 |
155 | **Add**
156 |
157 | - `AuthCore.JsonRegion`
158 | - `AuthCore.JsonAuthenticationInfo`
159 | - `AuthCore.JsonAuthenticationInfoMessage`
160 |
161 | # 3.0.0
162 |
163 | **Add**
164 |
165 | - `AuthCore.getExpirationDate()`
166 | - `Cookie.authorize()`
167 |
168 | _static_
169 |
170 | - `AuthCore.expires_in`
171 | - `AuthCore.token_type`
172 |
173 | **Remove**
174 |
175 | - `AuthCore.build()`
176 | - `Auth`
177 |
178 | **Change**
179 |
180 | - ~~`new AuthService(options)`~~ **-->** `new AuthService(options, data)`
181 | - ~~`Auth.fromToken()`~~ **-->** `AuthService.fromToken()`
182 | - ~~`Auth.fromUrl()`~~ **-->** `AuthService.fromUrl()`
183 | - ~~`Auth.fromResponse()`~~ **-->** `AuthService.fromResponse()`
184 | - ~~`Cookie.reAuthorize()`~~ **-->** `Cookie.reauthorize()`
185 | - ~~`Multifactor.twoFactor()`~~ **-->** `Multifactor.twofactor()`
186 | - ~~`User.loginForm()`~~ **-->** `User.loginform()`
187 |
188 | ### Typescript
189 |
190 | **Remove**
191 |
192 | - `ValError`
193 | - `AuthCore.BuildConfig`
194 |
195 | **Change**
196 |
197 | - ~~`AuthCore.Options`~~ **-->** `AuthCore.Config`
198 | - ~~`Auth.TokenResponse`~~ **-->** `AuthService.TokenResponse`
199 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022-2024 Ing Project
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/README.md:
--------------------------------------------------------------------------------
1 | [githubrepo_image]: https://github.com/valapi/.github/blob/main/128_valapi.png?raw=true
2 | [githubrepo_url]: https://github.com/valapi
3 | [download_image]: https://badgen.net/npm/dt/@valapi/auth?icon=npm
4 | [download_url]: https://www.npmjs.com/package/@valapi/auth
5 | [size_image]: https://packagephobia.com/badge?p=@valapi/auth
6 | [size_url]: https://packagephobia.com/result?p=@valapi/auth
7 | [vulnerabilities_image]: https://snyk.io/test/npm/@valapi/auth/badge.svg
8 | [vulnerabilities_url]: https://snyk.io/test/npm/@valapi/auth
9 | [license_image]: https://badgen.net/badge/license/MIT/blue
10 | [license_url]: https://github.com/valapi/.github/blob/main/LICENSE
11 | [github_image]: https://badgen.net/badge/icon/github?icon=github&label
12 | [github_url]: https://github.com/valapi/node-valapi/tree/master/packages/@valapi/auth
13 | [discord_image]: https://badgen.net/badge/icon/discord?icon=discord&label
14 | [discord_url]: https://discord.gg/pbyWbUYjyt
15 |
16 |
17 |
18 | # Valorant API - Authentication
19 |
20 | [![Profile][githubrepo_image]][github_url]
21 |
22 | Valorant Authentication
23 |
24 | [![Downloads][download_image]][download_url]
25 | [![install size][size_image]][size_url]
26 | [![Known Vulnerabilities][vulnerabilities_image]][vulnerabilities_url]
27 |
28 | [![LICENSE][license_image]][license_url]
29 | [![Github][github_image]][github_url]
30 | [![Discord][discord_image]][discord_url]
31 |
32 | Documentation: [valapi.github.io/docs](https://valapi.github.io/docs)
33 |
34 | Guide: [valapi.github.io/guide](https://valapi.github.io/guide)
35 |
36 |
37 |
38 | ---
39 |
40 | > - **@valapi/auth** isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
41 | > - **@valapi/auth** was created under [Riot Games' "Legal Jibber Jabber"](https://www.riotgames.com/en/legal) policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.
42 | > - [MIT License][license_url]
43 |
44 | ## Installation
45 |
46 | **NPM:**
47 |
48 | ```bash
49 | npm install @valapi/auth
50 | ```
51 |
52 | **PNPM:**
53 |
54 | ```bash
55 | pnpm add @valapi/auth
56 | ```
57 |
58 | ## Guide
59 |
60 | ```typescript
61 | import { Auth } from "@valapi/auth";
62 | ```
63 |
64 | ```typescript
65 | const auth = new Auth();
66 | ```
67 |
68 | ### Captcha
69 |
70 | _This is only an example function_
71 |
72 | ```typescript
73 | const data = await auth.captcha();
74 |
75 | const captchaResponse = await getCaptchaResponse(data); // P1_eyJ...
76 | ```
77 |
78 | ### Auth
79 |
80 | ```typescript
81 | await auth.login({
82 | username: "BestUsername",
83 | password: "SuperSecretPassword",
84 | captcha: captchaResponse
85 | });
86 | ```
87 |
88 | ```typescript
89 | if (auth.isMultifactor) {
90 | const loginCode = 428793;
91 |
92 | await auth.multifactor(loginCode);
93 | }
94 | ```
95 |
96 | **Subject** (PlayerUUID)
97 |
98 | ```typescript
99 | const subject = auth.subject;
100 | ```
101 |
102 | **Serialize**
103 |
104 | ```typescript
105 | const auth = new Auth({ user: oldAuth.toJSON() });
106 |
107 | if (!auth.isAuthenticated) {
108 | await auth.reauthorize();
109 | }
110 | ```
111 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@valapi/auth",
3 | "version": "5.0.0-beta.2",
4 | "publishConfig": {
5 | "registry": "https://registry.npmjs.org",
6 | "access": "public"
7 | },
8 | "description": "Valorant API - Authentication",
9 | "keywords": [
10 | "riot",
11 | "api",
12 | "val",
13 | "valorant",
14 | "authentication",
15 | "multifactor",
16 | "twofactor"
17 | ],
18 | "main": "build/index.js",
19 | "types": "./build/index.d.ts",
20 | "repository": {
21 | "type": "git",
22 | "url": "git+https://github.com/valapi/node-valapi.git",
23 | "directory": "packages/@valapi/auth"
24 | },
25 | "author": "ing3kth (https://github.com/KTNG-3)",
26 | "license": "MIT",
27 | "bugs": {
28 | "url": "https://github.com/valapi/node-valapi/issues"
29 | },
30 | "homepage": "https://valapi.github.io/guide",
31 | "dependencies": {
32 | "@valapi/lib": "5.0.0-beta.2",
33 | "axios": "^1.7.3",
34 | "http-cookie-agent": "^6.0.5",
35 | "selfsigned": "^2.4.1",
36 | "tough-cookie": "^4.1.4"
37 | },
38 | "devDependencies": {
39 | "@types/tough-cookie": "^4.0.5"
40 | },
41 | "directories": {
42 | "lib": "build",
43 | "test": "src/__tests__"
44 | },
45 | "files": [
46 | "build",
47 | "CHANGELOG.md",
48 | "LICENSE",
49 | "package.json",
50 | "README.md",
51 | "SECURITY.md"
52 | ]
53 | }
54 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/src/__tests__/client.ts:
--------------------------------------------------------------------------------
1 | import { env } from "node:process";
2 | import { randomBytes } from "node:crypto";
3 |
4 | import type { Region } from "@valapi/lib";
5 |
6 | import { Auth } from "../index";
7 |
8 | describe("auth.client", () => {
9 | const auth = new Auth();
10 |
11 | test("empty_reauth", async () => {
12 | await expect(auth.reauthorize()).rejects.toThrow();
13 | });
14 |
15 | test("login", async () => {
16 | await auth.login(env.VAL_USER, env.VAL_PASS);
17 |
18 | expect(auth.isMultifactor).toBe(false);
19 | expect(auth.isAuthenticated).toBe(true);
20 | });
21 |
22 | test("error", async () => {
23 | const errorAuth = new Auth({
24 | platform: {
25 | platformChipset: "",
26 | platformOS: "",
27 | platformOSVersion: "",
28 | platformType: ""
29 | },
30 | version: ""
31 | });
32 |
33 | await expect(errorAuth.login(randomBytes(10).toString("hex"), randomBytes(15).toString("hex"))).rejects.toThrow();
34 | });
35 |
36 | test("region", async () => {
37 | await expect(auth.regionTokenization()).resolves.toBe(env.VAL_REGION);
38 | });
39 |
40 | test("reauth", async () => {
41 | const cookieAuth = new Auth({
42 | user: {
43 | ...new Auth().toJSON(),
44 | ...{
45 | cookie: auth.cookie.toJSON()
46 | }
47 | }
48 | });
49 |
50 | await cookieAuth.reauthorize();
51 |
52 | expect(cookieAuth.isMultifactor).toBe(false);
53 | expect(cookieAuth.subject).toBe(auth.subject);
54 | expect(cookieAuth.cookie.serializeSync()).not.toStrictEqual(auth.cookie.serializeSync());
55 | });
56 | });
57 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/src/__tests__/core.ts:
--------------------------------------------------------------------------------
1 | import { CookieJar } from "tough-cookie";
2 |
3 | import { AuthInstance } from "@valapi/auth";
4 | import type { AuthUserInfo } from "@valapi/auth";
5 |
6 | describe("auth.core", () => {
7 | const auth = new AuthInstance();
8 |
9 | test("new", () => {
10 | expect(auth.toJSON()).toMatchObject({
11 | cookie: new CookieJar().serializeSync(),
12 | isMultifactor: false,
13 | access_token: "",
14 | id_token: "",
15 | session_state: "",
16 | entitlements_token: ""
17 | });
18 |
19 | expect(auth.subject).toBe("");
20 | expect(auth.isAuthenticated).toBe(false);
21 | });
22 |
23 | test("save", () => {
24 | const exportAuth = new AuthInstance(auth.toJSON());
25 |
26 | expect(exportAuth.toJSON()).toStrictEqual(auth.toJSON());
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/src/client/AuthInstance.ts:
--------------------------------------------------------------------------------
1 | import { CookieJar } from "tough-cookie";
2 |
3 | import { ValEncryption } from "@valapi/lib";
4 |
5 | export interface AuthUserInfo {
6 | cookie: CookieJar.Serialized;
7 | isMultifactor: boolean;
8 | login_token: string;
9 | access_token: string;
10 | id_token: string;
11 | session_state: string;
12 | entitlements_token: string;
13 | }
14 |
15 | interface UserTokenParse {
16 | sub: string;
17 | exp: number;
18 | }
19 |
20 | export class AuthInstance implements Omit {
21 | public cookie: CookieJar = new CookieJar();
22 | public isMultifactor: boolean = false;
23 |
24 | public login_token: string = "";
25 | public access_token: string = "";
26 | public id_token: string = "";
27 | public session_state: string = "";
28 | public entitlements_token: string = "";
29 |
30 | public subject: string = "";
31 | public expirationDate: Date = new Date(-1);
32 |
33 | public get isAuthenticated() {
34 | return new Date() < this.expirationDate && Boolean(this.access_token) && Boolean(this.entitlements_token);
35 | }
36 |
37 | public constructor(user?: AuthUserInfo) {
38 | if (!user) {
39 | return;
40 | }
41 |
42 | this.cookie = CookieJar.deserializeSync(user.cookie);
43 | this.isMultifactor = user.isMultifactor;
44 |
45 | this.login_token = user.login_token;
46 | this.access_token = user.access_token;
47 | this.id_token = user.id_token;
48 | this.session_state = user.session_state;
49 | this.entitlements_token = user.entitlements_token;
50 |
51 | this.getTokenInfo();
52 | }
53 |
54 | protected getTokenInfo() {
55 | if (!this.access_token) {
56 | return;
57 | }
58 |
59 | const parseToken: UserTokenParse = ValEncryption.decryptJson(this.access_token.split(".")[1]);
60 |
61 | this.subject = parseToken.sub;
62 | this.expirationDate = new Date(parseToken.exp * 1000);
63 | }
64 |
65 | public toJSON(): AuthUserInfo {
66 | return {
67 | cookie: this.cookie.serializeSync(),
68 | isMultifactor: this.isMultifactor,
69 | login_token: this.login_token,
70 | access_token: this.access_token,
71 | id_token: this.id_token,
72 | session_state: this.session_state,
73 | entitlements_token: this.entitlements_token
74 | };
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/src/client/AuthRequest.ts:
--------------------------------------------------------------------------------
1 | import { createSecureContext, type SecureContextOptions } from "node:tls";
2 | import type { Agent, AgentOptions } from "node:https";
3 |
4 | import axios, { AxiosHeaders } from "axios";
5 | import type { AxiosRequestConfig, AxiosResponse, AxiosInstance } from "axios";
6 | import { HttpsCookieAgent } from "http-cookie-agent/http";
7 | import type { CookieAgent, CookieAgentOptions } from "http-cookie-agent/http";
8 | import type { CookieJar } from "tough-cookie";
9 | import * as selfsigned from "selfsigned";
10 |
11 | import { ValEncryption } from "@valapi/lib";
12 |
13 | export type PromiseResponse = Promise>;
14 | export type Response = AxiosResponse;
15 |
16 | export interface ClientPlatfrom {
17 | platformType: string;
18 | platformOS: string;
19 | platformOSVersion: string;
20 | platformChipset: string;
21 | }
22 |
23 | export interface RequestConfig {
24 | build?: string;
25 | version?: string;
26 | platform?: ClientPlatfrom;
27 | axiosConfig?: AxiosRequestConfig;
28 | agentConfig?: AgentOptions & CookieAgentOptions;
29 | certificate?: selfsigned.GenerateResult;
30 | cookie: CookieJar;
31 | }
32 |
33 | export class AuthRequest {
34 | public readonly certificate: selfsigned.GenerateResult;
35 | public readonly headers: AxiosHeaders;
36 | public readonly agent: CookieAgent;
37 |
38 | readonly defaultAxiosConfig: AxiosRequestConfig;
39 |
40 | constructor(config: RequestConfig) {
41 | const __config = >{
42 | ...{
43 | build: "91.0.2.1870.3774", // GET https://valorant-api.com/v1/version["data"]["riotClientBuild"]
44 | version: "release-09.00-shipping-28-2628993", // GET https://valorant-api.com/v1/version["data"]["riotClientVersion"]
45 | platform: {
46 | platformType: "PC",
47 | platformOS: "Windows",
48 | platformOSVersion: "10.0.19043.1.256.64bit",
49 | platformChipset: "Unknown"
50 | },
51 | axiosConfig: {
52 | withCredentials: true
53 | }
54 | },
55 | ...config
56 | };
57 |
58 | this.defaultAxiosConfig = __config.axiosConfig;
59 |
60 | this.certificate =
61 | __config.certificate ??
62 | selfsigned.generate([], {
63 | days: 30,
64 | pkcs7: true,
65 | clientCertificate: true,
66 | clientCertificateCN: ValEncryption.randomString(16)
67 | });
68 |
69 | this.headers = new AxiosHeaders()
70 | .setContentType("application/json")
71 | .setAccept("application/json")
72 | .setUserAgent(AuthRequest.newUserAgent(__config.build, "rso-auth"))
73 | .set({
74 | "X-Riot-ClientVersion": __config.version,
75 | "X-Riot-ClientPlatform": ValEncryption.encryptJson(__config.platform)
76 | });
77 |
78 | const ctx_options: SecureContextOptions = {
79 | cert: this.certificate.cert,
80 | sigalgs: [
81 | "ecdsa_secp256r1_sha256",
82 | "rsa_pss_rsae_sha256",
83 | "rsa_pkcs1_sha256",
84 | "ecdsa_secp384r1_sha384",
85 | "rsa_pss_rsae_sha384",
86 | "rsa_pkcs1_sha384",
87 | "rsa_pss_rsae_sha512",
88 | "rsa_pkcs1_sha512",
89 | "rsa_pkcs1_sha1"
90 | ].join(":"),
91 | ciphers: [
92 | "TLS_AES_128_GCM_SHA256",
93 | "TLS_CHACHA20_POLY1305_SHA256",
94 | "TLS_AES_256_GCM_SHA384",
95 | "TLS_AES_128_CCM_SHA256",
96 | "TLS_AES_128_CCM_8_SHA256",
97 | "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"
98 | ].join(":"),
99 | honorCipherOrder: true,
100 | key: this.certificate.private,
101 | maxVersion: "TLSv1.3",
102 | minVersion: "TLSv1.2"
103 | };
104 |
105 | this.agent = new HttpsCookieAgent({
106 | ...__config.agentConfig,
107 | ...ctx_options,
108 | ...{
109 | // #TcpSocketConnectOpts
110 | keepAlive: true,
111 |
112 | // #CommonConnectionOptions
113 | requestCert: false,
114 | secureContext: createSecureContext(ctx_options),
115 | rejectUnauthorized: false,
116 |
117 | // #CookieAgentOptions
118 | cookies: {
119 | jar: __config.cookie
120 | }
121 | }
122 | });
123 | }
124 |
125 | private get axiosConfig(): AxiosRequestConfig {
126 | return {
127 | ...this.defaultAxiosConfig,
128 | ...{
129 | httpsAgent: this.agent,
130 | headers: {
131 | ...this.defaultAxiosConfig.headers,
132 | ...this.headers.toJSON()
133 | }
134 | }
135 | };
136 | }
137 |
138 | public static newUserAgent(build: string, app: string = "%s", os: string = "Windows;10;;Professional, x64"): string {
139 | return `RiotClient/${build} ${app} (${os})`;
140 | }
141 |
142 | public create(): AxiosInstance {
143 | return axios.create(this.axiosConfig);
144 | }
145 |
146 | public get(url: string) {
147 | return axios.get(url, this.axiosConfig);
148 | }
149 |
150 | public post(url: string, data: any = {}) {
151 | return axios.post(url, data, this.axiosConfig);
152 | }
153 |
154 | public put(url: string, data: any = {}) {
155 | return axios.put(url, data, this.axiosConfig);
156 | }
157 |
158 | public delete(url: string) {
159 | return axios.delete(url, this.axiosConfig);
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/src/index.ts:
--------------------------------------------------------------------------------
1 | import { Auth } from "./client/Auth";
2 |
3 | export { Auth };
4 | export type { Config } from "./client/Auth";
5 |
6 | export { AuthInstance } from "./client/AuthInstance";
7 | export type { AuthUserInfo } from "./client/AuthInstance";
8 |
9 | export { AuthRequest } from "./client/AuthRequest";
10 | export type { PromiseResponse, Response, ClientPlatfrom, RequestConfig } from "./client/AuthRequest";
11 |
12 | export default Auth;
13 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/src/utils/cookie.ts:
--------------------------------------------------------------------------------
1 | import { Cookie } from "tough-cookie";
2 |
3 | import { Response } from "../client/AuthRequest";
4 |
5 | // * mainly support bun
6 | export function getResponseCookies(response: Response): Cookie[] {
7 | const header = response.headers["set-cookie"];
8 | if (!header) {
9 | return [];
10 | }
11 |
12 | const cookies = [];
13 |
14 | for (const string of header) {
15 | const cookie = Cookie.parse(string);
16 |
17 | if (!cookie) {
18 | continue;
19 | }
20 |
21 | cookies.push(cookie);
22 | }
23 |
24 | return cookies;
25 | }
26 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "./src",
5 | "outDir": "./build",
6 | "paths": {
7 | "@valapi/lib": ["../lib/src"]
8 | }
9 | },
10 | "references": [
11 | {
12 | "path": "../lib"
13 | }
14 | ],
15 | "exclude": ["node_modules", "build", "src/__tests__"]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/@valapi/auth/typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "auth",
3 | "extends": ["../../../typedoc.base.json"],
4 | "entryPoints": ["src/index.ts"]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/@valapi/crosshair/CHANGELOG.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valapi/node-valapi/af9b0d2dc1af29b7e2c15300493fccf3dcaa500b/packages/@valapi/crosshair/CHANGELOG.md
--------------------------------------------------------------------------------
/packages/@valapi/crosshair/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Ing Project
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/@valapi/crosshair/README.md:
--------------------------------------------------------------------------------
1 | [githubrepo_image]: https://github.com/valapi/.github/blob/main/128_valapi.png?raw=true
2 | [githubrepo_url]: https://github.com/valapi
3 | [download_image]: https://badgen.net/npm/dt/@valapi/crosshair?icon=npm
4 | [download_url]: https://www.npmjs.com/package/@valapi/crosshair
5 | [size_image]: https://packagephobia.com/badge?p=@valapi/crosshair
6 | [size_url]: https://packagephobia.com/result?p=@valapi/crosshair
7 | [vulnerabilities_image]: https://snyk.io/test/npm/@valapi/crosshair/badge.svg
8 | [vulnerabilities_url]: https://snyk.io/test/npm/@valapi/crosshair
9 | [license_image]: https://badgen.net/badge/license/MIT/blue
10 | [license_url]: https://github.com/valapi/.github/blob/main/LICENSE
11 | [github_image]: https://badgen.net/badge/icon/github?icon=github&label
12 | [github_url]: https://github.com/valapi/node-valapi/tree/master/packages/@valapi/crosshair
13 | [discord_image]: https://badgen.net/badge/icon/discord?icon=discord&label
14 | [discord_url]: https://discord.gg/pbyWbUYjyt
15 |
16 |
17 |
18 | # Valorant API - Crosshair
19 |
20 | [![Profile][githubrepo_image]][github_url]
21 |
22 | Valorant Crosshair Compiler
23 |
24 | [![Downloads][download_image]][download_url]
25 | [![install size][size_image]][size_url]
26 | [![Known Vulnerabilities][vulnerabilities_image]][vulnerabilities_url]
27 |
28 | [![LICENSE][license_image]][license_url]
29 | [![Github][github_image]][github_url]
30 | [![Discord][discord_image]][discord_url]
31 |
32 | Documentation: [valapi.github.io/docs](https://valapi.github.io/docs)
33 |
34 | Guide: [valapi.github.io/guide](https://valapi.github.io/guide)
35 |
36 |
37 |
38 | ---
39 |
40 | > - **@valapi/crosshair** isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
41 | > - **@valapi/crosshair** was created under [Riot Games' "Legal Jibber Jabber"](https://www.riotgames.com/en/legal) policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.
42 | > - [MIT License][license_url]
43 |
44 | ## Installation
45 |
46 | **NPM:**
47 |
48 | ```bash
49 | npm install @valapi/crosshair
50 | ```
51 |
52 | **PNPM:**
53 |
54 | ```bash
55 | pnpm add @valapi/crosshair
56 | ```
57 |
--------------------------------------------------------------------------------
/packages/@valapi/crosshair/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@valapi/crosshair",
3 | "version": "5.0.0-beta.2",
4 | "publishConfig": {
5 | "registry": "https://registry.npmjs.org",
6 | "access": "public"
7 | },
8 | "description": "Valorant API - Crosshair",
9 | "keywords": [
10 | "riot",
11 | "api",
12 | "val",
13 | "valorant",
14 | "crosshair"
15 | ],
16 | "main": "build/index.js",
17 | "types": "./build/index.d.ts",
18 | "repository": {
19 | "type": "git",
20 | "url": "git+https://github.com/valapi/node-valapi.git",
21 | "directory": "packages/@valapi/crosshair"
22 | },
23 | "author": "ing3kth (https://github.com/KTNG-3)",
24 | "license": "MIT",
25 | "bugs": {
26 | "url": "https://github.com/valapi/node-valapi/issues"
27 | },
28 | "homepage": "https://valapi.github.io/guide",
29 | "dependencies": {
30 | "@valapi/lib": "5.0.0-beta.2"
31 | },
32 | "directories": {
33 | "lib": "build",
34 | "test": "src/__tests__"
35 | },
36 | "files": [
37 | "build",
38 | "CHANGELOG.md",
39 | "LICENSE",
40 | "package.json",
41 | "README.md",
42 | "SECURITY.md"
43 | ]
44 | }
45 |
--------------------------------------------------------------------------------
/packages/@valapi/crosshair/src/__tests__/crosshair.ts:
--------------------------------------------------------------------------------
1 | import { ValCrosshair } from "../index";
2 |
3 | describe("crosshair", () => {
4 | test("set", () => {
5 | const crosshair: ValCrosshair = new ValCrosshair();
6 |
7 | let index: Array = [];
8 |
9 | crosshair.find((value, _index) => {
10 | if (value.value.name === "AimDownSights.CopyPrimaryCrosshair") {
11 | index = _index;
12 | return true;
13 | }
14 |
15 | return false;
16 | });
17 |
18 | expect(
19 | crosshair.map((_value, _index) => {
20 | if (_index.toString() === index.toString()) {
21 | return _value;
22 | }
23 | })
24 | ).toStrictEqual([
25 | {
26 | type: "Boolean",
27 | value: {
28 | path: "0.p",
29 | priority: 1,
30 | name: "AimDownSights.CopyPrimaryCrosshair",
31 | data: 1,
32 | default: 1
33 | },
34 | components: []
35 | }
36 | ]);
37 |
38 | crosshair.set(index, 0);
39 |
40 | expect(crosshair.find((_value, _index) => _index.toString() === index.toString())).toStrictEqual({
41 | type: "Boolean",
42 | value: {
43 | path: "0.p",
44 | priority: 1,
45 | name: "AimDownSights.CopyPrimaryCrosshair",
46 | data: 0,
47 | default: 1
48 | },
49 | components: []
50 | });
51 | });
52 |
53 | test("data", () => {
54 | const crosshair: ValCrosshair = new ValCrosshair();
55 |
56 | crosshair.import("0;s;1");
57 |
58 | expect(crosshair.find(value => value.value.path === "0.s")).toStrictEqual({
59 | type: "Boolean",
60 | value: {
61 | path: "0.s",
62 | priority: 3,
63 | name: "General.Crosshair.UseAdvancedOptions",
64 | data: 1,
65 | default: 0
66 | },
67 | components: []
68 | });
69 |
70 | expect(crosshair.export()).toBe("0;s;1");
71 | });
72 | });
73 |
--------------------------------------------------------------------------------
/packages/@valapi/crosshair/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "./src",
5 | "outDir": "./build",
6 | "paths": {
7 | "@valapi/lib": ["../lib/src"]
8 | }
9 | },
10 | "references": [
11 | {
12 | "path": "../lib"
13 | }
14 | ],
15 | "exclude": ["node_modules", "build", "src/__tests__"]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/@valapi/crosshair/typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "crosshair",
3 | "extends": ["../../../typedoc.base.json"],
4 | "entryPoints": ["src/index.ts"]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 5.0.0-beta.1
2 |
3 | **Add**
4 |
5 | _static_
6 |
7 | - `ValEncryption.randomString(size)`
8 |
9 | # 5.0.0-beta.0
10 |
11 | **Add**
12 |
13 | - `ValVersion`
14 |
15 | **Change**
16 |
17 | - ~~`QueueId.fromName(x)`~~ **-->** `QueueId.fromName(x, newMapID?)`
18 | - ~~`QueueId.fromID(x)`~~ **-->** `QueueId.fromID(x, newMapID?)`
19 |
20 | # 4.0.0
21 |
22 | **Add**
23 |
24 | - `ValEncryption.encryptJson(object)`
25 | - `ValEncryption.decryptJson(object)`
26 | - `CrosshairHexColor`
27 |
28 | **Change**
29 |
30 | - ~~`ValError.fromError`~~ **-->** `ValError.parse`
31 | - ~~`ValBase64`~~ **-->** `ValEncryption`
32 |
33 | - ~~`CrosshairColor.fromColor()`~~ **-->** `CrosshairColor.fromName()`
34 | - ~~`CrosshairColor.fromString()`~~ **-->** `CrosshairColor.fromID()`
35 | - ~~`CrosshairColor.fromColorHex()`~~ **-->** `CrosshairHexColor.fromName()`
36 | - ~~`CrosshairColor.fromStringHex()`~~ **-->** `CrosshairHexColor.fromHex()`
37 | - ~~`ItemTypeId.fromString()`~~ **-->** `ItemTypeId.fromID()`
38 | - ~~`Locale.fromString()`~~ **-->** `Locale.fromID()`
39 | - ~~`QueueId.fromString()`~~ **-->** `QueueId.fromID()`
40 | - ~~`Region.fromString()`~~ **-->** `Region.fromID()`
41 |
42 | **Remove**
43 |
44 | - `CrosshairColor.Data`
45 | - `ItemTypeId.Data`
46 | - `Locale.Data`
47 | - `QueueId.Data`
48 | - `Region.Data`
49 |
50 | ### Typescript
51 |
52 | **Change**
53 |
54 | - ~~`CrosshairColor.Color`~~ **-->** `CrosshairColor.Name`
55 | - ~~`CrosshairColor.Identify`~~ **-->** `CrosshairColor.ID`
56 | - ~~`CrosshairColor.ColorHex`~~ **-->** `CrosshairHexColor.Name`
57 | - ~~`CrosshairColor.IdentifyHex`~~ **-->** `CrosshairHexColor.Hex`
58 | - ~~`ItemTypeId.Identify`~~ **-->** `ItemTypeId.ID`
59 | - ~~`Locale.Identify`~~ **-->** `Locale.ID`
60 | - ~~`QueueId.Identify`~~ **-->** `QueueId.ID`
61 | - ~~`Region.Identify`~~ **-->** `Region.ID`
62 |
63 | # 3.1.0
64 |
65 | **Remove**
66 |
67 | - `ValAxios`
68 |
69 | # 3.0.2
70 |
71 | **Change**
72 |
73 | - ~~`toUft8(text, technique)`~~ **-->** `ValBase64.encrypt(text)`
74 | - ~~`fromUft8(text, technique)`~~ **-->** `ValBase64.decrypt(text)`
75 |
76 | # 3.0.0
77 |
78 | **Remove**
79 |
80 | - `ValRegion.toJSON()`
81 | - `ValRegion.data`
82 | - `ValEvent`
83 |
84 | **Change**
85 |
86 | - ~~`ValRegion.data.id`~~ **-->** `ValRegion.id`
87 |
88 | ### Typescript
89 |
90 | **Remove**
91 |
92 | - `ValAxios.Config`
93 | - `ValAxios.Request`
94 | - `ValAxios.RequestData`
95 | - `ValRegion.JSON`
96 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022-2024 Ing Project
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/README.md:
--------------------------------------------------------------------------------
1 | [githubrepo_image]: https://github.com/valapi/.github/blob/main/128_valapi.png?raw=true
2 | [githubrepo_url]: https://github.com/valapi
3 | [download_image]: https://badgen.net/npm/dt/@valapi/lib?icon=npm
4 | [download_url]: https://www.npmjs.com/package/@valapi/lib
5 | [size_image]: https://packagephobia.com/badge?p=@valapi/lib
6 | [size_url]: https://packagephobia.com/result?p=@valapi/lib
7 | [vulnerabilities_image]: https://snyk.io/test/npm/@valapi/lib/badge.svg
8 | [vulnerabilities_url]: https://snyk.io/test/npm/@valapi/lib
9 | [license_image]: https://badgen.net/badge/license/MIT/blue
10 | [license_url]: https://github.com/valapi/.github/blob/main/LICENSE
11 | [github_image]: https://badgen.net/badge/icon/github?icon=github&label
12 | [github_url]: https://github.com/valapi/node-valapi/tree/master/packages/@valapi/lib
13 | [discord_image]: https://badgen.net/badge/icon/discord?icon=discord&label
14 | [discord_url]: https://discord.gg/pbyWbUYjyt
15 |
16 |
17 |
18 | # Valorant API - Library
19 |
20 | [![Profile][githubrepo_image]][github_url]
21 |
22 | Library of **@valapi**
23 |
24 | [![Downloads][download_image]][download_url]
25 | [![install size][size_image]][size_url]
26 | [![Known Vulnerabilities][vulnerabilities_image]][vulnerabilities_url]
27 |
28 | [![LICENSE][license_image]][license_url]
29 | [![Github][github_image]][github_url]
30 | [![Discord][discord_image]][discord_url]
31 |
32 | Documentation: [valapi.github.io/docs](https://valapi.github.io/docs)
33 |
34 | Guide: [valapi.github.io/guide](https://valapi.github.io/guide)
35 |
36 |
37 |
38 | ---
39 |
40 | > - **@valapi/lib** isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
41 | > - **@valapi/lib** was created under [Riot Games' "Legal Jibber Jabber"](https://www.riotgames.com/en/legal) policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.
42 | > - [MIT License][license_url]
43 |
44 | ## Installation
45 |
46 | **NPM:**
47 |
48 | ```bash
49 | npm install @valapi/lib
50 | ```
51 |
52 | **PNPM:**
53 |
54 | ```bash
55 | pnpm add @valapi/lib
56 | ```
57 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@valapi/lib",
3 | "version": "5.0.0-beta.2",
4 | "publishConfig": {
5 | "registry": "https://registry.npmjs.org",
6 | "access": "public"
7 | },
8 | "description": "Valorant API - Library",
9 | "keywords": [
10 | "riot",
11 | "api",
12 | "val",
13 | "valorant"
14 | ],
15 | "main": "build/index.js",
16 | "types": "./build/index.d.ts",
17 | "repository": {
18 | "type": "git",
19 | "url": "git+https://github.com/valapi/node-valapi.git",
20 | "directory": "packages/@valapi/lib"
21 | },
22 | "author": "ing3kth (https://github.com/KTNG-3)",
23 | "license": "MIT",
24 | "bugs": {
25 | "url": "https://github.com/valapi/node-valapi/issues"
26 | },
27 | "homepage": "https://valapi.github.io/guide",
28 | "dependencies": {
29 | "tslib": "^2.6.3"
30 | },
31 | "directories": {
32 | "lib": "build",
33 | "test": "src/__tests__"
34 | },
35 | "files": [
36 | "build",
37 | "CHANGELOG.md",
38 | "LICENSE",
39 | "package.json",
40 | "README.md",
41 | "SECURITY.md"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/__tests__/region.ts:
--------------------------------------------------------------------------------
1 | import { ValRegion, Region } from "../index";
2 |
3 | describe("lib.region", () => {
4 | test("latin_america", () => {
5 | const _region = new ValRegion(Region.Default.Latin_America);
6 |
7 | const id = "latam";
8 |
9 | expect(_region.id).toBe(id);
10 | });
11 |
12 | test("brazil", () => {
13 | const _region = new ValRegion(Region.Default.Brazil);
14 |
15 | const id = "br";
16 |
17 | expect(_region.id).toBe(id);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/__tests__/resource.ts:
--------------------------------------------------------------------------------
1 | import { CrosshairColor, CrosshairHexColor, ItemTypeId, Locale, QueueId, Region } from "../index";
2 |
3 | describe("lib.resource", () => {
4 | test("crosshair", () => {
5 | expect(CrosshairColor.fromName("White")).toBe("0");
6 | expect(CrosshairColor.fromID("1")).toBe("Green");
7 | });
8 |
9 | test("crosshair_hex", () => {
10 | expect(CrosshairHexColor.fromName("Pink")).toBe("FF00FF");
11 | expect(CrosshairHexColor.fromHex("00FFFF")).toBe("Cyan");
12 | });
13 |
14 | test("item_type", () => {
15 | expect(ItemTypeId.fromName("Agents")).toBe("01bb38e1-da47-4e6a-9b3d-945fe4655707");
16 | expect(ItemTypeId.fromID("e7c63390-eda7-46e0-bb7a-a6abdacd2433")).toBe("Skins");
17 | });
18 |
19 | test("locale", () => {
20 | expect(Locale.fromName("German_Germany")).toBe("de-DE");
21 | expect(Locale.fromID("zh-TW")).toBe("Chinese_Taiwan");
22 | });
23 |
24 | test("queue", () => {
25 | expect(QueueId.fromName("Escalation")).toBe("ggteam");
26 | expect(QueueId.fromID("onefa")).toBe("Replication");
27 | });
28 |
29 | test("queue.newmap", () => {
30 | const newMapID = "abyss";
31 |
32 | expect(QueueId.fromName("New_Map", newMapID)).toBe(newMapID);
33 | expect(QueueId.fromID(newMapID, newMapID)).toBe("New_Map");
34 | });
35 |
36 | test("region", () => {
37 | expect(Region.fromName("Brazil")).toBe("br");
38 | expect(Region.fromID("pbe")).toBe("Public_Beta_Environment");
39 | });
40 | });
41 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/__tests__/util.ts:
--------------------------------------------------------------------------------
1 | import { ValEncryption } from "../index";
2 |
3 | describe("lib.util", () => {
4 | test("encryption", () => {
5 | expect(ValEncryption.decryptJson("eyJ2YWxvcmFudC50cyI6ICJ0aGUgYmVzdCBOb2RlLmpzIGxpYnJhcnkgdG8gdXNpbmcgVmFsb3JhbnQgQVBJIn0=")).toStrictEqual({
6 | "valorant.ts": "the best Node.js library to using Valorant API"
7 | });
8 | expect(ValEncryption.encryptJson({ 1: "2kov83v4yj1v8y09", ":)": "18ny9c8ny91c8ny9cn9" })).toBe("eyIxIjoiMmtvdjgzdjR5ajF2OHkwOSIsIjopIjoiMThueTljOG55OTFjOG55OWNuOSJ9");
9 |
10 | expect(ValEncryption.encrypt("18ny9v2ny9v129ny1v21v8ny9")).toBe("MThueTl2Mm55OXYxMjlueTF2MjF2OG55OQ==");
11 | expect(ValEncryption.decrypt("MThueTl2Mm55OXYxMjlueTF2MjF2OG55OQ==")).toBe("18ny9v2ny9v129ny1v21v8ny9");
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/__tests__/version.ts:
--------------------------------------------------------------------------------
1 | import { ValVersion } from "../index";
2 |
3 | describe("valorant_ts.version", () => {
4 | test("parse", () => {
5 | expect(ValVersion.parse("6.00")).toBe("6.0");
6 | expect(ValVersion.parse("5.10")).toBe("5.10");
7 | expect(ValVersion.parse("5.0")).toBe("5.0");
8 | expect(ValVersion.parse("4.11")).toBe("4.11");
9 | expect(ValVersion.parse("4.01")).toBe("4.01");
10 | });
11 | });
12 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/client/ValError.ts:
--------------------------------------------------------------------------------
1 | export class ValError extends Error {
2 | public readonly data: T;
3 |
4 | public constructor(data: ValError) {
5 | super(data.message);
6 |
7 | this.data = data.data;
8 | }
9 |
10 | public static parse(error: Error): ValError {
11 | return new ValError({
12 | name: error.name,
13 | message: error.message,
14 | stack: error.stack,
15 | data: undefined
16 | });
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/client/ValRegion.ts:
--------------------------------------------------------------------------------
1 | import * as Region from "../resources/Region";
2 |
3 | export class ValRegion {
4 | public readonly id: Region.ID;
5 |
6 | /**
7 | * @param region (default: na)
8 | */
9 | public constructor(region: Region.ID = Region.Default.North_America) {
10 | this.id = "na";
11 | switch (region) {
12 | case "na": {
13 | break;
14 | }
15 | case "latam": {
16 | this.id = "latam";
17 | break;
18 | }
19 | case "br": {
20 | this.id = "br";
21 | break;
22 | }
23 | case "pbe": {
24 | break;
25 | }
26 | case "eu": {
27 | this.id = "eu";
28 | break;
29 | }
30 | case "kr": {
31 | this.id = "kr";
32 | break;
33 | }
34 | case "ap": {
35 | this.id = "ap";
36 | break;
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/index.ts:
--------------------------------------------------------------------------------
1 | export { ValRegion } from "./client/ValRegion";
2 | export { ValError } from "./client/ValError";
3 |
4 | export * as CrosshairColor from "./resources/CrosshairColor";
5 | export * as CrosshairHexColor from "./resources/CrosshairHexColor";
6 | export * as ItemTypeId from "./resources/ItemTypeId";
7 | export * as Locale from "./resources/Locale";
8 | export * as QueueId from "./resources/QueueId";
9 | export * as Region from "./resources/Region";
10 |
11 | export { ValEncryption } from "./utils/ValEncryption";
12 | export { ValVersion } from "./utils/ValVersion";
13 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/resources/CrosshairColor.ts:
--------------------------------------------------------------------------------
1 | import { ValError } from "../client/ValError";
2 |
3 | export const Default = {
4 | White: "0",
5 | Green: "1",
6 | Yellow_Green: "2",
7 | Green_Yellow: "3",
8 | Yellow: "4",
9 | Cyan: "5",
10 | Pink: "6",
11 | Red: "7",
12 | Custom: "8"
13 | };
14 |
15 | export type Name = keyof typeof Default;
16 | export type ID = (typeof Default)[Name];
17 |
18 | export function fromName(x: Name): ID {
19 | return Default[x];
20 | }
21 |
22 | export function fromID(x: ID): Name {
23 | for (const data of Object.entries(Default)) {
24 | if (data[1] === x) {
25 | return data[0];
26 | }
27 | }
28 |
29 | throw new ValError({
30 | name: "Resource_Error",
31 | message: "Resource Not Found",
32 | data: x
33 | });
34 | }
35 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/resources/CrosshairHexColor.ts:
--------------------------------------------------------------------------------
1 | import { ValError } from "../client/ValError";
2 |
3 | export const Default = {
4 | White: "FFFFFF",
5 | Green: "00FF00",
6 | Yellow_Green: "7FFF00",
7 | Green_Yellow: "DFFF00",
8 | Yellow: "FFFF00",
9 | Cyan: "00FFFF",
10 | Pink: "FF00FF",
11 | Red: "FF0000"
12 | };
13 |
14 | export type Name = keyof typeof Default;
15 | export type Hex = (typeof Default)[Name];
16 |
17 | export function fromName(x: Name): Hex {
18 | return Default[x];
19 | }
20 |
21 | export function fromHex(x: Hex): Name {
22 | for (const data of Object.entries(Default)) {
23 | if (data[1] === x) {
24 | return data[0];
25 | }
26 | }
27 |
28 | throw new ValError({
29 | name: "Resource_Error",
30 | message: "Resource Not Found",
31 | data: x
32 | });
33 | }
34 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/resources/ItemTypeId.ts:
--------------------------------------------------------------------------------
1 | import { ValError } from "../client/ValError";
2 |
3 | export const Default = {
4 | Agents: "01bb38e1-da47-4e6a-9b3d-945fe4655707",
5 | Contracts: "f85cb6f7-33e5-4dc8-b609-ec7212301948",
6 | Sprays: "d5f120f8-ff8c-4aac-92ea-f2b5acbe9475",
7 | Gun_Buddies: "dd3bf334-87f3-40bd-b043-682a57a8dc3a",
8 | Cards: "3f296c07-64c3-494c-923b-fe692a4fa1bd",
9 | Skins: "e7c63390-eda7-46e0-bb7a-a6abdacd2433",
10 | Skin_Variants: "3ad1b2b2-acdb-4524-852f-954a76ddae0a",
11 | Titles: "de7caa6b-adf7-4588-bbd1-143831e786c6"
12 | };
13 |
14 | export type Name = keyof typeof Default;
15 | export type ID = (typeof Default)[Name];
16 |
17 | export function fromName(x: Name): ID {
18 | return Default[x];
19 | }
20 |
21 | export function fromID(x: ID): Name {
22 | for (const data of Object.entries(Default)) {
23 | if (data[1] === x) {
24 | return data[0];
25 | }
26 | }
27 |
28 | throw new ValError({
29 | name: "Resource_Error",
30 | message: "Resource Not Found",
31 | data: x
32 | });
33 | }
34 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/resources/Locale.ts:
--------------------------------------------------------------------------------
1 | import { ValError } from "../client/ValError";
2 |
3 | export const Default = {
4 | Arabic_United_Arab_Emirates: "ar-AE",
5 | German_Germany: "de-DE",
6 | English_United_Kingdom: "en-GB",
7 | English_United_States: "en-US",
8 | Spanish_Spain: "es-ES",
9 | Spanish_Mexico: "es-MX",
10 | French_France: "fr-FR",
11 | Indonesian_Indonesia: "id-ID",
12 | Italian_Italy: "it-IT",
13 | Japanese_Japan: "ja-JP",
14 | Korean_South_Korea: "ko-KR",
15 | Polish_Poland: "pl-PL",
16 | Portuguese_Brazil: "pt-BR",
17 | Russian_Russia: "ru-RU",
18 | Thai_Thailand: "th-TH",
19 | Turkish_Turkey: "tr-TR",
20 | Vietnamese_Vietnam: "vi-VN",
21 | Chinese_China: "zh-CN",
22 | Chinese_Taiwan: "zh-TW"
23 | };
24 |
25 | export type Name = keyof typeof Default;
26 | export type ID = (typeof Default)[Name];
27 |
28 | export function fromName(x: Name): ID {
29 | return Default[x];
30 | }
31 |
32 | export function fromID(x: ID): Name {
33 | for (const data of Object.entries(Default)) {
34 | if (data[1] === x) {
35 | return data[0];
36 | }
37 | }
38 |
39 | throw new ValError({
40 | name: "Resource_Error",
41 | message: "Resource Not Found",
42 | data: x
43 | });
44 | }
45 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/resources/QueueId.ts:
--------------------------------------------------------------------------------
1 | import { ValError } from "../client/ValError";
2 |
3 | export const Default = {
4 | Unrated: "unrated",
5 | Competitive: "competitive",
6 | Spikerush: "spikerush",
7 | Deathmatch: "deathmatch",
8 | Escalation: "ggteam",
9 | Replication: "onefa",
10 | Snowball_Fight: "snowball",
11 | Swiftplay: "swiftplay",
12 | Team_Deathmatch: "hurm",
13 | Custom: "",
14 | Custom_Tournament: "tournamentmode",
15 |
16 | New_Map: "newmap"
17 | };
18 |
19 | export type Name = keyof typeof Default;
20 | export type ID = Exclude<(typeof Default)[Name], (typeof Default)["New_Map"] | "">;
21 |
22 | export function fromName(x: Name, newMapID: string = "abyss"): ID {
23 | if (x === "New_Map") {
24 | return newMapID;
25 | }
26 |
27 | return Default[x];
28 | }
29 |
30 | export function fromID(x: ID, newMapID: string = "abyss"): Name {
31 | for (const data of Object.entries(Default)) {
32 | if (data[1] === "newmap" && x === newMapID) {
33 | return "New_Map";
34 | }
35 |
36 | if (data[1] === x) {
37 | return data[0];
38 | }
39 | }
40 |
41 | throw new ValError({
42 | name: "Resource_Error",
43 | message: "Resource Not Found",
44 | data: x
45 | });
46 | }
47 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/resources/Region.ts:
--------------------------------------------------------------------------------
1 | import { ValError } from "../client/ValError";
2 |
3 | export const Default = {
4 | North_America: "na",
5 | Latin_America: "latam",
6 | Brazil: "br",
7 | Public_Beta_Environment: "pbe",
8 | Europe: "eu",
9 | Korea: "kr",
10 | Asia_Pacific: "ap"
11 | };
12 |
13 | export type Name = keyof typeof Default;
14 | export type ID = (typeof Default)[Name];
15 |
16 | export function fromName(x: Name): ID {
17 | return Default[x];
18 | }
19 |
20 | export function fromID(x: ID): Name {
21 | for (const data of Object.entries(Default)) {
22 | if (data[1] === x) {
23 | return data[0];
24 | }
25 | }
26 |
27 | throw new ValError({
28 | name: "Resource_Error",
29 | message: "Resource Not Found",
30 | data: x
31 | });
32 | }
33 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/utils/ValEncryption.ts:
--------------------------------------------------------------------------------
1 | import { Buffer } from "node:buffer";
2 | import { randomBytes } from "node:crypto";
3 |
4 | export class ValEncryption {
5 | public static encrypt(text: string): string {
6 | return Buffer.from(text).toString("base64");
7 | }
8 |
9 | public static encryptJson(object: T): string {
10 | return this.encrypt(JSON.stringify(object));
11 | }
12 |
13 | public static decrypt(text: string): string {
14 | return Buffer.from(text, "base64").toString();
15 | }
16 |
17 | public static decryptJson(object: string): T {
18 | return JSON.parse(this.decrypt(object));
19 | }
20 |
21 | public static randomString(size: number): string {
22 | return randomBytes(size).toString("base64url");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/src/utils/ValVersion.ts:
--------------------------------------------------------------------------------
1 | import { ValError } from "../client/ValError";
2 |
3 | export class ValVersion {
4 | public static parse(version: string): string {
5 | const splitVersion: Array = version.split(".");
6 | if (splitVersion.length !== 2) {
7 | throw new ValError({
8 | name: "Version_Error",
9 | message: "Invalid version",
10 | data: version
11 | });
12 | }
13 |
14 | splitVersion[0] = Number.parseInt(splitVersion[0]).toString();
15 |
16 | if (splitVersion[1].length === 1) {
17 | splitVersion[1] = `0${splitVersion[1]}`;
18 | }
19 |
20 | if (splitVersion[1] === "00") {
21 | splitVersion[1] = "0";
22 | }
23 |
24 | return splitVersion.join(".");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "./src",
5 | "outDir": "./build"
6 | },
7 | "exclude": ["node_modules", "build", "src/__tests__"]
8 | }
9 |
--------------------------------------------------------------------------------
/packages/@valapi/lib/typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lib",
3 | "extends": ["../../../typedoc.base.json"],
4 | "entryPoints": ["src/index.ts"]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 5.0.0-beta.0
2 |
3 | **Add**
4 |
5 | - `RiotApi.regionURL`
6 |
7 | **Change**
8 |
9 | - ~~`RiotApi.axios`~~ **-->** `RiotApi.request`
10 | - ~~`RiotApiRegion`~~ **-->** `RiotApiRegionURL`
11 | - ~~`RiotApiService.axios`~~ **-->** `RiotApiService.request`
12 | - ~~`RiotApiService.apiRegion`~~ **-->** `RiotApiService.regionURL`
13 |
14 | **Remove**
15 |
16 | - `RiotApi.config`
17 | - `RiotApi.createAt`
18 | - `RiotApi.Default`
19 |
20 | ### Typescript
21 |
22 | **Change**
23 |
24 | - ~~`RiotApi.Config`~~ **-->** `Config`
25 |
26 | # 4.0.0
27 |
28 | **Change**
29 |
30 | - ~~`RiotApiRegion.riotRegion`~~ **-->** `RiotApiRegion.continent`
31 | - ~~`RiotApiRegion.url.api`~~ **-->** `RiotApiRegion.url.continent`
32 | - ~~`RiotApiRegion.url.server`~~ **-->** `RiotApiRegion.url.region`
33 |
34 | ### Typescript
35 |
36 | **Add**
37 |
38 | - `MatchV1.MatchInfoDto`
39 | - `MatchV1.AbilityCastsDto`
40 | - `MatchV1.PlayerStatsDto`
41 | - `MatchV1.PlayerDto`
42 | - `MatchV1.CoachDto`
43 | - `MatchV1.TeamDto`
44 | - `MatchV1.LocationDto`
45 | - `MatchV1.PlayerLocationsDto`
46 | - `MatchV1.FinishingDamageDto`
47 | - `MatchV1.KillDto`
48 | - `MatchV1.DamageDto`
49 | - `MatchV1.EconomyDto`
50 | - `MatchV1.AbilityDto`
51 | - `MatchV1.PlayerRoundStatsDto`
52 | - `MatchV1.RoundResultDto`
53 | - `MatchV1.MatchDto`
54 | - `MatchV1.MatchlistEntryDto`
55 | - `MatchV1.MatchlistDto`
56 | - `MatchV1.RecentMatchesDto`
57 |
58 | # 3.2.0
59 |
60 | **Add**
61 |
62 | - `RiotApi.request()`
63 |
64 | **Remove**
65 |
66 | - `RiotApi.getService()`
67 |
68 | # 3.0.0
69 |
70 | **Add**
71 |
72 | - `RiotApiRegion`
73 | - `RiotApi.getService()`
74 |
75 | ### Typescript
76 |
77 | **Add**
78 |
79 | - `AccountV1.AccountDto`
80 | - `AccountV1.ActiveShardDto`
81 | - `ContentV1.ActDto`
82 | - `ContentV1.ContentItemDto`
83 | - `ContentV1.ContentDto`
84 | - `RankedV1.PlayerDto`
85 | - `RankedV1.LeaderboardDto`
86 | - `StatusV1.ContentDto`
87 | - `StatusV1.UpdateDto`
88 | - `StatusV1.StatusDto`
89 | - `StatusV1.PlatformDataDto`
90 |
91 | **Change**
92 |
93 | - ~~`RiotApi.Options`~~ **-->** `RiotApi.Config`
94 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022-2024 Ing Project
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/README.md:
--------------------------------------------------------------------------------
1 | [githubrepo_image]: https://github.com/valapi/.github/blob/main/128_valapi.png?raw=true
2 | [githubrepo_url]: https://github.com/valapi
3 | [download_image]: https://badgen.net/npm/dt/@valapi/riot-api?icon=npm
4 | [download_url]: https://www.npmjs.com/package/@valapi/riot-api
5 | [size_image]: https://packagephobia.com/badge?p=@valapi/riot-api
6 | [size_url]: https://packagephobia.com/result?p=@valapi/riot-api
7 | [vulnerabilities_image]: https://snyk.io/test/npm/@valapi/riot-api/badge.svg
8 | [vulnerabilities_url]: https://snyk.io/test/npm/@valapi/riot-api
9 | [license_image]: https://badgen.net/badge/license/MIT/blue
10 | [license_url]: https://github.com/valapi/.github/blob/main/LICENSE
11 | [github_image]: https://badgen.net/badge/icon/github?icon=github&label
12 | [github_url]: https://github.com/valapi/node-valapi/tree/master/packages/@valapi/riot-api
13 | [discord_image]: https://badgen.net/badge/icon/discord?icon=discord&label
14 | [discord_url]: https://discord.gg/pbyWbUYjyt
15 |
16 |
17 |
18 | # Valorant API - Riot API
19 |
20 | [![Profile][githubrepo_image]][github_url]
21 |
22 | Official Api From Riot Games
23 |
24 | [![Downloads][download_image]][download_url]
25 | [![install size][size_image]][size_url]
26 | [![Known Vulnerabilities][vulnerabilities_image]][vulnerabilities_url]
27 |
28 | [![LICENSE][license_image]][license_url]
29 | [![Github][github_image]][github_url]
30 | [![Discord][discord_image]][discord_url]
31 |
32 | Documentation: [valapi.github.io/docs](https://valapi.github.io/docs)
33 |
34 | Guide: [valapi.github.io/guide](https://valapi.github.io/guide)
35 |
36 |
37 |
38 | ---
39 |
40 | > - **@valapi/riot-api** isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
41 | > - **@valapi/riot-api** was created under [Riot Games' "Legal Jibber Jabber"](https://www.riotgames.com/en/legal) policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.
42 | > - [MIT License][license_url]
43 |
44 | ## Installation
45 |
46 | **NPM:**
47 |
48 | ```bash
49 | npm install @valapi/riot-api
50 | ```
51 |
52 | **PNPM:**
53 |
54 | ```bash
55 | pnpm add @valapi/riot-api
56 | ```
57 |
58 | ## Guide
59 |
60 | ```typescript
61 | import { RiotApi } from "@valapi/riot-api";
62 | ```
63 |
64 | ```typescript
65 | const client = new RiotApi({
66 | apiKey: "LoooooongApiKey_123456789",
67 | region: "ap"
68 | });
69 | ```
70 |
71 | ### API
72 |
73 | ```typescript
74 | const status = await client.StatusV1.platformData();
75 |
76 | console.log(status.data);
77 | ```
78 |
79 | ```typescript
80 | const accountData = await client.AccountV1.byRiotId("PRX f0rsakeN", "Huh");
81 |
82 | console.log(accountData.data);
83 | ```
84 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@valapi/riot-api",
3 | "version": "5.0.0-beta.2",
4 | "publishConfig": {
5 | "registry": "https://registry.npmjs.org",
6 | "access": "public"
7 | },
8 | "description": "Valorant API - Riot API",
9 | "keywords": [
10 | "riot",
11 | "api",
12 | "val",
13 | "valorant",
14 | "official"
15 | ],
16 | "main": "build/index.js",
17 | "types": "./build/index.d.ts",
18 | "repository": {
19 | "type": "git",
20 | "url": "git+https://github.com/valapi/node-valapi.git",
21 | "directory": "packages/@valapi/riot-api"
22 | },
23 | "author": "ing3kth (https://github.com/KTNG-3)",
24 | "license": "MIT",
25 | "bugs": {
26 | "url": "https://github.com/valapi/node-valapi/issues"
27 | },
28 | "homepage": "https://valapi.github.io/guide",
29 | "dependencies": {
30 | "@valapi/lib": "5.0.0-beta.2",
31 | "axios": "^1.7.3"
32 | },
33 | "directories": {
34 | "lib": "build",
35 | "test": "src/__tests__"
36 | },
37 | "files": [
38 | "build",
39 | "CHANGELOG.md",
40 | "LICENSE",
41 | "package.json",
42 | "README.md",
43 | "SECURITY.md"
44 | ]
45 | }
46 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/__tests__/api.ts:
--------------------------------------------------------------------------------
1 | import { env } from "node:process";
2 |
3 | import { Region, Locale } from "@valapi/lib";
4 |
5 | import { RiotApi } from "../index";
6 |
7 | describe("riotapi.api", () => {
8 | const client = new RiotApi({
9 | apiKey: env.VAL_RIOT_API ? env.VAL_RIOT_API : "",
10 | region: Region.Default.Asia_Pacific
11 | });
12 |
13 | test("apis", () => {
14 | Promise.all([
15 | client.AccountV1.byRiotId("ING", "EMPTY"),
16 | client.ContentV1.contents(Locale.Default.English_United_States),
17 | client.RankedV1.leaderboardsByAct("3e47230a-463c-a301-eb7d-67bb60357d4f", 10, 0),
18 | client.StatusV1.platformData()
19 | ]).then(values => {
20 | values.forEach(x => {
21 | expect(x.status === 200).toBe(true);
22 | expect(x.data).not.toMatchObject({
23 | status: {
24 | message: "Unauthorized",
25 | status_code: 401
26 | }
27 | });
28 | });
29 | });
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/__tests__/region.ts:
--------------------------------------------------------------------------------
1 | import { Region } from "@valapi/lib";
2 |
3 | import { RiotApiRegionURL } from "../index";
4 |
5 | describe("riotapi.region", () => {
6 | test("public_beta_environment", () => {
7 | const _region = new RiotApiRegionURL(Region.Default.Public_Beta_Environment);
8 |
9 | const id = "na";
10 | const continent = "pbe1";
11 |
12 | expect(_region.id).toBe(id);
13 | expect(_region.continent).toBe(continent);
14 |
15 | expect(_region.url).toMatchObject({
16 | region: `https://${id}.api.riotgames.com`,
17 | continent: `https://${continent}.api.riotgames.com`
18 | });
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/client/RiotApi.ts:
--------------------------------------------------------------------------------
1 | import axios, { AxiosHeaders } from "axios";
2 | import type { AxiosInstance, CreateAxiosDefaults } from "axios";
3 |
4 | import type { Region } from "@valapi/lib";
5 |
6 | import { RiotApiRegionURL } from "./RiotApiRegionURL";
7 |
8 | import { AccountV1 } from "../service/AccountV1";
9 | import { ContentV1 } from "../service/ContentV1";
10 | import { MatchV1 } from "../service/MatchV1";
11 | import { RankedV1 } from "../service/RankedV1";
12 | import { StatusV1 } from "../service/StatusV1";
13 |
14 | export interface Config {
15 | apiKey: string;
16 | region: Region.ID;
17 | axiosConfig?: CreateAxiosDefaults;
18 | }
19 |
20 | /**
21 | * Official Api From Riot Games
22 | */
23 | export class RiotApi {
24 | public readonly request: AxiosInstance;
25 | public readonly regionURL: RiotApiRegionURL;
26 |
27 | public constructor(config: Config) {
28 | const headers = new AxiosHeaders();
29 | headers.setContentType("application/json");
30 | headers.set("X-Riot-Token", config.apiKey);
31 |
32 | this.request = axios.create({
33 | ...config.axiosConfig,
34 | ...{
35 | headers: {
36 | ...config.axiosConfig?.headers,
37 | ...headers.toJSON()
38 | }
39 | }
40 | });
41 |
42 | this.regionURL = new RiotApiRegionURL(config.region);
43 | }
44 |
45 | public get AccountV1(): AccountV1 {
46 | return new AccountV1(this.request, this.regionURL);
47 | }
48 |
49 | public get ContentV1(): ContentV1 {
50 | return new ContentV1(this.request, this.regionURL);
51 | }
52 |
53 | public get MatchV1(): MatchV1 {
54 | return new MatchV1(this.request, this.regionURL);
55 | }
56 |
57 | public get RankedV1(): RankedV1 {
58 | return new RankedV1(this.request, this.regionURL);
59 | }
60 |
61 | public get StatusV1(): StatusV1 {
62 | return new StatusV1(this.request, this.regionURL);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/client/RiotApiRegionURL.ts:
--------------------------------------------------------------------------------
1 | import { ValRegion } from "@valapi/lib";
2 | import type { Region } from "@valapi/lib";
3 |
4 | export class RiotApiRegionURL extends ValRegion {
5 | public readonly continent: string;
6 | public readonly url: {
7 | /**
8 | * $.api.riotgames.com
9 | */
10 | region: string;
11 | /**
12 | * $.api.riotgames.com
13 | */
14 | continent: string;
15 | /**
16 | * esports.api.riotgames.com
17 | */
18 | esports: string;
19 | };
20 |
21 | /**
22 | * @param region (default: na)
23 | */
24 | public constructor(region?: Region.ID) {
25 | super(region);
26 |
27 | this.continent = "americas";
28 | switch (region) {
29 | case "na": {
30 | break;
31 | }
32 | case "latam": {
33 | break;
34 | }
35 | case "br": {
36 | break;
37 | }
38 | case "pbe": {
39 | this.continent = "pbe1";
40 | break;
41 | }
42 | case "eu": {
43 | this.continent = "europe";
44 | break;
45 | }
46 | case "kr": {
47 | this.continent = "asia";
48 | break;
49 | }
50 | case "ap": {
51 | this.continent = "asia";
52 | break;
53 | }
54 | }
55 |
56 | this.url = {
57 | region: `https://${this.id}.api.riotgames.com`,
58 | continent: `https://${this.continent}.api.riotgames.com`,
59 | esports: `https://esports.api.riotgames.com`
60 | };
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/client/RiotApiService.ts:
--------------------------------------------------------------------------------
1 | import type { AxiosInstance } from "axios";
2 |
3 | import type { RiotApiRegionURL } from "./RiotApiRegionURL";
4 |
5 | export class RiotApiService {
6 | protected readonly request: AxiosInstance;
7 | protected readonly regionURL: RiotApiRegionURL;
8 |
9 | public constructor(request: AxiosInstance, regionURL: RiotApiRegionURL) {
10 | this.request = request;
11 | this.regionURL = regionURL;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/index.ts:
--------------------------------------------------------------------------------
1 | import { RiotApi } from "./client/RiotApi";
2 |
3 | export { RiotApi };
4 | export type { Config } from "./client/RiotApi";
5 | export { RiotApiRegionURL } from "./client/RiotApiRegionURL";
6 | export { RiotApiService } from "./client/RiotApiService";
7 |
8 | export { AccountV1 } from "./service/AccountV1";
9 | export { ContentV1 } from "./service/ContentV1";
10 | export { MatchV1 } from "./service/MatchV1";
11 | export { RankedV1 } from "./service/RankedV1";
12 | export { StatusV1 } from "./service/StatusV1";
13 |
14 | export default RiotApi;
15 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/service/AccountV1.ts:
--------------------------------------------------------------------------------
1 | import type { AxiosResponse } from "axios";
2 |
3 | import { RiotApiService } from "../client/RiotApiService";
4 |
5 | export namespace AccountV1 {
6 | export interface AccountDto {
7 | puuid: string;
8 | /**
9 | * This field may be excluded from the response if the account doesn't have a gameName.
10 | */
11 | gameName?: string;
12 | /**
13 | * This field may be excluded from the response if the account doesn't have a tagLine.
14 | */
15 | tagLine?: string;
16 |
17 | [key: string]: any;
18 | }
19 |
20 | export interface ActiveShardDto {
21 | puuid: string;
22 | game: "val" | "lor";
23 | activeShard: string;
24 | }
25 | }
26 |
27 | export class AccountV1 extends RiotApiService {
28 | /**
29 | * Get account by puuid
30 | */
31 | public byPuuid(puuid: string): Promise> {
32 | return this.request.get(`${this.regionURL.url.continent}/riot/account/v1/accounts/by-puuid/${puuid}`);
33 | }
34 |
35 | /**
36 | * Get account by riot id
37 | */
38 | public byRiotId(gameName: string, tagLine: string): Promise> {
39 | return this.request.get(`${this.regionURL.url.continent}/riot/account/v1/accounts/by-riot-id/${gameName}/${tagLine}`);
40 | }
41 |
42 | /**
43 | * Get active shard for a player
44 | */
45 | public activeShardsByGameAndPuuid(puuid: string): Promise> {
46 | return this.request.get(`${this.regionURL.url.continent}/riot/account/v1/active-shards/by-game/val/by-puuid/${puuid}`);
47 | }
48 |
49 | /**
50 | * ! This API service is required your project to be registered by Riot Games.
51 | *
52 | * Get account by access token
53 | * @param authorization (Header Parameters)
54 | */
55 | public byAccessToken(authorization: string): Promise> {
56 | return this.request.get(`${this.regionURL.url.continent}/riot/account/v1/accounts/me`, {
57 | headers: {
58 | Authorization: authorization
59 | }
60 | });
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/service/ContentV1.ts:
--------------------------------------------------------------------------------
1 | import type { AxiosResponse } from "axios";
2 |
3 | import type { Locale } from "@valapi/lib";
4 |
5 | import { RiotApiService } from "../client/RiotApiService";
6 |
7 | export namespace ContentV1 {
8 | export interface ActDto {
9 | name: string;
10 | /**
11 | * This field is excluded from the response when a locale is set
12 | */
13 | localizedNames?: Record;
14 | id: string;
15 | isActive: boolean;
16 |
17 | [key: string]: any;
18 | }
19 |
20 | export interface ContentItemDto {
21 | name: string;
22 | /**
23 | * This field is excluded from the response when a locale is set
24 | */
25 | localizedNames?: Record;
26 | id: string;
27 | assetName: string;
28 | /**
29 | * This field is only included for maps and game modes. These values are used in the match response.
30 | */
31 | assetPath?: string;
32 |
33 | [key: string]: any;
34 | }
35 |
36 | export interface ContentDto {
37 | version: string;
38 | characters: Array;
39 | maps: Array;
40 | chromas: Array;
41 | skins: Array;
42 | skinLevels: Array;
43 | equips: Array;
44 | gameModes: Array;
45 | sprays: Array;
46 | sprayLevels: Array;
47 | charms: Array;
48 | charmLevels: Array;
49 | playerCards: Array;
50 | playerTitles: Array;
51 | acts: Array;
52 |
53 | [key: string]: any;
54 | }
55 | }
56 |
57 | export class ContentV1 extends RiotApiService {
58 | /**
59 | * Get content optionally filtered by locale
60 | * @param locale (default: en-US)
61 | */
62 | public contents(locale: Locale.ID = "en-US"): Promise> {
63 | return this.request.get(`${this.regionURL.url.region}/val/content/v1/contents?locale=${locale}`);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/service/RankedV1.ts:
--------------------------------------------------------------------------------
1 | import type { AxiosResponse } from "axios";
2 |
3 | import { RiotApiService } from "../client/RiotApiService";
4 |
5 | export namespace RankedV1 {
6 | export interface PlayerDto {
7 | /**
8 | * This field may be omitted if the player has been anonymized.
9 | */
10 | puuid?: string;
11 | /**
12 | * This field may be omitted if the player has been anonymized.
13 | */
14 | gameName?: string;
15 | /**
16 | * This field may be omitted if the player has been anonymized.
17 | */
18 | tagLine?: string;
19 | leaderboardRank: number;
20 | rankedRating: number;
21 | numberOfWins: number;
22 |
23 | [key: string]: any;
24 | }
25 |
26 | export interface LeaderboardDto {
27 | /**
28 | * The shard for the given leaderboard.
29 | */
30 | shard: string;
31 | /**
32 | * The act id for the given leaderboard. Act ids can be found using the val-content API.
33 | */
34 | actId: string;
35 | /**
36 | * The total number of players in the leaderboard.
37 | */
38 | totalPlayers: number;
39 | players: Array;
40 |
41 | [key: string]: any;
42 | }
43 | }
44 |
45 | export class RankedV1 extends RiotApiService {
46 | /**
47 | * Get leaderboard for the competitive queue
48 | * @param size (default: 200)
49 | * @param startIndex (default: 0)
50 | */
51 | public leaderboardsByAct(actId: string, size: number = 200, startIndex: number = 0): Promise> {
52 | return this.request.get(`${this.regionURL.url.region}/val/ranked/v1/leaderboards/by-act/${actId}?size=${size}&startIndex=${startIndex}`);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/src/service/StatusV1.ts:
--------------------------------------------------------------------------------
1 | import type { AxiosResponse } from "axios";
2 |
3 | import { RiotApiService } from "../client/RiotApiService";
4 |
5 | export namespace StatusV1 {
6 | export interface ContentDto {
7 | locale: string;
8 | content: string;
9 |
10 | [key: string]: any;
11 | }
12 |
13 | export interface UpdateDto {
14 | id: number;
15 | author: string;
16 | publish: boolean;
17 | /**
18 | * (Legal values: riotclient, riotstatus, game)
19 | */
20 | publish_locations: Array;
21 | translations: Array;
22 | created_at: string;
23 | updated_at: string;
24 |
25 | [key: string]: any;
26 | }
27 |
28 | export interface StatusDto {
29 | id: number;
30 | /**
31 | * (Legal values: scheduled, in_progress, complete)
32 | */
33 | maintenance_status: string;
34 | /**
35 | * (Legal values: info, warning, critical)
36 | */
37 | incident_severity: string;
38 | titles: Array;
39 | updates: Array;
40 | created_at: string;
41 | archive_at: string;
42 | updated_at: string;
43 | /**
44 | * (Legal values: windows, macos, android, ios, ps4, xbone, switch)
45 | */
46 | platforms: Array;
47 |
48 | [key: string]: any;
49 | }
50 |
51 | export interface PlatformDataDto {
52 | id: string;
53 | name: string;
54 | locales: Array;
55 | maintenances: Array;
56 | incidents: Array;
57 |
58 | [key: string]: any;
59 | }
60 | }
61 |
62 | export class StatusV1 extends RiotApiService {
63 | /**
64 | * Get VALORANT status for the given platform.
65 | */
66 | public platformData(): Promise> {
67 | return this.request.get(`${this.regionURL.url.region}/val/status/v1/platform-data`);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "./src",
5 | "outDir": "./build",
6 | "paths": {
7 | "@valapi/lib": ["../lib/src"]
8 | }
9 | },
10 | "references": [
11 | {
12 | "path": "../lib"
13 | }
14 | ],
15 | "exclude": ["node_modules", "build", "src/__tests__"]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/@valapi/riot-api/typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "riot-api",
3 | "extends": ["../../../typedoc.base.json"],
4 | "entryPoints": ["src/index.ts"]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 5.0.0-beta.1
2 |
3 | **Add**
4 |
5 | _service_
6 |
7 | - `Internal.uuid()`
8 | - `Internal.riotClientVersion()`
9 |
10 | # 5.0.0-beta.0
11 |
12 | **Change**
13 |
14 | - ~~`ValorantApiCom.axios`~~ **-->** `ValorantApiCom.request`
15 | - ~~`ValorantApiComService.axios`~~ **-->** `ValorantApiComService.request`
16 |
17 | **Remove**
18 |
19 | - `ValorantApiCom.Default`
20 | - `ValorantApiCom.config`
21 |
22 | ### Typescript
23 |
24 | **Change**
25 |
26 | - ~~`ValorantApiCom.Language`~~ **-->** `Language`
27 | - ~~`ValorantApiCom.Config`~~ **-->** `Config`
28 | - ~~`ValorantApiComService.MultipleLanguage`~~ **-->** `AllLanguageResponse`
29 | - ~~`ValorantApiComService.Languages`~~ **-->** `LanguageResponse`
30 | - ~~`ValorantApiComService.Response`~~ **-->** `Response`
31 |
32 | **Remove**
33 |
34 | - `ValorantApiComService.SingleLanguage`
35 | - `ValorantApiComService.BaseResponse`
36 |
37 | # 4.0.0
38 |
39 | **Change**
40 |
41 | - ~~`Agents.get(isPlayableCharacter?)`~~ **-->** `Agents.get(isPlayableCharacter = true)`
42 |
43 | # 3.2.1
44 |
45 | ### Typescript
46 |
47 | **Add**
48 |
49 | - `ValorantApiComService`
50 |
51 | **Remove**
52 |
53 | - `ValorantApiCom.Response`
54 |
55 | # 3.2.0
56 |
57 | **Add**
58 |
59 | - `ValorantApiCom.request()`
60 |
61 | **Remove**
62 |
63 | - `ValorantApiCom.getService()`
64 |
65 | # 3.0.0
66 |
67 | **Add**
68 |
69 | - `ValorantApiCom.getService()`
70 |
71 | _service_
72 |
73 | - `Missions`
74 | - `Objectives`
75 |
76 | ### Typescript
77 |
78 | **Change**
79 |
80 | - ~~`ValorantApiCom.Options`~~ **-->** `ValorantApiCom.Config`
81 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022-2024 Ing Project
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/README.md:
--------------------------------------------------------------------------------
1 | [githubrepo_image]: https://github.com/valapi/.github/blob/main/128_valapi.png?raw=true
2 | [githubrepo_url]: https://github.com/valapi
3 | [download_image]: https://badgen.net/npm/dt/@valapi/valorant-api.com?icon=npm
4 | [download_url]: https://www.npmjs.com/package/@valapi/valorant-api.com
5 | [size_image]: https://packagephobia.com/badge?p=@valapi/valorant-api.com
6 | [size_url]: https://packagephobia.com/result?p=@valapi/valorant-api.com
7 | [vulnerabilities_image]: https://snyk.io/test/npm/@valapi/valorant-api.com/badge.svg
8 | [vulnerabilities_url]: https://snyk.io/test/npm/@valapi/valorant-api.com
9 | [license_image]: https://badgen.net/badge/license/MIT/blue
10 | [license_url]: https://github.com/valapi/.github/blob/main/LICENSE
11 | [github_image]: https://badgen.net/badge/icon/github?icon=github&label
12 | [github_url]: https://github.com/valapi/node-valapi/tree/master/packages/@valapi/valorant-api.com
13 | [discord_image]: https://badgen.net/badge/icon/discord?icon=discord&label
14 | [discord_url]: https://discord.gg/pbyWbUYjyt
15 |
16 |
17 |
18 | # Valorant API - valorant-api.com
19 |
20 | [![Profile][githubrepo_image]][githubrepo_url]
21 |
22 | **Third-Party API** by Officer
23 |
24 | [![Downloads][download_image]][download_url]
25 | [![install size][size_image]][size_url]
26 | [![Known Vulnerabilities][vulnerabilities_image]][vulnerabilities_url]
27 |
28 | [![LICENSE][license_image]][license_url]
29 | [![Github][github_image]][github_url]
30 | [![Discord][discord_image]][discord_url]
31 |
32 | Documentation: [valapi.github.io/docs](https://valapi.github.io/docs)
33 |
34 | Guide: [valapi.github.io/guide](https://valapi.github.io/guide)
35 |
36 |
37 |
38 | ---
39 |
40 | > - **@valapi/valorant-api.com** isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
41 | > - **@valapi/valorant-api.com** was created under [Riot Games' "Legal Jibber Jabber"](https://www.riotgames.com/en/legal) policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.
42 | > - [MIT License][license_url]
43 |
44 | ## Installation
45 |
46 | **NPM:**
47 |
48 | ```bash
49 | npm install @valapi/valorant-api.com
50 | ```
51 |
52 | **PNPM:**
53 |
54 | ```bash
55 | pnpm add @valapi/valorant-api.com
56 | ```
57 |
58 | ## Guide
59 |
60 | ```typescript
61 | import { ValorantApiCom } from "@valapi/valorant-api.com";
62 | ```
63 |
64 | ```typescript
65 | const client = new ValorantApiCom({
66 | language: "en-US"
67 | });
68 | ```
69 |
70 | ### API
71 |
72 | ```typescript
73 | const versions = await client.Versions.get();
74 |
75 | console.log(versions.data);
76 | ```
77 |
78 | ```typescript
79 | const mapUuid = "7eaecc1b-4337-bbf6-6ab9-04b8f06b3319"; /* Ascent */
80 | const map = await client.Maps.getByUuid(mapUuid);
81 |
82 | console.log(events.data);
83 | ```
84 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@valapi/valorant-api.com",
3 | "version": "5.0.0-beta.2",
4 | "publishConfig": {
5 | "registry": "https://registry.npmjs.org",
6 | "access": "public"
7 | },
8 | "description": "Valorant API - valorant-api.com",
9 | "keywords": [
10 | "riot",
11 | "api",
12 | "val",
13 | "valorant",
14 | "valorant-api.com"
15 | ],
16 | "main": "build/index.js",
17 | "types": "./build/index.d.ts",
18 | "repository": {
19 | "type": "git",
20 | "url": "git+https://github.com/valapi/node-valapi.git",
21 | "directory": "packages/@valapi/valorant-api.com"
22 | },
23 | "author": "ing3kth (https://github.com/KTNG-3)",
24 | "license": "MIT",
25 | "bugs": {
26 | "url": "https://github.com/valapi/node-valapi/issues"
27 | },
28 | "homepage": "https://valapi.github.io/guide",
29 | "dependencies": {
30 | "@valapi/lib": "5.0.0-beta.2",
31 | "axios": "^1.7.3"
32 | },
33 | "directories": {
34 | "lib": "build",
35 | "test": "src/__tests__"
36 | },
37 | "files": [
38 | "build",
39 | "CHANGELOG.md",
40 | "LICENSE",
41 | "package.json",
42 | "README.md",
43 | "SECURITY.md"
44 | ]
45 | }
46 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/__tests__/api.ts:
--------------------------------------------------------------------------------
1 | import { Locale } from "@valapi/lib";
2 | import { ValorantApiCom } from "../index";
3 |
4 | describe("valapicom.api", () => {
5 | const client = new ValorantApiCom({
6 | language: Locale.Default.Thai_Thailand,
7 | responseOptions: {
8 | ignore_null: true
9 | }
10 | });
11 |
12 | test("apis", () => {
13 | Promise.all([
14 | client.Agents.get(),
15 | client.Buddies.get(),
16 | client.Buddies.getLevels(),
17 | client.Bundles.get(),
18 | client.Ceremonies.get(),
19 | client.CompetitiveTiers.get(),
20 | client.ContentTiers.get(),
21 | client.Contracts.get(),
22 | client.Currencies.get(),
23 | client.Events.get(),
24 | client.Gamemodes.get(),
25 | client.Gamemodes.getEquippables(),
26 | client.Gear.get(),
27 | client.Internal.riotClientVersion(),
28 | client.LevelBorders.get(),
29 | client.Maps.get(),
30 | client.Missions.get(),
31 | client.Objectives.get(),
32 | client.PlayerCards.get(),
33 | client.PlayerTitles.get(),
34 | client.Seasons.get(),
35 | client.Seasons.getCompetitiveSeasons(),
36 | client.Sprays.get(),
37 | client.Sprays.getLevels(),
38 | client.Themes.get(),
39 | client.Version.get(),
40 | client.Weapons.get(),
41 | client.Weapons.getSkins()
42 | ]).then(values => {
43 | values.forEach(x => {
44 | expect(x.status === 200).toBe(true);
45 | expect(x.data.data).not.toBe([]);
46 | expect(x.data.data).not.toContain([undefined]);
47 | });
48 | });
49 | });
50 | });
51 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/client/ValorantApiCom.ts:
--------------------------------------------------------------------------------
1 | import axios, { AxiosHeaders } from "axios";
2 | import type { AxiosInstance, CreateAxiosDefaults } from "axios";
3 |
4 | import { Locale } from "@valapi/lib";
5 |
6 | import { Agents } from "../service/Agents";
7 | import { Buddies } from "../service/Buddies";
8 | import { Bundles } from "../service/Bundles";
9 | import { Ceremonies } from "../service/Ceremonies";
10 | import { CompetitiveTiers } from "../service/CompetitiveTiers";
11 | import { ContentTiers } from "../service/ContentTiers";
12 | import { Contracts } from "../service/Contracts";
13 | import { Currencies } from "../service/Currencies";
14 | import { Events } from "../service/Events";
15 | import { Gamemodes } from "../service/Gamemodes";
16 | import { Gear } from "../service/Gear";
17 | import { Internal } from "../service/Internal";
18 | import { LevelBorders } from "../service/LevelBorders";
19 | import { Maps } from "../service/Maps";
20 | import { Missions } from "../service/Missions";
21 | import { Objectives } from "../service/Objectives";
22 | import { PlayerCards } from "../service/PlayerCards";
23 | import { PlayerTitles } from "../service/PlayerTitles";
24 | import { Seasons } from "../service/Seasons";
25 | import { Sprays } from "../service/Sprays";
26 | import { Themes } from "../service/Themes";
27 | import { Version } from "../service/Version";
28 | import { Weapons } from "../service/Weapons";
29 |
30 | export type Language = Exclude | "all";
31 |
32 | export interface Config {
33 | language?: L;
34 | axiosConfig?: CreateAxiosDefaults;
35 | responseOptions?: {
36 | /**
37 | * Delete properties that have a `null` value
38 | */
39 | ignore_null?: boolean;
40 | };
41 | }
42 |
43 | /**
44 | * Third-Party API by Officer
45 | *
46 | * https://valorant-api.com
47 | */
48 | export class ValorantApiCom {
49 | protected readonly request: AxiosInstance;
50 |
51 | public constructor(config: Config = {}) {
52 | const headers = new AxiosHeaders();
53 | headers.setContentType("application/json");
54 |
55 | this.request = axios.create({
56 | ...config.axiosConfig,
57 | ...{
58 | baseURL: "https://valorant-api.com",
59 | headers: {
60 | ...config.axiosConfig?.headers,
61 | ...headers.toJSON()
62 | },
63 | params: {
64 | ...config.axiosConfig?.params,
65 | ...{
66 | language: config.language,
67 | responseOptions: config.responseOptions
68 | ? Object.entries(config.responseOptions)
69 | .filter(x => x[1])
70 | .map(x => x[0])
71 | .join(" ")
72 | : undefined
73 | }
74 | }
75 | }
76 | });
77 | }
78 |
79 | public get Agents(): Agents {
80 | return new Agents(this.request);
81 | }
82 |
83 | public get Buddies(): Buddies {
84 | return new Buddies(this.request);
85 | }
86 |
87 | public get Bundles(): Bundles {
88 | return new Bundles(this.request);
89 | }
90 |
91 | public get Ceremonies(): Ceremonies {
92 | return new Ceremonies(this.request);
93 | }
94 |
95 | public get CompetitiveTiers(): CompetitiveTiers {
96 | return new CompetitiveTiers(this.request);
97 | }
98 |
99 | public get ContentTiers(): ContentTiers {
100 | return new ContentTiers(this.request);
101 | }
102 |
103 | public get Contracts(): Contracts {
104 | return new Contracts(this.request);
105 | }
106 |
107 | public get Currencies(): Currencies {
108 | return new Currencies(this.request);
109 | }
110 |
111 | public get Events(): Events {
112 | return new Events(this.request);
113 | }
114 |
115 | public get Gamemodes(): Gamemodes {
116 | return new Gamemodes(this.request);
117 | }
118 |
119 | public get Gear(): Gear {
120 | return new Gear(this.request);
121 | }
122 |
123 | public get Internal(): Internal {
124 | return new Internal(this.request);
125 | }
126 |
127 | public get LevelBorders(): LevelBorders {
128 | return new LevelBorders(this.request);
129 | }
130 |
131 | public get Maps(): Maps {
132 | return new Maps(this.request);
133 | }
134 |
135 | public get Missions(): Missions {
136 | return new Missions(this.request);
137 | }
138 |
139 | public get Objectives(): Objectives {
140 | return new Objectives(this.request);
141 | }
142 |
143 | public get PlayerCards(): PlayerCards {
144 | return new PlayerCards(this.request);
145 | }
146 |
147 | public get PlayerTitles(): PlayerTitles {
148 | return new PlayerTitles(this.request);
149 | }
150 |
151 | public get Seasons(): Seasons {
152 | return new Seasons(this.request);
153 | }
154 |
155 | public get Sprays(): Sprays {
156 | return new Sprays(this.request);
157 | }
158 |
159 | public get Themes(): Themes {
160 | return new Themes(this.request);
161 | }
162 |
163 | public get Version(): Version {
164 | return new Version(this.request);
165 | }
166 |
167 | public get Weapons(): Weapons {
168 | return new Weapons(this.request);
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/client/ValorantApiComService.ts:
--------------------------------------------------------------------------------
1 | import type { AxiosInstance, AxiosResponse } from "axios";
2 |
3 | import type { Language } from "./ValorantApiCom";
4 |
5 | export type AllLanguageResponse = Record, T>;
6 | export type LanguageResponse = L extends "all" ? AllLanguageResponse : T;
7 |
8 | export type Response = Promise<
9 | AxiosResponse<{
10 | status: number;
11 | data?: T;
12 | error?: string;
13 | }>
14 | >;
15 |
16 | export class ValorantApiComService {
17 | protected readonly request: AxiosInstance;
18 |
19 | public constructor(request: AxiosInstance) {
20 | this.request = request;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/index.ts:
--------------------------------------------------------------------------------
1 | import { ValorantApiCom } from "./client/ValorantApiCom";
2 |
3 | export { ValorantApiCom };
4 | export type { Language, Config } from "./client/ValorantApiCom";
5 | export { ValorantApiComService } from "./client/ValorantApiComService";
6 | export type { AllLanguageResponse, LanguageResponse, Response } from "./client/ValorantApiComService";
7 |
8 | export { Agents } from "./service/Agents";
9 | export { Buddies } from "./service/Buddies";
10 | export { Bundles } from "./service/Bundles";
11 | export { Ceremonies } from "./service/Ceremonies";
12 | export { CompetitiveTiers } from "./service/CompetitiveTiers";
13 | export { ContentTiers } from "./service/ContentTiers";
14 | export { Contracts } from "./service/Contracts";
15 | export { Currencies } from "./service/Currencies";
16 | export { Events } from "./service/Events";
17 | export { Gamemodes } from "./service/Gamemodes";
18 | export { Gear } from "./service/Gear";
19 | export { Internal } from "./service/Internal";
20 | export { LevelBorders } from "./service/LevelBorders";
21 | export { Maps } from "./service/Maps";
22 | export { Missions } from "./service/Missions";
23 | export { Objectives } from "./service/Objectives";
24 | export { PlayerCards } from "./service/PlayerCards";
25 | export { PlayerTitles } from "./service/PlayerTitles";
26 | export { Seasons } from "./service/Seasons";
27 | export { Sprays } from "./service/Sprays";
28 | export { Themes } from "./service/Themes";
29 | export { Version } from "./service/Version";
30 | export { Weapons } from "./service/Weapons";
31 |
32 | export default ValorantApiCom;
33 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Agents.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Agents {
6 | export interface Agents {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | description: LanguageResponse;
10 | developerName: string;
11 | characterTags: LanguageResponse, L>;
12 | displayIcon: string;
13 | displayIconSmall: string;
14 | bustPortrait: string;
15 | fullPortrait: string;
16 | fullPortraitV2: string;
17 | killfeedPortrait: string;
18 | background: string;
19 | backgroundGradientColors: Array;
20 | assetPath: string;
21 | isFullPortraitRightFacing: boolean;
22 | isPlayableCharacter: boolean;
23 | isAvailableForTest: boolean;
24 | isBaseContent: boolean;
25 | role: {
26 | uuid: string;
27 | displayName: LanguageResponse;
28 | description: LanguageResponse;
29 | displayIcon: string;
30 | assetPath: string;
31 | };
32 | recruitmentData: {
33 | counterId: string;
34 | milestoneId: string;
35 | milestoneThreshold: number;
36 | useLevelVpCostOverride: boolean;
37 | levelVpCostOverride: number;
38 | startDate: string | Date;
39 | endDate: string | Date;
40 | };
41 | abilities: Array<{
42 | slot: string;
43 | displayName: LanguageResponse;
44 | description: LanguageResponse;
45 | displayIcon: string;
46 | }>;
47 | voiceLines: {
48 | minDuration: number;
49 | maxDuration: number;
50 | mediaList: Array<{
51 | id: number;
52 | wwise: string;
53 | wave: string;
54 | }>;
55 | };
56 | }
57 | }
58 |
59 | export class Agents extends ValorantApiComService {
60 | public get(isPlayableCharacter: boolean = true): Response[]> {
61 | return this.request.get(`/v1/agents`, {
62 | params: {
63 | isPlayableCharacter: isPlayableCharacter
64 | }
65 | });
66 | }
67 |
68 | public getByUuid(uuid: string): Response> {
69 | return this.request.get(`/v1/agents/${uuid}`);
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Buddies.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Buddies {
6 | export interface BuddyLevels {
7 | uuid: string;
8 | charmLevel: number;
9 | hideIfNotOwned: boolean;
10 | displayName: LanguageResponse;
11 | displayIcon: string;
12 | assetPath: string;
13 | }
14 |
15 | export interface Buddies {
16 | uuid: string;
17 | displayName: LanguageResponse;
18 | isHiddenIfNotOwned: boolean;
19 | themeUuid: string;
20 | displayIcon: string;
21 | assetPath: string;
22 | levels: Array>;
23 | }
24 | }
25 |
26 | export class Buddies extends ValorantApiComService {
27 | public get(): Response[]> {
28 | return this.request.get(`/v1/buddies`);
29 | }
30 |
31 | public getLevels(): Response[]> {
32 | return this.request.get(`/v1/buddies/levels`);
33 | }
34 |
35 | public getByUuid(uuid: string): Response> {
36 | return this.request.get(`/v1/buddies/${uuid}`);
37 | }
38 |
39 | public getLevelByUuid(uuid: string): Response> {
40 | return this.request.get(`/v1/buddies/levels/${uuid}`);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Bundles.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Bundles {
6 | export interface Bundles {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | displayNameSubText: LanguageResponse;
10 | description: LanguageResponse;
11 | extraDescription: LanguageResponse;
12 | promoDescription: LanguageResponse;
13 | useAdditionalContext: boolean;
14 | displayIcon: string;
15 | displayIcon2: string;
16 | logoIcon: string;
17 | verticalPromoImage: string;
18 | assetPath: string;
19 | }
20 | }
21 |
22 | export class Bundles extends ValorantApiComService {
23 | public get(): Response[]> {
24 | return this.request.get(`/v1/bundles`);
25 | }
26 |
27 | public getByUuid(uuid: string): Response> {
28 | return this.request.get(`/v1/bundles/${uuid}`);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Ceremonies.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Ceremonies {
6 | export interface Ceremonies {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | assetPath: string;
10 | }
11 | }
12 |
13 | export class Ceremonies extends ValorantApiComService {
14 | public get(): Response[]> {
15 | return this.request.get(`/v1/ceremonies`);
16 | }
17 |
18 | public getByUuid(uuid: string): Response> {
19 | return this.request.get(`/v1/ceremonies/${uuid}`);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/CompetitiveTiers.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace CompetitiveTiers {
6 | export interface CompetitiveTiers {
7 | uuid: string;
8 | assetObjectName: string;
9 | tiers: Array<{
10 | tier: number;
11 | tierName: LanguageResponse;
12 | division: string;
13 | divisionName: LanguageResponse;
14 | color: string;
15 | backgroundColor: string;
16 | smallIcon: string;
17 | largeIcon: string;
18 | rankTriangleDownIcon: string;
19 | rankTriangleUpIcon: string;
20 | }>;
21 | assetPath: string;
22 | }
23 | }
24 |
25 | export class CompetitiveTiers extends ValorantApiComService {
26 | public get(): Response[]> {
27 | return this.request.get(`/v1/competitivetiers`);
28 | }
29 |
30 | public getByUuid(uuid: string): Response> {
31 | return this.request.get(`/v1/competitivetiers/${uuid}`);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/ContentTiers.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace ContentTiers {
6 | export interface ContentTiers {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | devName: string;
10 | rank: number;
11 | juiceValue: number;
12 | juiceCost: number;
13 | highlightColor: string;
14 | displayIcon: string;
15 | assetPath: string;
16 | }
17 | }
18 |
19 | export class ContentTiers extends ValorantApiComService {
20 | public get(): Response[]> {
21 | return this.request.get(`/v1/contenttiers`);
22 | }
23 |
24 | public getByUuid(uuid: string): Response> {
25 | return this.request.get(`/v1/contenttiers/${uuid}`);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Contracts.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Contracts {
6 | export interface Contracts {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | displayIcon: string;
10 | shipIt: boolean;
11 | useLevelVPCostOverride: boolean;
12 | levelVPCostOverride: number;
13 | freeRewardScheduleUuid: string;
14 | content: {
15 | relationType: string;
16 | relationUuid: string;
17 | chapters: Array<{
18 | isEpilogue: boolean;
19 | levels: Array<{
20 | reward: {
21 | type: string;
22 | uuid: string;
23 | amount: number;
24 | isHighlighted: boolean;
25 | };
26 | xp: number;
27 | vpCost: number;
28 | isPurchasableWithVP: boolean;
29 | doughCost: number;
30 | isPurchasableWithDough: boolean;
31 | }>;
32 | freeRewards: Array<{
33 | type: string;
34 | uuid: string;
35 | amount: number;
36 | isHighlighted: boolean;
37 | }>;
38 | }>;
39 | premiumRewardScheduleUuid: string;
40 | premiumVPCost: number;
41 | };
42 | assetPath: string;
43 | }
44 | }
45 |
46 | export class Contracts extends ValorantApiComService {
47 | public get(): Response[]> {
48 | return this.request.get(`/v1/contracts`);
49 | }
50 |
51 | public getByUuid(uuid: string): Response> {
52 | return this.request.get(`/v1/contracts/${uuid}`);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Currencies.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Currencies {
6 | export interface Currencies {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | displayNameSingular: LanguageResponse;
10 | displayIcon: string;
11 | largeIcon: string;
12 | assetPath: string;
13 | }
14 | }
15 |
16 | export class Currencies extends ValorantApiComService {
17 | public get(): Response[]> {
18 | return this.request.get(`/v1/currencies`);
19 | }
20 |
21 | public getByUuid(uuid: string): Response> {
22 | return this.request.get(`/v1/currencies/${uuid}`);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Events.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Events {
6 | export interface Events {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | shortDisplayName: LanguageResponse;
10 | startTime: string | Date;
11 | endTime: string | Date;
12 | assetPath: string;
13 | }
14 | }
15 |
16 | export class Events extends ValorantApiComService {
17 | public get(): Response[]> {
18 | return this.request.get(`/v1/events`);
19 | }
20 |
21 | public getByUuid(uuid: string): Response> {
22 | return this.request.get(`/v1/events/${uuid}`);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Gamemodes.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Gamemodes {
6 | export interface Gamemodes {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | duration: LanguageResponse;
10 | economyType: string;
11 | allowsMatchTimeouts: boolean;
12 | isTeamVoiceAllowed: boolean;
13 | isMinimapHidden: boolean;
14 | orbCount: number;
15 | /**
16 | * `-1` means no data was available
17 | */
18 | roundsPerHalf: number;
19 | teamRoles: Array;
20 | gameFeatureOverrides: Array<{
21 | featureName: string;
22 | state: boolean;
23 | }>;
24 | gameRuleBoolOverrides: Array<{
25 | ruleName: string;
26 | state: boolean;
27 | }>;
28 | displayIcon: string;
29 | listViewIconTall: string;
30 | assetPath: string;
31 | }
32 |
33 | export interface GamemodeEquippables {
34 | uuid: string;
35 | displayName: LanguageResponse;
36 | category: string;
37 | displayIcon: string;
38 | killStreamIcon: string;
39 | assetPath: string;
40 | }
41 | }
42 |
43 | export class Gamemodes extends ValorantApiComService {
44 | public get(): Response[]> {
45 | return this.request.get(`/v1/gamemodes`);
46 | }
47 |
48 | public getEquippables(): Response[]> {
49 | return this.request.get(`/v1/gamemodes/equippables`);
50 | }
51 |
52 | public getByUuid(uuid: string): Response> {
53 | return this.request.get(`/v1/gamemodes/${uuid}`);
54 | }
55 |
56 | public getEquippableByUuid(uuid: string): Response> {
57 | return this.request.get(`/v1/gamemodes/equippables/${uuid}`);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Gear.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Gear {
6 | export interface Gear {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | description: LanguageResponse;
10 | displayIcon: string;
11 | assetPath: string;
12 | shopData: {
13 | cost: number;
14 | category: string;
15 | shopOrderPriority: number;
16 | categoryText: LanguageResponse;
17 | gridPosition: {
18 | row: number;
19 | column: number;
20 | };
21 | canBeTrashed: boolean;
22 | image: string;
23 | newImage: string;
24 | newImage2: string;
25 | assetPath: string;
26 | };
27 | }
28 | }
29 |
30 | export class Gear extends ValorantApiComService {
31 | public get(): Response[]> {
32 | return this.request.get(`/v1/gear`);
33 | }
34 |
35 | public getByUuid(uuid: string): Response> {
36 | return this.request.get(`/v1/gear/${uuid}`);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Internal.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Internal {
6 | /**
7 | * ! unknown from website
8 | */
9 |
10 | export interface UUID {
11 | uuid: string;
12 | type: string;
13 | displayName: LanguageResponse;
14 | }
15 |
16 | export interface RiotClientVersion {
17 | manifestFileName: string;
18 | userAgentVersion: string;
19 | riotClientFoundationInfo: {
20 | VS_FIXEDFILEINFO: {
21 | FileVersion: string;
22 | ProductVersion: string;
23 | FileFlagsMask: string;
24 | FileFlags: `${number}`;
25 | FileOS: string;
26 | FileType: string;
27 | FileSubtype: string;
28 | };
29 | StringTable: {
30 | Language: `${number}`;
31 | CodePage: `${number}`;
32 | FileDescription: string;
33 | FileVersion: string;
34 | InternalName: string;
35 | OriginalFilename: string;
36 | ProductName: string;
37 | ProductVersion: string;
38 | CompanyName: string;
39 | LegalCopyright: string;
40 | };
41 | Translation: {
42 | Language: `${number}`;
43 | CodePage: `${number}`;
44 | };
45 | };
46 | riotGamesApiInfo: {
47 | VS_FIXEDFILEINFO: {
48 | FileVersion: string;
49 | ProductVersion: string;
50 | FileFlagsMask: string;
51 | FileFlags: string;
52 | FileOS: string;
53 | FileType: string;
54 | FileSubtype: string;
55 | };
56 | StringTable: {
57 | Language: `${number}`;
58 | CodePage: `${number}`;
59 | FileDescription: string;
60 | FileVersion: string;
61 | InternalName: string;
62 | OriginalFilename: string;
63 | ProductName: string;
64 | ProductVersion: string;
65 | CompanyName: string;
66 | LegalCopyright: string;
67 | };
68 | Translation: {
69 | Language: `${number}`;
70 | CodePage: `${number}`;
71 | };
72 | };
73 | }
74 | }
75 |
76 | export class Internal extends ValorantApiComService {
77 | public uuid(): Response[]> {
78 | return this.request.get(`/internal/uuids`);
79 | }
80 |
81 | public riotClientVersion(): Response {
82 | return this.request.get(`/internal/ritoclientversion`);
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/LevelBorders.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace LevelBorders {
6 | export interface LevelBorders {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | startingLevel: number;
10 | levelNumberAppearance: string;
11 | smallPlayerCardAppearance: string;
12 | assetPath: string;
13 | }
14 | }
15 |
16 | export class LevelBorders extends ValorantApiComService {
17 | public get(): Response[]> {
18 | return this.request.get(`/v1/levelborders`);
19 | }
20 |
21 | public getByUuid(uuid: string): Response> {
22 | return this.request.get(`/v1/levelborders/${uuid}`);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Maps.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Maps {
6 | export interface Maps {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | narrativeDescription: LanguageResponse;
10 | tacticalDescription: LanguageResponse;
11 | coordinates: LanguageResponse;
12 | displayIcon: string;
13 | listViewIcon: string;
14 | listViewIconTall: string;
15 | splash: string;
16 | stylizedBackgroundImage: string;
17 | premierBackgroundImage: string;
18 | assetPath: string;
19 | mapUrl: string;
20 | xMultiplier: number;
21 | yMultiplier: number;
22 | xScalarToAdd: number;
23 | yScalarToAdd: number;
24 | callouts: Array<{
25 | regionName: LanguageResponse;
26 | superRegionName: LanguageResponse;
27 | location: {
28 | x: number;
29 | y: number;
30 | };
31 | }>;
32 | }
33 | }
34 |
35 | export class Maps extends ValorantApiComService {
36 | public get(): Response[]> {
37 | return this.request.get(`/v1/maps`);
38 | }
39 |
40 | public getByUuid(uuid: string): Response> {
41 | return this.request.get(`/v1/maps/${uuid}`);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Missions.ts:
--------------------------------------------------------------------------------
1 | import { ValorantApiComService } from "../client/ValorantApiComService";
2 | import type { Response } from "../client/ValorantApiComService";
3 |
4 | export namespace Missions {
5 | /**
6 | * ! unknown from website
7 | */
8 |
9 | export interface Missions {
10 | uuid: string;
11 | displayName: string;
12 | title: string;
13 | type: string;
14 | xpGrant: number;
15 | progressToComplete: number;
16 | activationDate: string | Date;
17 | expirationDate: string | Date;
18 | tags: Array;
19 | objectives: Array<{
20 | objectiveUuid: string;
21 | value: number;
22 | }>;
23 | assetPath: string;
24 | }
25 | }
26 |
27 | export class Missions extends ValorantApiComService {
28 | public get(): Response {
29 | return this.request.get(`/v1/missions`);
30 | }
31 |
32 | public getByUuid(uuid: string): Response {
33 | return this.request.get(`/v1/missions/${uuid}`);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Objectives.ts:
--------------------------------------------------------------------------------
1 | import { ValorantApiComService } from "../client/ValorantApiComService";
2 | import type { Response } from "../client/ValorantApiComService";
3 |
4 | export namespace Objectives {
5 | /**
6 | * ! unknown from website
7 | */
8 |
9 | export interface Objectives {
10 | uuid: string;
11 | directive: string;
12 | assetPath: string;
13 | }
14 | }
15 |
16 | export class Objectives extends ValorantApiComService {
17 | public get(): Response {
18 | return this.request.get(`/v1/objectives`);
19 | }
20 |
21 | public getByUuid(uuid: string): Response {
22 | return this.request.get(`/v1/objectives/${uuid}`);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/PlayerCards.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace PlayerCards {
6 | export interface PlayerCards {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | isHiddenIfNotOwned: boolean;
10 | themeUuid: string;
11 | displayIcon: string;
12 | smallArt: string;
13 | wideArt: string;
14 | largeArt: string;
15 | assetPath: string;
16 | }
17 | }
18 |
19 | export class PlayerCards extends ValorantApiComService {
20 | public get(): Response[]> {
21 | return this.request.get(`/v1/playercards`);
22 | }
23 |
24 | public getByUuid(uuid: string): Response> {
25 | return this.request.get(`/v1/playercards/${uuid}`);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/PlayerTitles.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace PlayerTitles {
6 | export interface PlayerTitles {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | titleText: LanguageResponse;
10 | isHiddenIfNotOwned: boolean;
11 | assetPath: string;
12 | }
13 | }
14 |
15 | export class PlayerTitles extends ValorantApiComService {
16 | public get(): Response[]> {
17 | return this.request.get(`/v1/playertitles`);
18 | }
19 |
20 | public getByUuid(uuid: string): Response> {
21 | return this.request.get(`/v1/playertitles/${uuid}`);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/@valapi/valorant-api.com/src/service/Seasons.ts:
--------------------------------------------------------------------------------
1 | import type { Language } from "../client/ValorantApiCom";
2 | import { ValorantApiComService } from "../client/ValorantApiComService";
3 | import type { LanguageResponse, Response } from "../client/ValorantApiComService";
4 |
5 | export namespace Seasons {
6 | export interface Seasons {
7 | uuid: string;
8 | displayName: LanguageResponse;
9 | type: string;
10 | startTime: string | Date;
11 | endTime: string | Date;
12 | parentUuid: string;
13 | assetPath: string;
14 | }
15 |
16 | export interface CompetitiveSeasons {
17 | uuid: string;
18 | startTime: string | Date;
19 | endTime: string | Date;
20 | seasonUuid: string;
21 | competitiveTiersUuid: string;
22 | borders: Array<{
23 | uuid: string;
24 | level: number;
25 | winsRequired: number;
26 | displayIcon: string;
27 | smallIcon: string;
28 | assetPath: string;
29 | }>;
30 | assetPath: string;
31 | }
32 | }
33 |
34 | export class Seasons