chore: refactor notifications and re-enable vault tests (#2532)
* chore: refactor notifications and re-enable vault tests * fix message in error expected
This commit is contained in:
Binary file not shown.
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/models": "workspace:*",
|
||||
"@standardnotes/responses": "workspace:*",
|
||||
"@standardnotes/utils": "workspace:*",
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@electron/remote": "^2.0.9",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/electron-clear-data": "1.1.1",
|
||||
"@standardnotes/web": "workspace:*",
|
||||
"axios": "^1.1.3",
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/models": "workspace:*",
|
||||
"@standardnotes/responses": "workspace:*",
|
||||
"@standardnotes/sncrypto-common": "workspace:*",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/features": "workspace:*",
|
||||
"@standardnotes/responses": "workspace:*",
|
||||
"@standardnotes/sncrypto-common": "workspace:^",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"dependencies": {
|
||||
"@standardnotes/api": "workspace:^",
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/encryption": "workspace:^",
|
||||
"@standardnotes/features": "workspace:^",
|
||||
"@standardnotes/files": "workspace:^",
|
||||
|
||||
@@ -105,7 +105,7 @@ export class SharedVaultService
|
||||
switch (event.eventPayload.props.type.value) {
|
||||
case NotificationType.TYPES.SelfRemovedFromSharedVault: {
|
||||
const vault = this._getVault.execute<SharedVaultListingInterface>({
|
||||
sharedVaultUuid: event.eventPayload.props.sharedVaultUuid.value,
|
||||
sharedVaultUuid: event.eventPayload.props.primaryIdentifier.value,
|
||||
})
|
||||
if (!vault.isFailed()) {
|
||||
await this._deleteThirdPartyVault.execute(vault.getValue())
|
||||
@@ -113,11 +113,11 @@ export class SharedVaultService
|
||||
break
|
||||
}
|
||||
case NotificationType.TYPES.UserRemovedFromSharedVault: {
|
||||
this.vaultUsers.invalidateVaultUsersCache(event.eventPayload.props.sharedVaultUuid.value).catch(console.error)
|
||||
this.vaultUsers.invalidateVaultUsersCache(event.eventPayload.props.primaryIdentifier.value).catch(console.error)
|
||||
break
|
||||
}
|
||||
case NotificationType.TYPES.SharedVaultItemRemoved: {
|
||||
const item = this.items.findItem((event.eventPayload.props.itemUuid as Uuid).value)
|
||||
const item = this.items.findItem((event.eventPayload.props.secondaryIdentifier as Uuid).value)
|
||||
if (item) {
|
||||
void this._discardItemsLocally.execute([item])
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class SharedVaultService
|
||||
case NotificationType.TYPES.SharedVaultFileRemoved:
|
||||
case NotificationType.TYPES.SharedVaultFileUploaded: {
|
||||
const vaultOrError = this._getVault.execute<SharedVaultListingInterface>({
|
||||
sharedVaultUuid: event.eventPayload.props.sharedVaultUuid.value,
|
||||
sharedVaultUuid: event.eventPayload.props.primaryIdentifier.value,
|
||||
})
|
||||
if (!vaultOrError.isFailed()) {
|
||||
await this._syncLocalVaultsWithRemoteSharedVaults.execute([vaultOrError.getValue()])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const VaultTests = {
|
||||
enabled: false,
|
||||
enabled: true,
|
||||
exclusive: false,
|
||||
files: [
|
||||
'vaults/vaults.test.js',
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('vault key management', function () {
|
||||
|
||||
await Factory.expectThrowsAsync(
|
||||
() => context.vaults.removeItemFromVault(item),
|
||||
'Cannot find latest version of item to get vault for',
|
||||
'Cannot find vault to remove item from',
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"@babel/preset-env": "*",
|
||||
"@standardnotes/api": "workspace:*",
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/domain-events": "^2.122.0",
|
||||
"@standardnotes/encryption": "workspace:*",
|
||||
"@standardnotes/features": "workspace:*",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/features": "workspace:^",
|
||||
"@standardnotes/filepicker": "workspace:^",
|
||||
"@standardnotes/models": "workspace:^",
|
||||
|
||||
24
yarn.lock
24
yarn.lock
@@ -4138,7 +4138,7 @@ __metadata:
|
||||
resolution: "@standardnotes/api@workspace:packages/api"
|
||||
dependencies:
|
||||
"@standardnotes/common": ^1.50.0
|
||||
"@standardnotes/domain-core": ^1.32.0
|
||||
"@standardnotes/domain-core": ^1.33.1
|
||||
"@standardnotes/models": "workspace:*"
|
||||
"@standardnotes/responses": "workspace:*"
|
||||
"@standardnotes/utils": "workspace:*"
|
||||
@@ -4288,7 +4288,7 @@ __metadata:
|
||||
"@babel/core": "*"
|
||||
"@babel/preset-env": "*"
|
||||
"@electron/remote": ^2.0.9
|
||||
"@standardnotes/domain-core": ^1.32.0
|
||||
"@standardnotes/domain-core": ^1.33.1
|
||||
"@standardnotes/electron-clear-data": 1.1.1
|
||||
"@standardnotes/web": "workspace:*"
|
||||
"@types/fs-extra": ^11.0.1
|
||||
@@ -4340,12 +4340,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@standardnotes/domain-core@npm:^1.32.0":
|
||||
version: 1.32.0
|
||||
resolution: "@standardnotes/domain-core@npm:1.32.0"
|
||||
"@standardnotes/domain-core@npm:^1.33.1":
|
||||
version: 1.33.1
|
||||
resolution: "@standardnotes/domain-core@npm:1.33.1"
|
||||
dependencies:
|
||||
uuid: ^9.0.0
|
||||
checksum: 7d1263782caae6e7aefb245243f3ddc830efec707e2903d3dcb52bd5404d2c9464d3a24c2d4e04671fd9577b9c02bb8e9270b2571fe853b9469889c4b76c67a4
|
||||
checksum: 4caba6cd6fa667158aa326e43762bc466b726dfbd89e04cfc6fd6b89dce573b1be231350470fc7f1d027868bfd096096de7733256d35a7be699d693e84d29f2a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -4392,7 +4392,7 @@ __metadata:
|
||||
dependencies:
|
||||
"@standardnotes/common": ^1.50.0
|
||||
"@standardnotes/config": 2.4.3
|
||||
"@standardnotes/domain-core": ^1.32.0
|
||||
"@standardnotes/domain-core": ^1.33.1
|
||||
"@standardnotes/models": "workspace:*"
|
||||
"@standardnotes/responses": "workspace:*"
|
||||
"@standardnotes/sncrypto-common": "workspace:*"
|
||||
@@ -4427,7 +4427,7 @@ __metadata:
|
||||
resolution: "@standardnotes/features@workspace:packages/features"
|
||||
dependencies:
|
||||
"@standardnotes/common": ^1.50.0
|
||||
"@standardnotes/domain-core": ^1.32.0
|
||||
"@standardnotes/domain-core": ^1.33.1
|
||||
"@types/jest": ^29.2.3
|
||||
"@typescript-eslint/eslint-plugin": "*"
|
||||
eslint: "*"
|
||||
@@ -4633,7 +4633,7 @@ __metadata:
|
||||
resolution: "@standardnotes/models@workspace:packages/models"
|
||||
dependencies:
|
||||
"@standardnotes/common": ^1.50.0
|
||||
"@standardnotes/domain-core": ^1.32.0
|
||||
"@standardnotes/domain-core": ^1.33.1
|
||||
"@standardnotes/features": "workspace:*"
|
||||
"@standardnotes/responses": "workspace:*"
|
||||
"@standardnotes/sncrypto-common": "workspace:^"
|
||||
@@ -4729,7 +4729,7 @@ __metadata:
|
||||
dependencies:
|
||||
"@standardnotes/api": "workspace:^"
|
||||
"@standardnotes/common": ^1.50.0
|
||||
"@standardnotes/domain-core": ^1.32.0
|
||||
"@standardnotes/domain-core": ^1.33.1
|
||||
"@standardnotes/encryption": "workspace:^"
|
||||
"@standardnotes/features": "workspace:^"
|
||||
"@standardnotes/files": "workspace:^"
|
||||
@@ -4830,7 +4830,7 @@ __metadata:
|
||||
"@babel/preset-env": "*"
|
||||
"@standardnotes/api": "workspace:*"
|
||||
"@standardnotes/common": ^1.50.0
|
||||
"@standardnotes/domain-core": ^1.32.0
|
||||
"@standardnotes/domain-core": ^1.33.1
|
||||
"@standardnotes/domain-events": ^2.122.0
|
||||
"@standardnotes/encryption": "workspace:*"
|
||||
"@standardnotes/features": "workspace:*"
|
||||
@@ -4955,7 +4955,7 @@ __metadata:
|
||||
resolution: "@standardnotes/ui-services@workspace:packages/ui-services"
|
||||
dependencies:
|
||||
"@standardnotes/common": ^1.50.0
|
||||
"@standardnotes/domain-core": ^1.32.0
|
||||
"@standardnotes/domain-core": ^1.33.1
|
||||
"@standardnotes/features": "workspace:^"
|
||||
"@standardnotes/filepicker": "workspace:^"
|
||||
"@standardnotes/models": "workspace:^"
|
||||
|
||||
Reference in New Issue
Block a user