@mx-space/api-client 0.1.0 → 0.3.2
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 +191 -34
- 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 +193 -37
- package/build/index.esm.js +177 -31
- 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 +191 -34
- 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 +7 -20
- package/esm/core/client.js +12 -8
- package/esm/core/client.js.map +1 -1
- package/esm/core/controllers/aggregate.d.ts +3 -0
- package/esm/core/controllers/aggregate.js +3 -0
- package/esm/core/controllers/aggregate.js.map +1 -1
- package/esm/core/controllers/all.d.ts +8 -2
- package/esm/core/controllers/all.js +19 -6
- package/esm/core/controllers/all.js.map +1 -1
- package/esm/core/controllers/category.js +1 -2
- package/esm/core/controllers/category.js.map +1 -1
- 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/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 +33 -0
- package/esm/core/controllers/recently.js +32 -0
- package/esm/core/controllers/recently.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/snippet.d.ts +18 -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 +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 +19 -0
- package/esm/core/define.js +12 -0
- package/esm/core/define.js.map +1 -0
- 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/link.d.ts +17 -0
- package/esm/models/link.js +11 -0
- package/esm/models/link.js.map +1 -0
- 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/recently.d.ts +5 -0
- package/esm/models/recently.js +2 -0
- package/esm/models/recently.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/models/user.d.ts +6 -0
- package/esm/types/helper.d.ts +1 -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 +7 -20
- package/lib/core/client.js +11 -7
- package/lib/core/client.js.map +1 -1
- package/lib/core/controllers/aggregate.d.ts +3 -0
- package/lib/core/controllers/aggregate.js +3 -0
- package/lib/core/controllers/aggregate.js.map +1 -1
- package/lib/core/controllers/all.d.ts +8 -2
- package/lib/core/controllers/all.js +25 -6
- package/lib/core/controllers/all.js.map +1 -1
- package/lib/core/controllers/category.js +1 -2
- package/lib/core/controllers/category.js.map +1 -1
- 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/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 +33 -0
- package/lib/core/controllers/recently.js +36 -0
- package/lib/core/controllers/recently.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/snippet.d.ts +18 -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 +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 +19 -0
- package/lib/core/define.js +16 -0
- package/lib/core/define.js.map +1 -0
- 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/link.d.ts +17 -0
- package/lib/models/link.js +14 -0
- package/lib/models/link.js.map +1 -0
- 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/recently.d.ts +5 -0
- package/lib/models/recently.js +3 -0
- package/lib/models/recently.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/models/user.d.ts +6 -0
- package/lib/types/helper.d.ts +1 -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 +10 -10
|
@@ -1,41 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SayController = exports.PostController = exports.PageController = exports.NoteController = exports.CommentController = exports.CategoryController = exports.AggregateController = exports.allContollerNames = exports.allControllers = void 0;
|
|
3
|
+
exports.UserController = exports.SnippetController = exports.SearchController = exports.SayController = exports.RecentlyController = exports.ProjectController = exports.PostController = exports.PageController = exports.NoteController = exports.LinkController = exports.CommentController = exports.CategoryController = exports.AggregateController = exports.allContollerNames = exports.allControllers = void 0;
|
|
4
4
|
const aggregate_1 = require("./aggregate");
|
|
5
5
|
Object.defineProperty(exports, "AggregateController", { enumerable: true, get: function () { return aggregate_1.AggregateController; } });
|
|
6
6
|
const category_1 = require("./category");
|
|
7
7
|
Object.defineProperty(exports, "CategoryController", { enumerable: true, get: function () { return category_1.CategoryController; } });
|
|
8
8
|
const comment_1 = require("./comment");
|
|
9
9
|
Object.defineProperty(exports, "CommentController", { enumerable: true, get: function () { return comment_1.CommentController; } });
|
|
10
|
+
const link_1 = require("./link");
|
|
11
|
+
Object.defineProperty(exports, "LinkController", { enumerable: true, get: function () { return link_1.LinkController; } });
|
|
10
12
|
const note_1 = require("./note");
|
|
11
13
|
Object.defineProperty(exports, "NoteController", { enumerable: true, get: function () { return note_1.NoteController; } });
|
|
12
14
|
const page_1 = require("./page");
|
|
13
15
|
Object.defineProperty(exports, "PageController", { enumerable: true, get: function () { return page_1.PageController; } });
|
|
14
16
|
const post_1 = require("./post");
|
|
15
17
|
Object.defineProperty(exports, "PostController", { enumerable: true, get: function () { return post_1.PostController; } });
|
|
18
|
+
const project_1 = require("./project");
|
|
19
|
+
Object.defineProperty(exports, "ProjectController", { enumerable: true, get: function () { return project_1.ProjectController; } });
|
|
20
|
+
const recently_1 = require("./recently");
|
|
21
|
+
Object.defineProperty(exports, "RecentlyController", { enumerable: true, get: function () { return recently_1.RecentlyController; } });
|
|
16
22
|
const say_1 = require("./say");
|
|
17
23
|
Object.defineProperty(exports, "SayController", { enumerable: true, get: function () { return say_1.SayController; } });
|
|
24
|
+
const search_1 = require("./search");
|
|
25
|
+
Object.defineProperty(exports, "SearchController", { enumerable: true, get: function () { return search_1.SearchController; } });
|
|
26
|
+
const snippet_1 = require("./snippet");
|
|
27
|
+
Object.defineProperty(exports, "SnippetController", { enumerable: true, get: function () { return snippet_1.SnippetController; } });
|
|
28
|
+
const user_1 = require("./user");
|
|
29
|
+
Object.defineProperty(exports, "UserController", { enumerable: true, get: function () { return user_1.UserController; } });
|
|
18
30
|
exports.allControllers = [
|
|
19
31
|
aggregate_1.AggregateController,
|
|
20
32
|
category_1.CategoryController,
|
|
21
33
|
comment_1.CommentController,
|
|
34
|
+
link_1.LinkController,
|
|
22
35
|
note_1.NoteController,
|
|
23
36
|
page_1.PageController,
|
|
24
37
|
post_1.PostController,
|
|
38
|
+
project_1.ProjectController,
|
|
39
|
+
recently_1.RecentlyController,
|
|
25
40
|
say_1.SayController,
|
|
41
|
+
search_1.SearchController,
|
|
42
|
+
snippet_1.SnippetController,
|
|
43
|
+
user_1.UserController,
|
|
26
44
|
];
|
|
27
|
-
// export const allClientName = allClients.map((c) =>
|
|
28
|
-
// c.name.replace('Client', '').toLowerCase(),
|
|
29
|
-
// )
|
|
30
|
-
// Why not code like before
|
|
31
|
-
// In order to tree shake unnecessary client
|
|
32
45
|
exports.allContollerNames = [
|
|
33
46
|
'aggregate',
|
|
34
47
|
'category',
|
|
35
48
|
'comment',
|
|
49
|
+
'link',
|
|
36
50
|
'note',
|
|
37
51
|
'page',
|
|
38
52
|
'post',
|
|
53
|
+
'project',
|
|
54
|
+
'recently',
|
|
39
55
|
'say',
|
|
56
|
+
'search',
|
|
57
|
+
'snippet',
|
|
58
|
+
'user',
|
|
40
59
|
];
|
|
41
60
|
//# sourceMappingURL=all.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../../src/core/controllers/all.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;
|
|
1
|
+
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../../src/core/controllers/all.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AA+C/C,oGA/CO,+BAAmB,OA+CP;AA9CrB,yCAA+C;AA+C7C,mGA/CO,6BAAkB,OA+CP;AA9CpB,uCAA6C;AA+C3C,kGA/CO,2BAAiB,OA+CP;AA9CnB,iCAAuC;AA+CrC,+FA/CO,qBAAc,OA+CP;AA9ChB,iCAAuC;AA+CrC,+FA/CO,qBAAc,OA+CP;AA9ChB,iCAAuC;AA+CrC,+FA/CO,qBAAc,OA+CP;AA9ChB,iCAAuC;AA+CrC,+FA/CO,qBAAc,OA+CP;AA9ChB,uCAA6C;AA+C3C,kGA/CO,2BAAiB,OA+CP;AA9CnB,yCAA+C;AA+C7C,mGA/CO,6BAAkB,OA+CP;AA9CpB,+BAAqC;AA+CnC,8FA/CO,mBAAa,OA+CP;AA9Cf,qCAA2C;AA+CzC,iGA/CO,yBAAgB,OA+CP;AA9ClB,uCAA6C;AA+C3C,kGA/CO,2BAAiB,OA+CP;AA9CnB,iCAAuC;AA+CrC,+FA/CO,qBAAc,OA+CP;AA7CH,QAAA,cAAc,GAAG;IAC5B,+BAAmB;IACnB,6BAAkB;IAClB,2BAAiB;IACjB,qBAAc;IACd,qBAAc;IACd,qBAAc;IACd,qBAAc;IACd,2BAAiB;IACjB,6BAAkB;IAClB,mBAAa;IACb,yBAAgB;IAChB,2BAAiB;IACjB,qBAAc;CACf,CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,WAAW;IACX,UAAU;IACV,SAAS;IACT,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,UAAU;IACV,KAAK;IACL,QAAQ;IACR,SAAS;IACT,MAAM;CACP,CAAA"}
|
|
@@ -39,7 +39,6 @@ class CategoryController {
|
|
|
39
39
|
return result;
|
|
40
40
|
}
|
|
41
41
|
else if (Array.isArray(ids)) {
|
|
42
|
-
// TODO: backend: re-design data structure
|
|
43
42
|
const data = await this.proxy.get({
|
|
44
43
|
params: {
|
|
45
44
|
ids: ids.join(','),
|
|
@@ -47,7 +46,7 @@ class CategoryController {
|
|
|
47
46
|
});
|
|
48
47
|
const entries = data === null || data === void 0 ? void 0 : data.entries;
|
|
49
48
|
if (!entries) {
|
|
50
|
-
throw new __1.RequestError('data structure error', 500, data
|
|
49
|
+
throw new __1.RequestError('data structure error', 500, data.$request.path, data);
|
|
51
50
|
}
|
|
52
51
|
const map = new Map(Object.entries(entries).map(([id, value]) => [id.toLowerCase(), value]));
|
|
53
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,oDAK0B;AAE1B,uCAAmE;AACnE,0BAA6C;AAE7C,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,CAA4B;YAC/C,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,
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../../src/core/controllers/category.ts"],"names":[],"mappings":";;;AAEA,oDAK0B;AAE1B,uCAAmE;AACnE,0BAA6C;AAE7C,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,CAA4B;YAC/C,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,gBAAY,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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LinkModel } from "../../models/link";
|
|
2
|
+
import { HTTPClient } from '..';
|
|
3
|
+
import { BaseCrudController } from './base';
|
|
4
|
+
export declare class LinkController extends BaseCrudController<LinkModel> {
|
|
5
|
+
protected readonly client: HTTPClient;
|
|
6
|
+
constructor(client: HTTPClient);
|
|
7
|
+
name: string;
|
|
8
|
+
base: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkController = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
class LinkController extends base_1.BaseCrudController {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
super(client);
|
|
8
|
+
this.client = client;
|
|
9
|
+
this.name = 'link';
|
|
10
|
+
this.base = 'links';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.LinkController = LinkController;
|
|
14
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/core/controllers/link.ts"],"names":[],"mappings":";;;AAEA,iCAA2C;AAE3C,MAAa,cAAe,SAAQ,yBAA6B;IAC/D,YAA+B,MAAkB;QAC/C,KAAK,CAAC,MAAM,CAAC,CAAA;QADgB,WAAM,GAAN,MAAM,CAAY;QAIjD,SAAI,GAAG,MAAM,CAAA;QACb,SAAI,GAAG,OAAO,CAAA;IAHd,CAAC;CAIF;AAPD,wCAOC"}
|
|
@@ -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"}
|
|
@@ -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,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,18 @@
|
|
|
1
|
+
import { IController } from "../../interfaces/controller";
|
|
2
|
+
import { SnippetModel } from "../../models/snippet";
|
|
3
|
+
import { HTTPClient } from '..';
|
|
4
|
+
export declare class SnippetController implements IController {
|
|
5
|
+
protected client: HTTPClient;
|
|
6
|
+
base: string;
|
|
7
|
+
name: string;
|
|
8
|
+
constructor(client: HTTPClient);
|
|
9
|
+
get proxy(): import("../../interfaces/request").IRequestHandler;
|
|
10
|
+
getById(id: string): import("../../interfaces/request").RequestProxyResult<SnippetModel, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
data: SnippetModel;
|
|
13
|
+
}>;
|
|
14
|
+
getByReferenceAndName(reference: string, name: string): import("../../interfaces/request").RequestProxyResult<SnippetModel, {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
data: SnippetModel;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
@@ -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":";;;AAIA,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"}
|
|
@@ -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,19 @@
|
|
|
1
|
+
import { AggregateController, CategoryController, CommentController, LinkController, NoteController, PageController, PostController, ProjectController, RecentlyController, SayController, SearchController, SnippetController, 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
|
+
project: ProjectController;
|
|
11
|
+
recently: RecentlyController;
|
|
12
|
+
say: SayController;
|
|
13
|
+
search: SearchController;
|
|
14
|
+
snippet: SnippetController;
|
|
15
|
+
user: UserController;
|
|
16
|
+
get master(): UserController;
|
|
17
|
+
get friend(): LinkController;
|
|
18
|
+
get shorthand(): RecentlyController;
|
|
19
|
+
}
|
|
@@ -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":";;;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;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum LinkType {
|
|
2
|
+
Friend = 0,
|
|
3
|
+
Collection = 1
|
|
4
|
+
}
|
|
5
|
+
export declare enum LinkState {
|
|
6
|
+
Pass = 0,
|
|
7
|
+
Audit = 1
|
|
8
|
+
}
|
|
9
|
+
export interface LinkModel {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
url: string;
|
|
13
|
+
avatar: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
type: LinkType;
|
|
16
|
+
state: LinkState;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkState = exports.LinkType = void 0;
|
|
4
|
+
var LinkType;
|
|
5
|
+
(function (LinkType) {
|
|
6
|
+
LinkType[LinkType["Friend"] = 0] = "Friend";
|
|
7
|
+
LinkType[LinkType["Collection"] = 1] = "Collection";
|
|
8
|
+
})(LinkType = exports.LinkType || (exports.LinkType = {}));
|
|
9
|
+
var LinkState;
|
|
10
|
+
(function (LinkState) {
|
|
11
|
+
LinkState[LinkState["Pass"] = 0] = "Pass";
|
|
12
|
+
LinkState[LinkState["Audit"] = 1] = "Audit";
|
|
13
|
+
})(LinkState = exports.LinkState || (exports.LinkState = {}));
|
|
14
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/models/link.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,2CAAM,CAAA;IACN,mDAAU,CAAA;AACZ,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,yCAAI,CAAA;IACJ,2CAAK,CAAA;AACP,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
|
|
@@ -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":""}
|