@mx-space/api-client 1.4.0 → 1.4.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/.eslintcache +1 -1
- package/controllers/aggregate.ts +16 -10
- package/controllers/base.ts +4 -4
- package/controllers/category.ts +12 -11
- package/controllers/comment.ts +9 -9
- package/controllers/link.ts +4 -3
- package/controllers/note.ts +9 -9
- package/controllers/page.ts +8 -8
- package/controllers/post.ts +8 -8
- package/controllers/project.ts +4 -3
- package/controllers/recently.ts +6 -6
- package/controllers/say.ts +6 -5
- package/controllers/search.ts +9 -9
- package/controllers/severless.ts +5 -5
- package/controllers/snippet.ts +5 -5
- package/controllers/subscribe.ts +6 -6
- package/controllers/topic.ts +6 -5
- package/controllers/user.ts +6 -6
- package/dist/adaptors/axios.d.ts +1 -1
- package/dist/adaptors/axios.global.js +146 -95
- package/dist/adaptors/umi-request.d.ts +1 -1
- package/dist/adaptors/umi-request.global.js +22 -13
- package/dist/index.cjs +27 -15
- package/dist/index.d.ts +23 -27
- package/dist/index.global.js +27 -15
- package/dist/index.js +27 -15
- package/interfaces/adapter.ts +1 -1
- package/interfaces/client.ts +2 -2
- package/interfaces/request.ts +3 -1
- package/models/aggregate.ts +15 -7
- package/models/category.ts +2 -2
- package/models/comment.ts +2 -2
- package/models/link.ts +1 -1
- package/models/note.ts +2 -2
- package/models/page.ts +1 -1
- package/models/post.ts +2 -2
- package/models/project.ts +1 -1
- package/models/recently.ts +1 -1
- package/models/say.ts +1 -1
- package/models/snippet.ts +1 -1
- package/models/subscribe.ts +1 -1
- package/models/topic.ts +1 -1
- package/models/user.ts +1 -1
- package/package.json +8 -20
- package/tsconfig.json +1 -1
|
@@ -177,9 +177,9 @@
|
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
-
// ../../node_modules/.pnpm/get-intrinsic@1.
|
|
180
|
+
// ../../node_modules/.pnpm/get-intrinsic@1.2.0/node_modules/get-intrinsic/index.js
|
|
181
181
|
var require_get_intrinsic = __commonJS({
|
|
182
|
-
"../../node_modules/.pnpm/get-intrinsic@1.
|
|
182
|
+
"../../node_modules/.pnpm/get-intrinsic@1.2.0/node_modules/get-intrinsic/index.js"(exports, module) {
|
|
183
183
|
"use strict";
|
|
184
184
|
var undefined2;
|
|
185
185
|
var $SyntaxError = SyntaxError;
|
|
@@ -232,6 +232,8 @@
|
|
|
232
232
|
"%AsyncIteratorPrototype%": needsEval,
|
|
233
233
|
"%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
|
|
234
234
|
"%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
|
|
235
|
+
"%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array,
|
|
236
|
+
"%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array,
|
|
235
237
|
"%Boolean%": Boolean,
|
|
236
238
|
"%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
|
|
237
239
|
"%Date%": Date,
|
|
@@ -287,6 +289,13 @@
|
|
|
287
289
|
"%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
|
|
288
290
|
"%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
|
|
289
291
|
};
|
|
292
|
+
try {
|
|
293
|
+
null.error;
|
|
294
|
+
} catch (e) {
|
|
295
|
+
errorProto = getProto(getProto(e));
|
|
296
|
+
INTRINSICS["%Error.prototype%"] = errorProto;
|
|
297
|
+
}
|
|
298
|
+
var errorProto;
|
|
290
299
|
var doEval = function doEval2(name) {
|
|
291
300
|
var value;
|
|
292
301
|
if (name === "%AsyncFunction%") {
|
|
@@ -1160,9 +1169,9 @@
|
|
|
1160
1169
|
}
|
|
1161
1170
|
});
|
|
1162
1171
|
|
|
1163
|
-
// ../../node_modules/.pnpm/qs@6.11.
|
|
1172
|
+
// ../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/formats.js
|
|
1164
1173
|
var require_formats = __commonJS({
|
|
1165
|
-
"../../node_modules/.pnpm/qs@6.11.
|
|
1174
|
+
"../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/formats.js"(exports, module) {
|
|
1166
1175
|
"use strict";
|
|
1167
1176
|
var replace = String.prototype.replace;
|
|
1168
1177
|
var percentTwenties = /%20/g;
|
|
@@ -1186,9 +1195,9 @@
|
|
|
1186
1195
|
}
|
|
1187
1196
|
});
|
|
1188
1197
|
|
|
1189
|
-
// ../../node_modules/.pnpm/qs@6.11.
|
|
1198
|
+
// ../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/utils.js
|
|
1190
1199
|
var require_utils = __commonJS({
|
|
1191
|
-
"../../node_modules/.pnpm/qs@6.11.
|
|
1200
|
+
"../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/utils.js"(exports, module) {
|
|
1192
1201
|
"use strict";
|
|
1193
1202
|
var formats = require_formats();
|
|
1194
1203
|
var has = Object.prototype.hasOwnProperty;
|
|
@@ -1385,9 +1394,9 @@
|
|
|
1385
1394
|
}
|
|
1386
1395
|
});
|
|
1387
1396
|
|
|
1388
|
-
// ../../node_modules/.pnpm/qs@6.11.
|
|
1397
|
+
// ../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/stringify.js
|
|
1389
1398
|
var require_stringify = __commonJS({
|
|
1390
|
-
"../../node_modules/.pnpm/qs@6.11.
|
|
1399
|
+
"../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/stringify.js"(exports, module) {
|
|
1391
1400
|
"use strict";
|
|
1392
1401
|
var getSideChannel = require_side_channel();
|
|
1393
1402
|
var utils = require_utils();
|
|
@@ -1642,9 +1651,9 @@
|
|
|
1642
1651
|
}
|
|
1643
1652
|
});
|
|
1644
1653
|
|
|
1645
|
-
// ../../node_modules/.pnpm/qs@6.11.
|
|
1654
|
+
// ../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/parse.js
|
|
1646
1655
|
var require_parse = __commonJS({
|
|
1647
|
-
"../../node_modules/.pnpm/qs@6.11.
|
|
1656
|
+
"../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/parse.js"(exports, module) {
|
|
1648
1657
|
"use strict";
|
|
1649
1658
|
var utils = require_utils();
|
|
1650
1659
|
var has = Object.prototype.hasOwnProperty;
|
|
@@ -1681,7 +1690,7 @@
|
|
|
1681
1690
|
var isoSentinel = "utf8=%26%2310003%3B";
|
|
1682
1691
|
var charsetSentinel = "utf8=%E2%9C%93";
|
|
1683
1692
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
1684
|
-
var obj = {};
|
|
1693
|
+
var obj = { __proto__: null };
|
|
1685
1694
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
1686
1695
|
var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
|
|
1687
1696
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
@@ -1844,9 +1853,9 @@
|
|
|
1844
1853
|
}
|
|
1845
1854
|
});
|
|
1846
1855
|
|
|
1847
|
-
// ../../node_modules/.pnpm/qs@6.11.
|
|
1856
|
+
// ../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/index.js
|
|
1848
1857
|
var require_lib = __commonJS({
|
|
1849
|
-
"../../node_modules/.pnpm/qs@6.11.
|
|
1858
|
+
"../../node_modules/.pnpm/qs@6.11.2/node_modules/qs/lib/index.js"(exports, module) {
|
|
1850
1859
|
"use strict";
|
|
1851
1860
|
var stringify2 = require_stringify();
|
|
1852
1861
|
var parse2 = require_parse();
|
package/dist/index.cjs
CHANGED
|
@@ -92,13 +92,14 @@ var attachRawFromOneToAnthor = (from, to) => {
|
|
|
92
92
|
if (!from || !isObject(to)) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
;
|
|
96
|
+
["$raw", "$request", "$serialized"].forEach((key) => {
|
|
97
|
+
from[key] && Object.defineProperty(to, key, {
|
|
98
|
+
get() {
|
|
99
|
+
return from[key];
|
|
100
|
+
},
|
|
101
|
+
enumerable: false
|
|
102
|
+
});
|
|
102
103
|
});
|
|
103
104
|
};
|
|
104
105
|
|
|
@@ -176,8 +177,12 @@ var AggregateController = class {
|
|
|
176
177
|
/**
|
|
177
178
|
* 获取聚合数据
|
|
178
179
|
*/
|
|
179
|
-
getAggregateData() {
|
|
180
|
-
return this.proxy.get(
|
|
180
|
+
getAggregateData(theme) {
|
|
181
|
+
return this.proxy.get({
|
|
182
|
+
params: {
|
|
183
|
+
theme
|
|
184
|
+
}
|
|
185
|
+
});
|
|
181
186
|
}
|
|
182
187
|
/**
|
|
183
188
|
* 获取最新发布的内容
|
|
@@ -972,16 +977,18 @@ var HTTPClient = class {
|
|
|
972
977
|
if (!data) {
|
|
973
978
|
return null;
|
|
974
979
|
}
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
|
|
980
|
+
const cameledObject = (Array.isArray(data) || isPlainObject(data)) && that.options.transformResponse ? that.options.transformResponse(data) : data;
|
|
981
|
+
let nextObject = cameledObject;
|
|
982
|
+
if (cameledObject && typeof cameledObject === "object") {
|
|
983
|
+
nextObject = { ...cameledObject };
|
|
984
|
+
Object.defineProperty(nextObject, "$raw", {
|
|
978
985
|
get() {
|
|
979
986
|
return res;
|
|
980
987
|
},
|
|
981
988
|
enumerable: false,
|
|
982
989
|
configurable: false
|
|
983
990
|
});
|
|
984
|
-
Object.defineProperty(
|
|
991
|
+
Object.defineProperty(nextObject, "$request", {
|
|
985
992
|
get() {
|
|
986
993
|
return {
|
|
987
994
|
url,
|
|
@@ -991,8 +998,13 @@ var HTTPClient = class {
|
|
|
991
998
|
},
|
|
992
999
|
enumerable: false
|
|
993
1000
|
});
|
|
1001
|
+
Object.defineProperty(nextObject, "$serialized", {
|
|
1002
|
+
get() {
|
|
1003
|
+
return cameledObject;
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
994
1006
|
}
|
|
995
|
-
return
|
|
1007
|
+
return nextObject;
|
|
996
1008
|
};
|
|
997
1009
|
}
|
|
998
1010
|
route.push(name);
|
|
@@ -1084,7 +1096,7 @@ var SnippetType = /* @__PURE__ */ ((SnippetType2) => {
|
|
|
1084
1096
|
return SnippetType2;
|
|
1085
1097
|
})(SnippetType || {});
|
|
1086
1098
|
|
|
1087
|
-
// ../../src/modules/subscribe/subscribe.constant.ts
|
|
1099
|
+
// ../../apps/core/src/modules/subscribe/subscribe.constant.ts
|
|
1088
1100
|
var SubscribePostCreateBit = 1 << 0;
|
|
1089
1101
|
var SubscribeNoteCreateBit = 1 << 1;
|
|
1090
1102
|
var SubscribeSayCreateBit = 1 << 2;
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ type ResponseWrapperType<Response, RawData, T> = {
|
|
|
57
57
|
method: string;
|
|
58
58
|
[k: string]: string;
|
|
59
59
|
};
|
|
60
|
+
$serialized: T;
|
|
60
61
|
};
|
|
61
62
|
type ResponseProxyExtraRaw<T, RawData = unknown, Response = unknown> = T extends object ? T & ResponseWrapperType<Response, RawData, T> : T extends unknown ? T & ResponseWrapperType<Response, RawData, T> : unknown;
|
|
62
63
|
|
|
@@ -329,6 +330,16 @@ interface AggregateRoot {
|
|
|
329
330
|
url: Url;
|
|
330
331
|
categories: CategoryModel[];
|
|
331
332
|
pageMeta: Pick<PageModel, 'title' | 'id' | 'slug' | 'order'>[] | null;
|
|
333
|
+
/**
|
|
334
|
+
* @available 4.2.2
|
|
335
|
+
*/
|
|
336
|
+
latestNoteId: {
|
|
337
|
+
id: string;
|
|
338
|
+
nid: number;
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
342
|
+
theme?: Theme;
|
|
332
343
|
}
|
|
333
344
|
interface Url {
|
|
334
345
|
wsUrl: string;
|
|
@@ -388,7 +399,7 @@ declare class AggregateController<ResponseWrapper> implements IController {
|
|
|
388
399
|
/**
|
|
389
400
|
* 获取聚合数据
|
|
390
401
|
*/
|
|
391
|
-
getAggregateData(): RequestProxyResult<
|
|
402
|
+
getAggregateData<Theme>(theme?: string): RequestProxyResult<AggregateRootWithTheme<Theme>, ResponseWrapper>;
|
|
392
403
|
/**
|
|
393
404
|
* 获取最新发布的内容
|
|
394
405
|
*/
|
|
@@ -488,6 +499,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
488
499
|
path: string;
|
|
489
500
|
method: string;
|
|
490
501
|
};
|
|
502
|
+
$serialized: CategoryWithChildrenModel;
|
|
491
503
|
}>;
|
|
492
504
|
getTagByName(name: string): Promise<{
|
|
493
505
|
tag: string;
|
|
@@ -539,6 +551,10 @@ declare class CategoryController<ResponseWrapper> implements IController {
|
|
|
539
551
|
path: string;
|
|
540
552
|
method: string;
|
|
541
553
|
};
|
|
554
|
+
$serialized: {
|
|
555
|
+
tag: string;
|
|
556
|
+
data: Pick<PostModel, 'id' | 'title' | 'slug' | 'category' | 'created'>[];
|
|
557
|
+
};
|
|
542
558
|
}>;
|
|
543
559
|
}
|
|
544
560
|
|
|
@@ -769,11 +785,7 @@ declare class NoteController<ResponseWrapper> implements IController {
|
|
|
769
785
|
[key: string]: any;
|
|
770
786
|
data: NoteWrappedWithLikedPayload;
|
|
771
787
|
} : ResponseWrapper extends {
|
|
772
|
-
data: NoteWrappedWithLikedPayload;
|
|
773
|
-
* 获取一篇日记,根据 Id 查询需要鉴权
|
|
774
|
-
* @param id id | nid
|
|
775
|
-
* @param password 访问密码
|
|
776
|
-
*/
|
|
788
|
+
data: NoteWrappedWithLikedPayload;
|
|
777
789
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
778
790
|
data: NoteWrappedWithLikedPayload;
|
|
779
791
|
}>;
|
|
@@ -794,11 +806,7 @@ declare class NoteController<ResponseWrapper> implements IController {
|
|
|
794
806
|
[key: string]: any;
|
|
795
807
|
data: PaginateResult<NoteModel>;
|
|
796
808
|
} : ResponseWrapper extends {
|
|
797
|
-
data: PaginateResult<NoteModel>;
|
|
798
|
-
* 获取一篇日记,根据 Id 查询需要鉴权
|
|
799
|
-
* @param id id | nid
|
|
800
|
-
* @param password 访问密码
|
|
801
|
-
*/
|
|
809
|
+
data: PaginateResult<NoteModel>;
|
|
802
810
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
803
811
|
data: PaginateResult<NoteModel>;
|
|
804
812
|
}>;
|
|
@@ -818,11 +826,7 @@ declare class NoteController<ResponseWrapper> implements IController {
|
|
|
818
826
|
data: {
|
|
819
827
|
data: Pick<NoteModel, 'id' | 'title' | 'nid' | 'created'>[];
|
|
820
828
|
size: number;
|
|
821
|
-
};
|
|
822
|
-
* 获取一篇日记,根据 Id 查询需要鉴权
|
|
823
|
-
* @param id id | nid
|
|
824
|
-
* @param password 访问密码
|
|
825
|
-
*/
|
|
829
|
+
};
|
|
826
830
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
827
831
|
data: {
|
|
828
832
|
data: Pick<NoteModel, 'id' | 'title' | 'nid' | 'created'>[];
|
|
@@ -836,11 +840,7 @@ declare class NoteController<ResponseWrapper> implements IController {
|
|
|
836
840
|
[key: string]: any;
|
|
837
841
|
data: never;
|
|
838
842
|
} : ResponseWrapper extends {
|
|
839
|
-
data: never;
|
|
840
|
-
* 获取一篇日记,根据 Id 查询需要鉴权
|
|
841
|
-
* @param id id | nid
|
|
842
|
-
* @param password 访问密码
|
|
843
|
-
*/
|
|
843
|
+
data: never;
|
|
844
844
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
845
845
|
data: never;
|
|
846
846
|
}>;
|
|
@@ -851,11 +851,7 @@ declare class NoteController<ResponseWrapper> implements IController {
|
|
|
851
851
|
[key: string]: any;
|
|
852
852
|
data: PaginateResult<NoteModel>;
|
|
853
853
|
} : ResponseWrapper extends {
|
|
854
|
-
data: PaginateResult<NoteModel>;
|
|
855
|
-
* 获取一篇日记,根据 Id 查询需要鉴权
|
|
856
|
-
* @param id id | nid
|
|
857
|
-
* @param password 访问密码
|
|
858
|
-
*/
|
|
854
|
+
data: PaginateResult<NoteModel>;
|
|
859
855
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
860
856
|
data: PaginateResult<NoteModel>;
|
|
861
857
|
}>;
|
|
@@ -1471,4 +1467,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1471
1467
|
*/
|
|
1472
1468
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1473
1469
|
|
|
1474
|
-
export { AdminExtraModel, AggregateController, AggregateRoot, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, HTTPClient, IConfig, IConfigKeys, Image, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, NoteController, NoteModel, NoteMusicRecord, NoteWrappedPayload, NoteWrappedWithLikedPayload, PageController, PageModel, Pager, PaginateResult, PostController, PostModel, ProjectController, ProjectModel, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RefType, RequestError, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TimelineData, TimelineType, TopicController, TopicModel, Url, UrlOptionModel, UserController, UserModel, allContollerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
1470
|
+
export { AdminExtraModel, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, HTTPClient, IConfig, IConfigKeys, Image, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, NoteController, NoteModel, NoteMusicRecord, NoteWrappedPayload, NoteWrappedWithLikedPayload, PageController, PageModel, Pager, PaginateResult, PostController, PostModel, ProjectController, ProjectModel, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RefType, RequestError, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TimelineData, TimelineType, TopicController, TopicModel, Url, UrlOptionModel, UserController, UserModel, allContollerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.global.js
CHANGED
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
if (!from || !isObject(to)) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
;
|
|
33
|
+
["$raw", "$request", "$serialized"].forEach((key) => {
|
|
34
|
+
from[key] && Object.defineProperty(to, key, {
|
|
35
|
+
get() {
|
|
36
|
+
return from[key];
|
|
37
|
+
},
|
|
38
|
+
enumerable: false
|
|
39
|
+
});
|
|
39
40
|
});
|
|
40
41
|
};
|
|
41
42
|
|
|
@@ -113,8 +114,12 @@
|
|
|
113
114
|
/**
|
|
114
115
|
* 获取聚合数据
|
|
115
116
|
*/
|
|
116
|
-
getAggregateData() {
|
|
117
|
-
return this.proxy.get(
|
|
117
|
+
getAggregateData(theme) {
|
|
118
|
+
return this.proxy.get({
|
|
119
|
+
params: {
|
|
120
|
+
theme
|
|
121
|
+
}
|
|
122
|
+
});
|
|
118
123
|
}
|
|
119
124
|
/**
|
|
120
125
|
* 获取最新发布的内容
|
|
@@ -909,16 +914,18 @@
|
|
|
909
914
|
if (!data) {
|
|
910
915
|
return null;
|
|
911
916
|
}
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
|
|
917
|
+
const cameledObject = (Array.isArray(data) || isPlainObject(data)) && that.options.transformResponse ? that.options.transformResponse(data) : data;
|
|
918
|
+
let nextObject = cameledObject;
|
|
919
|
+
if (cameledObject && typeof cameledObject === "object") {
|
|
920
|
+
nextObject = { ...cameledObject };
|
|
921
|
+
Object.defineProperty(nextObject, "$raw", {
|
|
915
922
|
get() {
|
|
916
923
|
return res;
|
|
917
924
|
},
|
|
918
925
|
enumerable: false,
|
|
919
926
|
configurable: false
|
|
920
927
|
});
|
|
921
|
-
Object.defineProperty(
|
|
928
|
+
Object.defineProperty(nextObject, "$request", {
|
|
922
929
|
get() {
|
|
923
930
|
return {
|
|
924
931
|
url,
|
|
@@ -928,8 +935,13 @@
|
|
|
928
935
|
},
|
|
929
936
|
enumerable: false
|
|
930
937
|
});
|
|
938
|
+
Object.defineProperty(nextObject, "$serialized", {
|
|
939
|
+
get() {
|
|
940
|
+
return cameledObject;
|
|
941
|
+
}
|
|
942
|
+
});
|
|
931
943
|
}
|
|
932
|
-
return
|
|
944
|
+
return nextObject;
|
|
933
945
|
};
|
|
934
946
|
}
|
|
935
947
|
route.push(name);
|
|
@@ -1021,7 +1033,7 @@
|
|
|
1021
1033
|
return SnippetType2;
|
|
1022
1034
|
})(SnippetType || {});
|
|
1023
1035
|
|
|
1024
|
-
// ../../src/modules/subscribe/subscribe.constant.ts
|
|
1036
|
+
// ../../apps/core/src/modules/subscribe/subscribe.constant.ts
|
|
1025
1037
|
var SubscribePostCreateBit = 1 << 0;
|
|
1026
1038
|
var SubscribeNoteCreateBit = 1 << 1;
|
|
1027
1039
|
var SubscribeSayCreateBit = 1 << 2;
|
package/dist/index.js
CHANGED
|
@@ -27,13 +27,14 @@ var attachRawFromOneToAnthor = (from, to) => {
|
|
|
27
27
|
if (!from || !isObject(to)) {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
;
|
|
31
|
+
["$raw", "$request", "$serialized"].forEach((key) => {
|
|
32
|
+
from[key] && Object.defineProperty(to, key, {
|
|
33
|
+
get() {
|
|
34
|
+
return from[key];
|
|
35
|
+
},
|
|
36
|
+
enumerable: false
|
|
37
|
+
});
|
|
37
38
|
});
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -111,8 +112,12 @@ var AggregateController = class {
|
|
|
111
112
|
/**
|
|
112
113
|
* 获取聚合数据
|
|
113
114
|
*/
|
|
114
|
-
getAggregateData() {
|
|
115
|
-
return this.proxy.get(
|
|
115
|
+
getAggregateData(theme) {
|
|
116
|
+
return this.proxy.get({
|
|
117
|
+
params: {
|
|
118
|
+
theme
|
|
119
|
+
}
|
|
120
|
+
});
|
|
116
121
|
}
|
|
117
122
|
/**
|
|
118
123
|
* 获取最新发布的内容
|
|
@@ -907,16 +912,18 @@ var HTTPClient = class {
|
|
|
907
912
|
if (!data) {
|
|
908
913
|
return null;
|
|
909
914
|
}
|
|
910
|
-
const
|
|
911
|
-
|
|
912
|
-
|
|
915
|
+
const cameledObject = (Array.isArray(data) || isPlainObject(data)) && that.options.transformResponse ? that.options.transformResponse(data) : data;
|
|
916
|
+
let nextObject = cameledObject;
|
|
917
|
+
if (cameledObject && typeof cameledObject === "object") {
|
|
918
|
+
nextObject = { ...cameledObject };
|
|
919
|
+
Object.defineProperty(nextObject, "$raw", {
|
|
913
920
|
get() {
|
|
914
921
|
return res;
|
|
915
922
|
},
|
|
916
923
|
enumerable: false,
|
|
917
924
|
configurable: false
|
|
918
925
|
});
|
|
919
|
-
Object.defineProperty(
|
|
926
|
+
Object.defineProperty(nextObject, "$request", {
|
|
920
927
|
get() {
|
|
921
928
|
return {
|
|
922
929
|
url,
|
|
@@ -926,8 +933,13 @@ var HTTPClient = class {
|
|
|
926
933
|
},
|
|
927
934
|
enumerable: false
|
|
928
935
|
});
|
|
936
|
+
Object.defineProperty(nextObject, "$serialized", {
|
|
937
|
+
get() {
|
|
938
|
+
return cameledObject;
|
|
939
|
+
}
|
|
940
|
+
});
|
|
929
941
|
}
|
|
930
|
-
return
|
|
942
|
+
return nextObject;
|
|
931
943
|
};
|
|
932
944
|
}
|
|
933
945
|
route.push(name);
|
|
@@ -1019,7 +1031,7 @@ var SnippetType = /* @__PURE__ */ ((SnippetType2) => {
|
|
|
1019
1031
|
return SnippetType2;
|
|
1020
1032
|
})(SnippetType || {});
|
|
1021
1033
|
|
|
1022
|
-
// ../../src/modules/subscribe/subscribe.constant.ts
|
|
1034
|
+
// ../../apps/core/src/modules/subscribe/subscribe.constant.ts
|
|
1023
1035
|
var SubscribePostCreateBit = 1 << 0;
|
|
1024
1036
|
var SubscribeNoteCreateBit = 1 << 1;
|
|
1025
1037
|
var SubscribeSayCreateBit = 1 << 2;
|
package/interfaces/adapter.ts
CHANGED
package/interfaces/client.ts
CHANGED
package/interfaces/request.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequestOptions } from './instance'
|
|
1
|
+
import type { RequestOptions } from './instance'
|
|
2
2
|
|
|
3
3
|
type NoStringIndex<T> = { [K in keyof T as string extends K ? never : K]: T[K] }
|
|
4
4
|
|
|
@@ -70,6 +70,8 @@ type ResponseWrapperType<Response, RawData, T> = {
|
|
|
70
70
|
method: string
|
|
71
71
|
[k: string]: string
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
$serialized: T
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
export type ResponseProxyExtraRaw<
|
package/models/aggregate.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CategoryModel } from './category'
|
|
2
|
-
import { NoteModel } from './note'
|
|
3
|
-
import { PageModel } from './page'
|
|
4
|
-
import { PostModel } from './post'
|
|
5
|
-
import { SayModel } from './say'
|
|
6
|
-
import { SeoOptionModel } from './setting'
|
|
7
|
-
import { UserModel } from './user'
|
|
1
|
+
import type { CategoryModel } from './category'
|
|
2
|
+
import type { NoteModel } from './note'
|
|
3
|
+
import type { PageModel } from './page'
|
|
4
|
+
import type { PostModel } from './post'
|
|
5
|
+
import type { SayModel } from './say'
|
|
6
|
+
import type { SeoOptionModel } from './setting'
|
|
7
|
+
import type { UserModel } from './user'
|
|
8
8
|
|
|
9
9
|
export interface AggregateRoot {
|
|
10
10
|
user: UserModel
|
|
@@ -12,6 +12,14 @@ export interface AggregateRoot {
|
|
|
12
12
|
url: Url
|
|
13
13
|
categories: CategoryModel[]
|
|
14
14
|
pageMeta: Pick<PageModel, 'title' | 'id' | 'slug' | 'order'>[] | null
|
|
15
|
+
/**
|
|
16
|
+
* @available 4.2.2
|
|
17
|
+
*/
|
|
18
|
+
latestNoteId: { id: string; nid: number }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
22
|
+
theme?: Theme
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
export interface Url {
|
package/models/category.ts
CHANGED
package/models/comment.ts
CHANGED
package/models/link.ts
CHANGED
package/models/note.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModelWithLiked, TextBaseModel } from './base'
|
|
2
|
-
import { TopicModel } from './topic'
|
|
1
|
+
import type { ModelWithLiked, TextBaseModel } from './base'
|
|
2
|
+
import type { TopicModel } from './topic'
|
|
3
3
|
|
|
4
4
|
export interface NoteModel extends TextBaseModel {
|
|
5
5
|
hide: boolean
|
package/models/page.ts
CHANGED
package/models/post.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Count, Image, TextBaseModel } from './base'
|
|
2
|
-
import { CategoryModel } from './category'
|
|
1
|
+
import type { Count, Image, TextBaseModel } from './base'
|
|
2
|
+
import type { CategoryModel } from './category'
|
|
3
3
|
|
|
4
4
|
export interface PostModel extends TextBaseModel {
|
|
5
5
|
summary?: string
|
package/models/project.ts
CHANGED
package/models/recently.ts
CHANGED
package/models/say.ts
CHANGED
package/models/snippet.ts
CHANGED
package/models/subscribe.ts
CHANGED
package/models/topic.ts
CHANGED
package/models/user.ts
CHANGED