@mx-space/api-client 1.16.1 → 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.
- package/controllers/ai.ts +11 -1
- package/dist/adaptors/axios.global.js +1115 -236
- package/dist/adaptors/umi-request.global.js +1513 -1267
- package/dist/index.cjs +14 -7
- package/dist/index.d.cts +52 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.global.js +10 -3
- package/dist/index.js +11 -4
- package/esm/packages/api-client/adaptors/axios.js +1 -1
- package/esm/packages/api-client/adaptors/ky.js +1 -1
- package/esm/packages/api-client/adaptors/umi-request.js +1 -1
- package/esm/packages/api-client/controllers/index.d.ts +1 -1
- package/esm/packages/api-client/controllers/index.js +3 -3
- package/esm/packages/api-client/controllers/recently.js +4 -4
- package/esm/packages/api-client/core/attach-request.js +1 -1
- package/esm/packages/api-client/core/client.js +11 -11
- package/esm/packages/api-client/index.js +1 -1
- package/esm/packages/api-client/models/aggregate.js +2 -2
- package/esm/packages/api-client/models/category.js +2 -2
- package/esm/packages/api-client/models/comment.js +6 -6
- package/esm/packages/api-client/models/link.js +7 -7
- package/esm/packages/api-client/models/page.js +3 -3
- package/esm/packages/api-client/models/recently.js +3 -3
- package/esm/packages/api-client/models/snippet.js +4 -4
- package/esm/packages/api-client/tsup.config.js +2 -2
- package/esm/packages/api-client/utils/camelcase-keys.js +1 -1
- package/esm/packages/api-client/vitest.config.js +1 -1
- package/index.ts +0 -1
- package/mod-dts.mjs +3 -3
- package/models/aggregate.ts +0 -2
- package/models/ai.ts +9 -0
- package/models/setting.ts +5 -0
- package/package.json +23 -23
- package/readme.md +3 -3
- package/tsconfig.json +11 -11
- 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
|
|
22
|
-
__export(
|
|
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: () =>
|
|
63
|
+
default: () => index_default,
|
|
64
64
|
simpleCamelcaseKeys: () => camelcaseKeys
|
|
65
65
|
});
|
|
66
|
-
module.exports = __toCommonJS(
|
|
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-
|
|
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
|
|
@@ -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 ?
|
|
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
|
|
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;
|
|
@@ -971,6 +983,45 @@ declare class AIController<ResponseWrapper> implements IController {
|
|
|
971
983
|
};
|
|
972
984
|
$serialized: AISummaryModel;
|
|
973
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
|
+
}>;
|
|
974
1025
|
}
|
|
975
1026
|
|
|
976
1027
|
declare module '../core/client' {
|
|
@@ -1898,4 +1949,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
|
|
|
1898
1949
|
*/
|
|
1899
1950
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1900
1951
|
|
|
1901
|
-
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;
|
|
@@ -971,6 +983,45 @@ declare class AIController<ResponseWrapper> implements IController {
|
|
|
971
983
|
};
|
|
972
984
|
$serialized: AISummaryModel;
|
|
973
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
|
+
}>;
|
|
974
1025
|
}
|
|
975
1026
|
|
|
976
1027
|
declare module '@mx-space/api-client' {
|
|
@@ -1898,4 +1949,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
|
|
|
1898
1949
|
*/
|
|
1899
1950
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1900
1951
|
|
|
1901
|
-
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.global.js
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
return $1.toUpperCase().replace("-", "").replace("_", "");
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
var isMongoId = (id) => id.length === 24 && /^[\dA-
|
|
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
|
|
@@ -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 ?
|
|
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
|
|
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-
|
|
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
|
|
@@ -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 ?
|
|
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
|
|
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
|
-
|
|
1239
|
+
index_default as default,
|
|
1233
1240
|
camelcaseKeys as simpleCamelcaseKeys
|
|
1234
1241
|
};
|
|
@@ -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,
|
|
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,
|
|
58
|
-
|
|
59
|
-
|
|
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
|
|
5
|
-
RecentlyAttitudeResultEnum[RecentlyAttitudeResultEnum
|
|
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
|
|
10
|
-
RecentlyAttitudeEnum[RecentlyAttitudeEnum
|
|
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 ?
|
|
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 (
|
|
115
|
-
let message =
|
|
116
|
-
let code =
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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(
|
|
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(
|
|
130
|
-
: new RequestError(message, code, url,
|
|
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
|
-
|
|
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
|
|
4
|
-
TimelineType[TimelineType
|
|
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
|
|
4
|
-
CategoryType[CategoryType
|
|
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
|
|
4
|
-
RefType
|
|
5
|
-
RefType
|
|
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
|
|
10
|
-
CommentState[CommentState
|
|
11
|
-
CommentState[CommentState
|
|
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
|
|
4
|
-
LinkType[LinkType
|
|
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
|
|
9
|
-
LinkState[LinkState
|
|
10
|
-
LinkState[LinkState
|
|
11
|
-
LinkState[LinkState
|
|
12
|
-
LinkState[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";
|
|
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
|
|
4
|
-
EnumPageType
|
|
5
|
-
EnumPageType
|
|
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
|
|
4
|
-
RecentlyRefTypes
|
|
5
|
-
RecentlyRefTypes
|
|
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
|
|
4
|
-
SnippetType
|
|
5
|
-
SnippetType
|
|
6
|
-
SnippetType
|
|
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.
|
|
19
|
+
return str.replaceAll(/([-_][a-z])/gi, ($1) => {
|
|
20
20
|
return $1.toUpperCase().replace('-', '').replace('_', '');
|
|
21
21
|
});
|
|
22
22
|
}
|
package/index.ts
CHANGED
|
@@ -8,6 +8,5 @@ export { createClient, RequestError } from './core'
|
|
|
8
8
|
export type { HTTPClient } from './core'
|
|
9
9
|
export { camelcaseKeys as simpleCamelcaseKeys } from './utils/camelcase-keys'
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line import/no-default-export
|
|
12
11
|
export default createClient
|
|
13
12
|
export type { IRequestAdapter } from './interfaces/adapter'
|
package/mod-dts.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync } from 'fs'
|
|
2
|
-
import path from 'path'
|
|
1
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
3
|
|
|
4
4
|
const __dirname = new URL(import.meta.url).pathname.replace(/\/[^/]*$/, '')
|
|
5
5
|
const PKG = JSON.parse(readFileSync(path.resolve(__dirname, './package.json')))
|
|
@@ -11,7 +11,7 @@ const content = readFileSync(dts, 'utf-8')
|
|
|
11
11
|
// with declare module '@mx-space/api-client'
|
|
12
12
|
writeFileSync(
|
|
13
13
|
dts,
|
|
14
|
-
content.
|
|
14
|
+
content.replaceAll(
|
|
15
15
|
/declare module '..\/core\/client'/g,
|
|
16
16
|
'declare module ' + `'${PKG.name}'`,
|
|
17
17
|
),
|
package/models/aggregate.ts
CHANGED
|
@@ -28,11 +28,9 @@ export interface Url {
|
|
|
28
28
|
webUrl: string
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
32
31
|
export interface AggregateTopNote
|
|
33
32
|
extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images'> {}
|
|
34
33
|
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
36
34
|
export interface AggregateTopPost
|
|
37
35
|
extends Pick<
|
|
38
36
|
PostModel,
|
package/models/ai.ts
CHANGED
package/models/setting.ts
CHANGED
|
@@ -37,6 +37,11 @@ export declare class BaiduSearchOptionsModel {
|
|
|
37
37
|
enable: boolean
|
|
38
38
|
token?: string
|
|
39
39
|
}
|
|
40
|
+
export declare class BingSearchOptionsModel {
|
|
41
|
+
enable: boolean
|
|
42
|
+
token?: string
|
|
43
|
+
}
|
|
44
|
+
|
|
40
45
|
export declare class AlgoliaSearchOptionsModel {
|
|
41
46
|
enable: boolean
|
|
42
47
|
apiKey?: string
|