@mx-space/api-client 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/esm/adaptors/axios.d.ts +4 -0
- package/esm/adaptors/axios.js +37 -0
- package/esm/adaptors/axios.js.map +1 -0
- package/esm/adaptors/ky.d.ts +23 -0
- package/esm/adaptors/ky.js +62 -0
- package/esm/adaptors/ky.js.map +1 -0
- package/esm/adaptors/umi-request.d.ts +4 -0
- package/esm/adaptors/umi-request.js +31 -0
- package/esm/adaptors/umi-request.js.map +1 -0
- package/esm/controllers/aggregate.d.ts +64 -0
- package/esm/controllers/aggregate.js +42 -0
- package/esm/controllers/aggregate.js.map +1 -0
- package/esm/controllers/base.d.ts +43 -0
- package/esm/controllers/base.js +27 -0
- package/esm/controllers/base.js.map +1 -0
- package/esm/controllers/category.d.ts +114 -0
- package/esm/controllers/category.js +68 -0
- package/esm/controllers/category.js.map +1 -0
- package/esm/controllers/comment.d.ts +81 -0
- package/esm/controllers/comment.js +47 -0
- package/esm/controllers/comment.js.map +1 -0
- package/esm/controllers/index.d.ts +18 -0
- package/esm/controllers/index.js +55 -0
- package/esm/controllers/index.js.map +1 -0
- package/esm/controllers/link.d.ts +20 -0
- package/esm/controllers/link.js +21 -0
- package/esm/controllers/link.js.map +1 -0
- package/esm/controllers/note.d.ts +123 -0
- package/esm/controllers/note.js +68 -0
- package/esm/controllers/note.js.map +1 -0
- package/esm/controllers/page.d.ts +59 -0
- package/esm/controllers/page.js +42 -0
- package/esm/controllers/page.js.map +1 -0
- package/esm/controllers/post.d.ts +72 -0
- package/esm/controllers/post.js +52 -0
- package/esm/controllers/post.js.map +1 -0
- package/esm/controllers/project.d.ts +15 -0
- package/esm/controllers/project.js +12 -0
- package/esm/controllers/project.js.map +1 -0
- package/esm/controllers/recently.d.ts +61 -0
- package/esm/controllers/recently.js +31 -0
- package/esm/controllers/recently.js.map +1 -0
- package/esm/controllers/say.d.ts +37 -0
- package/esm/controllers/say.js +21 -0
- package/esm/controllers/say.js.map +1 -0
- package/esm/controllers/search.d.ts +247 -0
- package/esm/controllers/search.js +28 -0
- package/esm/controllers/search.js.map +1 -0
- package/esm/controllers/severless.d.ts +24 -0
- package/esm/controllers/severless.js +16 -0
- package/esm/controllers/severless.js.map +1 -0
- package/esm/controllers/snippet.d.ts +24 -0
- package/esm/controllers/snippet.js +19 -0
- package/esm/controllers/snippet.js.map +1 -0
- package/esm/controllers/topic.d.ts +26 -0
- package/esm/controllers/topic.js +18 -0
- package/esm/controllers/topic.js.map +1 -0
- package/esm/controllers/user.d.ts +70 -0
- package/esm/controllers/user.js +40 -0
- package/esm/controllers/user.js.map +1 -0
- package/esm/core/attach-request.d.ts +2 -0
- package/esm/core/attach-request.js +36 -0
- package/esm/core/attach-request.js.map +1 -0
- package/esm/core/client.d.ts +29 -0
- package/esm/core/client.js +186 -0
- package/esm/core/client.js.map +1 -0
- package/esm/core/error.d.ts +6 -0
- package/esm/core/error.js +9 -0
- package/esm/core/error.js.map +1 -0
- package/esm/core/index.d.ts +2 -0
- package/esm/core/index.js +3 -0
- package/esm/core/index.js.map +1 -0
- package/esm/dtos/comment.d.ts +6 -0
- package/esm/dtos/comment.js +3 -0
- package/esm/dtos/comment.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +8 -0
- package/esm/index.js.map +1 -0
- package/esm/interfaces/adapter.d.ts +14 -0
- package/esm/interfaces/adapter.js +2 -0
- package/esm/interfaces/adapter.js.map +1 -0
- package/esm/interfaces/client.d.ts +13 -0
- package/esm/interfaces/client.js +2 -0
- package/esm/interfaces/client.js.map +1 -0
- package/esm/interfaces/controller.d.ts +4 -0
- package/esm/interfaces/controller.js +2 -0
- package/esm/interfaces/controller.js.map +1 -0
- package/esm/interfaces/instance.d.ts +7 -0
- package/esm/interfaces/instance.js +2 -0
- package/esm/interfaces/instance.js.map +1 -0
- package/esm/interfaces/options.d.ts +1 -0
- package/esm/interfaces/options.js +2 -0
- package/esm/interfaces/options.js.map +1 -0
- package/esm/interfaces/params.d.ts +4 -0
- package/esm/interfaces/params.js +2 -0
- package/esm/interfaces/params.js.map +1 -0
- package/esm/interfaces/request.d.ts +43 -0
- package/esm/interfaces/request.js +2 -0
- package/esm/interfaces/request.js.map +1 -0
- package/esm/interfaces/types.d.ts +2 -0
- package/esm/interfaces/types.js +2 -0
- package/esm/interfaces/types.js.map +1 -0
- package/esm/models/aggregate.d.ts +53 -0
- package/esm/models/aggregate.js +6 -0
- package/esm/models/aggregate.js.map +1 -0
- package/esm/models/base.d.ts +41 -0
- package/esm/models/base.js +2 -0
- package/esm/models/base.js.map +1 -0
- package/esm/models/category.d.ts +22 -0
- package/esm/models/category.js +6 -0
- package/esm/models/category.js.map +1 -0
- package/esm/models/comment.d.ts +37 -0
- package/esm/models/comment.js +13 -0
- package/esm/models/comment.js.map +1 -0
- package/esm/models/index.d.ts +14 -0
- package/esm/models/index.js +15 -0
- package/esm/models/index.js.map +1 -0
- package/esm/models/link.d.ts +22 -0
- package/esm/models/link.js +14 -0
- package/esm/models/link.js.map +1 -0
- package/esm/models/note.d.ts +38 -0
- package/esm/models/note.js +2 -0
- package/esm/models/note.js.map +1 -0
- package/esm/models/page.d.ts +14 -0
- package/esm/models/page.js +7 -0
- package/esm/models/page.js.map +1 -0
- package/esm/models/post.d.ts +17 -0
- package/esm/models/post.js +2 -0
- package/esm/models/post.js.map +1 -0
- package/esm/models/project.d.ts +11 -0
- package/esm/models/project.js +2 -0
- package/esm/models/project.js.map +1 -0
- package/esm/models/recently.d.ts +20 -0
- package/esm/models/recently.js +7 -0
- package/esm/models/recently.js.map +1 -0
- package/esm/models/say.d.ts +6 -0
- package/esm/models/say.js +2 -0
- package/esm/models/say.js.map +1 -0
- package/esm/models/setting.d.ts +66 -0
- package/esm/models/setting.js +2 -0
- package/esm/models/setting.js.map +1 -0
- package/esm/models/snippet.d.ts +18 -0
- package/esm/models/snippet.js +8 -0
- package/esm/models/snippet.js.map +1 -0
- package/esm/models/topic.d.ts +8 -0
- package/esm/models/topic.js +2 -0
- package/esm/models/topic.js.map +1 -0
- package/esm/models/user.d.ts +21 -0
- package/esm/models/user.js +2 -0
- package/esm/models/user.js.map +1 -0
- package/esm/utils/auto-bind.d.ts +4 -0
- package/esm/utils/auto-bind.js +36 -0
- package/esm/utils/auto-bind.js.map +1 -0
- package/esm/utils/camelcase-keys.d.ts +6 -0
- package/esm/utils/camelcase-keys.js +23 -0
- package/esm/utils/camelcase-keys.js.map +1 -0
- package/esm/utils/index.d.ts +5 -0
- package/esm/utils/index.js +43 -0
- package/esm/utils/index.js.map +1 -0
- package/esm/utils/path.d.ts +1 -0
- package/esm/utils/path.js +7 -0
- package/esm/utils/path.js.map +1 -0
- package/esm/vitest.config.d.ts +2 -0
- package/esm/vitest.config.js +12 -0
- package/esm/vitest.config.js.map +1 -0
- package/lib/adaptors/axios.d.ts +4 -0
- package/lib/adaptors/axios.js +43 -0
- package/lib/adaptors/axios.js.map +1 -0
- package/lib/adaptors/ky.d.ts +23 -0
- package/lib/adaptors/ky.js +69 -0
- package/lib/adaptors/ky.js.map +1 -0
- package/lib/adaptors/umi-request.d.ts +4 -0
- package/lib/adaptors/umi-request.js +34 -0
- package/lib/adaptors/umi-request.js.map +1 -0
- package/lib/controllers/aggregate.d.ts +64 -0
- package/lib/controllers/aggregate.js +46 -0
- package/lib/controllers/aggregate.js.map +1 -0
- package/lib/controllers/base.d.ts +43 -0
- package/lib/controllers/base.js +31 -0
- package/lib/controllers/base.js.map +1 -0
- package/lib/controllers/category.d.ts +114 -0
- package/lib/controllers/category.js +72 -0
- package/lib/controllers/category.js.map +1 -0
- package/lib/controllers/comment.d.ts +81 -0
- package/lib/controllers/comment.js +51 -0
- package/lib/controllers/comment.js.map +1 -0
- package/lib/controllers/index.d.ts +18 -0
- package/lib/controllers/index.js +72 -0
- package/lib/controllers/index.js.map +1 -0
- package/lib/controllers/link.d.ts +20 -0
- package/lib/controllers/link.js +25 -0
- package/lib/controllers/link.js.map +1 -0
- package/lib/controllers/note.d.ts +123 -0
- package/lib/controllers/note.js +72 -0
- package/lib/controllers/note.js.map +1 -0
- package/lib/controllers/page.d.ts +59 -0
- package/lib/controllers/page.js +46 -0
- package/lib/controllers/page.js.map +1 -0
- package/lib/controllers/post.d.ts +72 -0
- package/lib/controllers/post.js +56 -0
- package/lib/controllers/post.js.map +1 -0
- package/lib/controllers/project.d.ts +15 -0
- package/lib/controllers/project.js +16 -0
- package/lib/controllers/project.js.map +1 -0
- package/lib/controllers/recently.d.ts +61 -0
- package/lib/controllers/recently.js +35 -0
- package/lib/controllers/recently.js.map +1 -0
- package/lib/controllers/say.d.ts +37 -0
- package/lib/controllers/say.js +25 -0
- package/lib/controllers/say.js.map +1 -0
- package/lib/controllers/search.d.ts +247 -0
- package/lib/controllers/search.js +32 -0
- package/lib/controllers/search.js.map +1 -0
- package/lib/controllers/severless.d.ts +24 -0
- package/lib/controllers/severless.js +20 -0
- package/lib/controllers/severless.js.map +1 -0
- package/lib/controllers/snippet.d.ts +24 -0
- package/lib/controllers/snippet.js +23 -0
- package/lib/controllers/snippet.js.map +1 -0
- package/lib/controllers/topic.d.ts +26 -0
- package/lib/controllers/topic.js +22 -0
- package/lib/controllers/topic.js.map +1 -0
- package/lib/controllers/user.d.ts +70 -0
- package/lib/controllers/user.js +44 -0
- package/lib/controllers/user.js.map +1 -0
- package/lib/core/attach-request.d.ts +2 -0
- package/lib/core/attach-request.js +40 -0
- package/lib/core/attach-request.js.map +1 -0
- package/lib/core/client.d.ts +29 -0
- package/lib/core/client.js +190 -0
- package/lib/core/client.js.map +1 -0
- package/lib/core/error.d.ts +6 -0
- package/lib/core/error.js +13 -0
- package/lib/core/error.js.map +1 -0
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +19 -0
- package/lib/core/index.js.map +1 -0
- package/lib/dtos/comment.d.ts +6 -0
- package/lib/dtos/comment.js +7 -0
- package/lib/dtos/comment.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +28 -0
- package/lib/index.js.map +1 -0
- package/lib/interfaces/adapter.d.ts +14 -0
- package/lib/interfaces/adapter.js +3 -0
- package/lib/interfaces/adapter.js.map +1 -0
- package/lib/interfaces/client.d.ts +13 -0
- package/lib/interfaces/client.js +3 -0
- package/lib/interfaces/client.js.map +1 -0
- package/lib/interfaces/controller.d.ts +4 -0
- package/lib/interfaces/controller.js +3 -0
- package/lib/interfaces/controller.js.map +1 -0
- package/lib/interfaces/instance.d.ts +7 -0
- package/lib/interfaces/instance.js +3 -0
- package/lib/interfaces/instance.js.map +1 -0
- package/lib/interfaces/options.d.ts +1 -0
- package/lib/interfaces/options.js +3 -0
- package/lib/interfaces/options.js.map +1 -0
- package/lib/interfaces/params.d.ts +4 -0
- package/lib/interfaces/params.js +3 -0
- package/lib/interfaces/params.js.map +1 -0
- package/lib/interfaces/request.d.ts +43 -0
- package/lib/interfaces/request.js +3 -0
- package/lib/interfaces/request.js.map +1 -0
- package/lib/interfaces/types.d.ts +2 -0
- package/lib/interfaces/types.js +3 -0
- package/lib/interfaces/types.js.map +1 -0
- package/lib/models/aggregate.d.ts +53 -0
- package/lib/models/aggregate.js +9 -0
- package/lib/models/aggregate.js.map +1 -0
- package/lib/models/base.d.ts +41 -0
- package/lib/models/base.js +3 -0
- package/lib/models/base.js.map +1 -0
- package/lib/models/category.d.ts +22 -0
- package/lib/models/category.js +9 -0
- package/lib/models/category.js.map +1 -0
- package/lib/models/comment.d.ts +37 -0
- package/lib/models/comment.js +16 -0
- package/lib/models/comment.js.map +1 -0
- package/lib/models/index.d.ts +14 -0
- package/lib/models/index.js +31 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/link.d.ts +22 -0
- package/lib/models/link.js +17 -0
- package/lib/models/link.js.map +1 -0
- package/lib/models/note.d.ts +38 -0
- package/lib/models/note.js +3 -0
- package/lib/models/note.js.map +1 -0
- package/lib/models/page.d.ts +14 -0
- package/lib/models/page.js +10 -0
- package/lib/models/page.js.map +1 -0
- package/lib/models/post.d.ts +17 -0
- package/lib/models/post.js +3 -0
- package/lib/models/post.js.map +1 -0
- package/lib/models/project.d.ts +11 -0
- package/lib/models/project.js +3 -0
- package/lib/models/project.js.map +1 -0
- package/lib/models/recently.d.ts +20 -0
- package/lib/models/recently.js +10 -0
- package/lib/models/recently.js.map +1 -0
- package/lib/models/say.d.ts +6 -0
- package/lib/models/say.js +3 -0
- package/lib/models/say.js.map +1 -0
- package/lib/models/setting.d.ts +66 -0
- package/lib/models/setting.js +3 -0
- package/lib/models/setting.js.map +1 -0
- package/lib/models/snippet.d.ts +18 -0
- package/lib/models/snippet.js +11 -0
- package/lib/models/snippet.js.map +1 -0
- package/lib/models/topic.d.ts +8 -0
- package/lib/models/topic.js +3 -0
- package/lib/models/topic.js.map +1 -0
- package/lib/models/user.d.ts +21 -0
- package/lib/models/user.js +3 -0
- package/lib/models/user.js.map +1 -0
- package/lib/utils/auto-bind.d.ts +4 -0
- package/lib/utils/auto-bind.js +40 -0
- package/lib/utils/auto-bind.js.map +1 -0
- package/lib/utils/camelcase-keys.d.ts +6 -0
- package/lib/utils/camelcase-keys.js +28 -0
- package/lib/utils/camelcase-keys.js.map +1 -0
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.js +50 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/path.d.ts +1 -0
- package/lib/utils/path.js +11 -0
- package/lib/utils/path.js.map +1 -0
- package/lib/vitest.config.d.ts +2 -0
- package/lib/vitest.config.js +17 -0
- package/lib/vitest.config.js.map +1 -0
- package/package.json +25 -12
- package/types/adaptors/axios.d.ts +4 -0
- package/types/adaptors/ky.d.ts +23 -0
- package/types/adaptors/umi-request.d.ts +4 -0
- package/types/controllers/aggregate.d.ts +64 -0
- package/types/controllers/base.d.ts +43 -0
- package/types/controllers/category.d.ts +114 -0
- package/types/controllers/comment.d.ts +81 -0
- package/types/controllers/index.d.ts +18 -0
- package/types/controllers/link.d.ts +20 -0
- package/types/controllers/note.d.ts +123 -0
- package/types/controllers/page.d.ts +59 -0
- package/types/controllers/post.d.ts +72 -0
- package/types/controllers/project.d.ts +15 -0
- package/types/controllers/recently.d.ts +61 -0
- package/types/controllers/say.d.ts +37 -0
- package/types/controllers/search.d.ts +247 -0
- package/types/controllers/severless.d.ts +24 -0
- package/types/controllers/snippet.d.ts +24 -0
- package/types/controllers/topic.d.ts +26 -0
- package/types/controllers/user.d.ts +70 -0
- package/types/core/attach-request.d.ts +2 -0
- package/types/core/client.d.ts +29 -0
- package/types/core/error.d.ts +6 -0
- package/types/core/index.d.ts +2 -0
- package/types/dtos/comment.d.ts +6 -0
- package/types/index.d.ts +7 -0
- package/types/interfaces/adapter.d.ts +14 -0
- package/types/interfaces/client.d.ts +13 -0
- package/types/interfaces/controller.d.ts +4 -0
- package/types/interfaces/instance.d.ts +7 -0
- package/types/interfaces/options.d.ts +1 -0
- package/types/interfaces/params.d.ts +4 -0
- package/types/interfaces/request.d.ts +43 -0
- package/types/interfaces/types.d.ts +2 -0
- package/types/models/aggregate.d.ts +53 -0
- package/types/models/base.d.ts +41 -0
- package/types/models/category.d.ts +22 -0
- package/types/models/comment.d.ts +37 -0
- package/types/models/index.d.ts +14 -0
- package/types/models/link.d.ts +22 -0
- package/types/models/note.d.ts +38 -0
- package/types/models/page.d.ts +14 -0
- package/types/models/post.d.ts +17 -0
- package/types/models/project.d.ts +11 -0
- package/types/models/recently.d.ts +20 -0
- package/types/models/say.d.ts +6 -0
- package/types/models/setting.d.ts +66 -0
- package/types/models/snippet.d.ts +18 -0
- package/types/models/topic.d.ts +8 -0
- package/types/models/user.d.ts +21 -0
- package/types/utils/auto-bind.d.ts +4 -0
- package/types/utils/camelcase-keys.d.ts +6 -0
- package/types/utils/index.d.ts +5 -0
- package/types/utils/path.d.ts +1 -0
- package/types/vitest.config.d.ts +2 -0
- package/__tests__/adaptors/axios.spec.ts +0 -7
- package/__tests__/adaptors/ky.spec.ts +0 -9
- package/__tests__/adaptors/umi-request.spec.ts +0 -7
- package/__tests__/contronllers/aggregate.test.ts +0 -389
- package/__tests__/contronllers/category.test.ts +0 -284
- package/__tests__/contronllers/comment.test.ts +0 -113
- package/__tests__/contronllers/link.test.ts +0 -95
- package/__tests__/contronllers/note.test.ts +0 -120
- package/__tests__/contronllers/page.test.ts +0 -49
- package/__tests__/contronllers/post.test.ts +0 -77
- package/__tests__/contronllers/recently.test.ts +0 -49
- package/__tests__/contronllers/say.test.ts +0 -106
- package/__tests__/contronllers/search.test.ts +0 -81
- package/__tests__/contronllers/serverless.test.ts +0 -19
- package/__tests__/contronllers/snippet.test.ts +0 -38
- package/__tests__/contronllers/topic.test.ts +0 -17
- package/__tests__/contronllers/user.test.ts +0 -59
- package/__tests__/core/client.test.ts +0 -293
- package/__tests__/helpers/adaptor-test.ts +0 -108
- package/__tests__/helpers/e2e-mock-server.ts +0 -22
- package/__tests__/helpers/global-fetch.ts +0 -39
- package/__tests__/helpers/instance.ts +0 -11
- package/__tests__/helpers/response.ts +0 -76
- package/__tests__/mock/algolia.json +0 -446
- package/__tests__/utils/auto-bind.spec.ts +0 -27
- package/__tests__/utils/camelcase-keys.spec.ts +0 -86
- package/__tests__/utils/index.test.ts +0 -33
- package/__tests__/utils/path.spec.ts +0 -8
- package/adaptors/axios.ts +0 -44
- package/adaptors/ky.ts +0 -76
- package/adaptors/umi-request.ts +0 -38
- package/core/attach-request.ts +0 -43
- package/core/client.ts +0 -252
- package/core/error.ts +0 -10
- package/core/index.ts +0 -2
- package/coverage/lcov-report/__tests__/helpers/adaptor-test.ts.html +0 -405
- package/coverage/lcov-report/__tests__/helpers/e2e-mock-server.ts.html +0 -150
- package/coverage/lcov-report/__tests__/helpers/index.html +0 -236
- package/coverage/lcov-report/__tests__/helpers/instance.ts.html +0 -120
- package/coverage/lcov-report/__tests__/helpers/response.ts.html +0 -231
- package/rollup.config.js +0 -150
- package/utils/auto-bind.ts +0 -48
- package/utils/camelcase-keys.ts +0 -26
- package/utils/index.ts +0 -53
- package/utils/path.ts +0 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Count, Image, TextBaseModel } from './base';
|
|
2
|
+
import { CategoryModel } from './category';
|
|
3
|
+
export interface PostModel extends TextBaseModel {
|
|
4
|
+
summary?: string;
|
|
5
|
+
copyright: boolean;
|
|
6
|
+
tags: string[];
|
|
7
|
+
count: Count;
|
|
8
|
+
text: string;
|
|
9
|
+
title: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
categoryId: string;
|
|
12
|
+
images: Image[];
|
|
13
|
+
category: CategoryModel;
|
|
14
|
+
pin?: string | null;
|
|
15
|
+
pinOrder?: number;
|
|
16
|
+
related?: Pick<PostModel, 'id' | 'category' | 'categoryId' | 'created' | 'modified' | 'title' | 'slug' | 'summary'>[];
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../models/post.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../models/project.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommentIndexModel } from './base';
|
|
2
|
+
export declare enum RecentlyRefTypes {
|
|
3
|
+
Post = "Post",
|
|
4
|
+
Note = "Note",
|
|
5
|
+
Page = "Page"
|
|
6
|
+
}
|
|
7
|
+
export type RecentlyRefType = {
|
|
8
|
+
title: string;
|
|
9
|
+
url: string;
|
|
10
|
+
};
|
|
11
|
+
export interface RecentlyModel extends BaseCommentIndexModel {
|
|
12
|
+
content: string;
|
|
13
|
+
ref?: RecentlyRefType & {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
refId?: string;
|
|
17
|
+
refType?: RecentlyRefTypes;
|
|
18
|
+
up: number;
|
|
19
|
+
down: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RecentlyRefTypes = void 0;
|
|
4
|
+
var RecentlyRefTypes;
|
|
5
|
+
(function (RecentlyRefTypes) {
|
|
6
|
+
RecentlyRefTypes["Post"] = "Post";
|
|
7
|
+
RecentlyRefTypes["Note"] = "Note";
|
|
8
|
+
RecentlyRefTypes["Page"] = "Page";
|
|
9
|
+
})(RecentlyRefTypes = exports.RecentlyRefTypes || (exports.RecentlyRefTypes = {}));
|
|
10
|
+
//# sourceMappingURL=recently.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently.js","sourceRoot":"","sources":["../../models/recently.ts"],"names":[],"mappings":";;;AAEA,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,iCAAa,CAAA;IACb,iCAAa,CAAA;AACf,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../models/say.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare class SeoOptionModel {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
keywords?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare class UrlOptionModel {
|
|
8
|
+
webUrl: string;
|
|
9
|
+
adminUrl: string;
|
|
10
|
+
serverUrl: string;
|
|
11
|
+
wsUrl: string;
|
|
12
|
+
}
|
|
13
|
+
declare class MailOptionModel {
|
|
14
|
+
port: number;
|
|
15
|
+
host: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class MailOptionsModel {
|
|
18
|
+
enable: boolean;
|
|
19
|
+
user: string;
|
|
20
|
+
pass: string;
|
|
21
|
+
options?: MailOptionModel;
|
|
22
|
+
}
|
|
23
|
+
export declare class CommentOptionsModel {
|
|
24
|
+
antiSpam: boolean;
|
|
25
|
+
spamKeywords?: string[];
|
|
26
|
+
blockIps?: string[];
|
|
27
|
+
disableNoChinese?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare class BackupOptionsModel {
|
|
30
|
+
enable: boolean;
|
|
31
|
+
secretId?: string;
|
|
32
|
+
secretKey?: string;
|
|
33
|
+
bucket?: string;
|
|
34
|
+
region: string;
|
|
35
|
+
}
|
|
36
|
+
export declare class BaiduSearchOptionsModel {
|
|
37
|
+
enable: boolean;
|
|
38
|
+
token?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare class AlgoliaSearchOptionsModel {
|
|
41
|
+
enable: boolean;
|
|
42
|
+
apiKey?: string;
|
|
43
|
+
appId?: string;
|
|
44
|
+
indexName?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare class AdminExtraModel {
|
|
47
|
+
background?: string;
|
|
48
|
+
gaodemapKey?: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
/**
|
|
51
|
+
* 是否开启后台反代访问
|
|
52
|
+
*/
|
|
53
|
+
enableAdminProxy?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface IConfig {
|
|
56
|
+
seo: SeoOptionModel;
|
|
57
|
+
url: UrlOptionModel;
|
|
58
|
+
mailOptions: MailOptionsModel;
|
|
59
|
+
commentOptions: CommentOptionsModel;
|
|
60
|
+
backupOptions: BackupOptionsModel;
|
|
61
|
+
baiduSearchOptions: BaiduSearchOptionsModel;
|
|
62
|
+
algoliaSearchOptions: AlgoliaSearchOptionsModel;
|
|
63
|
+
adminExtra: AdminExtraModel;
|
|
64
|
+
}
|
|
65
|
+
export declare type IConfigKeys = keyof IConfig;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting.js","sourceRoot":"","sources":["../../models/setting.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export declare enum SnippetType {
|
|
3
|
+
JSON = "json",
|
|
4
|
+
Function = "function",
|
|
5
|
+
Text = "text",
|
|
6
|
+
YAML = "yaml"
|
|
7
|
+
}
|
|
8
|
+
export interface SnippetModel<T = unknown> extends BaseModel {
|
|
9
|
+
type: SnippetType;
|
|
10
|
+
private: boolean;
|
|
11
|
+
raw: string;
|
|
12
|
+
name: string;
|
|
13
|
+
reference: string;
|
|
14
|
+
comment?: string;
|
|
15
|
+
metatype?: string;
|
|
16
|
+
schema?: string;
|
|
17
|
+
data: T;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SnippetType = void 0;
|
|
4
|
+
var SnippetType;
|
|
5
|
+
(function (SnippetType) {
|
|
6
|
+
SnippetType["JSON"] = "json";
|
|
7
|
+
SnippetType["Function"] = "function";
|
|
8
|
+
SnippetType["Text"] = "text";
|
|
9
|
+
SnippetType["YAML"] = "yaml";
|
|
10
|
+
})(SnippetType = exports.SnippetType || (exports.SnippetType = {}));
|
|
11
|
+
//# sourceMappingURL=snippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../models/snippet.ts"],"names":[],"mappings":";;;AAEA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic.js","sourceRoot":"","sources":["../../models/topic.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export interface UserModel extends BaseModel {
|
|
3
|
+
introduce: string;
|
|
4
|
+
mail: string;
|
|
5
|
+
url: string;
|
|
6
|
+
name: string;
|
|
7
|
+
socialIds: Record<string, string>;
|
|
8
|
+
username: string;
|
|
9
|
+
modified: string;
|
|
10
|
+
v: number;
|
|
11
|
+
lastLoginTime: string;
|
|
12
|
+
lastLoginIp?: string;
|
|
13
|
+
avatar: string;
|
|
14
|
+
postID: string;
|
|
15
|
+
}
|
|
16
|
+
export type TLogin = {
|
|
17
|
+
token: string;
|
|
18
|
+
expiresIn: number;
|
|
19
|
+
lastLoginTime: null | string;
|
|
20
|
+
lastLoginIp?: null | string;
|
|
21
|
+
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../models/user.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// @copy: https://github.com/sindresorhus/auto-bind/blob/main/index.js
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.autoBind = void 0;
|
|
6
|
+
// Gets all non-builtin properties up the prototype chain.
|
|
7
|
+
const getAllProperties = (object) => {
|
|
8
|
+
const properties = new Set();
|
|
9
|
+
do {
|
|
10
|
+
for (const key of Reflect.ownKeys(object)) {
|
|
11
|
+
properties.add([object, key]);
|
|
12
|
+
}
|
|
13
|
+
} while ((object = Reflect.getPrototypeOf(object)) &&
|
|
14
|
+
object !== Object.prototype);
|
|
15
|
+
return properties;
|
|
16
|
+
};
|
|
17
|
+
function autoBind(self, { include, exclude } = {}) {
|
|
18
|
+
const filter = (key) => {
|
|
19
|
+
const match = (pattern) => typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
|
20
|
+
if (include) {
|
|
21
|
+
return include.some(match);
|
|
22
|
+
}
|
|
23
|
+
if (exclude) {
|
|
24
|
+
return !exclude.some(match);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
28
|
+
for (const [object, key] of getAllProperties(self.constructor.prototype)) {
|
|
29
|
+
if (key === 'constructor' || !filter(key)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(object, key);
|
|
33
|
+
if (descriptor && typeof descriptor.value === 'function') {
|
|
34
|
+
self[key] = self[key].bind(self);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return self;
|
|
38
|
+
}
|
|
39
|
+
exports.autoBind = autoBind;
|
|
40
|
+
//# sourceMappingURL=auto-bind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-bind.js","sourceRoot":"","sources":["../../utils/auto-bind.ts"],"names":[],"mappings":";AAAA,cAAc;AACd,sEAAsE;;;AAEtE,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,EAAE;IAClC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;IAE5B,GAAG;QACD,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACzC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;SAC9B;KACF,QACC,CAAC,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,KAAK,MAAM,CAAC,SAAS,EAC5B;IAED,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AAED,SAAgB,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE;IACtD,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,EAAE;QACrB,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,EAAE,CACxB,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEnE,IAAI,OAAO,EAAE;YACX,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC3B;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC5B;QAED,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;QACxE,IAAI,GAAG,KAAK,aAAa,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YACzC,SAAQ;SACT;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAChE,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,EAAE;YACxD,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACjC;KACF;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AA5BD,4BA4BC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple camelCase function that only handles strings, but not handling symbol, date, or other complex case.
|
|
3
|
+
* If you need to handle more complex cases, please use camelcase-keys package.
|
|
4
|
+
*/
|
|
5
|
+
export declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
6
|
+
export declare function camelcase(str: string): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.camelcase = exports.camelcaseKeys = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
/**
|
|
6
|
+
* A simple camelCase function that only handles strings, but not handling symbol, date, or other complex case.
|
|
7
|
+
* If you need to handle more complex cases, please use camelcase-keys package.
|
|
8
|
+
*/
|
|
9
|
+
const camelcaseKeys = (obj) => {
|
|
10
|
+
if (Array.isArray(obj)) {
|
|
11
|
+
return obj.map((x) => (0, exports.camelcaseKeys)(x));
|
|
12
|
+
}
|
|
13
|
+
if ((0, _1.isPlainObject)(obj)) {
|
|
14
|
+
return Object.keys(obj).reduce((result, key) => {
|
|
15
|
+
result[camelcase(key)] = (0, exports.camelcaseKeys)(obj[key]);
|
|
16
|
+
return result;
|
|
17
|
+
}, {});
|
|
18
|
+
}
|
|
19
|
+
return obj;
|
|
20
|
+
};
|
|
21
|
+
exports.camelcaseKeys = camelcaseKeys;
|
|
22
|
+
function camelcase(str) {
|
|
23
|
+
return str.replace(/([-_][a-z])/gi, ($1) => {
|
|
24
|
+
return $1.toUpperCase().replace('-', '').replace('_', '');
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.camelcase = camelcase;
|
|
28
|
+
//# sourceMappingURL=camelcase-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camelcase-keys.js","sourceRoot":"","sources":["../../utils/camelcase-keys.ts"],"names":[],"mappings":";;;AAAA,wBAAiC;AAEjC;;;GAGG;AACI,MAAM,aAAa,GAAG,CAAU,GAAQ,EAAK,EAAE;IACpD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,CAAC,CAAC,CAAQ,CAAA;KAC/C;IAED,IAAI,IAAA,gBAAa,EAAC,GAAG,CAAC,EAAE;QACtB,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,GAAG,EAAE,EAAE;YAClD,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,IAAA,qBAAa,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;YAChD,OAAO,MAAM,CAAA;QACf,CAAC,EAAE,EAAE,CAAQ,CAAA;KACd;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAbY,QAAA,aAAa,iBAazB;AAED,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE;QACzC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAC3D,CAAC,CAAC,CAAA;AACJ,CAAC;AAJD,8BAIC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SortOrder } from '../interfaces/options';
|
|
2
|
+
export declare const isPlainObject: (obj: any) => any;
|
|
3
|
+
export declare const sortOrderToNumber: (order: SortOrder) => number;
|
|
4
|
+
export declare const destructureData: (payload: any) => any;
|
|
5
|
+
export declare const attachRawFromOneToAnthor: (from: any, to: any) => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attachRawFromOneToAnthor = exports.destructureData = exports.sortOrderToNumber = exports.isPlainObject = void 0;
|
|
4
|
+
const isPlainObject = (obj) => isObject(obj) &&
|
|
5
|
+
Object.prototype.toString.call(obj) === '[object Object]' &&
|
|
6
|
+
Object.getPrototypeOf(obj) === Object.prototype;
|
|
7
|
+
exports.isPlainObject = isPlainObject;
|
|
8
|
+
const sortOrderToNumber = (order) => {
|
|
9
|
+
return ({
|
|
10
|
+
asc: 1,
|
|
11
|
+
desc: -1,
|
|
12
|
+
}[order] || 1);
|
|
13
|
+
};
|
|
14
|
+
exports.sortOrderToNumber = sortOrderToNumber;
|
|
15
|
+
const isObject = (obj) => obj && typeof obj === 'object';
|
|
16
|
+
const destructureData = (payload) => {
|
|
17
|
+
if (typeof payload !== 'object') {
|
|
18
|
+
return payload;
|
|
19
|
+
}
|
|
20
|
+
if (payload === null) {
|
|
21
|
+
return payload;
|
|
22
|
+
}
|
|
23
|
+
const data = payload.data;
|
|
24
|
+
const dataIsPlainObject = (0, exports.isPlainObject)(data);
|
|
25
|
+
if (dataIsPlainObject && Object.keys(payload).length === 1) {
|
|
26
|
+
const d = Object.assign({}, data);
|
|
27
|
+
// attach raw onto new data
|
|
28
|
+
(0, exports.attachRawFromOneToAnthor)(payload, d);
|
|
29
|
+
return d;
|
|
30
|
+
}
|
|
31
|
+
return payload;
|
|
32
|
+
};
|
|
33
|
+
exports.destructureData = destructureData;
|
|
34
|
+
const attachRawFromOneToAnthor = (from, to) => {
|
|
35
|
+
if (!from || !isObject(to)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
from.$raw &&
|
|
39
|
+
Object.defineProperty(to, '$raw', {
|
|
40
|
+
value: { ...from.$raw },
|
|
41
|
+
enumerable: false,
|
|
42
|
+
});
|
|
43
|
+
from.$request &&
|
|
44
|
+
Object.defineProperty(to, '$request', {
|
|
45
|
+
value: { ...from.$request },
|
|
46
|
+
enumerable: false,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.attachRawFromOneToAnthor = attachRawFromOneToAnthor;
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,GAAG,CAAC,GAAQ,EAAE,EAAE,CACxC,QAAQ,CAAC,GAAG,CAAC;IACb,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,iBAAiB;IACzD,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,SAAS,CAAA;AAHpC,QAAA,aAAa,iBAGuB;AAE1C,MAAM,iBAAiB,GAAG,CAAC,KAAgB,EAAE,EAAE;IACpD,OAAO,CACL;QACE,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC,CAAC;KACT,CAAC,KAAK,CAAC,IAAI,CAAC,CACd,CAAA;AACH,CAAC,CAAA;AAPY,QAAA,iBAAiB,qBAO7B;AACD,MAAM,QAAQ,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAA;AACtD,MAAM,eAAe,GAAG,CAAC,OAAY,EAAE,EAAE;IAC9C,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO,OAAO,CAAA;KACf;IACD,IAAI,OAAO,KAAK,IAAI,EAAE;QACpB,OAAO,OAAO,CAAA;KACf;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IAEzB,MAAM,iBAAiB,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAA;IAE7C,IAAI,iBAAiB,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QACjC,2BAA2B;QAC3B,IAAA,gCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QACpC,OAAO,CAAC,CAAA;KACT;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AApBY,QAAA,eAAe,mBAoB3B;AAEM,MAAM,wBAAwB,GAAG,CAAC,IAAS,EAAE,EAAO,EAAE,EAAE;IAC7D,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;QAC1B,OAAM;KACP;IACD,IAAI,CAAC,IAAI;QACP,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE;YAChC,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;YACvB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;IACJ,IAAI,CAAC,QAAQ;QACX,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE;YACpC,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;YAC3B,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;AACN,CAAC,CAAA;AAdY,QAAA,wBAAwB,4BAcpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resolveFullPath: (endpoint: string, path: string) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveFullPath = void 0;
|
|
4
|
+
const resolveFullPath = (endpoint, path) => {
|
|
5
|
+
if (!path.startsWith('/')) {
|
|
6
|
+
path = `/${path}`;
|
|
7
|
+
}
|
|
8
|
+
return `${endpoint}${path}`;
|
|
9
|
+
};
|
|
10
|
+
exports.resolveFullPath = resolveFullPath;
|
|
11
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../utils/path.ts"],"names":[],"mappings":";;;AAAO,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,IAAY,EAAE,EAAE;IAChE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACzB,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;KAClB;IACD,OAAO,GAAG,QAAQ,GAAG,IAAI,EAAE,CAAA;AAC7B,CAAC,CAAA;AALY,QAAA,eAAe,mBAK3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
|
|
7
|
+
const config_1 = require("vitest/config");
|
|
8
|
+
// eslint-disable-next-line import/no-default-export
|
|
9
|
+
exports.default = (0, config_1.defineConfig)({
|
|
10
|
+
test: {
|
|
11
|
+
globals: true,
|
|
12
|
+
include: ['__tests__/**/*.(spec|test).ts'],
|
|
13
|
+
},
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
plugins: [(0, vite_tsconfig_paths_1.default)()],
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=vitest.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.config.js","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";;;;;AAAA,8EAAwC;AACxC,0CAA4C;AAE5C,oDAAoD;AACpD,kBAAe,IAAA,qBAAY,EAAC;IAC1B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QAEb,OAAO,EAAE,CAAC,+BAA+B,CAAC;KAC3C;IAED,aAAa;IACb,OAAO,EAAE,CAAC,IAAA,6BAAM,GAAE,CAAC;CACpB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A api client for mx-space server@next",
|
|
6
6
|
"author": "Innei",
|
|
@@ -25,6 +25,19 @@
|
|
|
25
25
|
"import": "./dist/index.js",
|
|
26
26
|
"require": "./dist/index.cjs"
|
|
27
27
|
},
|
|
28
|
+
"./dist/*": {
|
|
29
|
+
"types": "./types/*.d.ts",
|
|
30
|
+
"import": "./dist/*.js",
|
|
31
|
+
"require": "./dist/*.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./dist/adaptors/*": {
|
|
34
|
+
"types": "./types/adaptors/*.d.ts",
|
|
35
|
+
"import": "./dist/adaptors/*.js",
|
|
36
|
+
"require": "./dist/adaptors/*.cjs"
|
|
37
|
+
},
|
|
38
|
+
"./types/*": {
|
|
39
|
+
"types": "./types/*.d.ts"
|
|
40
|
+
},
|
|
28
41
|
"./package.json": "./package.json",
|
|
29
42
|
"./adaptors/*": {
|
|
30
43
|
"types": "./types/adaptors/*.d.ts",
|
|
@@ -64,16 +77,6 @@
|
|
|
64
77
|
"engines": {
|
|
65
78
|
"pnpm": ">=6"
|
|
66
79
|
},
|
|
67
|
-
"scripts": {
|
|
68
|
-
"prebuild": "rm -rf lib && rm -rf esm",
|
|
69
|
-
"build": "tsc --build tsconfig.build.json && tsc --build tsconfig.cjs.json",
|
|
70
|
-
"postbuild": "tsc-alias -p tsconfig.build.json && tsc-alias -p tsconfig.cjs.json && npm run types",
|
|
71
|
-
"types": "rm -rf types && tsc --build tsconfig.types.json && tsc-alias -p tsconfig.types.json",
|
|
72
|
-
"package": "NODE_ENV=production npm run build && rollup -c",
|
|
73
|
-
"prepackage": "rm -rf dist",
|
|
74
|
-
"test": "vitest",
|
|
75
|
-
"dev": "vite"
|
|
76
|
-
},
|
|
77
80
|
"devDependencies": {
|
|
78
81
|
"@rollup/plugin-commonjs": "22.0.2",
|
|
79
82
|
"@rollup/plugin-node-resolve": "14.0.1",
|
|
@@ -96,5 +99,15 @@
|
|
|
96
99
|
"rollup-plugin-terser": "7.0.2",
|
|
97
100
|
"tsc-alias": "1.7.0",
|
|
98
101
|
"umi-request": "1.4.0"
|
|
102
|
+
},
|
|
103
|
+
"scripts": {
|
|
104
|
+
"prebuild": "rm -rf lib && rm -rf esm",
|
|
105
|
+
"build": "tsc --build tsconfig.build.json && tsc --build tsconfig.cjs.json",
|
|
106
|
+
"postbuild": "tsc-alias -p tsconfig.build.json && tsc-alias -p tsconfig.cjs.json && npm run types",
|
|
107
|
+
"types": "rm -rf types && tsc --build tsconfig.types.json && tsc-alias -p tsconfig.types.json",
|
|
108
|
+
"package": "NODE_ENV=production npm run build && rollup -c",
|
|
109
|
+
"prepackage": "rm -rf dist",
|
|
110
|
+
"test": "vitest",
|
|
111
|
+
"dev": "vite"
|
|
99
112
|
}
|
|
100
|
-
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ResponsePromise } from 'ky';
|
|
2
|
+
import { KyInstance } from 'ky/distribution/types/ky';
|
|
3
|
+
export declare const createKyAdaptor: (ky: KyInstance) => Readonly<{
|
|
4
|
+
responseWrapper: ResponsePromise;
|
|
5
|
+
} & {
|
|
6
|
+
default: KyInstance;
|
|
7
|
+
get<P = unknown>(url: string, options?: Omit<import("../interfaces/instance").RequestOptions, "data"> | undefined): import("../interfaces/adapter").IAdaptorRequestResponseType<P>;
|
|
8
|
+
post<P_1 = unknown>(url: string, options: Partial<import("../interfaces/instance").RequestOptions>): import("../interfaces/adapter").IAdaptorRequestResponseType<P_1>;
|
|
9
|
+
patch<P_2 = unknown>(url: string, options: Partial<import("../interfaces/instance").RequestOptions>): import("../interfaces/adapter").IAdaptorRequestResponseType<P_2>;
|
|
10
|
+
delete<P_3 = unknown>(url: string, options?: Omit<import("../interfaces/instance").RequestOptions, "data"> | undefined): import("../interfaces/adapter").IAdaptorRequestResponseType<P_3>;
|
|
11
|
+
put<P_4 = unknown>(url: string, options: Partial<import("../interfaces/instance").RequestOptions>): import("../interfaces/adapter").IAdaptorRequestResponseType<P_4>;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const defaultKyAdaptor: Readonly<{
|
|
14
|
+
responseWrapper: ResponsePromise;
|
|
15
|
+
} & {
|
|
16
|
+
default: KyInstance;
|
|
17
|
+
get<P = unknown>(url: string, options?: Omit<import("../interfaces/instance").RequestOptions, "data"> | undefined): import("../interfaces/adapter").IAdaptorRequestResponseType<P>;
|
|
18
|
+
post<P_1 = unknown>(url: string, options: Partial<import("../interfaces/instance").RequestOptions>): import("../interfaces/adapter").IAdaptorRequestResponseType<P_1>;
|
|
19
|
+
patch<P_2 = unknown>(url: string, options: Partial<import("../interfaces/instance").RequestOptions>): import("../interfaces/adapter").IAdaptorRequestResponseType<P_2>;
|
|
20
|
+
delete<P_3 = unknown>(url: string, options?: Omit<import("../interfaces/instance").RequestOptions, "data"> | undefined): import("../interfaces/adapter").IAdaptorRequestResponseType<P_3>;
|
|
21
|
+
put<P_4 = unknown>(url: string, options: Partial<import("../interfaces/instance").RequestOptions>): import("../interfaces/adapter").IAdaptorRequestResponseType<P_4>;
|
|
22
|
+
}>;
|
|
23
|
+
export default defaultKyAdaptor;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { IRequestAdapter } from '../interfaces/adapter';
|
|
2
|
+
import { IController } from '../interfaces/controller';
|
|
3
|
+
import { SortOrder } from '../interfaces/options';
|
|
4
|
+
import { IRequestHandler, RequestProxyResult } from '../interfaces/request';
|
|
5
|
+
import { AggregateRoot, AggregateStat, AggregateTop, TimelineData, TimelineType } from '../models/aggregate';
|
|
6
|
+
import { HTTPClient } from '../core';
|
|
7
|
+
declare module '../core/client' {
|
|
8
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
9
|
+
aggregate: AggregateController<ResponseWrapper>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare class AggregateController<ResponseWrapper> implements IController {
|
|
13
|
+
private client;
|
|
14
|
+
base: string;
|
|
15
|
+
name: string;
|
|
16
|
+
constructor(client: HTTPClient);
|
|
17
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
18
|
+
/**
|
|
19
|
+
* 获取聚合数据
|
|
20
|
+
*/
|
|
21
|
+
getAggregateData(): RequestProxyResult<AggregateRoot, ResponseWrapper>;
|
|
22
|
+
/**
|
|
23
|
+
* 获取最新发布的内容
|
|
24
|
+
*/
|
|
25
|
+
getTop(size?: number): RequestProxyResult<AggregateTop, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
data: AggregateTop;
|
|
28
|
+
} : ResponseWrapper extends {
|
|
29
|
+
data: AggregateTop;
|
|
30
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
31
|
+
data: AggregateTop;
|
|
32
|
+
}>;
|
|
33
|
+
getTimeline(options?: {
|
|
34
|
+
sort?: SortOrder;
|
|
35
|
+
type?: TimelineType;
|
|
36
|
+
year?: number;
|
|
37
|
+
}): RequestProxyResult<{
|
|
38
|
+
data: TimelineData;
|
|
39
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
data: {
|
|
42
|
+
data: TimelineData;
|
|
43
|
+
};
|
|
44
|
+
} : ResponseWrapper extends {
|
|
45
|
+
data: {
|
|
46
|
+
data: TimelineData;
|
|
47
|
+
};
|
|
48
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
49
|
+
data: {
|
|
50
|
+
data: TimelineData;
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* 获取聚合数据统计
|
|
55
|
+
*/
|
|
56
|
+
getStat(): RequestProxyResult<AggregateStat, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
data: AggregateStat;
|
|
59
|
+
} : ResponseWrapper extends {
|
|
60
|
+
data: AggregateStat;
|
|
61
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
62
|
+
data: AggregateStat;
|
|
63
|
+
}>;
|
|
64
|
+
}
|