From f16ccb56895f65dea530be295b19f04a03c8ed99 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 22 Sep 2024 20:03:03 +0800 Subject: [PATCH] feat: add label map for device type in website --- pnpm-lock.yaml | 231 ++++++++++-------- .../website/WebsiteMetricsTable.tsx | 13 +- src/client/package.json | 2 +- src/client/public/locales/de/translation.json | 4 + src/client/public/locales/en/translation.json | 4 + src/client/public/locales/fr/translation.json | 4 + src/client/public/locales/jp/translation.json | 4 + src/client/public/locales/pl/translation.json | 4 + src/client/public/locales/pt/translation.json | 6 +- src/client/public/locales/ru/translation.json | 4 + src/client/public/locales/zh/translation.json | 4 + src/server/tests/seeds/website.ts | 52 ++-- 12 files changed, 201 insertions(+), 131 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2e695bf..5705f96 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -359,8 +359,8 @@ importers: specifier: 0.34.1 version: 0.34.1(nodemailer@6.9.8) '@i18next-toolkit/cli': - specifier: ^1.3.4 - version: 1.3.4(buffer@6.0.3)(typescript@5.5.4) + specifier: ^1.4.3 + version: 1.4.3(buffer@6.0.3)(openai@4.63.0(zod@3.22.2))(typescript@5.5.4) '@tanstack/router-vite-plugin': specifier: 1.20.5 version: 1.20.5 @@ -2709,8 +2709,8 @@ packages: resolution: {integrity: sha512-e5+YUKENATs1JgYHMzTr2MW/NDcXGfYFAuOQU8gJgF/kEh4EqKgfGrfLI67bMD4tbhZVlkigz/9YYwWcbOFthg==} engines: {node: '>=10.13.0'} - '@i18next-toolkit/cli@1.3.4': - resolution: {integrity: sha512-1qxnvrPKFHkdka/Fnfr9hupH9+MslJmDl3DEOL1zak4fbM+XEKYx5RN+UcrHyJ1N2CLXH84j6SnlskTCNNjDEg==} + '@i18next-toolkit/cli@1.4.3': + resolution: {integrity: sha512-PMGOb1NMAIkBn33gigRnWosYAobtDL9WLRgMuw8pxCO85tY3kBkmZd+V8Lp2VScs0Lr31GvLqryoZIyZg6QcEQ==} hasBin: true '@i18next-toolkit/extractor@1.1.0': @@ -2784,12 +2784,12 @@ packages: '@jsdevtools/ono@7.1.3': resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} - '@langchain/core@0.1.52': - resolution: {integrity: sha512-AEyP99r7jijF33pyzaWtqCkiO9crotgethqq7jznAGlIojMCL9BT/id2DjVyN32SGFTpet273kkjsmEdFSHqpA==} + '@langchain/core@0.2.27': + resolution: {integrity: sha512-QAIlGxXWW7fox1oGmQjEHs1fbPaXOE9CeunmwZl9grFpu1igdkLbKnEJF7fjbVchyJHRB6yzpQ1bwP/S12O4mQ==} engines: {node: '>=18'} - '@langchain/openai@0.0.24': - resolution: {integrity: sha512-4E9IYJDNVnuHxBV5mFPefaWu76dJREEW5WE2r4QKpHomBMReQVKT3TLiasl1rDI10axnJF9FPjsJG+MW93rCiQ==} + '@langchain/openai@0.2.7': + resolution: {integrity: sha512-f2XDXbExJf4SYsy17QSiq0YY/UWJXhJwoiS8uRi/gBa20zBQ8+bBFRnb9vPdLkOkGiaTy+yXZVFro3a9iW2r3w==} engines: {node: '>=18'} '@leichtgewicht/ip-codec@2.0.4': @@ -4856,6 +4856,9 @@ packages: '@types/unist@3.0.2': resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} + '@types/uuid@10.0.0': + resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} + '@types/uuid@9.0.7': resolution: {integrity: sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g==} @@ -5384,9 +5387,6 @@ packages: bare-stream@2.3.0: resolution: {integrity: sha512-pVRWciewGUeCyKEuRxwv06M079r+fRjAQjBEK2P6OYGrO43O+Z0LrPZZEjlc4mB6C2RpZ9AxJ1s7NLEtOHO6eA==} - base-64@0.1.0: - resolution: {integrity: sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==} - base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -6615,9 +6615,6 @@ packages: resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} engines: {node: '>=0.3.1'} - digest-fetch@1.3.0: - resolution: {integrity: sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==} - dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -8328,8 +8325,8 @@ packages: resolution: {integrity: sha512-c80Qupofp43y4cJ7+8TTDN/AsDwLi5oOm/plBrWI+iQt485vKXCco+yVmOwEgdo9VOdsYTuV0UlTeetVPTriXA==} engines: {node: '>=12'} - js-tiktoken@1.0.10: - resolution: {integrity: sha512-ZoSxbGjvGyMT13x6ACo9ebhDha/0FHdKA+OsQcMOWcm1Zs7r90Rhk5lhERLzji+3rA7EKpXCgwXcM5fF3DMpdA==} + js-tiktoken@1.0.14: + resolution: {integrity: sha512-Pk3l3WOgM9joguZY2k52+jH82RtABRgB5RdGFZNUGbOKGMVlNmafcPA3b0ITcCZPu1L9UclP1tne6aw7ZI4Myg==} js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -8456,8 +8453,13 @@ packages: kuler@2.0.0: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} - langsmith@0.1.14: - resolution: {integrity: sha512-iEzQLLB7/0nRpAwNBAR7B7N64fyByg5UsNjSvLaCCkQ9AS68PSafjB8xQkyI8QXXrGjU1dEqDRoa8m4SUuRdUw==} + langsmith@0.1.59: + resolution: {integrity: sha512-dW+z6s538zBswFFP2w/xzvVef7y2+yNt6GkmRCeLtwfpbMaM4di7JboK3vmnZ+0/LjNb2ukiMmgsTNKu/Y43cg==} + peerDependencies: + openai: '*' + peerDependenciesMeta: + openai: + optional: true latest-version@7.0.0: resolution: {integrity: sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==} @@ -9269,33 +9271,18 @@ packages: ml-array-max@1.2.4: resolution: {integrity: sha512-BlEeg80jI0tW6WaPyGxf5Sa4sqvcyY6lbSn5Vcv44lp1I2GR6AWojfUvLnGTNsIXrZ8uqWmo8VcG1WpkI2ONMQ==} - ml-array-mean@1.1.6: - resolution: {integrity: sha512-MIdf7Zc8HznwIisyiJGRH9tRigg3Yf4FldW8DxKxpCCv/g5CafTw0RRu51nojVEOXuCQC7DRVVu5c7XXO/5joQ==} - ml-array-min@1.2.3: resolution: {integrity: sha512-VcZ5f3VZ1iihtrGvgfh/q0XlMobG6GQ8FsNyQXD3T+IlstDv85g8kfV0xUG1QPRO/t21aukaJowDzMTc7j5V6Q==} ml-array-rescale@1.3.7: resolution: {integrity: sha512-48NGChTouvEo9KBctDfHC3udWnQKNKEWN0ziELvY3KG25GR5cA8K8wNVzracsqSW1QEkAXjTNx+ycgAv06/1mQ==} - ml-array-sum@1.1.6: - resolution: {integrity: sha512-29mAh2GwH7ZmiRnup4UyibQZB9+ZLyMShvt4cH4eTK+cL2oEMIZFnSyB3SS8MlsTh6q/w/yh48KmqLxmovN4Dw==} - - ml-distance-euclidean@2.0.0: - resolution: {integrity: sha512-yC9/2o8QF0A3m/0IXqCTXCzz2pNEzvmcE/9HFKOZGnTjatvBbsn4lWYJkxENkA4Ug2fnYl7PXQxnPi21sgMy/Q==} - - ml-distance@4.0.1: - resolution: {integrity: sha512-feZ5ziXs01zhyFUUUeZV5hwc0f5JW0Sh0ckU1koZe/wdVkJdGxcP06KNQuF0WBTj8FttQUzcvQcpcrOp/XrlEw==} - ml-matrix@6.11.0: resolution: {integrity: sha512-7jr9NmFRkaUxbKslfRu3aZOjJd2LkSitCGv+QH9PF0eJoEG7jIpjXra1Vw8/kgao8+kHCSsJONG6vfWmXQ+/Eg==} ml-matrix@6.5.0: resolution: {integrity: sha512-sms732Dge+rs5dU4mnjE0oqLWm1WujvR2fr38LgUHRG2cjXjWlO3WJupLYaSz3++2iYr0UrGDK72OAivr3J8dg==} - ml-tree-similarity@1.0.0: - resolution: {integrity: sha512-XJUyYqjSuUQkNQHMscr6tcjldsOoAekxADTplt40QKfwW6nd++1wHWV9AArl0Zvw/TIHgNaZZNvr8QGvE8wLRg==} - mlly@1.5.0: resolution: {integrity: sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==} @@ -9360,6 +9347,10 @@ packages: murmurhash-js@1.0.0: resolution: {integrity: sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==} + mustache@4.2.0: + resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} + hasBin: true + mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} @@ -9565,10 +9556,6 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - num-sort@2.1.0: - resolution: {integrity: sha512-1MQz1Ed8z2yckoBeSfkQHHO9K1yDRxxtotKSJ9yvcTUUxSvfvzEq5GwBrjjHEpMlq/k5gvXdmJ1SbYxWtpNoVg==} - engines: {node: '>=8'} - number-is-nan@1.0.1: resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} engines: {node: '>=0.10.0'} @@ -9655,9 +9642,14 @@ packages: resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} engines: {node: '>=14.16'} - openai@4.30.0: - resolution: {integrity: sha512-jOaT4u7DpWzvuOuSxw5skuBbSuagw91Vd4IU/zP9qdgu6C19AAq4wzx+24e59wdEmsAG58enOUNf6t5V2WwN9g==} + openai@4.63.0: + resolution: {integrity: sha512-Y9V4KODbmrOpqiOmCDVnPfMxMqKLOx8Hwcdn/r8mePq4yv7FSXGnxCs8/jZKO7zCB/IVPWihpJXwJNAIOEiZ2g==} hasBin: true + peerDependencies: + zod: ^3.23.8 + peerDependenciesMeta: + zod: + optional: true openapi-to-postmanv2@1.2.7: resolution: {integrity: sha512-oG3PZfAAljy5ebot8DZGLFDNNmDZ/qWqI/dboWlgg5hRj6dSSrXeiyXL6VQpcGDalxVX4jSChufOq2eDsFXp4w==} @@ -12882,6 +12874,10 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} + uuid@10.0.0: + resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} + hasBin: true + uuid@3.4.0: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. @@ -16258,12 +16254,12 @@ snapshots: '@hutson/parse-repository-url@5.0.0': {} - '@i18next-toolkit/cli@1.3.4(buffer@6.0.3)(typescript@5.5.4)': + '@i18next-toolkit/cli@1.4.3(buffer@6.0.3)(openai@4.63.0(zod@3.22.2))(typescript@5.5.4)': dependencies: '@i18next-toolkit/extractor': 1.1.0(buffer@6.0.3) '@i18next-toolkit/scanner': 1.0.0 - '@langchain/core': 0.1.52 - '@langchain/openai': 0.0.24 + '@langchain/core': 0.2.27(openai@4.63.0(zod@3.22.2)) + '@langchain/openai': 0.2.7 bing-translate-api: 4.0.2 cosmiconfig: 9.0.0(typescript@5.5.4) dotenv: 16.4.5 @@ -16271,10 +16267,11 @@ snapshots: inquirer: 8.2.6 lodash: 4.17.21 yargs: 17.7.2 - zod: 3.22.4 + zod: 3.23.8 transitivePeerDependencies: - buffer - encoding + - openai - typescript '@i18next-toolkit/extractor@1.1.0(buffer@6.0.3)': @@ -16390,27 +16387,45 @@ snapshots: '@jsdevtools/ono@7.1.3': {} - '@langchain/core@0.1.52': + '@langchain/core@0.2.27(openai@4.63.0(zod@3.22.2))': dependencies: ansi-styles: 5.2.0 camelcase: 6.3.0 decamelize: 1.2.0 - js-tiktoken: 1.0.10 - langsmith: 0.1.14 - ml-distance: 4.0.1 + js-tiktoken: 1.0.14 + langsmith: 0.1.59(openai@4.63.0(zod@3.22.2)) + mustache: 4.2.0 p-queue: 6.6.2 p-retry: 4.6.2 - uuid: 9.0.1 - zod: 3.22.4 - zod-to-json-schema: 3.22.5(zod@3.22.4) + uuid: 10.0.0 + zod: 3.23.8 + zod-to-json-schema: 3.22.5(zod@3.23.8) + transitivePeerDependencies: + - openai - '@langchain/openai@0.0.24': + '@langchain/core@0.2.27(openai@4.63.0(zod@3.23.8))': dependencies: - '@langchain/core': 0.1.52 - js-tiktoken: 1.0.10 - openai: 4.30.0 - zod: 3.22.4 - zod-to-json-schema: 3.22.5(zod@3.22.4) + ansi-styles: 5.2.0 + camelcase: 6.3.0 + decamelize: 1.2.0 + js-tiktoken: 1.0.14 + langsmith: 0.1.59(openai@4.63.0(zod@3.23.8)) + mustache: 4.2.0 + p-queue: 6.6.2 + p-retry: 4.6.2 + uuid: 10.0.0 + zod: 3.23.8 + zod-to-json-schema: 3.22.5(zod@3.23.8) + transitivePeerDependencies: + - openai + + '@langchain/openai@0.2.7': + dependencies: + '@langchain/core': 0.2.27(openai@4.63.0(zod@3.23.8)) + js-tiktoken: 1.0.14 + openai: 4.63.0(zod@3.23.8) + zod: 3.23.8 + zod-to-json-schema: 3.22.5(zod@3.23.8) transitivePeerDependencies: - encoding @@ -19225,6 +19240,8 @@ snapshots: '@types/unist@3.0.2': {} + '@types/uuid@10.0.0': {} + '@types/uuid@9.0.7': {} '@types/wrap-ansi@3.0.0': {} @@ -19864,8 +19881,7 @@ snapshots: b4a@1.6.4: {} - b4a@1.6.6: - optional: true + b4a@1.6.6: {} babel-loader@9.1.3(@babel/core@7.24.0)(webpack@5.90.3): dependencies: @@ -19935,8 +19951,6 @@ snapshots: streamx: 2.20.1 optional: true - base-64@0.1.0: {} - base64-js@1.5.1: {} base64id@2.0.0: {} @@ -21305,11 +21319,6 @@ snapshots: diff@5.2.0: {} - digest-fetch@1.3.0: - dependencies: - base-64: 0.1.0 - md5: 2.3.0 - dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -22284,7 +22293,7 @@ snapshots: fs-mkdirp-stream@2.0.1: dependencies: graceful-fs: 4.2.11 - streamx: 2.16.1 + streamx: 2.20.1 fs-monkey@1.0.5: {} @@ -22449,7 +22458,7 @@ snapshots: is-glob: 4.0.3 is-negated-glob: 1.0.0 normalize-path: 3.0.0 - streamx: 2.16.1 + streamx: 2.20.1 glob-to-regexp@0.4.1: {} @@ -23530,7 +23539,7 @@ snapshots: js-library-detector@6.7.0: {} - js-tiktoken@1.0.10: + js-tiktoken@1.0.14: dependencies: base64-js: 1.5.1 @@ -23658,13 +23667,27 @@ snapshots: kuler@2.0.0: {} - langsmith@0.1.14: + langsmith@0.1.59(openai@4.63.0(zod@3.22.2)): dependencies: - '@types/uuid': 9.0.7 + '@types/uuid': 10.0.0 commander: 10.0.1 p-queue: 6.6.2 p-retry: 4.6.2 - uuid: 9.0.1 + semver: 7.6.3 + uuid: 10.0.0 + optionalDependencies: + openai: 4.63.0(zod@3.22.2) + + langsmith@0.1.59(openai@4.63.0(zod@3.23.8)): + dependencies: + '@types/uuid': 10.0.0 + commander: 10.0.1 + p-queue: 6.6.2 + p-retry: 4.6.2 + semver: 7.6.3 + uuid: 10.0.0 + optionalDependencies: + openai: 4.63.0(zod@3.23.8) latest-version@7.0.0: dependencies: @@ -24925,10 +24948,6 @@ snapshots: dependencies: is-any-array: 2.0.1 - ml-array-mean@1.1.6: - dependencies: - ml-array-sum: 1.1.6 - ml-array-min@1.2.3: dependencies: is-any-array: 2.0.1 @@ -24939,18 +24958,6 @@ snapshots: ml-array-max: 1.2.4 ml-array-min: 1.2.3 - ml-array-sum@1.1.6: - dependencies: - is-any-array: 2.0.1 - - ml-distance-euclidean@2.0.0: {} - - ml-distance@4.0.1: - dependencies: - ml-array-mean: 1.1.6 - ml-distance-euclidean: 2.0.0 - ml-tree-similarity: 1.0.0 - ml-matrix@6.11.0: dependencies: is-any-array: 2.0.1 @@ -24960,11 +24967,6 @@ snapshots: dependencies: ml-array-rescale: 1.3.7 - ml-tree-similarity@1.0.0: - dependencies: - binary-search: 1.3.6 - num-sort: 2.1.0 - mlly@1.5.0: dependencies: acorn: 8.11.3 @@ -25047,6 +25049,8 @@ snapshots: murmurhash-js@1.0.0: {} + mustache@4.2.0: {} + mute-stream@0.0.8: {} mute-stream@1.0.0: {} @@ -25250,8 +25254,6 @@ snapshots: dependencies: boolbase: 1.0.0 - num-sort@2.1.0: {} - number-is-nan@1.0.1: {} nypm@0.3.8: @@ -25345,17 +25347,32 @@ snapshots: is-inside-container: 1.0.0 is-wsl: 2.2.0 - openai@4.30.0: + openai@4.63.0(zod@3.22.2): dependencies: '@types/node': 18.18.13 '@types/node-fetch': 2.6.11 abort-controller: 3.0.0 agentkeepalive: 4.5.0 - digest-fetch: 1.3.0 form-data-encoder: 1.7.2 formdata-node: 4.4.1 node-fetch: 2.7.0 - web-streams-polyfill: 3.2.1 + optionalDependencies: + zod: 3.22.2 + transitivePeerDependencies: + - encoding + optional: true + + openai@4.63.0(zod@3.23.8): + dependencies: + '@types/node': 18.18.13 + '@types/node-fetch': 2.6.11 + abort-controller: 3.0.0 + agentkeepalive: 4.5.0 + form-data-encoder: 1.7.2 + formdata-node: 4.4.1 + node-fetch: 2.7.0 + optionalDependencies: + zod: 3.23.8 transitivePeerDependencies: - encoding @@ -28645,7 +28662,7 @@ snapshots: stream-composer@1.0.2: dependencies: - streamx: 2.16.1 + streamx: 2.20.1 stream-shift@1.0.3: {} @@ -28665,7 +28682,6 @@ snapshots: text-decoder: 1.2.0 optionalDependencies: bare-events: 2.2.1 - optional: true strict-event-emitter@0.5.1: {} @@ -28821,7 +28837,7 @@ snapshots: mime: 2.6.0 qs: 6.11.2 readable-stream: 3.6.2 - semver: 7.6.0 + semver: 7.6.3 transitivePeerDependencies: - supports-color @@ -29064,7 +29080,7 @@ snapshots: teex@1.0.1: dependencies: - streamx: 2.16.1 + streamx: 2.20.1 temp-dir@1.0.0: {} @@ -29110,7 +29126,6 @@ snapshots: text-decoder@1.2.0: dependencies: b4a: 1.6.6 - optional: true text-extensions@2.4.0: {} @@ -29205,7 +29220,7 @@ snapshots: to-through@3.0.0: dependencies: - streamx: 2.16.1 + streamx: 2.20.1 toggle-selection@1.0.6: {} @@ -29693,6 +29708,8 @@ snapshots: utils-merge@1.0.1: {} + uuid@10.0.0: {} + uuid@3.4.0: {} uuid@8.3.2: {} @@ -29813,7 +29830,7 @@ snapshots: normalize-path: 3.0.0 resolve-options: 2.0.0 stream-composer: 1.0.2 - streamx: 2.16.1 + streamx: 2.20.1 to-through: 3.0.0 value-or-function: 4.0.0 vinyl: 3.0.0 @@ -29834,7 +29851,7 @@ snapshots: convert-source-map: 2.0.0 graceful-fs: 4.2.11 now-and-later: 3.0.0 - streamx: 2.16.1 + streamx: 2.20.1 vinyl: 3.0.0 vinyl-contents: 2.0.0 @@ -30364,9 +30381,9 @@ snapshots: dependencies: zod: 3.22.2 - zod-to-json-schema@3.22.5(zod@3.22.4): + zod-to-json-schema@3.22.5(zod@3.23.8): dependencies: - zod: 3.22.4 + zod: 3.23.8 zod@3.22.2: {} diff --git a/src/client/components/website/WebsiteMetricsTable.tsx b/src/client/components/website/WebsiteMetricsTable.tsx index 9057e0c..0de03c4 100644 --- a/src/client/components/website/WebsiteMetricsTable.tsx +++ b/src/client/components/website/WebsiteMetricsTable.tsx @@ -31,6 +31,13 @@ export const WebsiteMetricsTable: React.FC = React.memo( const workspaceId = useCurrentWorkspaceId(); const { t } = useTranslation(); + const labelMap: Record = { + desktop: t('Desktop'), + laptop: t('Laptop'), + tablet: t('Tablet'), + mobile: t('Mobile'), + }; + const { isLoading, data: metrics = [] } = trpc.website.metrics.useQuery({ workspaceId, websiteId, @@ -47,7 +54,11 @@ export const WebsiteMetricsTable: React.FC = React.memo( dataIndex: 'x', ellipsis: true, render: (val) => - val ?? {t('(None)')}, + val ? ( + {labelMap[val] ?? val} + ) : ( + {t('(None)')} + ), }, { title: title[1], diff --git a/src/client/package.json b/src/client/package.json index 776b394..94a5fdd 100644 --- a/src/client/package.json +++ b/src/client/package.json @@ -100,7 +100,7 @@ }, "devDependencies": { "@auth/core": "^0.34.1", - "@i18next-toolkit/cli": "^1.3.4", + "@i18next-toolkit/cli": "^1.4.3", "@tanstack/router-vite-plugin": "1.20.5", "@types/jsonexport": "^3.0.5", "@types/leaflet": "^1.9.8", diff --git a/src/client/public/locales/de/translation.json b/src/client/public/locales/de/translation.json index 9dbc593..1e3157a 100644 --- a/src/client/public/locales/de/translation.json +++ b/src/client/public/locales/de/translation.json @@ -22,6 +22,7 @@ "k1964b988": "Stopp", "k1bd89236": "Reporter mit ausführen", "k1c33c293": "Einstellungen", + "k1d8f92b4": "Tablet", "k1eb5b3ed": "Übersicht", "k1f6dea0": "Kanalname", "k2099f2e0": "Anmeldung fehlgeschlagen, bitte überprüfen Sie Ihren Benutzernamen und Ihr Passwort", @@ -71,6 +72,7 @@ "k38b90a03": "Noch keine Website hinzugefügt, Sie können Ihre Website hinzufügen und mit Tianji integrieren, um weitere Informationen zu erhalten.", "k3b13c5a0": "Kein Feed-Kanal gefunden", "k3bda65c8": "Erweiterter Modus", + "k3bdf26d6": "Mobil", "k3cedb797": "Sicherheit", "k3d1822c5": "Aktion bestätigen", "k3d3baf52": "durchschnittliche Besuchszeit", @@ -282,6 +284,7 @@ "kc5f82d53": "Zum Beispiel: pushdeer://pushKey", "kc6888ac4": "Automatisch", "kc6cac621": "(Keine)", + "kc6dc3c38": "Desktop", "kc70d69ad": "Antwort", "kc9b446d1": "Ausführung abgeschlossen", "kcacbfde1": "Jetzt erstellen", @@ -333,6 +336,7 @@ "ke509fba1": "Lighthouse ist ein Open-Source-Tool, das von Google entwickelt wurde, um die Qualität von Webanwendungen zu bewerten.", "ke5b015e9": "Sie können einen Token von https://t.me/BotFather erhalten.", "ke6797c65": "Sie können Ihre Chat-ID erhalten, indem Sie eine Nachricht an den Bot senden und diese URL besuchen, um die chat_id zu sehen", + "ke7ad530d": "Laptop", "ke8a4e98f": "Alles anzeigen", "ke9ada492": "Die Y-Achse beginnt nicht bei Null", "ke9d2fef3": "Dieser Monat", diff --git a/src/client/public/locales/en/translation.json b/src/client/public/locales/en/translation.json index 67a5a87..dd9160f 100644 --- a/src/client/public/locales/en/translation.json +++ b/src/client/public/locales/en/translation.json @@ -22,6 +22,7 @@ "k1964b988": "Stop", "k1bd89236": "run reporter with", "k1c33c293": "Settings", + "k1d8f92b4": "Tablet", "k1eb5b3ed": "Overview", "k1f6dea0": "Channel Name", "k2099f2e0": "Login failed, please check your username and password", @@ -71,6 +72,7 @@ "k38b90a03": "Not any website has been added, you can add your website and integrate with Tianji to get more information.", "k3b13c5a0": "Not found any feed channel", "k3bda65c8": "Advanced Mode", + "k3bdf26d6": "Mobile", "k3cedb797": "Security", "k3d1822c5": "Confirm action", "k3d3baf52": "average visit time", @@ -282,6 +284,7 @@ "kc5f82d53": "For example: pushdeer://pushKey", "kc6888ac4": "Auto", "kc6cac621": "(None)", + "kc6dc3c38": "Desktop", "kc70d69ad": "Response", "kc9b446d1": "Run Completed", "kcacbfde1": "Create Now", @@ -333,6 +336,7 @@ "ke509fba1": "Lighthouse is an open-source, automated tool developed by Google, designed to evaluate the quality of web applications.", "ke5b015e9": "You can get a token from https://t.me/BotFather.", "ke6797c65": "You can get your chat ID by sending a message to the bot and going to this URL to view the chat_id", + "ke7ad530d": "Laptop", "ke8a4e98f": "Show All", "ke9ada492": "Y Axis will not start from zero", "ke9d2fef3": "This month", diff --git a/src/client/public/locales/fr/translation.json b/src/client/public/locales/fr/translation.json index ac24c28..9523abb 100644 --- a/src/client/public/locales/fr/translation.json +++ b/src/client/public/locales/fr/translation.json @@ -22,6 +22,7 @@ "k1964b988": "Arrêter", "k1bd89236": "exécuter le rapporteur avec", "k1c33c293": "Paramètres", + "k1d8f92b4": "Tablette", "k1eb5b3ed": "Aperçu", "k1f6dea0": "Nom du canal", "k2099f2e0": "Échec de la connexion, veuillez vérifier votre nom d'utilisateur et votre mot de passe", @@ -71,6 +72,7 @@ "k38b90a03": "Aucun site Web ajouté, vous pouvez ajouter votre site Web et l'intégrer avec Tianji pour obtenir plus d'informations.", "k3b13c5a0": "Aucun canal de flux trouvé", "k3bda65c8": "Mode avancé", + "k3bdf26d6": "Mobile", "k3cedb797": "Sécurité", "k3d1822c5": "Confirmer l'action", "k3d3baf52": "temps moyen de visite", @@ -282,6 +284,7 @@ "kc5f82d53": "Par exemple : pushdeer://pushKey", "kc6888ac4": "Automatique", "kc6cac621": "(Aucun)", + "kc6dc3c38": "Bureau", "kc70d69ad": "Réponse", "kc9b446d1": "Exécution terminée", "kcacbfde1": "Créer maintenant", @@ -333,6 +336,7 @@ "ke509fba1": "Lighthouse est un outil automatisé et open-source développé par Google, conçu pour évaluer la qualité des applications web.", "ke5b015e9": "Vous pouvez obtenir un jeton de https://t.me/BotFather.", "ke6797c65": "Vous pouvez obtenir votre ID de chat en envoyant un message au bot et en allant à cette URL pour voir le chat_id", + "ke7ad530d": "Ordinateur portable", "ke8a4e98f": "Afficher tout", "ke9ada492": "L'axe Y ne commencera pas à zéro", "ke9d2fef3": "Ce mois-ci", diff --git a/src/client/public/locales/jp/translation.json b/src/client/public/locales/jp/translation.json index f51fa84..80744f2 100644 --- a/src/client/public/locales/jp/translation.json +++ b/src/client/public/locales/jp/translation.json @@ -22,6 +22,7 @@ "k1964b988": "停止", "k1bd89236": "レポーターを実行する", "k1c33c293": "設定", + "k1d8f92b4": "タブレット", "k1eb5b3ed": "概要", "k1f6dea0": "チャンネル名", "k2099f2e0": "ログインに失敗しました。ユーザー名とパスワードを確認してください", @@ -71,6 +72,7 @@ "k38b90a03": "まだウェブサイトが追加されていません。ウェブサイトを追加して、Tianjiと統合して詳細情報を取得できます。", "k3b13c5a0": "フィードチャンネルが見つかりません", "k3bda65c8": "高度なモード", + "k3bdf26d6": "モバイル", "k3cedb797": "セキュリティ", "k3d1822c5": "操作を確認", "k3d3baf52": "平均訪問時間", @@ -282,6 +284,7 @@ "kc5f82d53": "例:pushdeer://pushKey", "kc6888ac4": "自動", "kc6cac621": "(なし)", + "kc6dc3c38": "デスクトップ", "kc70d69ad": "応答", "kc9b446d1": "実行完了", "kcacbfde1": "今すぐ作成", @@ -333,6 +336,7 @@ "ke509fba1": "ライトハウスは、Googleによって開発されたオープンソースの自動化ツールで、ウェブアプリケーションの品質を評価するために設計されています。", "ke5b015e9": "https://t.me/BotFather でトークンを取得できます。", "ke6797c65": "ボットにメッセージを送り、このURLにアクセスしてchat_idを表示することで、チャットIDを取得できます", + "ke7ad530d": "ラップトップ", "ke8a4e98f": "すべて表示", "ke9ada492": "Y軸はゼロから始まりません", "ke9d2fef3": "今月", diff --git a/src/client/public/locales/pl/translation.json b/src/client/public/locales/pl/translation.json index 18a32bc..fd8df5b 100644 --- a/src/client/public/locales/pl/translation.json +++ b/src/client/public/locales/pl/translation.json @@ -22,6 +22,7 @@ "k1964b988": "Zatrzymaj", "k1bd89236": "uruchom raportera z", "k1c33c293": "Ustawienia", + "k1d8f92b4": "Tablet", "k1eb5b3ed": "Przegląd", "k1f6dea0": "Nazwa kanału", "k2099f2e0": "Logowanie nie powiodło się, sprawdź swoją nazwę użytkownika i hasło", @@ -71,6 +72,7 @@ "k38b90a03": "Brak dodanych stron internetowych, możesz dodać swoją stronę i zintegrować ją z Tianji, aby uzyskać więcej informacji.", "k3b13c5a0": "Nie znaleziono żadnego kanału feedu", "k3bda65c8": "Tryb zaawansowany", + "k3bdf26d6": "Mobile", "k3cedb797": "Bezpieczeństwo", "k3d1822c5": "Potwierdź działanie", "k3d3baf52": "średni czas wizyty", @@ -282,6 +284,7 @@ "kc5f82d53": "Na przykład: pushdeer://pushKey", "kc6888ac4": "Automatyczny", "kc6cac621": "(Brak)", + "kc6dc3c38": "Desktop", "kc70d69ad": "Odpowiedź", "kc9b446d1": "Zakończono uruchamianie", "kcacbfde1": "Utwórz teraz", @@ -333,6 +336,7 @@ "ke509fba1": "Lighthouse to narzędzie open-source, automatyczne, opracowane przez Google, zaprojektowane do oceny jakości aplikacji internetowych.", "ke5b015e9": "Możesz uzyskać token ze strony https://t.me/BotFather.", "ke6797c65": "Możesz uzyskać swoje ID czatu, wysyłając wiadomość do bota i przechodząc pod ten adres URL, aby wyświetlić chat_id", + "ke7ad530d": "Laptop", "ke8a4e98f": "Pokaż wszystko", "ke9ada492": "Oś Y nie będzie się zaczynać od zera", "ke9d2fef3": "W tym miesiącu", diff --git a/src/client/public/locales/pt/translation.json b/src/client/public/locales/pt/translation.json index 86399f2..f284319 100644 --- a/src/client/public/locales/pt/translation.json +++ b/src/client/public/locales/pt/translation.json @@ -22,6 +22,7 @@ "k1964b988": "Parar", "k1bd89236": "correr repórter com", "k1c33c293": "Definições", + "k1d8f92b4": "Tablet", "k1eb5b3ed": "Visão geral", "k1f6dea0": "Nome do Canal", "k2099f2e0": "Falha no login, verifique seu nome de usuário e senha", @@ -67,10 +68,11 @@ "k3834d1a6": "Adicionar página", "k3847fb49": "Todo mês", "k389db675": "Enviar", - "k38af345c": "Slug", + "k38af345c": "Caracol", "k38b90a03": "Nenhum site foi adicionado, você pode adicionar seu site e integrá-lo ao Tianji para obter mais informações.", "k3b13c5a0": "Nenhum canal de feed encontrado", "k3bda65c8": "Modo Avançado", + "k3bdf26d6": "Móvel", "k3cedb797": "Segurança", "k3d1822c5": "Confirmar ação", "k3d3baf52": "tempo médio de visita", @@ -282,6 +284,7 @@ "kc5f82d53": "Por exemplo: pushdeer://pushKey", "kc6888ac4": "Automático", "kc6cac621": "(Nenhum)", + "kc6dc3c38": "Desktop", "kc70d69ad": "Resposta", "kc9b446d1": "Execução concluída", "kcacbfde1": "Criar agora", @@ -333,6 +336,7 @@ "ke509fba1": "O Lighthouse é uma ferramenta automatizada de código aberto desenvolvida pelo Google, projetada para avaliar a qualidade de aplicações web.", "ke5b015e9": "Pode obter um token em https://t.me/BotFather.", "ke6797c65": "Pode obter o seu ID de chat enviando uma mensagem para o bot e acedendo a este URL para ver o chat_id", + "ke7ad530d": "Laptop", "ke8a4e98f": "Mostrar tudo", "ke9ada492": "O eixo Y não começará do zero", "ke9d2fef3": "Este mês", diff --git a/src/client/public/locales/ru/translation.json b/src/client/public/locales/ru/translation.json index bf61649..2087b4f 100644 --- a/src/client/public/locales/ru/translation.json +++ b/src/client/public/locales/ru/translation.json @@ -22,6 +22,7 @@ "k1964b988": "Остановить", "k1bd89236": "запустить репортер с", "k1c33c293": "Настройки", + "k1d8f92b4": "Планшет", "k1eb5b3ed": "Обзор", "k1f6dea0": "Название канала", "k2099f2e0": "Ошибка входа, проверьте имя пользователя и пароль", @@ -71,6 +72,7 @@ "k38b90a03": "Не добавлено ни одного сайта, вы можете добавить свой сайт и интегрировать его с Tianji для получения дополнительной информации.", "k3b13c5a0": "Канал обратной связи не найден", "k3bda65c8": "Расширенный режим", + "k3bdf26d6": "Мобильный", "k3cedb797": "Безопасность", "k3d1822c5": "Подтвердить действие", "k3d3baf52": "среднее время посещения", @@ -282,6 +284,7 @@ "kc5f82d53": "Например: pushdeer://pushKey", "kc6888ac4": "Авто", "kc6cac621": "(Нет)", + "kc6dc3c38": "Настольный", "kc70d69ad": "Ответ", "kc9b446d1": "Запуск завершен", "kcacbfde1": "Создать сейчас", @@ -333,6 +336,7 @@ "ke509fba1": "Lighthouse — это инструмент с открытым исходным кодом, разработанный Google, предназначенный для оценки качества веб-приложений.", "ke5b015e9": "Вы можете получить токен на https://t.me/BotFather.", "ke6797c65": "Вы можете получить свой ID чата, отправив сообщение боту и перейдя по этому URL, чтобы просмотреть chat_id", + "ke7ad530d": "Ноутбук", "ke8a4e98f": "Показать все", "ke9ada492": "Ось Y не начнется с нуля", "ke9d2fef3": "Этот месяц", diff --git a/src/client/public/locales/zh/translation.json b/src/client/public/locales/zh/translation.json index 39c3e9c..cb388a2 100644 --- a/src/client/public/locales/zh/translation.json +++ b/src/client/public/locales/zh/translation.json @@ -22,6 +22,7 @@ "k1964b988": "停止", "k1bd89236": "运行报告器", "k1c33c293": "设置", + "k1d8f92b4": "平板电脑", "k1eb5b3ed": "概览", "k1f6dea0": "频道名称", "k2099f2e0": "登录失败,请检查您的用户名和密码", @@ -71,6 +72,7 @@ "k38b90a03": "还没有添加任何网站,您可以添加您的网站并与Tianji集成以获取更多信息。", "k3b13c5a0": "未找到任何订阅频道", "k3bda65c8": "高级模式", + "k3bdf26d6": "手机", "k3cedb797": "安全", "k3d1822c5": "确认操作", "k3d3baf52": "平均访问时间", @@ -282,6 +284,7 @@ "kc5f82d53": "例如:pushdeer://pushKey", "kc6888ac4": "自动", "kc6cac621": "(无)", + "kc6dc3c38": "桌面", "kc70d69ad": "响应", "kc9b446d1": "运行完成", "kcacbfde1": "立即创建", @@ -333,6 +336,7 @@ "ke509fba1": "灯塔是一个开源的自动化工具,由谷歌开发,旨在评估Web应用程序的质量。", "ke5b015e9": "您可以从 https://t.me/BotFather 获取令牌。", "ke6797c65": "您可以通过向机器人发送消息并访问此URL来查看chat_id以获取您的聊天ID", + "ke7ad530d": "笔记本电脑", "ke8a4e98f": "显示全部", "ke9ada492": "Y轴不会从零开始", "ke9d2fef3": "本月", diff --git a/src/server/tests/seeds/website.ts b/src/server/tests/seeds/website.ts index 621c3c8..5e3126e 100644 --- a/src/server/tests/seeds/website.ts +++ b/src/server/tests/seeds/website.ts @@ -5,6 +5,8 @@ import { getLocation } from '../../utils/detect.js'; import dayjs from 'dayjs'; import { WebsiteSession } from '@prisma/client'; +const websiteId = 'cm1cemqhw0009g2snzh3eqjzr'; + async function main() { Array.from({ length: 200 }).map(async (_, i) => { const session = await createSession(); @@ -28,7 +30,6 @@ main() const startDate = dayjs().subtract(30, 'days').toDate(); const endDate = dayjs().toDate(); async function createSession() { - const websiteId = 'clrytmpbe000lvyo434zxiwqh'; const hostname = faker.internet.domainName(); const ip = faker.internet.ipv4(); const userAgent = faker.internet.userAgent(); @@ -47,7 +48,12 @@ async function createSession() { 'Mac OS', 'Windows 10', ]); - const device = faker.helpers.arrayElement(['desktop', 'mobile', 'tablet']); + const device = faker.helpers.arrayElement([ + 'desktop', + 'mobile', + 'tablet', + 'laptop', + ]); const screen = faker.helpers.arrayElement([ '1366x768', '1920x1080', @@ -91,29 +97,33 @@ async function createSession() { return session; } +const randomPagePath = Array.from({ length: 10 }).map(() => + [ + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.filePath(), + ].join('') +); + async function createSessionEvent(session: WebsiteSession) { await prisma.websiteEvent.createMany({ - data: Array.from({ length: faker.number.int({ max: 20 }) }).map(() => ({ + data: Array.from({ length: faker.number.int({ max: 40 }) }).map(() => ({ sessionId: session.id, websiteId: session.websiteId, - urlPath: [ - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.directoryPath(), - faker.system.filePath(), - ].join(''), // generate long path + urlPath: faker.helpers.arrayElement(randomPagePath), // generate long path createdAt: faker.date.between({ from: session.createdAt, to: endDate,