@sublay/js 7.7.0 → 7.7.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/index.d.mts +291 -44
- package/dist/index.d.ts +1 -1
- package/dist/index.js +158 -32
- package/dist/index.mjs +158 -32
- package/dist/interfaces/Report.d.ts +7 -1
- package/dist/interfaces/Workspace.d.ts +74 -1
- package/dist/modules/chat/index.d.ts +0 -1
- package/dist/modules/collections/updateCollection.d.ts +1 -1
- package/dist/modules/comments/updateComment.d.ts +4 -1
- package/dist/modules/reports/createReport.d.ts +2 -2
- package/dist/modules/spaces/fetchUserSpaces.d.ts +6 -0
- package/dist/modules/workspaces/acceptWorkspaceInvite.d.ts +13 -0
- package/dist/modules/workspaces/createWorkspaceInvite.d.ts +17 -0
- package/dist/modules/workspaces/declineWorkspaceInvite.d.ts +14 -0
- package/dist/modules/workspaces/deleteWorkspace.d.ts +13 -0
- package/dist/modules/workspaces/fetchMyWorkspaceInvites.d.ts +15 -0
- package/dist/modules/workspaces/fetchWorkspaceAuthority.d.ts +11 -0
- package/dist/modules/workspaces/fetchWorkspaceInvites.d.ts +17 -0
- package/dist/modules/workspaces/fetchWorkspaceMemberStanding.d.ts +11 -0
- package/dist/modules/workspaces/fetchWorkspaceMembers.d.ts +13 -0
- package/dist/modules/workspaces/index.d.ts +18 -6
- package/dist/modules/workspaces/leaveWorkspace.d.ts +11 -0
- package/dist/modules/workspaces/removeWorkspaceMember.d.ts +12 -0
- package/dist/modules/workspaces/removeWorkspaceMemberFromSubtree.d.ts +16 -0
- package/dist/modules/workspaces/resendWorkspaceInvite.d.ts +12 -0
- package/dist/modules/workspaces/revokeWorkspaceInvite.d.ts +13 -0
- package/dist/modules/workspaces/transferWorkspaceOwnership.d.ts +15 -0
- package/dist/modules/workspaces/updateWorkspace.d.ts +12 -0
- package/dist/modules/workspaces/updateWorkspaceInheritFlag.d.ts +13 -0
- package/dist/modules/workspaces/updateWorkspaceMember.d.ts +17 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2211,7 +2211,6 @@ __export(chat_exports, {
|
|
|
2211
2211
|
markAsRead: () => markAsRead,
|
|
2212
2212
|
muteConversation: () => muteConversation,
|
|
2213
2213
|
removeMember: () => removeMember,
|
|
2214
|
-
reportMessage: () => reportMessage,
|
|
2215
2214
|
sendMessage: () => sendMessage,
|
|
2216
2215
|
toggleReaction: () => toggleReaction,
|
|
2217
2216
|
updateConversation: () => updateConversation
|
|
@@ -2501,16 +2500,6 @@ async function muteConversation(client, data) {
|
|
|
2501
2500
|
return response.data;
|
|
2502
2501
|
}
|
|
2503
2502
|
|
|
2504
|
-
// src/modules/chat/reportMessage.ts
|
|
2505
|
-
async function reportMessage(client, data) {
|
|
2506
|
-
const { conversationId, messageId, ...body } = data;
|
|
2507
|
-
const response = await client.projectInstance.post(
|
|
2508
|
-
`/chat/conversations/${conversationId}/messages/${messageId}/report`,
|
|
2509
|
-
body
|
|
2510
|
-
);
|
|
2511
|
-
return response.data;
|
|
2512
|
-
}
|
|
2513
|
-
|
|
2514
2503
|
// src/modules/push/index.ts
|
|
2515
2504
|
var push_exports = {};
|
|
2516
2505
|
__export(push_exports, {
|
|
@@ -2539,22 +2528,36 @@ async function updateNotificationPreferences(client, data) {
|
|
|
2539
2528
|
// src/modules/workspaces/index.ts
|
|
2540
2529
|
var workspaces_exports = {};
|
|
2541
2530
|
__export(workspaces_exports, {
|
|
2542
|
-
|
|
2543
|
-
createInvite: () => createInvite,
|
|
2531
|
+
acceptWorkspaceInvite: () => acceptWorkspaceInvite,
|
|
2544
2532
|
createWorkspace: () => createWorkspace,
|
|
2545
|
-
|
|
2533
|
+
createWorkspaceInvite: () => createWorkspaceInvite,
|
|
2534
|
+
declineWorkspaceInvite: () => declineWorkspaceInvite,
|
|
2535
|
+
deleteWorkspace: () => deleteWorkspace,
|
|
2546
2536
|
fetchManyWorkspaces: () => fetchManyWorkspaces,
|
|
2547
|
-
|
|
2548
|
-
fetchMyInvites: () => fetchMyInvites,
|
|
2537
|
+
fetchMyWorkspaceInvites: () => fetchMyWorkspaceInvites,
|
|
2549
2538
|
fetchWorkspace: () => fetchWorkspace,
|
|
2550
|
-
|
|
2539
|
+
fetchWorkspaceAuthority: () => fetchWorkspaceAuthority,
|
|
2540
|
+
fetchWorkspaceInvites: () => fetchWorkspaceInvites,
|
|
2541
|
+
fetchWorkspaceMemberStanding: () => fetchWorkspaceMemberStanding,
|
|
2542
|
+
fetchWorkspaceMembers: () => fetchWorkspaceMembers,
|
|
2543
|
+
leaveWorkspace: () => leaveWorkspace,
|
|
2544
|
+
removeWorkspaceMember: () => removeWorkspaceMember,
|
|
2545
|
+
removeWorkspaceMemberFromSubtree: () => removeWorkspaceMemberFromSubtree,
|
|
2546
|
+
resendWorkspaceInvite: () => resendWorkspaceInvite,
|
|
2547
|
+
revokeWorkspaceInvite: () => revokeWorkspaceInvite,
|
|
2548
|
+
transferWorkspaceOwnership: () => transferWorkspaceOwnership,
|
|
2549
|
+
updateWorkspace: () => updateWorkspace,
|
|
2550
|
+
updateWorkspaceInheritFlag: () => updateWorkspaceInheritFlag,
|
|
2551
|
+
updateWorkspaceMember: () => updateWorkspaceMember
|
|
2551
2552
|
});
|
|
2552
2553
|
|
|
2553
2554
|
// src/modules/workspaces/createWorkspace.ts
|
|
2554
2555
|
async function createWorkspace(client, data) {
|
|
2556
|
+
const body = { ...data };
|
|
2557
|
+
delete body.userId;
|
|
2555
2558
|
const response = await client.projectInstance.post(
|
|
2556
2559
|
"/workspaces",
|
|
2557
|
-
|
|
2560
|
+
body
|
|
2558
2561
|
);
|
|
2559
2562
|
return response.data;
|
|
2560
2563
|
}
|
|
@@ -2571,19 +2574,113 @@ async function fetchWorkspace(client, data) {
|
|
|
2571
2574
|
|
|
2572
2575
|
// src/modules/workspaces/fetchManyWorkspaces.ts
|
|
2573
2576
|
async function fetchManyWorkspaces(client, data = {}) {
|
|
2574
|
-
const
|
|
2577
|
+
const params = { ...data };
|
|
2578
|
+
delete params.userId;
|
|
2579
|
+
const response = await client.projectInstance.get("/workspaces", { params });
|
|
2580
|
+
return response.data;
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
// src/modules/workspaces/updateWorkspace.ts
|
|
2584
|
+
async function updateWorkspace(client, data) {
|
|
2585
|
+
const { workspaceId, ...rest } = data;
|
|
2586
|
+
const body = { ...rest };
|
|
2587
|
+
delete body.userId;
|
|
2588
|
+
const response = await client.projectInstance.patch(
|
|
2589
|
+
`/workspaces/${workspaceId}`,
|
|
2590
|
+
body
|
|
2591
|
+
);
|
|
2592
|
+
return response.data;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
// src/modules/workspaces/updateWorkspaceInheritFlag.ts
|
|
2596
|
+
async function updateWorkspaceInheritFlag(client, data) {
|
|
2597
|
+
const { workspaceId, inheritsFromParent } = data;
|
|
2598
|
+
const response = await client.projectInstance.patch(
|
|
2599
|
+
`/workspaces/${workspaceId}/inherit-flag`,
|
|
2600
|
+
{ inheritsFromParent }
|
|
2601
|
+
);
|
|
2602
|
+
return response.data;
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
// src/modules/workspaces/deleteWorkspace.ts
|
|
2606
|
+
async function deleteWorkspace(client, data) {
|
|
2607
|
+
const { workspaceId } = data;
|
|
2608
|
+
const response = await client.projectInstance.delete(
|
|
2609
|
+
`/workspaces/${workspaceId}`
|
|
2610
|
+
);
|
|
2575
2611
|
return response.data;
|
|
2576
2612
|
}
|
|
2577
2613
|
|
|
2578
|
-
// src/modules/workspaces/
|
|
2579
|
-
async function
|
|
2580
|
-
const { workspaceId, ...
|
|
2614
|
+
// src/modules/workspaces/transferWorkspaceOwnership.ts
|
|
2615
|
+
async function transferWorkspaceOwnership(client, data) {
|
|
2616
|
+
const { workspaceId, ...rest } = data;
|
|
2617
|
+
const body = { ...rest };
|
|
2618
|
+
delete body.userId;
|
|
2619
|
+
const response = await client.projectInstance.post(
|
|
2620
|
+
`/workspaces/${workspaceId}/transfer-ownership`,
|
|
2621
|
+
body
|
|
2622
|
+
);
|
|
2623
|
+
return response.data;
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
// src/modules/workspaces/fetchWorkspaceMembers.ts
|
|
2627
|
+
async function fetchWorkspaceMembers(client, data) {
|
|
2628
|
+
const { workspaceId, ...rest } = data;
|
|
2629
|
+
const params = { ...rest };
|
|
2630
|
+
delete params.userId;
|
|
2581
2631
|
const response = await client.projectInstance.get(`/workspaces/${workspaceId}/members`, { params });
|
|
2582
2632
|
return response.data;
|
|
2583
2633
|
}
|
|
2584
2634
|
|
|
2585
|
-
// src/modules/workspaces/
|
|
2586
|
-
async function
|
|
2635
|
+
// src/modules/workspaces/fetchWorkspaceMemberStanding.ts
|
|
2636
|
+
async function fetchWorkspaceMemberStanding(client, data) {
|
|
2637
|
+
const { workspaceId, targetUserId } = data;
|
|
2638
|
+
const response = await client.projectInstance.get(
|
|
2639
|
+
`/workspaces/${workspaceId}/members/${targetUserId}`
|
|
2640
|
+
);
|
|
2641
|
+
return response.data;
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
// src/modules/workspaces/updateWorkspaceMember.ts
|
|
2645
|
+
async function updateWorkspaceMember(client, data) {
|
|
2646
|
+
const { workspaceId, targetUserId, ...rest } = data;
|
|
2647
|
+
const body = { ...rest };
|
|
2648
|
+
delete body.userId;
|
|
2649
|
+
const response = await client.projectInstance.patch(
|
|
2650
|
+
`/workspaces/${workspaceId}/members/${targetUserId}`,
|
|
2651
|
+
body
|
|
2652
|
+
);
|
|
2653
|
+
return response.data;
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
// src/modules/workspaces/removeWorkspaceMember.ts
|
|
2657
|
+
async function removeWorkspaceMember(client, data) {
|
|
2658
|
+
const { workspaceId, targetUserId } = data;
|
|
2659
|
+
await client.projectInstance.delete(
|
|
2660
|
+
`/workspaces/${workspaceId}/members/${targetUserId}`
|
|
2661
|
+
);
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
// src/modules/workspaces/leaveWorkspace.ts
|
|
2665
|
+
async function leaveWorkspace(client, data) {
|
|
2666
|
+
const { workspaceId } = data;
|
|
2667
|
+
await client.projectInstance.delete(
|
|
2668
|
+
`/workspaces/${workspaceId}/members/me`
|
|
2669
|
+
);
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
// src/modules/workspaces/removeWorkspaceMemberFromSubtree.ts
|
|
2673
|
+
async function removeWorkspaceMemberFromSubtree(client, data) {
|
|
2674
|
+
const { workspaceId, targetUserId } = data;
|
|
2675
|
+
const response = await client.projectInstance.post(
|
|
2676
|
+
`/workspaces/${workspaceId}/members/${targetUserId}/remove-from-subtree`,
|
|
2677
|
+
{}
|
|
2678
|
+
);
|
|
2679
|
+
return response.data;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
// src/modules/workspaces/createWorkspaceInvite.ts
|
|
2683
|
+
async function createWorkspaceInvite(client, data) {
|
|
2587
2684
|
const { workspaceId, ...body } = data;
|
|
2588
2685
|
const response = await client.projectInstance.post(
|
|
2589
2686
|
`/workspaces/${workspaceId}/invites`,
|
|
@@ -2592,8 +2689,37 @@ async function createInvite(client, data) {
|
|
|
2592
2689
|
return response.data;
|
|
2593
2690
|
}
|
|
2594
2691
|
|
|
2595
|
-
// src/modules/workspaces/
|
|
2596
|
-
async function
|
|
2692
|
+
// src/modules/workspaces/fetchWorkspaceInvites.ts
|
|
2693
|
+
async function fetchWorkspaceInvites(client, data) {
|
|
2694
|
+
const { workspaceId } = data;
|
|
2695
|
+
const response = await client.projectInstance.get(
|
|
2696
|
+
`/workspaces/${workspaceId}/invites`
|
|
2697
|
+
);
|
|
2698
|
+
return response.data;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
// src/modules/workspaces/revokeWorkspaceInvite.ts
|
|
2702
|
+
async function revokeWorkspaceInvite(client, data) {
|
|
2703
|
+
const { workspaceId, inviteId } = data;
|
|
2704
|
+
const response = await client.projectInstance.post(
|
|
2705
|
+
`/workspaces/${workspaceId}/invites/${inviteId}/revoke`,
|
|
2706
|
+
{}
|
|
2707
|
+
);
|
|
2708
|
+
return response.data;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
// src/modules/workspaces/resendWorkspaceInvite.ts
|
|
2712
|
+
async function resendWorkspaceInvite(client, data) {
|
|
2713
|
+
const { workspaceId, inviteId } = data;
|
|
2714
|
+
const response = await client.projectInstance.post(
|
|
2715
|
+
`/workspaces/${workspaceId}/invites/${inviteId}/resend`,
|
|
2716
|
+
{}
|
|
2717
|
+
);
|
|
2718
|
+
return response.data;
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2721
|
+
// src/modules/workspaces/acceptWorkspaceInvite.ts
|
|
2722
|
+
async function acceptWorkspaceInvite(client, data) {
|
|
2597
2723
|
const { inviteId } = data;
|
|
2598
2724
|
const response = await client.projectInstance.post(
|
|
2599
2725
|
`/workspace-invites/${inviteId}/accept`,
|
|
@@ -2602,8 +2728,8 @@ async function acceptInvite(client, data) {
|
|
|
2602
2728
|
return response.data;
|
|
2603
2729
|
}
|
|
2604
2730
|
|
|
2605
|
-
// src/modules/workspaces/
|
|
2606
|
-
async function
|
|
2731
|
+
// src/modules/workspaces/declineWorkspaceInvite.ts
|
|
2732
|
+
async function declineWorkspaceInvite(client, data) {
|
|
2607
2733
|
const { inviteId } = data;
|
|
2608
2734
|
const response = await client.projectInstance.post(
|
|
2609
2735
|
`/workspace-invites/${inviteId}/decline`,
|
|
@@ -2612,16 +2738,16 @@ async function declineInvite(client, data) {
|
|
|
2612
2738
|
return response.data;
|
|
2613
2739
|
}
|
|
2614
2740
|
|
|
2615
|
-
// src/modules/workspaces/
|
|
2616
|
-
async function
|
|
2741
|
+
// src/modules/workspaces/fetchMyWorkspaceInvites.ts
|
|
2742
|
+
async function fetchMyWorkspaceInvites(client) {
|
|
2617
2743
|
const response = await client.projectInstance.get(
|
|
2618
2744
|
"/me/workspace-invites"
|
|
2619
2745
|
);
|
|
2620
2746
|
return response.data;
|
|
2621
2747
|
}
|
|
2622
2748
|
|
|
2623
|
-
// src/modules/workspaces/
|
|
2624
|
-
async function
|
|
2749
|
+
// src/modules/workspaces/fetchWorkspaceAuthority.ts
|
|
2750
|
+
async function fetchWorkspaceAuthority(client, data) {
|
|
2625
2751
|
const { workspaceId } = data;
|
|
2626
2752
|
const response = await client.projectInstance.get(
|
|
2627
2753
|
`/workspaces/${workspaceId}/authority/me`
|
package/dist/index.mjs
CHANGED
|
@@ -2179,7 +2179,6 @@ __export(chat_exports, {
|
|
|
2179
2179
|
markAsRead: () => markAsRead,
|
|
2180
2180
|
muteConversation: () => muteConversation,
|
|
2181
2181
|
removeMember: () => removeMember,
|
|
2182
|
-
reportMessage: () => reportMessage,
|
|
2183
2182
|
sendMessage: () => sendMessage,
|
|
2184
2183
|
toggleReaction: () => toggleReaction,
|
|
2185
2184
|
updateConversation: () => updateConversation
|
|
@@ -2469,16 +2468,6 @@ async function muteConversation(client, data) {
|
|
|
2469
2468
|
return response.data;
|
|
2470
2469
|
}
|
|
2471
2470
|
|
|
2472
|
-
// src/modules/chat/reportMessage.ts
|
|
2473
|
-
async function reportMessage(client, data) {
|
|
2474
|
-
const { conversationId, messageId, ...body } = data;
|
|
2475
|
-
const response = await client.projectInstance.post(
|
|
2476
|
-
`/chat/conversations/${conversationId}/messages/${messageId}/report`,
|
|
2477
|
-
body
|
|
2478
|
-
);
|
|
2479
|
-
return response.data;
|
|
2480
|
-
}
|
|
2481
|
-
|
|
2482
2471
|
// src/modules/push/index.ts
|
|
2483
2472
|
var push_exports = {};
|
|
2484
2473
|
__export(push_exports, {
|
|
@@ -2507,22 +2496,36 @@ async function updateNotificationPreferences(client, data) {
|
|
|
2507
2496
|
// src/modules/workspaces/index.ts
|
|
2508
2497
|
var workspaces_exports = {};
|
|
2509
2498
|
__export(workspaces_exports, {
|
|
2510
|
-
|
|
2511
|
-
createInvite: () => createInvite,
|
|
2499
|
+
acceptWorkspaceInvite: () => acceptWorkspaceInvite,
|
|
2512
2500
|
createWorkspace: () => createWorkspace,
|
|
2513
|
-
|
|
2501
|
+
createWorkspaceInvite: () => createWorkspaceInvite,
|
|
2502
|
+
declineWorkspaceInvite: () => declineWorkspaceInvite,
|
|
2503
|
+
deleteWorkspace: () => deleteWorkspace,
|
|
2514
2504
|
fetchManyWorkspaces: () => fetchManyWorkspaces,
|
|
2515
|
-
|
|
2516
|
-
fetchMyInvites: () => fetchMyInvites,
|
|
2505
|
+
fetchMyWorkspaceInvites: () => fetchMyWorkspaceInvites,
|
|
2517
2506
|
fetchWorkspace: () => fetchWorkspace,
|
|
2518
|
-
|
|
2507
|
+
fetchWorkspaceAuthority: () => fetchWorkspaceAuthority,
|
|
2508
|
+
fetchWorkspaceInvites: () => fetchWorkspaceInvites,
|
|
2509
|
+
fetchWorkspaceMemberStanding: () => fetchWorkspaceMemberStanding,
|
|
2510
|
+
fetchWorkspaceMembers: () => fetchWorkspaceMembers,
|
|
2511
|
+
leaveWorkspace: () => leaveWorkspace,
|
|
2512
|
+
removeWorkspaceMember: () => removeWorkspaceMember,
|
|
2513
|
+
removeWorkspaceMemberFromSubtree: () => removeWorkspaceMemberFromSubtree,
|
|
2514
|
+
resendWorkspaceInvite: () => resendWorkspaceInvite,
|
|
2515
|
+
revokeWorkspaceInvite: () => revokeWorkspaceInvite,
|
|
2516
|
+
transferWorkspaceOwnership: () => transferWorkspaceOwnership,
|
|
2517
|
+
updateWorkspace: () => updateWorkspace,
|
|
2518
|
+
updateWorkspaceInheritFlag: () => updateWorkspaceInheritFlag,
|
|
2519
|
+
updateWorkspaceMember: () => updateWorkspaceMember
|
|
2519
2520
|
});
|
|
2520
2521
|
|
|
2521
2522
|
// src/modules/workspaces/createWorkspace.ts
|
|
2522
2523
|
async function createWorkspace(client, data) {
|
|
2524
|
+
const body = { ...data };
|
|
2525
|
+
delete body.userId;
|
|
2523
2526
|
const response = await client.projectInstance.post(
|
|
2524
2527
|
"/workspaces",
|
|
2525
|
-
|
|
2528
|
+
body
|
|
2526
2529
|
);
|
|
2527
2530
|
return response.data;
|
|
2528
2531
|
}
|
|
@@ -2539,19 +2542,113 @@ async function fetchWorkspace(client, data) {
|
|
|
2539
2542
|
|
|
2540
2543
|
// src/modules/workspaces/fetchManyWorkspaces.ts
|
|
2541
2544
|
async function fetchManyWorkspaces(client, data = {}) {
|
|
2542
|
-
const
|
|
2545
|
+
const params = { ...data };
|
|
2546
|
+
delete params.userId;
|
|
2547
|
+
const response = await client.projectInstance.get("/workspaces", { params });
|
|
2548
|
+
return response.data;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
// src/modules/workspaces/updateWorkspace.ts
|
|
2552
|
+
async function updateWorkspace(client, data) {
|
|
2553
|
+
const { workspaceId, ...rest } = data;
|
|
2554
|
+
const body = { ...rest };
|
|
2555
|
+
delete body.userId;
|
|
2556
|
+
const response = await client.projectInstance.patch(
|
|
2557
|
+
`/workspaces/${workspaceId}`,
|
|
2558
|
+
body
|
|
2559
|
+
);
|
|
2560
|
+
return response.data;
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
// src/modules/workspaces/updateWorkspaceInheritFlag.ts
|
|
2564
|
+
async function updateWorkspaceInheritFlag(client, data) {
|
|
2565
|
+
const { workspaceId, inheritsFromParent } = data;
|
|
2566
|
+
const response = await client.projectInstance.patch(
|
|
2567
|
+
`/workspaces/${workspaceId}/inherit-flag`,
|
|
2568
|
+
{ inheritsFromParent }
|
|
2569
|
+
);
|
|
2570
|
+
return response.data;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
// src/modules/workspaces/deleteWorkspace.ts
|
|
2574
|
+
async function deleteWorkspace(client, data) {
|
|
2575
|
+
const { workspaceId } = data;
|
|
2576
|
+
const response = await client.projectInstance.delete(
|
|
2577
|
+
`/workspaces/${workspaceId}`
|
|
2578
|
+
);
|
|
2543
2579
|
return response.data;
|
|
2544
2580
|
}
|
|
2545
2581
|
|
|
2546
|
-
// src/modules/workspaces/
|
|
2547
|
-
async function
|
|
2548
|
-
const { workspaceId, ...
|
|
2582
|
+
// src/modules/workspaces/transferWorkspaceOwnership.ts
|
|
2583
|
+
async function transferWorkspaceOwnership(client, data) {
|
|
2584
|
+
const { workspaceId, ...rest } = data;
|
|
2585
|
+
const body = { ...rest };
|
|
2586
|
+
delete body.userId;
|
|
2587
|
+
const response = await client.projectInstance.post(
|
|
2588
|
+
`/workspaces/${workspaceId}/transfer-ownership`,
|
|
2589
|
+
body
|
|
2590
|
+
);
|
|
2591
|
+
return response.data;
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
// src/modules/workspaces/fetchWorkspaceMembers.ts
|
|
2595
|
+
async function fetchWorkspaceMembers(client, data) {
|
|
2596
|
+
const { workspaceId, ...rest } = data;
|
|
2597
|
+
const params = { ...rest };
|
|
2598
|
+
delete params.userId;
|
|
2549
2599
|
const response = await client.projectInstance.get(`/workspaces/${workspaceId}/members`, { params });
|
|
2550
2600
|
return response.data;
|
|
2551
2601
|
}
|
|
2552
2602
|
|
|
2553
|
-
// src/modules/workspaces/
|
|
2554
|
-
async function
|
|
2603
|
+
// src/modules/workspaces/fetchWorkspaceMemberStanding.ts
|
|
2604
|
+
async function fetchWorkspaceMemberStanding(client, data) {
|
|
2605
|
+
const { workspaceId, targetUserId } = data;
|
|
2606
|
+
const response = await client.projectInstance.get(
|
|
2607
|
+
`/workspaces/${workspaceId}/members/${targetUserId}`
|
|
2608
|
+
);
|
|
2609
|
+
return response.data;
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
// src/modules/workspaces/updateWorkspaceMember.ts
|
|
2613
|
+
async function updateWorkspaceMember(client, data) {
|
|
2614
|
+
const { workspaceId, targetUserId, ...rest } = data;
|
|
2615
|
+
const body = { ...rest };
|
|
2616
|
+
delete body.userId;
|
|
2617
|
+
const response = await client.projectInstance.patch(
|
|
2618
|
+
`/workspaces/${workspaceId}/members/${targetUserId}`,
|
|
2619
|
+
body
|
|
2620
|
+
);
|
|
2621
|
+
return response.data;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
// src/modules/workspaces/removeWorkspaceMember.ts
|
|
2625
|
+
async function removeWorkspaceMember(client, data) {
|
|
2626
|
+
const { workspaceId, targetUserId } = data;
|
|
2627
|
+
await client.projectInstance.delete(
|
|
2628
|
+
`/workspaces/${workspaceId}/members/${targetUserId}`
|
|
2629
|
+
);
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
// src/modules/workspaces/leaveWorkspace.ts
|
|
2633
|
+
async function leaveWorkspace(client, data) {
|
|
2634
|
+
const { workspaceId } = data;
|
|
2635
|
+
await client.projectInstance.delete(
|
|
2636
|
+
`/workspaces/${workspaceId}/members/me`
|
|
2637
|
+
);
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
// src/modules/workspaces/removeWorkspaceMemberFromSubtree.ts
|
|
2641
|
+
async function removeWorkspaceMemberFromSubtree(client, data) {
|
|
2642
|
+
const { workspaceId, targetUserId } = data;
|
|
2643
|
+
const response = await client.projectInstance.post(
|
|
2644
|
+
`/workspaces/${workspaceId}/members/${targetUserId}/remove-from-subtree`,
|
|
2645
|
+
{}
|
|
2646
|
+
);
|
|
2647
|
+
return response.data;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
// src/modules/workspaces/createWorkspaceInvite.ts
|
|
2651
|
+
async function createWorkspaceInvite(client, data) {
|
|
2555
2652
|
const { workspaceId, ...body } = data;
|
|
2556
2653
|
const response = await client.projectInstance.post(
|
|
2557
2654
|
`/workspaces/${workspaceId}/invites`,
|
|
@@ -2560,8 +2657,37 @@ async function createInvite(client, data) {
|
|
|
2560
2657
|
return response.data;
|
|
2561
2658
|
}
|
|
2562
2659
|
|
|
2563
|
-
// src/modules/workspaces/
|
|
2564
|
-
async function
|
|
2660
|
+
// src/modules/workspaces/fetchWorkspaceInvites.ts
|
|
2661
|
+
async function fetchWorkspaceInvites(client, data) {
|
|
2662
|
+
const { workspaceId } = data;
|
|
2663
|
+
const response = await client.projectInstance.get(
|
|
2664
|
+
`/workspaces/${workspaceId}/invites`
|
|
2665
|
+
);
|
|
2666
|
+
return response.data;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
// src/modules/workspaces/revokeWorkspaceInvite.ts
|
|
2670
|
+
async function revokeWorkspaceInvite(client, data) {
|
|
2671
|
+
const { workspaceId, inviteId } = data;
|
|
2672
|
+
const response = await client.projectInstance.post(
|
|
2673
|
+
`/workspaces/${workspaceId}/invites/${inviteId}/revoke`,
|
|
2674
|
+
{}
|
|
2675
|
+
);
|
|
2676
|
+
return response.data;
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
// src/modules/workspaces/resendWorkspaceInvite.ts
|
|
2680
|
+
async function resendWorkspaceInvite(client, data) {
|
|
2681
|
+
const { workspaceId, inviteId } = data;
|
|
2682
|
+
const response = await client.projectInstance.post(
|
|
2683
|
+
`/workspaces/${workspaceId}/invites/${inviteId}/resend`,
|
|
2684
|
+
{}
|
|
2685
|
+
);
|
|
2686
|
+
return response.data;
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
// src/modules/workspaces/acceptWorkspaceInvite.ts
|
|
2690
|
+
async function acceptWorkspaceInvite(client, data) {
|
|
2565
2691
|
const { inviteId } = data;
|
|
2566
2692
|
const response = await client.projectInstance.post(
|
|
2567
2693
|
`/workspace-invites/${inviteId}/accept`,
|
|
@@ -2570,8 +2696,8 @@ async function acceptInvite(client, data) {
|
|
|
2570
2696
|
return response.data;
|
|
2571
2697
|
}
|
|
2572
2698
|
|
|
2573
|
-
// src/modules/workspaces/
|
|
2574
|
-
async function
|
|
2699
|
+
// src/modules/workspaces/declineWorkspaceInvite.ts
|
|
2700
|
+
async function declineWorkspaceInvite(client, data) {
|
|
2575
2701
|
const { inviteId } = data;
|
|
2576
2702
|
const response = await client.projectInstance.post(
|
|
2577
2703
|
`/workspace-invites/${inviteId}/decline`,
|
|
@@ -2580,16 +2706,16 @@ async function declineInvite(client, data) {
|
|
|
2580
2706
|
return response.data;
|
|
2581
2707
|
}
|
|
2582
2708
|
|
|
2583
|
-
// src/modules/workspaces/
|
|
2584
|
-
async function
|
|
2709
|
+
// src/modules/workspaces/fetchMyWorkspaceInvites.ts
|
|
2710
|
+
async function fetchMyWorkspaceInvites(client) {
|
|
2585
2711
|
const response = await client.projectInstance.get(
|
|
2586
2712
|
"/me/workspace-invites"
|
|
2587
2713
|
);
|
|
2588
2714
|
return response.data;
|
|
2589
2715
|
}
|
|
2590
2716
|
|
|
2591
|
-
// src/modules/workspaces/
|
|
2592
|
-
async function
|
|
2717
|
+
// src/modules/workspaces/fetchWorkspaceAuthority.ts
|
|
2718
|
+
async function fetchWorkspaceAuthority(client, data) {
|
|
2593
2719
|
const { workspaceId } = data;
|
|
2594
2720
|
const response = await client.projectInstance.get(
|
|
2595
2721
|
`/workspaces/${workspaceId}/authority/me`
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Entity } from "./Entity";
|
|
2
2
|
import { Comment } from "./Comment";
|
|
3
3
|
import { Space } from "./Space";
|
|
4
|
-
export type ReportTargetType = "entity" | "comment";
|
|
4
|
+
export type ReportTargetType = "entity" | "comment" | "message";
|
|
5
|
+
/**
|
|
6
|
+
* The reasons the API accepts on a report. Server-enforced — anything outside
|
|
7
|
+
* this set is rejected with `report/invalid-body`. Use `other` plus `details`
|
|
8
|
+
* for anything the taxonomy doesn't cover.
|
|
9
|
+
*/
|
|
10
|
+
export type ReportReason = "spam" | "inappropriateContent" | "harassment" | "misinformation" | "hateSpeech" | "violence" | "illegalActivity" | "selfHarm" | "other";
|
|
5
11
|
export type ReportStatus = "pending" | "on-hold" | "escalated" | "dismissed" | "actioned";
|
|
6
12
|
export interface UserReport {
|
|
7
13
|
id: string;
|
|
@@ -11,6 +11,13 @@ import { User } from "./User";
|
|
|
11
11
|
export type WorkspaceCapability = "view" | "invite" | "remove-member" | "edit-member-access" | "edit-member-profile" | "create-sub-workspace" | "edit-workspace";
|
|
12
12
|
export type WorkspaceInvitationStatus = "pending" | "accepted" | "declined" | "revoked";
|
|
13
13
|
export type WorkspaceAuthorityReason = "owner" | "ancestor-owner" | "member" | "reach-holder";
|
|
14
|
+
export type WorkspaceAuthorityReasonDetail = {
|
|
15
|
+
type: "owner" | "member";
|
|
16
|
+
viaWorkspaceId?: never;
|
|
17
|
+
} | {
|
|
18
|
+
type: "ancestor-owner" | "reach-holder";
|
|
19
|
+
viaWorkspaceId: string;
|
|
20
|
+
};
|
|
14
21
|
export interface Workspace {
|
|
15
22
|
id: string;
|
|
16
23
|
name: string;
|
|
@@ -23,6 +30,18 @@ export interface Workspace {
|
|
|
23
30
|
updatedAt: string;
|
|
24
31
|
memberCount?: number;
|
|
25
32
|
}
|
|
33
|
+
export interface WorkspaceMember {
|
|
34
|
+
id: string;
|
|
35
|
+
workspaceId: string;
|
|
36
|
+
userId: string;
|
|
37
|
+
capabilities: WorkspaceCapability[];
|
|
38
|
+
permissions: string[];
|
|
39
|
+
rank: number;
|
|
40
|
+
title: string | null;
|
|
41
|
+
metadata: Record<string, any>;
|
|
42
|
+
joinedAt: string;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
}
|
|
26
45
|
export interface WorkspaceInvitation {
|
|
27
46
|
id: string;
|
|
28
47
|
workspaceId: string;
|
|
@@ -67,9 +86,63 @@ export interface WorkspaceRosterCountsResponse {
|
|
|
67
86
|
total: number;
|
|
68
87
|
distinctUsers: number;
|
|
69
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* The `user` carried by a standing read. Normally the full user record, but the
|
|
91
|
+
* server falls back to `{ id }` alone when the user row is gone (a deleted user
|
|
92
|
+
* with a lingering membership row is a reachable case), so every field except
|
|
93
|
+
* `id` may be absent.
|
|
94
|
+
*/
|
|
95
|
+
export type WorkspaceStandingUser = Pick<User, "id"> & Partial<Omit<User, "id">>;
|
|
96
|
+
export interface WorkspaceMemberStanding {
|
|
97
|
+
user: WorkspaceStandingUser;
|
|
98
|
+
reasons: WorkspaceAuthorityReasonDetail[];
|
|
99
|
+
capabilities?: WorkspaceCapability[];
|
|
100
|
+
permissions?: string[];
|
|
101
|
+
rank?: number | null;
|
|
102
|
+
title: string | null;
|
|
103
|
+
metadata: Record<string, any>;
|
|
104
|
+
}
|
|
70
105
|
export interface WorkspaceAuthority {
|
|
71
|
-
reasons:
|
|
106
|
+
reasons: WorkspaceAuthorityReasonDetail[];
|
|
72
107
|
capabilities: WorkspaceCapability[];
|
|
73
108
|
permissions: string[];
|
|
74
109
|
rank: number | null;
|
|
75
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* One descendant the subtree sweep did NOT clear, where the target user still
|
|
113
|
+
* holds a direct membership.
|
|
114
|
+
*
|
|
115
|
+
* `id` / `name` are masked TOGETHER: an entry the acting user may see carries
|
|
116
|
+
* both, and one they may not carries `null` for both — the sweep reports THAT a
|
|
117
|
+
* membership survived without disclosing the existence or name of a sealed
|
|
118
|
+
* sub-workspace the actor has no authority over (the same sealing fence the
|
|
119
|
+
* descendant roster read applies). Modelled as a discriminated union so a
|
|
120
|
+
* `null` check on `id` narrows `name` too.
|
|
121
|
+
*/
|
|
122
|
+
export type SkippedWorkspace = {
|
|
123
|
+
id: string;
|
|
124
|
+
name: string;
|
|
125
|
+
/** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */
|
|
126
|
+
reason: "out-of-reach";
|
|
127
|
+
} | {
|
|
128
|
+
id: null;
|
|
129
|
+
name: null;
|
|
130
|
+
/** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */
|
|
131
|
+
reason: "out-of-reach";
|
|
132
|
+
};
|
|
133
|
+
export interface RemoveWorkspaceMemberFromSubtreeResponse {
|
|
134
|
+
removedCount: number;
|
|
135
|
+
removed: {
|
|
136
|
+
workspaceId: string;
|
|
137
|
+
userId: string;
|
|
138
|
+
}[];
|
|
139
|
+
/**
|
|
140
|
+
* How many descendant memberships the target RETAINED because the sweep could
|
|
141
|
+
* not reach them. Always `0` for an owner / ancestor-owner / privileged key.
|
|
142
|
+
* A non-zero value means the offboarding is PARTIAL — never conclude a user is
|
|
143
|
+
* fully removed from `removedCount` alone.
|
|
144
|
+
*/
|
|
145
|
+
skippedCount: number;
|
|
146
|
+
/** One entry per retained membership; `skippedCount === skipped.length`. */
|
|
147
|
+
skipped: SkippedWorkspace[];
|
|
148
|
+
}
|
|
@@ -2,6 +2,6 @@ import { SublayHttpClient } from "../../core/client";
|
|
|
2
2
|
import { Collection } from "../../interfaces/Collection";
|
|
3
3
|
export interface UpdateCollectionProps {
|
|
4
4
|
collectionId: string;
|
|
5
|
-
name
|
|
5
|
+
name: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function updateCollection(client: SublayHttpClient, data: UpdateCollectionProps): Promise<Collection>;
|
|
@@ -2,6 +2,9 @@ import { SublayHttpClient } from "../../core/client";
|
|
|
2
2
|
import { Comment } from "../../interfaces/Comment";
|
|
3
3
|
export interface UpdateCommentProps {
|
|
4
4
|
commentId: string;
|
|
5
|
-
content
|
|
5
|
+
/** New text content. Cannot be empty. Omit to leave the content untouched. */
|
|
6
|
+
content?: string;
|
|
7
|
+
/** Replaces the comment's metadata wholesale (not merged). */
|
|
8
|
+
metadata?: Record<string, any>;
|
|
6
9
|
}
|
|
7
10
|
export declare function updateComment(client: SublayHttpClient, data: UpdateCommentProps): Promise<Comment>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SublayHttpClient } from "../../core/client";
|
|
2
|
-
import { CreateReportResponse, ReportTargetType } from "../../interfaces/Report";
|
|
2
|
+
import { CreateReportResponse, ReportReason, ReportTargetType } from "../../interfaces/Report";
|
|
3
3
|
export interface CreateReportProps {
|
|
4
4
|
targetType: ReportTargetType;
|
|
5
5
|
targetId: string;
|
|
6
|
-
reason:
|
|
6
|
+
reason: ReportReason;
|
|
7
7
|
details?: string;
|
|
8
8
|
}
|
|
9
9
|
export declare function createReport(client: SublayHttpClient, data: CreateReportProps): Promise<CreateReportResponse>;
|
|
@@ -7,5 +7,11 @@ export interface FetchUserSpacesProps {
|
|
|
7
7
|
include?: string;
|
|
8
8
|
role?: string;
|
|
9
9
|
all?: "true" | "false";
|
|
10
|
+
/**
|
|
11
|
+
* Membership status to list. Defaults to `"active"` (spaces the user is in);
|
|
12
|
+
* `"pending"` returns join requests awaiting approval, `"banned"` the spaces
|
|
13
|
+
* they were removed from.
|
|
14
|
+
*/
|
|
15
|
+
status?: "active" | "pending" | "banned";
|
|
10
16
|
}
|
|
11
17
|
export declare function fetchUserSpaces(client: SublayHttpClient, data: FetchUserSpacesProps): Promise<UserSpacesResponse>;
|