inkdrop-model 2.7.2 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -92,6 +92,10 @@
92
92
  "description": "Whether the note is pinned to top",
93
93
  "type": "boolean"
94
94
  },
95
+ "timestamp": {
96
+ "description": "The date time when the revision was written, represented with Unix timestamps in milliseconds",
97
+ "type": "number"
98
+ },
95
99
  "_conflicts": {
96
100
  "description": "Conflicted revisions",
97
101
  "type": "array",
@@ -108,6 +112,7 @@
108
112
  "doctype",
109
113
  "body",
110
114
  "updatedAt",
111
- "createdAt"
115
+ "createdAt",
116
+ "timestamp"
112
117
  ]
113
118
  }
package/lib/index.esm.js CHANGED
@@ -96,6 +96,10 @@ var properties$3 = {
96
96
  description: "Whether the note is pinned to top",
97
97
  type: "boolean"
98
98
  },
99
+ timestamp: {
100
+ description: "The date time when the revision was written, represented with Unix timestamps in milliseconds",
101
+ type: "number"
102
+ },
99
103
  _conflicts: {
100
104
  description: "Conflicted revisions",
101
105
  type: "array",
@@ -112,7 +116,8 @@ var required$3 = [
112
116
  "doctype",
113
117
  "body",
114
118
  "updatedAt",
115
- "createdAt"
119
+ "createdAt",
120
+ "timestamp"
116
121
  ];
117
122
  var note = {
118
123
  $schema: $schema$3,
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/note.ts","../src/book.ts","../src/tag.ts","../src/file.ts","../src/validator.ts"],"sourcesContent":["import type { ValidateFunction } from 'ajv'\nimport NoteSchema from '../json-schema/note.json'\nimport validator from '../validators/note'\nimport type { EncryptedData } from './crypto'\nexport type TrashBookId = 'trash'\nexport type NoteStatus = 'none' | 'active' | 'onHold' | 'completed' | 'dropped'\nexport type NoteVisibility = 'private' | 'public'\nexport type NoteMetadata = {\n _id: string\n _rev?: string\n bookId: string\n doctype: string\n updatedAt: number\n createdAt: number\n tags?: string[]\n numOfTasks?: number\n numOfCheckedTasks?: number\n migratedBy?: string\n status?: NoteStatus\n share?: NoteVisibility\n pinned?: boolean\n _conflicts?: string[]\n}\nexport type Note = NoteMetadata & {\n title: string\n body: string\n}\nexport type EncryptedNote = NoteMetadata & {\n encryptedData: EncryptedData\n}\nexport const TRASH_BOOK_ID = 'trash'\n\nexport const NOTE_STATUS: {\n NONE: 'none'\n ACTIVE: 'active'\n ON_HOLD: 'onHold'\n COMPLETED: 'completed'\n DROPPED: 'dropped'\n} = {\n NONE: 'none',\n ACTIVE: 'active',\n ON_HOLD: 'onHold',\n COMPLETED: 'completed',\n DROPPED: 'dropped'\n}\nexport const NOTE_VISIBILITY: {\n PRIVATE: 'private'\n PUBLIC: 'public'\n} = {\n PRIVATE: 'private',\n PUBLIC: 'public'\n}\nconst validateNote: ValidateFunction<Note> = validator as any\nexport { NoteSchema, validateNote }\n","import type { ValidateFunction } from 'ajv'\nimport BookSchema from '../json-schema/book.json'\nimport validator from '../validators/book'\n\nimport type { EncryptedData } from './crypto'\nexport type BookMetadata = {\n _id: string\n _rev?: string\n updatedAt: number\n createdAt: number\n count?: number\n parentBookId?: null | string\n migratedBy?: string\n}\nexport type Book = BookMetadata & {\n name: string\n}\nexport type EncryptedBook = BookMetadata & {\n encryptedData: EncryptedData\n}\n\nconst validateBook: ValidateFunction<Book> = validator as any\nexport { BookSchema, validateBook }\n","import type { ValidateFunction } from 'ajv'\nimport TagSchema from '../json-schema/tag.json'\nimport validator from '../validators/tag'\nimport type { EncryptedData } from './crypto'\nexport type TagColor =\n | 'default'\n | 'red'\n | 'orange'\n | 'yellow'\n | 'olive'\n | 'green'\n | 'teal'\n | 'blue'\n | 'violet'\n | 'purple'\n | 'pink'\n | 'brown'\n | 'grey'\n | 'black'\nexport const TAG_COLOR: {\n DEFAULT: 'default'\n RED: 'red'\n ORANGE: 'orange'\n YELLOW: 'yellow'\n OLIVE: 'olive'\n GREEN: 'green'\n TEAL: 'teal'\n BLUE: 'blue'\n VIOLET: 'violet'\n PURPLE: 'purple'\n PINK: 'pink'\n BROWN: 'brown'\n GREY: 'grey'\n BLACK: 'black'\n} = {\n DEFAULT: 'default',\n RED: 'red',\n ORANGE: 'orange',\n YELLOW: 'yellow',\n OLIVE: 'olive',\n GREEN: 'green',\n TEAL: 'teal',\n BLUE: 'blue',\n VIOLET: 'violet',\n PURPLE: 'purple',\n PINK: 'pink',\n BROWN: 'brown',\n GREY: 'grey',\n BLACK: 'black'\n}\nexport type TagMetadata = {\n _id: string\n _rev?: string\n count?: number\n color: TagColor\n updatedAt: number\n createdAt: number\n}\nexport type Tag = TagMetadata & {\n name: string\n}\nexport type EncryptedTag = TagMetadata & {\n encryptedData: EncryptedData\n}\nconst validateTag: ValidateFunction<Tag> = validator as any\nexport { TagSchema, validateTag }\n","import type { ValidateFunction } from 'ajv'\nimport FileSchema from '../json-schema/file.json'\nimport validator from '../validators/file'\nimport type { EncryptionMetadata } from './crypto'\nexport type ImageFileType =\n | 'image/png'\n | 'image/jpeg'\n | 'image/jpg'\n | 'image/svg+xml'\n | 'image/gif'\n | 'image/heic'\n | 'image/heif'\nexport const supportedImageFileTypes: ReadonlyArray<ImageFileType> = [\n 'image/png',\n 'image/jpeg',\n 'image/jpg',\n 'image/svg+xml',\n 'image/gif',\n 'image/heic',\n 'image/heif'\n]\nexport const SUPPORTED_IMAGE_MIME_TYPES: {\n readonly [mime: string]: ImageFileType\n} = {\n ...supportedImageFileTypes.reduce(\n (hash, ft) => ({ ...hash, [ft.split('/')[1]]: ft }),\n {} as Record<string, ImageFileType>\n ),\n jpg: 'image/jpeg'\n}\nexport const maxAttachmentFileSize: number = 10 * 1024 * 1024\nexport type FileAttachmentItem = {\n digest?: string\n content_type: ImageFileType\n data: Buffer | string\n length?: number\n}\nexport type File = {\n _id: string\n _rev?: string\n name: string\n createdAt: number\n contentType: ImageFileType\n contentLength: number\n publicIn: string[]\n _attachments: {\n index: FileAttachmentItem\n }\n md5digest?: string\n}\nexport type EncryptedFile = File & {\n encryptionData: EncryptionMetadata\n}\nconst validateFile: ValidateFunction<File> = validator as any\nexport { FileSchema, validateFile }\n","import type { ErrorObject } from 'ajv'\n\nexport function validationErrorsToMessage(errors: ErrorObject[]): string {\n if (errors instanceof Array) {\n return errors\n .map(e => {\n if (typeof e === 'object') {\n return `\"${e.instancePath}\" ${e.message}`\n } else {\n return e\n }\n })\n .join(', ')\n } else {\n return errors\n }\n}\nexport class InvalidDataError extends Error {\n name = 'InvalidDataError'\n errors: ErrorObject[]\n\n constructor(message: string, errors: ErrorObject[]) {\n super(message + ' ' + validationErrorsToMessage(errors))\n this.errors = errors\n }\n}\n"],"names":["validator"],"mappings":"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"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/note.ts","../src/book.ts","../src/tag.ts","../src/file.ts","../src/validator.ts"],"sourcesContent":["import type { ValidateFunction } from 'ajv'\nimport NoteSchema from '../json-schema/note.json'\nimport validator from '../validators/note'\nimport type { EncryptedData } from './crypto'\nexport type TrashBookId = 'trash'\nexport type NoteStatus = 'none' | 'active' | 'onHold' | 'completed' | 'dropped'\nexport type NoteVisibility = 'private' | 'public'\nexport type NoteMetadata = {\n _id: string\n _rev?: string\n bookId: string\n doctype: string\n updatedAt: number\n createdAt: number\n tags?: string[]\n numOfTasks?: number\n numOfCheckedTasks?: number\n migratedBy?: string\n status?: NoteStatus\n share?: NoteVisibility\n pinned?: boolean\n timestamp: number\n _conflicts?: string[]\n}\nexport type Note = NoteMetadata & {\n title: string\n body: string\n}\nexport type EncryptedNote = NoteMetadata & {\n encryptedData: EncryptedData\n}\nexport const TRASH_BOOK_ID = 'trash'\n\nexport const NOTE_STATUS: Readonly<{\n NONE: 'none'\n ACTIVE: 'active'\n ON_HOLD: 'onHold'\n COMPLETED: 'completed'\n DROPPED: 'dropped'\n}> = {\n NONE: 'none',\n ACTIVE: 'active',\n ON_HOLD: 'onHold',\n COMPLETED: 'completed',\n DROPPED: 'dropped'\n}\nexport const NOTE_VISIBILITY: Readonly<{\n PRIVATE: 'private'\n PUBLIC: 'public'\n}> = {\n PRIVATE: 'private',\n PUBLIC: 'public'\n}\nconst validateNote: ValidateFunction<Note> = validator as any\nexport { NoteSchema, validateNote }\n","import type { ValidateFunction } from 'ajv'\nimport BookSchema from '../json-schema/book.json'\nimport validator from '../validators/book'\n\nimport type { EncryptedData } from './crypto'\nexport type BookMetadata = {\n _id: string\n _rev?: string\n updatedAt: number\n createdAt: number\n count?: number\n parentBookId?: null | string\n migratedBy?: string\n}\nexport type Book = BookMetadata & {\n name: string\n}\nexport type EncryptedBook = BookMetadata & {\n encryptedData: EncryptedData\n}\n\nconst validateBook: ValidateFunction<Book> = validator as any\nexport { BookSchema, validateBook }\n","import type { ValidateFunction } from 'ajv'\nimport TagSchema from '../json-schema/tag.json'\nimport validator from '../validators/tag'\nimport type { EncryptedData } from './crypto'\nexport type TagColor =\n | 'default'\n | 'red'\n | 'orange'\n | 'yellow'\n | 'olive'\n | 'green'\n | 'teal'\n | 'blue'\n | 'violet'\n | 'purple'\n | 'pink'\n | 'brown'\n | 'grey'\n | 'black'\nexport const TAG_COLOR: Readonly<{\n DEFAULT: 'default'\n RED: 'red'\n ORANGE: 'orange'\n YELLOW: 'yellow'\n OLIVE: 'olive'\n GREEN: 'green'\n TEAL: 'teal'\n BLUE: 'blue'\n VIOLET: 'violet'\n PURPLE: 'purple'\n PINK: 'pink'\n BROWN: 'brown'\n GREY: 'grey'\n BLACK: 'black'\n}> = {\n DEFAULT: 'default',\n RED: 'red',\n ORANGE: 'orange',\n YELLOW: 'yellow',\n OLIVE: 'olive',\n GREEN: 'green',\n TEAL: 'teal',\n BLUE: 'blue',\n VIOLET: 'violet',\n PURPLE: 'purple',\n PINK: 'pink',\n BROWN: 'brown',\n GREY: 'grey',\n BLACK: 'black'\n}\nexport type TagMetadata = {\n _id: string\n _rev?: string\n count?: number\n color: TagColor\n updatedAt: number\n createdAt: number\n}\nexport type Tag = TagMetadata & {\n name: string\n}\nexport type EncryptedTag = TagMetadata & {\n encryptedData: EncryptedData\n}\nconst validateTag: ValidateFunction<Tag> = validator as any\nexport { TagSchema, validateTag }\n","import type { ValidateFunction } from 'ajv'\nimport FileSchema from '../json-schema/file.json'\nimport validator from '../validators/file'\nimport type { EncryptionMetadata } from './crypto'\nexport type ImageFileType =\n | 'image/png'\n | 'image/jpeg'\n | 'image/jpg'\n | 'image/svg+xml'\n | 'image/gif'\n | 'image/heic'\n | 'image/heif'\nexport const supportedImageFileTypes: ReadonlyArray<ImageFileType> = [\n 'image/png',\n 'image/jpeg',\n 'image/jpg',\n 'image/svg+xml',\n 'image/gif',\n 'image/heic',\n 'image/heif'\n]\nexport const SUPPORTED_IMAGE_MIME_TYPES: {\n readonly [mime: string]: ImageFileType\n} = {\n ...supportedImageFileTypes.reduce(\n (hash, ft) => ({ ...hash, [ft.split('/')[1]]: ft }),\n {} as Record<string, ImageFileType>\n ),\n jpg: 'image/jpeg'\n}\nexport const maxAttachmentFileSize: number = 10 * 1024 * 1024\nexport type FileAttachmentItem = {\n digest?: string\n content_type: ImageFileType\n data: Buffer | string\n length?: number\n}\nexport type File = {\n _id: string\n _rev?: string\n name: string\n createdAt: number\n contentType: ImageFileType\n contentLength: number\n publicIn: string[]\n _attachments: {\n index: FileAttachmentItem\n }\n md5digest?: string\n}\nexport type EncryptedFile = File & {\n encryptionData: EncryptionMetadata\n}\nconst validateFile: ValidateFunction<File> = validator as any\nexport { FileSchema, validateFile }\n","import type { ErrorObject } from 'ajv'\n\nexport function validationErrorsToMessage(errors: ErrorObject[]): string {\n if (errors instanceof Array) {\n return errors\n .map(e => {\n if (typeof e === 'object') {\n return `\"${e.instancePath}\" ${e.message}`\n } else {\n return e\n }\n })\n .join(', ')\n } else {\n return errors\n }\n}\nexport class InvalidDataError extends Error {\n name = 'InvalidDataError'\n errors: ErrorObject[]\n\n constructor(message: string, errors: ErrorObject[]) {\n super(message + ' ' + validationErrorsToMessage(errors))\n this.errors = errors\n }\n}\n"],"names":["validator"],"mappings":"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"}
package/lib/index.js CHANGED
@@ -98,6 +98,10 @@ var properties$3 = {
98
98
  description: "Whether the note is pinned to top",
99
99
  type: "boolean"
100
100
  },
101
+ timestamp: {
102
+ description: "The date time when the revision was written, represented with Unix timestamps in milliseconds",
103
+ type: "number"
104
+ },
101
105
  _conflicts: {
102
106
  description: "Conflicted revisions",
103
107
  type: "array",
@@ -114,7 +118,8 @@ var required$3 = [
114
118
  "doctype",
115
119
  "body",
116
120
  "updatedAt",
117
- "createdAt"
121
+ "createdAt",
122
+ "timestamp"
118
123
  ];
119
124
  var note = {
120
125
  $schema: $schema$3,
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/note.ts","../src/book.ts","../src/tag.ts","../src/file.ts","../src/validator.ts"],"sourcesContent":["import type { ValidateFunction } from 'ajv'\nimport NoteSchema from '../json-schema/note.json'\nimport validator from '../validators/note'\nimport type { EncryptedData } from './crypto'\nexport type TrashBookId = 'trash'\nexport type NoteStatus = 'none' | 'active' | 'onHold' | 'completed' | 'dropped'\nexport type NoteVisibility = 'private' | 'public'\nexport type NoteMetadata = {\n _id: string\n _rev?: string\n bookId: string\n doctype: string\n updatedAt: number\n createdAt: number\n tags?: string[]\n numOfTasks?: number\n numOfCheckedTasks?: number\n migratedBy?: string\n status?: NoteStatus\n share?: NoteVisibility\n pinned?: boolean\n _conflicts?: string[]\n}\nexport type Note = NoteMetadata & {\n title: string\n body: string\n}\nexport type EncryptedNote = NoteMetadata & {\n encryptedData: EncryptedData\n}\nexport const TRASH_BOOK_ID = 'trash'\n\nexport const NOTE_STATUS: {\n NONE: 'none'\n ACTIVE: 'active'\n ON_HOLD: 'onHold'\n COMPLETED: 'completed'\n DROPPED: 'dropped'\n} = {\n NONE: 'none',\n ACTIVE: 'active',\n ON_HOLD: 'onHold',\n COMPLETED: 'completed',\n DROPPED: 'dropped'\n}\nexport const NOTE_VISIBILITY: {\n PRIVATE: 'private'\n PUBLIC: 'public'\n} = {\n PRIVATE: 'private',\n PUBLIC: 'public'\n}\nconst validateNote: ValidateFunction<Note> = validator as any\nexport { NoteSchema, validateNote }\n","import type { ValidateFunction } from 'ajv'\nimport BookSchema from '../json-schema/book.json'\nimport validator from '../validators/book'\n\nimport type { EncryptedData } from './crypto'\nexport type BookMetadata = {\n _id: string\n _rev?: string\n updatedAt: number\n createdAt: number\n count?: number\n parentBookId?: null | string\n migratedBy?: string\n}\nexport type Book = BookMetadata & {\n name: string\n}\nexport type EncryptedBook = BookMetadata & {\n encryptedData: EncryptedData\n}\n\nconst validateBook: ValidateFunction<Book> = validator as any\nexport { BookSchema, validateBook }\n","import type { ValidateFunction } from 'ajv'\nimport TagSchema from '../json-schema/tag.json'\nimport validator from '../validators/tag'\nimport type { EncryptedData } from './crypto'\nexport type TagColor =\n | 'default'\n | 'red'\n | 'orange'\n | 'yellow'\n | 'olive'\n | 'green'\n | 'teal'\n | 'blue'\n | 'violet'\n | 'purple'\n | 'pink'\n | 'brown'\n | 'grey'\n | 'black'\nexport const TAG_COLOR: {\n DEFAULT: 'default'\n RED: 'red'\n ORANGE: 'orange'\n YELLOW: 'yellow'\n OLIVE: 'olive'\n GREEN: 'green'\n TEAL: 'teal'\n BLUE: 'blue'\n VIOLET: 'violet'\n PURPLE: 'purple'\n PINK: 'pink'\n BROWN: 'brown'\n GREY: 'grey'\n BLACK: 'black'\n} = {\n DEFAULT: 'default',\n RED: 'red',\n ORANGE: 'orange',\n YELLOW: 'yellow',\n OLIVE: 'olive',\n GREEN: 'green',\n TEAL: 'teal',\n BLUE: 'blue',\n VIOLET: 'violet',\n PURPLE: 'purple',\n PINK: 'pink',\n BROWN: 'brown',\n GREY: 'grey',\n BLACK: 'black'\n}\nexport type TagMetadata = {\n _id: string\n _rev?: string\n count?: number\n color: TagColor\n updatedAt: number\n createdAt: number\n}\nexport type Tag = TagMetadata & {\n name: string\n}\nexport type EncryptedTag = TagMetadata & {\n encryptedData: EncryptedData\n}\nconst validateTag: ValidateFunction<Tag> = validator as any\nexport { TagSchema, validateTag }\n","import type { ValidateFunction } from 'ajv'\nimport FileSchema from '../json-schema/file.json'\nimport validator from '../validators/file'\nimport type { EncryptionMetadata } from './crypto'\nexport type ImageFileType =\n | 'image/png'\n | 'image/jpeg'\n | 'image/jpg'\n | 'image/svg+xml'\n | 'image/gif'\n | 'image/heic'\n | 'image/heif'\nexport const supportedImageFileTypes: ReadonlyArray<ImageFileType> = [\n 'image/png',\n 'image/jpeg',\n 'image/jpg',\n 'image/svg+xml',\n 'image/gif',\n 'image/heic',\n 'image/heif'\n]\nexport const SUPPORTED_IMAGE_MIME_TYPES: {\n readonly [mime: string]: ImageFileType\n} = {\n ...supportedImageFileTypes.reduce(\n (hash, ft) => ({ ...hash, [ft.split('/')[1]]: ft }),\n {} as Record<string, ImageFileType>\n ),\n jpg: 'image/jpeg'\n}\nexport const maxAttachmentFileSize: number = 10 * 1024 * 1024\nexport type FileAttachmentItem = {\n digest?: string\n content_type: ImageFileType\n data: Buffer | string\n length?: number\n}\nexport type File = {\n _id: string\n _rev?: string\n name: string\n createdAt: number\n contentType: ImageFileType\n contentLength: number\n publicIn: string[]\n _attachments: {\n index: FileAttachmentItem\n }\n md5digest?: string\n}\nexport type EncryptedFile = File & {\n encryptionData: EncryptionMetadata\n}\nconst validateFile: ValidateFunction<File> = validator as any\nexport { FileSchema, validateFile }\n","import type { ErrorObject } from 'ajv'\n\nexport function validationErrorsToMessage(errors: ErrorObject[]): string {\n if (errors instanceof Array) {\n return errors\n .map(e => {\n if (typeof e === 'object') {\n return `\"${e.instancePath}\" ${e.message}`\n } else {\n return e\n }\n })\n .join(', ')\n } else {\n return errors\n }\n}\nexport class InvalidDataError extends Error {\n name = 'InvalidDataError'\n errors: ErrorObject[]\n\n constructor(message: string, errors: ErrorObject[]) {\n super(message + ' ' + validationErrorsToMessage(errors))\n this.errors = errors\n }\n}\n"],"names":["validator"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","sources":["../src/note.ts","../src/book.ts","../src/tag.ts","../src/file.ts","../src/validator.ts"],"sourcesContent":["import type { ValidateFunction } from 'ajv'\nimport NoteSchema from '../json-schema/note.json'\nimport validator from '../validators/note'\nimport type { EncryptedData } from './crypto'\nexport type TrashBookId = 'trash'\nexport type NoteStatus = 'none' | 'active' | 'onHold' | 'completed' | 'dropped'\nexport type NoteVisibility = 'private' | 'public'\nexport type NoteMetadata = {\n _id: string\n _rev?: string\n bookId: string\n doctype: string\n updatedAt: number\n createdAt: number\n tags?: string[]\n numOfTasks?: number\n numOfCheckedTasks?: number\n migratedBy?: string\n status?: NoteStatus\n share?: NoteVisibility\n pinned?: boolean\n timestamp: number\n _conflicts?: string[]\n}\nexport type Note = NoteMetadata & {\n title: string\n body: string\n}\nexport type EncryptedNote = NoteMetadata & {\n encryptedData: EncryptedData\n}\nexport const TRASH_BOOK_ID = 'trash'\n\nexport const NOTE_STATUS: Readonly<{\n NONE: 'none'\n ACTIVE: 'active'\n ON_HOLD: 'onHold'\n COMPLETED: 'completed'\n DROPPED: 'dropped'\n}> = {\n NONE: 'none',\n ACTIVE: 'active',\n ON_HOLD: 'onHold',\n COMPLETED: 'completed',\n DROPPED: 'dropped'\n}\nexport const NOTE_VISIBILITY: Readonly<{\n PRIVATE: 'private'\n PUBLIC: 'public'\n}> = {\n PRIVATE: 'private',\n PUBLIC: 'public'\n}\nconst validateNote: ValidateFunction<Note> = validator as any\nexport { NoteSchema, validateNote }\n","import type { ValidateFunction } from 'ajv'\nimport BookSchema from '../json-schema/book.json'\nimport validator from '../validators/book'\n\nimport type { EncryptedData } from './crypto'\nexport type BookMetadata = {\n _id: string\n _rev?: string\n updatedAt: number\n createdAt: number\n count?: number\n parentBookId?: null | string\n migratedBy?: string\n}\nexport type Book = BookMetadata & {\n name: string\n}\nexport type EncryptedBook = BookMetadata & {\n encryptedData: EncryptedData\n}\n\nconst validateBook: ValidateFunction<Book> = validator as any\nexport { BookSchema, validateBook }\n","import type { ValidateFunction } from 'ajv'\nimport TagSchema from '../json-schema/tag.json'\nimport validator from '../validators/tag'\nimport type { EncryptedData } from './crypto'\nexport type TagColor =\n | 'default'\n | 'red'\n | 'orange'\n | 'yellow'\n | 'olive'\n | 'green'\n | 'teal'\n | 'blue'\n | 'violet'\n | 'purple'\n | 'pink'\n | 'brown'\n | 'grey'\n | 'black'\nexport const TAG_COLOR: Readonly<{\n DEFAULT: 'default'\n RED: 'red'\n ORANGE: 'orange'\n YELLOW: 'yellow'\n OLIVE: 'olive'\n GREEN: 'green'\n TEAL: 'teal'\n BLUE: 'blue'\n VIOLET: 'violet'\n PURPLE: 'purple'\n PINK: 'pink'\n BROWN: 'brown'\n GREY: 'grey'\n BLACK: 'black'\n}> = {\n DEFAULT: 'default',\n RED: 'red',\n ORANGE: 'orange',\n YELLOW: 'yellow',\n OLIVE: 'olive',\n GREEN: 'green',\n TEAL: 'teal',\n BLUE: 'blue',\n VIOLET: 'violet',\n PURPLE: 'purple',\n PINK: 'pink',\n BROWN: 'brown',\n GREY: 'grey',\n BLACK: 'black'\n}\nexport type TagMetadata = {\n _id: string\n _rev?: string\n count?: number\n color: TagColor\n updatedAt: number\n createdAt: number\n}\nexport type Tag = TagMetadata & {\n name: string\n}\nexport type EncryptedTag = TagMetadata & {\n encryptedData: EncryptedData\n}\nconst validateTag: ValidateFunction<Tag> = validator as any\nexport { TagSchema, validateTag }\n","import type { ValidateFunction } from 'ajv'\nimport FileSchema from '../json-schema/file.json'\nimport validator from '../validators/file'\nimport type { EncryptionMetadata } from './crypto'\nexport type ImageFileType =\n | 'image/png'\n | 'image/jpeg'\n | 'image/jpg'\n | 'image/svg+xml'\n | 'image/gif'\n | 'image/heic'\n | 'image/heif'\nexport const supportedImageFileTypes: ReadonlyArray<ImageFileType> = [\n 'image/png',\n 'image/jpeg',\n 'image/jpg',\n 'image/svg+xml',\n 'image/gif',\n 'image/heic',\n 'image/heif'\n]\nexport const SUPPORTED_IMAGE_MIME_TYPES: {\n readonly [mime: string]: ImageFileType\n} = {\n ...supportedImageFileTypes.reduce(\n (hash, ft) => ({ ...hash, [ft.split('/')[1]]: ft }),\n {} as Record<string, ImageFileType>\n ),\n jpg: 'image/jpeg'\n}\nexport const maxAttachmentFileSize: number = 10 * 1024 * 1024\nexport type FileAttachmentItem = {\n digest?: string\n content_type: ImageFileType\n data: Buffer | string\n length?: number\n}\nexport type File = {\n _id: string\n _rev?: string\n name: string\n createdAt: number\n contentType: ImageFileType\n contentLength: number\n publicIn: string[]\n _attachments: {\n index: FileAttachmentItem\n }\n md5digest?: string\n}\nexport type EncryptedFile = File & {\n encryptionData: EncryptionMetadata\n}\nconst validateFile: ValidateFunction<File> = validator as any\nexport { FileSchema, validateFile }\n","import type { ErrorObject } from 'ajv'\n\nexport function validationErrorsToMessage(errors: ErrorObject[]): string {\n if (errors instanceof Array) {\n return errors\n .map(e => {\n if (typeof e === 'object') {\n return `\"${e.instancePath}\" ${e.message}`\n } else {\n return e\n }\n })\n .join(', ')\n } else {\n return errors\n }\n}\nexport class InvalidDataError extends Error {\n name = 'InvalidDataError'\n errors: ErrorObject[]\n\n constructor(message: string, errors: ErrorObject[]) {\n super(message + ' ' + validationErrorsToMessage(errors))\n this.errors = errors\n }\n}\n"],"names":["validator"],"mappings":"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"}
package/lib/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../validators/note"),require("../validators/book"),require("../validators/tag"),require("../validators/file")):"function"==typeof define&&define.amd?define(["exports","../validators/note","../validators/book","../validators/tag","../validators/file"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).InkdropModel={},e.validator,e.validator$1,e.validator$2,e.validator$3)}(this,(function(e,t,i,n,r){"use strict";var o={$schema:"http://json-schema.org/draft-07/schema#",$id:"note",title:"Note",description:"A note data",type:"object",properties:{_id:{description:"The unique document ID which should start with `note:` and the remains are randomly generated string",type:"string",minLength:6,maxLength:128,pattern:"^note:"},_rev:{description:"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable).",type:"string"},bookId:{description:"The notebook ID",type:"string",minLength:5,maxLength:128,pattern:"^(book:|trash$)"},title:{description:"The note title",type:"string",maxLength:128},doctype:{description:"The format type of the body field. It currently can take markdown only, reserved for the future",type:"string",enum:["markdown"]},body:{description:"The content of the note represented with Markdown",type:"string",maxLength:1048576},updatedAt:{description:"The date time when the note was last updated, represented with Unix timestamps in milliseconds",type:"number"},createdAt:{description:"The date time when the note was created, represented with Unix timestamps in milliseconds",type:"number"},tags:{description:"The list of tag IDs",type:"array",items:{type:"string"},uniqueItems:!0},numOfTasks:{description:"The number of tasks, extracted from body",type:"number"},numOfCheckedTasks:{description:"The number of checked tasks, extracted from body",type:"number"},migratedBy:{description:"The type of the data migration",type:"string",maxLength:128},status:{description:"The status of the note",type:"string",enum:["none","active","onHold","completed","dropped"]},share:{description:"The sharing mode of the note",type:"string",enum:["private","public"]},pinned:{description:"Whether the note is pinned to top",type:"boolean"},_conflicts:{description:"Conflicted revisions",type:"array",items:{type:"string"},uniqueItems:!0}},required:["_id","bookId","title","doctype","body","updatedAt","createdAt"]},a=t,s={$schema:"http://json-schema.org/draft-07/schema#",$id:"book",title:"Book",description:"A notebook data",type:"object",properties:{_id:{description:"The unique notebook ID which should start with `book:` and the remains are randomly generated string",type:"string",minLength:6,maxLength:128,pattern:"^book:"},_rev:{description:"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable)",type:"string"},name:{description:"The notebook name",type:"string",minLength:1,maxLength:64},updatedAt:{description:"The date time when the notebook was last updated, represented with Unix timestamps in milliseconds",type:"number"},createdAt:{description:"The date time when the notebook was created, represented with Unix timestamps in milliseconds",type:"number"},count:{description:"It indicates the number of notes in the notebook",type:"number"},parentBookId:{description:"The ID of the parent notebook",type:["string","null"]}},required:["_id","name","updatedAt","createdAt"]},d=i,p={$schema:"http://json-schema.org/draft-07/schema#",$id:"tag",title:"Tag",description:"A note tag",type:"object",properties:{_id:{description:"The unique tag ID which should start with `tag:` and the remains are randomly generated string",type:"string",minLength:6,maxLength:128,pattern:"^tag:"},_rev:{description:"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable)",type:"string"},name:{description:"The name of the tag",type:"string",maxLength:64},count:{description:"It indicates the number of notes with the tag",type:"number"},color:{description:"The color type of the tag",type:"string",enum:["default","red","orange","yellow","olive","green","teal","blue","violet","purple","pink","brown","grey","black"]},updatedAt:{description:"The date time when the tag was last updated, represented with Unix timestamps in milliseconds",type:"number"},createdAt:{description:"The date time when the tag was created, represented with Unix timestamps in milliseconds",type:"number"}},required:["_id","name","count","updatedAt","createdAt"]},c=n,h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},h(e,t)};var m=function(){return m=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},m.apply(this,arguments)},l={$schema:"http://json-schema.org/draft-07/schema#",$id:"file",title:"File",description:"An attachment file",type:"object",properties:{_id:{description:"The unique document ID which should start with `file:` and the remains are randomly generated string",type:"string",minLength:6,maxLength:128,pattern:"^file:"},_rev:{description:"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable).",type:"string"},name:{description:"The file name",type:"string",minLength:1,maxLength:128},createdAt:{description:"The date time when the note was created, represented with Unix timestamps in milliseconds",type:"number"},contentType:{description:"The MIME type of the content",type:"string",enum:["image/png","image/jpeg","image/jpg","image/svg+xml","image/gif","image/heic","image/heif"],maxLength:128},contentLength:{description:"The content length of the file",type:"number",maximum:10485760},publicIn:{description:"An array of the note IDs where the file is included",type:"array",items:{type:"string"},uniqueItems:!0},_attachments:{description:"The attachment file",type:"object",properties:{index:{description:"The attachment file",type:"object",properties:{content_type:{description:"The content type of the file",type:"string",enum:["image/png","image/jpeg","image/jpg","image/svg+xml","image/gif","image/heic","image/heif"]},data:{description:"The file data",type:["string","object"]}},required:["content_type","data"]}},required:["index"]}},required:["_id","name","createdAt","contentType","contentLength","publicIn","_attachments"]},u=["image/png","image/jpeg","image/jpg","image/svg+xml","image/gif","image/heic","image/heif"],g=m(m({},u.reduce((function(e,t){var i;return m(m({},e),((i={})[t.split("/")[1]]=t,i))}),{})),{jpg:"image/jpeg"}),y=r;function f(e){return e instanceof Array?e.map((function(e){return"object"==typeof e?'"'.concat(e.instancePath,'" ').concat(e.message):e})).join(", "):e}var b=function(e){function t(t,i){var n=e.call(this,t+" "+f(i))||this;return n.name="InvalidDataError",n.errors=i,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(t,e),t}(Error);e.BookSchema=s,e.FileSchema=l,e.InvalidDataError=b,e.NOTE_STATUS={NONE:"none",ACTIVE:"active",ON_HOLD:"onHold",COMPLETED:"completed",DROPPED:"dropped"},e.NOTE_VISIBILITY={PRIVATE:"private",PUBLIC:"public"},e.NoteSchema=o,e.SUPPORTED_IMAGE_MIME_TYPES=g,e.TAG_COLOR={DEFAULT:"default",RED:"red",ORANGE:"orange",YELLOW:"yellow",OLIVE:"olive",GREEN:"green",TEAL:"teal",BLUE:"blue",VIOLET:"violet",PURPLE:"purple",PINK:"pink",BROWN:"brown",GREY:"grey",BLACK:"black"},e.TRASH_BOOK_ID="trash",e.TagSchema=p,e.maxAttachmentFileSize=10485760,e.supportedImageFileTypes=u,e.validateBook=d,e.validateFile=y,e.validateNote=a,e.validateTag=c,e.validationErrorsToMessage=f}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../validators/note"),require("../validators/book"),require("../validators/tag"),require("../validators/file")):"function"==typeof define&&define.amd?define(["exports","../validators/note","../validators/book","../validators/tag","../validators/file"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).InkdropModel={},e.validator,e.validator$1,e.validator$2,e.validator$3)}(this,(function(e,t,i,n,r){"use strict";var o={$schema:"http://json-schema.org/draft-07/schema#",$id:"note",title:"Note",description:"A note data",type:"object",properties:{_id:{description:"The unique document ID which should start with `note:` and the remains are randomly generated string",type:"string",minLength:6,maxLength:128,pattern:"^note:"},_rev:{description:"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable).",type:"string"},bookId:{description:"The notebook ID",type:"string",minLength:5,maxLength:128,pattern:"^(book:|trash$)"},title:{description:"The note title",type:"string",maxLength:128},doctype:{description:"The format type of the body field. It currently can take markdown only, reserved for the future",type:"string",enum:["markdown"]},body:{description:"The content of the note represented with Markdown",type:"string",maxLength:1048576},updatedAt:{description:"The date time when the note was last updated, represented with Unix timestamps in milliseconds",type:"number"},createdAt:{description:"The date time when the note was created, represented with Unix timestamps in milliseconds",type:"number"},tags:{description:"The list of tag IDs",type:"array",items:{type:"string"},uniqueItems:!0},numOfTasks:{description:"The number of tasks, extracted from body",type:"number"},numOfCheckedTasks:{description:"The number of checked tasks, extracted from body",type:"number"},migratedBy:{description:"The type of the data migration",type:"string",maxLength:128},status:{description:"The status of the note",type:"string",enum:["none","active","onHold","completed","dropped"]},share:{description:"The sharing mode of the note",type:"string",enum:["private","public"]},pinned:{description:"Whether the note is pinned to top",type:"boolean"},timestamp:{description:"The date time when the revision was written, represented with Unix timestamps in milliseconds",type:"number"},_conflicts:{description:"Conflicted revisions",type:"array",items:{type:"string"},uniqueItems:!0}},required:["_id","bookId","title","doctype","body","updatedAt","createdAt","timestamp"]},a=t,s={$schema:"http://json-schema.org/draft-07/schema#",$id:"book",title:"Book",description:"A notebook data",type:"object",properties:{_id:{description:"The unique notebook ID which should start with `book:` and the remains are randomly generated string",type:"string",minLength:6,maxLength:128,pattern:"^book:"},_rev:{description:"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable)",type:"string"},name:{description:"The notebook name",type:"string",minLength:1,maxLength:64},updatedAt:{description:"The date time when the notebook was last updated, represented with Unix timestamps in milliseconds",type:"number"},createdAt:{description:"The date time when the notebook was created, represented with Unix timestamps in milliseconds",type:"number"},count:{description:"It indicates the number of notes in the notebook",type:"number"},parentBookId:{description:"The ID of the parent notebook",type:["string","null"]}},required:["_id","name","updatedAt","createdAt"]},d=i,p={$schema:"http://json-schema.org/draft-07/schema#",$id:"tag",title:"Tag",description:"A note tag",type:"object",properties:{_id:{description:"The unique tag ID which should start with `tag:` and the remains are randomly generated string",type:"string",minLength:6,maxLength:128,pattern:"^tag:"},_rev:{description:"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable)",type:"string"},name:{description:"The name of the tag",type:"string",maxLength:64},count:{description:"It indicates the number of notes with the tag",type:"number"},color:{description:"The color type of the tag",type:"string",enum:["default","red","orange","yellow","olive","green","teal","blue","violet","purple","pink","brown","grey","black"]},updatedAt:{description:"The date time when the tag was last updated, represented with Unix timestamps in milliseconds",type:"number"},createdAt:{description:"The date time when the tag was created, represented with Unix timestamps in milliseconds",type:"number"}},required:["_id","name","count","updatedAt","createdAt"]},c=n,h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},h(e,t)};var m=function(){return m=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},m.apply(this,arguments)},l={$schema:"http://json-schema.org/draft-07/schema#",$id:"file",title:"File",description:"An attachment file",type:"object",properties:{_id:{description:"The unique document ID which should start with `file:` and the remains are randomly generated string",type:"string",minLength:6,maxLength:128,pattern:"^file:"},_rev:{description:"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable).",type:"string"},name:{description:"The file name",type:"string",minLength:1,maxLength:128},createdAt:{description:"The date time when the note was created, represented with Unix timestamps in milliseconds",type:"number"},contentType:{description:"The MIME type of the content",type:"string",enum:["image/png","image/jpeg","image/jpg","image/svg+xml","image/gif","image/heic","image/heif"],maxLength:128},contentLength:{description:"The content length of the file",type:"number",maximum:10485760},publicIn:{description:"An array of the note IDs where the file is included",type:"array",items:{type:"string"},uniqueItems:!0},_attachments:{description:"The attachment file",type:"object",properties:{index:{description:"The attachment file",type:"object",properties:{content_type:{description:"The content type of the file",type:"string",enum:["image/png","image/jpeg","image/jpg","image/svg+xml","image/gif","image/heic","image/heif"]},data:{description:"The file data",type:["string","object"]}},required:["content_type","data"]}},required:["index"]}},required:["_id","name","createdAt","contentType","contentLength","publicIn","_attachments"]},u=["image/png","image/jpeg","image/jpg","image/svg+xml","image/gif","image/heic","image/heif"],g=m(m({},u.reduce((function(e,t){var i;return m(m({},e),((i={})[t.split("/")[1]]=t,i))}),{})),{jpg:"image/jpeg"}),y=r;function f(e){return e instanceof Array?e.map((function(e){return"object"==typeof e?'"'.concat(e.instancePath,'" ').concat(e.message):e})).join(", "):e}var b=function(e){function t(t,i){var n=e.call(this,t+" "+f(i))||this;return n.name="InvalidDataError",n.errors=i,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(t,e),t}(Error);e.BookSchema=s,e.FileSchema=l,e.InvalidDataError=b,e.NOTE_STATUS={NONE:"none",ACTIVE:"active",ON_HOLD:"onHold",COMPLETED:"completed",DROPPED:"dropped"},e.NOTE_VISIBILITY={PRIVATE:"private",PUBLIC:"public"},e.NoteSchema=o,e.SUPPORTED_IMAGE_MIME_TYPES=g,e.TAG_COLOR={DEFAULT:"default",RED:"red",ORANGE:"orange",YELLOW:"yellow",OLIVE:"olive",GREEN:"green",TEAL:"teal",BLUE:"blue",VIOLET:"violet",PURPLE:"purple",PINK:"pink",BROWN:"brown",GREY:"grey",BLACK:"black"},e.TRASH_BOOK_ID="trash",e.TagSchema=p,e.maxAttachmentFileSize=10485760,e.supportedImageFileTypes=u,e.validateBook=d,e.validateFile=y,e.validateNote=a,e.validateTag=c,e.validationErrorsToMessage=f}));
package/lib/note.d.ts CHANGED
@@ -18,6 +18,7 @@ export type NoteMetadata = {
18
18
  status?: NoteStatus;
19
19
  share?: NoteVisibility;
20
20
  pinned?: boolean;
21
+ timestamp: number;
21
22
  _conflicts?: string[];
22
23
  };
23
24
  export type Note = NoteMetadata & {
@@ -28,16 +29,16 @@ export type EncryptedNote = NoteMetadata & {
28
29
  encryptedData: EncryptedData;
29
30
  };
30
31
  export declare const TRASH_BOOK_ID = "trash";
31
- export declare const NOTE_STATUS: {
32
+ export declare const NOTE_STATUS: Readonly<{
32
33
  NONE: 'none';
33
34
  ACTIVE: 'active';
34
35
  ON_HOLD: 'onHold';
35
36
  COMPLETED: 'completed';
36
37
  DROPPED: 'dropped';
37
- };
38
- export declare const NOTE_VISIBILITY: {
38
+ }>;
39
+ export declare const NOTE_VISIBILITY: Readonly<{
39
40
  PRIVATE: 'private';
40
41
  PUBLIC: 'public';
41
- };
42
+ }>;
42
43
  declare const validateNote: ValidateFunction<Note>;
43
44
  export { NoteSchema, validateNote };
package/lib/tag.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { ValidateFunction } from 'ajv';
2
2
  import TagSchema from '../json-schema/tag.json';
3
3
  import type { EncryptedData } from './crypto';
4
4
  export type TagColor = 'default' | 'red' | 'orange' | 'yellow' | 'olive' | 'green' | 'teal' | 'blue' | 'violet' | 'purple' | 'pink' | 'brown' | 'grey' | 'black';
5
- export declare const TAG_COLOR: {
5
+ export declare const TAG_COLOR: Readonly<{
6
6
  DEFAULT: 'default';
7
7
  RED: 'red';
8
8
  ORANGE: 'orange';
@@ -17,7 +17,7 @@ export declare const TAG_COLOR: {
17
17
  BROWN: 'brown';
18
18
  GREY: 'grey';
19
19
  BLACK: 'black';
20
- };
20
+ }>;
21
21
  export type TagMetadata = {
22
22
  _id: string;
23
23
  _rev?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inkdrop-model",
3
- "version": "2.7.2",
3
+ "version": "2.8.0",
4
4
  "description": "Data model for Inkdrop",
5
5
  "scripts": {
6
6
  "build": "npm-run-all build:schema build:lib doc",
@@ -1 +1 @@
1
- "use strict";module.exports = validate20;module.exports.default = validate20;const schema22 = {"$schema":"http://json-schema.org/draft-07/schema#","$id":"note","title":"Note","description":"A note data","type":"object","properties":{"_id":{"description":"The unique document ID which should start with `note:` and the remains are randomly generated string","type":"string","minLength":6,"maxLength":128,"pattern":"^note:"},"_rev":{"description":"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable).","type":"string"},"bookId":{"description":"The notebook ID","type":"string","minLength":5,"maxLength":128,"pattern":"^(book:|trash$)"},"title":{"description":"The note title","type":"string","maxLength":128},"doctype":{"description":"The format type of the body field. It currently can take markdown only, reserved for the future","type":"string","enum":["markdown"]},"body":{"description":"The content of the note represented with Markdown","type":"string","maxLength":1048576},"updatedAt":{"description":"The date time when the note was last updated, represented with Unix timestamps in milliseconds","type":"number"},"createdAt":{"description":"The date time when the note was created, represented with Unix timestamps in milliseconds","type":"number"},"tags":{"description":"The list of tag IDs","type":"array","items":{"type":"string"},"uniqueItems":true},"numOfTasks":{"description":"The number of tasks, extracted from body","type":"number"},"numOfCheckedTasks":{"description":"The number of checked tasks, extracted from body","type":"number"},"migratedBy":{"description":"The type of the data migration","type":"string","maxLength":128},"status":{"description":"The status of the note","type":"string","enum":["none","active","onHold","completed","dropped"]},"share":{"description":"The sharing mode of the note","type":"string","enum":["private","public"]},"pinned":{"description":"Whether the note is pinned to top","type":"boolean"},"_conflicts":{"description":"Conflicted revisions","type":"array","items":{"type":"string"},"uniqueItems":true}},"required":["_id","bookId","title","doctype","body","updatedAt","createdAt"]};const func4 = require("ajv/dist/runtime/ucs2length").default;const pattern0 = new RegExp("^note:", "u");const pattern1 = new RegExp("^(book:|trash$)", "u");function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="note" */;let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((((((data._id === undefined) && (missing0 = "_id")) || ((data.bookId === undefined) && (missing0 = "bookId"))) || ((data.title === undefined) && (missing0 = "title"))) || ((data.doctype === undefined) && (missing0 = "doctype"))) || ((data.body === undefined) && (missing0 = "body"))) || ((data.updatedAt === undefined) && (missing0 = "updatedAt"))) || ((data.createdAt === undefined) && (missing0 = "createdAt"))){validate20.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data._id !== undefined){let data0 = data._id;const _errs1 = errors;if(errors === _errs1){if(typeof data0 === "string"){if(func4(data0) > 128){validate20.errors = [{instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}else {if(func4(data0) < 6){validate20.errors = [{instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/minLength",keyword:"minLength",params:{limit: 6},message:"must NOT have fewer than 6 characters"}];return false;}else {if(!pattern0.test(data0)){validate20.errors = [{instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/pattern",keyword:"pattern",params:{pattern: "^note:"},message:"must match pattern \""+"^note:"+"\""}];return false;}}}}else {validate20.errors = [{instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data._rev !== undefined){const _errs3 = errors;if(typeof data._rev !== "string"){validate20.errors = [{instancePath:instancePath+"/_rev",schemaPath:"#/properties/_rev/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.bookId !== undefined){let data2 = data.bookId;const _errs5 = errors;if(errors === _errs5){if(typeof data2 === "string"){if(func4(data2) > 128){validate20.errors = [{instancePath:instancePath+"/bookId",schemaPath:"#/properties/bookId/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}else {if(func4(data2) < 5){validate20.errors = [{instancePath:instancePath+"/bookId",schemaPath:"#/properties/bookId/minLength",keyword:"minLength",params:{limit: 5},message:"must NOT have fewer than 5 characters"}];return false;}else {if(!pattern1.test(data2)){validate20.errors = [{instancePath:instancePath+"/bookId",schemaPath:"#/properties/bookId/pattern",keyword:"pattern",params:{pattern: "^(book:|trash$)"},message:"must match pattern \""+"^(book:|trash$)"+"\""}];return false;}}}}else {validate20.errors = [{instancePath:instancePath+"/bookId",schemaPath:"#/properties/bookId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.title !== undefined){let data3 = data.title;const _errs7 = errors;if(errors === _errs7){if(typeof data3 === "string"){if(func4(data3) > 128){validate20.errors = [{instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.doctype !== undefined){let data4 = data.doctype;const _errs9 = errors;if(typeof data4 !== "string"){validate20.errors = [{instancePath:instancePath+"/doctype",schemaPath:"#/properties/doctype/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(data4 === "markdown")){validate20.errors = [{instancePath:instancePath+"/doctype",schemaPath:"#/properties/doctype/enum",keyword:"enum",params:{allowedValues: schema22.properties.doctype.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.body !== undefined){let data5 = data.body;const _errs11 = errors;if(errors === _errs11){if(typeof data5 === "string"){if(func4(data5) > 1048576){validate20.errors = [{instancePath:instancePath+"/body",schemaPath:"#/properties/body/maxLength",keyword:"maxLength",params:{limit: 1048576},message:"must NOT have more than 1048576 characters"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/body",schemaPath:"#/properties/body/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs11 === errors;}else {var valid0 = true;}if(valid0){if(data.updatedAt !== undefined){let data6 = data.updatedAt;const _errs13 = errors;if(!((typeof data6 == "number") && (isFinite(data6)))){validate20.errors = [{instancePath:instancePath+"/updatedAt",schemaPath:"#/properties/updatedAt/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs13 === errors;}else {var valid0 = true;}if(valid0){if(data.createdAt !== undefined){let data7 = data.createdAt;const _errs15 = errors;if(!((typeof data7 == "number") && (isFinite(data7)))){validate20.errors = [{instancePath:instancePath+"/createdAt",schemaPath:"#/properties/createdAt/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs15 === errors;}else {var valid0 = true;}if(valid0){if(data.tags !== undefined){let data8 = data.tags;const _errs17 = errors;if(errors === _errs17){if(Array.isArray(data8)){var valid1 = true;const len0 = data8.length;for(let i0=0; i0<len0; i0++){const _errs19 = errors;if(typeof data8[i0] !== "string"){validate20.errors = [{instancePath:instancePath+"/tags/" + i0,schemaPath:"#/properties/tags/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs19 === errors;if(!valid1){break;}}if(valid1){let i1 = data8.length;let j0;if(i1 > 1){const indices0 = {};for(;i1--;){let item0 = data8[i1];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];validate20.errors = [{instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break;}indices0[item0] = i1;}}}}else {validate20.errors = [{instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs17 === errors;}else {var valid0 = true;}if(valid0){if(data.numOfTasks !== undefined){let data10 = data.numOfTasks;const _errs21 = errors;if(!((typeof data10 == "number") && (isFinite(data10)))){validate20.errors = [{instancePath:instancePath+"/numOfTasks",schemaPath:"#/properties/numOfTasks/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs21 === errors;}else {var valid0 = true;}if(valid0){if(data.numOfCheckedTasks !== undefined){let data11 = data.numOfCheckedTasks;const _errs23 = errors;if(!((typeof data11 == "number") && (isFinite(data11)))){validate20.errors = [{instancePath:instancePath+"/numOfCheckedTasks",schemaPath:"#/properties/numOfCheckedTasks/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs23 === errors;}else {var valid0 = true;}if(valid0){if(data.migratedBy !== undefined){let data12 = data.migratedBy;const _errs25 = errors;if(errors === _errs25){if(typeof data12 === "string"){if(func4(data12) > 128){validate20.errors = [{instancePath:instancePath+"/migratedBy",schemaPath:"#/properties/migratedBy/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/migratedBy",schemaPath:"#/properties/migratedBy/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs25 === errors;}else {var valid0 = true;}if(valid0){if(data.status !== undefined){let data13 = data.status;const _errs27 = errors;if(typeof data13 !== "string"){validate20.errors = [{instancePath:instancePath+"/status",schemaPath:"#/properties/status/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((((data13 === "none") || (data13 === "active")) || (data13 === "onHold")) || (data13 === "completed")) || (data13 === "dropped"))){validate20.errors = [{instancePath:instancePath+"/status",schemaPath:"#/properties/status/enum",keyword:"enum",params:{allowedValues: schema22.properties.status.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs27 === errors;}else {var valid0 = true;}if(valid0){if(data.share !== undefined){let data14 = data.share;const _errs29 = errors;if(typeof data14 !== "string"){validate20.errors = [{instancePath:instancePath+"/share",schemaPath:"#/properties/share/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((data14 === "private") || (data14 === "public"))){validate20.errors = [{instancePath:instancePath+"/share",schemaPath:"#/properties/share/enum",keyword:"enum",params:{allowedValues: schema22.properties.share.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs29 === errors;}else {var valid0 = true;}if(valid0){if(data.pinned !== undefined){const _errs31 = errors;if(typeof data.pinned !== "boolean"){validate20.errors = [{instancePath:instancePath+"/pinned",schemaPath:"#/properties/pinned/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs31 === errors;}else {var valid0 = true;}if(valid0){if(data._conflicts !== undefined){let data16 = data._conflicts;const _errs33 = errors;if(errors === _errs33){if(Array.isArray(data16)){var valid3 = true;const len1 = data16.length;for(let i2=0; i2<len1; i2++){const _errs35 = errors;if(typeof data16[i2] !== "string"){validate20.errors = [{instancePath:instancePath+"/_conflicts/" + i2,schemaPath:"#/properties/_conflicts/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid3 = _errs35 === errors;if(!valid3){break;}}if(valid3){let i3 = data16.length;let j1;if(i3 > 1){const indices1 = {};for(;i3--;){let item1 = data16[i3];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];validate20.errors = [{instancePath:instancePath+"/_conflicts",schemaPath:"#/properties/_conflicts/uniqueItems",keyword:"uniqueItems",params:{i: i3, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i3+" are identical)"}];return false;break;}indices1[item1] = i3;}}}}else {validate20.errors = [{instancePath:instancePath+"/_conflicts",schemaPath:"#/properties/_conflicts/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs33 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}}}else {validate20.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate20.errors = vErrors;return errors === 0;}
1
+ "use strict";module.exports = validate20;module.exports.default = validate20;const schema22 = {"$schema":"http://json-schema.org/draft-07/schema#","$id":"note","title":"Note","description":"A note data","type":"object","properties":{"_id":{"description":"The unique document ID which should start with `note:` and the remains are randomly generated string","type":"string","minLength":6,"maxLength":128,"pattern":"^note:"},"_rev":{"description":"This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable).","type":"string"},"bookId":{"description":"The notebook ID","type":"string","minLength":5,"maxLength":128,"pattern":"^(book:|trash$)"},"title":{"description":"The note title","type":"string","maxLength":128},"doctype":{"description":"The format type of the body field. It currently can take markdown only, reserved for the future","type":"string","enum":["markdown"]},"body":{"description":"The content of the note represented with Markdown","type":"string","maxLength":1048576},"updatedAt":{"description":"The date time when the note was last updated, represented with Unix timestamps in milliseconds","type":"number"},"createdAt":{"description":"The date time when the note was created, represented with Unix timestamps in milliseconds","type":"number"},"tags":{"description":"The list of tag IDs","type":"array","items":{"type":"string"},"uniqueItems":true},"numOfTasks":{"description":"The number of tasks, extracted from body","type":"number"},"numOfCheckedTasks":{"description":"The number of checked tasks, extracted from body","type":"number"},"migratedBy":{"description":"The type of the data migration","type":"string","maxLength":128},"status":{"description":"The status of the note","type":"string","enum":["none","active","onHold","completed","dropped"]},"share":{"description":"The sharing mode of the note","type":"string","enum":["private","public"]},"pinned":{"description":"Whether the note is pinned to top","type":"boolean"},"timestamp":{"description":"The date time when the revision was written, represented with Unix timestamps in milliseconds","type":"number"},"_conflicts":{"description":"Conflicted revisions","type":"array","items":{"type":"string"},"uniqueItems":true}},"required":["_id","bookId","title","doctype","body","updatedAt","createdAt","timestamp"]};const func4 = require("ajv/dist/runtime/ucs2length").default;const pattern0 = new RegExp("^note:", "u");const pattern1 = new RegExp("^(book:|trash$)", "u");function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="note" */;let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((((((data._id === undefined) && (missing0 = "_id")) || ((data.bookId === undefined) && (missing0 = "bookId"))) || ((data.title === undefined) && (missing0 = "title"))) || ((data.doctype === undefined) && (missing0 = "doctype"))) || ((data.body === undefined) && (missing0 = "body"))) || ((data.updatedAt === undefined) && (missing0 = "updatedAt"))) || ((data.createdAt === undefined) && (missing0 = "createdAt"))) || ((data.timestamp === undefined) && (missing0 = "timestamp"))){validate20.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data._id !== undefined){let data0 = data._id;const _errs1 = errors;if(errors === _errs1){if(typeof data0 === "string"){if(func4(data0) > 128){validate20.errors = [{instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}else {if(func4(data0) < 6){validate20.errors = [{instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/minLength",keyword:"minLength",params:{limit: 6},message:"must NOT have fewer than 6 characters"}];return false;}else {if(!pattern0.test(data0)){validate20.errors = [{instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/pattern",keyword:"pattern",params:{pattern: "^note:"},message:"must match pattern \""+"^note:"+"\""}];return false;}}}}else {validate20.errors = [{instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data._rev !== undefined){const _errs3 = errors;if(typeof data._rev !== "string"){validate20.errors = [{instancePath:instancePath+"/_rev",schemaPath:"#/properties/_rev/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.bookId !== undefined){let data2 = data.bookId;const _errs5 = errors;if(errors === _errs5){if(typeof data2 === "string"){if(func4(data2) > 128){validate20.errors = [{instancePath:instancePath+"/bookId",schemaPath:"#/properties/bookId/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}else {if(func4(data2) < 5){validate20.errors = [{instancePath:instancePath+"/bookId",schemaPath:"#/properties/bookId/minLength",keyword:"minLength",params:{limit: 5},message:"must NOT have fewer than 5 characters"}];return false;}else {if(!pattern1.test(data2)){validate20.errors = [{instancePath:instancePath+"/bookId",schemaPath:"#/properties/bookId/pattern",keyword:"pattern",params:{pattern: "^(book:|trash$)"},message:"must match pattern \""+"^(book:|trash$)"+"\""}];return false;}}}}else {validate20.errors = [{instancePath:instancePath+"/bookId",schemaPath:"#/properties/bookId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.title !== undefined){let data3 = data.title;const _errs7 = errors;if(errors === _errs7){if(typeof data3 === "string"){if(func4(data3) > 128){validate20.errors = [{instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.doctype !== undefined){let data4 = data.doctype;const _errs9 = errors;if(typeof data4 !== "string"){validate20.errors = [{instancePath:instancePath+"/doctype",schemaPath:"#/properties/doctype/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(data4 === "markdown")){validate20.errors = [{instancePath:instancePath+"/doctype",schemaPath:"#/properties/doctype/enum",keyword:"enum",params:{allowedValues: schema22.properties.doctype.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.body !== undefined){let data5 = data.body;const _errs11 = errors;if(errors === _errs11){if(typeof data5 === "string"){if(func4(data5) > 1048576){validate20.errors = [{instancePath:instancePath+"/body",schemaPath:"#/properties/body/maxLength",keyword:"maxLength",params:{limit: 1048576},message:"must NOT have more than 1048576 characters"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/body",schemaPath:"#/properties/body/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs11 === errors;}else {var valid0 = true;}if(valid0){if(data.updatedAt !== undefined){let data6 = data.updatedAt;const _errs13 = errors;if(!((typeof data6 == "number") && (isFinite(data6)))){validate20.errors = [{instancePath:instancePath+"/updatedAt",schemaPath:"#/properties/updatedAt/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs13 === errors;}else {var valid0 = true;}if(valid0){if(data.createdAt !== undefined){let data7 = data.createdAt;const _errs15 = errors;if(!((typeof data7 == "number") && (isFinite(data7)))){validate20.errors = [{instancePath:instancePath+"/createdAt",schemaPath:"#/properties/createdAt/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs15 === errors;}else {var valid0 = true;}if(valid0){if(data.tags !== undefined){let data8 = data.tags;const _errs17 = errors;if(errors === _errs17){if(Array.isArray(data8)){var valid1 = true;const len0 = data8.length;for(let i0=0; i0<len0; i0++){const _errs19 = errors;if(typeof data8[i0] !== "string"){validate20.errors = [{instancePath:instancePath+"/tags/" + i0,schemaPath:"#/properties/tags/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs19 === errors;if(!valid1){break;}}if(valid1){let i1 = data8.length;let j0;if(i1 > 1){const indices0 = {};for(;i1--;){let item0 = data8[i1];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];validate20.errors = [{instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break;}indices0[item0] = i1;}}}}else {validate20.errors = [{instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs17 === errors;}else {var valid0 = true;}if(valid0){if(data.numOfTasks !== undefined){let data10 = data.numOfTasks;const _errs21 = errors;if(!((typeof data10 == "number") && (isFinite(data10)))){validate20.errors = [{instancePath:instancePath+"/numOfTasks",schemaPath:"#/properties/numOfTasks/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs21 === errors;}else {var valid0 = true;}if(valid0){if(data.numOfCheckedTasks !== undefined){let data11 = data.numOfCheckedTasks;const _errs23 = errors;if(!((typeof data11 == "number") && (isFinite(data11)))){validate20.errors = [{instancePath:instancePath+"/numOfCheckedTasks",schemaPath:"#/properties/numOfCheckedTasks/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs23 === errors;}else {var valid0 = true;}if(valid0){if(data.migratedBy !== undefined){let data12 = data.migratedBy;const _errs25 = errors;if(errors === _errs25){if(typeof data12 === "string"){if(func4(data12) > 128){validate20.errors = [{instancePath:instancePath+"/migratedBy",schemaPath:"#/properties/migratedBy/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/migratedBy",schemaPath:"#/properties/migratedBy/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs25 === errors;}else {var valid0 = true;}if(valid0){if(data.status !== undefined){let data13 = data.status;const _errs27 = errors;if(typeof data13 !== "string"){validate20.errors = [{instancePath:instancePath+"/status",schemaPath:"#/properties/status/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((((data13 === "none") || (data13 === "active")) || (data13 === "onHold")) || (data13 === "completed")) || (data13 === "dropped"))){validate20.errors = [{instancePath:instancePath+"/status",schemaPath:"#/properties/status/enum",keyword:"enum",params:{allowedValues: schema22.properties.status.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs27 === errors;}else {var valid0 = true;}if(valid0){if(data.share !== undefined){let data14 = data.share;const _errs29 = errors;if(typeof data14 !== "string"){validate20.errors = [{instancePath:instancePath+"/share",schemaPath:"#/properties/share/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((data14 === "private") || (data14 === "public"))){validate20.errors = [{instancePath:instancePath+"/share",schemaPath:"#/properties/share/enum",keyword:"enum",params:{allowedValues: schema22.properties.share.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs29 === errors;}else {var valid0 = true;}if(valid0){if(data.pinned !== undefined){const _errs31 = errors;if(typeof data.pinned !== "boolean"){validate20.errors = [{instancePath:instancePath+"/pinned",schemaPath:"#/properties/pinned/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs31 === errors;}else {var valid0 = true;}if(valid0){if(data.timestamp !== undefined){let data16 = data.timestamp;const _errs33 = errors;if(!((typeof data16 == "number") && (isFinite(data16)))){validate20.errors = [{instancePath:instancePath+"/timestamp",schemaPath:"#/properties/timestamp/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid0 = _errs33 === errors;}else {var valid0 = true;}if(valid0){if(data._conflicts !== undefined){let data17 = data._conflicts;const _errs35 = errors;if(errors === _errs35){if(Array.isArray(data17)){var valid3 = true;const len1 = data17.length;for(let i2=0; i2<len1; i2++){const _errs37 = errors;if(typeof data17[i2] !== "string"){validate20.errors = [{instancePath:instancePath+"/_conflicts/" + i2,schemaPath:"#/properties/_conflicts/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid3 = _errs37 === errors;if(!valid3){break;}}if(valid3){let i3 = data17.length;let j1;if(i3 > 1){const indices1 = {};for(;i3--;){let item1 = data17[i3];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];validate20.errors = [{instancePath:instancePath+"/_conflicts",schemaPath:"#/properties/_conflicts/uniqueItems",keyword:"uniqueItems",params:{i: i3, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i3+" are identical)"}];return false;break;}indices1[item1] = i3;}}}}else {validate20.errors = [{instancePath:instancePath+"/_conflicts",schemaPath:"#/properties/_conflicts/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs35 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}}}}else {validate20.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate20.errors = vErrors;return errors === 0;}