refactor: remove Uuid and RoleName from @standardnotes/common in favour of @standardnotes/domain-core value objects (#2167)

This commit is contained in:
Karol Sójko
2023-01-19 16:17:59 +01:00
committed by GitHub
parent 2d63b7431a
commit 856a7e3500
108 changed files with 319 additions and 374 deletions

View File

@@ -1,4 +1,4 @@
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { PayloadsChangeObserver, QueueElement, PayloadsChangeObserverCallback, EmitQueue } from './Types'
import { removeFromArray, Uuids } from '@standardnotes/utils'
import {
@@ -66,11 +66,11 @@ export class PayloadManager extends AbstractService implements PayloadManagerInt
this.collection = new PayloadCollection()
}
public find(uuids: Uuid[]): FullyFormedPayloadInterface[] {
public find(uuids: string[]): FullyFormedPayloadInterface[] {
return this.collection.findAll(uuids)
}
public findOne(uuid: Uuid): FullyFormedPayloadInterface | undefined {
public findOne(uuid: string): FullyFormedPayloadInterface | undefined {
return this.collection.findAll([uuid])[0]
}
@@ -288,7 +288,7 @@ export class PayloadManager extends AbstractService implements PayloadManagerInt
* and marks the items as dirty.
* @returns Resulting items
*/
public async importPayloads(payloads: DecryptedPayloadInterface[], historyMap: HistoryMap): Promise<Uuid[]> {
public async importPayloads(payloads: DecryptedPayloadInterface[], historyMap: HistoryMap): Promise<string[]> {
const sourcedPayloads = payloads.map((p) => p.copy(undefined, PayloadSource.FileImport))
const delta = new DeltaFileImport(this.getMasterCollection(), sourcedPayloads, historyMap)