From f73aa5f9e139d6ee9a2c34bbf554a41d974eb6b9 Mon Sep 17 00:00:00 2001 From: ChenZhaoYu <790348264@qq.com> Date: Wed, 15 Feb 2023 14:10:43 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=83=A8=E4=BB=BD?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pnpm-lock.yaml | 140 ++++++++++----------- service/.env | 3 +- service/package.json | 3 +- service/pnpm-lock.yaml | 274 ++++++++++++++++++++--------------------- service/src/chatgpt.ts | 14 +-- 5 files changed, 213 insertions(+), 221 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 531b221..93d1f4c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,11 +43,11 @@ devDependencies: '@types/node': 18.13.0 '@vitejs/plugin-vue': 4.0.0_vite@4.1.1+vue@3.2.47 autoprefixer: 10.4.13_postcss@8.4.21 - axios: 1.3.2 + axios: 1.3.3 crypto-js: 4.1.1 eslint: 8.34.0 husky: 8.0.3 - lint-staged: 13.1.1 + lint-staged: 13.1.2 npm-run-all: 4.1.5 postcss: 8.4.21 rimraf: 4.1.2 @@ -58,7 +58,7 @@ devDependencies: packages: - /@antfu/eslint-config-basic/0.35.2_6ike4423xm2xnh233ikrbff5m4: + /@antfu/eslint-config-basic/0.35.2_khyrr7my4aaa3ssgqabkfgcc24: resolution: {integrity: sha512-2k7Ovkd8U/q0sgfjuT9KzAUV0q187yGxP7JzD2D4YifuJwL5Bh3JC49KpCv9PXMTeRUMJX2y/kOtGYPetocOug==} peerDependencies: eslint: '>=7.4.0' @@ -67,14 +67,14 @@ packages: eslint-plugin-antfu: 0.35.2_7kw3g6rralp5ps6mg3uyzz6azm eslint-plugin-eslint-comments: 3.2.0_eslint@8.34.0 eslint-plugin-html: 7.1.0 - eslint-plugin-import: 2.27.5_62tsymtiqxebhmxuag4hg3gx2m + eslint-plugin-import: 2.27.5_mcvs2y73sfmcxqzpjj5lr7a2m4 eslint-plugin-jsonc: 2.6.0_eslint@8.34.0 eslint-plugin-markdown: 3.0.0_eslint@8.34.0 eslint-plugin-n: 15.6.1_eslint@8.34.0 eslint-plugin-no-only-tests: 3.1.0 eslint-plugin-promise: 6.1.1_eslint@8.34.0 eslint-plugin-unicorn: 45.0.2_eslint@8.34.0 - eslint-plugin-unused-imports: 2.0.0_b5d7vn5fvb66hlq4xz6bd5gdxm + eslint-plugin-unused-imports: 2.0.0_vqeavzxdzk2atb75l6fx3anzpi eslint-plugin-yml: 1.5.0_eslint@8.34.0 jsonc-eslint-parser: 2.1.0 yaml-eslint-parser: 1.1.0 @@ -93,11 +93,11 @@ packages: eslint: '>=7.4.0' typescript: '>=3.9' dependencies: - '@antfu/eslint-config-basic': 0.35.2_6ike4423xm2xnh233ikrbff5m4 - '@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4 - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@antfu/eslint-config-basic': 0.35.2_khyrr7my4aaa3ssgqabkfgcc24 + '@typescript-eslint/eslint-plugin': 5.52.0_6cfvjsbua5ptj65675bqcn6oza + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm eslint: 8.34.0 - eslint-plugin-jest: 27.2.1_wz3lx5pragqwrk3vwpswr7bnzu + eslint-plugin-jest: 27.2.1_7hfwvekd5cgjoxqyvesymwuacm typescript: 4.9.5 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -106,12 +106,12 @@ packages: - supports-color dev: true - /@antfu/eslint-config-vue/0.35.2_6ike4423xm2xnh233ikrbff5m4: + /@antfu/eslint-config-vue/0.35.2_khyrr7my4aaa3ssgqabkfgcc24: resolution: {integrity: sha512-98k9D+n0bgr/9OqedAEOsflIWbXz4D92pejXqkUAtnRnB2Nq5dWrrFMJ59oJwTDKnEslpwANlgIXM11qdiTF0Q==} peerDependencies: eslint: '>=7.4.0' dependencies: - '@antfu/eslint-config-basic': 0.35.2_6ike4423xm2xnh233ikrbff5m4 + '@antfu/eslint-config-basic': 0.35.2_khyrr7my4aaa3ssgqabkfgcc24 '@antfu/eslint-config-ts': 0.35.2_7kw3g6rralp5ps6mg3uyzz6azm eslint: 8.34.0 eslint-plugin-vue: 9.9.0_eslint@8.34.0 @@ -131,13 +131,13 @@ packages: peerDependencies: eslint: '>=7.4.0' dependencies: - '@antfu/eslint-config-vue': 0.35.2_6ike4423xm2xnh233ikrbff5m4 - '@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4 - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@antfu/eslint-config-vue': 0.35.2_khyrr7my4aaa3ssgqabkfgcc24 + '@typescript-eslint/eslint-plugin': 5.52.0_6cfvjsbua5ptj65675bqcn6oza + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm eslint: 8.34.0 eslint-plugin-eslint-comments: 3.2.0_eslint@8.34.0 eslint-plugin-html: 7.1.0 - eslint-plugin-import: 2.27.5_62tsymtiqxebhmxuag4hg3gx2m + eslint-plugin-import: 2.27.5_mcvs2y73sfmcxqzpjj5lr7a2m4 eslint-plugin-jsonc: 2.6.0_eslint@8.34.0 eslint-plugin-n: 15.6.1_eslint@8.34.0 eslint-plugin-promise: 6.1.1_eslint@8.34.0 @@ -755,8 +755,8 @@ packages: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: true - /@typescript-eslint/eslint-plugin/5.51.0_z4swst3wuuqk4hlme4ajzslgh4: - resolution: {integrity: sha512-wcAwhEWm1RgNd7dxD/o+nnLW8oH+6RK1OGnmbmkj/GGoDPV1WWMVP0FXYQBivKHdwM1pwii3bt//RC62EriIUQ==} + /@typescript-eslint/eslint-plugin/5.52.0_6cfvjsbua5ptj65675bqcn6oza: + resolution: {integrity: sha512-lHazYdvYVsBokwCdKOppvYJKaJ4S41CgKBcPvyd0xjZNbvQdhn/pnJlGtQksQ/NhInzdaeaSarlBjDXHuclEbg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -766,10 +766,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm - '@typescript-eslint/scope-manager': 5.51.0 - '@typescript-eslint/type-utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm - '@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/scope-manager': 5.52.0 + '@typescript-eslint/type-utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm debug: 4.3.4 eslint: 8.34.0 grapheme-splitter: 1.0.4 @@ -783,8 +783,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm: - resolution: {integrity: sha512-fEV0R9gGmfpDeRzJXn+fGQKcl0inIeYobmmUWijZh9zA7bxJ8clPhV9up2ZQzATxAiFAECqPQyMDB4o4B81AaA==} + /@typescript-eslint/parser/5.52.0_7kw3g6rralp5ps6mg3uyzz6azm: + resolution: {integrity: sha512-e2KiLQOZRo4Y0D/b+3y08i3jsekoSkOYStROYmPUnGMEoA0h+k2qOH5H6tcjIc68WDvGwH+PaOrP1XRzLJ6QlA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -793,9 +793,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.51.0 - '@typescript-eslint/types': 5.51.0 - '@typescript-eslint/typescript-estree': 5.51.0_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.52.0 + '@typescript-eslint/types': 5.52.0 + '@typescript-eslint/typescript-estree': 5.52.0_typescript@4.9.5 debug: 4.3.4 eslint: 8.34.0 typescript: 4.9.5 @@ -803,16 +803,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.51.0: - resolution: {integrity: sha512-gNpxRdlx5qw3yaHA0SFuTjW4rxeYhpHxt491PEcKF8Z6zpq0kMhe0Tolxt0qjlojS+/wArSDlj/LtE69xUJphQ==} + /@typescript-eslint/scope-manager/5.52.0: + resolution: {integrity: sha512-AR7sxxfBKiNV0FWBSARxM8DmNxrwgnYMPwmpkC1Pl1n+eT8/I2NAUPuwDy/FmDcC6F8pBfmOcaxcxRHspgOBMw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.51.0 - '@typescript-eslint/visitor-keys': 5.51.0 + '@typescript-eslint/types': 5.52.0 + '@typescript-eslint/visitor-keys': 5.52.0 dev: true - /@typescript-eslint/type-utils/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm: - resolution: {integrity: sha512-QHC5KKyfV8sNSyHqfNa0UbTbJ6caB8uhcx2hYcWVvJAZYJRBo5HyyZfzMdRx8nvS+GyMg56fugMzzWnojREuQQ==} + /@typescript-eslint/type-utils/5.52.0_7kw3g6rralp5ps6mg3uyzz6azm: + resolution: {integrity: sha512-tEKuUHfDOv852QGlpPtB3lHOoig5pyFQN/cUiZtpw99D93nEBjexRLre5sQZlkMoHry/lZr8qDAt2oAHLKA6Jw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -821,8 +821,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.51.0_typescript@4.9.5 - '@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/typescript-estree': 5.52.0_typescript@4.9.5 + '@typescript-eslint/utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm debug: 4.3.4 eslint: 8.34.0 tsutils: 3.21.0_typescript@4.9.5 @@ -831,13 +831,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types/5.51.0: - resolution: {integrity: sha512-SqOn0ANn/v6hFn0kjvLwiDi4AzR++CBZz0NV5AnusT2/3y32jdc0G4woXPWHCumWtUXZKPAS27/9vziSsC9jnw==} + /@typescript-eslint/types/5.52.0: + resolution: {integrity: sha512-oV7XU4CHYfBhk78fS7tkum+/Dpgsfi91IIDy7fjCyq2k6KB63M6gMC0YIvy+iABzmXThCRI6xpCEyVObBdWSDQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.51.0_typescript@4.9.5: - resolution: {integrity: sha512-TSkNupHvNRkoH9FMA3w7TazVFcBPveAAmb7Sz+kArY6sLT86PA5Vx80cKlYmd8m3Ha2SwofM1KwraF24lM9FvA==} + /@typescript-eslint/typescript-estree/5.52.0_typescript@4.9.5: + resolution: {integrity: sha512-WeWnjanyEwt6+fVrSR0MYgEpUAuROxuAH516WPjUblIrClzYJj0kBbjdnbQXLpgAN8qbEuGywiQsXUVDiAoEuQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -845,8 +845,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.51.0 - '@typescript-eslint/visitor-keys': 5.51.0 + '@typescript-eslint/types': 5.52.0 + '@typescript-eslint/visitor-keys': 5.52.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -857,17 +857,17 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm: - resolution: {integrity: sha512-76qs+5KWcaatmwtwsDJvBk4H76RJQBFe+Gext0EfJdC3Vd2kpY2Pf//OHHzHp84Ciw0/rYoGTDnIAr3uWhhJYw==} + /@typescript-eslint/utils/5.52.0_7kw3g6rralp5ps6mg3uyzz6azm: + resolution: {integrity: sha512-As3lChhrbwWQLNk2HC8Ree96hldKIqk98EYvypd3It8Q1f8d5zWyIoaZEp2va5667M4ZyE7X8UUR+azXrFl+NA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 - '@typescript-eslint/scope-manager': 5.51.0 - '@typescript-eslint/types': 5.51.0 - '@typescript-eslint/typescript-estree': 5.51.0_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.52.0 + '@typescript-eslint/types': 5.52.0 + '@typescript-eslint/typescript-estree': 5.52.0_typescript@4.9.5 eslint: 8.34.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.34.0 @@ -877,11 +877,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys/5.51.0: - resolution: {integrity: sha512-Oh2+eTdjHjOFjKA27sxESlA87YPSOJafGCR0md5oeMdh1ZcCfAGCIOL216uTBAkAIptvLIfKQhl7lHxMJet4GQ==} + /@typescript-eslint/visitor-keys/5.52.0: + resolution: {integrity: sha512-qMwpw6SU5VHCPr99y274xhbm+PRViK/NATY6qzt+Et7+mThGuFSl/ompj2/hrBlRP/kq+BFdgagnOSgw9TB0eA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.51.0 + '@typescript-eslint/types': 5.52.0 eslint-visitor-keys: 3.3.0 dev: true @@ -1206,7 +1206,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.21.5 - caniuse-lite: 1.0.30001451 + caniuse-lite: 1.0.30001452 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -1219,8 +1219,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /axios/1.3.2: - resolution: {integrity: sha512-1M3O703bYqYuPhbHeya5bnhpYVsDDRyQSabNja04mZtboLNSuZ4YrltestrLXfHgmzua4TpUqRiVKbiQuo2epw==} + /axios/1.3.3: + resolution: {integrity: sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA==} dependencies: follow-redirects: 1.15.2 form-data: 4.0.0 @@ -1267,8 +1267,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001451 - electron-to-chromium: 1.4.295 + caniuse-lite: 1.0.30001452 + electron-to-chromium: 1.4.296 node-releases: 2.0.10 update-browserslist-db: 1.0.10_browserslist@4.21.5 dev: true @@ -1315,8 +1315,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite/1.0.30001451: - resolution: {integrity: sha512-XY7UbUpGRatZzoRft//5xOa69/1iGJRBlrieH6QYrkKLIFn3m7OVEJ81dSrKoy2BnKsdbX5cLrOispZNYo9v2w==} + /caniuse-lite/1.0.30001452: + resolution: {integrity: sha512-Lkp0vFjMkBB3GTpLR8zk4NwW5EdRdnitwYJHDOOKIU85x4ckYCPQ+9WlVvSVClHxVReefkUMtWZH2l9KGlD51w==} dev: true /chalk/2.4.2: @@ -1724,8 +1724,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium/1.4.295: - resolution: {integrity: sha512-lEO94zqf1bDA3aepxwnWoHUjA8sZ+2owgcSZjYQy0+uOSEclJX0VieZC+r+wLpSxUHRd6gG32znTWmr+5iGzFw==} + /electron-to-chromium/1.4.296: + resolution: {integrity: sha512-i/6Q+Y9bluDa2a0NbMvdtG5TuS/1Fr3TKK8L+7UUL9QjRS5iFJzCC3r70xjyOnLiYG8qGV4/mMpe6HuAbdJW4w==} dev: true /emoji-regex/8.0.0: @@ -1865,7 +1865,7 @@ packages: - supports-color dev: true - /eslint-module-utils/2.7.4_ithmlgmaospkvl4p7n7pyp3rgq: + /eslint-module-utils/2.7.4_npjqex3ey3rgd34fjcuucz7la4: resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: @@ -1886,7 +1886,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm debug: 3.2.7 eslint: 8.34.0 eslint-import-resolver-node: 0.3.7 @@ -1897,7 +1897,7 @@ packages: /eslint-plugin-antfu/0.35.2_7kw3g6rralp5ps6mg3uyzz6azm: resolution: {integrity: sha512-Q6FOcOakafU49PDRlq7jkrWmlTJ4u3AW7aGX+FqeQNaMgjXq0RzPGvS0Vyp7q/XDRLLoe0BjbGkamTeZXg8waw==} dependencies: - '@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm transitivePeerDependencies: - eslint - supports-color @@ -1932,7 +1932,7 @@ packages: htmlparser2: 8.0.1 dev: true - /eslint-plugin-import/2.27.5_62tsymtiqxebhmxuag4hg3gx2m: + /eslint-plugin-import/2.27.5_mcvs2y73sfmcxqzpjj5lr7a2m4: resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -1942,7 +1942,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 @@ -1950,7 +1950,7 @@ packages: doctrine: 2.1.0 eslint: 8.34.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4_ithmlgmaospkvl4p7n7pyp3rgq + eslint-module-utils: 2.7.4_npjqex3ey3rgd34fjcuucz7la4 has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -1965,7 +1965,7 @@ packages: - supports-color dev: true - /eslint-plugin-jest/27.2.1_wz3lx5pragqwrk3vwpswr7bnzu: + /eslint-plugin-jest/27.2.1_7hfwvekd5cgjoxqyvesymwuacm: resolution: {integrity: sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -1978,8 +1978,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4 - '@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/eslint-plugin': 5.52.0_6cfvjsbua5ptj65675bqcn6oza + '@typescript-eslint/utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm eslint: 8.34.0 transitivePeerDependencies: - supports-color @@ -2066,7 +2066,7 @@ packages: strip-indent: 3.0.0 dev: true - /eslint-plugin-unused-imports/2.0.0_b5d7vn5fvb66hlq4xz6bd5gdxm: + /eslint-plugin-unused-imports/2.0.0_vqeavzxdzk2atb75l6fx3anzpi: resolution: {integrity: sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2076,7 +2076,7 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4 + '@typescript-eslint/eslint-plugin': 5.52.0_6cfvjsbua5ptj65675bqcn6oza eslint: 8.34.0 eslint-rule-composer: 0.3.0 dev: true @@ -2976,8 +2976,8 @@ packages: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /lint-staged/13.1.1: - resolution: {integrity: sha512-LLJLO0Kdbcv2a+CvSF4p1M7jBZOajKSMpBUvyR8+bXccsqPER0/NxTFQSpNHjqwV9kM3tkHczYerTB5wI+bksQ==} + /lint-staged/13.1.2: + resolution: {integrity: sha512-K9b4FPbWkpnupvK3WXZLbgu9pchUJ6N7TtVZjbaPsoizkqFUDkUReUL25xdrCljJs7uLUF3tZ7nVPeo/6lp+6w==} engines: {node: ^14.13.1 || >=16.0.0} hasBin: true dependencies: diff --git a/service/.env b/service/.env index e3b0692..1c3f2e6 100644 --- a/service/.env +++ b/service/.env @@ -1,3 +1,2 @@ # OpenAI API Key - https://platform.openai.com/overview -# e.g: This key is invalid -OPENAI_API_KEY='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' +OPENAI_API_KEY= diff --git a/service/package.json b/service/package.json index bd4608e..c4f367c 100644 --- a/service/package.json +++ b/service/package.json @@ -19,7 +19,8 @@ "build": "pnpm clean && tsup", "clean": "rimraf build", "lint": "eslint .", - "lint:fix": "eslint . --fix" + "lint:fix": "eslint . --fix", + "common:cleanup": "rimraf node_modules && rimraf pnpm-lock.yaml" }, "dependencies": { "chatgpt": "^4.3.2", diff --git a/service/pnpm-lock.yaml b/service/pnpm-lock.yaml index bef1c27..80994a2 100644 --- a/service/pnpm-lock.yaml +++ b/service/pnpm-lock.yaml @@ -15,7 +15,7 @@ specifiers: typescript: ^4.9.5 dependencies: - chatgpt: 4.3.2 + chatgpt: 4.4.0 express: 4.18.2 isomorphic-fetch: 3.0.0 @@ -27,12 +27,12 @@ devDependencies: eslint: 8.34.0 esno: 0.16.3 rimraf: 4.1.2 - tsup: 6.6.2_typescript@4.9.5 + tsup: 6.6.3_typescript@4.9.5 typescript: 4.9.5 packages: - /@antfu/eslint-config-basic/0.35.2_6ike4423xm2xnh233ikrbff5m4: + /@antfu/eslint-config-basic/0.35.2_khyrr7my4aaa3ssgqabkfgcc24: resolution: {integrity: sha512-2k7Ovkd8U/q0sgfjuT9KzAUV0q187yGxP7JzD2D4YifuJwL5Bh3JC49KpCv9PXMTeRUMJX2y/kOtGYPetocOug==} peerDependencies: eslint: '>=7.4.0' @@ -41,14 +41,14 @@ packages: eslint-plugin-antfu: 0.35.2_7kw3g6rralp5ps6mg3uyzz6azm eslint-plugin-eslint-comments: 3.2.0_eslint@8.34.0 eslint-plugin-html: 7.1.0 - eslint-plugin-import: 2.27.5_62tsymtiqxebhmxuag4hg3gx2m + eslint-plugin-import: 2.27.5_mcvs2y73sfmcxqzpjj5lr7a2m4 eslint-plugin-jsonc: 2.6.0_eslint@8.34.0 eslint-plugin-markdown: 3.0.0_eslint@8.34.0 eslint-plugin-n: 15.6.1_eslint@8.34.0 eslint-plugin-no-only-tests: 3.1.0 eslint-plugin-promise: 6.1.1_eslint@8.34.0 eslint-plugin-unicorn: 45.0.2_eslint@8.34.0 - eslint-plugin-unused-imports: 2.0.0_b5d7vn5fvb66hlq4xz6bd5gdxm + eslint-plugin-unused-imports: 2.0.0_vqeavzxdzk2atb75l6fx3anzpi eslint-plugin-yml: 1.5.0_eslint@8.34.0 jsonc-eslint-parser: 2.1.0 yaml-eslint-parser: 1.1.0 @@ -67,11 +67,11 @@ packages: eslint: '>=7.4.0' typescript: '>=3.9' dependencies: - '@antfu/eslint-config-basic': 0.35.2_6ike4423xm2xnh233ikrbff5m4 - '@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4 - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@antfu/eslint-config-basic': 0.35.2_khyrr7my4aaa3ssgqabkfgcc24 + '@typescript-eslint/eslint-plugin': 5.52.0_6cfvjsbua5ptj65675bqcn6oza + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm eslint: 8.34.0 - eslint-plugin-jest: 27.2.1_wz3lx5pragqwrk3vwpswr7bnzu + eslint-plugin-jest: 27.2.1_7hfwvekd5cgjoxqyvesymwuacm typescript: 4.9.5 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -80,12 +80,12 @@ packages: - supports-color dev: true - /@antfu/eslint-config-vue/0.35.2_6ike4423xm2xnh233ikrbff5m4: + /@antfu/eslint-config-vue/0.35.2_khyrr7my4aaa3ssgqabkfgcc24: resolution: {integrity: sha512-98k9D+n0bgr/9OqedAEOsflIWbXz4D92pejXqkUAtnRnB2Nq5dWrrFMJ59oJwTDKnEslpwANlgIXM11qdiTF0Q==} peerDependencies: eslint: '>=7.4.0' dependencies: - '@antfu/eslint-config-basic': 0.35.2_6ike4423xm2xnh233ikrbff5m4 + '@antfu/eslint-config-basic': 0.35.2_khyrr7my4aaa3ssgqabkfgcc24 '@antfu/eslint-config-ts': 0.35.2_7kw3g6rralp5ps6mg3uyzz6azm eslint: 8.34.0 eslint-plugin-vue: 9.9.0_eslint@8.34.0 @@ -105,13 +105,13 @@ packages: peerDependencies: eslint: '>=7.4.0' dependencies: - '@antfu/eslint-config-vue': 0.35.2_6ike4423xm2xnh233ikrbff5m4 - '@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4 - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@antfu/eslint-config-vue': 0.35.2_khyrr7my4aaa3ssgqabkfgcc24 + '@typescript-eslint/eslint-plugin': 5.52.0_6cfvjsbua5ptj65675bqcn6oza + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm eslint: 8.34.0 eslint-plugin-eslint-comments: 3.2.0_eslint@8.34.0 eslint-plugin-html: 7.1.0 - eslint-plugin-import: 2.27.5_62tsymtiqxebhmxuag4hg3gx2m + eslint-plugin-import: 2.27.5_mcvs2y73sfmcxqzpjj5lr7a2m4 eslint-plugin-jsonc: 2.6.0_eslint@8.34.0 eslint-plugin-n: 15.6.1_eslint@8.34.0 eslint-plugin-promise: 6.1.1_eslint@8.34.0 @@ -159,7 +159,7 @@ packages: /@esbuild-kit/core-utils/3.1.0: resolution: {integrity: sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==} dependencies: - esbuild: 0.17.7 + esbuild: 0.17.8 source-map-support: 0.5.21 dev: true @@ -170,8 +170,8 @@ packages: get-tsconfig: 4.4.0 dev: true - /@esbuild/android-arm/0.17.7: - resolution: {integrity: sha512-Np6Lg8VUiuzHP5XvHU7zfSVPN4ILdiOhxA1GQ1uvCK2T2l3nI8igQV0c9FJx4hTkq8WGqhGEvn5UuRH8jMkExg==} + /@esbuild/android-arm/0.17.8: + resolution: {integrity: sha512-0/rb91GYKhrtbeglJXOhAv9RuYimgI8h623TplY2X+vA4EXnk3Zj1fXZreJ0J3OJJu1bwmb0W7g+2cT/d8/l/w==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -179,8 +179,8 @@ packages: dev: true optional: true - /@esbuild/android-arm64/0.17.7: - resolution: {integrity: sha512-fOUBZvcbtbQJIj2K/LMKcjULGfXLV9R4qjXFsi3UuqFhIRJHz0Fp6kFjsMFI6vLuPrfC5G9Dmh+3RZOrSKY2Lg==} + /@esbuild/android-arm64/0.17.8: + resolution: {integrity: sha512-oa/N5j6v1svZQs7EIRPqR8f+Bf8g6HBDjD/xHC02radE/NjKHK7oQmtmLxPs1iVwYyvE+Kolo6lbpfEQ9xnhxQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -188,8 +188,8 @@ packages: dev: true optional: true - /@esbuild/android-x64/0.17.7: - resolution: {integrity: sha512-6YILpPvop1rPAvaO/n2iWQL45RyTVTR/1SK7P6Xi2fyu+hpEeX22fE2U2oJd1sfpovUJOWTRdugjddX6QCup3A==} + /@esbuild/android-x64/0.17.8: + resolution: {integrity: sha512-bTliMLqD7pTOoPg4zZkXqCDuzIUguEWLpeqkNfC41ODBHwoUgZ2w5JBeYimv4oP6TDVocoYmEhZrCLQTrH89bg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -197,8 +197,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64/0.17.7: - resolution: {integrity: sha512-7i0gfFsDt1BBiurZz5oZIpzfxqy5QkJmhXdtrf2Hma/gI9vL2AqxHhRBoI1NeWc9IhN1qOzWZrslhiXZweMSFg==} + /@esbuild/darwin-arm64/0.17.8: + resolution: {integrity: sha512-ghAbV3ia2zybEefXRRm7+lx8J/rnupZT0gp9CaGy/3iolEXkJ6LYRq4IpQVI9zR97ID80KJVoUlo3LSeA/sMAg==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -206,8 +206,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64/0.17.7: - resolution: {integrity: sha512-hRvIu3vuVIcv4SJXEKOHVsNssM5tLE2xWdb9ZyJqsgYp+onRa5El3VJ4+WjTbkf/A2FD5wuMIbO2FCTV39LE0w==} + /@esbuild/darwin-x64/0.17.8: + resolution: {integrity: sha512-n5WOpyvZ9TIdv2V1K3/iIkkJeKmUpKaCTdun9buhGRWfH//osmUjlv4Z5mmWdPWind/VGcVxTHtLfLCOohsOXw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -215,8 +215,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64/0.17.7: - resolution: {integrity: sha512-2NJjeQ9kiabJkVXLM3sHkySqkL1KY8BeyLams3ITyiLW10IwDL0msU5Lq1cULCn9zNxt1Seh1I6QrqyHUvOtQw==} + /@esbuild/freebsd-arm64/0.17.8: + resolution: {integrity: sha512-a/SATTaOhPIPFWvHZDoZYgxaZRVHn0/LX1fHLGfZ6C13JqFUZ3K6SMD6/HCtwOQ8HnsNaEeokdiDSFLuizqv5A==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -224,8 +224,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64/0.17.7: - resolution: {integrity: sha512-8kSxlbjuLYMoIgvRxPybirHJeW45dflyIgHVs+jzMYJf87QOay1ZUTzKjNL3vqHQjmkSn8p6KDfHVrztn7Rprw==} + /@esbuild/freebsd-x64/0.17.8: + resolution: {integrity: sha512-xpFJb08dfXr5+rZc4E+ooZmayBW6R3q59daCpKZ/cDU96/kvDM+vkYzNeTJCGd8rtO6fHWMq5Rcv/1cY6p6/0Q==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -233,8 +233,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm/0.17.7: - resolution: {integrity: sha512-07RsAAzznWqdfJC+h3L2UVWwnUHepsFw5GmzySnUspHHb7glJ1+47rvlcH0SeUtoVOs8hF4/THgZbtJRyALaJA==} + /@esbuild/linux-arm/0.17.8: + resolution: {integrity: sha512-6Ij8gfuGszcEwZpi5jQIJCVIACLS8Tz2chnEBfYjlmMzVsfqBP1iGmHQPp7JSnZg5xxK9tjCc+pJ2WtAmPRFVA==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -242,8 +242,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64/0.17.7: - resolution: {integrity: sha512-43Bbhq3Ia/mGFTCRA4NlY8VRH3dLQltJ4cqzhSfq+cdvdm9nKJXVh4NUkJvdZgEZIkf/ufeMmJ0/22v9btXTcw==} + /@esbuild/linux-arm64/0.17.8: + resolution: {integrity: sha512-v3iwDQuDljLTxpsqQDl3fl/yihjPAyOguxuloON9kFHYwopeJEf1BkDXODzYyXEI19gisEsQlG1bM65YqKSIww==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -251,8 +251,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32/0.17.7: - resolution: {integrity: sha512-ViYkfcfnbwOoTS7xE4DvYFv7QOlW8kPBuccc4erJ0jx2mXDPR7e0lYOH9JelotS9qe8uJ0s2i3UjUvjunEp53A==} + /@esbuild/linux-ia32/0.17.8: + resolution: {integrity: sha512-8svILYKhE5XetuFk/B6raFYIyIqydQi+GngEXJgdPdI7OMKUbSd7uzR02wSY4kb53xBrClLkhH4Xs8P61Q2BaA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -260,8 +260,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64/0.17.7: - resolution: {integrity: sha512-H1g+AwwcqYQ/Hl/sMcopRcNLY/fysIb/ksDfCa3/kOaHQNhBrLeDYw+88VAFV5U6oJL9GqnmUj72m9Nv3th3hA==} + /@esbuild/linux-loong64/0.17.8: + resolution: {integrity: sha512-B6FyMeRJeV0NpyEOYlm5qtQfxbdlgmiGdD+QsipzKfFky0K5HW5Td6dyK3L3ypu1eY4kOmo7wW0o94SBqlqBSA==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -269,8 +269,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el/0.17.7: - resolution: {integrity: sha512-MDLGrVbTGYtmldlbcxfeDPdhxttUmWoX3ovk9u6jc8iM+ueBAFlaXKuUMCoyP/zfOJb+KElB61eSdBPSvNcCEg==} + /@esbuild/linux-mips64el/0.17.8: + resolution: {integrity: sha512-CCb67RKahNobjm/eeEqeD/oJfJlrWyw29fgiyB6vcgyq97YAf3gCOuP6qMShYSPXgnlZe/i4a8WFHBw6N8bYAA==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -278,8 +278,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64/0.17.7: - resolution: {integrity: sha512-UWtLhRPKzI+v2bKk4j9rBpGyXbLAXLCOeqt1tLVAt1mfagHpFjUzzIHCpPiUfY3x1xY5e45/+BWzGpqqvSglNw==} + /@esbuild/linux-ppc64/0.17.8: + resolution: {integrity: sha512-bytLJOi55y55+mGSdgwZ5qBm0K9WOCh0rx+vavVPx+gqLLhxtSFU0XbeYy/dsAAD6xECGEv4IQeFILaSS2auXw==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -287,8 +287,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64/0.17.7: - resolution: {integrity: sha512-3C/RTKqZauUwBYtIQAv7ELTJd+H2dNKPyzwE2ZTbz2RNrNhNHRoeKnG5C++eM6nSZWUCLyyaWfq1v1YRwBS/+A==} + /@esbuild/linux-riscv64/0.17.8: + resolution: {integrity: sha512-2YpRyQJmKVBEHSBLa8kBAtbhucaclb6ex4wchfY0Tj3Kg39kpjeJ9vhRU7x4mUpq8ISLXRXH1L0dBYjAeqzZAw==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -296,8 +296,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x/0.17.7: - resolution: {integrity: sha512-x7cuRSCm998KFZqGEtSo8rI5hXLxWji4znZkBhg2FPF8A8lxLLCsSXe2P5utf0RBQflb3K97dkEH/BJwTqrbDw==} + /@esbuild/linux-s390x/0.17.8: + resolution: {integrity: sha512-QgbNY/V3IFXvNf11SS6exkpVcX0LJcob+0RWCgV9OiDAmVElnxciHIisoSix9uzYzScPmS6dJFbZULdSAEkQVw==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -305,8 +305,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64/0.17.7: - resolution: {integrity: sha512-1Z2BtWgM0Wc92WWiZR5kZ5eC+IetI++X+nf9NMbUvVymt74fnQqwgM5btlTW7P5uCHfq03u5MWHjIZa4o+TnXQ==} + /@esbuild/linux-x64/0.17.8: + resolution: {integrity: sha512-mM/9S0SbAFDBc4OPoyP6SEOo5324LpUxdpeIUUSrSTOfhHU9hEfqRngmKgqILqwx/0DVJBzeNW7HmLEWp9vcOA==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -314,8 +314,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64/0.17.7: - resolution: {integrity: sha512-//VShPN4hgbmkDjYNCZermIhj8ORqoPNmAnwSPqPtBB0xOpHrXMlJhsqLNsgoBm0zi/5tmy//WyL6g81Uq2c6Q==} + /@esbuild/netbsd-x64/0.17.8: + resolution: {integrity: sha512-eKUYcWaWTaYr9zbj8GertdVtlt1DTS1gNBWov+iQfWuWyuu59YN6gSEJvFzC5ESJ4kMcKR0uqWThKUn5o8We6Q==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -323,8 +323,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64/0.17.7: - resolution: {integrity: sha512-IQ8BliXHiOsbQEOHzc7mVLIw2UYPpbOXJQ9cK1nClNYQjZthvfiA6rWZMz4BZpVzHZJ+/H2H23cZwRJ1NPYOGg==} + /@esbuild/openbsd-x64/0.17.8: + resolution: {integrity: sha512-Vc9J4dXOboDyMXKD0eCeW0SIeEzr8K9oTHJU+Ci1mZc5njPfhKAqkRt3B/fUNU7dP+mRyralPu8QUkiaQn7iIg==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -332,8 +332,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64/0.17.7: - resolution: {integrity: sha512-phO5HvU3SyURmcW6dfQXX4UEkFREUwaoiTgi1xH+CAFKPGsrcG6oDp1U70yQf5lxRKujoSCEIoBr0uFykJzN2g==} + /@esbuild/sunos-x64/0.17.8: + resolution: {integrity: sha512-0xvOTNuPXI7ft1LYUgiaXtpCEjp90RuBBYovdd2lqAFxje4sEucurg30M1WIm03+3jxByd3mfo+VUmPtRSVuOw==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -341,8 +341,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64/0.17.7: - resolution: {integrity: sha512-G/cRKlYrwp1B0uvzEdnFPJ3A6zSWjnsRrWivsEW0IEHZk+czv0Bmiwa51RncruHLjQ4fGsvlYPmCmwzmutPzHA==} + /@esbuild/win32-arm64/0.17.8: + resolution: {integrity: sha512-G0JQwUI5WdEFEnYNKzklxtBheCPkuDdu1YrtRrjuQv30WsYbkkoixKxLLv8qhJmNI+ATEWquZe/N0d0rpr55Mg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -350,8 +350,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32/0.17.7: - resolution: {integrity: sha512-/yMNVlMew07NrOflJdRAZcMdUoYTOCPbCHx0eHtg55l87wXeuhvYOPBQy5HLX31Ku+W2XsBD5HnjUjEUsTXJug==} + /@esbuild/win32-ia32/0.17.8: + resolution: {integrity: sha512-Fqy63515xl20OHGFykjJsMnoIWS+38fqfg88ClvPXyDbLtgXal2DTlhb1TfTX34qWi3u4I7Cq563QcHpqgLx8w==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -359,8 +359,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64/0.17.7: - resolution: {integrity: sha512-K9/YybM6WZO71x73Iyab6mwieHtHjm9hrPR/a9FBPZmFO3w+fJaM2uu2rt3JYf/rZR24MFwTliI8VSoKKOtYtg==} + /@esbuild/win32-x64/0.17.8: + resolution: {integrity: sha512-1iuezdyDNngPnz8rLRDO2C/ZZ/emJLb72OsZeqQ6gL6Avko/XCXZw+NuxBSNhBAP13Hie418V7VMt9et1FMvpg==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -515,8 +515,8 @@ packages: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: true - /@typescript-eslint/eslint-plugin/5.51.0_z4swst3wuuqk4hlme4ajzslgh4: - resolution: {integrity: sha512-wcAwhEWm1RgNd7dxD/o+nnLW8oH+6RK1OGnmbmkj/GGoDPV1WWMVP0FXYQBivKHdwM1pwii3bt//RC62EriIUQ==} + /@typescript-eslint/eslint-plugin/5.52.0_6cfvjsbua5ptj65675bqcn6oza: + resolution: {integrity: sha512-lHazYdvYVsBokwCdKOppvYJKaJ4S41CgKBcPvyd0xjZNbvQdhn/pnJlGtQksQ/NhInzdaeaSarlBjDXHuclEbg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -526,10 +526,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm - '@typescript-eslint/scope-manager': 5.51.0 - '@typescript-eslint/type-utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm - '@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/scope-manager': 5.52.0 + '@typescript-eslint/type-utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm debug: 4.3.4 eslint: 8.34.0 grapheme-splitter: 1.0.4 @@ -543,8 +543,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm: - resolution: {integrity: sha512-fEV0R9gGmfpDeRzJXn+fGQKcl0inIeYobmmUWijZh9zA7bxJ8clPhV9up2ZQzATxAiFAECqPQyMDB4o4B81AaA==} + /@typescript-eslint/parser/5.52.0_7kw3g6rralp5ps6mg3uyzz6azm: + resolution: {integrity: sha512-e2KiLQOZRo4Y0D/b+3y08i3jsekoSkOYStROYmPUnGMEoA0h+k2qOH5H6tcjIc68WDvGwH+PaOrP1XRzLJ6QlA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -553,9 +553,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.51.0 - '@typescript-eslint/types': 5.51.0 - '@typescript-eslint/typescript-estree': 5.51.0_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.52.0 + '@typescript-eslint/types': 5.52.0 + '@typescript-eslint/typescript-estree': 5.52.0_typescript@4.9.5 debug: 4.3.4 eslint: 8.34.0 typescript: 4.9.5 @@ -563,16 +563,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.51.0: - resolution: {integrity: sha512-gNpxRdlx5qw3yaHA0SFuTjW4rxeYhpHxt491PEcKF8Z6zpq0kMhe0Tolxt0qjlojS+/wArSDlj/LtE69xUJphQ==} + /@typescript-eslint/scope-manager/5.52.0: + resolution: {integrity: sha512-AR7sxxfBKiNV0FWBSARxM8DmNxrwgnYMPwmpkC1Pl1n+eT8/I2NAUPuwDy/FmDcC6F8pBfmOcaxcxRHspgOBMw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.51.0 - '@typescript-eslint/visitor-keys': 5.51.0 + '@typescript-eslint/types': 5.52.0 + '@typescript-eslint/visitor-keys': 5.52.0 dev: true - /@typescript-eslint/type-utils/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm: - resolution: {integrity: sha512-QHC5KKyfV8sNSyHqfNa0UbTbJ6caB8uhcx2hYcWVvJAZYJRBo5HyyZfzMdRx8nvS+GyMg56fugMzzWnojREuQQ==} + /@typescript-eslint/type-utils/5.52.0_7kw3g6rralp5ps6mg3uyzz6azm: + resolution: {integrity: sha512-tEKuUHfDOv852QGlpPtB3lHOoig5pyFQN/cUiZtpw99D93nEBjexRLre5sQZlkMoHry/lZr8qDAt2oAHLKA6Jw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -581,8 +581,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.51.0_typescript@4.9.5 - '@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/typescript-estree': 5.52.0_typescript@4.9.5 + '@typescript-eslint/utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm debug: 4.3.4 eslint: 8.34.0 tsutils: 3.21.0_typescript@4.9.5 @@ -591,13 +591,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types/5.51.0: - resolution: {integrity: sha512-SqOn0ANn/v6hFn0kjvLwiDi4AzR++CBZz0NV5AnusT2/3y32jdc0G4woXPWHCumWtUXZKPAS27/9vziSsC9jnw==} + /@typescript-eslint/types/5.52.0: + resolution: {integrity: sha512-oV7XU4CHYfBhk78fS7tkum+/Dpgsfi91IIDy7fjCyq2k6KB63M6gMC0YIvy+iABzmXThCRI6xpCEyVObBdWSDQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.51.0_typescript@4.9.5: - resolution: {integrity: sha512-TSkNupHvNRkoH9FMA3w7TazVFcBPveAAmb7Sz+kArY6sLT86PA5Vx80cKlYmd8m3Ha2SwofM1KwraF24lM9FvA==} + /@typescript-eslint/typescript-estree/5.52.0_typescript@4.9.5: + resolution: {integrity: sha512-WeWnjanyEwt6+fVrSR0MYgEpUAuROxuAH516WPjUblIrClzYJj0kBbjdnbQXLpgAN8qbEuGywiQsXUVDiAoEuQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -605,8 +605,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.51.0 - '@typescript-eslint/visitor-keys': 5.51.0 + '@typescript-eslint/types': 5.52.0 + '@typescript-eslint/visitor-keys': 5.52.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -617,17 +617,17 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.51.0_7kw3g6rralp5ps6mg3uyzz6azm: - resolution: {integrity: sha512-76qs+5KWcaatmwtwsDJvBk4H76RJQBFe+Gext0EfJdC3Vd2kpY2Pf//OHHzHp84Ciw0/rYoGTDnIAr3uWhhJYw==} + /@typescript-eslint/utils/5.52.0_7kw3g6rralp5ps6mg3uyzz6azm: + resolution: {integrity: sha512-As3lChhrbwWQLNk2HC8Ree96hldKIqk98EYvypd3It8Q1f8d5zWyIoaZEp2va5667M4ZyE7X8UUR+azXrFl+NA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 - '@typescript-eslint/scope-manager': 5.51.0 - '@typescript-eslint/types': 5.51.0 - '@typescript-eslint/typescript-estree': 5.51.0_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.52.0 + '@typescript-eslint/types': 5.52.0 + '@typescript-eslint/typescript-estree': 5.52.0_typescript@4.9.5 eslint: 8.34.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.34.0 @@ -637,11 +637,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys/5.51.0: - resolution: {integrity: sha512-Oh2+eTdjHjOFjKA27sxESlA87YPSOJafGCR0md5oeMdh1ZcCfAGCIOL216uTBAkAIptvLIfKQhl7lHxMJet4GQ==} + /@typescript-eslint/visitor-keys/5.52.0: + resolution: {integrity: sha512-qMwpw6SU5VHCPr99y274xhbm+PRViK/NATY6qzt+Et7+mThGuFSl/ompj2/hrBlRP/kq+BFdgagnOSgw9TB0eA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.51.0 + '@typescript-eslint/types': 5.52.0 eslint-visitor-keys: 3.3.0 dev: true @@ -818,13 +818,13 @@ packages: semver: 7.3.8 dev: true - /bundle-require/4.0.1_esbuild@0.17.7: + /bundle-require/4.0.1_esbuild@0.17.8: resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: esbuild: '>=0.17' dependencies: - esbuild: 0.17.7 + esbuild: 0.17.8 load-tsconfig: 0.2.3 dev: true @@ -878,8 +878,8 @@ packages: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} dev: true - /chatgpt/4.3.2: - resolution: {integrity: sha512-5+Kh0mdP/pDJTL3kA6C6Dp43EO8T8sILPJbbQwOu3J4dK+n/tYpSXsmG6VZkmitAVOffeTonXTGDJwslc66orw==} + /chatgpt/4.4.0: + resolution: {integrity: sha512-rS1F423hR5marIB7hvZ4KyczK9oFloWY+AR4WKIt+HLyiRgOOWv6V4olu1HvaoOayc5+A/N2WwX0SzuU1rI9Rg==} engines: {node: '>=18'} dependencies: eventsource-parser: 0.0.5 @@ -1175,34 +1175,34 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild/0.17.7: - resolution: {integrity: sha512-+5hHlrK108fT6C6/40juy0w4DYKtyZ5NjfBlTccBdsFutR7WBxpIY633JzZJewdsCy8xWA/u2z0MSniIJwufYg==} + /esbuild/0.17.8: + resolution: {integrity: sha512-g24ybC3fWhZddZK6R3uD2iF/RIPnRpwJAqLov6ouX3hMbY4+tKolP0VMF3zuIYCaXun+yHwS5IPQ91N2BT191g==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.17.7 - '@esbuild/android-arm64': 0.17.7 - '@esbuild/android-x64': 0.17.7 - '@esbuild/darwin-arm64': 0.17.7 - '@esbuild/darwin-x64': 0.17.7 - '@esbuild/freebsd-arm64': 0.17.7 - '@esbuild/freebsd-x64': 0.17.7 - '@esbuild/linux-arm': 0.17.7 - '@esbuild/linux-arm64': 0.17.7 - '@esbuild/linux-ia32': 0.17.7 - '@esbuild/linux-loong64': 0.17.7 - '@esbuild/linux-mips64el': 0.17.7 - '@esbuild/linux-ppc64': 0.17.7 - '@esbuild/linux-riscv64': 0.17.7 - '@esbuild/linux-s390x': 0.17.7 - '@esbuild/linux-x64': 0.17.7 - '@esbuild/netbsd-x64': 0.17.7 - '@esbuild/openbsd-x64': 0.17.7 - '@esbuild/sunos-x64': 0.17.7 - '@esbuild/win32-arm64': 0.17.7 - '@esbuild/win32-ia32': 0.17.7 - '@esbuild/win32-x64': 0.17.7 + '@esbuild/android-arm': 0.17.8 + '@esbuild/android-arm64': 0.17.8 + '@esbuild/android-x64': 0.17.8 + '@esbuild/darwin-arm64': 0.17.8 + '@esbuild/darwin-x64': 0.17.8 + '@esbuild/freebsd-arm64': 0.17.8 + '@esbuild/freebsd-x64': 0.17.8 + '@esbuild/linux-arm': 0.17.8 + '@esbuild/linux-arm64': 0.17.8 + '@esbuild/linux-ia32': 0.17.8 + '@esbuild/linux-loong64': 0.17.8 + '@esbuild/linux-mips64el': 0.17.8 + '@esbuild/linux-ppc64': 0.17.8 + '@esbuild/linux-riscv64': 0.17.8 + '@esbuild/linux-s390x': 0.17.8 + '@esbuild/linux-x64': 0.17.8 + '@esbuild/netbsd-x64': 0.17.8 + '@esbuild/openbsd-x64': 0.17.8 + '@esbuild/sunos-x64': 0.17.8 + '@esbuild/win32-arm64': 0.17.8 + '@esbuild/win32-ia32': 0.17.8 + '@esbuild/win32-x64': 0.17.8 dev: true /escape-html/1.0.3: @@ -1229,7 +1229,7 @@ packages: - supports-color dev: true - /eslint-module-utils/2.7.4_ithmlgmaospkvl4p7n7pyp3rgq: + /eslint-module-utils/2.7.4_npjqex3ey3rgd34fjcuucz7la4: resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: @@ -1250,7 +1250,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm debug: 3.2.7 eslint: 8.34.0 eslint-import-resolver-node: 0.3.7 @@ -1261,7 +1261,7 @@ packages: /eslint-plugin-antfu/0.35.2_7kw3g6rralp5ps6mg3uyzz6azm: resolution: {integrity: sha512-Q6FOcOakafU49PDRlq7jkrWmlTJ4u3AW7aGX+FqeQNaMgjXq0RzPGvS0Vyp7q/XDRLLoe0BjbGkamTeZXg8waw==} dependencies: - '@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm transitivePeerDependencies: - eslint - supports-color @@ -1296,7 +1296,7 @@ packages: htmlparser2: 8.0.1 dev: true - /eslint-plugin-import/2.27.5_62tsymtiqxebhmxuag4hg3gx2m: + /eslint-plugin-import/2.27.5_mcvs2y73sfmcxqzpjj5lr7a2m4: resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -1306,7 +1306,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/parser': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 @@ -1314,7 +1314,7 @@ packages: doctrine: 2.1.0 eslint: 8.34.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4_ithmlgmaospkvl4p7n7pyp3rgq + eslint-module-utils: 2.7.4_npjqex3ey3rgd34fjcuucz7la4 has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -1329,7 +1329,7 @@ packages: - supports-color dev: true - /eslint-plugin-jest/27.2.1_wz3lx5pragqwrk3vwpswr7bnzu: + /eslint-plugin-jest/27.2.1_7hfwvekd5cgjoxqyvesymwuacm: resolution: {integrity: sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -1342,8 +1342,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4 - '@typescript-eslint/utils': 5.51.0_7kw3g6rralp5ps6mg3uyzz6azm + '@typescript-eslint/eslint-plugin': 5.52.0_6cfvjsbua5ptj65675bqcn6oza + '@typescript-eslint/utils': 5.52.0_7kw3g6rralp5ps6mg3uyzz6azm eslint: 8.34.0 transitivePeerDependencies: - supports-color @@ -1430,7 +1430,7 @@ packages: strip-indent: 3.0.0 dev: true - /eslint-plugin-unused-imports/2.0.0_b5d7vn5fvb66hlq4xz6bd5gdxm: + /eslint-plugin-unused-imports/2.0.0_vqeavzxdzk2atb75l6fx3anzpi: resolution: {integrity: sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1440,7 +1440,7 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.51.0_z4swst3wuuqk4hlme4ajzslgh4 + '@typescript-eslint/eslint-plugin': 5.52.0_6cfvjsbua5ptj65675bqcn6oza eslint: 8.34.0 eslint-rule-composer: 0.3.0 dev: true @@ -3156,9 +3156,9 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tsup/6.6.2_typescript@4.9.5: - resolution: {integrity: sha512-+yQ6SI4rVtp1+YpcYOePumJLEVQ896CDNRt9dJ2L/DeMnLf1+FTOCVw5eioLBH0xLdHgogO9NQ6vPNF5MfkSJw==} - engines: {node: '>=14'} + /tsup/6.6.3_typescript@4.9.5: + resolution: {integrity: sha512-OLx/jFllYlVeZQ7sCHBuRVEQBBa1tFbouoc/gbYakyipjVQdWy/iQOvmExUA/ewap9iQ7tbJf9pW0PgcEFfJcQ==} + engines: {node: '>=14.18'} hasBin: true peerDependencies: '@swc/core': ^1 @@ -3172,11 +3172,11 @@ packages: typescript: optional: true dependencies: - bundle-require: 4.0.1_esbuild@0.17.7 + bundle-require: 4.0.1_esbuild@0.17.8 cac: 6.7.14 chokidar: 3.5.3 debug: 4.3.4 - esbuild: 0.17.7 + esbuild: 0.17.8 execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 diff --git a/service/src/chatgpt.ts b/service/src/chatgpt.ts index 3ad7af7..5cccee0 100644 --- a/service/src/chatgpt.ts +++ b/service/src/chatgpt.ts @@ -3,11 +3,6 @@ import 'isomorphic-fetch' import type { ChatGPTAPI, SendMessageOptions } from 'chatgpt' import { sendResponse } from './utils' -export interface ChatContext { - conversationId?: string - parentMessageId?: string -} - dotenv.config() const apiKey = process.env.OPENAI_API_KEY @@ -15,16 +10,13 @@ const apiKey = process.env.OPENAI_API_KEY if (apiKey === undefined) throw new Error('OPENAI_API_KEY is not defined') -/** - * More Info: https://github.com/transitive-bullshit/chatgpt-api - */ let api: ChatGPTAPI + // To use ESM in CommonJS, you can use a dynamic import (async () => { + // More Info: https://github.com/transitive-bullshit/chatgpt-api const { ChatGPTAPI } = await import('chatgpt') - - api = new ChatGPTAPI( - { apiKey: process.env.OPENAI_API_KEY }) + api = new ChatGPTAPI({ apiKey: process.env.OPENAI_API_KEY }) })() async function chatReply(