@agent-teams/engineering-foundation 0.16.1 → 0.17.0-rc.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/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/filesystem-public-api-repository.d.ts +3 -2
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/filesystem-public-api-repository.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/filesystem-public-api-repository.js +39 -6
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/filesystem-public-api-repository.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.d.ts +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.js +5 -2
- package/dist/capabilities/public-api-compatibility/adapters/outbound/filesystem/public-api-baseline-mapper.js.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/ports/public-api-repository.d.ts +3 -2
- package/dist/capabilities/public-api-compatibility/application/ports/public-api-repository.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.d.ts.map +1 -1
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.js +19 -2
- package/dist/capabilities/public-api-compatibility/application/use-cases/promote-public-api-baselines.js.map +1 -1
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile-v2.d.ts +26 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile-v2.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile-v2.js +74 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile-v2.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader-v2.d.ts +9 -0
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader-v2.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader-v2.js +41 -0
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader-v2.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-contract-validator.d.ts +1 -1
- package/dist/document-authoring/adapters/node/node-document-contract-validator.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-contract-validator.js +1 -1
- package/dist/document-authoring/adapters/node/node-document-contract-validator.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-file-state.d.ts +1 -1
- package/dist/document-authoring/adapters/node/node-document-file-state.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-file-state.js +17 -1
- package/dist/document-authoring/adapters/node/node-document-file-state.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-metadata-sidecar-reader.d.ts +9 -0
- package/dist/document-authoring/adapters/node/node-document-metadata-sidecar-reader.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-metadata-sidecar-reader.js +87 -0
- package/dist/document-authoring/adapters/node/node-document-metadata-sidecar-reader.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-parent-materializer.d.ts +39 -0
- package/dist/document-authoring/adapters/node/node-document-parent-materializer.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-parent-materializer.js +270 -0
- package/dist/document-authoring/adapters/node/node-document-parent-materializer.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.js +11 -3
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.d.ts +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.js +18 -1
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-publisher.d.ts +1 -1
- package/dist/document-authoring/adapters/node/node-document-publisher.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-publisher.js +102 -11
- package/dist/document-authoring/adapters/node/node-document-publisher.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.d.ts +1 -1
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.d.ts +1 -1
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.js +1 -1
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-metadata-instance-validator.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-metadata-instance-validator.js +6 -0
- package/dist/document-authoring/adapters/node/node-metadata-instance-validator.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-path-authority.d.ts +53 -0
- package/dist/document-authoring/adapters/node/node-path-authority.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-path-authority.js +186 -0
- package/dist/document-authoring/adapters/node/node-path-authority.js.map +1 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.d.ts +2 -1
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.js +21 -77
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.js.map +1 -1
- package/dist/document-authoring/application/model/document-authoring-profile-description.d.ts +53 -0
- package/dist/document-authoring/application/model/document-authoring-profile-description.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-authoring-profile-description.js +2 -0
- package/dist/document-authoring/application/model/document-authoring-profile-description.js.map +1 -0
- package/dist/document-authoring/application/model/document-catalog.d.ts +29 -0
- package/dist/document-authoring/application/model/document-catalog.d.ts.map +1 -1
- package/dist/document-authoring/application/model/document-find.d.ts +5 -1
- package/dist/document-authoring/application/model/document-find.d.ts.map +1 -1
- package/dist/document-authoring/application/model/document-parent-materialization.d.ts +26 -0
- package/dist/document-authoring/application/model/document-parent-materialization.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-parent-materialization.js +2 -0
- package/dist/document-authoring/application/model/document-parent-materialization.js.map +1 -0
- package/dist/document-authoring/application/model/document-planning.d.ts +29 -2
- package/dist/document-authoring/application/model/document-planning.d.ts.map +1 -1
- package/dist/document-authoring/application/model/document-receipt.d.ts +28 -1
- package/dist/document-authoring/application/model/document-receipt.d.ts.map +1 -1
- package/dist/document-authoring/application/model/document-transaction-inspection.d.ts +23 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.d.ts.map +1 -1
- package/dist/document-authoring/application/model/document-transaction.d.ts +91 -3
- package/dist/document-authoring/application/model/document-transaction.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/assert-artifact-owner-allowed.d.ts +3 -0
- package/dist/document-authoring/application/policies/assert-artifact-owner-allowed.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/assert-artifact-owner-allowed.js +8 -0
- package/dist/document-authoring/application/policies/assert-artifact-owner-allowed.js.map +1 -0
- package/dist/document-authoring/application/policies/assert-v2-planning-profile.d.ts +3 -0
- package/dist/document-authoring/application/policies/assert-v2-planning-profile.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/assert-v2-planning-profile.js +7 -0
- package/dist/document-authoring/application/policies/assert-v2-planning-profile.js.map +1 -0
- package/dist/document-authoring/application/policies/document-authoring-semantic-digests.d.ts +30 -0
- package/dist/document-authoring/application/policies/document-authoring-semantic-digests.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-authoring-semantic-digests.js +157 -0
- package/dist/document-authoring/application/policies/document-authoring-semantic-digests.js.map +1 -0
- package/dist/document-authoring/application/policies/document-catalog-authority-stability.d.ts +12 -0
- package/dist/document-authoring/application/policies/document-catalog-authority-stability.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-catalog-authority-stability.js +16 -0
- package/dist/document-authoring/application/policies/document-catalog-authority-stability.js.map +1 -0
- package/dist/document-authoring/application/policies/document-catalog-sidecar.d.ts +10 -0
- package/dist/document-authoring/application/policies/document-catalog-sidecar.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-catalog-sidecar.js +66 -0
- package/dist/document-authoring/application/policies/document-catalog-sidecar.js.map +1 -0
- package/dist/document-authoring/application/policies/document-command-projection.d.ts +1 -1
- package/dist/document-authoring/application/policies/document-command-projection.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/document-contract-digests.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/document-contract-digests.js +61 -7
- package/dist/document-authoring/application/policies/document-contract-digests.js.map +1 -1
- package/dist/document-authoring/application/policies/document-receipt-policy.d.ts +3 -3
- package/dist/document-authoring/application/policies/document-receipt-policy.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/document-receipt-policy.js +43 -4
- package/dist/document-authoring/application/policies/document-receipt-policy.js.map +1 -1
- package/dist/document-authoring/application/policies/document-transaction-digests.d.ts +2 -2
- package/dist/document-authoring/application/policies/document-transaction-digests.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/document-transaction-digests.js.map +1 -1
- package/dist/document-authoring/application/policies/document-transaction-envelope-body.d.ts +28 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-body.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-body.js +140 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-body.js.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.js +47 -6
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.js.map +1 -1
- package/dist/document-authoring/application/policies/inspect-catalog-document.d.ts +8 -1
- package/dist/document-authoring/application/policies/inspect-catalog-document.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/inspect-catalog-document.js +48 -0
- package/dist/document-authoring/application/policies/inspect-catalog-document.js.map +1 -1
- package/dist/document-authoring/application/policies/project-catalog-metadata.d.ts +7 -0
- package/dist/document-authoring/application/policies/project-catalog-metadata.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/project-catalog-metadata.js +165 -0
- package/dist/document-authoring/application/policies/project-catalog-metadata.js.map +1 -0
- package/dist/document-authoring/application/policies/same-document-catalog-snapshot.d.ts +3 -0
- package/dist/document-authoring/application/policies/same-document-catalog-snapshot.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/same-document-catalog-snapshot.js +24 -0
- package/dist/document-authoring/application/policies/same-document-catalog-snapshot.js.map +1 -0
- package/dist/document-authoring/application/ports/authoring-profile-reader.d.ts +10 -0
- package/dist/document-authoring/application/ports/authoring-profile-reader.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/document-authority-recompiler.d.ts +1 -1
- package/dist/document-authoring/application/ports/document-authority-recompiler.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/document-contract-validator.d.ts +1 -1
- package/dist/document-authoring/application/ports/document-contract-validator.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/document-file-state.d.ts +1 -1
- package/dist/document-authoring/application/ports/document-file-state.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/document-metadata-sidecar-reader.d.ts +13 -0
- package/dist/document-authoring/application/ports/document-metadata-sidecar-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-metadata-sidecar-reader.js +2 -0
- package/dist/document-authoring/application/ports/document-metadata-sidecar-reader.js.map +1 -0
- package/dist/document-authoring/application/ports/document-parent-materializer.d.ts +24 -0
- package/dist/document-authoring/application/ports/document-parent-materializer.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-parent-materializer.js +2 -0
- package/dist/document-authoring/application/ports/document-parent-materializer.js.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.d.ts +1 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/document-publisher.d.ts +1 -1
- package/dist/document-authoring/application/ports/document-publisher.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/document-reachability-projector.d.ts +1 -1
- package/dist/document-authoring/application/ports/document-reachability-projector.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/document-structure-verifier.d.ts +1 -1
- package/dist/document-authoring/application/ports/document-structure-verifier.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/documentation-catalog-reader-v2.d.ts +11 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader-v2.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader-v2.js +2 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader-v2.js.map +1 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.d.ts +2 -2
- package/dist/document-authoring/application/ports/documentation-catalog-reader.d.ts.map +1 -1
- package/dist/document-authoring/application/ports/documentation-search-catalog-reader-v2.d.ts +9 -0
- package/dist/document-authoring/application/ports/documentation-search-catalog-reader-v2.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/documentation-search-catalog-reader-v2.js +2 -0
- package/dist/document-authoring/application/ports/documentation-search-catalog-reader-v2.js.map +1 -0
- package/dist/document-authoring/application/ports/metadata-instance-validator.d.ts +1 -0
- package/dist/document-authoring/application/ports/metadata-instance-validator.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/apply-document-plan.d.ts +1 -1
- package/dist/document-authoring/application/use-cases/apply-document-plan.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/apply-document-plan.js +150 -54
- package/dist/document-authoring/application/use-cases/apply-document-plan.js.map +1 -1
- package/dist/document-authoring/application/use-cases/apply-document-recovery-receipt.d.ts +14 -0
- package/dist/document-authoring/application/use-cases/apply-document-recovery-receipt.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/apply-document-recovery-receipt.js +17 -0
- package/dist/document-authoring/application/use-cases/apply-document-recovery-receipt.js.map +1 -0
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.d.ts +18 -1
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.js +81 -26
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.js.map +1 -1
- package/dist/document-authoring/application/use-cases/compile-document-plan.d.ts +1 -1
- package/dist/document-authoring/application/use-cases/compile-document-plan.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/compile-document-plan.js +50 -6
- package/dist/document-authoring/application/use-cases/compile-document-plan.js.map +1 -1
- package/dist/document-authoring/application/use-cases/document-parent-materialization-continuation.d.ts +3 -0
- package/dist/document-authoring/application/use-cases/document-parent-materialization-continuation.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-parent-materialization-continuation.js +79 -0
- package/dist/document-authoring/application/use-cases/document-parent-materialization-continuation.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.d.ts +18 -13
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.js +88 -165
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.js.map +1 -1
- package/dist/document-authoring/application/use-cases/document-transaction-receipts.d.ts +21 -0
- package/dist/document-authoring/application/use-cases/document-transaction-receipts.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-receipts.js +180 -0
- package/dist/document-authoring/application/use-cases/document-transaction-receipts.js.map +1 -0
- package/dist/document-authoring/application/use-cases/find-documents.d.ts +7 -1
- package/dist/document-authoring/application/use-cases/find-documents.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/find-documents.js +19 -0
- package/dist/document-authoring/application/use-cases/find-documents.js.map +1 -1
- package/dist/document-authoring/application/use-cases/load-v2-profile-description.d.ts +15 -0
- package/dist/document-authoring/application/use-cases/load-v2-profile-description.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/load-v2-profile-description.js +12 -0
- package/dist/document-authoring/application/use-cases/load-v2-profile-description.js.map +1 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.d.ts +12 -4
- package/dist/document-authoring/application/use-cases/plan-documentation-document.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/plan-documentation-document.js +25 -28
- package/dist/document-authoring/application/use-cases/plan-documentation-document.js.map +1 -1
- package/dist/document-authoring/application/use-cases/recapture-directory-receipt-evidence.d.ts +8 -0
- package/dist/document-authoring/application/use-cases/recapture-directory-receipt-evidence.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/recapture-directory-receipt-evidence.js +32 -0
- package/dist/document-authoring/application/use-cases/recapture-directory-receipt-evidence.js.map +1 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.d.ts +1 -1
- package/dist/document-authoring/application/use-cases/recover-document-transaction.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/recover-document-transaction.js +148 -20
- package/dist/document-authoring/application/use-cases/recover-document-transaction.js.map +1 -1
- package/dist/document-authoring/application/use-cases/run-document-doctor.d.ts +2 -2
- package/dist/document-authoring/application/use-cases/run-document-doctor.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/run-document-doctor.js.map +1 -1
- package/dist/document-authoring/application/use-cases/run-document-new.d.ts +4 -4
- package/dist/document-authoring/application/use-cases/run-document-new.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/run-document-new.js.map +1 -1
- package/dist/document-authoring/application/use-cases/run-document-recover.d.ts +3 -3
- package/dist/document-authoring/application/use-cases/run-document-recover.d.ts.map +1 -1
- package/dist/document-authoring/composition/describe-document-authoring-profile-v2.d.ts +8 -0
- package/dist/document-authoring/composition/describe-document-authoring-profile-v2.d.ts.map +1 -0
- package/dist/document-authoring/composition/describe-document-authoring-profile-v2.js +183 -0
- package/dist/document-authoring/composition/describe-document-authoring-profile-v2.js.map +1 -0
- package/dist/document-authoring/composition/inspect-document-authoring-environment-v1.d.ts +7 -0
- package/dist/document-authoring/composition/inspect-document-authoring-environment-v1.d.ts.map +1 -0
- package/dist/document-authoring/composition/inspect-document-authoring-environment-v1.js +10 -0
- package/dist/document-authoring/composition/inspect-document-authoring-environment-v1.js.map +1 -0
- package/dist/document-authoring/composition/inspect-document-transaction.d.ts +3 -1
- package/dist/document-authoring/composition/inspect-document-transaction.d.ts.map +1 -1
- package/dist/document-authoring/composition/inspect-document-transaction.js +39 -1
- package/dist/document-authoring/composition/inspect-document-transaction.js.map +1 -1
- package/dist/document-authoring/composition/node-document-authority-recompiler.d.ts +1 -1
- package/dist/document-authoring/composition/node-document-authority-recompiler.d.ts.map +1 -1
- package/dist/document-authoring/composition/node-document-authority-recompiler.js +22 -3
- package/dist/document-authoring/composition/node-document-authority-recompiler.js.map +1 -1
- package/dist/document-authoring/composition/node-document-commands.js +2 -2
- package/dist/document-authoring/composition/node-document-planning.d.ts +2 -2
- package/dist/document-authoring/composition/node-document-planning.d.ts.map +1 -1
- package/dist/document-authoring/composition/node-document-planning.js +28 -7
- package/dist/document-authoring/composition/node-document-planning.js.map +1 -1
- package/dist/document-authoring/composition/node-document-writing-private.d.ts +1 -1
- package/dist/document-authoring/composition/node-document-writing-private.d.ts.map +1 -1
- package/dist/document-authoring/composition/node-document-writing-private.js +5 -3
- package/dist/document-authoring/composition/node-document-writing-private.js.map +1 -1
- package/dist/document-authoring/composition/node-document-writing.d.ts +1 -1
- package/dist/document-authoring/composition/node-document-writing.d.ts.map +1 -1
- package/dist/document-authoring/index.d.ts +29 -8
- package/dist/document-authoring/index.d.ts.map +1 -1
- package/dist/document-authoring/index.js +50 -3
- package/dist/document-authoring/index.js.map +1 -1
- package/dist/document-authoring/qualification/index.d.ts +22 -0
- package/dist/document-authoring/qualification/index.d.ts.map +1 -0
- package/dist/document-authoring/qualification/index.js +131 -0
- package/dist/document-authoring/qualification/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/local-mode/inspection.d.ts.map +1 -1
- package/dist/local-mode/inspection.js +2 -1
- package/dist/local-mode/inspection.js.map +1 -1
- package/dist/mutation/index.d.ts +3 -0
- package/dist/mutation/index.d.ts.map +1 -0
- package/dist/mutation/index.js +2 -0
- package/dist/mutation/index.js.map +1 -0
- package/dist/package-self-check.d.ts +1 -1
- package/dist/package-self-check.d.ts.map +1 -1
- package/dist/package-self-check.js +12 -0
- package/dist/package-self-check.js.map +1 -1
- package/dist/public-api-surface.d.ts +1 -0
- package/dist/public-api-surface.d.ts.map +1 -1
- package/dist/public-api-surface.js +1 -0
- package/dist/public-api-surface.js.map +1 -1
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.d.ts.map +1 -1
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.js +21 -0
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.js.map +1 -1
- package/dist/repository-mutation/adapters/node/node-create-and-bind-directory.d.ts +15 -0
- package/dist/repository-mutation/adapters/node/node-create-and-bind-directory.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-create-and-bind-directory.js +23 -0
- package/dist/repository-mutation/adapters/node/node-create-and-bind-directory.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-directory-materialization.d.ts +37 -0
- package/dist/repository-mutation/adapters/node/node-directory-materialization.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-directory-materialization.js +224 -0
- package/dist/repository-mutation/adapters/node/node-directory-materialization.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.d.ts +1 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.d.ts.map +1 -1
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.js +1 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.js.map +1 -1
- package/dist/repository-mutation/application/model/directory-materialization.d.ts +35 -0
- package/dist/repository-mutation/application/model/directory-materialization.d.ts.map +1 -0
- package/dist/repository-mutation/application/model/directory-materialization.js +11 -0
- package/dist/repository-mutation/application/model/directory-materialization.js.map +1 -0
- package/dist/schema-catalog.d.ts.map +1 -1
- package/dist/schema-catalog.js +9 -0
- package/dist/schema-catalog.js.map +1 -1
- package/dist/schema-ids.d.ts +1 -1
- package/dist/schema-ids.d.ts.map +1 -1
- package/dist/schema-ids.js +5 -0
- package/dist/schema-ids.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.d.ts +2 -2
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.js +33 -19
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.d.ts +1 -1
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.js +11 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.js.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.d.ts.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.js +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.js.map +1 -1
- package/dist/transaction-coordination/application/model/internal-transaction-status.d.ts +2 -2
- package/dist/transaction-coordination/application/model/internal-transaction-status.d.ts.map +1 -1
- package/package.json +14 -1
- package/schemas/document-authoring-profile/v2.schema.json +168 -0
- package/schemas/document-parent-materialization/v2.schema.json +65 -0
- package/schemas/document-plan/v2.schema.json +85 -0
- package/schemas/document-receipt/v2.schema.json +108 -0
- package/schemas/foundation-transaction-envelope/v4.schema.json +164 -0
|
@@ -3,7 +3,7 @@ import { readBoundedRegularFile } from "../../../repository-mutation/adapters/no
|
|
|
3
3
|
import { assertNonzeroDocumentPhysicalIdentity } from "../../application/model/document-physical-identity.js";
|
|
4
4
|
import { isDocumentRepositoryPath } from "../../application/policies/document-repository-path.js";
|
|
5
5
|
import { documentTemporaryPath } from "../../application/policies/document-temporary-path.js";
|
|
6
|
-
import { recaptureDocumentPublicationPaths, sameDocumentPhysicalIdentity } from "./recapture-document-publication-paths.js";
|
|
6
|
+
import { recaptureDocumentPublicationPaths, sameDocumentAncestry, sameDocumentPhysicalIdentity } from "./recapture-document-publication-paths.js";
|
|
7
7
|
const MAXIMUM_DOCUMENT_BYTES = 1_048_576;
|
|
8
8
|
function digest(bytes) {
|
|
9
9
|
return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
@@ -42,6 +42,16 @@ function planPostimage(plan) {
|
|
|
42
42
|
size: plan.output.size
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
async function assertPublicationAncestryStable(consumerRoot, repositoryPath, before) {
|
|
46
|
+
const after = await recaptureDocumentPublicationPaths({
|
|
47
|
+
consumerRoot,
|
|
48
|
+
destination: repositoryPath
|
|
49
|
+
});
|
|
50
|
+
if (before.destinationPath !== after.destinationPath ||
|
|
51
|
+
!sameDocumentAncestry(before.ancestryIdentities, after.ancestryIdentities)) {
|
|
52
|
+
throw new Error("Document path ancestry changed while filesystem state was read.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
45
55
|
function conflict(error) {
|
|
46
56
|
return {
|
|
47
57
|
state: "conflict",
|
|
@@ -79,11 +89,13 @@ export class NodeDocumentFileState {
|
|
|
79
89
|
catch (error) {
|
|
80
90
|
if (error instanceof Error && "code" in error &&
|
|
81
91
|
error.code === "ENOENT") {
|
|
92
|
+
await assertPublicationAncestryStable(request.consumerRoot, path, paths);
|
|
82
93
|
return { state: "absent" };
|
|
83
94
|
}
|
|
84
95
|
throw error;
|
|
85
96
|
}
|
|
86
97
|
request.signal?.throwIfAborted();
|
|
98
|
+
await assertPublicationAncestryStable(request.consumerRoot, path, paths);
|
|
87
99
|
if (observed.outcome !== "read") {
|
|
88
100
|
return unverifiable("Derived document temporary is not a stable regular file.");
|
|
89
101
|
}
|
|
@@ -116,11 +128,13 @@ export class NodeDocumentFileState {
|
|
|
116
128
|
catch (error) {
|
|
117
129
|
if (error instanceof Error && "code" in error &&
|
|
118
130
|
error.code === "ENOENT") {
|
|
131
|
+
await assertPublicationAncestryStable(request.consumerRoot, request.plan.destination, paths);
|
|
119
132
|
return { state: "absent" };
|
|
120
133
|
}
|
|
121
134
|
throw error;
|
|
122
135
|
}
|
|
123
136
|
request.signal?.throwIfAborted();
|
|
137
|
+
await assertPublicationAncestryStable(request.consumerRoot, request.plan.destination, paths);
|
|
124
138
|
const expected = planPostimage(request.plan);
|
|
125
139
|
if (observed.outcome !== "read" ||
|
|
126
140
|
observed.bytes.byteLength !== expected.size ||
|
|
@@ -159,11 +173,13 @@ export class NodeDocumentFileState {
|
|
|
159
173
|
catch (error) {
|
|
160
174
|
if (error instanceof Error && "code" in error &&
|
|
161
175
|
error.code === "ENOENT") {
|
|
176
|
+
await assertPublicationAncestryStable(request.consumerRoot, request.temporary.path, paths);
|
|
162
177
|
return { state: "absent" };
|
|
163
178
|
}
|
|
164
179
|
throw error;
|
|
165
180
|
}
|
|
166
181
|
request.signal?.throwIfAborted();
|
|
182
|
+
await assertPublicationAncestryStable(request.consumerRoot, request.temporary.path, paths);
|
|
167
183
|
if (observed.outcome !== "read" ||
|
|
168
184
|
!sameDocumentPhysicalIdentity(observed.identity, expected) ||
|
|
169
185
|
digest(observed.bytes) !== request.temporary.digest ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-document-file-state.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-file-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yEAAyE,CAAC;AAEjH,OAAO,EACL,qCAAqC,EAEtC,MAAM,uDAAuD,CAAC;AAS/D,OAAO,EAAE,wBAAwB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AQ,CAAC,6DAA6D,CAAC,CAAC;YACjF,CAAC;YACD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrC,MAAM,KAAK,CAAC;YACd,CAAC;YACD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"node-document-file-state.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-file-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yEAAyE,CAAC;AAEjH,OAAO,EACL,qCAAqC,EAEtC,MAAM,uDAAuD,CAAC;AAS/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EACL,iCAAiC,EACjC,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,2CAA2C,CAAC;AAEnD,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAEzC,SAAS,MAAM,CAAC,KAAiB;IAC/B,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACtE,CAAC;AAED,SAAS,QAAQ,CAAC,SAAiC;IACjD,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC;IACjC,IAAI,CAAC;QACH,qCAAqC,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG;QACb,GAAG,EAAE,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AC,IAAI,EACtB,KAAK,CACN,CAAC;YACF,IAAI,QAAQ,CAAC,OAAO,KAAK,MAAM;gBAC7B,CAAC,4BAA4B,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAC1D,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,MAAM;gBACnD,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;gBACtE,OAAO,QAAQ,CAAC,6DAA6D,CAAC,CAAC;YACjF,CAAC;YACD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrC,MAAM,KAAK,CAAC;YACd,CAAC;YACD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DocumentMetadataSidecarReader, DocumentMetadataSidecarSnapshot } from "../../application/ports/document-metadata-sidecar-reader.js";
|
|
2
|
+
export declare class NodeDocumentMetadataSidecarReader implements DocumentMetadataSidecarReader {
|
|
3
|
+
read(request: {
|
|
4
|
+
readonly consumerRoot: string;
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly signal?: AbortSignal;
|
|
7
|
+
}): Promise<DocumentMetadataSidecarSnapshot>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=node-document-metadata-sidecar-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-metadata-sidecar-reader.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-metadata-sidecar-reader.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,6BAA6B,EAC7B,+BAA+B,EAChC,MAAM,6DAA6D,CAAC;AAkFrE,qBAAa,iCACX,YAAW,6BAA6B;IAElC,IAAI,CAAC,OAAO,EAAE;QAClB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAU3C;CACF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { CapabilityInputError } from "../../../capability-runtime.js";
|
|
2
|
+
import { assertNotCancelled } from "../../../cancellation.js";
|
|
3
|
+
import { parseStrictYamlSource } from "../../../strict-yaml.js";
|
|
4
|
+
import { compareBinaryStrings } from "../../../binary-string-comparator.js";
|
|
5
|
+
import { isDocumentRepositoryPath } from "../../application/policies/document-repository-path.js";
|
|
6
|
+
import { CatalogMetadataProjectionError, projectCatalogMetadata } from "../../application/policies/project-catalog-metadata.js";
|
|
7
|
+
import { DocumentCatalogError } from "../../document-catalog-error.js";
|
|
8
|
+
import { readDocumentAuthorityFile } from "./read-document-authority-file.js";
|
|
9
|
+
const MAXIMUM_SIDECAR_BYTES = 1024 * 1024;
|
|
10
|
+
const MAXIMUM_SIDECAR_DOCUMENTS = 10_000;
|
|
11
|
+
function isRecord(value) {
|
|
12
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13
|
+
}
|
|
14
|
+
function invalidSidecar(message, cause) {
|
|
15
|
+
throw new DocumentCatalogError("DOCUMENT_CATALOG_INPUT_INVALID", `Document metadata sidecar is invalid: ${message}`, cause === undefined ? undefined : { cause });
|
|
16
|
+
}
|
|
17
|
+
function projectDocuments(value) {
|
|
18
|
+
if (!isRecord(value)) {
|
|
19
|
+
invalidSidecar("documents must be a mapping.");
|
|
20
|
+
}
|
|
21
|
+
const paths = Reflect.ownKeys(value);
|
|
22
|
+
if (paths.some((path) => typeof path !== "string")) {
|
|
23
|
+
invalidSidecar("document paths must be strings.");
|
|
24
|
+
}
|
|
25
|
+
if (paths.length > MAXIMUM_SIDECAR_DOCUMENTS) {
|
|
26
|
+
invalidSidecar(`documents exceeds ${MAXIMUM_SIDECAR_DOCUMENTS} entries.`);
|
|
27
|
+
}
|
|
28
|
+
const projected = {};
|
|
29
|
+
for (const path of paths.toSorted(compareBinaryStrings)) {
|
|
30
|
+
if (!isDocumentRepositoryPath(path) || !path.toLowerCase().endsWith(".md")) {
|
|
31
|
+
invalidSidecar(`document path is not portable Markdown: ${path}.`);
|
|
32
|
+
}
|
|
33
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, path);
|
|
34
|
+
if (descriptor === undefined ||
|
|
35
|
+
!("value" in descriptor) ||
|
|
36
|
+
descriptor.enumerable !== true) {
|
|
37
|
+
invalidSidecar("documents must contain enumerable own data properties.");
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
projected[path] = projectCatalogMetadata(descriptor.value);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (error instanceof CatalogMetadataProjectionError) {
|
|
44
|
+
invalidSidecar(`${path}: ${error.message}`, error);
|
|
45
|
+
}
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return Object.freeze(projected);
|
|
50
|
+
}
|
|
51
|
+
function parseSidecar(source) {
|
|
52
|
+
let input;
|
|
53
|
+
try {
|
|
54
|
+
input = parseStrictYamlSource(source, "document-metadata-sidecar");
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (error instanceof CapabilityInputError) {
|
|
58
|
+
invalidSidecar(error.message, error);
|
|
59
|
+
}
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
if (!isRecord(input)) {
|
|
63
|
+
invalidSidecar("root must be an object.");
|
|
64
|
+
}
|
|
65
|
+
const keys = Object.keys(input).toSorted(compareBinaryStrings);
|
|
66
|
+
if (keys.length !== 2 ||
|
|
67
|
+
keys[0] !== "contract" ||
|
|
68
|
+
keys[1] !== "documents" ||
|
|
69
|
+
input["contract"] !== "foundation.document-metadata-sidecar/v1") {
|
|
70
|
+
invalidSidecar("root must contain only contract foundation.document-metadata-sidecar/v1 and documents.");
|
|
71
|
+
}
|
|
72
|
+
return projectDocuments(input["documents"]);
|
|
73
|
+
}
|
|
74
|
+
export class NodeDocumentMetadataSidecarReader {
|
|
75
|
+
async read(request) {
|
|
76
|
+
assertNotCancelled(request.signal);
|
|
77
|
+
const file = await readDocumentAuthorityFile({
|
|
78
|
+
consumerRoot: request.consumerRoot,
|
|
79
|
+
maxBytes: MAXIMUM_SIDECAR_BYTES,
|
|
80
|
+
path: request.path
|
|
81
|
+
});
|
|
82
|
+
const documents = parseSidecar(file.source);
|
|
83
|
+
assertNotCancelled(request.signal);
|
|
84
|
+
return Object.freeze({ documents, evidence: file.evidence });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=node-document-metadata-sidecar-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-metadata-sidecar-reader.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-metadata-sidecar-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,wDAAwD,CAAC;AAKhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCA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I,CAAC,MAAM,KAAK,CAAC;QACjB,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU;QACtB,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW;QACvB,KAAK,CAAC,UAAU,CAAC,KAAK,yCAAyC,EAC/D,CAAC;QACD,cAAc,CACZ,wFAAwF,CACzF,CAAC;IACJ,CAAC;IACD,OAAO,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,OAAO,iCAAiC;IAG5C,KAAK,CAAC,IAAI,CAAC,OAIV;QACC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,yBAAyB,CAAC;YAC3C,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,QAAQ,EAAE,qBAAqB;YAC/B,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;QACH,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5C,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type DocumentPhysicalIdentity } from "../../application/model/document-physical-identity.js";
|
|
2
|
+
import type { DocumentCreatedDirectoryEvidenceV2, DocumentParentMaterializationInspectionV2, DocumentParentMaterializationJournalV2, DocumentParentMaterializationPlanV2 } from "../../application/model/document-parent-materialization.js";
|
|
3
|
+
import { type NodePathAuthorityOperations } from "./node-path-authority.js";
|
|
4
|
+
interface Operations extends NodePathAuthorityOperations {
|
|
5
|
+
readonly mkdir: (path: string, options: {
|
|
6
|
+
readonly mode: number;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
readonly syncDirectory: (path: string) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function planDocumentParentMaterializationV2(request: {
|
|
11
|
+
readonly consumerRoot: string;
|
|
12
|
+
readonly destination: string;
|
|
13
|
+
readonly signal?: AbortSignal;
|
|
14
|
+
}): Promise<DocumentParentMaterializationPlanV2>;
|
|
15
|
+
export declare class NodeDocumentParentMaterializerV2 {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(overrides?: Partial<Operations>);
|
|
18
|
+
begin(request: {
|
|
19
|
+
readonly consumerRoot: string;
|
|
20
|
+
readonly plan: DocumentParentMaterializationPlanV2;
|
|
21
|
+
}): Promise<DocumentParentMaterializationJournalV2>;
|
|
22
|
+
inspect(request: {
|
|
23
|
+
readonly consumerRoot: string;
|
|
24
|
+
readonly journal: DocumentParentMaterializationJournalV2;
|
|
25
|
+
}): Promise<DocumentParentMaterializationInspectionV2>;
|
|
26
|
+
createNext(request: {
|
|
27
|
+
readonly consumerRoot: string;
|
|
28
|
+
readonly journal: DocumentParentMaterializationJournalV2;
|
|
29
|
+
readonly signal?: AbortSignal;
|
|
30
|
+
}): Promise<DocumentCreatedDirectoryEvidenceV2 | undefined>;
|
|
31
|
+
createAndBindOne(request: {
|
|
32
|
+
readonly consumerRoot: string;
|
|
33
|
+
readonly expectedParentIdentity: DocumentPhysicalIdentity;
|
|
34
|
+
readonly path: string;
|
|
35
|
+
readonly bindCreatedDirectory: (evidence: DocumentCreatedDirectoryEvidenceV2) => Promise<void>;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=node-document-parent-materializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-parent-materializer.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-parent-materializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,KAAK,EACV,kCAAkC,EAClC,y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,OAAO,CAAC,kCAAkC,GAAG,SAAS,CAAC,CAuD1D;IAEK,gBAAgB,CAAC,OAAO,EAAE;QAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,sBAAsB,EAAE,wBAAwB,CAAC;QAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,oBAAoB,EAAE,CAC7B,QAAQ,EAAE,kCAAkC,KACzC,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDhB;CAEF"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { lstat, mkdir, readdir, realpath } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { syncDirectoryStrictly } from "../../../repository-mutation/adapters/node/node-directory-durability.js";
|
|
4
|
+
import { createAndBindNodeDirectory } from "../../../repository-mutation/adapters/node/node-create-and-bind-directory.js";
|
|
5
|
+
import { assertNonzeroDocumentPhysicalIdentity } from "../../application/model/document-physical-identity.js";
|
|
6
|
+
import { isDocumentRepositoryPath } from "../../application/policies/document-repository-path.js";
|
|
7
|
+
import { captureNodeRepositoryDirectoryAuthority, captureNodeRepositoryPathAuthority, captureNodeRepositoryRootAuthority, sameNodePathAncestry, sameNodePathIdentity } from "./node-path-authority.js";
|
|
8
|
+
const nodeOperations = {
|
|
9
|
+
lstat: (path) => lstat(path, { bigint: true }),
|
|
10
|
+
async mkdir(path, options) {
|
|
11
|
+
await mkdir(path, options);
|
|
12
|
+
},
|
|
13
|
+
readdir,
|
|
14
|
+
realpath,
|
|
15
|
+
syncDirectory: syncDirectoryStrictly
|
|
16
|
+
};
|
|
17
|
+
function isMissing(error) {
|
|
18
|
+
return error instanceof Error && "code" in error &&
|
|
19
|
+
["ENOENT", "ENOTDIR"].includes(error.code ?? "");
|
|
20
|
+
}
|
|
21
|
+
function documentIdentity(identity) {
|
|
22
|
+
const result = {
|
|
23
|
+
adapter: "node-filesystem",
|
|
24
|
+
version: 1,
|
|
25
|
+
birthtimeNs: identity.birthtimeNs.toString(10),
|
|
26
|
+
dev: identity.dev.toString(10),
|
|
27
|
+
ino: identity.ino.toString(10)
|
|
28
|
+
};
|
|
29
|
+
assertNonzeroDocumentPhysicalIdentity(result);
|
|
30
|
+
return Object.freeze(result);
|
|
31
|
+
}
|
|
32
|
+
function portableIdentity(identity) {
|
|
33
|
+
assertNonzeroDocumentPhysicalIdentity(identity);
|
|
34
|
+
return {
|
|
35
|
+
birthtimeNs: BigInt(identity.birthtimeNs),
|
|
36
|
+
dev: BigInt(identity.dev),
|
|
37
|
+
ino: BigInt(identity.ino)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function assertClosedPlan(plan) {
|
|
41
|
+
if (plan.policy !==
|
|
42
|
+
"create-missing-real-directories" ||
|
|
43
|
+
(plan.deepestExistingDirectory !== "." &&
|
|
44
|
+
!isDocumentRepositoryPath(plan.deepestExistingDirectory)) ||
|
|
45
|
+
(plan.finalParent !== "." && !isDocumentRepositoryPath(plan.finalParent))) {
|
|
46
|
+
throw new TypeError("Document parent materialization Plan is invalid.");
|
|
47
|
+
}
|
|
48
|
+
const expected = [];
|
|
49
|
+
let current = plan.deepestExistingDirectory;
|
|
50
|
+
const anchorSegments = current === "." ? [] : current.split("/");
|
|
51
|
+
const finalSegments = plan.finalParent === "." ? [] : plan.finalParent.split("/");
|
|
52
|
+
if (anchorSegments.length > finalSegments.length ||
|
|
53
|
+
anchorSegments.some((segment, index) => segment !== finalSegments[index])) {
|
|
54
|
+
throw new TypeError("Materialization anchor is not an ancestor of the final parent.");
|
|
55
|
+
}
|
|
56
|
+
for (const segment of finalSegments.slice(anchorSegments.length)) {
|
|
57
|
+
current = current === "." ? segment : `${current}/${segment}`;
|
|
58
|
+
expected.push(current);
|
|
59
|
+
}
|
|
60
|
+
if (expected.length !== plan.missingDirectories.length ||
|
|
61
|
+
expected.some((path, index) => path !== plan.missingDirectories[index])) {
|
|
62
|
+
throw new TypeError("Materialization missing directories are not one exact parent chain.");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export async function planDocumentParentMaterializationV2(request) {
|
|
66
|
+
request.signal?.throwIfAborted();
|
|
67
|
+
if (!isDocumentRepositoryPath(request.destination)) {
|
|
68
|
+
throw new TypeError("Document destination is not a portable repository path.");
|
|
69
|
+
}
|
|
70
|
+
await captureNodeRepositoryRootAuthority(request.consumerRoot, nodeOperations);
|
|
71
|
+
const parentSegments = request.destination.split("/").slice(0, -1);
|
|
72
|
+
let deepestExistingDirectory = ".";
|
|
73
|
+
let firstMissing = parentSegments.length;
|
|
74
|
+
for (let index = 0; index < parentSegments.length; index += 1) {
|
|
75
|
+
request.signal?.throwIfAborted();
|
|
76
|
+
const repositoryPath = parentSegments.slice(0, index + 1).join("/");
|
|
77
|
+
try {
|
|
78
|
+
await captureNodeRepositoryDirectoryAuthority({
|
|
79
|
+
consumerRoot: request.consumerRoot,
|
|
80
|
+
operations: nodeOperations,
|
|
81
|
+
repositoryPath
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
if (isMissing(error)) {
|
|
86
|
+
firstMissing = index;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
deepestExistingDirectory = repositoryPath;
|
|
92
|
+
}
|
|
93
|
+
const missingDirectories = Object.freeze(parentSegments.slice(firstMissing).map((_segment, offset) => parentSegments.slice(0, firstMissing + offset + 1).join("/")));
|
|
94
|
+
const finalParent = parentSegments.length === 0 ? "." : parentSegments.join("/");
|
|
95
|
+
const plan = Object.freeze({
|
|
96
|
+
deepestExistingDirectory,
|
|
97
|
+
finalParent,
|
|
98
|
+
missingDirectories,
|
|
99
|
+
policy: "create-missing-real-directories"
|
|
100
|
+
});
|
|
101
|
+
assertClosedPlan(plan);
|
|
102
|
+
return plan;
|
|
103
|
+
}
|
|
104
|
+
export class NodeDocumentParentMaterializerV2 {
|
|
105
|
+
#operations;
|
|
106
|
+
constructor(overrides = {}) {
|
|
107
|
+
this.#operations = { ...nodeOperations, ...overrides };
|
|
108
|
+
}
|
|
109
|
+
async begin(request) {
|
|
110
|
+
assertClosedPlan(request.plan);
|
|
111
|
+
const anchor = await captureNodeRepositoryDirectoryAuthority({
|
|
112
|
+
consumerRoot: request.consumerRoot,
|
|
113
|
+
operations: this.#operations,
|
|
114
|
+
repositoryPath: request.plan.deepestExistingDirectory
|
|
115
|
+
});
|
|
116
|
+
return Object.freeze({
|
|
117
|
+
anchorIdentity: documentIdentity(anchor.directoryIdentity),
|
|
118
|
+
createdDirectories: Object.freeze([]),
|
|
119
|
+
plan: request.plan,
|
|
120
|
+
schemaVersion: 2
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
async inspect(request) {
|
|
124
|
+
const { journal } = request;
|
|
125
|
+
assertClosedPlan(journal.plan);
|
|
126
|
+
assertNonzeroDocumentPhysicalIdentity(journal.anchorIdentity);
|
|
127
|
+
if (journal.createdDirectories.length > journal.plan.missingDirectories.length ||
|
|
128
|
+
journal.createdDirectories.some((entry, index) => entry.path !== journal.plan.missingDirectories[index])) {
|
|
129
|
+
throw new TypeError("Created directory evidence must be an exact Plan prefix.");
|
|
130
|
+
}
|
|
131
|
+
const createdByPath = new Map(journal.createdDirectories.map((entry) => [entry.path, entry]));
|
|
132
|
+
let anchor;
|
|
133
|
+
try {
|
|
134
|
+
anchor = await captureNodeRepositoryDirectoryAuthority({
|
|
135
|
+
consumerRoot: request.consumerRoot,
|
|
136
|
+
operations: this.#operations,
|
|
137
|
+
repositoryPath: journal.plan.deepestExistingDirectory
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return { path: journal.plan.deepestExistingDirectory, reason: "anchor-changed", state: "manual-recovery-required" };
|
|
142
|
+
}
|
|
143
|
+
if (!sameNodePathIdentity(anchor.directoryIdentity, portableIdentity(journal.anchorIdentity))) {
|
|
144
|
+
return { path: journal.plan.deepestExistingDirectory, reason: "anchor-changed", state: "manual-recovery-required" };
|
|
145
|
+
}
|
|
146
|
+
for (const path of journal.plan.missingDirectories) {
|
|
147
|
+
const expected = createdByPath.get(path);
|
|
148
|
+
let captured;
|
|
149
|
+
try {
|
|
150
|
+
captured = await captureNodeRepositoryDirectoryAuthority({
|
|
151
|
+
consumerRoot: request.consumerRoot,
|
|
152
|
+
operations: this.#operations,
|
|
153
|
+
repositoryPath: path
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
if (isMissing(error)) {
|
|
158
|
+
if (expected !== undefined) {
|
|
159
|
+
return { path, reason: "created-directory-changed", state: "manual-recovery-required" };
|
|
160
|
+
}
|
|
161
|
+
return { nextDirectory: path, state: "current" };
|
|
162
|
+
}
|
|
163
|
+
if (expected !== undefined) {
|
|
164
|
+
return { path, reason: "created-directory-changed", state: "manual-recovery-required" };
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
path,
|
|
168
|
+
reason: error instanceof Error &&
|
|
169
|
+
/portable name collision/u.test(error.message)
|
|
170
|
+
? "portable-name-collision"
|
|
171
|
+
: "unbound-directory-exists",
|
|
172
|
+
state: "manual-recovery-required"
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (expected === undefined) {
|
|
176
|
+
return { path, reason: "unbound-directory-exists", state: "manual-recovery-required" };
|
|
177
|
+
}
|
|
178
|
+
if (!sameNodePathIdentity(captured.directoryIdentity, portableIdentity(expected.identity))) {
|
|
179
|
+
return { path, reason: "created-directory-changed", state: "manual-recovery-required" };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return { state: "current" };
|
|
183
|
+
}
|
|
184
|
+
async createNext(request) {
|
|
185
|
+
request.signal?.throwIfAborted();
|
|
186
|
+
const inspection = await this.inspect(request);
|
|
187
|
+
if (inspection.state !== "current") {
|
|
188
|
+
throw new Error(`Document parent materialization requires manual recovery: ${inspection.reason}.`);
|
|
189
|
+
}
|
|
190
|
+
if (inspection.nextDirectory === undefined) {
|
|
191
|
+
return undefined;
|
|
192
|
+
}
|
|
193
|
+
const path = inspection.nextDirectory;
|
|
194
|
+
const targetAuthority = await captureNodeRepositoryPathAuthority({
|
|
195
|
+
consumerRoot: request.consumerRoot,
|
|
196
|
+
operations: this.#operations,
|
|
197
|
+
repositoryPath: path
|
|
198
|
+
});
|
|
199
|
+
const basename = path.split("/").at(-1);
|
|
200
|
+
request.signal?.throwIfAborted();
|
|
201
|
+
const absolute = join(targetAuthority.parent, basename);
|
|
202
|
+
await this.#operations.mkdir(absolute, { mode: 0o755 });
|
|
203
|
+
const firstObservedAfterMkdir = await this.#operations.lstat(absolute);
|
|
204
|
+
// No cancellation observation after mkdir: the returned identity must be
|
|
205
|
+
// durably journaled by the caller before another directory is created.
|
|
206
|
+
const createdIdentity = portableIdentity(documentIdentity(firstObservedAfterMkdir));
|
|
207
|
+
const captured = await captureNodeRepositoryDirectoryAuthority({
|
|
208
|
+
consumerRoot: request.consumerRoot,
|
|
209
|
+
operations: this.#operations,
|
|
210
|
+
repositoryPath: path
|
|
211
|
+
});
|
|
212
|
+
if (!sameNodePathIdentity(createdIdentity, captured.directoryIdentity) ||
|
|
213
|
+
!sameNodePathAncestry(targetAuthority.ancestry, captured.ancestry.slice(0, -1))) {
|
|
214
|
+
throw new Error("Created document directory changed before its identity could be bound. Manual recovery is required.");
|
|
215
|
+
}
|
|
216
|
+
await this.#operations.syncDirectory(targetAuthority.parent);
|
|
217
|
+
const finalCapture = await captureNodeRepositoryDirectoryAuthority({
|
|
218
|
+
consumerRoot: request.consumerRoot,
|
|
219
|
+
operations: this.#operations,
|
|
220
|
+
repositoryPath: path
|
|
221
|
+
});
|
|
222
|
+
if (!sameNodePathIdentity(createdIdentity, finalCapture.directoryIdentity) ||
|
|
223
|
+
!sameNodePathAncestry(captured.ancestry, finalCapture.ancestry)) {
|
|
224
|
+
throw new Error("Created document directory changed before its durable identity binding. Manual recovery is required.");
|
|
225
|
+
}
|
|
226
|
+
return Object.freeze({ path, identity: documentIdentity(createdIdentity) });
|
|
227
|
+
}
|
|
228
|
+
async createAndBindOne(request) {
|
|
229
|
+
const operations = this.#operations;
|
|
230
|
+
await createAndBindNodeDirectory({
|
|
231
|
+
ambiguousError: (error) => new Error(`Document directory creation is ambiguous and requires manual recovery: ${request.path}.`, { cause: error }),
|
|
232
|
+
bind: request.bindCreatedDirectory,
|
|
233
|
+
async captureParent() {
|
|
234
|
+
const target = await captureNodeRepositoryPathAuthority({
|
|
235
|
+
consumerRoot: request.consumerRoot,
|
|
236
|
+
operations,
|
|
237
|
+
repositoryPath: request.path
|
|
238
|
+
});
|
|
239
|
+
if (!sameNodePathIdentity(target.parentIdentity, portableIdentity(request.expectedParentIdentity))) {
|
|
240
|
+
throw new Error("Document materialization parent identity changed.");
|
|
241
|
+
}
|
|
242
|
+
return target;
|
|
243
|
+
},
|
|
244
|
+
async createAndObserve(target, markCreated) {
|
|
245
|
+
await operations.mkdir(target.destinationPath, { mode: 0o755 });
|
|
246
|
+
markCreated();
|
|
247
|
+
return portableIdentity(documentIdentity(await operations.lstat(target.destinationPath)));
|
|
248
|
+
},
|
|
249
|
+
async recapture(target, observed) {
|
|
250
|
+
const captured = await captureNodeRepositoryDirectoryAuthority({
|
|
251
|
+
consumerRoot: request.consumerRoot,
|
|
252
|
+
operations,
|
|
253
|
+
repositoryPath: request.path
|
|
254
|
+
});
|
|
255
|
+
if (!sameNodePathIdentity(observed, captured.directoryIdentity) ||
|
|
256
|
+
!sameNodePathAncestry(target.ancestry, captured.ancestry.slice(0, -1))) {
|
|
257
|
+
throw new Error("Created directory or its ancestry changed before binding.");
|
|
258
|
+
}
|
|
259
|
+
return Object.freeze({
|
|
260
|
+
identity: documentIdentity(captured.directoryIdentity),
|
|
261
|
+
path: request.path
|
|
262
|
+
});
|
|
263
|
+
},
|
|
264
|
+
async syncParent(target) {
|
|
265
|
+
await operations.syncDirectory(target.parent);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=node-document-parent-materializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-parent-materializer.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-parent-materializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yEAAyE,CAAC;AAChH,OAAO,EAAE,0BAA0B,EAAE,MAAM,8EAA8E,CAAC;AAC1H,OAAO,EACL,qCAAqC,EAEtC,MAAM,uDAAuD,CAAC;AAO/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EACL,uCAAuC,EACvC,kCAAkC,EAClC,kCAAkC,EAClC,oBAAoB,EACpB,oBAAoB,EAErB,MAAM,0BAA0B,CAAC;AAelC,MAAM,cAAc,GAAe;IACjC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9C,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO;QACvB,MAAM,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO;IACP,QAAQ;IACR,aAAa,EAAE,qBAAqB;CACrC,CAAC;AAEF,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK;QAC9C,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAE,KAA+B,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,gBAAgB,CAAC,QAIzB;IACC,M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AM,CAAC,MAAM,CAAC;oBACnB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,iBAAiB,CAAC;oBACtD,IAAI,EAAE,OAAO,CAAC,IAAI;iBACnB,CAAC,CAAC;YACL,CAAC;YACD,KAAK,CAAC,UAAU,CAAC,MAAM;gBACrB,MAAM,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAChD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CAEF"}
|
package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-document-planning-profile-reader.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-planning-profile-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,+BAA+B,EAChC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;
|
|
1
|
+
{"version":3,"file":"node-document-planning-profile-reader.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-planning-profile-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,+BAA+B,EAChC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAqEjH,qBAAa,iCACb,YAAW,6BAA6B;IAChC,IAAI,CAAC,OAAO,EAAE;QAClB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAuC3C;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DocumentCatalogError } from "../../document-catalog-error.js";
|
|
2
2
|
import { DocumentPlanningError } from "../../document-planning-error.js";
|
|
3
|
-
import { InvalidDocumentAuthoringProfileError
|
|
3
|
+
import { InvalidDocumentAuthoringProfileError } from "./load-validated-document-authoring-profile.js";
|
|
4
|
+
import { loadValidatedDocumentAuthoringProfileV2 } from "./load-validated-document-authoring-profile-v2.js";
|
|
4
5
|
function freezeIdentity(identity) {
|
|
5
6
|
return identity.format === "qualified"
|
|
6
7
|
? Object.freeze({
|
|
@@ -26,6 +27,9 @@ function freezePlacement(placement) {
|
|
|
26
27
|
function freezeArtifactType(artifactType) {
|
|
27
28
|
return Object.freeze({
|
|
28
29
|
...artifactType,
|
|
30
|
+
...(artifactType.allowedOwnerIds === undefined
|
|
31
|
+
? {}
|
|
32
|
+
: { allowedOwnerIds: Object.freeze([...artifactType.allowedOwnerIds]) }),
|
|
29
33
|
heading: Object.freeze({ ...artifactType.heading }),
|
|
30
34
|
identity: freezeIdentity(artifactType.identity),
|
|
31
35
|
placement: freezePlacement(artifactType.placement),
|
|
@@ -46,7 +50,7 @@ function invalidProfile(error) {
|
|
|
46
50
|
export class NodeDocumentPlanningProfileReader {
|
|
47
51
|
async read(request) {
|
|
48
52
|
try {
|
|
49
|
-
const { evidence, profile } = await
|
|
53
|
+
const { evidence, profile } = await loadValidatedDocumentAuthoringProfileV2(request);
|
|
50
54
|
return Object.freeze({
|
|
51
55
|
artifactTypes: Object.freeze(profile.authoring.artifactTypes.map(freezeArtifactType)),
|
|
52
56
|
collections: Object.freeze(profile.catalog.collections.map(freezeCollection)),
|
|
@@ -55,8 +59,12 @@ export class NodeDocumentPlanningProfileReader {
|
|
|
55
59
|
...(profile.catalog.excludedPrefixes ?? [])
|
|
56
60
|
]),
|
|
57
61
|
metadataSchemaPath: profile.catalog.metadataSchemaPath,
|
|
62
|
+
...(profile.catalog.metadataSidecar === undefined
|
|
63
|
+
? {}
|
|
64
|
+
: { metadataSidecar: Object.freeze({ ...profile.catalog.metadataSidecar }) }),
|
|
58
65
|
ownerCatalog: Object.freeze({ ...profile.catalog.ownerCatalog }),
|
|
59
|
-
projectId: profile.projectId
|
|
66
|
+
projectId: profile.projectId,
|
|
67
|
+
schemaVersion: profile.schemaVersion
|
|
60
68
|
});
|
|
61
69
|
}
|
|
62
70
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-document-planning-profile-reader.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-planning-profile-reader.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EACL,oCAAoC,
|
|
1
|
+
{"version":3,"file":"node-document-planning-profile-reader.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-planning-profile-reader.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EACL,oCAAoC,EACrC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,uCAAuC,EAExC,MAAM,mDAAmD,CAAC;AAE3D,SAAS,cAAc,CAAC,QAAkC;IACxD,OAAO,QAAQ,CAAC,MAAM,KAAK,WAAW;QACpC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YACZ,GAAG,QAAQ;YACX,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;gBACrB,GAAG,QAAQ,CAAC,OAAO;gBACnB,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;aACpE,CAAC;SACH,CAAC;QACJ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,eAAe,CAAC,SAAoC;IAC3D,OAAO,SAAS,CAAC,IAAI,KAAK,UAAU;QAClC,CAAC,CAAC,MAAM,CA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ChE,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,aAAa,EAAE,OAAO,CAAC,aAAa;aACrC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,oCAAoC,EAAE,CAAC;gBAC1D,cAAc,CAAC,KAAK,CAAC,CAAC;YACxB,CAAC;YACD,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;gBAC1C,MAAM,IAAI,qBAAqB,CAC7B,KAAK,CAAC,IAAI,KAAK,gCAAgC;oBAC7C,CAAC,CAAC,iCAAiC;oBACnC,CAAC,CAAC,yCAAyC,EAC7C,gDAAgD,KAAK,CAAC,OAAO,EAAE,EAC/D,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -4,6 +4,7 @@ export declare class NodeDocumentPlanningStateReader implements DocumentPlanning
|
|
|
4
4
|
observe(request: {
|
|
5
5
|
readonly consumerRoot: string;
|
|
6
6
|
readonly destination: string;
|
|
7
|
+
readonly parentPolicy?: "create-missing-real-directories";
|
|
7
8
|
readonly signal?: AbortSignal;
|
|
8
9
|
}): Promise<DocumentPlanningStateSnapshot>;
|
|
9
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-document-planning-state-reader.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-planning-state-reader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"node-document-planning-state-reader.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-planning-state-reader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;AA+I7G,qBAAa,+BACb,YAAW,2BAA2B;IAC9B,OAAO,CAAC,OAAO,EAAE;QACrB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,iCAAiC,CAAC;QAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CA2EzC;CACF"}
|