@mx-space/api-client 0.3.0 → 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 +99 -30
- 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 +290 -143
- package/build/index.esm.js +85 -27
- 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 +99 -30
- 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/client.d.ts +5 -7
- package/esm/core/client.js +9 -4
- package/esm/core/client.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/all.d.ts +4 -2
- package/esm/core/controllers/all.js +7 -1
- package/esm/core/controllers/all.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 +3 -3
- 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 +11 -3
- package/esm/core/controllers/note.js +10 -2
- package/esm/core/controllers/note.js.map +1 -1
- package/esm/core/controllers/page.d.ts +9 -2
- package/esm/core/controllers/page.js +9 -2
- package/esm/core/controllers/page.js.map +1 -1
- package/esm/core/controllers/post.d.ts +8 -1
- package/esm/core/controllers/post.js +10 -2
- package/esm/core/controllers/post.js.map +1 -1
- package/esm/core/controllers/project.d.ts +9 -0
- package/esm/core/controllers/project.js +10 -0
- package/esm/core/controllers/project.js.map +1 -0
- 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 +19 -0
- package/esm/core/controllers/snippet.js +17 -0
- package/esm/core/controllers/snippet.js.map +1 -0
- package/esm/core/controllers/user.d.ts +2 -1
- package/esm/core/controllers/user.js.map +1 -1
- package/esm/core/define.d.ts +3 -1
- package/esm/core/define.js.map +1 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/index.js.map +1 -1
- package/esm/interfaces/client.d.ts +5 -0
- package/esm/interfaces/client.js +2 -0
- package/esm/interfaces/client.js.map +1 -0
- package/esm/interfaces/request.d.ts +2 -2
- 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/esm/models/project.d.ts +16 -0
- package/esm/models/project.js +2 -0
- package/esm/models/project.js.map +1 -0
- package/esm/models/snippet.d.ts +14 -0
- package/esm/models/snippet.js +7 -0
- package/esm/models/snippet.js.map +1 -0
- package/esm/types/helper.d.ts +2 -0
- package/esm/types/helper.js +2 -0
- package/esm/types/helper.js.map +1 -0
- package/esm/utils/index.js +6 -6
- package/esm/utils/index.js.map +1 -1
- package/lib/core/client.d.ts +5 -7
- package/lib/core/client.js +9 -4
- package/lib/core/client.js.map +1 -1
- package/lib/core/controllers/aggregate.d.ts +5 -7
- package/lib/core/controllers/aggregate.js.map +1 -1
- package/lib/core/controllers/all.d.ts +4 -2
- package/lib/core/controllers/all.js +9 -1
- package/lib/core/controllers/all.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 +11 -3
- package/lib/core/controllers/note.js +10 -2
- package/lib/core/controllers/note.js.map +1 -1
- package/lib/core/controllers/page.d.ts +9 -2
- package/lib/core/controllers/page.js +9 -2
- package/lib/core/controllers/page.js.map +1 -1
- package/lib/core/controllers/post.d.ts +8 -1
- package/lib/core/controllers/post.js +10 -2
- package/lib/core/controllers/post.js.map +1 -1
- package/lib/core/controllers/project.d.ts +9 -0
- package/lib/core/controllers/project.js +14 -0
- package/lib/core/controllers/project.js.map +1 -0
- 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 +19 -0
- package/lib/core/controllers/snippet.js +21 -0
- package/lib/core/controllers/snippet.js.map +1 -0
- package/lib/core/controllers/user.d.ts +2 -1
- package/lib/core/controllers/user.js.map +1 -1
- package/lib/core/define.d.ts +3 -1
- package/lib/core/define.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +14 -5
- package/lib/index.js.map +1 -1
- package/lib/interfaces/client.d.ts +5 -0
- package/lib/interfaces/client.js +3 -0
- package/lib/interfaces/client.js.map +1 -0
- package/lib/interfaces/request.d.ts +2 -2
- 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/lib/models/project.d.ts +16 -0
- package/lib/models/project.js +3 -0
- package/lib/models/project.js.map +1 -0
- package/lib/models/snippet.d.ts +14 -0
- package/lib/models/snippet.js +10 -0
- package/lib/models/snippet.js.map +1 -0
- package/lib/types/helper.d.ts +2 -0
- package/lib/types/helper.js +3 -0
- package/lib/types/helper.js.map +1 -0
- package/lib/utils/index.js +6 -6
- package/lib/utils/index.js.map +1 -1
- package/package.json +9 -9
|
@@ -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,13 +1,21 @@
|
|
|
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
|
-
import {
|
|
5
|
+
import { SelectFields } from "../../types/helper";
|
|
6
|
+
import { HTTPClient } from '../client';
|
|
7
|
+
export declare type NoteListOptions = {
|
|
8
|
+
select?: SelectFields<keyof NoteModel>;
|
|
9
|
+
year?: number;
|
|
10
|
+
sortBy?: 'weather' | 'mood' | 'title' | 'created' | 'modified';
|
|
11
|
+
sortOrder?: 1 | -1;
|
|
12
|
+
};
|
|
5
13
|
export declare class NoteController implements IController {
|
|
6
14
|
private client;
|
|
7
15
|
base: string;
|
|
8
16
|
name: string;
|
|
9
17
|
constructor(client: HTTPClient);
|
|
10
|
-
get proxy():
|
|
18
|
+
get proxy(): IRequestHandler;
|
|
11
19
|
/**
|
|
12
20
|
* 最新日记
|
|
13
21
|
*/
|
|
@@ -27,7 +35,7 @@ export declare class NoteController implements IController {
|
|
|
27
35
|
/**
|
|
28
36
|
* 日记列表分页
|
|
29
37
|
*/
|
|
30
|
-
getList(page?: number, perPage?: number): import("../../interfaces/request").RequestProxyResult<PaginateResult<NoteModel>, {
|
|
38
|
+
getList(page?: number, perPage?: number, options?: NoteListOptions): import("../../interfaces/request").RequestProxyResult<PaginateResult<NoteModel>, {
|
|
31
39
|
[key: string]: any;
|
|
32
40
|
data: PaginateResult<NoteModel>;
|
|
33
41
|
}>;
|
|
@@ -34,9 +34,17 @@ class NoteController {
|
|
|
34
34
|
/**
|
|
35
35
|
* 日记列表分页
|
|
36
36
|
*/
|
|
37
|
-
getList(page = 1, perPage = 10) {
|
|
37
|
+
getList(page = 1, perPage = 10, options = {}) {
|
|
38
|
+
const { select, sortBy, sortOrder, year } = options;
|
|
38
39
|
return this.proxy.get({
|
|
39
|
-
params: {
|
|
40
|
+
params: {
|
|
41
|
+
page,
|
|
42
|
+
size: perPage,
|
|
43
|
+
select: select === null || select === void 0 ? void 0 : select.join(' '),
|
|
44
|
+
sortBy,
|
|
45
|
+
sortOrder,
|
|
46
|
+
year,
|
|
47
|
+
},
|
|
40
48
|
});
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
@@ -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,17 +1,24 @@
|
|
|
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";
|
|
5
|
+
import { SelectFields } from "../../types/helper";
|
|
4
6
|
import { HTTPClient } from '..';
|
|
7
|
+
export declare type PageListOptions = {
|
|
8
|
+
select?: SelectFields<keyof PageModel>;
|
|
9
|
+
sortBy?: 'order' | 'subtitle' | 'title' | 'created' | 'modified';
|
|
10
|
+
sortOrder?: 1 | -1;
|
|
11
|
+
};
|
|
5
12
|
export declare class PageController implements IController {
|
|
6
13
|
private readonly client;
|
|
7
14
|
constructor(client: HTTPClient);
|
|
8
15
|
base: string;
|
|
9
16
|
name: string;
|
|
10
|
-
get proxy():
|
|
17
|
+
get proxy(): IRequestHandler;
|
|
11
18
|
/**
|
|
12
19
|
* 页面列表
|
|
13
20
|
*/
|
|
14
|
-
getList(page?: number, perPage?: number): import("../../interfaces/request").RequestProxyResult<PaginateResult<PageModel>, {
|
|
21
|
+
getList(page?: number, perPage?: number, options?: PageListOptions): import("../../interfaces/request").RequestProxyResult<PaginateResult<PageModel>, {
|
|
15
22
|
[key: string]: any;
|
|
16
23
|
data: PaginateResult<PageModel>;
|
|
17
24
|
}>;
|
|
@@ -13,9 +13,16 @@ class PageController {
|
|
|
13
13
|
/**
|
|
14
14
|
* 页面列表
|
|
15
15
|
*/
|
|
16
|
-
getList(page = 1, perPage = 10) {
|
|
16
|
+
getList(page = 1, perPage = 10, options = {}) {
|
|
17
|
+
const { select, sortBy, sortOrder } = options;
|
|
17
18
|
return this.proxy.get({
|
|
18
|
-
params: {
|
|
19
|
+
params: {
|
|
20
|
+
page,
|
|
21
|
+
size: perPage,
|
|
22
|
+
select: select === null || select === void 0 ? void 0 : select.join(' '),
|
|
23
|
+
sortBy,
|
|
24
|
+
sortOrder,
|
|
25
|
+
},
|
|
19
26
|
});
|
|
20
27
|
}
|
|
21
28
|
/**
|
|
@@ -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"}
|
|
@@ -2,7 +2,14 @@ import { IController } from "../../interfaces/controller";
|
|
|
2
2
|
import { RequestProxyResult } from "../../interfaces/request";
|
|
3
3
|
import { PaginateResult } from "../../models/base";
|
|
4
4
|
import { PostModel } from "../../models/post";
|
|
5
|
+
import { SelectFields } from "../../types/helper";
|
|
5
6
|
import { HTTPClient } from '../client';
|
|
7
|
+
export declare type PostListOptions = {
|
|
8
|
+
select?: SelectFields<keyof PostModel>;
|
|
9
|
+
year?: number;
|
|
10
|
+
sortBy?: 'categoryId' | 'title' | 'created' | 'modified';
|
|
11
|
+
sortOrder?: 1 | -1;
|
|
12
|
+
};
|
|
6
13
|
export declare class PostController implements IController {
|
|
7
14
|
private client;
|
|
8
15
|
constructor(client: HTTPClient);
|
|
@@ -15,7 +22,7 @@ export declare class PostController implements IController {
|
|
|
15
22
|
* @param perPage
|
|
16
23
|
* @returns
|
|
17
24
|
*/
|
|
18
|
-
getList(page?: number, perPage?: number): RequestProxyResult<PaginateResult<PostModel>, {
|
|
25
|
+
getList(page?: number, perPage?: number, options?: PostListOptions): RequestProxyResult<PaginateResult<PostModel>, {
|
|
19
26
|
[key: string]: any;
|
|
20
27
|
data: PaginateResult<PostModel>;
|
|
21
28
|
}>;
|
|
@@ -16,9 +16,17 @@ class PostController {
|
|
|
16
16
|
* @param perPage
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
|
-
getList(page = 1, perPage = 10) {
|
|
19
|
+
getList(page = 1, perPage = 10, options = {}) {
|
|
20
|
+
const { select, sortBy, sortOrder, year } = options;
|
|
20
21
|
return this.proxy.get({
|
|
21
|
-
params: {
|
|
22
|
+
params: {
|
|
23
|
+
page,
|
|
24
|
+
size: perPage,
|
|
25
|
+
select: select === null || select === void 0 ? void 0 : select.join(' '),
|
|
26
|
+
sortBy,
|
|
27
|
+
sortOrder,
|
|
28
|
+
year,
|
|
29
|
+
},
|
|
22
30
|
});
|
|
23
31
|
}
|
|
24
32
|
getPost(idOrCategoryName, slug) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../../src/core/controllers/post.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../../src/core/controllers/post.ts"],"names":[],"mappings":";;;AAcA,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,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;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;AA/DD,wCA+DC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProjectModel } from "../../models/project";
|
|
2
|
+
import { HTTPClient } from '..';
|
|
3
|
+
import { BaseCrudController } from './base';
|
|
4
|
+
export declare class ProjectController extends BaseCrudController<ProjectModel> {
|
|
5
|
+
protected readonly client: HTTPClient;
|
|
6
|
+
constructor(client: HTTPClient);
|
|
7
|
+
base: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectController = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
class ProjectController extends base_1.BaseCrudController {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
super(client);
|
|
8
|
+
this.client = client;
|
|
9
|
+
this.base = 'projects';
|
|
10
|
+
this.name = 'project';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.ProjectController = ProjectController;
|
|
14
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../src/core/controllers/project.ts"],"names":[],"mappings":";;;AAEA,iCAA2C;AAE3C,MAAa,iBAAkB,SAAQ,yBAAgC;IACrE,YAA+B,MAAkB;QAC/C,KAAK,CAAC,MAAM,CAAC,CAAA;QADgB,WAAM,GAAN,MAAM,CAAY;QAIjD,SAAI,GAAG,UAAU,CAAA;QACjB,SAAI,GAAG,SAAS,CAAA;IAHhB,CAAC;CAIF;AAPD,8CAOC"}
|
|
@@ -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
|
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { IRequestHandler } from "../../interfaces/request";
|
|
3
|
+
import { SnippetModel } from "../../models/snippet";
|
|
4
|
+
import { HTTPClient } from '..';
|
|
5
|
+
export declare class SnippetController implements IController {
|
|
6
|
+
protected client: HTTPClient;
|
|
7
|
+
base: string;
|
|
8
|
+
name: string;
|
|
9
|
+
constructor(client: HTTPClient);
|
|
10
|
+
get proxy(): IRequestHandler;
|
|
11
|
+
getById(id: string): import("../../interfaces/request").RequestProxyResult<SnippetModel, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
data: SnippetModel;
|
|
14
|
+
}>;
|
|
15
|
+
getByReferenceAndName(reference: string, name: string): import("../../interfaces/request").RequestProxyResult<SnippetModel, {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
data: SnippetModel;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SnippetController = void 0;
|
|
4
|
+
class SnippetController {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.base = 'snippets';
|
|
8
|
+
this.name = 'snippet';
|
|
9
|
+
}
|
|
10
|
+
get proxy() {
|
|
11
|
+
return this.client.proxy(this.base);
|
|
12
|
+
}
|
|
13
|
+
getById(id) {
|
|
14
|
+
return this.proxy(id).get();
|
|
15
|
+
}
|
|
16
|
+
getByReferenceAndName(reference, name) {
|
|
17
|
+
return this.proxy(reference)(name).get();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SnippetController = SnippetController;
|
|
21
|
+
//# sourceMappingURL=snippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/lib/core/define.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AggregateController, CategoryController, CommentController, LinkController, NoteController, PageController, PostController, RecentlyController, SayController, SearchController, UserController } from './controllers';
|
|
1
|
+
import { AggregateController, CategoryController, CommentController, LinkController, NoteController, PageController, PostController, ProjectController, RecentlyController, SayController, SearchController, SnippetController, UserController } from './controllers';
|
|
2
2
|
export declare class HTTPControllerDefine {
|
|
3
3
|
aggregate: AggregateController;
|
|
4
4
|
category: CategoryController;
|
|
@@ -7,9 +7,11 @@ export declare class HTTPControllerDefine {
|
|
|
7
7
|
note: NoteController;
|
|
8
8
|
page: PageController;
|
|
9
9
|
post: PostController;
|
|
10
|
+
project: ProjectController;
|
|
10
11
|
recently: RecentlyController;
|
|
11
12
|
say: SayController;
|
|
12
13
|
search: SearchController;
|
|
14
|
+
snippet: SnippetController;
|
|
13
15
|
user: UserController;
|
|
14
16
|
get master(): UserController;
|
|
15
17
|
get friend(): LinkController;
|
package/lib/core/define.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/core/define.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/core/define.ts"],"names":[],"mappings":";;;AAgBA,MAAa,oBAAoB;IAe/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;AA1BD,oDA0BC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { allContollerNames
|
|
1
|
+
export { allContollerNames, allControllers, createClient, HTTPClient, RequestError, } from './core';
|
|
2
|
+
export * from './core/controllers';
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
2
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequestError = exports.
|
|
13
|
+
exports.RequestError = exports.HTTPClient = exports.createClient = exports.allControllers = exports.allContollerNames = void 0;
|
|
4
14
|
var core_1 = require("./core");
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "
|
|
15
|
+
Object.defineProperty(exports, "allContollerNames", { enumerable: true, get: function () { return core_1.allContollerNames; } });
|
|
16
|
+
Object.defineProperty(exports, "allControllers", { enumerable: true, get: function () { return core_1.allControllers; } });
|
|
7
17
|
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return core_1.createClient; } });
|
|
8
18
|
Object.defineProperty(exports, "HTTPClient", { enumerable: true, get: function () { return core_1.HTTPClient; } });
|
|
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
19
|
Object.defineProperty(exports, "RequestError", { enumerable: true, get: function () { return core_1.RequestError; } });
|
|
20
|
+
__exportStar(require("./core/controllers"), exports);
|
|
12
21
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+BAMe;AALb,yGAAA,iBAAiB,OAAA;AACjB,sGAAA,cAAc,OAAA;AACd,oGAAA,YAAY,OAAA;AACZ,kGAAA,UAAU,OAAA;AACV,oGAAA,YAAY,OAAA;AAEd,qDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/interfaces/client.ts"],"names":[],"mappings":""}
|
|
@@ -17,8 +17,8 @@ export declare type RequestProxyResult<T, R = {
|
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
}> = Promise<ResponseProxyExtraRaw<T, R>>;
|
|
19
19
|
export declare type ResponseProxyExtraRaw<T, R = any> = T & {
|
|
20
|
-
raw: R;
|
|
21
|
-
request: {
|
|
20
|
+
$raw: R;
|
|
21
|
+
$request: {
|
|
22
22
|
path: string;
|
|
23
23
|
method: string;
|
|
24
24
|
[k: string]: string;
|
|
@@ -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
|
-
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Pager } from './base';
|
|
2
|
+
export interface ProjectModel {
|
|
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
previewUrl?: string;
|
|
6
|
+
docUrl?: string;
|
|
7
|
+
projectUrl?: string;
|
|
8
|
+
images?: string[];
|
|
9
|
+
description: string;
|
|
10
|
+
avatar?: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
export declare type ProjectResponse = {
|
|
14
|
+
data: ProjectModel[];
|
|
15
|
+
pagination: Pager;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/models/project.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseModel } from './base';
|
|
2
|
+
export declare enum SnippetType {
|
|
3
|
+
JSON = "json",
|
|
4
|
+
Text = "text"
|
|
5
|
+
}
|
|
6
|
+
export interface SnippetModel extends BaseModel {
|
|
7
|
+
type: SnippetType;
|
|
8
|
+
private: boolean;
|
|
9
|
+
raw: string;
|
|
10
|
+
name: string;
|
|
11
|
+
reference: string;
|
|
12
|
+
comment?: string;
|
|
13
|
+
metatype?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SnippetType = void 0;
|
|
4
|
+
var SnippetType;
|
|
5
|
+
(function (SnippetType) {
|
|
6
|
+
SnippetType["JSON"] = "json";
|
|
7
|
+
// Function = 'function',
|
|
8
|
+
SnippetType["Text"] = "text";
|
|
9
|
+
})(SnippetType = exports.SnippetType || (exports.SnippetType = {}));
|
|
10
|
+
//# sourceMappingURL=snippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../src/models/snippet.ts"],"names":[],"mappings":";;;AACA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,yBAAyB;IACzB,4BAAa,CAAA;AACf,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB"}
|