diff --git a/.changeset/sixty-parrots-own.md b/.changeset/sixty-parrots-own.md new file mode 100644 index 00000000..445a290f --- /dev/null +++ b/.changeset/sixty-parrots-own.md @@ -0,0 +1,7 @@ +--- +"kiai.js": major +--- + +Implement all v1 API features + +**This is a major release**, and thus, is a breaking change from previous early releases of Kiai.js. \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 76b51040..5c7aa7d9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,2 @@ * @thewilloftheshadow -/packages/kiai.js @OIRNOIR \ No newline at end of file +/packages/kiai.js @thewilloftheshadow @OIRNOIR \ No newline at end of file diff --git a/.github/workflows/kiai_docs.yml b/.github/workflows/docs.yml similarity index 81% rename from .github/workflows/kiai_docs.yml rename to .github/workflows/docs.yml index 59e0c9bf..61663d5e 100644 --- a/.github/workflows/kiai_docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -name: Generate kiai.js docs +name: Generate Docs on: push: @@ -34,12 +34,12 @@ jobs: run: pnpm install - name: Generate Docs - run: pnpm run docs --filter kiai.js + run: pnpm run docs - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: - publish_branch: kiaijs-docs + publish_branch: docs github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./packages/kiai.js/docs - cname: kiai.js.org + publish_dir: ./docs + cname: utilities.buape.com \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d01975f..2de33dca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - uses: pnpm/action-setup@v2.2.4 with: - version: 7 + version: 8 - name: Setup Node.js environment uses: actions/setup-node@v3 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..db5b73a2 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "tabWidth": 4, + "semi": false, + "useTabs": true, + "proseWrap": "never", + "printWidth": 150, + "trailingComma": "none", + "singleQuote": false +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 95ab3e2d..399f836d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "dotenv.enableAutocloaking": false + "dotenv.enableAutocloaking": false, + "findUnusedExports.detectCircularImports": true } \ No newline at end of file diff --git a/LICENSE b/LICENSE index 16e5c4c4..9dfdf87b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Buape +Copyright (c) 2023 Buape Studios Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index 09193a7c..fc8f6c63 100644 --- a/package.json +++ b/package.json @@ -5,22 +5,29 @@ "private": true, "scripts": { "build": "turbo run build", + "clean": "turbo run clean", + "coverage": "vitest run --coverage", + "docs": "typedoc", "dev": "dotenv -- turbo run dev", - "pretty": "pnpm run format && pnpm run lint", - "lint": "turbo run lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "lint": "turbo run lint", "preinstall": "only-allow pnpm", - "clean": "turbo run clean", + "pretty": "pnpm run format && pnpm run lint", + "test": "dotenv -- vitest", "changeset": "changeset add", - "publish": "changeset version && pnpm run build && changeset publish", - "test": "turbo run test", - "docs": "typedoc" + "publish": "changeset version && pnpm run build && changeset publish" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.20.0" }, "dependencies": { "@changesets/cli": "^2.26.0", + "@typescript-eslint/eslint-plugin": "latest", + "@typescript-eslint/parser": "^5.59.0", + "dotenv-cli": "^7.2.1", + "eslint": "^8.38.0", + "eslint-config-prettier": "^8.8.0", + "eslint-config-turbo": "latest", "prettier": "latest", "tsc-watch": "^6.0.0", "turbo": "latest", @@ -34,7 +41,6 @@ "vitest": "^0.32.0" }, "workspaces": [ - "apps/*", "packages/*" ], "packageManager": "pnpm@8.6.5" diff --git a/packages/dotperms/package.json b/packages/dotperms/package.json index 19f63048..f0f41b32 100644 --- a/packages/dotperms/package.json +++ b/packages/dotperms/package.json @@ -10,8 +10,7 @@ "scripts": { "lint": "eslint . --fix", "build": "unbuild", - "clean": "rimraf dist", - "test": "vitest run" + "clean": "rimraf dist" }, "main": "./dist/index.cjs", "module": "./dist/index.mjs", diff --git a/packages/experiments/package.json b/packages/experiments/package.json index 41851b45..97347575 100644 --- a/packages/experiments/package.json +++ b/packages/experiments/package.json @@ -10,8 +10,7 @@ "scripts": { "lint": "eslint . --fix", "build": "unbuild", - "clean": "rimraf dist", - "test": "vitest run" + "clean": "rimraf dist" }, "main": "./dist/index.cjs", "module": "./dist/index.mjs", diff --git a/packages/kiai.js/CHANGELOG.md b/packages/kiai.js/CHANGELOG.md index 4aba200a..a09db6d7 100644 --- a/packages/kiai.js/CHANGELOG.md +++ b/packages/kiai.js/CHANGELOG.md @@ -4,22 +4,22 @@ ### Patch Changes -- d7935bc: Switched to unbuild for compiling +- d7935bc: Switched to unbuild for compiling ## 0.1.2 ### Patch Changes -- 85d2abd: Add documentation and rename getRank to getData +- 85d2abd: Add documentation and rename getRank to getData ## 0.1.1 ### Patch Changes -- be68093: readme.md adjustments +- be68093: readme.md adjustments ## 0.1.0 ### Minor Changes -- 33fa1ee: Initial implementation of kiai.js +- 33fa1ee: Initial implementation of kiai.js diff --git a/packages/kiai.js/LICENSE b/packages/kiai.js/LICENSE new file mode 100644 index 00000000..e69f9b4e --- /dev/null +++ b/packages/kiai.js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Buape Studios + +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. \ No newline at end of file diff --git a/packages/kiai.js/README.md b/packages/kiai.js/README.md index d55fd155..5830a596 100644 --- a/packages/kiai.js/README.md +++ b/packages/kiai.js/README.md @@ -2,8 +2,6 @@ This package is the official Javascript wrapper for the public API of [Kiai](https://kiaibot.com). -Note: Kiai is still in beta and not yet released. If you want to join the beta, check us out at https://go.kiai.wtf/discord - ## Installation ```bash @@ -13,7 +11,7 @@ npm install kiai.js ## Usage ```js -import { KiaiClient } from "@buape/experiments" +import { KiaiClient } from "kiai.js" const client = new KiaiClient("APIKEY") client.getData("USERID", "GUILDID") // Returns a levelData object @@ -22,4 +20,4 @@ client.addXp("USERID", "GUILDID", 100) // Returns a levelData object client.setXp("USERID", "GUILDID", 100) // Returns a levelData object ``` -Full documentation can be found at https://kiai.js.org/modules +Full documentation can be found at https://utilities.buape.com diff --git a/packages/kiai.js/package.json b/packages/kiai.js/package.json index b306b54e..46dcd70c 100644 --- a/packages/kiai.js/package.json +++ b/packages/kiai.js/package.json @@ -2,7 +2,7 @@ "name": "kiai.js", "description": "The official Javascript wrapper for Kiai", "type": "module", - "version": "0.1.3", + "version": "1.0.0", "author": { "name": "Shadow", "email": "shadow@buape.com" @@ -10,8 +10,7 @@ "scripts": { "lint": "eslint . --fix", "build": "unbuild", - "clean": "rimraf dist", - "test": "vitest run" + "clean": "rimraf dist" }, "main": "./dist/index.cjs", "module": "./dist/index.mjs", @@ -35,15 +34,16 @@ "@types/ms": "^0.7.31" }, "files": [ - "dist" + "dist", + "LICENSE" ], "engines": { "node": ">=16.17.1" }, "dependencies": { - "@buape/kiai-api-types": "^0.1.0", + "@buape/kiai-api-types": "^1.1.0", "ms": "^2.1.3", - "node-fetch": "^3.3.0" + "node-fetch": "^3.3.1" }, "keywords": [ "kiai", diff --git a/packages/kiai.js/src/KiaiClient.ts b/packages/kiai.js/src/KiaiClient.ts index c18bfc38..e40222fd 100644 --- a/packages/kiai.js/src/KiaiClient.ts +++ b/packages/kiai.js/src/KiaiClient.ts @@ -1,65 +1,49 @@ -import { LevelData, Message } from "@buape/kiai-api-types" +import { Message, RateLimitError, VirtualMessage } from "@buape/kiai-api-types" import { RequestHandler } from "./RequestHandler" +import * as handlers from "./handlers" export class KiaiClient { - apiKey: string - baseURL: string - debug: boolean + apiKey: string + baseURL: string + version: `v${string}` + debug: boolean + _requestHandler: RequestHandler - private _requestHandler: RequestHandler + blacklist: handlers.Blacklist + leveling: handlers.Leveling + multipliers: handlers.Multipliers + rewards: handlers.Rewards + settings: handlers.Settings - /** - * Create a new KiaiClient - * @param apiKey The API key to use - * @param options The options to use - * @param options.baseURL The base URL to use - * @param options.debug Whether to enable debug mode - * @constructor - */ - constructor(apiKey: string, options?: { baseURL?: string; debug?: boolean }) { - this.apiKey = apiKey - this.baseURL = options?.baseURL || "https://beta.kiaibot.com/api/v1" //TODO: Remove beta once the API is out of beta - this.debug = options?.debug || false - this._requestHandler = new RequestHandler(this) - } + /** + * Create a new KiaiClient + * @param apiKey The API key to use + * @param options The options to use + * @param options.baseURL The base URL to use + * @param options.debug Whether to enable debug mode + * @constructor + */ + constructor(apiKey: string, options?: { baseURL?: string; version: `v${number}`; debug?: boolean }) { + this.apiKey = apiKey + this.version = options?.version || "v1" + this.baseURL = options?.baseURL || `https://api.kiaibot.com/${this.version}` + this.debug = options?.debug || false + this._requestHandler = new RequestHandler(this.baseURL, this.apiKey, this.debug) - /** - * Get the current status of the API - * @returns {Promise} - */ - public getStatus = async (): Promise => { - return (await this._requestHandler.request("/status", {}, "GET", {})) as Message - } + this.blacklist = new handlers.Blacklist(this._requestHandler) + this.leveling = new handlers.Leveling(this._requestHandler) + this.multipliers = new handlers.Multipliers(this._requestHandler) + this.rewards = new handlers.Rewards(this._requestHandler) + this.settings = new handlers.Settings(this._requestHandler) + } - /** - * Get the current leveling data of a user - * @param userId The Discord ID of the user - * @param guildId The Discord ID of the guild - * @returns {Promise} - */ - public getData = async (userId: string, guildId: string): Promise => { - return (await this._requestHandler.request(`/guild/${guildId}/rank/${userId}`, {}, "GET", {})) as LevelData - } + public async getRatelimit() { + const res = await this._requestHandler.request("/ratelimit", "GET", {}, {}, true) + return res as RateLimitError + } - /** - * Add XP to a user - * @param userId The Discord ID of the user - * @param guildId The Discord ID of the guild - * @param xp The amount of XP to add (set to negative to remove XP) - * @returns {Promise} - */ - public addXp = async (userId: string, guildId: string, xp: number): Promise => { - return (await this._requestHandler.request(`/guild/${guildId}/editXp/${userId}`, {}, "POST", { xp })) as LevelData - } - - /** - * Set the XP of a user - * @param userId The Discord ID of the user - * @param guildId The Discord ID of the guild - * @param xp The amount of XP to set - * @returns {Promise} - */ - public setXp = async (userId: string, guildId: string, xp: number): Promise => { - return (await this._requestHandler.request(`/guild/${guildId}/editXp/${userId}`, {}, "PUT", { xp })) as LevelData - } + public async createVirtualMessage(guildId: string, message: VirtualMessage) { + const result = (await this._requestHandler.request(`/guilds/${guildId}/virtual-messages`, "POST", {}, message)) as Message + return result + } } diff --git a/packages/kiai.js/src/RequestHandler.ts b/packages/kiai.js/src/RequestHandler.ts index 25c94268..f9a97c22 100644 --- a/packages/kiai.js/src/RequestHandler.ts +++ b/packages/kiai.js/src/RequestHandler.ts @@ -1,77 +1,84 @@ -import { Message } from "@buape/kiai-api-types" +import { RateLimitError as APIRateLimitError } from "@buape/kiai-api-types" import fetch from "node-fetch" -import { APIError } from "./errors/APIError" -import { RatelimitError } from "./errors/RatelimitError" -import { KiaiClient } from "./KiaiClient" +import { RatelimitError, APIError } from "." export class RequestHandler { - _client: KiaiClient - constructor(client: KiaiClient) { - this._client = client - } + baseURL: string + apiKey: string + debug: boolean + constructor(baseURL: string, apiKey: string, debug: boolean = false) { + this.baseURL = baseURL + this.apiKey = apiKey + this.debug = debug + } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - async request(endpoint: string, query = {}, method = "GET", body: { [key: string]: any }, _attempts = 0) { - return new Promise(async (resolve, reject) => { - const url = `${this._client.baseURL}${endpoint}${toQueryString(query)}` - const options = { - method, - headers: { - Authorization: this._client.apiKey, - "Content-Type": "application/json", - }, - body: body == null || Object.entries(body).length == 0 ? undefined : JSON.stringify(body), - timeout: 15000, - } - if (this._client.debug) console.debug(`Sending request to ${url}\nMethod:\n ${options.method}\nParams:\n ${JSON.stringify(query)}`) - try { - const res = await fetch(url, options) - if (res.status >= 200 && res.status < 300) { - const json = (await res.json()) as Message - resolve(json) - if (this._client.debug) console.debug("Success: \n", json) - } else if (res.status === 429) { - const json = (await res.json()) as Message - if (this._client.debug) console.debug("Ratelimited: \n", res, json) - reject(new RatelimitError(res)) - } else { - try { - const json = (await res.json()) as Message - if (this._client.debug) console.debug("API Error: \n", res, json) - reject(new APIError(res, json)) - } catch (err) { - if (this._client.debug) console.debug("API Error: \n", res) - reject(new APIError(res)) - } - } - } catch (err) { - reject(err) - } - }) - } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async request( + endpoint: string, + method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE" = "GET", + query = {}, + body: { [key: string]: any } = {}, + noError: boolean = false + ) { + const url = `${this.baseURL}${endpoint}${toQueryString(query)}` + const options = { + method, + headers: { + Authorization: this.apiKey, + "Content-Type": "application/json" + }, + body: body == null || Object.entries(body).length == 0 ? undefined : JSON.stringify(body), + timeout: 15000 + } + if (this.debug) console.debug(`Sending request to ${url}\nMethod:\n ${options.method}\nParams:\n ${JSON.stringify(query)}`) + try { + const res = await fetch(url, options) + if (res.status >= 200 && res.status < 300) { + const json = (await res.json()) + if (this.debug) console.debug("Success: \n", json) + return json + } else if (res.status === 429) { + const json = (await res.json()) as APIRateLimitError + if (this.debug) console.debug("Ratelimited: \n", res, json) + if (noError) return json + throw new RatelimitError(res) + } else { + try { + const text = await res.text() + if (this.debug) console.debug("API Error: \n", res, text) + throw new APIError(res, text) + } catch (err) { + if (this.debug) console.debug("API Error: \n", res) + throw new APIError(res) + } + } + } catch (err) { + throw err + } + } } type replacerType = "!" | "'" | "(" | ")" | "~" | "%20" | "%00" const encode = (str: string) => { - const charMap = { - "!": "%21", - "'": "%27", - "(": "%28", - ")": "%29", - "~": "%7E", - "%20": "+", - "%00": "\x00", - } as const - return encodeURIComponent(str).replace(/[!'\(\)~]|%20|%00/g, (match) => { - return charMap[match as replacerType] - }) + const charMap = { + "!": "%21", + "'": "%27", + "(": "%28", + ")": "%29", + "~": "%7E", + "%20": "+", + "%00": "\x00" + } as const + return encodeURIComponent(str).replace(/[!'\(\)~]|%20|%00/g, (match) => { + return charMap[match as replacerType] + }) } const toQueryString = (data: { [key: string]: string }) => { - if (Object.entries(data).length == 0) return "" - let result = "" - for (const [key, value] of Object.entries(data)) { - result.length == 0 ? (result = "?") : (result += "&") - result += `${encode(key)}=${encode(value)}` - } - return result + if (Object.entries(data).length == 0) return "" + let result = "" + for (const [key, value] of Object.entries(data)) { + result.length == 0 ? (result = "?") : (result += "&") + result += `${encode(key)}=${encode(value)}` + } + return result } diff --git a/packages/kiai.js/src/errors/APIError.ts b/packages/kiai.js/src/errors/APIError.ts index 9b6547bb..905b4d13 100644 --- a/packages/kiai.js/src/errors/APIError.ts +++ b/packages/kiai.js/src/errors/APIError.ts @@ -5,18 +5,17 @@ * @property {string} message The message of this error */ -import { Message } from "@buape/kiai-api-types" import { Response } from "node-fetch" export class APIError extends Error { - name: string - status: number - message: string + name: string + status: number + message: string - constructor(response: Response, message?: Message) { - super() - this.name = this.constructor.name - this.status = response.status - this.message = message ? message.message : "No message provided" - } + constructor(response: Response, message?: string) { + super() + this.name = this.constructor.name + this.status = response.status + this.message = message ?? "No message provided" + } } diff --git a/packages/kiai.js/src/errors/RatelimitError.ts b/packages/kiai.js/src/errors/RatelimitError.ts index 9fc98891..248a399a 100644 --- a/packages/kiai.js/src/errors/RatelimitError.ts +++ b/packages/kiai.js/src/errors/RatelimitError.ts @@ -11,16 +11,16 @@ import ms from "ms" */ export class RatelimitError extends Error { - name: string - status: number - remaining: number - message: string + name: string + status: number + remaining: number + message: string - constructor(response: Response, message?: Message) { - super() - this.name = this.constructor.name - this.status = response.status - this.remaining = parseInt(response.headers.get("Ratelimit-Remaining") ?? `${Date.now()}`) - this.message = message ? message.message : "You are currently ratelimited! Try again in " + ms(this.remaining) - } + constructor(response: Response, message?: Message) { + super() + this.name = this.constructor.name + this.status = response.status + this.remaining = parseInt(response.headers.get("Ratelimit-Remaining") ?? `${Date.now()}`) + this.message = message ? message.message : "You are currently ratelimited! Try again in " + ms(this.remaining) + } } diff --git a/packages/kiai.js/src/handlers/Blacklist.ts b/packages/kiai.js/src/handlers/Blacklist.ts new file mode 100644 index 00000000..787eaf2f --- /dev/null +++ b/packages/kiai.js/src/handlers/Blacklist.ts @@ -0,0 +1,28 @@ +import { BaseHandler } from "." +import { Blacklist as APIBlacklist, Message } from "@buape/kiai-api-types" + +export class Blacklist extends BaseHandler { + async getBlacklists(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/blacklist`)) as APIBlacklist[] + return result + } + + async createBlacklist(guildId: string, data: APIBlacklist) { + const result = (await this._handler.request(`/guild/${guildId}/blacklist`, "POST", {}, data)) as Message + return result + } + + async deleteAllBlacklists(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/blacklist`, "DELETE")) as { + users: number + roles: number + channels: number + } + return result + } + + async deleteBlacklist(guildId: string, data: APIBlacklist) { + const result = (await this._handler.request(`/guild/${guildId}/blacklist/${data.type}/${data.id}`, "DELETE")) as Message + return result + } +} diff --git a/packages/kiai.js/src/handlers/Leveling.ts b/packages/kiai.js/src/handlers/Leveling.ts new file mode 100644 index 00000000..97f401aa --- /dev/null +++ b/packages/kiai.js/src/handlers/Leveling.ts @@ -0,0 +1,49 @@ +import { Leaderboard, LevelData, Message } from "@buape/kiai-api-types" +import { BaseHandler } from "." + +export class Leveling extends BaseHandler { + async getLeaderboard(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/leaderboard`)) as Leaderboard + return result + } + + async getMember(guildId: string, userId: string) { + const result = (await this._handler.request(`/guild/${guildId}/member/${userId}`)) as LevelData + return result + } + + async addXp(guildId: string, userId: string, xp: number) { + const result = (await this._handler.request( + `/guild/${guildId}/member/${userId}/xp`, + "PATCH", + {}, + { + xp + } + )) as Message + return result + } + + async removeXp(guildId: string, userId: string, xp: number) { + const result = (await this._handler.request( + `/guild/${guildId}/member/${userId}/xp`, + "PATCH", + {}, + { + xp, + remove: true + } + )) as Message + return result + } + + async setXp(guildId: string, userId: string, xp: number) { + const result = (await this._handler.request(`/guild/${guildId}/member/${userId}/xp`, "PUT", {}, { xp })) as Message + return result + } + + async setXpBulk(guildId: string, data: { userId: string; xp: number }[]) { + const result = (await this._handler.request(`/guild/${guildId}/members/xp`, "PUT", {}, { data })) as Message + return result + } +} diff --git a/packages/kiai.js/src/handlers/Multipliers.ts b/packages/kiai.js/src/handlers/Multipliers.ts new file mode 100644 index 00000000..da00ea68 --- /dev/null +++ b/packages/kiai.js/src/handlers/Multipliers.ts @@ -0,0 +1,39 @@ +import { ChannelMultiplier, GuildMultiplier, Message, Multiplier, RoleMultiplier } from "@buape/kiai-api-types" +import { BaseHandler } from "." + +export class Multipliers extends BaseHandler { + async getMultipliers(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/multipliers`)) as Multiplier[] + return result + } + + async createMultiplier(guildId: string, data: Multiplier) { + const result = (await this._handler.request(`/guild/${guildId}/multipliers`, "POST", {}, data)) as Message + return result + } + + async resetMultipliers(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/multipliers`, "DELETE")) as { channels: number; roles: number } + return result + } + + async getMultiplier(guildId: string, type: "channel" | "role" | "guild", id: string) { + const result = await this._handler.request(`/guild/${guildId}/multipliers/${type}${type === "guild" ? "" : `/${id}`}`) + switch (type) { + case "channel": + return result as ChannelMultiplier + case "role": + return result as RoleMultiplier + case "guild": + return result as GuildMultiplier + } + } + + async clearMultiplier(guildId: string, type: "channel" | "role" | "guild", id: string) { + const result = (await this._handler.request( + `/guild/${guildId}/multipliers/${type}${type === "guild" ? "" : `/${id}`}`, + "DELETE" + )) as Message + return result + } +} diff --git a/packages/kiai.js/src/handlers/Rewards.ts b/packages/kiai.js/src/handlers/Rewards.ts new file mode 100644 index 00000000..6f68f357 --- /dev/null +++ b/packages/kiai.js/src/handlers/Rewards.ts @@ -0,0 +1,24 @@ +import { Message, Reward } from "@buape/kiai-api-types" +import { BaseHandler } from "." + +export class Rewards extends BaseHandler { + async getRewards(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/rewards`)) as Reward[] + return result + } + + async createReward(guildId: string, data: Reward) { + const result = (await this._handler.request(`/guild/${guildId}/rewards`, "POST", {}, data)) as Message + return result + } + + async clearRewards(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/rewards`, "DELETE")) as Message + return result + } + + async deleteReward(guildId: string, id: string) { + const result = (await this._handler.request(`/guild/${guildId}/rewards/${id}`, "DELETE")) as Message + return result + } +} diff --git a/packages/kiai.js/src/handlers/Settings.ts b/packages/kiai.js/src/handlers/Settings.ts new file mode 100644 index 00000000..5b8d4eb4 --- /dev/null +++ b/packages/kiai.js/src/handlers/Settings.ts @@ -0,0 +1,28 @@ +import { ApiPermission, GuildSettings } from "@buape/kiai-api-types" +import { BaseHandler } from "." + +export class Settings extends BaseHandler { + async getSettings(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/settings`)) as GuildSettings + return result + } + + async getPermissions(guildId: string) { + const result = (await this._handler.request(`/guild/${guildId}/permissions`)) as number + const permissions: ApiPermission[] = [] + + let bit = 0 + let num = result + + while (num > 0) { + if (num & 1) { + const permission = 1 << bit + permissions.push(permission) + } + num >>= 1 + bit++ + } + + return permissions + } +} diff --git a/packages/kiai.js/src/handlers/index.ts b/packages/kiai.js/src/handlers/index.ts new file mode 100644 index 00000000..3dfa8585 --- /dev/null +++ b/packages/kiai.js/src/handlers/index.ts @@ -0,0 +1,14 @@ +import { RequestHandler } from "../RequestHandler" + +export { Blacklist } from "./Blacklist" +export { Leveling } from "./Leveling" +export { Multipliers } from "./Multipliers" +export { Rewards } from "./Rewards" +export { Settings } from "./Settings" + +export class BaseHandler { + public _handler: RequestHandler + constructor(handler: RequestHandler) { + this._handler = handler + } +} diff --git a/packages/kiai.js/src/index.ts b/packages/kiai.js/src/index.ts index 2c5d83b6..6e8f1519 100644 --- a/packages/kiai.js/src/index.ts +++ b/packages/kiai.js/src/index.ts @@ -1,7 +1,6 @@ import { KiaiClient } from "./KiaiClient" export { KiaiClient } - export { APIError } from "./errors/APIError" export { RatelimitError } from "./errors/RatelimitError" -export type { LevelData, Message } from "@buape/kiai-api-types" +export * as Types from "@buape/kiai-api-types" \ No newline at end of file diff --git a/packages/kiai.js/tests/kiai.test.ts b/packages/kiai.js/tests/kiai.test.ts deleted file mode 100644 index 3067e7de..00000000 --- a/packages/kiai.js/tests/kiai.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { KiaiClient } from "../src/index" -import { expect, expectTypeOf, test } from "vitest" - -const testServer = "1041045270659604701" -const testUser = "1068978554223738991" - -const matchData = { - id: testUser, - guildId: testServer, - currentLevel: 1, - nextLevel: 2, - xp: 0, - nextLevelXp: 100, -} - -test("It should do nothing", () => {}) - -// if (!process.env.TEST_API_KEY) throw new Error("No API key provided") - -// const client = new KiaiClient(process.env.TEST_API_KEY) - -// test("The client should have initalized properly", () => { -// expect(client).toBeInstanceOf(KiaiClient) -// expect(client.apiKey).toBe(process.env.TEST_API_KEY) -// }) - -// test("The client should be able to get a rank", async () => { -// const rank = await client.getData(testUser, testServer) -// expectTypeOf(rank).toEqualTypeOf(matchData) -// }) - -// test("The client should be able to add XP", async () => { -// const oldRank = await client.getData(testUser, testServer) -// const newRank = await client.addXp(testUser, testServer, 15) -// expect(newRank.xp).toBe(oldRank.xp + 15) -// }) - -// test("The client should be able to set XP", async () => { -// const newRank = await client.setXp(testUser, testServer, 100) -// expect(newRank.xp).toBe(100) -// const newRank2 = await client.setXp(testUser, testServer, 150) -// expect(newRank2.xp).toBe(150) -// }) diff --git a/packages/kiai.js/typedoc.json b/packages/kiai.js/typedoc.json index b084a68b..64f47a98 100644 --- a/packages/kiai.js/typedoc.json +++ b/packages/kiai.js/typedoc.json @@ -1,5 +1,4 @@ { "extends": ["../../typedoc.base.json"], "entryPoints": ["src/index.ts"], - "readme": "README.md" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c413939b..fc14619c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,9 +1,5 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - importers: .: @@ -11,6 +7,24 @@ importers: '@changesets/cli': specifier: ^2.26.0 version: 2.26.0 + '@typescript-eslint/eslint-plugin': + specifier: latest + version: 5.60.1(@typescript-eslint/parser@5.59.0)(eslint@8.38.0)(typescript@5.0.2) + '@typescript-eslint/parser': + specifier: ^5.59.0 + version: 5.59.0(eslint@8.38.0)(typescript@5.0.2) + dotenv-cli: + specifier: ^7.2.1 + version: 7.2.1 + eslint: + specifier: ^8.38.0 + version: 8.38.0 + eslint-config-prettier: + specifier: ^8.8.0 + version: 8.8.0(eslint@8.38.0) + eslint-config-turbo: + specifier: latest + version: 1.10.7(eslint@8.38.0) prettier: specifier: latest version: 2.8.8 @@ -51,14 +65,14 @@ importers: packages/kiai.js: dependencies: '@buape/kiai-api-types': - specifier: ^0.1.0 - version: 0.1.0 + specifier: ^1.1.0 + version: 1.1.0 ms: specifier: ^2.1.3 version: 2.1.3 node-fetch: - specifier: ^3.3.0 - version: 3.3.0 + specifier: ^3.3.1 + version: 3.3.1 devDependencies: '@types/ms': specifier: ^0.7.31 @@ -281,8 +295,8 @@ packages: to-fast-properties: 2.0.0 dev: false - /@buape/kiai-api-types@0.1.0: - resolution: {integrity: sha512-8SS1GTyXGXQd9L2ujMI7oWXJ9YAkcewnF3Z9JIfN7zU/1TYI25I8i3fqD5DAFEs4aQTrb523YdFFofEp53tzWw==} + /@buape/kiai-api-types@1.1.0: + resolution: {integrity: sha512-rx2t2oC9mqR0qZkKRVMt0Ynv97YY8MGCMZZ/tH9rWqVKbbHfRgdL81Z2vfNFzDmHOKRgLp7xQXJrY0Q70wyaDA==} dev: false /@changesets/apply-release-plan@6.1.3: @@ -645,6 +659,63 @@ packages: requiresBuild: true optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.38.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.38.0 + eslint-visitor-keys: 3.4.0 + dev: false + + /@eslint-community/regexpp@4.5.0: + resolution: {integrity: sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: false + + /@eslint/eslintrc@2.0.2: + resolution: {integrity: sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.5.1 + globals: 13.20.0 + ignore: 5.2.4 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: false + + /@eslint/js@8.38.0: + resolution: {integrity: sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /@humanwhocodes/config-array@0.11.8: + resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 1.2.1 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: false + + /@humanwhocodes/object-schema@1.2.1: + resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + dev: false + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} @@ -837,6 +908,10 @@ packages: ci-info: 3.8.0 dev: false + /@types/json-schema@7.0.11: + resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} + dev: false + /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: false @@ -865,6 +940,182 @@ packages: resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} dev: false + /@types/semver@7.3.13: + resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} + dev: false + + /@typescript-eslint/eslint-plugin@5.60.1(@typescript-eslint/parser@5.59.0)(eslint@8.38.0)(typescript@5.0.2): + resolution: {integrity: sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/parser': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.5.0 + '@typescript-eslint/parser': 5.59.0(eslint@8.38.0)(typescript@5.0.2) + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/type-utils': 5.60.1(eslint@8.38.0)(typescript@5.0.2) + '@typescript-eslint/utils': 5.60.1(eslint@8.38.0)(typescript@5.0.2) + debug: 4.3.4 + eslint: 8.38.0 + grapheme-splitter: 1.0.4 + ignore: 5.2.4 + natural-compare-lite: 1.4.0 + semver: 7.5.0 + tsutils: 3.21.0(typescript@5.0.2) + typescript: 5.0.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/parser@5.59.0(eslint@8.38.0)(typescript@5.0.2): + resolution: {integrity: sha512-qK9TZ70eJtjojSUMrrEwA9ZDQ4N0e/AuoOIgXuNBorXYcBDk397D2r5MIe1B3cok/oCtdNC5j+lUUpVB+Dpb+w==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.59.0 + '@typescript-eslint/types': 5.59.0 + '@typescript-eslint/typescript-estree': 5.59.0(typescript@5.0.2) + debug: 4.3.4 + eslint: 8.38.0 + typescript: 5.0.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/scope-manager@5.59.0: + resolution: {integrity: sha512-tsoldKaMh7izN6BvkK6zRMINj4Z2d6gGhO2UsI8zGZY3XhLq1DndP3Ycjhi1JwdwPRwtLMW4EFPgpuKhbCGOvQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.59.0 + '@typescript-eslint/visitor-keys': 5.59.0 + dev: false + + /@typescript-eslint/scope-manager@5.60.1: + resolution: {integrity: sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/visitor-keys': 5.60.1 + dev: false + + /@typescript-eslint/type-utils@5.60.1(eslint@8.38.0)(typescript@5.0.2): + resolution: {integrity: sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '*' + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.0.2) + '@typescript-eslint/utils': 5.60.1(eslint@8.38.0)(typescript@5.0.2) + debug: 4.3.4 + eslint: 8.38.0 + tsutils: 3.21.0(typescript@5.0.2) + typescript: 5.0.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/types@5.59.0: + resolution: {integrity: sha512-yR2h1NotF23xFFYKHZs17QJnB51J/s+ud4PYU4MqdZbzeNxpgUr05+dNeCN/bb6raslHvGdd6BFCkVhpPk/ZeA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /@typescript-eslint/types@5.60.1: + resolution: {integrity: sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /@typescript-eslint/typescript-estree@5.59.0(typescript@5.0.2): + resolution: {integrity: sha512-sUNnktjmI8DyGzPdZ8dRwW741zopGxltGs/SAPgGL/AAgDpiLsCFLcMNSpbfXfmnNeHmK9h3wGmCkGRGAoUZAg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.59.0 + '@typescript-eslint/visitor-keys': 5.59.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.0 + tsutils: 3.21.0(typescript@5.0.2) + typescript: 5.0.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/typescript-estree@5.60.1(typescript@5.0.2): + resolution: {integrity: sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/visitor-keys': 5.60.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.0 + tsutils: 3.21.0(typescript@5.0.2) + typescript: 5.0.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/utils@5.60.1(eslint@8.38.0)(typescript@5.0.2): + resolution: {integrity: sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.38.0) + '@types/json-schema': 7.0.11 + '@types/semver': 7.3.13 + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.0.2) + eslint: 8.38.0 + eslint-scope: 5.1.1 + semver: 7.5.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + + /@typescript-eslint/visitor-keys@5.59.0: + resolution: {integrity: sha512-qZ3iXxQhanchCeaExlKPV3gDQFxMUmU35xfd5eCXB6+kUw1TUAbIy2n7QIrwz9s98DQLzNWyHp61fY0da4ZcbA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.59.0 + eslint-visitor-keys: 3.4.0 + dev: false + + /@typescript-eslint/visitor-keys@5.60.1: + resolution: {integrity: sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.60.1 + eslint-visitor-keys: 3.4.0 + dev: false + /@vitest/expect@0.32.0: resolution: {integrity: sha512-VxVHhIxKw9Lux+O9bwLEEk2gzOUe93xuFHy9SzYWnnoYZFYg1NfBtnfnYWiJN7yooJ7KNElCK5YtA7DTZvtXtg==} dependencies: @@ -904,6 +1155,14 @@ packages: pretty-format: 27.5.1 dev: true + /acorn-jsx@5.3.2(acorn@8.8.2): + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.8.2 + dev: false + /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} @@ -914,6 +1173,15 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + /ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: false + /ansi-align@3.0.1: resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} dependencies: @@ -957,6 +1225,10 @@ packages: sprintf-js: 1.0.3 dev: false + /argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: false + /array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} dependencies: @@ -1021,6 +1293,13 @@ packages: widest-line: 3.1.0 dev: true + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: false + /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: @@ -1067,6 +1346,11 @@ packages: get-intrinsic: 1.2.0 dev: false + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: false + /camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} @@ -1198,6 +1482,10 @@ packages: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} dev: false + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: false + /concordance@5.0.4: resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} @@ -1301,6 +1589,10 @@ packages: type-detect: 4.0.8 dev: true + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: false + /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -1336,6 +1628,33 @@ packages: path-type: 4.0.0 dev: false + /doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + dev: false + + /dotenv-cli@7.2.1: + resolution: {integrity: sha512-ODHbGTskqRtXAzZapDPvgNuDVQApu4oKX8lZW7Y0+9hKA6le1ZJlyRS687oU9FXjOVEDU/VFV6zI125HzhM1UQ==} + hasBin: true + dependencies: + cross-spawn: 7.0.3 + dotenv: 16.0.3 + dotenv-expand: 10.0.0 + minimist: 1.2.8 + dev: false + + /dotenv-expand@10.0.0: + resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} + engines: {node: '>=12'} + dev: false + + /dotenv@16.0.3: + resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==} + engines: {node: '>=12'} + dev: false + /duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} dev: false @@ -1463,12 +1782,147 @@ packages: engines: {node: '>=0.8.0'} dev: false + /escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: false + + /eslint-config-prettier@8.8.0(eslint@8.38.0): + resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 8.38.0 + dev: false + + /eslint-config-turbo@1.10.7(eslint@8.38.0): + resolution: {integrity: sha512-0yHt5UlXVph8S4SOvP6gYehLvYjJj6XFKTYOG/WUQbjlcF0OU4pOT1a1juqmmBPWYlvJ0evt7v+RekY4tOopPQ==} + peerDependencies: + eslint: '>6.6.0' + dependencies: + eslint: 8.38.0 + eslint-plugin-turbo: 1.10.7(eslint@8.38.0) + dev: false + + /eslint-plugin-turbo@1.10.7(eslint@8.38.0): + resolution: {integrity: sha512-YikBHc75DY9VV1vAFUIBekHLQlxqVT5zTNibK8zBQInCUhF7PvyPJc0xXw5FSz8EYtt4uOV3r0Km3CmFRclS4Q==} + peerDependencies: + eslint: '>6.6.0' + dependencies: + dotenv: 16.0.3 + eslint: 8.38.0 + dev: false + + /eslint-scope@5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + dev: false + + /eslint-scope@7.2.0: + resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: false + + /eslint-visitor-keys@3.4.0: + resolution: {integrity: sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /eslint@8.38.0: + resolution: {integrity: sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.38.0) + '@eslint-community/regexpp': 4.5.0 + '@eslint/eslintrc': 2.0.2 + '@eslint/js': 8.38.0 + '@humanwhocodes/config-array': 0.11.8 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.0 + eslint-visitor-keys: 3.4.0 + espree: 9.5.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.20.0 + grapheme-splitter: 1.0.4 + ignore: 5.2.4 + import-fresh: 3.3.0 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-sdsl: 4.4.0 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.1 + strip-ansi: 6.0.1 + strip-json-comments: 3.1.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: false + + /espree@9.5.1: + resolution: {integrity: sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.8.2 + acorn-jsx: 5.3.2(acorn@8.8.2) + eslint-visitor-keys: 3.4.0 + dev: false + /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true dev: false + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: false + + /esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: false + + /estraverse@4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + dev: false + + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: false + /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: false @@ -1476,7 +1930,6 @@ packages: /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - dev: true /event-stream@3.3.4: resolution: {integrity: sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==} @@ -1503,6 +1956,10 @@ packages: tmp: 0.0.33 dev: false + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: false + /fast-diff@1.2.0: resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} dev: true @@ -1518,6 +1975,14 @@ packages: micromatch: 4.0.5 dev: false + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: false + + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: false + /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: @@ -1532,6 +1997,13 @@ packages: web-streams-polyfill: 3.2.1 dev: false + /file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.0.4 + dev: false + /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -1562,6 +2034,18 @@ packages: pkg-dir: 4.2.0 dev: false + /flat-cache@3.0.4: + resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: 3.2.7 + rimraf: 3.0.2 + dev: false + + /flatted@3.2.7: + resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} + dev: false + /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: @@ -1680,6 +2164,13 @@ packages: is-glob: 4.0.3 dev: false + /glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + dev: false + /glob@10.2.2: resolution: {integrity: sha512-Xsa0BcxIC6th9UwNjZkhrMtNo/MnyRL8jGCP+uEwhA5oFOCY1f2s1/oNKY47xQ0Bg5nkjsfAEIej1VeH62bDDQ==} engines: {node: '>=16 || 14 >=14.17'} @@ -1692,6 +2183,17 @@ packages: path-scurry: 1.7.0 dev: true + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: false + /glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} @@ -1708,6 +2210,13 @@ packages: engines: {node: '>=4'} dev: false + /globals@13.20.0: + resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: false + /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} @@ -1824,6 +2333,19 @@ packages: engines: {node: '>= 4'} dev: false + /import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: false + + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: false + /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} @@ -1944,6 +2466,11 @@ packages: engines: {node: '>=0.12.0'} dev: false + /is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: false + /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -2029,6 +2556,10 @@ packages: hasBin: true dev: false + /js-sdsl@4.4.0: + resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==} + dev: false + /js-string-escape@1.0.1: resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} engines: {node: '>= 0.8'} @@ -2046,6 +2577,13 @@ packages: esprima: 4.0.1 dev: false + /js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: false + /jsesc@2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} @@ -2056,6 +2594,14 @@ packages: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: false + /json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: false + + /json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: false + /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -2089,6 +2635,14 @@ packages: engines: {node: '>=6'} dev: false + /levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: false + /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: false @@ -2122,6 +2676,10 @@ packages: p-locate: 5.0.0 dev: false + /lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: false + /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: false @@ -2154,7 +2712,6 @@ packages: engines: {node: '>=10'} dependencies: yallist: 4.0.0 - dev: true /lru-cache@9.1.1: resolution: {integrity: sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==} @@ -2240,6 +2797,12 @@ packages: engines: {node: '>=4'} dev: false + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: false + /minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} @@ -2270,6 +2833,10 @@ packages: kind-of: 6.0.3 dev: false + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: false + /minipass@5.0.0: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} engines: {node: '>=8'} @@ -2333,6 +2900,14 @@ packages: hasBin: true dev: true + /natural-compare-lite@1.4.0: + resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} + dev: false + + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: false + /node-cleanup@2.1.2: resolution: {integrity: sha512-qN8v/s2PAJwGUtr1/hYTpNKlD6Y9rc4p8KSmJXyGdYGZsDGKXrGThikLFP9OCHFeLeEpQzPwiAtdIvBLqm//Hw==} dev: false @@ -2342,8 +2917,8 @@ packages: engines: {node: '>=10.5.0'} dev: false - /node-fetch@3.3.0: - resolution: {integrity: sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==} + /node-fetch@3.3.1: + resolution: {integrity: sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: data-uri-to-buffer: 4.0.1 @@ -2397,6 +2972,18 @@ packages: which-pm-runs: 1.1.0 dev: true + /optionator@0.9.1: + resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.3 + dev: false + /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} @@ -2458,6 +3045,13 @@ packages: engines: {node: '>=6'} dev: false + /parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: false + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -2473,6 +3067,11 @@ packages: engines: {node: '>=8'} dev: false + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: false + /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -2553,6 +3152,11 @@ packages: which-pm: 2.0.0 dev: false + /prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: false + /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} @@ -2585,6 +3189,11 @@ packages: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: false + /punycode@2.3.0: + resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + engines: {node: '>=6'} + dev: false + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: false @@ -2657,6 +3266,11 @@ packages: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: false + /resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: false + /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -2676,6 +3290,13 @@ packages: engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: false + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: false + /rimraf@5.0.0: resolution: {integrity: sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g==} engines: {node: '>=14'} @@ -2743,7 +3364,6 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 - dev: true /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} @@ -2944,6 +3564,11 @@ packages: min-indent: 1.0.1 dev: false + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: false + /strip-literal@1.0.1: resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} dependencies: @@ -2972,6 +3597,10 @@ packages: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} + /text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: false + /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} dev: false @@ -3033,6 +3662,20 @@ packages: typescript: 5.0.2 dev: false + /tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: false + + /tsutils@3.21.0(typescript@5.0.2): + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 5.0.2 + dev: false + /tty-table@4.2.1: resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} engines: {node: '>=8.0.0'} @@ -3108,6 +3751,13 @@ packages: turbo-windows-arm64: 1.10.7 dev: false + /type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + dev: false + /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} @@ -3118,6 +3768,11 @@ packages: engines: {node: '>=10'} dev: false + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: false + /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} @@ -3242,6 +3897,12 @@ packages: picocolors: 1.0.0 dev: false + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.0 + dev: false + /validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: @@ -3461,6 +4122,11 @@ packages: string-width: 4.2.3 dev: true + /word-wrap@1.2.3: + resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} + engines: {node: '>=0.10.0'} + dev: false + /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -3501,7 +4167,6 @@ packages: /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: true /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} diff --git a/vitess.config.ts b/vitess.config.ts new file mode 100644 index 00000000..23bafab8 --- /dev/null +++ b/vitess.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "vitest/config" + +export default defineConfig({ + optimizeDeps: { + disabled: false + }, + build: { + commonjsOptions: { + include: [] + } + } +}) diff --git a/vitess.workspace.ts b/vitess.workspace.ts new file mode 100644 index 00000000..cbf98059 --- /dev/null +++ b/vitess.workspace.ts @@ -0,0 +1,3 @@ +import { defineWorkspace } from "vitest/config" + +export default defineWorkspace(["packages/*"])