@mx-space/api-client 1.17.0 → 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 +1 -2
- 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 +1043 -1207
- package/dist/index.d.cts +1754 -1690
- package/dist/index.d.mts +2016 -0
- package/dist/index.mjs +1101 -0
- package/interfaces/request.ts +3 -1
- package/mod-dts.mjs +13 -10
- package/models/comment.ts +1 -2
- package/models/note.ts +1 -1
- package/models/recently.ts +2 -0
- package/package.json +16 -16
- package/{tsup.config.ts → tsdown.config.ts} +2 -2
- 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 -15030
- 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 -7625
- package/dist/adaptors/umi-request.js +0 -33
- package/dist/index.d.ts +0 -1952
- package/dist/index.global.js +0 -1200
- package/dist/index.js +0 -1241
- 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,1952 +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;
|
|
426
439
|
}
|
|
427
440
|
declare class BingSearchOptionsModel {
|
|
428
|
-
|
|
429
|
-
|
|
441
|
+
enable: boolean;
|
|
442
|
+
token?: string;
|
|
430
443
|
}
|
|
431
444
|
declare class AlgoliaSearchOptionsModel {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
445
|
+
enable: boolean;
|
|
446
|
+
apiKey?: string;
|
|
447
|
+
appId?: string;
|
|
448
|
+
indexName?: string;
|
|
436
449
|
}
|
|
437
450
|
declare class AdminExtraModel {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
451
|
+
background?: string;
|
|
452
|
+
gaodemapKey?: string;
|
|
453
|
+
title?: string;
|
|
454
|
+
/**
|
|
455
|
+
* 是否开启后台反代访问
|
|
456
|
+
*/
|
|
457
|
+
enableAdminProxy?: boolean;
|
|
445
458
|
}
|
|
446
459
|
interface IConfig {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
460
|
+
seo: SeoOptionModel;
|
|
461
|
+
url: UrlOptionModel;
|
|
462
|
+
mailOptions: MailOptionsModel;
|
|
463
|
+
commentOptions: CommentOptionsModel;
|
|
464
|
+
backupOptions: BackupOptionsModel;
|
|
465
|
+
baiduSearchOptions: BaiduSearchOptionsModel;
|
|
466
|
+
algoliaSearchOptions: AlgoliaSearchOptionsModel;
|
|
467
|
+
adminExtra: AdminExtraModel;
|
|
455
468
|
}
|
|
456
469
|
declare type IConfigKeys = keyof IConfig;
|
|
457
|
-
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region models/user.d.ts
|
|
458
472
|
interface UserModel extends BaseModel {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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;
|
|
471
485
|
}
|
|
472
486
|
type TLogin = {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
487
|
+
token: string;
|
|
488
|
+
expiresIn: number;
|
|
489
|
+
lastLoginTime: null | string;
|
|
490
|
+
lastLoginIp?: null | string;
|
|
477
491
|
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
478
|
-
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region models/aggregate.d.ts
|
|
479
494
|
interface AggregateRoot {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
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
|
+
};
|
|
492
507
|
}
|
|
493
508
|
interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
494
|
-
|
|
509
|
+
theme?: Theme;
|
|
495
510
|
}
|
|
496
511
|
interface Url {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
interface AggregateTopNote extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images'> {
|
|
502
|
-
}
|
|
503
|
-
interface AggregateTopPost extends Pick<PostModel, 'id' | 'slug' | 'created' | 'title' | 'category' | 'images'> {
|
|
512
|
+
wsUrl: string;
|
|
513
|
+
serverUrl: string;
|
|
514
|
+
webUrl: string;
|
|
504
515
|
}
|
|
516
|
+
interface AggregateTopNote extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images'> {}
|
|
517
|
+
interface AggregateTopPost extends Pick<PostModel, 'id' | 'slug' | 'created' | 'title' | 'category' | 'images'> {}
|
|
505
518
|
interface AggregateTop {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
519
|
+
notes: AggregateTopNote[];
|
|
520
|
+
posts: AggregateTopPost[];
|
|
521
|
+
says: SayModel[];
|
|
509
522
|
}
|
|
510
523
|
declare enum TimelineType {
|
|
511
|
-
|
|
512
|
-
|
|
524
|
+
Post = 0,
|
|
525
|
+
Note = 1,
|
|
513
526
|
}
|
|
514
527
|
interface TimelineData {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
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
|
+
})[];
|
|
519
532
|
}
|
|
520
533
|
interface AggregateStat {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
|
|
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
|
|
540
554
|
interface AISummaryModel {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
555
|
+
id: string;
|
|
556
|
+
created: string;
|
|
557
|
+
summary: string;
|
|
558
|
+
hash: string;
|
|
559
|
+
refId: string;
|
|
560
|
+
lang: string;
|
|
547
561
|
}
|
|
548
562
|
interface AIDeepReadingModel {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}
|
|
556
|
-
|
|
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
|
|
557
572
|
interface AuthUser {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
|
|
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
|
|
567
583
|
interface CommentModel extends BaseModel {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
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;
|
|
588
604
|
}
|
|
589
605
|
interface CommentRef {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
606
|
+
id: string;
|
|
607
|
+
categoryId?: string;
|
|
608
|
+
slug: string;
|
|
609
|
+
title: string;
|
|
610
|
+
category?: CategoryModel;
|
|
595
611
|
}
|
|
596
612
|
declare enum CommentState {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
613
|
+
Unread = 0,
|
|
614
|
+
Read = 1,
|
|
615
|
+
Junk = 2,
|
|
600
616
|
}
|
|
601
|
-
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region models/link.d.ts
|
|
602
619
|
declare enum LinkType {
|
|
603
|
-
|
|
604
|
-
|
|
620
|
+
Friend = 0,
|
|
621
|
+
Collection = 1,
|
|
605
622
|
}
|
|
606
623
|
declare enum LinkState {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
624
|
+
Pass = 0,
|
|
625
|
+
Audit = 1,
|
|
626
|
+
Outdate = 2,
|
|
627
|
+
Banned = 3,
|
|
628
|
+
Reject = 4,
|
|
612
629
|
}
|
|
613
630
|
interface LinkModel extends BaseModel {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
|
|
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
|
|
624
642
|
interface ProjectModel extends BaseModel {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
}
|
|
634
|
-
|
|
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
|
|
635
654
|
interface ReaderModel {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
}
|
|
642
|
-
|
|
655
|
+
email: string;
|
|
656
|
+
name: string;
|
|
657
|
+
handle: string;
|
|
658
|
+
image: string;
|
|
659
|
+
isOwner: boolean;
|
|
660
|
+
}
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region models/recently.d.ts
|
|
643
663
|
declare enum RecentlyRefTypes {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
664
|
+
Post = "Post",
|
|
665
|
+
Note = "Note",
|
|
666
|
+
Page = "Page",
|
|
647
667
|
}
|
|
648
668
|
type RecentlyRefType = {
|
|
649
|
-
|
|
650
|
-
|
|
669
|
+
title: string;
|
|
670
|
+
url: string;
|
|
651
671
|
};
|
|
652
672
|
interface RecentlyModel extends BaseCommentIndexModel {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
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
|
|
663
685
|
declare enum SnippetType {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
686
|
+
JSON = "json",
|
|
687
|
+
Function = "function",
|
|
688
|
+
Text = "text",
|
|
689
|
+
YAML = "yaml",
|
|
668
690
|
}
|
|
669
691
|
interface SnippetModel<T = unknown> extends BaseModel {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
|
|
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
|
|
681
704
|
declare const SubscribePostCreateBit: number;
|
|
682
705
|
declare const SubscribeNoteCreateBit: number;
|
|
683
706
|
declare const SubscribeSayCreateBit: number;
|
|
684
707
|
declare const SubscribeRecentCreateBit: number;
|
|
685
708
|
declare const SubscribeAllBit: number;
|
|
686
709
|
declare const SubscribeTypeToBitMap: {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
710
|
+
post_c: number;
|
|
711
|
+
note_c: number;
|
|
712
|
+
say_c: number;
|
|
713
|
+
recently_c: number;
|
|
714
|
+
all: number;
|
|
692
715
|
};
|
|
693
|
-
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region models/subscribe.d.ts
|
|
694
718
|
type SubscribeType = keyof typeof SubscribeTypeToBitMap;
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
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
|
+
}
|
|
700
725
|
}
|
|
701
726
|
/**
|
|
702
727
|
* @support core >= 4.3.0
|
|
703
728
|
*/
|
|
704
729
|
declare class ActivityController<ResponseWrapper> implements IController {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
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 ? {
|
|
711
801
|
[key: string]: any;
|
|
712
|
-
data:
|
|
713
|
-
|
|
714
|
-
data:
|
|
715
|
-
|
|
716
|
-
data:
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
*
|
|
720
|
-
* @support core >= 5.0.0
|
|
721
|
-
*/
|
|
722
|
-
getPresence(roomName: string): RequestProxyResult<{
|
|
723
|
-
data: Record<string, ActivityPresence>;
|
|
724
|
-
readers: Record<string, AuthUser>;
|
|
725
|
-
}, 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 ? {
|
|
726
808
|
[key: string]: any;
|
|
727
|
-
data:
|
|
728
|
-
|
|
729
|
-
|
|
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;
|
|
730
818
|
};
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
};
|
|
736
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
737
|
-
data: {
|
|
738
|
-
data: Record<string, ActivityPresence>;
|
|
739
|
-
readers: Record<string, AuthUser>;
|
|
819
|
+
objects: {
|
|
820
|
+
posts: RoomOmittedPost[];
|
|
821
|
+
notes: RoomOmittedNote[];
|
|
822
|
+
pages: RoomOmittedPage[];
|
|
740
823
|
};
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
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 ? {
|
|
755
839
|
[key: string]: any;
|
|
756
|
-
data:
|
|
757
|
-
|
|
758
|
-
data:
|
|
759
|
-
|
|
760
|
-
data:
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
[key: string]: number;
|
|
785
|
-
};
|
|
786
|
-
objects: {
|
|
787
|
-
posts: RoomOmittedPost[];
|
|
788
|
-
notes: RoomOmittedNote[];
|
|
789
|
-
pages: RoomOmittedPage[];
|
|
790
|
-
};
|
|
791
|
-
} : T_1 : never : never;
|
|
792
|
-
} : ResponseWrapper;
|
|
793
|
-
$request: {
|
|
794
|
-
path: string;
|
|
795
|
-
method: string;
|
|
796
|
-
[k: string]: string;
|
|
797
|
-
};
|
|
798
|
-
$serialized: RoomsData;
|
|
799
|
-
}>;
|
|
800
|
-
getRecentActivities(): Promise<RecentActivities & {
|
|
801
|
-
$raw: ResponseWrapper extends {
|
|
802
|
-
data: infer T;
|
|
803
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
804
|
-
[i: string]: any;
|
|
805
|
-
data: (ResponseWrapper extends unknown ? {
|
|
806
|
-
[key: string]: any;
|
|
807
|
-
data: RecentActivities;
|
|
808
|
-
} : ResponseWrapper extends {
|
|
809
|
-
data: RecentActivities;
|
|
810
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
811
|
-
data: RecentActivities;
|
|
812
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
813
|
-
[key: string]: any;
|
|
814
|
-
data: RecentActivities;
|
|
815
|
-
} : ResponseWrapper extends {
|
|
816
|
-
data: RecentActivities;
|
|
817
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
818
|
-
data: RecentActivities;
|
|
819
|
-
}) ? T_1 extends unknown ? {
|
|
820
|
-
like: RecentLike[];
|
|
821
|
-
comment: RecentComment[];
|
|
822
|
-
recent: RecentRecent[];
|
|
823
|
-
post: RecentPost[];
|
|
824
|
-
note: RecentNote[];
|
|
825
|
-
} : T_1 : never : never;
|
|
826
|
-
} : ResponseWrapper;
|
|
827
|
-
$request: {
|
|
828
|
-
path: string;
|
|
829
|
-
method: string;
|
|
830
|
-
[k: string]: string;
|
|
831
|
-
};
|
|
832
|
-
$serialized: RecentActivities;
|
|
833
|
-
}>;
|
|
834
|
-
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>;
|
|
835
868
|
}
|
|
836
|
-
|
|
869
|
+
//#endregion
|
|
870
|
+
//#region interfaces/options.d.ts
|
|
837
871
|
type SortOrder = 'asc' | 'desc';
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
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
|
+
}
|
|
843
878
|
}
|
|
844
879
|
declare class AggregateController<ResponseWrapper> implements IController {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
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 ? {
|
|
858
997
|
[key: string]: any;
|
|
859
|
-
data:
|
|
860
|
-
|
|
861
|
-
data:
|
|
862
|
-
|
|
863
|
-
data:
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
data:
|
|
871
|
-
|
|
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 ? {
|
|
872
1134
|
[key: string]: any;
|
|
873
1135
|
data: {
|
|
874
|
-
|
|
1136
|
+
tag: string;
|
|
1137
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
875
1138
|
};
|
|
876
|
-
|
|
1139
|
+
} : ResponseWrapper extends {
|
|
877
1140
|
data: {
|
|
878
|
-
|
|
1141
|
+
tag: string;
|
|
1142
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
879
1143
|
};
|
|
880
|
-
|
|
1144
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
881
1145
|
data: {
|
|
882
|
-
|
|
1146
|
+
tag: string;
|
|
1147
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
883
1148
|
};
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* 获取聚合数据统计
|
|
887
|
-
*/
|
|
888
|
-
getStat(): RequestProxyResult<AggregateStat, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1149
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
889
1150
|
[key: string]: any;
|
|
890
|
-
data:
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
894
|
-
data: AggregateStat;
|
|
895
|
-
}>;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
declare module '../core/client' {
|
|
899
|
-
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
900
|
-
ai: AIController<ResponseWrapper>;
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
/**
|
|
904
|
-
* @support core >= 5.6.0
|
|
905
|
-
*/
|
|
906
|
-
declare class AIController<ResponseWrapper> implements IController {
|
|
907
|
-
private client;
|
|
908
|
-
base: string;
|
|
909
|
-
name: string;
|
|
910
|
-
constructor(client: HTTPClient);
|
|
911
|
-
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
912
|
-
getSummary({ articleId, lang, onlyDb, }: {
|
|
913
|
-
articleId: string;
|
|
914
|
-
lang?: string;
|
|
915
|
-
onlyDb?: boolean;
|
|
916
|
-
}): Promise<AISummaryModel & {
|
|
917
|
-
$raw: ResponseWrapper extends {
|
|
918
|
-
data: infer T;
|
|
919
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
920
|
-
[i: string]: any;
|
|
921
|
-
data: (ResponseWrapper extends unknown ? {
|
|
922
|
-
[key: string]: any;
|
|
923
|
-
data: AISummaryModel;
|
|
924
|
-
} : ResponseWrapper extends {
|
|
925
|
-
data: AISummaryModel;
|
|
926
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
927
|
-
data: AISummaryModel;
|
|
928
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
929
|
-
[key: string]: any;
|
|
930
|
-
data: AISummaryModel;
|
|
931
|
-
} : ResponseWrapper extends {
|
|
932
|
-
data: AISummaryModel;
|
|
933
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
934
|
-
data: AISummaryModel;
|
|
935
|
-
}) ? T_1 extends unknown ? {
|
|
936
|
-
id: string;
|
|
937
|
-
created: string;
|
|
938
|
-
summary: string;
|
|
939
|
-
hash: string;
|
|
940
|
-
ref_id: string;
|
|
941
|
-
lang: string;
|
|
942
|
-
} : T_1 : never : never;
|
|
943
|
-
} : ResponseWrapper;
|
|
944
|
-
$request: {
|
|
945
|
-
path: string;
|
|
946
|
-
method: string;
|
|
947
|
-
[k: string]: string;
|
|
948
|
-
};
|
|
949
|
-
$serialized: AISummaryModel;
|
|
950
|
-
}>;
|
|
951
|
-
generateSummary(articleId: string, lang?: string, token?: string): Promise<AISummaryModel & {
|
|
952
|
-
$raw: ResponseWrapper extends {
|
|
953
|
-
data: infer T;
|
|
954
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
955
|
-
[i: string]: any;
|
|
956
|
-
data: (ResponseWrapper extends unknown ? {
|
|
957
|
-
[key: string]: any;
|
|
958
|
-
data: AISummaryModel;
|
|
959
|
-
} : ResponseWrapper extends {
|
|
960
|
-
data: AISummaryModel;
|
|
961
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
962
|
-
data: AISummaryModel;
|
|
963
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
964
|
-
[key: string]: any;
|
|
965
|
-
data: AISummaryModel;
|
|
966
|
-
} : ResponseWrapper extends {
|
|
967
|
-
data: AISummaryModel;
|
|
968
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
969
|
-
data: AISummaryModel;
|
|
970
|
-
}) ? T_1 extends unknown ? {
|
|
971
|
-
id: string;
|
|
972
|
-
created: string;
|
|
973
|
-
summary: string;
|
|
974
|
-
hash: string;
|
|
975
|
-
ref_id: string;
|
|
976
|
-
lang: string;
|
|
977
|
-
} : T_1 : never : never;
|
|
978
|
-
} : ResponseWrapper;
|
|
979
|
-
$request: {
|
|
980
|
-
path: string;
|
|
981
|
-
method: string;
|
|
982
|
-
[k: string]: string;
|
|
1151
|
+
data: {
|
|
1152
|
+
tag: string;
|
|
1153
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
983
1154
|
};
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
* @param articleId
|
|
989
|
-
*/
|
|
990
|
-
getDeepReading(articleId: string): Promise<AIDeepReadingModel & {
|
|
991
|
-
$raw: ResponseWrapper extends {
|
|
992
|
-
data: infer T;
|
|
993
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
994
|
-
[i: string]: any;
|
|
995
|
-
data: (ResponseWrapper extends unknown ? {
|
|
996
|
-
[key: string]: any;
|
|
997
|
-
data: AIDeepReadingModel;
|
|
998
|
-
} : ResponseWrapper extends {
|
|
999
|
-
data: AIDeepReadingModel;
|
|
1000
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1001
|
-
data: AIDeepReadingModel;
|
|
1002
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1003
|
-
[key: string]: any;
|
|
1004
|
-
data: AIDeepReadingModel;
|
|
1005
|
-
} : ResponseWrapper extends {
|
|
1006
|
-
data: AIDeepReadingModel;
|
|
1007
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1008
|
-
data: AIDeepReadingModel;
|
|
1009
|
-
}) ? T_1 extends unknown ? {
|
|
1010
|
-
id: string;
|
|
1011
|
-
hash: string;
|
|
1012
|
-
ref_id: string;
|
|
1013
|
-
key_points: string[];
|
|
1014
|
-
critical_analysis: string;
|
|
1015
|
-
content: string;
|
|
1016
|
-
} : T_1 : never : never;
|
|
1017
|
-
} : ResponseWrapper;
|
|
1018
|
-
$request: {
|
|
1019
|
-
path: string;
|
|
1020
|
-
method: string;
|
|
1021
|
-
[k: string]: string;
|
|
1155
|
+
} : ResponseWrapper extends {
|
|
1156
|
+
data: {
|
|
1157
|
+
tag: string;
|
|
1158
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1022
1159
|
};
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
declare module '../core/client' {
|
|
1028
|
-
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1029
|
-
category: CategoryController<ResponseWrapper>;
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
declare class CategoryController<ResponseWrapper> implements IController {
|
|
1033
|
-
private client;
|
|
1034
|
-
name: string;
|
|
1035
|
-
base: string;
|
|
1036
|
-
constructor(client: HTTPClient);
|
|
1037
|
-
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1038
|
-
getAllCategories(): RequestProxyResult<{
|
|
1039
|
-
data: CategoryModel[];
|
|
1040
|
-
}, ResponseWrapper>;
|
|
1041
|
-
getAllTags(): RequestProxyResult<{
|
|
1042
|
-
data: TagModel[];
|
|
1043
|
-
}, ResponseWrapper>;
|
|
1044
|
-
getCategoryDetail(id: string): Promise<ResponseProxyExtraRaw<CategoryWithChildrenModel>>;
|
|
1045
|
-
getCategoryDetail(ids: string[]): Promise<ResponseProxyExtraRaw<Map<string, CategoryWithChildrenModel>>>;
|
|
1046
|
-
getCategoryByIdOrSlug(idOrSlug: string): Promise<CategoryModel & {
|
|
1047
|
-
children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
|
|
1048
|
-
} & {
|
|
1049
|
-
$raw: ResponseWrapper extends {
|
|
1050
|
-
data: infer T;
|
|
1051
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1052
|
-
[i: string]: any;
|
|
1053
|
-
data: (ResponseWrapper extends unknown ? {
|
|
1054
|
-
[key: string]: any;
|
|
1055
|
-
data: CategoryWithChildrenModel;
|
|
1056
|
-
} : ResponseWrapper extends {
|
|
1057
|
-
data: CategoryWithChildrenModel;
|
|
1058
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1059
|
-
data: CategoryWithChildrenModel;
|
|
1060
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1061
|
-
[key: string]: any;
|
|
1062
|
-
data: CategoryWithChildrenModel;
|
|
1063
|
-
} : ResponseWrapper extends {
|
|
1064
|
-
data: CategoryWithChildrenModel;
|
|
1065
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1066
|
-
data: CategoryWithChildrenModel;
|
|
1067
|
-
}) ? T_1 extends unknown ? {
|
|
1068
|
-
type: CategoryType;
|
|
1069
|
-
count: number;
|
|
1070
|
-
slug: string;
|
|
1071
|
-
name: string;
|
|
1072
|
-
created: string;
|
|
1073
|
-
id: string;
|
|
1074
|
-
children: Pick<PostModel, "id" | "created" | "modified" | "title" | "slug">[];
|
|
1075
|
-
} : T_1 : never : never;
|
|
1076
|
-
} : ResponseWrapper;
|
|
1077
|
-
$request: {
|
|
1078
|
-
path: string;
|
|
1079
|
-
method: string;
|
|
1080
|
-
[k: string]: string;
|
|
1160
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1161
|
+
data: {
|
|
1162
|
+
tag: string;
|
|
1163
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1081
1164
|
};
|
|
1082
|
-
|
|
1083
|
-
}>;
|
|
1084
|
-
getTagByName(name: string): Promise<{
|
|
1165
|
+
}) ? T_1 extends unknown ? {
|
|
1085
1166
|
tag: string;
|
|
1086
|
-
data: Pick<PostModel, "
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
data: {
|
|
1100
|
-
tag: string;
|
|
1101
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1102
|
-
};
|
|
1103
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1104
|
-
data: {
|
|
1105
|
-
tag: string;
|
|
1106
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1107
|
-
};
|
|
1108
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1109
|
-
[key: string]: any;
|
|
1110
|
-
data: {
|
|
1111
|
-
tag: string;
|
|
1112
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1113
|
-
};
|
|
1114
|
-
} : ResponseWrapper extends {
|
|
1115
|
-
data: {
|
|
1116
|
-
tag: string;
|
|
1117
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1118
|
-
};
|
|
1119
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1120
|
-
data: {
|
|
1121
|
-
tag: string;
|
|
1122
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1123
|
-
};
|
|
1124
|
-
}) ? T_1 extends unknown ? {
|
|
1125
|
-
tag: string;
|
|
1126
|
-
data: Pick<PostModel, "id" | "category" | "created" | "title" | "slug">[];
|
|
1127
|
-
} : T_1 : never : never;
|
|
1128
|
-
} : ResponseWrapper;
|
|
1129
|
-
$request: {
|
|
1130
|
-
path: string;
|
|
1131
|
-
method: string;
|
|
1132
|
-
[k: string]: string;
|
|
1133
|
-
};
|
|
1134
|
-
$serialized: {
|
|
1135
|
-
tag: string;
|
|
1136
|
-
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1137
|
-
};
|
|
1138
|
-
}>;
|
|
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
|
+
}>;
|
|
1139
1180
|
}
|
|
1140
|
-
|
|
1181
|
+
//#endregion
|
|
1182
|
+
//#region interfaces/params.d.ts
|
|
1141
1183
|
interface PaginationParams {
|
|
1142
|
-
|
|
1143
|
-
|
|
1184
|
+
size?: number;
|
|
1185
|
+
page?: number;
|
|
1144
1186
|
}
|
|
1145
|
-
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region dtos/comment.d.ts
|
|
1146
1189
|
interface CommentDto {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
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
|
+
}
|
|
1159
1203
|
}
|
|
1160
1204
|
declare class CommentController<ResponseWrapper> implements IController {
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
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;
|
|
1191
1241
|
}> & {
|
|
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
|
-
|
|
1232
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1233
|
-
data: CommentModel;
|
|
1234
|
-
}>;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
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
|
|
1237
1282
|
type SortOptions = {
|
|
1238
|
-
|
|
1239
|
-
|
|
1283
|
+
sortBy?: string;
|
|
1284
|
+
sortOrder?: 1 | -1 | 'asc' | 'desc';
|
|
1240
1285
|
};
|
|
1241
1286
|
declare abstract class BaseCrudController<T, ResponseWrapper> {
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
1283
1329
|
}
|
|
1284
1330
|
declare class LinkController<ResponseWrapper> extends BaseCrudController<LinkModel, ResponseWrapper> {
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
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;
|
|
1293
1339
|
}
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
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
|
+
}
|
|
1299
1346
|
}
|
|
1300
1347
|
type NoteListOptions = {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1348
|
+
select?: SelectFields<keyof NoteModel>;
|
|
1349
|
+
year?: number;
|
|
1350
|
+
sortBy?: 'weather' | 'mood' | 'title' | 'created' | 'modified';
|
|
1351
|
+
sortOrder?: 1 | -1;
|
|
1305
1352
|
};
|
|
1306
1353
|
declare class NoteController<ResponseWrapper> implements IController {
|
|
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
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
1384
1432
|
}
|
|
1385
1433
|
type PageListOptions = {
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1434
|
+
select?: SelectFields<keyof PageModel>;
|
|
1435
|
+
sortBy?: 'order' | 'subtitle' | 'title' | 'created' | 'modified';
|
|
1436
|
+
sortOrder?: 1 | -1;
|
|
1389
1437
|
};
|
|
1390
1438
|
declare class PageController<ResponseWrapper> implements IController {
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
1437
1486
|
}
|
|
1438
1487
|
type PostListOptions = {
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1488
|
+
select?: SelectFields<keyof PostModel>;
|
|
1489
|
+
year?: number;
|
|
1490
|
+
sortBy?: 'categoryId' | 'title' | 'created' | 'modified';
|
|
1491
|
+
sortOrder?: 1 | -1;
|
|
1492
|
+
truncate?: number;
|
|
1444
1493
|
};
|
|
1445
1494
|
declare class PostController<ResponseWrapper> implements IController {
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
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
|
+
}>;
|
|
1503
1552
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
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
|
+
}
|
|
1509
1559
|
}
|
|
1510
1560
|
declare class ProjectController<ResponseWrapper> extends BaseCrudController<ProjectModel, ResponseWrapper> {
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
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
|
+
}
|
|
1522
1573
|
}
|
|
1523
1574
|
declare enum RecentlyAttitudeResultEnum {
|
|
1524
|
-
|
|
1525
|
-
|
|
1575
|
+
Inc = 1,
|
|
1576
|
+
Dec = -1,
|
|
1526
1577
|
}
|
|
1527
1578
|
declare enum RecentlyAttitudeEnum {
|
|
1528
|
-
|
|
1529
|
-
|
|
1579
|
+
Up = 0,
|
|
1580
|
+
Down = 1,
|
|
1530
1581
|
}
|
|
1531
1582
|
declare class RecentlyController<ResponseWrapper> implements IController {
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
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[] & {
|
|
1541
1615
|
comments: number;
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
} : ResponseWrapper extends {
|
|
1548
|
-
data: RecentlyModel & {
|
|
1549
|
-
comments: number;
|
|
1550
|
-
};
|
|
1551
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1552
|
-
data: RecentlyModel & {
|
|
1553
|
-
comments: number;
|
|
1554
|
-
};
|
|
1555
|
-
}>;
|
|
1556
|
-
getAll(): RequestProxyResult<{
|
|
1557
|
-
data: RecentlyModel[] & {
|
|
1558
|
-
comments: number;
|
|
1559
|
-
};
|
|
1560
|
-
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1561
|
-
[key: string]: any;
|
|
1562
|
-
data: {
|
|
1563
|
-
data: RecentlyModel[] & {
|
|
1564
|
-
comments: number;
|
|
1565
|
-
};
|
|
1566
|
-
};
|
|
1567
|
-
} : ResponseWrapper extends {
|
|
1568
|
-
data: {
|
|
1569
|
-
data: RecentlyModel[] & {
|
|
1570
|
-
comments: number;
|
|
1571
|
-
};
|
|
1572
|
-
};
|
|
1573
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1574
|
-
data: {
|
|
1575
|
-
data: RecentlyModel[] & {
|
|
1576
|
-
comments: number;
|
|
1577
|
-
};
|
|
1578
|
-
};
|
|
1579
|
-
}>;
|
|
1580
|
-
getList({ before, after, size, }?: {
|
|
1581
|
-
before?: string | undefined;
|
|
1582
|
-
after?: string | undefined;
|
|
1583
|
-
size?: number | number;
|
|
1584
|
-
}): RequestProxyResult<{
|
|
1585
|
-
data: RecentlyModel[] & {
|
|
1586
|
-
comments: number;
|
|
1587
|
-
};
|
|
1588
|
-
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1589
|
-
[key: string]: any;
|
|
1590
|
-
data: {
|
|
1591
|
-
data: RecentlyModel[] & {
|
|
1592
|
-
comments: number;
|
|
1593
|
-
};
|
|
1594
|
-
};
|
|
1595
|
-
} : ResponseWrapper extends {
|
|
1596
|
-
data: {
|
|
1597
|
-
data: RecentlyModel[] & {
|
|
1598
|
-
comments: number;
|
|
1599
|
-
};
|
|
1600
|
-
};
|
|
1601
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1602
|
-
data: {
|
|
1603
|
-
data: RecentlyModel[] & {
|
|
1604
|
-
comments: number;
|
|
1605
|
-
};
|
|
1606
|
-
};
|
|
1607
|
-
}>;
|
|
1608
|
-
getById(id: string): RequestProxyResult<RecentlyModel & {
|
|
1616
|
+
};
|
|
1617
|
+
};
|
|
1618
|
+
} : ResponseWrapper extends {
|
|
1619
|
+
data: {
|
|
1620
|
+
data: RecentlyModel[] & {
|
|
1609
1621
|
comments: number;
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
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
|
+
}>;
|
|
1641
1696
|
}
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
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
|
+
}
|
|
1647
1703
|
}
|
|
1648
1704
|
declare class SayController<ResponseWrapper> extends BaseCrudController<SayModel, ResponseWrapper> implements IController {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
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
|
+
}>;
|
|
1673
1729
|
}
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
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
|
+
}
|
|
1679
1736
|
}
|
|
1680
1737
|
type SearchOption = {
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1738
|
+
orderBy?: string;
|
|
1739
|
+
order?: number;
|
|
1740
|
+
rawAlgolia?: boolean;
|
|
1684
1741
|
};
|
|
1685
1742
|
declare class SearchController<ResponseWrapper> implements IController {
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
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
|
+
})> & {
|
|
1693
1764
|
/**
|
|
1694
|
-
*
|
|
1695
|
-
* https://www.algolia.com/doc/api-reference/api-methods/search/
|
|
1696
|
-
* @param keyword
|
|
1697
|
-
* @param options
|
|
1698
|
-
* @returns
|
|
1765
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
1699
1766
|
*/
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
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";
|
|
1706
1776
|
})> & {
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
}, ResponseWrapper
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "id" | "category" | "created" | "modified" | "title" | "slug"> & {
|
|
1740
|
-
type: "post";
|
|
1741
|
-
}) | (Pick<NoteModel, "id" | "created" | "modified" | "title" | "nid"> & {
|
|
1742
|
-
type: "note";
|
|
1743
|
-
}) | (Pick<PageModel, "id" | "created" | "modified" | "title" | "slug"> & {
|
|
1744
|
-
type: "page";
|
|
1745
|
-
})> & {
|
|
1746
|
-
/**
|
|
1747
|
-
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
1748
|
-
*/
|
|
1749
|
-
raw?: any;
|
|
1750
|
-
}, ResponseWrapper>;
|
|
1751
|
-
}>;
|
|
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
|
+
}>;
|
|
1752
1809
|
}
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
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
|
+
}
|
|
1758
1816
|
}
|
|
1759
1817
|
declare class ServerlessController<ResponseWrapper> implements IController {
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
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
|
+
}>;
|
|
1773
1831
|
}
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
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
|
+
}
|
|
1779
1838
|
}
|
|
1780
1839
|
declare class SnippetController<ResponseWrapper> implements IController {
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
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
|
+
}>;
|
|
1794
1853
|
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
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
|
+
}
|
|
1800
1860
|
}
|
|
1801
1861
|
declare class SubscribeController<ResponseWrapper> implements IController {
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
1860
1921
|
}
|
|
1861
1922
|
declare class TopicController<ResponseWrapper> extends BaseCrudController<TopicModel, ResponseWrapper> implements IController {
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
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
|
+
}
|
|
1882
1944
|
}
|
|
1883
1945
|
declare class UserController<ResponseWrapper> implements IController {
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
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
|
+
}>;
|
|
1941
2003
|
}
|
|
1942
|
-
|
|
2004
|
+
//#endregion
|
|
2005
|
+
//#region controllers/index.d.ts
|
|
1943
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)[];
|
|
1944
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"];
|
|
1945
|
-
|
|
2008
|
+
//#endregion
|
|
2009
|
+
//#region utils/camelcase-keys.d.ts
|
|
1946
2010
|
/**
|
|
1947
2011
|
* A simple camelCase function that only handles strings, but not handling symbol, date, or other complex case.
|
|
1948
2012
|
* If you need to handle more complex cases, please use camelcase-keys package.
|
|
1949
2013
|
*/
|
|
1950
2014
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1951
|
-
|
|
1952
|
-
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 };
|