From 1f9d9cf7ac99c9f8c44508041f9a76768f5db01f Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 19 Jun 2024 02:21:53 +0100 Subject: [PATCH 01/68] fix(prisma): missing bot label in seed command --- packages/prisma/seed.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/prisma/seed.ts b/packages/prisma/seed.ts index 4621050f..645c6da9 100644 --- a/packages/prisma/seed.ts +++ b/packages/prisma/seed.ts @@ -49,6 +49,7 @@ async function main() { secretKey: "YOUR_EXCHANGE_API_SECRET_KEY", password: "YOU_EXCHANGE_API_PASSPHRASE", isDemoAccount: true, + label: "DEFAULT", owner: { connect: { id: user.id, From f4d2db0aee4054e715b00e846ec27c9fdf1362a9 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 19 Jun 2024 02:22:06 +0100 Subject: [PATCH 02/68] chore: upgrade turbo and pnpm --- package.json | 4 ++-- turbo.json | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 95ff58a4..b0b78cc0 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "engines": { "node": ">=18.0.0" }, - "packageManager": "pnpm@9.2.0", + "packageManager": "pnpm@9.4.0", "devDependencies": { "prettier": "^3.2.5", "ts-node": "10.9.2", - "turbo": "^1.13.3" + "turbo": "^2.0.4" }, "scripts": { "lint": "turbo run lint", diff --git a/turbo.json b/turbo.json index a215f643..d90a92a4 100644 --- a/turbo.json +++ b/turbo.json @@ -1,9 +1,14 @@ { "$schema": "https://turbo.build/schema.json", - "pipeline": { + "tasks": { "build": { - "dependsOn": ["^build"], - "outputs": [".next/**", "dist"] + "dependsOn": [ + "^build" + ], + "outputs": [ + ".next/**", + "dist" + ] }, "lint": {}, "lint:fix": {}, From 2e54b382885d31a39b460bd4e2087d7626b82a8a Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 19 Jun 2024 03:11:43 +0100 Subject: [PATCH 03/68] chore: upgrade dependencies --- apps/cli/package.json | 10 +++++----- package.json | 2 +- packages/backtesting/package.json | 4 ++-- packages/bot-processor/package.json | 4 ++-- packages/bot-templates/package.json | 4 ++-- packages/bot/package.json | 2 +- packages/db/package.json | 2 +- packages/exchanges/package.json | 2 +- packages/indicators/package.json | 4 ++-- packages/logger/package.json | 6 +++--- packages/prisma/package.json | 2 +- packages/processing/package.json | 4 ++-- packages/tools/package.json | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 41714946..251946e6 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -15,12 +15,12 @@ "@opentrader/eslint-config": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "eslint": "8.54.0", "ts-loader": "^9.5.1", "ts-node": "10.9.2", "typescript": "5.4.5", - "webpack": "^5.91.0", + "webpack": "^5.92.0", "webpack-cli": "^5.1.4", "webpack-node-externals": "^3.0.0" }, @@ -36,10 +36,10 @@ "@opentrader/tools": "workspace:*", "@prisma/client": "5.15.0", "ccxt": "4.3.27", - "commander": "^12.0.0", + "commander": "^12.1.0", "jayson": "^4.1.0", "json5": "^2.2.3", - "pino": "^9.0.0", - "pino-pretty": "^11.0.0" + "pino": "^9.2.0", + "pino-pretty": "^11.2.1" } } diff --git a/package.json b/package.json index b0b78cc0..0b92ebad 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "packageManager": "pnpm@9.4.0", "devDependencies": { - "prettier": "^3.2.5", + "prettier": "^3.3.2", "ts-node": "10.9.2", "turbo": "^2.0.4" }, diff --git a/packages/backtesting/package.json b/packages/backtesting/package.json index 87075d98..cc3e2857 100644 --- a/packages/backtesting/package.json +++ b/packages/backtesting/package.json @@ -15,8 +15,8 @@ "@opentrader/eslint-config": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/lodash": "^4.17.1", - "@types/node": "^20.12.11", + "@types/lodash": "^4.17.5", + "@types/node": "^20.14.5", "eslint": "8.54.0", "typescript": "5.4.5" }, diff --git a/packages/bot-processor/package.json b/packages/bot-processor/package.json index dbf041f8..8adcfbce 100644 --- a/packages/bot-processor/package.json +++ b/packages/bot-processor/package.json @@ -15,10 +15,10 @@ "@opentrader/eslint-config": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "eslint": "8.54.0", "ts-node": "10.9.2", - "tslib": "^2.6.2", + "tslib": "^2.6.3", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/bot-templates/package.json b/packages/bot-templates/package.json index 79256fee..592a040c 100644 --- a/packages/bot-templates/package.json +++ b/packages/bot-templates/package.json @@ -23,10 +23,10 @@ "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/jest": "^29.5.12", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "eslint": "8.54.0", "jest": "^29.7.0", - "ts-jest": "^29.1.2", + "ts-jest": "^29.1.5", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/bot/package.json b/packages/bot/package.json index 3d72cb10..1c817d64 100644 --- a/packages/bot/package.json +++ b/packages/bot/package.json @@ -16,7 +16,7 @@ "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/async": "^3.2.24", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "@types/node-cron": "^3.0.11", "eslint": "8.54.0", "ts-node": "10.9.2", diff --git a/packages/db/package.json b/packages/db/package.json index fb05feb3..b2c22a2f 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -15,7 +15,7 @@ "@opentrader/eslint-config": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "eslint": "8.54.0", "typescript": "5.4.5" }, diff --git a/packages/exchanges/package.json b/packages/exchanges/package.json index 58c69bb9..50e34412 100644 --- a/packages/exchanges/package.json +++ b/packages/exchanges/package.json @@ -21,7 +21,7 @@ "@opentrader/eslint-config": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "eslint": "8.54.0", "typescript": "5.4.5" }, diff --git a/packages/indicators/package.json b/packages/indicators/package.json index a638ebcc..290a5045 100644 --- a/packages/indicators/package.json +++ b/packages/indicators/package.json @@ -18,10 +18,10 @@ "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/jest": "^29.5.12", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "eslint": "8.54.0", "jest": "^29.7.0", - "ts-jest": "^29.1.2", + "ts-jest": "^29.1.5", "ts-node": "10.9.2", "typescript": "5.4.5" }, diff --git a/packages/logger/package.json b/packages/logger/package.json index 5d5b7267..c1c9a66b 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -15,14 +15,14 @@ "@opentrader/eslint-config": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "eslint": "8.54.0", "ts-node": "10.9.2", "typescript": "5.4.5" }, "dependencies": { "chalk": "^4.1.2", - "pino": "^9.0.0", - "pino-pretty": "^11.0.0" + "pino": "^9.2.0", + "pino-pretty": "^11.2.1" } } diff --git a/packages/prisma/package.json b/packages/prisma/package.json index 80ee118b..cdea8e7b 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -17,7 +17,7 @@ "license": "Apache-2.0", "devDependencies": { "@opentrader/tsconfig": "workspace:*", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "ts-node": "10.9.2", "typescript": "5.4.5" }, diff --git a/packages/processing/package.json b/packages/processing/package.json index e4dd2d70..2dc5a199 100644 --- a/packages/processing/package.json +++ b/packages/processing/package.json @@ -18,10 +18,10 @@ "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/jest": "^29.5.12", - "@types/node": "^20.12.11", + "@types/node": "^20.14.5", "eslint": "8.54.0", "jest": "^29.7.0", - "ts-jest": "^29.1.2", + "ts-jest": "^29.1.5", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/tools/package.json b/packages/tools/package.json index 7d95c5a8..c7e4a8df 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -20,7 +20,7 @@ "@types/jest": "^29.5.12", "eslint": "8.54.0", "jest": "^29.7.0", - "ts-jest": "^29.1.2", + "ts-jest": "^29.1.5", "typescript": "5.4.5" }, "dependencies": { From 9b34a676655d661b261451ea74fddada1d8f3cf8 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 19 Jun 2024 20:52:28 +0100 Subject: [PATCH 04/68] refactor(packages/types): build with ESM target --- .../exchanges/src/exchanges/ccxt/normalize.ts | 13 ++-- .../exchange-account/orders.synchronizer.ts | 4 +- packages/tsconfig/esm.json | 8 +++ packages/tsconfig/package.json | 6 +- .../types/{.eslintrc.js => _.eslintrc.js} | 0 packages/types/package.json | 8 ++- .../{enums/bar-size.enum.ts => enums.ts} | 11 ++++ .../src/common/enums/exchange-code.enum.ts | 10 --- packages/types/src/common/index.ts | 2 - .../account/common.ts} | 0 .../account/get-trading-fee-rates.ts} | 5 ++ packages/types/src/exchange/index.ts | 15 +++++ .../market-data/get-candlesticks.ts} | 18 ++++++ .../public-data/get-market-price.ts} | 7 ++ .../exchange/public-data/get-symbols-info.ts | 64 +++++++++++++++++++ .../trade/cancel-limit-order.ts} | 7 ++ .../trade/common/enums.ts} | 1 + .../trade/get-closed-orders.ts} | 14 ++-- .../trade/get-limit-order.ts} | 16 +++-- .../trade/get-open-orders.ts} | 14 ++-- .../trade/place-limit-order.ts} | 13 +++- .../trade/place-market-order.ts} | 13 +++- .../trade/place-stop-order.ts} | 13 +++- .../types/src/exchange/trade/watch-candles.ts | 10 +++ .../trade/watch-orders.ts} | 11 +++- .../api/account/account-asset/index.ts | 1 - .../types/src/exchanges/api/account/index.ts | 2 - ...et-trading-fee-rates-response.interface.ts | 4 -- .../exchanges/api/account/trade-fee/index.ts | 2 - .../types/src/exchanges/api/helpers/index.ts | 1 - .../api/helpers/trading-pair-symbol/index.ts | 1 - .../trading-pair-symbol-request.interface.ts | 10 --- packages/types/src/exchanges/api/index.ts | 5 -- .../get-candlesticks-request.interface.ts | 17 ----- .../api/market-data/get-candlesticks/index.ts | 2 - .../get-candlesticks/types/index.ts | 1 - .../src/exchanges/api/market-data/index.ts | 1 - .../get-market-price-request.interface.ts | 6 -- .../api/public-data/get-market-price/index.ts | 2 - .../get-symbol-info-request.interface.ts | 6 -- .../api/public-data/get-symbols-info/index.ts | 2 - .../get-symbols-info/types/index.ts | 2 - .../types/symbol-filter.interface.ts | 27 -------- .../types/symbol-info.interface.ts | 30 --------- .../src/exchanges/api/public-data/index.ts | 2 - .../cancel-limit-order-response.interface.ts | 6 -- .../api/trade/cancel-limit-order/index.ts | 2 - .../src/exchanges/api/trade/common/index.ts | 1 - .../exchanges/api/trade/common/types/index.ts | 2 - .../api/trade/common/types/order-side.type.ts | 1 - .../get-closed-orders-request.interface.ts | 6 -- .../get-closed-orders-response.interface.ts | 3 - .../api/trade/get-closed-orders/index.ts | 3 - .../get-limit-order-request.interface.ts | 10 --- .../api/trade/get-limit-order/index.ts | 2 - .../get-open-orders-request.interface.ts | 6 -- .../get-open-orders-response.interface.ts | 3 - .../api/trade/get-open-orders/index.ts | 3 - .../types/src/exchanges/api/trade/index.ts | 10 --- .../api/trade/place-limit-order/index.ts | 2 - .../place-limit-order-response.interface.ts | 10 --- .../api/trade/place-market-order/index.ts | 2 - .../place-market-order-response.interface.ts | 10 --- .../api/trade/place-stop-order/index.ts | 2 - .../place-stop-order-response.interface.ts | 10 --- .../api/trade/watch-candles/index.ts | 2 - .../watch-candles-request.interface.ts | 6 -- .../watch-candles-response.interface.ts | 3 - .../exchanges/api/trade/watch-orders/index.ts | 3 - .../watch-orders-request.interface.ts | 6 -- .../watch-orders-response.interface.ts | 3 - packages/types/src/exchanges/index.ts | 1 - .../src/grid-bot/grid-level.interface.ts | 2 +- packages/types/src/grid-bot/index.ts | 4 +- packages/types/src/index.ts | 10 +-- packages/types/src/indicators/candle.ts | 2 +- packages/types/src/indicators/index.ts | 4 +- packages/types/src/indicators/indicators.ts | 3 +- .../src/smart-trade/common/enums/index.ts | 3 - .../common/enums/order-side.enum.ts | 4 -- .../common/enums/order-status.enum.ts | 8 --- .../smart-trade/common/enums/order-type.ts | 6 -- .../types/src/smart-trade/common/index.ts | 1 - packages/types/src/smart-trade/enums.ts | 20 ++++++ packages/types/src/smart-trade/index.ts | 1 - packages/types/tsconfig.json | 2 +- packages/types/tsup.config.ts | 8 +++ 87 files changed, 284 insertions(+), 319 deletions(-) create mode 100644 packages/tsconfig/esm.json rename packages/types/{.eslintrc.js => _.eslintrc.js} (100%) rename packages/types/src/common/{enums/bar-size.enum.ts => enums.ts} (54%) delete mode 100644 packages/types/src/common/enums/exchange-code.enum.ts delete mode 100644 packages/types/src/common/index.ts rename packages/types/src/{exchanges/api/account/account-asset/account-asset.interface.ts => exchange/account/common.ts} (100%) rename packages/types/src/{exchanges/api/account/trade-fee/get-trading-fee-rates-request.interface.ts => exchange/account/get-trading-fee-rates.ts} (62%) create mode 100644 packages/types/src/exchange/index.ts rename packages/types/src/{exchanges/api/market-data/get-candlesticks/types/candlestick.interface.ts => exchange/market-data/get-candlesticks.ts} (52%) rename packages/types/src/{exchanges/api/public-data/get-market-price/get-market-price-response.interface.ts => exchange/public-data/get-market-price.ts} (66%) create mode 100644 packages/types/src/exchange/public-data/get-symbols-info.ts rename packages/types/src/{exchanges/api/trade/cancel-limit-order/cancel-limit-order-request.interface.ts => exchange/trade/cancel-limit-order.ts} (59%) rename packages/types/src/{exchanges/api/trade/common/types/order-status.type.ts => exchange/trade/common/enums.ts} (66%) rename packages/types/src/{exchanges/api/trade/get-closed-orders/types/closed-order.interface.ts => exchange/trade/get-closed-orders.ts} (76%) rename packages/types/src/{exchanges/api/trade/get-limit-order/get-limit-order-response.interface.ts => exchange/trade/get-limit-order.ts} (75%) rename packages/types/src/{exchanges/api/trade/get-open-orders/types/open-order.interface.ts => exchange/trade/get-open-orders.ts} (76%) rename packages/types/src/{exchanges/api/trade/place-limit-order/place-limit-order-request.interface.ts => exchange/trade/place-limit-order.ts} (59%) rename packages/types/src/{exchanges/api/trade/place-market-order/place-market-order-request.interface.ts => exchange/trade/place-market-order.ts} (55%) rename packages/types/src/{exchanges/api/trade/place-stop-order/place-stop-order-request.interface.ts => exchange/trade/place-stop-order.ts} (65%) create mode 100644 packages/types/src/exchange/trade/watch-candles.ts rename packages/types/src/{exchanges/api/trade/watch-orders/types/watch-order.interface.ts => exchange/trade/watch-orders.ts} (76%) delete mode 100644 packages/types/src/exchanges/api/account/account-asset/index.ts delete mode 100644 packages/types/src/exchanges/api/account/index.ts delete mode 100644 packages/types/src/exchanges/api/account/trade-fee/get-trading-fee-rates-response.interface.ts delete mode 100644 packages/types/src/exchanges/api/account/trade-fee/index.ts delete mode 100644 packages/types/src/exchanges/api/helpers/index.ts delete mode 100644 packages/types/src/exchanges/api/helpers/trading-pair-symbol/index.ts delete mode 100644 packages/types/src/exchanges/api/helpers/trading-pair-symbol/trading-pair-symbol-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/index.ts delete mode 100644 packages/types/src/exchanges/api/market-data/get-candlesticks/get-candlesticks-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/market-data/get-candlesticks/index.ts delete mode 100644 packages/types/src/exchanges/api/market-data/get-candlesticks/types/index.ts delete mode 100644 packages/types/src/exchanges/api/market-data/index.ts delete mode 100644 packages/types/src/exchanges/api/public-data/get-market-price/get-market-price-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/public-data/get-market-price/index.ts delete mode 100644 packages/types/src/exchanges/api/public-data/get-symbols-info/get-symbol-info-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/public-data/get-symbols-info/index.ts delete mode 100644 packages/types/src/exchanges/api/public-data/get-symbols-info/types/index.ts delete mode 100644 packages/types/src/exchanges/api/public-data/get-symbols-info/types/symbol-filter.interface.ts delete mode 100644 packages/types/src/exchanges/api/public-data/get-symbols-info/types/symbol-info.interface.ts delete mode 100644 packages/types/src/exchanges/api/public-data/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/cancel-limit-order/cancel-limit-order-response.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/cancel-limit-order/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/common/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/common/types/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/common/types/order-side.type.ts delete mode 100644 packages/types/src/exchanges/api/trade/get-closed-orders/get-closed-orders-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/get-closed-orders/get-closed-orders-response.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/get-closed-orders/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/get-limit-order/get-limit-order-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/get-limit-order/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/get-open-orders/get-open-orders-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/get-open-orders/get-open-orders-response.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/get-open-orders/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/place-limit-order/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/place-limit-order/place-limit-order-response.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/place-market-order/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/place-market-order/place-market-order-response.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/place-stop-order/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/place-stop-order/place-stop-order-response.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/watch-candles/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/watch-candles/watch-candles-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/watch-candles/watch-candles-response.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/watch-orders/index.ts delete mode 100644 packages/types/src/exchanges/api/trade/watch-orders/watch-orders-request.interface.ts delete mode 100644 packages/types/src/exchanges/api/trade/watch-orders/watch-orders-response.interface.ts delete mode 100644 packages/types/src/exchanges/index.ts delete mode 100644 packages/types/src/smart-trade/common/enums/index.ts delete mode 100644 packages/types/src/smart-trade/common/enums/order-side.enum.ts delete mode 100644 packages/types/src/smart-trade/common/enums/order-status.enum.ts delete mode 100644 packages/types/src/smart-trade/common/enums/order-type.ts delete mode 100644 packages/types/src/smart-trade/common/index.ts create mode 100644 packages/types/src/smart-trade/enums.ts delete mode 100644 packages/types/src/smart-trade/index.ts create mode 100644 packages/types/tsup.config.ts diff --git a/packages/exchanges/src/exchanges/ccxt/normalize.ts b/packages/exchanges/src/exchanges/ccxt/normalize.ts index 28f7c549..3ec15899 100644 --- a/packages/exchanges/src/exchanges/ccxt/normalize.ts +++ b/packages/exchanges/src/exchanges/ccxt/normalize.ts @@ -1,6 +1,7 @@ import { composeSymbolIdFromPair, getExponentAbs } from "@opentrader/tools"; import type { Normalize } from "../../types/normalize.interface"; import { normalizeOrderStatus } from "../../utils/normalizeOrderStatus"; +import { OrderSide } from "@opentrader/types"; const accountAssets: Normalize["accountAssets"] = { response: (data) => @@ -18,7 +19,7 @@ const getLimitOrder: Normalize["getLimitOrder"] = { response: (order) => ({ exchangeOrderId: order.id, clientOrderId: order.clientOrderId, - side: order.side, + side: order.side as OrderSide, quantity: order.amount, price: order.price, filledPrice: order.average || null, @@ -82,11 +83,11 @@ const getOpenOrders: Normalize["getOpenOrders"] = { orders.map((order) => ({ exchangeOrderId: order.id, clientOrderId: order.clientOrderId, - side: order.side, + side: order.side as OrderSide, quantity: order.amount, price: order.price, filledPrice: null, - status: normalizeOrderStatus(order), + status: normalizeOrderStatus(order) as "open", fee: order.fee?.cost || 0, createdAt: order.timestamp, lastTradeTimestamp: order.lastTradeTimestamp, @@ -99,11 +100,11 @@ const getClosedOrders: Normalize["getClosedOrders"] = { orders.map((order) => ({ exchangeOrderId: order.id, clientOrderId: order.clientOrderId, - side: order.side, + side: order.side as OrderSide, quantity: order.amount, price: order.price, filledPrice: order.average || order.price, // assume that filled order must always contain `order.average` - status: normalizeOrderStatus(order), + status: normalizeOrderStatus(order) as "filled" | "canceled", fee: order.fee?.cost || 0, createdAt: order.timestamp, lastTradeTimestamp: order.lastTradeTimestamp, @@ -170,7 +171,7 @@ const watchOrders: Normalize["watchOrders"] = { orders.map((order) => ({ exchangeOrderId: order.id, clientOrderId: order.clientOrderId, - side: order.side, + side: order.side as OrderSide, quantity: order.amount, price: order.price, filledPrice: order.average || null, diff --git a/packages/processing/src/exchange-account/orders.synchronizer.ts b/packages/processing/src/exchange-account/orders.synchronizer.ts index 95ca7f2a..f1f50521 100644 --- a/packages/processing/src/exchange-account/orders.synchronizer.ts +++ b/packages/processing/src/exchange-account/orders.synchronizer.ts @@ -96,9 +96,9 @@ export class OrdersSynchronizer { affectedBotsIds.push(order.smartTrade.botId); if (exchangeOrder.status === "filled") { - params?.onFilled?.(exchangeOrder, order); + params?.onFilled?.(exchangeOrder as IClosedOrder, order); } else if (exchangeOrder.status === "canceled") { - params?.onCanceled?.(exchangeOrder, order); + params?.onCanceled?.(exchangeOrder as IClosedOrder, order); } } else { console.log( diff --git a/packages/tsconfig/esm.json b/packages/tsconfig/esm.json new file mode 100644 index 00000000..f0f84435 --- /dev/null +++ b/packages/tsconfig/esm.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": [ + "@tsconfig/node20/tsconfig.json", + "@tsconfig/strictest/tsconfig.json" + ], + "compilerOptions": {} +} diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json index 7ae93698..492f6da8 100644 --- a/packages/tsconfig/package.json +++ b/packages/tsconfig/package.json @@ -15,5 +15,9 @@ "bugs": { "url": "https://github.com/Open-Trader/opentrader/issues" }, - "homepage": "https://github.com/Open-Trader/opentrader/tree/master/packages/tsconfig" + "homepage": "https://github.com/Open-Trader/opentrader/tree/master/packages/tsconfig", + "devDependencies": { + "@tsconfig/node20": "^20.1.4", + "@tsconfig/strictest": "^2.0.5" + } } diff --git a/packages/types/.eslintrc.js b/packages/types/_.eslintrc.js similarity index 100% rename from packages/types/.eslintrc.js rename to packages/types/_.eslintrc.js diff --git a/packages/types/package.json b/packages/types/package.json index bd154339..82e74dbe 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -2,10 +2,11 @@ "name": "@opentrader/types", "version": "0.0.1", "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "type": "module", + "main": "dist/index.cjs", + "types": "dist/index.d.cts", "scripts": { - "build": "tsc", + "build": "tsup --dts", "lint": "eslint . --quiet" }, "author": "bludnic", @@ -14,6 +15,7 @@ "@opentrader/eslint-config": "workspace:*", "@opentrader/tsconfig": "workspace:*", "eslint": "8.54.0", + "tsup": "^8.1.0", "typescript": "5.4.5" } } diff --git a/packages/types/src/common/enums/bar-size.enum.ts b/packages/types/src/common/enums.ts similarity index 54% rename from packages/types/src/common/enums/bar-size.enum.ts rename to packages/types/src/common/enums.ts index 6393737f..24f73194 100644 --- a/packages/types/src/common/enums/bar-size.enum.ts +++ b/packages/types/src/common/enums.ts @@ -11,3 +11,14 @@ export const BarSize = { } as const; export type BarSize = (typeof BarSize)[keyof typeof BarSize]; + +export const ExchangeCode = { + OKX: "OKX", + BYBIT: "BYBIT", + BINANCE: "BINANCE", + KRAKEN: "KRAKEN", + COINBASE: "COINBASE", + GATEIO: "GATEIO", +} as const; + +export type ExchangeCode = (typeof ExchangeCode)[keyof typeof ExchangeCode]; diff --git a/packages/types/src/common/enums/exchange-code.enum.ts b/packages/types/src/common/enums/exchange-code.enum.ts deleted file mode 100644 index 2a122e83..00000000 --- a/packages/types/src/common/enums/exchange-code.enum.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const ExchangeCode = { - OKX: "OKX", - BYBIT: "BYBIT", - BINANCE: "BINANCE", - KRAKEN: "KRAKEN", - COINBASE: "COINBASE", - GATEIO: "GATEIO", -} as const; - -export type ExchangeCode = (typeof ExchangeCode)[keyof typeof ExchangeCode]; diff --git a/packages/types/src/common/index.ts b/packages/types/src/common/index.ts deleted file mode 100644 index 9eff5909..00000000 --- a/packages/types/src/common/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { BarSize } from "./enums/bar-size.enum"; -export { ExchangeCode } from "./enums/exchange-code.enum"; diff --git a/packages/types/src/exchanges/api/account/account-asset/account-asset.interface.ts b/packages/types/src/exchange/account/common.ts similarity index 100% rename from packages/types/src/exchanges/api/account/account-asset/account-asset.interface.ts rename to packages/types/src/exchange/account/common.ts diff --git a/packages/types/src/exchanges/api/account/trade-fee/get-trading-fee-rates-request.interface.ts b/packages/types/src/exchange/account/get-trading-fee-rates.ts similarity index 62% rename from packages/types/src/exchanges/api/account/trade-fee/get-trading-fee-rates-request.interface.ts rename to packages/types/src/exchange/account/get-trading-fee-rates.ts index 9df788da..ee40bc45 100644 --- a/packages/types/src/exchanges/api/account/trade-fee/get-trading-fee-rates-request.interface.ts +++ b/packages/types/src/exchange/account/get-trading-fee-rates.ts @@ -8,3 +8,8 @@ export interface IGetTradingFeeRatesRequest { */ quoteCurrency: string; } + +export interface IGetTradingFeeRatesResponse { + makerFee: number; + takerFee: number; +} diff --git a/packages/types/src/exchange/index.ts b/packages/types/src/exchange/index.ts new file mode 100644 index 00000000..0ea188be --- /dev/null +++ b/packages/types/src/exchange/index.ts @@ -0,0 +1,15 @@ +export * from "./account/common.js"; +export * from "./account/get-trading-fee-rates.js"; +export * from "./market-data/get-candlesticks.js"; +export * from "./public-data/get-market-price.js"; +export * from "./public-data/get-symbols-info.js"; +export * from "./trade/common/enums.js"; +export * from "./trade/cancel-limit-order.js"; +export * from "./trade/get-limit-order.js"; +export * from "./trade/place-limit-order.js"; +export * from "./trade/place-market-order.js"; +export * from "./trade/place-stop-order.js"; +export * from "./trade/get-open-orders.js"; +export * from "./trade/get-closed-orders.js"; +export * from "./trade/watch-orders.js"; +export * from "./trade/watch-candles.js"; diff --git a/packages/types/src/exchanges/api/market-data/get-candlesticks/types/candlestick.interface.ts b/packages/types/src/exchange/market-data/get-candlesticks.ts similarity index 52% rename from packages/types/src/exchanges/api/market-data/get-candlesticks/types/candlestick.interface.ts rename to packages/types/src/exchange/market-data/get-candlesticks.ts index ffc1a04b..ba0d7fa7 100644 --- a/packages/types/src/exchanges/api/market-data/get-candlesticks/types/candlestick.interface.ts +++ b/packages/types/src/exchange/market-data/get-candlesticks.ts @@ -1,3 +1,21 @@ +import type { BarSize } from "../../common/enums.js"; + +export interface IGetCandlesticksRequest { + /** + * e.g. ADA-USDT + */ + symbol: string; + bar?: BarSize; + /** + * Number of results per request. + */ + limit?: number; + /** + * Return results since specified timestamp. + */ + since?: number; +} + export interface ICandlestick { /** * Opening time of the candlestick, Unix timestamp format in milliseconds, diff --git a/packages/types/src/exchanges/api/public-data/get-market-price/get-market-price-response.interface.ts b/packages/types/src/exchange/public-data/get-market-price.ts similarity index 66% rename from packages/types/src/exchanges/api/public-data/get-market-price/get-market-price-response.interface.ts rename to packages/types/src/exchange/public-data/get-market-price.ts index bb5d504f..a708507a 100644 --- a/packages/types/src/exchanges/api/public-data/get-market-price/get-market-price-response.interface.ts +++ b/packages/types/src/exchange/public-data/get-market-price.ts @@ -1,3 +1,10 @@ +export interface IGetMarketPriceRequest { + /** + * e.g. ADA/USDT + */ + symbol: string; +} + export interface IGetMarketPriceResponse { /** * e.g. ADA-USDT diff --git a/packages/types/src/exchange/public-data/get-symbols-info.ts b/packages/types/src/exchange/public-data/get-symbols-info.ts new file mode 100644 index 00000000..d8522ea6 --- /dev/null +++ b/packages/types/src/exchange/public-data/get-symbols-info.ts @@ -0,0 +1,64 @@ +import type { ExchangeCode } from "../../common/enums.js"; + +export interface IGetSymbolInfoRequest { + /** + * e.g. BTC/USDT + */ + currencyPair: string; +} + +export interface ISymbolFilter { + precision: PrecisionFilter; + decimals: PrecisionDecimals; + limits: LimitsFilter; +} + +export interface PrecisionFilter { + amount?: number; + price?: number; +} + +export interface PrecisionDecimals { + amount?: number; + price?: number; +} + +export interface LimitsFilter { + amount?: MinMaxFilter; + cost?: MinMaxFilter; + leverage?: MinMaxFilter; + price?: MinMaxFilter; +} + +export interface MinMaxFilter { + min?: number; + max?: number; +} + +export interface ISymbolInfo { + /** + * e.g. OKX:BTC/USDT + */ + symbolId: string; + /** + * e.g. BTC/USDT + */ + currencyPair: string; + exchangeCode: ExchangeCode; + + /** + * Exchange supplied symbol ID + * + * Named as: + * - `symbol` on Binance + * - `instrumentId` on OKx + * - `productId` on Coinbase + * - May occur as `assetId` on other exchanges + */ + exchangeSymbolId: string; + + baseCurrency: string; + quoteCurrency: string; + + filters: ISymbolFilter; +} diff --git a/packages/types/src/exchanges/api/trade/cancel-limit-order/cancel-limit-order-request.interface.ts b/packages/types/src/exchange/trade/cancel-limit-order.ts similarity index 59% rename from packages/types/src/exchanges/api/trade/cancel-limit-order/cancel-limit-order-request.interface.ts rename to packages/types/src/exchange/trade/cancel-limit-order.ts index 9fa4a136..082f15c7 100644 --- a/packages/types/src/exchanges/api/trade/cancel-limit-order/cancel-limit-order-request.interface.ts +++ b/packages/types/src/exchange/trade/cancel-limit-order.ts @@ -8,3 +8,10 @@ export type ICancelLimitOrderRequest = { */ orderId: string; }; + +export interface ICancelLimitOrderResponse { + /** + * Exchange-supplied Order ID + */ + orderId: string; +} diff --git a/packages/types/src/exchanges/api/trade/common/types/order-status.type.ts b/packages/types/src/exchange/trade/common/enums.ts similarity index 66% rename from packages/types/src/exchanges/api/trade/common/types/order-status.type.ts rename to packages/types/src/exchange/trade/common/enums.ts index 270e47b2..46102790 100644 --- a/packages/types/src/exchanges/api/trade/common/types/order-status.type.ts +++ b/packages/types/src/exchange/trade/common/enums.ts @@ -1 +1,2 @@ +export type OrderSide = "buy" | "sell"; export type OrderStatus = "canceled" | "open" | "partially_filled" | "filled"; diff --git a/packages/types/src/exchanges/api/trade/get-closed-orders/types/closed-order.interface.ts b/packages/types/src/exchange/trade/get-closed-orders.ts similarity index 76% rename from packages/types/src/exchanges/api/trade/get-closed-orders/types/closed-order.interface.ts rename to packages/types/src/exchange/trade/get-closed-orders.ts index fea90bdb..d889ae5d 100644 --- a/packages/types/src/exchanges/api/trade/get-closed-orders/types/closed-order.interface.ts +++ b/packages/types/src/exchange/trade/get-closed-orders.ts @@ -1,7 +1,4 @@ -import type { - OrderSide, - OrderStatus, -} from "src/exchanges/api/trade/common/types"; +import type { OrderSide, OrderStatus } from "./common/enums.js"; export interface IClosedOrder { /** @@ -42,3 +39,12 @@ export interface IClosedOrder { */ createdAt: number; } + +export type IGetClosedOrdersRequest = { + /** + * e.g. ADA/USDT + */ + symbol: string; +}; + +export type IGetClosedOrdersResponse = IClosedOrder[]; diff --git a/packages/types/src/exchanges/api/trade/get-limit-order/get-limit-order-response.interface.ts b/packages/types/src/exchange/trade/get-limit-order.ts similarity index 75% rename from packages/types/src/exchanges/api/trade/get-limit-order/get-limit-order-response.interface.ts rename to packages/types/src/exchange/trade/get-limit-order.ts index 67ff1bcc..effe8027 100644 --- a/packages/types/src/exchanges/api/trade/get-limit-order/get-limit-order-response.interface.ts +++ b/packages/types/src/exchange/trade/get-limit-order.ts @@ -1,7 +1,15 @@ -import type { - OrderSide, - OrderStatus, -} from "src/exchanges/api/trade/common/types"; +export type IGetLimitOrderRequest = { + /** + * e.g. ADA/USDT + */ + symbol: string; + /** + * Order ID provided by the exchange + */ + orderId: string; +}; + +import type { OrderSide, OrderStatus } from "./common/enums.js"; export interface IGetLimitOrderResponse { /** diff --git a/packages/types/src/exchanges/api/trade/get-open-orders/types/open-order.interface.ts b/packages/types/src/exchange/trade/get-open-orders.ts similarity index 76% rename from packages/types/src/exchanges/api/trade/get-open-orders/types/open-order.interface.ts rename to packages/types/src/exchange/trade/get-open-orders.ts index 61c73c6e..3ae765a5 100644 --- a/packages/types/src/exchanges/api/trade/get-open-orders/types/open-order.interface.ts +++ b/packages/types/src/exchange/trade/get-open-orders.ts @@ -1,7 +1,4 @@ -import type { - OrderStatus, - OrderSide, -} from "src/exchanges/api/trade/common/types"; +import type { OrderStatus, OrderSide } from "./common/enums.js"; export interface IOpenOrder { /** @@ -42,3 +39,12 @@ export interface IOpenOrder { */ createdAt: number; } + +export type IGetOpenOrdersRequest = { + /** + * e.g. ADA/USDT + */ + symbol: string; +}; + +export type IGetOpenOrdersResponse = IOpenOrder[]; diff --git a/packages/types/src/exchanges/api/trade/place-limit-order/place-limit-order-request.interface.ts b/packages/types/src/exchange/trade/place-limit-order.ts similarity index 59% rename from packages/types/src/exchanges/api/trade/place-limit-order/place-limit-order-request.interface.ts rename to packages/types/src/exchange/trade/place-limit-order.ts index dd0b65d5..b2a71f24 100644 --- a/packages/types/src/exchanges/api/trade/place-limit-order/place-limit-order-request.interface.ts +++ b/packages/types/src/exchange/trade/place-limit-order.ts @@ -1,4 +1,4 @@ -import type { OrderSide } from "src/exchanges/api/trade/common/types"; +import type { OrderSide } from "./common/enums.js"; export interface IPlaceLimitOrderRequest { /** @@ -19,3 +19,14 @@ export interface IPlaceLimitOrderRequest { */ price: number; } + +export interface IPlaceLimitOrderResponse { + /** + * Order ID. + */ + orderId: string; + /** + * Client-supplied order ID + */ + clientOrderId?: string; +} diff --git a/packages/types/src/exchanges/api/trade/place-market-order/place-market-order-request.interface.ts b/packages/types/src/exchange/trade/place-market-order.ts similarity index 55% rename from packages/types/src/exchanges/api/trade/place-market-order/place-market-order-request.interface.ts rename to packages/types/src/exchange/trade/place-market-order.ts index 47ffbbef..b833d4af 100644 --- a/packages/types/src/exchanges/api/trade/place-market-order/place-market-order-request.interface.ts +++ b/packages/types/src/exchange/trade/place-market-order.ts @@ -1,4 +1,4 @@ -import type { OrderSide } from "../common/types"; +import type { OrderSide } from "./common/enums.js"; export interface IPlaceMarketOrderRequest { /** @@ -15,3 +15,14 @@ export interface IPlaceMarketOrderRequest { */ quantity: number; } + +export interface IPlaceMarketOrderResponse { + /** + * Order ID. + */ + orderId: string; + /** + * Client-supplied order ID + */ + clientOrderId?: string; +} diff --git a/packages/types/src/exchanges/api/trade/place-stop-order/place-stop-order-request.interface.ts b/packages/types/src/exchange/trade/place-stop-order.ts similarity index 65% rename from packages/types/src/exchanges/api/trade/place-stop-order/place-stop-order-request.interface.ts rename to packages/types/src/exchange/trade/place-stop-order.ts index 1bb979be..23200537 100644 --- a/packages/types/src/exchanges/api/trade/place-stop-order/place-stop-order-request.interface.ts +++ b/packages/types/src/exchange/trade/place-stop-order.ts @@ -1,4 +1,4 @@ -import type { OrderSide } from "src/exchanges/api/trade/common/types"; +import type { OrderSide } from "./common/enums.js"; export interface IPlaceStopOrderRequest { type: "limit" | "market"; @@ -19,3 +19,14 @@ export interface IPlaceStopOrderRequest { price?: number; stopPrice: number; } + +export interface IPlaceStopOrderResponse { + /** + * Order ID. + */ + orderId: string; + /** + * Client-supplied order ID + */ + clientOrderId?: string; +} diff --git a/packages/types/src/exchange/trade/watch-candles.ts b/packages/types/src/exchange/trade/watch-candles.ts new file mode 100644 index 00000000..0890c23f --- /dev/null +++ b/packages/types/src/exchange/trade/watch-candles.ts @@ -0,0 +1,10 @@ +import type { ICandlestick } from "../market-data/get-candlesticks.js"; + +export type IWatchCandlesRequest = { + /** + * e.g. ADA/USDT + */ + symbol: string; +}; + +export type IWatchCandlesResponse = ICandlestick[]; diff --git a/packages/types/src/exchanges/api/trade/watch-orders/types/watch-order.interface.ts b/packages/types/src/exchange/trade/watch-orders.ts similarity index 76% rename from packages/types/src/exchanges/api/trade/watch-orders/types/watch-order.interface.ts rename to packages/types/src/exchange/trade/watch-orders.ts index 48bacdb7..d75fcb5a 100644 --- a/packages/types/src/exchanges/api/trade/watch-orders/types/watch-order.interface.ts +++ b/packages/types/src/exchange/trade/watch-orders.ts @@ -1,4 +1,4 @@ -import type { OrderSide, OrderStatus } from "src/exchanges/api/trade/common"; +import type { OrderSide, OrderStatus } from "./common/enums.js"; export interface IWatchOrder { /** @@ -39,3 +39,12 @@ export interface IWatchOrder { */ lastTradeTimestamp?: number; } + +export type IWatchOrdersRequest = { + /** + * e.g. ADA/USDT + */ + symbol?: string; +}; + +export type IWatchOrdersResponse = IWatchOrder[]; diff --git a/packages/types/src/exchanges/api/account/account-asset/index.ts b/packages/types/src/exchanges/api/account/account-asset/index.ts deleted file mode 100644 index 4ff3411b..00000000 --- a/packages/types/src/exchanges/api/account/account-asset/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./account-asset.interface"; diff --git a/packages/types/src/exchanges/api/account/index.ts b/packages/types/src/exchanges/api/account/index.ts deleted file mode 100644 index ec7b9dc8..00000000 --- a/packages/types/src/exchanges/api/account/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./account-asset"; -export * from "./trade-fee"; diff --git a/packages/types/src/exchanges/api/account/trade-fee/get-trading-fee-rates-response.interface.ts b/packages/types/src/exchanges/api/account/trade-fee/get-trading-fee-rates-response.interface.ts deleted file mode 100644 index a30e154b..00000000 --- a/packages/types/src/exchanges/api/account/trade-fee/get-trading-fee-rates-response.interface.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IGetTradingFeeRatesResponse { - makerFee: number; - takerFee: number; -} diff --git a/packages/types/src/exchanges/api/account/trade-fee/index.ts b/packages/types/src/exchanges/api/account/trade-fee/index.ts deleted file mode 100644 index b9877803..00000000 --- a/packages/types/src/exchanges/api/account/trade-fee/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./get-trading-fee-rates-request.interface"; -export * from "./get-trading-fee-rates-response.interface"; diff --git a/packages/types/src/exchanges/api/helpers/index.ts b/packages/types/src/exchanges/api/helpers/index.ts deleted file mode 100644 index 4bb97d41..00000000 --- a/packages/types/src/exchanges/api/helpers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./trading-pair-symbol"; diff --git a/packages/types/src/exchanges/api/helpers/trading-pair-symbol/index.ts b/packages/types/src/exchanges/api/helpers/trading-pair-symbol/index.ts deleted file mode 100644 index 4e3919b6..00000000 --- a/packages/types/src/exchanges/api/helpers/trading-pair-symbol/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./trading-pair-symbol-request.interface"; diff --git a/packages/types/src/exchanges/api/helpers/trading-pair-symbol/trading-pair-symbol-request.interface.ts b/packages/types/src/exchanges/api/helpers/trading-pair-symbol/trading-pair-symbol-request.interface.ts deleted file mode 100644 index 90c484fa..00000000 --- a/packages/types/src/exchanges/api/helpers/trading-pair-symbol/trading-pair-symbol-request.interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface ITradingPairSymbolRequest { - /** - * E.g. BTC - */ - baseCurrency: string; - /** - * E.g. USDT - */ - quoteCurrency: string; -} diff --git a/packages/types/src/exchanges/api/index.ts b/packages/types/src/exchanges/api/index.ts deleted file mode 100644 index a9d583b4..00000000 --- a/packages/types/src/exchanges/api/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./account"; -export * from "./helpers"; -export * from "./market-data"; -export * from "./public-data"; -export * from "./trade"; diff --git a/packages/types/src/exchanges/api/market-data/get-candlesticks/get-candlesticks-request.interface.ts b/packages/types/src/exchanges/api/market-data/get-candlesticks/get-candlesticks-request.interface.ts deleted file mode 100644 index 648243e0..00000000 --- a/packages/types/src/exchanges/api/market-data/get-candlesticks/get-candlesticks-request.interface.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { BarSize } from "src/common"; - -export interface IGetCandlesticksRequest { - /** - * e.g. ADA-USDT - */ - symbol: string; - bar?: BarSize; - /** - * Number of results per request. - */ - limit?: number; - /** - * Return results since specified timestamp. - */ - since?: number; -} diff --git a/packages/types/src/exchanges/api/market-data/get-candlesticks/index.ts b/packages/types/src/exchanges/api/market-data/get-candlesticks/index.ts deleted file mode 100644 index c236c0d0..00000000 --- a/packages/types/src/exchanges/api/market-data/get-candlesticks/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./get-candlesticks-request.interface"; -export * from "./types"; diff --git a/packages/types/src/exchanges/api/market-data/get-candlesticks/types/index.ts b/packages/types/src/exchanges/api/market-data/get-candlesticks/types/index.ts deleted file mode 100644 index 0f26c46b..00000000 --- a/packages/types/src/exchanges/api/market-data/get-candlesticks/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./candlestick.interface"; diff --git a/packages/types/src/exchanges/api/market-data/index.ts b/packages/types/src/exchanges/api/market-data/index.ts deleted file mode 100644 index ab534813..00000000 --- a/packages/types/src/exchanges/api/market-data/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./get-candlesticks"; diff --git a/packages/types/src/exchanges/api/public-data/get-market-price/get-market-price-request.interface.ts b/packages/types/src/exchanges/api/public-data/get-market-price/get-market-price-request.interface.ts deleted file mode 100644 index e246bbe3..00000000 --- a/packages/types/src/exchanges/api/public-data/get-market-price/get-market-price-request.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface IGetMarketPriceRequest { - /** - * e.g. ADA/USDT - */ - symbol: string; -} diff --git a/packages/types/src/exchanges/api/public-data/get-market-price/index.ts b/packages/types/src/exchanges/api/public-data/get-market-price/index.ts deleted file mode 100644 index a7113fc4..00000000 --- a/packages/types/src/exchanges/api/public-data/get-market-price/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./get-market-price-request.interface"; -export * from "./get-market-price-response.interface"; diff --git a/packages/types/src/exchanges/api/public-data/get-symbols-info/get-symbol-info-request.interface.ts b/packages/types/src/exchanges/api/public-data/get-symbols-info/get-symbol-info-request.interface.ts deleted file mode 100644 index 45c33a32..00000000 --- a/packages/types/src/exchanges/api/public-data/get-symbols-info/get-symbol-info-request.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface IGetSymbolInfoRequest { - /** - * e.g. BTC/USDT - */ - currencyPair: string; -} diff --git a/packages/types/src/exchanges/api/public-data/get-symbols-info/index.ts b/packages/types/src/exchanges/api/public-data/get-symbols-info/index.ts deleted file mode 100644 index e90cb5d5..00000000 --- a/packages/types/src/exchanges/api/public-data/get-symbols-info/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./get-symbol-info-request.interface"; -export * from "./types"; diff --git a/packages/types/src/exchanges/api/public-data/get-symbols-info/types/index.ts b/packages/types/src/exchanges/api/public-data/get-symbols-info/types/index.ts deleted file mode 100644 index 3d49d341..00000000 --- a/packages/types/src/exchanges/api/public-data/get-symbols-info/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./symbol-info.interface"; -export * from "./symbol-filter.interface"; diff --git a/packages/types/src/exchanges/api/public-data/get-symbols-info/types/symbol-filter.interface.ts b/packages/types/src/exchanges/api/public-data/get-symbols-info/types/symbol-filter.interface.ts deleted file mode 100644 index 9139ab45..00000000 --- a/packages/types/src/exchanges/api/public-data/get-symbols-info/types/symbol-filter.interface.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface ISymbolFilter { - precision: PrecisionFilter; - decimals: PrecisionDecimals; - limits: LimitsFilter; -} - -export interface PrecisionFilter { - amount?: number; - price?: number; -} - -export interface PrecisionDecimals { - amount?: number; - price?: number; -} - -export interface LimitsFilter { - amount?: MinMaxFilter; - cost?: MinMaxFilter; - leverage?: MinMaxFilter; - price?: MinMaxFilter; -} - -export interface MinMaxFilter { - min?: number; - max?: number; -} diff --git a/packages/types/src/exchanges/api/public-data/get-symbols-info/types/symbol-info.interface.ts b/packages/types/src/exchanges/api/public-data/get-symbols-info/types/symbol-info.interface.ts deleted file mode 100644 index 8bdb4068..00000000 --- a/packages/types/src/exchanges/api/public-data/get-symbols-info/types/symbol-info.interface.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { ExchangeCode } from "src/common"; -import type { ISymbolFilter } from "./symbol-filter.interface"; - -export interface ISymbolInfo { - /** - * e.g. OKX:BTC/USDT - */ - symbolId: string; - /** - * e.g. BTC/USDT - */ - currencyPair: string; - exchangeCode: ExchangeCode; - - /** - * Exchange supplied symbol ID - * - * Named as: - * - `symbol` on Binance - * - `instrumentId` on OKx - * - `productId` on Coinbase - * - May occur as `assetId` on other exchanges - */ - exchangeSymbolId: string; - - baseCurrency: string; - quoteCurrency: string; - - filters: ISymbolFilter; -} diff --git a/packages/types/src/exchanges/api/public-data/index.ts b/packages/types/src/exchanges/api/public-data/index.ts deleted file mode 100644 index 082b9926..00000000 --- a/packages/types/src/exchanges/api/public-data/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./get-market-price"; -export * from "./get-symbols-info"; diff --git a/packages/types/src/exchanges/api/trade/cancel-limit-order/cancel-limit-order-response.interface.ts b/packages/types/src/exchanges/api/trade/cancel-limit-order/cancel-limit-order-response.interface.ts deleted file mode 100644 index f13dfb6b..00000000 --- a/packages/types/src/exchanges/api/trade/cancel-limit-order/cancel-limit-order-response.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface ICancelLimitOrderResponse { - /** - * Exchange-supplied Order ID - */ - orderId: string; -} diff --git a/packages/types/src/exchanges/api/trade/cancel-limit-order/index.ts b/packages/types/src/exchanges/api/trade/cancel-limit-order/index.ts deleted file mode 100644 index ce541ec0..00000000 --- a/packages/types/src/exchanges/api/trade/cancel-limit-order/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./cancel-limit-order-request.interface"; -export * from "./cancel-limit-order-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/common/index.ts b/packages/types/src/exchanges/api/trade/common/index.ts deleted file mode 100644 index eea524d6..00000000 --- a/packages/types/src/exchanges/api/trade/common/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./types"; diff --git a/packages/types/src/exchanges/api/trade/common/types/index.ts b/packages/types/src/exchanges/api/trade/common/types/index.ts deleted file mode 100644 index 8ac3910f..00000000 --- a/packages/types/src/exchanges/api/trade/common/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./order-side.type"; -export * from "./order-status.type"; diff --git a/packages/types/src/exchanges/api/trade/common/types/order-side.type.ts b/packages/types/src/exchanges/api/trade/common/types/order-side.type.ts deleted file mode 100644 index 1e372966..00000000 --- a/packages/types/src/exchanges/api/trade/common/types/order-side.type.ts +++ /dev/null @@ -1 +0,0 @@ -export type OrderSide = "buy" | "sell"; diff --git a/packages/types/src/exchanges/api/trade/get-closed-orders/get-closed-orders-request.interface.ts b/packages/types/src/exchanges/api/trade/get-closed-orders/get-closed-orders-request.interface.ts deleted file mode 100644 index e844097f..00000000 --- a/packages/types/src/exchanges/api/trade/get-closed-orders/get-closed-orders-request.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type IGetClosedOrdersRequest = { - /** - * e.g. ADA/USDT - */ - symbol: string; -}; diff --git a/packages/types/src/exchanges/api/trade/get-closed-orders/get-closed-orders-response.interface.ts b/packages/types/src/exchanges/api/trade/get-closed-orders/get-closed-orders-response.interface.ts deleted file mode 100644 index a28be819..00000000 --- a/packages/types/src/exchanges/api/trade/get-closed-orders/get-closed-orders-response.interface.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IClosedOrder } from "./types/closed-order.interface"; - -export type IGetClosedOrdersResponse = IClosedOrder[]; diff --git a/packages/types/src/exchanges/api/trade/get-closed-orders/index.ts b/packages/types/src/exchanges/api/trade/get-closed-orders/index.ts deleted file mode 100644 index a16ded4c..00000000 --- a/packages/types/src/exchanges/api/trade/get-closed-orders/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./types/closed-order.interface"; -export * from "./get-closed-orders-request.interface"; -export * from "./get-closed-orders-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/get-limit-order/get-limit-order-request.interface.ts b/packages/types/src/exchanges/api/trade/get-limit-order/get-limit-order-request.interface.ts deleted file mode 100644 index 02d83683..00000000 --- a/packages/types/src/exchanges/api/trade/get-limit-order/get-limit-order-request.interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type IGetLimitOrderRequest = { - /** - * e.g. ADA/USDT - */ - symbol: string; - /** - * Order ID provided by the exchange - */ - orderId: string; -}; diff --git a/packages/types/src/exchanges/api/trade/get-limit-order/index.ts b/packages/types/src/exchanges/api/trade/get-limit-order/index.ts deleted file mode 100644 index 2bb7d913..00000000 --- a/packages/types/src/exchanges/api/trade/get-limit-order/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./get-limit-order-request.interface"; -export * from "./get-limit-order-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/get-open-orders/get-open-orders-request.interface.ts b/packages/types/src/exchanges/api/trade/get-open-orders/get-open-orders-request.interface.ts deleted file mode 100644 index fb426962..00000000 --- a/packages/types/src/exchanges/api/trade/get-open-orders/get-open-orders-request.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type IGetOpenOrdersRequest = { - /** - * e.g. ADA/USDT - */ - symbol: string; -}; diff --git a/packages/types/src/exchanges/api/trade/get-open-orders/get-open-orders-response.interface.ts b/packages/types/src/exchanges/api/trade/get-open-orders/get-open-orders-response.interface.ts deleted file mode 100644 index 163cf6b2..00000000 --- a/packages/types/src/exchanges/api/trade/get-open-orders/get-open-orders-response.interface.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IOpenOrder } from "./types/open-order.interface"; - -export type IGetOpenOrdersResponse = IOpenOrder[]; diff --git a/packages/types/src/exchanges/api/trade/get-open-orders/index.ts b/packages/types/src/exchanges/api/trade/get-open-orders/index.ts deleted file mode 100644 index 614ebac0..00000000 --- a/packages/types/src/exchanges/api/trade/get-open-orders/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./types/open-order.interface"; -export * from "./get-open-orders-request.interface"; -export * from "./get-open-orders-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/index.ts b/packages/types/src/exchanges/api/trade/index.ts deleted file mode 100644 index 8bbd9351..00000000 --- a/packages/types/src/exchanges/api/trade/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from "./cancel-limit-order"; -export * from "./common"; -export * from "./get-limit-order"; -export * from "./place-limit-order"; -export * from "./place-market-order"; -export * from "./place-stop-order"; -export * from "./get-open-orders"; -export * from "./get-closed-orders"; -export * from "./watch-orders"; -export * from "./watch-candles"; diff --git a/packages/types/src/exchanges/api/trade/place-limit-order/index.ts b/packages/types/src/exchanges/api/trade/place-limit-order/index.ts deleted file mode 100644 index cda3c031..00000000 --- a/packages/types/src/exchanges/api/trade/place-limit-order/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./place-limit-order-request.interface"; -export * from "./place-limit-order-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/place-limit-order/place-limit-order-response.interface.ts b/packages/types/src/exchanges/api/trade/place-limit-order/place-limit-order-response.interface.ts deleted file mode 100644 index 7bd0b908..00000000 --- a/packages/types/src/exchanges/api/trade/place-limit-order/place-limit-order-response.interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface IPlaceLimitOrderResponse { - /** - * Order ID. - */ - orderId: string; - /** - * Client-supplied order ID - */ - clientOrderId?: string; -} diff --git a/packages/types/src/exchanges/api/trade/place-market-order/index.ts b/packages/types/src/exchanges/api/trade/place-market-order/index.ts deleted file mode 100644 index 9b74ed38..00000000 --- a/packages/types/src/exchanges/api/trade/place-market-order/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./place-market-order-request.interface"; -export * from "./place-market-order-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/place-market-order/place-market-order-response.interface.ts b/packages/types/src/exchanges/api/trade/place-market-order/place-market-order-response.interface.ts deleted file mode 100644 index a8667a31..00000000 --- a/packages/types/src/exchanges/api/trade/place-market-order/place-market-order-response.interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface IPlaceMarketOrderResponse { - /** - * Order ID. - */ - orderId: string; - /** - * Client-supplied order ID - */ - clientOrderId?: string; -} diff --git a/packages/types/src/exchanges/api/trade/place-stop-order/index.ts b/packages/types/src/exchanges/api/trade/place-stop-order/index.ts deleted file mode 100644 index 89b97e4e..00000000 --- a/packages/types/src/exchanges/api/trade/place-stop-order/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./place-stop-order-request.interface"; -export * from "./place-stop-order-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/place-stop-order/place-stop-order-response.interface.ts b/packages/types/src/exchanges/api/trade/place-stop-order/place-stop-order-response.interface.ts deleted file mode 100644 index 7324d840..00000000 --- a/packages/types/src/exchanges/api/trade/place-stop-order/place-stop-order-response.interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface IPlaceStopOrderResponse { - /** - * Order ID. - */ - orderId: string; - /** - * Client-supplied order ID - */ - clientOrderId?: string; -} diff --git a/packages/types/src/exchanges/api/trade/watch-candles/index.ts b/packages/types/src/exchanges/api/trade/watch-candles/index.ts deleted file mode 100644 index 2111ce62..00000000 --- a/packages/types/src/exchanges/api/trade/watch-candles/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./watch-candles-request.interface"; -export * from "./watch-candles-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/watch-candles/watch-candles-request.interface.ts b/packages/types/src/exchanges/api/trade/watch-candles/watch-candles-request.interface.ts deleted file mode 100644 index 73883c89..00000000 --- a/packages/types/src/exchanges/api/trade/watch-candles/watch-candles-request.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type IWatchCandlesRequest = { - /** - * e.g. ADA/USDT - */ - symbol: string; -}; diff --git a/packages/types/src/exchanges/api/trade/watch-candles/watch-candles-response.interface.ts b/packages/types/src/exchanges/api/trade/watch-candles/watch-candles-response.interface.ts deleted file mode 100644 index f4ee4152..00000000 --- a/packages/types/src/exchanges/api/trade/watch-candles/watch-candles-response.interface.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ICandlestick } from "../../market-data"; - -export type IWatchCandlesResponse = ICandlestick[]; diff --git a/packages/types/src/exchanges/api/trade/watch-orders/index.ts b/packages/types/src/exchanges/api/trade/watch-orders/index.ts deleted file mode 100644 index 73a70499..00000000 --- a/packages/types/src/exchanges/api/trade/watch-orders/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./types/watch-order.interface"; -export * from "./watch-orders-request.interface"; -export * from "./watch-orders-response.interface"; diff --git a/packages/types/src/exchanges/api/trade/watch-orders/watch-orders-request.interface.ts b/packages/types/src/exchanges/api/trade/watch-orders/watch-orders-request.interface.ts deleted file mode 100644 index ab03cfe7..00000000 --- a/packages/types/src/exchanges/api/trade/watch-orders/watch-orders-request.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type IWatchOrdersRequest = { - /** - * e.g. ADA/USDT - */ - symbol?: string; -}; diff --git a/packages/types/src/exchanges/api/trade/watch-orders/watch-orders-response.interface.ts b/packages/types/src/exchanges/api/trade/watch-orders/watch-orders-response.interface.ts deleted file mode 100644 index 1931cfc7..00000000 --- a/packages/types/src/exchanges/api/trade/watch-orders/watch-orders-response.interface.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IWatchOrder } from "./types/watch-order.interface"; - -export type IWatchOrdersResponse = IWatchOrder[]; diff --git a/packages/types/src/exchanges/index.ts b/packages/types/src/exchanges/index.ts deleted file mode 100644 index d158c576..00000000 --- a/packages/types/src/exchanges/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./api"; diff --git a/packages/types/src/grid-bot/grid-level.interface.ts b/packages/types/src/grid-bot/grid-level.interface.ts index e9e9ec0c..8fca56b7 100644 --- a/packages/types/src/grid-bot/grid-level.interface.ts +++ b/packages/types/src/grid-bot/grid-level.interface.ts @@ -1,4 +1,4 @@ -import type { OrderStatusEnum } from "../smart-trade"; +import type { OrderStatusEnum } from "../smart-trade/enums.js"; export interface IGridBotLevel { buy: { diff --git a/packages/types/src/grid-bot/index.ts b/packages/types/src/grid-bot/index.ts index febc451c..4ff76675 100644 --- a/packages/types/src/grid-bot/index.ts +++ b/packages/types/src/grid-bot/index.ts @@ -1,2 +1,2 @@ -export * from "./grid-level.interface"; -export * from "./grid-line.interface"; +export * from "./grid-level.interface.js"; +export * from "./grid-line.interface.js"; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index d639ab12..10dc96f9 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -15,8 +15,8 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * from "./common"; -export * from "./exchanges"; -export * from "./grid-bot"; -export * from "./smart-trade"; -export * from "./indicators"; +export * from "./common/enums.js"; +export * from "./exchange/index.js"; +export * from "./grid-bot/index.js"; +export * from "./smart-trade/enums.js"; +export * from "./indicators/index.js"; diff --git a/packages/types/src/indicators/candle.ts b/packages/types/src/indicators/candle.ts index b97d3f96..bd89deea 100644 --- a/packages/types/src/indicators/candle.ts +++ b/packages/types/src/indicators/candle.ts @@ -1,4 +1,4 @@ -import type { IndicatorName, IndicatorsResult } from "./indicators"; +import { IndicatorName, IndicatorsResult } from "./indicators.js"; export type Candle = { timestamp: number; diff --git a/packages/types/src/indicators/index.ts b/packages/types/src/indicators/index.ts index 66816524..2dd1d629 100644 --- a/packages/types/src/indicators/index.ts +++ b/packages/types/src/indicators/index.ts @@ -1,2 +1,2 @@ -export * from "./candle"; -export * from "./indicators"; +export * from "./candle.js"; +export * from "./indicators.js"; diff --git a/packages/types/src/indicators/indicators.ts b/packages/types/src/indicators/indicators.ts index d9f7a734..9fcac883 100644 --- a/packages/types/src/indicators/indicators.ts +++ b/packages/types/src/indicators/indicators.ts @@ -1,11 +1,10 @@ -import type { BarSize } from "../common"; +import { BarSize } from "../common/enums.js"; export type IndicatorName = "SMA5" | "SMA10" | "SMA15" | "SMA30" | "RSI"; export type IndicatorBarSize = Extract< BarSize, "1m" | "5m" | "10m" | "15m" | "30m" | "1h" | "4h" | "1d" >; - export type IndicatorsResult = { [K in I]: number; }; diff --git a/packages/types/src/smart-trade/common/enums/index.ts b/packages/types/src/smart-trade/common/enums/index.ts deleted file mode 100644 index 3fcfa71d..00000000 --- a/packages/types/src/smart-trade/common/enums/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./order-side.enum"; -export * from "./order-status.enum"; -export * from "./order-type"; diff --git a/packages/types/src/smart-trade/common/enums/order-side.enum.ts b/packages/types/src/smart-trade/common/enums/order-side.enum.ts deleted file mode 100644 index ac266ccf..00000000 --- a/packages/types/src/smart-trade/common/enums/order-side.enum.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum OrderSideEnum { - Buy = "buy", - Sell = "sell", -} diff --git a/packages/types/src/smart-trade/common/enums/order-status.enum.ts b/packages/types/src/smart-trade/common/enums/order-status.enum.ts deleted file mode 100644 index b68e4ce7..00000000 --- a/packages/types/src/smart-trade/common/enums/order-status.enum.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const OrderStatusEnum = { - Idle: "idle", - Placed: "placed", - Filled: "filled", -} as const; - -export type OrderStatusEnum = - (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum]; diff --git a/packages/types/src/smart-trade/common/enums/order-type.ts b/packages/types/src/smart-trade/common/enums/order-type.ts deleted file mode 100644 index c86c1186..00000000 --- a/packages/types/src/smart-trade/common/enums/order-type.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const OrderType = { - Limit: "Limit", - Market: "Market", -} as const; - -export type OrderType = (typeof OrderType)[keyof typeof OrderType]; diff --git a/packages/types/src/smart-trade/common/index.ts b/packages/types/src/smart-trade/common/index.ts deleted file mode 100644 index fa2ae8bc..00000000 --- a/packages/types/src/smart-trade/common/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./enums"; diff --git a/packages/types/src/smart-trade/enums.ts b/packages/types/src/smart-trade/enums.ts new file mode 100644 index 00000000..7b9958a2 --- /dev/null +++ b/packages/types/src/smart-trade/enums.ts @@ -0,0 +1,20 @@ +export enum OrderSideEnum { + Buy = "buy", + Sell = "sell", +} + +export const OrderStatusEnum = { + Idle: "idle", + Placed: "placed", + Filled: "filled", +} as const; + +export type OrderStatusEnum = + (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum]; + +export const OrderType = { + Limit: "Limit", + Market: "Market", +} as const; + +export type OrderType = (typeof OrderType)[keyof typeof OrderType]; diff --git a/packages/types/src/smart-trade/index.ts b/packages/types/src/smart-trade/index.ts deleted file mode 100644 index 6b571608..00000000 --- a/packages/types/src/smart-trade/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./common"; diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index cc92920f..7c095f42 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", "outDir": "./dist" diff --git a/packages/types/tsup.config.ts b/packages/types/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/types/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From 44f45efcc5dc72bb49019082159b6e6445cc5eb6 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 19 Jun 2024 21:18:20 +0100 Subject: [PATCH 05/68] chore: update `pro` packages --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index 0bd535f6..a221e661 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit 0bd535f61a485611e5551b9f15b807bcb3668f44 +Subproject commit a221e6610b7c80cc614a1901831838a7e42e2e6a From 4fae7fa4ad4d4b2e49de7186fc867a0193e207c5 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 19 Jun 2024 22:50:06 +0100 Subject: [PATCH 06/68] chore(ESLint): new configuration with ESM --- packages/eslint/LICENSE | 177 ++++++++++++++++++++++++++++++++ packages/eslint/module.js | 24 +++++ packages/eslint/package.json | 31 ++++++ packages/eslint/rules/rules.js | 49 +++++++++ packages/types/_.eslintrc.js | 9 -- packages/types/eslint.config.js | 10 ++ packages/types/package.json | 5 +- 7 files changed, 294 insertions(+), 11 deletions(-) create mode 100644 packages/eslint/LICENSE create mode 100644 packages/eslint/module.js create mode 100644 packages/eslint/package.json create mode 100644 packages/eslint/rules/rules.js delete mode 100644 packages/types/_.eslintrc.js create mode 100644 packages/types/eslint.config.js diff --git a/packages/eslint/LICENSE b/packages/eslint/LICENSE new file mode 100644 index 00000000..f433b1a5 --- /dev/null +++ b/packages/eslint/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/packages/eslint/module.js b/packages/eslint/module.js new file mode 100644 index 00000000..afeb7a12 --- /dev/null +++ b/packages/eslint/module.js @@ -0,0 +1,24 @@ +import eslint from '@eslint/js' +import tseslint from 'typescript-eslint' + +export default tseslint.config({ + files: ['src/**/*.ts'], + plugins: { + '@typescript-eslint': tseslint.plugin + }, + languageOptions: { + parser: tseslint.parser, + parserOptions: { + project: true, + sourceType: 'module' + } + }, + extends: [eslint.configs.recommended, ...tseslint.configs.recommended], + rules: { + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error' + } +}) diff --git a/packages/eslint/package.json b/packages/eslint/package.json new file mode 100644 index 00000000..383b6e6e --- /dev/null +++ b/packages/eslint/package.json @@ -0,0 +1,31 @@ +{ + "name": "@opentrader/eslint", + "description": "ESLint configuration from OpenTrader", + "version": "0.0.1", + "type": "module", + "repository": { + "type": "git", + "url": "git+https://github.com/bludnic/opentrader.git" + }, + "files": [ + "module.js", + "next.js" + ], + "devDependencies": { + "@eslint/js": "^9.5.0", + "@types/eslint__js": "^8.42.3", + "eslint": "^8.57.0", + "typescript": "5.4.5", + "typescript-eslint": "^7.13.1" + }, + "keywords": [ + "tsconfig", + "opentrader" + ], + "author": "bludnic", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/bludnic/opentrader/issues" + }, + "homepage": "https://github.com/bludnic/opentrader/tree/master/packages/eslint-config" +} diff --git a/packages/eslint/rules/rules.js b/packages/eslint/rules/rules.js new file mode 100644 index 00000000..f49aa63f --- /dev/null +++ b/packages/eslint/rules/rules.js @@ -0,0 +1,49 @@ +export default { + // errors + "import/no-default-export": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/require-await": "off", + "react-hooks/exhaustive-deps": 0, + "@typescript-eslint/consistent-type-definitions": "off", + "react/function-component-definition": "off", + "unicorn/filename-case": "off", + "no-duplicate-imports": "off", + "no-nested-ternary": "off", + "no-implicit-coercion": [ + "error", + { + allow: ["!!"], + }, + ], + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-confusing-void-expression": "off", + "@typescript-eslint/no-shadow": "off", + "turbo/no-undeclared-env-vars": "off", + "no-await-in-loop": "off", + "@typescript-eslint/no-misused-promises": ["off"], + "no-promise-executor-return": "off", + "@typescript-eslint/no-extraneous-class": "off", + "@typescript-eslint/naming-convention": "off", + "@typescript-eslint/no-unnecessary-condition": "off", + "@typescript-eslint/no-meaningless-void-operator": "off", + camelcase: "off", + "import/no-cycle": "off", // @todo investigate and enable the rule + "@typescript-eslint/no-unsafe-assignment": "off", // false positives, probably a bug in the rule + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/array-type": "off", + + // warnings + "import/no-named-as-default-member": "off", + "import/no-named-as-default": "off", + "no-console": [ + "warn", + { + allow: ["warn", "error", "debug"], + }, + ], + "@typescript-eslint/no-unused-vars": "warn", + "no-unused-vars": "warn", + "require-yield": "off", + "import/namespace": "off", +}; diff --git a/packages/types/_.eslintrc.js b/packages/types/_.eslintrc.js deleted file mode 100644 index bcd1db82..00000000 --- a/packages/types/_.eslintrc.js +++ /dev/null @@ -1,9 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], - rules: { - // repo uses alternative enum declaration with const/type (see `src/common/enums/*`) - "no-redeclare": "off", - }, -}; diff --git a/packages/types/eslint.config.js b/packages/types/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/types/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/types/package.json b/packages/types/package.json index 82e74dbe..bd525ae6 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -7,12 +7,13 @@ "types": "dist/index.d.cts", "scripts": { "build": "tsup --dts", - "lint": "eslint . --quiet" + "lint": "eslint . --quiet", + "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "eslint": "8.54.0", "tsup": "^8.1.0", From 219acfde2d2453c1d9b4b66fe76c86768de73665 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 19 Jun 2024 23:08:40 +0100 Subject: [PATCH 07/68] chore(packages/tools): convert package to ESM --- packages/tools/.eslintrc.js | 5 ----- packages/tools/eslint.config.js | 10 ++++++++++ packages/tools/package.json | 10 ++++++---- .../src/candlesticks/barSizeToDuration.spec.ts | 2 +- .../findHighestCandlestickBy.spec.ts | 4 ++-- .../findLowestCandlestickBy.spec.ts | 4 ++-- packages/tools/src/candlesticks/index.ts | 8 ++++---- .../candlesticks/lastClosedCandleDate.spec.ts | 2 +- .../src/candlesticks/lastClosedCandleDate.ts | 2 +- .../currency/common/countDecimalPlaces.spec.ts | 2 +- .../src/currency/common/countDecimalPlaces.ts | 2 +- .../src/currency/common/getExponentAbs.spec.ts | 2 +- packages/tools/src/currency/common/index.ts | 4 ++-- .../tools/src/currency/filterPrice.spec.ts | 4 ++-- packages/tools/src/currency/filterPrice.ts | 2 +- .../tools/src/currency/filterQuantity.spec.ts | 4 ++-- packages/tools/src/currency/filterQuantity.ts | 2 +- packages/tools/src/currency/index.ts | 6 +++--- .../areGridLinesPricesSortedInAscOrder.spec.ts | 2 +- .../grid/areGridLinesPricesSortedInAscOrder.ts | 2 +- packages/tools/src/grid/calcGridLines.ts | 2 +- .../src/grid/calcGridLinesWithPriceFilter.ts | 4 ++-- .../tools/src/grid/calculateInvestment.spec.ts | 4 ++-- ...puteGridLevelsFromCurrentAssetPrice.spec.ts | 6 +++--- .../computeGridLevelsFromCurrentAssetPrice.ts | 5 +++-- .../tools/src/grid/computeInvestmentAmount.ts | 6 +++--- packages/tools/src/grid/index.ts | 18 +++++++++--------- .../tools/src/grid/isWaitingGridLine.spec.ts | 2 +- packages/tools/src/grid/isWaitingGridLine.ts | 2 +- .../tools/src/grid/isWaitingPriceLine.spec.ts | 2 +- packages/tools/src/index.ts | 8 ++++---- packages/tools/src/mocks/symbols.ts | 7 +------ packages/tools/src/symbolId/composeSymbolId.ts | 2 +- .../src/symbolId/composeSymbolIdFromPair.ts | 2 +- .../src/symbolId/decomposeSymbolId.spec.ts | 4 ++-- .../tools/src/symbolId/decomposeSymbolId.ts | 15 +++++++++------ packages/tools/src/symbolId/index.ts | 10 +++++----- .../src/symbolId/isValidExchangeCode.spec.ts | 2 +- .../tools/src/symbolId/isValidSymbolId.spec.ts | 2 +- packages/tools/src/symbolId/isValidSymbolId.ts | 2 +- packages/tools/tsconfig.json | 2 +- packages/tools/tsup.config.ts | 8 ++++++++ 42 files changed, 104 insertions(+), 90 deletions(-) delete mode 100644 packages/tools/.eslintrc.js create mode 100644 packages/tools/eslint.config.js create mode 100644 packages/tools/tsup.config.ts diff --git a/packages/tools/.eslintrc.js b/packages/tools/.eslintrc.js deleted file mode 100644 index 097111f4..00000000 --- a/packages/tools/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], -}; diff --git a/packages/tools/eslint.config.js b/packages/tools/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/tools/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/tools/package.json b/packages/tools/package.json index c7e4a8df..12352be3 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -2,11 +2,12 @@ "name": "@opentrader/tools", "version": "0.0.1", "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "type": "module", + "main": "dist/index.cjs", + "types": "dist/index.d.cts", "scripts": { "test": "jest", - "build": "tsc", + "build": "tsup --dts", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -14,13 +15,14 @@ "license": "Apache-2.0", "devDependencies": { "@jest/globals": "^29.7.0", - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@types/big.js": "^6.2.2", "@types/jest": "^29.5.12", "eslint": "8.54.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/tools/src/candlesticks/barSizeToDuration.spec.ts b/packages/tools/src/candlesticks/barSizeToDuration.spec.ts index 4d55e7fd..b7ed594e 100644 --- a/packages/tools/src/candlesticks/barSizeToDuration.spec.ts +++ b/packages/tools/src/candlesticks/barSizeToDuration.spec.ts @@ -1,4 +1,4 @@ -import { barSizeToDuration } from "./barSizeToDuration"; +import { barSizeToDuration } from "./barSizeToDuration.js"; describe("barSizeToDuration function", () => { it("should return the correct duration for each bar size", () => { diff --git a/packages/tools/src/candlesticks/findHighestCandlestickBy.spec.ts b/packages/tools/src/candlesticks/findHighestCandlestickBy.spec.ts index e051f700..00b3327f 100644 --- a/packages/tools/src/candlesticks/findHighestCandlestickBy.spec.ts +++ b/packages/tools/src/candlesticks/findHighestCandlestickBy.spec.ts @@ -1,5 +1,5 @@ -import { CANDLESTICKS } from "src/mocks/candlesticks"; -import { findHighestCandlestickBy } from "./findHighestCandlestickBy"; +import { CANDLESTICKS } from "../mocks/candlesticks.js"; +import { findHighestCandlestickBy } from "./findHighestCandlestickBy.js"; describe("findHighestCandlestickBy", () => { it("highest by close", () => { diff --git a/packages/tools/src/candlesticks/findLowestCandlestickBy.spec.ts b/packages/tools/src/candlesticks/findLowestCandlestickBy.spec.ts index a7cc8788..2e55bc9a 100644 --- a/packages/tools/src/candlesticks/findLowestCandlestickBy.spec.ts +++ b/packages/tools/src/candlesticks/findLowestCandlestickBy.spec.ts @@ -1,5 +1,5 @@ -import { CANDLESTICKS } from "src/mocks/candlesticks"; -import { findLowestCandlestickBy } from "./findLowestCandlestickBy"; +import { CANDLESTICKS } from "../mocks/candlesticks.js"; +import { findLowestCandlestickBy } from "./findLowestCandlestickBy.js"; describe("findLowestCandlestickBy", () => { it("lowest by close", () => { diff --git a/packages/tools/src/candlesticks/index.ts b/packages/tools/src/candlesticks/index.ts index 8d6a4fe2..2d687672 100644 --- a/packages/tools/src/candlesticks/index.ts +++ b/packages/tools/src/candlesticks/index.ts @@ -1,4 +1,4 @@ -export * from "./findHighestCandlestickBy"; -export * from "./findLowestCandlestickBy"; -export * from "./barSizeToDuration"; -export * from "./lastClosedCandleDate"; +export * from "./findHighestCandlestickBy.js"; +export * from "./findLowestCandlestickBy.js"; +export * from "./barSizeToDuration.js"; +export * from "./lastClosedCandleDate.js"; diff --git a/packages/tools/src/candlesticks/lastClosedCandleDate.spec.ts b/packages/tools/src/candlesticks/lastClosedCandleDate.spec.ts index 50d85616..4ca1d340 100644 --- a/packages/tools/src/candlesticks/lastClosedCandleDate.spec.ts +++ b/packages/tools/src/candlesticks/lastClosedCandleDate.spec.ts @@ -1,4 +1,4 @@ -import { lastClosedCandleDate } from "./lastClosedCandleDate"; +import { lastClosedCandleDate } from "./lastClosedCandleDate.js"; describe("lastClosedCandleDate", () => { it("should return the correct date for each bar size", () => { diff --git a/packages/tools/src/candlesticks/lastClosedCandleDate.ts b/packages/tools/src/candlesticks/lastClosedCandleDate.ts index ca7684b6..a2ac2e4d 100644 --- a/packages/tools/src/candlesticks/lastClosedCandleDate.ts +++ b/packages/tools/src/candlesticks/lastClosedCandleDate.ts @@ -1,5 +1,5 @@ import type { BarSize } from "@opentrader/types"; -import { barSizeToDuration } from "./barSizeToDuration"; +import { barSizeToDuration } from "./barSizeToDuration.js"; /** * Calculate the start time of the last closed candle. diff --git a/packages/tools/src/currency/common/countDecimalPlaces.spec.ts b/packages/tools/src/currency/common/countDecimalPlaces.spec.ts index 710b2ada..1c2b7552 100644 --- a/packages/tools/src/currency/common/countDecimalPlaces.spec.ts +++ b/packages/tools/src/currency/common/countDecimalPlaces.spec.ts @@ -1,4 +1,4 @@ -import { countDecimalPlaces } from "./countDecimalPlaces"; +import { countDecimalPlaces } from "./countDecimalPlaces.js"; describe(countDecimalPlaces.name, () => { it("with trailing zeros", () => { diff --git a/packages/tools/src/currency/common/countDecimalPlaces.ts b/packages/tools/src/currency/common/countDecimalPlaces.ts index b565e511..205d2c0a 100644 --- a/packages/tools/src/currency/common/countDecimalPlaces.ts +++ b/packages/tools/src/currency/common/countDecimalPlaces.ts @@ -24,7 +24,7 @@ export function countDecimalPlaces( } if (number.includes(".")) { - return number.split(".")[1].length; + return number.split(".")[1]!.length; } // String Does Not Contain Decimal diff --git a/packages/tools/src/currency/common/getExponentAbs.spec.ts b/packages/tools/src/currency/common/getExponentAbs.spec.ts index e6937b5f..71e326c2 100644 --- a/packages/tools/src/currency/common/getExponentAbs.spec.ts +++ b/packages/tools/src/currency/common/getExponentAbs.spec.ts @@ -1,4 +1,4 @@ -import { getExponentAbs } from "./getExponentAbs"; +import { getExponentAbs } from "./getExponentAbs.js"; describe("getExponentAbs", () => { it("with trailing zeros", () => { diff --git a/packages/tools/src/currency/common/index.ts b/packages/tools/src/currency/common/index.ts index 1fb2f818..34e50052 100644 --- a/packages/tools/src/currency/common/index.ts +++ b/packages/tools/src/currency/common/index.ts @@ -1,2 +1,2 @@ -export * from "./countDecimalPlaces"; -export * from "./getExponentAbs"; +export * from "./countDecimalPlaces.js"; +export * from "./getExponentAbs.js"; diff --git a/packages/tools/src/currency/filterPrice.spec.ts b/packages/tools/src/currency/filterPrice.spec.ts index ec38a3b6..345907be 100644 --- a/packages/tools/src/currency/filterPrice.spec.ts +++ b/packages/tools/src/currency/filterPrice.spec.ts @@ -1,5 +1,5 @@ -import { ETH_SYMBOL_FILTER } from "src/mocks/symbols"; -import { filterPrice } from "./filterPrice"; +import { ETH_SYMBOL_FILTER } from "../mocks/symbols.js"; +import { filterPrice } from "./filterPrice.js"; describe("filterPrice", () => { it("should transform to fixed decimal points", () => { diff --git a/packages/tools/src/currency/filterPrice.ts b/packages/tools/src/currency/filterPrice.ts index c89f51cc..fcc81249 100644 --- a/packages/tools/src/currency/filterPrice.ts +++ b/packages/tools/src/currency/filterPrice.ts @@ -1,6 +1,6 @@ import type { ISymbolFilter } from "@opentrader/types"; import Big from "big.js"; -import { countDecimalPlaces } from "./common/countDecimalPlaces"; +import { countDecimalPlaces } from "./common/countDecimalPlaces.js"; /** * Filters order price (quote currency) diff --git a/packages/tools/src/currency/filterQuantity.spec.ts b/packages/tools/src/currency/filterQuantity.spec.ts index 568ee9b1..6b0377cf 100644 --- a/packages/tools/src/currency/filterQuantity.spec.ts +++ b/packages/tools/src/currency/filterQuantity.spec.ts @@ -1,5 +1,5 @@ -import { ETH_SYMBOL_FILTER } from "src/mocks/symbols"; -import { filterQuantity } from "./filterQuantity"; +import { ETH_SYMBOL_FILTER } from "../mocks/symbols.js"; +import { filterQuantity } from "./filterQuantity.js"; describe("filterQuantity", () => { it("should filter to stepSize", () => { diff --git a/packages/tools/src/currency/filterQuantity.ts b/packages/tools/src/currency/filterQuantity.ts index d97debef..f8e5ec12 100644 --- a/packages/tools/src/currency/filterQuantity.ts +++ b/packages/tools/src/currency/filterQuantity.ts @@ -1,6 +1,6 @@ import type { ISymbolFilter } from "@opentrader/types"; import Big from "big.js"; -import { countDecimalPlaces } from "./common/countDecimalPlaces"; +import { countDecimalPlaces } from "./common/countDecimalPlaces.js"; /** * Filters quantity of the base currency diff --git a/packages/tools/src/currency/index.ts b/packages/tools/src/currency/index.ts index 76dd0084..cb375e87 100644 --- a/packages/tools/src/currency/index.ts +++ b/packages/tools/src/currency/index.ts @@ -1,3 +1,3 @@ -export * from "./common"; -export * from "./filterPrice"; -export * from "./filterQuantity"; +export * from "./common/index.js"; +export * from "./filterPrice.js"; +export * from "./filterQuantity.js"; diff --git a/packages/tools/src/grid/areGridLinesPricesSortedInAscOrder.spec.ts b/packages/tools/src/grid/areGridLinesPricesSortedInAscOrder.spec.ts index fbfd151e..ced773b1 100644 --- a/packages/tools/src/grid/areGridLinesPricesSortedInAscOrder.spec.ts +++ b/packages/tools/src/grid/areGridLinesPricesSortedInAscOrder.spec.ts @@ -1,4 +1,4 @@ -import { areGridLinesPricesSortedInAscOrder } from "src/grid/areGridLinesPricesSortedInAscOrder"; +import { areGridLinesPricesSortedInAscOrder } from "./areGridLinesPricesSortedInAscOrder.js"; describe("areGridLinesPricesSortedInAscOrder", () => { it("should return `true` when array is empty", () => { diff --git a/packages/tools/src/grid/areGridLinesPricesSortedInAscOrder.ts b/packages/tools/src/grid/areGridLinesPricesSortedInAscOrder.ts index 914f88fc..8426ae3d 100644 --- a/packages/tools/src/grid/areGridLinesPricesSortedInAscOrder.ts +++ b/packages/tools/src/grid/areGridLinesPricesSortedInAscOrder.ts @@ -7,7 +7,7 @@ import Big from "big.js"; export function areGridLinesPricesSortedInAscOrder(gridLines: IGridLine[]) { return gridLines.slice(1).every((gridLine, i) => { const isGreaterThanOrEqual = new Big(gridLine.price).gte( - gridLines[i].price, + gridLines[i]!.price, ); return isGreaterThanOrEqual; diff --git a/packages/tools/src/grid/calcGridLines.ts b/packages/tools/src/grid/calcGridLines.ts index 3c2d70e9..fafced31 100644 --- a/packages/tools/src/grid/calcGridLines.ts +++ b/packages/tools/src/grid/calcGridLines.ts @@ -1,6 +1,6 @@ import big from "big.js"; import type { IGridLine } from "@opentrader/types"; -import { calcGridStepSize } from "./calcGridStepSize"; +import { calcGridStepSize } from "./calcGridStepSize.js"; // Note: Use this function only for tests purposes // to avoid boilerplate diff --git a/packages/tools/src/grid/calcGridLinesWithPriceFilter.ts b/packages/tools/src/grid/calcGridLinesWithPriceFilter.ts index a3707466..d22e6e15 100644 --- a/packages/tools/src/grid/calcGridLinesWithPriceFilter.ts +++ b/packages/tools/src/grid/calcGridLinesWithPriceFilter.ts @@ -1,7 +1,7 @@ import Big from "big.js"; import type { IGridLine, ISymbolFilter } from "@opentrader/types"; -import { filterPrice } from "../currency"; -import { calcGridLines } from "./calcGridLines"; +import { filterPrice } from "../currency/index.js"; +import { calcGridLines } from "./calcGridLines.js"; export function calcGridLinesWithPriceFilter( highPrice: number, diff --git a/packages/tools/src/grid/calculateInvestment.spec.ts b/packages/tools/src/grid/calculateInvestment.spec.ts index c2a9170a..c66c892a 100644 --- a/packages/tools/src/grid/calculateInvestment.spec.ts +++ b/packages/tools/src/grid/calculateInvestment.spec.ts @@ -2,8 +2,8 @@ import { BASE_CURRENCY_INVESTMENT, GRID_LEVELS, QUOTE_CURRENCY_INVESTMENT, -} from "src/mocks/grid-bot"; -import { calculateInvestment } from "./calculateInvestment"; +} from "../mocks/grid-bot.js"; +import { calculateInvestment } from "./calculateInvestment.js"; describe("calculateInvestment", () => { it("should calculate investment", () => { diff --git a/packages/tools/src/grid/computeGridLevelsFromCurrentAssetPrice.spec.ts b/packages/tools/src/grid/computeGridLevelsFromCurrentAssetPrice.spec.ts index 6216ad74..8d2ad058 100644 --- a/packages/tools/src/grid/computeGridLevelsFromCurrentAssetPrice.spec.ts +++ b/packages/tools/src/grid/computeGridLevelsFromCurrentAssetPrice.spec.ts @@ -3,9 +3,9 @@ import { CURRENT_ASSET_PRICE, GRID_LINES, GRID_LEVELS, -} from "src/mocks/grid-bot"; -import { calcGridLines } from "./calcGridLines"; -import { computeGridLevelsFromCurrentAssetPrice } from "./computeGridLevelsFromCurrentAssetPrice"; +} from "../mocks/grid-bot.js"; +import { calcGridLines } from "./calcGridLines.js"; +import { computeGridLevelsFromCurrentAssetPrice } from "./computeGridLevelsFromCurrentAssetPrice.js"; describe("computeGridLevelsFromCurrentAssetPrice", () => { it("should calculate initial grid levels", () => { diff --git a/packages/tools/src/grid/computeGridLevelsFromCurrentAssetPrice.ts b/packages/tools/src/grid/computeGridLevelsFromCurrentAssetPrice.ts index 21d8d150..79fc937f 100644 --- a/packages/tools/src/grid/computeGridLevelsFromCurrentAssetPrice.ts +++ b/packages/tools/src/grid/computeGridLevelsFromCurrentAssetPrice.ts @@ -1,7 +1,8 @@ import type { IGridBotLevel, IGridLine } from "@opentrader/types"; import { OrderStatusEnum } from "@opentrader/types"; -import { isWaitingGridLine } from "./isWaitingGridLine"; -import { nextGridLinePrice } from "./nextGridLinePrice"; + +import { isWaitingGridLine } from "./isWaitingGridLine.js"; +import { nextGridLinePrice } from "./nextGridLinePrice.js"; /** * Computes initial grid levels based on current asset price. diff --git a/packages/tools/src/grid/computeInvestmentAmount.ts b/packages/tools/src/grid/computeInvestmentAmount.ts index c36f2971..33254be0 100644 --- a/packages/tools/src/grid/computeInvestmentAmount.ts +++ b/packages/tools/src/grid/computeInvestmentAmount.ts @@ -1,7 +1,7 @@ import type { IGridLine, ISymbolInfo } from "@opentrader/types"; -import { filterPrice, filterQuantity } from "../currency"; -import { calculateInvestment } from "./calculateInvestment"; -import { computeGridLevelsFromCurrentAssetPrice } from "./computeGridLevelsFromCurrentAssetPrice"; +import { filterPrice, filterQuantity } from "../currency/index.js"; +import { calculateInvestment } from "./calculateInvestment.js"; +import { computeGridLevelsFromCurrentAssetPrice } from "./computeGridLevelsFromCurrentAssetPrice.js"; export function computeInvestmentAmount( symbol: ISymbolInfo, diff --git a/packages/tools/src/grid/index.ts b/packages/tools/src/grid/index.ts index 37e237bc..f19814e3 100644 --- a/packages/tools/src/grid/index.ts +++ b/packages/tools/src/grid/index.ts @@ -1,9 +1,9 @@ -export * from "./calcGridLines"; -export * from "./calcGridLinesWithPriceFilter"; -export * from "./calcGridStepSize"; -export * from "./calculateInvestment"; -export * from "./computeGridLevelsFromCurrentAssetPrice"; -export * from "./isWaitingGridLine"; -export * from "./nextGridLinePrice"; -export * from "./areGridLinesPricesSortedInAscOrder"; -export * from "./computeInvestmentAmount"; +export * from "./calcGridLines.js"; +export * from "./calcGridLinesWithPriceFilter.js"; +export * from "./calcGridStepSize.js"; +export * from "./calculateInvestment.js"; +export * from "./computeGridLevelsFromCurrentAssetPrice.js"; +export * from "./isWaitingGridLine.js"; +export * from "./nextGridLinePrice.js"; +export * from "./areGridLinesPricesSortedInAscOrder.js"; +export * from "./computeInvestmentAmount.js"; diff --git a/packages/tools/src/grid/isWaitingGridLine.spec.ts b/packages/tools/src/grid/isWaitingGridLine.spec.ts index 3c1268a2..cdf18cf1 100644 --- a/packages/tools/src/grid/isWaitingGridLine.spec.ts +++ b/packages/tools/src/grid/isWaitingGridLine.spec.ts @@ -1,5 +1,5 @@ import type { IGridLine } from "@opentrader/types"; -import { isWaitingGridLine } from "./isWaitingGridLine"; +import { isWaitingGridLine } from "./isWaitingGridLine.js"; const gridLines: IGridLine[] = [ { diff --git a/packages/tools/src/grid/isWaitingGridLine.ts b/packages/tools/src/grid/isWaitingGridLine.ts index 6be459ad..ac82c9ce 100644 --- a/packages/tools/src/grid/isWaitingGridLine.ts +++ b/packages/tools/src/grid/isWaitingGridLine.ts @@ -23,7 +23,7 @@ export function isWaitingGridLine( const nextGridLine: IGridLine | undefined = gridLines[gridLineIndex + 1]; const targetGridLinePriceDiff = big(currentAssetPrice) - .minus(targetGridLine.price) + .minus(targetGridLine!.price) .abs(); if (prevGridLine) { diff --git a/packages/tools/src/grid/isWaitingPriceLine.spec.ts b/packages/tools/src/grid/isWaitingPriceLine.spec.ts index cc6557c5..95f48fe1 100644 --- a/packages/tools/src/grid/isWaitingPriceLine.spec.ts +++ b/packages/tools/src/grid/isWaitingPriceLine.spec.ts @@ -1,4 +1,4 @@ -import { isWaitingPriceLine } from "./isWaitingPriceLine"; +import { isWaitingPriceLine } from "./isWaitingPriceLine.js"; const priceLines = [1, 3, 2, 4, 5]; diff --git a/packages/tools/src/index.ts b/packages/tools/src/index.ts index ab09375f..7c9399da 100644 --- a/packages/tools/src/index.ts +++ b/packages/tools/src/index.ts @@ -15,7 +15,7 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * from "./grid"; -export * from "./symbolId"; -export * from "./candlesticks"; -export * from "./currency"; +export * from "./grid/index.js"; +export * from "./symbolId/index.js"; +export * from "./candlesticks/index.js"; +export * from "./currency/index.js"; diff --git a/packages/tools/src/mocks/symbols.ts b/packages/tools/src/mocks/symbols.ts index d2ec5482..2ab3e2d0 100644 --- a/packages/tools/src/mocks/symbols.ts +++ b/packages/tools/src/mocks/symbols.ts @@ -12,14 +12,9 @@ export const ETH_SYMBOL_FILTER: ISymbolFilter = { limits: { amount: { min: 0.00001, - max: undefined, - }, - price: { - min: undefined, - max: undefined, }, + price: {}, cost: { - min: undefined, max: 1000000, }, leverage: { diff --git a/packages/tools/src/symbolId/composeSymbolId.ts b/packages/tools/src/symbolId/composeSymbolId.ts index 15826fc3..feb70295 100644 --- a/packages/tools/src/symbolId/composeSymbolId.ts +++ b/packages/tools/src/symbolId/composeSymbolId.ts @@ -1,5 +1,5 @@ import type { ExchangeCode } from "@opentrader/types"; -import { CURRENCY_PAIR_DELIMITER, EXCHANGE_CODE_DELIMITER } from "./constants"; +import { CURRENCY_PAIR_DELIMITER, EXCHANGE_CODE_DELIMITER } from "./constants.js"; export function composeSymbolId( exchangeCode: ExchangeCode, diff --git a/packages/tools/src/symbolId/composeSymbolIdFromPair.ts b/packages/tools/src/symbolId/composeSymbolIdFromPair.ts index 46185afb..446523b8 100644 --- a/packages/tools/src/symbolId/composeSymbolIdFromPair.ts +++ b/packages/tools/src/symbolId/composeSymbolIdFromPair.ts @@ -1,5 +1,5 @@ import type { ExchangeCode } from "@opentrader/types"; -import { EXCHANGE_CODE_DELIMITER } from "./constants"; +import { EXCHANGE_CODE_DELIMITER } from "./constants.js"; export function composeSymbolIdFromPair( exchangeCode: ExchangeCode, diff --git a/packages/tools/src/symbolId/decomposeSymbolId.spec.ts b/packages/tools/src/symbolId/decomposeSymbolId.spec.ts index c9add618..b627ebd9 100644 --- a/packages/tools/src/symbolId/decomposeSymbolId.spec.ts +++ b/packages/tools/src/symbolId/decomposeSymbolId.spec.ts @@ -1,6 +1,6 @@ import { ExchangeCode } from "@opentrader/types"; -import type { DecomposeSymbolIdResult } from "./decomposeSymbolId"; -import { decomposeSymbolId } from "./decomposeSymbolId"; +import type { DecomposeSymbolIdResult } from "./decomposeSymbolId.js"; +import { decomposeSymbolId } from "./decomposeSymbolId.js"; describe("decomposeSymbolId", () => { it("decompose valid symbol", () => { diff --git a/packages/tools/src/symbolId/decomposeSymbolId.ts b/packages/tools/src/symbolId/decomposeSymbolId.ts index 8ffd1b64..c7446f6d 100644 --- a/packages/tools/src/symbolId/decomposeSymbolId.ts +++ b/packages/tools/src/symbolId/decomposeSymbolId.ts @@ -1,6 +1,9 @@ import { ExchangeCode } from "@opentrader/types"; -import { CURRENCY_PAIR_DELIMITER, EXCHANGE_CODE_DELIMITER } from "./constants"; -import { isValidSymbolId } from "./isValidSymbolId"; +import { + CURRENCY_PAIR_DELIMITER, + EXCHANGE_CODE_DELIMITER, +} from "./constants.js"; +import { isValidSymbolId } from "./isValidSymbolId.js"; export type DecomposeSymbolIdResult = { exchangeCode: ExchangeCode; @@ -17,14 +20,14 @@ export function decomposeSymbolId(symbolId: string): DecomposeSymbolIdResult { const [exchangeCodeKey, currencyPairSymbol] = symbolId.split( EXCHANGE_CODE_DELIMITER, ); - const [baseCurrency, quoteCurrency] = currencyPairSymbol.split( + const [baseCurrency, quoteCurrency] = currencyPairSymbol!.split( CURRENCY_PAIR_DELIMITER, ); return { exchangeCode: ExchangeCode[exchangeCodeKey as keyof typeof ExchangeCode], - currencyPairSymbol, - baseCurrency, - quoteCurrency, + currencyPairSymbol: currencyPairSymbol!, + baseCurrency: baseCurrency!, + quoteCurrency: quoteCurrency!, }; } diff --git a/packages/tools/src/symbolId/index.ts b/packages/tools/src/symbolId/index.ts index 7022a3c4..c856f0d8 100644 --- a/packages/tools/src/symbolId/index.ts +++ b/packages/tools/src/symbolId/index.ts @@ -1,5 +1,5 @@ -export * from "./composeSymbolId"; -export * from "./composeSymbolIdFromPair"; -export * from "./decomposeSymbolId"; -export * from "./isValidSymbolId"; -export * from "./isValidExchangeCode"; +export * from "./composeSymbolId.js"; +export * from "./composeSymbolIdFromPair.js"; +export * from "./decomposeSymbolId.js"; +export * from "./isValidSymbolId.js"; +export * from "./isValidExchangeCode.js"; diff --git a/packages/tools/src/symbolId/isValidExchangeCode.spec.ts b/packages/tools/src/symbolId/isValidExchangeCode.spec.ts index 0855a98a..ec011f04 100644 --- a/packages/tools/src/symbolId/isValidExchangeCode.spec.ts +++ b/packages/tools/src/symbolId/isValidExchangeCode.spec.ts @@ -1,5 +1,5 @@ import { ExchangeCode } from "@opentrader/types"; -import { isValidExchangeCode } from "./isValidExchangeCode"; +import { isValidExchangeCode } from "./isValidExchangeCode.js"; describe("isValidExchangeCode", () => { it("test valid `exchangeCode`", () => { diff --git a/packages/tools/src/symbolId/isValidSymbolId.spec.ts b/packages/tools/src/symbolId/isValidSymbolId.spec.ts index 66822844..ce3155fa 100644 --- a/packages/tools/src/symbolId/isValidSymbolId.spec.ts +++ b/packages/tools/src/symbolId/isValidSymbolId.spec.ts @@ -1,4 +1,4 @@ -import { isValidSymbolId } from "./isValidSymbolId"; +import { isValidSymbolId } from "./isValidSymbolId.js"; describe("isValidSymbolId", () => { it("test existing exchange with a valid currency pair", () => { diff --git a/packages/tools/src/symbolId/isValidSymbolId.ts b/packages/tools/src/symbolId/isValidSymbolId.ts index 49f41235..9f0e9279 100644 --- a/packages/tools/src/symbolId/isValidSymbolId.ts +++ b/packages/tools/src/symbolId/isValidSymbolId.ts @@ -1,5 +1,5 @@ import { ExchangeCode } from "@opentrader/types"; -import { CURRENCY_PAIR_DELIMITER, EXCHANGE_CODE_DELIMITER } from "./constants"; +import { CURRENCY_PAIR_DELIMITER, EXCHANGE_CODE_DELIMITER } from "./constants.js"; export function isValidSymbolId(symbolId: string) { const exchangeCodes = Object.keys(ExchangeCode); diff --git a/packages/tools/tsconfig.json b/packages/tools/tsconfig.json index cc92920f..7c095f42 100644 --- a/packages/tools/tsconfig.json +++ b/packages/tools/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", "outDir": "./dist" diff --git a/packages/tools/tsup.config.ts b/packages/tools/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/tools/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From 0f8783b0da31f7d3ea9540e60331f879e78dc7ed Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 19 Jun 2024 23:26:13 +0100 Subject: [PATCH 08/68] chore(packages/backtesting): convert package to ESM --- packages/backtesting/.eslintrc.js | 5 ---- packages/backtesting/eslint.config.js | 10 ++++++++ packages/backtesting/package.json | 6 +++-- .../backtesting/src/backtesting-report.ts | 16 ++++++------- packages/backtesting/src/backtesting.ts | 14 +++++------ packages/backtesting/src/debugging/index.ts | 4 ++-- .../src/exchange/memory-exchange.ts | 2 +- packages/backtesting/src/index.ts | 6 ++--- packages/backtesting/src/report/buyOrder.ts | 4 ++-- .../backtesting/src/report/buyTransaction.ts | 2 +- packages/backtesting/src/report/sellOrder.ts | 4 ++-- .../backtesting/src/report/sellTransaction.ts | 2 +- .../backtesting/src/store/memory-store.ts | 2 +- packages/backtesting/src/types/index.ts | 2 +- .../{report/transaction.type.ts => report.ts} | 24 +++++++++++++++---- .../src/types/report/active-order.type.ts | 7 ------ .../backtesting/src/types/report/index.ts | 3 --- .../src/types/report/report-result.type.ts | 8 ------- packages/backtesting/tsconfig.json | 5 ++-- packages/backtesting/tsup.config.ts | 8 +++++++ 20 files changed, 71 insertions(+), 63 deletions(-) delete mode 100644 packages/backtesting/.eslintrc.js create mode 100644 packages/backtesting/eslint.config.js rename packages/backtesting/src/types/{report/transaction.type.ts => report.ts} (67%) delete mode 100644 packages/backtesting/src/types/report/active-order.type.ts delete mode 100644 packages/backtesting/src/types/report/index.ts delete mode 100644 packages/backtesting/src/types/report/report-result.type.ts create mode 100644 packages/backtesting/tsup.config.ts diff --git a/packages/backtesting/.eslintrc.js b/packages/backtesting/.eslintrc.js deleted file mode 100644 index 097111f4..00000000 --- a/packages/backtesting/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], -}; diff --git a/packages/backtesting/eslint.config.js b/packages/backtesting/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/backtesting/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/backtesting/package.json b/packages/backtesting/package.json index cc3e2857..ff16fcca 100644 --- a/packages/backtesting/package.json +++ b/packages/backtesting/package.json @@ -2,22 +2,24 @@ "name": "@opentrader/backtesting", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/lodash": "^4.17.5", "@types/node": "^20.14.5", "eslint": "8.54.0", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/backtesting/src/backtesting-report.ts b/packages/backtesting/src/backtesting-report.ts index 5d6a7da4..0b39ce32 100644 --- a/packages/backtesting/src/backtesting-report.ts +++ b/packages/backtesting/src/backtesting-report.ts @@ -6,12 +6,12 @@ import type { SmartTrade, } from "@opentrader/bot-processor"; import { ICandlestick, OrderStatusEnum } from "@opentrader/types"; -import { format, logger } from "@opentrader/logger"; -import { buyOrder } from "./report/buyOrder"; -import { buyTransaction } from "./report/buyTransaction"; -import { sellOrder } from "./report/sellOrder"; -import { sellTransaction } from "./report/sellTransaction"; -import type { ActiveOrder, ReportResult, Transaction } from "./types"; +import { format } from "@opentrader/logger"; +import { buyOrder } from "./report/buyOrder.js"; +import { buyTransaction } from "./report/buyTransaction.js"; +import { sellOrder } from "./report/sellOrder.js"; +import { sellTransaction } from "./report/sellTransaction.js"; +import type { ActiveOrder, Transaction } from "./types/index.js"; type OrderInfo = Order & { side: "buy" | "sell"; @@ -27,9 +27,9 @@ export class BacktestingReport { ) {} create(): string { - const startDate = format.datetime(this.candlesticks[0].timestamp); + const startDate = format.datetime(this.candlesticks[0]!.timestamp); const endDate = format.datetime( - this.candlesticks[this.candlesticks.length - 1].timestamp, + this.candlesticks[this.candlesticks.length - 1]!.timestamp, ); const strategyParams = JSON.stringify(this.botConfig.settings, null, 2); diff --git a/packages/backtesting/src/backtesting.ts b/packages/backtesting/src/backtesting.ts index b2fc88ad..1deaf80a 100644 --- a/packages/backtesting/src/backtesting.ts +++ b/packages/backtesting/src/backtesting.ts @@ -24,12 +24,10 @@ import type { import { createStrategyRunner } from "@opentrader/bot-processor"; import type { ICandlestick } from "@opentrader/types"; import { logger, format } from "@opentrader/logger"; -import { fulfilledTable, gridTable } from "./debugging"; -import { BacktestingReport } from "./backtesting-report"; -import type { ReportResult } from "./types"; -import { MarketSimulator } from "./market-simulator"; -import { MemoryExchange } from "./exchange/memory-exchange"; -import { MemoryStore } from "./store/memory-store"; +import { BacktestingReport } from "./backtesting-report.js"; +import { MarketSimulator } from "./market-simulator.js"; +import { MemoryExchange } from "./exchange/memory-exchange.js"; +import { MemoryStore } from "./store/memory-store.js"; export class Backtesting> { private marketSimulator: MarketSimulator; @@ -67,7 +65,7 @@ export class Backtesting> { )}`, ); - const anyOrderFulfilled = this.marketSimulator.fulfillOrders(); + // const anyOrderFulfilled = this.marketSimulator.fulfillOrders(); // if (anyOrderFulfilled) { // console.log("Fulfilled Table"); @@ -86,7 +84,7 @@ export class Backtesting> { }); } - const anyOrderPlaced = this.marketSimulator.placeOrders(); + // const anyOrderPlaced = this.marketSimulator.placeOrders(); // if (anyOrderPlaced) { // console.log("Placed Table"); // console.table(gridTable(this.store.getSmartTrades())); diff --git a/packages/backtesting/src/debugging/index.ts b/packages/backtesting/src/debugging/index.ts index d6f29f03..9e078e2f 100644 --- a/packages/backtesting/src/debugging/index.ts +++ b/packages/backtesting/src/debugging/index.ts @@ -1,2 +1,2 @@ -export * from "./fulfilledTable"; -export * from "./gridTable"; +export * from "./fulfilledTable.js"; +export * from "./gridTable.js"; diff --git a/packages/backtesting/src/exchange/memory-exchange.ts b/packages/backtesting/src/exchange/memory-exchange.ts index 73bcb34f..c7a85eec 100644 --- a/packages/backtesting/src/exchange/memory-exchange.ts +++ b/packages/backtesting/src/exchange/memory-exchange.ts @@ -25,7 +25,7 @@ import type { IPlaceMarketOrderResponse, } from "@opentrader/types"; import { ExchangeCode } from "@opentrader/types"; -import type { MarketSimulator } from "../market-simulator"; +import type { MarketSimulator } from "../market-simulator.js"; export class MemoryExchange implements IExchange { ccxt = {} as any; diff --git a/packages/backtesting/src/index.ts b/packages/backtesting/src/index.ts index 55d9435d..c6a2a9ca 100644 --- a/packages/backtesting/src/index.ts +++ b/packages/backtesting/src/index.ts @@ -15,6 +15,6 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * from "./backtesting"; -export * from "./market-simulator"; -export * from "./types"; +export * from "./backtesting.js"; +export * from "./market-simulator.js"; +export * from "./types/index.js"; diff --git a/packages/backtesting/src/report/buyOrder.ts b/packages/backtesting/src/report/buyOrder.ts index cc0361f8..399b98e4 100644 --- a/packages/backtesting/src/report/buyOrder.ts +++ b/packages/backtesting/src/report/buyOrder.ts @@ -1,11 +1,11 @@ import type { SmartTrade } from "@opentrader/bot-processor"; import { OrderSideEnum } from "@opentrader/types"; -import type { ActiveOrder } from "../types"; +import type { ActiveOrder } from "../types/index.js"; export function buyOrder(smartTrade: SmartTrade): ActiveOrder { return { side: OrderSideEnum.Buy, quantity: smartTrade.quantity, - price: smartTrade.buy.filledPrice || smartTrade.buy.price, + price: (smartTrade.buy.filledPrice || smartTrade.buy.price)!, }; } diff --git a/packages/backtesting/src/report/buyTransaction.ts b/packages/backtesting/src/report/buyTransaction.ts index b0825834..9040f445 100644 --- a/packages/backtesting/src/report/buyTransaction.ts +++ b/packages/backtesting/src/report/buyTransaction.ts @@ -1,6 +1,6 @@ import type { SmartTrade } from "@opentrader/bot-processor"; import { OrderSideEnum } from "@opentrader/types"; -import type { BuyTransaction } from "../types"; +import type { BuyTransaction } from "../types/index.js"; export function buyTransaction(smartTrade: SmartTrade): BuyTransaction { const { buy, sell, quantity, id } = smartTrade; diff --git a/packages/backtesting/src/report/sellOrder.ts b/packages/backtesting/src/report/sellOrder.ts index bb2dcb9a..b8184a79 100644 --- a/packages/backtesting/src/report/sellOrder.ts +++ b/packages/backtesting/src/report/sellOrder.ts @@ -1,11 +1,11 @@ import { SmartTradeWithSell } from "@opentrader/bot-processor"; import { OrderSideEnum } from "@opentrader/types"; -import type { ActiveOrder } from "../types"; +import type { ActiveOrder } from "../types/index.js"; export function sellOrder(smartTrade: SmartTradeWithSell): ActiveOrder { return { side: OrderSideEnum.Sell, quantity: smartTrade.quantity, - price: smartTrade.sell.filledPrice || smartTrade.sell.price, + price: (smartTrade.sell.filledPrice || smartTrade.sell.price)!, }; } diff --git a/packages/backtesting/src/report/sellTransaction.ts b/packages/backtesting/src/report/sellTransaction.ts index 012c15a3..02bc9a91 100644 --- a/packages/backtesting/src/report/sellTransaction.ts +++ b/packages/backtesting/src/report/sellTransaction.ts @@ -1,6 +1,6 @@ import type { SmartTradeWithSell } from "@opentrader/bot-processor"; import { OrderSideEnum } from "@opentrader/types"; -import type { SellTransaction } from "../types"; +import type { SellTransaction } from "../types/index.js"; export function sellTransaction( smartTrade: SmartTradeWithSell, diff --git a/packages/backtesting/src/store/memory-store.ts b/packages/backtesting/src/store/memory-store.ts index b475046d..afcf8ab4 100644 --- a/packages/backtesting/src/store/memory-store.ts +++ b/packages/backtesting/src/store/memory-store.ts @@ -7,7 +7,7 @@ import { import type { IExchange } from "@opentrader/exchanges"; import { OrderStatusEnum, OrderType } from "@opentrader/types"; import uniqueId from "lodash/uniqueId"; -import type { MarketSimulator } from "../market-simulator"; +import type { MarketSimulator } from "../market-simulator.js"; export class MemoryStore implements IStore { /** diff --git a/packages/backtesting/src/types/index.ts b/packages/backtesting/src/types/index.ts index b25cb5d3..d4ecb579 100644 --- a/packages/backtesting/src/types/index.ts +++ b/packages/backtesting/src/types/index.ts @@ -1 +1 @@ -export * from "./report"; +export * from "./report.js"; diff --git a/packages/backtesting/src/types/report/transaction.type.ts b/packages/backtesting/src/types/report.ts similarity index 67% rename from packages/backtesting/src/types/report/transaction.type.ts rename to packages/backtesting/src/types/report.ts index a7515d01..06925d49 100644 --- a/packages/backtesting/src/types/report/transaction.type.ts +++ b/packages/backtesting/src/types/report.ts @@ -9,11 +9,13 @@ export type BuyTransaction = { fee: number; // fee in quote currency updatedAt: number; }; - sell?: { - price: number; - fee: number; // fee in quote currency - updatedAt: number; - }; + sell?: + | { + price: number; + fee: number; // fee in quote currency + updatedAt: number; + } + | undefined; profit: number; }; @@ -35,3 +37,15 @@ export type SellTransaction = { }; export type Transaction = BuyTransaction | SellTransaction; + +export type ActiveOrder = { + side: OrderSideEnum; + quantity: number; + price?: number; +}; + +export type ReportResult = { + transactions: Transaction[]; + activeOrders: ActiveOrder[]; + totalProfit: number; +}; diff --git a/packages/backtesting/src/types/report/active-order.type.ts b/packages/backtesting/src/types/report/active-order.type.ts deleted file mode 100644 index 053e911a..00000000 --- a/packages/backtesting/src/types/report/active-order.type.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { OrderSideEnum } from "@opentrader/types"; - -export type ActiveOrder = { - side: OrderSideEnum; - quantity: number; - price?: number; -}; diff --git a/packages/backtesting/src/types/report/index.ts b/packages/backtesting/src/types/report/index.ts deleted file mode 100644 index 037b8172..00000000 --- a/packages/backtesting/src/types/report/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./report-result.type"; -export * from "./transaction.type"; -export * from "./active-order.type"; diff --git a/packages/backtesting/src/types/report/report-result.type.ts b/packages/backtesting/src/types/report/report-result.type.ts deleted file mode 100644 index 5a113876..00000000 --- a/packages/backtesting/src/types/report/report-result.type.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ActiveOrder } from "./active-order.type"; -import type { Transaction } from "./transaction.type"; - -export type ReportResult = { - transactions: Transaction[]; - activeOrders: ActiveOrder[]; - totalProfit: number; -}; diff --git a/packages/backtesting/tsconfig.json b/packages/backtesting/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/backtesting/tsconfig.json +++ b/packages/backtesting/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/backtesting/tsup.config.ts b/packages/backtesting/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/backtesting/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From ebdc1934cd5913dfe48ca36713b4b91edb2b49b7 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 00:32:31 +0100 Subject: [PATCH 09/68] chore(tsconfig): make ESM config less strict --- packages/tsconfig/esm.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/tsconfig/esm.json b/packages/tsconfig/esm.json index f0f84435..05f7388f 100644 --- a/packages/tsconfig/esm.json +++ b/packages/tsconfig/esm.json @@ -4,5 +4,10 @@ "@tsconfig/node20/tsconfig.json", "@tsconfig/strictest/tsconfig.json" ], - "compilerOptions": {} + "compilerOptions": { + "exactOptionalPropertyTypes": false, + "strictNullChecks": false, + "noUnusedLocals": false, + "noUnusedParameters": false + } } From 6f89e4548af6a08e94d2aeb4c04946a66a0809c1 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 00:34:16 +0100 Subject: [PATCH 10/68] chore(ESLint): unsafe call rules, error -> warn --- packages/eslint/module.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint/module.js b/packages/eslint/module.js index afeb7a12..38ec1225 100644 --- a/packages/eslint/module.js +++ b/packages/eslint/module.js @@ -17,8 +17,8 @@ export default tseslint.config({ rules: { '@typescript-eslint/no-unsafe-argument': 'error', '@typescript-eslint/no-unsafe-assignment': 'error', - '@typescript-eslint/no-unsafe-call': 'error', - '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-call': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'warn', '@typescript-eslint/no-unsafe-return': 'error' } }) From 06c3bbc78e0b0a32a516fcc32551f4b003f5ff9b Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 00:34:32 +0100 Subject: [PATCH 11/68] chore(packages/bot): convert to ESM --- packages/bot/eslint.config.js | 10 ++++++++++ packages/bot/package.json | 6 ++++-- .../bot/src/channels/candles/candles.aggregator.ts | 2 +- packages/bot/src/channels/candles/candles.channel.ts | 6 +++--- packages/bot/src/channels/candles/index.ts | 4 ++-- packages/bot/src/channels/index.ts | 2 +- packages/bot/src/index.ts | 6 +++--- packages/bot/src/market-data/ccxt-candles.provider.ts | 3 ++- packages/bot/src/processing/candles.processor.ts | 4 ++-- .../bot/src/processing/exchange-accounts.watcher.ts | 4 ++-- packages/bot/src/processing/index.ts | 2 +- .../bot/src/processing/order-synchronizer/index.ts | 2 +- .../order-synchronizer-polling.watcher.ts | 2 +- .../order-synchronizer-watcher.abstract.ts | 2 +- .../order-synchronizer-ws.watcher.ts | 4 ++-- .../order-synchronizer/order-synchronizer.ts | 6 +++--- packages/bot/src/processing/processor.ts | 7 ++++--- packages/bot/tsconfig.json | 5 ++--- packages/bot/tsup.config.ts | 8 ++++++++ 19 files changed, 53 insertions(+), 32 deletions(-) create mode 100644 packages/bot/eslint.config.js create mode 100644 packages/bot/tsup.config.ts diff --git a/packages/bot/eslint.config.js b/packages/bot/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/bot/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/bot/package.json b/packages/bot/package.json index 1c817d64..b8937c08 100644 --- a/packages/bot/package.json +++ b/packages/bot/package.json @@ -2,17 +2,18 @@ "name": "@opentrader/bot", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/async": "^3.2.24", @@ -20,6 +21,7 @@ "@types/node-cron": "^3.0.11", "eslint": "8.54.0", "ts-node": "10.9.2", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/bot/src/channels/candles/candles.aggregator.ts b/packages/bot/src/channels/candles/candles.aggregator.ts index 154eb8da..44830729 100644 --- a/packages/bot/src/channels/candles/candles.aggregator.ts +++ b/packages/bot/src/channels/candles/candles.aggregator.ts @@ -21,7 +21,7 @@ import { logger } from "@opentrader/logger"; import { barSizeToDuration } from "@opentrader/tools"; import { BarSize } from "@opentrader/types"; import type { ICandlestick } from "@opentrader/types"; -import type { CandlesWatcher } from "./candles.watcher"; +import type { CandlesWatcher } from "./candles.watcher.js"; /** * Aggregates 1m candles to higher timeframes. diff --git a/packages/bot/src/channels/candles/candles.channel.ts b/packages/bot/src/channels/candles/candles.channel.ts index cd39576a..c188ef7e 100644 --- a/packages/bot/src/channels/candles/candles.channel.ts +++ b/packages/bot/src/channels/candles/candles.channel.ts @@ -2,9 +2,9 @@ import { EventEmitter } from "node:events"; import type { IExchange } from "@opentrader/exchanges"; import type { BarSize, ICandlestick } from "@opentrader/types"; import { logger } from "@opentrader/logger"; -import type { CandleEvent } from "./types"; -import { CandlesWatcher } from "./candles.watcher"; -import { CandlesAggregator } from "./candles.aggregator"; +import type { CandleEvent } from "./types.js"; +import { CandlesWatcher } from "./candles.watcher.js"; +import { CandlesAggregator } from "./candles.aggregator.js"; /** * Channel that subscribes to 1m candles and aggregate them to higher timeframes. diff --git a/packages/bot/src/channels/candles/index.ts b/packages/bot/src/channels/candles/index.ts index 9662fdc1..7feedc8a 100644 --- a/packages/bot/src/channels/candles/index.ts +++ b/packages/bot/src/channels/candles/index.ts @@ -1,2 +1,2 @@ -export * from "./candles.channel"; -export * from "./types"; +export * from "./candles.channel.js"; +export * from "./types.js"; diff --git a/packages/bot/src/channels/index.ts b/packages/bot/src/channels/index.ts index fea89b9e..70c46f1f 100644 --- a/packages/bot/src/channels/index.ts +++ b/packages/bot/src/channels/index.ts @@ -1 +1 @@ -export * from "./candles"; +export * from "./candles/index.js"; diff --git a/packages/bot/src/index.ts b/packages/bot/src/index.ts index 2c6b785c..b64b2e4e 100644 --- a/packages/bot/src/index.ts +++ b/packages/bot/src/index.ts @@ -15,6 +15,6 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * from "./channels"; -export { CCXTCandlesProvider } from "./market-data/ccxt-candles.provider"; -export { Processor } from "./processing"; +export * from "./channels/index.js"; +export { CCXTCandlesProvider } from "./market-data/ccxt-candles.provider.js"; +export { Processor } from "./processing/index.js"; diff --git a/packages/bot/src/market-data/ccxt-candles.provider.ts b/packages/bot/src/market-data/ccxt-candles.provider.ts index ef854916..f9d85647 100644 --- a/packages/bot/src/market-data/ccxt-candles.provider.ts +++ b/packages/bot/src/market-data/ccxt-candles.provider.ts @@ -1,9 +1,10 @@ import { EventEmitter } from "node:events"; import { type Exchange, type OHLCV } from "ccxt"; import type { BarSize, ICandlestick } from "@opentrader/types"; -import type { ICandlesProvider } from "./candles-provider.interface"; import { logger, format } from "@opentrader/logger"; +import type { ICandlesProvider } from "./candles-provider.interface.js"; + export class CCXTCandlesProvider extends EventEmitter implements ICandlesProvider diff --git a/packages/bot/src/processing/candles.processor.ts b/packages/bot/src/processing/candles.processor.ts index 74767da4..d37ee76e 100644 --- a/packages/bot/src/processing/candles.processor.ts +++ b/packages/bot/src/processing/candles.processor.ts @@ -5,8 +5,8 @@ import { xprisma } from "@opentrader/db"; import { BotProcessing } from "@opentrader/processing"; import type { BarSize } from "@opentrader/types"; import { findStrategy } from "@opentrader/bot-templates/server"; -import type { CandleEvent } from "../channels"; -import { CandlesChannel } from "../channels"; +import type { CandleEvent } from "../channels/index.js"; +import { CandlesChannel } from "../channels/index.js"; export class CandlesProcessor { private channels: CandlesChannel[] = []; diff --git a/packages/bot/src/processing/exchange-accounts.watcher.ts b/packages/bot/src/processing/exchange-accounts.watcher.ts index 3e88123d..581b3d62 100644 --- a/packages/bot/src/processing/exchange-accounts.watcher.ts +++ b/packages/bot/src/processing/exchange-accounts.watcher.ts @@ -6,8 +6,8 @@ import type { } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; -import { processingQueue } from "./processing.queue"; -import { OrderSynchronizer } from "./order-synchronizer"; +import { processingQueue } from "./processing.queue.js"; +import { OrderSynchronizer } from "./order-synchronizer/index.js"; export class ExchangeAccountsWatcher { private ordersWatchers: OrderSynchronizer[] = []; diff --git a/packages/bot/src/processing/index.ts b/packages/bot/src/processing/index.ts index 843f8ebf..eda5911d 100644 --- a/packages/bot/src/processing/index.ts +++ b/packages/bot/src/processing/index.ts @@ -1 +1 @@ -export { Processor } from "./processor"; +export { Processor } from "./processor.js"; diff --git a/packages/bot/src/processing/order-synchronizer/index.ts b/packages/bot/src/processing/order-synchronizer/index.ts index f27545f0..6e39529b 100644 --- a/packages/bot/src/processing/order-synchronizer/index.ts +++ b/packages/bot/src/processing/order-synchronizer/index.ts @@ -1 +1 @@ -export * from "./order-synchronizer"; +export * from "./order-synchronizer.js"; diff --git a/packages/bot/src/processing/order-synchronizer/order-synchronizer-polling.watcher.ts b/packages/bot/src/processing/order-synchronizer/order-synchronizer-polling.watcher.ts index 4d95639d..639ebfd0 100644 --- a/packages/bot/src/processing/order-synchronizer/order-synchronizer-polling.watcher.ts +++ b/packages/bot/src/processing/order-synchronizer/order-synchronizer-polling.watcher.ts @@ -18,7 +18,7 @@ import { NetworkError, RequestTimeout } from "ccxt"; import { ExchangeAccountProcessor } from "@opentrader/processing"; import { logger } from "@opentrader/logger"; -import { OrderSynchronizerWatcher } from "./order-synchronizer-watcher.abstract"; +import { OrderSynchronizerWatcher } from "./order-synchronizer-watcher.abstract.js"; /** * This is a fallback for `OrderSynchronizerWsWatcher`. diff --git a/packages/bot/src/processing/order-synchronizer/order-synchronizer-watcher.abstract.ts b/packages/bot/src/processing/order-synchronizer/order-synchronizer-watcher.abstract.ts index 1901557a..df4d6f93 100644 --- a/packages/bot/src/processing/order-synchronizer/order-synchronizer-watcher.abstract.ts +++ b/packages/bot/src/processing/order-synchronizer/order-synchronizer-watcher.abstract.ts @@ -19,7 +19,7 @@ import type { IExchange } from "@opentrader/exchanges"; import { exchangeProvider } from "@opentrader/exchanges"; import type { ExchangeAccountWithCredentials } from "@opentrader/db"; import { logger } from "@opentrader/logger"; -import type { Subscription, Event } from "./types"; +import type { Subscription, Event } from "./types.js"; export abstract class OrderSynchronizerWatcher { private consumers: Subscription[] = []; diff --git a/packages/bot/src/processing/order-synchronizer/order-synchronizer-ws.watcher.ts b/packages/bot/src/processing/order-synchronizer/order-synchronizer-ws.watcher.ts index ae626cbd..592fa595 100644 --- a/packages/bot/src/processing/order-synchronizer/order-synchronizer-ws.watcher.ts +++ b/packages/bot/src/processing/order-synchronizer/order-synchronizer-ws.watcher.ts @@ -18,12 +18,12 @@ import { xprisma } from "@opentrader/db"; import { NetworkError, RequestTimeout } from "ccxt"; import { logger } from "@opentrader/logger"; -import { OrderSynchronizerWatcher } from "./order-synchronizer-watcher.abstract"; +import { OrderSynchronizerWatcher } from "./order-synchronizer-watcher.abstract.js"; export class OrderSynchronizerWsWatcher extends OrderSynchronizerWatcher { protocol = "ws" as const; - async disable() { + override async disable() { await super.disable(); await this.exchangeService.ccxt.close(); } diff --git a/packages/bot/src/processing/order-synchronizer/order-synchronizer.ts b/packages/bot/src/processing/order-synchronizer/order-synchronizer.ts index d7e0e6a2..77cee679 100644 --- a/packages/bot/src/processing/order-synchronizer/order-synchronizer.ts +++ b/packages/bot/src/processing/order-synchronizer/order-synchronizer.ts @@ -16,9 +16,9 @@ * Repository URL: https://github.com/bludnic/opentrader */ import type { ExchangeAccountWithCredentials } from "@opentrader/db"; -import { OrderSynchronizerPollingWatcher } from "./order-synchronizer-polling.watcher"; -import { OrderSynchronizerWsWatcher } from "./order-synchronizer-ws.watcher"; -import type { Event, Subscription } from "./types"; +import { OrderSynchronizerPollingWatcher } from "./order-synchronizer-polling.watcher.js"; +import { OrderSynchronizerWsWatcher } from "./order-synchronizer-ws.watcher.js"; +import type { Event, Subscription } from "./types.js"; export class OrderSynchronizer { private consumers: Subscription[] = []; diff --git a/packages/bot/src/processing/processor.ts b/packages/bot/src/processing/processor.ts index 05ba961c..51a299f6 100644 --- a/packages/bot/src/processing/processor.ts +++ b/packages/bot/src/processing/processor.ts @@ -1,8 +1,9 @@ import type { ExchangeAccountWithCredentials, TBot } from "@opentrader/db"; import { logger } from "@opentrader/logger"; -import { CandlesProcessor } from "./candles.processor"; -import { TimeframeCron } from "./timeframe.cron"; -import { ExchangeAccountsWatcher } from "./exchange-accounts.watcher"; + +import { CandlesProcessor } from "./candles.processor.js"; +import { TimeframeCron } from "./timeframe.cron.js"; +import { ExchangeAccountsWatcher } from "./exchange-accounts.watcher.js"; export class Processor { private exchangeAccountsWatcher: ExchangeAccountsWatcher; diff --git a/packages/bot/tsconfig.json b/packages/bot/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/bot/tsconfig.json +++ b/packages/bot/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/bot/tsup.config.ts b/packages/bot/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/bot/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From a80342dd788e893d92fe769dd563885ba627fb5d Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 00:42:27 +0100 Subject: [PATCH 12/68] chore(packages/bot-processor): convert to ESM --- packages/bot-processor/eslint.config.js | 10 ++++++++++ packages/bot-processor/package.json | 6 ++++-- packages/bot-processor/src/bot-control.ts | 4 ++-- packages/bot-processor/src/effect-runner.ts | 10 +++++----- packages/bot-processor/src/effects/buy.ts | 4 ++-- packages/bot-processor/src/effects/index.ts | 20 +++++++++---------- .../bot-processor/src/effects/indicators.ts | 4 ++-- packages/bot-processor/src/effects/market.ts | 4 ++-- packages/bot-processor/src/effects/sell.ts | 4 ++-- .../bot-processor/src/effects/smart-trade.ts | 6 +++--- .../src/effects/types/base-effect.ts | 2 +- .../bot-processor/src/effects/types/index.ts | 4 ++-- .../bot-processor/src/effects/useExchange.ts | 4 ++-- .../src/effects/useIndicators.ts | 4 ++-- .../bot-processor/src/effects/useTrade.ts | 4 ++-- .../bot-processor/src/effects/utils/index.ts | 2 +- packages/bot-processor/src/index.ts | 8 ++++---- packages/bot-processor/src/strategy-runner.ts | 10 +++++----- .../src/types/bot/bot-context.type.ts | 8 ++++---- .../src/types/bot/bot-control.interface.ts | 4 ++-- .../src/types/bot/bot-template.type.ts | 4 ++-- packages/bot-processor/src/types/bot/index.ts | 10 +++++----- packages/bot-processor/src/types/index.ts | 8 ++++---- .../bot-processor/src/types/market/index.ts | 2 +- .../src/types/smart-trade/index.ts | 6 +++--- .../types/smart-trade/smart-trade.service.ts | 4 ++-- .../src/types/smart-trade/trade.service.ts | 4 ++-- .../bot-processor/src/types/store/index.ts | 2 +- .../src/types/store/store.interface.ts | 4 ++-- .../bot-processor/src/utils/createContext.ts | 2 +- packages/bot-processor/tsconfig.json | 5 ++--- packages/bot-processor/tsup.config.ts | 8 ++++++++ 32 files changed, 100 insertions(+), 81 deletions(-) create mode 100644 packages/bot-processor/eslint.config.js create mode 100644 packages/bot-processor/tsup.config.ts diff --git a/packages/bot-processor/eslint.config.js b/packages/bot-processor/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/bot-processor/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/bot-processor/package.json b/packages/bot-processor/package.json index 8adcfbce..25aae231 100644 --- a/packages/bot-processor/package.json +++ b/packages/bot-processor/package.json @@ -2,23 +2,25 @@ "name": "@opentrader/bot-processor", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/node": "^20.14.5", "eslint": "8.54.0", "ts-node": "10.9.2", "tslib": "^2.6.3", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/bot-processor/src/bot-control.ts b/packages/bot-processor/src/bot-control.ts index c218ddb9..3089b077 100644 --- a/packages/bot-processor/src/bot-control.ts +++ b/packages/bot-processor/src/bot-control.ts @@ -1,11 +1,11 @@ import { OrderStatusEnum } from "@opentrader/types"; -import type { UseSmartTradePayload } from "./effects"; +import type { UseSmartTradePayload } from "./effects/index.js"; import type { IBotConfiguration, IBotControl, SmartTrade, IStore, -} from "./types"; +} from "./types/index.js"; export class BotControl implements IBotControl { constructor( diff --git a/packages/bot-processor/src/effect-runner.ts b/packages/bot-processor/src/effect-runner.ts index 1c865d38..2e8281f3 100644 --- a/packages/bot-processor/src/effect-runner.ts +++ b/packages/bot-processor/src/effect-runner.ts @@ -17,9 +17,9 @@ */ import { rsi } from "@opentrader/indicators"; import { OrderStatusEnum, OrderType } from "@opentrader/types"; -import { TradeService, SmartTradeService } from "./types"; -import type { TBotContext } from "./types"; -import type { BaseEffect, EffectType } from "./effects/types"; +import { TradeService, SmartTradeService } from "./types/index.js"; +import type { TBotContext } from "./types/index.js"; +import type { BaseEffect, EffectType } from "./effects/types/index.js"; import type { buy, useTrade, @@ -33,7 +33,7 @@ import type { useMarket, useCandle, useRSI, -} from "./effects"; +} from "./effects/index.js"; import { BUY, CANCEL_SMART_TRADE, @@ -48,7 +48,7 @@ import { USE_MARKET, USE_CANDLE, USE_RSI_INDICATOR, -} from "./effects"; +} from "./effects/index.js"; export const effectRunnerMap: Record< EffectType, diff --git a/packages/bot-processor/src/effects/buy.ts b/packages/bot-processor/src/effects/buy.ts index afca96f3..338d5789 100644 --- a/packages/bot-processor/src/effects/buy.ts +++ b/packages/bot-processor/src/effects/buy.ts @@ -1,6 +1,6 @@ import type { ExchangeCode } from "@opentrader/types"; -import { BUY } from "./types"; -import { makeEffect } from "./utils"; +import { BUY } from "./types/index.js"; +import { makeEffect } from "./utils/index.js"; export type BuyPayload = { exchange?: ExchangeCode; // not implemented diff --git a/packages/bot-processor/src/effects/index.ts b/packages/bot-processor/src/effects/index.ts index a3923d5f..46215301 100644 --- a/packages/bot-processor/src/effects/index.ts +++ b/packages/bot-processor/src/effects/index.ts @@ -1,10 +1,10 @@ -export * from "./types/effect-types"; -export * from "./utils"; -export * from "./smart-trade"; -export * from "./buy"; -export * from "./sell"; -export * from "./useExchange"; -export * from "./useIndicators"; -export * from "./useTrade"; -export * from "./market"; -export * from "./indicators"; +export * from "./types/effect-types.js"; +export * from "./utils/index.js"; +export * from "./smart-trade.js"; +export * from "./buy.js"; +export * from "./sell.js"; +export * from "./useExchange.js"; +export * from "./useIndicators.js"; +export * from "./useTrade.js"; +export * from "./market.js"; +export * from "./indicators.js"; diff --git a/packages/bot-processor/src/effects/indicators.ts b/packages/bot-processor/src/effects/indicators.ts index c3c2c89e..97a5978a 100644 --- a/packages/bot-processor/src/effects/indicators.ts +++ b/packages/bot-processor/src/effects/indicators.ts @@ -1,5 +1,5 @@ -import { USE_RSI_INDICATOR } from "./types"; -import { makeEffect } from "./utils"; +import { USE_RSI_INDICATOR } from "./types/index.js"; +import { makeEffect } from "./utils/index.js"; export function useRSI(periods = 14) { return makeEffect(USE_RSI_INDICATOR, periods, undefined); diff --git a/packages/bot-processor/src/effects/market.ts b/packages/bot-processor/src/effects/market.ts index c12a3731..33338bfe 100644 --- a/packages/bot-processor/src/effects/market.ts +++ b/packages/bot-processor/src/effects/market.ts @@ -1,5 +1,5 @@ -import { USE_MARKET, USE_CANDLE } from "./types"; -import { makeEffect } from "./utils"; +import { USE_MARKET, USE_CANDLE } from "./types/index.js"; +import { makeEffect } from "./utils/index.js"; export function useMarket() { return makeEffect(USE_MARKET, undefined, undefined); diff --git a/packages/bot-processor/src/effects/sell.ts b/packages/bot-processor/src/effects/sell.ts index bc125dd7..9cd1bc0b 100644 --- a/packages/bot-processor/src/effects/sell.ts +++ b/packages/bot-processor/src/effects/sell.ts @@ -1,6 +1,6 @@ import type { ExchangeCode } from "@opentrader/types"; -import { SELL } from "./types"; -import { makeEffect } from "./utils"; +import { SELL } from "./types/index.js"; +import { makeEffect } from "./utils/index.js"; export type SellPayload = { exchange?: ExchangeCode; // // not implemented diff --git a/packages/bot-processor/src/effects/smart-trade.ts b/packages/bot-processor/src/effects/smart-trade.ts index c19f73d0..d5c26109 100644 --- a/packages/bot-processor/src/effects/smart-trade.ts +++ b/packages/bot-processor/src/effects/smart-trade.ts @@ -1,13 +1,13 @@ import type { OrderStatusEnum, OrderType } from "@opentrader/types"; -import type { SmartTrade } from "../types"; +import type { SmartTrade } from "../types/index.js"; import { GET_SMART_TRADE, CANCEL_SMART_TRADE, CREATE_SMART_TRADE, REPLACE_SMART_TRADE, USE_SMART_TRADE, -} from "./types"; -import { makeEffect } from "./utils"; +} from "./types/index.js"; +import { makeEffect } from "./utils/index.js"; // Default smart trade reference const DEFAULT_REF = "0"; diff --git a/packages/bot-processor/src/effects/types/base-effect.ts b/packages/bot-processor/src/effects/types/base-effect.ts index 3dd46555..21ac1bb2 100644 --- a/packages/bot-processor/src/effects/types/base-effect.ts +++ b/packages/bot-processor/src/effects/types/base-effect.ts @@ -1,4 +1,4 @@ -import type { EffectType } from "./effect-types"; +import type { EffectType } from "./effect-types.js"; export type BaseEffect = { type: T; diff --git a/packages/bot-processor/src/effects/types/index.ts b/packages/bot-processor/src/effects/types/index.ts index 11256a28..91250b4d 100644 --- a/packages/bot-processor/src/effects/types/index.ts +++ b/packages/bot-processor/src/effects/types/index.ts @@ -1,2 +1,2 @@ -export * from "./base-effect"; -export * from "./effect-types"; +export * from "./base-effect.js"; +export * from "./effect-types.js"; diff --git a/packages/bot-processor/src/effects/useExchange.ts b/packages/bot-processor/src/effects/useExchange.ts index cb376857..d3b3bd38 100644 --- a/packages/bot-processor/src/effects/useExchange.ts +++ b/packages/bot-processor/src/effects/useExchange.ts @@ -1,5 +1,5 @@ -import { USE_EXCHANGE } from "./types"; -import { makeEffect } from "./utils"; +import { USE_EXCHANGE } from "./types/index.js"; +import { makeEffect } from "./utils/index.js"; /** * If no label is provided, the default exchange linked to the bot will be used. diff --git a/packages/bot-processor/src/effects/useIndicators.ts b/packages/bot-processor/src/effects/useIndicators.ts index 734ea311..f63d9604 100644 --- a/packages/bot-processor/src/effects/useIndicators.ts +++ b/packages/bot-processor/src/effects/useIndicators.ts @@ -1,6 +1,6 @@ import type { IndicatorBarSize, IndicatorName } from "@opentrader/types"; -import { makeEffect } from "./utils"; -import { USE_INDICATORS } from "./types"; +import { makeEffect } from "./utils/index.js"; +import { USE_INDICATORS } from "./types/index.js"; export function useIndicators( indicators: IndicatorName[], diff --git a/packages/bot-processor/src/effects/useTrade.ts b/packages/bot-processor/src/effects/useTrade.ts index 428ef5a4..2b429db2 100644 --- a/packages/bot-processor/src/effects/useTrade.ts +++ b/packages/bot-processor/src/effects/useTrade.ts @@ -1,6 +1,6 @@ import type { ExchangeCode, OrderSide, OrderType } from "@opentrader/types"; -import { makeEffect } from "./utils"; -import { USE_TRADE } from "./types"; +import { makeEffect } from "./utils/index.js"; +import { USE_TRADE } from "./types/index.js"; type UseTradePayload = { quantity: number; diff --git a/packages/bot-processor/src/effects/utils/index.ts b/packages/bot-processor/src/effects/utils/index.ts index d44cf8d5..beced211 100644 --- a/packages/bot-processor/src/effects/utils/index.ts +++ b/packages/bot-processor/src/effects/utils/index.ts @@ -1,4 +1,4 @@ -import type { BaseEffect, EffectType } from "../types"; +import type { BaseEffect, EffectType } from "../types/index.js"; export const makeEffect = ( type: T, diff --git a/packages/bot-processor/src/index.ts b/packages/bot-processor/src/index.ts index 3ffe39b7..3cc801e5 100644 --- a/packages/bot-processor/src/index.ts +++ b/packages/bot-processor/src/index.ts @@ -15,7 +15,7 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * from "./effects"; -export * from "./types"; -export * from "./strategy-runner"; -export * from "./bot-control"; +export * from "./effects/index.js"; +export * from "./types/index.js"; +export * from "./strategy-runner.js"; +export * from "./bot-control.js"; diff --git a/packages/bot-processor/src/strategy-runner.ts b/packages/bot-processor/src/strategy-runner.ts index 79561113..94897420 100644 --- a/packages/bot-processor/src/strategy-runner.ts +++ b/packages/bot-processor/src/strategy-runner.ts @@ -16,9 +16,9 @@ * Repository URL: https://github.com/bludnic/opentrader */ import type { IExchange } from "@opentrader/exchanges"; -import { BotControl } from "./bot-control"; -import { effectRunnerMap } from "./effect-runner"; -import { isEffect } from "./effects"; +import { BotControl } from "./bot-control.js"; +import { effectRunnerMap } from "./effect-runner.js"; +import { isEffect } from "./effects/index.js"; import type { BotState, BotTemplate, @@ -27,8 +27,8 @@ import type { IStore, MarketData, TBotContext, -} from "./types"; -import { createContext } from "./utils/createContext"; +} from "./types/index.js"; +import { createContext } from "./utils/createContext.js"; export class StrategyRunner { constructor( diff --git a/packages/bot-processor/src/types/bot/bot-context.type.ts b/packages/bot-processor/src/types/bot/bot-context.type.ts index 5915cbe2..61e4ae4c 100644 --- a/packages/bot-processor/src/types/bot/bot-context.type.ts +++ b/packages/bot-processor/src/types/bot/bot-context.type.ts @@ -1,8 +1,8 @@ import type { IExchange } from "@opentrader/exchanges"; -import type { MarketData } from "../market"; -import type { IBotControl } from "./bot-control.interface"; -import type { IBotConfiguration } from "./bot-configuration.interface"; -import type { BotState } from "./bot.state"; +import type { MarketData } from "../market/index.js"; +import type { IBotControl } from "./bot-control.interface.js"; +import type { IBotConfiguration } from "./bot-configuration.interface.js"; +import type { BotState } from "./bot.state.js"; export type TBotContext< T extends IBotConfiguration, diff --git a/packages/bot-processor/src/types/bot/bot-control.interface.ts b/packages/bot-processor/src/types/bot/bot-control.interface.ts index ad64705c..44220c97 100644 --- a/packages/bot-processor/src/types/bot/bot-control.interface.ts +++ b/packages/bot-processor/src/types/bot/bot-control.interface.ts @@ -1,6 +1,6 @@ import type { IExchange } from "@opentrader/exchanges"; -import type { UseSmartTradePayload } from "../../effects"; -import type { SmartTrade } from "../smart-trade"; +import type { UseSmartTradePayload } from "../../effects/index.js" +import type { SmartTrade } from "../smart-trade/index.js"; export interface IBotControl { /** diff --git a/packages/bot-processor/src/types/bot/bot-template.type.ts b/packages/bot-processor/src/types/bot/bot-template.type.ts index 92fe2417..220669a2 100644 --- a/packages/bot-processor/src/types/bot/bot-template.type.ts +++ b/packages/bot-processor/src/types/bot/bot-template.type.ts @@ -1,6 +1,6 @@ import type { ZodObject } from "zod"; -import type { TBotContext } from "./bot-context.type"; -import type { IBotConfiguration } from "./bot-configuration.interface"; +import type { TBotContext } from "./bot-context.type.js"; +import type { IBotConfiguration } from "./bot-configuration.interface.js"; export interface BotTemplate { (ctx: TBotContext): Generator; diff --git a/packages/bot-processor/src/types/bot/index.ts b/packages/bot-processor/src/types/bot/index.ts index 2511259d..c0a8b51a 100644 --- a/packages/bot-processor/src/types/bot/index.ts +++ b/packages/bot-processor/src/types/bot/index.ts @@ -1,5 +1,5 @@ -export * from "./bot-configuration.interface"; -export * from "./bot-control.interface"; -export * from "./bot-template.type"; -export * from "./bot-context.type"; -export * from "./bot.state"; +export * from "./bot-configuration.interface.js"; +export * from "./bot-control.interface.js"; +export * from "./bot-template.type.js"; +export * from "./bot-context.type.js"; +export * from "./bot.state.js"; diff --git a/packages/bot-processor/src/types/index.ts b/packages/bot-processor/src/types/index.ts index 62b1ec5a..ff157c4f 100644 --- a/packages/bot-processor/src/types/index.ts +++ b/packages/bot-processor/src/types/index.ts @@ -1,4 +1,4 @@ -export * from "./bot"; -export * from "./smart-trade"; -export * from "./store"; -export * from "./market"; +export * from "./bot/index.js"; +export * from "./smart-trade/index.js"; +export * from "./store/index.js"; +export * from "./market/index.js"; diff --git a/packages/bot-processor/src/types/market/index.ts b/packages/bot-processor/src/types/market/index.ts index aed10353..452964ef 100644 --- a/packages/bot-processor/src/types/market/index.ts +++ b/packages/bot-processor/src/types/market/index.ts @@ -1 +1 @@ -export * from "./market-data"; +export * from "./market-data.js"; diff --git a/packages/bot-processor/src/types/smart-trade/index.ts b/packages/bot-processor/src/types/smart-trade/index.ts index b32d39b9..2287ef0d 100644 --- a/packages/bot-processor/src/types/smart-trade/index.ts +++ b/packages/bot-processor/src/types/smart-trade/index.ts @@ -1,3 +1,3 @@ -export * from "./smart-trade.type"; -export * from "./smart-trade.service"; -export * from "./trade.service"; +export * from "./smart-trade.type.js"; +export * from "./smart-trade.service.js"; +export * from "./trade.service.js"; diff --git a/packages/bot-processor/src/types/smart-trade/smart-trade.service.ts b/packages/bot-processor/src/types/smart-trade/smart-trade.service.ts index 3b9bd880..41a17a2f 100644 --- a/packages/bot-processor/src/types/smart-trade/smart-trade.service.ts +++ b/packages/bot-processor/src/types/smart-trade/smart-trade.service.ts @@ -1,6 +1,6 @@ import { OrderStatusEnum } from "@opentrader/types"; -import { cancelSmartTrade, replaceSmartTrade } from "../../effects"; -import type { SmartTrade } from "./smart-trade.type"; +import { cancelSmartTrade, replaceSmartTrade } from "../../effects/index.js"; +import type { SmartTrade } from "./smart-trade.type.js"; export class SmartTradeService { buy: SmartTrade["buy"]; diff --git a/packages/bot-processor/src/types/smart-trade/trade.service.ts b/packages/bot-processor/src/types/smart-trade/trade.service.ts index 45d9912a..053c647a 100644 --- a/packages/bot-processor/src/types/smart-trade/trade.service.ts +++ b/packages/bot-processor/src/types/smart-trade/trade.service.ts @@ -1,6 +1,6 @@ import { OrderStatusEnum } from "@opentrader/types"; -import { cancelSmartTrade } from "../../effects"; -import type { SmartTrade } from "./smart-trade.type"; +import { cancelSmartTrade } from "../../effects/index.js"; +import type { SmartTrade } from "./smart-trade.type.js"; export class TradeService { buy: SmartTrade["buy"]; diff --git a/packages/bot-processor/src/types/store/index.ts b/packages/bot-processor/src/types/store/index.ts index 1e1ab63a..d326c61c 100644 --- a/packages/bot-processor/src/types/store/index.ts +++ b/packages/bot-processor/src/types/store/index.ts @@ -1 +1 @@ -export * from "./store.interface"; +export * from "./store.interface.js"; diff --git a/packages/bot-processor/src/types/store/store.interface.ts b/packages/bot-processor/src/types/store/store.interface.ts index 6c2287c5..9e6e7e74 100644 --- a/packages/bot-processor/src/types/store/store.interface.ts +++ b/packages/bot-processor/src/types/store/store.interface.ts @@ -1,6 +1,6 @@ import type { IExchange } from "@opentrader/exchanges"; -import type { UseSmartTradePayload } from "../../effects"; -import type { SmartTrade } from "../smart-trade"; +import type { UseSmartTradePayload } from "../../effects/index.js"; +import type { SmartTrade } from "../smart-trade/index.js"; export interface IStore { stopBot: (botId: number) => Promise; diff --git a/packages/bot-processor/src/utils/createContext.ts b/packages/bot-processor/src/utils/createContext.ts index 7a71b759..d8a84a3f 100644 --- a/packages/bot-processor/src/utils/createContext.ts +++ b/packages/bot-processor/src/utils/createContext.ts @@ -5,7 +5,7 @@ import type { IBotControl, MarketData, TBotContext, -} from "../types"; +} from "../types/index.js"; export function createContext( control: IBotControl, diff --git a/packages/bot-processor/tsconfig.json b/packages/bot-processor/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/bot-processor/tsconfig.json +++ b/packages/bot-processor/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/bot-processor/tsup.config.ts b/packages/bot-processor/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/bot-processor/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From c4d33f849026382fa2e82e4bee4b0bf69ccf7c3f Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 00:43:01 +0100 Subject: [PATCH 13/68] chore: remove legacy eslint configuration --- packages/bot-processor/.eslintrc.js | 5 ----- packages/bot/.eslintrc.js | 8 -------- 2 files changed, 13 deletions(-) delete mode 100644 packages/bot-processor/.eslintrc.js delete mode 100644 packages/bot/.eslintrc.js diff --git a/packages/bot-processor/.eslintrc.js b/packages/bot-processor/.eslintrc.js deleted file mode 100644 index 097111f4..00000000 --- a/packages/bot-processor/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], -}; diff --git a/packages/bot/.eslintrc.js b/packages/bot/.eslintrc.js deleted file mode 100644 index 4e85501c..00000000 --- a/packages/bot/.eslintrc.js +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], - rules: { - "@typescript-eslint/unified-signatures": "off", - }, -}; From a1fab175ad1b602d2e29f1071bece9d39c35a34a Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 01:08:09 +0100 Subject: [PATCH 14/68] chore(package/bot-templates): convert to ESM --- packages/bot-templates/.eslintrc.js | 13 ------------- packages/bot-templates/eslint.config.js | 10 ++++++++++ packages/bot-templates/package.json | 6 ++++-- packages/bot-templates/src/index.ts | 4 ++-- packages/bot-templates/src/server/dynamic-import.js | 2 +- packages/bot-templates/src/server/index.ts | 4 ++-- packages/bot-templates/src/templates/grid-bot.ts | 3 ++- packages/bot-templates/src/templates/grid.ts | 4 ++-- packages/bot-templates/src/templates/index.ts | 8 ++++---- packages/bot-templates/src/templates/test/index.ts | 12 ++++++------ packages/bot-templates/src/templates/test/state.ts | 6 +++--- packages/bot-templates/tsconfig.json | 5 ++--- packages/bot-templates/tsup.config.ts | 8 ++++++++ packages/tsconfig/esm.json | 8 ++------ 14 files changed, 48 insertions(+), 45 deletions(-) delete mode 100644 packages/bot-templates/.eslintrc.js create mode 100644 packages/bot-templates/eslint.config.js create mode 100644 packages/bot-templates/tsup.config.ts diff --git a/packages/bot-templates/.eslintrc.js b/packages/bot-templates/.eslintrc.js deleted file mode 100644 index 8c22b791..00000000 --- a/packages/bot-templates/.eslintrc.js +++ /dev/null @@ -1,13 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], - rules: { - // Bot templates usually use type correction `any -> SomeType` - // ```ts - // const result: SomeType = yield someEffect() - // ``` - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - }, -}; diff --git a/packages/bot-templates/eslint.config.js b/packages/bot-templates/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/bot-templates/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/bot-templates/package.json b/packages/bot-templates/package.json index 592a040c..3b6b1544 100644 --- a/packages/bot-templates/package.json +++ b/packages/bot-templates/package.json @@ -2,6 +2,7 @@ "name": "@opentrader/bot-templates", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "exports": { @@ -10,7 +11,7 @@ "./dist": "./src/index.ts" }, "scripts": { - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix", "test": "jest" @@ -19,7 +20,7 @@ "license": "Apache-2.0", "devDependencies": { "@jest/globals": "^29.7.0", - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/jest": "^29.5.12", @@ -27,6 +28,7 @@ "eslint": "8.54.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/bot-templates/src/index.ts b/packages/bot-templates/src/index.ts index 4564dbfa..161bafdf 100644 --- a/packages/bot-templates/src/index.ts +++ b/packages/bot-templates/src/index.ts @@ -16,9 +16,9 @@ * Repository URL: https://github.com/bludnic/opentrader */ import type { BotTemplate } from "@opentrader/bot-processor"; -import * as templates from "./templates"; +import * as templates from "./templates/index.js"; -export * from "./templates"; +export * from "./templates/index.js"; export function findTemplate(template: string): BotTemplate { if (template in templates) { diff --git a/packages/bot-templates/src/server/dynamic-import.js b/packages/bot-templates/src/server/dynamic-import.js index c6ff02bb..ff4718b7 100644 --- a/packages/bot-templates/src/server/dynamic-import.js +++ b/packages/bot-templates/src/server/dynamic-import.js @@ -1,4 +1,4 @@ // Webpack replaces calls to `require()` from within a bundle. This module // is not parsed by webpack and exports the real `require` // NOTE: since the module is unparsed, do not use es6 exports -module.exports = require; +export default require; diff --git a/packages/bot-templates/src/server/index.ts b/packages/bot-templates/src/server/index.ts index abbc666b..a201c13b 100644 --- a/packages/bot-templates/src/server/index.ts +++ b/packages/bot-templates/src/server/index.ts @@ -1,7 +1,7 @@ import { join } from "node:path"; import type { BotTemplate } from "@opentrader/bot-processor"; -import * as templates from "../templates"; -import dynamicImport from "./dynamic-import"; +import * as templates from "../templates/index.js"; +import dynamicImport from "./dynamic-import.js"; type FindStrategyResult = { strategyFn: BotTemplate; diff --git a/packages/bot-templates/src/templates/grid-bot.ts b/packages/bot-templates/src/templates/grid-bot.ts index 94e5387e..be423890 100644 --- a/packages/bot-templates/src/templates/grid-bot.ts +++ b/packages/bot-templates/src/templates/grid-bot.ts @@ -1,9 +1,10 @@ import { z } from "zod"; import type { IExchange } from "@opentrader/exchanges"; import type { + BotTemplate, IBotConfiguration, SmartTradeService, - TBotContext, + TBotContext } from "@opentrader/bot-processor"; import { cancelSmartTrade, diff --git a/packages/bot-templates/src/templates/grid.ts b/packages/bot-templates/src/templates/grid.ts index 0db1ca1c..d651bff8 100644 --- a/packages/bot-templates/src/templates/grid.ts +++ b/packages/bot-templates/src/templates/grid.ts @@ -1,8 +1,8 @@ import { z } from "zod"; import type { IBotConfiguration, TBotContext } from "@opentrader/bot-processor"; import { calcGridLines } from "@opentrader/tools"; -import type { GridBotConfig } from "./grid-bot"; -import { gridBot } from "./grid-bot"; +import type { GridBotConfig } from "./grid-bot.js"; +import { gridBot } from "./grid-bot.js"; /** * Wrapper for the `gridBot` template with a simplified configuration. diff --git a/packages/bot-templates/src/templates/index.ts b/packages/bot-templates/src/templates/index.ts index ebb524ce..4b962a03 100644 --- a/packages/bot-templates/src/templates/index.ts +++ b/packages/bot-templates/src/templates/index.ts @@ -1,4 +1,4 @@ -export * from "./grid-bot"; -export * from "./grid"; -export * from "./rsi"; -export * from "./test"; +export * from "./grid-bot.js"; +export * from "./grid.js"; +export * from "./rsi.js"; +export * from "./test/index.js"; diff --git a/packages/bot-templates/src/templates/test/index.ts b/packages/bot-templates/src/templates/test/index.ts index a11055c6..328d98a0 100644 --- a/packages/bot-templates/src/templates/test/index.ts +++ b/packages/bot-templates/src/templates/test/index.ts @@ -1,6 +1,6 @@ -export * from "./buySell"; -export * from "./trade"; -export * from "./debug"; -export * from "./candle"; -export * from "./rsi"; -export * from "./state"; +export * from "./buySell.js"; +export * from "./trade.js"; +export * from "./debug.js"; +export * from "./candle.js"; +export * from "./rsi.js"; +export * from "./state.js"; diff --git a/packages/bot-templates/src/templates/test/state.ts b/packages/bot-templates/src/templates/test/state.ts index 9c15ddf5..18343700 100644 --- a/packages/bot-templates/src/templates/test/state.ts +++ b/packages/bot-templates/src/templates/test/state.ts @@ -15,11 +15,11 @@ export function* testState(ctx: TBotContext) { return; } - if (ctx.state.counter === undefined) { - ctx.state.counter = 0; + if (ctx.state['counter'] === undefined) { + ctx.state['counter'] = 0; } - ctx.state.counter += 1; + ctx.state['counter'] += 1; logger.info(ctx.state, `[TestState] State is`); } diff --git a/packages/bot-templates/tsconfig.json b/packages/bot-templates/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/bot-templates/tsconfig.json +++ b/packages/bot-templates/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/bot-templates/tsup.config.ts b/packages/bot-templates/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/bot-templates/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); diff --git a/packages/tsconfig/esm.json b/packages/tsconfig/esm.json index 05f7388f..f9e70885 100644 --- a/packages/tsconfig/esm.json +++ b/packages/tsconfig/esm.json @@ -1,13 +1,9 @@ { "$schema": "https://json.schemastore.org/tsconfig", "extends": [ - "@tsconfig/node20/tsconfig.json", - "@tsconfig/strictest/tsconfig.json" + "@tsconfig/node20/tsconfig.json" ], "compilerOptions": { - "exactOptionalPropertyTypes": false, - "strictNullChecks": false, - "noUnusedLocals": false, - "noUnusedParameters": false + "strict": true } } From 7d73754daf31a4d3c68c502fd161480a013e01b2 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 01:12:40 +0100 Subject: [PATCH 15/68] chore(package/bot-templates): convert to ESM --- packages/db/.eslintrc.js | 5 ----- packages/db/eslint.config.js | 10 ++++++++++ packages/db/package.json | 6 ++++-- packages/db/src/asserts/assertHasExchangeOrderId.ts | 2 +- packages/db/src/asserts/assertIsOrderBased.ts | 2 +- packages/db/src/asserts/index.ts | 4 ++-- packages/db/src/entities/index.ts | 4 ++-- packages/db/src/entities/smart-trade.entity.ts | 6 +++--- packages/db/src/extension/models/custom-bot.model.ts | 4 ++-- packages/db/src/extension/models/grid-bot.model.ts | 4 ++-- packages/db/src/index.ts | 8 ++++---- packages/db/src/types/bot/bot.schema.ts | 4 ++-- packages/db/src/types/bot/index.ts | 6 +++--- .../exchange-account-with-credentials.ts | 2 +- packages/db/src/types/exchange-account/index.ts | 2 +- .../db/src/types/grid-bot/grid-bot-settings.schema.ts | 2 +- packages/db/src/types/grid-bot/grid-bot.schema.ts | 4 ++-- packages/db/src/types/grid-bot/index.ts | 6 +++--- packages/db/src/types/index.ts | 10 +++++----- packages/db/src/types/order/index.ts | 2 +- packages/db/src/types/smart-trade/index.ts | 2 +- packages/db/src/xprisma.ts | 8 ++++---- packages/db/tsconfig.json | 5 ++--- packages/db/tsup.config.ts | 8 ++++++++ 24 files changed, 65 insertions(+), 51 deletions(-) delete mode 100644 packages/db/.eslintrc.js create mode 100644 packages/db/eslint.config.js create mode 100644 packages/db/tsup.config.ts diff --git a/packages/db/.eslintrc.js b/packages/db/.eslintrc.js deleted file mode 100644 index 097111f4..00000000 --- a/packages/db/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], -}; diff --git a/packages/db/eslint.config.js b/packages/db/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/db/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/db/package.json b/packages/db/package.json index b2c22a2f..622ab0a8 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -2,21 +2,23 @@ "name": "@opentrader/db", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/node": "^20.14.5", "eslint": "8.54.0", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/db/src/asserts/assertHasExchangeOrderId.ts b/packages/db/src/asserts/assertHasExchangeOrderId.ts index 54c3c049..6f99faa2 100644 --- a/packages/db/src/asserts/assertHasExchangeOrderId.ts +++ b/packages/db/src/asserts/assertHasExchangeOrderId.ts @@ -1,4 +1,4 @@ -import type { OrderEntity } from "../entities"; +import type { OrderEntity } from "../entities/index.js"; type RequiredNotNull = T & { [P in K]: NonNullable; diff --git a/packages/db/src/asserts/assertIsOrderBased.ts b/packages/db/src/asserts/assertIsOrderBased.ts index 36101d5d..6e87c10c 100644 --- a/packages/db/src/asserts/assertIsOrderBased.ts +++ b/packages/db/src/asserts/assertIsOrderBased.ts @@ -1,7 +1,7 @@ import type { SmartTradeEntity, SmartTradeEntity_Order_Order, -} from "../entities"; +} from "../entities/index.js"; /** * Asserts that SmartTrade uses orders for entry and exit diff --git a/packages/db/src/asserts/index.ts b/packages/db/src/asserts/index.ts index 740dc110..7c80071e 100644 --- a/packages/db/src/asserts/index.ts +++ b/packages/db/src/asserts/index.ts @@ -1,2 +1,2 @@ -export * from "./assertIsOrderBased"; -export * from "./assertHasExchangeOrderId"; +export * from "./assertIsOrderBased.js"; +export * from "./assertHasExchangeOrderId.js"; diff --git a/packages/db/src/entities/index.ts b/packages/db/src/entities/index.ts index 50aba4fa..a5599ad4 100644 --- a/packages/db/src/entities/index.ts +++ b/packages/db/src/entities/index.ts @@ -1,2 +1,2 @@ -export * from "./order.entity"; -export * from "./smart-trade.entity"; +export * from "./order.entity.js"; +export * from "./smart-trade.entity.js"; diff --git a/packages/db/src/entities/smart-trade.entity.ts b/packages/db/src/entities/smart-trade.entity.ts index 176e1fb7..b13a6217 100644 --- a/packages/db/src/entities/smart-trade.entity.ts +++ b/packages/db/src/entities/smart-trade.entity.ts @@ -1,7 +1,7 @@ import type { $Enums } from "@prisma/client"; -import type { SmartTradeWithOrders } from "../types/smart-trade"; -import type { OrderEntity } from "./order.entity"; -import { toOrderEntity } from "./order.entity"; +import type { SmartTradeWithOrders } from "../types/smart-trade/index.js"; +import type { OrderEntity } from "./order.entity.js"; +import { toOrderEntity } from "./order.entity.js"; export type SmartTradeEntityBuilder< EntryType extends $Enums.EntryType, diff --git a/packages/db/src/extension/models/custom-bot.model.ts b/packages/db/src/extension/models/custom-bot.model.ts index 63b87a25..50be4830 100644 --- a/packages/db/src/extension/models/custom-bot.model.ts +++ b/packages/db/src/extension/models/custom-bot.model.ts @@ -4,8 +4,8 @@ import { GetFindResult, InternalArgs, } from "@prisma/client/runtime/library"; -import type { TBotSettings, TBotState } from "../../types"; -import { ZBotSettings } from "../../types"; +import type { TBotSettings, TBotState } from "../../types/index.js"; +import { ZBotSettings } from "../../types/index.js"; type NarrowBotType = Omit< Awaited, T>>, diff --git a/packages/db/src/extension/models/grid-bot.model.ts b/packages/db/src/extension/models/grid-bot.model.ts index 63250ae4..b2c5745c 100644 --- a/packages/db/src/extension/models/grid-bot.model.ts +++ b/packages/db/src/extension/models/grid-bot.model.ts @@ -4,8 +4,8 @@ import type { GetFindResult, InternalArgs, } from "@prisma/client/runtime/library"; -import type { TBotState, TGridBotSettings } from "../../types"; -import { ZGridBotSettings } from "../../types/grid-bot"; +import type { TBotState, TGridBotSettings } from "../../types/index.js"; +import { ZGridBotSettings } from "../../types/grid-bot/index.js"; type NarrowBotType = Omit< Awaited, T>>, diff --git a/packages/db/src/index.ts b/packages/db/src/index.ts index d1aba4c7..7930e7ed 100644 --- a/packages/db/src/index.ts +++ b/packages/db/src/index.ts @@ -15,8 +15,8 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * from "./xprisma"; -export * from "./types"; -export * from "./entities"; -export * from "./asserts"; +export * from "./xprisma.js"; +export * from "./types/index.js"; +export * from "./entities/index.js"; +export * from "./asserts/index.js"; export * from "@prisma/client"; // forward export of Prisma types diff --git a/packages/db/src/types/bot/bot.schema.ts b/packages/db/src/types/bot/bot.schema.ts index 48b21950..0834e759 100644 --- a/packages/db/src/types/bot/bot.schema.ts +++ b/packages/db/src/types/bot/bot.schema.ts @@ -1,7 +1,7 @@ import { zt } from "@opentrader/prisma"; import type { z } from "zod"; -import { ZBotSettings } from "./bot-settings.schema"; -import { ZBotState } from "./bot-state.schema"; +import { ZBotSettings } from "./bot-settings.schema.js"; +import { ZBotState } from "./bot-state.schema.js"; export const ZBot = zt.BotSchema.extend({ settings: ZBotSettings, diff --git a/packages/db/src/types/bot/index.ts b/packages/db/src/types/bot/index.ts index 2911752a..c5c95ee4 100644 --- a/packages/db/src/types/bot/index.ts +++ b/packages/db/src/types/bot/index.ts @@ -1,3 +1,3 @@ -export * from "./bot-settings.schema"; -export * from "./bot.schema"; -export * from "./bot-state.schema"; +export * from "./bot-settings.schema.js"; +export * from "./bot.schema.js"; +export * from "./bot-state.schema.js"; diff --git a/packages/db/src/types/exchange-account/exchange-account-with-credentials.ts b/packages/db/src/types/exchange-account/exchange-account-with-credentials.ts index db841bc8..80da85a7 100644 --- a/packages/db/src/types/exchange-account/exchange-account-with-credentials.ts +++ b/packages/db/src/types/exchange-account/exchange-account-with-credentials.ts @@ -1,5 +1,5 @@ import type { Prisma } from "@prisma/client"; -import type { xprisma } from "../../xprisma"; +import type { xprisma } from "../../xprisma.js"; export type ExchangeAccountWithCredentials = Prisma.PromiseReturnType< typeof xprisma.exchangeAccount.findUniqueOrThrow diff --git a/packages/db/src/types/exchange-account/index.ts b/packages/db/src/types/exchange-account/index.ts index 829430e3..44ff7008 100644 --- a/packages/db/src/types/exchange-account/index.ts +++ b/packages/db/src/types/exchange-account/index.ts @@ -1 +1 @@ -export * from "./exchange-account-with-credentials"; +export * from "./exchange-account-with-credentials.js"; diff --git a/packages/db/src/types/grid-bot/grid-bot-settings.schema.ts b/packages/db/src/types/grid-bot/grid-bot-settings.schema.ts index 0f7ed85c..6c754209 100644 --- a/packages/db/src/types/grid-bot/grid-bot-settings.schema.ts +++ b/packages/db/src/types/grid-bot/grid-bot-settings.schema.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ZGridLineSchema } from "./grid-line.schema"; +import { ZGridLineSchema } from "./grid-line.schema.js"; export const ZGridBotSettings = z.object({ gridLines: z.array(ZGridLineSchema), diff --git a/packages/db/src/types/grid-bot/grid-bot.schema.ts b/packages/db/src/types/grid-bot/grid-bot.schema.ts index 768201c0..2ab7af2c 100644 --- a/packages/db/src/types/grid-bot/grid-bot.schema.ts +++ b/packages/db/src/types/grid-bot/grid-bot.schema.ts @@ -1,7 +1,7 @@ import { zt } from "@opentrader/prisma"; import type { z } from "zod"; -import { ZGridBotSettings } from "./grid-bot-settings.schema"; -import { ZBotState } from "../bot/bot-state.schema"; +import { ZGridBotSettings } from "./grid-bot-settings.schema.js"; +import { ZBotState } from "../bot/bot-state.schema.js"; export const ZGridBot = zt.BotSchema.extend({ settings: ZGridBotSettings, diff --git a/packages/db/src/types/grid-bot/index.ts b/packages/db/src/types/grid-bot/index.ts index fdf96021..7f7d7979 100644 --- a/packages/db/src/types/grid-bot/index.ts +++ b/packages/db/src/types/grid-bot/index.ts @@ -1,3 +1,3 @@ -export * from "./grid-line.schema"; -export * from "./grid-bot-settings.schema"; -export * from "./grid-bot.schema"; +export * from "./grid-line.schema.js"; +export * from "./grid-bot-settings.schema.js"; +export * from "./grid-bot.schema.js"; diff --git a/packages/db/src/types/index.ts b/packages/db/src/types/index.ts index e136624f..1a784f76 100644 --- a/packages/db/src/types/index.ts +++ b/packages/db/src/types/index.ts @@ -1,5 +1,5 @@ -export * from "./exchange-account"; -export * from "./bot"; -export * from "./grid-bot"; -export * from "./order"; -export * from "./smart-trade"; +export * from "./exchange-account/index.js"; +export * from "./bot/index.js"; +export * from "./grid-bot/index.js"; +export * from "./order/index.js"; +export * from "./smart-trade/index.js"; diff --git a/packages/db/src/types/order/index.ts b/packages/db/src/types/order/index.ts index 898d1b34..a5ed079b 100644 --- a/packages/db/src/types/order/index.ts +++ b/packages/db/src/types/order/index.ts @@ -1 +1 @@ -export * from "./order-with-smart-trade"; +export * from "./order-with-smart-trade.js"; diff --git a/packages/db/src/types/smart-trade/index.ts b/packages/db/src/types/smart-trade/index.ts index 6181a926..1a20b791 100644 --- a/packages/db/src/types/smart-trade/index.ts +++ b/packages/db/src/types/smart-trade/index.ts @@ -1 +1 @@ -export * from "./smart-trade-with-orders"; +export * from "./smart-trade-with-orders.js"; diff --git a/packages/db/src/xprisma.ts b/packages/db/src/xprisma.ts index 3b5730c0..f3432346 100644 --- a/packages/db/src/xprisma.ts +++ b/packages/db/src/xprisma.ts @@ -1,8 +1,8 @@ import { PrismaClient } from "@prisma/client"; -import { gridBotModel } from "./extension/models/grid-bot.model"; -import { orderModel } from "./extension/models/order.model"; -import { smartTradeModel } from "./extension/models/smart-trade.model"; -import { customBotModel } from "./extension/models/custom-bot.model"; +import { gridBotModel } from "./extension/models/grid-bot.model.js"; +import { orderModel } from "./extension/models/order.model.js"; +import { smartTradeModel } from "./extension/models/smart-trade.model.js"; +import { customBotModel } from "./extension/models/custom-bot.model.js"; function newPrismaClientInstance() { console.log("❕ DB: Created new instance of PrismaClient"); diff --git a/packages/db/tsconfig.json b/packages/db/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/db/tsconfig.json +++ b/packages/db/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/db/tsup.config.ts b/packages/db/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/db/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From fba64526015998dc86dea0a333b5ccd2c9cdce90 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 01:28:28 +0100 Subject: [PATCH 16/68] chore(TypeScript): copy ESM configuration, remove dependencies --- packages/tsconfig/esm.json | 13 +++++++++---- packages/tsconfig/package.json | 6 +----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/tsconfig/esm.json b/packages/tsconfig/esm.json index f9e70885..b6e734a7 100644 --- a/packages/tsconfig/esm.json +++ b/packages/tsconfig/esm.json @@ -1,9 +1,14 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": [ - "@tsconfig/node20/tsconfig.json" - ], + "display": "TypeScript configuration using ESM", "compilerOptions": { - "strict": true + "lib": ["es2023", "DOM"], + "module": "node16", + "target": "es2022", + + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "moduleResolution": "node16" } } diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json index 492f6da8..7ae93698 100644 --- a/packages/tsconfig/package.json +++ b/packages/tsconfig/package.json @@ -15,9 +15,5 @@ "bugs": { "url": "https://github.com/Open-Trader/opentrader/issues" }, - "homepage": "https://github.com/Open-Trader/opentrader/tree/master/packages/tsconfig", - "devDependencies": { - "@tsconfig/node20": "^20.1.4", - "@tsconfig/strictest": "^2.0.5" - } + "homepage": "https://github.com/Open-Trader/opentrader/tree/master/packages/tsconfig" } From 49d1c72f8b7e55aacc6511163ce2b2bf4b2eb629 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 01:29:29 +0100 Subject: [PATCH 17/68] chore(packages/exchanges): convert to ESM --- packages/exchanges/.eslintrc.js | 15 --------------- packages/exchanges/eslint.config.js | 10 ++++++++++ packages/exchanges/package.json | 6 ++++-- packages/exchanges/src/cache.ts | 4 ++-- .../cache/providers/memory-cache.provider.ts | 2 +- packages/exchanges/src/exchange.provider.ts | 4 ++-- packages/exchanges/src/exchanges/ccxt/exchange.ts | 10 +++++----- packages/exchanges/src/exchanges/ccxt/factory.ts | 4 ++-- .../exchanges/src/exchanges/ccxt/normalize.ts | 4 ++-- packages/exchanges/src/exchanges/index.ts | 4 ++-- packages/exchanges/src/index.ts | 8 ++++---- .../cache/providers/prisma-cache.provider.ts | 2 +- packages/exchanges/src/types/index.ts | 4 ++-- packages/exchanges/src/utils/next/fetcher.ts | 1 + packages/exchanges/tsconfig.json | 5 ++--- packages/exchanges/tsup.config.ts | 8 ++++++++ 16 files changed, 48 insertions(+), 43 deletions(-) delete mode 100644 packages/exchanges/.eslintrc.js create mode 100644 packages/exchanges/eslint.config.js create mode 100644 packages/exchanges/tsup.config.ts diff --git a/packages/exchanges/.eslintrc.js b/packages/exchanges/.eslintrc.js deleted file mode 100644 index 588ff544..00000000 --- a/packages/exchanges/.eslintrc.js +++ /dev/null @@ -1,15 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], - rules: { - // `ccxt` library uses lower-case constructors - // - // ```js - // const exchange = pro.okx(); - // ``` - // - // Disable it for current repo. - "new-cap": "off", - }, -}; diff --git a/packages/exchanges/eslint.config.js b/packages/exchanges/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/exchanges/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/exchanges/package.json b/packages/exchanges/package.json index 50e34412..c16a9cca 100644 --- a/packages/exchanges/package.json +++ b/packages/exchanges/package.json @@ -2,6 +2,7 @@ "name": "@opentrader/exchanges", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "exports": { @@ -11,18 +12,19 @@ "./dist": "./src/index.ts" }, "scripts": { - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/node": "^20.14.5", "eslint": "8.54.0", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/exchanges/src/cache.ts b/packages/exchanges/src/cache.ts index 6278edf0..a424deea 100644 --- a/packages/exchanges/src/cache.ts +++ b/packages/exchanges/src/cache.ts @@ -1,5 +1,5 @@ -import type { ICacheProvider } from "./types/cache/cache-provider.interface"; -import { MemoryCacheProvider } from "./client/cache/providers/memory-cache.provider"; +import type { ICacheProvider } from "./types/cache/cache-provider.interface.js"; +import { MemoryCacheProvider } from "./client/cache/providers/memory-cache.provider.js"; type Cache = { cacheProvider: ICacheProvider; diff --git a/packages/exchanges/src/client/cache/providers/memory-cache.provider.ts b/packages/exchanges/src/client/cache/providers/memory-cache.provider.ts index 04f57f84..d9df828c 100644 --- a/packages/exchanges/src/client/cache/providers/memory-cache.provider.ts +++ b/packages/exchanges/src/client/cache/providers/memory-cache.provider.ts @@ -17,7 +17,7 @@ */ import type { Dictionary, Exchange, Market } from "ccxt"; import type { ExchangeCode } from "@opentrader/types"; -import type { ICacheProvider } from "../../../types/cache/cache-provider.interface"; +import type { ICacheProvider } from "../../../types/cache/cache-provider.interface.js"; export class MemoryCacheProvider implements ICacheProvider { /** diff --git a/packages/exchanges/src/exchange.provider.ts b/packages/exchanges/src/exchange.provider.ts index 722f2899..7941a3bc 100644 --- a/packages/exchanges/src/exchange.provider.ts +++ b/packages/exchanges/src/exchange.provider.ts @@ -17,8 +17,8 @@ */ import type { ExchangeAccountWithCredentials } from "@opentrader/db"; import type { ExchangeCode } from "@opentrader/types"; -import { exchanges } from "./exchanges"; -import type { IExchange } from "./types"; +import { exchanges } from "./exchanges/index.js"; +import type { IExchange } from "./types/index.js"; type ExchangeAccountId = number; diff --git a/packages/exchanges/src/exchanges/ccxt/exchange.ts b/packages/exchanges/src/exchanges/ccxt/exchange.ts index 0e471145..eeb3fe4f 100644 --- a/packages/exchanges/src/exchanges/ccxt/exchange.ts +++ b/packages/exchanges/src/exchanges/ccxt/exchange.ts @@ -44,11 +44,11 @@ import type { } from "@opentrader/types"; import { pro } from "ccxt"; import type { Dictionary, Market, Exchange } from "ccxt"; -import type { IExchange, IExchangeCredentials } from "../../types"; -import { cache } from "../../cache"; -import { fetcher } from "../../utils/next/fetcher"; -import { normalize } from "./normalize"; -import { exchangeCodeMapCCXT } from "./constants"; +import type { IExchange, IExchangeCredentials } from "../../types/index.js"; +import { cache } from "../../cache.js"; +import { fetcher } from "../../utils/next/fetcher.js"; +import { normalize } from "./normalize.js"; +import { exchangeCodeMapCCXT } from "./constants.js"; export class CCXTExchange implements IExchange { public exchangeCode: ExchangeCode; diff --git a/packages/exchanges/src/exchanges/ccxt/factory.ts b/packages/exchanges/src/exchanges/ccxt/factory.ts index 20623801..9b9406bf 100644 --- a/packages/exchanges/src/exchanges/ccxt/factory.ts +++ b/packages/exchanges/src/exchanges/ccxt/factory.ts @@ -1,6 +1,6 @@ import { ExchangeCode } from "@opentrader/types"; -import { CCXTExchange } from "./exchange"; -import type { IExchangeCredentials } from "../../types"; +import { CCXTExchange } from "./exchange.js"; +import type { IExchangeCredentials } from "../../types/index.js"; export function createExchange(exchangeCode: ExchangeCode) { return (credentials?: IExchangeCredentials) => diff --git a/packages/exchanges/src/exchanges/ccxt/normalize.ts b/packages/exchanges/src/exchanges/ccxt/normalize.ts index 3ec15899..c9a87a8b 100644 --- a/packages/exchanges/src/exchanges/ccxt/normalize.ts +++ b/packages/exchanges/src/exchanges/ccxt/normalize.ts @@ -1,7 +1,7 @@ import { composeSymbolIdFromPair, getExponentAbs } from "@opentrader/tools"; -import type { Normalize } from "../../types/normalize.interface"; -import { normalizeOrderStatus } from "../../utils/normalizeOrderStatus"; import { OrderSide } from "@opentrader/types"; +import type { Normalize } from "../../types/normalize.interface.js"; +import { normalizeOrderStatus } from "../../utils/normalizeOrderStatus.js"; const accountAssets: Normalize["accountAssets"] = { response: (data) => diff --git a/packages/exchanges/src/exchanges/index.ts b/packages/exchanges/src/exchanges/index.ts index c442aa4c..41e81d8e 100644 --- a/packages/exchanges/src/exchanges/index.ts +++ b/packages/exchanges/src/exchanges/index.ts @@ -1,6 +1,6 @@ import { ExchangeCode } from "@opentrader/types"; -import { createExchange } from "./ccxt/factory"; -import { exchangeCodeMapCCXT } from "./ccxt/constants"; +import { createExchange } from "./ccxt/factory.js"; +import { exchangeCodeMapCCXT } from "./ccxt/constants.js"; export const exchanges: Record< ExchangeCode, diff --git a/packages/exchanges/src/index.ts b/packages/exchanges/src/index.ts index 567a44c5..b091851e 100644 --- a/packages/exchanges/src/index.ts +++ b/packages/exchanges/src/index.ts @@ -15,7 +15,7 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * from "./exchanges"; -export * from "./types"; -export * from "./cache"; -export * from "./exchange.provider"; +export * from "./exchanges/index.js"; +export * from "./types/index.js"; +export * from "./cache.js"; +export * from "./exchange.provider.js"; diff --git a/packages/exchanges/src/server/cache/providers/prisma-cache.provider.ts b/packages/exchanges/src/server/cache/providers/prisma-cache.provider.ts index 105870a8..a2f01f9e 100644 --- a/packages/exchanges/src/server/cache/providers/prisma-cache.provider.ts +++ b/packages/exchanges/src/server/cache/providers/prisma-cache.provider.ts @@ -2,7 +2,7 @@ import type { Dictionary, Exchange, Market } from "ccxt"; import type { ExchangeCode } from "@opentrader/types"; import type { Prisma } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; -import type { ICacheProvider } from "../../../types/cache/cache-provider.interface"; +import type { ICacheProvider } from "../../../types/cache/cache-provider.interface.js"; export class PrismaCacheProvider implements ICacheProvider { async getMarkets(exchangeCode: ExchangeCode, ccxtExchange: Exchange) { diff --git a/packages/exchanges/src/types/index.ts b/packages/exchanges/src/types/index.ts index c2a0937d..1a46af48 100644 --- a/packages/exchanges/src/types/index.ts +++ b/packages/exchanges/src/types/index.ts @@ -1,2 +1,2 @@ -export * from "./exchange.interface"; -export * from "./exchange-credentials.interface"; +export * from "./exchange.interface.js"; +export * from "./exchange-credentials.interface.js"; diff --git a/packages/exchanges/src/utils/next/fetcher.ts b/packages/exchanges/src/utils/next/fetcher.ts index 56f94cc9..88dd82c5 100644 --- a/packages/exchanges/src/utils/next/fetcher.ts +++ b/packages/exchanges/src/utils/next/fetcher.ts @@ -4,5 +4,6 @@ type FetchParams = Parameters; export const fetcher = (input: FetchParams[0], init?: FetchParams[1]) => fetch(input, { ...init, + // @ts-ignore-next-line `no-cache` is not in the FetchInit type, it's Next.js specific feature cache: "no-cache", }); diff --git a/packages/exchanges/tsconfig.json b/packages/exchanges/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/exchanges/tsconfig.json +++ b/packages/exchanges/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/exchanges/tsup.config.ts b/packages/exchanges/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/exchanges/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From 23751bccfdb77e22cd3ed1efd9d4b7553d00cb52 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 01:43:13 +0100 Subject: [PATCH 18/68] chore(packages/indicators): convert to ESM --- packages/indicators/.eslintrc.js | 6 ------ packages/indicators/eslint.config.js | 10 ++++++++++ packages/indicators/package.json | 10 ++++++---- packages/indicators/src/index.ts | 2 +- packages/indicators/src/indicators/index.ts | 2 +- packages/indicators/src/indicators/rsi.spec.ts | 2 +- packages/indicators/src/indicators/rsi.ts | 2 +- packages/indicators/src/typings/talib.d.ts | 10 ---------- packages/indicators/tsconfig.json | 5 ++--- packages/indicators/tsup.config.ts | 8 ++++++++ 10 files changed, 30 insertions(+), 27 deletions(-) delete mode 100644 packages/indicators/.eslintrc.js create mode 100644 packages/indicators/eslint.config.js delete mode 100644 packages/indicators/src/typings/talib.d.ts create mode 100644 packages/indicators/tsup.config.ts diff --git a/packages/indicators/.eslintrc.js b/packages/indicators/.eslintrc.js deleted file mode 100644 index e1a1e2f0..00000000 --- a/packages/indicators/.eslintrc.js +++ /dev/null @@ -1,6 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], - rules: {}, -}; diff --git a/packages/indicators/eslint.config.js b/packages/indicators/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/indicators/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/indicators/package.json b/packages/indicators/package.json index 290a5045..039f030c 100644 --- a/packages/indicators/package.json +++ b/packages/indicators/package.json @@ -2,19 +2,20 @@ "name": "@opentrader/indicators", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "test": "jest", - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", - "lint:fix": "eslint . --fix" + "lint:fix": "eslint . --fix", + "test": "jest" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { "@jest/globals": "^29.7.0", - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/jest": "^29.5.12", @@ -23,6 +24,7 @@ "jest": "^29.7.0", "ts-jest": "^29.1.5", "ts-node": "10.9.2", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/indicators/src/index.ts b/packages/indicators/src/index.ts index c3f87233..3f74465d 100644 --- a/packages/indicators/src/index.ts +++ b/packages/indicators/src/index.ts @@ -1 +1 @@ -export * from "./indicators"; +export * from "./indicators/index.js"; diff --git a/packages/indicators/src/indicators/index.ts b/packages/indicators/src/indicators/index.ts index e0b5fa4d..5432dd5a 100644 --- a/packages/indicators/src/indicators/index.ts +++ b/packages/indicators/src/indicators/index.ts @@ -1 +1 @@ -export * from "./rsi"; +export * from "./rsi.js"; diff --git a/packages/indicators/src/indicators/rsi.spec.ts b/packages/indicators/src/indicators/rsi.spec.ts index 9d84fb4e..de911417 100644 --- a/packages/indicators/src/indicators/rsi.spec.ts +++ b/packages/indicators/src/indicators/rsi.spec.ts @@ -2,7 +2,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import type { ICandlestick } from "@opentrader/types"; -import { rsi } from "./rsi"; +import { rsi } from "./rsi.js"; const loadCandles = (filename: string): ICandlestick[] => { return JSON.parse( diff --git a/packages/indicators/src/indicators/rsi.ts b/packages/indicators/src/indicators/rsi.ts index 70315bac..01a580bd 100644 --- a/packages/indicators/src/indicators/rsi.ts +++ b/packages/indicators/src/indicators/rsi.ts @@ -17,7 +17,7 @@ */ import type { ICandlestick } from "@opentrader/types"; import { RSI } from "technicalindicators"; -import { IndicatorError } from "../utils/indicator.error"; +import { IndicatorError } from "../utils/indicator.error.js"; type RsiParams = { periods: number; diff --git a/packages/indicators/src/typings/talib.d.ts b/packages/indicators/src/typings/talib.d.ts deleted file mode 100644 index ea0d67b2..00000000 --- a/packages/indicators/src/typings/talib.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare module "talib" { - const talib: { - execute: ( - options: any, - callback: (err: Error, result: any) => void, - ) => void; - }; - - export default talib; -} diff --git a/packages/indicators/tsconfig.json b/packages/indicators/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/indicators/tsconfig.json +++ b/packages/indicators/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/indicators/tsup.config.ts b/packages/indicators/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/indicators/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From db0f8aa91cd48ea2e6d9c7d4068572513df8a198 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 01:46:24 +0100 Subject: [PATCH 19/68] chore(packages/logger): convert to ESM --- packages/logger/.eslintrc.js | 6 ------ packages/logger/eslint.config.js | 10 ++++++++++ packages/logger/package.json | 6 ++++-- packages/logger/src/index.ts | 4 ++-- packages/logger/src/logger.ts | 2 +- packages/logger/tsconfig.json | 5 ++--- packages/logger/tsup.config.ts | 8 ++++++++ 7 files changed, 27 insertions(+), 14 deletions(-) delete mode 100644 packages/logger/.eslintrc.js create mode 100644 packages/logger/eslint.config.js create mode 100644 packages/logger/tsup.config.ts diff --git a/packages/logger/.eslintrc.js b/packages/logger/.eslintrc.js deleted file mode 100644 index 08420086..00000000 --- a/packages/logger/.eslintrc.js +++ /dev/null @@ -1,6 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], - rules: {} -}; diff --git a/packages/logger/eslint.config.js b/packages/logger/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/logger/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/logger/package.json b/packages/logger/package.json index c1c9a66b..21cfe751 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -2,22 +2,24 @@ "name": "@opentrader/logger", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/node": "^20.14.5", "eslint": "8.54.0", "ts-node": "10.9.2", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index 4621da56..21705c35 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -15,5 +15,5 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * as format from "./formatters"; -export { logger } from "./logger"; +export * as format from "./formatters.js"; +export { logger } from "./logger.js"; diff --git a/packages/logger/src/logger.ts b/packages/logger/src/logger.ts index 15b94e02..6ed6cd98 100644 --- a/packages/logger/src/logger.ts +++ b/packages/logger/src/logger.ts @@ -1,4 +1,4 @@ -import pino from "pino"; +import { pino } from "pino"; const logFile = process.env.LOG_FILE; diff --git a/packages/logger/tsconfig.json b/packages/logger/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/logger/tsconfig.json +++ b/packages/logger/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/logger/tsup.config.ts b/packages/logger/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/logger/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From fc917e06a1d6ff1e21d82a8a604c557a9fdf9942 Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 01:56:58 +0100 Subject: [PATCH 20/68] chore(packages/processing): convert to ESM --- packages/processing/.eslintrc.js | 5 ----- packages/processing/eslint.config.js | 10 ++++++++++ packages/processing/package.json | 8 +++++--- packages/processing/src/bot/bot-store-adapter.ts | 4 ++-- packages/processing/src/bot/bot.processing.ts | 4 ++-- packages/processing/src/bot/index.ts | 2 +- packages/processing/src/bot/utils/index.ts | 9 +++++---- .../processing/src/bot/utils/order-status/index.ts | 2 -- packages/processing/src/bot/utils/order/index.ts | 1 - .../src/bot/utils/{order => }/toPrismaOrder.ts | 2 +- .../utils/{order-status => }/toPrismaOrderStatus.ts | 0 .../processing/src/bot/utils/toPrismaSmartTrade.ts | 2 +- .../utils/{order-status => }/toProcessorOrderStatus.ts | 0 .../src/bot/utils/toSmartTradeIteratorResult.ts | 2 +- .../src/exchange-account/exchange-account.processor.ts | 2 +- packages/processing/src/exchange-account/index.ts | 4 ++-- packages/processing/src/executors/index.ts | 2 +- .../src/executors/order/order-executor.spec.ts | 4 ++-- .../processing/src/executors/smart-trade.executor.ts | 4 ++-- .../src/executors/trade/trade-executor.spec.ts | 4 ++-- .../processing/src/executors/trade/trade.executor.ts | 4 ++-- packages/processing/src/index.ts | 8 ++++---- packages/processing/src/smart-trade/index.ts | 2 +- packages/processing/src/utils/index.ts | 2 +- packages/processing/tsconfig.json | 5 ++--- packages/processing/tsup.config.ts | 8 ++++++++ 26 files changed, 56 insertions(+), 44 deletions(-) delete mode 100644 packages/processing/.eslintrc.js create mode 100644 packages/processing/eslint.config.js delete mode 100644 packages/processing/src/bot/utils/order-status/index.ts delete mode 100644 packages/processing/src/bot/utils/order/index.ts rename packages/processing/src/bot/utils/{order => }/toPrismaOrder.ts (93%) rename packages/processing/src/bot/utils/{order-status => }/toPrismaOrderStatus.ts (100%) rename packages/processing/src/bot/utils/{order-status => }/toProcessorOrderStatus.ts (100%) create mode 100644 packages/processing/tsup.config.ts diff --git a/packages/processing/.eslintrc.js b/packages/processing/.eslintrc.js deleted file mode 100644 index 097111f4..00000000 --- a/packages/processing/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], -}; diff --git a/packages/processing/eslint.config.js b/packages/processing/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/processing/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/processing/package.json b/packages/processing/package.json index 2dc5a199..4a27d2a1 100644 --- a/packages/processing/package.json +++ b/packages/processing/package.json @@ -2,13 +2,14 @@ "name": "@opentrader/processing", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "test": "jest", - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", - "lint:fix": "eslint . --fix" + "lint:fix": "eslint . --fix", + "test": "jest" }, "author": "bludnic", "license": "Apache-2.0", @@ -22,6 +23,7 @@ "eslint": "8.54.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/processing/src/bot/bot-store-adapter.ts b/packages/processing/src/bot/bot-store-adapter.ts index 88923e82..cf7aa476 100644 --- a/packages/processing/src/bot/bot-store-adapter.ts +++ b/packages/processing/src/bot/bot-store-adapter.ts @@ -6,8 +6,8 @@ import type { import { xprisma, toSmartTradeEntity } from "@opentrader/db"; import { exchangeProvider } from "@opentrader/exchanges"; import { logger } from "@opentrader/logger"; -import { SmartTradeExecutor } from "../executors"; -import { toPrismaSmartTrade, toSmartTradeIteratorResult } from "./utils"; +import { SmartTradeExecutor } from "../executors/index.js"; +import { toPrismaSmartTrade, toSmartTradeIteratorResult } from "./utils/index.js"; export class BotStoreAdapter implements IStore { constructor(private stopBotFn: (botId: number) => Promise) {} diff --git a/packages/processing/src/bot/bot.processing.ts b/packages/processing/src/bot/bot.processing.ts index adc78d60..939228b2 100644 --- a/packages/processing/src/bot/bot.processing.ts +++ b/packages/processing/src/bot/bot.processing.ts @@ -9,8 +9,8 @@ import { exchangeProvider } from "@opentrader/exchanges"; import type { TBot } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; -import { SmartTradeExecutor } from "../executors"; -import { BotStoreAdapter } from "./bot-store-adapter"; +import { SmartTradeExecutor } from "../executors/index.js"; +import { BotStoreAdapter } from "./bot-store-adapter.js"; export class BotProcessing { constructor(private bot: TBot) {} diff --git a/packages/processing/src/bot/index.ts b/packages/processing/src/bot/index.ts index 38c7d295..6785b9ee 100644 --- a/packages/processing/src/bot/index.ts +++ b/packages/processing/src/bot/index.ts @@ -1 +1 @@ -export * from "./bot.processing"; +export * from "./bot.processing.js"; diff --git a/packages/processing/src/bot/utils/index.ts b/packages/processing/src/bot/utils/index.ts index f59afc3a..0b22a838 100644 --- a/packages/processing/src/bot/utils/index.ts +++ b/packages/processing/src/bot/utils/index.ts @@ -1,4 +1,5 @@ -export * from "./toSmartTradeIteratorResult"; -export * from "./toPrismaSmartTrade"; -export * from "./order-status"; -export * from "./order"; +export * from "./toPrismaOrder.js"; +export * from "./toPrismaOrderStatus.js"; +export * from "./toProcessorOrderStatus.js"; +export * from "./toSmartTradeIteratorResult.js"; +export * from "./toPrismaSmartTrade.js"; diff --git a/packages/processing/src/bot/utils/order-status/index.ts b/packages/processing/src/bot/utils/order-status/index.ts deleted file mode 100644 index 6f5e9c51..00000000 --- a/packages/processing/src/bot/utils/order-status/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./toPrismaOrderStatus"; -export * from "./toProcessorOrderStatus"; diff --git a/packages/processing/src/bot/utils/order/index.ts b/packages/processing/src/bot/utils/order/index.ts deleted file mode 100644 index 4a528c9e..00000000 --- a/packages/processing/src/bot/utils/order/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./toPrismaOrder"; diff --git a/packages/processing/src/bot/utils/order/toPrismaOrder.ts b/packages/processing/src/bot/utils/toPrismaOrder.ts similarity index 93% rename from packages/processing/src/bot/utils/order/toPrismaOrder.ts rename to packages/processing/src/bot/utils/toPrismaOrder.ts index a559ee7e..34fa7ce1 100644 --- a/packages/processing/src/bot/utils/order/toPrismaOrder.ts +++ b/packages/processing/src/bot/utils/toPrismaOrder.ts @@ -1,6 +1,6 @@ import type { $Enums, Prisma } from "@opentrader/db"; import { OrderStatusEnum, OrderType } from "@opentrader/types"; -import { toPrismaOrderStatus } from "../order-status"; +import { toPrismaOrderStatus } from "./toPrismaOrderStatus.js"; export function toPrismaOrder( order: { diff --git a/packages/processing/src/bot/utils/order-status/toPrismaOrderStatus.ts b/packages/processing/src/bot/utils/toPrismaOrderStatus.ts similarity index 100% rename from packages/processing/src/bot/utils/order-status/toPrismaOrderStatus.ts rename to packages/processing/src/bot/utils/toPrismaOrderStatus.ts diff --git a/packages/processing/src/bot/utils/toPrismaSmartTrade.ts b/packages/processing/src/bot/utils/toPrismaSmartTrade.ts index e489ae3c..12edaddb 100644 --- a/packages/processing/src/bot/utils/toPrismaSmartTrade.ts +++ b/packages/processing/src/bot/utils/toPrismaSmartTrade.ts @@ -1,7 +1,7 @@ import type { UseSmartTradePayload } from "@opentrader/bot-processor"; import type { Prisma } from "@opentrader/db"; import { $Enums } from "@opentrader/db"; -import { toPrismaOrder } from "./order"; +import { toPrismaOrder } from "./toPrismaOrder.js"; /** * Convert `SmartTrade` iterator result into `ISmartTrade` entity diff --git a/packages/processing/src/bot/utils/order-status/toProcessorOrderStatus.ts b/packages/processing/src/bot/utils/toProcessorOrderStatus.ts similarity index 100% rename from packages/processing/src/bot/utils/order-status/toProcessorOrderStatus.ts rename to packages/processing/src/bot/utils/toProcessorOrderStatus.ts diff --git a/packages/processing/src/bot/utils/toSmartTradeIteratorResult.ts b/packages/processing/src/bot/utils/toSmartTradeIteratorResult.ts index 1ad42c9a..f7a9445b 100644 --- a/packages/processing/src/bot/utils/toSmartTradeIteratorResult.ts +++ b/packages/processing/src/bot/utils/toSmartTradeIteratorResult.ts @@ -1,6 +1,6 @@ import type { SmartTrade as ProcessorSmartTrade } from "@opentrader/bot-processor"; import type { SmartTradeEntity } from "@opentrader/db"; -import { toProcessorOrderStatus } from "./order-status"; +import { toProcessorOrderStatus } from "./toProcessorOrderStatus.js"; /** * Convert `ISmartTrade` entity into `SmartTrade` iterator result diff --git a/packages/processing/src/exchange-account/exchange-account.processor.ts b/packages/processing/src/exchange-account/exchange-account.processor.ts index e5aa3524..302b8ec9 100644 --- a/packages/processing/src/exchange-account/exchange-account.processor.ts +++ b/packages/processing/src/exchange-account/exchange-account.processor.ts @@ -8,7 +8,7 @@ import { xprisma } from "@opentrader/db"; import { exchangeProvider, type IExchange } from "@opentrader/exchanges"; import type { IGetLimitOrderResponse } from "@opentrader/types"; import { logger } from "@opentrader/logger"; -import { toDbStatus } from "../utils"; +import { toDbStatus } from "../utils/index.js"; type SymbolId = string; diff --git a/packages/processing/src/exchange-account/index.ts b/packages/processing/src/exchange-account/index.ts index cd0efe34..29b4f005 100644 --- a/packages/processing/src/exchange-account/index.ts +++ b/packages/processing/src/exchange-account/index.ts @@ -1,2 +1,2 @@ -export * from "./orders.synchronizer"; -export * from "./exchange-account.processor"; +export * from "./orders.synchronizer.js"; +export * from "./exchange-account.processor.js"; diff --git a/packages/processing/src/executors/index.ts b/packages/processing/src/executors/index.ts index 75d15734..906685ea 100644 --- a/packages/processing/src/executors/index.ts +++ b/packages/processing/src/executors/index.ts @@ -1 +1 @@ -export * from "./smart-trade.executor"; +export * from "./smart-trade.executor.js"; diff --git a/packages/processing/src/executors/order/order-executor.spec.ts b/packages/processing/src/executors/order/order-executor.spec.ts index f889d833..7fa3945d 100644 --- a/packages/processing/src/executors/order/order-executor.spec.ts +++ b/packages/processing/src/executors/order/order-executor.spec.ts @@ -5,8 +5,8 @@ import { } from "@opentrader/db"; import { exchangeProvider, IExchange } from "@opentrader/exchanges"; import { Order } from "@opentrader/db"; -import { OrderExecutor } from "./order.executor"; -import { createTrade, getExchangeAccount } from "../../utils/test"; +import { OrderExecutor } from "./order.executor.js"; +import { createTrade, getExchangeAccount } from "../../utils/test.js"; describe("OrderExecutor", () => { let exchangeAccount: ExchangeAccountWithCredentials; diff --git a/packages/processing/src/executors/smart-trade.executor.ts b/packages/processing/src/executors/smart-trade.executor.ts index 860a7d6b..f5fe2c30 100644 --- a/packages/processing/src/executors/smart-trade.executor.ts +++ b/packages/processing/src/executors/smart-trade.executor.ts @@ -4,8 +4,8 @@ import type { } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; import { exchangeProvider } from "@opentrader/exchanges"; -import type { ISmartTradeExecutor } from "./smart-trade-executor.interface"; -import { TradeExecutor } from "./trade/trade.executor"; +import type { ISmartTradeExecutor } from "./smart-trade-executor.interface.js"; +import { TradeExecutor } from "./trade/trade.executor.js"; /** * Combine all type of SmartTrades into one executor. diff --git a/packages/processing/src/executors/trade/trade-executor.spec.ts b/packages/processing/src/executors/trade/trade-executor.spec.ts index 182e8964..4100ed30 100644 --- a/packages/processing/src/executors/trade/trade-executor.spec.ts +++ b/packages/processing/src/executors/trade/trade-executor.spec.ts @@ -4,12 +4,12 @@ import { xprisma, } from "@opentrader/db"; import { exchangeProvider, IExchange } from "@opentrader/exchanges"; -import { TradeExecutor } from "./trade.executor"; +import { TradeExecutor } from "./trade.executor.js"; import { createTrade, getExchangeAccount, updateEntryOrder, -} from "../../utils/test"; +} from "../../utils/test.js"; describe("TradeExecutor", () => { let exchangeAccount: ExchangeAccountWithCredentials; diff --git a/packages/processing/src/executors/trade/trade.executor.ts b/packages/processing/src/executors/trade/trade.executor.ts index 5278b8cf..a9b0fcac 100644 --- a/packages/processing/src/executors/trade/trade.executor.ts +++ b/packages/processing/src/executors/trade/trade.executor.ts @@ -6,8 +6,8 @@ import type { import type { IExchange } from "@opentrader/exchanges"; import { exchangeProvider } from "@opentrader/exchanges"; import { logger } from "@opentrader/logger"; -import type { ISmartTradeExecutor } from "../smart-trade-executor.interface"; -import { OrderExecutor } from "../order/order.executor"; +import type { ISmartTradeExecutor } from "../smart-trade-executor.interface.js"; +import { OrderExecutor } from "../order/order.executor.js"; export class TradeExecutor implements ISmartTradeExecutor { smartTrade: SmartTradeWithOrders; diff --git a/packages/processing/src/index.ts b/packages/processing/src/index.ts index e4c30d84..9ccf0f57 100644 --- a/packages/processing/src/index.ts +++ b/packages/processing/src/index.ts @@ -1,4 +1,4 @@ -export * from "./bot"; -export * from "./smart-trade"; -export * from "./exchange-account"; -export * from "./executors"; +export * from "./bot/index.js"; +export * from "./smart-trade/index.js"; +export * from "./exchange-account/index.js"; +export * from "./executors/index.js"; diff --git a/packages/processing/src/smart-trade/index.ts b/packages/processing/src/smart-trade/index.ts index 525af385..5a9a9135 100644 --- a/packages/processing/src/smart-trade/index.ts +++ b/packages/processing/src/smart-trade/index.ts @@ -1 +1 @@ -export * from "./smart-trade.synchronizer"; +export * from "./smart-trade.synchronizer.js"; diff --git a/packages/processing/src/utils/index.ts b/packages/processing/src/utils/index.ts index 58533170..9622f7c1 100644 --- a/packages/processing/src/utils/index.ts +++ b/packages/processing/src/utils/index.ts @@ -1 +1 @@ -export * from "./toDbStatus"; +export * from "./toDbStatus.js"; diff --git a/packages/processing/tsconfig.json b/packages/processing/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/processing/tsconfig.json +++ b/packages/processing/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/processing/tsup.config.ts b/packages/processing/tsup.config.ts new file mode 100644 index 00000000..14b62e47 --- /dev/null +++ b/packages/processing/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: true, + clean: true, + format: ["cjs"], +}); From d768b54dc4e6b2dc0424b97a15115604164644af Mon Sep 17 00:00:00 2001 From: bludnic Date: Thu, 20 Jun 2024 02:15:21 +0100 Subject: [PATCH 21/68] chore(packages/trpc): convert to ESM --- packages/trpc/.eslintrc.js | 5 -- packages/trpc/eslint.config.js | 10 +++ packages/trpc/package.json | 7 ++- .../trpc/src/common/middlewares/isLoggedIn.ts | 2 +- packages/trpc/src/index.ts | 6 +- packages/trpc/src/procedures.ts | 4 +- packages/trpc/src/routers/appRouter.ts | 6 +- .../routers/private/bot/create-bot/handler.ts | 6 +- .../bot/cron-place-pending-orders/handler.ts | 4 +- .../routers/private/bot/delete-bot/handler.ts | 6 +- .../bot/get-active-smart-trades/handler.ts | 4 +- .../routers/private/bot/get-bot/handler.ts | 4 +- .../routers/private/bot/get-bots/handler.ts | 2 +- .../bot/get-completed-smart-trades/handler.ts | 4 +- .../bot/get-open-smart-trades/handler.ts | 4 +- .../routers/private/bot/get-orders/handler.ts | 4 +- .../bot/get-pending-smart-trades/handler.ts | 4 +- .../private/bot/manual-process/handler.ts | 6 +- .../trpc/src/routers/private/bot/router.ts | 62 +++++++++---------- .../private/bot/run-template/handler.ts | 6 +- .../routers/private/bot/start-bot/handler.ts | 8 +-- .../routers/private/bot/stop-bot/handler.ts | 6 +- .../private/bot/sync-orders/handler.ts | 4 +- .../routers/private/bot/update-bot/handler.ts | 4 +- .../trpc/src/routers/private/cron/router.ts | 6 +- .../cron/sync-closed-orders/handler.ts | 2 +- .../create-account/handler.ts | 6 +- .../exchange-accounts/get-account/handler.ts | 4 +- .../exchange-accounts/get-accounts/handler.ts | 2 +- .../private/exchange-accounts/router.ts | 18 +++--- .../update-account/handler.ts | 4 +- .../private/grid-bot/create-bot/handler.ts | 4 +- .../private/grid-bot/get-bot/handler.ts | 4 +- .../private/grid-bot/get-bots/handler.ts | 2 +- .../grid-bot/get-form-options/handler.ts | 4 +- .../src/routers/private/grid-bot/router.ts | 22 +++---- .../private/grid-bot/update-bot/handler.ts | 4 +- packages/trpc/src/routers/private/index.ts | 6 -- packages/trpc/src/routers/private/router.ts | 6 ++ .../smart-trade/get-smart-trade/handler.ts | 4 +- .../smart-trade/get-smart-trades/handler.ts | 4 +- .../src/routers/private/smart-trade/router.ts | 12 ++-- .../symbols/get-symbol-price/handler.ts | 4 +- .../private/symbols/get-symbol/handler.ts | 4 +- .../private/symbols/get-symbols/handler.ts | 4 +- .../src/routers/private/symbols/router.ts | 16 ++--- .../src/routers/public/healthcheck/handler.ts | 2 +- packages/trpc/src/routers/public/index.ts | 1 - packages/trpc/src/routers/public/router.ts | 6 +- packages/trpc/src/trpc.ts | 2 +- packages/trpc/tsconfig.json | 5 +- packages/trpc/tsup.config.ts | 8 +++ 52 files changed, 179 insertions(+), 165 deletions(-) delete mode 100644 packages/trpc/.eslintrc.js create mode 100644 packages/trpc/eslint.config.js delete mode 100644 packages/trpc/src/routers/private/index.ts create mode 100644 packages/trpc/src/routers/private/router.ts delete mode 100644 packages/trpc/src/routers/public/index.ts create mode 100644 packages/trpc/tsup.config.ts diff --git a/packages/trpc/.eslintrc.js b/packages/trpc/.eslintrc.js deleted file mode 100644 index 097111f4..00000000 --- a/packages/trpc/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], -}; diff --git a/packages/trpc/eslint.config.js b/packages/trpc/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/trpc/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/trpc/package.json b/packages/trpc/package.json index e32fd5c2..a08b8ccc 100644 --- a/packages/trpc/package.json +++ b/packages/trpc/package.json @@ -2,20 +2,23 @@ "name": "@opentrader/trpc", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsc", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", + "@types/node": "^20.14.5", "eslint": "8.54.0", + "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/trpc/src/common/middlewares/isLoggedIn.ts b/packages/trpc/src/common/middlewares/isLoggedIn.ts index f6b0b6db..1e31bec1 100644 --- a/packages/trpc/src/common/middlewares/isLoggedIn.ts +++ b/packages/trpc/src/common/middlewares/isLoggedIn.ts @@ -1,5 +1,5 @@ import { TRPCError } from "@trpc/server"; -import { middleware } from "../../trpc"; +import { middleware } from "../../trpc.js"; export const isLoggedIn = middleware(({ next, ctx }) => { if (!ctx.user) { diff --git a/packages/trpc/src/index.ts b/packages/trpc/src/index.ts index 52ca2849..ddaa5b7d 100644 --- a/packages/trpc/src/index.ts +++ b/packages/trpc/src/index.ts @@ -15,6 +15,6 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export { type AppRouter, appRouter } from "./routers/appRouter"; -export { createContext } from "./utils/context"; -export { eventBus, EVENT } from "./event-bus"; +export { type AppRouter, appRouter } from "./routers/appRouter.js"; +export { createContext } from "./utils/context.js"; +export { eventBus, EVENT } from "./event-bus.js"; diff --git a/packages/trpc/src/procedures.ts b/packages/trpc/src/procedures.ts index b920d552..3f698b95 100644 --- a/packages/trpc/src/procedures.ts +++ b/packages/trpc/src/procedures.ts @@ -1,5 +1,5 @@ -import { trpc } from "./trpc"; -import { isLoggedIn } from "./common/middlewares/isLoggedIn"; +import { trpc } from "./trpc.js"; +import { isLoggedIn } from "./common/middlewares/isLoggedIn.js"; export const publicProcedure = trpc.procedure; export const authorizedProcedure = publicProcedure.use(isLoggedIn); diff --git a/packages/trpc/src/routers/appRouter.ts b/packages/trpc/src/routers/appRouter.ts index 99321b84..5e200f3b 100644 --- a/packages/trpc/src/routers/appRouter.ts +++ b/packages/trpc/src/routers/appRouter.ts @@ -1,4 +1,4 @@ -import { trpc } from "../trpc"; // @todo relative path +import { trpc } from "../trpc.js"; import { botRouter, cronRouter, @@ -6,8 +6,8 @@ import { gridBotRouter, smartTradeRouter, symbolsRouter, -} from "./private"; -import { publicRouter } from "./public"; +} from "./private/router.js"; +import { publicRouter } from "./public/router.js"; export const appRouter = trpc.router({ exchangeAccount: exchangeAccountsRouter, diff --git a/packages/trpc/src/routers/private/bot/create-bot/handler.ts b/packages/trpc/src/routers/private/bot/create-bot/handler.ts index 2f74f4f9..c8fc64a0 100644 --- a/packages/trpc/src/routers/private/bot/create-bot/handler.ts +++ b/packages/trpc/src/routers/private/bot/create-bot/handler.ts @@ -1,9 +1,9 @@ import { findStrategy } from "@opentrader/bot-templates/server"; import { TRPCError } from "@trpc/server"; import { xprisma } from "@opentrader/db"; -import { eventBus } from "../../../../event-bus"; -import type { Context } from "../../../../utils/context"; -import type { TCreateBotInputSchema } from "./schema"; +import { eventBus } from "../../../../event-bus.js"; +import type { Context } from "../../../../utils/context.js"; +import type { TCreateBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/cron-place-pending-orders/handler.ts b/packages/trpc/src/routers/private/bot/cron-place-pending-orders/handler.ts index efb5192c..e1beef9c 100644 --- a/packages/trpc/src/routers/private/bot/cron-place-pending-orders/handler.ts +++ b/packages/trpc/src/routers/private/bot/cron-place-pending-orders/handler.ts @@ -1,7 +1,7 @@ import { xprisma } from "@opentrader/db"; import { SmartTradeExecutor } from "@opentrader/processing"; -import type { Context } from "../../../../utils/context"; -import type { TCronPlacePendingOrdersInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TCronPlacePendingOrdersInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/delete-bot/handler.ts b/packages/trpc/src/routers/private/bot/delete-bot/handler.ts index cdb9f52e..8f82a684 100644 --- a/packages/trpc/src/routers/private/bot/delete-bot/handler.ts +++ b/packages/trpc/src/routers/private/bot/delete-bot/handler.ts @@ -1,7 +1,7 @@ import { xprisma } from "@opentrader/db"; -import { BotService } from "../../../../services/bot.service"; -import type { Context } from "../../../../utils/context"; -import type { TDeleteBotInputSchema } from "./schema"; +import { BotService } from "../../../../services/bot.service.js"; +import type { Context } from "../../../../utils/context.js"; +import type { TDeleteBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/get-active-smart-trades/handler.ts b/packages/trpc/src/routers/private/bot/get-active-smart-trades/handler.ts index c5643bf4..afa1cb40 100644 --- a/packages/trpc/src/routers/private/bot/get-active-smart-trades/handler.ts +++ b/packages/trpc/src/routers/private/bot/get-active-smart-trades/handler.ts @@ -1,7 +1,7 @@ import type { SmartTradeEntity_Order_Order } from "@opentrader/db"; import { toSmartTradeEntity, xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetActiveSmartTradesInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetActiveSmartTradesInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/get-bot/handler.ts b/packages/trpc/src/routers/private/bot/get-bot/handler.ts index 5ae8950e..85e4c78e 100644 --- a/packages/trpc/src/routers/private/bot/get-bot/handler.ts +++ b/packages/trpc/src/routers/private/bot/get-bot/handler.ts @@ -1,6 +1,6 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetBotInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/get-bots/handler.ts b/packages/trpc/src/routers/private/bot/get-bots/handler.ts index 44c2dbe1..7ce430e8 100644 --- a/packages/trpc/src/routers/private/bot/get-bots/handler.ts +++ b/packages/trpc/src/routers/private/bot/get-bots/handler.ts @@ -1,5 +1,5 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; +import type { Context } from "../../../../utils/context.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/get-completed-smart-trades/handler.ts b/packages/trpc/src/routers/private/bot/get-completed-smart-trades/handler.ts index 0fb3f209..3e04f42c 100644 --- a/packages/trpc/src/routers/private/bot/get-completed-smart-trades/handler.ts +++ b/packages/trpc/src/routers/private/bot/get-completed-smart-trades/handler.ts @@ -1,7 +1,7 @@ import type { SmartTradeEntity_Order_Order } from "@opentrader/db"; import { toSmartTradeEntity, xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetCompletedSmartTradesInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetCompletedSmartTradesInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/get-open-smart-trades/handler.ts b/packages/trpc/src/routers/private/bot/get-open-smart-trades/handler.ts index 6daef329..a29abadb 100644 --- a/packages/trpc/src/routers/private/bot/get-open-smart-trades/handler.ts +++ b/packages/trpc/src/routers/private/bot/get-open-smart-trades/handler.ts @@ -3,8 +3,8 @@ import type { SmartTradeEntity_Order_Order, } from "@opentrader/db"; import { toSmartTradeEntity, xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetOpenSmartTradesInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetOpenSmartTradesInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/get-orders/handler.ts b/packages/trpc/src/routers/private/bot/get-orders/handler.ts index d7584e92..4d2111a0 100644 --- a/packages/trpc/src/routers/private/bot/get-orders/handler.ts +++ b/packages/trpc/src/routers/private/bot/get-orders/handler.ts @@ -1,6 +1,6 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetGridBotOrdersInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetGridBotOrdersInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/get-pending-smart-trades/handler.ts b/packages/trpc/src/routers/private/bot/get-pending-smart-trades/handler.ts index f96af14e..b2acb77e 100644 --- a/packages/trpc/src/routers/private/bot/get-pending-smart-trades/handler.ts +++ b/packages/trpc/src/routers/private/bot/get-pending-smart-trades/handler.ts @@ -1,7 +1,7 @@ import type { SmartTradeEntity_Order_Order } from "@opentrader/db"; import { toSmartTradeEntity, xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetPendingSmartTradesInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetPendingSmartTradesInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/manual-process/handler.ts b/packages/trpc/src/routers/private/bot/manual-process/handler.ts index 8d3af50c..c3c8ec05 100644 --- a/packages/trpc/src/routers/private/bot/manual-process/handler.ts +++ b/packages/trpc/src/routers/private/bot/manual-process/handler.ts @@ -1,7 +1,7 @@ import { BotProcessing } from "@opentrader/processing"; -import { BotService } from "../../../../services/bot.service"; -import type { Context } from "../../../../utils/context"; -import type { TManualProcessGridBotInputSchema } from "./schema"; +import { BotService } from "../../../../services/bot.service.js"; +import type { Context } from "../../../../utils/context.js"; +import type { TManualProcessGridBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/router.ts b/packages/trpc/src/routers/private/bot/router.ts index 8ee69fed..bbc02436 100644 --- a/packages/trpc/src/routers/private/bot/router.ts +++ b/packages/trpc/src/routers/private/bot/router.ts @@ -1,34 +1,34 @@ -import { router } from "../../../trpc"; -import { authorizedProcedure } from "../../../procedures"; -import { getBots } from "./get-bots/handler"; -import { getBot } from "./get-bot/handler"; -import { ZGetBotInputSchema } from "./get-bot/schema"; -import { createBot } from "./create-bot/handler"; -import { ZCreateBotInputSchema } from "./create-bot/schema"; -import { deleteBot } from "./delete-bot/handler"; -import { ZDeleteBotInputSchema } from "./delete-bot/schema"; -import { updateBot } from "./update-bot/handler"; -import { ZUpdateBotInputSchema } from "./update-bot/schema"; -import { startGridBot } from "./start-bot/handler"; -import { ZStartGridBotInputSchema } from "./start-bot/schema"; -import { stopGridBot } from "./stop-bot/handler"; -import { ZStopGridBotInputSchema } from "./stop-bot/schema"; -import { manualProcessGridBot } from "./manual-process/handler"; -import { ZManualProcessGridBotInputSchema } from "./manual-process/schema"; -import { getActiveSmartTrades } from "./get-active-smart-trades/handler"; -import { ZGetActiveSmartTradesInputSchema } from "./get-active-smart-trades/schema"; -import { getOpenSmartTrades } from "./get-open-smart-trades/handler"; -import { ZGetOpenSmartTradesInputSchema } from "./get-open-smart-trades/schema"; -import { getPendingSmartTrades } from "./get-pending-smart-trades/handler"; -import { ZGetPendingSmartTradesInputSchema } from "./get-pending-smart-trades/schema"; -import { getCompletedSmartTrades } from "./get-completed-smart-trades/handler"; -import { ZGetCompletedSmartTradesInputSchema } from "./get-completed-smart-trades/schema"; -import { getGridBotOrders } from "./get-orders/handler"; -import { ZGetGridBotOrdersInputSchema } from "./get-orders/schema"; -import { cronPlacePendingOrders } from "./cron-place-pending-orders/handler"; -import { ZCronPlacePendingOrdersInputSchema } from "./cron-place-pending-orders/schema"; -import { syncOrders } from "./sync-orders/handler"; -import { ZSyncGridBotOrdersInputSchema } from "./sync-orders/schema"; +import { router } from "../../../trpc.js"; +import { authorizedProcedure } from "../../../procedures.js"; +import { getBots } from "./get-bots/handler.js"; +import { getBot } from "./get-bot/handler.js"; +import { ZGetBotInputSchema } from "./get-bot/schema.js"; +import { createBot } from "./create-bot/handler.js"; +import { ZCreateBotInputSchema } from "./create-bot/schema.js"; +import { deleteBot } from "./delete-bot/handler.js"; +import { ZDeleteBotInputSchema } from "./delete-bot/schema.js"; +import { updateBot } from "./update-bot/handler.js"; +import { ZUpdateBotInputSchema } from "./update-bot/schema.js"; +import { startGridBot } from "./start-bot/handler.js"; +import { ZStartGridBotInputSchema } from "./start-bot/schema.js"; +import { stopGridBot } from "./stop-bot/handler.js"; +import { ZStopGridBotInputSchema } from "./stop-bot/schema.js"; +import { manualProcessGridBot } from "./manual-process/handler.js"; +import { ZManualProcessGridBotInputSchema } from "./manual-process/schema.js"; +import { getActiveSmartTrades } from "./get-active-smart-trades/handler.js"; +import { ZGetActiveSmartTradesInputSchema } from "./get-active-smart-trades/schema.js"; +import { getOpenSmartTrades } from "./get-open-smart-trades/handler.js"; +import { ZGetOpenSmartTradesInputSchema } from "./get-open-smart-trades/schema.js"; +import { getPendingSmartTrades } from "./get-pending-smart-trades/handler.js"; +import { ZGetPendingSmartTradesInputSchema } from "./get-pending-smart-trades/schema.js"; +import { getCompletedSmartTrades } from "./get-completed-smart-trades/handler.js"; +import { ZGetCompletedSmartTradesInputSchema } from "./get-completed-smart-trades/schema.js"; +import { getGridBotOrders } from "./get-orders/handler.js"; +import { ZGetGridBotOrdersInputSchema } from "./get-orders/schema.js"; +import { cronPlacePendingOrders } from "./cron-place-pending-orders/handler.js"; +import { ZCronPlacePendingOrdersInputSchema } from "./cron-place-pending-orders/schema.js"; +import { syncOrders } from "./sync-orders/handler.js"; +import { ZSyncGridBotOrdersInputSchema } from "./sync-orders/schema.js"; export const botRouter = router({ list: authorizedProcedure.query(getBots), diff --git a/packages/trpc/src/routers/private/bot/run-template/handler.ts b/packages/trpc/src/routers/private/bot/run-template/handler.ts index 2ff56598..9fd071dc 100644 --- a/packages/trpc/src/routers/private/bot/run-template/handler.ts +++ b/packages/trpc/src/routers/private/bot/run-template/handler.ts @@ -1,7 +1,7 @@ import { BotProcessing } from "@opentrader/processing"; -import { BotService } from "../../../../services/bot.service"; -import type { Context } from "../../../../utils/context"; -import type { TRunBotTemplateInputSchema } from "./schema"; +import { BotService } from "../../../../services/bot.service.js"; +import type { Context } from "../../../../utils/context.js"; +import type { TRunBotTemplateInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/start-bot/handler.ts b/packages/trpc/src/routers/private/bot/start-bot/handler.ts index 9d3f7194..1fc4f80c 100644 --- a/packages/trpc/src/routers/private/bot/start-bot/handler.ts +++ b/packages/trpc/src/routers/private/bot/start-bot/handler.ts @@ -1,8 +1,8 @@ import { BotProcessing } from "@opentrader/processing"; -import { eventBus } from "../../../../event-bus"; -import { BotService } from "../../../../services/bot.service"; -import type { Context } from "../../../../utils/context"; -import type { TStartGridBotInputSchema } from "./schema"; +import { eventBus } from "../../../../event-bus.js"; +import { BotService } from "../../../../services/bot.service.js"; +import type { Context } from "../../../../utils/context.js"; +import type { TStartGridBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/stop-bot/handler.ts b/packages/trpc/src/routers/private/bot/stop-bot/handler.ts index bef7c267..752d93b7 100644 --- a/packages/trpc/src/routers/private/bot/stop-bot/handler.ts +++ b/packages/trpc/src/routers/private/bot/stop-bot/handler.ts @@ -1,7 +1,7 @@ import { BotProcessing } from "@opentrader/processing"; -import { BotService } from "../../../../services/bot.service"; -import type { Context } from "../../../../utils/context"; -import type { TStopGridBotInputSchema } from "./schema"; +import { BotService } from "../../../../services/bot.service.js"; +import type { Context } from "../../../../utils/context.js"; +import type { TStopGridBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/sync-orders/handler.ts b/packages/trpc/src/routers/private/bot/sync-orders/handler.ts index 79e39f35..57277e18 100644 --- a/packages/trpc/src/routers/private/bot/sync-orders/handler.ts +++ b/packages/trpc/src/routers/private/bot/sync-orders/handler.ts @@ -6,8 +6,8 @@ import { import type { OrderEntity } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; import type { IGetLimitOrderResponse } from "@opentrader/types"; -import type { Context } from "../../../../utils/context"; -import type { TSyncGridBotOrdersInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TSyncGridBotOrdersInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/bot/update-bot/handler.ts b/packages/trpc/src/routers/private/bot/update-bot/handler.ts index ac20325b..b52dcc88 100644 --- a/packages/trpc/src/routers/private/bot/update-bot/handler.ts +++ b/packages/trpc/src/routers/private/bot/update-bot/handler.ts @@ -1,6 +1,6 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TUpdateBotInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TUpdateBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/cron/router.ts b/packages/trpc/src/routers/private/cron/router.ts index 8a825bbc..3614dce9 100644 --- a/packages/trpc/src/routers/private/cron/router.ts +++ b/packages/trpc/src/routers/private/cron/router.ts @@ -1,6 +1,6 @@ -import { router } from "../../../trpc"; -import { authorizedProcedure } from "../../../procedures"; -import { syncClosedOrders } from "./sync-closed-orders/handler"; +import { router } from "../../../trpc.js"; +import { authorizedProcedure } from "../../../procedures.js"; +import { syncClosedOrders } from "./sync-closed-orders/handler.js"; export const cronRouter = router({ syncClosedOrders: authorizedProcedure.mutation(syncClosedOrders), diff --git a/packages/trpc/src/routers/private/cron/sync-closed-orders/handler.ts b/packages/trpc/src/routers/private/cron/sync-closed-orders/handler.ts index 2ed2d6f2..2ce51f3f 100644 --- a/packages/trpc/src/routers/private/cron/sync-closed-orders/handler.ts +++ b/packages/trpc/src/routers/private/cron/sync-closed-orders/handler.ts @@ -3,7 +3,7 @@ import { ExchangeAccountProcessor, } from "@opentrader/processing"; import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; +import type { Context } from "../../../../utils/context.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/exchange-accounts/create-account/handler.ts b/packages/trpc/src/routers/private/exchange-accounts/create-account/handler.ts index 753658f1..4e7527e6 100644 --- a/packages/trpc/src/routers/private/exchange-accounts/create-account/handler.ts +++ b/packages/trpc/src/routers/private/exchange-accounts/create-account/handler.ts @@ -1,7 +1,7 @@ import { xprisma } from "@opentrader/db"; -import { eventBus } from "../../../../event-bus"; -import type { Context } from "../../../../utils/context"; -import type { TCreateExchangeAccountInputSchema } from "./schema"; +import { eventBus } from "../../../../event-bus.js"; +import type { Context } from "../../../../utils/context.js"; +import type { TCreateExchangeAccountInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/exchange-accounts/get-account/handler.ts b/packages/trpc/src/routers/private/exchange-accounts/get-account/handler.ts index 5a4a8225..7a994a64 100644 --- a/packages/trpc/src/routers/private/exchange-accounts/get-account/handler.ts +++ b/packages/trpc/src/routers/private/exchange-accounts/get-account/handler.ts @@ -1,6 +1,6 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetExchangeAccountInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetExchangeAccountInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/exchange-accounts/get-accounts/handler.ts b/packages/trpc/src/routers/private/exchange-accounts/get-accounts/handler.ts index c9a0fe9a..6ed87986 100644 --- a/packages/trpc/src/routers/private/exchange-accounts/get-accounts/handler.ts +++ b/packages/trpc/src/routers/private/exchange-accounts/get-accounts/handler.ts @@ -1,5 +1,5 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; +import type { Context } from "../../../../utils/context.js"; type GetExchangeAccountsOptions = { ctx: { diff --git a/packages/trpc/src/routers/private/exchange-accounts/router.ts b/packages/trpc/src/routers/private/exchange-accounts/router.ts index 283d0c6b..03947a1c 100644 --- a/packages/trpc/src/routers/private/exchange-accounts/router.ts +++ b/packages/trpc/src/routers/private/exchange-accounts/router.ts @@ -1,12 +1,12 @@ -import { authorizedProcedure } from "../../../procedures"; -import { router } from "../../../trpc"; -import { getExchangeAccounts } from "./get-accounts/handler"; -import { getExchangeAccount } from "./get-account/handler"; -import { ZGetExchangeAccountInputSchema } from "./get-account/schema"; -import { createExchangeAccount } from "./create-account/handler"; -import { ZCreateExchangeAccountInputSchema } from "./create-account/schema"; -import { updateExchangeAccount } from "./update-account/handler"; -import { ZUpdateExchangeAccountInputSchema } from "./update-account/schema"; +import { authorizedProcedure } from "../../../procedures.js"; +import { router } from "../../../trpc.js"; +import { getExchangeAccounts } from "./get-accounts/handler.js"; +import { getExchangeAccount } from "./get-account/handler.js"; +import { ZGetExchangeAccountInputSchema } from "./get-account/schema.js"; +import { createExchangeAccount } from "./create-account/handler.js"; +import { ZCreateExchangeAccountInputSchema } from "./create-account/schema.js"; +import { updateExchangeAccount } from "./update-account/handler.js"; +import { ZUpdateExchangeAccountInputSchema } from "./update-account/schema.js"; export const exchangeAccountsRouter = router({ list: authorizedProcedure.query(getExchangeAccounts), diff --git a/packages/trpc/src/routers/private/exchange-accounts/update-account/handler.ts b/packages/trpc/src/routers/private/exchange-accounts/update-account/handler.ts index 26048940..19b8944a 100644 --- a/packages/trpc/src/routers/private/exchange-accounts/update-account/handler.ts +++ b/packages/trpc/src/routers/private/exchange-accounts/update-account/handler.ts @@ -1,6 +1,6 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TUpdateExchangeAccountInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TUpdateExchangeAccountInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts b/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts index 40d407b0..76792286 100644 --- a/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts +++ b/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts @@ -1,7 +1,7 @@ import { TRPCError } from "@trpc/server"; import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TCreateGridBotInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TCreateGridBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/grid-bot/get-bot/handler.ts b/packages/trpc/src/routers/private/grid-bot/get-bot/handler.ts index e5a3646b..8752d336 100644 --- a/packages/trpc/src/routers/private/grid-bot/get-bot/handler.ts +++ b/packages/trpc/src/routers/private/grid-bot/get-bot/handler.ts @@ -1,6 +1,6 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetGridBotInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetGridBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/grid-bot/get-bots/handler.ts b/packages/trpc/src/routers/private/grid-bot/get-bots/handler.ts index 1bcdc9bf..4ef60fd3 100644 --- a/packages/trpc/src/routers/private/grid-bot/get-bots/handler.ts +++ b/packages/trpc/src/routers/private/grid-bot/get-bots/handler.ts @@ -1,5 +1,5 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; +import type { Context } from "../../../../utils/context.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/grid-bot/get-form-options/handler.ts b/packages/trpc/src/routers/private/grid-bot/get-form-options/handler.ts index 0605e1ed..9866466c 100644 --- a/packages/trpc/src/routers/private/grid-bot/get-form-options/handler.ts +++ b/packages/trpc/src/routers/private/grid-bot/get-form-options/handler.ts @@ -1,8 +1,8 @@ import { exchangeProvider } from "@opentrader/exchanges"; import { decomposeSymbolId } from "@opentrader/tools"; import type { ExchangeCode } from "@opentrader/types"; -import type { Context } from "../../../../utils/context"; -import type { TGetGridBotFormOptionsInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetGridBotFormOptionsInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/grid-bot/router.ts b/packages/trpc/src/routers/private/grid-bot/router.ts index 6c3d6dd2..31648723 100644 --- a/packages/trpc/src/routers/private/grid-bot/router.ts +++ b/packages/trpc/src/routers/private/grid-bot/router.ts @@ -1,14 +1,14 @@ -import { router } from "../../../trpc"; -import { authorizedProcedure } from "../../../procedures"; -import { getGridBots } from "./get-bots/handler"; -import { getGridBot } from "./get-bot/handler"; -import { ZGetGridBotInputSchema } from "./get-bot/schema"; -import { createGridBot } from "./create-bot/handler"; -import { ZCreateGridBotInputSchema } from "./create-bot/schema"; -import { updateGridBot } from "./update-bot/handler"; -import { ZUpdateGridBotInputSchema } from "./update-bot/schema"; -import { getFormOptions } from "./get-form-options/handler"; -import { ZGetGridBotFormOptionsInputSchema } from "./get-form-options/schema"; +import { router } from "../../../trpc.js"; +import { authorizedProcedure } from "../../../procedures.js"; +import { getGridBots } from "./get-bots/handler.js"; +import { getGridBot } from "./get-bot/handler.js"; +import { ZGetGridBotInputSchema } from "./get-bot/schema.js"; +import { createGridBot } from "./create-bot/handler.js"; +import { ZCreateGridBotInputSchema } from "./create-bot/schema.js"; +import { updateGridBot } from "./update-bot/handler.js"; +import { ZUpdateGridBotInputSchema } from "./update-bot/schema.js"; +import { getFormOptions } from "./get-form-options/handler.js"; +import { ZGetGridBotFormOptionsInputSchema } from "./get-form-options/schema.js"; export const gridBotRouter = router({ list: authorizedProcedure.query(getGridBots), diff --git a/packages/trpc/src/routers/private/grid-bot/update-bot/handler.ts b/packages/trpc/src/routers/private/grid-bot/update-bot/handler.ts index ff89fd96..b16af8a3 100644 --- a/packages/trpc/src/routers/private/grid-bot/update-bot/handler.ts +++ b/packages/trpc/src/routers/private/grid-bot/update-bot/handler.ts @@ -1,6 +1,6 @@ import { xprisma } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TUpdateGridBotInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TUpdateGridBotInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/index.ts b/packages/trpc/src/routers/private/index.ts deleted file mode 100644 index 6d47fcc3..00000000 --- a/packages/trpc/src/routers/private/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./exchange-accounts/router"; -export * from "./symbols/router"; -export * from "./bot/router"; -export * from "./grid-bot/router"; -export * from "./smart-trade/router"; -export * from "./cron/router"; diff --git a/packages/trpc/src/routers/private/router.ts b/packages/trpc/src/routers/private/router.ts new file mode 100644 index 00000000..4487de2e --- /dev/null +++ b/packages/trpc/src/routers/private/router.ts @@ -0,0 +1,6 @@ +export * from "./exchange-accounts/router.js"; +export * from "./symbols/router.js"; +export * from "./bot/router.js"; +export * from "./grid-bot/router.js"; +export * from "./smart-trade/router.js"; +export * from "./cron/router.js"; diff --git a/packages/trpc/src/routers/private/smart-trade/get-smart-trade/handler.ts b/packages/trpc/src/routers/private/smart-trade/get-smart-trade/handler.ts index 3f5524a7..2e4e8999 100644 --- a/packages/trpc/src/routers/private/smart-trade/get-smart-trade/handler.ts +++ b/packages/trpc/src/routers/private/smart-trade/get-smart-trade/handler.ts @@ -3,8 +3,8 @@ import type { SmartTradeEntity_Order_Order, } from "@opentrader/db"; import { xprisma, toSmartTradeEntity } from "@opentrader/db"; -import type { Context } from "../../../../utils/context"; -import type { TGetSmartTradeInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetSmartTradeInputSchema } from "./schema.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/smart-trade/get-smart-trades/handler.ts b/packages/trpc/src/routers/private/smart-trade/get-smart-trades/handler.ts index 08bde51e..abb8c755 100644 --- a/packages/trpc/src/routers/private/smart-trade/get-smart-trades/handler.ts +++ b/packages/trpc/src/routers/private/smart-trade/get-smart-trades/handler.ts @@ -1,6 +1,6 @@ import { xprisma, toSmartTradeEntity } from "@opentrader/db"; -import type { TGetSmartTradesSchema } from "./schema"; -import type { Context } from "../../../../utils/context"; +import type { TGetSmartTradesSchema } from "./schema.js"; +import type { Context } from "../../../../utils/context.js"; type Options = { ctx: { diff --git a/packages/trpc/src/routers/private/smart-trade/router.ts b/packages/trpc/src/routers/private/smart-trade/router.ts index dba1e967..45aba124 100644 --- a/packages/trpc/src/routers/private/smart-trade/router.ts +++ b/packages/trpc/src/routers/private/smart-trade/router.ts @@ -1,9 +1,9 @@ -import { router } from "../../../trpc"; -import { authorizedProcedure } from "../../../procedures"; -import { getSmartTrades } from "./get-smart-trades/handler"; -import { ZGetSmartTradesSchema } from "./get-smart-trades/schema"; -import { getSmartTrade } from "./get-smart-trade/handler"; -import { ZGetSmartTradeInputSchema } from "./get-smart-trade/schema"; +import { router } from "../../../trpc.js"; +import { authorizedProcedure } from "../../../procedures.js"; +import { getSmartTrades } from "./get-smart-trades/handler.js"; +import { ZGetSmartTradesSchema } from "./get-smart-trades/schema.js"; +import { getSmartTrade } from "./get-smart-trade/handler.js"; +import { ZGetSmartTradeInputSchema } from "./get-smart-trade/schema.js"; export const smartTradeRouter = router({ list: authorizedProcedure.input(ZGetSmartTradesSchema).query(getSmartTrades), diff --git a/packages/trpc/src/routers/private/symbols/get-symbol-price/handler.ts b/packages/trpc/src/routers/private/symbols/get-symbol-price/handler.ts index f70811c1..21965172 100644 --- a/packages/trpc/src/routers/private/symbols/get-symbol-price/handler.ts +++ b/packages/trpc/src/routers/private/symbols/get-symbol-price/handler.ts @@ -1,7 +1,7 @@ import { exchangeProvider } from "@opentrader/exchanges"; import { decomposeSymbolId } from "@opentrader/tools"; -import type { Context } from "../../../../utils/context"; -import type { TGetSymbolPriceInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetSymbolPriceInputSchema } from "./schema.js"; type Options = { ctx: Context; diff --git a/packages/trpc/src/routers/private/symbols/get-symbol/handler.ts b/packages/trpc/src/routers/private/symbols/get-symbol/handler.ts index 52de0f2a..a12a3e45 100644 --- a/packages/trpc/src/routers/private/symbols/get-symbol/handler.ts +++ b/packages/trpc/src/routers/private/symbols/get-symbol/handler.ts @@ -1,7 +1,7 @@ import { exchangeProvider } from "@opentrader/exchanges"; import { decomposeSymbolId } from "@opentrader/tools"; -import type { Context } from "../../../../utils/context"; -import type { TGetSymbolInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetSymbolInputSchema } from "./schema.js"; type Options = { ctx: Context; diff --git a/packages/trpc/src/routers/private/symbols/get-symbols/handler.ts b/packages/trpc/src/routers/private/symbols/get-symbols/handler.ts index eb893a12..a8a184d8 100644 --- a/packages/trpc/src/routers/private/symbols/get-symbols/handler.ts +++ b/packages/trpc/src/routers/private/symbols/get-symbols/handler.ts @@ -1,6 +1,6 @@ import { exchangeProvider } from "@opentrader/exchanges"; -import type { Context } from "../../../../utils/context"; -import type { TGetSymbolsInputSchema } from "./schema"; +import type { Context } from "../../../../utils/context.js"; +import type { TGetSymbolsInputSchema } from "./schema.js"; type Options = { ctx: Context; diff --git a/packages/trpc/src/routers/private/symbols/router.ts b/packages/trpc/src/routers/private/symbols/router.ts index 9384da2d..58a27044 100644 --- a/packages/trpc/src/routers/private/symbols/router.ts +++ b/packages/trpc/src/routers/private/symbols/router.ts @@ -1,11 +1,11 @@ -import { router } from "../../../trpc"; -import { authorizedProcedure } from "../../../procedures"; -import { getSymbols } from "./get-symbols/handler"; -import { ZGetSymbolsInputSchema } from "./get-symbols/schema"; -import { getSymbol } from "./get-symbol/handler"; -import { ZGetSymbolInputSchema } from "./get-symbol/schema"; -import { getSymbolPrice } from "./get-symbol-price/handler"; -import { ZGetSymbolPriceInputSchema } from "./get-symbol-price/schema"; +import { router } from "../../../trpc.js"; +import { authorizedProcedure } from "../../../procedures.js"; +import { getSymbols } from "./get-symbols/handler.js"; +import { ZGetSymbolsInputSchema } from "./get-symbols/schema.js"; +import { getSymbol } from "./get-symbol/handler.js"; +import { ZGetSymbolInputSchema } from "./get-symbol/schema.js"; +import { getSymbolPrice } from "./get-symbol-price/handler.js"; +import { ZGetSymbolPriceInputSchema } from "./get-symbol-price/schema.js"; export const symbolsRouter = router({ list: authorizedProcedure.input(ZGetSymbolsInputSchema).query(getSymbols), diff --git a/packages/trpc/src/routers/public/healthcheck/handler.ts b/packages/trpc/src/routers/public/healthcheck/handler.ts index fb70c51a..f9457545 100644 --- a/packages/trpc/src/routers/public/healthcheck/handler.ts +++ b/packages/trpc/src/routers/public/healthcheck/handler.ts @@ -1,4 +1,4 @@ -import type { Context } from "../../../utils/context"; +import type { Context } from "../../../utils/context.js"; type Options = { ctx: Context; diff --git a/packages/trpc/src/routers/public/index.ts b/packages/trpc/src/routers/public/index.ts deleted file mode 100644 index 9d6ac3ae..00000000 --- a/packages/trpc/src/routers/public/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { publicRouter } from "./router"; diff --git a/packages/trpc/src/routers/public/router.ts b/packages/trpc/src/routers/public/router.ts index 1c17621f..358953d7 100644 --- a/packages/trpc/src/routers/public/router.ts +++ b/packages/trpc/src/routers/public/router.ts @@ -1,6 +1,6 @@ -import { router } from "../../trpc"; -import { publicProcedure } from "../../procedures"; -import { healhcheck } from "./healthcheck/handler"; +import { router } from "../../trpc.js"; +import { publicProcedure } from "../../procedures.js"; +import { healhcheck } from "./healthcheck/handler.js"; export const publicRouter = router({ healhcheck: publicProcedure.query(healhcheck), diff --git a/packages/trpc/src/trpc.ts b/packages/trpc/src/trpc.ts index 3481a471..252c44b9 100644 --- a/packages/trpc/src/trpc.ts +++ b/packages/trpc/src/trpc.ts @@ -1,6 +1,6 @@ import { initTRPC } from "@trpc/server"; import superjson from "superjson"; -import type { Context } from "./utils/context"; +import type { Context } from "./utils/context.js"; export const trpc = initTRPC.context().create({ transformer: superjson, diff --git a/packages/trpc/tsconfig.json b/packages/trpc/tsconfig.json index d2707e6a..7c095f42 100644 --- a/packages/trpc/tsconfig.json +++ b/packages/trpc/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", - "paths": {} + "outDir": "./dist" } } diff --git a/packages/trpc/tsup.config.ts b/packages/trpc/tsup.config.ts new file mode 100644 index 00000000..3c0d6e1c --- /dev/null +++ b/packages/trpc/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/**/*.ts"], + sourcemap: false, + clean: true, + format: ["cjs"], +}); From ce18f43e265f1322fcce3a11322325dfc1e66898 Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 25 Jun 2024 05:09:01 +0100 Subject: [PATCH 22/68] chore: replace `cron-job` with `cron` due missing ESM support --- packages/bot/package.json | 7 +++---- packages/bot/src/processing/timeframe.cron.ts | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/bot/package.json b/packages/bot/package.json index b8937c08..d88dbc40 100644 --- a/packages/bot/package.json +++ b/packages/bot/package.json @@ -1,12 +1,13 @@ { "name": "@opentrader/bot", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -18,10 +19,8 @@ "@opentrader/types": "workspace:*", "@types/async": "^3.2.24", "@types/node": "^20.14.5", - "@types/node-cron": "^3.0.11", "eslint": "8.54.0", "ts-node": "10.9.2", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { @@ -33,6 +32,6 @@ "@opentrader/tools": "workspace:*", "async": "^3.2.5", "ccxt": "4.3.27", - "node-cron": "^3.0.3" + "cron": "^3.1.7" } } diff --git a/packages/bot/src/processing/timeframe.cron.ts b/packages/bot/src/processing/timeframe.cron.ts index 70c7fed6..c05f6c43 100644 --- a/packages/bot/src/processing/timeframe.cron.ts +++ b/packages/bot/src/processing/timeframe.cron.ts @@ -1,7 +1,6 @@ import { BotProcessing } from "@opentrader/processing"; import { xprisma } from "@opentrader/db"; -import type { ScheduledTask } from "node-cron"; -import { schedule } from "node-cron"; +import { CronJob } from "cron"; import { logger } from "@opentrader/logger"; type Timeframe = "1m" | "5m" | "10m" | "15m" | "30m" | "1h" | "4h" | "1d"; @@ -18,12 +17,12 @@ const CronExpression: Record = { }; export class TimeframeCron { - tasks: ScheduledTask[] = []; + tasks: CronJob[] = []; create() { for (const [timeframe, cronExpression] of Object.entries(CronExpression)) { this.tasks.push( - schedule(cronExpression, async () => { + new CronJob(cronExpression, async () => { await this.execTemplate(timeframe as Timeframe); }), ); From 6164ce85b84c1715d8ffb2b5f61b9c29d32534fc Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 25 Jun 2024 05:16:03 +0100 Subject: [PATCH 23/68] chore(cli): target ESM --- apps/cli/.eslintrc.js | 10 ------- apps/cli/eslint.config.js | 10 +++++++ apps/cli/package.json | 6 ++-- apps/cli/src/api/down.ts | 4 +-- apps/cli/src/api/grid-lines.ts | 2 +- apps/cli/src/api/index.ts | 16 +++++----- apps/cli/src/api/logs.ts | 13 +++----- apps/cli/src/api/run-backtest.ts | 4 +-- apps/cli/src/api/run-trading.ts | 2 +- apps/cli/src/api/stop-command.ts | 4 +-- apps/cli/src/api/up/daemon.ts | 6 ++-- apps/cli/src/api/up/index.ts | 11 ++++--- apps/cli/src/commands/backtest.ts | 10 +++---- apps/cli/src/commands/down.ts | 4 +-- apps/cli/src/commands/grid-lines.ts | 6 ++-- apps/cli/src/commands/logs.ts | 4 +-- apps/cli/src/commands/stop.ts | 8 ++--- apps/cli/src/commands/trade.ts | 10 +++---- apps/cli/src/commands/up.ts | 4 +-- apps/cli/src/commands/version.ts | 4 +-- apps/cli/src/config.ts | 8 +++-- apps/cli/src/index.ts | 18 +++++------ apps/cli/src/utils/bot.ts | 2 +- apps/cli/src/utils/command.ts | 2 +- apps/cli/src/utils/pid.ts | 2 +- apps/cli/tsconfig.json | 5 ++-- apps/cli/tsup.config.ts | 30 +++++++++++++++++++ packages/backtesting/package.json | 4 +-- .../backtesting/src/store/memory-store.ts | 2 +- packages/backtesting/tsup.config.ts | 8 ----- packages/bot-processor/package.json | 4 +-- packages/bot-templates/package.json | 4 +-- packages/bot-templates/tsup.config.ts | 8 ----- packages/bot/tsup.config.ts | 8 ----- packages/db/package.json | 4 +-- packages/db/tsup.config.ts | 8 ----- packages/exchanges/package.json | 4 +-- packages/exchanges/tsup.config.ts | 8 ----- packages/indicators/package.json | 4 +-- packages/indicators/tsup.config.ts | 8 ----- packages/logger/package.json | 4 +-- packages/logger/src/formatters.ts | 9 +++--- packages/logger/tsup.config.ts | 8 ----- packages/prisma/package.json | 1 + packages/processing/package.json | 4 +-- packages/processing/tsup.config.ts | 8 ----- packages/trpc/package.json | 4 +-- packages/trpc/tsup.config.ts | 8 ----- 48 files changed, 144 insertions(+), 181 deletions(-) delete mode 100644 apps/cli/.eslintrc.js create mode 100644 apps/cli/eslint.config.js create mode 100644 apps/cli/tsup.config.ts delete mode 100644 packages/backtesting/tsup.config.ts delete mode 100644 packages/bot-templates/tsup.config.ts delete mode 100644 packages/bot/tsup.config.ts delete mode 100644 packages/db/tsup.config.ts delete mode 100644 packages/exchanges/tsup.config.ts delete mode 100644 packages/indicators/tsup.config.ts delete mode 100644 packages/logger/tsup.config.ts delete mode 100644 packages/processing/tsup.config.ts delete mode 100644 packages/trpc/tsup.config.ts diff --git a/apps/cli/.eslintrc.js b/apps/cli/.eslintrc.js deleted file mode 100644 index 1a0bc443..00000000 --- a/apps/cli/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - extends: ["@opentrader/eslint-config/module.js"], - rules: { - "import/namespace": "off", - "@typescript-eslint/no-var-requires": "off", - "import/first": "off", - }, -}; diff --git a/apps/cli/eslint.config.js b/apps/cli/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/apps/cli/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/apps/cli/package.json b/apps/cli/package.json index 251946e6..75a73ea6 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -2,23 +2,25 @@ "name": "opentrader", "version": "0.0.1", "description": "", + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "webpack", + "build": "tsup", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, "author": "bludnic", "license": "Apache-2.0", "devDependencies": { - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/node": "^20.14.5", "eslint": "8.54.0", "ts-loader": "^9.5.1", "ts-node": "10.9.2", + "tsup": "^8.1.0", "typescript": "5.4.5", "webpack": "^5.92.0", "webpack-cli": "^5.1.4", diff --git a/apps/cli/src/api/down.ts b/apps/cli/src/api/down.ts index 8880fb3b..7f16886a 100644 --- a/apps/cli/src/api/down.ts +++ b/apps/cli/src/api/down.ts @@ -1,6 +1,6 @@ import { logger } from "@opentrader/logger"; -import { CommandResult } from "../types"; -import { getPid, clearPid } from "../utils/pid"; +import { CommandResult } from "../types.js"; +import { getPid, clearPid } from "../utils/pid.js"; type Options = { force: boolean; diff --git a/apps/cli/src/api/grid-lines.ts b/apps/cli/src/api/grid-lines.ts index cce66473..829010d1 100644 --- a/apps/cli/src/api/grid-lines.ts +++ b/apps/cli/src/api/grid-lines.ts @@ -1,5 +1,5 @@ import { calcGridLines } from "@opentrader/tools"; -import type { CommandResult } from "../types"; +import type { CommandResult } from "../types.js"; export function buildGridLines( maxPrice: number, diff --git a/apps/cli/src/api/index.ts b/apps/cli/src/api/index.ts index 2cdb607a..6208eb53 100644 --- a/apps/cli/src/api/index.ts +++ b/apps/cli/src/api/index.ts @@ -1,8 +1,8 @@ -export * from "./grid-lines"; -export * from "./run-backtest"; -export * from "./run-trading"; -export * from "./stop-command"; -export * from "./up/index"; -export * from "./down"; -export * from "./logs"; -export * from "./version"; +export * from "./grid-lines.js"; +export * from "./run-backtest.js"; +export * from "./run-trading.js"; +export * from "./stop-command.js"; +export * from "./up/index.js"; +export * from "./down.js"; +export * from "./logs.js"; +export * from "./version.js"; diff --git a/apps/cli/src/api/logs.ts b/apps/cli/src/api/logs.ts index f5b46440..9a54ebdb 100644 --- a/apps/cli/src/api/logs.ts +++ b/apps/cli/src/api/logs.ts @@ -1,14 +1,9 @@ import { logger } from "@opentrader/logger"; -import { - existsSync, - readFileSync, - createReadStream, - watchFile, -} from "fs"; +import { existsSync, readFileSync, createReadStream, watchFile } from "fs"; import { createInterface } from "readline"; -import { prettyLog } from "../utils/pretty-log"; -import { logPath } from "../utils/app-path"; -import { CommandResult } from "../types"; +import { prettyLog } from "../utils/pretty-log.js"; +import { logPath } from "../utils/app-path.js"; +import { CommandResult } from "../types.js"; type Options = { follow: boolean; diff --git a/apps/cli/src/api/run-backtest.ts b/apps/cli/src/api/run-backtest.ts index 8091fcac..776cf42f 100644 --- a/apps/cli/src/api/run-backtest.ts +++ b/apps/cli/src/api/run-backtest.ts @@ -6,8 +6,8 @@ import { CCXTCandlesProvider } from "@opentrader/bot"; import { logger } from "@opentrader/logger"; import { exchangeCodeMapCCXT } from "@opentrader/exchanges"; import type { BarSize, ExchangeCode, ICandlestick } from "@opentrader/types"; -import type { CommandResult, ConfigName } from "../types"; -import { readBotConfig } from "../config"; +import type { CommandResult, ConfigName } from "../types.js"; +import { readBotConfig } from "../config.js"; type Options = { config: ConfigName; diff --git a/apps/cli/src/api/run-trading.ts b/apps/cli/src/api/run-trading.ts index 82fac8c1..0c700a3b 100644 --- a/apps/cli/src/api/run-trading.ts +++ b/apps/cli/src/api/run-trading.ts @@ -1,7 +1,7 @@ import { templates } from "@opentrader/bot-templates"; import { BarSize } from "@opentrader/types"; import { Client } from "jayson/promise"; -import type { CommandResult, ConfigName } from "../types"; +import type { CommandResult, ConfigName } from "../types.js"; type Options = { config: ConfigName; diff --git a/apps/cli/src/api/stop-command.ts b/apps/cli/src/api/stop-command.ts index 305b4b2a..a9986340 100644 --- a/apps/cli/src/api/stop-command.ts +++ b/apps/cli/src/api/stop-command.ts @@ -2,8 +2,8 @@ import { findStrategy } from "@opentrader/bot-templates/server"; import { xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; import { BotProcessing } from "@opentrader/processing"; -import type { CommandResult, ConfigName } from "../types"; -import { readBotConfig, readExchangesConfig } from "../config"; +import type { CommandResult, ConfigName } from "../types.js"; +import { readBotConfig, readExchangesConfig } from "../config.js"; export async function stopCommand(options: { config: ConfigName; diff --git a/apps/cli/src/api/up/daemon.ts b/apps/cli/src/api/up/daemon.ts index 0e6b2683..76c03f73 100644 --- a/apps/cli/src/api/up/daemon.ts +++ b/apps/cli/src/api/up/daemon.ts @@ -5,15 +5,15 @@ import { xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; import type { BarSize } from "@opentrader/types"; import { findStrategy } from "@opentrader/bot-templates/server"; -import { readBotConfig, readExchangesConfig } from "../../config"; +import { readBotConfig, readExchangesConfig } from "../../config.js"; import { createOrUpdateBot, createOrUpdateExchangeAccounts, resetProcessing, startBot, stopBot, -} from "../../utils/bot"; -import type { ConfigName } from "../../types"; +} from "../../utils/bot.js"; +import type { ConfigName } from "../../types.js"; let app: App | null = null; diff --git a/apps/cli/src/api/up/index.ts b/apps/cli/src/api/up/index.ts index f008b057..29f74a42 100644 --- a/apps/cli/src/api/up/index.ts +++ b/apps/cli/src/api/up/index.ts @@ -1,10 +1,13 @@ -import { join } from "node:path"; +import { dirname, join } from "node:path"; import { spawn } from "node:child_process"; import { logger } from "@opentrader/logger"; -import type { CommandResult } from "../../types"; -import { appPath } from "../../utils/app-path"; -import { getPid, savePid } from "../../utils/pid"; +import type { CommandResult } from "../../types.js"; +import { appPath } from "../../utils/app-path.js"; +import { getPid, savePid } from "../../utils/pid.js"; +import { fileURLToPath } from "node:url"; +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); const isDevelopment = process.env.NODE_ENV !== "production"; type Options = { diff --git a/apps/cli/src/commands/backtest.ts b/apps/cli/src/commands/backtest.ts index 509f34f2..f6a87c4c 100644 --- a/apps/cli/src/commands/backtest.ts +++ b/apps/cli/src/commands/backtest.ts @@ -1,10 +1,10 @@ import { ExchangeCode } from "@opentrader/types"; import type { Command } from "commander"; import { Argument, Option } from "commander"; -import { DEFAULT_CONFIG_NAME } from "../config"; -import { validateExchange, validatePair } from "../utils/validate"; -import { handle } from "../utils/command"; -import * as api from "../api"; +import { DEFAULT_CONFIG_NAME } from "../config.js"; +import { validateExchange, validatePair } from "../utils/validate.js"; +import { handle } from "../utils/command.js"; +import { runBacktest } from "../api/run-backtest.js"; export function addBacktestCommand(program: Command) { program @@ -37,5 +37,5 @@ export function addBacktestCommand(program: Command) { .argParser(validateExchange) .default(ExchangeCode.OKX), ) - .action(handle(api.runBacktest)); + .action(handle(runBacktest)); } diff --git a/apps/cli/src/commands/down.ts b/apps/cli/src/commands/down.ts index 6cc69f87..60809596 100644 --- a/apps/cli/src/commands/down.ts +++ b/apps/cli/src/commands/down.ts @@ -1,6 +1,6 @@ import { Command, Option } from "commander"; -import { handle } from "../utils/command"; -import { down } from "../api"; +import { handle } from "../utils/command.js"; +import { down } from "../api/down.js"; export function addDownCommand(program: Command) { program diff --git a/apps/cli/src/commands/grid-lines.ts b/apps/cli/src/commands/grid-lines.ts index 0a7d6d28..2af3f6ce 100644 --- a/apps/cli/src/commands/grid-lines.ts +++ b/apps/cli/src/commands/grid-lines.ts @@ -1,7 +1,7 @@ import type { Command } from "commander"; import { Argument, Option } from "commander"; -import { handle } from "../utils/command"; -import * as api from "../api"; +import { handle } from "../utils/command.js"; +import { buildGridLines } from "../api/grid-lines.js"; export function addGridLinesCommand(program: Command) { program @@ -19,5 +19,5 @@ export function addGridLinesCommand(program: Command) { .argParser(parseFloat) .default(1), ) - .action(handle(api.buildGridLines)); + .action(handle(buildGridLines)); } diff --git a/apps/cli/src/commands/logs.ts b/apps/cli/src/commands/logs.ts index 84301184..573045e7 100644 --- a/apps/cli/src/commands/logs.ts +++ b/apps/cli/src/commands/logs.ts @@ -1,6 +1,6 @@ import { Command, Option } from "commander"; -import { handle } from "../utils/command"; -import { logs } from "../api"; +import { handle } from "../utils/command.js"; +import { logs } from "../api/logs.js"; export function addLogsCommand(program: Command) { program diff --git a/apps/cli/src/commands/stop.ts b/apps/cli/src/commands/stop.ts index 466d85c3..1608f1be 100644 --- a/apps/cli/src/commands/stop.ts +++ b/apps/cli/src/commands/stop.ts @@ -1,8 +1,8 @@ import type { Command } from "commander"; import { Option } from "commander"; -import { DEFAULT_CONFIG_NAME } from "../config"; -import { handle } from "../utils/command"; -import * as api from "../api"; +import { DEFAULT_CONFIG_NAME } from "../config.js"; +import { handle } from "../utils/command.js"; +import { stopCommand } from "../api/stop-command.js"; export function addStopCommand(program: Command) { program @@ -13,5 +13,5 @@ export function addStopCommand(program: Command) { DEFAULT_CONFIG_NAME, ), ) - .action(handle(api.stopCommand)); + .action(handle(stopCommand)); } diff --git a/apps/cli/src/commands/trade.ts b/apps/cli/src/commands/trade.ts index 1d77e6d0..29964c02 100644 --- a/apps/cli/src/commands/trade.ts +++ b/apps/cli/src/commands/trade.ts @@ -1,9 +1,9 @@ import type { Command } from "commander"; import { Argument, Option } from "commander"; -import { DEFAULT_CONFIG_NAME } from "../config"; -import { validatePair, validateTimeframe } from "../utils/validate"; -import { handle } from "../utils/command"; -import * as api from "../api"; +import { DEFAULT_CONFIG_NAME } from "../config.js"; +import { validatePair, validateTimeframe } from "../utils/validate.js"; +import { handle } from "../utils/command.js"; +import { runTrading } from "../api/run-trading.js"; export function addTradeCommand(program: Command) { program @@ -24,5 +24,5 @@ export function addTradeCommand(program: Command) { .argParser(validateTimeframe) .default(null), ) - .action(handle(api.runTrading)); + .action(handle(runTrading)); } diff --git a/apps/cli/src/commands/up.ts b/apps/cli/src/commands/up.ts index 3c34a215..40d18595 100644 --- a/apps/cli/src/commands/up.ts +++ b/apps/cli/src/commands/up.ts @@ -1,6 +1,6 @@ import { Command, Option } from "commander"; -import { handle } from "../utils/command"; -import { up } from "../api"; +import { handle } from "../utils/command.js"; +import { up } from "../api/up/index.js"; export function addUpCommand(program: Command) { program diff --git a/apps/cli/src/commands/version.ts b/apps/cli/src/commands/version.ts index 7281d43f..0e65ed83 100644 --- a/apps/cli/src/commands/version.ts +++ b/apps/cli/src/commands/version.ts @@ -1,6 +1,6 @@ import { Command, Option } from "commander"; -import { handle } from "../utils/command"; -import { version } from "../api"; +import { handle } from "../utils/command.js"; +import { version } from "../api/version.js"; export function addVersionCommand(program: Command) { program.command("version").action(handle(version)); diff --git a/apps/cli/src/config.ts b/apps/cli/src/config.ts index a41a85fa..d2e32f14 100644 --- a/apps/cli/src/config.ts +++ b/apps/cli/src/config.ts @@ -1,8 +1,12 @@ import * as fs from "node:fs"; -import { join } from "node:path"; +import { join, dirname } from "node:path"; +import { fileURLToPath } from "url"; import JSON5 from "json5"; import { logger } from "@opentrader/logger"; -import { BotConfig, ConfigName, ExchangeConfig } from "./types"; +import { BotConfig, ConfigName, ExchangeConfig } from "./types.js"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); const rootDir = join(__dirname, ".."); diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.ts index 6602f5f3..6819c196 100644 --- a/apps/cli/src/index.ts +++ b/apps/cli/src/index.ts @@ -16,18 +16,18 @@ * Repository URL: https://github.com/bludnic/opentrader */ -import { logPath } from "./utils/app-path"; +import { logPath } from "./utils/app-path.js"; process.env.LOG_FILE = logPath; import { Command } from "commander"; -import { addStopCommand } from "./commands/stop"; -import { addBacktestCommand } from "./commands/backtest"; -import { addGridLinesCommand } from "./commands/grid-lines"; -import { addTradeCommand } from "./commands/trade"; -import { addUpCommand } from "./commands/up"; -import { addDownCommand } from "./commands/down"; -import { addLogsCommand } from "./commands/logs"; -import { addVersionCommand } from "./commands/version"; +import { addStopCommand } from "./commands/stop.js"; +import { addBacktestCommand } from "./commands/backtest.js"; +import { addGridLinesCommand } from "./commands/grid-lines.js"; +import { addTradeCommand } from "./commands/trade.js"; +import { addUpCommand } from "./commands/up.js"; +import { addDownCommand } from "./commands/down.js"; +import { addLogsCommand } from "./commands/logs.js"; +import { addVersionCommand } from "./commands/version.js"; const program = new Command(); diff --git a/apps/cli/src/utils/bot.ts b/apps/cli/src/utils/bot.ts index 0ec2587b..6f476831 100644 --- a/apps/cli/src/utils/bot.ts +++ b/apps/cli/src/utils/bot.ts @@ -2,7 +2,7 @@ import { ExchangeAccountWithCredentials, TBot, xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; import { BotProcessing } from "@opentrader/processing"; import { BarSize } from "@opentrader/types"; -import { BotConfig, ConfigName, ExchangeConfig } from "../types"; +import { BotConfig, ConfigName, ExchangeConfig } from "../types.js"; /** * Save exchange accounts to DB if not exists diff --git a/apps/cli/src/utils/command.ts b/apps/cli/src/utils/command.ts index 57b54062..4e5a16bc 100644 --- a/apps/cli/src/utils/command.ts +++ b/apps/cli/src/utils/command.ts @@ -1,5 +1,5 @@ import { logger } from "@opentrader/logger"; -import type { CommandResult } from "../types"; +import type { CommandResult } from "../types.js"; /** * Return a wrapper what will process an async function and log the result diff --git a/apps/cli/src/utils/pid.ts b/apps/cli/src/utils/pid.ts index fb21621e..d7ae600e 100644 --- a/apps/cli/src/utils/pid.ts +++ b/apps/cli/src/utils/pid.ts @@ -1,6 +1,6 @@ import { join } from "node:path"; import { mkdirSync, readFileSync, writeFileSync } from "node:fs"; -import { appPath } from "./app-path"; +import { appPath } from "./app-path.js"; /** * Save daemon process PID to file diff --git a/apps/cli/tsconfig.json b/apps/cli/tsconfig.json index d2707e6a..ac05db81 100644 --- a/apps/cli/tsconfig.json +++ b/apps/cli/tsconfig.json @@ -1,8 +1,9 @@ { - "extends": "@opentrader/tsconfig/module.json", + "extends": "@opentrader/tsconfig/esm.json", "compilerOptions": { "baseUrl": ".", "outDir": "./dist", - "paths": {} + "paths": {}, + "resolveJsonModule": true } } diff --git a/apps/cli/tsup.config.ts b/apps/cli/tsup.config.ts new file mode 100644 index 00000000..2eb98ea4 --- /dev/null +++ b/apps/cli/tsup.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: { + main: "./src/index.ts", + }, // Adjust this to your entry file + format: ["esm", "cjs"], + outDir: "dist", + dts: false, // Generate TypeScript declaration files if needed + splitting: false, + sourcemap: false, + clean: true, + minify: false, + skipNodeModulesBundle: false, + bundle: true, + target: "esnext", + treeshake: true, + external: [], + noExternal: [/node_modules/, /@opentrader/], // Include node_modules in the bundle + outExtension: ({ format }) => { + if (format === "esm") return { js: ".mjs" }; + if (format === "cjs") return { js: ".cjs" }; + return { js: ".js" }; + }, + esbuildOptions: (options) => { + options.banner = { + js: "import { createRequire } from 'module';const require = createRequire(import.meta.url);", + }; + }, +}); diff --git a/packages/backtesting/package.json b/packages/backtesting/package.json index ff16fcca..c6c67bda 100644 --- a/packages/backtesting/package.json +++ b/packages/backtesting/package.json @@ -1,12 +1,13 @@ { "name": "@opentrader/backtesting", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -19,7 +20,6 @@ "@types/lodash": "^4.17.5", "@types/node": "^20.14.5", "eslint": "8.54.0", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/backtesting/src/store/memory-store.ts b/packages/backtesting/src/store/memory-store.ts index afcf8ab4..7c61c838 100644 --- a/packages/backtesting/src/store/memory-store.ts +++ b/packages/backtesting/src/store/memory-store.ts @@ -6,7 +6,7 @@ import { } from "@opentrader/bot-processor"; import type { IExchange } from "@opentrader/exchanges"; import { OrderStatusEnum, OrderType } from "@opentrader/types"; -import uniqueId from "lodash/uniqueId"; +import { uniqueId } from "lodash"; import type { MarketSimulator } from "../market-simulator.js"; export class MemoryStore implements IStore { diff --git a/packages/backtesting/tsup.config.ts b/packages/backtesting/tsup.config.ts deleted file mode 100644 index 14b62e47..00000000 --- a/packages/backtesting/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: true, - clean: true, - format: ["cjs"], -}); diff --git a/packages/bot-processor/package.json b/packages/bot-processor/package.json index 25aae231..31f24ef5 100644 --- a/packages/bot-processor/package.json +++ b/packages/bot-processor/package.json @@ -1,12 +1,13 @@ { "name": "@opentrader/bot-processor", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -20,7 +21,6 @@ "eslint": "8.54.0", "ts-node": "10.9.2", "tslib": "^2.6.3", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/bot-templates/package.json b/packages/bot-templates/package.json index 3b6b1544..c9bd5109 100644 --- a/packages/bot-templates/package.json +++ b/packages/bot-templates/package.json @@ -1,6 +1,7 @@ { "name": "@opentrader/bot-templates", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", @@ -11,7 +12,7 @@ "./dist": "./src/index.ts" }, "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix", "test": "jest" @@ -28,7 +29,6 @@ "eslint": "8.54.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/bot-templates/tsup.config.ts b/packages/bot-templates/tsup.config.ts deleted file mode 100644 index 14b62e47..00000000 --- a/packages/bot-templates/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: true, - clean: true, - format: ["cjs"], -}); diff --git a/packages/bot/tsup.config.ts b/packages/bot/tsup.config.ts deleted file mode 100644 index 14b62e47..00000000 --- a/packages/bot/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: true, - clean: true, - format: ["cjs"], -}); diff --git a/packages/db/package.json b/packages/db/package.json index 622ab0a8..bee97475 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,12 +1,13 @@ { "name": "@opentrader/db", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -18,7 +19,6 @@ "@opentrader/types": "workspace:*", "@types/node": "^20.14.5", "eslint": "8.54.0", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/db/tsup.config.ts b/packages/db/tsup.config.ts deleted file mode 100644 index 14b62e47..00000000 --- a/packages/db/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: true, - clean: true, - format: ["cjs"], -}); diff --git a/packages/exchanges/package.json b/packages/exchanges/package.json index c16a9cca..dbd6cf12 100644 --- a/packages/exchanges/package.json +++ b/packages/exchanges/package.json @@ -1,6 +1,7 @@ { "name": "@opentrader/exchanges", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", @@ -12,7 +13,7 @@ "./dist": "./src/index.ts" }, "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -24,7 +25,6 @@ "@opentrader/types": "workspace:*", "@types/node": "^20.14.5", "eslint": "8.54.0", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/exchanges/tsup.config.ts b/packages/exchanges/tsup.config.ts deleted file mode 100644 index 14b62e47..00000000 --- a/packages/exchanges/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: true, - clean: true, - format: ["cjs"], -}); diff --git a/packages/indicators/package.json b/packages/indicators/package.json index 039f030c..17c8f06d 100644 --- a/packages/indicators/package.json +++ b/packages/indicators/package.json @@ -1,12 +1,13 @@ { "name": "@opentrader/indicators", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix", "test": "jest" @@ -24,7 +25,6 @@ "jest": "^29.7.0", "ts-jest": "^29.1.5", "ts-node": "10.9.2", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/indicators/tsup.config.ts b/packages/indicators/tsup.config.ts deleted file mode 100644 index 14b62e47..00000000 --- a/packages/indicators/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: true, - clean: true, - format: ["cjs"], -}); diff --git a/packages/logger/package.json b/packages/logger/package.json index 21cfe751..69e8ac43 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,12 +1,13 @@ { "name": "@opentrader/logger", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -19,7 +20,6 @@ "@types/node": "^20.14.5", "eslint": "8.54.0", "ts-node": "10.9.2", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/logger/src/formatters.ts b/packages/logger/src/formatters.ts index cf955a32..6513734c 100644 --- a/packages/logger/src/formatters.ts +++ b/packages/logger/src/formatters.ts @@ -1,14 +1,13 @@ import type { ICandlestick } from "@opentrader/types"; -import c from "chalk"; const pad = (value: string | number, length: number) => value.toString().padEnd(length); export function candle({ open, high, low, close }: ICandlestick) { - const O = c.green("O"); - const H = c.green("H"); - const L = c.green("L"); - const C = c.green("C"); + const O = "O"; + const H = "H"; + const L = "L"; + const C = "C"; return `${O} ${open} ${H} ${high} ${L} ${low} ${C} ${close}`; } diff --git a/packages/logger/tsup.config.ts b/packages/logger/tsup.config.ts deleted file mode 100644 index 14b62e47..00000000 --- a/packages/logger/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: true, - clean: true, - format: ["cjs"], -}); diff --git a/packages/prisma/package.json b/packages/prisma/package.json index cdea8e7b..f48b9e72 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -1,6 +1,7 @@ { "name": "@opentrader/prisma", "version": "0.0.1", + "private": true, "description": "", "main": "src/index.ts", "types": "src/index.ts", diff --git a/packages/processing/package.json b/packages/processing/package.json index 4a27d2a1..8855f780 100644 --- a/packages/processing/package.json +++ b/packages/processing/package.json @@ -1,12 +1,13 @@ { "name": "@opentrader/processing", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix", "test": "jest" @@ -23,7 +24,6 @@ "eslint": "8.54.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/processing/tsup.config.ts b/packages/processing/tsup.config.ts deleted file mode 100644 index 14b62e47..00000000 --- a/packages/processing/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: true, - clean: true, - format: ["cjs"], -}); diff --git a/packages/trpc/package.json b/packages/trpc/package.json index a08b8ccc..8d86c96e 100644 --- a/packages/trpc/package.json +++ b/packages/trpc/package.json @@ -1,12 +1,13 @@ { "name": "@opentrader/trpc", "version": "0.0.1", + "private": true, "description": "", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "tsup", + "?build": "Internal package", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -18,7 +19,6 @@ "@opentrader/types": "workspace:*", "@types/node": "^20.14.5", "eslint": "8.54.0", - "tsup": "^8.1.0", "typescript": "5.4.5" }, "dependencies": { diff --git a/packages/trpc/tsup.config.ts b/packages/trpc/tsup.config.ts deleted file mode 100644 index 3c0d6e1c..00000000 --- a/packages/trpc/tsup.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/**/*.ts"], - sourcemap: false, - clean: true, - format: ["cjs"], -}); From 12b934b0c540611582d967e6eff0ad0cce6900ac Mon Sep 17 00:00:00 2001 From: bludnic Date: Sat, 29 Jun 2024 19:30:05 +0100 Subject: [PATCH 24/68] feat: use tRPC instead of jayson --- apps/cli/build.mjs | 82 ++++++++++++++++++++ apps/cli/package.json | 18 ++++- apps/cli/src/api/run-trading.ts | 77 ++++++++++++++++--- apps/cli/src/api/stop-command.ts | 27 ++----- apps/cli/src/api/up/daemon.ts | 124 ++----------------------------- apps/cli/src/server.ts | 107 ++++++++++++++++++++++++++ apps/cli/src/trpc.ts | 15 ++++ apps/cli/tsup.config.ts | 26 +++++-- packages/trpc/src/index.ts | 1 + 9 files changed, 319 insertions(+), 158 deletions(-) create mode 100644 apps/cli/build.mjs create mode 100644 apps/cli/src/server.ts create mode 100644 apps/cli/src/trpc.ts diff --git a/apps/cli/build.mjs b/apps/cli/build.mjs new file mode 100644 index 00000000..2b74c807 --- /dev/null +++ b/apps/cli/build.mjs @@ -0,0 +1,82 @@ +import fs from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const rootPackageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8")); +const dependencies = {}; + +// Function to merge dependencies, excluding specified packages +const mergeDependencies = (source, target) => { + for (const [key, value] of Object.entries(source)) { + if ( + !key.startsWith("@opentrader/") && + key !== "eslint" && + key !== "prettier" + ) { + if (!target[key]) { + target[key] = value; + } else if (target[key] !== value) { + console.warn(`Version conflict for ${key}: ${target[key]} vs ${value}`); + } + } + } +}; + +// Function to find package.json files in immediate subdirectories +const findPackageJsonFiles = (dir) => { + const results = []; + const list = fs.readdirSync(dir); + list.forEach((file) => { + const filePath = path.resolve(dir, file); + const stat = fs.statSync(filePath); + if (stat && stat.isDirectory()) { + const packageJsonPath = path.resolve(filePath, "package.json"); + if (fs.existsSync(packageJsonPath)) { + results.push(packageJsonPath); + } + } + }); + return results; +}; + +// Define the base path for the search +const basePath = path.resolve(__dirname, "../../packages"); + +// Get all package.json files in the immediate subdirectories +const packageJsonFiles = findPackageJsonFiles(basePath); + +packageJsonFiles.forEach((file) => { + const packageJson = JSON.parse(fs.readFileSync(file, "utf-8")); + + if (packageJson.dependencies) { + mergeDependencies(packageJson.dependencies, dependencies); + } +}); + +// Merge root dependencies with collected dependencies +if (rootPackageJson.dependencies) { + mergeDependencies(rootPackageJson.dependencies, dependencies); +} + +// Create new package.json for publishing without devDependencies +const { devDependencies, ...rootPackageJsonWithoutDev } = rootPackageJson; +const newPackageJson = { + ...rootPackageJsonWithoutDev, + dependencies, +}; + +// Write to new package.json file +const distPath = path.resolve(__dirname, "dist"); +if (!fs.existsSync(distPath)) { + fs.mkdirSync(distPath); +} + +fs.writeFileSync( + path.resolve(distPath, "package.json"), + JSON.stringify(newPackageJson, null, 2), +); + +console.log("Generated package.json at dist/package.json"); diff --git a/apps/cli/package.json b/apps/cli/package.json index 75a73ea6..7e7238f4 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -3,10 +3,12 @@ "version": "0.0.1", "description": "", "type": "module", - "main": "src/index.ts", + "main": "dist/main.mjs", "types": "src/index.ts", "scripts": { "build": "tsup", + "build:packageJson": "node build.mjs", + "pack": "ncc build dist/main.js -o app/main && ncc build dist/daemon.js -o app/daemon", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -16,6 +18,8 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", + "@trpc/client": "^10.45.2", + "@types/express": "^4.17.21", "@types/node": "^20.14.5", "eslint": "8.54.0", "ts-loader": "^9.5.1", @@ -36,12 +40,20 @@ "@opentrader/logger": "workspace:*", "@opentrader/processing": "workspace:*", "@opentrader/tools": "workspace:*", + "@opentrader/trpc": "workspace:*", "@prisma/client": "5.15.0", + "@trpc/server": "^10.45.2", "ccxt": "4.3.27", "commander": "^12.1.0", - "jayson": "^4.1.0", + "express": "^4.19.2", "json5": "^2.2.3", "pino": "^9.2.0", - "pino-pretty": "^11.2.1" + "pino-pretty": "^11.2.1", + "zod": "3.23.8" + }, + "pkg": { + "assets": [ + "node_modules/ccxt/**/*" + ] } } diff --git a/apps/cli/src/api/run-trading.ts b/apps/cli/src/api/run-trading.ts index 0c700a3b..2a30d73c 100644 --- a/apps/cli/src/api/run-trading.ts +++ b/apps/cli/src/api/run-trading.ts @@ -1,7 +1,17 @@ import { templates } from "@opentrader/bot-templates"; import { BarSize } from "@opentrader/types"; -import { Client } from "jayson/promise"; +import { logger } from "@opentrader/logger"; +import { findStrategy } from "@opentrader/bot-templates/server"; import type { CommandResult, ConfigName } from "../types.js"; +import { createClient } from "../server.js"; +import { readBotConfig, readExchangesConfig } from "../config.js"; +import { ExchangeAccountWithCredentials, xprisma } from "@opentrader/db"; +import { + createOrUpdateBot, + createOrUpdateExchangeAccounts, + resetProcessing, +} from "src/utils/bot.js"; +import { tServer } from "../trpc.js"; type Options = { config: ConfigName; @@ -14,17 +24,64 @@ export async function runTrading( strategyName: keyof typeof templates, options: Options, ): Promise { - const client = Client.http({ - port: 8000, + const daemon = createClient(); + + const config = readBotConfig(options.config); + logger.debug(config, "Parsed bot config"); + + const exchangesConfig = readExchangesConfig(options.config); + logger.debug(exchangesConfig, "Parsed exchanges config"); + + let strategy: Awaited>; + try { + strategy = await findStrategy(strategyName); + } catch (err) { + logger.info((err as Error).message); + + return { + result: undefined, + }; + } + + let bot = await xprisma.bot.custom.findUnique({ + where: { + label: config.label || "default", + }, }); - const result = client.request("startBot", [ - strategyName, - options.config, - options.pair, - options.exchange, - options.timeframe, - ]); + if (bot?.enabled) { + logger.info( + `Bot "${bot.label}" is already enabled. Cancelling previous orders...`, + ); + await tServer.bot.stop({ botId: bot.id }); + + logger.info(`The bot was stoped`); + } + + if (bot?.processing) { + logger.warn( + `Bot "${bot.label}" is already processing. It could happen because previous process was interrupted.`, + ); + await resetProcessing(bot.id); + logger.warn(`The bot processing state was cleared`); + } + + const exchangeAccounts: ExchangeAccountWithCredentials[] = + await createOrUpdateExchangeAccounts(exchangesConfig); + bot = await createOrUpdateBot( + strategy.isCustom ? strategy.strategyFilePath : strategyName, + options, + config, + exchangeAccounts, + ); + + const result = await daemon.startBot.mutate({ botId: bot.id }); + + if (result) { + logger.info(`Bot "${bot.label}" started succesfully`); + } else { + logger.error(`Bot "${bot.label}" failed to start. Check the daemon logs`); + } return { result: undefined, diff --git a/apps/cli/src/api/stop-command.ts b/apps/cli/src/api/stop-command.ts index a9986340..6ca80381 100644 --- a/apps/cli/src/api/stop-command.ts +++ b/apps/cli/src/api/stop-command.ts @@ -4,10 +4,13 @@ import { logger } from "@opentrader/logger"; import { BotProcessing } from "@opentrader/processing"; import type { CommandResult, ConfigName } from "../types.js"; import { readBotConfig, readExchangesConfig } from "../config.js"; +import { createClient } from "../server.js"; export async function stopCommand(options: { config: ConfigName; }): Promise { + const daemon = createClient(); + const config = readBotConfig(options.config); logger.debug(config, "Parsed bot config"); @@ -41,29 +44,11 @@ export async function stopCommand(options: { }; } - logger.info(`Processing stop command for bot "${bot.label}"...`); - await stopBot(bot.id); - logger.info(`Command stop processed successfully for bot "${bot.label}"`); + logger.info(`Stopping bot "${bot.label}"...`); + await daemon.stopBot.mutate({ botId: bot.id }); + logger.info(`Bot "${bot.label}" stopped successfully`); return { result: undefined, }; } - -async function stopBot(botId: number) { - const botProcessor = await BotProcessing.fromId(botId); - await botProcessor.processStopCommand(); - - await disableBot(botId); -} - -async function disableBot(botId: number) { - await xprisma.bot.custom.update({ - where: { - id: botId, - }, - data: { - enabled: false, - }, - }); -} diff --git a/apps/cli/src/api/up/daemon.ts b/apps/cli/src/api/up/daemon.ts index 76c03f73..413e56ec 100644 --- a/apps/cli/src/api/up/daemon.ts +++ b/apps/cli/src/api/up/daemon.ts @@ -1,19 +1,9 @@ -import { Server } from "jayson/promise"; import { Processor } from "@opentrader/bot"; -import type { ExchangeAccountWithCredentials } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; import type { BarSize } from "@opentrader/types"; -import { findStrategy } from "@opentrader/bot-templates/server"; -import { readBotConfig, readExchangesConfig } from "../../config.js"; -import { - createOrUpdateBot, - createOrUpdateExchangeAccounts, - resetProcessing, - startBot, - stopBot, -} from "../../utils/bot.js"; import type { ConfigName } from "../../types.js"; +import { createServer } from "../../server.js"; let app: App | null = null; @@ -65,7 +55,7 @@ async function createApp() { app = await App.create(); logger.info("App created"); - server.http().listen(8000); + server.listen(8000); logger.info("RPC Server started on port 8000"); } void createApp(); @@ -77,111 +67,7 @@ type Options = { timeframe?: BarSize; }; -const server = Server({ - async startBot( - args: [ - strategyName: string, - configName: ConfigName, - pair?: string, - exchange?: string, - timeframe?: BarSize, - ], - ) { - const [strategyName, configName, pair, exchange, timeframe] = args; - const options = { - strategyName, - config: configName, - pair, - exchange, - timeframe, - }; - - const config = readBotConfig(options.config); - logger.debug(config, "Parsed bot config"); - - const exchangesConfig = readExchangesConfig(options.config); - logger.debug(exchangesConfig, "Parsed exchanges config"); - - let strategy: Awaited>; - try { - strategy = await findStrategy(strategyName); - } catch (err) { - logger.info((err as Error).message); - - return false; - } - - // Saving exchange accounts to DB if not exists - const exchangeAccounts: ExchangeAccountWithCredentials[] = - await createOrUpdateExchangeAccounts(exchangesConfig); - const bot = await createOrUpdateBot( - strategy.isCustom ? strategy.strategyFilePath : strategyName, - options, - config, - exchangeAccounts, - ); - - await app?.restart(); - - if (bot.enabled) { - logger.info( - `Bot "${bot.label}" is already enabled. Cancelling previous orders...`, - ); - await stopBot(bot.id); - logger.info(`The bot state was cleared`); - } - - if (bot.processing) { - logger.warn( - `Bot "${bot.label}" is already processing. It could happen because previous process was interrupted.`, - ); - await resetProcessing(bot.id); - logger.warn(`The bot processing state was cleared`); - } - - await startBot(bot.id); - logger.info(`Bot "${bot.label}" started`); - - return true; - }, - async stopBot(args: [configName: ConfigName]) { - const [configName] = args; - - const config = readBotConfig(configName); - logger.debug(config, "Parsed bot config"); - - const exchangesConfig = readExchangesConfig(configName); - logger.debug(exchangesConfig, "Parsed exchanges config"); - - const botLabel = config.label || "default"; - - const bot = await xprisma.bot.custom.findUnique({ - where: { - label: botLabel, - }, - }); - - if (!bot) { - logger.info(`Bot "${botLabel}" does not exists. Nothing to stop`); - - return false; - } - - try { - await findStrategy(bot.template); - } catch (err) { - logger.info((err as Error).message); - - return false; - } - - logger.info(`Processing stop command for bot "${bot.label}"...`); - await stopBot(bot.id); - logger.info(`Command stop processed successfully for bot "${bot.label}"`); - - return true; - }, -}); +const server = createServer(); async function shutdown() { logger.info("SIGTERM received"); @@ -191,8 +77,8 @@ async function shutdown() { logger.info("App shutted down gracefully."); } - server.http().close(); - logger.info("RPC Server shutted down gracefully."); + server.close(); + logger.info("Express Server shutted down gracefully."); process.exit(0); } diff --git a/apps/cli/src/server.ts b/apps/cli/src/server.ts new file mode 100644 index 00000000..41f30c97 --- /dev/null +++ b/apps/cli/src/server.ts @@ -0,0 +1,107 @@ +import { initTRPC } from "@trpc/server"; +import { createTRPCProxyClient, httpBatchLink } from "@trpc/client"; +import * as trpcExpress from "@trpc/server/adapters/express"; +import type { Express } from "express"; +import express from "express"; +import { z } from "zod"; +import { logger } from "@opentrader/logger"; +import { tServer } from "./trpc.js"; + +const t = initTRPC.create(); + +export const { router, procedure } = t; + +const cliRouter = router({ + startBot: procedure + .input(z.object({ botId: z.number() })) + .mutation(async (opts) => { + const { botId } = opts.input; + + try { + await tServer.bot.start({ botId }); + } catch (err) { + logger.error((err as Error).message); + + return false; + } + + return true; + }), + stopBot: procedure + .input(z.object({ botId: z.number() })) + .mutation(async (opts) => { + const { botId } = opts.input; + + try { + await tServer.bot.stop({ botId }); + } catch (err) { + logger.error((err as Error).message); + + return false; + } + + return true; + }), +}); + +// created for each request +const createContext = ({ + req, + res, +}: trpcExpress.CreateExpressContextOptions) => { + const password = req.headers.authorization; + + if (password === process.env.ADMIN_PASSWORD) { + return { + user: { + id: 1, + password: "huitebe", + email: "nu@nahui", + displayName: "Hui tebe", + role: "Admin" as const, + }, + }; + } + + return { + user: null, + }; +}; + +export function useTrpc(app: Express) { + app.use( + "/api/trpc", + trpcExpress.createExpressMiddleware({ + router: cliRouter, + createContext, + }), + ); +} + +export const app = express(); +useTrpc(app); + +export const createServer = () => { + let server: ReturnType | null = null; + + return { + listen: (port: number, cb?: () => void) => { + server = app.listen(port, cb); + + return server; + }, + close: () => { + server?.close(); + }, + }; +}; + +export const createClient = () => { + return createTRPCProxyClient({ + links: [ + httpBatchLink({ + url: "http://localhost:8000/api/trpc", + }), + ], + }); +}; diff --git a/apps/cli/src/trpc.ts b/apps/cli/src/trpc.ts new file mode 100644 index 00000000..edf3ac03 --- /dev/null +++ b/apps/cli/src/trpc.ts @@ -0,0 +1,15 @@ +import { trpc, appRouter } from "@opentrader/trpc"; + +const ctx = { + user: { + id: 1, + password: "huitebe", + email: "nu@nahui", + displayName: "Hui tebe", + role: "Admin" as const, + }, +}; + +const createCaller = trpc.createCallerFactory(appRouter); + +export const tServer = createCaller(ctx); diff --git a/apps/cli/tsup.config.ts b/apps/cli/tsup.config.ts index 2eb98ea4..0c3d80c7 100644 --- a/apps/cli/tsup.config.ts +++ b/apps/cli/tsup.config.ts @@ -3,11 +3,12 @@ import { defineConfig } from "tsup"; export default defineConfig({ entry: { main: "./src/index.ts", + daemon: "./src/api/up/daemon.ts", }, // Adjust this to your entry file - format: ["esm", "cjs"], + format: ["esm"], outDir: "dist", dts: false, // Generate TypeScript declaration files if needed - splitting: false, + splitting: true, sourcemap: false, clean: true, minify: false, @@ -16,15 +17,30 @@ export default defineConfig({ target: "esnext", treeshake: true, external: [], - noExternal: [/node_modules/, /@opentrader/], // Include node_modules in the bundle + env: { + NODE_ENV: "production", + }, + // noExternal: [/(.*)/], + noExternal: [/@opentrader/], // Include node_modules in the bundle outExtension: ({ format }) => { - if (format === "esm") return { js: ".mjs" }; + if (format === "esm") return { js: ".js" }; if (format === "cjs") return { js: ".cjs" }; return { js: ".js" }; }, esbuildOptions: (options) => { options.banner = { - js: "import { createRequire } from 'module';const require = createRequire(import.meta.url);", + js: ` + import { createRequire } from 'module'; + + const require = createRequire(import.meta.url); + + if (typeof globalThis.__dirname === "undefined") { + globalThis.__dirname = new URL('.', import.meta.url).pathname; + } + if (typeof globalThis.__filename === "undefined") { + globalThis.__filename = new URL(import.meta.url).pathname; + } + `, }; }, }); diff --git a/packages/trpc/src/index.ts b/packages/trpc/src/index.ts index ddaa5b7d..77a7ef59 100644 --- a/packages/trpc/src/index.ts +++ b/packages/trpc/src/index.ts @@ -15,6 +15,7 @@ * * Repository URL: https://github.com/bludnic/opentrader */ +export { trpc } from "./trpc.js"; export { type AppRouter, appRouter } from "./routers/appRouter.js"; export { createContext } from "./utils/context.js"; export { eventBus, EVENT } from "./event-bus.js"; From 3e4b5fdd0b1067a1392fa0019556f4a22519f401 Mon Sep 17 00:00:00 2001 From: bludnic Date: Sat, 29 Jun 2024 19:54:15 +0100 Subject: [PATCH 25/68] feat(cli): check if daemon is running before starting the bot --- apps/cli/src/api/run-trading.ts | 35 +++++++++++++++++++++++++------- apps/cli/src/api/stop-command.ts | 5 ++--- apps/cli/src/server.ts | 3 +++ 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/apps/cli/src/api/run-trading.ts b/apps/cli/src/api/run-trading.ts index 2a30d73c..77bbd3f0 100644 --- a/apps/cli/src/api/run-trading.ts +++ b/apps/cli/src/api/run-trading.ts @@ -2,10 +2,10 @@ import { templates } from "@opentrader/bot-templates"; import { BarSize } from "@opentrader/types"; import { logger } from "@opentrader/logger"; import { findStrategy } from "@opentrader/bot-templates/server"; +import { ExchangeAccountWithCredentials, xprisma } from "@opentrader/db"; import type { CommandResult, ConfigName } from "../types.js"; import { createClient } from "../server.js"; import { readBotConfig, readExchangesConfig } from "../config.js"; -import { ExchangeAccountWithCredentials, xprisma } from "@opentrader/db"; import { createOrUpdateBot, createOrUpdateExchangeAccounts, @@ -20,12 +20,12 @@ type Options = { timeframe?: BarSize; }; +const daemon = createClient(); + export async function runTrading( strategyName: keyof typeof templates, options: Options, ): Promise { - const daemon = createClient(); - const config = readBotConfig(options.config); logger.debug(config, "Parsed bot config"); @@ -49,13 +49,15 @@ export async function runTrading( }, }); - if (bot?.enabled) { + const isDaemonRunning = await checkDaemonHealth(); + if (!isDaemonRunning) { logger.info( - `Bot "${bot.label}" is already enabled. Cancelling previous orders...`, + "Daemon is not running. Please start it before running the bot", ); - await tServer.bot.stop({ botId: bot.id }); - logger.info(`The bot was stoped`); + return { + result: undefined, + }; } if (bot?.processing) { @@ -66,6 +68,15 @@ export async function runTrading( logger.warn(`The bot processing state was cleared`); } + if (bot?.enabled) { + logger.info( + `Bot "${bot.label}" is already enabled. Cancelling previous orders...`, + ); + await tServer.bot.stop({ botId: bot.id }); + + logger.info(`The bot was stoped`); + } + const exchangeAccounts: ExchangeAccountWithCredentials[] = await createOrUpdateExchangeAccounts(exchangesConfig); bot = await createOrUpdateBot( @@ -87,3 +98,13 @@ export async function runTrading( result: undefined, }; } + +async function checkDaemonHealth() { + try { + await daemon.healthcheck.query(); + + return true; + } catch (err) { + return false; + } +} diff --git a/apps/cli/src/api/stop-command.ts b/apps/cli/src/api/stop-command.ts index 6ca80381..fa90e82a 100644 --- a/apps/cli/src/api/stop-command.ts +++ b/apps/cli/src/api/stop-command.ts @@ -1,16 +1,15 @@ import { findStrategy } from "@opentrader/bot-templates/server"; import { xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; -import { BotProcessing } from "@opentrader/processing"; import type { CommandResult, ConfigName } from "../types.js"; import { readBotConfig, readExchangesConfig } from "../config.js"; import { createClient } from "../server.js"; +const daemon = createClient(); + export async function stopCommand(options: { config: ConfigName; }): Promise { - const daemon = createClient(); - const config = readBotConfig(options.config); logger.debug(config, "Parsed bot config"); diff --git a/apps/cli/src/server.ts b/apps/cli/src/server.ts index 41f30c97..68e1ec9c 100644 --- a/apps/cli/src/server.ts +++ b/apps/cli/src/server.ts @@ -42,6 +42,9 @@ const cliRouter = router({ return true; }), + healthcheck: procedure.query(async () => { + return true; + }), }); // created for each request From 0ca976a5ff8ba437013351310d93b8f53cfa6654 Mon Sep 17 00:00:00 2001 From: bludnic Date: Mon, 1 Jul 2024 00:09:34 +0100 Subject: [PATCH 26/68] chore(cli): generate `package.json` and copy `schema.prisma` using ESBuild plugins --- apps/cli/.gitignore | 1 + apps/cli/build.mjs | 82 ------------- apps/cli/package.json | 8 +- apps/cli/plugins/copy-prisma-schema-plugin.ts | 37 ++++++ .../plugins/generate-package-json-plugin.ts | 110 ++++++++++++++++++ apps/cli/tsup.config.ts | 4 + 6 files changed, 153 insertions(+), 89 deletions(-) delete mode 100644 apps/cli/build.mjs create mode 100644 apps/cli/plugins/copy-prisma-schema-plugin.ts create mode 100644 apps/cli/plugins/generate-package-json-plugin.ts diff --git a/apps/cli/.gitignore b/apps/cli/.gitignore index f06235c4..a2d24c81 100644 --- a/apps/cli/.gitignore +++ b/apps/cli/.gitignore @@ -1,2 +1,3 @@ node_modules dist +release diff --git a/apps/cli/build.mjs b/apps/cli/build.mjs deleted file mode 100644 index 2b74c807..00000000 --- a/apps/cli/build.mjs +++ /dev/null @@ -1,82 +0,0 @@ -import fs from "fs"; -import path from "path"; -import { fileURLToPath } from "url"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -const rootPackageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8")); -const dependencies = {}; - -// Function to merge dependencies, excluding specified packages -const mergeDependencies = (source, target) => { - for (const [key, value] of Object.entries(source)) { - if ( - !key.startsWith("@opentrader/") && - key !== "eslint" && - key !== "prettier" - ) { - if (!target[key]) { - target[key] = value; - } else if (target[key] !== value) { - console.warn(`Version conflict for ${key}: ${target[key]} vs ${value}`); - } - } - } -}; - -// Function to find package.json files in immediate subdirectories -const findPackageJsonFiles = (dir) => { - const results = []; - const list = fs.readdirSync(dir); - list.forEach((file) => { - const filePath = path.resolve(dir, file); - const stat = fs.statSync(filePath); - if (stat && stat.isDirectory()) { - const packageJsonPath = path.resolve(filePath, "package.json"); - if (fs.existsSync(packageJsonPath)) { - results.push(packageJsonPath); - } - } - }); - return results; -}; - -// Define the base path for the search -const basePath = path.resolve(__dirname, "../../packages"); - -// Get all package.json files in the immediate subdirectories -const packageJsonFiles = findPackageJsonFiles(basePath); - -packageJsonFiles.forEach((file) => { - const packageJson = JSON.parse(fs.readFileSync(file, "utf-8")); - - if (packageJson.dependencies) { - mergeDependencies(packageJson.dependencies, dependencies); - } -}); - -// Merge root dependencies with collected dependencies -if (rootPackageJson.dependencies) { - mergeDependencies(rootPackageJson.dependencies, dependencies); -} - -// Create new package.json for publishing without devDependencies -const { devDependencies, ...rootPackageJsonWithoutDev } = rootPackageJson; -const newPackageJson = { - ...rootPackageJsonWithoutDev, - dependencies, -}; - -// Write to new package.json file -const distPath = path.resolve(__dirname, "dist"); -if (!fs.existsSync(distPath)) { - fs.mkdirSync(distPath); -} - -fs.writeFileSync( - path.resolve(distPath, "package.json"), - JSON.stringify(newPackageJson, null, 2), -); - -console.log("Generated package.json at dist/package.json"); diff --git a/apps/cli/package.json b/apps/cli/package.json index 7e7238f4..de4cb50e 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -7,8 +7,7 @@ "types": "src/index.ts", "scripts": { "build": "tsup", - "build:packageJson": "node build.mjs", - "pack": "ncc build dist/main.js -o app/main && ncc build dist/daemon.js -o app/daemon", + "build:release": "tsup -d release/dist", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -50,10 +49,5 @@ "pino": "^9.2.0", "pino-pretty": "^11.2.1", "zod": "3.23.8" - }, - "pkg": { - "assets": [ - "node_modules/ccxt/**/*" - ] } } diff --git a/apps/cli/plugins/copy-prisma-schema-plugin.ts b/apps/cli/plugins/copy-prisma-schema-plugin.ts new file mode 100644 index 00000000..77aa19a1 --- /dev/null +++ b/apps/cli/plugins/copy-prisma-schema-plugin.ts @@ -0,0 +1,37 @@ +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { Plugin } from "esbuild"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const CLI_DIR = path.resolve(__dirname, "../"); +const PRISMA_DIR = path.resolve(CLI_DIR, "../../packages/prisma"); +const DIST_DIR = path.resolve(CLI_DIR, "release/dist"); + +/** + * Copy the Prisma schema file to the release build directory. + */ +export const copyPrismaSchemaPlugin = (): Plugin => ({ + name: "copy-prisma-schema", + setup(build) { + if (build.initialOptions.outdir !== "release/dist") { + console.log('Skipping "schema.prisma" copy for non-release build'); + return; + } + + build.onEnd(() => { + const prismaSchemaPath = path.resolve(PRISMA_DIR, "src/schema.prisma"); + const prismaSchemaDest = path.resolve(DIST_DIR, "../schema.prisma"); + + if (!fs.existsSync(DIST_DIR)) { + fs.mkdirSync(DIST_DIR, { + recursive: true, + }); + } + + fs.copyFileSync(prismaSchemaPath, prismaSchemaDest); + }); + }, +}); diff --git a/apps/cli/plugins/generate-package-json-plugin.ts b/apps/cli/plugins/generate-package-json-plugin.ts new file mode 100644 index 00000000..3c1242f9 --- /dev/null +++ b/apps/cli/plugins/generate-package-json-plugin.ts @@ -0,0 +1,110 @@ +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { Plugin } from "esbuild"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const CLI_DIR = path.resolve(__dirname, "../"); +const PACKAGES_DIR = path.resolve(CLI_DIR, "../../packages"); + +/** + * ESBuild plugin for generating a `package.json` that includes all the + * dependencies used by Internal Packages. The generated `package.json` is used + * for later publishing on NPM. + */ +export const generatePackageJsonPlugin = (): Plugin => ({ + name: "generate-package-json", + setup(build) { + if (build.initialOptions.outdir !== "release/dist") { + console.log('Skipping "package.json" generation for non-release build'); + return; + } + + build.onEnd(() => { + const rootPackageJson = JSON.parse( + fs.readFileSync("./package.json", "utf-8"), + ); + const dependencies = {}; + + // Function to merge dependencies, excluding specified packages + const mergeDependencies = ( + source: Record, + target: Record, + ) => { + for (const [key, value] of Object.entries(source)) { + if (!key.startsWith("@opentrader/")) { + if (!target[key]) { + target[key] = value; + } else if (target[key] !== value) { + console.warn( + `Version conflict for ${key}: ${target[key]} vs ${value}`, + ); + } + } + } + }; + + // Function to find package.json files in immediate subdirectories + const findPackageJsonFiles = (dir: string) => { + const results: string[] = []; + const list = fs.readdirSync(dir); + list.forEach((file) => { + const filePath = path.resolve(dir, file); + const stat = fs.statSync(filePath); + if (stat && stat.isDirectory()) { + const packageJsonPath = path.resolve(filePath, "package.json"); + if (fs.existsSync(packageJsonPath)) { + results.push(packageJsonPath); + } + } + }); + + return results; + }; + + // Get all package.json files in the immediate subdirectories + const packageJsonFiles = findPackageJsonFiles(PACKAGES_DIR); + + packageJsonFiles.forEach((file) => { + const packageJson = JSON.parse(fs.readFileSync(file, "utf-8")); + + if (packageJson.dependencies) { + mergeDependencies(packageJson.dependencies, dependencies); + } + }); + + // Merge root dependencies with collected dependencies + if (rootPackageJson.dependencies) { + mergeDependencies(rootPackageJson.dependencies, dependencies); + } + + // Create new package.json for publishing without devDependencies + const { devDependencies, ...rootPackageJsonWithoutDev } = rootPackageJson; + const newPackageJson = { + ...rootPackageJsonWithoutDev, + dependencies, + }; + + // Add postinstall script + newPackageJson.scripts.postinstall = "prisma generate"; // @todo prisma migrate dev + + const distPath = path.resolve(CLI_DIR, build.initialOptions.outdir!); + + // Write to new package.json file + if (!fs.existsSync(distPath)) { + fs.mkdirSync(distPath, { recursive: true }); + } + + fs.writeFileSync( + path.resolve(distPath, "../package.json"), + JSON.stringify(newPackageJson, null, 2), + ); + + console.log( + `Generated package.json. Check the release build at ${build.initialOptions.outdir}`, + ); + }); + }, +}); diff --git a/apps/cli/tsup.config.ts b/apps/cli/tsup.config.ts index 0c3d80c7..60f1ee63 100644 --- a/apps/cli/tsup.config.ts +++ b/apps/cli/tsup.config.ts @@ -1,5 +1,8 @@ import { defineConfig } from "tsup"; +import { copyPrismaSchemaPlugin } from "./plugins/copy-prisma-schema-plugin.js"; +import { generatePackageJsonPlugin } from "./plugins/generate-package-json-plugin.js"; + export default defineConfig({ entry: { main: "./src/index.ts", @@ -43,4 +46,5 @@ export default defineConfig({ `, }; }, + esbuildPlugins: [generatePackageJsonPlugin(), copyPrismaSchemaPlugin()], }); From df36e60d5ce8e5f402d8f09a0f08c682f7506fea Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 2 Jul 2024 11:29:59 +0100 Subject: [PATCH 27/68] feat(cli): load bot config from cwd or root dir --- apps/cli/src/config.ts | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/apps/cli/src/config.ts b/apps/cli/src/config.ts index d2e32f14..8070d3e6 100644 --- a/apps/cli/src/config.ts +++ b/apps/cli/src/config.ts @@ -9,13 +9,18 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const rootDir = join(__dirname, ".."); - -const PROD_CONFIG = fs.existsSync(`${rootDir}/config.prod.json5`) - ? "prod" - : undefined; -const DEV_CONFIG = fs.existsSync(`${rootDir}/config.dev.json5`) - ? "dev" - : undefined; +const currDir = process.cwd(); + +const PROD_CONFIG = + fs.existsSync(`${currDir}/config.prod.json5`) || + fs.existsSync(`${rootDir}/config.prod.json5`) + ? "prod" + : undefined; +const DEV_CONFIG = + fs.existsSync(`${currDir}/config.dev.json5`) || + fs.existsSync(`${rootDir}/config.dev.json5`) + ? "dev" + : undefined; export const DEFAULT_CONFIG_NAME: ConfigName = PROD_CONFIG || DEV_CONFIG || "default"; @@ -29,9 +34,11 @@ export function readBotConfig( configName: ConfigName = DEFAULT_CONFIG_NAME, ): BotConfig { const configFileName = `config.${configName}.json5`; - const configPath = `${rootDir}/${configFileName}`; + const configPath = fs.existsSync(`${currDir}/${configFileName}`) + ? `${currDir}/${configFileName}` + : `${rootDir}/${configFileName}`; - logger.info(`Using bot config file: ${configFileName}`); + logger.info(`Using bot config file: ${configPath}`); const config = JSON5.parse>(fs.readFileSync(configPath, "utf8")); return config; @@ -41,9 +48,11 @@ export function readExchangesConfig( configName: ConfigName = "default", ): Record { const configFileName = `exchanges.${configName}.json5`; - const configPath = `${rootDir}/${configFileName}`; + const configPath = fs.existsSync(`${currDir}/${configFileName}`) + ? `${currDir}/${configFileName}` + : `${rootDir}/${configFileName}`; - logger.info(`Using exchanges config file: ${configFileName}`); + logger.info(`Using exchanges config file: ${configPath}`); const config = JSON5.parse>( fs.readFileSync(configPath, "utf8"), ); From b7840f7be05eb3e3ef62f4a3c38fa788bd666854 Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 2 Jul 2024 13:10:40 +0100 Subject: [PATCH 28/68] chore: prepare binary file for publishing on NPM --- apps/cli/bin/cli.sh | 4 ++++ apps/cli/package.json | 5 ++++- apps/cli/tsup.config.ts | 2 +- bin/opentrader.sh | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100755 apps/cli/bin/cli.sh diff --git a/apps/cli/bin/cli.sh b/apps/cli/bin/cli.sh new file mode 100755 index 00000000..8337e81e --- /dev/null +++ b/apps/cli/bin/cli.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# Use "$@" to pass all additional command line arguments to your script + +node dist/main.mjs "$@" diff --git a/apps/cli/package.json b/apps/cli/package.json index de4cb50e..f3dd5eaf 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -7,7 +7,7 @@ "types": "src/index.ts", "scripts": { "build": "tsup", - "build:release": "tsup -d release/dist", + "build:release": "tsup -d release/dist && cp -r ./bin ./release/bin", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -49,5 +49,8 @@ "pino": "^9.2.0", "pino-pretty": "^11.2.1", "zod": "3.23.8" + }, + "bin": { + "opentrader": "./bin/cli.sh" } } diff --git a/apps/cli/tsup.config.ts b/apps/cli/tsup.config.ts index 60f1ee63..e53b6597 100644 --- a/apps/cli/tsup.config.ts +++ b/apps/cli/tsup.config.ts @@ -26,7 +26,7 @@ export default defineConfig({ // noExternal: [/(.*)/], noExternal: [/@opentrader/], // Include node_modules in the bundle outExtension: ({ format }) => { - if (format === "esm") return { js: ".js" }; + if (format === "esm") return { js: ".mjs" }; if (format === "cjs") return { js: ".cjs" }; return { js: ".js" }; }, diff --git a/bin/opentrader.sh b/bin/opentrader.sh index 8152d270..d4e5bd9e 100755 --- a/bin/opentrader.sh +++ b/bin/opentrader.sh @@ -1,3 +1,3 @@ #!/bin/bash # Use "$@" to pass all additional command line arguments to your script -node apps/cli/dist/main.js "$@" +node apps/cli/dist/main.mjs "$@" From b70f7021856afcc428daa3f6f3d0cb64aadd6b78 Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 2 Jul 2024 13:42:43 +0100 Subject: [PATCH 29/68] fix(cli): run .mjs relative to .sh script --- apps/cli/bin/cli.sh | 4 ---- apps/cli/bin/opentrader.sh | 7 +++++++ apps/cli/package.json | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) delete mode 100755 apps/cli/bin/cli.sh create mode 100755 apps/cli/bin/opentrader.sh diff --git a/apps/cli/bin/cli.sh b/apps/cli/bin/cli.sh deleted file mode 100755 index 8337e81e..00000000 --- a/apps/cli/bin/cli.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# Use "$@" to pass all additional command line arguments to your script - -node dist/main.mjs "$@" diff --git a/apps/cli/bin/opentrader.sh b/apps/cli/bin/opentrader.sh new file mode 100755 index 00000000..fde0fe71 --- /dev/null +++ b/apps/cli/bin/opentrader.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Determine the script's directory +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" + +# Run the Node.js script with the resolved directory +node "$SCRIPT_DIR/../dist/main.mjs" "$@" \ No newline at end of file diff --git a/apps/cli/package.json b/apps/cli/package.json index f3dd5eaf..4fa7be56 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -20,6 +20,7 @@ "@trpc/client": "^10.45.2", "@types/express": "^4.17.21", "@types/node": "^20.14.5", + "esbuild": "^0.23.0", "eslint": "8.54.0", "ts-loader": "^9.5.1", "ts-node": "10.9.2", @@ -51,6 +52,6 @@ "zod": "3.23.8" }, "bin": { - "opentrader": "./bin/cli.sh" + "opentrader": "./bin/opentrader.sh" } } From 99a792134b1e838bc0a290be2400ed70c37b812a Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 2 Jul 2024 13:48:00 +0100 Subject: [PATCH 30/68] fix(cli): js to mjs --- apps/cli/package.json | 2 +- apps/cli/src/api/up/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 4fa7be56..c854a6f8 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "opentrader", - "version": "0.0.1", + "version": "1.0.0-alpha.2", "description": "", "type": "module", "main": "dist/main.mjs", diff --git a/apps/cli/src/api/up/index.ts b/apps/cli/src/api/up/index.ts index 29f74a42..53c25a48 100644 --- a/apps/cli/src/api/up/index.ts +++ b/apps/cli/src/api/up/index.ts @@ -30,7 +30,7 @@ export async function up(options: Options): Promise { detached: options.detach, stdio: options.detach ? "ignore" : undefined, }) - : spawn("node", [join(__dirname, "daemon.js")], { + : spawn("node", [join(__dirname, "daemon.mjs")], { detached: options.detach, stdio: options.detach ? "ignore" : undefined, }); From 54d11010f80399d2ad2a716632e93f1bd50c7436 Mon Sep 17 00:00:00 2001 From: bludnic Date: Mon, 8 Jul 2024 23:24:23 +0100 Subject: [PATCH 31/68] refactor(cli): move Daemon to a separate package --- apps/cli/package.json | 4 +- apps/cli/src/api/run-trading.ts | 6 +- apps/cli/src/api/stop-command.ts | 4 +- apps/cli/src/api/up/daemon.ts | 81 +------------- apps/cli/src/daemon.ts | 19 ++++ apps/cli/src/server.ts | 110 ------------------- packages/daemon/.gitignore | 2 + packages/daemon/LICENSE | 177 +++++++++++++++++++++++++++++++ packages/daemon/eslint.config.js | 10 ++ packages/daemon/package.json | 36 +++++++ packages/daemon/src/index.ts | 55 ++++++++++ packages/daemon/src/processor.ts | 20 ++++ packages/daemon/src/server.ts | 66 ++++++++++++ packages/daemon/src/trpc.ts | 15 +++ packages/daemon/tsconfig.json | 7 ++ 15 files changed, 418 insertions(+), 194 deletions(-) create mode 100644 apps/cli/src/daemon.ts delete mode 100644 apps/cli/src/server.ts create mode 100644 packages/daemon/.gitignore create mode 100644 packages/daemon/LICENSE create mode 100644 packages/daemon/eslint.config.js create mode 100644 packages/daemon/package.json create mode 100644 packages/daemon/src/index.ts create mode 100644 packages/daemon/src/processor.ts create mode 100644 packages/daemon/src/server.ts create mode 100644 packages/daemon/src/trpc.ts create mode 100644 packages/daemon/tsconfig.json diff --git a/apps/cli/package.json b/apps/cli/package.json index c854a6f8..b04d3fb2 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -17,7 +17,6 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@trpc/client": "^10.45.2", "@types/express": "^4.17.21", "@types/node": "^20.14.5", "esbuild": "^0.23.0", @@ -35,6 +34,7 @@ "@opentrader/bot": "workspace:*", "@opentrader/bot-processor": "workspace:*", "@opentrader/bot-templates": "workspace:*", + "@opentrader/daemon": "workspace:*", "@opentrader/db": "workspace:*", "@opentrader/exchanges": "workspace:*", "@opentrader/logger": "workspace:*", @@ -42,6 +42,7 @@ "@opentrader/tools": "workspace:*", "@opentrader/trpc": "workspace:*", "@prisma/client": "5.15.0", + "@trpc/client": "^10.45.2", "@trpc/server": "^10.45.2", "ccxt": "4.3.27", "commander": "^12.1.0", @@ -49,6 +50,7 @@ "json5": "^2.2.3", "pino": "^9.2.0", "pino-pretty": "^11.2.1", + "superjson": "^1.13.3", "zod": "3.23.8" }, "bin": { diff --git a/apps/cli/src/api/run-trading.ts b/apps/cli/src/api/run-trading.ts index 77bbd3f0..5d89da3e 100644 --- a/apps/cli/src/api/run-trading.ts +++ b/apps/cli/src/api/run-trading.ts @@ -4,7 +4,7 @@ import { logger } from "@opentrader/logger"; import { findStrategy } from "@opentrader/bot-templates/server"; import { ExchangeAccountWithCredentials, xprisma } from "@opentrader/db"; import type { CommandResult, ConfigName } from "../types.js"; -import { createClient } from "../server.js"; +import { createClient } from "../daemon.js"; import { readBotConfig, readExchangesConfig } from "../config.js"; import { createOrUpdateBot, @@ -86,7 +86,7 @@ export async function runTrading( exchangeAccounts, ); - const result = await daemon.startBot.mutate({ botId: bot.id }); + const result = await daemon.bot.start.mutate({ botId: bot.id }); if (result) { logger.info(`Bot "${bot.label}" started succesfully`); @@ -101,7 +101,7 @@ export async function runTrading( async function checkDaemonHealth() { try { - await daemon.healthcheck.query(); + await daemon.public.healhcheck.query(); return true; } catch (err) { diff --git a/apps/cli/src/api/stop-command.ts b/apps/cli/src/api/stop-command.ts index fa90e82a..56761007 100644 --- a/apps/cli/src/api/stop-command.ts +++ b/apps/cli/src/api/stop-command.ts @@ -3,7 +3,7 @@ import { xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; import type { CommandResult, ConfigName } from "../types.js"; import { readBotConfig, readExchangesConfig } from "../config.js"; -import { createClient } from "../server.js"; +import { createClient } from "../daemon.js"; const daemon = createClient(); @@ -44,7 +44,7 @@ export async function stopCommand(options: { } logger.info(`Stopping bot "${bot.label}"...`); - await daemon.stopBot.mutate({ botId: bot.id }); + await daemon.bot.stop.mutate({ botId: bot.id }); logger.info(`Bot "${bot.label}" stopped successfully`); return { diff --git a/apps/cli/src/api/up/daemon.ts b/apps/cli/src/api/up/daemon.ts index 413e56ec..ffc8faee 100644 --- a/apps/cli/src/api/up/daemon.ts +++ b/apps/cli/src/api/up/daemon.ts @@ -1,84 +1,9 @@ -import { Processor } from "@opentrader/bot"; -import { xprisma } from "@opentrader/db"; -import { logger } from "@opentrader/logger"; -import type { BarSize } from "@opentrader/types"; -import type { ConfigName } from "../../types.js"; -import { createServer } from "../../server.js"; +import { Daemon } from "@opentrader/daemon"; -let app: App | null = null; - -class App { - constructor(private processor: Processor) {} - - static async create() { - const exchangeAccounts = await xprisma.exchangeAccount.findMany(); - logger.info(`Found ${exchangeAccounts.length} exchange accounts`); - - const bot = await xprisma.bot.custom.findFirst({ - where: { - label: "default", - }, - }); - logger.info(`Found bot: ${bot ? bot.label : "none"}`); - - const processor = new Processor(exchangeAccounts, bot ? [bot] : []); - await processor.onApplicationBootstrap(); - - return new App(processor); - } - - async destroy() { - if (this.processor) { - await this.processor.beforeApplicationShutdown(); - } - } - - async restart() { - await this.destroy(); - - const exchangeAccounts = await xprisma.exchangeAccount.findMany(); - logger.info(`Found ${exchangeAccounts.length} exchange accounts`); - - const bot = await xprisma.bot.custom.findFirst({ - where: { - label: "default", - }, - }); - logger.info(`Found bot: ${bot ? bot.label : "none"}`); - - const processor = new Processor(exchangeAccounts, bot ? [bot] : []); - await processor.onApplicationBootstrap(); - } -} - -async function createApp() { - app = await App.create(); - logger.info("App created"); - - server.listen(8000); - logger.info("RPC Server started on port 8000"); -} -void createApp(); - -type Options = { - config: ConfigName; - pair?: string; - exchange?: string; - timeframe?: BarSize; -}; - -const server = createServer(); +const daemon = await Daemon.create(); async function shutdown() { - logger.info("SIGTERM received"); - - if (app) { - await app.destroy(); - logger.info("App shutted down gracefully."); - } - - server.close(); - logger.info("Express Server shutted down gracefully."); + await daemon.shutdown(); process.exit(0); } diff --git a/apps/cli/src/daemon.ts b/apps/cli/src/daemon.ts new file mode 100644 index 00000000..26408805 --- /dev/null +++ b/apps/cli/src/daemon.ts @@ -0,0 +1,19 @@ +import superjson from "superjson"; +import { createTRPCProxyClient, httpBatchLink } from "@trpc/client"; +import { appRouter } from "@opentrader/trpc"; + +const DAEMON_URL = "http://localhost:8000/api/trpc"; + +export const createClient = () => { + return createTRPCProxyClient({ + transformer: superjson, + links: [ + httpBatchLink({ + url: DAEMON_URL, + headers: () => ({ + Authorization: process.env.ADMIN_PASSWORD, + }), + }), + ], + }); +}; diff --git a/apps/cli/src/server.ts b/apps/cli/src/server.ts deleted file mode 100644 index 68e1ec9c..00000000 --- a/apps/cli/src/server.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { initTRPC } from "@trpc/server"; -import { createTRPCProxyClient, httpBatchLink } from "@trpc/client"; -import * as trpcExpress from "@trpc/server/adapters/express"; -import type { Express } from "express"; -import express from "express"; -import { z } from "zod"; -import { logger } from "@opentrader/logger"; -import { tServer } from "./trpc.js"; - -const t = initTRPC.create(); - -export const { router, procedure } = t; - -const cliRouter = router({ - startBot: procedure - .input(z.object({ botId: z.number() })) - .mutation(async (opts) => { - const { botId } = opts.input; - - try { - await tServer.bot.start({ botId }); - } catch (err) { - logger.error((err as Error).message); - - return false; - } - - return true; - }), - stopBot: procedure - .input(z.object({ botId: z.number() })) - .mutation(async (opts) => { - const { botId } = opts.input; - - try { - await tServer.bot.stop({ botId }); - } catch (err) { - logger.error((err as Error).message); - - return false; - } - - return true; - }), - healthcheck: procedure.query(async () => { - return true; - }), -}); - -// created for each request -const createContext = ({ - req, - res, -}: trpcExpress.CreateExpressContextOptions) => { - const password = req.headers.authorization; - - if (password === process.env.ADMIN_PASSWORD) { - return { - user: { - id: 1, - password: "huitebe", - email: "nu@nahui", - displayName: "Hui tebe", - role: "Admin" as const, - }, - }; - } - - return { - user: null, - }; -}; - -export function useTrpc(app: Express) { - app.use( - "/api/trpc", - trpcExpress.createExpressMiddleware({ - router: cliRouter, - createContext, - }), - ); -} - -export const app = express(); -useTrpc(app); - -export const createServer = () => { - let server: ReturnType | null = null; - - return { - listen: (port: number, cb?: () => void) => { - server = app.listen(port, cb); - - return server; - }, - close: () => { - server?.close(); - }, - }; -}; - -export const createClient = () => { - return createTRPCProxyClient({ - links: [ - httpBatchLink({ - url: "http://localhost:8000/api/trpc", - }), - ], - }); -}; diff --git a/packages/daemon/.gitignore b/packages/daemon/.gitignore new file mode 100644 index 00000000..f06235c4 --- /dev/null +++ b/packages/daemon/.gitignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/daemon/LICENSE b/packages/daemon/LICENSE new file mode 100644 index 00000000..f433b1a5 --- /dev/null +++ b/packages/daemon/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/packages/daemon/eslint.config.js b/packages/daemon/eslint.config.js new file mode 100644 index 00000000..bf58e5c2 --- /dev/null +++ b/packages/daemon/eslint.config.js @@ -0,0 +1,10 @@ +import EslintConfig from "@opentrader/eslint/module.js"; + +export default [ + ...EslintConfig, + { + rules: { + // overriding rules here + }, + }, +]; diff --git a/packages/daemon/package.json b/packages/daemon/package.json new file mode 100644 index 00000000..15994c48 --- /dev/null +++ b/packages/daemon/package.json @@ -0,0 +1,36 @@ +{ + "name": "@opentrader/daemon", + "version": "0.0.1", + "private": true, + "description": "", + "type": "module", + "main": "src/index.ts", + "types": "src/index.ts", + "scripts": { + "?build": "Internal package", + "lint": "eslint . --quiet", + "lint:fix": "eslint . --fix" + }, + "author": "bludnic", + "license": "Apache-2.0", + "devDependencies": { + "@opentrader/eslint": "workspace:*", + "@opentrader/tsconfig": "workspace:*", + "@opentrader/types": "workspace:*", + "@types/express": "^4.17.21", + "@types/node": "^20.14.5", + "eslint": "8.54.0", + "ts-node": "10.9.2", + "typescript": "5.4.5" + }, + "dependencies": { + "@opentrader/bot": "workspace:*", + "@opentrader/db": "workspace:*", + "@opentrader/logger": "workspace:*", + "@opentrader/trpc": "workspace:*", + "@trpc/client": "^10.45.2", + "@trpc/server": "^10.45.2", + "express": "^4.19.2", + "zod": "3.23.8" + } +} diff --git a/packages/daemon/src/index.ts b/packages/daemon/src/index.ts new file mode 100644 index 00000000..79a48de6 --- /dev/null +++ b/packages/daemon/src/index.ts @@ -0,0 +1,55 @@ +/** + * Copyright 2024 bludnic + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Repository URL: https://github.com/bludnic/opentrader + */ +import { Server } from "node:http"; +import { Processor } from "@opentrader/bot"; +import { logger } from "@opentrader/logger"; +import { createServer } from "./server.js"; +import { createProcessor } from "./processor.js"; + +export class Daemon { + constructor( + private processor: Processor, + private server: Server, + ) {} + + static async create() { + const processor = await createProcessor(); + logger.info("Processor created"); + + const server = createServer().listen(8000); + logger.info("RPC Server started on port 8000"); + + return new Daemon(processor, server); + } + + async restart() { + await this.processor.beforeApplicationShutdown(); + + this.processor = await createProcessor(); + } + + async shutdown() { + logger.info("Shutting down Daemon..."); + + this.server.close(); + logger.info("Express Server shutted down gracefully."); + + await this.processor.beforeApplicationShutdown(); + logger.info("Processor shutted down gracefully."); + } +} diff --git a/packages/daemon/src/processor.ts b/packages/daemon/src/processor.ts new file mode 100644 index 00000000..36474d14 --- /dev/null +++ b/packages/daemon/src/processor.ts @@ -0,0 +1,20 @@ +import { logger } from "@opentrader/logger"; +import { xprisma } from "@opentrader/db"; +import { Processor } from "@opentrader/bot"; + +export async function createProcessor() { + const exchangeAccounts = await xprisma.exchangeAccount.findMany(); + logger.info(`Found ${exchangeAccounts.length} exchange accounts`); + + const bot = await xprisma.bot.custom.findFirst({ + where: { + label: "default", + }, + }); + logger.info(`Found bot: ${bot ? bot.label : "none"}`); + + const processor = new Processor(exchangeAccounts, bot ? [bot] : []); + await processor.onApplicationBootstrap(); + + return processor; +} diff --git a/packages/daemon/src/server.ts b/packages/daemon/src/server.ts new file mode 100644 index 00000000..c59a3913 --- /dev/null +++ b/packages/daemon/src/server.ts @@ -0,0 +1,66 @@ +import * as trpcExpress from "@trpc/server/adapters/express"; +import type { Express } from "express"; +import express from "express"; +import { appRouter } from "@opentrader/trpc"; + +// created for each request +const createContext = ({ + req, + res, +}: trpcExpress.CreateExpressContextOptions) => { + const password = req.headers.authorization; + + if (password === process.env.ADMIN_PASSWORD) { + return { + user: { + id: 1, + password: "huitebe", + email: "nu@nahui", + displayName: "Hui tebe", + role: "Admin" as const, + }, + }; + } + + return { + user: null, + }; +}; + +export function useTrpc(app: Express) { + app.use( + "/api/trpc", + trpcExpress.createExpressMiddleware({ + router: appRouter, + createContext, + }), + ); +} + +export const app = express(); +useTrpc(app); + +export const createServer = () => { + let server: ReturnType | null = null; + + return { + listen: (port: number, cb?: () => void) => { + server = app.listen(port, cb); + + return server; + }, + close: () => { + server?.close(); + }, + }; +}; + +// export const createClient = () => { +// return createTRPCProxyClient({ +// links: [ +// httpBatchLink({ +// url: "http://localhost:8000/api/trpc", +// }), +// ], +// }); +// }; diff --git a/packages/daemon/src/trpc.ts b/packages/daemon/src/trpc.ts new file mode 100644 index 00000000..edf3ac03 --- /dev/null +++ b/packages/daemon/src/trpc.ts @@ -0,0 +1,15 @@ +import { trpc, appRouter } from "@opentrader/trpc"; + +const ctx = { + user: { + id: 1, + password: "huitebe", + email: "nu@nahui", + displayName: "Hui tebe", + role: "Admin" as const, + }, +}; + +const createCaller = trpc.createCallerFactory(appRouter); + +export const tServer = createCaller(ctx); diff --git a/packages/daemon/tsconfig.json b/packages/daemon/tsconfig.json new file mode 100644 index 00000000..7c095f42 --- /dev/null +++ b/packages/daemon/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "@opentrader/tsconfig/esm.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + } +} From c608a2701f4501b5174f9b7d3b122e5cad4ef433 Mon Sep 17 00:00:00 2001 From: bludnic Date: Mon, 8 Jul 2024 23:25:02 +0100 Subject: [PATCH 32/68] chore: upgrade pro package --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index a221e661..8ad7231a 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit a221e6610b7c80cc614a1901831838a7e42e2e6a +Subproject commit 8ad7231a241e8d60a9e55c63e4cc67490ef930e8 From 4f71ab11e0635351e0659bb32fb47c020ed96b34 Mon Sep 17 00:00:00 2001 From: bludnic Date: Tue, 9 Jul 2024 00:23:49 +0100 Subject: [PATCH 33/68] fix(daemon): use EventBus --- packages/daemon/src/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/daemon/src/index.ts b/packages/daemon/src/index.ts index 79a48de6..754f97d1 100644 --- a/packages/daemon/src/index.ts +++ b/packages/daemon/src/index.ts @@ -18,6 +18,7 @@ import { Server } from "node:http"; import { Processor } from "@opentrader/bot"; import { logger } from "@opentrader/logger"; +import { eventBus, EVENT } from "@opentrader/trpc"; import { createServer } from "./server.js"; import { createProcessor } from "./processor.js"; @@ -25,7 +26,17 @@ export class Daemon { constructor( private processor: Processor, private server: Server, - ) {} + ) { + eventBus.on(EVENT.onBotStarted, (bot) => { + console.log("EventBus: Bot started", bot); + void this.processor.onBotStarted(bot); + }); + + eventBus.on(EVENT.onExchangeAccountCreated, (exchangeAccount) => { + console.log("EventBus: Exchange account created", exchangeAccount); + void processor.onExchangeAccountCreated(exchangeAccount); + }); + } static async create() { const processor = await createProcessor(); From 01dcc2073f7a7b0a13d6e4f0460430c6e15304cf Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 08:42:08 +0100 Subject: [PATCH 34/68] fix(daemon): enable CORS for express server --- packages/daemon/src/server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/daemon/src/server.ts b/packages/daemon/src/server.ts index c59a3913..6c9fe124 100644 --- a/packages/daemon/src/server.ts +++ b/packages/daemon/src/server.ts @@ -1,6 +1,7 @@ import * as trpcExpress from "@trpc/server/adapters/express"; import type { Express } from "express"; import express from "express"; +import cors from "cors"; import { appRouter } from "@opentrader/trpc"; // created for each request @@ -21,7 +22,7 @@ const createContext = ({ }, }; } - + ``; return { user: null, }; @@ -38,6 +39,7 @@ export function useTrpc(app: Express) { } export const app = express(); +app.use(cors()); useTrpc(app); export const createServer = () => { From d84dd12e3184f01756ae89ff4c4e8283f7271f8e Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 08:42:44 +0100 Subject: [PATCH 35/68] chore(tools): import as Internal Package --- packages/tools/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tools/package.json b/packages/tools/package.json index 12352be3..029cca1b 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -3,8 +3,8 @@ "version": "0.0.1", "description": "", "type": "module", - "main": "dist/index.cjs", - "types": "dist/index.d.cts", + "main": "src/index.ts", + "types": "src/index.ts", "scripts": { "test": "jest", "build": "tsup --dts", From 6d848fb82b2da1174f9883b326a61efbb0909fab Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 08:42:56 +0100 Subject: [PATCH 36/68] chore(types): import as Internal Package --- packages/types/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/types/package.json b/packages/types/package.json index bd525ae6..f494d153 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -3,8 +3,8 @@ "version": "0.0.1", "description": "", "type": "module", - "main": "dist/index.cjs", - "types": "dist/index.d.cts", + "main": "src/index.ts", + "types": "src/index.ts", "scripts": { "build": "tsup --dts", "lint": "eslint . --quiet", From 69a0cd45af5d56d90878539cfb47246a586c36c8 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 10:32:08 +0100 Subject: [PATCH 37/68] refactor(cli): update comment --- apps/cli/tsup.config.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/cli/tsup.config.ts b/apps/cli/tsup.config.ts index e53b6597..e828d907 100644 --- a/apps/cli/tsup.config.ts +++ b/apps/cli/tsup.config.ts @@ -23,8 +23,7 @@ export default defineConfig({ env: { NODE_ENV: "production", }, - // noExternal: [/(.*)/], - noExternal: [/@opentrader/], // Include node_modules in the bundle + noExternal: [/@opentrader/], // Include internal packages into the bundle outExtension: ({ format }) => { if (format === "esm") return { js: ".mjs" }; if (format === "cjs") return { js: ".cjs" }; From 08b0d909bafb6e6345b07ea6096e5b75f7f73850 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 10:40:50 +0100 Subject: [PATCH 38/68] chore: update pro package --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index 8ad7231a..c3bdc0ff 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit 8ad7231a241e8d60a9e55c63e4cc67490ef930e8 +Subproject commit c3bdc0ff74a0981431b4fae7da7dfdf33b81ad2f From d5e3205a99ddb81055ca8ffca98e6b88ee29a615 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 10:45:04 +0100 Subject: [PATCH 39/68] fix(daemon): add missing dependencies --- packages/daemon/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/daemon/package.json b/packages/daemon/package.json index 15994c48..303201ed 100644 --- a/packages/daemon/package.json +++ b/packages/daemon/package.json @@ -17,6 +17,7 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", + "@types/cors": "^2.8.17", "@types/express": "^4.17.21", "@types/node": "^20.14.5", "eslint": "8.54.0", @@ -30,6 +31,7 @@ "@opentrader/trpc": "workspace:*", "@trpc/client": "^10.45.2", "@trpc/server": "^10.45.2", + "cors": "^2.8.5", "express": "^4.19.2", "zod": "3.23.8" } From 9820f49c0b521d89600109bdacbeb202e597ced6 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 10:45:27 +0100 Subject: [PATCH 40/68] chore(ENV): enable tRPC by default --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 11266ee1..1b82a02a 100644 --- a/.env.example +++ b/.env.example @@ -4,10 +4,10 @@ NEXT_PUBLIC_PROCESSOR_URL="http://localhost:4000" # If `true`, then tRPC will be provided by `processor` app. # If `false`, then `frontend` app will instantiate the tRPC client by itself using Next API Routes # Accepts: "true" | "" -NEXT_PUBLIC_PROCESSOR_ENABLE_TRPC= +NEXT_PUBLIC_PROCESSOR_ENABLE_TRPC=true # Build NextJS as a static app (`export`) instead of `standalone` # Accepts: "true" | "" -NEXT_PUBLIC_STATIC= +NEXT_PUBLIC_STATIC=true DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:5432/postgres" ADMIN_PASSWORD=opentrader NEXT_PUBLIC_CANDLES_SERVICE_API_URL="http://localhost:5001" From a2d8e24ca917e77173e6c7e6b0de088c09781483 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 10:48:40 +0100 Subject: [PATCH 41/68] chore: update pro package --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index c3bdc0ff..381a4cca 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit c3bdc0ff74a0981431b4fae7da7dfdf33b81ad2f +Subproject commit 381a4cca0fc8db68f1cbbced78a81cd37057cba6 From 1d23f0bb25a27878cf22ae148ca470eb22a11af2 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 10:51:29 +0100 Subject: [PATCH 42/68] chore(opentrader.sh): rename binary to not confuse with NPM version --- bin/{opentrader.sh => devtrader.sh} | 0 package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename bin/{opentrader.sh => devtrader.sh} (100%) diff --git a/bin/opentrader.sh b/bin/devtrader.sh similarity index 100% rename from bin/opentrader.sh rename to bin/devtrader.sh diff --git a/package.json b/package.json index 0b92ebad..3735d716 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ }, "bin": { "dev": "./bin/dev.sh", - "opentrader": "./bin/opentrader.sh" + "devtrader": "./bin/devtrader.sh" } } From bb93a6168219048327a17a00e16dadd1182d79f9 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 11:22:01 +0100 Subject: [PATCH 43/68] chore: upgrade pnpm to 9.5.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3735d716..6fbff868 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "engines": { "node": ">=18.0.0" }, - "packageManager": "pnpm@9.4.0", + "packageManager": "pnpm@9.5.0", "devDependencies": { "prettier": "^3.3.2", "ts-node": "10.9.2", From 8cf1c2af9821426186078bc73f8c6cd952794399 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 11:24:33 +0100 Subject: [PATCH 44/68] chore(bin): update clean.sh script --- bin/clean.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/clean.sh b/bin/clean.sh index 92126b8d..2c8c03c4 100755 --- a/bin/clean.sh +++ b/bin/clean.sh @@ -3,7 +3,7 @@ # Function to remove specified directories remove_directories() { local dir=$1 - local dirs_to_remove=("node_modules" "dist" ".next" ".turbo") + local dirs_to_remove=("node_modules" "dist" ".turbo") for sub_dir in "${dirs_to_remove[@]}"; do if [ -d "$dir/$sub_dir" ]; then echo "Removing ${dir%/}/$sub_dir..." From 490e49a37eb1053295c9cc8dc0ab8b11e2f491f3 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 12:31:10 +0100 Subject: [PATCH 45/68] chore: upgrade deps --- apps/cli/package.json | 14 +- package.json | 2 +- packages/backtesting/package.json | 8 +- packages/bot-processor/package.json | 6 +- packages/bot-templates/package.json | 8 +- packages/bot/package.json | 8 +- packages/daemon/package.json | 6 +- packages/db/package.json | 6 +- packages/eslint-config/LICENSE | 177 -------------------------- packages/eslint-config/module.js | 29 ----- packages/eslint-config/next.js | 42 ------ packages/eslint-config/package.json | 28 ---- packages/eslint-config/rules/rules.js | 49 ------- packages/eslint/package.json | 8 +- packages/exchanges/package.json | 8 +- packages/indicators/package.json | 8 +- packages/logger/package.json | 8 +- packages/prisma/package.json | 4 +- packages/processing/package.json | 12 +- packages/tools/package.json | 6 +- packages/trpc/package.json | 10 +- packages/types/package.json | 4 +- 22 files changed, 63 insertions(+), 388 deletions(-) delete mode 100644 packages/eslint-config/LICENSE delete mode 100644 packages/eslint-config/module.js delete mode 100644 packages/eslint-config/next.js delete mode 100644 packages/eslint-config/package.json delete mode 100644 packages/eslint-config/rules/rules.js diff --git a/apps/cli/package.json b/apps/cli/package.json index b04d3fb2..321a77b1 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -18,14 +18,14 @@ "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/express": "^4.17.21", - "@types/node": "^20.14.5", + "@types/node": "^20.14.10", "esbuild": "^0.23.0", - "eslint": "8.54.0", + "eslint": "8.57.0", "ts-loader": "^9.5.1", "ts-node": "10.9.2", "tsup": "^8.1.0", - "typescript": "5.4.5", - "webpack": "^5.92.0", + "typescript": "5.5.3", + "webpack": "^5.92.1", "webpack-cli": "^5.1.4", "webpack-node-externals": "^3.0.0" }, @@ -41,16 +41,16 @@ "@opentrader/processing": "workspace:*", "@opentrader/tools": "workspace:*", "@opentrader/trpc": "workspace:*", - "@prisma/client": "5.15.0", + "@prisma/client": "5.16.2", "@trpc/client": "^10.45.2", "@trpc/server": "^10.45.2", - "ccxt": "4.3.27", + "ccxt": "4.3.59", "commander": "^12.1.0", "express": "^4.19.2", "json5": "^2.2.3", "pino": "^9.2.0", "pino-pretty": "^11.2.1", - "superjson": "^1.13.3", + "superjson": "^2.2.1", "zod": "3.23.8" }, "bin": { diff --git a/package.json b/package.json index 6fbff868..418c4653 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "devDependencies": { "prettier": "^3.3.2", "ts-node": "10.9.2", - "turbo": "^2.0.4" + "turbo": "^2.0.6" }, "scripts": { "lint": "turbo run lint", diff --git a/packages/backtesting/package.json b/packages/backtesting/package.json index c6c67bda..2bca7e29 100644 --- a/packages/backtesting/package.json +++ b/packages/backtesting/package.json @@ -17,10 +17,10 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/lodash": "^4.17.5", - "@types/node": "^20.14.5", - "eslint": "8.54.0", - "typescript": "5.4.5" + "@types/lodash": "^4.17.6", + "@types/node": "^20.14.10", + "eslint": "8.57.0", + "typescript": "5.5.3" }, "dependencies": { "@opentrader/bot-processor": "workspace:*", diff --git a/packages/bot-processor/package.json b/packages/bot-processor/package.json index 31f24ef5..5674bba3 100644 --- a/packages/bot-processor/package.json +++ b/packages/bot-processor/package.json @@ -17,11 +17,11 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.14.5", - "eslint": "8.54.0", + "@types/node": "^20.14.10", + "eslint": "8.57.0", "ts-node": "10.9.2", "tslib": "^2.6.3", - "typescript": "5.4.5" + "typescript": "5.5.3" }, "dependencies": { "@opentrader/exchanges": "workspace:*", diff --git a/packages/bot-templates/package.json b/packages/bot-templates/package.json index c9bd5109..c8365e41 100644 --- a/packages/bot-templates/package.json +++ b/packages/bot-templates/package.json @@ -25,11 +25,11 @@ "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/jest": "^29.5.12", - "@types/node": "^20.14.5", - "eslint": "8.54.0", + "@types/node": "^20.14.10", + "eslint": "8.57.0", "jest": "^29.7.0", - "ts-jest": "^29.1.5", - "typescript": "5.4.5" + "ts-jest": "^29.2.1", + "typescript": "5.5.3" }, "dependencies": { "@opentrader/bot-processor": "workspace:*", diff --git a/packages/bot/package.json b/packages/bot/package.json index d88dbc40..20bb34bf 100644 --- a/packages/bot/package.json +++ b/packages/bot/package.json @@ -18,10 +18,10 @@ "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/async": "^3.2.24", - "@types/node": "^20.14.5", - "eslint": "8.54.0", + "@types/node": "^20.14.10", + "eslint": "8.57.0", "ts-node": "10.9.2", - "typescript": "5.4.5" + "typescript": "5.5.3" }, "dependencies": { "@opentrader/bot-templates": "workspace:*", @@ -31,7 +31,7 @@ "@opentrader/processing": "workspace:*", "@opentrader/tools": "workspace:*", "async": "^3.2.5", - "ccxt": "4.3.27", + "ccxt": "4.3.59", "cron": "^3.1.7" } } diff --git a/packages/daemon/package.json b/packages/daemon/package.json index 303201ed..7e9e4eb6 100644 --- a/packages/daemon/package.json +++ b/packages/daemon/package.json @@ -19,10 +19,10 @@ "@opentrader/types": "workspace:*", "@types/cors": "^2.8.17", "@types/express": "^4.17.21", - "@types/node": "^20.14.5", - "eslint": "8.54.0", + "@types/node": "^20.14.10", + "eslint": "8.57.0", "ts-node": "10.9.2", - "typescript": "5.4.5" + "typescript": "5.5.3" }, "dependencies": { "@opentrader/bot": "workspace:*", diff --git a/packages/db/package.json b/packages/db/package.json index bee97475..7cb2132b 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -17,9 +17,9 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.14.5", - "eslint": "8.54.0", - "typescript": "5.4.5" + "@types/node": "^20.14.10", + "eslint": "8.57.0", + "typescript": "5.5.3" }, "dependencies": { "@opentrader/prisma": "workspace:*", diff --git a/packages/eslint-config/LICENSE b/packages/eslint-config/LICENSE deleted file mode 100644 index f433b1a5..00000000 --- a/packages/eslint-config/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/packages/eslint-config/module.js b/packages/eslint-config/module.js deleted file mode 100644 index c2c8d60e..00000000 --- a/packages/eslint-config/module.js +++ /dev/null @@ -1,29 +0,0 @@ -const { resolve } = require("node:path"); -const rules = require("./rules/rules"); - -const project = resolve(process.cwd(), "tsconfig.json"); - -module.exports = { - extends: [ - "@vercel/style-guide/eslint/node", - "@vercel/style-guide/eslint/typescript", - "@vercel/style-guide/eslint/browser", - ].map(require.resolve), - parserOptions: { - project, - }, - globals: { - React: true, - JSX: true, - }, - settings: { - "import/resolver": { - typescript: { - project, - }, - }, - }, - ignorePatterns: ["node_modules/", "dist/", "*.spec.*"], - // add rules configurations here - rules, -}; diff --git a/packages/eslint-config/next.js b/packages/eslint-config/next.js deleted file mode 100644 index 10a0fcb9..00000000 --- a/packages/eslint-config/next.js +++ /dev/null @@ -1,42 +0,0 @@ -const { resolve } = require("node:path"); -const rules = require("./rules/rules"); - -const project = resolve(process.cwd(), "tsconfig.json"); - -/* - * This is a custom ESLint configuration for use with - * Next.js apps. - * - * This config extends the Vercel Engineering Style Guide. - * For more information, see https://github.com/vercel/style-guide - * - */ -module.exports = { - extends: [ - "@vercel/style-guide/eslint/node", - "@vercel/style-guide/eslint/typescript", - "@vercel/style-guide/eslint/browser", - "@vercel/style-guide/eslint/react", - "@vercel/style-guide/eslint/next", - // turborepo custom eslint configuration configures the following rules: - // - https://github.com/vercel/turbo/blob/main/packages/eslint-plugin-turbo/docs/rules/no-undeclared-env-vars.md - "eslint-config-turbo", - ].map(require.resolve), - parserOptions: { - project, - }, - globals: { - React: true, - JSX: true, - }, - settings: { - "import/resolver": { - typescript: { - project, - }, - }, - }, - ignorePatterns: ["node_modules/", "dist/", "*.spec.*", "out/"], - // add rules configurations here - rules, -}; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json deleted file mode 100644 index efdc6e16..00000000 --- a/packages/eslint-config/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@opentrader/eslint-config", - "description": "ESLint configuration from OpenTrader", - "version": "0.0.2", - "repository": { - "type": "git", - "url": "git+https://github.com/Open-Trader/opentrader.git" - }, - "files": [ - "module.js", - "next.js" - ], - "devDependencies": { - "@vercel/style-guide": "5.2.0", - "eslint-config-turbo": "1.13.3", - "typescript": "5.4.5" - }, - "keywords": [ - "tsconfig", - "opentrader" - ], - "author": "bludnic", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/Open-Trader/opentrader/issues" - }, - "homepage": "https://github.com/Open-Trader/opentrader/tree/master/packages/eslint-config" -} diff --git a/packages/eslint-config/rules/rules.js b/packages/eslint-config/rules/rules.js deleted file mode 100644 index 2a7f1102..00000000 --- a/packages/eslint-config/rules/rules.js +++ /dev/null @@ -1,49 +0,0 @@ -module.exports = { - // errors - "import/no-default-export": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/require-await": "off", - "react-hooks/exhaustive-deps": 0, - "@typescript-eslint/consistent-type-definitions": "off", - "react/function-component-definition": "off", - "unicorn/filename-case": "off", - "no-duplicate-imports": "off", - "no-nested-ternary": "off", - "no-implicit-coercion": [ - "error", - { - allow: ["!!"], - }, - ], - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-confusing-void-expression": "off", - "@typescript-eslint/no-shadow": "off", - "turbo/no-undeclared-env-vars": "off", - "no-await-in-loop": "off", - "@typescript-eslint/no-misused-promises": ["off"], - "no-promise-executor-return": "off", - "@typescript-eslint/no-extraneous-class": "off", - "@typescript-eslint/naming-convention": "off", - "@typescript-eslint/no-unnecessary-condition": "off", - "@typescript-eslint/no-meaningless-void-operator": "off", - camelcase: "off", - "import/no-cycle": "off", // @todo investigate and enable the rule - "@typescript-eslint/no-unsafe-assignment": "off", // false positives, probably a bug in the rule - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/array-type": "off", - - // warnings - "import/no-named-as-default-member": "off", - "import/no-named-as-default": "off", - "no-console": [ - "warn", - { - allow: ["warn", "error", "debug"], - }, - ], - "@typescript-eslint/no-unused-vars": "warn", - "no-unused-vars": "warn", - "require-yield": "off", - "import/namespace": "off", -}; diff --git a/packages/eslint/package.json b/packages/eslint/package.json index 383b6e6e..e1cb8fd0 100644 --- a/packages/eslint/package.json +++ b/packages/eslint/package.json @@ -12,11 +12,11 @@ "next.js" ], "devDependencies": { - "@eslint/js": "^9.5.0", + "@eslint/js": "^9.6.0", "@types/eslint__js": "^8.42.3", - "eslint": "^8.57.0", - "typescript": "5.4.5", - "typescript-eslint": "^7.13.1" + "eslint": "8.57.0", + "typescript": "5.5.3", + "typescript-eslint": "^7.16.0" }, "keywords": [ "tsconfig", diff --git a/packages/exchanges/package.json b/packages/exchanges/package.json index dbd6cf12..143a5bbf 100644 --- a/packages/exchanges/package.json +++ b/packages/exchanges/package.json @@ -23,13 +23,13 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.14.5", - "eslint": "8.54.0", - "typescript": "5.4.5" + "@types/node": "^20.14.10", + "eslint": "8.57.0", + "typescript": "5.5.3" }, "dependencies": { "@opentrader/db": "workspace:*", "@opentrader/tools": "workspace:*", - "ccxt": "4.3.27" + "ccxt": "4.3.59" } } diff --git a/packages/indicators/package.json b/packages/indicators/package.json index 17c8f06d..e5b3260f 100644 --- a/packages/indicators/package.json +++ b/packages/indicators/package.json @@ -20,12 +20,12 @@ "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/jest": "^29.5.12", - "@types/node": "^20.14.5", - "eslint": "8.54.0", + "@types/node": "^20.14.10", + "eslint": "8.57.0", "jest": "^29.7.0", - "ts-jest": "^29.1.5", + "ts-jest": "^29.2.1", "ts-node": "10.9.2", - "typescript": "5.4.5" + "typescript": "5.5.3" }, "dependencies": { "technicalindicators": "^3.1.0" diff --git a/packages/logger/package.json b/packages/logger/package.json index 69e8ac43..56828428 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -17,13 +17,13 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.14.5", - "eslint": "8.54.0", + "@types/node": "^20.14.10", + "eslint": "8.57.0", "ts-node": "10.9.2", - "typescript": "5.4.5" + "typescript": "5.5.3" }, "dependencies": { - "chalk": "^4.1.2", + "chalk": "^5.3.0", "pino": "^9.2.0", "pino-pretty": "^11.2.1" } diff --git a/packages/prisma/package.json b/packages/prisma/package.json index f48b9e72..9ea545f9 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -18,9 +18,9 @@ "license": "Apache-2.0", "devDependencies": { "@opentrader/tsconfig": "workspace:*", - "@types/node": "^20.14.5", + "@types/node": "^20.14.10", "ts-node": "10.9.2", - "typescript": "5.4.5" + "typescript": "5.5.3" }, "dependencies": { "@opentrader/tools": "workspace:*", diff --git a/packages/processing/package.json b/packages/processing/package.json index 8855f780..6013ebdd 100644 --- a/packages/processing/package.json +++ b/packages/processing/package.json @@ -16,15 +16,15 @@ "license": "Apache-2.0", "devDependencies": { "@jest/globals": "^29.7.0", - "@opentrader/eslint-config": "workspace:*", + "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", "@types/jest": "^29.5.12", - "@types/node": "^20.14.5", - "eslint": "8.54.0", + "@types/node": "^20.14.10", + "eslint": "8.57.0", "jest": "^29.7.0", - "ts-jest": "^29.1.5", - "typescript": "5.4.5" + "ts-jest": "^29.2.1", + "typescript": "5.5.3" }, "dependencies": { "@opentrader/bot-processor": "workspace:*", @@ -33,6 +33,6 @@ "@opentrader/exchanges": "workspace:*", "@opentrader/logger": "workspace:*", "@prisma/client": "5.15.0", - "ccxt": "4.3.27" + "ccxt": "4.3.59" } } diff --git a/packages/tools/package.json b/packages/tools/package.json index 029cca1b..9709f13b 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -19,11 +19,11 @@ "@opentrader/tsconfig": "workspace:*", "@types/big.js": "^6.2.2", "@types/jest": "^29.5.12", - "eslint": "8.54.0", + "eslint": "8.57.0", "jest": "^29.7.0", - "ts-jest": "^29.1.5", + "ts-jest": "^29.2.1", "tsup": "^8.1.0", - "typescript": "5.4.5" + "typescript": "5.5.3" }, "dependencies": { "@opentrader/types": "workspace:*", diff --git a/packages/trpc/package.json b/packages/trpc/package.json index 8d86c96e..b80c30e5 100644 --- a/packages/trpc/package.json +++ b/packages/trpc/package.json @@ -17,9 +17,9 @@ "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", "@opentrader/types": "workspace:*", - "@types/node": "^20.14.5", - "eslint": "8.54.0", - "typescript": "5.4.5" + "@types/node": "^20.14.10", + "eslint": "8.57.0", + "typescript": "5.5.3" }, "dependencies": { "@opentrader/bot-processor": "workspace:*", @@ -30,8 +30,8 @@ "@opentrader/processing": "workspace:*", "@opentrader/tools": "workspace:*", "@trpc/server": "^10.45.2", - "ccxt": "4.3.27", - "superjson": "^1.13.3", + "ccxt": "4.3.59", + "superjson": "^2.2.1", "zod": "3.23.8" } } diff --git a/packages/types/package.json b/packages/types/package.json index f494d153..5207b78e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -15,8 +15,8 @@ "devDependencies": { "@opentrader/eslint": "workspace:*", "@opentrader/tsconfig": "workspace:*", - "eslint": "8.54.0", + "eslint": "8.57.0", "tsup": "^8.1.0", - "typescript": "5.4.5" + "typescript": "5.5.3" } } From 0ca30fff6367dbf160bc5a0366fba7bab80b6b4b Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 12:31:18 +0100 Subject: [PATCH 46/68] chore: update pro package --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index 381a4cca..b5ee3934 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit 381a4cca0fc8db68f1cbbced78a81cd37057cba6 +Subproject commit b5ee393485d405ce2e01d31d636efd8a3683d265 From aee9cabce9d6702663d2bde6695b088bd9ee6e2e Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 12:32:07 +0100 Subject: [PATCH 47/68] chore: commit pnpm-lock.yaml --- pnpm-lock.yaml | 7095 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 7095 insertions(+) create mode 100644 pnpm-lock.yaml diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 00000000..c53db609 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,7095 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + prettier: + specifier: ^3.3.2 + version: 3.3.2 + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + turbo: + specifier: ^2.0.6 + version: 2.0.6 + + apps/cli: + dependencies: + '@opentrader/backtesting': + specifier: workspace:* + version: link:../../packages/backtesting + '@opentrader/bot': + specifier: workspace:* + version: link:../../packages/bot + '@opentrader/bot-processor': + specifier: workspace:* + version: link:../../packages/bot-processor + '@opentrader/bot-templates': + specifier: workspace:* + version: link:../../packages/bot-templates + '@opentrader/daemon': + specifier: workspace:* + version: link:../../packages/daemon + '@opentrader/db': + specifier: workspace:* + version: link:../../packages/db + '@opentrader/exchanges': + specifier: workspace:* + version: link:../../packages/exchanges + '@opentrader/logger': + specifier: workspace:* + version: link:../../packages/logger + '@opentrader/processing': + specifier: workspace:* + version: link:../../packages/processing + '@opentrader/tools': + specifier: workspace:* + version: link:../../packages/tools + '@opentrader/trpc': + specifier: workspace:* + version: link:../../packages/trpc + '@prisma/client': + specifier: 5.16.2 + version: 5.16.2(prisma@5.15.0) + '@trpc/client': + specifier: ^10.45.2 + version: 10.45.2(@trpc/server@10.45.2) + '@trpc/server': + specifier: ^10.45.2 + version: 10.45.2 + ccxt: + specifier: 4.3.59 + version: 4.3.59 + commander: + specifier: ^12.1.0 + version: 12.1.0 + express: + specifier: ^4.19.2 + version: 4.19.2 + json5: + specifier: ^2.2.3 + version: 2.2.3 + pino: + specifier: ^9.2.0 + version: 9.2.0 + pino-pretty: + specifier: ^11.2.1 + version: 11.2.1 + superjson: + specifier: ^2.2.1 + version: 2.2.1 + zod: + specifier: 3.23.8 + version: 3.23.8 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../../packages/eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../../packages/tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../../packages/types + '@types/express': + specifier: ^4.17.21 + version: 4.17.21 + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + esbuild: + specifier: ^0.23.0 + version: 0.23.0 + eslint: + specifier: 8.57.0 + version: 8.57.0 + ts-loader: + specifier: ^9.5.1 + version: 9.5.1(typescript@5.5.3)(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4)) + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + tsup: + specifier: ^8.1.0 + version: 8.1.0(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + webpack: + specifier: ^5.92.1 + version: 5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4) + webpack-cli: + specifier: ^5.1.4 + version: 5.1.4(webpack@5.92.1) + webpack-node-externals: + specifier: ^3.0.0 + version: 3.0.0 + + packages/backtesting: + dependencies: + '@opentrader/bot-processor': + specifier: workspace:* + version: link:../bot-processor + '@opentrader/exchanges': + specifier: workspace:* + version: link:../exchanges + '@opentrader/logger': + specifier: workspace:* + version: link:../logger + '@opentrader/tools': + specifier: workspace:* + version: link:../tools + lodash: + specifier: ^4.17.21 + version: 4.17.21 + table: + specifier: ^6.8.2 + version: 6.8.2 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/lodash': + specifier: ^4.17.6 + version: 4.17.6 + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/bot: + dependencies: + '@opentrader/bot-templates': + specifier: workspace:* + version: link:../bot-templates + '@opentrader/db': + specifier: workspace:* + version: link:../db + '@opentrader/exchanges': + specifier: workspace:* + version: link:../exchanges + '@opentrader/logger': + specifier: workspace:* + version: link:../logger + '@opentrader/processing': + specifier: workspace:* + version: link:../processing + '@opentrader/tools': + specifier: workspace:* + version: link:../tools + async: + specifier: ^3.2.5 + version: 3.2.5 + ccxt: + specifier: 4.3.59 + version: 4.3.59 + cron: + specifier: ^3.1.7 + version: 3.1.7 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/async': + specifier: ^3.2.24 + version: 3.2.24 + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/bot-processor: + dependencies: + '@opentrader/exchanges': + specifier: workspace:* + version: link:../exchanges + '@opentrader/indicators': + specifier: workspace:* + version: link:../indicators + '@opentrader/tools': + specifier: workspace:* + version: link:../tools + zod: + specifier: 3.23.8 + version: 3.23.8 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + tslib: + specifier: ^2.6.3 + version: 2.6.3 + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/bot-templates: + dependencies: + '@opentrader/bot-processor': + specifier: workspace:* + version: link:../bot-processor + '@opentrader/exchanges': + specifier: workspace:* + version: link:../exchanges + '@opentrader/logger': + specifier: workspace:* + version: link:../logger + '@opentrader/tools': + specifier: workspace:* + version: link:../tools + zod: + specifier: 3.23.8 + version: 3.23.8 + devDependencies: + '@jest/globals': + specifier: ^29.7.0 + version: 29.7.0 + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + ts-jest: + specifier: ^29.2.1 + version: 29.2.1(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)))(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/daemon: + dependencies: + '@opentrader/bot': + specifier: workspace:* + version: link:../bot + '@opentrader/db': + specifier: workspace:* + version: link:../db + '@opentrader/logger': + specifier: workspace:* + version: link:../logger + '@opentrader/trpc': + specifier: workspace:* + version: link:../trpc + '@trpc/client': + specifier: ^10.45.2 + version: 10.45.2(@trpc/server@10.45.2) + '@trpc/server': + specifier: ^10.45.2 + version: 10.45.2 + cors: + specifier: ^2.8.5 + version: 2.8.5 + express: + specifier: ^4.19.2 + version: 4.19.2 + zod: + specifier: 3.23.8 + version: 3.23.8 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/cors': + specifier: ^2.8.17 + version: 2.8.17 + '@types/express': + specifier: ^4.17.21 + version: 4.17.21 + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/db: + dependencies: + '@opentrader/prisma': + specifier: workspace:* + version: link:../prisma + '@prisma/client': + specifier: 5.15.0 + version: 5.15.0(prisma@5.15.0) + zod: + specifier: 3.23.8 + version: 3.23.8 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/eslint: + devDependencies: + '@eslint/js': + specifier: ^9.6.0 + version: 9.6.0 + '@types/eslint__js': + specifier: ^8.42.3 + version: 8.42.3 + eslint: + specifier: 8.57.0 + version: 8.57.0 + typescript: + specifier: 5.5.3 + version: 5.5.3 + typescript-eslint: + specifier: ^7.16.0 + version: 7.16.0(eslint@8.57.0)(typescript@5.5.3) + + packages/exchanges: + dependencies: + '@opentrader/db': + specifier: workspace:* + version: link:../db + '@opentrader/tools': + specifier: workspace:* + version: link:../tools + ccxt: + specifier: 4.3.59 + version: 4.3.59 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/indicators: + dependencies: + technicalindicators: + specifier: ^3.1.0 + version: 3.1.0 + devDependencies: + '@jest/globals': + specifier: ^29.7.0 + version: 29.7.0 + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + ts-jest: + specifier: ^29.2.1 + version: 29.2.1(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)))(typescript@5.5.3) + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/logger: + dependencies: + chalk: + specifier: ^5.3.0 + version: 5.3.0 + pino: + specifier: ^9.2.0 + version: 9.2.0 + pino-pretty: + specifier: ^11.2.1 + version: 11.2.1 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/prisma: + dependencies: + '@opentrader/tools': + specifier: workspace:* + version: link:../tools + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@prisma/client': + specifier: 5.15.0 + version: 5.15.0(prisma@5.15.0) + prisma: + specifier: 5.15.0 + version: 5.15.0 + zod: + specifier: 3.23.8 + version: 3.23.8 + zod-prisma-types: + specifier: 3.1.8 + version: 3.1.8 + devDependencies: + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/processing: + dependencies: + '@opentrader/bot-processor': + specifier: workspace:* + version: link:../bot-processor + '@opentrader/bot-templates': + specifier: workspace:* + version: link:../bot-templates + '@opentrader/db': + specifier: workspace:* + version: link:../db + '@opentrader/exchanges': + specifier: workspace:* + version: link:../exchanges + '@opentrader/logger': + specifier: workspace:* + version: link:../logger + '@prisma/client': + specifier: 5.15.0 + version: 5.15.0(prisma@5.15.0) + ccxt: + specifier: 4.3.59 + version: 4.3.59 + devDependencies: + '@jest/globals': + specifier: ^29.7.0 + version: 29.7.0 + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + ts-jest: + specifier: ^29.2.1 + version: 29.2.1(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)))(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/tools: + dependencies: + '@opentrader/types': + specifier: workspace:* + version: link:../types + big.js: + specifier: ^6.2.1 + version: 6.2.1 + devDependencies: + '@jest/globals': + specifier: ^29.7.0 + version: 29.7.0 + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@types/big.js': + specifier: ^6.2.2 + version: 6.2.2 + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + eslint: + specifier: 8.57.0 + version: 8.57.0 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + ts-jest: + specifier: ^29.2.1 + version: 29.2.1(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)))(typescript@5.5.3) + tsup: + specifier: ^8.1.0 + version: 8.1.0(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/trpc: + dependencies: + '@opentrader/bot-processor': + specifier: workspace:* + version: link:../bot-processor + '@opentrader/bot-templates': + specifier: workspace:* + version: link:../bot-templates + '@opentrader/db': + specifier: workspace:* + version: link:../db + '@opentrader/exchanges': + specifier: workspace:* + version: link:../exchanges + '@opentrader/prisma': + specifier: workspace:* + version: link:../prisma + '@opentrader/processing': + specifier: workspace:* + version: link:../processing + '@opentrader/tools': + specifier: workspace:* + version: link:../tools + '@trpc/server': + specifier: ^10.45.2 + version: 10.45.2 + ccxt: + specifier: 4.3.59 + version: 4.3.59 + superjson: + specifier: ^2.2.1 + version: 2.2.1 + zod: + specifier: 3.23.8 + version: 3.23.8 + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@opentrader/types': + specifier: workspace:* + version: link:../types + '@types/node': + specifier: ^20.14.10 + version: 20.14.10 + eslint: + specifier: 8.57.0 + version: 8.57.0 + typescript: + specifier: 5.5.3 + version: 5.5.3 + + packages/tsconfig: {} + + packages/types: + devDependencies: + '@opentrader/eslint': + specifier: workspace:* + version: link:../eslint + '@opentrader/tsconfig': + specifier: workspace:* + version: link:../tsconfig + eslint: + specifier: 8.57.0 + version: 8.57.0 + tsup: + specifier: ^8.1.0 + version: 8.1.0(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))(typescript@5.5.3) + typescript: + specifier: 5.5.3 + version: 5.5.3 + +packages: + + '@ampproject/remapping@2.3.0': + resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} + engines: {node: '>=6.0.0'} + + '@babel/code-frame@7.24.7': + resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.24.7': + resolution: {integrity: sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.24.7': + resolution: {integrity: sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.24.7': + resolution: {integrity: sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.24.7': + resolution: {integrity: sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-environment-visitor@7.24.7': + resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-function-name@7.24.7': + resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-hoist-variables@7.24.7': + resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.24.7': + resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.24.7': + resolution: {integrity: sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-plugin-utils@7.24.7': + resolution: {integrity: sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-simple-access@7.24.7': + resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-split-export-declaration@7.24.7': + resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.24.7': + resolution: {integrity: sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.24.7': + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.24.7': + resolution: {integrity: sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.24.7': + resolution: {integrity: sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==} + engines: {node: '>=6.9.0'} + + '@babel/highlight@7.24.7': + resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.24.7': + resolution: {integrity: sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-syntax-async-generators@7.8.4': + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-bigint@7.8.3': + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-class-properties@7.12.13': + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-meta@7.10.4': + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-json-strings@7.8.3': + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-jsx@7.24.7': + resolution: {integrity: sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4': + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-numeric-separator@7.10.4': + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-object-rest-spread@7.8.3': + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3': + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-optional-chaining@7.8.3': + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-top-level-await@7.14.5': + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-typescript@7.24.7': + resolution: {integrity: sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/runtime@7.24.7': + resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} + engines: {node: '>=6.9.0'} + + '@babel/template@7.24.7': + resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.24.7': + resolution: {integrity: sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.24.7': + resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} + engines: {node: '>=6.9.0'} + + '@bcoe/v8-coverage@0.2.3': + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + + '@discoveryjs/json-ext@0.5.7': + resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} + engines: {node: '>=10.0.0'} + + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + + '@esbuild/aix-ppc64@0.23.0': + resolution: {integrity: sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm64@0.23.0': + resolution: {integrity: sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + + '@esbuild/android-arm@0.23.0': + resolution: {integrity: sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + + '@esbuild/android-x64@0.23.0': + resolution: {integrity: sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-arm64@0.23.0': + resolution: {integrity: sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + + '@esbuild/darwin-x64@0.23.0': + resolution: {integrity: sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-arm64@0.23.0': + resolution: {integrity: sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.23.0': + resolution: {integrity: sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm64@0.23.0': + resolution: {integrity: sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-arm@0.23.0': + resolution: {integrity: sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-ia32@0.23.0': + resolution: {integrity: sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-loong64@0.23.0': + resolution: {integrity: sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-mips64el@0.23.0': + resolution: {integrity: sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-ppc64@0.23.0': + resolution: {integrity: sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-riscv64@0.23.0': + resolution: {integrity: sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-s390x@0.23.0': + resolution: {integrity: sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + + '@esbuild/linux-x64@0.23.0': + resolution: {integrity: sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.23.0': + resolution: {integrity: sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.23.0': + resolution: {integrity: sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.23.0': + resolution: {integrity: sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + + '@esbuild/sunos-x64@0.23.0': + resolution: {integrity: sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-arm64@0.23.0': + resolution: {integrity: sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-ia32@0.23.0': + resolution: {integrity: sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + + '@esbuild/win32-x64@0.23.0': + resolution: {integrity: sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@eslint-community/eslint-utils@4.4.0': + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.11.0': + resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/eslintrc@2.1.4': + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@eslint/js@8.57.0': + resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@eslint/js@9.6.0': + resolution: {integrity: sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@humanwhocodes/config-array@0.11.14': + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} + engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/object-schema@2.0.3': + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead + + '@isaacs/cliui@8.0.2': + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + + '@istanbuljs/load-nyc-config@1.1.0': + resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} + engines: {node: '>=8'} + + '@istanbuljs/schema@0.1.3': + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + + '@jest/console@29.7.0': + resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/core@29.7.0': + resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + '@jest/environment@29.7.0': + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/expect-utils@29.7.0': + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/expect@29.7.0': + resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/fake-timers@29.7.0': + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/globals@29.7.0': + resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/reporters@29.7.0': + resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + '@jest/schemas@29.6.3': + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/source-map@29.6.3': + resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/test-result@29.7.0': + resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/test-sequencer@29.7.0': + resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/transform@29.7.0': + resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/types@29.6.3': + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jridgewell/gen-mapping@0.3.5': + resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} + engines: {node: '>=6.0.0'} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/set-array@1.2.1': + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} + engines: {node: '>=6.0.0'} + + '@jridgewell/source-map@0.3.6': + resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} + + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + + '@jridgewell/trace-mapping@0.3.25': + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@pkgjs/parseargs@0.11.0': + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + + '@prisma/client@5.15.0': + resolution: {integrity: sha512-wPTeTjbd2Q0abOeffN7zCDCbkp9C9cF+e9HPiI64lmpehyq2TepgXE+sY7FXr7Rhbb21prLMnhXX27/E11V09w==} + engines: {node: '>=16.13'} + peerDependencies: + prisma: '*' + peerDependenciesMeta: + prisma: + optional: true + + '@prisma/client@5.16.2': + resolution: {integrity: sha512-+1lmkhR9gHWcTC5oghm2ZKpWljyWdzfazCVlLKUWXVmwHSf52g81aZ8qb6Km5Bs025yBi7puLp3qSLEvktoUtw==} + engines: {node: '>=16.13'} + peerDependencies: + prisma: '*' + peerDependenciesMeta: + prisma: + optional: true + + '@prisma/debug@5.15.0': + resolution: {integrity: sha512-QpEAOjieLPc/4sMny/WrWqtpIAmBYsgqwWlWwIctqZO0AbhQ9QcT6x2Ut3ojbDo/pFRCCA1Z1+xm2MUy7fAkZA==} + + '@prisma/debug@5.16.2': + resolution: {integrity: sha512-ItzB4nR4O8eLzuJiuP3WwUJfoIvewMHqpGCad+64gvThcKEVOtaUza9AEJo2DPqAOa/AWkFyK54oM4WwHeew+A==} + + '@prisma/engines-version@5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022': + resolution: {integrity: sha512-3BEgZ41Qb4oWHz9kZNofToRvNeS4LZYaT9pienR1gWkjhky6t6K1NyeWNBkqSj2llgraUNbgMOCQPY4f7Qp5wA==} + + '@prisma/engines@5.15.0': + resolution: {integrity: sha512-hXL5Sn9hh/ZpRKWiyPA5GbvF3laqBHKt6Vo70hYqqOhh5e0ZXDzHcdmxNvOefEFeqxra2DMz2hNbFoPvqrVe1w==} + + '@prisma/fetch-engine@5.15.0': + resolution: {integrity: sha512-z6AY5yyXxc20Klj7wwnfGP0iIUkVKzybqapT02zLYR/nf9ynaeN8bq73WRmi1TkLYn+DJ5Qy+JGu7hBf1pE78A==} + + '@prisma/generator-helper@5.16.2': + resolution: {integrity: sha512-ajdZ5OTKuLEYB7KQQPNYGPr4s56wD4+vH6KqIGiyQVw8ze8dPaxUB3MLzf0vCq2yYq6CZynSExf4InFXYBliTA==} + + '@prisma/get-platform@5.15.0': + resolution: {integrity: sha512-1GULDkW4+/VQb73vihxCBSc4Chc2x88MA+O40tcZFjmBzG4/fF44PaXFxUqKSFltxU9L9GIMLhh0Gfkk/pUbtg==} + + '@rollup/rollup-android-arm-eabi@4.18.1': + resolution: {integrity: sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.18.1': + resolution: {integrity: sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.18.1': + resolution: {integrity: sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.18.1': + resolution: {integrity: sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-linux-arm-gnueabihf@4.18.1': + resolution: {integrity: sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.18.1': + resolution: {integrity: sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.18.1': + resolution: {integrity: sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.18.1': + resolution: {integrity: sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.18.1': + resolution: {integrity: sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.18.1': + resolution: {integrity: sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.18.1': + resolution: {integrity: sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.18.1': + resolution: {integrity: sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.18.1': + resolution: {integrity: sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-win32-arm64-msvc@4.18.1': + resolution: {integrity: sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.18.1': + resolution: {integrity: sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.18.1': + resolution: {integrity: sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==} + cpu: [x64] + os: [win32] + + '@sinclair/typebox@0.27.8': + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + + '@sinonjs/commons@3.0.1': + resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + + '@sinonjs/fake-timers@10.3.0': + resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + + '@trpc/client@10.45.2': + resolution: {integrity: sha512-ykALM5kYWTLn1zYuUOZ2cPWlVfrXhc18HzBDyRhoPYN0jey4iQHEFSEowfnhg1RvYnrAVjNBgHNeSAXjrDbGwg==} + peerDependencies: + '@trpc/server': 10.45.2 + + '@trpc/server@10.45.2': + resolution: {integrity: sha512-wOrSThNNE4HUnuhJG6PfDRp4L2009KDVxsd+2VYH8ro6o/7/jwYZ8Uu5j+VaW+mOmc8EHerHzGcdbGNQSAUPgg==} + + '@tsconfig/node10@1.0.11': + resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + + '@types/async@3.2.24': + resolution: {integrity: sha512-8iHVLHsCCOBKjCF2KwFe0p9Z3rfM9mL+sSP8btyR5vTjJRAqpBYD28/ZLgXPf0pjG1VxOvtCV/BgXkQbpSe8Hw==} + + '@types/babel__core@7.20.5': + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + + '@types/babel__generator@7.6.8': + resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==} + + '@types/babel__template@7.4.4': + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + + '@types/babel__traverse@7.20.6': + resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} + + '@types/big.js@6.2.2': + resolution: {integrity: sha512-e2cOW9YlVzFY2iScnGBBkplKsrn2CsObHQ2Hiw4V1sSyiGbgWL8IyqE3zFi1Pt5o1pdAtYkDAIsF3KKUPjdzaA==} + + '@types/body-parser@1.19.5': + resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} + + '@types/connect@3.4.38': + resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} + + '@types/cors@2.8.17': + resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} + + '@types/eslint-scope@3.7.7': + resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} + + '@types/eslint@8.56.10': + resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} + + '@types/eslint__js@8.42.3': + resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + + '@types/estree@1.0.5': + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + + '@types/express-serve-static-core@4.19.5': + resolution: {integrity: sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==} + + '@types/express@4.17.21': + resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} + + '@types/graceful-fs@4.1.9': + resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + + '@types/http-errors@2.0.4': + resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} + + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + + '@types/istanbul-lib-report@3.0.3': + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + + '@types/istanbul-reports@3.0.4': + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + + '@types/jest@29.5.12': + resolution: {integrity: sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/lodash@4.17.6': + resolution: {integrity: sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==} + + '@types/luxon@3.4.2': + resolution: {integrity: sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA==} + + '@types/mime@1.3.5': + resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} + + '@types/node@20.14.10': + resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==} + + '@types/node@6.14.13': + resolution: {integrity: sha512-J1F0XJ/9zxlZel5ZlbeSuHW2OpabrUAqpFuC2sm2I3by8sERQ8+KCjNKUcq8QHuzpGMWiJpo9ZxeHrqrP2KzQw==} + + '@types/parse-json@4.0.2': + resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} + + '@types/qs@6.9.15': + resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==} + + '@types/range-parser@1.2.7': + resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} + + '@types/send@0.17.4': + resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} + + '@types/serve-static@1.15.7': + resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} + + '@types/stack-utils@2.0.3': + resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + + '@types/yargs@17.0.32': + resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} + + '@typescript-eslint/eslint-plugin@7.16.0': + resolution: {integrity: sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/parser@7.16.0': + resolution: {integrity: sha512-ar9E+k7CU8rWi2e5ErzQiC93KKEFAXA2Kky0scAlPcxYblLt8+XZuHUZwlyfXILyQa95P6lQg+eZgh/dDs3+Vw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/scope-manager@7.16.0': + resolution: {integrity: sha512-8gVv3kW6n01Q6TrI1cmTZ9YMFi3ucDT7i7aI5lEikk2ebk1AEjrwX8MDTdaX5D7fPXMBLvnsaa0IFTAu+jcfOw==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@typescript-eslint/type-utils@7.16.0': + resolution: {integrity: sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/types@7.16.0': + resolution: {integrity: sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@typescript-eslint/typescript-estree@7.16.0': + resolution: {integrity: sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/utils@7.16.0': + resolution: {integrity: sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + + '@typescript-eslint/visitor-keys@7.16.0': + resolution: {integrity: sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@ungap/structured-clone@1.2.0': + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + + '@webassemblyjs/ast@1.12.1': + resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==} + + '@webassemblyjs/floating-point-hex-parser@1.11.6': + resolution: {integrity: sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==} + + '@webassemblyjs/helper-api-error@1.11.6': + resolution: {integrity: sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==} + + '@webassemblyjs/helper-buffer@1.12.1': + resolution: {integrity: sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==} + + '@webassemblyjs/helper-numbers@1.11.6': + resolution: {integrity: sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==} + + '@webassemblyjs/helper-wasm-bytecode@1.11.6': + resolution: {integrity: sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==} + + '@webassemblyjs/helper-wasm-section@1.12.1': + resolution: {integrity: sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==} + + '@webassemblyjs/ieee754@1.11.6': + resolution: {integrity: sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==} + + '@webassemblyjs/leb128@1.11.6': + resolution: {integrity: sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==} + + '@webassemblyjs/utf8@1.11.6': + resolution: {integrity: sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==} + + '@webassemblyjs/wasm-edit@1.12.1': + resolution: {integrity: sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==} + + '@webassemblyjs/wasm-gen@1.12.1': + resolution: {integrity: sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==} + + '@webassemblyjs/wasm-opt@1.12.1': + resolution: {integrity: sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==} + + '@webassemblyjs/wasm-parser@1.12.1': + resolution: {integrity: sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==} + + '@webassemblyjs/wast-printer@1.12.1': + resolution: {integrity: sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==} + + '@webpack-cli/configtest@2.1.1': + resolution: {integrity: sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + + '@webpack-cli/info@2.0.2': + resolution: {integrity: sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + + '@webpack-cli/serve@2.0.5': + resolution: {integrity: sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==} + engines: {node: '>=14.15.0'} + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + webpack-dev-server: '*' + peerDependenciesMeta: + webpack-dev-server: + optional: true + + '@xtuc/ieee754@1.2.0': + resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} + + '@xtuc/long@4.2.2': + resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} + + abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + + accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + + acorn-import-attributes@1.9.5: + resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} + peerDependencies: + acorn: ^8 + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn-walk@8.3.3: + resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} + engines: {node: '>=0.4.0'} + + acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv-keywords@3.5.2: + resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==} + peerDependencies: + ajv: ^6.9.1 + + ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + + ajv@8.16.0: + resolution: {integrity: sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==} + + ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-regex@6.0.1: + resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + engines: {node: '>=12'} + + ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + + ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + + any-promise@1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + array-flatten@1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + + array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + + astral-regex@2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + + async@3.2.5: + resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} + + atomic-sleep@1.0.0: + resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} + engines: {node: '>=8.0.0'} + + babel-jest@29.7.0: + resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + + babel-plugin-istanbul@6.1.1: + resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} + engines: {node: '>=8'} + + babel-plugin-jest-hoist@29.6.3: + resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + babel-plugin-macros@3.1.0: + resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} + engines: {node: '>=10', npm: '>=6'} + + babel-preset-current-node-syntax@1.0.1: + resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} + peerDependencies: + '@babel/core': ^7.0.0 + + babel-preset-jest@29.6.3: + resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + big.js@6.2.1: + resolution: {integrity: sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ==} + + binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + + body-parser@1.20.2: + resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + + brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + browserslist@4.23.2: + resolution: {integrity: sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + bs-logger@0.2.6: + resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} + engines: {node: '>= 6'} + + bser@2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + + buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + + bundle-require@4.2.1: + resolution: {integrity: sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.17' + + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + + call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + + camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + + caniuse-lite@1.0.30001641: + resolution: {integrity: sha512-Phv5thgl67bHYo1TtMY/MurjkHhV4EDaCosezRXgZ8jzA/Ub+wjxAvbGvjoFENStinwi5kCyOYV3mi5tOGykwA==} + + ccxt@4.3.59: + resolution: {integrity: sha512-10wSovFgZjTt9R4thW6oFwkuXCBCxH65U2FcINnGXJ2+xf54OZeRP8ECBp+1bcKHdJ0yA6CcEyKm6Tl0DP0ULA==} + engines: {node: '>=15.0.0'} + hasBin: true + + chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + + chrome-trace-event@1.0.4: + resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} + engines: {node: '>=6.0'} + + ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} + + cjs-module-lexer@1.3.1: + resolution: {integrity: sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + clone-deep@4.0.1: + resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} + engines: {node: '>=6'} + + co@4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + + code-block-writer@12.0.0: + resolution: {integrity: sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==} + + collect-v8-coverage@1.0.2: + resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} + + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + + commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + + commander@2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + + commander@4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + content-disposition@0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + + content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + cookie-signature@1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + + cookie@0.6.0: + resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} + engines: {node: '>= 0.6'} + + copy-anything@3.0.5: + resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} + engines: {node: '>=12.13'} + + cors@2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + + cosmiconfig@7.1.0: + resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} + engines: {node: '>=10'} + + create-jest@29.7.0: + resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + + cron@3.1.7: + resolution: {integrity: sha512-tlBg7ARsAMQLzgwqVxy8AZl/qlTc5nibqYwtNGoCrd+cV+ugI+tvZC1oT/8dFH8W455YrywGykx/KMmAqOr7Jw==} + + cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + + dateformat@4.6.3: + resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} + + debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.3.5: + resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + dedent@1.5.3: + resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + detect-newline@3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + + diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + + dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + + doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + + eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + ejs@3.1.10: + resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} + engines: {node: '>=0.10.0'} + hasBin: true + + electron-to-chromium@1.4.823: + resolution: {integrity: sha512-4h+oPeAiGQOHFyUJOqpoEcPj/xxlicxBzOErVeYVMMmAiXUXsGpsFd0QXBMaUUbnD8hhSfLf9uw+MlsoIA7j5w==} + + emittery@0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} + engines: {node: '>=12'} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + + encodeurl@1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + + end-of-stream@1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + + enhanced-resolve@5.17.0: + resolution: {integrity: sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==} + engines: {node: '>=10.13.0'} + + envinfo@7.13.0: + resolution: {integrity: sha512-cvcaMr7KqXVh4nyzGTVqTum+gAiL265x5jUWQIDLq//zOGbW+gSW/C+OWLleY/rs9Qole6AZLMXPbtIFQbqu+Q==} + engines: {node: '>=4'} + hasBin: true + + error-ex@1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + + es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-module-lexer@1.5.4: + resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} + hasBin: true + + esbuild@0.23.0: + resolution: {integrity: sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==} + engines: {node: '>=18'} + hasBin: true + + escalade@3.1.2: + resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + engines: {node: '>=6'} + + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + eslint-scope@5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} + + eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint@8.57.0: + resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + + espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + + esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + + event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + + events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + + execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + + exit@0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} + + expect@29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + express@4.19.2: + resolution: {integrity: sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==} + engines: {node: '>= 0.10.0'} + + fast-copy@3.0.2: + resolution: {integrity: sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fast-redact@3.5.0: + resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} + engines: {node: '>=6'} + + fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + + fastest-levenshtein@1.0.16: + resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} + engines: {node: '>= 4.9.1'} + + fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + + fb-watchman@2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + + file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + + filelist@1.0.4: + resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + finalhandler@1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + + flat@5.0.2: + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} + hasBin: true + + flatted@3.3.1: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + + foreground-child@3.2.1: + resolution: {integrity: sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==} + engines: {node: '>=14'} + + forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + + fresh@0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + + get-package-type@0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} + + get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + glob-to-regexp@0.4.1: + resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} + + glob@10.4.5: + resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} + hasBin: true + + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported + + globals@11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + + globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + + globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + + gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + + has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + + has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + help-me@5.0.0: + resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==} + + html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + + http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + + human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + + iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + + ignore@5.3.1: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + engines: {node: '>= 4'} + + import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + + import-local@3.1.0: + resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} + engines: {node: '>=8'} + hasBin: true + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + interpret@3.1.1: + resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} + engines: {node: '>=10.13.0'} + + ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + is-core-module@2.14.0: + resolution: {integrity: sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==} + engines: {node: '>= 0.4'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-generator-fn@2.1.0: + resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} + engines: {node: '>=6'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + + is-plain-object@2.0.4: + resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} + engines: {node: '>=0.10.0'} + + is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + + is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} + engines: {node: '>=12.13'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + isobject@3.0.1: + resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} + engines: {node: '>=0.10.0'} + + istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} + engines: {node: '>=8'} + + istanbul-lib-instrument@5.2.1: + resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} + engines: {node: '>=8'} + + istanbul-lib-instrument@6.0.3: + resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} + engines: {node: '>=10'} + + istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + + istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + + istanbul-reports@3.1.7: + resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} + engines: {node: '>=8'} + + jackspeak@3.4.2: + resolution: {integrity: sha512-qH3nOSj8q/8+Eg8LUPOq3C+6HWkpUioIjDsq1+D4zY91oZvpPttw8GwtF1nReRYKXl+1AORyFqtm2f5Q1SB6/Q==} + engines: {node: 14 >=14.21 || 16 >=16.20 || >=18} + + jake@10.9.1: + resolution: {integrity: sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==} + engines: {node: '>=10'} + hasBin: true + + jest-changed-files@29.7.0: + resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-circus@29.7.0: + resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-cli@29.7.0: + resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + jest-config@29.7.0: + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + + jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-docblock@29.7.0: + resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-each@29.7.0: + resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-environment-node@29.7.0: + resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-haste-map@29.7.0: + resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-leak-detector@29.7.0: + resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-matcher-utils@29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-mock@29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-pnp-resolver@1.2.3: + resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} + engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true + + jest-regex-util@29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-resolve-dependencies@29.7.0: + resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-resolve@29.7.0: + resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-runner@29.7.0: + resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-runtime@29.7.0: + resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-snapshot@29.7.0: + resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-validate@29.7.0: + resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-watcher@29.7.0: + resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-worker@27.5.1: + resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} + engines: {node: '>= 10.13.0'} + + jest-worker@29.7.0: + resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest@29.7.0: + resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + joycon@3.1.1: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + + js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + + jsesc@2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + kind-of@6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + + kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + + leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + lilconfig@3.1.2: + resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} + engines: {node: '>=14'} + + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + + loader-runner@4.3.0: + resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} + engines: {node: '>=6.11.5'} + + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + lodash.sortby@4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + + lodash.truncate@4.4.2: + resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} + + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + luxon@3.4.4: + resolution: {integrity: sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==} + engines: {node: '>=12'} + + make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + + makeerror@1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + + media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + + merge-descriptors@1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + methods@1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + + micromatch@4.0.7: + resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} + engines: {node: '>=8.6'} + + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + + mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} + engines: {node: '>=16 || 14 >=14.17'} + + ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + + ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + mz@2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + + nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + + node-int64@0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + + node-releases@2.0.14: + resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.2: + resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} + engines: {node: '>= 0.4'} + + on-exit-leak-free@2.1.2: + resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} + engines: {node: '>=14.0.0'} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + + package-json-from-dist@1.0.0: + resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + + path-to-regexp@0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + + path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + + picocolors@1.0.1: + resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + pino-abstract-transport@1.2.0: + resolution: {integrity: sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==} + + pino-pretty@11.2.1: + resolution: {integrity: sha512-O05NuD9tkRasFRWVaF/uHLOvoRDFD7tb5VMertr78rbsYFjYp48Vg3477EshVAF5eZaEw+OpDl/tu+B0R5o+7g==} + hasBin: true + + pino-std-serializers@7.0.0: + resolution: {integrity: sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==} + + pino@9.2.0: + resolution: {integrity: sha512-g3/hpwfujK5a4oVbaefoJxezLzsDgLcNJeITvC6yrfwYeT9la+edCK42j5QpEQSQCZgTKapXvnQIdgZwvRaZug==} + hasBin: true + + pirates@4.0.6: + resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} + engines: {node: '>= 6'} + + pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + + postcss-load-config@4.0.2: + resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} + engines: {node: '>= 14'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + + postcss@8.4.39: + resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==} + engines: {node: ^10 || ^12 || >=14} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier@3.3.2: + resolution: {integrity: sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==} + engines: {node: '>=14'} + hasBin: true + + pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + prisma@5.15.0: + resolution: {integrity: sha512-JA81ACQSCi3a7NUOgonOIkdx8PAVkO+HbUOxmd00Yb8DgIIEpr2V9+Qe/j6MLxIgWtE/OtVQ54rVjfYRbZsCfw==} + engines: {node: '>=16.13'} + hasBin: true + + process-warning@3.0.0: + resolution: {integrity: sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==} + + process@0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + + prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + + proxy-addr@2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + + pump@3.0.0: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + pure-rand@6.1.0: + resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + + qs@6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + quick-format-unescaped@4.0.4: + resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + + randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + + range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + + raw-body@2.5.2: + resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} + engines: {node: '>= 0.8'} + + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + + readable-stream@4.5.2: + resolution: {integrity: sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + real-require@0.2.0: + resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} + engines: {node: '>= 12.13.0'} + + rechoir@0.8.0: + resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} + engines: {node: '>= 10.13.0'} + + regenerator-runtime@0.14.1: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + resolve-cwd@3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + + resolve.exports@2.0.2: + resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} + engines: {node: '>=10'} + + resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + + reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + + rollup@4.18.1: + resolution: {integrity: sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + safe-stable-stringify@2.4.3: + resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} + engines: {node: '>=10'} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + schema-utils@3.3.0: + resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} + engines: {node: '>= 10.13.0'} + + secure-json-parse@2.7.0: + resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + engines: {node: '>=10'} + hasBin: true + + send@0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + + serialize-javascript@6.0.2: + resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + + serve-static@1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + shallow-clone@3.0.1: + resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} + engines: {node: '>=8'} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + side-channel@1.0.6: + resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + engines: {node: '>= 0.4'} + + signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + + slice-ansi@4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + + sonic-boom@4.0.1: + resolution: {integrity: sha512-hTSD/6JMLyT4r9zeof6UtuBDpjJ9sO08/nmS5djaA9eozT9oOlNdpXSnzcgj4FTqpk3nkLrs61l4gip9r1HCrQ==} + + source-map-js@1.2.0: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + engines: {node: '>=0.10.0'} + + source-map-support@0.5.13: + resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + + source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + source-map@0.7.4: + resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} + engines: {node: '>= 8'} + + source-map@0.8.0-beta.0: + resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} + engines: {node: '>= 8'} + + split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + + statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + + string-length@4.0.2: + resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} + engines: {node: '>=10'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + + strip-bom@4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + + strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + sucrase@3.35.0: + resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + + superjson@2.2.1: + resolution: {integrity: sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==} + engines: {node: '>=16'} + + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + table@6.8.2: + resolution: {integrity: sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==} + engines: {node: '>=10.0.0'} + + tapable@2.2.1: + resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + engines: {node: '>=6'} + + technicalindicators@3.1.0: + resolution: {integrity: sha512-f16mOc+Y05hNy/of+UbGxhxQQmxUztCiluhsqC5QLUYz4WowUgKde9m6nIjK1Kay0wGHigT0IkOabpp0+22UfA==} + + terser-webpack-plugin@5.3.10: + resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + + terser@5.31.2: + resolution: {integrity: sha512-LGyRZVFm/QElZHy/CPr/O4eNZOZIzsrQ92y4v9UJe/pFJjypje2yI3C2FmPtvUEnhadlSbmG2nXtdcjHOjCfxw==} + engines: {node: '>=10'} + hasBin: true + + test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + + text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + thenify-all@1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + + thenify@3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + + thread-stream@3.1.0: + resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==} + + tmpl@1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + + to-fast-properties@2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + + tr46@1.0.1: + resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} + + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + + ts-api-utils@1.3.0: + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + + ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + + ts-jest@29.2.1: + resolution: {integrity: sha512-7obwtH5gw0b0XZi0wmprCSvGSvHliMBI47lPnU47vmbxWS6B+v1X94yWFo1f1vt9k/he+gttsrXjkxmgY41XNQ==} + engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/transform': ^29.0.0 + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/transform': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + + ts-loader@9.5.1: + resolution: {integrity: sha512-rNH3sK9kGZcH9dYzC7CewQm4NtxJTjSEVRJ2DyBZR7f8/wcta+iV44UPCXc5+nzDzivKtlzV6c9P4e+oFhDLYg==} + engines: {node: '>=12.0.0'} + peerDependencies: + typescript: '*' + webpack: ^5.0.0 + + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + + tslib@2.6.3: + resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + + tsup@8.1.0: + resolution: {integrity: sha512-UFdfCAXukax+U6KzeTNO2kAARHcWxmKsnvSPXUcfA1D+kU05XDccCrkffCQpFaWDsZfV0jMyTsxU39VfCp6EOg==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + '@microsoft/api-extractor': ^7.36.0 + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.5.0' + peerDependenciesMeta: + '@microsoft/api-extractor': + optional: true + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + + turbo-darwin-64@2.0.6: + resolution: {integrity: sha512-XpgBwWj3Ggmz/gQVqXdMKXHC1iFPMDiuwugLwSzE7Ih0O13JuNtYZKhQnopvbDQnFQCeRq2Vsm5OTWabg/oB/g==} + cpu: [x64] + os: [darwin] + + turbo-darwin-arm64@2.0.6: + resolution: {integrity: sha512-RfeZYXIAkiA21E8lsvfptGTqz/256YD+eI1x37fedfvnHFWuIMFZGAOwJxtZc6QasQunDZ9TRRREbJNI68tkIw==} + cpu: [arm64] + os: [darwin] + + turbo-linux-64@2.0.6: + resolution: {integrity: sha512-92UDa0xNQQbx0HdSp9ag3YSS3xPdavhc7q9q9mxIAcqyjjD6VElA4Y85m4F/DDGE5SolCrvBz2sQhVmkOd6Caw==} + cpu: [x64] + os: [linux] + + turbo-linux-arm64@2.0.6: + resolution: {integrity: sha512-eQKu6utCVUkIH2kqOzD8OS6E0ba6COjWm6PRDTNCHQRljZW503ycaTUIdMOiJrVg1MkEjDyOReUg8s8D18aJ4Q==} + cpu: [arm64] + os: [linux] + + turbo-windows-64@2.0.6: + resolution: {integrity: sha512-+9u4EPrpoeHYCQ46dRcou9kbkSoelhOelHNcbs2d86D6ruYD/oIAHK9qgYK8LeARRz0jxhZIA/dWYdYsxJJWkw==} + cpu: [x64] + os: [win32] + + turbo-windows-arm64@2.0.6: + resolution: {integrity: sha512-rdrKL+p+EjtdDVg0wQ/7yTbzkIYrnb0Pw4IKcjsy3M0RqUM9UcEi67b94XOAyTa5a0GqJL1+tUj2ebsFGPgZbg==} + cpu: [arm64] + os: [win32] + + turbo@2.0.6: + resolution: {integrity: sha512-/Ftmxd5Mq//a9yMonvmwENNUN65jOVTwhhBPQjEtNZutYT9YKyzydFGLyVM1nzhpLWahQSMamRc/RDBv5EapzA==} + hasBin: true + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + + type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + + type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + + type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + + typescript-eslint@7.16.0: + resolution: {integrity: sha512-kaVRivQjOzuoCXU6+hLnjo3/baxyzWVO5GrnExkFzETRYJKVHYkrJglOu2OCm8Hi9RPDWX1PTNNTpU5KRV0+RA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + typescript@5.5.3: + resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + + update-browserslist-db@1.1.0: + resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + + v8-to-istanbul@9.3.0: + resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} + engines: {node: '>=10.12.0'} + + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + + walker@1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + + watchpack@2.4.1: + resolution: {integrity: sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==} + engines: {node: '>=10.13.0'} + + webidl-conversions@4.0.2: + resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + + webpack-cli@5.1.4: + resolution: {integrity: sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==} + engines: {node: '>=14.15.0'} + hasBin: true + peerDependencies: + '@webpack-cli/generators': '*' + webpack: 5.x.x + webpack-bundle-analyzer: '*' + webpack-dev-server: '*' + peerDependenciesMeta: + '@webpack-cli/generators': + optional: true + webpack-bundle-analyzer: + optional: true + webpack-dev-server: + optional: true + + webpack-merge@5.10.0: + resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} + engines: {node: '>=10.0.0'} + + webpack-node-externals@3.0.0: + resolution: {integrity: sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==} + engines: {node: '>=6'} + + webpack-sources@3.2.3: + resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} + engines: {node: '>=10.13.0'} + + webpack@5.92.1: + resolution: {integrity: sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==} + engines: {node: '>=10.13.0'} + hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + + whatwg-url@7.1.0: + resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + wildcard@2.0.1: + resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + write-file-atomic@4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + + ws@8.18.0: + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yaml@1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + + yaml@2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} + engines: {node: '>= 14'} + hasBin: true + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + + zod-prisma-types@3.1.8: + resolution: {integrity: sha512-5oe0ays3ur4u2GtuUqlhgCraKBcsuMaMI8o7VMV4YAnFeOuVid7K2zGvjI19V0ue9PeNF2ICyVREQVohaQm5dw==} + hasBin: true + + zod@3.23.8: + resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + +snapshots: + + '@ampproject/remapping@2.3.0': + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + + '@babel/code-frame@7.24.7': + dependencies: + '@babel/highlight': 7.24.7 + picocolors: 1.0.1 + + '@babel/compat-data@7.24.7': {} + + '@babel/core@7.24.7': + dependencies: + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.24.7 + '@babel/generator': 7.24.7 + '@babel/helper-compilation-targets': 7.24.7 + '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.7) + '@babel/helpers': 7.24.7 + '@babel/parser': 7.24.7 + '@babel/template': 7.24.7 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 + convert-source-map: 2.0.0 + debug: 4.3.5 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.24.7': + dependencies: + '@babel/types': 7.24.7 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 2.5.2 + + '@babel/helper-compilation-targets@7.24.7': + dependencies: + '@babel/compat-data': 7.24.7 + '@babel/helper-validator-option': 7.24.7 + browserslist: 4.23.2 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-environment-visitor@7.24.7': + dependencies: + '@babel/types': 7.24.7 + + '@babel/helper-function-name@7.24.7': + dependencies: + '@babel/template': 7.24.7 + '@babel/types': 7.24.7 + + '@babel/helper-hoist-variables@7.24.7': + dependencies: + '@babel/types': 7.24.7 + + '@babel/helper-module-imports@7.24.7': + dependencies: + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.24.7(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-module-imports': 7.24.7 + '@babel/helper-simple-access': 7.24.7 + '@babel/helper-split-export-declaration': 7.24.7 + '@babel/helper-validator-identifier': 7.24.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-plugin-utils@7.24.7': {} + + '@babel/helper-simple-access@7.24.7': + dependencies: + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-split-export-declaration@7.24.7': + dependencies: + '@babel/types': 7.24.7 + + '@babel/helper-string-parser@7.24.7': {} + + '@babel/helper-validator-identifier@7.24.7': {} + + '@babel/helper-validator-option@7.24.7': {} + + '@babel/helpers@7.24.7': + dependencies: + '@babel/template': 7.24.7 + '@babel/types': 7.24.7 + + '@babel/highlight@7.24.7': + dependencies: + '@babel/helper-validator-identifier': 7.24.7 + chalk: 2.4.2 + js-tokens: 4.0.0 + picocolors: 1.0.1 + + '@babel/parser@7.24.7': + dependencies: + '@babel/types': 7.24.7 + + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.24.7)': + dependencies: + '@babel/core': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/runtime@7.24.7': + dependencies: + regenerator-runtime: 0.14.1 + optional: true + + '@babel/template@7.24.7': + dependencies: + '@babel/code-frame': 7.24.7 + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 + + '@babel/traverse@7.24.7': + dependencies: + '@babel/code-frame': 7.24.7 + '@babel/generator': 7.24.7 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-hoist-variables': 7.24.7 + '@babel/helper-split-export-declaration': 7.24.7 + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 + debug: 4.3.5 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.24.7': + dependencies: + '@babel/helper-string-parser': 7.24.7 + '@babel/helper-validator-identifier': 7.24.7 + to-fast-properties: 2.0.0 + + '@bcoe/v8-coverage@0.2.3': {} + + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + + '@discoveryjs/json-ext@0.5.7': {} + + '@esbuild/aix-ppc64@0.21.5': + optional: true + + '@esbuild/aix-ppc64@0.23.0': + optional: true + + '@esbuild/android-arm64@0.21.5': + optional: true + + '@esbuild/android-arm64@0.23.0': + optional: true + + '@esbuild/android-arm@0.21.5': + optional: true + + '@esbuild/android-arm@0.23.0': + optional: true + + '@esbuild/android-x64@0.21.5': + optional: true + + '@esbuild/android-x64@0.23.0': + optional: true + + '@esbuild/darwin-arm64@0.21.5': + optional: true + + '@esbuild/darwin-arm64@0.23.0': + optional: true + + '@esbuild/darwin-x64@0.21.5': + optional: true + + '@esbuild/darwin-x64@0.23.0': + optional: true + + '@esbuild/freebsd-arm64@0.21.5': + optional: true + + '@esbuild/freebsd-arm64@0.23.0': + optional: true + + '@esbuild/freebsd-x64@0.21.5': + optional: true + + '@esbuild/freebsd-x64@0.23.0': + optional: true + + '@esbuild/linux-arm64@0.21.5': + optional: true + + '@esbuild/linux-arm64@0.23.0': + optional: true + + '@esbuild/linux-arm@0.21.5': + optional: true + + '@esbuild/linux-arm@0.23.0': + optional: true + + '@esbuild/linux-ia32@0.21.5': + optional: true + + '@esbuild/linux-ia32@0.23.0': + optional: true + + '@esbuild/linux-loong64@0.21.5': + optional: true + + '@esbuild/linux-loong64@0.23.0': + optional: true + + '@esbuild/linux-mips64el@0.21.5': + optional: true + + '@esbuild/linux-mips64el@0.23.0': + optional: true + + '@esbuild/linux-ppc64@0.21.5': + optional: true + + '@esbuild/linux-ppc64@0.23.0': + optional: true + + '@esbuild/linux-riscv64@0.21.5': + optional: true + + '@esbuild/linux-riscv64@0.23.0': + optional: true + + '@esbuild/linux-s390x@0.21.5': + optional: true + + '@esbuild/linux-s390x@0.23.0': + optional: true + + '@esbuild/linux-x64@0.21.5': + optional: true + + '@esbuild/linux-x64@0.23.0': + optional: true + + '@esbuild/netbsd-x64@0.21.5': + optional: true + + '@esbuild/netbsd-x64@0.23.0': + optional: true + + '@esbuild/openbsd-arm64@0.23.0': + optional: true + + '@esbuild/openbsd-x64@0.21.5': + optional: true + + '@esbuild/openbsd-x64@0.23.0': + optional: true + + '@esbuild/sunos-x64@0.21.5': + optional: true + + '@esbuild/sunos-x64@0.23.0': + optional: true + + '@esbuild/win32-arm64@0.21.5': + optional: true + + '@esbuild/win32-arm64@0.23.0': + optional: true + + '@esbuild/win32-ia32@0.21.5': + optional: true + + '@esbuild/win32-ia32@0.23.0': + optional: true + + '@esbuild/win32-x64@0.21.5': + optional: true + + '@esbuild/win32-x64@0.23.0': + optional: true + + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': + dependencies: + eslint: 8.57.0 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.11.0': {} + + '@eslint/eslintrc@2.1.4': + dependencies: + ajv: 6.12.6 + debug: 4.3.5 + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.1 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@8.57.0': {} + + '@eslint/js@9.6.0': {} + + '@humanwhocodes/config-array@0.11.14': + dependencies: + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.3.5 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/object-schema@2.0.3': {} + + '@isaacs/cliui@8.0.2': + dependencies: + string-width: 5.1.2 + string-width-cjs: string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: wrap-ansi@7.0.0 + + '@istanbuljs/load-nyc-config@1.1.0': + dependencies: + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.14.1 + resolve-from: 5.0.0 + + '@istanbuljs/schema@0.1.3': {} + + '@jest/console@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + chalk: 4.1.2 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + slash: 3.0.0 + + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.7 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + + '@jest/environment@29.7.0': + dependencies: + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + jest-mock: 29.7.0 + + '@jest/expect-utils@29.7.0': + dependencies: + jest-get-type: 29.6.3 + + '@jest/expect@29.7.0': + dependencies: + expect: 29.7.0 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + + '@jest/fake-timers@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 20.14.10 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 + + '@jest/globals@29.7.0': + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/types': 29.6.3 + jest-mock: 29.7.0 + transitivePeerDependencies: + - supports-color + + '@jest/reporters@29.7.0': + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.25 + '@types/node': 20.14.10 + chalk: 4.1.2 + collect-v8-coverage: 1.0.2 + exit: 0.1.2 + glob: 7.2.3 + graceful-fs: 4.2.11 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-instrument: 6.0.3 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.7 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + jest-worker: 29.7.0 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.3.0 + transitivePeerDependencies: + - supports-color + + '@jest/schemas@29.6.3': + dependencies: + '@sinclair/typebox': 0.27.8 + + '@jest/source-map@29.6.3': + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + callsites: 3.1.0 + graceful-fs: 4.2.11 + + '@jest/test-result@29.7.0': + dependencies: + '@jest/console': 29.7.0 + '@jest/types': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + collect-v8-coverage: 1.0.2 + + '@jest/test-sequencer@29.7.0': + dependencies: + '@jest/test-result': 29.7.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + slash: 3.0.0 + + '@jest/transform@29.7.0': + dependencies: + '@babel/core': 7.24.7 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.25 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + micromatch: 4.0.7 + pirates: 4.0.6 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + + '@jest/types@29.6.3': + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@types/node': 20.14.10 + '@types/yargs': 17.0.32 + chalk: 4.1.2 + + '@jridgewell/gen-mapping@0.3.5': + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/set-array@1.2.1': {} + + '@jridgewell/source-map@0.3.6': + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/sourcemap-codec@1.5.0': {} + + '@jridgewell/trace-mapping@0.3.25': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + + '@pkgjs/parseargs@0.11.0': + optional: true + + '@prisma/client@5.15.0(prisma@5.15.0)': + optionalDependencies: + prisma: 5.15.0 + + '@prisma/client@5.16.2(prisma@5.15.0)': + optionalDependencies: + prisma: 5.15.0 + + '@prisma/debug@5.15.0': {} + + '@prisma/debug@5.16.2': {} + + '@prisma/engines-version@5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022': {} + + '@prisma/engines@5.15.0': + dependencies: + '@prisma/debug': 5.15.0 + '@prisma/engines-version': 5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022 + '@prisma/fetch-engine': 5.15.0 + '@prisma/get-platform': 5.15.0 + + '@prisma/fetch-engine@5.15.0': + dependencies: + '@prisma/debug': 5.15.0 + '@prisma/engines-version': 5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022 + '@prisma/get-platform': 5.15.0 + + '@prisma/generator-helper@5.16.2': + dependencies: + '@prisma/debug': 5.16.2 + + '@prisma/get-platform@5.15.0': + dependencies: + '@prisma/debug': 5.15.0 + + '@rollup/rollup-android-arm-eabi@4.18.1': + optional: true + + '@rollup/rollup-android-arm64@4.18.1': + optional: true + + '@rollup/rollup-darwin-arm64@4.18.1': + optional: true + + '@rollup/rollup-darwin-x64@4.18.1': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.18.1': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.18.1': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.18.1': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.18.1': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.18.1': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.18.1': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.18.1': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.18.1': + optional: true + + '@rollup/rollup-linux-x64-musl@4.18.1': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.18.1': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.18.1': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.18.1': + optional: true + + '@sinclair/typebox@0.27.8': {} + + '@sinonjs/commons@3.0.1': + dependencies: + type-detect: 4.0.8 + + '@sinonjs/fake-timers@10.3.0': + dependencies: + '@sinonjs/commons': 3.0.1 + + '@trpc/client@10.45.2(@trpc/server@10.45.2)': + dependencies: + '@trpc/server': 10.45.2 + + '@trpc/server@10.45.2': {} + + '@tsconfig/node10@1.0.11': {} + + '@tsconfig/node12@1.0.11': {} + + '@tsconfig/node14@1.0.3': {} + + '@tsconfig/node16@1.0.4': {} + + '@types/async@3.2.24': {} + + '@types/babel__core@7.20.5': + dependencies: + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 + '@types/babel__generator': 7.6.8 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.20.6 + + '@types/babel__generator@7.6.8': + dependencies: + '@babel/types': 7.24.7 + + '@types/babel__template@7.4.4': + dependencies: + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 + + '@types/babel__traverse@7.20.6': + dependencies: + '@babel/types': 7.24.7 + + '@types/big.js@6.2.2': {} + + '@types/body-parser@1.19.5': + dependencies: + '@types/connect': 3.4.38 + '@types/node': 20.14.10 + + '@types/connect@3.4.38': + dependencies: + '@types/node': 20.14.10 + + '@types/cors@2.8.17': + dependencies: + '@types/node': 20.14.10 + + '@types/eslint-scope@3.7.7': + dependencies: + '@types/eslint': 8.56.10 + '@types/estree': 1.0.5 + + '@types/eslint@8.56.10': + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + + '@types/eslint__js@8.42.3': + dependencies: + '@types/eslint': 8.56.10 + + '@types/estree@1.0.5': {} + + '@types/express-serve-static-core@4.19.5': + dependencies: + '@types/node': 20.14.10 + '@types/qs': 6.9.15 + '@types/range-parser': 1.2.7 + '@types/send': 0.17.4 + + '@types/express@4.17.21': + dependencies: + '@types/body-parser': 1.19.5 + '@types/express-serve-static-core': 4.19.5 + '@types/qs': 6.9.15 + '@types/serve-static': 1.15.7 + + '@types/graceful-fs@4.1.9': + dependencies: + '@types/node': 20.14.10 + + '@types/http-errors@2.0.4': {} + + '@types/istanbul-lib-coverage@2.0.6': {} + + '@types/istanbul-lib-report@3.0.3': + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + + '@types/istanbul-reports@3.0.4': + dependencies: + '@types/istanbul-lib-report': 3.0.3 + + '@types/jest@29.5.12': + dependencies: + expect: 29.7.0 + pretty-format: 29.7.0 + + '@types/json-schema@7.0.15': {} + + '@types/lodash@4.17.6': {} + + '@types/luxon@3.4.2': {} + + '@types/mime@1.3.5': {} + + '@types/node@20.14.10': + dependencies: + undici-types: 5.26.5 + + '@types/node@6.14.13': {} + + '@types/parse-json@4.0.2': + optional: true + + '@types/qs@6.9.15': {} + + '@types/range-parser@1.2.7': {} + + '@types/send@0.17.4': + dependencies: + '@types/mime': 1.3.5 + '@types/node': 20.14.10 + + '@types/serve-static@1.15.7': + dependencies: + '@types/http-errors': 2.0.4 + '@types/node': 20.14.10 + '@types/send': 0.17.4 + + '@types/stack-utils@2.0.3': {} + + '@types/yargs-parser@21.0.3': {} + + '@types/yargs@17.0.32': + dependencies: + '@types/yargs-parser': 21.0.3 + + '@typescript-eslint/eslint-plugin@7.16.0(@typescript-eslint/parser@7.16.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3)': + dependencies: + '@eslint-community/regexpp': 4.11.0 + '@typescript-eslint/parser': 7.16.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/scope-manager': 7.16.0 + '@typescript-eslint/type-utils': 7.16.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.16.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 7.16.0 + eslint: 8.57.0 + graphemer: 1.4.0 + ignore: 5.3.1 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.5.3) + optionalDependencies: + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@7.16.0(eslint@8.57.0)(typescript@5.5.3)': + dependencies: + '@typescript-eslint/scope-manager': 7.16.0 + '@typescript-eslint/types': 7.16.0 + '@typescript-eslint/typescript-estree': 7.16.0(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 7.16.0 + debug: 4.3.5 + eslint: 8.57.0 + optionalDependencies: + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@7.16.0': + dependencies: + '@typescript-eslint/types': 7.16.0 + '@typescript-eslint/visitor-keys': 7.16.0 + + '@typescript-eslint/type-utils@7.16.0(eslint@8.57.0)(typescript@5.5.3)': + dependencies: + '@typescript-eslint/typescript-estree': 7.16.0(typescript@5.5.3) + '@typescript-eslint/utils': 7.16.0(eslint@8.57.0)(typescript@5.5.3) + debug: 4.3.5 + eslint: 8.57.0 + ts-api-utils: 1.3.0(typescript@5.5.3) + optionalDependencies: + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@7.16.0': {} + + '@typescript-eslint/typescript-estree@7.16.0(typescript@5.5.3)': + dependencies: + '@typescript-eslint/types': 7.16.0 + '@typescript-eslint/visitor-keys': 7.16.0 + debug: 4.3.5 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.2 + ts-api-utils: 1.3.0(typescript@5.5.3) + optionalDependencies: + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@7.16.0(eslint@8.57.0)(typescript@5.5.3)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@typescript-eslint/scope-manager': 7.16.0 + '@typescript-eslint/types': 7.16.0 + '@typescript-eslint/typescript-estree': 7.16.0(typescript@5.5.3) + eslint: 8.57.0 + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/visitor-keys@7.16.0': + dependencies: + '@typescript-eslint/types': 7.16.0 + eslint-visitor-keys: 3.4.3 + + '@ungap/structured-clone@1.2.0': {} + + '@webassemblyjs/ast@1.12.1': + dependencies: + '@webassemblyjs/helper-numbers': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + + '@webassemblyjs/floating-point-hex-parser@1.11.6': {} + + '@webassemblyjs/helper-api-error@1.11.6': {} + + '@webassemblyjs/helper-buffer@1.12.1': {} + + '@webassemblyjs/helper-numbers@1.11.6': + dependencies: + '@webassemblyjs/floating-point-hex-parser': 1.11.6 + '@webassemblyjs/helper-api-error': 1.11.6 + '@xtuc/long': 4.2.2 + + '@webassemblyjs/helper-wasm-bytecode@1.11.6': {} + + '@webassemblyjs/helper-wasm-section@1.12.1': + dependencies: + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/helper-buffer': 1.12.1 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/wasm-gen': 1.12.1 + + '@webassemblyjs/ieee754@1.11.6': + dependencies: + '@xtuc/ieee754': 1.2.0 + + '@webassemblyjs/leb128@1.11.6': + dependencies: + '@xtuc/long': 4.2.2 + + '@webassemblyjs/utf8@1.11.6': {} + + '@webassemblyjs/wasm-edit@1.12.1': + dependencies: + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/helper-buffer': 1.12.1 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/helper-wasm-section': 1.12.1 + '@webassemblyjs/wasm-gen': 1.12.1 + '@webassemblyjs/wasm-opt': 1.12.1 + '@webassemblyjs/wasm-parser': 1.12.1 + '@webassemblyjs/wast-printer': 1.12.1 + + '@webassemblyjs/wasm-gen@1.12.1': + dependencies: + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/ieee754': 1.11.6 + '@webassemblyjs/leb128': 1.11.6 + '@webassemblyjs/utf8': 1.11.6 + + '@webassemblyjs/wasm-opt@1.12.1': + dependencies: + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/helper-buffer': 1.12.1 + '@webassemblyjs/wasm-gen': 1.12.1 + '@webassemblyjs/wasm-parser': 1.12.1 + + '@webassemblyjs/wasm-parser@1.12.1': + dependencies: + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/helper-api-error': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/ieee754': 1.11.6 + '@webassemblyjs/leb128': 1.11.6 + '@webassemblyjs/utf8': 1.11.6 + + '@webassemblyjs/wast-printer@1.12.1': + dependencies: + '@webassemblyjs/ast': 1.12.1 + '@xtuc/long': 4.2.2 + + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack@5.92.1))(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4))': + dependencies: + webpack: 5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.92.1) + + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack@5.92.1))(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4))': + dependencies: + webpack: 5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.92.1) + + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack@5.92.1))(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4))': + dependencies: + webpack: 5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack@5.92.1) + + '@xtuc/ieee754@1.2.0': {} + + '@xtuc/long@4.2.2': {} + + abort-controller@3.0.0: + dependencies: + event-target-shim: 5.0.1 + + accepts@1.3.8: + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + + acorn-import-attributes@1.9.5(acorn@8.12.1): + dependencies: + acorn: 8.12.1 + + acorn-jsx@5.3.2(acorn@8.12.1): + dependencies: + acorn: 8.12.1 + + acorn-walk@8.3.3: + dependencies: + acorn: 8.12.1 + + acorn@8.12.1: {} + + ajv-keywords@3.5.2(ajv@6.12.6): + dependencies: + ajv: 6.12.6 + + ajv@6.12.6: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ajv@8.16.0: + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + + ansi-escapes@4.3.2: + dependencies: + type-fest: 0.21.3 + + ansi-regex@5.0.1: {} + + ansi-regex@6.0.1: {} + + ansi-styles@3.2.1: + dependencies: + color-convert: 1.9.3 + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + ansi-styles@5.2.0: {} + + ansi-styles@6.2.1: {} + + any-promise@1.3.0: {} + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + + arg@4.1.3: {} + + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + + argparse@2.0.1: {} + + array-flatten@1.1.1: {} + + array-union@2.1.0: {} + + astral-regex@2.0.0: {} + + async@3.2.5: {} + + atomic-sleep@1.0.0: {} + + babel-jest@29.7.0(@babel/core@7.24.7): + dependencies: + '@babel/core': 7.24.7 + '@jest/transform': 29.7.0 + '@types/babel__core': 7.20.5 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.6.3(@babel/core@7.24.7) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-istanbul@6.1.1: + dependencies: + '@babel/helper-plugin-utils': 7.24.7 + '@istanbuljs/load-nyc-config': 1.1.0 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-instrument: 5.2.1 + test-exclude: 6.0.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-jest-hoist@29.6.3: + dependencies: + '@babel/template': 7.24.7 + '@babel/types': 7.24.7 + '@types/babel__core': 7.20.5 + '@types/babel__traverse': 7.20.6 + + babel-plugin-macros@3.1.0: + dependencies: + '@babel/runtime': 7.24.7 + cosmiconfig: 7.1.0 + resolve: 1.22.8 + optional: true + + babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.7): + dependencies: + '@babel/core': 7.24.7 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.7) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.7) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.7) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.7) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.7) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.7) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.7) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.7) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.7) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.7) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.7) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.7) + + babel-preset-jest@29.6.3(@babel/core@7.24.7): + dependencies: + '@babel/core': 7.24.7 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.7) + + balanced-match@1.0.2: {} + + base64-js@1.5.1: {} + + big.js@6.2.1: {} + + binary-extensions@2.3.0: {} + + body-parser@1.20.2: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.2 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + brace-expansion@1.1.11: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + browserslist@4.23.2: + dependencies: + caniuse-lite: 1.0.30001641 + electron-to-chromium: 1.4.823 + node-releases: 2.0.14 + update-browserslist-db: 1.1.0(browserslist@4.23.2) + + bs-logger@0.2.6: + dependencies: + fast-json-stable-stringify: 2.1.0 + + bser@2.1.1: + dependencies: + node-int64: 0.4.0 + + buffer-from@1.1.2: {} + + buffer@6.0.3: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + + bundle-require@4.2.1(esbuild@0.21.5): + dependencies: + esbuild: 0.21.5 + load-tsconfig: 0.2.5 + + bytes@3.1.2: {} + + cac@6.7.14: {} + + call-bind@1.0.7: + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + + callsites@3.1.0: {} + + camelcase@5.3.1: {} + + camelcase@6.3.0: {} + + caniuse-lite@1.0.30001641: {} + + ccxt@4.3.59: + dependencies: + ws: 8.18.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + chalk@2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + chalk@5.3.0: {} + + char-regex@1.0.2: {} + + chokidar@3.6.0: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + + chrome-trace-event@1.0.4: {} + + ci-info@3.9.0: {} + + cjs-module-lexer@1.3.1: {} + + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + clone-deep@4.0.1: + dependencies: + is-plain-object: 2.0.4 + kind-of: 6.0.3 + shallow-clone: 3.0.1 + + co@4.6.0: {} + + code-block-writer@12.0.0: {} + + collect-v8-coverage@1.0.2: {} + + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.3: {} + + color-name@1.1.4: {} + + colorette@2.0.20: {} + + commander@10.0.1: {} + + commander@12.1.0: {} + + commander@2.20.3: {} + + commander@4.1.1: {} + + concat-map@0.0.1: {} + + content-disposition@0.5.4: + dependencies: + safe-buffer: 5.2.1 + + content-type@1.0.5: {} + + convert-source-map@2.0.0: {} + + cookie-signature@1.0.6: {} + + cookie@0.6.0: {} + + copy-anything@3.0.5: + dependencies: + is-what: 4.1.16 + + cors@2.8.5: + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + + cosmiconfig@7.1.0: + dependencies: + '@types/parse-json': 4.0.2 + import-fresh: 3.3.0 + parse-json: 5.2.0 + path-type: 4.0.0 + yaml: 1.10.2 + optional: true + + create-jest@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + create-require@1.1.1: {} + + cron@3.1.7: + dependencies: + '@types/luxon': 3.4.2 + luxon: 3.4.4 + + cross-spawn@7.0.3: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + dateformat@4.6.3: {} + + debug@2.6.9: + dependencies: + ms: 2.0.0 + + debug@4.3.5: + dependencies: + ms: 2.1.2 + + dedent@1.5.3(babel-plugin-macros@3.1.0): + optionalDependencies: + babel-plugin-macros: 3.1.0 + + deep-is@0.1.4: {} + + deepmerge@4.3.1: {} + + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + + depd@2.0.0: {} + + destroy@1.2.0: {} + + detect-newline@3.1.0: {} + + diff-sequences@29.6.3: {} + + diff@4.0.2: {} + + dir-glob@3.0.1: + dependencies: + path-type: 4.0.0 + + doctrine@3.0.0: + dependencies: + esutils: 2.0.3 + + eastasianwidth@0.2.0: {} + + ee-first@1.1.1: {} + + ejs@3.1.10: + dependencies: + jake: 10.9.1 + + electron-to-chromium@1.4.823: {} + + emittery@0.13.1: {} + + emoji-regex@8.0.0: {} + + emoji-regex@9.2.2: {} + + encodeurl@1.0.2: {} + + end-of-stream@1.4.4: + dependencies: + once: 1.4.0 + + enhanced-resolve@5.17.0: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.2.1 + + envinfo@7.13.0: {} + + error-ex@1.3.2: + dependencies: + is-arrayish: 0.2.1 + + es-define-property@1.0.0: + dependencies: + get-intrinsic: 1.2.4 + + es-errors@1.3.0: {} + + es-module-lexer@1.5.4: {} + + esbuild@0.21.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + + esbuild@0.23.0: + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.0 + '@esbuild/android-arm': 0.23.0 + '@esbuild/android-arm64': 0.23.0 + '@esbuild/android-x64': 0.23.0 + '@esbuild/darwin-arm64': 0.23.0 + '@esbuild/darwin-x64': 0.23.0 + '@esbuild/freebsd-arm64': 0.23.0 + '@esbuild/freebsd-x64': 0.23.0 + '@esbuild/linux-arm': 0.23.0 + '@esbuild/linux-arm64': 0.23.0 + '@esbuild/linux-ia32': 0.23.0 + '@esbuild/linux-loong64': 0.23.0 + '@esbuild/linux-mips64el': 0.23.0 + '@esbuild/linux-ppc64': 0.23.0 + '@esbuild/linux-riscv64': 0.23.0 + '@esbuild/linux-s390x': 0.23.0 + '@esbuild/linux-x64': 0.23.0 + '@esbuild/netbsd-x64': 0.23.0 + '@esbuild/openbsd-arm64': 0.23.0 + '@esbuild/openbsd-x64': 0.23.0 + '@esbuild/sunos-x64': 0.23.0 + '@esbuild/win32-arm64': 0.23.0 + '@esbuild/win32-ia32': 0.23.0 + '@esbuild/win32-x64': 0.23.0 + + escalade@3.1.2: {} + + escape-html@1.0.3: {} + + escape-string-regexp@1.0.5: {} + + escape-string-regexp@2.0.0: {} + + escape-string-regexp@4.0.0: {} + + eslint-scope@5.1.1: + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + + eslint-scope@7.2.2: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint@8.57.0: + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/regexpp': 4.11.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.0 + '@humanwhocodes/config-array': 0.11.14 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.5 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.1 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + + espree@9.6.1: + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 3.4.3 + + esprima@4.0.1: {} + + esquery@1.6.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@4.3.0: {} + + estraverse@5.3.0: {} + + esutils@2.0.3: {} + + etag@1.8.1: {} + + event-target-shim@5.0.1: {} + + events@3.3.0: {} + + execa@5.1.1: + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + + exit@0.1.2: {} + + expect@29.7.0: + dependencies: + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + + express@4.19.2: + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.2 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.6.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + + fast-copy@3.0.2: {} + + fast-deep-equal@3.1.3: {} + + fast-glob@3.3.2: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.7 + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fast-redact@3.5.0: {} + + fast-safe-stringify@2.1.1: {} + + fastest-levenshtein@1.0.16: {} + + fastq@1.17.1: + dependencies: + reusify: 1.0.4 + + fb-watchman@2.0.2: + dependencies: + bser: 2.1.1 + + file-entry-cache@6.0.1: + dependencies: + flat-cache: 3.2.0 + + filelist@1.0.4: + dependencies: + minimatch: 5.1.6 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + finalhandler@1.2.0: + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@3.2.0: + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 + rimraf: 3.0.2 + + flat@5.0.2: {} + + flatted@3.3.1: {} + + foreground-child@3.2.1: + dependencies: + cross-spawn: 7.0.3 + signal-exit: 4.1.0 + + forwarded@0.2.0: {} + + fresh@0.5.2: {} + + fs.realpath@1.0.0: {} + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + gensync@1.0.0-beta.2: {} + + get-caller-file@2.0.5: {} + + get-intrinsic@1.2.4: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + + get-package-type@0.1.0: {} + + get-stream@6.0.1: {} + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + glob-to-regexp@0.4.1: {} + + glob@10.4.5: + dependencies: + foreground-child: 3.2.1 + jackspeak: 3.4.2 + minimatch: 9.0.5 + minipass: 7.1.2 + package-json-from-dist: 1.0.0 + path-scurry: 1.11.1 + + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + globals@11.12.0: {} + + globals@13.24.0: + dependencies: + type-fest: 0.20.2 + + globby@11.1.0: + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.3.1 + merge2: 1.4.1 + slash: 3.0.0 + + gopd@1.0.1: + dependencies: + get-intrinsic: 1.2.4 + + graceful-fs@4.2.11: {} + + graphemer@1.4.0: {} + + has-flag@3.0.0: {} + + has-flag@4.0.0: {} + + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.0 + + has-proto@1.0.3: {} + + has-symbols@1.0.3: {} + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + help-me@5.0.0: {} + + html-escaper@2.0.2: {} + + http-errors@2.0.0: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + + human-signals@2.1.0: {} + + iconv-lite@0.4.24: + dependencies: + safer-buffer: 2.1.2 + + ieee754@1.2.1: {} + + ignore@5.3.1: {} + + import-fresh@3.3.0: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + import-local@3.1.0: + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + + imurmurhash@0.1.4: {} + + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + + interpret@3.1.1: {} + + ipaddr.js@1.9.1: {} + + is-arrayish@0.2.1: {} + + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.3.0 + + is-core-module@2.14.0: + dependencies: + hasown: 2.0.2 + + is-extglob@2.1.1: {} + + is-fullwidth-code-point@3.0.0: {} + + is-generator-fn@2.1.0: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-number@7.0.0: {} + + is-path-inside@3.0.3: {} + + is-plain-object@2.0.4: + dependencies: + isobject: 3.0.1 + + is-stream@2.0.1: {} + + is-what@4.1.16: {} + + isexe@2.0.0: {} + + isobject@3.0.1: {} + + istanbul-lib-coverage@3.2.2: {} + + istanbul-lib-instrument@5.2.1: + dependencies: + '@babel/core': 7.24.7 + '@babel/parser': 7.24.7 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.2 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + istanbul-lib-instrument@6.0.3: + dependencies: + '@babel/core': 7.24.7 + '@babel/parser': 7.24.7 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.2 + semver: 7.6.2 + transitivePeerDependencies: + - supports-color + + istanbul-lib-report@3.0.1: + dependencies: + istanbul-lib-coverage: 3.2.2 + make-dir: 4.0.0 + supports-color: 7.2.0 + + istanbul-lib-source-maps@4.0.1: + dependencies: + debug: 4.3.5 + istanbul-lib-coverage: 3.2.2 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + + istanbul-reports@3.1.7: + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + + jackspeak@3.4.2: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + + jake@10.9.1: + dependencies: + async: 3.2.5 + chalk: 4.1.2 + filelist: 1.0.4 + minimatch: 3.1.2 + + jest-changed-files@29.7.0: + dependencies: + execa: 5.1.1 + jest-util: 29.7.0 + p-limit: 3.1.0 + + jest-circus@29.7.0(babel-plugin-macros@3.1.0): + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + chalk: 4.1.2 + co: 4.6.0 + dedent: 1.5.3(babel-plugin-macros@3.1.0) + is-generator-fn: 2.1.0 + jest-each: 29.7.0 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + p-limit: 3.1.0 + pretty-format: 29.7.0 + pure-rand: 6.1.0 + slash: 3.0.0 + stack-utils: 2.0.6 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-cli@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): + dependencies: + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + exit: 0.1.2 + import-local: 3.1.0 + jest-config: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + jest-config@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): + dependencies: + '@babel/core': 7.24.7 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.24.7) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0(babel-plugin-macros@3.1.0) + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.7 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 20.14.10 + ts-node: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-diff@29.7.0: + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-docblock@29.7.0: + dependencies: + detect-newline: 3.1.0 + + jest-each@29.7.0: + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + jest-get-type: 29.6.3 + jest-util: 29.7.0 + pretty-format: 29.7.0 + + jest-environment-node@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + jest-mock: 29.7.0 + jest-util: 29.7.0 + + jest-get-type@29.6.3: {} + + jest-haste-map@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/graceful-fs': 4.1.9 + '@types/node': 20.14.10 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + jest-worker: 29.7.0 + micromatch: 4.0.7 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.3 + + jest-leak-detector@29.7.0: + dependencies: + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-matcher-utils@29.7.0: + dependencies: + chalk: 4.1.2 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-message-util@29.7.0: + dependencies: + '@babel/code-frame': 7.24.7 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.3 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.7 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + + jest-mock@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + jest-util: 29.7.0 + + jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): + optionalDependencies: + jest-resolve: 29.7.0 + + jest-regex-util@29.6.3: {} + + jest-resolve-dependencies@29.7.0: + dependencies: + jest-regex-util: 29.6.3 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + + jest-resolve@29.7.0: + dependencies: + chalk: 4.1.2 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0) + jest-util: 29.7.0 + jest-validate: 29.7.0 + resolve: 1.22.8 + resolve.exports: 2.0.2 + slash: 3.0.0 + + jest-runner@29.7.0: + dependencies: + '@jest/console': 29.7.0 + '@jest/environment': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + chalk: 4.1.2 + emittery: 0.13.1 + graceful-fs: 4.2.11 + jest-docblock: 29.7.0 + jest-environment-node: 29.7.0 + jest-haste-map: 29.7.0 + jest-leak-detector: 29.7.0 + jest-message-util: 29.7.0 + jest-resolve: 29.7.0 + jest-runtime: 29.7.0 + jest-util: 29.7.0 + jest-watcher: 29.7.0 + jest-worker: 29.7.0 + p-limit: 3.1.0 + source-map-support: 0.5.13 + transitivePeerDependencies: + - supports-color + + jest-runtime@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/globals': 29.7.0 + '@jest/source-map': 29.6.3 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + chalk: 4.1.2 + cjs-module-lexer: 1.3.1 + collect-v8-coverage: 1.0.2 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + slash: 3.0.0 + strip-bom: 4.0.0 + transitivePeerDependencies: + - supports-color + + jest-snapshot@29.7.0: + dependencies: + '@babel/core': 7.24.7 + '@babel/generator': 7.24.7 + '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.24.7) + '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.24.7) + '@babel/types': 7.24.7 + '@jest/expect-utils': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.7) + chalk: 4.1.2 + expect: 29.7.0 + graceful-fs: 4.2.11 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + natural-compare: 1.4.0 + pretty-format: 29.7.0 + semver: 7.6.2 + transitivePeerDependencies: + - supports-color + + jest-util@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + chalk: 4.1.2 + ci-info: 3.9.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + + jest-validate@29.7.0: + dependencies: + '@jest/types': 29.6.3 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.6.3 + leven: 3.1.0 + pretty-format: 29.7.0 + + jest-watcher@29.7.0: + dependencies: + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.10 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + emittery: 0.13.1 + jest-util: 29.7.0 + string-length: 4.0.2 + + jest-worker@27.5.1: + dependencies: + '@types/node': 20.14.10 + merge-stream: 2.0.0 + supports-color: 8.1.1 + + jest-worker@29.7.0: + dependencies: + '@types/node': 20.14.10 + jest-util: 29.7.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + + jest@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): + dependencies: + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + '@jest/types': 29.6.3 + import-local: 3.1.0 + jest-cli: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + joycon@3.1.1: {} + + js-tokens@4.0.0: {} + + js-yaml@3.14.1: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + + js-yaml@4.1.0: + dependencies: + argparse: 2.0.1 + + jsesc@2.5.2: {} + + json-buffer@3.0.1: {} + + json-parse-even-better-errors@2.3.1: {} + + json-schema-traverse@0.4.1: {} + + json-schema-traverse@1.0.0: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + json5@2.2.3: {} + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + kind-of@6.0.3: {} + + kleur@3.0.3: {} + + leven@3.1.0: {} + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + lilconfig@3.1.2: {} + + lines-and-columns@1.2.4: {} + + load-tsconfig@0.2.5: {} + + loader-runner@4.3.0: {} + + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lodash.memoize@4.1.2: {} + + lodash.merge@4.6.2: {} + + lodash.sortby@4.7.0: {} + + lodash.truncate@4.4.2: {} + + lodash@4.17.21: {} + + lru-cache@10.4.3: {} + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + luxon@3.4.4: {} + + make-dir@4.0.0: + dependencies: + semver: 7.6.2 + + make-error@1.3.6: {} + + makeerror@1.0.12: + dependencies: + tmpl: 1.0.5 + + media-typer@0.3.0: {} + + merge-descriptors@1.0.1: {} + + merge-stream@2.0.0: {} + + merge2@1.4.1: {} + + methods@1.1.2: {} + + micromatch@4.0.7: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + + mime-db@1.52.0: {} + + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + + mime@1.6.0: {} + + mimic-fn@2.1.0: {} + + minimatch@3.1.2: + dependencies: + brace-expansion: 1.1.11 + + minimatch@5.1.6: + dependencies: + brace-expansion: 2.0.1 + + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + + minimist@1.2.8: {} + + minipass@7.1.2: {} + + ms@2.0.0: {} + + ms@2.1.2: {} + + ms@2.1.3: {} + + mz@2.7.0: + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + + nanoid@3.3.7: + optional: true + + natural-compare@1.4.0: {} + + negotiator@0.6.3: {} + + neo-async@2.6.2: {} + + node-int64@0.4.0: {} + + node-releases@2.0.14: {} + + normalize-path@3.0.0: {} + + npm-run-path@4.0.1: + dependencies: + path-key: 3.1.1 + + object-assign@4.1.1: {} + + object-inspect@1.13.2: {} + + on-exit-leak-free@2.1.2: {} + + on-finished@2.4.1: + dependencies: + ee-first: 1.1.1 + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + onetime@5.1.2: + dependencies: + mimic-fn: 2.1.0 + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + p-try@2.2.0: {} + + package-json-from-dist@1.0.0: {} + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + parse-json@5.2.0: + dependencies: + '@babel/code-frame': 7.24.7 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + + parseurl@1.3.3: {} + + path-exists@4.0.0: {} + + path-is-absolute@1.0.1: {} + + path-key@3.1.1: {} + + path-parse@1.0.7: {} + + path-scurry@1.11.1: + dependencies: + lru-cache: 10.4.3 + minipass: 7.1.2 + + path-to-regexp@0.1.7: {} + + path-type@4.0.0: {} + + picocolors@1.0.1: {} + + picomatch@2.3.1: {} + + pino-abstract-transport@1.2.0: + dependencies: + readable-stream: 4.5.2 + split2: 4.2.0 + + pino-pretty@11.2.1: + dependencies: + colorette: 2.0.20 + dateformat: 4.6.3 + fast-copy: 3.0.2 + fast-safe-stringify: 2.1.1 + help-me: 5.0.0 + joycon: 3.1.1 + minimist: 1.2.8 + on-exit-leak-free: 2.1.2 + pino-abstract-transport: 1.2.0 + pump: 3.0.0 + readable-stream: 4.5.2 + secure-json-parse: 2.7.0 + sonic-boom: 4.0.1 + strip-json-comments: 3.1.1 + + pino-std-serializers@7.0.0: {} + + pino@9.2.0: + dependencies: + atomic-sleep: 1.0.0 + fast-redact: 3.5.0 + on-exit-leak-free: 2.1.2 + pino-abstract-transport: 1.2.0 + pino-std-serializers: 7.0.0 + process-warning: 3.0.0 + quick-format-unescaped: 4.0.4 + real-require: 0.2.0 + safe-stable-stringify: 2.4.3 + sonic-boom: 4.0.1 + thread-stream: 3.1.0 + + pirates@4.0.6: {} + + pkg-dir@4.2.0: + dependencies: + find-up: 4.1.0 + + postcss-load-config@4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): + dependencies: + lilconfig: 3.1.2 + yaml: 2.4.5 + optionalDependencies: + postcss: 8.4.39 + ts-node: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + + postcss@8.4.39: + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.1 + source-map-js: 1.2.0 + optional: true + + prelude-ls@1.2.1: {} + + prettier@3.3.2: {} + + pretty-format@29.7.0: + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.3.1 + + prisma@5.15.0: + dependencies: + '@prisma/engines': 5.15.0 + + process-warning@3.0.0: {} + + process@0.11.10: {} + + prompts@2.4.2: + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + + proxy-addr@2.0.7: + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + + pump@3.0.0: + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + + punycode@2.3.1: {} + + pure-rand@6.1.0: {} + + qs@6.11.0: + dependencies: + side-channel: 1.0.6 + + queue-microtask@1.2.3: {} + + quick-format-unescaped@4.0.4: {} + + randombytes@2.1.0: + dependencies: + safe-buffer: 5.2.1 + + range-parser@1.2.1: {} + + raw-body@2.5.2: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + + react-is@18.3.1: {} + + readable-stream@4.5.2: + dependencies: + abort-controller: 3.0.0 + buffer: 6.0.3 + events: 3.3.0 + process: 0.11.10 + string_decoder: 1.3.0 + + readdirp@3.6.0: + dependencies: + picomatch: 2.3.1 + + real-require@0.2.0: {} + + rechoir@0.8.0: + dependencies: + resolve: 1.22.8 + + regenerator-runtime@0.14.1: + optional: true + + require-directory@2.1.1: {} + + require-from-string@2.0.2: {} + + resolve-cwd@3.0.0: + dependencies: + resolve-from: 5.0.0 + + resolve-from@4.0.0: {} + + resolve-from@5.0.0: {} + + resolve.exports@2.0.2: {} + + resolve@1.22.8: + dependencies: + is-core-module: 2.14.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + + reusify@1.0.4: {} + + rimraf@3.0.2: + dependencies: + glob: 7.2.3 + + rollup@4.18.1: + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.18.1 + '@rollup/rollup-android-arm64': 4.18.1 + '@rollup/rollup-darwin-arm64': 4.18.1 + '@rollup/rollup-darwin-x64': 4.18.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.18.1 + '@rollup/rollup-linux-arm-musleabihf': 4.18.1 + '@rollup/rollup-linux-arm64-gnu': 4.18.1 + '@rollup/rollup-linux-arm64-musl': 4.18.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.18.1 + '@rollup/rollup-linux-riscv64-gnu': 4.18.1 + '@rollup/rollup-linux-s390x-gnu': 4.18.1 + '@rollup/rollup-linux-x64-gnu': 4.18.1 + '@rollup/rollup-linux-x64-musl': 4.18.1 + '@rollup/rollup-win32-arm64-msvc': 4.18.1 + '@rollup/rollup-win32-ia32-msvc': 4.18.1 + '@rollup/rollup-win32-x64-msvc': 4.18.1 + fsevents: 2.3.3 + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + safe-buffer@5.2.1: {} + + safe-stable-stringify@2.4.3: {} + + safer-buffer@2.1.2: {} + + schema-utils@3.3.0: + dependencies: + '@types/json-schema': 7.0.15 + ajv: 6.12.6 + ajv-keywords: 3.5.2(ajv@6.12.6) + + secure-json-parse@2.7.0: {} + + semver@6.3.1: {} + + semver@7.6.2: {} + + send@0.18.0: + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + + serialize-javascript@6.0.2: + dependencies: + randombytes: 2.1.0 + + serve-static@1.15.0: + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + + setprototypeof@1.2.0: {} + + shallow-clone@3.0.1: + dependencies: + kind-of: 6.0.3 + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + side-channel@1.0.6: + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + object-inspect: 1.13.2 + + signal-exit@3.0.7: {} + + signal-exit@4.1.0: {} + + sisteransi@1.0.5: {} + + slash@3.0.0: {} + + slice-ansi@4.0.0: + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + + sonic-boom@4.0.1: + dependencies: + atomic-sleep: 1.0.0 + + source-map-js@1.2.0: + optional: true + + source-map-support@0.5.13: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + + source-map-support@0.5.21: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + + source-map@0.6.1: {} + + source-map@0.7.4: {} + + source-map@0.8.0-beta.0: + dependencies: + whatwg-url: 7.1.0 + + split2@4.2.0: {} + + sprintf-js@1.0.3: {} + + stack-utils@2.0.6: + dependencies: + escape-string-regexp: 2.0.0 + + statuses@2.0.1: {} + + string-length@4.0.2: + dependencies: + char-regex: 1.0.2 + strip-ansi: 6.0.1 + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + string-width@5.1.2: + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.0 + + string_decoder@1.3.0: + dependencies: + safe-buffer: 5.2.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-ansi@7.1.0: + dependencies: + ansi-regex: 6.0.1 + + strip-bom@4.0.0: {} + + strip-final-newline@2.0.0: {} + + strip-json-comments@3.1.1: {} + + sucrase@3.35.0: + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + commander: 4.1.1 + glob: 10.4.5 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.6 + ts-interface-checker: 0.1.13 + + superjson@2.2.1: + dependencies: + copy-anything: 3.0.5 + + supports-color@5.5.0: + dependencies: + has-flag: 3.0.0 + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + supports-color@8.1.1: + dependencies: + has-flag: 4.0.0 + + supports-preserve-symlinks-flag@1.0.0: {} + + table@6.8.2: + dependencies: + ajv: 8.16.0 + lodash.truncate: 4.4.2 + slice-ansi: 4.0.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + tapable@2.2.1: {} + + technicalindicators@3.1.0: + dependencies: + '@types/node': 6.14.13 + + terser-webpack-plugin@5.3.10(esbuild@0.23.0)(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4)): + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.2 + terser: 5.31.2 + webpack: 5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4) + optionalDependencies: + esbuild: 0.23.0 + + terser@5.31.2: + dependencies: + '@jridgewell/source-map': 0.3.6 + acorn: 8.12.1 + commander: 2.20.3 + source-map-support: 0.5.21 + + test-exclude@6.0.0: + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + + text-table@0.2.0: {} + + thenify-all@1.6.0: + dependencies: + thenify: 3.3.1 + + thenify@3.3.1: + dependencies: + any-promise: 1.3.0 + + thread-stream@3.1.0: + dependencies: + real-require: 0.2.0 + + tmpl@1.0.5: {} + + to-fast-properties@2.0.0: {} + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + toidentifier@1.0.1: {} + + tr46@1.0.1: + dependencies: + punycode: 2.3.1 + + tree-kill@1.2.2: {} + + ts-api-utils@1.3.0(typescript@5.5.3): + dependencies: + typescript: 5.5.3 + + ts-interface-checker@0.1.13: {} + + ts-jest@29.2.1(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)))(typescript@5.5.3): + dependencies: + bs-logger: 0.2.6 + ejs: 3.1.10 + fast-json-stable-stringify: 2.1.0 + jest: 29.7.0(@types/node@20.14.10)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + jest-util: 29.7.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.6.2 + typescript: 5.5.3 + yargs-parser: 21.1.1 + optionalDependencies: + '@babel/core': 7.24.7 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.24.7) + + ts-loader@9.5.1(typescript@5.5.3)(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4)): + dependencies: + chalk: 4.1.2 + enhanced-resolve: 5.17.0 + micromatch: 4.0.7 + semver: 7.6.2 + source-map: 0.7.4 + typescript: 5.5.3 + webpack: 5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4) + + ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.14.10 + acorn: 8.12.1 + acorn-walk: 8.3.3 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.5.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + + tslib@2.6.3: {} + + tsup@8.1.0(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))(typescript@5.5.3): + dependencies: + bundle-require: 4.2.1(esbuild@0.21.5) + cac: 6.7.14 + chokidar: 3.6.0 + debug: 4.3.5 + esbuild: 0.21.5 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) + resolve-from: 5.0.0 + rollup: 4.18.1 + source-map: 0.8.0-beta.0 + sucrase: 3.35.0 + tree-kill: 1.2.2 + optionalDependencies: + postcss: 8.4.39 + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + - ts-node + + turbo-darwin-64@2.0.6: + optional: true + + turbo-darwin-arm64@2.0.6: + optional: true + + turbo-linux-64@2.0.6: + optional: true + + turbo-linux-arm64@2.0.6: + optional: true + + turbo-windows-64@2.0.6: + optional: true + + turbo-windows-arm64@2.0.6: + optional: true + + turbo@2.0.6: + optionalDependencies: + turbo-darwin-64: 2.0.6 + turbo-darwin-arm64: 2.0.6 + turbo-linux-64: 2.0.6 + turbo-linux-arm64: 2.0.6 + turbo-windows-64: 2.0.6 + turbo-windows-arm64: 2.0.6 + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + type-detect@4.0.8: {} + + type-fest@0.20.2: {} + + type-fest@0.21.3: {} + + type-is@1.6.18: + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + + typescript-eslint@7.16.0(eslint@8.57.0)(typescript@5.5.3): + dependencies: + '@typescript-eslint/eslint-plugin': 7.16.0(@typescript-eslint/parser@7.16.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/parser': 7.16.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.16.0(eslint@8.57.0)(typescript@5.5.3) + eslint: 8.57.0 + optionalDependencies: + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + + typescript@5.5.3: {} + + undici-types@5.26.5: {} + + unpipe@1.0.0: {} + + update-browserslist-db@1.1.0(browserslist@4.23.2): + dependencies: + browserslist: 4.23.2 + escalade: 3.1.2 + picocolors: 1.0.1 + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + utils-merge@1.0.1: {} + + v8-compile-cache-lib@3.0.1: {} + + v8-to-istanbul@9.3.0: + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + '@types/istanbul-lib-coverage': 2.0.6 + convert-source-map: 2.0.0 + + vary@1.1.2: {} + + walker@1.0.8: + dependencies: + makeerror: 1.0.12 + + watchpack@2.4.1: + dependencies: + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + + webidl-conversions@4.0.2: {} + + webpack-cli@5.1.4(webpack@5.92.1): + dependencies: + '@discoveryjs/json-ext': 0.5.7 + '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack@5.92.1))(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4)) + '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack@5.92.1))(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4)) + '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack@5.92.1))(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4)) + colorette: 2.0.20 + commander: 10.0.1 + cross-spawn: 7.0.3 + envinfo: 7.13.0 + fastest-levenshtein: 1.0.16 + import-local: 3.1.0 + interpret: 3.1.1 + rechoir: 0.8.0 + webpack: 5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4) + webpack-merge: 5.10.0 + + webpack-merge@5.10.0: + dependencies: + clone-deep: 4.0.1 + flat: 5.0.2 + wildcard: 2.0.1 + + webpack-node-externals@3.0.0: {} + + webpack-sources@3.2.3: {} + + webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4): + dependencies: + '@types/eslint-scope': 3.7.7 + '@types/estree': 1.0.5 + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/wasm-edit': 1.12.1 + '@webassemblyjs/wasm-parser': 1.12.1 + acorn: 8.12.1 + acorn-import-attributes: 1.9.5(acorn@8.12.1) + browserslist: 4.23.2 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.17.0 + es-module-lexer: 1.5.4 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.10(esbuild@0.23.0)(webpack@5.92.1(esbuild@0.23.0)(webpack-cli@5.1.4)) + watchpack: 2.4.1 + webpack-sources: 3.2.3 + optionalDependencies: + webpack-cli: 5.1.4(webpack@5.92.1) + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + + whatwg-url@7.1.0: + dependencies: + lodash.sortby: 4.7.0 + tr46: 1.0.1 + webidl-conversions: 4.0.2 + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + wildcard@2.0.1: {} + + word-wrap@1.2.5: {} + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrap-ansi@8.1.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + + wrappy@1.0.2: {} + + write-file-atomic@4.0.2: + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + + ws@8.18.0: {} + + y18n@5.0.8: {} + + yallist@3.1.1: {} + + yaml@1.10.2: + optional: true + + yaml@2.4.5: {} + + yargs-parser@21.1.1: {} + + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.1.2 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + yn@3.1.1: {} + + yocto-queue@0.1.0: {} + + zod-prisma-types@3.1.8: + dependencies: + '@prisma/generator-helper': 5.16.2 + code-block-writer: 12.0.0 + lodash: 4.17.21 + zod: 3.23.8 + + zod@3.23.8: {} From 407923e86bd1191736ec886501459d336340e9e2 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 13:03:32 +0100 Subject: [PATCH 48/68] chore(env): disable NEXT_PUBLIC_STATIC by default --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 1b82a02a..9ec00099 100644 --- a/.env.example +++ b/.env.example @@ -7,7 +7,7 @@ NEXT_PUBLIC_PROCESSOR_URL="http://localhost:4000" NEXT_PUBLIC_PROCESSOR_ENABLE_TRPC=true # Build NextJS as a static app (`export`) instead of `standalone` # Accepts: "true" | "" -NEXT_PUBLIC_STATIC=true +NEXT_PUBLIC_STATIC= DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:5432/postgres" ADMIN_PASSWORD=opentrader NEXT_PUBLIC_CANDLES_SERVICE_API_URL="http://localhost:5001" From 553bc28199a629554034856d8881cc3331604624 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 13:07:07 +0100 Subject: [PATCH 49/68] chore(Docker): fix frontend dist dir --- Dockerfile | 4 ++-- pro.Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 57047a86..45f809fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,7 +73,7 @@ RUN corepack enable WORKDIR /app -COPY --from=installer /app/pro/frontend/out ./pro/frontend/out +COPY --from=installer /app/pro/frontend/dist ./pro/frontend/dist COPY --from=installer /app/pro/processor ./pro/processor COPY --from=installer /app/package.json ./package.json COPY --from=installer /app/pnpm-lock.yaml ./pnpm-lock.yaml @@ -93,7 +93,7 @@ RUN addgroup --system --gid 1001 expressjs RUN adduser --system --uid 1001 expressjs USER expressjs -COPY --from=optimizer /app/pro/frontend/out ./pro/frontend/out +COPY --from=optimizer /app/pro/frontend/dist ./pro/frontend/dist COPY --from=optimizer /app/pro/processor ./pro/processor COPY --from=optimizer /app/node_modules ./node_modules diff --git a/pro.Dockerfile b/pro.Dockerfile index e9ada840..fffd3b48 100644 --- a/pro.Dockerfile +++ b/pro.Dockerfile @@ -85,7 +85,7 @@ RUN corepack enable WORKDIR /app -COPY --from=installer /app/pro/frontend/out ./pro/frontend/out +COPY --from=installer /app/pro/frontend/dist ./pro/frontend/dist COPY --from=installer /app/pro/processor ./pro/processor COPY --from=installer /app/package.json ./package.json COPY --from=installer /app/pnpm-lock.yaml ./pnpm-lock.yaml @@ -105,7 +105,7 @@ RUN addgroup --system --gid 1001 expressjs RUN adduser --system --uid 1001 expressjs USER expressjs -COPY --from=optimizer /app/pro/frontend/out ./pro/frontend/out +COPY --from=optimizer /app/pro/frontend/dist ./pro/frontend/dist COPY --from=optimizer /app/pro/processor ./pro/processor COPY --from=optimizer /app/node_modules ./node_modules From 55e993b4561a596b6a5af9835457ceabdc013752 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 13:07:15 +0100 Subject: [PATCH 50/68] chore: update pro package --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index b5ee3934..0d6d4122 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit b5ee393485d405ce2e01d31d636efd8a3683d265 +Subproject commit 0d6d412223b1bf92b2edba98ba79c28961c17254 From 6323a3899f628d046d1cc15e20b7a15099935d23 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 13:17:17 +0100 Subject: [PATCH 51/68] chore(Dockerfile): fix executable file path --- Dockerfile | 4 ++-- pro.Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 45f809fc..f02b691c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,7 @@ COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml # Copy Prisma Schema as it is not included in `/json` dir COPY --from=builder /app/out/full/packages/prisma/src/schema.prisma ./packages/prisma/src/schema.prisma RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch -RUN pnpm install --offline +RUN pnpm install --prefer-offline # Build the project and its dependencies COPY --from=builder /app/out/full/ . @@ -98,4 +98,4 @@ COPY --from=optimizer /app/pro/processor ./pro/processor COPY --from=optimizer /app/node_modules ./node_modules WORKDIR /app/pro/processor -CMD node dist/main.js +CMD node dist/main.mjs diff --git a/pro.Dockerfile b/pro.Dockerfile index fffd3b48..0d1a659d 100644 --- a/pro.Dockerfile +++ b/pro.Dockerfile @@ -110,4 +110,4 @@ COPY --from=optimizer /app/pro/processor ./pro/processor COPY --from=optimizer /app/node_modules ./node_modules WORKDIR /app/pro/processor -CMD node dist/main.js +CMD node dist/main.mjs From 85f843330d7d98c96f2feadd4afd356e3d3372d4 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 13:46:56 +0100 Subject: [PATCH 52/68] fix(cli): wrong prisma version --- apps/cli/package.json | 2 +- pnpm-lock.yaml | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 321a77b1..6126cff1 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -41,7 +41,7 @@ "@opentrader/processing": "workspace:*", "@opentrader/tools": "workspace:*", "@opentrader/trpc": "workspace:*", - "@prisma/client": "5.16.2", + "@prisma/client": "5.15.0", "@trpc/client": "^10.45.2", "@trpc/server": "^10.45.2", "ccxt": "4.3.59", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c53db609..a2d3aebf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ importers: specifier: workspace:* version: link:../../packages/trpc '@prisma/client': - specifier: 5.16.2 - version: 5.16.2(prisma@5.15.0) + specifier: 5.15.0 + version: 5.15.0(prisma@5.15.0) '@trpc/client': specifier: ^10.45.2 version: 10.45.2(@trpc/server@10.45.2) @@ -1362,15 +1362,6 @@ packages: prisma: optional: true - '@prisma/client@5.16.2': - resolution: {integrity: sha512-+1lmkhR9gHWcTC5oghm2ZKpWljyWdzfazCVlLKUWXVmwHSf52g81aZ8qb6Km5Bs025yBi7puLp3qSLEvktoUtw==} - engines: {node: '>=16.13'} - peerDependencies: - prisma: '*' - peerDependenciesMeta: - prisma: - optional: true - '@prisma/debug@5.15.0': resolution: {integrity: sha512-QpEAOjieLPc/4sMny/WrWqtpIAmBYsgqwWlWwIctqZO0AbhQ9QcT6x2Ut3ojbDo/pFRCCA1Z1+xm2MUy7fAkZA==} @@ -4417,10 +4408,6 @@ snapshots: optionalDependencies: prisma: 5.15.0 - '@prisma/client@5.16.2(prisma@5.15.0)': - optionalDependencies: - prisma: 5.15.0 - '@prisma/debug@5.15.0': {} '@prisma/debug@5.16.2': {} From a99ab164e9b813b2c78504505135c7e3a85d4720 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 14:27:45 +0100 Subject: [PATCH 53/68] feat(cli): validate strategy params before starting the bot --- apps/cli/src/api/run-backtest.ts | 14 ++++++++++++++ apps/cli/src/api/run-trading.ts | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/apps/cli/src/api/run-backtest.ts b/apps/cli/src/api/run-backtest.ts index 776cf42f..298a308c 100644 --- a/apps/cli/src/api/run-backtest.ts +++ b/apps/cli/src/api/run-backtest.ts @@ -36,6 +36,20 @@ export async function runBacktest( }; } + // Validate strategy params + const { success: isValidSchema, error } = + strategy.strategyFn.schema.safeParse(botConfig.settings); + if (!isValidSchema) { + logger.error(error.message); + logger.error( + `The params for "${strategyName}" strategy are invalid. Check the "config.dev.json5"`, + ); + + return { + result: undefined, + }; + } + const botTimeframe = options.timeframe || botConfig.timeframe || null; const botPair = options.pair || botConfig.pair; const [baseCurrency, quoteCurrency] = botPair.split("/"); diff --git a/apps/cli/src/api/run-trading.ts b/apps/cli/src/api/run-trading.ts index 5d89da3e..82a86b61 100644 --- a/apps/cli/src/api/run-trading.ts +++ b/apps/cli/src/api/run-trading.ts @@ -43,6 +43,20 @@ export async function runTrading( }; } + // Validate strategy params + const { success: isValidSchema, error } = + strategy.strategyFn.schema.safeParse(config.settings); + if (!isValidSchema) { + logger.error(error.message); + logger.error( + `The params for "${strategyName}" strategy are invalid. Check the "config.dev.json5"`, + ); + + return { + result: undefined, + }; + } + let bot = await xprisma.bot.custom.findUnique({ where: { label: config.label || "default", From a4858a0e5e165b3e0ace9081bac30a423e06cf60 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 14:29:55 +0100 Subject: [PATCH 54/68] chore: update pro package --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index 0d6d4122..a4a9d60d 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit 0d6d412223b1bf92b2edba98ba79c28961c17254 +Subproject commit a4a9d60d2fa92032cf5f956ed21bbf024a009581 From fb3b027d254e87a570e5b815450ec8d1d0ee21a3 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 14:36:35 +0100 Subject: [PATCH 55/68] refactor(db): hide new prisma instance message --- packages/db/src/xprisma.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/db/src/xprisma.ts b/packages/db/src/xprisma.ts index f3432346..88b64da9 100644 --- a/packages/db/src/xprisma.ts +++ b/packages/db/src/xprisma.ts @@ -5,7 +5,7 @@ import { smartTradeModel } from "./extension/models/smart-trade.model.js"; import { customBotModel } from "./extension/models/custom-bot.model.js"; function newPrismaClientInstance() { - console.log("❕ DB: Created new instance of PrismaClient"); + // console.log("❕ DB: Created new instance of PrismaClient"); return new PrismaClient(); } From 81300a666211e8e3b7a349537dc3a67d5d98856d Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 15:28:53 +0100 Subject: [PATCH 56/68] chore: rename cli script --- bin/{devtrader.sh => cli.sh} | 0 package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename bin/{devtrader.sh => cli.sh} (100%) diff --git a/bin/devtrader.sh b/bin/cli.sh similarity index 100% rename from bin/devtrader.sh rename to bin/cli.sh diff --git a/package.json b/package.json index 418c4653..2b69376b 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ }, "bin": { "dev": "./bin/dev.sh", - "devtrader": "./bin/devtrader.sh" + "cli": "./bin/cli.sh" } } From ee5bb45474d5063bc2852173ceb3cbbd652738ed Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 15:28:58 +0100 Subject: [PATCH 57/68] docs(README.md): add daemon commands --- README.md | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f5444dcb..7c53cf24 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,10 @@ $ cp .env.example .env $ pnpm install ``` -2. Build `/packages/**` +2. Build packages ```bash -$ turbo run build --filter='./packages/*' +$ turbo run build ``` 3. Run db migrations @@ -108,27 +108,49 @@ Create the strategy configuration file `config.dev.json5`. We will use the `grid ## Run a backtest -Command: `pnpm opentrader backtest --from --to -t ` +Command: `./bin/cli.sh backtest --from --to -t ` Example running a `grid` strategy on `1h` timeframe. ```bash -$ pnpm opentrader backtest grid --from 2024-03-01 --to 2024-06-01 -t 1h +$ bin/cli.sh backtest grid --from 2024-03-01 --to 2024-06-01 -t 1h ``` > To get more accurate results, use a smaller timeframe, e.g. 1m, however, it will take more time to download OHLC data from the exchange. ## Live trading -Command: `pnpm opentrader trade ` +## Starting the daemon + +Before running live trading, you need to start the daemon: + +```bash +$ bin/cli.sh up +``` + +Now the daemon is ready to listen for incoming commands. + +> Tip: To run the daemon in the background, use: `bin/cli.sh up -d` + +## Running a Live Trading + +Command: `bin/cli.sh trade ` Example running a live trading with `grid` strategy. ```bash -$ pnpm opentrader trade grid +$ bin/cli.sh trade grid ``` -> After `Ctrl+C`, the orders created by the bot will remain on the exchange. To cancel them, use the `pnpm opentrader stop` command. +> To stop the live trading, run `bin/cli.sh stop` + +## Stop the daemon + +To stop the daemon, run the following command: + +```bash +$ bin/cli.sh down +``` # UI @@ -148,7 +170,7 @@ Run frontend app: ```shell $ pnpm i -$ turbo run build --filter='./packages/*' +$ turbo run build $ turbo run dev ``` From 8e3c7592ecc793acc2522a39ed3a1a584ef9190e Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 17:20:17 +0100 Subject: [PATCH 58/68] fix(prisma): use `tsx` instead of `ts-node` which doesn't support ESM --- packages/prisma/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/prisma/package.json b/packages/prisma/package.json index 9ea545f9..180fec4c 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -20,6 +20,7 @@ "@opentrader/tsconfig": "workspace:*", "@types/node": "^20.14.10", "ts-node": "10.9.2", + "tsx": "^4.16.2", "typescript": "5.5.3" }, "dependencies": { @@ -32,6 +33,6 @@ }, "prisma": { "schema": "src/schema.prisma", - "seed": "ts-node seed.ts" + "seed": "tsx seed.ts" } } From 69ecc17a92dc76f0108eb1467d4b584e8467f057 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 17:20:44 +0100 Subject: [PATCH 59/68] chore: update pro package --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index a4a9d60d..f662d8ea 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit a4a9d60d2fa92032cf5f956ed21bbf024a009581 +Subproject commit f662d8ea092157ffb0d587bb3f069ede4dd6967d From 0d910df6b8c3a52a235c7dfefa8679d47b8da95c Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 17:21:41 +0100 Subject: [PATCH 60/68] chore: update pnpm-lock --- pnpm-lock.yaml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a2d3aebf..d904c4ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -559,6 +559,9 @@ importers: ts-node: specifier: 10.9.2 version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) + tsx: + specifier: ^4.16.2 + version: 4.16.2 typescript: specifier: 5.5.3 version: 5.5.3 @@ -2408,6 +2411,9 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + get-tsconfig@4.7.5: + resolution: {integrity: sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -2602,9 +2608,8 @@ packages: resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} engines: {node: '>=8'} - jackspeak@3.4.2: - resolution: {integrity: sha512-qH3nOSj8q/8+Eg8LUPOq3C+6HWkpUioIjDsq1+D4zY91oZvpPttw8GwtF1nReRYKXl+1AORyFqtm2f5Q1SB6/Q==} - engines: {node: 14 >=14.21 || 16 >=16.20 || >=18} + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} jake@10.9.1: resolution: {integrity: sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==} @@ -3198,6 +3203,9 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + resolve.exports@2.0.2: resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} @@ -3548,6 +3556,11 @@ packages: typescript: optional: true + tsx@4.16.2: + resolution: {integrity: sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==} + engines: {node: '>=18.0.0'} + hasBin: true + turbo-darwin-64@2.0.6: resolution: {integrity: sha512-XpgBwWj3Ggmz/gQVqXdMKXHC1iFPMDiuwugLwSzE7Ih0O13JuNtYZKhQnopvbDQnFQCeRq2Vsm5OTWabg/oB/g==} cpu: [x64] @@ -5577,6 +5590,10 @@ snapshots: get-stream@6.0.1: {} + get-tsconfig@4.7.5: + dependencies: + resolve-pkg-maps: 1.0.0 + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -5590,7 +5607,7 @@ snapshots: glob@10.4.5: dependencies: foreground-child: 3.2.1 - jackspeak: 3.4.2 + jackspeak: 3.4.3 minimatch: 9.0.5 minipass: 7.1.2 package-json-from-dist: 1.0.0 @@ -5766,7 +5783,7 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 - jackspeak@3.4.2: + jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 optionalDependencies: @@ -6485,6 +6502,8 @@ snapshots: resolve-from@5.0.0: {} + resolve-pkg-maps@1.0.0: {} + resolve.exports@2.0.2: {} resolve@1.22.8: @@ -6860,6 +6879,13 @@ snapshots: - supports-color - ts-node + tsx@4.16.2: + dependencies: + esbuild: 0.21.5 + get-tsconfig: 4.7.5 + optionalDependencies: + fsevents: 2.3.3 + turbo-darwin-64@2.0.6: optional: true From 6da9be3c1076ebe5c17c2d371d7457213eff30cc Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 20:06:27 +0100 Subject: [PATCH 61/68] feat(prisma): switch from Postgres to SQLite connector (#40) --- .env.example | 3 +- .gitignore | 1 + apps/cli/src/utils/bot.ts | 2 +- packages/db/eslint.config.js | 2 +- packages/db/src/entities/order.entity.ts | 7 +- .../db/src/entities/smart-trade.entity.ts | 10 +- .../src/extension/models/custom-bot.model.ts | 62 +++++- .../db/src/extension/models/grid-bot.model.ts | 43 ++++- .../db/src/extension/models/order.model.ts | 5 +- packages/db/src/xprisma.ts | 2 +- packages/exchanges/src/exchange.provider.ts | 4 +- .../cache/providers/prisma-cache.provider.ts | 3 +- packages/prisma/seed.ts | 6 +- .../20240604011809_init/migration.sql | 101 ++++++++++ .../prisma/src/migrations/migration_lock.toml | 2 +- .../20230830142318_/migration.sql | 0 .../20230830142453_/migration.sql | 0 .../20230830144602_/migration.sql | 0 .../20230831124542_/migration.sql | 0 .../20230831124734_/migration.sql | 0 .../20230831125211_/migration.sql | 0 .../20230831125340_/migration.sql | 0 .../20230831125359_/migration.sql | 0 .../20230831125411_/migration.sql | 0 .../20230831125508_/migration.sql | 0 .../20230831125929_/migration.sql | 0 .../20230831130507_/migration.sql | 0 .../20230901025107_remove_bina/migration.sql | 0 .../20230901032428_bot/migration.sql | 0 .../20230901032632_/migration.sql | 0 .../20230901033525_owner/migration.sql | 0 .../20230901033542_/migration.sql | 0 .../20230901034007_/migration.sql | 0 .../20230901034042_/migration.sql | 0 .../20230901034155_/migration.sql | 0 .../20230901034606_/migration.sql | 0 .../20230901034623_/migration.sql | 0 .../20230901035704_/migration.sql | 0 .../migration.sql | 0 .../20230905122615_/migration.sql | 0 .../20230905123204_/migration.sql | 0 .../20230906003822_/migration.sql | 0 .../20230906003915_/migration.sql | 0 .../20230908174225_/migration.sql | 0 .../20230909040738_/migration.sql | 0 .../20230909201917_/migration.sql | 0 .../20230909203138_/migration.sql | 0 .../20230911103320_/migration.sql | 0 .../20230911103715_/migration.sql | 0 .../20230911104030_/migration.sql | 0 .../20230911104516_/migration.sql | 0 .../20230911105518_/migration.sql | 0 .../20230911122909_/migration.sql | 0 .../20230912103646_/migration.sql | 0 .../20230916235301_/migration.sql | 0 .../20230916235629_/migration.sql | 0 .../20230917021233_/migration.sql | 0 .../20230918043729_/migration.sql | 0 .../20230919025239_processing/migration.sql | 0 .../20230927205804_/migration.sql | 0 .../20230928000007_/migration.sql | 0 .../20231005015427_markets/migration.sql | 0 .../20231005015446_/migration.sql | 0 .../20231005015557_/migration.sql | 0 .../20231005015812_/migration.sql | 0 .../20231110095215_add_fee/migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migration.sql | 0 .../migrations_postgres/migration_lock.toml | 3 + packages/prisma/src/schema.prisma | 180 +++++++++--------- packages/processing/src/bot/bot.processing.ts | 3 +- .../processing/src/bot/utils/toPrismaOrder.ts | 8 +- .../src/bot/utils/toPrismaOrderStatus.ts | 7 +- .../src/bot/utils/toPrismaSmartTrade.ts | 12 +- .../src/bot/utils/toProcessorOrderStatus.ts | 7 +- .../exchange-account.processor.ts | 5 +- packages/processing/src/utils/test.ts | 17 +- packages/processing/src/utils/toDbStatus.ts | 5 +- .../routers/private/bot/create-bot/handler.ts | 1 + .../private/grid-bot/create-bot/handler.ts | 10 + .../private/grid-bot/update-bot/handler.ts | 5 +- packages/types/src/common/db.enums.ts | 63 ++++++ packages/types/src/common/index.ts | 2 + packages/types/src/index.ts | 2 +- 91 files changed, 416 insertions(+), 167 deletions(-) create mode 100644 packages/prisma/src/migrations/20240604011809_init/migration.sql rename packages/prisma/src/{migrations => migrations_postgres}/20230830142318_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230830142453_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230830144602_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831124542_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831124734_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831125211_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831125340_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831125359_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831125411_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831125508_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831125929_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230831130507_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901025107_remove_bina/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901032428_bot/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901032632_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901033525_owner/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901033542_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901034007_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901034042_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901034155_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901034606_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901034623_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230901035704_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230905003838_smart_trade_type/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230905122615_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230905123204_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230906003822_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230906003915_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230908174225_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230909040738_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230909201917_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230909203138_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230911103320_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230911103715_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230911104030_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230911104516_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230911105518_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230911122909_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230912103646_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230916235301_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230916235629_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230917021233_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230918043729_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230919025239_processing/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230927205804_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20230928000007_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20231005015427_markets/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20231005015446_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20231005015557_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20231005015812_/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20231110095215_add_fee/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20231110141721_smart_trade_updated_at/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20231125225125_smart_trade_cascade_on_bot_delete/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20240121122456_extended_bot_type_enum/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20240124111108_add_bot_template/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20240202014004_add_bot_timeframe_column/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20240510032632_add_label_to_bot_and_exchange_account_models/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20240511194804_add_more_exchanges/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20240516154507_smart_trade_optional_take_profit/migration.sql (100%) rename packages/prisma/src/{migrations => migrations_postgres}/20240521080911_add_bot_state/migration.sql (100%) create mode 100644 packages/prisma/src/migrations_postgres/migration_lock.toml create mode 100644 packages/types/src/common/db.enums.ts create mode 100644 packages/types/src/common/index.ts diff --git a/.env.example b/.env.example index 9ec00099..216fd0f5 100644 --- a/.env.example +++ b/.env.example @@ -8,7 +8,8 @@ NEXT_PUBLIC_PROCESSOR_ENABLE_TRPC=true # Build NextJS as a static app (`export`) instead of `standalone` # Accepts: "true" | "" NEXT_PUBLIC_STATIC= -DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:5432/postgres" +# Relative to packages/prisma/src +DATABASE_URL="file:../../../dev.db" ADMIN_PASSWORD=opentrader NEXT_PUBLIC_CANDLES_SERVICE_API_URL="http://localhost:5001" NEXT_PUBLIC_CANDLES_SERVICE_API_KEY="opentrader" diff --git a/.gitignore b/.gitignore index b8e11fa7..161c5265 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ config.prod.json5 exchanges.dev.json5 exchanges.prod.json5 .vercel +dev.db diff --git a/apps/cli/src/utils/bot.ts b/apps/cli/src/utils/bot.ts index 6f476831..af7b657b 100644 --- a/apps/cli/src/utils/bot.ts +++ b/apps/cli/src/utils/bot.ts @@ -146,7 +146,7 @@ export async function createOrUpdateBot( timeframe: botTimeframe, baseCurrency, quoteCurrency, - settings: botConfig.settings as object, + settings: JSON.stringify(botConfig.settings), exchangeAccount: { connect: { id: exchangeAccount.id, diff --git a/packages/db/eslint.config.js b/packages/db/eslint.config.js index bf58e5c2..caaedad9 100644 --- a/packages/db/eslint.config.js +++ b/packages/db/eslint.config.js @@ -4,7 +4,7 @@ export default [ ...EslintConfig, { rules: { - // overriding rules here + "@typescript-eslint/no-explicit-any": "off", }, }, ]; diff --git a/packages/db/src/entities/order.entity.ts b/packages/db/src/entities/order.entity.ts index 87e9bdc9..0a44a5ba 100644 --- a/packages/db/src/entities/order.entity.ts +++ b/packages/db/src/entities/order.entity.ts @@ -1,4 +1,5 @@ -import type { $Enums, Order as OrderModel } from "@prisma/client"; +import { XOrderStatus, XOrderType } from "@opentrader/types"; +import type { Order as OrderModel } from "@prisma/client"; type GenericOrderProps = | "type" @@ -9,8 +10,8 @@ type GenericOrderProps = | "placedAt"; type OrderEntityBuilder< - OrderType extends $Enums.OrderType, - OrderStatus extends $Enums.OrderStatus, + OrderType extends XOrderType, + OrderStatus extends XOrderStatus, O extends OrderModel = OrderModel, > = { type: OrderType; diff --git a/packages/db/src/entities/smart-trade.entity.ts b/packages/db/src/entities/smart-trade.entity.ts index b13a6217..64e8053b 100644 --- a/packages/db/src/entities/smart-trade.entity.ts +++ b/packages/db/src/entities/smart-trade.entity.ts @@ -1,11 +1,11 @@ -import type { $Enums } from "@prisma/client"; +import { XEntryType, XTakeProfitType } from "@opentrader/types"; import type { SmartTradeWithOrders } from "../types/smart-trade/index.js"; import type { OrderEntity } from "./order.entity.js"; import { toOrderEntity } from "./order.entity.js"; export type SmartTradeEntityBuilder< - EntryType extends $Enums.EntryType, - TakeProfitType extends $Enums.TakeProfitType, + EntryType extends XEntryType, + TakeProfitType extends XTakeProfitType, > = SmartTradeWithOrders & { // tradeType: `${EntryType}_${TakeProfitType},`; entryType: EntryType; @@ -13,7 +13,7 @@ export type SmartTradeEntityBuilder< } & EntryOrderBuilder & TakeProfitOrderBuilder; -type EntryOrderBuilder = +type EntryOrderBuilder = EntryType extends "Order" ? { entryOrder: OrderEntity; @@ -22,7 +22,7 @@ type EntryOrderBuilder = entryOrders: OrderEntity[]; }; -type TakeProfitOrderBuilder = +type TakeProfitOrderBuilder = TakeProfitType extends "None" ? { takeProfitOrder: null; diff --git a/packages/db/src/extension/models/custom-bot.model.ts b/packages/db/src/extension/models/custom-bot.model.ts index 50be4830..0feccd34 100644 --- a/packages/db/src/extension/models/custom-bot.model.ts +++ b/packages/db/src/extension/models/custom-bot.model.ts @@ -1,5 +1,5 @@ import type { Prisma, PrismaClient } from "@prisma/client"; -import { +import type { DefaultArgs, GetFindResult, InternalArgs, @@ -24,6 +24,13 @@ export const customBotModel = ( const bot = await prisma.bot.findFirst(args); if (!bot) return null; + if ("settings" in bot) { + (bot as any).settings = ZBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + return bot as NarrowBotType; }, async findUnique>( @@ -32,21 +39,35 @@ export const customBotModel = ( const bot = await prisma.bot.findUnique(args); if (!bot) return null; - return bot as NarrowBotType; + return bot as unknown as NarrowBotType; }, async findUniqueOrThrow( args: Prisma.SelectSubset, ) { const bot = await prisma.bot.findUniqueOrThrow(args); - return bot as NarrowBotType; + if ("settings" in bot) { + (bot as any).settings = ZBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + + return bot as unknown as NarrowBotType; }, async findFirstOrThrow( args: Prisma.SelectSubset, ) { const bot = await prisma.bot.findFirstOrThrow(args); - return bot as NarrowBotType; + if ("settings" in bot) { + (bot as any).settings = ZBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + + return bot as unknown as NarrowBotType; }, async findMany( args: Prisma.SelectSubset, @@ -54,13 +75,20 @@ export const customBotModel = ( const bots = await prisma.bot.findMany(args); return bots.map((bot) => { - return bot as NarrowBotType; + if ("settings" in bot) { + (bot as any).settings = ZBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + + return bot as unknown as NarrowBotType; }); }, async create( args: Prisma.SelectSubset, ) { - ZBotSettings.parse(args.data.settings); + ZBotSettings.parse(JSON.parse(args.data.settings)); const bot = await prisma.bot.create({ ...args, @@ -69,13 +97,20 @@ export const customBotModel = ( }, }); - return bot as NarrowBotType; + if ("settings" in bot) { + (bot as any).settings = ZBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + + return bot as unknown as NarrowBotType; }, async update( args: Prisma.SelectSubset, ) { - if (args.data.settings) { - ZBotSettings.parse(args.data.settings); + if (typeof args.data.settings === "string") { + ZBotSettings.parse(JSON.parse(args.data.settings)); } const bot = await prisma.bot.update({ @@ -85,7 +120,14 @@ export const customBotModel = ( }, }); - return bot as NarrowBotType; + if ("settings" in bot) { + (bot as any).settings = ZBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + + return bot as unknown as NarrowBotType; }, async setProcessing(value: boolean, botId: number) { return prisma.bot.update({ diff --git a/packages/db/src/extension/models/grid-bot.model.ts b/packages/db/src/extension/models/grid-bot.model.ts index b2c5745c..f250f611 100644 --- a/packages/db/src/extension/models/grid-bot.model.ts +++ b/packages/db/src/extension/models/grid-bot.model.ts @@ -31,6 +31,13 @@ export const gridBotModel = ( if (!bot) return null; + if ("settings" in bot) { + (bot as any).settings = ZGridBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + return bot as unknown as NarrowBotType; }, async findUniqueOrThrow( @@ -45,10 +52,10 @@ export const gridBotModel = ( }); if ("settings" in bot) { - bot.settings = ZGridBotSettings.parse(bot.settings); + (bot as any).settings = ZGridBotSettings.parse(JSON.parse(bot.settings)); } if ("state" in bot) { - bot.state = bot.state as TBotState; + (bot as any).state = JSON.parse(bot.state) as TBotState; } return bot as unknown as NarrowBotType; @@ -63,13 +70,13 @@ export const gridBotModel = ( const bot = await prisma.bot.findFirstOrThrow(args); if ("settings" in bot) { - bot.settings = ZGridBotSettings.parse(bot.settings); + (bot as any).settings = ZGridBotSettings.parse(JSON.parse(bot.settings)); } if ("state" in bot) { - bot.state = bot.state as TBotState; + (bot as any).state = JSON.parse(bot.state) as TBotState; } - return bot as NarrowBotType; + return bot as unknown as NarrowBotType; }, async findMany( args: Prisma.SelectSubset, @@ -81,10 +88,12 @@ export const gridBotModel = ( return bots.map((bot) => { if ("settings" in bot) { - bot.settings = ZGridBotSettings.parse(bot.settings); + (bot as any).settings = ZGridBotSettings.parse( + JSON.parse(bot.settings), + ); } if ("state" in bot) { - bot.state = bot.state as unknown as TBotState; + (bot as any).state = JSON.parse(bot.state) as TBotState; } return bot as unknown as NarrowBotType; @@ -93,7 +102,7 @@ export const gridBotModel = ( async create( args: Prisma.SelectSubset, ) { - ZGridBotSettings.parse(args.data.settings); + ZGridBotSettings.parse(JSON.parse(args.data.settings)); const bot = await prisma.bot.create({ ...args, @@ -103,13 +112,20 @@ export const gridBotModel = ( }, }); + if ("settings" in bot) { + (bot as any).settings = ZGridBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + return bot as unknown as NarrowBotType; }, async update( args: Prisma.SelectSubset, ) { - if (args.data.settings) { - ZGridBotSettings.parse(args.data.settings); + if (typeof args.data.settings === "string") { + ZGridBotSettings.parse(JSON.parse(args.data.settings)); } const bot = await prisma.bot.update({ @@ -120,6 +136,13 @@ export const gridBotModel = ( }, }); + if ("settings" in bot) { + (bot as any).settings = ZGridBotSettings.parse(JSON.parse(bot.settings)); + } + if ("state" in bot) { + (bot as any).state = JSON.parse(bot.state) as TBotState; + } + return bot as unknown as NarrowBotType; }, }); diff --git a/packages/db/src/extension/models/order.model.ts b/packages/db/src/extension/models/order.model.ts index a2b4d954..9bc20991 100644 --- a/packages/db/src/extension/models/order.model.ts +++ b/packages/db/src/extension/models/order.model.ts @@ -1,4 +1,5 @@ -import type { PrismaClient, $Enums } from "@prisma/client"; +import { XOrderStatus } from "@opentrader/types"; +import type { PrismaClient } from "@prisma/client"; export const orderModel = (prisma: PrismaClient) => ({ async findByExchangeOrderId(exchangeOrderId: string) { @@ -31,7 +32,7 @@ export const orderModel = (prisma: PrismaClient) => ({ * synchronizing with the Exchange. */ async updateStatus( - status: Extract<$Enums.OrderStatus, "Canceled" | "Revoked" | "Deleted">, + status: Extract, orderId: number, ) { const resetSmartTradeRef = { diff --git a/packages/db/src/xprisma.ts b/packages/db/src/xprisma.ts index 88b64da9..a6d21b41 100644 --- a/packages/db/src/xprisma.ts +++ b/packages/db/src/xprisma.ts @@ -42,7 +42,7 @@ const xprismaClient = prismaClient.$extends({ id: botId, }, data: { - state, + state: JSON.stringify(state), }, }); }, diff --git a/packages/exchanges/src/exchange.provider.ts b/packages/exchanges/src/exchange.provider.ts index 7941a3bc..1d336ef8 100644 --- a/packages/exchanges/src/exchange.provider.ts +++ b/packages/exchanges/src/exchange.provider.ts @@ -51,9 +51,9 @@ export class ExchangeProvider { } // Create new exchange instance - const newExchange = exchanges[exchangeCode]({ + const newExchange = exchanges[exchangeCode as ExchangeCode]({ ...credentials, - code: credentials.code, + code: credentials.code as ExchangeCode, password: credentials.password ?? "", }); diff --git a/packages/exchanges/src/server/cache/providers/prisma-cache.provider.ts b/packages/exchanges/src/server/cache/providers/prisma-cache.provider.ts index a2f01f9e..ebc1a7c0 100644 --- a/packages/exchanges/src/server/cache/providers/prisma-cache.provider.ts +++ b/packages/exchanges/src/server/cache/providers/prisma-cache.provider.ts @@ -1,6 +1,5 @@ import type { Dictionary, Exchange, Market } from "ccxt"; import type { ExchangeCode } from "@opentrader/types"; -import type { Prisma } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; import type { ICacheProvider } from "../../../types/cache/cache-provider.interface.js"; @@ -46,7 +45,7 @@ export class PrismaCacheProvider implements ICacheProvider { data: { exchangeCode, - markets: markets as any as Prisma.InputJsonValue, + markets: JSON.stringify(markets), }, }); return markets; diff --git a/packages/prisma/seed.ts b/packages/prisma/seed.ts index 645c6da9..2b8bafd4 100644 --- a/packages/prisma/seed.ts +++ b/packages/prisma/seed.ts @@ -74,9 +74,9 @@ async function main() { type: "GridBot", template: "gridBot", - settings: { - gridLines: gridLines as any, - }, + settings: JSON.stringify({ + gridLines, + }), exchangeAccount: { connect: { diff --git a/packages/prisma/src/migrations/20240604011809_init/migration.sql b/packages/prisma/src/migrations/20240604011809_init/migration.sql new file mode 100644 index 00000000..02f0ed2a --- /dev/null +++ b/packages/prisma/src/migrations/20240604011809_init/migration.sql @@ -0,0 +1,101 @@ +-- CreateTable +CREATE TABLE "User" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "email" TEXT NOT NULL, + "displayName" TEXT, + "role" TEXT NOT NULL DEFAULT 'User', + "password" TEXT NOT NULL +); + +-- CreateTable +CREATE TABLE "ExchangeAccount" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "name" TEXT NOT NULL, + "label" TEXT, + "exchangeCode" TEXT NOT NULL, + "apiKey" TEXT NOT NULL, + "secretKey" TEXT NOT NULL, + "password" TEXT, + "isDemoAccount" BOOLEAN NOT NULL DEFAULT false, + "ownerId" INTEGER NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT "ExchangeAccount_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "SmartTrade" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "type" TEXT NOT NULL, + "entryType" TEXT NOT NULL, + "takeProfitType" TEXT NOT NULL, + "baseCurrency" TEXT NOT NULL, + "quoteCurrency" TEXT NOT NULL, + "exchangeSymbolId" TEXT NOT NULL, + "ref" TEXT, + "exchangeAccountId" INTEGER NOT NULL, + "botId" INTEGER, + "ownerId" INTEGER NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" DATETIME NOT NULL, + CONSTRAINT "SmartTrade_exchangeAccountId_fkey" FOREIGN KEY ("exchangeAccountId") REFERENCES "ExchangeAccount" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, + CONSTRAINT "SmartTrade_botId_fkey" FOREIGN KEY ("botId") REFERENCES "Bot" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "SmartTrade_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "Order" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "status" TEXT NOT NULL DEFAULT 'Idle', + "type" TEXT NOT NULL, + "entityType" TEXT NOT NULL, + "side" TEXT NOT NULL, + "price" REAL, + "filledPrice" REAL, + "fee" REAL, + "exchangeOrderId" TEXT, + "quantity" REAL NOT NULL, + "smartTradeId" INTEGER NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "placedAt" DATETIME, + "syncedAt" DATETIME DEFAULT CURRENT_TIMESTAMP, + "filledAt" DATETIME, + "updatedAt" DATETIME NOT NULL, + CONSTRAINT "Order_smartTradeId_fkey" FOREIGN KEY ("smartTradeId") REFERENCES "SmartTrade" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "Bot" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "type" TEXT NOT NULL, + "name" TEXT NOT NULL, + "label" TEXT, + "baseCurrency" TEXT NOT NULL, + "quoteCurrency" TEXT NOT NULL, + "enabled" BOOLEAN NOT NULL DEFAULT false, + "template" TEXT NOT NULL, + "timeframe" TEXT, + "processing" BOOLEAN NOT NULL DEFAULT false, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "settings" TEXT NOT NULL, + "state" TEXT NOT NULL DEFAULT '{}', + "exchangeAccountId" INTEGER NOT NULL, + "ownerId" INTEGER NOT NULL, + CONSTRAINT "Bot_exchangeAccountId_fkey" FOREIGN KEY ("exchangeAccountId") REFERENCES "ExchangeAccount" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, + CONSTRAINT "Bot_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "Markets" ( + "exchangeCode" TEXT NOT NULL PRIMARY KEY, + "markets" TEXT NOT NULL, + "updatedAt" DATETIME NOT NULL +); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "ExchangeAccount_label_key" ON "ExchangeAccount"("label"); + +-- CreateIndex +CREATE UNIQUE INDEX "Bot_label_key" ON "Bot"("label"); diff --git a/packages/prisma/src/migrations/migration_lock.toml b/packages/prisma/src/migrations/migration_lock.toml index fbffa92c..e5e5c470 100644 --- a/packages/prisma/src/migrations/migration_lock.toml +++ b/packages/prisma/src/migrations/migration_lock.toml @@ -1,3 +1,3 @@ # Please do not edit this file manually # It should be added in your version-control system (i.e. Git) -provider = "postgresql" \ No newline at end of file +provider = "sqlite" \ No newline at end of file diff --git a/packages/prisma/src/migrations/20230830142318_/migration.sql b/packages/prisma/src/migrations_postgres/20230830142318_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230830142318_/migration.sql rename to packages/prisma/src/migrations_postgres/20230830142318_/migration.sql diff --git a/packages/prisma/src/migrations/20230830142453_/migration.sql b/packages/prisma/src/migrations_postgres/20230830142453_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230830142453_/migration.sql rename to packages/prisma/src/migrations_postgres/20230830142453_/migration.sql diff --git a/packages/prisma/src/migrations/20230830144602_/migration.sql b/packages/prisma/src/migrations_postgres/20230830144602_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230830144602_/migration.sql rename to packages/prisma/src/migrations_postgres/20230830144602_/migration.sql diff --git a/packages/prisma/src/migrations/20230831124542_/migration.sql b/packages/prisma/src/migrations_postgres/20230831124542_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831124542_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831124542_/migration.sql diff --git a/packages/prisma/src/migrations/20230831124734_/migration.sql b/packages/prisma/src/migrations_postgres/20230831124734_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831124734_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831124734_/migration.sql diff --git a/packages/prisma/src/migrations/20230831125211_/migration.sql b/packages/prisma/src/migrations_postgres/20230831125211_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831125211_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831125211_/migration.sql diff --git a/packages/prisma/src/migrations/20230831125340_/migration.sql b/packages/prisma/src/migrations_postgres/20230831125340_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831125340_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831125340_/migration.sql diff --git a/packages/prisma/src/migrations/20230831125359_/migration.sql b/packages/prisma/src/migrations_postgres/20230831125359_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831125359_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831125359_/migration.sql diff --git a/packages/prisma/src/migrations/20230831125411_/migration.sql b/packages/prisma/src/migrations_postgres/20230831125411_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831125411_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831125411_/migration.sql diff --git a/packages/prisma/src/migrations/20230831125508_/migration.sql b/packages/prisma/src/migrations_postgres/20230831125508_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831125508_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831125508_/migration.sql diff --git a/packages/prisma/src/migrations/20230831125929_/migration.sql b/packages/prisma/src/migrations_postgres/20230831125929_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831125929_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831125929_/migration.sql diff --git a/packages/prisma/src/migrations/20230831130507_/migration.sql b/packages/prisma/src/migrations_postgres/20230831130507_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230831130507_/migration.sql rename to packages/prisma/src/migrations_postgres/20230831130507_/migration.sql diff --git a/packages/prisma/src/migrations/20230901025107_remove_bina/migration.sql b/packages/prisma/src/migrations_postgres/20230901025107_remove_bina/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901025107_remove_bina/migration.sql rename to packages/prisma/src/migrations_postgres/20230901025107_remove_bina/migration.sql diff --git a/packages/prisma/src/migrations/20230901032428_bot/migration.sql b/packages/prisma/src/migrations_postgres/20230901032428_bot/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901032428_bot/migration.sql rename to packages/prisma/src/migrations_postgres/20230901032428_bot/migration.sql diff --git a/packages/prisma/src/migrations/20230901032632_/migration.sql b/packages/prisma/src/migrations_postgres/20230901032632_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901032632_/migration.sql rename to packages/prisma/src/migrations_postgres/20230901032632_/migration.sql diff --git a/packages/prisma/src/migrations/20230901033525_owner/migration.sql b/packages/prisma/src/migrations_postgres/20230901033525_owner/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901033525_owner/migration.sql rename to packages/prisma/src/migrations_postgres/20230901033525_owner/migration.sql diff --git a/packages/prisma/src/migrations/20230901033542_/migration.sql b/packages/prisma/src/migrations_postgres/20230901033542_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901033542_/migration.sql rename to packages/prisma/src/migrations_postgres/20230901033542_/migration.sql diff --git a/packages/prisma/src/migrations/20230901034007_/migration.sql b/packages/prisma/src/migrations_postgres/20230901034007_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901034007_/migration.sql rename to packages/prisma/src/migrations_postgres/20230901034007_/migration.sql diff --git a/packages/prisma/src/migrations/20230901034042_/migration.sql b/packages/prisma/src/migrations_postgres/20230901034042_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901034042_/migration.sql rename to packages/prisma/src/migrations_postgres/20230901034042_/migration.sql diff --git a/packages/prisma/src/migrations/20230901034155_/migration.sql b/packages/prisma/src/migrations_postgres/20230901034155_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901034155_/migration.sql rename to packages/prisma/src/migrations_postgres/20230901034155_/migration.sql diff --git a/packages/prisma/src/migrations/20230901034606_/migration.sql b/packages/prisma/src/migrations_postgres/20230901034606_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901034606_/migration.sql rename to packages/prisma/src/migrations_postgres/20230901034606_/migration.sql diff --git a/packages/prisma/src/migrations/20230901034623_/migration.sql b/packages/prisma/src/migrations_postgres/20230901034623_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901034623_/migration.sql rename to packages/prisma/src/migrations_postgres/20230901034623_/migration.sql diff --git a/packages/prisma/src/migrations/20230901035704_/migration.sql b/packages/prisma/src/migrations_postgres/20230901035704_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230901035704_/migration.sql rename to packages/prisma/src/migrations_postgres/20230901035704_/migration.sql diff --git a/packages/prisma/src/migrations/20230905003838_smart_trade_type/migration.sql b/packages/prisma/src/migrations_postgres/20230905003838_smart_trade_type/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230905003838_smart_trade_type/migration.sql rename to packages/prisma/src/migrations_postgres/20230905003838_smart_trade_type/migration.sql diff --git a/packages/prisma/src/migrations/20230905122615_/migration.sql b/packages/prisma/src/migrations_postgres/20230905122615_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230905122615_/migration.sql rename to packages/prisma/src/migrations_postgres/20230905122615_/migration.sql diff --git a/packages/prisma/src/migrations/20230905123204_/migration.sql b/packages/prisma/src/migrations_postgres/20230905123204_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230905123204_/migration.sql rename to packages/prisma/src/migrations_postgres/20230905123204_/migration.sql diff --git a/packages/prisma/src/migrations/20230906003822_/migration.sql b/packages/prisma/src/migrations_postgres/20230906003822_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230906003822_/migration.sql rename to packages/prisma/src/migrations_postgres/20230906003822_/migration.sql diff --git a/packages/prisma/src/migrations/20230906003915_/migration.sql b/packages/prisma/src/migrations_postgres/20230906003915_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230906003915_/migration.sql rename to packages/prisma/src/migrations_postgres/20230906003915_/migration.sql diff --git a/packages/prisma/src/migrations/20230908174225_/migration.sql b/packages/prisma/src/migrations_postgres/20230908174225_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230908174225_/migration.sql rename to packages/prisma/src/migrations_postgres/20230908174225_/migration.sql diff --git a/packages/prisma/src/migrations/20230909040738_/migration.sql b/packages/prisma/src/migrations_postgres/20230909040738_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230909040738_/migration.sql rename to packages/prisma/src/migrations_postgres/20230909040738_/migration.sql diff --git a/packages/prisma/src/migrations/20230909201917_/migration.sql b/packages/prisma/src/migrations_postgres/20230909201917_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230909201917_/migration.sql rename to packages/prisma/src/migrations_postgres/20230909201917_/migration.sql diff --git a/packages/prisma/src/migrations/20230909203138_/migration.sql b/packages/prisma/src/migrations_postgres/20230909203138_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230909203138_/migration.sql rename to packages/prisma/src/migrations_postgres/20230909203138_/migration.sql diff --git a/packages/prisma/src/migrations/20230911103320_/migration.sql b/packages/prisma/src/migrations_postgres/20230911103320_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230911103320_/migration.sql rename to packages/prisma/src/migrations_postgres/20230911103320_/migration.sql diff --git a/packages/prisma/src/migrations/20230911103715_/migration.sql b/packages/prisma/src/migrations_postgres/20230911103715_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230911103715_/migration.sql rename to packages/prisma/src/migrations_postgres/20230911103715_/migration.sql diff --git a/packages/prisma/src/migrations/20230911104030_/migration.sql b/packages/prisma/src/migrations_postgres/20230911104030_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230911104030_/migration.sql rename to packages/prisma/src/migrations_postgres/20230911104030_/migration.sql diff --git a/packages/prisma/src/migrations/20230911104516_/migration.sql b/packages/prisma/src/migrations_postgres/20230911104516_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230911104516_/migration.sql rename to packages/prisma/src/migrations_postgres/20230911104516_/migration.sql diff --git a/packages/prisma/src/migrations/20230911105518_/migration.sql b/packages/prisma/src/migrations_postgres/20230911105518_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230911105518_/migration.sql rename to packages/prisma/src/migrations_postgres/20230911105518_/migration.sql diff --git a/packages/prisma/src/migrations/20230911122909_/migration.sql b/packages/prisma/src/migrations_postgres/20230911122909_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230911122909_/migration.sql rename to packages/prisma/src/migrations_postgres/20230911122909_/migration.sql diff --git a/packages/prisma/src/migrations/20230912103646_/migration.sql b/packages/prisma/src/migrations_postgres/20230912103646_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230912103646_/migration.sql rename to packages/prisma/src/migrations_postgres/20230912103646_/migration.sql diff --git a/packages/prisma/src/migrations/20230916235301_/migration.sql b/packages/prisma/src/migrations_postgres/20230916235301_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230916235301_/migration.sql rename to packages/prisma/src/migrations_postgres/20230916235301_/migration.sql diff --git a/packages/prisma/src/migrations/20230916235629_/migration.sql b/packages/prisma/src/migrations_postgres/20230916235629_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230916235629_/migration.sql rename to packages/prisma/src/migrations_postgres/20230916235629_/migration.sql diff --git a/packages/prisma/src/migrations/20230917021233_/migration.sql b/packages/prisma/src/migrations_postgres/20230917021233_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230917021233_/migration.sql rename to packages/prisma/src/migrations_postgres/20230917021233_/migration.sql diff --git a/packages/prisma/src/migrations/20230918043729_/migration.sql b/packages/prisma/src/migrations_postgres/20230918043729_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230918043729_/migration.sql rename to packages/prisma/src/migrations_postgres/20230918043729_/migration.sql diff --git a/packages/prisma/src/migrations/20230919025239_processing/migration.sql b/packages/prisma/src/migrations_postgres/20230919025239_processing/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230919025239_processing/migration.sql rename to packages/prisma/src/migrations_postgres/20230919025239_processing/migration.sql diff --git a/packages/prisma/src/migrations/20230927205804_/migration.sql b/packages/prisma/src/migrations_postgres/20230927205804_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230927205804_/migration.sql rename to packages/prisma/src/migrations_postgres/20230927205804_/migration.sql diff --git a/packages/prisma/src/migrations/20230928000007_/migration.sql b/packages/prisma/src/migrations_postgres/20230928000007_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20230928000007_/migration.sql rename to packages/prisma/src/migrations_postgres/20230928000007_/migration.sql diff --git a/packages/prisma/src/migrations/20231005015427_markets/migration.sql b/packages/prisma/src/migrations_postgres/20231005015427_markets/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20231005015427_markets/migration.sql rename to packages/prisma/src/migrations_postgres/20231005015427_markets/migration.sql diff --git a/packages/prisma/src/migrations/20231005015446_/migration.sql b/packages/prisma/src/migrations_postgres/20231005015446_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20231005015446_/migration.sql rename to packages/prisma/src/migrations_postgres/20231005015446_/migration.sql diff --git a/packages/prisma/src/migrations/20231005015557_/migration.sql b/packages/prisma/src/migrations_postgres/20231005015557_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20231005015557_/migration.sql rename to packages/prisma/src/migrations_postgres/20231005015557_/migration.sql diff --git a/packages/prisma/src/migrations/20231005015812_/migration.sql b/packages/prisma/src/migrations_postgres/20231005015812_/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20231005015812_/migration.sql rename to packages/prisma/src/migrations_postgres/20231005015812_/migration.sql diff --git a/packages/prisma/src/migrations/20231110095215_add_fee/migration.sql b/packages/prisma/src/migrations_postgres/20231110095215_add_fee/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20231110095215_add_fee/migration.sql rename to packages/prisma/src/migrations_postgres/20231110095215_add_fee/migration.sql diff --git a/packages/prisma/src/migrations/20231110141721_smart_trade_updated_at/migration.sql b/packages/prisma/src/migrations_postgres/20231110141721_smart_trade_updated_at/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20231110141721_smart_trade_updated_at/migration.sql rename to packages/prisma/src/migrations_postgres/20231110141721_smart_trade_updated_at/migration.sql diff --git a/packages/prisma/src/migrations/20231125225125_smart_trade_cascade_on_bot_delete/migration.sql b/packages/prisma/src/migrations_postgres/20231125225125_smart_trade_cascade_on_bot_delete/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20231125225125_smart_trade_cascade_on_bot_delete/migration.sql rename to packages/prisma/src/migrations_postgres/20231125225125_smart_trade_cascade_on_bot_delete/migration.sql diff --git a/packages/prisma/src/migrations/20240121122456_extended_bot_type_enum/migration.sql b/packages/prisma/src/migrations_postgres/20240121122456_extended_bot_type_enum/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20240121122456_extended_bot_type_enum/migration.sql rename to packages/prisma/src/migrations_postgres/20240121122456_extended_bot_type_enum/migration.sql diff --git a/packages/prisma/src/migrations/20240124111108_add_bot_template/migration.sql b/packages/prisma/src/migrations_postgres/20240124111108_add_bot_template/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20240124111108_add_bot_template/migration.sql rename to packages/prisma/src/migrations_postgres/20240124111108_add_bot_template/migration.sql diff --git a/packages/prisma/src/migrations/20240202014004_add_bot_timeframe_column/migration.sql b/packages/prisma/src/migrations_postgres/20240202014004_add_bot_timeframe_column/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20240202014004_add_bot_timeframe_column/migration.sql rename to packages/prisma/src/migrations_postgres/20240202014004_add_bot_timeframe_column/migration.sql diff --git a/packages/prisma/src/migrations/20240510032632_add_label_to_bot_and_exchange_account_models/migration.sql b/packages/prisma/src/migrations_postgres/20240510032632_add_label_to_bot_and_exchange_account_models/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20240510032632_add_label_to_bot_and_exchange_account_models/migration.sql rename to packages/prisma/src/migrations_postgres/20240510032632_add_label_to_bot_and_exchange_account_models/migration.sql diff --git a/packages/prisma/src/migrations/20240511194804_add_more_exchanges/migration.sql b/packages/prisma/src/migrations_postgres/20240511194804_add_more_exchanges/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20240511194804_add_more_exchanges/migration.sql rename to packages/prisma/src/migrations_postgres/20240511194804_add_more_exchanges/migration.sql diff --git a/packages/prisma/src/migrations/20240516154507_smart_trade_optional_take_profit/migration.sql b/packages/prisma/src/migrations_postgres/20240516154507_smart_trade_optional_take_profit/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20240516154507_smart_trade_optional_take_profit/migration.sql rename to packages/prisma/src/migrations_postgres/20240516154507_smart_trade_optional_take_profit/migration.sql diff --git a/packages/prisma/src/migrations/20240521080911_add_bot_state/migration.sql b/packages/prisma/src/migrations_postgres/20240521080911_add_bot_state/migration.sql similarity index 100% rename from packages/prisma/src/migrations/20240521080911_add_bot_state/migration.sql rename to packages/prisma/src/migrations_postgres/20240521080911_add_bot_state/migration.sql diff --git a/packages/prisma/src/migrations_postgres/migration_lock.toml b/packages/prisma/src/migrations_postgres/migration_lock.toml new file mode 100644 index 00000000..fbffa92c --- /dev/null +++ b/packages/prisma/src/migrations_postgres/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (i.e. Git) +provider = "postgresql" \ No newline at end of file diff --git a/packages/prisma/src/schema.prisma b/packages/prisma/src/schema.prisma index f15854af..ce66d8a3 100644 --- a/packages/prisma/src/schema.prisma +++ b/packages/prisma/src/schema.prisma @@ -17,78 +17,83 @@ generator zod { useTypeAssertions = true } -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") // uses connection pooling -} - -enum ExchangeCode { - OKX - BYBIT - BINANCE - KRAKEN - COINBASE - GATEIO -} - -enum BotType { - Bot - GridBot -} - -enum OrderSide { - Buy - Sell -} - -enum OrderStatus { - Idle - Placed - Filled - Canceled - Revoked - Deleted -} - -enum OrderType { - Limit - Market -} - -enum UserRole { - User - Admin -} - -enum SmartTradeType { - Trade - DCA -} - -// SmartTrade enums -enum EntryType { - Order - Ladder -} +// datasource postgres { +// provider = "postgresql" +// url = env("DATABASE_URL") // uses connection pooling +// } -enum TakeProfitType { - Order - Ladder - None +datasource sqlite { + provider = "sqlite" + url = env("DATABASE_URL") } -enum EntityType { - EntryOrder - TakeProfitOrder - StopLossOrder - SafetyOrder -} +// enum ExchangeCode { +// OKX +// BYBIT +// BINANCE +// KRAKEN +// COINBASE +// GATEIO +// } +// +// enum BotType { +// Bot +// GridBot +// } +// +// enum OrderSide { +// Buy +// Sell +// } +// +// enum OrderStatus { +// Idle +// Placed +// Filled +// Canceled +// Revoked +// Deleted +// } +// +// enum OrderType { +// Limit +// Market +// } +// +// enum UserRole { +// User +// Admin +// } +// +// enum SmartTradeType { +// Trade +// DCA +// } +// +// // SmartTrade enums +// enum EntryType { +// Order +// Ladder +// } +// +// enum TakeProfitType { +// Order +// Ladder +// None +// } +// +// enum EntityType { +// EntryOrder +// TakeProfitOrder +// StopLossOrder +// SafetyOrder +// } model User { - id Int @id @default(autoincrement()) - email String @unique + id Int @id @default(autoincrement()) + email String @unique displayName String? - role UserRole @default(User) + role String @default("User") password String exchangeAccounts ExchangeAccount[] @@ -97,10 +102,10 @@ model User { } model ExchangeAccount { - id Int @id @default(autoincrement()) + id Int @id @default(autoincrement()) name String - label String? @unique - exchangeCode ExchangeCode // ExchangeCode + label String? @unique + exchangeCode String // ExchangeCode // Credentials apiKey String @@ -119,9 +124,9 @@ model ExchangeAccount { model SmartTrade { id Int @id @default(autoincrement()) - type SmartTradeType - entryType EntryType - takeProfitType TakeProfitType + type String // SmartTradeType + entryType String // EntryType + takeProfitType String // TakeProfitType baseCurrency String quoteCurrency String @@ -144,11 +149,11 @@ model SmartTrade { } model Order { - id Int @id @default(autoincrement()) - status OrderStatus @default(Idle) - type OrderType - entityType EntityType - side OrderSide + id Int @id @default(autoincrement()) + status String @default("Idle") // OrderStatus + type String // OrderType + entityType String // EntityType + side String // OrderSide price Float? // Market orders doesn't require price to be specified filledPrice Float? fee Float? @@ -169,7 +174,7 @@ model Order { model Bot { id Int @id @default(autoincrement()) - type BotType + type String // BotType name String label String? @unique baseCurrency String @@ -192,8 +197,8 @@ model Bot { createdAt DateTime @default(now()) - settings Json // @todo gridLines - state Json @default("{}") + settings String // JSON stringified + state String @default("{}") // JSON stringified smartTrades SmartTrade[] @@ -207,16 +212,7 @@ model Bot { } model Markets { - exchangeCode ExchangeCode @id - markets Json - updatedAt DateTime @updatedAt + exchangeCode String @id // ExchangeCode + markets String // JSON stringified + updatedAt DateTime @updatedAt } - -// model BotState { -// id Int @id @default(autoincrement()) -// type String // smartTradeRef -// key String // index provided by user -// value String // smartTrade.id -// bot Bot @relation(fields: [botId], references: [id]) -// botId Int -// } diff --git a/packages/processing/src/bot/bot.processing.ts b/packages/processing/src/bot/bot.processing.ts index 939228b2..caad6c81 100644 --- a/packages/processing/src/bot/bot.processing.ts +++ b/packages/processing/src/bot/bot.processing.ts @@ -9,6 +9,7 @@ import { exchangeProvider } from "@opentrader/exchanges"; import type { TBot } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; import { logger } from "@opentrader/logger"; +import type { ExchangeCode } from "@opentrader/types"; import { SmartTradeExecutor } from "../executors/index.js"; import { BotStoreAdapter } from "./bot-store-adapter.js"; @@ -166,7 +167,7 @@ export class BotProcessing { baseCurrency: this.bot.baseCurrency, quoteCurrency: this.bot.quoteCurrency, settings: this.bot.settings, - exchangeCode: exchangeAccount.exchangeCode, + exchangeCode: exchangeAccount.exchangeCode as ExchangeCode, }; const storeAdapter = new BotStoreAdapter(() => this.stop()); diff --git a/packages/processing/src/bot/utils/toPrismaOrder.ts b/packages/processing/src/bot/utils/toPrismaOrder.ts index 34fa7ce1..21131de7 100644 --- a/packages/processing/src/bot/utils/toPrismaOrder.ts +++ b/packages/processing/src/bot/utils/toPrismaOrder.ts @@ -1,5 +1,5 @@ -import type { $Enums, Prisma } from "@opentrader/db"; -import { OrderStatusEnum, OrderType } from "@opentrader/types"; +import type { Prisma } from "@opentrader/db"; +import { OrderStatusEnum, OrderType, XEntityType, XOrderSide } from "@opentrader/types"; import { toPrismaOrderStatus } from "./toPrismaOrderStatus.js"; export function toPrismaOrder( @@ -9,8 +9,8 @@ export function toPrismaOrder( price?: number; }, quantity: number, - side: $Enums.OrderSide, - entityType: $Enums.EntityType, + side: XOrderSide, + entityType: XEntityType, ): Prisma.OrderCreateManySmartTradeInput { return { status: toPrismaOrderStatus(order.status || OrderStatusEnum.Idle), diff --git a/packages/processing/src/bot/utils/toPrismaOrderStatus.ts b/packages/processing/src/bot/utils/toPrismaOrderStatus.ts index 93c4eecd..24b7c439 100644 --- a/packages/processing/src/bot/utils/toPrismaOrderStatus.ts +++ b/packages/processing/src/bot/utils/toPrismaOrderStatus.ts @@ -1,9 +1,8 @@ -import { OrderStatusEnum } from "@opentrader/types"; -import type { $Enums } from "@opentrader/db"; +import { OrderStatusEnum, XOrderStatus } from "@opentrader/types"; const map: Record< OrderStatusEnum, - Extract<$Enums.OrderStatus, "Idle" | "Placed" | "Filled"> + Extract > = { [OrderStatusEnum.Idle]: "Idle", [OrderStatusEnum.Placed]: "Placed", @@ -12,6 +11,6 @@ const map: Record< export function toPrismaOrderStatus( orderStatus: OrderStatusEnum, -): $Enums.OrderStatus { +): XOrderStatus { return map[orderStatus]; } diff --git a/packages/processing/src/bot/utils/toPrismaSmartTrade.ts b/packages/processing/src/bot/utils/toPrismaSmartTrade.ts index 12edaddb..96b61542 100644 --- a/packages/processing/src/bot/utils/toPrismaSmartTrade.ts +++ b/packages/processing/src/bot/utils/toPrismaSmartTrade.ts @@ -1,6 +1,6 @@ import type { UseSmartTradePayload } from "@opentrader/bot-processor"; import type { Prisma } from "@opentrader/db"; -import { $Enums } from "@opentrader/db"; +import { XEntityType, XOrderSide, XSmartTradeType } from "@opentrader/types"; import { toPrismaOrder } from "./toPrismaOrder.js"; /** @@ -36,16 +36,16 @@ export function toPrismaSmartTrade( const buyOrderData = toPrismaOrder( buy, quantity, - $Enums.OrderSide.Buy, - $Enums.EntityType.EntryOrder, + XOrderSide.Buy, + XEntityType.EntryOrder, ); const sellOrderData = sell ? toPrismaOrder( sell, quantity, - $Enums.OrderSide.Sell, - $Enums.EntityType.TakeProfitOrder, + XOrderSide.Sell, + XEntityType.TakeProfitOrder, ) : undefined; @@ -54,7 +54,7 @@ export function toPrismaSmartTrade( takeProfitType: sell ? "Order" : "None", ref, - type: $Enums.SmartTradeType.Trade, + type: XSmartTradeType.Trade, exchangeSymbolId, baseCurrency, quoteCurrency, diff --git a/packages/processing/src/bot/utils/toProcessorOrderStatus.ts b/packages/processing/src/bot/utils/toProcessorOrderStatus.ts index 486ef7dc..e7036bbc 100644 --- a/packages/processing/src/bot/utils/toProcessorOrderStatus.ts +++ b/packages/processing/src/bot/utils/toProcessorOrderStatus.ts @@ -1,7 +1,6 @@ -import type { $Enums } from "@opentrader/db"; -import { OrderStatusEnum } from "@opentrader/types"; +import { OrderStatusEnum, XOrderStatus } from "@opentrader/types"; -const map: Record<$Enums.OrderStatus, OrderStatusEnum> = { +const map: Record = { Idle: OrderStatusEnum.Idle, Placed: OrderStatusEnum.Placed, Filled: OrderStatusEnum.Filled, @@ -15,7 +14,7 @@ const map: Record<$Enums.OrderStatus, OrderStatusEnum> = { }; export function toProcessorOrderStatus( - orderStatus: $Enums.OrderStatus, + orderStatus: XOrderStatus, ): OrderStatusEnum { return map[orderStatus]; } diff --git a/packages/processing/src/exchange-account/exchange-account.processor.ts b/packages/processing/src/exchange-account/exchange-account.processor.ts index 302b8ec9..eb8490c9 100644 --- a/packages/processing/src/exchange-account/exchange-account.processor.ts +++ b/packages/processing/src/exchange-account/exchange-account.processor.ts @@ -2,11 +2,10 @@ import { OrderNotFound } from "ccxt"; import type { ExchangeAccountWithCredentials, OrderWithSmartTrade, - $Enums, } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; import { exchangeProvider, type IExchange } from "@opentrader/exchanges"; -import type { IGetLimitOrderResponse } from "@opentrader/types"; +import type { IGetLimitOrderResponse, XOrderStatus } from "@opentrader/types"; import { logger } from "@opentrader/logger"; import { toDbStatus } from "../utils/index.js"; @@ -121,7 +120,7 @@ export class ExchangeAccountProcessor { private async updateStatus( order: OrderWithSmartTrade, exchangeOrder: IGetLimitOrderResponse, - status: $Enums.OrderStatus, + status: XOrderStatus, ) { // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- "Idle" | "Placed" | "Revoked" doesn't require to be processed switch (status) { diff --git a/packages/processing/src/utils/test.ts b/packages/processing/src/utils/test.ts index c0c08f39..eed64521 100644 --- a/packages/processing/src/utils/test.ts +++ b/packages/processing/src/utils/test.ts @@ -1,16 +1,21 @@ // Only for testing purposes. Don't export this file. import type { - $Enums, ExchangeAccountWithCredentials, SmartTradeWithOrders, } from "@opentrader/db"; import { xprisma } from "@opentrader/db"; +import type { + XEntityType, + XOrderSide, + XOrderStatus, + XOrderType, +} from "@opentrader/types"; export const TEST_ACCOUNT_LABEL = "TEST"; type OrderParams = { - type: $Enums.OrderType; - side: $Enums.OrderSide; + type: XOrderType; + side: XOrderSide; price: number; quantity: number; }; @@ -35,7 +40,7 @@ export async function createTrade( }); // @todo Array - const orders: (OrderParams & { entityType: $Enums.EntityType })[] = []; + const orders: (OrderParams & { entityType: XEntityType })[] = []; orders.push({ entityType: "EntryOrder", ...entry, @@ -98,13 +103,13 @@ type UpdateOrderParams = { filledPrice?: number; filledAt?: Date; quantity?: number; - status?: $Enums.OrderStatus; + status?: XOrderStatus; }; export async function updateOrder( params: UpdateOrderParams, trade: SmartTradeWithOrders, - entityType: $Enums.EntityType, + entityType: XEntityType, ) { const entryOrder = trade.orders.find( (order) => order.entityType === "EntryOrder", diff --git a/packages/processing/src/utils/toDbStatus.ts b/packages/processing/src/utils/toDbStatus.ts index 3441dec8..d9e2fefa 100644 --- a/packages/processing/src/utils/toDbStatus.ts +++ b/packages/processing/src/utils/toDbStatus.ts @@ -1,11 +1,10 @@ -import type { OrderStatus } from "@opentrader/types"; -import type { $Enums } from "@opentrader/db"; +import type { OrderStatus, XOrderStatus } from "@opentrader/types"; /** * Map Exchange order status to DB order status * @param status - Order status */ -export function toDbStatus(status: OrderStatus): $Enums.OrderStatus { +export function toDbStatus(status: OrderStatus): XOrderStatus { switch (status) { case "open": return "Placed"; diff --git a/packages/trpc/src/routers/private/bot/create-bot/handler.ts b/packages/trpc/src/routers/private/bot/create-bot/handler.ts index c8fc64a0..501ac049 100644 --- a/packages/trpc/src/routers/private/bot/create-bot/handler.ts +++ b/packages/trpc/src/routers/private/bot/create-bot/handler.ts @@ -52,6 +52,7 @@ export async function createBot({ ctx, input }: Options) { const bot = await xprisma.bot.custom.create({ data: { ...data, + settings: JSON.stringify(data.settings), type: "Bot", exchangeAccount: { connect: { diff --git a/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts b/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts index 76792286..833529c7 100644 --- a/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts +++ b/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts @@ -1,3 +1,4 @@ +import { gridBot } from "@opentrader/bot-templates"; import { TRPCError } from "@trpc/server"; import { xprisma } from "@opentrader/db"; import type { Context } from "../../../../utils/context.js"; @@ -29,9 +30,18 @@ export async function createGridBot({ ctx, input }: Options) { }); } + const parsed = gridBot.schema.safeParse(data.settings); + if (!parsed.success) { + throw new TRPCError({ + message: `Invalid strategy params: ${parsed.error.message}`, + code: "PARSE_ERROR", + }); + } + const bot = await xprisma.bot.grid.create({ data: { ...data, + settings: JSON.stringify(data.settings), type: "GridBot", template: "gridBot", exchangeAccount: { diff --git a/packages/trpc/src/routers/private/grid-bot/update-bot/handler.ts b/packages/trpc/src/routers/private/grid-bot/update-bot/handler.ts index b16af8a3..6e7e91f2 100644 --- a/packages/trpc/src/routers/private/grid-bot/update-bot/handler.ts +++ b/packages/trpc/src/routers/private/grid-bot/update-bot/handler.ts @@ -19,7 +19,10 @@ export async function updateGridBot({ ctx, input }: Options) { id: ctx.user.id, }, }, - data, + data: { + ...data, + settings: JSON.stringify(data.settings), + }, }); return bot; diff --git a/packages/types/src/common/db.enums.ts b/packages/types/src/common/db.enums.ts new file mode 100644 index 00000000..11ca5550 --- /dev/null +++ b/packages/types/src/common/db.enums.ts @@ -0,0 +1,63 @@ +export const XBotType = { + Bot: "Bot", + GridBot: "GridBot", +} as const; +export type XBotType = (typeof XBotType)[keyof typeof XBotType]; + +export const XOrderSide = { + Buy: "Buy", + Sell: "Sell", +} as const; +export type XOrderSide = (typeof XOrderSide)[keyof typeof XOrderSide]; + +export const XOrderStatus = { + Idle: "Idle", + Placed: "Placed", + Filled: "Filled", + Canceled: "Canceled", + Revoked: "Revoked", + Deleted: "Deleted", +} as const; +export type XOrderStatus = (typeof XOrderStatus)[keyof typeof XOrderStatus]; + +export const XOrderType = { + Limit: "Limit", + Market: "Market", +} as const; +export type XOrderType = (typeof XOrderType)[keyof typeof XOrderType]; + +export const XUserRole = { + User: "User", + Admin: "Admin", +} as const; +export type XUserRole = (typeof XUserRole)[keyof typeof XUserRole]; + +export const XSmartTradeType = { + Trade: "Trade", + DCA: "DCA", +} as const; + +export type XSmartTradeType = + (typeof XSmartTradeType)[keyof typeof XSmartTradeType]; + +export const XEntryType = { + Order: "Order", + Ladder: "Ladder", +} as const; +export type XEntryType = (typeof XEntryType)[keyof typeof XEntryType]; + +export const XTakeProfitType = { + Order: "Order", + Ladder: "Ladder", + None: "None", +} as const; +export type XTakeProfitType = + (typeof XTakeProfitType)[keyof typeof XTakeProfitType]; + +export const XEntityType = { + EntryOrder: "EntryOrder", + TakeProfitOrder: "TakeProfitOrder", + StopLossOrder: "StopLossOrder", + SafetyOrder: "SafetyOrder", +} as const; +export type XEntityType = (typeof XEntityType)[keyof typeof XEntityType]; diff --git a/packages/types/src/common/index.ts b/packages/types/src/common/index.ts new file mode 100644 index 00000000..cae3b7bb --- /dev/null +++ b/packages/types/src/common/index.ts @@ -0,0 +1,2 @@ +export * from "./db.enums.js"; +export * from "./enums.js"; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 10dc96f9..78038280 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -15,7 +15,7 @@ * * Repository URL: https://github.com/bludnic/opentrader */ -export * from "./common/enums.js"; +export * from "./common/index.js"; export * from "./exchange/index.js"; export * from "./grid-bot/index.js"; export * from "./smart-trade/enums.js"; From 0047de372e068380dde0c095c51d29fe2400e387 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 20:09:41 +0100 Subject: [PATCH 62/68] chore(ENV): add `CCXT_VERBOSE` env --- .env.example | 3 +++ packages/exchanges/src/exchanges/ccxt/exchange.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/.env.example b/.env.example index 216fd0f5..8248d536 100644 --- a/.env.example +++ b/.env.example @@ -13,4 +13,7 @@ DATABASE_URL="file:../../../dev.db" ADMIN_PASSWORD=opentrader NEXT_PUBLIC_CANDLES_SERVICE_API_URL="http://localhost:5001" NEXT_PUBLIC_CANDLES_SERVICE_API_KEY="opentrader" +# Logging level for ccxt +# Accepts: "true" | "" +CCXT_VERBOSE= ########## SHARED END ###### diff --git a/packages/exchanges/src/exchanges/ccxt/exchange.ts b/packages/exchanges/src/exchanges/ccxt/exchange.ts index eeb3fe4f..c5634ef8 100644 --- a/packages/exchanges/src/exchanges/ccxt/exchange.ts +++ b/packages/exchanges/src/exchanges/ccxt/exchange.ts @@ -72,6 +72,7 @@ export class CCXTExchange implements IExchange { // #88 Fixes: 'e instanceof this.AbortError' is not an object this.ccxt.FetchError = TypeError; // when fetch request failed (network error) this.ccxt.AbortError = DOMException; // when fetch request aborted + this.ccxt.verbose = process.env.CCXT_VERBOSE === "true"; if (credentials?.isDemoAccount) { this.ccxt.setSandboxMode(true); From 519fea983538c1e0b669df08c4dee693501547f1 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 20:09:47 +0100 Subject: [PATCH 63/68] chore: update pro package --- pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pro b/pro index f662d8ea..eaad9923 160000 --- a/pro +++ b/pro @@ -1 +1 @@ -Subproject commit f662d8ea092157ffb0d587bb3f069ede4dd6967d +Subproject commit eaad99239a4173e6db0c3bc31ca13aaf03067300 From b0f8e06e893a15eda4409cc10da251138b62a17e Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 22:15:34 +0100 Subject: [PATCH 64/68] feat(cli): prepare release build with SQLite --- apps/cli/bin/opentrader.sh | 14 +++- apps/cli/package.json | 5 +- apps/cli/plugins/copy-prisma-schema-plugin.ts | 42 +++++++++++ .../plugins/generate-package-json-plugin.ts | 9 ++- apps/cli/scripts/postinstall.mjs | 46 ++++++++++++ apps/cli/seed.ts | 72 +++++++++++++++++++ 6 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 apps/cli/scripts/postinstall.mjs create mode 100644 apps/cli/seed.ts diff --git a/apps/cli/bin/opentrader.sh b/apps/cli/bin/opentrader.sh index fde0fe71..b9691bd5 100755 --- a/apps/cli/bin/opentrader.sh +++ b/apps/cli/bin/opentrader.sh @@ -3,5 +3,17 @@ # Determine the script's directory SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# Path to the file containing the admin password +PASSWORD_FILE="${HOME}/.opentrader/pass" + +# Extract the password from the file +if [ -f "$PASSWORD_FILE" ]; then + ADMIN_PASSWORD=$(cat "$PASSWORD_FILE") + echo "Admin password: **********" +else + echo "Password file not found!" + exit 1 +fi + # Run the Node.js script with the resolved directory -node "$SCRIPT_DIR/../dist/main.mjs" "$@" \ No newline at end of file +ADMIN_PASSWORD=$ADMIN_PASSWORD DATABASE_URL="file:${HOME}/.opentrader/dev.db" node "$SCRIPT_DIR/../dist/main.mjs" "$@" diff --git a/apps/cli/package.json b/apps/cli/package.json index 6126cff1..8ad6af7d 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -7,7 +7,7 @@ "types": "src/index.ts", "scripts": { "build": "tsup", - "build:release": "tsup -d release/dist && cp -r ./bin ./release/bin", + "build:release": "rimraf ./release && tsup -d release/dist && cp -r ./bin ./release/bin && cp -r ./scripts ./release/scripts", "lint": "eslint . --quiet", "lint:fix": "eslint . --fix" }, @@ -21,6 +21,7 @@ "@types/node": "^20.14.10", "esbuild": "^0.23.0", "eslint": "8.57.0", + "rimraf": "^6.0.1", "ts-loader": "^9.5.1", "ts-node": "10.9.2", "tsup": "^8.1.0", @@ -50,7 +51,9 @@ "json5": "^2.2.3", "pino": "^9.2.0", "pino-pretty": "^11.2.1", + "random-words": "^2.0.1", "superjson": "^2.2.1", + "tsx": "^4.16.2", "zod": "3.23.8" }, "bin": { diff --git a/apps/cli/plugins/copy-prisma-schema-plugin.ts b/apps/cli/plugins/copy-prisma-schema-plugin.ts index 77aa19a1..a2c5df24 100644 --- a/apps/cli/plugins/copy-prisma-schema-plugin.ts +++ b/apps/cli/plugins/copy-prisma-schema-plugin.ts @@ -22,6 +22,7 @@ export const copyPrismaSchemaPlugin = (): Plugin => ({ } build.onEnd(() => { + // Copy schema.prisma const prismaSchemaPath = path.resolve(PRISMA_DIR, "src/schema.prisma"); const prismaSchemaDest = path.resolve(DIST_DIR, "../schema.prisma"); @@ -32,6 +33,47 @@ export const copyPrismaSchemaPlugin = (): Plugin => ({ } fs.copyFileSync(prismaSchemaPath, prismaSchemaDest); + + // Copy seed.ts + const prismaSeedPath = path.resolve(CLI_DIR, "seed.ts"); + const prismaSeedDest = path.resolve(DIST_DIR, "../seed.ts"); + fs.copyFileSync(prismaSeedPath, prismaSeedDest); + + // Copy migrations + const prismaMigrationsPath = path.resolve(PRISMA_DIR, "src/migrations"); + const prismaMigrationsDest = path.resolve(DIST_DIR, "../migrations"); + + if (!fs.existsSync(prismaMigrationsDest)) { + fs.mkdirSync(prismaMigrationsDest, { + recursive: true, + }); + } + + copyDirectory(prismaMigrationsPath, prismaMigrationsDest); }); }, }); + +function copyDirectory(src: string, dest: string) { + // Create destination folder if it doesn't exist + if (!fs.existsSync(dest)) { + fs.mkdirSync(dest, { recursive: true }); + } + + // Read all items in the source directory + const items = fs.readdirSync(src); + + // Iterate through each item and copy it to the destination + items.forEach((item) => { + const srcPath = path.join(src, item); + const destPath = path.join(dest, item); + + if (fs.lstatSync(srcPath).isDirectory()) { + // If item is a directory, recursively copy it + copyDirectory(srcPath, destPath); + } else { + // If item is a file, copy it + fs.copyFileSync(srcPath, destPath); + } + }); +} diff --git a/apps/cli/plugins/generate-package-json-plugin.ts b/apps/cli/plugins/generate-package-json-plugin.ts index 3c1242f9..5d1c1ad8 100644 --- a/apps/cli/plugins/generate-package-json-plugin.ts +++ b/apps/cli/plugins/generate-package-json-plugin.ts @@ -88,7 +88,14 @@ export const generatePackageJsonPlugin = (): Plugin => ({ }; // Add postinstall script - newPackageJson.scripts.postinstall = "prisma generate"; // @todo prisma migrate dev + newPackageJson.scripts.postinstall = + 'prisma generate && DATABASE_URL="file:${HOME}/.opentrader/dev.db" prisma migrate dev && node scripts/postinstall.mjs'; + + // Write to new package.json file + newPackageJson.prisma = { + schema: "schema.prisma", + seed: "tsx seed.ts", + }; const distPath = path.resolve(CLI_DIR, build.initialOptions.outdir!); diff --git a/apps/cli/scripts/postinstall.mjs b/apps/cli/scripts/postinstall.mjs new file mode 100644 index 00000000..8865e1bf --- /dev/null +++ b/apps/cli/scripts/postinstall.mjs @@ -0,0 +1,46 @@ +import { homedir } from "node:os"; +import { writeFileSync, existsSync } from "node:fs"; +import { join } from "node:path"; +import { generate } from "random-words"; + +const APP_DIR = ".opentrader"; +export const appPath = join(homedir(), APP_DIR); +export const passFilePath = join(appPath, "pass"); + +function generatePassword(wordCount = 3, numberCount = 2) { + // Generate random words + const words = generate({ + exactly: 1, + wordsPerString: wordCount, + separator: "-", + }); + + // Generate random numbers + const numbers = Array.from({ length: numberCount }, () => + Math.floor(Math.random() * 10), + ).join(""); + + // Combine words and numbers + return words[0] + numbers; +} + +function savePassword() { + const password = generatePassword(); + + if (existsSync(passFilePath)) { + console.log(`🔐 Password already set in ${passFilePath}. Skipping...`); + return; + } + + writeFileSync(passFilePath, password, { + encoding: "utf8", + recursive: true, + }); + console.log(`Generated new ADMIN PASSWORD in ${passFilePath}`); + console.log( + `Please keep this password safe. You will need it to access the admin panel.`, + ); + console.log(`🔒 Password: ${password}`); +} + +savePassword(); diff --git a/apps/cli/seed.ts b/apps/cli/seed.ts new file mode 100644 index 00000000..30003780 --- /dev/null +++ b/apps/cli/seed.ts @@ -0,0 +1,72 @@ +/** + * Copyright 2024 bludnic + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Repository URL: https://github.com/bludnic/opentrader + */ +import { PrismaClient } from "@prisma/client"; + +const prisma = new PrismaClient(); + +async function main() { + const user = await prisma.user.upsert({ + where: { + id: 1, + }, + update: {}, + create: { + email: "onboarding@opentrader.pro", + password: "onboarding", + displayName: "Open Trader", + role: "Admin", + }, + }); + console.log( + `👤 Created user "${user.email}" with password "${user.password}"`, + ); + + // const exchangeAccount = await prisma.exchangeAccount.upsert({ + // where: { + // id: 1, + // }, + // update: {}, + // create: { + // name: "OKX Demo Account", + // exchangeCode: "OKX", + // apiKey: "YOUR_EXCHANGE_API_KEY", + // secretKey: "YOUR_EXCHANGE_API_SECRET_KEY", + // password: "YOU_EXCHANGE_API_PASSPHRASE", + // isDemoAccount: true, + // label: "DEFAULT", + // owner: { + // connect: { + // id: user.id, + // }, + // }, + // }, + // }); + // console.log( + // `🏦 Created ${exchangeAccount.exchangeCode} exchange account "${exchangeAccount.name}"`, + // ); +} + +main() + .then(async () => { + await prisma.$disconnect(); + }) + .catch(async (e) => { + console.error(e); + await prisma.$disconnect(); + process.exit(1); + }); From fb70b900d05adf1d8fae7e4cb05e84118fcd0650 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 22:15:51 +0100 Subject: [PATCH 65/68] chore(config): remove unused config refs --- apps/cli/config.prod.json5 | 1 - apps/cli/exchanges.prod.json5 | 1 - 2 files changed, 2 deletions(-) delete mode 120000 apps/cli/config.prod.json5 delete mode 120000 apps/cli/exchanges.prod.json5 diff --git a/apps/cli/config.prod.json5 b/apps/cli/config.prod.json5 deleted file mode 120000 index 0e171a41..00000000 --- a/apps/cli/config.prod.json5 +++ /dev/null @@ -1 +0,0 @@ -../../config.prod.json5 \ No newline at end of file diff --git a/apps/cli/exchanges.prod.json5 b/apps/cli/exchanges.prod.json5 deleted file mode 120000 index 919bf14d..00000000 --- a/apps/cli/exchanges.prod.json5 +++ /dev/null @@ -1 +0,0 @@ -../../exchanges.prod.json5 \ No newline at end of file From 2ce2adf630ba79b144e54dabd5c06526fa598129 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 22:18:09 +0100 Subject: [PATCH 66/68] chore(cli): increment version --- apps/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 8ad6af7d..d209c51c 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "opentrader", - "version": "1.0.0-alpha.2", + "version": "1.0.0-alpha.3", "description": "", "type": "module", "main": "dist/main.mjs", From 817850bde2b4552ef2b1d4c534e19e87f1cb673d Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 22:28:11 +0100 Subject: [PATCH 67/68] chore(cli): increment version --- apps/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index d209c51c..42988fb4 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "opentrader", - "version": "1.0.0-alpha.3", + "version": "1.0.0-alpha.4", "description": "", "type": "module", "main": "dist/main.mjs", From 5846fbab17ac46e3f3d80090c28d9ae003ecc823 Mon Sep 17 00:00:00 2001 From: bludnic Date: Wed, 10 Jul 2024 23:27:24 +0100 Subject: [PATCH 68/68] chore(cli): convert binary from bash to mjs --- apps/cli/bin/opentrader.mjs | 48 +++++++++++++++++++++++++++++++++++++ apps/cli/bin/opentrader.sh | 19 --------------- apps/cli/package.json | 4 ++-- 3 files changed, 50 insertions(+), 21 deletions(-) create mode 100755 apps/cli/bin/opentrader.mjs delete mode 100755 apps/cli/bin/opentrader.sh diff --git a/apps/cli/bin/opentrader.mjs b/apps/cli/bin/opentrader.mjs new file mode 100755 index 00000000..c74dba2d --- /dev/null +++ b/apps/cli/bin/opentrader.mjs @@ -0,0 +1,48 @@ +#!/usr/bin/env node + +import { readFile } from "fs/promises"; +import { spawn } from "child_process"; +import { fileURLToPath } from "url"; +import { dirname } from "path"; + +// Determine the script's directory +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +// Path to the file containing the admin password +const passwordFile = `${process.env.HOME}/.opentrader/pass`; + +// Function to read the password file +async function readPasswordFile(filePath) { + try { + const data = await readFile(filePath, "utf-8"); + return data.trim(); + } catch (error) { + console.error("Password file not found!"); + process.exit(1); + } +} + +// Main function to run the script +async function main() { + const adminPassword = await readPasswordFile(passwordFile); + + // Set environment variables + const env = { + ...process.env, + ADMIN_PASSWORD: adminPassword, + DATABASE_URL: `file:${process.env.HOME}/.opentrader/dev.db`, + }; + + // Run the Node.js script + const args = [`${__dirname}/../dist/main.mjs`, ...process.argv.slice(2)]; + const child = spawn("node", args, { env, stdio: "inherit" }); + + child.on("close", (code) => { + if (code !== 0) { + console.error(`Process exited with code ${code}`); + } + }); +} + +main(); diff --git a/apps/cli/bin/opentrader.sh b/apps/cli/bin/opentrader.sh deleted file mode 100755 index b9691bd5..00000000 --- a/apps/cli/bin/opentrader.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# Determine the script's directory -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" - -# Path to the file containing the admin password -PASSWORD_FILE="${HOME}/.opentrader/pass" - -# Extract the password from the file -if [ -f "$PASSWORD_FILE" ]; then - ADMIN_PASSWORD=$(cat "$PASSWORD_FILE") - echo "Admin password: **********" -else - echo "Password file not found!" - exit 1 -fi - -# Run the Node.js script with the resolved directory -ADMIN_PASSWORD=$ADMIN_PASSWORD DATABASE_URL="file:${HOME}/.opentrader/dev.db" node "$SCRIPT_DIR/../dist/main.mjs" "$@" diff --git a/apps/cli/package.json b/apps/cli/package.json index 42988fb4..d07be4a2 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "opentrader", - "version": "1.0.0-alpha.4", + "version": "1.0.0-alpha.5", "description": "", "type": "module", "main": "dist/main.mjs", @@ -57,6 +57,6 @@ "zod": "3.23.8" }, "bin": { - "opentrader": "./bin/opentrader.sh" + "opentrader": "./bin/opentrader.mjs" } }