@sublay/js 7.3.0 → 7.4.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/dist/core/spaceReputationParams.d.ts +57 -0
- package/dist/index.d.mts +93 -7
- package/dist/index.js +390 -29
- package/dist/index.mjs +390 -29
- package/dist/interfaces/SpaceReputation.d.ts +44 -6
- 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/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -289,9 +289,59 @@ __export(users_exports, {
|
|
|
289
289
|
updateUser: () => updateUser
|
|
290
290
|
});
|
|
291
291
|
|
|
292
|
+
// src/core/spaceReputationParams.ts
|
|
293
|
+
var bothFormsWarned = false;
|
|
294
|
+
function isProduction() {
|
|
295
|
+
return typeof process !== "undefined" && !!process.env && process.env.NODE_ENV === "production";
|
|
296
|
+
}
|
|
297
|
+
function buildSpaceReputationParams(input) {
|
|
298
|
+
const { spaceReputation, spaceReputationId, spaceReputationDescendants } = input;
|
|
299
|
+
const objectPresent = spaceReputation !== void 0;
|
|
300
|
+
const flatPresent = spaceReputationId !== void 0 && spaceReputationId !== null || spaceReputationDescendants !== void 0 && spaceReputationDescendants !== null;
|
|
301
|
+
if (objectPresent && flatPresent && !bothFormsWarned && !isProduction()) {
|
|
302
|
+
bothFormsWarned = true;
|
|
303
|
+
console.warn(
|
|
304
|
+
"[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."
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
const result = {};
|
|
308
|
+
if (objectPresent) {
|
|
309
|
+
const spaceId = spaceReputation.spaceId;
|
|
310
|
+
if (spaceId !== void 0 && spaceId !== null) {
|
|
311
|
+
result.spaceReputationId = spaceId;
|
|
312
|
+
}
|
|
313
|
+
const includeDescendants = spaceReputation.includeDescendants;
|
|
314
|
+
if (includeDescendants !== void 0 && includeDescendants !== null) {
|
|
315
|
+
result.spaceReputationDescendants = includeDescendants;
|
|
316
|
+
}
|
|
317
|
+
return result;
|
|
318
|
+
}
|
|
319
|
+
if (spaceReputationId !== void 0 && spaceReputationId !== null) {
|
|
320
|
+
result.spaceReputationId = spaceReputationId;
|
|
321
|
+
}
|
|
322
|
+
if (spaceReputationDescendants !== void 0 && spaceReputationDescendants !== null) {
|
|
323
|
+
result.spaceReputationDescendants = spaceReputationDescendants;
|
|
324
|
+
}
|
|
325
|
+
return result;
|
|
326
|
+
}
|
|
327
|
+
|
|
292
328
|
// src/modules/users/fetchUserById.ts
|
|
293
329
|
async function fetchUserById(client, data) {
|
|
294
|
-
const {
|
|
330
|
+
const {
|
|
331
|
+
userId,
|
|
332
|
+
spaceReputation,
|
|
333
|
+
spaceReputationId,
|
|
334
|
+
spaceReputationDescendants,
|
|
335
|
+
...rest
|
|
336
|
+
} = data;
|
|
337
|
+
const params = {
|
|
338
|
+
...rest,
|
|
339
|
+
...buildSpaceReputationParams({
|
|
340
|
+
spaceReputation,
|
|
341
|
+
spaceReputationId,
|
|
342
|
+
spaceReputationDescendants
|
|
343
|
+
})
|
|
344
|
+
};
|
|
295
345
|
const response = await client.projectInstance.get(`/users/${userId}`, {
|
|
296
346
|
params
|
|
297
347
|
});
|
|
@@ -300,27 +350,72 @@ async function fetchUserById(client, data) {
|
|
|
300
350
|
|
|
301
351
|
// src/modules/users/fetchUserByForeignId.ts
|
|
302
352
|
async function fetchUserByForeignId(client, data) {
|
|
353
|
+
const {
|
|
354
|
+
spaceReputation,
|
|
355
|
+
spaceReputationId,
|
|
356
|
+
spaceReputationDescendants,
|
|
357
|
+
...rest
|
|
358
|
+
} = data;
|
|
303
359
|
const response = await client.projectInstance.get(
|
|
304
360
|
"/users/by-foreign-id",
|
|
305
|
-
{
|
|
361
|
+
{
|
|
362
|
+
params: {
|
|
363
|
+
...rest,
|
|
364
|
+
...buildSpaceReputationParams({
|
|
365
|
+
spaceReputation,
|
|
366
|
+
spaceReputationId,
|
|
367
|
+
spaceReputationDescendants
|
|
368
|
+
})
|
|
369
|
+
}
|
|
370
|
+
}
|
|
306
371
|
);
|
|
307
372
|
return response.data;
|
|
308
373
|
}
|
|
309
374
|
|
|
310
375
|
// src/modules/users/fetchUserByUsername.ts
|
|
311
376
|
async function fetchUserByUsername(client, data) {
|
|
377
|
+
const {
|
|
378
|
+
spaceReputation,
|
|
379
|
+
spaceReputationId,
|
|
380
|
+
spaceReputationDescendants,
|
|
381
|
+
...rest
|
|
382
|
+
} = data;
|
|
312
383
|
const response = await client.projectInstance.get(
|
|
313
384
|
"/users/by-username",
|
|
314
|
-
{
|
|
385
|
+
{
|
|
386
|
+
params: {
|
|
387
|
+
...rest,
|
|
388
|
+
...buildSpaceReputationParams({
|
|
389
|
+
spaceReputation,
|
|
390
|
+
spaceReputationId,
|
|
391
|
+
spaceReputationDescendants
|
|
392
|
+
})
|
|
393
|
+
}
|
|
394
|
+
}
|
|
315
395
|
);
|
|
316
396
|
return response.data;
|
|
317
397
|
}
|
|
318
398
|
|
|
319
399
|
// src/modules/users/fetchUserSuggestions.ts
|
|
320
400
|
async function fetchUserSuggestions(client, data) {
|
|
401
|
+
const {
|
|
402
|
+
spaceReputation,
|
|
403
|
+
spaceReputationId,
|
|
404
|
+
spaceReputationDescendants,
|
|
405
|
+
...rest
|
|
406
|
+
} = data;
|
|
321
407
|
const response = await client.projectInstance.get(
|
|
322
408
|
"/users/suggestions",
|
|
323
|
-
{
|
|
409
|
+
{
|
|
410
|
+
params: {
|
|
411
|
+
...rest,
|
|
412
|
+
...buildSpaceReputationParams({
|
|
413
|
+
spaceReputation,
|
|
414
|
+
spaceReputationId,
|
|
415
|
+
spaceReputationDescendants
|
|
416
|
+
})
|
|
417
|
+
}
|
|
418
|
+
}
|
|
324
419
|
);
|
|
325
420
|
return response.data;
|
|
326
421
|
}
|
|
@@ -379,7 +474,21 @@ async function updateUser(client, data) {
|
|
|
379
474
|
|
|
380
475
|
// src/modules/users/fetchFollowersByUserId.ts
|
|
381
476
|
async function fetchFollowersByUserId(client, data) {
|
|
382
|
-
const {
|
|
477
|
+
const {
|
|
478
|
+
userId,
|
|
479
|
+
spaceReputation,
|
|
480
|
+
spaceReputationId,
|
|
481
|
+
spaceReputationDescendants,
|
|
482
|
+
...rest
|
|
483
|
+
} = data;
|
|
484
|
+
const params = {
|
|
485
|
+
...rest,
|
|
486
|
+
...buildSpaceReputationParams({
|
|
487
|
+
spaceReputation,
|
|
488
|
+
spaceReputationId,
|
|
489
|
+
spaceReputationDescendants
|
|
490
|
+
})
|
|
491
|
+
};
|
|
383
492
|
const response = await client.projectInstance.get(`/users/${userId}/followers`, { params });
|
|
384
493
|
return response.data;
|
|
385
494
|
}
|
|
@@ -395,7 +504,21 @@ async function fetchFollowersCountByUserId(client, data) {
|
|
|
395
504
|
|
|
396
505
|
// src/modules/users/fetchFollowingByUserId.ts
|
|
397
506
|
async function fetchFollowingByUserId(client, data) {
|
|
398
|
-
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
|
+
};
|
|
399
522
|
const response = await client.projectInstance.get(`/users/${userId}/following`, { params });
|
|
400
523
|
return response.data;
|
|
401
524
|
}
|
|
@@ -411,7 +534,21 @@ async function fetchFollowingCountByUserId(client, data) {
|
|
|
411
534
|
|
|
412
535
|
// src/modules/users/fetchConnectionsByUserId.ts
|
|
413
536
|
async function fetchConnectionsByUserId(client, data) {
|
|
414
|
-
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
|
+
};
|
|
415
552
|
const response = await client.projectInstance.get(`/users/${userId}/connections`, { params });
|
|
416
553
|
return response.data;
|
|
417
554
|
}
|
|
@@ -507,7 +644,21 @@ async function createEntity(client, data) {
|
|
|
507
644
|
|
|
508
645
|
// src/modules/entities/fetchEntity.ts
|
|
509
646
|
async function fetchEntity(client, data) {
|
|
510
|
-
const {
|
|
647
|
+
const {
|
|
648
|
+
entityId,
|
|
649
|
+
spaceReputation,
|
|
650
|
+
spaceReputationId,
|
|
651
|
+
spaceReputationDescendants,
|
|
652
|
+
...rest
|
|
653
|
+
} = data;
|
|
654
|
+
const params = {
|
|
655
|
+
...rest,
|
|
656
|
+
...buildSpaceReputationParams({
|
|
657
|
+
spaceReputation,
|
|
658
|
+
spaceReputationId,
|
|
659
|
+
spaceReputationDescendants
|
|
660
|
+
})
|
|
661
|
+
};
|
|
511
662
|
const response = await client.projectInstance.get(
|
|
512
663
|
`/entities/${entityId}`,
|
|
513
664
|
{ params }
|
|
@@ -536,10 +687,23 @@ async function fetchEntityByShortId(client, data) {
|
|
|
536
687
|
// src/modules/entities/fetchManyEntities.ts
|
|
537
688
|
async function fetchManyEntities(client, data) {
|
|
538
689
|
const path = `/entities`;
|
|
690
|
+
const {
|
|
691
|
+
spaceReputation,
|
|
692
|
+
spaceReputationId,
|
|
693
|
+
spaceReputationDescendants,
|
|
694
|
+
...rest
|
|
695
|
+
} = data;
|
|
539
696
|
const response = await client.projectInstance.get(
|
|
540
697
|
path,
|
|
541
698
|
{
|
|
542
|
-
params:
|
|
699
|
+
params: {
|
|
700
|
+
...rest,
|
|
701
|
+
...buildSpaceReputationParams({
|
|
702
|
+
spaceReputation,
|
|
703
|
+
spaceReputationId,
|
|
704
|
+
spaceReputationDescendants
|
|
705
|
+
})
|
|
706
|
+
}
|
|
543
707
|
}
|
|
544
708
|
);
|
|
545
709
|
return response.data;
|
|
@@ -611,7 +775,21 @@ async function removeReaction(client, data) {
|
|
|
611
775
|
|
|
612
776
|
// src/modules/entities/fetchReactions.ts
|
|
613
777
|
async function fetchReactions(client, data) {
|
|
614
|
-
const {
|
|
778
|
+
const {
|
|
779
|
+
entityId,
|
|
780
|
+
spaceReputation,
|
|
781
|
+
spaceReputationId,
|
|
782
|
+
spaceReputationDescendants,
|
|
783
|
+
...rest
|
|
784
|
+
} = data;
|
|
785
|
+
const params = {
|
|
786
|
+
...rest,
|
|
787
|
+
...buildSpaceReputationParams({
|
|
788
|
+
spaceReputation,
|
|
789
|
+
spaceReputationId,
|
|
790
|
+
spaceReputationDescendants
|
|
791
|
+
})
|
|
792
|
+
};
|
|
615
793
|
const response = await client.projectInstance.get(
|
|
616
794
|
`/entities/${entityId}/reactions`,
|
|
617
795
|
{ params }
|
|
@@ -840,7 +1018,21 @@ async function createComment(client, data) {
|
|
|
840
1018
|
|
|
841
1019
|
// src/modules/comments/fetchComment.ts
|
|
842
1020
|
async function fetchComment(client, data) {
|
|
843
|
-
const {
|
|
1021
|
+
const {
|
|
1022
|
+
commentId,
|
|
1023
|
+
spaceReputation,
|
|
1024
|
+
spaceReputationId,
|
|
1025
|
+
spaceReputationDescendants,
|
|
1026
|
+
...rest
|
|
1027
|
+
} = data;
|
|
1028
|
+
const params = {
|
|
1029
|
+
...rest,
|
|
1030
|
+
...buildSpaceReputationParams({
|
|
1031
|
+
spaceReputation,
|
|
1032
|
+
spaceReputationId,
|
|
1033
|
+
spaceReputationDescendants
|
|
1034
|
+
})
|
|
1035
|
+
};
|
|
844
1036
|
const response = await client.projectInstance.get(
|
|
845
1037
|
`/comments/${commentId}`,
|
|
846
1038
|
{ params }
|
|
@@ -877,9 +1069,24 @@ async function deleteComment(client, data) {
|
|
|
877
1069
|
|
|
878
1070
|
// src/modules/comments/fetchManyComments.ts
|
|
879
1071
|
async function fetchManyComments(client, data) {
|
|
1072
|
+
const {
|
|
1073
|
+
spaceReputation,
|
|
1074
|
+
spaceReputationId,
|
|
1075
|
+
spaceReputationDescendants,
|
|
1076
|
+
...rest
|
|
1077
|
+
} = data;
|
|
880
1078
|
const response = await client.projectInstance.get(
|
|
881
1079
|
"/comments",
|
|
882
|
-
{
|
|
1080
|
+
{
|
|
1081
|
+
params: {
|
|
1082
|
+
...rest,
|
|
1083
|
+
...buildSpaceReputationParams({
|
|
1084
|
+
spaceReputation,
|
|
1085
|
+
spaceReputationId,
|
|
1086
|
+
spaceReputationDescendants
|
|
1087
|
+
})
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
883
1090
|
);
|
|
884
1091
|
return response.data;
|
|
885
1092
|
}
|
|
@@ -905,7 +1112,21 @@ async function removeReaction2(client, data) {
|
|
|
905
1112
|
|
|
906
1113
|
// src/modules/comments/fetchReactions.ts
|
|
907
1114
|
async function fetchReactions2(client, data) {
|
|
908
|
-
const {
|
|
1115
|
+
const {
|
|
1116
|
+
commentId,
|
|
1117
|
+
spaceReputation,
|
|
1118
|
+
spaceReputationId,
|
|
1119
|
+
spaceReputationDescendants,
|
|
1120
|
+
...rest
|
|
1121
|
+
} = data;
|
|
1122
|
+
const params = {
|
|
1123
|
+
...rest,
|
|
1124
|
+
...buildSpaceReputationParams({
|
|
1125
|
+
spaceReputation,
|
|
1126
|
+
spaceReputationId,
|
|
1127
|
+
spaceReputationDescendants
|
|
1128
|
+
})
|
|
1129
|
+
};
|
|
909
1130
|
const response = await client.projectInstance.get(
|
|
910
1131
|
`/comments/${commentId}/reactions`,
|
|
911
1132
|
{ params }
|
|
@@ -1130,7 +1351,21 @@ async function checkMyMembership(client, data) {
|
|
|
1130
1351
|
|
|
1131
1352
|
// src/modules/spaces/fetchSpaceMembers.ts
|
|
1132
1353
|
async function fetchSpaceMembers(client, data) {
|
|
1133
|
-
const {
|
|
1354
|
+
const {
|
|
1355
|
+
spaceId,
|
|
1356
|
+
spaceReputation,
|
|
1357
|
+
spaceReputationId,
|
|
1358
|
+
spaceReputationDescendants,
|
|
1359
|
+
...rest
|
|
1360
|
+
} = data;
|
|
1361
|
+
const params = {
|
|
1362
|
+
...rest,
|
|
1363
|
+
...buildSpaceReputationParams({
|
|
1364
|
+
spaceReputation,
|
|
1365
|
+
spaceReputationId,
|
|
1366
|
+
spaceReputationDescendants
|
|
1367
|
+
})
|
|
1368
|
+
};
|
|
1134
1369
|
const response = await client.projectInstance.get(
|
|
1135
1370
|
`/spaces/${spaceId}/members`,
|
|
1136
1371
|
{ params }
|
|
@@ -1140,7 +1375,21 @@ async function fetchSpaceMembers(client, data) {
|
|
|
1140
1375
|
|
|
1141
1376
|
// src/modules/spaces/fetchSpaceTeam.ts
|
|
1142
1377
|
async function fetchSpaceTeam(client, data) {
|
|
1143
|
-
const {
|
|
1378
|
+
const {
|
|
1379
|
+
spaceId,
|
|
1380
|
+
spaceReputation,
|
|
1381
|
+
spaceReputationId,
|
|
1382
|
+
spaceReputationDescendants,
|
|
1383
|
+
...rest
|
|
1384
|
+
} = data;
|
|
1385
|
+
const params = {
|
|
1386
|
+
...rest,
|
|
1387
|
+
...buildSpaceReputationParams({
|
|
1388
|
+
spaceReputation,
|
|
1389
|
+
spaceReputationId,
|
|
1390
|
+
spaceReputationDescendants
|
|
1391
|
+
})
|
|
1392
|
+
};
|
|
1144
1393
|
const response = await client.projectInstance.get(
|
|
1145
1394
|
`/spaces/${spaceId}/team`,
|
|
1146
1395
|
{ params }
|
|
@@ -1595,9 +1844,24 @@ async function createReport(client, data) {
|
|
|
1595
1844
|
|
|
1596
1845
|
// src/modules/reports/fetchModeratedReports.ts
|
|
1597
1846
|
async function fetchModeratedReports(client, data) {
|
|
1847
|
+
const {
|
|
1848
|
+
spaceReputation,
|
|
1849
|
+
spaceReputationId,
|
|
1850
|
+
spaceReputationDescendants,
|
|
1851
|
+
...rest
|
|
1852
|
+
} = data;
|
|
1598
1853
|
const response = await client.projectInstance.get(
|
|
1599
1854
|
"/reports/moderated",
|
|
1600
|
-
{
|
|
1855
|
+
{
|
|
1856
|
+
params: {
|
|
1857
|
+
...rest,
|
|
1858
|
+
...buildSpaceReputationParams({
|
|
1859
|
+
spaceReputation,
|
|
1860
|
+
spaceReputationId,
|
|
1861
|
+
spaceReputationDescendants
|
|
1862
|
+
})
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1601
1865
|
);
|
|
1602
1866
|
return response.data;
|
|
1603
1867
|
}
|
|
@@ -1606,6 +1870,7 @@ async function fetchModeratedReports(client, data) {
|
|
|
1606
1870
|
var search_exports = {};
|
|
1607
1871
|
__export(search_exports, {
|
|
1608
1872
|
askContent: () => askContent,
|
|
1873
|
+
matchUsers: () => matchUsers,
|
|
1609
1874
|
searchContent: () => searchContent,
|
|
1610
1875
|
searchSpaces: () => searchSpaces,
|
|
1611
1876
|
searchUsers: () => searchUsers
|
|
@@ -1613,11 +1878,22 @@ __export(search_exports, {
|
|
|
1613
1878
|
|
|
1614
1879
|
// src/modules/search/searchContent.ts
|
|
1615
1880
|
async function searchContent(client, data) {
|
|
1616
|
-
const {
|
|
1881
|
+
const {
|
|
1882
|
+
spaceReputation,
|
|
1883
|
+
spaceReputationId,
|
|
1884
|
+
spaceReputationDescendants,
|
|
1885
|
+
...body
|
|
1886
|
+
} = data;
|
|
1617
1887
|
const response = await client.projectInstance.post(
|
|
1618
1888
|
"/search/content",
|
|
1619
1889
|
body,
|
|
1620
|
-
{
|
|
1890
|
+
{
|
|
1891
|
+
params: buildSpaceReputationParams({
|
|
1892
|
+
spaceReputation,
|
|
1893
|
+
spaceReputationId,
|
|
1894
|
+
spaceReputationDescendants
|
|
1895
|
+
})
|
|
1896
|
+
}
|
|
1621
1897
|
);
|
|
1622
1898
|
return response.data;
|
|
1623
1899
|
}
|
|
@@ -1674,20 +1950,31 @@ function parseSseBlock(block) {
|
|
|
1674
1950
|
}
|
|
1675
1951
|
}
|
|
1676
1952
|
async function* askContent(client, data) {
|
|
1677
|
-
const {
|
|
1953
|
+
const {
|
|
1954
|
+
signal,
|
|
1955
|
+
spaceReputation,
|
|
1956
|
+
spaceReputationId,
|
|
1957
|
+
spaceReputationDescendants,
|
|
1958
|
+
...body
|
|
1959
|
+
} = data;
|
|
1678
1960
|
const baseURL = client.projectInstance.defaults.baseURL ?? "";
|
|
1679
1961
|
const authHeader = await client.getAuthHeader();
|
|
1680
1962
|
const headers = {
|
|
1681
1963
|
"Content-Type": "application/json"
|
|
1682
1964
|
};
|
|
1683
1965
|
if (authHeader) headers.Authorization = authHeader;
|
|
1966
|
+
const flatParams = buildSpaceReputationParams({
|
|
1967
|
+
spaceReputation,
|
|
1968
|
+
spaceReputationId,
|
|
1969
|
+
spaceReputationDescendants
|
|
1970
|
+
});
|
|
1684
1971
|
const search = new URLSearchParams();
|
|
1685
|
-
if (spaceReputationId != null)
|
|
1686
|
-
search.set("spaceReputationId", spaceReputationId);
|
|
1687
|
-
if (spaceReputationDescendants != null)
|
|
1972
|
+
if (flatParams.spaceReputationId != null)
|
|
1973
|
+
search.set("spaceReputationId", flatParams.spaceReputationId);
|
|
1974
|
+
if (flatParams.spaceReputationDescendants != null)
|
|
1688
1975
|
search.set(
|
|
1689
1976
|
"spaceReputationDescendants",
|
|
1690
|
-
String(spaceReputationDescendants)
|
|
1977
|
+
String(flatParams.spaceReputationDescendants)
|
|
1691
1978
|
);
|
|
1692
1979
|
const queryString = search.toString();
|
|
1693
1980
|
const url = `${baseURL}/search/ask${queryString ? `?${queryString}` : ""}`;
|
|
@@ -1733,6 +2020,15 @@ async function* askContent(client, data) {
|
|
|
1733
2020
|
}
|
|
1734
2021
|
}
|
|
1735
2022
|
|
|
2023
|
+
// src/modules/search/matchUsers.ts
|
|
2024
|
+
async function matchUsers(client, data) {
|
|
2025
|
+
const response = await client.projectInstance.post(
|
|
2026
|
+
"/match/users",
|
|
2027
|
+
data
|
|
2028
|
+
);
|
|
2029
|
+
return response.data;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
1736
2032
|
// src/modules/storage/index.ts
|
|
1737
2033
|
var storage_exports = {};
|
|
1738
2034
|
__export(storage_exports, {
|
|
@@ -1918,7 +2214,21 @@ async function getUnreadCount(client) {
|
|
|
1918
2214
|
|
|
1919
2215
|
// src/modules/chat/listMembers.ts
|
|
1920
2216
|
async function listMembers(client, data) {
|
|
1921
|
-
const {
|
|
2217
|
+
const {
|
|
2218
|
+
conversationId,
|
|
2219
|
+
spaceReputation,
|
|
2220
|
+
spaceReputationId,
|
|
2221
|
+
spaceReputationDescendants,
|
|
2222
|
+
...rest
|
|
2223
|
+
} = data;
|
|
2224
|
+
const params = {
|
|
2225
|
+
...rest,
|
|
2226
|
+
...buildSpaceReputationParams({
|
|
2227
|
+
spaceReputation,
|
|
2228
|
+
spaceReputationId,
|
|
2229
|
+
spaceReputationDescendants
|
|
2230
|
+
})
|
|
2231
|
+
};
|
|
1922
2232
|
const response = await client.projectInstance.get(`/chat/conversations/${conversationId}/members`, { params });
|
|
1923
2233
|
return response.data;
|
|
1924
2234
|
}
|
|
@@ -1963,7 +2273,21 @@ async function changeMemberRole(client, data) {
|
|
|
1963
2273
|
|
|
1964
2274
|
// src/modules/chat/listMessages.ts
|
|
1965
2275
|
async function listMessages(client, data) {
|
|
1966
|
-
const {
|
|
2276
|
+
const {
|
|
2277
|
+
conversationId,
|
|
2278
|
+
spaceReputation,
|
|
2279
|
+
spaceReputationId,
|
|
2280
|
+
spaceReputationDescendants,
|
|
2281
|
+
...rest
|
|
2282
|
+
} = data;
|
|
2283
|
+
const params = {
|
|
2284
|
+
...rest,
|
|
2285
|
+
...buildSpaceReputationParams({
|
|
2286
|
+
spaceReputation,
|
|
2287
|
+
spaceReputationId,
|
|
2288
|
+
spaceReputationDescendants
|
|
2289
|
+
})
|
|
2290
|
+
};
|
|
1967
2291
|
const response = await client.projectInstance.get(
|
|
1968
2292
|
`/chat/conversations/${conversationId}/messages`,
|
|
1969
2293
|
{ params }
|
|
@@ -1977,13 +2301,20 @@ async function sendMessage(client, data) {
|
|
|
1977
2301
|
conversationId,
|
|
1978
2302
|
files,
|
|
1979
2303
|
// The server reads these from `req.query`, not the body, so they are
|
|
1980
|
-
// forwarded as query params (in both the JSON and multipart branches)
|
|
2304
|
+
// forwarded as query params (in both the JSON and multipart branches),
|
|
2305
|
+
// flattened via the helper so the `spaceReputation` object never reaches
|
|
2306
|
+
// the serializer.
|
|
2307
|
+
spaceReputation,
|
|
1981
2308
|
spaceReputationId,
|
|
1982
2309
|
spaceReputationDescendants,
|
|
1983
2310
|
...body
|
|
1984
2311
|
} = data;
|
|
1985
2312
|
const path = `/chat/conversations/${conversationId}/messages`;
|
|
1986
|
-
const params = {
|
|
2313
|
+
const params = buildSpaceReputationParams({
|
|
2314
|
+
spaceReputation,
|
|
2315
|
+
spaceReputationId,
|
|
2316
|
+
spaceReputationDescendants
|
|
2317
|
+
});
|
|
1987
2318
|
if (files && files.length > 0) {
|
|
1988
2319
|
const formData = new FormData();
|
|
1989
2320
|
for (const file of files) {
|
|
@@ -2005,7 +2336,22 @@ async function sendMessage(client, data) {
|
|
|
2005
2336
|
|
|
2006
2337
|
// src/modules/chat/getMessage.ts
|
|
2007
2338
|
async function getMessage(client, data) {
|
|
2008
|
-
const {
|
|
2339
|
+
const {
|
|
2340
|
+
conversationId,
|
|
2341
|
+
messageId,
|
|
2342
|
+
spaceReputation,
|
|
2343
|
+
spaceReputationId,
|
|
2344
|
+
spaceReputationDescendants,
|
|
2345
|
+
...rest
|
|
2346
|
+
} = data;
|
|
2347
|
+
const params = {
|
|
2348
|
+
...rest,
|
|
2349
|
+
...buildSpaceReputationParams({
|
|
2350
|
+
spaceReputation,
|
|
2351
|
+
spaceReputationId,
|
|
2352
|
+
spaceReputationDescendants
|
|
2353
|
+
})
|
|
2354
|
+
};
|
|
2009
2355
|
const response = await client.projectInstance.get(
|
|
2010
2356
|
`/chat/conversations/${conversationId}/messages/${messageId}`,
|
|
2011
2357
|
{ params }
|
|
@@ -2044,7 +2390,22 @@ async function toggleReaction(client, data) {
|
|
|
2044
2390
|
|
|
2045
2391
|
// src/modules/chat/listReactions.ts
|
|
2046
2392
|
async function listReactions(client, data) {
|
|
2047
|
-
const {
|
|
2393
|
+
const {
|
|
2394
|
+
conversationId,
|
|
2395
|
+
messageId,
|
|
2396
|
+
spaceReputation,
|
|
2397
|
+
spaceReputationId,
|
|
2398
|
+
spaceReputationDescendants,
|
|
2399
|
+
...rest
|
|
2400
|
+
} = data;
|
|
2401
|
+
const params = {
|
|
2402
|
+
...rest,
|
|
2403
|
+
...buildSpaceReputationParams({
|
|
2404
|
+
spaceReputation,
|
|
2405
|
+
spaceReputationId,
|
|
2406
|
+
spaceReputationDescendants
|
|
2407
|
+
})
|
|
2408
|
+
};
|
|
2048
2409
|
const response = await client.projectInstance.get(
|
|
2049
2410
|
`/chat/conversations/${conversationId}/messages/${messageId}/reactions`,
|
|
2050
2411
|
{ params }
|
|
@@ -20,18 +20,37 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export interface SpaceReputationContextParams {
|
|
22
22
|
/**
|
|
23
|
+
* Opt into space-scoped reputation enrichment. The primary form: an object
|
|
24
|
+
* describing the space and whether to include descendants.
|
|
25
|
+
*
|
|
26
|
+
* - `spaceId` — a space `<uuid>` (reputation within that specific space),
|
|
27
|
+
* `"none"` (no space context — global reputation only), or `"context"`
|
|
28
|
+
* (derive the space from each record's own context, e.g. a feed enriches
|
|
29
|
+
* each row's author with reputation in that row's space).
|
|
30
|
+
* - `includeDescendants` — whether to include descendant spaces when
|
|
31
|
+
* computing space-scoped reputation. Only honored with an explicit space
|
|
32
|
+
* `<uuid>` (ignored for `"none"` / `"context"`).
|
|
33
|
+
*/
|
|
34
|
+
spaceReputation?: {
|
|
35
|
+
spaceId: string | "none" | "context";
|
|
36
|
+
includeDescendants?: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Pass the `spaceReputation` object instead. Retained for
|
|
40
|
+
* back-compat; removal is a later major version.
|
|
41
|
+
*
|
|
23
42
|
* Opt into space-scoped reputation enrichment. Accepted forms:
|
|
24
43
|
* - a space `<uuid>` — reputation within that specific space;
|
|
25
44
|
* - `"none"` — no space context (global reputation only);
|
|
26
45
|
* - `"context"` — derive the space from each record's own context
|
|
27
46
|
* (e.g. a feed enriches each row's author with reputation in that row's
|
|
28
47
|
* space).
|
|
29
|
-
*
|
|
30
|
-
* Plain `string` — a `string | "none" | "context"` union adds no safety
|
|
31
|
-
* since a uuid is already a string.
|
|
32
48
|
*/
|
|
33
49
|
spaceReputationId?: string;
|
|
34
50
|
/**
|
|
51
|
+
* @deprecated Pass the `spaceReputation` object (`includeDescendants`)
|
|
52
|
+
* instead. Retained for back-compat; removal is a later major version.
|
|
53
|
+
*
|
|
35
54
|
* Whether to include descendant spaces when computing space-scoped
|
|
36
55
|
* reputation. Only honored with an explicit space `<uuid>` (ignored for
|
|
37
56
|
* `"none"` / `"context"`).
|
|
@@ -43,18 +62,37 @@ export interface SpaceReputationContextParams {
|
|
|
43
62
|
*/
|
|
44
63
|
export interface SpaceReputationUserParams {
|
|
45
64
|
/**
|
|
65
|
+
* Opt into space-scoped reputation enrichment. The primary form: an object
|
|
66
|
+
* describing the space and whether to include descendants.
|
|
67
|
+
*
|
|
68
|
+
* - `spaceId` — a space `<uuid>` (reputation within that specific space) or
|
|
69
|
+
* `"none"` (no space context — global reputation only). `"context"` is
|
|
70
|
+
* **rejected by the server (400)** on user-direct endpoints — there is no
|
|
71
|
+
* per-record context to derive a space from.
|
|
72
|
+
* - `includeDescendants` — whether to include descendant spaces when
|
|
73
|
+
* computing space-scoped reputation. Only honored with an explicit space
|
|
74
|
+
* `<uuid>`.
|
|
75
|
+
*/
|
|
76
|
+
spaceReputation?: {
|
|
77
|
+
spaceId: string | "none";
|
|
78
|
+
includeDescendants?: boolean;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated Pass the `spaceReputation` object instead. Retained for
|
|
82
|
+
* back-compat; removal is a later major version.
|
|
83
|
+
*
|
|
46
84
|
* Opt into space-scoped reputation enrichment. Accepted forms:
|
|
47
85
|
* - a space `<uuid>` — reputation within that specific space;
|
|
48
86
|
* - `"none"` — no space context (global reputation only).
|
|
49
87
|
*
|
|
50
88
|
* `"context"` is **rejected by the server (400)** on user-direct endpoints —
|
|
51
89
|
* there is no per-record context to derive a space from.
|
|
52
|
-
*
|
|
53
|
-
* Plain `string` — a `string | "none"` union adds no safety since a uuid is
|
|
54
|
-
* already a string.
|
|
55
90
|
*/
|
|
56
91
|
spaceReputationId?: string;
|
|
57
92
|
/**
|
|
93
|
+
* @deprecated Pass the `spaceReputation` object (`includeDescendants`)
|
|
94
|
+
* instead. Retained for back-compat; removal is a later major version.
|
|
95
|
+
*
|
|
58
96
|
* Whether to include descendant spaces when computing space-scoped
|
|
59
97
|
* reputation. Only honored with an explicit space `<uuid>`.
|
|
60
98
|
*/
|
|
@@ -5,6 +5,12 @@ export interface AskContentProps extends SpaceReputationContextParams {
|
|
|
5
5
|
query: string;
|
|
6
6
|
sourceTypes?: ("entity" | "comment" | "message")[];
|
|
7
7
|
spaceId?: string;
|
|
8
|
+
/**
|
|
9
|
+
* With a `spaceId`, also search every space nested under it (children,
|
|
10
|
+
* grandchildren — the whole subtree, any depth). Ignored without a `spaceId`.
|
|
11
|
+
* Defaults to false (exact-space search).
|
|
12
|
+
*/
|
|
13
|
+
includeChildSpaces?: boolean;
|
|
8
14
|
conversationId?: string;
|
|
9
15
|
limit?: number;
|
|
10
16
|
/** Abort the in-flight stream (e.g. when the user navigates away). */
|