chore: fix ContentType usage (#2353)
* chore: fix ContentType usage * chore: fix specs
This commit is contained in:
@@ -2,7 +2,7 @@ import { MutatorClientInterface } from './../../Mutator/MutatorClientInterface'
|
||||
import { HandleTrustedSharedVaultInviteMessage } from './HandleTrustedSharedVaultInviteMessage'
|
||||
import { SyncServiceInterface } from '../../Sync/SyncServiceInterface'
|
||||
import { ContactServiceInterface } from '../../Contacts/ContactServiceInterface'
|
||||
import { ContentType } from '@standardnotes/common'
|
||||
import { ContentType } from '@standardnotes/domain-core'
|
||||
import {
|
||||
AsymmetricMessagePayloadType,
|
||||
AsymmetricMessageSharedVaultInvite,
|
||||
@@ -55,11 +55,11 @@ describe('HandleTrustedSharedVaultInviteMessage', () => {
|
||||
await handleTrustedSharedVaultInviteMessage.execute(testMessage, sharedVaultUuid, senderUuid)
|
||||
|
||||
const keySystemRootKeyCallIndex = mutatorMock.createItem.mock.calls.findIndex(
|
||||
([contentType]) => contentType === ContentType.KeySystemRootKey,
|
||||
([contentType]) => contentType === ContentType.TYPES.KeySystemRootKey,
|
||||
)
|
||||
|
||||
const vaultListingCallIndex = mutatorMock.createItem.mock.calls.findIndex(
|
||||
([contentType]) => contentType === ContentType.VaultListing,
|
||||
([contentType]) => contentType === ContentType.TYPES.VaultListing,
|
||||
)
|
||||
|
||||
expect(keySystemRootKeyCallIndex).toBeLessThan(vaultListingCallIndex)
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
VaultListingContentSpecialized,
|
||||
KeySystemRootKeyStorageMode,
|
||||
} from '@standardnotes/models'
|
||||
import { ContentType } from '@standardnotes/common'
|
||||
import { MutatorClientInterface } from '../../Mutator/MutatorClientInterface'
|
||||
import { ContentType } from '@standardnotes/domain-core'
|
||||
|
||||
export class HandleTrustedSharedVaultInviteMessage {
|
||||
constructor(
|
||||
@@ -39,12 +39,12 @@ export class HandleTrustedSharedVaultInviteMessage {
|
||||
}
|
||||
|
||||
await this.mutator.createItem<KeySystemRootKeyInterface>(
|
||||
ContentType.KeySystemRootKey,
|
||||
ContentType.TYPES.KeySystemRootKey,
|
||||
FillItemContent<KeySystemRootKeyContent>(rootKeyContent),
|
||||
true,
|
||||
)
|
||||
|
||||
await this.mutator.createItem(ContentType.VaultListing, FillItemContentSpecialized(content), true)
|
||||
await this.mutator.createItem(ContentType.TYPES.VaultListing, FillItemContentSpecialized(content), true)
|
||||
|
||||
for (const contact of trustedContacts) {
|
||||
if (contact.isMe) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
VaultListingMutator,
|
||||
} from '@standardnotes/models'
|
||||
|
||||
import { ContentType } from '@standardnotes/common'
|
||||
import { ContentType } from '@standardnotes/domain-core'
|
||||
import { GetVaultUseCase } from '../../Vaults/UseCase/GetVault'
|
||||
import { EncryptionProviderInterface } from '@standardnotes/encryption'
|
||||
|
||||
@@ -25,7 +25,7 @@ export class HandleTrustedSharedVaultRootKeyChangedMessage {
|
||||
const rootKeyContent = message.data.rootKey
|
||||
|
||||
await this.mutator.createItem<KeySystemRootKeyInterface>(
|
||||
ContentType.KeySystemRootKey,
|
||||
ContentType.TYPES.KeySystemRootKey,
|
||||
FillItemContent<KeySystemRootKeyContent>(rootKeyContent),
|
||||
true,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user