@mx-space/api-client 3.7.1 → 4.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -487,6 +487,21 @@ var CommentController = class {
487
487
  readerReply(commentId, data) {
488
488
  return this.proxy.reader.reply(commentId).post({ data });
489
489
  }
490
+ /**
491
+ * 取评论图片上传之公开配置(启用状态、限额、MIME 白名单等)
492
+ */
493
+ getUploadConfig() {
494
+ return this.proxy.uploads.config.get();
495
+ }
496
+ /**
497
+ * 已登录读者上传评论图片
498
+ * @param file - 浏览器 File / Blob 或 node 之 Buffer 包装
499
+ */
500
+ uploadImage(file) {
501
+ const form = new FormData();
502
+ form.append("file", file);
503
+ return this.proxy.uploads.post({ data: form });
504
+ }
490
505
  };
491
506
  //#endregion
492
507
  //#region controllers/base.ts
@@ -1226,15 +1241,11 @@ let TimelineType = /* @__PURE__ */ function(TimelineType) {
1226
1241
  }({});
1227
1242
  //#endregion
1228
1243
  //#region ../../apps/core/src/constants/db.constant.ts
1229
- const NOTE_COLLECTION_NAME = "notes";
1230
- const PAGE_COLLECTION_NAME = "pages";
1231
- const POST_COLLECTION_NAME = "posts";
1232
- const RECENTLY_COLLECTION_NAME = "recentlies";
1233
1244
  let CollectionRefTypes = /* @__PURE__ */ function(CollectionRefTypes) {
1234
- CollectionRefTypes[CollectionRefTypes["Post"] = POST_COLLECTION_NAME] = "Post";
1235
- CollectionRefTypes[CollectionRefTypes["Note"] = NOTE_COLLECTION_NAME] = "Note";
1236
- CollectionRefTypes[CollectionRefTypes["Page"] = PAGE_COLLECTION_NAME] = "Page";
1237
- CollectionRefTypes[CollectionRefTypes["Recently"] = RECENTLY_COLLECTION_NAME] = "Recently";
1245
+ CollectionRefTypes["Post"] = "post";
1246
+ CollectionRefTypes["Note"] = "note";
1247
+ CollectionRefTypes["Page"] = "page";
1248
+ CollectionRefTypes["Recently"] = "recently";
1238
1249
  return CollectionRefTypes;
1239
1250
  }({});
1240
1251
  //#endregion
@@ -1271,9 +1282,10 @@ let EnumPageType = /* @__PURE__ */ function(EnumPageType) {
1271
1282
  //#endregion
1272
1283
  //#region models/recently.ts
1273
1284
  let RecentlyRefTypes = /* @__PURE__ */ function(RecentlyRefTypes) {
1274
- RecentlyRefTypes["Post"] = "Post";
1275
- RecentlyRefTypes["Note"] = "Note";
1276
- RecentlyRefTypes["Page"] = "Page";
1285
+ RecentlyRefTypes["Post"] = "post";
1286
+ RecentlyRefTypes["Note"] = "note";
1287
+ RecentlyRefTypes["Page"] = "page";
1288
+ RecentlyRefTypes["Recently"] = "recently";
1277
1289
  return RecentlyRefTypes;
1278
1290
  }({});
1279
1291
  let RecentlyTypeEnum = /* @__PURE__ */ function(RecentlyTypeEnum) {
@@ -1291,6 +1303,7 @@ let RecentlyTypeEnum = /* @__PURE__ */ function(RecentlyTypeEnum) {
1291
1303
  //#region models/snippet.ts
1292
1304
  let SnippetType = /* @__PURE__ */ function(SnippetType) {
1293
1305
  SnippetType["JSON"] = "json";
1306
+ SnippetType["JSON5"] = "json5";
1294
1307
  SnippetType["Function"] = "function";
1295
1308
  SnippetType["Text"] = "text";
1296
1309
  SnippetType["YAML"] = "yaml";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/api-client",
3
- "version": "3.7.1",
3
+ "version": "4.0.0-next.0",
4
4
  "description": "A api client for mx-space server@next",
5
5
  "type": "module",
6
6
  "engines": {
@@ -49,7 +49,7 @@
49
49
  "axios": "^1.15.2",
50
50
  "camelcase-keys": "^10.0.2",
51
51
  "cors": "2.8.6",
52
- "es-toolkit": "1.46.0",
52
+ "es-toolkit": "1.46.1",
53
53
  "express": "5.2.1",
54
54
  "form-data": "4.0.5",
55
55
  "tsdown": "0.21.10",