Compare commits

...

4 Commits

33 changed files with 178 additions and 44 deletions

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.26.15](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.26.14...@standardnotes/analytics@2.26.15) (2023-09-18)
**Note:** Version bump only for package @standardnotes/analytics
## [2.26.14](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.26.13...@standardnotes/analytics@2.26.14) (2023-09-15)
**Note:** Version bump only for package @standardnotes/analytics

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/analytics",
"version": "2.26.14",
"version": "2.26.15",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.74.13](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.74.12...@standardnotes/api-gateway@1.74.13) (2023-09-18)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.74.12](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.74.11...@standardnotes/api-gateway@1.74.12) (2023-09-15)
**Note:** Version bump only for package @standardnotes/api-gateway

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api-gateway",
"version": "1.74.12",
"version": "1.74.13",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.143.2](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.143.1...@standardnotes/auth-server@1.143.2) (2023-09-18)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.143.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.143.0...@standardnotes/auth-server@1.143.1) (2023-09-15)
### Bug Fixes
* **auth:** retrieving transition status ([66ef4be](https://github.com/standardnotes/server/commit/66ef4be656561b9c3ef9fe6359d7bbef14627a1f))
# [1.143.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.142.1...@standardnotes/auth-server@1.143.0) (2023-09-15)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/auth-server",
"version": "1.143.0",
"version": "1.143.2",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -33,6 +33,11 @@ export class RedisTransitionStatusRepository implements TransitionStatusReposito
return null
}
return TransitionStatus.create(status).getValue()
const transitionStatusOrError = TransitionStatus.create(status)
if (transitionStatusOrError.isFailed()) {
return null
}
return transitionStatusOrError.getValue()
}
}

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.30.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.29.0...@standardnotes/domain-core@1.30.0) (2023-09-18)
### Features
* add publishing notifications for users when a user is added to vault ([#834](https://github.com/standardnotes/server/issues/834)) ([547a79e](https://github.com/standardnotes/server/commit/547a79e23174dab0a756e4e5bee218e4859b3b42))
# [1.29.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.28.1...@standardnotes/domain-core@1.29.0) (2023-09-15)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-core",
"version": "1.29.0",
"version": "1.30.0",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -6,6 +6,7 @@ export class NotificationType extends ValueObject<NotificationTypeProps> {
static readonly TYPES = {
SharedVaultItemRemoved: 'shared_vault_item_removed',
RemovedFromSharedVault: 'removed_from_shared_vault',
UserAddedToSharedVault: 'user_added_to_shared_vault',
SharedVaultFileUploaded: 'shared_vault_file_uploaded',
SharedVaultFileRemoved: 'shared_vault_file_removed',
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.11.43](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.11.42...@standardnotes/event-store@1.11.43) (2023-09-18)
**Note:** Version bump only for package @standardnotes/event-store
## [1.11.42](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.11.41...@standardnotes/event-store@1.11.42) (2023-09-15)
**Note:** Version bump only for package @standardnotes/event-store

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/event-store",
"version": "1.11.42",
"version": "1.11.43",
"description": "Event Store Service",
"private": true,
"main": "dist/src/index.js",

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.22.22](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.22.21...@standardnotes/files-server@1.22.22) (2023-09-18)
**Note:** Version bump only for package @standardnotes/files-server
## [1.22.21](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.22.20...@standardnotes/files-server@1.22.21) (2023-09-15)
**Note:** Version bump only for package @standardnotes/files-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files-server",
"version": "1.22.21",
"version": "1.22.22",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.15.60](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.15.59...@standardnotes/home-server@1.15.60) (2023-09-18)
**Note:** Version bump only for package @standardnotes/home-server
## [1.15.59](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.15.58...@standardnotes/home-server@1.15.59) (2023-09-15)
**Note:** Version bump only for package @standardnotes/home-server
## [1.15.58](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.15.57...@standardnotes/home-server@1.15.58) (2023-09-15)
**Note:** Version bump only for package @standardnotes/home-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/home-server",
"version": "1.15.58",
"version": "1.15.60",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.1](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.35.0...@standardnotes/revisions-server@1.35.1) (2023-09-18)
**Note:** Version bump only for package @standardnotes/revisions-server
# [1.35.0](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.34.1...@standardnotes/revisions-server@1.35.0) (2023-09-15)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/revisions-server",
"version": "1.35.0",
"version": "1.35.1",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.20.47](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.20.46...@standardnotes/scheduler-server@1.20.47) (2023-09-18)
**Note:** Version bump only for package @standardnotes/scheduler-server
## [1.20.46](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.20.45...@standardnotes/scheduler-server@1.20.46) (2023-09-15)
**Note:** Version bump only for package @standardnotes/scheduler-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/scheduler-server",
"version": "1.20.46",
"version": "1.20.47",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.21.33](https://github.com/standardnotes/server/compare/@standardnotes/settings@1.21.32...@standardnotes/settings@1.21.33) (2023-09-18)
**Note:** Version bump only for package @standardnotes/settings
## [1.21.32](https://github.com/standardnotes/server/compare/@standardnotes/settings@1.21.31...@standardnotes/settings@1.21.32) (2023-09-15)
**Note:** Version bump only for package @standardnotes/settings

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/settings",
"version": "1.21.32",
"version": "1.21.33",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.98.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.97.0...@standardnotes/syncing-server@1.98.0) (2023-09-18)
### Features
* add publishing notifications for users when a user is added to vault ([#834](https://github.com/standardnotes/syncing-server-js/issues/834)) ([547a79e](https://github.com/standardnotes/syncing-server-js/commit/547a79e23174dab0a756e4e5bee218e4859b3b42))
# [1.97.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.96.1...@standardnotes/syncing-server@1.97.0) (2023-09-15)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/syncing-server",
"version": "1.97.0",
"version": "1.98.0",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -620,14 +620,14 @@ export class ContainerConfigLoader {
.bind<UpdateExistingItem>(TYPES.Sync_UpdateExistingItem)
.toConstantValue(
new UpdateExistingItem(
container.get(TYPES.Sync_ItemRepositoryResolver),
container.get(TYPES.Sync_Timer),
container.get(TYPES.Sync_DomainEventPublisher),
container.get(TYPES.Sync_DomainEventFactory),
container.get(TYPES.Sync_REVISIONS_FREQUENCY),
container.get(TYPES.Sync_DetermineSharedVaultOperationOnItem),
container.get(TYPES.Sync_AddNotificationForUser),
container.get(TYPES.Sync_RemoveNotificationsForUser),
container.get<ItemRepositoryResolverInterface>(TYPES.Sync_ItemRepositoryResolver),
container.get<TimerInterface>(TYPES.Sync_Timer),
container.get<DomainEventPublisherInterface>(TYPES.Sync_DomainEventPublisher),
container.get<DomainEventFactoryInterface>(TYPES.Sync_DomainEventFactory),
container.get<number>(TYPES.Sync_REVISIONS_FREQUENCY),
container.get<DetermineSharedVaultOperationOnItem>(TYPES.Sync_DetermineSharedVaultOperationOnItem),
container.get<AddNotificationsForUsers>(TYPES.Sync_AddNotificationsForUsers),
container.get<RemoveNotificationsForUser>(TYPES.Sync_RemoveNotificationsForUser),
),
)
container
@@ -710,6 +710,7 @@ export class ContainerConfigLoader {
container.get<TimerInterface>(TYPES.Sync_Timer),
container.get<DomainEventFactoryInterface>(TYPES.Sync_DomainEventFactory),
container.get<DomainEventPublisherInterface>(TYPES.Sync_DomainEventPublisher),
container.get<AddNotificationsForUsers>(TYPES.Sync_AddNotificationsForUsers),
),
)
container
@@ -756,7 +757,7 @@ export class ContainerConfigLoader {
new RemoveUserFromSharedVault(
container.get<SharedVaultUserRepositoryInterface>(TYPES.Sync_SharedVaultUserRepository),
container.get<SharedVaultRepositoryInterface>(TYPES.Sync_SharedVaultRepository),
container.get<AddNotificationForUser>(TYPES.Sync_AddNotificationForUser),
container.get<AddNotificationsForUsers>(TYPES.Sync_AddNotificationsForUsers),
container.get<DomainEventFactoryInterface>(TYPES.Sync_DomainEventFactory),
container.get<DomainEventPublisherInterface>(TYPES.Sync_DomainEventPublisher),
),

View File

@@ -1,5 +1,5 @@
import { TimerInterface } from '@standardnotes/time'
import { Result, SharedVaultUser } from '@standardnotes/domain-core'
import { NotificationPayload, Result, SharedVaultUser } from '@standardnotes/domain-core'
import { DomainEventInterface, DomainEventPublisherInterface } from '@standardnotes/domain-events'
import { SharedVaultRepositoryInterface } from '../../../SharedVault/SharedVaultRepositoryInterface'
@@ -7,6 +7,7 @@ import { SharedVaultUserRepositoryInterface } from '../../../SharedVault/User/Sh
import { AddUserToSharedVault } from './AddUserToSharedVault'
import { SharedVault } from '../../../SharedVault/SharedVault'
import { DomainEventFactoryInterface } from '../../../Event/DomainEventFactoryInterface'
import { AddNotificationsForUsers } from '../../Messaging/AddNotificationsForUsers/AddNotificationsForUsers'
describe('AddUserToSharedVault', () => {
let sharedVaultRepository: SharedVaultRepositoryInterface
@@ -15,6 +16,7 @@ describe('AddUserToSharedVault', () => {
let sharedVault: SharedVault
let domainEventFactory: DomainEventFactoryInterface
let domainEventPublisher: DomainEventPublisherInterface
let addNotificationsForUsers: AddNotificationsForUsers
const validUuid = '00000000-0000-0000-0000-000000000000'
@@ -25,6 +27,7 @@ describe('AddUserToSharedVault', () => {
timer,
domainEventFactory,
domainEventPublisher,
addNotificationsForUsers,
)
beforeEach(() => {
@@ -46,6 +49,9 @@ describe('AddUserToSharedVault', () => {
domainEventPublisher = {} as jest.Mocked<DomainEventPublisherInterface>
domainEventPublisher.publish = jest.fn()
addNotificationsForUsers = {} as jest.Mocked<AddNotificationsForUsers>
addNotificationsForUsers.execute = jest.fn().mockReturnValue(Result.ok())
})
it('should return a failure result if the shared vault uuid is invalid', async () => {
@@ -122,6 +128,39 @@ describe('AddUserToSharedVault', () => {
mockSharedVaultUser.mockRestore()
})
it('should return a failure if add notification for users fails', async () => {
addNotificationsForUsers.execute = jest.fn().mockReturnValue(Result.fail('Oops'))
const useCase = createUseCase()
const result = await useCase.execute({
sharedVaultUuid: validUuid,
userUuid: validUuid,
permission: 'read',
})
expect(result.isFailed()).toBe(true)
expect(result.getError()).toBe('Oops')
})
it('should return error if notification payload could not be created', async () => {
const mock = jest.spyOn(NotificationPayload, 'create')
mock.mockReturnValue(Result.fail('Oops'))
const useCase = createUseCase()
const result = await useCase.execute({
sharedVaultUuid: validUuid,
userUuid: validUuid,
permission: 'read',
})
expect(result.isFailed()).toBe(true)
expect(result.getError()).toBe('Oops')
mock.mockRestore()
})
it('should add a user to a shared vault', async () => {
const useCase = createUseCase()

View File

@@ -1,4 +1,6 @@
import {
NotificationPayload,
NotificationType,
Result,
SharedVaultUser,
SharedVaultUserPermission,
@@ -13,6 +15,7 @@ import { AddUserToSharedVaultDTO } from './AddUserToSharedVaultDTO'
import { SharedVaultRepositoryInterface } from '../../../SharedVault/SharedVaultRepositoryInterface'
import { SharedVaultUserRepositoryInterface } from '../../../SharedVault/User/SharedVaultUserRepositoryInterface'
import { DomainEventFactoryInterface } from '../../../Event/DomainEventFactoryInterface'
import { AddNotificationsForUsers } from '../../Messaging/AddNotificationsForUsers/AddNotificationsForUsers'
export class AddUserToSharedVault implements UseCaseInterface<SharedVaultUser> {
constructor(
@@ -21,6 +24,7 @@ export class AddUserToSharedVault implements UseCaseInterface<SharedVaultUser> {
private timer: TimerInterface,
private domainEventFactory: DomainEventFactoryInterface,
private domainEventPublisher: DomainEventPublisherInterface,
private addNotificationForUsers: AddNotificationsForUsers,
) {}
async execute(dto: AddUserToSharedVaultDTO): Promise<Result<SharedVaultUser>> {
@@ -67,6 +71,26 @@ export class AddUserToSharedVault implements UseCaseInterface<SharedVaultUser> {
await this.sharedVaultUserRepository.save(sharedVaultUser)
const notificationPayloadOrError = NotificationPayload.create({
sharedVaultUuid: sharedVaultUuid,
type: NotificationType.create(NotificationType.TYPES.UserAddedToSharedVault).getValue(),
version: '1.0',
})
if (notificationPayloadOrError.isFailed()) {
return Result.fail(notificationPayloadOrError.getError())
}
const notificationPayload = notificationPayloadOrError.getValue()
const result = await this.addNotificationForUsers.execute({
sharedVaultUuid: sharedVaultUuid.value,
type: NotificationType.TYPES.UserAddedToSharedVault,
payload: notificationPayload,
version: '1.0',
})
if (result.isFailed()) {
return Result.fail(result.getError())
}
await this.domainEventPublisher.publish(
this.domainEventFactory.createUserAddedToSharedVaultEvent({
sharedVaultUuid: sharedVaultUser.props.sharedVaultUuid.value,

View File

@@ -11,14 +11,14 @@ import { SharedVault } from '../../../SharedVault/SharedVault'
import { SharedVaultRepositoryInterface } from '../../../SharedVault/SharedVaultRepositoryInterface'
import { SharedVaultUserRepositoryInterface } from '../../../SharedVault/User/SharedVaultUserRepositoryInterface'
import { RemoveUserFromSharedVault } from './RemoveUserFromSharedVault'
import { AddNotificationForUser } from '../../Messaging/AddNotificationForUser/AddNotificationForUser'
import { DomainEventFactoryInterface } from '../../../Event/DomainEventFactoryInterface'
import { DomainEventInterface, DomainEventPublisherInterface } from '@standardnotes/domain-events'
import { AddNotificationsForUsers } from '../../Messaging/AddNotificationsForUsers/AddNotificationsForUsers'
describe('RemoveUserFromSharedVault', () => {
let sharedVaultRepository: SharedVaultRepositoryInterface
let sharedVaultUserRepository: SharedVaultUserRepositoryInterface
let addNotificationForUser: AddNotificationForUser
let addNotificationsForUsers: AddNotificationsForUsers
let sharedVault: SharedVault
let sharedVaultUser: SharedVaultUser
let domainEventFactory: DomainEventFactoryInterface
@@ -28,7 +28,7 @@ describe('RemoveUserFromSharedVault', () => {
new RemoveUserFromSharedVault(
sharedVaultUserRepository,
sharedVaultRepository,
addNotificationForUser,
addNotificationsForUsers,
domainEventFactory,
domainEventPublisher,
)
@@ -53,8 +53,8 @@ describe('RemoveUserFromSharedVault', () => {
sharedVaultUserRepository.findByUserUuidAndSharedVaultUuid = jest.fn().mockResolvedValue(sharedVaultUser)
sharedVaultUserRepository.remove = jest.fn()
addNotificationForUser = {} as jest.Mocked<AddNotificationForUser>
addNotificationForUser.execute = jest.fn().mockReturnValue(Result.ok())
addNotificationsForUsers = {} as jest.Mocked<AddNotificationsForUsers>
addNotificationsForUsers.execute = jest.fn().mockReturnValue(Result.ok())
domainEventFactory = {} as jest.Mocked<DomainEventFactoryInterface>
domainEventFactory.createUserRemovedFromSharedVaultEvent = jest
@@ -199,11 +199,11 @@ describe('RemoveUserFromSharedVault', () => {
userUuid: '00000000-0000-0000-0000-000000000001',
})
expect(addNotificationForUser.execute).toHaveBeenCalled()
expect(addNotificationsForUsers.execute).toHaveBeenCalled()
})
it('should return error if notification could not be added', async () => {
addNotificationForUser.execute = jest.fn().mockResolvedValue(Result.fail('Could not add notification'))
addNotificationsForUsers.execute = jest.fn().mockResolvedValue(Result.fail('Could not add notification'))
const useCase = createUseCase()
const result = await useCase.execute({
@@ -228,5 +228,7 @@ describe('RemoveUserFromSharedVault', () => {
expect(result.isFailed()).toBe(true)
expect(result.getError()).toBe('Oops')
mock.mockRestore()
})
})

View File

@@ -4,14 +4,14 @@ import { DomainEventPublisherInterface } from '@standardnotes/domain-events'
import { RemoveUserFromSharedVaultDTO } from './RemoveUserFromSharedVaultDTO'
import { SharedVaultRepositoryInterface } from '../../../SharedVault/SharedVaultRepositoryInterface'
import { SharedVaultUserRepositoryInterface } from '../../../SharedVault/User/SharedVaultUserRepositoryInterface'
import { AddNotificationForUser } from '../../Messaging/AddNotificationForUser/AddNotificationForUser'
import { DomainEventFactoryInterface } from '../../../Event/DomainEventFactoryInterface'
import { AddNotificationsForUsers } from '../../Messaging/AddNotificationsForUsers/AddNotificationsForUsers'
export class RemoveUserFromSharedVault implements UseCaseInterface<void> {
constructor(
private sharedVaultUsersRepository: SharedVaultUserRepositoryInterface,
private sharedVaultRepository: SharedVaultRepositoryInterface,
private addNotificationForUser: AddNotificationForUser,
private addNotificationForUsers: AddNotificationsForUsers,
private domainEventFactory: DomainEventFactoryInterface,
private domainEventPublisher: DomainEventPublisherInterface,
) {}
@@ -71,8 +71,8 @@ export class RemoveUserFromSharedVault implements UseCaseInterface<void> {
}
const notificationPayload = notificationPayloadOrError.getValue()
const result = await this.addNotificationForUser.execute({
userUuid: sharedVaultUser.props.userUuid.value,
const result = await this.addNotificationForUsers.execute({
sharedVaultUuid: sharedVault.id.toString(),
type: NotificationType.TYPES.RemovedFromSharedVault,
payload: notificationPayload,
version: '1.0',

View File

@@ -18,10 +18,10 @@ import {
import { SharedVaultAssociation } from '../../../SharedVault/SharedVaultAssociation'
import { KeySystemAssociation } from '../../../KeySystem/KeySystemAssociation'
import { DetermineSharedVaultOperationOnItem } from '../../SharedVaults/DetermineSharedVaultOperationOnItem/DetermineSharedVaultOperationOnItem'
import { AddNotificationForUser } from '../../Messaging/AddNotificationForUser/AddNotificationForUser'
import { RemoveNotificationsForUser } from '../../Messaging/RemoveNotificationsForUser/RemoveNotificationsForUser'
import { SharedVaultOperationOnItem } from '../../../SharedVault/SharedVaultOperationOnItem'
import { ItemRepositoryResolverInterface } from '../../../Item/ItemRepositoryResolverInterface'
import { AddNotificationsForUsers } from '../../Messaging/AddNotificationsForUsers/AddNotificationsForUsers'
describe('UpdateExistingItem', () => {
let itemRepository: ItemRepositoryInterface
@@ -32,7 +32,7 @@ describe('UpdateExistingItem', () => {
let itemHash1: ItemHash
let item1: Item
let determineSharedVaultOperationOnItem: DetermineSharedVaultOperationOnItem
let addNotificationForUser: AddNotificationForUser
let addNotificationsForUsers: AddNotificationsForUsers
let removeNotificationsForUser: RemoveNotificationsForUser
const createUseCase = () =>
@@ -43,7 +43,7 @@ describe('UpdateExistingItem', () => {
domainEventFactory,
5,
determineSharedVaultOperationOnItem,
addNotificationForUser,
addNotificationsForUsers,
removeNotificationsForUser,
)
@@ -128,8 +128,8 @@ describe('UpdateExistingItem', () => {
),
)
addNotificationForUser = {} as jest.Mocked<AddNotificationForUser>
addNotificationForUser.execute = jest.fn().mockReturnValue(Result.ok())
addNotificationsForUsers = {} as jest.Mocked<AddNotificationsForUsers>
addNotificationsForUsers.execute = jest.fn().mockReturnValue(Result.ok())
removeNotificationsForUser = {} as jest.Mocked<RemoveNotificationsForUser>
removeNotificationsForUser.execute = jest.fn().mockReturnValue(Result.ok())
@@ -580,7 +580,7 @@ describe('UpdateExistingItem', () => {
),
)
addNotificationForUser.execute = jest.fn().mockReturnValue(Result.fail('Oops'))
addNotificationsForUsers.execute = jest.fn().mockReturnValue(Result.fail('Oops'))
const useCase = createUseCase()

View File

@@ -20,10 +20,10 @@ import { SharedVaultAssociation } from '../../../SharedVault/SharedVaultAssociat
import { KeySystemAssociation } from '../../../KeySystem/KeySystemAssociation'
import { DetermineSharedVaultOperationOnItem } from '../../SharedVaults/DetermineSharedVaultOperationOnItem/DetermineSharedVaultOperationOnItem'
import { SharedVaultOperationOnItem } from '../../../SharedVault/SharedVaultOperationOnItem'
import { AddNotificationForUser } from '../../Messaging/AddNotificationForUser/AddNotificationForUser'
import { RemoveNotificationsForUser } from '../../Messaging/RemoveNotificationsForUser/RemoveNotificationsForUser'
import { ItemRepositoryResolverInterface } from '../../../Item/ItemRepositoryResolverInterface'
import { ItemHash } from '../../../Item/ItemHash'
import { AddNotificationsForUsers } from '../../Messaging/AddNotificationsForUsers/AddNotificationsForUsers'
export class UpdateExistingItem implements UseCaseInterface<Item> {
constructor(
@@ -33,7 +33,7 @@ export class UpdateExistingItem implements UseCaseInterface<Item> {
private domainEventFactory: DomainEventFactoryInterface,
private revisionFrequency: number,
private determineSharedVaultOperationOnItem: DetermineSharedVaultOperationOnItem,
private addNotificationForUser: AddNotificationForUser,
private addNotificationForUsers: AddNotificationsForUsers,
private removeNotificationsForUser: RemoveNotificationsForUser,
) {}
@@ -255,10 +255,10 @@ export class UpdateExistingItem implements UseCaseInterface<Item> {
}
const payload = notificationPayloadOrError.getValue()
const result = await this.addNotificationForUser.execute({
const result = await this.addNotificationForUsers.execute({
payload,
type: NotificationType.TYPES.SharedVaultItemRemoved,
userUuid: userUuid.value,
sharedVaultUuid: sharedVaultOperation.props.sharedVaultUuid.value,
version: '1.0',
})
if (result.isFailed()) {

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.10.44](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.10.43...@standardnotes/websockets-server@1.10.44) (2023-09-18)
**Note:** Version bump only for package @standardnotes/websockets-server
## [1.10.43](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.10.42...@standardnotes/websockets-server@1.10.43) (2023-09-15)
**Note:** Version bump only for package @standardnotes/websockets-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/websockets-server",
"version": "1.10.43",
"version": "1.10.44",
"engines": {
"node": ">=18.0.0 <21.0.0"
},