From 0c9e224ac993cfd604d6ff98f558bf2a34ef8601 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Tue, 21 Feb 2023 22:19:45 -0300 Subject: [PATCH 1/3] init monorepo --- .devcontainer/Dockerfile | 11 - .devcontainer/devcontainer.json | 49 - .github/{dependabot.yml => dependabot.yaml} | 2 +- .github/spigotBuilld/index.mjs | 29 - .github/uploadphp/index.mjs | 24 - .github/workflows/code_analyzer.yml | 43 - .github/workflows/gendocs.yaml | 43 - .github/workflows/php_buid.yml | 221 --- .github/workflows/publish.yml | 69 - .github/workflows/spigotBuild.yaml | 116 -- .github/workflows/{test.yml => test.yaml} | 20 +- .gitignore | 19 +- .gitpod.yml | 19 - .hintrc | 8 - .mocharc.yml | 11 - .npmignore | 2 - .vscode/extensions.json | 22 - .vscode/launch.json | 34 - .vscode/settings.json | 6 +- CODE_OF_CONDUCT.md | 128 -- CONTRIBUTING.md | 8 - LICENSE | 5 +- README.md | 12 - configs/bedrock/server.properties | 135 -- configs/java/server.properties | 57 - package-lock.json | 1338 +++-------------- package.json | 58 +- package/cli/package.json | 18 + package/cli/src/index.ts | 39 + package/cli/tsconfig.json | 31 + package/core/README.md | 5 + package/core/package.json | 26 + .../core/src}/childPromisses.ts | 0 package/core/src/index.ts | 12 + .../remote.ts => package/core/src/internal.ts | 5 +- package/core/src/serverManeger.ts | 121 ++ package/core/src/servers/bedrock.ts | 206 +++ package/core/src/servers/java.ts | 9 + package/core/tsconfig.json | 27 + package/docker/package.json | 17 + package/docker/tsconfig.json | 31 + src/index.ts | 3 - src/lib/Proprieties.ts | 43 - src/lib/proxy.ts | 86 -- src/lib/randomPort.ts | 11 - src/platform/Bedrock.ts | 252 ---- src/platform/Java.ts | 16 - src/serverManeger.ts | 216 --- tsconfig.json | 13 +- 49 files changed, 791 insertions(+), 2885 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/devcontainer.json rename .github/{dependabot.yml => dependabot.yaml} (90%) delete mode 100644 .github/spigotBuilld/index.mjs delete mode 100644 .github/uploadphp/index.mjs delete mode 100644 .github/workflows/code_analyzer.yml delete mode 100644 .github/workflows/gendocs.yaml delete mode 100644 .github/workflows/php_buid.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/spigotBuild.yaml rename .github/workflows/{test.yml => test.yaml} (66%) delete mode 100644 .gitpod.yml delete mode 100644 .hintrc delete mode 100644 .mocharc.yml delete mode 100644 .npmignore delete mode 100644 .vscode/extensions.json delete mode 100644 .vscode/launch.json delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 README.md delete mode 100644 configs/bedrock/server.properties delete mode 100644 configs/java/server.properties create mode 100644 package/cli/package.json create mode 100644 package/cli/src/index.ts create mode 100644 package/cli/tsconfig.json create mode 100644 package/core/README.md create mode 100644 package/core/package.json rename {src/lib => package/core/src}/childPromisses.ts (100%) create mode 100644 package/core/src/index.ts rename src/lib/remote.ts => package/core/src/internal.ts (58%) create mode 100644 package/core/src/serverManeger.ts create mode 100644 package/core/src/servers/bedrock.ts create mode 100644 package/core/src/servers/java.ts create mode 100644 package/core/tsconfig.json create mode 100644 package/docker/package.json create mode 100644 package/docker/tsconfig.json delete mode 100644 src/index.ts delete mode 100644 src/lib/Proprieties.ts delete mode 100644 src/lib/proxy.ts delete mode 100644 src/lib/randomPort.ts delete mode 100644 src/platform/Bedrock.ts delete mode 100644 src/platform/Java.ts delete mode 100644 src/serverManeger.ts diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index a602098..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ghcr.io/sirherobrine23/initjs:latest -# Install dependecies to Bedrock server -RUN (apt update && apt install -y libssl1.1 || (echo "deb http://security.ubuntu.com/ubuntu focal-security main" | tee /etc/apt/sources.list.d/focal-security.list && apt update && apt install -y libssl1.1)) || echo exit $? - -# Add non root user and Install oh my zsh -ARG USERNAME="devcontainer" -ARG USER_UID="1000" -ARG USER_GID=$USER_UID -RUN initjs create-user --username "${USERNAME}" --uid "${USER_UID}" --gid "${USER_GID}" --groups sudo --groups docker -USER $USERNAME -WORKDIR /home/$USERNAME diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 1f750ae..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "Bds Maneger Core", - "updateRemoteUserUID": false, - "containerUser": "develop", - "remoteUser": "develop", - "overrideCommand": false, - "postCreateCommand": "npm install", - "build": { - "dockerfile": "Dockerfile", - "args": { - "USERNAME": "develop", - "USER_UID": "1000" - } - }, - "runArgs": [ - "--init", - "--privileged" - ], - "mounts": [ - "target=/var/lib/docker,type=volume,source=bdsmanegercore" - ], - "extensions": [ - "benshabatnoam.google-translate-ext", - "eamodio.gitlens", - "github.vscode-pull-request-github", - "visualstudioexptteam.vscodeintellicode", - "redhat.vscode-yaml", - "ms-vscode-remote.remote-containers", - "wix.vscode-import-cost", - "eg2.vscode-npm-script", - "christian-kohler.npm-intellisense", - "christian-kohler.path-intellisense", - "aaron-bond.better-comments", - "vscode-icons-team.vscode-icons", - "me-dutour-mathieu.vscode-github-actions", - "cschleiden.vscode-github-actions", - "oderwat.indent-rainbow", - "ms-azuretools.vscode-docker", - "formulahendry.code-runner", - "chrmarti.regex" - ], - "settings": { - "editor.tabSize": 2, - "editor.minimap.enabled": false, - "files.eol": "\n", - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true - } -} diff --git a/.github/dependabot.yml b/.github/dependabot.yaml similarity index 90% rename from .github/dependabot.yml rename to .github/dependabot.yaml index 656d9ef..7a26096 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yaml @@ -10,4 +10,4 @@ updates: schedule: interval: monthly assignees: - - Sirherobrine23 + - Sirherobrine23 \ No newline at end of file diff --git a/.github/spigotBuilld/index.mjs b/.github/spigotBuilld/index.mjs deleted file mode 100644 index caaae01..0000000 --- a/.github/spigotBuilld/index.mjs +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node -import { createReadStream, promises as fs } from "node:fs"; -import { Cloud, Extends } from "@sirherobrine23/coreutils"; -import path from "path"; -const { tenancy, fingerprint, privateKey, user, passphase } = process.env; -const oracleBucket = await Cloud.oracleBucket({ - region: "sa-saopaulo-1", - name: "bdsFiles", - namespace: "grwodtg32n4d", - auth: { - type: "user", - tenancy, - fingerprint, - privateKey, - user, - passphase - } -}) -const __dirname = path.resolve(process.cwd(), process.argv.slice(2)[0]||""); - -await Extends.extendsFS.readdir({folderPath: __dirname}).then(files => files.filter(file => file.endsWith(".jar"))).then(async files => { - for (const file of files) { - const version = path.basename(file, ".jar").split("-")[1]; - if (!version) continue; - console.log("Uploading %s, file: %O", version, "SpigotBuild/"+version+".jar"); - await oracleBucket.uploadFile("SpigotBuild/"+version+".jar", createReadStream(file)).then(() => console.log("Uploaded %s", version)); - await fs.unlink(file); - } -}); \ No newline at end of file diff --git a/.github/uploadphp/index.mjs b/.github/uploadphp/index.mjs deleted file mode 100644 index b88beab..0000000 --- a/.github/uploadphp/index.mjs +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env node -import { createReadStream } from "node:fs"; -import coreutils, { extendFs } from "@sirherobrine23/coreutils"; -import path from "node:path"; -import fs from "node:fs/promises"; -if (!process.env.OCI_AUTHKEY) throw new Error("No key auth"); -const ociKeyAuth = (process.env.OCI_AUTHKEY||"").trim(); -console.log("using key to upload '%s'", ociKeyAuth); - -const files = (await extendFs.readdir({folderPath: path.join(process.cwd(), "phpOutput")})).filter(file => file.endsWith(".tar.gz")||file.endsWith(".zip")||file.endsWith(".tgz")); -await Promise.all(files.map(async file => { - const fileName = path.basename(file); - console.log("Uploading %s", fileName); - await coreutils.httpRequest.bufferFetch({ - url: `https://objectstorage.sa-saopaulo-1.oraclecloud.com/p/${ociKeyAuth}/n/grwodtg32n4d/b/bdsFiles/o/php_bin/${encodeURIComponent(fileName.toLowerCase())}`, - method: "PUT", - body: createReadStream(file), - headers: { - "Content-Length": (await fs.lstat(file)).size.toString(), - "Content-Type": "application/octet-stream" - } - }); - console.log("Upload success to %s", fileName); -})); \ No newline at end of file diff --git a/.github/workflows/code_analyzer.yml b/.github/workflows/code_analyzer.yml deleted file mode 100644 index 247c7eb..0000000 --- a/.github/workflows/code_analyzer.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Code Analyze -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - - cron: "26 8 * * 1" - -jobs: - snyk: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Run Snyk to check for vulnerabilities - uses: snyk/actions/node@master - continue-on-error: true - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - with: - args: --sarif-file-output=snyk.sarif - - name: Upload result to GitHub Code Scanning - continue-on-error: true - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: snyk.sarif - - codeql: - name: CodeQL Analyze - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: javascript - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/.github/workflows/gendocs.yaml b/.github/workflows/gendocs.yaml deleted file mode 100644 index 4b8ba89..0000000 --- a/.github/workflows/gendocs.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Deploy bds core wiki -on: - push: - branches: - - main - paths: - - "src/**/*" - - "tests/**/*" - - "package*.json" - -permissions: - contents: read - pages: write - id-token: write - -jobs: - deploy_doc: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3.6.0 - name: Setup node.js - with: - node-version: latest - - - run: npm ci - - - name: Gen docs - run: npm run docs - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: "docs" - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.github/workflows/php_buid.yml b/.github/workflows/php_buid.yml deleted file mode 100644 index 39cd7ac..0000000 --- a/.github/workflows/php_buid.yml +++ /dev/null @@ -1,221 +0,0 @@ -name: PHP build -on: - workflow_dispatch: - schedule: - - cron: "0 0 */2 * 0" - -jobs: - # Android Build arm64 - android: - runs-on: ubuntu-latest - name: Android - steps: - - name: Clone Repository - uses: actions/checkout@v3 - with: - repository: pmmp/php-build-scripts - submodules: true - - - name: Cache musl - uses: actions/cache@v3 - with: - key: ${{ runner.os }}-android_musl - path: muslCrossMake - - - name: Build musl to android - env: - DEBIAN_FRONTEND: "noninteractive" - run: | - set -ex - sudo apt update - sudo apt -y install build-essential curl make autoconf automake libtool m4 wget gzip bzip2 bison g++ git cmake pkg-config re2c libtool* unzip zip tar - - # Build musl - if ! [[ -d muslCrossMake ]];then - mkdir muslCrossMake - INITIAL_PATH="$(pwd)" - cd muslCrossMake - git clone https://github.com/pmmp/musl-cross-make.git ./ - (echo "TARGET = aarch64-linux-musl"; echo "OUTPUT = /usr/local") > config.mak - make - sudo make install -j$(nproc) - else - cd muslCrossMake - sudo make install -j$(nproc) - fi - - - name: "Building php bin" - continue-on-error: true - timeout-minutes: 40 - run: | - ./compile.sh -t android-aarch64 -x -f -g -j$(nproc) - # Compress files - cd bin/php*/ - pwd - # ZIP - zip -r "${{ github.workspace }}/android_arm64.zip" * - # tar - tar -czf "${{ github.workspace }}/android_arm64.tar.gz" * - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: android_arm64 - path: "*.tar.gz" - - # Linux Build - linux: - strategy: - fail-fast: false - matrix: - target: - - ubuntu-latest - - arm64 - name: "Linux - ${{ matrix.target }}" - runs-on: ${{ matrix.target }} - steps: - - name: Clone Repository - uses: actions/checkout@v3 - with: - repository: pmmp/php-build-scripts - submodules: true - - - name: Install tools and dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake pkg-config make autoconf automake libtool libtool-bin m4 wget libc-bin gzip bzip2 bison g++ git re2c zip tar - - - name: Compile PHP - continue-on-error: true - timeout-minutes: 40 - run: | - set -ex - ./compile.sh -j 4 -f -g -s - - # Compress files - cd bin/php*/ - pwd - # ZIP - zip -r "${{ github.workspace }}/linux_${{ runner.arch }}.zip" * - # tar - tar -czf "${{ github.workspace }}/linux_${{ runner.arch }}.tar.gz" * - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: linux_${{ runner.arch }} - path: | - *.tar.gz - *.zip - - # MacOS Build - macos: - runs-on: macos-11 - name: MacOS - steps: - - name: Clone Repository - uses: actions/checkout@v3 - with: - repository: pmmp/php-build-scripts - submodules: true - - - name: Install dependecies - run: brew install libtool autoconf automake pkg-config bison re2c - - - name: "Building php" - continue-on-error: true - timeout-minutes: 40 - run: | - export PATH="/usr/local/opt/bison/bin:$PATH" - set -ex - trap "exit 1" ERR - ./compile.sh -j4 -f -g || (cat *.log && exit 1) - - - name: Create tarballs - run: | - cd bin/*/ - pwd - # ZIP - zip -r "${{ github.workspace }}/darwin_${{ runner.arch }}.zip" * - # tar - tar -czf "${{ github.workspace }}/darwin_${{ runner.arch }}.tar.gz" * - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: darwin_${{ runner.arch }} - path: | - *.tar.gz - *.zip - - # Windows build - win32: - runs-on: windows-2019 - name: Windows - steps: - - name: Clone Repository - uses: actions/checkout@v3 - with: - repository: pmmp/php-build-scripts - submodules: true - - - name: Windows Depencies Install - run: choco install --no-progress wget - - - name: "Building php bin" - run: .\windows-compile-vs.bat - env: - VS_EDITION: Enterprise - SOURCES_PATH: ${{ github.workspace }}\pocketmine-php-sdk - - - name: show log - run: type compile.log - - - name: Rename files - shell: node {0} - run: | - const fs = require("fs"); - const path = require("path"); - const files = fs.readdirSync(process.cwd()).filter(file => file.endsWith(".zip")); - for (const zip of files) { - console.log("File:", path.join(process.cwd(), zip)); - if (/debug/i.test(zip)) fs.rmSync(path.join(process.cwd(), zip)); - else fs.renameSync(path.join(process.cwd(), zip), path.join(process.cwd(), "win32_x64.zip")); - } - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: Windows - path: "*.zip" - - # Upload to bucket - upload: - runs-on: ubuntu-latest - needs: - - win32 - - macos - - linux - - android - steps: - - uses: actions/checkout@v3 - name: Code checkout - - - uses: actions/setup-node@v3.6.0 - name: Setup node.js - with: - node-version: latest - - - name: Install node depencies - run: npm install --no-save - - - name: Download tarbals - uses: actions/download-artifact@v3 - with: - path: ./phpOutput - - - name: Upload to bucket - run: node .github/uploadphp/index.mjs - timeout-minutes: 25 - env: - OCI_AUTHKEY: ${{ secrets.OCI_AUTHKEY }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 6da017f..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Publish package -on: - release: - types: - - prereleased - - released - -permissions: - pull-requests: write - id-token: write - -jobs: - publishpackage: - runs-on: ubuntu-latest - name: Publish - steps: - - uses: actions/checkout@v3 - name: Code checkout - with: - persist-credentials: true - ref: main - fetch-depth: 2 - submodules: true - - # Install basic tools - - uses: actions/setup-node@v3.6.0 - name: Setup node.js - with: - registry-url: https://registry.npmjs.org/ - node-version: latest - - - name: Edit version - shell: node {0} - run: | - const fs = require("fs"); - const path = require("path"); - const packagePath = path.join(process.cwd(), "package.json"); - const package = JSON.parse(fs.readFileSync(packagePath, "utf8")); - package.version = "${{ github.ref }}"; - package.version = package.version.replace(/[A-Za-z_\/]+/, ""); - fs.writeFileSync(packagePath, JSON.stringify(package, null, 2)); - - # Install depencides and build - - run: npm ci && npm run build - - # Publish - - run: npm publish --tag ${{ github.event.release.prerelease && 'next' || 'latest' }} - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_ORG_TOKEN }} - - # Add version to environment variables - - name: Add version to environment variables - run: | - cat package.json | jq -r '.version' > /tmp/version.txt - echo "PACKAGE_VERSION=$(cat /tmp/version.txt)" >> $GITHUB_ENV - - # Create pull request to update version in main branch - - uses: peter-evans/create-pull-request@v4 - name: Create Pull Request - continue-on-error: true - with: - commit-message: Update version v${{ env.PACKAGE_VERSION }} - delete-branch: true - assignees: SirHerobrine23 - reviewers: SirHerobrine23 - branch: update-version - title: Update package version v${{ env.PACKAGE_VERSION }} - body: Auto update package version, created with GitHub Actions diff --git a/.github/workflows/spigotBuild.yaml b/.github/workflows/spigotBuild.yaml deleted file mode 100644 index 7aa2009..0000000 --- a/.github/workflows/spigotBuild.yaml +++ /dev/null @@ -1,116 +0,0 @@ -name: Spigot Build -on: - workflow_dispatch: - schedule: - - cron: "0 0 */2 * 0" - push: - branches: - - main - paths: - - ".github/workflows/spigotBuild.yaml" - - ".github/spigotBuilld/**/*" - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: - - latest - - "1.19.2" - - "1.19.1" - - "1.19" - - "1.18.2" - - "1.18.1" - - "1.18-rc3" - - "1.18-pre8" - - "1.18-pre5" - - "1.18" - - "1.17.1" - - "1.17" - - "1.16.5" - - "1.16.4" - - "1.16.3" - - "1.16.2" - - "1.16.1" - - "1.15.2" - - "1.15.1" - - "1.15" - - "1.14.4" - - "1.14.3-pre4" - - "1.14.3" - - "1.14.2" - - "1.14.1" - - "1.14-pre5" - - "1.14" - - "1.13.2" - - "1.13.1" - - "1.13-pre7" - - "1.13" - - "1.12.2" - - "1.12.1" - - "1.12" - - "1.11.2" - - "1.11.1" - - "1.11" - - "1.10.2" - - "1.10" - - "1.9.4" - - "1.9.2" - - "1.9" - - "1.8.8" - - "1.8.7" - - "1.8.6" - - "1.8.5" - - "1.8.4" - - "1.8.3" - - "1.8" - steps: - - name: Install ${{ startsWith(matrix.version, 'latest') && '19' || (startsWith(matrix.version, '1.19')||startsWith(matrix.version, '1.18')) && '17' || startsWith(matrix.version, '1.17') && '16' || '8' }} java - uses: actions/setup-java@v3 - continue-on-error: true - with: - distribution: liberica - java-version: ${{ (startsWith(matrix.version, 'latest')||startsWith(matrix.version, '1.19')||startsWith(matrix.version, '1.18')) && '17' || startsWith(matrix.version, '1.17') && '16' || '8' }} - - - name: Build - continue-on-error: true - run: | - wget -qO build.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar - java -jar build.jar --rev "${{ matrix.version || 'latest' }}" - - - name: Upload to actifial - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.version || 'latest' }} - path: "*.jar" - - # Upload - upload: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v3 - name: Code checkout - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: latest - - - name: Install node depencies - run: npm install --no-save - - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts - - - name: Upload to actifial - run: node .github/spigotBuilld/index.mjs artifacts - env: - tenancy: ${{ secrets.OCI_TENANCY }} - fingerprint: ${{ secrets.OCI_FING }} - privateKey: ${{ secrets.OCI_PRIV }} - user: ${{ secrets.OCI_USER }} - passphase: ${{ secrets.OCI_PASSPHASE || '' }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yaml similarity index 66% rename from .github/workflows/test.yml rename to .github/workflows/test.yaml index 07be96b..d0d77cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yaml @@ -1,23 +1,13 @@ - name: Test on: push: - branches: - - main - paths: - - "src/**/*" - - "tests/**/*" - - "package*.json" - pull_request: - branches: - - main jobs: test: runs-on: ubuntu-latest name: "Test" env: - BDS_HOME: "~/.bdsCore" + bdscoreroot: "~/.bdsCore" steps: - uses: actions/checkout@v3 name: Code checkout @@ -36,8 +26,8 @@ jobs: # Install dependecies - name: Install nodejs dependencies - run: npm ci + run: npm install --no-save - # Run test - - name: Test - run: npm run test + # Build Core + - name: Core Build + run: cd package/core && npm run build \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1e4d5df..251e766 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,6 @@ -/*.log +# Node node_modules/ -dist/ -src/**/*.d.ts -src/**/*.d.js -src/**/*.js -docs/ -# PHP Bins -muslCrossMake/ -phpOutput/ -*.tar.gz -*.tgz -*.zip - -# Spigot -*.jar \ No newline at end of file +# Typescript +packages/**/*.js +packages/**/*.d.ts \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 7e122d4..0000000 --- a/.gitpod.yml +++ /dev/null @@ -1,19 +0,0 @@ -image: - file: .devcontainer/Dockerfile -tasks: - - init: npm install -vscode: - extensions: - - formulahendry.code-runner - - github.vscode-pull-request-github - - redhat.vscode-yaml - - eamodio.gitlens - - wix.vscode-import-cost - - eg2.vscode-npm-script - - christian-kohler.npm-intellisense - - christian-kohler.path-intellisense - - aaron-bond.better-comments - - vscode-icons-team.vscode-icons - - cschleiden.vscode-github-actions - - oderwat.indent-rainbow - - ms-azuretools.vscode-docker diff --git a/.hintrc b/.hintrc deleted file mode 100644 index 12c4655..0000000 --- a/.hintrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": [ - "development" - ], - "hints": { - "typescript-config/strict": "off" - } -} \ No newline at end of file diff --git a/.mocharc.yml b/.mocharc.yml deleted file mode 100644 index 34b4006..0000000 --- a/.mocharc.yml +++ /dev/null @@ -1,11 +0,0 @@ -exit: true -colors: true -full-trace: true -recursive: true -parallel: true -timeout: 0 -node-option: - - "experimental-specifier-resolution=node" - - "loader=ts-node/esm" -extension: - - "test.ts" \ No newline at end of file diff --git a/.npmignore b/.npmignore deleted file mode 100644 index f21dac1..0000000 --- a/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -!dist/ -backup_*.zip \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 07a01ad..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "recommendations": [ - "formulahendry.code-runner", - "chrmarti.regex", - "benshabatnoam.google-translate-ext", - "eamodio.gitlens", - "github.vscode-pull-request-github", - "visualstudioexptteam.vscodeintellicode", - "redhat.vscode-yaml", - "ms-vscode-remote.remote-containers", - "wix.vscode-import-cost", - "eg2.vscode-npm-script", - "christian-kohler.npm-intellisense", - "christian-kohler.path-intellisense", - "aaron-bond.better-comments", - "vscode-icons-team.vscode-icons", - "me-dutour-mathieu.vscode-github-actions", - "cschleiden.vscode-github-actions", - "oderwat.indent-rainbow", - "ms-azuretools.vscode-docker" - ] -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index b2ff62a..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "name": "Current file", - "internalConsoleOptions": "openOnSessionStart", - "request": "launch", - "env": { - "BDSD_IGNORE_KEY": "1", - "PORT": "3000" - }, - "args": [ - "-r", "ts-node/register", - "${file}" - ], - }, - { - "type": "node", - "name": "Mocha Tests", - "program": "${workspaceFolder}/node_modules/mocha/bin/mocha.js", - "internalConsoleOptions": "openOnSessionStart", - "request": "launch", - "skipFiles": [ - "/**" - ], - "args": [ - "-r", "ts-node/register", - "--colors", - "${workspaceFolder}/tests/**/*.ts" - ], - }, - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 9739557..0bc8c7b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,9 +8,7 @@ "files.trimTrailingWhitespace": true, "files.exclude": { "**/node_modules/": true, - // Ignore generate tsc files - "**/dist/": true, - "**/src/**/*.js": false, - "**/src/**/*.d.ts": false, + "**/src/**/*.js": true, + "**/src/**/*.d.ts": true, } } \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index f0dca73..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,128 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -Email or Github issues. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 33f28a9..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,8 +0,0 @@ -# Contributing to the core - -We hope to have multiple platforms supported by the project, as I want to bring together multiple servers to be managed in one place. - -Any new platform will have to fork the repository or open an issue to request the new platform. - -1. not all servers can be added because of project licensing but we can talk to the maintainers if needed. -2. This project is designed to run on various operating systems such as Android, Linux, Windows and MacOS (other systems can be added to be supported). diff --git a/LICENSE b/LICENSE index 53d1f3d..49bdab5 100644 --- a/LICENSE +++ b/LICENSE @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) + Copyright (C) 2023 Matheus Sampaio Queiroga This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Copyright (C) + Copyright (C) 2023 Matheus Sampaio Queiroga This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -672,4 +672,3 @@ may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . - diff --git a/README.md b/README.md deleted file mode 100644 index 1f44509..0000000 --- a/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Bds Maneger Core - -A quick way to install, update and start your Minecraft Java and Bedrock server. - -## Current Bds core support servers - -1. `Bedrock` (Mojang) -2. `Java` (Mojang) -3. `Pocketmine` (PMMP - Minecraft bedrock server writed in PHP) -4. `Spigot` (Spigot-MC is Minecraft java server to add plugins and more to server) -5. `Powernukkit` (Minecraft Bedrock Server in java) -6. `Paper` (PaperMC is Minecraft java server with plugins and mods) diff --git a/configs/bedrock/server.properties b/configs/bedrock/server.properties deleted file mode 100644 index 4eaaa4a..0000000 --- a/configs/bedrock/server.properties +++ /dev/null @@ -1,135 +0,0 @@ -server-name=Dedicated Server -# Used as the server name -# Allowed values: Any string without semicolon symbol. - -gamemode=survival -# Sets the game mode for new players. -# Allowed values: "survival", "creative", or "adventure" - -force-gamemode=false -# force-gamemode=false (or force-gamemode is not defined in the server.properties) -# prevents the server from sending to the client gamemode values other -# than the gamemode value saved by the server during world creation -# even if those values are set in server.properties after world creation. -# -# force-gamemode=true forces the server to send to the client gamemode values -# other than the gamemode value saved by the server during world creation -# if those values are set in server.properties after world creation. - -difficulty=easy -# Sets the difficulty of the world. -# Allowed values: "peaceful", "easy", "normal", or "hard" - -allow-cheats=false -# If true then cheats like commands can be used. -# Allowed values: "true" or "false" - -max-players=10 -# The maximum number of players that can play on the server. -# Allowed values: Any positive integer - -online-mode=true -# If true then all connected players must be authenticated to Xbox Live. -# Clients connecting to remote (non-LAN) servers will always require Xbox Live authentication regardless of this setting. -# If the server accepts connections from the Internet, then it's highly recommended to enable online-mode. -# Allowed values: "true" or "false" - -allow-list=false -# If true then all connected players must be listed in the separate allowlist.json file. -# Allowed values: "true" or "false" - -server-port=34215 -# Which IPv4 port the server should listen to. -# Allowed values: Integers in the range [1, 65535] - -server-portv6=33657 -# Which IPv6 port the server should listen to. -# Allowed values: Integers in the range [1, 65535] - -view-distance=32 -# The maximum allowed view distance in number of chunks. -# Allowed values: Positive integer equal to 5 or greater. - -tick-distance=4 -# The world will be ticked this many chunks away from any player. -# Allowed values: Integers in the range [4, 12] - -player-idle-timeout=30 -# After a player has idled for this many minutes they will be kicked. If set to 0 then players can idle indefinitely. -# Allowed values: Any non-negative integer. - -max-threads=8 -# Maximum number of threads the server will try to use. If set to 0 or removed then it will use as many as possible. -# Allowed values: Any positive integer. - -level-name=Bedrock level -# Allowed values: Any string without semicolon symbol or symbols illegal for file name: /\n\r\t\f`?*\\<>|\": - -level-seed= -# Use to randomize the world -# Allowed values: Any string - -default-player-permission-level=member -# Permission level for new players joining for the first time. -# Allowed values: "visitor", "member", "operator" - -texturepack-required=false -# Force clients to use texture packs in the current world -# Allowed values: "true" or "false" - -content-log-file-enabled=false -# Enables logging content errors to a file -# Allowed values: "true" or "false" - -compression-threshold=1 -# Determines the smallest size of raw network payload to compress -# Allowed values: 0-65535 - -compression-algorithm=zlib -# Determines the compression algorithm to use for networking -# Allowed values: "zlib", "snappy" - -server-authoritative-movement=server-auth -# Allowed values: "client-auth", "server-auth", "server-auth-with-rewind" -# Enables server authoritative movement. If "server-auth", the server will replay local user input on -# the server and send down corrections when the client's position doesn't match the server's. -# If "server-auth-with-rewind" is enabled and the server sends a correction, the clients will be instructed -# to rewind time back to the correction time, apply the correction, then replay all the player's inputs since then. This results in smoother and more frequent corrections. -# Corrections will only happen if correct-player-movement is set to true. - -player-movement-score-threshold=20 -# The number of incongruent time intervals needed before abnormal behavior is reported. -# Disabled by server-authoritative-movement. - -player-movement-action-direction-threshold=0.85 -# The amount that the player's attack direction and look direction can differ. -# Allowed values: Any value in the range of [0, 1] where 1 means that the -# direction of the players view and the direction the player is attacking -# must match exactly and a value of 0 means that the two directions can -# differ by up to and including 90 degrees. - -player-movement-distance-threshold=0.3 -# The difference between server and client positions that needs to be exceeded before abnormal behavior is detected. -# Disabled by server-authoritative-movement. - -player-movement-duration-threshold-in-ms=500 -# The duration of time the server and client positions can be out of sync (as defined by player-movement-distance-threshold) -# before the abnormal movement score is incremented. This value is defined in milliseconds. -# Disabled by server-authoritative-movement. - -correct-player-movement=false -# If true, the client position will get corrected to the server position if the movement score exceeds the threshold. - - -server-authoritative-block-breaking=false -# If true, the server will compute block mining operations in sync with the client so it can verify that the client should be able to break blocks when it thinks it can. - -chat-restriction=None -# Allowed values: "None", "Dropped", "Disabled" -# This represents the level of restriction applied to the chat for each player that joins the server. -# "None" is the default and represents regular free chat. -# "Dropped" means the chat messages are dropped and never sent to any client. Players receive a message to let them know the feature is disabled. -# "Disabled" means that unless the player is an operator, the chat UI does not even appear. No information is displayed to the player. - -disable-player-interaction=false -# If true, the server will inform clients that they should ignore other players when interacting with the world. This is not server authoritative. \ No newline at end of file diff --git a/configs/java/server.properties b/configs/java/server.properties deleted file mode 100644 index 9cffd13..0000000 --- a/configs/java/server.properties +++ /dev/null @@ -1,57 +0,0 @@ -#Minecraft server properties -#Mon Oct 17 00:27:26 UTC 2022 -enable-jmx-monitoring=false -rcon.port=25575 -level-seed= -gamemode=survival -enable-command-block=false -enable-query=false -generator-settings={} -enforce-secure-profile=true -level-name=world -motd=A Minecraft Server -query.port=25565 -pvp=true -generate-structures=true -max-chained-neighbor-updates=1000000 -difficulty=easy -network-compression-threshold=256 -max-tick-time=60000 -require-resource-pack=false -use-native-transport=true -max-players=20 -online-mode=true -enable-status=true -allow-flight=false -broadcast-rcon-to-ops=true -view-distance=10 -server-ip= -resource-pack-prompt= -allow-nether=true -server-port=25565 -enable-rcon=false -sync-chunk-writes=true -op-permission-level=4 -prevent-proxy-connections=false -hide-online-players=false -resource-pack= -entity-broadcast-range-percentage=100 -simulation-distance=10 -rcon.password= -player-idle-timeout=0 -force-gamemode=false -rate-limit=0 -hardcore=false -white-list=false -broadcast-console-to-ops=true -spawn-npcs=true -previews-chat=false -spawn-animals=true -function-permission-level=2 -level-type=minecraft\:normal -text-filtering-config= -spawn-monsters=true -enforce-whitelist=false -spawn-protection=16 -resource-pack-sha1= -max-world-size=29999984 diff --git a/package-lock.json b/package-lock.json index 8d46eb9..02020a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,72 +1,19 @@ { - "name": "@the-bds-maneger/core", - "version": "5.4.0", + "name": "@the-bds-maneger/monorepo", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@the-bds-maneger/core", - "version": "5.4.0", + "name": "@the-bds-maneger/monorepo", "license": "GPL-3.0", - "dependencies": { - "@sirherobrine23/coreutils": "^3.1.2", - "adm-zip": "^0.5.10", - "compare-versions": "^5.0.3", - "debug": "^4.3.4", - "prismarine-nbt": "^2.2.1", - "tar": "^6.1.13" - }, + "workspaces": [ + "package/core", + "package/cli", + "package/docker" + ], "devDependencies": { - "@types/adm-zip": "^0.5.0", - "@types/debug": "^4.1.7", - "@types/mocha": "^10.0.1", - "@types/node": "^18.13.0", - "@types/tar": "^6.1.3", - "mocha": "^10.2.0", - "ts-node": "^10.9.1", - "tsconfig-paths": "^4.1.2", - "typedoc": "^0.23.24", + "@types/node": "^18.14.0", "typescript": "^4.9.5" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@octokit/app": { @@ -296,9 +243,9 @@ } }, "node_modules/@octokit/plugin-retry": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-4.1.1.tgz", - "integrity": "sha512-iR7rg5KRSl6L6RELTQQ3CYeNgeBJyuAmP95odzcQ/zyefnRT/Peo8rWeky4z7V/+/oPWqOL4I5Z+V8KtjpHCJw==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-4.1.2.tgz", + "integrity": "sha512-hscf7p/6DIQ8xbfDrMl9IflxugED6sFQvAUbSi75R6h/6hcNQgrb2vpfPTmyYKkdAEeTkUsEpzpQFdTAhSITOw==", "dependencies": { "@octokit/types": "^9.0.0", "bottleneck": "^2.15.3" @@ -400,72 +347,30 @@ "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@sirherobrine23/ar": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sirherobrine23/ar/-/ar-3.1.2.tgz", - "integrity": "sha512-qD/Ij2vve8+RCpOXhPcPAAfaYQTvDukZib9qyCUIhdokCkpylvRjpMUx8pSa+JL61XNEUJI+g4plm43P/4S4UQ==" - }, - "node_modules/@sirherobrine23/basic_utils": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sirherobrine23/basic_utils/-/basic_utils-3.1.2.tgz", - "integrity": "sha512-cgSoSb3kyNQqSzM166wjLZlotlnPDeIkvwqh2FxttMQ5YUkjB4GnAA7qKMqzIFYAFkhS0UTaX8kDYHY9nTa6qw==" - }, "node_modules/@sirherobrine23/cloud": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sirherobrine23/cloud/-/cloud-3.1.2.tgz", - "integrity": "sha512-/ENyYqpEh33WYq9D8EZNNAxekqGfm4RsUrxtnDiKOFxT/xhM3H8Rk98V0iVseaEG2SDnbWWP4yPu6oxjUajxug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@sirherobrine23/cloud/-/cloud-3.2.1.tgz", + "integrity": "sha512-D/Mo12oHEAisOl6INfpKjcQHINTiKtO1/fkHs4vymhOvw12uy+C4KtFhpWdwkGCmfQkC05AUMrI4SVwV2m8t8w==", "dependencies": { - "@sirherobrine23/http": "3.1.2", + "@sirherobrine23/extends": "3.2.1", + "@sirherobrine23/http": "3.2.1", + "chokidar": "^3.5.3", "googleapis": "^110.0.0", "oci-common": "^2.50.4", "oci-objectstorage": "^2.51.0" } }, - "node_modules/@sirherobrine23/coreutils": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sirherobrine23/coreutils/-/coreutils-3.1.2.tgz", - "integrity": "sha512-V+aySml73Wr55C5bcSIdU24sfn79jgiM38jQ19djJS3nlYx/vh9xjOYPehutlBhPIAe22UPswEdfK5CO4WgU7g==", - "dependencies": { - "@sirherobrine23/ar": "3.1.2", - "@sirherobrine23/basic_utils": "3.1.2", - "@sirherobrine23/cloud": "3.1.2", - "@sirherobrine23/debian": "3.1.2", - "@sirherobrine23/docker-registry": "3.1.2", - "@sirherobrine23/extends": "3.1.2", - "@sirherobrine23/http": "3.1.2" - } - }, - "node_modules/@sirherobrine23/debian": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sirherobrine23/debian/-/debian-3.1.2.tgz", - "integrity": "sha512-HOFZDEGqwsX0Zmj8wY8RUpjRzY30kozWG3YYP9XomsM/s9DrK4x6e8sdE51VNF74dJjOzS8QxSZ7TMMHCGZwQg==", - "dependencies": { - "@sirherobrine23/ar": "3.1.2", - "@sirherobrine23/extends": "3.1.2", - "@sirherobrine23/http": "3.1.2", - "lzma-native": "^8.0.6", - "unbzip2-stream": "^1.4.3" - } - }, - "node_modules/@sirherobrine23/docker-registry": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sirherobrine23/docker-registry/-/docker-registry-3.1.2.tgz", - "integrity": "sha512-Q0DlrUMqMXtKaBDHoE3iZT/MWqgewgJ27C4bCY+ZoALMMC6NaSdCXj7pPKax36i6NgXMmr7e79q07ujosClIHw==", - "dependencies": { - "@sirherobrine23/http": "3.1.2" - } - }, "node_modules/@sirherobrine23/extends": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sirherobrine23/extends/-/extends-3.1.2.tgz", - "integrity": "sha512-3hBg9Ol5PYGk+DkoXniH3jPQxoVqri7tQmli6fYT7IGa04VweFBpasbEOUYZm0yM9gzIFxzMg3Ic8xa3BfXGrg==" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@sirherobrine23/extends/-/extends-3.2.1.tgz", + "integrity": "sha512-5fc6eH9IBQFOm0BF2N4eB5kkkzpY9owb8XCcwajJROYe9zTKSfC2QPDiHf+CuXCbO6Zex4nVL6AjbTs4FYJKTQ==" }, "node_modules/@sirherobrine23/http": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sirherobrine23/http/-/http-3.1.2.tgz", - "integrity": "sha512-KkI8mIgX9u52DsepXJsvyxmsA5QpJ88YIUIlaGEwRoBMbZNs14S84/3b4XYfHYMdPI6quAdmyhUBBuGU57ig7A==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@sirherobrine23/http/-/http-3.2.1.tgz", + "integrity": "sha512-jRzztPuPF+i6RmxXKlhgsXgy2Dj/MW1SldNdI45+KVn6vC1wTZANHPPaf6tZDvdbvgTm1KJy0UIcL827HGuw0A==", "dependencies": { - "@sirherobrine23/extends": "3.1.2", + "@sirherobrine23/extends": "3.2.1", "acme-client": "^5.0.0", "adm-zip": "^0.5.10", "cloudflare": "^2.9.1", @@ -487,6 +392,18 @@ "node": ">=14.16" } }, + "node_modules/@the-bds-maneger/cli": { + "resolved": "package/cli", + "link": true + }, + "node_modules/@the-bds-maneger/core": { + "resolved": "package/core", + "link": true + }, + "node_modules/@the-bds-maneger/docker": { + "resolved": "package/docker", + "link": true + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -495,39 +412,6 @@ "node": ">= 10" } }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", - "dev": true - }, - "node_modules/@types/adm-zip": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.0.tgz", - "integrity": "sha512-FCJBJq9ODsQZUNURo5ILAQueuA8WJhRvuihS3ke2iI25mJlfV2LK8jG2Qj2z2AWg8U0FtWWqBHVRetceLskSaw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/aws-lambda": { "version": "8.10.110", "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.110.tgz", @@ -538,15 +422,6 @@ "resolved": "https://registry.npmjs.org/@types/btoa-lite/-/btoa-lite-1.0.0.tgz", "integrity": "sha512-wJsiX1tosQ+J5+bY5LrSahHxr2wT+uME5UDwdN1kg4frt40euqA+wzECkmq4t5QbveHiJepfdThgQrPw6KiSlg==" }, - "node_modules/@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", - "dev": true, - "dependencies": { - "@types/ms": "*" - } - }, "node_modules/@types/http-cache-semantics": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", @@ -575,22 +450,10 @@ "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==" }, - "node_modules/@types/mocha": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", - "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", - "dev": true - }, - "node_modules/@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", - "dev": true - }, "node_modules/@types/node": { - "version": "18.13.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", - "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==" + "version": "18.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.0.tgz", + "integrity": "sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A==" }, "node_modules/@types/opossum": { "version": "4.1.1", @@ -600,6 +463,12 @@ "@types/node": "*" } }, + "node_modules/@types/semver": { + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "dev": true + }, "node_modules/@types/sshpk": { "version": "1.10.3", "resolved": "https://registry.npmjs.org/@types/sshpk/-/sshpk-1.10.3.tgz", @@ -609,15 +478,39 @@ } }, "node_modules/@types/tar": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@types/tar/-/tar-6.1.3.tgz", - "integrity": "sha512-YzDOr5kdAeqS8dcO6NTTHTMJ44MUCBDoLEIyPtwEn7PssKqUYL49R1iCVJPeiPzPlKi6DbH33eZkpeJ27e4vHg==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@types/tar/-/tar-6.1.4.tgz", + "integrity": "sha512-Cp4oxpfIzWt7mr2pbhHT2OTXGMAL0szYCzuf8lRWyIMCgsx6/Hfc3ubztuhvzXHXgraTQxyOCmmg7TDGIMIJJQ==", "dev": true, "dependencies": { "@types/node": "*", - "minipass": "^3.3.5" + "minipass": "^4.0.0" } }, + "node_modules/@types/unzip-stream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@types/unzip-stream/-/unzip-stream-0.3.1.tgz", + "integrity": "sha512-RlE3qaqvu4XaMwxkG/zR1gIunCbqXvNrmZ4BCG7OiQ8QUactFUPxm0TTrOCRJZQfPW3T6XBH7PcHQiiqkdcijw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.22", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.22.tgz", + "integrity": "sha512-pet5WJ9U8yPVRhkwuEIp5ktAeAqRZOq4UdAyWLWzxbtpyXnzbtLdKiXAjJzi/KLmPGS9wk86lUFWZFN6sISo4g==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -696,35 +589,10 @@ "node": ">=8" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -733,7 +601,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -748,7 +615,6 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -757,18 +623,6 @@ "node": ">= 8" } }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "node_modules/arrify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", @@ -817,12 +671,6 @@ "form-data": "^4.0.0" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -863,11 +711,22 @@ "node": "*" } }, + "node_modules/binary": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", + "integrity": "sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==", + "dependencies": { + "buffers": "~0.1.1", + "chainsaw": "~0.1.0" + }, + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, "engines": { "node": ">=8" } @@ -877,20 +736,10 @@ "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -898,45 +747,24 @@ "node": ">=8" } }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, "node_modules/btoa-lite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", "integrity": "sha512-gvW7InbIyF8AicrqWoptdW08pUxuhq8BEgowNajy9RhiE86fmGAGl+bLKo6oB8QP0CkqHLowfN0oJdKC/J6LbA==" }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" }, + "node_modules/buffers": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", + "integrity": "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==", + "engines": { + "node": ">=0.2.0" + } + }, "node_modules/cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", @@ -974,18 +802,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/capture-stack-trace": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.2.tgz", @@ -997,39 +813,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, + "node_modules/chainsaw": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", + "integrity": "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "traverse": ">=0.3.0 <0.4" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "node": "*" } }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, "funding": [ { "type": "individual", @@ -1069,14 +867,16 @@ } }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/cloudflare": { @@ -1142,7 +942,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -1153,8 +952,7 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/combined-stream": { "version": "1.0.8", @@ -1167,17 +965,6 @@ "node": ">= 0.8" } }, - "node_modules/compare-versions": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.3.tgz", - "integrity": "sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A==" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -1194,12 +981,6 @@ "node": ">=0.10.0" } }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, "node_modules/cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -1261,18 +1042,6 @@ } } }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/decimal.js": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", @@ -1329,15 +1098,6 @@ "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -1374,8 +1134,7 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/entities": { "version": "4.4.0", @@ -1402,23 +1161,10 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/escodegen": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", @@ -1481,16 +1227,6 @@ "node >=0.6.0" ] }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -1505,7 +1241,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1513,31 +1248,6 @@ "node": ">=8" } }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "bin": { - "flat": "cli.js" - } - }, "node_modules/follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -1608,17 +1318,21 @@ "node": ">= 8" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -1663,7 +1377,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -1700,31 +1413,10 @@ "assert-plus": "^1.0.0" } }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -1732,28 +1424,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/google-auth-library": { "version": "8.7.0", "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.7.0.tgz", @@ -1863,15 +1533,6 @@ "node": ">= 0.4.0" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -1883,15 +1544,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "bin": { - "he": "bin/he" - } - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -1969,25 +1621,6 @@ "node": ">=0.10.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", @@ -1996,26 +1629,10 @@ "node": ">=8" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -2027,7 +1644,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -2036,7 +1652,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -2045,7 +1660,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -2057,20 +1671,10 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -2111,18 +1715,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/isomorphic-fetch": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", @@ -2132,18 +1724,6 @@ "whatwg-fetch": "^3.4.1" } }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -2211,29 +1791,6 @@ "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", - "dev": true - }, "node_modules/jsonwebtoken": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", @@ -2338,52 +1895,11 @@ "node": ">= 0.8.0" } }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" - }, - "node_modules/lodash.reduce": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", - "integrity": "sha512-6raRe2vxCYBhpBu+B+TtNGUzah+hQjVdu3E17wfusjyrXBka2nBS8OH/gjVZ5PvHOhWmIZTYri09Z6n/QfnNMw==" - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -2406,47 +1922,6 @@ "node": ">=10" } }, - "node_modules/lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true - }, - "node_modules/lzma-native": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/lzma-native/-/lzma-native-8.0.6.tgz", - "integrity": "sha512-09xfg67mkL2Lz20PrrDeNYZxzeW7ADtpYFbwSQh9U8+76RIzx5QsJBMy8qikv3hbUPfpy6hqwxt6FcGK81g9AA==", - "hasInstallScript": true, - "dependencies": { - "node-addon-api": "^3.1.0", - "node-gyp-build": "^4.2.1", - "readable-stream": "^3.6.0" - }, - "bin": { - "lzmajs": "bin/lzmajs" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/marked": { - "version": "4.2.12", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", - "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==", - "dev": true, - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 12" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -2477,34 +1952,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", - "dev": true, + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dependencies": { - "yallist": "^4.0.0" - }, + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.0.3.tgz", + "integrity": "sha512-OW2r4sQ0sI+z5ckEt5c1Tri4xTgZwYDxpE54eqWlQloQRoWtXjqt9udJ5Z4dSv7wK+nfFI7FRXyCpBSft+gpFw==", "engines": { "node": ">=8" } @@ -2521,6 +1980,17 @@ "node": ">= 8" } }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -2532,74 +2002,11 @@ "node": ">=10" } }, - "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", - "dev": true, - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "nanoid": "3.3.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" - }, "node_modules/node-fetch": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", @@ -2646,21 +2053,10 @@ "node": ">= 6.13.0" } }, - "node_modules/node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -2698,9 +2094,9 @@ } }, "node_modules/oci-common": { - "version": "2.51.0", - "resolved": "https://registry.npmjs.org/oci-common/-/oci-common-2.51.0.tgz", - "integrity": "sha512-tjFxeUZ7hLpC7lNznwfHfEsEVY2hbNx/fkFp3Zrr1ylzgxJF64mLzvNJXUqCVvLn+RUuvzEfU5osFhYRjzC/5A==", + "version": "2.52.0", + "resolved": "https://registry.npmjs.org/oci-common/-/oci-common-2.52.0.tgz", + "integrity": "sha512-86qBgAIBj3pZS40qqmJUDQsdnimOT9MmEjYN8Cqk8uanqQ9j/HxbMuEZR7Fj7Sfx4cYbn0mqr7rbG7fE1VWHRA==", "dependencies": { "@types/isomorphic-fetch": "0.0.35", "@types/jsonwebtoken": "9.0.0", @@ -2727,22 +2123,22 @@ } }, "node_modules/oci-objectstorage": { - "version": "2.51.0", - "resolved": "https://registry.npmjs.org/oci-objectstorage/-/oci-objectstorage-2.51.0.tgz", - "integrity": "sha512-vl9shd0KCSOErjoTbwo7iJ9ZoQQAiumfjNqmXk9hzMgw2BTeIs9K2J+g4TYtHT9Dc8YZPjTJ2dtYnl0lMtHZYA==", + "version": "2.52.0", + "resolved": "https://registry.npmjs.org/oci-objectstorage/-/oci-objectstorage-2.52.0.tgz", + "integrity": "sha512-JDfLtzACz8o+dlXe+62z0oaTZYfsKuNqvsdC1/DzjANhAeVRgr4PX8EhORPOuxtJjgYf9unXOGkenr7aaClPZw==", "dependencies": { "await-semaphore": "^0.1.3", - "oci-common": "2.51.0", - "oci-workrequests": "2.51.0" + "oci-common": "2.52.0", + "oci-workrequests": "2.52.0" } }, "node_modules/oci-workrequests": { - "version": "2.51.0", - "resolved": "https://registry.npmjs.org/oci-workrequests/-/oci-workrequests-2.51.0.tgz", - "integrity": "sha512-2lVHMRlccwoTv9FVA7QuUwRXr9zIIkKtsGf9LQ+YYVhDJhL5nOvzQ0aKRRMNOieepUjAuVCRdj/bBQDL2CO24w==", + "version": "2.52.0", + "resolved": "https://registry.npmjs.org/oci-workrequests/-/oci-workrequests-2.52.0.tgz", + "integrity": "sha512-lK5wTuY/BPZblfAsTvffGfQ49k1gHkIPYRepPDwBCV3EYbYESTb232AK3YSif39mOXdrnPX5aOTRn4eqrgW/BQ==", "dependencies": { - "oci-common": "2.51.0", - "oci-workrequests": "2.51.0" + "oci-common": "2.52.0", + "oci-workrequests": "2.52.0" } }, "node_modules/octokit": { @@ -2803,36 +2199,6 @@ "node": ">=12.20" } }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -2844,29 +2210,10 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -2890,39 +2237,6 @@ "node": ">=0.10.0" } }, - "node_modules/prismarine-nbt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prismarine-nbt/-/prismarine-nbt-2.2.1.tgz", - "integrity": "sha512-Mb50c58CPnuZ+qvM31DBa08tf9UumlTq1LkvpMoUpKfCuN05GZHTqCUwER3lxTSHLL0GZKghIPbYR/JQkINijQ==", - "dependencies": { - "protodef": "^1.9.0" - } - }, - "node_modules/protodef": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/protodef/-/protodef-1.15.0.tgz", - "integrity": "sha512-bZ2Omw8dT+DACjJHLrBWZlqN4MlT9g9oSpJDdkUAJOStUzgJp+Zn42FJfPUdwutUxjaxA0PftN0PDlNa2XbneA==", - "dependencies": { - "lodash.get": "^4.4.2", - "lodash.reduce": "^4.6.0", - "protodef-validator": "^1.3.0", - "readable-stream": "^3.0.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/protodef-validator": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/protodef-validator/-/protodef-validator-1.3.1.tgz", - "integrity": "sha512-lZ5FWKZYR9xOjpMw1+EfZRfCjzNRQWPq+Dk+jki47Sikl2EeWEPnTfnJERwnU/EwFq6us+0zqHHzSsmLeYX+Lg==", - "dependencies": { - "ajv": "^6.5.4" - }, - "bin": { - "protodef-validator": "cli.js" - } - }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -2966,33 +2280,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -3004,7 +2295,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -3082,26 +2372,6 @@ "node": ">=10" } }, - "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/shiki": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.12.1.tgz", - "integrity": "sha512-aieaV1m349rZINEBkjxh2QbBvFFQOlgqYTNtCal82hHj4dDZ76oMlQIX+C7ryerBTDiga3e5NfH6smjdJ02BbQ==", - "dev": true, - "dependencies": { - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } - }, "node_modules/should-proxy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/should-proxy/-/should-proxy-1.0.4.tgz", @@ -3153,19 +2423,10 @@ "node": ">=0.10.0" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3179,7 +2440,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3187,42 +2447,6 @@ "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -3244,19 +2468,6 @@ "node": ">=10" } }, - "node_modules/tar/node_modules/minipass": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.0.3.tgz", - "integrity": "sha512-OW2r4sQ0sI+z5ckEt5c1Tri4xTgZwYDxpE54eqWlQloQRoWtXjqt9udJ5Z4dSv7wK+nfFI7FRXyCpBSft+gpFw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" - }, "node_modules/timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", @@ -3269,7 +2480,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -3302,70 +2512,12 @@ "node": ">=12" } }, - "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, + "node_modules/traverse": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", + "integrity": "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==", "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/tsconfig-paths": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.1.2.tgz", - "integrity": "sha512-uhxiMgnXQp1IR622dUXI+9Ehnws7i/y6xvpZB9IbUVOPy0muvdvgXeZOn88UcGPiT98Vp3rJPTa8bFoalZ3Qhw==", - "dev": true, - "dependencies": { - "json5": "^2.2.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" + "node": "*" } }, "node_modules/tweetnacl": { @@ -3384,39 +2536,6 @@ "node": ">= 0.8.0" } }, - "node_modules/typedoc": { - "version": "0.23.24", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.24.tgz", - "integrity": "sha512-bfmy8lNQh+WrPYcJbtjQ6JEEsVl/ce1ZIXyXhyW+a1vFrjO39t6J8sL/d6FfAGrJTc7McCXgk9AanYBSNvLdIA==", - "dev": true, - "dependencies": { - "lunr": "^2.3.9", - "marked": "^4.2.5", - "minimatch": "^5.1.2", - "shiki": "^0.12.1" - }, - "bin": { - "typedoc": "bin/typedoc" - }, - "engines": { - "node": ">= 14.14" - }, - "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x" - } - }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -3430,15 +2549,6 @@ "node": ">=4.2.0" } }, - "node_modules/unbzip2-stream": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", - "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", - "dependencies": { - "buffer": "^5.2.1", - "through": "^2.3.8" - } - }, "node_modules/universal-github-app-jwt": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/universal-github-app-jwt/-/universal-github-app-jwt-1.1.1.tgz", @@ -3469,12 +2579,24 @@ "node": ">=4" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "node_modules/unzip-stream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.1.tgz", + "integrity": "sha512-RzaGXLNt+CW+T41h1zl6pGz3EaeVhYlK+rdAap+7DxW5kqsqePO8kRtWPaCiVqdhZc86EctSPVYNix30YOMzmw==", "dependencies": { - "punycode": "^2.1.0" + "binary": "^0.3.0", + "mkdirp": "^0.5.1" + } + }, + "node_modules/unzip-stream/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" } }, "node_modules/url-parse": { @@ -3510,11 +2632,6 @@ "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==" }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, "node_modules/uuid": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", @@ -3523,12 +2640,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -3542,18 +2653,6 @@ "extsprintf": "^1.2.0" } }, - "node_modules/vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true - }, - "node_modules/vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true - }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -3617,17 +2716,10 @@ "node": ">=0.10.0" } }, - "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true - }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -3646,9 +2738,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", - "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.1.tgz", + "integrity": "sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==", "engines": { "node": ">=10.0.0" }, @@ -3682,7 +2774,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "engines": { "node": ">=10" } @@ -3701,67 +2792,68 @@ } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, + "version": "17.7.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.0.tgz", + "integrity": "sha512-dwqOPg5trmrre9+v8SUo2q/hAwyKoVfu8OC1xPHKJGNdxAvPl4sKxL4vBnh3bQz/ZvvGAFeA5H3ou2kcOY8sQQ==", "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "engines": { - "node": ">=10" + "node": ">=12" } }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, + "package/cli": { + "name": "@the-bds-maneger/cli", + "version": "1.0.0", + "license": "ISC", "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" + "@the-bds-maneger/core": "*", + "yargs": "^17.7.0" }, - "engines": { - "node": ">=10" + "devDependencies": { + "@types/yargs": "^17.0.22" } }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" + "package/core": { + "name": "@the-bds-maneger/core", + "version": "1.0.0", + "license": "GPL-3.0", + "dependencies": { + "@sirherobrine23/cloud": "^3.2.1", + "@sirherobrine23/extends": "^3.2.1", + "@sirherobrine23/http": "^3.2.1", + "semver": "^7.3.8", + "tar": "^6.1.13", + "unzip-stream": "^0.3.1" + }, + "devDependencies": { + "@types/semver": "^7.3.13", + "@types/tar": "^6.1.4", + "@types/unzip-stream": "^0.3.1" } }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" + "package/docker": { + "name": "@the-bds-maneger/docker", + "version": "1.0.0", + "license": "ISC", + "bin": { + "bdsdocker": "src/index.js" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "devDependencies": {} } } } diff --git a/package.json b/package.json index 293ba4e..b9fbffc 100644 --- a/package.json +++ b/package.json @@ -1,52 +1,16 @@ { - "name": "@the-bds-maneger/core", - "version": "5.4.0", - "description": "A very simple way to manage Minecraft servers", - "author": "Sirherobrine23", + "name": "@the-bds-maneger/monorepo", + "private": true, + "scripts": {}, + "author": "Matheus Sampaio Queiroga ", "license": "GPL-3.0", - "homepage": "https://sirherobrine23.org/BdsProject", - "type": "module", - "types": "./src/index.d.ts", - "main": "./src/index.js", - "private": false, - "publishConfig": { - "access": "public" - }, - "scripts": { - "docs": "typedoc --readme none --out docs src/index.ts", - "build": "tsc", - "test": "mocha src" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Sirherobrine23/Bds-Maneger-Core.git" - }, - "keywords": [], - "bugs": { - "url": "https://github.com/Sirherobrine23/Bds-Maneger-Core/issues/new", - "email": "support_bds@sirherobrine23.org" - }, - "engines": { - "node": ">=16.0.0" - }, - "dependencies": { - "@sirherobrine23/coreutils": "^3.1.2", - "adm-zip": "^0.5.10", - "compare-versions": "^5.0.3", - "debug": "^4.3.4", - "prismarine-nbt": "^2.2.1", - "tar": "^6.1.13" - }, "devDependencies": { - "@types/adm-zip": "^0.5.0", - "@types/debug": "^4.1.7", - "@types/mocha": "^10.0.1", - "@types/node": "^18.13.0", - "@types/tar": "^6.1.3", - "mocha": "^10.2.0", - "ts-node": "^10.9.1", - "tsconfig-paths": "^4.1.2", - "typedoc": "^0.23.24", + "@types/node": "^18.14.0", "typescript": "^4.9.5" - } + }, + "workspaces": [ + "package/core", + "package/cli", + "package/docker" + ] } diff --git a/package/cli/package.json b/package/cli/package.json new file mode 100644 index 0000000..c1bca99 --- /dev/null +++ b/package/cli/package.json @@ -0,0 +1,18 @@ +{ + "name": "@the-bds-maneger/cli", + "version": "1.0.0", + "description": "", + "main": "src/index.js", + "type": "module", + "scripts": {}, + "keywords": [], + "author": "Matheus Sampaio Queiroga ", + "license": "ISC", + "dependencies": { + "@the-bds-maneger/core": "*", + "yargs": "^17.7.0" + }, + "devDependencies": { + "@types/yargs": "^17.0.22" + } +} diff --git a/package/cli/src/index.ts b/package/cli/src/index.ts new file mode 100644 index 0000000..b96e85c --- /dev/null +++ b/package/cli/src/index.ts @@ -0,0 +1,39 @@ +#!/usr/bin/env node +import bdsCore from "@the-bds-maneger/core"; +import yargs from "yargs"; + +// Init yargs +yargs(process.argv.slice(2)).version(false).help(true).strictCommands().demandCommand() + +// bedrock +.command("bedrock", "Bedrock", yargs => yargs.command("install", "Install Server", async yargs => { + const options = yargs.option("altServer", { + string: true, + description: "Select a server other than Mojang", + demandOption: false, + choices: [ + "pocketmine", + "powernukkit", + "cloudbust" + ], + }).option("list", { + alias: "l", + boolean: true, + default: false, + description: "List versions instead of installing" + }).option("version", { + alias: "V", + string: true, + default: "latest", + description: "Server version to install", + }).parseSync(); + if (options.list) return console.log(JSON.stringify(await bdsCore.Bedrock.listVersions({altServer: options.altServer as any}), null, 2)); + const data = await bdsCore.Bedrock.installServer({ + altServer: options.altServer as any, + version: options.version, + }); + console.log("Server ID: %O", data.id); +})) + +// run +.parseAsync(); \ No newline at end of file diff --git a/package/cli/tsconfig.json b/package/cli/tsconfig.json new file mode 100644 index 0000000..3694926 --- /dev/null +++ b/package/cli/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "module": "NodeNext", + "moduleResolution": "NodeNext", + "target": "ESNext", + "forceConsistentCasingInFileNames": true, + "declaration": true, + "strict": false, + "noUnusedLocals": true, + "isolatedModules": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "allowJs": true, + "lib": [ + "ESNext" + ] + }, + "exclude": [ + "**/*.test.*" + ], + "ts-node": { + "esm": true + }, + "references": [ + { + "path": "../core" + } + ] +} \ No newline at end of file diff --git a/package/core/README.md b/package/core/README.md new file mode 100644 index 0000000..9db4838 --- /dev/null +++ b/package/core/README.md @@ -0,0 +1,5 @@ +# Bds Maneger Core + +Este é um nucleo de utilização basica como: Fazer download do servidor, Gerenciar e outras coisas. + +**Atualmente suportamos varias servidores, tanto para o Bedrock tanto o Java** diff --git a/package/core/package.json b/package/core/package.json new file mode 100644 index 0000000..aca3275 --- /dev/null +++ b/package/core/package.json @@ -0,0 +1,26 @@ +{ + "name": "@the-bds-maneger/core", + "version": "1.0.0", + "description": "", + "main": "src/index.js", + "types": "src/index.d.ts", + "type": "module", + "author": "Matheus Sampaio Queiroga ", + "license": "GPL-3.0", + "scripts": { + "build": "tsc --build --clean && tsc" + }, + "dependencies": { + "@sirherobrine23/cloud": "^3.2.1", + "@sirherobrine23/extends": "^3.2.1", + "@sirherobrine23/http": "^3.2.1", + "semver": "^7.3.8", + "tar": "^6.1.13", + "unzip-stream": "^0.3.1" + }, + "devDependencies": { + "@types/semver": "^7.3.13", + "@types/tar": "^6.1.4", + "@types/unzip-stream": "^0.3.1" + } +} diff --git a/src/lib/childPromisses.ts b/package/core/src/childPromisses.ts similarity index 100% rename from src/lib/childPromisses.ts rename to package/core/src/childPromisses.ts diff --git a/package/core/src/index.ts b/package/core/src/index.ts new file mode 100644 index 0000000..090e7ab --- /dev/null +++ b/package/core/src/index.ts @@ -0,0 +1,12 @@ +export * from "./serverManeger.js"; +export * as Bedrock from "./servers/bedrock.js"; +export * as Java from "./servers/java.js"; + +import * as serverManeger from "./serverManeger.js"; +import * as Bedrock from "./servers/bedrock.js"; +import * as Java from "./servers/java.js"; +export default { + ...serverManeger, + Bedrock, + Java +}; diff --git a/src/lib/remote.ts b/package/core/src/internal.ts similarity index 58% rename from src/lib/remote.ts rename to package/core/src/internal.ts index 2a58cb3..af737bb 100644 --- a/src/lib/remote.ts +++ b/package/core/src/internal.ts @@ -1,11 +1,12 @@ -import { Cloud } from "@sirherobrine23/coreutils"; +import { oracleBucket } from "@sirherobrine23/cloud"; -export const oracleBucket = await Cloud.oracleBucket({ +export const oracleStorage = await oracleBucket.oracleBucket({ region: "sa-saopaulo-1", namespace: "grwodtg32n4d", name: "bdsFiles", auth: { type: "preAuthentication", + // Public auth (No write enabled). PreAuthenticatedKey: "0IKM-5KFpAF8PuWoVe86QFsF4sipU2rXfojpaOMEdf4QgFQLcLlDWgMSPHWmjf5W" } }); \ No newline at end of file diff --git a/package/core/src/serverManeger.ts b/package/core/src/serverManeger.ts new file mode 100644 index 0000000..262626b --- /dev/null +++ b/package/core/src/serverManeger.ts @@ -0,0 +1,121 @@ +import { extendsFS } from "@sirherobrine23/extends"; +import child_process from "node:child_process"; +import crypto from "node:crypto"; +import path from "node:path"; +import fs from "node:fs/promises"; +import os from "node:os"; + +// Default bds maneger core +export const bdsManegerRoot = process.env.bdscoreroot ? path.resolve(process.cwd(), process.env.bdscoreroot) : path.join(os.homedir(), ".bdsmaneger"); +if (!(await extendsFS.exists(bdsManegerRoot))) await fs.mkdir(bdsManegerRoot, {recursive: true}); + +export type runOptions = { + cwd: string, + env?: {[k: string]: string|number|boolean}, + command: string, + args?: (string|number|boolean)[], + serverActions?: { + stop?(child: serverRun): void|Promise, + } +}; + +export declare class serverRun extends child_process.ChildProcess { + on(event: string, listener: (...args: any[]) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: "message", listener: (message: child_process.Serializable, sendHandle: child_process.SendHandle) => void): this; + on(event: "spawn", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: "message", listener: (message: child_process.Serializable, sendHandle: child_process.SendHandle) => void): this; + once(event: "spawn", listener: () => void): this; + + stopServer(): Promise<{code?: number, signal?: NodeJS.Signals}>; + sendCommand(...args: (string|number|boolean)[]): this; +} + +/** + * + */ +export async function runServer(options: runOptions): Promise { + const child = child_process.execFile(options.command, [...((options.args ?? []).map(String))], { + maxBuffer: Infinity, + cwd: options.cwd || process.cwd(), + env: { + ...process.env, + ...Object.keys(options.env ?? {}).reduce((acc, a) => { + acc[a] = String(options.env[a]); + return acc; + }, {}) + } + }) as serverRun; + child.sendCommand = function (...args) { + if (!child.stdin.writable) { + child.emit("error", new Error("cannot send command to server")); + return child; + }; + child.stdin.write(args.map(String).join(" ")+"\n"); + return child; + } + + child.stopServer = async function () { + const stop = options.serverActions?.stop ?? function (child) { + + }; + Promise.resolve().then(() => stop(child)).catch(err => child.emit("error", err)); + return new Promise((done, reject) => child.once("error", reject).once("exit", (code, signal) => done({code, signal}))); + } + return child; +} + +export type manegerOptions = { + ID?: string, + newID?: boolean, +}; + +/** + * + */ +export async function serverManeger(options: manegerOptions) { + if (!options) throw new TypeError("Por favor adicione as opções do serverManeger!"); + if (!options.ID) options.newID = true; + if (options.newID) { + while(true) { + options.ID = crypto.randomBytes(16).toString("hex"); + if (!(await fs.readdir(bdsManegerRoot)).includes(options.ID)) break; + } + } + + /** + * Platform ID root path + */ + const rootPath = path.join(bdsManegerRoot, options.ID); + if (!(await extendsFS.exists(rootPath))) await fs.mkdir(rootPath, {recursive: true}); + + // sub-folders + const serverFolder = path.join(rootPath, "server"); + const backup = path.join(rootPath, "backups"); + + for await (const p of [ + serverFolder, + backup, + ]) if (!(await extendsFS.exists(p))) await fs.mkdir(p, {recursive: true}); + + return { + id: options.ID, + rootPath, + serverFolder, + backup, + async runCommand(options: Omit) { + return runServer({...options, cwd: serverFolder}); + } + }; +} + +export type serverManegerV1 = Awaited>; \ No newline at end of file diff --git a/package/core/src/servers/bedrock.ts b/package/core/src/servers/bedrock.ts new file mode 100644 index 0000000..1899ae5 --- /dev/null +++ b/package/core/src/servers/bedrock.ts @@ -0,0 +1,206 @@ +import coreHttp, { Github, large } from "@sirherobrine23/http"; +import { manegerOptions, runOptions, serverManeger } from "../serverManeger.js"; +import { commandExists } from "../childPromisses.js"; +import { oracleStorage } from "../internal.js"; +import { pipeline } from "node:stream/promises"; +import semver from "semver"; +import unzip from "unzip-stream"; +import utils from "node:util"; +import path from "node:path"; +import tar from "tar"; +import extendsFS from "@sirherobrine23/extends"; + +export type bedrockOptions = manegerOptions & { + /** + * Servidor alternativo ao invés do servidor ofical da Mojang + */ + altServer?: "pocketmine"|"powernukkit"|"cloudbust", + allowBeta?: boolean +}; + +const pocketmineGithub = await Github.GithubManeger("pmmp", "PocketMine-MP"); + +export async function listVersions(options: {altServer: "powernukkit"} & Omit): Promise<{version: string, mcpeVersion: string, date: Date, variantType: "stable"|"snapshot", url: string}[]>; +export async function listVersions(options: {altServer: "pocketmine"} & Omit): Promise; +export async function listVersions(): Promise<{version: string, date: Date, release?: "stable"|"preview", url: {[platform in NodeJS.Platform]?: {[arch in NodeJS.Architecture]?: string}}}[]>; +export async function listVersions(options?: Omit) { + if (!options) options = {}; + if (options.altServer === "pocketmine") return pocketmineGithub.getRelease(); + else if (options.altServer === "powernukkit") { + const releases_version = (await coreHttp.jsonRequest<{[k: string]: {version: string, releaseTime: number, minecraftVersion: string, artefacts: string[], commitId: string, snapshotBuild?: number}[]}>("https://raw.githubusercontent.com/PowerNukkit/powernukkit-version-aggregator/master/powernukkit-versions.json")).body; + return Object.keys(releases_version).reduce((acc, key) => { + for (const data of releases_version[key]) { + const dt = new Date(data.releaseTime); + const getArtefactExtension = (artefactId: string) => (artefactId.includes("REDUCED_JAR")) ? ".jar" : (artefactId.includes("REDUCED_SOURCES_JAR")) ? "-sources.jar" : (artefactId.includes("SHADED_JAR")) ? "-shaded.jar" : (artefactId.includes("SHADED_SOURCES_JAR")) ? "-shaded-sources.jar" : (artefactId.includes("JAVADOC_JAR")) ? "-javadoc.jar" : ".unknown"; + function buildArtefactUrl(data: any, artefactId?: string) { + const buildReleaseArtefactUrl = (data: any, artefactId?: string) => !data.artefacts.includes(artefactId) ? null : utils.format("https://search.maven.org/remotecontent?filepath=org/powernukkit/powernukkit/%s/powernukkit-%s%s", data.version, data.version, getArtefactExtension(artefactId)); + const buildSnapshotArtefactUrl = (data: any, artefactId?: string) => !data.artefacts.includes(artefactId) ? null : utils.format("https://oss.sonatype.org/content/repositories/snapshots/org/powernukkit/powernukkit/%s-SNAPSHOT/powernukkit-%s-%s%s", data.version.substring(0, data.version.indexOf("-SNAPSHOT")), data.version.substring(0, data.version.indexOf("-SNAPSHOT")), dt.getUTCFullYear().toString().padStart(4, "0") + (dt.getUTCMonth() + 1).toString().padStart(2, "0") + dt.getUTCDate().toString().padStart(2, "0") + "." + dt.getUTCHours().toString().padStart(2, "0") + dt.getUTCMinutes().toString().padStart(2, "0") + dt.getUTCSeconds().toString().padStart(2, "0") + "-" + data.snapshotBuild, getArtefactExtension(artefactId)); + if (artefactId == "GIT_SOURCE") { + if (data.commitId) return utils.format("https://github.com/PowerNukkit/PowerNukkit/tree/%s", data.commitId); + else if (data.snapshotBuild && data.artefacts.includes("SHADED_SOURCES_JAR")) return buildSnapshotArtefactUrl(data, "SHADED_SOURCES_JAR"); + else if (data.snapshotBuild && data.artefacts.includes("REDUCED_SOURCES_JAR")) return buildSnapshotArtefactUrl(data, "REDUCED_SOURCES_JAR"); + else if (data.artefacts.includes("SHADED_SOURCES_JAR")) return buildReleaseArtefactUrl(data, "SHADED_SOURCES_JAR"); + else if (data.artefacts.includes("REDUCED_SOURCES_JAR")) return buildReleaseArtefactUrl(data, "REDUCED_SOURCES_JAR"); + } else if (data.snapshotBuild) return buildSnapshotArtefactUrl(data, artefactId); + else return buildReleaseArtefactUrl(data, artefactId); + return null; + } + const artefacts = data.artefacts.reduce((acc, artefactId) => {acc[artefactId] = buildArtefactUrl(data, artefactId); return acc;}, {} as {[key: string]: string}); + const verRel = { + version: data.version, + mcpeVersion: data.minecraftVersion, + date: dt, + variantType: (!data.snapshotBuild?"snapshot":"stable") as "stable"|"snapshot", + url: artefacts.SHADED_JAR || artefacts.REDUCED_JAR + }; + if (!!verRel.url) acc.push(verRel); + } + return acc; + }, [] as {version: string, mcpeVersion: string, date: Date, variantType: "stable"|"snapshot", url: string}[]).filter(a => !!a.url).sort((b, a) => (b.date.getTime() - a.date.getTime()) - semver.compare(semver.valid(semver.coerce(a.version)), semver.valid(semver.coerce(b.version)))); + } else if (options.altServer === "cloudbust") throw new TypeError("O Cloudbust não tem listagem de versöes"); + return (await coreHttp.jsonRequest<{version: string, date: Date, release?: "stable"|"preview", url: {[platform in NodeJS.Platform]?: {[arch in NodeJS.Architecture]?: string}}}[]>("https://sirherobrine23.github.io/BedrockFetch/all.json")).body; +} + +export async function installServer(options: bedrockOptions & {version?: string}): Promise<{id: string, version: string, mcpeVersion?: string, releaseDate: Date}> { + const serverPath = await serverManeger(options); + if (options.altServer === "pocketmine") { + const version = (options.version ?? "latest").trim(); + const rel = (await pocketmineGithub.getRelease(version)); + if (!rel) throw new Error("Não foi possivel encontrar a versão informada do Pocketmine!"); + + const phpFile = (await oracleStorage.listFiles("php_bin")).find(file => file.name.includes(process.platform) && file.name.includes(process.arch)); + if (!phpFile) throw new Error(`Não foi possivel encontra os arquivos do php para o ${process.platform} com a arquitetura ${process.arch}`); + if (phpFile.name.endsWith(".tar.gz")) await pipeline(await oracleStorage.getFileStream(phpFile.name), tar.extract({cwd: serverPath.serverFolder})); + else if (phpFile.name.endsWith(".zip")) await pipeline(await oracleStorage.getFileStream(phpFile.name), unzip.Extract({path: serverPath.serverFolder})); + else throw new Error("Arquivo encontrado não é suportado!"); + + // save phar + await large.saveFile({ + url: rel.assets.find(a => a.name.endsWith(".phar"))?.browser_download_url, + path: path.join(serverPath.serverFolder, "server.phar") + }); + + return { + id: serverPath.id, + version: rel.tag_name, + releaseDate: new Date(rel.published_at) + }; + } else if (options.altServer === "powernukkit") { + const version = (options.version ?? "latest").trim(); + const releases = await listVersions({altServer: "powernukkit"}); + const relVersion = releases.find(rel => { + if (rel.variantType === "snapshot") if (!options.allowBeta) return false; + if (version.toLowerCase() === "latest") return true; + return (rel.version === version || rel.mcpeVersion === version); + }); + if (!relVersion) throw new Error("A versão não foi encontrada, por favor verique a versão informada!"); + await large.saveFile({ + path: path.join(serverPath.serverFolder, "server.jar"), + url: relVersion.url + }); + return { + id: serverPath.id, + version: relVersion.version, + mcpeVersion: relVersion.mcpeVersion, + releaseDate: relVersion.date, + }; + } else if (options.altServer === "cloudbust") { + await large.saveFile({ + url: "https://ci.opencollab.dev/job/NukkitX/job/Server/job/bleeding/lastSuccessfulBuild/artifact/target/Cloudburst.jar", + path: path.join(serverPath.serverFolder, "server.jar") + }); + + return { + id: serverPath.id, + version: "bleeding", + releaseDate: new Date() + }; + } + const bedrockVersion = (await listVersions()).find(rel => { + if (rel.release === "preview" && !!options.allowBeta) return false; + const version = (options.version ?? "latest").trim(); + if (version.toLowerCase() === "latest") return true; + return rel.version === version; + }); + if (!bedrockVersion) throw new Error("Não existe essa versão"); + let downloadUrl = bedrockVersion.url[process.platform]?.[process.arch]; + if ((["android", "linux"] as NodeJS.Process["platform"][]).includes(process.platform) && process.arch !== "x64") { + if (!downloadUrl) { + for (const emu of ["qemu-x86_64-static", "qemu-x86_64", "box64"]) { + if (downloadUrl) break; + if (await commandExists(emu)) downloadUrl = bedrockVersion.url.linux?.x64; + } + } + } + if (!downloadUrl) throw new Error(`Não existe o URL de download para ${process.platform} na arquitetura ${process.arch}`); + await pipeline(await coreHttp.streamRequest(downloadUrl), unzip.Extract({path: serverPath.serverFolder})); + return { + id: serverPath.id, + version: bedrockVersion.version, + releaseDate: bedrockVersion.date, + }; +} + +export async function startServer(options: bedrockOptions) { + const serverPath = await serverManeger(options); + if (options.altServer === "powernukkit"||options.altServer === "cloudbust") { + return serverPath.runCommand({ + command: "java", + args: [ + "-XX:+UseG1GC", + "-XX:+ParallelRefProcEnabled", + "-XX:MaxGCPauseMillis=200", + "-XX:+UnlockExperimentalVMOptions", + "-XX:+DisableExplicitGC", + "-XX:+AlwaysPreTouch", + "-XX:G1NewSizePercent=30", + "-XX:G1MaxNewSizePercent=40", + "-XX:G1HeapRegionSize=8M", + "-XX:G1ReservePercent=20", + "-XX:G1HeapWastePercent=5", + "-XX:G1MixedGCCountTarget=4", + "-XX:InitiatingHeapOccupancyPercent=15", + "-XX:G1MixedGCLiveThresholdPercent=90", + "-XX:G1RSetUpdatingPauseTimePercent=5", + "-XX:SurvivorRatio=32", + "-XX:+PerfDisableSharedMem", + "-XX:MaxTenuringThreshold=1", + "-Dusing.aikars.flags=https://mcflags.emc.gs", + "-Daikars.new.flags=true", + "-jar", "server.jar", + ], + serverActions: { + stop(child) { + child.sendCommand("stop"); + }, + } + }) + } else if (options.altServer === "pocketmine") { + return serverPath.runCommand({ + command: (await extendsFS.readdir(serverPath.serverFolder)).find(file => file.endsWith("php")||file.endsWith("php.exe")), + args: [ + "server.jar", + "--no-wizard" + ] + }); + } + if (process.platform === "darwin") throw new Error("Run in docker or podman!"); + const run: Omit = { + command: path.join(serverPath.serverFolder, "bedrock_server"), + serverActions: { + stop(child) { + child.sendCommand("stop"); + }, + } + }; + if ((["android", "linux"] as NodeJS.Process["platform"][]).includes(process.platform) && process.arch !== "x64") { + for (const emu of ["qemu-x86_64-static", "qemu-x86_64", "box64"]) { + if (await commandExists(emu)) { + run.args = [emu, run.command]; + run.command = emu; + break; + } + } + } + return serverPath.runCommand(run); +} \ No newline at end of file diff --git a/package/core/src/servers/java.ts b/package/core/src/servers/java.ts new file mode 100644 index 0000000..648f812 --- /dev/null +++ b/package/core/src/servers/java.ts @@ -0,0 +1,9 @@ +import { manegerOptions } from "../serverManeger.js"; + +export type javaOptions = manegerOptions & { + /** + * Servidor alternativo ao invés do servidor ofical da Mojang + */ + altServer?: "spigot"|"paper"|"purpur", + allowBeta?: boolean +}; diff --git a/package/core/tsconfig.json b/package/core/tsconfig.json new file mode 100644 index 0000000..61566f2 --- /dev/null +++ b/package/core/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "module": "NodeNext", + "moduleResolution": "NodeNext", + "target": "ESNext", + "forceConsistentCasingInFileNames": true, + "declaration": true, + "strict": false, + "noUnusedLocals": true, + "isolatedModules": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "allowJs": true, + "lib": [ + "ESNext" + ], + "composite": true + }, + "exclude": [ + "**/*.test.*" + ], + "ts-node": { + "esm": true + } +} \ No newline at end of file diff --git a/package/docker/package.json b/package/docker/package.json new file mode 100644 index 0000000..0632d9f --- /dev/null +++ b/package/docker/package.json @@ -0,0 +1,17 @@ +{ + "name": "@the-bds-maneger/docker", + "private": true, + "version": "1.0.0", + "description": "", + "type": "module", + "bin": { + "bdsdocker": "./src/index.js" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "Matheus Sampaio Queiroga ", + "license": "ISC" +} diff --git a/package/docker/tsconfig.json b/package/docker/tsconfig.json new file mode 100644 index 0000000..3694926 --- /dev/null +++ b/package/docker/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "module": "NodeNext", + "moduleResolution": "NodeNext", + "target": "ESNext", + "forceConsistentCasingInFileNames": true, + "declaration": true, + "strict": false, + "noUnusedLocals": true, + "isolatedModules": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "allowJs": true, + "lib": [ + "ESNext" + ] + }, + "exclude": [ + "**/*.test.*" + ], + "ts-node": { + "esm": true + }, + "references": [ + { + "path": "../core" + } + ] +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index a268965..0000000 --- a/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * as serverManeger from "./serverManeger.js"; -export * as Bedrock from "./platform/Bedrock.js"; -export * as Java from "./platform/Java.js"; \ No newline at end of file diff --git a/src/lib/Proprieties.ts b/src/lib/Proprieties.ts deleted file mode 100644 index 2e70eaa..0000000 --- a/src/lib/Proprieties.ts +++ /dev/null @@ -1,43 +0,0 @@ -export default {parse, stringify}; -export type properitiesBase = {[key: string]: string|number|true|false}; - -/** - * Parse Proprieties files and return a map of properties. - * - * @param Proper - String with the properties or similar files - * @returns - */ -export function parse(Proper: string): PropertiesObject { - const ProPri = {}; - const ProperSplit = Proper.replace(/\\\s+?\n/gi, "").split(/\r?\n/).map(Line => Line.trim()).filter(line => /.*(\s+)?\=(\s+)?.*/.test(line) && !/^#/.test(line)); - for (const Line of ProperSplit) { - const LineMatch = Line.match(/^([^\s\=]+)\s*\=(.*)$/); - const key = LineMatch[1].trim(), value = LineMatch[2].trim(); - ProPri[key] = value; - if (ProPri[key] === "true") ProPri[key] = true; - else if (ProPri[key] === "false") ProPri[key] = false; - else if (/^[0-9]+\.[0-9]+/.test(ProPri[key]) && !/^[0-9]+\.[0-9]+\.[0-9]+/.test(ProPri[key])) ProPri[key] = parseFloat(ProPri[key]); - else if (/^[0-9]+/.test(ProPri[key])) ProPri[key] = parseInt(ProPri[key]); - } - return ProPri as PropertiesObject; -} - -/** - * Convert json to properities files. - * - * @param ProPri - String with properties file - * @returns - */ -export function stringify(ProPri: properitiesBase): string { - const Proper = []; - for (const key of Object.keys(ProPri)) { - if (ProPri[key] === null||ProPri[key] === undefined) Proper.push(`${key}=`); - else if (ProPri[key] === true) Proper.push(`${key}=true`); - else if (ProPri[key] === false) Proper.push(`${key}=false`); - else if (typeof ProPri[key] === "number") Proper.push(`${key}=${ProPri[key]}`); - else if (typeof ProPri[key] === "string") Proper.push(`${key}=${ProPri[key]}`); - else if (typeof ProPri[key] === "object") Proper.push(`${key}=${JSON.stringify(ProPri[key])}`); - else console.error(`[Proprieties.stringify] ${key} is not a valid type.`); - } - return Proper.join("\n"); -} \ No newline at end of file diff --git a/src/lib/proxy.ts b/src/lib/proxy.ts deleted file mode 100644 index 7515949..0000000 --- a/src/lib/proxy.ts +++ /dev/null @@ -1,86 +0,0 @@ -import dgram from "node:dgram"; -import net from "node:net"; - -export type proxyUdpToTcpOptions = { - udpType?: dgram.SocketType, - listen?: number, - portListen?: (port: number) => void -}; - -export type proxyTcpToUdpClient = { - udpType?: dgram.SocketType, - listen?: number, - remote: { - host: string, - port: number - }, -}; - -/** - * Transfer packets from UDP to TCP to send through some tunnel that only accepts TCP - * - * This also means that it will also have error transporting the data, so it is not guaranteed to work properly even more when dealing with UDP packets. - */ -export function proxyUdpToTcp(udpPort: number, options?: proxyUdpToTcpOptions) { - const tcpServer = net.createServer(); - tcpServer.on("error", err => console.error(err)); - tcpServer.on("connection", socket => { - const udpClient = dgram.createSocket(options?.udpType||"udp4"); - - // Close Sockets - udpClient.once("close", () => socket.end()); - socket.once("close", () => udpClient.close()); - - // Print error - udpClient.on("error", console.error); - socket.on("error", console.error); - - // Pipe Datas - udpClient.on("message", data => socket.write(data)); - socket.on("data", data => udpClient.send(data)); - - // Connect - udpClient.connect(udpPort); - }); - - // Listen - tcpServer.listen(options?.listen||0, function() { - const addr = this.address(); - if (options?.portListen) options.portListen(addr.port); - console.debug("bds proxy port listen, %s, (udp -> tcp)", addr.port); - tcpServer.once("close", () => console.debug("bds proxy close, %s", addr.port)); - }); - - return tcpServer; -} - -export function proxyTcpToUdp(options: proxyTcpToUdpClient) { - const sessions: {[keyIP: string]: net.Socket} = {}; - const udp = dgram.createSocket(options?.udpType||"udp4"); - - udp.on("error", console.error); - udp.on("message", (msg, ipInfo) => { - const keyInfo = `${ipInfo.address}:${ipInfo.port}`; - - // Client TCP - if (!sessions[keyInfo]) { - sessions[keyInfo] = net.createConnection(options.remote); - sessions[keyInfo].on("data", data => udp.send(data, ipInfo.port, ipInfo.address)); - sessions[keyInfo].on("error", console.error); - sessions[keyInfo].once("close", () => { - delete sessions[keyInfo]; - console.log("Client %s:%f close", ipInfo.address, ipInfo.port); - }); - console.log("Client %s:%f connected", ipInfo.address, ipInfo.port); - } - - // Send message - sessions[keyInfo].write(msg); - }); - - // Listen port - udp.bind(options.listen||0, function(){ - const addr = this.address(); - console.log("Port listen, %s (tcp -> udp)", addr.port); - }); -} \ No newline at end of file diff --git a/src/lib/randomPort.ts b/src/lib/randomPort.ts deleted file mode 100644 index 37a5eb4..0000000 --- a/src/lib/randomPort.ts +++ /dev/null @@ -1,11 +0,0 @@ -import net from "net" -export async function randomPort(): Promise { - return new Promise((res, rej) => { - const srv = net.createServer(); - srv.listen(0, () => { - const address = srv.address(); - if (typeof address === "string") return rej(new Error("Invalid listen port")); - srv.close((_err) => res(address.port)); - }); - }); -} \ No newline at end of file diff --git a/src/platform/Bedrock.ts b/src/platform/Bedrock.ts deleted file mode 100644 index 1ef073a..0000000 --- a/src/platform/Bedrock.ts +++ /dev/null @@ -1,252 +0,0 @@ -import { createServerManeger, platformPathID, pathOptions, serverConfig } from "../serverManeger.js"; -import { promises as fs, createWriteStream } from "node:fs"; -import { oracleBucket } from "../lib/remote.js"; -import { promisify } from "node:util"; -import { pipeline } from "node:stream/promises"; -import * as childPromisses from "../lib/childPromisses.js"; -import coreUtils from "@sirherobrine23/coreutils"; -import AdmZip from "adm-zip"; -import path from "node:path"; -import tar from "tar"; - -export type bedrockRootOption = pathOptions & { - variant?: "oficial"|"Pocketmine-PMMP"|"Powernukkit"|"Cloudbust" -}; - -export const hostArchEmulate = Object.freeze([ - "qemu-x86_64-static", - "qemu-x86_64", - "box64" -]); - -type bedrockVersionJSON = { - version: string, - date: Date, - release?: "stable"|"preview", - url: { - [platform in NodeJS.Platform]?: { - [arch in NodeJS.Architecture]?: string - } - } -}; - -async function getPHPBin(options?: bedrockRootOption) { - options = {variant: "oficial", ...options}; - const serverPath = await platformPathID("bedrock", options); - const binFolder = path.join(serverPath.serverPath, "bin"); - const files = await coreUtils.Extends.readdir({folderPath: binFolder}); - const file = files.find((v) => v.endsWith("php.exe")||v.endsWith("php")); - if (!file) throw new Error("PHP Bin not found"); - return file; -} - -export async function installServer(version?: string, options?: bedrockRootOption) { - options = {variant: "oficial", ...options}; - const serverPath = await platformPathID("bedrock", options); - if (options?.variant === "Pocketmine-PMMP") { - if (!version) version = "latest"; - const phpBin = ((await oracleBucket.listFiles()) as any[]).filter(({name}) => name.includes("php_bin/")).filter(({name}) => name.includes(process.platform) && name.includes(process.arch)).at(0); - if (!phpBin) throw new Error("PHP Bin not found"); - const binFolder = path.join(serverPath.serverPath, "bin"); - if (await coreUtils.Extends.exists(binFolder)) await fs.rm(binFolder, {recursive: true}); - await fs.mkdir(binFolder); - await pipeline(await oracleBucket.getFileStream(phpBin.name), createWriteStream(path.join(binFolder, "phpTmp"))); - - if (phpBin.name.endsWith(".tar.gz")) { - await tar.extract({ - file: path.join(binFolder, "phpTmp"), - cwd: binFolder - }); - } else if (phpBin.name.endsWith(".zip")) { - await promisify((new AdmZip(path.join(binFolder, "phpTmp"))).extractAllToAsync)(binFolder, true, true); - } - await fs.rm(path.join(binFolder, "phpTmp")); - - const rel = await (await coreUtils.http.Github.GithubManeger("pmmp", "PocketMine-MP")).getRelease(); - const relData = version.trim().toLowerCase() === "latest" ? rel.at(0) : rel.find((v) => v.tag_name === version.trim()); - if (!relData) throw new Error("Version not found"); - const phpAsset = relData.assets.find((a) => a.name.endsWith(".phar"))?.browser_download_url; - if (!phpAsset) throw new Error("PHP asset not found"); - await coreUtils.http.large.saveFile({url: phpAsset, path: path.join(serverPath.serverPath, "PocketMine-MP.phar")}); - - return { - version: relData.tag_name, - releaseDate: new Date(relData.published_at), - release: (relData.prerelease ? "preview" : "stable") as "preview"|"stable", - url: phpAsset, - phpBin: phpBin.name, - }; - } else if (options?.variant === "Powernukkit") { - if (!version) version = "latest"; - const versions = await coreUtils.http.jsonRequest<{version: string, mcpeVersion: string, date: string, url: string, variantType: "snapshot"|"stable"}[]>("https://mcpeversion-static.sirherobrine23.org/powernukkit/all.json").then(data => data.body); - const versionData = version.trim().toLowerCase() === "latest" ? versions.at(-1) : versions.find((v) => v.version === version.trim() || v.mcpeVersion === version.trim()); - if (!versionData) throw new Error("Version not found"); - const url = versionData.url; - if (!url) throw new Error("Platform not supported"); - await coreUtils.http.large.saveFile({url, path: path.join(serverPath.serverPath, "server.jar")}); - return { - version: versionData.version, - mcpeVersion: versionData.mcpeVersion, - variantType: versionData.variantType, - releaseDate: new Date(versionData.date), - url, - }; - } else if (options?.variant === "Cloudbust") { - await coreUtils.http.large.saveFile({ - url: "https://ci.opencollab.dev/job/NukkitX/job/Server/job/bleeding/lastSuccessfulBuild/artifact/target/Cloudburst.jar", - path: path.join(serverPath.serverPath, "server.jar") - }); - - return { - version: "bleeding", - releaseDate: new Date(), - release: "preview", - url: "https://ci.opencollab.dev/job/NukkitX/job/Server/job/bleeding/lastSuccessfulBuild/artifact/target/Cloudburst.jar", - }; - } else { - if (!version) version = "latest"; - const versions = await coreUtils.http.jsonRequest("https://sirherobrine23.github.io/BedrockFetch/all.json").then(data => data.body); - const versionData = version.trim().toLowerCase() === "latest" ? versions.at(-1) : versions.find((v) => v.version === version.trim()); - if (!versionData) throw new Error("Version not found"); - let currentPlatform = process.platform; - if (currentPlatform === "android") currentPlatform = "linux"; - const url = versionData.url[currentPlatform]?.[process.arch]; - if (!url) throw new Error("Platform not supported"); - (await coreUtils.http.large.admZip(url)).zip.extractAllTo(serverPath.serverPath, true, true); - return { - version: versionData.version, - releaseDate: new Date(versionData.date), - release: versionData.release ?? "stable", - url: url - } - } -} - -export async function startServer(options?: bedrockRootOption) { - // Bad fix options - options = {variant: "oficial", ...options}; - const serverPath = await platformPathID("bedrock", options); - // Server Object - const serverExec: serverConfig = { - exec: { - cwd: serverPath.serverPath, - }, - actions: {} - }; - - if (options?.variant === "Pocketmine-PMMP") { - serverExec.exec.exec = await getPHPBin(); - serverExec.exec.args = ["PocketMine-MP.phar", "--no-wizard"]; - serverExec.actions = { - stopServer(child_process) { - child_process.stdin.write("stop\n"); - }, - onStart(lineData, fnRegister) { - if (!(lineData.includes("INFO") && lineData.includes("Done") && lineData.includes("help"))) return; - const doneStart = new Date(); - fnRegister({ - serverAvaible: doneStart, - bootUp: runStart.getTime() - doneStart.getTime() - }); - }, - }; - } else if (options?.variant === "Powernukkit" || options?.variant === "Cloudbust") { - serverExec.exec.exec = "java"; - serverExec.exec.args = [ - "-XX:+UseG1GC", - "-XX:+ParallelRefProcEnabled", - "-XX:MaxGCPauseMillis=200", - "-XX:+UnlockExperimentalVMOptions", - "-XX:+DisableExplicitGC", - "-XX:+AlwaysPreTouch", - "-XX:G1NewSizePercent=30", - "-XX:G1MaxNewSizePercent=40", - "-XX:G1HeapRegionSize=8M", - "-XX:G1ReservePercent=20", - "-XX:G1HeapWastePercent=5", - "-XX:G1MixedGCCountTarget=4", - "-XX:InitiatingHeapOccupancyPercent=15", - "-XX:G1MixedGCLiveThresholdPercent=90", - "-XX:G1RSetUpdatingPauseTimePercent=5", - "-XX:SurvivorRatio=32", - "-XX:+PerfDisableSharedMem", - "-XX:MaxTenuringThreshold=1", - "-Dusing.aikars.flags=https://mcflags.emc.gs", - "-Daikars.new.flags=true", - "-jar", "server.jar" - ]; - serverExec.actions = { - stopServer(child_process) { - child_process.stdin.write("stop\n"); - }, - onStart(lineData, fnRegister) { - if (!(lineData.includes("INFO") && lineData.includes("Done") && lineData.includes("help"))) return; - const doneStart = new Date(); - fnRegister({ - serverAvaible: doneStart, - bootUp: runStart.getTime() - doneStart.getTime() - }); - }, - }; - } else { - if (process.platform === "win32") serverExec.exec.exec = "bedrock_server.exe"; - else if (process.platform === "darwin") throw new Error("MacOS is not supported, run in Docker or Virtual Machine"); - else { - serverExec.exec.exec = path.join(serverPath.serverPath, "bedrock_server"); - serverExec.exec.env = { - LD_LIBRARY_PATH: serverPath.serverPath - }; - } - if ((["android", "linux"]).includes(process.platform) && process.arch !== "x64") { - const exec = serverExec.exec.exec; - serverExec.exec.exec = undefined; - for (const command of hostArchEmulate) { - if (await childPromisses.commandExists(command, true)) { - serverExec.exec.args = [exec]; - serverExec.exec.exec = command; - break; - } - if (!serverExec.exec.exec) throw new Error("No emulator found for this platform"); - } - } - - const startTest = /\[.*\]\s+Server\s+started\./; - // Server actions - serverExec.actions = { - stopServer(child_process) { - child_process.stdin.write("stop\n"); - }, - onStart(lineData, fnRegister) {if (startTest.test(lineData)) fnRegister({serverAvaible: new Date()});}, - playerActions(lineData, fnRegister) { - const playerActionsV1 = /\[.*\]\s+Player\s+((dis|)connected):\s+(.*),\s+xuid:\s+([0-9]+)/; - const newPlayerActions = /\[.*INFO\]\s+Player\s+(Spawned|connected|disconnected):\s+([\s\S\w]+)\s+(xuid:\s+([0-9]+))?/; - const connectTime = new Date(); - if (!(newPlayerActions.test(lineData)||playerActionsV1.test(lineData))) return; - let playerName: string, action: string, xuid: string; - if (newPlayerActions.test(lineData)) { - const [, actionV2,, playerNameV2,, xuidV2] = lineData.match(newPlayerActions); - playerName = playerNameV2; - action = actionV2; - xuid = xuidV2; - } else { - const [, actionV1,, playerNameV1, xuidV1] = lineData.match(newPlayerActions); - playerName = playerNameV1; - action = actionV1; - xuid = xuidV1; - } - fnRegister({ - player: playerName, - action: action === "Spawned" ? "spawned" : action === "connected" ? "join" : "leave", - actionDate: connectTime, - sessionID: serverPath.id, - more: { - xuid - } - }); - }, - }; - } - - const runStart = new Date(); - return createServerManeger(serverExec); -} \ No newline at end of file diff --git a/src/platform/Java.ts b/src/platform/Java.ts deleted file mode 100644 index ef93514..0000000 --- a/src/platform/Java.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { pathOptions } from "../serverManeger.js"; - -export type javaRootOption = pathOptions & { - variant?: "oficial"|"Spigot"|"Paper"|"Purpur", -}; - -export async function installServer(options?: javaRootOption) { - options = {variant: "oficial", ...options}; - if (options?.variant === "Spigot") { - } else if (options?.variant === "Paper") { - } else if (options?.variant === "Purpur") { - } else {} -} - -export default startServer; -export async function startServer(options?: javaRootOption) {} \ No newline at end of file diff --git a/src/serverManeger.ts b/src/serverManeger.ts deleted file mode 100644 index 72d6deb..0000000 --- a/src/serverManeger.ts +++ /dev/null @@ -1,216 +0,0 @@ -import { createInterface as readline } from "node:readline"; -import { promises as fs } from "node:fs"; -import child_process from "node:child_process"; -import { Cloud, Extends as extendFs } from "@sirherobrine23/coreutils"; -import crypto from "node:crypto"; -import path from "node:path"; -import os from "node:os"; -import EventEmitter from "node:events"; - -export type pathOptions = { - id?: "default"|string, - newId?: boolean, - withBuildFolder?: boolean, -}; - -export let bdsRoot = process.env.BDS_HOME?(process.env.BDS_HOME.startsWith("~")?process.env.BDS_HOME.replace("~", os.homedir()):process.env.BDS_HOME):path.join(os.homedir(), ".bdsManeger"); -export async function platformPathID(platform: "bedrock"|"java", options?: pathOptions) { - if (!(["bedrock", "java"].includes(platform))) throw new Error("Invalid platform target"); - options = {id: "default", ...options}; - const platformRoot = path.join(bdsRoot, platform); - if (!await extendFs.exists(platformRoot)) await fs.mkdir(platformRoot, {recursive: true}); - if (!options) options = {}; - - // Create if not exists - const foldersAndLink = await fs.readdir(platformRoot); - if (foldersAndLink.length === 0) options.newId = true; - if (options.newId) { - options.id = crypto.randomBytes(16).toString("hex"); - fs.mkdir(path.join(platformRoot, options.id), {recursive: true}); - if (await extendFs.exists(path.join(platformRoot, "default"))) await fs.unlink(path.join(platformRoot, "default")); - await fs.symlink(path.join(platformRoot, options.id), path.join(platformRoot, "default")); - } else if (!await extendFs.exists(path.join(platformRoot, options.id))) throw new Error("Folder ID not created!"); - - // Get real id - if (!(/^[A-Za-z0-9]*$/).test(options.id)) throw new Error("Invalid Platform ID"); - if (options?.id === "default") options.id = path.basename(await fs.realpath(path.join(platformRoot, options.id)).catch(async () => (await fs.readdir(platformRoot)).sort().at(0))); - - // Mount Paths - const serverRoot = path.join(platformRoot, options.id); - const serverPath = path.join(serverRoot, "server"); - const hooksPath = path.join(serverRoot, "hooks"); - const backupPath = path.join(serverRoot, "backup"); - const logsPath = path.join(serverRoot, "logs"); - let buildFolder: string; - if (options?.withBuildFolder) buildFolder = path.join(serverRoot, "build"); - - // Create folder if not exists - if (!(await extendFs.exists(serverRoot))) await fs.mkdir(serverRoot, {recursive: true}); - if (!(await extendFs.exists(serverPath))) await fs.mkdir(serverPath, {recursive: true}); - if (!(await extendFs.exists(hooksPath))) await fs.mkdir(hooksPath, {recursive: true}); - if (!(await extendFs.exists(backupPath))) await fs.mkdir(backupPath, {recursive: true}); - if (!(await extendFs.exists(logsPath))) await fs.mkdir(logsPath, {recursive: true}); - if (buildFolder && !(await extendFs.exists(buildFolder))) await fs.mkdir(buildFolder, {recursive: true}); - - return { - id: options?.id, - serverRoot, - serverPath, - hooksPath, - backupPath, - logsPath, - buildFolder, - platformIDs: foldersAndLink - }; -} - -export type playerAction = ({action: "join"|"spawned"|"leave"}|{ - action: "kick"|"ban", - reason?: string, - by?: string -}) & { - player: string, - actionDate: Date, - sessionID: string - more?: any, - latestAction?: playerAction -} - -export type serverConfig = { - exec: { - exec?: string, - args?: string[], - cwd?: string, - env?: NodeJS.ProcessEnv & {[key: string]: string}, - }, - actions?: { - stopServer?: (child_process: child_process.ChildProcess) => void, - onStart?: (lineData: string, fnRegister: (data?: {serverAvaible?: Date, bootUp?: number}) => void) => void, - playerActions?: (lineData: string, fnRegister: (data: playerAction) => void) => void, - }, - maneger?: { - backup?: { - folderWatch: {local: string, remoteParent?: string}[], - } & ({ - cloud: "google", - config: Cloud.googleOptions - }|{ - cloud: "oracle_bucket", - config: Cloud.oracleOptions - }) - } -}; - -declare class serverManeger extends EventEmitter { - on(event: "error", fn: (lineLog: any) => void): this; - once(event: "error", fn: (lineLog: any) => void): this; - emit(event: "error", data: any): boolean; - - on(event: "log", fn: (lineLog: string) => void): this; - once(event: "log", fn: (lineLog: string) => void): this; - emit(event: "log", data: string): boolean; - - on(event: "rawLog", fn: (raw: any) => void): this; - once(event: "rawLog", fn: (raw: any) => void): this; - emit(event: "rawLog", data: any): boolean; - - // Player actions - on(event: "playerAction", fn: (playerAction: playerAction) => void): this; - once(event: "playerAction", fn: (playerAction: playerAction) => void): this; - emit(event: "playerAction", data: playerAction): boolean; - - // Server started - on(event: "serverStarted", fn: (data: {serverAvaible: Date, bootUp: number}) => void): this; - once(event: "serverStarted", fn: (data: {serverAvaible: Date, bootUp: number}) => void): this; - emit(event: "serverStarted", data: {serverAvaible: Date, bootUp: number}): boolean; -} - -export async function createServerManeger(serverOptions: serverConfig): Promise { - const internalStops: (() => any|void)[] = []; - if (serverOptions?.maneger?.backup) { - const { folderWatch, cloud } = serverOptions?.maneger?.backup; - if (cloud === "oracle_bucket") { - const { config } = serverOptions?.maneger?.backup; - const ociClient = await Cloud.oracleBucket(config); - for await (const folder of folderWatch) { - ociClient; - folder; - } - } - } - const serverExec = child_process.execFile(serverOptions.exec.exec, serverOptions.exec.args ?? [], { - cwd: serverOptions.exec.cwd, - windowsHide: true, - maxBuffer: Infinity, - env: { - ...process.env, - ...serverOptions.exec.env - }, - }); - const playerActions: playerAction[] = []; - const internalEvent = new class serverManeger extends EventEmitter { - async stopServer() { - const stopServer = serverOptions.actions?.stopServer ?? ((child_process) => child_process.kill("SIGKILL")); - await Promise.resolve(stopServer(serverExec)).catch(err => internalEvent.emit("error", err)); - internalStops.forEach((fn) => Promise.resolve().then(() => fn()).catch(err => internalEvent.emit("error", err))); - } - - getPlayers() { - return playerActions ?? []; - } - }; - serverExec.on("error", internalEvent.emit.bind(internalEvent, "error")); - const stdoutReadline = readline({input: serverExec.stdout}); - stdoutReadline.on("line", (line) => internalEvent.emit("log", line)); - stdoutReadline.on("error", internalEvent.emit.bind(internalEvent, "error")); - serverExec.stdout.on("data", (data) => internalEvent.emit("rawLog", data)); - - const stderrReadline = readline({input: serverExec.stderr}); - stderrReadline.on("line", (line) => internalEvent.emit("log", line)); - stderrReadline.on("error", internalEvent.emit.bind(internalEvent, "error")); - serverExec.stderr.on("data", (data) => internalEvent.emit("rawLog", data)); - - // Server start - if (serverOptions.actions?.onStart) { - const serverStartFN = serverOptions.actions.onStart; - let lock = false; - const started = new Date(); - async function register(data?: {serverAvaible?: Date, bootUp?: number}) { - if (lock) return; - const eventData = { - serverAvaible: data?.serverAvaible ?? new Date(), - bootUp: data?.bootUp ?? new Date().getTime() - started.getTime() - }; - internalEvent.emit("serverStarted", eventData); - lock = true; - stderrReadline.removeListener("line", register); - stdoutReadline.removeListener("line", register); - // emit and remove new listener for serverStarted - internalEvent.removeAllListeners("serverStarted"); - internalEvent.prependListener("serverStarted", () => { - internalEvent.emit("serverStarted", eventData); - internalEvent.removeAllListeners("serverStarted"); - }); - } - stdoutReadline.on("line", (line) => serverStartFN(line, register)); - stderrReadline.on("line", (line) => serverStartFN(line, register)); - } - - // Player actions - if (serverOptions.actions?.playerActions) { - const playerFn = serverOptions.actions.playerActions; - const registerData = (data: playerAction) => { - const player = playerActions.find((player) => player.player === data.player); - if (!player) playerActions.push(data); - else { - data.latestAction = player; - playerActions[playerActions.indexOf(player)] = data; - } - internalEvent.emit("playerAction", data); - } - stdoutReadline.on("line", (line) => playerFn(line, registerData)); - stderrReadline.on("line", (line) => playerFn(line, registerData)); - } - - return internalEvent; -} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 9ad0311..dbefa53 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,22 +4,21 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "target": "ESNext", + "forceConsistentCasingInFileNames": true, "declaration": true, "strict": false, - "forceConsistentCasingInFileNames": true, "noUnusedLocals": true, + "isolatedModules": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "skipLibCheck": true, "allowJs": true, - "lib": ["ES6"] + "lib": [ + "ESNext" + ] }, - "include": [ - "src/**/*" - ], "exclude": [ - "src/**/*.test.ts", - "node_modules/**/*" + "**/*.test.ts" ], "ts-node": { "esm": true -- 2.45.2 From f2d252715bd2483a53dc5e11c5280f2eaa4d453f Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Wed, 22 Feb 2023 01:03:50 -0300 Subject: [PATCH 2/3] add java --- package/core/src/servers/bedrock.ts | 3 +- package/core/src/servers/java.ts | 85 ++++++++++++++++++++++++++++- 2 files changed, 83 insertions(+), 5 deletions(-) diff --git a/package/core/src/servers/bedrock.ts b/package/core/src/servers/bedrock.ts index 1899ae5..e98d454 100644 --- a/package/core/src/servers/bedrock.ts +++ b/package/core/src/servers/bedrock.ts @@ -15,7 +15,6 @@ export type bedrockOptions = manegerOptions & { * Servidor alternativo ao invés do servidor ofical da Mojang */ altServer?: "pocketmine"|"powernukkit"|"cloudbust", - allowBeta?: boolean }; const pocketmineGithub = await Github.GithubManeger("pmmp", "PocketMine-MP"); @@ -61,7 +60,7 @@ export async function listVersions(options?: Omit("https://sirherobrine23.github.io/BedrockFetch/all.json")).body; } -export async function installServer(options: bedrockOptions & {version?: string}): Promise<{id: string, version: string, mcpeVersion?: string, releaseDate: Date}> { +export async function installServer(options: bedrockOptions & {version?: string, allowBeta?: boolean}): Promise<{id: string, version: string, mcpeVersion?: string, releaseDate: Date}> { const serverPath = await serverManeger(options); if (options.altServer === "pocketmine") { const version = (options.version ?? "latest").trim(); diff --git a/package/core/src/servers/java.ts b/package/core/src/servers/java.ts index 648f812..8c7a2d7 100644 --- a/package/core/src/servers/java.ts +++ b/package/core/src/servers/java.ts @@ -1,9 +1,88 @@ -import { manegerOptions } from "../serverManeger.js"; +import { manegerOptions, serverManeger } from "../serverManeger.js"; +import coreHttp, { large } from "@sirherobrine23/http"; +import utils from "node:util"; +import path from "node:path"; export type javaOptions = manegerOptions & { /** * Servidor alternativo ao invés do servidor ofical da Mojang */ - altServer?: "spigot"|"paper"|"purpur", - allowBeta?: boolean + altServer?: "spigot"|"paper"|"purpur" }; + +export async function listVersions(options: Omit) { + if (options.altServer === "purpur") { + return Promise.all((await coreHttp.jsonRequest<{versions: string[]}>("https://api.purpurmc.org/v2/purpur")).body.versions.map(async version => ({ + version, + downloadUrl: utils.format("https://api.purpurmc.org/v2/purpur/%s/latest/download", version), + date: new Date((await coreHttp.jsonRequest<{timestamp: number}>(utils.format("https://api.purpurmc.org/v2/purpur/%s/latest", version))).body.timestamp) + }))); + } else if (options.altServer === "paper") { + return Promise.all((await coreHttp.jsonRequest<{versions: string[]}>("https://api.papermc.io/v2/projects/paper")).body.versions.map(async version => { + const build = (await coreHttp.jsonRequest<{builds: number[]}>(utils.format("https://api.papermc.io/v2/projects/paper/versions/%s", version))).body.builds.at(-1); + const data = (await coreHttp.jsonRequest<{time: string, downloads: {[k: string]: {name: string, sha256: string}}}>(utils.format("https://api.papermc.io/v2/projects/paper/versions/%s/builds/%s", version, build))).body; + + return { + version, + date: new Date(data.time), + downloadUrl: utils.format("https://api.papermc.io/v2/projects/paper/versions/%s/builds/%s/downloads/%s", version, build, data.downloads["application"].name) + } + })); + } else if (options.altServer === "spigot") { + throw new Error("Não foi implementado!"); + } + return (await Promise.all((await coreHttp.jsonRequest<{versions: {id: string, releaseTime: string, url: string}[]}>("https://launchermeta.mojang.com/mc/game/version_manifest_v2.json")).body.versions.map(async data => ({ + version: data.id, + date: new Date(data.releaseTime), + downloadUrl: (await coreHttp.jsonRequest<{downloads: {[k: string]: {size: number, url: string}}}>(data.url)).body.downloads?.["server"]?.url + })))).filter(a => !!a.downloadUrl); +} + +export async function installServer(options: javaOptions & {version?: string}) { + const serverPath = await serverManeger(options); + const version = (await listVersions(options)).find(rel => (!options.version || options.version === "latest" || rel.version === options.version)); + if (!version) throw new Error("Não existe a versão informada!"); + await large.saveFile({ + path: path.join(serverPath.serverFolder, "server.jar"), + url: version.downloadUrl + }); + return { + ...version, + id: serverPath.id, + }; +} + +export async function startServer(options: javaOptions) { + const serverPath = await serverManeger(options); + return serverPath.runCommand({ + command: "java", + args: [ + "-XX:+UseG1GC", + "-XX:+ParallelRefProcEnabled", + "-XX:MaxGCPauseMillis=200", + "-XX:+UnlockExperimentalVMOptions", + "-XX:+DisableExplicitGC", + "-XX:+AlwaysPreTouch", + "-XX:G1NewSizePercent=30", + "-XX:G1MaxNewSizePercent=40", + "-XX:G1HeapRegionSize=8M", + "-XX:G1ReservePercent=20", + "-XX:G1HeapWastePercent=5", + "-XX:G1MixedGCCountTarget=4", + "-XX:InitiatingHeapOccupancyPercent=15", + "-XX:G1MixedGCLiveThresholdPercent=90", + "-XX:G1RSetUpdatingPauseTimePercent=5", + "-XX:SurvivorRatio=32", + "-XX:+PerfDisableSharedMem", + "-XX:MaxTenuringThreshold=1", + "-Dusing.aikars.flags=https://mcflags.emc.gs", + "-Daikars.new.flags=true", + "-jar", "server.jar", + ], + serverActions: { + stop(child) { + child.sendCommand("stop"); + }, + } + }); +} \ No newline at end of file -- 2.45.2 From 1f27b7006239f4009bbab8a178b2043c0638e5c3 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Wed, 22 Feb 2023 01:20:17 -0300 Subject: [PATCH 3/3] add php and spigot CI --- .github/uploadToBucket.mjs | 23 +++ .github/workflows/phpBuild.yaml | 221 +++++++++++++++++++++++++++++ .github/workflows/spigotBuild.yaml | 112 +++++++++++++++ .gitignore | 5 +- 4 files changed, 360 insertions(+), 1 deletion(-) create mode 100644 .github/uploadToBucket.mjs create mode 100644 .github/workflows/phpBuild.yaml create mode 100644 .github/workflows/spigotBuild.yaml diff --git a/.github/uploadToBucket.mjs b/.github/uploadToBucket.mjs new file mode 100644 index 0000000..589ee9a --- /dev/null +++ b/.github/uploadToBucket.mjs @@ -0,0 +1,23 @@ +#!/usr/bin/env node +import { createReadStream } from "fs"; +import { oracleBucket } from "@sirherobrine23/cloud"; +import extendsFS from "@sirherobrine23/extends"; +import path from "node:path"; + +const [,, remote, local] = process.argv; +const bucket = await oracleBucket.oracleBucket({ + region: "sa-saopaulo-1", + namespace: "grwodtg32n4d", + name: "bdsFiles", + auth: { + type: "preAuthentication", + // Public auth (No write enabled). + PreAuthenticatedKey: process.env.OCI_AUTHKEY + } +}); + +for await (const file of await extendsFS.readdir(path.resolve(process.cwd(), local))) { + console.log("Uploading %O", file); + await bucket.uploadFile(path.posix.resolve("/", remote ?? "", path.basename(file)), createReadStream(file)); + console.log("Success %O", file); +} \ No newline at end of file diff --git a/.github/workflows/phpBuild.yaml b/.github/workflows/phpBuild.yaml new file mode 100644 index 0000000..60a1f07 --- /dev/null +++ b/.github/workflows/phpBuild.yaml @@ -0,0 +1,221 @@ +name: PHP build +on: + workflow_dispatch: + schedule: + - cron: "0 0 */2 * 0" + +jobs: + # Android Build arm64 + android: + runs-on: ubuntu-latest + name: Android + steps: + - name: Clone Repository + uses: actions/checkout@v3 + with: + repository: pmmp/php-build-scripts + submodules: true + + - name: Cache musl + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-android_musl + path: muslCrossMake + + - name: Build musl to android + env: + DEBIAN_FRONTEND: "noninteractive" + run: | + set -ex + sudo apt update + sudo apt -y install build-essential curl make autoconf automake libtool m4 wget gzip bzip2 bison g++ git cmake pkg-config re2c libtool* unzip zip tar + + # Build musl + if ! [[ -d muslCrossMake ]];then + mkdir muslCrossMake + INITIAL_PATH="$(pwd)" + cd muslCrossMake + git clone https://github.com/pmmp/musl-cross-make.git ./ + (echo "TARGET = aarch64-linux-musl"; echo "OUTPUT = /usr/local") > config.mak + make + sudo make install -j$(nproc) + else + cd muslCrossMake + sudo make install -j$(nproc) + fi + + - name: "Building php bin" + continue-on-error: true + timeout-minutes: 40 + run: | + ./compile.sh -t android-aarch64 -x -f -g -j$(nproc) + # Compress files + cd bin/php*/ + pwd + # ZIP + zip -r "${{ github.workspace }}/android_arm64.zip" * + # tar + tar -czf "${{ github.workspace }}/android_arm64.tar.gz" * + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: android_arm64 + path: "*.tar.gz" + + # Linux Build + linux: + strategy: + fail-fast: false + matrix: + target: + - ubuntu-latest + - arm64 + name: "Linux - ${{ matrix.target }}" + runs-on: ${{ matrix.target }} + steps: + - name: Clone Repository + uses: actions/checkout@v3 + with: + repository: pmmp/php-build-scripts + submodules: true + + - name: Install tools and dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake pkg-config make autoconf automake libtool libtool-bin m4 wget libc-bin gzip bzip2 bison g++ git re2c zip tar + + - name: Compile PHP + continue-on-error: true + timeout-minutes: 40 + run: | + set -ex + ./compile.sh -j 4 -f -g -s + + # Compress files + cd bin/php*/ + pwd + # ZIP + zip -r "${{ github.workspace }}/linux_${{ runner.arch }}.zip" * + # tar + tar -czf "${{ github.workspace }}/linux_${{ runner.arch }}.tar.gz" * + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: linux_${{ runner.arch }} + path: | + *.tar.gz + *.zip + + # MacOS Build + macos: + runs-on: macos-11 + name: MacOS + steps: + - name: Clone Repository + uses: actions/checkout@v3 + with: + repository: pmmp/php-build-scripts + submodules: true + + - name: Install dependecies + run: brew install libtool autoconf automake pkg-config bison re2c + + - name: "Building php" + continue-on-error: true + timeout-minutes: 40 + run: | + export PATH="/usr/local/opt/bison/bin:$PATH" + set -ex + trap "exit 1" ERR + ./compile.sh -j4 -f -g || (cat *.log && exit 1) + + - name: Create tarballs + run: | + cd bin/*/ + pwd + # ZIP + zip -r "${{ github.workspace }}/darwin_${{ runner.arch }}.zip" * + # tar + tar -czf "${{ github.workspace }}/darwin_${{ runner.arch }}.tar.gz" * + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: darwin_${{ runner.arch }} + path: | + *.tar.gz + *.zip + + # Windows build + win32: + runs-on: windows-2019 + name: Windows + steps: + - name: Clone Repository + uses: actions/checkout@v3 + with: + repository: pmmp/php-build-scripts + submodules: true + + - name: Windows Depencies Install + run: choco install --no-progress wget + + - name: "Building php bin" + run: .\windows-compile-vs.bat + env: + VS_EDITION: Enterprise + SOURCES_PATH: ${{ github.workspace }}\pocketmine-php-sdk + + - name: show log + run: type compile.log + + - name: Rename files + shell: node {0} + run: | + const fs = require("fs"); + const path = require("path"); + const files = fs.readdirSync(process.cwd()).filter(file => file.endsWith(".zip")); + for (const zip of files) { + console.log("File:", path.join(process.cwd(), zip)); + if (/debug/i.test(zip)) fs.rmSync(path.join(process.cwd(), zip)); + else fs.renameSync(path.join(process.cwd(), zip), path.join(process.cwd(), "win32_x64.zip")); + } + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: Windows + path: "*.zip" + + # Upload to bucket + upload: + runs-on: ubuntu-latest + needs: + - win32 + - macos + - linux + - android + steps: + - uses: actions/checkout@v3 + name: Code checkout + + - uses: actions/setup-node@v3.6.0 + name: Setup node.js + with: + node-version: latest + + - name: Install node depencies + run: npm install --no-save + + - name: Download tarbals + uses: actions/download-artifact@v3 + with: + path: ./phpOutput + + - name: Upload to bucket + run: node .github/uploadphp/index.mjs php_bin phpOutput + timeout-minutes: 25 + env: + OCI_AUTHKEY: ${{ secrets.OCI_AUTHKEY }} \ No newline at end of file diff --git a/.github/workflows/spigotBuild.yaml b/.github/workflows/spigotBuild.yaml new file mode 100644 index 0000000..13ed0b0 --- /dev/null +++ b/.github/workflows/spigotBuild.yaml @@ -0,0 +1,112 @@ +name: Spigot Build +on: + workflow_dispatch: + schedule: + - cron: "0 0 */2 * 0" + push: + branches: + - main + paths: + - ".github/workflows/spigotBuild.yaml" + - ".github/spigotBuilld/**/*" + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + version: + - latest + - "1.19.2" + - "1.19.1" + - "1.19" + - "1.18.2" + - "1.18.1" + - "1.18-rc3" + - "1.18-pre8" + - "1.18-pre5" + - "1.18" + - "1.17.1" + - "1.17" + - "1.16.5" + - "1.16.4" + - "1.16.3" + - "1.16.2" + - "1.16.1" + - "1.15.2" + - "1.15.1" + - "1.15" + - "1.14.4" + - "1.14.3-pre4" + - "1.14.3" + - "1.14.2" + - "1.14.1" + - "1.14-pre5" + - "1.14" + - "1.13.2" + - "1.13.1" + - "1.13-pre7" + - "1.13" + - "1.12.2" + - "1.12.1" + - "1.12" + - "1.11.2" + - "1.11.1" + - "1.11" + - "1.10.2" + - "1.10" + - "1.9.4" + - "1.9.2" + - "1.9" + - "1.8.8" + - "1.8.7" + - "1.8.6" + - "1.8.5" + - "1.8.4" + - "1.8.3" + - "1.8" + steps: + - name: Install ${{ startsWith(matrix.version, 'latest') && '19' || (startsWith(matrix.version, '1.19')||startsWith(matrix.version, '1.18')) && '17' || startsWith(matrix.version, '1.17') && '16' || '8' }} java + uses: actions/setup-java@v3 + continue-on-error: true + with: + distribution: liberica + java-version: ${{ (startsWith(matrix.version, 'latest')||startsWith(matrix.version, '1.19')||startsWith(matrix.version, '1.18')) && '17' || startsWith(matrix.version, '1.17') && '16' || '8' }} + + - name: Build + continue-on-error: true + run: | + wget -qO build.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar + java -jar build.jar --rev "${{ matrix.version || 'latest' }}" + + - name: Upload to actifial + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.version || 'latest' }} + path: "*.jar" + + # Upload + upload: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v3 + name: Code checkout + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: latest + + - name: Install node depencies + run: npm install --no-save + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: Upload to actifial + run: node .github/uploadToBucket.ts SpigotBuild artifacts + env: + OCI_AUTHKEY: ${{ secrets.OCI_AUTHKEY }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 251e766..33deb68 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ node_modules/ # Typescript packages/**/*.js -packages/**/*.d.ts \ No newline at end of file +packages/**/*.d.ts + +# PHP Pre builds +phpOutput/ \ No newline at end of file -- 2.45.2