open-agreements 0.3.1 → 0.4.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.
- package/content/templates/closing-checklist/template.docx +0 -0
- package/dist/core/checklist/docx-import.d.ts +50 -0
- package/dist/core/checklist/docx-import.d.ts.map +1 -0
- package/dist/core/checklist/docx-import.js +613 -0
- package/dist/core/checklist/docx-import.js.map +1 -0
- package/dist/core/checklist/docx-table-helpers.d.ts +33 -0
- package/dist/core/checklist/docx-table-helpers.d.ts.map +1 -0
- package/dist/core/checklist/docx-table-helpers.js +154 -0
- package/dist/core/checklist/docx-table-helpers.js.map +1 -0
- package/dist/core/checklist/format-checklist-docx.d.ts.map +1 -1
- package/dist/core/checklist/format-checklist-docx.js +37 -88
- package/dist/core/checklist/format-checklist-docx.js.map +1 -1
- package/dist/core/checklist/index.d.ts +15 -12
- package/dist/core/checklist/index.d.ts.map +1 -1
- package/dist/core/checklist/index.js +48 -30
- package/dist/core/checklist/index.js.map +1 -1
- package/dist/core/checklist/status-labels.d.ts +6 -0
- package/dist/core/checklist/status-labels.d.ts.map +1 -1
- package/dist/core/checklist/status-labels.js +8 -0
- package/dist/core/checklist/status-labels.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts +218 -0
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/atomizer.js +869 -0
- package/node_modules/@usejunior/docx-core/dist/atomizer.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.d.ts +96 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.js +347 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.d.ts +2 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.js +188 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.d.ts +41 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.js +85 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts +64 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js +985 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.d.ts +111 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.js +469 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts +277 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js +2279 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.d.ts +59 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.js +209 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts +69 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js +910 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.d.ts +26 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.js +153 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.d.ts +63 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.js +254 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts +64 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js +616 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.d.ts +65 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.js +95 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.d.ts +51 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.js +83 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts +40 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js +135 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts +28 -0
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js +110 -0
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts +3 -0
- package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/index.js +21 -0
- package/node_modules/@usejunior/docx-core/dist/cli/index.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts +296 -0
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/core-types.js +122 -0
- package/node_modules/@usejunior/docx-core/dist/core-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts +144 -0
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/footnotes.js +291 -0
- package/node_modules/@usejunior/docx-core/dist/footnotes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/format-detection.d.ts +120 -0
- package/node_modules/@usejunior/docx-core/dist/format-detection.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/format-detection.js +338 -0
- package/node_modules/@usejunior/docx-core/dist/format-detection.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/index.d.ts +177 -0
- package/node_modules/@usejunior/docx-core/dist/index.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/index.js +55 -0
- package/node_modules/@usejunior/docx-core/dist/index.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.d.ts +6 -0
- package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.js +30 -0
- package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/move-detection.d.ts +211 -0
- package/node_modules/@usejunior/docx-core/dist/move-detection.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/move-detection.js +391 -0
- package/node_modules/@usejunior/docx-core/dist/move-detection.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/numbering.d.ts +136 -0
- package/node_modules/@usejunior/docx-core/dist/numbering.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/numbering.js +446 -0
- package/node_modules/@usejunior/docx-core/dist/numbering.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts +30 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js +241 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.js +248 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts +88 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js +703 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts +186 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js +555 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts +97 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js +749 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts +94 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js +219 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/errors.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/errors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/errors.js +10 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/errors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.d.ts +50 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.js +340 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js +552 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts +43 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js +291 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts +27 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js +27 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts +53 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js +178 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.js +57 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/matching.d.ts +31 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/matching.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/matching.js +223 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/matching.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts +23 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js +243 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts +91 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js +108 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/numbering.d.ts +27 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/numbering.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/numbering.js +182 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/numbering.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.d.ts +18 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.js +190 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts +27 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js +371 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/relationships.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/relationships.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/relationships.js +24 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/relationships.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts +17 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js +58 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.js +94 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js +205 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts +54 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js +205 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts +30 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js +461 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.js +147 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts +25 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js +78 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.d.ts +94 -0
- package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.js +169 -0
- package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts +149 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js +224 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.d.ts +136 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.js +7 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.d.ts +31 -0
- package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.js +110 -0
- package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.js.map +1 -0
- package/node_modules/@usejunior/docx-core/package.json +26 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/diff-match-patch/LICENSE +202 -0
- package/node_modules/diff-match-patch/README.md +94 -0
- package/node_modules/diff-match-patch/index.js +2218 -0
- package/node_modules/diff-match-patch/package.json +22 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
- package/node_modules/jszip/.jekyll-metadata +0 -0
- package/node_modules/jszip/.travis.yml +17 -0
- package/node_modules/jszip/CHANGES.md +204 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/deps.js +37 -0
- package/node_modules/jszip/dist/jszip.js +11577 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/graph.svg +601 -0
- package/node_modules/jszip/index.d.ts +330 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +501 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/package.json +9 -4
- package/packages/docx-core/node_modules/@xmldom/xmldom/CHANGELOG.md +468 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/LICENSE +8 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/index.d.ts +43 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/lib/conventions.js +203 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/lib/dom.js +1879 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/lib/index.js +4 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/lib/sax.js +662 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/package.json +71 -0
- package/packages/docx-core/node_modules/@xmldom/xmldom/readme.md +356 -0
|
Binary file
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checklist DOCX import/diff module.
|
|
3
|
+
*
|
|
4
|
+
* Parses a rendered closing-checklist DOCX and produces RFC 6902 patch
|
|
5
|
+
* operations representing human edits to the document.
|
|
6
|
+
*
|
|
7
|
+
* Processes 5-column Documents, 5-column Action Items, and 5-column Issues tables.
|
|
8
|
+
*/
|
|
9
|
+
import type { ClosingChecklist } from './schemas.js';
|
|
10
|
+
import type { ChecklistPatchEnvelope } from './patch-schemas.js';
|
|
11
|
+
export interface DocxImportOptions {
|
|
12
|
+
docxBuffer: Buffer;
|
|
13
|
+
canonicalChecklist: ClosingChecklist;
|
|
14
|
+
checklistId: string;
|
|
15
|
+
currentRevision: number;
|
|
16
|
+
}
|
|
17
|
+
export type DocxImportWarningCode = 'SUB_ROW_CHANGED' | 'ROW_REORDERED' | 'UNSUPPORTED_EDIT' | 'UNKNOWN_ID' | 'DUPLICATE_ID' | 'NEW_ROW_ADDED' | 'DISPLAY_ROW_SKIPPED';
|
|
18
|
+
export interface DocxImportWarning {
|
|
19
|
+
code: DocxImportWarningCode;
|
|
20
|
+
table: 'documents' | 'action_items' | 'issues';
|
|
21
|
+
message: string;
|
|
22
|
+
rowIndex?: number;
|
|
23
|
+
column?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DocxImportSummary {
|
|
26
|
+
documentsProcessed: number;
|
|
27
|
+
actionItemsProcessed: number;
|
|
28
|
+
issuesProcessed: number;
|
|
29
|
+
operationsGenerated: number;
|
|
30
|
+
warningsGenerated: number;
|
|
31
|
+
}
|
|
32
|
+
export interface DocxImportResult {
|
|
33
|
+
ok: true;
|
|
34
|
+
patch: ChecklistPatchEnvelope | null;
|
|
35
|
+
warnings: DocxImportWarning[];
|
|
36
|
+
summary: DocxImportSummary;
|
|
37
|
+
}
|
|
38
|
+
export type DocxImportErrorCode = 'TABLE_NOT_FOUND' | 'MERGED_CELLS' | 'PARSE_FAILED' | 'VERSION_MISMATCH' | 'ID_COLUMN_MISSING';
|
|
39
|
+
export interface DocxImportFailure {
|
|
40
|
+
ok: false;
|
|
41
|
+
error_code: DocxImportErrorCode;
|
|
42
|
+
message: string;
|
|
43
|
+
}
|
|
44
|
+
export type DocxImportOutcome = DocxImportResult | DocxImportFailure;
|
|
45
|
+
/**
|
|
46
|
+
* Import a rendered closing-checklist DOCX and produce a patch envelope
|
|
47
|
+
* representing the differences from the canonical checklist state.
|
|
48
|
+
*/
|
|
49
|
+
export declare function importChecklistFromDocx(options: DocxImportOptions): DocxImportOutcome;
|
|
50
|
+
//# sourceMappingURL=docx-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docx-import.d.ts","sourceRoot":"","sources":["../../../src/core/checklist/docx-import.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,OAAO,KAAK,EAAE,gBAAgB,EAAwD,MAAM,cAAc,CAAC;AAC3G,OAAO,KAAK,EAA2B,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAc1F,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,qBAAqB,GAC7B,iBAAiB,GACjB,eAAe,GACf,kBAAkB,GAClB,YAAY,GACZ,cAAc,GACd,eAAe,GACf,qBAAqB,CAAC;AAE1B,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,IAAI,CAAC;IACT,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,MAAM,mBAAmB,GAC3B,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,mBAAmB,CAAC;AAExB,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,KAAK,CAAC;IACV,UAAU,EAAE,mBAAmB,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAgjBrE;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,iBAAiB,CAiHrF"}
|
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checklist DOCX import/diff module.
|
|
3
|
+
*
|
|
4
|
+
* Parses a rendered closing-checklist DOCX and produces RFC 6902 patch
|
|
5
|
+
* operations representing human edits to the document.
|
|
6
|
+
*
|
|
7
|
+
* Processes 5-column Documents, 5-column Action Items, and 5-column Issues tables.
|
|
8
|
+
*/
|
|
9
|
+
import AdmZip from 'adm-zip';
|
|
10
|
+
import { DOMParser } from '@xmldom/xmldom';
|
|
11
|
+
import { extractTables, } from '@usejunior/docx-core';
|
|
12
|
+
import { reverseHumanStatus } from './status-labels.js';
|
|
13
|
+
import { DOCUMENTS_HEADERS, ACTION_ITEMS_HEADERS, ISSUES_HEADERS, classifyRow, extractRenderVersion, } from './docx-table-helpers.js';
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Parsing helpers
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
/**
|
|
18
|
+
* Parse the merged Responsible column: "Entity (Individual)" format.
|
|
19
|
+
* Uses the canonical shape to disambiguate single-token text.
|
|
20
|
+
*
|
|
21
|
+
* Known limitation: when canonical has both org and individual, any
|
|
22
|
+
* parenthesized text is split — e.g. "Acme (Delaware)" would be parsed as
|
|
23
|
+
* org="Acme", individual="Delaware". This is inherent to the format; the
|
|
24
|
+
* canonical shape is the best available disambiguation signal.
|
|
25
|
+
*/
|
|
26
|
+
function parseResponsibleColumn(text, canonical) {
|
|
27
|
+
const trimmed = text.trim();
|
|
28
|
+
if (!trimmed)
|
|
29
|
+
return { organization: null, individual_name: null };
|
|
30
|
+
// Only attempt "Entity (Individual)" split when canonical has BOTH fields
|
|
31
|
+
const hasBoth = canonical?.organization && canonical?.individual_name;
|
|
32
|
+
if (hasBoth) {
|
|
33
|
+
const parenIdx = trimmed.lastIndexOf('(');
|
|
34
|
+
if (parenIdx > 0 && trimmed.endsWith(')')) {
|
|
35
|
+
const org = trimmed.slice(0, parenIdx).trim();
|
|
36
|
+
const individual = trimmed.slice(parenIdx + 1, -1).trim();
|
|
37
|
+
return { organization: org || null, individual_name: individual || null };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// No parens or single-field canonical — use canonical shape as tiebreaker
|
|
41
|
+
if (canonical) {
|
|
42
|
+
if (canonical.organization && !canonical.individual_name) {
|
|
43
|
+
return { organization: trimmed, individual_name: null };
|
|
44
|
+
}
|
|
45
|
+
if (canonical.individual_name && !canonical.organization) {
|
|
46
|
+
return { organization: null, individual_name: trimmed };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Default (no canonical or canonical has both but no parens): treat as org
|
|
50
|
+
return { organization: trimmed, individual_name: null };
|
|
51
|
+
}
|
|
52
|
+
function toArray(collection) {
|
|
53
|
+
return Array.isArray(collection) ? collection : Object.values(collection);
|
|
54
|
+
}
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// Table extraction from DOCX buffer
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
function parseDocxXml(buffer) {
|
|
59
|
+
const zip = new AdmZip(buffer);
|
|
60
|
+
const entry = zip.getEntry('word/document.xml');
|
|
61
|
+
if (!entry)
|
|
62
|
+
throw new Error('word/document.xml not found in DOCX');
|
|
63
|
+
const xmlStr = entry.getData().toString('utf-8');
|
|
64
|
+
return new DOMParser().parseFromString(xmlStr, 'text/xml');
|
|
65
|
+
}
|
|
66
|
+
function findExtractedTable(result, targetHeaders) {
|
|
67
|
+
return result.tables.find((t) => {
|
|
68
|
+
if (t.headers.length !== targetHeaders.length)
|
|
69
|
+
return false;
|
|
70
|
+
return t.headers.every((h, i) => h === targetHeaders[i]);
|
|
71
|
+
}) ?? null;
|
|
72
|
+
}
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Documents table import
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
function importDocumentsTable(table, checklist, ops, warnings) {
|
|
77
|
+
const entries = toArray(checklist.checklist_entries);
|
|
78
|
+
const documents = toArray(checklist.documents);
|
|
79
|
+
const entriesById = new Map(entries.map((e) => [e.entry_id, e]));
|
|
80
|
+
const documentsById = new Map(documents.map((d) => [d.document_id, d]));
|
|
81
|
+
const seenIds = new Set();
|
|
82
|
+
let processed = 0;
|
|
83
|
+
for (let i = 0; i < table.rows.length; i++) {
|
|
84
|
+
const row = table.rows[i];
|
|
85
|
+
const entryId = row['ID']?.trim() ?? '';
|
|
86
|
+
const titleText = row['Title']?.trim() ?? '';
|
|
87
|
+
// Skip stage headings and sub-rows
|
|
88
|
+
const rowType = classifyRow(entryId, titleText);
|
|
89
|
+
if (rowType === 'stage_heading')
|
|
90
|
+
continue;
|
|
91
|
+
// Sub-rows: detect changes and emit warnings
|
|
92
|
+
if (rowType !== 'main_entry' && rowType !== 'unknown') {
|
|
93
|
+
// Sub-rows are read-only
|
|
94
|
+
if (titleText || row['Status']?.trim()) {
|
|
95
|
+
warnings.push({
|
|
96
|
+
code: 'SUB_ROW_CHANGED',
|
|
97
|
+
table: 'documents',
|
|
98
|
+
message: `Sub-row at index ${i} (${rowType}) is read-only`,
|
|
99
|
+
rowIndex: i,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
// Empty-ID unknown rows: display-only, skip with info warning
|
|
105
|
+
if (!entryId && rowType === 'unknown') {
|
|
106
|
+
warnings.push({
|
|
107
|
+
code: 'DISPLAY_ROW_SKIPPED',
|
|
108
|
+
table: 'documents',
|
|
109
|
+
message: `Row ${i} has empty ID — display-only row skipped`,
|
|
110
|
+
rowIndex: i,
|
|
111
|
+
});
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
// ID integrity policy
|
|
115
|
+
if (!entryId) {
|
|
116
|
+
warnings.push({
|
|
117
|
+
code: 'NEW_ROW_ADDED',
|
|
118
|
+
table: 'documents',
|
|
119
|
+
message: `Row ${i} has empty ID — new row addition not supported for documents table`,
|
|
120
|
+
rowIndex: i,
|
|
121
|
+
});
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (seenIds.has(entryId)) {
|
|
125
|
+
warnings.push({
|
|
126
|
+
code: 'DUPLICATE_ID',
|
|
127
|
+
table: 'documents',
|
|
128
|
+
message: `Duplicate ID "${entryId}" at row ${i} — skipping`,
|
|
129
|
+
rowIndex: i,
|
|
130
|
+
});
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
seenIds.add(entryId);
|
|
134
|
+
const entry = entriesById.get(entryId);
|
|
135
|
+
if (!entry) {
|
|
136
|
+
warnings.push({
|
|
137
|
+
code: 'UNKNOWN_ID',
|
|
138
|
+
table: 'documents',
|
|
139
|
+
message: `Unknown entry ID "${entryId}" at row ${i} — skipping`,
|
|
140
|
+
rowIndex: i,
|
|
141
|
+
});
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
processed++;
|
|
145
|
+
// Compare and generate replace ops
|
|
146
|
+
// Title (strip NBSP indent for comparison)
|
|
147
|
+
const cleanTitle = titleText.replace(/^\u00A0+/, '').trim();
|
|
148
|
+
if (cleanTitle && cleanTitle !== entry.title) {
|
|
149
|
+
ops.push({
|
|
150
|
+
op: 'replace',
|
|
151
|
+
path: `/checklist_entries/${entryId}/title`,
|
|
152
|
+
value: cleanTitle,
|
|
153
|
+
rationale: 'DOCX import: title changed',
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
// Status
|
|
157
|
+
const statusText = row['Status']?.trim() ?? '';
|
|
158
|
+
if (statusText) {
|
|
159
|
+
const enumStatus = reverseHumanStatus(statusText);
|
|
160
|
+
if (enumStatus && enumStatus !== entry.status) {
|
|
161
|
+
ops.push({
|
|
162
|
+
op: 'replace',
|
|
163
|
+
path: `/checklist_entries/${entryId}/status`,
|
|
164
|
+
value: enumStatus,
|
|
165
|
+
rationale: 'DOCX import: status changed',
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Link → ChecklistDocument.primary_link
|
|
170
|
+
const linkText = row['Link']?.trim() ?? '';
|
|
171
|
+
const doc = entry.document_id ? documentsById.get(entry.document_id) : null;
|
|
172
|
+
if (doc) {
|
|
173
|
+
const currentLink = doc.primary_link ?? '';
|
|
174
|
+
if (linkText !== currentLink) {
|
|
175
|
+
ops.push({
|
|
176
|
+
op: linkText ? 'replace' : 'remove',
|
|
177
|
+
path: `/documents/${doc.document_id}/primary_link`,
|
|
178
|
+
...(linkText ? { value: linkText } : {}),
|
|
179
|
+
rationale: 'DOCX import: link changed',
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// Responsible → merged "Entity (Individual)" column
|
|
184
|
+
const responsibleText = row['Responsible']?.trim() ?? '';
|
|
185
|
+
const parsed = parseResponsibleColumn(responsibleText, entry.responsible_party);
|
|
186
|
+
const currentOrg = entry.responsible_party?.organization ?? '';
|
|
187
|
+
const currentIndividual = entry.responsible_party?.individual_name ?? '';
|
|
188
|
+
if ((parsed.organization ?? '') !== currentOrg || (parsed.individual_name ?? '') !== currentIndividual) {
|
|
189
|
+
if (!entry.responsible_party && (parsed.organization || parsed.individual_name)) {
|
|
190
|
+
// Create new responsible_party (never touch role)
|
|
191
|
+
ops.push({
|
|
192
|
+
op: 'replace',
|
|
193
|
+
path: `/checklist_entries/${entryId}/responsible_party`,
|
|
194
|
+
value: {
|
|
195
|
+
...(parsed.organization ? { organization: parsed.organization } : {}),
|
|
196
|
+
...(parsed.individual_name ? { individual_name: parsed.individual_name } : {}),
|
|
197
|
+
},
|
|
198
|
+
rationale: 'DOCX import: responsible party added',
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
else if (entry.responsible_party) {
|
|
202
|
+
// Clearing entire responsible_party
|
|
203
|
+
if (!parsed.organization && !parsed.individual_name && !responsibleText) {
|
|
204
|
+
ops.push({
|
|
205
|
+
op: 'remove',
|
|
206
|
+
path: `/checklist_entries/${entryId}/responsible_party`,
|
|
207
|
+
rationale: 'DOCX import: responsible party cleared',
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
// Update individual fields (never touch role)
|
|
212
|
+
if ((parsed.organization ?? '') !== currentOrg) {
|
|
213
|
+
if (parsed.organization) {
|
|
214
|
+
ops.push({
|
|
215
|
+
op: 'replace',
|
|
216
|
+
path: `/checklist_entries/${entryId}/responsible_party/organization`,
|
|
217
|
+
value: parsed.organization,
|
|
218
|
+
rationale: 'DOCX import: organization changed',
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
ops.push({
|
|
223
|
+
op: 'remove',
|
|
224
|
+
path: `/checklist_entries/${entryId}/responsible_party/organization`,
|
|
225
|
+
rationale: 'DOCX import: organization cleared',
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if ((parsed.individual_name ?? '') !== currentIndividual) {
|
|
230
|
+
if (parsed.individual_name) {
|
|
231
|
+
ops.push({
|
|
232
|
+
op: 'replace',
|
|
233
|
+
path: `/checklist_entries/${entryId}/responsible_party/individual_name`,
|
|
234
|
+
value: parsed.individual_name,
|
|
235
|
+
rationale: 'DOCX import: individual_name changed',
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
ops.push({
|
|
240
|
+
op: 'remove',
|
|
241
|
+
path: `/checklist_entries/${entryId}/responsible_party/individual_name`,
|
|
242
|
+
rationale: 'DOCX import: individual_name cleared',
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return processed;
|
|
251
|
+
}
|
|
252
|
+
// ---------------------------------------------------------------------------
|
|
253
|
+
// Action Items table import
|
|
254
|
+
// ---------------------------------------------------------------------------
|
|
255
|
+
function importActionItemsTable(table, checklist, ops, warnings) {
|
|
256
|
+
const actions = toArray(checklist.action_items);
|
|
257
|
+
const actionsById = new Map(actions.map((a) => [a.action_id, a]));
|
|
258
|
+
const seenIds = new Set();
|
|
259
|
+
let processed = 0;
|
|
260
|
+
for (let i = 0; i < table.rows.length; i++) {
|
|
261
|
+
const row = table.rows[i];
|
|
262
|
+
const actionId = row['ID']?.trim() ?? '';
|
|
263
|
+
// Empty ID = new row
|
|
264
|
+
if (!actionId) {
|
|
265
|
+
const description = row['Description']?.trim() ?? '';
|
|
266
|
+
if (description) {
|
|
267
|
+
const newId = `A-${Date.now()}-${i}`;
|
|
268
|
+
const statusText = row['Status']?.trim() ?? '';
|
|
269
|
+
const enumStatus = reverseHumanStatus(statusText) ?? 'NOT_STARTED';
|
|
270
|
+
ops.push({
|
|
271
|
+
op: 'add',
|
|
272
|
+
path: `/action_items/${newId}`,
|
|
273
|
+
value: {
|
|
274
|
+
action_id: newId,
|
|
275
|
+
description,
|
|
276
|
+
status: enumStatus,
|
|
277
|
+
assigned_to: row['Assigned To']?.trim() ? { individual_name: row['Assigned To']?.trim() } : undefined,
|
|
278
|
+
due_date: row['Due Date']?.trim() || undefined,
|
|
279
|
+
related_document_ids: [],
|
|
280
|
+
citations: [],
|
|
281
|
+
},
|
|
282
|
+
rationale: 'DOCX import: new action item added',
|
|
283
|
+
});
|
|
284
|
+
warnings.push({
|
|
285
|
+
code: 'NEW_ROW_ADDED',
|
|
286
|
+
table: 'action_items',
|
|
287
|
+
message: `New action item "${description}" added with generated ID "${newId}"`,
|
|
288
|
+
rowIndex: i,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
if (seenIds.has(actionId)) {
|
|
294
|
+
warnings.push({
|
|
295
|
+
code: 'DUPLICATE_ID',
|
|
296
|
+
table: 'action_items',
|
|
297
|
+
message: `Duplicate ID "${actionId}" at row ${i} — skipping`,
|
|
298
|
+
rowIndex: i,
|
|
299
|
+
});
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
seenIds.add(actionId);
|
|
303
|
+
const action = actionsById.get(actionId);
|
|
304
|
+
if (!action) {
|
|
305
|
+
warnings.push({
|
|
306
|
+
code: 'UNKNOWN_ID',
|
|
307
|
+
table: 'action_items',
|
|
308
|
+
message: `Unknown action ID "${actionId}" at row ${i} — skipping`,
|
|
309
|
+
rowIndex: i,
|
|
310
|
+
});
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
processed++;
|
|
314
|
+
// Description
|
|
315
|
+
const desc = row['Description']?.trim() ?? '';
|
|
316
|
+
if (desc && desc !== action.description) {
|
|
317
|
+
ops.push({
|
|
318
|
+
op: 'replace',
|
|
319
|
+
path: `/action_items/${actionId}/description`,
|
|
320
|
+
value: desc,
|
|
321
|
+
rationale: 'DOCX import: action description changed',
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
// Status
|
|
325
|
+
const statusText = row['Status']?.trim() ?? '';
|
|
326
|
+
if (statusText) {
|
|
327
|
+
const enumStatus = reverseHumanStatus(statusText);
|
|
328
|
+
if (enumStatus && enumStatus !== action.status) {
|
|
329
|
+
ops.push({
|
|
330
|
+
op: 'replace',
|
|
331
|
+
path: `/action_items/${actionId}/status`,
|
|
332
|
+
value: enumStatus,
|
|
333
|
+
rationale: 'DOCX import: action status changed',
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
// Assigned To
|
|
338
|
+
const assignedTo = row['Assigned To']?.trim() ?? '';
|
|
339
|
+
const currentAssigned = action.assigned_to?.individual_name ?? '';
|
|
340
|
+
if (assignedTo !== currentAssigned) {
|
|
341
|
+
if (!action.assigned_to && assignedTo) {
|
|
342
|
+
ops.push({
|
|
343
|
+
op: 'replace',
|
|
344
|
+
path: `/action_items/${actionId}/assigned_to`,
|
|
345
|
+
value: { individual_name: assignedTo },
|
|
346
|
+
rationale: 'DOCX import: action assigned_to changed',
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
else if (action.assigned_to) {
|
|
350
|
+
ops.push({
|
|
351
|
+
op: 'replace',
|
|
352
|
+
path: `/action_items/${actionId}/assigned_to/individual_name`,
|
|
353
|
+
value: assignedTo || undefined,
|
|
354
|
+
rationale: 'DOCX import: action assigned_to changed',
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// Due Date
|
|
359
|
+
const dueDate = row['Due Date']?.trim() ?? '';
|
|
360
|
+
const currentDue = action.due_date ?? '';
|
|
361
|
+
if (dueDate !== currentDue) {
|
|
362
|
+
ops.push({
|
|
363
|
+
op: dueDate ? 'replace' : 'remove',
|
|
364
|
+
path: `/action_items/${actionId}/due_date`,
|
|
365
|
+
...(dueDate ? { value: dueDate } : {}),
|
|
366
|
+
rationale: 'DOCX import: action due_date changed',
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
// Check for removed rows
|
|
371
|
+
for (const action of actions) {
|
|
372
|
+
if (!seenIds.has(action.action_id)) {
|
|
373
|
+
ops.push({
|
|
374
|
+
op: 'remove',
|
|
375
|
+
path: `/action_items/${action.action_id}`,
|
|
376
|
+
rationale: 'DOCX import: action item removed from table',
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return processed;
|
|
381
|
+
}
|
|
382
|
+
// ---------------------------------------------------------------------------
|
|
383
|
+
// Issues table import
|
|
384
|
+
// ---------------------------------------------------------------------------
|
|
385
|
+
function importIssuesTable(table, checklist, ops, warnings) {
|
|
386
|
+
const issues = toArray(checklist.issues);
|
|
387
|
+
const issuesById = new Map(issues.map((iss) => [iss.issue_id, iss]));
|
|
388
|
+
const seenIds = new Set();
|
|
389
|
+
let processed = 0;
|
|
390
|
+
for (let i = 0; i < table.rows.length; i++) {
|
|
391
|
+
const row = table.rows[i];
|
|
392
|
+
const issueId = row['ID']?.trim() ?? '';
|
|
393
|
+
// Empty ID = new row
|
|
394
|
+
if (!issueId) {
|
|
395
|
+
const title = row['Title']?.trim() ?? '';
|
|
396
|
+
if (title) {
|
|
397
|
+
const newId = `I-${Date.now()}-${i}`;
|
|
398
|
+
const statusText = row['Status']?.trim() ?? '';
|
|
399
|
+
const enumStatus = reverseHumanStatus(statusText) ?? 'OPEN';
|
|
400
|
+
ops.push({
|
|
401
|
+
op: 'add',
|
|
402
|
+
path: `/issues/${newId}`,
|
|
403
|
+
value: {
|
|
404
|
+
issue_id: newId,
|
|
405
|
+
title,
|
|
406
|
+
status: enumStatus,
|
|
407
|
+
summary: row['Summary']?.trim() || undefined,
|
|
408
|
+
related_document_ids: [],
|
|
409
|
+
citations: [],
|
|
410
|
+
},
|
|
411
|
+
rationale: 'DOCX import: new issue added',
|
|
412
|
+
});
|
|
413
|
+
warnings.push({
|
|
414
|
+
code: 'NEW_ROW_ADDED',
|
|
415
|
+
table: 'issues',
|
|
416
|
+
message: `New issue "${title}" added with generated ID "${newId}"`,
|
|
417
|
+
rowIndex: i,
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
if (seenIds.has(issueId)) {
|
|
423
|
+
warnings.push({
|
|
424
|
+
code: 'DUPLICATE_ID',
|
|
425
|
+
table: 'issues',
|
|
426
|
+
message: `Duplicate ID "${issueId}" at row ${i} — skipping`,
|
|
427
|
+
rowIndex: i,
|
|
428
|
+
});
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
seenIds.add(issueId);
|
|
432
|
+
const issue = issuesById.get(issueId);
|
|
433
|
+
if (!issue) {
|
|
434
|
+
warnings.push({
|
|
435
|
+
code: 'UNKNOWN_ID',
|
|
436
|
+
table: 'issues',
|
|
437
|
+
message: `Unknown issue ID "${issueId}" at row ${i} — skipping`,
|
|
438
|
+
rowIndex: i,
|
|
439
|
+
});
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
processed++;
|
|
443
|
+
// Title
|
|
444
|
+
const title = row['Title']?.trim() ?? '';
|
|
445
|
+
if (title && title !== issue.title) {
|
|
446
|
+
ops.push({
|
|
447
|
+
op: 'replace',
|
|
448
|
+
path: `/issues/${issueId}/title`,
|
|
449
|
+
value: title,
|
|
450
|
+
rationale: 'DOCX import: issue title changed',
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
// Status
|
|
454
|
+
const statusText = row['Status']?.trim() ?? '';
|
|
455
|
+
if (statusText) {
|
|
456
|
+
const enumStatus = reverseHumanStatus(statusText);
|
|
457
|
+
if (enumStatus && enumStatus !== issue.status) {
|
|
458
|
+
ops.push({
|
|
459
|
+
op: 'replace',
|
|
460
|
+
path: `/issues/${issueId}/status`,
|
|
461
|
+
value: enumStatus,
|
|
462
|
+
rationale: 'DOCX import: issue status changed',
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
// Summary
|
|
467
|
+
const summary = row['Summary']?.trim() ?? '';
|
|
468
|
+
const currentSummary = issue.summary ?? '';
|
|
469
|
+
if (summary !== currentSummary) {
|
|
470
|
+
ops.push({
|
|
471
|
+
op: summary ? 'replace' : 'remove',
|
|
472
|
+
path: `/issues/${issueId}/summary`,
|
|
473
|
+
...(summary ? { value: summary } : {}),
|
|
474
|
+
rationale: 'DOCX import: issue summary changed',
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
// Citation (latest citation text)
|
|
478
|
+
const citationText = row['Citation']?.trim() ?? '';
|
|
479
|
+
const currentCitations = issue.citations ?? [];
|
|
480
|
+
const currentLatestCitation = currentCitations.length > 0
|
|
481
|
+
? (currentCitations[currentCitations.length - 1].text ?? currentCitations[currentCitations.length - 1].ref ?? '')
|
|
482
|
+
: '';
|
|
483
|
+
if (citationText && citationText !== currentLatestCitation) {
|
|
484
|
+
// Add a new citation
|
|
485
|
+
ops.push({
|
|
486
|
+
op: 'add',
|
|
487
|
+
path: `/issues/${issueId}/citations/-`,
|
|
488
|
+
value: { text: citationText },
|
|
489
|
+
rationale: 'DOCX import: issue citation updated',
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
// Check for removed rows
|
|
494
|
+
for (const issue of issues) {
|
|
495
|
+
if (!seenIds.has(issue.issue_id)) {
|
|
496
|
+
ops.push({
|
|
497
|
+
op: 'remove',
|
|
498
|
+
path: `/issues/${issue.issue_id}`,
|
|
499
|
+
rationale: 'DOCX import: issue removed from table',
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
return processed;
|
|
504
|
+
}
|
|
505
|
+
// ---------------------------------------------------------------------------
|
|
506
|
+
// Main import function
|
|
507
|
+
// ---------------------------------------------------------------------------
|
|
508
|
+
/**
|
|
509
|
+
* Import a rendered closing-checklist DOCX and produce a patch envelope
|
|
510
|
+
* representing the differences from the canonical checklist state.
|
|
511
|
+
*/
|
|
512
|
+
export function importChecklistFromDocx(options) {
|
|
513
|
+
const { docxBuffer, canonicalChecklist, checklistId, currentRevision } = options;
|
|
514
|
+
// Parse DOCX XML
|
|
515
|
+
let xmlDoc;
|
|
516
|
+
try {
|
|
517
|
+
xmlDoc = parseDocxXml(docxBuffer);
|
|
518
|
+
}
|
|
519
|
+
catch (err) {
|
|
520
|
+
return {
|
|
521
|
+
ok: false,
|
|
522
|
+
error_code: 'PARSE_FAILED',
|
|
523
|
+
message: `Failed to parse DOCX: ${err instanceof Error ? err.message : String(err)}`,
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
// Check render version marker
|
|
527
|
+
const renderVersion = extractRenderVersion(xmlDoc);
|
|
528
|
+
if (renderVersion !== 'closing-checklist') {
|
|
529
|
+
return {
|
|
530
|
+
ok: false,
|
|
531
|
+
error_code: 'VERSION_MISMATCH',
|
|
532
|
+
message: 'DOCX is missing render version marker (closing-checklist). Was this rendered with the current template?',
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
// Use docx-core extractTables on the raw DOM
|
|
536
|
+
// We need to use the xmldom Document as a DOM Document
|
|
537
|
+
const extractResult = extractTables(xmlDoc, {
|
|
538
|
+
rejectMergedCells: true,
|
|
539
|
+
headerFilter: [DOCUMENTS_HEADERS, ACTION_ITEMS_HEADERS, ISSUES_HEADERS],
|
|
540
|
+
});
|
|
541
|
+
// Check for merged cell errors
|
|
542
|
+
if (extractResult.mergedCellDiagnostics.length > 0) {
|
|
543
|
+
return {
|
|
544
|
+
ok: false,
|
|
545
|
+
error_code: 'MERGED_CELLS',
|
|
546
|
+
message: `DOCX contains merged cells which cannot be safely parsed (${extractResult.mergedCellDiagnostics.length} merged cells detected)`,
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
const docsTable = findExtractedTable(extractResult, DOCUMENTS_HEADERS);
|
|
550
|
+
const actionsTable = findExtractedTable(extractResult, ACTION_ITEMS_HEADERS);
|
|
551
|
+
const issuesTable = findExtractedTable(extractResult, ISSUES_HEADERS);
|
|
552
|
+
if (!docsTable && !actionsTable && !issuesTable) {
|
|
553
|
+
return {
|
|
554
|
+
ok: false,
|
|
555
|
+
error_code: 'TABLE_NOT_FOUND',
|
|
556
|
+
message: 'No recognized checklist tables found in DOCX. Expected 5-column headers (ID | Title | Link | Status | Responsible).',
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
const ops = [];
|
|
560
|
+
const warnings = [];
|
|
561
|
+
// Filter out control rows from extracted tables
|
|
562
|
+
// (docx-core extractTables gives us raw data; control rows have {FOR / {END-FOR text)
|
|
563
|
+
function filterControlRows(table) {
|
|
564
|
+
const filteredRows = table.rows.filter((row) => {
|
|
565
|
+
const firstCell = Object.values(row)[0] ?? '';
|
|
566
|
+
if (firstCell.trim().startsWith('{FOR') || firstCell.trim().startsWith('{END-FOR')) {
|
|
567
|
+
return false;
|
|
568
|
+
}
|
|
569
|
+
return true;
|
|
570
|
+
});
|
|
571
|
+
return { ...table, rows: filteredRows };
|
|
572
|
+
}
|
|
573
|
+
let documentsProcessed = 0;
|
|
574
|
+
let actionItemsProcessed = 0;
|
|
575
|
+
let issuesProcessed = 0;
|
|
576
|
+
if (docsTable) {
|
|
577
|
+
const filtered = filterControlRows(docsTable);
|
|
578
|
+
documentsProcessed = importDocumentsTable(filtered, canonicalChecklist, ops, warnings);
|
|
579
|
+
}
|
|
580
|
+
if (actionsTable) {
|
|
581
|
+
const filtered = filterControlRows(actionsTable);
|
|
582
|
+
actionItemsProcessed = importActionItemsTable(filtered, canonicalChecklist, ops, warnings);
|
|
583
|
+
}
|
|
584
|
+
if (issuesTable) {
|
|
585
|
+
const filtered = filterControlRows(issuesTable);
|
|
586
|
+
issuesProcessed = importIssuesTable(filtered, canonicalChecklist, ops, warnings);
|
|
587
|
+
}
|
|
588
|
+
// Build patch envelope
|
|
589
|
+
const patch = ops.length > 0
|
|
590
|
+
? {
|
|
591
|
+
patch_id: `docx-import-${checklistId}-${Date.now()}`,
|
|
592
|
+
mode: 'APPLY',
|
|
593
|
+
expected_revision: currentRevision,
|
|
594
|
+
operations: ops,
|
|
595
|
+
source_event: {
|
|
596
|
+
provider: 'docx-import',
|
|
597
|
+
},
|
|
598
|
+
}
|
|
599
|
+
: null;
|
|
600
|
+
return {
|
|
601
|
+
ok: true,
|
|
602
|
+
patch,
|
|
603
|
+
warnings,
|
|
604
|
+
summary: {
|
|
605
|
+
documentsProcessed,
|
|
606
|
+
actionItemsProcessed,
|
|
607
|
+
issuesProcessed,
|
|
608
|
+
operationsGenerated: ops.length,
|
|
609
|
+
warningsGenerated: warnings.length,
|
|
610
|
+
},
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
//# sourceMappingURL=docx-import.js.map
|