@mx-space/api-client 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +54 -54
- package/dist/index.d.cts +35 -28
- package/dist/index.d.mts +35 -28
- package/dist/index.mjs +54 -54
- package/models/aggregate.ts +16 -7
- package/package.json +15 -13
- package/vitest.config.ts +0 -3
package/dist/index.cjs
CHANGED
|
@@ -261,10 +261,10 @@ var RequestError = class extends Error {
|
|
|
261
261
|
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region models/category.ts
|
|
264
|
-
let CategoryType = /* @__PURE__ */ function(CategoryType
|
|
265
|
-
CategoryType
|
|
266
|
-
CategoryType
|
|
267
|
-
return CategoryType
|
|
264
|
+
let CategoryType = /* @__PURE__ */ function(CategoryType) {
|
|
265
|
+
CategoryType[CategoryType["Category"] = 0] = "Category";
|
|
266
|
+
CategoryType[CategoryType["Tag"] = 1] = "Tag";
|
|
267
|
+
return CategoryType;
|
|
268
268
|
}({});
|
|
269
269
|
|
|
270
270
|
//#endregion
|
|
@@ -558,15 +558,15 @@ var ProjectController = class extends BaseCrudController {
|
|
|
558
558
|
|
|
559
559
|
//#endregion
|
|
560
560
|
//#region controllers/recently.ts
|
|
561
|
-
let RecentlyAttitudeResultEnum = /* @__PURE__ */ function(RecentlyAttitudeResultEnum
|
|
562
|
-
RecentlyAttitudeResultEnum
|
|
563
|
-
RecentlyAttitudeResultEnum
|
|
564
|
-
return RecentlyAttitudeResultEnum
|
|
561
|
+
let RecentlyAttitudeResultEnum = /* @__PURE__ */ function(RecentlyAttitudeResultEnum) {
|
|
562
|
+
RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum["Inc"] = 1] = "Inc";
|
|
563
|
+
RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum["Dec"] = -1] = "Dec";
|
|
564
|
+
return RecentlyAttitudeResultEnum;
|
|
565
565
|
}({});
|
|
566
|
-
let RecentlyAttitudeEnum = /* @__PURE__ */ function(RecentlyAttitudeEnum
|
|
567
|
-
RecentlyAttitudeEnum
|
|
568
|
-
RecentlyAttitudeEnum
|
|
569
|
-
return RecentlyAttitudeEnum
|
|
566
|
+
let RecentlyAttitudeEnum = /* @__PURE__ */ function(RecentlyAttitudeEnum) {
|
|
567
|
+
RecentlyAttitudeEnum[RecentlyAttitudeEnum["Up"] = 0] = "Up";
|
|
568
|
+
RecentlyAttitudeEnum[RecentlyAttitudeEnum["Down"] = 1] = "Down";
|
|
569
|
+
return RecentlyAttitudeEnum;
|
|
570
570
|
}({});
|
|
571
571
|
var RecentlyController = class {
|
|
572
572
|
constructor(client) {
|
|
@@ -1007,10 +1007,10 @@ function createClient(adapter) {
|
|
|
1007
1007
|
|
|
1008
1008
|
//#endregion
|
|
1009
1009
|
//#region models/aggregate.ts
|
|
1010
|
-
let TimelineType = /* @__PURE__ */ function(TimelineType
|
|
1011
|
-
TimelineType
|
|
1012
|
-
TimelineType
|
|
1013
|
-
return TimelineType
|
|
1010
|
+
let TimelineType = /* @__PURE__ */ function(TimelineType) {
|
|
1011
|
+
TimelineType[TimelineType["Post"] = 0] = "Post";
|
|
1012
|
+
TimelineType[TimelineType["Note"] = 1] = "Note";
|
|
1013
|
+
return TimelineType;
|
|
1014
1014
|
}({});
|
|
1015
1015
|
|
|
1016
1016
|
//#endregion
|
|
@@ -1019,65 +1019,65 @@ const POST_COLLECTION_NAME = "posts";
|
|
|
1019
1019
|
const NOTE_COLLECTION_NAME = "notes";
|
|
1020
1020
|
const PAGE_COLLECTION_NAME = "pages";
|
|
1021
1021
|
const RECENTLY_COLLECTION_NAME = "recentlies";
|
|
1022
|
-
let CollectionRefTypes = /* @__PURE__ */ function(CollectionRefTypes
|
|
1023
|
-
CollectionRefTypes
|
|
1024
|
-
CollectionRefTypes
|
|
1025
|
-
CollectionRefTypes
|
|
1026
|
-
CollectionRefTypes
|
|
1027
|
-
return CollectionRefTypes
|
|
1022
|
+
let CollectionRefTypes = /* @__PURE__ */ function(CollectionRefTypes) {
|
|
1023
|
+
CollectionRefTypes[CollectionRefTypes["Post"] = POST_COLLECTION_NAME] = "Post";
|
|
1024
|
+
CollectionRefTypes[CollectionRefTypes["Note"] = NOTE_COLLECTION_NAME] = "Note";
|
|
1025
|
+
CollectionRefTypes[CollectionRefTypes["Page"] = PAGE_COLLECTION_NAME] = "Page";
|
|
1026
|
+
CollectionRefTypes[CollectionRefTypes["Recently"] = RECENTLY_COLLECTION_NAME] = "Recently";
|
|
1027
|
+
return CollectionRefTypes;
|
|
1028
1028
|
}({});
|
|
1029
1029
|
|
|
1030
1030
|
//#endregion
|
|
1031
1031
|
//#region models/comment.ts
|
|
1032
|
-
let CommentState = /* @__PURE__ */ function(CommentState
|
|
1033
|
-
CommentState
|
|
1034
|
-
CommentState
|
|
1035
|
-
CommentState
|
|
1036
|
-
return CommentState
|
|
1032
|
+
let CommentState = /* @__PURE__ */ function(CommentState) {
|
|
1033
|
+
CommentState[CommentState["Unread"] = 0] = "Unread";
|
|
1034
|
+
CommentState[CommentState["Read"] = 1] = "Read";
|
|
1035
|
+
CommentState[CommentState["Junk"] = 2] = "Junk";
|
|
1036
|
+
return CommentState;
|
|
1037
1037
|
}({});
|
|
1038
1038
|
|
|
1039
1039
|
//#endregion
|
|
1040
1040
|
//#region models/link.ts
|
|
1041
|
-
let LinkType = /* @__PURE__ */ function(LinkType
|
|
1042
|
-
LinkType
|
|
1043
|
-
LinkType
|
|
1044
|
-
return LinkType
|
|
1041
|
+
let LinkType = /* @__PURE__ */ function(LinkType) {
|
|
1042
|
+
LinkType[LinkType["Friend"] = 0] = "Friend";
|
|
1043
|
+
LinkType[LinkType["Collection"] = 1] = "Collection";
|
|
1044
|
+
return LinkType;
|
|
1045
1045
|
}({});
|
|
1046
|
-
let LinkState = /* @__PURE__ */ function(LinkState
|
|
1047
|
-
LinkState
|
|
1048
|
-
LinkState
|
|
1049
|
-
LinkState
|
|
1050
|
-
LinkState
|
|
1051
|
-
LinkState
|
|
1052
|
-
return LinkState
|
|
1046
|
+
let LinkState = /* @__PURE__ */ function(LinkState) {
|
|
1047
|
+
LinkState[LinkState["Pass"] = 0] = "Pass";
|
|
1048
|
+
LinkState[LinkState["Audit"] = 1] = "Audit";
|
|
1049
|
+
LinkState[LinkState["Outdate"] = 2] = "Outdate";
|
|
1050
|
+
LinkState[LinkState["Banned"] = 3] = "Banned";
|
|
1051
|
+
LinkState[LinkState["Reject"] = 4] = "Reject";
|
|
1052
|
+
return LinkState;
|
|
1053
1053
|
}({});
|
|
1054
1054
|
|
|
1055
1055
|
//#endregion
|
|
1056
1056
|
//#region models/page.ts
|
|
1057
|
-
let EnumPageType = /* @__PURE__ */ function(EnumPageType
|
|
1058
|
-
EnumPageType
|
|
1059
|
-
EnumPageType
|
|
1060
|
-
EnumPageType
|
|
1061
|
-
return EnumPageType
|
|
1057
|
+
let EnumPageType = /* @__PURE__ */ function(EnumPageType) {
|
|
1058
|
+
EnumPageType["md"] = "md";
|
|
1059
|
+
EnumPageType["html"] = "html";
|
|
1060
|
+
EnumPageType["frame"] = "frame";
|
|
1061
|
+
return EnumPageType;
|
|
1062
1062
|
}({});
|
|
1063
1063
|
|
|
1064
1064
|
//#endregion
|
|
1065
1065
|
//#region models/recently.ts
|
|
1066
|
-
let RecentlyRefTypes = /* @__PURE__ */ function(RecentlyRefTypes
|
|
1067
|
-
RecentlyRefTypes
|
|
1068
|
-
RecentlyRefTypes
|
|
1069
|
-
RecentlyRefTypes
|
|
1070
|
-
return RecentlyRefTypes
|
|
1066
|
+
let RecentlyRefTypes = /* @__PURE__ */ function(RecentlyRefTypes) {
|
|
1067
|
+
RecentlyRefTypes["Post"] = "Post";
|
|
1068
|
+
RecentlyRefTypes["Note"] = "Note";
|
|
1069
|
+
RecentlyRefTypes["Page"] = "Page";
|
|
1070
|
+
return RecentlyRefTypes;
|
|
1071
1071
|
}({});
|
|
1072
1072
|
|
|
1073
1073
|
//#endregion
|
|
1074
1074
|
//#region models/snippet.ts
|
|
1075
|
-
let SnippetType = /* @__PURE__ */ function(SnippetType
|
|
1076
|
-
SnippetType
|
|
1077
|
-
SnippetType
|
|
1078
|
-
SnippetType
|
|
1079
|
-
SnippetType
|
|
1080
|
-
return SnippetType
|
|
1075
|
+
let SnippetType = /* @__PURE__ */ function(SnippetType) {
|
|
1076
|
+
SnippetType["JSON"] = "json";
|
|
1077
|
+
SnippetType["Function"] = "function";
|
|
1078
|
+
SnippetType["Text"] = "text";
|
|
1079
|
+
SnippetType["YAML"] = "yaml";
|
|
1080
|
+
return SnippetType;
|
|
1081
1081
|
}({});
|
|
1082
1082
|
|
|
1083
1083
|
//#endregion
|
package/dist/index.d.cts
CHANGED
|
@@ -40,14 +40,14 @@ interface IRequestHandler<ResponseWrapper> {
|
|
|
40
40
|
valueOf: (withBase?: boolean) => string;
|
|
41
41
|
[key: string]: IRequestHandler<ResponseWrapper>;
|
|
42
42
|
}
|
|
43
|
-
type RequestProxyResult<T, ResponseWrapper, R
|
|
43
|
+
type RequestProxyResult<T, ResponseWrapper, R = (ResponseWrapper extends unknown ? {
|
|
44
44
|
data: T;
|
|
45
45
|
[key: string]: any;
|
|
46
46
|
} : ResponseWrapper extends {
|
|
47
47
|
data: T;
|
|
48
48
|
} ? ResponseWrapper : Omit<ResponseWrapper, 'data'> & {
|
|
49
49
|
data: T;
|
|
50
|
-
})> = Promise<ResponseProxyExtraRaw<T, R
|
|
50
|
+
})> = Promise<ResponseProxyExtraRaw<T, R, ResponseWrapper>>;
|
|
51
51
|
type CamelToSnake<T extends string, P extends string = ''> = string extends T ? string : T extends `${infer C0}${infer R}` ? CamelToSnake<R, `${P}${C0 extends Lowercase<C0> ? '' : '_'}${Lowercase<C0>}`> : P;
|
|
52
52
|
type CamelKeysToSnake<T> = { [K in keyof T as CamelToSnake<Extract<K, string>>]: T[K] };
|
|
53
53
|
type ResponseWrapperType<Response, RawData, T> = {
|
|
@@ -129,7 +129,7 @@ declare enum CollectionRefTypes {
|
|
|
129
129
|
Post = "posts",
|
|
130
130
|
Note = "notes",
|
|
131
131
|
Page = "pages",
|
|
132
|
-
Recently = "recentlies"
|
|
132
|
+
Recently = "recentlies"
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
135
|
//#region models/base.d.ts
|
|
@@ -195,7 +195,7 @@ interface PostModel extends TextBaseModel {
|
|
|
195
195
|
//#region models/category.d.ts
|
|
196
196
|
declare enum CategoryType {
|
|
197
197
|
Category = 0,
|
|
198
|
-
Tag = 1
|
|
198
|
+
Tag = 1
|
|
199
199
|
}
|
|
200
200
|
interface CategoryModel extends BaseModel {
|
|
201
201
|
type: CategoryType;
|
|
@@ -379,7 +379,7 @@ interface NoteWrappedWithLikedPayload {
|
|
|
379
379
|
declare enum EnumPageType {
|
|
380
380
|
'md' = "md",
|
|
381
381
|
'html' = "html",
|
|
382
|
-
'frame' = "frame"
|
|
382
|
+
'frame' = "frame"
|
|
383
383
|
}
|
|
384
384
|
interface PageModel extends TextBaseModel {
|
|
385
385
|
created: string;
|
|
@@ -491,6 +491,9 @@ type TLogin = {
|
|
|
491
491
|
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
492
492
|
//#endregion
|
|
493
493
|
//#region models/aggregate.d.ts
|
|
494
|
+
interface AggregateAIConfig {
|
|
495
|
+
enableSummary: boolean;
|
|
496
|
+
}
|
|
494
497
|
interface AggregateRoot {
|
|
495
498
|
user: UserModel;
|
|
496
499
|
seo: SeoOptionModel;
|
|
@@ -504,6 +507,10 @@ interface AggregateRoot {
|
|
|
504
507
|
id: string;
|
|
505
508
|
nid: number;
|
|
506
509
|
};
|
|
510
|
+
/**
|
|
511
|
+
* @available 9.2.0
|
|
512
|
+
*/
|
|
513
|
+
ai?: AggregateAIConfig;
|
|
507
514
|
}
|
|
508
515
|
interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
509
516
|
theme?: Theme;
|
|
@@ -522,7 +529,7 @@ interface AggregateTop {
|
|
|
522
529
|
}
|
|
523
530
|
declare enum TimelineType {
|
|
524
531
|
Post = 0,
|
|
525
|
-
Note = 1
|
|
532
|
+
Note = 1
|
|
526
533
|
}
|
|
527
534
|
interface TimelineData {
|
|
528
535
|
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'bookmark'>[];
|
|
@@ -612,20 +619,20 @@ interface CommentRef {
|
|
|
612
619
|
declare enum CommentState {
|
|
613
620
|
Unread = 0,
|
|
614
621
|
Read = 1,
|
|
615
|
-
Junk = 2
|
|
622
|
+
Junk = 2
|
|
616
623
|
}
|
|
617
624
|
//#endregion
|
|
618
625
|
//#region models/link.d.ts
|
|
619
626
|
declare enum LinkType {
|
|
620
627
|
Friend = 0,
|
|
621
|
-
Collection = 1
|
|
628
|
+
Collection = 1
|
|
622
629
|
}
|
|
623
630
|
declare enum LinkState {
|
|
624
631
|
Pass = 0,
|
|
625
632
|
Audit = 1,
|
|
626
633
|
Outdate = 2,
|
|
627
634
|
Banned = 3,
|
|
628
|
-
Reject = 4
|
|
635
|
+
Reject = 4
|
|
629
636
|
}
|
|
630
637
|
interface LinkModel extends BaseModel {
|
|
631
638
|
name: string;
|
|
@@ -663,7 +670,7 @@ interface ReaderModel {
|
|
|
663
670
|
declare enum RecentlyRefTypes {
|
|
664
671
|
Post = "Post",
|
|
665
672
|
Note = "Note",
|
|
666
|
-
Page = "Page"
|
|
673
|
+
Page = "Page"
|
|
667
674
|
}
|
|
668
675
|
type RecentlyRefType = {
|
|
669
676
|
title: string;
|
|
@@ -686,7 +693,7 @@ declare enum SnippetType {
|
|
|
686
693
|
JSON = "json",
|
|
687
694
|
Function = "function",
|
|
688
695
|
Text = "text",
|
|
689
|
-
YAML = "yaml"
|
|
696
|
+
YAML = "yaml"
|
|
690
697
|
}
|
|
691
698
|
interface SnippetModel<T = unknown> extends BaseModel {
|
|
692
699
|
type: SnippetType;
|
|
@@ -1112,7 +1119,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1112
1119
|
name: string;
|
|
1113
1120
|
created: string;
|
|
1114
1121
|
id: string;
|
|
1115
|
-
children: Pick<PostModel, "id" | "
|
|
1122
|
+
children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
|
|
1116
1123
|
} : T_1 : never : never;
|
|
1117
1124
|
} : ResponseWrapper;
|
|
1118
1125
|
$request: {
|
|
@@ -1164,7 +1171,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1164
1171
|
};
|
|
1165
1172
|
}) ? T_1 extends unknown ? {
|
|
1166
1173
|
tag: string;
|
|
1167
|
-
data: Pick<PostModel, "category" | "id" | "
|
|
1174
|
+
data: Pick<PostModel, "category" | "id" | "title" | "slug" | "created">[];
|
|
1168
1175
|
} : T_1 : never : never;
|
|
1169
1176
|
} : ResponseWrapper;
|
|
1170
1177
|
$request: {
|
|
@@ -1573,11 +1580,11 @@ declare module '@mx-space/api-client' {
|
|
|
1573
1580
|
}
|
|
1574
1581
|
declare enum RecentlyAttitudeResultEnum {
|
|
1575
1582
|
Inc = 1,
|
|
1576
|
-
Dec = -1
|
|
1583
|
+
Dec = -1
|
|
1577
1584
|
}
|
|
1578
1585
|
declare enum RecentlyAttitudeEnum {
|
|
1579
1586
|
Up = 0,
|
|
1580
|
-
Down = 1
|
|
1587
|
+
Down = 1
|
|
1581
1588
|
}
|
|
1582
1589
|
declare class RecentlyController<ResponseWrapper> implements IController {
|
|
1583
1590
|
private readonly client;
|
|
@@ -1754,11 +1761,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1754
1761
|
* @param options
|
|
1755
1762
|
* @returns
|
|
1756
1763
|
*/
|
|
1757
|
-
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1764
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1758
1765
|
type: "post";
|
|
1759
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1766
|
+
}) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
|
|
1760
1767
|
type: "note";
|
|
1761
|
-
}) | (Pick<PageModel, "id" | "
|
|
1768
|
+
}) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1762
1769
|
type: "page";
|
|
1763
1770
|
})> & {
|
|
1764
1771
|
/**
|
|
@@ -1767,11 +1774,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1767
1774
|
raw?: any;
|
|
1768
1775
|
}, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1769
1776
|
[key: string]: any;
|
|
1770
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1777
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1771
1778
|
type: "post";
|
|
1772
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1779
|
+
}) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
|
|
1773
1780
|
type: "note";
|
|
1774
|
-
}) | (Pick<PageModel, "id" | "
|
|
1781
|
+
}) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1775
1782
|
type: "page";
|
|
1776
1783
|
})> & {
|
|
1777
1784
|
/**
|
|
@@ -1780,11 +1787,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1780
1787
|
raw?: any;
|
|
1781
1788
|
}, ResponseWrapper>;
|
|
1782
1789
|
} : ResponseWrapper extends {
|
|
1783
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1790
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1784
1791
|
type: "post";
|
|
1785
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1792
|
+
}) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
|
|
1786
1793
|
type: "note";
|
|
1787
|
-
}) | (Pick<PageModel, "id" | "
|
|
1794
|
+
}) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1788
1795
|
type: "page";
|
|
1789
1796
|
})> & {
|
|
1790
1797
|
/**
|
|
@@ -1793,11 +1800,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1793
1800
|
raw?: any;
|
|
1794
1801
|
}, ResponseWrapper>;
|
|
1795
1802
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1796
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1803
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1797
1804
|
type: "post";
|
|
1798
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1805
|
+
}) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
|
|
1799
1806
|
type: "note";
|
|
1800
|
-
}) | (Pick<PageModel, "id" | "
|
|
1807
|
+
}) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1801
1808
|
type: "page";
|
|
1802
1809
|
})> & {
|
|
1803
1810
|
/**
|
|
@@ -2013,4 +2020,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
|
|
|
2013
2020
|
*/
|
|
2014
2021
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
2015
2022
|
//#endregion
|
|
2016
|
-
export { AIController, AIDeepReadingModel, AISummaryModel, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, NoteController, NoteModel, NoteWrappedPayload, NoteWrappedWithLikedPayload, PageController, PageModel, Pager, PaginateResult, PostController, PostModel, ProjectController, ProjectModel, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TimelineData, TimelineType, TopicController, TopicModel, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
2023
|
+
export { AIController, AIDeepReadingModel, AISummaryModel, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, NoteController, NoteModel, NoteWrappedPayload, NoteWrappedWithLikedPayload, PageController, PageModel, Pager, PaginateResult, PostController, PostModel, ProjectController, ProjectModel, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TimelineData, TimelineType, TopicController, TopicModel, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.d.mts
CHANGED
|
@@ -40,14 +40,14 @@ interface IRequestHandler<ResponseWrapper> {
|
|
|
40
40
|
valueOf: (withBase?: boolean) => string;
|
|
41
41
|
[key: string]: IRequestHandler<ResponseWrapper>;
|
|
42
42
|
}
|
|
43
|
-
type RequestProxyResult<T, ResponseWrapper, R
|
|
43
|
+
type RequestProxyResult<T, ResponseWrapper, R = (ResponseWrapper extends unknown ? {
|
|
44
44
|
data: T;
|
|
45
45
|
[key: string]: any;
|
|
46
46
|
} : ResponseWrapper extends {
|
|
47
47
|
data: T;
|
|
48
48
|
} ? ResponseWrapper : Omit<ResponseWrapper, 'data'> & {
|
|
49
49
|
data: T;
|
|
50
|
-
})> = Promise<ResponseProxyExtraRaw<T, R
|
|
50
|
+
})> = Promise<ResponseProxyExtraRaw<T, R, ResponseWrapper>>;
|
|
51
51
|
type CamelToSnake<T extends string, P extends string = ''> = string extends T ? string : T extends `${infer C0}${infer R}` ? CamelToSnake<R, `${P}${C0 extends Lowercase<C0> ? '' : '_'}${Lowercase<C0>}`> : P;
|
|
52
52
|
type CamelKeysToSnake<T> = { [K in keyof T as CamelToSnake<Extract<K, string>>]: T[K] };
|
|
53
53
|
type ResponseWrapperType<Response, RawData, T> = {
|
|
@@ -129,7 +129,7 @@ declare enum CollectionRefTypes {
|
|
|
129
129
|
Post = "posts",
|
|
130
130
|
Note = "notes",
|
|
131
131
|
Page = "pages",
|
|
132
|
-
Recently = "recentlies"
|
|
132
|
+
Recently = "recentlies"
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
135
|
//#region models/base.d.ts
|
|
@@ -195,7 +195,7 @@ interface PostModel extends TextBaseModel {
|
|
|
195
195
|
//#region models/category.d.ts
|
|
196
196
|
declare enum CategoryType {
|
|
197
197
|
Category = 0,
|
|
198
|
-
Tag = 1
|
|
198
|
+
Tag = 1
|
|
199
199
|
}
|
|
200
200
|
interface CategoryModel extends BaseModel {
|
|
201
201
|
type: CategoryType;
|
|
@@ -379,7 +379,7 @@ interface NoteWrappedWithLikedPayload {
|
|
|
379
379
|
declare enum EnumPageType {
|
|
380
380
|
'md' = "md",
|
|
381
381
|
'html' = "html",
|
|
382
|
-
'frame' = "frame"
|
|
382
|
+
'frame' = "frame"
|
|
383
383
|
}
|
|
384
384
|
interface PageModel extends TextBaseModel {
|
|
385
385
|
created: string;
|
|
@@ -491,6 +491,9 @@ type TLogin = {
|
|
|
491
491
|
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
492
492
|
//#endregion
|
|
493
493
|
//#region models/aggregate.d.ts
|
|
494
|
+
interface AggregateAIConfig {
|
|
495
|
+
enableSummary: boolean;
|
|
496
|
+
}
|
|
494
497
|
interface AggregateRoot {
|
|
495
498
|
user: UserModel;
|
|
496
499
|
seo: SeoOptionModel;
|
|
@@ -504,6 +507,10 @@ interface AggregateRoot {
|
|
|
504
507
|
id: string;
|
|
505
508
|
nid: number;
|
|
506
509
|
};
|
|
510
|
+
/**
|
|
511
|
+
* @available 9.2.0
|
|
512
|
+
*/
|
|
513
|
+
ai?: AggregateAIConfig;
|
|
507
514
|
}
|
|
508
515
|
interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
509
516
|
theme?: Theme;
|
|
@@ -522,7 +529,7 @@ interface AggregateTop {
|
|
|
522
529
|
}
|
|
523
530
|
declare enum TimelineType {
|
|
524
531
|
Post = 0,
|
|
525
|
-
Note = 1
|
|
532
|
+
Note = 1
|
|
526
533
|
}
|
|
527
534
|
interface TimelineData {
|
|
528
535
|
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'bookmark'>[];
|
|
@@ -612,20 +619,20 @@ interface CommentRef {
|
|
|
612
619
|
declare enum CommentState {
|
|
613
620
|
Unread = 0,
|
|
614
621
|
Read = 1,
|
|
615
|
-
Junk = 2
|
|
622
|
+
Junk = 2
|
|
616
623
|
}
|
|
617
624
|
//#endregion
|
|
618
625
|
//#region models/link.d.ts
|
|
619
626
|
declare enum LinkType {
|
|
620
627
|
Friend = 0,
|
|
621
|
-
Collection = 1
|
|
628
|
+
Collection = 1
|
|
622
629
|
}
|
|
623
630
|
declare enum LinkState {
|
|
624
631
|
Pass = 0,
|
|
625
632
|
Audit = 1,
|
|
626
633
|
Outdate = 2,
|
|
627
634
|
Banned = 3,
|
|
628
|
-
Reject = 4
|
|
635
|
+
Reject = 4
|
|
629
636
|
}
|
|
630
637
|
interface LinkModel extends BaseModel {
|
|
631
638
|
name: string;
|
|
@@ -663,7 +670,7 @@ interface ReaderModel {
|
|
|
663
670
|
declare enum RecentlyRefTypes {
|
|
664
671
|
Post = "Post",
|
|
665
672
|
Note = "Note",
|
|
666
|
-
Page = "Page"
|
|
673
|
+
Page = "Page"
|
|
667
674
|
}
|
|
668
675
|
type RecentlyRefType = {
|
|
669
676
|
title: string;
|
|
@@ -686,7 +693,7 @@ declare enum SnippetType {
|
|
|
686
693
|
JSON = "json",
|
|
687
694
|
Function = "function",
|
|
688
695
|
Text = "text",
|
|
689
|
-
YAML = "yaml"
|
|
696
|
+
YAML = "yaml"
|
|
690
697
|
}
|
|
691
698
|
interface SnippetModel<T = unknown> extends BaseModel {
|
|
692
699
|
type: SnippetType;
|
|
@@ -1112,7 +1119,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1112
1119
|
name: string;
|
|
1113
1120
|
created: string;
|
|
1114
1121
|
id: string;
|
|
1115
|
-
children: Pick<PostModel, "id" | "
|
|
1122
|
+
children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
|
|
1116
1123
|
} : T_1 : never : never;
|
|
1117
1124
|
} : ResponseWrapper;
|
|
1118
1125
|
$request: {
|
|
@@ -1164,7 +1171,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1164
1171
|
};
|
|
1165
1172
|
}) ? T_1 extends unknown ? {
|
|
1166
1173
|
tag: string;
|
|
1167
|
-
data: Pick<PostModel, "category" | "id" | "
|
|
1174
|
+
data: Pick<PostModel, "category" | "id" | "title" | "slug" | "created">[];
|
|
1168
1175
|
} : T_1 : never : never;
|
|
1169
1176
|
} : ResponseWrapper;
|
|
1170
1177
|
$request: {
|
|
@@ -1573,11 +1580,11 @@ declare module '@mx-space/api-client' {
|
|
|
1573
1580
|
}
|
|
1574
1581
|
declare enum RecentlyAttitudeResultEnum {
|
|
1575
1582
|
Inc = 1,
|
|
1576
|
-
Dec = -1
|
|
1583
|
+
Dec = -1
|
|
1577
1584
|
}
|
|
1578
1585
|
declare enum RecentlyAttitudeEnum {
|
|
1579
1586
|
Up = 0,
|
|
1580
|
-
Down = 1
|
|
1587
|
+
Down = 1
|
|
1581
1588
|
}
|
|
1582
1589
|
declare class RecentlyController<ResponseWrapper> implements IController {
|
|
1583
1590
|
private readonly client;
|
|
@@ -1754,11 +1761,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1754
1761
|
* @param options
|
|
1755
1762
|
* @returns
|
|
1756
1763
|
*/
|
|
1757
|
-
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1764
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1758
1765
|
type: "post";
|
|
1759
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1766
|
+
}) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
|
|
1760
1767
|
type: "note";
|
|
1761
|
-
}) | (Pick<PageModel, "id" | "
|
|
1768
|
+
}) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1762
1769
|
type: "page";
|
|
1763
1770
|
})> & {
|
|
1764
1771
|
/**
|
|
@@ -1767,11 +1774,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1767
1774
|
raw?: any;
|
|
1768
1775
|
}, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1769
1776
|
[key: string]: any;
|
|
1770
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1777
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1771
1778
|
type: "post";
|
|
1772
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1779
|
+
}) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
|
|
1773
1780
|
type: "note";
|
|
1774
|
-
}) | (Pick<PageModel, "id" | "
|
|
1781
|
+
}) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1775
1782
|
type: "page";
|
|
1776
1783
|
})> & {
|
|
1777
1784
|
/**
|
|
@@ -1780,11 +1787,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1780
1787
|
raw?: any;
|
|
1781
1788
|
}, ResponseWrapper>;
|
|
1782
1789
|
} : ResponseWrapper extends {
|
|
1783
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1790
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1784
1791
|
type: "post";
|
|
1785
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1792
|
+
}) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
|
|
1786
1793
|
type: "note";
|
|
1787
|
-
}) | (Pick<PageModel, "id" | "
|
|
1794
|
+
}) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1788
1795
|
type: "page";
|
|
1789
1796
|
})> & {
|
|
1790
1797
|
/**
|
|
@@ -1793,11 +1800,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1793
1800
|
raw?: any;
|
|
1794
1801
|
}, ResponseWrapper>;
|
|
1795
1802
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1796
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1803
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1797
1804
|
type: "post";
|
|
1798
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1805
|
+
}) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
|
|
1799
1806
|
type: "note";
|
|
1800
|
-
}) | (Pick<PageModel, "id" | "
|
|
1807
|
+
}) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
|
|
1801
1808
|
type: "page";
|
|
1802
1809
|
})> & {
|
|
1803
1810
|
/**
|
|
@@ -2013,4 +2020,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
|
|
|
2013
2020
|
*/
|
|
2014
2021
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
2015
2022
|
//#endregion
|
|
2016
|
-
export { AIController, AIDeepReadingModel, AISummaryModel, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, NoteController, NoteModel, NoteWrappedPayload, NoteWrappedWithLikedPayload, PageController, PageModel, Pager, PaginateResult, PostController, PostModel, ProjectController, ProjectModel, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TimelineData, TimelineType, TopicController, TopicModel, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
2023
|
+
export { AIController, AIDeepReadingModel, AISummaryModel, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, NoteController, NoteModel, NoteWrappedPayload, NoteWrappedWithLikedPayload, PageController, PageModel, Pager, PaginateResult, PostController, PostModel, ProjectController, ProjectModel, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TimelineData, TimelineType, TopicController, TopicModel, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.mjs
CHANGED
|
@@ -259,10 +259,10 @@ var RequestError = class extends Error {
|
|
|
259
259
|
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region models/category.ts
|
|
262
|
-
let CategoryType = /* @__PURE__ */ function(CategoryType
|
|
263
|
-
CategoryType
|
|
264
|
-
CategoryType
|
|
265
|
-
return CategoryType
|
|
262
|
+
let CategoryType = /* @__PURE__ */ function(CategoryType) {
|
|
263
|
+
CategoryType[CategoryType["Category"] = 0] = "Category";
|
|
264
|
+
CategoryType[CategoryType["Tag"] = 1] = "Tag";
|
|
265
|
+
return CategoryType;
|
|
266
266
|
}({});
|
|
267
267
|
|
|
268
268
|
//#endregion
|
|
@@ -556,15 +556,15 @@ var ProjectController = class extends BaseCrudController {
|
|
|
556
556
|
|
|
557
557
|
//#endregion
|
|
558
558
|
//#region controllers/recently.ts
|
|
559
|
-
let RecentlyAttitudeResultEnum = /* @__PURE__ */ function(RecentlyAttitudeResultEnum
|
|
560
|
-
RecentlyAttitudeResultEnum
|
|
561
|
-
RecentlyAttitudeResultEnum
|
|
562
|
-
return RecentlyAttitudeResultEnum
|
|
559
|
+
let RecentlyAttitudeResultEnum = /* @__PURE__ */ function(RecentlyAttitudeResultEnum) {
|
|
560
|
+
RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum["Inc"] = 1] = "Inc";
|
|
561
|
+
RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum["Dec"] = -1] = "Dec";
|
|
562
|
+
return RecentlyAttitudeResultEnum;
|
|
563
563
|
}({});
|
|
564
|
-
let RecentlyAttitudeEnum = /* @__PURE__ */ function(RecentlyAttitudeEnum
|
|
565
|
-
RecentlyAttitudeEnum
|
|
566
|
-
RecentlyAttitudeEnum
|
|
567
|
-
return RecentlyAttitudeEnum
|
|
564
|
+
let RecentlyAttitudeEnum = /* @__PURE__ */ function(RecentlyAttitudeEnum) {
|
|
565
|
+
RecentlyAttitudeEnum[RecentlyAttitudeEnum["Up"] = 0] = "Up";
|
|
566
|
+
RecentlyAttitudeEnum[RecentlyAttitudeEnum["Down"] = 1] = "Down";
|
|
567
|
+
return RecentlyAttitudeEnum;
|
|
568
568
|
}({});
|
|
569
569
|
var RecentlyController = class {
|
|
570
570
|
constructor(client) {
|
|
@@ -1005,10 +1005,10 @@ function createClient(adapter) {
|
|
|
1005
1005
|
|
|
1006
1006
|
//#endregion
|
|
1007
1007
|
//#region models/aggregate.ts
|
|
1008
|
-
let TimelineType = /* @__PURE__ */ function(TimelineType
|
|
1009
|
-
TimelineType
|
|
1010
|
-
TimelineType
|
|
1011
|
-
return TimelineType
|
|
1008
|
+
let TimelineType = /* @__PURE__ */ function(TimelineType) {
|
|
1009
|
+
TimelineType[TimelineType["Post"] = 0] = "Post";
|
|
1010
|
+
TimelineType[TimelineType["Note"] = 1] = "Note";
|
|
1011
|
+
return TimelineType;
|
|
1012
1012
|
}({});
|
|
1013
1013
|
|
|
1014
1014
|
//#endregion
|
|
@@ -1017,65 +1017,65 @@ const POST_COLLECTION_NAME = "posts";
|
|
|
1017
1017
|
const NOTE_COLLECTION_NAME = "notes";
|
|
1018
1018
|
const PAGE_COLLECTION_NAME = "pages";
|
|
1019
1019
|
const RECENTLY_COLLECTION_NAME = "recentlies";
|
|
1020
|
-
let CollectionRefTypes = /* @__PURE__ */ function(CollectionRefTypes
|
|
1021
|
-
CollectionRefTypes
|
|
1022
|
-
CollectionRefTypes
|
|
1023
|
-
CollectionRefTypes
|
|
1024
|
-
CollectionRefTypes
|
|
1025
|
-
return CollectionRefTypes
|
|
1020
|
+
let CollectionRefTypes = /* @__PURE__ */ function(CollectionRefTypes) {
|
|
1021
|
+
CollectionRefTypes[CollectionRefTypes["Post"] = POST_COLLECTION_NAME] = "Post";
|
|
1022
|
+
CollectionRefTypes[CollectionRefTypes["Note"] = NOTE_COLLECTION_NAME] = "Note";
|
|
1023
|
+
CollectionRefTypes[CollectionRefTypes["Page"] = PAGE_COLLECTION_NAME] = "Page";
|
|
1024
|
+
CollectionRefTypes[CollectionRefTypes["Recently"] = RECENTLY_COLLECTION_NAME] = "Recently";
|
|
1025
|
+
return CollectionRefTypes;
|
|
1026
1026
|
}({});
|
|
1027
1027
|
|
|
1028
1028
|
//#endregion
|
|
1029
1029
|
//#region models/comment.ts
|
|
1030
|
-
let CommentState = /* @__PURE__ */ function(CommentState
|
|
1031
|
-
CommentState
|
|
1032
|
-
CommentState
|
|
1033
|
-
CommentState
|
|
1034
|
-
return CommentState
|
|
1030
|
+
let CommentState = /* @__PURE__ */ function(CommentState) {
|
|
1031
|
+
CommentState[CommentState["Unread"] = 0] = "Unread";
|
|
1032
|
+
CommentState[CommentState["Read"] = 1] = "Read";
|
|
1033
|
+
CommentState[CommentState["Junk"] = 2] = "Junk";
|
|
1034
|
+
return CommentState;
|
|
1035
1035
|
}({});
|
|
1036
1036
|
|
|
1037
1037
|
//#endregion
|
|
1038
1038
|
//#region models/link.ts
|
|
1039
|
-
let LinkType = /* @__PURE__ */ function(LinkType
|
|
1040
|
-
LinkType
|
|
1041
|
-
LinkType
|
|
1042
|
-
return LinkType
|
|
1039
|
+
let LinkType = /* @__PURE__ */ function(LinkType) {
|
|
1040
|
+
LinkType[LinkType["Friend"] = 0] = "Friend";
|
|
1041
|
+
LinkType[LinkType["Collection"] = 1] = "Collection";
|
|
1042
|
+
return LinkType;
|
|
1043
1043
|
}({});
|
|
1044
|
-
let LinkState = /* @__PURE__ */ function(LinkState
|
|
1045
|
-
LinkState
|
|
1046
|
-
LinkState
|
|
1047
|
-
LinkState
|
|
1048
|
-
LinkState
|
|
1049
|
-
LinkState
|
|
1050
|
-
return LinkState
|
|
1044
|
+
let LinkState = /* @__PURE__ */ function(LinkState) {
|
|
1045
|
+
LinkState[LinkState["Pass"] = 0] = "Pass";
|
|
1046
|
+
LinkState[LinkState["Audit"] = 1] = "Audit";
|
|
1047
|
+
LinkState[LinkState["Outdate"] = 2] = "Outdate";
|
|
1048
|
+
LinkState[LinkState["Banned"] = 3] = "Banned";
|
|
1049
|
+
LinkState[LinkState["Reject"] = 4] = "Reject";
|
|
1050
|
+
return LinkState;
|
|
1051
1051
|
}({});
|
|
1052
1052
|
|
|
1053
1053
|
//#endregion
|
|
1054
1054
|
//#region models/page.ts
|
|
1055
|
-
let EnumPageType = /* @__PURE__ */ function(EnumPageType
|
|
1056
|
-
EnumPageType
|
|
1057
|
-
EnumPageType
|
|
1058
|
-
EnumPageType
|
|
1059
|
-
return EnumPageType
|
|
1055
|
+
let EnumPageType = /* @__PURE__ */ function(EnumPageType) {
|
|
1056
|
+
EnumPageType["md"] = "md";
|
|
1057
|
+
EnumPageType["html"] = "html";
|
|
1058
|
+
EnumPageType["frame"] = "frame";
|
|
1059
|
+
return EnumPageType;
|
|
1060
1060
|
}({});
|
|
1061
1061
|
|
|
1062
1062
|
//#endregion
|
|
1063
1063
|
//#region models/recently.ts
|
|
1064
|
-
let RecentlyRefTypes = /* @__PURE__ */ function(RecentlyRefTypes
|
|
1065
|
-
RecentlyRefTypes
|
|
1066
|
-
RecentlyRefTypes
|
|
1067
|
-
RecentlyRefTypes
|
|
1068
|
-
return RecentlyRefTypes
|
|
1064
|
+
let RecentlyRefTypes = /* @__PURE__ */ function(RecentlyRefTypes) {
|
|
1065
|
+
RecentlyRefTypes["Post"] = "Post";
|
|
1066
|
+
RecentlyRefTypes["Note"] = "Note";
|
|
1067
|
+
RecentlyRefTypes["Page"] = "Page";
|
|
1068
|
+
return RecentlyRefTypes;
|
|
1069
1069
|
}({});
|
|
1070
1070
|
|
|
1071
1071
|
//#endregion
|
|
1072
1072
|
//#region models/snippet.ts
|
|
1073
|
-
let SnippetType = /* @__PURE__ */ function(SnippetType
|
|
1074
|
-
SnippetType
|
|
1075
|
-
SnippetType
|
|
1076
|
-
SnippetType
|
|
1077
|
-
SnippetType
|
|
1078
|
-
return SnippetType
|
|
1073
|
+
let SnippetType = /* @__PURE__ */ function(SnippetType) {
|
|
1074
|
+
SnippetType["JSON"] = "json";
|
|
1075
|
+
SnippetType["Function"] = "function";
|
|
1076
|
+
SnippetType["Text"] = "text";
|
|
1077
|
+
SnippetType["YAML"] = "yaml";
|
|
1078
|
+
return SnippetType;
|
|
1079
1079
|
}({});
|
|
1080
1080
|
|
|
1081
1081
|
//#endregion
|
package/models/aggregate.ts
CHANGED
|
@@ -6,6 +6,10 @@ import type { SayModel } from './say'
|
|
|
6
6
|
import type { SeoOptionModel } from './setting'
|
|
7
7
|
import type { UserModel } from './user'
|
|
8
8
|
|
|
9
|
+
export interface AggregateAIConfig {
|
|
10
|
+
enableSummary: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
export interface AggregateRoot {
|
|
10
14
|
user: UserModel
|
|
11
15
|
seo: SeoOptionModel
|
|
@@ -16,6 +20,10 @@ export interface AggregateRoot {
|
|
|
16
20
|
* @available 4.2.2
|
|
17
21
|
*/
|
|
18
22
|
latestNoteId: { id: string; nid: number }
|
|
23
|
+
/**
|
|
24
|
+
* @available 9.2.0
|
|
25
|
+
*/
|
|
26
|
+
ai?: AggregateAIConfig
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
export interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
@@ -28,14 +36,15 @@ export interface Url {
|
|
|
28
36
|
webUrl: string
|
|
29
37
|
}
|
|
30
38
|
|
|
31
|
-
export interface AggregateTopNote
|
|
32
|
-
|
|
39
|
+
export interface AggregateTopNote extends Pick<
|
|
40
|
+
NoteModel,
|
|
41
|
+
'id' | 'title' | 'created' | 'nid' | 'images'
|
|
42
|
+
> {}
|
|
33
43
|
|
|
34
|
-
export interface AggregateTopPost
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
> {}
|
|
44
|
+
export interface AggregateTopPost extends Pick<
|
|
45
|
+
PostModel,
|
|
46
|
+
'id' | 'slug' | 'created' | 'title' | 'category' | 'images'
|
|
47
|
+
> {}
|
|
39
48
|
|
|
40
49
|
export interface AggregateTop {
|
|
41
50
|
notes: AggregateTopNote[]
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "A api client for mx-space server@next",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22"
|
|
8
|
+
},
|
|
6
9
|
"license": "MIT",
|
|
7
10
|
"author": "Innei",
|
|
8
11
|
"main": "dist/index.cjs",
|
|
@@ -10,17 +13,17 @@
|
|
|
10
13
|
"types": "dist/index.d.ts",
|
|
11
14
|
"exports": {
|
|
12
15
|
".": {
|
|
13
|
-
"types": "./dist/index.d.
|
|
16
|
+
"types": "./dist/index.d.mts",
|
|
14
17
|
"require": "./dist/index.cjs",
|
|
15
|
-
"import": "./dist/index.
|
|
18
|
+
"import": "./dist/index.mjs"
|
|
16
19
|
},
|
|
17
20
|
"./dist/*": {
|
|
18
21
|
"require": "./dist/*.cjs",
|
|
19
|
-
"import": "./dist/*.
|
|
22
|
+
"import": "./dist/*.mjs"
|
|
20
23
|
},
|
|
21
24
|
"./dist/adaptors/*": {
|
|
22
25
|
"require": "./dist/adaptors/*.cjs",
|
|
23
|
-
"import": "./dist/adaptors/*.
|
|
26
|
+
"import": "./dist/adaptors/*.mjs"
|
|
24
27
|
},
|
|
25
28
|
"./package.json": "./package.json"
|
|
26
29
|
},
|
|
@@ -46,17 +49,16 @@
|
|
|
46
49
|
"devDependencies": {
|
|
47
50
|
"@types/cors": "2.8.19",
|
|
48
51
|
"@types/express": "5.0.6",
|
|
49
|
-
"@types/lodash": "4.17.21",
|
|
50
52
|
"abort-controller": "3.0.0",
|
|
51
|
-
"axios": "^1.13.
|
|
52
|
-
"camelcase-keys": "^
|
|
53
|
-
"cors": "2.8.
|
|
53
|
+
"axios": "^1.13.3",
|
|
54
|
+
"camelcase-keys": "^10.0.2",
|
|
55
|
+
"cors": "2.8.6",
|
|
56
|
+
"es-toolkit": "1.44.0",
|
|
54
57
|
"express": "4.21.2",
|
|
55
58
|
"form-data": "4.0.5",
|
|
56
|
-
"
|
|
57
|
-
"tsdown": "0.18.3",
|
|
59
|
+
"tsdown": "0.20.1",
|
|
58
60
|
"umi-request": "1.4.0",
|
|
59
|
-
"vite": "^
|
|
60
|
-
"vitest": "
|
|
61
|
+
"vite": "^7.3.1",
|
|
62
|
+
"vitest": "4.0.18"
|
|
61
63
|
}
|
|
62
64
|
}
|