@mx-space/api-client 1.8.1-alpha.0 → 1.9.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 +3 -2
- package/controllers/recently.ts +13 -5
- package/dist/adaptors/umi-request.global.js +2 -2
- package/dist/index.cjs +10 -2
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.global.js +10 -2
- package/dist/index.js +10 -2
- package/package.json +2 -2
package/controllers/activity.ts
CHANGED
|
@@ -60,7 +60,7 @@ export class ActivityController<ResponseWrapper> implements IController {
|
|
|
60
60
|
position,
|
|
61
61
|
roomName,
|
|
62
62
|
sid,
|
|
63
|
-
|
|
63
|
+
ts,
|
|
64
64
|
displayName,
|
|
65
65
|
}: {
|
|
66
66
|
roomName: string
|
|
@@ -69,12 +69,13 @@ export class ActivityController<ResponseWrapper> implements IController {
|
|
|
69
69
|
sid: string
|
|
70
70
|
|
|
71
71
|
displayName?: string
|
|
72
|
+
ts?: number
|
|
72
73
|
}) {
|
|
73
74
|
return this.proxy.presence.update.post({
|
|
74
75
|
data: {
|
|
75
76
|
identity,
|
|
76
77
|
position,
|
|
77
|
-
ts: Date.now(),
|
|
78
|
+
ts: ts || Date.now(),
|
|
78
79
|
roomName,
|
|
79
80
|
sid,
|
|
80
81
|
|
package/controllers/recently.ts
CHANGED
|
@@ -50,11 +50,15 @@ export class RecentlyController<ResponseWrapper> implements IController {
|
|
|
50
50
|
}>()
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
getList(
|
|
54
|
-
before
|
|
55
|
-
after
|
|
56
|
-
size
|
|
57
|
-
|
|
53
|
+
getList({
|
|
54
|
+
before,
|
|
55
|
+
after,
|
|
56
|
+
size,
|
|
57
|
+
}: {
|
|
58
|
+
before?: string | undefined
|
|
59
|
+
after?: string | undefined
|
|
60
|
+
size?: number | number
|
|
61
|
+
} = {}) {
|
|
58
62
|
return this.proxy.get<{ data: RecentlyModel[] & { comments: number } }>({
|
|
59
63
|
params: {
|
|
60
64
|
before,
|
|
@@ -64,6 +68,10 @@ export class RecentlyController<ResponseWrapper> implements IController {
|
|
|
64
68
|
})
|
|
65
69
|
}
|
|
66
70
|
|
|
71
|
+
getById(id: string) {
|
|
72
|
+
return this.proxy(id).get<RecentlyModel & { comments: number }>()
|
|
73
|
+
}
|
|
74
|
+
|
|
67
75
|
/** 表态:点赞,点踩 */
|
|
68
76
|
attitude(id: string, attitude: RecentlyAttitudeEnum) {
|
|
69
77
|
return this.proxy.attitude(id).get<{ code: RecentlyAttitudeResultEnum }>({
|
|
@@ -694,9 +694,9 @@
|
|
|
694
694
|
}
|
|
695
695
|
});
|
|
696
696
|
|
|
697
|
-
// ../../node_modules/.pnpm/set-function-length@1.2.
|
|
697
|
+
// ../../node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js
|
|
698
698
|
var require_set_function_length = __commonJS({
|
|
699
|
-
"../../node_modules/.pnpm/set-function-length@1.2.
|
|
699
|
+
"../../node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js"(exports, module) {
|
|
700
700
|
"use strict";
|
|
701
701
|
var GetIntrinsic = require_get_intrinsic();
|
|
702
702
|
var define = require_define_data_property();
|
package/dist/index.cjs
CHANGED
|
@@ -227,13 +227,14 @@ var ActivityController = class {
|
|
|
227
227
|
position,
|
|
228
228
|
roomName,
|
|
229
229
|
sid,
|
|
230
|
+
ts,
|
|
230
231
|
displayName
|
|
231
232
|
}) {
|
|
232
233
|
return this.proxy.presence.update.post({
|
|
233
234
|
data: {
|
|
234
235
|
identity,
|
|
235
236
|
position,
|
|
236
|
-
ts: Date.now(),
|
|
237
|
+
ts: ts || Date.now(),
|
|
237
238
|
roomName,
|
|
238
239
|
sid,
|
|
239
240
|
displayName
|
|
@@ -659,7 +660,11 @@ var RecentlyController = class {
|
|
|
659
660
|
getAll() {
|
|
660
661
|
return this.proxy.all.get();
|
|
661
662
|
}
|
|
662
|
-
getList(
|
|
663
|
+
getList({
|
|
664
|
+
before,
|
|
665
|
+
after,
|
|
666
|
+
size
|
|
667
|
+
} = {}) {
|
|
663
668
|
return this.proxy.get({
|
|
664
669
|
params: {
|
|
665
670
|
before,
|
|
@@ -668,6 +673,9 @@ var RecentlyController = class {
|
|
|
668
673
|
}
|
|
669
674
|
});
|
|
670
675
|
}
|
|
676
|
+
getById(id) {
|
|
677
|
+
return this.proxy(id).get();
|
|
678
|
+
}
|
|
671
679
|
/** 表态:点赞,点踩 */
|
|
672
680
|
attitude(id, attitude) {
|
|
673
681
|
return this.proxy.attitude(id).get({
|
package/dist/index.d.cts
CHANGED
|
@@ -279,12 +279,13 @@ declare class ActivityController<ResponseWrapper> implements IController {
|
|
|
279
279
|
*
|
|
280
280
|
* @support core >= 5.0.0
|
|
281
281
|
*/
|
|
282
|
-
updatePresence({ identity, position, roomName, sid, displayName, }: {
|
|
282
|
+
updatePresence({ identity, position, roomName, sid, ts, displayName, }: {
|
|
283
283
|
roomName: string;
|
|
284
284
|
position: number;
|
|
285
285
|
identity: string;
|
|
286
286
|
sid: string;
|
|
287
287
|
displayName?: string;
|
|
288
|
+
ts?: number;
|
|
288
289
|
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
289
290
|
[key: string]: any;
|
|
290
291
|
data: unknown;
|
|
@@ -1228,7 +1229,11 @@ declare class RecentlyController<ResponseWrapper> implements IController {
|
|
|
1228
1229
|
};
|
|
1229
1230
|
};
|
|
1230
1231
|
}>;
|
|
1231
|
-
getList(before
|
|
1232
|
+
getList({ before, after, size, }?: {
|
|
1233
|
+
before?: string | undefined;
|
|
1234
|
+
after?: string | undefined;
|
|
1235
|
+
size?: number | number;
|
|
1236
|
+
}): RequestProxyResult<{
|
|
1232
1237
|
data: RecentlyModel[] & {
|
|
1233
1238
|
comments: number;
|
|
1234
1239
|
};
|
|
@@ -1252,6 +1257,22 @@ declare class RecentlyController<ResponseWrapper> implements IController {
|
|
|
1252
1257
|
};
|
|
1253
1258
|
};
|
|
1254
1259
|
}>;
|
|
1260
|
+
getById(id: string): RequestProxyResult<RecentlyModel & {
|
|
1261
|
+
comments: number;
|
|
1262
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1263
|
+
[key: string]: any;
|
|
1264
|
+
data: RecentlyModel & {
|
|
1265
|
+
comments: number;
|
|
1266
|
+
};
|
|
1267
|
+
} : ResponseWrapper extends {
|
|
1268
|
+
data: RecentlyModel & {
|
|
1269
|
+
comments: number;
|
|
1270
|
+
};
|
|
1271
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1272
|
+
data: RecentlyModel & {
|
|
1273
|
+
comments: number;
|
|
1274
|
+
};
|
|
1275
|
+
}>;
|
|
1255
1276
|
/** 表态:点赞,点踩 */
|
|
1256
1277
|
attitude(id: string, attitude: RecentlyAttitudeEnum): RequestProxyResult<{
|
|
1257
1278
|
code: RecentlyAttitudeResultEnum;
|
package/dist/index.d.ts
CHANGED
|
@@ -279,12 +279,13 @@ declare class ActivityController<ResponseWrapper> implements IController {
|
|
|
279
279
|
*
|
|
280
280
|
* @support core >= 5.0.0
|
|
281
281
|
*/
|
|
282
|
-
updatePresence({ identity, position, roomName, sid, displayName, }: {
|
|
282
|
+
updatePresence({ identity, position, roomName, sid, ts, displayName, }: {
|
|
283
283
|
roomName: string;
|
|
284
284
|
position: number;
|
|
285
285
|
identity: string;
|
|
286
286
|
sid: string;
|
|
287
287
|
displayName?: string;
|
|
288
|
+
ts?: number;
|
|
288
289
|
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
289
290
|
[key: string]: any;
|
|
290
291
|
data: unknown;
|
|
@@ -1228,7 +1229,11 @@ declare class RecentlyController<ResponseWrapper> implements IController {
|
|
|
1228
1229
|
};
|
|
1229
1230
|
};
|
|
1230
1231
|
}>;
|
|
1231
|
-
getList(before
|
|
1232
|
+
getList({ before, after, size, }?: {
|
|
1233
|
+
before?: string | undefined;
|
|
1234
|
+
after?: string | undefined;
|
|
1235
|
+
size?: number | number;
|
|
1236
|
+
}): RequestProxyResult<{
|
|
1232
1237
|
data: RecentlyModel[] & {
|
|
1233
1238
|
comments: number;
|
|
1234
1239
|
};
|
|
@@ -1252,6 +1257,22 @@ declare class RecentlyController<ResponseWrapper> implements IController {
|
|
|
1252
1257
|
};
|
|
1253
1258
|
};
|
|
1254
1259
|
}>;
|
|
1260
|
+
getById(id: string): RequestProxyResult<RecentlyModel & {
|
|
1261
|
+
comments: number;
|
|
1262
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1263
|
+
[key: string]: any;
|
|
1264
|
+
data: RecentlyModel & {
|
|
1265
|
+
comments: number;
|
|
1266
|
+
};
|
|
1267
|
+
} : ResponseWrapper extends {
|
|
1268
|
+
data: RecentlyModel & {
|
|
1269
|
+
comments: number;
|
|
1270
|
+
};
|
|
1271
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1272
|
+
data: RecentlyModel & {
|
|
1273
|
+
comments: number;
|
|
1274
|
+
};
|
|
1275
|
+
}>;
|
|
1255
1276
|
/** 表态:点赞,点踩 */
|
|
1256
1277
|
attitude(id: string, attitude: RecentlyAttitudeEnum): RequestProxyResult<{
|
|
1257
1278
|
code: RecentlyAttitudeResultEnum;
|
package/dist/index.global.js
CHANGED
|
@@ -163,13 +163,14 @@
|
|
|
163
163
|
position,
|
|
164
164
|
roomName,
|
|
165
165
|
sid,
|
|
166
|
+
ts,
|
|
166
167
|
displayName
|
|
167
168
|
}) {
|
|
168
169
|
return this.proxy.presence.update.post({
|
|
169
170
|
data: {
|
|
170
171
|
identity,
|
|
171
172
|
position,
|
|
172
|
-
ts: Date.now(),
|
|
173
|
+
ts: ts || Date.now(),
|
|
173
174
|
roomName,
|
|
174
175
|
sid,
|
|
175
176
|
displayName
|
|
@@ -595,7 +596,11 @@
|
|
|
595
596
|
getAll() {
|
|
596
597
|
return this.proxy.all.get();
|
|
597
598
|
}
|
|
598
|
-
getList(
|
|
599
|
+
getList({
|
|
600
|
+
before,
|
|
601
|
+
after,
|
|
602
|
+
size
|
|
603
|
+
} = {}) {
|
|
599
604
|
return this.proxy.get({
|
|
600
605
|
params: {
|
|
601
606
|
before,
|
|
@@ -604,6 +609,9 @@
|
|
|
604
609
|
}
|
|
605
610
|
});
|
|
606
611
|
}
|
|
612
|
+
getById(id) {
|
|
613
|
+
return this.proxy(id).get();
|
|
614
|
+
}
|
|
607
615
|
/** 表态:点赞,点踩 */
|
|
608
616
|
attitude(id, attitude) {
|
|
609
617
|
return this.proxy.attitude(id).get({
|
package/dist/index.js
CHANGED
|
@@ -161,13 +161,14 @@ var ActivityController = class {
|
|
|
161
161
|
position,
|
|
162
162
|
roomName,
|
|
163
163
|
sid,
|
|
164
|
+
ts,
|
|
164
165
|
displayName
|
|
165
166
|
}) {
|
|
166
167
|
return this.proxy.presence.update.post({
|
|
167
168
|
data: {
|
|
168
169
|
identity,
|
|
169
170
|
position,
|
|
170
|
-
ts: Date.now(),
|
|
171
|
+
ts: ts || Date.now(),
|
|
171
172
|
roomName,
|
|
172
173
|
sid,
|
|
173
174
|
displayName
|
|
@@ -593,7 +594,11 @@ var RecentlyController = class {
|
|
|
593
594
|
getAll() {
|
|
594
595
|
return this.proxy.all.get();
|
|
595
596
|
}
|
|
596
|
-
getList(
|
|
597
|
+
getList({
|
|
598
|
+
before,
|
|
599
|
+
after,
|
|
600
|
+
size
|
|
601
|
+
} = {}) {
|
|
597
602
|
return this.proxy.get({
|
|
598
603
|
params: {
|
|
599
604
|
before,
|
|
@@ -602,6 +607,9 @@ var RecentlyController = class {
|
|
|
602
607
|
}
|
|
603
608
|
});
|
|
604
609
|
}
|
|
610
|
+
getById(id) {
|
|
611
|
+
return this.proxy(id).get();
|
|
612
|
+
}
|
|
605
613
|
/** 表态:点赞,点踩 */
|
|
606
614
|
attitude(id, attitude) {
|
|
607
615
|
return this.proxy.attitude(id).get({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A api client for mx-space server@next",
|
|
6
6
|
"author": "Innei",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"axios": "^1.6.7",
|
|
52
52
|
"camelcase-keys": "^9.1.3",
|
|
53
53
|
"cors": "2.8.5",
|
|
54
|
-
"express": "4.19.
|
|
54
|
+
"express": "4.19.2",
|
|
55
55
|
"form-data": "4.0.0",
|
|
56
56
|
"lodash": "4.17.21",
|
|
57
57
|
"tsup": "8.0.2",
|