@mx-space/api-client 2.2.0 → 2.4.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 +22 -4
- package/dist/index.d.cts +104 -17
- package/dist/index.d.mts +104 -17
- package/dist/index.mjs +22 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -428,14 +428,20 @@ var CommentController = class {
|
|
|
428
428
|
/**
|
|
429
429
|
* 评论
|
|
430
430
|
*/
|
|
431
|
-
|
|
432
|
-
return this.proxy(refId).post({ data });
|
|
431
|
+
guestComment(refId, data) {
|
|
432
|
+
return this.proxy.guest(refId).post({ data });
|
|
433
433
|
}
|
|
434
434
|
/**
|
|
435
435
|
* 回复评论
|
|
436
436
|
*/
|
|
437
|
-
|
|
438
|
-
return this.proxy.reply(commentId).post({ data });
|
|
437
|
+
guestReply(commentId, data) {
|
|
438
|
+
return this.proxy.guest.reply(commentId).post({ data });
|
|
439
|
+
}
|
|
440
|
+
readerComment(refId, data) {
|
|
441
|
+
return this.proxy.reader(refId).post({ data });
|
|
442
|
+
}
|
|
443
|
+
readerReply(commentId, data) {
|
|
444
|
+
return this.proxy.reader.reply(commentId).post({ data });
|
|
439
445
|
}
|
|
440
446
|
};
|
|
441
447
|
|
|
@@ -1247,6 +1253,17 @@ let RecentlyRefTypes = /* @__PURE__ */ function(RecentlyRefTypes) {
|
|
|
1247
1253
|
RecentlyRefTypes["Page"] = "Page";
|
|
1248
1254
|
return RecentlyRefTypes;
|
|
1249
1255
|
}({});
|
|
1256
|
+
let RecentlyTypeEnum = /* @__PURE__ */ function(RecentlyTypeEnum) {
|
|
1257
|
+
RecentlyTypeEnum["Text"] = "text";
|
|
1258
|
+
RecentlyTypeEnum["Book"] = "book";
|
|
1259
|
+
RecentlyTypeEnum["Media"] = "media";
|
|
1260
|
+
RecentlyTypeEnum["Music"] = "music";
|
|
1261
|
+
RecentlyTypeEnum["Github"] = "github";
|
|
1262
|
+
RecentlyTypeEnum["Link"] = "link";
|
|
1263
|
+
RecentlyTypeEnum["Academic"] = "academic";
|
|
1264
|
+
RecentlyTypeEnum["Code"] = "code";
|
|
1265
|
+
return RecentlyTypeEnum;
|
|
1266
|
+
}({});
|
|
1250
1267
|
|
|
1251
1268
|
//#endregion
|
|
1252
1269
|
//#region models/snippet.ts
|
|
@@ -1299,6 +1316,7 @@ exports.RecentlyAttitudeEnum = RecentlyAttitudeEnum;
|
|
|
1299
1316
|
exports.RecentlyAttitudeResultEnum = RecentlyAttitudeResultEnum;
|
|
1300
1317
|
exports.RecentlyController = RecentlyController;
|
|
1301
1318
|
exports.RecentlyRefTypes = RecentlyRefTypes;
|
|
1319
|
+
exports.RecentlyTypeEnum = RecentlyTypeEnum;
|
|
1302
1320
|
exports.RequestError = RequestError;
|
|
1303
1321
|
exports.SayController = SayController;
|
|
1304
1322
|
exports.SearchController = SearchController;
|
package/dist/index.d.cts
CHANGED
|
@@ -459,6 +459,7 @@ declare class MailOptionsModel {
|
|
|
459
459
|
}
|
|
460
460
|
declare class CommentOptionsModel {
|
|
461
461
|
antiSpam: boolean;
|
|
462
|
+
allowGuestComment: boolean;
|
|
462
463
|
spamKeywords?: string[];
|
|
463
464
|
blockIps?: string[];
|
|
464
465
|
disableNoChinese?: boolean;
|
|
@@ -747,7 +748,6 @@ interface CommentModel extends BaseModel {
|
|
|
747
748
|
deletedAt?: string;
|
|
748
749
|
isWhispers?: boolean;
|
|
749
750
|
location?: string;
|
|
750
|
-
source?: string;
|
|
751
751
|
readerId?: string;
|
|
752
752
|
editedAt?: string;
|
|
753
753
|
}
|
|
@@ -823,7 +823,7 @@ interface ReaderModel {
|
|
|
823
823
|
name: string;
|
|
824
824
|
handle: string;
|
|
825
825
|
image: string;
|
|
826
|
-
|
|
826
|
+
role?: 'reader' | 'owner';
|
|
827
827
|
}
|
|
828
828
|
//#endregion
|
|
829
829
|
//#region models/recently.d.ts
|
|
@@ -836,8 +836,74 @@ type RecentlyRefType = {
|
|
|
836
836
|
title: string;
|
|
837
837
|
url: string;
|
|
838
838
|
};
|
|
839
|
+
declare enum RecentlyTypeEnum {
|
|
840
|
+
Text = "text",
|
|
841
|
+
Book = "book",
|
|
842
|
+
Media = "media",
|
|
843
|
+
Music = "music",
|
|
844
|
+
Github = "github",
|
|
845
|
+
Link = "link",
|
|
846
|
+
Academic = "academic",
|
|
847
|
+
Code = "code"
|
|
848
|
+
}
|
|
849
|
+
interface BookMetadata {
|
|
850
|
+
url: string;
|
|
851
|
+
title: string;
|
|
852
|
+
author: string;
|
|
853
|
+
cover?: string;
|
|
854
|
+
rating?: number;
|
|
855
|
+
isbn?: string;
|
|
856
|
+
}
|
|
857
|
+
interface MediaMetadata {
|
|
858
|
+
url: string;
|
|
859
|
+
title: string;
|
|
860
|
+
originalTitle?: string;
|
|
861
|
+
cover?: string;
|
|
862
|
+
rating?: number;
|
|
863
|
+
description?: string;
|
|
864
|
+
genre?: string;
|
|
865
|
+
}
|
|
866
|
+
interface MusicMetadata {
|
|
867
|
+
url: string;
|
|
868
|
+
title: string;
|
|
869
|
+
artist: string;
|
|
870
|
+
album?: string;
|
|
871
|
+
cover?: string;
|
|
872
|
+
source?: string;
|
|
873
|
+
}
|
|
874
|
+
interface GithubMetadata {
|
|
875
|
+
url: string;
|
|
876
|
+
owner: string;
|
|
877
|
+
repo: string;
|
|
878
|
+
description?: string;
|
|
879
|
+
stars?: number;
|
|
880
|
+
language?: string;
|
|
881
|
+
languageColor?: string;
|
|
882
|
+
}
|
|
883
|
+
interface LinkMetadata {
|
|
884
|
+
url: string;
|
|
885
|
+
title?: string;
|
|
886
|
+
description?: string;
|
|
887
|
+
image?: string;
|
|
888
|
+
}
|
|
889
|
+
interface AcademicMetadata {
|
|
890
|
+
url: string;
|
|
891
|
+
title: string;
|
|
892
|
+
authors?: string[];
|
|
893
|
+
arxivId?: string;
|
|
894
|
+
}
|
|
895
|
+
interface CodeMetadata {
|
|
896
|
+
url: string;
|
|
897
|
+
title: string;
|
|
898
|
+
difficulty?: string;
|
|
899
|
+
tags?: string[];
|
|
900
|
+
platform?: string;
|
|
901
|
+
}
|
|
902
|
+
type RecentlyMetadata = BookMetadata | MediaMetadata | MusicMetadata | GithubMetadata | LinkMetadata | AcademicMetadata | CodeMetadata;
|
|
839
903
|
interface RecentlyModel extends BaseCommentIndexModel {
|
|
840
904
|
content: string;
|
|
905
|
+
type: RecentlyTypeEnum;
|
|
906
|
+
metadata?: RecentlyMetadata;
|
|
841
907
|
ref?: RecentlyRefType & {
|
|
842
908
|
[key: string]: any;
|
|
843
909
|
};
|
|
@@ -1497,7 +1563,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1497
1563
|
name: string;
|
|
1498
1564
|
created: string;
|
|
1499
1565
|
id: string;
|
|
1500
|
-
children: Pick<PostModel, "
|
|
1566
|
+
children: Pick<PostModel, "slug" | "id" | "created" | "title" | "modified">[];
|
|
1501
1567
|
} : T_1 : never : never;
|
|
1502
1568
|
} : ResponseWrapper;
|
|
1503
1569
|
$request: {
|
|
@@ -1549,7 +1615,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1549
1615
|
};
|
|
1550
1616
|
}) ? T_1 extends unknown ? {
|
|
1551
1617
|
tag: string;
|
|
1552
|
-
data: Pick<PostModel, "category" | "
|
|
1618
|
+
data: Pick<PostModel, "category" | "slug" | "id" | "created" | "title">[];
|
|
1553
1619
|
} : T_1 : never : never;
|
|
1554
1620
|
} : ResponseWrapper;
|
|
1555
1621
|
$request: {
|
|
@@ -1571,14 +1637,19 @@ interface PaginationParams {
|
|
|
1571
1637
|
}
|
|
1572
1638
|
//#endregion
|
|
1573
1639
|
//#region dtos/comment.d.ts
|
|
1574
|
-
interface
|
|
1640
|
+
interface AnonymousCommentDto {
|
|
1575
1641
|
author: string;
|
|
1576
1642
|
text: string;
|
|
1577
1643
|
mail: string;
|
|
1578
1644
|
url?: string;
|
|
1579
|
-
source?: 'github' | 'google';
|
|
1580
1645
|
avatar?: string;
|
|
1646
|
+
isWhispers?: boolean;
|
|
1581
1647
|
}
|
|
1648
|
+
interface ReaderCommentDto {
|
|
1649
|
+
text: string;
|
|
1650
|
+
isWhispers?: boolean;
|
|
1651
|
+
}
|
|
1652
|
+
type CommentDto = AnonymousCommentDto | ReaderCommentDto;
|
|
1582
1653
|
//#endregion
|
|
1583
1654
|
//#region controllers/comment.d.ts
|
|
1584
1655
|
declare module '@mx-space/api-client' {
|
|
@@ -1652,7 +1723,7 @@ declare class CommentController<ResponseWrapper> implements IController {
|
|
|
1652
1723
|
/**
|
|
1653
1724
|
* 评论
|
|
1654
1725
|
*/
|
|
1655
|
-
|
|
1726
|
+
guestComment(refId: string, data: AnonymousCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1656
1727
|
[key: string]: any;
|
|
1657
1728
|
data: CommentModel;
|
|
1658
1729
|
} : ResponseWrapper extends {
|
|
@@ -1663,7 +1734,23 @@ declare class CommentController<ResponseWrapper> implements IController {
|
|
|
1663
1734
|
/**
|
|
1664
1735
|
* 回复评论
|
|
1665
1736
|
*/
|
|
1666
|
-
|
|
1737
|
+
guestReply(commentId: string, data: AnonymousCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1738
|
+
[key: string]: any;
|
|
1739
|
+
data: CommentModel;
|
|
1740
|
+
} : ResponseWrapper extends {
|
|
1741
|
+
data: CommentModel;
|
|
1742
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1743
|
+
data: CommentModel;
|
|
1744
|
+
}>;
|
|
1745
|
+
readerComment(refId: string, data: ReaderCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1746
|
+
[key: string]: any;
|
|
1747
|
+
data: CommentModel;
|
|
1748
|
+
} : ResponseWrapper extends {
|
|
1749
|
+
data: CommentModel;
|
|
1750
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1751
|
+
data: CommentModel;
|
|
1752
|
+
}>;
|
|
1753
|
+
readerReply(commentId: string, data: ReaderCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1667
1754
|
[key: string]: any;
|
|
1668
1755
|
data: CommentModel;
|
|
1669
1756
|
} : ResponseWrapper extends {
|
|
@@ -2366,11 +2453,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
2366
2453
|
* @param options
|
|
2367
2454
|
* @returns
|
|
2368
2455
|
*/
|
|
2369
|
-
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "
|
|
2456
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2370
2457
|
type: "post";
|
|
2371
2458
|
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2372
2459
|
type: "note";
|
|
2373
|
-
}) | (Pick<PageModel, "
|
|
2460
|
+
}) | (Pick<PageModel, "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2374
2461
|
type: "page";
|
|
2375
2462
|
})> & {
|
|
2376
2463
|
/**
|
|
@@ -2379,11 +2466,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
2379
2466
|
raw?: any;
|
|
2380
2467
|
}, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2381
2468
|
[key: string]: any;
|
|
2382
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "
|
|
2469
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2383
2470
|
type: "post";
|
|
2384
2471
|
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2385
2472
|
type: "note";
|
|
2386
|
-
}) | (Pick<PageModel, "
|
|
2473
|
+
}) | (Pick<PageModel, "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2387
2474
|
type: "page";
|
|
2388
2475
|
})> & {
|
|
2389
2476
|
/**
|
|
@@ -2392,11 +2479,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
2392
2479
|
raw?: any;
|
|
2393
2480
|
}, ResponseWrapper>;
|
|
2394
2481
|
} : ResponseWrapper extends {
|
|
2395
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "
|
|
2482
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2396
2483
|
type: "post";
|
|
2397
2484
|
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2398
2485
|
type: "note";
|
|
2399
|
-
}) | (Pick<PageModel, "
|
|
2486
|
+
}) | (Pick<PageModel, "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2400
2487
|
type: "page";
|
|
2401
2488
|
})> & {
|
|
2402
2489
|
/**
|
|
@@ -2405,11 +2492,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
2405
2492
|
raw?: any;
|
|
2406
2493
|
}, ResponseWrapper>;
|
|
2407
2494
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2408
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "
|
|
2495
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2409
2496
|
type: "post";
|
|
2410
2497
|
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2411
2498
|
type: "note";
|
|
2412
|
-
}) | (Pick<PageModel, "
|
|
2499
|
+
}) | (Pick<PageModel, "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2413
2500
|
type: "page";
|
|
2414
2501
|
})> & {
|
|
2415
2502
|
/**
|
|
@@ -2558,4 +2645,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
|
|
|
2558
2645
|
*/
|
|
2559
2646
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
2560
2647
|
//#endregion
|
|
2561
|
-
export { AIController, AIDeepReadingModel, AISummaryModel, AISummaryStreamEvent, AITranslationModel, AITranslationStreamEvent, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BetterAuthSession, BetterAuthSessionResult, BetterAuthSignInResult, BetterAuthUser, BetterAuthUserRole, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CheckLoggedResult, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentReplyWindow, CommentState, CommentThreadItem, CommentThreadReplies, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LatestCombinedItem, LatestData, LatestNoteItem, LatestPostItem, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, ModelWithTranslation, NoteController, type NoteMiddleListOptions, NoteModel, type NoteTimelineItem, type NoteTopicListItem, type NoteTopicListOptions, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, OwnerAllowLoginResult, OwnerSessionResult, PageController, PageModel, Pager, PaginateResult, PostController, type PostListItem, type PostListOptions, 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, TextBaseModelLexical, TextBaseModelMarkdown, ThirdPartyServiceIntegrationModel, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
2648
|
+
export { AIController, AIDeepReadingModel, AISummaryModel, AISummaryStreamEvent, AITranslationModel, AITranslationStreamEvent, AcademicMetadata, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AnonymousCommentDto, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BetterAuthSession, BetterAuthSessionResult, BetterAuthSignInResult, BetterAuthUser, BetterAuthUserRole, BingSearchOptionsModel, BookMetadata, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CheckLoggedResult, CodeMetadata, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentReplyWindow, CommentState, CommentThreadItem, CommentThreadReplies, Coordinate, Count, EnumPageType, GithubMetadata, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LatestCombinedItem, LatestData, LatestNoteItem, LatestPostItem, LinkController, LinkMetadata, LinkModel, LinkState, LinkType, MailOptionsModel, MediaMetadata, ModelWithLiked, ModelWithTranslation, MusicMetadata, NoteController, type NoteMiddleListOptions, NoteModel, type NoteTimelineItem, type NoteTopicListItem, type NoteTopicListOptions, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, OwnerAllowLoginResult, OwnerSessionResult, PageController, PageModel, Pager, PaginateResult, PostController, type PostListItem, type PostListOptions, PostModel, ProjectController, ProjectModel, ReaderCommentDto, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyMetadata, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RecentlyTypeEnum, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TextBaseModelLexical, TextBaseModelMarkdown, ThirdPartyServiceIntegrationModel, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.d.mts
CHANGED
|
@@ -459,6 +459,7 @@ declare class MailOptionsModel {
|
|
|
459
459
|
}
|
|
460
460
|
declare class CommentOptionsModel {
|
|
461
461
|
antiSpam: boolean;
|
|
462
|
+
allowGuestComment: boolean;
|
|
462
463
|
spamKeywords?: string[];
|
|
463
464
|
blockIps?: string[];
|
|
464
465
|
disableNoChinese?: boolean;
|
|
@@ -747,7 +748,6 @@ interface CommentModel extends BaseModel {
|
|
|
747
748
|
deletedAt?: string;
|
|
748
749
|
isWhispers?: boolean;
|
|
749
750
|
location?: string;
|
|
750
|
-
source?: string;
|
|
751
751
|
readerId?: string;
|
|
752
752
|
editedAt?: string;
|
|
753
753
|
}
|
|
@@ -823,7 +823,7 @@ interface ReaderModel {
|
|
|
823
823
|
name: string;
|
|
824
824
|
handle: string;
|
|
825
825
|
image: string;
|
|
826
|
-
|
|
826
|
+
role?: 'reader' | 'owner';
|
|
827
827
|
}
|
|
828
828
|
//#endregion
|
|
829
829
|
//#region models/recently.d.ts
|
|
@@ -836,8 +836,74 @@ type RecentlyRefType = {
|
|
|
836
836
|
title: string;
|
|
837
837
|
url: string;
|
|
838
838
|
};
|
|
839
|
+
declare enum RecentlyTypeEnum {
|
|
840
|
+
Text = "text",
|
|
841
|
+
Book = "book",
|
|
842
|
+
Media = "media",
|
|
843
|
+
Music = "music",
|
|
844
|
+
Github = "github",
|
|
845
|
+
Link = "link",
|
|
846
|
+
Academic = "academic",
|
|
847
|
+
Code = "code"
|
|
848
|
+
}
|
|
849
|
+
interface BookMetadata {
|
|
850
|
+
url: string;
|
|
851
|
+
title: string;
|
|
852
|
+
author: string;
|
|
853
|
+
cover?: string;
|
|
854
|
+
rating?: number;
|
|
855
|
+
isbn?: string;
|
|
856
|
+
}
|
|
857
|
+
interface MediaMetadata {
|
|
858
|
+
url: string;
|
|
859
|
+
title: string;
|
|
860
|
+
originalTitle?: string;
|
|
861
|
+
cover?: string;
|
|
862
|
+
rating?: number;
|
|
863
|
+
description?: string;
|
|
864
|
+
genre?: string;
|
|
865
|
+
}
|
|
866
|
+
interface MusicMetadata {
|
|
867
|
+
url: string;
|
|
868
|
+
title: string;
|
|
869
|
+
artist: string;
|
|
870
|
+
album?: string;
|
|
871
|
+
cover?: string;
|
|
872
|
+
source?: string;
|
|
873
|
+
}
|
|
874
|
+
interface GithubMetadata {
|
|
875
|
+
url: string;
|
|
876
|
+
owner: string;
|
|
877
|
+
repo: string;
|
|
878
|
+
description?: string;
|
|
879
|
+
stars?: number;
|
|
880
|
+
language?: string;
|
|
881
|
+
languageColor?: string;
|
|
882
|
+
}
|
|
883
|
+
interface LinkMetadata {
|
|
884
|
+
url: string;
|
|
885
|
+
title?: string;
|
|
886
|
+
description?: string;
|
|
887
|
+
image?: string;
|
|
888
|
+
}
|
|
889
|
+
interface AcademicMetadata {
|
|
890
|
+
url: string;
|
|
891
|
+
title: string;
|
|
892
|
+
authors?: string[];
|
|
893
|
+
arxivId?: string;
|
|
894
|
+
}
|
|
895
|
+
interface CodeMetadata {
|
|
896
|
+
url: string;
|
|
897
|
+
title: string;
|
|
898
|
+
difficulty?: string;
|
|
899
|
+
tags?: string[];
|
|
900
|
+
platform?: string;
|
|
901
|
+
}
|
|
902
|
+
type RecentlyMetadata = BookMetadata | MediaMetadata | MusicMetadata | GithubMetadata | LinkMetadata | AcademicMetadata | CodeMetadata;
|
|
839
903
|
interface RecentlyModel extends BaseCommentIndexModel {
|
|
840
904
|
content: string;
|
|
905
|
+
type: RecentlyTypeEnum;
|
|
906
|
+
metadata?: RecentlyMetadata;
|
|
841
907
|
ref?: RecentlyRefType & {
|
|
842
908
|
[key: string]: any;
|
|
843
909
|
};
|
|
@@ -1497,7 +1563,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1497
1563
|
name: string;
|
|
1498
1564
|
created: string;
|
|
1499
1565
|
id: string;
|
|
1500
|
-
children: Pick<PostModel, "
|
|
1566
|
+
children: Pick<PostModel, "slug" | "id" | "created" | "title" | "modified">[];
|
|
1501
1567
|
} : T_1 : never : never;
|
|
1502
1568
|
} : ResponseWrapper;
|
|
1503
1569
|
$request: {
|
|
@@ -1549,7 +1615,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1549
1615
|
};
|
|
1550
1616
|
}) ? T_1 extends unknown ? {
|
|
1551
1617
|
tag: string;
|
|
1552
|
-
data: Pick<PostModel, "category" | "
|
|
1618
|
+
data: Pick<PostModel, "category" | "slug" | "id" | "created" | "title">[];
|
|
1553
1619
|
} : T_1 : never : never;
|
|
1554
1620
|
} : ResponseWrapper;
|
|
1555
1621
|
$request: {
|
|
@@ -1571,14 +1637,19 @@ interface PaginationParams {
|
|
|
1571
1637
|
}
|
|
1572
1638
|
//#endregion
|
|
1573
1639
|
//#region dtos/comment.d.ts
|
|
1574
|
-
interface
|
|
1640
|
+
interface AnonymousCommentDto {
|
|
1575
1641
|
author: string;
|
|
1576
1642
|
text: string;
|
|
1577
1643
|
mail: string;
|
|
1578
1644
|
url?: string;
|
|
1579
|
-
source?: 'github' | 'google';
|
|
1580
1645
|
avatar?: string;
|
|
1646
|
+
isWhispers?: boolean;
|
|
1581
1647
|
}
|
|
1648
|
+
interface ReaderCommentDto {
|
|
1649
|
+
text: string;
|
|
1650
|
+
isWhispers?: boolean;
|
|
1651
|
+
}
|
|
1652
|
+
type CommentDto = AnonymousCommentDto | ReaderCommentDto;
|
|
1582
1653
|
//#endregion
|
|
1583
1654
|
//#region controllers/comment.d.ts
|
|
1584
1655
|
declare module '@mx-space/api-client' {
|
|
@@ -1652,7 +1723,7 @@ declare class CommentController<ResponseWrapper> implements IController {
|
|
|
1652
1723
|
/**
|
|
1653
1724
|
* 评论
|
|
1654
1725
|
*/
|
|
1655
|
-
|
|
1726
|
+
guestComment(refId: string, data: AnonymousCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1656
1727
|
[key: string]: any;
|
|
1657
1728
|
data: CommentModel;
|
|
1658
1729
|
} : ResponseWrapper extends {
|
|
@@ -1663,7 +1734,23 @@ declare class CommentController<ResponseWrapper> implements IController {
|
|
|
1663
1734
|
/**
|
|
1664
1735
|
* 回复评论
|
|
1665
1736
|
*/
|
|
1666
|
-
|
|
1737
|
+
guestReply(commentId: string, data: AnonymousCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1738
|
+
[key: string]: any;
|
|
1739
|
+
data: CommentModel;
|
|
1740
|
+
} : ResponseWrapper extends {
|
|
1741
|
+
data: CommentModel;
|
|
1742
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1743
|
+
data: CommentModel;
|
|
1744
|
+
}>;
|
|
1745
|
+
readerComment(refId: string, data: ReaderCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1746
|
+
[key: string]: any;
|
|
1747
|
+
data: CommentModel;
|
|
1748
|
+
} : ResponseWrapper extends {
|
|
1749
|
+
data: CommentModel;
|
|
1750
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1751
|
+
data: CommentModel;
|
|
1752
|
+
}>;
|
|
1753
|
+
readerReply(commentId: string, data: ReaderCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1667
1754
|
[key: string]: any;
|
|
1668
1755
|
data: CommentModel;
|
|
1669
1756
|
} : ResponseWrapper extends {
|
|
@@ -2366,11 +2453,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
2366
2453
|
* @param options
|
|
2367
2454
|
* @returns
|
|
2368
2455
|
*/
|
|
2369
|
-
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "
|
|
2456
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2370
2457
|
type: "post";
|
|
2371
2458
|
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2372
2459
|
type: "note";
|
|
2373
|
-
}) | (Pick<PageModel, "
|
|
2460
|
+
}) | (Pick<PageModel, "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2374
2461
|
type: "page";
|
|
2375
2462
|
})> & {
|
|
2376
2463
|
/**
|
|
@@ -2379,11 +2466,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
2379
2466
|
raw?: any;
|
|
2380
2467
|
}, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2381
2468
|
[key: string]: any;
|
|
2382
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "
|
|
2469
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2383
2470
|
type: "post";
|
|
2384
2471
|
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2385
2472
|
type: "note";
|
|
2386
|
-
}) | (Pick<PageModel, "
|
|
2473
|
+
}) | (Pick<PageModel, "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2387
2474
|
type: "page";
|
|
2388
2475
|
})> & {
|
|
2389
2476
|
/**
|
|
@@ -2392,11 +2479,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
2392
2479
|
raw?: any;
|
|
2393
2480
|
}, ResponseWrapper>;
|
|
2394
2481
|
} : ResponseWrapper extends {
|
|
2395
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "
|
|
2482
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2396
2483
|
type: "post";
|
|
2397
2484
|
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2398
2485
|
type: "note";
|
|
2399
|
-
}) | (Pick<PageModel, "
|
|
2486
|
+
}) | (Pick<PageModel, "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2400
2487
|
type: "page";
|
|
2401
2488
|
})> & {
|
|
2402
2489
|
/**
|
|
@@ -2405,11 +2492,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
2405
2492
|
raw?: any;
|
|
2406
2493
|
}, ResponseWrapper>;
|
|
2407
2494
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2408
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "
|
|
2495
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2409
2496
|
type: "post";
|
|
2410
2497
|
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2411
2498
|
type: "note";
|
|
2412
|
-
}) | (Pick<PageModel, "
|
|
2499
|
+
}) | (Pick<PageModel, "slug" | "id" | "created" | "title" | "modified"> & {
|
|
2413
2500
|
type: "page";
|
|
2414
2501
|
})> & {
|
|
2415
2502
|
/**
|
|
@@ -2558,4 +2645,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
|
|
|
2558
2645
|
*/
|
|
2559
2646
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
2560
2647
|
//#endregion
|
|
2561
|
-
export { AIController, AIDeepReadingModel, AISummaryModel, AISummaryStreamEvent, AITranslationModel, AITranslationStreamEvent, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BetterAuthSession, BetterAuthSessionResult, BetterAuthSignInResult, BetterAuthUser, BetterAuthUserRole, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CheckLoggedResult, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentReplyWindow, CommentState, CommentThreadItem, CommentThreadReplies, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LatestCombinedItem, LatestData, LatestNoteItem, LatestPostItem, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, ModelWithTranslation, NoteController, type NoteMiddleListOptions, NoteModel, type NoteTimelineItem, type NoteTopicListItem, type NoteTopicListOptions, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, OwnerAllowLoginResult, OwnerSessionResult, PageController, PageModel, Pager, PaginateResult, PostController, type PostListItem, type PostListOptions, 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, TextBaseModelLexical, TextBaseModelMarkdown, ThirdPartyServiceIntegrationModel, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
2648
|
+
export { AIController, AIDeepReadingModel, AISummaryModel, AISummaryStreamEvent, AITranslationModel, AITranslationStreamEvent, AcademicMetadata, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AnonymousCommentDto, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BetterAuthSession, BetterAuthSessionResult, BetterAuthSignInResult, BetterAuthUser, BetterAuthUserRole, BingSearchOptionsModel, BookMetadata, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CheckLoggedResult, CodeMetadata, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentReplyWindow, CommentState, CommentThreadItem, CommentThreadReplies, Coordinate, Count, EnumPageType, GithubMetadata, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LatestCombinedItem, LatestData, LatestNoteItem, LatestPostItem, LinkController, LinkMetadata, LinkModel, LinkState, LinkType, MailOptionsModel, MediaMetadata, ModelWithLiked, ModelWithTranslation, MusicMetadata, NoteController, type NoteMiddleListOptions, NoteModel, type NoteTimelineItem, type NoteTopicListItem, type NoteTopicListOptions, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, OwnerAllowLoginResult, OwnerSessionResult, PageController, PageModel, Pager, PaginateResult, PostController, type PostListItem, type PostListOptions, PostModel, ProjectController, ProjectModel, ReaderCommentDto, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyMetadata, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RecentlyTypeEnum, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TextBaseModelLexical, TextBaseModelMarkdown, ThirdPartyServiceIntegrationModel, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.mjs
CHANGED
|
@@ -426,14 +426,20 @@ var CommentController = class {
|
|
|
426
426
|
/**
|
|
427
427
|
* 评论
|
|
428
428
|
*/
|
|
429
|
-
|
|
430
|
-
return this.proxy(refId).post({ data });
|
|
429
|
+
guestComment(refId, data) {
|
|
430
|
+
return this.proxy.guest(refId).post({ data });
|
|
431
431
|
}
|
|
432
432
|
/**
|
|
433
433
|
* 回复评论
|
|
434
434
|
*/
|
|
435
|
-
|
|
436
|
-
return this.proxy.reply(commentId).post({ data });
|
|
435
|
+
guestReply(commentId, data) {
|
|
436
|
+
return this.proxy.guest.reply(commentId).post({ data });
|
|
437
|
+
}
|
|
438
|
+
readerComment(refId, data) {
|
|
439
|
+
return this.proxy.reader(refId).post({ data });
|
|
440
|
+
}
|
|
441
|
+
readerReply(commentId, data) {
|
|
442
|
+
return this.proxy.reader.reply(commentId).post({ data });
|
|
437
443
|
}
|
|
438
444
|
};
|
|
439
445
|
|
|
@@ -1245,6 +1251,17 @@ let RecentlyRefTypes = /* @__PURE__ */ function(RecentlyRefTypes) {
|
|
|
1245
1251
|
RecentlyRefTypes["Page"] = "Page";
|
|
1246
1252
|
return RecentlyRefTypes;
|
|
1247
1253
|
}({});
|
|
1254
|
+
let RecentlyTypeEnum = /* @__PURE__ */ function(RecentlyTypeEnum) {
|
|
1255
|
+
RecentlyTypeEnum["Text"] = "text";
|
|
1256
|
+
RecentlyTypeEnum["Book"] = "book";
|
|
1257
|
+
RecentlyTypeEnum["Media"] = "media";
|
|
1258
|
+
RecentlyTypeEnum["Music"] = "music";
|
|
1259
|
+
RecentlyTypeEnum["Github"] = "github";
|
|
1260
|
+
RecentlyTypeEnum["Link"] = "link";
|
|
1261
|
+
RecentlyTypeEnum["Academic"] = "academic";
|
|
1262
|
+
RecentlyTypeEnum["Code"] = "code";
|
|
1263
|
+
return RecentlyTypeEnum;
|
|
1264
|
+
}({});
|
|
1248
1265
|
|
|
1249
1266
|
//#endregion
|
|
1250
1267
|
//#region models/snippet.ts
|
|
@@ -1276,4 +1293,4 @@ const SubscribeTypeToBitMap = {
|
|
|
1276
1293
|
var api_client_default = createClient;
|
|
1277
1294
|
|
|
1278
1295
|
//#endregion
|
|
1279
|
-
export { AIController, AckController, ActivityController, AggregateController, CategoryController, CategoryType, CollectionRefTypes, CommentController, CommentState, EnumPageType, LinkController, LinkState, LinkType, NoteController, PageController, PostController, ProjectController, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyRefTypes, RequestError, SayController, SearchController, ServerlessController, SnippetController, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeTypeToBitMap, TimelineType, TopicController, UserController, allControllerNames, allControllers, createClient, api_client_default as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
1296
|
+
export { AIController, AckController, ActivityController, AggregateController, CategoryController, CategoryType, CollectionRefTypes, CommentController, CommentState, EnumPageType, LinkController, LinkState, LinkType, NoteController, PageController, PostController, ProjectController, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyRefTypes, RecentlyTypeEnum, RequestError, SayController, SearchController, ServerlessController, SnippetController, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeTypeToBitMap, TimelineType, TopicController, UserController, allControllerNames, allControllers, createClient, api_client_default as default, camelcaseKeys as simpleCamelcaseKeys };
|