From c5f13306ede59f2c72c21256796387efb0262ca5 Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Sun, 1 Sep 2024 14:05:01 +0530 Subject: [PATCH] chore: Housekeeping --- apps/api/package-lock.json | 1755 +++++++++++++++++ apps/api/src/socket/change-notifier.socket.ts | 21 +- apps/cli/.swcrc | 50 +- apps/cli/package-lock.json | 534 +++++ apps/cli/package.json | 11 +- apps/cli/src/commands/base.command.ts | 2 +- .../environment/delete.environment.ts | 2 +- .../commands/environment/get.environment.ts | 2 +- .../environment/update.environment.ts | 2 +- apps/cli/src/commands/profile/list.profile.ts | 21 +- apps/cli/src/commands/run.command.ts | 72 +- apps/cli/src/http/auth.ts | 25 - apps/cli/src/http/index.ts | 5 - apps/cli/src/http/project.ts | 0 apps/cli/src/http/secret.ts | 28 - apps/cli/src/http/variable.ts | 28 - apps/cli/src/index.ts | 10 +- apps/cli/tsconfig.json | 26 +- package.json | 6 +- packages/api-client/package.json | 3 +- packages/api-client/src/controllers/secret.ts | 7 +- .../api-client/src/controllers/variable.ts | 7 +- packages/api-client/src/index.ts | 14 +- .../api-client/src/types/secret.types.d.ts | 9 +- .../api-client/src/types/variable.types.d.ts | 11 +- packages/api-client/tsconfig.json | 13 +- pnpm-lock.yaml | 69 +- 27 files changed, 2512 insertions(+), 221 deletions(-) create mode 100644 apps/api/package-lock.json create mode 100644 apps/cli/package-lock.json delete mode 100644 apps/cli/src/http/auth.ts delete mode 100644 apps/cli/src/http/index.ts delete mode 100644 apps/cli/src/http/project.ts delete mode 100644 apps/cli/src/http/secret.ts delete mode 100644 apps/cli/src/http/variable.ts diff --git a/apps/api/package-lock.json b/apps/api/package-lock.json new file mode 100644 index 00000000..cfc3d73c --- /dev/null +++ b/apps/api/package-lock.json @@ -0,0 +1,1755 @@ +{ + "name": "api", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "api", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/config": "^3.2.0", + "@nestjs/core": "^10.0.0", + "@nestjs/jwt": "^10.2.0", + "@nestjs/passport": "^10.0.3", + "@nestjs/platform-express": "^10.0.0", + "@nestjs/platform-fastify": "^10.3.3", + "@nestjs/platform-socket.io": "^10.3.7", + "@nestjs/schedule": "^4.0.1", + "@nestjs/swagger": "^7.3.0", + "@nestjs/websockets": "^10.3.7", + "@socket.io/redis-adapter": "^8.3.0", + "@supabase/supabase-js": "^2.39.6", + "class-transformer": "^0.5.1", + "class-validator": "^0.14.1", + "cookie-parser": "^1.4.6", + "eccrypto": "^1.1.6", + "minio": "^8.0.0", + "nodemailer": "^6.9.9", + "passport-github2": "^0.1.12", + "passport-gitlab2": "^5.0.0", + "passport-google-oauth20": "^2.0.0", + "redis": "^4.6.13", + "rxjs": "^7.8.1", + "socket.io": "^4.7.5", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@nestjs/cli": "^10.0.0", + "@nestjs/schematics": "^10.0.0", + "@nestjs/testing": "^10.0.0", + "@prisma/client": "^5.13.0", + "@types/cookie-parser": "^1.4.7", + "@types/eccrypto": "^1.1.6", + "@types/express": "^4.17.17", + "@types/multer": "^1.4.11", + "@types/supertest": "^6.0.0", + "@types/uuid": "^9.0.8", + "ajv": "^7", + "dotenv-cli": "^7.4.2", + "jest": "^29.5.0", + "jest-mock-extended": "^3.0.5", + "prettier": "^3.0.0", + "prisma": "5.13.0", + "reflect-metadata": "^0.2.2", + "source-map-support": "^0.5.21", + "supertest": "^6.3.3", + "ts-jest": "^29.1.0", + "ts-loader": "^9.4.3" + } + }, + "../../node_modules/.pnpm/@nestjs+cli@10.4.2_@swc+cli@0.4.0_@swc+core@1.7.3_chokidar@3.6.0__@swc+core@1.7.3/node_modules/@nestjs/cli": { + "version": "10.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.8", + "@angular-devkit/schematics": "17.3.8", + "@angular-devkit/schematics-cli": "17.3.8", + "@nestjs/schematics": "^10.0.1", + "chalk": "4.1.2", + "chokidar": "3.6.0", + "cli-table3": "0.6.5", + "commander": "4.1.1", + "fork-ts-checker-webpack-plugin": "9.0.2", + "glob": "10.4.2", + "inquirer": "8.2.6", + "node-emoji": "1.11.0", + "ora": "5.4.1", + "tree-kill": "1.2.2", + "tsconfig-paths": "4.2.0", + "tsconfig-paths-webpack-plugin": "4.1.0", + "typescript": "5.3.3", + "webpack": "5.92.1", + "webpack-node-externals": "3.0.0" + }, + "bin": { + "nest": "bin/nest.js" + }, + "devDependencies": { + "@commitlint/cli": "19.3.0", + "@commitlint/config-angular": "19.3.0", + "@swc/cli": "0.4.0", + "@swc/core": "1.6.7", + "@types/inquirer": "9.0.3", + "@types/jest": "29.5.12", + "@types/node": "20.14.9", + "@types/node-emoji": "1.8.2", + "@types/webpack-node-externals": "3.0.4", + "@typescript-eslint/eslint-plugin": "7.15.0", + "@typescript-eslint/parser": "7.15.0", + "delete-empty": "3.0.0", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "gulp": "5.0.0", + "gulp-clean": "0.4.0", + "husky": "9.0.11", + "jest": "29.7.0", + "lint-staged": "15.2.7", + "prettier": "3.3.2", + "release-it": "17.4.1", + "ts-jest": "29.1.5", + "ts-loader": "9.5.1", + "ts-node": "10.9.2" + }, + "engines": { + "node": ">= 16.14" + }, + "peerDependencies": { + "@swc/cli": "^0.1.62 || ^0.3.0 || ^0.4.0", + "@swc/core": "^1.3.62" + }, + "peerDependenciesMeta": { + "@swc/cli": { + "optional": true + }, + "@swc/core": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_reflect-metadata@0.2.2_rxjs@7.8.1/node_modules/@nestjs/common": { + "version": "10.3.10", + "license": "MIT", + "dependencies": { + "iterare": "1.2.1", + "tslib": "2.6.3", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "class-transformer": "*", + "class-validator": "*", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@nestjs+config@3.2.3_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_g5lwdyyg5rxaj4lwyvjoifnhui/node_modules/@nestjs/config": { + "version": "3.2.3", + "license": "MIT", + "dependencies": { + "dotenv": "16.4.5", + "dotenv-expand": "10.0.0", + "lodash": "4.17.21" + }, + "devDependencies": { + "@commitlint/cli": "19.3.0", + "@commitlint/config-angular": "19.3.0", + "@nestjs/common": "10.3.10", + "@nestjs/core": "10.3.10", + "@nestjs/platform-express": "10.3.10", + "@nestjs/testing": "10.3.10", + "@types/jest": "29.5.12", + "@types/lodash": "4.17.6", + "@types/node": "20.14.9", + "@typescript-eslint/eslint-plugin": "7.14.1", + "@typescript-eslint/parser": "7.14.1", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.29.1", + "husky": "9.0.11", + "jest": "29.7.0", + "joi": "17.13.3", + "lint-staged": "15.2.7", + "prettier": "3.3.2", + "reflect-metadata": "0.2.2", + "release-it": "17.4.1", + "rimraf": "5.0.7", + "rxjs": "7.8.1", + "ts-jest": "29.1.5", + "typescript": "5.5.2" + }, + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "rxjs": "^7.1.0" + } + }, + "../../node_modules/.pnpm/@nestjs+core@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_tva4fjl6oyedawmhdxireoguqa/node_modules/@nestjs/core": { + "version": "10.3.10", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@nuxtjs/opencollective": "0.3.2", + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "3.2.0", + "tslib": "2.6.3", + "uid": "2.0.2" + }, + "devDependencies": { + "@nestjs/common": "10.3.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/microservices": "^10.0.0", + "@nestjs/platform-express": "^10.0.0", + "@nestjs/websockets": "^10.0.0", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + }, + "@nestjs/websockets": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@nestjs+jwt@10.2.0_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_refl_5mpbonfurgfqq5cjey6jllxpuy/node_modules/@nestjs/jwt": { + "version": "10.2.0", + "license": "MIT", + "dependencies": { + "@types/jsonwebtoken": "9.0.5", + "jsonwebtoken": "9.0.2" + }, + "devDependencies": { + "@commitlint/cli": "18.2.0", + "@commitlint/config-angular": "18.1.0", + "@nestjs/common": "10.2.8", + "@nestjs/core": "10.2.8", + "@nestjs/testing": "10.2.8", + "@types/jest": "29.5.8", + "@types/node": "20.9.0", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", + "eslint": "8.53.0", + "eslint-config-prettier": "9.0.0", + "eslint-plugin-import": "2.29.0", + "husky": "8.0.3", + "jest": "29.7.0", + "lint-staged": "15.0.2", + "prettier": "3.0.3", + "reflect-metadata": "0.1.13", + "release-it": "16.2.1", + "rxjs": "7.8.1", + "ts-jest": "29.1.1", + "typescript": "5.2.2" + }, + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0" + } + }, + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_e3j2olz5znbylg5qzqinge5uvy/node_modules/@nestjs/passport": { + "version": "10.0.3", + "license": "MIT", + "devDependencies": { + "@commitlint/cli": "18.4.3", + "@commitlint/config-angular": "18.4.3", + "@nestjs/common": "10.2.10", + "@nestjs/core": "10.2.10", + "@nestjs/jwt": "10.2.0", + "@nestjs/platform-express": "10.2.10", + "@nestjs/testing": "10.2.10", + "@types/jest": "29.5.10", + "@types/node": "20.10.3", + "@types/passport": "1.0.16", + "@types/passport-jwt": "3.0.13", + "@types/passport-local": "1.0.38", + "@typescript-eslint/eslint-plugin": "6.13.1", + "@typescript-eslint/parser": "6.13.1", + "eslint": "8.55.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.29.0", + "husky": "8.0.3", + "jest": "29.7.0", + "lint-staged": "15.2.0", + "pactum": "3.5.1", + "passport": "0.7.0", + "passport-jwt": "4.0.1", + "passport-local": "1.0.0", + "prettier": "3.1.0", + "reflect-metadata": "0.1.13", + "release-it": "17.0.0", + "rimraf": "5.0.5", + "rxjs": "7.8.1", + "ts-jest": "29.1.1", + "typescript": "5.3.2" + }, + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "passport": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0" + } + }, + "../../node_modules/.pnpm/@nestjs+platform-express@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validat_3kvif5spq7wvxhs5bkoxkrybjm/node_modules/@nestjs/platform-express": { + "version": "10.3.10", + "license": "MIT", + "dependencies": { + "body-parser": "1.20.2", + "cors": "2.8.5", + "express": "4.19.2", + "multer": "1.4.4-lts.1", + "tslib": "2.6.3" + }, + "devDependencies": { + "@nestjs/common": "10.3.10", + "@nestjs/core": "10.3.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0" + } + }, + "../../node_modules/.pnpm/@nestjs+platform-fastify@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validat_nefnr24blwc67xbn5rqrmimqny/node_modules/@nestjs/platform-fastify": { + "version": "10.3.10", + "license": "MIT", + "dependencies": { + "@fastify/cors": "9.0.1", + "@fastify/formbody": "7.4.0", + "@fastify/middie": "8.3.1", + "fastify": "4.28.0", + "light-my-request": "5.13.0", + "path-to-regexp": "3.2.0", + "tslib": "2.6.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@fastify/static": "^6.0.0 || ^7.0.0", + "@fastify/view": "^7.0.0 || ^8.0.0", + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0" + }, + "peerDependenciesMeta": { + "@fastify/static": { + "optional": true + }, + "@fastify/view": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@nestjs+platform-socket.io@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-valid_ooo5dr6kflgcm6gskke53kuwmy/node_modules/@nestjs/platform-socket.io": { + "version": "10.3.10", + "license": "MIT", + "dependencies": { + "socket.io": "4.7.5", + "tslib": "2.6.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/websockets": "^10.0.0", + "rxjs": "^7.1.0" + } + }, + "../../node_modules/.pnpm/@nestjs+schedule@4.1.0_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1__pe3yfbl6nhcyrwlmzqxhigzqcu/node_modules/@nestjs/schedule": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "cron": "3.1.7", + "uuid": "10.0.0" + }, + "devDependencies": { + "@commitlint/cli": "19.3.0", + "@commitlint/config-angular": "19.3.0", + "@nestjs/common": "10.3.10", + "@nestjs/core": "10.3.10", + "@nestjs/platform-express": "10.3.10", + "@nestjs/testing": "10.3.10", + "@types/jest": "29.5.12", + "@types/node": "20.14.9", + "@types/sinon": "17.0.3", + "@types/uuid": "10.0.0", + "@typescript-eslint/eslint-plugin": "7.15.0", + "@typescript-eslint/parser": "7.15.0", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.29.1", + "husky": "9.0.11", + "jest": "29.7.0", + "lint-staged": "15.2.7", + "prettier": "3.3.2", + "reflect-metadata": "0.2.2", + "release-it": "17.4.1", + "rimraf": "5.0.7", + "rxjs": "7.8.1", + "sinon": "18.0.0", + "ts-jest": "29.1.5", + "typescript": "5.5.3" + }, + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "@nestjs/core": "^8.0.0 || ^9.0.0 || ^10.0.0" + } + }, + "../../node_modules/.pnpm/@nestjs+schematics@10.1.3_chokidar@3.6.0_typescript@5.3.3/node_modules/@nestjs/schematics": { + "version": "10.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.8", + "@angular-devkit/schematics": "17.3.8", + "comment-json": "4.2.3", + "jsonc-parser": "3.3.1", + "pluralize": "8.0.0" + }, + "devDependencies": { + "@commitlint/cli": "19.3.0", + "@commitlint/config-angular": "19.3.0", + "@types/jest": "29.5.12", + "@types/node": "20.14.12", + "@typescript-eslint/eslint-plugin": "7.17.0", + "@typescript-eslint/parser": "7.17.0", + "cpx2": "7.0.1", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.29.1", + "gulp": "5.0.0", + "gulp-clean": "0.4.0", + "husky": "9.1.1", + "jest": "29.7.0", + "nyc": "17.0.0", + "release-it": "17.6.0", + "ts-jest": "29.2.3", + "ts-node": "10.9.2", + "typescript": "5.5.4" + }, + "peerDependencies": { + "typescript": ">=4.8.2" + } + }, + "../../node_modules/.pnpm/@nestjs+swagger@7.4.0_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_r_2bphq7pkyve6vwjmftobu4nq7u/node_modules/@nestjs/swagger": { + "version": "7.4.0", + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "^0.15.0", + "@nestjs/mapped-types": "2.0.5", + "js-yaml": "4.1.0", + "lodash": "4.17.21", + "path-to-regexp": "3.2.0", + "swagger-ui-dist": "5.17.14" + }, + "devDependencies": { + "@commitlint/cli": "19.3.0", + "@commitlint/config-angular": "19.3.0", + "@fastify/static": "7.0.4", + "@nestjs/common": "10.3.10", + "@nestjs/core": "10.3.10", + "@nestjs/platform-express": "10.3.10", + "@nestjs/platform-fastify": "10.3.10", + "@types/jest": "29.5.12", + "@types/js-yaml": "4.0.9", + "@types/lodash": "4.17.6", + "@types/node": "20.14.9", + "@typescript-eslint/eslint-plugin": "7.14.1", + "@typescript-eslint/parser": "7.14.1", + "class-transformer": "0.5.1", + "class-validator": "0.14.1", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.29.1", + "express": "4.19.2", + "husky": "9.0.11", + "jest": "29.7.0", + "lint-staged": "15.2.7", + "openapi-types": "12.1.3", + "prettier": "2.8.8", + "reflect-metadata": "0.2.2", + "release-it": "17.4.1", + "supertest": "7.0.0", + "swagger-parser": "10.0.3", + "ts-jest": "29.1.5", + "typescript": "5.1.6" + }, + "peerDependencies": { + "@fastify/static": "^6.0.0 || ^7.0.0", + "@nestjs/common": "^9.0.0 || ^10.0.0", + "@nestjs/core": "^9.0.0 || ^10.0.0", + "class-transformer": "*", + "class-validator": "*", + "reflect-metadata": "^0.1.12 || ^0.2.0" + }, + "peerDependenciesMeta": { + "@fastify/static": { + "optional": true + }, + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@nestjs+testing@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_fyjbnkypm6wrxf4pwbd5e6guie/node_modules/@nestjs/testing": { + "version": "10.3.10", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "2.6.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0", + "@nestjs/microservices": "^10.0.0", + "@nestjs/platform-express": "^10.0.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@nestjs+websockets@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.1_wpm5qvbbekfzprnx6zfgpof2wu/node_modules/@nestjs/websockets": { + "version": "10.3.10", + "license": "MIT", + "dependencies": { + "iterare": "1.2.1", + "object-hash": "3.0.0", + "tslib": "2.6.3" + }, + "devDependencies": { + "@nestjs/common": "10.3.10", + "@nestjs/core": "10.3.10" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0", + "@nestjs/platform-socket.io": "^10.0.0", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/platform-socket.io": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@prisma+client@5.17.0_prisma@5.13.0/node_modules/@prisma/client": { + "version": "5.17.0", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "devDependencies": { + "@cloudflare/workers-types": "4.20240614.0", + "@codspeed/benchmark.js-plugin": "3.1.0", + "@faker-js/faker": "8.4.1", + "@fast-check/jest": "1.8.2", + "@inquirer/prompts": "5.0.5", + "@jest/create-cache-key-function": "29.7.0", + "@jest/globals": "29.7.0", + "@jest/test-sequencer": "29.7.0", + "@libsql/client": "0.6.2", + "@neondatabase/serverless": "0.9.3", + "@opentelemetry/api": "1.9.0", + "@opentelemetry/context-async-hooks": "1.25.1", + "@opentelemetry/instrumentation": "0.52.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/sdk-trace-base": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1", + "@planetscale/database": "1.18.0", + "@prisma/adapter-d1": "5.17.0", + "@prisma/adapter-libsql": "5.17.0", + "@prisma/adapter-neon": "5.17.0", + "@prisma/adapter-pg": "5.17.0", + "@prisma/adapter-pg-worker": "5.17.0", + "@prisma/adapter-planetscale": "5.17.0", + "@prisma/debug": "5.17.0", + "@prisma/driver-adapter-utils": "5.17.0", + "@prisma/engines": "5.17.0", + "@prisma/engines-version": "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053", + "@prisma/fetch-engine": "5.17.0", + "@prisma/generator-helper": "5.17.0", + "@prisma/get-platform": "5.17.0", + "@prisma/instrumentation": "5.17.0", + "@prisma/internals": "5.17.0", + "@prisma/migrate": "5.17.0", + "@prisma/mini-proxy": "0.9.5", + "@prisma/pg-worker": "5.17.0", + "@prisma/query-engine-wasm": "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053", + "@snaplet/copycat": "0.17.3", + "@swc-node/register": "1.10.3", + "@swc/core": "1.6.13", + "@swc/jest": "0.2.36", + "@timsuchanek/copy": "1.4.5", + "@types/debug": "4.1.12", + "@types/fs-extra": "9.0.13", + "@types/jest": "29.5.12", + "@types/js-levenshtein": "1.1.3", + "@types/mssql": "9.1.5", + "@types/node": "18.19.31", + "@types/pg": "8.11.6", + "arg": "5.0.2", + "benchmark": "2.1.4", + "ci-info": "4.0.0", + "decimal.js": "10.4.3", + "detect-runtime": "1.0.4", + "env-paths": "2.2.1", + "esbuild": "0.23.0", + "execa": "5.1.1", + "expect-type": "0.19.0", + "flat-map-polyfill": "0.3.8", + "fs-extra": "11.1.1", + "get-stream": "6.0.1", + "globby": "11.1.0", + "indent-string": "4.0.0", + "jest": "29.7.0", + "jest-extended": "4.0.2", + "jest-junit": "16.0.0", + "jest-serializer-ansi-escapes": "3.0.0", + "jest-snapshot": "29.7.0", + "js-levenshtein": "1.1.6", + "kleur": "4.1.5", + "klona": "2.0.6", + "mariadb": "3.3.1", + "memfs": "4.9.3", + "mssql": "11.0.1", + "new-github-issue-url": "0.2.1", + "node-fetch": "3.3.2", + "p-retry": "4.6.2", + "pg": "8.11.5", + "pkg-up": "3.1.0", + "pluralize": "8.0.0", + "resolve": "1.22.8", + "rimraf": "3.0.2", + "simple-statistics": "7.8.3", + "sort-keys": "4.2.0", + "source-map-support": "0.5.21", + "sql-template-tag": "5.2.1", + "stacktrace-parser": "0.1.10", + "strip-ansi": "6.0.1", + "strip-indent": "3.0.0", + "ts-node": "10.9.2", + "ts-pattern": "5.2.0", + "tsd": "0.31.1", + "typescript": "5.4.5", + "undici": "5.28.4", + "wrangler": "3.62.0", + "zx": "7.2.3" + }, + "engines": { + "node": ">=16.13" + }, + "peerDependencies": { + "prisma": "*" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@socket.io+redis-adapter@8.3.0_socket.io-adapter@2.5.5/node_modules/@socket.io/redis-adapter": { + "version": "8.3.0", + "license": "MIT", + "dependencies": { + "debug": "~4.3.1", + "notepack.io": "~3.0.1", + "uid2": "1.0.0" + }, + "devDependencies": { + "@types/expect.js": "^0.3.29", + "@types/mocha": "^8.2.1", + "@types/node": "^14.14.7", + "expect.js": "0.3.1", + "ioredis": "^5.3.2", + "mocha": "^10.1.0", + "nyc": "^15.1.0", + "prettier": "^2.8.7", + "redis": "^4.6.6", + "redis-v3": "npm:redis@^3.1.2", + "rimraf": "^5.0.5", + "socket.io": "^4.6.1", + "socket.io-client": "^4.1.1", + "ts-node": "^10.9.1", + "typescript": "^4.9.5" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "socket.io-adapter": "^2.5.4" + } + }, + "../../node_modules/.pnpm/@supabase+supabase-js@2.45.0/node_modules/@supabase/supabase-js": { + "version": "2.45.0", + "license": "MIT", + "dependencies": { + "@supabase/auth-js": "2.64.4", + "@supabase/functions-js": "2.4.1", + "@supabase/node-fetch": "2.6.15", + "@supabase/postgrest-js": "1.15.8", + "@supabase/realtime-js": "2.10.2", + "@supabase/storage-js": "2.6.0" + }, + "devDependencies": { + "@sebbo2002/semantic-release-jsr": "^1.0.0", + "@types/jest": "^29.2.5", + "husky": "^4.3.0", + "jest": "^29.3.1", + "npm-run-all": "^4.1.5", + "prettier": "^2.5.1", + "pretty-quick": "^3.1.3", + "rimraf": "^3.0.2", + "semantic-release-plugin-update-version-in-files": "^1.1.0", + "serve": "^14.2.1", + "ts-jest": "^29.0.5", + "ts-loader": "^8.0.11", + "ts-node": "^10.9.1", + "tsd": "^0.30.4", + "typedoc": "^0.22.16", + "typescript": "^4.5.5", + "webpack": "^5.69.1", + "webpack-cli": "^4.9.2" + } + }, + "../../node_modules/.pnpm/@types+cookie-parser@1.4.7/node_modules/@types/cookie-parser": { + "version": "1.4.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express": "*" + } + }, + "../../node_modules/.pnpm/@types+eccrypto@1.1.6/node_modules/@types/eccrypto": { + "version": "1.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, + "../../node_modules/.pnpm/@types+express@4.17.21/node_modules/@types/express": { + "version": "4.17.21", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "../../node_modules/.pnpm/@types+multer@1.4.11/node_modules/@types/multer": { + "version": "1.4.11", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express": "*" + } + }, + "../../node_modules/.pnpm/@types+supertest@6.0.2/node_modules/@types/supertest": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/methods": "^1.1.4", + "@types/superagent": "^8.1.0" + } + }, + "../../node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid": { + "version": "9.0.8", + "dev": true, + "license": "MIT" + }, + "../../node_modules/.pnpm/ajv@7.2.4/node_modules/ajv": { + "version": "7.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "devDependencies": { + "@ajv-validator/config": "^0.3.0", + "@types/chai": "^4.2.12", + "@types/mocha": "^8.0.3", + "@types/node": "^14.0.27", + "@types/require-from-string": "^1.2.0", + "@typescript-eslint/eslint-plugin": "^3.8.0", + "@typescript-eslint/parser": "^3.8.0", + "@vuepress/shared-utils": "^1.8.2", + "ajv-formats": "^1.5.0", + "browserify": "^17.0.0", + "chai": "^4.0.1", + "cross-env": "^7.0.2", + "eslint": "^7.8.1", + "eslint-config-prettier": "^7.0.0", + "glob": "^7.0.0", + "husky": "^5.0.9", + "if-node-version": "^1.0.0", + "jimp": "^0.16.1", + "js-beautify": "^1.7.3", + "json-schema-test": "^2.0.0", + "karma": "^5.0.0", + "karma-chrome-launcher": "^3.0.0", + "karma-mocha": "^2.0.0", + "lint-staged": "^10.2.11", + "mocha": "^8.0.1", + "node-fetch": "^2.6.1", + "nyc": "^15.0.0", + "prettier": "^2.0.5", + "terser": "^5.2.1", + "ts-node": "^9.0.0", + "tsify": "^5.0.2", + "typescript": "^4.2.0", + "vuepress": "^1.8.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "../../node_modules/.pnpm/class-transformer@0.5.1/node_modules/class-transformer": { + "version": "0.5.1", + "license": "MIT" + }, + "../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator": { + "version": "0.14.1", + "license": "MIT", + "dependencies": { + "@types/validator": "^13.11.8", + "libphonenumber-js": "^1.10.53", + "validator": "^13.9.0" + } + }, + "../../node_modules/.pnpm/cookie-parser@1.4.6/node_modules/cookie-parser": { + "version": "1.4.6", + "license": "MIT", + "dependencies": { + "cookie": "0.4.1", + "cookie-signature": "1.0.6" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.2", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.1.3", + "nyc": "15.1.0", + "supertest": "6.1.6" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "../../node_modules/.pnpm/dotenv-cli@7.4.2/node_modules/dotenv-cli": { + "version": "7.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "dotenv": "^16.3.0", + "dotenv-expand": "^10.0.0", + "minimist": "^1.2.6" + }, + "bin": { + "dotenv": "cli.js" + }, + "devDependencies": { + "standard": "^16.0.4" + } + }, + "../../node_modules/.pnpm/eccrypto@1.1.6/node_modules/eccrypto": { + "version": "1.1.6", + "hasInstallScript": true, + "license": "CC0-1.0", + "dependencies": { + "acorn": "7.1.1", + "elliptic": "6.5.4", + "es6-promise": "4.2.8", + "nan": "2.14.0" + }, + "devDependencies": { + "browserify": "16.5.0", + "buffer-equal": "1.0.0", + "chai": "*", + "jshint": "*", + "karma": "4.3.0", + "karma-browserify": "6.1.0", + "karma-chrome-launcher": "3.1.0", + "karma-cli": "2.0.0", + "karma-firefox-launcher": "1.2.0", + "karma-mocha": "1.3.0", + "karma-mocha-reporter": "2.2.5", + "mocha": "*" + }, + "optionalDependencies": { + "secp256k1": "3.7.1" + } + }, + "../../node_modules/.pnpm/jest-mock-extended@3.0.7_jest@29.7.0_@types+node@20.14.13_ts-node@10.9.2_@swc+core@1.7.3_@typ_jhxggbe4bvfgdyrqh2bhodnpsu/node_modules/jest-mock-extended": { + "version": "3.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ts-essentials": "^10.0.0" + }, + "devDependencies": { + "@types/jest": "^27.5.0", + "coveralls": "^3.1.1", + "jest": "^29.5.0", + "prettier": "^2.3.2", + "rimraf": "^3.0.2", + "ts-jest": "^29.0.5", + "typescript": "^5.0.2" + }, + "peerDependencies": { + "jest": "^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0 || ^29.0.0", + "typescript": "^3.0.0 || ^4.0.0 || ^5.0.0" + } + }, + "../../node_modules/.pnpm/jest@29.7.0_@types+node@20.14.13_ts-node@10.9.2_@swc+core@1.7.3_@types+node@20.14.13_typescript@5.3.3_/node_modules/jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "devDependencies": { + "@tsd/typescript": "^5.0.4", + "tsd-lite": "^0.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/minio@8.0.1/node_modules/minio": { + "version": "8.0.1", + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.4", + "block-stream2": "^2.1.0", + "browser-or-node": "^2.1.1", + "buffer-crc32": "^1.0.0", + "eventemitter3": "^5.0.1", + "fast-xml-parser": "^4.2.2", + "ipaddr.js": "^2.0.1", + "lodash": "^4.17.21", + "mime-types": "^2.1.35", + "query-string": "^7.1.3", + "stream-json": "^1.8.0", + "through2": "^4.0.2", + "web-encoding": "^1.1.5", + "xml2js": "^0.5.0" + }, + "devDependencies": { + "@babel/core": "^7.21.8", + "@babel/plugin-transform-modules-commonjs": "^7.21.5", + "@babel/preset-env": "^7.21.5", + "@babel/preset-typescript": "^7.21.5", + "@babel/register": "^7.21.0", + "@nodelib/fs.walk": "^1.2.8", + "@types/async": "^3.2.20", + "@types/block-stream2": "^2.1.2", + "@types/chai": "^4.3.11", + "@types/chai-as-promised": "^7.1.8", + "@types/lodash": "^4.14.194", + "@types/mime-types": "^2.1.1", + "@types/node": "^20.1.0", + "@types/stream-json": "^1.7.5", + "@types/through2": "^2.0.38", + "@types/xml2js": "^0.4.11", + "@typescript-eslint/eslint-plugin": "^5.59.2", + "@typescript-eslint/parser": "^5.59.2", + "@upleveled/babel-plugin-remove-node-prefix": "^1.0.5", + "babel-plugin-replace-import-extension": "^1.1.3", + "babel-plugin-transform-replace-expressions": "^0.2.0", + "chai": "^4.3.7", + "chai-as-promised": "^7.1.1", + "dotenv": "^16.0.3", + "eslint": "^8.40.0", + "eslint-config-prettier": "^8.8.0", + "eslint-import-resolver-typescript": "^3.5.5", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-simple-import-sort": "^10.0.0", + "eslint-plugin-unicorn": "^47.0.0", + "eslint-plugin-unused-imports": "^2.0.0", + "husky": "^8.0.3", + "lint-staged": "^13.2.2", + "mocha": "^10.2.0", + "mocha-steps": "^1.3.0", + "nock": "^13.3.1", + "prettier": "^2.8.8", + "source-map-support": "^0.5.21", + "split-file": "^2.3.0", + "superagent": "^8.0.1", + "typescript": "^5.0.4", + "uuid": "^9.0.0" + }, + "engines": { + "node": "^16 || ^18 || >=20" + } + }, + "../../node_modules/.pnpm/nodemailer@6.9.14/node_modules/nodemailer": { + "version": "6.9.14", + "license": "MIT-0", + "devDependencies": { + "@aws-sdk/client-ses": "3.600.0", + "bunyan": "1.8.15", + "c8": "10.1.2", + "eslint": "8.57.0", + "eslint-config-nodemailer": "1.2.0", + "eslint-config-prettier": "9.1.0", + "libbase64": "1.3.0", + "libmime": "5.3.5", + "libqp": "2.1.0", + "nodemailer-ntlm-auth": "1.0.4", + "proxy": "1.0.2", + "proxy-test-server": "1.0.0", + "smtp-server": "3.13.4" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "../../node_modules/.pnpm/passport-github2@0.1.12/node_modules/passport-github2": { + "version": "0.1.12", + "dependencies": { + "passport-oauth2": "1.x.x" + }, + "devDependencies": { + "chai": "1.x.x", + "mocha": "1.x.x" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "../../node_modules/.pnpm/passport-gitlab2@5.0.0/node_modules/passport-gitlab2": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "passport-oauth2": "^1.4.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "eslint": "^5.13.0", + "eslint-config-google": "^0.12.0", + "mocha": "^5.2.0", + "nyc": "^13.2.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "../../node_modules/.pnpm/passport-google-oauth20@2.0.0/node_modules/passport-google-oauth20": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "passport-oauth2": "1.x.x" + }, + "devDependencies": { + "chai": "2.x.x", + "chai-passport-strategy": "1.x.x", + "make-node": "0.3.x", + "mocha": "1.x.x" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "../../node_modules/.pnpm/prettier@3.3.3/node_modules/prettier": { + "version": "3.3.3", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "../../node_modules/.pnpm/prisma@5.13.0/node_modules/prisma": { + "version": "5.13.0", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/engines": "5.13.0" + }, + "bin": { + "prisma": "build/index.js" + }, + "devDependencies": { + "@prisma/client": "5.13.0", + "@prisma/debug": "5.13.0", + "@prisma/fetch-engine": "5.13.0", + "@prisma/generator-helper": "5.13.0", + "@prisma/get-platform": "5.13.0", + "@prisma/internals": "5.13.0", + "@prisma/migrate": "5.13.0", + "@prisma/mini-proxy": "0.9.5", + "@prisma/studio": "0.500.0", + "@prisma/studio-server": "0.500.0", + "@swc/core": "1.4.11", + "@swc/jest": "0.2.36", + "@types/debug": "4.1.12", + "@types/fs-extra": "9.0.13", + "@types/jest": "29.5.12", + "@types/node": "18.19.31", + "@types/node-fetch": "2.6.11", + "@types/rimraf": "3.0.2", + "async-listen": "3.0.1", + "checkpoint-client": "1.1.33", + "debug": "4.3.4", + "dotenv": "16.0.3", + "esbuild": "0.20.2", + "execa": "5.1.1", + "fast-glob": "3.3.2", + "fs-extra": "11.1.1", + "fs-jetpack": "5.1.0", + "get-port": "5.1.1", + "global-dirs": "4.0.0", + "jest": "29.7.0", + "jest-junit": "16.0.0", + "kleur": "4.1.5", + "line-replace": "2.0.1", + "log-update": "4.0.0", + "node-fetch": "2.7.0", + "npm-packlist": "5.1.3", + "open": "7.4.2", + "pkg-up": "3.1.0", + "resolve-pkg": "2.0.0", + "rimraf": "3.0.2", + "strip-ansi": "6.0.1", + "ts-pattern": "5.1.0", + "typescript": "5.3.3", + "xdg-app-paths": "8.3.0", + "zx": "7.2.3" + }, + "engines": { + "node": ">=16.13" + } + }, + "../../node_modules/.pnpm/redis@4.7.0/node_modules/redis": { + "version": "4.7.0", + "license": "MIT", + "workspaces": [ + "./packages/*" + ], + "dependencies": { + "@redis/bloom": "1.2.0", + "@redis/client": "1.6.0", + "@redis/graph": "1.1.1", + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" + }, + "devDependencies": { + "@tsconfig/node14": "^14.1.0", + "gh-pages": "^6.0.0", + "release-it": "^16.1.5", + "typescript": "^5.2.2" + } + }, + "../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata": { + "version": "0.2.2", + "dev": true, + "license": "Apache-2.0", + "devDependencies": { + "@types/chai": "^3.4.34", + "@types/mocha": "^2.2.34", + "@types/node": "^10.17.60", + "chai": "^3.5.0", + "del": "^2.2.2", + "ecmarkup": "^3.9.3", + "gulp": "^3.9.1", + "gulp-emu": "^1.1.0", + "gulp-live-server": "0.0.30", + "gulp-mocha": "^3.0.1", + "gulp-rename": "^1.2.2", + "gulp-sequence": "^0.4.6", + "gulp-tsb": "^2.0.3", + "mocha": "^3.2.0", + "typescript": "^2.1.4" + } + }, + "../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs": { + "version": "7.8.1", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + }, + "devDependencies": { + "@angular-devkit/build-optimizer": "0.4.6", + "@angular-devkit/schematics": "^11.0.7", + "@swc/core": "^1.2.128", + "@swc/helpers": "^0.3.2", + "@types/chai": "^4.2.11", + "@types/lodash": "4.14.102", + "@types/mocha": "^7.0.2", + "@types/node": "^14.14.6", + "@types/shelljs": "^0.8.8", + "@types/sinon": "4.1.3", + "@types/sinon-chai": "2.7.29", + "@types/source-map": "^0.5.2", + "@typescript-eslint/eslint-plugin": "^4.29.1", + "@typescript-eslint/parser": "^4.29.1", + "babel-polyfill": "6.26.0", + "chai": "^4.2.0", + "check-side-effects": "0.0.23", + "color": "3.0.0", + "colors": "1.1.2", + "cross-env": "5.1.3", + "cz-conventional-changelog": "1.2.0", + "dependency-cruiser": "^9.12.0", + "escape-string-regexp": "1.0.5", + "eslint": "^7.8.1", + "eslint-plugin-jasmine": "^2.10.1", + "form-data": "^3.0.0", + "fs-extra": "^8.1.0", + "glob": "7.1.2", + "google-closure-compiler-js": "20170218.0.0", + "husky": "^4.2.5", + "klaw-sync": "3.0.2", + "lint-staged": "^10.2.11", + "lodash": "^4.17.15", + "minimist": "^1.2.5", + "mocha": "^8.1.3", + "nodemon": "^1.9.2", + "npm-run-all": "4.1.2", + "opn-cli": "3.1.0", + "platform": "1.3.5", + "prettier": "^2.5.1", + "promise": "8.0.1", + "rollup": "0.66.6", + "rollup-plugin-alias": "1.4.0", + "rollup-plugin-inject": "2.0.0", + "rollup-plugin-node-resolve": "2.0.0", + "shelljs": "^0.8.4", + "shx": "^0.3.2", + "sinon": "4.3.0", + "sinon-chai": "2.14.0", + "source-map-support": "0.5.3", + "systemjs": "^0.21.0", + "ts-node": "^9.1.1", + "tslint": "^5.20.1", + "tslint-config-prettier": "^1.18.0", + "tslint-etc": "1.13.10", + "tslint-no-toplevel-property-access": "0.0.2", + "tslint-no-unused-expression-chai": "0.0.3", + "typescript": "~4.2.0", + "validate-commit-msg": "2.14.0", + "web-streams-polyfill": "^3.0.2", + "webpack": "^4.31.0" + } + }, + "../../node_modules/.pnpm/socket.io@4.7.5/node_modules/socket.io": { + "version": "4.7.5", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.5.2", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "expect.js": "0.3.1", + "mocha": "^10.0.0", + "nyc": "^15.1.0", + "prettier": "^2.3.2", + "rimraf": "^3.0.2", + "socket.io-client": "4.7.5", + "socket.io-client-v2": "npm:socket.io-client@^2.4.0", + "superagent": "^8.0.0", + "supertest": "^6.1.6", + "ts-node": "^10.2.1", + "tsd": "^0.27.0", + "typescript": "^4.4.2", + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.30.0" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support": { + "version": "0.5.21", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "devDependencies": { + "browserify": "^4.2.3", + "coffeescript": "^1.12.7", + "http-server": "^0.11.1", + "mocha": "^3.5.3", + "webpack": "^1.15.0" + } + }, + "../../node_modules/.pnpm/supertest@6.3.4/node_modules/supertest": { + "version": "6.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "methods": "^1.1.2", + "superagent": "^8.1.2" + }, + "devDependencies": { + "body-parser": "^1.20.2", + "cookie-parser": "^1.4.6", + "eslint": "^8.32.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.27.5", + "express": "^4.18.2", + "mocha": "^10.2.0", + "nock": "^13.3.0", + "nyc": "^15.1.0", + "proxyquire": "^2.1.3", + "should": "^13.2.3" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "../../node_modules/.pnpm/ts-jest@29.2.3_@babel+core@7.25.2_@jest+transform@29.7.0_@jest+types@29.6.3_babel-jest@29.7.0_rsxe6qybycxa2obr6ktanl25u4/node_modules/ts-jest": { + "version": "29.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "0.x", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "2.x", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "^7.5.3", + "yargs-parser": "^21.0.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "devDependencies": { + "@commitlint/cli": "18.6.1", + "@commitlint/config-angular": "18.6.1", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/babel__core": "7.20.5", + "@types/cross-spawn": "latest", + "@types/ejs": "^3.1.5", + "@types/fs-extra": "latest", + "@types/js-yaml": "latest", + "@types/lodash.camelcase": "4.3.9", + "@types/lodash.memoize": "4.1.9", + "@types/lodash.set": "4.3.9", + "@types/micromatch": "4.0.9", + "@types/node": "20.14.11", + "@types/react": "18.x", + "@types/semver": "latest", + "@types/yargs": "latest", + "@types/yargs-parser": "21.0.3", + "@typescript-eslint/eslint-plugin": "^7.16.1", + "@typescript-eslint/parser": "^7.16.1", + "babel-jest": "^29.7.0", + "conventional-changelog-cli": "^5.0.0", + "cross-spawn": "latest", + "esbuild": "~0.21.5", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jest": "^28.6.0", + "eslint-plugin-jsdoc": "^48.7.0", + "eslint-plugin-prefer-arrow": "^1.2.3", + "eslint-plugin-prettier": "^4.2.1", + "execa": "5.1.1", + "fs-extra": "11.2.0", + "glob": "^10.2.6", + "glob-gitignore": "latest", + "husky": "4.x", + "jest": "^29.7.0", + "jest-snapshot-serializer-raw": "^1.2.0", + "js-yaml": "latest", + "json-schema-to-typescript": "^13.1.2", + "lint-staged": "latest", + "prettier": "^2.8.8", + "typescript": "~5.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/ts-loader@9.5.1_typescript@5.3.3_webpack@5.92.1_@swc+core@1.7.3_/node_modules/ts-loader": { + "version": "9.5.1", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4", + "source-map": "^0.7.4" + }, + "devDependencies": { + "@types/micromatch": "^4.0.0", + "@types/node": "*", + "@types/semver": "^7.3.4", + "@typescript-eslint/eslint-plugin": "^6.0.0", + "@typescript-eslint/parser": "^6.0.0", + "babel": "^6.0.0", + "babel-core": "^6.0.0", + "babel-loader": "^7.0.0", + "babel-polyfill": "^6.16.0", + "babel-preset-es2015": "^6.0.0", + "babel-preset-es2016": "^6.16.0", + "babel-preset-react": "^6.0.0", + "escape-string-regexp": "^2.0.0", + "eslint": "^8.0.0", + "eslint-config-prettier": "^8.0.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^4.0.0", + "fs-extra": "^11.0.0", + "glob": "^7.1.1", + "husky": "^8.0.0", + "jasmine-core": "^4.0.0", + "karma": "^6.0.0", + "karma-chrome-launcher": "^3.1.0", + "karma-jasmine": "^4.0.0", + "karma-mocha-reporter": "^2.0.0", + "karma-sourcemap-loader": "^0.4.0", + "karma-webpack": "^5.0.0", + "lint-staged": "^8.0.0", + "markdown-toc": "^1.2.0", + "mkdirp": "^0.5.1", + "mocha": "^6.0.0", + "prettier": "^2.0.5", + "rimraf": "^2.6.2", + "typescript": "^5.2.2", + "webpack": "^5.74.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "typescript": "*", + "webpack": "^5.0.0" + } + }, + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + }, + "devDependencies": { + "@babel/cli": "7.18.10", + "@babel/core": "7.18.10", + "@babel/eslint-parser": "7.18.9", + "@babel/preset-env": "7.18.10", + "@commitlint/cli": "17.0.3", + "@commitlint/config-conventional": "17.0.3", + "bundlewatch": "0.3.3", + "eslint": "8.21.0", + "eslint-config-prettier": "8.5.0", + "eslint-config-standard": "17.0.0", + "eslint-plugin-import": "2.26.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-prettier": "4.2.1", + "eslint-plugin-promise": "6.0.0", + "husky": "8.0.1", + "jest": "28.1.3", + "lint-staged": "13.0.3", + "npm-run-all": "4.1.5", + "optional-dev-dependency": "2.0.1", + "prettier": "2.7.1", + "random-seed": "0.3.0", + "runmd": "1.3.9", + "standard-version": "9.5.0" + } + }, + "node_modules/@nestjs/cli": { + "resolved": "../../node_modules/.pnpm/@nestjs+cli@10.4.2_@swc+cli@0.4.0_@swc+core@1.7.3_chokidar@3.6.0__@swc+core@1.7.3/node_modules/@nestjs/cli", + "link": true + }, + "node_modules/@nestjs/common": { + "resolved": "../../node_modules/.pnpm/@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_reflect-metadata@0.2.2_rxjs@7.8.1/node_modules/@nestjs/common", + "link": true + }, + "node_modules/@nestjs/config": { + "resolved": "../../node_modules/.pnpm/@nestjs+config@3.2.3_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_g5lwdyyg5rxaj4lwyvjoifnhui/node_modules/@nestjs/config", + "link": true + }, + "node_modules/@nestjs/core": { + "resolved": "../../node_modules/.pnpm/@nestjs+core@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_tva4fjl6oyedawmhdxireoguqa/node_modules/@nestjs/core", + "link": true + }, + "node_modules/@nestjs/jwt": { + "resolved": "../../node_modules/.pnpm/@nestjs+jwt@10.2.0_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_refl_5mpbonfurgfqq5cjey6jllxpuy/node_modules/@nestjs/jwt", + "link": true + }, + "node_modules/@nestjs/passport": { + "resolved": "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_e3j2olz5znbylg5qzqinge5uvy/node_modules/@nestjs/passport", + "link": true + }, + "node_modules/@nestjs/platform-express": { + "resolved": "../../node_modules/.pnpm/@nestjs+platform-express@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validat_3kvif5spq7wvxhs5bkoxkrybjm/node_modules/@nestjs/platform-express", + "link": true + }, + "node_modules/@nestjs/platform-fastify": { + "resolved": "../../node_modules/.pnpm/@nestjs+platform-fastify@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validat_nefnr24blwc67xbn5rqrmimqny/node_modules/@nestjs/platform-fastify", + "link": true + }, + "node_modules/@nestjs/platform-socket.io": { + "resolved": "../../node_modules/.pnpm/@nestjs+platform-socket.io@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-valid_ooo5dr6kflgcm6gskke53kuwmy/node_modules/@nestjs/platform-socket.io", + "link": true + }, + "node_modules/@nestjs/schedule": { + "resolved": "../../node_modules/.pnpm/@nestjs+schedule@4.1.0_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1__pe3yfbl6nhcyrwlmzqxhigzqcu/node_modules/@nestjs/schedule", + "link": true + }, + "node_modules/@nestjs/schematics": { + "resolved": "../../node_modules/.pnpm/@nestjs+schematics@10.1.3_chokidar@3.6.0_typescript@5.3.3/node_modules/@nestjs/schematics", + "link": true + }, + "node_modules/@nestjs/swagger": { + "resolved": "../../node_modules/.pnpm/@nestjs+swagger@7.4.0_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_r_2bphq7pkyve6vwjmftobu4nq7u/node_modules/@nestjs/swagger", + "link": true + }, + "node_modules/@nestjs/testing": { + "resolved": "../../node_modules/.pnpm/@nestjs+testing@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_fyjbnkypm6wrxf4pwbd5e6guie/node_modules/@nestjs/testing", + "link": true + }, + "node_modules/@nestjs/websockets": { + "resolved": "../../node_modules/.pnpm/@nestjs+websockets@10.3.10_@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.1_wpm5qvbbekfzprnx6zfgpof2wu/node_modules/@nestjs/websockets", + "link": true + }, + "node_modules/@prisma/client": { + "resolved": "../../node_modules/.pnpm/@prisma+client@5.17.0_prisma@5.13.0/node_modules/@prisma/client", + "link": true + }, + "node_modules/@socket.io/redis-adapter": { + "resolved": "../../node_modules/.pnpm/@socket.io+redis-adapter@8.3.0_socket.io-adapter@2.5.5/node_modules/@socket.io/redis-adapter", + "link": true + }, + "node_modules/@supabase/supabase-js": { + "resolved": "../../node_modules/.pnpm/@supabase+supabase-js@2.45.0/node_modules/@supabase/supabase-js", + "link": true + }, + "node_modules/@types/cookie-parser": { + "resolved": "../../node_modules/.pnpm/@types+cookie-parser@1.4.7/node_modules/@types/cookie-parser", + "link": true + }, + "node_modules/@types/eccrypto": { + "resolved": "../../node_modules/.pnpm/@types+eccrypto@1.1.6/node_modules/@types/eccrypto", + "link": true + }, + "node_modules/@types/express": { + "resolved": "../../node_modules/.pnpm/@types+express@4.17.21/node_modules/@types/express", + "link": true + }, + "node_modules/@types/multer": { + "resolved": "../../node_modules/.pnpm/@types+multer@1.4.11/node_modules/@types/multer", + "link": true + }, + "node_modules/@types/supertest": { + "resolved": "../../node_modules/.pnpm/@types+supertest@6.0.2/node_modules/@types/supertest", + "link": true + }, + "node_modules/@types/uuid": { + "resolved": "../../node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid", + "link": true + }, + "node_modules/ajv": { + "resolved": "../../node_modules/.pnpm/ajv@7.2.4/node_modules/ajv", + "link": true + }, + "node_modules/class-transformer": { + "resolved": "../../node_modules/.pnpm/class-transformer@0.5.1/node_modules/class-transformer", + "link": true + }, + "node_modules/class-validator": { + "resolved": "../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator", + "link": true + }, + "node_modules/cookie-parser": { + "resolved": "../../node_modules/.pnpm/cookie-parser@1.4.6/node_modules/cookie-parser", + "link": true + }, + "node_modules/dotenv-cli": { + "resolved": "../../node_modules/.pnpm/dotenv-cli@7.4.2/node_modules/dotenv-cli", + "link": true + }, + "node_modules/eccrypto": { + "resolved": "../../node_modules/.pnpm/eccrypto@1.1.6/node_modules/eccrypto", + "link": true + }, + "node_modules/jest": { + "resolved": "../../node_modules/.pnpm/jest@29.7.0_@types+node@20.14.13_ts-node@10.9.2_@swc+core@1.7.3_@types+node@20.14.13_typescript@5.3.3_/node_modules/jest", + "link": true + }, + "node_modules/jest-mock-extended": { + "resolved": "../../node_modules/.pnpm/jest-mock-extended@3.0.7_jest@29.7.0_@types+node@20.14.13_ts-node@10.9.2_@swc+core@1.7.3_@typ_jhxggbe4bvfgdyrqh2bhodnpsu/node_modules/jest-mock-extended", + "link": true + }, + "node_modules/minio": { + "resolved": "../../node_modules/.pnpm/minio@8.0.1/node_modules/minio", + "link": true + }, + "node_modules/nodemailer": { + "resolved": "../../node_modules/.pnpm/nodemailer@6.9.14/node_modules/nodemailer", + "link": true + }, + "node_modules/passport-github2": { + "resolved": "../../node_modules/.pnpm/passport-github2@0.1.12/node_modules/passport-github2", + "link": true + }, + "node_modules/passport-gitlab2": { + "resolved": "../../node_modules/.pnpm/passport-gitlab2@5.0.0/node_modules/passport-gitlab2", + "link": true + }, + "node_modules/passport-google-oauth20": { + "resolved": "../../node_modules/.pnpm/passport-google-oauth20@2.0.0/node_modules/passport-google-oauth20", + "link": true + }, + "node_modules/prettier": { + "resolved": "../../node_modules/.pnpm/prettier@3.3.3/node_modules/prettier", + "link": true + }, + "node_modules/prisma": { + "resolved": "../../node_modules/.pnpm/prisma@5.13.0/node_modules/prisma", + "link": true + }, + "node_modules/redis": { + "resolved": "../../node_modules/.pnpm/redis@4.7.0/node_modules/redis", + "link": true + }, + "node_modules/reflect-metadata": { + "resolved": "../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata", + "link": true + }, + "node_modules/rxjs": { + "resolved": "../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs", + "link": true + }, + "node_modules/socket.io": { + "resolved": "../../node_modules/.pnpm/socket.io@4.7.5/node_modules/socket.io", + "link": true + }, + "node_modules/source-map-support": { + "resolved": "../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support", + "link": true + }, + "node_modules/supertest": { + "resolved": "../../node_modules/.pnpm/supertest@6.3.4/node_modules/supertest", + "link": true + }, + "node_modules/ts-jest": { + "resolved": "../../node_modules/.pnpm/ts-jest@29.2.3_@babel+core@7.25.2_@jest+transform@29.7.0_@jest+types@29.6.3_babel-jest@29.7.0_rsxe6qybycxa2obr6ktanl25u4/node_modules/ts-jest", + "link": true + }, + "node_modules/ts-loader": { + "resolved": "../../node_modules/.pnpm/ts-loader@9.5.1_typescript@5.3.3_webpack@5.92.1_@swc+core@1.7.3_/node_modules/ts-loader", + "link": true + }, + "node_modules/uuid": { + "resolved": "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid", + "link": true + } + } +} diff --git a/apps/api/src/socket/change-notifier.socket.ts b/apps/api/src/socket/change-notifier.socket.ts index 8f802a27..7db998d6 100644 --- a/apps/api/src/socket/change-notifier.socket.ts +++ b/apps/api/src/socket/change-notifier.socket.ts @@ -74,8 +74,8 @@ export default class ChangeNotifier ) } - async handleConnection(client: Socket, ...args: any[]) { - this.logger.log(`Client connected: ${client.id}. Data: ${args}`) + async handleConnection(client: Socket) { + this.logger.log(`Client connected: ${client.id}.`) } async handleDisconnect(client: Socket) { @@ -102,7 +102,12 @@ export default class ChangeNotifier // Check if the user has access to the workspace const workspace = await this.prisma.workspace.findFirst({ where: { - name: data.workspaceName + name: data.workspaceName, + members: { + some: { + userId: user.id + } + } } }) await this.authorityCheckerService.checkAuthorityOverWorkspace({ @@ -115,7 +120,8 @@ export default class ChangeNotifier // Check if the user has access to the project const project = await this.prisma.project.findFirst({ where: { - name: data.projectName + name: data.projectName, + workspaceId: workspace.id } }) await this.authorityCheckerService.checkAuthorityOverProject({ @@ -128,7 +134,8 @@ export default class ChangeNotifier // Check if the user has access to the environment const environment = await this.prisma.environment.findFirst({ where: { - name: data.environmentName + name: data.environmentName, + projectId: project.id } }) await this.authorityCheckerService.checkAuthorityOverEnvironment({ @@ -151,7 +158,9 @@ export default class ChangeNotifier client.emit('client-registered', clientRegisteredResponse) this.logger.log( - `Client registered: ${client.id} for configuration: ${clientRegisteredResponse}` + `Client registered: ${client.id} for configuration: ${JSON.stringify( + clientRegisteredResponse + )}` ) } diff --git a/apps/cli/.swcrc b/apps/cli/.swcrc index 59bc3808..be579a92 100644 --- a/apps/cli/.swcrc +++ b/apps/cli/.swcrc @@ -1,28 +1,26 @@ { - "$schema": "https://json.schemastore.org/swcrc", - "jsc": { - "parser": { - "syntax": "typescript", - "tsx": false, - "dynamicImport": true, - "decorators": false - }, - "transform": null, - "target": "es2016", - "loose": false, - "externalHelpers": false, - "keepClassNames": false, - "baseUrl": ".", - "paths": { - "@/*": ["./src/*"] - } + "$schema": "https://json.schemastore.org/swcrc", + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": false, + "dynamicImport": true }, - "module": { - "type": "commonjs", - "strict": false, - "strictMode": false, - "noInterop": false, - "lazy": false - }, - "minify": true -} \ No newline at end of file + "target": "es2022", + "loose": false, + "externalHelpers": false, + "keepClassNames": false, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } + }, + "module": { + "type": "es6", + "strict": false, + "strictMode": false, + "noInterop": false, + "lazy": false + }, + "minify": true +} diff --git a/apps/cli/package-lock.json b/apps/cli/package-lock.json new file mode 100644 index 00000000..cb2c85ea --- /dev/null +++ b/apps/cli/package-lock.json @@ -0,0 +1,534 @@ +{ + "name": "cli", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "cli", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@clack/core": "^0.3.4", + "@clack/prompts": "^0.7.0", + "chalk": "^4.1.2", + "cli-table": "^0.3.11", + "colors": "^1.4.0", + "commander": "^12.1.0", + "eccrypto": "^1.1.6", + "figlet": "^1.7.0", + "fs": "0.0.1-security", + "nodemon": "^3.1.4", + "socket.io-client": "^4.7.5" + }, + "devDependencies": { + "@swc/cli": "^0.4.0", + "@swc/core": "^1.6.13", + "@types/cli-table": "^0.3.4", + "@types/eccrypto": "^1.1.6", + "@types/figlet": "^1.5.8", + "@types/node": "^20.14.10", + "eslint-config-standard-with-typescript": "^43.0.1" + } + }, + "../../node_modules/.pnpm/@clack+core@0.3.4/node_modules/@clack/core": { + "version": "0.3.4", + "license": "MIT", + "dependencies": { + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + }, + "devDependencies": { + "wrap-ansi": "^8.1.0" + } + }, + "../../node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts": { + "version": "0.7.0", + "bundleDependencies": [ + "is-unicode-supported" + ], + "license": "MIT", + "dependencies": { + "@clack/core": "^0.3.3", + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + }, + "devDependencies": { + "is-unicode-supported": "^1.3.0" + } + }, + "../../node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/node_modules/is-unicode-supported": { + "version": "1.3.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "../../node_modules/.pnpm/@swc+cli@0.4.0_@swc+core@1.7.3_chokidar@3.6.0/node_modules/@swc/cli": { + "version": "0.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@mole-inc/bin-wrapper": "^8.0.1", + "@swc/counter": "^0.1.3", + "commander": "^8.3.0", + "fast-glob": "^3.2.5", + "minimatch": "^9.0.3", + "piscina": "^4.3.0", + "semver": "^7.3.8", + "slash": "3.0.0", + "source-map": "^0.7.3" + }, + "bin": { + "spack": "bin/spack.js", + "swc": "bin/swc.js", + "swcx": "bin/swcx.js" + }, + "devDependencies": { + "@swc/cli": "=0.3.14", + "@swc/core": "^1.6.4", + "@swc/jest": "^0.2.36", + "@swc/types": "^0.1.9", + "@types/jest": "^29.5.0", + "@types/node": "^20.11.5", + "@types/semver": "^7.3.13", + "chokidar": "^3.5.1", + "deepmerge": "^4.2.2", + "jest": "^29.5.0", + "ts-jest": "^29.0.5", + "typescript": "~4.3.2" + }, + "engines": { + "node": ">= 16.14.0" + }, + "peerDependencies": { + "@swc/core": "^1.2.66", + "chokidar": "^3.5.1" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@swc+core@1.7.3_@swc+helpers@0.5.2/node_modules/@swc/core": { + "version": "1.7.3", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@swc/counter": "^0.1.3", + "@swc/types": "^0.1.12" + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "cross-env": "^7.0.3", + "jest": "^29.7.0", + "typescript": "^5.3.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/swc" + }, + "optionalDependencies": { + "@swc/core-darwin-arm64": "1.7.3", + "@swc/core-darwin-x64": "1.7.3", + "@swc/core-linux-arm-gnueabihf": "1.7.3", + "@swc/core-linux-arm64-gnu": "1.7.3", + "@swc/core-linux-arm64-musl": "1.7.3", + "@swc/core-linux-x64-gnu": "1.7.3", + "@swc/core-linux-x64-musl": "1.7.3", + "@swc/core-win32-arm64-msvc": "1.7.3", + "@swc/core-win32-ia32-msvc": "1.7.3", + "@swc/core-win32-x64-msvc": "1.7.3" + }, + "peerDependencies": { + "@swc/helpers": "*" + }, + "peerDependenciesMeta": { + "@swc/helpers": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@types+cli-table@0.3.4/node_modules/@types/cli-table": { + "version": "0.3.4", + "dev": true, + "license": "MIT" + }, + "../../node_modules/.pnpm/@types+eccrypto@1.1.6/node_modules/@types/eccrypto": { + "version": "1.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, + "../../node_modules/.pnpm/@types+figlet@1.5.8/node_modules/@types/figlet": { + "version": "1.5.8", + "dev": true, + "license": "MIT" + }, + "../../node_modules/.pnpm/@types+node@20.14.13/node_modules/@types/node": { + "version": "20.14.13", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "coveralls": "^3.0.7", + "execa": "^4.0.0", + "import-fresh": "^3.1.0", + "matcha": "^0.7.0", + "nyc": "^15.0.0", + "resolve-from": "^5.0.0", + "tsd": "^0.7.4", + "xo": "^0.28.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "../../node_modules/.pnpm/cli-table@0.3.11/node_modules/cli-table": { + "version": "0.3.11", + "dependencies": { + "colors": "1.0.3" + }, + "devDependencies": { + "expresso": "~0.9", + "should": "~0.6" + }, + "engines": { + "node": ">= 0.2.0" + } + }, + "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors": { + "version": "1.4.0", + "license": "MIT", + "devDependencies": { + "eslint": "^5.2.0", + "eslint-config-google": "^0.11.0" + }, + "engines": { + "node": ">=0.1.90" + } + }, + "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander": { + "version": "12.1.0", + "license": "MIT", + "devDependencies": { + "@eslint/js": "^8.56.0", + "@types/jest": "^29.2.4", + "@types/node": "^20.2.5", + "eslint": "^8.30.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jest": "^28.3.0", + "eslint-plugin-jsdoc": "^48.1.0", + "globals": "^13.24.0", + "jest": "^29.3.1", + "prettier": "^3.2.5", + "prettier-plugin-jsdoc": "^1.3.0", + "ts-jest": "^29.0.3", + "tsd": "^0.31.0", + "typescript": "^5.0.4", + "typescript-eslint": "^7.0.1" + }, + "engines": { + "node": ">=18" + } + }, + "../../node_modules/.pnpm/eccrypto@1.1.6/node_modules/eccrypto": { + "version": "1.1.6", + "hasInstallScript": true, + "license": "CC0-1.0", + "dependencies": { + "acorn": "7.1.1", + "elliptic": "6.5.4", + "es6-promise": "4.2.8", + "nan": "2.14.0" + }, + "devDependencies": { + "browserify": "16.5.0", + "buffer-equal": "1.0.0", + "chai": "*", + "jshint": "*", + "karma": "4.3.0", + "karma-browserify": "6.1.0", + "karma-chrome-launcher": "3.1.0", + "karma-cli": "2.0.0", + "karma-firefox-launcher": "1.2.0", + "karma-mocha": "1.3.0", + "karma-mocha-reporter": "2.2.5", + "mocha": "*" + }, + "optionalDependencies": { + "secp256k1": "3.7.1" + } + }, + "../../node_modules/.pnpm/eslint-config-standard-with-typescript@43.0.1_@typescript-eslint+eslint-plugin@6.21.0_@typesc_gdz7pup2ygpczip36mdqeerqha/node_modules/eslint-config-standard-with-typescript": { + "version": "43.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/parser": "^6.4.0", + "eslint-config-standard": "17.1.0" + }, + "devDependencies": { + "@arkweid/lefthook": "0.7.7", + "@commitlint/cli": "18.4.4", + "@commitlint/config-conventional": "18.4.4", + "@types/eslint": "8.56.2", + "@types/js-yaml": "4.0.9", + "@types/node": "20.11.5", + "@types/npm-package-arg": "6.1.4", + "@types/semver": "7.5.6", + "@types/ungap__structured-clone": "1.2.0", + "@typescript-eslint_bottom/eslint-plugin": "npm:@typescript-eslint/eslint-plugin@6.4.0", + "@typescript-eslint_bottom/parser": "npm:@typescript-eslint/parser@6.4.0", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@ungap/structured-clone": "1.2.0", + "ava": "6.0.1", + "commitlint-config-standard": "github:standard/commitlint-config-standard", + "editorconfig-checker": "5.1.2", + "eslint": "8.56.0", + "eslint-plugin-import": "2.29.1", + "eslint-plugin-n": "16.6.2", + "eslint-plugin-promise": "6.1.1", + "js-yaml": "4.1.0", + "just-diff": "6.0.2", + "npm-package-arg": "11.0.1", + "npm-run-all": "4.1.5", + "read-pkg-up": "10.1.0", + "runtypes": "6.7.0", + "semantic-release": "23.0.0", + "semantic-release-standard": "github:standard/semantic-release", + "semver": "7.5.4", + "standard-version": "9.5.0", + "tsconfigs": "5.0.0", + "type-fest": "4.9.0", + "typescript": "5.2.2" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^6.4.0", + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", + "eslint-plugin-promise": "^6.0.0", + "typescript": "*" + } + }, + "../../node_modules/.pnpm/figlet@1.7.0/node_modules/figlet": { + "version": "1.7.0", + "license": "MIT", + "bin": { + "figlet": "bin/index.js" + }, + "devDependencies": { + "async": "~3.2.4", + "grunt": "^1.6.1", + "grunt-contrib-clean": "~2.0.1", + "grunt-contrib-jshint": "^3.2.0", + "grunt-contrib-nodeunit": "~5.0.0", + "grunt-contrib-uglify": "^5.2.2", + "husky": "^8.0.3", + "lint-staged": "^13.2.1", + "prettier": "2.8.7" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "../../node_modules/.pnpm/fs@0.0.1-security/node_modules/fs": { + "version": "0.0.1-security", + "license": "ISC" + }, + "../../node_modules/.pnpm/nodemon@3.1.4/node_modules/nodemon": { + "version": "3.1.4", + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "devDependencies": { + "@commitlint/cli": "^11.0.0", + "@commitlint/config-conventional": "^11.0.0", + "async": "1.4.2", + "coffee-script": "~1.7.1", + "eslint": "^7.32.0", + "husky": "^7.0.4", + "mocha": "^2.5.3", + "nyc": "^15.1.0", + "proxyquire": "^1.8.0", + "semantic-release": "^18.0.0", + "should": "~4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "../../node_modules/.pnpm/socket.io-client@4.7.5/node_modules/socket.io-client": { + "version": "4.7.5", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.5.2", + "socket.io-parser": "~4.2.4" + }, + "devDependencies": { + "@babel/core": "^7.15.0", + "@babel/plugin-transform-object-assign": "^7.14.5", + "@babel/preset-env": "^7.15.0", + "@babel/register": "^7.18.9", + "@rollup/plugin-alias": "^3.1.5", + "@rollup/plugin-babel": "^5.3.0", + "@rollup/plugin-commonjs": "^21.0.0", + "@rollup/plugin-node-resolve": "^13.0.5", + "@sinonjs/fake-timers": "^7.1.2", + "@types/mocha": "^9.0.0", + "@types/node": "^16.7.6", + "@types/sinonjs__fake-timers": "^6.0.3", + "@wdio/cli": "^7.26.0", + "@wdio/local-runner": "^7.26.0", + "@wdio/mocha-framework": "^7.26.0", + "@wdio/sauce-service": "^7.26.0", + "@wdio/spec-reporter": "^7.26.0", + "babel-eslint": "^10.1.0", + "babel-loader": "^8.1.0", + "babel-preset-es2015": "6.24.1", + "base64-arraybuffer": "^0.1.5", + "expect.js": "0.3.1", + "has-cors": "^1.1.0", + "mocha": "^10.1.0", + "prettier": "^2.3.2", + "rimraf": "^3.0.2", + "rollup": "^2.58.0", + "rollup-plugin-terser": "^7.0.2", + "socket.io": "^4.6.0-alpha1", + "socket.io-msgpack-parser": "^3.0.0", + "text-blob-builder": "0.0.1", + "ts-loader": "^8.3.0", + "ts-node": "^10.2.1", + "tsd": "^0.17.0", + "typescript": "^4.4.2" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "../../packages/api-client": { + "name": "@keyshade/api-client", + "version": "1.0.0", + "extraneous": true + }, + "node_modules/@clack/core": { + "resolved": "../../node_modules/.pnpm/@clack+core@0.3.4/node_modules/@clack/core", + "link": true + }, + "node_modules/@clack/prompts": { + "resolved": "../../node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts", + "link": true + }, + "node_modules/@swc/cli": { + "resolved": "../../node_modules/.pnpm/@swc+cli@0.4.0_@swc+core@1.7.3_chokidar@3.6.0/node_modules/@swc/cli", + "link": true + }, + "node_modules/@swc/core": { + "resolved": "../../node_modules/.pnpm/@swc+core@1.7.3_@swc+helpers@0.5.2/node_modules/@swc/core", + "link": true + }, + "node_modules/@types/cli-table": { + "resolved": "../../node_modules/.pnpm/@types+cli-table@0.3.4/node_modules/@types/cli-table", + "link": true + }, + "node_modules/@types/eccrypto": { + "resolved": "../../node_modules/.pnpm/@types+eccrypto@1.1.6/node_modules/@types/eccrypto", + "link": true + }, + "node_modules/@types/figlet": { + "resolved": "../../node_modules/.pnpm/@types+figlet@1.5.8/node_modules/@types/figlet", + "link": true + }, + "node_modules/@types/node": { + "resolved": "../../node_modules/.pnpm/@types+node@20.14.13/node_modules/@types/node", + "link": true + }, + "node_modules/chalk": { + "resolved": "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk", + "link": true + }, + "node_modules/cli-table": { + "resolved": "../../node_modules/.pnpm/cli-table@0.3.11/node_modules/cli-table", + "link": true + }, + "node_modules/colors": { + "resolved": "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors", + "link": true + }, + "node_modules/commander": { + "resolved": "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander", + "link": true + }, + "node_modules/eccrypto": { + "resolved": "../../node_modules/.pnpm/eccrypto@1.1.6/node_modules/eccrypto", + "link": true + }, + "node_modules/eslint-config-standard-with-typescript": { + "resolved": "../../node_modules/.pnpm/eslint-config-standard-with-typescript@43.0.1_@typescript-eslint+eslint-plugin@6.21.0_@typesc_gdz7pup2ygpczip36mdqeerqha/node_modules/eslint-config-standard-with-typescript", + "link": true + }, + "node_modules/figlet": { + "resolved": "../../node_modules/.pnpm/figlet@1.7.0/node_modules/figlet", + "link": true + }, + "node_modules/fs": { + "resolved": "../../node_modules/.pnpm/fs@0.0.1-security/node_modules/fs", + "link": true + }, + "node_modules/nodemon": { + "resolved": "../../node_modules/.pnpm/nodemon@3.1.4/node_modules/nodemon", + "link": true + }, + "node_modules/socket.io-client": { + "resolved": "../../node_modules/.pnpm/socket.io-client@4.7.5/node_modules/socket.io-client", + "link": true + } + } +} diff --git a/apps/cli/package.json b/apps/cli/package.json index ab079628..a43c1fdb 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -2,13 +2,13 @@ "name": "cli", "version": "1.0.0", "description": "CLI for keyshade", - "main": "index.js", + "main": "index.ts", "private": false, - "type": "commonjs", + "type": "module", "scripts": { - "build": "swc src --out-dir dist", + "build": "tsc && tsc-alias", "start": "node dist/src/index.js", - "dev": "pnpm build && node dist/src/index.js" + "dev": "pnpm build && node dist/index.js" }, "keywords": [], "author": "", @@ -24,8 +24,7 @@ "figlet": "^1.7.0", "fs": "0.0.1-security", "nodemon": "^3.1.4", - "socket.io-client": "^4.7.5", - "@keyshade/api-client": "workspace:../../packages/api-client" + "socket.io-client": "^4.7.5" }, "devDependencies": { "@swc/cli": "^0.4.0", diff --git a/apps/cli/src/commands/base.command.ts b/apps/cli/src/commands/base.command.ts index 30f2e65b..cb20c0de 100644 --- a/apps/cli/src/commands/base.command.ts +++ b/apps/cli/src/commands/base.command.ts @@ -38,7 +38,7 @@ export default abstract class BaseCommand { const args: string[] = data.slice(0, argsCount) await this.action({ args, options: commandOptions }) } catch (error) { - Logger.error(error.message as string) + Logger.error(`${error as string}`) process.exit(1) } }) diff --git a/apps/cli/src/commands/environment/delete.environment.ts b/apps/cli/src/commands/environment/delete.environment.ts index a4874360..521a96b3 100644 --- a/apps/cli/src/commands/environment/delete.environment.ts +++ b/apps/cli/src/commands/environment/delete.environment.ts @@ -49,7 +49,7 @@ export class DeleteEnvironment extends BaseCommand { if (success) { Logger.info('Environment deleted successfully') } else { - Logger.error(error.message) + Logger.error(`Error deleting environment: ${error.message}`) } } } diff --git a/apps/cli/src/commands/environment/get.environment.ts b/apps/cli/src/commands/environment/get.environment.ts index 8e543725..4ea604e8 100644 --- a/apps/cli/src/commands/environment/get.environment.ts +++ b/apps/cli/src/commands/environment/get.environment.ts @@ -56,7 +56,7 @@ export class GetEnvironment extends BaseCommand { `Environment ID: ${environment.id}, Name: ${environment.name}, Description: ${environment.description}` ) } else { - Logger.error(error.message) + Logger.error(`Error fetching environment: ${error.message}`) } } } diff --git a/apps/cli/src/commands/environment/update.environment.ts b/apps/cli/src/commands/environment/update.environment.ts index b1638ba6..a54d786f 100644 --- a/apps/cli/src/commands/environment/update.environment.ts +++ b/apps/cli/src/commands/environment/update.environment.ts @@ -76,7 +76,7 @@ export class UpdateEnvironment extends BaseCommand { `Environment ID: ${environment.id}, Name: ${environment.name}, Description: ${environment.description}` ) } else { - Logger.error(error.message) + Logger.error(`Error updating Environment: ${error}`) } } } diff --git a/apps/cli/src/commands/profile/list.profile.ts b/apps/cli/src/commands/profile/list.profile.ts index 550f927a..d9a71197 100644 --- a/apps/cli/src/commands/profile/list.profile.ts +++ b/apps/cli/src/commands/profile/list.profile.ts @@ -6,11 +6,8 @@ import type { CommandActionData, CommandOption } from '@/types/command/command.types' - -// eslint-disable-next-line @typescript-eslint/no-var-requires -const Table = require('cli-table') -// eslint-disable-next-line @typescript-eslint/no-var-requires -const colors = require('colors/safe') +import Table from 'cli-table' +// import * as colors from 'colors' export default class ListProfile extends BaseCommand { private profiles: ProfileConfig @@ -79,27 +76,25 @@ export default class ListProfile extends BaseCommand { const profileList = [] Object.keys(profiles).forEach((profile) => { profileList.push([ - `${defaultProfile === profile ? `${profile} ${colors.dim('(default)')}` : profile}`, + `${defaultProfile === profile ? `${profile} (default)` : profile}`, `${profiles[profile].apiKey}`, `${profiles[profile].baseUrl}` ]) }) table.push( - [ - colors.cyan.bold('Profile'), - colors.cyan.bold('API Key'), - colors.cyan.bold('Base URL') - ], + ['Profile', 'API Key', 'Base URL'], + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument ...profileList ) } else { const profileList = [] Object.keys(profiles).forEach((profile) => { profileList.push([ - `${defaultProfile === profile ? `${profile} ${colors.dim('(default)')}` : profile}` + `${defaultProfile === profile ? `${profile} (default)` : profile}` ]) }) - table.push([colors.cyan.bold('Profile')], ...profileList) + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + table.push(['Profile'], ...profileList) } console.log(table.toString()) diff --git a/apps/cli/src/commands/run.command.ts b/apps/cli/src/commands/run.command.ts index 0feda2bf..0bf43381 100644 --- a/apps/cli/src/commands/run.command.ts +++ b/apps/cli/src/commands/run.command.ts @@ -6,8 +6,6 @@ import type { CommandActionData, CommandArgument } from '@/types/command/command.types' -import { AuthController, SecretController, VariableController } from '@/http' -import type { ProjectRootConfig } from '@/types/index.types' import { fetchPrivateKeyConfig, fetchProjectRootConfig @@ -21,6 +19,8 @@ import type { import { decrypt } from '@/util/decrypt' +import { SecretController, VariableController } from '@keyshade/api-client' + export default class RunCommand extends BaseCommand { private processEnvironmentalVariables = {} @@ -47,7 +47,7 @@ export default class RunCommand extends BaseCommand { async action({ args }: CommandActionData): Promise { const configurations = await this.fetchConfigurations() - await AuthController.checkApiKeyValidity(this.baseUrl, this.apiKey) + await this.checkApiKeyValidity(this.baseUrl, this.apiKey) await this.connectToSocket(configurations) await this.sleep(3000) await this.prefetchConfigurations() @@ -179,26 +179,42 @@ export default class RunCommand extends BaseCommand { private async prefetchConfigurations() { Logger.info('Prefetching configurations...') - // Fetch all secrets - const secrets = await SecretController.fetchSecrets( - this.baseUrl, - this.apiKey, - this.projectId, - this.environmentId - ) + const secretController = new SecretController(this.baseUrl) + const variableController = new VariableController(this.baseUrl) - // Fetch all variables - const variables = await VariableController.fetchVariables( - this.baseUrl, - this.apiKey, - this.projectId, - this.environmentId + const secretsResponse = await secretController.getAllSecretsOfEnvironment( + { + environmentId: this.environmentId, + projectId: this.projectId + }, + { + 'x-keyshade-token': this.apiKey + } ) + if (!secretsResponse.success) { + throw new Error(secretsResponse.error.message as string) + } + + const variablesResponse = + await variableController.getAllVariablesOfEnvironment( + { + environmentId: this.environmentId, + projectId: this.projectId + }, + { + 'x-keyshade-token': this.apiKey + } + ) + + if (!variablesResponse.success) { + throw new Error(variablesResponse.error.message as string) + } + // Merge secrets and variables - const configurations = [...secrets, ...variables] + const configurations = [...secretsResponse.data, ...variablesResponse.data] Logger.info( - `Fetched ${configurations.length} configurations (${secrets.length} secrets, ${variables.length} variables)` + `Fetched ${configurations.length} configurations (${secretsResponse.data.length} secrets, ${variablesResponse.data.length} variables)` ) // Set the configurations as environmental variables @@ -212,4 +228,24 @@ export default class RunCommand extends BaseCommand { setTimeout(resolve, ms) }) } + + private async checkApiKeyValidity( + baseUrl: string, + apiKey: string + ): Promise { + Logger.info('Checking API key validity...') + const response = await fetch(`${baseUrl}/api/api-key/access/live-updates`, { + headers: { + 'x-keyshade-token': apiKey + } + }) + + if (!response.ok) { + throw new Error( + 'API key is not valid. Please check the key and try again.' + ) + } + + Logger.info('API key is valid!') + } } diff --git a/apps/cli/src/http/auth.ts b/apps/cli/src/http/auth.ts deleted file mode 100644 index d53108f7..00000000 --- a/apps/cli/src/http/auth.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Logger } from '@/util/logger' - -class AuthController { - static async checkApiKeyValidity( - baseUrl: string, - apiKey: string - ): Promise { - Logger.info('Checking API key validity...') - const response = await fetch(`${baseUrl}/api/api-key/access/live-updates`, { - headers: { - 'x-keyshade-token': apiKey - } - }) - - if (!response.ok) { - throw new Error( - 'API key is not valid. Please check the key and try again.' - ) - } - - Logger.info('API key is valid!') - } -} - -export default AuthController diff --git a/apps/cli/src/http/index.ts b/apps/cli/src/http/index.ts deleted file mode 100644 index 926ab844..00000000 --- a/apps/cli/src/http/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import SecretController from './secret' -import VariableController from './variable' -import AuthController from './auth' - -export { SecretController, VariableController, AuthController } diff --git a/apps/cli/src/http/project.ts b/apps/cli/src/http/project.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/cli/src/http/secret.ts b/apps/cli/src/http/secret.ts deleted file mode 100644 index a5a9d0e6..00000000 --- a/apps/cli/src/http/secret.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Configuration } from '@/types/command/run.types' - -class SecretController { - static async fetchSecrets( - baseUrl: string, - apiKey: string, - projectId: string, - environmentId: string - ): Promise { - const response = await fetch( - `${baseUrl}/api/secret/${projectId}/${environmentId}`, - { - method: 'GET', - headers: { - 'x-keyshade-token': apiKey - } - } - ) - - if (!response.ok) { - throw new Error('Failed to fetch secrets: ' + response.statusText) - } - - return (await response.json()) as Configuration[] - } -} - -export default SecretController diff --git a/apps/cli/src/http/variable.ts b/apps/cli/src/http/variable.ts deleted file mode 100644 index cc3a4363..00000000 --- a/apps/cli/src/http/variable.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Configuration } from '@/types/command/run.types' - -class VariableController { - static async fetchVariables( - baseUrl: string, - apiKey: string, - projectId: string, - environmentId: string - ): Promise { - const response = await fetch( - `${baseUrl}/api/variable/${projectId}/${environmentId}`, - { - method: 'GET', - headers: { - 'x-keyshade-token': apiKey - } - } - ) - - if (!response.ok) { - throw new Error('Failed to fetch variables: ' + response.statusText) - } - - return (await response.json()) as Configuration[] - } -} - -export default VariableController diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.ts index f1a78a03..b4abea66 100644 --- a/apps/cli/src/index.ts +++ b/apps/cli/src/index.ts @@ -1,9 +1,9 @@ import { Command } from 'commander' -import type BaseCommand from '@/commands/base.command' -import ProfileCommand from '@/commands/profile.command' -import InitCommand from '@/commands/init.command' -import RunCommand from '@/commands/run.command' -import EnvironmentCommand from '@/commands/environment.command' +import type BaseCommand from './commands/base.command' +import InitCommand from './commands/init.command' +import RunCommand from './commands/run.command' +import ProfileCommand from './commands/profile.command' +import EnvironmentCommand from './commands/environment.command' const program = new Command() diff --git a/apps/cli/tsconfig.json b/apps/cli/tsconfig.json index 3867967a..424a6338 100644 --- a/apps/cli/tsconfig.json +++ b/apps/cli/tsconfig.json @@ -1,26 +1,16 @@ { + "extends": "../../packages/tsconfig/base.json", "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2021", - "sourceMap": true, - "outDir": "./dist", "baseUrl": ".", "paths": { - "@/*": ["./src/*"], - "@keyshade/api-client": ["../../packages/api-client/src/index.ts"] + "@/*": ["./src/*"] }, - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": false, - "noImplicitAny": false, - "strictBindCallApply": false, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true + "outDir": "dist", + "plugins": [{ "transform": "typescript-transform-paths" }] + }, + "tsc-alias": { + "resolveFullPaths": true, + "verbose": false }, "ts-node": { "require": ["tsconfig-paths/register"] diff --git a/package.json b/package.json index 6bfe4fad..f0f336ea 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "2.3.0", "license": "MPL-2.0", "private": true, + "type": "module", "engineStrict": false, "packageManager": "pnpm@9.2.0", "release": { @@ -178,7 +179,10 @@ "sharp": "^0.33.3", "tailwind-merge": "^2.3.0", "ts-node": "^10.9.2", + "tsc-alias": "^1.8.10", + "typescript": "^5.5.2", + "typescript-transform-paths": "^3.5.0", "zod": "^3.23.6", - "typescript": "^5.5.2" + "@keyshade/api-client": "workspace:*" } } diff --git a/packages/api-client/package.json b/packages/api-client/package.json index 19bc6929..9eba7136 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -4,8 +4,9 @@ "main": "dist/src/index.js", "description": "This package holds all the API request logic", "private": true, + "type": "module", "scripts": { - "build": "tsc", + "build": "tsc && tsc-alias", "watch": "tsc -w", "start": "node dist/index.js", "dev": "npx tsc && node dist/index.js", diff --git a/packages/api-client/src/controllers/secret.ts b/packages/api-client/src/controllers/secret.ts index 82b8802a..0cd66b63 100644 --- a/packages/api-client/src/controllers/secret.ts +++ b/packages/api-client/src/controllers/secret.ts @@ -93,12 +93,7 @@ export default class SecretController { request: GetAllSecretsOfEnvironmentRequest, headers?: Record ): Promise> { - let url = `/api/secret/${request.projectId}/${request.environmentId}` - request.page && (url += `page=${request.page}&`) - request.limit && (url += `limit=${request.limit}&`) - request.sort && (url += `sort=${request.sort}&`) - request.order && (url += `order=${request.order}&`) - request.search && (url += `search=${request.search}&`) + const url = `/api/secret/${request.projectId}/${request.environmentId}` const response = await this.apiClient.get(url, headers) return await parseResponse(response) diff --git a/packages/api-client/src/controllers/variable.ts b/packages/api-client/src/controllers/variable.ts index f3972a0f..521da12d 100644 --- a/packages/api-client/src/controllers/variable.ts +++ b/packages/api-client/src/controllers/variable.ts @@ -92,12 +92,7 @@ export default class VariableController { request: GetAllVariablesOfEnvironmentRequest, headers: Record ): Promise> { - let url = `/api/variable/${request.projectId}/${request.environmentId}` - request.page && (url += `page=${request.page}&`) - request.limit && (url += `limit=${request.limit}&`) - request.sort && (url += `sort=${request.sort}&`) - request.order && (url += `order=${request.order}&`) - request.search && (url += `search=${request.search}&`) + const url = `/api/variable/${request.projectId}/${request.environmentId}` const response = await this.apiClient.get(url, headers) return await parseResponse(response) diff --git a/packages/api-client/src/index.ts b/packages/api-client/src/index.ts index e87c54ba..c2785808 100644 --- a/packages/api-client/src/index.ts +++ b/packages/api-client/src/index.ts @@ -1,11 +1,15 @@ -import EnvironmentController from './controllers/environment' -import SecretController from './controllers/secret' -import EventController from './controllers/event' -import IntegrationController from './controllers/integration' +import EnvironmentController from '@api-client/controllers/environment' +import SecretController from '@api-client/controllers/secret' +import EventController from '@api-client/controllers/event' +import IntegrationController from '@api-client/controllers/integration' +import ProjectController from '@api-client/controllers/project' +import VariableController from '@api-client/controllers/variable' export { EnvironmentController, SecretController, EventController, - IntegrationController + IntegrationController, + ProjectController, + VariableController } diff --git a/packages/api-client/src/types/secret.types.d.ts b/packages/api-client/src/types/secret.types.d.ts index 12336787..4aeebc01 100644 --- a/packages/api-client/src/types/secret.types.d.ts +++ b/packages/api-client/src/types/secret.types.d.ts @@ -113,14 +113,9 @@ export interface GetAllSecretsOfProjectResponse export interface GetAllSecretsOfEnvironmentRequest { projectId: string environmentId: string - page?: number - limit?: number - sort?: string - order?: string - search?: string } -export interface GetAllSecretsOfEnvironmentResponse { +export type GetAllSecretsOfEnvironmentResponse = { name: string value: string isPlaintext: boolean -} +}[] diff --git a/packages/api-client/src/types/variable.types.d.ts b/packages/api-client/src/types/variable.types.d.ts index a7b51e5f..a7b245e8 100644 --- a/packages/api-client/src/types/variable.types.d.ts +++ b/packages/api-client/src/types/variable.types.d.ts @@ -114,9 +114,8 @@ export interface GetAllVariablesOfEnvironmentRequest { search?: string } -export interface GetAllVariablesOfEnvironmentResponse - extends Page<{ - name: string - value: string - isPlaintext: boolean - }> {} +export type GetAllVariablesOfEnvironmentResponse = { + name: string + value: string + isPlaintext: boolean +}[] diff --git a/packages/api-client/tsconfig.json b/packages/api-client/tsconfig.json index 75d6ba4e..4671d0fe 100644 --- a/packages/api-client/tsconfig.json +++ b/packages/api-client/tsconfig.json @@ -1,11 +1,16 @@ { "extends": "../tsconfig/base.json", "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./", + "baseUrl": ".", "paths": { - "@api-client/*": ["src/*"] - } + "@api-client/*": ["./src/*"] + }, + "outDir": "dist", + "plugins": [{ "transform": "typescript-transform-paths" }] + }, + "tsc-alias": { + "resolveFullPaths": true, + "verbose": false }, "include": ["src/**/*.ts", "tests/**/*.ts", "jest.config.ts"], "exclude": ["node_modules", "dist"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8c913990..efa33f83 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@keyshade/api-client': + specifier: workspace:* + version: link:packages/api-client '@semantic-release/changelog': specifier: ^6.0.3 version: 6.0.3(semantic-release@24.0.0(typescript@5.5.4)) @@ -62,9 +65,15 @@ importers: ts-node: specifier: ^10.9.2 version: 10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4) + tsc-alias: + specifier: ^1.8.10 + version: 1.8.10 typescript: specifier: ^5.5.2 version: 5.5.4 + typescript-transform-paths: + specifier: ^3.5.0 + version: 3.5.0(typescript@5.5.4) zod: specifier: ^3.23.6 version: 3.23.8 @@ -277,9 +286,6 @@ importers: '@clack/prompts': specifier: ^0.7.0 version: 0.7.0 - '@keyshade/api-client': - specifier: workspace:../../packages/api-client - version: link:../../packages/api-client chalk: specifier: ^4.1.2 version: 4.1.2 @@ -4097,6 +4103,10 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} + commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + comment-json@4.2.3: resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==} engines: {node: '>= 6'} @@ -6437,6 +6447,10 @@ packages: minimalistic-crypto-utils@1.0.1: resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + minimatch@10.0.1: + resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + engines: {node: 20 || >=22} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -6501,6 +6515,10 @@ packages: resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + mylas@2.1.13: + resolution: {integrity: sha512-+MrqnJRtxdF+xngFfUUkIMQrUUL0KsxbADUkn23Z/4ibGg192Q+z+CQyiYwvWTsYjJygmMR8+w3ZDa98Zh6ESg==} + engines: {node: '>=12.0.0'} + mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -7023,6 +7041,10 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + plimit-lit@1.6.1: + resolution: {integrity: sha512-B7+VDyb8Tl6oMJT9oSO2CW8XC/T4UcJGrwOVoNGwOQsQYhlpfajmrMj5xeejqaASq3V/EqThyOeATEOMuSEXiA==} + engines: {node: '>=12'} + pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} @@ -7227,6 +7249,10 @@ packages: resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==} engines: {node: '>=6'} + queue-lit@1.5.2: + resolution: {integrity: sha512-tLc36IOPeMAubu8BkW8YDBV+WyIgKlYU7zUNs0J5Vk9skSZ4JfGlPOqplP0aHdfv7HL0B2Pg6nwiq60Qc6M2Hw==} + engines: {node: '>=12'} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -8143,6 +8169,10 @@ packages: '@swc/wasm': optional: true + tsc-alias@1.8.10: + resolution: {integrity: sha512-Ibv4KAWfFkFdKJxnWfVtdOmB0Zi1RJVxcbPGiCDsFpCQSsmpWyuzHG3rQyI5YkobWwxFPEyQfu1hdo4qLG2zPw==} + hasBin: true + tsconfig-paths-webpack-plugin@4.1.0: resolution: {integrity: sha512-xWFISjviPydmtmgeUAuXp4N1fky+VCtfhOkDUFIv5ea7p4wuTomI4QTrXvFBX2S4jZsmyTSrStQl+E+4w+RzxA==} engines: {node: '>=10.13.0'} @@ -8259,6 +8289,11 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + typescript-transform-paths@3.5.0: + resolution: {integrity: sha512-Qsm5elv11DWu1q+yaugV37ygHhSLhPExkkQu3+blIYfEZAMtY6jSdXANoaR7p+uDoAAHrWXSzwFYK9AmTApLvw==} + peerDependencies: + typescript: '>=3.6.5' + typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} @@ -12916,6 +12951,8 @@ snapshots: commander@8.3.0: {} + commander@9.5.0: {} + comment-json@4.2.3: dependencies: array-timsort: 1.0.3 @@ -16058,6 +16095,10 @@ snapshots: minimalistic-crypto-utils@1.0.1: {} + minimatch@10.0.1: + dependencies: + brace-expansion: 2.0.1 + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -16131,6 +16172,8 @@ snapshots: mute-stream@1.0.0: {} + mylas@2.1.13: {} + mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -16577,6 +16620,10 @@ snapshots: dependencies: find-up: 4.1.0 + plimit-lit@1.6.1: + dependencies: + queue-lit: 1.5.2 + pluralize@8.0.0: {} possible-typed-array-names@1.0.0: {} @@ -16718,6 +16765,8 @@ snapshots: split-on-first: 1.1.0 strict-uri-encode: 2.0.0 + queue-lit@1.5.2: {} + queue-microtask@1.2.3: {} quick-format-unescaped@4.0.4: {} @@ -17846,6 +17895,15 @@ snapshots: optionalDependencies: '@swc/core': 1.7.3(@swc/helpers@0.5.2) + tsc-alias@1.8.10: + dependencies: + chokidar: 3.6.0 + commander: 9.5.0 + globby: 11.1.0 + mylas: 2.1.13 + normalize-path: 3.0.0 + plimit-lit: 1.6.1 + tsconfig-paths-webpack-plugin@4.1.0: dependencies: chalk: 4.1.2 @@ -17960,6 +18018,11 @@ snapshots: typedarray@0.0.6: {} + typescript-transform-paths@3.5.0(typescript@5.5.4): + dependencies: + minimatch: 10.0.1 + typescript: 5.5.4 + typescript@4.9.5: {} typescript@5.3.3: {}