@sublay/js 7.3.0 → 7.4.1
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/dist/core/spaceReputationParams.d.ts +57 -0
- package/dist/index.d.mts +114 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +390 -29
- package/dist/index.mjs +390 -29
- package/dist/interfaces/SpaceReputation.d.ts +44 -6
- package/dist/interfaces/UserSearch.d.ts +13 -0
- package/dist/modules/connections/fetchConnections.d.ts +2 -1
- package/dist/modules/follows/fetchFollowers.d.ts +2 -1
- package/dist/modules/follows/fetchFollowing.d.ts +2 -1
- package/dist/modules/search/askContent.d.ts +6 -0
- package/dist/modules/search/index.d.ts +1 -0
- package/dist/modules/search/matchUsers.d.ts +36 -0
- package/dist/modules/search/searchContent.d.ts +6 -0
- package/dist/modules/users/fetchConnectionsByUserId.d.ts +2 -1
- package/dist/modules/users/fetchFollowersByUserId.d.ts +2 -1
- package/dist/modules/users/fetchFollowingByUserId.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -319,9 +319,59 @@ __export(users_exports, {
|
|
|
319
319
|
updateUser: () => updateUser
|
|
320
320
|
});
|
|
321
321
|
|
|
322
|
+
// src/core/spaceReputationParams.ts
|
|
323
|
+
var bothFormsWarned = false;
|
|
324
|
+
function isProduction() {
|
|
325
|
+
return typeof process !== "undefined" && !!process.env && process.env.NODE_ENV === "production";
|
|
326
|
+
}
|
|
327
|
+
function buildSpaceReputationParams(input) {
|
|
328
|
+
const { spaceReputation, spaceReputationId, spaceReputationDescendants } = input;
|
|
329
|
+
const objectPresent = spaceReputation !== void 0;
|
|
330
|
+
const flatPresent = spaceReputationId !== void 0 && spaceReputationId !== null || spaceReputationDescendants !== void 0 && spaceReputationDescendants !== null;
|
|
331
|
+
if (objectPresent && flatPresent && !bothFormsWarned && !isProduction()) {
|
|
332
|
+
bothFormsWarned = true;
|
|
333
|
+
console.warn(
|
|
334
|
+
"[Sublay] Both `spaceReputation` and the deprecated flat props (`spaceReputationId` / `spaceReputationDescendants`) were supplied. The `spaceReputation` object takes precedence; the flat props are ignored. Remove the flat props \u2014 they are deprecated."
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
const result = {};
|
|
338
|
+
if (objectPresent) {
|
|
339
|
+
const spaceId = spaceReputation.spaceId;
|
|
340
|
+
if (spaceId !== void 0 && spaceId !== null) {
|
|
341
|
+
result.spaceReputationId = spaceId;
|
|
342
|
+
}
|
|
343
|
+
const includeDescendants = spaceReputation.includeDescendants;
|
|
344
|
+
if (includeDescendants !== void 0 && includeDescendants !== null) {
|
|
345
|
+
result.spaceReputationDescendants = includeDescendants;
|
|
346
|
+
}
|
|
347
|
+
return result;
|
|
348
|
+
}
|
|
349
|
+
if (spaceReputationId !== void 0 && spaceReputationId !== null) {
|
|
350
|
+
result.spaceReputationId = spaceReputationId;
|
|
351
|
+
}
|
|
352
|
+
if (spaceReputationDescendants !== void 0 && spaceReputationDescendants !== null) {
|
|
353
|
+
result.spaceReputationDescendants = spaceReputationDescendants;
|
|
354
|
+
}
|
|
355
|
+
return result;
|
|
356
|
+
}
|
|
357
|
+
|
|
322
358
|
// src/modules/users/fetchUserById.ts
|
|
323
359
|
async function fetchUserById(client, data) {
|
|
324
|
-
const {
|
|
360
|
+
const {
|
|
361
|
+
userId,
|
|
362
|
+
spaceReputation,
|
|
363
|
+
spaceReputationId,
|
|
364
|
+
spaceReputationDescendants,
|
|
365
|
+
...rest
|
|
366
|
+
} = data;
|
|
367
|
+
const params = {
|
|
368
|
+
...rest,
|
|
369
|
+
...buildSpaceReputationParams({
|
|
370
|
+
spaceReputation,
|
|
371
|
+
spaceReputationId,
|
|
372
|
+
spaceReputationDescendants
|
|
373
|
+
})
|
|
374
|
+
};
|
|
325
375
|
const response = await client.projectInstance.get(`/users/${userId}`, {
|
|
326
376
|
params
|
|
327
377
|
});
|
|
@@ -330,27 +380,72 @@ async function fetchUserById(client, data) {
|
|
|
330
380
|
|
|
331
381
|
// src/modules/users/fetchUserByForeignId.ts
|
|
332
382
|
async function fetchUserByForeignId(client, data) {
|
|
383
|
+
const {
|
|
384
|
+
spaceReputation,
|
|
385
|
+
spaceReputationId,
|
|
386
|
+
spaceReputationDescendants,
|
|
387
|
+
...rest
|
|
388
|
+
} = data;
|
|
333
389
|
const response = await client.projectInstance.get(
|
|
334
390
|
"/users/by-foreign-id",
|
|
335
|
-
{
|
|
391
|
+
{
|
|
392
|
+
params: {
|
|
393
|
+
...rest,
|
|
394
|
+
...buildSpaceReputationParams({
|
|
395
|
+
spaceReputation,
|
|
396
|
+
spaceReputationId,
|
|
397
|
+
spaceReputationDescendants
|
|
398
|
+
})
|
|
399
|
+
}
|
|
400
|
+
}
|
|
336
401
|
);
|
|
337
402
|
return response.data;
|
|
338
403
|
}
|
|
339
404
|
|
|
340
405
|
// src/modules/users/fetchUserByUsername.ts
|
|
341
406
|
async function fetchUserByUsername(client, data) {
|
|
407
|
+
const {
|
|
408
|
+
spaceReputation,
|
|
409
|
+
spaceReputationId,
|
|
410
|
+
spaceReputationDescendants,
|
|
411
|
+
...rest
|
|
412
|
+
} = data;
|
|
342
413
|
const response = await client.projectInstance.get(
|
|
343
414
|
"/users/by-username",
|
|
344
|
-
{
|
|
415
|
+
{
|
|
416
|
+
params: {
|
|
417
|
+
...rest,
|
|
418
|
+
...buildSpaceReputationParams({
|
|
419
|
+
spaceReputation,
|
|
420
|
+
spaceReputationId,
|
|
421
|
+
spaceReputationDescendants
|
|
422
|
+
})
|
|
423
|
+
}
|
|
424
|
+
}
|
|
345
425
|
);
|
|
346
426
|
return response.data;
|
|
347
427
|
}
|
|
348
428
|
|
|
349
429
|
// src/modules/users/fetchUserSuggestions.ts
|
|
350
430
|
async function fetchUserSuggestions(client, data) {
|
|
431
|
+
const {
|
|
432
|
+
spaceReputation,
|
|
433
|
+
spaceReputationId,
|
|
434
|
+
spaceReputationDescendants,
|
|
435
|
+
...rest
|
|
436
|
+
} = data;
|
|
351
437
|
const response = await client.projectInstance.get(
|
|
352
438
|
"/users/suggestions",
|
|
353
|
-
{
|
|
439
|
+
{
|
|
440
|
+
params: {
|
|
441
|
+
...rest,
|
|
442
|
+
...buildSpaceReputationParams({
|
|
443
|
+
spaceReputation,
|
|
444
|
+
spaceReputationId,
|
|
445
|
+
spaceReputationDescendants
|
|
446
|
+
})
|
|
447
|
+
}
|
|
448
|
+
}
|
|
354
449
|
);
|
|
355
450
|
return response.data;
|
|
356
451
|
}
|
|
@@ -409,7 +504,21 @@ async function updateUser(client, data) {
|
|
|
409
504
|
|
|
410
505
|
// src/modules/users/fetchFollowersByUserId.ts
|
|
411
506
|
async function fetchFollowersByUserId(client, data) {
|
|
412
|
-
const {
|
|
507
|
+
const {
|
|
508
|
+
userId,
|
|
509
|
+
spaceReputation,
|
|
510
|
+
spaceReputationId,
|
|
511
|
+
spaceReputationDescendants,
|
|
512
|
+
...rest
|
|
513
|
+
} = data;
|
|
514
|
+
const params = {
|
|
515
|
+
...rest,
|
|
516
|
+
...buildSpaceReputationParams({
|
|
517
|
+
spaceReputation,
|
|
518
|
+
spaceReputationId,
|
|
519
|
+
spaceReputationDescendants
|
|
520
|
+
})
|
|
521
|
+
};
|
|
413
522
|
const response = await client.projectInstance.get(`/users/${userId}/followers`, { params });
|
|
414
523
|
return response.data;
|
|
415
524
|
}
|
|
@@ -425,7 +534,21 @@ async function fetchFollowersCountByUserId(client, data) {
|
|
|
425
534
|
|
|
426
535
|
// src/modules/users/fetchFollowingByUserId.ts
|
|
427
536
|
async function fetchFollowingByUserId(client, data) {
|
|
428
|
-
const {
|
|
537
|
+
const {
|
|
538
|
+
userId,
|
|
539
|
+
spaceReputation,
|
|
540
|
+
spaceReputationId,
|
|
541
|
+
spaceReputationDescendants,
|
|
542
|
+
...rest
|
|
543
|
+
} = data;
|
|
544
|
+
const params = {
|
|
545
|
+
...rest,
|
|
546
|
+
...buildSpaceReputationParams({
|
|
547
|
+
spaceReputation,
|
|
548
|
+
spaceReputationId,
|
|
549
|
+
spaceReputationDescendants
|
|
550
|
+
})
|
|
551
|
+
};
|
|
429
552
|
const response = await client.projectInstance.get(`/users/${userId}/following`, { params });
|
|
430
553
|
return response.data;
|
|
431
554
|
}
|
|
@@ -441,7 +564,21 @@ async function fetchFollowingCountByUserId(client, data) {
|
|
|
441
564
|
|
|
442
565
|
// src/modules/users/fetchConnectionsByUserId.ts
|
|
443
566
|
async function fetchConnectionsByUserId(client, data) {
|
|
444
|
-
const {
|
|
567
|
+
const {
|
|
568
|
+
userId,
|
|
569
|
+
spaceReputation,
|
|
570
|
+
spaceReputationId,
|
|
571
|
+
spaceReputationDescendants,
|
|
572
|
+
...rest
|
|
573
|
+
} = data;
|
|
574
|
+
const params = {
|
|
575
|
+
...rest,
|
|
576
|
+
...buildSpaceReputationParams({
|
|
577
|
+
spaceReputation,
|
|
578
|
+
spaceReputationId,
|
|
579
|
+
spaceReputationDescendants
|
|
580
|
+
})
|
|
581
|
+
};
|
|
445
582
|
const response = await client.projectInstance.get(`/users/${userId}/connections`, { params });
|
|
446
583
|
return response.data;
|
|
447
584
|
}
|
|
@@ -537,7 +674,21 @@ async function createEntity(client, data) {
|
|
|
537
674
|
|
|
538
675
|
// src/modules/entities/fetchEntity.ts
|
|
539
676
|
async function fetchEntity(client, data) {
|
|
540
|
-
const {
|
|
677
|
+
const {
|
|
678
|
+
entityId,
|
|
679
|
+
spaceReputation,
|
|
680
|
+
spaceReputationId,
|
|
681
|
+
spaceReputationDescendants,
|
|
682
|
+
...rest
|
|
683
|
+
} = data;
|
|
684
|
+
const params = {
|
|
685
|
+
...rest,
|
|
686
|
+
...buildSpaceReputationParams({
|
|
687
|
+
spaceReputation,
|
|
688
|
+
spaceReputationId,
|
|
689
|
+
spaceReputationDescendants
|
|
690
|
+
})
|
|
691
|
+
};
|
|
541
692
|
const response = await client.projectInstance.get(
|
|
542
693
|
`/entities/${entityId}`,
|
|
543
694
|
{ params }
|
|
@@ -566,10 +717,23 @@ async function fetchEntityByShortId(client, data) {
|
|
|
566
717
|
// src/modules/entities/fetchManyEntities.ts
|
|
567
718
|
async function fetchManyEntities(client, data) {
|
|
568
719
|
const path = `/entities`;
|
|
720
|
+
const {
|
|
721
|
+
spaceReputation,
|
|
722
|
+
spaceReputationId,
|
|
723
|
+
spaceReputationDescendants,
|
|
724
|
+
...rest
|
|
725
|
+
} = data;
|
|
569
726
|
const response = await client.projectInstance.get(
|
|
570
727
|
path,
|
|
571
728
|
{
|
|
572
|
-
params:
|
|
729
|
+
params: {
|
|
730
|
+
...rest,
|
|
731
|
+
...buildSpaceReputationParams({
|
|
732
|
+
spaceReputation,
|
|
733
|
+
spaceReputationId,
|
|
734
|
+
spaceReputationDescendants
|
|
735
|
+
})
|
|
736
|
+
}
|
|
573
737
|
}
|
|
574
738
|
);
|
|
575
739
|
return response.data;
|
|
@@ -641,7 +805,21 @@ async function removeReaction(client, data) {
|
|
|
641
805
|
|
|
642
806
|
// src/modules/entities/fetchReactions.ts
|
|
643
807
|
async function fetchReactions(client, data) {
|
|
644
|
-
const {
|
|
808
|
+
const {
|
|
809
|
+
entityId,
|
|
810
|
+
spaceReputation,
|
|
811
|
+
spaceReputationId,
|
|
812
|
+
spaceReputationDescendants,
|
|
813
|
+
...rest
|
|
814
|
+
} = data;
|
|
815
|
+
const params = {
|
|
816
|
+
...rest,
|
|
817
|
+
...buildSpaceReputationParams({
|
|
818
|
+
spaceReputation,
|
|
819
|
+
spaceReputationId,
|
|
820
|
+
spaceReputationDescendants
|
|
821
|
+
})
|
|
822
|
+
};
|
|
645
823
|
const response = await client.projectInstance.get(
|
|
646
824
|
`/entities/${entityId}/reactions`,
|
|
647
825
|
{ params }
|
|
@@ -870,7 +1048,21 @@ async function createComment(client, data) {
|
|
|
870
1048
|
|
|
871
1049
|
// src/modules/comments/fetchComment.ts
|
|
872
1050
|
async function fetchComment(client, data) {
|
|
873
|
-
const {
|
|
1051
|
+
const {
|
|
1052
|
+
commentId,
|
|
1053
|
+
spaceReputation,
|
|
1054
|
+
spaceReputationId,
|
|
1055
|
+
spaceReputationDescendants,
|
|
1056
|
+
...rest
|
|
1057
|
+
} = data;
|
|
1058
|
+
const params = {
|
|
1059
|
+
...rest,
|
|
1060
|
+
...buildSpaceReputationParams({
|
|
1061
|
+
spaceReputation,
|
|
1062
|
+
spaceReputationId,
|
|
1063
|
+
spaceReputationDescendants
|
|
1064
|
+
})
|
|
1065
|
+
};
|
|
874
1066
|
const response = await client.projectInstance.get(
|
|
875
1067
|
`/comments/${commentId}`,
|
|
876
1068
|
{ params }
|
|
@@ -907,9 +1099,24 @@ async function deleteComment(client, data) {
|
|
|
907
1099
|
|
|
908
1100
|
// src/modules/comments/fetchManyComments.ts
|
|
909
1101
|
async function fetchManyComments(client, data) {
|
|
1102
|
+
const {
|
|
1103
|
+
spaceReputation,
|
|
1104
|
+
spaceReputationId,
|
|
1105
|
+
spaceReputationDescendants,
|
|
1106
|
+
...rest
|
|
1107
|
+
} = data;
|
|
910
1108
|
const response = await client.projectInstance.get(
|
|
911
1109
|
"/comments",
|
|
912
|
-
{
|
|
1110
|
+
{
|
|
1111
|
+
params: {
|
|
1112
|
+
...rest,
|
|
1113
|
+
...buildSpaceReputationParams({
|
|
1114
|
+
spaceReputation,
|
|
1115
|
+
spaceReputationId,
|
|
1116
|
+
spaceReputationDescendants
|
|
1117
|
+
})
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
913
1120
|
);
|
|
914
1121
|
return response.data;
|
|
915
1122
|
}
|
|
@@ -935,7 +1142,21 @@ async function removeReaction2(client, data) {
|
|
|
935
1142
|
|
|
936
1143
|
// src/modules/comments/fetchReactions.ts
|
|
937
1144
|
async function fetchReactions2(client, data) {
|
|
938
|
-
const {
|
|
1145
|
+
const {
|
|
1146
|
+
commentId,
|
|
1147
|
+
spaceReputation,
|
|
1148
|
+
spaceReputationId,
|
|
1149
|
+
spaceReputationDescendants,
|
|
1150
|
+
...rest
|
|
1151
|
+
} = data;
|
|
1152
|
+
const params = {
|
|
1153
|
+
...rest,
|
|
1154
|
+
...buildSpaceReputationParams({
|
|
1155
|
+
spaceReputation,
|
|
1156
|
+
spaceReputationId,
|
|
1157
|
+
spaceReputationDescendants
|
|
1158
|
+
})
|
|
1159
|
+
};
|
|
939
1160
|
const response = await client.projectInstance.get(
|
|
940
1161
|
`/comments/${commentId}/reactions`,
|
|
941
1162
|
{ params }
|
|
@@ -1160,7 +1381,21 @@ async function checkMyMembership(client, data) {
|
|
|
1160
1381
|
|
|
1161
1382
|
// src/modules/spaces/fetchSpaceMembers.ts
|
|
1162
1383
|
async function fetchSpaceMembers(client, data) {
|
|
1163
|
-
const {
|
|
1384
|
+
const {
|
|
1385
|
+
spaceId,
|
|
1386
|
+
spaceReputation,
|
|
1387
|
+
spaceReputationId,
|
|
1388
|
+
spaceReputationDescendants,
|
|
1389
|
+
...rest
|
|
1390
|
+
} = data;
|
|
1391
|
+
const params = {
|
|
1392
|
+
...rest,
|
|
1393
|
+
...buildSpaceReputationParams({
|
|
1394
|
+
spaceReputation,
|
|
1395
|
+
spaceReputationId,
|
|
1396
|
+
spaceReputationDescendants
|
|
1397
|
+
})
|
|
1398
|
+
};
|
|
1164
1399
|
const response = await client.projectInstance.get(
|
|
1165
1400
|
`/spaces/${spaceId}/members`,
|
|
1166
1401
|
{ params }
|
|
@@ -1170,7 +1405,21 @@ async function fetchSpaceMembers(client, data) {
|
|
|
1170
1405
|
|
|
1171
1406
|
// src/modules/spaces/fetchSpaceTeam.ts
|
|
1172
1407
|
async function fetchSpaceTeam(client, data) {
|
|
1173
|
-
const {
|
|
1408
|
+
const {
|
|
1409
|
+
spaceId,
|
|
1410
|
+
spaceReputation,
|
|
1411
|
+
spaceReputationId,
|
|
1412
|
+
spaceReputationDescendants,
|
|
1413
|
+
...rest
|
|
1414
|
+
} = data;
|
|
1415
|
+
const params = {
|
|
1416
|
+
...rest,
|
|
1417
|
+
...buildSpaceReputationParams({
|
|
1418
|
+
spaceReputation,
|
|
1419
|
+
spaceReputationId,
|
|
1420
|
+
spaceReputationDescendants
|
|
1421
|
+
})
|
|
1422
|
+
};
|
|
1174
1423
|
const response = await client.projectInstance.get(
|
|
1175
1424
|
`/spaces/${spaceId}/team`,
|
|
1176
1425
|
{ params }
|
|
@@ -1625,9 +1874,24 @@ async function createReport(client, data) {
|
|
|
1625
1874
|
|
|
1626
1875
|
// src/modules/reports/fetchModeratedReports.ts
|
|
1627
1876
|
async function fetchModeratedReports(client, data) {
|
|
1877
|
+
const {
|
|
1878
|
+
spaceReputation,
|
|
1879
|
+
spaceReputationId,
|
|
1880
|
+
spaceReputationDescendants,
|
|
1881
|
+
...rest
|
|
1882
|
+
} = data;
|
|
1628
1883
|
const response = await client.projectInstance.get(
|
|
1629
1884
|
"/reports/moderated",
|
|
1630
|
-
{
|
|
1885
|
+
{
|
|
1886
|
+
params: {
|
|
1887
|
+
...rest,
|
|
1888
|
+
...buildSpaceReputationParams({
|
|
1889
|
+
spaceReputation,
|
|
1890
|
+
spaceReputationId,
|
|
1891
|
+
spaceReputationDescendants
|
|
1892
|
+
})
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1631
1895
|
);
|
|
1632
1896
|
return response.data;
|
|
1633
1897
|
}
|
|
@@ -1636,6 +1900,7 @@ async function fetchModeratedReports(client, data) {
|
|
|
1636
1900
|
var search_exports = {};
|
|
1637
1901
|
__export(search_exports, {
|
|
1638
1902
|
askContent: () => askContent,
|
|
1903
|
+
matchUsers: () => matchUsers,
|
|
1639
1904
|
searchContent: () => searchContent,
|
|
1640
1905
|
searchSpaces: () => searchSpaces,
|
|
1641
1906
|
searchUsers: () => searchUsers
|
|
@@ -1643,11 +1908,22 @@ __export(search_exports, {
|
|
|
1643
1908
|
|
|
1644
1909
|
// src/modules/search/searchContent.ts
|
|
1645
1910
|
async function searchContent(client, data) {
|
|
1646
|
-
const {
|
|
1911
|
+
const {
|
|
1912
|
+
spaceReputation,
|
|
1913
|
+
spaceReputationId,
|
|
1914
|
+
spaceReputationDescendants,
|
|
1915
|
+
...body
|
|
1916
|
+
} = data;
|
|
1647
1917
|
const response = await client.projectInstance.post(
|
|
1648
1918
|
"/search/content",
|
|
1649
1919
|
body,
|
|
1650
|
-
{
|
|
1920
|
+
{
|
|
1921
|
+
params: buildSpaceReputationParams({
|
|
1922
|
+
spaceReputation,
|
|
1923
|
+
spaceReputationId,
|
|
1924
|
+
spaceReputationDescendants
|
|
1925
|
+
})
|
|
1926
|
+
}
|
|
1651
1927
|
);
|
|
1652
1928
|
return response.data;
|
|
1653
1929
|
}
|
|
@@ -1704,20 +1980,31 @@ function parseSseBlock(block) {
|
|
|
1704
1980
|
}
|
|
1705
1981
|
}
|
|
1706
1982
|
async function* askContent(client, data) {
|
|
1707
|
-
const {
|
|
1983
|
+
const {
|
|
1984
|
+
signal,
|
|
1985
|
+
spaceReputation,
|
|
1986
|
+
spaceReputationId,
|
|
1987
|
+
spaceReputationDescendants,
|
|
1988
|
+
...body
|
|
1989
|
+
} = data;
|
|
1708
1990
|
const baseURL = client.projectInstance.defaults.baseURL ?? "";
|
|
1709
1991
|
const authHeader = await client.getAuthHeader();
|
|
1710
1992
|
const headers = {
|
|
1711
1993
|
"Content-Type": "application/json"
|
|
1712
1994
|
};
|
|
1713
1995
|
if (authHeader) headers.Authorization = authHeader;
|
|
1996
|
+
const flatParams = buildSpaceReputationParams({
|
|
1997
|
+
spaceReputation,
|
|
1998
|
+
spaceReputationId,
|
|
1999
|
+
spaceReputationDescendants
|
|
2000
|
+
});
|
|
1714
2001
|
const search = new URLSearchParams();
|
|
1715
|
-
if (spaceReputationId != null)
|
|
1716
|
-
search.set("spaceReputationId", spaceReputationId);
|
|
1717
|
-
if (spaceReputationDescendants != null)
|
|
2002
|
+
if (flatParams.spaceReputationId != null)
|
|
2003
|
+
search.set("spaceReputationId", flatParams.spaceReputationId);
|
|
2004
|
+
if (flatParams.spaceReputationDescendants != null)
|
|
1718
2005
|
search.set(
|
|
1719
2006
|
"spaceReputationDescendants",
|
|
1720
|
-
String(spaceReputationDescendants)
|
|
2007
|
+
String(flatParams.spaceReputationDescendants)
|
|
1721
2008
|
);
|
|
1722
2009
|
const queryString = search.toString();
|
|
1723
2010
|
const url = `${baseURL}/search/ask${queryString ? `?${queryString}` : ""}`;
|
|
@@ -1763,6 +2050,15 @@ async function* askContent(client, data) {
|
|
|
1763
2050
|
}
|
|
1764
2051
|
}
|
|
1765
2052
|
|
|
2053
|
+
// src/modules/search/matchUsers.ts
|
|
2054
|
+
async function matchUsers(client, data) {
|
|
2055
|
+
const response = await client.projectInstance.post(
|
|
2056
|
+
"/match/users",
|
|
2057
|
+
data
|
|
2058
|
+
);
|
|
2059
|
+
return response.data;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
1766
2062
|
// src/modules/storage/index.ts
|
|
1767
2063
|
var storage_exports = {};
|
|
1768
2064
|
__export(storage_exports, {
|
|
@@ -1948,7 +2244,21 @@ async function getUnreadCount(client) {
|
|
|
1948
2244
|
|
|
1949
2245
|
// src/modules/chat/listMembers.ts
|
|
1950
2246
|
async function listMembers(client, data) {
|
|
1951
|
-
const {
|
|
2247
|
+
const {
|
|
2248
|
+
conversationId,
|
|
2249
|
+
spaceReputation,
|
|
2250
|
+
spaceReputationId,
|
|
2251
|
+
spaceReputationDescendants,
|
|
2252
|
+
...rest
|
|
2253
|
+
} = data;
|
|
2254
|
+
const params = {
|
|
2255
|
+
...rest,
|
|
2256
|
+
...buildSpaceReputationParams({
|
|
2257
|
+
spaceReputation,
|
|
2258
|
+
spaceReputationId,
|
|
2259
|
+
spaceReputationDescendants
|
|
2260
|
+
})
|
|
2261
|
+
};
|
|
1952
2262
|
const response = await client.projectInstance.get(`/chat/conversations/${conversationId}/members`, { params });
|
|
1953
2263
|
return response.data;
|
|
1954
2264
|
}
|
|
@@ -1993,7 +2303,21 @@ async function changeMemberRole(client, data) {
|
|
|
1993
2303
|
|
|
1994
2304
|
// src/modules/chat/listMessages.ts
|
|
1995
2305
|
async function listMessages(client, data) {
|
|
1996
|
-
const {
|
|
2306
|
+
const {
|
|
2307
|
+
conversationId,
|
|
2308
|
+
spaceReputation,
|
|
2309
|
+
spaceReputationId,
|
|
2310
|
+
spaceReputationDescendants,
|
|
2311
|
+
...rest
|
|
2312
|
+
} = data;
|
|
2313
|
+
const params = {
|
|
2314
|
+
...rest,
|
|
2315
|
+
...buildSpaceReputationParams({
|
|
2316
|
+
spaceReputation,
|
|
2317
|
+
spaceReputationId,
|
|
2318
|
+
spaceReputationDescendants
|
|
2319
|
+
})
|
|
2320
|
+
};
|
|
1997
2321
|
const response = await client.projectInstance.get(
|
|
1998
2322
|
`/chat/conversations/${conversationId}/messages`,
|
|
1999
2323
|
{ params }
|
|
@@ -2007,13 +2331,20 @@ async function sendMessage(client, data) {
|
|
|
2007
2331
|
conversationId,
|
|
2008
2332
|
files,
|
|
2009
2333
|
// The server reads these from `req.query`, not the body, so they are
|
|
2010
|
-
// forwarded as query params (in both the JSON and multipart branches)
|
|
2334
|
+
// forwarded as query params (in both the JSON and multipart branches),
|
|
2335
|
+
// flattened via the helper so the `spaceReputation` object never reaches
|
|
2336
|
+
// the serializer.
|
|
2337
|
+
spaceReputation,
|
|
2011
2338
|
spaceReputationId,
|
|
2012
2339
|
spaceReputationDescendants,
|
|
2013
2340
|
...body
|
|
2014
2341
|
} = data;
|
|
2015
2342
|
const path = `/chat/conversations/${conversationId}/messages`;
|
|
2016
|
-
const params = {
|
|
2343
|
+
const params = buildSpaceReputationParams({
|
|
2344
|
+
spaceReputation,
|
|
2345
|
+
spaceReputationId,
|
|
2346
|
+
spaceReputationDescendants
|
|
2347
|
+
});
|
|
2017
2348
|
if (files && files.length > 0) {
|
|
2018
2349
|
const formData = new FormData();
|
|
2019
2350
|
for (const file of files) {
|
|
@@ -2035,7 +2366,22 @@ async function sendMessage(client, data) {
|
|
|
2035
2366
|
|
|
2036
2367
|
// src/modules/chat/getMessage.ts
|
|
2037
2368
|
async function getMessage(client, data) {
|
|
2038
|
-
const {
|
|
2369
|
+
const {
|
|
2370
|
+
conversationId,
|
|
2371
|
+
messageId,
|
|
2372
|
+
spaceReputation,
|
|
2373
|
+
spaceReputationId,
|
|
2374
|
+
spaceReputationDescendants,
|
|
2375
|
+
...rest
|
|
2376
|
+
} = data;
|
|
2377
|
+
const params = {
|
|
2378
|
+
...rest,
|
|
2379
|
+
...buildSpaceReputationParams({
|
|
2380
|
+
spaceReputation,
|
|
2381
|
+
spaceReputationId,
|
|
2382
|
+
spaceReputationDescendants
|
|
2383
|
+
})
|
|
2384
|
+
};
|
|
2039
2385
|
const response = await client.projectInstance.get(
|
|
2040
2386
|
`/chat/conversations/${conversationId}/messages/${messageId}`,
|
|
2041
2387
|
{ params }
|
|
@@ -2074,7 +2420,22 @@ async function toggleReaction(client, data) {
|
|
|
2074
2420
|
|
|
2075
2421
|
// src/modules/chat/listReactions.ts
|
|
2076
2422
|
async function listReactions(client, data) {
|
|
2077
|
-
const {
|
|
2423
|
+
const {
|
|
2424
|
+
conversationId,
|
|
2425
|
+
messageId,
|
|
2426
|
+
spaceReputation,
|
|
2427
|
+
spaceReputationId,
|
|
2428
|
+
spaceReputationDescendants,
|
|
2429
|
+
...rest
|
|
2430
|
+
} = data;
|
|
2431
|
+
const params = {
|
|
2432
|
+
...rest,
|
|
2433
|
+
...buildSpaceReputationParams({
|
|
2434
|
+
spaceReputation,
|
|
2435
|
+
spaceReputationId,
|
|
2436
|
+
spaceReputationDescendants
|
|
2437
|
+
})
|
|
2438
|
+
};
|
|
2078
2439
|
const response = await client.projectInstance.get(
|
|
2079
2440
|
`/chat/conversations/${conversationId}/messages/${messageId}/reactions`,
|
|
2080
2441
|
{ params }
|