@daihum/record-formats 0.1.0 → 0.1.1
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.
- package/README.md +21 -0
- package/dist/archive-description/index.d.ts +163 -0
- package/dist/archive-description/index.d.ts.map +1 -0
- package/dist/archive-description/index.js +1256 -0
- package/dist/archive-description/index.js.map +1 -0
- package/dist/ead3/index.d.ts +4 -158
- package/dist/ead3/index.js +4 -519
- package/dist/ead3-DM2in-ck.js +592 -0
- package/dist/ead3-DM2in-ck.js.map +1 -0
- package/dist/{index-90ZPmZ85.d.ts → index-BNudmNFx.d.ts} +2 -2
- package/dist/{index-90ZPmZ85.d.ts.map → index-BNudmNFx.d.ts.map} +1 -1
- package/dist/index-DxjnI5KZ.d.ts +168 -0
- package/dist/index-DxjnI5KZ.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{result-YrPe5I9D.js → result-Cl7IY6PN.js} +1 -1
- package/dist/{result-YrPe5I9D.js.map → result-Cl7IY6PN.js.map} +1 -1
- package/dist/{result-Dd9q1uJU.d.ts → result-D7vcrlFh.d.ts} +1 -1
- package/dist/{result-Dd9q1uJU.d.ts.map → result-D7vcrlFh.d.ts.map} +1 -1
- package/dist/xml/index.d.ts +2 -2
- package/dist/xml/index.js +2 -2
- package/dist/{xml-6kdXnoBh.js → xml-DXtayJiw.js} +2 -2
- package/dist/{xml-6kdXnoBh.js.map → xml-DXtayJiw.js.map} +1 -1
- package/package.json +9 -1
- package/dist/ead3/index.d.ts.map +0 -1
- package/dist/ead3/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["issues: FormatIssue[]","value: unknown","issues: FormatIssue[]","issues: FormatIssue[]","findingAid: Ead3FindingAid","record: ArchiveDescriptionRecord"],"sources":["../../src/archive-description/types.ts","../../src/archive-description/identity.ts","../../src/archive-description/rfc3339.ts","../../src/archive-description/archive-description.ts","../../src/archive-description/dacs.ts","../../src/archive-description/ead3-projection.ts","../../src/archive-description/json-schema.ts"],"sourcesContent":["export const ARCHIVE_DESCRIPTION_SCHEMA = 'archive-description.v1' as const;\n\nexport type ArchiveDescriptionSchema = typeof ARCHIVE_DESCRIPTION_SCHEMA;\n\nexport type ArchiveDescriptionLevel =\n | 'collection'\n | 'series'\n | 'subseries'\n | 'file'\n | 'item'\n | 'otherlevel';\n\nexport type ArchiveDescriptionMaintenanceStatus =\n | 'new'\n | 'revised'\n | 'deleted'\n | 'derived'\n | 'unknown';\n\nexport type ArchiveDescriptionDate = Readonly<{\n expression: string;\n normalized?: string;\n type?: string;\n certainty?: string;\n}>;\n\nexport type ArchiveDescriptionAccessPointType =\n | 'person'\n | 'family'\n | 'organization'\n | 'place'\n | 'subject'\n | 'documentaryForm'\n | 'occupation'\n | 'function'\n | (string & Record<never, never>);\n\nexport type ArchiveDescriptionAccessPoint = Readonly<{\n type: ArchiveDescriptionAccessPointType;\n label: string;\n identifier?: string;\n source?: string;\n}>;\n\n/** A product-neutral reference to material, a representation, or an annotation. */\nexport type ArchiveDescriptionTargetRef = Readonly<{\n kind: string;\n id: string;\n href?: string;\n label?: string;\n role?: string;\n locator?: Readonly<Record<string, unknown>>;\n metadata?: Readonly<Record<string, unknown>>;\n}>;\n\nexport type ArchiveDescriptionReviewStatus =\n | 'unreviewed'\n | 'needs_review'\n | 'accepted'\n | 'rejected';\n\nexport type ArchiveDescriptionProvenance = Readonly<{\n createdBy: string;\n createdAt: string;\n method: string;\n rules?: readonly string[];\n tool?: string;\n model?: string;\n reviewStatus?: ArchiveDescriptionReviewStatus;\n reviewedBy?: string;\n reviewedAt?: string;\n}>;\n\nexport type ArchiveDescriptionSourceDiagnostic = Readonly<{\n severity: 'error' | 'warning' | 'info';\n code: string;\n message: string;\n path?: readonly string[];\n}>;\n\nexport type ArchiveDescriptionSourceRecord = Readonly<{\n id: string;\n producer: string;\n format?: string;\n source?: string;\n retrievedAt?: string;\n raw?: unknown;\n mappedFields?: readonly string[];\n unmappedFields?: unknown;\n diagnostics?: readonly ArchiveDescriptionSourceDiagnostic[];\n}>;\n\nexport type ArchiveDescriptionVendorExtension = Readonly<{\n namespace: string;\n name: string;\n value: unknown;\n}>;\n\nexport type ArchiveDescriptionExtensions = Readonly<{\n ead3?: Readonly<Record<string, unknown>>;\n vendor?: readonly ArchiveDescriptionVendorExtension[];\n}>;\n\nexport type ArchiveDescriptionNode = Readonly<{\n /** Stable identity. It must not be derived from array position. */\n id: string;\n level: ArchiveDescriptionLevel;\n otherLevel?: string;\n title: string;\n referenceCode?: string;\n repository?: string;\n dates?: readonly ArchiveDescriptionDate[];\n extent?: string;\n creator?: string;\n creatorStatus?: 'known' | 'unknown' | 'not_applicable';\n abstract?: string;\n scopeContent?: string;\n arrangement?: string;\n accessRestriction?: string;\n useRestriction?: string;\n language?: string;\n biographicalHistory?: string;\n custodialHistory?: string;\n acquisitionInformation?: string;\n appraisal?: string;\n processingInformation?: string;\n relatedMaterial?: string;\n separatedMaterial?: string;\n preferredCitation?: string;\n notes?: readonly string[];\n accessPoints?: readonly ArchiveDescriptionAccessPoint[];\n targets?: readonly ArchiveDescriptionTargetRef[];\n provenance?: ArchiveDescriptionProvenance;\n subItems?: readonly ArchiveDescriptionNode[];\n extensions?: ArchiveDescriptionExtensions;\n}>;\n\nexport type ArchiveDescriptionRecord = Readonly<{\n schema: ArchiveDescriptionSchema;\n recordId: string;\n title: string;\n maintenanceStatus?: ArchiveDescriptionMaintenanceStatus;\n language?: string;\n agencyName?: string;\n description: ArchiveDescriptionNode;\n provenance: ArchiveDescriptionProvenance;\n sourceRecords?: readonly ArchiveDescriptionSourceRecord[];\n extensions?: ArchiveDescriptionExtensions;\n}>;\n\nexport type ArchiveDescriptionSerializeOptions = Readonly<{\n format?: boolean;\n}>;\n","import { ARCHIVE_DESCRIPTION_SCHEMA } from './types.js';\n\nexport const ARCHIVE_DESCRIPTION_SCHEMA_ID =\n 'https://daihum.dev/schema/record-formats/archive-description.v1.json';\nexport const ARCHIVE_DESCRIPTION_SCHEMA_TITLE = 'DAIHUM Archive Description';\nexport const ARCHIVE_DESCRIPTION_SCHEMA_VERSION = ARCHIVE_DESCRIPTION_SCHEMA;\n\nexport function canonicalJson(value: unknown): string {\n return JSON.stringify(value, (_key, item) => {\n if (item && typeof item === 'object' && !Array.isArray(item)) {\n const record = item as Record<string, unknown>;\n return Object.keys(record)\n .sort()\n .reduce<Record<string, unknown>>((result, key) => {\n result[key] = record[key];\n return result;\n }, {});\n }\n return item;\n });\n}\n\nexport function contentHash(input: string): string {\n let h1 = 0xdeadbeef;\n let h2 = 0x41c6ce57;\n for (let index = 0; index < input.length; index += 1) {\n const code = input.charCodeAt(index);\n h1 = Math.imul(h1 ^ code, 2654435761);\n h2 = Math.imul(h2 ^ code, 1597334677);\n }\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n const value = 4294967296 * (2097151 & h2) + (h1 >>> 0);\n return value.toString(16).padStart(14, '0');\n}\n","const RFC3339_DATE_TIME =\n /^(\\d{4})-(\\d{2})-(\\d{2})[Tt](\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d+)?(?:[Zz]|([+-])(\\d{2}):(\\d{2}))$/;\n\nfunction isLeapYear(year: number): boolean {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nfunction daysInMonth(year: number, month: number): number {\n if (month === 2) return isLeapYear(year) ? 29 : 28;\n return [4, 6, 9, 11].includes(month) ? 30 : 31;\n}\n\nfunction isValidLeapSecond(\n year: number,\n month: number,\n day: number,\n hour: number,\n minute: number,\n offsetSign: string | undefined,\n offsetHour: number,\n offsetMinute: number,\n): boolean {\n const signedOffset = offsetSign === '-' ? -1 : 1;\n const utc = new Date(Date.UTC(year, month - 1, day, hour, minute, 59) -\n signedOffset * (offsetHour * 60 + offsetMinute) * 60_000);\n return utc.getUTCHours() === 23 &&\n utc.getUTCMinutes() === 59 &&\n ((utc.getUTCMonth() === 5 && utc.getUTCDate() === 30) ||\n (utc.getUTCMonth() === 11 && utc.getUTCDate() === 31));\n}\n\n/** Strict RFC 3339 date-time validation, including calendar and leap-second checks. */\nexport function isRfc3339DateTime(value: string): boolean {\n const match = RFC3339_DATE_TIME.exec(value);\n if (!match) return false;\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const hour = Number(match[4]);\n const minute = Number(match[5]);\n const second = Number(match[6]);\n const offsetHour = Number(match[8] ?? 0);\n const offsetMinute = Number(match[9] ?? 0);\n if (year < 1 || month < 1 || month > 12) return false;\n if (day < 1 || day > daysInMonth(year, month)) return false;\n if (hour > 23 || minute > 59 || offsetHour > 23 || offsetMinute > 59) return false;\n if (second < 60) return true;\n if (second > 60) return false;\n return isValidLeapSecond(\n year,\n month,\n day,\n hour,\n minute,\n match[7],\n offsetHour,\n offsetMinute,\n );\n}\n","import {\n createFormatIssue,\n formatFail,\n formatOk,\n hasFormatErrors,\n type FormatIssue,\n type ParseResult,\n type RecordFormatAdapter,\n type SerializeResult,\n} from '../result.js';\nimport { canonicalJson } from './identity.js';\nimport { isRfc3339DateTime } from './rfc3339.js';\nimport {\n ARCHIVE_DESCRIPTION_SCHEMA,\n type ArchiveDescriptionNode,\n type ArchiveDescriptionProvenance,\n type ArchiveDescriptionRecord,\n type ArchiveDescriptionSerializeOptions,\n} from './types.js';\n\nexport const ARCHIVE_DESCRIPTION_FORMAT_ID = 'archive-description';\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction isDateTimeString(value: unknown): value is string {\n return typeof value === 'string' && isRfc3339DateTime(value);\n}\n\nfunction validateAllowedKeys(\n value: Record<string, unknown>,\n allowed: ReadonlySet<string>,\n path: string,\n issues: FormatIssue[],\n): void {\n for (const key of Object.keys(value)) {\n if (!allowed.has(key)) {\n issues.push(issue({\n code: 'archive.property.unknown',\n path: path ? `${path}.${key}` : key,\n message: `Unknown archive-description property \"${key}\".`,\n }));\n }\n }\n}\n\nfunction validateOptionalStrings(\n value: Record<string, unknown>,\n fields: readonly string[],\n path: string,\n issues: FormatIssue[],\n): void {\n for (const field of fields) {\n if (value[field] !== undefined && typeof value[field] !== 'string') {\n issues.push(issue({\n code: 'archive.string.invalid',\n path: path ? `${path}.${field}` : field,\n message: `${path ? `${path}.` : ''}${field} must be a string.`,\n }));\n }\n }\n}\n\nfunction issue(params: {\n code: string;\n path: string;\n message: string;\n severity?: 'error' | 'warning';\n cause?: unknown;\n}): FormatIssue {\n return createFormatIssue({\n severity: params.severity ?? 'error',\n format: ARCHIVE_DESCRIPTION_FORMAT_ID,\n code: params.code,\n path: params.path,\n message: params.message,\n ...(params.cause !== undefined ? { cause: params.cause } : {}),\n });\n}\n\nfunction validateStringArray(value: unknown, path: string, issues: FormatIssue[]): void {\n if (value === undefined) return;\n if (!Array.isArray(value)) {\n issues.push(issue({ code: 'archive.array.required', path, message: `${path} must be an array.` }));\n return;\n }\n value.forEach((item, index) => {\n if (!isNonEmptyString(item)) {\n issues.push(issue({\n code: 'archive.string.required',\n path: `${path}.${index}`,\n message: `${path}.${index} must be a non-empty string.`,\n }));\n }\n });\n}\n\nfunction validateProvenance(\n value: unknown,\n path: string,\n issues: FormatIssue[],\n): value is ArchiveDescriptionProvenance {\n if (!isRecord(value)) {\n issues.push(issue({ code: 'archive.provenance.required', path, message: `${path} is required.` }));\n return false;\n }\n validateAllowedKeys(value, new Set([\n 'createdBy', 'createdAt', 'method', 'rules', 'tool', 'model', 'reviewStatus',\n 'reviewedBy', 'reviewedAt',\n ]), path, issues);\n for (const field of ['createdBy', 'createdAt', 'method'] as const) {\n if (!isNonEmptyString(value[field])) {\n issues.push(issue({\n code: `archive.provenance.${field}.required`,\n path: `${path}.${field}`,\n message: `${path}.${field} is required.`,\n }));\n }\n }\n if (isNonEmptyString(value['createdAt']) && !isDateTimeString(value['createdAt'])) {\n issues.push(issue({\n code: 'archive.provenance.createdAt.invalid',\n path: `${path}.createdAt`,\n message: `${path}.createdAt must be an RFC 3339 date-time.`,\n }));\n }\n validateStringArray(value['rules'], `${path}.rules`, issues);\n validateOptionalStrings(value, ['tool', 'model', 'reviewedBy', 'reviewedAt'], path, issues);\n if (value['reviewedAt'] !== undefined && !isDateTimeString(value['reviewedAt'])) {\n issues.push(issue({\n code: 'archive.provenance.reviewedAt.invalid',\n path: `${path}.reviewedAt`,\n message: `${path}.reviewedAt must be an RFC 3339 date-time.`,\n }));\n }\n if (\n value['reviewStatus'] !== undefined &&\n !['unreviewed', 'needs_review', 'accepted', 'rejected'].includes(String(value['reviewStatus']))\n ) {\n issues.push(issue({\n code: 'archive.provenance.reviewStatus.invalid',\n path: `${path}.reviewStatus`,\n message: 'Provenance reviewStatus is invalid.',\n }));\n }\n if (isNonEmptyString(value['method']) && value['method'].startsWith('model:') && !isNonEmptyString(value['model'])) {\n issues.push(issue({\n severity: 'warning',\n code: 'archive.provenance.model.recommended',\n path: `${path}.model`,\n message: 'Machine-generated descriptions should identify the model.',\n }));\n }\n return true;\n}\n\nfunction validateExtensions(value: unknown, path: string, issues: FormatIssue[]): void {\n if (value === undefined) return;\n if (!isRecord(value)) {\n issues.push(issue({ code: 'archive.extensions.invalid', path, message: `${path} must be an object.` }));\n return;\n }\n validateAllowedKeys(value, new Set(['ead3', 'vendor']), path, issues);\n if (value['ead3'] !== undefined && !isRecord(value['ead3'])) {\n issues.push(issue({\n code: 'archive.extensions.value.invalid',\n path: `${path}.ead3`,\n message: `${path}.ead3 must be an object.`,\n }));\n }\n if (value['vendor'] !== undefined) {\n if (!Array.isArray(value['vendor'])) {\n issues.push(issue({\n code: 'archive.extensions.value.invalid',\n path: `${path}.vendor`,\n message: `${path}.vendor must be an array.`,\n }));\n } else {\n value['vendor'].forEach((extension, index) => {\n const extensionPath = `${path}.vendor.${index}`;\n if (!isRecord(extension)) {\n issues.push(issue({ code: 'archive.vendorExtension.invalid', path: extensionPath, message: 'Vendor extension must be an object.' }));\n return;\n }\n validateAllowedKeys(extension, new Set(['namespace', 'name', 'value']), extensionPath, issues);\n for (const field of ['namespace', 'name'] as const) {\n if (!isNonEmptyString(extension[field])) {\n issues.push(issue({ code: `archive.vendorExtension.${field}.required`, path: `${extensionPath}.${field}`, message: `Vendor extension ${field} is required.` }));\n }\n }\n if (!Object.prototype.hasOwnProperty.call(extension, 'value')) {\n issues.push(issue({ code: 'archive.vendorExtension.value.required', path: `${extensionPath}.value`, message: 'Vendor extension value is required.' }));\n }\n });\n }\n }\n}\n\nfunction validateSourceRecords(value: unknown, path: string, issues: FormatIssue[]): void {\n if (value === undefined) return;\n if (!Array.isArray(value)) {\n issues.push(issue({ code: 'archive.sourceRecords.invalid', path, message: `${path} must be an array.` }));\n return;\n }\n value.forEach((sourceRecord, index) => {\n const itemPath = `${path}.${index}`;\n if (!isRecord(sourceRecord)) {\n issues.push(issue({ code: 'archive.sourceRecord.invalid', path: itemPath, message: `${itemPath} must be an object.` }));\n return;\n }\n validateAllowedKeys(sourceRecord, new Set([\n 'id', 'producer', 'format', 'source', 'retrievedAt', 'raw', 'mappedFields',\n 'unmappedFields', 'diagnostics',\n ]), itemPath, issues);\n for (const field of ['id', 'producer'] as const) {\n if (!isNonEmptyString(sourceRecord[field])) {\n issues.push(issue({\n code: `archive.sourceRecord.${field}.required`,\n path: `${itemPath}.${field}`,\n message: `${itemPath}.${field} is required.`,\n }));\n }\n }\n validateOptionalStrings(sourceRecord, ['format', 'source', 'retrievedAt'], itemPath, issues);\n if (sourceRecord['retrievedAt'] !== undefined && !isDateTimeString(sourceRecord['retrievedAt'])) {\n issues.push(issue({\n code: 'archive.sourceRecord.retrievedAt.invalid',\n path: `${itemPath}.retrievedAt`,\n message: `${itemPath}.retrievedAt must be an RFC 3339 date-time.`,\n }));\n }\n validateStringArray(sourceRecord['mappedFields'], `${itemPath}.mappedFields`, issues);\n if (sourceRecord['diagnostics'] !== undefined) {\n if (!Array.isArray(sourceRecord['diagnostics'])) {\n issues.push(issue({ code: 'archive.sourceRecord.diagnostics.invalid', path: `${itemPath}.diagnostics`, message: 'Source diagnostics must be an array.' }));\n } else {\n sourceRecord['diagnostics'].forEach((diagnostic, diagnosticIndex) => {\n const diagnosticPath = `${itemPath}.diagnostics.${diagnosticIndex}`;\n if (!isRecord(diagnostic)) {\n issues.push(issue({ code: 'archive.sourceDiagnostic.invalid', path: diagnosticPath, message: 'Source diagnostic must be an object.' }));\n return;\n }\n validateAllowedKeys(diagnostic, new Set(['severity', 'code', 'message', 'path']), diagnosticPath, issues);\n if (!['error', 'warning', 'info'].includes(String(diagnostic['severity']))) {\n issues.push(issue({ code: 'archive.sourceDiagnostic.severity.invalid', path: `${diagnosticPath}.severity`, message: 'Source diagnostic severity is invalid.' }));\n }\n for (const field of ['code', 'message'] as const) {\n if (!isNonEmptyString(diagnostic[field])) {\n issues.push(issue({ code: `archive.sourceDiagnostic.${field}.required`, path: `${diagnosticPath}.${field}`, message: `Source diagnostic ${field} is required.` }));\n }\n }\n validateStringArray(diagnostic['path'], `${diagnosticPath}.path`, issues);\n });\n }\n }\n });\n}\n\nfunction validateNode(\n value: unknown,\n path: string,\n issues: FormatIssue[],\n nodeIds: Set<string>,\n seenObjects: WeakSet<object>,\n): value is ArchiveDescriptionNode {\n if (!isRecord(value)) {\n issues.push(issue({ code: 'archive.node.required', path, message: `${path} must be an object.` }));\n return false;\n }\n if (seenObjects.has(value)) {\n issues.push(issue({ code: 'archive.node.cycle', path, message: 'Archive description nodes must not form cycles.' }));\n return false;\n }\n seenObjects.add(value);\n\n validateAllowedKeys(value, new Set([\n 'id', 'level', 'otherLevel', 'title', 'referenceCode', 'repository', 'dates',\n 'extent', 'creator', 'creatorStatus', 'abstract', 'scopeContent', 'arrangement',\n 'accessRestriction', 'useRestriction', 'language', 'biographicalHistory',\n 'custodialHistory', 'acquisitionInformation', 'appraisal', 'processingInformation',\n 'relatedMaterial', 'separatedMaterial', 'preferredCitation', 'notes', 'accessPoints',\n 'targets', 'provenance', 'subItems', 'extensions',\n ]), path, issues);\n validateOptionalStrings(value, [\n 'otherLevel', 'referenceCode', 'repository', 'extent', 'creator', 'abstract',\n 'scopeContent', 'arrangement', 'accessRestriction', 'useRestriction', 'language',\n 'biographicalHistory', 'custodialHistory', 'acquisitionInformation', 'appraisal',\n 'processingInformation', 'relatedMaterial', 'separatedMaterial', 'preferredCitation',\n ], path, issues);\n\n const id = value['id'];\n if (!isNonEmptyString(id)) {\n issues.push(issue({ code: 'archive.node.id.required', path: `${path}.id`, message: 'Node id is required.' }));\n } else if (nodeIds.has(id)) {\n issues.push(issue({\n code: 'archive.node.id.duplicate',\n path: `${path}.id`,\n message: `Node id \"${id}\" is duplicated.`,\n }));\n } else {\n nodeIds.add(id);\n }\n\n const levels = new Set(['collection', 'series', 'subseries', 'file', 'item', 'otherlevel']);\n if (!isNonEmptyString(value['level']) || !levels.has(value['level'])) {\n issues.push(issue({\n code: 'archive.node.level.invalid',\n path: `${path}.level`,\n message: 'Node level must be a supported archival description level.',\n }));\n }\n if (value['level'] === 'otherlevel' && !isNonEmptyString(value['otherLevel'])) {\n issues.push(issue({\n code: 'archive.node.otherLevel.required',\n path: `${path}.otherLevel`,\n message: 'otherLevel is required when level is otherlevel.',\n }));\n }\n if (\n value['creatorStatus'] !== undefined &&\n !['known', 'unknown', 'not_applicable'].includes(String(value['creatorStatus']))\n ) {\n issues.push(issue({\n code: 'archive.node.creatorStatus.invalid',\n path: `${path}.creatorStatus`,\n message: 'Node creatorStatus is invalid.',\n }));\n }\n if (!isNonEmptyString(value['title'])) {\n issues.push(issue({ code: 'archive.node.title.required', path: `${path}.title`, message: 'Node title is required.' }));\n }\n\n if (value['dates'] !== undefined) {\n if (!Array.isArray(value['dates'])) {\n issues.push(issue({ code: 'archive.node.dates.invalid', path: `${path}.dates`, message: 'Node dates must be an array.' }));\n } else {\n value['dates'].forEach((date, index) => {\n if (!isRecord(date) || !isNonEmptyString(date['expression'])) {\n issues.push(issue({\n code: 'archive.node.date.expression.required',\n path: `${path}.dates.${index}.expression`,\n message: 'Each date must have a non-empty expression.',\n }));\n } else {\n validateAllowedKeys(date, new Set(['expression', 'normalized', 'type', 'certainty']), `${path}.dates.${index}`, issues);\n validateOptionalStrings(date, ['normalized', 'type', 'certainty'], `${path}.dates.${index}`, issues);\n }\n });\n }\n }\n\n if (value['accessPoints'] !== undefined) {\n if (!Array.isArray(value['accessPoints'])) {\n issues.push(issue({\n code: 'archive.node.accessPoints.invalid',\n path: `${path}.accessPoints`,\n message: 'Node accessPoints must be an array.',\n }));\n } else {\n value['accessPoints'].forEach((accessPoint, index) => {\n if (!isRecord(accessPoint) || !isNonEmptyString(accessPoint['type']) || !isNonEmptyString(accessPoint['label'])) {\n issues.push(issue({\n code: 'archive.node.accessPoint.invalid',\n path: `${path}.accessPoints.${index}`,\n message: 'Each access point must have a non-empty type and label.',\n }));\n } else {\n validateAllowedKeys(accessPoint, new Set(['type', 'label', 'identifier', 'source']), `${path}.accessPoints.${index}`, issues);\n validateOptionalStrings(accessPoint, ['identifier', 'source'], `${path}.accessPoints.${index}`, issues);\n }\n });\n }\n }\n\n if (value['targets'] !== undefined) {\n if (!Array.isArray(value['targets'])) {\n issues.push(issue({ code: 'archive.node.targets.invalid', path: `${path}.targets`, message: 'Node targets must be an array.' }));\n } else {\n value['targets'].forEach((target, index) => {\n if (!isRecord(target) || !isNonEmptyString(target['kind']) || !isNonEmptyString(target['id'])) {\n issues.push(issue({\n code: 'archive.node.target.invalid',\n path: `${path}.targets.${index}`,\n message: 'Each target must have a non-empty kind and id.',\n }));\n } else {\n validateAllowedKeys(target, new Set(['kind', 'id', 'href', 'label', 'role', 'locator', 'metadata']), `${path}.targets.${index}`, issues);\n validateOptionalStrings(target, ['href', 'label', 'role'], `${path}.targets.${index}`, issues);\n for (const field of ['locator', 'metadata'] as const) {\n if (target[field] !== undefined && !isRecord(target[field])) {\n issues.push(issue({ code: 'archive.node.target.object.invalid', path: `${path}.targets.${index}.${field}`, message: `Target ${field} must be an object.` }));\n }\n }\n }\n });\n }\n }\n\n if (value['provenance'] !== undefined) {\n validateProvenance(value['provenance'], `${path}.provenance`, issues);\n }\n validateStringArray(value['notes'], `${path}.notes`, issues);\n validateExtensions(value['extensions'], `${path}.extensions`, issues);\n\n if (value['subItems'] !== undefined) {\n if (!Array.isArray(value['subItems'])) {\n issues.push(issue({\n code: 'archive.node.subItems.invalid',\n path: `${path}.subItems`,\n message: 'Node subItems must be an array.',\n }));\n } else {\n value['subItems'].forEach((child, index) => {\n validateNode(child, `${path}.subItems.${index}`, issues, nodeIds, seenObjects);\n });\n }\n }\n seenObjects.delete(value);\n return true;\n}\n\nexport function validateArchiveDescription(value: unknown): readonly FormatIssue[] {\n const issues: FormatIssue[] = [];\n if (!isRecord(value)) {\n return [issue({ code: 'archive.record.required', path: '', message: 'Archive description record must be an object.' })];\n }\n validateAllowedKeys(value, new Set([\n 'schema', 'recordId', 'title', 'maintenanceStatus', 'language', 'agencyName',\n 'description', 'provenance', 'sourceRecords', 'extensions',\n ]), '', issues);\n if (value['schema'] !== ARCHIVE_DESCRIPTION_SCHEMA) {\n issues.push(issue({\n code: 'archive.schema.invalid',\n path: 'schema',\n message: `Archive description schema must be ${ARCHIVE_DESCRIPTION_SCHEMA}.`,\n }));\n }\n if (!isNonEmptyString(value['recordId'])) {\n issues.push(issue({ code: 'archive.recordId.required', path: 'recordId', message: 'Record id is required.' }));\n }\n if (!isNonEmptyString(value['title'])) {\n issues.push(issue({ code: 'archive.title.required', path: 'title', message: 'Finding-aid title is required.' }));\n }\n validateOptionalStrings(value, ['language', 'agencyName'], '', issues);\n if (\n value['maintenanceStatus'] !== undefined &&\n !['new', 'revised', 'deleted', 'derived', 'unknown'].includes(String(value['maintenanceStatus']))\n ) {\n issues.push(issue({ code: 'archive.maintenanceStatus.invalid', path: 'maintenanceStatus', message: 'Maintenance status is invalid.' }));\n }\n validateProvenance(value['provenance'], 'provenance', issues);\n validateSourceRecords(value['sourceRecords'], 'sourceRecords', issues);\n validateExtensions(value['extensions'], 'extensions', issues);\n validateNode(value['description'], 'description', issues, new Set<string>(), new WeakSet<object>());\n if (isRecord(value['description']) && value['description']['level'] !== 'collection') {\n issues.push(issue({\n code: 'archive.root.level.collection.required',\n path: 'description.level',\n message: 'The root description node must have collection level.',\n }));\n }\n return issues;\n}\n\nexport function parseArchiveDescriptionJson(input: string): ParseResult<ArchiveDescriptionRecord> {\n let value: unknown;\n try {\n value = JSON.parse(input);\n } catch (cause) {\n return formatFail([\n issue({ code: 'archive.json.invalid', path: '', message: 'Archive description JSON is invalid.', cause }),\n ]);\n }\n const issues = validateArchiveDescription(value);\n return hasFormatErrors(issues)\n ? formatFail(issues, value as ArchiveDescriptionRecord)\n : formatOk(value as ArchiveDescriptionRecord, issues);\n}\n\nfunction canonicalize(value: unknown): unknown {\n return JSON.parse(canonicalJson(value));\n}\n\nexport function serializeArchiveDescriptionJson(\n record: ArchiveDescriptionRecord,\n options: ArchiveDescriptionSerializeOptions = {},\n): SerializeResult<string> {\n const issues = validateArchiveDescription(record);\n if (hasFormatErrors(issues)) return formatFail(issues);\n const canonical = canonicalize(record);\n const format = options.format ?? true;\n return formatOk(JSON.stringify(canonical, null, format ? 2 : undefined), issues);\n}\n\nexport const archiveDescriptionAdapter = {\n format: ARCHIVE_DESCRIPTION_FORMAT_ID,\n parse: parseArchiveDescriptionJson,\n serialize: serializeArchiveDescriptionJson,\n validate: validateArchiveDescription,\n detect(input: string): boolean {\n try {\n const value = JSON.parse(input) as { schema?: unknown };\n return value?.schema === ARCHIVE_DESCRIPTION_SCHEMA;\n } catch {\n return false;\n }\n },\n} satisfies RecordFormatAdapter<ArchiveDescriptionRecord>;\n","import { createFormatIssue, type FormatIssue } from '../result.js';\nimport type { ArchiveDescriptionNode, ArchiveDescriptionRecord } from './types.js';\n\nexport const DACS_PROFILE_ID = 'daihum.record-formats.archive-description.dacs.v1';\n\nexport type DacsValidationOptions = Readonly<{\n requireMinimumAtEveryLevel?: boolean;\n}>;\n\nfunction text(value: unknown): boolean {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction dacsIssue(path: string, code: string, message: string): FormatIssue {\n return createFormatIssue({\n severity: 'error',\n format: DACS_PROFILE_ID,\n path,\n code,\n message,\n });\n}\n\nfunction validateMinimum(\n node: ArchiveDescriptionNode,\n path: string,\n repositoryFallback: string | undefined,\n): FormatIssue[] {\n const issues: FormatIssue[] = [];\n if (!text(node.referenceCode)) {\n issues.push(dacsIssue(`${path}.referenceCode`, 'dacs.referenceCode.required', 'DACS minimum description requires a reference code.'));\n }\n if (!text(node.repository) && !text(repositoryFallback)) {\n issues.push(dacsIssue(`${path}.repository`, 'dacs.repository.required', 'DACS minimum description requires repository identification.'));\n }\n if (!text(node.title)) {\n issues.push(dacsIssue(`${path}.title`, 'dacs.title.required', 'DACS minimum description requires a title.'));\n }\n if (!node.dates?.some((date) => text(date.expression))) {\n issues.push(dacsIssue(`${path}.dates`, 'dacs.dates.required', 'DACS minimum description requires a date expression.'));\n }\n if (!text(node.extent)) {\n issues.push(dacsIssue(`${path}.extent`, 'dacs.extent.required', 'DACS minimum description requires extent.'));\n }\n if (!text(node.creator) && node.creatorStatus !== 'unknown' && node.creatorStatus !== 'not_applicable') {\n issues.push(dacsIssue(\n `${path}.creator`,\n 'dacs.creator.required_or_unknown',\n 'DACS minimum description requires a creator or an explicit unknown/not-applicable status.',\n ));\n }\n if (!text(node.scopeContent)) {\n issues.push(dacsIssue(`${path}.scopeContent`, 'dacs.scopeContent.required', 'DACS minimum description requires scope and content.'));\n }\n if (!text(node.accessRestriction)) {\n issues.push(dacsIssue(\n `${path}.accessRestriction`,\n 'dacs.accessRestriction.required',\n 'DACS minimum description requires conditions governing access, including an explicit unrestricted statement.',\n ));\n }\n if (!text(node.language)) {\n issues.push(dacsIssue(`${path}.language`, 'dacs.language.required', 'DACS minimum description requires language/script information.'));\n }\n return issues;\n}\n\nfunction walk(\n node: ArchiveDescriptionNode,\n path: string,\n issues: FormatIssue[],\n options: DacsValidationOptions,\n repositoryFallback: string | undefined,\n): void {\n if (options.requireMinimumAtEveryLevel) {\n issues.push(...validateMinimum(node, path, repositoryFallback));\n }\n node.subItems?.forEach((child, index) => {\n walk(child, `${path}.subItems.${index}`, issues, options, repositoryFallback);\n });\n}\n\nexport function validateDacsArchiveDescription(\n record: ArchiveDescriptionRecord,\n options: DacsValidationOptions = {},\n): readonly FormatIssue[] {\n const issues = validateMinimum(record.description, 'description', undefined);\n if (record.description.subItems?.length && record.description.level !== 'collection') {\n issues.push(dacsIssue(\n 'description.level',\n 'dacs.multilevel.root.collection.required',\n 'A multilevel finding aid must begin with a collection-level root.',\n ));\n }\n record.description.subItems?.forEach((child, index) => {\n walk(child, `description.subItems.${index}`, issues, options, record.description.repository);\n });\n return issues;\n}\n","import type {\n Ead3AccessPoint,\n Ead3AccessPointType,\n Ead3Component,\n Ead3ComponentExtensions,\n Ead3Date,\n Ead3DigitalObjectRef,\n Ead3FindingAid,\n Ead3FindingAidExtensions,\n} from '../ead3/index.js';\nimport { validateEad3 } from '../ead3/index.js';\nimport {\n createFormatIssue,\n formatFail,\n formatOk,\n hasFormatErrors,\n type FormatIssue,\n type FormatResult,\n} from '../result.js';\nimport { validateArchiveDescription } from './archive-description.js';\nimport {\n ARCHIVE_DESCRIPTION_SCHEMA,\n type ArchiveDescriptionAccessPoint,\n type ArchiveDescriptionAccessPointType,\n type ArchiveDescriptionNode,\n type ArchiveDescriptionProvenance,\n type ArchiveDescriptionRecord,\n type ArchiveDescriptionSourceRecord,\n type ArchiveDescriptionTargetRef,\n} from './types.js';\n\nexport const ARCHIVE_DESCRIPTION_EAD3_PROJECTION_ID =\n 'daihum.record-formats.archive-description.ead3.v1';\n\nexport type ArchiveDescriptionFromEad3Options = Readonly<{\n provenance: ArchiveDescriptionProvenance;\n sourceRecord?: ArchiveDescriptionSourceRecord;\n nodeId?: (component: Ead3Component, path: string) => string | undefined;\n}>;\n\nconst ACCESS_POINT_TYPES = new Set<Ead3AccessPointType>([\n 'person', 'family', 'organization', 'place', 'subject',\n 'documentaryForm', 'occupation', 'function',\n]);\n\nfunction projectionIssue(params: {\n code: string;\n path: string;\n message: string;\n severity?: 'error' | 'warning';\n}): FormatIssue {\n return createFormatIssue({\n severity: params.severity ?? 'warning',\n format: ARCHIVE_DESCRIPTION_EAD3_PROJECTION_ID,\n code: params.code,\n path: params.path,\n message: params.message,\n });\n}\n\nfunction ead3Extensions<T>(value: Readonly<Record<string, unknown>> | undefined): T | undefined {\n return value as T | undefined;\n}\n\nfunction dateToEad3(\n date: NonNullable<ArchiveDescriptionNode['dates']>[number],\n path: string,\n issues: FormatIssue[],\n): Ead3Date {\n if (date.certainty) {\n issues.push(projectionIssue({\n code: 'archive.ead3.date.certainty.loss',\n path: `${path}.certainty`,\n message: 'EAD3 common-element projection does not model date certainty.',\n }));\n }\n return {\n expression: date.expression,\n ...(date.normalized ? { normalized: date.normalized } : {}),\n ...(date.type ? { type: date.type } : {}),\n };\n}\n\nfunction accessPointToEad3(\n accessPoint: ArchiveDescriptionAccessPoint,\n path: string,\n issues: FormatIssue[],\n): Ead3AccessPoint | undefined {\n if (!ACCESS_POINT_TYPES.has(accessPoint.type as Ead3AccessPointType)) {\n issues.push(projectionIssue({\n code: 'archive.ead3.accessPoint.type.unsupported',\n path: `${path}.type`,\n message: `Access point type \"${accessPoint.type}\" is not represented by the EAD3 projection.`,\n }));\n return undefined;\n }\n return {\n type: accessPoint.type as Ead3AccessPointType,\n label: accessPoint.label,\n ...(accessPoint.identifier ? { identifier: accessPoint.identifier } : {}),\n ...(accessPoint.source ? { source: accessPoint.source } : {}),\n };\n}\n\nfunction targetToEad3(\n target: ArchiveDescriptionTargetRef,\n path: string,\n issues: FormatIssue[],\n): Ead3DigitalObjectRef | undefined {\n if (!target.href) {\n issues.push(projectionIssue({\n code: 'archive.ead3.target.href.required',\n path: `${path}.href`,\n message: 'Target has no href and cannot be projected to an EAD3 digital object.',\n }));\n return undefined;\n }\n return {\n href: target.href,\n ...(target.label ? { label: target.label } : {}),\n ...(target.role ? { role: target.role } : {}),\n targetKind: target.kind,\n sourceRef: {\n kind: target.kind,\n id: target.id,\n ...(target.label ? { label: target.label } : {}),\n ...(target.locator ? { locator: target.locator } : {}),\n ...(target.metadata ? { metadata: target.metadata } : {}),\n },\n };\n}\n\nfunction nodeToEad3(\n node: ArchiveDescriptionNode,\n path: string,\n issues: FormatIssue[],\n): Ead3Component {\n if (node.provenance) {\n issues.push(projectionIssue({\n code: 'archive.ead3.node.provenance.loss',\n path: `${path}.provenance`,\n message: 'Node provenance remains canonical metadata and is not represented in EAD3.',\n }));\n }\n if (node.creatorStatus && node.creatorStatus !== 'known') {\n issues.push(projectionIssue({\n code: 'archive.ead3.creatorStatus.loss',\n path: `${path}.creatorStatus`,\n message: 'Explicit unknown/not-applicable creator status is not represented in EAD3.',\n }));\n }\n if (node.extensions?.vendor) {\n issues.push(projectionIssue({\n code: 'archive.ead3.vendorExtension.loss',\n path: `${path}.extensions.vendor`,\n message: 'Vendor extension facts remain canonical and are not represented in EAD3.',\n }));\n }\n\n const accessPoints = node.accessPoints\n ?.map((value, index) => accessPointToEad3(value, `${path}.accessPoints.${index}`, issues))\n .filter((value): value is Ead3AccessPoint => Boolean(value));\n const digitalObjects = node.targets\n ?.map((value, index) => targetToEad3(value, `${path}.targets.${index}`, issues))\n .filter((value): value is Ead3DigitalObjectRef => Boolean(value));\n const extensions = ead3Extensions<Ead3ComponentExtensions>(node.extensions?.ead3);\n\n return {\n id: node.id,\n level: node.level,\n ...(node.otherLevel ? { otherLevel: node.otherLevel } : {}),\n title: node.title,\n ...(node.referenceCode ? { referenceCode: node.referenceCode } : {}),\n ...(node.repository ? { repository: node.repository } : {}),\n ...(node.dates?.length\n ? { dates: node.dates.map((date, index) => dateToEad3(date, `${path}.dates.${index}`, issues)) }\n : {}),\n ...(node.extent ? { extent: node.extent } : {}),\n ...(node.creator ? { creator: node.creator } : {}),\n ...(node.abstract ? { abstract: node.abstract } : {}),\n ...(node.scopeContent ? { scopeContent: node.scopeContent } : {}),\n ...(node.arrangement ? { arrangement: node.arrangement } : {}),\n ...(node.accessRestriction ? { accessRestriction: node.accessRestriction } : {}),\n ...(node.useRestriction ? { useRestriction: node.useRestriction } : {}),\n ...(node.language ? { language: node.language } : {}),\n ...(node.biographicalHistory ? { biographicalHistory: node.biographicalHistory } : {}),\n ...(node.custodialHistory ? { custodialHistory: node.custodialHistory } : {}),\n ...(node.acquisitionInformation ? { acquisitionInformation: node.acquisitionInformation } : {}),\n ...(node.appraisal ? { appraisal: node.appraisal } : {}),\n ...(node.processingInformation ? { processingInformation: node.processingInformation } : {}),\n ...(node.relatedMaterial ? { relatedMaterial: node.relatedMaterial } : {}),\n ...(node.separatedMaterial ? { separatedMaterial: node.separatedMaterial } : {}),\n ...(node.preferredCitation ? { preferredCitation: node.preferredCitation } : {}),\n ...(node.notes?.length ? { notes: node.notes } : {}),\n ...(accessPoints?.length ? { accessPoints } : {}),\n ...(digitalObjects?.length ? { digitalObjects } : {}),\n ...(node.subItems?.length\n ? { components: node.subItems.map((child, index) => nodeToEad3(child, `${path}.subItems.${index}`, issues)) }\n : {}),\n ...(extensions ? { extensions } : {}),\n };\n}\n\nexport function archiveDescriptionToEad3(\n record: ArchiveDescriptionRecord,\n): FormatResult<Ead3FindingAid> {\n const issues: FormatIssue[] = [...validateArchiveDescription(record)];\n if (hasFormatErrors(issues)) return formatFail(issues);\n issues.push(projectionIssue({\n code: 'archive.ead3.provenance.loss',\n path: 'provenance',\n message: 'Record provenance remains canonical metadata and is not represented in EAD3.',\n }));\n if (record.sourceRecords?.length) {\n issues.push(projectionIssue({\n code: 'archive.ead3.sourceRecords.loss',\n path: 'sourceRecords',\n message: 'Source records remain canonical provenance and are not represented in EAD3.',\n }));\n }\n if (record.extensions?.vendor) {\n issues.push(projectionIssue({\n code: 'archive.ead3.vendorExtension.loss',\n path: 'extensions.vendor',\n message: 'Vendor extension facts remain canonical and are not represented in EAD3.',\n }));\n }\n const extensions = ead3Extensions<Ead3FindingAidExtensions>(record.extensions?.ead3);\n const findingAid: Ead3FindingAid = {\n recordId: record.recordId,\n title: record.title,\n ...(record.maintenanceStatus ? { maintenanceStatus: record.maintenanceStatus } : {}),\n ...(record.language ? { language: record.language } : {}),\n ...(record.agencyName ? { agencyName: record.agencyName } : {}),\n description: nodeToEad3(record.description, 'description', issues),\n ...(extensions ? { extensions } : {}),\n };\n issues.push(...validateEad3(findingAid));\n return hasFormatErrors(issues) ? formatFail(issues, findingAid) : formatOk(findingAid, issues);\n}\n\nfunction targetFromEad3(\n target: Ead3DigitalObjectRef,\n path: string,\n issues: FormatIssue[],\n): ArchiveDescriptionTargetRef {\n const label = target.label ?? target.sourceRef?.label;\n if (target.hrefPolicy) {\n issues.push(projectionIssue({\n code: 'ead3.archive.target.hrefPolicy.loss',\n path: `${path}.hrefPolicy`,\n message: 'EAD3 href policy is not modeled by the canonical target reference.',\n }));\n }\n if (target.provenance) {\n issues.push(projectionIssue({\n code: 'ead3.archive.target.provenance.loss',\n path: `${path}.provenance`,\n message: 'EAD3 target provenance is not modeled by the canonical target reference.',\n }));\n }\n if (target.extensions) {\n issues.push(projectionIssue({\n code: 'ead3.archive.target.extensions.loss',\n path: `${path}.extensions`,\n message: 'EAD3 target XML extensions are not modeled by the canonical target reference.',\n }));\n }\n if (target.sourceRef?.label && target.label && target.sourceRef.label !== target.label) {\n issues.push(projectionIssue({\n code: 'ead3.archive.target.sourceLabel.loss',\n path: `${path}.sourceRef.label`,\n message: 'Distinct EAD3 digital-object and source-reference labels cannot both occupy the canonical target label.',\n }));\n }\n if (target.sourceRef && target.targetKind && target.sourceRef.kind !== target.targetKind) {\n issues.push(projectionIssue({\n code: 'ead3.archive.target.targetKind.loss',\n path: `${path}.targetKind`,\n message: 'Distinct EAD3 targetKind and sourceRef.kind cannot both occupy the canonical target kind.',\n }));\n }\n return {\n kind: target.sourceRef?.kind ?? target.targetKind ?? 'external-uri',\n id: target.sourceRef?.id ?? target.href,\n href: target.href,\n ...(label ? { label } : {}),\n ...(target.role ? { role: target.role } : {}),\n ...(target.sourceRef?.locator ? { locator: target.sourceRef.locator } : {}),\n ...(target.sourceRef?.metadata ? { metadata: target.sourceRef.metadata } : {}),\n };\n}\n\nfunction dateFromEad3(\n date: Ead3Date,\n path: string,\n issues: FormatIssue[],\n): NonNullable<ArchiveDescriptionNode['dates']>[number] {\n if (date.extensions) {\n issues.push(projectionIssue({\n code: 'ead3.archive.date.extension.loss',\n path: `${path}.extensions`,\n message: 'EAD3 date XML extensions are not modeled by the canonical date.',\n }));\n }\n return {\n expression: date.expression,\n ...(date.normalized ? { normalized: date.normalized } : {}),\n ...(date.type ? { type: date.type } : {}),\n };\n}\n\nfunction accessPointFromEad3(\n value: Ead3AccessPoint,\n path: string,\n issues: FormatIssue[],\n): ArchiveDescriptionAccessPoint {\n if (value.extensions) {\n issues.push(projectionIssue({\n code: 'ead3.archive.accessPoint.extension.loss',\n path: `${path}.extensions`,\n message: 'EAD3 access-point XML extensions are not modeled by the canonical access point.',\n }));\n }\n return {\n type: value.type as ArchiveDescriptionAccessPointType,\n label: value.label,\n ...(value.identifier ? { identifier: value.identifier } : {}),\n ...(value.source ? { source: value.source } : {}),\n };\n}\n\nfunction resolveNodeId(\n component: Ead3Component,\n path: string,\n options: ArchiveDescriptionFromEad3Options,\n issues: FormatIssue[],\n): string {\n const id = component.id ?? component.referenceCode ?? options.nodeId?.(component, path);\n if (id) return id;\n issues.push(projectionIssue({\n severity: 'error',\n code: 'ead3.archive.nodeId.required',\n path: `${path}.id`,\n message: 'EAD3 component needs an id, a reference code, or an explicit stable nodeId resolver.',\n }));\n return '';\n}\n\nfunction nodeFromEad3(\n component: Ead3Component,\n path: string,\n options: ArchiveDescriptionFromEad3Options,\n issues: FormatIssue[],\n): ArchiveDescriptionNode {\n const id = resolveNodeId(component, path, options, issues);\n return {\n id,\n level: component.level,\n ...(component.otherLevel ? { otherLevel: component.otherLevel } : {}),\n title: component.title,\n ...(component.referenceCode ? { referenceCode: component.referenceCode } : {}),\n ...(component.repository ? { repository: component.repository } : {}),\n ...(component.dates?.length\n ? {\n dates: component.dates.map((date, index) =>\n dateFromEad3(date, `${path}.dates.${index}`, issues)),\n }\n : {}),\n ...(component.extent ? { extent: component.extent } : {}),\n ...(component.creator ? { creator: component.creator, creatorStatus: 'known' as const } : {}),\n ...(component.abstract ? { abstract: component.abstract } : {}),\n ...(component.scopeContent ? { scopeContent: component.scopeContent } : {}),\n ...(component.arrangement ? { arrangement: component.arrangement } : {}),\n ...(component.accessRestriction ? { accessRestriction: component.accessRestriction } : {}),\n ...(component.useRestriction ? { useRestriction: component.useRestriction } : {}),\n ...(component.language ? { language: component.language } : {}),\n ...(component.biographicalHistory ? { biographicalHistory: component.biographicalHistory } : {}),\n ...(component.custodialHistory ? { custodialHistory: component.custodialHistory } : {}),\n ...(component.acquisitionInformation ? { acquisitionInformation: component.acquisitionInformation } : {}),\n ...(component.appraisal ? { appraisal: component.appraisal } : {}),\n ...(component.processingInformation ? { processingInformation: component.processingInformation } : {}),\n ...(component.relatedMaterial ? { relatedMaterial: component.relatedMaterial } : {}),\n ...(component.separatedMaterial ? { separatedMaterial: component.separatedMaterial } : {}),\n ...(component.preferredCitation ? { preferredCitation: component.preferredCitation } : {}),\n ...(component.notes?.length ? { notes: component.notes } : {}),\n ...(component.accessPoints?.length\n ? {\n accessPoints: component.accessPoints.map((value, index) =>\n accessPointFromEad3(value, `${path}.accessPoints.${index}`, issues)),\n }\n : {}),\n ...(component.digitalObjects?.length\n ? { targets: component.digitalObjects.map((target, index) => targetFromEad3(target, `${path}.digitalObjects.${index}`, issues)) }\n : {}),\n ...(component.components?.length\n ? { subItems: component.components.map((child, index) => nodeFromEad3(child, `${path}.components.${index}`, options, issues)) }\n : {}),\n ...(component.extensions\n ? { extensions: { ead3: component.extensions as Readonly<Record<string, unknown>> } }\n : {}),\n };\n}\n\nexport function archiveDescriptionFromEad3(\n findingAid: Ead3FindingAid,\n options: ArchiveDescriptionFromEad3Options,\n): FormatResult<ArchiveDescriptionRecord> {\n const issues: FormatIssue[] = [...validateEad3(findingAid)];\n const record: ArchiveDescriptionRecord = {\n schema: ARCHIVE_DESCRIPTION_SCHEMA,\n recordId: findingAid.recordId,\n title: findingAid.title,\n ...(findingAid.maintenanceStatus ? { maintenanceStatus: findingAid.maintenanceStatus } : {}),\n ...(findingAid.language ? { language: findingAid.language } : {}),\n ...(findingAid.agencyName ? { agencyName: findingAid.agencyName } : {}),\n description: nodeFromEad3(findingAid.description, 'description', options, issues),\n provenance: options.provenance,\n ...(options.sourceRecord ? { sourceRecords: [options.sourceRecord] } : {}),\n ...(findingAid.extensions\n ? { extensions: { ead3: findingAid.extensions as Readonly<Record<string, unknown>> } }\n : {}),\n };\n issues.push(...validateArchiveDescription(record));\n return hasFormatErrors(issues) ? formatFail(issues, record) : formatOk(record, issues);\n}\n","import {\n ARCHIVE_DESCRIPTION_SCHEMA_ID,\n ARCHIVE_DESCRIPTION_SCHEMA_TITLE,\n canonicalJson,\n contentHash,\n} from './identity.js';\nimport { ARCHIVE_DESCRIPTION_SCHEMA } from './types.js';\n\nconst nonEmptyStringSchema = { type: 'string', minLength: 1, pattern: '\\\\S' } as const;\n\nconst provenanceSchema = {\n type: 'object',\n required: ['createdBy', 'createdAt', 'method'],\n properties: {\n createdBy: nonEmptyStringSchema,\n createdAt: { type: 'string', format: 'date-time' },\n method: nonEmptyStringSchema,\n rules: { type: 'array', items: nonEmptyStringSchema },\n tool: { type: 'string' },\n model: { type: 'string' },\n reviewStatus: {\n type: 'string',\n enum: ['unreviewed', 'needs_review', 'accepted', 'rejected'],\n },\n reviewedBy: { type: 'string' },\n reviewedAt: { type: 'string', format: 'date-time' },\n },\n additionalProperties: false,\n} as const;\n\nconst extensionsSchema = {\n type: 'object',\n properties: {\n ead3: { type: 'object', additionalProperties: true },\n vendor: {\n type: 'array',\n items: {\n type: 'object',\n required: ['namespace', 'name', 'value'],\n properties: {\n namespace: nonEmptyStringSchema,\n name: nonEmptyStringSchema,\n value: {},\n },\n additionalProperties: false,\n },\n },\n },\n additionalProperties: false,\n} as const;\n\nconst dateSchema = {\n type: 'object',\n required: ['expression'],\n properties: {\n expression: nonEmptyStringSchema,\n normalized: { type: 'string' },\n type: { type: 'string' },\n certainty: { type: 'string' },\n },\n additionalProperties: false,\n} as const;\n\nconst accessPointSchema = {\n type: 'object',\n required: ['type', 'label'],\n properties: {\n type: nonEmptyStringSchema,\n label: nonEmptyStringSchema,\n identifier: { type: 'string' },\n source: { type: 'string' },\n },\n additionalProperties: false,\n} as const;\n\nconst targetRefSchema = {\n type: 'object',\n required: ['kind', 'id'],\n properties: {\n kind: nonEmptyStringSchema,\n id: nonEmptyStringSchema,\n href: { type: 'string' },\n label: { type: 'string' },\n role: { type: 'string' },\n locator: { type: 'object', additionalProperties: true },\n metadata: { type: 'object', additionalProperties: true },\n },\n additionalProperties: false,\n} as const;\n\nconst sourceDiagnosticSchema = {\n type: 'object',\n required: ['severity', 'code', 'message'],\n properties: {\n severity: { type: 'string', enum: ['error', 'warning', 'info'] },\n code: nonEmptyStringSchema,\n message: nonEmptyStringSchema,\n path: { type: 'array', items: nonEmptyStringSchema },\n },\n additionalProperties: false,\n} as const;\n\nconst sourceRecordSchema = {\n type: 'object',\n required: ['id', 'producer'],\n properties: {\n id: nonEmptyStringSchema,\n producer: nonEmptyStringSchema,\n format: { type: 'string' },\n source: { type: 'string' },\n retrievedAt: { type: 'string', format: 'date-time' },\n raw: {},\n mappedFields: { type: 'array', items: nonEmptyStringSchema },\n unmappedFields: {},\n diagnostics: { type: 'array', items: sourceDiagnosticSchema },\n },\n additionalProperties: false,\n} as const;\n\nconst nodeProperties = {\n id: nonEmptyStringSchema,\n level: {\n type: 'string',\n enum: ['collection', 'series', 'subseries', 'file', 'item', 'otherlevel'],\n },\n otherLevel: { type: 'string' },\n title: nonEmptyStringSchema,\n referenceCode: { type: 'string' },\n repository: { type: 'string' },\n dates: { type: 'array', items: dateSchema },\n extent: { type: 'string' },\n creator: { type: 'string' },\n creatorStatus: { type: 'string', enum: ['known', 'unknown', 'not_applicable'] },\n abstract: { type: 'string' },\n scopeContent: { type: 'string' },\n arrangement: { type: 'string' },\n accessRestriction: { type: 'string' },\n useRestriction: { type: 'string' },\n language: { type: 'string' },\n biographicalHistory: { type: 'string' },\n custodialHistory: { type: 'string' },\n acquisitionInformation: { type: 'string' },\n appraisal: { type: 'string' },\n processingInformation: { type: 'string' },\n relatedMaterial: { type: 'string' },\n separatedMaterial: { type: 'string' },\n preferredCitation: { type: 'string' },\n notes: { type: 'array', items: nonEmptyStringSchema },\n accessPoints: { type: 'array', items: accessPointSchema },\n targets: { type: 'array', items: targetRefSchema },\n provenance: provenanceSchema,\n subItems: { type: 'array', items: { $ref: '#/$defs/node' } },\n extensions: extensionsSchema,\n} as const;\n\nexport function buildArchiveDescriptionJsonSchema(): Record<string, unknown> {\n return {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n $id: ARCHIVE_DESCRIPTION_SCHEMA_ID,\n title: ARCHIVE_DESCRIPTION_SCHEMA_TITLE,\n type: 'object',\n required: ['schema', 'recordId', 'title', 'description', 'provenance'],\n properties: {\n schema: { const: ARCHIVE_DESCRIPTION_SCHEMA },\n recordId: nonEmptyStringSchema,\n title: nonEmptyStringSchema,\n maintenanceStatus: {\n type: 'string',\n enum: ['new', 'revised', 'deleted', 'derived', 'unknown'],\n },\n language: { type: 'string' },\n agencyName: { type: 'string' },\n description: {\n allOf: [\n { $ref: '#/$defs/node' },\n { type: 'object', properties: { level: { const: 'collection' } } },\n ],\n },\n provenance: provenanceSchema,\n sourceRecords: { type: 'array', items: sourceRecordSchema },\n extensions: extensionsSchema,\n },\n $defs: {\n node: {\n type: 'object',\n required: ['id', 'level', 'title'],\n properties: nodeProperties,\n allOf: [\n {\n if: { properties: { level: { const: 'otherlevel' } }, required: ['level'] },\n then: { required: ['otherLevel'], properties: { otherLevel: nonEmptyStringSchema } },\n },\n ],\n additionalProperties: false,\n },\n },\n additionalProperties: false,\n };\n}\n\nexport const archiveDescriptionJsonSchema = buildArchiveDescriptionJsonSchema();\nexport const ARCHIVE_DESCRIPTION_SCHEMA_REVISION = contentHash(\n canonicalJson(archiveDescriptionJsonSchema),\n);\n"],"mappings":";;;;;AAAA,MAAa,6BAA6B;;;;ACE1C,MAAa,gCACX;AACF,MAAa,mCAAmC;AAChD,MAAa,qCAAqC;AAElD,SAAgB,cAAc,OAAwB;AACpD,QAAO,KAAK,UAAU,QAAQ,MAAM,SAAS;AAC3C,MAAI,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,KAAK,EAAE;GAC5D,MAAM,SAAS;AACf,UAAO,OAAO,KAAK,OAAO,CACvB,MAAM,CACN,QAAiC,QAAQ,QAAQ;AAChD,WAAO,OAAO,OAAO;AACrB,WAAO;MACN,EAAE,CAAC;;AAEV,SAAO;GACP;;AAGJ,SAAgB,YAAY,OAAuB;CACjD,IAAI,KAAK;CACT,IAAI,KAAK;AACT,MAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG;EACpD,MAAM,OAAO,MAAM,WAAW,MAAM;AACpC,OAAK,KAAK,KAAK,KAAK,MAAM,WAAW;AACrC,OAAK,KAAK,KAAK,KAAK,MAAM,WAAW;;AAEvC,MAAK,KAAK,KAAK,KAAM,OAAO,IAAK,WAAW;AAC5C,OAAM,KAAK,KAAK,KAAM,OAAO,IAAK,WAAW;AAC7C,MAAK,KAAK,KAAK,KAAM,OAAO,IAAK,WAAW;AAC5C,OAAM,KAAK,KAAK,KAAM,OAAO,IAAK,WAAW;AAE7C,SADc,cAAc,UAAU,OAAO,OAAO,IACvC,SAAS,GAAG,CAAC,SAAS,IAAI,IAAI;;;;;ACnC7C,M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C,UAAU;GACV,OAAO;GACP,mBAAmB;IACjB,MAAM;IACN,MAAM;KAAC;KAAO;KAAW;KAAW;KAAW;KAAU;IAC1D;GACD,UAAU,EAAE,MAAM,UAAU;GAC5B,YAAY,EAAE,MAAM,UAAU;GAC9B,aAAa,EACX,OAAO,CACL,EAAE,MAAM,gBAAgB,EACxB;IAAE,MAAM;IAAU,YAAY,EAAE,OAAO,EAAE,OAAO,cAAc,EAAE;IAAE,CACnE,EACF;GACD,YAAY;GACZ,eAAe;IAAE,MAAM;IAAS,OAAO;IAAoB;GAC3D,YAAY;GACb;EACD,OAAO,EACL,MAAM;GACJ,MAAM;GACN,UAAU;IAAC;IAAM;IAAS;IAAQ;GAClC,YAAY;GACZ,OAAO,CACL;IACE,IAAI;KAAE,YAAY,EAAE,OAAO,EAAE,OAAO,cAAc,EAAE;KAAE,UAAU,CAAC,QAAQ;KAAE;IAC3E,MAAM;KAAE,UAAU,CAAC,aAAa;KAAE,YAAY,EAAE,YAAY,sBAAsB;KAAE;IACrF,CACF;GACD,sBAAsB;GACvB,EACF;EACD,sBAAsB;EACvB;;AAGH,MAAa,+BAA+B,mCAAmC;AAC/E,MAAa,sCAAsC,YACjD,cAAc,6BAA6B,CAC5C"}
|
package/dist/ead3/index.d.ts
CHANGED
|
@@ -1,158 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { l as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type Ead3LevelOfDescription = 'collection' | 'series' | 'subseries' | 'file' | 'item' | 'otherlevel';
|
|
6
|
-
type Ead3MaintenanceStatus = 'new' | 'revised' | 'deleted' | 'derived' | 'unknown';
|
|
7
|
-
type Ead3ValidationLevel = 'projection' | 'structural' | 'schema';
|
|
8
|
-
type Ead3AdapterSourceReference = Readonly<{
|
|
9
|
-
label: string;
|
|
10
|
-
url: string;
|
|
11
|
-
}>;
|
|
12
|
-
type Ead3AdapterProfile = Readonly<{
|
|
13
|
-
profileId: string;
|
|
14
|
-
profileVersion: string;
|
|
15
|
-
formatId: 'ead3';
|
|
16
|
-
formatGeneration: 'EAD3';
|
|
17
|
-
namespace: string;
|
|
18
|
-
schemaVersion: string;
|
|
19
|
-
schemaRevision: string;
|
|
20
|
-
tagLibraryVersion: string;
|
|
21
|
-
validationLevel: Ead3ValidationLevel;
|
|
22
|
-
officialSchemaValidation: boolean;
|
|
23
|
-
conformanceNotes: readonly string[];
|
|
24
|
-
sourceReferences: readonly Ead3AdapterSourceReference[];
|
|
25
|
-
}>;
|
|
26
|
-
type Ead3XmlExtensions = Readonly<Record<string, unknown>>;
|
|
27
|
-
type Ead3Date = Readonly<{
|
|
28
|
-
expression: string;
|
|
29
|
-
normalized?: string;
|
|
30
|
-
type?: string;
|
|
31
|
-
extensions?: Ead3XmlExtensions;
|
|
32
|
-
}>;
|
|
33
|
-
type Ead3DigitalObjectTargetKind = 'file-uri' | 'data-source-item' | 'reader-page' | 'artifact' | 'external-uri' | 'opaque' | (string & Record<never, never>);
|
|
34
|
-
type Ead3HrefPolicyKind = 'preserve' | 'relative' | 'redact' | 'externalize';
|
|
35
|
-
type Ead3HrefPolicy = Readonly<{
|
|
36
|
-
kind: Ead3HrefPolicyKind;
|
|
37
|
-
publicHref?: string;
|
|
38
|
-
baseHref?: string;
|
|
39
|
-
redactedHref?: string;
|
|
40
|
-
note?: string;
|
|
41
|
-
}>;
|
|
42
|
-
type Ead3SourceRef = Readonly<{
|
|
43
|
-
kind: string;
|
|
44
|
-
id: string;
|
|
45
|
-
label?: string;
|
|
46
|
-
locator?: Readonly<Record<string, unknown>>;
|
|
47
|
-
metadata?: Readonly<Record<string, unknown>>;
|
|
48
|
-
}>;
|
|
49
|
-
type Ead3DigitalObjectRef = Readonly<{
|
|
50
|
-
href: string;
|
|
51
|
-
label?: string;
|
|
52
|
-
role?: string;
|
|
53
|
-
targetKind?: Ead3DigitalObjectTargetKind;
|
|
54
|
-
hrefPolicy?: Ead3HrefPolicy;
|
|
55
|
-
sourceRef?: Ead3SourceRef;
|
|
56
|
-
provenance?: Record<string, unknown>;
|
|
57
|
-
extensions?: Ead3XmlExtensions;
|
|
58
|
-
}>;
|
|
59
|
-
type Ead3ComponentExtensions = Readonly<{
|
|
60
|
-
xml?: Ead3XmlExtensions;
|
|
61
|
-
did?: Ead3XmlExtensions;
|
|
62
|
-
}>;
|
|
63
|
-
type Ead3Component = Readonly<{
|
|
64
|
-
id?: string;
|
|
65
|
-
level: Ead3LevelOfDescription;
|
|
66
|
-
otherLevel?: string;
|
|
67
|
-
title: string;
|
|
68
|
-
referenceCode?: string;
|
|
69
|
-
dates?: readonly Ead3Date[];
|
|
70
|
-
extent?: string;
|
|
71
|
-
creator?: string;
|
|
72
|
-
abstract?: string;
|
|
73
|
-
scopeContent?: string;
|
|
74
|
-
arrangement?: string;
|
|
75
|
-
accessRestriction?: string;
|
|
76
|
-
useRestriction?: string;
|
|
77
|
-
language?: string;
|
|
78
|
-
biographicalHistory?: string;
|
|
79
|
-
custodialHistory?: string;
|
|
80
|
-
acquisitionInformation?: string;
|
|
81
|
-
appraisal?: string;
|
|
82
|
-
processingInformation?: string;
|
|
83
|
-
relatedMaterial?: string;
|
|
84
|
-
separatedMaterial?: string;
|
|
85
|
-
preferredCitation?: string;
|
|
86
|
-
notes?: readonly string[];
|
|
87
|
-
digitalObjects?: readonly Ead3DigitalObjectRef[];
|
|
88
|
-
components?: readonly Ead3Component[];
|
|
89
|
-
extensions?: Ead3ComponentExtensions;
|
|
90
|
-
}>;
|
|
91
|
-
type Ead3FindingAidExtensions = Readonly<{
|
|
92
|
-
ead?: Ead3XmlExtensions;
|
|
93
|
-
control?: Ead3XmlExtensions;
|
|
94
|
-
}>;
|
|
95
|
-
type Ead3FindingAid = Readonly<{
|
|
96
|
-
recordId: string;
|
|
97
|
-
title: string;
|
|
98
|
-
maintenanceStatus?: Ead3MaintenanceStatus;
|
|
99
|
-
language?: string;
|
|
100
|
-
agencyName?: string;
|
|
101
|
-
description: Ead3Component;
|
|
102
|
-
extensions?: Ead3FindingAidExtensions;
|
|
103
|
-
}>;
|
|
104
|
-
type Ead3ParseOptions = Readonly<{
|
|
105
|
-
preserveUnknown?: boolean;
|
|
106
|
-
}>;
|
|
107
|
-
type Ead3SerializeOptions = Readonly<{
|
|
108
|
-
format?: boolean;
|
|
109
|
-
}>;
|
|
110
|
-
type Ead3ValidationOptions = Readonly<{
|
|
111
|
-
requireRecordId?: boolean;
|
|
112
|
-
}>;
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/ead3/ead3.d.ts
|
|
115
|
-
declare const EAD3_FORMAT_ID = "ead3";
|
|
116
|
-
declare const EAD3_NAMESPACE = "http://ead3.archivists.org/schema/";
|
|
117
|
-
declare const EAD3_FORMAT_GENERATION = "EAD3";
|
|
118
|
-
declare const EAD3_SCHEMA_VERSION = "1.1.1";
|
|
119
|
-
declare const EAD3_SCHEMA_REVISION = "1.1.1";
|
|
120
|
-
declare const EAD3_TAG_LIBRARY_VERSION = "1.1.2";
|
|
121
|
-
declare const EAD3_VALIDATION_LEVEL = "projection";
|
|
122
|
-
declare const EAD3_OFFICIAL_SCHEMA_VALIDATION = false;
|
|
123
|
-
declare const EAD3_ADAPTER_PROFILE: Ead3AdapterProfile;
|
|
124
|
-
type Ead3ResultMetadata = Readonly<{
|
|
125
|
-
adapterProfile: Ead3AdapterProfile;
|
|
126
|
-
}>;
|
|
127
|
-
type Ead3ParseResult = ParseResult<Ead3FindingAid> & Ead3ResultMetadata;
|
|
128
|
-
type Ead3XmlDocumentResult = SerializeResult<XmlDocument> & Ead3ResultMetadata;
|
|
129
|
-
type Ead3XmlSerializeResult = SerializeResult<string> & Ead3ResultMetadata;
|
|
130
|
-
declare function ead3FromXmlDocument(document: XmlDocument, options?: Ead3ParseOptions): Ead3ParseResult;
|
|
131
|
-
declare function parseEad3Xml(input: string, options?: Ead3ParseOptions): Ead3ParseResult;
|
|
132
|
-
declare function ead3ToXmlDocument(findingAid: Ead3FindingAid, options?: Ead3ValidationOptions): Ead3XmlDocumentResult;
|
|
133
|
-
declare function serializeEad3Xml(findingAid: Ead3FindingAid, options?: Ead3SerializeOptions): Ead3XmlSerializeResult;
|
|
134
|
-
declare function validateEad3(findingAid: Ead3FindingAid, options?: Ead3ValidationOptions): readonly FormatIssue[];
|
|
135
|
-
declare const ead3Adapter: {
|
|
136
|
-
format: string;
|
|
137
|
-
profile: Readonly<{
|
|
138
|
-
profileId: string;
|
|
139
|
-
profileVersion: string;
|
|
140
|
-
formatId: "ead3";
|
|
141
|
-
formatGeneration: "EAD3";
|
|
142
|
-
namespace: string;
|
|
143
|
-
schemaVersion: string;
|
|
144
|
-
schemaRevision: string;
|
|
145
|
-
tagLibraryVersion: string;
|
|
146
|
-
validationLevel: Ead3ValidationLevel;
|
|
147
|
-
officialSchemaValidation: boolean;
|
|
148
|
-
conformanceNotes: readonly string[];
|
|
149
|
-
sourceReferences: readonly Ead3AdapterSourceReference[];
|
|
150
|
-
}>;
|
|
151
|
-
parse: typeof parseEad3Xml;
|
|
152
|
-
serialize: typeof serializeEad3Xml;
|
|
153
|
-
validate: typeof validateEad3;
|
|
154
|
-
detect(input: string): boolean;
|
|
155
|
-
};
|
|
156
|
-
//#endregion
|
|
157
|
-
export { EAD3_ADAPTER_PROFILE, EAD3_FORMAT_GENERATION, EAD3_FORMAT_ID, EAD3_NAMESPACE, EAD3_OFFICIAL_SCHEMA_VALIDATION, EAD3_SCHEMA_REVISION, EAD3_SCHEMA_VERSION, EAD3_TAG_LIBRARY_VERSION, EAD3_VALIDATION_LEVEL, type Ead3AdapterProfile, type Ead3AdapterSourceReference, type Ead3Component, type Ead3ComponentExtensions, type Ead3Date, type Ead3DigitalObjectRef, type Ead3DigitalObjectTargetKind, type Ead3FindingAid, type Ead3FindingAidExtensions, type Ead3HrefPolicy, type Ead3HrefPolicyKind, type Ead3LevelOfDescription, type Ead3MaintenanceStatus, type Ead3ParseOptions, type Ead3ParseResult, type Ead3ResultMetadata, type Ead3SerializeOptions, type Ead3SourceRef, type Ead3ValidationLevel, type Ead3ValidationOptions, type Ead3XmlDocumentResult, type Ead3XmlExtensions, type Ead3XmlSerializeResult, ead3Adapter, ead3FromXmlDocument, ead3ToXmlDocument, parseEad3Xml, serializeEad3Xml, validateEad3 };
|
|
158
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import "../result-D7vcrlFh.js";
|
|
2
|
+
import { A as Ead3FindingAidExtensions, B as Ead3XmlExtensions, C as Ead3AdapterSourceReference, D as Ead3DigitalObjectRef, E as Ead3Date, F as Ead3ParseOptions, I as Ead3SerializeOptions, L as Ead3SourceRef, M as Ead3HrefPolicyKind, N as Ead3LevelOfDescription, O as Ead3DigitalObjectTargetKind, P as Ead3MaintenanceStatus, R as Ead3ValidationLevel, S as Ead3AdapterProfile, T as Ead3ComponentExtensions, _ as parseEad3Xml, a as EAD3_OFFICIAL_SCHEMA_VALIDATION, b as Ead3AccessPoint, c as EAD3_TAG_LIBRARY_VERSION, d as Ead3ResultMetadata, f as Ead3XmlDocumentResult, g as ead3ToXmlDocument, h as ead3FromXmlDocument, i as EAD3_NAMESPACE, j as Ead3HrefPolicy, k as Ead3FindingAid, l as EAD3_VALIDATION_LEVEL, m as ead3Adapter, n as EAD3_FORMAT_GENERATION, o as EAD3_SCHEMA_REVISION, p as Ead3XmlSerializeResult, r as EAD3_FORMAT_ID, s as EAD3_SCHEMA_VERSION, t as EAD3_ADAPTER_PROFILE, u as Ead3ParseResult, v as serializeEad3Xml, w as Ead3Component, x as Ead3AccessPointType, y as validateEad3, z as Ead3ValidationOptions } from "../index-DxjnI5KZ.js";
|
|
3
|
+
import "../index-BNudmNFx.js";
|
|
4
|
+
export { EAD3_ADAPTER_PROFILE, EAD3_FORMAT_GENERATION, EAD3_FORMAT_ID, EAD3_NAMESPACE, EAD3_OFFICIAL_SCHEMA_VALIDATION, EAD3_SCHEMA_REVISION, EAD3_SCHEMA_VERSION, EAD3_TAG_LIBRARY_VERSION, EAD3_VALIDATION_LEVEL, Ead3AccessPoint, Ead3AccessPointType, Ead3AdapterProfile, Ead3AdapterSourceReference, Ead3Component, Ead3ComponentExtensions, Ead3Date, Ead3DigitalObjectRef, Ead3DigitalObjectTargetKind, Ead3FindingAid, Ead3FindingAidExtensions, Ead3HrefPolicy, Ead3HrefPolicyKind, Ead3LevelOfDescription, Ead3MaintenanceStatus, Ead3ParseOptions, Ead3ParseResult, Ead3ResultMetadata, Ead3SerializeOptions, Ead3SourceRef, Ead3ValidationLevel, Ead3ValidationOptions, Ead3XmlDocumentResult, Ead3XmlExtensions, Ead3XmlSerializeResult, ead3Adapter, ead3FromXmlDocument, ead3ToXmlDocument, parseEad3Xml, serializeEad3Xml, validateEad3 };
|