@mx-space/api-client 1.8.0-alpha.3 → 1.8.0-alpha.5
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 +10 -0
- package/dist/index.cjs +7 -2
- package/dist/index.d.cts +127 -67
- package/dist/index.d.ts +127 -67
- package/dist/index.global.js +7 -2
- package/dist/index.js +7 -2
- package/models/activity.ts +36 -0
- package/models/post.ts +1 -1
- package/package.json +2 -2
package/controllers/activity.ts
CHANGED
|
@@ -60,11 +60,15 @@ export class ActivityController<ResponseWrapper> implements IController {
|
|
|
60
60
|
position,
|
|
61
61
|
roomName,
|
|
62
62
|
sid,
|
|
63
|
+
|
|
64
|
+
displayName,
|
|
63
65
|
}: {
|
|
64
66
|
roomName: string
|
|
65
67
|
position: number
|
|
66
68
|
identity: string
|
|
67
69
|
sid: string
|
|
70
|
+
|
|
71
|
+
displayName?: string
|
|
68
72
|
}) {
|
|
69
73
|
return this.proxy.presence.update.post({
|
|
70
74
|
data: {
|
|
@@ -73,7 +77,13 @@ export class ActivityController<ResponseWrapper> implements IController {
|
|
|
73
77
|
ts: Date.now(),
|
|
74
78
|
roomName,
|
|
75
79
|
sid,
|
|
80
|
+
|
|
81
|
+
displayName,
|
|
76
82
|
},
|
|
77
83
|
})
|
|
78
84
|
}
|
|
85
|
+
|
|
86
|
+
async getRoomsInfo() {
|
|
87
|
+
return this.proxy.rooms.get<{}>()
|
|
88
|
+
}
|
|
79
89
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -226,7 +226,8 @@ var ActivityController = class {
|
|
|
226
226
|
identity,
|
|
227
227
|
position,
|
|
228
228
|
roomName,
|
|
229
|
-
sid
|
|
229
|
+
sid,
|
|
230
|
+
displayName
|
|
230
231
|
}) {
|
|
231
232
|
return this.proxy.presence.update.post({
|
|
232
233
|
data: {
|
|
@@ -234,10 +235,14 @@ var ActivityController = class {
|
|
|
234
235
|
position,
|
|
235
236
|
ts: Date.now(),
|
|
236
237
|
roomName,
|
|
237
|
-
sid
|
|
238
|
+
sid,
|
|
239
|
+
displayName
|
|
238
240
|
}
|
|
239
241
|
});
|
|
240
242
|
}
|
|
243
|
+
async getRoomsInfo() {
|
|
244
|
+
return this.proxy.rooms.get();
|
|
245
|
+
}
|
|
241
246
|
};
|
|
242
247
|
|
|
243
248
|
// controllers/aggregate.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -116,71 +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, }: {
|
|
168
|
-
roomName: string;
|
|
169
|
-
position: number;
|
|
170
|
-
identity: string;
|
|
171
|
-
sid: string;
|
|
172
|
-
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
173
|
-
[key: string]: any;
|
|
174
|
-
data: unknown;
|
|
175
|
-
} : ResponseWrapper extends {
|
|
176
|
-
data: unknown;
|
|
177
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
178
|
-
data: unknown;
|
|
179
|
-
}>;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
type SortOrder = 'asc' | 'desc';
|
|
183
|
-
|
|
184
119
|
interface Count {
|
|
185
120
|
read: number;
|
|
186
121
|
like: number;
|
|
@@ -223,7 +158,7 @@ type ModelWithLiked<T> = T & {
|
|
|
223
158
|
};
|
|
224
159
|
|
|
225
160
|
interface PostModel extends TextBaseModel {
|
|
226
|
-
summary?: string;
|
|
161
|
+
summary?: string | null;
|
|
227
162
|
copyright: boolean;
|
|
228
163
|
tags: string[];
|
|
229
164
|
count: Count;
|
|
@@ -259,6 +194,131 @@ interface TagModel {
|
|
|
259
194
|
name: string;
|
|
260
195
|
}
|
|
261
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<{
|
|
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: {};
|
|
298
|
+
} : ResponseWrapper extends {
|
|
299
|
+
data: {};
|
|
300
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
301
|
+
data: {};
|
|
302
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
303
|
+
[key: string]: any;
|
|
304
|
+
data: {};
|
|
305
|
+
} : ResponseWrapper extends {
|
|
306
|
+
data: {};
|
|
307
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
308
|
+
data: {};
|
|
309
|
+
}) ? T_1 extends unknown ? {} : T_1 : never : never;
|
|
310
|
+
} : ResponseWrapper;
|
|
311
|
+
$request: {
|
|
312
|
+
[k: string]: string;
|
|
313
|
+
path: string;
|
|
314
|
+
method: string;
|
|
315
|
+
};
|
|
316
|
+
$serialized: {};
|
|
317
|
+
}>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
type SortOrder = 'asc' | 'desc';
|
|
321
|
+
|
|
262
322
|
interface TopicModel extends BaseModel {
|
|
263
323
|
description?: string;
|
|
264
324
|
introduce: string;
|
|
@@ -1537,4 +1597,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1537
1597
|
*/
|
|
1538
1598
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1539
1599
|
|
|
1540
|
-
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 };
|
|
1600
|
+
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,71 +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, }: {
|
|
168
|
-
roomName: string;
|
|
169
|
-
position: number;
|
|
170
|
-
identity: string;
|
|
171
|
-
sid: string;
|
|
172
|
-
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
173
|
-
[key: string]: any;
|
|
174
|
-
data: unknown;
|
|
175
|
-
} : ResponseWrapper extends {
|
|
176
|
-
data: unknown;
|
|
177
|
-
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
178
|
-
data: unknown;
|
|
179
|
-
}>;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
type SortOrder = 'asc' | 'desc';
|
|
183
|
-
|
|
184
119
|
interface Count {
|
|
185
120
|
read: number;
|
|
186
121
|
like: number;
|
|
@@ -223,7 +158,7 @@ type ModelWithLiked<T> = T & {
|
|
|
223
158
|
};
|
|
224
159
|
|
|
225
160
|
interface PostModel extends TextBaseModel {
|
|
226
|
-
summary?: string;
|
|
161
|
+
summary?: string | null;
|
|
227
162
|
copyright: boolean;
|
|
228
163
|
tags: string[];
|
|
229
164
|
count: Count;
|
|
@@ -259,6 +194,131 @@ interface TagModel {
|
|
|
259
194
|
name: string;
|
|
260
195
|
}
|
|
261
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<{
|
|
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: {};
|
|
298
|
+
} : ResponseWrapper extends {
|
|
299
|
+
data: {};
|
|
300
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
301
|
+
data: {};
|
|
302
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
303
|
+
[key: string]: any;
|
|
304
|
+
data: {};
|
|
305
|
+
} : ResponseWrapper extends {
|
|
306
|
+
data: {};
|
|
307
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
308
|
+
data: {};
|
|
309
|
+
}) ? T_1 extends unknown ? {} : T_1 : never : never;
|
|
310
|
+
} : ResponseWrapper;
|
|
311
|
+
$request: {
|
|
312
|
+
[k: string]: string;
|
|
313
|
+
path: string;
|
|
314
|
+
method: string;
|
|
315
|
+
};
|
|
316
|
+
$serialized: {};
|
|
317
|
+
}>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
type SortOrder = 'asc' | 'desc';
|
|
321
|
+
|
|
262
322
|
interface TopicModel extends BaseModel {
|
|
263
323
|
description?: string;
|
|
264
324
|
introduce: string;
|
|
@@ -1537,4 +1597,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1537
1597
|
*/
|
|
1538
1598
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1539
1599
|
|
|
1540
|
-
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 };
|
|
1600
|
+
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
|
@@ -162,7 +162,8 @@
|
|
|
162
162
|
identity,
|
|
163
163
|
position,
|
|
164
164
|
roomName,
|
|
165
|
-
sid
|
|
165
|
+
sid,
|
|
166
|
+
displayName
|
|
166
167
|
}) {
|
|
167
168
|
return this.proxy.presence.update.post({
|
|
168
169
|
data: {
|
|
@@ -170,10 +171,14 @@
|
|
|
170
171
|
position,
|
|
171
172
|
ts: Date.now(),
|
|
172
173
|
roomName,
|
|
173
|
-
sid
|
|
174
|
+
sid,
|
|
175
|
+
displayName
|
|
174
176
|
}
|
|
175
177
|
});
|
|
176
178
|
}
|
|
179
|
+
async getRoomsInfo() {
|
|
180
|
+
return this.proxy.rooms.get();
|
|
181
|
+
}
|
|
177
182
|
};
|
|
178
183
|
|
|
179
184
|
// controllers/aggregate.ts
|
package/dist/index.js
CHANGED
|
@@ -160,7 +160,8 @@ var ActivityController = class {
|
|
|
160
160
|
identity,
|
|
161
161
|
position,
|
|
162
162
|
roomName,
|
|
163
|
-
sid
|
|
163
|
+
sid,
|
|
164
|
+
displayName
|
|
164
165
|
}) {
|
|
165
166
|
return this.proxy.presence.update.post({
|
|
166
167
|
data: {
|
|
@@ -168,10 +169,14 @@ var ActivityController = class {
|
|
|
168
169
|
position,
|
|
169
170
|
ts: Date.now(),
|
|
170
171
|
roomName,
|
|
171
|
-
sid
|
|
172
|
+
sid,
|
|
173
|
+
displayName
|
|
172
174
|
}
|
|
173
175
|
});
|
|
174
176
|
}
|
|
177
|
+
async getRoomsInfo() {
|
|
178
|
+
return this.proxy.rooms.get();
|
|
179
|
+
}
|
|
175
180
|
};
|
|
176
181
|
|
|
177
182
|
// controllers/aggregate.ts
|
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.5",
|
|
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
|
+
}
|