@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.d.mts
CHANGED
|
@@ -1607,7 +1607,10 @@ declare function fetchCommentByForeignId(client: SublayHttpClient, data: FetchCo
|
|
|
1607
1607
|
|
|
1608
1608
|
interface UpdateCommentProps {
|
|
1609
1609
|
commentId: string;
|
|
1610
|
-
content
|
|
1610
|
+
/** New text content. Cannot be empty. Omit to leave the content untouched. */
|
|
1611
|
+
content?: string;
|
|
1612
|
+
/** Replaces the comment's metadata wholesale (not merged). */
|
|
1613
|
+
metadata?: Record<string, any>;
|
|
1611
1614
|
}
|
|
1612
1615
|
declare function updateComment(client: SublayHttpClient, data: UpdateCommentProps): Promise<Comment>;
|
|
1613
1616
|
|
|
@@ -1749,6 +1752,12 @@ interface FetchUserSpacesProps {
|
|
|
1749
1752
|
include?: string;
|
|
1750
1753
|
role?: string;
|
|
1751
1754
|
all?: "true" | "false";
|
|
1755
|
+
/**
|
|
1756
|
+
* Membership status to list. Defaults to `"active"` (spaces the user is in);
|
|
1757
|
+
* `"pending"` returns join requests awaiting approval, `"banned"` the spaces
|
|
1758
|
+
* they were removed from.
|
|
1759
|
+
*/
|
|
1760
|
+
status?: "active" | "pending" | "banned";
|
|
1752
1761
|
}
|
|
1753
1762
|
declare function fetchUserSpaces(client: SublayHttpClient, data: FetchUserSpacesProps): Promise<UserSpacesResponse>;
|
|
1754
1763
|
|
|
@@ -2229,7 +2238,7 @@ declare function removeEntityFromCollection(client: SublayHttpClient, data: Remo
|
|
|
2229
2238
|
|
|
2230
2239
|
interface UpdateCollectionProps {
|
|
2231
2240
|
collectionId: string;
|
|
2232
|
-
name
|
|
2241
|
+
name: string;
|
|
2233
2242
|
}
|
|
2234
2243
|
declare function updateCollection(client: SublayHttpClient, data: UpdateCollectionProps): Promise<Collection>;
|
|
2235
2244
|
|
|
@@ -2612,7 +2621,13 @@ declare namespace AppNotifications {
|
|
|
2612
2621
|
export { AppNotifications_countUnreadNotifications as countUnreadNotifications, AppNotifications_fetchNotifications as fetchNotifications, AppNotifications_markAllNotificationsAsRead as markAllNotificationsAsRead, AppNotifications_markNotificationAsRead as markNotificationAsRead };
|
|
2613
2622
|
}
|
|
2614
2623
|
|
|
2615
|
-
type ReportTargetType = "entity" | "comment";
|
|
2624
|
+
type ReportTargetType = "entity" | "comment" | "message";
|
|
2625
|
+
/**
|
|
2626
|
+
* The reasons the API accepts on a report. Server-enforced — anything outside
|
|
2627
|
+
* this set is rejected with `report/invalid-body`. Use `other` plus `details`
|
|
2628
|
+
* for anything the taxonomy doesn't cover.
|
|
2629
|
+
*/
|
|
2630
|
+
type ReportReason = "spam" | "inappropriateContent" | "harassment" | "misinformation" | "hateSpeech" | "violence" | "illegalActivity" | "selfHarm" | "other";
|
|
2616
2631
|
type ReportStatus = "pending" | "on-hold" | "escalated" | "dismissed" | "actioned";
|
|
2617
2632
|
interface UserReport {
|
|
2618
2633
|
id: string;
|
|
@@ -2645,7 +2660,7 @@ interface CreateReportResponse {
|
|
|
2645
2660
|
interface CreateReportProps {
|
|
2646
2661
|
targetType: ReportTargetType;
|
|
2647
2662
|
targetId: string;
|
|
2648
|
-
reason:
|
|
2663
|
+
reason: ReportReason;
|
|
2649
2664
|
details?: string;
|
|
2650
2665
|
}
|
|
2651
2666
|
declare function createReport(client: SublayHttpClient, data: CreateReportProps): Promise<CreateReportResponse>;
|
|
@@ -3271,18 +3286,6 @@ interface MuteConversationResponse {
|
|
|
3271
3286
|
*/
|
|
3272
3287
|
declare function muteConversation(client: SublayHttpClient, data: MuteConversationProps): Promise<MuteConversationResponse>;
|
|
3273
3288
|
|
|
3274
|
-
interface ReportMessageProps {
|
|
3275
|
-
conversationId: string;
|
|
3276
|
-
messageId: string;
|
|
3277
|
-
reason: string;
|
|
3278
|
-
details?: string;
|
|
3279
|
-
}
|
|
3280
|
-
interface ReportMessageResponse {
|
|
3281
|
-
message: string;
|
|
3282
|
-
code: string;
|
|
3283
|
-
}
|
|
3284
|
-
declare function reportMessage(client: SublayHttpClient, data: ReportMessageProps): Promise<ReportMessageResponse>;
|
|
3285
|
-
|
|
3286
3289
|
declare const Chat_addMember: typeof addMember;
|
|
3287
3290
|
declare const Chat_changeMemberRole: typeof changeMemberRole;
|
|
3288
3291
|
declare const Chat_createDirectConversation: typeof createDirectConversation;
|
|
@@ -3301,12 +3304,11 @@ declare const Chat_listReactions: typeof listReactions;
|
|
|
3301
3304
|
declare const Chat_markAsRead: typeof markAsRead;
|
|
3302
3305
|
declare const Chat_muteConversation: typeof muteConversation;
|
|
3303
3306
|
declare const Chat_removeMember: typeof removeMember;
|
|
3304
|
-
declare const Chat_reportMessage: typeof reportMessage;
|
|
3305
3307
|
declare const Chat_sendMessage: typeof sendMessage;
|
|
3306
3308
|
declare const Chat_toggleReaction: typeof toggleReaction;
|
|
3307
3309
|
declare const Chat_updateConversation: typeof updateConversation;
|
|
3308
3310
|
declare namespace Chat {
|
|
3309
|
-
export { Chat_addMember as addMember, Chat_changeMemberRole as changeMemberRole, Chat_createDirectConversation as createDirectConversation, Chat_createGroupConversation as createGroupConversation, Chat_deleteConversation as deleteConversation, Chat_deleteMessage as deleteMessage, Chat_editMessage as editMessage, Chat_getConversation as getConversation, Chat_getMessage as getMessage, Chat_getUnreadCount as getUnreadCount, Chat_leaveConversation as leaveConversation, Chat_listConversations as listConversations, Chat_listMembers as listMembers, Chat_listMessages as listMessages, Chat_listReactions as listReactions, Chat_markAsRead as markAsRead, Chat_muteConversation as muteConversation, Chat_removeMember as removeMember,
|
|
3311
|
+
export { Chat_addMember as addMember, Chat_changeMemberRole as changeMemberRole, Chat_createDirectConversation as createDirectConversation, Chat_createGroupConversation as createGroupConversation, Chat_deleteConversation as deleteConversation, Chat_deleteMessage as deleteMessage, Chat_editMessage as editMessage, Chat_getConversation as getConversation, Chat_getMessage as getMessage, Chat_getUnreadCount as getUnreadCount, Chat_leaveConversation as leaveConversation, Chat_listConversations as listConversations, Chat_listMembers as listMembers, Chat_listMessages as listMessages, Chat_listReactions as listReactions, Chat_markAsRead as markAsRead, Chat_muteConversation as muteConversation, Chat_removeMember as removeMember, Chat_sendMessage as sendMessage, Chat_toggleReaction as toggleReaction, Chat_updateConversation as updateConversation };
|
|
3310
3312
|
}
|
|
3311
3313
|
|
|
3312
3314
|
/**
|
|
@@ -3352,6 +3354,13 @@ declare namespace Push {
|
|
|
3352
3354
|
type WorkspaceCapability = "view" | "invite" | "remove-member" | "edit-member-access" | "edit-member-profile" | "create-sub-workspace" | "edit-workspace";
|
|
3353
3355
|
type WorkspaceInvitationStatus = "pending" | "accepted" | "declined" | "revoked";
|
|
3354
3356
|
type WorkspaceAuthorityReason = "owner" | "ancestor-owner" | "member" | "reach-holder";
|
|
3357
|
+
type WorkspaceAuthorityReasonDetail = {
|
|
3358
|
+
type: "owner" | "member";
|
|
3359
|
+
viaWorkspaceId?: never;
|
|
3360
|
+
} | {
|
|
3361
|
+
type: "ancestor-owner" | "reach-holder";
|
|
3362
|
+
viaWorkspaceId: string;
|
|
3363
|
+
};
|
|
3355
3364
|
interface Workspace {
|
|
3356
3365
|
id: string;
|
|
3357
3366
|
name: string;
|
|
@@ -3364,6 +3373,18 @@ interface Workspace {
|
|
|
3364
3373
|
updatedAt: string;
|
|
3365
3374
|
memberCount?: number;
|
|
3366
3375
|
}
|
|
3376
|
+
interface WorkspaceMember {
|
|
3377
|
+
id: string;
|
|
3378
|
+
workspaceId: string;
|
|
3379
|
+
userId: string;
|
|
3380
|
+
capabilities: WorkspaceCapability[];
|
|
3381
|
+
permissions: string[];
|
|
3382
|
+
rank: number;
|
|
3383
|
+
title: string | null;
|
|
3384
|
+
metadata: Record<string, any>;
|
|
3385
|
+
joinedAt: string;
|
|
3386
|
+
createdAt: string;
|
|
3387
|
+
}
|
|
3367
3388
|
interface WorkspaceInvitation {
|
|
3368
3389
|
id: string;
|
|
3369
3390
|
workspaceId: string;
|
|
@@ -3408,12 +3429,66 @@ interface WorkspaceRosterCountsResponse {
|
|
|
3408
3429
|
total: number;
|
|
3409
3430
|
distinctUsers: number;
|
|
3410
3431
|
}
|
|
3432
|
+
/**
|
|
3433
|
+
* The `user` carried by a standing read. Normally the full user record, but the
|
|
3434
|
+
* server falls back to `{ id }` alone when the user row is gone (a deleted user
|
|
3435
|
+
* with a lingering membership row is a reachable case), so every field except
|
|
3436
|
+
* `id` may be absent.
|
|
3437
|
+
*/
|
|
3438
|
+
type WorkspaceStandingUser = Pick<User, "id"> & Partial<Omit<User, "id">>;
|
|
3439
|
+
interface WorkspaceMemberStanding {
|
|
3440
|
+
user: WorkspaceStandingUser;
|
|
3441
|
+
reasons: WorkspaceAuthorityReasonDetail[];
|
|
3442
|
+
capabilities?: WorkspaceCapability[];
|
|
3443
|
+
permissions?: string[];
|
|
3444
|
+
rank?: number | null;
|
|
3445
|
+
title: string | null;
|
|
3446
|
+
metadata: Record<string, any>;
|
|
3447
|
+
}
|
|
3411
3448
|
interface WorkspaceAuthority {
|
|
3412
|
-
reasons:
|
|
3449
|
+
reasons: WorkspaceAuthorityReasonDetail[];
|
|
3413
3450
|
capabilities: WorkspaceCapability[];
|
|
3414
3451
|
permissions: string[];
|
|
3415
3452
|
rank: number | null;
|
|
3416
3453
|
}
|
|
3454
|
+
/**
|
|
3455
|
+
* One descendant the subtree sweep did NOT clear, where the target user still
|
|
3456
|
+
* holds a direct membership.
|
|
3457
|
+
*
|
|
3458
|
+
* `id` / `name` are masked TOGETHER: an entry the acting user may see carries
|
|
3459
|
+
* both, and one they may not carries `null` for both — the sweep reports THAT a
|
|
3460
|
+
* membership survived without disclosing the existence or name of a sealed
|
|
3461
|
+
* sub-workspace the actor has no authority over (the same sealing fence the
|
|
3462
|
+
* descendant roster read applies). Modelled as a discriminated union so a
|
|
3463
|
+
* `null` check on `id` narrows `name` too.
|
|
3464
|
+
*/
|
|
3465
|
+
type SkippedWorkspace = {
|
|
3466
|
+
id: string;
|
|
3467
|
+
name: string;
|
|
3468
|
+
/** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */
|
|
3469
|
+
reason: "out-of-reach";
|
|
3470
|
+
} | {
|
|
3471
|
+
id: null;
|
|
3472
|
+
name: null;
|
|
3473
|
+
/** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */
|
|
3474
|
+
reason: "out-of-reach";
|
|
3475
|
+
};
|
|
3476
|
+
interface RemoveWorkspaceMemberFromSubtreeResponse {
|
|
3477
|
+
removedCount: number;
|
|
3478
|
+
removed: {
|
|
3479
|
+
workspaceId: string;
|
|
3480
|
+
userId: string;
|
|
3481
|
+
}[];
|
|
3482
|
+
/**
|
|
3483
|
+
* How many descendant memberships the target RETAINED because the sweep could
|
|
3484
|
+
* not reach them. Always `0` for an owner / ancestor-owner / privileged key.
|
|
3485
|
+
* A non-zero value means the offboarding is PARTIAL — never conclude a user is
|
|
3486
|
+
* fully removed from `removedCount` alone.
|
|
3487
|
+
*/
|
|
3488
|
+
skippedCount: number;
|
|
3489
|
+
/** One entry per retained membership; `skippedCount === skipped.length`. */
|
|
3490
|
+
skipped: SkippedWorkspace[];
|
|
3491
|
+
}
|
|
3417
3492
|
|
|
3418
3493
|
interface CreateWorkspaceProps {
|
|
3419
3494
|
name: string;
|
|
@@ -3443,7 +3518,57 @@ interface FetchManyWorkspacesProps {
|
|
|
3443
3518
|
*/
|
|
3444
3519
|
declare function fetchManyWorkspaces(client: SublayHttpClient, data?: FetchManyWorkspacesProps): Promise<PaginatedResponse<Workspace>>;
|
|
3445
3520
|
|
|
3446
|
-
interface
|
|
3521
|
+
interface UpdateWorkspaceProps {
|
|
3522
|
+
workspaceId: string;
|
|
3523
|
+
name?: string;
|
|
3524
|
+
metadata?: Record<string, any>;
|
|
3525
|
+
}
|
|
3526
|
+
/**
|
|
3527
|
+
* Edit a workspace's name / metadata. Requires the `edit-workspace` capability
|
|
3528
|
+
* (or ownership). The actor is the bearer-token user — no `userId` is sent.
|
|
3529
|
+
*/
|
|
3530
|
+
declare function updateWorkspace(client: SublayHttpClient, data: UpdateWorkspaceProps): Promise<Workspace>;
|
|
3531
|
+
|
|
3532
|
+
interface UpdateWorkspaceInheritFlagProps {
|
|
3533
|
+
workspaceId: string;
|
|
3534
|
+
inheritsFromParent: boolean;
|
|
3535
|
+
}
|
|
3536
|
+
/**
|
|
3537
|
+
* Flip whether capabilities held on an ancestor "reach" into this workspace.
|
|
3538
|
+
* Owner-only in both directions (own owner or an ancestor owner), and blocked
|
|
3539
|
+
* (403 `workspace/inherit-enforced`) when the project enforces its default.
|
|
3540
|
+
* The actor is the bearer-token user — no `userId` is sent.
|
|
3541
|
+
*/
|
|
3542
|
+
declare function updateWorkspaceInheritFlag(client: SublayHttpClient, data: UpdateWorkspaceInheritFlagProps): Promise<Workspace>;
|
|
3543
|
+
|
|
3544
|
+
interface DeleteWorkspaceProps {
|
|
3545
|
+
workspaceId: string;
|
|
3546
|
+
}
|
|
3547
|
+
interface DeleteWorkspaceResponse {
|
|
3548
|
+
message: string;
|
|
3549
|
+
}
|
|
3550
|
+
/**
|
|
3551
|
+
* Owner-only delete (own owner or an ancestor owner). Cascades the whole
|
|
3552
|
+
* subtree transactionally. The actor is the bearer-token user — no `userId`
|
|
3553
|
+
* body is sent.
|
|
3554
|
+
*/
|
|
3555
|
+
declare function deleteWorkspace(client: SublayHttpClient, data: DeleteWorkspaceProps): Promise<DeleteWorkspaceResponse>;
|
|
3556
|
+
|
|
3557
|
+
interface TransferWorkspaceOwnershipProps {
|
|
3558
|
+
workspaceId: string;
|
|
3559
|
+
newOwnerId: string;
|
|
3560
|
+
previousOwnerDisposition?: "demote" | "remove";
|
|
3561
|
+
previousOwnerRank?: number;
|
|
3562
|
+
previousOwnerCapabilities?: WorkspaceCapability[];
|
|
3563
|
+
}
|
|
3564
|
+
/**
|
|
3565
|
+
* Hand the workspace to a new owner. Owner-only (own owner or an ancestor
|
|
3566
|
+
* owner). The actor is the bearer-token user — no `userId` is sent;
|
|
3567
|
+
* `newOwnerId` addresses the TARGET, not the actor.
|
|
3568
|
+
*/
|
|
3569
|
+
declare function transferWorkspaceOwnership(client: SublayHttpClient, data: TransferWorkspaceOwnershipProps): Promise<Workspace>;
|
|
3570
|
+
|
|
3571
|
+
interface FetchWorkspaceMembersProps {
|
|
3447
3572
|
workspaceId: string;
|
|
3448
3573
|
include?: string;
|
|
3449
3574
|
countOnly?: boolean;
|
|
@@ -3453,9 +3578,73 @@ interface FetchMembersProps {
|
|
|
3453
3578
|
* array. Always returned in full (never paginated). With `countOnly=true` the
|
|
3454
3579
|
* shape is `WorkspaceRosterCountsResponse` instead. Actor from the token.
|
|
3455
3580
|
*/
|
|
3456
|
-
declare function
|
|
3581
|
+
declare function fetchWorkspaceMembers(client: SublayHttpClient, data: FetchWorkspaceMembersProps): Promise<WorkspaceRosterResponse | WorkspaceRosterCountsResponse>;
|
|
3582
|
+
|
|
3583
|
+
interface FetchWorkspaceMemberStandingProps {
|
|
3584
|
+
workspaceId: string;
|
|
3585
|
+
targetUserId: string;
|
|
3586
|
+
}
|
|
3587
|
+
/**
|
|
3588
|
+
* Read one user's resolved standing on a workspace (`reasons`, `capabilities`,
|
|
3589
|
+
* `permissions`, `rank`, `title`, `metadata`).
|
|
3590
|
+
*/
|
|
3591
|
+
declare function fetchWorkspaceMemberStanding(client: SublayHttpClient, data: FetchWorkspaceMemberStandingProps): Promise<WorkspaceMemberStanding>;
|
|
3457
3592
|
|
|
3458
|
-
interface
|
|
3593
|
+
interface UpdateWorkspaceMemberProps {
|
|
3594
|
+
workspaceId: string;
|
|
3595
|
+
targetUserId: string;
|
|
3596
|
+
capabilities?: WorkspaceCapability[];
|
|
3597
|
+
permissions?: string[];
|
|
3598
|
+
rank?: number;
|
|
3599
|
+
title?: string | null;
|
|
3600
|
+
metadata?: Record<string, any>;
|
|
3601
|
+
}
|
|
3602
|
+
/**
|
|
3603
|
+
* Edit a member's grant / profile. Powerful fields need `edit-member-access`
|
|
3604
|
+
* plus rank + no-escalation rules; cosmetic fields need only
|
|
3605
|
+
* `edit-member-profile`. No `userId` is sent — the actor comes from the token.
|
|
3606
|
+
*/
|
|
3607
|
+
declare function updateWorkspaceMember(client: SublayHttpClient, data: UpdateWorkspaceMemberProps): Promise<WorkspaceMember>;
|
|
3608
|
+
|
|
3609
|
+
interface RemoveWorkspaceMemberProps {
|
|
3610
|
+
workspaceId: string;
|
|
3611
|
+
targetUserId: string;
|
|
3612
|
+
}
|
|
3613
|
+
/**
|
|
3614
|
+
* Remove a member from this workspace. Requires the `remove-member` capability
|
|
3615
|
+
* and is rank-bounded. The workspace owner cannot be removed (409
|
|
3616
|
+
* `workspace/sole-owner`) — transfer ownership first. No `userId` body is sent;
|
|
3617
|
+
* the actor comes from the token.
|
|
3618
|
+
*/
|
|
3619
|
+
declare function removeWorkspaceMember(client: SublayHttpClient, data: RemoveWorkspaceMemberProps): Promise<void>;
|
|
3620
|
+
|
|
3621
|
+
interface LeaveWorkspaceProps {
|
|
3622
|
+
workspaceId: string;
|
|
3623
|
+
}
|
|
3624
|
+
/**
|
|
3625
|
+
* The bearer-token user leaves this workspace — removes THEIR OWN direct
|
|
3626
|
+
* membership on THIS node only (owning a child is unaffected). An owner cannot
|
|
3627
|
+
* leave (409 `workspace/sole-owner`); transfer or delete first. No `userId` is
|
|
3628
|
+
* sent — the server derives the leaver from the token.
|
|
3629
|
+
*/
|
|
3630
|
+
declare function leaveWorkspace(client: SublayHttpClient, data: LeaveWorkspaceProps): Promise<void>;
|
|
3631
|
+
|
|
3632
|
+
interface RemoveWorkspaceMemberFromSubtreeProps {
|
|
3633
|
+
workspaceId: string;
|
|
3634
|
+
targetUserId: string;
|
|
3635
|
+
}
|
|
3636
|
+
/**
|
|
3637
|
+
* Removes the target user's direct memberships on this workspace and every
|
|
3638
|
+
* descendant. Requires `remove-member` (rank-bounded per node). Blocks (409
|
|
3639
|
+
* `workspace/owns-descendants`) with a report if the user OWNS any descendant
|
|
3640
|
+
* workspace — transfer or delete those first. The actor comes from the token.
|
|
3641
|
+
*
|
|
3642
|
+
* A NON-owner's sweep can be PARTIAL: it stops at sealed sub-workspaces. Check
|
|
3643
|
+
* `skippedCount` / `skipped` before treating the user as fully offboarded.
|
|
3644
|
+
*/
|
|
3645
|
+
declare function removeWorkspaceMemberFromSubtree(client: SublayHttpClient, data: RemoveWorkspaceMemberFromSubtreeProps): Promise<RemoveWorkspaceMemberFromSubtreeResponse>;
|
|
3646
|
+
|
|
3647
|
+
interface CreateWorkspaceInviteProps {
|
|
3459
3648
|
workspaceId: string;
|
|
3460
3649
|
email?: string;
|
|
3461
3650
|
userId?: string;
|
|
@@ -3469,12 +3658,52 @@ interface CreateInviteProps {
|
|
|
3469
3658
|
* Create an invitation (requires the `invite` capability on the workspace). The
|
|
3470
3659
|
* inviter is the bearer-token user.
|
|
3471
3660
|
*/
|
|
3472
|
-
declare function
|
|
3661
|
+
declare function createWorkspaceInvite(client: SublayHttpClient, data: CreateWorkspaceInviteProps): Promise<WorkspaceInvitation>;
|
|
3662
|
+
|
|
3663
|
+
interface FetchWorkspaceInvitesProps {
|
|
3664
|
+
workspaceId: string;
|
|
3665
|
+
}
|
|
3666
|
+
interface FetchWorkspaceInvitesResponse {
|
|
3667
|
+
data: WorkspaceInvitation[];
|
|
3668
|
+
}
|
|
3669
|
+
/**
|
|
3670
|
+
* List a workspace's LIVE pending invites (`status='pending' AND expiresAt >
|
|
3671
|
+
* now`). Requires the `invite` capability (or owner). Always returned in full —
|
|
3672
|
+
* this list is deliberately unpaginated.
|
|
3673
|
+
*
|
|
3674
|
+
* This is the OUTBOX read — invites this workspace ISSUED. For the invites
|
|
3675
|
+
* addressed TO the caller, use `fetchMyWorkspaceInvites`.
|
|
3676
|
+
*/
|
|
3677
|
+
declare function fetchWorkspaceInvites(client: SublayHttpClient, data: FetchWorkspaceInvitesProps): Promise<FetchWorkspaceInvitesResponse>;
|
|
3678
|
+
|
|
3679
|
+
interface RevokeWorkspaceInviteProps {
|
|
3680
|
+
workspaceId: string;
|
|
3681
|
+
inviteId: string;
|
|
3682
|
+
}
|
|
3683
|
+
interface RevokeWorkspaceInviteResponse {
|
|
3684
|
+
success: boolean;
|
|
3685
|
+
}
|
|
3686
|
+
/**
|
|
3687
|
+
* Revoke a pending invitation. Requires the `invite` capability (or owner).
|
|
3688
|
+
* Note the verb-suffixed POST route — this is not a `DELETE`.
|
|
3689
|
+
*/
|
|
3690
|
+
declare function revokeWorkspaceInvite(client: SublayHttpClient, data: RevokeWorkspaceInviteProps): Promise<RevokeWorkspaceInviteResponse>;
|
|
3691
|
+
|
|
3692
|
+
interface ResendWorkspaceInviteProps {
|
|
3693
|
+
workspaceId: string;
|
|
3694
|
+
inviteId: string;
|
|
3695
|
+
}
|
|
3696
|
+
/**
|
|
3697
|
+
* Resend / refresh a pending invitation (valid on any `pending` invite, even one
|
|
3698
|
+
* past `expiresAt` — resets a 14-day expiry and resends the email). A terminal
|
|
3699
|
+
* invite (accepted/declined/revoked) → 409. Requires `invite` (or owner).
|
|
3700
|
+
*/
|
|
3701
|
+
declare function resendWorkspaceInvite(client: SublayHttpClient, data: ResendWorkspaceInviteProps): Promise<WorkspaceInvitation>;
|
|
3473
3702
|
|
|
3474
|
-
interface
|
|
3703
|
+
interface AcceptWorkspaceInviteProps {
|
|
3475
3704
|
inviteId: string;
|
|
3476
3705
|
}
|
|
3477
|
-
interface
|
|
3706
|
+
interface AcceptWorkspaceInviteResponse {
|
|
3478
3707
|
success: boolean;
|
|
3479
3708
|
workspaceId: string;
|
|
3480
3709
|
}
|
|
@@ -3482,31 +3711,37 @@ interface AcceptInviteResponse {
|
|
|
3482
3711
|
* Accept an invitation — identity-matched to the bearer-token user + verified
|
|
3483
3712
|
* email required. Non-secret id. Idempotent when already a member/owner.
|
|
3484
3713
|
*/
|
|
3485
|
-
declare function
|
|
3714
|
+
declare function acceptWorkspaceInvite(client: SublayHttpClient, data: AcceptWorkspaceInviteProps): Promise<AcceptWorkspaceInviteResponse>;
|
|
3486
3715
|
|
|
3487
|
-
interface
|
|
3716
|
+
interface DeclineWorkspaceInviteProps {
|
|
3488
3717
|
inviteId: string;
|
|
3489
3718
|
}
|
|
3490
|
-
interface
|
|
3719
|
+
interface DeclineWorkspaceInviteResponse {
|
|
3491
3720
|
success: boolean;
|
|
3492
3721
|
}
|
|
3493
3722
|
/**
|
|
3494
|
-
* Decline an invitation — identity-matched to the bearer-token user
|
|
3495
|
-
*
|
|
3723
|
+
* Decline an invitation — identity-matched to the bearer-token user, and
|
|
3724
|
+
* verified-email-gated (the same gate as accept, so an unverified squatter on
|
|
3725
|
+
* someone else's address cannot burn their invite). An unverified decline
|
|
3726
|
+
* returns `403 workspace/email-not-verified`.
|
|
3496
3727
|
*/
|
|
3497
|
-
declare function
|
|
3728
|
+
declare function declineWorkspaceInvite(client: SublayHttpClient, data: DeclineWorkspaceInviteProps): Promise<DeclineWorkspaceInviteResponse>;
|
|
3498
3729
|
|
|
3499
|
-
interface
|
|
3730
|
+
interface FetchMyWorkspaceInvitesResponse {
|
|
3500
3731
|
data: WorkspaceInvitation[];
|
|
3501
3732
|
}
|
|
3502
3733
|
/**
|
|
3503
3734
|
* The bearer-token user's LIVE pending invites (`status='pending' AND expiresAt
|
|
3504
3735
|
* > now`), matched by `userId` from the token. Surfacing is NOT
|
|
3505
|
-
* verification-gated (the verified check applies
|
|
3736
|
+
* verification-gated (the verified check applies when the user ACTS on an
|
|
3737
|
+
* invite — accept or decline).
|
|
3738
|
+
*
|
|
3739
|
+
* This is the INBOX read — invites addressed TO the caller. For the invites a
|
|
3740
|
+
* workspace has ISSUED, use `fetchWorkspaceInvites`.
|
|
3506
3741
|
*/
|
|
3507
|
-
declare function
|
|
3742
|
+
declare function fetchMyWorkspaceInvites(client: SublayHttpClient): Promise<FetchMyWorkspaceInvitesResponse>;
|
|
3508
3743
|
|
|
3509
|
-
interface
|
|
3744
|
+
interface FetchWorkspaceAuthorityProps {
|
|
3510
3745
|
workspaceId: string;
|
|
3511
3746
|
}
|
|
3512
3747
|
/**
|
|
@@ -3514,19 +3749,31 @@ interface GetAuthorityProps {
|
|
|
3514
3749
|
* (`{ reasons, capabilities, permissions, rank }`) on the workspace. A
|
|
3515
3750
|
* permission check is a one-line `.includes()` on the result.
|
|
3516
3751
|
*/
|
|
3517
|
-
declare function
|
|
3752
|
+
declare function fetchWorkspaceAuthority(client: SublayHttpClient, data: FetchWorkspaceAuthorityProps): Promise<WorkspaceAuthority>;
|
|
3518
3753
|
|
|
3519
|
-
declare const
|
|
3520
|
-
declare const Workspaces_createInvite: typeof createInvite;
|
|
3754
|
+
declare const Workspaces_acceptWorkspaceInvite: typeof acceptWorkspaceInvite;
|
|
3521
3755
|
declare const Workspaces_createWorkspace: typeof createWorkspace;
|
|
3522
|
-
declare const
|
|
3756
|
+
declare const Workspaces_createWorkspaceInvite: typeof createWorkspaceInvite;
|
|
3757
|
+
declare const Workspaces_declineWorkspaceInvite: typeof declineWorkspaceInvite;
|
|
3758
|
+
declare const Workspaces_deleteWorkspace: typeof deleteWorkspace;
|
|
3523
3759
|
declare const Workspaces_fetchManyWorkspaces: typeof fetchManyWorkspaces;
|
|
3524
|
-
declare const
|
|
3525
|
-
declare const Workspaces_fetchMyInvites: typeof fetchMyInvites;
|
|
3760
|
+
declare const Workspaces_fetchMyWorkspaceInvites: typeof fetchMyWorkspaceInvites;
|
|
3526
3761
|
declare const Workspaces_fetchWorkspace: typeof fetchWorkspace;
|
|
3527
|
-
declare const
|
|
3762
|
+
declare const Workspaces_fetchWorkspaceAuthority: typeof fetchWorkspaceAuthority;
|
|
3763
|
+
declare const Workspaces_fetchWorkspaceInvites: typeof fetchWorkspaceInvites;
|
|
3764
|
+
declare const Workspaces_fetchWorkspaceMemberStanding: typeof fetchWorkspaceMemberStanding;
|
|
3765
|
+
declare const Workspaces_fetchWorkspaceMembers: typeof fetchWorkspaceMembers;
|
|
3766
|
+
declare const Workspaces_leaveWorkspace: typeof leaveWorkspace;
|
|
3767
|
+
declare const Workspaces_removeWorkspaceMember: typeof removeWorkspaceMember;
|
|
3768
|
+
declare const Workspaces_removeWorkspaceMemberFromSubtree: typeof removeWorkspaceMemberFromSubtree;
|
|
3769
|
+
declare const Workspaces_resendWorkspaceInvite: typeof resendWorkspaceInvite;
|
|
3770
|
+
declare const Workspaces_revokeWorkspaceInvite: typeof revokeWorkspaceInvite;
|
|
3771
|
+
declare const Workspaces_transferWorkspaceOwnership: typeof transferWorkspaceOwnership;
|
|
3772
|
+
declare const Workspaces_updateWorkspace: typeof updateWorkspace;
|
|
3773
|
+
declare const Workspaces_updateWorkspaceInheritFlag: typeof updateWorkspaceInheritFlag;
|
|
3774
|
+
declare const Workspaces_updateWorkspaceMember: typeof updateWorkspaceMember;
|
|
3528
3775
|
declare namespace Workspaces {
|
|
3529
|
-
export {
|
|
3776
|
+
export { Workspaces_acceptWorkspaceInvite as acceptWorkspaceInvite, Workspaces_createWorkspace as createWorkspace, Workspaces_createWorkspaceInvite as createWorkspaceInvite, Workspaces_declineWorkspaceInvite as declineWorkspaceInvite, Workspaces_deleteWorkspace as deleteWorkspace, Workspaces_fetchManyWorkspaces as fetchManyWorkspaces, Workspaces_fetchMyWorkspaceInvites as fetchMyWorkspaceInvites, Workspaces_fetchWorkspace as fetchWorkspace, Workspaces_fetchWorkspaceAuthority as fetchWorkspaceAuthority, Workspaces_fetchWorkspaceInvites as fetchWorkspaceInvites, Workspaces_fetchWorkspaceMemberStanding as fetchWorkspaceMemberStanding, Workspaces_fetchWorkspaceMembers as fetchWorkspaceMembers, Workspaces_leaveWorkspace as leaveWorkspace, Workspaces_removeWorkspaceMember as removeWorkspaceMember, Workspaces_removeWorkspaceMemberFromSubtree as removeWorkspaceMemberFromSubtree, Workspaces_resendWorkspaceInvite as resendWorkspaceInvite, Workspaces_revokeWorkspaceInvite as revokeWorkspaceInvite, Workspaces_transferWorkspaceOwnership as transferWorkspaceOwnership, Workspaces_updateWorkspace as updateWorkspace, Workspaces_updateWorkspaceInheritFlag as updateWorkspaceInheritFlag, Workspaces_updateWorkspaceMember as updateWorkspaceMember };
|
|
3530
3777
|
}
|
|
3531
3778
|
|
|
3532
3779
|
/**
|
|
@@ -3626,4 +3873,4 @@ declare class SublayClient {
|
|
|
3626
3873
|
clearTokens(): void;
|
|
3627
3874
|
}
|
|
3628
3875
|
|
|
3629
|
-
export { type AuthTokens, type BulkDeleteProps, type BulkDeleteResult, type ClientConfig, type DbFilter, type DbFilterOperator, type DeleteResult, MUTE_DURATIONS, type MuteConversationProps, type MuteConversationResponse, type MuteDuration, type NotificationPreferences, PUSH_EVENT_TYPES, type PaginatedResponse, type PaginationMetadata, type PushEventType, type SpaceReputationContextParams, type SpaceReputationUserParams, SublayClient, type TableAccessor, type TableQuery, type TableRow, type UpdateNotificationPreferencesProps, type UserSearchParams, type Workspace, type WorkspaceAuthority, type WorkspaceAuthorityReason, type WorkspaceCapability, type WorkspaceInvitation, type WorkspaceInvitationStatus, type WorkspaceRosterCountsResponse, type WorkspaceRosterEntry, type WorkspaceRosterReason, type WorkspaceRosterResponse };
|
|
3876
|
+
export { type AuthTokens, type BulkDeleteProps, type BulkDeleteResult, type ClientConfig, type DbFilter, type DbFilterOperator, type DeleteResult, MUTE_DURATIONS, type MuteConversationProps, type MuteConversationResponse, type MuteDuration, type NotificationPreferences, PUSH_EVENT_TYPES, type PaginatedResponse, type PaginationMetadata, type PushEventType, type RemoveWorkspaceMemberFromSubtreeResponse, type SkippedWorkspace, type SpaceReputationContextParams, type SpaceReputationUserParams, SublayClient, type TableAccessor, type TableQuery, type TableRow, type UpdateNotificationPreferencesProps, type UserSearchParams, type Workspace, type WorkspaceAuthority, type WorkspaceAuthorityReason, type WorkspaceAuthorityReasonDetail, type WorkspaceCapability, type WorkspaceInvitation, type WorkspaceInvitationStatus, type WorkspaceMember, type WorkspaceMemberStanding, type WorkspaceRosterCountsResponse, type WorkspaceRosterEntry, type WorkspaceRosterReason, type WorkspaceRosterResponse, type WorkspaceStandingUser };
|
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export type { ClientConfig, AuthTokens } from "./core/client";
|
|
|
56
56
|
export type { PaginatedResponse, PaginationMetadata, } from "./interfaces/IPaginatedResponse";
|
|
57
57
|
export type { SpaceReputationContextParams, SpaceReputationUserParams, } from "./interfaces/SpaceReputation";
|
|
58
58
|
export type { UserSearchParams } from "./interfaces/UserSearch";
|
|
59
|
-
export type { Workspace, WorkspaceInvitation, WorkspaceCapability, WorkspaceInvitationStatus, WorkspaceAuthorityReason, WorkspaceRosterReason, WorkspaceRosterEntry, WorkspaceRosterResponse, WorkspaceRosterCountsResponse, WorkspaceAuthority, } from "./interfaces/Workspace";
|
|
59
|
+
export type { Workspace, WorkspaceMember, WorkspaceInvitation, WorkspaceCapability, WorkspaceInvitationStatus, WorkspaceAuthorityReason, WorkspaceAuthorityReasonDetail, WorkspaceRosterReason, WorkspaceRosterEntry, WorkspaceRosterResponse, WorkspaceRosterCountsResponse, WorkspaceStandingUser, WorkspaceMemberStanding, WorkspaceAuthority, RemoveWorkspaceMemberFromSubtreeResponse, SkippedWorkspace, } from "./interfaces/Workspace";
|
|
60
60
|
export { PUSH_EVENT_TYPES, MUTE_DURATIONS } from "./interfaces/Push";
|
|
61
61
|
export type { PushEventType, MuteDuration, NotificationPreferences, } from "./interfaces/Push";
|
|
62
62
|
export type { UpdateNotificationPreferencesProps } from "./modules/push/updateNotificationPreferences";
|