@mx-space/api-client 1.8.0-alpha.4 → 1.8.0-alpha.6
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.cjs +3 -0
- package/dist/index.d.cts +137 -68
- package/dist/index.d.ts +137 -68
- package/dist/index.global.js +3 -0
- package/dist/index.js +3 -0
- package/models/activity.ts +36 -0
- package/models/post.ts +1 -1
- package/package.json +2 -2
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'
|
|
@@ -82,4 +82,8 @@ export class ActivityController<ResponseWrapper> implements IController {
|
|
|
82
82
|
},
|
|
83
83
|
})
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
async getRoomsInfo() {
|
|
87
|
+
return this.proxy.rooms.get<RoomsData>()
|
|
88
|
+
}
|
|
85
89
|
}
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -116,72 +116,6 @@ declare class AckController<ResponseWrapper> implements IController {
|
|
|
116
116
|
}>;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
interface ActivityPresence {
|
|
120
|
-
operationTime: number;
|
|
121
|
-
updatedAt: number;
|
|
122
|
-
connectedAt: number;
|
|
123
|
-
identity: string;
|
|
124
|
-
roomName: string;
|
|
125
|
-
position: number;
|
|
126
|
-
displayName?: string;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
declare module '../core/client' {
|
|
130
|
-
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
131
|
-
activity: ActivityController<ResponseWrapper>;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* @support core >= 4.3.0
|
|
136
|
-
*/
|
|
137
|
-
declare class ActivityController<ResponseWrapper> implements IController {
|
|
138
|
-
private client;
|
|
139
|
-
base: string;
|
|
140
|
-
name: string;
|
|
141
|
-
constructor(client: HTTPClient);
|
|
142
|
-
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
143
|
-
likeIt(type: 'Post' | 'Note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
144
|
-
[key: string]: any;
|
|
145
|
-
data: never;
|
|
146
|
-
} : ResponseWrapper extends {
|
|
147
|
-
data: never;
|
|
148
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
149
|
-
data: never;
|
|
150
|
-
}>;
|
|
151
|
-
/**
|
|
152
|
-
*
|
|
153
|
-
* @support core >= 5.0.0
|
|
154
|
-
*/
|
|
155
|
-
getPresence(roomName: string): RequestProxyResult<Record<string, ActivityPresence>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
156
|
-
[key: string]: any;
|
|
157
|
-
data: Record<string, ActivityPresence>;
|
|
158
|
-
} : ResponseWrapper extends {
|
|
159
|
-
data: Record<string, ActivityPresence>;
|
|
160
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
161
|
-
data: Record<string, ActivityPresence>;
|
|
162
|
-
}>;
|
|
163
|
-
/**
|
|
164
|
-
*
|
|
165
|
-
* @support core >= 5.0.0
|
|
166
|
-
*/
|
|
167
|
-
updatePresence({ identity, position, roomName, sid, displayName, }: {
|
|
168
|
-
roomName: string;
|
|
169
|
-
position: number;
|
|
170
|
-
identity: string;
|
|
171
|
-
sid: string;
|
|
172
|
-
displayName?: string;
|
|
173
|
-
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
174
|
-
[key: string]: any;
|
|
175
|
-
data: unknown;
|
|
176
|
-
} : ResponseWrapper extends {
|
|
177
|
-
data: unknown;
|
|
178
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
179
|
-
data: unknown;
|
|
180
|
-
}>;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
type SortOrder = 'asc' | 'desc';
|
|
184
|
-
|
|
185
119
|
interface Count {
|
|
186
120
|
read: number;
|
|
187
121
|
like: number;
|
|
@@ -224,7 +158,7 @@ type ModelWithLiked<T> = T & {
|
|
|
224
158
|
};
|
|
225
159
|
|
|
226
160
|
interface PostModel extends TextBaseModel {
|
|
227
|
-
summary?: string;
|
|
161
|
+
summary?: string | null;
|
|
228
162
|
copyright: boolean;
|
|
229
163
|
tags: string[];
|
|
230
164
|
count: Count;
|
|
@@ -260,6 +194,141 @@ interface TagModel {
|
|
|
260
194
|
name: string;
|
|
261
195
|
}
|
|
262
196
|
|
|
197
|
+
interface ActivityPresence {
|
|
198
|
+
operationTime: number;
|
|
199
|
+
updatedAt: number;
|
|
200
|
+
connectedAt: number;
|
|
201
|
+
identity: string;
|
|
202
|
+
roomName: string;
|
|
203
|
+
position: number;
|
|
204
|
+
displayName?: string;
|
|
205
|
+
}
|
|
206
|
+
interface RoomOmittedNote {
|
|
207
|
+
title: string;
|
|
208
|
+
nid: number;
|
|
209
|
+
id: string;
|
|
210
|
+
created: string;
|
|
211
|
+
}
|
|
212
|
+
interface RoomOmittedPage {
|
|
213
|
+
title: string;
|
|
214
|
+
slug: string;
|
|
215
|
+
id: string;
|
|
216
|
+
created: string;
|
|
217
|
+
}
|
|
218
|
+
interface RoomOmittedPost {
|
|
219
|
+
slug: string;
|
|
220
|
+
title: string;
|
|
221
|
+
categoryId: string;
|
|
222
|
+
category: CategoryModel;
|
|
223
|
+
id: string;
|
|
224
|
+
created: string;
|
|
225
|
+
}
|
|
226
|
+
interface RoomsData {
|
|
227
|
+
rooms: string[];
|
|
228
|
+
roomCount: {
|
|
229
|
+
[key: string]: number;
|
|
230
|
+
};
|
|
231
|
+
objects: {
|
|
232
|
+
posts: RoomOmittedPost[];
|
|
233
|
+
notes: RoomOmittedNote[];
|
|
234
|
+
pages: RoomOmittedPage[];
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
declare module '../core/client' {
|
|
239
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
240
|
+
activity: ActivityController<ResponseWrapper>;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* @support core >= 4.3.0
|
|
245
|
+
*/
|
|
246
|
+
declare class ActivityController<ResponseWrapper> implements IController {
|
|
247
|
+
private client;
|
|
248
|
+
base: string;
|
|
249
|
+
name: string;
|
|
250
|
+
constructor(client: HTTPClient);
|
|
251
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
252
|
+
likeIt(type: 'Post' | 'Note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
253
|
+
[key: string]: any;
|
|
254
|
+
data: never;
|
|
255
|
+
} : ResponseWrapper extends {
|
|
256
|
+
data: never;
|
|
257
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
258
|
+
data: never;
|
|
259
|
+
}>;
|
|
260
|
+
/**
|
|
261
|
+
*
|
|
262
|
+
* @support core >= 5.0.0
|
|
263
|
+
*/
|
|
264
|
+
getPresence(roomName: string): RequestProxyResult<Record<string, ActivityPresence>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
265
|
+
[key: string]: any;
|
|
266
|
+
data: Record<string, ActivityPresence>;
|
|
267
|
+
} : ResponseWrapper extends {
|
|
268
|
+
data: Record<string, ActivityPresence>;
|
|
269
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
270
|
+
data: Record<string, ActivityPresence>;
|
|
271
|
+
}>;
|
|
272
|
+
/**
|
|
273
|
+
*
|
|
274
|
+
* @support core >= 5.0.0
|
|
275
|
+
*/
|
|
276
|
+
updatePresence({ identity, position, roomName, sid, displayName, }: {
|
|
277
|
+
roomName: string;
|
|
278
|
+
position: number;
|
|
279
|
+
identity: string;
|
|
280
|
+
sid: string;
|
|
281
|
+
displayName?: string;
|
|
282
|
+
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
283
|
+
[key: string]: any;
|
|
284
|
+
data: unknown;
|
|
285
|
+
} : ResponseWrapper extends {
|
|
286
|
+
data: unknown;
|
|
287
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
288
|
+
data: unknown;
|
|
289
|
+
}>;
|
|
290
|
+
getRoomsInfo(): Promise<RoomsData & {
|
|
291
|
+
$raw: ResponseWrapper extends {
|
|
292
|
+
data: infer T;
|
|
293
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
294
|
+
[i: string]: any;
|
|
295
|
+
data: (ResponseWrapper extends unknown ? {
|
|
296
|
+
[key: string]: any;
|
|
297
|
+
data: RoomsData;
|
|
298
|
+
} : ResponseWrapper extends {
|
|
299
|
+
data: RoomsData;
|
|
300
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
301
|
+
data: RoomsData;
|
|
302
|
+
}) extends infer T ? T extends (ResponseWrapper extends unknown ? {
|
|
303
|
+
[key: string]: any;
|
|
304
|
+
data: RoomsData;
|
|
305
|
+
} : ResponseWrapper extends {
|
|
306
|
+
data: RoomsData;
|
|
307
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
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;
|
|
320
|
+
} : ResponseWrapper;
|
|
321
|
+
$request: {
|
|
322
|
+
[k: string]: string;
|
|
323
|
+
path: string;
|
|
324
|
+
method: string;
|
|
325
|
+
};
|
|
326
|
+
$serialized: RoomsData;
|
|
327
|
+
}>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
type SortOrder = 'asc' | 'desc';
|
|
331
|
+
|
|
263
332
|
interface TopicModel extends BaseModel {
|
|
264
333
|
description?: string;
|
|
265
334
|
introduce: string;
|
|
@@ -1538,4 +1607,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1538
1607
|
*/
|
|
1539
1608
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1540
1609
|
|
|
1541
|
-
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, type Image, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteMusicRecord, 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, 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 };
|
|
1610
|
+
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, type Image, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteMusicRecord, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -116,72 +116,6 @@ declare class AckController<ResponseWrapper> implements IController {
|
|
|
116
116
|
}>;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
interface ActivityPresence {
|
|
120
|
-
operationTime: number;
|
|
121
|
-
updatedAt: number;
|
|
122
|
-
connectedAt: number;
|
|
123
|
-
identity: string;
|
|
124
|
-
roomName: string;
|
|
125
|
-
position: number;
|
|
126
|
-
displayName?: string;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
declare module '@mx-space/api-client' {
|
|
130
|
-
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
131
|
-
activity: ActivityController<ResponseWrapper>;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* @support core >= 4.3.0
|
|
136
|
-
*/
|
|
137
|
-
declare class ActivityController<ResponseWrapper> implements IController {
|
|
138
|
-
private client;
|
|
139
|
-
base: string;
|
|
140
|
-
name: string;
|
|
141
|
-
constructor(client: HTTPClient);
|
|
142
|
-
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
143
|
-
likeIt(type: 'Post' | 'Note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
144
|
-
[key: string]: any;
|
|
145
|
-
data: never;
|
|
146
|
-
} : ResponseWrapper extends {
|
|
147
|
-
data: never;
|
|
148
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
149
|
-
data: never;
|
|
150
|
-
}>;
|
|
151
|
-
/**
|
|
152
|
-
*
|
|
153
|
-
* @support core >= 5.0.0
|
|
154
|
-
*/
|
|
155
|
-
getPresence(roomName: string): RequestProxyResult<Record<string, ActivityPresence>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
156
|
-
[key: string]: any;
|
|
157
|
-
data: Record<string, ActivityPresence>;
|
|
158
|
-
} : ResponseWrapper extends {
|
|
159
|
-
data: Record<string, ActivityPresence>;
|
|
160
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
161
|
-
data: Record<string, ActivityPresence>;
|
|
162
|
-
}>;
|
|
163
|
-
/**
|
|
164
|
-
*
|
|
165
|
-
* @support core >= 5.0.0
|
|
166
|
-
*/
|
|
167
|
-
updatePresence({ identity, position, roomName, sid, displayName, }: {
|
|
168
|
-
roomName: string;
|
|
169
|
-
position: number;
|
|
170
|
-
identity: string;
|
|
171
|
-
sid: string;
|
|
172
|
-
displayName?: string;
|
|
173
|
-
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
174
|
-
[key: string]: any;
|
|
175
|
-
data: unknown;
|
|
176
|
-
} : ResponseWrapper extends {
|
|
177
|
-
data: unknown;
|
|
178
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
179
|
-
data: unknown;
|
|
180
|
-
}>;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
type SortOrder = 'asc' | 'desc';
|
|
184
|
-
|
|
185
119
|
interface Count {
|
|
186
120
|
read: number;
|
|
187
121
|
like: number;
|
|
@@ -224,7 +158,7 @@ type ModelWithLiked<T> = T & {
|
|
|
224
158
|
};
|
|
225
159
|
|
|
226
160
|
interface PostModel extends TextBaseModel {
|
|
227
|
-
summary?: string;
|
|
161
|
+
summary?: string | null;
|
|
228
162
|
copyright: boolean;
|
|
229
163
|
tags: string[];
|
|
230
164
|
count: Count;
|
|
@@ -260,6 +194,141 @@ interface TagModel {
|
|
|
260
194
|
name: string;
|
|
261
195
|
}
|
|
262
196
|
|
|
197
|
+
interface ActivityPresence {
|
|
198
|
+
operationTime: number;
|
|
199
|
+
updatedAt: number;
|
|
200
|
+
connectedAt: number;
|
|
201
|
+
identity: string;
|
|
202
|
+
roomName: string;
|
|
203
|
+
position: number;
|
|
204
|
+
displayName?: string;
|
|
205
|
+
}
|
|
206
|
+
interface RoomOmittedNote {
|
|
207
|
+
title: string;
|
|
208
|
+
nid: number;
|
|
209
|
+
id: string;
|
|
210
|
+
created: string;
|
|
211
|
+
}
|
|
212
|
+
interface RoomOmittedPage {
|
|
213
|
+
title: string;
|
|
214
|
+
slug: string;
|
|
215
|
+
id: string;
|
|
216
|
+
created: string;
|
|
217
|
+
}
|
|
218
|
+
interface RoomOmittedPost {
|
|
219
|
+
slug: string;
|
|
220
|
+
title: string;
|
|
221
|
+
categoryId: string;
|
|
222
|
+
category: CategoryModel;
|
|
223
|
+
id: string;
|
|
224
|
+
created: string;
|
|
225
|
+
}
|
|
226
|
+
interface RoomsData {
|
|
227
|
+
rooms: string[];
|
|
228
|
+
roomCount: {
|
|
229
|
+
[key: string]: number;
|
|
230
|
+
};
|
|
231
|
+
objects: {
|
|
232
|
+
posts: RoomOmittedPost[];
|
|
233
|
+
notes: RoomOmittedNote[];
|
|
234
|
+
pages: RoomOmittedPage[];
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
declare module '@mx-space/api-client' {
|
|
239
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
240
|
+
activity: ActivityController<ResponseWrapper>;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* @support core >= 4.3.0
|
|
245
|
+
*/
|
|
246
|
+
declare class ActivityController<ResponseWrapper> implements IController {
|
|
247
|
+
private client;
|
|
248
|
+
base: string;
|
|
249
|
+
name: string;
|
|
250
|
+
constructor(client: HTTPClient);
|
|
251
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
252
|
+
likeIt(type: 'Post' | 'Note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
253
|
+
[key: string]: any;
|
|
254
|
+
data: never;
|
|
255
|
+
} : ResponseWrapper extends {
|
|
256
|
+
data: never;
|
|
257
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
258
|
+
data: never;
|
|
259
|
+
}>;
|
|
260
|
+
/**
|
|
261
|
+
*
|
|
262
|
+
* @support core >= 5.0.0
|
|
263
|
+
*/
|
|
264
|
+
getPresence(roomName: string): RequestProxyResult<Record<string, ActivityPresence>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
265
|
+
[key: string]: any;
|
|
266
|
+
data: Record<string, ActivityPresence>;
|
|
267
|
+
} : ResponseWrapper extends {
|
|
268
|
+
data: Record<string, ActivityPresence>;
|
|
269
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
270
|
+
data: Record<string, ActivityPresence>;
|
|
271
|
+
}>;
|
|
272
|
+
/**
|
|
273
|
+
*
|
|
274
|
+
* @support core >= 5.0.0
|
|
275
|
+
*/
|
|
276
|
+
updatePresence({ identity, position, roomName, sid, displayName, }: {
|
|
277
|
+
roomName: string;
|
|
278
|
+
position: number;
|
|
279
|
+
identity: string;
|
|
280
|
+
sid: string;
|
|
281
|
+
displayName?: string;
|
|
282
|
+
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
283
|
+
[key: string]: any;
|
|
284
|
+
data: unknown;
|
|
285
|
+
} : ResponseWrapper extends {
|
|
286
|
+
data: unknown;
|
|
287
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
288
|
+
data: unknown;
|
|
289
|
+
}>;
|
|
290
|
+
getRoomsInfo(): Promise<RoomsData & {
|
|
291
|
+
$raw: ResponseWrapper extends {
|
|
292
|
+
data: infer T;
|
|
293
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
294
|
+
[i: string]: any;
|
|
295
|
+
data: (ResponseWrapper extends unknown ? {
|
|
296
|
+
[key: string]: any;
|
|
297
|
+
data: RoomsData;
|
|
298
|
+
} : ResponseWrapper extends {
|
|
299
|
+
data: RoomsData;
|
|
300
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
301
|
+
data: RoomsData;
|
|
302
|
+
}) extends infer T ? T extends (ResponseWrapper extends unknown ? {
|
|
303
|
+
[key: string]: any;
|
|
304
|
+
data: RoomsData;
|
|
305
|
+
} : ResponseWrapper extends {
|
|
306
|
+
data: RoomsData;
|
|
307
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
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;
|
|
320
|
+
} : ResponseWrapper;
|
|
321
|
+
$request: {
|
|
322
|
+
[k: string]: string;
|
|
323
|
+
path: string;
|
|
324
|
+
method: string;
|
|
325
|
+
};
|
|
326
|
+
$serialized: RoomsData;
|
|
327
|
+
}>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
type SortOrder = 'asc' | 'desc';
|
|
331
|
+
|
|
263
332
|
interface TopicModel extends BaseModel {
|
|
264
333
|
description?: string;
|
|
265
334
|
introduce: string;
|
|
@@ -1538,4 +1607,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1538
1607
|
*/
|
|
1539
1608
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1540
1609
|
|
|
1541
|
-
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, type Image, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteMusicRecord, 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, 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 };
|
|
1610
|
+
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, type Image, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteMusicRecord, 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 };
|
package/dist/index.global.js
CHANGED
package/dist/index.js
CHANGED
package/models/activity.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { CategoryModel } from './category'
|
|
2
|
+
|
|
1
3
|
export interface ActivityPresence {
|
|
2
4
|
operationTime: number
|
|
3
5
|
updatedAt: number
|
|
@@ -8,3 +10,37 @@ export interface ActivityPresence {
|
|
|
8
10
|
|
|
9
11
|
displayName?: string
|
|
10
12
|
}
|
|
13
|
+
|
|
14
|
+
export interface RoomOmittedNote {
|
|
15
|
+
title: string
|
|
16
|
+
nid: number
|
|
17
|
+
id: string
|
|
18
|
+
created: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface RoomOmittedPage {
|
|
22
|
+
title: string
|
|
23
|
+
slug: string
|
|
24
|
+
id: string
|
|
25
|
+
created: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface RoomOmittedPost {
|
|
29
|
+
slug: string
|
|
30
|
+
title: string
|
|
31
|
+
categoryId: string
|
|
32
|
+
category: CategoryModel
|
|
33
|
+
id: string
|
|
34
|
+
created: string
|
|
35
|
+
}
|
|
36
|
+
export interface RoomsData {
|
|
37
|
+
rooms: string[]
|
|
38
|
+
roomCount: {
|
|
39
|
+
[key: string]: number
|
|
40
|
+
}
|
|
41
|
+
objects: {
|
|
42
|
+
posts: RoomOmittedPost[]
|
|
43
|
+
notes: RoomOmittedNote[]
|
|
44
|
+
pages: RoomOmittedPage[]
|
|
45
|
+
}
|
|
46
|
+
}
|
package/models/post.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.8.0-alpha.
|
|
3
|
+
"version": "1.8.0-alpha.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A api client for mx-space server@next",
|
|
6
6
|
"author": "Innei",
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
"vite": "^5.0.12",
|
|
61
61
|
"vitest": "^1.0.4"
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|