@sublay/js 7.8.0 → 7.9.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/LICENSE +202 -0
- package/NOTICE +9 -0
- package/README.md +23 -14
- package/dist/index.d.mts +374 -21
- package/dist/index.d.ts +4364 -31
- package/dist/index.js +53 -19
- package/dist/index.mjs +53 -19
- package/package.json +29 -18
- package/dist/core/client.d.ts +0 -64
- package/dist/core/multipart.d.ts +0 -22
- package/dist/core/spaceReputationParams.d.ts +0 -57
- package/dist/interfaces/AppNotification.d.ts +0 -258
- package/dist/interfaces/ChatMessage.d.ts +0 -32
- package/dist/interfaces/Collection.d.ts +0 -10
- package/dist/interfaces/Comment.d.ts +0 -42
- package/dist/interfaces/Connection.d.ts +0 -67
- package/dist/interfaces/Conversation.d.ts +0 -27
- package/dist/interfaces/ConversationMember.d.ts +0 -17
- package/dist/interfaces/Entity.d.ts +0 -55
- package/dist/interfaces/Event.d.ts +0 -66
- package/dist/interfaces/File.d.ts +0 -39
- package/dist/interfaces/Follow.d.ts +0 -19
- package/dist/interfaces/HostedApp.d.ts +0 -11
- package/dist/interfaces/IPaginatedResponse.d.ts +0 -11
- package/dist/interfaces/ImageProcessing.d.ts +0 -62
- package/dist/interfaces/Mention.d.ts +0 -12
- package/dist/interfaces/OAuthIdentity.d.ts +0 -14
- package/dist/interfaces/Project.d.ts +0 -14
- package/dist/interfaces/Push.d.ts +0 -74
- package/dist/interfaces/Reaction.d.ts +0 -23
- package/dist/interfaces/Report.d.ts +0 -38
- package/dist/interfaces/Rule.d.ts +0 -22
- package/dist/interfaces/Space.d.ts +0 -130
- package/dist/interfaces/SpaceMember.d.ts +0 -29
- package/dist/interfaces/SpaceReputation.d.ts +0 -100
- package/dist/interfaces/Table.d.ts +0 -63
- package/dist/interfaces/User.d.ts +0 -46
- package/dist/interfaces/UserSearch.d.ts +0 -13
- package/dist/interfaces/Workspace.d.ts +0 -148
- package/dist/modules/app-notifications/countUnreadNotifications.d.ts +0 -2
- package/dist/modules/app-notifications/fetchNotifications.d.ts +0 -8
- package/dist/modules/app-notifications/index.d.ts +0 -4
- package/dist/modules/app-notifications/markAllNotificationsAsRead.d.ts +0 -5
- package/dist/modules/app-notifications/markNotificationAsRead.d.ts +0 -5
- package/dist/modules/auth/changePassword.d.ts +0 -34
- package/dist/modules/auth/confirmAccountDeletion.d.ts +0 -11
- package/dist/modules/auth/index.d.ts +0 -13
- package/dist/modules/auth/requestAccountDeletion.d.ts +0 -14
- package/dist/modules/auth/requestNewAccessToken.d.ts +0 -16
- package/dist/modules/auth/requestPasswordReset.d.ts +0 -5
- package/dist/modules/auth/resetPassword.d.ts +0 -6
- package/dist/modules/auth/sendVerificationEmail.d.ts +0 -13
- package/dist/modules/auth/setPassword.d.ts +0 -9
- package/dist/modules/auth/signIn.d.ts +0 -12
- package/dist/modules/auth/signOut.d.ts +0 -103
- package/dist/modules/auth/signUp.d.ts +0 -24
- package/dist/modules/auth/verifyEmail.d.ts +0 -5
- package/dist/modules/auth/verifyExternalUser.d.ts +0 -11
- package/dist/modules/chat/addMember.d.ts +0 -8
- package/dist/modules/chat/changeMemberRole.d.ts +0 -9
- package/dist/modules/chat/createDirectConversation.d.ts +0 -7
- package/dist/modules/chat/createGroupConversation.d.ts +0 -10
- package/dist/modules/chat/deleteConversation.d.ts +0 -8
- package/dist/modules/chat/deleteMessage.d.ts +0 -11
- package/dist/modules/chat/editMessage.d.ts +0 -14
- package/dist/modules/chat/getConversation.d.ts +0 -6
- package/dist/modules/chat/getMessage.d.ts +0 -8
- package/dist/modules/chat/getUnreadCount.d.ts +0 -6
- package/dist/modules/chat/index.d.ts +0 -21
- package/dist/modules/chat/leaveConversation.d.ts +0 -7
- package/dist/modules/chat/listConversations.d.ts +0 -17
- package/dist/modules/chat/listMembers.d.ts +0 -11
- package/dist/modules/chat/listMessages.d.ts +0 -40
- package/dist/modules/chat/listReactions.d.ts +0 -24
- package/dist/modules/chat/markAsRead.d.ts +0 -9
- package/dist/modules/chat/muteConversation.d.ts +0 -23
- package/dist/modules/chat/removeMember.d.ts +0 -9
- package/dist/modules/chat/reportMessage.d.ts +0 -12
- package/dist/modules/chat/sendMessage.d.ts +0 -22
- package/dist/modules/chat/toggleReaction.d.ts +0 -16
- package/dist/modules/chat/updateConversation.d.ts +0 -12
- package/dist/modules/collections/addEntityToCollection.d.ts +0 -13
- package/dist/modules/collections/createNewCollection.d.ts +0 -8
- package/dist/modules/collections/deleteCollection.d.ts +0 -5
- package/dist/modules/collections/fetchCollectionEntities.d.ts +0 -13
- package/dist/modules/collections/fetchRootCollection.d.ts +0 -3
- package/dist/modules/collections/fetchSubCollections.d.ts +0 -6
- package/dist/modules/collections/index.d.ts +0 -8
- package/dist/modules/collections/removeEntityFromCollection.d.ts +0 -7
- package/dist/modules/collections/updateCollection.d.ts +0 -7
- package/dist/modules/comments/addReaction.d.ts +0 -8
- package/dist/modules/comments/createComment.d.ts +0 -15
- package/dist/modules/comments/deleteComment.d.ts +0 -5
- package/dist/modules/comments/fetchComment.d.ts +0 -8
- package/dist/modules/comments/fetchCommentByForeignId.d.ts +0 -7
- package/dist/modules/comments/fetchManyComments.d.ts +0 -26
- package/dist/modules/comments/fetchReactions.d.ts +0 -16
- package/dist/modules/comments/getUserReaction.d.ts +0 -9
- package/dist/modules/comments/index.d.ts +0 -10
- package/dist/modules/comments/removeReaction.d.ts +0 -6
- package/dist/modules/comments/updateComment.d.ts +0 -10
- package/dist/modules/connections/acceptConnection.d.ts +0 -6
- package/dist/modules/connections/declineConnection.d.ts +0 -6
- package/dist/modules/connections/fetchConnections.d.ts +0 -9
- package/dist/modules/connections/fetchConnectionsCount.d.ts +0 -3
- package/dist/modules/connections/fetchReceivedPendingConnections.d.ts +0 -8
- package/dist/modules/connections/fetchSentPendingConnections.d.ts +0 -8
- package/dist/modules/connections/index.d.ts +0 -7
- package/dist/modules/connections/removeConnection.d.ts +0 -5
- package/dist/modules/entities/addReaction.d.ts +0 -8
- package/dist/modules/entities/createEntity.d.ts +0 -23
- package/dist/modules/entities/deleteEntity.d.ts +0 -5
- package/dist/modules/entities/fetchDrafts.d.ts +0 -11
- package/dist/modules/entities/fetchEntity.d.ts +0 -8
- package/dist/modules/entities/fetchEntityByForeignId.d.ts +0 -8
- package/dist/modules/entities/fetchEntityByShortId.d.ts +0 -7
- package/dist/modules/entities/fetchManyEntities.d.ts +0 -65
- package/dist/modules/entities/fetchReactions.d.ts +0 -16
- package/dist/modules/entities/fetchTopComment.d.ts +0 -6
- package/dist/modules/entities/getUserReaction.d.ts +0 -9
- package/dist/modules/entities/index.d.ts +0 -15
- package/dist/modules/entities/isEntitySaved.d.ts +0 -12
- package/dist/modules/entities/publishDraft.d.ts +0 -6
- package/dist/modules/entities/removeReaction.d.ts +0 -6
- package/dist/modules/entities/updateEntity.d.ts +0 -18
- package/dist/modules/events/addHost.d.ts +0 -8
- package/dist/modules/events/addInvite.d.ts +0 -8
- package/dist/modules/events/cancelEvent.d.ts +0 -6
- package/dist/modules/events/createEvent.d.ts +0 -49
- package/dist/modules/events/deleteEvent.d.ts +0 -5
- package/dist/modules/events/fetchEvent.d.ts +0 -8
- package/dist/modules/events/fetchEventRsvps.d.ts +0 -19
- package/dist/modules/events/fetchInvitees.d.ts +0 -12
- package/dist/modules/events/fetchManyEvents.d.ts +0 -42
- package/dist/modules/events/index.d.ts +0 -14
- package/dist/modules/events/removeHost.d.ts +0 -8
- package/dist/modules/events/removeInvite.d.ts +0 -8
- package/dist/modules/events/setRsvp.d.ts +0 -7
- package/dist/modules/events/updateEvent.d.ts +0 -43
- package/dist/modules/events/withdrawRsvp.d.ts +0 -6
- package/dist/modules/follows/deleteFollow.d.ts +0 -5
- package/dist/modules/follows/fetchFollowers.d.ts +0 -9
- package/dist/modules/follows/fetchFollowersCount.d.ts +0 -5
- package/dist/modules/follows/fetchFollowing.d.ts +0 -9
- package/dist/modules/follows/fetchFollowingCount.d.ts +0 -5
- package/dist/modules/follows/index.d.ts +0 -5
- package/dist/modules/oauth/authorize.d.ts +0 -25
- package/dist/modules/oauth/index.d.ts +0 -4
- package/dist/modules/oauth/linkIdentity.d.ts +0 -14
- package/dist/modules/oauth/listIdentities.d.ts +0 -4
- package/dist/modules/oauth/unlinkIdentity.d.ts +0 -12
- package/dist/modules/push/getNotificationPreferences.d.ts +0 -11
- package/dist/modules/push/index.d.ts +0 -2
- package/dist/modules/push/updateNotificationPreferences.d.ts +0 -16
- package/dist/modules/reports/createReport.d.ts +0 -9
- package/dist/modules/reports/fetchModeratedReports.d.ts +0 -13
- package/dist/modules/reports/index.d.ts +0 -2
- package/dist/modules/search/askContent.d.ts +0 -58
- package/dist/modules/search/index.d.ts +0 -5
- package/dist/modules/search/matchUsers.d.ts +0 -36
- package/dist/modules/search/searchContent.d.ts +0 -24
- package/dist/modules/search/searchSpaces.d.ts +0 -11
- package/dist/modules/search/searchUsers.d.ts +0 -11
- package/dist/modules/spaces/approveMembership.d.ts +0 -7
- package/dist/modules/spaces/banMember.d.ts +0 -13
- package/dist/modules/spaces/checkMyMembership.d.ts +0 -6
- package/dist/modules/spaces/checkSlugAvailability.d.ts +0 -8
- package/dist/modules/spaces/createRule.d.ts +0 -8
- package/dist/modules/spaces/createSpace.d.ts +0 -29
- package/dist/modules/spaces/declineMembership.d.ts +0 -7
- package/dist/modules/spaces/deleteRule.d.ts +0 -7
- package/dist/modules/spaces/deleteSpace.d.ts +0 -6
- package/dist/modules/spaces/fetchChildSpaces.d.ts +0 -11
- package/dist/modules/spaces/fetchDigestConfig.d.ts +0 -6
- package/dist/modules/spaces/fetchManyRules.d.ts +0 -6
- package/dist/modules/spaces/fetchManySpaces.d.ts +0 -17
- package/dist/modules/spaces/fetchMutualSpaces.d.ts +0 -11
- package/dist/modules/spaces/fetchRule.d.ts +0 -7
- package/dist/modules/spaces/fetchSpace.d.ts +0 -6
- package/dist/modules/spaces/fetchSpaceBreadcrumb.d.ts +0 -6
- package/dist/modules/spaces/fetchSpaceByShortId.d.ts +0 -6
- package/dist/modules/spaces/fetchSpaceBySlug.d.ts +0 -6
- package/dist/modules/spaces/fetchSpaceMembers.d.ts +0 -11
- package/dist/modules/spaces/fetchSpaceTeam.d.ts +0 -7
- package/dist/modules/spaces/fetchUserSpaces.d.ts +0 -17
- package/dist/modules/spaces/getSpaceConversation.d.ts +0 -6
- package/dist/modules/spaces/handleCommentReport.d.ts +0 -14
- package/dist/modules/spaces/handleEntityReport.d.ts +0 -17
- package/dist/modules/spaces/handleSpaceChatReport.d.ts +0 -18
- package/dist/modules/spaces/index.d.ts +0 -36
- package/dist/modules/spaces/joinSpace.d.ts +0 -6
- package/dist/modules/spaces/leaveSpace.d.ts +0 -6
- package/dist/modules/spaces/moderateSpaceChatMessage.d.ts +0 -12
- package/dist/modules/spaces/moderateSpaceComment.d.ts +0 -9
- package/dist/modules/spaces/moderateSpaceEntity.d.ts +0 -12
- package/dist/modules/spaces/reorderRules.d.ts +0 -7
- package/dist/modules/spaces/setSpaceEntityNsfw.d.ts +0 -16
- package/dist/modules/spaces/unbanMember.d.ts +0 -13
- package/dist/modules/spaces/updateDigestConfig.d.ts +0 -11
- package/dist/modules/spaces/updateMemberRole.d.ts +0 -8
- package/dist/modules/spaces/updateRule.d.ts +0 -9
- package/dist/modules/spaces/updateSpace.d.ts +0 -22
- package/dist/modules/storage/deleteFile.d.ts +0 -5
- package/dist/modules/storage/getFile.d.ts +0 -34
- package/dist/modules/storage/index.d.ts +0 -4
- package/dist/modules/storage/uploadFile.d.ts +0 -30
- package/dist/modules/storage/uploadImage.d.ts +0 -42
- package/dist/modules/tables/bulkCreate.d.ts +0 -4
- package/dist/modules/tables/bulkDelete.d.ts +0 -7
- package/dist/modules/tables/create.d.ts +0 -4
- package/dist/modules/tables/createTableAccessor.d.ts +0 -9
- package/dist/modules/tables/deleteRow.d.ts +0 -9
- package/dist/modules/tables/find.d.ts +0 -8
- package/dist/modules/tables/findOne.d.ts +0 -7
- package/dist/modules/tables/index.d.ts +0 -9
- package/dist/modules/tables/restore.d.ts +0 -6
- package/dist/modules/tables/update.d.ts +0 -4
- package/dist/modules/users/checkUsernameAvailability.d.ts +0 -8
- package/dist/modules/users/createBlock.d.ts +0 -19
- package/dist/modules/users/createFollow.d.ts +0 -7
- package/dist/modules/users/deleteBlock.d.ts +0 -13
- package/dist/modules/users/deleteFollow.d.ts +0 -6
- package/dist/modules/users/fetchBlockStatus.d.ts +0 -23
- package/dist/modules/users/fetchBlockedUsers.d.ts +0 -19
- package/dist/modules/users/fetchConnectionStatus.d.ts +0 -10
- package/dist/modules/users/fetchConnectionsByUserId.d.ts +0 -11
- package/dist/modules/users/fetchConnectionsCountByUserId.d.ts +0 -6
- package/dist/modules/users/fetchFollowStatus.d.ts +0 -14
- package/dist/modules/users/fetchFollowersByUserId.d.ts +0 -11
- package/dist/modules/users/fetchFollowersCountByUserId.d.ts +0 -8
- package/dist/modules/users/fetchFollowingByUserId.d.ts +0 -11
- package/dist/modules/users/fetchFollowingCountByUserId.d.ts +0 -8
- package/dist/modules/users/fetchUserByForeignId.d.ts +0 -8
- package/dist/modules/users/fetchUserById.d.ts +0 -8
- package/dist/modules/users/fetchUserByUsername.d.ts +0 -8
- package/dist/modules/users/fetchUserSuggestions.d.ts +0 -7
- package/dist/modules/users/index.d.ts +0 -22
- package/dist/modules/users/removeConnectionByUserId.d.ts +0 -10
- package/dist/modules/users/requestConnection.d.ts +0 -11
- package/dist/modules/users/updateUser.d.ts +0 -32
- package/dist/modules/workspaces/acceptInvite.d.ts +0 -13
- package/dist/modules/workspaces/acceptWorkspaceInvite.d.ts +0 -13
- package/dist/modules/workspaces/createInvite.d.ts +0 -17
- package/dist/modules/workspaces/createWorkspace.d.ts +0 -12
- package/dist/modules/workspaces/createWorkspaceInvite.d.ts +0 -17
- package/dist/modules/workspaces/declineInvite.d.ts +0 -12
- package/dist/modules/workspaces/declineWorkspaceInvite.d.ts +0 -14
- package/dist/modules/workspaces/deleteWorkspace.d.ts +0 -13
- package/dist/modules/workspaces/fetchManyWorkspaces.d.ts +0 -13
- package/dist/modules/workspaces/fetchMembers.d.ts +0 -13
- package/dist/modules/workspaces/fetchMyInvites.d.ts +0 -11
- package/dist/modules/workspaces/fetchMyWorkspaceInvites.d.ts +0 -15
- package/dist/modules/workspaces/fetchWorkspace.d.ts +0 -7
- package/dist/modules/workspaces/fetchWorkspaceAuthority.d.ts +0 -11
- package/dist/modules/workspaces/fetchWorkspaceInvites.d.ts +0 -17
- package/dist/modules/workspaces/fetchWorkspaceMemberStanding.d.ts +0 -11
- package/dist/modules/workspaces/fetchWorkspaceMembers.d.ts +0 -13
- package/dist/modules/workspaces/getAuthority.d.ts +0 -11
- package/dist/modules/workspaces/index.d.ts +0 -21
- package/dist/modules/workspaces/leaveWorkspace.d.ts +0 -11
- package/dist/modules/workspaces/removeWorkspaceMember.d.ts +0 -12
- package/dist/modules/workspaces/removeWorkspaceMemberFromSubtree.d.ts +0 -16
- package/dist/modules/workspaces/resendWorkspaceInvite.d.ts +0 -12
- package/dist/modules/workspaces/revokeWorkspaceInvite.d.ts +0 -13
- package/dist/modules/workspaces/transferWorkspaceOwnership.d.ts +0 -15
- package/dist/modules/workspaces/updateWorkspace.d.ts +0 -12
- package/dist/modules/workspaces/updateWorkspaceInheritFlag.d.ts +0 -13
- package/dist/modules/workspaces/updateWorkspaceMember.d.ts +0 -17
package/dist/index.d.mts
CHANGED
|
@@ -190,7 +190,7 @@ declare function signIn(client: SublayHttpClient, data: SignInProps): Promise<Si
|
|
|
190
190
|
* (server `src/constants/push/pushEvents.ts`); these are the only names a
|
|
191
191
|
* `disabledTypes` set may contain.
|
|
192
192
|
*/
|
|
193
|
-
declare const PUSH_EVENT_TYPES: readonly ["entity-comment", "comment-reply", "entity-mention", "comment-mention", "entity-reaction", "comment-reaction", "entity-reaction-milestone-specific", "entity-reaction-milestone-total", "comment-reaction-milestone-specific", "comment-reaction-milestone-total", "new-follow", "connection-request", "connection-accepted", "space-membership-approved", "event-invite", "event-updated", "event-cancelled", "message"];
|
|
193
|
+
declare const PUSH_EVENT_TYPES: readonly ["entity-comment", "comment-reply", "entity-mention", "comment-mention", "entity-reaction", "comment-reaction", "entity-reaction-milestone-specific", "entity-reaction-milestone-total", "comment-reaction-milestone-specific", "comment-reaction-milestone-total", "new-follow", "connection-request", "connection-accepted", "space-membership-approved", "event-invite", "event-updated", "event-cancelled", "reputation-grant", "message"];
|
|
194
194
|
type PushEventType = (typeof PUSH_EVENT_TYPES)[number];
|
|
195
195
|
/**
|
|
196
196
|
* The four conversation-mute duration choices. Send the CHOICE, never a raw
|
|
@@ -445,18 +445,35 @@ interface VerifyEmailProps {
|
|
|
445
445
|
}
|
|
446
446
|
declare function verifyEmail(client: SublayHttpClient, data: VerifyEmailProps): Promise<void>;
|
|
447
447
|
|
|
448
|
-
interface
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
interface SendCodeVerificationEmailHexProps {
|
|
449
|
+
mode: "code";
|
|
450
|
+
tokenFormat: "hex";
|
|
451
|
+
tokenLength?: never;
|
|
452
|
+
}
|
|
453
|
+
interface SendCodeVerificationEmailShortProps {
|
|
454
|
+
mode: "code";
|
|
455
|
+
tokenFormat: "numeric" | "alpha" | "alphanumeric";
|
|
456
|
+
tokenLength: number;
|
|
457
|
+
}
|
|
458
|
+
interface SendLinkVerificationEmailProps {
|
|
459
|
+
mode: "link";
|
|
451
460
|
tokenFormat?: "hex" | "numeric" | "alpha" | "alphanumeric";
|
|
452
461
|
tokenLength?: number;
|
|
453
|
-
/**
|
|
462
|
+
/** Where to send the user after the link is verified. */
|
|
454
463
|
redirectUrl?: string;
|
|
455
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* `mode` is required so every caller explicitly decides code vs link, and the
|
|
467
|
+
* `tokenFormat`/`tokenLength` pair for "code" is a discriminated union rather
|
|
468
|
+
* than two independent optionals — pairing `mode: "code"` with the default
|
|
469
|
+
* `tokenFormat: "hex"` used to compile fine and silently email a 64-character
|
|
470
|
+
* string no one could type.
|
|
471
|
+
*/
|
|
472
|
+
type SendVerificationEmailProps = SendCodeVerificationEmailHexProps | SendCodeVerificationEmailShortProps | SendLinkVerificationEmailProps;
|
|
456
473
|
interface SendVerificationEmailResponse {
|
|
457
474
|
success: boolean;
|
|
458
475
|
}
|
|
459
|
-
declare function sendVerificationEmail(client: SublayHttpClient, data
|
|
476
|
+
declare function sendVerificationEmail(client: SublayHttpClient, data: SendVerificationEmailProps): Promise<SendVerificationEmailResponse>;
|
|
460
477
|
|
|
461
478
|
interface RequestAccountDeletionResponse {
|
|
462
479
|
success: boolean;
|
|
@@ -1021,6 +1038,91 @@ declare namespace Users {
|
|
|
1021
1038
|
export { Users_checkUsernameAvailability as checkUsernameAvailability, Users_createBlock as createBlock, Users_createFollow as createFollow, Users_deleteBlock as deleteBlock, deleteFollow$1 as deleteFollow, Users_fetchBlockStatus as fetchBlockStatus, Users_fetchBlockedUsers as fetchBlockedUsers, Users_fetchConnectionStatus as fetchConnectionStatus, Users_fetchConnectionsByUserId as fetchConnectionsByUserId, Users_fetchConnectionsCountByUserId as fetchConnectionsCountByUserId, Users_fetchFollowStatus as fetchFollowStatus, Users_fetchFollowersByUserId as fetchFollowersByUserId, Users_fetchFollowersCountByUserId as fetchFollowersCountByUserId, Users_fetchFollowingByUserId as fetchFollowingByUserId, Users_fetchFollowingCountByUserId as fetchFollowingCountByUserId, Users_fetchUserByForeignId as fetchUserByForeignId, Users_fetchUserById as fetchUserById, Users_fetchUserByUsername as fetchUserByUsername, Users_fetchUserSuggestions as fetchUserSuggestions, Users_removeConnectionByUserId as removeConnectionByUserId, Users_requestConnection as requestConnection, Users_updateUser as updateUser };
|
|
1022
1039
|
}
|
|
1023
1040
|
|
|
1041
|
+
/** The three grantable target kinds. Polymorphic — `targetId` carries no FK. */
|
|
1042
|
+
type ReputationGrantTargetType = "entity" | "comment" | "chat-message";
|
|
1043
|
+
/**
|
|
1044
|
+
* Who created the grant. `"user"` is a debited transfer (reputation moved out
|
|
1045
|
+
* of `senderId`'s bucket); `"app"` is a mint issued by the project itself with
|
|
1046
|
+
* a null `senderId`. Persisted rather than inferred from `senderId`, which is
|
|
1047
|
+
* also null for a transfer whose sender was later deleted.
|
|
1048
|
+
*/
|
|
1049
|
+
type ReputationGrantSourceType = "user" | "app";
|
|
1050
|
+
/**
|
|
1051
|
+
* The "which item was rewarded" pair, as a both-or-neither union.
|
|
1052
|
+
*
|
|
1053
|
+
* Modelled as a two-branch union rather than two independent optional fields so
|
|
1054
|
+
* a half-filled target — `{ targetType }` with no `targetId`, or the reverse —
|
|
1055
|
+
* does not compile. The server answers that shape with
|
|
1056
|
+
* `400 reputation-grant/invalid-body` on the write (a shared
|
|
1057
|
+
* `bothOrNeitherTarget` refinement) and
|
|
1058
|
+
* `400 reputation-grant/invalid-filter` on the list, so the union turns a
|
|
1059
|
+
* guaranteed round trip into a red squiggle.
|
|
1060
|
+
*
|
|
1061
|
+
* The empty branch is `?: undefined`, NOT `?: null` — deliberately, and for the
|
|
1062
|
+
* same reason `metadata` is not nullable: `grantBodyFields.targetType` is
|
|
1063
|
+
* `.optional()` with no `.nullable()`, so an explicit `targetType: null` is
|
|
1064
|
+
* rejected. Omit both keys to mean "no target".
|
|
1065
|
+
*
|
|
1066
|
+
* Building the pair conditionally needs one accommodation: an inline
|
|
1067
|
+
* conditional spread of just these two keys widens both to `T | undefined` and
|
|
1068
|
+
* then matches neither branch. Either branch the whole argument, or name this
|
|
1069
|
+
* type on a helper and spread that:
|
|
1070
|
+
*
|
|
1071
|
+
* ```ts
|
|
1072
|
+
* const target: ReputationGrantTargetFilter = item
|
|
1073
|
+
* ? { targetType: "entity", targetId: item.id }
|
|
1074
|
+
* : {};
|
|
1075
|
+
* await listGrants(client, { ...base, ...target });
|
|
1076
|
+
* ```
|
|
1077
|
+
*/
|
|
1078
|
+
type ReputationGrantTargetFilter = {
|
|
1079
|
+
/** The kind of item rewarded. Requires `targetId` alongside it. */
|
|
1080
|
+
targetType: ReputationGrantTargetType;
|
|
1081
|
+
/** The rewarded item's id. Requires `targetType` alongside it. */
|
|
1082
|
+
targetId: string;
|
|
1083
|
+
} | {
|
|
1084
|
+
targetType?: undefined;
|
|
1085
|
+
targetId?: undefined;
|
|
1086
|
+
};
|
|
1087
|
+
/**
|
|
1088
|
+
* Per-item reputation-grant summary. Covers positive grants only — negative
|
|
1089
|
+
* grants (app deductions) are invisible on every public read surface.
|
|
1090
|
+
*/
|
|
1091
|
+
interface GrantSummary {
|
|
1092
|
+
/** Sum of positive grant amounts on the item. */
|
|
1093
|
+
total: number;
|
|
1094
|
+
/** Number of positive grants on the item. */
|
|
1095
|
+
count: number;
|
|
1096
|
+
/** The calling user's own summed positive grants on the item. */
|
|
1097
|
+
viewerTotal: number;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* A single reputation movement. Rows are append-only — nothing updates or
|
|
1101
|
+
* soft-deletes them — so the table is the audit log behind every balance.
|
|
1102
|
+
*/
|
|
1103
|
+
interface ReputationGrant {
|
|
1104
|
+
id: string;
|
|
1105
|
+
sourceType: ReputationGrantSourceType;
|
|
1106
|
+
/** Null for an app mint, and for a transfer whose sender was deleted. */
|
|
1107
|
+
senderId: string | null;
|
|
1108
|
+
/** Populated when the list is called with `include: "user"`. */
|
|
1109
|
+
sender?: User | null;
|
|
1110
|
+
recipientId: string;
|
|
1111
|
+
/** Populated when the list is called with `include: "user"`. */
|
|
1112
|
+
recipient?: User | null;
|
|
1113
|
+
/** Non-zero. Negative only when `sourceType` is `"app"`. */
|
|
1114
|
+
amount: number;
|
|
1115
|
+
/** The bucket both legs moved in; null = the project-general bucket. */
|
|
1116
|
+
spaceId: string | null;
|
|
1117
|
+
/** Both null or both non-null. */
|
|
1118
|
+
targetType: ReputationGrantTargetType | null;
|
|
1119
|
+
targetId: string | null;
|
|
1120
|
+
note: string | null;
|
|
1121
|
+
metadata: Record<string, any> | null;
|
|
1122
|
+
createdAt: string;
|
|
1123
|
+
updatedAt: string;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1024
1126
|
type Mention = UserMention | SpaceMention;
|
|
1025
1127
|
interface UserMention {
|
|
1026
1128
|
type: "user";
|
|
@@ -1226,6 +1328,13 @@ interface Entity {
|
|
|
1226
1328
|
nsfwEffective: boolean;
|
|
1227
1329
|
topComment: TopComment | null;
|
|
1228
1330
|
isSaved?: boolean;
|
|
1331
|
+
/**
|
|
1332
|
+
* Reputation-grant summary. Opt-in — present exactly when the read requested
|
|
1333
|
+
* `include=grants`. Once requested the server always returns the object,
|
|
1334
|
+
* zero-filled rather than omitted, on projects with no grants and on projects
|
|
1335
|
+
* without the reputation bundle alike.
|
|
1336
|
+
*/
|
|
1337
|
+
grants?: GrantSummary;
|
|
1229
1338
|
isDraft: boolean | null;
|
|
1230
1339
|
moderationStatus: "approved" | "removed" | null;
|
|
1231
1340
|
moderatedAt: string | null;
|
|
@@ -1757,6 +1866,13 @@ interface Comment {
|
|
|
1757
1866
|
reactionCounts: ReactionCounts;
|
|
1758
1867
|
userReaction?: ReactionType | null;
|
|
1759
1868
|
repliesCount: number;
|
|
1869
|
+
/**
|
|
1870
|
+
* Reputation-grant summary. Opt-in — present exactly when the read requested
|
|
1871
|
+
* `include=grants`. Once requested the server always returns the object,
|
|
1872
|
+
* zero-filled rather than omitted, on projects with no grants and on projects
|
|
1873
|
+
* without the reputation bundle alike.
|
|
1874
|
+
*/
|
|
1875
|
+
grants?: GrantSummary;
|
|
1760
1876
|
metadata: Record<string, any>;
|
|
1761
1877
|
createdAt: string;
|
|
1762
1878
|
updatedAt: string;
|
|
@@ -2241,6 +2357,13 @@ interface ChatMessage {
|
|
|
2241
2357
|
threadReplyCount: number;
|
|
2242
2358
|
reactionCounts: Record<string, number>;
|
|
2243
2359
|
userReactions: string[];
|
|
2360
|
+
/**
|
|
2361
|
+
* Reputation-grant summary. Opt-in — present exactly when the read requested
|
|
2362
|
+
* `include=grants`. Once requested the server always returns the object,
|
|
2363
|
+
* zero-filled rather than omitted, on projects with no grants and on projects
|
|
2364
|
+
* without the reputation bundle alike.
|
|
2365
|
+
*/
|
|
2366
|
+
grants?: GrantSummary;
|
|
2244
2367
|
editedAt: string | null;
|
|
2245
2368
|
userDeletedAt: string | null;
|
|
2246
2369
|
moderationStatus: "approved" | "removed" | null;
|
|
@@ -2871,6 +2994,96 @@ declare namespace Reports {
|
|
|
2871
2994
|
export { Reports_createReport as createReport, Reports_fetchModeratedReports as fetchModeratedReports };
|
|
2872
2995
|
}
|
|
2873
2996
|
|
|
2997
|
+
interface CreateGrantBaseProps {
|
|
2998
|
+
/** The user receiving the reputation. Cannot be the logged-in user. */
|
|
2999
|
+
recipientId: string;
|
|
3000
|
+
/**
|
|
3001
|
+
* Positive integer. A user transfer can never mint (negatives) nor be a
|
|
3002
|
+
* no-op (zero) — minting is service-key-only and lives in `@sublay/node`.
|
|
3003
|
+
*/
|
|
3004
|
+
amount: number;
|
|
3005
|
+
/** The bucket both legs move in. Omitted/null = the project-general bucket. */
|
|
3006
|
+
spaceId?: string | null;
|
|
3007
|
+
/**
|
|
3008
|
+
* Free-text reason. Trimmed and capped at 2000 characters server-side.
|
|
3009
|
+
* Genuinely nullable — an explicit `null` is accepted and means "no note".
|
|
3010
|
+
*/
|
|
3011
|
+
note?: string | null;
|
|
3012
|
+
/**
|
|
3013
|
+
* Arbitrary JSON, capped at 1 MB server-side.
|
|
3014
|
+
*
|
|
3015
|
+
* NOT nullable — deliberately asymmetric with `note` directly above, not a
|
|
3016
|
+
* typo. The server's shared `metadataSchema` is `z.record(...).optional()`
|
|
3017
|
+
* with no `.nullable()`, so an explicit `metadata: null` is rejected with
|
|
3018
|
+
* `400 reputation-grant/invalid-body`. Omit the key to mean "no metadata".
|
|
3019
|
+
*/
|
|
3020
|
+
metadata?: Record<string, any>;
|
|
3021
|
+
}
|
|
3022
|
+
/**
|
|
3023
|
+
* `targetType` and `targetId` are supplied together or not at all — the
|
|
3024
|
+
* both-or-neither pair is carried by {@link ReputationGrantTargetFilter}, which
|
|
3025
|
+
* makes the half-filled shape a compile error instead of a
|
|
3026
|
+
* `400 reputation-grant/invalid-body`.
|
|
3027
|
+
*/
|
|
3028
|
+
type CreateGrantProps = CreateGrantBaseProps & ReputationGrantTargetFilter;
|
|
3029
|
+
/**
|
|
3030
|
+
* Transfers reputation from the logged-in user to another user — a **debited
|
|
3031
|
+
* transfer**: the amount leaves the sender's bucket and lands in the
|
|
3032
|
+
* recipient's bucket in the same space. Nothing is created.
|
|
3033
|
+
*
|
|
3034
|
+
* There is no actor field: the sender is always the user the token belongs to.
|
|
3035
|
+
* Naming somebody else as the sender requires a service key, which this SDK
|
|
3036
|
+
* never holds.
|
|
3037
|
+
*/
|
|
3038
|
+
declare function createGrant(client: SublayHttpClient, data: CreateGrantProps): Promise<ReputationGrant>;
|
|
3039
|
+
|
|
3040
|
+
interface ListGrantsBaseProps extends SpaceReputationContextParams {
|
|
3041
|
+
page?: number;
|
|
3042
|
+
limit?: number;
|
|
3043
|
+
/** What this user received. */
|
|
3044
|
+
recipientId?: string;
|
|
3045
|
+
/** What this user sent. */
|
|
3046
|
+
senderId?: string;
|
|
3047
|
+
/** Associations to expand. Only `"user"` is supported (hydrates both parties). */
|
|
3048
|
+
include?: string;
|
|
3049
|
+
}
|
|
3050
|
+
/**
|
|
3051
|
+
* The third filter shape — "who rewarded this item" — is the
|
|
3052
|
+
* {@link ReputationGrantTargetFilter} pair, so a half-filled target is a
|
|
3053
|
+
* compile error rather than a `400 reputation-grant/invalid-filter`.
|
|
3054
|
+
*
|
|
3055
|
+
* Mutual exclusivity between the three shapes is NOT expressed in the type: a
|
|
3056
|
+
* three-way exclusive union would multiply out across every pagination and
|
|
3057
|
+
* space-reputation field and make the props unreadable, for a rule the server
|
|
3058
|
+
* reports clearly. Only the both-or-neither pairing is typed.
|
|
3059
|
+
*/
|
|
3060
|
+
type ListGrantsProps = ListGrantsBaseProps & ReputationGrantTargetFilter;
|
|
3061
|
+
/**
|
|
3062
|
+
* The `summary` block rides alongside the page envelope, and only on the
|
|
3063
|
+
* target filter shape.
|
|
3064
|
+
*/
|
|
3065
|
+
interface ListGrantsResponse extends PaginatedResponse<ReputationGrant> {
|
|
3066
|
+
summary?: GrantSummary;
|
|
3067
|
+
}
|
|
3068
|
+
/**
|
|
3069
|
+
* Lists reputation grants.
|
|
3070
|
+
*
|
|
3071
|
+
* Exactly one filter shape per request — `recipientId`, `senderId`, or
|
|
3072
|
+
* `targetType` + `targetId`. Supplying none or combining two is a `400`; the
|
|
3073
|
+
* shapes are not AND-ed, which is what keeps the `summary` block reconcilable
|
|
3074
|
+
* with the rows beneath it.
|
|
3075
|
+
*
|
|
3076
|
+
* Only positive grants are ever returned. Negative grants are app moderation
|
|
3077
|
+
* deductions and are unreadable from every public surface.
|
|
3078
|
+
*/
|
|
3079
|
+
declare function listGrants(client: SublayHttpClient, data: ListGrantsProps): Promise<ListGrantsResponse>;
|
|
3080
|
+
|
|
3081
|
+
declare const Reputation_createGrant: typeof createGrant;
|
|
3082
|
+
declare const Reputation_listGrants: typeof listGrants;
|
|
3083
|
+
declare namespace Reputation {
|
|
3084
|
+
export { Reputation_createGrant as createGrant, Reputation_listGrants as listGrants };
|
|
3085
|
+
}
|
|
3086
|
+
|
|
2874
3087
|
interface SearchContentProps extends SpaceReputationContextParams {
|
|
2875
3088
|
query: string;
|
|
2876
3089
|
sourceTypes?: ("entity" | "comment" | "message")[];
|
|
@@ -3323,7 +3536,11 @@ interface ListMessagesProps extends SpaceReputationContextParams {
|
|
|
3323
3536
|
/** Page size (default 50, max 100). */
|
|
3324
3537
|
limit?: number;
|
|
3325
3538
|
sort?: "asc" | "desc";
|
|
3326
|
-
/**
|
|
3539
|
+
/**
|
|
3540
|
+
* Comma-separated associations to populate: `"files"` (message
|
|
3541
|
+
* attachments) and `"grants"` (the reputation-grant summary). Combine
|
|
3542
|
+
* them as `"files,grants"` — the server splits and trims this itself.
|
|
3543
|
+
*/
|
|
3327
3544
|
include?: string;
|
|
3328
3545
|
/** Optional filters, e.g. `{ hasReplies: true }`. */
|
|
3329
3546
|
filters?: MessageFilters;
|
|
@@ -3363,6 +3580,11 @@ declare function sendMessage(client: SublayHttpClient, data: SendMessageProps):
|
|
|
3363
3580
|
interface GetMessageProps extends SpaceReputationContextParams {
|
|
3364
3581
|
conversationId: string;
|
|
3365
3582
|
messageId: string;
|
|
3583
|
+
/**
|
|
3584
|
+
* Comma-separated associations to populate. Only `"grants"` is supported
|
|
3585
|
+
* here — it attaches the message's reputation-grant summary.
|
|
3586
|
+
*/
|
|
3587
|
+
include?: string;
|
|
3366
3588
|
}
|
|
3367
3589
|
declare function getMessage(client: SublayHttpClient, data: GetMessageProps): Promise<ChatMessage>;
|
|
3368
3590
|
|
|
@@ -3569,9 +3791,46 @@ interface WorkspaceInvitation {
|
|
|
3569
3791
|
createdAt: string;
|
|
3570
3792
|
updatedAt: string;
|
|
3571
3793
|
}
|
|
3794
|
+
interface WorkspaceInvitationInviter {
|
|
3795
|
+
id: string;
|
|
3796
|
+
name: string | null;
|
|
3797
|
+
username: string | null;
|
|
3798
|
+
avatar: string | null;
|
|
3799
|
+
reputation: number;
|
|
3800
|
+
}
|
|
3801
|
+
interface MyWorkspaceInvitation extends Omit<WorkspaceInvitation, "invitedBy"> {
|
|
3802
|
+
workspace: {
|
|
3803
|
+
id: string;
|
|
3804
|
+
name: string;
|
|
3805
|
+
};
|
|
3806
|
+
invitedBy: WorkspaceInvitationInviter;
|
|
3807
|
+
}
|
|
3572
3808
|
interface WorkspaceRosterReason {
|
|
3573
3809
|
type: "owner" | "member" | "ancestor-owner" | "reach-holder" | "descendant-member";
|
|
3574
3810
|
rank?: number;
|
|
3811
|
+
/**
|
|
3812
|
+
* The SAME ladder position, expressed as an offset from the CALLER: `1` = one
|
|
3813
|
+
* rung below you, `0` = your peer, `-3` = three rungs above you. The caller's
|
|
3814
|
+
* own anchor is their member row on this workspace if they hold one, and apex
|
|
3815
|
+
* (one step above rank 0) if they do not — so a rank-0 member reads back as
|
|
3816
|
+
* `relativeRank: 1` for an owner.
|
|
3817
|
+
*
|
|
3818
|
+
* Authority-bearing and fenced WITH `rank`, never beside it: it is `rank`
|
|
3819
|
+
* minus a number the caller already knows, so leaking it leaks `rank` exactly.
|
|
3820
|
+
*
|
|
3821
|
+
* Present on same-node `member` reasons only. `descendant-member` entries
|
|
3822
|
+
* carry `rank` but NEVER `relativeRank` — rank is per-workspace, so an offset
|
|
3823
|
+
* measured against your standing on THIS node would be arithmetic across two
|
|
3824
|
+
* different ladders. Use their absolute `rank` there.
|
|
3825
|
+
*
|
|
3826
|
+
* Note the deliberate asymmetry with the fence described above: the FENCE is
|
|
3827
|
+
* per node (a descendant row may or may not carry `rank` depending on your
|
|
3828
|
+
* standing there), but PRESENCE of `relativeRank` is not — it is absent on
|
|
3829
|
+
* every `descendant-member` row, unconditionally, however much authority you
|
|
3830
|
+
* hold. A field that appears and disappears by who is asking is worse to
|
|
3831
|
+
* consume than one that is uniformly absent.
|
|
3832
|
+
*/
|
|
3833
|
+
relativeRank?: number;
|
|
3575
3834
|
capabilities?: WorkspaceCapability[];
|
|
3576
3835
|
permissions?: string[];
|
|
3577
3836
|
title?: string | null;
|
|
@@ -3611,6 +3870,13 @@ interface WorkspaceMemberStanding {
|
|
|
3611
3870
|
capabilities?: WorkspaceCapability[];
|
|
3612
3871
|
permissions?: string[];
|
|
3613
3872
|
rank?: number | null;
|
|
3873
|
+
/**
|
|
3874
|
+
* `rank` expressed as an offset from the CALLER (negative = senior to you).
|
|
3875
|
+
* `null` exactly when `rank` is `null` — a target with no direct member row
|
|
3876
|
+
* here sits outside the ladder and has no position to measure. Fenced with
|
|
3877
|
+
* `rank`: absent (not null) for a caller who may not see it.
|
|
3878
|
+
*/
|
|
3879
|
+
relativeRank?: number | null;
|
|
3614
3880
|
title: string | null;
|
|
3615
3881
|
metadata: Record<string, any>;
|
|
3616
3882
|
}
|
|
@@ -3683,7 +3949,11 @@ interface FetchManyWorkspacesProps {
|
|
|
3683
3949
|
}
|
|
3684
3950
|
/**
|
|
3685
3951
|
* List the bearer-token user's direct-membership + owned workspaces. The actor
|
|
3686
|
-
* is derived from the token — no
|
|
3952
|
+
* is derived from the token — no actor field is sent.
|
|
3953
|
+
*
|
|
3954
|
+
* ⚠️ Only the fields declared above are accepted. The workspaces endpoints
|
|
3955
|
+
* refuse any undeclared top-level field with a 400 rather than ignoring it, so
|
|
3956
|
+
* do not spread an unrelated object into `data`.
|
|
3687
3957
|
*/
|
|
3688
3958
|
declare function fetchManyWorkspaces(client: SublayHttpClient, data?: FetchManyWorkspacesProps): Promise<PaginatedResponse<Workspace>>;
|
|
3689
3959
|
|
|
@@ -3694,7 +3964,7 @@ interface UpdateWorkspaceProps {
|
|
|
3694
3964
|
}
|
|
3695
3965
|
/**
|
|
3696
3966
|
* Edit a workspace's name / metadata. Requires the `edit-workspace` capability
|
|
3697
|
-
* (or ownership). The actor is the bearer-token user — no
|
|
3967
|
+
* (or ownership). The actor is the bearer-token user — no actor field is sent.
|
|
3698
3968
|
*/
|
|
3699
3969
|
declare function updateWorkspace(client: SublayHttpClient, data: UpdateWorkspaceProps): Promise<Workspace>;
|
|
3700
3970
|
|
|
@@ -3706,7 +3976,7 @@ interface UpdateWorkspaceInheritFlagProps {
|
|
|
3706
3976
|
* Flip whether capabilities held on an ancestor "reach" into this workspace.
|
|
3707
3977
|
* Owner-only in both directions (own owner or an ancestor owner), and blocked
|
|
3708
3978
|
* (403 `workspace/inherit-enforced`) when the project enforces its default.
|
|
3709
|
-
* The actor is the bearer-token user — no
|
|
3979
|
+
* The actor is the bearer-token user — no actor field is sent.
|
|
3710
3980
|
*/
|
|
3711
3981
|
declare function updateWorkspaceInheritFlag(client: SublayHttpClient, data: UpdateWorkspaceInheritFlagProps): Promise<Workspace>;
|
|
3712
3982
|
|
|
@@ -3718,8 +3988,8 @@ interface DeleteWorkspaceResponse {
|
|
|
3718
3988
|
}
|
|
3719
3989
|
/**
|
|
3720
3990
|
* Owner-only delete (own owner or an ancestor owner). Cascades the whole
|
|
3721
|
-
* subtree transactionally. The actor is the bearer-token user — no
|
|
3722
|
-
*
|
|
3991
|
+
* subtree transactionally. The actor is the bearer-token user — no actor
|
|
3992
|
+
* field is sent.
|
|
3723
3993
|
*/
|
|
3724
3994
|
declare function deleteWorkspace(client: SublayHttpClient, data: DeleteWorkspaceProps): Promise<DeleteWorkspaceResponse>;
|
|
3725
3995
|
|
|
@@ -3732,7 +4002,7 @@ interface TransferWorkspaceOwnershipProps {
|
|
|
3732
4002
|
}
|
|
3733
4003
|
/**
|
|
3734
4004
|
* Hand the workspace to a new owner. Owner-only (own owner or an ancestor
|
|
3735
|
-
* owner). The actor is the bearer-token user — no
|
|
4005
|
+
* owner). The actor is the bearer-token user — no actor field is sent;
|
|
3736
4006
|
* `newOwnerId` addresses the TARGET, not the actor.
|
|
3737
4007
|
*/
|
|
3738
4008
|
declare function transferWorkspaceOwnership(client: SublayHttpClient, data: TransferWorkspaceOwnershipProps): Promise<Workspace>;
|
|
@@ -3746,6 +4016,11 @@ interface FetchWorkspaceMembersProps {
|
|
|
3746
4016
|
* Unified roster read — one entry per distinct user, each with a `reasons`
|
|
3747
4017
|
* array. Always returned in full (never paginated). With `countOnly=true` the
|
|
3748
4018
|
* shape is `WorkspaceRosterCountsResponse` instead. Actor from the token.
|
|
4019
|
+
*
|
|
4020
|
+
* Same-node `member` reasons carry both rank coordinates: absolute `rank` and
|
|
4021
|
+
* `relativeRank`, the offset from you (`1` = one rung below you, `-3` = three
|
|
4022
|
+
* above). Both are fenced together and both are absent for a caller who does
|
|
4023
|
+
* not operate people here. `descendant-member` reasons carry `rank` only.
|
|
3749
4024
|
*/
|
|
3750
4025
|
declare function fetchWorkspaceMembers(client: SublayHttpClient, data: FetchWorkspaceMembersProps): Promise<WorkspaceRosterResponse | WorkspaceRosterCountsResponse>;
|
|
3751
4026
|
|
|
@@ -3755,7 +4030,11 @@ interface FetchWorkspaceMemberStandingProps {
|
|
|
3755
4030
|
}
|
|
3756
4031
|
/**
|
|
3757
4032
|
* Read one user's resolved standing on a workspace (`reasons`, `capabilities`,
|
|
3758
|
-
* `permissions`, `rank`, `title`, `metadata`).
|
|
4033
|
+
* `permissions`, `rank`, `relativeRank`, `title`, `metadata`).
|
|
4034
|
+
*
|
|
4035
|
+
* `relativeRank` is the target's `rank` as an offset from YOU (negative =
|
|
4036
|
+
* senior to you), and is fenced with `rank`: both are absent, not null, for a
|
|
4037
|
+
* caller who may not see the target's authority.
|
|
3759
4038
|
*/
|
|
3760
4039
|
declare function fetchWorkspaceMemberStanding(client: SublayHttpClient, data: FetchWorkspaceMemberStandingProps): Promise<WorkspaceMemberStanding>;
|
|
3761
4040
|
|
|
@@ -3765,13 +4044,31 @@ interface UpdateWorkspaceMemberProps {
|
|
|
3765
4044
|
capabilities?: WorkspaceCapability[];
|
|
3766
4045
|
permissions?: string[];
|
|
3767
4046
|
rank?: number;
|
|
4047
|
+
/**
|
|
4048
|
+
* `rank`'s relative twin: an offset from the ACTOR (`1` = one rung below me),
|
|
4049
|
+
* resolved to an absolute rank at write time and stored absolute. Must be
|
|
4050
|
+
* `>= 1`; mutually exclusive with `rank` (sending both is a 400). Both rank fields are also capped at `2147483647` (int4), and the RESOLVED sum is bounded too — an in-range anchor plus an in-range offset can still overflow, which is a 400 rather than a 500.
|
|
4051
|
+
*
|
|
4052
|
+
* The anchor is the actor's own rank if they hold a member row on this
|
|
4053
|
+
* workspace, apex otherwise. A SNAPSHOT — frozen at write time, it does not
|
|
4054
|
+
* follow the actor's own rank afterwards.
|
|
4055
|
+
*
|
|
4056
|
+
* Unlike invite, edit has NO default: omitting BOTH still means "rank
|
|
4057
|
+
* unchanged", so editing someone's capabilities never moves them on the
|
|
4058
|
+
* ladder.
|
|
4059
|
+
*/
|
|
4060
|
+
relativeRank?: number;
|
|
3768
4061
|
title?: string | null;
|
|
3769
4062
|
metadata?: Record<string, any>;
|
|
3770
4063
|
}
|
|
3771
4064
|
/**
|
|
3772
4065
|
* Edit a member's grant / profile. Powerful fields need `edit-member-access`
|
|
3773
4066
|
* plus rank + no-escalation rules; cosmetic fields need only
|
|
3774
|
-
* `edit-member-profile`. No
|
|
4067
|
+
* `edit-member-profile`. No actor field is sent — the actor comes from the token.
|
|
4068
|
+
*
|
|
4069
|
+
* Rank moves in either coordinate — `rank` (absolute) or `relativeRank` (an
|
|
4070
|
+
* offset from the actor) — never both. Omitting both leaves rank UNCHANGED;
|
|
4071
|
+
* unlike invite, edit has no value default.
|
|
3775
4072
|
*/
|
|
3776
4073
|
declare function updateWorkspaceMember(client: SublayHttpClient, data: UpdateWorkspaceMemberProps): Promise<WorkspaceMember>;
|
|
3777
4074
|
|
|
@@ -3782,7 +4079,7 @@ interface RemoveWorkspaceMemberProps {
|
|
|
3782
4079
|
/**
|
|
3783
4080
|
* Remove a member from this workspace. Requires the `remove-member` capability
|
|
3784
4081
|
* and is rank-bounded. The workspace owner cannot be removed (409
|
|
3785
|
-
* `workspace/sole-owner`) — transfer ownership first. No
|
|
4082
|
+
* `workspace/sole-owner`) — transfer ownership first. No actor field is sent;
|
|
3786
4083
|
* the actor comes from the token.
|
|
3787
4084
|
*/
|
|
3788
4085
|
declare function removeWorkspaceMember(client: SublayHttpClient, data: RemoveWorkspaceMemberProps): Promise<void>;
|
|
@@ -3793,8 +4090,9 @@ interface LeaveWorkspaceProps {
|
|
|
3793
4090
|
/**
|
|
3794
4091
|
* The bearer-token user leaves this workspace — removes THEIR OWN direct
|
|
3795
4092
|
* membership on THIS node only (owning a child is unaffected). An owner cannot
|
|
3796
|
-
* leave (409 `workspace/sole-owner`)
|
|
3797
|
-
* sent
|
|
4093
|
+
* leave (409 `workspace/sole-owner`) — transfer ownership or remove the
|
|
4094
|
+
* workspace first. No actor field is sent; the server derives the leaver from
|
|
4095
|
+
* the token.
|
|
3798
4096
|
*/
|
|
3799
4097
|
declare function leaveWorkspace(client: SublayHttpClient, data: LeaveWorkspaceProps): Promise<void>;
|
|
3800
4098
|
|
|
@@ -3820,12 +4118,61 @@ interface CreateWorkspaceInviteProps {
|
|
|
3820
4118
|
username?: string;
|
|
3821
4119
|
capabilities?: WorkspaceCapability[];
|
|
3822
4120
|
permissions?: string[];
|
|
3823
|
-
|
|
4121
|
+
/**
|
|
4122
|
+
* The invited rank, ABSOLUTE — a position on this workspace's ladder (smaller
|
|
4123
|
+
* = more senior). The escape hatch, and what tier-constant apps want, since
|
|
4124
|
+
* they compute the number anyway.
|
|
4125
|
+
*
|
|
4126
|
+
* Optional, and mutually exclusive with `relativeRank` — sending both is a
|
|
4127
|
+
* 400. Sending NEITHER defaults to `relativeRank: 1`, one rung below the
|
|
4128
|
+
* inviter, which is well defined for every actor and can never fail the rank
|
|
4129
|
+
* floor.
|
|
4130
|
+
*
|
|
4131
|
+
* ⚠️ That default is for a NEW invitation. Re-inviting a target who already
|
|
4132
|
+
* has a live pending invite updates it in place, and there omitting both rank
|
|
4133
|
+
* fields PRESERVES the stored rank instead of re-defaulting it. See the
|
|
4134
|
+
* function doc below.
|
|
4135
|
+
*/
|
|
4136
|
+
rank?: number;
|
|
4137
|
+
/**
|
|
4138
|
+
* The invited rank, RELATIVE to the inviter: `1` = one rung below me, `2` =
|
|
4139
|
+
* two rungs below, and so on. The documented happy path — every governance
|
|
4140
|
+
* rule about rank is relative, so this is what callers usually mean.
|
|
4141
|
+
*
|
|
4142
|
+
* Must be `>= 1` on a write. `0` would mean "a peer", which the assign rule
|
|
4143
|
+
* forbids (you cannot clone your own authority), and a negative offset would
|
|
4144
|
+
* mint someone senior to you; both are a 400. Both rank fields are also capped at `2147483647` (int4), and the RESOLVED sum is bounded too — an in-range anchor plus an in-range offset can still overflow, which is a 400 rather than a 500.
|
|
4145
|
+
*
|
|
4146
|
+
* The anchor is the inviter's OWN rank if they hold a member row on this
|
|
4147
|
+
* workspace, and apex (one step above rank 0) if they do not — so an owner's
|
|
4148
|
+
* `relativeRank: 1` lands on rank 0, while a rank-3 member's lands on rank 4.
|
|
4149
|
+
*
|
|
4150
|
+
* ⚠️ A SNAPSHOT, not a live link: the offset is resolved to an absolute rank
|
|
4151
|
+
* once, at invite time, and frozen. It does not track the inviter's later
|
|
4152
|
+
* promotions or demotions.
|
|
4153
|
+
*/
|
|
4154
|
+
relativeRank?: number;
|
|
3824
4155
|
title?: string | null;
|
|
3825
4156
|
}
|
|
3826
4157
|
/**
|
|
3827
4158
|
* Create an invitation (requires the `invite` capability on the workspace). The
|
|
3828
4159
|
* inviter is the bearer-token user.
|
|
4160
|
+
*
|
|
4161
|
+
* The invited rank comes in either coordinate — `rank` (absolute) or
|
|
4162
|
+
* `relativeRank` (an offset from the inviter) — never both. Omitting both
|
|
4163
|
+
* defaults to `relativeRank: 1`, one rung below the inviter, which is the
|
|
4164
|
+
* documented happy path and can never fail the rank floor.
|
|
4165
|
+
*
|
|
4166
|
+
* ⚠️ This route doubles as an UPSERT, and the default above applies only to a
|
|
4167
|
+
* NEW invitation. Re-inviting a target who already holds a live pending invite
|
|
4168
|
+
* refreshes THAT invitation in place — same id, expiry reset — and on that
|
|
4169
|
+
* branch an omitted grant field is PRESERVED, not re-defaulted or blanked:
|
|
4170
|
+
* `rank`, `capabilities`, `permissions` and `title` all keep their stored
|
|
4171
|
+
* values. A "Resend invitation" button that posts only the address therefore
|
|
4172
|
+
* cannot silently re-rank the invitee to one below whoever clicked it. An
|
|
4173
|
+
* explicit value still overwrites, and an explicit `relativeRank` re-resolves
|
|
4174
|
+
* against the CURRENT caller. Full semantics:
|
|
4175
|
+
* https://docs.sublay.io/api-reference/workspaces/invitations/create-invite
|
|
3829
4176
|
*/
|
|
3830
4177
|
declare function createWorkspaceInvite(client: SublayHttpClient, data: CreateWorkspaceInviteProps): Promise<WorkspaceInvitation>;
|
|
3831
4178
|
|
|
@@ -3897,7 +4244,7 @@ interface DeclineWorkspaceInviteResponse {
|
|
|
3897
4244
|
declare function declineWorkspaceInvite(client: SublayHttpClient, data: DeclineWorkspaceInviteProps): Promise<DeclineWorkspaceInviteResponse>;
|
|
3898
4245
|
|
|
3899
4246
|
interface FetchMyWorkspaceInvitesResponse {
|
|
3900
|
-
data:
|
|
4247
|
+
data: MyWorkspaceInvitation[];
|
|
3901
4248
|
}
|
|
3902
4249
|
/**
|
|
3903
4250
|
* The bearer-token user's LIVE pending invites (`status='pending' AND expiresAt
|
|
@@ -3917,6 +4264,11 @@ interface FetchWorkspaceAuthorityProps {
|
|
|
3917
4264
|
* Authority-as-a-service read — the bearer-token user's resolved standing
|
|
3918
4265
|
* (`{ reasons, capabilities, permissions, rank }`) on the workspace. A
|
|
3919
4266
|
* permission check is a one-line `.includes()` on the result.
|
|
4267
|
+
*
|
|
4268
|
+
* ⚠️ No `relativeRank` on this read. It is an offset from the caller, and here
|
|
4269
|
+
* the caller IS the subject — so it could only ever be `0`. `rank` is the only
|
|
4270
|
+
* rank coordinate this endpoint exposes. `relativeRank` is meaningful on the
|
|
4271
|
+
* roster and member-standing reads, where the subject is somebody else.
|
|
3920
4272
|
*/
|
|
3921
4273
|
declare function fetchWorkspaceAuthority(client: SublayHttpClient, data: FetchWorkspaceAuthorityProps): Promise<WorkspaceAuthority>;
|
|
3922
4274
|
|
|
@@ -4022,6 +4374,7 @@ declare class SublayClient {
|
|
|
4022
4374
|
connections: BoundModule<typeof Connections>;
|
|
4023
4375
|
appNotifications: BoundModule<typeof AppNotifications>;
|
|
4024
4376
|
reports: BoundModule<typeof Reports>;
|
|
4377
|
+
reputation: BoundModule<typeof Reputation>;
|
|
4025
4378
|
search: BoundModule<typeof Search>;
|
|
4026
4379
|
storage: BoundModule<typeof Storage>;
|
|
4027
4380
|
oauth: BoundModule<typeof OAuth>;
|
|
@@ -4042,4 +4395,4 @@ declare class SublayClient {
|
|
|
4042
4395
|
clearTokens(): void;
|
|
4043
4396
|
}
|
|
4044
4397
|
|
|
4045
|
-
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 PushDeviceIdentifier, type PushEventType, type PushUnbindSkipReason, type RemoveWorkspaceMemberFromSubtreeResponse, type SignOutResult, type SkippedWorkspace, type SpaceReputationContextParams, type SpaceReputationUserParams, SublayClient, type TableAccessor, type TableQuery, type TableRow, type UpdateNotificationPreferencesProps, type UserSearchParams, type WebPushSubscription, 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 };
|
|
4398
|
+
export { type AuthTokens, type BulkDeleteProps, type BulkDeleteResult, type ClientConfig, type CreateGrantProps, type DbFilter, type DbFilterOperator, type DeleteResult, type GrantSummary, type ListGrantsProps, type ListGrantsResponse, MUTE_DURATIONS, type MuteConversationProps, type MuteConversationResponse, type MuteDuration, type MyWorkspaceInvitation, type NotificationPreferences, PUSH_EVENT_TYPES, type PaginatedResponse, type PaginationMetadata, type PushDeviceIdentifier, type PushEventType, type PushUnbindSkipReason, type RemoveWorkspaceMemberFromSubtreeResponse, type ReputationGrant, type ReputationGrantSourceType, type ReputationGrantTargetFilter, type ReputationGrantTargetType, type SignOutResult, type SkippedWorkspace, type SpaceReputationContextParams, type SpaceReputationUserParams, SublayClient, type TableAccessor, type TableQuery, type TableRow, type UpdateNotificationPreferencesProps, type UserSearchParams, type WebPushSubscription, type Workspace, type WorkspaceAuthority, type WorkspaceAuthorityReason, type WorkspaceAuthorityReasonDetail, type WorkspaceCapability, type WorkspaceInvitation, type WorkspaceInvitationInviter, type WorkspaceInvitationStatus, type WorkspaceMember, type WorkspaceMemberStanding, type WorkspaceRosterCountsResponse, type WorkspaceRosterEntry, type WorkspaceRosterReason, type WorkspaceRosterResponse, type WorkspaceStandingUser };
|