chore: fix uuid generation for importers

This commit is contained in:
Mo
2023-08-07 05:06:11 -05:00
parent cedd8e1006
commit ee473fe34d
17 changed files with 94 additions and 47 deletions

View File

@@ -2,9 +2,11 @@ import { ContentType } from '@standardnotes/domain-core'
import { parseFileName } from '@standardnotes/filepicker'
import { DecryptedTransferPayload, NoteContent } from '@standardnotes/models'
import { readFileAsText } from '../Utils'
import { UuidGenerator } from '@standardnotes/utils'
import { GenerateUuid } from '@standardnotes/services'
export class PlaintextConverter {
constructor(private _generateUuid: GenerateUuid) {}
static isValidPlaintextFile(file: File): boolean {
return file.type === 'text/plain' || file.type === 'text/markdown'
}
@@ -22,7 +24,7 @@ export class PlaintextConverter {
created_at_timestamp: createdAtDate.getTime(),
updated_at: updatedAtDate,
updated_at_timestamp: updatedAtDate.getTime(),
uuid: UuidGenerator.GenerateUuid(),
uuid: this._generateUuid.execute().getValue(),
content_type: ContentType.TYPES.Note,
content: {
title: name,