@tiangong-lca/foundry 0.1.2
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/LICENSE +21 -0
- package/README.md +532 -0
- package/docs/architecture.md +450 -0
- package/docs/foundry-task-contracts.md +147 -0
- package/docs/import-profiles/bafu/constraints.md +343 -0
- package/docs/import-profiles/bafu/leaf-process-classification-authoring.md +153 -0
- package/docs/import-profiles/bafu/profile.md +183 -0
- package/docs/import-profiles/uslci/constraints.md +29 -0
- package/docs/import-profiles/uslci/profile.md +43 -0
- package/docs/import-profiles/worldsteel/constraints.md +77 -0
- package/docs/import-profiles/worldsteel/import-coverage.md +93 -0
- package/docs/import-profiles/worldsteel/import-plan.md +375 -0
- package/docs/import-profiles/worldsteel/profile.md +78 -0
- package/docs/package-distribution-contract.md +287 -0
- package/docs/public-runtime-contract.md +218 -0
- package/docs/runtime-context-contract.md +138 -0
- package/docs/safety-policy.md +164 -0
- package/docs/task-authorization-contract.md +131 -0
- package/docs/uslci-import-runbook.md +336 -0
- package/docs/workspace-migration-contract.md +127 -0
- package/package-dist/assets/foundry-package-descriptor.json +1661 -0
- package/package-dist/scripts/foundry-facade.d.ts +78 -0
- package/package-dist/scripts/foundry-facade.js +1317 -0
- package/package-dist/scripts/foundry-runtime.d.ts +180 -0
- package/package-dist/scripts/foundry-runtime.js +190 -0
- package/package-dist/scripts/lib/batch-orchestration/scope-attempt-ledger.d.ts +27 -0
- package/package-dist/scripts/lib/batch-orchestration/scope-attempt-ledger.js +85 -0
- package/package-dist/scripts/lib/batch-orchestration/scope-resume-contract.d.ts +38 -0
- package/package-dist/scripts/lib/batch-orchestration/scope-resume-contract.js +90 -0
- package/package-dist/scripts/lib/bundle-row-types.d.ts +44 -0
- package/package-dist/scripts/lib/bundle-row-types.js +46 -0
- package/package-dist/scripts/lib/bundle-sample-utils.d.ts +183 -0
- package/package-dist/scripts/lib/bundle-sample-utils.js +526 -0
- package/package-dist/scripts/lib/bundle-source-context.d.ts +31 -0
- package/package-dist/scripts/lib/bundle-source-context.js +142 -0
- package/package-dist/scripts/lib/canonical-description.d.ts +12 -0
- package/package-dist/scripts/lib/canonical-description.js +72 -0
- package/package-dist/scripts/lib/canonical-support-rewrites.d.ts +127 -0
- package/package-dist/scripts/lib/canonical-support-rewrites.js +527 -0
- package/package-dist/scripts/lib/decision-owners/classification.d.ts +245 -0
- package/package-dist/scripts/lib/decision-owners/classification.js +754 -0
- package/package-dist/scripts/lib/decision-owners/identity-preflight.d.ts +333 -0
- package/package-dist/scripts/lib/decision-owners/identity-preflight.js +1353 -0
- package/package-dist/scripts/lib/decision-owners/identity-task.d.ts +130 -0
- package/package-dist/scripts/lib/decision-owners/identity-task.js +494 -0
- package/package-dist/scripts/lib/decision-owners/identity.d.ts +74 -0
- package/package-dist/scripts/lib/decision-owners/identity.js +443 -0
- package/package-dist/scripts/lib/decision-owners/location.d.ts +239 -0
- package/package-dist/scripts/lib/decision-owners/location.js +704 -0
- package/package-dist/scripts/lib/decision-task-utils.d.ts +484 -0
- package/package-dist/scripts/lib/decision-task-utils.js +735 -0
- package/package-dist/scripts/lib/finalize-owners/cli-wrappers.d.ts +52 -0
- package/package-dist/scripts/lib/finalize-owners/cli-wrappers.js +146 -0
- package/package-dist/scripts/lib/finalize-owners/commit-handoff.d.ts +79 -0
- package/package-dist/scripts/lib/finalize-owners/commit-handoff.js +515 -0
- package/package-dist/scripts/lib/finalize-owners/post-authoring.d.ts +234 -0
- package/package-dist/scripts/lib/finalize-owners/post-authoring.js +1720 -0
- package/package-dist/scripts/lib/finalize-owners/post-write-closeout.d.ts +140 -0
- package/package-dist/scripts/lib/finalize-owners/post-write-closeout.js +656 -0
- package/package-dist/scripts/lib/foundry-args.d.ts +7 -0
- package/package-dist/scripts/lib/foundry-args.js +38 -0
- package/package-dist/scripts/lib/foundry-authentication-environment.d.ts +17 -0
- package/package-dist/scripts/lib/foundry-authentication-environment.js +55 -0
- package/package-dist/scripts/lib/foundry-authorization-input.d.ts +31 -0
- package/package-dist/scripts/lib/foundry-authorization-input.js +151 -0
- package/package-dist/scripts/lib/foundry-command-metadata.d.ts +32 -0
- package/package-dist/scripts/lib/foundry-command-metadata.js +1012 -0
- package/package-dist/scripts/lib/foundry-command-registry.d.ts +34 -0
- package/package-dist/scripts/lib/foundry-command-registry.js +241 -0
- package/package-dist/scripts/lib/foundry-command-spec.d.ts +1 -0
- package/package-dist/scripts/lib/foundry-command-spec.js +1 -0
- package/package-dist/scripts/lib/foundry-decision-owners.d.ts +17 -0
- package/package-dist/scripts/lib/foundry-decision-owners.js +68 -0
- package/package-dist/scripts/lib/foundry-decision-routing.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-decision-routing.js +38 -0
- package/package-dist/scripts/lib/foundry-execution-admission.d.ts +33 -0
- package/package-dist/scripts/lib/foundry-execution-admission.js +225 -0
- package/package-dist/scripts/lib/foundry-execution-attempt.d.ts +11 -0
- package/package-dist/scripts/lib/foundry-execution-attempt.js +33 -0
- package/package-dist/scripts/lib/foundry-execution-context-format.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-execution-context-format.js +83 -0
- package/package-dist/scripts/lib/foundry-facade-store.d.ts +25 -0
- package/package-dist/scripts/lib/foundry-facade-store.js +449 -0
- package/package-dist/scripts/lib/foundry-finalize-owners.d.ts +21 -0
- package/package-dist/scripts/lib/foundry-finalize-owners.js +203 -0
- package/package-dist/scripts/lib/foundry-identity-owners.d.ts +13 -0
- package/package-dist/scripts/lib/foundry-identity-owners.js +58 -0
- package/package-dist/scripts/lib/foundry-managed-host.d.ts +7 -0
- package/package-dist/scripts/lib/foundry-managed-host.js +173 -0
- package/package-dist/scripts/lib/foundry-migration-adoption-plan.d.ts +39 -0
- package/package-dist/scripts/lib/foundry-migration-adoption-plan.js +467 -0
- package/package-dist/scripts/lib/foundry-migration-adoption.d.ts +31 -0
- package/package-dist/scripts/lib/foundry-migration-adoption.js +187 -0
- package/package-dist/scripts/lib/foundry-migration-authority.d.ts +42 -0
- package/package-dist/scripts/lib/foundry-migration-authority.js +280 -0
- package/package-dist/scripts/lib/foundry-migration-inventory.d.ts +31 -0
- package/package-dist/scripts/lib/foundry-migration-inventory.js +148 -0
- package/package-dist/scripts/lib/foundry-migration-plan.d.ts +48 -0
- package/package-dist/scripts/lib/foundry-migration-plan.js +234 -0
- package/package-dist/scripts/lib/foundry-migration-replay.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-migration-replay.js +134 -0
- package/package-dist/scripts/lib/foundry-migration-stage.d.ts +15 -0
- package/package-dist/scripts/lib/foundry-migration-stage.js +152 -0
- package/package-dist/scripts/lib/foundry-migration-transfer-io.d.ts +13 -0
- package/package-dist/scripts/lib/foundry-migration-transfer-io.js +226 -0
- package/package-dist/scripts/lib/foundry-migration-transfer.d.ts +36 -0
- package/package-dist/scripts/lib/foundry-migration-transfer.js +350 -0
- package/package-dist/scripts/lib/foundry-operation-result.d.ts +71 -0
- package/package-dist/scripts/lib/foundry-operation-result.js +264 -0
- package/package-dist/scripts/lib/foundry-owner-execution-store.d.ts +319 -0
- package/package-dist/scripts/lib/foundry-owner-execution-store.js +293 -0
- package/package-dist/scripts/lib/foundry-owner-readback.d.ts +22 -0
- package/package-dist/scripts/lib/foundry-owner-readback.js +189 -0
- package/package-dist/scripts/lib/foundry-owner-trace-acceptance.d.ts +15 -0
- package/package-dist/scripts/lib/foundry-owner-trace-acceptance.js +68 -0
- package/package-dist/scripts/lib/foundry-package-contract.d.ts +56 -0
- package/package-dist/scripts/lib/foundry-package-contract.js +392 -0
- package/package-dist/scripts/lib/foundry-private-path.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-private-path.js +20 -0
- package/package-dist/scripts/lib/foundry-runtime-cache.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-runtime-cache.js +25 -0
- package/package-dist/scripts/lib/foundry-runtime-command-policy.d.ts +20 -0
- package/package-dist/scripts/lib/foundry-runtime-command-policy.js +173 -0
- package/package-dist/scripts/lib/foundry-runtime-context-types.d.ts +59 -0
- package/package-dist/scripts/lib/foundry-runtime-context-types.js +1 -0
- package/package-dist/scripts/lib/foundry-runtime-context.d.ts +27 -0
- package/package-dist/scripts/lib/foundry-runtime-context.js +668 -0
- package/package-dist/scripts/lib/foundry-runtime-environment.d.ts +9 -0
- package/package-dist/scripts/lib/foundry-runtime-environment.js +90 -0
- package/package-dist/scripts/lib/foundry-runtime-error.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-runtime-error.js +8 -0
- package/package-dist/scripts/lib/foundry-runtime-identity.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-runtime-identity.js +127 -0
- package/package-dist/scripts/lib/foundry-runtime-paths.d.ts +16 -0
- package/package-dist/scripts/lib/foundry-runtime-paths.js +159 -0
- package/package-dist/scripts/lib/foundry-runtime-qualification.d.ts +66 -0
- package/package-dist/scripts/lib/foundry-runtime-qualification.js +223 -0
- package/package-dist/scripts/lib/foundry-runtime-selection-record.d.ts +16 -0
- package/package-dist/scripts/lib/foundry-runtime-selection-record.js +32 -0
- package/package-dist/scripts/lib/foundry-runtime-selection.d.ts +14 -0
- package/package-dist/scripts/lib/foundry-runtime-selection.js +123 -0
- package/package-dist/scripts/lib/foundry-runtime-utils.d.ts +178 -0
- package/package-dist/scripts/lib/foundry-runtime-utils.js +603 -0
- package/package-dist/scripts/lib/foundry-semantic-input.d.ts +30 -0
- package/package-dist/scripts/lib/foundry-semantic-input.js +132 -0
- package/package-dist/scripts/lib/foundry-task-authorization.d.ts +68 -0
- package/package-dist/scripts/lib/foundry-task-authorization.js +350 -0
- package/package-dist/scripts/lib/foundry-task-io.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-task-io.js +92 -0
- package/package-dist/scripts/lib/foundry-task-registration.d.ts +6 -0
- package/package-dist/scripts/lib/foundry-task-registration.js +384 -0
- package/package-dist/scripts/lib/foundry-task-start-spec.d.ts +34 -0
- package/package-dist/scripts/lib/foundry-task-start-spec.js +161 -0
- package/package-dist/scripts/lib/foundry-task-store.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-task-store.js +466 -0
- package/package-dist/scripts/lib/foundry-task-types.d.ts +99 -0
- package/package-dist/scripts/lib/foundry-task-types.js +1 -0
- package/package-dist/scripts/lib/foundry-workflow-approval-continuation.d.ts +6 -0
- package/package-dist/scripts/lib/foundry-workflow-approval-continuation.js +136 -0
- package/package-dist/scripts/lib/foundry-workflow-assessment.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-workflow-assessment.js +231 -0
- package/package-dist/scripts/lib/foundry-workflow-authorization.d.ts +22 -0
- package/package-dist/scripts/lib/foundry-workflow-authorization.js +174 -0
- package/package-dist/scripts/lib/foundry-workflow-context.d.ts +3 -0
- package/package-dist/scripts/lib/foundry-workflow-context.js +99 -0
- package/package-dist/scripts/lib/foundry-workflow-decisions.d.ts +18 -0
- package/package-dist/scripts/lib/foundry-workflow-decisions.js +123 -0
- package/package-dist/scripts/lib/foundry-workflow-execution.d.ts +8 -0
- package/package-dist/scripts/lib/foundry-workflow-execution.js +248 -0
- package/package-dist/scripts/lib/foundry-workflow-finalize.d.ts +13 -0
- package/package-dist/scripts/lib/foundry-workflow-finalize.js +264 -0
- package/package-dist/scripts/lib/foundry-workflow-identity-apply.d.ts +14 -0
- package/package-dist/scripts/lib/foundry-workflow-identity-apply.js +159 -0
- package/package-dist/scripts/lib/foundry-workflow-identity.d.ts +6 -0
- package/package-dist/scripts/lib/foundry-workflow-identity.js +153 -0
- package/package-dist/scripts/lib/foundry-workflow-import.d.ts +4 -0
- package/package-dist/scripts/lib/foundry-workflow-import.js +70 -0
- package/package-dist/scripts/lib/foundry-workflow-io.d.ts +11 -0
- package/package-dist/scripts/lib/foundry-workflow-io.js +77 -0
- package/package-dist/scripts/lib/foundry-workflow-reference-verify.d.ts +41 -0
- package/package-dist/scripts/lib/foundry-workflow-reference-verify.js +266 -0
- package/package-dist/scripts/lib/foundry-workflow-rows.d.ts +2 -0
- package/package-dist/scripts/lib/foundry-workflow-rows.js +47 -0
- package/package-dist/scripts/lib/foundry-workflow-semantic.d.ts +5 -0
- package/package-dist/scripts/lib/foundry-workflow-semantic.js +367 -0
- package/package-dist/scripts/lib/foundry-workflow-state.d.ts +37 -0
- package/package-dist/scripts/lib/foundry-workflow-state.js +158 -0
- package/package-dist/scripts/lib/full-context-proof.d.ts +51 -0
- package/package-dist/scripts/lib/full-context-proof.js +932 -0
- package/package-dist/scripts/lib/identity-preflight-artifacts.d.ts +184 -0
- package/package-dist/scripts/lib/identity-preflight-artifacts.js +573 -0
- package/package-dist/scripts/lib/identity-preflight-proof.d.ts +117 -0
- package/package-dist/scripts/lib/identity-preflight-proof.js +341 -0
- package/package-dist/scripts/lib/identity-reference-rewrite-utils.d.ts +147 -0
- package/package-dist/scripts/lib/identity-reference-rewrite-utils.js +817 -0
- package/package-dist/scripts/lib/import-curation/authoring-packages.d.ts +28 -0
- package/package-dist/scripts/lib/import-curation/authoring-packages.js +92 -0
- package/package-dist/scripts/lib/import-curation/curation-cleanup.d.ts +32 -0
- package/package-dist/scripts/lib/import-curation/curation-cleanup.js +203 -0
- package/package-dist/scripts/lib/import-curation/curation-gate.d.ts +47 -0
- package/package-dist/scripts/lib/import-curation/curation-gate.js +528 -0
- package/package-dist/scripts/lib/import-curation/internal/artifact-inputs.d.ts +24 -0
- package/package-dist/scripts/lib/import-curation/internal/artifact-inputs.js +152 -0
- package/package-dist/scripts/lib/import-curation/internal/authoring-patch-workflow.d.ts +3 -0
- package/package-dist/scripts/lib/import-curation/internal/authoring-patch-workflow.js +3 -0
- package/package-dist/scripts/lib/import-curation/internal/authoring-task-workflow.d.ts +1 -0
- package/package-dist/scripts/lib/import-curation/internal/authoring-task-workflow.js +1 -0
- package/package-dist/scripts/lib/import-curation/internal/context-inputs.d.ts +56 -0
- package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +206 -0
- package/package-dist/scripts/lib/import-curation/internal/curation-gate-workflow.d.ts +14 -0
- package/package-dist/scripts/lib/import-curation/internal/curation-gate-workflow.js +14 -0
- package/package-dist/scripts/lib/import-curation/internal/dataset-payload.d.ts +70 -0
- package/package-dist/scripts/lib/import-curation/internal/dataset-payload.js +141 -0
- package/package-dist/scripts/lib/import-curation/internal/dataset-types.d.ts +25 -0
- package/package-dist/scripts/lib/import-curation/internal/dataset-types.js +45 -0
- package/package-dist/scripts/lib/import-curation/internal/full-context-proof.d.ts +129 -0
- package/package-dist/scripts/lib/import-curation/internal/full-context-proof.js +552 -0
- package/package-dist/scripts/lib/import-curation/internal/hash-utils.d.ts +2 -0
- package/package-dist/scripts/lib/import-curation/internal/hash-utils.js +10 -0
- package/package-dist/scripts/lib/import-curation/internal/mutation-manifest-workflow.d.ts +15 -0
- package/package-dist/scripts/lib/import-curation/internal/mutation-manifest-workflow.js +15 -0
- package/package-dist/scripts/lib/import-curation/internal/prewrite-cleanup.d.ts +31 -0
- package/package-dist/scripts/lib/import-curation/internal/prewrite-cleanup.js +467 -0
- package/package-dist/scripts/lib/import-curation/internal/profiles-config.d.ts +47 -0
- package/package-dist/scripts/lib/import-curation/internal/profiles-config.js +88 -0
- package/package-dist/scripts/lib/import-curation/internal/runtime-io.d.ts +23 -0
- package/package-dist/scripts/lib/import-curation/internal/runtime-io.js +132 -0
- package/package-dist/scripts/lib/import-curation/internal/trace-summary.d.ts +53 -0
- package/package-dist/scripts/lib/import-curation/internal/trace-summary.js +114 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-authoring-tasks.d.ts +141 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-authoring-tasks.js +854 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-decision-apply-context.d.ts +20 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-decision-apply-context.js +46 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-decision-full-context.d.ts +110 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-decision-full-context.js +782 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-dry-run-context.d.ts +24 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-dry-run-context.js +191 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-evidence-scope.d.ts +80 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-evidence-scope.js +359 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-decision-context.d.ts +146 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-decision-context.js +381 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.d.ts +223 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.js +1079 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-collect.d.ts +41 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-collect.js +412 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence-context.d.ts +117 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence-context.js +278 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence.d.ts +59 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence.js +593 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-queue-context.d.ts +58 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-queue-context.js +263 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.d.ts +177 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.js +812 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-row-transform-context.d.ts +159 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-row-transform-context.js +466 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-semantic-actions.d.ts +152 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-semantic-actions.js +1377 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-source-reference-context.d.ts +38 -0
- package/package-dist/scripts/lib/import-curation/internal/workflow-source-reference-context.js +116 -0
- package/package-dist/scripts/lib/import-curation/mutation-manifest.d.ts +51 -0
- package/package-dist/scripts/lib/import-curation/mutation-manifest.js +542 -0
- package/package-dist/scripts/lib/import-curation/patch-collect.d.ts +18 -0
- package/package-dist/scripts/lib/import-curation/patch-collect.js +172 -0
- package/package-dist/scripts/lib/import-curation/profiles.d.ts +1 -0
- package/package-dist/scripts/lib/import-curation/profiles.js +1 -0
- package/package-dist/scripts/lib/import-curation/trace-summary.d.ts +1 -0
- package/package-dist/scripts/lib/import-curation/trace-summary.js +1 -0
- package/package-dist/scripts/lib/oauth-session-reference.d.ts +1 -0
- package/package-dist/scripts/lib/oauth-session-reference.js +20 -0
- package/package-dist/scripts/lib/post-authoring-finalize-utils.d.ts +95 -0
- package/package-dist/scripts/lib/post-authoring-finalize-utils.js +548 -0
- package/package-dist/scripts/lib/post-write-root-proof.d.ts +44 -0
- package/package-dist/scripts/lib/post-write-root-proof.js +169 -0
- package/package-dist/scripts/lib/reference-description-text.d.ts +2 -0
- package/package-dist/scripts/lib/reference-description-text.js +12 -0
- package/package-dist/scripts/lib/remote-verification-accepted-diff.d.ts +42 -0
- package/package-dist/scripts/lib/remote-verification-accepted-diff.js +424 -0
- package/package-dist/scripts/lib/same-identity-commit-recovery.d.ts +8 -0
- package/package-dist/scripts/lib/same-identity-commit-recovery.js +52 -0
- package/package-dist/scripts/lib/source-semantics.d.ts +255 -0
- package/package-dist/scripts/lib/source-semantics.js +888 -0
- package/package-dist/scripts/lib/stage-contract.d.ts +36 -0
- package/package-dist/scripts/lib/stage-contract.js +25 -0
- package/package-dist/scripts/lib/task-authorization.d.ts +84 -0
- package/package-dist/scripts/lib/task-authorization.js +210 -0
- package/package-dist/scripts/lib/tidas-adapter.d.ts +113 -0
- package/package-dist/scripts/lib/tidas-adapter.js +525 -0
- package/package-dist/scripts/lib/tidas-language-utils.d.ts +8 -0
- package/package-dist/scripts/lib/tidas-language-utils.js +206 -0
- package/package-dist/scripts/lib/tidas-row-utils.d.ts +70 -0
- package/package-dist/scripts/lib/tidas-row-utils.js +225 -0
- package/package-dist/scripts/lib/trace-coverage.d.ts +53 -0
- package/package-dist/scripts/lib/trace-coverage.js +178 -0
- package/package-dist/scripts/package-entry.d.ts +2 -0
- package/package-dist/scripts/package-entry.js +4 -0
- package/package-dist/scripts/public-api.d.ts +80 -0
- package/package-dist/scripts/public-api.js +28 -0
- package/package-dist/scripts/runtime-entry.d.ts +23 -0
- package/package-dist/scripts/runtime-entry.js +424 -0
- package/package.json +93 -0
- package/specs/canonical-support/flow-properties-unit-groups.json +2692 -0
- package/specs/import-profiles.json +118 -0
- package/specs/prewrite-content-policy.json +105 -0
- package/specs/schemas/authorization-derivation.schema.json +34 -0
- package/specs/schemas/execution-context.schema.json +68 -0
- package/specs/schemas/foundry-authorization-input.schema.json +120 -0
- package/specs/schemas/foundry-facade-request-index.schema.json +78 -0
- package/specs/schemas/foundry-managed-runtime.schema.json +122 -0
- package/specs/schemas/foundry-migration-activation.schema.json +213 -0
- package/specs/schemas/foundry-migration-adoption-plan.schema.json +548 -0
- package/specs/schemas/foundry-migration-transfer-receipt.schema.json +93 -0
- package/specs/schemas/foundry-operation-result.schema.json +147 -0
- package/specs/schemas/foundry-package-descriptor.schema.json +134 -0
- package/specs/schemas/foundry-runtime-selection.schema.json +59 -0
- package/specs/schemas/foundry-semantic-input.schema.json +36 -0
- package/specs/schemas/foundry-task-start.schema.json +123 -0
- package/specs/schemas/foundry-workspace-migration-pending.schema.json +17 -0
- package/specs/schemas/foundry-workspace-migration-plan.schema.json +59 -0
- package/specs/schemas/foundry-workspace-migration-transfer-plan.schema.json +357 -0
- package/specs/schemas/foundry-workspace-v2.schema.json +70 -0
- package/specs/schemas/runtime-qualification.schema.json +63 -0
- package/specs/schemas/task-authorization.schema.json +154 -0
- package/specs/schemas/tidas-runtime-expectation.schema.json +54 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
export const TIDAS_LANGUAGE_CODES = [
|
|
2
|
+
"aa",
|
|
3
|
+
"ab",
|
|
4
|
+
"ae",
|
|
5
|
+
"af",
|
|
6
|
+
"ak",
|
|
7
|
+
"am",
|
|
8
|
+
"an",
|
|
9
|
+
"ar",
|
|
10
|
+
"as",
|
|
11
|
+
"av",
|
|
12
|
+
"ay",
|
|
13
|
+
"az",
|
|
14
|
+
"ba",
|
|
15
|
+
"be",
|
|
16
|
+
"bg",
|
|
17
|
+
"bh",
|
|
18
|
+
"bi",
|
|
19
|
+
"bm",
|
|
20
|
+
"bn",
|
|
21
|
+
"bo",
|
|
22
|
+
"br",
|
|
23
|
+
"bs",
|
|
24
|
+
"ca",
|
|
25
|
+
"ce",
|
|
26
|
+
"ch",
|
|
27
|
+
"co",
|
|
28
|
+
"cr",
|
|
29
|
+
"cs",
|
|
30
|
+
"cu",
|
|
31
|
+
"cv",
|
|
32
|
+
"cy",
|
|
33
|
+
"da",
|
|
34
|
+
"de",
|
|
35
|
+
"dv",
|
|
36
|
+
"dz",
|
|
37
|
+
"ee",
|
|
38
|
+
"el",
|
|
39
|
+
"en",
|
|
40
|
+
"eo",
|
|
41
|
+
"es",
|
|
42
|
+
"et",
|
|
43
|
+
"eu",
|
|
44
|
+
"fa",
|
|
45
|
+
"ff",
|
|
46
|
+
"fi",
|
|
47
|
+
"fj",
|
|
48
|
+
"fo",
|
|
49
|
+
"fr",
|
|
50
|
+
"fy",
|
|
51
|
+
"ga",
|
|
52
|
+
"gd",
|
|
53
|
+
"gl",
|
|
54
|
+
"gn",
|
|
55
|
+
"gu",
|
|
56
|
+
"gv",
|
|
57
|
+
"ha",
|
|
58
|
+
"he",
|
|
59
|
+
"hi",
|
|
60
|
+
"ho",
|
|
61
|
+
"hr",
|
|
62
|
+
"ht",
|
|
63
|
+
"hu",
|
|
64
|
+
"hy",
|
|
65
|
+
"hz",
|
|
66
|
+
"ia",
|
|
67
|
+
"id",
|
|
68
|
+
"ie",
|
|
69
|
+
"ig",
|
|
70
|
+
"ii",
|
|
71
|
+
"ik",
|
|
72
|
+
"io",
|
|
73
|
+
"is",
|
|
74
|
+
"it",
|
|
75
|
+
"iu",
|
|
76
|
+
"ja",
|
|
77
|
+
"jv",
|
|
78
|
+
"ka",
|
|
79
|
+
"kg",
|
|
80
|
+
"ki",
|
|
81
|
+
"kj",
|
|
82
|
+
"kk",
|
|
83
|
+
"kl",
|
|
84
|
+
"km",
|
|
85
|
+
"kn",
|
|
86
|
+
"ko",
|
|
87
|
+
"kr",
|
|
88
|
+
"ks",
|
|
89
|
+
"ku",
|
|
90
|
+
"kv",
|
|
91
|
+
"kw",
|
|
92
|
+
"ky",
|
|
93
|
+
"la",
|
|
94
|
+
"lb",
|
|
95
|
+
"lg",
|
|
96
|
+
"li",
|
|
97
|
+
"ln",
|
|
98
|
+
"lo",
|
|
99
|
+
"lt",
|
|
100
|
+
"lu",
|
|
101
|
+
"lv",
|
|
102
|
+
"mg",
|
|
103
|
+
"mh",
|
|
104
|
+
"mi",
|
|
105
|
+
"mk",
|
|
106
|
+
"ml",
|
|
107
|
+
"mn",
|
|
108
|
+
"mo",
|
|
109
|
+
"mr",
|
|
110
|
+
"ms",
|
|
111
|
+
"mt",
|
|
112
|
+
"my",
|
|
113
|
+
"na",
|
|
114
|
+
"nb",
|
|
115
|
+
"nd",
|
|
116
|
+
"ne",
|
|
117
|
+
"ng",
|
|
118
|
+
"nl",
|
|
119
|
+
"nn",
|
|
120
|
+
"no",
|
|
121
|
+
"nr",
|
|
122
|
+
"nv",
|
|
123
|
+
"ny",
|
|
124
|
+
"oc",
|
|
125
|
+
"oj",
|
|
126
|
+
"om",
|
|
127
|
+
"or",
|
|
128
|
+
"os",
|
|
129
|
+
"pa",
|
|
130
|
+
"pi",
|
|
131
|
+
"pl",
|
|
132
|
+
"ps",
|
|
133
|
+
"pt",
|
|
134
|
+
"qu",
|
|
135
|
+
"rm",
|
|
136
|
+
"rn",
|
|
137
|
+
"ro",
|
|
138
|
+
"ru",
|
|
139
|
+
"rw",
|
|
140
|
+
"sa",
|
|
141
|
+
"sc",
|
|
142
|
+
"sd",
|
|
143
|
+
"se",
|
|
144
|
+
"sg",
|
|
145
|
+
"si",
|
|
146
|
+
"sk",
|
|
147
|
+
"sl",
|
|
148
|
+
"sm",
|
|
149
|
+
"sn",
|
|
150
|
+
"so",
|
|
151
|
+
"sq",
|
|
152
|
+
"sr",
|
|
153
|
+
"ss",
|
|
154
|
+
"st",
|
|
155
|
+
"su",
|
|
156
|
+
"sv",
|
|
157
|
+
"sw",
|
|
158
|
+
"ta",
|
|
159
|
+
"te",
|
|
160
|
+
"tg",
|
|
161
|
+
"th",
|
|
162
|
+
"ti",
|
|
163
|
+
"tk",
|
|
164
|
+
"tl",
|
|
165
|
+
"tn",
|
|
166
|
+
"to",
|
|
167
|
+
"tr",
|
|
168
|
+
"ts",
|
|
169
|
+
"tt",
|
|
170
|
+
"tw",
|
|
171
|
+
"ty",
|
|
172
|
+
"ug",
|
|
173
|
+
"uk",
|
|
174
|
+
"ur",
|
|
175
|
+
"uz",
|
|
176
|
+
"ve",
|
|
177
|
+
"vi",
|
|
178
|
+
"vo",
|
|
179
|
+
"wa",
|
|
180
|
+
"wo",
|
|
181
|
+
"xh",
|
|
182
|
+
"yi",
|
|
183
|
+
"yo",
|
|
184
|
+
"za",
|
|
185
|
+
"zh",
|
|
186
|
+
"zu",
|
|
187
|
+
];
|
|
188
|
+
export const TIDAS_LANGUAGE_CODE_SET = new Set(TIDAS_LANGUAGE_CODES);
|
|
189
|
+
export function normalizeTidasLanguageCode(language, options = {}) {
|
|
190
|
+
const fallback = options.fallback ?? "en";
|
|
191
|
+
const field = options.field ?? "language";
|
|
192
|
+
const raw = String(language ?? "")
|
|
193
|
+
.trim()
|
|
194
|
+
.toLowerCase();
|
|
195
|
+
const code = raw || String(fallback).trim().toLowerCase() || "en";
|
|
196
|
+
if (!TIDAS_LANGUAGE_CODE_SET.has(code)) {
|
|
197
|
+
throw new Error(`${field} must use a TIDAS Languages enumeration value: ${code}`);
|
|
198
|
+
}
|
|
199
|
+
return code;
|
|
200
|
+
}
|
|
201
|
+
export function tidasLanguageForText(text, fallback = "en") {
|
|
202
|
+
const value = String(text ?? "").trim();
|
|
203
|
+
if (!value)
|
|
204
|
+
return normalizeTidasLanguageCode(fallback);
|
|
205
|
+
return /[\u3400-\u9fff\uf900-\ufaff]/u.test(value) ? "zh" : normalizeTidasLanguageCode(fallback);
|
|
206
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { normalizeTidasLanguageCode } from "./tidas-language-utils.ts";
|
|
2
|
+
export type TidasRowUtilsDependencies = {
|
|
3
|
+
asText: (value: unknown) => string;
|
|
4
|
+
bundleRowTypes: Record<string, {
|
|
5
|
+
plural: string;
|
|
6
|
+
rootKey: string;
|
|
7
|
+
informationKey: string;
|
|
8
|
+
}>;
|
|
9
|
+
cloneJson: <T>(value: T) => T;
|
|
10
|
+
ensureArray: (value: unknown) => unknown[];
|
|
11
|
+
writeText: (filePath: string, text: string) => unknown;
|
|
12
|
+
};
|
|
13
|
+
type UnknownRecord = Record<string, unknown>;
|
|
14
|
+
type ContactReference = UnknownRecord & {
|
|
15
|
+
"@type"?: unknown;
|
|
16
|
+
"@refObjectId"?: unknown;
|
|
17
|
+
"@version"?: unknown;
|
|
18
|
+
"@uri"?: unknown;
|
|
19
|
+
"common:shortDescription"?: unknown;
|
|
20
|
+
};
|
|
21
|
+
type ContactRewriteStats = {
|
|
22
|
+
rewritten: number;
|
|
23
|
+
previous_ids: Set<string>;
|
|
24
|
+
previous_descriptions: Set<string>;
|
|
25
|
+
};
|
|
26
|
+
type PlaceholderTextStats = {
|
|
27
|
+
placeholder_text_replacements: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function createTidasRowUtils({ asText, bundleRowTypes, cloneJson, ensureArray, writeText, }: TidasRowUtilsDependencies): {
|
|
30
|
+
bundleClassificationPath: (payload: unknown, type: string) => string;
|
|
31
|
+
cleanEcoSpoldNameText: (text: unknown) => string;
|
|
32
|
+
contactGlobalReference: ({ id, version, shortDescription, language, }: {
|
|
33
|
+
id: unknown;
|
|
34
|
+
version: unknown;
|
|
35
|
+
shortDescription: unknown;
|
|
36
|
+
language?: unknown;
|
|
37
|
+
}) => {
|
|
38
|
+
"@type": string;
|
|
39
|
+
"@refObjectId": unknown;
|
|
40
|
+
"@version": unknown;
|
|
41
|
+
"@uri": string;
|
|
42
|
+
"common:shortDescription": {
|
|
43
|
+
"@xml:lang": string;
|
|
44
|
+
"#text": string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
datasetIdentity: (payload: unknown, type: string) => {
|
|
48
|
+
id: string | null;
|
|
49
|
+
version: string | null;
|
|
50
|
+
};
|
|
51
|
+
datasetRowsFileStem: (datasetType: unknown) => string;
|
|
52
|
+
flowClassificationSchemaType: (payload: unknown) => "flow-elementary" | "flow-product";
|
|
53
|
+
flowTypeOfDataSet: (payload: unknown) => string;
|
|
54
|
+
isConvertedDefaultClassification: (classificationPath: string) => boolean;
|
|
55
|
+
isObjectEmpty: (value: unknown) => unknown;
|
|
56
|
+
languageForText: (text: unknown, fallback?: unknown) => string;
|
|
57
|
+
multiLang: (text: unknown, language?: unknown) => {
|
|
58
|
+
"@xml:lang": string;
|
|
59
|
+
"#text": string;
|
|
60
|
+
};
|
|
61
|
+
normalizeTidasLanguageCode: typeof normalizeTidasLanguageCode;
|
|
62
|
+
pathExpression: (pathSegments: unknown[]) => string;
|
|
63
|
+
preferredSourceLanguageText: (values: unknown) => string;
|
|
64
|
+
printJson: (value: unknown) => void;
|
|
65
|
+
rewriteContactReferences: (value: unknown, contactRef: ContactReference, stats: ContactRewriteStats) => void;
|
|
66
|
+
sanitizePlaceholderText: (text: unknown, pathSegments: unknown[], stats: PlaceholderTextStats) => string;
|
|
67
|
+
textValue: (value: unknown) => string;
|
|
68
|
+
writeJsonLines: (filePath: string, rows: unknown[]) => void;
|
|
69
|
+
};
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { normalizeTidasLanguageCode, tidasLanguageForText } from "./tidas-language-utils.js";
|
|
2
|
+
export function createTidasRowUtils({ asText, bundleRowTypes, cloneJson, ensureArray, writeText, }) {
|
|
3
|
+
function datasetRowsFileStem(datasetType) {
|
|
4
|
+
return ({
|
|
5
|
+
contact: "contacts",
|
|
6
|
+
flow: "flows",
|
|
7
|
+
flowproperty: "flowproperties",
|
|
8
|
+
lifecyclemodel: "lifecyclemodels",
|
|
9
|
+
process: "processes",
|
|
10
|
+
source: "sources",
|
|
11
|
+
support: "support",
|
|
12
|
+
unitgroup: "unitgroups",
|
|
13
|
+
}[asText(datasetType).toLowerCase()] || `${datasetType}s`);
|
|
14
|
+
}
|
|
15
|
+
function multiLang(text, language = "en") {
|
|
16
|
+
return {
|
|
17
|
+
"@xml:lang": normalizeTidasLanguageCode(language),
|
|
18
|
+
"#text": String(text ?? "").trim(),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function containsCjk(text) {
|
|
22
|
+
return /[\u3400-\u9fff\uf900-\ufaff]/u.test(String(text ?? ""));
|
|
23
|
+
}
|
|
24
|
+
function languageForText(text, fallback = "en") {
|
|
25
|
+
const value = String(text ?? "").trim();
|
|
26
|
+
if (!value)
|
|
27
|
+
return normalizeTidasLanguageCode(fallback);
|
|
28
|
+
return containsCjk(value) ? "zh" : tidasLanguageForText(value, fallback);
|
|
29
|
+
}
|
|
30
|
+
function preferredSourceLanguageText(values) {
|
|
31
|
+
const texts = ensureArray(values).map(asText).filter(Boolean);
|
|
32
|
+
return texts.find((text) => !containsCjk(text)) || texts[0] || "";
|
|
33
|
+
}
|
|
34
|
+
function contactGlobalReference({ id, version, shortDescription, language = "en", }) {
|
|
35
|
+
return {
|
|
36
|
+
"@type": "contact data set",
|
|
37
|
+
"@refObjectId": id,
|
|
38
|
+
"@version": version,
|
|
39
|
+
"@uri": `../contacts/${id}.json`,
|
|
40
|
+
"common:shortDescription": multiLang(shortDescription, language),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function datasetIdentity(payload, type) {
|
|
44
|
+
const config = bundleRowTypes[type];
|
|
45
|
+
if (!config || !payload || typeof payload !== "object" || Array.isArray(payload)) {
|
|
46
|
+
return { id: null, version: null };
|
|
47
|
+
}
|
|
48
|
+
const payloadRecord = payload;
|
|
49
|
+
const rootValue = payloadRecord[config.rootKey];
|
|
50
|
+
const root = rootValue && typeof rootValue === "object" ? rootValue : {};
|
|
51
|
+
const informationValue = root[config.informationKey];
|
|
52
|
+
const information = informationValue && typeof informationValue === "object"
|
|
53
|
+
? informationValue
|
|
54
|
+
: {};
|
|
55
|
+
const dataSetInformationValue = information.dataSetInformation;
|
|
56
|
+
const dataSetInformation = dataSetInformationValue && typeof dataSetInformationValue === "object"
|
|
57
|
+
? dataSetInformationValue
|
|
58
|
+
: {};
|
|
59
|
+
const administrativeInformationValue = root.administrativeInformation;
|
|
60
|
+
const administrativeInformation = administrativeInformationValue && typeof administrativeInformationValue === "object"
|
|
61
|
+
? administrativeInformationValue
|
|
62
|
+
: {};
|
|
63
|
+
const publicationAndOwnershipValue = administrativeInformation.publicationAndOwnership;
|
|
64
|
+
const publicationAndOwnership = publicationAndOwnershipValue && typeof publicationAndOwnershipValue === "object"
|
|
65
|
+
? publicationAndOwnershipValue
|
|
66
|
+
: {};
|
|
67
|
+
return {
|
|
68
|
+
id: asText(dataSetInformation["common:UUID"]) || null,
|
|
69
|
+
version: asText(publicationAndOwnership["common:dataSetVersion"]) || null,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function contactDescriptionText(reference) {
|
|
73
|
+
const description = reference?.["common:shortDescription"];
|
|
74
|
+
if (typeof description === "string")
|
|
75
|
+
return description;
|
|
76
|
+
if (description && typeof description === "object" && !Array.isArray(description)) {
|
|
77
|
+
const descriptionRecord = description;
|
|
78
|
+
return asText(descriptionRecord["#text"]) || asText(descriptionRecord.value);
|
|
79
|
+
}
|
|
80
|
+
return "";
|
|
81
|
+
}
|
|
82
|
+
function rewriteContactReferences(value, contactRef, stats) {
|
|
83
|
+
if (!value || typeof value !== "object")
|
|
84
|
+
return;
|
|
85
|
+
if (Array.isArray(value)) {
|
|
86
|
+
for (const item of value)
|
|
87
|
+
rewriteContactReferences(item, contactRef, stats);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const valueRecord = value;
|
|
91
|
+
const refType = asText(valueRecord["@type"]).toLowerCase();
|
|
92
|
+
const refObjectId = asText(valueRecord["@refObjectId"]);
|
|
93
|
+
if (refObjectId && refType.includes("contact")) {
|
|
94
|
+
stats.rewritten += 1;
|
|
95
|
+
stats.previous_ids.add(refObjectId);
|
|
96
|
+
const previousDescription = contactDescriptionText(value);
|
|
97
|
+
if (previousDescription)
|
|
98
|
+
stats.previous_descriptions.add(previousDescription);
|
|
99
|
+
valueRecord["@type"] = contactRef["@type"];
|
|
100
|
+
valueRecord["@refObjectId"] = contactRef["@refObjectId"];
|
|
101
|
+
valueRecord["@version"] = contactRef["@version"];
|
|
102
|
+
valueRecord["@uri"] = contactRef["@uri"];
|
|
103
|
+
valueRecord["common:shortDescription"] = cloneJson(contactRef["common:shortDescription"]);
|
|
104
|
+
}
|
|
105
|
+
for (const child of Object.values(valueRecord)) {
|
|
106
|
+
rewriteContactReferences(child, contactRef, stats);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function isObjectEmpty(value) {
|
|
110
|
+
return (value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0);
|
|
111
|
+
}
|
|
112
|
+
function pathExpression(pathSegments) {
|
|
113
|
+
return pathSegments.map(String).join(".");
|
|
114
|
+
}
|
|
115
|
+
function cleanEcoSpoldNameText(text) {
|
|
116
|
+
return String(text ?? "")
|
|
117
|
+
.replace(/^\s*x+\s+/iu, "")
|
|
118
|
+
.replace(/\s*\{[A-Za-z][A-Za-z0-9_-]*\}/gu, "")
|
|
119
|
+
.replace(/\s{2,}/gu, " ")
|
|
120
|
+
.trim();
|
|
121
|
+
}
|
|
122
|
+
function sanitizePlaceholderText(text, pathSegments, stats) {
|
|
123
|
+
const original = String(text ?? "");
|
|
124
|
+
let next = original;
|
|
125
|
+
if (/^\s*0\s+Not declared in source package\s*$/iu.test(next)) {
|
|
126
|
+
next = "Not specified";
|
|
127
|
+
}
|
|
128
|
+
if (next.trim().toLowerCase().includes("not declared in source package") ||
|
|
129
|
+
next.trim().toLowerCase().includes("source package metadata not declared") ||
|
|
130
|
+
next.trim() === "<null>" ||
|
|
131
|
+
next.trim() === "Not specified by the BAFU ecoSpold1 source.") {
|
|
132
|
+
next = "Not specified";
|
|
133
|
+
}
|
|
134
|
+
if (pathSegments.includes("baseName") || pathSegments.includes("common:shortDescription")) {
|
|
135
|
+
next = cleanEcoSpoldNameText(next);
|
|
136
|
+
}
|
|
137
|
+
if (next !== original) {
|
|
138
|
+
stats.placeholder_text_replacements += 1;
|
|
139
|
+
}
|
|
140
|
+
return next;
|
|
141
|
+
}
|
|
142
|
+
function bundleClassificationEntries(payload, type) {
|
|
143
|
+
const config = bundleRowTypes[type];
|
|
144
|
+
const payloadRecord = payload;
|
|
145
|
+
const root = payloadRecord?.[config?.rootKey];
|
|
146
|
+
const information = root?.[config?.informationKey];
|
|
147
|
+
const dataSetInformation = information?.dataSetInformation;
|
|
148
|
+
const classificationInformation = dataSetInformation?.classificationInformation;
|
|
149
|
+
const classification = classificationInformation?.["common:classification"];
|
|
150
|
+
const classes = classification?.["common:class"];
|
|
151
|
+
return ensureArray(classes)
|
|
152
|
+
.filter((item) => Boolean(item && typeof item === "object" && !Array.isArray(item)))
|
|
153
|
+
.map((item) => ({
|
|
154
|
+
level: asText(item["@level"]),
|
|
155
|
+
class_id: asText(item["@classId"]),
|
|
156
|
+
text: asText(item["#text"]),
|
|
157
|
+
}))
|
|
158
|
+
.filter((item) => item.text);
|
|
159
|
+
}
|
|
160
|
+
function bundleClassificationPath(payload, type) {
|
|
161
|
+
return bundleClassificationEntries(payload, type)
|
|
162
|
+
.map((entry) => entry.text)
|
|
163
|
+
.join(" > ");
|
|
164
|
+
}
|
|
165
|
+
function isConvertedDefaultClassification(classificationPath) {
|
|
166
|
+
return /Other service activities\s*>\s*Activities of membership organizations\s*>\s*Activities of other membership organizations\s*>\s*Activities of other membership organizations n\.e\.c\.|Community,\s*social and personal services\s*>\s*Sewage and waste collection,\s*treatment and disposal and other environmental protection services\s*>\s*Other environmental protection services n\.e\.c\./iu.test(classificationPath);
|
|
167
|
+
}
|
|
168
|
+
function flowTypeOfDataSet(payload) {
|
|
169
|
+
const payloadRecord = payload;
|
|
170
|
+
const flowDataSet = payloadRecord?.flowDataSet;
|
|
171
|
+
const modellingAndValidation = flowDataSet?.modellingAndValidation;
|
|
172
|
+
const lciMethod = modellingAndValidation?.LCIMethod;
|
|
173
|
+
const flowInformation = flowDataSet?.flowInformation;
|
|
174
|
+
const dataSetInformation = flowInformation?.dataSetInformation;
|
|
175
|
+
return asText(lciMethod?.typeOfDataSet ?? dataSetInformation?.typeOfDataSet);
|
|
176
|
+
}
|
|
177
|
+
function flowClassificationSchemaType(payload) {
|
|
178
|
+
return /^elementary flow$/iu.test(flowTypeOfDataSet(payload))
|
|
179
|
+
? "flow-elementary"
|
|
180
|
+
: "flow-product";
|
|
181
|
+
}
|
|
182
|
+
function textValue(value) {
|
|
183
|
+
if (typeof value === "string")
|
|
184
|
+
return value.trim();
|
|
185
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
186
|
+
const valueRecord = value;
|
|
187
|
+
return asText(valueRecord["#text"]) || asText(valueRecord.value);
|
|
188
|
+
}
|
|
189
|
+
if (Array.isArray(value)) {
|
|
190
|
+
for (const item of value) {
|
|
191
|
+
const text = textValue(item);
|
|
192
|
+
if (text)
|
|
193
|
+
return text;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return "";
|
|
197
|
+
}
|
|
198
|
+
function writeJsonLines(filePath, rows) {
|
|
199
|
+
writeText(filePath, rows.map((row) => JSON.stringify(row)).join("\n") + (rows.length ? "\n" : ""));
|
|
200
|
+
}
|
|
201
|
+
function printJson(value) {
|
|
202
|
+
console.log(JSON.stringify(value, null, 2));
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
bundleClassificationPath,
|
|
206
|
+
cleanEcoSpoldNameText,
|
|
207
|
+
contactGlobalReference,
|
|
208
|
+
datasetIdentity,
|
|
209
|
+
datasetRowsFileStem,
|
|
210
|
+
flowClassificationSchemaType,
|
|
211
|
+
flowTypeOfDataSet,
|
|
212
|
+
isConvertedDefaultClassification,
|
|
213
|
+
isObjectEmpty,
|
|
214
|
+
languageForText,
|
|
215
|
+
multiLang,
|
|
216
|
+
normalizeTidasLanguageCode,
|
|
217
|
+
pathExpression,
|
|
218
|
+
preferredSourceLanguageText,
|
|
219
|
+
printJson,
|
|
220
|
+
rewriteContactReferences,
|
|
221
|
+
sanitizePlaceholderText,
|
|
222
|
+
textValue,
|
|
223
|
+
writeJsonLines,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
type JsonRecord = Record<string, unknown>;
|
|
2
|
+
interface TraceIdentity {
|
|
3
|
+
id: unknown;
|
|
4
|
+
version: unknown;
|
|
5
|
+
}
|
|
6
|
+
interface TraceCoverageRow extends JsonRecord {
|
|
7
|
+
dataset_type?: unknown;
|
|
8
|
+
entity_id?: unknown;
|
|
9
|
+
version?: unknown;
|
|
10
|
+
row_index?: unknown;
|
|
11
|
+
trace_kind?: unknown;
|
|
12
|
+
path?: unknown;
|
|
13
|
+
status?: unknown;
|
|
14
|
+
action_item_code?: unknown;
|
|
15
|
+
blocked_path?: unknown;
|
|
16
|
+
trace_sha256?: unknown;
|
|
17
|
+
}
|
|
18
|
+
interface FoundryTraceSummary {
|
|
19
|
+
unresolved_traces: TraceCoverageRow[];
|
|
20
|
+
source_exchange_completeness: TraceCoverageRow[];
|
|
21
|
+
}
|
|
22
|
+
type TraceCoverageBlocker = JsonRecord;
|
|
23
|
+
export type TraceCoverageDependencies = {
|
|
24
|
+
asText: (value: unknown) => string;
|
|
25
|
+
datasetIdentity: (row: JsonRecord, datasetType: string) => TraceIdentity;
|
|
26
|
+
fileExists: (filePath: string) => boolean;
|
|
27
|
+
foundryTraceSummary: (options: {
|
|
28
|
+
datasetType: string;
|
|
29
|
+
identity: TraceIdentity;
|
|
30
|
+
row: JsonRecord;
|
|
31
|
+
rowIndex: number;
|
|
32
|
+
}) => FoundryTraceSummary;
|
|
33
|
+
readJsonLines: (filePath: string) => unknown[];
|
|
34
|
+
readRowsFile: (filePath: string) => unknown[];
|
|
35
|
+
repoRelativePath: (filePath: string) => string;
|
|
36
|
+
resolveRepoPath: (filePath: string | null | undefined) => string | null;
|
|
37
|
+
};
|
|
38
|
+
export declare function createTraceCoverageUtils({ asText, datasetIdentity, fileExists, foundryTraceSummary, readJsonLines, readRowsFile, repoRelativePath, resolveRepoPath, }: TraceCoverageDependencies): {
|
|
39
|
+
validateTraceQueueCoverageForRows: ({ datasetType, finalRowsFile, traceQueues, counts, blockers, }: {
|
|
40
|
+
datasetType: string;
|
|
41
|
+
finalRowsFile: string;
|
|
42
|
+
traceQueues: {
|
|
43
|
+
unresolved_traces?: string | null;
|
|
44
|
+
source_exchange_completeness_traces?: string | null;
|
|
45
|
+
};
|
|
46
|
+
counts: {
|
|
47
|
+
unresolved_trace_entries: number;
|
|
48
|
+
source_exchange_completeness_entries: number;
|
|
49
|
+
};
|
|
50
|
+
blockers: TraceCoverageBlocker[];
|
|
51
|
+
}) => void;
|
|
52
|
+
};
|
|
53
|
+
export {};
|