diff --git a/index.js b/index.js index 05168e7..c6b1bf1 100644 --- a/index.js +++ b/index.js @@ -12,8 +12,6 @@ const { CreatorAuditLogService } = require('./src/services/creatorAuditLogServic const { CreatorAuthService } = require('./src/services/creatorAuthService'); const { SorobanSubscriptionVerifier } = require('./src/services/sorobanSubscriptionVerifier'); const { SubscriptionService } = require('./src/services/subscriptionService'); -const VideoProcessingWorker = require('./src/services/videoProcessingWorker'); -const createVideoRoutes = require('./routes/video'); const { buildAuditLogCsv } = require('./src/utils/export/auditLogCsv'); const { buildAuditLogPdf } = require('./src/utils/export/auditLogPdf'); const { getRequestIp } = require('./src/utils/requestIp'); @@ -42,7 +40,6 @@ function createApp(dependencies = {}) { // expose the service on the express app so external routers can access it app.set('subscriptionService', subscriptionService); - const videoWorker = dependencies.videoWorker || new VideoProcessingWorker(config, database); app.use(cors()); app.use(express.json()); diff --git a/package-lock.json b/package-lock.json index 317d12d..e016904 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,23 +9,32 @@ "version": "1.0.0", "dependencies": { "@stellar/stellar-sdk": "^14.6.1", + "aws-sdk": "^2.1500.0", "axios": "^1.6.2", + "better-sqlite3": "^12.8.0", + "bull": "^4.12.2", "cors": "^2.8.6", "dotenv": "^17.3.1", "ethers": "^6.8.1", "express": "^5.2.1", + "fluent-ffmpeg": "^2.1.2", "form-data": "^4.0.0", "ioredis": "^5.6.1", "ipfs-http-client": "^60.0.1", "jsonwebtoken": "^9.0.2", "multer": "^1.4.5-lts.1", + "redis": "^4.6.10", "stellar-sdk": "^13.3.0", + "uuid": "^9.0.1", "web3.storage": "^4.5.4" }, "devDependencies": { "jest": "^29.7.0", "nodemon": "^3.0.2", "supertest": "^7.0.0" + }, + "engines": { + "node": ">=20.11.0" } }, "node_modules/@adraffy/ens-normalize": { @@ -1396,6 +1405,84 @@ "npm": ">=7.0.0" } }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz", + "integrity": "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz", + "integrity": "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz", + "integrity": "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz", + "integrity": "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz", + "integrity": "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz", + "integrity": "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@multiformats/dns": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/@multiformats/dns/-/dns-1.0.13.tgz", @@ -1649,6 +1736,71 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", "license": "BSD-3-Clause" }, + "node_modules/@redis/bloom": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", + "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/client": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.1.tgz", + "integrity": "sha512-/KCsg3xSlR+nCK8/8ZYSknYxvXHwubJrU82F3Lm1Fp6789VQ0/3RJKfsmRXjqfaTA++23CvC3hqmqe/2GEt6Kw==", + "license": "MIT", + "dependencies": { + "cluster-key-slot": "1.1.2", + "generic-pool": "3.9.0", + "yallist": "4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@redis/client/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/@redis/graph": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", + "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/json": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", + "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/search": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", + "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/time-series": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", + "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.10", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", @@ -2080,6 +2232,11 @@ "dev": true, "license": "MIT" }, + "node_modules/async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==" + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -2101,6 +2258,70 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/aws-sdk": { + "version": "2.1693.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1693.0.tgz", + "integrity": "sha512-cJmb8xEnVLT+R6fBS5sn/EFJiX7tUnDaPtOPZ1vFbOJtd0fnZn/Ky2XGgsvvoeliWeH7mL3TWSX5zXXGSQV6gQ==", + "deprecated": "The AWS SDK for JavaScript (v2) has reached end-of-support, and no longer receives updates. Please migrate your code to use AWS SDK for JavaScript (v3). More info https://a.co/cUPnyil", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "buffer": "4.9.2", + "events": "1.1.1", + "ieee754": "1.1.13", + "jmespath": "0.16.0", + "querystring": "0.2.0", + "sax": "1.2.1", + "url": "0.10.3", + "util": "^0.12.4", + "uuid": "8.0.0", + "xml2js": "0.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/aws-sdk/node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/aws-sdk/node_modules/events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==", + "license": "MIT", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/aws-sdk/node_modules/ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "license": "BSD-3-Clause" + }, + "node_modules/aws-sdk/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/aws-sdk/node_modules/uuid": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", + "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/axios": { "version": "1.13.6", "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz", @@ -2320,6 +2541,20 @@ "node": ">=6.0.0" } }, + "node_modules/better-sqlite3": { + "version": "12.8.0", + "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.8.0.tgz", + "integrity": "sha512-RxD2Vd96sQDjQr20kdP+F+dK/1OUNiVOl200vKBZY8u0vTwysfolF6Hq+3ZK2+h8My9YvZhHsF+RSGZW2VYrPQ==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "bindings": "^1.5.0", + "prebuild-install": "^7.1.1" + }, + "engines": { + "node": "20.x || 22.x || 23.x || 24.x || 25.x" + } + }, "node_modules/bignumber.js": { "version": "9.3.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", @@ -2342,6 +2577,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bl": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", @@ -2527,6 +2771,45 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "license": "MIT" }, + "node_modules/bull": { + "version": "4.16.5", + "resolved": "https://registry.npmjs.org/bull/-/bull-4.16.5.tgz", + "integrity": "sha512-lDsx2BzkKe7gkCYiT5Acj02DpTwDznl/VNN7Psn7M3USPG7Vs/BaClZJJTAG+ufAR9++N1/NiUTdaFBWDIl5TQ==", + "license": "MIT", + "dependencies": { + "cron-parser": "^4.9.0", + "get-port": "^5.1.1", + "ioredis": "^5.3.2", + "lodash": "^4.17.21", + "msgpackr": "^1.11.2", + "semver": "^7.5.2", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/bull/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/bull/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -2752,6 +3035,12 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, "node_modules/ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", @@ -3014,6 +3303,18 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/cron-parser": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.9.0.tgz", + "integrity": "sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==", + "license": "MIT", + "dependencies": { + "luxon": "^3.2.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -3097,6 +3398,21 @@ "node": ">=0.10.0" } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/dedent": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", @@ -3112,6 +3428,15 @@ } } }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -3164,6 +3489,15 @@ "node": ">= 0.8" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -3309,6 +3643,15 @@ "node": ">=0.10.0" } }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", @@ -3526,6 +3869,15 @@ "node": ">= 0.8.0" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, "node_modules/expect": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", @@ -3623,6 +3975,12 @@ "is-retry-allowed": "^3.0.0" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" + }, "node_modules/files-from-path": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/files-from-path/-/files-from-path-0.2.6.tgz", @@ -3736,6 +4094,32 @@ "node": ">=8" } }, + "node_modules/fluent-ffmpeg": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.3.tgz", + "integrity": "sha512-Be3narBNt2s6bsaqP6Jzq91heDgOEaDCJAXcE3qcma/EJBSy5FB4cvO31XBInuAuKBx8Kptf8dkhjK0IOru39Q==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "license": "MIT", + "dependencies": { + "async": "^0.2.9", + "which": "^1.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/fluent-ffmpeg/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/follow-redirects": { "version": "1.15.11", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", @@ -3840,6 +4224,12 @@ "node": ">= 0.8" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3878,6 +4268,15 @@ "node": ">= 0.4" } }, + "node_modules/generic-pool": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", + "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -3936,6 +4335,18 @@ "node": ">=8.0.0" } }, + "node_modules/get-port": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", + "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-proto": { "version": "1.0.1", "license": "MIT", @@ -3960,6 +4371,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4279,6 +4696,12 @@ "version": "2.0.4", "license": "ISC" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, "node_modules/interface-blockstore": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/interface-blockstore/-/interface-blockstore-2.0.3.tgz", @@ -5128,7 +5551,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, "license": "ISC" }, "node_modules/iso-random-stream": { @@ -5974,6 +6396,15 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jmespath": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", + "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6194,6 +6625,12 @@ "node": ">=8" } }, + "node_modules/lodash": { + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", + "license": "MIT" + }, "node_modules/lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", @@ -6264,6 +6701,15 @@ "yallist": "^3.0.2" } }, + "node_modules/luxon": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", + "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/main-event": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/main-event/-/main-event-1.0.1.tgz", @@ -6470,6 +6916,18 @@ "node": ">=6" } }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -6535,6 +6993,12 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, "node_modules/move-file": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/move-file/-/move-file-2.1.0.tgz", @@ -6563,6 +7027,37 @@ "version": "2.1.3", "license": "MIT" }, + "node_modules/msgpackr": { + "version": "1.11.9", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.9.tgz", + "integrity": "sha512-FkoAAyyA6HM8wL882EcEyFZ9s7hVADSwG9xrVx3dxxNQAtgADTrJoEWivID82Iv1zWDsv/OtbrrcZAzGzOMdNw==", + "license": "MIT", + "optionalDependencies": { + "msgpackr-extract": "^3.0.2" + } + }, + "node_modules/msgpackr-extract": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz", + "integrity": "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build-optional-packages": "5.2.2" + }, + "bin": { + "download-msgpackr-prebuilds": "bin/download-prebuilds.js" + }, + "optionalDependencies": { + "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3", + "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3" + } + }, "node_modules/multer": { "version": "1.4.5-lts.2", "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", @@ -6722,6 +7217,12 @@ "node": "^14 || ^16 || >=18" } }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT" + }, "node_modules/native-abort-controller": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/native-abort-controller/-/native-abort-controller-1.0.4.tgz", @@ -6754,6 +7255,30 @@ "node": ">= 0.6" } }, + "node_modules/node-abi": { + "version": "3.89.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.89.0.tgz", + "integrity": "sha512-6u9UwL0HlAl21+agMN3YAMXcKByMqwGx+pq+P76vii5f7hTPtKDp08/H9py6DY+cfDw7kQNTGEj/rly3IgbNQA==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-abi/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -6783,6 +7308,21 @@ "node": ">= 6.13.0" } }, + "node_modules/node-gyp-build-optional-packages": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz", + "integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==", + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.1" + }, + "bin": { + "node-gyp-build-optional-packages": "bin.js", + "node-gyp-build-optional-packages-optional": "optional.js", + "node-gyp-build-optional-packages-test": "build-test.js" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -7250,6 +7790,33 @@ "node": ">= 0.4" } }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "deprecated": "No longer maintained. Please contact the author of the relevant native addon; alternatives are available.", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -7378,6 +7945,22 @@ "dev": true, "license": "MIT" }, + "node_modules/pump": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", + "license": "MIT" + }, "node_modules/pure-rand": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", @@ -7408,6 +7991,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "engines": { + "node": ">=0.4.x" + } + }, "node_modules/quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", @@ -7463,6 +8055,30 @@ "node": ">= 0.10" } }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -7614,6 +8230,23 @@ "node": ">=8" } }, + "node_modules/redis": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.1.tgz", + "integrity": "sha512-S1bJDnqLftzHXHP8JsT5II/CtHWQrASX5K96REjWjlmWKrviSOLWmM7QnRLstAWsu1VBBV1ffV6DzCvxNP0UJQ==", + "license": "MIT", + "workspaces": [ + "./packages/*" + ], + "dependencies": { + "@redis/bloom": "1.2.0", + "@redis/client": "1.6.1", + "@redis/graph": "1.1.1", + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" + } + }, "node_modules/redis-errors": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", @@ -7781,6 +8414,12 @@ "version": "2.1.2", "license": "MIT" }, + "node_modules/sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", + "license": "ISC" + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -7967,6 +8606,51 @@ "dev": true, "license": "ISC" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/simple-update-notifier": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", @@ -8335,6 +9019,69 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tar-fs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/tar-stream/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -8452,6 +9199,18 @@ "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "license": "0BSD" }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -8650,6 +9409,16 @@ "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==", "license": "MIT" }, + "node_modules/url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==", + "license": "MIT", + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, "node_modules/utf8-codec": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/utf8-codec/-/utf8-codec-1.0.0.tgz", @@ -8675,6 +9444,19 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", @@ -9226,6 +10008,28 @@ } } }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index b564e54..7bfd146 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,10 @@ "test": "jest" }, "dependencies": { - "@stellar/stellar-sdk": "^14.6.1", - "aws-sdk": "^2.1500.0", - "axios": "^1.6.2", + "@stellar/stellar-sdk": "^14.6.1", + "aws-sdk": "^2.1500.0", + "axios": "^1.6.2", + "better-sqlite3": "^12.8.0", "bull": "^4.12.2", "cors": "^2.8.6", "dotenv": "^17.3.1", diff --git a/routes/payouts.js b/routes/payouts.js new file mode 100644 index 0000000..4a1e5fc --- /dev/null +++ b/routes/payouts.js @@ -0,0 +1,16 @@ +const express = require('express'); +const router = express.Router(); + +// GET /api/payouts?creator_address=... +router.get('/', (req, res) => { + const db = req.app.get('db'); + const { creator_address } = req.query; + try { + const payouts = db.getPayouts(creator_address); + res.json({ payouts }); + } catch (err) { + res.status(500).json({ error: 'Failed to fetch payouts' }); + } +}); + +module.exports = router; diff --git a/src/db/appDatabase.js b/src/db/appDatabase.js index aaebddf..d6ebef4 100644 --- a/src/db/appDatabase.js +++ b/src/db/appDatabase.js @@ -1,42 +1,20 @@ const fs = require('fs'); const path = require('path'); const crypto = require('crypto'); -const { DatabaseSync } = require('node:sqlite'); +const Database = require('better-sqlite3'); /** * SQLite-backed application database wrapper. */ class AppDatabase { + // ...existing code... /** * @param {string} filename SQLite filename or `:memory:`. */ constructor(filename) { this.filename = filename; this.ensureDirectory(); - this.db = new DatabaseSync(filename); - this.initializeSchema(); - this.ensureSubscriberCountColumn(); - } - - /** - * Ensure the database directory exists for file-backed databases. - * - * @returns {void} - */ - ensureDirectory() { - if (this.filename === ':memory:') { - return; - } - - fs.mkdirSync(path.dirname(this.filename), { recursive: true }); - } - - /** - * Initialize all application tables and indexes. - * - * @returns {void} - */ - initializeSchema() { + this.db = new Database(filename); this.db.exec(` PRAGMA foreign_keys = ON; @@ -104,17 +82,8 @@ class AppDatabase { PRIMARY KEY (creator_id, wallet_address) ); - CREATE TABLE IF NOT EXISTS subscriptions ( - creator_id TEXT NOT NULL REFERENCES creators(id), - wallet_address TEXT NOT NULL, - active INTEGER NOT NULL DEFAULT 1, - subscribed_at TEXT NOT NULL, - unsubscribed_at TEXT, - PRIMARY KEY (creator_id, wallet_address) - ); - CREATE INDEX IF NOT EXISTS idx_creator_audit_logs_creator_timestamp - ON creator_audit_logs (creator_id, timestamp DESC); + ON creator_audit_logs (creator_id, timestamp DESC); CREATE TABLE IF NOT EXISTS comments ( id TEXT PRIMARY KEY, @@ -130,6 +99,20 @@ class AppDatabase { CREATE INDEX IF NOT EXISTS idx_comments_creator_id ON comments (creator_id); CREATE INDEX IF NOT EXISTS idx_comments_user_address ON comments (user_address); `); + + this.ensureSubscriberCountColumn(); + } + + /** + * Ensure the parent directory for the database file exists. + */ + ensureDirectory() { + if (this.filename !== ':memory:') { + const dir = path.dirname(this.filename); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } + } } /** @@ -138,20 +121,12 @@ class AppDatabase { */ ensureSubscriberCountColumn() { try { - const info = this.db - .prepare("PRAGMA table_info(creators);") - .all(); - + const info = this.db.prepare('PRAGMA table_info(creators);').all(); const hasColumn = info.some((col) => col.name === 'subscriber_count'); - if (!hasColumn) { - // Add the column with a default of 0 - this.db.exec(`ALTER TABLE creators ADD COLUMN subscriber_count INTEGER DEFAULT 0`); + this.db.exec('ALTER TABLE creators ADD COLUMN subscriber_count INTEGER DEFAULT 0'); } } catch (error) { - // If anything goes wrong, log and continue — schema migrations - // should be non-fatal for existing deployments in this simple codebase. - // eslint-disable-next-line no-console console.warn('ensureSubscriberCountColumn failed:', error.message); } } @@ -165,7 +140,6 @@ class AppDatabase { */ transaction(callback) { this.db.exec('BEGIN'); - try { const result = callback(); this.db.exec('COMMIT'); @@ -177,62 +151,42 @@ class AppDatabase { } /** - * Ensure a creator row exists. + * Ensure a creator row exists, inserting a stub if absent. * * @param {string} creatorId Creator identifier. - * @returns {void} */ ensureCreator(creatorId) { - const now = new Date().toISOString(); this.db .prepare( - ` - INSERT INTO creators (id, created_at) - VALUES (?, ?) - ON CONFLICT(id) DO NOTHING - `, + 'INSERT INTO creators (id, created_at) VALUES (?, ?) ON CONFLICT(id) DO NOTHING', ) - .run(creatorId, now); + .run(creatorId, new Date().toISOString()); } /** * Seed a video for tests or local setup. * * @param {{id: string, creatorId: string, title?: string, visibility: string}} video Video seed. - * @returns {void} */ seedVideo(video) { this.ensureCreator(video.creatorId); this.db .prepare( - ` - INSERT INTO videos (id, creator_id, title, visibility, updated_at) - VALUES (?, ?, ?, ?, ?) - `, + 'INSERT INTO videos (id, creator_id, title, visibility, updated_at) VALUES (?, ?, ?, ?, ?)', ) - .run( - video.id, - video.creatorId, - video.title || null, - video.visibility, - new Date().toISOString(), - ); + .run(video.id, video.creatorId, video.title || null, video.visibility, new Date().toISOString()); } /** * Seed a co-op split for tests or local setup. * - * @param {{id: string, creatorId: string, splits: object[]}} split Co-op split seed. - * @returns {void} + * @param {{id: string, creatorId: string, splits: object[]}} split Split seed. */ seedCoopSplit(split) { this.ensureCreator(split.creatorId); this.db .prepare( - ` - INSERT INTO coop_splits (id, creator_id, split_json, updated_at) - VALUES (?, ?, ?, ?) - `, + 'INSERT INTO coop_splits (id, creator_id, split_json, updated_at) VALUES (?, ?, ?, ?)', ) .run(split.id, split.creatorId, JSON.stringify(split.splits), new Date().toISOString()); } @@ -247,21 +201,9 @@ class AppDatabase { this.ensureCreator(settings.creatorId); this.db .prepare( - ` - INSERT INTO creator_settings (creator_id, flow_rate, currency, updated_at) - VALUES (?, ?, ?, ?) - ON CONFLICT(creator_id) DO UPDATE SET - flow_rate = excluded.flow_rate, - currency = excluded.currency, - updated_at = excluded.updated_at - `, + 'INSERT INTO creator_settings (creator_id, flow_rate, currency, updated_at) VALUES (?, ?, ?, ?) ON CONFLICT(creator_id) DO UPDATE SET flow_rate = excluded.flow_rate, currency = excluded.currency, updated_at = excluded.updated_at', ) - .run( - settings.creatorId, - settings.flowRate, - settings.currency || null, - new Date().toISOString(), - ); + .run(settings.creatorId, settings.flowRate, settings.currency || null, new Date().toISOString()); } /** @@ -273,14 +215,9 @@ class AppDatabase { getCreatorSettings(creatorId) { const row = this.db .prepare( - ` - SELECT creator_id AS creatorId, flow_rate AS flowRate, currency, updated_at AS updatedAt - FROM creator_settings - WHERE creator_id = ? - `, + 'SELECT creator_id AS creatorId, flow_rate AS flowRate, currency, updated_at AS updatedAt FROM creator_settings WHERE creator_id = ?', ) .get(creatorId); - return row || null; } @@ -294,17 +231,9 @@ class AppDatabase { this.ensureCreator(settings.creatorId); this.db .prepare( - ` - INSERT INTO creator_settings (creator_id, flow_rate, currency, updated_at) - VALUES (?, ?, ?, ?) - ON CONFLICT(creator_id) DO UPDATE SET - flow_rate = excluded.flow_rate, - currency = excluded.currency, - updated_at = excluded.updated_at - `, + 'INSERT INTO creator_settings (creator_id, flow_rate, currency, updated_at) VALUES (?, ?, ?, ?) ON CONFLICT(creator_id) DO UPDATE SET flow_rate = excluded.flow_rate, currency = excluded.currency, updated_at = excluded.updated_at', ) .run(settings.creatorId, settings.flowRate, settings.currency, settings.updatedAt); - return this.getCreatorSettings(settings.creatorId); } @@ -317,14 +246,9 @@ class AppDatabase { getVideoById(videoId) { const row = this.db .prepare( - ` - SELECT id, creator_id AS creatorId, title, visibility, updated_at AS updatedAt - FROM videos - WHERE id = ? - `, + 'SELECT id, creator_id AS creatorId, title, visibility, updated_at AS updatedAt FROM videos WHERE id = ?', ) .get(videoId); - return row || null; } @@ -336,15 +260,8 @@ class AppDatabase { */ updateVideoVisibility(input) { this.db - .prepare( - ` - UPDATE videos - SET visibility = ?, updated_at = ? - WHERE id = ? - `, - ) + .prepare('UPDATE videos SET visibility = ?, updated_at = ? WHERE id = ?') .run(input.visibility, input.updatedAt, input.videoId); - return this.getVideoById(input.videoId); } @@ -357,18 +274,12 @@ class AppDatabase { getCoopSplitById(splitId) { const row = this.db .prepare( - ` - SELECT id, creator_id AS creatorId, split_json AS splitJson, updated_at AS updatedAt - FROM coop_splits - WHERE id = ? - `, + 'SELECT id, creator_id AS creatorId, split_json AS splitJson, updated_at AS updatedAt FROM coop_splits WHERE id = ?', ) .get(splitId); - if (!row) { return null; } - return { ...row, splits: JSON.parse(row.splitJson), @@ -383,15 +294,8 @@ class AppDatabase { */ updateCoopSplit(input) { this.db - .prepare( - ` - UPDATE coop_splits - SET split_json = ?, updated_at = ? - WHERE id = ? - `, - ) + .prepare('UPDATE coop_splits SET split_json = ?, updated_at = ? WHERE id = ?') .run(JSON.stringify(input.splits), input.updatedAt, input.splitId); - return this.getCoopSplitById(input.splitId); } @@ -406,20 +310,7 @@ class AppDatabase { this.ensureCreator(entry.creatorId); this.db .prepare( - ` - INSERT INTO creator_audit_logs ( - id, - creator_id, - action_type, - entity_type, - entity_id, - timestamp, - ip_address, - metadata_json, - created_at - ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) - `, + 'INSERT INTO creator_audit_logs (id, creator_id, action_type, entity_type, entity_id, timestamp, ip_address, metadata_json, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)', ) .run( id, @@ -435,20 +326,7 @@ class AppDatabase { return this.db .prepare( - ` - SELECT - id, - creator_id AS creatorId, - action_type AS actionType, - entity_type AS entityType, - entity_id AS entityId, - timestamp, - ip_address AS ipAddress, - metadata_json AS metadataJson, - created_at AS createdAt - FROM creator_audit_logs - WHERE id = ? - `, + 'SELECT id, creator_id AS creatorId, action_type AS actionType, entity_type AS entityType, entity_id AS entityId, timestamp, ip_address AS ipAddress, metadata_json AS metadataJson, created_at AS createdAt FROM creator_audit_logs WHERE id = ?', ) .get(id); } @@ -462,21 +340,7 @@ class AppDatabase { listAuditLogsByCreatorId(creatorId) { return this.db .prepare( - ` - SELECT - id, - creator_id AS creatorId, - action_type AS actionType, - entity_type AS entityType, - entity_id AS entityId, - timestamp, - ip_address AS ipAddress, - metadata_json AS metadataJson, - created_at AS createdAt - FROM creator_audit_logs - WHERE creator_id = ? - ORDER BY timestamp DESC, id DESC - `, + 'SELECT id, creator_id AS creatorId, action_type AS actionType, entity_type AS entityType, entity_id AS entityId, timestamp, ip_address AS ipAddress, metadata_json AS metadataJson, created_at AS createdAt FROM creator_audit_logs WHERE creator_id = ? ORDER BY timestamp DESC, id DESC', ) .all(creatorId); } @@ -491,9 +355,8 @@ class AppDatabase { getCreatorSubscriberCount(creatorId) { this.ensureCreator(creatorId); const row = this.db - .prepare(`SELECT subscriber_count AS subscriberCount FROM creators WHERE id = ?`) + .prepare('SELECT subscriber_count AS subscriberCount FROM creators WHERE id = ?') .get(creatorId); - return (row && Number(row.subscriberCount)) || 0; } @@ -508,9 +371,10 @@ class AppDatabase { return this.transaction(() => { this.ensureCreator(creatorId); this.db - .prepare(`UPDATE creators SET subscriber_count = COALESCE(subscriber_count, 0) + 1 WHERE id = ?`) + .prepare( + 'UPDATE creators SET subscriber_count = COALESCE(subscriber_count, 0) + 1 WHERE id = ?', + ) .run(creatorId); - return this.getCreatorSubscriberCount(creatorId); }); } @@ -527,10 +391,9 @@ class AppDatabase { this.ensureCreator(creatorId); this.db .prepare( - `UPDATE creators SET subscriber_count = MAX(COALESCE(subscriber_count, 0) - 1, 0) WHERE id = ?`, + 'UPDATE creators SET subscriber_count = MAX(COALESCE(subscriber_count, 0) - 1, 0) WHERE id = ?', ) .run(creatorId); - return this.getCreatorSubscriberCount(creatorId); }); } @@ -547,15 +410,15 @@ class AppDatabase { this.ensureCreator(creatorId); const safe = Math.max(0, Math.floor(Number(count) || 0)); this.db - .prepare(`UPDATE creators SET subscriber_count = ? WHERE id = ?`) + .prepare('UPDATE creators SET subscriber_count = ? WHERE id = ?') .run(safe, creatorId); - return this.getCreatorSubscriberCount(creatorId); }); } /** * Get a subscription row for a creator and wallet. + * * @param {string} creatorId * @param {string} walletAddress * @returns {object|null} @@ -563,9 +426,11 @@ class AppDatabase { getSubscription(creatorId, walletAddress) { const row = this.db .prepare( - `SELECT creator_id AS creatorId, wallet_address AS walletAddress, active, subscribed_at AS subscribedAt, unsubscribed_at AS unsubscribedAt FROM subscriptions WHERE creator_id = ? AND wallet_address = ?`, + 'SELECT creator_id AS creatorId, wallet_address AS walletAddress, active, subscribed_at AS subscribedAt, unsubscribed_at AS unsubscribedAt FROM subscriptions WHERE creator_id = ? AND wallet_address = ?' ) .get(creatorId, walletAddress); +<<<<<<< HEAD +======= * Create a new comment. * * @param {{postId: string, userAddress: string, creatorId: string, content: string}} comment Comment data. @@ -603,11 +468,54 @@ class AppDatabase { ) .get(commentId); +>>>>>>> origin/main + return row || null; + } + /** +<<<<<<< HEAD + * Create a new comment. + * @param {{postId: string, userAddress: string, creatorId: string, content: string}} comment Comment data. + * @returns {object} + */ + createComment(comment) { + const id = crypto.randomUUID(); + const now = new Date().toISOString(); + this.db + .prepare( + ` + INSERT INTO comments (id, post_id, user_address, creator_id, content, created_at, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?) + ` + ) + .run(id, comment.postId, comment.userAddress, comment.creatorId, comment.content, now, now); + return this.getCommentById(id); + } + + /** + * Get a comment by ID. + * @param {string} commentId Comment identifier. + * @returns {object|null} + */ + getCommentById(commentId) { + const row = this.db + .prepare( + ` + SELECT id, post_id AS postId, user_address AS userAddress, creator_id AS creatorId, content, created_at AS createdAt, updated_at AS updatedAt + FROM comments + WHERE id = ? + ` + ) + .get(commentId); return row || null; } /** + * Create or activate a subscription for a wallet. + * Returns { changed: boolean, count: number }. + * +======= * Create or activate a subscription for a wallet. Returns { changed: boolean, count: number } +>>>>>>> origin/main * @param {string} creatorId * @param {string} walletAddress */ @@ -618,33 +526,37 @@ class AppDatabase { const now = new Date().toISOString(); if (existing && existing.active === 1) { - // already active return { changed: false, count: this.getCreatorSubscriberCount(creatorId) }; } if (existing) { - // reactivate this.db - .prepare(`UPDATE subscriptions SET active = 1, subscribed_at = ?, unsubscribed_at = NULL WHERE creator_id = ? AND wallet_address = ?`) + .prepare( + 'UPDATE subscriptions SET active = 1, subscribed_at = ?, unsubscribed_at = NULL WHERE creator_id = ? AND wallet_address = ?', + ) .run(now, creatorId, walletAddress); } else { this.db - .prepare(`INSERT INTO subscriptions (creator_id, wallet_address, active, subscribed_at) VALUES (?, ?, 1, ?)`) + .prepare( + 'INSERT INTO subscriptions (creator_id, wallet_address, active, subscribed_at) VALUES (?, ?, 1, ?)', + ) .run(creatorId, walletAddress, now); } - // Increment cached count this.db - .prepare(`UPDATE creators SET subscriber_count = COALESCE(subscriber_count, 0) + 1 WHERE id = ?`) + .prepare( + 'UPDATE creators SET subscriber_count = COALESCE(subscriber_count, 0) + 1 WHERE id = ?', + ) .run(creatorId); - const newCount = this.getCreatorSubscriberCount(creatorId); - return { changed: true, count: newCount }; + return { changed: true, count: this.getCreatorSubscriberCount(creatorId) }; }); } /** - * Deactivate a subscription if it is currently active. Returns { changed: boolean, count: number } + * Deactivate a subscription if it is currently active. + * Returns { changed: boolean, count: number }. + * * @param {string} creatorId * @param {string} walletAddress */ @@ -659,32 +571,41 @@ class AppDatabase { } this.db - .prepare(`UPDATE subscriptions SET active = 0, unsubscribed_at = ? WHERE creator_id = ? AND wallet_address = ?`) + .prepare( + 'UPDATE subscriptions SET active = 0, unsubscribed_at = ? WHERE creator_id = ? AND wallet_address = ?', + ) .run(now, creatorId, walletAddress); - // Decrement cached count, clamp at 0 this.db - .prepare(`UPDATE creators SET subscriber_count = MAX(COALESCE(subscriber_count, 0) - 1, 0) WHERE id = ?`) + .prepare( + 'UPDATE creators SET subscriber_count = MAX(COALESCE(subscriber_count, 0) - 1, 0) WHERE id = ?', + ) .run(creatorId); - const newCount = this.getCreatorSubscriberCount(creatorId); - return { changed: true, count: newCount }; + return { changed: true, count: this.getCreatorSubscriberCount(creatorId) }; }); } /** * Count active subscriptions for a creator (derived from subscriptions table). + * * @param {string} creatorId * @returns {number} */ countActiveSubscriptions(creatorId) { const row = this.db - .prepare(`SELECT COUNT(1) AS ct FROM subscriptions WHERE creator_id = ? AND active = 1`) + .prepare('SELECT COUNT(1) AS ct FROM subscriptions WHERE creator_id = ? AND active = 1') .get(creatorId); - return (row && Number(row.ct)) || 0; +<<<<<<< HEAD + } + + /** + * Get comments by post ID. +======= * Get comments by post ID. * +>>>>>>> origin/main * @param {string} postId Post identifier. * @returns {object[]} */ @@ -696,14 +617,21 @@ class AppDatabase { FROM comments WHERE post_id = ? ORDER BY created_at DESC +<<<<<<< HEAD + ` +======= `, +>>>>>>> origin/main ) .all(postId); } /** * Update a comment. +<<<<<<< HEAD +======= * +>>>>>>> origin/main * @param {{commentId: string, content: string}} input Update payload. * @returns {object} */ @@ -715,16 +643,25 @@ class AppDatabase { UPDATE comments SET content = ?, updated_at = ? WHERE id = ? +<<<<<<< HEAD + ` + ) + .run(input.content, now, input.commentId); +======= `, ) .run(input.content, now, input.commentId); +>>>>>>> origin/main return this.getCommentById(input.commentId); } /** * Delete a comment. +<<<<<<< HEAD +======= * +>>>>>>> origin/main * @param {string} commentId Comment identifier. * @returns {boolean} */ @@ -733,14 +670,20 @@ class AppDatabase { .prepare( ` DELETE FROM comments WHERE id = ? +<<<<<<< HEAD + ` + ) + .run(commentId); +======= `, ) .run(commentId); +>>>>>>> origin/main return result.changes > 0; } } module.exports = { AppDatabase, -}; +}; \ No newline at end of file