@mx-space/api-client 1.10.1 → 1.11.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.
@@ -1,7 +1,11 @@
1
1
  import type { IRequestAdapter } from '~/interfaces/adapter'
2
2
  import type { IController } from '~/interfaces/controller'
3
3
  import type { IRequestHandler } from '~/interfaces/request'
4
- import type { ActivityPresence, RoomsData } from '~/models/activity'
4
+ import type {
5
+ ActivityPresence,
6
+ RecentActivities,
7
+ RoomsData,
8
+ } from '~/models/activity'
5
9
  import type { HTTPClient } from '../core'
6
10
 
7
11
  import { autoBind } from '~/utils/auto-bind'
@@ -87,4 +91,8 @@ export class ActivityController<ResponseWrapper> implements IController {
87
91
  async getRoomsInfo() {
88
92
  return this.proxy.rooms.get<RoomsData>()
89
93
  }
94
+
95
+ async getRecentActivities() {
96
+ return this.proxy.recent.get<RecentActivities>()
97
+ }
90
98
  }
@@ -4,11 +4,10 @@ import type { IRequestHandler, RequestProxyResult } from '~/interfaces/request'
4
4
  import type { SelectFields } from '~/interfaces/types'
5
5
  import type { ModelWithLiked, PaginateResult } from '~/models/base'
6
6
  import type { PostModel } from '~/models/post'
7
+ import type { HTTPClient } from '../core/client'
7
8
 
8
9
  import { autoBind } from '~/utils/auto-bind'
9
10
 
10
- import { HTTPClient } from '../core/client'
11
-
12
11
  declare module '../core/client' {
13
12
  interface HTTPClient<
14
13
  T extends IRequestAdapter = IRequestAdapter,
@@ -86,4 +85,8 @@ export class PostController<ResponseWrapper> implements IController {
86
85
  getLatest() {
87
86
  return this.proxy.latest.get<ModelWithLiked<PostModel>>()
88
87
  }
88
+
89
+ getFullUrl(slug: string) {
90
+ return this.proxy('get-url')(slug).get<{ path: string }>()
91
+ }
89
92
  }
@@ -1438,9 +1438,9 @@
1438
1438
  }
1439
1439
  });
1440
1440
 
1441
- // ../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/formats.js
1441
+ // ../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/formats.js
1442
1442
  var require_formats = __commonJS({
1443
- "../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/formats.js"(exports, module) {
1443
+ "../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/formats.js"(exports, module) {
1444
1444
  "use strict";
1445
1445
  var replace = String.prototype.replace;
1446
1446
  var percentTwenties = /%20/g;
@@ -1464,9 +1464,9 @@
1464
1464
  }
1465
1465
  });
1466
1466
 
1467
- // ../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/utils.js
1467
+ // ../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/utils.js
1468
1468
  var require_utils = __commonJS({
1469
- "../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/utils.js"(exports, module) {
1469
+ "../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/utils.js"(exports, module) {
1470
1470
  "use strict";
1471
1471
  var formats = require_formats();
1472
1472
  var has = Object.prototype.hasOwnProperty;
@@ -1567,6 +1567,7 @@
1567
1567
  return strWithoutPlus;
1568
1568
  }
1569
1569
  };
1570
+ var limit = 1024;
1570
1571
  var encode = function encode2(str, defaultEncoder, charset, kind, format) {
1571
1572
  if (str.length === 0) {
1572
1573
  return str;
@@ -1583,27 +1584,32 @@
1583
1584
  });
1584
1585
  }
1585
1586
  var out = "";
1586
- for (var i = 0; i < string.length; ++i) {
1587
- var c = string.charCodeAt(i);
1588
- if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) {
1589
- out += string.charAt(i);
1590
- continue;
1591
- }
1592
- if (c < 128) {
1593
- out = out + hexTable[c];
1594
- continue;
1595
- }
1596
- if (c < 2048) {
1597
- out = out + (hexTable[192 | c >> 6] + hexTable[128 | c & 63]);
1598
- continue;
1599
- }
1600
- if (c < 55296 || c >= 57344) {
1601
- out = out + (hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]);
1602
- continue;
1587
+ for (var j = 0; j < string.length; j += limit) {
1588
+ var segment = string.length >= limit ? string.slice(j, j + limit) : string;
1589
+ var arr = [];
1590
+ for (var i = 0; i < segment.length; ++i) {
1591
+ var c = segment.charCodeAt(i);
1592
+ if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) {
1593
+ arr[arr.length] = segment.charAt(i);
1594
+ continue;
1595
+ }
1596
+ if (c < 128) {
1597
+ arr[arr.length] = hexTable[c];
1598
+ continue;
1599
+ }
1600
+ if (c < 2048) {
1601
+ arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
1602
+ continue;
1603
+ }
1604
+ if (c < 55296 || c >= 57344) {
1605
+ arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
1606
+ continue;
1607
+ }
1608
+ i += 1;
1609
+ c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
1610
+ arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
1603
1611
  }
1604
- i += 1;
1605
- c = 65536 + ((c & 1023) << 10 | string.charCodeAt(i) & 1023);
1606
- out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
1612
+ out += arr.join("");
1607
1613
  }
1608
1614
  return out;
1609
1615
  };
@@ -1663,9 +1669,9 @@
1663
1669
  }
1664
1670
  });
1665
1671
 
1666
- // ../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/stringify.js
1672
+ // ../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/stringify.js
1667
1673
  var require_stringify = __commonJS({
1668
- "../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/stringify.js"(exports, module) {
1674
+ "../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/stringify.js"(exports, module) {
1669
1675
  "use strict";
1670
1676
  var getSideChannel = require_side_channel();
1671
1677
  var utils = require_utils();
@@ -1943,9 +1949,9 @@
1943
1949
  }
1944
1950
  });
1945
1951
 
1946
- // ../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/parse.js
1952
+ // ../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/parse.js
1947
1953
  var require_parse = __commonJS({
1948
- "../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/parse.js"(exports, module) {
1954
+ "../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/parse.js"(exports, module) {
1949
1955
  "use strict";
1950
1956
  var utils = require_utils();
1951
1957
  var has = Object.prototype.hasOwnProperty;
@@ -1959,7 +1965,7 @@
1959
1965
  charset: "utf-8",
1960
1966
  charsetSentinel: false,
1961
1967
  comma: false,
1962
- decodeDotInKeys: true,
1968
+ decodeDotInKeys: false,
1963
1969
  decoder: utils.decode,
1964
1970
  delimiter: "&",
1965
1971
  depth: 5,
@@ -2164,9 +2170,9 @@
2164
2170
  }
2165
2171
  });
2166
2172
 
2167
- // ../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/index.js
2173
+ // ../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/index.js
2168
2174
  var require_lib = __commonJS({
2169
- "../../node_modules/.pnpm/qs@6.12.0/node_modules/qs/lib/index.js"(exports, module) {
2175
+ "../../node_modules/.pnpm/qs@6.12.1/node_modules/qs/lib/index.js"(exports, module) {
2170
2176
  "use strict";
2171
2177
  var stringify2 = require_stringify();
2172
2178
  var parse2 = require_parse();
package/dist/index.cjs CHANGED
@@ -244,6 +244,9 @@ var ActivityController = class {
244
244
  async getRoomsInfo() {
245
245
  return this.proxy.rooms.get();
246
246
  }
247
+ async getRecentActivities() {
248
+ return this.proxy.recent.get();
249
+ }
247
250
  };
248
251
 
249
252
  // controllers/aggregate.ts
@@ -617,6 +620,9 @@ var PostController = class {
617
620
  getLatest() {
618
621
  return this.proxy.latest.get();
619
622
  }
623
+ getFullUrl(slug) {
624
+ return this.proxy("get-url")(slug).get();
625
+ }
620
626
  };
621
627
 
622
628
  // controllers/project.ts
package/dist/index.d.cts CHANGED
@@ -121,6 +121,13 @@ declare class AckController<ResponseWrapper> implements IController {
121
121
  }>;
122
122
  }
123
123
 
124
+ declare enum CollectionRefTypes {
125
+ Post = "posts",
126
+ Note = "notes",
127
+ Page = "pages",
128
+ Recently = "recentlies"
129
+ }
130
+
124
131
  interface Count {
125
132
  read: number;
126
133
  like: number;
@@ -240,6 +247,53 @@ interface RoomsData {
240
247
  pages: RoomOmittedPage[];
241
248
  };
242
249
  }
250
+ interface RecentActivities {
251
+ like: RecentLike[];
252
+ comment: RecentComment[];
253
+ recent: RecentRecent[];
254
+ post: RecentPost[];
255
+ note: RecentNote[];
256
+ }
257
+ interface RecentComment {
258
+ created: string;
259
+ author: string;
260
+ text: string;
261
+ id: string;
262
+ title: string;
263
+ slug?: string;
264
+ type: string;
265
+ avatar: string;
266
+ nid?: string;
267
+ }
268
+ interface RecentLike {
269
+ created: string;
270
+ id: string;
271
+ type: CollectionRefTypes.Post | CollectionRefTypes.Note;
272
+ nid?: number;
273
+ slug?: string;
274
+ title: string;
275
+ }
276
+ interface RecentNote {
277
+ id: string;
278
+ created: string;
279
+ title: string;
280
+ modified: string;
281
+ nid: number;
282
+ }
283
+ interface RecentPost {
284
+ id: string;
285
+ created: string;
286
+ title: string;
287
+ modified: string;
288
+ slug: string;
289
+ }
290
+ interface RecentRecent {
291
+ id: string;
292
+ content: string;
293
+ up: number;
294
+ down: number;
295
+ created: string;
296
+ }
243
297
 
244
298
  declare module '../core/client' {
245
299
  interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
@@ -332,6 +386,40 @@ declare class ActivityController<ResponseWrapper> implements IController {
332
386
  };
333
387
  $serialized: RoomsData;
334
388
  }>;
389
+ getRecentActivities(): Promise<RecentActivities & {
390
+ $raw: ResponseWrapper extends {
391
+ data: infer T;
392
+ } ? ResponseWrapper : ResponseWrapper extends unknown ? {
393
+ [i: string]: any;
394
+ data: (ResponseWrapper extends unknown ? {
395
+ [key: string]: any;
396
+ data: RecentActivities;
397
+ } : ResponseWrapper extends {
398
+ data: RecentActivities;
399
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
400
+ data: RecentActivities;
401
+ }) extends infer T ? T extends (ResponseWrapper extends unknown ? {
402
+ [key: string]: any;
403
+ data: RecentActivities;
404
+ } : ResponseWrapper extends {
405
+ data: RecentActivities;
406
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
407
+ data: RecentActivities;
408
+ }) ? T extends unknown ? {
409
+ like: RecentLike[];
410
+ comment: RecentComment[];
411
+ recent: RecentRecent[];
412
+ post: RecentPost[];
413
+ note: RecentNote[];
414
+ } : T : never : never;
415
+ } : ResponseWrapper;
416
+ $request: {
417
+ [k: string]: string;
418
+ path: string;
419
+ method: string;
420
+ };
421
+ $serialized: RecentActivities;
422
+ }>;
335
423
  }
336
424
 
337
425
  type SortOrder = 'asc' | 'desc';
@@ -722,13 +810,6 @@ interface PaginationParams {
722
810
  page?: number;
723
811
  }
724
812
 
725
- declare enum CollectionRefTypes {
726
- Post = "posts",
727
- Note = "notes",
728
- Page = "pages",
729
- Recently = "recentlies"
730
- }
731
-
732
813
  interface CommentModel extends BaseModel {
733
814
  refType: CollectionRefTypes;
734
815
  ref: string;
@@ -1116,6 +1197,22 @@ declare class PostController<ResponseWrapper> implements IController {
1116
1197
  } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1117
1198
  data: ModelWithLiked<PostModel>;
1118
1199
  }>;
1200
+ getFullUrl(slug: string): RequestProxyResult<{
1201
+ path: string;
1202
+ }, ResponseWrapper, ResponseWrapper extends unknown ? {
1203
+ [key: string]: any;
1204
+ data: {
1205
+ path: string;
1206
+ };
1207
+ } : ResponseWrapper extends {
1208
+ data: {
1209
+ path: string;
1210
+ };
1211
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1212
+ data: {
1213
+ path: string;
1214
+ };
1215
+ }>;
1119
1216
  }
1120
1217
 
1121
1218
  interface ProjectModel extends BaseModel {
@@ -1629,4 +1726,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
1629
1726
  */
1630
1727
  declare const camelcaseKeys: <T = any>(obj: any) => T;
1631
1728
 
1632
- export { AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, 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, 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, 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 };
1729
+ export { AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, 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, 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 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
@@ -121,6 +121,13 @@ declare class AckController<ResponseWrapper> implements IController {
121
121
  }>;
122
122
  }
123
123
 
124
+ declare enum CollectionRefTypes {
125
+ Post = "posts",
126
+ Note = "notes",
127
+ Page = "pages",
128
+ Recently = "recentlies"
129
+ }
130
+
124
131
  interface Count {
125
132
  read: number;
126
133
  like: number;
@@ -240,6 +247,53 @@ interface RoomsData {
240
247
  pages: RoomOmittedPage[];
241
248
  };
242
249
  }
250
+ interface RecentActivities {
251
+ like: RecentLike[];
252
+ comment: RecentComment[];
253
+ recent: RecentRecent[];
254
+ post: RecentPost[];
255
+ note: RecentNote[];
256
+ }
257
+ interface RecentComment {
258
+ created: string;
259
+ author: string;
260
+ text: string;
261
+ id: string;
262
+ title: string;
263
+ slug?: string;
264
+ type: string;
265
+ avatar: string;
266
+ nid?: string;
267
+ }
268
+ interface RecentLike {
269
+ created: string;
270
+ id: string;
271
+ type: CollectionRefTypes.Post | CollectionRefTypes.Note;
272
+ nid?: number;
273
+ slug?: string;
274
+ title: string;
275
+ }
276
+ interface RecentNote {
277
+ id: string;
278
+ created: string;
279
+ title: string;
280
+ modified: string;
281
+ nid: number;
282
+ }
283
+ interface RecentPost {
284
+ id: string;
285
+ created: string;
286
+ title: string;
287
+ modified: string;
288
+ slug: string;
289
+ }
290
+ interface RecentRecent {
291
+ id: string;
292
+ content: string;
293
+ up: number;
294
+ down: number;
295
+ created: string;
296
+ }
243
297
 
244
298
  declare module '@mx-space/api-client' {
245
299
  interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
@@ -332,6 +386,40 @@ declare class ActivityController<ResponseWrapper> implements IController {
332
386
  };
333
387
  $serialized: RoomsData;
334
388
  }>;
389
+ getRecentActivities(): Promise<RecentActivities & {
390
+ $raw: ResponseWrapper extends {
391
+ data: infer T;
392
+ } ? ResponseWrapper : ResponseWrapper extends unknown ? {
393
+ [i: string]: any;
394
+ data: (ResponseWrapper extends unknown ? {
395
+ [key: string]: any;
396
+ data: RecentActivities;
397
+ } : ResponseWrapper extends {
398
+ data: RecentActivities;
399
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
400
+ data: RecentActivities;
401
+ }) extends infer T ? T extends (ResponseWrapper extends unknown ? {
402
+ [key: string]: any;
403
+ data: RecentActivities;
404
+ } : ResponseWrapper extends {
405
+ data: RecentActivities;
406
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
407
+ data: RecentActivities;
408
+ }) ? T extends unknown ? {
409
+ like: RecentLike[];
410
+ comment: RecentComment[];
411
+ recent: RecentRecent[];
412
+ post: RecentPost[];
413
+ note: RecentNote[];
414
+ } : T : never : never;
415
+ } : ResponseWrapper;
416
+ $request: {
417
+ [k: string]: string;
418
+ path: string;
419
+ method: string;
420
+ };
421
+ $serialized: RecentActivities;
422
+ }>;
335
423
  }
336
424
 
337
425
  type SortOrder = 'asc' | 'desc';
@@ -722,13 +810,6 @@ interface PaginationParams {
722
810
  page?: number;
723
811
  }
724
812
 
725
- declare enum CollectionRefTypes {
726
- Post = "posts",
727
- Note = "notes",
728
- Page = "pages",
729
- Recently = "recentlies"
730
- }
731
-
732
813
  interface CommentModel extends BaseModel {
733
814
  refType: CollectionRefTypes;
734
815
  ref: string;
@@ -1116,6 +1197,22 @@ declare class PostController<ResponseWrapper> implements IController {
1116
1197
  } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1117
1198
  data: ModelWithLiked<PostModel>;
1118
1199
  }>;
1200
+ getFullUrl(slug: string): RequestProxyResult<{
1201
+ path: string;
1202
+ }, ResponseWrapper, ResponseWrapper extends unknown ? {
1203
+ [key: string]: any;
1204
+ data: {
1205
+ path: string;
1206
+ };
1207
+ } : ResponseWrapper extends {
1208
+ data: {
1209
+ path: string;
1210
+ };
1211
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1212
+ data: {
1213
+ path: string;
1214
+ };
1215
+ }>;
1119
1216
  }
1120
1217
 
1121
1218
  interface ProjectModel extends BaseModel {
@@ -1629,4 +1726,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
1629
1726
  */
1630
1727
  declare const camelcaseKeys: <T = any>(obj: any) => T;
1631
1728
 
1632
- export { AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, 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, 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, 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 };
1729
+ export { AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, 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, 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 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 };
@@ -180,6 +180,9 @@
180
180
  async getRoomsInfo() {
181
181
  return this.proxy.rooms.get();
182
182
  }
183
+ async getRecentActivities() {
184
+ return this.proxy.recent.get();
185
+ }
183
186
  };
184
187
 
185
188
  // controllers/aggregate.ts
@@ -553,6 +556,9 @@
553
556
  getLatest() {
554
557
  return this.proxy.latest.get();
555
558
  }
559
+ getFullUrl(slug) {
560
+ return this.proxy("get-url")(slug).get();
561
+ }
556
562
  };
557
563
 
558
564
  // controllers/project.ts
package/dist/index.js CHANGED
@@ -178,6 +178,9 @@ var ActivityController = class {
178
178
  async getRoomsInfo() {
179
179
  return this.proxy.rooms.get();
180
180
  }
181
+ async getRecentActivities() {
182
+ return this.proxy.recent.get();
183
+ }
181
184
  };
182
185
 
183
186
  // controllers/aggregate.ts
@@ -551,6 +554,9 @@ var PostController = class {
551
554
  getLatest() {
552
555
  return this.proxy.latest.get();
553
556
  }
557
+ getFullUrl(slug) {
558
+ return this.proxy("get-url")(slug).get();
559
+ }
554
560
  };
555
561
 
556
562
  // controllers/project.ts
@@ -1,3 +1,4 @@
1
+ import type { CollectionRefTypes } from '@core/constants/db.constant'
1
2
  import type { CategoryModel } from './category'
2
3
 
3
4
  export interface ActivityPresence {
@@ -45,3 +46,57 @@ export interface RoomsData {
45
46
  pages: RoomOmittedPage[]
46
47
  }
47
48
  }
49
+
50
+ export interface RecentActivities {
51
+ like: RecentLike[]
52
+ comment: RecentComment[]
53
+ recent: RecentRecent[]
54
+ post: RecentPost[]
55
+ note: RecentNote[]
56
+ }
57
+
58
+ export interface RecentComment {
59
+ created: string
60
+ author: string
61
+ text: string
62
+ id: string
63
+ title: string
64
+ slug?: string
65
+ type: string
66
+ avatar: string
67
+ nid?: string
68
+ }
69
+
70
+ export interface RecentLike {
71
+ created: string
72
+ id: string
73
+ type: CollectionRefTypes.Post | CollectionRefTypes.Note
74
+ nid?: number
75
+ slug?: string
76
+ title: string
77
+ }
78
+
79
+ export interface RecentNote {
80
+ id: string
81
+ created: string
82
+ title: string
83
+ modified: string
84
+ nid: number
85
+ }
86
+
87
+ export interface RecentPost {
88
+ id: string
89
+ created: string
90
+ title: string
91
+ modified: string
92
+ slug: string
93
+ }
94
+
95
+ export interface RecentRecent {
96
+ id: string
97
+
98
+ content: string
99
+ up: number
100
+ down: number
101
+ created: string
102
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/api-client",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "description": "A api client for mx-space server@next",
6
6
  "author": "Innei",