@mx-space/api-client 1.8.0-alpha.5 → 1.8.0-beta.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/activity.ts +2 -2
- package/controllers/note.ts +1 -2
- package/dist/index.d.cts +23 -13
- package/dist/index.d.ts +23 -13
- package/models/aggregate.ts +1 -1
- package/models/note.ts +2 -2
- package/package.json +1 -1
package/controllers/activity.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 } from '~/models/activity'
|
|
4
|
+
import type { ActivityPresence, RoomsData } from '~/models/activity'
|
|
5
5
|
import type { HTTPClient } from '../core'
|
|
6
6
|
|
|
7
7
|
import { autoBind } from '~/utils/auto-bind'
|
|
@@ -84,6 +84,6 @@ export class ActivityController<ResponseWrapper> implements IController {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
async getRoomsInfo() {
|
|
87
|
-
return this.proxy.rooms.get<
|
|
87
|
+
return this.proxy.rooms.get<RoomsData>()
|
|
88
88
|
}
|
|
89
89
|
}
|
package/controllers/note.ts
CHANGED
|
@@ -8,12 +8,11 @@ import type {
|
|
|
8
8
|
NoteWrappedPayload,
|
|
9
9
|
NoteWrappedWithLikedPayload,
|
|
10
10
|
} from '~/models/note'
|
|
11
|
+
import type { HTTPClient } from '../core/client'
|
|
11
12
|
import type { SortOptions } from './base'
|
|
12
13
|
|
|
13
14
|
import { autoBind } from '~/utils/auto-bind'
|
|
14
15
|
|
|
15
|
-
import { HTTPClient } from '../core/client'
|
|
16
|
-
|
|
17
16
|
declare module '../core/client' {
|
|
18
17
|
interface HTTPClient<
|
|
19
18
|
T extends IRequestAdapter = IRequestAdapter,
|
package/dist/index.d.cts
CHANGED
|
@@ -287,33 +287,43 @@ declare class ActivityController<ResponseWrapper> implements IController {
|
|
|
287
287
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
288
288
|
data: unknown;
|
|
289
289
|
}>;
|
|
290
|
-
getRoomsInfo(): Promise<{
|
|
290
|
+
getRoomsInfo(): Promise<RoomsData & {
|
|
291
291
|
$raw: ResponseWrapper extends {
|
|
292
292
|
data: infer T;
|
|
293
293
|
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
294
294
|
[i: string]: any;
|
|
295
295
|
data: (ResponseWrapper extends unknown ? {
|
|
296
296
|
[key: string]: any;
|
|
297
|
-
data:
|
|
297
|
+
data: RoomsData;
|
|
298
298
|
} : ResponseWrapper extends {
|
|
299
|
-
data:
|
|
299
|
+
data: RoomsData;
|
|
300
300
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
301
|
-
data:
|
|
302
|
-
}) extends infer
|
|
301
|
+
data: RoomsData;
|
|
302
|
+
}) extends infer T ? T extends (ResponseWrapper extends unknown ? {
|
|
303
303
|
[key: string]: any;
|
|
304
|
-
data:
|
|
304
|
+
data: RoomsData;
|
|
305
305
|
} : ResponseWrapper extends {
|
|
306
|
-
data:
|
|
306
|
+
data: RoomsData;
|
|
307
307
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
308
|
-
data:
|
|
309
|
-
}) ?
|
|
308
|
+
data: RoomsData;
|
|
309
|
+
}) ? T extends unknown ? {
|
|
310
|
+
rooms: string[];
|
|
311
|
+
room_count: {
|
|
312
|
+
[key: string]: number;
|
|
313
|
+
};
|
|
314
|
+
objects: {
|
|
315
|
+
posts: RoomOmittedPost[];
|
|
316
|
+
notes: RoomOmittedNote[];
|
|
317
|
+
pages: RoomOmittedPage[];
|
|
318
|
+
};
|
|
319
|
+
} : T : never : never;
|
|
310
320
|
} : ResponseWrapper;
|
|
311
321
|
$request: {
|
|
312
322
|
[k: string]: string;
|
|
313
323
|
path: string;
|
|
314
324
|
method: string;
|
|
315
325
|
};
|
|
316
|
-
$serialized:
|
|
326
|
+
$serialized: RoomsData;
|
|
317
327
|
}>;
|
|
318
328
|
}
|
|
319
329
|
|
|
@@ -335,8 +345,8 @@ interface NoteModel extends TextBaseModel {
|
|
|
335
345
|
};
|
|
336
346
|
mood?: string;
|
|
337
347
|
weather?: string;
|
|
338
|
-
|
|
339
|
-
|
|
348
|
+
bookmark?: boolean;
|
|
349
|
+
publicAt?: Date;
|
|
340
350
|
password?: string | null;
|
|
341
351
|
nid: number;
|
|
342
352
|
music?: NoteMusicRecord[];
|
|
@@ -507,7 +517,7 @@ declare enum TimelineType {
|
|
|
507
517
|
Note = 1
|
|
508
518
|
}
|
|
509
519
|
interface TimelineData {
|
|
510
|
-
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | '
|
|
520
|
+
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'bookmark'>[];
|
|
511
521
|
posts?: (Pick<PostModel, 'id' | 'title' | 'slug' | 'created' | 'modified' | 'category'> & {
|
|
512
522
|
url: string;
|
|
513
523
|
})[];
|
package/dist/index.d.ts
CHANGED
|
@@ -287,33 +287,43 @@ declare class ActivityController<ResponseWrapper> implements IController {
|
|
|
287
287
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
288
288
|
data: unknown;
|
|
289
289
|
}>;
|
|
290
|
-
getRoomsInfo(): Promise<{
|
|
290
|
+
getRoomsInfo(): Promise<RoomsData & {
|
|
291
291
|
$raw: ResponseWrapper extends {
|
|
292
292
|
data: infer T;
|
|
293
293
|
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
294
294
|
[i: string]: any;
|
|
295
295
|
data: (ResponseWrapper extends unknown ? {
|
|
296
296
|
[key: string]: any;
|
|
297
|
-
data:
|
|
297
|
+
data: RoomsData;
|
|
298
298
|
} : ResponseWrapper extends {
|
|
299
|
-
data:
|
|
299
|
+
data: RoomsData;
|
|
300
300
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
301
|
-
data:
|
|
302
|
-
}) extends infer
|
|
301
|
+
data: RoomsData;
|
|
302
|
+
}) extends infer T ? T extends (ResponseWrapper extends unknown ? {
|
|
303
303
|
[key: string]: any;
|
|
304
|
-
data:
|
|
304
|
+
data: RoomsData;
|
|
305
305
|
} : ResponseWrapper extends {
|
|
306
|
-
data:
|
|
306
|
+
data: RoomsData;
|
|
307
307
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
308
|
-
data:
|
|
309
|
-
}) ?
|
|
308
|
+
data: RoomsData;
|
|
309
|
+
}) ? T extends unknown ? {
|
|
310
|
+
rooms: string[];
|
|
311
|
+
room_count: {
|
|
312
|
+
[key: string]: number;
|
|
313
|
+
};
|
|
314
|
+
objects: {
|
|
315
|
+
posts: RoomOmittedPost[];
|
|
316
|
+
notes: RoomOmittedNote[];
|
|
317
|
+
pages: RoomOmittedPage[];
|
|
318
|
+
};
|
|
319
|
+
} : T : never : never;
|
|
310
320
|
} : ResponseWrapper;
|
|
311
321
|
$request: {
|
|
312
322
|
[k: string]: string;
|
|
313
323
|
path: string;
|
|
314
324
|
method: string;
|
|
315
325
|
};
|
|
316
|
-
$serialized:
|
|
326
|
+
$serialized: RoomsData;
|
|
317
327
|
}>;
|
|
318
328
|
}
|
|
319
329
|
|
|
@@ -335,8 +345,8 @@ interface NoteModel extends TextBaseModel {
|
|
|
335
345
|
};
|
|
336
346
|
mood?: string;
|
|
337
347
|
weather?: string;
|
|
338
|
-
|
|
339
|
-
|
|
348
|
+
bookmark?: boolean;
|
|
349
|
+
publicAt?: Date;
|
|
340
350
|
password?: string | null;
|
|
341
351
|
nid: number;
|
|
342
352
|
music?: NoteMusicRecord[];
|
|
@@ -507,7 +517,7 @@ declare enum TimelineType {
|
|
|
507
517
|
Note = 1
|
|
508
518
|
}
|
|
509
519
|
interface TimelineData {
|
|
510
|
-
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | '
|
|
520
|
+
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'bookmark'>[];
|
|
511
521
|
posts?: (Pick<PostModel, 'id' | 'title' | 'slug' | 'created' | 'modified' | 'category'> & {
|
|
512
522
|
url: string;
|
|
513
523
|
})[];
|
package/models/aggregate.ts
CHANGED
package/models/note.ts
CHANGED