@mx-space/api-client 1.14.0 → 1.14.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/controllers/activity.ts +5 -1
- package/dist/index.d.cts +348 -326
- package/dist/index.d.ts +348 -326
- package/models/activity.ts +1 -0
- package/models/auth.ts +8 -0
- package/models/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -215,6 +215,7 @@ interface ActivityPresence {
|
|
|
215
215
|
joinedAt: number;
|
|
216
216
|
connectedAt: number;
|
|
217
217
|
updatedAt: number;
|
|
218
|
+
readerId?: string;
|
|
218
219
|
displayName?: string;
|
|
219
220
|
}
|
|
220
221
|
interface RoomOmittedNote {
|
|
@@ -324,137 +325,6 @@ interface NotesItem {
|
|
|
324
325
|
bookmark: boolean;
|
|
325
326
|
}
|
|
326
327
|
|
|
327
|
-
declare module '@mx-space/api-client' {
|
|
328
|
-
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
329
|
-
activity: ActivityController<ResponseWrapper>;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* @support core >= 4.3.0
|
|
334
|
-
*/
|
|
335
|
-
declare class ActivityController<ResponseWrapper> implements IController {
|
|
336
|
-
private client;
|
|
337
|
-
base: string;
|
|
338
|
-
name: string;
|
|
339
|
-
constructor(client: HTTPClient);
|
|
340
|
-
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
341
|
-
likeIt(type: 'Post' | 'Note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
342
|
-
[key: string]: any;
|
|
343
|
-
data: never;
|
|
344
|
-
} : ResponseWrapper extends {
|
|
345
|
-
data: never;
|
|
346
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
347
|
-
data: never;
|
|
348
|
-
}>;
|
|
349
|
-
/**
|
|
350
|
-
*
|
|
351
|
-
* @support core >= 5.0.0
|
|
352
|
-
*/
|
|
353
|
-
getPresence(roomName: string): RequestProxyResult<Record<string, ActivityPresence>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
354
|
-
[key: string]: any;
|
|
355
|
-
data: Record<string, ActivityPresence>;
|
|
356
|
-
} : ResponseWrapper extends {
|
|
357
|
-
data: Record<string, ActivityPresence>;
|
|
358
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
359
|
-
data: Record<string, ActivityPresence>;
|
|
360
|
-
}>;
|
|
361
|
-
/**
|
|
362
|
-
*
|
|
363
|
-
* @support core >= 5.0.0
|
|
364
|
-
*/
|
|
365
|
-
updatePresence({ identity, position, roomName, sid, ts, displayName, readerId, }: {
|
|
366
|
-
roomName: string;
|
|
367
|
-
position: number;
|
|
368
|
-
identity: string;
|
|
369
|
-
sid: string;
|
|
370
|
-
displayName?: string;
|
|
371
|
-
ts?: number;
|
|
372
|
-
readerId?: string;
|
|
373
|
-
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
374
|
-
[key: string]: any;
|
|
375
|
-
data: unknown;
|
|
376
|
-
} : ResponseWrapper extends {
|
|
377
|
-
data: unknown;
|
|
378
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
379
|
-
data: unknown;
|
|
380
|
-
}>;
|
|
381
|
-
getRoomsInfo(): Promise<RoomsData & {
|
|
382
|
-
$raw: ResponseWrapper extends {
|
|
383
|
-
data: infer T;
|
|
384
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
385
|
-
[i: string]: any;
|
|
386
|
-
data: (ResponseWrapper extends unknown ? {
|
|
387
|
-
[key: string]: any;
|
|
388
|
-
data: RoomsData;
|
|
389
|
-
} : ResponseWrapper extends {
|
|
390
|
-
data: RoomsData;
|
|
391
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
392
|
-
data: RoomsData;
|
|
393
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
394
|
-
[key: string]: any;
|
|
395
|
-
data: RoomsData;
|
|
396
|
-
} : ResponseWrapper extends {
|
|
397
|
-
data: RoomsData;
|
|
398
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
399
|
-
data: RoomsData;
|
|
400
|
-
}) ? T_1 extends unknown ? {
|
|
401
|
-
rooms: string[];
|
|
402
|
-
room_count: {
|
|
403
|
-
[key: string]: number;
|
|
404
|
-
};
|
|
405
|
-
objects: {
|
|
406
|
-
posts: RoomOmittedPost[];
|
|
407
|
-
notes: RoomOmittedNote[];
|
|
408
|
-
pages: RoomOmittedPage[];
|
|
409
|
-
};
|
|
410
|
-
} : T_1 : never : never;
|
|
411
|
-
} : ResponseWrapper;
|
|
412
|
-
$request: {
|
|
413
|
-
path: string;
|
|
414
|
-
method: string;
|
|
415
|
-
[k: string]: string;
|
|
416
|
-
};
|
|
417
|
-
$serialized: RoomsData;
|
|
418
|
-
}>;
|
|
419
|
-
getRecentActivities(): Promise<RecentActivities & {
|
|
420
|
-
$raw: ResponseWrapper extends {
|
|
421
|
-
data: infer T;
|
|
422
|
-
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
423
|
-
[i: string]: any;
|
|
424
|
-
data: (ResponseWrapper extends unknown ? {
|
|
425
|
-
[key: string]: any;
|
|
426
|
-
data: RecentActivities;
|
|
427
|
-
} : ResponseWrapper extends {
|
|
428
|
-
data: RecentActivities;
|
|
429
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
430
|
-
data: RecentActivities;
|
|
431
|
-
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
432
|
-
[key: string]: any;
|
|
433
|
-
data: RecentActivities;
|
|
434
|
-
} : ResponseWrapper extends {
|
|
435
|
-
data: RecentActivities;
|
|
436
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
437
|
-
data: RecentActivities;
|
|
438
|
-
}) ? T_1 extends unknown ? {
|
|
439
|
-
like: RecentLike[];
|
|
440
|
-
comment: RecentComment[];
|
|
441
|
-
recent: RecentRecent[];
|
|
442
|
-
post: RecentPost[];
|
|
443
|
-
note: RecentNote[];
|
|
444
|
-
} : T_1 : never : never;
|
|
445
|
-
} : ResponseWrapper;
|
|
446
|
-
$request: {
|
|
447
|
-
path: string;
|
|
448
|
-
method: string;
|
|
449
|
-
[k: string]: string;
|
|
450
|
-
};
|
|
451
|
-
$serialized: RecentActivities;
|
|
452
|
-
}>;
|
|
453
|
-
getLastYearPublication(): Promise<LastYearPublication>;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
type SortOrder = 'asc' | 'desc';
|
|
457
|
-
|
|
458
328
|
interface TopicModel extends BaseModel {
|
|
459
329
|
description?: string;
|
|
460
330
|
introduce: string;
|
|
@@ -595,73 +465,353 @@ interface UserModel extends BaseModel {
|
|
|
595
465
|
avatar: string;
|
|
596
466
|
postID: string;
|
|
597
467
|
}
|
|
598
|
-
type TLogin = {
|
|
599
|
-
token: string;
|
|
600
|
-
expiresIn: number;
|
|
601
|
-
lastLoginTime: null | string;
|
|
602
|
-
lastLoginIp?: null | string;
|
|
603
|
-
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
468
|
+
type TLogin = {
|
|
469
|
+
token: string;
|
|
470
|
+
expiresIn: number;
|
|
471
|
+
lastLoginTime: null | string;
|
|
472
|
+
lastLoginIp?: null | string;
|
|
473
|
+
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
474
|
+
|
|
475
|
+
interface AggregateRoot {
|
|
476
|
+
user: UserModel;
|
|
477
|
+
seo: SeoOptionModel;
|
|
478
|
+
url: Url;
|
|
479
|
+
categories: CategoryModel[];
|
|
480
|
+
pageMeta: Pick<PageModel, 'title' | 'id' | 'slug' | 'order'>[] | null;
|
|
481
|
+
/**
|
|
482
|
+
* @available 4.2.2
|
|
483
|
+
*/
|
|
484
|
+
latestNoteId: {
|
|
485
|
+
id: string;
|
|
486
|
+
nid: number;
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
490
|
+
theme?: Theme;
|
|
491
|
+
}
|
|
492
|
+
interface Url {
|
|
493
|
+
wsUrl: string;
|
|
494
|
+
serverUrl: string;
|
|
495
|
+
webUrl: string;
|
|
496
|
+
}
|
|
497
|
+
interface AggregateTopNote extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images'> {
|
|
498
|
+
}
|
|
499
|
+
interface AggregateTopPost extends Pick<PostModel, 'id' | 'slug' | 'created' | 'title' | 'category' | 'images'> {
|
|
500
|
+
}
|
|
501
|
+
interface AggregateTop {
|
|
502
|
+
notes: AggregateTopNote[];
|
|
503
|
+
posts: AggregateTopPost[];
|
|
504
|
+
says: SayModel[];
|
|
505
|
+
}
|
|
506
|
+
declare enum TimelineType {
|
|
507
|
+
Post = 0,
|
|
508
|
+
Note = 1
|
|
509
|
+
}
|
|
510
|
+
interface TimelineData {
|
|
511
|
+
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'bookmark'>[];
|
|
512
|
+
posts?: (Pick<PostModel, 'id' | 'title' | 'slug' | 'created' | 'modified' | 'category'> & {
|
|
513
|
+
url: string;
|
|
514
|
+
})[];
|
|
515
|
+
}
|
|
516
|
+
interface AggregateStat {
|
|
517
|
+
allComments: number;
|
|
518
|
+
categories: number;
|
|
519
|
+
comments: number;
|
|
520
|
+
linkApply: number;
|
|
521
|
+
links: number;
|
|
522
|
+
notes: number;
|
|
523
|
+
pages: number;
|
|
524
|
+
posts: number;
|
|
525
|
+
says: number;
|
|
526
|
+
recently: number;
|
|
527
|
+
unreadComments: number;
|
|
528
|
+
online: number;
|
|
529
|
+
todayMaxOnline: string;
|
|
530
|
+
todayOnlineTotal: string;
|
|
531
|
+
callTime: number;
|
|
532
|
+
uv: number;
|
|
533
|
+
todayIpAccessCount: number;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
interface AISummaryModel {
|
|
537
|
+
id: string;
|
|
538
|
+
created: string;
|
|
539
|
+
summary: string;
|
|
540
|
+
hash: string;
|
|
541
|
+
refId: string;
|
|
542
|
+
lang: string;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
interface AuthUser {
|
|
546
|
+
id: string;
|
|
547
|
+
email: string;
|
|
548
|
+
isOwner: boolean;
|
|
549
|
+
image: string;
|
|
550
|
+
name: string;
|
|
551
|
+
provider: string;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
interface CommentModel extends BaseModel {
|
|
555
|
+
refType: CollectionRefTypes;
|
|
556
|
+
ref: string;
|
|
557
|
+
state: number;
|
|
558
|
+
commentsIndex: number;
|
|
559
|
+
author: string;
|
|
560
|
+
text: string;
|
|
561
|
+
mail?: string;
|
|
562
|
+
url?: string;
|
|
563
|
+
ip?: string;
|
|
564
|
+
agent?: string;
|
|
565
|
+
key: string;
|
|
566
|
+
pin?: boolean;
|
|
567
|
+
avatar: string;
|
|
568
|
+
parent?: CommentModel | string;
|
|
569
|
+
children: CommentModel[];
|
|
570
|
+
isWhispers?: boolean;
|
|
571
|
+
location?: string;
|
|
572
|
+
source?: string;
|
|
573
|
+
}
|
|
574
|
+
interface CommentRef {
|
|
575
|
+
id: string;
|
|
576
|
+
categoryId?: string;
|
|
577
|
+
slug: string;
|
|
578
|
+
title: string;
|
|
579
|
+
category?: CategoryModel;
|
|
580
|
+
}
|
|
581
|
+
declare enum CommentState {
|
|
582
|
+
Unread = 0,
|
|
583
|
+
Read = 1,
|
|
584
|
+
Junk = 2
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
declare enum LinkType {
|
|
588
|
+
Friend = 0,
|
|
589
|
+
Collection = 1
|
|
590
|
+
}
|
|
591
|
+
declare enum LinkState {
|
|
592
|
+
Pass = 0,
|
|
593
|
+
Audit = 1,
|
|
594
|
+
Outdate = 2,
|
|
595
|
+
Banned = 3,
|
|
596
|
+
Reject = 4
|
|
597
|
+
}
|
|
598
|
+
interface LinkModel extends BaseModel {
|
|
599
|
+
name: string;
|
|
600
|
+
url: string;
|
|
601
|
+
avatar: string;
|
|
602
|
+
description?: string;
|
|
603
|
+
type: LinkType;
|
|
604
|
+
state: LinkState;
|
|
605
|
+
hide: boolean;
|
|
606
|
+
email: string;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
interface ProjectModel extends BaseModel {
|
|
610
|
+
name: string;
|
|
611
|
+
previewUrl?: string;
|
|
612
|
+
docUrl?: string;
|
|
613
|
+
projectUrl?: string;
|
|
614
|
+
images?: string[];
|
|
615
|
+
description: string;
|
|
616
|
+
avatar?: string;
|
|
617
|
+
text: string;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
declare enum RecentlyRefTypes {
|
|
621
|
+
Post = "Post",
|
|
622
|
+
Note = "Note",
|
|
623
|
+
Page = "Page"
|
|
624
|
+
}
|
|
625
|
+
type RecentlyRefType = {
|
|
626
|
+
title: string;
|
|
627
|
+
url: string;
|
|
628
|
+
};
|
|
629
|
+
interface RecentlyModel extends BaseCommentIndexModel {
|
|
630
|
+
content: string;
|
|
631
|
+
ref?: RecentlyRefType & {
|
|
632
|
+
[key: string]: any;
|
|
633
|
+
};
|
|
634
|
+
refId?: string;
|
|
635
|
+
refType?: RecentlyRefTypes;
|
|
636
|
+
up: number;
|
|
637
|
+
down: number;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
declare enum SnippetType {
|
|
641
|
+
JSON = "json",
|
|
642
|
+
Function = "function",
|
|
643
|
+
Text = "text",
|
|
644
|
+
YAML = "yaml"
|
|
645
|
+
}
|
|
646
|
+
interface SnippetModel<T = unknown> extends BaseModel {
|
|
647
|
+
type: SnippetType;
|
|
648
|
+
private: boolean;
|
|
649
|
+
raw: string;
|
|
650
|
+
name: string;
|
|
651
|
+
reference: string;
|
|
652
|
+
comment?: string;
|
|
653
|
+
metatype?: string;
|
|
654
|
+
schema?: string;
|
|
655
|
+
data: T;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
declare const SubscribePostCreateBit: number;
|
|
659
|
+
declare const SubscribeNoteCreateBit: number;
|
|
660
|
+
declare const SubscribeSayCreateBit: number;
|
|
661
|
+
declare const SubscribeRecentCreateBit: number;
|
|
662
|
+
declare const SubscribeAllBit: number;
|
|
663
|
+
declare const SubscribeTypeToBitMap: {
|
|
664
|
+
post_c: number;
|
|
665
|
+
note_c: number;
|
|
666
|
+
say_c: number;
|
|
667
|
+
recently_c: number;
|
|
668
|
+
all: number;
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
type SubscribeType = keyof typeof SubscribeTypeToBitMap;
|
|
672
|
+
|
|
673
|
+
declare module '@mx-space/api-client' {
|
|
674
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
675
|
+
activity: ActivityController<ResponseWrapper>;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* @support core >= 4.3.0
|
|
680
|
+
*/
|
|
681
|
+
declare class ActivityController<ResponseWrapper> implements IController {
|
|
682
|
+
private client;
|
|
683
|
+
base: string;
|
|
684
|
+
name: string;
|
|
685
|
+
constructor(client: HTTPClient);
|
|
686
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
687
|
+
likeIt(type: 'Post' | 'Note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
688
|
+
[key: string]: any;
|
|
689
|
+
data: never;
|
|
690
|
+
} : ResponseWrapper extends {
|
|
691
|
+
data: never;
|
|
692
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
693
|
+
data: never;
|
|
694
|
+
}>;
|
|
695
|
+
/**
|
|
696
|
+
*
|
|
697
|
+
* @support core >= 5.0.0
|
|
698
|
+
*/
|
|
699
|
+
getPresence(roomName: string): RequestProxyResult<{
|
|
700
|
+
data: Record<string, ActivityPresence>;
|
|
701
|
+
readers: Record<string, AuthUser>;
|
|
702
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
703
|
+
[key: string]: any;
|
|
704
|
+
data: {
|
|
705
|
+
data: Record<string, ActivityPresence>;
|
|
706
|
+
readers: Record<string, AuthUser>;
|
|
707
|
+
};
|
|
708
|
+
} : ResponseWrapper extends {
|
|
709
|
+
data: {
|
|
710
|
+
data: Record<string, ActivityPresence>;
|
|
711
|
+
readers: Record<string, AuthUser>;
|
|
712
|
+
};
|
|
713
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
714
|
+
data: {
|
|
715
|
+
data: Record<string, ActivityPresence>;
|
|
716
|
+
readers: Record<string, AuthUser>;
|
|
717
|
+
};
|
|
718
|
+
}>;
|
|
719
|
+
/**
|
|
720
|
+
*
|
|
721
|
+
* @support core >= 5.0.0
|
|
722
|
+
*/
|
|
723
|
+
updatePresence({ identity, position, roomName, sid, ts, displayName, readerId, }: {
|
|
724
|
+
roomName: string;
|
|
725
|
+
position: number;
|
|
726
|
+
identity: string;
|
|
727
|
+
sid: string;
|
|
728
|
+
displayName?: string;
|
|
729
|
+
ts?: number;
|
|
730
|
+
readerId?: string;
|
|
731
|
+
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
732
|
+
[key: string]: any;
|
|
733
|
+
data: unknown;
|
|
734
|
+
} : ResponseWrapper extends {
|
|
735
|
+
data: unknown;
|
|
736
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
737
|
+
data: unknown;
|
|
738
|
+
}>;
|
|
739
|
+
getRoomsInfo(): Promise<RoomsData & {
|
|
740
|
+
$raw: ResponseWrapper extends {
|
|
741
|
+
data: infer T;
|
|
742
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
743
|
+
[i: string]: any;
|
|
744
|
+
data: (ResponseWrapper extends unknown ? {
|
|
745
|
+
[key: string]: any;
|
|
746
|
+
data: RoomsData;
|
|
747
|
+
} : ResponseWrapper extends {
|
|
748
|
+
data: RoomsData;
|
|
749
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
750
|
+
data: RoomsData;
|
|
751
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
752
|
+
[key: string]: any;
|
|
753
|
+
data: RoomsData;
|
|
754
|
+
} : ResponseWrapper extends {
|
|
755
|
+
data: RoomsData;
|
|
756
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
757
|
+
data: RoomsData;
|
|
758
|
+
}) ? T_1 extends unknown ? {
|
|
759
|
+
rooms: string[];
|
|
760
|
+
room_count: {
|
|
761
|
+
[key: string]: number;
|
|
762
|
+
};
|
|
763
|
+
objects: {
|
|
764
|
+
posts: RoomOmittedPost[];
|
|
765
|
+
notes: RoomOmittedNote[];
|
|
766
|
+
pages: RoomOmittedPage[];
|
|
767
|
+
};
|
|
768
|
+
} : T_1 : never : never;
|
|
769
|
+
} : ResponseWrapper;
|
|
770
|
+
$request: {
|
|
771
|
+
path: string;
|
|
772
|
+
method: string;
|
|
773
|
+
[k: string]: string;
|
|
774
|
+
};
|
|
775
|
+
$serialized: RoomsData;
|
|
776
|
+
}>;
|
|
777
|
+
getRecentActivities(): Promise<RecentActivities & {
|
|
778
|
+
$raw: ResponseWrapper extends {
|
|
779
|
+
data: infer T;
|
|
780
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
781
|
+
[i: string]: any;
|
|
782
|
+
data: (ResponseWrapper extends unknown ? {
|
|
783
|
+
[key: string]: any;
|
|
784
|
+
data: RecentActivities;
|
|
785
|
+
} : ResponseWrapper extends {
|
|
786
|
+
data: RecentActivities;
|
|
787
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
788
|
+
data: RecentActivities;
|
|
789
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
790
|
+
[key: string]: any;
|
|
791
|
+
data: RecentActivities;
|
|
792
|
+
} : ResponseWrapper extends {
|
|
793
|
+
data: RecentActivities;
|
|
794
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
795
|
+
data: RecentActivities;
|
|
796
|
+
}) ? T_1 extends unknown ? {
|
|
797
|
+
like: RecentLike[];
|
|
798
|
+
comment: RecentComment[];
|
|
799
|
+
recent: RecentRecent[];
|
|
800
|
+
post: RecentPost[];
|
|
801
|
+
note: RecentNote[];
|
|
802
|
+
} : T_1 : never : never;
|
|
803
|
+
} : ResponseWrapper;
|
|
804
|
+
$request: {
|
|
805
|
+
path: string;
|
|
806
|
+
method: string;
|
|
807
|
+
[k: string]: string;
|
|
808
|
+
};
|
|
809
|
+
$serialized: RecentActivities;
|
|
810
|
+
}>;
|
|
811
|
+
getLastYearPublication(): Promise<LastYearPublication>;
|
|
812
|
+
}
|
|
604
813
|
|
|
605
|
-
|
|
606
|
-
user: UserModel;
|
|
607
|
-
seo: SeoOptionModel;
|
|
608
|
-
url: Url;
|
|
609
|
-
categories: CategoryModel[];
|
|
610
|
-
pageMeta: Pick<PageModel, 'title' | 'id' | 'slug' | 'order'>[] | null;
|
|
611
|
-
/**
|
|
612
|
-
* @available 4.2.2
|
|
613
|
-
*/
|
|
614
|
-
latestNoteId: {
|
|
615
|
-
id: string;
|
|
616
|
-
nid: number;
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
620
|
-
theme?: Theme;
|
|
621
|
-
}
|
|
622
|
-
interface Url {
|
|
623
|
-
wsUrl: string;
|
|
624
|
-
serverUrl: string;
|
|
625
|
-
webUrl: string;
|
|
626
|
-
}
|
|
627
|
-
interface AggregateTopNote extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images'> {
|
|
628
|
-
}
|
|
629
|
-
interface AggregateTopPost extends Pick<PostModel, 'id' | 'slug' | 'created' | 'title' | 'category' | 'images'> {
|
|
630
|
-
}
|
|
631
|
-
interface AggregateTop {
|
|
632
|
-
notes: AggregateTopNote[];
|
|
633
|
-
posts: AggregateTopPost[];
|
|
634
|
-
says: SayModel[];
|
|
635
|
-
}
|
|
636
|
-
declare enum TimelineType {
|
|
637
|
-
Post = 0,
|
|
638
|
-
Note = 1
|
|
639
|
-
}
|
|
640
|
-
interface TimelineData {
|
|
641
|
-
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'bookmark'>[];
|
|
642
|
-
posts?: (Pick<PostModel, 'id' | 'title' | 'slug' | 'created' | 'modified' | 'category'> & {
|
|
643
|
-
url: string;
|
|
644
|
-
})[];
|
|
645
|
-
}
|
|
646
|
-
interface AggregateStat {
|
|
647
|
-
allComments: number;
|
|
648
|
-
categories: number;
|
|
649
|
-
comments: number;
|
|
650
|
-
linkApply: number;
|
|
651
|
-
links: number;
|
|
652
|
-
notes: number;
|
|
653
|
-
pages: number;
|
|
654
|
-
posts: number;
|
|
655
|
-
says: number;
|
|
656
|
-
recently: number;
|
|
657
|
-
unreadComments: number;
|
|
658
|
-
online: number;
|
|
659
|
-
todayMaxOnline: string;
|
|
660
|
-
todayOnlineTotal: string;
|
|
661
|
-
callTime: number;
|
|
662
|
-
uv: number;
|
|
663
|
-
todayIpAccessCount: number;
|
|
664
|
-
}
|
|
814
|
+
type SortOrder = 'asc' | 'desc';
|
|
665
815
|
|
|
666
816
|
declare module '@mx-space/api-client' {
|
|
667
817
|
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
@@ -722,15 +872,6 @@ declare class AggregateController<ResponseWrapper> implements IController {
|
|
|
722
872
|
}>;
|
|
723
873
|
}
|
|
724
874
|
|
|
725
|
-
interface AISummaryModel {
|
|
726
|
-
id: string;
|
|
727
|
-
created: string;
|
|
728
|
-
summary: string;
|
|
729
|
-
hash: string;
|
|
730
|
-
refId: string;
|
|
731
|
-
lang: string;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
875
|
declare module '@mx-space/api-client' {
|
|
735
876
|
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
736
877
|
ai: AIController<ResponseWrapper>;
|
|
@@ -940,39 +1081,6 @@ interface PaginationParams {
|
|
|
940
1081
|
page?: number;
|
|
941
1082
|
}
|
|
942
1083
|
|
|
943
|
-
interface CommentModel extends BaseModel {
|
|
944
|
-
refType: CollectionRefTypes;
|
|
945
|
-
ref: string;
|
|
946
|
-
state: number;
|
|
947
|
-
commentsIndex: number;
|
|
948
|
-
author: string;
|
|
949
|
-
text: string;
|
|
950
|
-
mail?: string;
|
|
951
|
-
url?: string;
|
|
952
|
-
ip?: string;
|
|
953
|
-
agent?: string;
|
|
954
|
-
key: string;
|
|
955
|
-
pin?: boolean;
|
|
956
|
-
avatar: string;
|
|
957
|
-
parent?: CommentModel | string;
|
|
958
|
-
children: CommentModel[];
|
|
959
|
-
isWhispers?: boolean;
|
|
960
|
-
location?: string;
|
|
961
|
-
source?: string;
|
|
962
|
-
}
|
|
963
|
-
interface CommentRef {
|
|
964
|
-
id: string;
|
|
965
|
-
categoryId?: string;
|
|
966
|
-
slug: string;
|
|
967
|
-
title: string;
|
|
968
|
-
category?: CategoryModel;
|
|
969
|
-
}
|
|
970
|
-
declare enum CommentState {
|
|
971
|
-
Unread = 0,
|
|
972
|
-
Read = 1,
|
|
973
|
-
Junk = 2
|
|
974
|
-
}
|
|
975
|
-
|
|
976
1084
|
interface CommentDto {
|
|
977
1085
|
author: string;
|
|
978
1086
|
text: string;
|
|
@@ -1056,28 +1164,6 @@ declare class CommentController<ResponseWrapper> implements IController {
|
|
|
1056
1164
|
}>;
|
|
1057
1165
|
}
|
|
1058
1166
|
|
|
1059
|
-
declare enum LinkType {
|
|
1060
|
-
Friend = 0,
|
|
1061
|
-
Collection = 1
|
|
1062
|
-
}
|
|
1063
|
-
declare enum LinkState {
|
|
1064
|
-
Pass = 0,
|
|
1065
|
-
Audit = 1,
|
|
1066
|
-
Outdate = 2,
|
|
1067
|
-
Banned = 3,
|
|
1068
|
-
Reject = 4
|
|
1069
|
-
}
|
|
1070
|
-
interface LinkModel extends BaseModel {
|
|
1071
|
-
name: string;
|
|
1072
|
-
url: string;
|
|
1073
|
-
avatar: string;
|
|
1074
|
-
description?: string;
|
|
1075
|
-
type: LinkType;
|
|
1076
|
-
state: LinkState;
|
|
1077
|
-
hide: boolean;
|
|
1078
|
-
email: string;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
1167
|
type SortOptions = {
|
|
1082
1168
|
sortBy?: string;
|
|
1083
1169
|
sortOrder?: 1 | -1 | 'asc' | 'desc';
|
|
@@ -1346,17 +1432,6 @@ declare class PostController<ResponseWrapper> implements IController {
|
|
|
1346
1432
|
}>;
|
|
1347
1433
|
}
|
|
1348
1434
|
|
|
1349
|
-
interface ProjectModel extends BaseModel {
|
|
1350
|
-
name: string;
|
|
1351
|
-
previewUrl?: string;
|
|
1352
|
-
docUrl?: string;
|
|
1353
|
-
projectUrl?: string;
|
|
1354
|
-
images?: string[];
|
|
1355
|
-
description: string;
|
|
1356
|
-
avatar?: string;
|
|
1357
|
-
text: string;
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
1435
|
declare module '@mx-space/api-client' {
|
|
1361
1436
|
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1362
1437
|
project: ProjectController<ResponseWrapper>;
|
|
@@ -1369,26 +1444,6 @@ declare class ProjectController<ResponseWrapper> extends BaseCrudController<Proj
|
|
|
1369
1444
|
name: string;
|
|
1370
1445
|
}
|
|
1371
1446
|
|
|
1372
|
-
declare enum RecentlyRefTypes {
|
|
1373
|
-
Post = "Post",
|
|
1374
|
-
Note = "Note",
|
|
1375
|
-
Page = "Page"
|
|
1376
|
-
}
|
|
1377
|
-
type RecentlyRefType = {
|
|
1378
|
-
title: string;
|
|
1379
|
-
url: string;
|
|
1380
|
-
};
|
|
1381
|
-
interface RecentlyModel extends BaseCommentIndexModel {
|
|
1382
|
-
content: string;
|
|
1383
|
-
ref?: RecentlyRefType & {
|
|
1384
|
-
[key: string]: any;
|
|
1385
|
-
};
|
|
1386
|
-
refId?: string;
|
|
1387
|
-
refType?: RecentlyRefTypes;
|
|
1388
|
-
up: number;
|
|
1389
|
-
down: number;
|
|
1390
|
-
}
|
|
1391
|
-
|
|
1392
1447
|
declare module '@mx-space/api-client' {
|
|
1393
1448
|
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1394
1449
|
recently: RecentlyController<ResponseWrapper>;
|
|
@@ -1668,21 +1723,6 @@ declare class SnippetController<ResponseWrapper> implements IController {
|
|
|
1668
1723
|
}>;
|
|
1669
1724
|
}
|
|
1670
1725
|
|
|
1671
|
-
declare const SubscribePostCreateBit: number;
|
|
1672
|
-
declare const SubscribeNoteCreateBit: number;
|
|
1673
|
-
declare const SubscribeSayCreateBit: number;
|
|
1674
|
-
declare const SubscribeRecentCreateBit: number;
|
|
1675
|
-
declare const SubscribeAllBit: number;
|
|
1676
|
-
declare const SubscribeTypeToBitMap: {
|
|
1677
|
-
post_c: number;
|
|
1678
|
-
note_c: number;
|
|
1679
|
-
say_c: number;
|
|
1680
|
-
recently_c: number;
|
|
1681
|
-
all: number;
|
|
1682
|
-
};
|
|
1683
|
-
|
|
1684
|
-
type SubscribeType = keyof typeof SubscribeTypeToBitMap;
|
|
1685
|
-
|
|
1686
1726
|
declare module '@mx-space/api-client' {
|
|
1687
1727
|
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1688
1728
|
subscribe: SubscribeController<ResponseWrapper>;
|
|
@@ -1833,28 +1873,10 @@ declare class UserController<ResponseWrapper> implements IController {
|
|
|
1833
1873
|
declare const allControllers: (typeof AckController | typeof ActivityController | typeof AggregateController | typeof AIController | 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)[];
|
|
1834
1874
|
declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate", "category", "comment", "link", "note", "page", "post", "project", "topic", "recently", "say", "search", "snippet", "serverless", "subscribe", "user", "friend", "master", "shorthand"];
|
|
1835
1875
|
|
|
1836
|
-
declare enum SnippetType {
|
|
1837
|
-
JSON = "json",
|
|
1838
|
-
Function = "function",
|
|
1839
|
-
Text = "text",
|
|
1840
|
-
YAML = "yaml"
|
|
1841
|
-
}
|
|
1842
|
-
interface SnippetModel<T = unknown> extends BaseModel {
|
|
1843
|
-
type: SnippetType;
|
|
1844
|
-
private: boolean;
|
|
1845
|
-
raw: string;
|
|
1846
|
-
name: string;
|
|
1847
|
-
reference: string;
|
|
1848
|
-
comment?: string;
|
|
1849
|
-
metatype?: string;
|
|
1850
|
-
schema?: string;
|
|
1851
|
-
data: T;
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
1876
|
/**
|
|
1855
1877
|
* A simple camelCase function that only handles strings, but not handling symbol, date, or other complex case.
|
|
1856
1878
|
* If you need to handle more complex cases, please use camelcase-keys package.
|
|
1857
1879
|
*/
|
|
1858
1880
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1859
1881
|
|
|
1860
|
-
export { AIController, type AISummaryModel, 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, 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 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 };
|
|
1882
|
+
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 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 };
|