|
|
|
|
@ -7,6 +7,11 @@ import { StateService as StateServiceAbstraction } from "../abstractions/state.s
@@ -7,6 +7,11 @@ import { StateService as StateServiceAbstraction } from "../abstractions/state.s
|
|
|
|
|
|
|
|
|
|
import { StorageOptions } from "jslib-common/models/domain/storageOptions"; |
|
|
|
|
|
|
|
|
|
import { CipherData } from "jslib-common/models/data/cipherData"; |
|
|
|
|
import { CollectionData } from "jslib-common/models/data/collectionData"; |
|
|
|
|
import { FolderData } from "jslib-common/models/data/folderData"; |
|
|
|
|
import { SendData } from "jslib-common/models/data/sendData"; |
|
|
|
|
|
|
|
|
|
export class StateService |
|
|
|
|
extends BaseStateService<GlobalState, Account> |
|
|
|
|
implements StateServiceAbstraction |
|
|
|
|
@ -33,4 +38,58 @@ export class StateService
@@ -33,4 +38,58 @@ export class StateService
|
|
|
|
|
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async getEncryptedCiphers(options?: StorageOptions): Promise<{ [id: string]: CipherData }> { |
|
|
|
|
options = this.reconcileOptions(options, this.defaultInMemoryOptions); |
|
|
|
|
return await super.getEncryptedCiphers(options); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async setEncryptedCiphers( |
|
|
|
|
value: { [id: string]: CipherData }, |
|
|
|
|
options?: StorageOptions |
|
|
|
|
): Promise<void> { |
|
|
|
|
options = this.reconcileOptions(options, this.defaultInMemoryOptions); |
|
|
|
|
return await super.setEncryptedCiphers(value, options); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async getEncryptedCollections( |
|
|
|
|
options?: StorageOptions |
|
|
|
|
): Promise<{ [id: string]: CollectionData }> { |
|
|
|
|
options = this.reconcileOptions(options, this.defaultInMemoryOptions); |
|
|
|
|
return await super.getEncryptedCollections(options); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async setEncryptedCollections( |
|
|
|
|
value: { [id: string]: CollectionData }, |
|
|
|
|
options?: StorageOptions |
|
|
|
|
): Promise<void> { |
|
|
|
|
options = this.reconcileOptions(options, this.defaultInMemoryOptions); |
|
|
|
|
return await super.setEncryptedCollections(value, options); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async getEncryptedFolders(options?: StorageOptions): Promise<{ [id: string]: FolderData }> { |
|
|
|
|
options = this.reconcileOptions(options, this.defaultInMemoryOptions); |
|
|
|
|
return await super.getEncryptedFolders(options); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async setEncryptedFolders( |
|
|
|
|
value: { [id: string]: FolderData }, |
|
|
|
|
options?: StorageOptions |
|
|
|
|
): Promise<void> { |
|
|
|
|
options = this.reconcileOptions(options, this.defaultInMemoryOptions); |
|
|
|
|
return await super.setEncryptedFolders(value, options); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async getEncryptedSends(options?: StorageOptions): Promise<{ [id: string]: SendData }> { |
|
|
|
|
options = this.reconcileOptions(options, this.defaultInMemoryOptions); |
|
|
|
|
return await super.getEncryptedSends(options); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async setEncryptedSends( |
|
|
|
|
value: { [id: string]: SendData }, |
|
|
|
|
options?: StorageOptions |
|
|
|
|
): Promise<void> { |
|
|
|
|
options = this.reconcileOptions(options, this.defaultInMemoryOptions); |
|
|
|
|
return await super.setEncryptedSends(value, options); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|