Skip to content

Commit

Permalink
reorganize name, type, packages
Browse files Browse the repository at this point in the history
  • Loading branch information
KTNG-3 committed Jun 30, 2024
1 parent f2e5872 commit 5a5c7d8
Show file tree
Hide file tree
Showing 36 changed files with 230 additions and 368 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| ---------- | ----------- |
| Rate Limit | Missing |

**@/valorant.ts**
**@/crosshair**

| Type | Name | Progression |
| ----- | ------------ | ----------- |
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"workspaces": [
"packages/@valapi/auth",
"packages/@valapi/crosshair",
"packages/@valapi/lib",
"packages/@valapi/riot-api",
"packages/@valapi/valorant-api.com",
"packages/@valapi/web-client",
"packages/valorant.ts"
"packages/@valapi/web-client"
],
"private": true,
"name": "node-valapi",
Expand All @@ -18,16 +18,18 @@
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.12.7",
"@types/node": "^20.14.9",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"jest": "29.7.0",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.2",
"typedoc": "^0.25.13",
"typescript": "^5.4.5"
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"ts-jest": "^29.1.5",
"ts-node": "^10.9.2",
"typedoc": "^0.26.3",
"typescript": "^5.5.2"
},
"scripts": {
"test": "jest --detectOpenHandles",
Expand Down
2 changes: 1 addition & 1 deletion packages/@valapi/auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 5.0.0
# 5.0.0-beta.0

**Change**

Expand Down
8 changes: 4 additions & 4 deletions packages/@valapi/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@valapi/auth",
"version": "5.0.0",
"version": "5.0.0-beta.0",
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
Expand Down Expand Up @@ -29,9 +29,9 @@
},
"homepage": "https://github.com/valapi/node-valapi/tree/master/packages/@valapi/auth#readme",
"dependencies": {
"@valapi/lib": "^4.0.0",
"http-cookie-agent": "^6.0.3",
"tough-cookie": "^4.1.3"
"@valapi/lib": "5.0.0-beta.0",
"http-cookie-agent": "^6.0.5",
"tough-cookie": "^4.1.4"
},
"devDependencies": {
"@types/tough-cookie": "^4.0.5"
Expand Down
2 changes: 1 addition & 1 deletion packages/@valapi/auth/src/client/AuthRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class AuthRequest {
const requestConfig = {
...{
userAgent: "RiotClient/53.0.0.4494832.4470164 %s (Windows;10;;Professional, x64)",
version: "release-08.07-shipping-9-2444158",
version: "release-09.00-shipping-28-2628993",
platform: {
platformType: "PC",
platformOS: "Windows",
Expand Down
Empty file.
42 changes: 21 additions & 21 deletions packages/valorant.ts/LICENSE → packages/@valapi/crosshair/LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License
Copyright (c) 2022-2023 ING Project
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License

Copyright (c) 2022-2024 ING Project

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
52 changes: 52 additions & 0 deletions packages/@valapi/crosshair/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[githubrepo_image]: https://github.com/valapi/.github/blob/main/128_valapi.png?raw=true
[githubrepo_url]: https://github.com/valapi
[download_image]: https://badgen.net/npm/dt/@valapi/crosshair?icon=npm
[download_url]: https://www.npmjs.com/package/@valapi/crosshair
[size_image]: https://packagephobia.com/badge?p=@valapi/crosshair
[size_url]: https://packagephobia.com/result?p=@valapi/crosshair
[vulnerabilities_image]: https://snyk.io/test/npm/@valapi/crosshair/badge.svg
[vulnerabilities_url]: https://snyk.io/test/npm/@valapi/crosshair
[license_image]: https://badgen.net/badge/license/MIT/blue
[license_url]: https://github.com/valapi/.github/blob/main/LICENSE
[github_image]: https://badgen.net/badge/icon/github?icon=github&label
[github_url]: https://github.com/valapi/node-valapi/tree/master/packages/@valapi/crosshair
[discord_image]: https://badgen.net/badge/icon/discord?icon=discord&label
[discord_url]: https://discord.gg/pbyWbUYjyt

<div align="center">

# Valorant API - Crosshair

[![Profile][githubrepo_image]][github_url]

Valorant Crosshair Parser

[![Downloads][download_image]][download_url]
[![install size][size_image]][size_url]
[![Known Vulnerabilities][vulnerabilities_image]][vulnerabilities_url]

[![LICENSE][license_image]][license_url]
[![Github][github_image]][github_url]
[![Discord][discord_image]][discord_url]

</div>

---

> - **@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.
> - **@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.
> - [MIT License][license_url]
## Installation

**NPM:**

```bash
npm install @valapi/crosshair
```

**PNPM:**

```bash
pnpm add @valapi/crosshair
```
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
{
"name": "valorant.ts",
"version": "4.0.0",
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
},
"description": "Valorant API",
"keywords": [
"riot",
"api",
"val",
"valorant",
"all-in-one"
],
"main": "build/index.js",
"types": "./build/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/valapi/node-valapi.git",
"directory": "packages/valorant.ts"
},
"author": "ing3kth (https://github.com/KTNG-3)",
"license": "MIT",
"bugs": {
"url": "https://github.com/valapi/node-valapi/issues"
},
"homepage": "https://github.com/valapi/node-valapi/tree/master/packages/valorant.ts#readme",
"dependencies": {
"@valapi/auth": "^5.0.0",
"@valapi/lib": "^4.0.0",
"@valapi/riot-api": "^5.0.0",
"@valapi/valorant-api.com": "^5.0.0",
"@valapi/web-client": "^5.0.0"
},
"directories": {
"lib": "build",
"test": "__tests__"
},
"files": [
"build",
"CHANGELOG.md",
"LICENSE",
"package.json",
"README.md",
"SECURITY.md"
]
}
{
"name": "@valapi/crosshair",
"version": "5.0.0-alpha.0",
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
},
"description": "Valorant API - Crosshair",
"keywords": [
"riot",
"api",
"val",
"valorant",
"crosshair"
],
"main": "build/index.js",
"types": "./build/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/valapi/node-valapi.git",
"directory": "packages/@valapi/crosshair"
},
"author": "ing3kth (https://github.com/KTNG-3)",
"license": "MIT",
"bugs": {
"url": "https://github.com/valapi/node-valapi/issues"
},
"homepage": "https://github.com/valapi/node-valapi/tree/master/packages/@valapi/crosshair#readme",
"dependencies": {
"@valapi/lib": "5.0.0-beta.0"
},
"directories": {
"lib": "build",
"test": "src/__tests__"
},
"files": [
"build",
"CHANGELOG.md",
"LICENSE",
"package.json",
"README.md",
"SECURITY.md"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ValCrosshair } from "../index";

describe("valorant_ts.crosshair", () => {
describe("crosshair", () => {
test("set", () => {
const crosshair: ValCrosshair = new ValCrosshair();

Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions packages/@valapi/crosshair/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./build",
"paths": {
"@valapi/lib": ["../lib/src"]
}
},
"references": [
{
"path": "../lib"
}
],
"exclude": ["node_modules", "build", "src/__tests__"]
}
5 changes: 5 additions & 0 deletions packages/@valapi/crosshair/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "crosshair",
"extends": ["../../../typedoc.base.json"],
"entryPoints": ["src/index.ts"]
}
11 changes: 11 additions & 0 deletions packages/@valapi/lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# 5.0.0-beta.0

**Add**

- `ValVersion`

**Change**

- ~~`QueueId.fromName(x)`~~ **-->** `QueueId.fromName(x, newMapID?)`
- ~~`QueueId.fromID(x)`~~ **-->** `QueueId.fromID(x, newMapID?)`

# 4.0.0

**Add**
Expand Down
6 changes: 3 additions & 3 deletions packages/@valapi/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@valapi/lib",
"version": "4.0.0",
"version": "5.0.0-beta.0",
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
Expand All @@ -26,8 +26,8 @@
},
"homepage": "https://github.com/valapi/node-valapi/tree/master/packages/@valapi/lib#readme",
"dependencies": {
"axios": "^1.6.8",
"tslib": "^2.6.2"
"axios": "^1.7.2",
"tslib": "^2.6.3"
},
"directories": {
"lib": "build",
Expand Down
7 changes: 7 additions & 0 deletions packages/@valapi/lib/src/__tests__/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ describe("lib.resource", () => {
expect(QueueId.fromID("onefa")).toBe("Replication");
});

test("queue.newmap", () => {
const newMapID = <QueueId.ID>"abyss";

expect(QueueId.fromName("New_Map", newMapID)).toBe(newMapID);
expect(QueueId.fromID(newMapID, newMapID)).toBe("New_Map");
});

test("region", () => {
expect(Region.fromName("Brazil")).toBe("br");
expect(Region.fromID("pbe")).toBe("Public_Beta_Environment");
Expand Down
3 changes: 2 additions & 1 deletion packages/@valapi/lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export * as Locale from "./resources/Locale";
export * as QueueId from "./resources/QueueId";
export * as Region from "./resources/Region";

export { ValEncryption } from "./utils/encryption";
export { ValEncryption } from "./utils/ValEncryption";
export { ValVersion } from "./utils/ValVersion";
17 changes: 12 additions & 5 deletions packages/@valapi/lib/src/resources/QueueId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,27 @@ export const Default = <const>{
Custom: "",
Custom_Tournament: "tournamentmode",

// * change when having a new map
New_Map: undefined
New_Map: "newmap"
};

export type Name = keyof typeof Default;
export type ID = Exclude<(typeof Default)[Name], (typeof Default)["New_Map"] | "">;

export function fromName(x: Name): ID {
export function fromName(x: Name, newMapID: string = "abyss"): ID {
if (x == "New_Map") {
return <ID>newMapID;
}

return <ID>Default[x];
}

export function fromID(x: ID): Name {
export function fromID(x: ID, newMapID: string = "abyss"): Name {
for (const data of Object.entries(Default)) {
if (typeof data[1] == "string" && data[1] == x) {
if (data[1] == "newmap" && x == newMapID) {
return "New_Map";
}

if (data[1] == x) {
return <Name>data[0];
}
}
Expand Down
Loading

0 comments on commit 5a5c7d8

Please sign in to comment.