mirror of
https://github.com/standardnotes/server
synced 2026-09-21 06:13:09 -04:00
feat: should be able to access shared item revisions as third party user (#807)
This commit is contained in:
@@ -9,7 +9,9 @@ import {
|
||||
NotificationAddedForUserEvent,
|
||||
RevisionsCopyRequestedEvent,
|
||||
TransitionStatusUpdatedEvent,
|
||||
UserAddedToSharedVaultEvent,
|
||||
UserInvitedToSharedVaultEvent,
|
||||
UserRemovedFromSharedVaultEvent,
|
||||
WebSocketMessageRequestedEvent,
|
||||
} from '@standardnotes/domain-events'
|
||||
import { TimerInterface } from '@standardnotes/time'
|
||||
@@ -18,6 +20,44 @@ import { DomainEventFactoryInterface } from './DomainEventFactoryInterface'
|
||||
export class DomainEventFactory implements DomainEventFactoryInterface {
|
||||
constructor(private timer: TimerInterface) {}
|
||||
|
||||
createUserRemovedFromSharedVaultEvent(dto: {
|
||||
sharedVaultUuid: string
|
||||
userUuid: string
|
||||
}): UserRemovedFromSharedVaultEvent {
|
||||
return {
|
||||
type: 'USER_REMOVED_FROM_SHARED_VAULT',
|
||||
createdAt: this.timer.getUTCDate(),
|
||||
meta: {
|
||||
correlation: {
|
||||
userIdentifier: dto.userUuid,
|
||||
userIdentifierType: 'uuid',
|
||||
},
|
||||
origin: DomainEventService.SyncingServer,
|
||||
},
|
||||
payload: dto,
|
||||
}
|
||||
}
|
||||
createUserAddedToSharedVaultEvent(dto: {
|
||||
sharedVaultUuid: string
|
||||
userUuid: string
|
||||
permission: string
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
}): UserAddedToSharedVaultEvent {
|
||||
return {
|
||||
type: 'USER_ADDED_TO_SHARED_VAULT',
|
||||
createdAt: this.timer.getUTCDate(),
|
||||
meta: {
|
||||
correlation: {
|
||||
userIdentifier: dto.userUuid,
|
||||
userIdentifierType: 'uuid',
|
||||
},
|
||||
origin: DomainEventService.SyncingServer,
|
||||
},
|
||||
payload: dto,
|
||||
}
|
||||
}
|
||||
|
||||
createUserInvitedToSharedVaultEvent(dto: {
|
||||
invite: {
|
||||
uuid: string
|
||||
|
||||
@@ -7,7 +7,9 @@ import {
|
||||
NotificationAddedForUserEvent,
|
||||
RevisionsCopyRequestedEvent,
|
||||
TransitionStatusUpdatedEvent,
|
||||
UserAddedToSharedVaultEvent,
|
||||
UserInvitedToSharedVaultEvent,
|
||||
UserRemovedFromSharedVaultEvent,
|
||||
WebSocketMessageRequestedEvent,
|
||||
} from '@standardnotes/domain-events'
|
||||
|
||||
@@ -80,4 +82,15 @@ export interface DomainEventFactoryInterface {
|
||||
userUuid: string,
|
||||
dto: { originalItemUuid: string; newItemUuid: string; roleNames: string[] },
|
||||
): RevisionsCopyRequestedEvent
|
||||
createUserAddedToSharedVaultEvent(dto: {
|
||||
sharedVaultUuid: string
|
||||
userUuid: string
|
||||
permission: string
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
}): UserAddedToSharedVaultEvent
|
||||
createUserRemovedFromSharedVaultEvent(dto: {
|
||||
sharedVaultUuid: string
|
||||
userUuid: string
|
||||
}): UserRemovedFromSharedVaultEvent
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user