@mx-space/api-client 1.21.0 → 1.21.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/dist/index.cjs +16 -3
- package/dist/index.d.cts +45 -24
- package/dist/index.d.mts +45 -24
- package/dist/index.mjs +16 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -455,17 +455,30 @@ var NoteController = class {
|
|
|
455
455
|
}
|
|
456
456
|
/**
|
|
457
457
|
* 获取当前日记的上下各 n / 2 篇日记
|
|
458
|
+
* @param id 当前日记 ID
|
|
459
|
+
* @param size 返回数量,默认 5
|
|
460
|
+
* @param options 可选参数,包含 lang 用于获取翻译版本
|
|
458
461
|
*/
|
|
459
|
-
getMiddleList(id, size = 5) {
|
|
460
|
-
|
|
462
|
+
getMiddleList(id, size = 5, options) {
|
|
463
|
+
const { lang } = options || {};
|
|
464
|
+
return this.proxy.list(id).get({ params: {
|
|
465
|
+
size,
|
|
466
|
+
lang
|
|
467
|
+
} });
|
|
461
468
|
}
|
|
462
469
|
/**
|
|
463
470
|
* 获取专栏内的所有日记
|
|
471
|
+
* @param topicId 专栏 ID
|
|
472
|
+
* @param page 页码,默认 1
|
|
473
|
+
* @param size 每页数量,默认 10
|
|
474
|
+
* @param options 可选参数,包含排序选项和 lang 用于获取翻译版本
|
|
464
475
|
*/
|
|
465
|
-
getNoteByTopicId(topicId, page = 1, size = 10,
|
|
476
|
+
getNoteByTopicId(topicId, page = 1, size = 10, options = {}) {
|
|
477
|
+
const { lang, ...sortOptions } = options;
|
|
466
478
|
return this.proxy.topics(topicId).get({ params: {
|
|
467
479
|
page,
|
|
468
480
|
size,
|
|
481
|
+
lang,
|
|
469
482
|
...sortOptions
|
|
470
483
|
} });
|
|
471
484
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1134,7 +1134,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1134
1134
|
name: string;
|
|
1135
1135
|
created: string;
|
|
1136
1136
|
id: string;
|
|
1137
|
-
children: Pick<PostModel, "id" | "
|
|
1137
|
+
children: Pick<PostModel, "id" | "created" | "title" | "slug" | "modified">[];
|
|
1138
1138
|
} : T_1 : never : never;
|
|
1139
1139
|
} : ResponseWrapper;
|
|
1140
1140
|
$request: {
|
|
@@ -1186,7 +1186,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1186
1186
|
};
|
|
1187
1187
|
}) ? T_1 extends unknown ? {
|
|
1188
1188
|
tag: string;
|
|
1189
|
-
data: Pick<PostModel, "category" | "id" | "
|
|
1189
|
+
data: Pick<PostModel, "category" | "id" | "created" | "title" | "slug">[];
|
|
1190
1190
|
} : T_1 : never : never;
|
|
1191
1191
|
} : ResponseWrapper;
|
|
1192
1192
|
$request: {
|
|
@@ -1377,6 +1377,20 @@ type NoteByNidOptions = {
|
|
|
1377
1377
|
single?: boolean;
|
|
1378
1378
|
lang?: string;
|
|
1379
1379
|
};
|
|
1380
|
+
type NoteMiddleListOptions = {
|
|
1381
|
+
lang?: string;
|
|
1382
|
+
};
|
|
1383
|
+
type NoteTopicListOptions = SortOptions & {
|
|
1384
|
+
lang?: string;
|
|
1385
|
+
};
|
|
1386
|
+
type NoteTimelineItem = Pick<NoteModel, 'id' | 'title' | 'nid' | 'created' | 'isPublished'> & {
|
|
1387
|
+
isTranslated?: boolean;
|
|
1388
|
+
translationMeta?: TranslationMeta;
|
|
1389
|
+
};
|
|
1390
|
+
type NoteTopicListItem = NoteModel & {
|
|
1391
|
+
isTranslated?: boolean;
|
|
1392
|
+
translationMeta?: TranslationMeta;
|
|
1393
|
+
};
|
|
1380
1394
|
declare class NoteController<ResponseWrapper> implements IController {
|
|
1381
1395
|
private client;
|
|
1382
1396
|
base: string;
|
|
@@ -1423,37 +1437,44 @@ declare class NoteController<ResponseWrapper> implements IController {
|
|
|
1423
1437
|
}>;
|
|
1424
1438
|
/**
|
|
1425
1439
|
* 获取当前日记的上下各 n / 2 篇日记
|
|
1440
|
+
* @param id 当前日记 ID
|
|
1441
|
+
* @param size 返回数量,默认 5
|
|
1442
|
+
* @param options 可选参数,包含 lang 用于获取翻译版本
|
|
1426
1443
|
*/
|
|
1427
|
-
getMiddleList(id: string, size?: number): RequestProxyResult<{
|
|
1428
|
-
data:
|
|
1444
|
+
getMiddleList(id: string, size?: number, options?: NoteMiddleListOptions): RequestProxyResult<{
|
|
1445
|
+
data: NoteTimelineItem[];
|
|
1429
1446
|
size: number;
|
|
1430
1447
|
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1431
1448
|
[key: string]: any;
|
|
1432
1449
|
data: {
|
|
1433
|
-
data:
|
|
1450
|
+
data: NoteTimelineItem[];
|
|
1434
1451
|
size: number;
|
|
1435
1452
|
};
|
|
1436
1453
|
} : ResponseWrapper extends {
|
|
1437
1454
|
data: {
|
|
1438
|
-
data:
|
|
1455
|
+
data: NoteTimelineItem[];
|
|
1439
1456
|
size: number;
|
|
1440
1457
|
};
|
|
1441
1458
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1442
1459
|
data: {
|
|
1443
|
-
data:
|
|
1460
|
+
data: NoteTimelineItem[];
|
|
1444
1461
|
size: number;
|
|
1445
1462
|
};
|
|
1446
1463
|
}>;
|
|
1447
1464
|
/**
|
|
1448
1465
|
* 获取专栏内的所有日记
|
|
1466
|
+
* @param topicId 专栏 ID
|
|
1467
|
+
* @param page 页码,默认 1
|
|
1468
|
+
* @param size 每页数量,默认 10
|
|
1469
|
+
* @param options 可选参数,包含排序选项和 lang 用于获取翻译版本
|
|
1449
1470
|
*/
|
|
1450
|
-
getNoteByTopicId(topicId: string, page?: number, size?: number,
|
|
1471
|
+
getNoteByTopicId(topicId: string, page?: number, size?: number, options?: NoteTopicListOptions): RequestProxyResult<PaginateResult<NoteTopicListItem>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1451
1472
|
[key: string]: any;
|
|
1452
|
-
data: PaginateResult<
|
|
1473
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1453
1474
|
} : ResponseWrapper extends {
|
|
1454
|
-
data: PaginateResult<
|
|
1475
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1455
1476
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1456
|
-
data: PaginateResult<
|
|
1477
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1457
1478
|
}>;
|
|
1458
1479
|
}
|
|
1459
1480
|
//#endregion
|
|
@@ -1797,11 +1818,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1797
1818
|
* @param options
|
|
1798
1819
|
* @returns
|
|
1799
1820
|
*/
|
|
1800
|
-
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1821
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1801
1822
|
type: "post";
|
|
1802
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1823
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1803
1824
|
type: "note";
|
|
1804
|
-
}) | (Pick<PageModel, "id" | "
|
|
1825
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1805
1826
|
type: "page";
|
|
1806
1827
|
})> & {
|
|
1807
1828
|
/**
|
|
@@ -1810,11 +1831,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1810
1831
|
raw?: any;
|
|
1811
1832
|
}, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1812
1833
|
[key: string]: any;
|
|
1813
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1834
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1814
1835
|
type: "post";
|
|
1815
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1836
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1816
1837
|
type: "note";
|
|
1817
|
-
}) | (Pick<PageModel, "id" | "
|
|
1838
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1818
1839
|
type: "page";
|
|
1819
1840
|
})> & {
|
|
1820
1841
|
/**
|
|
@@ -1823,11 +1844,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1823
1844
|
raw?: any;
|
|
1824
1845
|
}, ResponseWrapper>;
|
|
1825
1846
|
} : ResponseWrapper extends {
|
|
1826
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1847
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1827
1848
|
type: "post";
|
|
1828
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1849
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1829
1850
|
type: "note";
|
|
1830
|
-
}) | (Pick<PageModel, "id" | "
|
|
1851
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1831
1852
|
type: "page";
|
|
1832
1853
|
})> & {
|
|
1833
1854
|
/**
|
|
@@ -1836,11 +1857,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1836
1857
|
raw?: any;
|
|
1837
1858
|
}, ResponseWrapper>;
|
|
1838
1859
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1839
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1860
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1840
1861
|
type: "post";
|
|
1841
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1862
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1842
1863
|
type: "note";
|
|
1843
|
-
}) | (Pick<PageModel, "id" | "
|
|
1864
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1844
1865
|
type: "page";
|
|
1845
1866
|
})> & {
|
|
1846
1867
|
/**
|
|
@@ -2056,4 +2077,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
|
|
|
2056
2077
|
*/
|
|
2057
2078
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
2058
2079
|
//#endregion
|
|
2059
|
-
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, ModelWithTranslation, NoteController, NoteModel, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, 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, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
2080
|
+
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, ModelWithTranslation, NoteController, type NoteMiddleListOptions, NoteModel, type NoteTimelineItem, type NoteTopicListItem, type NoteTopicListOptions, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, 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, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.d.mts
CHANGED
|
@@ -1134,7 +1134,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1134
1134
|
name: string;
|
|
1135
1135
|
created: string;
|
|
1136
1136
|
id: string;
|
|
1137
|
-
children: Pick<PostModel, "id" | "
|
|
1137
|
+
children: Pick<PostModel, "id" | "created" | "title" | "slug" | "modified">[];
|
|
1138
1138
|
} : T_1 : never : never;
|
|
1139
1139
|
} : ResponseWrapper;
|
|
1140
1140
|
$request: {
|
|
@@ -1186,7 +1186,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
1186
1186
|
};
|
|
1187
1187
|
}) ? T_1 extends unknown ? {
|
|
1188
1188
|
tag: string;
|
|
1189
|
-
data: Pick<PostModel, "category" | "id" | "
|
|
1189
|
+
data: Pick<PostModel, "category" | "id" | "created" | "title" | "slug">[];
|
|
1190
1190
|
} : T_1 : never : never;
|
|
1191
1191
|
} : ResponseWrapper;
|
|
1192
1192
|
$request: {
|
|
@@ -1377,6 +1377,20 @@ type NoteByNidOptions = {
|
|
|
1377
1377
|
single?: boolean;
|
|
1378
1378
|
lang?: string;
|
|
1379
1379
|
};
|
|
1380
|
+
type NoteMiddleListOptions = {
|
|
1381
|
+
lang?: string;
|
|
1382
|
+
};
|
|
1383
|
+
type NoteTopicListOptions = SortOptions & {
|
|
1384
|
+
lang?: string;
|
|
1385
|
+
};
|
|
1386
|
+
type NoteTimelineItem = Pick<NoteModel, 'id' | 'title' | 'nid' | 'created' | 'isPublished'> & {
|
|
1387
|
+
isTranslated?: boolean;
|
|
1388
|
+
translationMeta?: TranslationMeta;
|
|
1389
|
+
};
|
|
1390
|
+
type NoteTopicListItem = NoteModel & {
|
|
1391
|
+
isTranslated?: boolean;
|
|
1392
|
+
translationMeta?: TranslationMeta;
|
|
1393
|
+
};
|
|
1380
1394
|
declare class NoteController<ResponseWrapper> implements IController {
|
|
1381
1395
|
private client;
|
|
1382
1396
|
base: string;
|
|
@@ -1423,37 +1437,44 @@ declare class NoteController<ResponseWrapper> implements IController {
|
|
|
1423
1437
|
}>;
|
|
1424
1438
|
/**
|
|
1425
1439
|
* 获取当前日记的上下各 n / 2 篇日记
|
|
1440
|
+
* @param id 当前日记 ID
|
|
1441
|
+
* @param size 返回数量,默认 5
|
|
1442
|
+
* @param options 可选参数,包含 lang 用于获取翻译版本
|
|
1426
1443
|
*/
|
|
1427
|
-
getMiddleList(id: string, size?: number): RequestProxyResult<{
|
|
1428
|
-
data:
|
|
1444
|
+
getMiddleList(id: string, size?: number, options?: NoteMiddleListOptions): RequestProxyResult<{
|
|
1445
|
+
data: NoteTimelineItem[];
|
|
1429
1446
|
size: number;
|
|
1430
1447
|
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1431
1448
|
[key: string]: any;
|
|
1432
1449
|
data: {
|
|
1433
|
-
data:
|
|
1450
|
+
data: NoteTimelineItem[];
|
|
1434
1451
|
size: number;
|
|
1435
1452
|
};
|
|
1436
1453
|
} : ResponseWrapper extends {
|
|
1437
1454
|
data: {
|
|
1438
|
-
data:
|
|
1455
|
+
data: NoteTimelineItem[];
|
|
1439
1456
|
size: number;
|
|
1440
1457
|
};
|
|
1441
1458
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1442
1459
|
data: {
|
|
1443
|
-
data:
|
|
1460
|
+
data: NoteTimelineItem[];
|
|
1444
1461
|
size: number;
|
|
1445
1462
|
};
|
|
1446
1463
|
}>;
|
|
1447
1464
|
/**
|
|
1448
1465
|
* 获取专栏内的所有日记
|
|
1466
|
+
* @param topicId 专栏 ID
|
|
1467
|
+
* @param page 页码,默认 1
|
|
1468
|
+
* @param size 每页数量,默认 10
|
|
1469
|
+
* @param options 可选参数,包含排序选项和 lang 用于获取翻译版本
|
|
1449
1470
|
*/
|
|
1450
|
-
getNoteByTopicId(topicId: string, page?: number, size?: number,
|
|
1471
|
+
getNoteByTopicId(topicId: string, page?: number, size?: number, options?: NoteTopicListOptions): RequestProxyResult<PaginateResult<NoteTopicListItem>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1451
1472
|
[key: string]: any;
|
|
1452
|
-
data: PaginateResult<
|
|
1473
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1453
1474
|
} : ResponseWrapper extends {
|
|
1454
|
-
data: PaginateResult<
|
|
1475
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1455
1476
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1456
|
-
data: PaginateResult<
|
|
1477
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1457
1478
|
}>;
|
|
1458
1479
|
}
|
|
1459
1480
|
//#endregion
|
|
@@ -1797,11 +1818,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1797
1818
|
* @param options
|
|
1798
1819
|
* @returns
|
|
1799
1820
|
*/
|
|
1800
|
-
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1821
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1801
1822
|
type: "post";
|
|
1802
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1823
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1803
1824
|
type: "note";
|
|
1804
|
-
}) | (Pick<PageModel, "id" | "
|
|
1825
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1805
1826
|
type: "page";
|
|
1806
1827
|
})> & {
|
|
1807
1828
|
/**
|
|
@@ -1810,11 +1831,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1810
1831
|
raw?: any;
|
|
1811
1832
|
}, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1812
1833
|
[key: string]: any;
|
|
1813
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1834
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1814
1835
|
type: "post";
|
|
1815
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1836
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1816
1837
|
type: "note";
|
|
1817
|
-
}) | (Pick<PageModel, "id" | "
|
|
1838
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1818
1839
|
type: "page";
|
|
1819
1840
|
})> & {
|
|
1820
1841
|
/**
|
|
@@ -1823,11 +1844,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1823
1844
|
raw?: any;
|
|
1824
1845
|
}, ResponseWrapper>;
|
|
1825
1846
|
} : ResponseWrapper extends {
|
|
1826
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1847
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1827
1848
|
type: "post";
|
|
1828
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1849
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1829
1850
|
type: "note";
|
|
1830
|
-
}) | (Pick<PageModel, "id" | "
|
|
1851
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1831
1852
|
type: "page";
|
|
1832
1853
|
})> & {
|
|
1833
1854
|
/**
|
|
@@ -1836,11 +1857,11 @@ declare class SearchController<ResponseWrapper> implements IController {
|
|
|
1836
1857
|
raw?: any;
|
|
1837
1858
|
}, ResponseWrapper>;
|
|
1838
1859
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1839
|
-
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "
|
|
1860
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1840
1861
|
type: "post";
|
|
1841
|
-
}) | (Pick<NoteModel, "id" | "
|
|
1862
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
1842
1863
|
type: "note";
|
|
1843
|
-
}) | (Pick<PageModel, "id" | "
|
|
1864
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
1844
1865
|
type: "page";
|
|
1845
1866
|
})> & {
|
|
1846
1867
|
/**
|
|
@@ -2056,4 +2077,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
|
|
|
2056
2077
|
*/
|
|
2057
2078
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
2058
2079
|
//#endregion
|
|
2059
|
-
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, ModelWithTranslation, NoteController, NoteModel, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, 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, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
2080
|
+
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, ModelWithTranslation, NoteController, type NoteMiddleListOptions, NoteModel, type NoteTimelineItem, type NoteTopicListItem, type NoteTopicListOptions, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, 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, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.mjs
CHANGED
|
@@ -453,17 +453,30 @@ var NoteController = class {
|
|
|
453
453
|
}
|
|
454
454
|
/**
|
|
455
455
|
* 获取当前日记的上下各 n / 2 篇日记
|
|
456
|
+
* @param id 当前日记 ID
|
|
457
|
+
* @param size 返回数量,默认 5
|
|
458
|
+
* @param options 可选参数,包含 lang 用于获取翻译版本
|
|
456
459
|
*/
|
|
457
|
-
getMiddleList(id, size = 5) {
|
|
458
|
-
|
|
460
|
+
getMiddleList(id, size = 5, options) {
|
|
461
|
+
const { lang } = options || {};
|
|
462
|
+
return this.proxy.list(id).get({ params: {
|
|
463
|
+
size,
|
|
464
|
+
lang
|
|
465
|
+
} });
|
|
459
466
|
}
|
|
460
467
|
/**
|
|
461
468
|
* 获取专栏内的所有日记
|
|
469
|
+
* @param topicId 专栏 ID
|
|
470
|
+
* @param page 页码,默认 1
|
|
471
|
+
* @param size 每页数量,默认 10
|
|
472
|
+
* @param options 可选参数,包含排序选项和 lang 用于获取翻译版本
|
|
462
473
|
*/
|
|
463
|
-
getNoteByTopicId(topicId, page = 1, size = 10,
|
|
474
|
+
getNoteByTopicId(topicId, page = 1, size = 10, options = {}) {
|
|
475
|
+
const { lang, ...sortOptions } = options;
|
|
464
476
|
return this.proxy.topics(topicId).get({ params: {
|
|
465
477
|
page,
|
|
466
478
|
size,
|
|
479
|
+
lang,
|
|
467
480
|
...sortOptions
|
|
468
481
|
} });
|
|
469
482
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.2",
|
|
4
4
|
"description": "A api client for mx-space server@next",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"vitest": "4.0.18"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
|
-
"package": "rm -rf dist && tsdown
|
|
61
|
+
"package": "rm -rf dist && tsdown",
|
|
62
62
|
"build": "npm run package",
|
|
63
63
|
"prepackage": "rm -rf dist",
|
|
64
64
|
"test": "vitest",
|