@mx-space/api-client 0.3.3 → 0.3.4
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 +9 -9
- 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 +210 -119
- package/build/index.esm.js +9 -9
- 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 +9 -9
- 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/controllers/aggregate.d.ts +5 -7
- package/esm/core/controllers/aggregate.js.map +1 -1
- package/esm/core/controllers/base.d.ts +5 -7
- package/esm/core/controllers/base.js.map +1 -1
- package/esm/core/controllers/category.d.ts +6 -16
- package/esm/core/controllers/category.js +2 -2
- package/esm/core/controllers/category.js.map +1 -1
- package/esm/core/controllers/comment.d.ts +2 -1
- package/esm/core/controllers/comment.js.map +1 -1
- package/esm/core/controllers/note.d.ts +3 -2
- package/esm/core/controllers/note.js.map +1 -1
- package/esm/core/controllers/page.d.ts +2 -1
- package/esm/core/controllers/page.js.map +1 -1
- package/esm/core/controllers/recently.d.ts +2 -1
- package/esm/core/controllers/recently.js.map +1 -1
- package/esm/core/controllers/say.d.ts +2 -1
- package/esm/core/controllers/say.js.map +1 -1
- package/esm/core/controllers/search.d.ts +6 -6
- package/esm/core/controllers/snippet.d.ts +2 -1
- package/esm/core/controllers/snippet.js.map +1 -1
- package/esm/core/controllers/user.d.ts +2 -1
- package/esm/core/controllers/user.js.map +1 -1
- package/esm/models/aggregate.d.ts +2 -1
- package/esm/models/aggregate.js.map +1 -1
- package/esm/models/post.d.ts +1 -9
- package/lib/core/controllers/aggregate.d.ts +5 -7
- package/lib/core/controllers/aggregate.js.map +1 -1
- package/lib/core/controllers/base.d.ts +5 -7
- package/lib/core/controllers/base.js.map +1 -1
- package/lib/core/controllers/category.d.ts +6 -16
- package/lib/core/controllers/category.js +3 -3
- package/lib/core/controllers/category.js.map +1 -1
- package/lib/core/controllers/comment.d.ts +2 -1
- package/lib/core/controllers/comment.js.map +1 -1
- package/lib/core/controllers/note.d.ts +3 -2
- package/lib/core/controllers/note.js.map +1 -1
- package/lib/core/controllers/page.d.ts +2 -1
- package/lib/core/controllers/page.js.map +1 -1
- package/lib/core/controllers/recently.d.ts +2 -1
- package/lib/core/controllers/recently.js.map +1 -1
- package/lib/core/controllers/say.d.ts +2 -1
- package/lib/core/controllers/say.js.map +1 -1
- package/lib/core/controllers/search.d.ts +6 -6
- package/lib/core/controllers/snippet.d.ts +2 -1
- package/lib/core/controllers/snippet.js.map +1 -1
- package/lib/core/controllers/user.d.ts +2 -1
- package/lib/core/controllers/user.js.map +1 -1
- package/lib/models/aggregate.d.ts +2 -1
- package/lib/models/aggregate.js.map +1 -1
- package/lib/models/post.d.ts +1 -9
- package/package.json +5 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { PaginateResult } from "../../models/base";
|
|
3
4
|
import { PageModel } from "../../models/page";
|
|
4
5
|
import { SelectFields } from "../../types/helper";
|
|
@@ -13,7 +14,7 @@ export declare class PageController implements IController {
|
|
|
13
14
|
constructor(client: HTTPClient);
|
|
14
15
|
base: string;
|
|
15
16
|
name: string;
|
|
16
|
-
get proxy():
|
|
17
|
+
get proxy(): IRequestHandler;
|
|
17
18
|
/**
|
|
18
19
|
* 页面列表
|
|
19
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/core/controllers/page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/core/controllers/page.ts"],"names":[],"mappings":"AAaA,MAAM,OAAO,cAAc;IACzB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAC/C,SAAI,GAAG,OAAO,CAAA;QACd,SAAI,GAAG,MAAM,CAAA;IAFqC,CAAC;IAGnD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IACD;;OAEG;IACH,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE,EAAE,UAA2B,EAAE;QAC3D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAA4B;YAC/C,MAAM,EAAE;gBACN,IAAI;gBACJ,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,GAAG,CAAC;gBACzB,MAAM;gBACN,SAAS;aACV;SACF,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAa,CAAA;IACxC,CAAC;IACD;;;;OAIG;IACH,SAAS,CAAC,IAAY;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAY,EAAE,CAAC,CAAA;IACjD,CAAC;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { RecentlyModel } from "../../models/recently";
|
|
3
4
|
import { HTTPClient } from '..';
|
|
4
5
|
export declare class RecentlyController implements IController {
|
|
@@ -6,7 +7,7 @@ export declare class RecentlyController implements IController {
|
|
|
6
7
|
base: string;
|
|
7
8
|
name: string;
|
|
8
9
|
constructor(client: HTTPClient);
|
|
9
|
-
get proxy():
|
|
10
|
+
get proxy(): IRequestHandler;
|
|
10
11
|
/**
|
|
11
12
|
* 获取最新一条
|
|
12
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recently.js","sourceRoot":"","sources":["../../../src/core/controllers/recently.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recently.js","sourceRoot":"","sources":["../../../src/core/controllers/recently.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { SayModel } from "../../models/say";
|
|
3
4
|
import { HTTPClient } from '..';
|
|
4
5
|
import { BaseCrudController } from './base';
|
|
@@ -7,7 +8,7 @@ export declare class SayController extends BaseCrudController<SayModel> implemen
|
|
|
7
8
|
base: string;
|
|
8
9
|
name: string;
|
|
9
10
|
constructor(client: HTTPClient);
|
|
10
|
-
protected get proxy():
|
|
11
|
+
protected get proxy(): IRequestHandler;
|
|
11
12
|
/**
|
|
12
13
|
* 获取随机一条
|
|
13
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../../src/core/controllers/say.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../../src/core/controllers/say.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AAE3C,MAAM,OAAO,aACX,SAAQ,kBAA4B;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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
-
import { RequestProxyResult } from "../../interfaces/request";
|
|
2
|
+
import { IRequestHandler, RequestProxyResult } from "../../interfaces/request";
|
|
3
3
|
import { PaginateResult } from "../../models/base";
|
|
4
4
|
import { NoteModel } from "../../models/note";
|
|
5
5
|
import { PostModel } from "../../models/post";
|
|
@@ -14,7 +14,7 @@ export declare class SearchController implements IController {
|
|
|
14
14
|
base: string;
|
|
15
15
|
name: string;
|
|
16
16
|
constructor(client: HTTPClient);
|
|
17
|
-
get proxy():
|
|
17
|
+
get proxy(): IRequestHandler;
|
|
18
18
|
search(type: 'note', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<NoteModel, 'modified' | 'id' | 'title' | 'created' | 'nid'>>>>;
|
|
19
19
|
search(type: 'post', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<PostModel, 'modified' | 'id' | 'title' | 'created' | 'slug' | 'category'>>>>;
|
|
20
20
|
/**
|
|
@@ -24,14 +24,14 @@ export declare class SearchController implements IController {
|
|
|
24
24
|
* @param options
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<Pick<PostModel, "
|
|
27
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<Pick<PostModel, "id" | "title" | "slug" | "modified" | "created" | "category">> & {
|
|
28
28
|
/**
|
|
29
29
|
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
30
30
|
*/
|
|
31
31
|
raw?: any;
|
|
32
32
|
}, {
|
|
33
33
|
[key: string]: any;
|
|
34
|
-
data: PaginateResult<Pick<PostModel, "
|
|
34
|
+
data: PaginateResult<Pick<PostModel, "id" | "title" | "slug" | "modified" | "created" | "category">> & {
|
|
35
35
|
/**
|
|
36
36
|
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
37
37
|
*/
|
|
@@ -39,14 +39,14 @@ export declare class SearchController implements IController {
|
|
|
39
39
|
};
|
|
40
40
|
}>, {
|
|
41
41
|
[key: string]: any;
|
|
42
|
-
data: RequestProxyResult<PaginateResult<Pick<PostModel, "
|
|
42
|
+
data: RequestProxyResult<PaginateResult<Pick<PostModel, "id" | "title" | "slug" | "modified" | "created" | "category">> & {
|
|
43
43
|
/**
|
|
44
44
|
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
45
45
|
*/
|
|
46
46
|
raw?: any;
|
|
47
47
|
}, {
|
|
48
48
|
[key: string]: any;
|
|
49
|
-
data: PaginateResult<Pick<PostModel, "
|
|
49
|
+
data: PaginateResult<Pick<PostModel, "id" | "title" | "slug" | "modified" | "created" | "category">> & {
|
|
50
50
|
/**
|
|
51
51
|
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
52
52
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { SnippetModel } from "../../models/snippet";
|
|
3
4
|
import { HTTPClient } from '..';
|
|
4
5
|
export declare class SnippetController implements IController {
|
|
@@ -6,7 +7,7 @@ export declare class SnippetController implements IController {
|
|
|
6
7
|
base: string;
|
|
7
8
|
name: string;
|
|
8
9
|
constructor(client: HTTPClient);
|
|
9
|
-
get proxy():
|
|
10
|
+
get proxy(): IRequestHandler;
|
|
10
11
|
getById(id: string): import("../../interfaces/request").RequestProxyResult<SnippetModel, {
|
|
11
12
|
[key: string]: any;
|
|
12
13
|
data: SnippetModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../../src/core/controllers/snippet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../../src/core/controllers/snippet.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,iBAAiB;IAI5B,YAAsB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAHxC,SAAI,GAAG,UAAU,CAAA;QACjB,SAAI,GAAG,SAAS,CAAA;IAE2B,CAAC;IAE5C,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAgB,CAAA;IAC3C,CAAC;IAED,qBAAqB,CAAC,SAAiB,EAAE,IAAY;QACnD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAgB,CAAA;IACxD,CAAC;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { TLogin, UserModel } from "../../models/user";
|
|
3
4
|
import { HTTPClient } from '..';
|
|
4
5
|
export declare class UserController implements IController {
|
|
@@ -6,7 +7,7 @@ export declare class UserController implements IController {
|
|
|
6
7
|
constructor(client: HTTPClient);
|
|
7
8
|
base: string;
|
|
8
9
|
name: string;
|
|
9
|
-
protected get proxy():
|
|
10
|
+
protected get proxy(): IRequestHandler;
|
|
10
11
|
getMasterInfo(): import("../../interfaces/request").RequestProxyResult<UserModel, {
|
|
11
12
|
[key: string]: any;
|
|
12
13
|
data: UserModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/core/controllers/user.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/core/controllers/user.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { CategoryModel } from './category';
|
|
1
2
|
import { NoteModel } from './note';
|
|
2
3
|
import { PageModel } from './page';
|
|
3
|
-
import {
|
|
4
|
+
import { PostModel } from './post';
|
|
4
5
|
import { SayModel } from './say';
|
|
5
6
|
import { SeoOptionModel } from './setting';
|
|
6
7
|
import { UserModel } from './user';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/models/aggregate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/models/aggregate.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+CAAI,CAAA;IACJ,+CAAI,CAAA;AACN,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB"}
|
package/esm/models/post.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Count, Image } from './base';
|
|
2
|
+
import { CategoryModel } from './category';
|
|
2
3
|
export interface PostModel {
|
|
3
4
|
commentsIndex: number;
|
|
4
5
|
allowComment: boolean;
|
|
@@ -16,12 +17,3 @@ export interface PostModel {
|
|
|
16
17
|
created: string;
|
|
17
18
|
category: CategoryModel;
|
|
18
19
|
}
|
|
19
|
-
export interface CategoryModel {
|
|
20
|
-
type: number;
|
|
21
|
-
count: number;
|
|
22
|
-
id: string;
|
|
23
|
-
name: string;
|
|
24
|
-
slug: string;
|
|
25
|
-
created: Date;
|
|
26
|
-
categoryId: string;
|
|
27
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
2
|
import { SortOrder } from "../../interfaces/options";
|
|
3
|
+
import { RequestProxyResult } from "../../interfaces/request";
|
|
3
4
|
import { AggregateRoot, AggregateStat, AggregateTop, TimelineData, TimelineType } from "../../models/aggregate";
|
|
4
5
|
import { HTTPClient } from '..';
|
|
5
6
|
export declare class AggregateController implements IController {
|
|
@@ -11,14 +12,11 @@ export declare class AggregateController implements IController {
|
|
|
11
12
|
/**
|
|
12
13
|
* 获取聚合数据
|
|
13
14
|
*/
|
|
14
|
-
getAggregateData():
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
data: AggregateRoot;
|
|
17
|
-
}>;
|
|
15
|
+
getAggregateData(): RequestProxyResult<AggregateRoot>;
|
|
18
16
|
/**
|
|
19
17
|
* 获取最新发布的内容
|
|
20
18
|
*/
|
|
21
|
-
getTop(size?: number):
|
|
19
|
+
getTop(size?: number): RequestProxyResult<AggregateTop, {
|
|
22
20
|
[key: string]: any;
|
|
23
21
|
data: AggregateTop;
|
|
24
22
|
}>;
|
|
@@ -26,7 +24,7 @@ export declare class AggregateController implements IController {
|
|
|
26
24
|
sort?: SortOrder;
|
|
27
25
|
type?: TimelineType;
|
|
28
26
|
year?: number;
|
|
29
|
-
}):
|
|
27
|
+
}): RequestProxyResult<{
|
|
30
28
|
data: TimelineData;
|
|
31
29
|
}, {
|
|
32
30
|
[key: string]: any;
|
|
@@ -37,7 +35,7 @@ export declare class AggregateController implements IController {
|
|
|
37
35
|
/**
|
|
38
36
|
* 获取聚合数据统计
|
|
39
37
|
*/
|
|
40
|
-
getStat():
|
|
38
|
+
getStat(): RequestProxyResult<AggregateStat, {
|
|
41
39
|
[key: string]: any;
|
|
42
40
|
data: AggregateStat;
|
|
43
41
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../../src/core/controllers/aggregate.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../../src/core/controllers/aggregate.ts"],"names":[],"mappings":";;;AAUA,uCAA2C;AAG3C,MAAa,mBAAmB;IAG9B,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAFtC,SAAI,GAAG,WAAW,CAAA;QAClB,SAAI,GAAG,WAAW,CAAA;IACuB,CAAC;IAC1C,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,EAAiB,CAAA;IACxC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,GAAG,CAAC;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAe,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC/D,CAAC;IAED,WAAW,CAAC,OAIX;QACC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;QAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAyB;YACrD,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,IAAI,IAAA,yBAAiB,EAAC,IAAI,CAAC;gBACrC,IAAI;gBACJ,IAAI;aACL;SACF,CAAC,CAAA;IACJ,CAAC;IACD;;OAEG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAiB,CAAA;IAC7C,CAAC;CACF;AA1CD,kDA0CC"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
+
import { IRequestHandler, RequestProxyResult } from "../../interfaces/request";
|
|
1
2
|
import { PaginateResult } from "../../models/base";
|
|
2
3
|
import { HTTPClient } from '..';
|
|
3
4
|
export declare abstract class BaseCrudController<T> {
|
|
4
5
|
protected client: HTTPClient;
|
|
5
6
|
base: string;
|
|
6
7
|
constructor(client: HTTPClient);
|
|
7
|
-
protected get proxy():
|
|
8
|
-
getById(id: string):
|
|
9
|
-
|
|
10
|
-
data: T;
|
|
11
|
-
}>;
|
|
12
|
-
getAll(): import("../../interfaces/request").RequestProxyResult<{
|
|
8
|
+
protected get proxy(): IRequestHandler;
|
|
9
|
+
getById(id: string): RequestProxyResult<T>;
|
|
10
|
+
getAll(): RequestProxyResult<{
|
|
13
11
|
data: T[];
|
|
14
12
|
}, {
|
|
15
13
|
[key: string]: any;
|
|
@@ -22,7 +20,7 @@ export declare abstract class BaseCrudController<T> {
|
|
|
22
20
|
* @param page
|
|
23
21
|
* @param perPage
|
|
24
22
|
*/
|
|
25
|
-
getAllPaginated(page?: number, perPage?: number):
|
|
23
|
+
getAllPaginated(page?: number, perPage?: number): RequestProxyResult<PaginateResult<T>, {
|
|
26
24
|
[key: string]: any;
|
|
27
25
|
data: PaginateResult<T>;
|
|
28
26
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/core/controllers/base.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/core/controllers/base.ts"],"names":[],"mappings":";;;AAIA,MAAsB,kBAAkB;IAEtC,YAAsB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAC5C,IAAc,KAAK;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAK,CAAA;IAChC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAiB,CAAA;IAC5C,CAAC;IACD;;;;OAIG;IACH,eAAe,CAAC,IAAa,EAAE,OAAgB;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAoB;YACvC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;SAChC,CAAC,CAAA;IACJ,CAAC;CACF;AAxBD,gDAwBC"}
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
-
import { ResponseProxyExtraRaw } from "../../interfaces/request";
|
|
3
|
-
import { CategoryWithChildrenModel, TagModel } from
|
|
4
|
-
import {
|
|
5
|
-
import { HTTPClient } from '
|
|
2
|
+
import { RequestProxyResult, ResponseProxyExtraRaw } from "../../interfaces/request";
|
|
3
|
+
import { CategoryModel, CategoryWithChildrenModel, TagModel } from '../../models/category';
|
|
4
|
+
import { PostModel } from '../../models/post';
|
|
5
|
+
import { HTTPClient } from '../client';
|
|
6
6
|
export declare class CategoryController implements IController {
|
|
7
7
|
private client;
|
|
8
8
|
name: string;
|
|
9
9
|
base: string;
|
|
10
10
|
constructor(client: HTTPClient);
|
|
11
11
|
private get proxy();
|
|
12
|
-
getAllCategories():
|
|
12
|
+
getAllCategories(): RequestProxyResult<{
|
|
13
13
|
data: CategoryModel[];
|
|
14
|
-
}, {
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
data: {
|
|
17
|
-
data: CategoryModel[];
|
|
18
|
-
};
|
|
19
14
|
}>;
|
|
20
|
-
getAllTags():
|
|
15
|
+
getAllTags(): RequestProxyResult<{
|
|
21
16
|
data: TagModel[];
|
|
22
|
-
}, {
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
data: {
|
|
25
|
-
data: TagModel[];
|
|
26
|
-
};
|
|
27
17
|
}>;
|
|
28
18
|
getCategoryDetail(id: string): Promise<ResponseProxyExtraRaw<CategoryWithChildrenModel>>;
|
|
29
19
|
getCategoryDetail(ids: string[]): Promise<ResponseProxyExtraRaw<Map<string, CategoryWithChildrenModel>>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CategoryController = void 0;
|
|
4
|
-
const category_1 = require("../../models/category");
|
|
5
4
|
const utils_1 = require("../../utils");
|
|
6
|
-
const
|
|
5
|
+
const category_1 = require("../../models/category");
|
|
6
|
+
const error_1 = require("../error");
|
|
7
7
|
class CategoryController {
|
|
8
8
|
constructor(client) {
|
|
9
9
|
this.client = client;
|
|
@@ -46,7 +46,7 @@ class CategoryController {
|
|
|
46
46
|
});
|
|
47
47
|
const entries = data === null || data === void 0 ? void 0 : data.entries;
|
|
48
48
|
if (!entries) {
|
|
49
|
-
throw new
|
|
49
|
+
throw new error_1.RequestError('data structure error', 500, data.$request.path, data);
|
|
50
50
|
}
|
|
51
51
|
const map = new Map(Object.entries(entries).map(([id, value]) => [id.toLowerCase(), value]));
|
|
52
52
|
(0, utils_1.attachRawFromOneToAnthor)(data, map);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../../src/core/controllers/category.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../../src/core/controllers/category.ts"],"names":[],"mappings":";;;AAEA,uCAAmE;AACnE,oDAM8B;AAG9B,oCAAuC;AAEvC,MAAa,kBAAkB;IAG7B,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAFtC,SAAI,GAAG,UAAU,CAAA;QACjB,SAAI,GAAG,YAAY,CAAA;IACsB,CAAC;IAE1C,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACpB,MAAM,EAAE;gBACN,IAAI,EAAE,uBAAY,CAAC,QAAQ;aAC5B;SACF,CAAC,CAAA;IACJ,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAuB;YAC1C,MAAM,EAAE;gBACN,IAAI,EAAE,uBAAY,CAAC,GAAG;aACvB;SACF,CAAC,CAAA;IACJ,CAAC;IAQD,KAAK,CAAC,iBAAiB,CAAC,GAAsB;QAC5C,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB;gBACjD,MAAM,EAAE;oBACN,GAAG,EAAE,GAAG;iBACT;aACF,CAAC,CAAA;YACF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7C,IAAA,gCAAwB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAA;YACtC,OAAO,MAAM,CAAA;SACd;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB;gBACjD,MAAM,EAAE;oBACN,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;iBACnB;aACF,CAAC,CAAA;YACF,MAAM,OAAO,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAA;YAC7B,IAAI,CAAC,OAAO,EAAE;gBACZ,MAAM,IAAI,oBAAY,CACpB,sBAAsB,EACtB,GAAG,EACH,IAAI,CAAC,QAAQ,CAAC,IAAI,EAClB,IAAI,CACL,CAAA;aACF;YAED,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC,CACxE,CAAA;YAED,IAAA,gCAAwB,EAAC,IAAI,EAAE,GAAG,CAAC,CAAA;YACnC,OAAO,GAAG,CAAA;SACX;IACH,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,QAAgB;QAC1C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,EAA6B,CAAA;QACvE,OAAO,IAAA,uBAAe,EAAC,GAAG,CAAe,CAAA;IAC3C,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,IAAY;QAC7B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAGnC;YACD,MAAM,EAAE;gBACN,GAAG,EAAE,CAAC;aACP;SACF,CAAC,CAAA;QAEF,OAAO,GAAG,CAAA;IACZ,CAAC;CACF;AAnFD,gDAmFC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
2
|
import { PaginationParams } from "../../interfaces/params";
|
|
3
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
3
4
|
import { PaginateResult } from "../../models/base";
|
|
4
5
|
import { CommentModel } from "../../models/comment";
|
|
5
6
|
import { HTTPClient } from '..';
|
|
@@ -9,7 +10,7 @@ export declare class CommentController implements IController {
|
|
|
9
10
|
base: string;
|
|
10
11
|
name: string;
|
|
11
12
|
constructor(client: HTTPClient);
|
|
12
|
-
get proxy():
|
|
13
|
+
get proxy(): IRequestHandler;
|
|
13
14
|
/**
|
|
14
15
|
* 根据 comment id 获取评论, 包括子评论
|
|
15
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../../src/core/controllers/comment.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../../src/core/controllers/comment.ts"],"names":[],"mappings":";;;AAQA,MAAa,iBAAiB;IAI5B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAH/C,SAAI,GAAG,UAAU,CAAA;QACjB,SAAI,GAAG,SAAS,CAAA;IAEkC,CAAC;IAEnD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAgB,CAAA;IAC3C,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,KAAa,EAAE,aAA+B,EAAE;QACzD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,UAAU,CAAA;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAA+B;YAC7D,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,EAAE;SAC9C,CAAC,CAAA;IACJ,CAAC;IACD;;OAEG;IACH,OAAO,CAAC,KAAa,EAAE,IAAgB;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAe;YAC1C,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAiB,EAAE,IAAgB;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAe;YACpD,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF;AA5CD,8CA4CC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { PaginateResult } from "../../models/base";
|
|
3
4
|
import { NoteModel, NoteWrappedPayload } from "../../models/note";
|
|
4
5
|
import { SelectFields } from "../../types/helper";
|
|
5
|
-
import { HTTPClient } from '
|
|
6
|
+
import { HTTPClient } from '../client';
|
|
6
7
|
export declare type NoteListOptions = {
|
|
7
8
|
select?: SelectFields<keyof NoteModel>;
|
|
8
9
|
year?: number;
|
|
@@ -14,7 +15,7 @@ export declare class NoteController implements IController {
|
|
|
14
15
|
base: string;
|
|
15
16
|
name: string;
|
|
16
17
|
constructor(client: HTTPClient);
|
|
17
|
-
get proxy():
|
|
18
|
+
get proxy(): IRequestHandler;
|
|
18
19
|
/**
|
|
19
20
|
* 最新日记
|
|
20
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../../src/core/controllers/note.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../../src/core/controllers/note.ts"],"names":[],"mappings":";;;AAcA,MAAa,cAAc;IAIzB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAHtC,SAAI,GAAG,OAAO,CAAA;QACd,SAAI,GAAG,MAAM,CAAA;IAE4B,CAAC;IAC1C,IAAI,KAAK;QACP,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,EAAsB,CAAA;IACpD,CAAC;IAED;;;;OAIG;IAEH,WAAW,CAAC,EAAmB,EAAE,QAAiB;QAChD,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAqB;gBAC3D,MAAM,EAAE,EAAE,QAAQ,EAAE;aACrB,CAAC,CAAA;SACH;aAAM;YACL,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAqB,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;SACxE;IACH,CAAC;IAED;;OAEG;IAEH,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE,EAAE,UAA2B,EAAE;QAC3D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;QACnD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAA4B;YAC/C,MAAM,EAAE;gBACN,IAAI;gBACJ,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,GAAG,CAAC;gBACzB,MAAM;gBACN,SAAS;gBACT,IAAI;aACL;SACF,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,EAAU,EAAE,IAAI,GAAG,CAAC;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAG3B;YACD,MAAM,EAAE,EAAE,IAAI,EAAE;SACjB,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,EAAS,CAAA;IACzC,CAAC;CACF;AApED,wCAoEC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { PaginateResult } from "../../models/base";
|
|
3
4
|
import { PageModel } from "../../models/page";
|
|
4
5
|
import { SelectFields } from "../../types/helper";
|
|
@@ -13,7 +14,7 @@ export declare class PageController implements IController {
|
|
|
13
14
|
constructor(client: HTTPClient);
|
|
14
15
|
base: string;
|
|
15
16
|
name: string;
|
|
16
|
-
get proxy():
|
|
17
|
+
get proxy(): IRequestHandler;
|
|
17
18
|
/**
|
|
18
19
|
* 页面列表
|
|
19
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/core/controllers/page.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/core/controllers/page.ts"],"names":[],"mappings":";;;AAaA,MAAa,cAAc;IACzB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAC/C,SAAI,GAAG,OAAO,CAAA;QACd,SAAI,GAAG,MAAM,CAAA;IAFqC,CAAC;IAGnD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IACD;;OAEG;IACH,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE,EAAE,UAA2B,EAAE;QAC3D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAA4B;YAC/C,MAAM,EAAE;gBACN,IAAI;gBACJ,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,GAAG,CAAC;gBACzB,MAAM;gBACN,SAAS;aACV;SACF,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAa,CAAA;IACxC,CAAC;IACD;;;;OAIG;IACH,SAAS,CAAC,IAAY;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAY,EAAE,CAAC,CAAA;IACjD,CAAC;CACF;AArCD,wCAqCC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { RecentlyModel } from "../../models/recently";
|
|
3
4
|
import { HTTPClient } from '..';
|
|
4
5
|
export declare class RecentlyController implements IController {
|
|
@@ -6,7 +7,7 @@ export declare class RecentlyController implements IController {
|
|
|
6
7
|
base: string;
|
|
7
8
|
name: string;
|
|
8
9
|
constructor(client: HTTPClient);
|
|
9
|
-
get proxy():
|
|
10
|
+
get proxy(): IRequestHandler;
|
|
10
11
|
/**
|
|
11
12
|
* 获取最新一条
|
|
12
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recently.js","sourceRoot":"","sources":["../../../src/core/controllers/recently.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"recently.js","sourceRoot":"","sources":["../../../src/core/controllers/recently.ts"],"names":[],"mappings":";;;AAKA,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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { SayModel } from "../../models/say";
|
|
3
4
|
import { HTTPClient } from '..';
|
|
4
5
|
import { BaseCrudController } from './base';
|
|
@@ -7,7 +8,7 @@ export declare class SayController extends BaseCrudController<SayModel> implemen
|
|
|
7
8
|
base: string;
|
|
8
9
|
name: string;
|
|
9
10
|
constructor(client: HTTPClient);
|
|
10
|
-
protected get proxy():
|
|
11
|
+
protected get proxy(): IRequestHandler;
|
|
11
12
|
/**
|
|
12
13
|
* 获取随机一条
|
|
13
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../../src/core/controllers/say.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../../src/core/controllers/say.ts"],"names":[],"mappings":";;;AAIA,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
-
import { RequestProxyResult } from "../../interfaces/request";
|
|
2
|
+
import { IRequestHandler, RequestProxyResult } from "../../interfaces/request";
|
|
3
3
|
import { PaginateResult } from "../../models/base";
|
|
4
4
|
import { NoteModel } from "../../models/note";
|
|
5
5
|
import { PostModel } from "../../models/post";
|
|
@@ -14,7 +14,7 @@ export declare class SearchController implements IController {
|
|
|
14
14
|
base: string;
|
|
15
15
|
name: string;
|
|
16
16
|
constructor(client: HTTPClient);
|
|
17
|
-
get proxy():
|
|
17
|
+
get proxy(): IRequestHandler;
|
|
18
18
|
search(type: 'note', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<NoteModel, 'modified' | 'id' | 'title' | 'created' | 'nid'>>>>;
|
|
19
19
|
search(type: 'post', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<PostModel, 'modified' | 'id' | 'title' | 'created' | 'slug' | 'category'>>>>;
|
|
20
20
|
/**
|
|
@@ -24,14 +24,14 @@ export declare class SearchController implements IController {
|
|
|
24
24
|
* @param options
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<Pick<PostModel, "
|
|
27
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<Pick<PostModel, "id" | "title" | "slug" | "modified" | "created" | "category">> & {
|
|
28
28
|
/**
|
|
29
29
|
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
30
30
|
*/
|
|
31
31
|
raw?: any;
|
|
32
32
|
}, {
|
|
33
33
|
[key: string]: any;
|
|
34
|
-
data: PaginateResult<Pick<PostModel, "
|
|
34
|
+
data: PaginateResult<Pick<PostModel, "id" | "title" | "slug" | "modified" | "created" | "category">> & {
|
|
35
35
|
/**
|
|
36
36
|
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
37
37
|
*/
|
|
@@ -39,14 +39,14 @@ export declare class SearchController implements IController {
|
|
|
39
39
|
};
|
|
40
40
|
}>, {
|
|
41
41
|
[key: string]: any;
|
|
42
|
-
data: RequestProxyResult<PaginateResult<Pick<PostModel, "
|
|
42
|
+
data: RequestProxyResult<PaginateResult<Pick<PostModel, "id" | "title" | "slug" | "modified" | "created" | "category">> & {
|
|
43
43
|
/**
|
|
44
44
|
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
45
45
|
*/
|
|
46
46
|
raw?: any;
|
|
47
47
|
}, {
|
|
48
48
|
[key: string]: any;
|
|
49
|
-
data: PaginateResult<Pick<PostModel, "
|
|
49
|
+
data: PaginateResult<Pick<PostModel, "id" | "title" | "slug" | "modified" | "created" | "category">> & {
|
|
50
50
|
/**
|
|
51
51
|
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
52
52
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { SnippetModel } from "../../models/snippet";
|
|
3
4
|
import { HTTPClient } from '..';
|
|
4
5
|
export declare class SnippetController implements IController {
|
|
@@ -6,7 +7,7 @@ export declare class SnippetController implements IController {
|
|
|
6
7
|
base: string;
|
|
7
8
|
name: string;
|
|
8
9
|
constructor(client: HTTPClient);
|
|
9
|
-
get proxy():
|
|
10
|
+
get proxy(): IRequestHandler;
|
|
10
11
|
getById(id: string): import("../../interfaces/request").RequestProxyResult<SnippetModel, {
|
|
11
12
|
[key: string]: any;
|
|
12
13
|
data: SnippetModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../../src/core/controllers/snippet.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../../src/core/controllers/snippet.ts"],"names":[],"mappings":";;;AAKA,MAAa,iBAAiB;IAI5B,YAAsB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAHxC,SAAI,GAAG,UAAU,CAAA;QACjB,SAAI,GAAG,SAAS,CAAA;IAE2B,CAAC;IAE5C,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,EAAgB,CAAA;IAC3C,CAAC;IAED,qBAAqB,CAAC,SAAiB,EAAE,IAAY;QACnD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAgB,CAAA;IACxD,CAAC;CACF;AAjBD,8CAiBC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
2
3
|
import { TLogin, UserModel } from "../../models/user";
|
|
3
4
|
import { HTTPClient } from '..';
|
|
4
5
|
export declare class UserController implements IController {
|
|
@@ -6,7 +7,7 @@ export declare class UserController implements IController {
|
|
|
6
7
|
constructor(client: HTTPClient);
|
|
7
8
|
base: string;
|
|
8
9
|
name: string;
|
|
9
|
-
protected get proxy():
|
|
10
|
+
protected get proxy(): IRequestHandler;
|
|
10
11
|
getMasterInfo(): import("../../interfaces/request").RequestProxyResult<UserModel, {
|
|
11
12
|
[key: string]: any;
|
|
12
13
|
data: UserModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/core/controllers/user.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/core/controllers/user.ts"],"names":[],"mappings":";;;AAKA,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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { CategoryModel } from './category';
|
|
1
2
|
import { NoteModel } from './note';
|
|
2
3
|
import { PageModel } from './page';
|
|
3
|
-
import {
|
|
4
|
+
import { PostModel } from './post';
|
|
4
5
|
import { SayModel } from './say';
|
|
5
6
|
import { SeoOptionModel } from './setting';
|
|
6
7
|
import { UserModel } from './user';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/models/aggregate.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/models/aggregate.ts"],"names":[],"mappings":";;;AAsBA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+CAAI,CAAA;IACJ,+CAAI,CAAA;AACN,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
|
package/lib/models/post.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Count, Image } from './base';
|
|
2
|
+
import { CategoryModel } from './category';
|
|
2
3
|
export interface PostModel {
|
|
3
4
|
commentsIndex: number;
|
|
4
5
|
allowComment: boolean;
|
|
@@ -16,12 +17,3 @@ export interface PostModel {
|
|
|
16
17
|
created: string;
|
|
17
18
|
category: CategoryModel;
|
|
18
19
|
}
|
|
19
|
-
export interface CategoryModel {
|
|
20
|
-
type: number;
|
|
21
|
-
count: number;
|
|
22
|
-
id: string;
|
|
23
|
-
name: string;
|
|
24
|
-
slug: string;
|
|
25
|
-
created: Date;
|
|
26
|
-
categoryId: string;
|
|
27
|
-
}
|