fix: encryption exports (#1205)

* fix: encryptio exports

* fix: imports

* fix: items key mutator import
This commit is contained in:
Karol Sójko
2022-07-05 11:31:22 +02:00
committed by GitHub
parent d311ce40b9
commit 945248d7d3
12 changed files with 53 additions and 46 deletions

View File

@@ -7,17 +7,3 @@ export type BackupFile = {
auth_params?: AnyKeyParamsContent
items: (BackupFileDecryptedContextualPayload | BackupFileEncryptedContextualPayload)[]
}
export enum BackupFileType {
Encrypted = 'Encrypted',
/**
* Generated when an export is made from an application with no account and no passcode. The
* items are encrypted, but the items keys are not.
*/
EncryptedWithNonEncryptedItemsKey = 'EncryptedWithNonEncryptedItemsKey',
FullyDecrypted = 'FullyDecrypted',
Corrupt = 'Corrupt',
}

View File

@@ -5,7 +5,8 @@ import {
leftVersionGreaterThanOrEqualToRight,
compareVersions,
} from '@standardnotes/common'
import { BackupFile, BackupFileType } from './BackupFile'
import { BackupFile } from './BackupFile'
import { BackupFileType } from './BackupFileType'
import { extendArray } from '@standardnotes/utils'
import { EncryptionService } from '../Service/Encryption/EncryptionService'
import {
@@ -28,7 +29,7 @@ import { CreateAnyKeyParams } from '../Keys/RootKey/KeyParamsFunctions'
import { SNRootKeyParams } from '../Keys/RootKey/RootKeyParams'
import { SNRootKey } from '../Keys/RootKey/RootKey'
import { ContentTypeUsesRootKeyEncryption } from '../Keys/RootKey/Functions'
import { isItemsKey, SNItemsKey } from '../Keys/ItemsKey'
import { isItemsKey, SNItemsKey } from '../Keys/ItemsKey/ItemsKey'
export async function DecryptBackupFile(
file: BackupFile,

View File

@@ -0,0 +1,13 @@
export enum BackupFileType {
Encrypted = 'Encrypted',
/**
* Generated when an export is made from an application with no account and no passcode. The
* items are encrypted, but the items keys are not.
*/
EncryptedWithNonEncryptedItemsKey = 'EncryptedWithNonEncryptedItemsKey',
FullyDecrypted = 'FullyDecrypted',
Corrupt = 'Corrupt',
}