@sublay/js 7.6.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/README.md +1 -1
- package/dist/index.d.mts +459 -55
- package/dist/index.d.ts +3 -0
- package/dist/index.js +232 -32
- package/dist/index.mjs +232 -32
- package/dist/interfaces/Report.d.ts +7 -1
- package/dist/interfaces/Space.d.ts +0 -16
- package/dist/interfaces/Workspace.d.ts +148 -0
- package/dist/modules/chat/editMessage.d.ts +3 -2
- 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/spaces/index.d.ts +0 -2
- package/dist/modules/workspaces/acceptInvite.d.ts +13 -0
- package/dist/modules/workspaces/acceptWorkspaceInvite.d.ts +13 -0
- package/dist/modules/workspaces/createInvite.d.ts +17 -0
- package/dist/modules/workspaces/createWorkspace.d.ts +12 -0
- package/dist/modules/workspaces/createWorkspaceInvite.d.ts +17 -0
- package/dist/modules/workspaces/declineInvite.d.ts +12 -0
- package/dist/modules/workspaces/declineWorkspaceInvite.d.ts +14 -0
- package/dist/modules/workspaces/deleteWorkspace.d.ts +13 -0
- package/dist/modules/workspaces/fetchManyWorkspaces.d.ts +13 -0
- package/dist/modules/workspaces/fetchMembers.d.ts +13 -0
- package/dist/modules/workspaces/fetchMyInvites.d.ts +11 -0
- package/dist/modules/workspaces/fetchMyWorkspaceInvites.d.ts +15 -0
- package/dist/modules/workspaces/fetchWorkspace.d.ts +7 -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/getAuthority.d.ts +11 -0
- package/dist/modules/workspaces/index.d.ts +21 -0
- 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
|
@@ -1233,7 +1233,6 @@ __export(spaces_exports, {
|
|
|
1233
1233
|
deleteRule: () => deleteRule,
|
|
1234
1234
|
deleteSpace: () => deleteSpace,
|
|
1235
1235
|
fetchChildSpaces: () => fetchChildSpaces,
|
|
1236
|
-
fetchDigestConfig: () => fetchDigestConfig,
|
|
1237
1236
|
fetchManyRules: () => fetchManyRules,
|
|
1238
1237
|
fetchManySpaces: () => fetchManySpaces,
|
|
1239
1238
|
fetchMutualSpaces: () => fetchMutualSpaces,
|
|
@@ -1257,7 +1256,6 @@ __export(spaces_exports, {
|
|
|
1257
1256
|
reorderRules: () => reorderRules,
|
|
1258
1257
|
setSpaceEntityNsfw: () => setSpaceEntityNsfw,
|
|
1259
1258
|
unbanMember: () => unbanMember,
|
|
1260
|
-
updateDigestConfig: () => updateDigestConfig,
|
|
1261
1259
|
updateMemberRole: () => updateMemberRole,
|
|
1262
1260
|
updateRule: () => updateRule,
|
|
1263
1261
|
updateSpace: () => updateSpace
|
|
@@ -1628,25 +1626,6 @@ async function moderateSpaceComment(client, data) {
|
|
|
1628
1626
|
return response.data;
|
|
1629
1627
|
}
|
|
1630
1628
|
|
|
1631
|
-
// src/modules/spaces/fetchDigestConfig.ts
|
|
1632
|
-
async function fetchDigestConfig(client, data) {
|
|
1633
|
-
const { spaceId } = data;
|
|
1634
|
-
const response = await client.projectInstance.get(
|
|
1635
|
-
`/spaces/${spaceId}/digest-config`
|
|
1636
|
-
);
|
|
1637
|
-
return response.data;
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
// src/modules/spaces/updateDigestConfig.ts
|
|
1641
|
-
async function updateDigestConfig(client, data) {
|
|
1642
|
-
const { spaceId, ...body } = data;
|
|
1643
|
-
const response = await client.projectInstance.patch(
|
|
1644
|
-
`/spaces/${spaceId}/digest-config`,
|
|
1645
|
-
body
|
|
1646
|
-
);
|
|
1647
|
-
return response.data;
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
1629
|
// src/modules/spaces/getSpaceConversation.ts
|
|
1651
1630
|
async function getSpaceConversation(client, data) {
|
|
1652
1631
|
const { spaceId } = data;
|
|
@@ -2232,7 +2211,6 @@ __export(chat_exports, {
|
|
|
2232
2211
|
markAsRead: () => markAsRead,
|
|
2233
2212
|
muteConversation: () => muteConversation,
|
|
2234
2213
|
removeMember: () => removeMember,
|
|
2235
|
-
reportMessage: () => reportMessage,
|
|
2236
2214
|
sendMessage: () => sendMessage,
|
|
2237
2215
|
toggleReaction: () => toggleReaction,
|
|
2238
2216
|
updateConversation: () => updateConversation
|
|
@@ -2522,16 +2500,6 @@ async function muteConversation(client, data) {
|
|
|
2522
2500
|
return response.data;
|
|
2523
2501
|
}
|
|
2524
2502
|
|
|
2525
|
-
// src/modules/chat/reportMessage.ts
|
|
2526
|
-
async function reportMessage(client, data) {
|
|
2527
|
-
const { conversationId, messageId, ...body } = data;
|
|
2528
|
-
const response = await client.projectInstance.post(
|
|
2529
|
-
`/chat/conversations/${conversationId}/messages/${messageId}/report`,
|
|
2530
|
-
body
|
|
2531
|
-
);
|
|
2532
|
-
return response.data;
|
|
2533
|
-
}
|
|
2534
|
-
|
|
2535
2503
|
// src/modules/push/index.ts
|
|
2536
2504
|
var push_exports = {};
|
|
2537
2505
|
__export(push_exports, {
|
|
@@ -2557,6 +2525,236 @@ async function updateNotificationPreferences(client, data) {
|
|
|
2557
2525
|
return response.data;
|
|
2558
2526
|
}
|
|
2559
2527
|
|
|
2528
|
+
// src/modules/workspaces/index.ts
|
|
2529
|
+
var workspaces_exports = {};
|
|
2530
|
+
__export(workspaces_exports, {
|
|
2531
|
+
acceptWorkspaceInvite: () => acceptWorkspaceInvite,
|
|
2532
|
+
createWorkspace: () => createWorkspace,
|
|
2533
|
+
createWorkspaceInvite: () => createWorkspaceInvite,
|
|
2534
|
+
declineWorkspaceInvite: () => declineWorkspaceInvite,
|
|
2535
|
+
deleteWorkspace: () => deleteWorkspace,
|
|
2536
|
+
fetchManyWorkspaces: () => fetchManyWorkspaces,
|
|
2537
|
+
fetchMyWorkspaceInvites: () => fetchMyWorkspaceInvites,
|
|
2538
|
+
fetchWorkspace: () => fetchWorkspace,
|
|
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
|
|
2552
|
+
});
|
|
2553
|
+
|
|
2554
|
+
// src/modules/workspaces/createWorkspace.ts
|
|
2555
|
+
async function createWorkspace(client, data) {
|
|
2556
|
+
const body = { ...data };
|
|
2557
|
+
delete body.userId;
|
|
2558
|
+
const response = await client.projectInstance.post(
|
|
2559
|
+
"/workspaces",
|
|
2560
|
+
body
|
|
2561
|
+
);
|
|
2562
|
+
return response.data;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
// src/modules/workspaces/fetchWorkspace.ts
|
|
2566
|
+
async function fetchWorkspace(client, data) {
|
|
2567
|
+
const { workspaceId, include } = data;
|
|
2568
|
+
const response = await client.projectInstance.get(
|
|
2569
|
+
`/workspaces/${workspaceId}`,
|
|
2570
|
+
{ params: include ? { include } : void 0 }
|
|
2571
|
+
);
|
|
2572
|
+
return response.data;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
// src/modules/workspaces/fetchManyWorkspaces.ts
|
|
2576
|
+
async function fetchManyWorkspaces(client, data = {}) {
|
|
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
|
+
);
|
|
2611
|
+
return response.data;
|
|
2612
|
+
}
|
|
2613
|
+
|
|
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;
|
|
2631
|
+
const response = await client.projectInstance.get(`/workspaces/${workspaceId}/members`, { params });
|
|
2632
|
+
return response.data;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
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) {
|
|
2684
|
+
const { workspaceId, ...body } = data;
|
|
2685
|
+
const response = await client.projectInstance.post(
|
|
2686
|
+
`/workspaces/${workspaceId}/invites`,
|
|
2687
|
+
body
|
|
2688
|
+
);
|
|
2689
|
+
return response.data;
|
|
2690
|
+
}
|
|
2691
|
+
|
|
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) {
|
|
2723
|
+
const { inviteId } = data;
|
|
2724
|
+
const response = await client.projectInstance.post(
|
|
2725
|
+
`/workspace-invites/${inviteId}/accept`,
|
|
2726
|
+
{}
|
|
2727
|
+
);
|
|
2728
|
+
return response.data;
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
// src/modules/workspaces/declineWorkspaceInvite.ts
|
|
2732
|
+
async function declineWorkspaceInvite(client, data) {
|
|
2733
|
+
const { inviteId } = data;
|
|
2734
|
+
const response = await client.projectInstance.post(
|
|
2735
|
+
`/workspace-invites/${inviteId}/decline`,
|
|
2736
|
+
{}
|
|
2737
|
+
);
|
|
2738
|
+
return response.data;
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
// src/modules/workspaces/fetchMyWorkspaceInvites.ts
|
|
2742
|
+
async function fetchMyWorkspaceInvites(client) {
|
|
2743
|
+
const response = await client.projectInstance.get(
|
|
2744
|
+
"/me/workspace-invites"
|
|
2745
|
+
);
|
|
2746
|
+
return response.data;
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
// src/modules/workspaces/fetchWorkspaceAuthority.ts
|
|
2750
|
+
async function fetchWorkspaceAuthority(client, data) {
|
|
2751
|
+
const { workspaceId } = data;
|
|
2752
|
+
const response = await client.projectInstance.get(
|
|
2753
|
+
`/workspaces/${workspaceId}/authority/me`
|
|
2754
|
+
);
|
|
2755
|
+
return response.data;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2560
2758
|
// src/modules/tables/find.ts
|
|
2561
2759
|
async function find(client, tableName, query = {}) {
|
|
2562
2760
|
const { filters, includeDeleted, ...rest } = query;
|
|
@@ -2688,6 +2886,7 @@ var SublayClient = class _SublayClient {
|
|
|
2688
2886
|
oauth;
|
|
2689
2887
|
chat;
|
|
2690
2888
|
push;
|
|
2889
|
+
workspaces;
|
|
2691
2890
|
constructor(http) {
|
|
2692
2891
|
this.http = http;
|
|
2693
2892
|
this.auth = bindModule(auth_exports, this.http);
|
|
@@ -2706,6 +2905,7 @@ var SublayClient = class _SublayClient {
|
|
|
2706
2905
|
this.oauth = bindModule(oauth_exports, this.http);
|
|
2707
2906
|
this.chat = bindModule(chat_exports, this.http);
|
|
2708
2907
|
this.push = bindModule(push_exports, this.http);
|
|
2908
|
+
this.workspaces = bindModule(workspaces_exports, this.http);
|
|
2709
2909
|
}
|
|
2710
2910
|
static async init(config) {
|
|
2711
2911
|
const http = new SublayHttpClient(config);
|
package/dist/index.mjs
CHANGED
|
@@ -1201,7 +1201,6 @@ __export(spaces_exports, {
|
|
|
1201
1201
|
deleteRule: () => deleteRule,
|
|
1202
1202
|
deleteSpace: () => deleteSpace,
|
|
1203
1203
|
fetchChildSpaces: () => fetchChildSpaces,
|
|
1204
|
-
fetchDigestConfig: () => fetchDigestConfig,
|
|
1205
1204
|
fetchManyRules: () => fetchManyRules,
|
|
1206
1205
|
fetchManySpaces: () => fetchManySpaces,
|
|
1207
1206
|
fetchMutualSpaces: () => fetchMutualSpaces,
|
|
@@ -1225,7 +1224,6 @@ __export(spaces_exports, {
|
|
|
1225
1224
|
reorderRules: () => reorderRules,
|
|
1226
1225
|
setSpaceEntityNsfw: () => setSpaceEntityNsfw,
|
|
1227
1226
|
unbanMember: () => unbanMember,
|
|
1228
|
-
updateDigestConfig: () => updateDigestConfig,
|
|
1229
1227
|
updateMemberRole: () => updateMemberRole,
|
|
1230
1228
|
updateRule: () => updateRule,
|
|
1231
1229
|
updateSpace: () => updateSpace
|
|
@@ -1596,25 +1594,6 @@ async function moderateSpaceComment(client, data) {
|
|
|
1596
1594
|
return response.data;
|
|
1597
1595
|
}
|
|
1598
1596
|
|
|
1599
|
-
// src/modules/spaces/fetchDigestConfig.ts
|
|
1600
|
-
async function fetchDigestConfig(client, data) {
|
|
1601
|
-
const { spaceId } = data;
|
|
1602
|
-
const response = await client.projectInstance.get(
|
|
1603
|
-
`/spaces/${spaceId}/digest-config`
|
|
1604
|
-
);
|
|
1605
|
-
return response.data;
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
// src/modules/spaces/updateDigestConfig.ts
|
|
1609
|
-
async function updateDigestConfig(client, data) {
|
|
1610
|
-
const { spaceId, ...body } = data;
|
|
1611
|
-
const response = await client.projectInstance.patch(
|
|
1612
|
-
`/spaces/${spaceId}/digest-config`,
|
|
1613
|
-
body
|
|
1614
|
-
);
|
|
1615
|
-
return response.data;
|
|
1616
|
-
}
|
|
1617
|
-
|
|
1618
1597
|
// src/modules/spaces/getSpaceConversation.ts
|
|
1619
1598
|
async function getSpaceConversation(client, data) {
|
|
1620
1599
|
const { spaceId } = data;
|
|
@@ -2200,7 +2179,6 @@ __export(chat_exports, {
|
|
|
2200
2179
|
markAsRead: () => markAsRead,
|
|
2201
2180
|
muteConversation: () => muteConversation,
|
|
2202
2181
|
removeMember: () => removeMember,
|
|
2203
|
-
reportMessage: () => reportMessage,
|
|
2204
2182
|
sendMessage: () => sendMessage,
|
|
2205
2183
|
toggleReaction: () => toggleReaction,
|
|
2206
2184
|
updateConversation: () => updateConversation
|
|
@@ -2490,16 +2468,6 @@ async function muteConversation(client, data) {
|
|
|
2490
2468
|
return response.data;
|
|
2491
2469
|
}
|
|
2492
2470
|
|
|
2493
|
-
// src/modules/chat/reportMessage.ts
|
|
2494
|
-
async function reportMessage(client, data) {
|
|
2495
|
-
const { conversationId, messageId, ...body } = data;
|
|
2496
|
-
const response = await client.projectInstance.post(
|
|
2497
|
-
`/chat/conversations/${conversationId}/messages/${messageId}/report`,
|
|
2498
|
-
body
|
|
2499
|
-
);
|
|
2500
|
-
return response.data;
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
2471
|
// src/modules/push/index.ts
|
|
2504
2472
|
var push_exports = {};
|
|
2505
2473
|
__export(push_exports, {
|
|
@@ -2525,6 +2493,236 @@ async function updateNotificationPreferences(client, data) {
|
|
|
2525
2493
|
return response.data;
|
|
2526
2494
|
}
|
|
2527
2495
|
|
|
2496
|
+
// src/modules/workspaces/index.ts
|
|
2497
|
+
var workspaces_exports = {};
|
|
2498
|
+
__export(workspaces_exports, {
|
|
2499
|
+
acceptWorkspaceInvite: () => acceptWorkspaceInvite,
|
|
2500
|
+
createWorkspace: () => createWorkspace,
|
|
2501
|
+
createWorkspaceInvite: () => createWorkspaceInvite,
|
|
2502
|
+
declineWorkspaceInvite: () => declineWorkspaceInvite,
|
|
2503
|
+
deleteWorkspace: () => deleteWorkspace,
|
|
2504
|
+
fetchManyWorkspaces: () => fetchManyWorkspaces,
|
|
2505
|
+
fetchMyWorkspaceInvites: () => fetchMyWorkspaceInvites,
|
|
2506
|
+
fetchWorkspace: () => fetchWorkspace,
|
|
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
|
|
2520
|
+
});
|
|
2521
|
+
|
|
2522
|
+
// src/modules/workspaces/createWorkspace.ts
|
|
2523
|
+
async function createWorkspace(client, data) {
|
|
2524
|
+
const body = { ...data };
|
|
2525
|
+
delete body.userId;
|
|
2526
|
+
const response = await client.projectInstance.post(
|
|
2527
|
+
"/workspaces",
|
|
2528
|
+
body
|
|
2529
|
+
);
|
|
2530
|
+
return response.data;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
// src/modules/workspaces/fetchWorkspace.ts
|
|
2534
|
+
async function fetchWorkspace(client, data) {
|
|
2535
|
+
const { workspaceId, include } = data;
|
|
2536
|
+
const response = await client.projectInstance.get(
|
|
2537
|
+
`/workspaces/${workspaceId}`,
|
|
2538
|
+
{ params: include ? { include } : void 0 }
|
|
2539
|
+
);
|
|
2540
|
+
return response.data;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
// src/modules/workspaces/fetchManyWorkspaces.ts
|
|
2544
|
+
async function fetchManyWorkspaces(client, data = {}) {
|
|
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
|
+
);
|
|
2579
|
+
return response.data;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
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;
|
|
2599
|
+
const response = await client.projectInstance.get(`/workspaces/${workspaceId}/members`, { params });
|
|
2600
|
+
return response.data;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
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) {
|
|
2652
|
+
const { workspaceId, ...body } = data;
|
|
2653
|
+
const response = await client.projectInstance.post(
|
|
2654
|
+
`/workspaces/${workspaceId}/invites`,
|
|
2655
|
+
body
|
|
2656
|
+
);
|
|
2657
|
+
return response.data;
|
|
2658
|
+
}
|
|
2659
|
+
|
|
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) {
|
|
2691
|
+
const { inviteId } = data;
|
|
2692
|
+
const response = await client.projectInstance.post(
|
|
2693
|
+
`/workspace-invites/${inviteId}/accept`,
|
|
2694
|
+
{}
|
|
2695
|
+
);
|
|
2696
|
+
return response.data;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
// src/modules/workspaces/declineWorkspaceInvite.ts
|
|
2700
|
+
async function declineWorkspaceInvite(client, data) {
|
|
2701
|
+
const { inviteId } = data;
|
|
2702
|
+
const response = await client.projectInstance.post(
|
|
2703
|
+
`/workspace-invites/${inviteId}/decline`,
|
|
2704
|
+
{}
|
|
2705
|
+
);
|
|
2706
|
+
return response.data;
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
// src/modules/workspaces/fetchMyWorkspaceInvites.ts
|
|
2710
|
+
async function fetchMyWorkspaceInvites(client) {
|
|
2711
|
+
const response = await client.projectInstance.get(
|
|
2712
|
+
"/me/workspace-invites"
|
|
2713
|
+
);
|
|
2714
|
+
return response.data;
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
// src/modules/workspaces/fetchWorkspaceAuthority.ts
|
|
2718
|
+
async function fetchWorkspaceAuthority(client, data) {
|
|
2719
|
+
const { workspaceId } = data;
|
|
2720
|
+
const response = await client.projectInstance.get(
|
|
2721
|
+
`/workspaces/${workspaceId}/authority/me`
|
|
2722
|
+
);
|
|
2723
|
+
return response.data;
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2528
2726
|
// src/modules/tables/find.ts
|
|
2529
2727
|
async function find(client, tableName, query = {}) {
|
|
2530
2728
|
const { filters, includeDeleted, ...rest } = query;
|
|
@@ -2656,6 +2854,7 @@ var SublayClient = class _SublayClient {
|
|
|
2656
2854
|
oauth;
|
|
2657
2855
|
chat;
|
|
2658
2856
|
push;
|
|
2857
|
+
workspaces;
|
|
2659
2858
|
constructor(http) {
|
|
2660
2859
|
this.http = http;
|
|
2661
2860
|
this.auth = bindModule(auth_exports, this.http);
|
|
@@ -2674,6 +2873,7 @@ var SublayClient = class _SublayClient {
|
|
|
2674
2873
|
this.oauth = bindModule(oauth_exports, this.http);
|
|
2675
2874
|
this.chat = bindModule(chat_exports, this.http);
|
|
2676
2875
|
this.push = bindModule(push_exports, this.http);
|
|
2876
|
+
this.workspaces = bindModule(workspaces_exports, this.http);
|
|
2677
2877
|
}
|
|
2678
2878
|
static async init(config) {
|
|
2679
2879
|
const http = new SublayHttpClient(config);
|
|
@@ -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;
|
|
@@ -123,22 +123,6 @@ export interface CheckMyMembershipResponse {
|
|
|
123
123
|
}
|
|
124
124
|
export interface DeleteSpaceResponse {
|
|
125
125
|
message: string;
|
|
126
|
-
deletedSpace: {
|
|
127
|
-
id: string;
|
|
128
|
-
name: string;
|
|
129
|
-
};
|
|
130
|
-
counts: {
|
|
131
|
-
entities: number;
|
|
132
|
-
members: number;
|
|
133
|
-
childSpaces: number;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
export interface DigestConfig {
|
|
137
|
-
digestEnabled: boolean;
|
|
138
|
-
digestWebhookUrl: string | null;
|
|
139
|
-
digestWebhookSecret: string | null;
|
|
140
|
-
digestScheduleHour: number | null;
|
|
141
|
-
digestTimezone: string | null;
|
|
142
126
|
}
|
|
143
127
|
export interface SpaceBreadcrumb {
|
|
144
128
|
breadcrumb: SpacePreview[];
|