mirror of
https://github.com/outline/outline.git
synced 2026-12-05 02:44:34 +03:00
Documents can now have owners, stored as an array of user IDs. Owners must be active members or admins, and changing them requires the existing manage users permission on the document, gated behind a new DocumentOwners plan entitlement that is included in every plan. - ownerIds accepted by documents.create and documents.update and returned by the document presenter - ownerIds filter field (eq/in) for documents.list and documents.search - ownerIds on the MCP create_document and update_document tools, and an ownerId filter on list_documents - Owners section in the document Insights dialog to add and remove owners - Owner filter on the search page - In-app and email notification when a user is made an owner Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016MJXFdSZ39ZGPf31jyGcYz
85 lines
3.1 KiB
TypeScript
85 lines
3.1 KiB
TypeScript
/** Events that a user can subscribe to. */
|
|
export enum SubscriptionType {
|
|
Document = "documents.update",
|
|
}
|
|
|
|
/** Events that can trigger a notification. */
|
|
export enum NotificationEventType {
|
|
PublishDocument = "documents.publish",
|
|
UpdateDocument = "documents.update",
|
|
AddUserToDocument = "documents.add_user",
|
|
AddOwnerToDocument = "documents.add_owner",
|
|
AddUserToCollection = "collections.add_user",
|
|
AddUserToGroup = "groups.add_user",
|
|
RemoveUserFromGroup = "groups.remove_user",
|
|
CreateRevision = "revisions.create",
|
|
CreateCollection = "collections.create",
|
|
CreateComment = "comments.create",
|
|
ResolveComment = "comments.resolve",
|
|
ReactionsCreate = "reactions.create",
|
|
MentionedInDocument = "documents.mentioned",
|
|
MentionedInComment = "comments.mentioned",
|
|
GroupMentionedInDocument = "documents.group_mentioned",
|
|
GroupMentionedInComment = "comments.group_mentioned",
|
|
InviteAccepted = "emails.invite_accepted",
|
|
Onboarding = "emails.onboarding",
|
|
Features = "emails.features",
|
|
ExportCompleted = "emails.export_completed",
|
|
RequestDocumentAccess = "access_requests.create",
|
|
}
|
|
|
|
/** Channels that a notification can be delivered through. */
|
|
export enum NotificationChannelType {
|
|
App = "app",
|
|
Email = "email",
|
|
Chat = "chat",
|
|
}
|
|
|
|
/** Extra data stored on a notification. */
|
|
export type NotificationData = {
|
|
emoji?: string;
|
|
};
|
|
|
|
/** A user's notification settings, by event and optionally by channel. */
|
|
export type NotificationSettings = {
|
|
[event in NotificationEventType]?:
|
|
| {
|
|
[type in NotificationChannelType]?: boolean;
|
|
}
|
|
| boolean;
|
|
};
|
|
|
|
/** Whether each notification event is enabled when the user has no setting. */
|
|
export const NotificationEventDefaults: Record<NotificationEventType, boolean> =
|
|
{
|
|
[NotificationEventType.PublishDocument]: false,
|
|
[NotificationEventType.UpdateDocument]: true,
|
|
[NotificationEventType.CreateCollection]: false,
|
|
[NotificationEventType.CreateComment]: true,
|
|
[NotificationEventType.ResolveComment]: true,
|
|
[NotificationEventType.ReactionsCreate]: true,
|
|
[NotificationEventType.CreateRevision]: false,
|
|
[NotificationEventType.MentionedInDocument]: true,
|
|
[NotificationEventType.MentionedInComment]: true,
|
|
[NotificationEventType.GroupMentionedInDocument]: true,
|
|
[NotificationEventType.GroupMentionedInComment]: true,
|
|
[NotificationEventType.InviteAccepted]: true,
|
|
[NotificationEventType.Onboarding]: true,
|
|
[NotificationEventType.Features]: true,
|
|
[NotificationEventType.ExportCompleted]: true,
|
|
[NotificationEventType.AddUserToDocument]: true,
|
|
[NotificationEventType.AddOwnerToDocument]: true,
|
|
[NotificationEventType.AddUserToCollection]: true,
|
|
[NotificationEventType.AddUserToGroup]: true,
|
|
[NotificationEventType.RemoveUserFromGroup]: true,
|
|
[NotificationEventType.RequestDocumentAccess]: true,
|
|
};
|
|
|
|
/** Notices shown to the user from the `notice` query parameter. */
|
|
export enum QueryNotices {
|
|
UnsubscribeDocument = "unsubscribe-document",
|
|
UnsubscribeCollection = "unsubscribe-collection",
|
|
Subscribed = "subscribed",
|
|
Unsubscribed = "unsubscribed",
|
|
}
|