@mx-space/api-client 1.16.0 → 1.17.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.
Files changed (38) hide show
  1. package/controllers/ai.ts +11 -1
  2. package/controllers/index.ts +3 -3
  3. package/dist/adaptors/axios.global.js +1119 -239
  4. package/dist/adaptors/umi-request.global.js +1513 -1267
  5. package/dist/index.cjs +17 -10
  6. package/dist/index.d.cts +53 -1
  7. package/dist/index.d.ts +53 -1
  8. package/dist/index.global.js +13 -6
  9. package/dist/index.js +14 -7
  10. package/esm/packages/api-client/adaptors/axios.js +1 -1
  11. package/esm/packages/api-client/adaptors/ky.js +1 -1
  12. package/esm/packages/api-client/adaptors/umi-request.js +1 -1
  13. package/esm/packages/api-client/controllers/index.d.ts +1 -1
  14. package/esm/packages/api-client/controllers/index.js +3 -3
  15. package/esm/packages/api-client/controllers/recently.js +4 -4
  16. package/esm/packages/api-client/core/attach-request.js +1 -1
  17. package/esm/packages/api-client/core/client.js +11 -11
  18. package/esm/packages/api-client/index.js +1 -1
  19. package/esm/packages/api-client/models/aggregate.js +2 -2
  20. package/esm/packages/api-client/models/category.js +2 -2
  21. package/esm/packages/api-client/models/comment.js +6 -6
  22. package/esm/packages/api-client/models/link.js +7 -7
  23. package/esm/packages/api-client/models/page.js +3 -3
  24. package/esm/packages/api-client/models/recently.js +3 -3
  25. package/esm/packages/api-client/models/snippet.js +4 -4
  26. package/esm/packages/api-client/tsup.config.js +2 -2
  27. package/esm/packages/api-client/utils/camelcase-keys.js +1 -1
  28. package/esm/packages/api-client/vitest.config.js +1 -1
  29. package/index.ts +0 -1
  30. package/mod-dts.mjs +3 -3
  31. package/models/aggregate.ts +0 -2
  32. package/models/ai.ts +9 -0
  33. package/models/comment.ts +1 -0
  34. package/models/setting.ts +5 -0
  35. package/package.json +23 -23
  36. package/readme.md +3 -3
  37. package/tsconfig.json +11 -11
  38. package/vitest.config.ts +0 -1
package/dist/index.cjs CHANGED
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // index.ts
21
- var api_client_exports = {};
22
- __export(api_client_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  AIController: () => AIController,
24
24
  AckController: () => AckController,
25
25
  ActivityController: () => ActivityController,
@@ -60,10 +60,10 @@ __export(api_client_exports, {
60
60
  allControllerNames: () => allControllerNames,
61
61
  allControllers: () => allControllers,
62
62
  createClient: () => createClient,
63
- default: () => api_client_default,
63
+ default: () => index_default,
64
64
  simpleCamelcaseKeys: () => camelcaseKeys
65
65
  });
66
- module.exports = __toCommonJS(api_client_exports);
66
+ module.exports = __toCommonJS(index_exports);
67
67
 
68
68
  // utils/index.ts
69
69
  var isPlainObject = (obj) => isObject(obj) && Object.prototype.toString.call(obj) === "[object Object]" && Object.getPrototypeOf(obj) === Object.prototype;
@@ -124,7 +124,7 @@ function camelcase(str) {
124
124
  return $1.toUpperCase().replace("-", "").replace("_", "");
125
125
  });
126
126
  }
127
- var isMongoId = (id) => id.length === 24 && /^[\dA-Fa-f]{24}$/.test(id);
127
+ var isMongoId = (id) => id.length === 24 && /^[\dA-F]{24}$/i.test(id);
128
128
 
129
129
  // utils/path.ts
130
130
  var resolveFullPath = (endpoint, path) => {
@@ -336,6 +336,13 @@ var AIController = class {
336
336
  }
337
337
  });
338
338
  }
339
+ /**
340
+ * Core >= 8.3.0
341
+ * @param articleId
342
+ */
343
+ async getDeepReading(articleId) {
344
+ return this.proxy("deep-readings").article(articleId).get();
345
+ }
339
346
  };
340
347
 
341
348
  // core/error.ts
@@ -912,10 +919,10 @@ var UserController = class {
912
919
 
913
920
  // controllers/index.ts
914
921
  var allControllers = [
915
- AIController,
916
922
  AckController,
917
923
  ActivityController,
918
924
  AggregateController,
925
+ AIController,
919
926
  CategoryController,
920
927
  CommentController,
921
928
  LinkController,
@@ -924,12 +931,12 @@ var allControllers = [
924
931
  PostController,
925
932
  ProjectController,
926
933
  RecentlyController,
927
- TopicController,
928
934
  SayController,
929
935
  SearchController,
930
- SnippetController,
931
936
  ServerlessController,
937
+ SnippetController,
932
938
  SubscribeController,
939
+ TopicController,
933
940
  UserController
934
941
  ];
935
942
  var allControllerNames = [
@@ -964,7 +971,7 @@ function attachRequestMethod(target) {
964
971
  value(url, options) {
965
972
  const { params = {}, ...rest } = options;
966
973
  const qs = handleSearchParams(params);
967
- return target.instance.get(`${url}${qs ? `${`?${qs}`}` : ""}`, rest);
974
+ return target.instance.get(`${url}${qs ? String(`?${qs}`) : ""}`, rest);
968
975
  }
969
976
  });
970
977
  ["put", "post", "patch", "delete"].forEach((method) => {
@@ -1254,7 +1261,7 @@ var SubscribeTypeToBitMap = {
1254
1261
  };
1255
1262
 
1256
1263
  // index.ts
1257
- var api_client_default = createClient;
1264
+ var index_default = createClient;
1258
1265
  // Annotate the CommonJS export names for ESM import in node:
1259
1266
  0 && (module.exports = {
1260
1267
  AIController,
package/dist/index.d.cts CHANGED
@@ -424,6 +424,10 @@ declare class BaiduSearchOptionsModel {
424
424
  enable: boolean;
425
425
  token?: string;
426
426
  }
427
+ declare class BingSearchOptionsModel {
428
+ enable: boolean;
429
+ token?: string;
430
+ }
427
431
  declare class AlgoliaSearchOptionsModel {
428
432
  enable: boolean;
429
433
  apiKey?: string;
@@ -541,6 +545,14 @@ interface AISummaryModel {
541
545
  refId: string;
542
546
  lang: string;
543
547
  }
548
+ interface AIDeepReadingModel {
549
+ id: string;
550
+ hash: string;
551
+ refId: string;
552
+ keyPoints: string[];
553
+ criticalAnalysis: string;
554
+ content: string;
555
+ }
544
556
 
545
557
  interface AuthUser {
546
558
  id: string;
@@ -572,6 +584,7 @@ interface CommentModel extends BaseModel {
572
584
  location?: string;
573
585
  source?: string;
574
586
  readerId?: string;
587
+ editedAt?: string;
575
588
  }
576
589
  interface CommentRef {
577
590
  id: string;
@@ -970,6 +983,45 @@ declare class AIController<ResponseWrapper> implements IController {
970
983
  };
971
984
  $serialized: AISummaryModel;
972
985
  }>;
986
+ /**
987
+ * Core >= 8.3.0
988
+ * @param articleId
989
+ */
990
+ getDeepReading(articleId: string): Promise<AIDeepReadingModel & {
991
+ $raw: ResponseWrapper extends {
992
+ data: infer T;
993
+ } ? ResponseWrapper : ResponseWrapper extends unknown ? {
994
+ [i: string]: any;
995
+ data: (ResponseWrapper extends unknown ? {
996
+ [key: string]: any;
997
+ data: AIDeepReadingModel;
998
+ } : ResponseWrapper extends {
999
+ data: AIDeepReadingModel;
1000
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1001
+ data: AIDeepReadingModel;
1002
+ }) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
1003
+ [key: string]: any;
1004
+ data: AIDeepReadingModel;
1005
+ } : ResponseWrapper extends {
1006
+ data: AIDeepReadingModel;
1007
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1008
+ data: AIDeepReadingModel;
1009
+ }) ? T_1 extends unknown ? {
1010
+ id: string;
1011
+ hash: string;
1012
+ ref_id: string;
1013
+ key_points: string[];
1014
+ critical_analysis: string;
1015
+ content: string;
1016
+ } : T_1 : never : never;
1017
+ } : ResponseWrapper;
1018
+ $request: {
1019
+ path: string;
1020
+ method: string;
1021
+ [k: string]: string;
1022
+ };
1023
+ $serialized: AIDeepReadingModel;
1024
+ }>;
973
1025
  }
974
1026
 
975
1027
  declare module '../core/client' {
@@ -1897,4 +1949,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
1897
1949
  */
1898
1950
  declare const camelcaseKeys: <T = any>(obj: any) => T;
1899
1951
 
1900
- export { AIController, type AISummaryModel, AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, type AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, type BaseCommentIndexModel, type BaseModel, CategoryController, type CategoryEntries, type CategoryModel, CategoryType, type CategoryWithChildrenModel, CollectionRefTypes, CommentController, type CommentDto, type CommentModel, CommentOptionsModel, type CommentRef, CommentState, type Coordinate, type Count, EnumPageType, HTTPClient, type IConfig, type IConfigKeys, IRequestAdapter, type Image, type LastYearPublication, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteWrappedPayload, type NoteWrappedWithLikedPayload, PageController, type PageModel, type Pager, type PaginateResult, PostController, type PostModel, ProjectController, type ProjectModel, type ReaderModel, type RecentActivities, type RecentComment, type RecentLike, type RecentNote, type RecentPost, type RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, type RecentlyModel, type RecentlyRefType, RecentlyRefTypes, RequestError, type RoomOmittedNote, type RoomOmittedPage, type RoomOmittedPost, type RoomsData, SayController, type SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, type SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, type SubscribeType, SubscribeTypeToBitMap, type TLogin, type TagModel, type TextBaseModel, type TimelineData, TimelineType, TopicController, type TopicModel, type Url, UrlOptionModel, UserController, type UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
1952
+ export { AIController, type AIDeepReadingModel, type AISummaryModel, AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, type AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, type BaseCommentIndexModel, type BaseModel, BingSearchOptionsModel, CategoryController, type CategoryEntries, type CategoryModel, CategoryType, type CategoryWithChildrenModel, CollectionRefTypes, CommentController, type CommentDto, type CommentModel, CommentOptionsModel, type CommentRef, CommentState, type Coordinate, type Count, EnumPageType, HTTPClient, type IConfig, type IConfigKeys, IRequestAdapter, type Image, type LastYearPublication, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteWrappedPayload, type NoteWrappedWithLikedPayload, PageController, type PageModel, type Pager, type PaginateResult, PostController, type PostModel, ProjectController, type ProjectModel, type ReaderModel, type RecentActivities, type RecentComment, type RecentLike, type RecentNote, type RecentPost, type RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, type RecentlyModel, type RecentlyRefType, RecentlyRefTypes, RequestError, type RoomOmittedNote, type RoomOmittedPage, type RoomOmittedPost, type RoomsData, SayController, type SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, type SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, type SubscribeType, SubscribeTypeToBitMap, type TLogin, type TagModel, type TextBaseModel, type TimelineData, TimelineType, TopicController, type TopicModel, type Url, UrlOptionModel, UserController, type UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
package/dist/index.d.ts CHANGED
@@ -424,6 +424,10 @@ declare class BaiduSearchOptionsModel {
424
424
  enable: boolean;
425
425
  token?: string;
426
426
  }
427
+ declare class BingSearchOptionsModel {
428
+ enable: boolean;
429
+ token?: string;
430
+ }
427
431
  declare class AlgoliaSearchOptionsModel {
428
432
  enable: boolean;
429
433
  apiKey?: string;
@@ -541,6 +545,14 @@ interface AISummaryModel {
541
545
  refId: string;
542
546
  lang: string;
543
547
  }
548
+ interface AIDeepReadingModel {
549
+ id: string;
550
+ hash: string;
551
+ refId: string;
552
+ keyPoints: string[];
553
+ criticalAnalysis: string;
554
+ content: string;
555
+ }
544
556
 
545
557
  interface AuthUser {
546
558
  id: string;
@@ -572,6 +584,7 @@ interface CommentModel extends BaseModel {
572
584
  location?: string;
573
585
  source?: string;
574
586
  readerId?: string;
587
+ editedAt?: string;
575
588
  }
576
589
  interface CommentRef {
577
590
  id: string;
@@ -970,6 +983,45 @@ declare class AIController<ResponseWrapper> implements IController {
970
983
  };
971
984
  $serialized: AISummaryModel;
972
985
  }>;
986
+ /**
987
+ * Core >= 8.3.0
988
+ * @param articleId
989
+ */
990
+ getDeepReading(articleId: string): Promise<AIDeepReadingModel & {
991
+ $raw: ResponseWrapper extends {
992
+ data: infer T;
993
+ } ? ResponseWrapper : ResponseWrapper extends unknown ? {
994
+ [i: string]: any;
995
+ data: (ResponseWrapper extends unknown ? {
996
+ [key: string]: any;
997
+ data: AIDeepReadingModel;
998
+ } : ResponseWrapper extends {
999
+ data: AIDeepReadingModel;
1000
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1001
+ data: AIDeepReadingModel;
1002
+ }) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
1003
+ [key: string]: any;
1004
+ data: AIDeepReadingModel;
1005
+ } : ResponseWrapper extends {
1006
+ data: AIDeepReadingModel;
1007
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1008
+ data: AIDeepReadingModel;
1009
+ }) ? T_1 extends unknown ? {
1010
+ id: string;
1011
+ hash: string;
1012
+ ref_id: string;
1013
+ key_points: string[];
1014
+ critical_analysis: string;
1015
+ content: string;
1016
+ } : T_1 : never : never;
1017
+ } : ResponseWrapper;
1018
+ $request: {
1019
+ path: string;
1020
+ method: string;
1021
+ [k: string]: string;
1022
+ };
1023
+ $serialized: AIDeepReadingModel;
1024
+ }>;
973
1025
  }
974
1026
 
975
1027
  declare module '@mx-space/api-client' {
@@ -1897,4 +1949,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
1897
1949
  */
1898
1950
  declare const camelcaseKeys: <T = any>(obj: any) => T;
1899
1951
 
1900
- export { AIController, type AISummaryModel, AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, type AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, type BaseCommentIndexModel, type BaseModel, CategoryController, type CategoryEntries, type CategoryModel, CategoryType, type CategoryWithChildrenModel, CollectionRefTypes, CommentController, type CommentDto, type CommentModel, CommentOptionsModel, type CommentRef, CommentState, type Coordinate, type Count, EnumPageType, HTTPClient, type IConfig, type IConfigKeys, IRequestAdapter, type Image, type LastYearPublication, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteWrappedPayload, type NoteWrappedWithLikedPayload, PageController, type PageModel, type Pager, type PaginateResult, PostController, type PostModel, ProjectController, type ProjectModel, type ReaderModel, type RecentActivities, type RecentComment, type RecentLike, type RecentNote, type RecentPost, type RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, type RecentlyModel, type RecentlyRefType, RecentlyRefTypes, RequestError, type RoomOmittedNote, type RoomOmittedPage, type RoomOmittedPost, type RoomsData, SayController, type SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, type SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, type SubscribeType, SubscribeTypeToBitMap, type TLogin, type TagModel, type TextBaseModel, type TimelineData, TimelineType, TopicController, type TopicModel, type Url, UrlOptionModel, UserController, type UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
1952
+ export { AIController, type AIDeepReadingModel, type AISummaryModel, AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, type AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, type BaseCommentIndexModel, type BaseModel, BingSearchOptionsModel, CategoryController, type CategoryEntries, type CategoryModel, CategoryType, type CategoryWithChildrenModel, CollectionRefTypes, CommentController, type CommentDto, type CommentModel, CommentOptionsModel, type CommentRef, CommentState, type Coordinate, type Count, EnumPageType, HTTPClient, type IConfig, type IConfigKeys, IRequestAdapter, type Image, type LastYearPublication, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteWrappedPayload, type NoteWrappedWithLikedPayload, PageController, type PageModel, type Pager, type PaginateResult, PostController, type PostModel, ProjectController, type ProjectModel, type ReaderModel, type RecentActivities, type RecentComment, type RecentLike, type RecentNote, type RecentPost, type RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, type RecentlyModel, type RecentlyRefType, RecentlyRefTypes, RequestError, type RoomOmittedNote, type RoomOmittedPage, type RoomOmittedPost, type RoomsData, SayController, type SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, type SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, type SubscribeType, SubscribeTypeToBitMap, type TLogin, type TagModel, type TextBaseModel, type TimelineData, TimelineType, TopicController, type TopicModel, type Url, UrlOptionModel, UserController, type UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
@@ -59,7 +59,7 @@
59
59
  return $1.toUpperCase().replace("-", "").replace("_", "");
60
60
  });
61
61
  }
62
- var isMongoId = (id) => id.length === 24 && /^[\dA-Fa-f]{24}$/.test(id);
62
+ var isMongoId = (id) => id.length === 24 && /^[\dA-F]{24}$/i.test(id);
63
63
 
64
64
  // utils/path.ts
65
65
  var resolveFullPath = (endpoint, path) => {
@@ -271,6 +271,13 @@
271
271
  }
272
272
  });
273
273
  }
274
+ /**
275
+ * Core >= 8.3.0
276
+ * @param articleId
277
+ */
278
+ async getDeepReading(articleId) {
279
+ return this.proxy("deep-readings").article(articleId).get();
280
+ }
274
281
  };
275
282
 
276
283
  // core/error.ts
@@ -847,10 +854,10 @@
847
854
 
848
855
  // controllers/index.ts
849
856
  var allControllers = [
850
- AIController,
851
857
  AckController,
852
858
  ActivityController,
853
859
  AggregateController,
860
+ AIController,
854
861
  CategoryController,
855
862
  CommentController,
856
863
  LinkController,
@@ -859,12 +866,12 @@
859
866
  PostController,
860
867
  ProjectController,
861
868
  RecentlyController,
862
- TopicController,
863
869
  SayController,
864
870
  SearchController,
865
- SnippetController,
866
871
  ServerlessController,
872
+ SnippetController,
867
873
  SubscribeController,
874
+ TopicController,
868
875
  UserController
869
876
  ];
870
877
  var allControllerNames = [
@@ -899,7 +906,7 @@
899
906
  value(url, options) {
900
907
  const { params = {}, ...rest } = options;
901
908
  const qs = handleSearchParams(params);
902
- return target.instance.get(`${url}${qs ? `${`?${qs}`}` : ""}`, rest);
909
+ return target.instance.get(`${url}${qs ? String(`?${qs}`) : ""}`, rest);
903
910
  }
904
911
  });
905
912
  ["put", "post", "patch", "delete"].forEach((method) => {
@@ -1189,5 +1196,5 @@
1189
1196
  };
1190
1197
 
1191
1198
  // index.ts
1192
- var api_client_default = createClient;
1199
+ var index_default = createClient;
1193
1200
  })();
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ function camelcase(str) {
57
57
  return $1.toUpperCase().replace("-", "").replace("_", "");
58
58
  });
59
59
  }
60
- var isMongoId = (id) => id.length === 24 && /^[\dA-Fa-f]{24}$/.test(id);
60
+ var isMongoId = (id) => id.length === 24 && /^[\dA-F]{24}$/i.test(id);
61
61
 
62
62
  // utils/path.ts
63
63
  var resolveFullPath = (endpoint, path) => {
@@ -269,6 +269,13 @@ var AIController = class {
269
269
  }
270
270
  });
271
271
  }
272
+ /**
273
+ * Core >= 8.3.0
274
+ * @param articleId
275
+ */
276
+ async getDeepReading(articleId) {
277
+ return this.proxy("deep-readings").article(articleId).get();
278
+ }
272
279
  };
273
280
 
274
281
  // core/error.ts
@@ -845,10 +852,10 @@ var UserController = class {
845
852
 
846
853
  // controllers/index.ts
847
854
  var allControllers = [
848
- AIController,
849
855
  AckController,
850
856
  ActivityController,
851
857
  AggregateController,
858
+ AIController,
852
859
  CategoryController,
853
860
  CommentController,
854
861
  LinkController,
@@ -857,12 +864,12 @@ var allControllers = [
857
864
  PostController,
858
865
  ProjectController,
859
866
  RecentlyController,
860
- TopicController,
861
867
  SayController,
862
868
  SearchController,
863
- SnippetController,
864
869
  ServerlessController,
870
+ SnippetController,
865
871
  SubscribeController,
872
+ TopicController,
866
873
  UserController
867
874
  ];
868
875
  var allControllerNames = [
@@ -897,7 +904,7 @@ function attachRequestMethod(target) {
897
904
  value(url, options) {
898
905
  const { params = {}, ...rest } = options;
899
906
  const qs = handleSearchParams(params);
900
- return target.instance.get(`${url}${qs ? `${`?${qs}`}` : ""}`, rest);
907
+ return target.instance.get(`${url}${qs ? String(`?${qs}`) : ""}`, rest);
901
908
  }
902
909
  });
903
910
  ["put", "post", "patch", "delete"].forEach((method) => {
@@ -1187,7 +1194,7 @@ var SubscribeTypeToBitMap = {
1187
1194
  };
1188
1195
 
1189
1196
  // index.ts
1190
- var api_client_default = createClient;
1197
+ var index_default = createClient;
1191
1198
  export {
1192
1199
  AIController,
1193
1200
  AckController,
@@ -1229,6 +1236,6 @@ export {
1229
1236
  allControllerNames,
1230
1237
  allControllers,
1231
1238
  createClient,
1232
- api_client_default as default,
1239
+ index_default as default,
1233
1240
  camelcaseKeys as simpleCamelcaseKeys
1234
1241
  };
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- // eslint-disable-next-line spaced-comment
2
+
3
3
  const $http = /*#__PURE__*/ axios.create({});
4
4
  // ignore axios `method` declare not assignable to `Method`
5
5
  export const axiosAdaptor = Object.preventExtensions({
@@ -1,5 +1,5 @@
1
1
  import ky from 'ky';
2
- // eslint-disable-next-line spaced-comment
2
+
3
3
  const $http = /*#__PURE__*/ ky.create({});
4
4
  // TODO post data not only json,
5
5
  const getDataFromKyResponse = async (response) => {
@@ -1,5 +1,5 @@
1
1
  import { extend } from 'umi-request';
2
- // eslint-disable-next-line spaced-comment
2
+
3
3
  const $http = /*#__PURE__*/ extend({
4
4
  getResponse: true,
5
5
  requestType: 'json',
@@ -16,4 +16,4 @@ import { TopicController } from './topic';
16
16
  import { UserController } from './user';
17
17
  export declare const allControllers: (typeof AggregateController | typeof CategoryController | typeof CommentController | typeof LinkController | typeof NoteController | typeof PageController | typeof PostController | typeof ProjectController | typeof RecentlyController | typeof SayController | typeof SearchController | typeof ServerlessController | typeof SnippetController | typeof SubscribeController | typeof TopicController | typeof UserController)[];
18
18
  export declare const allContollerNames: readonly ["aggregate", "category", "comment", "link", "note", "page", "post", "project", "topic", "recently", "say", "search", "snippet", "serverless", "subscribe", "user", "friend", "master", "shorthand"];
19
- export { AggregateController, CategoryController, CommentController, LinkController, NoteController, PageController, PostController, ProjectController, RecentlyController, SayController, SearchController, SnippetController, ServerlessController, SubscribeController, UserController, TopicController, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, };
19
+ export { AggregateController, CategoryController, CommentController, LinkController, NoteController, PageController, PostController, ProjectController, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, SayController, SearchController, ServerlessController, SnippetController, SubscribeController, TopicController, UserController, };
@@ -54,7 +54,7 @@ export const allContollerNames = [
54
54
  'master',
55
55
  'shorthand',
56
56
  ];
57
- export { AggregateController, CategoryController, CommentController, LinkController, NoteController, PageController, PostController, ProjectController, RecentlyController, SayController, SearchController, SnippetController, ServerlessController, SubscribeController, UserController, TopicController,
58
- // Enum
59
- RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, };
57
+ export { AggregateController, CategoryController, CommentController, LinkController, NoteController, PageController, PostController, ProjectController, // Enum
58
+ RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, SayController, SearchController, ServerlessController, SnippetController, SubscribeController,
59
+ TopicController, UserController, };
60
60
  //# sourceMappingURL=index.js.map
@@ -1,13 +1,13 @@
1
1
  import { autoBind } from '~/utils/auto-bind';
2
2
  export var RecentlyAttitudeResultEnum;
3
3
  (function (RecentlyAttitudeResultEnum) {
4
- RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum["Inc"] = 1] = "Inc";
5
- RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum["Dec"] = -1] = "Dec";
4
+ RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum.Inc = 1] = "Inc";
5
+ RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum.Dec = -1] = "Dec";
6
6
  })(RecentlyAttitudeResultEnum || (RecentlyAttitudeResultEnum = {}));
7
7
  export var RecentlyAttitudeEnum;
8
8
  (function (RecentlyAttitudeEnum) {
9
- RecentlyAttitudeEnum[RecentlyAttitudeEnum["Up"] = 0] = "Up";
10
- RecentlyAttitudeEnum[RecentlyAttitudeEnum["Down"] = 1] = "Down";
9
+ RecentlyAttitudeEnum[RecentlyAttitudeEnum.Up = 0] = "Up";
10
+ RecentlyAttitudeEnum[RecentlyAttitudeEnum.Down = 1] = "Down";
11
11
  })(RecentlyAttitudeEnum || (RecentlyAttitudeEnum = {}));
12
12
  export class RecentlyController {
13
13
  constructor(client) {
@@ -4,7 +4,7 @@ export function attachRequestMethod(target) {
4
4
  // HINT: method get only accept search params;
5
5
  const { params = {}, ...rest } = options;
6
6
  const qs = handleSearchParams(params);
7
- return target.instance.get(`${url}${qs ? `${`?${qs}`}` : ''}`, rest);
7
+ return target.instance.get(`${url}${qs ? String(`?${qs}`) : ''}`, rest);
8
8
  },
9
9
  });
10
10
  ['put', 'post', 'patch', 'delete'].forEach((method) => {
@@ -111,23 +111,23 @@ class HTTPClient {
111
111
  url,
112
112
  });
113
113
  }
114
- catch (e) {
115
- let message = e.message;
116
- let code = e.code ||
117
- e.status ||
118
- e.statusCode ||
119
- e.response?.status ||
120
- e.response?.statusCode ||
121
- e.response?.code ||
114
+ catch (error) {
115
+ let message = error.message;
116
+ let code = error.code ||
117
+ error.status ||
118
+ error.statusCode ||
119
+ error.response?.status ||
120
+ error.response?.statusCode ||
121
+ error.response?.code ||
122
122
  500;
123
123
  if (that.options.getCodeMessageFromException) {
124
- const errorInfo = that.options.getCodeMessageFromException(e);
124
+ const errorInfo = that.options.getCodeMessageFromException(error);
125
125
  message = errorInfo.message || message;
126
126
  code = errorInfo.code || code;
127
127
  }
128
128
  throw that.options.customThrowResponseError
129
- ? that.options.customThrowResponseError(e)
130
- : new RequestError(message, code, url, e);
129
+ ? that.options.customThrowResponseError(error)
130
+ : new RequestError(message, code, url, error);
131
131
  }
132
132
  const data = res.data;
133
133
  if (!data) {
@@ -4,6 +4,6 @@ export * from './models';
4
4
  export * from './dtos';
5
5
  export { createClient, RequestError } from './core';
6
6
  export { camelcaseKeys as simpleCamelcaseKeys } from './utils/camelcase-keys';
7
- // eslint-disable-next-line import/no-default-export
7
+
8
8
  export default createClient;
9
9
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  export var TimelineType;
2
2
  (function (TimelineType) {
3
- TimelineType[TimelineType["Post"] = 0] = "Post";
4
- TimelineType[TimelineType["Note"] = 1] = "Note";
3
+ TimelineType[TimelineType.Post = 0] = "Post";
4
+ TimelineType[TimelineType.Note = 1] = "Note";
5
5
  })(TimelineType || (TimelineType = {}));
6
6
  //# sourceMappingURL=aggregate.js.map
@@ -1,6 +1,6 @@
1
1
  export var CategoryType;
2
2
  (function (CategoryType) {
3
- CategoryType[CategoryType["Category"] = 0] = "Category";
4
- CategoryType[CategoryType["Tag"] = 1] = "Tag";
3
+ CategoryType[CategoryType.Category = 0] = "Category";
4
+ CategoryType[CategoryType.Tag = 1] = "Tag";
5
5
  })(CategoryType || (CategoryType = {}));
6
6
  //# sourceMappingURL=category.js.map
@@ -1,13 +1,13 @@
1
1
  export var RefType;
2
2
  (function (RefType) {
3
- RefType["Page"] = "Page";
4
- RefType["Post"] = "Post";
5
- RefType["Note"] = "Note";
3
+ RefType.Page = "Page";
4
+ RefType.Post = "Post";
5
+ RefType.Note = "Note";
6
6
  })(RefType || (RefType = {}));
7
7
  export var CommentState;
8
8
  (function (CommentState) {
9
- CommentState[CommentState["Unread"] = 0] = "Unread";
10
- CommentState[CommentState["Read"] = 1] = "Read";
11
- CommentState[CommentState["Junk"] = 2] = "Junk";
9
+ CommentState[CommentState.Unread = 0] = "Unread";
10
+ CommentState[CommentState.Read = 1] = "Read";
11
+ CommentState[CommentState.Junk = 2] = "Junk";
12
12
  })(CommentState || (CommentState = {}));
13
13
  //# sourceMappingURL=comment.js.map
@@ -1,14 +1,14 @@
1
1
  export var LinkType;
2
2
  (function (LinkType) {
3
- LinkType[LinkType["Friend"] = 0] = "Friend";
4
- LinkType[LinkType["Collection"] = 1] = "Collection";
3
+ LinkType[LinkType.Friend = 0] = "Friend";
4
+ LinkType[LinkType.Collection = 1] = "Collection";
5
5
  })(LinkType || (LinkType = {}));
6
6
  export var LinkState;
7
7
  (function (LinkState) {
8
- LinkState[LinkState["Pass"] = 0] = "Pass";
9
- LinkState[LinkState["Audit"] = 1] = "Audit";
10
- LinkState[LinkState["Outdate"] = 2] = "Outdate";
11
- LinkState[LinkState["Banned"] = 3] = "Banned";
12
- LinkState[LinkState["Reject"] = 4] = "Reject";
8
+ LinkState[LinkState.Pass = 0] = "Pass";
9
+ LinkState[LinkState.Audit = 1] = "Audit";
10
+ LinkState[LinkState.Outdate = 2] = "Outdate";
11
+ LinkState[LinkState.Banned = 3] = "Banned";
12
+ LinkState[LinkState.Reject = 4] = "Reject";
13
13
  })(LinkState || (LinkState = {}));
14
14
  //# sourceMappingURL=link.js.map
@@ -1,7 +1,7 @@
1
1
  export var EnumPageType;
2
2
  (function (EnumPageType) {
3
- EnumPageType["md"] = "md";
4
- EnumPageType["html"] = "html";
5
- EnumPageType["frame"] = "frame";
3
+ EnumPageType.md = "md";
4
+ EnumPageType.html = "html";
5
+ EnumPageType.frame = "frame";
6
6
  })(EnumPageType || (EnumPageType = {}));
7
7
  //# sourceMappingURL=page.js.map
@@ -1,7 +1,7 @@
1
1
  export var RecentlyRefTypes;
2
2
  (function (RecentlyRefTypes) {
3
- RecentlyRefTypes["Post"] = "Post";
4
- RecentlyRefTypes["Note"] = "Note";
5
- RecentlyRefTypes["Page"] = "Page";
3
+ RecentlyRefTypes.Post = "Post";
4
+ RecentlyRefTypes.Note = "Note";
5
+ RecentlyRefTypes.Page = "Page";
6
6
  })(RecentlyRefTypes || (RecentlyRefTypes = {}));
7
7
  //# sourceMappingURL=recently.js.map
@@ -1,8 +1,8 @@
1
1
  export var SnippetType;
2
2
  (function (SnippetType) {
3
- SnippetType["JSON"] = "json";
4
- SnippetType["Function"] = "function";
5
- SnippetType["Text"] = "text";
6
- SnippetType["YAML"] = "yaml";
3
+ SnippetType.JSON = "json";
4
+ SnippetType.Function = "function";
5
+ SnippetType.Text = "text";
6
+ SnippetType.YAML = "yaml";
7
7
  })(SnippetType || (SnippetType = {}));
8
8
  //# sourceMappingURL=snippet.js.map
@@ -1,5 +1,5 @@
1
- import { readdirSync } from 'fs';
2
- import path from 'path';
1
+ import { readdirSync } from 'node:fs';
2
+ import path from 'node:path';
3
3
  import { defineConfig } from 'tsup';
4
4
  const __dirname = new URL(import.meta.url).pathname.replace(/\/[^/]*$/, '');
5
5
  const adaptorNames = readdirSync(path.resolve(__dirname, './adaptors')).map((i) => path.parse(i).name);
@@ -16,7 +16,7 @@ export const camelcaseKeys = (obj) => {
16
16
  return obj;
17
17
  };
18
18
  export function camelcase(str) {
19
- return str.replace(/([-_][a-z])/gi, ($1) => {
19
+ return str.replaceAll(/([-_][a-z])/gi, ($1) => {
20
20
  return $1.toUpperCase().replace('-', '').replace('_', '');
21
21
  });
22
22
  }