@mx-space/api-client 0.0.4 → 0.3.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/build/index.cjs.js +526 -33
- package/build/index.cjs.js.map +1 -1
- package/build/index.cjs.min.js +1 -1
- package/build/index.cjs.min.js.map +1 -1
- package/build/index.d.ts +542 -34
- package/build/index.esm.js +523 -30
- package/build/index.esm.js.map +1 -1
- package/build/index.esm.min.js +1 -1
- package/build/index.esm.min.js.map +1 -1
- package/build/index.umd.js +526 -33
- package/build/index.umd.js.map +1 -1
- package/build/index.umd.min.js +1 -1
- package/build/index.umd.min.js.map +1 -1
- package/esm/core/attachRequest.js +29 -6
- package/esm/core/attachRequest.js.map +1 -1
- package/esm/core/client.d.ts +12 -15
- package/esm/core/client.js +21 -8
- package/esm/core/client.js.map +1 -1
- package/esm/core/controllers/aggregate.d.ts +44 -0
- package/esm/core/controllers/aggregate.js +40 -0
- package/esm/core/controllers/aggregate.js.map +1 -0
- package/esm/core/controllers/all.d.ts +14 -0
- package/esm/core/controllers/all.js +39 -0
- package/esm/core/controllers/all.js.map +1 -0
- package/esm/core/controllers/base.d.ts +29 -0
- package/esm/core/controllers/base.js +25 -0
- package/esm/core/controllers/base.js.map +1 -0
- package/esm/core/controllers/category.d.ts +44 -0
- package/esm/core/controllers/category.js +66 -0
- package/esm/core/controllers/category.js.map +1 -0
- package/esm/core/controllers/comment.d.ts +42 -0
- package/esm/core/controllers/comment.js +43 -0
- package/esm/core/controllers/comment.js.map +1 -0
- package/esm/core/controllers/index.d.ts +1 -0
- package/esm/core/controllers/index.js +2 -0
- package/esm/core/controllers/index.js.map +1 -0
- package/esm/core/controllers/link.d.ts +9 -0
- package/esm/core/controllers/link.js +10 -0
- package/esm/core/controllers/link.js.map +1 -0
- package/esm/core/controllers/note.d.ts +54 -0
- package/esm/core/controllers/note.js +54 -0
- package/esm/core/controllers/note.js.map +1 -0
- package/esm/core/controllers/page.d.ts +34 -0
- package/esm/core/controllers/page.js +33 -0
- package/esm/core/controllers/page.js.map +1 -0
- package/esm/core/controllers/post.d.ts +47 -0
- package/esm/core/controllers/post.js +42 -0
- package/esm/core/controllers/post.js.map +1 -0
- package/esm/core/controllers/recently.d.ts +33 -0
- package/esm/core/controllers/recently.js +32 -0
- package/esm/core/controllers/recently.js.map +1 -0
- package/esm/core/controllers/say.d.ts +22 -0
- package/esm/core/controllers/say.js +19 -0
- package/esm/core/controllers/say.js.map +1 -0
- package/esm/core/controllers/search.d.ts +58 -0
- package/esm/core/controllers/search.js +26 -0
- package/esm/core/controllers/search.js.map +1 -0
- package/esm/core/controllers/user.d.ts +28 -0
- package/esm/core/controllers/user.js +29 -0
- package/esm/core/controllers/user.js.map +1 -0
- package/esm/core/define.d.ts +17 -0
- package/esm/core/define.js +12 -0
- package/esm/core/define.js.map +1 -0
- package/esm/core/dtos/comment.d.ts +6 -0
- package/esm/core/dtos/comment.js +3 -0
- package/esm/core/dtos/comment.js.map +1 -0
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/interfaces/{client.d.ts → controller.d.ts} +1 -1
- package/esm/interfaces/controller.js +2 -0
- package/esm/interfaces/controller.js.map +1 -0
- package/esm/interfaces/instance.d.ts +3 -2
- package/esm/interfaces/options.d.ts +1 -0
- package/esm/interfaces/options.js +2 -0
- package/esm/interfaces/options.js.map +1 -0
- package/esm/interfaces/params.d.ts +4 -0
- package/esm/interfaces/params.js +2 -0
- package/esm/interfaces/params.js.map +1 -0
- package/esm/interfaces/request.d.ts +19 -9
- package/esm/models/aggregate.d.ts +47 -0
- package/esm/models/aggregate.js +6 -0
- package/esm/models/aggregate.js.map +1 -0
- package/esm/models/base.d.ts +1 -1
- package/esm/models/category.d.ts +24 -0
- package/esm/models/category.js +6 -0
- package/esm/models/category.js.map +1 -0
- package/esm/models/comment.d.ts +28 -0
- package/esm/models/comment.js +7 -0
- package/esm/models/comment.js.map +1 -0
- package/esm/models/link.d.ts +17 -0
- package/esm/models/link.js +11 -0
- package/esm/models/link.js.map +1 -0
- package/esm/models/note.d.ts +34 -0
- package/esm/models/note.js +2 -0
- package/esm/models/note.js.map +1 -0
- package/esm/models/page.d.ts +24 -0
- package/esm/models/page.js +7 -0
- package/esm/models/page.js.map +1 -0
- package/esm/models/post.d.ts +2 -7
- package/esm/models/recently.d.ts +5 -0
- package/esm/models/recently.js +2 -0
- package/esm/models/recently.js.map +1 -0
- package/esm/models/say.d.ts +6 -0
- package/esm/models/say.js +2 -0
- package/esm/models/say.js.map +1 -0
- package/esm/models/setting.d.ts +66 -0
- package/esm/models/setting.js +2 -0
- package/esm/models/setting.js.map +1 -0
- package/esm/models/user.d.ts +29 -0
- package/esm/models/user.js +2 -0
- package/esm/models/user.js.map +1 -0
- package/esm/utils/index.d.ts +4 -0
- package/esm/utils/index.js +38 -0
- package/esm/utils/index.js.map +1 -1
- package/lib/core/attachRequest.js +29 -6
- package/lib/core/attachRequest.js.map +1 -1
- package/lib/core/client.d.ts +12 -15
- package/lib/core/client.js +21 -8
- package/lib/core/client.js.map +1 -1
- package/lib/core/controllers/aggregate.d.ts +44 -0
- package/lib/core/controllers/aggregate.js +44 -0
- package/lib/core/controllers/aggregate.js.map +1 -0
- package/lib/core/controllers/all.d.ts +14 -0
- package/lib/core/controllers/all.js +52 -0
- package/lib/core/controllers/all.js.map +1 -0
- package/lib/core/controllers/base.d.ts +29 -0
- package/lib/core/controllers/base.js +29 -0
- package/lib/core/controllers/base.js.map +1 -0
- package/lib/core/controllers/category.d.ts +44 -0
- package/lib/core/controllers/category.js +70 -0
- package/lib/core/controllers/category.js.map +1 -0
- package/lib/core/controllers/comment.d.ts +42 -0
- package/lib/core/controllers/comment.js +47 -0
- package/lib/core/controllers/comment.js.map +1 -0
- package/lib/core/controllers/index.d.ts +1 -0
- package/lib/core/{clients → controllers}/index.js +0 -3
- package/lib/core/controllers/index.js.map +1 -0
- package/lib/core/controllers/link.d.ts +9 -0
- package/lib/core/controllers/link.js +14 -0
- package/lib/core/controllers/link.js.map +1 -0
- package/lib/core/controllers/note.d.ts +54 -0
- package/lib/core/controllers/note.js +58 -0
- package/lib/core/controllers/note.js.map +1 -0
- package/lib/core/controllers/page.d.ts +34 -0
- package/lib/core/controllers/page.js +37 -0
- package/lib/core/controllers/page.js.map +1 -0
- package/lib/core/controllers/post.d.ts +47 -0
- package/lib/core/controllers/post.js +46 -0
- package/lib/core/controllers/post.js.map +1 -0
- package/lib/core/controllers/recently.d.ts +33 -0
- package/lib/core/controllers/recently.js +36 -0
- package/lib/core/controllers/recently.js.map +1 -0
- package/lib/core/controllers/say.d.ts +22 -0
- package/lib/core/controllers/say.js +23 -0
- package/lib/core/controllers/say.js.map +1 -0
- package/lib/core/controllers/search.d.ts +58 -0
- package/lib/core/controllers/search.js +30 -0
- package/lib/core/controllers/search.js.map +1 -0
- package/lib/core/controllers/user.d.ts +28 -0
- package/lib/core/controllers/user.js +33 -0
- package/lib/core/controllers/user.js.map +1 -0
- package/lib/core/define.d.ts +17 -0
- package/lib/core/define.js +16 -0
- package/lib/core/define.js.map +1 -0
- package/lib/core/dtos/comment.d.ts +6 -0
- package/lib/core/dtos/comment.js +7 -0
- package/lib/core/dtos/comment.js.map +1 -0
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/interfaces/{client.d.ts → controller.d.ts} +1 -1
- package/lib/interfaces/controller.js +3 -0
- package/lib/interfaces/controller.js.map +1 -0
- package/lib/interfaces/instance.d.ts +3 -2
- package/lib/interfaces/options.d.ts +1 -0
- package/lib/interfaces/options.js +3 -0
- package/lib/interfaces/options.js.map +1 -0
- package/lib/interfaces/params.d.ts +4 -0
- package/lib/interfaces/{client.js → params.js} +1 -1
- package/lib/interfaces/params.js.map +1 -0
- package/lib/interfaces/request.d.ts +19 -9
- package/lib/models/aggregate.d.ts +47 -0
- package/lib/models/aggregate.js +9 -0
- package/lib/models/aggregate.js.map +1 -0
- package/lib/models/base.d.ts +1 -1
- package/lib/models/category.d.ts +24 -0
- package/lib/models/category.js +9 -0
- package/lib/models/category.js.map +1 -0
- package/lib/models/comment.d.ts +28 -0
- package/lib/models/comment.js +10 -0
- package/lib/models/comment.js.map +1 -0
- package/lib/models/link.d.ts +17 -0
- package/lib/models/link.js +14 -0
- package/lib/models/link.js.map +1 -0
- package/lib/models/note.d.ts +34 -0
- package/lib/models/note.js +3 -0
- package/lib/models/note.js.map +1 -0
- package/lib/models/page.d.ts +24 -0
- package/lib/models/page.js +10 -0
- package/lib/models/page.js.map +1 -0
- package/lib/models/post.d.ts +2 -7
- package/lib/models/recently.d.ts +5 -0
- package/lib/models/recently.js +3 -0
- package/lib/models/recently.js.map +1 -0
- package/lib/models/say.d.ts +6 -0
- package/lib/models/say.js +3 -0
- package/lib/models/say.js.map +1 -0
- package/lib/models/setting.d.ts +66 -0
- package/lib/models/setting.js +3 -0
- package/lib/models/setting.js.map +1 -0
- package/lib/models/user.d.ts +29 -0
- package/lib/models/user.js +3 -0
- package/lib/models/user.js.map +1 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.js +42 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +12 -11
- package/esm/core/clients/all.d.ts +0 -3
- package/esm/core/clients/all.js +0 -9
- package/esm/core/clients/all.js.map +0 -1
- package/esm/core/clients/index.d.ts +0 -3
- package/esm/core/clients/index.js +0 -5
- package/esm/core/clients/index.js.map +0 -1
- package/esm/core/clients/note.d.ts +0 -5
- package/esm/core/clients/note.js +0 -7
- package/esm/core/clients/note.js.map +0 -1
- package/esm/core/clients/post.d.ts +0 -16
- package/esm/core/clients/post.js +0 -23
- package/esm/core/clients/post.js.map +0 -1
- package/esm/interfaces/client.js +0 -2
- package/esm/interfaces/client.js.map +0 -1
- package/lib/core/clients/all.d.ts +0 -3
- package/lib/core/clients/all.js +0 -12
- package/lib/core/clients/all.js.map +0 -1
- package/lib/core/clients/index.d.ts +0 -3
- package/lib/core/clients/index.js.map +0 -1
- package/lib/core/clients/note.d.ts +0 -5
- package/lib/core/clients/note.js +0 -11
- package/lib/core/clients/note.js.map +0 -1
- package/lib/core/clients/post.d.ts +0 -16
- package/lib/core/clients/post.js +0 -27
- package/lib/core/clients/post.js.map +0 -1
- package/lib/interfaces/client.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostController = void 0;
|
|
4
|
+
class PostController {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.base = 'posts';
|
|
8
|
+
this.name = 'post';
|
|
9
|
+
}
|
|
10
|
+
get proxy() {
|
|
11
|
+
return this.client.proxy(this.base);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 获取文章列表分页
|
|
15
|
+
* @param page
|
|
16
|
+
* @param perPage
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
getList(page = 1, perPage = 10) {
|
|
20
|
+
return this.proxy.get({
|
|
21
|
+
params: { page, size: perPage },
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getPost(idOrCategoryName, slug) {
|
|
25
|
+
if (arguments.length == 1) {
|
|
26
|
+
return this.proxy(idOrCategoryName).get();
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return this.proxy(idOrCategoryName)(slug).get();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 获取最新的文章
|
|
34
|
+
*/
|
|
35
|
+
getLatest() {
|
|
36
|
+
return this.proxy.latest.get();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 点赞
|
|
40
|
+
*/
|
|
41
|
+
thumbsUp(id) {
|
|
42
|
+
return this.proxy('_thumbs-up').get({ params: { id } });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.PostController = PostController;
|
|
46
|
+
//# sourceMappingURL=post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../../src/core/controllers/post.ts"],"names":[],"mappings":";;;AAMA,MAAa,cAAc;IACzB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAEtC,SAAI,GAAG,OAAO,CAAA;QAEd,SAAI,GAAG,MAAM,CAAA;IAJ4B,CAAC;IAM1C,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAA4B;YAC/C,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;SAChC,CAAC,CAAA;IACJ,CAAC;IAaD,OAAO,CAAC,gBAAwB,EAAE,IAAa;QAC7C,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAa,CAAA;SACrD;aAAM;YACL,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAa,CAAA;SAC3D;IACH,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAa,CAAA;IAC3C,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CAAO,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;IAC/D,CAAC;CACF;AAvDD,wCAuDC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { RecentlyModel } from "../../models/recently";
|
|
3
|
+
import { HTTPClient } from '..';
|
|
4
|
+
export declare class RecentlyController implements IController {
|
|
5
|
+
private readonly client;
|
|
6
|
+
base: string;
|
|
7
|
+
name: string;
|
|
8
|
+
constructor(client: HTTPClient);
|
|
9
|
+
get proxy(): import("../../interfaces/request").IRequestHandler;
|
|
10
|
+
/**
|
|
11
|
+
* 获取最新一条
|
|
12
|
+
*/
|
|
13
|
+
getLatestOne(): import("../../interfaces/request").RequestProxyResult<RecentlyModel, {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
data: RecentlyModel;
|
|
16
|
+
}>;
|
|
17
|
+
getAll(): import("../../interfaces/request").RequestProxyResult<{
|
|
18
|
+
data: RecentlyModel[];
|
|
19
|
+
}, {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
data: {
|
|
22
|
+
data: RecentlyModel[];
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
getList(before?: string | undefined, after?: string | undefined, size?: number | number): import("../../interfaces/request").RequestProxyResult<{
|
|
26
|
+
data: RecentlyModel[];
|
|
27
|
+
}, {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
data: {
|
|
30
|
+
data: RecentlyModel[];
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RecentlyController = void 0;
|
|
4
|
+
class RecentlyController {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.base = 'recently';
|
|
8
|
+
this.name = 'recently';
|
|
9
|
+
}
|
|
10
|
+
get proxy() {
|
|
11
|
+
return this.client.proxy(this.base);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 获取最新一条
|
|
15
|
+
*/
|
|
16
|
+
getLatestOne() {
|
|
17
|
+
return this.proxy.latest.get();
|
|
18
|
+
}
|
|
19
|
+
getAll() {
|
|
20
|
+
return this.proxy.all.get();
|
|
21
|
+
}
|
|
22
|
+
getList(before, after, size) {
|
|
23
|
+
if (!before && !after) {
|
|
24
|
+
throw new Error('you can only choose `before` or `after`');
|
|
25
|
+
}
|
|
26
|
+
return this.proxy.get({
|
|
27
|
+
params: {
|
|
28
|
+
before,
|
|
29
|
+
after,
|
|
30
|
+
size,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.RecentlyController = RecentlyController;
|
|
36
|
+
//# sourceMappingURL=recently.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently.js","sourceRoot":"","sources":["../../../src/core/controllers/recently.ts"],"names":[],"mappings":";;;AAIA,MAAa,kBAAkB;IAI7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAH/C,SAAI,GAAG,UAAU,CAAA;QACjB,SAAI,GAAG,UAAU,CAAA;IAEiC,CAAC;IAEnD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IACD;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAiB,CAAA;IAC/C,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAA6B,CAAA;IACxD,CAAC;IAED,OAAO,CACL,MAA2B,EAC3B,KAA0B,EAC1B,IAAsB;QAEtB,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;SAC3D;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAA4B;YAC/C,MAAM,EAAE;gBACN,MAAM;gBACN,KAAK;gBACL,IAAI;aACL;SACF,CAAC,CAAA;IACJ,CAAC;CACF;AApCD,gDAoCC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { SayModel } from "../../models/say";
|
|
3
|
+
import { HTTPClient } from '..';
|
|
4
|
+
import { BaseCrudController } from './base';
|
|
5
|
+
export declare class SayController extends BaseCrudController<SayModel> implements IController {
|
|
6
|
+
protected client: HTTPClient;
|
|
7
|
+
base: string;
|
|
8
|
+
name: string;
|
|
9
|
+
constructor(client: HTTPClient);
|
|
10
|
+
protected get proxy(): import("../../interfaces/request").IRequestHandler;
|
|
11
|
+
/**
|
|
12
|
+
* 获取随机一条
|
|
13
|
+
*/
|
|
14
|
+
getRandom(): import("../../interfaces/request").RequestProxyResult<{
|
|
15
|
+
data: SayModel | null;
|
|
16
|
+
}, {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
data: {
|
|
19
|
+
data: SayModel | null;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SayController = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
class SayController extends base_1.BaseCrudController {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
super(client);
|
|
8
|
+
this.client = client;
|
|
9
|
+
this.base = 'says';
|
|
10
|
+
this.name = 'say';
|
|
11
|
+
}
|
|
12
|
+
get proxy() {
|
|
13
|
+
return this.client.proxy(this.base);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 获取随机一条
|
|
17
|
+
*/
|
|
18
|
+
getRandom() {
|
|
19
|
+
return this.proxy.random.get();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.SayController = SayController;
|
|
23
|
+
//# sourceMappingURL=say.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../../src/core/controllers/say.ts"],"names":[],"mappings":";;;AAGA,iCAA2C;AAE3C,MAAa,aACX,SAAQ,yBAA4B;IAMpC,YAAsB,MAAkB;QACtC,KAAK,CAAC,MAAM,CAAC,CAAA;QADO,WAAM,GAAN,MAAM,CAAY;QAHxC,SAAI,GAAG,MAAM,CAAA;QACb,SAAI,GAAG,KAAK,CAAA;IAIZ,CAAC;IAED,IAAc,KAAK;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAA6B,CAAA;IAC3D,CAAC;CACF;AArBD,sCAqBC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { RequestProxyResult } from "../../interfaces/request";
|
|
3
|
+
import { PaginateResult } from "../../models/base";
|
|
4
|
+
import { NoteModel } from "../../models/note";
|
|
5
|
+
import { PostModel } from "../../models/post";
|
|
6
|
+
import { HTTPClient } from '..';
|
|
7
|
+
declare type SearchOption = {
|
|
8
|
+
orderBy?: string;
|
|
9
|
+
order?: number;
|
|
10
|
+
rawAlgolia?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare class SearchController implements IController {
|
|
13
|
+
private readonly client;
|
|
14
|
+
base: string;
|
|
15
|
+
name: string;
|
|
16
|
+
constructor(client: HTTPClient);
|
|
17
|
+
get proxy(): import("../../interfaces/request").IRequestHandler;
|
|
18
|
+
search(type: 'note', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<NoteModel, 'modified' | 'id' | 'title' | 'created' | 'nid'>>>>;
|
|
19
|
+
search(type: 'post', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<PostModel, 'modified' | 'id' | 'title' | 'created' | 'slug' | 'category'>>>>;
|
|
20
|
+
/**
|
|
21
|
+
* 从 algolya 搜索
|
|
22
|
+
* https://www.algolia.com/doc/api-reference/api-methods/search/
|
|
23
|
+
* @param keyword
|
|
24
|
+
* @param options
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<Pick<PostModel, "created" | "id" | "modified" | "title" | "slug" | "category">> & {
|
|
28
|
+
/**
|
|
29
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
30
|
+
*/
|
|
31
|
+
raw?: any;
|
|
32
|
+
}, {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
data: PaginateResult<Pick<PostModel, "created" | "id" | "modified" | "title" | "slug" | "category">> & {
|
|
35
|
+
/**
|
|
36
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
37
|
+
*/
|
|
38
|
+
raw?: any;
|
|
39
|
+
};
|
|
40
|
+
}>, {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
data: RequestProxyResult<PaginateResult<Pick<PostModel, "created" | "id" | "modified" | "title" | "slug" | "category">> & {
|
|
43
|
+
/**
|
|
44
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
45
|
+
*/
|
|
46
|
+
raw?: any;
|
|
47
|
+
}, {
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
data: PaginateResult<Pick<PostModel, "created" | "id" | "modified" | "title" | "slug" | "category">> & {
|
|
50
|
+
/**
|
|
51
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
52
|
+
*/
|
|
53
|
+
raw?: any;
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchController = void 0;
|
|
4
|
+
class SearchController {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.base = 'search';
|
|
8
|
+
this.name = 'search';
|
|
9
|
+
}
|
|
10
|
+
get proxy() {
|
|
11
|
+
return this.client.proxy(this.base);
|
|
12
|
+
}
|
|
13
|
+
search(type, keyword, options = {}) {
|
|
14
|
+
return this.proxy(type).get({
|
|
15
|
+
params: Object.assign({ keyword }, options),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 从 algolya 搜索
|
|
20
|
+
* https://www.algolia.com/doc/api-reference/api-methods/search/
|
|
21
|
+
* @param keyword
|
|
22
|
+
* @param options
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
searchByAlgolia(keyword, options) {
|
|
26
|
+
return this.proxy('algolia').get({ params: Object.assign({ keyword }, options) });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.SearchController = SearchController;
|
|
30
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/core/controllers/search.ts"],"names":[],"mappings":";;;AAaA,MAAa,gBAAgB;IAI3B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAH/C,SAAI,GAAG,QAAQ,CAAA;QACf,SAAI,GAAG,QAAQ,CAAA;IAEmC,CAAC;IAEnD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IA2BD,MAAM,CACJ,IAAgB,EAChB,OAAe,EACf,UAA4C,EAAE;QAE9C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;YAC1B,MAAM,kBAAI,OAAO,IAAK,OAAO,CAAE;SAChC,CAAC,CAAA;IACJ,CAAC;IACD;;;;;;OAMG;IACH,eAAe,CAAC,OAAe,EAAE,OAAsB;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,CAc9B,EAAE,MAAM,kBAAI,OAAO,IAAK,OAAO,CAAE,EAAE,CAAC,CAAA;IACxC,CAAC;CACF;AApED,4CAoEC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { TLogin, UserModel } from "../../models/user";
|
|
3
|
+
import { HTTPClient } from '..';
|
|
4
|
+
export declare class UserController implements IController {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: HTTPClient);
|
|
7
|
+
base: string;
|
|
8
|
+
name: string;
|
|
9
|
+
protected get proxy(): import("../../interfaces/request").IRequestHandler;
|
|
10
|
+
getMasterInfo(): import("../../interfaces/request").RequestProxyResult<UserModel, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
data: UserModel;
|
|
13
|
+
}>;
|
|
14
|
+
login(username: string, password: string): import("../../interfaces/request").RequestProxyResult<TLogin, {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
data: TLogin;
|
|
17
|
+
}>;
|
|
18
|
+
checkTokenValid(token: string): import("../../interfaces/request").RequestProxyResult<{
|
|
19
|
+
ok: number;
|
|
20
|
+
isGuest: boolean;
|
|
21
|
+
}, {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
data: {
|
|
24
|
+
ok: number;
|
|
25
|
+
isGuest: boolean;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserController = void 0;
|
|
4
|
+
class UserController {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.base = 'master';
|
|
8
|
+
this.name = 'user';
|
|
9
|
+
}
|
|
10
|
+
get proxy() {
|
|
11
|
+
return this.client.proxy(this.base);
|
|
12
|
+
}
|
|
13
|
+
getMasterInfo() {
|
|
14
|
+
return this.proxy.get();
|
|
15
|
+
}
|
|
16
|
+
login(username, password) {
|
|
17
|
+
return this.proxy.login.post({
|
|
18
|
+
data: {
|
|
19
|
+
username,
|
|
20
|
+
password,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
checkTokenValid(token) {
|
|
25
|
+
return this.proxy.check_logged.get({
|
|
26
|
+
params: {
|
|
27
|
+
token,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.UserController = UserController;
|
|
33
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/core/controllers/user.ts"],"names":[],"mappings":";;;AAIA,MAAa,cAAc;IACzB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAE/C,SAAI,GAAG,QAAQ,CAAA;QAEf,SAAI,GAAG,MAAM,CAAA;IAJqC,CAAC;IAMnD,IAAc,KAAK;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,EAAa,CAAA;IACpC,CAAC;IAED,KAAK,CAAC,QAAgB,EAAE,QAAgB;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAS;YACnC,IAAI,EAAE;gBACJ,QAAQ;gBACR,QAAQ;aACT;SACF,CAAC,CAAA;IACJ,CAAC;IAED,eAAe,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAmC;YACnE,MAAM,EAAE;gBACN,KAAK;aACN;SACF,CAAC,CAAA;IACJ,CAAC;CACF;AA/BD,wCA+BC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AggregateController, CategoryController, CommentController, LinkController, NoteController, PageController, PostController, RecentlyController, SayController, SearchController, UserController } from './controllers';
|
|
2
|
+
export declare class HTTPControllerDefine {
|
|
3
|
+
aggregate: AggregateController;
|
|
4
|
+
category: CategoryController;
|
|
5
|
+
comment: CommentController;
|
|
6
|
+
link: LinkController;
|
|
7
|
+
note: NoteController;
|
|
8
|
+
page: PageController;
|
|
9
|
+
post: PostController;
|
|
10
|
+
recently: RecentlyController;
|
|
11
|
+
say: SayController;
|
|
12
|
+
search: SearchController;
|
|
13
|
+
user: UserController;
|
|
14
|
+
get master(): UserController;
|
|
15
|
+
get friend(): LinkController;
|
|
16
|
+
get shorthand(): RecentlyController;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HTTPControllerDefine = void 0;
|
|
4
|
+
class HTTPControllerDefine {
|
|
5
|
+
get master() {
|
|
6
|
+
return this.user;
|
|
7
|
+
}
|
|
8
|
+
get friend() {
|
|
9
|
+
return this.link;
|
|
10
|
+
}
|
|
11
|
+
get shorthand() {
|
|
12
|
+
return this.recently;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.HTTPControllerDefine = HTTPControllerDefine;
|
|
16
|
+
//# sourceMappingURL=define.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/core/define.ts"],"names":[],"mappings":";;;AAcA,MAAa,oBAAoB;IAa/B,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;CACF;AAxBD,oDAwBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../../src/core/dtos/comment.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAU;CAQtB;AARD,gCAQC"}
|
package/lib/core/index.d.ts
CHANGED
package/lib/core/index.js
CHANGED
|
@@ -11,6 +11,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./client"), exports);
|
|
14
|
-
__exportStar(require("./
|
|
14
|
+
__exportStar(require("./controllers"), exports);
|
|
15
15
|
__exportStar(require("./error"), exports);
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/lib/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwB;AACxB,gDAA6B;AAC7B,0CAAuB"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { allClientName, allClients, createClient, HTTPClient, NoteClient, PostClient, RequestError, } from './core';
|
|
1
|
+
export { allContollerNames as allClientName, allControllers as allClients, createClient, HTTPClient, NoteController as NoteClient, PostController as PostClient, RequestError, } from './core';
|
package/lib/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RequestError = exports.PostClient = exports.NoteClient = exports.HTTPClient = exports.createClient = exports.allClients = exports.allClientName = void 0;
|
|
4
4
|
var core_1 = require("./core");
|
|
5
|
-
Object.defineProperty(exports, "allClientName", { enumerable: true, get: function () { return core_1.
|
|
6
|
-
Object.defineProperty(exports, "allClients", { enumerable: true, get: function () { return core_1.
|
|
5
|
+
Object.defineProperty(exports, "allClientName", { enumerable: true, get: function () { return core_1.allContollerNames; } });
|
|
6
|
+
Object.defineProperty(exports, "allClients", { enumerable: true, get: function () { return core_1.allControllers; } });
|
|
7
7
|
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return core_1.createClient; } });
|
|
8
8
|
Object.defineProperty(exports, "HTTPClient", { enumerable: true, get: function () { return core_1.HTTPClient; } });
|
|
9
|
-
Object.defineProperty(exports, "NoteClient", { enumerable: true, get: function () { return core_1.
|
|
10
|
-
Object.defineProperty(exports, "PostClient", { enumerable: true, get: function () { return core_1.
|
|
9
|
+
Object.defineProperty(exports, "NoteClient", { enumerable: true, get: function () { return core_1.NoteController; } });
|
|
10
|
+
Object.defineProperty(exports, "PostClient", { enumerable: true, get: function () { return core_1.PostController; } });
|
|
11
11
|
Object.defineProperty(exports, "RequestError", { enumerable: true, get: function () { return core_1.RequestError; } });
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAQe;AAPb,qGAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAQe;AAPb,qGAAA,iBAAiB,OAAiB;AAClC,kGAAA,cAAc,OAAc;AAC5B,oGAAA,YAAY,OAAA;AACZ,kGAAA,UAAU,OAAA;AACV,kGAAA,cAAc,OAAc;AAC5B,kGAAA,cAAc,OAAc;AAC5B,oGAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/interfaces/controller.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export interface RequestOptions {
|
|
2
2
|
method?: string;
|
|
3
|
-
data?: string
|
|
4
|
-
params?: Record<string, any
|
|
3
|
+
data?: Record<string, any>;
|
|
4
|
+
params?: Record<string, any> | URLSearchParams;
|
|
5
|
+
headers?: Record<string, string>;
|
|
5
6
|
[key: string]: any;
|
|
6
7
|
}
|
|
7
8
|
export interface IRequestAdapter {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type SortOrder = 'asc' | 'desc';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/interfaces/options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../src/interfaces/params.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import { RequestOptions } from './instance';
|
|
1
|
+
import type { RequestOptions } from './instance';
|
|
2
|
+
declare type NoStringIndex<T> = {
|
|
3
|
+
[K in keyof T as string extends K ? never : K]: T[K];
|
|
4
|
+
};
|
|
2
5
|
export declare type Method = 'get' | 'delete' | 'post' | 'put' | 'patch';
|
|
3
|
-
export interface IRequestHandler
|
|
6
|
+
export interface IRequestHandler {
|
|
4
7
|
(id?: string): IRequestHandler;
|
|
5
|
-
get<P = unknown>(options?:
|
|
6
|
-
post<P = unknown>(options?:
|
|
7
|
-
patch<P = unknown>(options?:
|
|
8
|
-
delete<P = unknown>(options?:
|
|
9
|
-
put<P = unknown>(options?:
|
|
8
|
+
get<P = unknown>(options?: Omit<NoStringIndex<RequestOptions>, 'data'>): RequestProxyResult<P>;
|
|
9
|
+
post<P = unknown>(options?: RequestOptions): RequestProxyResult<P>;
|
|
10
|
+
patch<P = unknown>(options?: RequestOptions): RequestProxyResult<P>;
|
|
11
|
+
delete<P = unknown>(options?: Omit<NoStringIndex<RequestOptions>, 'data'>): RequestProxyResult<P>;
|
|
12
|
+
put<P = unknown>(options?: RequestOptions): RequestProxyResult<P>;
|
|
10
13
|
[key: string]: IRequestHandler;
|
|
11
14
|
}
|
|
12
15
|
export declare type RequestProxyResult<T, R = {
|
|
13
16
|
data: T;
|
|
14
17
|
[key: string]: any;
|
|
15
|
-
}> = Promise<T
|
|
18
|
+
}> = Promise<ResponseProxyExtraRaw<T, R>>;
|
|
19
|
+
export declare type ResponseProxyExtraRaw<T, R = any> = T & {
|
|
16
20
|
raw: R;
|
|
17
|
-
|
|
21
|
+
request: {
|
|
22
|
+
path: string;
|
|
23
|
+
method: string;
|
|
24
|
+
[k: string]: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { NoteModel } from './note';
|
|
2
|
+
import { PageModel } from './page';
|
|
3
|
+
import { CategoryModel, PostModel } from './post';
|
|
4
|
+
import { SayModel } from './say';
|
|
5
|
+
import { SeoOptionModel } from './setting';
|
|
6
|
+
import { UserModel } from './user';
|
|
7
|
+
export interface AggregateRoot {
|
|
8
|
+
user: UserModel;
|
|
9
|
+
seo: SeoOptionModel;
|
|
10
|
+
categories: CategoryModel[];
|
|
11
|
+
pageMeta: Pick<PageModel, 'title' | 'id' | 'slug' | 'order'>[] | null;
|
|
12
|
+
lastestNoteNid: number | null;
|
|
13
|
+
}
|
|
14
|
+
export interface AggregateTop {
|
|
15
|
+
notes: Pick<NoteModel, 'id' | 'title' | 'created' | 'nid'>[];
|
|
16
|
+
posts: Pick<PostModel, 'id' | 'slug' | 'created' | 'title' | 'category'>[];
|
|
17
|
+
says: SayModel[];
|
|
18
|
+
}
|
|
19
|
+
export declare enum TimelineType {
|
|
20
|
+
Post = 0,
|
|
21
|
+
Note = 1
|
|
22
|
+
}
|
|
23
|
+
export interface TimelineData {
|
|
24
|
+
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'hasMemory'>[];
|
|
25
|
+
posts?: (Pick<PostModel, 'id' | 'title' | 'slug' | 'created' | 'modified' | 'category'> & {
|
|
26
|
+
url: string;
|
|
27
|
+
})[];
|
|
28
|
+
}
|
|
29
|
+
export interface AggregateStat {
|
|
30
|
+
allComments: number;
|
|
31
|
+
categories: number;
|
|
32
|
+
comments: number;
|
|
33
|
+
linkApply: number;
|
|
34
|
+
links: number;
|
|
35
|
+
notes: number;
|
|
36
|
+
pages: number;
|
|
37
|
+
posts: number;
|
|
38
|
+
says: number;
|
|
39
|
+
recently: number;
|
|
40
|
+
unreadComments: number;
|
|
41
|
+
online: number;
|
|
42
|
+
todayMaxOnline: string;
|
|
43
|
+
todayOnlineTotal: string;
|
|
44
|
+
callTime: number;
|
|
45
|
+
uv: number;
|
|
46
|
+
todayIPAccessCount: number;
|
|
47
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimelineType = void 0;
|
|
4
|
+
var TimelineType;
|
|
5
|
+
(function (TimelineType) {
|
|
6
|
+
TimelineType[TimelineType["Post"] = 0] = "Post";
|
|
7
|
+
TimelineType[TimelineType["Note"] = 1] = "Note";
|
|
8
|
+
})(TimelineType = exports.TimelineType || (exports.TimelineType = {}));
|
|
9
|
+
//# sourceMappingURL=aggregate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/models/aggregate.ts"],"names":[],"mappings":";;;AAqBA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+CAAI,CAAA;IACJ,+CAAI,CAAA;AACN,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
|
package/lib/models/base.d.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PostModel } from './post';
|
|
2
|
+
export declare enum CategoryType {
|
|
3
|
+
Category = 0,
|
|
4
|
+
Tag = 1
|
|
5
|
+
}
|
|
6
|
+
export interface CategoryModel {
|
|
7
|
+
type: CategoryType;
|
|
8
|
+
count: number;
|
|
9
|
+
id: string;
|
|
10
|
+
created: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
name: string;
|
|
13
|
+
modified: string;
|
|
14
|
+
}
|
|
15
|
+
export declare type CategoryWithChildrenModel = CategoryModel & {
|
|
16
|
+
children: Pick<PostModel, 'id' | 'title' | 'slug' | 'modified' | 'created'>[];
|
|
17
|
+
};
|
|
18
|
+
export declare type CategoryEntries = {
|
|
19
|
+
entries: Record<string, CategoryWithChildrenModel>;
|
|
20
|
+
};
|
|
21
|
+
export interface TagModel {
|
|
22
|
+
count: number;
|
|
23
|
+
name: string;
|
|
24
|
+
}
|