diff --git a/package.json b/package.json index e94ea2a..7adfd13 100644 --- a/package.json +++ b/package.json @@ -57,14 +57,14 @@ "vue-i18n": "^9.2.2", "vue-router": "^4.2.4", "xmlbuilder2": "^3.1.1", - "zhi-blog-api": "^1.16.0", + "zhi-blog-api": "^1.18.0", "zhi-common": "^1.11.5", "zhi-device": "^2.3.0", "zhi-fetch-middleware": "^0.1.19", - "zhi-github-middleware": "^0.1.0", + "zhi-github-middleware": "^0.1.2", "zhi-lib-base": "^0.4.2", - "zhi-siyuan-api": "^1.27.2", - "zhi-wechatsync-middleware": "^0.1.2", + "zhi-siyuan-api": "^1.27.7", + "zhi-wechatsync-middleware": "^0.1.7", "zhi-xmlrpc-middleware": "^0.2.19" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 22d130b..ae0a214 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,8 +48,8 @@ dependencies: specifier: ^3.1.1 version: 3.1.1 zhi-blog-api: - specifier: ^1.16.0 - version: 1.16.0 + specifier: ^1.18.0 + version: 1.18.0 zhi-common: specifier: ^1.11.5 version: 1.11.5 @@ -60,17 +60,17 @@ dependencies: specifier: ^0.1.19 version: 0.1.19 zhi-github-middleware: - specifier: ^0.1.0 - version: 0.1.0 + specifier: ^0.1.2 + version: 0.1.2 zhi-lib-base: specifier: ^0.4.2 version: 0.4.2 zhi-siyuan-api: - specifier: ^1.27.2 - version: 1.27.2 + specifier: ^1.27.7 + version: 1.27.7 zhi-wechatsync-middleware: - specifier: ^0.1.2 - version: 0.1.2 + specifier: ^0.1.7 + version: 0.1.7 zhi-xmlrpc-middleware: specifier: ^0.2.19 version: 0.2.19 @@ -78,7 +78,7 @@ dependencies: devDependencies: '@terwer/eslint-config-custom': specifier: ^1.3.6 - version: 1.3.6(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.62.0)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.9.0)(eslint-config-turbo@1.10.12)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.32.4)(eslint-plugin-vue@9.15.1)(eslint@8.45.0)(prettier-plugin-svelte@2.10.1)(prettier@2.8.8)(typescript@5.1.6) + version: 1.3.6(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.62.0)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.9.0)(eslint-config-turbo@1.10.12)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.32.4)(eslint-plugin-vue@9.15.1)(eslint@8.46.0)(prettier-plugin-svelte@2.10.1)(prettier@2.8.8)(typescript@5.1.6) '@types/node': specifier: ^18.17.1 version: 18.17.1 @@ -1823,14 +1823,14 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.45.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.46.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.45.0 - eslint-visitor-keys: 3.4.1 + eslint: 8.46.0 + eslint-visitor-keys: 3.4.2 dev: true /@eslint-community/regexpp@4.6.2: @@ -1838,8 +1838,8 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.1.0: - resolution: {integrity: sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==} + /@eslint/eslintrc@2.1.1: + resolution: {integrity: sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 @@ -1855,19 +1855,26 @@ packages: - supports-color dev: true - /@eslint/js@8.44.0: - resolution: {integrity: sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==} + /@eslint/js@8.46.0: + resolution: {integrity: sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@floating-ui/core@1.3.1: - resolution: {integrity: sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g==} + /@floating-ui/core@1.4.0: + resolution: {integrity: sha512-x5Ly1Eiyqt9aR38XzhraoWxgtQtvy3mVChWMZIr49XFyvIhNuqUxZKXBRoI5WiMRaaAZezCauJaEISu3z5y8sg==} + dependencies: + '@floating-ui/utils': 0.1.0 dev: false - /@floating-ui/dom@1.4.5: - resolution: {integrity: sha512-96KnRWkRnuBSSFbj0sFGwwOUd8EkiecINVl0O9wiZlZ64EkpyAOG3Xc2vKKNJmru0Z7RqWNymA+6b8OZqjgyyw==} + /@floating-ui/dom@1.5.0: + resolution: {integrity: sha512-9jPin5dTlcEN+nXzBRhdreCzlJBIYWeMXpJJ5VnO1l9dLcP7uQNPbmwmIoHpHpH6GPYMYtQA7GfkvsSj/CQPwg==} dependencies: - '@floating-ui/core': 1.3.1 + '@floating-ui/core': 1.4.0 + '@floating-ui/utils': 0.1.0 + dev: false + + /@floating-ui/utils@0.1.0: + resolution: {integrity: sha512-ZSlli/beGZdvoqT3/Y9oOW79XSEpBfxt8UY6vjyWJW0B8d/M+MKlkQ3kBzLKDXaSsB84IVj6QntQfHLzesB4mA==} dev: false /@gar/promisify@1.1.3: @@ -2038,7 +2045,7 @@ packages: resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==} dependencies: '@gar/promisify': 1.1.3 - semver: 7.5.4 + semver: 7.3.8 dev: true /@npmcli/move-file@1.1.2: @@ -2057,16 +2064,16 @@ packages: json-parse-even-better-errors: 2.3.1 dev: true - /@nuxt/eslint-config@0.1.1(eslint@8.45.0): + /@nuxt/eslint-config@0.1.1(eslint@8.46.0): resolution: {integrity: sha512-znm1xlbhldUubB2XGx6Ca5uarwlIieKf0o8CtxtF6eEauDbpa3T2p3JnTcdguMW2nj1YPneoGmhshANfOlghiQ==} peerDependencies: eslint: ^8.29.0 dependencies: '@rushstack/eslint-patch': 1.3.2 - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.45.0)(typescript@4.9.5) - '@typescript-eslint/parser': 5.62.0(eslint@8.45.0)(typescript@4.9.5) - eslint: 8.45.0 - eslint-plugin-vue: 9.15.1(eslint@8.45.0) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.46.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.46.0)(typescript@4.9.5) + eslint: 8.46.0 + eslint-plugin-vue: 9.15.1(eslint@8.46.0) typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -2259,7 +2266,7 @@ packages: defer-to-connect: 2.0.1 dev: true - /@terwer/eslint-config-custom@1.3.6(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.62.0)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.9.0)(eslint-config-turbo@1.10.12)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.32.4)(eslint-plugin-vue@9.15.1)(eslint@8.45.0)(prettier-plugin-svelte@2.10.1)(prettier@2.8.8)(typescript@5.1.6): + /@terwer/eslint-config-custom@1.3.6(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.62.0)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.9.0)(eslint-config-turbo@1.10.12)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.32.4)(eslint-plugin-vue@9.15.1)(eslint@8.46.0)(prettier-plugin-svelte@2.10.1)(prettier@2.8.8)(typescript@5.1.6): resolution: {integrity: sha512-W0dFSTYfkzpp71LW8cDZUgLrNa004KDctojbiQrJrF4FIDmlwND/LyPUqfe1Eg8sulB5qkNX9qMgFWZ4SAVXBQ==} peerDependencies: '@nuxt/eslint-config': ^0.1.1 @@ -2275,15 +2282,15 @@ packages: prettier-plugin-svelte: ^2.10.0 typescript: ^5.0.4 dependencies: - '@nuxt/eslint-config': 0.1.1(eslint@8.45.0) - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.45.0)(typescript@5.1.6) + '@nuxt/eslint-config': 0.1.1(eslint@8.46.0) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.46.0)(typescript@5.1.6) astro-eslint-parser: 0.13.3 - eslint: 8.45.0 - eslint-config-prettier: 8.9.0(eslint@8.45.0) - eslint-config-turbo: 1.10.12(eslint@8.45.0) - eslint-plugin-prettier: 4.2.1(eslint-config-prettier@8.9.0)(eslint@8.45.0)(prettier@2.8.8) - eslint-plugin-svelte: 2.32.4(eslint@8.45.0)(svelte@4.1.1) - eslint-plugin-vue: 9.15.1(eslint@8.45.0) + eslint: 8.46.0 + eslint-config-prettier: 8.9.0(eslint@8.46.0) + eslint-config-turbo: 1.10.12(eslint@8.46.0) + eslint-plugin-prettier: 4.2.1(eslint-config-prettier@8.9.0)(eslint@8.46.0)(prettier@2.8.8) + eslint-plugin-svelte: 2.32.4(eslint@8.46.0)(svelte@4.1.1) + eslint-plugin-vue: 9.15.1(eslint@8.46.0) prettier: 2.8.8 prettier-plugin-svelte: 2.10.1(prettier@2.8.8)(svelte@4.1.1) typescript: 5.1.6 @@ -2457,7 +2464,7 @@ packages: /@types/web-bluetooth@0.0.17: resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.45.0)(typescript@4.9.5): + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.46.0)(typescript@4.9.5): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2469,12 +2476,12 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.6.2 - '@typescript-eslint/parser': 5.62.0(eslint@8.45.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.46.0)(typescript@4.9.5) '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.45.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.45.0)(typescript@4.9.5) + '@typescript-eslint/type-utils': 5.62.0(eslint@8.46.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.46.0)(typescript@4.9.5) debug: 4.3.4 - eslint: 8.45.0 + eslint: 8.46.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 @@ -2485,7 +2492,7 @@ packages: - supports-color dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.45.0)(typescript@5.1.6): + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.46.0)(typescript@5.1.6): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2497,12 +2504,12 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.6.2 - '@typescript-eslint/parser': 5.62.0(eslint@8.45.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.46.0)(typescript@5.1.6) '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.45.0)(typescript@5.1.6) - '@typescript-eslint/utils': 5.62.0(eslint@8.45.0)(typescript@5.1.6) + '@typescript-eslint/type-utils': 5.62.0(eslint@8.46.0)(typescript@5.1.6) + '@typescript-eslint/utils': 5.62.0(eslint@8.46.0)(typescript@5.1.6) debug: 4.3.4 - eslint: 8.45.0 + eslint: 8.46.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 @@ -2513,7 +2520,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@5.62.0(eslint@8.45.0)(typescript@4.9.5): + /@typescript-eslint/parser@5.62.0(eslint@8.46.0)(typescript@4.9.5): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2527,13 +2534,13 @@ packages: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) debug: 4.3.4 - eslint: 8.45.0 + eslint: 8.46.0 typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.62.0(eslint@8.45.0)(typescript@5.1.6): + /@typescript-eslint/parser@5.62.0(eslint@8.46.0)(typescript@5.1.6): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2547,7 +2554,7 @@ packages: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) debug: 4.3.4 - eslint: 8.45.0 + eslint: 8.46.0 typescript: 5.1.6 transitivePeerDependencies: - supports-color @@ -2561,7 +2568,7 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/type-utils@5.62.0(eslint@8.45.0)(typescript@4.9.5): + /@typescript-eslint/type-utils@5.62.0(eslint@8.46.0)(typescript@4.9.5): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2572,16 +2579,16 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.45.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.46.0)(typescript@4.9.5) debug: 4.3.4 - eslint: 8.45.0 + eslint: 8.46.0 tsutils: 3.21.0(typescript@4.9.5) typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/type-utils@5.62.0(eslint@8.45.0)(typescript@5.1.6): + /@typescript-eslint/type-utils@5.62.0(eslint@8.46.0)(typescript@5.1.6): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2592,9 +2599,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) - '@typescript-eslint/utils': 5.62.0(eslint@8.45.0)(typescript@5.1.6) + '@typescript-eslint/utils': 5.62.0(eslint@8.46.0)(typescript@5.1.6) debug: 4.3.4 - eslint: 8.45.0 + eslint: 8.46.0 tsutils: 3.21.0(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: @@ -2648,19 +2655,19 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@5.62.0(eslint@8.45.0)(typescript@4.9.5): + /@typescript-eslint/utils@5.62.0(eslint@8.46.0)(typescript@4.9.5): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - eslint: 8.45.0 + eslint: 8.46.0 eslint-scope: 5.1.1 semver: 7.5.4 transitivePeerDependencies: @@ -2668,19 +2675,19 @@ packages: - typescript dev: true - /@typescript-eslint/utils@5.62.0(eslint@8.45.0)(typescript@5.1.6): + /@typescript-eslint/utils@5.62.0(eslint@8.46.0)(typescript@5.1.6): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) - eslint: 8.45.0 + eslint: 8.46.0 eslint-scope: 5.1.1 semver: 7.5.4 transitivePeerDependencies: @@ -2693,7 +2700,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: '@typescript-eslint/types': 5.62.0 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 dev: true /@vanilla-extract/babel-plugin-debug-ids@1.0.3: @@ -2942,7 +2949,7 @@ packages: recast: 0.21.5 remark-frontmatter: 4.0.1 remark-mdx-frontmatter: 1.1.1 - semver: 7.5.4 + semver: 7.3.8 sort-package-json: 1.57.0 tar-fs: 2.1.1 tsconfig-paths: 4.2.0 @@ -3435,7 +3442,7 @@ packages: '@typescript-eslint/types': 5.62.0 astrojs-compiler-sync: 0.3.3(@astrojs/compiler@1.6.3) debug: 4.3.4 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 espree: 9.6.1 semver: 7.5.4 transitivePeerDependencies: @@ -3705,7 +3712,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001517 - electron-to-chromium: 1.4.475 + electron-to-chromium: 1.4.477 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: true @@ -4482,8 +4489,8 @@ packages: jake: 10.8.7 dev: true - /electron-to-chromium@1.4.475: - resolution: {integrity: sha512-mTye5u5P98kSJO2n7zYALhpJDmoSQejIGya0iR01GpoRady8eK3bw7YHHnjA1Rfi4ZSLdpuzlAC7Zw+1Zu7Z6A==} + /electron-to-chromium@1.4.477: + resolution: {integrity: sha512-shUVy6Eawp33dFBFIoYbIwLHrX0IZ857AlH9ug2o4rvbWmpaCUdBpQ5Zw39HRrfzAFm4APJE9V+E2A/WB0YqJw==} dev: true /element-plus@2.3.8(vue@3.3.4): @@ -4493,7 +4500,7 @@ packages: dependencies: '@ctrl/tinycolor': 3.6.0 '@element-plus/icons-vue': 2.1.0(vue@3.3.4) - '@floating-ui/dom': 1.4.5 + '@floating-ui/dom': 1.5.0 '@popperjs/core': /@sxzz/popperjs-es@2.11.7 '@types/lodash': 4.14.196 '@types/lodash-es': 4.17.8 @@ -4865,25 +4872,25 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-prettier@8.9.0(eslint@8.45.0): + /eslint-config-prettier@8.9.0(eslint@8.46.0): resolution: {integrity: sha512-+sbni7NfVXnOpnRadUA8S28AUlsZt9GjgFvABIRL9Hkn8KqNzOp+7Lw4QWtrwn20KzU3wqu1QoOj2m+7rKRqkA==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.45.0 + eslint: 8.46.0 dev: true - /eslint-config-turbo@1.10.12(eslint@8.45.0): + /eslint-config-turbo@1.10.12(eslint@8.46.0): resolution: {integrity: sha512-z3jfh+D7UGYlzMWGh+Kqz++hf8LOE96q3o5R8X4HTjmxaBWlLAWG+0Ounr38h+JLR2TJno0hU9zfzoPNkR9BdA==} peerDependencies: eslint: '>6.6.0' dependencies: - eslint: 8.45.0 - eslint-plugin-turbo: 1.10.12(eslint@8.45.0) + eslint: 8.46.0 + eslint-plugin-turbo: 1.10.12(eslint@8.46.0) dev: true - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.9.0)(eslint@8.45.0)(prettier@2.8.8): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.9.0)(eslint@8.46.0)(prettier@2.8.8): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -4894,13 +4901,13 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.45.0 - eslint-config-prettier: 8.9.0(eslint@8.45.0) + eslint: 8.46.0 + eslint-config-prettier: 8.9.0(eslint@8.46.0) prettier: 2.8.8 prettier-linter-helpers: 1.0.0 dev: true - /eslint-plugin-svelte@2.32.4(eslint@8.45.0)(svelte@4.1.1): + /eslint-plugin-svelte@2.32.4(eslint@8.46.0)(svelte@4.1.1): resolution: {integrity: sha512-VJ12i2Iogug1jvhwxSlognnfGj76P5gks/V4pUD4SCSVQOp14u47MNP0zAG8AQR3LT0Fi1iUvIFnY4l9z5Rwbg==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: @@ -4910,10 +4917,10 @@ packages: svelte: optional: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) '@jridgewell/sourcemap-codec': 1.4.15 debug: 4.3.4 - eslint: 8.45.0 + eslint: 8.46.0 esutils: 2.0.3 known-css-properties: 0.28.0 postcss: 8.4.27 @@ -4928,28 +4935,28 @@ packages: - ts-node dev: true - /eslint-plugin-turbo@1.10.12(eslint@8.45.0): + /eslint-plugin-turbo@1.10.12(eslint@8.46.0): resolution: {integrity: sha512-uNbdj+ohZaYo4tFJ6dStRXu2FZigwulR1b3URPXe0Q8YaE7thuekKNP+54CHtZPH9Zey9dmDx5btAQl9mfzGOw==} peerDependencies: eslint: '>6.6.0' dependencies: dotenv: 16.0.3 - eslint: 8.45.0 + eslint: 8.46.0 dev: true - /eslint-plugin-vue@9.15.1(eslint@8.45.0): + /eslint-plugin-vue@9.15.1(eslint@8.46.0): resolution: {integrity: sha512-CJE/oZOslvmAR9hf8SClTdQ9JLweghT6JCBQNrT2Iel1uVw0W0OLJxzvPd6CxmABKCvLrtyDnqGV37O7KQv6+A==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) - eslint: 8.45.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) + eslint: 8.46.0 natural-compare: 1.4.0 nth-check: 2.1.1 postcss-selector-parser: 6.0.13 semver: 7.5.4 - vue-eslint-parser: 9.3.1(eslint@8.45.0) + vue-eslint-parser: 9.3.1(eslint@8.46.0) xml-name-validator: 4.0.0 transitivePeerDependencies: - supports-color @@ -4963,28 +4970,28 @@ packages: estraverse: 4.3.0 dev: true - /eslint-scope@7.2.1: - resolution: {integrity: sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==} + /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.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} + /eslint-visitor-keys@3.4.2: + resolution: {integrity: sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.45.0: - resolution: {integrity: sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==} + /eslint@8.46.0: + resolution: {integrity: sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) '@eslint-community/regexpp': 4.6.2 - '@eslint/eslintrc': 2.1.0 - '@eslint/js': 8.44.0 + '@eslint/eslintrc': 2.1.1 + '@eslint/js': 8.46.0 '@humanwhocodes/config-array': 0.11.10 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -4994,8 +5001,8 @@ packages: debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.1 - eslint-visitor-keys: 3.4.1 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.2 espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 @@ -5028,7 +5035,7 @@ packages: dependencies: acorn: 8.10.0 acorn-jsx: 5.3.2(acorn@8.10.0) - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 dev: true /esprima@4.0.1: @@ -6984,7 +6991,7 @@ packages: acorn: 8.10.0 pathe: 1.1.1 pkg-types: 1.0.3 - ufo: 1.1.2 + ufo: 1.2.0 dev: true /mri@1.2.0: @@ -8123,8 +8130,8 @@ packages: estree-walker: 0.6.1 dev: true - /rollup@3.26.3: - resolution: {integrity: sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ==} + /rollup@3.27.0: + resolution: {integrity: sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -8537,8 +8544,8 @@ packages: svelte: optional: true dependencies: - eslint-scope: 7.2.1 - eslint-visitor-keys: 3.4.1 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.2 espree: 9.6.1 postcss: 8.4.27 postcss-scss: 4.0.6(postcss@8.4.27) @@ -8828,8 +8835,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - /ufo@1.1.2: - resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} + /ufo@1.2.0: + resolution: {integrity: sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==} dev: true /unicode-canonical-property-names-ecmascript@2.0.0: @@ -9281,7 +9288,7 @@ packages: '@types/node': 18.17.1 esbuild: 0.18.17 postcss: 8.4.27 - rollup: 3.26.3 + rollup: 3.27.0 stylus: 0.59.0 optionalDependencies: fsevents: 2.3.2 @@ -9380,16 +9387,16 @@ packages: dependencies: vue: 3.3.4 - /vue-eslint-parser@9.3.1(eslint@8.45.0): + /vue-eslint-parser@9.3.1(eslint@8.46.0): resolution: {integrity: sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: debug: 4.3.4 - eslint: 8.45.0 - eslint-scope: 7.2.1 - eslint-visitor-keys: 3.4.1 + eslint: 8.46.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.2 espree: 9.6.1 esquery: 1.5.0 lodash: 4.17.21 @@ -9640,8 +9647,8 @@ packages: engines: {node: '>=12.20'} dev: true - /zhi-blog-api@1.16.0: - resolution: {integrity: sha512-jHBLTipF12ZRFuxx+/oU6iVd1Oko7cOAYzDjBVMWafuGWP5fpUQWRhL8Svju2UXSXgaYOcQUjmPH9Ubad0cZqg==} + /zhi-blog-api@1.18.0: + resolution: {integrity: sha512-9B8msbNsfjSnzWx+7jWa1jaaGT8Qz6LbTt+F2ymnXwmpprJ+3niNNt/9iq3fY+apuOiKRWPdYuYAUD5YIJT4Jw==} dependencies: zhi-lib-base: 0.4.2 dev: false @@ -9664,8 +9671,8 @@ packages: zhi-lib-base: 0.4.2 dev: false - /zhi-github-middleware@0.1.0: - resolution: {integrity: sha512-SAmHGln9rDXHu/2frUM7TuZ3wyZe2j2o905q+KjhpJzIiQuY5KH0ii+cTdtZBwKUz6TQCzlK8H3zVijNCHxUOg==} + /zhi-github-middleware@0.1.2: + resolution: {integrity: sha512-L1ED4wl+b16xT3Zih3pcbSO4mq1sri4EhJlHtyKJFWfHd/oX8IjvE0fdUOvLrApTOuyR2zGdfAzRUrgV9xzZyA==} dependencies: '@octokit/core': 5.0.0 js-base64: 3.7.5 @@ -9677,18 +9684,18 @@ packages: resolution: {integrity: sha512-kfKgN4hb5efUf+k5Y9028CVV1p/hsnK0NbRsxI3uwJoTlHfTBjfi6ZfrkhDn+XEnEYeWidO75sx4RdcnT7C3KA==} dev: false - /zhi-siyuan-api@1.27.2: - resolution: {integrity: sha512-/cI19mq5AidEO47IVXgAbAlfAyJxwPH3RONR8JAAaGayAvghbV8ovhmPVRJFDBEztcwzJpEbqra2DZ5iQGuofQ==} + /zhi-siyuan-api@1.27.7: + resolution: {integrity: sha512-oQspqaQn3ql13T4JUJ5YQCRaYPh87NXTcYJDpwrmzdi37ieXTBTw8F4ugl22xAfELIfxEVuSV/2Cx05kjZSmGw==} dependencies: - zhi-blog-api: 1.16.0 + zhi-blog-api: 1.18.0 zhi-common: 1.11.5 zhi-lib-base: 0.4.2 dev: false - /zhi-wechatsync-middleware@0.1.2: - resolution: {integrity: sha512-/swjrL9pe/GrktW/mMcHitYtWdqc7KSguHr1g8dUCA9SnTgQ4JFUi3F1D5M3T8mQWM5hPKsGBLpihlXSZMNOtg==} + /zhi-wechatsync-middleware@0.1.7: + resolution: {integrity: sha512-sqLLgkyyzVHyr5QF6XIoB3crIe4fVo0MgDojYz0XxI2CvqvoN16Xy1tPDx5aI0rIhDISclvSs+wHrXJjfaMPbw==} dependencies: - zhi-blog-api: 1.16.0 + zhi-blog-api: 1.18.0 zhi-common: 1.11.5 zhi-lib-base: 0.4.2 dev: false diff --git a/src/composables/api/useCnblogsApi.ts b/src/adaptors/api/cnblogs/useCnblogsApi.ts similarity index 99% rename from src/composables/api/useCnblogsApi.ts rename to src/adaptors/api/cnblogs/useCnblogsApi.ts index a3b0b83..007d354 100644 --- a/src/composables/api/useCnblogsApi.ts +++ b/src/adaptors/api/cnblogs/useCnblogsApi.ts @@ -36,6 +36,7 @@ import { getDynPostidKey } from "~/src/components/set/publish/platform/dynamicCo * 使用Cnblogs API的自定义hook * * @param key 配置键值,可选参数 + * @param newCfg * @author terwer * @version 0.9.0 * @since 0.9.0 diff --git a/src/composables/api/useHexoApi.ts b/src/adaptors/api/hexo/useHexoApi.ts similarity index 100% rename from src/composables/api/useHexoApi.ts rename to src/adaptors/api/hexo/useHexoApi.ts diff --git a/src/adaptors/api/siyuan/docs.md b/src/adaptors/api/siyuan/docs.md deleted file mode 100644 index 71cf0bc..0000000 --- a/src/adaptors/api/siyuan/docs.md +++ /dev/null @@ -1,15 +0,0 @@ -# SiYuanApiAdaptor - -## Usage - -```ts -import { SiYuanApiAdaptor, SiyuanConfig } from "zhi-siyuan-api" - -const siyuanCfg = new SiyuanConfig("http://127.0.0.1:6806", "") -// 显示指定修复标题 -siyuanCfg.fixTitle = true -const siyuanApiAdaptor = new SiYuanApiAdaptor(siyuanCfg) -const siyuanApi = Utils.blogApi(appInstance, siyuanApiAdaptor) -const siyuanUsersBlogs = await siyuanApi.getUsersBlogs() -console.log("siyuanUsersBlogs=>", siyuanUsersBlogs) -``` \ No newline at end of file diff --git a/src/adaptors/api/typecho/config/typechoConfig.ts b/src/adaptors/api/typecho/config/typechoConfig.ts index 5123dea..28b608f 100644 --- a/src/adaptors/api/typecho/config/typechoConfig.ts +++ b/src/adaptors/api/typecho/config/typechoConfig.ts @@ -25,7 +25,7 @@ import { MetaweblogConfig } from "~/src/adaptors/api/base/metaweblog/config/MetaweblogConfig.ts" import { PageTypeEnum } from "zhi-blog-api" -import TypechoUtils from "~/src/adaptors/api/Typecho/TypechoUtils.ts" +import TypechoUtils from "~/src/adaptors/api/typecho/typechoUtils.ts" /** * Typecho 配置 @@ -34,26 +34,6 @@ import TypechoUtils from "~/src/adaptors/api/Typecho/TypechoUtils.ts" * @since 1.0.0 */ class TypechoConfig extends MetaweblogConfig { - /** - * API 地址 - */ - public override apiUrl = "" - - /** - * 用户名 - */ - public override username = "" - - /** - * 密码 - */ - public override password = "" - - /** - * 代理地址 - */ - public override middlewareUrl = "" - /** * Typecho 配置项 * diff --git a/src/composables/api/useTypechoApi.ts b/src/adaptors/api/typecho/useTypechoApi.ts similarity index 98% rename from src/composables/api/useTypechoApi.ts rename to src/adaptors/api/typecho/useTypechoApi.ts index cd9dee0..2a53117 100644 --- a/src/composables/api/useTypechoApi.ts +++ b/src/adaptors/api/typecho/useTypechoApi.ts @@ -68,7 +68,7 @@ export const useTypechoApi = async (key?: string, newCfg?: TypechoConfig) => { const typechoAuthToken = Utils.emptyOrDefault(process.env.VITE_TYPECHO_AUTH_TOKEN, "") const middlewareUrl = Utils.emptyOrDefault( process.env.VITE_MIDDLEWARE_URL, - "http://localhost:3000/api/middleware" + "https://api.terwer.space/api/middleware" ) cfg = new TypechoConfig(typechoApiUrl, typechoUsername, typechoAuthToken, middlewareUrl) // 默认值 diff --git a/src/adaptors/api/wordpress/config/wordpressConfig.ts b/src/adaptors/api/wordpress/config/wordpressConfig.ts index 96775fa..4a7ec85 100644 --- a/src/adaptors/api/wordpress/config/wordpressConfig.ts +++ b/src/adaptors/api/wordpress/config/wordpressConfig.ts @@ -34,26 +34,6 @@ import WordpressUtils from "~/src/adaptors/api/wordpress/wordpressUtils.ts" * @since 1.0.0 */ class WordpressConfig extends MetaweblogConfig { - /** - * API 地址 - */ - public override apiUrl = "" - - /** - * 用户名 - */ - public override username = "" - - /** - * 密码 - */ - public override password = "" - - /** - * 代理地址 - */ - public override middlewareUrl = "" - /** * WordPress 配置项 * diff --git a/src/composables/api/useWordpressApi.ts b/src/adaptors/api/wordpress/useWordpressApi.ts similarity index 98% rename from src/composables/api/useWordpressApi.ts rename to src/adaptors/api/wordpress/useWordpressApi.ts index 28f35ab..c5cf46e 100644 --- a/src/composables/api/useWordpressApi.ts +++ b/src/adaptors/api/wordpress/useWordpressApi.ts @@ -68,7 +68,7 @@ export const useWordpressApi = async (key?: string, newCfg?: WordpressConfig) => const wordpressAuthToken = Utils.emptyOrDefault(process.env.VITE_WORDPRESS_AUTH_TOKEN, "") const middlewareUrl = Utils.emptyOrDefault( process.env.VITE_MIDDLEWARE_URL, - "http://localhost:3000/api/middleware" + "https://api.terwer.space/api/middleware" ) cfg = new WordpressConfig(wordpressApiUrl, wordpressUsername, wordpressAuthToken, middlewareUrl) // 默认值 diff --git a/src/composables/api/useYuqueApi.ts b/src/adaptors/api/yuque/useYuqueApi.ts similarity index 100% rename from src/composables/api/useYuqueApi.ts rename to src/adaptors/api/yuque/useYuqueApi.ts diff --git a/src/adaptors/index.ts b/src/adaptors/index.ts index 0fedb02..07232e3 100644 --- a/src/adaptors/index.ts +++ b/src/adaptors/index.ts @@ -23,13 +23,14 @@ * questions. */ -import { BlogAdaptor, BlogConfig } from "zhi-blog-api" +import { BlogAdaptor, WebAdaptor } from "zhi-blog-api" import { getSubPlatformTypeByKey, SubPlatformType } from "~/src/components/set/publish/platform/dynamicConfig.ts" -import { useCnblogsApi } from "~/src/composables/api/useCnblogsApi.ts" +import { useCnblogsApi } from "~/src/adaptors/api/cnblogs/useCnblogsApi.ts" import { createAppLogger } from "~/src/utils/appLogger.ts" -import { useWordpressApi } from "~/src/composables/api/useWordpressApi.ts" -import { useTypechoApi } from "~/src/composables/api/useTypechoApi.ts" -import { useYuqueApi } from "~/src/composables/api/useYuqueApi.ts" +import { useWordpressApi } from "~/src/adaptors/api/wordpress/useWordpressApi.ts" +import { useTypechoApi } from "~/src/adaptors/api/typecho/useTypechoApi.ts" +import { useYuqueApi } from "~/src/adaptors/api/yuque/useYuqueApi.ts" +import { useZhihuWeb } from "~/src/adaptors/web/zhihu/useZhihuWeb.ts" /** * 适配器统一入口 @@ -46,14 +47,11 @@ class Adaptors { * @param key * @param newCfg */ - public static async getAdaptor(key: string, newCfg?: any): Promise { + public static async getAdaptor(key: string, newCfg?: any): Promise { let blogAdaptor = null const type: SubPlatformType = getSubPlatformTypeByKey(key) switch (type) { - case SubPlatformType.Common_Zhihu:{ - break - } case SubPlatformType.Common_Yuque: { const { blogApi } = await useYuqueApi(key, newCfg) blogAdaptor = blogApi @@ -74,6 +72,11 @@ class Adaptors { blogAdaptor = blogApi break } + case SubPlatformType.Custom_Zhihu: { + const { webApi } = await useZhihuWeb() + blogAdaptor = webApi + break + } default: { break } diff --git a/src/adaptors/api/index.ts b/src/adaptors/web/zhihu/useZhihuWeb.ts similarity index 82% rename from src/adaptors/api/index.ts rename to src/adaptors/web/zhihu/useZhihuWeb.ts index 0463300..b1429dd 100644 --- a/src/adaptors/api/index.ts +++ b/src/adaptors/web/zhihu/useZhihuWeb.ts @@ -23,3 +23,16 @@ * questions. */ +import { ZhihuWebAdaptor } from "~/src/adaptors/web/zhihu/zhihuWebAdaptor.ts" + +/** + * 用于获取ZhihuWeb的API的自定义Hook + */ +const useZhihuWeb = async () => { + const webApi = new ZhihuWebAdaptor() + return { + webApi, + } +} + +export { useZhihuWeb } diff --git a/src/composables/api/useZhihuApi.ts b/src/adaptors/web/zhihu/zhihuWebAdaptor.ts similarity index 57% rename from src/composables/api/useZhihuApi.ts rename to src/adaptors/web/zhihu/zhihuWebAdaptor.ts index 0463300..cd4110a 100644 --- a/src/composables/api/useZhihuApi.ts +++ b/src/adaptors/web/zhihu/zhihuWebAdaptor.ts @@ -23,3 +23,35 @@ * questions. */ +import { WebApi } from "zhi-blog-api" +import { JsonUtil } from "zhi-common" + +/** + * 知乎网页授权适配器 + * + * @author terwer + * @version 0.9.0 + * @since 0.9.0 + */ +class ZhihuWebAdaptor extends WebApi { + public async getMetaData(): Promise { + const fetchResponse = await fetch( + "https://www.zhihu.com/api/v4/me?include=account_status%2Cis_bind_phone%2Cis_force_renamed%2Cemail%2Crenamed_fullname" + ) + const resText = await fetchResponse.text() + // console.log(res); + const res = JsonUtil.safeParse(resText, {} as any) + return { + uid: res.uid, + title: res.name, + avatar: res.avatar_url, + supportTypes: ["html"], + type: "zhihu", + displayName: "知乎", + home: "https://www.zhihu.com/settings/account", + icon: "https://static.zhihu.com/static/favicon.ico", + } + } +} + +export { ZhihuWebAdaptor } diff --git a/src/components/set/PublishSetting.vue b/src/components/set/PublishSetting.vue index 2d5c135..f507d3d 100644 --- a/src/components/set/PublishSetting.vue +++ b/src/components/set/PublishSetting.vue @@ -24,19 +24,18 @@ --> + - + diff --git a/src/composables/api/useSiyuanApi.ts b/src/composables/useSiyuanApi.ts similarity index 100% rename from src/composables/api/useSiyuanApi.ts rename to src/composables/useSiyuanApi.ts diff --git a/src/locales/zh_CN.ts b/src/locales/zh_CN.ts index 689a07e..e0b6835 100644 --- a/src/locales/zh_CN.ts +++ b/src/locales/zh_CN.ts @@ -476,13 +476,13 @@ export default { "目前支持的通用平台有:语雀,采用API授权。这些平台通常提供了现代化的REST API,可以方便的进行集成。", "setting.platform.wordpress": "WordPress", "setting.platform.wordpress.desc": - "Wordpress 通过Xmlrpc API支持,采用 API 授权。WordPress是一个以PHP和MySQL为平台的自由开源的博客软件和内容管理系统。它具有插件架构和模板系统,同时也是最受欢迎的网站内容管理系统。点击右侧图标快速添加,或者点击下方按钮自定义添加", + "Wordpress 通过Xmlrpc API支持,采用 API 授权。WordPress是一个自由开源的博客软件和内容管理系统,具有数量众多的优质插件和主题。", "setting.platform.github": "Github", "setting.platform.github.desc": - "目前支持Github发布的的平台有:Hexo、Hugo、Jekyll、Vitepress等,采用 API 授权。GitHub 是一个使用 Git 进行软件开发和版本控制的平台和基于云的服务,允许开发人员存储和管理他们的代码。", + "目前支持Github发布的的平台有:Hexo、Hugo、Jekyll、Vitepress等,采用 API 授权。GitHub 是一个使用 Git 进行软件开发和版本控制的代码平台。", "setting.platform.metaweblog": "Metaweblog", "setting.platform.metaweblog.desc": - "目前支持Metaweblog的平台有:博客园、Typecho等,采用 API 授权。MetaWeblog API是由软件开发人员Dave Winer创建的应用程序编程接口,它允许使用 Web 服务写入、编辑和删除。该 API 作为XML-RPC Web 服务实现,具有三个方法,其名称描述了其功能:metaweblog.newPost()、metaweblog.getPost() 和 metaweblog.editPost()。这些方法采用指定博客作者的用户名和密码以及与单个博客条目相关的信息的参数。", + "目前支持Metaweblog的平台有:博客园、Typecho等,采用 API 授权。MetaWeblog API 作为XML-RPC Web 服务实现,是目前公认的开放博客标准。", "setting.platform.custom": "自定义 HTTP 协议", "setting.platform.custom.desc": "目前支持自定义HTTP协议的平台有:知乎、CSDN、简书、掘金等,采用网页授权。自定义HTTP协议通过类似 WeChatSync 的方式实现。", "setting.platform.right.tips0": "特别提示:", diff --git a/src/stores/common/commonStorage.ts b/src/stores/common/commonStorage.ts index 8fe68b7..a382a66 100644 --- a/src/stores/common/commonStorage.ts +++ b/src/stores/common/commonStorage.ts @@ -26,7 +26,7 @@ import { StorageLikeAsync } from "@vueuse/core" import { createAppLogger } from "~/src/utils/appLogger.ts" import { StrUtil } from "zhi-common" -import { useSiyuanApi } from "~/src/composables/api/useSiyuanApi.ts" +import { useSiyuanApi } from "~/src/composables/useSiyuanApi.ts" import { SiyuanDevice } from "zhi-device" /** diff --git a/src/stores/useSettingStore.ts b/src/stores/useSettingStore.ts index 82395eb..20636a6 100755 --- a/src/stores/useSettingStore.ts +++ b/src/stores/useSettingStore.ts @@ -18,7 +18,6 @@ export const useSettingStore = defineStore("setting", () => { const initialValue = SypConfig const { commonStore } = useCommonStorageAsync(storageKey, initialValue) const settingRef = ref(null) - const { t } = useVueI18n() const getSettingRef = computed(async () => { const setting = await commonStore.get() @@ -85,37 +84,5 @@ export const useSettingStore = defineStore("setting", () => { } } - const checkAndUpgradeSetting = async (setting: Partial) => { - let isUpgrade = false - let logText = "" - - const logMessage = (message: string) => { - logger.info(message) - logText += `\n${message}` - } - - logMessage(t("setting.upgrade.syp.doTip1")) - - if (StrUtil.isEmptyString(setting.version)) { - logMessage(t("setting.upgrade.syp.doTip2")) - - // TODO 迁移旧配置 - // 读取旧的配置文件 - // 数据转换适配 - // 更新最新版本号 - logMessage("TODO,开发中,敬请期待") - // setting.version = version - // - // await updateSetting(setting) - // - // logMessage(t("setting.upgrade.syp.doTip3")) - // isUpgrade = true - } else { - logMessage(t("setting.upgrade.syp.doTip4")) - } - - return { isUpgrade, logText } - } - - return { getSetting, updateSetting, checkKeyExists, deleteKey, checkAndUpgradeSetting } + return { getSetting, updateSetting, checkKeyExists, deleteKey } }) diff --git a/src/utils/import/pre.ts b/src/utils/import/pre.ts index 5499c1d..65b1455 100644 --- a/src/utils/import/pre.ts +++ b/src/utils/import/pre.ts @@ -95,7 +95,8 @@ export const pre = { platformName: "知乎", platformIcon: svgIcons.iconIFZhihu, authMode: AuthMode.WEBSITE, - isEnabled: false + authUrl: "https://www.zhihu.com/signin", + isEnabled: false, }, ], } diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 524e130..3434338 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -25,7 +25,7 @@ import { AppInstance } from "~/src/appInstance.ts" import { createAppLogger } from "~/src/utils/appLogger.ts" -import { BlogAdaptor } from "zhi-blog-api" +import { BlogAdaptor, WebAdaptor } from "zhi-blog-api" import { StrUtil } from "zhi-common" /** @@ -40,17 +40,30 @@ export class Utils { public static blogApi(appInstance: AppInstance, apiAdaptor: any) { if (!apiAdaptor) { - throw new Error("ApiAdaptor cannot be null") + throw new Error("apiAdaptor cannot be null") } if (!apiAdaptor.getUsersBlogs) { - this.logger.error("ApiAdaptor must implements BlogApi", apiAdaptor) - throw new Error(`ApiAdaptor must implements BlogApi => ${this.getObjectName(apiAdaptor)}`) + this.logger.error("apiAdaptor must implements BlogApi", apiAdaptor) + throw new Error(`apiAdaptor must implements BlogApi => ${this.getObjectName(apiAdaptor)}`) } return new BlogAdaptor(apiAdaptor) } + public static webApi(appInstance: AppInstance, webAdaptor: any) { + if (!webAdaptor) { + throw new Error("webAdaptor cannot be null") + } + + if (!webAdaptor.getMetaData) { + this.logger.error("webAdaptor must implements WebApi", webAdaptor) + throw new Error(`webAdaptor must implements WebApi => ${this.getObjectName(webAdaptor)}`) + } + + return new WebAdaptor(webAdaptor) + } + private static getObjectName(obj) { try { // 判断是否为类 @@ -79,7 +92,7 @@ export class Utils { } } - public static emptyOrDefault(value, defaultValue) { + public static emptyOrDefault(value: any, defaultValue: any) { return StrUtil.isEmptyString(value) ? defaultValue : value } } diff --git a/src/adaptors/web/index.ts b/src/utils/widgetUtils.ts similarity index 79% rename from src/adaptors/web/index.ts rename to src/utils/widgetUtils.ts index 0463300..d62a939 100644 --- a/src/adaptors/web/index.ts +++ b/src/utils/widgetUtils.ts @@ -22,4 +22,17 @@ * or visit www.terwer.space if you need additional information or have any * questions. */ +import { useSiyuanDevice } from "~/src/composables/useSiyuanDevice.ts" +/** + * 打开网页弹窗 + */ +export const openBrowserWindow = (url: string) => { + const { isInSiyuanWidget } = useSiyuanDevice() + + if (isInSiyuanWidget()) { + alert(`${url}=>当前挂件模式`) + } else { + window.open(url) + } +}