From 3137f02063fa59a81697b87c63ad2d76e6d69e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my?= Date: Mon, 15 Jan 2024 17:36:39 +0100 Subject: [PATCH] Update dependencies and fix code formatting --- .prettierrc | 4 + package.json | 3 +- pnpm-lock.yaml | 457 ++++++++++++++++++++++++++++++++- src/bot/commands/ai/help.ts | 5 +- src/bot/commands/ai/imagine.ts | 457 +++++++++++++++++---------------- src/test/database.ts | 194 +++++++------- 6 files changed, 793 insertions(+), 327 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..222861c --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "tabWidth": 2, + "useTabs": false +} diff --git a/package.json b/package.json index 4f6dc49..8c0664f 100644 --- a/package.json +++ b/package.json @@ -21,10 +21,11 @@ "@types/react": "^18.0.23", "@types/react-dom": "^18.0.7", "cross-env": "^7.0.3", + "eslint": "^8.56.0", "nodemon": "^3.0.2", "prisma": "^5.8.1", "ts-node": "^10.9.2", - "typescript": ">=2.7" + "typescript": "^5.3.3" }, "dependencies": { "@emotion/cache": "^11.11.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dfa4c12..09c8563 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -85,6 +85,9 @@ devDependencies: cross-env: specifier: ^7.0.3 version: 7.0.3 + eslint: + specifier: ^8.56.0 + version: 8.56.0 nodemon: specifier: ^3.0.2 version: 3.0.2 @@ -95,11 +98,16 @@ devDependencies: specifier: ^10.9.2 version: 10.9.2(@swc/core@1.3.101)(@types/node@20.10.5)(typescript@5.3.3) typescript: - specifier: '>=2.7' + specifier: ^5.3.3 version: 5.3.3 packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + /@babel/code-frame@7.23.5: resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} @@ -341,6 +349,43 @@ packages: resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==} dev: false + /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.56.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp@4.10.0: + resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + + /@eslint/eslintrc@2.1.4: + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4(supports-color@5.5.0) + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.0 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js@8.56.0: + resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@fastify/ajv-compiler@3.5.0: resolution: {integrity: sha512-ebbEtlI7dxXF5ziNdr05mOY8NnDiPB1XvAlLHctRt/Rc+C3LCOVW5imUVX+mhvUhnNzmPBHewUkOFgGlCxgdAA==} dependencies: @@ -400,6 +445,26 @@ packages: resolution: {integrity: sha512-XxPltXs5R31D6UZeLIV1td3wTXU3jzd3f2DLsXI8tytMGBkIsGcc9sIyiupRtA8y73HAhuSCeweOoBqf6DbWCA==} dev: false + /@humanwhocodes/config-array@0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 2.0.2 + debug: 4.3.4(supports-color@5.5.0) + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: true + + /@humanwhocodes/object-schema@2.0.2: + resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + dev: true + /@jridgewell/resolve-uri@3.1.1: resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} engines: {node: '>=6.0.0'} @@ -1223,6 +1288,10 @@ packages: '@types/node': 20.10.5 dev: false + /@ungap/structured-clone@1.2.0: + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + dev: true + /@vladfrangu/async_event_emitter@2.2.4: resolution: {integrity: sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} @@ -1250,6 +1319,14 @@ packages: resolution: {integrity: sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==} dev: false + /acorn-jsx@5.3.2(acorn@8.11.2): + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.11.2 + dev: true + /acorn-walk@8.3.1: resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==} engines: {node: '>=0.4.0'} @@ -1272,6 +1349,15 @@ packages: ajv: 8.12.0 dev: false + /ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + /ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} dependencies: @@ -1281,6 +1367,11 @@ packages: uri-js: 4.4.1 dev: false + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -1288,6 +1379,13 @@ packages: color-convert: 1.9.3 dev: false + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -1308,6 +1406,10 @@ packages: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} dev: true + /argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true + /async-mutex@0.4.0: resolution: {integrity: sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA==} dependencies: @@ -1433,7 +1535,6 @@ packages: /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - dev: false /caniuse-lite@1.0.30001571: resolution: {integrity: sha512-tYq/6MoXhdezDLFZuCO/TKboTzuQ/xR5cFdgXPfDtM7/kchBO3b4VWghE/OAi/DV7tTdhmLjZiZBZi1fA/GheQ==} @@ -1448,6 +1549,14 @@ packages: supports-color: 5.5.0 dev: false + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} @@ -1484,10 +1593,21 @@ packages: color-name: 1.1.3 dev: false + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} dev: false + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -1587,6 +1707,10 @@ packages: mimic-response: 3.1.0 dev: true + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + /defer-to-connect@2.0.1: resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} engines: {node: '>=10'} @@ -1634,6 +1758,13 @@ packages: - utf-8-validate dev: false + /doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + dev: true + /dom-helpers@5.2.1: resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==} dependencies: @@ -1666,13 +1797,105 @@ packages: /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - dev: false /escape-string-regexp@5.0.0: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} dev: true + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /eslint@8.56.0: + resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + '@eslint-community/regexpp': 4.10.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.56.0 + '@humanwhocodes/config-array': 0.11.14 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4(supports-color@5.5.0) + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.0 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.11.2 + acorn-jsx: 5.3.2(acorn@8.11.2) + eslint-visitor-keys: 3.4.3 + dev: true + + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + /event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} @@ -1743,7 +1966,6 @@ packages: /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: false /fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} @@ -1756,6 +1978,10 @@ packages: micromatch: 4.0.5 dev: true + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + /fast-json-stringify@5.9.1: resolution: {integrity: sha512-NMrf+uU9UJnTzfxaumMDXK1NWqtPCfGoM9DYIE+ESlaTQqjlANFBy0VAbsm6FB88Mx0nceyi18zTo5kIEUlzxg==} dependencies: @@ -1768,6 +1994,10 @@ packages: rfdc: 1.3.0 dev: false + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + /fast-printf@1.6.9: resolution: {integrity: sha512-FChq8hbz65WMj4rstcQsFB0O7Cy++nmbNfLYnD9cYv2cRn8EG6k/MGn9kO/tjO66t09DLDugj3yL+V2o6Qftrg==} engines: {node: '>=10.0'} @@ -1826,6 +2056,13 @@ packages: web-streams-polyfill: 3.2.1 dev: false + /file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.2.0 + dev: true + /file-type@17.1.6: resolution: {integrity: sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1869,6 +2106,14 @@ packages: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} dev: false + /find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + /find-versions@5.1.0: resolution: {integrity: sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==} engines: {node: '>=12'} @@ -1876,6 +2121,19 @@ packages: semver-regex: 4.0.5 dev: true + /flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: 3.2.9 + keyv: 4.5.4 + rimraf: 3.0.2 + dev: true + + /flatted@3.2.9: + resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} + dev: true + /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -1897,6 +2155,10 @@ packages: engines: {node: '>= 0.6'} dev: false + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -1933,10 +2195,35 @@ packages: is-glob: 4.0.3 dev: true + /glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + dev: true + /glob-to-regexp@0.4.1: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} dev: false + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + 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 + dev: true + + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + /got@11.8.6: resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} engines: {node: '>=10.19.0'} @@ -1958,10 +2245,19 @@ packages: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: false + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + /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'} + dev: true + /hasown@2.0.0: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} engines: {node: '>= 0.4'} @@ -2013,13 +2309,29 @@ packages: resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==} dev: true + /ignore@5.3.0: + resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} + engines: {node: '>= 4'} + dev: true + /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 - dev: false + + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -2064,6 +2376,11 @@ packages: engines: {node: '>=0.12.0'} dev: true + /is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -2091,6 +2408,13 @@ packages: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: false + /js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} dev: true @@ -2105,16 +2429,32 @@ packages: fast-deep-equal: 3.1.3 dev: false + /json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true + /json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} dev: false + /json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true + /keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} dependencies: json-buffer: 3.0.1 dev: true + /levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + /libsql@0.1.34: resolution: {integrity: sha512-LGofp7z7gi1Td6vu2GxaA4WyvSPEkuFn0f/ePSti1TsAlBU0LWxdk+bj9D8nqswzxiqe5wpAyTLhVzTIYSyXEA==} cpu: [x64, arm64] @@ -2144,6 +2484,17 @@ packages: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: false + /locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true + /lodash.snakecase@4.1.1: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} dev: false @@ -2261,6 +2612,10 @@ packages: hasBin: true dev: false + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + /next@14.0.4(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-qbwypnM7327SadwFtxXnQdGiKpkuhaRLE2uq62/nRul9cj9KhQ5LhHmlziTNqUidZotw/Q1I9OjirBROdUJNgA==} engines: {node: '>=18.17.0'} @@ -2398,6 +2753,18 @@ packages: mimic-fn: 2.1.0 dev: true + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} + engines: {node: '>= 0.8.0'} + dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + /os-filter-obj@2.0.0: resolution: {integrity: sha512-uksVLsqG3pVdzzPvmAHpBK0wKxYItuzZr7SziusRPoz67tGV8rL1szZ6IdeUrbqLjGDwApBtN29eEE3IqGHOjg==} engines: {node: '>=4'} @@ -2415,12 +2782,25 @@ packages: engines: {node: '>=4'} dev: true + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} dependencies: callsites: 3.1.0 - dev: false /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} @@ -2432,6 +2812,16 @@ packages: lines-and-columns: 1.2.4 dev: false + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + /path-key@2.0.1: resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} engines: {node: '>=4'} @@ -2507,6 +2897,11 @@ packages: source-map-js: 1.0.2 dev: false + /prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: true + /prisma@5.8.1: resolution: {integrity: sha512-N6CpjzECnUHZ5beeYpDzkt2rYpEdAeqXX2dweu6BoQaeYkNZrC/WJHM+5MO/uidFHTak8QhkPKBWck1o/4MD4A==} engines: {node: '>=16.13'} @@ -2562,7 +2957,6 @@ packages: /punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - dev: false /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -2671,7 +3065,6 @@ packages: /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} - dev: false /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} @@ -2701,6 +3094,13 @@ packages: resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} dev: false + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -2848,6 +3248,13 @@ packages: dependencies: safe-buffer: 5.2.1 + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + /strip-eof@1.0.0: resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} engines: {node: '>=0.10.0'} @@ -2858,6 +3265,11 @@ packages: engines: {node: '>=6'} dev: true + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + /strip-outer@2.0.0: resolution: {integrity: sha512-A21Xsm1XzUkK0qK1ZrytDUvqsQWict2Cykhvi0fBQntGG5JSprESasEyV1EZ/4CiR5WB5KjzLTrP/bO37B0wPg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -2898,11 +3310,22 @@ packages: dependencies: has-flag: 3.0.0 + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} dev: false + /text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true + /thread-stream@2.4.1: resolution: {integrity: sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==} dependencies: @@ -2992,6 +3415,18 @@ packages: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: false + /type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + dev: true + + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: true + /typescript@5.3.3: resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} engines: {node: '>=14.17'} @@ -3016,7 +3451,6 @@ packages: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.1 - dev: false /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -3098,3 +3532,8 @@ packages: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} dev: true + + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true diff --git a/src/bot/commands/ai/help.ts b/src/bot/commands/ai/help.ts index 30cb285..65e329c 100644 --- a/src/bot/commands/ai/help.ts +++ b/src/bot/commands/ai/help.ts @@ -1,5 +1,4 @@ import { - ApplicationCommandOption, ApplicationCommandOptionType, CommandInteraction, EmbedBuilder, @@ -37,7 +36,7 @@ export default async function Help( return localization[0] === interaction.locale; }); if (localizedDesc) desc = localizedDesc[1]; - } catch (_) {} + } catch (_) { } return [ ` - ${desc}`, ]; @@ -52,7 +51,7 @@ export default async function Help( return localization[0] === interaction.locale; }); if (localizedDesc) desc = localizedDesc[1]; - } catch (_) {} + } catch (_) { } return [ ` - ${desc}`, ]; diff --git a/src/bot/commands/ai/imagine.ts b/src/bot/commands/ai/imagine.ts index 5814aad..890c66d 100644 --- a/src/bot/commands/ai/imagine.ts +++ b/src/bot/commands/ai/imagine.ts @@ -1,142 +1,159 @@ -import CommandsBase from "../baseCommands"; +import type CommandsBase from '../baseCommands' import { - APIActionRowComponent, - APIButtonComponent, - AttachmentPayload, + type APIActionRowComponent, + type APIButtonComponent, + type AttachmentPayload, ButtonBuilder, ButtonStyle, Colors, - CommandInteraction, + type CommandInteraction, CommandInteractionOptionResolver, EmbedBuilder, - MessageEditOptions, + type MessageEditOptions, MessageFlags, TextChannel, - codeBlock, -} from "discord.js"; + codeBlock +} from 'discord.js' import { - ImageGenerationInput, + type ImageGenerationInput, ModelGenerationInputPostProcessingTypes, - ModelGenerationInputStableSamplers, -} from "@zeldafan0225/ai_horde"; -import { bt } from "../../../main"; -import { getUser } from "../../functions/database"; + ModelGenerationInputStableSamplers +} from '@zeldafan0225/ai_horde' +import { bt } from '../../../main' +import { getUser } from '../../functions/database' export default async function Imagine( command: CommandsBase, - interaction: CommandInteraction, + interaction: CommandInteraction ) { - let userDatabase = await getUser(interaction.user.id, command.client.database); - let defaultToken = "0000000000"; + const userDatabase = await getUser(interaction.user.id, command.client.database) + let defaultToken = '0000000000' if (userDatabase && userDatabase.horde_token) { - defaultToken = command.client.decryptString(userDatabase.horde_token); + defaultToken = command.client.decryptString(userDatabase.horde_token) } - let timeout = command.client.timeouts.get(interaction.commandName); + const timeout = command.client.timeouts.get(interaction.commandName) if (!timeout) { interaction.reply({ content: bt.__({ - phrase: "An error occured, please try again later", - locale: interaction.locale, + phrase: 'An error occured, please try again later', + locale: interaction.locale }), - flags: MessageFlags.Ephemeral, - }); - return; + flags: MessageFlags.Ephemeral + }) + return } if (timeout.has(interaction.user.id)) { interaction.reply({ content: bt.__({ phrase: - "You must wait the current generation before using this command again", - locale: interaction.locale, + 'You must wait the current generation before using this command again', + locale: interaction.locale }), - flags: MessageFlags.Ephemeral, - }); - return; + flags: MessageFlags.Ephemeral + }) + return } - let ai = command.client.aiHorde; - let config = userDatabase.horde_config ? userDatabase.horde_config : null; + const ai = command.client.aiHorde + const config = userDatabase.horde_config ? userDatabase.horde_config : null // get the option value - let message = await interaction.deferReply(); - let modelMoreDemanded = await ai.getModels(); - let options = interaction.options; + const msgToSend = await interaction.reply({ + "content": bt.__({ + phrase: 'Generation started..', + locale: interaction.locale + }), + }); + const modelMoreDemanded = await ai.getModels() + const options = interaction.options if (options instanceof CommandInteractionOptionResolver) { - let image = options.getString("prompt") || ""; + const image = options.getString('prompt') || '' // the model the more demanded is the one with the most count of Workers - let model = - options.getString("model") || config?.model || + const model = + options.getString('model') || config?.model || modelMoreDemanded.sort((a, b) => { - return b.count - a.count; - })[0].name; - let negative_prompt = - options.getString("negative_prompt") || - ""; - let lorasConfig = config ? config.loras : null; + return b.count - a.count + })[0].name + const negative_prompt = + options.getString('negative_prompt') || + '' // first let's check if userDatabase is null, if it is, we set the default value to false - let nsfw = options.getBoolean("nsfw") || config?.nsfw || false; - let loras = options.getString("loras") || lorasConfig?.length > 0 ? config.loras[0].loras_id : null || null; - let loras2 = options.getString("loras_2") || lorasConfig?.length > 1 ? config.loras[1].loras_id : null || null; - let loras3 = options.getString("loras_3") || lorasConfig?.length > 2 ? config.loras[2].loras_id : null || null; - let loras4 = options.getString("loras_4") || lorasConfig?.length > 3 ? config.loras[3].loras_id : null || null; - let loras5 = options.getString("loras_5") || lorasConfig?.length > 4 ? config.loras[4].loras_id : null || null; - let preprompt = options.getBoolean("preprompt") || config?.preprompt_loras || false; + const nsfw = options.getBoolean('nsfw') || config?.nsfw || false + let lorasListFromDatabase = Array(5).fill(null).map((_, index) => { + return config?.loras[index]?.loras_id || null + }) + // we now need to check for each Loras if it's set or not, if it's not, we set it to null and if it is, we set it to the value + const loras = options.getString('loras') || + lorasListFromDatabase[0] || null + const loras2 = options.getString('loras_2') || + lorasListFromDatabase[1] || + null + const loras3 = options.getString('loras_3') || + lorasListFromDatabase[2] || + null + const loras4 = options.getString('loras_4') || + lorasListFromDatabase[3] || + null + const loras5 = options.getString('loras_5') || + lorasListFromDatabase[4] || + null + const preprompt = options.getBoolean('preprompt') || config?.preprompt_loras || false if (image) { - let textChannel = - interaction.channel instanceof TextChannel ? interaction.channel : null; - let nsfwchannel = true; + const textChannel = + interaction.channel instanceof TextChannel ? interaction.channel : null + let nsfwchannel = true if (textChannel) { - nsfwchannel = textChannel.nsfw; + nsfwchannel = textChannel.nsfw } command.client.timeouts .get(interaction.commandName) - ?.set(interaction.user.id, true); + ?.set(interaction.user.id, true) - let predefinedPrompt = config?.definedPrompt || "{p}###{ng}deformed, blurry,[bad anatomy], disfigured, poorly drawn face, [[[mutation]]], mutated, [[[extra arms]]], extra legs, ugly, horror, out of focus, depth of field, focal blur, bad quality, double body, [[double torso]], equine, bovine,[[feral]], [duo], [[canine]], creepy fingers, extra fingers, bad breasts, bad butt, split breasts, split butt, Blurry textures, blurry everything, creepy arms, bad arm anatomy, bad leg anatomy, bad finger anatomy, poor connection of the body with clothing and other things, poor quality character, poor quality body, Bad clothes quality, bad underwear, bad ears, poor eyes quality, poor quality of the background, poor facial quality, text."; - let prompt: ImageGenerationInput = { - prompt: predefinedPrompt.replace("{p}", image).replace("{ng}", negative_prompt), + const predefinedPrompt = config?.definedPrompt || '{p}###{ng}deformed, blurry,[bad anatomy], disfigured, poorly drawn face, [[[mutation]]], mutated, [[[extra arms]]], extra legs, ugly, horror, out of focus, depth of field, focal blur, bad quality, double body, [[double torso]], equine, bovine,[[feral]], [duo], [[canine]], creepy fingers, extra fingers, bad breasts, bad butt, split breasts, split butt, Blurry textures, blurry everything, creepy arms, bad arm anatomy, bad leg anatomy, bad finger anatomy, poor connection of the body with clothing and other things, poor quality character, poor quality body, Bad clothes quality, bad underwear, bad ears, poor eyes quality, poor quality of the background, poor facial quality, text.' + const prompt: ImageGenerationInput = { + prompt: predefinedPrompt.replace('{p}', image).replace('{ng}', negative_prompt), params: { - sampler_name: config?.sampler as ImageGenerationInput["params"]["sampler_name"] || ModelGenerationInputStableSamplers.k_euler, + sampler_name: config?.sampler as ImageGenerationInput['params']['sampler_name'] || ModelGenerationInputStableSamplers.k_euler, cfg_scale: config?.cfg_scale || 7, height: config?.height || 512, width: config?.width || 512, post_processing: [ - config?.upscaller as ImageGenerationInput["params"]["post_processing"][0] || ModelGenerationInputPostProcessingTypes.RealESRGAN_x4plus, + config?.upscaller as ImageGenerationInput['params']['post_processing'][0] || ModelGenerationInputPostProcessingTypes.RealESRGAN_x4plus ], clip_skip: config?.clip_skip || 3, facefixer_strength: 1, steps: config?.steps || 25, - n: config?.gen_numbers || 4, + n: config?.gen_numbers || 4 }, - censor_nsfw: nsfwchannel ? (nsfw ? false : true) : true, + censor_nsfw: nsfwchannel ? (!nsfw) : true, models: [model], - nsfw: nsfwchannel ? (nsfw ? true : false) : false, - shared: true, - }; + nsfw: nsfwchannel ? (!!nsfw) : false, + shared: true + } - let lorasList = [loras, loras2, loras3, loras4, loras5].filter((loras) => { - return loras !== null; - }); + const lorasList = [loras, loras2, loras3, loras4, loras5].filter((loras) => { + return loras !== null + }) if (lorasList.length > 0) { // if preprompt is selected, we get a random model, and a random image from this model to use as prompt if (preprompt) { try { - let lorasDatas = await command.client.getLorasModel(lorasList[0]); - let randomModelVersion = + const lorasDatas = await command.client.getLorasModel(lorasList[0]) + const randomModelVersion = lorasDatas.modelVersions[ Math.floor(Math.random() * lorasDatas.modelVersions.length) - ]; - let randomMetaImage = + ] + const randomMetaImage = randomModelVersion.images[ Math.floor(Math.random() * randomModelVersion.images.length) - ].meta; - prompt.params.steps = randomMetaImage.steps; - prompt.params.cfg_scale = randomMetaImage.cfgScale; + ].meta + prompt.params.steps = randomMetaImage.steps + prompt.params.cfg_scale = randomMetaImage.cfgScale prompt.prompt = randomMetaImage.prompt + image.substring(0, 1024) + - "### " + - randomMetaImage.negativePrompt; + '### ' + + randomMetaImage.negativePrompt } catch (e) { - console.log("Loras was not found"); + console.log('Loras was not found') } } @@ -145,42 +162,42 @@ export default async function Imagine( name: loras, model: index, clip: index + 1, - inject_trigger: "any", - }; - }); + inject_trigger: 'any' + } + }) } - if (model.toLowerCase().includes("sdxl")) { - prompt.params.hires_fix = false; + if (model.toLowerCase().includes('sdxl')) { + prompt.params.hires_fix = false } else { - prompt.params.hires_fix = true; + prompt.params.hires_fix = true } ai.postAsyncImageGenerate(prompt, { - token: defaultToken, + token: defaultToken }) .then(async (result) => { - let id = result.id as string; - let finished = 0; - let collector = await message.createMessageComponentCollector({ + const id = result.id + let finished = 0 + const collector = await msgToSend.createMessageComponentCollector({ filter: (componentInteraction) => { return ( - componentInteraction.customId === "cancel" && + componentInteraction.customId === 'cancel' && componentInteraction.user.id === interaction.user.id - ); + ) }, - max: 1, - }); - let interval: NodeJS.Timeout = setInterval(() => { + max: 1 + }) + const interval: NodeJS.Timeout = setInterval(() => { if (id) { ai.getImageGenerationCheck(id, { - force: true, + force: true }).then((stat) => { if (stat.is_possible) { if (stat.done) { - clearInterval(interval); - collector.stop("done"); + clearInterval(interval) + collector.stop('done') command.client.timeouts .get(interaction.commandName) - ?.delete(interaction.user.id); + ?.delete(interaction.user.id) ai.getImageGenerationStatus(id).then((status) => { console.log({ generations: status.generations.map((generation) => { @@ -188,121 +205,121 @@ export default async function Imagine( url: generation.img, workerName: generation.worker_name, workerId: generation.worker_id, - model: generation.model, + model: generation.model } }), prompt: JSON.stringify(prompt), - guildName: interaction.guild?.name || "DM", - }); - let generations = status.generations; + guildName: interaction.guild?.name || 'DM' + }) + const generations = status.generations if (generations && generations.length > 0) { - interaction.editReply({ - content: "", + msgToSend.edit({ + content: '', files: generations.map((generation, i) => { return { - attachment: generation.img as string, - name: "image" + i + ".webp", - }; + attachment: generation.img, + name: 'image' + i + '.webp' + } }), - components: [], - }); + components: [] + }) } - }); + }) } else { - let components: APIActionRowComponent[] = + const components: Array> = [ { type: 1, components: [ new ButtonBuilder() - .setCustomId("cancel") + .setCustomId('cancel') .setLabel( bt.__({ - phrase: "Cancel", - locale: interaction.locale, - }), + phrase: 'Cancel', + locale: interaction.locale + }) ) .setStyle(ButtonStyle.Danger) - .setEmoji("🚫") + .setEmoji('🚫') .setDisabled(false) - .toJSON(), - ], - }, - ]; + .toJSON() + ] + } + ] // attachment - let wait_time = stat.wait_time || 1; - let files: AttachmentPayload[] = []; + const wait_time = stat.wait_time || 1 + const files: AttachmentPayload[] = [] let processed = bt.__({ - phrase: "Generation started..", - locale: interaction.locale, - }) + "\n"; + phrase: 'Generation started..', + locale: interaction.locale + }) + '\n' if (stat.queue_position && stat.queue_position > 0) { processed += bt.__( { - phrase: "(Position in the queue: %s -", - locale: interaction.locale, + phrase: '(Position in the queue: %s -', + locale: interaction.locale }, - String(stat.queue_position), - ) + "\n"; + String(stat.queue_position) + ) + '\n' } if (stat.waiting && stat.waiting > 0) { processed += bt.__( { - phrase: "Waiting : %s", - locale: interaction.locale, + phrase: 'Waiting : %s', + locale: interaction.locale }, - String(stat.waiting), - ) + "\n"; + String(stat.waiting) + ) + '\n' } if (stat.finished && stat.finished > 0) { processed += bt.__( { - phrase: "Finished : %s", - locale: interaction.locale, + phrase: 'Finished : %s', + locale: interaction.locale }, - String(stat.finished), - ) + "\n"; + String(stat.finished) + ) + '\n' } if (stat.processing && stat.processing > 0) { processed += bt.__( { - phrase: "Processing : %s", - locale: interaction.locale, + phrase: 'Processing : %s', + locale: interaction.locale }, - String(stat.processing), - ) + "\n"; + String(stat.processing) + ) + '\n' processed += bt.__( { - phrase: "(Estimated waiting time: )", - locale: interaction.locale, + phrase: '(Estimated waiting time: )', + locale: interaction.locale }, String( parseInt( - ((Date.now() + wait_time * 1000) / 1000).toString(), - ), - ), - ) + "\n"; + ((Date.now() + wait_time * 1000) / 1000).toString() + ) + ) + ) + '\n' } if (stat.kudos && stat.kudos > 0) { processed += bt.__( { - phrase: "Kudos used: %s", - locale: interaction.locale, + phrase: 'Kudos used: %s', + locale: interaction.locale }, - String(stat.kudos), - ); + String(stat.kudos) + ) } - let message: MessageEditOptions = { + const message: MessageEditOptions = { content: processed, - components: components, - }; + components + } if (stat.finished && stat.finished > finished) { - finished = stat.finished; + finished = stat.finished ai.getImageGenerationStatus(id).then((status) => { if ( status.generations && @@ -310,130 +327,130 @@ export default async function Imagine( ) { status.generations.forEach((generation, i) => { files.push({ - attachment: generation.img as string, - name: "image" + i + ".webp", - }); - }); + attachment: generation.img, + name: 'image' + i + '.webp' + }) + }) } if (files.length > 0) { - message.files = files; + message.files = files } - interaction.editReply(message).catch((e) => { - clearInterval(interval); - collector.stop("cancel"); + msgToSend.edit(message).catch((e) => { + clearInterval(interval) + collector.stop('cancel') command.client.timeouts .get(interaction.commandName) - ?.delete(interaction.user.id); + ?.delete(interaction.user.id) command.client.aiHorde.deleteImageGenerationRequest( - id, - ); - }); - }); + id + ) + }) + }) } else { - interaction.editReply(message).catch((e) => { - clearInterval(interval); - collector.stop("cancel"); + msgToSend.edit(message).catch((e) => { + clearInterval(interval) + collector.stop('cancel') command.client.timeouts .get(interaction.commandName) - ?.delete(interaction.user.id); - command.client.aiHorde.deleteImageGenerationRequest(id); - }); + ?.delete(interaction.user.id) + command.client.aiHorde.deleteImageGenerationRequest(id) + }) } } } else { - clearInterval(interval); + clearInterval(interval) command.client.timeouts .get(interaction.commandName) - ?.delete(interaction.user.id); + ?.delete(interaction.user.id) interaction .editReply({ content: bt.__({ - phrase: "Request impossible, model not available", - locale: interaction.locale, + phrase: 'Request impossible, model not available', + locale: interaction.locale }), - components: [], + components: [] }) .catch((e) => { - clearInterval(interval); - collector.stop("cancel"); + clearInterval(interval) + collector.stop('cancel') command.client.timeouts .get(interaction.commandName) - ?.delete(interaction.user.id); - command.client.aiHorde.deleteImageGenerationRequest(id); - }); + ?.delete(interaction.user.id) + command.client.aiHorde.deleteImageGenerationRequest(id) + }) } - }); + }) } - }, 5000); + }, 5000) - collector.on("collect", (componentInteraction) => { - collector.stop("cancel"); - clearInterval(interval); + collector.on('collect', (componentInteraction) => { + collector.stop('cancel') + clearInterval(interval) command.client.timeouts .get(interaction.commandName) - ?.delete(interaction.user.id); + ?.delete(interaction.user.id) componentInteraction.update({ content: bt.__({ - phrase: "Request canceled", - locale: interaction.locale, + phrase: 'Request canceled', + locale: interaction.locale }), - components: [], - }); - command.client.aiHorde.deleteImageGenerationRequest(id); - }); + components: [] + }) + command.client.aiHorde.deleteImageGenerationRequest(id) + }) }) .catch((err) => { - if (command.client.application.id === "1100859965616427068") { - command.client.users.fetch("243117191774470146").then((user) => { + if (command.client.application.id === '1100859965616427068') { + command.client.users.fetch('243117191774470146').then((user) => { user.send({ embeds: [ new EmbedBuilder() .setTimestamp(new Date()) - .setDescription(codeBlock("json", JSON.stringify(err))) + .setDescription(codeBlock('json', JSON.stringify(err))) .setTitle("Erreur lors de la génération d'une image") .setColor(Colors.Red) .addFields([ { - name: "Utilisateur", - value: `${interaction.user.tag} (${interaction.user.id})`, + name: 'Utilisateur', + value: `${interaction.user.tag} (${interaction.user.id})` }, { - name: "Commande", - value: `${interaction.commandName}`, + name: 'Commande', + value: `${interaction.commandName}` }, { - name: "Options", - value: codeBlock("json", JSON.stringify(options)), - }, + name: 'Options', + value: codeBlock('json', JSON.stringify(options)) + } ]) - .toJSON(), - ], - }); - }); + .toJSON() + ] + }) + }) } command.client.timeouts .get(interaction.commandName) - ?.delete(interaction.user.id); + ?.delete(interaction.user.id) if (interaction.deferred) { - interaction.editReply({ + msgToSend.edit({ content: bt.__({ phrase: - "An error occured, content too long or too complex, or request too unethical to be processed.", - locale: interaction.locale, + 'An error occured, content too long or too complex, or request too unethical to be processed.', + locale: interaction.locale }), - components: [], - }); + components: [] + }) } else { - interaction.editReply({ + msgToSend.edit({ content: bt.__({ phrase: - "An error occured, content too long or too complex, or request too unethical to be processed.", - locale: interaction.locale, + 'An error occured, content too long or too complex, or request too unethical to be processed.', + locale: interaction.locale }), - components: [], - }); + components: [] + }) } - }); + }) } } } diff --git a/src/test/database.ts b/src/test/database.ts index 718849f..048b42f 100644 --- a/src/test/database.ts +++ b/src/test/database.ts @@ -1,124 +1,130 @@ import { PrismaClient } from "@prisma/client"; import assert from "assert"; import { createUser, getUser, removeToken } from "../bot/functions/database"; -import test, { describe } from "node:test"; +import test from "node:test"; -let database: PrismaClient = new PrismaClient(); +const database: PrismaClient = new PrismaClient(); test("Create user", async () => { - - let user = await createUser({ - id: "123", - horde_token: "123", - }, database) - - assert.strictEqual(user.id, "123"); - assert.strictEqual(user.horde_token, "123"); - assert.strictEqual(user.horde_config, null); + const user = await createUser( + { + id: "123", + horde_token: "123", + }, + database + ); + + assert.strictEqual(user.id, "123"); + assert.strictEqual(user.horde_token, "123"); + assert.strictEqual(user.horde_config, null); }); - test("Remove token", async () => { - let userToken = await removeToken("123", database) - if (userToken) { - assert.strictEqual(userToken.id, "123"); - assert.strictEqual(userToken.horde_token, null); - } - - let userDelete = await database.users.delete({ - where: { - id: "123", - }, - }) - - assert.strictEqual(userDelete.id, "123"); - assert.strictEqual(userDelete.horde_token, null); + const userToken = await removeToken("123", database); + if (userToken) { + assert.strictEqual(userToken.id, "123"); + assert.strictEqual(userToken.horde_token, null); + } + + const userDelete = await database.users.delete({ + where: { + id: "123", + }, + }); + + assert.strictEqual(userDelete.id, "123"); + assert.strictEqual(userDelete.horde_token, null); }); test("Get user", async () => { - let user = await getUser("123", database); - assert.strictEqual(user.id, "123"); - assert.strictEqual(user.horde_token, null); - assert.strictEqual(user.horde_config, null); + const user = await getUser("123", database); + assert.strictEqual(user.id, "123"); + assert.strictEqual(user.horde_token, null); + assert.strictEqual(user.horde_config, null); }); test("Get user with token", async () => { - let user = await createUser({ - id: "123", - horde_token: "123", - }, database) - assert.strictEqual(user.id, "123"); - assert.strictEqual(user.horde_token, "123"); + const user = await createUser( + { + id: "123", + horde_token: "123", + }, + database + ); + assert.strictEqual(user.id, "123"); + assert.strictEqual(user.horde_token, "123"); }); test("Remove user", async () => { - let userDelete = await database.users.delete({ - where: { - id: "123", - }, - }) - - assert.strictEqual(userDelete.id, "123"); - assert.strictEqual(userDelete.horde_token, "123"); + const userDelete = await database.users.delete({ + where: { + id: "123", + }, + }); + + assert.strictEqual(userDelete.id, "123"); + assert.strictEqual(userDelete.horde_token, "123"); }); test("Create user with a config and without a token", async () => { - let user = await createUser({ - id: "123", - horde_config: { + const user = await createUser( + { + id: "123", + horde_config: { + create: { + id: "123", + loras: { create: { - id: "123", - loras: { - create: { - loras_id: "123", - }, - }, + loras_id: "123", }, + }, }, - }, database) - assert.strictEqual(user.id, "123"); - assert.strictEqual(user.horde_token, null); - assert.strictEqual(user.horde_config.id, "123"); - assert.strictEqual(user.horde_config.loras[0].loras_id, "123"); + }, + }, + database + ); + assert.strictEqual(user.id, "123"); + assert.strictEqual(user.horde_token, null); + assert.strictEqual(user.horde_config.id, "123"); + assert.strictEqual(user.horde_config.loras[0].loras_id, "123"); }); test("Update the user with a token", async () => { - let user = await createUser({ - id: "123", - horde_token: "123", - }, database) - assert.strictEqual(user.id, "123"); - assert.strictEqual(user.horde_token, "123"); - // ensure config has not been deleted - assert.strictEqual(user.horde_config.id, "123"); - - - + const user = await createUser( + { + id: "123", + horde_token: "123", + }, + database + ); + assert.strictEqual(user.id, "123"); + assert.strictEqual(user.horde_token, "123"); + // ensure config has not been deleted + assert.strictEqual(user.horde_config.id, "123"); }); test("Delete user, config and loras", async () => { - - // all test passed, let's delete the user - let loras = await database.loras.deleteMany({ - where: { - aiHordeConfigId: "123", - }, - }); - - let config = await database.aIHordeConfig.delete({ - where: { - userId: "123", - }, - }); - - let userDelete = await database.users.delete({ - where: { - id: "123", - }, - }) - - assert.strictEqual(userDelete.id, "123"); - assert.strictEqual(userDelete.horde_token, "123"); - assert.strictEqual(config.id, "123"); - assert.strictEqual(loras.count, 1); -}); \ No newline at end of file + // all test passed, let's delete the user + const loras = await database.loras.deleteMany({ + where: { + aiHordeConfigId: "123", + }, + }); + + const config = await database.aIHordeConfig.delete({ + where: { + userId: "123", + }, + }); + + const userDelete = await database.users.delete({ + where: { + id: "123", + }, + }); + + assert.strictEqual(userDelete.id, "123"); + assert.strictEqual(userDelete.horde_token, "123"); + assert.strictEqual(config.id, "123"); + assert.strictEqual(loras.count, 1); +});