@mx-space/api-client 3.5.0 → 3.6.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 CHANGED
@@ -633,6 +633,13 @@ var NoteController = class {
633
633
  ...sortOptions
634
634
  } });
635
635
  }
636
+ /**
637
+ * 获取专栏的最近更新时间(取该专栏下所有可见日记 max(modified, created))
638
+ * @param topicId 专栏 ID
639
+ */
640
+ getTopicRecentUpdate(topicId) {
641
+ return this.proxy.topics(topicId)["recent-update"].get();
642
+ }
636
643
  };
637
644
  //#endregion
638
645
  //#region controllers/owner.ts
package/dist/index.d.cts CHANGED
@@ -196,6 +196,13 @@ type ModelWithTranslation<T> = T & {
196
196
  isTranslated: boolean;
197
197
  translationMeta?: TranslationMeta;
198
198
  availableTranslations?: string[];
199
+ /**
200
+ * Whether AI insights are available in the caller's requested locale.
201
+ * Independent from `translationMeta` because insights maintain their own
202
+ * translation pipeline — the article may be translated without insights,
203
+ * and vice versa. Absent (undefined) on endpoints that don't surface it.
204
+ */
205
+ hasInsightsInLocale?: boolean;
199
206
  };
200
207
  //#endregion
201
208
  //#region models/post.d.ts
@@ -1681,7 +1688,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
1681
1688
  name: string;
1682
1689
  created: string;
1683
1690
  id: string;
1684
- children: Pick<PostModel, "id" | "created" | "title" | "slug" | "modified">[];
1691
+ children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
1685
1692
  } : T_1 : never : never;
1686
1693
  } : ResponseWrapper;
1687
1694
  $request: {
@@ -1733,7 +1740,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
1733
1740
  };
1734
1741
  }) ? T_1 extends unknown ? {
1735
1742
  tag: string;
1736
- data: Pick<PostModel, "category" | "id" | "created" | "title" | "slug">[];
1743
+ data: Pick<PostModel, "category" | "id" | "title" | "slug" | "created">[];
1737
1744
  } : T_1 : never : never;
1738
1745
  } : ResponseWrapper;
1739
1746
  $request: {
@@ -2062,6 +2069,26 @@ declare class NoteController<ResponseWrapper> implements IController {
2062
2069
  } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2063
2070
  data: PaginateResult<NoteTopicListItem>;
2064
2071
  }>;
2072
+ /**
2073
+ * 获取专栏的最近更新时间(取该专栏下所有可见日记 max(modified, created))
2074
+ * @param topicId 专栏 ID
2075
+ */
2076
+ getTopicRecentUpdate(topicId: string): RequestProxyResult<{
2077
+ ts: string | null;
2078
+ }, ResponseWrapper, ResponseWrapper extends unknown ? {
2079
+ [key: string]: any;
2080
+ data: {
2081
+ ts: string | null;
2082
+ };
2083
+ } : ResponseWrapper extends {
2084
+ data: {
2085
+ ts: string | null;
2086
+ };
2087
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2088
+ data: {
2089
+ ts: string | null;
2090
+ };
2091
+ }>;
2065
2092
  }
2066
2093
  //#endregion
2067
2094
  //#region controllers/owner.d.ts
@@ -2574,35 +2601,35 @@ declare class SearchController<ResponseWrapper> implements IController {
2574
2601
  search(type: 'note', keyword: string, options?: SearchOption): Promise<RequestProxyResult<PaginateResult<Pick<NoteModel, 'modified' | 'id' | 'title' | 'created' | 'nid'> & SearchResultHighlight>, ResponseWrapper>>;
2575
2602
  search(type: 'post', keyword: string, options?: SearchOption): Promise<RequestProxyResult<PaginateResult<Pick<PostModel, 'modified' | 'id' | 'title' | 'created' | 'slug' | 'category'> & SearchResultHighlight>, ResponseWrapper>>;
2576
2603
  search(type: 'page', keyword: string, options?: SearchOption): Promise<RequestProxyResult<PaginateResult<Pick<PageModel, 'modified' | 'id' | 'title' | 'created' | 'slug'> & SearchResultHighlight>, ResponseWrapper>>;
2577
- searchAll(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2604
+ searchAll(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2578
2605
  type: "post";
2579
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & SearchResultHighlight & {
2606
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & SearchResultHighlight & {
2580
2607
  type: "note";
2581
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2608
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2582
2609
  type: "page";
2583
2610
  })>, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
2584
2611
  [key: string]: any;
2585
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2612
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2586
2613
  type: "post";
2587
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & SearchResultHighlight & {
2614
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & SearchResultHighlight & {
2588
2615
  type: "note";
2589
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2616
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2590
2617
  type: "page";
2591
2618
  })>, ResponseWrapper>;
2592
2619
  } : ResponseWrapper extends {
2593
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2620
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2594
2621
  type: "post";
2595
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & SearchResultHighlight & {
2622
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & SearchResultHighlight & {
2596
2623
  type: "note";
2597
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2624
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2598
2625
  type: "page";
2599
2626
  })>, ResponseWrapper>;
2600
2627
  } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2601
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2628
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2602
2629
  type: "post";
2603
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & SearchResultHighlight & {
2630
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & SearchResultHighlight & {
2604
2631
  type: "note";
2605
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2632
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2606
2633
  type: "page";
2607
2634
  })>, ResponseWrapper>;
2608
2635
  }>;
package/dist/index.d.mts CHANGED
@@ -196,6 +196,13 @@ type ModelWithTranslation<T> = T & {
196
196
  isTranslated: boolean;
197
197
  translationMeta?: TranslationMeta;
198
198
  availableTranslations?: string[];
199
+ /**
200
+ * Whether AI insights are available in the caller's requested locale.
201
+ * Independent from `translationMeta` because insights maintain their own
202
+ * translation pipeline — the article may be translated without insights,
203
+ * and vice versa. Absent (undefined) on endpoints that don't surface it.
204
+ */
205
+ hasInsightsInLocale?: boolean;
199
206
  };
200
207
  //#endregion
201
208
  //#region models/post.d.ts
@@ -1681,7 +1688,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
1681
1688
  name: string;
1682
1689
  created: string;
1683
1690
  id: string;
1684
- children: Pick<PostModel, "id" | "created" | "title" | "slug" | "modified">[];
1691
+ children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
1685
1692
  } : T_1 : never : never;
1686
1693
  } : ResponseWrapper;
1687
1694
  $request: {
@@ -1733,7 +1740,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
1733
1740
  };
1734
1741
  }) ? T_1 extends unknown ? {
1735
1742
  tag: string;
1736
- data: Pick<PostModel, "category" | "id" | "created" | "title" | "slug">[];
1743
+ data: Pick<PostModel, "category" | "id" | "title" | "slug" | "created">[];
1737
1744
  } : T_1 : never : never;
1738
1745
  } : ResponseWrapper;
1739
1746
  $request: {
@@ -2062,6 +2069,26 @@ declare class NoteController<ResponseWrapper> implements IController {
2062
2069
  } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2063
2070
  data: PaginateResult<NoteTopicListItem>;
2064
2071
  }>;
2072
+ /**
2073
+ * 获取专栏的最近更新时间(取该专栏下所有可见日记 max(modified, created))
2074
+ * @param topicId 专栏 ID
2075
+ */
2076
+ getTopicRecentUpdate(topicId: string): RequestProxyResult<{
2077
+ ts: string | null;
2078
+ }, ResponseWrapper, ResponseWrapper extends unknown ? {
2079
+ [key: string]: any;
2080
+ data: {
2081
+ ts: string | null;
2082
+ };
2083
+ } : ResponseWrapper extends {
2084
+ data: {
2085
+ ts: string | null;
2086
+ };
2087
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2088
+ data: {
2089
+ ts: string | null;
2090
+ };
2091
+ }>;
2065
2092
  }
2066
2093
  //#endregion
2067
2094
  //#region controllers/owner.d.ts
@@ -2574,35 +2601,35 @@ declare class SearchController<ResponseWrapper> implements IController {
2574
2601
  search(type: 'note', keyword: string, options?: SearchOption): Promise<RequestProxyResult<PaginateResult<Pick<NoteModel, 'modified' | 'id' | 'title' | 'created' | 'nid'> & SearchResultHighlight>, ResponseWrapper>>;
2575
2602
  search(type: 'post', keyword: string, options?: SearchOption): Promise<RequestProxyResult<PaginateResult<Pick<PostModel, 'modified' | 'id' | 'title' | 'created' | 'slug' | 'category'> & SearchResultHighlight>, ResponseWrapper>>;
2576
2603
  search(type: 'page', keyword: string, options?: SearchOption): Promise<RequestProxyResult<PaginateResult<Pick<PageModel, 'modified' | 'id' | 'title' | 'created' | 'slug'> & SearchResultHighlight>, ResponseWrapper>>;
2577
- searchAll(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2604
+ searchAll(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2578
2605
  type: "post";
2579
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & SearchResultHighlight & {
2606
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & SearchResultHighlight & {
2580
2607
  type: "note";
2581
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2608
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2582
2609
  type: "page";
2583
2610
  })>, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
2584
2611
  [key: string]: any;
2585
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2612
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2586
2613
  type: "post";
2587
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & SearchResultHighlight & {
2614
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & SearchResultHighlight & {
2588
2615
  type: "note";
2589
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2616
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2590
2617
  type: "page";
2591
2618
  })>, ResponseWrapper>;
2592
2619
  } : ResponseWrapper extends {
2593
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2620
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2594
2621
  type: "post";
2595
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & SearchResultHighlight & {
2622
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & SearchResultHighlight & {
2596
2623
  type: "note";
2597
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2624
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2598
2625
  type: "page";
2599
2626
  })>, ResponseWrapper>;
2600
2627
  } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2601
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2628
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2602
2629
  type: "post";
2603
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & SearchResultHighlight & {
2630
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & SearchResultHighlight & {
2604
2631
  type: "note";
2605
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & SearchResultHighlight & {
2632
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & SearchResultHighlight & {
2606
2633
  type: "page";
2607
2634
  })>, ResponseWrapper>;
2608
2635
  }>;
package/dist/index.mjs CHANGED
@@ -629,6 +629,13 @@ var NoteController = class {
629
629
  ...sortOptions
630
630
  } });
631
631
  }
632
+ /**
633
+ * 获取专栏的最近更新时间(取该专栏下所有可见日记 max(modified, created))
634
+ * @param topicId 专栏 ID
635
+ */
636
+ getTopicRecentUpdate(topicId) {
637
+ return this.proxy.topics(topicId)["recent-update"].get();
638
+ }
632
639
  };
633
640
  //#endregion
634
641
  //#region controllers/owner.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/api-client",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "description": "A api client for mx-space server@next",
5
5
  "type": "module",
6
6
  "engines": {
@@ -53,15 +53,15 @@
53
53
  "@types/cors": "2.8.19",
54
54
  "@types/express": "5.0.6",
55
55
  "abort-controller": "3.0.0",
56
- "axios": "^1.15.0",
56
+ "axios": "^1.15.2",
57
57
  "camelcase-keys": "^10.0.2",
58
58
  "cors": "2.8.6",
59
- "es-toolkit": "1.45.1",
59
+ "es-toolkit": "1.46.0",
60
60
  "express": "5.2.1",
61
61
  "form-data": "4.0.5",
62
- "tsdown": "0.21.9",
62
+ "tsdown": "0.21.10",
63
63
  "umi-request": "1.4.0",
64
- "vite": "^8.0.8",
65
- "vitest": "4.1.4"
64
+ "vite": "^8.0.10",
65
+ "vitest": "4.1.5"
66
66
  }
67
67
  }