diff --git a/bin/add.mjs b/bin/add.mjs index 190789331..5a3cbfaab 100644 --- a/bin/add.mjs +++ b/bin/add.mjs @@ -43,9 +43,9 @@ test('log', () => { name: 'package.json', type: 'file', content: `{ - "name": "@akarui/${lib}", + "name": "@aoijs/${lib}", "version": "0.0.1", - "description": "@akarui/${lib} - A Extension for Aoi.js", + "description": "@aoijs/${lib} - A Extension for Aoi.js", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "types": "dist/types/index.d.ts", diff --git a/bin/index.mjs b/bin/index.mjs index 90ccee8b9..8aa06c240 100755 --- a/bin/index.mjs +++ b/bin/index.mjs @@ -1,6 +1,4 @@ -#!/usr/bin/env node - -process.removeAllListeners('warning'); +#!/usr/bin/env -S node --no-warnings=ExperimentalWarning import { program } from 'commander'; import test from './test.mjs'; @@ -12,11 +10,13 @@ import pkg from './package.json' assert { type: 'json' }; import chalk from 'chalk'; import add from './add.mjs'; import addLicense from './addLicense.mjs'; +import run from './run.mjs'; program .command('test') .description('run all tests for the given library') .requiredOption('-l, --library ', 'the library to test') + .option('-f, --folder ', 'the folder to test in the library') .action(test); program @@ -56,6 +56,13 @@ program .requiredOption('-l, --library ', 'the library to license') .action(addLicense); +program + .command('run') + .description('run a file for the given library') + .requiredOption('-l, --library ', 'the library to run') + .requiredOption('-f, --file ', 'the file to run') + .action(run); + program .name(pkg.name) .version(pkg.version) diff --git a/bin/run.mjs b/bin/run.mjs new file mode 100644 index 000000000..01e379a2e --- /dev/null +++ b/bin/run.mjs @@ -0,0 +1,45 @@ +import path from 'node:path'; +import { spawn } from 'node:child_process'; + +/** + * Run given path for the given library + * @param {object} options - The options object + * @param {string} options.library - The library to test + * @param {string} options.path - The path to the file that needs to be run + * @returns {Promise} + */ +const run = async ({ library, file: filePath }) => { + console.log(`Running ${filePath} from ${library}`); + + // Resolve paths in a cross-platform way + const mainFolder = path.join(process.cwd(), 'lib', library); + + const spwn = spawn( + `node ${filePath}`, + [], + { + stdio: 'inherit', + // Set cwd to the project root + cwd: mainFolder, + shell: true, + }, + ); + + spwn.on('exit', (code) => { + if (code !== 0) { + console.error(`Failed to run ${filePath} from ${library}`); + process.exit(1); + } + }); + + spwn.on('error', (error) => { + console.error(error); + process.exit(1); + }); + + spwn.on('close', () => { + console.log(`finished running ${filePath} from ${library}`); + }); +}; + +export default run; diff --git a/bin/test.mjs b/bin/test.mjs index b63697ae1..d30d5a8df 100644 --- a/bin/test.mjs +++ b/bin/test.mjs @@ -1,33 +1,39 @@ import path from 'node:path'; import { spawn } from 'node:child_process'; - +import { pathToFileURL } from 'node:url'; +import chalk from 'chalk'; /** - * run all tests for the given library - * @param {object} options - the options object - * @param {string} options.library - the library to test + * Run all tests for the given library + * @param {object} options - The options object + * @param {string} options.library - The library to test * @returns {Promise} */ -const test = async ({ library }) => { +const test = async ({ library, folder, reporter }) => { + const start = performance.now(); console.log(`Running tests for ${library}`); - // find all test files in the library - // recursively check all folders for test files - const mainFolder = path.resolve(process.cwd(), `lib/${library}`); - + // Resolve paths in a cross-platform way + const mainFolder = path.join(process.cwd(), 'lib', library); + const reporterPath = pathToFileURL( + path.join(process.cwd(), 'tools', 'testing', 'testReporter.mjs'), + ); + const flags = folder ? `--folder=${folder}` : ''; + const runnerPath = path.join( + process.cwd(), + 'tools', + 'testing', + 'testRunner.mjs', + ); + // "glob -c \"tsx --test\" \"./src/**/*.test.ts\"" const spwn = spawn( - 'npx', - [ - 'jest', - '--verbose', - '--color', - '--coverage', - '--coverageProvider=v8', - `--config=${process.cwd()}/jest.config.js`, - `${mainFolder}`, - ], + // `npx glob -c "tsx --test-reporter="${reporterPath.toString()}" --test" "./src/**/*.test.ts"`, + `node --import tsx "${runnerPath.toString()}" -- ${flags}`, + [], { stdio: 'inherit', - cwd: mainFolder, + // Set cwd to the project root + cwd: `${mainFolder}`, + shell: true, }, ); @@ -45,10 +51,11 @@ const test = async ({ library }) => { spwn.on('close', () => { console.log(`Tested ${library}`); - }); - - spwn.on('disconnect', () => { - console.log('Disconnected'); + console.log( + chalk.gray( + `Duration: ${((performance.now() - start) / 1000).toFixed(2)}s`, + ), + ); }); }; diff --git a/eslint.config.mjs b/eslint.config.mjs index b11180e58..636c7ec21 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,5 +1,6 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import globals from 'globals'; -import tseslint from 'typescript-eslint'; +// import tseslint from 'typescript-eslint'; import jsdoc from 'eslint-plugin-jsdoc'; import tsdoc from 'eslint-plugin-tsdoc'; @@ -23,7 +24,7 @@ export default [ ...compat.extends('xo-typescript'), // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - ...tseslint.configs.stylisticTypeChecked, + // ...tseslint.configs.stylisticTypeChecked, { // enable object curly spacing rules: { @@ -32,22 +33,29 @@ export default [ 'error', 'interface', ], + '@typescript-eslint/parameter-properties': 'off', '@typescript-eslint/naming-convention': [ 'error', { selector: 'variable', - format: ['camelCase'], + format: ['camelCase', 'UPPER_CASE'], leadingUnderscore: 'allow', }, { selector: 'classProperty', - format: [''], + format: ['camelCase'], leadingUnderscore: 'allow', trailingUnderscore: 'allow', }, { selector: 'parameter', format: ['camelCase'] }, { selector: 'typeLike', format: ['PascalCase'] }, ], + '@typescript-eslint/prefer-literal-enum-member': [ + 'error', + { + allowBitwiseExpressions: true, + }, + ], }, }, { diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 29082c3c9..000000000 --- a/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: 'ts-jest', - testEnvironment: 'node', -}; diff --git a/jsconfig.json b/jsconfig.json deleted file mode 100644 index 1184dd540..000000000 --- a/jsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "typeAcquisition": { - "include": [ - "jest" - ] - } -} \ No newline at end of file diff --git a/lib/aoi.db/package.json b/lib/aoi.db/package.json index 7b907a0ec..b2ad04a86 100644 --- a/lib/aoi.db/package.json +++ b/lib/aoi.db/package.json @@ -1,7 +1,7 @@ { - "name": "@akarui/aoi.db", + "name": "@aoijs/aoi.db", "version": "0.0.1", - "description": "@akarui/aoi.db - A Extension for Aoi.js", + "description": "@aoijs/aoi.db - A Extension for Aoi.js", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", @@ -44,6 +44,6 @@ }, "readme": "https://github.com/Aoijs/aoi.js/blob/main/README.md", "dependencies": { - "@akarui/structures": "workspace:^" + "@aoijs/structures": "workspace:^" } } \ No newline at end of file diff --git a/lib/aoi.js/.gitignore b/lib/aoi.js/.gitignore index 0e75fe557..a289e87e1 100644 --- a/lib/aoi.js/.gitignore +++ b/lib/aoi.js/.gitignore @@ -1,3 +1,5 @@ node_modules dist coverage +index.mjs +index.js \ No newline at end of file diff --git a/lib/aoi.js/README.md b/lib/aoi.js/README.md index 90e9ec7c7..97841c893 100644 --- a/lib/aoi.js/README.md +++ b/lib/aoi.js/README.md @@ -1,3 +1,3 @@ -# @aoijs/aoi.js +# @akarui/aoi.js -dev version for Aoi.js +A Extension for Aoi.js diff --git a/lib/aoi.js/generators/readme.js b/lib/aoi.js/generators/readme.js deleted file mode 100644 index 55f38c7af..000000000 --- a/lib/aoi.js/generators/readme.js +++ /dev/null @@ -1,71 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const fs = require( "fs" ); - -const file = process.cwd() + "/src/functions"; - -const dirs = fs.readdirSync( file, { withFileTypes: true } ).filter( x => x.isDirectory() ).map( x => x.name ); - -const folders = {}; -for ( const dir of dirs ) -{ - const subdirs = fs.readdirSync( file + "/" + dir, { withFileTypes: true } ).filter( x => x.isDirectory() ).map( x => x.name ); - const obj = {}; - for ( const subdir of subdirs ) - { - const files = fs.readdirSync( file + "/" + dir + "/" + subdir, { withFileTypes: true } ).filter( x => x.isFile() && x.name.startsWith( ( "$" ) ) ).map( x => x.name.split( "." )[ 0 ] ); - if( files.length) - obj[ subdir ] = files; - } - folders[ dir ] = obj; -} -console.log( folders ); - -const readme = `# Functions - -## Directory Structure -\`\`\`mermaid -graph RL; -${ Object.keys( folders ).map( x => `${ x } --> Functions` ).join( ";\n" )}; -${ Object.keys( folders ).map( x => Object.keys( folders[ x ] ).map( y => `${ y } --> ${ x }` ).join( ";\n" ) ).join( ";\n" )}; -\`\`\` - -## Divisions - -${ Object.keys( folders ).map( x => ` - \`${ x }\`: Contains functions related to ${ x }` ).join( "\n" )} -`; - -fs.writeFileSync( file + "/README.md", readme ); - -const DiscordReadme = `# Discord - -## Directory Structure - -\`\`\`mermaid -graph RL; -${ Object.keys( folders[ "discord" ] ).map( x => folders[ "discord" ][ x ].map( y => `${ y } --> ${ x }` ).join( ";\n" ) ).join( ";\n" ) }; - -\`\`\` - -## Divisions - -${ Object.keys( folders[ "discord" ] ).map( x => ` - \`${ x }\`: Contains functions related to ${ x }` ).join( "\n" )} -`; - -fs.writeFileSync( file + "/discord/README.md", DiscordReadme ); - -const JsReadme = `# JavaScript - -## Directory Structure - -\`\`\`mermaid -graph RL; -${ Object.keys( folders[ "js" ] ).map( x => folders[ "js" ][ x ].map( y => `${ y } --> ${ x }` ).join( ";\n" ) ).join( ";\n" ) }; - -\`\`\` - -## Divisions - -${ Object.keys( folders[ "js" ] ).map( x => ` - \`${ x }\`: Contains functions related to ${ x }` ).join( "\n" )}; -`; - -fs.writeFileSync( file + "/js/README.md", JsReadme ); \ No newline at end of file diff --git a/lib/aoi.js/package.json b/lib/aoi.js/package.json index 1de2a8c2d..b39902fce 100755 --- a/lib/aoi.js/package.json +++ b/lib/aoi.js/package.json @@ -1,93 +1,71 @@ { - "name": "aoi.js", - "version": "7.0.0-dev", - "description": "A next generation package to create Discord Bots with built-in string functions.", - "main": "./dist/cjs/index.js", - "exports": { - "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js" - }, - "browser": "./browser/index.js", - "scripts": { - "test": "node tests", - "start": "node index.js", - "build": "npx tsc -p tsconfig.esm.json && npx tsc -p tsconfig.cjs.json && npm run createpack", - "build:utils": "npx tsc -p tsconfig.utils.json && node ./utils/.interals/addpkgjson.js", - "createpack": "node src/pack.js", - "lint": "eslint . --ext .ts --fix ", - "buildStart": "npm run build && npm start", - "genmd": "node generators/readme.js", - "docgen": " npx typedoc --plugin typedoc-theme-hierarchy --plugin typedoc-plugin-mermaid --plugin typedoc-plugin-extras --footerLastModified --customCss ./packers/custom.css" - }, - "contributors": [ - "leref", - "USERSATOSHI" - ], - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/AkaruiDevelopment/aoi.js.git" - }, - "devDependencies": { - "@eslint/eslintrc": "^3.0.2", - "@eslint/js": "^9.0.0", - "@types/js-beautify": "^1.14.3", - "@types/node": "^20.10.3", - "@types/uglify-js": "^3.17.1", - "@types/ws": "^8.5.10", - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", - "csso": "^5.0.5", - "eslint": "^8.57.0", - "eslint-config-xo-typescript": "^4.0.0", - "globals": "^15.0.0", - "js-beautify": "^1.14.11", - "typedoc": "^0.25.4", - "typedoc-github-wiki-theme": "^1.1.0", - "typedoc-plugin-extras": "^3.0.0", - "typedoc-plugin-markdown": "^3.17.1", - "typedoc-plugin-mermaid": "^1.10.0", - "typedoc-theme-hierarchy": "^4.1.2", - "typescript": "^5.4.4", - "typescript-eslint": "^7.5.0", - "uglify-js": "^3.17.4" - }, - "type": "commonjs", - "keywords": [ - "aoi.js", - "aoi.js-next", - "aoijs", - "aoi", - "typescript", - "api", - "bot", - "discord", - "discordbot" - ], - "engines": { - "node": ">=18.x" - }, - "dependencies": { - "@akarui/structures": "^2.0.1", - "boxen": "^7.1.1", - "chalk": "^5.3.0", - "cli-spinners": "^2.9.2", - "dotenv": "^16.3.1", - "ora": "^7.0.1", - "undici": "^5.28.2", - "ws": "^8.14.2", - "zeneth": "^0.0.1" - }, - "files": [ - "dist", - "README.md", - "LICENSE", - "package.json" - ] + "name": "aoi.js", + "version": "7.0.0", + "description": "aoi.js - A Extension for Aoi.js", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "type": "module", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js", + "types": "./dist/types/index.d.ts" + }, + "./core": { + "import": "./dist/esm/core/index.js", + "require": "./dist/cjs/core/index.js", + "types": "./dist/types/core/index.d.ts" + } + }, + "engines": { + "node": ">=20.x" + }, + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0" + } + ], + "keywords": [ + "aoi.db", + "aoi.js", + "dbd.js", + "dbdjs", + "dbd", + "aoi.js", + "aoi", + "discord" + ], + "files": [ + "dist", + "package.json", + "README.md" + ], + "homepage": "", + "repository": { + "type": "git", + "url": "https://github.com/Aoijs/aoi.js" + }, + "author": "Leref", + "maintainers": [ + "USERSATOSHI" + ], + "bugs": { + "url": "https://github.com/Aoijs/aoi.js/issues" + }, + "readme": "https://github.com/Aoijs/aoi.js/blob/monorepo/README.md", + "dependencies": { + "@aoijs/structures": "workspace:^", + "@discordjs/collection": "^2.1.1", + "@discordjs/ws": "^2.0.0", + "discord.js": "^14.16.2", + "uglify-js": "^3.18.0" + }, + "devDependencies": { + "@types/uglify-js": "^3.17.5", + "@vladfrangu/async_event_emitter": "^2.4.6", + "discord-api-types": "^0.37.100" + } } diff --git a/lib/aoi.js/packers/custom.css b/lib/aoi.js/packers/custom.css deleted file mode 100755 index f220a391c..000000000 --- a/lib/aoi.js/packers/custom.css +++ /dev/null @@ -1,176 +0,0 @@ -@keyframes open { - 0% { - opacity: 0; - height: 0; - } - 30% { - opacity: 0; - } - 100% { - opacity: 1; - height: auto; - } -} -@keyframes close { - 0% { - height: auto; - opacity: 1; - } - 70% { - height: auto; - } - 100% { - opacity: 0; - height: 0; - } -} -*, -::after, -::before { - box-sizing: border-box; - padding: 0; - margin: 0; -} -:root { - --dark-color-background: rgb(6, 11, 28) !important; -} -a { - color: #f492f1; - text-decoration: none; - position: relative; - margin-top: 2px; - margin-bottom: 2px; - margin-left: 5px; -} - -a::after { - content: ""; - position: absolute; - top: 0px; - left: -5px; - width: 2px; - height:0%; - background-image: linear-gradient( - to bottom, - #f492f1, - hsla(258, 40%, 68%, 1) - ); -} -a:hover::after { - height: 100%; -} -.current, -a:hover { - color: #a08dce; -} -* a:hover { - text-decoration: none !important; -} -.tsd-checkbox-background { - fill: #2b2b2b !important; -} -.tsd-filter-input svg { - border-radius: 100% !important; -} -details[open] summary ~ * { - animation: open 0.5s; -} -details:not([open]) summary ~ * { - animation: close 1 s; -} - -.tsd-generator > p { - display: flex; - justify-content: flex-start; - align-items: center; - gap: 16px; - width: 100%; -} -.tsd-generator > p > span { - display: flex; - justify-content: flex-end; - align-items: center; - flex: 1; -} -.tsd-index-accordion .tsd-accordion-summary > svg, -a, -a::after { - transition: 0.5s; -} - -.tsd-index-accordion .tsd-accordion-summary { - display: flex; - justify-content: flex-start; - gap:4px; - align-items: center; -} - -.tsd-accordion-details { - height:0px; - transition: 500ms; -} - -.tsd-index-accordion[open] .tsd-accordion-details { - height: auto; -} - -.col-sidebar { - overflow-x: hidden; -} - -a { - word-break: break-all; -} - -.tsd-index-accordion .tsd-accordion-summary > h3 { - display: flex; - justify-content: flex-start; - gap:4px; - align-items: center; -} - -.tsd-page-toolbar { - background-color: rgb(6, 11, 28); - border-bottom: none; -} - -.tsd-page-toolbar .tsd-toolbar-contents { - -} - -.results { - background-color: rgb(6, 11, 28); -} - -#tsd-search .results li:nth-child(even) { - background-color: #f492f155; -} - -.tsd-search .results li.current,#tsd-search .results li:hover,#tsd-search.has-focus { - background-color: #56337755 !important; - transition: 500ms; -} - - -@media (max-width: 769px) { -html .col-sidebar { - width: 90%; -} - -a { - font-size:12px; -} - -.tree ~ * { - padding: 0; - padding-left: 0; - padding-top: 0; - padding-bottom: 0; - padding-right: 0; -} - -.tree-content,.tree-content ~ *,.tree-content ~ * { - padding: 0; -} - -} \ No newline at end of file diff --git a/lib/aoi.js/packers/docgen.js b/lib/aoi.js/packers/docgen.js deleted file mode 100755 index 6ee373617..000000000 --- a/lib/aoi.js/packers/docgen.js +++ /dev/null @@ -1,382 +0,0 @@ -const uglify = require("uglify-js"); -const csso = require("csso"); -const path = require("path"); - -const fs = require("fs"); -const AoijsPkg = require("../package.json"); -const docPath = "./api_docs/src/pages/docs/"; -const base = path.resolve(process.cwd(), docPath); - -const files = fs.readdirSync(base); - -function walk(base) { - const files = fs.readdirSync(base); - for (const fileordir of files) { - const fsStats = fs.statSync(path.join(base, fileordir)); - if (fsStats.isDirectory()) { - walk(path.join(base, fileordir)); - } else { - if (!fileordir.endsWith(".html")) continue; - - const content = fs.readFileSync( - path.join(base, fileordir), - "utf-8", - ); - // fixing all the relative links - const replaced = content - // replace href to tho anchors which are in the same page in format of SamePage.html#anchor - .replace(/href=".+?\.html#.+?"/g, (match) => { - console.log(match); - if (match.startsWith('href="/')) return match; - if (match.startsWith('href="#')) return match; - if (match.startsWith('href="https://')) return match; - if (match.startsWith('href="http://')) return match; - if (match.startsWith('href="../')) - return `href="/docs/${match - .replaceAll("../", "") - .slice(6)}`.replaceAll(".html", ""); - const category = base.split("/").pop(); - //console.log(match); - return `href="/docs/${category}/${match.slice(6)}`.replaceAll(".html", ""); - }) - .replace(/src=".*?"/g, (match) => { - if (match.startsWith('src="/')) return match; - if (match.startsWith('src="https://')) return match; - if (match.startsWith('src="http://')) return match; - if (match.startsWith('src="../')) - return `src="/${match - .replaceAll("../", "") - .slice(5)}`; - if (match.startsWith('src="./')) { - return `src="/${match - .replaceAll("./", "") - .slice(5)}`; - } - return `src="/${match.slice(5)}`; - }) - .replace(/href=".*?"/g, (match) => { - if (match.startsWith('href="/')) return match; - if (match.startsWith('href="#')) return match; - if (match.startsWith('href="https://')) return match; - if (match.startsWith('href="http://')) return match; - if ( - ['.css"', '.png"', '.jpg"', '.jpeg"'].some((e) => - match.endsWith(e), - ) - ) { - console.log(match); - if (match.startsWith('href="../')) - return `href="/${match - .replaceAll("../", "") - .slice(6)}`; - else if (match.startsWith('href="./')) { - return `href="/${match - .replaceAll("./", "") - .slice(6)}`; - } else return `href="/${match.slice(6)}`; - } - if (match.startsWith('href="../')) - return `href="/docs/${match - .replaceAll("../", "") - .slice(6)}`.replaceAll(".html", ""); - const category = base.split("/").pop(); - if (category === AoijsPkg.version) - return `href="/docs/${match.slice(6)}`.replaceAll(".html", ""); - return `href="/docs/${category}/${match.slice(6)}`.replaceAll(".html", ""); - }) - .replace( - `
-
- -
`, - `
-
- -
- - -
-
- - - -`, - ) - .replace( - `
-
- -
`, - `
-
- -
- - -
-
- - - - -`, - ); - - fs.writeFileSync(path.join(base, fileordir), replaced); - } - } -} - -function moveAssets() { - const assetsPath = path.resolve( - process.cwd(), - `./api_docs/src/pages/docs/assets`, - ); - const newAssetsPath = path.resolve(process.cwd(), "./api_docs/public/assets"); - - if (!fs.existsSync(newAssetsPath)) fs.mkdirSync(newAssetsPath); - - const files = fs.readdirSync(assetsPath); - - for (const file of files) { - let content = fs.readFileSync(path.join(assetsPath, file)).toString(); - - if (file === "search.js") { - content = content.replaceAll(".html", ""); - } else if (file === "main.js") { - content = content.replace( - "m.href=n.base+l.url", - `m.href= "/"+window.location.href.split("/").slice(3,6).join("/")+"/"+l.url`, - ); - } - let minified; - if (file.endsWith(".css")) { - minified = csso.minify(content).css; - } else if (file.endsWith(".js")) minified = uglify.minify(content).code; - else minified = content; - fs.writeFileSync(path.join(newAssetsPath, file), minified ?? ""); - } - - fs.rmSync(assetsPath, { recursive: true }); - - const mycss = fs.readFileSync(__dirname + "/custom.css").toString(); - - fs.appendFileSync(path.join(newAssetsPath, "custom.css"), mycss); -} - -walk(base); -moveAssets(); diff --git a/lib/aoi.js/packers/updatejson.js b/lib/aoi.js/packers/updatejson.js deleted file mode 100755 index 63ece8efb..000000000 --- a/lib/aoi.js/packers/updatejson.js +++ /dev/null @@ -1,56 +0,0 @@ -const json = require("../site/src/data/data.json"); -const typedoc = require("typedoc"); -const fs = require("fs"); -const path = require("path"); -const jsonpath = path.join(process.cwd(), "./site/src/data/data.json"); - -const entries = Object.entries(typedoc.Models.ReflectionKind).filter( - (x) => typeof x[1] === "number", -); -console.log(entries); - -const getTypePlural = (type) => { - if (type === "Class") return "classes"; - if (type === "Interface") return "interfaces"; - if (type === "Enum") return "enums"; - if (type === "Function") return "functions"; - if (type === "Variable") return "variables"; - if (type === "TypeAlias") return "typealiases"; - if (type === "ObjectLiteral") return "objectliterals"; - if (type === "TypeParameter") return "typeparameters"; - if (type === "Accessor") return "accessors"; - if (type === "Constructor") return "constructors"; - if (type === "Property") return "properties"; - if (type === "Method") return "methods"; - if (type === "CallSignature") return "callsignatures"; - if (type === "IndexSignature") return "indexsignatures"; - if (type === "ConstructorSignature") return "constructorsignatures"; - if (type === "Parameter") return "parameters"; - if (type === "TypeLiteral") return "typeliterals"; -}; - -const obj = {}; - -for (const [key, value] of entries) { - obj[getTypePlural(key)] = []; -} - -const RecurSiveDepthLoop = (jsn) => { - obj[getTypePlural(entries.find((x) => x[1] === jsn.kind)[0])].push(jsn); -}; - -json.children.forEach(RecurSiveDepthLoop); -for (const key in obj) { - if (!obj[key].length) delete obj[key]; -} - -fs.writeFileSync( - jsonpath, - JSON.stringify({ - name: "Aoijs", - children: Object.entries(obj).map((x) => ({ - name: x[0], - children: x[1], - })), - }), -); diff --git a/lib/aoi.js/src/README.md b/lib/aoi.js/src/README.md deleted file mode 100644 index d39131926..000000000 --- a/lib/aoi.js/src/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Aoi.js Source - -This is the source code for Aoi.js. It is written in TypeScript and compiled to JavaScript. - -## Directory Structure - -```mermaid -graph RL; - Core -----> Aoijs - Events ----> Aoijs - Functions ---> Aoijs - Manager --> Aoijs - Structures ---> Aoijs - Typings ----> Aoijs - Utils -----> Aoijs - Parsers --> Core - Structs --> Core - Discord --> Functions - Javascript --> Functions - Client --> Discord - Guild --> Discord - Interaction --> Discord - Message --> Discord - Misc --> Discord - User --> Discord - Array --> Javascript - Condition --> Javascript - FileSystem --> Javascript - Loop --> Javascript - Math --> Javascript - Misc --> Javascript - Object --> Javascript - Process --> Javascript - String --> Javascript -``` - -## Divisions - -the `src` directory is divided into the following sections: - -- `core` - this contains the transpiler for aoi.js functions and responsible for converting aoi.js command's code to executable javascript function. - -- `events` - this contains the event handlers for aoi.js - -- `functions` - this contains the functions for aoi.js - -- `manager` - this contains the various managers for aoi.js handling various modules - -- `structures` - this contains the various classes for aoi.js - -- `typings` - this contains the typings for aoi.js - -- `utils` - this contains the various utility functions for aoi.js - -## [pack.js](./pack.js) - -responsible for the adding package.json to the `dist/cjs` and `dist/esm` directories. - -## [index.ts](./index.ts) - -the main entry point for aoi.js diff --git a/lib/aoi.js/src/classes/AoiClient.ts b/lib/aoi.js/src/classes/AoiClient.ts new file mode 100644 index 000000000..21c946553 --- /dev/null +++ b/lib/aoi.js/src/classes/AoiClient.ts @@ -0,0 +1,109 @@ +import Transpiler from '@aoi.js/core/Transpiler.js'; +import { CommandManager } from '@aoi.js/managers/Command.js'; +import FunctionManager from '@aoi.js/managers/Function.js'; +import { + type ICommandOptions, + type IAoiClientOptions, +} from '@aoi.js/typings/interface.js'; +import { + type Optional, + type CommandTypes, +} from '@aoi.js/typings/type.js'; +import { Client, Partials, type ClientOptions } from 'discord.js'; +import * as Events from '@aoi.js/events/index.js'; + +class AoiClient { + client!: Client; + + transpiler: Transpiler; + database = null; + managers!: { + commands: CommandManager; + functions: FunctionManager; + }; + + readonly #options: IAoiClientOptions; + + constructor(options: IAoiClientOptions) { + this.#validateOptions(options); + this.#options = options; + + const transpilerOptions = { + minify: options.transpilerOptions?.minify ?? true, + customFunctions: {}, + }; + + this.transpiler = new Transpiler(transpilerOptions, this); + this.managers = { + commands: new CommandManager(this), + functions: new FunctionManager(this), + }; + if (options.testMode) return; + + const djsOptions: ClientOptions = options.djsClientOptions ?? { + intents: 0, + }; + + djsOptions.partials ||= [ + Partials.GuildMember, + Partials.Channel, + Partials.Message, + Partials.Reaction, + Partials.User, + Partials.GuildScheduledEvent, + Partials.ThreadMember, + ]; + djsOptions.intents = options.intents; + + this.client = new Client(djsOptions); + this.#bindEvents(); + } + + async start() { + await this.client.login(this.#options.token); + } + + command(data: Optional ) { + if (!data.type) data.type = 'basic' as CommandTypes; + data.__path__ = data.__path__ ?? 'root'; + + this.managers.commands.add(data as ICommandOptions); + return this; + } + + #validateOptions(options: IAoiClientOptions) { + if (options.intents === undefined) { + throw new SyntaxError( + 'Intents not provided, "Guilds" intent is required', + ); + } + + if (isNaN(options.intents)) { + throw new TypeError('Provided intents are not of type "number"'); + } + + if (!options.token) { + throw new SyntaxError('Token not provided'); + } + + if (!options.prefix?.length) { + throw new SyntaxError('Prefix not provided'); + } + } + + #bindEvents() { + this.#options.events.forEach((event) => { + Events[event]?.(this); + }); + } + + get prefix() { + return this.#options.prefix; + } + + get options() { + return this.#options; + } +} + +export default AoiClient; diff --git a/lib/aoi.js/src/classes/Command.ts b/lib/aoi.js/src/classes/Command.ts new file mode 100644 index 000000000..601ee0589 --- /dev/null +++ b/lib/aoi.js/src/classes/Command.ts @@ -0,0 +1,75 @@ +import { type AsyncFunction, type CommandTypes } from '@aoi.js/typings/type.js'; +import type AoiClient from './AoiClient.js'; +import { type ICommandOptions } from '@aoi.js/typings/interface.js'; +import { type Snowflake } from 'discord.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; + +export default class Command { + [key: string]: unknown; + name!: string; + type!: CommandTypes; + code!: string | AsyncFunction; + aliases?: string[]; + channel?: string; + // eslint-disable-next-line @typescript-eslint/naming-convention + __path__!: string; + reverseRead?: boolean; + executeAt?: 'guild' | 'dm' | 'both'; + // eslint-disable-next-line @typescript-eslint/naming-convention + __compiled__!: AsyncFunction; + + constructor(data: ICommandOptions, client: AoiClient) { + this.name = data.name; + this.type = data.type; + this.code = data.code; + this.aliases = data.aliases; + this.__path__ = data.__path__; + this.executeAt = data.executeAt ?? 'both'; + this.reverseRead = data.reverseRead ?? false; + + const transpiler = client.transpiler; + + for (const key in data) { + if ( + ![ + 'name', + 'type', + 'code', + 'aliases', + '__path__', + 'executeAt', + 'reverseRead', + ].includes(key) + ) + this[key] = data[key]; + } + + if (this.code instanceof Function) this.__compiled__ = this.code; + else { + let channelId: Snowflake | undefined; + if (this.channel) { + if ( + typeof this.channel === 'string' && + this.channel.startsWith('$') + ) { + channelId = transpiler.transpile(this.channel, { + sendMessage: false, + scopeData: { + name: 'GLOBAL_CHANNEL', + }, + asFunction: false, + }).result; + } else channelId = this.channel; + } + + const func = transpiler.transpile(this.code, { + sendMessage: true, + reverse: this.reverseRead, + scopeData: { + useChannel: channelId?.includes('__$DISCORD_DATA$__') ? escapeResult(channelId) : channelId, + }, + }); + this.__compiled__ = func.func!; + } + } +} diff --git a/lib/aoi.js/src/classes/Util.ts b/lib/aoi.js/src/classes/Util.ts new file mode 100644 index 000000000..1068cef4a --- /dev/null +++ b/lib/aoi.js/src/classes/Util.ts @@ -0,0 +1,28 @@ +import { type Guild, type Snowflake, type User } from 'discord.js'; +import type AoiClient from './AoiClient.js'; +import { type Group } from '@aoijs/structures'; + +export class Util { + client: AoiClient; + constructor(client: AoiClient) { + this.client = client; + } + + async getUser(id: Snowflake) { + return this.client.client.users.resolve(id); + } + + // findUser(name: string) { + // if (this.client.cache?.users) + // return ( + // this.client.cache.users as unknown as Group + // ).find((u) => u.username === name || u.tag === name); + // else return undefined; + // } + + // async getGuild(id: Snowflake) { + // if (this.client.cache?.guilds) + // return this.client.cache.guilds.get(id) as Guild; + // else return await this.client.client.getGuild(id); + // } +} diff --git a/lib/aoi.js/src/core/AoiReader.ts b/lib/aoi.js/src/core/AoiReader.ts new file mode 100644 index 000000000..ced2bc3e8 --- /dev/null +++ b/lib/aoi.js/src/core/AoiReader.ts @@ -0,0 +1,165 @@ +import { BundlerCustoms } from '@aoi.js/typings/enum.js'; +import { TranspilerError } from './Error.js'; +import { type ICommandOptions } from '@aoi.js/typings/interface.js'; +import { type Optional } from '@aoi.js/typings/type.js'; +import type AoiClient from '@aoi.js/classes/AoiClient.js'; + +export default class AoiReader { + _parseEmbeddedJS(code: string) { + let cntr = 0, + isPotentialStart = false, + tmp = ''; + const embeds = []; + + for (const char of code) { + if (char === '$') { + if (cntr) { + tmp += char; + } + + if (!isPotentialStart) { + isPotentialStart = true; + } + } else if (char === '{') { + if (isPotentialStart && !cntr) { + cntr++; + } else if (cntr) { + tmp += char; + cntr++; + } + } else if (char === '}') { + if (cntr) { + cntr--; + + if (!cntr) { + embeds.push(tmp); + tmp = ''; + isPotentialStart = false; + } else { + tmp += char; + } + } else if (isPotentialStart) { + isPotentialStart = false; + } + } else { + if (cntr) { + tmp += char; + } + } + } + + if (cntr) { + throw TranspilerError.AoiReaderError('Invalid embedded JS', code); + } + + return embeds; + } + + _updateEmbedJs(compiled: string, embeds: string[]) { + while (embeds.length) { + const embed = embeds.pop()!; + compiled = this._replaceLast(compiled, BundlerCustoms.EJS, embed); + } + + return compiled; + } + + _replaceLast(str: string, find: string, replace: string) { + const index = str.lastIndexOf(find); + if (index === -1) { + return str; + } + + return str.slice(0, index) + replace + str.slice(index + find.length); + } + + _parseMetadata(metadataLines: string[]) { + const metadata: Record = {}; + let currentKey: string | undefined = undefined; + let currentValue: unknown = undefined; + let isObjectBlock = false; + + metadataLines.forEach((line) => { + line = line.trim(); + + if (line.includes('|')) { + const [key, value] = line.split(':').map((s) => s.trim()); + metadata[key] = value.split('|').map((item) => item.trim()); + } else if (line.endsWith('>') && isObjectBlock) { + isObjectBlock = false; + metadata[currentKey!] = currentValue; + currentKey = undefined; + } else if (isObjectBlock) { + const [key, value] = line.split(':').map((s) => s.trim()); + (currentValue as Record)[key] = value; + } else { + const [key, value] = line.split(':').map((s) => s.trim()); + if (value.startsWith('<')) { + currentKey = key; + currentValue = {}; + isObjectBlock = true; + } else { + metadata[key] = value; + } + } + }); + + return metadata; + } + + _parseCmd(cmdString: string) { + const sections = cmdString.split('---'); + + if (sections.length < 3) { + throw new SyntaxError( + 'Invalid command format provided:\n\n' + cmdString, + ); + } + + let result: Optional; + + const metadataLines = sections[1].trim().split('\n'); + result = this._parseMetadata(metadataLines) as Optional< + ICommandOptions, + '__path__' + >; + + result.code = sections.slice(2).join('---').trim(); + return result; + } + + parse(code: string, client: AoiClient) { + const embeddedJS = this._parseEmbeddedJS(code); + + for (const ejs of embeddedJS) { + code = code.replace(`\${${ejs}}`, BundlerCustoms.EJS); + } + + const cmd = this._parseCmd(code); + cmd.code = client.transpiler.transpile(cmd.code as string, { + scopeData: { + embeddedJS: embeddedJS, + }, + sendMessage: true, + reverse: cmd.reverseRead ?? false, + }).func!; + + return cmd; + } +} + +/* +```aoi +--- +name: ping +type: basic +alias: ms | latency | pong +info: < + usage: !ping + description: returns ping + > +--- + +Pong! current ping is $pingms! +``` +*/ diff --git a/lib/aoi.js/src/core/builders/Condition.ts b/lib/aoi.js/src/core/builders/Condition.ts new file mode 100644 index 000000000..d251229b2 --- /dev/null +++ b/lib/aoi.js/src/core/builders/Condition.ts @@ -0,0 +1,142 @@ +import { inspect } from 'util'; +import { parseData } from '@aoi.js/utils/Helpers/core.js'; +import { parseString } from '../parsers/string.js'; +import { BundlerCustoms, TranspilerCustoms } from '@aoi.js/typings/enum.js'; + +export const OPERATORS = ['==', '!=', '>=', '<=', '>', '<', '===', '!=='] as const; + +export default class Condition { + condition: string; + children: Condition[] = []; + parent: Condition | undefined; + + constructor(condition: string, parent?: Condition) { + this.condition = condition; + this.parent = parent; + } + + _handlePart(part: string) { + let result; + if (part.split(' ').length === 1) { + result = parseData(part); + + if (typeof result === 'object') { + try { + result = JSON.stringify(result); + } catch { + result = inspect(result, { depth: null }); + } + } else if (typeof result === 'string') { + if ( + !( + (result.startsWith(TranspilerCustoms.FS) && + result.endsWith(TranspilerCustoms.FE)) || + result.startsWith('__$DISCORD_DATA$__') || + result.trim() === (BundlerCustoms.EJS as string) + ) + ) { + result = parseString(result); + + if (typeof parseData(result.slice(1, -1)) !== 'string') { + result = parseData(result.slice(1, -1)); + } + } + } else if (typeof result === 'bigint') { + result = result.toString() + 'n'; + } + } else { + result = parseString(part); + } + + return result; + } + + _handleConditionWithOperator(condition: string, op: string) { + let [left, right] = condition.split(op); + left = left.trim(); + right = right.trim(); + + const leftResult = this._handlePart(left) as string; + const rightResult = this._handlePart(right) as string; + + return `${leftResult}${op}${rightResult}`; + } + + _solve(condition: string) { + condition = condition + .replaceAll(TranspilerCustoms.SBL, '(') + .replaceAll(TranspilerCustoms.SBR, ')'); + + if (this.children.length) { + for (const child of this.children) { + const solved = child.solve(); + condition = condition.replace('#CONDITION#', `(${solved})`); + } + + return condition; + } + + const op = OPERATORS.find((op) => condition.includes(op)); + let result; + + if (op) { + result = this._handleConditionWithOperator(condition, op); + } else { + result = parseData(condition); + + if ( + typeof result === 'string' && + (!result.endsWith(TranspilerCustoms.FE) || + result.trim().split(' ').length > 1) && + !result.startsWith(TranspilerCustoms.FS) && + result.trim() !== (BundlerCustoms.EJS as string) + ) { + result = parseString(result); + } + } + + return result as string; + } + + _solveOr(condition: string) { + const subConditions = condition.split('||'); + const results = []; + + for (const subCondition of subConditions) { + results.push(this._solve(subCondition)); + } + + return results.join(' || '); + } + + _solveAnd(condition: string) { + const subConditions = condition.split('&&'); + const results = []; + + for (const subCondition of subConditions) { + if (subCondition.includes('||')) { + results.push(this._solveOr(subCondition)); + } else { + results.push(this._solve(subCondition)); + } + } + + return results.join(' && '); + } + + solve() { + if (this.children.length) { + return this._solve(this.condition); + } + + return this._solveAnd(this.condition); + } + + add(part: string) { + this.condition += part; + } + + addChild(child: Condition) { + this.children.push(child); + } +} diff --git a/lib/aoi.js/src/core/builders/CustomFunction.ts b/lib/aoi.js/src/core/builders/CustomFunction.ts new file mode 100644 index 000000000..6ef1a5459 --- /dev/null +++ b/lib/aoi.js/src/core/builders/CustomFunction.ts @@ -0,0 +1,237 @@ +import { FunctionType, type ReturnType } from '@aoi.js/typings/enum.js'; +import { + type ITranspileOptions, + type IFunctionField, + type ICodeFunctionData, +} from '@aoi.js/typings/interface.js'; +import { + type AsyncFunction, + type CustomFunctionProps, + type FunctionCode, +} from '@aoi.js/typings/type.js'; +import FunctionBuilder from './Function.js'; +import type AoiClient from '@aoi.js/classes/AoiClient.js'; +import type Scope from './Scope.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; + +/** + * Represents a custom function in Aoi.js that can either be JavaScript or Aoijs. + */ +export default class CustomFunction + extends FunctionBuilder + implements CustomFunctionProps { + declare name: string; + functionType!: 'js' | 'aoijs'; + brackets = false; + optional = false; + declare type: FunctionType; + declare fields: IFunctionField[]; + declare returns: ReturnType; + declare code: FunctionCode; + _code!: undefined | string; + + /** + * Sets the function type (either 'js' or 'aoijs'). + * + * @param functionType - The type of the function ('js' or 'aoijs'). + * @returns The current instance of `CustomFunction`. + */ + setFunctionType(functionType: 'js' | 'aoijs'): this { + this.functionType = functionType; + return this; + } + + /** + * Sets the code for this custom function. + * + * @param code - The code to set for this custom function. + * @returns The current instance of `CustomFunction`. + */ + setCode(code: string | ((data: ICodeFunctionData, scopes: Scope[], thisArg: FunctionBuilder) => { + code: string; + scope: Scope[]; + })): this { + if ( typeof code === 'function' ) { + this.code = (data: ICodeFunctionData, scopes: Scope[]) => { + return code(data, scopes, this); + }; + + } else { + this._code = code; + } + + return this; + } + + /** + * Creates the custom function and adds it to the client. + * + * @param client - The Aoi.js client. + * @param options - Options for transpiling the code. + * @returns The built function object. + */ + create(client: AoiClient, options: ITranspileOptions) { + if (this.functionType === 'js') { + const build = this.build(); + client.managers.functions.addFunction(this.name, build); + return build; + } else { + const fieldNames = this.fields.map((field) => field.name); + + this.code = this.#setAoijsCodeToJs(client, fieldNames, options); + + const build = { + name: this.name, + brackets: this.brackets, + optional: this.optional, + type: this.type, + fields: this.fields, + returns: this.returns, + extra: this.extra, + code: this.code, + }; + + client.managers.functions.addFunction(this.name, build); + return build; + } + } + + /** + * Handles the general logic for replacing placeholders, transpiling code, and handling function or result. + * + * @param client - The Aoi.js client. + * @param fieldNames - The names of the fields in the function. + * @param options - Options for transpiling the code. + * @param scopes - The current scope stack. + * @param thisArg - The reference to the current function builder instance. + * @param asFunction - Whether the code should be treated as a function. + * @param sendMessage - Whether to send a message. + * @returns The transpiled code as a string. + */ + #handleFunction( + client: AoiClient, + fieldNames: string[], + options: ITranspileOptions, + scopes: Scope[], + thisArg: FunctionBuilder, + asFunction: boolean, + sendMessage: boolean, + ): FunctionCode { + return super.setCode((data: ICodeFunctionData) => { + const params = thisArg.getParams(data); + const currentScope = thisArg.getCurrentScope(scopes); + let code = this._code; + + for (let i = 0; i < fieldNames.length; i++) { + const field = fieldNames[i]; + const value = params[i]; + code = code?.replaceAll(`{${field}}`, value); + } + + const results = client.transpiler.transpile(code ?? '', { + ...options, + scopeData: { + ...options.scopeData, + ...currentScope, + functions: currentScope._funcList, + name: this.name, + }, + asFunction, + sendMessage, + }); + + const func = asFunction ? results.func! : results.result; + + if (asFunction && !thisArg.hasFunction(currentScope, this.name)) { + thisArg.addFunction(currentScope, func as AsyncFunction); + } + + const escaped = escapeResult( + asFunction ? `await ${this.name}(__$DISCORD_DATA$__)` : (func as string), + ); + + return { + code: escaped, + scope: scopes, + }; + }).code; + } + + /** + * Maps Aoijs code to JavaScript for different function types. + * + * @param client - The Aoi.js client. + * @param fieldNames - The field names for the function. + * @param options - Options for transpiling the code. + * @returns The JavaScript code for the Aoijs function. + */ + #setAoijsCodeToJs( + client: AoiClient, + fieldNames: string[], + options: ITranspileOptions, + ): FunctionCode { + switch (this.type) { + case FunctionType.Getter: + return this.#handleFunction( + client, + fieldNames, + options, + [], + this, + false, + false, + ); + case FunctionType.Function: + return this.#handleFunction( + client, + fieldNames, + options, + [], + this, + true, + true, + ); + case FunctionType.Setter: + return this.#handleFunction( + client, + fieldNames, + options, + [], + this, + false, + false, + ); + case FunctionType.FunctionGetter: + return this.#handleFunction( + client, + fieldNames, + options, + [], + this, + true, + false, + ); + // TODO: Implement the scope type. currently below are placeholder + case FunctionType.ScopeGetter: + return this.#handleFunction( + client, + fieldNames, + options, + [], + this, + false, + false, + ); + case FunctionType.Scope: + return this.#handleFunction( + client, + fieldNames, + options, + [], + this, + true, + true, + ); + } + } +} diff --git a/lib/aoi.js/src/core/builders/Function.ts b/lib/aoi.js/src/core/builders/Function.ts new file mode 100644 index 000000000..219240418 --- /dev/null +++ b/lib/aoi.js/src/core/builders/Function.ts @@ -0,0 +1,230 @@ +import { + ReturnType, + TranspilerCustoms, + type FunctionType, +} from '@aoi.js/typings/enum.js'; +import { + type IFunctionField, + type IFunctionData, + type ICodeFunctionData, + type ITranspilerData, +} from '@aoi.js/typings/interface.js'; +import { type ProxyType, type FunctionCode } from '@aoi.js/typings/type.js'; +import type Scope from './Scope.js'; +import { inspect } from 'node:util'; +import proxyBuilder from './typeProxy.js'; +import { escapeVars } from '@aoi.js/utils/Helpers/core.js'; + +export default class FunctionBuilder implements IFunctionData { + name!: string; + brackets!: boolean; + optional!: boolean; + type!: FunctionType; + fields!: IFunctionField[]; + returns!: ReturnType; + extra!: unknown; + code!: FunctionCode; + + setName(name: string): this { + this.name = name; + return this; + } + + setBrackets(brackets: boolean): this { + this.brackets = brackets; + return this; + } + + setOptional(optional: boolean): this { + this.optional = optional; + return this; + } + + setType(type: FunctionType): this { + this.type = type; + return this; + } + + setFields(fields: IFunctionField[]): this { + this.fields = fields; + return this; + } + + setReturns(returns: ReturnType): this { + this.returns = returns; + return this; + } + + setExtra(extra: unknown): this { + this.extra = extra; + return this; + } + + setCode( + code: ( + data: ICodeFunctionData, + scopes: Scope[], + thisArg: FunctionBuilder, + ) => { + code: string; + scope: Scope[]; + }, + ): this { + this.code = (data: ICodeFunctionData, scopes: Scope[]) => { + return code(data, scopes, this); + }; + + return this; + } + + build(): IFunctionData { + return { + name: this.name, + brackets: this.brackets, + optional: this.optional, + type: this.type, + fields: this.fields, + returns: this.returns, + extra: this.extra, + code: this.code, + }; + } + + // Helper functions to be used in the code function + + getCurrentScope(scopes: Scope[]): Scope { + return scopes[scopes.length - 1]; + } + + getParams(data: ICodeFunctionData): string[] { + return data.fields.length === 1 && + ![ReturnType.Any, ReturnType.Array].includes(data.fields[0].type) + ? [data.executed] + : data.splits(); + } + + addFunction( + scope: Scope, + func: (...args: any[]) => any, + vars: string[] = [], + ): void { + const stringified = func.toString(); + + const functionName = inspect(func) + .replace('[Function: ', '') + .replace(']', '') + .trim(); + + const es5Regex = + /^(?:(?:\/\*[^(?:*/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*\s*(?:(?:(?:async\s(?:(?:\/\*[^(?:*/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*\s*)?function|class)(?:\s|(?:(?:\/\*[^(?:*/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*)|(?:[_$\w][\w0-9_$]*\s*(?:\/\*[^(?:*/)]*\*\/\s*)*\s*\()|(?:\[\s*(?:\/\*[^(?:*/)]*\*\/\s*)*\s*(?:(?:['][^']+['])|(?:["][^"]+["]))\s*(?:\/\*[^(?:*/)]*\*\/\s*)*\s*\]\())/; + + const isEs6 = !es5Regex.test(stringified); + const findNumbersRegex = /\$[0-9]+/g; + let functionToAdd = ''; + + if (isEs6) { + functionToAdd = `function ${functionName} ${stringified.replace( + '=>', + '', + )}`; + } else { + functionToAdd = stringified; + } + + const numbers = functionToAdd.match(findNumbersRegex); + if (numbers?.length && vars?.length) { + for (const number of numbers) { + const index = parseInt(number.replace('$', '')); + functionToAdd = functionToAdd + .replaceAll(`"${number}"`, vars[index]) + .replaceAll(`'${number}'`, vars[index]); + } + } + + scope.addFunction(functionToAdd); + } + + hasFunction(scope: Scope, functionName: string): boolean { + return scope._funcList.includes(functionName); + } + + getResultString( + func: (__$DISCORD_DATA$__: ITranspilerData) => any, + args: string[] = [], + ): string { + const body = func.toString(); + + const matchWholeArgwithAsync = /(async\s*)?\(?\s*(\w)*\s*\)?(?=\s*=>)/; + const argRegex = /\(?\s*(\w)*\s*\)?(?=\s*=>)/; + + const getArg = argRegex.exec(body); + if (!getArg) throw new Error('Function Arg must be present'); + + const arg = getArg[0].replace('(', '').replace(')', '').trim(); + + let bodyWithoutArg = body.replace(matchWholeArgwithAsync, ''); + + if (arg !== '') { + bodyWithoutArg = this.#replaceArgInFunctionStringWithDiscord( + bodyWithoutArg, + arg, + ); + } + + const removedArrow = bodyWithoutArg.replace('=>', '').trim(); + + const bodyWithoutBrackets = removedArrow.startsWith('{') + ? removedArrow.slice(1, -1) + : removedArrow; + const findNumbersRegex = /\$[0-9]+/g; + const numbers = bodyWithoutBrackets.match(findNumbersRegex); + + if (!numbers) { + return bodyWithoutBrackets; + } + + let result = bodyWithoutBrackets; + for (const number of numbers) { + const index = parseInt(number.replace('$', '')); + result = result + .replaceAll(`"${number}"`, args[index]) + .replaceAll(`'${number}'`, args[index]); + } + + return result.trim(); + } + + as(variable: string): ProxyType { + return proxyBuilder(variable); + } + + defineVar(name: string, value: string, redefined = false) { + if (redefined) { + return `${escapeVars(name)} = ${value};\n`; + } else { + return `let ${escapeVars(name)} = ${value};\n`; + } + } + + canSuppressAtComp(data: ICodeFunctionData, scope: Scope): boolean { + if ( + data.executed.startsWith(TranspilerCustoms.FS) || + scope.name.startsWith('$try') || + scope.name.startsWith('$catch') + ) { + return true; + } else { + return false; + } + } + + #replaceArgInFunctionStringWithDiscord(func: string, arg: string) { + // it will replace all arg with __$DISCORD_DATA$__ and wont replace same word if it is a part of another word or a property + + const regex = new RegExp( + `(?; + hasSendData: boolean; + sendFunction: string; + functions: string; + _funcList: string[] = []; + _contentParts: string[] = []; + _packages: string[] = []; + addReturn: boolean; + useChannel?: bigint | string; + embeddedJS: string[] = []; + packages = ''; + client: AoiClient; + constructor( + name: string, + client: AoiClient, + parent?: string, + ast?: ICodeFunctionData, + addReturn?: boolean, + ) { + this.name = name; + this.sendFunction = 'await __$DISCORD_DATA$__.channel.send'; + this.parent = parent; + this.hasSendData = false; + this.content = ast ? this.getContent(ast) : ' '; + this.variables = []; + this.objects = {}; + this.env = []; + this.setters = ''; + this.functions = ''; + this.addReturn = addReturn ?? false; + this.client = client; + } + + getContent(ast: ICodeFunctionData): string { + // remove all non returning functionType + const parts = [ast.executed]; + if (ast.funcs.length) { + let idx = 0; + for (const func of ast.funcs) { + if ( + [ + FunctionType.Function, + FunctionType.Scope, + FunctionType.Setter, + ].includes(func.type) + ) { + const lastPart = parts.at(-1)!; + const splits = lastPart.split(`#FUNCTION_${idx}#`); + parts.pop(); + parts.push(...splits); + } + + idx++; + } + } + + this._contentParts = parts; + return parts.join(''); + } + + updateContentParts(part: string, replacedTo: string) { + this._contentParts = this._contentParts.map((p) => + p.replace(part, replacedTo), + ); + } + + addVariables(...scopeVars: string[]) { + this.variables.push(...scopeVars); + } + + hasVariable(name: string) { + return this.variables.includes(name); + } + + addEmbeds(embeds: unknown[]) { + this.embeds.push(...embeds); + } + + addFunction(func: string) { + this.functions += func + ' \n'; + this._funcList.push(func.split(' ')[1].trim()); + } + + replaceLast(str: string, replacer: string, replacedTo: string) { + const index = str.lastIndexOf(replacer); + if (index === -1) return str; + return ( + str.substring(0, index) + + replacedTo + + str.substring(index + replacer.length) + ); + } + + replace(str: string, replacer: string, replacedTo: string) { + const index = str.indexOf(replacer); + if (index === -1) return str; + return ( + str.substring(0, index) + + replacedTo + + str.substring(index + replacer.length) + ); + } + + addChild(child: string) { + this.children.push(new Scope(child, this.client, this.name)); + } + + getChild(name: string) { + return this.children.find((child) => child.name === name); + } + + removeChild(name: string) { + this.children = this.children.filter((child) => child.name !== name); + } + + addPkg(pkgName: string, code: string) { + this.packages += code + '\n'; + this._packages.push(pkgName); + } + + hasPkg(pkgName: string) { + return this._packages.includes(pkgName); + } + + getFunction(code: string, sendMessage = true, execute = false) { + const name = this.name === 'global' ? 'main' : this.name; + return ( + `async function ${name}(__$DISCORD_DATA$__) {\n${this.generate( + code, + sendMessage, + )}\n}` + + (execute + ? `\n${ + this.addReturn ? 'return ' : '' + }${name}(__$DISCORD_DATA$__);` + : '') + ).replaceAll(TranspilerCustoms.SL, '`'); + } + + clone(name: string) { + const scope = new Scope(name, this.client, this.parent); + scope.embeds = this.embeds; + scope.components = this.components; + scope.files = this.files; + scope.stickers = this.stickers; + scope.env = this.env; + scope.variables = this.variables; + scope.setters = this.setters; + scope.objects = this.objects; + scope.hasSendData = this.hasSendData; + scope.sendFunction = this.sendFunction; + scope.functions = this.functions; + scope._funcList = this._funcList; + scope.addReturn = this.addReturn; + scope.useChannel = this.useChannel; + scope.embeddedJS = this.embeddedJS; + scope.packages = this.packages; + return scope; + } + + merge(scope: Scope) { + this.embeds.push(...scope.embeds); + this.components.push(...scope.components); + this.files.push(...scope.files); + this.stickers.push(...scope.stickers); + this.env.push(...scope.env); + this.variables.push(...scope.variables); + this.setters += scope.setters; + this.objects = { ...this.objects, ...scope.objects }; + this.hasSendData = this.hasSendData || scope.hasSendData; + this.functions += scope.functions; + this._funcList.push(...scope._funcList); + this.addReturn = this.addReturn || scope.addReturn; + this.useChannel = scope.useChannel ?? this.useChannel; + this.embeddedJS.push(...scope.embeddedJS); + this.packages += scope.packages; + } + + generate(code: string, sendMessage = true, asFunction = true) { + if (sendMessage) + for (const part of this._contentParts) { + code = code.replace(part, ''); + } + + const sendData = { + content: this.content + .replaceAll('\n', TranspilerCustoms.NL) + .replaceAll(BundlerCustoms.EJS, ''), + embeds: escapeResult(escapeVars(`${this.name}_embeds`)), + components: escapeResult(escapeVars(`${this.name}_components`)), + files: escapeResult(escapeVars(`${this.name}_files`)), + stickers: escapeResult(escapeVars(`${this.name}_stickers`)), + }; + + if ( + sendData.content.replaceAll(TranspilerCustoms.NL, '').trim() !== + '' || + this.embeds.length || + this.files.length || + this.stickers.length + ) + this.hasSendData = true; + else this.hasSendData = false; + + sendData.content = parseString( + sendData.content.replaceAll(TranspilerCustoms.NL, '\n').trim(), + ) + .replaceAll(TranspilerCustoms.SL, '\\`') + .trim(); + + if (sendData.content.trim() === '') { + sendData.content = ' '; + } + + sendData.content = fixMath( + sendData.content === '``' ? '` `' : sendData.content, + ); + + const payload = `{ + content: ${sendData.content}, + embeds: ${sendData.embeds}, + components: ${sendData.components}, + files: ${sendData.files}, + stickers: ${sendData.stickers}, + flags: ${this.ephemeral ? 64 : 0}, + }`.replaceAll(TranspilerCustoms.NL, '\\\\n'); + + const channelSendFunction = this.useChannel + ? `__$DISCORD_DATA$__.client.channels.cache.get(${parseString( + typeof this.useChannel === 'bigint' + ? this.useChannel.toString() + 'n' + : this.useChannel.toString(), + )}).send` + : this.sendFunction; + + const sent = + this.hasSendData && sendMessage + ? ` + ${this.addReturn ? 'return ' : ''} await ${channelSendFunction}( ${payload} );` + : ''; + + const initialVars = sendMessage + ? ` + const ${escapeVars(`${this.name}_embeds`)} = []; + const ${escapeVars(`${this.name}_components`)} = []; + const ${escapeVars(`${this.name}_files`)} = []; + const ${escapeVars(`${this.name}_stickers`)} = []; + ` + : ''; + + return parseResult( + asFunction + ? ` + async function ${this.name === 'global' ? 'main' : this.name}(__$DISCORD_DATA$__) { + ${initialVars} + ${this.packages} + ${this.functions} + ${code} + ${sent} + } + `.replaceAll(TranspilerCustoms.SL, '\\`') + : ` + ${initialVars} + ${this.packages} + ${this.functions} + ${code} + ${sent} + `.replaceAll(TranspilerCustoms.SL, '\\`'), + ).trim(); + } +} diff --git a/lib/aoi.js/src/core/structs/StringObject.ts b/lib/aoi.js/src/core/builders/StringObject.ts similarity index 99% rename from lib/aoi.js/src/core/structs/StringObject.ts rename to lib/aoi.js/src/core/builders/StringObject.ts index 320183862..86b129aa2 100644 --- a/lib/aoi.js/src/core/structs/StringObject.ts +++ b/lib/aoi.js/src/core/builders/StringObject.ts @@ -23,7 +23,7 @@ export default class StringObject { addValue(text: string) { this.values.push(text); } - + addEnd(text: '}' | ']') { this.end = text; } diff --git a/lib/aoi.js/src/core/builders/TextBlock.ts b/lib/aoi.js/src/core/builders/TextBlock.ts new file mode 100644 index 000000000..60380b9a4 --- /dev/null +++ b/lib/aoi.js/src/core/builders/TextBlock.ts @@ -0,0 +1,36 @@ +export default class TextBlock { + position: number; + isMain: boolean; + parent?: TextBlock; + children: TextBlock[]; + text: string; + + constructor(position: number, isMain: boolean, parent?: TextBlock) { + this.position = position; + this.isMain = isMain; + this.parent = parent; + this.children = []; + this.text = ''; + } + + addText(text: string) { + this.text += text; + } + + addChild(child: TextBlock) { + this.children.push(child); + } + + parse() { + for (const child of this.children) { + const res = child.parse(); + this.text = this.text.replace(child.parsed, res); + } + + return this.isMain ? `\`${this.text}\`` : `\${${this.text}}`; + } + + get parsed() { + return `#CHILD_POSITION_${this.position}#`; + } +} \ No newline at end of file diff --git a/lib/aoi.js/src/core/builders/typeProxy.ts b/lib/aoi.js/src/core/builders/typeProxy.ts new file mode 100644 index 000000000..0c03db54b --- /dev/null +++ b/lib/aoi.js/src/core/builders/typeProxy.ts @@ -0,0 +1,27 @@ +import { type ProxyType } from '@aoi.js/typings/type.js'; + +export default function proxyBuilder(variableName: string) { + function createProxy(state: string) { + const handler: ProxyHandler> = { + // eslint-disable-next-line @typescript-eslint/naming-convention + get(_, propKey) { + if (propKey === 'build') { + return () => state; + } + + // Dynamically handle method calls + return function (...args: any[]) { + const argsStr = args + .map((arg) => JSON.stringify(arg)) + .join(', '); + const newState = `${state}.${String(propKey)}(${argsStr})`; + return createProxy(newState); + }; + }, + }; + + return new Proxy({}, handler) as ProxyType; + } + + return createProxy(variableName); +} diff --git a/lib/aoi.js/src/core/bundler.ts b/lib/aoi.js/src/core/bundler.ts deleted file mode 100644 index e2d9f4cfa..000000000 --- a/lib/aoi.js/src/core/bundler.ts +++ /dev/null @@ -1,102 +0,0 @@ -import * as Transpiler from './transpiler.js'; -import { JsonXYaml } from './structs/JsonXYaml.js'; -import { BundlerCustoms } from '../typings/enums.js'; -import { type AoiClient } from '../index.js'; - -export function Bundler(code: string, client: AoiClient) { - const embedJs = parseEmbedJs(code); - for (const ejs of embedJs) { - code = code.replace(`\${${ejs}}`, BundlerCustoms.EJS); - } - - const command = parseExportCommand(code); - - command.code = Transpiler.transpiler((command.code as string), { - scopeData:{ - embedJs: embedJs, - }, - sendMessage: true, - minify: true, - reverse: command.reverse as boolean ?? false, - client, - }).func; - - return { - command:command, - embedJs, - }; -} - -// this function will get js code from ${} or nested ${} in a string and return it -export function parseEmbedJs(fileData: string) { - let counter = 0; - let isPotentialStart = false; - let temp = ''; - const embedJs: string[] = []; - for (let i = 0; i < fileData.length; i++) { - const char = fileData[i]; - if (char === '$') { - if (counter) { - temp += char; - } - - if (!isPotentialStart) { - isPotentialStart = true; - } - } else if (char === '{') { - if (isPotentialStart && !counter) { - counter++; - } else if (counter) { - temp += char; - counter++; - } - } else if (char === '}') { - if (counter) { - counter--; - if (counter === 0) { - embedJs.push(temp); - temp = ''; - isPotentialStart = false; - } else { - temp += char; - } - } else if (isPotentialStart) { - isPotentialStart = false; - } - } else { - if (counter) { - temp += char; - } - } - } - - if (counter) { - throw new Error('Invalid embed js'); - } - - return embedJs; -} - -export function getCodeFromString(s: string) { - return s.split('@{').slice(1).join('@{').split('}').slice(0, -1).join('}').trim(); -} - -export function parseExportCommand(s: string) { - const commandTypeMatchArray = /\[exportCommand:\s*(\w+)\]/.exec(s); - if (!commandTypeMatchArray) { - throw new Error('Invalid export command'); - } - - const commandType = commandTypeMatchArray[1]; - let command = s.split(commandTypeMatchArray[0])[1].trim(); - command = command.slice(1, command.length - 1); - - const code = getCodeFromString(command); - command = command.replace(code, code.replaceAll('{', BundlerCustoms.LB).replaceAll('}', BundlerCustoms.RB)); - const jsonxyaml = new JsonXYaml(command); - const obj = jsonxyaml.toObject(); - obj.type = commandType; - obj.code = (obj.code as string).replaceAll(BundlerCustoms.LB, '{').replaceAll(BundlerCustoms.RB, '}'); - return obj; -} - diff --git a/lib/aoi.js/src/core/error.ts b/lib/aoi.js/src/core/error.ts index 33738d0cb..9be1acbd0 100644 --- a/lib/aoi.js/src/core/error.ts +++ b/lib/aoi.js/src/core/error.ts @@ -1,5 +1,37 @@ +import { type ICodeFunctionData } from '@aoi.js/typings/interface.js'; + export class TranspilerError extends Error { - cause: TranspilerError; + + static CompileError(msg: string, data: ICodeFunctionData) { + return new TranspilerError(`CompileError: ${msg}`, { + function: { + name: data.name, + code: data.inside ?? '', + }, + cmd: data.cmd?.name, + path: data.cmd?.__path__, + code: data.cmd?.code.toString(), + }); + } + + static RunTimeError(msg: string, data: ICodeFunctionData) { + return new TranspilerError(`RunTimeError: ${msg}`, { + function: { + name: data.name, + code: data.inside ?? '', + }, + cmd: data.cmd?.name, + path: data.cmd?.__path__, + code: data.cmd?.code.toString(), + }); + } + + static AoiReaderError(msg: string, code: string) { + return new TranspilerError(`AoiReaderError: ${msg}`, { + code, + }); + } + function?: { name: string; code: string }; cmd?: string; path?: string; @@ -18,7 +50,7 @@ export class TranspilerError extends Error { ) { super(msg); this.name = 'TranspilerError'; - this.cause = this; + // this.cause = this; this.function = data?.function; this.cmd = data?.cmd; this.path = data?.path; @@ -26,7 +58,7 @@ export class TranspilerError extends Error { } toString() { - return `TranspilerError: ${this.message} { + return `[TranspilerError]|> ${this.message} { ${ this.function ? `function: { diff --git a/lib/aoi.js/src/core/index.ts b/lib/aoi.js/src/core/index.ts deleted file mode 100644 index 1dbf55190..000000000 --- a/lib/aoi.js/src/core/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -export * from './error.js'; -export * from './transpiler.js'; - -export * from './parsers/condition/main.js'; -import fixMath from './parsers/mathParser.js'; -export * from './parsers/stringParser.js'; -export * from './parsers/objectParser.js'; - -import Scope from './structs/Scope.js'; -import Block from './structs/Block.js'; -import Condition from './structs/Condition.js'; -import StringObject from './structs/StringObject.js'; -import { conditionLexer } from './parsers/condition/main.js'; -export * from './structs/JsonXYaml.js'; - -export * from './bundler.js'; - -export { Scope, Block, Condition, StringObject, conditionLexer, fixMath }; - diff --git a/lib/aoi.js/src/core/parsers/condition.ts b/lib/aoi.js/src/core/parsers/condition.ts new file mode 100644 index 000000000..e1aabe836 --- /dev/null +++ b/lib/aoi.js/src/core/parsers/condition.ts @@ -0,0 +1,62 @@ +import { TranspilerCustoms } from '@aoi.js/typings/enum.js'; +import Condition, { OPERATORS } from '../builders/Condition.js'; + +export function _countSmoothBrackets(condition: string) { + const start = condition.split('(').length - 1; + const end = condition.split(')').length - 1; + + return { + start, + end, + }; +} + +export function _areSmoothBracketsBalanced(condition: string) { + const { start, end } = _countSmoothBrackets(condition); + + return start === end; +} + +export function parseCondition(condition: string) { + if (condition.includes(TranspilerCustoms.FS)) { + const matches = condition.match( + /((#FUNCTION_START#([$a-z.0-9\s?(){}[\]._:'"`;=><,!-]|\n)+#FUNCTION_END#)|(__\$[a-z_?.()]+\$__))/gim, + ); + + if (matches) { + for (const match of matches) { + const updated = match + .replaceAll('(', TranspilerCustoms.SBL) + .replaceAll(')', TranspilerCustoms.SBR); + + condition = condition.replace(match, updated); + } + } + } + + let i = 0, + starter = new Condition(''); + + while (i < condition.length) { + const char = condition[i]; + + if (char === '(') { + const child = new Condition('', starter); + starter.add('#CONDITION#'); + starter.addChild(child); + starter = child; + } else if (char === ')') { + if (starter.parent) { + starter = starter.parent; + } else { + break; + } + } else { + starter.add(char); + } + + i++; + } + + return starter; +} diff --git a/lib/aoi.js/src/core/parsers/condition/main.ts b/lib/aoi.js/src/core/parsers/condition/main.ts deleted file mode 100644 index 802031c21..000000000 --- a/lib/aoi.js/src/core/parsers/condition/main.ts +++ /dev/null @@ -1,59 +0,0 @@ -import Condition from '../../structs/Condition.js'; -export const operators = ['===', '!==', '==', '!=', '>', '<', '>=', '<=']; - -export function countSBrackets(condition: string) { - const sBrackets = condition.match(/\(/g); - const eBrackets = condition.match(/\)/g); - return { - right: sBrackets ? sBrackets.length : 0, - left: eBrackets ? eBrackets.length : 0, - }; -} - -function areSBracketsBalanced(condition: string) { - const { left, right } = countSBrackets(condition); - return left === right; -} - -export function conditionLexer(condition: string) { - let tempCondition; - if (condition.includes('#FUNCTION_START#')) { - const matches = condition.match( - /((#FUNCTION_START#([$a-z.0-9\s?(){}[\]._:'"`;=><,!-]|\n)+#FUNCTION_END#)|(__\$[a-z_?.()]+\$__))/gim, - ); - if (matches) { - for (const match of matches) { - const newmatch = match - .replaceAll('(', '#SMOOTH_BRACKET_LEFT#') - .replaceAll(')', '#SMOOTH_BRACKET_RIGHT#'); - condition = condition.replace(match, newmatch); - } - - tempCondition = condition; - } - - tempCondition = condition; - } else { - tempCondition = condition; - } - - let i = 0; - let starter = new Condition(''); - while (i < tempCondition.length) { - if (tempCondition[i] === '(') { - const nest = new Condition('', starter); - starter.add('#CONDITION#'); - starter.nest.push(nest); - starter = nest; - } else if (tempCondition[i] === ')') { - if (starter.parent) starter = starter.parent; - else break; - } else { - starter.add(tempCondition[i]); - } - - i++; - } - - return starter; -} diff --git a/lib/aoi.js/src/core/parsers/math.ts b/lib/aoi.js/src/core/parsers/math.ts new file mode 100644 index 000000000..1d92f0102 --- /dev/null +++ b/lib/aoi.js/src/core/parsers/math.ts @@ -0,0 +1,22 @@ +import { TranspilerCustoms } from '@aoi.js/typings/enum.js'; + +const mathRegex = + /#MATH_FUNCTION_START#[#$._0-9a-\s*+-/%^&|?()]*#MATH_FUNCTION_END#/gi; + +export function fixMath(code: string) { + let res = code; + const matches = res.match(mathRegex); + + if (!matches) return res; + + for (const match of matches) { + res = res.replace( + match, + `\${ ${match + .replaceAll(TranspilerCustoms.MFS, '(') + .replaceAll(TranspilerCustoms.MFE, ')')} }`, + ); + } + + return res; +} diff --git a/lib/aoi.js/src/core/parsers/mathParser.ts b/lib/aoi.js/src/core/parsers/mathParser.ts deleted file mode 100644 index 85ba115e9..000000000 --- a/lib/aoi.js/src/core/parsers/mathParser.ts +++ /dev/null @@ -1,21 +0,0 @@ -const regex = - /#MATH_FUNCTION_START#[#$._0-9a-\s*+-/%^&|?()]*#MATH_FUNCTION_END#/gi; -export default function fixMath(code: string) { - let res = code; - const matches = code.match(regex); - matches; - if (!matches) return code; - matches.forEach((match) => { - res = res.replace( - match, - '${' + - match - .replaceAll('#MATH_FUNCTION_END#', '') - .replaceAll('#MATH_FUNCTION_START#', '') + - '}', - ); - }); - return res; -} - -// console.log( fixMath( "log(`#MATH_FUNCTION_START#(1+2*#MATH_FUNCTION_START#(1-3)#MATH_FUNCTION_END#)#MATH_FUNCTION_END# lol ok #MATH_FUNCTION_START#(2+#MATH_FUNCTION_START#(3/2)#MATH_FUNCTION_END#)#MATH_FUNCTION_END#`)" ) ); diff --git a/lib/aoi.js/src/core/parsers/object.ts b/lib/aoi.js/src/core/parsers/object.ts new file mode 100644 index 000000000..793bbcd6f --- /dev/null +++ b/lib/aoi.js/src/core/parsers/object.ts @@ -0,0 +1,104 @@ +import { parseData } from '@aoi.js/utils/Helpers/core.js'; +import StringObject from '../builders/StringObject.js'; +import { parseString } from './string.js'; +import { TranspilerCustoms } from '@aoi.js/typings/enum.js'; + +export const OBJECT_QUOTE_REGEX = /".*?"/g; + +export function _handleStringData(text: string, object: StringObject) { + if (text.startsWith('\'') || text.startsWith('"') || text.startsWith('`')) { + text = text.slice(1, text.length - 1); + text = parseString(text); + } else if (text.includes(TranspilerCustoms.FS)) { + if ( + text + .replaceAll(/#FUNCTION_START#(.+?)#FUNCTION_END#/g, '') + .trim() !== '' + ) { + text = parseString(text); + } + } else { + text = parseString(text); + } + + object.addValue(text); +} + +export function _getObjectAst( + objectString: string, + currentObject: StringObject, +) { + let i = 0, + text = '', + arrayEnded = false; + + while (i < objectString.length) { + const char = objectString[i]; + if (char === '{' || char === '[') { + const newObject = new StringObject(char, currentObject); + currentObject.addValue(`#StringObject_${newObject.name}#`); + currentObject = newObject; + } else if (char === '}' || char === ']') { + currentObject.addEnd(char); + + if (text.trim() !== '') { + const t = parseData(text.trim()); + if (typeof t === 'string') { + _handleStringData(t, currentObject); + text = ''; + } + } + + currentObject.parent?.pushChild(currentObject); + currentObject = currentObject.parent!; + } else if (char === ':') { + currentObject.addKey(text.trim()); + text = ''; + } else if (char === ',') { + if (arrayEnded) { + i++; + arrayEnded = false; + continue; + } + + if (currentObject.start === '[' || currentObject.start === '{') { + const t = parseData(text.trim()); + if (typeof t === 'string') { + _handleStringData(t, currentObject); + } + + text = ''; + } + } else { + text += char; + } + } + + while (currentObject.parent) { + currentObject = currentObject.parent; + } + + return currentObject; +} + +export function _escapeObjectSymbols(text: string) { + return text + .replaceAll(':', TranspilerCustoms.OSEP) + .replaceAll('{', TranspilerCustoms.OS) + .replaceAll('}', TranspilerCustoms.OE) + .replaceAll('[', TranspilerCustoms.AS) + .replaceAll(']', TranspilerCustoms.AE) + .replaceAll(',', TranspilerCustoms.ASEP); +} + +export function parseStringObject(text: string, stringObject: StringObject) { + const quotes = text.match(OBJECT_QUOTE_REGEX); + + if (quotes) { + for (const quote of quotes) { + text = text.replace(quote, _escapeObjectSymbols(quote)); + } + } + + return _getObjectAst(text.slice(1, text.length - 1), stringObject); +} diff --git a/lib/aoi.js/src/core/parsers/objectParser.ts b/lib/aoi.js/src/core/parsers/objectParser.ts deleted file mode 100644 index 6e92672b9..000000000 --- a/lib/aoi.js/src/core/parsers/objectParser.ts +++ /dev/null @@ -1,169 +0,0 @@ -import StringObject from '../structs/StringObject.js'; -import { parseString } from './stringParser.js'; -import { parseData } from '../../util/transpilerHelpers.js'; - -export const ObjectQuoteRegex = /".*?"/g; - -export function getObjectData(stringObject: string, currentObj: StringObject) { - let i = 0, - text = ''; - let arrayEnded = false; - while (i < stringObject.length) { - const char = stringObject[i]; - if (char === '{' || char === '[') { - const newObj = new StringObject(char, currentObj); - currentObj.addValue(`#StringObject_${newObj.name}#`); - currentObj = newObj; - } else if (char === '}' || char === ']') { - if (char === ']') arrayEnded = true; - currentObj.addEnd(char); - if (text.trim() !== '') { - let t = parseData(text.trim()); - if (typeof t === 'string') { - if ( - t.trim().startsWith('\'') || - t.trim().startsWith('"') || - t.trim().startsWith('`') - ) { - t = t.trim().slice(1, t.trim().length - 1); - t = parseString(t); - } else if (t.includes('#FUNCTION_START#')) { - if ( - t - .replaceAll( - /#FUNCTION_START#(.+?)#FUNCTION_END#/g, - '', - ) - .trim() !== '' - ) { - t = parseString(t); - } - } else t = parseString(t); - } - - currentObj.addValue(t); - text = ''; - } - - currentObj.parent?.pushChild(currentObj); - currentObj = currentObj.parent!; - } else if (char === ':') { - currentObj.addKey(text.trim()); - text = ''; - } else if (char === ',') { - if (arrayEnded) { - i++; - arrayEnded = false; - continue; - } - - if (currentObj.start === '[') { - let t = parseData(text.trim()); - if (typeof t === 'string') { - if ( - t.trim().startsWith('\'') || - t.trim().startsWith('"') || - t.trim().startsWith('`') - ) { - t = t.trim().slice(1, t.trim().length - 1); - t = parseString(t); - } else if (t.includes('#FUNCTION_START#')) { - if ( - t - .replaceAll( - /#FUNCTION_START#(.+?)#FUNCTION_END#/g, - '', - ) - .trim() !== '' - ) { - t = parseString(t); - } - } else t = parseString(t); - } - - currentObj.addValue(t); - } else { - let t = parseData(text.trim()); - if (typeof t === 'string') { - if ( - t.trim().startsWith('\'') || - t.trim().startsWith('"') || - t.trim().startsWith('`') - ) { - t = t.trim().slice(1, t.trim().length - 1); - t = parseString(t); - } else if (t.includes('#FUNCTION_START#')) { - if ( - t - .replaceAll( - /#FUNCTION_START#(.+?)#FUNCTION_END#/g, - '', - ) - .trim() !== '' - ) { - t = parseString(t); - } - } else t = parseString(t); - } - - currentObj.addValue(t); - } - - text = ''; - } else { - text += char; - } - - i++; - } - - if (text.trim() !== '') { - let t = parseData(text.trim()); - if (typeof t === 'string') { - if ( - t.trim().startsWith('\'') || - t.trim().startsWith('"') || - t.trim().startsWith('`') - ) { - t = t.trim().slice(1, t.trim().length - 1); - t = parseString(t); - } else if (t.includes('#FUNCTION_START#')) { - if ( - t - .replaceAll(/#FUNCTION_START#(.+?)#FUNCTION_END#/g, '') - .trim() !== '' - ) { - t = parseString(t); - } - } else t = parseString(t); - } - - currentObj.addValue(t); - } - - return currentObj; -} - -export function parseStringObject( - stringObject: string, - currentObj: StringObject, -) { - const quotes = stringObject.match(ObjectQuoteRegex); - if (quotes) { - quotes.forEach((x) => { - const newx = x - .replaceAll(':', '#OBJECT_SEPARATOR#') - .replaceAll('{', '#OBJECT_STARTER#') - .replaceAll('}', '#OBJECT_ENDER#') - .replaceAll('[', '#ARRAY_STARTER#') - .replaceAll(']', '#ARRAY_ENDER#') - .replaceAll(',', '#ARRAY_SEPARATOR#'); - stringObject = stringObject.replace(x, newx); - }); - } - - return getObjectData( - stringObject.slice(1, stringObject.length - 1), - currentObj, - ); -} \ No newline at end of file diff --git a/lib/aoi.js/src/core/parsers/string.ts b/lib/aoi.js/src/core/parsers/string.ts new file mode 100644 index 000000000..66fefa021 --- /dev/null +++ b/lib/aoi.js/src/core/parsers/string.ts @@ -0,0 +1,66 @@ +import { BundlerCustoms, TranspilerCustoms } from '@aoi.js/typings/enum.js'; +import TextBlock from '../builders/TextBlock.js'; + +export function createStringAST(text: string) { + let block = new TextBlock(0, true); + let i = 0; + let res = ''; + + while (i < text.length) { + if (res.includes(TranspilerCustoms.FS)) { + const child = new TextBlock(block.children.length, false, block); + + block.text = block.text.replace(TranspilerCustoms.FS, ''); + block.addText(child.parsed); + block.addChild(child); + + block = child; + block.addText(text[i]); + + res = text[i] ?? ''; + } else if (res.includes(TranspilerCustoms.FE)) { + block.text = block.text.replace(TranspilerCustoms.FE, ''); + + block = block.parent ?? block; + block.addText(text[i] ?? ''); + + res = text[i] ?? ''; + } else if (res.includes(TranspilerCustoms.MFS)) { + const child = new TextBlock(block.children.length, false, block); + + block.text = block.text.replace(TranspilerCustoms.MFS, ''); + block.addText(child.parsed); + block.addChild(child); + + block = child; + block.addText(text[i]); + + res = text[i] ?? ''; + } else if (res.includes(TranspilerCustoms.MFE)) { + block.text = block.text.replace(TranspilerCustoms.MFE, ''); + + block = block.parent ?? block; + block.addText(text[i] ?? ''); + + res = text[i] ?? ''; + } else { + res += text[i] ?? ''; + block.addText(text[i] ?? ''); + } + + i++; + } + + while (block.parent) { + block = block.parent; + } + + return block; +} + +export function parseString(text: string) { + const ast = createStringAST(text); + return ast + .parse() + .replaceAll(BundlerCustoms.EJS, `\${${BundlerCustoms.EJS}`); +} diff --git a/lib/aoi.js/src/core/parsers/stringParser.ts b/lib/aoi.js/src/core/parsers/stringParser.ts deleted file mode 100644 index 8432ae6f5..000000000 --- a/lib/aoi.js/src/core/parsers/stringParser.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { BundlerCustoms, TranspilerCustoms } from '../../typings/enums.js'; -import Block from '../structs/Block.js'; - -export function createStringAST(text: string) { - let block = new Block(-1, true); - let i = 0; - let res = ''; - // const stack: number[] = []; - // while (i <= text.length) { - // if (res.includes("#FUNCTION_START#")) { - // stack.push(i - 15); - // res = text[i]; - // } else if (res.includes("#FUNCTION_END#")) { - // const a = stack.pop(); - // if (!a) { - // stack.push(i - 13); - // } - // res = text[i]; - // } else if(res.includes(TranspilerCustoms.MFS)) { - // stack.push(i - TranspilerCustoms.MFS.length-1); - // res = text[i]; - // } else if(res.includes(TranspilerCustoms.MFE)) { - // const a = stack.pop(); - // if (!a) { - // stack.push(i - TranspilerCustoms.MFE.length-1); - // } - // res = text[i]; - // } - // else { - // res += text[i]; - // } - // i++; - // } - // if (stack.length) { - // stack; - // stack.forEach((x) => { - // text = text.substring(0, x - 1) + text.slice(x + 15, text.length); - // }); - // } - i = 0; - res = ''; - while (i <= text.length) { - if (res.includes('#FUNCTION_START#')) { - const nest = new Block(block.nest.length, false, block); - block.text = block.text.replace('#FUNCTION_START#', ''); - block.add(`#NEST_POSITION_${block.nest.length}#`); - block.addBlock(nest); - block = nest; - block.add(text[i]); - res = text[i] ?? ''; - } else if (res.includes('#FUNCTION_END#')) { - block.text = block.text.replace('#FUNCTION_END#', ''); - block = block.parent ? block.parent : block; - block.add(text[i] ?? ''); - res = text[i] ?? ''; - } else if (res.includes(TranspilerCustoms.MFS)) { - const nest = new Block(block.nest.length, false, block); - block.text = block.text.replace(TranspilerCustoms.MFS, ''); - block.add(`#NEST_POSITION_${block.nest.length}#`); - block.addBlock(nest); - block = nest; - block.add(text[i]); - res = text[i] ?? ''; - } else if (res.includes(TranspilerCustoms.MFE)) { - block.text = block.text.replace(TranspilerCustoms.MFE, ''); - block = block.parent ? block.parent : block; - block.add(text[i] ?? ''); - res = text[i] ?? ''; - } else { - res += text[i]; - block.add(text[i] ?? ''); - } - - i++; - } - - return block; -} - -export function parseString(text: string) { - const ast = createStringAST(text); - return ast.parse().replaceAll(BundlerCustoms.EJS, `\${${BundlerCustoms.EJS}}`); -} - -//console.log(parseString("#FUNCTION_START#__$DISCORD_DATA__#FUNCTION_END#")) diff --git a/lib/aoi.js/src/core/structs/Block.ts b/lib/aoi.js/src/core/structs/Block.ts deleted file mode 100644 index aa8cadf4b..000000000 --- a/lib/aoi.js/src/core/structs/Block.ts +++ /dev/null @@ -1,39 +0,0 @@ -export default class Block { - position: number; - isMain: boolean; - parent?: Block; - nest: Block[]; - text: string; - constructor(position: number, isMain: boolean, parent?: Block) { - this.position = position; - this.isMain = isMain; - this.parent = parent; - this.nest = []; - this.text = ''; - } - - add(text: string) { - this.text += text; - } - - addBlock(block: Block) { - this.nest.push(block); - } - - parse() { - if (this.nest.length) { - for (const block of this.nest) { - const res = block.parse(); - this.text = this.text.replace(block.parsed, res); - } - - return this.isMain ? `\`${this.text}\`` : `\${${this.text}}`; - } else { - return this.isMain ? `\`${this.text}\`` : `\${${this.text}}`; - } - } - - get parsed() { - return `#NEST_POSITION_${this.position}#`; - } -} diff --git a/lib/aoi.js/src/core/structs/Condition.ts b/lib/aoi.js/src/core/structs/Condition.ts deleted file mode 100644 index e21cbc944..000000000 --- a/lib/aoi.js/src/core/structs/Condition.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { inspect } from 'util'; -import { parseData } from '../../util/transpilerHelpers.js'; -import { parseString } from '../parsers/stringParser.js'; -import { BundlerCustoms } from '../../typings/enums.js'; -const operators = ['===', '!==', '==', '!=', '>', '<', '>=', '<=']; - -export default class Condition { - condition: string; - nest: Condition[]; - parent: Condition | undefined; - constructor(condition: string, parent?: Condition) { - this.condition = condition; - this.nest = []; - this.parent = parent ?? null; - } - - solve() { - if (this.nest.length) { - return this._solve(this.condition); - } else return this.solveAnd(this.condition); - } - - solveAnd(condition: string) { - const conditions = condition.split('&&'); - const res = []; - for (const c of conditions) { - if (condition.includes('||')) { - res.push(this.solveOr(c)); - } else { - res.push(this._solve(c)); - } - } - - return res.join('&&'); - } - - solveOr(condition: string) { - const conditions = condition.split('||'); - const res = []; - for (const c of conditions) { - res.push(this._solve(c)); - } - - return res.join('||'); - } - - _solve(condition: string): string { - condition = condition - .replaceAll('#SMOOTH_BRACKET_LEFT#', '(') - .replaceAll('#SMOOTH_BRACKET_RIGHT#', ')'); - if (this.nest.length) { - for (const c of this.nest) { - const solvedData = c.solve(); - condition = condition.replace('#CONDITION#', `(${solvedData})`); - } - - return condition; - } else { - const op = operators.find((o) => condition.includes(o)); - let res; - if (op) { - const [left, right] = condition.split(op); - let leftData, rightData; - if (left.trim().split(' ').length === 1) { - leftData = parseData(left.trim()); - if (typeof leftData === 'object') { - try { - leftData = JSON.stringify(leftData); - } catch { - leftData = inspect(leftData); - } - } else if (typeof leftData === 'string') { - if ( - !((leftData.startsWith('#FUNCTION_START#') && - leftData.endsWith('#FUNCTION_END#')) || - leftData.startsWith('__$DISCORD_DATA$__') || leftData.trim() === BundlerCustoms.EJS ) - ) { - leftData = parseString(leftData); - if ( - typeof parseData( - leftData.substring(1, leftData.length - 1), - ) !== 'string' - ) { - leftData = parseData( - leftData.substring(1, leftData.length - 1), - ); - } - } - } else if ( typeof leftData === 'bigint' ) { - leftData = leftData.toString() + 'n'; - } - } else { - leftData = parseString(left.trim()); - } - - if (right.trim().split(' ').length === 1) { - rightData = parseData(right.trim()); - if (typeof rightData === 'object') { - try { - rightData = JSON.stringify(rightData); - } catch { - rightData = inspect(rightData); - } - } else if (typeof rightData === 'string') { - if ( - !((rightData.startsWith('#FUNCTION_START#') && - rightData.endsWith('#FUNCTION_END#')) || - (rightData.startsWith('__$') && - rightData.includes('$__')) || - rightData.startsWith('__$DISCORD_DATA$__') || rightData.trim() === BundlerCustoms.EJS) - ) { - rightData = parseString(rightData); - if ( - typeof parseData( - rightData.substring( - 1, - rightData.length - 1, - ), - ) !== 'string' - ) { - rightData = parseData( - rightData.substring( - 1, - rightData.length - 1, - ), - ); - } - } - } else if (typeof rightData === 'bigint') { - rightData = rightData.toString() + 'n'; - } - - res = `${leftData}${op}${rightData}`; - } else { - rightData = parseString(right.trim()); - res = `${leftData}${op}${rightData}`; - } - } else { - res = parseData(condition); - if ( - typeof res === 'string' && - (!res.endsWith('#FUNCTION_END#') || - res.trim().split(' ').length > 1) && - !res.startsWith('#FUNCTION_START#') && res.trim() !== BundlerCustoms.EJS - ) { - res = parseString(res); - } - } - - return res; - } - } - - add(part: string) { - this.condition += part; - } -} diff --git a/lib/aoi.js/src/core/structs/JsonXYaml.ts b/lib/aoi.js/src/core/structs/JsonXYaml.ts deleted file mode 100644 index 8e9bd2241..000000000 --- a/lib/aoi.js/src/core/structs/JsonXYaml.ts +++ /dev/null @@ -1,73 +0,0 @@ -export class JsonXYaml { - obj: Record = {}; - isInString = false; - isObject = false; - hasPotential = false; - stringLiteralStarted = false; - - constructor(ob: string) { - ob = ob.trim(); - let temp = ''; - let currentKey = ''; - for (const char of ob) { - if (char === ':' && !this.isInString && !this.isObject) { - const key = temp.trim(); - currentKey = key; - temp = ''; - } else if ( - char === '\n' && - !this.isInString && - !this.isObject && - temp.trim() !== '' - ) { - const value = temp.trim(); - this.obj[currentKey] = value; - temp = ''; - currentKey = ''; - } else if (char === '@' && !this.isInString) { - this.hasPotential = true; - } else if (char === '{' && this.hasPotential && !this.isInString) { - this.isInString = true; - this.stringLiteralStarted = true; - } else if (char === '}' && this.isInString && this.hasPotential) { - this.isInString = false; - this.obj[currentKey] = `${temp.trim()}`; - temp = ''; - this.stringLiteralStarted = false; - this.hasPotential = false; - } else if (char === '{' && !this.isInString && !this.hasPotential) { - this.isObject = true; - temp += char; - } else if ( - char === '}' && - !this.isInString && - !this.hasPotential && - this.isObject - ) { - this.isObject = false; - temp += char; - this.obj[currentKey] = new JsonXYaml( - temp - .trim() - .slice(1, temp.length - 1) - .trim(), - ).toObject(); - temp = ''; - currentKey = ''; - } else { - temp += char; - if ( - this.hasPotential && - char !== '{' && - !this.stringLiteralStarted - ) { - this.hasPotential = false; - } - } - } - } - - toObject() { - return this.obj; - } -} \ No newline at end of file diff --git a/lib/aoi.js/src/core/structs/Scope.ts b/lib/aoi.js/src/core/structs/Scope.ts deleted file mode 100644 index 7a3253090..000000000 --- a/lib/aoi.js/src/core/structs/Scope.ts +++ /dev/null @@ -1,346 +0,0 @@ -import { type AoiClient } from '../../index.js'; -import { BundlerCustoms, TranspilerCustoms } from '../../typings/enums.js'; -import { type funcData } from '../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - parseResult, - removeMultiLineComments, - removeSetFunc, -} from '../../util/transpilerHelpers.js'; -import fixMath from '../parsers/mathParser.js'; -import { parseString } from '../parsers/stringParser.js'; -import type StringObject from './StringObject.js'; - -export default class Scope { - name: string; - parent: string | undefined; - children: Scope[] = []; - sendData: { - content: string; - }; - - embeds: unknown[] = []; - components: unknown[] = []; - files: unknown[] = []; - stickers: unknown[] = []; - env: string[]; - ephemeral = false; - variables: string[]; - setters: string; - objects: Record; - rest: string; - hasSendData: boolean; - sendFunction: string; - functions: string; - _funcList: string[] = []; - addReturn: boolean; - useChannel?: bigint | string; - embededJS: string[] = []; - packages = ''; - client: AoiClient; - constructor( - name: string, - client: AoiClient, - parent?: string, - code?: string, - addReturn?: boolean, - ) { - this.name = name; - this.sendFunction = 'await __$DISCORD_DATA$__.client.createMessage'; - this.parent = parent; - this.hasSendData = false; - this.sendData = { - content: code?.replaceAll('`', TranspilerCustoms.SL) || ' ', - }; - this.variables = []; - this.objects = {}; - this.env = []; - this.setters = ''; - this.functions = ''; - this.rest = code?.replaceAll('`', TranspilerCustoms.SL) || ''; - this.addReturn = addReturn ?? false; - this.client = client; - } - - addVariables(scopeVars: string[]) { - this.variables.push(...scopeVars); - } - - addEmbeds(embeds: unknown[]) { - this.embeds.push(...embeds); - } - - addFunction(func: string) { - this.functions += func + ' \n'; - } - - replaceLast(str: string, replacer: string, replacedTo: string) { - const index = str.lastIndexOf(replacer); - if (index === -1) return str; - return ( - str.substring(0, index) + - replacedTo + - str.substring(index + replacer.length) - ); - } - - replace(str: string, replacer: string, replacedTo: string) { - const index = str.indexOf(replacer); - if (index === -1) return str; - return ( - str.substring(0, index) + - replacedTo + - str.substring(index + replacer.length) - ); - } - - addChild(child: string) { - this.children.push(new Scope(child, this.client, this.name)); - } - - getChild(name: string) { - return this.children.find((child) => child.name === name); - } - - removeChild(name: string) { - this.children = this.children.filter((child) => child.name !== name); - } - - updateEmbedJs() { - const embeds = [...this.embededJS.reverse()]; - for (const embed of embeds) { - const old = this.rest; - this.rest = this.replaceLast(this.rest, BundlerCustoms.EJS, embed); - if (this.rest === old) { - this.packages = this.embededJS.shift() + '\n' + this.packages; - } else { - this.embededJS.shift(); - } - } - } - - toString(sendMessage = true) { - const sendData: Record = { ...this.sendData }; - sendData.embeds = escapeResult(escapeVars(`${this.name}_embeds`)); - sendData.components = escapeResult( - escapeVars(`${this.name}_components`), - ); - sendData.files = escapeResult(escapeVars(`${this.name}_files`)); - sendData.stickers = escapeResult(escapeVars(`${this.name}_stickers`)); - sendData.content = sendData.content - .replaceAll('\n', TranspilerCustoms.NL) - .replaceAll(BundlerCustoms.EJS, ''); - if ( - sendData.content.replaceAll(TranspilerCustoms.NL, '').trim() !== - '' || - this.embeds.length || - this.files.length || - this.stickers.length - ) - this.hasSendData = true; - else this.hasSendData = false; - - let parsedStr = parseString( - sendData.content.replaceAll(TranspilerCustoms.NL, '\n').trim(), - ); - parsedStr = - parsedStr.trim().replaceAll(TranspilerCustoms.SL, '\\`') === '' - ? ' ' - : parsedStr.trim().replaceAll(TranspilerCustoms.SL, '\\`'); - - if (sendData.content.trim() !== '') { - this.rest = this.replaceLast( - parseResult(removeMultiLineComments(this.rest.trim())), - sendData.content.replaceAll(TranspilerCustoms.NL, '\n').trim(), - '', - ); - } - - parsedStr = parsedStr.replaceAll('\\n', TranspilerCustoms.NL); - - const sent = `{ - content: ${fixMath(parsedStr.trim() === '``' ? '` `' : parsedStr)}, - embeds: ${escapeVars(`${this.name}_embeds`)}, - components: ${escapeVars(`${this.name}_components`)}, - files: ${escapeVars(`${this.name}_files`)}, - stickers: ${escapeVars(`${this.name}_stickers`)}, - flags: ${this.ephemeral ? 64 : 0}, - }`.replaceAll(TranspilerCustoms.NL, '\\\\n'); - - return parseResult( - `const ${escapeVars(`${this.name}_embeds`)} = [];\n` + - `const ${escapeVars(`${this.name}_components`)} = [];\n` + - `const ${escapeVars(`${this.name}_files`)} = [];\n` + - `const ${escapeVars(`${this.name}_stickers`)} = [];\n` + - `${this.packages}` + - `${this.setters}\n\n${ - this.functions - }\n\n${this.rest.trim()}\n\n`.trim() + - `\n${(() => { - if (this.hasSendData && sendMessage) { - return `${this.addReturn ? 'return ' : ''} await ${ - this.useChannel - ? this.sendFunction + - `(${parseString( - typeof this.useChannel === 'bigint' - ? this.useChannel.toString() + 'n' - : this.useChannel.toString(), - )},${sent});` - : this.sendFunction + - `(__$DISCORD_DATA$__.message.channelId,${sent});` - }`; - } else { - return ''; - } - })()}`, - ).replaceAll(TranspilerCustoms.SL, '\\`'); - } - - getFunction(sendMessage = true, execute = false) { - const name = this.name === 'global' ? 'main' : this.name; - return ( - `async function ${name}(__$DISCORD_DATA$__) {\n${this.toString( - sendMessage, - )}\n}` + - (execute - ? `\n${ - this.addReturn ? 'return ' : '' - }${name}(__$DISCORD_DATA$__);` - : '') - ).replaceAll(TranspilerCustoms.SL, '`'); - } - - editMessage(channel: string, message: string) { - const sendData: Record = { ...this.sendData }; - sendData.embeds = escapeResult(escapeVars(`${this.name}_embeds`)); - sendData.components = escapeResult( - escapeVars(`${this.name}_components`), - ); - sendData.files = escapeResult(escapeVars(`${this.name}_files`)); - sendData.content = sendData.content.replaceAll( - '\n', - TranspilerCustoms.NL, - ); - if ( - sendData.content.replaceAll(TranspilerCustoms.NL, '').trim() !== - '' || - this.embeds.length || - this.files.length || - this.stickers.length - ) - this.hasSendData = true; - else this.hasSendData = false; - - let parsedStr = parseString( - sendData.content.replaceAll(TranspilerCustoms.NL, '\n').trim(), - ); - parsedStr = parsedStr.trim() === '' ? ' ' : parsedStr.trim(); - - this.rest = this.replaceLast( - this.rest.trim(), - this.sendData.content.trim(), - '', - ); - - const sent = `{ - content: ${parsedStr.replaceAll('\\n', TranspilerCustoms.NL)}, - embeds: ${escapeVars(`${this.name}_embeds`)}, - components: ${escapeVars(`${this.name}_components`)}, - files: ${escapeVars(`${this.name}_files`)}, - stickers: ${escapeVars(`${this.name}_stickers`)}, - }`.replaceAll(TranspilerCustoms.NL, '\\\\n'); - - return parseResult( - `async function ${ - this.name === 'global' ? 'main' : this.name - }(__$DISCORD_DATA$__) {\n` + - `const ${escapeVars(`${this.name}_embeds`)} = [];\n` + - `const ${escapeVars(`${this.name}_components`)} = [];\n` + - `const ${escapeVars(`${this.name}_files`)} = [];\n` + - `const ${escapeVars(`${this.name}_stickers`)} = [];\n` + - `${this.packages}` + - `${this.setters}\n\n${ - this.functions - }\n\n${this.rest.trim()}\n\n`.trim() + - `\n${(() => { - if (this.hasSendData) { - return `${ - this.addReturn ? 'return ' : '' - } await ${`__$DISCORD_DATA$__.client.editMessage(${parseString( - channel, - )},${parseString(message)},${sent}).catch(e => { - throw e; - });`}`; - } else { - return ''; - } - })()}` + - '\n}', - ).replaceAll(TranspilerCustoms.SL, '\\`'); - } - - update(res: string, data: funcData) { - if (data.type === 'function') { - this.rest = this.rest.replace( - data.total.replaceAll(TranspilerCustoms.FSEP, ';'), - res.replaceAll('$', '$$$$'), - ); - } else if (data.type === 'setter') { - this.setters += res + '\n'; - - this.rest = this.rest.replace( - removeSetFunc(data.total).replaceAll( - TranspilerCustoms.FSEP, - ';', - ), - '', - ); - } else if (data.type === 'function_getter') { - this.rest = this.rest.replace( - data.total.replaceAll(TranspilerCustoms.FSEP, ';'), - res.replaceAll('$', '$$$$'), - ); - } else if (data.type === 'getter') { - this.rest = this.rest.replace( - data.total.replaceAll(TranspilerCustoms.FSEP, ';'), - res.replaceAll('$', '$$$$'), - ); - // this.rest = this.replaceLast(this.rest, data.total.replaceAll(TranspilerCustoms.FSEP, ";"),res.replaceAll("$", "$$$$")); - } else if (data.type === 'scope' || data.type === 'scope_getter') { - this.rest = this.rest.replace( - data.total.replaceAll(TranspilerCustoms.FSEP, ';'), - res.replaceAll('$', '$$$$'), - ); - data.funcs = []; - } - } - - rawString() { - const sendData: Record = { ...this.sendData }; - sendData.embeds = escapeResult(escapeVars(`${this.name}_embeds`)); - sendData.components = escapeResult( - escapeVars(`${this.name}_components`), - ); - sendData.files = escapeResult(escapeVars(`${this.name}_files`)); - sendData.stickers = escapeResult(escapeVars(`${this.name}_stickers`)); - sendData.content = sendData.content.replaceAll( - '\n', - TranspilerCustoms.NL, - ); - if ( - sendData.content.replaceAll(TranspilerCustoms.NL, '').trim() !== - '' || - this.embeds.length || - this.files.length || - this.stickers.length - ) - this.hasSendData = true; - else this.hasSendData = false; - - return parseResult(`\n\n${this.rest.trim()}\n\n`.trim()).replaceAll( - TranspilerCustoms.SL, - '\\`', - ); - } -} diff --git a/lib/aoi.js/src/core/transpiler.ts b/lib/aoi.js/src/core/transpiler.ts index d089733fd..8890697a8 100644 --- a/lib/aoi.js/src/core/transpiler.ts +++ b/lib/aoi.js/src/core/transpiler.ts @@ -1,122 +1,412 @@ -import funcs from '../functions/index.js'; -import { type TranspilerOptions } from '../typings/interfaces.js'; -import { type MinifyOutput, minify } from 'uglify-js'; import { - getFunctionList, - parseResult, - getFunctionData, - executeData, -} from '../util/transpilerHelpers.js'; -import { TranspilerError } from './error.js'; - -import fixMath from './parsers/mathParser.js'; -import Scope from './structs/Scope.js'; -import { type AsyncFunction } from '../typings/types.js'; - -function generateGlobalScope( - scopeData: TranspilerOptions['scopeData'], - client: TranspilerOptions['client'], -): Scope { - const globalScope = new Scope( - scopeData?.name ?? 'global', - client, - undefined, - ); - globalScope.addVariables(scopeData?.variables ?? []); - globalScope.addEmbeds(scopeData?.embeds ?? []); - globalScope.env.push(...(scopeData?.env ?? [])); - globalScope.objects = { ...globalScope.objects, ...scopeData?.objects }; - globalScope.embededJS = scopeData?.embedJs ?? []; - globalScope.sendFunction = - scopeData?.sendFunction ?? globalScope.sendFunction; - globalScope.useChannel = scopeData?.useChannel; - return globalScope; -} + type ITranspilerOptions, + type IFunctionData, + type IScopeData, + type ICodeFunctionData, + type ITranspileOptions, +} from '@aoi.js/typings/interface.js'; +import Scope from './builders/Scope.js'; +import type AoiClient from '@aoi.js/classes/AoiClient.js'; +import type Command from '@aoi.js/classes/Command.js'; +import { + FunctionType, + ReturnType, + TranspilerCustoms, +} from '@aoi.js/typings/enum.js'; +import { TranspilerError } from './Error.js'; +import * as allFunctions from '@aoi.js/functions/index.js'; +import { parseResult } from '@aoi.js/utils/Helpers/core.js'; -export function transpiler( - code: string, - options: TranspilerOptions, -): { func: AsyncFunction; code: string; scope: Scope[] } { - const { scopeData, sendMessage, minify: uglify, customFunctions } = options; - const functions = { ...funcs, ...customFunctions }; - const functionNames = Object.keys(functions); - const flist = getFunctionList(code, functionNames); - - flist.forEach((x) => { - const reg = new RegExp(`${x.replace('$', '\\$')}`, 'gi'); - code = parseResult(code); - code = code.replace(reg, x); - }); - - const tempcode = `$EXECUTEMAINCODEFUNCTION[ - ${code} - ]`; - const fData = getFunctionData(tempcode, '$EXECUTEMAINCODEFUNCTION', flist); - const globalScope = generateGlobalScope(scopeData, options.client); - const res = executeData( - parseResult(code), - fData.funcs, - [globalScope], - options.reverse ?? false, - ); - - if (res.scope[0].sendData.content.trim() !== '') { - const scope = res.scope[0]; - scope.hasSendData = true; - // scope.rest = scope.rest.replace(scope.sendData.content.trim(), ""); - scope.rest = scope.replaceLast( - scope.rest, - scope.sendData.content.trim(), - '', - ); - res.scope[0] = scope; +import { type MinifyOutput, minify } from 'uglify-js'; +import { type AsyncFunction } from '@aoi.js/typings/type.js'; +import { fixMath } from './parsers/math.js'; + +export default class Transpiler { + static instance: Transpiler | undefined = undefined; + + minify!: boolean; + functions!: Record; + client!: AoiClient; + functionFinderRegex = /(\$[a-z]+)/gi; + mainFunction = '$AOIJSMAINFUNCTION'; + + constructor(options: ITranspilerOptions, client: AoiClient) { + if (Transpiler.instance) return Transpiler.instance; + + this.minify = options.minify ?? true; + this.functions = { ...allFunctions, ...options.customFunctions }; + this.client = client; + Transpiler.instance = this; } - res.scope[0].updateEmbedJs(); + _createGlobalScope(ast: ICodeFunctionData, scopeData: Partial) { + const scope = new Scope( + scopeData.name ?? 'global', + this.client, + undefined, + ast, + ); - let str = res.scope[0].getFunction(sendMessage); - str = fixMath(str); + scope.addVariables(...(scopeData.vars ?? [])); + scope.addEmbeds(scopeData.embeds ?? []); + scope.env.push(...(scopeData.env ?? [])); + scope.objects = { ...(scope.objects ?? {}), ...scopeData.object }; + scope.embeddedJS = scopeData.embeddedJS ?? []; + scope.sendFunction = scopeData.sendFunction ?? scope.sendFunction; + scope.useChannel = scopeData?.useChannel; - const functionString = uglify ? minify(str) : str; + return scope; + } - if (uglify && (functionString as MinifyOutput).error) { - throw new TranspilerError( - ` - Failed To Transpile Code with error ${ - (functionString as MinifyOutput).error?.message -}`, - { - code: str, - cmd: options.command?.name, - path: options.command?.__path__, - }, + _getFunctionList(code: string, functions: string[]) { + const raws = code.match(this.functionFinderRegex); + if (!raws) return []; + const functionsThatExists = functions.filter((x) => + code.toLowerCase().includes(x.toLowerCase()), ); + + const res = []; + + for (const raw of raws) { + const func = functionsThatExists.filter( + (x) => x.toLowerCase() === raw.toLowerCase().slice(0, x.length), + ); + if (func.length === 1) res.push(func[0]); + else if (func.length > 1) { + res.push(func.sort((a, b) => b.length - a.length)[0]); + } else { + continue; + } + } + + return res; } - let func; + _getFunctionData( + code: string, + func: string, + functions: string[], + command?: Command, + ): ICodeFunctionData { + let funcD: IFunctionData = this.functions[func]; - if (options.parsedStringOnly) - return { - code: uglify - ? (functionString as MinifyOutput).code - : (functionString as string), - func: async () => { - return undefined; - }, - scope: res.scope, + let codeFuncData: ICodeFunctionData = { + ...funcD, + total: code, + inside: undefined, + splits: () => [], + funcs: [], + parsed: '', + executed: '', + cmd: command, }; - try { - const strr = uglify - ? (functionString as MinifyOutput).code - : (functionString as string); - func = eval(`const f = ${strr}; f`) as AsyncFunction; - } catch (e) { - throw new TranspilerError(e as string, { - code: str, - cmd: options.command?.name, - path: options.command?.__path__, + + if (func === this.mainFunction) { + funcD = { + name: this.mainFunction, + brackets: true, + optional: false, + returns: ReturnType.Void, + code: (data, scope) => { + return { + code: data.executed, + scope: scope, + }; + }, + type: FunctionType.Scope, + fields: [ + { + name: 'code', + type: ReturnType.String, + required: true, + }, + ], + }; + + codeFuncData = { + ...funcD, + total: code, + inside: undefined, + splits: () => [], + funcs: [], + parsed: '', + executed: '', + cmd: command, + }; + } + + const regex = new RegExp(`${func.replace('$', '\\$')}`, 'i'); + code = code.replace(regex, func); + code = code.replaceAll('`', TranspilerCustoms.SL); + + const functionPosition = code.indexOf(func); + code = code.slice(functionPosition, code.length); + + let leftCount = 0, + rightCount = 0, + i = 0; + + let rawTotal = ''; + + while (i < code.length) { + if (!funcD.brackets) break; + + if (!funcD.optional && code[func.length] !== '[') { + throw new TranspilerError('Function requires brackets', { + function: { + name: func, + code: func, + }, + cmd: command?.name, + path: command?.__path__, + }); + } + + if (rightCount === leftCount && rightCount !== 0) break; + + if (code[func.length] !== '[') break; + + if (code[i] === '[') leftCount++; + else if (code[i] === ']') rightCount++; + + rawTotal += code[i]; + i++; + } + + if (rawTotal === '') rawTotal = func; + + if ( + !this._areBracketsBalanced(rawTotal) && + func !== this.mainFunction + ) { + throw new TranspilerError('Brackets are not balanced', { + function: { + name: func, + code: rawTotal, + }, + cmd: command?.name, + path: command?.__path__, + }); + } + + const funcs = []; + let inside = + rawTotal.endsWith(']') && rawTotal.startsWith(`${func}[`) + ? rawTotal.slice(func.length + 1, rawTotal.length - 1) + : undefined; + + const list = this._getFunctionList(inside ?? '', functions); + functions.splice(0, list.length); + + let newinside = inside ?? ''; + let idx = 0; + while (list.length) { + const func = list.shift()!; + + const funcData = this._getFunctionData( + newinside, + func, + list, + command, + ); + + inside = inside?.replace( + funcData.inside?.replaceAll(TranspilerCustoms.FSEP, ';') ?? '', + funcData.parsed!, + ); + + newinside = newinside.replace( + funcData.total, + `#FUNCTION_${idx++}#`, + ); + + funcData.parent = codeFuncData; + + funcs.push(funcData); + } + + const parsed = inside?.replaceAll(';', TranspilerCustoms.FSEP) ?? ''; + const executed = newinside.replaceAll(TranspilerCustoms.FSEP, ';'); + codeFuncData.total = rawTotal; + codeFuncData.inside = inside; + codeFuncData.splits = () => codeFuncData.executed.split(';'); + codeFuncData.parsed = parsed; + codeFuncData.executed = executed; + codeFuncData.funcs = funcs; + + return codeFuncData; + } + + _areBracketsBalanced(code: string) { + const leftBracketRegex = /\[/g; + const rightBracketRegex = /\]/g; + + const leftBrackets = code.match(leftBracketRegex) ?? []; + const rightBrackets = code.match(rightBracketRegex) ?? []; + + return leftBrackets.length === rightBrackets.length; + } + + _compile( + ast: ICodeFunctionData, + scopes: Scope[], + reverse = false, + sendMessage = true, + asFunction = true, + ) { + if (reverse) { + ast.funcs = ast.funcs.reverse(); + } + + let i = 0; + while (i < ast.funcs.length) { + const node = ast.funcs[i]; + + if ( + node.type === FunctionType.Scope || + node.type === FunctionType.ScopeGetter + ) { + const executed = node.code(node, scopes); + node.funcs = []; + if (node.parent) { + node.parent.executed = node.parent.executed.replace( + `#FUNCTION_${i}#`, + executed.code, + ); + } + + if (node.type === FunctionType.ScopeGetter) { + scopes.at(-1)!.content = scopes + .at(-1)! + .content.replace(`#FUNCTION_${i}#`, executed.code); + + scopes + .at(-1)! + .updateContentParts(`#FUNCTION_${i}#`, executed.code); + } + } else { + if (node.funcs.length) { + this._compile( + node, + scopes, + reverse, + sendMessage, + asFunction, + ); + } + + const executed = node.code(node, scopes); + scopes = executed.scope; + + ast.executed = ast.executed.replace( + `#FUNCTION_${i}#`, + executed.code, + ); + + if ( + (node.type === FunctionType.Getter || + node.type === FunctionType.FunctionGetter) && + node.parent?.name === this.mainFunction + ) { + scopes.at(-1)!.content = scopes + .at(-1)! + .content.replace(`#FUNCTION_${i}#`, executed.code); + + scopes + .at(-1)! + .updateContentParts(`#FUNCTION_${i}#`, executed.code); + } + } + + i++; + } + + const scope = scopes.at(-1)!; + if (sendMessage) + for (const part of scope._contentParts) { + ast.executed = ast.executed.replace(part, ''); + } + + return scope.generate(ast.executed, sendMessage, asFunction); + } + + transpile(code: string, options: ITranspileOptions) { + const functions = Object.keys(this.functions); + const functionList = this._getFunctionList(code, functions); + // console.log({code ,options}) + + if (options.asFunction === undefined) { + options.asFunction = true; + } + + functionList.forEach((func) => { + const reg = new RegExp(`${func.replace('$', '\\$')}`, 'gi'); + code = parseResult(code); + code = code.replace(reg, func); }); + + const tempCode = `${this.mainFunction}[${code}]`; + + const ast = this._getFunctionData( + tempCode, + this.mainFunction, + functionList, + options.command, + ); + const globalScope = this._createGlobalScope( + ast, + options.scopeData ?? {}, + ); + + let result = this._compile( + ast, + [globalScope], + options.reverse, + options.sendMessage, + options.asFunction ?? true, + ); + result = fixMath(result); + + const functionString = this.minify ? minify(result) : result; + + if (this.minify && (functionString as MinifyOutput).error) { + throw new TranspilerError( + `Failed To Transpile Code with error ${ + (functionString as MinifyOutput).error?.message + }`, + { + code: result, + cmd: options.command?.name, + path: options.command?.__path__, + }, + ); + } + + let func: AsyncFunction; + + try { + const minified = this.minify + ? (functionString as MinifyOutput).code + : (functionString as string); + + if (!options.asFunction) { + // return non minified code + return { result, ast, scope: globalScope, functionList }; + } + + func = eval(`const f = ${minified}; f`) as AsyncFunction; + } catch (e) { + throw new TranspilerError(e as string, { + code: result, + cmd: options.command?.name, + path: options.command?.__path__, + }); + } + + return { func, ast, result, scope: globalScope, functionList }; } - return { func, ...res }; + addFunctions(functions: Record) { + this.functions = { ...this.functions, ...functions }; + } } diff --git a/lib/aoi.js/src/events/guildMessages/index.ts b/lib/aoi.js/src/events/guildMessages/index.ts new file mode 100644 index 000000000..11dd1db31 --- /dev/null +++ b/lib/aoi.js/src/events/guildMessages/index.ts @@ -0,0 +1,4 @@ +import onMessageCreate from './messageCreate.js'; +export { + onMessageCreate, +}; diff --git a/lib/aoi.js/src/events/guildMessages/messageCreate.ts b/lib/aoi.js/src/events/guildMessages/messageCreate.ts new file mode 100644 index 000000000..f2b100fa8 --- /dev/null +++ b/lib/aoi.js/src/events/guildMessages/messageCreate.ts @@ -0,0 +1,53 @@ +import { type Message } from 'discord.js'; +import type AoiClient from '@aoi.js/classes/AoiClient.js'; +import { AoiClientEvents } from '@aoi.js/typings/enum.js'; +import { safe } from '@aoi.js/utils/Helpers/core.js'; + +export async function _messageCreate(message: Message, bot: AoiClient) { + let prefix: string | undefined; + if (bot.options.prefix instanceof Array) { + prefix = bot.options.prefix.find((p) => + message.content.startsWith(p), + ); + } else prefix = bot.options.prefix; + + + if (!prefix) return; + if (!message.content.startsWith(prefix)) return; + + const args = message.content.slice(prefix.length).trim().split(/ +/); + const cmd = args.shift()?.toLowerCase(); + if (!cmd) return; + + await bot.managers.commands + .exec({ + type: 'basic', + filter: (x) => + x.name === cmd || (x.aliases?.includes(cmd) ?? false), + data: { + message, + channel: message.channel, + guild: message.guild ?? undefined, + author: message.author, + client: bot.client, + args, + bot, + member: message.member ?? undefined, + }, + }) + + .catch((e) => { + if (e.component && !e.success) return; + else bot.client.emit(AoiClientEvents.Error, e); + }); +} + +export default function onMessageCreate(bot: AoiClient) { + bot.client.on('messageCreate', async (message) => { + const [error] = await safe(_messageCreate(message, bot)); + + if (error) { + bot.client.emit(AoiClientEvents.Error, 'An error occurred while executing the message event'); + } + }); +} diff --git a/lib/aoi.js/src/events/index.ts b/lib/aoi.js/src/events/index.ts index d4ec004a3..e45ae9905 100755 --- a/lib/aoi.js/src/events/index.ts +++ b/lib/aoi.js/src/events/index.ts @@ -1,3 +1,2 @@ -export * from './interactionCreate.js'; -export * from './messageCreate.js'; -export * from './ready.js'; \ No newline at end of file +export * from './guildMessages/index.js'; +export * from './nonIntents/index.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/events/interactionCreate.ts b/lib/aoi.js/src/events/interactionCreate.ts deleted file mode 100644 index 3e024727d..000000000 --- a/lib/aoi.js/src/events/interactionCreate.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { - GatewayEventNames, - type Interaction, - InteractionTypes, - type Snowflake, -} from 'zeneth'; -import { type AoiClient } from '../structures/AoiClient.js'; -import { isAutoFetchDataEnabled } from '../util/DapiHelper.js'; -import { AoiClientEvents } from '../typings/enums.js'; - -export function onInteraction(client: AoiClient) { - client.client.on( - GatewayEventNames.InteractionCreate, - async (interaction) => { - await interactionCreate(interaction, client); - }, - ); -} - -export async function interactionCreate( - interaction: Interaction, - client: AoiClient, -) { - const cmdName = getCommandName(interaction); - if (!cmdName) return; - await client.managers.commands - .exec({ - type: 'interaction', - data: { - interaction, - client: client.client, - bot: client, - message: interaction.message, - channel: - interaction.channel ?? - client.cache?.channels?.get(interaction.channelId) ?? - isAutoFetchDataEnabled('channel', client) - ? await client.client.getChannel( - interaction.channelId!, - ) - : { id: interaction.channelId, fetched: false }, - guild: - client.cache?.guilds?.get(interaction.guildId) ?? - isAutoFetchDataEnabled('guild', client) - ? await client.client.getGuild( - interaction.guildId!, - ) - : { id: interaction.guildId, fetched: false }, - author: interaction.user, - member: interaction.member, - }, - filter: (cmd) => cmd.name === cmdName, - }) - - .catch((e) => { - if (e.component && !e.success) return; - else client.emit(AoiClientEvents.Error, e); - }); -} - -function getCommandName(interaction: Interaction) { - switch (interaction.type) { - case InteractionTypes.ApplicationCommand: - return interaction.data.name; - case InteractionTypes.MessageComponent: - return interaction.customId!; - case InteractionTypes.ApplicationCommandAutocomplete: - return interaction.data.name; - default: - return undefined; - } -} diff --git a/lib/aoi.js/src/events/messageCreate.ts b/lib/aoi.js/src/events/messageCreate.ts deleted file mode 100644 index 4ae617074..000000000 --- a/lib/aoi.js/src/events/messageCreate.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { type AoiClient } from '../structures/AoiClient.js'; -import { GatewayEventNames, type Message, type Snowflake } from 'zeneth'; -import { isAutoFetchDataEnabled } from '../util/DapiHelper.js'; -import { AoiClientEvents } from '../typings/enums.js'; -export function onMessage(client: AoiClient) { - client.client.on(GatewayEventNames.MessageCreate, async (message) => { - await messageCreate(message, client); - }); -} - -export async function messageCreate(message: Message, client: AoiClient) { - let prefix: string | undefined; - if (client.options.prefixes instanceof Array) - prefix = client.options.prefixes.find((p) => - message.content.startsWith(p), - ); - else prefix = client.options.prefixes; - if (!prefix) return; - if (!message.content.startsWith(prefix)) return; - const args = message.content.slice(prefix.length).trim().split(/ +/); - const cmd = args.shift()?.toLowerCase(); - if (!cmd) return; - await client.managers.commands - .exec({ - type: 'basic', - filter: (x) => - x.name === cmd || (x.aliases?.includes(cmd) ?? false), - data: { - message, - channel: - client.cache?.channels?.get(message.channelId) ?? - isAutoFetchDataEnabled('channel', client) - ? await client.client.getChannel(message.channelId) - : { id: message.channelId, fetched: false }, - guild: - client.cache?.guilds?.get(message.guildId) ?? - isAutoFetchDataEnabled('guild', client) - ? await client.client.getGuild( - (message.guildId!), - ) - : { id: message.guildId, fetched: false }, - author: message.author, - client: client.client, - args, - bot: client, - member: message.member, - }, - }) - - .catch((e) => { - if (e.component && !e.success) return; - else client.emit(AoiClientEvents.Error, e); - }); -} diff --git a/lib/aoi.js/src/events/nonIntents/index.ts b/lib/aoi.js/src/events/nonIntents/index.ts new file mode 100644 index 000000000..b139613be --- /dev/null +++ b/lib/aoi.js/src/events/nonIntents/index.ts @@ -0,0 +1,3 @@ +import onReady from './onReady.js'; + +export { onReady }; diff --git a/lib/aoi.js/src/events/nonIntents/onReady.ts b/lib/aoi.js/src/events/nonIntents/onReady.ts new file mode 100644 index 000000000..51f2318ae --- /dev/null +++ b/lib/aoi.js/src/events/nonIntents/onReady.ts @@ -0,0 +1,24 @@ +import type AoiClient from '@aoi.js/classes/AoiClient.js'; +import { AoiClientEvents } from '@aoi.js/typings/enum.js'; +import { safe } from '@aoi.js/utils/Helpers/core.js'; + +export async function _ready(bot: AoiClient) { + await bot.managers.commands.exec({ + type: 'ready', + data: { + bot: bot, + client: bot.client, + }, + filter: () => true, + }); +} + +export default function onReady(bot: AoiClient) { + bot.client.on('ready', async () => { + const [error] = await safe(_ready(bot)); + + if (error) { + bot.client.emit(AoiClientEvents.Error, 'An error occurred while executing the ready event'); + } + }); +} diff --git a/lib/aoi.js/src/events/ready.ts b/lib/aoi.js/src/events/ready.ts deleted file mode 100644 index 374129a7b..000000000 --- a/lib/aoi.js/src/events/ready.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { type Camelize, GatewayEventNames, type GatewayReadyData } from 'zeneth'; -import { type AoiClient } from '../index.js'; - -export function onReady(client: AoiClient) { - client.client.on(GatewayEventNames.Ready, async (data) => { - await ready(data, client); - }); -} - -export async function ready( - data: Camelize, - client: AoiClient, -) { - await client.managers.commands.exec({ - type: 'ready', - data: { - client: client.client, - bot: client, - data, - }, - filter: () => true, - }); -} diff --git a/lib/aoi.js/src/functions/README.md b/lib/aoi.js/src/functions/README.md deleted file mode 100644 index 35009faa9..000000000 --- a/lib/aoi.js/src/functions/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Functions - -## Directory Structure -```mermaid -graph RL; -discord --> Functions; -js --> Functions; -client --> discord; -guild --> discord; -interaction --> discord; -message --> discord; -misc --> discord; -user --> discord; -array --> js; -conditions --> js; -loops --> js; -maths --> js; -misc --> js; -object --> js; -process --> js; -string --> js; -``` - -## Divisions - - - `discord`: Contains functions related to discord - - `js`: Contains functions related to js diff --git a/lib/aoi.js/src/functions/discord/README.md b/lib/aoi.js/src/functions/discord/README.md deleted file mode 100644 index f936a226c..000000000 --- a/lib/aoi.js/src/functions/discord/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Discord - -## Directory Structure - -```mermaid -graph RL; -$clientAvatar --> client; -$clientId --> client; -$clientTag --> client; -$clientToken --> client; -$ping --> client; -$guildId --> guild; -$guildName --> guild; -$autocompleteRespond --> interaction; -$interactionData --> interaction; -$interactionDefer --> interaction; -$interactionDeferUpdate --> interaction; -$interactionModal --> interaction; -$interactionReply --> interaction; -$interactionUpdate --> interaction; -$description --> message; -$message --> message; -$title --> message; -$eval --> misc; -$authorAvatar --> user; -$authorId --> user; -$authorName --> user; -$authorTag --> user; -$userAvatar --> user; -$userId --> user; -$userTag --> user; -$username --> user; - -``` - -## Divisions - - - `client`: Contains functions related to client - - `guild`: Contains functions related to guild - - `interaction`: Contains functions related to interaction - - `message`: Contains functions related to message - - `misc`: Contains functions related to misc - - `user`: Contains functions related to user diff --git a/lib/aoi.js/src/functions/discord/channel/$channelid.ts b/lib/aoi.js/src/functions/discord/channel/$channelid.ts new file mode 100644 index 000000000..eed44114a --- /dev/null +++ b/lib/aoi.js/src/functions/discord/channel/$channelid.ts @@ -0,0 +1,51 @@ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; +import { ChannelType } from 'discord.js'; + +const $channelId = new FunctionBuilder() + .setName('$channelid') + .setType(FunctionType.Getter) + .setReturns(ReturnType.String | ReturnType.Void) + .setBrackets(true) + .setOptional(true) + .setFields([ + { + name: 'channel name', + type: ReturnType.String, + required: true, + description: 'Name of the channel', + }, + ]) + .setCode((data, scopes, thisArg) => { + const [name] = thisArg.getParams(data); + + if (!name) { + const result = thisArg.getResultString( + (discordData) => discordData.channel?.id, + ); + + const escaped = escapeResult(result); + + return { + code: escaped, + scope: scopes, + }; + } + + const result = thisArg.getResultString( + // @ts-expect-error: $0 and $1 are placeholders + (discordData) => discordData.client.channels.cache.find((channel) => channel.type !== '$0' && channel.name === '$1')?.id, + [ChannelType.DM.toString(), name], + ); + + const escaped = escapeResult(result); + + return { + code: escaped, + scope: scopes, + }; + }) + .build(); + +export { $channelId }; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/discord/channel/index.ts b/lib/aoi.js/src/functions/discord/channel/index.ts new file mode 100644 index 000000000..b91c06737 --- /dev/null +++ b/lib/aoi.js/src/functions/discord/channel/index.ts @@ -0,0 +1 @@ +export * from './$channelid.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/discord/client/$clientAvatar.ts b/lib/aoi.js/src/functions/discord/client/$clientAvatar.ts deleted file mode 100644 index aafc70551..000000000 --- a/lib/aoi.js/src/functions/discord/client/$clientAvatar.ts +++ /dev/null @@ -1,70 +0,0 @@ - -import { type Scope } from '../../../index.js'; -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { - type TranspiledFuncData, - type FuncData, -} from '../../../typings/interfaces.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -const clientAvatar = new AoiJSFunction() - .setName('$clientAvatar') - .setType('getter') - .setBrackets(true) - .setOptional(true) - .setFields([ - { - name: 'size', - type: 'number', - description: 'The size of the avatar', - required: false, - }, - { - name: 'format', - type: 'string', - description: 'The format of the avatar', - required: false, - }, - { - name: 'dynamic', - type: 'boolean', - description: 'Whether the avatar is gif or not', - required: false, - }, - ]) - .setVersion('7.0.0') - .setDefault(['void', 'void', 'void']) - .setReturns('string') - .setDescription('Returns the Avatar of client') - .setExample( - ` -$clientAvatar // returns the avatar of client - -$clientAvatar[4096;true;png] // returns the avatar of client with size 4096, dynamic true and format png - `, - ); -clientAvatar.setCode((data: FuncData, scope: Scope[], thisArg) => { - const [size = '4096', dynamic = 'true', format = 'png'] = - thisArg.getParams(data); - const currentScope = thisArg.getCurrentScope(scope); - - const resultString = thisArg.getResultString( - (discord: TranspiledFuncData) => - discord.client.readyData.user.avatarUrl({ - size: '$0' as unknown as number, - dynamic: '$1' as unknown as boolean, - format: '$2' as unknown as string, - }), - [size, dynamic, `"${format}"`], - ); - - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, clientAvatar); - -export const $clientAvatar = clientAvatar.build(); diff --git a/lib/aoi.js/src/functions/discord/client/$clientId.ts b/lib/aoi.js/src/functions/discord/client/$clientId.ts deleted file mode 100644 index d23b23bc6..000000000 --- a/lib/aoi.js/src/functions/discord/client/$clientId.ts +++ /dev/null @@ -1,32 +0,0 @@ -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -const clientId = new AoiJSFunction() - .setName('$clientId') - .setType('getter') - .setBrackets(false) - .setOptional(false) - .setFields([]) - .setVersion('7.0.0') - .setDefault([]) - .setReturns('bigint') - .setDescription('Returns the ID of client').setExample(` -$clientId // returns the ID of client - `); - -clientId.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - const resultString = thisArg.getResultString( - (discord) => discord.client.user.id, - [], - ); - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, clientId); - -export const $clientId = clientId.build(); diff --git a/lib/aoi.js/src/functions/discord/client/$clientPrefixes.ts b/lib/aoi.js/src/functions/discord/client/$clientPrefixes.ts deleted file mode 100755 index fc1488100..000000000 --- a/lib/aoi.js/src/functions/discord/client/$clientPrefixes.ts +++ /dev/null @@ -1,35 +0,0 @@ -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -const clientPrefixes = new AoiJSFunction() - .setName('$clientPrefixes') - .setType('getter') - .setBrackets(false) - .setOptional(false) - .setFields([]) - .setVersion('7.0.0') - .setDefault([]) - .setReturns('string') - .setDescription('Returns the Prefixes of client').setExample(` -$clientPrefixes // returns the Prefixes of client - `); - -clientPrefixes.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - const resultString = thisArg.getResultString( - (discord) => - Array.isArray(discord.bot.options.prefixes) - ? discord.bot.options.prefixes.join(', ') - : discord.bot.options.prefixes, - [], - ); - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, clientPrefixes); - -export const $clientPrefixes = clientPrefixes.build(); diff --git a/lib/aoi.js/src/functions/discord/client/$clientToken.ts b/lib/aoi.js/src/functions/discord/client/$clientToken.ts deleted file mode 100644 index 3ef967b94..000000000 --- a/lib/aoi.js/src/functions/discord/client/$clientToken.ts +++ /dev/null @@ -1,31 +0,0 @@ -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -const clientToken = new AoiJSFunction() - .setName('$clientToken') - .setType('getter') - .setBrackets(false) - .setOptional(false) - .setFields([]) - .setVersion('7.0.0') - .setDefault([]) - .setReturns('string') - .setDescription('Returns the token of client') - .setExample('client token is `$clientToken`'); - -clientToken.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - const resultString = thisArg.getResultString( - (discord) => discord.client.token, - [], - ); - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, clientToken); - -export const $clientToken = clientToken.build(); diff --git a/lib/aoi.js/src/functions/discord/client/$ping.ts b/lib/aoi.js/src/functions/discord/client/$ping.ts index 90260e0ef..b4c5a8dee 100644 --- a/lib/aoi.js/src/functions/discord/client/$ping.ts +++ b/lib/aoi.js/src/functions/discord/client/$ping.ts @@ -1,31 +1,24 @@ -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; -const ping = new AoiJSFunction() +const $ping = new FunctionBuilder() .setName('$ping') - .setType('getter') .setBrackets(false) - .setOptional(false) .setFields([]) - .setVersion('7.0.0') - .setDefault([]) - .setReturns('number') - .setDescription('Returns the Ping of client') - .setExample('client ping is `$pingms`'); - -ping.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - const resultString = thisArg.getResultString( - (discord) => discord.client.ws.data.ping, - [], - ); - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, ping); + .setOptional(false) + .setType(FunctionType.Getter) + .setReturns(ReturnType.Number) + .setCode((data, scopes, thisArg) => { + const resultString = thisArg.getResultString( + (discordData) => discordData.client.ws.ping, + ); + const escaped = escapeResult(resultString); + return { + code: escaped, + scope: scopes, + }; + }) + .build(); -export const $ping = ping.build(); +export { $ping }; diff --git a/lib/aoi.js/src/functions/discord/client/index.ts b/lib/aoi.js/src/functions/discord/client/index.ts index 32ac35e90..202cdcb7a 100644 --- a/lib/aoi.js/src/functions/discord/client/index.ts +++ b/lib/aoi.js/src/functions/discord/client/index.ts @@ -1,5 +1 @@ -export * from './$ping.js'; -export * from './$clientAvatar.js'; -export * from './$clientId.js'; -export * from './$clientToken.js'; -export * from './$clientPrefixes.js'; \ No newline at end of file +export * from './$ping.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/discord/guild/$guildId.ts b/lib/aoi.js/src/functions/discord/guild/$guildId.ts index 921e437bb..dac088413 100644 --- a/lib/aoi.js/src/functions/discord/guild/$guildId.ts +++ b/lib/aoi.js/src/functions/discord/guild/$guildId.ts @@ -1,29 +1,43 @@ -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; -const guildId = new AoiJSFunction() - .setName('$guildId') - .setType('getter') - .setBrackets(false) - .setOptional(false) - .setFields([]) - .setVersion('7.0.0') - .setDefault([]) - .setReturns('bigint') - .setDescription('Returns the guildId of current guild') - .setExample('current guild id is `$guildId`'); +const $guildId = new FunctionBuilder() + .setName('$guildid') + .setBrackets(true) + .setOptional(true) + .setFields([ + { + name: 'guild name', + type: ReturnType.String, + required: true, + description: 'Name of the guild', + }, + ]) + .setReturns(ReturnType.String) + .setType(FunctionType.Getter) + .setCode((data, scopes, thisArg) => { + const [name] = thisArg.getParams(data); -guildId.setCode((data, scope, thisArg) => { - const currentScope = scope[scope.length - 1]; + let resultString: string; + if ( name ) { + resultString = thisArg.getResultString( + (discordData) => discordData.client.guilds.cache.find( guild => guild.name === '$0')?.id, + [name], + ); + } else { + resultString = thisArg.getResultString( + (discordData) => discordData.guild?.name, + ); + } - const guildId = thisArg.getResultString((discord) => discord.guild?.id, []); + const escaped = escapeResult(resultString); - const res = escapeResult(`(${guildId})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; -}, guildId); + return { + code: escaped, + scope: scopes, + }; + }) + .build(); -export const $guildId = guildId; +export { $guildId }; diff --git a/lib/aoi.js/src/functions/discord/guild/$guildName.ts b/lib/aoi.js/src/functions/discord/guild/$guildName.ts index 1e92129b6..753975958 100644 --- a/lib/aoi.js/src/functions/discord/guild/$guildName.ts +++ b/lib/aoi.js/src/functions/discord/guild/$guildName.ts @@ -1,59 +1,43 @@ - -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-nocheck -import { type Guild, type Snowflake } from 'zeneth'; -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; -import { parseString } from '../../../index.js'; +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; -const guildName = new AoiJSFunction() - .setName('$guildName') - .setType('getter') +const $guildName = new FunctionBuilder() + .setName('$guildid') .setBrackets(true) .setOptional(true) .setFields([ { - name: 'guildId', - type: 'number', - description: 'The guild id to get the name from', - required: false, + name: 'guild id', + type: ReturnType.String, + required: true, + description: 'id of the guild', }, ]) - .setVersion('7.0.0') - .setDefault(['__$DISCORD_DATA$__.guild?.id']) - .setReturns('string') - .setDescription('Returns the name of current guild').setExample(` - $guildName // returns the name of current guild + .setReturns(ReturnType.String) + .setType(FunctionType.Getter) + .setCode((data, scopes, thisArg) => { + const [id] = thisArg.getParams(data); - $guildName[some id here] // returns the name of guild with provided id - `); + let resultString: string; + if ( id ) { + resultString = thisArg.getResultString( + (discordData) => discordData.client.guilds.cache.find( guild => guild.id === '$0')?.name, + [id], + ); + } else { + resultString = thisArg.getResultString( + (discordData) => discordData.guild?.name, + ); + } -guildName.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - const id = data.inside; - const resultString = thisArg.conditionalGetResultString( - !!id, - { - func: async (discord) => - ( - (await discord.bot.util.getGuild( - '$0' as unknown as Snowflake, - )) - )?.name, - args: [parseString(id)], - }, - { - func: (discord) => discord.guild?.name, - args: [], - }, - ); - const res = escapeResult(resultString); - currentScope.update(res, data); + const escaped = escapeResult(resultString); - return { - code: res, - scope, - }; -}, guildName); + return { + code: escaped, + scope: scopes, + }; + }) + .build(); -export const $guildName = guildName.build(); +export { $guildName }; diff --git a/lib/aoi.js/src/functions/discord/guild/index.ts b/lib/aoi.js/src/functions/discord/guild/index.ts index 4ef340315..b797c579a 100644 --- a/lib/aoi.js/src/functions/discord/guild/index.ts +++ b/lib/aoi.js/src/functions/discord/guild/index.ts @@ -1,2 +1,2 @@ -export * from './$guildId.js'; -export * from './$guildName.js'; \ No newline at end of file +export * from './$guildid.js'; +export * from './$guildname.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/discord/index.ts b/lib/aoi.js/src/functions/discord/index.ts index bede60130..9e3601679 100644 --- a/lib/aoi.js/src/functions/discord/index.ts +++ b/lib/aoi.js/src/functions/discord/index.ts @@ -1,6 +1,3 @@ export * from './client/index.js'; export * from './guild/index.js'; -export * from './misc/index.js'; -export * from './message/index.js'; -export * from './user/index.js'; -export * from './interaction/index.js'; \ No newline at end of file +export * from './channel/index.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/discord/interaction/$autocompleteRespond.ts b/lib/aoi.js/src/functions/discord/interaction/$autocompleteRespond.ts deleted file mode 100644 index f7fbb8384..000000000 --- a/lib/aoi.js/src/functions/discord/interaction/$autocompleteRespond.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import { InteractionResponseTypes, type Snowflake } from 'zeneth'; -import { StringObject, parseStringObject } from '../../../index.js'; -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -const autocomplete = new AoiJSFunction() - .setName('$autocompleteRespond') - .setType('setter') - .setBrackets(true) - .setOptional(true) - .setFields([ - { - name: 'options', - type: 'array | object', - description: 'The options to respond with', - required: true, - }, - ]) - .setVersion('7.0.0') - .setDefault(['void']) - .setReturns('void') - .setDescription( - 'responds to the autocomplete interaction with the provided options', - ).setExample(` - $autocompleteRespond[{ - name: "Hello World", - value: "helloworld" - };{ - name: "Hello World 2", - value: "helloworld2" - }] // responds to the autocomplete interaction with the provided options (object) - - $autocompleteRespond[Hello World;helloworld;Hello World 2;helloworld2] // responds to the autocomplete interaction with the provided options (array) - `); - -autocomplete.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - const opts = thisArg.getParams(data); - const options = []; - let i = 0; - while (i < opts.length) { - const opt = opts[i].trim(); - if (opt.startsWith('{') && opt.endsWith('}')) { - const currentObj = new StringObject('{'); - currentObj.addEnd('}'); - - const obj = parseStringObject(opt, currentObj); - options.push(obj.solve()); - i += 1; - } else { - const name = opt; - const value = opts[i + 1]; - options.push(`{name: "${name}", value: "${value}" }`); - i += 2; - } - } - - const resultString = thisArg.getResultString( - async (discord) => - discord.client.createInteractionResponse( - discord.interaction?.id!, - discord.interaction?.token!, - //@ts-expect-error - '$0', - { - choices: ['$1'] as any, - }, - ), - [InteractionResponseTypes.ApplicationCommandAutocompleteResult.toString(), options.join(',\n')], - ); - - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, autocomplete); - -export const $autocompleteRespond = autocomplete.build(); diff --git a/lib/aoi.js/src/functions/discord/interaction/$interactionData.ts b/lib/aoi.js/src/functions/discord/interaction/$interactionData.ts deleted file mode 100644 index 93b736d94..000000000 --- a/lib/aoi.js/src/functions/discord/interaction/$interactionData.ts +++ /dev/null @@ -1,41 +0,0 @@ -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -const interactionData = new AoiJSFunction() - .setName('$interactionData') - .setType('getter') - .setBrackets(true) - .setOptional(true) - .setFields([ - { - name: 'property', - type: 'string', - required: false, - description: 'The property to get from the interaction data', - }, - ]) - .setVersion('7.0.0') - .setDefault(['void']) - .setReturns('any') - .setDescription('gets the interaction data').setExample(` - $interactionData[user.id] // returns the user's id of the interaction - `); - -interactionData.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - const property = data.inside; - - const res = escapeResult( - !property?.trim() - ? '__$Discord_Data$__.interaction' - : `__$Discord_Data$__.interaction?.${property}`, - ); - - currentScope.update(res, data); - return { - code: res, - scope, - }; -}, interactionData); - -export const $interactionData = interactionData.build(); diff --git a/lib/aoi.js/src/functions/discord/interaction/$interactionDefer.ts b/lib/aoi.js/src/functions/discord/interaction/$interactionDefer.ts deleted file mode 100644 index d992c67a4..000000000 --- a/lib/aoi.js/src/functions/discord/interaction/$interactionDefer.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -/* eslint-disable no-constant-condition */ -import { InteractionResponseTypes, MessageFlags, type Snowflake } from 'zeneth'; -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -const interactionDefer = new AoiJSFunction() - .setName('$interactionDefer') - .setType('setter') - .setBrackets(true) - .setOptional(true) - .setFields([ - { - name: 'ephermal', - type: 'string', - description: 'Whether the interaction should be ephermal or not', - required: false, - }, - ]) - .setVersion('7.0.0') - .setDefault(['false']) - .setReturns('void') - .setDescription( - 'defers the interaction from initial 3 seconds response time limit to 15 minutes', - ).setExample(` - $interactionDefer // defers the interaction - - $interactionDefer[true] // defers the interaction and makes it ephemeral - `); - -interactionDefer.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - //code here - - const ephemeral = data.inside ?? 'false'; - - const resultString = thisArg.getResultString( - async (discord) => - discord.client.createInteractionResponse( - discord.interaction?.id!, - discord.interaction?.token!, - // @ts-ignore - '$0' as unknown as InteractionResponseTypes, - { - flags: '$1' ? '$2' : 0, - }, - ), - [ - InteractionResponseTypes.DeferredChannelMessageWithSource.toString(), - ephemeral, - MessageFlags.Ephemeral.toString(), - ], - ); - - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, interactionDefer); - -export const $interactionDefer = interactionDefer.build(); diff --git a/lib/aoi.js/src/functions/discord/interaction/$interactionDeferUpdate.ts b/lib/aoi.js/src/functions/discord/interaction/$interactionDeferUpdate.ts deleted file mode 100644 index 6bb98ff6d..000000000 --- a/lib/aoi.js/src/functions/discord/interaction/$interactionDeferUpdate.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ - -import { InteractionResponseTypes, type Snowflake } from 'zeneth'; -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -const interactionDeferUpdate = new AoiJSFunction() - .setName('$interactionDeferUpdate') - .setType('setter') - .setBrackets(false) - .setOptional(false) - .setFields([]) - .setVersion('7.0.0') - .setDefault([]) - .setReturns('void') - .setDescription( - 'defers the interaction update from initial 3 seconds response time limit to 15 minutes', - ).setExample(` - $interactionDeferUpdate // defers the interaction - `); - -interactionDeferUpdate.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - //code here - - const resultString = thisArg.getResultString( - async (discord) => - discord.client.createInteractionResponse( - discord.interaction?.id!, - discord.interaction?.token!, - //@ts-expect-error - '$0', - undefined, - ), - [InteractionResponseTypes.DeferredUpdateMessage], - ); - - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, interactionDeferUpdate); - -export const $interactionDeferUpdate = interactionDeferUpdate.build(); diff --git a/lib/aoi.js/src/functions/discord/interaction/$interactionModal.ts b/lib/aoi.js/src/functions/discord/interaction/$interactionModal.ts deleted file mode 100644 index 9f2599612..000000000 --- a/lib/aoi.js/src/functions/discord/interaction/$interactionModal.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { Transpiler, TranspilerError, functions } from '../../../index.js'; -import Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - getFunctionList, - parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $interactionModal: FunctionData = { - name: '$interactionModal', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'msg', - type: 'string', - description: 'The message to send', - required: true, - }, - ], - description: 'creates a modal for the interaction', - default: ['void'], - returns: 'void', - version: '7.0.0', - example: ` - - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope.at(-1)!; - const funcs = [ - ...Object.keys(functions), - ...currentScope.client.managers.functions.functions.K(), - ]; - //code here - - const [msg, ephemeral = 'false'] = data.splits; - - if ( - !msg && - (currentScope?.name.startsWith('$try') || - currentScope?.name.startsWith('$catch')) - ) - throw new TranspilerError( - `${data.name} requires a message or content`, - { - function: { - name: data.name, - code: data.total, - }, - }, - ); - - let msgExecute; - const msgFunctionList = getFunctionList(msg, funcs); - const hash = Math.floor(Math.random() * 1000000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - parseResult(msg), - false, - ); - if (msgFunctionList.length) { - msgExecute = Transpiler(msg, { - client: currentScope.client, - customFunctions: - currentScope.client.managers.functions.functions.toJSON(), - sendMessage: false, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: newscope.name, - objects: currentScope.objects, - }, - }); - newscope.functions = msgExecute.scope[0].functions + '\n'; - newscope.packages = msgExecute.scope[0].packages + '\n'; - newscope.setters = msgExecute.scope[0].setters + '\n'; - newscope.rest = msgExecute.scope[0].rest + '\n'; - newscope.sendData = msgExecute.scope[0].sendData; - newscope.embeds = msgExecute.scope[0].embeds; - newscope.components = msgExecute.scope[0].components; - newscope.files = msgExecute.scope[0].files; - newscope.stickers = msgExecute.scope[0].stickers; - newscope.variables = msgExecute.scope[0].variables; - } - - currentScope.sendFunction = '__$DISCORD_DATA$__.client.createMessage'; - newscope.ephemeral = ephemeral === 'true' ? true : false; - - const res = escapeResult( - `await __$DISCORD_DATA$__.client.createInteractionResponse(__$DISCORD_DATA$__.interaction.id, __$DISCORD_DATA$__.interaction.token, 4, ${newscope.toString( - false, - )});`, - ); - - currentScope.update(res, data); - - return { - code: res, - scope, - }; - }, -}; - -// const interactionModal = new AoiJSFunction() -// .setName("$interactionModal") -// .setType("scope") -// .setBrackets(true) -// .setOptional(false) -// .setFields([ -// { -// name: "msg", -// type: "string", -// description: "The message to send", -// required: true, -// }, -// ]) -// .setVersion("7.0.0") -// .setDefault(["void"]) diff --git a/lib/aoi.js/src/functions/discord/interaction/$interactionReply.ts b/lib/aoi.js/src/functions/discord/interaction/$interactionReply.ts deleted file mode 100644 index 05ae7942f..000000000 --- a/lib/aoi.js/src/functions/discord/interaction/$interactionReply.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import { Transpiler, TranspilerError, functions } from '../../../index.js'; -import Scope from '../../../core/structs/Scope.js'; -import { - escapeResult, - getFunctionList, - parseResult, -} from '../../../util/transpilerHelpers.js'; -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { InteractionResponseTypes, type Snowflake } from 'zeneth'; - -const interactionReply = new AoiJSFunction() - .setName('$interactionReply') - .setType('scope') - .setBrackets(true) - .setOptional(false) - .setFields([ - { - name: 'msg', - type: 'string', - description: 'The message to send', - required: true, - }, - { - name: 'ephemeral', - type: 'boolean', - description: 'Whether the message should be ephemeral or not', - required: false, - }, - ]) - .setVersion('7.0.0') - .setDefault(['void', 'false']) - .setReturns('void') - .setDescription('replies to the interaction').setExample(` - $interactionReply[hello world] // replies with "hello world" - - $interactionReply[hello world;true] // replies with "hello world" and makes it ephemeral - - $interactionReply[ - $title[hello world] - $description[hello world] - ;true] - `); - -interactionReply.setCode((data, scope, thisArg) => { - const currentScope = thisArg.getCurrentScope(scope); - const funcs = [ - ...Object.keys(functions), - ...currentScope.client.managers.functions.functions.K(), - ]; - //code here - - const [msg, ephemeral = 'false'] = thisArg.getParams(data); - - if ( - !msg && - (currentScope?.name.startsWith('$try') || - currentScope?.name.startsWith('$catch')) - ) - throw new TranspilerError(`${data.name} requires a message or content`); - - let msgExecute; - const msgFunctionList = getFunctionList(msg, funcs); - const hash = Math.floor(Math.random() * 1000000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - parseResult(msg), - false, - ); - if (msgFunctionList.length) { - msgExecute = Transpiler(msg, { - client: currentScope.client, - customFunctions: - currentScope.client.managers.functions.functions.toJSON(), - sendMessage: false, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: newscope.name, - objects: currentScope.objects, - }, - }); - newscope.functions = msgExecute.scope[0].functions + '\n'; - newscope.packages = msgExecute.scope[0].packages + '\n'; - newscope.setters = msgExecute.scope[0].setters + '\n'; - newscope.rest = msgExecute.scope[0].rest + '\n'; - newscope.sendData = msgExecute.scope[0].sendData; - newscope.embeds = msgExecute.scope[0].embeds; - newscope.components = msgExecute.scope[0].components; - newscope.files = msgExecute.scope[0].files; - newscope.stickers = msgExecute.scope[0].stickers; - newscope.variables = msgExecute.scope[0].variables; - } - - currentScope.sendFunction = thisArg.getResultString( - (discord) => discord.client.createMessage, - [], - ); - - newscope.ephemeral = ephemeral === 'true'; - - const resultString = thisArg.getResultString( - async (discord) => - discord.client.createInteractionResponse( - discord.interaction?.id!, - discord.interaction?.token!, - //@ts-expect-error - '$0', - '$1', - ), - [ - InteractionResponseTypes.ChannelMessageWithSource, - newscope.toString(false), - ], - ); - - const res = escapeResult(resultString); - currentScope.update(res, data); - - return { - code: res, - scope, - }; -}, interactionReply); - -export const $interactionReply = interactionReply.build(); diff --git a/lib/aoi.js/src/functions/discord/interaction/$interactionUpdate.ts b/lib/aoi.js/src/functions/discord/interaction/$interactionUpdate.ts deleted file mode 100644 index 6b9575b6f..000000000 --- a/lib/aoi.js/src/functions/discord/interaction/$interactionUpdate.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { Transpiler, TranspilerError, functions } from '../../../index.js'; -import Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - getFunctionList, - parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $interactionUpdate: FunctionData = { - name: '$interactionUpdate', - brackets: true, - optional: true, - type: 'scope', - fields: [ - { - name: 'msg', - type: 'string', - description: 'The message to send', - required: true, - }, - ], - description: 'updates the original message of the interaction (only for message components)', - default: ['void'], - returns: 'void', - version: '7.0.0', - example: ` - $interactionUpdate[hello world] // updates the original message with "hello world" - - $interactionUpdate[ - $title[hello world] - $description[hello world] - ] // updates the original message with an embed - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope.at(-1)!; - const funcs = [ - ...Object.keys(functions), - ...currentScope.client.managers.functions.functions.K(), - ]; - //code here - - const msg = data.inside!; - - if ( - !msg && - (currentScope?.name.startsWith('$try') || - currentScope?.name.startsWith('$catch')) - ) - throw new TranspilerError( - `${data.name} requires a message or content`, - ); - - let msgExecute; - const msgFunctionList = getFunctionList(msg, funcs); - const hash = Math.floor(Math.random() * 1000000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - parseResult(msg), - false, - ); - if (msgFunctionList.length) { - msgExecute = Transpiler(msg, { - client: currentScope.client, - customFunctions: - currentScope.client.managers.functions.functions.toJSON(), - sendMessage: false, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: newscope.name, - objects: currentScope.objects, - }, - }); - newscope.functions = msgExecute.scope[0].functions + '\n'; - newscope.packages = msgExecute.scope[0].packages + '\n'; - newscope.setters = msgExecute.scope[0].setters + '\n'; - newscope.rest = msgExecute.scope[0].rest + '\n'; - newscope.sendData = msgExecute.scope[0].sendData; - newscope.embeds = msgExecute.scope[0].embeds; - newscope.components = msgExecute.scope[0].components; - newscope.files = msgExecute.scope[0].files; - newscope.stickers = msgExecute.scope[0].stickers; - newscope.variables = msgExecute.scope[0].variables; - } - - const res = escapeResult( - `await __$DISCORD_DATA$__.client.createInteractionResponse(__$DISCORD_DATA$__.interaction.id, __$DISCORD_DATA$__.interaction.token, 7, ${newscope.toString( - false, - )});`, - ); - - currentScope.update(res, data); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/interaction/index.ts b/lib/aoi.js/src/functions/discord/interaction/index.ts deleted file mode 100644 index 623c067fe..000000000 --- a/lib/aoi.js/src/functions/discord/interaction/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './$autocompleteRespond.js'; -export * from './$interactionData.js'; -export * from './$interactionDefer.js'; -export * from './$interactionDeferUpdate.js'; -export * from './$interactionModal.js'; -export * from './$interactionReply.js'; -export * from './$interactionUpdate.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/discord/message/$description.ts b/lib/aoi.js/src/functions/discord/message/$description.ts deleted file mode 100644 index 62cf5372a..000000000 --- a/lib/aoi.js/src/functions/discord/message/$description.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { type RawEmbedData } from 'zeneth'; -import { parseString } from '../../../core/parsers/stringParser.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $description: FunctionData = { - name: '$description', - brackets: true, - optional: false, - type: 'setter', - fields: [ - { - name: 'index or description', - type: 'string | number', - description: 'The index of the embed to set the description of', - required: true, - }, - { - name: 'description', - type: 'string', - description: 'The description to set', - required: false, - }, - ], - description: 'Sets the description of an embed at the specified index', - default: ['text', ''], - returns: 'void', - version: '7.0.0', - example: ` - $description[hello world] // sets the description of the first embed to "hello world" - - $description[2;hello world] // sets the description of the second embed to "hello world" - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope.at(-1)!; - //code here - const [indexOrDescription, ...description] = data.splits; - const parsedDescription = description.join(';'); - let actualDescription: string; - let index = 0; - if (!parsedDescription) actualDescription = indexOrDescription; - else if (parsedDescription && isNaN(Number(indexOrDescription))) - actualDescription = indexOrDescription + ';' + parsedDescription; - else { - actualDescription = parsedDescription; - index = Number(indexOrDescription) - 1; - } - - let embed = currentScope.embeds[index] as RawEmbedData; - if (!embed) { - embed = { - fields: [], - }; - - currentScope.setters += escapeResult( - `${escapeVars(`${currentScope.name}_embeds`)}[${index}] = { fields: [] };`, - ); - } - - embed.description = actualDescription; - currentScope.embeds[index] = embed; - - const res = escapeResult( - `${escapeVars(`${currentScope.name}_embeds`)}[${index}].description = ${parseString( - actualDescription, - )};`, - ); - - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/message/$message.ts b/lib/aoi.js/src/functions/discord/message/$message.ts deleted file mode 100644 index 8229b9a4d..000000000 --- a/lib/aoi.js/src/functions/discord/message/$message.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { type FunctionData } from '../../../typings/interfaces.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $message: FunctionData = { - name: '$message', - type: 'getter', - brackets: true, - optional: true, - fields: [ - { - name: 'argsIndex', - description: 'The index of the argument', - type: 'number', - required: false, - }, - ], - version: '7.0.0', - default: ['all'], - returns: 'string', - description: 'Returns the author\'s message', - example: ` - $message // returns the author's message - - $message[1] // returns the first argument - `, - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - const argsIndex = data.inside; - const message = argsIndex - ? `__$DISCORD_DATA$__.args?.[${argsIndex}]` - : '__$DISCORD_DATA$__.args?.join(\' \')'; - - const res = escapeResult(`(${message})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/message/$title.ts b/lib/aoi.js/src/functions/discord/message/$title.ts deleted file mode 100644 index 0bbda4c2d..000000000 --- a/lib/aoi.js/src/functions/discord/message/$title.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { type RawEmbedData } from 'zeneth'; -import { parseString } from '../../../core/parsers/stringParser.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $title: FunctionData = { - name: '$title', - brackets: true, - optional: false, - type: 'setter', - fields: [ - { - name: 'index or title', - type: 'string | number', - description: 'The index of the embed to set the title of', - required: true, - }, - { - name: 'title', - type: 'string', - description: 'The title to set', - required: false, - }, - ], - description: 'Sets the title of an embed at the specified index', - default: ['text', ''], - returns: 'void', - version: '7.0.0', - example: ` - $title[hello world] // sets the title of the first embed to "hello world" - - $title[2;hello world] // sets the title of the second embed to "hello world" - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope.at(-1)!; - //code here - const [indexOrTitle, ...title] = data.splits; - const parsedTitle = title.join(';'); - let actualTitle: string; - let index = 0; - if (!parsedTitle) actualTitle = indexOrTitle; - else if (parsedTitle && isNaN(Number(indexOrTitle))) - actualTitle = indexOrTitle + ';' + parsedTitle; - else { - actualTitle = parsedTitle; - index = Number(indexOrTitle) - 1; - } - - let embed = currentScope.embeds[index] as RawEmbedData; - if (!embed) { - embed = { - fields: [], - }; - - currentScope.setters += escapeResult( - `${escapeVars( - `${currentScope.name}_embeds`, - )}[${index}] = { fields: [] };`, - ); - } - - embed.title = actualTitle; - currentScope.embeds[index] = embed; - - const res = escapeResult( - `${escapeVars( - currentScope.name + '_embeds', - )}[${index}].title = ${parseString(actualTitle)};`, - ); - - currentScope.update(res, data); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/message/index.ts b/lib/aoi.js/src/functions/discord/message/index.ts deleted file mode 100644 index 03d537363..000000000 --- a/lib/aoi.js/src/functions/discord/message/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './$message.js'; -export * from './$description.js'; -export * from './$title.js'; diff --git a/lib/aoi.js/src/functions/discord/misc/$eval.ts b/lib/aoi.js/src/functions/discord/misc/$eval.ts deleted file mode 100644 index 8d972f78a..000000000 --- a/lib/aoi.js/src/functions/discord/misc/$eval.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { type Scope, parseString } from '../../../index.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - convertToBool, - escapeResult, -} from '../../../util/transpilerHelpers.js'; -export const $eval: FunctionData = { - name: '$eval', - type: 'function', - brackets: true, - optional: false, - fields: [ - { - name: 'output', - type: 'boolean', - description: 'Whether to send the output to the channel', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to evaluate', - required: true, - }, - ], - default: ['void', 'void'], - returns: 'any', - version: '7.0.0', - description: 'Evaluates the aoi.js code', - example: ` - $eval[true;$ping] // sends the ping to the channel - `, - code: (data: funcData, scope: Scope[]) => { - const [output, ...code] = data.splits; - const parsedOutput = convertToBool(output); - const currentScope = scope[scope.length - 1]; - const executedCode = `Transpiler(${parseString( - code.join(';'), - )}, {sendMessage: ${parsedOutput} ,minify: false }).func(__$DISCORD_DATA$__);\n`; - const res = escapeResult(` - ${executedCode} - `); - if ( - !currentScope.packages.includes( - 'const { Transpiler } = await import(\'./transpiler.js\');', - ) - ) { - currentScope.packages += 'const { Transpiler } = await import(\'./transpiler.js\');\n'; - } - - currentScope.rest = currentScope.rest.replace(data.total, res); - - data.funcs = []; - return { - code: res, - scope: scope, - data: data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/misc/index.ts b/lib/aoi.js/src/functions/discord/misc/index.ts deleted file mode 100644 index 92fc28448..000000000 --- a/lib/aoi.js/src/functions/discord/misc/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './$eval.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/discord/user/$authorAvatar.ts b/lib/aoi.js/src/functions/discord/user/$authorAvatar.ts deleted file mode 100644 index 366c06e3b..000000000 --- a/lib/aoi.js/src/functions/discord/user/$authorAvatar.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, -} from '../../../util/transpilerHelpers.js'; - -export const $authorAvatar: FunctionData = { - name: '$authorAvatar', - type: 'getter', - brackets: false, - optional: true, - fields: [ - { - name: 'size', - type: 'number', - description: 'The size of the avatar', - required: false, - }, - { - name: 'dynamic', - type: 'boolean', - description: 'Whether the avatar is dynamic', - required: false, - }, - { - name: 'format', - type: 'string', - description: 'The format of the avatar', - required: false, - }, - ], - version: '7.0.0', - default: ['1024', 'true', '\'png\''], - returns: 'string', - description: 'Returns the avatar of the author', - example: ` - $authorAvatar // returns the avatar of the author - - $authorAvatar[4096;true;png] // returns the avatar of the author with size 4096, dynamic true and format png - `, - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - - const [size = 1024, dynamic = true, format = '\'png\''] = data.splits; - - const avatar = `__$DISCORD_DATA$__.author?.avatarUrl({size: ${size}, dynamic: ${dynamic}, format: ${format} })`; - - const res = escapeResult(`(${avatar})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/user/$authorId.ts b/lib/aoi.js/src/functions/discord/user/$authorId.ts deleted file mode 100644 index c36145a51..000000000 --- a/lib/aoi.js/src/functions/discord/user/$authorId.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, -} from '../../../util/transpilerHelpers.js'; - -export const $authorId: FunctionData = { - name: '$authorId', - type: 'getter', - brackets: false, - optional: false, - fields: [], - version: '7.0.0', - default: [], - returns: 'bigint', - description: 'Returns the id of the author', - example: 'author id is `$authorId`', - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - - const authorId = '__$DISCORD_DATA$__.author?.id'; - - const res = escapeResult(`(${authorId})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/user/$authorName.ts b/lib/aoi.js/src/functions/discord/user/$authorName.ts deleted file mode 100644 index 466a10900..000000000 --- a/lib/aoi.js/src/functions/discord/user/$authorName.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, -} from '../../../util/transpilerHelpers.js'; - -export const $authorName: FunctionData = { - name: '$authorName', - type: 'getter', - brackets: false, - optional: false, - fields: [], - version: '7.0.0', - default: [], - returns: 'string', - description: 'Returns the name of the author', - example: 'author name is `$authorName`', - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - - const authorName = '__$DISCORD_DATA$__.author?.username'; - - const res = escapeResult(`(${authorName})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/user/$authorTag.ts b/lib/aoi.js/src/functions/discord/user/$authorTag.ts deleted file mode 100644 index b697625b1..000000000 --- a/lib/aoi.js/src/functions/discord/user/$authorTag.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, -} from '../../../util/transpilerHelpers.js'; - -export const $authorTag: FunctionData = { - name: '$authorTag', - type: 'getter', - brackets: false, - optional: false, - fields: [], - version: '7.0.0', - default: [], - returns: 'string', - description: 'Returns the tag of the author', - example: 'author tag is `$authorTag`', - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - - const authorTag = '__$DISCORD_DATA$__.author?.tag'; - - const res = escapeResult(`(${authorTag})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/user/$userAvatar.ts b/lib/aoi.js/src/functions/discord/user/$userAvatar.ts deleted file mode 100644 index b32805c50..000000000 --- a/lib/aoi.js/src/functions/discord/user/$userAvatar.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, -} from '../../../util/transpilerHelpers.js'; - -export const $userAvatar: FunctionData = { - name: '$userAvatar', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'user', - type: 'bigint', - description: 'Id of the user', - required: false, - }, - { - name: 'size', - type: 'number', - description: 'Size of the avatar', - required: false, - }, { - name: 'dynamic', - type: 'boolean', - description: 'Whether the avatar is dynamic', - required: false, - }, { - name: 'format', - type: 'string', - description: 'The format of the avatar', - required: false, - }, - ], - version: '7.0.0', - default: [ - 'void', - '1024', - 'true', - '\'png\'', - ], - returns: 'string', - description: 'Returns the avatar of the user', - example: ` - $userAvatar // returns the avatar of the user - - $userAvatar[123456789012345678n;4096;true;png] // returns the avatar of the user with size 4096, dynamic true and format png - `, - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - - const [id, size = 1024, dynamic = true, format = '\'png\''] = data.splits; - - const avatar = `(await __$DISCORD_DATA$__.bot.util.getUser(${id}))?.avatarUrl({size: ${size}, dynamic: ${dynamic}, format: ${format} }`; - - const res = escapeResult(`${avatar}`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/user/$userId.ts b/lib/aoi.js/src/functions/discord/user/$userId.ts deleted file mode 100644 index bc23384bc..000000000 --- a/lib/aoi.js/src/functions/discord/user/$userId.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { TranspilerError } from '../../../index.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $userId: FunctionData = { - name: '$userId', - type: 'getter', - brackets: true, - optional: false, - fields: [{ name: 'username', type: 'string', required: true, description: 'The username of the user' }], - version: '7.0.0', - default: ['void'], - returns: 'bigint', - description: 'Returns the id of the user ( provided user should have mutual servers with the bot )', - example: ` - $userId[leref] // returns the id of the user with provided username - `, - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - const name = data.inside; - if ( - name === '' && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires a username.`); - } - - const userId = `(await __$DISCORD_DATA$__.bot.util.findUser(\`${name}\`))?.id`; - - const res = escapeResult(`(${userId})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/user/$userTag.ts b/lib/aoi.js/src/functions/discord/user/$userTag.ts deleted file mode 100644 index 95b1aeafe..000000000 --- a/lib/aoi.js/src/functions/discord/user/$userTag.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $userTag: FunctionData = { - name: '$userTag', - type: 'getter', - brackets: true, - optional: true, - fields: [ - { - name: 'user', - type: 'bigint', - required: false, - }, - ], - version: '7.0.0', - default: ['authorId'], - returns: 'string', - description: 'Returns the tag of the user', - example: ` - $userTag // returns the tag of the author - - $userTag[123456789012345678] // returns the tag of the user with id 123456789012345678 - `, - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - - const userTag = data.inside ? `(await __$DISCORD_DATA$__.bot.util.getUser(${parseResult(data.inside)}))?.tag` : '__$DISCORD_DATA$__.author?.tag'; - - const res = escapeResult(`(${userTag})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/user/$username.ts b/lib/aoi.js/src/functions/discord/user/$username.ts deleted file mode 100644 index dab8dc108..000000000 --- a/lib/aoi.js/src/functions/discord/user/$username.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, -} from '../../../util/transpilerHelpers.js'; - -export const $username: FunctionData = { - name: '$username', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'user', - type: 'bigint', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'string', - description: 'Returns the name of the user', - example: ` - $username[$authorId] // returns the name of the author - - $username[123456789012345678] // returns the name of the user with id 123456789012345678 - `, - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - - const id = data.inside; - - const username = `(await __$DISCORD_DATA$__.bot.util.getUser(${id}))?.username`; - - const res = escapeResult(`(${username})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/discord/user/index.ts b/lib/aoi.js/src/functions/discord/user/index.ts deleted file mode 100644 index af3897b8a..000000000 --- a/lib/aoi.js/src/functions/discord/user/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './$authorId.js'; -export * from './$authorName.js'; -export * from './$authorTag.js'; -export * from './$authorAvatar.js'; - -export * from './$userId.js'; -export * from './$username.js'; -export * from './$userTag.js'; -export * from './$userAvatar.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/index.ts b/lib/aoi.js/src/functions/index.ts index 841cb0d06..7fff748c0 100644 --- a/lib/aoi.js/src/functions/index.ts +++ b/lib/aoi.js/src/functions/index.ts @@ -1,12 +1,2 @@ -import { type FunctionData } from '../typings/interfaces.js'; -import * as JSFuncs from './js/index.js'; -import * as DiscordFuncs from './discord/index.js'; - -export { JSFuncs, DiscordFuncs }; - -const functions: Record = { - ...JSFuncs, - ...DiscordFuncs, -}; - -export default functions; +export * from './js/index.js'; +export * from './discord/index.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/README.md b/lib/aoi.js/src/functions/js/README.md deleted file mode 100644 index 7a3168bb7..000000000 --- a/lib/aoi.js/src/functions/js/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# JavaScript - -## Directory Structure - -```mermaid -graph RL; -$arrayAt --> array; -$arrayConcat --> array; -$arrayCreate --> array; -$arrayEvery --> array; -$arrayFilter --> array; -$arrayFind --> array; -$arrayForEach --> array; -$arrayIncludes --> array; -$arrayIndexOf --> array; -$arrayJoin --> array; -$arrayLastIndexOf --> array; -$arrayLength --> array; -$arrayMap --> array; -$arrayPop --> array; -$and --> conditions; -$case --> conditions; -$checkCondition --> conditions; -$default --> conditions; -$else --> conditions; -$elseif --> conditions; -$if --> conditions; -$onlyif --> conditions; -$or --> conditions; -$switch --> conditions; -$forIn --> loops; -$loop --> loops; -$while --> loops; -$abs --> maths; -$divide --> maths; -$math --> maths; -$modulo --> maths; -$multi --> maths; -$pow --> maths; -$root --> maths; -$round --> maths; -$sub --> maths; -$sum --> maths; -$truncate --> maths; -$break --> misc; -$catch --> misc; -$comment --> misc; -$env --> misc; -$finally --> misc; -$get --> misc; -$inc --> misc; -$jseval --> misc; -$let --> misc; -$log --> misc; -$passData --> misc; -$try --> misc; -$useComponent --> misc; -$addObjectProperty --> object; -$cloneObject --> object; -$createObject --> object; -$deleteObjectProperty --> object; -$getObject --> object; -$getObjectKeys --> object; -$getObjectProperty --> object; -$getObjectValues --> object; -$objectExists --> object; -$cpu --> process; -$ram --> process; -$includes --> string; -$toString --> string; - -``` - -## Divisions - - - `array`: Contains functions related to array - - `conditions`: Contains functions related to conditions - - `loops`: Contains functions related to loops - - `maths`: Contains functions related to maths - - `misc`: Contains functions related to misc - - `object`: Contains functions related to object - - `process`: Contains functions related to process - - `string`: Contains functions related to string; diff --git a/lib/aoi.js/src/functions/js/array/$arrayAt.ts b/lib/aoi.js/src/functions/js/array/$arrayAt.ts deleted file mode 100644 index a0cee27c8..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayAt.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, -} from '../../../util/transpilerHelpers.js'; -export const $arrayAt: FunctionData = { - name: '$arrayAt', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'index', - type: 'number', - description: 'The index of the array', - required: true, - }, - ], - description: 'returns the value of the array at the specified index', - default: ['void', 'void'], - returns: 'any', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya] - $arrayAt[myArray;1] // returns "hello" - $arrayAt[myArray;2] // returns "world" - $arrayAt[myArray;-1] // returns "nya" - `, - code: (data: funcData, scope: Scope[]) => { - const [name, index] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Variable ${name} doesn't exist`, - ); - - const parsedIndex = (Number(index) < 0 ? Number(index) : Number(index) - 1); - if ( - isNaN(parsedIndex) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError(`${data.name}: Index must be a number`); - - const res = escapeResult(`${escapeVars(name)}?.at(${parsedIndex})`); - currentScope.update(res, data); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayConcat.ts b/lib/aoi.js/src/functions/js/array/$arrayConcat.ts deleted file mode 100644 index 3f1e5cf0e..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayConcat.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, -} from '../../../util/transpilerHelpers.js'; -export const $arrayConcat: FunctionData = { - name: '$arrayConcat', - brackets: true, - optional: false, - type: 'setter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'values', - type: 'string[]', - description: 'The arrays to concatenate', - required: true, - }, - ], - description: 'concatenates the specified values to the array', - default: ['void', 'void'], - returns: 'void', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world] - $arrayCreate[myNextArray;nya] - - $arrayConcat[myArray;myNextArray] // myArray is now ["hello", "world", "nya"] - `, - code: (data: funcData, scope: Scope[]) => { - const [name, ...values] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - currentScope.objects[name] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Variable ${name} already exists`, - ); - if ( - !currentScope.variables.every((x) => values.includes(x)) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: array ${values - .filter((x) => !currentScope.variables.includes(x)) - .join(', ')} do(es) not exist`, - ); - - currentScope.variables.push(name); - const parsedValues = values.map((v) => escapeVars(v)); - const res = escapeResult( - `const ${escapeVars(name)} = [...${parsedValues.join(', ...')}];`, - ); - currentScope.update(res, data); - - return { - code: '', - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayCreate.ts b/lib/aoi.js/src/functions/js/array/$arrayCreate.ts deleted file mode 100644 index d64fbafa7..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayCreate.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { StringObject, parseStringObject } from '../../../index.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - parseData, -} from '../../../util/transpilerHelpers.js'; -export const $arrayCreate: FunctionData = { - name: '$arrayCreate', - brackets: true, - optional: false, - type: 'setter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'values', - type: 'unknown', - description: 'The values to create the array with', - required: true, - }, - ], - description: 'creates an array with the specified values', - default: ['void', 'void'], - returns: 'void', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya] - $arrayCreate[myNextArray;1;2;3] - `, - code: (data: funcData, scope: Scope[]) => { - const [name, ...values] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - currentScope.objects[name] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Variable ${name} already exists`, - ); - const parsedValues = values.map((v) => parseData(v)); - const currentObj = new StringObject('['); - currentObj.addEnd(']'); - - const array = parseStringObject( - `[${parsedValues.join(' , ')}]`, - currentObj, - ); - - currentScope.objects[name] = array; - currentScope.variables.push(name); - - const res = escapeResult( - `const ${escapeVars(name)} = ${array.solve()};`, - ); - currentScope.update(res, data); - - return { - code: '', - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayEvery.ts b/lib/aoi.js/src/functions/js/array/$arrayEvery.ts deleted file mode 100644 index dae7bdc19..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayEvery.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { Transpiler, conditionLexer, functions } from '../../../index.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - getFunctionList, - parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $arrayEvery: FunctionData = { - name: '$arrayEvery', - brackets: true, - optional: false, - type: 'scope_getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'query', - type: 'function', - description: 'The query to check', - required: true, - }, - ], - description: 'checks if every element in the array passes the test', - default: ['void', 'void'], - returns: 'boolean', - version: '7.0.0', - example: ` - $arrayCreate[myArray;1;2;3;4;5] - $arrayEvery[myArray;$env[array_element]<=;5] // returns true - $arrayEvery[myArray;$env[array_element]>=;5] // returns false - `, - code: (data: funcData, scope: Scope[]) => { - const [name, ...values] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Variable ${name} does not exists`, - ); - - const condition = values.join(';'); - const conditionFunctionList = getFunctionList( - condition, - Object.keys(functions), - ); - let executedCondition; - if (conditionFunctionList.length) { - executedCondition = Transpiler(condition, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: [...currentScope.env, 'array_element'], - }, - client: currentScope.client, - }); - currentScope.functions += - executedCondition.scope[0].functions + '\n'; - currentScope.packages += executedCondition.scope[0].packages; - executedCondition = executedCondition.code; - } else { - executedCondition = condition; - } - - executedCondition = conditionLexer(executedCondition); - - executedCondition = executedCondition.solve(); - - const res = escapeResult( - `${escapeVars(name)}.every(array_element => ${parseResult( - executedCondition, - )})`, - ); - currentScope.update(res, data); - - return { - code: res, - scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayFilter.ts b/lib/aoi.js/src/functions/js/array/$arrayFilter.ts deleted file mode 100644 index 7ba146b47..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayFilter.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { Transpiler, conditionLexer, functions } from '../../../index.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - getFunctionList, - parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $arrayFilter: FunctionData = { - name: '$arrayFilter', - brackets: true, - optional: false, - type: 'scope_getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'query', - type: 'function', - description: 'The query to check', - required: true, - }, - ], - description: 'filters the array based on the condition', - default: ['void', 'void'], - returns: 'void', - version: '7.0.0', - example: ` - $arrayCreate[myArray;1;2;3;4;5] - $arrayFilter[myArray;$env[array_element]<=;5] // returns [1,2,3,4,5] - $arrayFilter[myArray;$env[array_element]>=;5] // returns [5] - `, - code: (data: funcData, scope: Scope[]) => { - const [name, ...values] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Variable ${name} does not exists`, - ); - - const condition = values.join(';'); - const conditionFunctionList = getFunctionList( - condition, - Object.keys(functions), - ); - let executedCondition; - if (conditionFunctionList.length) { - executedCondition = Transpiler(condition, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: [...currentScope.env, 'array_element'], - }, - client: currentScope.client, - }); - currentScope.functions += - executedCondition.scope[0].functions + '\n'; - currentScope.packages += executedCondition.scope[0].packages; - executedCondition = executedCondition.code; - } else { - executedCondition = condition; - } - - executedCondition = conditionLexer(executedCondition); - - executedCondition = executedCondition.solve(); - - const res = escapeResult( - `${escapeVars(name)}.filter(array_element => ${ parseResult(executedCondition)})`, - ); - - currentScope.update(res, data); - - return { - code: res, - scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayFind.ts b/lib/aoi.js/src/functions/js/array/$arrayFind.ts deleted file mode 100644 index a538f9c42..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayFind.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { Transpiler, conditionLexer, functions } from '../../../index.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - getFunctionList, - parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $arrayFind: FunctionData = { - name: '$arrayFind', - brackets: true, - optional: false, - type: 'scope_getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'query', - type: 'function', - description: 'The query to check', - required: true, - }, - ], - description: 'finds the first element in the array based on the condition', - default: ['void', 'void'], - returns: 'any', - version: '7.0.0', - example: ` - $arrayCreate[myArray;1;2;3;4;5] - $arrayFind[myArray;$env[array_element]<=;5] // returns 1 - $arrayFind[myArray;$env[array_element]>=;5] // returns 5 - `, - code: (data: funcData, scope: Scope[]) => { - const [name, ...values] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Variable ${name} does not exists`, - ); - - const condition = values.join(';'); - const conditionFunctionList = getFunctionList( - condition, - Object.keys(functions), - ); - let executedCondition; - if (conditionFunctionList.length) { - executedCondition = Transpiler(condition, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: [...currentScope.env, 'array_element'], - }, - client: currentScope.client, - }); - currentScope.functions += - executedCondition.scope[0].functions + '\n'; - currentScope.packages += executedCondition.scope[0].packages; - executedCondition = executedCondition.code; - } else { - executedCondition = condition; - } - - executedCondition = conditionLexer(executedCondition); - - executedCondition = executedCondition.solve(); - - const res = escapeResult( - `${escapeVars(name)}.find(array_element => ${ parseResult(executedCondition)})`, - ); - - currentScope.update(res, data); - - return { - code: res, - scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayForEach.ts b/lib/aoi.js/src/functions/js/array/$arrayForEach.ts deleted file mode 100644 index 31b829e96..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayForEach.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { Transpiler, conditionLexer, functions } from '../../../index.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - getFunctionList, - parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $arrayForEach: FunctionData = { - name: '$arrayForEach', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'code', - type: 'function', - description: 'The code to execute', - required: true, - }, - ], - description: 'for each element in the array, execute the condition', - default: ['void', 'void'], - returns: 'void', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya] - $arrayForEach[myArray;$log[$env[array_element]]] // logs "hello", "world", "nya" - `, - code: (data: funcData, scope: Scope[]) => { - const [name, ...values] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Variable ${name} does not exists`, - ); - - const condition = values.join(';'); - const conditionFunctionList = getFunctionList( - condition, - Object.keys(functions), - ); - let executedCondition; - if (conditionFunctionList.length) { - executedCondition = Transpiler(condition, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: [...currentScope.env, 'array_element'], - }, - client: currentScope.client, - }); - currentScope.functions += - executedCondition.scope[0].functions + '\n'; - currentScope.packages += executedCondition.scope[0].packages; - executedCondition = executedCondition.code; - } else { - executedCondition = condition; - } - - executedCondition = conditionLexer(executedCondition); - - executedCondition = executedCondition.solve(); - - const res = escapeResult( - `${escapeVars(name)}.forEach(async array_element => { - ${parseResult(executedCondition)} - })`, - ); - - currentScope.update(res, data); - return { - code: res, - scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayIncludes.ts b/lib/aoi.js/src/functions/js/array/$arrayIncludes.ts deleted file mode 100644 index 79b07c737..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayIncludes.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $arrayIncludes: FunctionData = { - name: '$arrayIncludes', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'array', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'value', - type: 'string', - description: 'The value to check', - required: true, - }, - ], - description: 'Checks if array includes value', - default: ['void', 'void'], - returns: 'boolean', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya] - $arrayIncludes[myArray;hello] // returns true - $arrayIncludes[myArray;hi] // returns false - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, value] = data.splits; - - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Array ${name} does not exist`, - ); - - const res = escapeResult(`${escapeVars(name)}.includes(${value})`); - currentScope.update(res, data); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayIndexOf.ts b/lib/aoi.js/src/functions/js/array/$arrayIndexOf.ts deleted file mode 100644 index e0a8de3af..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayIndexOf.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, -} from '../../../util/transpilerHelpers.js'; -export const $arrayIndexOf: FunctionData = { - name: '$arrayIndexOf', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'array', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'value', - type: 'string', - description: 'The value to check', - required: true, - }, - ], - description: - 'Returns the index of the first occurrence of a value in an array, or 0 if it is not present.', - default: ['void', 'void'], - returns: 'number', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya] - $arrayIndexOf[myArray;hello] // returns 1 - - $arrayIndexOf[myArray;hi] // returns 0 - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, value] = data.splits; - - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Array ${name} does not exist`, - ); - - const res = escapeResult( - `${escapeVars(name)}.indexOf(${value}) + 1`, - ); - currentScope.update(res, data); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayJoin.ts b/lib/aoi.js/src/functions/js/array/$arrayJoin.ts deleted file mode 100644 index 88714ad7e..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayJoin.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $arrayJoin: FunctionData = { - name: '$arrayJoin', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'array', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'separator', - type: 'string', - description: 'The separator to join the array with', - required: false, - }, - ], - description: 'Joins all elements of an array into a string.', - default: ['void', ', '], - returns: 'string', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya] - $arrayJoin[myArray] // returns hello, world, nya - - $arrayJoin[myArray; | ] // returns hello | world | nya - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, separator = ', '] = data.splits; - - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Array ${name} does not exist`, - ); - - const res = escapeResult(`${escapeVars(name)}.join(${separator})`); - currentScope.update(res, data); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayLastIndexOf.ts b/lib/aoi.js/src/functions/js/array/$arrayLastIndexOf.ts deleted file mode 100644 index 460504cd2..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayLastIndexOf.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $arrayLastIndexOf: FunctionData = { - name: '$arrayLastIndexOf', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'array', - type: 'string', - description: 'The name of the array', - required: true, - }, - { - name: 'value', - type: 'string', - description: 'The value to check', - required: true, - }, - ], - description: - 'Returns the index of the last occurrence of a value in an array, or 0 if it is not present.', - default: ['void', 'void'], - returns: 'number', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya;hello] - $arrayLastIndexOf[myArray;hello] // returns 4 - - $arrayLastIndexOf[myArray;hi] // returns 0 - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, value] = data.splits; - - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Array ${name} does not exist`, - ); - - const res = escapeResult( - `${escapeVars(name)}.lastIndexOf(${value}) + 1`, - ); - currentScope.update(res, data); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayLength.ts b/lib/aoi.js/src/functions/js/array/$arrayLength.ts deleted file mode 100644 index 8bcee5bed..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayLength.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $arrayLength: FunctionData = { - name: '$arrayLength', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'array', - type: 'string', - description: 'The name of the array', - required: true, - }, - ], - description: 'Returns the length of an array.', - default: ['void'], - returns: 'number', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya] - $arrayLength[myArray] // returns 3 - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const name = data.inside!; - - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Array ${name} does not exist`, - ); - - const res = escapeResult(`${escapeVars(name)}.length`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayMap.ts b/lib/aoi.js/src/functions/js/array/$arrayMap.ts deleted file mode 100644 index 99a92502f..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayMap.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { Transpiler, functions } from '../../../index.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - getFunctionList, -} from '../../../util/transpilerHelpers.js'; -export const $arrayMap: FunctionData = { - name: '$arrayMap', - brackets: true, - optional: false, - type: 'scope_getter', - fields: [ - { - name: 'name', - type: 'string', - required: true, - }, - { - name: 'query', - type: 'function', - required: true, - }, - ], - description: 'maps the array based on the code', - default: ['void', 'void'], - returns: 'array', - version: '7.0.0', - example: ` - $arrayCreate[myArray;1;2;3;4;5] - $arrayMap[myArray;$sum[$env[array_element];1]] // returns [2,3,4,5,6] - `, - code: (data: funcData, scope: Scope[]) => { - const [name, ...values] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Variable ${name} does not exists`, - ); - - const code = values.join(';'); - - const codeFunctionList = getFunctionList(code, Object.keys(functions)); - - let executedCode; - if (codeFunctionList.length) { - executedCode = Transpiler(code, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: [...currentScope.env, 'array_element'], - }, - client: currentScope.client, - }); - currentScope.functions += executedCode.scope[0].functions + '\n'; - currentScope.packages += executedCode.scope[0].packages; - executedCode = executedCode.code; - } else { - executedCode = code; - } - - const res = escapeResult(` - ${escapeVars(name)}.map(array_element => { - ${executedCode} - })`); - - currentScope.update(res, data); - - return { - code: res, - scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/$arrayPop.ts b/lib/aoi.js/src/functions/js/array/$arrayPop.ts deleted file mode 100644 index 0ccbf22cd..000000000 --- a/lib/aoi.js/src/functions/js/array/$arrayPop.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $arrayPop: FunctionData = { - name: '$arrayPop', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'array', - type: 'string', - description: 'The name of the array', - required: true, - }, - ], - description: - 'Removes the last element from an array and returns that element. This method changes the length of the array.', - default: ['void'], - returns: 'any', - version: '7.0.0', - example: ` - $arrayCreate[myArray;hello;world;nya] - $arrayPop[myArray] // returns nya - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope.at(-1)!; - const name = data.inside!; - - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) - throw new TranspilerError( - `${data.name}: Array ${name} does not exist`, - ); - - const res = escapeResult(`${escapeVars(name)}.pop()`); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/array/index.ts b/lib/aoi.js/src/functions/js/array/index.ts deleted file mode 100644 index d0f0c324b..000000000 --- a/lib/aoi.js/src/functions/js/array/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from './$arrayCreate.js'; -export * from './$arrayAt.js'; -export * from './$arrayConcat.js'; -export * from './$arrayEvery.js'; -export * from './$arrayFilter.js'; -export * from './$arrayFind.js'; -export * from './$arrayForEach.js'; -export * from './$arrayIncludes.js'; -export * from './$arrayIndexOf.js'; -export * from './$arrayJoin.js'; -export * from './$arrayLastIndexOf.js'; -export * from './$arrayLength.js'; -export * from './$arrayMap.js'; -export * from './$arrayPop.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/conditions/$and.test.ts b/lib/aoi.js/src/functions/js/conditions/$and.test.ts new file mode 100644 index 000000000..ab4fd24cf --- /dev/null +++ b/lib/aoi.js/src/functions/js/conditions/$and.test.ts @@ -0,0 +1,82 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $and } from './$and.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $and }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToFail = '$and'; +const codeToPass = '$and[1==1;2==2]'; +const codeToTrue = '$and[1==1;2==2]'; +const codeToFalse = '$and[1==1;2==3]'; + + +void describe('$and', () => { + void it('should not compile successfully without arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFail, transpilerOptions); + }); + }); + + void it('should compile successfully with arg', () => { + const func = client.transpiler.transpile(codeToPass, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); + + void it('should return true', async () => { + // logs true + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeToTrue, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), 'true'); + }); + + void it('should return false', async () => { + // logs false + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeToFalse, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), 'false'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/conditions/$and.ts b/lib/aoi.js/src/functions/js/conditions/$and.ts index f7d3541c4..e2f6ca02b 100644 --- a/lib/aoi.js/src/functions/js/conditions/$and.ts +++ b/lib/aoi.js/src/functions/js/conditions/$and.ts @@ -1,38 +1,32 @@ -import { conditionLexer } from '../../../index.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { escapeFunctionResult, parseResult } from '../../../util/transpilerHelpers.js'; -export const $and: FunctionData = { - name: '$and', - type: 'getter', - brackets: true, - optional: false, - version: '7.0.0', - fields: [ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { parseCondition } from '@aoi.js/core/parsers/condition.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult, parseResult } from '@aoi.js/utils/Helpers/core.js'; + +const $and = new FunctionBuilder() + .setName('$and') + .setBrackets(true) + .setOptional(false) + .setType(FunctionType.Getter) + .setFields([ { - name: 'condition', - type: 'string', - description: 'The condition to check', + name: 'conditions', + type: ReturnType.Array, required: true, + description: 'conditions to check', }, - ], - default: ['void'], - returns: 'boolean', - description: 'Returns true if all conditions are true ( function version of && )', - example: ` - $and[$isNumber[1];$isNumber[2]] // returns true - $and[$isNumber[1];$isNumber[hello]] // returns false - `, - code: (data, scope) => { - const conditions = data.splits; - const currentScope = scope[scope.length - 1]; + ]) + .setReturns(ReturnType.Boolean) + .setCode((data, scopes, thisArg) => { + const conditions = thisArg.getParams(data); + const solved = parseCondition(conditions.join(' && ')).solve(); + const escaped = escapeResult( parseResult(solved) ); - const solved = conditionLexer( conditions.join( '&&' ) ).solve( ); - const res = escapeFunctionResult( parseResult(solved) ); - currentScope.update( res, data ); return { - code: res, - scope, - data, + code: escaped, + scope: scopes, }; - }, -}; + }) + .build(); + +export { $and }; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/conditions/$case.ts b/lib/aoi.js/src/functions/js/conditions/$case.ts deleted file mode 100644 index 22d3df13c..000000000 --- a/lib/aoi.js/src/functions/js/conditions/$case.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { - type FunctionData, - type funcData, - Scope, - TranspilerError, - Transpiler, - parseString, -} from '../../../index.js'; -import funcs from '../../index.js'; -import { - getFunctionList, - escapeResult, - parseData, -} from '../../../util/transpilerHelpers.js'; - -export const $case: FunctionData = { - name: '$case', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'case', - type: 'string', - description: 'The case to check', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to execute if the case is true', - required: true, - }, - ], - version: '7.0.0', - default: ['void', 'void'], - returns: 'void', - description: 'Case statement', - example: ` - $let[num;1] - $switch[$get[num]; - $case[1; - $log[hello world] - ] - $case[2; - $log[hello world 2] - ] - $default[ - $log[hello world default] - ] - ] - `, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($case.brackets) { - if ( - !data.total.startsWith($case.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - const [ caseValue, ...errorMsg ] = splits; - - const caseFunctionList = getFunctionList( - caseValue, - Object.keys( funcs ), - ); - let exeCaseValue, parsedCase; - if ( caseFunctionList.length ) { - exeCaseValue = Transpiler(caseValue, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - currentScope.functions += exeCaseValue.scope[ 0 ].functions + '\n'; - currentScope.packages += exeCaseValue.scope[ 0 ].packages; - exeCaseValue = exeCaseValue.code; - parsedCase = parseData( exeCaseValue ); - } else { - exeCaseValue = caseValue; - parsedCase = parseData(exeCaseValue); - typeof parsedCase === 'string' && - (parsedCase = parseString(parsedCase)); - } - - const hash = Math.floor(Math.random() * 100000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - errorMsg.join(';'), - true, - ); - - let executedErrorMsg; - const errorMsgFunctionList = getFunctionList( - errorMsg.join(';'), - Object.keys(funcs), - ); - if (errorMsgFunctionList.length) { - executedErrorMsg = Transpiler(errorMsg.join(';'), { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - minify: true, - }); - newscope.functions = executedErrorMsg.scope[0].functions + '\n'; - newscope.packages = executedErrorMsg.scope[0].packages + '\n'; - newscope.setters = executedErrorMsg.scope[0].setters + '\n'; - executedErrorMsg.scope[0].addReturn = true; - newscope.rest = executedErrorMsg.scope[0].rest + '\n'; - newscope.sendData = executedErrorMsg.scope[0].sendData; - } else { - executedErrorMsg = errorMsg.join(';'); - newscope.rest = executedErrorMsg + '\n'; - newscope.sendData.content = executedErrorMsg; - } - - const res = escapeResult(` - case ${parsedCase}: - ${newscope.toString()} - break; - `); - currentScope.update( res, data ); - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/conditions/$checkCondition.ts b/lib/aoi.js/src/functions/js/conditions/$checkCondition.ts deleted file mode 100644 index 153d43824..000000000 --- a/lib/aoi.js/src/functions/js/conditions/$checkCondition.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { conditionLexer } from '../../../index.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $checkCondition: FunctionData = { - name: '$checkCondition', - type: 'getter', - brackets: true, - optional: false, - version: '7.0.0', - fields: [ - { - name: 'condition', - type: 'string', - description: 'The condition to check', - required: true, - }, - ], - default: ['void'], - returns: 'boolean', - description: 'Returns true if the condition is true', - example: ` - $checkCondition[$isNumber[1]] // returns true - - $checkCondition[hello === world] // returns false - `, - code: (data, scope) => { - const conditions = data.inside!; - const currentScope = scope[scope.length - 1]; - const solved = conditionLexer(conditions).solve(); - const res = escapeResult(parseResult(solved)); - currentScope.update( res, data ); - - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/conditions/$default.ts b/lib/aoi.js/src/functions/js/conditions/$default.ts deleted file mode 100644 index 3bac13aa7..000000000 --- a/lib/aoi.js/src/functions/js/conditions/$default.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { - type FunctionData, - type funcData, - Scope, - TranspilerError, - Transpiler, -} from '../../../index.js'; -import funcs from '../../index.js'; -import { - getFunctionList, - escapeResult, -} from '../../../util/transpilerHelpers.js'; - -export const $default: FunctionData = { - name: '$default', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'code', - type: 'string', - description: 'The code to execute if the default case is true', - required: true, - }, - ], - version: '7.0.0', - default: ['void', 'void'], - returns: 'void', - description: 'Default case statement', - example: ` - $let[num;1] - $switch[$get[num]; - $case[1; - $log[hello world] - ] - $case[2; - $log[hello world 2] - ] - $default[ - $log[hello world default] - ] - ]`, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($default.brackets) { - if ( - !data.total.startsWith($default.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - const errorMsg = splits; - - const hash = Math.floor(Math.random() * 100000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - errorMsg.join(';'), - true, - ); - - let executedErrorMsg; - const errorMsgFunctionList = getFunctionList( - errorMsg.join(';'), - Object.keys(funcs), - ); - if (errorMsgFunctionList.length) { - executedErrorMsg = Transpiler(errorMsg.join(';'), { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - minify: true, - }); - newscope.functions = executedErrorMsg.scope[0].functions + '\n'; - newscope.packages = executedErrorMsg.scope[0].packages + '\n'; - newscope.setters = executedErrorMsg.scope[0].setters + '\n'; - executedErrorMsg.scope[0].addReturn = true; - newscope.rest = executedErrorMsg.scope[0].rest + '\n'; - newscope.sendData = executedErrorMsg.scope[0].sendData; - } else { - executedErrorMsg = errorMsg.join(';'); - newscope.rest = executedErrorMsg + '\n'; - newscope.sendData.content = executedErrorMsg; - } - - const res = escapeResult(` - default: - ${newscope.toString()} - break; - `); - currentScope.update( res, data ); - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/conditions/$else.ts b/lib/aoi.js/src/functions/js/conditions/$else.ts deleted file mode 100644 index 9f2042f57..000000000 --- a/lib/aoi.js/src/functions/js/conditions/$else.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { type FunctionData, type funcData, Scope, TranspilerError, Transpiler } from '../../../index.js'; -import funcs from '../../index.js'; -import { getFunctionList, escapeFunctionResult } from '../../../util/transpilerHelpers.js'; - -export const $else: FunctionData = { - name: '$else', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'code', - type: 'string', - description: 'The code to execute if the else statement is true', - required: false, - }, - ], - default: ['void'], - version: '7.0.0', - returns: 'void', - description: 'Else statement', - example: ` - $if[$ping<100; - $log[ping is less than 100] - ] - $elseIf[$ping<200; - $log[ping is less than 200] - ] - $else[ - $log[ping is greater than 200] - ]`, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($else.brackets) { - if ( - !data.total.startsWith($else.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - const [...errorMsg] = splits; - const hash = Math.floor(Math.random() * 100000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - errorMsg.join(';'), - true, - ); - - let executedErrorMsg; - const errorMsgFunctionList = getFunctionList( - errorMsg.join(';'), - Object.keys(funcs), - ); - if (errorMsgFunctionList.length) { - executedErrorMsg = Transpiler(errorMsg.join(';'), { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - env: currentScope.env, - name: currentScope.name, - objects: currentScope.objects, - }, - client: currentScope.client, - }); - newscope.functions = executedErrorMsg.scope[0].functions + '\n'; - newscope.packages = executedErrorMsg.scope[0].packages + '\n'; - newscope.setters = executedErrorMsg.scope[0].setters + '\n'; - executedErrorMsg.scope[0].addReturn = true; - newscope.rest = executedErrorMsg.scope[0].rest + '\n'; - newscope.sendData = executedErrorMsg.scope[0].sendData; - } else { - executedErrorMsg = errorMsg.join(';'); - newscope.rest = executedErrorMsg + '\n'; - newscope.sendData.content = executedErrorMsg; - } - - const res = escapeFunctionResult(` - else { - ${newscope.toString()} - } - `); - currentScope.update( res, data ); - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/conditions/$elseif.ts b/lib/aoi.js/src/functions/js/conditions/$elseif.ts deleted file mode 100644 index ae50f365c..000000000 --- a/lib/aoi.js/src/functions/js/conditions/$elseif.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { - type FunctionData, - type funcData, - Scope, - TranspilerError, - Transpiler, - conditionLexer, -} from '../../../index.js'; -import funcs from '../../index.js'; -import { getFunctionList, escapeFunctionResult } from '../../../util/transpilerHelpers.js'; - -export const $elseIf: FunctionData = { - name: '$elseIf', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'condition', - type: 'string', - description: 'The condition to check', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to execute if the else if statement is true', - required: false, - }, - ], - default: ['void', ''], - returns: 'void', - version: '7.0.0', - description: 'Else if statement', - example: ` - $if[$ping<100; - $log[ping is less than 100] - ] - $elseIf[$ping<200; - $log[ping is less than 200] - ] - $else[ - $log[ping is greater than 200] - ] - `, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($elseIf.brackets) { - if ( - !data.total.startsWith($elseIf.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - const [condition, ...errorMsg] = splits; - const conditionFunctionList = getFunctionList( - condition, - Object.keys(funcs), - ); - let executedCondition; - if (conditionFunctionList.length) { - executedCondition = Transpiler(condition, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - env: currentScope.env, - name: currentScope.name, - objects: currentScope.objects, - }, - client: currentScope.client, - }); - currentScope.functions += - executedCondition.scope[0].functions + '\n'; - currentScope.packages += executedCondition.scope[0].packages; - executedCondition = executedCondition.code; - } else { - executedCondition = condition; - } - - executedCondition = conditionLexer(executedCondition); - executedCondition = executedCondition.solve(); - const hash = Math.floor(Math.random() * 100000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - errorMsg.join(';'), - true, - ); - - let executedErrorMsg; - const errorMsgFunctionList = getFunctionList( - errorMsg.join(';'), - Object.keys(funcs), - ); - if (errorMsgFunctionList.length) { - executedErrorMsg = Transpiler(errorMsg.join(';'), { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - env: currentScope.env, - name: currentScope.name, - objects: currentScope.objects, - }, - client: currentScope.client, - }); - newscope.functions = executedErrorMsg.scope[0].functions + '\n'; - newscope.packages = executedErrorMsg.scope[0].packages + '\n'; - newscope.setters = executedErrorMsg.scope[0].setters + '\n'; - executedErrorMsg.scope[0].addReturn = true; - newscope.rest = executedErrorMsg.scope[0].rest + '\n'; - newscope.sendData = executedErrorMsg.scope[0].sendData; - } else { - executedErrorMsg = errorMsg.join(';'); - newscope.rest = executedErrorMsg + '\n'; - newscope.sendData.content = executedErrorMsg; - } - - const res = escapeFunctionResult(` - else if(${executedCondition}) { - ${newscope.toString()} - } - `); - currentScope.update( res, data ); - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/conditions/$if.ts b/lib/aoi.js/src/functions/js/conditions/$if.ts deleted file mode 100644 index c7f831bfe..000000000 --- a/lib/aoi.js/src/functions/js/conditions/$if.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { type FunctionData, type funcData, Scope, TranspilerError, Transpiler, conditionLexer } from '../../../index.js'; -import funcs from '../../index.js'; -import { getFunctionList, escapeFunctionResult } from '../../../util/transpilerHelpers.js'; - -export const $if: FunctionData = { - name: '$if', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'condition', - type: 'string', - description: 'The condition to check', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to execute if the if statement is true', - required: true, - }, - ], - version: '7.0.0', - default: ['void', 'void'], - returns: 'void', - description: 'If statement', - example: ` - $if[$ping<100; - $log[ping is less than 100] - ] - $elseIf[$ping<200; - $log[ping is less than 200] - ] - $else[ - $log[ping is greater than 200] - ] - `, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($if.brackets) { - if ( - !data.total.startsWith($if.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - const [condition, ...errorMsg] = splits; - const conditionFunctionList = getFunctionList( - condition, - Object.keys(funcs), - ); - let executedCondition; - if (conditionFunctionList.length) { - executedCondition = Transpiler(condition, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - currentScope.functions += - executedCondition.scope[0].functions + '\n'; - currentScope.packages += executedCondition.scope[0].packages; - executedCondition = executedCondition.code; - } else { - executedCondition = condition; - } - - executedCondition = conditionLexer(executedCondition); - - executedCondition = executedCondition.solve(); - - const hash = Math.floor(Math.random() * 100000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - errorMsg.join(';'), - true, - ); - - let executedErrorMsg; - const errorMsgFunctionList = getFunctionList( - errorMsg.join(';'), - Object.keys(funcs), - ); - if (errorMsgFunctionList.length) { - executedErrorMsg = Transpiler(errorMsg.join(';'), { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - newscope.functions = executedErrorMsg.scope[0].functions + '\n'; - newscope.packages = executedErrorMsg.scope[0].packages + '\n'; - newscope.setters = executedErrorMsg.scope[0].setters + '\n'; - executedErrorMsg.scope[0].addReturn = true; - newscope.rest = executedErrorMsg.scope[0].rest + '\n'; - newscope.sendData = executedErrorMsg.scope[0].sendData; - } else { - executedErrorMsg = errorMsg.join(';'); - newscope.rest = executedErrorMsg + '\n'; - newscope.sendData.content = executedErrorMsg; - } - - const res = escapeFunctionResult(` - if(${executedCondition}) { - ${newscope.toString()} - } - `); - currentScope.update( res, data ); - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/conditions/$onlyif.ts b/lib/aoi.js/src/functions/js/conditions/$onlyif.ts deleted file mode 100644 index e75209638..000000000 --- a/lib/aoi.js/src/functions/js/conditions/$onlyif.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { type FunctionData, type funcData, Scope, TranspilerError, Transpiler, conditionLexer } from '../../../index.js'; -import funcs from '../../index.js'; -import { getFunctionList, escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $onlyIf: FunctionData = { - name: '$onlyIf', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'condition', - type: 'string', - description: 'The condition to check', - required: true, - }, - { - name: 'errorMsg', - type: 'string', - description: 'The error message to send if the condition is false', - required: false, - }, - ], - version: '7.0.0', - default: ['void', ''], - returns: 'void', - description: 'onlyIf statement', - example: ` - $onlyIf[$ping<100; - $log[ping is less than 100] - ]`, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($onlyIf.brackets) { - if ( - !data.total.startsWith($onlyIf.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - const [condition, ...errorMsg] = splits; - const conditionFunctionList = getFunctionList( - condition, - Object.keys(funcs), - ); - let executedCondition; - if (conditionFunctionList.length) { - executedCondition = Transpiler(condition, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - currentScope.functions += - executedCondition.scope[0].functions + '\n'; - currentScope.packages += executedCondition.scope[0].packages; - executedCondition = executedCondition.code; - } else { - executedCondition = condition; - } - - executedCondition = conditionLexer(executedCondition); - executedCondition = executedCondition.solve(); - const hash = Math.floor(Math.random() * 100000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - errorMsg.join(';'), - true, - ); - - let executedErrorMsg; - const errorMsgFunctionList = getFunctionList( - errorMsg.join(';'), - Object.keys(funcs), - ); - if (errorMsgFunctionList.length) { - executedErrorMsg = Transpiler(errorMsg.join(';'), { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - newscope.functions = executedErrorMsg.scope[0].functions + '\n'; - newscope.packages = executedErrorMsg.scope[0].packages + '\n'; - newscope.setters = executedErrorMsg.scope[0].setters + '\n'; - newscope.rest = executedErrorMsg.scope[0].rest + '\n'; - newscope.sendData = executedErrorMsg.scope[0].sendData; - newscope.embeds = executedErrorMsg.scope[0].embeds; - newscope.components = executedErrorMsg.scope[0].components; - newscope.files = executedErrorMsg.scope[0].files; - newscope.stickers = executedErrorMsg.scope[0].stickers; - newscope.variables = executedErrorMsg.scope[0].variables; - } else { - executedErrorMsg = errorMsg.join(';'); - newscope.rest = executedErrorMsg + '\n'; - newscope.sendData.content = executedErrorMsg; - } - - newscope.addReturn = true; - const res = escapeResult(` - if(!(${executedCondition})) { - ${newscope.toString( true )} - return ; - } - `); - currentScope.rest = currentScope.rest.replace(data.total, res); - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/conditions/$or.test.ts b/lib/aoi.js/src/functions/js/conditions/$or.test.ts new file mode 100644 index 000000000..ae9bd2672 --- /dev/null +++ b/lib/aoi.js/src/functions/js/conditions/$or.test.ts @@ -0,0 +1,82 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $or } from './$or.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $or }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToFail = '$or'; +const codeToPass = '$or[1==1;2==2]'; +const codeToTrue = '$or[1==1;2==2]'; +const codeToFalse = '$or[1==2;2==3]'; + + +void describe('$or', () => { + void it('should not compile successfully without arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFail, transpilerOptions); + }); + }); + + void it('should compile successfully with arg', () => { + const func = client.transpiler.transpile(codeToPass, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); + + void it('should return true', async () => { + // logs true + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeToTrue, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), 'true'); + }); + + void it('should return false', async () => { + // logs false + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeToFalse, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), 'false'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/conditions/$or.ts b/lib/aoi.js/src/functions/js/conditions/$or.ts index 7533e5f48..cf07a97b4 100644 --- a/lib/aoi.js/src/functions/js/conditions/$or.ts +++ b/lib/aoi.js/src/functions/js/conditions/$or.ts @@ -1,40 +1,32 @@ -import { conditionLexer } from '../../../index.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $or: FunctionData = { - name: '$or', - type: 'getter', - brackets: true, - optional: false, - version: '7.0.0', - fields: [ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { parseCondition } from '@aoi.js/core/parsers/condition.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult, parseResult } from '@aoi.js/utils/Helpers/core.js'; + +const $or = new FunctionBuilder() + .setName('$or') + .setBrackets(true) + .setOptional(false) + .setType(FunctionType.Getter) + .setFields([ { - name: 'condition', - type: 'string', - description: 'The condition to check', + name: 'conditions', + type: ReturnType.Any, required: true, + description: 'conditions to check', }, - ], - default: ['void'], - returns: 'boolean', - description: 'Returns true if any condition is true', - example: ` - $or[$isNumber[1];$isNumber[2]] // returns true - $or[$isNumber[1];$isNumber[abc]] // returns true - `, - code: (data, scope) => { - const conditions = data.splits; - const currentScope = scope[scope.length - 1]; - const solved = conditionLexer(conditions.join('||')).solve(); - - const res = escapeResult(parseResult(solved)); - currentScope.update( res, data ); + ]) + .setReturns(ReturnType.Boolean) + .setCode((data, scopes, thisArg) => { + const conditions = thisArg.getParams(data); + const solved = parseCondition(conditions.join(' || ')).solve(); + const escaped = escapeResult( parseResult(solved) ); return { - code: res, - scope, + code: escaped, + scope: scopes, }; - }, -}; + }) + .build(); + +export { $or }; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/conditions/$switch.ts b/lib/aoi.js/src/functions/js/conditions/$switch.ts deleted file mode 100644 index 360374111..000000000 --- a/lib/aoi.js/src/functions/js/conditions/$switch.ts +++ /dev/null @@ -1,142 +0,0 @@ -import { - type FunctionData, - type funcData, - Scope, - TranspilerError, - Transpiler, -} from '../../../index.js'; -import funcs from '../../index.js'; -import { - getFunctionList, - escapeResult, -} from '../../../util/transpilerHelpers.js'; - -export const $switch: FunctionData = { - name: '$switch', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'condition', - type: 'string', - description: 'The condition to check', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to execute if the switch statement is true', - required: true, - }, - ], - version: '7.0.0', - default: ['void', 'void'], - returns: 'void', - description: 'Switch statement', - example: ` - $let[num;1] - $switch[$get[num]; - $case[1; - $log[hello world] - ] - $case[2; - $log[hello world 2] - ] - $default[ - $log[hello world default] - ] - ]`, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($switch.brackets) { - if ( - !data.total.startsWith($switch.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - const [ variable, ...errorMsg ] = splits; - - let Execvariable; - - const variableFunctionList = getFunctionList( - variable, - Object.keys( funcs ), - ); - - if ( variableFunctionList.length ) { - Execvariable = Transpiler(variable, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }).code; - } else { - Execvariable = variable; - - } - - const hash = Math.floor(Math.random() * 100000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - errorMsg.join(';'), - true, - ); - - let executedErrorMsg; - const errorMsgFunctionList = getFunctionList( - errorMsg.join(';'), - Object.keys(funcs), - ); - if (errorMsgFunctionList.length) { - executedErrorMsg = Transpiler(errorMsg.join(';'), { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - parsedStringOnly: true, - }); - newscope.functions = executedErrorMsg.scope[0].functions + '\n'; - newscope.packages = executedErrorMsg.scope[0].packages + '\n'; - newscope.setters = executedErrorMsg.scope[0].setters + '\n'; - executedErrorMsg.scope[0].addReturn = true; - newscope.rest = executedErrorMsg.scope[0].rest + '\n'; - newscope.sendData = executedErrorMsg.scope[0].sendData; - } else { - executedErrorMsg = errorMsg.join(';'); - newscope.rest = executedErrorMsg + '\n'; - newscope.sendData.content = executedErrorMsg; - } - - const res = escapeResult(` - switch(${Execvariable}) { - ${newscope.rawString()} - } - `); - currentScope.update( res, data ); - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/conditions/index.ts b/lib/aoi.js/src/functions/js/conditions/index.ts deleted file mode 100644 index f813056c8..000000000 --- a/lib/aoi.js/src/functions/js/conditions/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './$and.js'; -export * from './$else.js'; -export * from './$elseif.js'; -export * from './$if.js'; -export * from './$or.js'; -export * from './$onlyif.js'; -export * from './$switch.js'; -export * from './$case.js'; -export * from './$checkCondition.js'; -export * from './$default.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/index.ts b/lib/aoi.js/src/functions/js/index.ts index 059db277d..dae9aa47a 100644 --- a/lib/aoi.js/src/functions/js/index.ts +++ b/lib/aoi.js/src/functions/js/index.ts @@ -1,8 +1,3 @@ export * from './misc/index.js'; -export * from './maths/index.js'; -export * from './object/index.js'; -export * from './loops/index.js'; -export * from './conditions/index.js'; export * from './process/index.js'; -export * from './string/index.js'; -export * from './array/index.js'; \ No newline at end of file +export * from './math/index.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/loops/$forIn.ts b/lib/aoi.js/src/functions/js/loops/$forIn.ts deleted file mode 100644 index 33ba6c99a..000000000 --- a/lib/aoi.js/src/functions/js/loops/$forIn.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { type FunctionData, TranspilerError, Transpiler } from '../../../index.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { getFunctionList, escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -import funcs from '../../index.js'; -export const $forIn: FunctionData = { - name: '$forIn', - type: 'scope', - brackets: true, - optional: false, - fields: [ - { - name: 'variable', - type: 'string', - description: 'The variable to use', - required: true, - }, { - name: 'objectName', - type: 'string', - description: 'The object to use', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to execute', - required: true, - }, - ], - version: '7.0.0', - default: ['void', 'void', 'void'], - returns: 'void', - description: 'ForIn statement', - example: ` - $createObject[object;{ - name: hello, - age: 12 - }] - $forIn[key;object;$log[key is $env[key]] - `, - code: (data, scope) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.inside?.trim() === '' || - (!data.inside && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_'))) - ) { - throw new TranspilerError( - `${data.name} function requires variable ,objectName and code`, - ); - } - - if ( - data.splits.length < 2 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} function requires objectName and code`, - ); - } - - const [ variable, objectName, ...code ] = splits; - - currentScope.env.push( variable ); - if ( currentScope.objects[ objectName ] === undefined && !currentScope.name.startsWith( '$try_' ) && !currentScope.name.startsWith( '$catch_' ) ) { - throw new TranspilerError( - `${ data.name } function requires objectName field as string`, - ); - } - - let executedCode; - const codeFunctionList = getFunctionList( - code.join(';'), - Object.keys(funcs), - ); - if (codeFunctionList.length) { - executedCode = Transpiler(code.join(';'), { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - } else { - executedCode = code.join( ';' ); - } - - const res = escapeResult(` -for(let ${variable} in ${escapeVars(objectName)}){ - ${ - typeof executedCode === 'string' - ? executedCode - : (executedCode as { code: string; scope: Scope[]; func: unknown })?.scope[0].toString(false) -} -} -`); - currentScope.update(res, data); - return { code: res, scope: scope, data }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/loops/$loop.ts b/lib/aoi.js/src/functions/js/loops/$loop.ts deleted file mode 100644 index 412ed6a4b..000000000 --- a/lib/aoi.js/src/functions/js/loops/$loop.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { - type FunctionData, - TranspilerError, - Transpiler, - parseStringObject, -} from '../../../index.js'; -import StringObject from '../../../core/structs/StringObject.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { - getFunctionList, - escapeResult, -} from '../../../util/transpilerHelpers.js'; -import funcs from '../../index.js'; -export const $loop: FunctionData = { - name: '$loop', - type: 'scope', - brackets: true, - optional: false, - fields: [ - { - name: 'times', - type: 'number', - description: 'The times to loop', - required: true, - }, - { - name: 'extraData', - type: 'json', - description: 'The extra data to send to the loop', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to execute', - required: true, - }, - ], - version: '7.0.0', - default: ['void', 'void', 'void'], - returns: 'void', - description: 'Loop statement', - example: ` - $loop[5;{name: hello, age: 12};$log[hello world]] - `, - code: (data, scope) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.inside?.trim() === '' || - (!data.inside && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_'))) - ) { - throw new TranspilerError( - `${data.name} function requires condition and code`, - ); - } - - if ( - data.splits.length < 2 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} function requires condition and code`, - ); - } - - const [times, extraData, ...code] = splits; - - if ( - isNaN(Number(times)) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} function requires times field as number`, - ); - } - - const currentObj = new StringObject('{'); - currentObj.addEnd('}'); - let object; - try { - object = parseStringObject(extraData, currentObj); - } catch (e) { - throw new TranspilerError(`${data.name}: Invalid Object Provided`); - } - - currentScope.env.push(...object.keys.map((x) => `loop_${x}`)); - currentScope.env.push('loop_index'); - let executedCode; - const codeFunctionList = getFunctionList( - code.join(';'), - Object.keys(funcs), - ); - if ( - code.join(';').startsWith('{execute:') && - code.join(';').endsWith('}') - ) { - object.keys = object.keys.map((x) => `loop_${x}`); - - const [name, type] = code - .join(';') - .split('{execute:')[1] - .split('}')[0] - .split(':'); - executedCode = `__$DISCORD_DATA$__.bot.cmds.get("${name}", "${type}").code({...__$DISCORD_DATA$__, ...${object.solve()} })`; - } else if (codeFunctionList.length) { - executedCode = Transpiler(code.join(';'), { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - } else { - executedCode = code.join(';'); - } - - const res = escapeResult(` -for(let loop_index = 0; loop_index < ${times}; loop_index++) { - ${ - typeof executedCode === 'string' - ? executedCode - : (executedCode as { code: string; scope: Scope[]; func: unknown })?.scope[0].toString(false) -} -} -`); - currentScope.update(res, data); - return { code: res, scope: scope, data }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/loops/$while.ts b/lib/aoi.js/src/functions/js/loops/$while.ts deleted file mode 100644 index 8f3649974..000000000 --- a/lib/aoi.js/src/functions/js/loops/$while.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { type FunctionData, TranspilerError, Transpiler, conditionLexer } from '../../../index.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type AsyncFunction } from '../../../typings/types.js'; -import { getFunctionList, escapeResult } from '../../../util/transpilerHelpers.js'; -import funcs from '../../index.js'; -export const $while: FunctionData = { - name: '$while', - type: 'scope', - brackets: true, - optional: false, - fields: [ - { - name: 'condition', - type: 'string', - description: 'The condition to check', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to execute if the while statement is true', - required: true, - }, - ], - version: '1.0.0', - default: ['void', 'void'], - returns: 'void', - description: 'While statement', - example: ` - $let[num;1] - $while[$get[num] < 5; - $log[hello world] - $inc[$get[num]] - ] - `, - code: (data, scope) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.inside?.trim() === '' || - (!data.inside && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_'))) - ) { - throw new TranspilerError( - `${data.name} function requires condition and code`, - ); - } - - if ( - data.splits.length < 2 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} function requires condition and code`, - ); - } - - const [ condition, ...code ] = splits; - - const conditionFunctionList = getFunctionList( - condition, - Object.keys(funcs), - ); - let executedCondition; - if (conditionFunctionList.length) { - executedCondition = Transpiler(condition, { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - currentScope.functions += - executedCondition.scope[0].functions + '\n'; - currentScope.packages += executedCondition.scope[0].packages; - executedCondition = executedCondition.code; - } else { - executedCondition = condition; - } - - executedCondition = conditionLexer(executedCondition); - executedCondition = executedCondition.solve(); - - let executedCode; - const codeFunctionList = getFunctionList( - code.join(';'), - Object.keys(funcs), - ); - if (codeFunctionList.length) { - executedCode = Transpiler(code.join(';'), { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: currentScope.name, - objects: currentScope.objects, - env: currentScope.env, - }, - client: currentScope.client, - }); - } else { - executedCode = code.join(';'); - } - - const res = escapeResult(` -while(${executedCondition}) { - ${ - typeof executedCode === 'string' - ? executedCode - : (executedCode as { code: string; scope: Scope[]; func: AsyncFunction })?.scope[0].toString(false) -} -} -`); - currentScope.update( res, data ); - return { code: res, scope: scope, data }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/loops/index.ts b/lib/aoi.js/src/functions/js/loops/index.ts deleted file mode 100644 index 2de2db1c2..000000000 --- a/lib/aoi.js/src/functions/js/loops/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './$while.js'; -export * from './$loop.js'; -export * from './$forIn.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/math/$abbreviate.test.ts b/lib/aoi.js/src/functions/js/math/$abbreviate.test.ts new file mode 100644 index 000000000..d6a9eaa9d --- /dev/null +++ b/lib/aoi.js/src/functions/js/math/$abbreviate.test.ts @@ -0,0 +1,82 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $abbreviate } from './$abbreviate.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $abbreviate }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToFail = '$abbreviate'; +const codeToPass = '$abbreviate[2000]'; +const codeToValue = '$abbreviate[2000]'; +const codeToValueWithDecimal = '$abbreviate[2000;0]'; + + +void describe('$abbreviate', () => { + void it('should not compile successfully without arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFail, transpilerOptions); + }); + }); + + void it('should compile successfully with arg', () => { + const func = client.transpiler.transpile(codeToPass, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); + + void it('should return 2.00K', async () => { + // logs true + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeToValue, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), '2.00K'); + }); + + void it('should return 2K', async () => { + // logs false + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeToValueWithDecimal, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), '2K'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/math/$abbreviate.ts b/lib/aoi.js/src/functions/js/math/$abbreviate.ts new file mode 100644 index 000000000..afe250c82 --- /dev/null +++ b/lib/aoi.js/src/functions/js/math/$abbreviate.ts @@ -0,0 +1,125 @@ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { TranspilerError } from '@aoi.js/core/Error.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; + +function _abbreviate(number: number, decimal: number) { + const SI_SYMBOLS = [ + '', + 'K', + 'M', + 'B', + 'T', + 'Qa', + 'Qi', + 'Sx', + 'Sp', + 'Oc', + 'No', + 'Dc', + 'Udc', + 'Ddc', + 'Tdc', + 'Qadc', + 'Qidc', + 'Sxdc', + 'Spdc', + 'Ocdc', + 'Nmdc', + 'Vg', + 'Uvg', + 'Dvg', + 'Tvg', + 'Qavg', + 'Qvg', + 'Sxvg', + 'Spvg', + 'Ovg', + 'Nvg', + 'Tg', + ] as const; + + const tier = Math.floor(Math.log10(Math.abs(number || 1)) / 3); + if (tier === 0) return number; + const suffix = SI_SYMBOLS[tier]; + const scale = Math.pow(10, tier * 3); + const scaled = number / scale; + return scaled.toFixed(decimal) + suffix; +} +/** + * Returns the abbreviation of provided value to decimal place + * @example + * ```aoi + * --- + * name: abbreviate + * type: basic + * --- + * + * $abbreviate[20000;2] // returns 2.00K + * ``` + */ + +const $abbreviate = new FunctionBuilder() + .setName('$abbreviate') + .setBrackets(true) + .setOptional(false) + .setFields([ + { + name: 'number', + type: ReturnType.Number, + required: true, + description: 'The number to abbreviate.', + }, + { + name: 'decimals', + type: ReturnType.Number, + required: false, + description: 'The number of decimals to keep. Defaults to 2.', + }, + ]) + .setReturns(ReturnType.String) + .setType(FunctionType.FunctionGetter) + .setCode((data, scopes, thisArg) => { + const currentScope = thisArg.getCurrentScope(scopes); + const [number, decimals] = thisArg.getParams(data); + + const parsedDecimal = Number(decimals ?? 2); + const parsedNumber = Number(number); + + if ( + isNaN(parsedNumber) && + !thisArg.canSuppressAtComp(data, currentScope) + ) { + throw TranspilerError.CompileError( + `Provided number is not a number, received ${number}`, + data, + ); + } + + if ( + isNaN(parsedDecimal) && + !thisArg.canSuppressAtComp(data, currentScope) + ) { + throw TranspilerError.CompileError( + `Provided number is not a valid decimal position, received ${decimals}`, + data, + ); + } + + thisArg.addFunction(currentScope, _abbreviate); + const resultString = thisArg.getResultString( + // @ts-expect-error - intended behaviour + () => _abbreviate('$0', '$1'), + [parsedNumber.toString(), parsedDecimal.toString()], + ); + + const result = escapeResult(resultString); + + return { + code: result, + scope: scopes, + }; + }) + .build(); + +export { $abbreviate }; diff --git a/lib/aoi.js/src/functions/js/math/$abs.test.ts b/lib/aoi.js/src/functions/js/math/$abs.test.ts new file mode 100644 index 000000000..98e93f5a6 --- /dev/null +++ b/lib/aoi.js/src/functions/js/math/$abs.test.ts @@ -0,0 +1,82 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $abs } from './$abs.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $abs }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToFail = '$abs'; +const codeToPass = '$abs[2000]'; +const codeWithPositive = '$abs[200]'; +const codeWithNegative = '$abs[-200]'; + + +void describe('$abs', () => { + void it('should not compile successfully without arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFail, transpilerOptions); + }); + }); + + void it('should compile successfully with arg', () => { + const func = client.transpiler.transpile(codeToPass, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); + + void it('should return 200 for 200', async () => { + // logs true + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeWithPositive, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), '200'); + }); + + void it('should return 200 for -200', async () => { + // logs false + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeWithNegative, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), -200); + }); +}); diff --git a/lib/aoi.js/src/functions/js/math/$abs.ts b/lib/aoi.js/src/functions/js/math/$abs.ts new file mode 100644 index 000000000..5d6964fbd --- /dev/null +++ b/lib/aoi.js/src/functions/js/math/$abs.ts @@ -0,0 +1,50 @@ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { TranspilerError } from '@aoi.js/core/Error.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeMathResult, escapeResult } from '@aoi.js/utils/Helpers/core.js'; + +const $abs = new FunctionBuilder() + .setName('$abs') + .setBrackets(true) + .setOptional(false) + .setFields([ + { + name: 'number', + type: ReturnType.Number, + required: true, + description: 'the number to get absolute value', + }, + ]) + .setReturns(ReturnType.Number) + .setType(FunctionType.Getter) + .setCode((data, scopes, thisArg) => { + const currentScope = thisArg.getCurrentScope(scopes); + + const [number] = thisArg.getParams(data); + const parsedNumber = Number(number); + + if ( + isNaN(parsedNumber) && + !thisArg.canSuppressAtComp(data, currentScope) + ) { + throw TranspilerError.CompileError( + `Provided number is not a number, received ${number}`, + data, + ); + } + + const resultString = thisArg.getResultString( + () => Math.abs('$0' as unknown as number), + [parsedNumber.toString()], + ); + + const escaped = escapeMathResult(resultString); + + return { + code: escaped, + scope: scopes, + }; + }) + .build(); + +export { $abs }; diff --git a/lib/aoi.js/src/functions/js/math/$math.test.ts b/lib/aoi.js/src/functions/js/math/$math.test.ts new file mode 100644 index 000000000..a828f7045 --- /dev/null +++ b/lib/aoi.js/src/functions/js/math/$math.test.ts @@ -0,0 +1,91 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $math } from './$math.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $math }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToFail = '$math'; +const codeToFailWithArg = '$math[hi+bye]'; +const codeToPass = '$math[2000+1]'; +const codewithBasicMath = '$math[2000/2+2-2*2]'; +const codeWithAdvMath = '$math[pow(sin(90), 2) + pow(cos(90), 2)]'; + + +void describe('$math', () => { + void it('should not compile successfully without arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFail, transpilerOptions); + }); + }); + + void it('should not compile successfully with arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFailWithArg, transpilerOptions); + }); + }); + + void it('should compile successfully with arg', () => { + const func = client.transpiler.transpile(codeToPass, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); + + void it('should return 998 for 2000/2+2-2*2', async () => { + // logs true + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codewithBasicMath, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), '998'); + }); + + void it('should return 1 for pow(sin(90), 2) + pow(cos(90), 2)', async () => { + // logs false + const orignalLog = console.log; + let logged: Record = { content: 'hi' }; + + console.log = (log: Record) => { + logged = log; + // orignalLog(log); + }; + + const { func } = client.transpiler.transpile(codeWithAdvMath, transpilerOptions); + + // @ts-expect-error: func is a function + await func?.(); + + console.log = orignalLog; + + assert.strictEqual(logged.content.toString(), '1'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/math/$math.ts b/lib/aoi.js/src/functions/js/math/$math.ts new file mode 100644 index 000000000..eea810a0e --- /dev/null +++ b/lib/aoi.js/src/functions/js/math/$math.ts @@ -0,0 +1,73 @@ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { TranspilerError } from '@aoi.js/core/Error.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeMathResult, escapeResult, parseResult } from '@aoi.js/utils/Helpers/core.js'; +import { isMathExpression } from '@aoi.js/utils/Helpers/functions.js'; + +const $math = new FunctionBuilder() + .setName('$math') + .setType(FunctionType.Getter) + .setFields([ + { + name: 'math', + type: ReturnType.String, + required: true, + description: 'The math to calculate.', + }, + ]) + .setReturns(ReturnType.Number) + .setBrackets(true) + .setOptional(false) + .setCode((data, scopes, thisArg) => { + const params = thisArg.getParams(data); + const mathExpression = params[0]; + + if ( + !mathExpression && + !thisArg.canSuppressAtComp(data, thisArg.getCurrentScope(scopes)) + ) { + throw TranspilerError.CompileError( + 'No math expression provided.', + data, + ); + } + + if ( + !isMathExpression(mathExpression) && + !thisArg.canSuppressAtComp(data, thisArg.getCurrentScope(scopes)) + ) { + throw TranspilerError.CompileError( + 'Invalid math expression provided.', + data, + ); + } + + const regex = + /(abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp|expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|tan|tanh|trunc|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2)/g; + + const math = mathExpression + ?.replaceAll(regex, 'Math.$1') + .replaceAll('EULERNUM', 'Math.E'); + + if (!math && !thisArg.canSuppressAtComp(data, thisArg.getCurrentScope(scopes))) { + throw TranspilerError.CompileError( + 'Invalid math expression provided.', + data, + ); + } + + const result = thisArg.getResultString( + () => '$0', + [math], + ); + + const escaped = escapeMathResult(parseResult(result)); + + return { + code: escaped, + scope: scopes, + }; + }) + .build(); + +export { $math }; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/math/index.ts b/lib/aoi.js/src/functions/js/math/index.ts new file mode 100644 index 000000000..e88bec873 --- /dev/null +++ b/lib/aoi.js/src/functions/js/math/index.ts @@ -0,0 +1,3 @@ +export * from './$abbreviate.js'; +export * from './$abs.js'; +export * from './$math.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/maths/$abs.ts b/lib/aoi.js/src/functions/js/maths/$abs.ts deleted file mode 100644 index d16d09b9b..000000000 --- a/lib/aoi.js/src/functions/js/maths/$abs.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $abs: FunctionData = { - name: '$abs', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'number', - type: 'number', - description: 'The number to get the absolute value from', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the Absolute value of the number', - example: ` - $abs[1] // returns 1 - $abs[-1] // returns 1 - `, - code: (data, scope) => { - const numbers = data.inside; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - if (!numbers) throw new TranspilerError(`${data.name} requires at least 1 argument`); - let abs = - numbers.includes( TranspilerCustoms.FS ) || - numbers.includes( '__$DISCORD_DATA$__' ) || - numbers.includes( TranspilerCustoms.MFS ) - ? parseResult( numbers.trim() ) - : Number( numbers ); - abs = `Math.abs(${abs})`; - - const res = escapeMathResult(`(${abs})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/maths/$divide.ts b/lib/aoi.js/src/functions/js/maths/$divide.ts deleted file mode 100644 index 72d43ef82..000000000 --- a/lib/aoi.js/src/functions/js/maths/$divide.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $divide: FunctionData = { - name: '$divide', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'numbers', - type: 'number', - description: 'The numbers to divide', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the division of the numbers', - example: ` - $divide[1;2] // returns 0.5 - $divide[1;2;3] // returns 0.16666666666666666 - `, - code: (data, scope) => { - const numbers = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - const divide = numbers - .map((x) => - x.includes(TranspilerCustoms.FS) || - x.includes('__$DISCORD_DATA$__') || - x.includes(TranspilerCustoms.MFS) - ? parseResult(x.trim()) - : Number(x), - ) - .join('/'); - - const res = escapeMathResult(`(${divide})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/maths/$math.ts b/lib/aoi.js/src/functions/js/maths/$math.ts deleted file mode 100644 index 36bb26b83..000000000 --- a/lib/aoi.js/src/functions/js/maths/$math.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, - removeF, - removeFF, - removeMF, -} from '../../../util/transpilerHelpers.js'; - -// function to check if a exression is valid js math expression -function isMathExpression(expression: string): boolean { - expression = parseResult( removeFF( removeMF( removeF( expression.trim() ) ) ) ); - const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', ',']; - const mathOperators = ['+', '-', '*', '/', '%', '**', '(', ')', '^', '|', '&', '>>', '<<']; - const MathClassFunctions = [ - 'abs', - 'acos', - 'acosh', - 'asin', - 'asinh', - 'atan', - 'atan2', - 'atanh', - 'cbrt', - 'ceil', - 'clz32', - 'cos', - 'cosh', - 'exp', - 'expm1', - 'floor', - 'fround', - 'hypot', - 'imul', - 'log', - 'log10', - 'log1p', - 'log2', - 'max', - 'min', - 'pow', - 'random', - 'round', - 'sign', - 'sin', - 'sinh', - 'sqrt', - 'tan', - 'tanh', - 'trunc', - ]; - const MathClassProperties = [ - 'EULERNUM', - 'LN10', - 'LN2', - 'LOG10E', - 'LOG2E', - 'PI', - 'SQRT1_2', - 'SQRT2', - ]; - const ops = [ - ...numbers, - ...mathOperators, - ...MathClassFunctions, - ...MathClassProperties, - ]; - - for (const op of ops) { - expression = expression.replaceAll(op, ''); - } - - return expression.trim() === ''; -} - -export const $math: FunctionData = { - name: '$math', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'expression', - type: 'number', - description: 'The math expression to evaluate', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'evaluates a math expression', - example: ` - $math[1 + 1] // returns 2 - $math[1 + 1 * 2] // returns 3 - - $math[sin(1) + cos(1)] // returns 1.3817732906760363 - `, - code: (data, scope) => { - const numbers = data.inside; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - if (numbers && !isMathExpression(numbers)) { - throw new TranspilerError( - `${data.name} requires a valid math expression`, - ); - } - - const regex = /(abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp|expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|tan|tanh|trunc|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2)/g; - const math = numbers?.replaceAll(regex, 'Math.$1').replaceAll('EULERNUM', 'Math.E'); - if ( !math ) { - throw new TranspilerError( - `${data.name} requires a valid math expression`, - ); - } - - const res = escapeMathResult(`(${parseResult(math)})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/maths/$modulo.ts b/lib/aoi.js/src/functions/js/maths/$modulo.ts deleted file mode 100644 index e5193b694..000000000 --- a/lib/aoi.js/src/functions/js/maths/$modulo.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $modulo: FunctionData = { - name: '$modulo', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'numbers', - type: 'number', - description: 'The numbers to get the modulo from', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the modulo of the numbers', - example: ` - $modulo[1;2] // returns 1 - $modulo[7;4;3] // returns 0 - `, - code: (data, scope) => { - const numbers = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - const modulo = numbers - .map((x) => - x.includes(TranspilerCustoms.FS) || - x.includes('__$DISCORD_DATA$__') || - x.includes(TranspilerCustoms.MFS) - ? parseResult(x.trim()) - : Number(x), - ) - .join('%'); - - const res = escapeMathResult(`(${modulo})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; - diff --git a/lib/aoi.js/src/functions/js/maths/$multi.ts b/lib/aoi.js/src/functions/js/maths/$multi.ts deleted file mode 100644 index e7ddcf119..000000000 --- a/lib/aoi.js/src/functions/js/maths/$multi.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $multi: FunctionData = { - name: '$multi', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'numbers', - type: 'number', - description: 'The numbers to multiply', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the multiplication of the numbers', - example: ` - $multi[1;2] // returns 2 - $multi[1;2;3] // returns 6 - `, - code: (data, scope) => { - const numbers = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - const multi = numbers - .map((x) => - x.includes(TranspilerCustoms.FS) || - x.includes('__$DISCORD_DATA$__') || - x.includes(TranspilerCustoms.MFS) - ? parseResult(x.trim()) - : Number(x), - ) - .join('*'); - - const res = escapeMathResult(`(${multi})`); - currentScope.rest = currentScope.rest.replace(data.total, res); - return { - code: res, - scope, - }; - }, -}; - diff --git a/lib/aoi.js/src/functions/js/maths/$pow.ts b/lib/aoi.js/src/functions/js/maths/$pow.ts deleted file mode 100644 index bd195a550..000000000 --- a/lib/aoi.js/src/functions/js/maths/$pow.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $pow: FunctionData = { - name: '$pow', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'numbers', - type: 'number', - description: 'The numbers to get the power from', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the power of the numbers', - example: ` - $pow[1;2] // returns 1 - $pow[7;4;3] // returns 2401 - `, - code: (data, scope) => { - const numbers = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - const pow = numbers - .map((x) => - x.includes(TranspilerCustoms.FS) || - x.includes('__$DISCORD_DATA$__') || - x.includes(TranspilerCustoms.MFS) - ? parseResult(x.trim()) - : Number(x), - ) - .join('**'); - - const res = escapeMathResult(`(${pow})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/maths/$root.ts b/lib/aoi.js/src/functions/js/maths/$root.ts deleted file mode 100644 index 913eb2608..000000000 --- a/lib/aoi.js/src/functions/js/maths/$root.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - escapeResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $root: FunctionData = { - name: '$root', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'numbers', - type: 'number', - description: 'The numbers to get the root from', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the root of the numbers', - example: ` - $root[4;2] // returns 2 - $root[27;3] // returns 3 - - $root[625;4;2] // returns 5 -`, - code: (data, scope) => { - const numbers = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - if (!currentScope.functions.includes('function nthRoot')) { - currentScope.functions += (`function nthRoot(x, n) { - try { - var negate = n % 2 == 1 && x < 0; - if(negate) - x = -x; - var possible = Math.pow(x, 1 / n); - n = Math.pow(possible, n); - if(Math.abs(x - n) < 1 && (x > 0 == n > 0)) - return negate ? -possible : possible; - } catch(e){} -}\n`); - } - - const root = numbers.map((x) => - x.includes(TranspilerCustoms.FS) || - x.includes('__$DISCORD_DATA$__') || - x.includes(TranspilerCustoms.MFS) - ? parseResult(x.trim()) - : Number(x), - ); - const rec = (a: string | number, b: string | number) => { - let ans = ''; - let i = 2; - while (i <= root.length) { - ans = `nthRoot(${a}, ${b})`; - i += 1; - a = ans; - b = root[ i - 1 ]; - } - - return ans; - }; - - const res = escapeResult(escapeMathResult(`(${rec(root[0], root[1])})`)); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; - diff --git a/lib/aoi.js/src/functions/js/maths/$round.ts b/lib/aoi.js/src/functions/js/maths/$round.ts deleted file mode 100644 index a642da68e..000000000 --- a/lib/aoi.js/src/functions/js/maths/$round.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $round: FunctionData = { - name: '$round', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'number', - type: 'number', - description: 'The number to round off', - required: true, - }, { - name: 'decimal', - type: 'number', - description: 'The decimal to round off', - required: false, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the Roundo off value of the number', - example: ` - $round[1;2] // returns 1.00 - $round[1.2;0] // returns 1 - `, - code: (data, scope) => { - const [number, decimal = '0'] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - if (!number) - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - let round = - number.includes(TranspilerCustoms.FS) || - number.includes('__$DISCORD_DATA$__') || - number.includes(TranspilerCustoms.MFS) - ? parseResult(number.trim()) - : Number( number ); - const rounddecimal = - decimal.includes( TranspilerCustoms.FS ) || - decimal.includes( '__$DISCORD_DATA$__' ) || - decimal.includes( TranspilerCustoms.MFS ) - ? parseResult( decimal.trim() ) - : Number( decimal ); - - round = `((${round}).toFixed(${rounddecimal}))`; - - const res = escapeMathResult(`(${round})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/maths/$sub.ts b/lib/aoi.js/src/functions/js/maths/$sub.ts deleted file mode 100644 index 7d3807d57..000000000 --- a/lib/aoi.js/src/functions/js/maths/$sub.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $sub: FunctionData = { - name: '$sub', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'numbers', - type: 'number', - description: 'The numbers to subtract', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the sub of the numbers', - example: ` - $sub[1;2] // returns -1 - $sub[7;4;3] // returns 0 - `, - code: (data, scope) => { - const numbers = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - const sub = numbers - .map((x) => - x.includes(TranspilerCustoms.FS) || - x.includes('__$DISCORD_DATA$__') || - x.includes(TranspilerCustoms.MFS) - ? parseResult(x.trim()) - : Number(x), - ) - .join('-'); - - const res = escapeMathResult(`(${sub})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/maths/$sum.ts b/lib/aoi.js/src/functions/js/maths/$sum.ts deleted file mode 100644 index 28c488b90..000000000 --- a/lib/aoi.js/src/functions/js/maths/$sum.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { escapeMathResult, parseResult } from '../../../util/transpilerHelpers.js'; - -export const $sum: FunctionData = { - name: '$sum', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'numbers', - type: 'number', - description: 'The numbers to add', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the sum of the numbers', - example: ` - $sum[1;2] // returns 3 - $sum[7;4;3] // returns 14 - `, - code: (data, scope) => { - const numbers = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - const sum = numbers - .map((x) => - x.includes(TranspilerCustoms.FS) || - x.includes('__$DISCORD_DATA$__') || - x.includes(TranspilerCustoms.MFS) - ? parseResult(x.trim()) - : Number(x), - ) - .join('+'); - - const res = escapeMathResult(`(${sum})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/maths/$truncate.ts b/lib/aoi.js/src/functions/js/maths/$truncate.ts deleted file mode 100644 index f8e466421..000000000 --- a/lib/aoi.js/src/functions/js/maths/$truncate.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeMathResult, - parseResult, -} from '../../../util/transpilerHelpers.js'; - -export const $truncate: FunctionData = { - name: '$truncate', - type: 'getter', - brackets: true, - optional: false, - fields: [ - { - name: 'number', - type: 'number', - description: 'The number to truncate off', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'number', - description: 'Returns the Truncate off value of the number', - example: ` - $truncate[1.22342] // returns 1 -`, - code: (data, scope) => { - const number = data.inside ?? ''; - const currentScope = scope[scope.length - 1]; - if ( - data.splits.length === 0 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - } - - if (!number) - throw new TranspilerError( - `${data.name} requires at least 1 argument`, - ); - let truncate = - number.includes(TranspilerCustoms.FS) || - number.includes('__$DISCORD_DATA$__') || - number.includes(TranspilerCustoms.MFS) - ? parseResult(number.trim()) - : Number(number); - - truncate = `(Math.trunc(${truncate}))`; - - const res = escapeMathResult(`(${truncate})`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/maths/index.ts b/lib/aoi.js/src/functions/js/maths/index.ts deleted file mode 100644 index 2f537400a..000000000 --- a/lib/aoi.js/src/functions/js/maths/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './$divide.js'; -export * from './$multi.js'; -export * from './$sub.js'; -export * from './$sum.js'; -export * from './$root.js'; -export * from './$pow.js'; -export * from './$modulo.js'; -export * from './$math.js'; -export * from './$abs.js'; -export * from './$truncate.js'; -export * from './$round.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/misc/$break.ts b/lib/aoi.js/src/functions/js/misc/$break.ts deleted file mode 100644 index fd6f871e9..000000000 --- a/lib/aoi.js/src/functions/js/misc/$break.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { type FunctionData } from '../../../index.js'; -import { escapeFunctionResult } from '../../../util/transpilerHelpers.js'; - -export const $break: FunctionData = { - name: '$break', - type: 'function', - brackets: false, - optional: false, - fields: [], - version: '7.0.0', - default: [], - returns: 'void', - description: 'Breaks out of a loop', - example: ` - - $let[i;0] - $while[$get[i] < 5 ; - $if[$get[i] == 3; $break] - $log[$get[i]] - $inc[$get[i]] - ] - // Logs 0, 1, 2 - `, - code: (data, scope) => { - const currentScope = scope[scope.length - 1]; - const res = escapeFunctionResult('break;'); - currentScope.rest = currentScope.rest.replace(data.total, res); - scope[scope.length - 1] = currentScope; - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$catch.ts b/lib/aoi.js/src/functions/js/misc/$catch.ts deleted file mode 100644 index e7b1e91fb..000000000 --- a/lib/aoi.js/src/functions/js/misc/$catch.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { type FunctionData, type funcData, Scope, TranspilerError, Transpiler } from '../../../index.js'; -import { parseResult, getFunctionList, escapeResult } from '../../../util/transpilerHelpers.js'; -import funcs from '../../index.js'; -export const $catch: FunctionData = { - name: '$catch', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'code', - type: 'string', - description: 'The code to execute if the try statement fails', - required: true, - }, - ], - version: '7.0.0', - description: 'catch statement that executes when try fails', - default: ['void'], - returns: 'void', - example: ` - $try[ - $let[;1] - ] - $catch[ - $log[ - $env[catch_error] - ] - ] - `, - code: (data: funcData, scope: Scope[]) => { - const code = data.inside; - if (!code) { - throw new TranspilerError(`${data.name}: Code Not Provided.`); - } - - const currentScope = scope[scope.length - 1]; - const hash = Math.floor(Math.random() * 1000000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - parseResult(code), - true, - ); - let codeexe; - const funcList = getFunctionList(code, Object.keys(funcs)); - if ( !funcList.length ) { - codeexe = code; - } else { - codeexe = Transpiler(code, { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: newscope.name, - env: ['catch_error'], - }, - client: currentScope.client, - }); - newscope.functions = codeexe.scope[ 0 ].functions + '\n'; - newscope.packages = codeexe.scope[ 0 ].packages + '\n'; - newscope.setters = codeexe.scope[ 0 ].setters + '\n'; - newscope.rest = codeexe.scope[ 0 ].rest + '\n'; - newscope.sendData = codeexe.scope[ 0 ].sendData; - newscope.embeds = codeexe.scope[ 0 ].embeds; - newscope.components = codeexe.scope[ 0 ].components; - newscope.files = codeexe.scope[ 0 ].files; - newscope.stickers = codeexe.scope[ 0 ].stickers; - newscope.variables = codeexe.scope[ 0 ].variables; - } - - const res = escapeResult(`catch(catch_error) { - ${newscope.toString(true)} - }`); - currentScope.rest = currentScope.rest.replace(data.total, res); - data.funcs = []; - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$comment.ts b/lib/aoi.js/src/functions/js/misc/$comment.ts deleted file mode 100644 index 41bfbe242..000000000 --- a/lib/aoi.js/src/functions/js/misc/$comment.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type Scope from '../../../core/structs/Scope.js'; -import { type funcData, type FunctionData } from '../../../typings/interfaces.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $comment: FunctionData = { - name: '$comment', - type: 'scope', - brackets: true, - optional: false, - version: '7.0.0', - fields: [ - { - name: 'comment', - type: 'string', - description: 'The comment to convert', - required: true, - }, - ], - default: ['void'], - returns: 'void', - description: 'Converts provided code to a comment', - example: ` - $comment[hello world] // returns /*hello world*/ - `, - code: (data: funcData, scope: Scope[]) => { - const comment = data.inside; - const currentScope = scope[scope.length - 1]; - const res = escapeResult(''); - currentScope.update( res, data ); - return { - code: res, - scope: scope, - data: data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$env.ts b/lib/aoi.js/src/functions/js/misc/$env.ts deleted file mode 100644 index 20ea2b5cc..000000000 --- a/lib/aoi.js/src/functions/js/misc/$env.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { TranspilerError, type Scope } from '../../../core/index.js'; - -import { type funcData, type FunctionData } from '../../../typings/interfaces.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; -export const $env: FunctionData = { - name: '$env', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'env', - type: 'string', - description: 'The env to get from the current scope', - required: true, - }, - ], - description: 'returns the value of an scoped variable of the current scope', - default: ['void'], - version: '7.0.0', - returns: '?string', - example: ` - $try[ - $let[;1] - ] - $catch[ - $log[ - $env[catch_error] - ] - ] -`, - code: (data: funcData, scope: Scope[]) => { - const env = data.inside; - const currentScope = scope[scope.length - 1]; - if ( - !env && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: ENV Not Provided.`); - } - - const mainenv = env?.split('.')[0]; - - if ( - !currentScope.env.includes((mainenv!)) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: ENV ${env} Not Found`); - } - - const res = escapeResult(`${env}`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$executionTime.ts b/lib/aoi.js/src/functions/js/misc/$executionTime.ts deleted file mode 100644 index a49fde4b9..000000000 --- a/lib/aoi.js/src/functions/js/misc/$executionTime.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type Scope from '../../../core/structs/Scope.js'; -import { type funcData, type FunctionData } from '../../../typings/interfaces.js'; -import { - escapeResult, -} from '../../../util/transpilerHelpers.js'; -export const $executionTime: FunctionData = { - name: '$executionTime', - brackets: false, - optional: false, - type: 'getter', - fields: [], - version: '7.0.0', - default: [], - returns: 'number', - description: 'Returns the execution time of the code', - example: ` - $executionTime // returns the execution time of the code - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope.at(-1)!; - - currentScope.setters = `const startTime = performance.now();\n${currentScope.setters}`; - const res = `${escapeResult('((performance.now() - startTime).toFixed(3))')}`; - currentScope.update(res, data); - - return { - code: res, - scope: scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$finally.ts b/lib/aoi.js/src/functions/js/misc/$finally.ts deleted file mode 100644 index 84d57d0c5..000000000 --- a/lib/aoi.js/src/functions/js/misc/$finally.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { type FunctionData, type funcData, Scope, TranspilerError, Transpiler } from '../../../index.js'; -import funcs from '../../index.js'; -import { parseResult, getFunctionList, escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $finally: FunctionData = { - name: '$finally', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'code', - type: 'string', - description: 'The code to execute after try and catch', - required: true, - }, - ], - version: '7.0.0', - description: 'finally statement that runs after try and catch', - default: ['void'], - returns: 'void', - example: ` - $try[ - $let[;1] - ] - $catch[ - $log[ - $env[catch_error] - ] - ] - $finally[ - $log[hello world] - ] -`, - code: (data: funcData, scope: Scope[]) => { - const code = data.inside; - if (!code) { - throw new TranspilerError(`${data.name}: Code Not Provided.`); - } - - const currentScope = scope[scope.length - 1]; - const hash = Math.floor(Math.random() * 1000000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - parseResult(code), - true, - ); - let codeexe; - const funcList = getFunctionList(code, Object.keys(funcs)); - if (!funcList.length) { - codeexe = code; - } else { - codeexe = Transpiler(code, { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: newscope.name, - objects: currentScope.objects, - }, - client: currentScope.client, - }); - newscope.functions = codeexe.scope[0].functions + '\n'; - newscope.packages = codeexe.scope[0].packages + '\n'; - newscope.setters = codeexe.scope[0].setters + '\n'; - newscope.rest = codeexe.scope[0].rest + '\n'; - newscope.sendData = codeexe.scope[0].sendData; - newscope.embeds = codeexe.scope[0].embeds; - newscope.components = codeexe.scope[0].components; - newscope.files = codeexe.scope[0].files; - newscope.stickers = codeexe.scope[0].stickers; - newscope.variables = codeexe.scope[0].variables; - } - - const res = escapeResult(`finally { - ${newscope.toString(true)} - }`); - currentScope.rest = currentScope.rest.replace(data.total, res); - data.funcs = []; - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$get.ts b/lib/aoi.js/src/functions/js/misc/$get.ts deleted file mode 100644 index 896399b35..000000000 --- a/lib/aoi.js/src/functions/js/misc/$get.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - removeSetFunc, -} from '../../../util/transpilerHelpers.js'; - -export const $get: FunctionData = { - name: '$get', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the variable to get', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'any', - description: 'Gets the value of the variable', - example: ` - $let[hello;world] - $get[hello] // returns world - `, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($get.brackets) { - if ( - !data.total.startsWith($get.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - if ( - splits.length !== 1 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires 1 argument`); - } - - const name = removeSetFunc(splits[0]); - if ( - name === '' && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires a name`); - } - - if ( - !currentScope.variables.includes(name) && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} cannot find ${name}`); - } - - const res = `${escapeResult(escapeVars(name))}`; - - currentScope.update( res, data ); - return { code: res, scope: scope }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$inc.ts b/lib/aoi.js/src/functions/js/misc/$inc.ts deleted file mode 100644 index 2ee5172b4..000000000 --- a/lib/aoi.js/src/functions/js/misc/$inc.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { type FunctionData, type funcData, TranspilerError } from '../../../index.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { escapeFunctionResult } from '../../../util/transpilerHelpers.js'; - -export const $inc: FunctionData = { - name: '$inc', - type: 'function', - brackets: true, - optional: false, - fields: [ - { - name: 'variable', - type: 'string', - description: 'The variable to increment', - required: true, - }, - { - name: 'incrementFunction', - type: 'function', - description: 'The function to increment the variable', - required: false, - }, - ], - version: '7.0.0', - default: ['void', '++'], - example: '$inc[$get[i]]', - returns: 'void', - description: 'Increments the variable', - code: (data: funcData, scope: Scope[]) => { - const [variable, ...incrementFunction] = data.splits; - const currentScope = scope[scope.length - 1]; - if ( - variable === '' && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires a variable`); - } - - if (incrementFunction.length === 0) { - incrementFunction.push('++'); - } - - const incrementFunctionString = incrementFunction.join(';'); - const res = escapeFunctionResult( - `${variable}${incrementFunctionString};`, - ); - currentScope.update( res, data ); - return { - code: res, - scope: scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$jseval.ts b/lib/aoi.js/src/functions/js/misc/$jseval.ts deleted file mode 100644 index 02dbb69ac..000000000 --- a/lib/aoi.js/src/functions/js/misc/$jseval.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { type FunctionData, type Scope, TranspilerError, type funcData, parseString } from '../../../index.js'; -import { convertToBool, escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $jseval: FunctionData = { - name: '$jseval', - brackets: true, - optional: false, - type: 'function_getter', - fields: [ - { - name: 'output', - type: 'string', - description: 'Whether to output the result of the code', - required: true, - }, - { - name: 'code', - type: 'string', - description: 'The code to evaluate', - required: true, - }, - ], - version: '1.0.0', - default: ['void', 'void'], - returns: 'any', - description: 'Evaluates the provided Js code', - example: ` - $jsEval[false;log("hello world")] - `, - code: (data: funcData, scope: Scope[]) => { - const splits = data.splits; - const [output, ...code] = splits; - const currentScope = scope[scope.length - 1]; - const parsedOutput = convertToBool(output); - if ($jseval.brackets) { - if ( - !data.total.startsWith($jseval.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - if ( - splits.length < 2 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires 2 arguments`); - } - - const Code = parseString(code.join(';')); - if ( - !currentScope.functions.includes( - 'async function __$jseval$__(Code) {', - ) - ) { - const setres = ` - async function __$jsEval$__(Code) { - try { - const evaled = await eval(Code); - return evaled; - } catch (e) { - return e; - } - }`; - currentScope.functions += escapeResult(setres) + '\n'; - } - - const res = `${escapeResult( - `await __$jsEval$__.call(__$DISCORD_DATA$__,${Code})`, - ) }`; - - currentScope.rest = currentScope.rest.replace(data.total, res); - return { - code: parsedOutput ? res : '', - scope: scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$jsonRequest.ts b/lib/aoi.js/src/functions/js/misc/$jsonRequest.ts deleted file mode 100755 index 2fdd69858..000000000 --- a/lib/aoi.js/src/functions/js/misc/$jsonRequest.ts +++ /dev/null @@ -1,138 +0,0 @@ - -import { - Scope, - StringObject, - Transpiler, - functions, - parseStringObject, -} from '../../../index.js'; -import AoiJSFunction from '../../../structures/AoiJSFunction.js'; -import { type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - getFunctionList, -} from '../../../util/transpilerHelpers.js'; - -const jsonRequest = new AoiJSFunction() - .setName('$jsonRequest') - .setType('scope_getter') - .setBrackets(true) - .setOptional(true) - .setFields([ - { - name: 'url', - type: 'string', - description: 'The url to request', - required: true, - }, - { - name: 'property', - type: 'string', - description: 'The data to access', - required: false, - }, - { - name: 'headers', - type: 'json', - description: 'The headers to send', - required: false, - }, - { - name: 'error', - type: 'string', - description: 'The error message to send if the request fails', - required: false, - }, - ]) - .setVersion('7.0.0') - .setDefault(['void', 'undefined', '{}', '{status}: {error}']) - .setReturns('string') - .setDescription('Returns the response of a json GET request') - .setExample( - ` - $jsonRequest[https://some-random-api.ml/facts/dog;fact;{};Something went wrong.] - `, - ); -jsonRequest.setCode((data: funcData, scope: Scope[], thisArg) => { - const [url, prop, headers = '{}', ...errorMsg] = thisArg.getParams(data); - if (!errorMsg.length) errorMsg.push(''); - const currentScope = thisArg.getCurrentScope(scope); - let executedErrorMsg; - const errorMsgFunctionList = getFunctionList( - errorMsg.join(';'), - Object.keys(functions), - ); - - const obj = new StringObject('{'); - obj.addEnd('}'); - - const parsedObj = parseStringObject(headers, obj); - - const hash = Math.floor(Math.random() * 100000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - errorMsg.join(';'), - true, - ); - if (errorMsgFunctionList.length) { - executedErrorMsg = Transpiler(errorMsg.join(';'), { - sendMessage: false, - scopeData: { - variables: currentScope.variables, - name: currentScope.name, - objects: currentScope.objects, - env: [...currentScope.env, 'jsonRequestError'], - }, - client: currentScope.client, - }); - newscope.env.push(...executedErrorMsg.scope[0].env); - newscope.env.push('jsonRequestError'); - newscope.functions = executedErrorMsg.scope[0].functions + '\n'; - newscope.packages = executedErrorMsg.scope[0].packages + '\n'; - newscope.setters = executedErrorMsg.scope[0].setters + '\n'; - newscope.rest = executedErrorMsg.scope[0].rest + '\n'; - newscope.sendData = executedErrorMsg.scope[0].sendData; - newscope.embeds = executedErrorMsg.scope[0].embeds; - newscope.components = executedErrorMsg.scope[0].components; - newscope.files = executedErrorMsg.scope[0].files; - newscope.stickers = executedErrorMsg.scope[0].stickers; - newscope.variables = executedErrorMsg.scope[0].variables; - } else { - executedErrorMsg = errorMsg.join(';'); - newscope.rest = executedErrorMsg + '\n'; - newscope.sendData.content = executedErrorMsg; - } - - newscope.addReturn = true; - - const res = escapeResult( prop ? ` - (await fetch(\`${url}\`,{ headers: ${parsedObj.solve()} }).then(res => res.json()).catch((jsonRequestError) => { - ${newscope.toString(true)} - const error = new Error(\`${executedErrorMsg}\`); - error.component = "jsonRequest"; - error.success = false; - throw error; - }))?.${prop}` : `(await fetch(\`${url}\`,{ headers: ${parsedObj.solve()} }).then(res => res.json()).catch((jsonRequestError) => { - ${newscope.toString(true)} - const error = new Error(\`${executedErrorMsg}\`); - error.component = "jsonRequest"; - error.success = false; - throw error; - })) - `); - - currentScope.update(res, data); - currentScope.functions += newscope.functions; - currentScope.packages += newscope.packages; - data.funcs = []; - - return { - code: res, - scope, - data, - }; -}, jsonRequest); - -export const $jsonRequest = jsonRequest.build(); diff --git a/lib/aoi.js/src/functions/js/misc/$let.test.ts b/lib/aoi.js/src/functions/js/misc/$let.test.ts new file mode 100644 index 000000000..c32aee4e0 --- /dev/null +++ b/lib/aoi.js/src/functions/js/misc/$let.test.ts @@ -0,0 +1,49 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $let } from './$let.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $let }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToFail = '$let'; +const codeToFailWithArg = '$let[hi+bye]'; +const codeToPass = '$let[hi;bye]'; + + +void describe('$let', () => { + void it('should not compile successfully without arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFail, transpilerOptions); + }); + }); + + void it('should not compile successfully with arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFailWithArg, transpilerOptions); + }); + }); + + void it('should compile successfully with arg', () => { + const func = client.transpiler.transpile(codeToPass, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/misc/$let.ts b/lib/aoi.js/src/functions/js/misc/$let.ts index e3afa1e76..6ca1a72eb 100644 --- a/lib/aoi.js/src/functions/js/misc/$let.ts +++ b/lib/aoi.js/src/functions/js/misc/$let.ts @@ -1,129 +1,76 @@ -import { TranspilerError } from '../../../core/error.js'; -import { parseString } from '../../../core/parsers/stringParser.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeVars, - parseData, - parseResult, - removeSetFunc, -} from '../../../util/transpilerHelpers.js'; +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { TranspilerError } from '@aoi.js/core/Error.js'; +import { parseString } from '@aoi.js/core/parsers/string.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult, parseData, stringify } from '@aoi.js/utils/Helpers/core.js'; -export const $let: FunctionData = { - name: '$let', - brackets: true, - optional: false, - type: 'setter', - fields: [ +/** + * define a variable with a value + * @example + * ```aoi + * --- + * name: let + * type: basic + * --- + * + * $let[variable;value] + * $get[variable] // value + * ``` + */ +const $let = new FunctionBuilder() + .setName('$let') + .setBrackets(true) + .setOptional(true) + .setFields([ { - name: 'name', - type: 'string', - description: 'The name of the variable to set', + name: 'variable', + type: ReturnType.String, required: true, + description: 'The variable name to store the value in.', }, { name: 'value', - type: 'string', - description: 'The value to set the variable to', + type: ReturnType.Any, required: true, + description: 'The value to store.', }, - ], - version: '7.0.0', - default: ['void', 'void'], - returns: 'void', - description: 'Sets the value of the variable', - example: ` - $let[hello;world] // sets the variable hello to world - `, - code: (data: funcData, scope: Scope[]) => { - let res; - const splits = data.splits; - const currentScope = scope[ scope.length - 1 ]; - // Initial Error Handling - if ($let.brackets) { - if ( - !data.total.startsWith($let.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } + ]) + .setReturns(ReturnType.Void) + .setType(FunctionType.Setter) + .setCode((data, scopes, thisArg) => { + const currentScope = thisArg.getCurrentScope(scopes); + const [variable, value] = data.splits(); - if ( - splits.length < 2 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires 2 arguments`); + if (!variable && !thisArg.canSuppressAtComp(data, currentScope)) { + throw TranspilerError.CompileError('Variable name not provided.', data); } - const name = removeSetFunc(splits[0]); - let value = parseData(removeSetFunc(splits.slice(1).join(';'))); - if ( - typeof value === 'string' && - value.includes(TranspilerCustoms.FS) && - !value.includes(TranspilerCustoms.MFS) && - !(!value.split(TranspilerCustoms.FS)[0] && !value.split(TranspilerCustoms.FE)[1]) - ) { - value = parseString(value); + if (!value && !thisArg.canSuppressAtComp(data, currentScope)) { + throw TranspilerError.CompileError('Value not provided.', data); } - // Error handling for name and value - if ( - name === '' && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires a name`); - } + let parsedValue = parseData(value); - if ( - name === value && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name} cannot be used to set itself`, - ); + if (typeof parsedValue === 'string') { + parsedValue = parseString(parsedValue); + } else { + parsedValue = stringify(parsedValue); } - if (currentScope.variables.includes(name)) { - if ( - currentScope.variables.includes(parseResult(value)) || - value.toString().startsWith(TranspilerCustoms.FS) || - (value.toString().startsWith('`') && - value.toString().endsWith('`')) || - value.toString().includes(TranspilerCustoms.MFS) - ) { - res = `${escapeVars(name)} = ${value};`; - } else { - res = `${escapeVars(name)} = \`${value}\`;`; - } - } else { - if ( - typeof value !== 'string' || - currentScope.variables.includes( - parseResult(value.toString()), - ) || - value.toString().startsWith(TranspilerCustoms.FS) || - (value.toString().startsWith('`') && - value.toString().endsWith('`')) || - value.includes(TranspilerCustoms.MFS) - ) { - res = `let ${escapeVars(name)} = ${value};`; - } else { - res = `let ${escapeVars(name)} = \`${value}\`;`; - } + const result = thisArg.defineVar(variable, parsedValue, currentScope.hasVariable(variable)); + + if (!currentScope.hasVariable(variable)) { + currentScope.addVariables(variable); } - currentScope.variables.push(name); - currentScope.update(res, data); - scope[scope.length - 1] = currentScope; + const escaped = escapeResult(result); + + return { + code: escaped, + scope: scopes, + }; + }) + .build(); - return { code: '', scope: scope }; - }, -}; +export { $let }; + \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/misc/$log.ts b/lib/aoi.js/src/functions/js/misc/$log.ts deleted file mode 100644 index 8acd1b311..000000000 --- a/lib/aoi.js/src/functions/js/misc/$log.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import fixMath from '../../../core/parsers/mathParser.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { parseString } from '../../../core/parsers/stringParser.js'; -import { type funcData, type FunctionData } from '../../../typings/interfaces.js'; -import { escapeFunctionResult } from '../../../util/transpilerHelpers.js'; -export const $log: FunctionData = { - name: '$log', - brackets: true, - optional: false, - type: 'function', - fields: [ - { - name: 'text', - type: 'string', - description: 'The text to log', - required: true, - }, - ], - version: '7.0.0', - default: ['void'], - returns: 'void', - description: 'Logs the text', - example: ` - $log[hello world] // logs hello world - `, - code: (data: funcData, scope: Scope[]) => { - - const splits = data.splits; - const currentScope = scope[scope.length - 1]; - if ($log.brackets) { - if ( - !data.total.startsWith($log.name + '[') && - (!currentScope.name.startsWith('$try_') || - !currentScope.name.startsWith('$catch_')) - ) { - throw new TranspilerError( - `${data.name} requires closure brackets`, - ); - } - } - - if ( - splits.length !== 1 && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires 1 argument`); - } - - const text = splits[0]; - if ( - text === '' && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name} requires a text`); - } - - const parsedText = parseString(fixMath(text)); - const res = `${escapeFunctionResult(`console.log(${parsedText});`)}`; - currentScope.update(res, data); - return { code: res, scope: scope, data }; - }, -}; - diff --git a/lib/aoi.js/src/functions/js/misc/$passData.ts b/lib/aoi.js/src/functions/js/misc/$passData.ts deleted file mode 100644 index 2727e0f96..000000000 --- a/lib/aoi.js/src/functions/js/misc/$passData.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { TranspilerError, type Scope } from '../../../core/index.js'; - -import { type funcData, type FunctionData } from '../../../typings/interfaces.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; -export const $passData: FunctionData = { - name: '$passData', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'passData', - type: 'string', - description: 'access the data passed to the command from another command', - required: true, - }, - ], - description: 'return the data passed to the command from another command', - default: ['void'], - version: '7.0.0', - returns: '?string', - example: ` - $passData[hello] // returns the data passed to the command from another command -`, - code: (data: funcData, scope: Scope[]) => { - const passData = data.inside; - const currentScope = scope[scope.length - 1]; - if ( - !passData && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: PASSDATA Not Provided.`); - } - - const res = escapeResult(`__$DISCORD_DATA$__${passData}`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$try.ts b/lib/aoi.js/src/functions/js/misc/$try.ts deleted file mode 100644 index 5fdd87ed1..000000000 --- a/lib/aoi.js/src/functions/js/misc/$try.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { type FunctionData, type funcData, Scope, TranspilerError, Transpiler } from '../../../index.js'; -import funcs from '../../index.js'; -import { parseResult, getFunctionList, escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $try: FunctionData = { - name: '$try', - brackets: true, - optional: false, - type: 'scope', - fields: [ - { - name: 'code', - type: 'string', - description: 'The code to execute', - required: true, - }, - ], - version: '7.0.0', - description: 'try statement that tests if a code works', - default: ['void'], - returns: 'void', - example: ` - $try[ - $let[;1] - ] - $catch[ - $log[ - $env[catch_error] - ] - ] - $finally[ - $log[hello world] - ] -`, - code: (data: funcData, scope: Scope[]) => { - const code = data.inside; - if (!code) { - throw new TranspilerError(`${data.name}: Code Not Provided.`); - } - - const currentScope = scope[scope.length - 1]; - const hash = Math.floor(Math.random() * 1000000); - const newscope = new Scope( - `${data.name}_${hash}`, - currentScope.client, - currentScope.name, - parseResult(code), - true, - ); - let codeexe; - const funcList = getFunctionList(code, Object.keys(funcs)); - if ( !funcList.length ) { - codeexe = code; - } else { - codeexe = Transpiler(code, { - sendMessage: true, - scopeData: { - variables: currentScope.variables, - embeds: currentScope.embeds, - name: newscope.name, - objects: currentScope.objects, - }, - client: currentScope.client, - }); - newscope.functions = codeexe.scope[ 0 ].functions + '\n'; - newscope.packages = codeexe.scope[ 0 ].packages + '\n'; - newscope.setters = codeexe.scope[ 0 ].setters + '\n'; - newscope.rest = codeexe.scope[ 0 ].rest + '\n'; - newscope.sendData = codeexe.scope[ 0 ].sendData; - newscope.embeds = codeexe.scope[ 0 ].embeds; - newscope.components = codeexe.scope[ 0 ].components; - newscope.files = codeexe.scope[ 0 ].files; - newscope.stickers = codeexe.scope[ 0 ].stickers; - newscope.variables = codeexe.scope[ 0 ].variables; - } - - const res = escapeResult(`try { - ${newscope.toString(true)} - }`); - currentScope.rest = currentScope.rest.replace(data.total, res); - data.funcs = []; - return { - code: res, - scope: scope, - data, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/$useComponent.ts b/lib/aoi.js/src/functions/js/misc/$useComponent.ts deleted file mode 100644 index ca0c742dd..000000000 --- a/lib/aoi.js/src/functions/js/misc/$useComponent.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { StringObject, parseStringObject } from '../../../index.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, -} from '../../../util/transpilerHelpers.js'; -export const $useComponent: FunctionData = { - name: '$useComponent', - brackets: true, - optional: false, - type: 'function_getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the component to use', - required: true, - }, - { - name: 'data', - type: 'object', - description: 'The data to pass to the component', - required: false, - }, - ], - description: 'use a component in the code', - default: ['void', 'undefined'], - returns: 'any', - version: '7.0.0', - example: ` - $useComponent[hello;{hello: world}] // executes the component hello with the data {hello: world} - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope.at(-1)!; - //code here - - const [name, ...rest] = data.splits; - const actualRestData = rest.join(';'); - - const currentObj = new StringObject('{'); - currentObj.addEnd('}'); - - const obj = parseStringObject(actualRestData, currentObj); - - const res = escapeResult(` - ${currentScope.client.returnComponent(name, obj.solve())} - `, - ); - - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/misc/index.ts b/lib/aoi.js/src/functions/js/misc/index.ts index dec65a646..613416721 100644 --- a/lib/aoi.js/src/functions/js/misc/index.ts +++ b/lib/aoi.js/src/functions/js/misc/index.ts @@ -1,15 +1 @@ -export * from './$comment.js'; -export * from './$get.js'; -export * from './$let.js'; -export * from './$log.js'; -export * from './$inc.js'; -export * from './$env.js'; -export * from './$passData.js'; -export * from './$jseval.js'; -export * from './$break.js'; -export * from './$try.js'; -export * from './$catch.js'; -export * from './$finally.js'; -export * from './$useComponent.js'; -export * from './$executionTime.js'; -export * from './$jsonRequest.js'; \ No newline at end of file +export * from './$let.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/object/$addObjectProperty.ts b/lib/aoi.js/src/functions/js/object/$addObjectProperty.ts deleted file mode 100644 index bc25aa4a9..000000000 --- a/lib/aoi.js/src/functions/js/object/$addObjectProperty.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - parseData, -} from '../../../util/transpilerHelpers.js'; -export const $addObjectProperty: FunctionData = { - name: '$addObjectProperty', - brackets: true, - optional: false, - type: 'function', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to add the property to', - required: true, - }, - { - name: 'key', - type: 'string', - description: 'The key of the property to add', - required: true, - }, - { - name: 'value', - type: 'any', - description: 'The value of the property to add', - required: true, - }, - ], - version: '7.0.0', - description: 'adds a value to the key in the object', - default: ['void', 'void', 'void'], - returns: 'void', - example: ` - $createObject[object;{key:value}] - $addObjectProperty[object;key2;value2] - $getObjectProperty[object;key2] // returns value2 - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, key, ...value] = data.splits; - const parsedValue = parseData(value.join(';')); - - if ( - !value.length && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: No Value Provided`); - } - - if ( - !currentScope.objects[name] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name}: Invalid Object Name Provided`, - ); - } - - currentScope.objects[name].addKey(key); - currentScope.objects[name].addValue(parsedValue); - const res = escapeResult(`${escapeVars(name)}.${key} = ${parsedValue}`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/$cloneObject.ts b/lib/aoi.js/src/functions/js/object/$cloneObject.ts deleted file mode 100644 index 17a464f24..000000000 --- a/lib/aoi.js/src/functions/js/object/$cloneObject.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $cloneObject: FunctionData = { - name: '$cloneObject', - brackets: true, - optional: false, - type: 'setter', - version: '7.0.0', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to clone', - required: true, - }, - { - name: 'target', - type: 'string', - description: 'The name of the object to clone to', - required: true, - }, - ], - description: 'clones an Object', - default: ['void', 'void'], - returns: 'void', - example: ` - $createObject[object;{key:value}] - $cloneObject[object;object2] - $getObjectProperty[object2;key] // returns value - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, target] = data.splits; - if ( - !currentScope.objects[name] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name}: Invalid Object Name Provided`, - ); - } - - currentScope.objects[target] = currentScope.objects[name]; - const res = escapeResult( - `const ${escapeVars(target)} = structuredClone(${escapeVars(name)});`, - ); - currentScope.update(res, data); - - return { - code: '', - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/$createObject.ts b/lib/aoi.js/src/functions/js/object/$createObject.ts deleted file mode 100644 index 702c2681c..000000000 --- a/lib/aoi.js/src/functions/js/object/$createObject.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { StringObject, parseStringObject } from '../../../index.js'; -import { TranspilerCustoms } from '../../../typings/enums.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, - parseResult, -} from '../../../util/transpilerHelpers.js'; -export const $createObject: FunctionData = { - name: '$createObject', - brackets: true, - optional: false, - type: 'setter', - version: '7.0.0', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to create', - required: true, - }, - { - name: 'object', - type: 'json', - description: 'The object to create', - required: true, - }, - ], - description: 'creates an Object', - default: ['void', 'void'], - returns: 'void', - example: ` - $createObject[object;{key:value}] - $getObjectProperty[object;key] // returns value - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, ...obj] = data.splits; - const parsedObj = obj.join(';').trim(); - if ( - !obj.length && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: No Object Provided`); - } - - const currentObj = new StringObject('{'); - currentObj.addEnd('}'); - let object; - try { - if ([TranspilerCustoms.FFS, TranspilerCustoms.FS].some(x => parsedObj.startsWith(x))) { - object = parsedObj; - } else { - if (parsedObj.startsWith('[') && parsedObj.endsWith(']')) currentObj.start = '[', currentObj.addEnd(']'); - object = parseStringObject(parsedObj, currentObj); - } - } catch (e) { - throw new TranspilerError(`${data.name}: Invalid Object Provided`); - } - - const res = escapeResult( - `const ${escapeVars(name)} = ${typeof object === 'string' ? object : parseResult(object.solve())};`, - ); - currentScope.objects[name] = object as StringObject; - currentScope.variables.push(name); - currentScope.update( res, data ); - return { - code: '', - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/$deleteObjectProperty.ts b/lib/aoi.js/src/functions/js/object/$deleteObjectProperty.ts deleted file mode 100644 index 1e9b97de9..000000000 --- a/lib/aoi.js/src/functions/js/object/$deleteObjectProperty.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $deleteObjectProperty: FunctionData = { - name: '$deleteObjectProperty', - brackets: true, - optional: false, - type: 'function', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to delete the property from', - required: true, - }, - { - name: 'key', - type: 'string', - description: 'The key of the property to delete', - required: true, - }, - ], - version: '7.0.0', - description: 'deletes the key in the object', - default: ['void', 'void' ], - returns: 'void', - example: ` - $createObject[object;{key:value}] - $deleteObjectProperty[object;key] - $getObjectProperty[object;key] // returns undefined - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, key] = data.splits; - - if ( - !key.length && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: No Key Provided`); - } - - if ( - !currentScope.objects[name] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name}: Invalid Object Name Provided`, - ); - } - - const o = currentScope.objects[name]; - const index = o.keys.indexOf(key); - o.keys.splice(index, 1); - o.values.splice(index, 1); - const res = escapeResult(`delete ${escapeVars(name)}.${key}`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/$getObject.ts b/lib/aoi.js/src/functions/js/object/$getObject.ts deleted file mode 100644 index b387f2ec3..000000000 --- a/lib/aoi.js/src/functions/js/object/$getObject.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult, escapeVars } from '../../../util/transpilerHelpers.js'; -export const $getObject: FunctionData = { - name: '$getObject', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to get', - required: true, - }, - ], - version: '7.0.0', - description: 'returns the object', - default: ['void'], - returns: 'object', - example: ` - $createObject[object;{key:value}] - $getObject[object] // returns {key:value} - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const name = data.inside; - if ( - !name && - !currentScope.name.startsWith('$try_') && - !currentScope.name.endsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: No Object Name Provided`); - } - - if ( - !currentScope.objects[name! ?? ''] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.endsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name}: Invalid Object Name Provided`, - ); - } - - if ( - !currentScope.packages.includes( - 'const UTIL = await import(\'util\');', - ) - ) { - currentScope.packages += 'const UTIL = await import(\'util\');\n'; - } - - const res = escapeResult( - `UTIL.inspect(${escapeVars((name!))},{depth:null})`, - ); - - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/$getObjectKeys.ts b/lib/aoi.js/src/functions/js/object/$getObjectKeys.ts deleted file mode 100644 index 1dd568d41..000000000 --- a/lib/aoi.js/src/functions/js/object/$getObjectKeys.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, -} from '../../../util/transpilerHelpers.js'; -export const $getObjectKeys: FunctionData = { - name: '$getObjectKeys', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to get the keys from', - required: true, - }, - ], - version: '7.0.0', - description: 'returns all the key in the object', - default: ['void'], - returns: 'void', - example: ` - $createObject[object;{key:value,key2:value2}] - $getObjectKeys[object] // returns key, key2 - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const name = data.inside!; - - if ( - !name && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: No name Provided`); - } - - if ( - !currentScope.objects[name] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name}: Invalid Object Name Provided`, - ); - } - - const res = escapeResult(`Object.keys(${escapeVars(name)}).join(", ")`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/$getObjectProperty.ts b/lib/aoi.js/src/functions/js/object/$getObjectProperty.ts deleted file mode 100644 index f3721bb41..000000000 --- a/lib/aoi.js/src/functions/js/object/$getObjectProperty.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, -} from '../../../util/transpilerHelpers.js'; -export const $getObjectProperty: FunctionData = { - name: '$getObjectProperty', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to get the property from', - required: true, - }, - { - name: 'key', - type: 'string', - description: 'The key of the property to get', - required: true, - }, - ], - version: '7.0.0', - description: 'gets the value of the key in the object', - default: ['void', 'void'], - returns: 'void', - example: ` - $createObject[object;{key:value}] - $getObjectProperty[object;key] // returns value - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [name, key ] = data.splits; - - if ( - !currentScope.objects[name] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name}: Invalid Object Name Provided`, - ); - } - - const res = escapeResult(`${escapeVars(name)}.${key}`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/$getObjectValues.ts b/lib/aoi.js/src/functions/js/object/$getObjectValues.ts deleted file mode 100644 index 9110599c7..000000000 --- a/lib/aoi.js/src/functions/js/object/$getObjectValues.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { - escapeResult, - escapeVars, -} from '../../../util/transpilerHelpers.js'; -export const $getObjectValues: FunctionData = { - name: '$getObjectValues', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to get the values from', - required: true, - }, - ], - version: '7.0.0', - description: 'returns all the values in the object', - default: ['void'], - returns: 'void', - example: ` - $createObject[object;{key:value,key2:value2}] - $getObjectValues[object] // returns value, value2 - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const name = data.inside!; - - if ( - !name && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: No name Provided`); - } - - if ( - !currentScope.objects[name] && - !currentScope.name.startsWith('$try_') && - !currentScope.name.startsWith('$catch_') - ) { - throw new TranspilerError( - `${data.name}: Invalid Object Name Provided`, - ); - } - - const res = escapeResult(`Object.values(${escapeVars(name)}).join(", ")`); - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/$objectExists.ts b/lib/aoi.js/src/functions/js/object/$objectExists.ts deleted file mode 100644 index ed54f6b02..000000000 --- a/lib/aoi.js/src/functions/js/object/$objectExists.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { TranspilerError } from '../../../core/error.js'; -import type Scope from '../../../core/structs/Scope.js'; -import { type FunctionData, type funcData } from '../../../typings/interfaces.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; -export const $objectExists: FunctionData = { - name: '$objectExists', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'name', - type: 'string', - description: 'The name of the object to check', - required: true, - }, - ], - version: '7.0.0', - description: 'returns whether object exists or not', - default: ['void'], - returns: 'object', - example: ` - $createObject[object;{key:value}] - $objectExists[object] // returns true - - $objectExists[object2] // returns false - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const name = data.inside; - if ( - !name && - !currentScope.name.startsWith('$try_') && - !currentScope.name.endsWith('$catch_') - ) { - throw new TranspilerError(`${data.name}: No Object Name Provided`); - } - - const res = escapeResult( - `${!!currentScope.objects[name! ?? '']}`, - ); - - currentScope.update(res, data); - return { - code: res, - scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/object/index.ts b/lib/aoi.js/src/functions/js/object/index.ts deleted file mode 100644 index 7f0b20f29..000000000 --- a/lib/aoi.js/src/functions/js/object/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './$addObjectProperty.js'; -export * from './$createObject.js'; -export * from './$getObjectProperty.js'; -export * from './$getObject.js'; -export * from './$deleteObjectProperty.js'; -export * from './$getObjectKeys.js'; -export * from './$getObjectValues.js'; -export * from './$cloneObject.js'; -export * from './$objectExists.js'; - -// TODO: add $findObjectProperty \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/process/$cpu.test.ts b/lib/aoi.js/src/functions/js/process/$cpu.test.ts new file mode 100644 index 000000000..f8cdb3c9b --- /dev/null +++ b/lib/aoi.js/src/functions/js/process/$cpu.test.ts @@ -0,0 +1,48 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $cpu } from './$cpu.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $cpu }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToPassWithoutArg = '$cpu'; +const codeToFailWithArg = '$cpu[hi]'; +const codeToPass = '$cpu[os]'; + + +void describe('$cpu', () => { + void it('should compile successfully without arg', () => { + + const func = client.transpiler.transpile(codeToPassWithoutArg, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); + + void it('should not compile successfully with arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFailWithArg, transpilerOptions); + }); + }); + + void it('should compile successfully with arg', () => { + const func = client.transpiler.transpile(codeToPass, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/process/$cpu.ts b/lib/aoi.js/src/functions/js/process/$cpu.ts index 0247c1a36..3869d977b 100644 --- a/lib/aoi.js/src/functions/js/process/$cpu.ts +++ b/lib/aoi.js/src/functions/js/process/$cpu.ts @@ -1,76 +1,119 @@ -import { type FunctionData, type funcData, type Scope, parseString } from '../../../index.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $cpu: FunctionData = { - name: '$cpu', - brackets: true, - optional: true, - version: '7.0.0', - type: 'function_getter', - fields: [ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { TranspilerError } from '@aoi.js/core/Error.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; +import type os from 'os'; + +/** + * Returns the CPU usage of the process or the OS. + * @example + * ```aoi + * --- + * name: cpu + * type: basic + * --- + * + * $cpu // returns the CPU usage of the process + * $cpu[os] // returns the CPU usage of the OS + * ``` + */ +const $cpu = new FunctionBuilder() + .setName('$cpu') + .setBrackets(true) + .setOptional(true) + .setType(FunctionType.FunctionGetter) + .setFields([ { name: 'type', - type: 'process|os', - description: 'The type of cpu usage to get', + type: ReturnType.String, required: false, + description: 'The type of CPU to get. Can be `process` or `os`.', }, - ], - default: ['process'], - returns: 'number', - description: 'Returns the CPU usage', - example: ` - $cpu // returns the cpu usage of the process - $cpu[os] // returns the cpu usage of the os - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const type = parseString(data.inside ?? 'process'); - let res = escapeResult(`function secNSec2ms (secNSec) { - if (Array.isArray(secNSec)) { - return secNSec[0] * 1000 + secNSec[1] / 1000000; - } - return secNSec / 1000; -} - -function __$get_cpu_usage$__(type) { - if (type === "process") { -const startTime = process.hrtime() -const startUsage = process.cpuUsage() - -const now = Date.now() -while (Date.now() - now < 100) {} - -const elapTime = process.hrtime(startTime) -var elapUsage = process.cpuUsage(startUsage) - -const elapTimeMS = secNSec2ms(elapTime) -const elapUserMS = secNSec2ms(elapUsage.user) -const elapSystMS = secNSec2ms(elapUsage.system) -const cpuPercent = (100 * (elapUserMS + elapSystMS) / elapTimeMS).toFixed(2) -return cpuPercent - } else if (type === "os") { - return ((OS.loadavg()[0] * 100)/OS.cpus().length).toFixed(2) - } else { - throw new Error(\`${data.name}: Invalid Type \${type}\`); - } -}`); - if (!currentScope.packages.includes('const OS = await import("os")')) { - currentScope.packages += 'const OS = await import("os")\n'; + ]) + .setReturns(ReturnType.String) + .setCode((data, scopes, thisArg) => { + const currentScope = thisArg.getCurrentScope(scopes); + let [type] = thisArg.getParams(data); + + if (!type) { + type = 'process'; } if ( - !currentScope.functions.includes( - 'function __$get_cpu_usage$__(type) {', - ) + !['process', 'os'].includes(type) && + !thisArg.canSuppressAtComp(data, currentScope) ) { - currentScope.functions += res + '\n'; + throw TranspilerError.CompileError(`Invalid CPU type: ${type}`, data); + } + + if (!currentScope.hasPkg('OS')) { + currentScope.addPkg('OS', 'const OS = await import("os")'); + } + + if (!currentScope.hasPkg('TRANSPILE_ERROR')) { + currentScope.addPkg( + 'TRANSPILE_ERROR', + 'const TRANSPILE_ERROR = await import("aoi.js/core/Error.js")', + ); + } + + // placeholder for the actual module + const OS = thisArg.as('OS'); + const TRANSPILE_ERROR = + thisArg.as('TRANSPILE_ERROR'); + + function secNSec2ms(secNSec: number | number[]) { + if (Array.isArray(secNSec)) { + return secNSec[0] * 1000 + secNSec[1] / 1000000; + } + + return secNSec / 1000; } - res = escapeResult(`__$get_cpu_usage$__(${type})`); - currentScope.rest = currentScope.rest.replace(data.total, res); + function __$getCPUUsage$__(type: string) { + if (type === 'process') { + const startTime = process.hrtime(); + const startUsage = process.cpuUsage(); + + const now = Date.now(); + while (Date.now() - now < 100) {} + + const elapTime = process.hrtime(startTime); + const elapUsage = process.cpuUsage(startUsage); + + const elapTimeMS = secNSec2ms(elapTime); + const elapUserMS = secNSec2ms(elapUsage.user); + const elapSystMS = secNSec2ms(elapUsage.system); + const cpuPercent = ( + (100 * (elapUserMS + elapSystMS)) / + elapTimeMS + ).toFixed(2); + return cpuPercent; + } else if (type === 'os') { + return ((OS.loadavg()[0] * 100) / OS.cpus().length).toFixed(2); + } else { + throw TRANSPILE_ERROR.RunTimeError( + `Invalid CPU type: ${type}`, + data, + ) as TranspilerError; + } + } + + thisArg.addFunction(currentScope, secNSec2ms); + thisArg.addFunction(currentScope, __$getCPUUsage$__); + + const result = thisArg.getResultString( + () => __$getCPUUsage$__('$0'), + [type], + ); + + const escaped = escapeResult(result); + return { - code: res, - scope: scope, + code: escaped, + scope: scopes, }; - }, -}; + }) + .build(); + +export { $cpu }; diff --git a/lib/aoi.js/src/functions/js/process/$cwd.test.ts b/lib/aoi.js/src/functions/js/process/$cwd.test.ts new file mode 100644 index 000000000..b937f1e2d --- /dev/null +++ b/lib/aoi.js/src/functions/js/process/$cwd.test.ts @@ -0,0 +1,32 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $cwd } from './$cwd.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $cwd }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToPassWithoutArg = '$cwd'; + + +void describe('$cwd', () => { + void it('should compile successfully without arg', () => { + + const func = client.transpiler.transpile(codeToPassWithoutArg, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/process/$cwd.ts b/lib/aoi.js/src/functions/js/process/$cwd.ts new file mode 100644 index 000000000..5306cb7e8 --- /dev/null +++ b/lib/aoi.js/src/functions/js/process/$cwd.ts @@ -0,0 +1,37 @@ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; + +/** + * Returns the current working directory of the process. + * @example + * ```aoi + * --- + * name: cwd + * type: basic + * --- + * + * $cwd // /.js + * ``` + */ +const $cwd = new FunctionBuilder() + .setName('$cwd') + .setBrackets(false) + .setOptional(false) + .setFields([]) + .setReturns(ReturnType.String) + .setType(FunctionType.Getter) + .setCode((data, scopes, thisArg) => { + const result = thisArg.getResultString( + () => process.cwd(), + ); + const escaped = escapeResult(result); + + return { + code: escaped, + scope: scopes, + }; + }) + .build(); + +export { $cwd }; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/process/$procenv.test.ts b/lib/aoi.js/src/functions/js/process/$procenv.test.ts new file mode 100644 index 000000000..e1dcf89a8 --- /dev/null +++ b/lib/aoi.js/src/functions/js/process/$procenv.test.ts @@ -0,0 +1,40 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $procenv } from './$procenv.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $procenv }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToPassWithoutArg = '$procenv'; +const codeToPassWithArg = '$procenv[hi]'; + + +void describe('$procenv', () => { + void it('should compile successfully without arg', () => { + + const func = client.transpiler.transpile(codeToPassWithoutArg, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); + + void it('should compile successfully with arg', () => { + + const func = client.transpiler.transpile(codeToPassWithArg, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/process/$procenv.ts b/lib/aoi.js/src/functions/js/process/$procenv.ts new file mode 100644 index 000000000..c04bcf0e2 --- /dev/null +++ b/lib/aoi.js/src/functions/js/process/$procenv.ts @@ -0,0 +1,57 @@ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; + +/** + * Returns the environment variable of the process for given key. + * @example + * ```aoi + * --- + * name: procenv + * type: basic + * --- + * + * $procenv // returns all environment variables as an object + * $procenv[KEY] // returns the value of the environment variable + * ``` + */ +const $procenv = new FunctionBuilder() + .setName('$procenv') + .setBrackets(true) + .setOptional(true) + .setType(FunctionType.Getter) + .setFields([ + { + name: 'key', + type: ReturnType.String, + required: false, + description: 'The key of the environment variable to get.', + }, + ]) + .setReturns(ReturnType.String | ReturnType.Object) + .setCode((data, scopes, thisArg) => { + const [key] = thisArg.getParams(data); + + if (!key) { + const result = thisArg.getResultString(() => process.env); + + const escaped = escapeResult(result); + + return { + code: escaped, + scope: scopes, + }; + } + + const result = thisArg.getResultString(() => process.env.$0, [key]); + + const escaped = escapeResult(result); + + return { + code: escaped, + scope: scopes, + }; + }) + .build(); + +export { $procenv }; diff --git a/lib/aoi.js/src/functions/js/process/$ram.test.ts b/lib/aoi.js/src/functions/js/process/$ram.test.ts new file mode 100644 index 000000000..b1111918c --- /dev/null +++ b/lib/aoi.js/src/functions/js/process/$ram.test.ts @@ -0,0 +1,47 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; + +import TestClient from '@aoi.js/testing/testClient.js'; +import { $ram } from './$ram.js'; + +const client = new TestClient(); +client.transpiler.addFunctions({ $ram }); + +const transpilerOptions = { + scopeData: { + name: 'global', + vars: [], + embeds: [], + env: [], + object: {}, + embeddedJS: [], + sendFunction: 'console.log', + }, +}; + +const codeToPassWithoutArg = '$ram'; +const codeToFail = '$ram[hi]'; +const codeWithParam = '$ram[rss]'; + +void describe('$ram', () => { + void it('should compile successfully without arg', () => { + + const func = client.transpiler.transpile(codeToPassWithoutArg, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); + + void it('should not compile successfully with arg', () => { + + // expect this to throw an error + assert.throws(() => { + client.transpiler.transpile(codeToFail, transpilerOptions); + }); + }); + + void it('should compile successfully with arg', () => { + const func = client.transpiler.transpile(codeWithParam, transpilerOptions); + assert.ok(func); + assert.strictEqual(typeof func.func, 'function'); + }); +}); diff --git a/lib/aoi.js/src/functions/js/process/$ram.ts b/lib/aoi.js/src/functions/js/process/$ram.ts index c3ffe1878..9f3a703ac 100644 --- a/lib/aoi.js/src/functions/js/process/$ram.ts +++ b/lib/aoi.js/src/functions/js/process/$ram.ts @@ -1,41 +1,69 @@ -import { type FunctionData, type funcData, type Scope } from '../../../index.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $ram: FunctionData = { - name: '$ram', - brackets: true, - optional: true, - type: 'getter', - fields: [ +import FunctionBuilder from '@aoi.js/core/builders/Function.js'; +import { TranspilerError } from '@aoi.js/core/Error.js'; +import { FunctionType, ReturnType } from '@aoi.js/typings/enum.js'; +import { escapeResult } from '@aoi.js/utils/Helpers/core.js'; + +/** + * Returns the memory usage of the process for given type. + * @example + * ```aoi + * --- + * name: ram + * type: basic + * --- + * + * $ram // returns heapUsed + * $ram[heapTotal] // returns heapTotal + * $ram[rss] // returns rss + * $ram[external] // returns external + * $ram[arrayBuffers] // returns arrayBuffers + * ``` + */ +const $ram = new FunctionBuilder() + .setName('$ram') + .setBrackets(true) + .setOptional(true) + .setType(FunctionType.Getter) + .setFields([ { name: 'type', - type: 'rss|heapUsed|heapTotal|external|arrayBuffer', - description: 'The type of ram to get', + type: ReturnType.String, required: false, + description: 'The type of memory to get. Can be `heapUsed`, `heapTotal`, `rss`, `external`, `arrayBuffers`.', + }, - ], - version: '7.0.0', - default: ['rss'], - returns: 'number', - description: 'Returns the bot\'s ram usage', - example: ` - $ram // returns the rss ram usage - $ram[heapUsed] // returns the heapUsed ram usage - $ram[heapTotal] // returns the heapTotal ram usage - $ram[external] // returns the external ram usage - $ram[arrayBuffer] // returns the arrayBuffer ram usage - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const type = data.inside ?? 'rss'; - - const res = escapeResult( - `(process.memoryUsage().${type} / 1024 / 1024).toFixed(2)`, + ]) + .setReturns(ReturnType.String) + .setCode((data, scopes, thisArg) => { + const currentScope = thisArg.getCurrentScope(scopes); + let [type] = thisArg.getParams(data); + + if (!type) { + type = 'heapUsed'; + } + + if ( + !['heapUsed', 'heapTotal', 'rss', 'external', 'arrayBuffers'].includes(type) && + !thisArg.canSuppressAtComp(data, currentScope) + ) { + throw TranspilerError.CompileError(`Invalid memory type: ${type}`, data); + } + + const result = thisArg.getResultString( + // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/ban-ts-comment + // @ts-ignore + // eslint-disable-next-line @typescript-eslint/dot-notation, @typescript-eslint/no-unsafe-return + () => process.memoryUsage()['"$0"'], + [type], ); - currentScope.rest = currentScope.rest.replace(data.total, res); + + const escaped = escapeResult(result); + return { - code: res, - scope: scope, + code: escaped, + scope: scopes, }; - }, -}; + }) + .build(); + +export { $ram }; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/process/index.ts b/lib/aoi.js/src/functions/js/process/index.ts index a66fcbaa5..be21d961a 100644 --- a/lib/aoi.js/src/functions/js/process/index.ts +++ b/lib/aoi.js/src/functions/js/process/index.ts @@ -1,2 +1,4 @@ export * from './$cpu.js'; +export * from './$cwd.js'; +export * from './$procenv.js'; export * from './$ram.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/functions/js/string/$includes.ts b/lib/aoi.js/src/functions/js/string/$includes.ts deleted file mode 100644 index 7892d46e8..000000000 --- a/lib/aoi.js/src/functions/js/string/$includes.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { type FunctionData, type funcData, type Scope, parseString } from '../../../index.js'; -import { escapeResult } from '../../../util/transpilerHelpers.js'; - -export const $includes: FunctionData = { - name: '$includes', - brackets: true, - optional: false, - type: 'getter', - fields: [ - { - name: 'text', - type: 'string', - description: 'The text to check', - required: true, - }, - { - name: 'search', - type: 'string', - description: 'The text to search for', - required: true, - }, - ], - version: '7.0.0', - default: ['void', 'void'], - returns: 'boolean', - description: 'Checks if the text includes the search', - example: ` - $includes[Hello World;Hello] // returns true - $includes[Hello World;hello] // returns false - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const [text, search] = data.splits; - const parsedText = parseString(text); - const parsedSearch = parseString(search); - const res = escapeResult(`${parsedText}.includes(${parsedSearch})`); - currentScope.rest = currentScope.rest.replace(data.total, res); - return { - code: res, - scope: scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/string/$toString.ts b/lib/aoi.js/src/functions/js/string/$toString.ts deleted file mode 100644 index 2a4ae652f..000000000 --- a/lib/aoi.js/src/functions/js/string/$toString.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { type FunctionData, type funcData, type Scope } from '../../../index.js'; -import { escapeFunctionResult, parseData, parseResult } from '../../../util/transpilerHelpers.js'; - -export const $toString: FunctionData = { - name: '$toString', - brackets: true, - optional: false, - type: 'function_getter', - fields: [ - { - name: 'data', - type: 'any', - description: 'The data to convert to string', - required: true, - }, - ], - version: '7.0.0', - default: [ 'void'], - returns: 'string', - description: 'Checks if the text toString the search', - example: ` - $toString[Hello World] // returns "Hello World" - $toString[1] // returns "1" - $toString[true] // returns "true" - `, - code: (data: funcData, scope: Scope[]) => { - const currentScope = scope[scope.length - 1]; - const value = data.inside!; - const parsedValue = parseResult(parseData(value)); - if (!currentScope.functions.includes('function __$toString$__(value) {')) { - currentScope.functions += ` -function __$toString$__(value) { - if(typeof value === "object") return UTIL.inspect(value,{depth:0}); - return value.toString(); -} -`; - } - - if (!currentScope.packages.includes('const UTIL = await import("util");')) { - currentScope.packages += ` -const UTIL = await import("util"); -`; - } - - const res = escapeFunctionResult(`__$toString$__(${parsedValue})`); - currentScope.update(res, data); - - return { - code: res, - scope: scope, - }; - }, -}; diff --git a/lib/aoi.js/src/functions/js/string/index.ts b/lib/aoi.js/src/functions/js/string/index.ts deleted file mode 100644 index 9a37ba712..000000000 --- a/lib/aoi.js/src/functions/js/string/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './$includes.js'; -export * from './$toString.js'; \ No newline at end of file diff --git a/lib/aoi.js/src/index.ts b/lib/aoi.js/src/index.ts index b83b7efc5..5115dee83 100644 --- a/lib/aoi.js/src/index.ts +++ b/lib/aoi.js/src/index.ts @@ -1,24 +1,21 @@ -import { AoiClient } from './structures/AoiClient.js'; -export * from './core/index.js'; -export * from './typings/interfaces.js'; -export * from './typings/types.js'; -export * from './typings/enums.js'; -import functions, { JSFuncs, DiscordFuncs } from './functions/index.js'; +/* + Copyright 2024 Akarui Development -export * from './util/DapiHelper.js'; -export * from './util/Time.js'; -export * from './util/transpilerHelpers.js'; + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ -export * from './manager/Command.js'; -export * from './manager/Function.js'; +function log(message: string) { + console.log(message); +} -export * from './events/index.js'; - -export * from './structures/AoiJSFunction.js'; -export * from './structures/Command.js'; -export * from './structures/CustomEvent.js'; -export * from './structures/Util.js'; -// import AoiJSFunction from "./structures/AoiJSFunction.js"; - -// eslint-disable-next-line @typescript-eslint/consistent-type-exports -export { AoiClient, functions, JSFuncs, DiscordFuncs }; +export default log; \ No newline at end of file diff --git a/lib/aoi.js/src/manager/Function.ts b/lib/aoi.js/src/manager/Function.ts deleted file mode 100644 index 90eb314be..000000000 --- a/lib/aoi.js/src/manager/Function.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Group } from '@akarui/structures'; -import { type AoiClient } from '../structures/AoiClient.js'; -import { type FunctionData } from '../typings/interfaces.js'; -import fs from 'fs/promises'; -export class FunctionManager { - client: AoiClient; - functions: Group = new Group(Infinity); - constructor( client: AoiClient ) { - this.client = client; - } - - createFunction( data: FunctionData ) { - if ( !data.name ) throw new Error( 'Function name is required' ); - if ( !data.code ) throw new Error( 'Function code is required' ); - this.functions.set( data.name, data ); - } - - createManyFunctions( data: FunctionData[] ) { - for ( const func of data ) this.createFunction( func ); - } - - async load( path: string ) { - const stats = await fs.stat( path ); - if ( stats.isDirectory() ) { - const files = await fs.readdir( path ); - for ( const file of files ) { - const filePath = path + '/' + file; - const stats = await fs.stat( filePath ); - if ( stats.isDirectory() ) await this.load( filePath ); - else if ( stats.isFile() && file.endsWith( '.js' ) ) { - const func = await import( filePath ); - this.createFunction( func.default ); - } - } - } - } -} \ No newline at end of file diff --git a/lib/aoi.js/src/manager/Command.ts b/lib/aoi.js/src/managers/Command.ts similarity index 74% rename from lib/aoi.js/src/manager/Command.ts rename to lib/aoi.js/src/managers/Command.ts index 77adaedc7..b67ab39c7 100644 --- a/lib/aoi.js/src/manager/Command.ts +++ b/lib/aoi.js/src/managers/Command.ts @@ -1,20 +1,31 @@ -import { Group } from '@akarui/structures'; -import { Command } from '../structures/Command.js'; -import { type CommandOptions, type TranspiledFuncData } from '../typings/interfaces.js'; -import { type CommandTypes, type Optional } from '../typings/types.js'; +import Command from '../classes/Command.js'; +import { Group } from '@aoijs/structures'; +import { + type ICommandOptions, + type ITranspilerData, +} from '../typings/interface.js'; +import { type CommandTypes, type Optional } from '../typings/type.js'; import fs, { readFile } from 'fs/promises'; -import { type AoiClient, Bundler } from '../index.js'; +import type AoiClient from '@aoi.js/classes/AoiClient.js'; import Path from 'path'; +import AoiReader from '@aoi.js/core/AoiReader.js'; export class CommandManager { + static cmdTypes() { + return ['basic', 'interaction', 'ready', 'debug', 'component']; + } + basic: Group = new Group(Infinity); interaction: Group = new Group(Infinity); ready: Group = new Group(Infinity); debug: Group = new Group(Infinity); component: Group = new Group(Infinity); + readonly #client: AoiClient; + readonly #reader: AoiReader; constructor(client: AoiClient) { this.#client = client; + this.#reader = new AoiReader(); } isValidType(type: string) { @@ -25,19 +36,17 @@ export class CommandManager { return ['basic', 'interaction', 'ready', 'debug']; } - static cmdTypes() { - return ['basic', 'interaction', 'ready', 'debug', 'component']; - } - - add(command: Optional) { + add(command: Optional) { if (!command.name) throw new Error('Command name is required'); if (!command.type) throw new Error('Command type is required'); if (!command.__path__) command.__path__ = 'root'; - const cmd = new Command(command as CommandOptions, this.#client); - if (this.isValidType(command.type) && command.type !== 'component') + const cmd = new Command(command as ICommandOptions, this.#client); + if (this.isValidType(command.type) && command.type !== 'component') { + this[command.type].set(this[command.type].size, cmd); - else { + } else { if (command.type === 'component') + this.component.set(command.name, cmd); else { // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -49,7 +58,7 @@ export class CommandManager { } } - addMany(commands: Array>) { + addMany(commands: Array>) { for (const command of commands) this.add(command); } @@ -63,8 +72,11 @@ export class CommandManager { const chalk = (await import('chalk')).default; const boxen = (await import('boxen')).default; const stats = await fs.stat(path); - const Commands: Array<{ path: string; loaded: boolean; reason?: string }> = - []; + const commands: Array<{ + path: string; + loaded: boolean; + reason?: string; + }> = []; if (!usingAoi) { if (stats.isDirectory()) { const files = await fs.readdir(path); @@ -75,8 +87,8 @@ export class CommandManager { await this.load({ path: filePath, usingAoi }); else if ( stats.isFile() && - file.endsWith('.js') && - !file.endsWith('.template.js') + file.endsWith('.js') && + !file.endsWith('.template.js') ) { // importing on windows let command; @@ -86,13 +98,13 @@ export class CommandManager { this.addMany(command.default); } else this.add(command.default); - Commands.push({ + commands.push({ path: filePath.split('/').pop()!, loaded: true, }); } catch (e) { /* empty */ - Commands.push({ + commands.push({ path: filePath.split('/').pop()!, loaded: false, reason: e as string, @@ -111,21 +123,20 @@ export class CommandManager { await this.load({ path: filePath, usingAoi }); else if ( stats.isFile() && - file.endsWith('.aoi') && - !file.endsWith('.template.aoi') + file.endsWith('.aoi') && + !file.endsWith('.template.aoi') ) { const command = await readFile(filePath, 'utf-8'); try { - const cmd = Bundler(command, this.#client).command; + const cmd = this.#reader.parse(command, this.#client); cmd.__path__ = filePath; - this.add(cmd as unknown as CommandOptions); - Commands.push({ + this.add(cmd as ICommandOptions); + commands.push({ path: filePath.split('/').pop()!, loaded: true, }); } catch (e) { - /* empty */ - Commands.push({ + commands.push({ path: filePath.split('/').pop()!, loaded: false, reason: e as string, @@ -141,7 +152,7 @@ export class CommandManager { } const box = boxen( - `${Commands.map((cmd) => { + `${commands.map((cmd) => { return `∷ ${chalk.cyanBright( cmd.loaded ? 'Loaded' : 'Failed', )} ${chalk.greenBright(cmd.path)} ${chalk.redBright( @@ -152,7 +163,7 @@ export class CommandManager { { title: `∴ Loading ${chalk.blueBright( path, - )} ( ${chalk.yellowBright(Commands.length)} )`, + )} ( ${chalk.yellowBright(commands.length)} )`, borderStyle: 'round', borderColor: 'cyan', textAlignment: 'left', @@ -173,30 +184,36 @@ export class CommandManager { filter, }: { type: CommandTypes; - data: TranspiledFuncData; + data: Optional; filter: (cmd: Command) => boolean; }) { + const cmd = this[type].filter((cmd) => filter(cmd)); if (cmd.size) { + for (const command of cmd.values()) { + await command.__compiled__({ ...data, command }); } } } async loadFile(filePath: string) { - let command; + let command: { default: Optional | Array> }; try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-require-imports command = require(filePath); } catch { if (process.platform === 'win32') { const fp = Path.join('file:///', process.cwd(), filePath); + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment command = await import(fp); } else { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment command = await import(Path.join(process.cwd(), filePath)); } } - + return command; } } diff --git a/lib/aoi.js/src/managers/Function.ts b/lib/aoi.js/src/managers/Function.ts new file mode 100644 index 000000000..925b9785d --- /dev/null +++ b/lib/aoi.js/src/managers/Function.ts @@ -0,0 +1,20 @@ +import type AoiClient from '@aoi.js/classes/AoiClient.js'; +import { type IFunctionData } from '@aoi.js/typings/interface.js'; + +export default class FunctionManager { + customs: Record; + readonly #client: AoiClient; + + constructor(client: AoiClient) { + this.#client = client; + this.customs = {}; + } + + addFunction(name: string, data: IFunctionData) { + this.customs[name] = data; + } + + addToTranspiler() { + this.#client.transpiler.addFunctions(this.customs); + } +} diff --git a/lib/aoi.js/src/pack.js b/lib/aoi.js/src/pack.js deleted file mode 100644 index 238bdfdff..000000000 --- a/lib/aoi.js/src/pack.js +++ /dev/null @@ -1,14 +0,0 @@ -const { writeFileSync } = require('fs'); - -writeFileSync( - './dist/cjs/package.json', - `{ - "type" : "commonjs" -}`, -); -writeFileSync( - './dist/esm/package.json', - `{ - "type" : "module" -}`, -); diff --git a/lib/aoi.js/src/structures/AoiClient.ts b/lib/aoi.js/src/structures/AoiClient.ts deleted file mode 100644 index 774548d6c..000000000 --- a/lib/aoi.js/src/structures/AoiClient.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* eslint-disable @typescript-eslint/prefer-ts-expect-error */ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import { - Client, - type CreateApplicationCommandPayload, - type Snowflake, - createCacheManager, -} from 'zeneth'; -import { - type AoiClientType, - type AoiClientOptions, - type CommandOptions, -} from '../typings/interfaces.js'; -import { CommandManager } from '../manager/Command.js'; -import { onMessage } from '../events/messageCreate.js'; -import { Util } from './Util.js'; -import { FunctionManager } from '../manager/Function.js'; -import { type CommandMethods, type CommandTypes } from '../typings/types.js'; -import { type AoiClientEvents } from '../typings/enums.js'; -import { onInteraction } from '../events/interactionCreate.js'; -import { onReady } from '../events/ready.js'; -import { readFileSync } from 'fs'; - -// @ts-ignore -class AoiClient implements AoiClientType { - static create() { - const file = './config.aoi'; - const config = JSON.parse( - readFileSync(file, 'utf-8'), - ) as AoiClientOptions; - return new AoiClient(config); - } - - client: Client; - managers: { commands: CommandManager; functions: FunctionManager }; - options: AoiClientOptions; - cache: any; - util: Util; - __on__: Partial void>>> = - {}; - - constructor(options: AoiClientOptions) { - this.client = new Client(options); - this.managers = { - commands: new CommandManager(this), - functions: new FunctionManager(this), - }; - this.options = options; - if (options.caches) - this.cache = createCacheManager(options.caches, this.client); - - this.#bindEvents(); - this.#bindCommands(); - this.util = new Util(this); - this.__on__ = {}; - } - - emit(event: AoiClientEvents, ...args: unknown[]) { - if (this.__on__[event]) { - for (const func of this.__on__[event] ?? []) { - func(...args); - } - } - } - - on(event: AoiClientEvents, func: (...args: unknown[]) => void) { - if (!this.__on__[event]) this.__on__[event] = []; - this.__on__[event]?.push(func); - } - - async createApplicationCommand( - globalOrGuldId: 'global' | Snowflake, - data: CreateApplicationCommandPayload, - ) { - if (globalOrGuldId === 'global') { - return this.client.createGlobalApplicationCommand(data); - } - - return this.client.createGuildApplicationCommand(globalOrGuldId, data); - } - - returnComponent(name: string, dataString: string) { - const component = this.managers.commands.component.get(name); - if (!component) throw new Error(`Component ${name} not found`); - const func = component.__compiled__.toString(); - return ` -${dataString}; -${func} -`; - } - - #bindEvents() { - for (const event of this.options.events) - switch (event) { - case 'MessageCreate': - onMessage(this); - break; - case 'InteractionCreate': - onInteraction(this); - break; - case 'Ready': - onReady(this); - break; - default: - break; - } - } - - #bindCommands() { - const cmdTypes = this.managers.commands.types as CommandTypes[]; - for (const type of cmdTypes) { - const cmdType = `${type}Command` as const; - const parsedType = - cmdType === 'basicCommand' - ? 'command' - : (cmdType as CommandMethods); - // @ts-ignore - this[parsedType] = function ( - ...cmd: Array> - ) { - const cmds = cmd.map((c) => { - return { - ...c, - type, - }; - }) as CommandOptions[]; - this.managers.commands.addMany(cmds); - }; - } - - // @ts-ignore - this.componentCommand = function ( - ...cmd: Array> - ) { - const cmds = cmd.map((c) => { - return { - ...c, - type: 'component', - }; - }) as CommandOptions[]; - this.managers.commands.addMany(cmds); - }; - } -} - -export { AoiClient }; diff --git a/lib/aoi.js/src/structures/AoiJSFunction.ts b/lib/aoi.js/src/structures/AoiJSFunction.ts deleted file mode 100755 index c49a664fb..000000000 --- a/lib/aoi.js/src/structures/AoiJSFunction.ts +++ /dev/null @@ -1,229 +0,0 @@ - -import { - type FunctionData, - type Scope, - type TranspiledFuncData, - type FuncData, -} from '../index.js'; -import { inspect } from 'util'; - -export default class AoijsFunction { - name!: string; - type!: FunctionData['type']; - brackets!: boolean; - optional!: boolean; - fields!: FunctionData['fields']; - version!: string; - default!: string[]; - returns!: string; - description!: string; - example!: string; - code!: FunctionData['code']; - setName(name: string) { - this.name = name; - return this; - } - - setType(type: FunctionData['type']) { - this.type = type; - return this; - } - - setBrackets(brackets: boolean) { - this.brackets = brackets; - return this; - } - - setOptional(optional: boolean) { - this.optional = optional; - return this; - } - - setFields(fields: FunctionData['fields']) { - this.fields = fields; - return this; - } - - setVersion(version: string) { - this.version = version; - return this; - } - - setDefault(defaults: string[]) { - this.default = defaults; - return this; - } - - setReturns(returns: string) { - this.returns = returns; - return this; - } - - setDescription(description: string) { - this.description = description; - return this; - } - - setExample(example: string) { - this.example = example; - return this; - } - - setCode( - code: ( - data: FuncData, - scope: Scope[], - thisArg: AoijsFunction, - ) => { code: string; scope: Scope[]; data?: FuncData }, - thisArg: AoijsFunction, - ) { - this.code = function (data, scope) { - return code(data, scope, thisArg); - }; - - return this; - } - - getCurrentScope(scope: Scope[]) { - return scope[scope.length - 1]; - } - - getParams(data: FuncData) { - return data.splits; - } - - setSetter(scope: Scope, value: string) { - scope.setters = value; - } - - updateSetter(scope: Scope, value: string) { - scope.setters += value; - } - - updateFunction( - scope: Scope, - func: (discord: TranspiledFuncData, arg?: unknown[]) => unknown, - vars?: unknown[], - ) { - const stringifyFunction = func.toString(); - const functionName = inspect(func) - .replace('[Function:', '') - .replace(']', '') - .trim(); - - const es5Regex = - /^(?:(?:\/\*[^(?:*/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*\s*(?:(?:(?:async\s(?:(?:\/\*[^(?:*/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*\s*)?function|class)(?:\s|(?:(?:\/\*[^(?:*/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*)|(?:[_$\w][\w0-9_$]*\s*(?:\/\*[^(?:*/)]*\*\/\s*)*\s*\()|(?:\[\s*(?:\/\*[^(?:*/)]*\*\/\s*)*\s*(?:(?:['][^']+['])|(?:["][^"]+["]))\s*(?:\/\*[^(?:*/)]*\*\/\s*)*\s*\]\())/; - - const isEs6 = !es5Regex.test(stringifyFunction); - const findNumbersRegex = /\$[0-9]+/g; - let functionToUpdate = ''; - if (isEs6) { - functionToUpdate = `function ${functionName} ${stringifyFunction.replace( - '=>', - '', - )}`; - } else { - functionToUpdate = stringifyFunction; - } - - const numbers = functionToUpdate.match(findNumbersRegex); - if (numbers?.length && vars?.length) { - for (const number of numbers) { - const index = parseInt(number.replace('$', '')); - functionToUpdate = functionToUpdate - .replaceAll(`"${number}"`, vars[index] as string) - .replaceAll(`'${number}'`, vars[index] as string); - } - } - - scope.functions += functionToUpdate + '\n'; - } - - hasFunction(scope: Scope, funcName: string) { - return scope._funcList.includes(funcName); - } - - - getResultString( - func: (__$DISCORD_DATA$__: TranspiledFuncData) => unknown, - args: string[], - ): string { - const body = func.toString(); - // if (!/\((\s)*__\$DISCORD_DATA\$__(\s)*\)/.test(body.trim())) { - // throw new Error("Function Arg must be name __$DISCORD_DATA$__"); - // } - const matchWholeArgwithAsync = /(async\s*)?\(?\s*(\w)*\s*\)?(?=\s*=>)/; - const argRegex = /\(?\s*(\w)*\s*\)?(?=\s*=>)/; - const getArg = argRegex.exec(body); - if (!getArg) throw new Error('Function Arg must be present'); - const arg = getArg[0].replace('(', '').replace(')', '').trim(); - let bodyWithoutArg = body.replace(matchWholeArgwithAsync, ''); - bodyWithoutArg = this.#replaceArgInFunctionStringWithDiscord( - bodyWithoutArg, - arg, - ); - const removedArrow = bodyWithoutArg.replace('=>', '').trim(); - - const bodyWithoutBrackets = removedArrow.startsWith('{') - ? removedArrow.slice(1, -1) - : removedArrow; - const findNumbersRegex = /\$[0-9]+/g; - const numbers = bodyWithoutBrackets.match(findNumbersRegex); - - if (!numbers) { - return bodyWithoutBrackets; - } - - let result = bodyWithoutBrackets; - for (const number of numbers) { - const index = parseInt(number.replace('$', '')); - result = result - .replaceAll(`"${number}"`, args[index]) - .replaceAll(`'${number}'`, args[index]); - } - - return result; - } - - build(): FunctionData { - return { - name: this.name, - type: this.type, - brackets: this.brackets, - optional: this.optional, - fields: this.fields, - version: this.version, - default: this.default, - returns: this.returns, - description: this.description, - example: this.example, - code: this.code, - }; - } - - conditionalGetResultString( - condition: boolean, - trueData: { - func: (__$DISCORD_DATA$__: TranspiledFuncData) => unknown; - args: string[]; - }, - falseData: { - func: (__$DISCORD_DATA$__: TranspiledFuncData) => unknown; - args: string[]; - }, - ): string { - if (condition) - return this.getResultString(trueData.func, trueData.args); - return this.getResultString(falseData.func, falseData.args); - } - - #replaceArgInFunctionStringWithDiscord(func: string, arg: string) { - // it will replace all arg with __$DISCORD_DATA$__ and wont replace same word if it is a part of another word or a property - - const regex = new RegExp( - `(?; - readonly #client: AoiClient; - constructor(client: AoiClient) { - super(); - this.#client = client; - this.commands = new Group(Infinity); - } - - listen(eventName: string) { - this.on(eventName, async (...args) => { - const cmds = this.commands.filter((cmd) => cmd.listen === eventName); - - for (const cmd of cmds.values()) { - await cmd.__compiled__({ bot:this.#client, eventData:args } as unknown as TranspiledFuncData); - } - }); - } - - add(command: CommandOptions) { - const cmd = new Command(command, this.#client); - this.commands.set(cmd.name, cmd); - } - - addMany(commands: CommandOptions[]) { - for (const command of commands) this.add(command); - } - - async load({ - path, - usingAoi = false, - }: { - path: string; - usingAoi?: boolean; - }) { - const chalk = (await import('chalk')).default; - const boxen = (await import('boxen')).default; - const stats = await fs.stat(path); - const Commands: Array<{ path: string;loaded: boolean;reason?: string }> = []; - if (!usingAoi) { - if (stats.isDirectory()) { - const files = await fs.readdir(path); - for (const file of files) { - const filePath = path + '/' + file; - const stats = await fs.stat(filePath); - if (stats.isDirectory()) - await this.load({ path: filePath, usingAoi }); - else if (stats.isFile() && file.endsWith('.js')) { - // importing on windows - let command; - try { - if (process.platform === 'win32') { - const fp = Path.join( - 'file:///', - process.cwd(), - filePath, - ); - command = await import(fp); - } else { - command = await import( - Path.join(process.cwd(), filePath) - ); - } - - if (Array.isArray(command.default)) { - this.addMany(command.default); - } else this.add(command.default); - - Commands.push({ path:filePath.split('/').pop()!, loaded:true }); - } catch (e) { - /* empty */ - Commands.push({ path:filePath.split('/').pop()!, loaded:false, reason:e as string }); - } - } - } - } - } else { - if (stats.isDirectory()) { - const files = await fs.readdir(path); - for (const file of files) { - const filePath = path + '/' + file; - const stats = await fs.stat(filePath); - if (stats.isDirectory()) - await this.load({ path: filePath, usingAoi }); - else if (stats.isFile() && file.endsWith('.aoi')) { - const command = await readFile(filePath, 'utf-8'); - try { - const cmd = Bundler(command, this.#client).command; - cmd.__path__ = filePath; - this.add(cmd as unknown as CommandOptions); - Commands.push({ path:filePath.split('/').pop()!, loaded:true }); - } catch (e) { - /* empty */ - Commands.push({ path:filePath.split('/').pop()!, loaded:false, reason:e as string }); - } - } - // else if(stats.isFile() && file.endsWith(".aoi") && !file.endsWith(".template.aoi")) { - // const command = await import(filePath); - // this.add(command.default); - // } - } - } - } - - const box = boxen( - `${Commands.map((cmd) => { - return `∷ ${chalk.cyanBright(cmd.loaded ? 'Loaded' : 'Failed')} ${chalk.greenBright( - cmd, - )} ${chalk.redBright(cmd.loaded ? '' : cmd.reason)}`; - }).join('\n')} - `, - { - title: `∴ Loading Events ( ${chalk.yellowBright(Commands.length)} )`, - borderStyle: 'round', - borderColor: 'cyan', - textAlignment: 'left', - backgroundColor: 'black', - width: 100, - padding:1, - dimBorder: true, - float: 'center', - }, - ); - - console.log(box); - } -} \ No newline at end of file diff --git a/lib/aoi.js/src/structures/Database.ts b/lib/aoi.js/src/structures/Database.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/aoi.js/src/structures/Util.ts b/lib/aoi.js/src/structures/Util.ts deleted file mode 100644 index 606afa1a0..000000000 --- a/lib/aoi.js/src/structures/Util.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { type Guild, type Snowflake, type User } from 'zeneth'; -import { type AoiClient } from './AoiClient.js'; -import { type Group } from '@akarui/structures'; - -export class Util { - client: AoiClient; - constructor(client: AoiClient) { - this.client = client; - } - - async getUser(id: Snowflake) { - if (this.client.cache?.users) return this.client.cache.users.get(id); - else return this.client.client.getUser(id); - } - - findUser(name: string) { - if (this.client.cache?.users) - return ((this.client.cache.users as unknown) as Group).find((u) => u.username === name || u.tag === name); - else return undefined; - } - - async getGuild(id: Snowflake) { - if (this.client.cache?.guilds) return this.client.cache.guilds.get(id) as Guild; - else return this.client.client.getGuild(id); - } -} diff --git a/lib/aoi.js/src/testing/testClient.ts b/lib/aoi.js/src/testing/testClient.ts new file mode 100644 index 000000000..495a66d59 --- /dev/null +++ b/lib/aoi.js/src/testing/testClient.ts @@ -0,0 +1,10 @@ +import AoiClient from '@aoi.js/classes/AoiClient.js'; + +class TestClient extends AoiClient { + constructor() { + super({ testMode: true, token: 'token.a.b', 'intents': 0, prefix: '!', events: [] }); + // code... + } +} + +export default TestClient; \ No newline at end of file diff --git a/lib/aoi.js/src/typings/enums.ts b/lib/aoi.js/src/typings/enum.ts similarity index 69% rename from lib/aoi.js/src/typings/enums.ts rename to lib/aoi.js/src/typings/enum.ts index bdc7985aa..b36d68341 100644 --- a/lib/aoi.js/src/typings/enums.ts +++ b/lib/aoi.js/src/typings/enum.ts @@ -1,3 +1,22 @@ +export enum FunctionType { + Setter, + Getter, + Function, + FunctionGetter, + Scope, + ScopeGetter, +} + +export enum ReturnType { + Void = 1 << 0, + Any = 1 << 1, + Number = 1 << 2, + String = 1 << 3, + Boolean = 1 << 4, + Object = 1 << 5, + Array = 1 << 6, +} + export enum TranspilerCustoms { F = '#FUNCTION#', FS = '#FUNCTION_START#', @@ -22,14 +41,16 @@ export enum TranspilerCustoms { AS = '#ARRAY_STARTER#', AE = '#ARRAY_ENDER#', ASEP = '#ARRAY_SEPARATOR#', + SBL = '#SMOOTH_BRACKET_LEFT#', + SBR = '#SMOOTH_BRACKET_RIGHT#', } -export enum BundlerCustoms { +export enum BundlerCustoms { LB = '#LEFT_BRACKET#', RB = '#RIGHT_BRACKET#', EJS = '#EMBEDDED_JS#', } export enum AoiClientEvents { - Error = 'error', + Error = 'AoiError', } \ No newline at end of file diff --git a/lib/aoi.js/src/typings/interface.ts b/lib/aoi.js/src/typings/interface.ts new file mode 100644 index 000000000..6da1358d7 --- /dev/null +++ b/lib/aoi.js/src/typings/interface.ts @@ -0,0 +1,113 @@ +import type AoiClient from '@aoi.js/classes/AoiClient.js'; +import { type ReturnType, type FunctionType } from './enum.js'; +import { type AoiEventNames, type AsyncFunction, type CommandTypes, type FunctionCode } from './type.js'; +import type StringObject from '../core/builders/StringObject.js'; +import type Command from '@aoi.js/classes/Command.js'; +import { type User, type Channel, type Client, type ClientOptions, type Guild, type Message, type GuildMember } from 'discord.js'; + +export interface ITranspilerOptions { + customFunctions: Record; + minify: boolean; +} + +export interface ITranspileOptions { + reverse?: boolean; + parsedStringOnly?: boolean; + command?: Command; + sendMessage?: boolean; + scopeData?: IScopeData; + asFunction?: boolean; +} + +export interface IScopeData { + vars?: string[]; + embeds?: unknown[]; + name?: string; + sendFunction?: string; + functions?: string[]; + env?: string[]; + object?: Record; + embeddedJS?: string[]; + useChannel?: Snowflake | string; +} + +export interface IFunctionData { + name: string; + brackets: boolean; + optional: boolean; + type: FunctionType; + fields: IFunctionField[]; + returns: ReturnType; + extra?: unknown; + code: FunctionCode; +} + +export interface ICodeFunctionData extends IFunctionData { + inside?: string; + parent?: ICodeFunctionData; + total: string; + splits: () => string[]; + funcs: ICodeFunctionData[]; + parsed?: string; + executed: string; + cmd?: Command; +} + +export interface IFunctionField { + name: string; + type: ReturnType; + required: boolean; + description?: string; +} + +type Snowflake = bigint; + +export interface ICommandOptions { + [key: string]: unknown; + name: string; + type: CommandTypes; + code: string | AsyncFunction; + aliases?: string[]; + reverseRead?: boolean; + executeAt?: 'guild' | 'dm' | 'both'; + __path__: string; +} + +export interface ITranspilerData { + bot: AoiClient; + client: Client; + message?: Message; + guild?: Guild; + channel?: Channel; + author?: User; + member?: GuildMember; + command: Command; + args?: string[]; + data?: Record; +} + +export interface IAoiClientOptions { + token: `${string}.${string}.${string}`; + intents: number; + events: AoiEventNames[]; + prefix: string | string[]; + respond?: { + toBot?: boolean; + onEdit?: { + commands?: boolean; + alwaysExecute?: boolean; + nonPrefixed?: boolean; + time?: number; + }; + }; + cache?: Record; + djsClientOptions?: ClientOptions; + transpilerOptions?: ITranspilerOptions; + testMode?: boolean; +} + +export interface IAoiLoggerOptions { + logs?: boolean; + warnings?: boolean; + errors?: boolean; +} \ No newline at end of file diff --git a/lib/aoi.js/src/typings/interfaces.ts b/lib/aoi.js/src/typings/interfaces.ts deleted file mode 100644 index 4681accca..000000000 --- a/lib/aoi.js/src/typings/interfaces.ts +++ /dev/null @@ -1,166 +0,0 @@ -import type StringObject from '../core/structs/StringObject.js'; -import { - type Channel, - type Client, - type ClientOptions, - type GatewayEventNames, - type GroupConfigOptions, - type Guild, - type Interaction, - type Message, - type Snowflake, -} from 'zeneth'; -import type Scope from '../core/structs/Scope.js'; -import { - type AsyncFunction, - type CommandTypes, - type PluginType, - type AutoFetchDataTypes, - type AoiClientProps, -} from './types.js'; -import { type AoiClient } from '../index.js'; -import { type Command } from '../structures/Command.js'; - -export interface TranspilerOptions { - customFunctions?: Record; - sendMessage: boolean; - scopeData?: { - variables?: string[]; - embeds?: unknown[]; - name?: string; - sendFunction?: string; - functions?: string; - env?: string[]; - objects?: Record; - embedJs?: string[]; - useChannel?: Snowflake | string; - }; - reverse?: boolean; - minify?: boolean; - parsedStringOnly?: boolean; - client: AoiClient; - command?: Command; -} - -export interface Field { - name: string; - type: string; - required: boolean; - description?: string; -} - -export interface FunctionData { - name: string; - brackets: boolean; - optional: boolean; - type: 'scope' | 'setter' | 'getter' | 'function' | 'function_getter' | 'scope_getter'; - fields: Field[]; - returns: unknown; - default: string[]; - description: string; - version: string; - example: string; - extra?: unknown; - code: (data: FuncData, scope: Scope[]) => { code: string; scope: Scope[]; data?: FuncData }; -} - -export interface PartialFunctionData extends FunctionData { - total: string; -} - -export interface FuncData extends FunctionData { - inside?: string; - parent?: FunctionData; - total: string; - splits: string[]; - funcs: FuncData[]; - parsed: string; -} - -export interface CommandData { - name: string; - type: CommandTypes; - code: string; - __compiled__?: string; - __uglify__: boolean; - aliases?: string[]; - __path__?: string; -} - -export interface TransformedGuild { - rulesChannel: { id: string | undefined; name: string | undefined }; - publicUpdatesChannel: { id: string | undefined; name: string | undefined }; - bans: string; - commands: number; - partnered: boolean; - verified: boolean; - mfaLevel: unknown; - explicitContentFilter: unknown; - defaultMessageNotifications: unknown; - systemChannelFlags: unknown; - premiumTier: unknown; - premiumSubscriptionCount: number | undefined; - preferredLocale: unknown; - systemChannel: { id: string | undefined; name: string | undefined }; - splash: string | undefined; - owner: { id: string; name: string; nick: string | undefined }; - icon: string | undefined; - afkChannel: { id: string | undefined; name: string | undefined }; - membersId: string[]; - channelsId: string[]; - rolesId: string[]; - emojisId: string[]; - stickersId: string[]; -} - -export interface AoiClientOptions extends ClientOptions { - events: Array; - prefixes: string | string[]; - caches: Record; - autoFetchData?: AutoFetchDataTypes[]; -} - -export interface CommandOptions { - [key: string]: unknown; - name: string; - type: CommandTypes; - code: string | AsyncFunction; - aliases?: string[]; - reverseRead?: boolean; - executeAt?: 'guild' | 'dm' | 'both'; - __path__: string; -} - -export interface TranspiledFuncData { - client: Client; - bot: AoiClient; - message?: Message; - channel?: Channel | { id: Snowflake | undefined; fetched: boolean }; - guild?: Guild | { id: Snowflake | undefined; fetched: boolean }; - author?: Message['author']; - args?: string[]; - member?: Message['member']; - interaction?: Interaction; - data?: unknown; - command?: Command; -} - -export interface Plugin { - name: string; - func: (...args: unknown[]) => unknown; -} - -export interface Plugins { - type: PluginType; - plugins: Plugin[]; -} - -export interface PluginOptions { - plugins: Plugins[]; -} - -export interface AoiClientType extends AoiClient { - new (options: AoiClientOptions): AoiClient & { - client: Client; - } & AoiClientProps; -} \ No newline at end of file diff --git a/lib/aoi.js/src/typings/type.ts b/lib/aoi.js/src/typings/type.ts new file mode 100644 index 000000000..d9aa2cd0c --- /dev/null +++ b/lib/aoi.js/src/typings/type.ts @@ -0,0 +1,68 @@ +import type Scope from '@aoi.js/core/builders/Scope.js'; +import { type ITranspilerData, type ICodeFunctionData, type IFunctionData } from './interface.js'; +import type * as Events from '@aoi.js/events/index.js'; + +export type FunctionCode = ( + data: ICodeFunctionData, + scope: Scope[], +) => { + code: string; + scope: Scope[]; +}; + +export type CommandTypes = + | 'basic' + | 'interaction' + | 'ready' + | 'debug' + | 'component'; +// export type AsyncFunction = (arg: ITranspiledFuncData) => Promise; + +export type AutoFetchDataTypes = + | 'guild' + | 'channel' + | 'emoji' + | 'member' + | 'role' + | 'user' + | 'all'; + +export type WithBuild = R & { build: () => string }; + +export type ProxyType = + T extends Array + ? { + [K in keyof T]: T[K] extends (...args: infer A) => infer R + ? (...args: A) => WithBuild> + : WithBuild>; + } & { + [K in keyof U[]]: U[][K] extends (...args: infer A) => infer R + ? (...args: A) => WithBuild> + : WithBuild>; + } & { build: () => string } + : { + [K in keyof T]: T[K] extends (...args: infer A) => infer R + ? (...args: A) => WithBuild> + : WithBuild>; + } & { build: () => string }; + +export type AsyncFunction = (arg: ITranspilerData) => Promise; + +export type OptionalFor = { + [P in keyof T as P extends K ? P : never]?: T[P]; +}; + +export type OptionalExecept = { + [P in keyof T as P extends K ? never : P]: T[P]; +}; + +export type Optional = OptionalFor & +OptionalExecept; + +export type CustomFunctionProps = IFunctionData & { + _code?: string; +}; + +export type Safe = [Error, undefined] | [undefined, T]; + +export type AoiEventNames = keyof typeof Events; \ No newline at end of file diff --git a/lib/aoi.js/src/typings/types.ts b/lib/aoi.js/src/typings/types.ts deleted file mode 100644 index 1eb43407f..000000000 --- a/lib/aoi.js/src/typings/types.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { type Client, type Cacher } from 'zeneth'; -import { type CommandManager } from '../manager/Command.js'; -import { type FunctionManager } from '../manager/Function.js'; -import { type Util } from '../structures/Util.js'; -import { - type AoiClientOptions, - type CommandOptions, - type Plugin, - type TranspiledFuncData, -} from './interfaces.js'; -import { type AoiClientEvents } from './enums.js'; - -export type CommandTypes = - | 'basic' - | 'interaction' - | 'ready' - | 'debug' - | 'component'; - -export type CommandMethods = CommandTypes extends 'basic' - ? 'command' - : `${Exclude}Command` | 'command'; -export type AsyncFunction = (arg: TranspiledFuncData) => Promise; - -export type AutoFetchDataTypes = - | 'guild' - | 'channel' - | 'emoji' - | 'member' - | 'role' - | 'user' - | 'all'; - -// make provided key as optional -export type OptionalFor = { - [P in keyof T as P extends K ? P : never]?: T[P]; -}; - -export type OptionalExecept = { - [P in keyof T as P extends K ? never : P]: T[P]; -}; - -export type Optional = OptionalFor & -OptionalExecept; -// change basiCommand to command - -export type DynamicAoiClientMethods = { - [key in `${Exclude}Command` | 'command']: ( - ...cmd: Array> - ) => void; -}; - -export type AoiClientProps = DynamicAoiClientMethods & { - client: Client; - managers: { - commands: CommandManager; - functions: FunctionManager; - }; - options: AoiClientOptions; - cache?: Cacher; - util: Util; - __on__: Partial< - Record void>> - >; -}; - -export type PluginType = - | 'pre' - | 'post' - | 'load' - | 'preEvent' - | 'postEvent' - | 'preCommand' - | 'postCommand'; - -export type PluginManagerProps = { - [key in PluginType]: Plugin[]; -}; diff --git a/lib/aoi.js/src/util/DapiHelper.ts b/lib/aoi.js/src/util/DapiHelper.ts deleted file mode 100644 index da762d2a5..000000000 --- a/lib/aoi.js/src/util/DapiHelper.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { type Message } from 'zeneth'; -import { type AoiClient } from '..'; -import { type AutoFetchDataTypes } from '../typings/types.js'; - -/** - * Checks if the autoFetchData is enabled for the given string - * @param string The string to check - * @param client The client - * @returns - * @example - * ```js - * isAutoFetchDataEnabled("messages", client) - * ``` - */ -export function isAutoFetchDataEnabled( - string: AutoFetchDataTypes, - client: AoiClient, -) { - if (!string) return false; - if ( - client.options.autoFetchData?.includes(string) || - client.options.autoFetchData?.includes('all') - ) - return true; - else return false; -} - -/** - * Returns the default cache config - * @example - * ```js - * defaultCacheConfig() - * ``` - */ -export function defaultCacheConfig(): { - messages: { - class: string; - cacheFunction: (message: Message) => boolean; - }; - channels: { - class: string; - }; - guilds: { - class: string; - }; -} { - return { - messages: { - class: 'Message', - cacheFunction: (message: Message) => !message.author.bot, - }, - channels: { - class: 'Channel', - }, - guilds: { - class: 'Guild', - }, - }; -} diff --git a/lib/aoi.js/src/util/Time.ts b/lib/aoi.js/src/util/Time.ts deleted file mode 100644 index 8e8e5cd54..000000000 --- a/lib/aoi.js/src/util/Time.ts +++ /dev/null @@ -1,149 +0,0 @@ -const compare = (a: { order: number }, b: { order: number }) => { - if (a.order < b.order) { - return -1; - } - - if (a.order > b.order) { - return 1; - } - - return 0; -}; - -const pluralize = (num: number, txt: string, suffix = 's') => - `${num} ${txt}${num !== 1 ? suffix : ''}`; - -export function parse(time: string | number) { - if (!['string', 'number'].includes(typeof time)) - throw TypeError("'time' must be a string or number"); - if (typeof time === 'number') - return { - ms: time, - format: format(time).toString(), - }; - else { - const Hash = new Map(); - - time.split(' ').forEach((x) => { - if (x.endsWith('y')) - Hash.set('y', { - format: pluralize(Number(x.split('y')[0]), 'year'), - ms: Number(x.split('y')[0]) * 31536000000, - order: 1, - }); - if (x.endsWith('mon') || x.endsWith('M')) - Hash.set('mon', { - format: pluralize( - Number(x.split('mon')[0].split('M')[0]), - 'month', - ), - ms: Number(x.split('mon')[0].split('M')[0]) * 2628002880, - order: 2, - }); - if (x.endsWith('w')) - Hash.set('w', { - format: pluralize(Number(x.split('w')[0]), 'week'), - ms: Number(x.split('w')[0]) * 604800000, - order: 3, - }); - if (x.endsWith('d')) - Hash.set('d', { - format: pluralize(Number(x.split('d')[0]), 'day'), - ms: Number(x.split('d')[0]) * 86400000, - order: 4, - }); - if (x.endsWith('h') || x.endsWith('hr')) - Hash.set('h', { - format: pluralize( - Number(x.split('h')[0].split('hr')[0]), - 'hour', - ), - ms: Number(x.split('hr')[0].split('h')[0]) * 3600000, - order: 5, - }); - if (x.endsWith('min') || x.endsWith('m')) - Hash.set('min', { - format: pluralize( - Number(x.split('min')[0].split('m')[0]), - 'minute', - ), - ms: Number(x.split('min')[0].split('m')[0]) * 60000, - order: 6, - }); - if (x.endsWith('s') && !x.endsWith('ms')) - Hash.set('s', { - format: pluralize(Number(x.split('s')[0]), 'second'), - ms: Number(x.split('s')[0]) * 1000, - order: 7, - }); - if (x.endsWith('ms')) - Hash.set('ms', { - ms: Number(x.split('ms')[0]), - order: 8, - }); - }); - const data = [...Hash.values()].sort(compare); - - const ms = data.map((x) => x.ms).reduce((a, b) => a + b, 0); - const format = data - .filter((x) => x.format) - .map((x) => x.format) - .join(', '); - - return { - ms, - format, - }; - } -} - -export function format(time: number) { - const date = (ms: number) => { - const res = Math.trunc(Math.abs(time) / ms); - time -= res * ms; - return res; - }; - - const data: { - object: { - years: number; - months: number; - weeks: number; - days: number; - hours: number; - minutes: number; - seconds: number; - ms: number; - }; - humanize: () => string; - toString: () => string; - } = { - object: { - years: date(31536000000), - months: date(2628746000), - weeks: date(604800000), - days: date(86400000), - hours: date(3600000), - minutes: date(60000), - seconds: date(1000), - ms: date(1), - }, - humanize: () => { - const string: string[] = []; - Object.entries(data.object) - .slice(0, -1) - .forEach((x) => { - if (x[1]) { - if (['months', 'ms'].includes(x[0])) { - string.push(`${x[1]}${x[0].slice(0, 3)}`); - } else { - string.push(`${x[1]}${x[0].slice(0, 1)}`); - } - } - }); - return string.join(' '); - }, - toString: () => parse(data.humanize()).format, - }; - return data; -} diff --git a/lib/aoi.js/src/util/transpilerHelpers.ts b/lib/aoi.js/src/util/transpilerHelpers.ts deleted file mode 100644 index bb5f81c6c..000000000 --- a/lib/aoi.js/src/util/transpilerHelpers.ts +++ /dev/null @@ -1,758 +0,0 @@ -import { TranspilerError } from '../core/error.js'; -import type Scope from '../core/structs/Scope.js'; -import FUNCDATA from '../functions/index.js'; -import { type FunctionData, type FuncData } from '../typings/interfaces.js'; -import { TranspilerCustoms } from '../typings/enums.js'; -import { StringObject, parseStringObject } from '../index.js'; -import { type Command } from '../structures/Command.js'; -/** - * Checks if the brackets in the given code are balanced. - * @param code - The code to check. - * @returns - Returns true if the brackets are balanced, false otherwise. - * @example - * ```js - * areBracketsBalanced("[]") // true - * areBracketsBalanced("[[]]") // true - * areBracketsBalanced("[[]") // false - * areBracketsBalanced("[]]") // false - * ``` - */ -export function areBracketsBalanced(code: string): boolean { - const leftbracket = /\[/g; - const rightbracket = /\]/g; - const leftbracketCount = code.match(leftbracket)?.length ?? 0; - const rightbracketCount = code.match(rightbracket)?.length ?? 0; - return leftbracketCount === rightbracketCount; -} - -/** - * Counts the number of brackets in the given code. - * @param code - The code to count the brackets in. - * @returns - Returns an object containing the number of left and right brackets. - * @example - * ```js - * countBrackets("[]") // { leftbracketCount: 1, rightbracketCount: 1 } - * countBrackets("[[]]") // { leftbracketCount: 2, rightbracketCount: 2 } - * ``` - */ - -export function countBrackets(code: string) { - const leftbracket = /\[/g; - const rightbracket = /\]/g; - const leftbracketCount = code.match(leftbracket)?.length ?? 0; - const rightbracketCount = code.match(rightbracket)?.length ?? 0; - return { leftbracketCount, rightbracketCount }; -} - -/** - * parse data to its actual type - * @param text - The string to check. - * @returns - Returns the parsed data. - * @example - * ```js - * parseData("1") // 1 - * parseData("1n") // 1n - * parseData("null") // null - * // and so on... - * ``` - */ -export function parseData(text: string) { - if (text === '') return text; - else if (!isNaN(Number(text)) && Number.isSafeInteger(Number(text))) - return Number(text); - else if ( - (!isNaN(Number(text)) && !Number.isSafeInteger(text)) || - isBigInt(text) - ) - return BigInt(text.replace('n', '')); - else if (text === 'null') return null; - else if (text === 'undefined') return undefined; - else if (text === 'true' || text === 'false') return text === 'true'; - else { - try { - return JSON.parse(text) as Record; - } catch { - if (text.startsWith('{') && text.endsWith('}')) { - const so = new StringObject('{'); - so.addEnd('}'); - let e; - eval(`e = ${parseStringObject(text, so).solve()}`); - return e; - } else if (text.startsWith('[') && text.endsWith(']')) { - const so = new StringObject('['); - so.addEnd(']'); - let e; - eval(`e = ${parseStringObject(text, so).solve()}`); - return e; - } else return text; - } - } -} - -/** - * Escapes a variable name by wrapping it with '__$' and '$__'. - * - * @param name - The variable name to escape. - * @returns The escaped variable name. - * @example - * ```js - * escapeVars("a") // "__$a$__" - * ``` - */ - -export function escapeVars(name: string) { - return `__$${name}$__`; -} - -/** - * Unescapes a variable name by removing the '__$' and '$__'. - * @param res - The variable name to unescape. - * @returns The unescaped variable name. - * @example - * ```js - * unescapeVars("__$a$__") // "a" - * ``` - */ - -export function escapeResult(res: string) { - return `${TranspilerCustoms.FS}${res}${TranspilerCustoms.FE}`; -} - -/** - * Escapes a math result by wrapping it with TranspilerCustoms.MFS and TranspilerCustoms.MFE. - * @param res - The math result to escape. - * @returns The escaped math result. - * @example - * ```js - * escapeMathResult("1+1") // #MATH_FUNCTION_START#1+1#MATH_FUNCTION_END# - * ``` - * @see {@link TranspilerCustoms} - */ - -export function escapeMathResult(res: string) { - return `${TranspilerCustoms.MFS}${res}${TranspilerCustoms.MFE}`; -} - -/** - * parse the result by removing all the customs - * @param result - The result to parse. - * @returns The parsed result. - * @example - * ```js - * parseResult("#MATH_FUNCTION_START#1+1#MATH_FUNCTION_END#") // "1+1" - * ``` - */ - -export function parseResult(result: string) { - if (typeof result !== 'string') return result; - return result - .replaceAll(TranspilerCustoms.FS, '') - .replaceAll(TranspilerCustoms.FE, '') - .replaceAll(TranspilerCustoms.FSEP, ';') - .replaceAll(TranspilerCustoms.FFUN, '') - .replaceAll(TranspilerCustoms.FSET, '') - .replaceAll(TranspilerCustoms.FGET, '') - .replaceAll(TranspilerCustoms.FISS, '') - .replaceAll(TranspilerCustoms.FISE, '') - .replaceAll(TranspilerCustoms.FSS, '') - .replaceAll(TranspilerCustoms.FSE, '') - .replaceAll(TranspilerCustoms.FFS, '') - .replaceAll(TranspilerCustoms.FFE, '') - .replaceAll(TranspilerCustoms.MFS, '') - .replaceAll(TranspilerCustoms.MFE, '') - .replaceAll(TranspilerCustoms.OS, '{') - .replaceAll(TranspilerCustoms.OE, '}') - .replaceAll(TranspilerCustoms.OSEP, ':') - .replaceAll(TranspilerCustoms.AS, '[') - .replaceAll(TranspilerCustoms.AE, ']') - .replaceAll(TranspilerCustoms.ASEP, ','); -} - -/** - * remove the set function - * @param code - The code to parse - * @returns The parsed result. - * @example - * ```js - * parseResult("#FUNCTION_SETTER#i#FUNCTION_SETTER#") // "i" - * ``` - */ - -export function removeSetFunc(code: string) { - return code - .replaceAll(TranspilerCustoms.FSET, '') - .replaceAll(TranspilerCustoms.FFUN, ''); -} - -/** - * Wraps a function result string with specific prefix and suffix. - * - * @param result - The function result string to wrap. - * @returns The wrapped function result string. - * - * @example - * ```js - * escapeFunctionResult("result") // #FUNCTION_FUNCTION_START##FUNCTION_START#result#FUNCTION_END##FUNCTION_FUNCTION_END# - * ``` - */ - -export function escapeFunctionResult(result: string) { - return `${TranspilerCustoms.FFS}${TranspilerCustoms.FS}${result}${TranspilerCustoms.FE}${TranspilerCustoms.FFE}`; -} - -/** - * Checks if the given code has a function. - * @param code - The code to check. - * @returns - Returns true if the code has a function, false otherwise. - * @example - * ```js - * hasFunction("$ping") // true - * ``` - */ -export function hasFunction(code: string) { - return functionFinderRegex.test(code); -} - -/** - * Generates data of the given function in the given code. - * @param code - The code to generate the function data in. - * @param func - The function to generate the data of. - * @param functions - The list of valid functions. - * @param command - The command that the code is in. - * @returns - Returns the generated function data. - * @example - * ```js - * getFunctionData("$ping", "$ping", ["$ping"]) // { inside: "", total: "$ping", splits: [], funcs: [], parsed: "$ping", type: "getter", code: [Function (anonymous)] } - * ``` - */ - -export function getFunctionData( - code: string, - func: string, - functions: string[], - command?: Command, -): FuncData { - let funcD = FUNCDATA[func]; - if (func === '$EXECUTEMAINCODEFUNCTION') { - funcD = { - name: '$EXECUTEMAINCODEFUNCTION', - brackets: true, - optional: false, - default: ['void'], - returns: undefined, - code: (() => { - /** Empty */ - }) as unknown as FunctionData['code'], - type: 'scope', - fields: [ - { - name: 'code', - type: 'string', - required: true, - }, - ], - description: 'Main Execution Function', - version: '7.0.0', - example: 'N/A', - }; - } - - const reg = new RegExp(`${func.replace('$', '\\$')}`, 'i'); - code = code.replace(reg, func); - code = code.replaceAll('`', TranspilerCustoms.SL); - - const functionPosition = code.indexOf(func); - code = code.substring(functionPosition, code.length); - - let leftCount = 0, - rightCount = 0, - i = 0; - let rawTotal = ''; - // eslint-disable-next-line no-constant-condition - while (true) { - if (i >= code.length) break; - if (!funcD?.brackets) { - break; - } - - if (!funcD?.optional && !code.slice(func.length).startsWith('[')) { - throw new TranspilerError('Function requires brackets', { - function: { - name: func, - code: func, - }, - cmd: command?.name, - path: command?.__path__, - }); - } - - if (rightCount === leftCount && rightCount !== 0) break; - // if (!areBracketsBalanced(code)) { - // throw new TranspilerError( - // "Brackets are not balanced in code:\n\n" + code, - // ); - // } - if (!code.slice(func.length).startsWith('[')) { - break; - } - - if (code[i] === '[') leftCount++; - else if (code[i] === ']') rightCount++; - rawTotal += code[i]; - i++; - } - - if (rawTotal === '') rawTotal = func; - if (!areBracketsBalanced(rawTotal) && func !== '$EXECUTEMAINCODEFUNCTION') - throw new TranspilerError('Brackets are not balanced', { - function: { - name: func, - code: rawTotal, - }, - cmd: command?.name, - path: command?.__path__, - }); - const funcs = []; - let inside = - rawTotal.endsWith(']') && rawTotal.startsWith(`${func}[`) - ? rawTotal.substring(func.length + 1, rawTotal.length - 1) - : undefined; - - const list = getFunctionList(inside ?? '', functions); - - functions.splice(0, list.length); - - let newinside = inside ?? ''; - while (list.length) { - const func = list.shift() ?? ''; - const funcData = getFunctionData(newinside, func, list); - - inside = inside?.replace( - funcData.inside?.replaceAll(TranspilerCustoms.FSEP, ';') ?? '', - funcData.parsed, - ); - newinside = newinside.replace(funcData.total, TranspilerCustoms.F); - - funcs.push(funcData); - } - - const splits = inside?.split(';') ?? []; - const parsed = inside?.replaceAll(';', TranspilerCustoms.FSEP); - - return { - inside, - total: rawTotal, - splits, - funcs, - parsed: parsed ?? '', - ...funcD, - }; -} - -export const functionFinderRegex = /(\$[a-z]+)/gi; - -/** - * Gets the list of functions in the given code. - * @param code - The code to get the functions in. - * @param functions - The list of valid functions. - * @returns - Returns the list of functions. - * @example - * ```js - * getFunctionList("$ping") // ["$ping"] - * ``` - */ - -export function getFunctionList(code: string, functions: string[]) { - const raws = code.match(functionFinderRegex); - if (!raws) return []; - const functionsThatExists = functions.filter((x) => - code.toLowerCase().includes(x.toLowerCase()), - ); - - const res = []; - - for (const raw of raws) { - const func = functionsThatExists.filter( - (x) => x.toLowerCase() === raw.toLowerCase().slice(0, x.length), - ); - if (func.length === 1) res.push(func[0]); - else if (func.length > 1) { - res.push(func.sort((a, b) => b.length - a.length)[0]); - } else { - continue; - } - } - - return res; -} - -/** - * Deep Reverses the given array of function data. - * @param arr - The array of function data to reverse. - * @returns - Returns the reversed array of function data. - */ - -export function reverseArray(arr: FuncData[]) { - const res: FuncData[] = []; - for (let i = arr.length - 1; i >= 0; i--) { - const el = arr[i]; - if (el.funcs.length) el.funcs = reverseArray(arr[i].funcs); - res.push(el); - } - - return res; -} - -/** - * Reverses the given code and function data. - * @param code - The code to reverse. - * @param funcs - The function data to reverse. - * @returns - Returns an object containing the reversed code and function data. - * @example - * ```js - * Reverse("$ping", [{ inside: "", total: "$ping", splits: [], funcs: [], parsed: "$ping", type: "getter", code: [Function (anonymous)] }]) // { code: "$ping", funcs: [{ inside: "", total: "$ping", splits: [], funcs: [], parsed: "$ping", type: "getter", code: [Function (anonymous)] }] } - * ``` - */ - -export function _reverse( - code: string, - funcs: FuncData[], -): { - code: string; - funcs: FuncData[]; - } { - let codeWithGenricFuncs = code; - - for (const func of funcs) { - codeWithGenricFuncs = codeWithGenricFuncs.replace( - func.total, - '#GENERIC-FUNCTION#', - ); - } - - const reversedFuncs = reverseArray(funcs); - - for (const func of reversedFuncs) { - codeWithGenricFuncs = codeWithGenricFuncs.replace( - '#GENERIC-FUNCTION#', - func.total, - ); - } - - return { code: codeWithGenricFuncs, funcs: reversedFuncs }; -} - -/** - * Executes the given code and function data to generate a js function. - * @param code - The code to execute. - * @param data - The function data to execute. - * @param scope - The scope to execute the code in. - * @param reverse - Whether to reverse the code and function data or not. - * @returns - Returns an object containing the generated js function and the scope. - * @example - * ```js - * ExecuteData("$ping", [{ inside: "", total: "$ping", splits: [], funcs: [], parsed: "$ping", type: "getter", code: [Function (anonymous)] }], []) // { code: "__$DISCORD_DATA$__.client.ws.data.ping", scope: [] } - * ``` - */ - -export function executeData( - code: string, - data: FuncData[], - scope: Scope[], - reverse = false, -) { - let i = 0; - - if (reverse) { - const { code: newCode, funcs } = _reverse(code, data); - code = newCode; - data = funcs; - scope[0].rest = code; - } - - while (i < data.length) { - let d = data[i]; - - const oldd = data[i].total; - if (d.type === 'scope' || d.type === 'scope_getter') { - const result = d.code(d, scope); - scope = result.scope; - d = result.data!; - - code = code.replace(d.total, result.code.replaceAll('$', '$$$$')); - // .replace(d.total.replaceAll(";", "#FUNCTION_SEPARATOR#"), result.code); - if (d.type === 'scope_getter') { - d.total = removeFunctionFunction(d.total); - scope[scope.length - 1].sendData.content = scope[ - scope.length - 1 - ].sendData.content.replace( - d.total, - result.code.replaceAll('$', '$$$$'), - ); - } - } else { - let executed: { - code: string; - scope: Scope[]; - }; - - if (d.funcs.length) { - executed = executeData( - parseResult(d.inside ?? ''), - d.funcs, - scope, - ); - - scope = executed.scope; - - const oldtotal = d.total; - - d.total = d.total - .replace( - d.inside ?? '', - executed.code.replaceAll('$', '$$$$'), - ) - .replace( - d.inside?.replaceAll(TranspilerCustoms.FSEP, ';') ?? '', - executed.code.replaceAll('$', '$$$$'), - ); - - code = code - .replace(oldtotal, d.total.replaceAll('$', '$$$$')) - .replace(oldd, d.total.replaceAll('$', '$$$$')); - - d.inside = executed.code; - d.splits = d.inside.split(';'); - - const result = d.code(d, scope); - - code = code - .replace(d.total, result.code.replaceAll('$', '$$$$')) - // .replace(d.total.replaceAll(";", "#FUNCTION_SEPARATOR#"), result.code) - .replace(oldd, result.code.replaceAll('$', '$$$$')); - - if (d.type === 'getter' || d.type === 'function_getter') { - let oldcontent = scope[scope.length - 1].sendData.content; - scope[scope.length - 1].sendData.content = scope[ - scope.length - 1 - ].sendData.content.replace( - d.total, - result.code.replaceAll('$', '$$$$'), - ); - if ( - oldcontent === scope[scope.length - 1].sendData.content - ) { - scope[scope.length - 1].sendData.content = scope[ - scope.length - 1 - ].sendData.content.replace( - d.total.replaceAll(';', TranspilerCustoms.FSEP), - result.code.replaceAll('$', '$$$$'), - ); - oldcontent = scope[scope.length - 1].sendData.content; - } - - if (oldcontent === scope[scope.length - 1].sendData.content) - scope[scope.length - 1].sendData.content = scope[ - scope.length - 1 - ].sendData.content.replace( - oldd, - result.code.replaceAll('$', '$$$$'), - ); - } - } else { - executed = d.code(d, scope); - scope = executed.scope; - - code = code.replace( - d.total, - executed.code.replaceAll('$', '$$$$'), - ); - - if (d.type === 'getter' || d.type === 'function_getter') { - const oldt = d.total; - const oldcontent = scope[scope.length - 1].sendData.content; - d.total = removeFunctionFunction(d.total); - scope[scope.length - 1].sendData.content = scope[ - scope.length - 1 - ].sendData.content.replace( - d.total, - executed.code.replaceAll('$', '$$$$'), - ); - if (oldcontent === scope[scope.length - 1].sendData.content) - scope[scope.length - 1].sendData.content = scope[ - scope.length - 1 - ].sendData.content.replace( - oldt, - executed.code.replaceAll('$', '$$$$'), - ); - } - } - } - - if ( - d.type !== 'getter' && - d.type !== 'function_getter' && - d.type !== 'scope_getter' - ) { - const s = scope[scope.length - 1]; - const oldt = d.total; - const oldcontent = s.sendData.content; - d.total = removeFunctionFunction(d.total); - s.sendData.content = s.sendData.content.replace(d.total, ''); - if (oldcontent === s.sendData.content) - s.sendData.content = s.sendData.content.replace(oldt, ''); - scope[scope.length - 1] = s; - } - - i++; - } - - return { - code, - scope, - }; -} - -/** - * uh idk what this does - * @param text - The text to parse. - * @returns - Returns the parsed text. - */ -export function _parseString(text: string) { - const reg = - /((#FUNCTION_START#([\s$a-z.0-9?(){}[\]._:'"`;=><,!-]|\n)+#FUNCTION_END#)|(__\$[a-z_?.()]+\$__))/gim; - let matches = text.match(reg); - const functionlist = matches?.slice(1) ?? []; - - let temptext = text; - - if (matches) { - matches = matches.reverse() as RegExpMatchArray; - let i = 0; - let u = 0; - while (i < (matches?.length ?? 0)) { - const match = matches?.[i]; - if (!match) break; - const position = temptext.indexOf(match); - const part = temptext.slice(position, position + match.length); - const temppart = parseResult(part); - - temptext = `${temptext.slice(0, position)}${`__$${u - .toString() - .repeat(temppart.length - 3)}$__`}${temptext.slice( - position + part.length, - text.length, - )}`; - text = `${text.slice(0, position)}\${${temppart}}${text.slice( - position + part.length, - text.length, - )}`; - - matches = (temptext.match(reg)?.reverse() ?? - []) as RegExpMatchArray; - i = 0; - u++; - } - - matches = (text.match(/__\$[0-9]+\$__/gi)?.reverse() ?? - []) as RegExpMatchArray; - - matches?.forEach((x, y) => { - text = text.replace(x, `\${${parseResult(functionlist[y])}}`); - }); - - text = `\`${text}\``; - } else { - text = `\`${text}\``; - } - - return text; -} - -/** - * converts the given string to boolean - * @param output - The string to convert. - * @returns - Returns the converted boolean. - * @example - * ```js - * convertToBool("true") // true - * convertToBool("yes") // true - * convertToBool("false") // false - * convertToBool("no") // false - * ``` - */ -export function convertToBool(output: string) { - return output === 'true' || output === 'yes' ? true : false; -} - -/** - * removes the FF transpiler customs - * @param total - The string to remove the customs from. - * @returns - Returns the string without the customs. - */ -export function removeFunctionFunction(total: string) { - if (!total.includes(TranspilerCustoms.FFS)) return total; - const parts = total.split(TranspilerCustoms.FFS).slice(1); - let i = 0; - while (i < parts.length) { - const part = parts[i].split(TranspilerCustoms.FFE)[0]; - total = total.replace(part, ''); - i++; - } - - return parseResult(total); -} - -export function removeFunction(total: string) { - if (!total.includes(TranspilerCustoms.FS)) return total; - const parts = total.split(TranspilerCustoms.FS).slice(1); - let i = 0; - while (i < parts.length) { - const part = parts[i].split(TranspilerCustoms.FE)[0]; - total = total.replace(part, ''); - i++; - } - - return total; -} - -export function removeMathFunction(total: string) { - if (!total.includes(TranspilerCustoms.MFS)) return total; - const parts = total.split(TranspilerCustoms.MFS).slice(1); - let i = 0; - while (i < parts.length) { - const part = parts[i].split(TranspilerCustoms.MFE)[0]; - total = total.replace(part, ''); - i++; - } - - return total; -} - -/** - * Checks if the given string is a bigint. - * @param string - The string to check. - * @returns - Returns true if the string is a bigint, false otherwise. - * @example - * ```js - * isBigInt("1n") // true - * isBigInt("1") // false - * ``` - */ - -export function isBigInt(string: string) { - return /^-?\d+n$/.exec(string) !== null; -} - -/** - * Removes the multi line comments from the given code. - * @param code - The code to remove the comments from. - * @returns - Returns the code without the comments. - * @example - * ```js - * removeMultiLineComments("/* comment *\/") // "" - * ``` - */ -export function removeMultiLineComments(code: string) { - return code.replace(/\/\*[\s\S]*?\*\//g, ''); -} diff --git a/lib/aoi.js/src/core/parsers/condition/main.test.ts b/lib/aoi.js/src/utils/Constants/functions.ts similarity index 100% rename from lib/aoi.js/src/core/parsers/condition/main.test.ts rename to lib/aoi.js/src/utils/Constants/functions.ts diff --git a/lib/aoi.js/src/utils/Helpers/core.ts b/lib/aoi.js/src/utils/Helpers/core.ts new file mode 100644 index 000000000..8a8e9d02b --- /dev/null +++ b/lib/aoi.js/src/utils/Helpers/core.ts @@ -0,0 +1,222 @@ +import StringObject from '@aoi.js/core/builders/StringObject.js'; +import { parseStringObject } from '@aoi.js/core/parsers/object.js'; +import { TranspilerCustoms } from '@aoi.js/typings/enum.js'; +import { type Safe } from '@aoi.js/typings/type.js'; + +/** + * Escapes a variable name by wrapping it with '__$' and '$__'. + * + * @param name - The variable name to escape. + * @returns The escaped variable name. + * @example + * ```js + * escapeVars("a") // "__$a$__" + * ``` + */ +export function escapeVars(name: string) { + return `__$${name}$__`; +} + +/** + * Escapes a result by wrapping it with TranspilerCustoms.FS and TranspilerCustoms.FE. + * @param res - The result to escape. + * @returns The escaped result. + * + * @example + * ```js + * escapeResult("a") // "#FUNCTION_START#a#FUNCTION_END#" + * ``` + */ + +export function escapeResult(res: string) { + return `${TranspilerCustoms.FS}${res}${TranspilerCustoms.FE}`; +} + +/** + * Escapes a math result by wrapping it with TranspilerCustoms.MFS and TranspilerCustoms.MFE. + * @param res - The result to escape. + * @returns The escaped result. + * @example + * ```js + * escapeMathResult("1+1") // "#MATH_FUNCTION_START#1+1#MATH_FUNCTION_END#" + * ``` + */ +export function escapeMathResult(res: string) { + return `${TranspilerCustoms.MFS}${res}${TranspilerCustoms.MFE}`; +} + +/** + * parse the result by removing all the customs + * @param result - The result to parse. + * @returns The parsed result. + * @example + * ```js + * parseResult("#MATH_FUNCTION_START#1+1#MATH_FUNCTION_END#") // "1+1" + * ``` + */ +export function parseResult(result: string) { + if (typeof result !== 'string') return result; + return result + .replaceAll(TranspilerCustoms.FS, '') + .replaceAll(TranspilerCustoms.FE, '') + .replaceAll(TranspilerCustoms.FSEP, ';') + .replaceAll(TranspilerCustoms.FFUN, '') + .replaceAll(TranspilerCustoms.FSET, '') + .replaceAll(TranspilerCustoms.FGET, '') + .replaceAll(TranspilerCustoms.FISS, '') + .replaceAll(TranspilerCustoms.FISE, '') + .replaceAll(TranspilerCustoms.FSS, '') + .replaceAll(TranspilerCustoms.FSE, '') + .replaceAll(TranspilerCustoms.FFS, '') + .replaceAll(TranspilerCustoms.FFE, '') + .replaceAll(TranspilerCustoms.MFS, '') + .replaceAll(TranspilerCustoms.MFE, '') + .replaceAll(TranspilerCustoms.OS, '{') + .replaceAll(TranspilerCustoms.OE, '}') + .replaceAll(TranspilerCustoms.OSEP, ':') + .replaceAll(TranspilerCustoms.AS, '[') + .replaceAll(TranspilerCustoms.AE, ']') + .replaceAll(TranspilerCustoms.ASEP, ','); +} + +/** + * remove the set function + * @param code - The code to parse + * @returns The parsed result. + * @example + * ```js + * parseResult("#FUNCTION_SETTER#i#FUNCTION_SETTER#") // "i" + * ``` + */ + +export function removeSetFunc(code: string) { + return code + .replaceAll(TranspilerCustoms.FSET, '') + .replaceAll(TranspilerCustoms.FFUN, ''); +} + +/** + * Removes the multi line comments from the given code. + * @param code - The code to remove the comments from. + * @returns Returns the code without the comments. + * @example + * ```js + * removeMultiLineComments("/* comment *\/") // "" + * ``` + */ +export function removeMultiLineComments(code: string) { + return code.replace(/\/\*[\s\S]*?\*\//g, ''); +} + +/** + * parse data to its actual type + * @param text - The string to check. + * @returns - Returns the parsed data. + * @example + * ```js + * parseData("1") // 1 + * parseData("1n") // 1n + * parseData("null") // null + * // and so on... + * ``` + */ +export function parseData(text: string) { + if (text === '') return text; + else if (!isNaN(Number(text)) && Number.isSafeInteger(Number(text))) + return Number(text); + else if ( + (!isNaN(Number(text)) && !Number.isSafeInteger(text)) || + isBigInt(text) + ) + return BigInt(text.replace('n', '')); + else if (text === 'null') return null; + else if (text === 'undefined') return undefined; + else if (text === 'true' || text === 'false') return text === 'true'; + else { + try { + return JSON.parse(text) as Record; + } catch { + if (text.startsWith('{') && text.endsWith('}')) { + const so = new StringObject('{'); + so.addEnd('}'); + let e: Record; + eval(`e = ${parseStringObject(text, so).solve()}`); + // @ts-expect-error - we use eval here + return e; + } else if (text.startsWith('[') && text.endsWith(']')) { + const so = new StringObject('['); + so.addEnd(']'); + let e: unknown[]; + eval(`e = ${parseStringObject(text, so).solve()}`); + // @ts-expect-error - we use eval here + return e; + } else return text; + } + } +} + +/** + * Checks if the given string is a bigint. + * @param string - The string to check. + * @returns - Returns true if the string is a bigint, false otherwise. + * @example + * ```js + * isBigInt("1n") // true + * isBigInt("1") // false + * ``` + */ + +export function isBigInt(string: string) { + return /^-?\d+n$/.exec(string) !== null; +} + +export function stringify(data: any): string { + switch (typeof data) { + case 'bigint': + return data + 'n'; + case 'object': + return JSON.stringify(data); + case 'undefined': + return 'undefined'; + default: + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + return data.toString() as string; + } +} + +/** + * Safely resolves a promise. + * @param promise - The promise to resolve. + * @returns - Returns a tuple with the error and the data. + */ +export async function safeAsync(promise: Promise): Promise> { + return promise + .then((data) => [undefined, data]) + .catch((error) => [error, undefined]) as Promise>; +} + +/** + * Safely executes a function. + * @param fn - The function to execute. + * @returns - Returns a tuple with the error and the data. + */ +export function safeSync(fn: () => T): Safe { + try { + return [undefined, fn()]; + } catch (error) { + return [error as Error, undefined]; + } +} + +/** + * Safely executes a function or a promise. + * @param promise - The promise to resolve. + * @returns - Returns a tuple with the error and the data. + */ +export function safe( promise: Promise): Promise>; +export function safe(fn: () => T): Safe; +// eslint-disable-next-line @typescript-eslint/promise-function-async +export function safe(funcOrPromise: Promise | (() => T)): Safe | Promise> { + if (funcOrPromise instanceof Promise) return safeAsync(funcOrPromise); + else return safeSync(funcOrPromise); +} \ No newline at end of file diff --git a/lib/aoi.js/src/utils/Helpers/events.ts b/lib/aoi.js/src/utils/Helpers/events.ts new file mode 100644 index 000000000..ab4688e78 --- /dev/null +++ b/lib/aoi.js/src/utils/Helpers/events.ts @@ -0,0 +1,17 @@ +import { type ITranspilerData } from '../../typings/interface.js'; +import { type Optional } from '../../typings/type.js'; + +export function createData(data: Optional): Optional { + const obj: Optional = { + bot: data.bot, + client: data.client, + }; + + if (data.channel) obj.channel = data.channel; + if (data.guild) obj.guild = data.guild; + if (data.message) obj.message = data.message; + if (data.args) obj.args = data.args; + if (data.data) obj.data = data.data; + + return obj; +} diff --git a/lib/aoi.js/src/utils/Helpers/functions.ts b/lib/aoi.js/src/utils/Helpers/functions.ts new file mode 100644 index 000000000..550dc538f --- /dev/null +++ b/lib/aoi.js/src/utils/Helpers/functions.ts @@ -0,0 +1,93 @@ +import { parseResult } from './core.js'; + +export function isMathExpression(expression: string): boolean { + expression = parseResult(expression.trim()); + const numbers = [ + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '.', + ',', + ]; + const mathOperators = [ + '+', + '-', + '*', + '/', + '%', + '**', + '(', + ')', + '^', + '|', + '&', + '>>', + '<<', + ]; + const mathClassFunctions = [ + 'abs', + 'acos', + 'acosh', + 'asin', + 'asinh', + 'atan', + 'atan2', + 'atanh', + 'cbrt', + 'ceil', + 'clz32', + 'cos', + 'cosh', + 'exp', + 'expm1', + 'floor', + 'fround', + 'hypot', + 'imul', + 'log', + 'log10', + 'log1p', + 'log2', + 'max', + 'min', + 'pow', + 'random', + 'round', + 'sign', + 'sin', + 'sinh', + 'sqrt', + 'tan', + 'tanh', + 'trunc', + ]; + const mathClassProperties = [ + 'EULERNUM', + 'LN10', + 'LN2', + 'LOG10E', + 'LOG2E', + 'PI', + 'SQRT1_2', + 'SQRT2', + ]; + const ops = [ + ...numbers, + ...mathOperators, + ...mathClassFunctions, + ...mathClassProperties, + ]; + + for (const op of ops) { + expression = expression.replaceAll(op, ''); + } + + return expression.trim() === ''; +} diff --git a/lib/aoi.js/tests/index.test.ts b/lib/aoi.js/tests/index.test.ts deleted file mode 100644 index 16aec144a..000000000 --- a/lib/aoi.js/tests/index.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -import log from '../src/index.js'; - -test('log', () => { - const spy = jest.spyOn(console, 'log'); - log('hello'); - expect(spy).toHaveBeenCalledWith('hello'); -}); \ No newline at end of file diff --git a/lib/aoi.js/tsconfig.cjs.json b/lib/aoi.js/tsconfig.cjs.json index 3c63a031b..9f0aaf288 100644 --- a/lib/aoi.js/tsconfig.cjs.json +++ b/lib/aoi.js/tsconfig.cjs.json @@ -12,4 +12,5 @@ "tsBuildInfoFile": "./dist/cjs/.tsbuildinfo", "incremental": true }, + "exclude": ["src/**/*.test.ts"] } \ No newline at end of file diff --git a/lib/aoi.js/tsconfig.eslint.json b/lib/aoi.js/tsconfig.eslint.json index 920039f3b..db3f6bdb7 100644 --- a/lib/aoi.js/tsconfig.eslint.json +++ b/lib/aoi.js/tsconfig.eslint.json @@ -13,7 +13,7 @@ "src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", - "__tests__" + "tests" ], "exclude": ["node_modules"] } \ No newline at end of file diff --git a/lib/aoi.js/tsconfig.esm.json b/lib/aoi.js/tsconfig.esm.json index ed4706d69..309814447 100644 --- a/lib/aoi.js/tsconfig.esm.json +++ b/lib/aoi.js/tsconfig.esm.json @@ -12,4 +12,5 @@ "tsBuildInfoFile": "./dist/esm/.tsbuildinfo", "incremental": true }, + "exclude": ["src/**/*.test.ts"] } \ No newline at end of file diff --git a/lib/aoi.js/tsconfig.json b/lib/aoi.js/tsconfig.json index 3c59388d2..f386ce4b2 100644 --- a/lib/aoi.js/tsconfig.json +++ b/lib/aoi.js/tsconfig.json @@ -2,114 +2,29 @@ "extends": "../../tsconfig.json", "include": ["./src/**/*.ts"], "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - "incremental": true /* Save .tsbuildinfo files to allow for incremental compilation of projects. */, - "composite": true /* Enable constraints that allow a TypeScript project to be used with project references. */, - "tsBuildInfoFile": "./.tsbuildinfo" /* Specify the path to .tsbuildinfo incremental compilation file. */, - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "CommonJS" /* Specify what module code is generated. */, - "moduleResolution": "node10" /* Specify how TypeScript looks up a file from a given module specifier. */, - "baseUrl": "." /* Specify the base directory to resolve non-relative module names. */, + "incremental": true, + "composite": true, + "tsBuildInfoFile": "./.tsbuildinfo", + "target": "ESNext", + "module": "CommonJS", + "moduleResolution": "node10", + "baseUrl": ".", "paths": { "@aoi.js/*": ["./src/*"], "@aoirepo/*": ["../../*"] - } /* Specify a set of entries that re-map imports to additional lookup locations. */, - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - "rootDir": "./src" /* Specify the root folder within your source files. */, - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - "allowImportingTsExtensions": false, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - "allowJs": false, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - "checkJs": false, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - "noEmit": false, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - "declarationDir": "./dist/types", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - - /* Type Checking */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "rootDir": "./src", + "allowImportingTsExtensions": false, + "allowJs": false, + "checkJs": false, + "declaration": true, + "outDir": "./dist", + "noEmit": false, + "declarationDir": "./dist/types", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true }, - "exclude": ["coverage","node_modules"] + "exclude": ["coverage", "node_modules"] } diff --git a/lib/aoi.js/typedoc.json b/lib/aoi.js/typedoc.json deleted file mode 100755 index 2dd7e87ce..000000000 --- a/lib/aoi.js/typedoc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "entryPoints": [ - "./src/index.ts" - ], - "out": "./docs", - "customCss": "./packers/custom.css", - "tsconfig": "./tsconfig.json", - "entryPointStrategy": "resolve", - "json": "docs/data.json", - "commentStyle": "all", - "jsDocCompatibility": true, - "includeVersion": true, - "categorizeByGroup": true, - "darkHighlightTheme": "material-theme-palenight", - "navigation": true, - "theme": "hierarchy" -} \ No newline at end of file diff --git a/lib/structures/package.json b/lib/structures/package.json index 7afe052ad..8f1bc92b2 100644 --- a/lib/structures/package.json +++ b/lib/structures/package.json @@ -1,8 +1,9 @@ { - "name": "@akarui/structures", + "name": "@aoijs/structures", "version": "0.0.1", - "description": "@akarui/structures - A Extension for Aoi.js", + "description": "@aoijs/structures - A Extension for Aoi.js", "main": "./dist/cjs/index.js", + "type": "module", "module": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", "exports": { diff --git a/lib/structures/src/index.ts b/lib/structures/src/index.ts index ab0639249..bc01ddc32 100644 --- a/lib/structures/src/index.ts +++ b/lib/structures/src/index.ts @@ -14,7 +14,7 @@ limitations under the License. */ -import Group from "./Group/index.js"; -import LinkedList from "./LinkedList/index.js"; -import PriorityQueue from "./PriorityQueue/index.js"; -export { Group, LinkedList,PriorityQueue }; +import Group from './Group/index.js'; +import LinkedList from './LinkedList/index.js'; +import PriorityQueue from './PriorityQueue/index.js'; +export { Group, LinkedList, PriorityQueue }; diff --git a/package.json b/package.json index d7042ca55..4591bc950 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@types/eslint": "^8.56.10", "@types/eslint__eslintrc": "^2.1.1", "@types/eslint__js": "^8.42.3", - "@types/jest": "^29.5.12", "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "^7.6.0", "@typescript-eslint/parser": ">=7.0.2", @@ -46,14 +45,16 @@ "eslint-config-xo-typescript": "^4.0.0", "eslint-plugin-jsdoc": "^48.2.3", "eslint-plugin-tsdoc": "^0.2.17", + "glob": "^11.0.0", "globals": "^15.0.0", "husky": "^9.0.11", - "jest": "^29.7.0", "prettier": "^3.2.5", - "ts-jest": "^29.1.2", + "ts-patch": "^3.2.1", "tslib": "^2.6.2", - "typescript": "^5.4.5", - "typescript-eslint": "^7.6.0" + "tsx": "^4.19.1", + "typescript": "^5.5.4", + "typescript-eslint": "^7.6.0", + "typescript-transform-paths": "^3.5.1" }, "dependencies": { "boxen": "^7.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8332559f..e779007d1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '9.0' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -19,101 +19,104 @@ importers: version: 2.9.2 commander: specifier: ^12.0.0 - version: 12.0.0 + version: 12.1.0 enquirer: specifier: ^2.4.1 version: 2.4.1 ora: specifier: ^8.0.1 - version: 8.0.1 + version: 8.1.0 devDependencies: '@commitlint/cli': specifier: ^19.2.1 - version: 19.2.1(@types/node@20.12.7)(typescript@5.4.5) + version: 19.5.0(@types/node@20.16.5)(typescript@5.5.4) '@commitlint/config-conventional': specifier: ^19.1.0 - version: 19.1.0 + version: 19.5.0 '@eslint/eslintrc': specifier: ^3.0.2 - version: 3.0.2 + version: 3.1.0 '@eslint/js': specifier: ^9.0.0 - version: 9.0.0 + version: 9.11.0 '@stylistic/eslint-plugin': specifier: ^1.7.2 - version: 1.7.2(eslint@9.0.0)(typescript@5.4.5) + version: 1.8.1(eslint@9.11.0)(typescript@5.5.4) '@stylistic/eslint-plugin-js': specifier: ^1.7.2 - version: 1.7.2(eslint@9.0.0) + version: 1.8.1(eslint@9.11.0) '@stylistic/eslint-plugin-ts': specifier: ^1.7.2 - version: 1.7.2(eslint@9.0.0)(typescript@5.4.5) + version: 1.8.1(eslint@9.11.0)(typescript@5.5.4) '@types/eslint': specifier: ^8.56.10 - version: 8.56.10 + version: 8.56.12 '@types/eslint__eslintrc': specifier: ^2.1.1 - version: 2.1.1 + version: 2.1.2 '@types/eslint__js': specifier: ^8.42.3 version: 8.42.3 - '@types/jest': - specifier: ^29.5.12 - version: 29.5.12 '@types/node': specifier: ^20.12.7 - version: 20.12.7 + version: 20.16.5 '@typescript-eslint/eslint-plugin': specifier: ^7.6.0 - version: 7.6.0(@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5))(eslint@9.0.0)(typescript@5.4.5) + version: 7.18.0(@typescript-eslint/parser@8.7.0)(eslint@9.11.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: '>=7.0.2' - version: 7.6.0(eslint@9.0.0)(typescript@5.4.5) + version: 8.7.0(eslint@9.11.0)(typescript@5.5.4) acorn: specifier: ^8.11.3 - version: 8.11.3 + version: 8.12.1 eslint: specifier: ^9.0.0 - version: 9.0.0 + version: 9.11.0 eslint-config-xo-typescript: specifier: ^4.0.0 - version: 4.0.0(@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5))(eslint@9.0.0)(typescript@5.4.5))(@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5))(eslint@9.0.0)(typescript@5.4.5) + version: 4.0.0(@typescript-eslint/eslint-plugin@7.18.0)(@typescript-eslint/parser@8.7.0)(eslint@9.11.0)(typescript@5.5.4) eslint-plugin-jsdoc: specifier: ^48.2.3 - version: 48.2.3(eslint@9.0.0) + version: 48.11.0(eslint@9.11.0) eslint-plugin-tsdoc: specifier: ^0.2.17 version: 0.2.17 + glob: + specifier: ^11.0.0 + version: 11.0.0 globals: specifier: ^15.0.0 - version: 15.0.0 + version: 15.9.0 husky: specifier: ^9.0.11 - version: 9.0.11 - jest: - specifier: ^29.7.0 - version: 29.7.0(@types/node@20.12.7) + version: 9.1.6 prettier: specifier: ^3.2.5 - version: 3.2.5 - ts-jest: - specifier: ^29.1.2 - version: 29.1.2(@babel/core@7.24.4)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.4))(jest@29.7.0(@types/node@20.12.7))(typescript@5.4.5) + version: 3.3.3 + ts-patch: + specifier: ^3.2.1 + version: 3.2.1 tslib: specifier: ^2.6.2 - version: 2.6.2 + version: 2.7.0 + tsx: + specifier: ^4.19.1 + version: 4.19.1 typescript: - specifier: ^5.4.5 - version: 5.4.5 + specifier: ^5.5.4 + version: 5.5.4 typescript-eslint: specifier: ^7.6.0 - version: 7.6.0(eslint@9.0.0)(typescript@5.4.5) + version: 7.18.0(eslint@9.11.0)(typescript@5.5.4) + typescript-transform-paths: + specifier: ^3.5.1 + version: 3.5.1(typescript@5.5.4) lib/aoi.cli: {} lib/aoi.db: dependencies: - '@akarui/structures': + '@aoijs/structures': specifier: workspace:^ version: link:../structures @@ -121,100 +124,31 @@ importers: lib/aoi.js: dependencies: - '@akarui/structures': - specifier: ^2.0.1 - version: 2.1.0 - boxen: - specifier: ^7.1.1 - version: 7.1.1 - chalk: - specifier: ^5.3.0 - version: 5.3.0 - cli-spinners: - specifier: ^2.9.2 - version: 2.9.2 - dotenv: - specifier: ^16.3.1 - version: 16.4.5 - ora: - specifier: ^7.0.1 - version: 7.0.1 - undici: - specifier: ^5.28.2 - version: 5.28.4 - ws: - specifier: ^8.14.2 - version: 8.17.0 - zeneth: - specifier: ^0.0.1 - version: 0.0.1 + '@aoijs/structures': + specifier: workspace:^ + version: link:../structures + '@discordjs/collection': + specifier: ^2.1.1 + version: 2.1.1 + '@discordjs/ws': + specifier: ^2.0.0 + version: 2.0.0 + discord.js: + specifier: ^14.16.2 + version: 14.16.2 + uglify-js: + specifier: ^3.18.0 + version: 3.19.3 devDependencies: - '@eslint/eslintrc': - specifier: ^3.0.2 - version: 3.0.2 - '@eslint/js': - specifier: ^9.0.0 - version: 9.0.0 - '@types/js-beautify': - specifier: ^1.14.3 - version: 1.14.3 - '@types/node': - specifier: ^20.10.3 - version: 20.12.7 '@types/uglify-js': - specifier: ^3.17.1 + specifier: ^3.17.5 version: 3.17.5 - '@types/ws': - specifier: ^8.5.10 - version: 8.5.10 - '@typescript-eslint/eslint-plugin': - specifier: ^7.5.0 - version: 7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': - specifier: ^7.5.0 - version: 7.6.0(eslint@8.57.0)(typescript@5.4.5) - csso: - specifier: ^5.0.5 - version: 5.0.5 - eslint: - specifier: ^8.57.0 - version: 8.57.0 - eslint-config-xo-typescript: - specifier: ^4.0.0 - version: 4.0.0(@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) - globals: - specifier: ^15.0.0 - version: 15.0.0 - js-beautify: - specifier: ^1.14.11 - version: 1.15.1 - typedoc: - specifier: ^0.25.4 - version: 0.25.13(typescript@5.4.5) - typedoc-github-wiki-theme: - specifier: ^1.1.0 - version: 1.1.0(typedoc-plugin-markdown@3.17.1(typedoc@0.25.13(typescript@5.4.5)))(typedoc@0.25.13(typescript@5.4.5)) - typedoc-plugin-extras: - specifier: ^3.0.0 - version: 3.0.0(typedoc@0.25.13(typescript@5.4.5)) - typedoc-plugin-markdown: - specifier: ^3.17.1 - version: 3.17.1(typedoc@0.25.13(typescript@5.4.5)) - typedoc-plugin-mermaid: - specifier: ^1.10.0 - version: 1.10.0(typedoc@0.25.13(typescript@5.4.5)) - typedoc-theme-hierarchy: - specifier: ^4.1.2 - version: 4.1.2(typedoc@0.25.13(typescript@5.4.5)) - typescript: - specifier: ^5.4.4 - version: 5.4.5 - typescript-eslint: - specifier: ^7.5.0 - version: 7.6.0(eslint@8.57.0)(typescript@5.4.5) - uglify-js: - specifier: ^3.17.4 - version: 3.17.4 + '@vladfrangu/async_event_emitter': + specifier: ^2.4.6 + version: 2.4.6 + discord-api-types: + specifier: ^0.37.100 + version: 0.37.101 lib/aoi.music: {} @@ -230,535 +164,796 @@ importers: packages: - '@aashutoshrathi/word-wrap@1.2.6': - resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} - engines: {node: '>=0.10.0'} - - '@akarui/structures@2.1.0': - resolution: {integrity: sha512-kGvrGV/CrTzcCZC0zJmW3ZV8rMBDfZo9QlHgmUILshbC8q8ClkrU/hvpQo8IVORKFrYTKf8ZG5dhP4hGCIuPtA==} - - '@ampproject/remapping@2.3.0': - resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} - engines: {node: '>=6.0.0'} - - '@babel/code-frame@7.24.2': - resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} - engines: {node: '>=6.9.0'} - - '@babel/compat-data@7.24.4': - resolution: {integrity: sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ==} - engines: {node: '>=6.9.0'} - - '@babel/core@7.24.4': - resolution: {integrity: sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg==} - engines: {node: '>=6.9.0'} - - '@babel/generator@7.24.4': - resolution: {integrity: sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-compilation-targets@7.23.6': - resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-environment-visitor@7.22.20': - resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-function-name@7.23.0': - resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-hoist-variables@7.22.5': - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-imports@7.24.3': - resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-transforms@7.23.3': - resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-plugin-utils@7.24.0': - resolution: {integrity: sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==} - engines: {node: '>=6.9.0'} - - '@babel/helper-simple-access@7.22.5': - resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} - engines: {node: '>=6.9.0'} - - '@babel/helper-split-export-declaration@7.22.6': - resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.24.1': - resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.22.20': - resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-option@7.23.5': - resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} - engines: {node: '>=6.9.0'} - - '@babel/helpers@7.24.4': - resolution: {integrity: sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==} - engines: {node: '>=6.9.0'} - - '@babel/highlight@7.24.2': - resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.24.4': - resolution: {integrity: sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/plugin-syntax-async-generators@7.8.4': - resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-bigint@7.8.3': - resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-class-properties@7.12.13': - resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-import-meta@7.10.4': - resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-json-strings@7.8.3': - resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-jsx@7.24.1': - resolution: {integrity: sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-logical-assignment-operators@7.10.4': - resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': - resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-numeric-separator@7.10.4': - resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-object-rest-spread@7.8.3': - resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-optional-catch-binding@7.8.3': - resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-optional-chaining@7.8.3': - resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-top-level-await@7.14.5': - resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-typescript@7.24.1': - resolution: {integrity: sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/template@7.24.0': - resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} + /@babel/code-frame@7.24.7: + resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.24.7 + picocolors: 1.1.0 + dev: true - '@babel/traverse@7.24.1': - resolution: {integrity: sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==} + /@babel/helper-validator-identifier@7.24.7: + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} engines: {node: '>=6.9.0'} + dev: true - '@babel/types@7.24.0': - resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} + /@babel/highlight@7.24.7: + resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.24.7 + chalk: 2.4.2 + js-tokens: 4.0.0 + picocolors: 1.1.0 + dev: true - '@bcoe/v8-coverage@0.2.3': - resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - - '@commitlint/cli@19.2.1': - resolution: {integrity: sha512-cbkYUJsLqRomccNxvoJTyv5yn0bSy05BBizVyIcLACkRbVUqYorC351Diw/XFSWC/GtpwiwT2eOvQgFZa374bg==} + /@commitlint/cli@19.5.0(@types/node@20.16.5)(typescript@5.5.4): + resolution: {integrity: sha512-gaGqSliGwB86MDmAAKAtV9SV1SHdmN8pnGq4EJU4+hLisQ7IFfx4jvU4s+pk6tl0+9bv6yT+CaZkufOinkSJIQ==} engines: {node: '>=v18'} hasBin: true + dependencies: + '@commitlint/format': 19.5.0 + '@commitlint/lint': 19.5.0 + '@commitlint/load': 19.5.0(@types/node@20.16.5)(typescript@5.5.4) + '@commitlint/read': 19.5.0 + '@commitlint/types': 19.5.0 + tinyexec: 0.3.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - typescript + dev: true - '@commitlint/config-conventional@19.1.0': - resolution: {integrity: sha512-KIKD2xrp6Uuk+dcZVj3++MlzIr/Su6zLE8crEDQCZNvWHNQSeeGbzOlNtsR32TUy6H3JbP7nWgduAHCaiGQ6EA==} + /@commitlint/config-conventional@19.5.0: + resolution: {integrity: sha512-OBhdtJyHNPryZKg0fFpZNOBM1ZDbntMvqMuSmpfyP86XSfwzGw4CaoYRG4RutUPg0BTK07VMRIkNJT6wi2zthg==} engines: {node: '>=v18'} + dependencies: + '@commitlint/types': 19.5.0 + conventional-changelog-conventionalcommits: 7.0.2 + dev: true - '@commitlint/config-validator@19.0.3': - resolution: {integrity: sha512-2D3r4PKjoo59zBc2auodrSCaUnCSALCx54yveOFwwP/i2kfEAQrygwOleFWswLqK0UL/F9r07MFi5ev2ohyM4Q==} + /@commitlint/config-validator@19.5.0: + resolution: {integrity: sha512-CHtj92H5rdhKt17RmgALhfQt95VayrUo2tSqY9g2w+laAXyk7K/Ef6uPm9tn5qSIwSmrLjKaXK9eiNuxmQrDBw==} engines: {node: '>=v18'} + dependencies: + '@commitlint/types': 19.5.0 + ajv: 8.17.1 + dev: true - '@commitlint/ensure@19.0.3': - resolution: {integrity: sha512-SZEpa/VvBLoT+EFZVb91YWbmaZ/9rPH3ESrINOl0HD2kMYsjvl0tF7nMHh0EpTcv4+gTtZBAe1y/SS6/OhfZzQ==} + /@commitlint/ensure@19.5.0: + resolution: {integrity: sha512-Kv0pYZeMrdg48bHFEU5KKcccRfKmISSm9MvgIgkpI6m+ohFTB55qZlBW6eYqh/XDfRuIO0x4zSmvBjmOwWTwkg==} engines: {node: '>=v18'} + dependencies: + '@commitlint/types': 19.5.0 + lodash.camelcase: 4.3.0 + lodash.kebabcase: 4.1.1 + lodash.snakecase: 4.1.1 + lodash.startcase: 4.4.0 + lodash.upperfirst: 4.3.1 + dev: true - '@commitlint/execute-rule@19.0.0': - resolution: {integrity: sha512-mtsdpY1qyWgAO/iOK0L6gSGeR7GFcdW7tIjcNFxcWkfLDF5qVbPHKuGATFqRMsxcO8OUKNj0+3WOHB7EHm4Jdw==} + /@commitlint/execute-rule@19.5.0: + resolution: {integrity: sha512-aqyGgytXhl2ejlk+/rfgtwpPexYyri4t8/n4ku6rRJoRhGZpLFMqrZ+YaubeGysCP6oz4mMA34YSTaSOKEeNrg==} engines: {node: '>=v18'} + dev: true - '@commitlint/format@19.0.3': - resolution: {integrity: sha512-QjjyGyoiVWzx1f5xOteKHNLFyhyweVifMgopozSgx1fGNrGV8+wp7k6n1t6StHdJ6maQJ+UUtO2TcEiBFRyR6Q==} + /@commitlint/format@19.5.0: + resolution: {integrity: sha512-yNy088miE52stCI3dhG/vvxFo9e4jFkU1Mj3xECfzp/bIS/JUay4491huAlVcffOoMK1cd296q0W92NlER6r3A==} engines: {node: '>=v18'} + dependencies: + '@commitlint/types': 19.5.0 + chalk: 5.3.0 + dev: true - '@commitlint/is-ignored@19.0.3': - resolution: {integrity: sha512-MqDrxJaRSVSzCbPsV6iOKG/Lt52Y+PVwFVexqImmYYFhe51iVJjK2hRhOG2jUAGiUHk4jpdFr0cZPzcBkSzXDQ==} + /@commitlint/is-ignored@19.5.0: + resolution: {integrity: sha512-0XQ7Llsf9iL/ANtwyZ6G0NGp5Y3EQ8eDQSxv/SRcfJ0awlBY4tHFAvwWbw66FVUaWICH7iE5en+FD9TQsokZ5w==} engines: {node: '>=v18'} + dependencies: + '@commitlint/types': 19.5.0 + semver: 7.6.3 + dev: true - '@commitlint/lint@19.1.0': - resolution: {integrity: sha512-ESjaBmL/9cxm+eePyEr6SFlBUIYlYpI80n+Ltm7IA3MAcrmiP05UMhJdAD66sO8jvo8O4xdGn/1Mt2G5VzfZKw==} + /@commitlint/lint@19.5.0: + resolution: {integrity: sha512-cAAQwJcRtiBxQWO0eprrAbOurtJz8U6MgYqLz+p9kLElirzSCc0vGMcyCaA1O7AqBuxo11l1XsY3FhOFowLAAg==} engines: {node: '>=v18'} + dependencies: + '@commitlint/is-ignored': 19.5.0 + '@commitlint/parse': 19.5.0 + '@commitlint/rules': 19.5.0 + '@commitlint/types': 19.5.0 + dev: true - '@commitlint/load@19.2.0': - resolution: {integrity: sha512-XvxxLJTKqZojCxaBQ7u92qQLFMMZc4+p9qrIq/9kJDy8DOrEa7P1yx7Tjdc2u2JxIalqT4KOGraVgCE7eCYJyQ==} + /@commitlint/load@19.5.0(@types/node@20.16.5)(typescript@5.5.4): + resolution: {integrity: sha512-INOUhkL/qaKqwcTUvCE8iIUf5XHsEPCLY9looJ/ipzi7jtGhgmtH7OOFiNvwYgH7mA8osUWOUDV8t4E2HAi4xA==} engines: {node: '>=v18'} + dependencies: + '@commitlint/config-validator': 19.5.0 + '@commitlint/execute-rule': 19.5.0 + '@commitlint/resolve-extends': 19.5.0 + '@commitlint/types': 19.5.0 + chalk: 5.3.0 + cosmiconfig: 9.0.0(typescript@5.5.4) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.16.5)(cosmiconfig@9.0.0)(typescript@5.5.4) + lodash.isplainobject: 4.0.6 + lodash.merge: 4.6.2 + lodash.uniq: 4.5.0 + transitivePeerDependencies: + - '@types/node' + - typescript + dev: true - '@commitlint/message@19.0.0': - resolution: {integrity: sha512-c9czf6lU+9oF9gVVa2lmKaOARJvt4soRsVmbR7Njwp9FpbBgste5i7l/2l5o8MmbwGh4yE1snfnsy2qyA2r/Fw==} + /@commitlint/message@19.5.0: + resolution: {integrity: sha512-R7AM4YnbxN1Joj1tMfCyBryOC5aNJBdxadTZkuqtWi3Xj0kMdutq16XQwuoGbIzL2Pk62TALV1fZDCv36+JhTQ==} engines: {node: '>=v18'} + dev: true - '@commitlint/parse@19.0.3': - resolution: {integrity: sha512-Il+tNyOb8VDxN3P6XoBBwWJtKKGzHlitEuXA5BP6ir/3loWlsSqDr5aecl6hZcC/spjq4pHqNh0qPlfeWu38QA==} + /@commitlint/parse@19.5.0: + resolution: {integrity: sha512-cZ/IxfAlfWYhAQV0TwcbdR1Oc0/r0Ik1GEessDJ3Lbuma/MRO8FRQX76eurcXtmhJC//rj52ZSZuXUg0oIX0Fw==} engines: {node: '>=v18'} + dependencies: + '@commitlint/types': 19.5.0 + conventional-changelog-angular: 7.0.0 + conventional-commits-parser: 5.0.0 + dev: true - '@commitlint/read@19.2.1': - resolution: {integrity: sha512-qETc4+PL0EUv7Q36lJbPG+NJiBOGg7SSC7B5BsPWOmei+Dyif80ErfWQ0qXoW9oCh7GTpTNRoaVhiI8RbhuaNw==} + /@commitlint/read@19.5.0: + resolution: {integrity: sha512-TjS3HLPsLsxFPQj6jou8/CZFAmOP2y+6V4PGYt3ihbQKTY1Jnv0QG28WRKl/d1ha6zLODPZqsxLEov52dhR9BQ==} engines: {node: '>=v18'} + dependencies: + '@commitlint/top-level': 19.5.0 + '@commitlint/types': 19.5.0 + git-raw-commits: 4.0.0 + minimist: 1.2.8 + tinyexec: 0.3.0 + dev: true - '@commitlint/resolve-extends@19.1.0': - resolution: {integrity: sha512-z2riI+8G3CET5CPgXJPlzftH+RiWYLMYv4C9tSLdLXdr6pBNimSKukYP9MS27ejmscqCTVA4almdLh0ODD2KYg==} + /@commitlint/resolve-extends@19.5.0: + resolution: {integrity: sha512-CU/GscZhCUsJwcKTJS9Ndh3AKGZTNFIOoQB2n8CmFnizE0VnEuJoum+COW+C1lNABEeqk6ssfc1Kkalm4bDklA==} engines: {node: '>=v18'} + dependencies: + '@commitlint/config-validator': 19.5.0 + '@commitlint/types': 19.5.0 + global-directory: 4.0.1 + import-meta-resolve: 4.1.0 + lodash.mergewith: 4.6.2 + resolve-from: 5.0.0 + dev: true - '@commitlint/rules@19.0.3': - resolution: {integrity: sha512-TspKb9VB6svklxNCKKwxhELn7qhtY1rFF8ls58DcFd0F97XoG07xugPjjbVnLqmMkRjZDbDIwBKt9bddOfLaPw==} + /@commitlint/rules@19.5.0: + resolution: {integrity: sha512-hDW5TPyf/h1/EufSHEKSp6Hs+YVsDMHazfJ2azIk9tHPXS6UqSz1dIRs1gpqS3eMXgtkT7JH6TW4IShdqOwhAw==} engines: {node: '>=v18'} + dependencies: + '@commitlint/ensure': 19.5.0 + '@commitlint/message': 19.5.0 + '@commitlint/to-lines': 19.5.0 + '@commitlint/types': 19.5.0 + dev: true - '@commitlint/to-lines@19.0.0': - resolution: {integrity: sha512-vkxWo+VQU5wFhiP9Ub9Sre0FYe019JxFikrALVoD5UGa8/t3yOJEpEhxC5xKiENKKhUkTpEItMTRAjHw2SCpZw==} + /@commitlint/to-lines@19.5.0: + resolution: {integrity: sha512-R772oj3NHPkodOSRZ9bBVNq224DOxQtNef5Pl8l2M8ZnkkzQfeSTr4uxawV2Sd3ui05dUVzvLNnzenDBO1KBeQ==} engines: {node: '>=v18'} + dev: true - '@commitlint/top-level@19.0.0': - resolution: {integrity: sha512-KKjShd6u1aMGNkCkaX4aG1jOGdn7f8ZI8TR1VEuNqUOjWTOdcDSsmglinglJ18JTjuBX5I1PtjrhQCRcixRVFQ==} + /@commitlint/top-level@19.5.0: + resolution: {integrity: sha512-IP1YLmGAk0yWrImPRRc578I3dDUI5A2UBJx9FbSOjxe9sTlzFiwVJ+zeMLgAtHMtGZsC8LUnzmW1qRemkFU4ng==} engines: {node: '>=v18'} + dependencies: + find-up: 7.0.0 + dev: true - '@commitlint/types@19.0.3': - resolution: {integrity: sha512-tpyc+7i6bPG9mvaBbtKUeghfyZSDgWquIDfMgqYtTbmZ9Y9VzEm2je9EYcQ0aoz5o7NvGS+rcDec93yO08MHYA==} + /@commitlint/types@19.5.0: + resolution: {integrity: sha512-DSHae2obMSMkAtTBSOulg5X7/z+rGLxcXQIkg3OmWvY6wifojge5uVMydfhUvs7yQj+V7jNmRZ2Xzl8GJyqRgg==} engines: {node: '>=v18'} + dependencies: + '@types/conventional-commits-parser': 5.0.0 + chalk: 5.3.0 + dev: true - '@es-joy/jsdoccomment@0.42.0': - resolution: {integrity: sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==} - engines: {node: '>=16'} + /@discordjs/builders@1.9.0: + resolution: {integrity: sha512-0zx8DePNVvQibh5ly5kCEei5wtPBIUbSoE9n+91Rlladz4tgtFbJ36PZMxxZrTEOQ7AHMZ/b0crT/0fCy6FTKg==} + engines: {node: '>=18'} + dependencies: + '@discordjs/formatters': 0.5.0 + '@discordjs/util': 1.1.1 + '@sapphire/shapeshift': 4.0.0 + discord-api-types: 0.37.97 + fast-deep-equal: 3.1.3 + ts-mixer: 6.0.4 + tslib: 2.7.0 + dev: false - '@eslint-community/eslint-utils@4.4.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 + /@discordjs/collection@1.5.3: + resolution: {integrity: sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==} + engines: {node: '>=16.11.0'} + dev: false - '@eslint-community/regexpp@4.10.0': - resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + /@discordjs/collection@2.1.1: + resolution: {integrity: sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==} + engines: {node: '>=18'} + dev: false - '@eslint/eslintrc@2.1.4': - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@discordjs/formatters@0.5.0: + resolution: {integrity: sha512-98b3i+Y19RFq1Xke4NkVY46x8KjJQjldHUuEbCqMvp1F5Iq9HgnGpu91jOi/Ufazhty32eRsKnnzS8n4c+L93g==} + engines: {node: '>=18'} + dependencies: + discord-api-types: 0.37.97 + dev: false - '@eslint/eslintrc@3.0.2': - resolution: {integrity: sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + /@discordjs/rest@2.4.0: + resolution: {integrity: sha512-Xb2irDqNcq+O8F0/k/NaDp7+t091p+acb51iA4bCKfIn+WFWd6HrNvcsSbMMxIR9NjcMZS6NReTKygqiQN+ntw==} + engines: {node: '>=18'} + dependencies: + '@discordjs/collection': 2.1.1 + '@discordjs/util': 1.1.1 + '@sapphire/async-queue': 1.5.3 + '@sapphire/snowflake': 3.5.3 + '@vladfrangu/async_event_emitter': 2.4.6 + discord-api-types: 0.37.97 + magic-bytes.js: 1.10.0 + tslib: 2.7.0 + undici: 6.19.8 + dev: false + + /@discordjs/util@1.1.1: + resolution: {integrity: sha512-eddz6UnOBEB1oITPinyrB2Pttej49M9FZQY8NxgEvc3tq6ZICZ19m70RsmzRdDHk80O9NoYN/25AqJl8vPVf/g==} + engines: {node: '>=18'} + dev: false + + /@discordjs/ws@1.1.1: + resolution: {integrity: sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA==} + engines: {node: '>=16.11.0'} + dependencies: + '@discordjs/collection': 2.1.1 + '@discordjs/rest': 2.4.0 + '@discordjs/util': 1.1.1 + '@sapphire/async-queue': 1.5.3 + '@types/ws': 8.5.12 + '@vladfrangu/async_event_emitter': 2.4.6 + discord-api-types: 0.37.83 + tslib: 2.7.0 + ws: 8.18.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + + /@discordjs/ws@2.0.0: + resolution: {integrity: sha512-VSVFMOFE+G9bp/2+4e/lFySIU+urxW8NPRXPsKLbP9AUl1MvQxoUVIUfPjZkUP23jjQh+AvWWm6vaA0A5Rb2Rg==} + engines: {node: '>=20'} + dependencies: + '@discordjs/collection': 2.1.1 + '@discordjs/rest': 2.4.0 + '@discordjs/util': 1.1.1 + '@sapphire/async-queue': 1.5.3 + '@types/ws': 8.5.12 + '@vladfrangu/async_event_emitter': 2.4.6 + discord-api-types: 0.37.97 + tslib: 2.7.0 + ws: 8.18.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false - '@eslint/js@8.57.0': - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@es-joy/jsdoccomment@0.46.0: + resolution: {integrity: sha512-C3Axuq1xd/9VqFZpW4YAzOx5O9q/LP46uIQy/iNDpHG3fmPa6TBtvfglMCs3RBiBxAIi0Go97r8+jvTt55XMyQ==} + engines: {node: '>=16'} + dependencies: + comment-parser: 1.4.1 + esquery: 1.6.0 + jsdoc-type-pratt-parser: 4.0.0 + dev: true - '@eslint/js@9.0.0': - resolution: {integrity: sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + /@esbuild/aix-ppc64@0.23.1: + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true - '@fastify/busboy@2.1.1': - resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} - engines: {node: '>=14'} + /@esbuild/android-arm64@0.23.1: + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true - '@humanwhocodes/config-array@0.11.14': - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} - engines: {node: '>=10.10.0'} + /@esbuild/android-arm@0.23.1: + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true - '@humanwhocodes/config-array@0.12.3': - resolution: {integrity: sha512-jsNnTBlMWuTpDkeE3on7+dWJi0D6fdDfeANj/w7MpS8ztROCoLvIO2nG0CcFj+E4k8j4QrSTh4Oryi3i2G669g==} - engines: {node: '>=10.10.0'} + /@esbuild/android-x64@0.23.1: + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true - '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} + /@esbuild/darwin-arm64@0.23.1: + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true - '@humanwhocodes/object-schema@2.0.3': - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + /@esbuild/darwin-x64@0.23.1: + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true - '@isaacs/cliui@8.0.2': - resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} - engines: {node: '>=12'} + /@esbuild/freebsd-arm64@0.23.1: + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true - '@istanbuljs/load-nyc-config@1.1.0': - resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} - engines: {node: '>=8'} + /@esbuild/freebsd-x64@0.23.1: + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true - '@istanbuljs/schema@0.1.3': - resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} - engines: {node: '>=8'} + /@esbuild/linux-arm64@0.23.1: + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/console@29.7.0': - resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/linux-arm@0.23.1: + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/core@29.7.0': - resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true + /@esbuild/linux-ia32@0.23.1: + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/environment@29.7.0': - resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/linux-loong64@0.23.1: + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/expect-utils@29.7.0': - resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/linux-mips64el@0.23.1: + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/expect@29.7.0': - resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/linux-ppc64@0.23.1: + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/fake-timers@29.7.0': - resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/linux-riscv64@0.23.1: + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/globals@29.7.0': - resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/linux-s390x@0.23.1: + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/reporters@29.7.0': - resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true + /@esbuild/linux-x64@0.23.1: + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true - '@jest/schemas@29.6.3': - resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/netbsd-x64@0.23.1: + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true - '@jest/source-map@29.6.3': - resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/openbsd-arm64@0.23.1: + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true - '@jest/test-result@29.7.0': - resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/openbsd-x64@0.23.1: + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true - '@jest/test-sequencer@29.7.0': - resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/sunos-x64@0.23.1: + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true - '@jest/transform@29.7.0': - resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/win32-arm64@0.23.1: + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true - '@jest/types@29.6.3': - resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /@esbuild/win32-ia32@0.23.1: + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} - engines: {node: '>=6.0.0'} + /@esbuild/win32-x64@0.23.1: + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} + /@eslint-community/eslint-utils@4.4.0(eslint@9.11.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: 9.11.0 + eslint-visitor-keys: 3.4.3 + dev: true - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} + /@eslint-community/regexpp@4.11.1: + resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true - '@jridgewell/sourcemap-codec@1.4.15': - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + /@eslint/config-array@0.18.0: + resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.7 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + /@eslint/eslintrc@3.1.0: + resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.7 + espree: 10.1.0 + globals: 14.0.0 + ignore: 5.3.2 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js@9.11.0: + resolution: {integrity: sha512-LPkkenkDqyzTFauZLLAPhIb48fj6drrfMvRGSL9tS3AcZBSVTllemLSNyCvHNNL2t797S/6DJNSIwRwXgMO/eQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /@eslint/object-schema@2.1.4: + resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /@eslint/plugin-kit@0.2.0: + resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + levn: 0.4.1 + dev: true + + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: true + + /@humanwhocodes/retry@0.3.0: + resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} + engines: {node: '>=18.18'} + dev: true + + /@isaacs/cliui@8.0.2: + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + dependencies: + string-width: 5.1.2 + string-width-cjs: /string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: /strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: /wrap-ansi@7.0.0 + dev: true - '@microsoft/tsdoc-config@0.16.2': + /@microsoft/tsdoc-config@0.16.2: resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==} + dependencies: + '@microsoft/tsdoc': 0.14.2 + ajv: 6.12.6 + jju: 1.4.0 + resolve: 1.19.0 + dev: true - '@microsoft/tsdoc@0.14.2': + /@microsoft/tsdoc@0.14.2: resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} + dev: true - '@nodelib/fs.scandir@2.1.5': + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true - '@nodelib/fs.stat@2.0.5': + /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} + dev: true - '@nodelib/fs.walk@1.2.8': + /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + dev: true - '@one-ini/wasm@0.1.1': - resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==} - - '@pkgjs/parseargs@0.11.0': - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} - engines: {node: '>=14'} + /@pkgr/core@0.1.1: + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + dev: true - '@sinclair/typebox@0.27.8': - resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + /@sapphire/async-queue@1.5.3: + resolution: {integrity: sha512-x7zadcfJGxFka1Q3f8gCts1F0xMwCKbZweM85xECGI0hBTeIZJGGCrHgLggihBoprlQ/hBmDR5LKfIPqnmHM3w==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + dev: false - '@sinonjs/commons@3.0.1': - resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + /@sapphire/shapeshift@4.0.0: + resolution: {integrity: sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg==} + engines: {node: '>=v16'} + dependencies: + fast-deep-equal: 3.1.3 + lodash: 4.17.21 + dev: false - '@sinonjs/fake-timers@10.3.0': - resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + /@sapphire/snowflake@3.5.3: + resolution: {integrity: sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + dev: false - '@stylistic/eslint-plugin-js@1.7.2': - resolution: {integrity: sha512-ZYX7C5p7zlHbACwFLU+lISVh6tdcRP/++PWegh2Sy0UgMT5kU0XkPa2tKWEtJYzZmPhJxu9LxbnWcnE/tTwSDQ==} + /@stylistic/eslint-plugin-js@1.8.1(eslint@9.11.0): + resolution: {integrity: sha512-c5c2C8Mos5tTQd+NWpqwEu7VT6SSRooAguFPMj1cp2RkTYl1ynKoXo8MWy3k4rkbzoeYHrqC2UlUzsroAN7wtQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: '>=8.40.0' + dependencies: + '@types/eslint': 8.56.12 + acorn: 8.12.1 + escape-string-regexp: 4.0.0 + eslint: 9.11.0 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + dev: true - '@stylistic/eslint-plugin-jsx@1.7.2': - resolution: {integrity: sha512-lNZR5PR0HLJPs+kY0y8fy6KroKlYqA5PwsYWpVYWzqZWiL5jgAeUo4s9yLFYjJjzildJ5MsTVMy/xP81Qz6GXg==} + /@stylistic/eslint-plugin-jsx@1.8.1(eslint@9.11.0): + resolution: {integrity: sha512-k1Eb6rcjMP+mmjvj+vd9y5KUdWn1OBkkPLHXhsrHt5lCDFZxJEs0aVQzE5lpYrtVZVkpc5esTtss/cPJux0lfA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: '>=8.40.0' + dependencies: + '@stylistic/eslint-plugin-js': 1.8.1(eslint@9.11.0) + '@types/eslint': 8.56.12 + eslint: 9.11.0 + estraverse: 5.3.0 + picomatch: 4.0.2 + dev: true - '@stylistic/eslint-plugin-plus@1.7.2': - resolution: {integrity: sha512-luUfRVbBVtt0+/FNt8/76BANJEzb/nHWasHD7UUjyMrch2U9xUKpObrkTCzqBuisKek+uFupwGjqXqDP07+fQw==} + /@stylistic/eslint-plugin-plus@1.8.1(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-4+40H3lHYTN8OWz+US8CamVkO+2hxNLp9+CAjorI7top/lHqemhpJvKA1LD9Uh+WMY9DYWiWpL2+SZ2wAXY9fQ==} peerDependencies: eslint: '*' + dependencies: + '@types/eslint': 8.56.12 + '@typescript-eslint/utils': 6.21.0(eslint@9.11.0)(typescript@5.5.4) + eslint: 9.11.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true - '@stylistic/eslint-plugin-ts@1.7.2': - resolution: {integrity: sha512-szX89YPocwCe4T0eT3alj7MwEzDHt5+B+kb/vQfSSLIjI9CGgoWrgj50zU8PtaDctTh4ZieFBzU/lRmkSUo0RQ==} + /@stylistic/eslint-plugin-ts@1.8.1(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-/q1m+ZuO1JHfiSF16EATFzv7XSJkc5W6DocfvH5o9oB6WWYFMF77fVoBWnKT3wGptPOc2hkRupRKhmeFROdfWA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: '>=8.40.0' + dependencies: + '@stylistic/eslint-plugin-js': 1.8.1(eslint@9.11.0) + '@types/eslint': 8.56.12 + '@typescript-eslint/utils': 6.21.0(eslint@9.11.0)(typescript@5.5.4) + eslint: 9.11.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true - '@stylistic/eslint-plugin@1.7.2': - resolution: {integrity: sha512-TesaPR4AOCeD4unwu9gZCdTe8SsUpykriICuwXV8GFBgESuVbfVp+S8g6xTWe9ntVR803bNMtnr2UhxHW0iFqg==} + /@stylistic/eslint-plugin@1.8.1(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-64My6I7uCcmSQ//427Pfg2vjSf9SDzfsGIWohNFgISMLYdC5BzJqDo647iDDJzSxINh3WTC0Ql46ifiKuOoTyA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: '>=8.40.0' + dependencies: + '@stylistic/eslint-plugin-js': 1.8.1(eslint@9.11.0) + '@stylistic/eslint-plugin-jsx': 1.8.1(eslint@9.11.0) + '@stylistic/eslint-plugin-plus': 1.8.1(eslint@9.11.0)(typescript@5.5.4) + '@stylistic/eslint-plugin-ts': 1.8.1(eslint@9.11.0)(typescript@5.5.4) + '@types/eslint': 8.56.12 + eslint: 9.11.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true - '@tokenizer/token@0.3.0': - resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} - - '@types/babel__core@7.20.5': - resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} - - '@types/babel__generator@7.6.8': - resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==} - - '@types/babel__template@7.4.4': - resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - - '@types/babel__traverse@7.20.5': - resolution: {integrity: sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==} - - '@types/conventional-commits-parser@5.0.0': + /@types/conventional-commits-parser@5.0.0: resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} + dependencies: + '@types/node': 20.16.5 + dev: true - '@types/eslint@8.56.10': - resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} + /@types/eslint@8.56.12: + resolution: {integrity: sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==} + dependencies: + '@types/estree': 1.0.6 + '@types/json-schema': 7.0.15 + dev: true - '@types/eslint__eslintrc@2.1.1': - resolution: {integrity: sha512-LI51vVv3N7WI4+fM7Xkh1+ciLA1gtuQPgXdKdece+vD8f/G2hrFqtwb4YIQyIM6VXpRM4vSy1PW5y3yuHK+Y2w==} + /@types/eslint__eslintrc@2.1.2: + resolution: {integrity: sha512-qXvzPFY7Rz05xD8ZApXJ3S8xStQD2Ibzu3EFIF0UMNOAfLY5xUu3H61q0JrHo2OXD6rcFG75yUxNQbkKtFKBSw==} + dependencies: + '@types/eslint': 8.56.12 + dev: true - '@types/eslint__js@8.42.3': + /@types/eslint__js@8.42.3: resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + dependencies: + '@types/eslint': 8.56.12 + dev: true - '@types/estree@1.0.5': - resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - - '@types/graceful-fs@4.1.9': - resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} - - '@types/istanbul-lib-coverage@2.0.6': - resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} - - '@types/istanbul-lib-report@3.0.3': - resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} - - '@types/istanbul-reports@3.0.4': - resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - - '@types/jest@29.5.12': - resolution: {integrity: sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==} - - '@types/js-beautify@1.14.3': - resolution: {integrity: sha512-FMbQHz+qd9DoGvgLHxeqqVPaNRffpIu5ZjozwV8hf9JAGpIOzuAf4wGbRSo8LNITHqGjmmVjaMggTT5P4v4IHg==} + /@types/estree@1.0.6: + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + dev: true - '@types/json-schema@7.0.15': + /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + dev: true - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} + /@types/node@20.16.5: + resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} + dependencies: + undici-types: 6.19.8 - '@types/semver@7.5.8': + /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} + dev: true - '@types/stack-utils@2.0.3': - resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} - - '@types/uglify-js@3.17.5': + /@types/uglify-js@3.17.5: resolution: {integrity: sha512-TU+fZFBTBcXj/GpDpDaBmgWk/gn96kMZ+uocaFUlV2f8a6WdMzzI44QBCmGcCiYR0Y6ZlNRiyUyKKt5nl/lbzQ==} + dependencies: + source-map: 0.6.1 + dev: true - '@types/ws@8.5.10': - resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} - - '@types/yargs-parser@21.0.3': - resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + /@types/ws@8.5.12: + resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} + dependencies: + '@types/node': 20.16.5 + dev: false - '@types/yargs@17.0.32': - resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} + /@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0)(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.11.1 + '@typescript-eslint/parser': 7.18.0(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/type-utils': 7.18.0(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 7.18.0 + eslint: 9.11.0 + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.5.4) + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dev: true - '@typescript-eslint/eslint-plugin@7.6.0': - resolution: {integrity: sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==} + /@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@8.7.0)(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -767,9 +962,25 @@ packages: peerDependenciesMeta: typescript: optional: true + dependencies: + '@eslint-community/regexpp': 4.11.1 + '@typescript-eslint/parser': 8.7.0(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/type-utils': 7.18.0(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 7.18.0 + eslint: 9.11.0 + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.5.4) + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dev: true - '@typescript-eslint/parser@7.6.0': - resolution: {integrity: sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg==} + /@typescript-eslint/parser@7.18.0(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -777,17 +988,65 @@ packages: peerDependenciesMeta: typescript: optional: true + dependencies: + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.7 + eslint: 9.11.0 + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@8.7.0(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-lN0btVpj2unxHlNYLI//BQ7nzbMJYBVQX5+pbNXvGYazdlgYonMn4AhhHifQ+J4fGRYA/m1DjaQjx+fDetqBOQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 8.7.0 + '@typescript-eslint/types': 8.7.0 + '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.7.0 + debug: 4.3.7 + eslint: 9.11.0 + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dev: true - '@typescript-eslint/scope-manager@6.21.0': + /@typescript-eslint/scope-manager@6.21.0: resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + dev: true - '@typescript-eslint/scope-manager@7.6.0': - resolution: {integrity: sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w==} + /@typescript-eslint/scope-manager@7.18.0: + resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + dev: true + + /@typescript-eslint/scope-manager@8.7.0: + resolution: {integrity: sha512-87rC0k3ZlDOuz82zzXRtQ7Akv3GKhHs0ti4YcbAJtaomllXoSO8hi7Ix3ccEvCd824dy9aIX+j3d2UMAfCtVpg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@typescript-eslint/types': 8.7.0 + '@typescript-eslint/visitor-keys': 8.7.0 + dev: true - '@typescript-eslint/type-utils@7.6.0': - resolution: {integrity: sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw==} + /@typescript-eslint/type-utils@7.18.0(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -795,16 +1054,33 @@ packages: peerDependenciesMeta: typescript: optional: true + dependencies: + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@9.11.0)(typescript@5.5.4) + debug: 4.3.7 + eslint: 9.11.0 + ts-api-utils: 1.3.0(typescript@5.5.4) + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dev: true - '@typescript-eslint/types@6.21.0': + /@typescript-eslint/types@6.21.0: resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} engines: {node: ^16.0.0 || >=18.0.0} + dev: true - '@typescript-eslint/types@7.6.0': - resolution: {integrity: sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ==} + /@typescript-eslint/types@7.18.0: + resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} engines: {node: ^18.18.0 || >=20.0.0} + dev: true + + /@typescript-eslint/types@8.7.0: + resolution: {integrity: sha512-LLt4BLHFwSfASHSF2K29SZ+ZCsbQOM+LuarPjRUuHm+Qd09hSe3GCeaQbcCr+Mik+0QFRmep/FyZBO6fJ64U3w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true - '@typescript-eslint/typescript-estree@6.21.0': + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.5.4): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -812,316 +1088,399 @@ packages: peerDependenciesMeta: typescript: optional: true + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.7 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dev: true - '@typescript-eslint/typescript-estree@7.6.0': - resolution: {integrity: sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw==} + /@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4): + resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.7 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/typescript-estree@8.7.0(typescript@5.5.4): + resolution: {integrity: sha512-MC8nmcGHsmfAKxwnluTQpNqceniT8SteVwd2voYlmiSWGOtjvGXdPl17dYu2797GVscK30Z04WRM28CrKS9WOg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 8.7.0 + '@typescript-eslint/visitor-keys': 8.7.0 + debug: 4.3.7 + fast-glob: 3.3.2 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dev: true - '@typescript-eslint/utils@6.21.0': + /@typescript-eslint/utils@6.21.0(eslint@9.11.0)(typescript@5.5.4): resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.5.4) + eslint: 9.11.0 + semver: 7.6.3 + transitivePeerDependencies: + - supports-color + - typescript + dev: true - '@typescript-eslint/utils@7.6.0': - resolution: {integrity: sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA==} + /@typescript-eslint/utils@7.18.0(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.0) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) + eslint: 9.11.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true - '@typescript-eslint/visitor-keys@6.21.0': + /@typescript-eslint/visitor-keys@6.21.0: resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.21.0 + eslint-visitor-keys: 3.4.3 + dev: true - '@typescript-eslint/visitor-keys@7.6.0': - resolution: {integrity: sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw==} + /@typescript-eslint/visitor-keys@7.18.0: + resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.18.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@typescript-eslint/visitor-keys@8.7.0: + resolution: {integrity: sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@typescript-eslint/types': 8.7.0 + eslint-visitor-keys: 3.4.3 + dev: true - '@ungap/structured-clone@1.2.0': - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + /@vladfrangu/async_event_emitter@2.4.6: + resolution: {integrity: sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - JSONStream@1.3.5: + /JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true + dependencies: + jsonparse: 1.3.1 + through: 2.3.8 + dev: true - abbrev@2.0.0: - resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - acorn-jsx@5.3.2: + /acorn-jsx@5.3.2(acorn@8.12.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.12.1 + dev: true - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + /acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} engines: {node: '>=0.4.0'} hasBin: true + dev: true - ajv@6.12.6: + /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: true - ajv@8.12.0: - resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + /ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.0.1 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + dev: true - ansi-align@3.0.1: + /ansi-align@3.0.1: resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + dependencies: + string-width: 4.2.3 + dev: false - ansi-colors@4.1.3: + /ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} + dev: false - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + /ansi-regex@6.1.0: + resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} - ansi-sequence-parser@1.1.1: - resolution: {integrity: sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==} - - ansi-styles@3.2.1: + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: true - ansi-styles@4.3.0: + /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true - ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - - ansi-styles@6.2.1: + /ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - - are-docs-informative@0.0.2: + /are-docs-informative@0.0.2: resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} engines: {node: '>=14'} + dev: true - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: + /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true - array-ify@1.0.0: + /array-ify@1.0.0: resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} + dev: true - array-union@2.1.0: + /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} + dev: true - babel-jest@29.7.0: - resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@babel/core': ^7.8.0 - - babel-plugin-istanbul@6.1.1: - resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} - engines: {node: '>=8'} - - babel-plugin-jest-hoist@29.6.3: - resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - babel-preset-current-node-syntax@1.0.1: - resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} - peerDependencies: - '@babel/core': ^7.0.0 - - babel-preset-jest@29.6.3: - resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@babel/core': ^7.0.0 - - balanced-match@1.0.2: + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - bl@5.1.0: - resolution: {integrity: sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==} - - boxen@7.1.1: + /boxen@7.1.1: resolution: {integrity: sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==} engines: {node: '>=14.16'} + dependencies: + ansi-align: 3.0.1 + camelcase: 7.0.1 + chalk: 5.3.0 + cli-boxes: 3.0.0 + string-width: 5.1.2 + type-fest: 2.19.0 + widest-line: 4.0.1 + wrap-ansi: 8.1.0 + dev: false - brace-expansion@1.1.11: + /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true - brace-expansion@2.0.1: + /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + /braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + dependencies: + fill-range: 7.1.1 + dev: true - browserslist@4.23.0: - resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - - bs-logger@0.2.6: - resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} - engines: {node: '>= 6'} - - bser@2.1.1: - resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} - - buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - - buffer@6.0.3: - resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - - builtin-modules@3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} - - callsites@3.1.0: + /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + dev: true - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - - camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} - - camelcase@7.0.1: + /camelcase@7.0.1: resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} engines: {node: '>=14.16'} + dev: false - caniuse-lite@1.0.30001608: - resolution: {integrity: sha512-cjUJTQkk9fQlJR2s4HMuPMvTiRggl0rAVMtthQuyOlDWuqHXqN8azLq+pi8B2TjwKJ32diHjUqRIKeFX4z1FoA==} - - chalk@2.4.2: + /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true - chalk@4.1.2: + /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true - chalk@5.3.0: + /chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - char-regex@1.0.2: - resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} - engines: {node: '>=10'} - - ci-info@3.9.0: - resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} - engines: {node: '>=8'} - - cjs-module-lexer@1.2.3: - resolution: {integrity: sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==} - - cli-boxes@3.0.0: + /cli-boxes@3.0.0: resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} engines: {node: '>=10'} + dev: false - cli-cursor@4.0.0: - resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + dependencies: + restore-cursor: 5.1.0 + dev: false - cli-spinners@2.9.2: + /cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} + dev: false - cliui@8.0.1: + /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true - co@4.6.0: - resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} - engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - - collect-v8-coverage@1.0.2: - resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} - - color-convert@1.9.3: + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: true - color-convert@2.0.1: + /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true - color-name@1.1.3: + /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true - color-name@1.1.4: + /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true - commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} - - commander@12.0.0: - resolution: {integrity: sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==} + /commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} + dev: false - comment-parser@1.4.1: + /comment-parser@1.4.1: resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} engines: {node: '>= 12.0.0'} + dev: true - compare-func@2.0.0: + /compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} + dependencies: + array-ify: 1.0.0 + dot-prop: 5.3.0 + dev: true - concat-map@0.0.1: + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true - config-chain@1.1.13: - resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} - - conventional-changelog-angular@7.0.0: + /conventional-changelog-angular@7.0.0: resolution: {integrity: sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==} engines: {node: '>=16'} + dependencies: + compare-func: 2.0.0 + dev: true - conventional-changelog-conventionalcommits@7.0.2: + /conventional-changelog-conventionalcommits@7.0.2: resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==} engines: {node: '>=16'} + dependencies: + compare-func: 2.0.0 + dev: true - conventional-commits-parser@5.0.0: + /conventional-commits-parser@5.0.0: resolution: {integrity: sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==} engines: {node: '>=16'} hasBin: true + dependencies: + JSONStream: 1.3.5 + is-text-path: 2.0.0 + meow: 12.1.1 + split2: 4.2.0 + dev: true - convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - - cosmiconfig-typescript-loader@5.0.0: + /cosmiconfig-typescript-loader@5.0.0(@types/node@20.16.5)(cosmiconfig@9.0.0)(typescript@5.5.4): resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} engines: {node: '>=v16'} peerDependencies: '@types/node': '*' cosmiconfig: '>=8.2' typescript: '>=4' + dependencies: + '@types/node': 20.16.5 + cosmiconfig: 9.0.0(typescript@5.5.4) + jiti: 1.21.6 + typescript: 5.5.4 + dev: true - cosmiconfig@9.0.0: + /cosmiconfig@9.0.0(typescript@5.5.4): resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: @@ -1129,128 +1488,175 @@ packages: peerDependenciesMeta: typescript: optional: true + dependencies: + env-paths: 2.2.1 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + parse-json: 5.2.0 + typescript: 5.5.4 + dev: true - create-jest@29.7.0: - resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - - cross-spawn@7.0.3: + /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true - css-tree@2.2.1: - resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==} - engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} - - csso@5.0.5: - resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} - engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} - - dargs@8.1.0: + /dargs@8.1.0: resolution: {integrity: sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==} engines: {node: '>=12'} + dev: true - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + /debug@4.3.7: + resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' peerDependenciesMeta: supports-color: optional: true + dependencies: + ms: 2.1.3 + dev: true - dedent@1.5.3: - resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} - peerDependencies: - babel-plugin-macros: ^3.1.0 - peerDependenciesMeta: - babel-plugin-macros: - optional: true - - deep-is@0.1.4: + /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - - detect-newline@3.1.0: - resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + /dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: true - diff-sequences@29.6.3: - resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + /discord-api-types@0.37.101: + resolution: {integrity: sha512-2wizd94t7G3A8U5Phr3AiuL4gSvhqistDwWnlk1VLTit8BI1jWUncFqFQNdPbHqS3661+Nx/iEyIwtVjPuBP3w==} + dev: true - dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} + /discord-api-types@0.37.83: + resolution: {integrity: sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==} + dev: false + + /discord-api-types@0.37.97: + resolution: {integrity: sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==} + dev: false - doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} + /discord.js@14.16.2: + resolution: {integrity: sha512-VGNi9WE2dZIxYM8/r/iatQQ+3LT8STW4hhczJOwm+DBeHq66vsKDCk8trChNCB01sMO9crslYuEMeZl2d7r3xw==} + engines: {node: '>=18'} + dependencies: + '@discordjs/builders': 1.9.0 + '@discordjs/collection': 1.5.3 + '@discordjs/formatters': 0.5.0 + '@discordjs/rest': 2.4.0 + '@discordjs/util': 1.1.1 + '@discordjs/ws': 1.1.1 + '@sapphire/snowflake': 3.5.3 + discord-api-types: 0.37.97 + fast-deep-equal: 3.1.3 + lodash.snakecase: 4.1.1 + tslib: 2.7.0 + undici: 6.19.8 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false - dot-prop@5.3.0: + /dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} engines: {node: '>=8'} + dependencies: + is-obj: 2.0.0 + dev: true - dotenv@16.4.5: - resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} - engines: {node: '>=12'} - - eastasianwidth@0.2.0: + /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - editorconfig@1.0.4: - resolution: {integrity: sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==} - engines: {node: '>=14'} - hasBin: true - - electron-to-chromium@1.4.733: - resolution: {integrity: sha512-gUI9nhI2iBGF0OaYYLKOaOtliFMl+Bt1rY7VmEjwxOxqoYLub/D9xmduPEhbw2imE6gYkJKhIE5it+KE2ulVxQ==} - - emittery@0.13.1: - resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} - engines: {node: '>=12'} - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} + /emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + dev: false - emoji-regex@8.0.0: + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - emoji-regex@9.2.2: + /emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - enquirer@2.4.1: + /enquirer@2.4.1: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} + dependencies: + ansi-colors: 4.1.3 + strip-ansi: 6.0.1 + dev: false - env-paths@2.2.1: + /env-paths@2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} + dev: true - error-ex@1.3.2: + /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + /es-module-lexer@1.5.4: + resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + dev: true + + /esbuild@0.23.1: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + engines: {node: '>=18'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 + dev: true + + /escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + dev: true - escape-string-regexp@1.0.5: + /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} + dev: true - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@4.0.0: + /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + dev: true - eslint-config-xo-typescript@4.0.0: + /eslint-config-xo-typescript@4.0.0(@typescript-eslint/eslint-plugin@7.18.0)(@typescript-eslint/parser@8.7.0)(eslint@9.11.0)(typescript@5.5.4): resolution: {integrity: sha512-pmSWzVpvzEjZHG7S/rN34cFXAoe6YbvWFBQSitEXD5CcT2SULfykYl8hcYXss37r5N3SmJYAiO6VlcfkPiDRxg==} engines: {node: '>=18'} peerDependencies: @@ -1258,4225 +1664,1245 @@ packages: '@typescript-eslint/parser': '>=7.0.2' eslint: '>=8.56.0' typescript: '>=5.0.0' + dependencies: + '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@8.7.0)(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.7.0(eslint@9.11.0)(typescript@5.5.4) + eslint: 9.11.0 + typescript: 5.5.4 + dev: true - eslint-plugin-jsdoc@48.2.3: - resolution: {integrity: sha512-r9DMAmFs66VNvNqRLLjHejdnJtILrt3xGi+Qx0op0oRfFGVpOR1Hb3BC++MacseHx93d8SKYPhyrC9BS7Os2QA==} + /eslint-plugin-jsdoc@48.11.0(eslint@9.11.0): + resolution: {integrity: sha512-d12JHJDPNo7IFwTOAItCeJY1hcqoIxE0lHA8infQByLilQ9xkqrRa6laWCnsuCrf+8rUnvxXY1XuTbibRBNylA==} engines: {node: '>=18'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + dependencies: + '@es-joy/jsdoccomment': 0.46.0 + are-docs-informative: 0.0.2 + comment-parser: 1.4.1 + debug: 4.3.7 + escape-string-regexp: 4.0.0 + eslint: 9.11.0 + espree: 10.1.0 + esquery: 1.6.0 + parse-imports: 2.2.1 + semver: 7.6.3 + spdx-expression-parse: 4.0.0 + synckit: 0.9.1 + transitivePeerDependencies: + - supports-color + dev: true - eslint-plugin-tsdoc@0.2.17: + /eslint-plugin-tsdoc@0.2.17: resolution: {integrity: sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==} + dependencies: + '@microsoft/tsdoc': 0.14.2 + '@microsoft/tsdoc-config': 0.16.2 + dev: true - eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint-scope@8.0.1: - resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + /eslint-scope@8.0.2: + resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true - eslint-visitor-keys@3.4.3: + /eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true - eslint-visitor-keys@4.0.0: + /eslint-visitor-keys@4.0.0: resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true - eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - hasBin: true - - eslint@9.0.0: - resolution: {integrity: sha512-IMryZ5SudxzQvuod6rUdIUz29qFItWx281VhtFVc2Psy/ZhlCeD/5DT6lBIJ4H3G+iamGJoTln1v+QSuPw0p7Q==} + /eslint@9.11.0: + resolution: {integrity: sha512-yVS6XODx+tMFMDFcG4+Hlh+qG7RM6cCJXtQhCKLSsr3XkLvWggHjCqjfh0XsPPnt1c56oaT6PMgW9XWQQjdHXA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.0) + '@eslint-community/regexpp': 4.11.1 + '@eslint/config-array': 0.18.0 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.11.0 + '@eslint/plugin-kit': 0.2.0 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.3.0 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.7 + escape-string-regexp: 4.0.0 + eslint-scope: 8.0.2 + eslint-visitor-keys: 4.0.0 + espree: 10.1.0 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true - espree@10.0.1: - resolution: {integrity: sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==} + /espree@10.1.0: + resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 4.0.0 + dev: true - espree@9.6.1: + /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 3.4.3 + dev: true - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + /esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true - esrecurse@4.3.0: + /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true - estraverse@5.3.0: + /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + dev: true - esutils@2.0.3: + /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} + dev: true - execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} - - execa@8.0.1: - resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} - engines: {node: '>=16.17'} - - exit@0.1.2: - resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} - engines: {node: '>= 0.8.0'} - - expect@29.7.0: - resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - fast-deep-equal@3.1.3: + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-glob@3.3.2: + /fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + dev: true - fast-json-stable-stringify@2.1.0: + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true - fast-levenshtein@2.0.6: + /fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - fb-watchman@2.0.2: - resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + /fast-uri@3.0.1: + resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + dev: true - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + /fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + dependencies: + reusify: 1.0.4 + dev: true - file-entry-cache@8.0.0: + /file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} + dependencies: + flat-cache: 4.0.1 + dev: true - file-type@18.7.0: - resolution: {integrity: sha512-ihHtXRzXEziMrQ56VSgU7wkxh55iNchFkosu7Y9/S+tXHdKyrGjVK0ujbqNnsxzea+78MaLhN6PGmfYSAv1ACw==} - engines: {node: '>=14.16'} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + /fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true - find-up@5.0.0: + /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true - find-up@7.0.0: + /find-up@7.0.0: resolution: {integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==} engines: {node: '>=18'} + dependencies: + locate-path: 7.2.0 + path-exists: 5.0.0 + unicorn-magic: 0.1.0 + dev: true - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} - - flat-cache@4.0.1: + /flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 + dev: true - flatted@3.3.1: + /flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + dev: true - foreground-child@3.1.1: - resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} + /foreground-child@3.3.0: + resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 4.1.0 + dev: true - fs-extra@11.1.1: - resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} - engines: {node: '>=14.14'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - fsevents@2.3.3: + /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + requiresBuild: true + dev: true + optional: true - function-bind@1.1.2: + /function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: true - gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} - - get-caller-file@2.0.5: + /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + dev: true - get-east-asian-width@1.2.0: + /get-east-asian-width@1.2.0: resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} engines: {node: '>=18'} + dev: false - get-package-type@0.1.0: - resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} - engines: {node: '>=8.0.0'} - - get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - - get-stream@8.0.1: - resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} - engines: {node: '>=16'} + /get-tsconfig@4.8.1: + resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true - git-raw-commits@4.0.0: + /git-raw-commits@4.0.0: resolution: {integrity: sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==} engines: {node: '>=16'} hasBin: true + dependencies: + dargs: 8.1.0 + meow: 12.1.1 + split2: 4.2.0 + dev: true - glob-parent@5.1.2: + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true - glob-parent@6.0.2: + /glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + dev: true - glob@10.4.1: - resolution: {integrity: sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==} - engines: {node: '>=16 || 14 >=14.18'} + /glob@11.0.0: + resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} + engines: {node: 20 || >=22} hasBin: true + dependencies: + foreground-child: 3.3.0 + jackspeak: 4.0.2 + minimatch: 10.0.1 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 2.0.0 + dev: true - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - global-directory@4.0.1: + /global-directory@4.0.1: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} engines: {node: '>=18'} + dependencies: + ini: 4.1.1 + dev: true - globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - - globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} + /global-prefix@3.0.0: + resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==} + engines: {node: '>=6'} + dependencies: + ini: 1.3.8 + kind-of: 6.0.3 + which: 1.3.1 + dev: true - globals@14.0.0: + /globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} + dev: true - globals@15.0.0: - resolution: {integrity: sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==} + /globals@15.9.0: + resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==} engines: {node: '>=18'} + dev: true - globby@11.1.0: + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.3.2 + merge2: 1.4.1 + slash: 3.0.0 + dev: true - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - graphemer@1.4.0: + /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true - handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} - engines: {node: '>=0.4.7'} - hasBin: true - - has-flag@3.0.0: + /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} + dev: true - has-flag@4.0.0: + /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + dev: true - hasown@2.0.2: + /hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: true - html-escaper@2.0.2: - resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - - html-escaper@3.0.3: - resolution: {integrity: sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==} - - human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - - human-signals@5.0.0: - resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} - engines: {node: '>=16.17.0'} - - husky@9.0.11: - resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} + /husky@9.1.6: + resolution: {integrity: sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==} engines: {node: '>=18'} hasBin: true + dev: true - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + /ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} + dev: true - import-fresh@3.3.0: + /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: true - import-local@3.1.0: - resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} - engines: {node: '>=8'} - hasBin: true - - import-meta-resolve@4.0.0: - resolution: {integrity: sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==} + /import-meta-resolve@4.1.0: + resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} + dev: true - imurmurhash@0.1.4: + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + dev: true - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - ini@1.3.8: + /ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: true - ini@4.1.1: + /ini@4.1.1: resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true - is-arrayish@0.2.1: + /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true - is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - - is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + /is-core-module@2.15.1: + resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + engines: {node: '>= 0.4'} + dependencies: + hasown: 2.0.2 + dev: true - is-extglob@2.1.1: + /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + dev: true - is-fullwidth-code-point@3.0.0: + /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-generator-fn@2.1.0: - resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} - engines: {node: '>=6'} - - is-glob@4.0.3: + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true - is-interactive@2.0.0: + /is-interactive@2.0.0: resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} engines: {node: '>=12'} + dev: false - is-number@7.0.0: + /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + dev: true - is-obj@2.0.0: + /is-obj@2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} + dev: true - is-path-inside@3.0.3: + /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} + dev: true - is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - - is-stream@3.0.0: - resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - is-text-path@2.0.0: + /is-text-path@2.0.0: resolution: {integrity: sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==} engines: {node: '>=8'} + dependencies: + text-extensions: 2.4.0 + dev: true - is-unicode-supported@1.3.0: + /is-unicode-supported@1.3.0: resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} engines: {node: '>=12'} + dev: false - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} + /is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} engines: {node: '>=18'} + dev: false - isexe@2.0.0: + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true - istanbul-lib-coverage@3.2.2: - resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} - engines: {node: '>=8'} + /jackspeak@4.0.2: + resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} + engines: {node: 20 || >=22} + dependencies: + '@isaacs/cliui': 8.0.2 + dev: true - istanbul-lib-instrument@5.2.1: - resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} - engines: {node: '>=8'} + /jiti@1.21.6: + resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} + hasBin: true + dev: true - istanbul-lib-instrument@6.0.2: - resolution: {integrity: sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==} - engines: {node: '>=10'} + /jju@1.4.0: + resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} + dev: true - istanbul-lib-report@3.0.1: - resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} - engines: {node: '>=10'} + /js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true - istanbul-lib-source-maps@4.0.1: - resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} - engines: {node: '>=10'} - - istanbul-reports@3.1.7: - resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} - engines: {node: '>=8'} - - jackspeak@3.1.2: - resolution: {integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==} - engines: {node: '>=14'} - - jest-changed-files@29.7.0: - resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-circus@29.7.0: - resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-cli@29.7.0: - resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - jest-config@29.7.0: - resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - - jest-diff@29.7.0: - resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-docblock@29.7.0: - resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-each@29.7.0: - resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-environment-node@29.7.0: - resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-get-type@29.6.3: - resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-haste-map@29.7.0: - resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-leak-detector@29.7.0: - resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-matcher-utils@29.7.0: - resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-message-util@29.7.0: - resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-mock@29.7.0: - resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-pnp-resolver@1.2.3: - resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} - engines: {node: '>=6'} - peerDependencies: - jest-resolve: '*' - peerDependenciesMeta: - jest-resolve: - optional: true - - jest-regex-util@29.6.3: - resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-resolve-dependencies@29.7.0: - resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-resolve@29.7.0: - resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-runner@29.7.0: - resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-runtime@29.7.0: - resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-snapshot@29.7.0: - resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-util@29.7.0: - resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-validate@29.7.0: - resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-watcher@29.7.0: - resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-worker@29.7.0: - resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest@29.7.0: - resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - jiti@1.21.0: - resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} - hasBin: true - - jju@1.4.0: - resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} - - js-beautify@1.15.1: - resolution: {integrity: sha512-ESjNzSlt/sWE8sciZH8kBF8BPlwXPwhR6pWKAw8bw4Bwj+iZcnKW6ONWUutJ7eObuBZQpiIb8S7OYspWrKt7rA==} - engines: {node: '>=14'} - hasBin: true - - js-cookie@3.0.5: - resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==} - engines: {node: '>=14'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: + /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true + dependencies: + argparse: 2.0.1 + dev: true - jsdoc-type-pratt-parser@4.0.0: + /jsdoc-type-pratt-parser@4.0.0: resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} engines: {node: '>=12.0.0'} + dev: true - jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - - json-buffer@3.0.1: + /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true - json-parse-even-better-errors@2.3.1: + /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: true - json-schema-traverse@0.4.1: + /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true - json-schema-traverse@1.0.0: + /json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + dev: true - json-stable-stringify-without-jsonify@1.0.1: + /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true - json5@2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} - engines: {node: '>=6'} - hasBin: true - - jsonc-parser@3.2.1: - resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} - - jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - - jsonparse@1.3.1: + /jsonparse@1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} engines: {'0': node >= 0.2.0} + dev: true - keyv@4.5.4: + /keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + dependencies: + json-buffer: 3.0.1 + dev: true - kleur@3.0.3: - resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} - engines: {node: '>=6'} - - leven@3.1.0: - resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} - engines: {node: '>=6'} + /kind-of@6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + dev: true - levn@0.4.1: + /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: true - lines-and-columns@1.2.4: + /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + dev: true - locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - - locate-path@6.0.0: + /locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true - locate-path@7.2.0: + /locate-path@7.2.0: resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + p-locate: 6.0.0 + dev: true - lodash.camelcase@4.3.0: + /lodash.camelcase@4.3.0: resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + dev: true - lodash.isplainobject@4.0.6: + /lodash.isplainobject@4.0.6: resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + dev: true - lodash.kebabcase@4.1.1: + /lodash.kebabcase@4.1.1: resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} + dev: true - lodash.memoize@4.1.2: - resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} - - lodash.merge@4.6.2: + /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true - lodash.mergewith@4.6.2: + /lodash.mergewith@4.6.2: resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} + dev: true - lodash.snakecase@4.1.1: + /lodash.snakecase@4.1.1: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} - lodash.startcase@4.4.0: + /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + dev: true - lodash.uniq@4.5.0: + /lodash.uniq@4.5.0: resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + dev: true - lodash.upperfirst@4.3.1: + /lodash.upperfirst@4.3.1: resolution: {integrity: sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==} + dev: true - log-symbols@5.1.0: - resolution: {integrity: sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==} - engines: {node: '>=12'} + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: false - log-symbols@6.0.0: + /log-symbols@6.0.0: resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==} engines: {node: '>=18'} + dependencies: + chalk: 5.3.0 + is-unicode-supported: 1.3.0 + dev: false - lru-cache@10.2.2: - resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} - engines: {node: 14 || >=16.14} - - lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - lunr@2.3.9: - resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} - - make-dir@4.0.0: - resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} - engines: {node: '>=10'} - - make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - - makeerror@1.0.12: - resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} - - marked@4.3.0: - resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} - engines: {node: '>= 12'} - hasBin: true + /lru-cache@11.0.1: + resolution: {integrity: sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==} + engines: {node: 20 || >=22} + dev: true - mdn-data@2.0.28: - resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} + /magic-bytes.js@1.10.0: + resolution: {integrity: sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==} + dev: false - meow@12.1.1: + /meow@12.1.1: resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==} engines: {node: '>=16.10'} + dev: true - merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - - merge2@1.4.1: + /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + dev: true - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + /micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + dev: true - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} + /mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + dev: false - mimic-fn@4.0.0: - resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} - engines: {node: '>=12'} + /minimatch@10.0.1: + resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + engines: {node: 20 || >=22} + dependencies: + brace-expansion: 2.0.1 + dev: true - minimatch@3.1.2: + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true - minimatch@9.0.1: - resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} - engines: {node: '>=16 || 14 >=14.17'} - - minimatch@9.0.3: + /minimatch@9.0.3: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true - minimatch@9.0.4: - resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} + /minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true - minimist@1.2.8: + /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true - minipass@7.1.2: + /minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + dev: true - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + /ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true - natural-compare@1.4.0: + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true - neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - - node-int64@0.4.0: - resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} - - node-releases@2.0.14: - resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} - - nopt@7.2.1: - resolution: {integrity: sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true - - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - - npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} - - npm-run-path@5.3.0: - resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - onetime@6.0.0: - resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} - engines: {node: '>=12'} - - optionator@0.9.3: - resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} - engines: {node: '>= 0.8.0'} - - ora@7.0.1: - resolution: {integrity: sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==} - engines: {node: '>=16'} - - ora@8.0.1: - resolution: {integrity: sha512-ANIvzobt1rls2BDny5fWZ3ZVKyD6nscLvfFRpQgfWsythlcsVUC9kL0zq6j2Z5z9wwp1kd7wpsD/T9qNPVLCaQ==} + /onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} engines: {node: '>=18'} + dependencies: + mimic-function: 5.0.1 + dev: false - p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - - p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - - p-limit@4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} - - p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - - p-locate@6.0.0: - resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - - parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - - parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} - engines: {node: '>=8'} - - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - - path-exists@5.0.0: - resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} - - path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - - path-scurry@1.11.1: - resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} - engines: {node: '>=16 || 14 >=14.18'} - - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - - peek-readable@5.0.0: - resolution: {integrity: sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==} - engines: {node: '>=14.16'} - - picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} - engines: {node: '>=12'} - - pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} - engines: {node: '>= 6'} - - pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} - - prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + /optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} - - prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} - engines: {node: '>=14'} - hasBin: true - - pretty-format@29.7.0: - resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - prompts@2.4.2: - resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} - engines: {node: '>= 6'} - - proto-list@1.2.4: - resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} - - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - - pure-rand@6.1.0: - resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-is@18.2.0: - resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - readable-web-to-node-stream@3.0.2: - resolution: {integrity: sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==} - engines: {node: '>=8'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - require-from-string@2.0.2: - resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - resolve.exports@2.0.2: - resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} - engines: {node: '>=10'} - - resolve@1.19.0: - resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==} - - resolve@1.22.8: - resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} - hasBin: true - - restore-cursor@4.0.0: - resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - shiki@0.14.7: - resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - sisteransi@1.0.5: - resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - source-map-support@0.5.13: - resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} - - source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - - spdx-exceptions@2.5.0: - resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} - - spdx-expression-parse@4.0.0: - resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} - - spdx-license-ids@3.0.17: - resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==} - - split2@4.2.0: - resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} - engines: {node: '>= 10.x'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - stdin-discarder@0.1.0: - resolution: {integrity: sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - stdin-discarder@0.2.2: - resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==} - engines: {node: '>=18'} - - string-length@4.0.2: - resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} - - string-width@6.1.0: - resolution: {integrity: sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==} - engines: {node: '>=16'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - strip-bom@4.0.0: - resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} - engines: {node: '>=8'} - - strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - - strip-final-newline@3.0.0: - resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} - engines: {node: '>=12'} - - strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - - strtok3@7.0.0: - resolution: {integrity: sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==} - engines: {node: '>=14.16'} - - supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} - engines: {node: '>=10'} - - supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - - test-exclude@6.0.0: - resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} - engines: {node: '>=8'} - - text-extensions@2.4.0: - resolution: {integrity: sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==} - engines: {node: '>=8'} - - text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - - through@2.3.8: - resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - - tmpl@1.0.5: - resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} - - to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - token-types@5.0.1: - resolution: {integrity: sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==} - engines: {node: '>=14.16'} - - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} - engines: {node: '>=16'} - peerDependencies: - typescript: '>=4.2.0' - - ts-jest@29.1.2: - resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==} - engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/types': ^29.0.0 - babel-jest: ^29.0.0 - esbuild: '*' - jest: ^29.0.0 - typescript: '>=4.3 <6' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - - type-detect@4.0.8: - resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} - engines: {node: '>=4'} - - type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - type-fest@2.19.0: - resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} - engines: {node: '>=12.20'} - - typedoc-github-wiki-theme@1.1.0: - resolution: {integrity: sha512-VyFmz8ZV2j/qEsCjD5EtR6FgZsCoy64Zr6SS9kCTcq7zx69Cx4UJBx8Ga/naxqs08TDggE6myIfODY6awwAGcA==} - peerDependencies: - typedoc: '>=0.24.0' - typedoc-plugin-markdown: '>=3.15.0' - - typedoc-plugin-extras@3.0.0: - resolution: {integrity: sha512-eiAe3qtm2WbV5owdncpt0zHZPqsNZH2mzNGILPd4zqrvEZie3Et9es4cpGZ+8lHO/SI0pVKwsAj7IuMxPNOdYg==} - peerDependencies: - typedoc: 0.25.x - - typedoc-plugin-markdown@3.17.1: - resolution: {integrity: sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==} - peerDependencies: - typedoc: '>=0.24.0' - - typedoc-plugin-mermaid@1.10.0: - resolution: {integrity: sha512-NMo+m5FY5SuNR2dgDYwLO/Bu8O1927xPm1B5S5QcqBD9JiNaWP6jbyuPUltJtq9KEZOme3QwLVe1ZPSDr3tsmw==} - peerDependencies: - typedoc: '>=0.23.0' - - typedoc-theme-hierarchy@4.1.2: - resolution: {integrity: sha512-X3H+zaDkg7wLNoaPJoqXs3rnMfZ9BZjmlXRwplWDciaPfn2hojHxJJ+yVKdqqmojgiHJgg7MYWGDVpOfNlOJ5A==} - peerDependencies: - typedoc: ^0.24.0 || ^0.25.0 - - typedoc@0.25.13: - resolution: {integrity: sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x - - typescript-eslint@7.6.0: - resolution: {integrity: sha512-LY6vH6F1l5jpGqRtU+uK4+mOecIb4Cd4kaz1hAiJrgnNiHUA8wiw8BkJyYS+MRLM69F1QuSKwtGlQqnGl1Rc6w==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - uglify-js@3.17.4: - resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} - engines: {node: '>=0.8.0'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - undici@5.28.4: - resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} - engines: {node: '>=14.0'} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universalify@2.0.1: - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} - engines: {node: '>= 10.0.0'} - - update-browserslist-db@1.0.13: - resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - - uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - v8-to-istanbul@9.2.0: - resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} - engines: {node: '>=10.12.0'} - - vscode-oniguruma@1.7.0: - resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} - - vscode-textmate@8.0.0: - resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} - - walker@1.0.8: - resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - widest-line@4.0.1: - resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==} - engines: {node: '>=12'} - - wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} - engines: {node: '>=12'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@4.0.2: - resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - - ws@8.17.0: - resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - - yocto-queue@1.0.0: - resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} - engines: {node: '>=12.20'} - - zeneth@0.0.1: - resolution: {integrity: sha512-QGqq6LqLBlECEH4uozMoUlRnDJnkaPCbEsnPwrKndMcmHFU1YIV3woyhrSU6FzdGd1VO9lMAGa/UKmcLB+zh0g==} - -snapshots: - - '@aashutoshrathi/word-wrap@1.2.6': {} - - '@akarui/structures@2.1.0': {} - - '@ampproject/remapping@2.3.0': - dependencies: - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - - '@babel/code-frame@7.24.2': - dependencies: - '@babel/highlight': 7.24.2 - picocolors: 1.0.0 - - '@babel/compat-data@7.24.4': {} - - '@babel/core@7.24.4': - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.4 - '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) - '@babel/helpers': 7.24.4 - '@babel/parser': 7.24.4 - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.1 - '@babel/types': 7.24.0 - convert-source-map: 2.0.0 - debug: 4.3.4 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/generator@7.24.4': - dependencies: - '@babel/types': 7.24.0 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 - - '@babel/helper-compilation-targets@7.23.6': - dependencies: - '@babel/compat-data': 7.24.4 - '@babel/helper-validator-option': 7.23.5 - browserslist: 4.23.0 - lru-cache: 5.1.1 - semver: 6.3.1 - - '@babel/helper-environment-visitor@7.22.20': {} - - '@babel/helper-function-name@7.23.0': - dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.0 - - '@babel/helper-hoist-variables@7.22.5': - dependencies: - '@babel/types': 7.24.0 - - '@babel/helper-module-imports@7.24.3': - dependencies: - '@babel/types': 7.24.0 - - '@babel/helper-module-transforms@7.23.3(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.24.3 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 - - '@babel/helper-plugin-utils@7.24.0': {} - - '@babel/helper-simple-access@7.22.5': - dependencies: - '@babel/types': 7.24.0 - - '@babel/helper-split-export-declaration@7.22.6': - dependencies: - '@babel/types': 7.24.0 - - '@babel/helper-string-parser@7.24.1': {} - - '@babel/helper-validator-identifier@7.22.20': {} - - '@babel/helper-validator-option@7.23.5': {} - - '@babel/helpers@7.24.4': - dependencies: - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.1 - '@babel/types': 7.24.0 - transitivePeerDependencies: - - supports-color - - '@babel/highlight@7.24.2': - dependencies: - '@babel/helper-validator-identifier': 7.22.20 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.0.0 - - '@babel/parser@7.24.4': - dependencies: - '@babel/types': 7.24.0 - - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/template@7.24.0': - dependencies: - '@babel/code-frame': 7.24.2 - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 - - '@babel/traverse@7.24.1': - dependencies: - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 - debug: 4.3.4 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - '@babel/types@7.24.0': - dependencies: - '@babel/helper-string-parser': 7.24.1 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 - - '@bcoe/v8-coverage@0.2.3': {} - - '@commitlint/cli@19.2.1(@types/node@20.12.7)(typescript@5.4.5)': - dependencies: - '@commitlint/format': 19.0.3 - '@commitlint/lint': 19.1.0 - '@commitlint/load': 19.2.0(@types/node@20.12.7)(typescript@5.4.5) - '@commitlint/read': 19.2.1 - '@commitlint/types': 19.0.3 - execa: 8.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - typescript - - '@commitlint/config-conventional@19.1.0': - dependencies: - '@commitlint/types': 19.0.3 - conventional-changelog-conventionalcommits: 7.0.2 - - '@commitlint/config-validator@19.0.3': - dependencies: - '@commitlint/types': 19.0.3 - ajv: 8.12.0 - - '@commitlint/ensure@19.0.3': - dependencies: - '@commitlint/types': 19.0.3 - lodash.camelcase: 4.3.0 - lodash.kebabcase: 4.1.1 - lodash.snakecase: 4.1.1 - lodash.startcase: 4.4.0 - lodash.upperfirst: 4.3.1 - - '@commitlint/execute-rule@19.0.0': {} - - '@commitlint/format@19.0.3': - dependencies: - '@commitlint/types': 19.0.3 - chalk: 5.3.0 - - '@commitlint/is-ignored@19.0.3': - dependencies: - '@commitlint/types': 19.0.3 - semver: 7.6.0 - - '@commitlint/lint@19.1.0': - dependencies: - '@commitlint/is-ignored': 19.0.3 - '@commitlint/parse': 19.0.3 - '@commitlint/rules': 19.0.3 - '@commitlint/types': 19.0.3 - - '@commitlint/load@19.2.0(@types/node@20.12.7)(typescript@5.4.5)': - dependencies: - '@commitlint/config-validator': 19.0.3 - '@commitlint/execute-rule': 19.0.0 - '@commitlint/resolve-extends': 19.1.0 - '@commitlint/types': 19.0.3 - chalk: 5.3.0 - cosmiconfig: 9.0.0(typescript@5.4.5) - cosmiconfig-typescript-loader: 5.0.0(@types/node@20.12.7)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5) - lodash.isplainobject: 4.0.6 - lodash.merge: 4.6.2 - lodash.uniq: 4.5.0 - transitivePeerDependencies: - - '@types/node' - - typescript - - '@commitlint/message@19.0.0': {} - - '@commitlint/parse@19.0.3': - dependencies: - '@commitlint/types': 19.0.3 - conventional-changelog-angular: 7.0.0 - conventional-commits-parser: 5.0.0 - - '@commitlint/read@19.2.1': - dependencies: - '@commitlint/top-level': 19.0.0 - '@commitlint/types': 19.0.3 - execa: 8.0.1 - git-raw-commits: 4.0.0 - minimist: 1.2.8 - - '@commitlint/resolve-extends@19.1.0': - dependencies: - '@commitlint/config-validator': 19.0.3 - '@commitlint/types': 19.0.3 - global-directory: 4.0.1 - import-meta-resolve: 4.0.0 - lodash.mergewith: 4.6.2 - resolve-from: 5.0.0 - - '@commitlint/rules@19.0.3': - dependencies: - '@commitlint/ensure': 19.0.3 - '@commitlint/message': 19.0.0 - '@commitlint/to-lines': 19.0.0 - '@commitlint/types': 19.0.3 - execa: 8.0.1 - - '@commitlint/to-lines@19.0.0': {} - - '@commitlint/top-level@19.0.0': - dependencies: - find-up: 7.0.0 - - '@commitlint/types@19.0.3': - dependencies: - '@types/conventional-commits-parser': 5.0.0 - chalk: 5.3.0 - - '@es-joy/jsdoccomment@0.42.0': - dependencies: - comment-parser: 1.4.1 - esquery: 1.5.0 - jsdoc-type-pratt-parser: 4.0.0 - - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': - dependencies: - eslint: 8.57.0 - eslint-visitor-keys: 3.4.3 - - '@eslint-community/eslint-utils@4.4.0(eslint@9.0.0)': - dependencies: - eslint: 9.0.0 - eslint-visitor-keys: 3.4.3 - - '@eslint-community/regexpp@4.10.0': {} - - '@eslint/eslintrc@2.1.4': - dependencies: - ajv: 6.12.6 - debug: 4.3.4 - espree: 9.6.1 - globals: 13.24.0 - ignore: 5.3.1 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - - '@eslint/eslintrc@3.0.2': - dependencies: - ajv: 6.12.6 - debug: 4.3.4 - espree: 10.0.1 - globals: 14.0.0 - ignore: 5.3.1 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - - '@eslint/js@8.57.0': {} - - '@eslint/js@9.0.0': {} - - '@fastify/busboy@2.1.1': {} - - '@humanwhocodes/config-array@0.11.14': - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - - '@humanwhocodes/config-array@0.12.3': - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - - '@humanwhocodes/module-importer@1.0.1': {} - - '@humanwhocodes/object-schema@2.0.3': {} - - '@isaacs/cliui@8.0.2': - dependencies: - string-width: 5.1.2 - string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.0 - strip-ansi-cjs: strip-ansi@6.0.1 - wrap-ansi: 8.1.0 - wrap-ansi-cjs: wrap-ansi@7.0.0 - - '@istanbuljs/load-nyc-config@1.1.0': - dependencies: - camelcase: 5.3.1 - find-up: 4.1.0 - get-package-type: 0.1.0 - js-yaml: 3.14.1 - resolve-from: 5.0.0 - - '@istanbuljs/schema@0.1.3': {} - - '@jest/console@29.7.0': - dependencies: - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - chalk: 4.1.2 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - slash: 3.0.0 - - '@jest/core@29.7.0': - dependencies: - '@jest/console': 29.7.0 - '@jest/reporters': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 3.9.0 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.12.7) - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-resolve-dependencies: 29.7.0 - jest-runner: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - jest-watcher: 29.7.0 - micromatch: 4.0.5 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - - '@jest/environment@29.7.0': - dependencies: - '@jest/fake-timers': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - jest-mock: 29.7.0 - - '@jest/expect-utils@29.7.0': - dependencies: - jest-get-type: 29.6.3 - - '@jest/expect@29.7.0': - dependencies: - expect: 29.7.0 - jest-snapshot: 29.7.0 - transitivePeerDependencies: - - supports-color - - '@jest/fake-timers@29.7.0': - dependencies: - '@jest/types': 29.6.3 - '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.12.7 - jest-message-util: 29.7.0 - jest-mock: 29.7.0 - jest-util: 29.7.0 - - '@jest/globals@29.7.0': - dependencies: - '@jest/environment': 29.7.0 - '@jest/expect': 29.7.0 - '@jest/types': 29.6.3 - jest-mock: 29.7.0 - transitivePeerDependencies: - - supports-color - - '@jest/reporters@29.7.0': - dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 20.12.7 - chalk: 4.1.2 - collect-v8-coverage: 1.0.2 - exit: 0.1.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - istanbul-lib-coverage: 3.2.2 - istanbul-lib-instrument: 6.0.2 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.7 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - jest-worker: 29.7.0 - slash: 3.0.0 - string-length: 4.0.2 - strip-ansi: 6.0.1 - v8-to-istanbul: 9.2.0 - transitivePeerDependencies: - - supports-color - - '@jest/schemas@29.6.3': - dependencies: - '@sinclair/typebox': 0.27.8 - - '@jest/source-map@29.6.3': - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - callsites: 3.1.0 - graceful-fs: 4.2.11 - - '@jest/test-result@29.7.0': - dependencies: - '@jest/console': 29.7.0 - '@jest/types': 29.6.3 - '@types/istanbul-lib-coverage': 2.0.6 - collect-v8-coverage: 1.0.2 - - '@jest/test-sequencer@29.7.0': - dependencies: - '@jest/test-result': 29.7.0 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - slash: 3.0.0 - - '@jest/transform@29.7.0': - dependencies: - '@babel/core': 7.24.4 - '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.25 - babel-plugin-istanbul: 6.1.1 - chalk: 4.1.2 - convert-source-map: 2.0.0 - fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-regex-util: 29.6.3 - jest-util: 29.7.0 - micromatch: 4.0.5 - pirates: 4.0.6 - slash: 3.0.0 - write-file-atomic: 4.0.2 - transitivePeerDependencies: - - supports-color - - '@jest/types@29.6.3': - dependencies: - '@jest/schemas': 29.6.3 - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.7 - '@types/yargs': 17.0.32 - chalk: 4.1.2 - - '@jridgewell/gen-mapping@0.3.5': - dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.25 - - '@jridgewell/resolve-uri@3.1.2': {} - - '@jridgewell/set-array@1.2.1': {} - - '@jridgewell/sourcemap-codec@1.4.15': {} - - '@jridgewell/trace-mapping@0.3.25': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - - '@microsoft/tsdoc-config@0.16.2': - dependencies: - '@microsoft/tsdoc': 0.14.2 - ajv: 6.12.6 - jju: 1.4.0 - resolve: 1.19.0 - - '@microsoft/tsdoc@0.14.2': {} - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@one-ini/wasm@0.1.1': {} - - '@pkgjs/parseargs@0.11.0': - optional: true - - '@sinclair/typebox@0.27.8': {} - - '@sinonjs/commons@3.0.1': - dependencies: - type-detect: 4.0.8 - - '@sinonjs/fake-timers@10.3.0': - dependencies: - '@sinonjs/commons': 3.0.1 - - '@stylistic/eslint-plugin-js@1.7.2(eslint@9.0.0)': - dependencies: - '@types/eslint': 8.56.10 - acorn: 8.11.3 - escape-string-regexp: 4.0.0 - eslint: 9.0.0 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - - '@stylistic/eslint-plugin-jsx@1.7.2(eslint@9.0.0)': - dependencies: - '@stylistic/eslint-plugin-js': 1.7.2(eslint@9.0.0) - '@types/eslint': 8.56.10 - eslint: 9.0.0 - estraverse: 5.3.0 - picomatch: 4.0.2 - - '@stylistic/eslint-plugin-plus@1.7.2(eslint@9.0.0)(typescript@5.4.5)': - dependencies: - '@types/eslint': 8.56.10 - '@typescript-eslint/utils': 6.21.0(eslint@9.0.0)(typescript@5.4.5) - eslint: 9.0.0 - transitivePeerDependencies: - - supports-color - - typescript - - '@stylistic/eslint-plugin-ts@1.7.2(eslint@9.0.0)(typescript@5.4.5)': - dependencies: - '@stylistic/eslint-plugin-js': 1.7.2(eslint@9.0.0) - '@types/eslint': 8.56.10 - '@typescript-eslint/utils': 6.21.0(eslint@9.0.0)(typescript@5.4.5) - eslint: 9.0.0 - transitivePeerDependencies: - - supports-color - - typescript - - '@stylistic/eslint-plugin@1.7.2(eslint@9.0.0)(typescript@5.4.5)': - dependencies: - '@stylistic/eslint-plugin-js': 1.7.2(eslint@9.0.0) - '@stylistic/eslint-plugin-jsx': 1.7.2(eslint@9.0.0) - '@stylistic/eslint-plugin-plus': 1.7.2(eslint@9.0.0)(typescript@5.4.5) - '@stylistic/eslint-plugin-ts': 1.7.2(eslint@9.0.0)(typescript@5.4.5) - '@types/eslint': 8.56.10 - eslint: 9.0.0 - transitivePeerDependencies: - - supports-color - - typescript - - '@tokenizer/token@0.3.0': {} - - '@types/babel__core@7.20.5': - dependencies: - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 - '@types/babel__generator': 7.6.8 - '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.20.5 - - '@types/babel__generator@7.6.8': - dependencies: - '@babel/types': 7.24.0 - - '@types/babel__template@7.4.4': - dependencies: - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 - - '@types/babel__traverse@7.20.5': - dependencies: - '@babel/types': 7.24.0 - - '@types/conventional-commits-parser@5.0.0': - dependencies: - '@types/node': 20.12.7 - - '@types/eslint@8.56.10': - dependencies: - '@types/estree': 1.0.5 - '@types/json-schema': 7.0.15 - - '@types/eslint__eslintrc@2.1.1': - dependencies: - '@types/eslint': 8.56.10 - - '@types/eslint__js@8.42.3': - dependencies: - '@types/eslint': 8.56.10 - - '@types/estree@1.0.5': {} - - '@types/graceful-fs@4.1.9': - dependencies: - '@types/node': 20.12.7 - - '@types/istanbul-lib-coverage@2.0.6': {} - - '@types/istanbul-lib-report@3.0.3': - dependencies: - '@types/istanbul-lib-coverage': 2.0.6 - - '@types/istanbul-reports@3.0.4': - dependencies: - '@types/istanbul-lib-report': 3.0.3 - - '@types/jest@29.5.12': - dependencies: - expect: 29.7.0 - pretty-format: 29.7.0 - - '@types/js-beautify@1.14.3': {} - - '@types/json-schema@7.0.15': {} - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@types/semver@7.5.8': {} - - '@types/stack-utils@2.0.3': {} - - '@types/uglify-js@3.17.5': - dependencies: - source-map: 0.6.1 - - '@types/ws@8.5.10': - dependencies: - '@types/node': 20.12.7 - - '@types/yargs-parser@21.0.3': {} - - '@types/yargs@17.0.32': - dependencies: - '@types/yargs-parser': 21.0.3 - - '@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/type-utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.6.0 - debug: 4.3.4 - eslint: 8.57.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare: 1.4.0 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5))(eslint@9.0.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.6.0(eslint@9.0.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/type-utils': 7.6.0(eslint@9.0.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@9.0.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.6.0 - debug: 4.3.4 - eslint: 9.0.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare: 1.4.0 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.6.0 - debug: 4.3.4 - eslint: 8.57.0 - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5)': - dependencies: - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.6.0 - debug: 4.3.4 - eslint: 9.0.0 - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/scope-manager@6.21.0': - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - - '@typescript-eslint/scope-manager@7.6.0': - dependencies: - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/visitor-keys': 7.6.0 - - '@typescript-eslint/type-utils@7.6.0(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.4 - eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/type-utils@7.6.0(eslint@9.0.0)(typescript@5.4.5)': - dependencies: - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@9.0.0)(typescript@5.4.5) - debug: 4.3.4 - eslint: 9.0.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/types@6.21.0': {} - - '@typescript-eslint/types@7.6.0': {} - - '@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5)': - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/typescript-estree@7.6.0(typescript@5.4.5)': - dependencies: - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/visitor-keys': 7.6.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.4 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/utils@6.21.0(eslint@9.0.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) - eslint: 9.0.0 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - typescript - - '@typescript-eslint/utils@7.6.0(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - eslint: 8.57.0 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - typescript - - '@typescript-eslint/utils@7.6.0(eslint@9.0.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - eslint: 9.0.0 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - typescript - - '@typescript-eslint/visitor-keys@6.21.0': - dependencies: - '@typescript-eslint/types': 6.21.0 - eslint-visitor-keys: 3.4.3 - - '@typescript-eslint/visitor-keys@7.6.0': - dependencies: - '@typescript-eslint/types': 7.6.0 - eslint-visitor-keys: 3.4.3 - - '@ungap/structured-clone@1.2.0': {} - - JSONStream@1.3.5: - dependencies: - jsonparse: 1.3.1 - through: 2.3.8 - - abbrev@2.0.0: {} - - acorn-jsx@5.3.2(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn@8.11.3: {} - - ajv@6.12.6: - 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 - - ajv@8.12.0: - dependencies: - fast-deep-equal: 3.1.3 - json-schema-traverse: 1.0.0 - require-from-string: 2.0.2 - uri-js: 4.4.1 - - ansi-align@3.0.1: - dependencies: - string-width: 4.2.3 - - ansi-colors@4.1.3: {} - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-sequence-parser@1.1.1: {} - - ansi-styles@3.2.1: - dependencies: - color-convert: 1.9.3 - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@5.2.0: {} - - ansi-styles@6.2.1: {} - - anymatch@3.1.3: - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - - are-docs-informative@0.0.2: {} - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-ify@1.0.0: {} - - array-union@2.1.0: {} - - babel-jest@29.7.0(@babel/core@7.24.4): - dependencies: - '@babel/core': 7.24.4 - '@jest/transform': 29.7.0 - '@types/babel__core': 7.20.5 - babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.24.4) - chalk: 4.1.2 - graceful-fs: 4.2.11 - slash: 3.0.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-istanbul@6.1.1: - dependencies: - '@babel/helper-plugin-utils': 7.24.0 - '@istanbuljs/load-nyc-config': 1.1.0 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-instrument: 5.2.1 - test-exclude: 6.0.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-jest-hoist@29.6.3: - dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.0 - '@types/babel__core': 7.20.5 - '@types/babel__traverse': 7.20.5 - - babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.4): - dependencies: - '@babel/core': 7.24.4 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.4) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.4) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.4) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.4) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.4) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.4) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.4) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.4) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.4) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.4) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.4) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.4) - - babel-preset-jest@29.6.3(@babel/core@7.24.4): - dependencies: - '@babel/core': 7.24.4 - babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.4) - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - bl@5.1.0: - dependencies: - buffer: 6.0.3 - inherits: 2.0.4 - readable-stream: 3.6.2 - - boxen@7.1.1: - dependencies: - ansi-align: 3.0.1 - camelcase: 7.0.1 - chalk: 5.3.0 - cli-boxes: 3.0.0 - string-width: 5.1.2 - type-fest: 2.19.0 - widest-line: 4.0.1 - wrap-ansi: 8.1.0 - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - brace-expansion@2.0.1: - dependencies: - balanced-match: 1.0.2 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - browserslist@4.23.0: - dependencies: - caniuse-lite: 1.0.30001608 - electron-to-chromium: 1.4.733 - node-releases: 2.0.14 - update-browserslist-db: 1.0.13(browserslist@4.23.0) - - bs-logger@0.2.6: - dependencies: - fast-json-stable-stringify: 2.1.0 - - bser@2.1.1: - dependencies: - node-int64: 0.4.0 - - buffer-from@1.1.2: {} - - buffer@6.0.3: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - builtin-modules@3.3.0: {} - - callsites@3.1.0: {} - - camelcase@5.3.1: {} - - camelcase@6.3.0: {} - - camelcase@7.0.1: {} - - caniuse-lite@1.0.30001608: {} - - chalk@2.4.2: - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - char-regex@1.0.2: {} - - ci-info@3.9.0: {} - - cjs-module-lexer@1.2.3: {} - - cli-boxes@3.0.0: {} - - cli-cursor@4.0.0: - dependencies: - restore-cursor: 4.0.0 - - cli-spinners@2.9.2: {} - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - co@4.6.0: {} - - collect-v8-coverage@1.0.2: {} - - color-convert@1.9.3: - dependencies: - color-name: 1.1.3 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.3: {} - - color-name@1.1.4: {} - - commander@10.0.1: {} - - commander@12.0.0: {} - - comment-parser@1.4.1: {} - - compare-func@2.0.0: - dependencies: - array-ify: 1.0.0 - dot-prop: 5.3.0 - - concat-map@0.0.1: {} - - config-chain@1.1.13: - dependencies: - ini: 1.3.8 - proto-list: 1.2.4 - - conventional-changelog-angular@7.0.0: - dependencies: - compare-func: 2.0.0 - - conventional-changelog-conventionalcommits@7.0.2: - dependencies: - compare-func: 2.0.0 - - conventional-commits-parser@5.0.0: - dependencies: - JSONStream: 1.3.5 - is-text-path: 2.0.0 - meow: 12.1.1 - split2: 4.2.0 - - convert-source-map@2.0.0: {} - - cosmiconfig-typescript-loader@5.0.0(@types/node@20.12.7)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5): - dependencies: - '@types/node': 20.12.7 - cosmiconfig: 9.0.0(typescript@5.4.5) - jiti: 1.21.0 - typescript: 5.4.5 - - cosmiconfig@9.0.0(typescript@5.4.5): - dependencies: - env-paths: 2.2.1 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - parse-json: 5.2.0 - optionalDependencies: - typescript: 5.4.5 - - create-jest@29.7.0(@types/node@20.12.7): - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.12.7) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - cross-spawn@7.0.3: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - css-tree@2.2.1: - dependencies: - mdn-data: 2.0.28 - source-map-js: 1.2.0 - - csso@5.0.5: - dependencies: - css-tree: 2.2.1 - - dargs@8.1.0: {} - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - dedent@1.5.3: {} - - deep-is@0.1.4: {} - - deepmerge@4.3.1: {} - - detect-newline@3.1.0: {} - - diff-sequences@29.6.3: {} - - dir-glob@3.0.1: - dependencies: - path-type: 4.0.0 - - doctrine@3.0.0: - dependencies: - esutils: 2.0.3 - - dot-prop@5.3.0: - dependencies: - is-obj: 2.0.0 - - dotenv@16.4.5: {} - - eastasianwidth@0.2.0: {} - - editorconfig@1.0.4: - dependencies: - '@one-ini/wasm': 0.1.1 - commander: 10.0.1 - minimatch: 9.0.1 - semver: 7.6.0 - - electron-to-chromium@1.4.733: {} - - emittery@0.13.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - emoji-regex@9.2.2: {} - - enquirer@2.4.1: - dependencies: - ansi-colors: 4.1.3 - strip-ansi: 6.0.1 - - env-paths@2.2.1: {} - - error-ex@1.3.2: - dependencies: - is-arrayish: 0.2.1 - - escalade@3.1.2: {} - - escape-string-regexp@1.0.5: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@4.0.0: {} - - eslint-config-xo-typescript@4.0.0(@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5): - dependencies: - '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - eslint: 8.57.0 - typescript: 5.4.5 - - eslint-config-xo-typescript@4.0.0(@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5))(eslint@9.0.0)(typescript@5.4.5))(@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5))(eslint@9.0.0)(typescript@5.4.5): - dependencies: - '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5))(eslint@9.0.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.6.0(eslint@9.0.0)(typescript@5.4.5) - eslint: 9.0.0 - typescript: 5.4.5 - - eslint-plugin-jsdoc@48.2.3(eslint@9.0.0): - dependencies: - '@es-joy/jsdoccomment': 0.42.0 - are-docs-informative: 0.0.2 - comment-parser: 1.4.1 - debug: 4.3.4 - escape-string-regexp: 4.0.0 - eslint: 9.0.0 - esquery: 1.5.0 - is-builtin-module: 3.2.1 - semver: 7.6.0 - spdx-expression-parse: 4.0.0 - transitivePeerDependencies: - - supports-color - - eslint-plugin-tsdoc@0.2.17: - dependencies: - '@microsoft/tsdoc': 0.14.2 - '@microsoft/tsdoc-config': 0.16.2 - - eslint-scope@7.2.2: - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - - eslint-scope@8.0.1: - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - - eslint-visitor-keys@3.4.3: {} - - eslint-visitor-keys@4.0.0: {} - - eslint@8.57.0: - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 - 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.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.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.24.0 - graphemer: 1.4.0 - ignore: 5.3.1 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - 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.3 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - - eslint@9.0.0: - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 3.0.2 - '@eslint/js': 9.0.0 - '@humanwhocodes/config-array': 0.12.3 - '@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 - escape-string-regexp: 4.0.0 - eslint-scope: 8.0.1 - eslint-visitor-keys: 4.0.0 - espree: 10.0.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 - find-up: 5.0.0 - glob-parent: 6.0.2 - graphemer: 1.4.0 - ignore: 5.3.1 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - 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.3 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - - espree@10.0.1: - dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 4.0.0 - - espree@9.6.1: - dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.4.3 - - esprima@4.0.1: {} - - esquery@1.5.0: - dependencies: - estraverse: 5.3.0 - - esrecurse@4.3.0: - dependencies: - estraverse: 5.3.0 - - estraverse@5.3.0: {} - - esutils@2.0.3: {} - - execa@5.1.1: - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - - execa@8.0.1: - dependencies: - cross-spawn: 7.0.3 - get-stream: 8.0.1 - human-signals: 5.0.0 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.3.0 - onetime: 6.0.0 - signal-exit: 4.1.0 - strip-final-newline: 3.0.0 - - exit@0.1.2: {} - - expect@29.7.0: - dependencies: - '@jest/expect-utils': 29.7.0 - jest-get-type: 29.6.3 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - - fast-deep-equal@3.1.3: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fast-json-stable-stringify@2.1.0: {} - - fast-levenshtein@2.0.6: {} - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - fb-watchman@2.0.2: - dependencies: - bser: 2.1.1 - - file-entry-cache@6.0.1: - dependencies: - flat-cache: 3.2.0 - - file-entry-cache@8.0.0: - dependencies: - flat-cache: 4.0.1 - - file-type@18.7.0: - dependencies: - readable-web-to-node-stream: 3.0.2 - strtok3: 7.0.0 - token-types: 5.0.1 - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up@4.1.0: - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - - find-up@5.0.0: - dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - - find-up@7.0.0: - dependencies: - locate-path: 7.2.0 - path-exists: 5.0.0 - unicorn-magic: 0.1.0 - - flat-cache@3.2.0: - dependencies: - flatted: 3.3.1 - keyv: 4.5.4 - rimraf: 3.0.2 - - flat-cache@4.0.1: - dependencies: - flatted: 3.3.1 - keyv: 4.5.4 - - flatted@3.3.1: {} - - foreground-child@3.1.1: - dependencies: - cross-spawn: 7.0.3 - signal-exit: 4.1.0 - - fs-extra@11.1.1: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.1 - - fs.realpath@1.0.0: {} - - fsevents@2.3.3: - optional: true - - function-bind@1.1.2: {} - - gensync@1.0.0-beta.2: {} - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-package-type@0.1.0: {} - - get-stream@6.0.1: {} - - get-stream@8.0.1: {} - - git-raw-commits@4.0.0: - dependencies: - dargs: 8.1.0 - meow: 12.1.1 - split2: 4.2.0 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob-parent@6.0.2: - dependencies: - is-glob: 4.0.3 - - glob@10.4.1: - dependencies: - foreground-child: 3.1.1 - jackspeak: 3.1.2 - minimatch: 9.0.4 - minipass: 7.1.2 - path-scurry: 1.11.1 - - glob@7.2.3: - 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 - - global-directory@4.0.1: - dependencies: - ini: 4.1.1 - - globals@11.12.0: {} - - globals@13.24.0: - dependencies: - type-fest: 0.20.2 - - globals@14.0.0: {} - - globals@15.0.0: {} - - globby@11.1.0: - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.1 - merge2: 1.4.1 - slash: 3.0.0 - - graceful-fs@4.2.11: {} - - graphemer@1.4.0: {} - - handlebars@4.7.8: - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.17.4 - - has-flag@3.0.0: {} - - has-flag@4.0.0: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - html-escaper@2.0.2: {} - - html-escaper@3.0.3: {} - - human-signals@2.1.0: {} - - human-signals@5.0.0: {} - - husky@9.0.11: {} - - ieee754@1.2.1: {} - - ignore@5.3.1: {} - - import-fresh@3.3.0: - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - - import-local@3.1.0: - dependencies: - pkg-dir: 4.2.0 - resolve-cwd: 3.0.0 - - import-meta-resolve@4.0.0: {} - - imurmurhash@0.1.4: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - ini@1.3.8: {} - - ini@4.1.1: {} - - is-arrayish@0.2.1: {} - - is-builtin-module@3.2.1: - dependencies: - builtin-modules: 3.3.0 - - is-core-module@2.13.1: - dependencies: - hasown: 2.0.2 - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-generator-fn@2.1.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@2.0.0: {} - - is-number@7.0.0: {} - - is-obj@2.0.0: {} - - is-path-inside@3.0.3: {} - - is-stream@2.0.1: {} - - is-stream@3.0.0: {} - - is-text-path@2.0.0: - dependencies: - text-extensions: 2.4.0 - - is-unicode-supported@1.3.0: {} - - is-unicode-supported@2.0.0: {} - - isexe@2.0.0: {} - - istanbul-lib-coverage@3.2.2: {} - - istanbul-lib-instrument@5.2.1: - dependencies: - '@babel/core': 7.24.4 - '@babel/parser': 7.24.4 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.2 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - istanbul-lib-instrument@6.0.2: - dependencies: - '@babel/core': 7.24.4 - '@babel/parser': 7.24.4 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.2 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - istanbul-lib-report@3.0.1: - dependencies: - istanbul-lib-coverage: 3.2.2 - make-dir: 4.0.0 - supports-color: 7.2.0 - - istanbul-lib-source-maps@4.0.1: - dependencies: - debug: 4.3.4 - istanbul-lib-coverage: 3.2.2 - source-map: 0.6.1 - transitivePeerDependencies: - - supports-color - - istanbul-reports@3.1.7: - dependencies: - html-escaper: 2.0.2 - istanbul-lib-report: 3.0.1 - - jackspeak@3.1.2: - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - - jest-changed-files@29.7.0: - dependencies: - execa: 5.1.1 - jest-util: 29.7.0 - p-limit: 3.1.0 - - jest-circus@29.7.0: - dependencies: - '@jest/environment': 29.7.0 - '@jest/expect': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - chalk: 4.1.2 - co: 4.6.0 - dedent: 1.5.3 - is-generator-fn: 2.1.0 - jest-each: 29.7.0 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - p-limit: 3.1.0 - pretty-format: 29.7.0 - pure-rand: 6.1.0 - slash: 3.0.0 - stack-utils: 2.0.6 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-cli@29.7.0(@types/node@20.12.7): - dependencies: - '@jest/core': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.12.7) - exit: 0.1.2 - import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.12.7) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest-config@29.7.0(@types/node@20.12.7): - dependencies: - '@babel/core': 7.24.4 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.24.4) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0 - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 20.12.7 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-diff@29.7.0: - dependencies: - chalk: 4.1.2 - diff-sequences: 29.6.3 - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - - jest-docblock@29.7.0: - dependencies: - detect-newline: 3.1.0 - - jest-each@29.7.0: - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - jest-get-type: 29.6.3 - jest-util: 29.7.0 - pretty-format: 29.7.0 - - jest-environment-node@29.7.0: - dependencies: - '@jest/environment': 29.7.0 - '@jest/fake-timers': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - jest-mock: 29.7.0 - jest-util: 29.7.0 - - jest-get-type@29.6.3: {} - - jest-haste-map@29.7.0: - dependencies: - '@jest/types': 29.6.3 - '@types/graceful-fs': 4.1.9 - '@types/node': 20.12.7 - anymatch: 3.1.3 - fb-watchman: 2.0.2 - graceful-fs: 4.2.11 - jest-regex-util: 29.6.3 - jest-util: 29.7.0 - jest-worker: 29.7.0 - micromatch: 4.0.5 - walker: 1.0.8 - optionalDependencies: - fsevents: 2.3.3 - - jest-leak-detector@29.7.0: - dependencies: - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - - jest-matcher-utils@29.7.0: - dependencies: - chalk: 4.1.2 - jest-diff: 29.7.0 - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - - jest-message-util@29.7.0: - dependencies: - '@babel/code-frame': 7.24.2 - '@jest/types': 29.6.3 - '@types/stack-utils': 2.0.3 - chalk: 4.1.2 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - pretty-format: 29.7.0 - slash: 3.0.0 - stack-utils: 2.0.6 - - jest-mock@29.7.0: - dependencies: - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - jest-util: 29.7.0 - - jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): - optionalDependencies: - jest-resolve: 29.7.0 - - jest-regex-util@29.6.3: {} - - jest-resolve-dependencies@29.7.0: - dependencies: - jest-regex-util: 29.6.3 - jest-snapshot: 29.7.0 - transitivePeerDependencies: - - supports-color - - jest-resolve@29.7.0: - dependencies: - chalk: 4.1.2 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0) - jest-util: 29.7.0 - jest-validate: 29.7.0 - resolve: 1.22.8 - resolve.exports: 2.0.2 - slash: 3.0.0 - - jest-runner@29.7.0: - dependencies: - '@jest/console': 29.7.0 - '@jest/environment': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - chalk: 4.1.2 - emittery: 0.13.1 - graceful-fs: 4.2.11 - jest-docblock: 29.7.0 - jest-environment-node: 29.7.0 - jest-haste-map: 29.7.0 - jest-leak-detector: 29.7.0 - jest-message-util: 29.7.0 - jest-resolve: 29.7.0 - jest-runtime: 29.7.0 - jest-util: 29.7.0 - jest-watcher: 29.7.0 - jest-worker: 29.7.0 - p-limit: 3.1.0 - source-map-support: 0.5.13 - transitivePeerDependencies: - - supports-color - - jest-runtime@29.7.0: - dependencies: - '@jest/environment': 29.7.0 - '@jest/fake-timers': 29.7.0 - '@jest/globals': 29.7.0 - '@jest/source-map': 29.6.3 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - chalk: 4.1.2 - cjs-module-lexer: 1.2.3 - collect-v8-coverage: 1.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-mock: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - slash: 3.0.0 - strip-bom: 4.0.0 - transitivePeerDependencies: - - supports-color - - jest-snapshot@29.7.0: - dependencies: - '@babel/core': 7.24.4 - '@babel/generator': 7.24.4 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.4) - '@babel/types': 7.24.0 - '@jest/expect-utils': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.4) - chalk: 4.1.2 - expect: 29.7.0 - graceful-fs: 4.2.11 - jest-diff: 29.7.0 - jest-get-type: 29.6.3 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - natural-compare: 1.4.0 - pretty-format: 29.7.0 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - jest-util@29.7.0: - dependencies: - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - chalk: 4.1.2 - ci-info: 3.9.0 - graceful-fs: 4.2.11 - picomatch: 2.3.1 - - jest-validate@29.7.0: - dependencies: - '@jest/types': 29.6.3 - camelcase: 6.3.0 - chalk: 4.1.2 - jest-get-type: 29.6.3 - leven: 3.1.0 - pretty-format: 29.7.0 - - jest-watcher@29.7.0: - dependencies: - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.12.7 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - emittery: 0.13.1 - jest-util: 29.7.0 - string-length: 4.0.2 - - jest-worker@29.7.0: dependencies: - '@types/node': 20.12.7 - jest-util: 29.7.0 - merge-stream: 2.0.0 - supports-color: 8.1.1 - - jest@29.7.0(@types/node@20.12.7): - dependencies: - '@jest/core': 29.7.0 - '@jest/types': 29.6.3 - import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.12.7) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jiti@1.21.0: {} - - jju@1.4.0: {} - - js-beautify@1.15.1: - dependencies: - config-chain: 1.1.13 - editorconfig: 1.0.4 - glob: 10.4.1 - js-cookie: 3.0.5 - nopt: 7.2.1 - - js-cookie@3.0.5: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - jsdoc-type-pratt-parser@4.0.0: {} - - jsesc@2.5.2: {} - - json-buffer@3.0.1: {} - - json-parse-even-better-errors@2.3.1: {} - - json-schema-traverse@0.4.1: {} - - json-schema-traverse@1.0.0: {} - - json-stable-stringify-without-jsonify@1.0.1: {} - - json5@2.2.3: {} - - jsonc-parser@3.2.1: {} - - jsonfile@6.1.0: - dependencies: - universalify: 2.0.1 - optionalDependencies: - graceful-fs: 4.2.11 - - jsonparse@1.3.1: {} - - keyv@4.5.4: - dependencies: - json-buffer: 3.0.1 - - kleur@3.0.3: {} - - leven@3.1.0: {} - - levn@0.4.1: - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - - lines-and-columns@1.2.4: {} - - locate-path@5.0.0: - dependencies: - p-locate: 4.1.0 - - locate-path@6.0.0: - dependencies: - p-locate: 5.0.0 - - locate-path@7.2.0: - dependencies: - p-locate: 6.0.0 - - lodash.camelcase@4.3.0: {} - - lodash.isplainobject@4.0.6: {} - - lodash.kebabcase@4.1.1: {} - - lodash.memoize@4.1.2: {} - - lodash.merge@4.6.2: {} - - lodash.mergewith@4.6.2: {} - - lodash.snakecase@4.1.1: {} - - lodash.startcase@4.4.0: {} - - lodash.uniq@4.5.0: {} - - lodash.upperfirst@4.3.1: {} - - log-symbols@5.1.0: - dependencies: - chalk: 5.3.0 - is-unicode-supported: 1.3.0 - - log-symbols@6.0.0: - dependencies: - chalk: 5.3.0 - is-unicode-supported: 1.3.0 - - lru-cache@10.2.2: {} - - lru-cache@5.1.1: - dependencies: - yallist: 3.1.1 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - lunr@2.3.9: {} - - make-dir@4.0.0: - dependencies: - semver: 7.6.0 - - make-error@1.3.6: {} - - makeerror@1.0.12: - dependencies: - tmpl: 1.0.5 - - marked@4.3.0: {} - - mdn-data@2.0.28: {} - - meow@12.1.1: {} - - merge-stream@2.0.0: {} - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mimic-fn@2.1.0: {} - - mimic-fn@4.0.0: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minimatch@9.0.1: - dependencies: - brace-expansion: 2.0.1 - - minimatch@9.0.3: - dependencies: - brace-expansion: 2.0.1 - - minimatch@9.0.4: - dependencies: - brace-expansion: 2.0.1 - - minimist@1.2.8: {} - - minipass@7.1.2: {} - - ms@2.1.2: {} - - natural-compare@1.4.0: {} - - neo-async@2.6.2: {} - - node-int64@0.4.0: {} - - node-releases@2.0.14: {} - - nopt@7.2.1: - dependencies: - abbrev: 2.0.0 - - normalize-path@3.0.0: {} - - npm-run-path@4.0.1: - dependencies: - path-key: 3.1.1 - - npm-run-path@5.3.0: - dependencies: - path-key: 4.0.0 - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - onetime@6.0.0: - dependencies: - mimic-fn: 4.0.0 - - optionator@0.9.3: - dependencies: - '@aashutoshrathi/word-wrap': 1.2.6 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.5 + dev: true - ora@7.0.1: - dependencies: - chalk: 5.3.0 - cli-cursor: 4.0.0 - cli-spinners: 2.9.2 - is-interactive: 2.0.0 - is-unicode-supported: 1.3.0 - log-symbols: 5.1.0 - stdin-discarder: 0.1.0 - string-width: 6.1.0 - strip-ansi: 7.1.0 - - ora@8.0.1: + /ora@8.1.0: + resolution: {integrity: sha512-GQEkNkH/GHOhPFXcqZs3IDahXEQcQxsSjEkK4KvEEST4t7eNzoMjxTzef+EZ+JluDEV+Raoi3WQ2CflnRdSVnQ==} + engines: {node: '>=18'} dependencies: chalk: 5.3.0 - cli-cursor: 4.0.0 + cli-cursor: 5.0.0 cli-spinners: 2.9.2 is-interactive: 2.0.0 - is-unicode-supported: 2.0.0 + is-unicode-supported: 2.1.0 log-symbols: 6.0.0 stdin-discarder: 0.2.2 - string-width: 7.1.0 + string-width: 7.2.0 strip-ansi: 7.1.0 + dev: false - p-limit@2.3.0: - dependencies: - p-try: 2.2.0 - - p-limit@3.1.0: + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 + dev: true - p-limit@4.0.0: - dependencies: - yocto-queue: 1.0.0 - - p-locate@4.1.0: + /p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: - p-limit: 2.3.0 + yocto-queue: 1.1.1 + dev: true - p-locate@5.0.0: + /p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} dependencies: p-limit: 3.1.0 + dev: true - p-locate@6.0.0: + /p-locate@6.0.0: + resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: p-limit: 4.0.0 + dev: true - p-try@2.2.0: {} + /package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + dev: true - parent-module@1.0.1: + /parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} dependencies: callsites: 3.1.0 + dev: true + + /parse-imports@2.2.1: + resolution: {integrity: sha512-OL/zLggRp8mFhKL0rNORUTR4yBYujK/uU+xZL+/0Rgm2QE4nLO9v8PzEweSJEbMGKmDRjJE4R3IMJlL2di4JeQ==} + engines: {node: '>= 18'} + dependencies: + es-module-lexer: 1.5.4 + slashes: 3.0.12 + dev: true - parse-json@5.2.0: + /parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.24.2 + '@babel/code-frame': 7.24.7 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + dev: true - path-exists@4.0.0: {} - - path-exists@5.0.0: {} - - path-is-absolute@1.0.1: {} + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true - path-key@3.1.1: {} + /path-exists@5.0.0: + resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true - path-key@4.0.0: {} + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true - path-parse@1.0.7: {} + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true - path-scurry@1.11.1: + /path-scurry@2.0.0: + resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} + engines: {node: 20 || >=22} dependencies: - lru-cache: 10.2.2 + lru-cache: 11.0.1 minipass: 7.1.2 + dev: true - path-type@4.0.0: {} - - peek-readable@5.0.0: {} - - picocolors@1.0.0: {} - - picomatch@2.3.1: {} - - picomatch@4.0.2: {} - - pirates@4.0.6: {} - - pkg-dir@4.2.0: - dependencies: - find-up: 4.1.0 - - prelude-ls@1.2.1: {} - - prettier@3.2.5: {} - - pretty-format@29.7.0: - dependencies: - '@jest/schemas': 29.6.3 - ansi-styles: 5.2.0 - react-is: 18.2.0 - - prompts@2.4.2: - dependencies: - kleur: 3.0.3 - sisteransi: 1.0.5 - - proto-list@1.2.4: {} + /path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true - punycode@2.3.1: {} + /picocolors@1.1.0: + resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + dev: true - pure-rand@6.1.0: {} + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true - queue-microtask@1.2.3: {} + /picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + dev: true - react-is@18.2.0: {} + /prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: true - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true + dev: true - readable-web-to-node-stream@3.0.2: - dependencies: - readable-stream: 3.6.2 + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + dev: true - require-directory@2.1.1: {} + /queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true - require-from-string@2.0.2: {} + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 + /require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + dev: true - resolve-from@4.0.0: {} + /resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true - resolve-from@5.0.0: {} + /resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + dev: true - resolve.exports@2.0.2: {} + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true - resolve@1.19.0: + /resolve@1.19.0: + resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==} dependencies: - is-core-module: 2.13.1 + is-core-module: 2.15.1 path-parse: 1.0.7 + dev: true - resolve@1.22.8: + /resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true dependencies: - is-core-module: 2.13.1 + is-core-module: 2.15.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + dev: true - restore-cursor@4.0.0: + /restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} + onetime: 7.0.0 + signal-exit: 4.1.0 + dev: false - rimraf@3.0.2: - dependencies: - glob: 7.2.3 + /reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true - run-parallel@1.2.0: + /run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 + dev: true - safe-buffer@5.2.1: {} - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 + /semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + dev: true - shebang-command@2.0.0: + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 + dev: true - shebang-regex@3.0.0: {} - - shiki@0.14.7: - dependencies: - ansi-sequence-parser: 1.1.1 - jsonc-parser: 3.2.1 - vscode-oniguruma: 1.7.0 - vscode-textmate: 8.0.0 - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - sisteransi@1.0.5: {} + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true - slash@3.0.0: {} + /signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} - source-map-js@1.2.0: {} + /slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true - source-map-support@0.5.13: - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 + /slashes@3.0.12: + resolution: {integrity: sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==} + dev: true - source-map@0.6.1: {} + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true - spdx-exceptions@2.5.0: {} + /spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + dev: true - spdx-expression-parse@4.0.0: + /spdx-expression-parse@4.0.0: + resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.17 - - spdx-license-ids@3.0.17: {} - - split2@4.2.0: {} - - sprintf-js@1.0.3: {} + spdx-license-ids: 3.0.20 + dev: true - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - stdin-discarder@0.1.0: - dependencies: - bl: 5.1.0 + /spdx-license-ids@3.0.20: + resolution: {integrity: sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==} + dev: true - stdin-discarder@0.2.2: {} + /split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + dev: true - string-length@4.0.2: - dependencies: - char-regex: 1.0.2 - strip-ansi: 6.0.1 + /stdin-discarder@0.2.2: + resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==} + engines: {node: '>=18'} + dev: false - string-width@4.2.3: + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - string-width@5.1.2: + /string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 strip-ansi: 7.1.0 - string-width@6.1.0: - dependencies: - eastasianwidth: 0.2.0 - emoji-regex: 10.3.0 - strip-ansi: 7.1.0 - - string-width@7.1.0: + /string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} dependencies: - emoji-regex: 10.3.0 + emoji-regex: 10.4.0 get-east-asian-width: 1.2.0 strip-ansi: 7.1.0 + dev: false - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 - strip-ansi@7.1.0: + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} dependencies: - ansi-regex: 6.0.1 + ansi-regex: 6.1.0 - strip-bom@4.0.0: {} - - strip-final-newline@2.0.0: {} - - strip-final-newline@3.0.0: {} - - strip-json-comments@3.1.1: {} - - strtok3@7.0.0: - dependencies: - '@tokenizer/token': 0.3.0 - peek-readable: 5.0.0 + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true - supports-color@5.5.0: + /supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} dependencies: has-flag: 3.0.0 + dev: true - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - supports-color@8.1.1: + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} dependencies: has-flag: 4.0.0 + dev: true - supports-preserve-symlinks-flag@1.0.0: {} + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true - test-exclude@6.0.0: + /synckit@0.9.1: + resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} + engines: {node: ^14.18.0 || >=16.0.0} dependencies: - '@istanbuljs/schema': 0.1.3 - glob: 7.2.3 - minimatch: 3.1.2 - - text-extensions@2.4.0: {} + '@pkgr/core': 0.1.1 + tslib: 2.7.0 + dev: true - text-table@0.2.0: {} + /text-extensions@2.4.0: + resolution: {integrity: sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==} + engines: {node: '>=8'} + dev: true - through@2.3.8: {} + /text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true - tmpl@1.0.5: {} + /through@2.3.8: + resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + dev: true - to-fast-properties@2.0.0: {} + /tinyexec@0.3.0: + resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} + dev: true - to-regex-range@5.0.1: + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 + dev: true - token-types@5.0.1: - dependencies: - '@tokenizer/token': 0.3.0 - ieee754: 1.2.1 - - ts-api-utils@1.3.0(typescript@5.4.5): - dependencies: - typescript: 5.4.5 - - ts-jest@29.1.2(@babel/core@7.24.4)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.4))(jest@29.7.0(@types/node@20.12.7))(typescript@5.4.5): - dependencies: - bs-logger: 0.2.6 - fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.12.7) - jest-util: 29.7.0 - json5: 2.2.3 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.6.0 - typescript: 5.4.5 - yargs-parser: 21.1.1 - optionalDependencies: - '@babel/core': 7.24.4 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.24.4) - - tslib@2.6.2: {} - - type-check@0.4.0: + /ts-api-utils@1.3.0(typescript@5.5.4): + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' dependencies: - prelude-ls: 1.2.1 - - type-detect@4.0.8: {} + typescript: 5.5.4 + dev: true - type-fest@0.20.2: {} + /ts-mixer@6.0.4: + resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} + dev: false - type-fest@0.21.3: {} - - type-fest@2.19.0: {} - - typedoc-github-wiki-theme@1.1.0(typedoc-plugin-markdown@3.17.1(typedoc@0.25.13(typescript@5.4.5)))(typedoc@0.25.13(typescript@5.4.5)): - dependencies: - typedoc: 0.25.13(typescript@5.4.5) - typedoc-plugin-markdown: 3.17.1(typedoc@0.25.13(typescript@5.4.5)) - - typedoc-plugin-extras@3.0.0(typedoc@0.25.13(typescript@5.4.5)): + /ts-patch@3.2.1: + resolution: {integrity: sha512-hlR43v+GUIUy8/ZGFP1DquEqPh7PFKQdDMTAmYt671kCCA6AkDQMoeFaFmZ7ObPLYOmpMgyKUqL1C+coFMf30w==} + hasBin: true dependencies: - typedoc: 0.25.13(typescript@5.4.5) + chalk: 4.1.2 + global-prefix: 3.0.0 + minimist: 1.2.8 + resolve: 1.22.8 + semver: 7.6.3 + strip-ansi: 6.0.1 + dev: true - typedoc-plugin-markdown@3.17.1(typedoc@0.25.13(typescript@5.4.5)): - dependencies: - handlebars: 4.7.8 - typedoc: 0.25.13(typescript@5.4.5) + /tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} - typedoc-plugin-mermaid@1.10.0(typedoc@0.25.13(typescript@5.4.5)): + /tsx@4.19.1: + resolution: {integrity: sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==} + engines: {node: '>=18.0.0'} + hasBin: true dependencies: - html-escaper: 3.0.3 - typedoc: 0.25.13(typescript@5.4.5) + esbuild: 0.23.1 + get-tsconfig: 4.8.1 + optionalDependencies: + fsevents: 2.3.3 + dev: true - typedoc-theme-hierarchy@4.1.2(typedoc@0.25.13(typescript@5.4.5)): + /type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} dependencies: - fs-extra: 11.1.1 - typedoc: 0.25.13(typescript@5.4.5) + prelude-ls: 1.2.1 + dev: true - typedoc@0.25.13(typescript@5.4.5): - dependencies: - lunr: 2.3.9 - marked: 4.3.0 - minimatch: 9.0.4 - shiki: 0.14.7 - typescript: 5.4.5 + /type-fest@2.19.0: + resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} + engines: {node: '>=12.20'} + dev: false - typescript-eslint@7.6.0(eslint@8.57.0)(typescript@5.4.5): + /typescript-eslint@7.18.0(eslint@9.11.0)(typescript@5.5.4): + resolution: {integrity: sha512-PonBkP603E3tt05lDkbOMyaxJjvKqQrXsnow72sVeOFINDE/qNmnnd+f9b4N+U7W6MXnnYyrhtmF2t08QWwUbA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true dependencies: - '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) - eslint: 8.57.0 - optionalDependencies: - typescript: 5.4.5 + '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0)(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/parser': 7.18.0(eslint@9.11.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@9.11.0)(typescript@5.5.4) + eslint: 9.11.0 + typescript: 5.5.4 transitivePeerDependencies: - supports-color + dev: true - typescript-eslint@7.6.0(eslint@9.0.0)(typescript@5.4.5): + /typescript-transform-paths@3.5.1(typescript@5.5.4): + resolution: {integrity: sha512-nq+exuF+38rAby9zrP+S6t0HWuwv69jeFu0I5UwjdoCIDPmnKIAr6a7JfYkbft7h5OzYKEDRhT/jLvvtTvWF4Q==} + peerDependencies: + typescript: '>=3.6.5' dependencies: - '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0(eslint@9.0.0)(typescript@5.4.5))(eslint@9.0.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.6.0(eslint@9.0.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@9.0.0)(typescript@5.4.5) - eslint: 9.0.0 - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - typescript@5.4.5: {} + minimatch: 9.0.5 + typescript: 5.5.4 + dev: true - uglify-js@3.17.4: {} - - undici-types@5.26.5: {} + /typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + engines: {node: '>=14.17'} + hasBin: true + dev: true - undici@5.28.4: - dependencies: - '@fastify/busboy': 2.1.1 + /uglify-js@3.19.3: + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + engines: {node: '>=0.8.0'} + hasBin: true + dev: false - unicorn-magic@0.1.0: {} + /undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - universalify@2.0.1: {} + /undici@6.19.8: + resolution: {integrity: sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==} + engines: {node: '>=18.17'} + dev: false - update-browserslist-db@1.0.13(browserslist@4.23.0): - dependencies: - browserslist: 4.23.0 - escalade: 3.1.2 - picocolors: 1.0.0 + /unicorn-magic@0.1.0: + resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} + engines: {node: '>=18'} + dev: true - uri-js@4.4.1: + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.1 + dev: true - util-deprecate@1.0.2: {} - - v8-to-istanbul@9.2.0: - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - '@types/istanbul-lib-coverage': 2.0.6 - convert-source-map: 2.0.0 - - vscode-oniguruma@1.7.0: {} - - vscode-textmate@8.0.0: {} - - walker@1.0.8: + /which@1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true dependencies: - makeerror: 1.0.12 + isexe: 2.0.0 + dev: true - which@2.0.2: + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true dependencies: isexe: 2.0.0 + dev: true - widest-line@4.0.1: + /widest-line@4.0.1: + resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==} + engines: {node: '>=12'} dependencies: string-width: 5.1.2 + dev: false - wordwrap@1.0.0: {} + /word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + dev: true - wrap-ansi@7.0.0: + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + dev: true - wrap-ansi@8.1.0: + /wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} dependencies: ansi-styles: 6.2.1 string-width: 5.1.2 strip-ansi: 7.1.0 - wrappy@1.0.2: {} - - write-file-atomic@4.0.2: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 3.0.7 - - ws@8.17.0: {} - - y18n@5.0.8: {} - - yallist@3.1.1: {} + /ws@8.18.0: + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false - yallist@4.0.0: {} + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true - yargs-parser@21.1.1: {} + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true - yargs@17.7.2: + /yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} dependencies: cliui: 8.0.1 - escalade: 3.1.2 + escalade: 3.2.0 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 + dev: true - yocto-queue@0.1.0: {} - - yocto-queue@1.0.0: {} + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true - zeneth@0.0.1: - dependencies: - '@akarui/structures': 2.1.0 - file-type: 18.7.0 - ws: 8.17.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate + /yocto-queue@1.1.1: + resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} + engines: {node: '>=12.20'} + dev: true diff --git a/tools/aoijs-tooling/getFunctionData.mjs b/tools/aoijs-tooling/getFunctionData.mjs new file mode 100644 index 000000000..07c664c5c --- /dev/null +++ b/tools/aoijs-tooling/getFunctionData.mjs @@ -0,0 +1,79 @@ +import fs from 'fs'; +import path from 'path'; + +/** + * Extract metadata from aoijs' function TypeScript file + * @param {string} filePath - The path to the TypeScript file + * @returns {object} - The extracted metadata + */ +function extractMetadata(filePath) { + // Read the TypeScript file + const tsFileContent = fs.readFileSync(filePath, 'utf-8'); + + // Extract metadata using regular expressions + const metadata = {}; + + // Extract function name + const nameMatch = /\.setName\(['"`](.*?)['"`]\)/.exec(tsFileContent); + if (nameMatch) metadata.name = nameMatch[1]; + + // Extract brackets + const bracketsMatch = /\.setBrackets\((.*?)\)/.exec(tsFileContent); + if (bracketsMatch) metadata.brackets = bracketsMatch[1] === 'true'; + + // Extract optional + const optionalMatch = /\.setOptional\((.*?)\)/.exec(tsFileContent); + if (optionalMatch) metadata.optional = optionalMatch[1] === 'true'; + + // Extract function type + const typeMatch = /\.setType\((.*?)\)/.exec(tsFileContent); + if (typeMatch) metadata.type = typeMatch[1].replace('FunctionType.', ''); + + // Extract fields + const fieldsMatch = /\.setFields\((.*?)\)/s.exec(tsFileContent); + if (fieldsMatch) { + const fields = fieldsMatch[1].split('],').map((field) => { + const fieldData = field.replace(/[\[\]']/g, '').split(','); + const name = fieldData + .find((data) => data.includes('name:')) + .split(':')[1] + .trim(); + const description = fieldData + .find((data) => data.includes('description:')) + .split(':')[1] + .trim(); + const type = fieldData + .find((data) => data.includes('type:')) + .split(':')[1] + .split('.')[1] + .trim(); + const required = + fieldData + .find((data) => data.includes('required:')) + .split(':')[1] + .trim() === 'true'; + + return { + name, + description, + type, + required, + }; + }); + metadata.fields = fields; + } + + // Extract return type + const returnTypeMatch = /\.setReturns\((.*?)\)/.exec(tsFileContent); + if (returnTypeMatch) + metadata.returns = returnTypeMatch[1].replace('ReturnType.', ''); + + return metadata; +} + +// Usage example +const filePath = path.join( + process.cwd() + '/lib/aoi.js/src/functions/js/conditions/$and.ts', +); +const metadata = extractMetadata(filePath); +console.log(metadata); diff --git a/tools/testing/testReporter.mjs b/tools/testing/testReporter.mjs new file mode 100644 index 000000000..d02927412 --- /dev/null +++ b/tools/testing/testReporter.mjs @@ -0,0 +1,152 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/no-unsafe-argument */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import { Transform } from 'node:stream'; +import chalk from 'chalk'; +import ora from 'ora'; +import cliSpinners from 'cli-spinners'; +import boxen from 'boxen'; + +const groups = {}; +let parent = ''; + +const spinner = ora({ + spinner: cliSpinners.arc, + text: 'Running tests...', +}).start(); +let output = ''; + +const customReporter = new Transform({ + writableObjectMode: true, + transform(event, _encoding, callback) { + try { + + + if (event.type === 'test:start') { + if (event.data.nesting === 0) { + groups[event.data.name] = { + start: performance.now(), + end: null, + subtests: {}, + status: 'running', + }; + parent = event.data.name; + } else { + groups[parent].subtests[event.data.name] = { + start: performance.now(), + end: null, + status: 'running', + }; + } + } + + switch (event.type) { + case 'test:enqueue': + // output = chalk.blue( + // `${kaomojiIcons.enqueue} Test enqueued: ${event.data.name}`, + // ); + break; + case 'test:dequeue': + // output = chalk.yellow( + // `${kaomojiIcons.dequeue} Test dequeued: ${event.data.name}`, + // ); + break; + case 'test:start': + // group[parent] = true; + break; + case 'test:pass': + if (event.data.nesting === 0) { + groups[event.data.name].end = performance.now(); + groups[event.data.name].status = 'passed'; + } else { + groups[parent].subtests[event.data.name].end = + performance.now(); + groups[parent].subtests[event.data.name].status = + 'passed'; + } + + break; + case 'test:fail': + if (event.data.nesting === 0) { + groups[event.data.name].end = performance.now(); + groups[event.data.name].status = 'failed'; + } else { + groups[parent].subtests[event.data.name].end = + performance.now(); + groups[parent].subtests[event.data.name].status = + 'failed'; + } + + break; + case 'test:plan': + // output = chalk.magenta('Test plan executed'); + break; + case 'test:watch:drained': + break; + case 'test:coverage': { + break; + } + + case 'test:diagnostic': + case 'test:stderr': + case 'test:stdout': + output += chalk.gray(event.data.message) + '\n'; + break; + default: { + throw new Error('default case'); + } + } + + if (output) { + // this.push(`${output}\n`); + if (output.includes('duration')) { + // loop through groups and print them in boxen subtests are padded left more to give tree structure + let boxoutput = '\n'; + Object.keys(groups).forEach((group) => { + const { start, end, status, subtests } = groups[group]; + const duration = (end - start).toFixed(2); + let subtestoutput = ''; + Object.keys(subtests).forEach((subtest) => { + const { start, end, status } = subtests[subtest]; + const duration = (end - start).toFixed(2); + subtestoutput += `${status === 'passed' ? chalk.green('✔') : chalk.red('✘')} ${subtest} (${duration}ms)\n`; + }); + boxoutput += boxen(`${subtestoutput}`, { + padding: { left: 2, right: 8 }, + title: `${status === 'passed' ? chalk.green('✔') : chalk.red('✘')} ${group} (${duration}ms)`, + }); + boxoutput += '\n'; + }); + + this.push(boxoutput); + this.push('\n'); + this.push(output + '\n'); + + setTimeout(() => { + spinner.stopAndPersist({ + symbol: '★', + text: chalk.green('All tests complete!'), + }); + + process.exit(0); + }, 10); + } + } + + // Stop spinner when all tests are done + if (event.type === 'test:watch:drained') { + spinner.stopAndPersist({ + symbol: '★', + text: chalk.green('All tests complete!'), + }); + } + + callback(); + } catch (error) { + console.error(error); + process.exit(1); + } + }, +}); + +export default customReporter; diff --git a/tools/testing/testRunner.mjs b/tools/testing/testRunner.mjs new file mode 100644 index 000000000..0e2d819b2 --- /dev/null +++ b/tools/testing/testRunner.mjs @@ -0,0 +1,32 @@ +import { run } from 'node:test'; +import process from 'node:process'; +import customReporter from './testReporter.mjs'; +import * as glob from 'glob'; + +const argvs = process.argv.slice(3); + +const flags = argvs.reduce((acc, arg) => { + const [key, value] = arg.split('='); + acc[key.replace('--', '')] = value; + return acc; +}, {}); + +// recursively go through src folder and find all test files +let globBase = './src'; +if (flags.folder) { + globBase += `/${flags.folder}`; +} + +let reporter = customReporter; + +const files = glob.sync(`${globBase}/**/*.test.ts`); + +const testStream = run({ + files, + timeout: 60 * 1000, + concurrency: true, + forceExit: true, +}); + +// eslint-disable-next-line @typescript-eslint/no-unsafe-call +testStream.compose(reporter).pipe(process.stdout); diff --git a/tsconfig.json b/tsconfig.json index a27bd1937..ae512109b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -55,7 +55,7 @@ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, // "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + "sourceMap": true, /* Create source map files for emitted JavaScript files. */ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ "outDir": "./dist" /* Specify an output folder for all emitted files. */, @@ -107,7 +107,12 @@ /* Completeness */ "skipDefaultLibCheck": true /* Skip type checking .d.ts files that are included with TypeScript. */, - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "skipLibCheck": true, /* Skip type checking all .d.ts files. */ + "plugins": [ + { "transform": "typescript-transform-paths" }, + { "transform": "typescript-transform-paths", "afterDeclarations": true }, + ], + "declarationMap": true, }, "references": [ { "path": "./lib/aoi.js/" },