@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,22 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
import { PostModel } from './post';
|
|
3
|
+
export declare enum CategoryType {
|
|
4
|
+
Category = 0,
|
|
5
|
+
Tag = 1
|
|
6
|
+
}
|
|
7
|
+
export interface CategoryModel extends BaseModel {
|
|
8
|
+
type: CategoryType;
|
|
9
|
+
count: number;
|
|
10
|
+
slug: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
export type CategoryWithChildrenModel = CategoryModel & {
|
|
14
|
+
children: Pick<PostModel, 'id' | 'title' | 'slug' | 'modified' | 'created'>[];
|
|
15
|
+
};
|
|
16
|
+
export type CategoryEntries = {
|
|
17
|
+
entries: Record<string, CategoryWithChildrenModel>;
|
|
18
|
+
};
|
|
19
|
+
export interface TagModel {
|
|
20
|
+
count: number;
|
|
21
|
+
name: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
import { CategoryModel } from './category';
|
|
3
|
+
export declare enum RefType {
|
|
4
|
+
Page = "Page",
|
|
5
|
+
Post = "Post",
|
|
6
|
+
Note = "Note"
|
|
7
|
+
}
|
|
8
|
+
export interface CommentModel extends BaseModel {
|
|
9
|
+
refType: RefType;
|
|
10
|
+
ref: string;
|
|
11
|
+
state: number;
|
|
12
|
+
commentsIndex: number;
|
|
13
|
+
author: string;
|
|
14
|
+
text: string;
|
|
15
|
+
mail?: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
ip?: string;
|
|
18
|
+
agent?: string;
|
|
19
|
+
key: string;
|
|
20
|
+
pin?: boolean;
|
|
21
|
+
avatar: string;
|
|
22
|
+
parent?: CommentModel | string;
|
|
23
|
+
children: CommentModel[];
|
|
24
|
+
isWhispers?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface CommentRef {
|
|
27
|
+
id: string;
|
|
28
|
+
categoryId?: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
title: string;
|
|
31
|
+
category?: CategoryModel;
|
|
32
|
+
}
|
|
33
|
+
export declare enum CommentState {
|
|
34
|
+
Unread = 0,
|
|
35
|
+
Read = 1,
|
|
36
|
+
Junk = 2
|
|
37
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './aggregate';
|
|
2
|
+
export * from './base';
|
|
3
|
+
export * from './category';
|
|
4
|
+
export * from './comment';
|
|
5
|
+
export * from './link';
|
|
6
|
+
export * from './note';
|
|
7
|
+
export * from './page';
|
|
8
|
+
export * from './post';
|
|
9
|
+
export * from './project';
|
|
10
|
+
export * from './recently';
|
|
11
|
+
export * from './say';
|
|
12
|
+
export * from './setting';
|
|
13
|
+
export * from './snippet';
|
|
14
|
+
export * from './user';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export declare enum LinkType {
|
|
3
|
+
Friend = 0,
|
|
4
|
+
Collection = 1
|
|
5
|
+
}
|
|
6
|
+
export declare enum LinkState {
|
|
7
|
+
Pass = 0,
|
|
8
|
+
Audit = 1,
|
|
9
|
+
Outdate = 2,
|
|
10
|
+
Banned = 3,
|
|
11
|
+
Reject = 4
|
|
12
|
+
}
|
|
13
|
+
export interface LinkModel extends BaseModel {
|
|
14
|
+
name: string;
|
|
15
|
+
url: string;
|
|
16
|
+
avatar: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
type: LinkType;
|
|
19
|
+
state: LinkState;
|
|
20
|
+
hide: boolean;
|
|
21
|
+
email: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ModelWithLiked, TextBaseModel } from './base';
|
|
2
|
+
import { TopicModel } from './topic';
|
|
3
|
+
export interface NoteModel extends TextBaseModel {
|
|
4
|
+
hide: boolean;
|
|
5
|
+
count: {
|
|
6
|
+
read: number;
|
|
7
|
+
like: number;
|
|
8
|
+
};
|
|
9
|
+
mood?: string;
|
|
10
|
+
weather?: string;
|
|
11
|
+
hasMemory?: boolean;
|
|
12
|
+
secret?: Date;
|
|
13
|
+
password?: string | null;
|
|
14
|
+
nid: number;
|
|
15
|
+
music?: NoteMusicRecord[];
|
|
16
|
+
location?: string;
|
|
17
|
+
coordinates?: Coordinate;
|
|
18
|
+
topic?: TopicModel;
|
|
19
|
+
topicId?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface NoteMusicRecord {
|
|
22
|
+
type: string;
|
|
23
|
+
id: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Coordinate {
|
|
26
|
+
latitude: number;
|
|
27
|
+
longitude: number;
|
|
28
|
+
}
|
|
29
|
+
export interface NoteWrappedPayload {
|
|
30
|
+
data: NoteModel;
|
|
31
|
+
next?: Partial<NoteModel>;
|
|
32
|
+
prev?: Partial<NoteModel>;
|
|
33
|
+
}
|
|
34
|
+
export interface NoteWrappedWithLikedPayload {
|
|
35
|
+
data: ModelWithLiked<NoteModel>;
|
|
36
|
+
next?: Partial<NoteModel>;
|
|
37
|
+
prev?: Partial<NoteModel>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TextBaseModel } from './base';
|
|
2
|
+
export declare enum EnumPageType {
|
|
3
|
+
'md' = "md",
|
|
4
|
+
'html' = "html",
|
|
5
|
+
'frame' = "frame"
|
|
6
|
+
}
|
|
7
|
+
export interface PageModel extends TextBaseModel {
|
|
8
|
+
created: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
order?: number;
|
|
12
|
+
type?: EnumPageType;
|
|
13
|
+
options?: object;
|
|
14
|
+
}
|
|
@@ -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,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,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,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,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,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,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 @@
|
|
|
1
|
+
export declare const resolveFullPath: (endpoint: string, path: string) => string;
|