@mx-space/api-client 1.16.1 → 1.18.0
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/controllers/ack.ts +1 -2
- package/controllers/activity.ts +1 -2
- package/controllers/aggregate.ts +1 -2
- package/controllers/ai.ts +12 -3
- package/controllers/base.ts +1 -2
- package/controllers/category.ts +4 -6
- package/controllers/comment.ts +1 -2
- package/controllers/link.ts +1 -3
- package/controllers/note.ts +5 -3
- package/controllers/page.ts +1 -2
- package/controllers/post.ts +1 -2
- package/controllers/project.ts +1 -3
- package/controllers/recently.ts +1 -2
- package/controllers/say.ts +1 -3
- package/controllers/search.ts +2 -3
- package/controllers/severless.ts +1 -2
- package/controllers/snippet.ts +1 -2
- package/controllers/subscribe.ts +1 -2
- package/controllers/topic.ts +1 -3
- package/controllers/user.ts +1 -2
- package/dist/adapter-B1dtiutp.d.cts +25 -0
- package/dist/adapter-CRsPadpS.d.mts +25 -0
- package/dist/adaptors/axios.cjs +53 -57
- package/dist/adaptors/axios.d.cts +5 -4
- package/dist/adaptors/axios.d.mts +7 -0
- package/dist/adaptors/axios.mjs +33 -0
- package/dist/adaptors/fetch.cjs +72 -108
- package/dist/adaptors/fetch.d.cts +4 -3
- package/dist/adaptors/fetch.d.mts +6 -0
- package/dist/adaptors/fetch.mjs +75 -0
- package/dist/adaptors/umi-request.cjs +32 -54
- package/dist/adaptors/umi-request.d.cts +5 -4
- package/dist/adaptors/umi-request.d.mts +7 -0
- package/dist/adaptors/umi-request.mjs +33 -0
- package/dist/index.cjs +1042 -1199
- package/dist/index.d.cts +1758 -1643
- package/dist/index.d.mts +2016 -0
- package/dist/index.mjs +1101 -0
- package/index.ts +0 -1
- package/interfaces/request.ts +3 -1
- package/mod-dts.mjs +15 -12
- package/models/aggregate.ts +0 -2
- package/models/ai.ts +9 -0
- package/models/comment.ts +1 -2
- package/models/note.ts +1 -1
- package/models/recently.ts +2 -0
- package/models/setting.ts +5 -0
- package/package.json +20 -20
- package/readme.md +3 -3
- package/tsconfig.json +11 -11
- package/{tsup.config.ts → tsdown.config.ts} +2 -2
- package/vitest.config.ts +0 -1
- package/.eslintcache +0 -1
- package/coverage/clover.xml +0 -591
- package/coverage/coverage-final.json +0 -5944
- package/coverage/lcov-report/adaptors/axios.ts.html +0 -201
- package/coverage/lcov-report/adaptors/index.html +0 -196
- package/coverage/lcov-report/adaptors/umi-request.ts.html +0 -186
- package/coverage/lcov-report/auto-bind.ts.html +0 -228
- package/coverage/lcov-report/base.css +0 -354
- package/coverage/lcov-report/block-navigation.js +0 -85
- package/coverage/lcov-report/controllers/aggregate.ts.html +0 -294
- package/coverage/lcov-report/controllers/base.ts.html +0 -183
- package/coverage/lcov-report/controllers/category.ts.html +0 -441
- package/coverage/lcov-report/controllers/comment.ts.html +0 -291
- package/coverage/lcov-report/controllers/index.html +0 -476
- package/coverage/lcov-report/controllers/index.ts.html +0 -297
- package/coverage/lcov-report/controllers/link.ts.html +0 -216
- package/coverage/lcov-report/controllers/note.ts.html +0 -375
- package/coverage/lcov-report/controllers/page.ts.html +0 -279
- package/coverage/lcov-report/controllers/post.ts.html +0 -369
- package/coverage/lcov-report/controllers/project.ts.html +0 -168
- package/coverage/lcov-report/controllers/recently.ts.html +0 -246
- package/coverage/lcov-report/controllers/say.ts.html +0 -207
- package/coverage/lcov-report/controllers/search.ts.html +0 -411
- package/coverage/lcov-report/controllers/severless.ts.html +0 -180
- package/coverage/lcov-report/controllers/snippet.ts.html +0 -195
- package/coverage/lcov-report/controllers/user.ts.html +0 -240
- package/coverage/lcov-report/core/attach-request.ts.html +0 -216
- package/coverage/lcov-report/core/client.ts.html +0 -786
- package/coverage/lcov-report/core/error.ts.html +0 -117
- package/coverage/lcov-report/core/index.html +0 -236
- package/coverage/lcov-report/core/index.ts.html +0 -93
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -276
- package/coverage/lcov-report/index.ts.html +0 -243
- package/coverage/lcov-report/models/aggregate.ts.html +0 -300
- package/coverage/lcov-report/models/category.ts.html +0 -162
- package/coverage/lcov-report/models/index.html +0 -196
- package/coverage/lcov-report/prettify.css +0 -101
- package/coverage/lcov-report/prettify.js +0 -1004
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -191
- package/coverage/lcov-report/utils/auto-bind.ts.html +0 -231
- package/coverage/lcov-report/utils/index.html +0 -216
- package/coverage/lcov-report/utils/index.ts.html +0 -246
- package/coverage/lcov-report/utils/path.ts.html +0 -105
- package/coverage/lcov.info +0 -1209
- package/dist/adapter-B8tKfr1O.d.cts +0 -23
- package/dist/adapter-B8tKfr1O.d.ts +0 -23
- package/dist/adaptors/axios.d.ts +0 -6
- package/dist/adaptors/axios.global.js +0 -14151
- package/dist/adaptors/axios.js +0 -33
- package/dist/adaptors/fetch.d.ts +0 -5
- package/dist/adaptors/fetch.global.js +0 -87
- package/dist/adaptors/fetch.js +0 -87
- package/dist/adaptors/umi-request.d.ts +0 -6
- package/dist/adaptors/umi-request.global.js +0 -7379
- package/dist/adaptors/umi-request.js +0 -33
- package/dist/index.d.ts +0 -1901
- package/dist/index.global.js +0 -1193
- package/dist/index.js +0 -1234
- package/esm/apps/core/src/modules/subscribe/subscribe.constant.d.ts +0 -12
- package/esm/apps/core/src/modules/subscribe/subscribe.constant.js +0 -16
- package/esm/apps/core/src/modules/subscribe/subscribe.constant.js.map +0 -1
- package/esm/packages/api-client/adaptors/axios.d.ts +0 -4
- package/esm/packages/api-client/adaptors/axios.js +0 -37
- package/esm/packages/api-client/adaptors/axios.js.map +0 -1
- package/esm/packages/api-client/adaptors/fetch.d.ts +0 -2
- package/esm/packages/api-client/adaptors/fetch.js +0 -95
- package/esm/packages/api-client/adaptors/fetch.js.map +0 -1
- package/esm/packages/api-client/adaptors/ky.d.ts +0 -23
- package/esm/packages/api-client/adaptors/ky.js +0 -62
- package/esm/packages/api-client/adaptors/ky.js.map +0 -1
- package/esm/packages/api-client/adaptors/umi-request.d.ts +0 -4
- package/esm/packages/api-client/adaptors/umi-request.js +0 -31
- package/esm/packages/api-client/adaptors/umi-request.js.map +0 -1
- package/esm/packages/api-client/controllers/aggregate.d.ts +0 -64
- package/esm/packages/api-client/controllers/aggregate.js +0 -46
- package/esm/packages/api-client/controllers/aggregate.js.map +0 -1
- package/esm/packages/api-client/controllers/base.d.ts +0 -43
- package/esm/packages/api-client/controllers/base.js +0 -27
- package/esm/packages/api-client/controllers/base.js.map +0 -1
- package/esm/packages/api-client/controllers/category.d.ts +0 -120
- package/esm/packages/api-client/controllers/category.js +0 -68
- package/esm/packages/api-client/controllers/category.js.map +0 -1
- package/esm/packages/api-client/controllers/comment.d.ts +0 -81
- package/esm/packages/api-client/controllers/comment.js +0 -47
- package/esm/packages/api-client/controllers/comment.js.map +0 -1
- package/esm/packages/api-client/controllers/index.d.ts +0 -19
- package/esm/packages/api-client/controllers/index.js +0 -60
- package/esm/packages/api-client/controllers/index.js.map +0 -1
- package/esm/packages/api-client/controllers/link.d.ts +0 -20
- package/esm/packages/api-client/controllers/link.js +0 -21
- package/esm/packages/api-client/controllers/link.js.map +0 -1
- package/esm/packages/api-client/controllers/note.d.ts +0 -103
- package/esm/packages/api-client/controllers/note.js +0 -68
- package/esm/packages/api-client/controllers/note.js.map +0 -1
- package/esm/packages/api-client/controllers/page.d.ts +0 -59
- package/esm/packages/api-client/controllers/page.js +0 -42
- package/esm/packages/api-client/controllers/page.js.map +0 -1
- package/esm/packages/api-client/controllers/post.d.ts +0 -72
- package/esm/packages/api-client/controllers/post.js +0 -52
- package/esm/packages/api-client/controllers/post.js.map +0 -1
- package/esm/packages/api-client/controllers/project.d.ts +0 -15
- package/esm/packages/api-client/controllers/project.js +0 -12
- package/esm/packages/api-client/controllers/project.js.map +0 -1
- package/esm/packages/api-client/controllers/recently.d.ts +0 -110
- package/esm/packages/api-client/controllers/recently.js +0 -49
- package/esm/packages/api-client/controllers/recently.js.map +0 -1
- package/esm/packages/api-client/controllers/say.d.ts +0 -37
- package/esm/packages/api-client/controllers/say.js +0 -21
- package/esm/packages/api-client/controllers/say.js.map +0 -1
- package/esm/packages/api-client/controllers/search.d.ts +0 -87
- package/esm/packages/api-client/controllers/search.js +0 -28
- package/esm/packages/api-client/controllers/search.js.map +0 -1
- package/esm/packages/api-client/controllers/severless.d.ts +0 -24
- package/esm/packages/api-client/controllers/severless.js +0 -16
- package/esm/packages/api-client/controllers/severless.js.map +0 -1
- package/esm/packages/api-client/controllers/snippet.d.ts +0 -24
- package/esm/packages/api-client/controllers/snippet.js +0 -19
- package/esm/packages/api-client/controllers/snippet.js.map +0 -1
- package/esm/packages/api-client/controllers/subscribe.d.ts +0 -64
- package/esm/packages/api-client/controllers/subscribe.js +0 -35
- package/esm/packages/api-client/controllers/subscribe.js.map +0 -1
- package/esm/packages/api-client/controllers/topic.d.ts +0 -26
- package/esm/packages/api-client/controllers/topic.js +0 -18
- package/esm/packages/api-client/controllers/topic.js.map +0 -1
- package/esm/packages/api-client/controllers/user.d.ts +0 -70
- package/esm/packages/api-client/controllers/user.js +0 -40
- package/esm/packages/api-client/controllers/user.js.map +0 -1
- package/esm/packages/api-client/core/attach-request.d.ts +0 -2
- package/esm/packages/api-client/core/attach-request.js +0 -36
- package/esm/packages/api-client/core/attach-request.js.map +0 -1
- package/esm/packages/api-client/core/client.d.ts +0 -29
- package/esm/packages/api-client/core/client.js +0 -193
- package/esm/packages/api-client/core/client.js.map +0 -1
- package/esm/packages/api-client/core/error.d.ts +0 -6
- package/esm/packages/api-client/core/error.js +0 -9
- package/esm/packages/api-client/core/error.js.map +0 -1
- package/esm/packages/api-client/core/index.d.ts +0 -2
- package/esm/packages/api-client/core/index.js +0 -3
- package/esm/packages/api-client/core/index.js.map +0 -1
- package/esm/packages/api-client/dtos/comment.d.ts +0 -8
- package/esm/packages/api-client/dtos/comment.js +0 -2
- package/esm/packages/api-client/dtos/comment.js.map +0 -1
- package/esm/packages/api-client/dtos/index.d.ts +0 -1
- package/esm/packages/api-client/dtos/index.js +0 -2
- package/esm/packages/api-client/dtos/index.js.map +0 -1
- package/esm/packages/api-client/index.d.ts +0 -8
- package/esm/packages/api-client/index.js +0 -9
- package/esm/packages/api-client/index.js.map +0 -1
- package/esm/packages/api-client/interfaces/adapter.d.ts +0 -14
- package/esm/packages/api-client/interfaces/adapter.js +0 -2
- package/esm/packages/api-client/interfaces/adapter.js.map +0 -1
- package/esm/packages/api-client/interfaces/client.d.ts +0 -13
- package/esm/packages/api-client/interfaces/client.js +0 -2
- package/esm/packages/api-client/interfaces/client.js.map +0 -1
- package/esm/packages/api-client/interfaces/controller.d.ts +0 -4
- package/esm/packages/api-client/interfaces/controller.js +0 -2
- package/esm/packages/api-client/interfaces/controller.js.map +0 -1
- package/esm/packages/api-client/interfaces/instance.d.ts +0 -7
- package/esm/packages/api-client/interfaces/instance.js +0 -2
- package/esm/packages/api-client/interfaces/instance.js.map +0 -1
- package/esm/packages/api-client/interfaces/options.d.ts +0 -1
- package/esm/packages/api-client/interfaces/options.js +0 -2
- package/esm/packages/api-client/interfaces/options.js.map +0 -1
- package/esm/packages/api-client/interfaces/params.d.ts +0 -4
- package/esm/packages/api-client/interfaces/params.js +0 -2
- package/esm/packages/api-client/interfaces/params.js.map +0 -1
- package/esm/packages/api-client/interfaces/request.d.ts +0 -44
- package/esm/packages/api-client/interfaces/request.js +0 -2
- package/esm/packages/api-client/interfaces/request.js.map +0 -1
- package/esm/packages/api-client/interfaces/types.d.ts +0 -2
- package/esm/packages/api-client/interfaces/types.js +0 -2
- package/esm/packages/api-client/interfaces/types.js.map +0 -1
- package/esm/packages/api-client/models/aggregate.d.ts +0 -67
- package/esm/packages/api-client/models/aggregate.js +0 -6
- package/esm/packages/api-client/models/aggregate.js.map +0 -1
- package/esm/packages/api-client/models/base.d.ts +0 -40
- package/esm/packages/api-client/models/base.js +0 -2
- package/esm/packages/api-client/models/base.js.map +0 -1
- package/esm/packages/api-client/models/category.d.ts +0 -22
- package/esm/packages/api-client/models/category.js +0 -6
- package/esm/packages/api-client/models/category.js.map +0 -1
- package/esm/packages/api-client/models/comment.d.ts +0 -39
- package/esm/packages/api-client/models/comment.js +0 -13
- package/esm/packages/api-client/models/comment.js.map +0 -1
- package/esm/packages/api-client/models/index.d.ts +0 -16
- package/esm/packages/api-client/models/index.js +0 -17
- package/esm/packages/api-client/models/index.js.map +0 -1
- package/esm/packages/api-client/models/link.d.ts +0 -22
- package/esm/packages/api-client/models/link.js +0 -14
- package/esm/packages/api-client/models/link.js.map +0 -1
- package/esm/packages/api-client/models/note.d.ts +0 -38
- package/esm/packages/api-client/models/note.js +0 -2
- package/esm/packages/api-client/models/note.js.map +0 -1
- package/esm/packages/api-client/models/page.d.ts +0 -14
- package/esm/packages/api-client/models/page.js +0 -7
- package/esm/packages/api-client/models/page.js.map +0 -1
- package/esm/packages/api-client/models/post.d.ts +0 -17
- package/esm/packages/api-client/models/post.js +0 -2
- package/esm/packages/api-client/models/post.js.map +0 -1
- package/esm/packages/api-client/models/project.d.ts +0 -11
- package/esm/packages/api-client/models/project.js +0 -2
- package/esm/packages/api-client/models/project.js.map +0 -1
- package/esm/packages/api-client/models/recently.d.ts +0 -20
- package/esm/packages/api-client/models/recently.js +0 -7
- package/esm/packages/api-client/models/recently.js.map +0 -1
- package/esm/packages/api-client/models/say.d.ts +0 -6
- package/esm/packages/api-client/models/say.js +0 -2
- package/esm/packages/api-client/models/say.js.map +0 -1
- package/esm/packages/api-client/models/setting.d.ts +0 -66
- package/esm/packages/api-client/models/setting.js +0 -2
- package/esm/packages/api-client/models/setting.js.map +0 -1
- package/esm/packages/api-client/models/snippet.d.ts +0 -18
- package/esm/packages/api-client/models/snippet.js +0 -8
- package/esm/packages/api-client/models/snippet.js.map +0 -1
- package/esm/packages/api-client/models/subscribe.d.ts +0 -3
- package/esm/packages/api-client/models/subscribe.js +0 -2
- package/esm/packages/api-client/models/subscribe.js.map +0 -1
- package/esm/packages/api-client/models/topic.d.ts +0 -8
- package/esm/packages/api-client/models/topic.js +0 -2
- package/esm/packages/api-client/models/topic.js.map +0 -1
- package/esm/packages/api-client/models/user.d.ts +0 -21
- package/esm/packages/api-client/models/user.js +0 -2
- package/esm/packages/api-client/models/user.js.map +0 -1
- package/esm/packages/api-client/tsup.config.d.ts +0 -2
- package/esm/packages/api-client/tsup.config.js +0 -14
- package/esm/packages/api-client/tsup.config.js.map +0 -1
- package/esm/packages/api-client/utils/auto-bind.d.ts +0 -4
- package/esm/packages/api-client/utils/auto-bind.js +0 -36
- package/esm/packages/api-client/utils/auto-bind.js.map +0 -1
- package/esm/packages/api-client/utils/camelcase-keys.d.ts +0 -6
- package/esm/packages/api-client/utils/camelcase-keys.js +0 -23
- package/esm/packages/api-client/utils/camelcase-keys.js.map +0 -1
- package/esm/packages/api-client/utils/index.d.ts +0 -5
- package/esm/packages/api-client/utils/index.js +0 -43
- package/esm/packages/api-client/utils/index.js.map +0 -1
- package/esm/packages/api-client/utils/path.d.ts +0 -1
- package/esm/packages/api-client/utils/path.js +0 -7
- package/esm/packages/api-client/utils/path.js.map +0 -1
- package/esm/packages/api-client/vitest.config.d.ts +0 -2
- package/esm/packages/api-client/vitest.config.js +0 -15
- package/esm/packages/api-client/vitest.config.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,1901 +1,2016 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as IRequestAdapter, r as RequestOptions, t as IAdaptorRequestResponseType } from "./adapter-B1dtiutp.cjs";
|
|
2
2
|
|
|
3
|
+
//#region interfaces/controller.d.ts
|
|
3
4
|
interface IController {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
base: string;
|
|
6
|
+
name: string | string[];
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region interfaces/types.d.ts
|
|
8
10
|
type Class<T> = new (...args: any[]) => T;
|
|
9
11
|
type SelectFields<T extends string> = `${'+' | '-' | ''}${T}`[];
|
|
10
|
-
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region interfaces/client.d.ts
|
|
11
14
|
interface IClientOptions {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
controllers: Class<IController>[];
|
|
16
|
+
getCodeMessageFromException: <T = Error>(error: T) => {
|
|
17
|
+
message?: string | undefined | null;
|
|
18
|
+
code?: number | undefined | null;
|
|
19
|
+
};
|
|
20
|
+
customThrowResponseError: <T extends Error = Error>(err: any) => T;
|
|
21
|
+
transformResponse: <T = any>(data: any) => T;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @default (res) => res.data
|
|
25
|
+
*/
|
|
26
|
+
getDataFromResponse: <T = any>(response: unknown) => T;
|
|
24
27
|
}
|
|
25
28
|
type ClientOptions = Partial<IClientOptions>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region interfaces/request.d.ts
|
|
31
|
+
type NoStringIndex<T> = { [K in keyof T as string extends K ? never : K]: T[K] };
|
|
30
32
|
interface IRequestHandler<ResponseWrapper> {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
type RequestProxyResult<T, ResponseWrapper, R = ResponseWrapper extends unknown ? {
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
(path?: string | number): IRequestHandler<ResponseWrapper>;
|
|
34
|
+
get: <P = unknown>(options?: Omit<NoStringIndex<RequestOptions>, 'data'>) => RequestProxyResult<P, ResponseWrapper>;
|
|
35
|
+
post: <P = unknown>(options?: RequestOptions) => RequestProxyResult<P, ResponseWrapper>;
|
|
36
|
+
patch: <P = unknown>(options?: RequestOptions) => RequestProxyResult<P, ResponseWrapper>;
|
|
37
|
+
delete: <P = unknown>(options?: Omit<NoStringIndex<RequestOptions>, 'data'>) => RequestProxyResult<P, ResponseWrapper>;
|
|
38
|
+
put: <P = unknown>(options?: RequestOptions) => RequestProxyResult<P, ResponseWrapper>;
|
|
39
|
+
toString: (withBase?: boolean) => string;
|
|
40
|
+
valueOf: (withBase?: boolean) => string;
|
|
41
|
+
[key: string]: IRequestHandler<ResponseWrapper>;
|
|
42
|
+
}
|
|
43
|
+
type RequestProxyResult<T, ResponseWrapper, R$1 = (ResponseWrapper extends unknown ? {
|
|
44
|
+
data: T;
|
|
45
|
+
[key: string]: any;
|
|
44
46
|
} : ResponseWrapper extends {
|
|
45
|
-
|
|
47
|
+
data: T;
|
|
46
48
|
} ? ResponseWrapper : Omit<ResponseWrapper, 'data'> & {
|
|
47
|
-
|
|
48
|
-
}> = Promise<ResponseProxyExtraRaw<T, R, ResponseWrapper>>;
|
|
49
|
+
data: T;
|
|
50
|
+
})> = Promise<ResponseProxyExtraRaw<T, R$1, ResponseWrapper>>;
|
|
49
51
|
type CamelToSnake<T extends string, P extends string = ''> = string extends T ? string : T extends `${infer C0}${infer R}` ? CamelToSnake<R, `${P}${C0 extends Lowercase<C0> ? '' : '_'}${Lowercase<C0>}`> : P;
|
|
50
|
-
type CamelKeysToSnake<T> = {
|
|
51
|
-
[K in keyof T as CamelToSnake<Extract<K, string>>]: T[K];
|
|
52
|
-
};
|
|
52
|
+
type CamelKeysToSnake<T> = { [K in keyof T as CamelToSnake<Extract<K, string>>]: T[K] };
|
|
53
53
|
type ResponseWrapperType<Response, RawData, T> = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
$raw: Response extends {
|
|
55
|
+
data: infer T;
|
|
56
|
+
} ? Response : Response extends unknown ? {
|
|
57
|
+
[i: string]: any;
|
|
58
|
+
data: RawData extends unknown ? CamelKeysToSnake<T> : RawData;
|
|
59
|
+
} : Response;
|
|
60
|
+
$request: {
|
|
61
|
+
path: string;
|
|
62
|
+
method: string;
|
|
63
|
+
[k: string]: string;
|
|
64
|
+
};
|
|
65
|
+
$serialized: T;
|
|
66
66
|
};
|
|
67
67
|
type ResponseProxyExtraRaw<T, RawData = unknown, Response = unknown> = T extends object ? T & ResponseWrapperType<Response, RawData, T> : T extends unknown ? T & ResponseWrapperType<Response, RawData, T> : unknown;
|
|
68
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region core/client.d.ts
|
|
69
70
|
declare class HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
declare function createClient<T extends IRequestAdapter>(adapter: T): <ResponseWrapper = T extends {
|
|
90
|
-
|
|
91
|
-
} ? Type extends undefined ? unknown : Type : unknown>(endpoint: string, options?: ClientOptions) => HTTPClient<T, ResponseWrapper>;
|
|
92
|
-
|
|
71
|
+
private readonly _endpoint;
|
|
72
|
+
private _adaptor;
|
|
73
|
+
private options;
|
|
74
|
+
private readonly _proxy;
|
|
75
|
+
constructor(_endpoint: string, _adaptor: T, options?: Omit<ClientOptions, 'controllers'>);
|
|
76
|
+
private initGetClient;
|
|
77
|
+
injectControllers(...Controller: Class<IController>[]): void;
|
|
78
|
+
injectControllers(Controller: Class<IController>[]): void;
|
|
79
|
+
get endpoint(): string;
|
|
80
|
+
get instance(): T;
|
|
81
|
+
request(options: {
|
|
82
|
+
url: string;
|
|
83
|
+
method?: string;
|
|
84
|
+
data?: any;
|
|
85
|
+
params?: any;
|
|
86
|
+
}): Promise<IAdaptorRequestResponseType<any>>;
|
|
87
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
88
|
+
private buildRoute;
|
|
89
|
+
}
|
|
90
|
+
declare function createClient<T extends IRequestAdapter>(adapter: T): <ResponseWrapper = (T extends {
|
|
91
|
+
responseWrapper: infer Type;
|
|
92
|
+
} ? Type extends undefined ? unknown : Type : unknown)>(endpoint: string, options?: ClientOptions) => HTTPClient<T, ResponseWrapper>;
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region core/error.d.ts
|
|
93
95
|
declare class RequestError extends Error {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
status: number;
|
|
97
|
+
path: string;
|
|
98
|
+
raw: any;
|
|
99
|
+
constructor(message: string, status: number, path: string, raw: any);
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region controllers/ack.d.ts
|
|
103
|
+
declare module '@mx-space/api-client' {
|
|
104
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
105
|
+
ack: AckController<ResponseWrapper>;
|
|
106
|
+
}
|
|
104
107
|
}
|
|
105
108
|
/**
|
|
106
109
|
* @support core >= 4.4.0
|
|
107
110
|
*/
|
|
108
111
|
declare class AckController<ResponseWrapper> implements IController {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
112
|
+
private client;
|
|
113
|
+
base: string;
|
|
114
|
+
name: string;
|
|
115
|
+
constructor(client: HTTPClient);
|
|
116
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
117
|
+
read(type: 'post' | 'note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
118
|
+
[key: string]: any;
|
|
119
|
+
data: never;
|
|
120
|
+
} : ResponseWrapper extends {
|
|
121
|
+
data: never;
|
|
122
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
123
|
+
data: never;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region ../../apps/core/src/constants/db.constant.d.ts
|
|
124
128
|
declare enum CollectionRefTypes {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
Post = "posts",
|
|
130
|
+
Note = "notes",
|
|
131
|
+
Page = "pages",
|
|
132
|
+
Recently = "recentlies",
|
|
129
133
|
}
|
|
130
|
-
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region models/base.d.ts
|
|
131
136
|
interface Count {
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
read: number;
|
|
138
|
+
like: number;
|
|
134
139
|
}
|
|
135
140
|
interface Image {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
height: number;
|
|
142
|
+
width: number;
|
|
143
|
+
type: string;
|
|
144
|
+
accent?: string;
|
|
145
|
+
src: string;
|
|
146
|
+
blurHash?: string;
|
|
142
147
|
}
|
|
143
148
|
interface Pager {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
total: number;
|
|
150
|
+
size: number;
|
|
151
|
+
currentPage: number;
|
|
152
|
+
totalPage: number;
|
|
153
|
+
hasPrevPage: boolean;
|
|
154
|
+
hasNextPage: boolean;
|
|
150
155
|
}
|
|
151
156
|
interface PaginateResult<T> {
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
data: T[];
|
|
158
|
+
pagination: Pager;
|
|
154
159
|
}
|
|
155
160
|
interface BaseModel {
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
created: string;
|
|
162
|
+
id: string;
|
|
158
163
|
}
|
|
159
164
|
interface BaseCommentIndexModel extends BaseModel {
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
commentsIndex?: number;
|
|
166
|
+
allowComment: boolean;
|
|
162
167
|
}
|
|
163
168
|
interface TextBaseModel extends BaseCommentIndexModel {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
title: string;
|
|
170
|
+
text: string;
|
|
171
|
+
images?: Image[];
|
|
172
|
+
modified: string | null;
|
|
168
173
|
}
|
|
169
174
|
type ModelWithLiked<T> = T & {
|
|
170
|
-
|
|
175
|
+
liked: boolean;
|
|
171
176
|
};
|
|
172
|
-
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region models/post.d.ts
|
|
173
179
|
interface PostModel extends TextBaseModel {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
180
|
+
summary?: string | null;
|
|
181
|
+
copyright: boolean;
|
|
182
|
+
tags: string[];
|
|
183
|
+
count: Count;
|
|
184
|
+
text: string;
|
|
185
|
+
title: string;
|
|
186
|
+
slug: string;
|
|
187
|
+
categoryId: string;
|
|
188
|
+
images: Image[];
|
|
189
|
+
category: CategoryModel;
|
|
190
|
+
pin?: string | null;
|
|
191
|
+
pinOrder?: number;
|
|
192
|
+
related?: Pick<PostModel, 'id' | 'category' | 'categoryId' | 'created' | 'modified' | 'title' | 'slug' | 'summary'>[];
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region models/category.d.ts
|
|
189
196
|
declare enum CategoryType {
|
|
190
|
-
|
|
191
|
-
|
|
197
|
+
Category = 0,
|
|
198
|
+
Tag = 1,
|
|
192
199
|
}
|
|
193
200
|
interface CategoryModel extends BaseModel {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
201
|
+
type: CategoryType;
|
|
202
|
+
count: number;
|
|
203
|
+
slug: string;
|
|
204
|
+
name: string;
|
|
198
205
|
}
|
|
199
206
|
type CategoryWithChildrenModel = CategoryModel & {
|
|
200
|
-
|
|
207
|
+
children: Pick<PostModel, 'id' | 'title' | 'slug' | 'modified' | 'created'>[];
|
|
201
208
|
};
|
|
202
209
|
type CategoryEntries = {
|
|
203
|
-
|
|
210
|
+
entries: Record<string, CategoryWithChildrenModel>;
|
|
204
211
|
};
|
|
205
212
|
interface TagModel {
|
|
206
|
-
|
|
207
|
-
|
|
213
|
+
count: number;
|
|
214
|
+
name: string;
|
|
208
215
|
}
|
|
209
|
-
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region models/activity.d.ts
|
|
210
218
|
interface ActivityPresence {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
operationTime: number;
|
|
220
|
+
identity: string;
|
|
221
|
+
roomName: string;
|
|
222
|
+
position: number;
|
|
223
|
+
joinedAt: number;
|
|
224
|
+
connectedAt: number;
|
|
225
|
+
updatedAt: number;
|
|
226
|
+
readerId?: string;
|
|
227
|
+
displayName?: string;
|
|
220
228
|
}
|
|
221
229
|
interface RoomOmittedNote {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
230
|
+
title: string;
|
|
231
|
+
nid: number;
|
|
232
|
+
id: string;
|
|
233
|
+
created: string;
|
|
226
234
|
}
|
|
227
235
|
interface RoomOmittedPage {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
236
|
+
title: string;
|
|
237
|
+
slug: string;
|
|
238
|
+
id: string;
|
|
239
|
+
created: string;
|
|
232
240
|
}
|
|
233
241
|
interface RoomOmittedPost {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
242
|
+
slug: string;
|
|
243
|
+
title: string;
|
|
244
|
+
categoryId: string;
|
|
245
|
+
category: CategoryModel;
|
|
246
|
+
id: string;
|
|
247
|
+
created: string;
|
|
240
248
|
}
|
|
241
249
|
interface RoomsData {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
250
|
+
rooms: string[];
|
|
251
|
+
roomCount: {
|
|
252
|
+
[key: string]: number;
|
|
253
|
+
};
|
|
254
|
+
objects: {
|
|
255
|
+
posts: RoomOmittedPost[];
|
|
256
|
+
notes: RoomOmittedNote[];
|
|
257
|
+
pages: RoomOmittedPage[];
|
|
258
|
+
};
|
|
251
259
|
}
|
|
252
260
|
interface RecentActivities {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
261
|
+
like: RecentLike[];
|
|
262
|
+
comment: RecentComment[];
|
|
263
|
+
recent: RecentRecent[];
|
|
264
|
+
post: RecentPost[];
|
|
265
|
+
note: RecentNote[];
|
|
258
266
|
}
|
|
259
267
|
interface RecentComment {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
268
|
+
created: string;
|
|
269
|
+
author: string;
|
|
270
|
+
text: string;
|
|
271
|
+
id: string;
|
|
272
|
+
title: string;
|
|
273
|
+
slug?: string;
|
|
274
|
+
type: string;
|
|
275
|
+
avatar: string;
|
|
276
|
+
nid?: string;
|
|
269
277
|
}
|
|
270
278
|
interface RecentLike {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
279
|
+
created: string;
|
|
280
|
+
id: string;
|
|
281
|
+
type: CollectionRefTypes.Post | CollectionRefTypes.Note;
|
|
282
|
+
nid?: number;
|
|
283
|
+
slug?: string;
|
|
284
|
+
title: string;
|
|
277
285
|
}
|
|
278
286
|
interface RecentNote {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
287
|
+
id: string;
|
|
288
|
+
created: string;
|
|
289
|
+
title: string;
|
|
290
|
+
modified: string;
|
|
291
|
+
nid: number;
|
|
284
292
|
}
|
|
285
293
|
interface RecentPost {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
294
|
+
id: string;
|
|
295
|
+
created: string;
|
|
296
|
+
title: string;
|
|
297
|
+
modified: string;
|
|
298
|
+
slug: string;
|
|
291
299
|
}
|
|
292
300
|
interface RecentRecent {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
301
|
+
id: string;
|
|
302
|
+
content: string;
|
|
303
|
+
up: number;
|
|
304
|
+
down: number;
|
|
305
|
+
created: string;
|
|
298
306
|
}
|
|
299
307
|
interface LastYearPublication {
|
|
300
|
-
|
|
301
|
-
|
|
308
|
+
posts: PostsItem[];
|
|
309
|
+
notes: NotesItem[];
|
|
302
310
|
}
|
|
303
311
|
interface PostsItem {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
312
|
+
id: string;
|
|
313
|
+
created: string;
|
|
314
|
+
title: string;
|
|
315
|
+
slug: string;
|
|
316
|
+
categoryId: string;
|
|
317
|
+
category: Category;
|
|
310
318
|
}
|
|
311
319
|
interface Category {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
320
|
+
id: string;
|
|
321
|
+
type: number;
|
|
322
|
+
name: string;
|
|
323
|
+
slug: string;
|
|
324
|
+
created: string;
|
|
317
325
|
}
|
|
318
326
|
interface NotesItem {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
|
|
327
|
+
id: string;
|
|
328
|
+
created: string;
|
|
329
|
+
title: string;
|
|
330
|
+
mood: string;
|
|
331
|
+
weather: string;
|
|
332
|
+
nid: number;
|
|
333
|
+
bookmark: boolean;
|
|
334
|
+
}
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region models/topic.d.ts
|
|
328
337
|
interface TopicModel extends BaseModel {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
|
|
338
|
+
description?: string;
|
|
339
|
+
introduce: string;
|
|
340
|
+
name: string;
|
|
341
|
+
slug: string;
|
|
342
|
+
icon?: string;
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region models/note.d.ts
|
|
336
346
|
interface NoteModel extends TextBaseModel {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
347
|
+
isPublished: boolean;
|
|
348
|
+
count: {
|
|
349
|
+
read: number;
|
|
350
|
+
like: number;
|
|
351
|
+
};
|
|
352
|
+
mood?: string;
|
|
353
|
+
weather?: string;
|
|
354
|
+
bookmark?: boolean;
|
|
355
|
+
publicAt?: Date;
|
|
356
|
+
password?: string | null;
|
|
357
|
+
nid: number;
|
|
358
|
+
location?: string;
|
|
359
|
+
coordinates?: Coordinate;
|
|
360
|
+
topic?: TopicModel;
|
|
361
|
+
topicId?: string;
|
|
352
362
|
}
|
|
353
363
|
interface Coordinate {
|
|
354
|
-
|
|
355
|
-
|
|
364
|
+
latitude: number;
|
|
365
|
+
longitude: number;
|
|
356
366
|
}
|
|
357
367
|
interface NoteWrappedPayload {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
368
|
+
data: NoteModel;
|
|
369
|
+
next?: Partial<NoteModel>;
|
|
370
|
+
prev?: Partial<NoteModel>;
|
|
361
371
|
}
|
|
362
372
|
interface NoteWrappedWithLikedPayload {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
373
|
+
data: ModelWithLiked<NoteModel>;
|
|
374
|
+
next?: Partial<NoteModel>;
|
|
375
|
+
prev?: Partial<NoteModel>;
|
|
366
376
|
}
|
|
367
|
-
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region models/page.d.ts
|
|
368
379
|
declare enum EnumPageType {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
380
|
+
'md' = "md",
|
|
381
|
+
'html' = "html",
|
|
382
|
+
'frame' = "frame",
|
|
372
383
|
}
|
|
373
384
|
interface PageModel extends TextBaseModel {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
|
|
385
|
+
created: string;
|
|
386
|
+
slug: string;
|
|
387
|
+
subtitle?: string;
|
|
388
|
+
order?: number;
|
|
389
|
+
type?: EnumPageType;
|
|
390
|
+
options?: object;
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region models/say.d.ts
|
|
382
394
|
interface SayModel extends BaseModel {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
395
|
+
text: string;
|
|
396
|
+
source?: string;
|
|
397
|
+
author?: string;
|
|
386
398
|
}
|
|
387
|
-
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region models/setting.d.ts
|
|
388
401
|
declare class SeoOptionModel {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
402
|
+
title: string;
|
|
403
|
+
description: string;
|
|
404
|
+
icon?: string;
|
|
405
|
+
keywords?: string[];
|
|
393
406
|
}
|
|
394
407
|
declare class UrlOptionModel {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
408
|
+
webUrl: string;
|
|
409
|
+
adminUrl: string;
|
|
410
|
+
serverUrl: string;
|
|
411
|
+
wsUrl: string;
|
|
399
412
|
}
|
|
400
413
|
declare class MailOptionModel {
|
|
401
|
-
|
|
402
|
-
|
|
414
|
+
port: number;
|
|
415
|
+
host: string;
|
|
403
416
|
}
|
|
404
417
|
declare class MailOptionsModel {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
418
|
+
enable: boolean;
|
|
419
|
+
user: string;
|
|
420
|
+
pass: string;
|
|
421
|
+
options?: MailOptionModel;
|
|
409
422
|
}
|
|
410
423
|
declare class CommentOptionsModel {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
424
|
+
antiSpam: boolean;
|
|
425
|
+
spamKeywords?: string[];
|
|
426
|
+
blockIps?: string[];
|
|
427
|
+
disableNoChinese?: boolean;
|
|
415
428
|
}
|
|
416
429
|
declare class BackupOptionsModel {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
430
|
+
enable: boolean;
|
|
431
|
+
secretId?: string;
|
|
432
|
+
secretKey?: string;
|
|
433
|
+
bucket?: string;
|
|
434
|
+
region: string;
|
|
422
435
|
}
|
|
423
436
|
declare class BaiduSearchOptionsModel {
|
|
424
|
-
|
|
425
|
-
|
|
437
|
+
enable: boolean;
|
|
438
|
+
token?: string;
|
|
439
|
+
}
|
|
440
|
+
declare class BingSearchOptionsModel {
|
|
441
|
+
enable: boolean;
|
|
442
|
+
token?: string;
|
|
426
443
|
}
|
|
427
444
|
declare class AlgoliaSearchOptionsModel {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
445
|
+
enable: boolean;
|
|
446
|
+
apiKey?: string;
|
|
447
|
+
appId?: string;
|
|
448
|
+
indexName?: string;
|
|
432
449
|
}
|
|
433
450
|
declare class AdminExtraModel {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
451
|
+
background?: string;
|
|
452
|
+
gaodemapKey?: string;
|
|
453
|
+
title?: string;
|
|
454
|
+
/**
|
|
455
|
+
* 是否开启后台反代访问
|
|
456
|
+
*/
|
|
457
|
+
enableAdminProxy?: boolean;
|
|
441
458
|
}
|
|
442
459
|
interface IConfig {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
460
|
+
seo: SeoOptionModel;
|
|
461
|
+
url: UrlOptionModel;
|
|
462
|
+
mailOptions: MailOptionsModel;
|
|
463
|
+
commentOptions: CommentOptionsModel;
|
|
464
|
+
backupOptions: BackupOptionsModel;
|
|
465
|
+
baiduSearchOptions: BaiduSearchOptionsModel;
|
|
466
|
+
algoliaSearchOptions: AlgoliaSearchOptionsModel;
|
|
467
|
+
adminExtra: AdminExtraModel;
|
|
451
468
|
}
|
|
452
469
|
declare type IConfigKeys = keyof IConfig;
|
|
453
|
-
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region models/user.d.ts
|
|
454
472
|
interface UserModel extends BaseModel {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
473
|
+
introduce: string;
|
|
474
|
+
mail: string;
|
|
475
|
+
url: string;
|
|
476
|
+
name: string;
|
|
477
|
+
socialIds: Record<string, string>;
|
|
478
|
+
username: string;
|
|
479
|
+
modified: string;
|
|
480
|
+
v: number;
|
|
481
|
+
lastLoginTime: string;
|
|
482
|
+
lastLoginIp?: string;
|
|
483
|
+
avatar: string;
|
|
484
|
+
postID: string;
|
|
467
485
|
}
|
|
468
486
|
type TLogin = {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
487
|
+
token: string;
|
|
488
|
+
expiresIn: number;
|
|
489
|
+
lastLoginTime: null | string;
|
|
490
|
+
lastLoginIp?: null | string;
|
|
473
491
|
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
474
|
-
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region models/aggregate.d.ts
|
|
475
494
|
interface AggregateRoot {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
495
|
+
user: UserModel;
|
|
496
|
+
seo: SeoOptionModel;
|
|
497
|
+
url: Url;
|
|
498
|
+
categories: CategoryModel[];
|
|
499
|
+
pageMeta: Pick<PageModel, 'title' | 'id' | 'slug' | 'order'>[] | null;
|
|
500
|
+
/**
|
|
501
|
+
* @available 4.2.2
|
|
502
|
+
*/
|
|
503
|
+
latestNoteId: {
|
|
504
|
+
id: string;
|
|
505
|
+
nid: number;
|
|
506
|
+
};
|
|
488
507
|
}
|
|
489
508
|
interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
490
|
-
|
|
509
|
+
theme?: Theme;
|
|
491
510
|
}
|
|
492
511
|
interface Url {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
interface AggregateTopNote extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images'> {
|
|
498
|
-
}
|
|
499
|
-
interface AggregateTopPost extends Pick<PostModel, 'id' | 'slug' | 'created' | 'title' | 'category' | 'images'> {
|
|
512
|
+
wsUrl: string;
|
|
513
|
+
serverUrl: string;
|
|
514
|
+
webUrl: string;
|
|
500
515
|
}
|
|
516
|
+
interface AggregateTopNote extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images'> {}
|
|
517
|
+
interface AggregateTopPost extends Pick<PostModel, 'id' | 'slug' | 'created' | 'title' | 'category' | 'images'> {}
|
|
501
518
|
interface AggregateTop {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
519
|
+
notes: AggregateTopNote[];
|
|
520
|
+
posts: AggregateTopPost[];
|
|
521
|
+
says: SayModel[];
|
|
505
522
|
}
|
|
506
523
|
declare enum TimelineType {
|
|
507
|
-
|
|
508
|
-
|
|
524
|
+
Post = 0,
|
|
525
|
+
Note = 1,
|
|
509
526
|
}
|
|
510
527
|
interface TimelineData {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
528
|
+
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'bookmark'>[];
|
|
529
|
+
posts?: (Pick<PostModel, 'id' | 'title' | 'slug' | 'created' | 'modified' | 'category'> & {
|
|
530
|
+
url: string;
|
|
531
|
+
})[];
|
|
515
532
|
}
|
|
516
533
|
interface AggregateStat {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
|
|
534
|
+
allComments: number;
|
|
535
|
+
categories: number;
|
|
536
|
+
comments: number;
|
|
537
|
+
linkApply: number;
|
|
538
|
+
links: number;
|
|
539
|
+
notes: number;
|
|
540
|
+
pages: number;
|
|
541
|
+
posts: number;
|
|
542
|
+
says: number;
|
|
543
|
+
recently: number;
|
|
544
|
+
unreadComments: number;
|
|
545
|
+
online: number;
|
|
546
|
+
todayMaxOnline: string;
|
|
547
|
+
todayOnlineTotal: string;
|
|
548
|
+
callTime: number;
|
|
549
|
+
uv: number;
|
|
550
|
+
todayIpAccessCount: number;
|
|
551
|
+
}
|
|
552
|
+
//#endregion
|
|
553
|
+
//#region models/ai.d.ts
|
|
536
554
|
interface AISummaryModel {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
|
|
555
|
+
id: string;
|
|
556
|
+
created: string;
|
|
557
|
+
summary: string;
|
|
558
|
+
hash: string;
|
|
559
|
+
refId: string;
|
|
560
|
+
lang: string;
|
|
561
|
+
}
|
|
562
|
+
interface AIDeepReadingModel {
|
|
563
|
+
id: string;
|
|
564
|
+
hash: string;
|
|
565
|
+
refId: string;
|
|
566
|
+
keyPoints: string[];
|
|
567
|
+
criticalAnalysis: string;
|
|
568
|
+
content: string;
|
|
569
|
+
}
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region models/auth.d.ts
|
|
545
572
|
interface AuthUser {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
|
|
573
|
+
id: string;
|
|
574
|
+
email: string;
|
|
575
|
+
isOwner: boolean;
|
|
576
|
+
image: string;
|
|
577
|
+
name: string;
|
|
578
|
+
provider: string;
|
|
579
|
+
handle: string;
|
|
580
|
+
}
|
|
581
|
+
//#endregion
|
|
582
|
+
//#region models/comment.d.ts
|
|
555
583
|
interface CommentModel extends BaseModel {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
584
|
+
refType: CollectionRefTypes;
|
|
585
|
+
ref: string;
|
|
586
|
+
state: number;
|
|
587
|
+
commentsIndex: number;
|
|
588
|
+
author: string;
|
|
589
|
+
text: string;
|
|
590
|
+
mail?: string;
|
|
591
|
+
url?: string;
|
|
592
|
+
ip?: string;
|
|
593
|
+
agent?: string;
|
|
594
|
+
key: string;
|
|
595
|
+
pin?: boolean;
|
|
596
|
+
avatar: string;
|
|
597
|
+
parent?: CommentModel | string;
|
|
598
|
+
children: CommentModel[];
|
|
599
|
+
isWhispers?: boolean;
|
|
600
|
+
location?: string;
|
|
601
|
+
source?: string;
|
|
602
|
+
readerId?: string;
|
|
603
|
+
editedAt?: string;
|
|
576
604
|
}
|
|
577
605
|
interface CommentRef {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
606
|
+
id: string;
|
|
607
|
+
categoryId?: string;
|
|
608
|
+
slug: string;
|
|
609
|
+
title: string;
|
|
610
|
+
category?: CategoryModel;
|
|
583
611
|
}
|
|
584
612
|
declare enum CommentState {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
613
|
+
Unread = 0,
|
|
614
|
+
Read = 1,
|
|
615
|
+
Junk = 2,
|
|
588
616
|
}
|
|
589
|
-
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region models/link.d.ts
|
|
590
619
|
declare enum LinkType {
|
|
591
|
-
|
|
592
|
-
|
|
620
|
+
Friend = 0,
|
|
621
|
+
Collection = 1,
|
|
593
622
|
}
|
|
594
623
|
declare enum LinkState {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
624
|
+
Pass = 0,
|
|
625
|
+
Audit = 1,
|
|
626
|
+
Outdate = 2,
|
|
627
|
+
Banned = 3,
|
|
628
|
+
Reject = 4,
|
|
600
629
|
}
|
|
601
630
|
interface LinkModel extends BaseModel {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
}
|
|
611
|
-
|
|
631
|
+
name: string;
|
|
632
|
+
url: string;
|
|
633
|
+
avatar: string;
|
|
634
|
+
description?: string;
|
|
635
|
+
type: LinkType;
|
|
636
|
+
state: LinkState;
|
|
637
|
+
hide: boolean;
|
|
638
|
+
email: string;
|
|
639
|
+
}
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region models/project.d.ts
|
|
612
642
|
interface ProjectModel extends BaseModel {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
|
|
643
|
+
name: string;
|
|
644
|
+
previewUrl?: string;
|
|
645
|
+
docUrl?: string;
|
|
646
|
+
projectUrl?: string;
|
|
647
|
+
images?: string[];
|
|
648
|
+
description: string;
|
|
649
|
+
avatar?: string;
|
|
650
|
+
text: string;
|
|
651
|
+
}
|
|
652
|
+
//#endregion
|
|
653
|
+
//#region models/reader.d.ts
|
|
623
654
|
interface ReaderModel {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
|
|
655
|
+
email: string;
|
|
656
|
+
name: string;
|
|
657
|
+
handle: string;
|
|
658
|
+
image: string;
|
|
659
|
+
isOwner: boolean;
|
|
660
|
+
}
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region models/recently.d.ts
|
|
631
663
|
declare enum RecentlyRefTypes {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
664
|
+
Post = "Post",
|
|
665
|
+
Note = "Note",
|
|
666
|
+
Page = "Page",
|
|
635
667
|
}
|
|
636
668
|
type RecentlyRefType = {
|
|
637
|
-
|
|
638
|
-
|
|
669
|
+
title: string;
|
|
670
|
+
url: string;
|
|
639
671
|
};
|
|
640
672
|
interface RecentlyModel extends BaseCommentIndexModel {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
673
|
+
content: string;
|
|
674
|
+
ref?: RecentlyRefType & {
|
|
675
|
+
[key: string]: any;
|
|
676
|
+
};
|
|
677
|
+
refId?: string;
|
|
678
|
+
refType?: RecentlyRefTypes;
|
|
679
|
+
up: number;
|
|
680
|
+
down: number;
|
|
681
|
+
modified?: string;
|
|
682
|
+
}
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region models/snippet.d.ts
|
|
651
685
|
declare enum SnippetType {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
686
|
+
JSON = "json",
|
|
687
|
+
Function = "function",
|
|
688
|
+
Text = "text",
|
|
689
|
+
YAML = "yaml",
|
|
656
690
|
}
|
|
657
691
|
interface SnippetModel<T = unknown> extends BaseModel {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}
|
|
668
|
-
|
|
692
|
+
type: SnippetType;
|
|
693
|
+
private: boolean;
|
|
694
|
+
raw: string;
|
|
695
|
+
name: string;
|
|
696
|
+
reference: string;
|
|
697
|
+
comment?: string;
|
|
698
|
+
metatype?: string;
|
|
699
|
+
schema?: string;
|
|
700
|
+
data: T;
|
|
701
|
+
}
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region ../../apps/core/src/modules/subscribe/subscribe.constant.d.ts
|
|
669
704
|
declare const SubscribePostCreateBit: number;
|
|
670
705
|
declare const SubscribeNoteCreateBit: number;
|
|
671
706
|
declare const SubscribeSayCreateBit: number;
|
|
672
707
|
declare const SubscribeRecentCreateBit: number;
|
|
673
708
|
declare const SubscribeAllBit: number;
|
|
674
709
|
declare const SubscribeTypeToBitMap: {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
710
|
+
post_c: number;
|
|
711
|
+
note_c: number;
|
|
712
|
+
say_c: number;
|
|
713
|
+
recently_c: number;
|
|
714
|
+
all: number;
|
|
680
715
|
};
|
|
681
|
-
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region models/subscribe.d.ts
|
|
682
718
|
type SubscribeType = keyof typeof SubscribeTypeToBitMap;
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region controllers/activity.d.ts
|
|
721
|
+
declare module '@mx-space/api-client' {
|
|
722
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
723
|
+
activity: ActivityController<ResponseWrapper>;
|
|
724
|
+
}
|
|
688
725
|
}
|
|
689
726
|
/**
|
|
690
727
|
* @support core >= 4.3.0
|
|
691
728
|
*/
|
|
692
729
|
declare class ActivityController<ResponseWrapper> implements IController {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
730
|
+
private client;
|
|
731
|
+
base: string;
|
|
732
|
+
name: string;
|
|
733
|
+
constructor(client: HTTPClient);
|
|
734
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
735
|
+
likeIt(type: 'Post' | 'Note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
736
|
+
[key: string]: any;
|
|
737
|
+
data: never;
|
|
738
|
+
} : ResponseWrapper extends {
|
|
739
|
+
data: never;
|
|
740
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
741
|
+
data: never;
|
|
742
|
+
}>;
|
|
743
|
+
/**
|
|
744
|
+
*
|
|
745
|
+
* @support core >= 5.0.0
|
|
746
|
+
*/
|
|
747
|
+
getPresence(roomName: string): RequestProxyResult<{
|
|
748
|
+
data: Record<string, ActivityPresence>;
|
|
749
|
+
readers: Record<string, AuthUser>;
|
|
750
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
751
|
+
[key: string]: any;
|
|
752
|
+
data: {
|
|
753
|
+
data: Record<string, ActivityPresence>;
|
|
754
|
+
readers: Record<string, AuthUser>;
|
|
755
|
+
};
|
|
756
|
+
} : ResponseWrapper extends {
|
|
757
|
+
data: {
|
|
758
|
+
data: Record<string, ActivityPresence>;
|
|
759
|
+
readers: Record<string, AuthUser>;
|
|
760
|
+
};
|
|
761
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
762
|
+
data: {
|
|
763
|
+
data: Record<string, ActivityPresence>;
|
|
764
|
+
readers: Record<string, AuthUser>;
|
|
765
|
+
};
|
|
766
|
+
}>;
|
|
767
|
+
/**
|
|
768
|
+
*
|
|
769
|
+
* @support core >= 5.0.0
|
|
770
|
+
*/
|
|
771
|
+
updatePresence({
|
|
772
|
+
identity,
|
|
773
|
+
position,
|
|
774
|
+
roomName,
|
|
775
|
+
sid,
|
|
776
|
+
ts,
|
|
777
|
+
displayName,
|
|
778
|
+
readerId
|
|
779
|
+
}: {
|
|
780
|
+
roomName: string;
|
|
781
|
+
position: number;
|
|
782
|
+
identity: string;
|
|
783
|
+
sid: string;
|
|
784
|
+
displayName?: string;
|
|
785
|
+
ts?: number;
|
|
786
|
+
readerId?: string;
|
|
787
|
+
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
788
|
+
[key: string]: any;
|
|
789
|
+
data: unknown;
|
|
790
|
+
} : ResponseWrapper extends {
|
|
791
|
+
data: unknown;
|
|
792
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
793
|
+
data: unknown;
|
|
794
|
+
}>;
|
|
795
|
+
getRoomsInfo(): Promise<RoomsData & {
|
|
796
|
+
$raw: ResponseWrapper extends {
|
|
797
|
+
data: infer T;
|
|
798
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
799
|
+
[i: string]: any;
|
|
800
|
+
data: (ResponseWrapper extends unknown ? {
|
|
699
801
|
[key: string]: any;
|
|
700
|
-
data:
|
|
701
|
-
|
|
702
|
-
data:
|
|
703
|
-
|
|
704
|
-
data:
|
|
705
|
-
|
|
706
|
-
/**
|
|
707
|
-
*
|
|
708
|
-
* @support core >= 5.0.0
|
|
709
|
-
*/
|
|
710
|
-
getPresence(roomName: string): RequestProxyResult<{
|
|
711
|
-
data: Record<string, ActivityPresence>;
|
|
712
|
-
readers: Record<string, AuthUser>;
|
|
713
|
-
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
802
|
+
data: RoomsData;
|
|
803
|
+
} : ResponseWrapper extends {
|
|
804
|
+
data: RoomsData;
|
|
805
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
806
|
+
data: RoomsData;
|
|
807
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
714
808
|
[key: string]: any;
|
|
715
|
-
data:
|
|
716
|
-
|
|
717
|
-
|
|
809
|
+
data: RoomsData;
|
|
810
|
+
} : ResponseWrapper extends {
|
|
811
|
+
data: RoomsData;
|
|
812
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
813
|
+
data: RoomsData;
|
|
814
|
+
}) ? T_1 extends unknown ? {
|
|
815
|
+
rooms: string[];
|
|
816
|
+
room_count: {
|
|
817
|
+
[key: string]: number;
|
|
718
818
|
};
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
};
|
|
724
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
725
|
-
data: {
|
|
726
|
-
data: Record<string, ActivityPresence>;
|
|
727
|
-
readers: Record<string, AuthUser>;
|
|
819
|
+
objects: {
|
|
820
|
+
posts: RoomOmittedPost[];
|
|
821
|
+
notes: RoomOmittedNote[];
|
|
822
|
+
pages: RoomOmittedPage[];
|
|
728
823
|
};
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
824
|
+
} : T_1 : never : never;
|
|
825
|
+
} : ResponseWrapper;
|
|
826
|
+
$request: {
|
|
827
|
+
path: string;
|
|
828
|
+
method: string;
|
|
829
|
+
[k: string]: string;
|
|
830
|
+
};
|
|
831
|
+
$serialized: RoomsData;
|
|
832
|
+
}>;
|
|
833
|
+
getRecentActivities(): Promise<RecentActivities & {
|
|
834
|
+
$raw: ResponseWrapper extends {
|
|
835
|
+
data: infer T;
|
|
836
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
837
|
+
[i: string]: any;
|
|
838
|
+
data: (ResponseWrapper extends unknown ? {
|
|
743
839
|
[key: string]: any;
|
|
744
|
-
data:
|
|
745
|
-
|
|
746
|
-
data:
|
|
747
|
-
|
|
748
|
-
data:
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
[key: string]: number;
|
|
773
|
-
};
|
|
774
|
-
objects: {
|
|
775
|
-
posts: RoomOmittedPost[];
|
|
776
|
-
notes: RoomOmittedNote[];
|
|
777
|
-
pages: RoomOmittedPage[];
|
|
778
|
-
};
|
|
779
|
-
} : T_1 : never : never;
|
|
780
|
-
} : ResponseWrapper;
|
|
781
|
-
$request: {
|
|
782
|
-
path: string;
|
|
783
|
-
method: string;
|
|
784
|
-
[k: string]: string;
|
|
785
|
-
};
|
|
786
|
-
$serialized: RoomsData;
|
|
787
|
-
}>;
|
|
788
|
-
getRecentActivities(): Promise<RecentActivities & {
|
|
789
|
-
$raw: ResponseWrapper extends {
|
|
790
|
-
data: infer T;
|
|
791
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
792
|
-
[i: string]: any;
|
|
793
|
-
data: (ResponseWrapper extends unknown ? {
|
|
794
|
-
[key: string]: any;
|
|
795
|
-
data: RecentActivities;
|
|
796
|
-
} : ResponseWrapper extends {
|
|
797
|
-
data: RecentActivities;
|
|
798
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
799
|
-
data: RecentActivities;
|
|
800
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
801
|
-
[key: string]: any;
|
|
802
|
-
data: RecentActivities;
|
|
803
|
-
} : ResponseWrapper extends {
|
|
804
|
-
data: RecentActivities;
|
|
805
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
806
|
-
data: RecentActivities;
|
|
807
|
-
}) ? T_1 extends unknown ? {
|
|
808
|
-
like: RecentLike[];
|
|
809
|
-
comment: RecentComment[];
|
|
810
|
-
recent: RecentRecent[];
|
|
811
|
-
post: RecentPost[];
|
|
812
|
-
note: RecentNote[];
|
|
813
|
-
} : T_1 : never : never;
|
|
814
|
-
} : ResponseWrapper;
|
|
815
|
-
$request: {
|
|
816
|
-
path: string;
|
|
817
|
-
method: string;
|
|
818
|
-
[k: string]: string;
|
|
819
|
-
};
|
|
820
|
-
$serialized: RecentActivities;
|
|
821
|
-
}>;
|
|
822
|
-
getLastYearPublication(): Promise<LastYearPublication>;
|
|
840
|
+
data: RecentActivities;
|
|
841
|
+
} : ResponseWrapper extends {
|
|
842
|
+
data: RecentActivities;
|
|
843
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
844
|
+
data: RecentActivities;
|
|
845
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
846
|
+
[key: string]: any;
|
|
847
|
+
data: RecentActivities;
|
|
848
|
+
} : ResponseWrapper extends {
|
|
849
|
+
data: RecentActivities;
|
|
850
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
851
|
+
data: RecentActivities;
|
|
852
|
+
}) ? T_1 extends unknown ? {
|
|
853
|
+
like: RecentLike[];
|
|
854
|
+
comment: RecentComment[];
|
|
855
|
+
recent: RecentRecent[];
|
|
856
|
+
post: RecentPost[];
|
|
857
|
+
note: RecentNote[];
|
|
858
|
+
} : T_1 : never : never;
|
|
859
|
+
} : ResponseWrapper;
|
|
860
|
+
$request: {
|
|
861
|
+
path: string;
|
|
862
|
+
method: string;
|
|
863
|
+
[k: string]: string;
|
|
864
|
+
};
|
|
865
|
+
$serialized: RecentActivities;
|
|
866
|
+
}>;
|
|
867
|
+
getLastYearPublication(): Promise<LastYearPublication>;
|
|
823
868
|
}
|
|
824
|
-
|
|
869
|
+
//#endregion
|
|
870
|
+
//#region interfaces/options.d.ts
|
|
825
871
|
type SortOrder = 'asc' | 'desc';
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region controllers/aggregate.d.ts
|
|
874
|
+
declare module '@mx-space/api-client' {
|
|
875
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
876
|
+
aggregate: AggregateController<ResponseWrapper>;
|
|
877
|
+
}
|
|
831
878
|
}
|
|
832
879
|
declare class AggregateController<ResponseWrapper> implements IController {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
880
|
+
private client;
|
|
881
|
+
base: string;
|
|
882
|
+
name: string;
|
|
883
|
+
constructor(client: HTTPClient);
|
|
884
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
885
|
+
/**
|
|
886
|
+
* 获取聚合数据
|
|
887
|
+
*/
|
|
888
|
+
getAggregateData<Theme>(theme?: string): RequestProxyResult<AggregateRootWithTheme<Theme>, ResponseWrapper>;
|
|
889
|
+
/**
|
|
890
|
+
* 获取最新发布的内容
|
|
891
|
+
*/
|
|
892
|
+
getTop(size?: number): RequestProxyResult<AggregateTop, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
893
|
+
[key: string]: any;
|
|
894
|
+
data: AggregateTop;
|
|
895
|
+
} : ResponseWrapper extends {
|
|
896
|
+
data: AggregateTop;
|
|
897
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
898
|
+
data: AggregateTop;
|
|
899
|
+
}>;
|
|
900
|
+
getTimeline(options?: {
|
|
901
|
+
sort?: SortOrder;
|
|
902
|
+
type?: TimelineType;
|
|
903
|
+
year?: number;
|
|
904
|
+
}): RequestProxyResult<{
|
|
905
|
+
data: TimelineData;
|
|
906
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
907
|
+
[key: string]: any;
|
|
908
|
+
data: {
|
|
909
|
+
data: TimelineData;
|
|
910
|
+
};
|
|
911
|
+
} : ResponseWrapper extends {
|
|
912
|
+
data: {
|
|
913
|
+
data: TimelineData;
|
|
914
|
+
};
|
|
915
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
916
|
+
data: {
|
|
917
|
+
data: TimelineData;
|
|
918
|
+
};
|
|
919
|
+
}>;
|
|
920
|
+
/**
|
|
921
|
+
* 获取聚合数据统计
|
|
922
|
+
*/
|
|
923
|
+
getStat(): RequestProxyResult<AggregateStat, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
924
|
+
[key: string]: any;
|
|
925
|
+
data: AggregateStat;
|
|
926
|
+
} : ResponseWrapper extends {
|
|
927
|
+
data: AggregateStat;
|
|
928
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
929
|
+
data: AggregateStat;
|
|
930
|
+
}>;
|
|
931
|
+
}
|
|
932
|
+
//#endregion
|
|
933
|
+
//#region controllers/ai.d.ts
|
|
934
|
+
declare module '@mx-space/api-client' {
|
|
935
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
936
|
+
ai: AIController<ResponseWrapper>;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* @support core >= 5.6.0
|
|
941
|
+
*/
|
|
942
|
+
declare class AIController<ResponseWrapper> implements IController {
|
|
943
|
+
private client;
|
|
944
|
+
base: string;
|
|
945
|
+
name: string;
|
|
946
|
+
constructor(client: HTTPClient);
|
|
947
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
948
|
+
getSummary({
|
|
949
|
+
articleId,
|
|
950
|
+
lang,
|
|
951
|
+
onlyDb
|
|
952
|
+
}: {
|
|
953
|
+
articleId: string;
|
|
954
|
+
lang?: string;
|
|
955
|
+
onlyDb?: boolean;
|
|
956
|
+
}): Promise<AISummaryModel & {
|
|
957
|
+
$raw: ResponseWrapper extends {
|
|
958
|
+
data: infer T;
|
|
959
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
960
|
+
[i: string]: any;
|
|
961
|
+
data: (ResponseWrapper extends unknown ? {
|
|
962
|
+
[key: string]: any;
|
|
963
|
+
data: AISummaryModel;
|
|
964
|
+
} : ResponseWrapper extends {
|
|
965
|
+
data: AISummaryModel;
|
|
966
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
967
|
+
data: AISummaryModel;
|
|
968
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
969
|
+
[key: string]: any;
|
|
970
|
+
data: AISummaryModel;
|
|
971
|
+
} : ResponseWrapper extends {
|
|
972
|
+
data: AISummaryModel;
|
|
973
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
974
|
+
data: AISummaryModel;
|
|
975
|
+
}) ? T_1 extends unknown ? {
|
|
976
|
+
id: string;
|
|
977
|
+
created: string;
|
|
978
|
+
summary: string;
|
|
979
|
+
hash: string;
|
|
980
|
+
ref_id: string;
|
|
981
|
+
lang: string;
|
|
982
|
+
} : T_1 : never : never;
|
|
983
|
+
} : ResponseWrapper;
|
|
984
|
+
$request: {
|
|
985
|
+
path: string;
|
|
986
|
+
method: string;
|
|
987
|
+
[k: string]: string;
|
|
988
|
+
};
|
|
989
|
+
$serialized: AISummaryModel;
|
|
990
|
+
}>;
|
|
991
|
+
generateSummary(articleId: string, lang?: string, token?: string): Promise<AISummaryModel & {
|
|
992
|
+
$raw: ResponseWrapper extends {
|
|
993
|
+
data: infer T;
|
|
994
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
995
|
+
[i: string]: any;
|
|
996
|
+
data: (ResponseWrapper extends unknown ? {
|
|
846
997
|
[key: string]: any;
|
|
847
|
-
data:
|
|
848
|
-
|
|
849
|
-
data:
|
|
850
|
-
|
|
851
|
-
data:
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
data:
|
|
859
|
-
|
|
998
|
+
data: AISummaryModel;
|
|
999
|
+
} : ResponseWrapper extends {
|
|
1000
|
+
data: AISummaryModel;
|
|
1001
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1002
|
+
data: AISummaryModel;
|
|
1003
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1004
|
+
[key: string]: any;
|
|
1005
|
+
data: AISummaryModel;
|
|
1006
|
+
} : ResponseWrapper extends {
|
|
1007
|
+
data: AISummaryModel;
|
|
1008
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1009
|
+
data: AISummaryModel;
|
|
1010
|
+
}) ? T_1 extends unknown ? {
|
|
1011
|
+
id: string;
|
|
1012
|
+
created: string;
|
|
1013
|
+
summary: string;
|
|
1014
|
+
hash: string;
|
|
1015
|
+
ref_id: string;
|
|
1016
|
+
lang: string;
|
|
1017
|
+
} : T_1 : never : never;
|
|
1018
|
+
} : ResponseWrapper;
|
|
1019
|
+
$request: {
|
|
1020
|
+
path: string;
|
|
1021
|
+
method: string;
|
|
1022
|
+
[k: string]: string;
|
|
1023
|
+
};
|
|
1024
|
+
$serialized: AISummaryModel;
|
|
1025
|
+
}>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Core >= 8.3.0
|
|
1028
|
+
* @param articleId
|
|
1029
|
+
*/
|
|
1030
|
+
getDeepReading(articleId: string): Promise<AIDeepReadingModel & {
|
|
1031
|
+
$raw: ResponseWrapper extends {
|
|
1032
|
+
data: infer T;
|
|
1033
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1034
|
+
[i: string]: any;
|
|
1035
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1036
|
+
[key: string]: any;
|
|
1037
|
+
data: AIDeepReadingModel;
|
|
1038
|
+
} : ResponseWrapper extends {
|
|
1039
|
+
data: AIDeepReadingModel;
|
|
1040
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1041
|
+
data: AIDeepReadingModel;
|
|
1042
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1043
|
+
[key: string]: any;
|
|
1044
|
+
data: AIDeepReadingModel;
|
|
1045
|
+
} : ResponseWrapper extends {
|
|
1046
|
+
data: AIDeepReadingModel;
|
|
1047
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1048
|
+
data: AIDeepReadingModel;
|
|
1049
|
+
}) ? T_1 extends unknown ? {
|
|
1050
|
+
id: string;
|
|
1051
|
+
hash: string;
|
|
1052
|
+
ref_id: string;
|
|
1053
|
+
key_points: string[];
|
|
1054
|
+
critical_analysis: string;
|
|
1055
|
+
content: string;
|
|
1056
|
+
} : T_1 : never : never;
|
|
1057
|
+
} : ResponseWrapper;
|
|
1058
|
+
$request: {
|
|
1059
|
+
path: string;
|
|
1060
|
+
method: string;
|
|
1061
|
+
[k: string]: string;
|
|
1062
|
+
};
|
|
1063
|
+
$serialized: AIDeepReadingModel;
|
|
1064
|
+
}>;
|
|
1065
|
+
}
|
|
1066
|
+
//#endregion
|
|
1067
|
+
//#region controllers/category.d.ts
|
|
1068
|
+
declare module '@mx-space/api-client' {
|
|
1069
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1070
|
+
category: CategoryController<ResponseWrapper>;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
declare class CategoryController<ResponseWrapper> implements IController {
|
|
1074
|
+
private client;
|
|
1075
|
+
name: string;
|
|
1076
|
+
base: string;
|
|
1077
|
+
constructor(client: HTTPClient);
|
|
1078
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1079
|
+
getAllCategories(): RequestProxyResult<{
|
|
1080
|
+
data: CategoryModel[];
|
|
1081
|
+
}, ResponseWrapper>;
|
|
1082
|
+
getAllTags(): RequestProxyResult<{
|
|
1083
|
+
data: TagModel[];
|
|
1084
|
+
}, ResponseWrapper>;
|
|
1085
|
+
getCategoryDetail(id: string): Promise<ResponseProxyExtraRaw<CategoryWithChildrenModel>>;
|
|
1086
|
+
getCategoryDetail(ids: string[]): Promise<ResponseProxyExtraRaw<Map<string, CategoryWithChildrenModel>>>;
|
|
1087
|
+
getCategoryByIdOrSlug(idOrSlug: string): Promise<CategoryModel & {
|
|
1088
|
+
children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
|
|
1089
|
+
} & {
|
|
1090
|
+
$raw: ResponseWrapper extends {
|
|
1091
|
+
data: infer T;
|
|
1092
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1093
|
+
[i: string]: any;
|
|
1094
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1095
|
+
[key: string]: any;
|
|
1096
|
+
data: CategoryWithChildrenModel;
|
|
1097
|
+
} : ResponseWrapper extends {
|
|
1098
|
+
data: CategoryWithChildrenModel;
|
|
1099
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1100
|
+
data: CategoryWithChildrenModel;
|
|
1101
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1102
|
+
[key: string]: any;
|
|
1103
|
+
data: CategoryWithChildrenModel;
|
|
1104
|
+
} : ResponseWrapper extends {
|
|
1105
|
+
data: CategoryWithChildrenModel;
|
|
1106
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1107
|
+
data: CategoryWithChildrenModel;
|
|
1108
|
+
}) ? T_1 extends unknown ? {
|
|
1109
|
+
type: CategoryType;
|
|
1110
|
+
count: number;
|
|
1111
|
+
slug: string;
|
|
1112
|
+
name: string;
|
|
1113
|
+
created: string;
|
|
1114
|
+
id: string;
|
|
1115
|
+
children: Pick<PostModel, "id" | "created" | "title" | "slug" | "modified">[];
|
|
1116
|
+
} : T_1 : never : never;
|
|
1117
|
+
} : ResponseWrapper;
|
|
1118
|
+
$request: {
|
|
1119
|
+
path: string;
|
|
1120
|
+
method: string;
|
|
1121
|
+
[k: string]: string;
|
|
1122
|
+
};
|
|
1123
|
+
$serialized: CategoryWithChildrenModel;
|
|
1124
|
+
}>;
|
|
1125
|
+
getTagByName(name: string): Promise<{
|
|
1126
|
+
tag: string;
|
|
1127
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1128
|
+
} & {
|
|
1129
|
+
$raw: ResponseWrapper extends {
|
|
1130
|
+
data: infer T;
|
|
1131
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1132
|
+
[i: string]: any;
|
|
1133
|
+
data: (ResponseWrapper extends unknown ? {
|
|
860
1134
|
[key: string]: any;
|
|
861
1135
|
data: {
|
|
862
|
-
|
|
1136
|
+
tag: string;
|
|
1137
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
863
1138
|
};
|
|
864
|
-
|
|
1139
|
+
} : ResponseWrapper extends {
|
|
865
1140
|
data: {
|
|
866
|
-
|
|
1141
|
+
tag: string;
|
|
1142
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
867
1143
|
};
|
|
868
|
-
|
|
1144
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
869
1145
|
data: {
|
|
870
|
-
|
|
1146
|
+
tag: string;
|
|
1147
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
871
1148
|
};
|
|
872
|
-
|
|
873
|
-
/**
|
|
874
|
-
* 获取聚合数据统计
|
|
875
|
-
*/
|
|
876
|
-
getStat(): RequestProxyResult<AggregateStat, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1149
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
877
1150
|
[key: string]: any;
|
|
878
|
-
data:
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
882
|
-
data: AggregateStat;
|
|
883
|
-
}>;
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
declare module '../core/client' {
|
|
887
|
-
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
888
|
-
ai: AIController<ResponseWrapper>;
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
/**
|
|
892
|
-
* @support core >= 5.6.0
|
|
893
|
-
*/
|
|
894
|
-
declare class AIController<ResponseWrapper> implements IController {
|
|
895
|
-
private client;
|
|
896
|
-
base: string;
|
|
897
|
-
name: string;
|
|
898
|
-
constructor(client: HTTPClient);
|
|
899
|
-
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
900
|
-
getSummary({ articleId, lang, onlyDb, }: {
|
|
901
|
-
articleId: string;
|
|
902
|
-
lang?: string;
|
|
903
|
-
onlyDb?: boolean;
|
|
904
|
-
}): Promise<AISummaryModel & {
|
|
905
|
-
$raw: ResponseWrapper extends {
|
|
906
|
-
data: infer T;
|
|
907
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
908
|
-
[i: string]: any;
|
|
909
|
-
data: (ResponseWrapper extends unknown ? {
|
|
910
|
-
[key: string]: any;
|
|
911
|
-
data: AISummaryModel;
|
|
912
|
-
} : ResponseWrapper extends {
|
|
913
|
-
data: AISummaryModel;
|
|
914
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
915
|
-
data: AISummaryModel;
|
|
916
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
917
|
-
[key: string]: any;
|
|
918
|
-
data: AISummaryModel;
|
|
919
|
-
} : ResponseWrapper extends {
|
|
920
|
-
data: AISummaryModel;
|
|
921
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
922
|
-
data: AISummaryModel;
|
|
923
|
-
}) ? T_1 extends unknown ? {
|
|
924
|
-
id: string;
|
|
925
|
-
created: string;
|
|
926
|
-
summary: string;
|
|
927
|
-
hash: string;
|
|
928
|
-
ref_id: string;
|
|
929
|
-
lang: string;
|
|
930
|
-
} : T_1 : never : never;
|
|
931
|
-
} : ResponseWrapper;
|
|
932
|
-
$request: {
|
|
933
|
-
path: string;
|
|
934
|
-
method: string;
|
|
935
|
-
[k: string]: string;
|
|
1151
|
+
data: {
|
|
1152
|
+
tag: string;
|
|
1153
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
936
1154
|
};
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
data: infer T;
|
|
942
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
943
|
-
[i: string]: any;
|
|
944
|
-
data: (ResponseWrapper extends unknown ? {
|
|
945
|
-
[key: string]: any;
|
|
946
|
-
data: AISummaryModel;
|
|
947
|
-
} : ResponseWrapper extends {
|
|
948
|
-
data: AISummaryModel;
|
|
949
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
950
|
-
data: AISummaryModel;
|
|
951
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
952
|
-
[key: string]: any;
|
|
953
|
-
data: AISummaryModel;
|
|
954
|
-
} : ResponseWrapper extends {
|
|
955
|
-
data: AISummaryModel;
|
|
956
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
957
|
-
data: AISummaryModel;
|
|
958
|
-
}) ? T_1 extends unknown ? {
|
|
959
|
-
id: string;
|
|
960
|
-
created: string;
|
|
961
|
-
summary: string;
|
|
962
|
-
hash: string;
|
|
963
|
-
ref_id: string;
|
|
964
|
-
lang: string;
|
|
965
|
-
} : T_1 : never : never;
|
|
966
|
-
} : ResponseWrapper;
|
|
967
|
-
$request: {
|
|
968
|
-
path: string;
|
|
969
|
-
method: string;
|
|
970
|
-
[k: string]: string;
|
|
1155
|
+
} : ResponseWrapper extends {
|
|
1156
|
+
data: {
|
|
1157
|
+
tag: string;
|
|
1158
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
971
1159
|
};
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
declare module '../core/client' {
|
|
977
|
-
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
978
|
-
category: CategoryController<ResponseWrapper>;
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
declare class CategoryController<ResponseWrapper> implements IController {
|
|
982
|
-
private client;
|
|
983
|
-
name: string;
|
|
984
|
-
base: string;
|
|
985
|
-
constructor(client: HTTPClient);
|
|
986
|
-
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
987
|
-
getAllCategories(): RequestProxyResult<{
|
|
988
|
-
data: CategoryModel[];
|
|
989
|
-
}, ResponseWrapper>;
|
|
990
|
-
getAllTags(): RequestProxyResult<{
|
|
991
|
-
data: TagModel[];
|
|
992
|
-
}, ResponseWrapper>;
|
|
993
|
-
getCategoryDetail(id: string): Promise<ResponseProxyExtraRaw<CategoryWithChildrenModel>>;
|
|
994
|
-
getCategoryDetail(ids: string[]): Promise<ResponseProxyExtraRaw<Map<string, CategoryWithChildrenModel>>>;
|
|
995
|
-
getCategoryByIdOrSlug(idOrSlug: string): Promise<CategoryModel & {
|
|
996
|
-
children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
|
|
997
|
-
} & {
|
|
998
|
-
$raw: ResponseWrapper extends {
|
|
999
|
-
data: infer T;
|
|
1000
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1001
|
-
[i: string]: any;
|
|
1002
|
-
data: (ResponseWrapper extends unknown ? {
|
|
1003
|
-
[key: string]: any;
|
|
1004
|
-
data: CategoryWithChildrenModel;
|
|
1005
|
-
} : ResponseWrapper extends {
|
|
1006
|
-
data: CategoryWithChildrenModel;
|
|
1007
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1008
|
-
data: CategoryWithChildrenModel;
|
|
1009
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1010
|
-
[key: string]: any;
|
|
1011
|
-
data: CategoryWithChildrenModel;
|
|
1012
|
-
} : ResponseWrapper extends {
|
|
1013
|
-
data: CategoryWithChildrenModel;
|
|
1014
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1015
|
-
data: CategoryWithChildrenModel;
|
|
1016
|
-
}) ? T_1 extends unknown ? {
|
|
1017
|
-
type: CategoryType;
|
|
1018
|
-
count: number;
|
|
1019
|
-
slug: string;
|
|
1020
|
-
name: string;
|
|
1021
|
-
created: string;
|
|
1022
|
-
id: string;
|
|
1023
|
-
children: Pick<PostModel, "id" | "created" | "modified" | "title" | "slug">[];
|
|
1024
|
-
} : T_1 : never : never;
|
|
1025
|
-
} : ResponseWrapper;
|
|
1026
|
-
$request: {
|
|
1027
|
-
path: string;
|
|
1028
|
-
method: string;
|
|
1029
|
-
[k: string]: string;
|
|
1160
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1161
|
+
data: {
|
|
1162
|
+
tag: string;
|
|
1163
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1030
1164
|
};
|
|
1031
|
-
|
|
1032
|
-
}>;
|
|
1033
|
-
getTagByName(name: string): Promise<{
|
|
1165
|
+
}) ? T_1 extends unknown ? {
|
|
1034
1166
|
tag: string;
|
|
1035
|
-
data: Pick<PostModel, "
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
data: {
|
|
1049
|
-
tag: string;
|
|
1050
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1051
|
-
};
|
|
1052
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1053
|
-
data: {
|
|
1054
|
-
tag: string;
|
|
1055
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1056
|
-
};
|
|
1057
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1058
|
-
[key: string]: any;
|
|
1059
|
-
data: {
|
|
1060
|
-
tag: string;
|
|
1061
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1062
|
-
};
|
|
1063
|
-
} : ResponseWrapper extends {
|
|
1064
|
-
data: {
|
|
1065
|
-
tag: string;
|
|
1066
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1067
|
-
};
|
|
1068
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1069
|
-
data: {
|
|
1070
|
-
tag: string;
|
|
1071
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1072
|
-
};
|
|
1073
|
-
}) ? T_1 extends unknown ? {
|
|
1074
|
-
tag: string;
|
|
1075
|
-
data: Pick<PostModel, "id" | "category" | "created" | "title" | "slug">[];
|
|
1076
|
-
} : T_1 : never : never;
|
|
1077
|
-
} : ResponseWrapper;
|
|
1078
|
-
$request: {
|
|
1079
|
-
path: string;
|
|
1080
|
-
method: string;
|
|
1081
|
-
[k: string]: string;
|
|
1082
|
-
};
|
|
1083
|
-
$serialized: {
|
|
1084
|
-
tag: string;
|
|
1085
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1086
|
-
};
|
|
1087
|
-
}>;
|
|
1167
|
+
data: Pick<PostModel, "category" | "id" | "created" | "title" | "slug">[];
|
|
1168
|
+
} : T_1 : never : never;
|
|
1169
|
+
} : ResponseWrapper;
|
|
1170
|
+
$request: {
|
|
1171
|
+
path: string;
|
|
1172
|
+
method: string;
|
|
1173
|
+
[k: string]: string;
|
|
1174
|
+
};
|
|
1175
|
+
$serialized: {
|
|
1176
|
+
tag: string;
|
|
1177
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1178
|
+
};
|
|
1179
|
+
}>;
|
|
1088
1180
|
}
|
|
1089
|
-
|
|
1181
|
+
//#endregion
|
|
1182
|
+
//#region interfaces/params.d.ts
|
|
1090
1183
|
interface PaginationParams {
|
|
1091
|
-
|
|
1092
|
-
|
|
1184
|
+
size?: number;
|
|
1185
|
+
page?: number;
|
|
1093
1186
|
}
|
|
1094
|
-
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region dtos/comment.d.ts
|
|
1095
1189
|
interface CommentDto {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1190
|
+
author: string;
|
|
1191
|
+
text: string;
|
|
1192
|
+
mail: string;
|
|
1193
|
+
url?: string;
|
|
1194
|
+
source?: 'github' | 'google';
|
|
1195
|
+
avatar?: string;
|
|
1196
|
+
}
|
|
1197
|
+
//#endregion
|
|
1198
|
+
//#region controllers/comment.d.ts
|
|
1199
|
+
declare module '@mx-space/api-client' {
|
|
1200
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1201
|
+
comment: CommentController<ResponseWrapper>;
|
|
1202
|
+
}
|
|
1108
1203
|
}
|
|
1109
1204
|
declare class CommentController<ResponseWrapper> implements IController {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1205
|
+
private readonly client;
|
|
1206
|
+
base: string;
|
|
1207
|
+
name: string;
|
|
1208
|
+
constructor(client: HTTPClient);
|
|
1209
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1210
|
+
/**
|
|
1211
|
+
* 根据 comment id 获取评论,包括子评论
|
|
1212
|
+
*/
|
|
1213
|
+
getById(id: string): RequestProxyResult<CommentModel & {
|
|
1214
|
+
ref: string;
|
|
1215
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1216
|
+
[key: string]: any;
|
|
1217
|
+
data: CommentModel & {
|
|
1218
|
+
ref: string;
|
|
1219
|
+
};
|
|
1220
|
+
} : ResponseWrapper extends {
|
|
1221
|
+
data: CommentModel & {
|
|
1222
|
+
ref: string;
|
|
1223
|
+
};
|
|
1224
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1225
|
+
data: CommentModel & {
|
|
1226
|
+
ref: string;
|
|
1227
|
+
};
|
|
1228
|
+
}>;
|
|
1229
|
+
/**
|
|
1230
|
+
* 获取文章的评论列表
|
|
1231
|
+
* @param refId 文章 Id
|
|
1232
|
+
*/
|
|
1233
|
+
getByRefId(refId: string, pagination?: PaginationParams): RequestProxyResult<PaginateResult<CommentModel & {
|
|
1234
|
+
ref: string;
|
|
1235
|
+
}> & {
|
|
1236
|
+
readers: Record<string, ReaderModel>;
|
|
1237
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1238
|
+
[key: string]: any;
|
|
1239
|
+
data: PaginateResult<CommentModel & {
|
|
1240
|
+
ref: string;
|
|
1140
1241
|
}> & {
|
|
1141
|
-
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1182
|
-
data: CommentModel;
|
|
1183
|
-
}>;
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1242
|
+
readers: Record<string, ReaderModel>;
|
|
1243
|
+
};
|
|
1244
|
+
} : ResponseWrapper extends {
|
|
1245
|
+
data: PaginateResult<CommentModel & {
|
|
1246
|
+
ref: string;
|
|
1247
|
+
}> & {
|
|
1248
|
+
readers: Record<string, ReaderModel>;
|
|
1249
|
+
};
|
|
1250
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1251
|
+
data: PaginateResult<CommentModel & {
|
|
1252
|
+
ref: string;
|
|
1253
|
+
}> & {
|
|
1254
|
+
readers: Record<string, ReaderModel>;
|
|
1255
|
+
};
|
|
1256
|
+
}>;
|
|
1257
|
+
/**
|
|
1258
|
+
* 评论
|
|
1259
|
+
*/
|
|
1260
|
+
comment(refId: string, data: CommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1261
|
+
[key: string]: any;
|
|
1262
|
+
data: CommentModel;
|
|
1263
|
+
} : ResponseWrapper extends {
|
|
1264
|
+
data: CommentModel;
|
|
1265
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1266
|
+
data: CommentModel;
|
|
1267
|
+
}>;
|
|
1268
|
+
/**
|
|
1269
|
+
* 回复评论
|
|
1270
|
+
*/
|
|
1271
|
+
reply(commentId: string, data: CommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1272
|
+
[key: string]: any;
|
|
1273
|
+
data: CommentModel;
|
|
1274
|
+
} : ResponseWrapper extends {
|
|
1275
|
+
data: CommentModel;
|
|
1276
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1277
|
+
data: CommentModel;
|
|
1278
|
+
}>;
|
|
1279
|
+
}
|
|
1280
|
+
//#endregion
|
|
1281
|
+
//#region controllers/base.d.ts
|
|
1186
1282
|
type SortOptions = {
|
|
1187
|
-
|
|
1188
|
-
|
|
1283
|
+
sortBy?: string;
|
|
1284
|
+
sortOrder?: 1 | -1 | 'asc' | 'desc';
|
|
1189
1285
|
};
|
|
1190
1286
|
declare abstract class BaseCrudController<T, ResponseWrapper> {
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1287
|
+
protected client: HTTPClient;
|
|
1288
|
+
base: string;
|
|
1289
|
+
constructor(client: HTTPClient);
|
|
1290
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1291
|
+
getById(id: string): RequestProxyResult<T, ResponseWrapper>;
|
|
1292
|
+
getAll(): RequestProxyResult<{
|
|
1293
|
+
data: T[];
|
|
1294
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1295
|
+
[key: string]: any;
|
|
1296
|
+
data: {
|
|
1297
|
+
data: T[];
|
|
1298
|
+
};
|
|
1299
|
+
} : ResponseWrapper extends {
|
|
1300
|
+
data: {
|
|
1301
|
+
data: T[];
|
|
1302
|
+
};
|
|
1303
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1304
|
+
data: {
|
|
1305
|
+
data: T[];
|
|
1306
|
+
};
|
|
1307
|
+
}>;
|
|
1308
|
+
/**
|
|
1309
|
+
* 带分页的查询
|
|
1310
|
+
* @param page
|
|
1311
|
+
* @param perPage
|
|
1312
|
+
*/
|
|
1313
|
+
getAllPaginated(page?: number, perPage?: number, sortOption?: SortOptions): RequestProxyResult<PaginateResult<T>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1314
|
+
[key: string]: any;
|
|
1315
|
+
data: PaginateResult<T>;
|
|
1316
|
+
} : ResponseWrapper extends {
|
|
1317
|
+
data: PaginateResult<T>;
|
|
1318
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1319
|
+
data: PaginateResult<T>;
|
|
1320
|
+
}>;
|
|
1321
|
+
}
|
|
1322
|
+
//#endregion
|
|
1323
|
+
//#region controllers/link.d.ts
|
|
1324
|
+
declare module '@mx-space/api-client' {
|
|
1325
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1326
|
+
link: LinkController<ResponseWrapper>;
|
|
1327
|
+
friend: LinkController<ResponseWrapper>;
|
|
1328
|
+
}
|
|
1232
1329
|
}
|
|
1233
1330
|
declare class LinkController<ResponseWrapper> extends BaseCrudController<LinkModel, ResponseWrapper> {
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1331
|
+
protected readonly client: HTTPClient;
|
|
1332
|
+
constructor(client: HTTPClient);
|
|
1333
|
+
canApplyLink(): Promise<boolean>;
|
|
1334
|
+
applyLink(data: Pick<LinkModel, 'avatar' | 'name' | 'description' | 'url' | 'email'> & {
|
|
1335
|
+
author: string;
|
|
1336
|
+
}): Promise<never>;
|
|
1337
|
+
name: string[];
|
|
1338
|
+
base: string;
|
|
1242
1339
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1340
|
+
//#endregion
|
|
1341
|
+
//#region controllers/note.d.ts
|
|
1342
|
+
declare module '@mx-space/api-client' {
|
|
1343
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1344
|
+
note: NoteController<ResponseWrapper>;
|
|
1345
|
+
}
|
|
1248
1346
|
}
|
|
1249
1347
|
type NoteListOptions = {
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1348
|
+
select?: SelectFields<keyof NoteModel>;
|
|
1349
|
+
year?: number;
|
|
1350
|
+
sortBy?: 'weather' | 'mood' | 'title' | 'created' | 'modified';
|
|
1351
|
+
sortOrder?: 1 | -1;
|
|
1254
1352
|
};
|
|
1255
1353
|
declare class NoteController<ResponseWrapper> implements IController {
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1354
|
+
private client;
|
|
1355
|
+
base: string;
|
|
1356
|
+
name: string;
|
|
1357
|
+
constructor(client: HTTPClient);
|
|
1358
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1359
|
+
/**
|
|
1360
|
+
* 最新日记
|
|
1361
|
+
*/
|
|
1362
|
+
getLatest(): RequestProxyResult<NoteWrappedWithLikedPayload, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1363
|
+
[key: string]: any;
|
|
1364
|
+
data: NoteWrappedWithLikedPayload;
|
|
1365
|
+
} : ResponseWrapper extends {
|
|
1366
|
+
data: NoteWrappedWithLikedPayload;
|
|
1367
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1368
|
+
data: NoteWrappedWithLikedPayload;
|
|
1369
|
+
}>;
|
|
1370
|
+
/**
|
|
1371
|
+
* 获取一篇日记,根据 Id 查询需要鉴权
|
|
1372
|
+
* @param id id | nid
|
|
1373
|
+
* @param password 访问密码
|
|
1374
|
+
*/
|
|
1375
|
+
getNoteById(id: string): Promise<RequestProxyResult<NoteModel, ResponseWrapper>>;
|
|
1376
|
+
getNoteById(id: number): Promise<NoteWrappedPayload>;
|
|
1377
|
+
getNoteById(id: number, password: string): Promise<NoteWrappedPayload>;
|
|
1378
|
+
getNoteById(id: number, password: undefined, singleResult: true): Promise<RequestProxyResult<NoteModel, ResponseWrapper>>;
|
|
1379
|
+
getNoteById(id: number, password: string, singleResult: true): Promise<RequestProxyResult<NoteModel, ResponseWrapper>>;
|
|
1380
|
+
/**
|
|
1381
|
+
* 日记列表分页
|
|
1382
|
+
*/
|
|
1383
|
+
getList(page?: number, perPage?: number, options?: NoteListOptions): RequestProxyResult<PaginateResult<NoteModel>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1384
|
+
[key: string]: any;
|
|
1385
|
+
data: PaginateResult<NoteModel>;
|
|
1386
|
+
} : ResponseWrapper extends {
|
|
1387
|
+
data: PaginateResult<NoteModel>;
|
|
1388
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1389
|
+
data: PaginateResult<NoteModel>;
|
|
1390
|
+
}>;
|
|
1391
|
+
/**
|
|
1392
|
+
* 获取当前日记的上下各 n / 2 篇日记
|
|
1393
|
+
*/
|
|
1394
|
+
getMiddleList(id: string, size?: number): RequestProxyResult<{
|
|
1395
|
+
data: Pick<NoteModel, "id" | "title" | "nid" | "created" | "isPublished">[];
|
|
1396
|
+
size: number;
|
|
1397
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1398
|
+
[key: string]: any;
|
|
1399
|
+
data: {
|
|
1400
|
+
data: Pick<NoteModel, "id" | "title" | "nid" | "created" | "isPublished">[];
|
|
1401
|
+
size: number;
|
|
1402
|
+
};
|
|
1403
|
+
} : ResponseWrapper extends {
|
|
1404
|
+
data: {
|
|
1405
|
+
data: Pick<NoteModel, "id" | "title" | "nid" | "created" | "isPublished">[];
|
|
1406
|
+
size: number;
|
|
1407
|
+
};
|
|
1408
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1409
|
+
data: {
|
|
1410
|
+
data: Pick<NoteModel, "id" | "title" | "nid" | "created" | "isPublished">[];
|
|
1411
|
+
size: number;
|
|
1412
|
+
};
|
|
1413
|
+
}>;
|
|
1414
|
+
/**
|
|
1415
|
+
* 获取专栏内的所有日记
|
|
1416
|
+
*/
|
|
1417
|
+
getNoteByTopicId(topicId: string, page?: number, size?: number, sortOptions?: SortOptions): RequestProxyResult<PaginateResult<NoteModel>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1418
|
+
[key: string]: any;
|
|
1419
|
+
data: PaginateResult<NoteModel>;
|
|
1420
|
+
} : ResponseWrapper extends {
|
|
1421
|
+
data: PaginateResult<NoteModel>;
|
|
1422
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1423
|
+
data: PaginateResult<NoteModel>;
|
|
1424
|
+
}>;
|
|
1425
|
+
}
|
|
1426
|
+
//#endregion
|
|
1427
|
+
//#region controllers/page.d.ts
|
|
1428
|
+
declare module '@mx-space/api-client' {
|
|
1429
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1430
|
+
page: PageController<ResponseWrapper>;
|
|
1431
|
+
}
|
|
1333
1432
|
}
|
|
1334
1433
|
type PageListOptions = {
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1434
|
+
select?: SelectFields<keyof PageModel>;
|
|
1435
|
+
sortBy?: 'order' | 'subtitle' | 'title' | 'created' | 'modified';
|
|
1436
|
+
sortOrder?: 1 | -1;
|
|
1338
1437
|
};
|
|
1339
1438
|
declare class PageController<ResponseWrapper> implements IController {
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1439
|
+
private readonly client;
|
|
1440
|
+
constructor(client: HTTPClient);
|
|
1441
|
+
base: string;
|
|
1442
|
+
name: string;
|
|
1443
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1444
|
+
/**
|
|
1445
|
+
* 页面列表
|
|
1446
|
+
*/
|
|
1447
|
+
getList(page?: number, perPage?: number, options?: PageListOptions): RequestProxyResult<PaginateResult<PageModel>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1448
|
+
[key: string]: any;
|
|
1449
|
+
data: PaginateResult<PageModel>;
|
|
1450
|
+
} : ResponseWrapper extends {
|
|
1451
|
+
data: PaginateResult<PageModel>;
|
|
1452
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1453
|
+
data: PaginateResult<PageModel>;
|
|
1454
|
+
}>;
|
|
1455
|
+
/**
|
|
1456
|
+
* 页面详情
|
|
1457
|
+
*/
|
|
1458
|
+
getById(id: string): RequestProxyResult<PageModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1459
|
+
[key: string]: any;
|
|
1460
|
+
data: PageModel;
|
|
1461
|
+
} : ResponseWrapper extends {
|
|
1462
|
+
data: PageModel;
|
|
1463
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1464
|
+
data: PageModel;
|
|
1465
|
+
}>;
|
|
1466
|
+
/**
|
|
1467
|
+
* 根据路径获取页面
|
|
1468
|
+
* @param slug 路径
|
|
1469
|
+
* @returns
|
|
1470
|
+
*/
|
|
1471
|
+
getBySlug(slug: string): RequestProxyResult<PageModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1472
|
+
[key: string]: any;
|
|
1473
|
+
data: PageModel;
|
|
1474
|
+
} : ResponseWrapper extends {
|
|
1475
|
+
data: PageModel;
|
|
1476
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1477
|
+
data: PageModel;
|
|
1478
|
+
}>;
|
|
1479
|
+
}
|
|
1480
|
+
//#endregion
|
|
1481
|
+
//#region controllers/post.d.ts
|
|
1482
|
+
declare module '@mx-space/api-client' {
|
|
1483
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1484
|
+
post: PostController<ResponseWrapper>;
|
|
1485
|
+
}
|
|
1386
1486
|
}
|
|
1387
1487
|
type PostListOptions = {
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1488
|
+
select?: SelectFields<keyof PostModel>;
|
|
1489
|
+
year?: number;
|
|
1490
|
+
sortBy?: 'categoryId' | 'title' | 'created' | 'modified';
|
|
1491
|
+
sortOrder?: 1 | -1;
|
|
1492
|
+
truncate?: number;
|
|
1393
1493
|
};
|
|
1394
1494
|
declare class PostController<ResponseWrapper> implements IController {
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1495
|
+
private client;
|
|
1496
|
+
constructor(client: HTTPClient);
|
|
1497
|
+
base: string;
|
|
1498
|
+
name: string;
|
|
1499
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1500
|
+
/**
|
|
1501
|
+
* 获取文章列表分页
|
|
1502
|
+
* @param page
|
|
1503
|
+
* @param perPage
|
|
1504
|
+
* @returns
|
|
1505
|
+
*/
|
|
1506
|
+
getList(page?: number, perPage?: number, options?: PostListOptions): RequestProxyResult<PaginateResult<PostModel>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1507
|
+
[key: string]: any;
|
|
1508
|
+
data: PaginateResult<PostModel>;
|
|
1509
|
+
} : ResponseWrapper extends {
|
|
1510
|
+
data: PaginateResult<PostModel>;
|
|
1511
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1512
|
+
data: PaginateResult<PostModel>;
|
|
1513
|
+
}>;
|
|
1514
|
+
/**
|
|
1515
|
+
* 根据分类和路径查找文章
|
|
1516
|
+
* @param categoryName
|
|
1517
|
+
* @param slug
|
|
1518
|
+
*/
|
|
1519
|
+
getPost(categoryName: string, slug: string): RequestProxyResult<ModelWithLiked<PostModel>, ResponseWrapper>;
|
|
1520
|
+
/**
|
|
1521
|
+
* 根据 ID 查找文章
|
|
1522
|
+
* @param id
|
|
1523
|
+
*/
|
|
1524
|
+
getPost(id: string): RequestProxyResult<PostModel, ResponseWrapper>;
|
|
1525
|
+
/**
|
|
1526
|
+
* 获取最新的文章
|
|
1527
|
+
*/
|
|
1528
|
+
getLatest(): RequestProxyResult<ModelWithLiked<PostModel>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1529
|
+
[key: string]: any;
|
|
1530
|
+
data: ModelWithLiked<PostModel>;
|
|
1531
|
+
} : ResponseWrapper extends {
|
|
1532
|
+
data: ModelWithLiked<PostModel>;
|
|
1533
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1534
|
+
data: ModelWithLiked<PostModel>;
|
|
1535
|
+
}>;
|
|
1536
|
+
getFullUrl(slug: string): RequestProxyResult<{
|
|
1537
|
+
path: string;
|
|
1538
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1539
|
+
[key: string]: any;
|
|
1540
|
+
data: {
|
|
1541
|
+
path: string;
|
|
1542
|
+
};
|
|
1543
|
+
} : ResponseWrapper extends {
|
|
1544
|
+
data: {
|
|
1545
|
+
path: string;
|
|
1546
|
+
};
|
|
1547
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1548
|
+
data: {
|
|
1549
|
+
path: string;
|
|
1550
|
+
};
|
|
1551
|
+
}>;
|
|
1452
1552
|
}
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1553
|
+
//#endregion
|
|
1554
|
+
//#region controllers/project.d.ts
|
|
1555
|
+
declare module '@mx-space/api-client' {
|
|
1556
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1557
|
+
project: ProjectController<ResponseWrapper>;
|
|
1558
|
+
}
|
|
1458
1559
|
}
|
|
1459
1560
|
declare class ProjectController<ResponseWrapper> extends BaseCrudController<ProjectModel, ResponseWrapper> {
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1561
|
+
protected readonly client: HTTPClient;
|
|
1562
|
+
constructor(client: HTTPClient);
|
|
1563
|
+
base: string;
|
|
1564
|
+
name: string;
|
|
1565
|
+
}
|
|
1566
|
+
//#endregion
|
|
1567
|
+
//#region controllers/recently.d.ts
|
|
1568
|
+
declare module '@mx-space/api-client' {
|
|
1569
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1570
|
+
recently: RecentlyController<ResponseWrapper>;
|
|
1571
|
+
shorthand: RecentlyController<ResponseWrapper>;
|
|
1572
|
+
}
|
|
1471
1573
|
}
|
|
1472
1574
|
declare enum RecentlyAttitudeResultEnum {
|
|
1473
|
-
|
|
1474
|
-
|
|
1575
|
+
Inc = 1,
|
|
1576
|
+
Dec = -1,
|
|
1475
1577
|
}
|
|
1476
1578
|
declare enum RecentlyAttitudeEnum {
|
|
1477
|
-
|
|
1478
|
-
|
|
1579
|
+
Up = 0,
|
|
1580
|
+
Down = 1,
|
|
1479
1581
|
}
|
|
1480
1582
|
declare class RecentlyController<ResponseWrapper> implements IController {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1583
|
+
private readonly client;
|
|
1584
|
+
base: string;
|
|
1585
|
+
name: string[];
|
|
1586
|
+
constructor(client: HTTPClient);
|
|
1587
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1588
|
+
/**
|
|
1589
|
+
* 获取最新一条
|
|
1590
|
+
*/
|
|
1591
|
+
getLatestOne(): RequestProxyResult<RecentlyModel & {
|
|
1592
|
+
comments: number;
|
|
1593
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1594
|
+
[key: string]: any;
|
|
1595
|
+
data: RecentlyModel & {
|
|
1596
|
+
comments: number;
|
|
1597
|
+
};
|
|
1598
|
+
} : ResponseWrapper extends {
|
|
1599
|
+
data: RecentlyModel & {
|
|
1600
|
+
comments: number;
|
|
1601
|
+
};
|
|
1602
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1603
|
+
data: RecentlyModel & {
|
|
1604
|
+
comments: number;
|
|
1605
|
+
};
|
|
1606
|
+
}>;
|
|
1607
|
+
getAll(): RequestProxyResult<{
|
|
1608
|
+
data: RecentlyModel[] & {
|
|
1609
|
+
comments: number;
|
|
1610
|
+
};
|
|
1611
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1612
|
+
[key: string]: any;
|
|
1613
|
+
data: {
|
|
1614
|
+
data: RecentlyModel[] & {
|
|
1490
1615
|
comments: number;
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
} : ResponseWrapper extends {
|
|
1497
|
-
data: RecentlyModel & {
|
|
1498
|
-
comments: number;
|
|
1499
|
-
};
|
|
1500
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1501
|
-
data: RecentlyModel & {
|
|
1502
|
-
comments: number;
|
|
1503
|
-
};
|
|
1504
|
-
}>;
|
|
1505
|
-
getAll(): RequestProxyResult<{
|
|
1506
|
-
data: RecentlyModel[] & {
|
|
1507
|
-
comments: number;
|
|
1508
|
-
};
|
|
1509
|
-
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1510
|
-
[key: string]: any;
|
|
1511
|
-
data: {
|
|
1512
|
-
data: RecentlyModel[] & {
|
|
1513
|
-
comments: number;
|
|
1514
|
-
};
|
|
1515
|
-
};
|
|
1516
|
-
} : ResponseWrapper extends {
|
|
1517
|
-
data: {
|
|
1518
|
-
data: RecentlyModel[] & {
|
|
1519
|
-
comments: number;
|
|
1520
|
-
};
|
|
1521
|
-
};
|
|
1522
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1523
|
-
data: {
|
|
1524
|
-
data: RecentlyModel[] & {
|
|
1525
|
-
comments: number;
|
|
1526
|
-
};
|
|
1527
|
-
};
|
|
1528
|
-
}>;
|
|
1529
|
-
getList({ before, after, size, }?: {
|
|
1530
|
-
before?: string | undefined;
|
|
1531
|
-
after?: string | undefined;
|
|
1532
|
-
size?: number | number;
|
|
1533
|
-
}): RequestProxyResult<{
|
|
1534
|
-
data: RecentlyModel[] & {
|
|
1535
|
-
comments: number;
|
|
1536
|
-
};
|
|
1537
|
-
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1538
|
-
[key: string]: any;
|
|
1539
|
-
data: {
|
|
1540
|
-
data: RecentlyModel[] & {
|
|
1541
|
-
comments: number;
|
|
1542
|
-
};
|
|
1543
|
-
};
|
|
1544
|
-
} : ResponseWrapper extends {
|
|
1545
|
-
data: {
|
|
1546
|
-
data: RecentlyModel[] & {
|
|
1547
|
-
comments: number;
|
|
1548
|
-
};
|
|
1549
|
-
};
|
|
1550
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1551
|
-
data: {
|
|
1552
|
-
data: RecentlyModel[] & {
|
|
1553
|
-
comments: number;
|
|
1554
|
-
};
|
|
1555
|
-
};
|
|
1556
|
-
}>;
|
|
1557
|
-
getById(id: string): RequestProxyResult<RecentlyModel & {
|
|
1616
|
+
};
|
|
1617
|
+
};
|
|
1618
|
+
} : ResponseWrapper extends {
|
|
1619
|
+
data: {
|
|
1620
|
+
data: RecentlyModel[] & {
|
|
1558
1621
|
comments: number;
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1622
|
+
};
|
|
1623
|
+
};
|
|
1624
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1625
|
+
data: {
|
|
1626
|
+
data: RecentlyModel[] & {
|
|
1627
|
+
comments: number;
|
|
1628
|
+
};
|
|
1629
|
+
};
|
|
1630
|
+
}>;
|
|
1631
|
+
getList({
|
|
1632
|
+
before,
|
|
1633
|
+
after,
|
|
1634
|
+
size
|
|
1635
|
+
}?: {
|
|
1636
|
+
before?: string | undefined;
|
|
1637
|
+
after?: string | undefined;
|
|
1638
|
+
size?: number | number;
|
|
1639
|
+
}): RequestProxyResult<{
|
|
1640
|
+
data: RecentlyModel[] & {
|
|
1641
|
+
comments: number;
|
|
1642
|
+
};
|
|
1643
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1644
|
+
[key: string]: any;
|
|
1645
|
+
data: {
|
|
1646
|
+
data: RecentlyModel[] & {
|
|
1647
|
+
comments: number;
|
|
1648
|
+
};
|
|
1649
|
+
};
|
|
1650
|
+
} : ResponseWrapper extends {
|
|
1651
|
+
data: {
|
|
1652
|
+
data: RecentlyModel[] & {
|
|
1653
|
+
comments: number;
|
|
1654
|
+
};
|
|
1655
|
+
};
|
|
1656
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1657
|
+
data: {
|
|
1658
|
+
data: RecentlyModel[] & {
|
|
1659
|
+
comments: number;
|
|
1660
|
+
};
|
|
1661
|
+
};
|
|
1662
|
+
}>;
|
|
1663
|
+
getById(id: string): RequestProxyResult<RecentlyModel & {
|
|
1664
|
+
comments: number;
|
|
1665
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1666
|
+
[key: string]: any;
|
|
1667
|
+
data: RecentlyModel & {
|
|
1668
|
+
comments: number;
|
|
1669
|
+
};
|
|
1670
|
+
} : ResponseWrapper extends {
|
|
1671
|
+
data: RecentlyModel & {
|
|
1672
|
+
comments: number;
|
|
1673
|
+
};
|
|
1674
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1675
|
+
data: RecentlyModel & {
|
|
1676
|
+
comments: number;
|
|
1677
|
+
};
|
|
1678
|
+
}>;
|
|
1679
|
+
/** 表态:点赞,点踩 */
|
|
1680
|
+
attitude(id: string, attitude: RecentlyAttitudeEnum): RequestProxyResult<{
|
|
1681
|
+
code: RecentlyAttitudeResultEnum;
|
|
1682
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1683
|
+
[key: string]: any;
|
|
1684
|
+
data: {
|
|
1685
|
+
code: RecentlyAttitudeResultEnum;
|
|
1686
|
+
};
|
|
1687
|
+
} : ResponseWrapper extends {
|
|
1688
|
+
data: {
|
|
1689
|
+
code: RecentlyAttitudeResultEnum;
|
|
1690
|
+
};
|
|
1691
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1692
|
+
data: {
|
|
1693
|
+
code: RecentlyAttitudeResultEnum;
|
|
1694
|
+
};
|
|
1695
|
+
}>;
|
|
1590
1696
|
}
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1697
|
+
//#endregion
|
|
1698
|
+
//#region controllers/say.d.ts
|
|
1699
|
+
declare module '@mx-space/api-client' {
|
|
1700
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1701
|
+
say: SayController<ResponseWrapper>;
|
|
1702
|
+
}
|
|
1596
1703
|
}
|
|
1597
1704
|
declare class SayController<ResponseWrapper> extends BaseCrudController<SayModel, ResponseWrapper> implements IController {
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1705
|
+
protected client: HTTPClient;
|
|
1706
|
+
base: string;
|
|
1707
|
+
name: string;
|
|
1708
|
+
constructor(client: HTTPClient);
|
|
1709
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1710
|
+
/**
|
|
1711
|
+
* 获取随机一条
|
|
1712
|
+
*/
|
|
1713
|
+
getRandom(): RequestProxyResult<{
|
|
1714
|
+
data: SayModel | null;
|
|
1715
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1716
|
+
[key: string]: any;
|
|
1717
|
+
data: {
|
|
1718
|
+
data: SayModel | null;
|
|
1719
|
+
};
|
|
1720
|
+
} : ResponseWrapper extends {
|
|
1721
|
+
data: {
|
|
1722
|
+
data: SayModel | null;
|
|
1723
|
+
};
|
|
1724
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1725
|
+
data: {
|
|
1726
|
+
data: SayModel | null;
|
|
1727
|
+
};
|
|
1728
|
+
}>;
|
|
1622
1729
|
}
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1730
|
+
//#endregion
|
|
1731
|
+
//#region controllers/search.d.ts
|
|
1732
|
+
declare module '@mx-space/api-client' {
|
|
1733
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1734
|
+
search: SearchController<ResponseWrapper>;
|
|
1735
|
+
}
|
|
1628
1736
|
}
|
|
1629
1737
|
type SearchOption = {
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1738
|
+
orderBy?: string;
|
|
1739
|
+
order?: number;
|
|
1740
|
+
rawAlgolia?: boolean;
|
|
1633
1741
|
};
|
|
1634
1742
|
declare class SearchController<ResponseWrapper> implements IController {
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1743
|
+
private readonly client;
|
|
1744
|
+
base: string;
|
|
1745
|
+
name: string;
|
|
1746
|
+
constructor(client: HTTPClient);
|
|
1747
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1748
|
+
search(type: 'note', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<NoteModel, 'modified' | 'id' | 'title' | 'created' | 'nid'>>, ResponseWrapper>>;
|
|
1749
|
+
search(type: 'post', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<PostModel, 'modified' | 'id' | 'title' | 'created' | 'slug' | 'category'>>, ResponseWrapper>>;
|
|
1750
|
+
/**
|
|
1751
|
+
* 从 algolya 搜索
|
|
1752
|
+
* https://www.algolia.com/doc/api-reference/api-methods/search/
|
|
1753
|
+
* @param keyword
|
|
1754
|
+
* @param options
|
|
1755
|
+
* @returns
|
|
1756
|
+
*/
|
|
1757
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1758
|
+
type: "post";
|
|
1759
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1760
|
+
type: "note";
|
|
1761
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1762
|
+
type: "page";
|
|
1763
|
+
})> & {
|
|
1642
1764
|
/**
|
|
1643
|
-
*
|
|
1644
|
-
* https://www.algolia.com/doc/api-reference/api-methods/search/
|
|
1645
|
-
* @param keyword
|
|
1646
|
-
* @param options
|
|
1647
|
-
* @returns
|
|
1765
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
1648
1766
|
*/
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1767
|
+
raw?: any;
|
|
1768
|
+
}, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1769
|
+
[key: string]: any;
|
|
1770
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1771
|
+
type: "post";
|
|
1772
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1773
|
+
type: "note";
|
|
1774
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1775
|
+
type: "page";
|
|
1655
1776
|
})> & {
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
}, ResponseWrapper
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "id" | "category" | "created" | "modified" | "title" | "slug"> & {
|
|
1689
|
-
type: "post";
|
|
1690
|
-
}) | (Pick<NoteModel, "id" | "created" | "modified" | "title" | "nid"> & {
|
|
1691
|
-
type: "note";
|
|
1692
|
-
}) | (Pick<PageModel, "id" | "created" | "modified" | "title" | "slug"> & {
|
|
1693
|
-
type: "page";
|
|
1694
|
-
})> & {
|
|
1695
|
-
/**
|
|
1696
|
-
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
1697
|
-
*/
|
|
1698
|
-
raw?: any;
|
|
1699
|
-
}, ResponseWrapper>;
|
|
1700
|
-
}>;
|
|
1777
|
+
/**
|
|
1778
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
1779
|
+
*/
|
|
1780
|
+
raw?: any;
|
|
1781
|
+
}, ResponseWrapper>;
|
|
1782
|
+
} : ResponseWrapper extends {
|
|
1783
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1784
|
+
type: "post";
|
|
1785
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1786
|
+
type: "note";
|
|
1787
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1788
|
+
type: "page";
|
|
1789
|
+
})> & {
|
|
1790
|
+
/**
|
|
1791
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
1792
|
+
*/
|
|
1793
|
+
raw?: any;
|
|
1794
|
+
}, ResponseWrapper>;
|
|
1795
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1796
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1797
|
+
type: "post";
|
|
1798
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1799
|
+
type: "note";
|
|
1800
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1801
|
+
type: "page";
|
|
1802
|
+
})> & {
|
|
1803
|
+
/**
|
|
1804
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
1805
|
+
*/
|
|
1806
|
+
raw?: any;
|
|
1807
|
+
}, ResponseWrapper>;
|
|
1808
|
+
}>;
|
|
1701
1809
|
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1810
|
+
//#endregion
|
|
1811
|
+
//#region controllers/severless.d.ts
|
|
1812
|
+
declare module '@mx-space/api-client' {
|
|
1813
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1814
|
+
serverless: ServerlessController<ResponseWrapper>;
|
|
1815
|
+
}
|
|
1707
1816
|
}
|
|
1708
1817
|
declare class ServerlessController<ResponseWrapper> implements IController {
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1818
|
+
protected client: HTTPClient;
|
|
1819
|
+
base: string;
|
|
1820
|
+
name: string;
|
|
1821
|
+
constructor(client: HTTPClient);
|
|
1822
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1823
|
+
getByReferenceAndName<T = unknown>(reference: string, name: string): RequestProxyResult<T, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1824
|
+
[key: string]: any;
|
|
1825
|
+
data: T;
|
|
1826
|
+
} : ResponseWrapper extends {
|
|
1827
|
+
data: T;
|
|
1828
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1829
|
+
data: T;
|
|
1830
|
+
}>;
|
|
1722
1831
|
}
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1832
|
+
//#endregion
|
|
1833
|
+
//#region controllers/snippet.d.ts
|
|
1834
|
+
declare module '@mx-space/api-client' {
|
|
1835
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1836
|
+
snippet: SnippetController<ResponseWrapper>;
|
|
1837
|
+
}
|
|
1728
1838
|
}
|
|
1729
1839
|
declare class SnippetController<ResponseWrapper> implements IController {
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1840
|
+
protected client: HTTPClient;
|
|
1841
|
+
base: string;
|
|
1842
|
+
name: string;
|
|
1843
|
+
constructor(client: HTTPClient);
|
|
1844
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1845
|
+
getByReferenceAndName<T = unknown>(reference: string, name: string): RequestProxyResult<T, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1846
|
+
[key: string]: any;
|
|
1847
|
+
data: T;
|
|
1848
|
+
} : ResponseWrapper extends {
|
|
1849
|
+
data: T;
|
|
1850
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1851
|
+
data: T;
|
|
1852
|
+
}>;
|
|
1743
1853
|
}
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1854
|
+
//#endregion
|
|
1855
|
+
//#region controllers/subscribe.d.ts
|
|
1856
|
+
declare module '@mx-space/api-client' {
|
|
1857
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1858
|
+
subscribe: SubscribeController<ResponseWrapper>;
|
|
1859
|
+
}
|
|
1749
1860
|
}
|
|
1750
1861
|
declare class SubscribeController<ResponseWrapper> implements IController {
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1862
|
+
protected client: HTTPClient;
|
|
1863
|
+
base: string;
|
|
1864
|
+
name: string;
|
|
1865
|
+
constructor(client: HTTPClient);
|
|
1866
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1867
|
+
/**
|
|
1868
|
+
* 检查开启状态
|
|
1869
|
+
*/
|
|
1870
|
+
check(): RequestProxyResult<{
|
|
1871
|
+
enable: boolean;
|
|
1872
|
+
bitMap: Record<SubscribeType, number>;
|
|
1873
|
+
allowBits: number[];
|
|
1874
|
+
allowTypes: SubscribeType[];
|
|
1875
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1876
|
+
[key: string]: any;
|
|
1877
|
+
data: {
|
|
1878
|
+
enable: boolean;
|
|
1879
|
+
bitMap: Record<SubscribeType, number>;
|
|
1880
|
+
allowBits: number[];
|
|
1881
|
+
allowTypes: SubscribeType[];
|
|
1882
|
+
};
|
|
1883
|
+
} : ResponseWrapper extends {
|
|
1884
|
+
data: {
|
|
1885
|
+
enable: boolean;
|
|
1886
|
+
bitMap: Record<SubscribeType, number>;
|
|
1887
|
+
allowBits: number[];
|
|
1888
|
+
allowTypes: SubscribeType[];
|
|
1889
|
+
};
|
|
1890
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1891
|
+
data: {
|
|
1892
|
+
enable: boolean;
|
|
1893
|
+
bitMap: Record<SubscribeType, number>;
|
|
1894
|
+
allowBits: number[];
|
|
1895
|
+
allowTypes: SubscribeType[];
|
|
1896
|
+
};
|
|
1897
|
+
}>;
|
|
1898
|
+
subscribe(email: string, types: SubscribeType[]): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1899
|
+
[key: string]: any;
|
|
1900
|
+
data: never;
|
|
1901
|
+
} : ResponseWrapper extends {
|
|
1902
|
+
data: never;
|
|
1903
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1904
|
+
data: never;
|
|
1905
|
+
}>;
|
|
1906
|
+
unsubscribe(email: string, cancelToken: string): RequestProxyResult<string, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1907
|
+
[key: string]: any;
|
|
1908
|
+
data: string;
|
|
1909
|
+
} : ResponseWrapper extends {
|
|
1910
|
+
data: string;
|
|
1911
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1912
|
+
data: string;
|
|
1913
|
+
}>;
|
|
1914
|
+
}
|
|
1915
|
+
//#endregion
|
|
1916
|
+
//#region controllers/topic.d.ts
|
|
1917
|
+
declare module '@mx-space/api-client' {
|
|
1918
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1919
|
+
topic: TopicController<ResponseWrapper>;
|
|
1920
|
+
}
|
|
1809
1921
|
}
|
|
1810
1922
|
declare class TopicController<ResponseWrapper> extends BaseCrudController<TopicModel, ResponseWrapper> implements IController {
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1923
|
+
protected client: HTTPClient;
|
|
1924
|
+
base: string;
|
|
1925
|
+
name: string;
|
|
1926
|
+
constructor(client: HTTPClient);
|
|
1927
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1928
|
+
getTopicBySlug(slug: string): RequestProxyResult<TopicModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1929
|
+
[key: string]: any;
|
|
1930
|
+
data: TopicModel;
|
|
1931
|
+
} : ResponseWrapper extends {
|
|
1932
|
+
data: TopicModel;
|
|
1933
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1934
|
+
data: TopicModel;
|
|
1935
|
+
}>;
|
|
1936
|
+
}
|
|
1937
|
+
//#endregion
|
|
1938
|
+
//#region controllers/user.d.ts
|
|
1939
|
+
declare module '@mx-space/api-client' {
|
|
1940
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1941
|
+
user: UserController<ResponseWrapper>;
|
|
1942
|
+
master: UserController<ResponseWrapper>;
|
|
1943
|
+
}
|
|
1831
1944
|
}
|
|
1832
1945
|
declare class UserController<ResponseWrapper> implements IController {
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1946
|
+
private readonly client;
|
|
1947
|
+
constructor(client: HTTPClient);
|
|
1948
|
+
base: string;
|
|
1949
|
+
name: string[];
|
|
1950
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1951
|
+
getMasterInfo(): RequestProxyResult<UserModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1952
|
+
[key: string]: any;
|
|
1953
|
+
data: UserModel;
|
|
1954
|
+
} : ResponseWrapper extends {
|
|
1955
|
+
data: UserModel;
|
|
1956
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1957
|
+
data: UserModel;
|
|
1958
|
+
}>;
|
|
1959
|
+
login(username: string, password: string): RequestProxyResult<TLogin, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1960
|
+
[key: string]: any;
|
|
1961
|
+
data: TLogin;
|
|
1962
|
+
} : ResponseWrapper extends {
|
|
1963
|
+
data: TLogin;
|
|
1964
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1965
|
+
data: TLogin;
|
|
1966
|
+
}>;
|
|
1967
|
+
loginWithToken(token?: string): RequestProxyResult<{
|
|
1968
|
+
token: string;
|
|
1969
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1970
|
+
[key: string]: any;
|
|
1971
|
+
data: {
|
|
1972
|
+
token: string;
|
|
1973
|
+
};
|
|
1974
|
+
} : ResponseWrapper extends {
|
|
1975
|
+
data: {
|
|
1976
|
+
token: string;
|
|
1977
|
+
};
|
|
1978
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1979
|
+
data: {
|
|
1980
|
+
token: string;
|
|
1981
|
+
};
|
|
1982
|
+
}>;
|
|
1983
|
+
checkTokenValid(token: string): RequestProxyResult<{
|
|
1984
|
+
ok: number;
|
|
1985
|
+
isGuest: boolean;
|
|
1986
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1987
|
+
[key: string]: any;
|
|
1988
|
+
data: {
|
|
1989
|
+
ok: number;
|
|
1990
|
+
isGuest: boolean;
|
|
1991
|
+
};
|
|
1992
|
+
} : ResponseWrapper extends {
|
|
1993
|
+
data: {
|
|
1994
|
+
ok: number;
|
|
1995
|
+
isGuest: boolean;
|
|
1996
|
+
};
|
|
1997
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1998
|
+
data: {
|
|
1999
|
+
ok: number;
|
|
2000
|
+
isGuest: boolean;
|
|
2001
|
+
};
|
|
2002
|
+
}>;
|
|
1890
2003
|
}
|
|
1891
|
-
|
|
2004
|
+
//#endregion
|
|
2005
|
+
//#region controllers/index.d.ts
|
|
1892
2006
|
declare const allControllers: (typeof AckController | typeof ActivityController | typeof AggregateController | typeof AIController | typeof CategoryController | typeof CommentController | typeof LinkController | typeof NoteController | typeof PageController | typeof PostController | typeof ProjectController | typeof RecentlyController | typeof SayController | typeof SearchController | typeof ServerlessController | typeof SnippetController | typeof SubscribeController | typeof TopicController | typeof UserController)[];
|
|
1893
2007
|
declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate", "category", "comment", "link", "note", "page", "post", "project", "topic", "recently", "say", "search", "snippet", "serverless", "subscribe", "user", "friend", "master", "shorthand"];
|
|
1894
|
-
|
|
2008
|
+
//#endregion
|
|
2009
|
+
//#region utils/camelcase-keys.d.ts
|
|
1895
2010
|
/**
|
|
1896
2011
|
* A simple camelCase function that only handles strings, but not handling symbol, date, or other complex case.
|
|
1897
2012
|
* If you need to handle more complex cases, please use camelcase-keys package.
|
|
1898
2013
|
*/
|
|
1899
2014
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1900
|
-
|
|
1901
|
-
export { AIController,
|
|
2015
|
+
//#endregion
|
|
2016
|
+
export { AIController, AIDeepReadingModel, AISummaryModel, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, NoteController, NoteModel, NoteWrappedPayload, NoteWrappedWithLikedPayload, PageController, PageModel, Pager, PaginateResult, PostController, PostModel, ProjectController, ProjectModel, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TimelineData, TimelineType, TopicController, TopicModel, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|