@empire-builder-kit/nx 1.0.0-rc.47 → 1.0.0-rc.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -169
- package/executors.json +24 -79
- package/generators.json +8 -18
- package/package.json +13 -71
- package/src/aws/identity.d.ts +1 -1
- package/src/aws-authority/boundary-transforms.d.ts +9 -0
- package/src/aws-authority/boundary-transforms.js +78 -0
- package/src/aws-authority/contracts.d.ts +116 -0
- package/src/aws-authority/contracts.js +40 -0
- package/src/aws-authority/deployment-guardrails.d.ts +4 -0
- package/src/aws-authority/deployment-guardrails.js +543 -0
- package/src/aws-authority/deployment-policy-groups.d.ts +3 -0
- package/src/aws-authority/deployment-policy-groups.js +299 -0
- package/src/aws-authority/deployment-resources.d.ts +64 -0
- package/src/aws-authority/deployment-resources.js +265 -0
- package/src/aws-authority/deployment-services.d.ts +3 -0
- package/src/aws-authority/deployment-services.js +717 -0
- package/src/aws-authority/development-authority.d.ts +11 -0
- package/src/aws-authority/development-authority.js +160 -0
- package/src/aws-authority/guardrail-actions.d.ts +87 -0
- package/src/aws-authority/guardrail-actions.js +463 -0
- package/src/aws-authority/policy-document.d.ts +15 -0
- package/src/aws-authority/policy-document.js +264 -0
- package/src/aws-authority/runtime-boundary.d.ts +7 -0
- package/src/aws-authority/runtime-boundary.js +211 -0
- package/src/aws-authority/service-actions.d.ts +96 -0
- package/src/aws-authority/service-actions.js +512 -0
- package/src/aws-authority/stage-authority.d.ts +6 -272
- package/src/aws-authority/stage-authority.js +109 -3609
- package/src/aws-authority/stage-identity.d.ts +6 -0
- package/src/aws-authority/stage-identity.js +134 -0
- package/src/cli/bootstrap.d.ts +0 -20
- package/src/cli/bootstrap.js +2 -153
- package/src/cli/dev-command.d.ts +2 -4
- package/src/cli/dev-command.js +1 -19
- package/src/cli/main.d.ts +0 -4
- package/src/cli/main.js +22 -80
- package/src/cli/output.d.ts +2 -4
- package/src/cli/output.js +2 -8
- package/src/executors/deployment-plan/deployment-plan.d.ts +0 -2
- package/src/executors/deployment-plan/deployment-plan.js +3 -68
- package/src/executors/dev-doctor/dev-doctor.js +2 -2
- package/src/executors/local-deploy/deployed-smoke.d.ts +12 -0
- package/src/executors/local-deploy/deployed-smoke.js +115 -0
- package/src/executors/local-deploy/deployment-authority.d.ts +24 -0
- package/src/executors/local-deploy/deployment-authority.js +81 -0
- package/src/executors/local-deploy/deployment-child.d.ts +18 -0
- package/src/executors/local-deploy/deployment-child.js +77 -0
- package/src/executors/local-deploy/deployment-contracts.d.ts +96 -0
- package/src/executors/local-deploy/deployment-contracts.js +3 -0
- package/src/executors/local-deploy/deployment-projects.d.ts +4 -0
- package/src/executors/local-deploy/deployment-projects.js +16 -0
- package/src/executors/local-deploy/deployment-receipt.d.ts +4 -0
- package/src/executors/local-deploy/deployment-receipt.js +55 -0
- package/src/executors/local-deploy/deployment-scope.d.ts +17 -0
- package/src/executors/local-deploy/deployment-scope.js +239 -0
- package/src/executors/local-deploy/deployment-source.d.ts +13 -0
- package/src/executors/local-deploy/deployment-source.js +86 -0
- package/src/executors/local-deploy/local-deploy.d.ts +5 -121
- package/src/executors/local-deploy/local-deploy.js +55 -936
- package/src/executors/sst-lifecycle/governed-child-process.d.ts +27 -0
- package/src/executors/sst-lifecycle/governed-child-process.js +277 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js +4 -10
- package/src/executors/sst-lifecycle/run-sst-command.d.ts +4 -85
- package/src/executors/sst-lifecycle/run-sst-command.js +28 -834
- package/src/executors/sst-lifecycle/sst-contracts.d.ts +44 -0
- package/src/executors/sst-lifecycle/sst-contracts.js +3 -0
- package/src/executors/sst-lifecycle/sst-invocation.d.ts +17 -0
- package/src/executors/sst-lifecycle/sst-invocation.js +502 -0
- package/src/executors/sst-lifecycle/task-unlock.js +3 -3
- package/src/foundation/discovery.d.ts +1 -5
- package/src/foundation/discovery.js +0 -2
- package/src/foundation/index.d.ts +0 -2
- package/src/foundation/index.js +0 -9
- package/src/foundation/local-private-smoke-access.d.ts +6 -15
- package/src/foundation/local-private-smoke-access.js +8 -192
- package/src/foundation/observability.d.ts +16 -26
- package/src/foundation/observability.js +34 -135
- package/src/foundation/preflight.js +0 -14
- package/src/foundation/private-smoke-access.d.ts +7 -14
- package/src/foundation/private-smoke-access.js +4 -126
- package/src/foundation/root-site-workspace.d.ts +35 -0
- package/src/foundation/root-site-workspace.js +80 -0
- package/src/foundation/root-site.d.ts +8 -7
- package/src/foundation/root-site.js +17 -9
- package/src/generators/formatting.js +5 -4
- package/src/generators/function/function.d.ts +9 -5
- package/src/generators/function/function.js +106 -136
- package/src/generators/function/schema.json +2 -2
- package/src/generators/function-access/function-access.d.ts +0 -6
- package/src/generators/function-access/function-access.js +41 -109
- package/src/generators/observability-policy.js +1 -2
- package/src/{supply-chain → generators}/pnpm-toolchain-authority.d.ts +3 -3
- package/src/{supply-chain → generators}/pnpm-toolchain-authority.js +12 -12
- package/src/generators/post-generation-install.d.ts +1 -8
- package/src/generators/post-generation-install.js +11 -139
- package/src/generators/preset/dependency-overrides.d.ts +13 -19
- package/src/generators/preset/dependency-overrides.js +12 -56
- package/src/generators/preset/generator.js +0 -3
- package/src/generators/preset/workspace-files-foundation-infra.d.ts +6 -0
- package/src/generators/preset/workspace-files-foundation-infra.js +586 -0
- package/src/generators/preset/workspace-files-foundation-readme.d.ts +5 -0
- package/src/generators/preset/workspace-files-foundation-readme.js +90 -0
- package/src/generators/preset/workspace-files-foundation.d.ts +3 -0
- package/src/generators/preset/workspace-files-foundation.js +170 -0
- package/src/generators/preset/workspace-files-ownership.d.ts +9 -0
- package/src/generators/preset/workspace-files-ownership.js +124 -0
- package/src/generators/preset/workspace-files-root-config.d.ts +32 -0
- package/src/generators/preset/workspace-files-root-config.js +356 -0
- package/src/generators/preset/workspace-files-root-docs.d.ts +5 -0
- package/src/generators/preset/workspace-files-root-docs.js +109 -0
- package/src/generators/preset/workspace-files-shared.d.ts +18 -0
- package/src/generators/preset/workspace-files-shared.js +7 -0
- package/src/generators/preset/workspace-files-workflows.d.ts +39 -0
- package/src/generators/preset/workspace-files-workflows.js +306 -0
- package/src/generators/preset/workspace-files-workspace-health.d.ts +6 -0
- package/src/generators/preset/workspace-files-workspace-health.js +148 -0
- package/src/generators/preset/workspace-files.d.ts +10 -24
- package/src/generators/preset/workspace-files.js +48 -10705
- package/src/generators/site/built-in-site-documentation-files.d.ts +2 -1
- package/src/generators/site/built-in-site-documentation-files.js +15 -56
- package/src/generators/site/built-in-site-files.d.ts +4 -1
- package/src/generators/site/built-in-site-files.js +12 -11
- package/src/generators/site/built-in-site-infrastructure-files.d.ts +2 -1
- package/src/generators/site/built-in-site-infrastructure-files.js +46 -206
- package/src/generators/site/built-in-site-plan.d.ts +5 -1
- package/src/generators/site/built-in-site-plan.js +7 -5
- package/src/generators/site/built-in-site-project-files.d.ts +10 -2
- package/src/generators/site/built-in-site-project-files.js +131 -177
- package/src/generators/site/built-in-site-script-files.d.ts +2 -0
- package/src/generators/site/built-in-site-script-files.js +76 -280
- package/src/generators/site/built-in-site-shared.d.ts +64 -4
- package/src/generators/site/built-in-site-shared.js +307 -14
- package/src/generators/site/built-in-site-sst-config-files.d.ts +2 -1
- package/src/generators/site/built-in-site-sst-config-files.js +90 -22
- package/src/generators/site/built-in-site-web-files.d.ts +2 -1
- package/src/generators/site/built-in-site-web-files.js +19 -225
- package/src/generators/site/schema.d.ts +5 -0
- package/src/generators/site/schema.json +6 -0
- package/src/generators/site/site.d.ts +0 -8
- package/src/generators/site/site.js +17 -85
- package/src/generators/slice/built-in-plan-api-files.d.ts +1 -2
- package/src/generators/slice/built-in-plan-api-files.js +30 -890
- package/src/generators/slice/built-in-plan-database-lifecycle-files.js +57 -1851
- package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +5 -2
- package/src/generators/slice/built-in-plan-infrastructure-files.js +80 -3272
- package/src/generators/slice/built-in-plan-key-value-files.d.ts +3 -2
- package/src/generators/slice/built-in-plan-key-value-files.js +3 -21
- package/src/generators/slice/built-in-plan-project-files.d.ts +5 -3
- package/src/generators/slice/built-in-plan-project-files.js +79 -897
- package/src/generators/slice/built-in-plan-shared.d.ts +3 -18
- package/src/generators/slice/built-in-plan-shared.js +4 -57
- package/src/generators/slice/built-in-plan-web-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-web-files.js +14 -540
- package/src/generators/slice/built-in-plan.d.ts +2 -3
- package/src/generators/slice/built-in-plan.js +79 -277
- package/src/{developer-agent/preview-changes.d.ts → generators/slice/generation-tree.d.ts} +1 -5
- package/src/generators/slice/generation-tree.js +161 -0
- package/src/generators/slice/schema.json +12 -4
- package/src/generators/slice/slice-config.d.ts +7 -0
- package/src/generators/slice/slice-config.js +125 -0
- package/src/generators/slice/slice.js +29 -261
- package/src/generators/slice/sql-bootstrap.d.ts +1 -0
- package/src/generators/slice/sql-bootstrap.js +505 -0
- package/src/generators/slice/sql-client.d.ts +1 -0
- package/src/generators/slice/sql-client.js +107 -0
- package/src/generators/slice/sql-infrastructure.d.ts +1 -0
- package/src/generators/slice/sql-infrastructure.js +225 -0
- package/src/generators/slice/sql-logging.d.ts +1 -0
- package/src/generators/slice/sql-logging.js +266 -0
- package/src/generators/slice/sql-migration.d.ts +2 -0
- package/src/generators/slice/sql-migration.js +202 -0
- package/src/generators/slice/standard-slice-contract.d.ts +25 -0
- package/src/generators/slice/standard-slice-contract.js +64 -0
- package/src/generators/sql/schema.json +1 -1
- package/src/generators/sql/sql.d.ts +1 -1
- package/src/generators/sql/sql.js +13 -7
- package/src/generators/upgrade/framework-package-upgrade.d.ts +4 -27
- package/src/generators/upgrade/framework-package-upgrade.js +16 -39
- package/src/generators/upgrade/framework-packages.d.ts +25 -0
- package/src/generators/upgrade/framework-packages.js +138 -0
- package/src/generators/upgrade/function-authentication-notice.d.ts +10 -18
- package/src/generators/upgrade/function-authentication-notice.js +24 -44
- package/src/generators/upgrade/schema.d.ts +0 -3
- package/src/generators/upgrade/schema.json +6 -16
- package/src/generators/upgrade/slice-compositions.d.ts +20 -0
- package/src/generators/upgrade/slice-compositions.js +100 -0
- package/src/generators/upgrade/slice-upgrade-guidance.d.ts +19 -0
- package/src/generators/upgrade/slice-upgrade-guidance.js +50 -0
- package/src/generators/upgrade/slice-upgrade.d.ts +4 -0
- package/src/generators/upgrade/slice-upgrade.js +231 -0
- package/src/generators/upgrade/upgrade-plan.d.ts +10 -13
- package/src/generators/upgrade/upgrade-plan.js +33 -197
- package/src/generators/upgrade/upgrade-preflight.d.ts +20 -0
- package/src/generators/upgrade/upgrade-preflight.js +64 -0
- package/src/generators/upgrade/upgrade.d.ts +8 -53
- package/src/generators/upgrade/upgrade.js +23 -1571
- package/src/generators/workload/schema.json +2 -2
- package/src/generators/workload/workload.d.ts +11 -11
- package/src/generators/workload/workload.js +166 -1255
- package/src/index.d.ts +0 -5
- package/src/index.js +0 -5
- package/src/local-dev/browser-verification.d.ts +0 -7
- package/src/local-dev/browser-verification.js +0 -136
- package/src/local-dev/contracts.d.ts +6 -0
- package/src/local-dev/contracts.js +17 -9
- package/src/local-dev/environment-checks.d.ts +126 -0
- package/src/local-dev/environment-checks.js +81 -0
- package/src/local-dev/environment-inspector.d.ts +3 -124
- package/src/local-dev/environment-inspector.js +9 -148
- package/src/local-dev/private-state.d.ts +1 -0
- package/src/local-dev/private-state.js +19 -23
- package/src/local-dev/process-identity.js +4 -2
- package/src/local-dev/slice-runner-child.d.ts +37 -0
- package/src/local-dev/slice-runner-child.js +127 -0
- package/src/local-dev/slice-runner-recovery.d.ts +32 -0
- package/src/local-dev/slice-runner-recovery.js +216 -0
- package/src/local-dev/slice-runner-state.d.ts +82 -0
- package/src/local-dev/slice-runner-state.js +265 -0
- package/src/local-dev/slice-runner.d.ts +4 -117
- package/src/local-dev/slice-runner.js +59 -594
- package/src/local-dev/tls.js +8 -97
- package/src/ownership/index.d.ts +1 -0
- package/src/ownership/index.js +6 -0
- package/src/ownership/pnpm-workspace.d.ts +77 -0
- package/src/ownership/pnpm-workspace.js +225 -0
- package/src/ownership/site-record.d.ts +8 -0
- package/src/ownership/site-record.js +17 -2
- package/src/repository-policy/capacity-migration.d.ts +1 -1
- package/src/repository-policy/capacity-migration.js +1 -1
- package/src/repository-policy/foundation-router.d.ts +17 -0
- package/src/repository-policy/foundation-router.js +44 -0
- package/src/repository-policy/index.d.ts +2 -0
- package/src/repository-policy/index.js +2 -0
- package/src/repository-policy/policy-accounts.d.ts +22 -0
- package/src/repository-policy/policy-accounts.js +134 -0
- package/src/repository-policy/policy-files.d.ts +8 -0
- package/src/repository-policy/policy-files.js +201 -0
- package/src/repository-policy/policy-internal.d.ts +2 -0
- package/src/repository-policy/policy-internal.js +11 -0
- package/src/repository-policy/policy-model.d.ts +95 -0
- package/src/repository-policy/policy-model.js +42 -0
- package/src/repository-policy/policy-validation.d.ts +4 -0
- package/src/repository-policy/policy-validation.js +308 -0
- package/src/repository-policy/policy.d.ts +5 -120
- package/src/repository-policy/policy.js +34 -662
- package/src/repository-policy/public-dns.d.ts +4 -0
- package/src/repository-policy/public-dns.js +102 -5
- package/src/{generators/repository-policy → repository-policy}/tree-policy.d.ts +1 -1
- package/src/{generators/repository-policy → repository-policy}/tree-policy.js +5 -5
- package/src/schemas/repository-policy-v1.json +40 -3
- package/src/secrets/index.d.ts +0 -5
- package/src/secrets/index.js +0 -5
- package/src/slice-infra/index.d.ts +57 -0
- package/src/slice-infra/index.js +117 -0
- package/src/slice-scripts/build.d.ts +27 -0
- package/src/slice-scripts/build.js +120 -0
- package/src/slice-scripts/database.d.ts +87 -0
- package/src/slice-scripts/database.js +328 -0
- package/src/slice-scripts/index.d.ts +11 -0
- package/src/slice-scripts/index.js +23 -0
- package/src/slice-scripts/root-site-routes.d.ts +11 -0
- package/src/slice-scripts/root-site-routes.js +83 -0
- package/src/slice-scripts/sql-migration-engine.mjs +180 -0
- package/src/workload-roles/effective-policy.d.ts +0 -37
- package/src/workload-roles/effective-policy.js +1 -174
- package/src/workload-roles/standard-slice.d.ts +2 -19
- package/src/workload-roles/standard-slice.js +3 -129
- package/src/api-contract/baseline-update.d.ts +0 -82
- package/src/api-contract/baseline-update.js +0 -225
- package/src/api-contract/compatibility.d.ts +0 -30
- package/src/api-contract/compatibility.js +0 -643
- package/src/api-contract/contract-graph.d.ts +0 -35
- package/src/api-contract/contract-graph.js +0 -141
- package/src/api-contract/evidence.d.ts +0 -23
- package/src/api-contract/evidence.js +0 -87
- package/src/api-contract/index.d.ts +0 -6
- package/src/api-contract/index.js +0 -10
- package/src/api-contract/model.d.ts +0 -144
- package/src/api-contract/model.js +0 -993
- package/src/api-contract/rollout.d.ts +0 -32
- package/src/api-contract/rollout.js +0 -88
- package/src/authorization/compatibility.d.ts +0 -62
- package/src/authorization/compatibility.js +0 -175
- package/src/authorization/index.d.ts +0 -1
- package/src/authorization/index.js +0 -5
- package/src/blueprints/execution.d.ts +0 -55
- package/src/blueprints/execution.js +0 -329
- package/src/blueprints/external-sandbox.d.ts +0 -53
- package/src/blueprints/external-sandbox.js +0 -1194
- package/src/blueprints/index.d.ts +0 -5
- package/src/blueprints/index.js +0 -9
- package/src/blueprints/inputs.d.ts +0 -43
- package/src/blueprints/inputs.js +0 -103
- package/src/blueprints/manifest.d.ts +0 -281
- package/src/blueprints/manifest.js +0 -424
- package/src/blueprints/resolver.d.ts +0 -37
- package/src/blueprints/resolver.js +0 -387
- package/src/blueprints/transitions.d.ts +0 -20
- package/src/blueprints/transitions.js +0 -61
- package/src/cli/agent-command.d.ts +0 -30
- package/src/cli/agent-command.js +0 -204
- package/src/cli/agent-runtime.d.ts +0 -25
- package/src/cli/agent-runtime.js +0 -498
- package/src/cli/blueprint-authority.d.ts +0 -9
- package/src/cli/blueprint-authority.js +0 -43
- package/src/cli/blueprint-command.d.ts +0 -24
- package/src/cli/blueprint-command.js +0 -63
- package/src/data-lifecycle/index.d.ts +0 -3
- package/src/data-lifecycle/index.js +0 -7
- package/src/data-lifecycle/model.d.ts +0 -172
- package/src/data-lifecycle/model.js +0 -95
- package/src/data-lifecycle/sensitive-artifacts.d.ts +0 -28
- package/src/data-lifecycle/sensitive-artifacts.js +0 -146
- package/src/data-lifecycle/validation.d.ts +0 -32
- package/src/data-lifecycle/validation.js +0 -837
- package/src/database-retirement/contract.d.ts +0 -68
- package/src/database-retirement/contract.js +0 -166
- package/src/database-retirement/index.d.ts +0 -1
- package/src/database-retirement/index.js +0 -5
- package/src/developer-agent/context.d.ts +0 -57
- package/src/developer-agent/context.js +0 -662
- package/src/developer-agent/generator-planning.d.ts +0 -34
- package/src/developer-agent/generator-planning.js +0 -759
- package/src/developer-agent/generator-preview.d.ts +0 -8
- package/src/developer-agent/generator-preview.js +0 -650
- package/src/developer-agent/git-inspection.d.ts +0 -112
- package/src/developer-agent/git-inspection.js +0 -887
- package/src/developer-agent/handoff.d.ts +0 -43
- package/src/developer-agent/handoff.js +0 -713
- package/src/developer-agent/index.d.ts +0 -10
- package/src/developer-agent/index.js +0 -14
- package/src/developer-agent/model.d.ts +0 -497
- package/src/developer-agent/model.js +0 -144
- package/src/developer-agent/operation-registry.d.ts +0 -61
- package/src/developer-agent/operation-registry.js +0 -1591
- package/src/developer-agent/ordering.d.ts +0 -9
- package/src/developer-agent/ordering.js +0 -15
- package/src/developer-agent/planning.d.ts +0 -25
- package/src/developer-agent/planning.js +0 -481
- package/src/developer-agent/preview-changes.js +0 -225
- package/src/developer-agent/preview-source.d.ts +0 -2
- package/src/developer-agent/preview-source.js +0 -19
- package/src/developer-agent/validation.d.ts +0 -30
- package/src/developer-agent/validation.js +0 -2729
- package/src/developer-agent/workspace-inspection.d.ts +0 -20
- package/src/developer-agent/workspace-inspection.js +0 -1236
- package/src/developer-agent/workspace-path.d.ts +0 -6
- package/src/developer-agent/workspace-path.js +0 -22
- package/src/executors/blueprint-trust/blueprint-trust.d.ts +0 -29
- package/src/executors/blueprint-trust/blueprint-trust.js +0 -121
- package/src/executors/blueprint-trust/schema.json +0 -27
- package/src/executors/blueprint-verification/blueprint-verification.d.ts +0 -13
- package/src/executors/blueprint-verification/blueprint-verification.js +0 -110
- package/src/executors/blueprint-verification/schema.json +0 -44
- package/src/executors/developer-context/developer-context.d.ts +0 -38
- package/src/executors/developer-context/developer-context.js +0 -78
- package/src/executors/developer-context/schema.json +0 -87
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +0 -19
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +0 -105
- package/src/executors/foundation-profile-preflight/schema.json +0 -32
- package/src/executors/github-bootstrap/github-bootstrap.d.ts +0 -13
- package/src/executors/github-bootstrap/github-bootstrap.js +0 -62
- package/src/executors/github-bootstrap/schema.json +0 -50
- package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +0 -37
- package/src/executors/infrastructure-plan/infrastructure-plan.js +0 -275
- package/src/executors/infrastructure-plan/schema.json +0 -38
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.d.ts +0 -42
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +0 -1229
- package/src/executors/router-waf-rehearsal/schema.json +0 -29
- package/src/executors/secret-guardrails/schema.json +0 -6
- package/src/executors/secret-guardrails/secret-guardrails.d.ts +0 -3
- package/src/executors/secret-guardrails/secret-guardrails.js +0 -44
- package/src/executors/secret-initialize/schema.json +0 -42
- package/src/executors/secret-initialize/secret-initialize.d.ts +0 -34
- package/src/executors/secret-initialize/secret-initialize.js +0 -297
- package/src/executors/secret-metadata/schema.json +0 -36
- package/src/executors/secret-metadata/secret-metadata.d.ts +0 -46
- package/src/executors/secret-metadata/secret-metadata.js +0 -230
- package/src/executors/sst-lifecycle/generated-secret-retirement.d.ts +0 -53
- package/src/executors/sst-lifecycle/generated-secret-retirement.js +0 -192
- package/src/executors/sst-lifecycle/logging-preflight.d.ts +0 -22
- package/src/executors/sst-lifecycle/logging-preflight.js +0 -217
- package/src/executors/sst-lifecycle/secret-preflight.d.ts +0 -27
- package/src/executors/sst-lifecycle/secret-preflight.js +0 -125
- package/src/executors/work-markers/schema.json +0 -14
- package/src/executors/work-markers/work-markers.d.ts +0 -6
- package/src/executors/work-markers/work-markers.js +0 -20
- package/src/foundation/cost-estimate.d.ts +0 -175
- package/src/foundation/cost-estimate.js +0 -706
- package/src/foundation/private-smoke-admission.d.ts +0 -45
- package/src/foundation/private-smoke-admission.js +0 -180
- package/src/foundation/private-smoke-control-plane.d.ts +0 -18
- package/src/foundation/private-smoke-control-plane.js +0 -184
- package/src/foundation/root-site-readiness.d.ts +0 -27
- package/src/foundation/root-site-readiness.js +0 -78
- package/src/foundation/router-waf-rate-rehearsal.d.ts +0 -97
- package/src/foundation/router-waf-rate-rehearsal.js +0 -210
- package/src/foundation/router-waf.d.ts +0 -149
- package/src/foundation/router-waf.js +0 -809
- package/src/frontend-security/index.d.ts +0 -1
- package/src/frontend-security/index.js +0 -5
- package/src/frontend-security/security-headers.d.ts +0 -50
- package/src/frontend-security/security-headers.js +0 -418
- package/src/generators/blueprint/blueprint.d.ts +0 -5
- package/src/generators/blueprint/blueprint.js +0 -102
- package/src/generators/blueprint/files.d.ts +0 -6
- package/src/generators/blueprint/files.js +0 -217
- package/src/generators/blueprint/schema.d.ts +0 -4
- package/src/generators/blueprint/schema.json +0 -18
- package/src/generators/feature-registry.d.ts +0 -13
- package/src/generators/feature-registry.js +0 -73
- package/src/generators/function/function-registration.d.ts +0 -24
- package/src/generators/function/function-registration.js +0 -66
- package/src/generators/observability-infrastructure.d.ts +0 -2
- package/src/generators/observability-infrastructure.js +0 -31
- package/src/generators/preset/workspace-files-adopter-skills.d.ts +0 -7
- package/src/generators/preset/workspace-files-adopter-skills.js +0 -359
- package/src/generators/preset/workspace-files-agent-development.d.ts +0 -9
- package/src/generators/preset/workspace-files-agent-development.js +0 -42
- package/src/generators/preset/workspace-files-ci-acceptance.d.ts +0 -1
- package/src/generators/preset/workspace-files-ci-acceptance.js +0 -791
- package/src/generators/preset/workspace-files-ci-install.d.ts +0 -2
- package/src/generators/preset/workspace-files-ci-install.js +0 -196
- package/src/generators/preset/workspace-files-developer-agent.d.ts +0 -16
- package/src/generators/preset/workspace-files-developer-agent.js +0 -644
- package/src/generators/preset/workspace-files-ecr-inspector.d.ts +0 -18
- package/src/generators/preset/workspace-files-ecr-inspector.js +0 -298
- package/src/generators/preset/workspace-files-foundation-workload-roles.d.ts +0 -6
- package/src/generators/preset/workspace-files-foundation-workload-roles.js +0 -409
- package/src/generators/preset/workspace-files-performance-cost.d.ts +0 -66
- package/src/generators/preset/workspace-files-performance-cost.js +0 -866
- package/src/generators/preset/workspace-files-performance-load.d.ts +0 -73
- package/src/generators/preset/workspace-files-performance-load.js +0 -815
- package/src/generators/preset/workspace-files-shared-operation-claims.d.ts +0 -10
- package/src/generators/preset/workspace-files-shared-operation-claims.js +0 -59
- package/src/generators/preset/workspace-files-stage-authority.d.ts +0 -6
- package/src/generators/preset/workspace-files-stage-authority.js +0 -586
- package/src/generators/preset/workspace-files-thin-deploy.d.ts +0 -76
- package/src/generators/preset/workspace-files-thin-deploy.js +0 -2563
- package/src/generators/preset/workspace-files-thin-docs.d.ts +0 -7
- package/src/generators/preset/workspace-files-thin-docs.js +0 -386
- package/src/generators/preset/workspace-files-thin-release.d.ts +0 -14
- package/src/generators/preset/workspace-files-thin-release.js +0 -26
- package/src/generators/preset/workspace-files-workload-role-baseline.d.ts +0 -9
- package/src/generators/preset/workspace-files-workload-role-baseline.js +0 -1314
- package/src/generators/repository-policy/repository-policy.d.ts +0 -4
- package/src/generators/repository-policy/repository-policy.js +0 -294
- package/src/generators/repository-policy/schema.d.ts +0 -30
- package/src/generators/repository-policy/schema.json +0 -127
- package/src/generators/site/built-in-site-smoke-files.d.ts +0 -2
- package/src/generators/site/built-in-site-smoke-files.js +0 -37
- package/src/generators/slice/built-in-plan-alarm-identity.d.ts +0 -182
- package/src/generators/slice/built-in-plan-alarm-identity.js +0 -209
- package/src/generators/slice/built-in-plan-api-contract-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-api-contract-files.js +0 -2848
- package/src/generators/slice/built-in-plan-async-work-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-async-work-files.js +0 -6118
- package/src/generators/slice/built-in-plan-authorization-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-authorization-files.js +0 -2082
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +0 -1301
- package/src/generators/slice/built-in-plan-authorization-storage.d.ts +0 -3
- package/src/generators/slice/built-in-plan-authorization-storage.js +0 -119
- package/src/generators/slice/built-in-plan-background-work-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-background-work-files.js +0 -99
- package/src/generators/slice/built-in-plan-data-deletion-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-deletion-files.js +0 -273
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +0 -223
- package/src/generators/slice/built-in-plan-data-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-files.js +0 -618
- package/src/generators/slice/built-in-plan-data-lifecycle-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-lifecycle-files.js +0 -775
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +0 -863
- package/src/generators/slice/built-in-plan-data-retention-job-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-retention-job-files.js +0 -169
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +0 -186
- package/src/generators/slice/built-in-plan-data-rights-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-rights-files.js +0 -152
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +0 -508
- package/src/generators/slice/built-in-plan-event-contract-literal.d.ts +0 -6
- package/src/generators/slice/built-in-plan-event-contract-literal.js +0 -52
- package/src/generators/slice/built-in-plan-foundation-files.d.ts +0 -15
- package/src/generators/slice/built-in-plan-foundation-files.js +0 -314
- package/src/generators/slice/built-in-plan-frontend-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-frontend-files.js +0 -1975
- package/src/generators/slice/built-in-plan-frontend-header-proof.d.ts +0 -6
- package/src/generators/slice/built-in-plan-frontend-header-proof.js +0 -282
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.js +0 -373
- package/src/generators/slice/built-in-plan-key-value-cleanup.d.ts +0 -4
- package/src/generators/slice/built-in-plan-key-value-cleanup.js +0 -101
- package/src/generators/slice/built-in-plan-key-value-consumer.d.ts +0 -4
- package/src/generators/slice/built-in-plan-key-value-consumer.js +0 -151
- package/src/generators/slice/built-in-plan-key-value-deletion.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-deletion.js +0 -377
- package/src/generators/slice/built-in-plan-key-value-delivery.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-delivery.js +0 -137
- package/src/generators/slice/built-in-plan-key-value-export.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-export.js +0 -595
- package/src/generators/slice/built-in-plan-key-value-holds.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-holds.js +0 -189
- package/src/generators/slice/built-in-plan-key-value-infrastructure.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-infrastructure.js +0 -102
- package/src/generators/slice/built-in-plan-key-value-performance.d.ts +0 -5
- package/src/generators/slice/built-in-plan-key-value-performance.js +0 -530
- package/src/generators/slice/built-in-plan-key-value-provider.d.ts +0 -4
- package/src/generators/slice/built-in-plan-key-value-provider.js +0 -366
- package/src/generators/slice/built-in-plan-key-value-records.d.ts +0 -3
- package/src/generators/slice/built-in-plan-key-value-records.js +0 -232
- package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.js +0 -103
- package/src/generators/slice/built-in-plan-key-value-retention-job-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention-job-files.js +0 -160
- package/src/generators/slice/built-in-plan-key-value-retention-maintenance.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention-maintenance.js +0 -329
- package/src/generators/slice/built-in-plan-key-value-retention-worker.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention-worker.js +0 -477
- package/src/generators/slice/built-in-plan-key-value-retention.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention.js +0 -184
- package/src/generators/slice/built-in-plan-log-group-helpers.d.ts +0 -29
- package/src/generators/slice/built-in-plan-log-group-helpers.js +0 -130
- package/src/generators/slice/built-in-plan-metadata-files.d.ts +0 -3
- package/src/generators/slice/built-in-plan-metadata-files.js +0 -401
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +0 -324
- package/src/generators/slice/built-in-plan-next-build-authority.d.ts +0 -5
- package/src/generators/slice/built-in-plan-next-build-authority.js +0 -124
- package/src/generators/slice/built-in-plan-operations-files.d.ts +0 -8
- package/src/generators/slice/built-in-plan-operations-files.js +0 -1106
- package/src/generators/slice/built-in-plan-performance-files.d.ts +0 -4
- package/src/generators/slice/built-in-plan-performance-files.js +0 -2444
- package/src/generators/slice/built-in-plan-release-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-release-files.js +0 -6585
- package/src/generators/slice/built-in-plan-reliability-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-reliability-files.js +0 -4728
- package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-secret-runtime-files.js +0 -1015
- package/src/generators/slice/built-in-plan-sql-events.d.ts +0 -2
- package/src/generators/slice/built-in-plan-sql-events.js +0 -276
- package/src/generators/slice/built-in-plan-testing-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-testing-files.js +0 -2618
- package/src/generators/slice/built-in-plan-testing-persistence-event-files.d.ts +0 -7
- package/src/generators/slice/built-in-plan-testing-persistence-event-files.js +0 -487
- package/src/generators/slice/built-in-plan-testing-persistence-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-testing-persistence-files.js +0 -180
- package/src/generators/slice/built-in-plan-thin-release-files.d.ts +0 -11
- package/src/generators/slice/built-in-plan-thin-release-files.js +0 -162
- package/src/generators/slice/built-in-plan-verification-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-verification-files.js +0 -442
- package/src/generators/slice/built-in-plan-workload-role-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-workload-role-files.js +0 -2220
- package/src/generators/slice/data-policy-review-seed.d.ts +0 -2
- package/src/generators/slice/data-policy-review-seed.js +0 -22
- package/src/generators/slice/deployed-smoke-diagnostics.d.ts +0 -35
- package/src/generators/slice/deployed-smoke-diagnostics.js +0 -189
- package/src/generators/slice/deployed-smoke-readiness.d.ts +0 -9
- package/src/generators/slice/deployed-smoke-readiness.js +0 -309
- package/src/generators/slice/local-source-identity.d.ts +0 -2
- package/src/generators/slice/local-source-identity.js +0 -31
- package/src/generators/slice/pnpm-launch-script.d.ts +0 -13
- package/src/generators/slice/pnpm-launch-script.js +0 -28
- package/src/generators/upgrade/custom-domain-notice.d.ts +0 -19
- package/src/generators/upgrade/custom-domain-notice.js +0 -38
- package/src/generators/upgrade/external-blueprint-compositions.d.ts +0 -84
- package/src/generators/upgrade/external-blueprint-compositions.js +0 -478
- package/src/generators/upgrade/sql-seeded-reconciliation.d.ts +0 -2
- package/src/generators/upgrade/sql-seeded-reconciliation.js +0 -170
- package/src/generators/workload/performance-registration.d.ts +0 -33
- package/src/generators/workload/performance-registration.js +0 -224
- package/src/generators/workload/reliability-registration.d.ts +0 -16
- package/src/generators/workload/reliability-registration.js +0 -150
- package/src/generators/workload/service-performance-files.d.ts +0 -5
- package/src/generators/workload/service-performance-files.js +0 -1883
- package/src/git-policy/action-pins.d.ts +0 -43
- package/src/git-policy/action-pins.js +0 -50
- package/src/git-policy/github-bootstrap.d.ts +0 -95
- package/src/git-policy/github-bootstrap.js +0 -1250
- package/src/git-policy/index.d.ts +0 -3
- package/src/git-policy/index.js +0 -7
- package/src/git-policy/routing.d.ts +0 -21
- package/src/git-policy/routing.js +0 -138
- package/src/infrastructure-change/convergence.d.ts +0 -13
- package/src/infrastructure-change/convergence.js +0 -85
- package/src/infrastructure-change/drift.d.ts +0 -13
- package/src/infrastructure-change/drift.js +0 -112
- package/src/infrastructure-change/index.d.ts +0 -7
- package/src/infrastructure-change/index.js +0 -11
- package/src/infrastructure-change/local-capability.d.ts +0 -73
- package/src/infrastructure-change/local-capability.js +0 -114
- package/src/infrastructure-change/model.d.ts +0 -274
- package/src/infrastructure-change/model.js +0 -29
- package/src/infrastructure-change/normalize.d.ts +0 -16
- package/src/infrastructure-change/normalize.js +0 -285
- package/src/infrastructure-change/plan.d.ts +0 -67
- package/src/infrastructure-change/plan.js +0 -671
- package/src/infrastructure-change/risk.d.ts +0 -9
- package/src/infrastructure-change/risk.js +0 -349
- package/src/infrastructure-change/summary.d.ts +0 -20
- package/src/infrastructure-change/summary.js +0 -130
- package/src/performance/cost-collection.d.ts +0 -225
- package/src/performance/cost-collection.js +0 -827
- package/src/performance/cost-controls.d.ts +0 -135
- package/src/performance/cost-controls.js +0 -347
- package/src/performance/evidence.d.ts +0 -140
- package/src/performance/evidence.js +0 -601
- package/src/performance/index.d.ts +0 -10
- package/src/performance/index.js +0 -14
- package/src/performance/load-safety.d.ts +0 -84
- package/src/performance/load-safety.js +0 -348
- package/src/performance/model.d.ts +0 -129
- package/src/performance/model.js +0 -451
- package/src/performance/pr-artifact-budget.d.ts +0 -42
- package/src/performance/pr-artifact-budget.js +0 -151
- package/src/performance/runner.d.ts +0 -75
- package/src/performance/runner.js +0 -227
- package/src/performance/scenario-endpoint.d.ts +0 -1
- package/src/performance/scenario-endpoint.js +0 -5
- package/src/performance/scenario.d.ts +0 -215
- package/src/performance/scenario.js +0 -744
- package/src/performance/unit-cost.d.ts +0 -105
- package/src/performance/unit-cost.js +0 -364
- package/src/release/index.d.ts +0 -2
- package/src/release/index.js +0 -6
- package/src/release/lifecycle.d.ts +0 -132
- package/src/release/lifecycle.js +0 -411
- package/src/release/manifest.d.ts +0 -148
- package/src/release/manifest.js +0 -503
- package/src/release/rollout.d.ts +0 -170
- package/src/release/rollout.js +0 -578
- package/src/release/source-authority.d.ts +0 -19
- package/src/release/source-authority.js +0 -212
- package/src/schemas/aggregate-count-evidence-v1.json +0 -135
- package/src/schemas/api-contract-baseline-v1.json +0 -674
- package/src/schemas/api-contract-compatibility-report-v1.json +0 -126
- package/src/schemas/aws-billing-actual-evidence-v1.json +0 -407
- package/src/schemas/blueprint-input-schema-v1.json +0 -23
- package/src/schemas/blueprint-v1.json +0 -188
- package/src/schemas/data-lifecycle-policy-v1.json +0 -517
- package/src/schemas/performance-policy-v1.json +0 -335
- package/src/schemas/testing-evidence-quarantine-v1.json +0 -168
- package/src/schemas/testing-evidence-result-v1.json +0 -319
- package/src/secrets/aws-control-plane.d.ts +0 -29
- package/src/secrets/aws-control-plane.js +0 -322
- package/src/secrets/generated-aws-control-plane.d.ts +0 -33
- package/src/secrets/generated-aws-control-plane.js +0 -322
- package/src/secrets/guardrails.d.ts +0 -26
- package/src/secrets/guardrails.js +0 -328
- package/src/secrets/metadata.d.ts +0 -48
- package/src/secrets/metadata.js +0 -199
- package/src/secrets/operator.d.ts +0 -190
- package/src/secrets/operator.js +0 -701
- package/src/secrets/verification.d.ts +0 -18
- package/src/secrets/verification.js +0 -152
- package/src/supply-chain/action-pins.d.ts +0 -26
- package/src/supply-chain/action-pins.js +0 -262
- package/src/supply-chain/blueprint-trust-git.d.ts +0 -130
- package/src/supply-chain/blueprint-trust-git.js +0 -1666
- package/src/supply-chain/blueprint-trust-process.d.ts +0 -4
- package/src/supply-chain/blueprint-trust-process.js +0 -88
- package/src/supply-chain/blueprint-trust.d.ts +0 -354
- package/src/supply-chain/blueprint-trust.js +0 -1558
- package/src/supply-chain/blueprint-verification-authority.d.ts +0 -62
- package/src/supply-chain/blueprint-verification-authority.js +0 -679
- package/src/supply-chain/blueprint-verification-execution.d.ts +0 -68
- package/src/supply-chain/blueprint-verification-execution.js +0 -639
- package/src/supply-chain/build-output-bounds.d.ts +0 -2
- package/src/supply-chain/build-output-bounds.js +0 -12
- package/src/supply-chain/build-output.d.ts +0 -41
- package/src/supply-chain/build-output.js +0 -551
- package/src/supply-chain/common.d.ts +0 -21
- package/src/supply-chain/common.js +0 -107
- package/src/supply-chain/container-artifact-contract.d.ts +0 -23
- package/src/supply-chain/container-artifact-contract.js +0 -208
- package/src/supply-chain/container-release.d.ts +0 -119
- package/src/supply-chain/container-release.js +0 -496
- package/src/supply-chain/ecr-applicability.d.ts +0 -19
- package/src/supply-chain/ecr-applicability.js +0 -103
- package/src/supply-chain/ecr-scanning.d.ts +0 -85
- package/src/supply-chain/ecr-scanning.js +0 -325
- package/src/supply-chain/ecs-deployed-image.d.ts +0 -87
- package/src/supply-chain/ecs-deployed-image.js +0 -302
- package/src/supply-chain/errors.d.ts +0 -6
- package/src/supply-chain/errors.js +0 -15
- package/src/supply-chain/generated-blueprint-trust-command.d.ts +0 -4
- package/src/supply-chain/generated-blueprint-trust-command.js +0 -1394
- package/src/supply-chain/generated-command.d.ts +0 -1
- package/src/supply-chain/generated-command.js +0 -775
- package/src/supply-chain/generated-container-release-command.d.ts +0 -16
- package/src/supply-chain/generated-container-release-command.js +0 -3248
- package/src/supply-chain/generated-ecr-collector-command.d.ts +0 -20
- package/src/supply-chain/generated-ecr-collector-command.js +0 -1445
- package/src/supply-chain/generated-files.d.ts +0 -13
- package/src/supply-chain/generated-files.js +0 -421
- package/src/supply-chain/generated-scanner-command.d.ts +0 -1
- package/src/supply-chain/generated-scanner-command.js +0 -778
- package/src/supply-chain/index.d.ts +0 -28
- package/src/supply-chain/index.js +0 -36
- package/src/supply-chain/inventory.d.ts +0 -96
- package/src/supply-chain/inventory.js +0 -828
- package/src/supply-chain/license-expression.d.ts +0 -7
- package/src/supply-chain/license-expression.js +0 -128
- package/src/supply-chain/policy.d.ts +0 -105
- package/src/supply-chain/policy.js +0 -304
- package/src/supply-chain/publication.d.ts +0 -48
- package/src/supply-chain/publication.js +0 -85
- package/src/supply-chain/sbom.d.ts +0 -228
- package/src/supply-chain/sbom.js +0 -913
- package/src/supply-chain/scanner.d.ts +0 -77
- package/src/supply-chain/scanner.js +0 -514
- package/src/supply-chain/vendored-source.d.ts +0 -95
- package/src/supply-chain/vendored-source.js +0 -315
- package/src/testing-evidence/fixture-scope.d.ts +0 -53
- package/src/testing-evidence/fixture-scope.js +0 -142
- package/src/testing-evidence/index.d.ts +0 -5
- package/src/testing-evidence/index.js +0 -9
- package/src/testing-evidence/quarantine.d.ts +0 -48
- package/src/testing-evidence/quarantine.js +0 -253
- package/src/testing-evidence/result.d.ts +0 -109
- package/src/testing-evidence/result.js +0 -585
- package/src/testing-evidence/runner-adapter.d.ts +0 -51
- package/src/testing-evidence/runner-adapter.js +0 -288
- package/src/testing-evidence/sensitive-artifacts.d.ts +0 -13
- package/src/testing-evidence/sensitive-artifacts.js +0 -93
- package/src/work-markers/index.d.ts +0 -1
- package/src/work-markers/index.js +0 -5
- package/src/work-markers/work-markers.d.ts +0 -39
- package/src/work-markers/work-markers.js +0 -363
- package/src/workload-roles/account-baseline.d.ts +0 -143
- package/src/workload-roles/account-baseline.js +0 -980
- package/src/workload-roles/authority.d.ts +0 -40
- package/src/workload-roles/authority.js +0 -202
- package/src/workload-roles/aws-adapter.d.ts +0 -99
- package/src/workload-roles/aws-adapter.js +0 -416
- package/src/workload-roles/aws-internal-handler.d.ts +0 -27
- package/src/workload-roles/aws-internal-handler.js +0 -58
- package/src/workload-roles/aws-s3-state.d.ts +0 -52
- package/src/workload-roles/aws-s3-state.js +0 -191
- package/src/workload-roles/aws-sdk-control-plane.d.ts +0 -12
- package/src/workload-roles/aws-sdk-control-plane.js +0 -291
- package/src/workload-roles/boundary.d.ts +0 -34
- package/src/workload-roles/boundary.js +0 -137
- package/src/workload-roles/convergence.d.ts +0 -66
- package/src/workload-roles/convergence.js +0 -186
- package/src/workload-roles/handler.d.ts +0 -43
- package/src/workload-roles/handler.js +0 -158
- package/src/workload-roles/history.d.ts +0 -47
- package/src/workload-roles/history.js +0 -324
- package/src/workload-roles/injection.d.ts +0 -119
- package/src/workload-roles/injection.js +0 -495
- package/src/workload-roles/manifest.d.ts +0 -54
- package/src/workload-roles/manifest.js +0 -343
- package/src/workload-roles/provisioner.d.ts +0 -70
- package/src/workload-roles/provisioner.js +0 -239
- package/src/workload-roles/registration.d.ts +0 -102
- package/src/workload-roles/registration.js +0 -462
- package/src/workload-roles/stage-boundary.d.ts +0 -31
- package/src/workload-roles/stage-boundary.js +0 -208
- /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.d.ts +0 -0
- /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.js +0 -0
|
@@ -1,2848 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderProductApiContractFiles = renderProductApiContractFiles;
|
|
4
|
-
const api_contract_1 = require("@empire-builder-kit/runtime/api-contract");
|
|
5
|
-
const index_js_1 = require("../../api-contract/index.js");
|
|
6
|
-
const built_in_plan_event_contract_literal_js_1 = require("./built-in-plan-event-contract-literal.js");
|
|
7
|
-
const built_in_plan_shared_js_1 = require("./built-in-plan-shared.js");
|
|
8
|
-
const local_source_identity_js_1 = require("./local-source-identity.js");
|
|
9
|
-
// Shared by the machine-readable contract and the generated operation source.
|
|
10
|
-
const KEY_VALUE_RECORD_PROBLEMS = [
|
|
11
|
-
{
|
|
12
|
-
code: 'record_input_invalid',
|
|
13
|
-
message: 'Record input is invalid.',
|
|
14
|
-
retryable: false,
|
|
15
|
-
status: 400,
|
|
16
|
-
type: 'https://empirebuilderkit.dev/problems/records/input-invalid',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
code: 'record_idempotency_conflict',
|
|
20
|
-
message: 'The mutation receipt does not match this exact request.',
|
|
21
|
-
retryable: false,
|
|
22
|
-
status: 409,
|
|
23
|
-
type: 'https://empirebuilderkit.dev/problems/records/idempotency-conflict',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
code: 'record_write_conflict',
|
|
27
|
-
message: 'The record changed concurrently; retry the request.',
|
|
28
|
-
retryable: true,
|
|
29
|
-
status: 409,
|
|
30
|
-
type: 'https://empirebuilderkit.dev/problems/records/write-conflict',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
code: 'record_not_found',
|
|
34
|
-
message: 'The record was not found.',
|
|
35
|
-
retryable: false,
|
|
36
|
-
status: 404,
|
|
37
|
-
type: 'https://empirebuilderkit.dev/problems/records/not-found',
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
function createStandardApiContract(name, pascalName) {
|
|
41
|
-
const authenticationProblems = [
|
|
42
|
-
{
|
|
43
|
-
code: 'auth_invalid_token',
|
|
44
|
-
message: 'The access token is invalid or expired.',
|
|
45
|
-
retryable: false,
|
|
46
|
-
status: 401,
|
|
47
|
-
type: 'https://empirebuilderkit.dev/problems/auth/invalid-token',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
code: 'auth_unauthenticated',
|
|
51
|
-
message: 'Authentication is required.',
|
|
52
|
-
retryable: false,
|
|
53
|
-
status: 401,
|
|
54
|
-
type: 'https://empirebuilderkit.dev/problems/auth/unauthenticated',
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
const authorizationProblems = [
|
|
58
|
-
...authenticationProblems,
|
|
59
|
-
{
|
|
60
|
-
code: 'authorization_admission_required',
|
|
61
|
-
message: 'Required operation admission is missing.',
|
|
62
|
-
retryable: false,
|
|
63
|
-
status: 403,
|
|
64
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/admission-required',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
code: 'authorization_approval_required',
|
|
68
|
-
message: 'Approval is required.',
|
|
69
|
-
retryable: false,
|
|
70
|
-
status: 409,
|
|
71
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/approval-required',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
code: 'authorization_denied',
|
|
75
|
-
message: 'Authorization denied.',
|
|
76
|
-
retryable: false,
|
|
77
|
-
status: 403,
|
|
78
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/denied',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
code: 'authorization_input_invalid',
|
|
82
|
-
message: 'Authorization input is invalid.',
|
|
83
|
-
retryable: false,
|
|
84
|
-
status: 403,
|
|
85
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/input-invalid',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
code: 'authorization_policy_stale',
|
|
89
|
-
message: 'Authorization policy is not current.',
|
|
90
|
-
retryable: true,
|
|
91
|
-
status: 503,
|
|
92
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/policy-stale',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
code: 'authorization_unavailable',
|
|
96
|
-
message: 'Authorization is temporarily unavailable.',
|
|
97
|
-
retryable: true,
|
|
98
|
-
status: 503,
|
|
99
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/unavailable',
|
|
100
|
-
},
|
|
101
|
-
];
|
|
102
|
-
const recordConflictProblems = [
|
|
103
|
-
...authorizationProblems,
|
|
104
|
-
...KEY_VALUE_RECORD_PROBLEMS,
|
|
105
|
-
{
|
|
106
|
-
code: 'record_conflict',
|
|
107
|
-
message: 'The record identifier is owned by another principal.',
|
|
108
|
-
retryable: false,
|
|
109
|
-
status: 409,
|
|
110
|
-
type: 'https://empirebuilderkit.dev/problems/records/conflict',
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
code: 'record_correction_retry_required',
|
|
114
|
-
message: 'Record correction propagation requires retry.',
|
|
115
|
-
retryable: true,
|
|
116
|
-
status: 503,
|
|
117
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/correction-retry-required',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
code: 'test_data_expiry_invalid',
|
|
121
|
-
message: 'Test data expiry must be a canonical future timestamp within 48 hours.',
|
|
122
|
-
retryable: false,
|
|
123
|
-
status: 400,
|
|
124
|
-
type: 'https://empirebuilderkit.dev/problems/testing/expiry-invalid',
|
|
125
|
-
},
|
|
126
|
-
];
|
|
127
|
-
const recordNotFoundProblems = [
|
|
128
|
-
...authorizationProblems,
|
|
129
|
-
{
|
|
130
|
-
code: 'record_not_found',
|
|
131
|
-
message: 'The record was not found.',
|
|
132
|
-
retryable: false,
|
|
133
|
-
status: 404,
|
|
134
|
-
type: 'https://empirebuilderkit.dev/problems/records/not-found',
|
|
135
|
-
},
|
|
136
|
-
];
|
|
137
|
-
const delegationProblems = [
|
|
138
|
-
...authorizationProblems,
|
|
139
|
-
{
|
|
140
|
-
code: 'authorization_delegation_expired',
|
|
141
|
-
message: 'Delegated authority has expired.',
|
|
142
|
-
retryable: false,
|
|
143
|
-
status: 403,
|
|
144
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/delegation-expired',
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
code: 'authorization_delegation_out_of_bounds',
|
|
148
|
-
message: 'Delegated authority does not cover this request.',
|
|
149
|
-
retryable: false,
|
|
150
|
-
status: 403,
|
|
151
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/delegation-out-of-bounds',
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
code: 'authorization_delegation_rate_limited',
|
|
155
|
-
message: 'Delegated authority use limit has been reached.',
|
|
156
|
-
retryable: false,
|
|
157
|
-
status: 429,
|
|
158
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/delegation-rate-limited',
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
code: 'authorization_delegation_revoked',
|
|
162
|
-
message: 'Delegated authority has been revoked.',
|
|
163
|
-
retryable: false,
|
|
164
|
-
status: 403,
|
|
165
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/delegation-revoked',
|
|
166
|
-
},
|
|
167
|
-
];
|
|
168
|
-
const delegatedRecordProblems = [
|
|
169
|
-
...delegationProblems,
|
|
170
|
-
{
|
|
171
|
-
code: 'record_not_found',
|
|
172
|
-
message: 'The record was not found.',
|
|
173
|
-
retryable: false,
|
|
174
|
-
status: 404,
|
|
175
|
-
type: 'https://empirebuilderkit.dev/problems/records/not-found',
|
|
176
|
-
},
|
|
177
|
-
];
|
|
178
|
-
const deletionProblems = [
|
|
179
|
-
...recordNotFoundProblems,
|
|
180
|
-
{
|
|
181
|
-
code: 'authorization_approval_expired',
|
|
182
|
-
message: 'Approval has expired.',
|
|
183
|
-
retryable: false,
|
|
184
|
-
status: 409,
|
|
185
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/approval-expired',
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
code: 'authorization_approval_invalid',
|
|
189
|
-
message: 'Approval is not valid for this request.',
|
|
190
|
-
retryable: false,
|
|
191
|
-
status: 409,
|
|
192
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/approval-invalid',
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
code: 'authorization_approval_pending',
|
|
196
|
-
message: 'Approval is pending.',
|
|
197
|
-
retryable: false,
|
|
198
|
-
status: 409,
|
|
199
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/approval-pending',
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
code: 'data_deletion_held',
|
|
203
|
-
message: 'Deletion is blocked by an active hold.',
|
|
204
|
-
retryable: false,
|
|
205
|
-
status: 409,
|
|
206
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/deletion-held',
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
code: 'data_deletion_retry_required',
|
|
210
|
-
message: 'Deletion propagation requires retry.',
|
|
211
|
-
retryable: true,
|
|
212
|
-
status: 503,
|
|
213
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/deletion-retry-required',
|
|
214
|
-
},
|
|
215
|
-
];
|
|
216
|
-
const dataRightsProblems = [
|
|
217
|
-
...recordNotFoundProblems,
|
|
218
|
-
{
|
|
219
|
-
code: 'data_export_expired',
|
|
220
|
-
message: 'The confidential export has expired.',
|
|
221
|
-
retryable: false,
|
|
222
|
-
status: 410,
|
|
223
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-expired',
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
code: 'data_export_held',
|
|
227
|
-
message: 'An active hold blocks the confidential export.',
|
|
228
|
-
retryable: false,
|
|
229
|
-
status: 409,
|
|
230
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-held',
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
code: 'data_export_not_ready',
|
|
234
|
-
message: 'The confidential export is not ready.',
|
|
235
|
-
retryable: false,
|
|
236
|
-
status: 409,
|
|
237
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-not-ready',
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
code: 'data_export_rate_limited',
|
|
241
|
-
message: 'The bounded confidential export rate was exceeded.',
|
|
242
|
-
retryable: false,
|
|
243
|
-
status: 429,
|
|
244
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-rate-limited',
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
code: 'data_export_retry_required',
|
|
248
|
-
message: 'Confidential export processing requires retry.',
|
|
249
|
-
retryable: true,
|
|
250
|
-
status: 503,
|
|
251
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-retry-required',
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
code: 'data_rights_input_invalid',
|
|
255
|
-
message: 'The data-rights request is invalid.',
|
|
256
|
-
retryable: false,
|
|
257
|
-
status: 400,
|
|
258
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/input-invalid',
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
code: 'record_hold_invalid',
|
|
262
|
-
message: 'The record hold cannot make the requested transition.',
|
|
263
|
-
retryable: false,
|
|
264
|
-
status: 409,
|
|
265
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/hold-invalid',
|
|
266
|
-
},
|
|
267
|
-
];
|
|
268
|
-
const retentionProblems = [
|
|
269
|
-
...authorizationProblems,
|
|
270
|
-
{
|
|
271
|
-
code: 'data_retention_approval_invalid',
|
|
272
|
-
message: 'The retention approval is invalid for this report.',
|
|
273
|
-
retryable: false,
|
|
274
|
-
status: 409,
|
|
275
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-approval-invalid',
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
code: 'data_retention_input_invalid',
|
|
279
|
-
message: 'The retention review request is invalid.',
|
|
280
|
-
retryable: false,
|
|
281
|
-
status: 400,
|
|
282
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-input-invalid',
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
code: 'data_retention_not_reviewable',
|
|
286
|
-
message: 'The retention report is no longer reviewable.',
|
|
287
|
-
retryable: false,
|
|
288
|
-
status: 409,
|
|
289
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-not-reviewable',
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
code: 'data_retention_report_not_found',
|
|
293
|
-
message: 'The retention report was not found.',
|
|
294
|
-
retryable: false,
|
|
295
|
-
status: 404,
|
|
296
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-report-not-found',
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
code: 'data_retention_retry_required',
|
|
300
|
-
message: 'Retention review persistence requires retry.',
|
|
301
|
-
retryable: true,
|
|
302
|
-
status: 503,
|
|
303
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-retry-required',
|
|
304
|
-
},
|
|
305
|
-
];
|
|
306
|
-
const recordPath = () => (0, api_contract_1.apiObject)({
|
|
307
|
-
recordId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
308
|
-
});
|
|
309
|
-
const deletionRequestPath = () => (0, api_contract_1.apiObject)({
|
|
310
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
311
|
-
recordId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
312
|
-
});
|
|
313
|
-
const delegationPath = () => (0, api_contract_1.apiObject)({
|
|
314
|
-
delegationId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
315
|
-
recordId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
316
|
-
});
|
|
317
|
-
const exportPath = () => (0, api_contract_1.apiObject)({
|
|
318
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
319
|
-
recordId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
320
|
-
});
|
|
321
|
-
const holdPath = () => (0, api_contract_1.apiObject)({
|
|
322
|
-
holdId: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 1 }),
|
|
323
|
-
recordId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
324
|
-
});
|
|
325
|
-
const retentionApprovalPath = () => (0, api_contract_1.apiObject)({
|
|
326
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
327
|
-
runId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
328
|
-
});
|
|
329
|
-
const retentionRunPath = () => (0, api_contract_1.apiObject)({
|
|
330
|
-
runId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
331
|
-
});
|
|
332
|
-
const recordResponse = () => (0, api_contract_1.apiObject)({
|
|
333
|
-
id: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
334
|
-
name: (0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 }),
|
|
335
|
-
runScope: (0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 }),
|
|
336
|
-
});
|
|
337
|
-
const holdResponse = () => (0, api_contract_1.apiObject)({
|
|
338
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
339
|
-
holdId: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 1 }),
|
|
340
|
-
reviewAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
341
|
-
status: (0, api_contract_1.apiString)({ enum: ['active', 'released'] }),
|
|
342
|
-
});
|
|
343
|
-
const health = (0, api_contract_1.defineApiOperation)({
|
|
344
|
-
authentication: 'anonymous',
|
|
345
|
-
authorizationActions: [],
|
|
346
|
-
contractVersion: '1.0.0',
|
|
347
|
-
feature: 'operations',
|
|
348
|
-
lifecycle: { status: 'active' },
|
|
349
|
-
method: 'GET',
|
|
350
|
-
operationId: `${name}.health`,
|
|
351
|
-
path: '/health',
|
|
352
|
-
problems: [],
|
|
353
|
-
response: {
|
|
354
|
-
body: (0, api_contract_1.apiObject)({
|
|
355
|
-
service: (0, api_contract_1.apiString)({ enum: [name] }),
|
|
356
|
-
sourceCommit: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 1 }),
|
|
357
|
-
stage: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 1 }),
|
|
358
|
-
status: (0, api_contract_1.apiString)({ enum: ['ok'] }),
|
|
359
|
-
}),
|
|
360
|
-
status: 200,
|
|
361
|
-
},
|
|
362
|
-
responseProfile: 'ebk-app-v1',
|
|
363
|
-
slice: name,
|
|
364
|
-
summary: `Read ${pascalName} API health`,
|
|
365
|
-
});
|
|
366
|
-
const machineAuthorizationProof = (0, api_contract_1.defineApiOperation)({
|
|
367
|
-
authentication: 'customer',
|
|
368
|
-
authorizationActions: [`${name}:machine-proof-read`],
|
|
369
|
-
contractVersion: '1.0.0',
|
|
370
|
-
feature: 'authorization',
|
|
371
|
-
lifecycle: { status: 'active' },
|
|
372
|
-
method: 'GET',
|
|
373
|
-
operationId: `${name}.machine-authorization-proof`,
|
|
374
|
-
path: '/authorization/machine-proof',
|
|
375
|
-
problems: authorizationProblems,
|
|
376
|
-
response: {
|
|
377
|
-
body: (0, api_contract_1.apiObject)({
|
|
378
|
-
message: (0, api_contract_1.apiString)({
|
|
379
|
-
enum: ['Machine authorization accepted.'],
|
|
380
|
-
}),
|
|
381
|
-
}),
|
|
382
|
-
status: 200,
|
|
383
|
-
},
|
|
384
|
-
responseProfile: 'ebk-app-v1',
|
|
385
|
-
slice: name,
|
|
386
|
-
summary: `Prove narrow ${pascalName} machine authorization`,
|
|
387
|
-
});
|
|
388
|
-
const issueRecordDelegation = (0, api_contract_1.defineApiOperation)({
|
|
389
|
-
authentication: 'customer',
|
|
390
|
-
authorizationActions: [`${name}:record-delegation-issue`],
|
|
391
|
-
contractVersion: '1.0.0',
|
|
392
|
-
feature: 'authorization',
|
|
393
|
-
lifecycle: { status: 'active' },
|
|
394
|
-
method: 'POST',
|
|
395
|
-
operationId: `${name}.issue-record-delegation`,
|
|
396
|
-
path: '/records/{recordId}/delegations',
|
|
397
|
-
problems: authorizationProblems,
|
|
398
|
-
request: {
|
|
399
|
-
body: (0, api_contract_1.apiObject)({
|
|
400
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
401
|
-
purposeReference: (0, api_contract_1.apiString)({ maxLength: 256, minLength: 1 }),
|
|
402
|
-
}),
|
|
403
|
-
maxBodyBytes: 512,
|
|
404
|
-
path: recordPath(),
|
|
405
|
-
},
|
|
406
|
-
response: {
|
|
407
|
-
body: (0, api_contract_1.apiObject)({
|
|
408
|
-
capability: (0, api_contract_1.apiString)({ maxLength: 43, minLength: 43 }),
|
|
409
|
-
delegationId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
410
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
411
|
-
status: (0, api_contract_1.apiString)({ enum: ['active'] }),
|
|
412
|
-
}),
|
|
413
|
-
status: 201,
|
|
414
|
-
},
|
|
415
|
-
responseProfile: 'ebk-app-v1',
|
|
416
|
-
slice: name,
|
|
417
|
-
summary: `Issue one attended ${pascalName} record delegation`,
|
|
418
|
-
});
|
|
419
|
-
const revokeRecordDelegation = (0, api_contract_1.defineApiOperation)({
|
|
420
|
-
authentication: 'customer',
|
|
421
|
-
authorizationActions: [`${name}:record-delegation-revoke`],
|
|
422
|
-
contractVersion: '1.0.0',
|
|
423
|
-
feature: 'authorization',
|
|
424
|
-
lifecycle: { status: 'active' },
|
|
425
|
-
method: 'DELETE',
|
|
426
|
-
operationId: `${name}.revoke-record-delegation`,
|
|
427
|
-
path: '/records/{recordId}/delegations/{delegationId}',
|
|
428
|
-
problems: authorizationProblems,
|
|
429
|
-
request: { path: delegationPath() },
|
|
430
|
-
response: {
|
|
431
|
-
body: (0, api_contract_1.apiObject)({
|
|
432
|
-
delegationId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
433
|
-
status: (0, api_contract_1.apiString)({ enum: ['revoked'] }),
|
|
434
|
-
}),
|
|
435
|
-
status: 200,
|
|
436
|
-
},
|
|
437
|
-
responseProfile: 'ebk-app-v1',
|
|
438
|
-
slice: name,
|
|
439
|
-
summary: `Revoke one attended ${pascalName} record delegation`,
|
|
440
|
-
});
|
|
441
|
-
const useRecordDelegation = (0, api_contract_1.defineApiOperation)({
|
|
442
|
-
authentication: 'customer',
|
|
443
|
-
authorizationActions: [`${name}:record-delegation-use`],
|
|
444
|
-
contractVersion: '1.0.0',
|
|
445
|
-
feature: 'authorization',
|
|
446
|
-
lifecycle: { status: 'active' },
|
|
447
|
-
method: 'POST',
|
|
448
|
-
operationId: `${name}.use-record-delegation`,
|
|
449
|
-
path: '/records/{recordId}/delegations/{delegationId}/use',
|
|
450
|
-
problems: delegatedRecordProblems,
|
|
451
|
-
request: {
|
|
452
|
-
body: (0, api_contract_1.apiObject)({
|
|
453
|
-
capability: (0, api_contract_1.apiString)({ maxLength: 43, minLength: 43 }),
|
|
454
|
-
}),
|
|
455
|
-
maxBodyBytes: 256,
|
|
456
|
-
path: delegationPath(),
|
|
457
|
-
},
|
|
458
|
-
response: { body: recordResponse(), status: 200 },
|
|
459
|
-
responseProfile: 'ebk-app-v1',
|
|
460
|
-
slice: name,
|
|
461
|
-
summary: `Use one attended ${pascalName} record delegation`,
|
|
462
|
-
});
|
|
463
|
-
const requestRecordExport = (0, api_contract_1.defineApiOperation)({
|
|
464
|
-
authentication: 'customer',
|
|
465
|
-
authorizationActions: [`${name}:record-export`],
|
|
466
|
-
contractVersion: '1.0.0',
|
|
467
|
-
feature: 'data-lifecycle',
|
|
468
|
-
lifecycle: { status: 'active' },
|
|
469
|
-
method: 'POST',
|
|
470
|
-
operationId: `${name}.request-record-export`,
|
|
471
|
-
path: '/records/{recordId}/exports',
|
|
472
|
-
problems: dataRightsProblems,
|
|
473
|
-
request: { path: recordPath() },
|
|
474
|
-
response: {
|
|
475
|
-
body: (0, api_contract_1.apiObject)({
|
|
476
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
477
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
478
|
-
requestDigest: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 64 }),
|
|
479
|
-
status: (0, api_contract_1.apiString)({ enum: ['pending'] }),
|
|
480
|
-
}),
|
|
481
|
-
status: 202,
|
|
482
|
-
},
|
|
483
|
-
responseProfile: 'ebk-app-v1',
|
|
484
|
-
slice: name,
|
|
485
|
-
summary: `Request one subject-bound ${pascalName} record export`,
|
|
486
|
-
});
|
|
487
|
-
const decideRecordExport = (0, api_contract_1.defineApiOperation)({
|
|
488
|
-
authentication: 'customer',
|
|
489
|
-
authorizationActions: [`${name}:approval-review`],
|
|
490
|
-
contractVersion: '1.0.0',
|
|
491
|
-
feature: 'data-lifecycle',
|
|
492
|
-
lifecycle: { status: 'active' },
|
|
493
|
-
method: 'POST',
|
|
494
|
-
operationId: `${name}.decide-record-export`,
|
|
495
|
-
path: '/records/{recordId}/exports/{approvalRequestId}/decision',
|
|
496
|
-
problems: dataRightsProblems,
|
|
497
|
-
request: {
|
|
498
|
-
body: (0, api_contract_1.apiObject)({
|
|
499
|
-
expectedRequestDigest: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 64 }),
|
|
500
|
-
outcome: (0, api_contract_1.apiString)({ enum: ['approved', 'rejected'] }),
|
|
501
|
-
reasonReference: (0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 }),
|
|
502
|
-
}),
|
|
503
|
-
maxBodyBytes: 512,
|
|
504
|
-
path: exportPath(),
|
|
505
|
-
},
|
|
506
|
-
response: {
|
|
507
|
-
body: (0, api_contract_1.apiObject)({
|
|
508
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
509
|
-
status: (0, api_contract_1.apiString)({ enum: ['approved', 'rejected'] }),
|
|
510
|
-
}),
|
|
511
|
-
status: 200,
|
|
512
|
-
},
|
|
513
|
-
responseProfile: 'ebk-app-v1',
|
|
514
|
-
slice: name,
|
|
515
|
-
summary: `Decide one ${pascalName} record export`,
|
|
516
|
-
});
|
|
517
|
-
const executeRecordExport = (0, api_contract_1.defineApiOperation)({
|
|
518
|
-
authentication: 'customer',
|
|
519
|
-
authorizationActions: [`${name}:record-export`],
|
|
520
|
-
contractVersion: '1.0.0',
|
|
521
|
-
feature: 'data-lifecycle',
|
|
522
|
-
lifecycle: { status: 'active' },
|
|
523
|
-
method: 'POST',
|
|
524
|
-
operationId: `${name}.execute-record-export`,
|
|
525
|
-
path: '/records/{recordId}/exports/{approvalRequestId}/execute',
|
|
526
|
-
problems: dataRightsProblems,
|
|
527
|
-
request: { path: exportPath() },
|
|
528
|
-
response: {
|
|
529
|
-
body: (0, api_contract_1.apiObject)({
|
|
530
|
-
artifactRef: (0, api_contract_1.apiOptional)((0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 })),
|
|
531
|
-
expiresAt: (0, api_contract_1.apiOptional)((0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 })),
|
|
532
|
-
status: (0, api_contract_1.apiString)({ enum: ['held', 'ready'] }),
|
|
533
|
-
}),
|
|
534
|
-
status: 200,
|
|
535
|
-
},
|
|
536
|
-
responseProfile: 'ebk-app-v1',
|
|
537
|
-
slice: name,
|
|
538
|
-
summary: `Execute one approved ${pascalName} record export`,
|
|
539
|
-
});
|
|
540
|
-
const deliverRecordExport = (0, api_contract_1.defineApiOperation)({
|
|
541
|
-
authentication: 'customer',
|
|
542
|
-
authorizationActions: [`${name}:record-export`],
|
|
543
|
-
contractVersion: '1.0.0',
|
|
544
|
-
feature: 'data-lifecycle',
|
|
545
|
-
lifecycle: { status: 'active' },
|
|
546
|
-
method: 'GET',
|
|
547
|
-
operationId: `${name}.deliver-record-export`,
|
|
548
|
-
path: '/records/{recordId}/exports/{approvalRequestId}/delivery',
|
|
549
|
-
problems: dataRightsProblems,
|
|
550
|
-
request: { path: exportPath() },
|
|
551
|
-
response: {
|
|
552
|
-
body: (0, api_contract_1.apiObject)({
|
|
553
|
-
artifactRef: (0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 }),
|
|
554
|
-
deliveredAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
555
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
556
|
-
record: recordResponse(),
|
|
557
|
-
}),
|
|
558
|
-
status: 200,
|
|
559
|
-
},
|
|
560
|
-
responseProfile: 'ebk-app-v1',
|
|
561
|
-
slice: name,
|
|
562
|
-
summary: `Deliver one unexpired ${pascalName} record export`,
|
|
563
|
-
});
|
|
564
|
-
const cleanupRecordExport = (0, api_contract_1.defineApiOperation)({
|
|
565
|
-
authentication: 'customer',
|
|
566
|
-
authorizationActions: [`${name}:record-export-cleanup`],
|
|
567
|
-
contractVersion: '1.0.0',
|
|
568
|
-
feature: 'data-lifecycle',
|
|
569
|
-
lifecycle: { status: 'active' },
|
|
570
|
-
method: 'DELETE',
|
|
571
|
-
operationId: `${name}.cleanup-record-export`,
|
|
572
|
-
path: '/records/{recordId}/exports/{approvalRequestId}',
|
|
573
|
-
problems: dataRightsProblems,
|
|
574
|
-
request: { path: exportPath() },
|
|
575
|
-
response: {
|
|
576
|
-
body: (0, api_contract_1.apiObject)({
|
|
577
|
-
deletedVersions: (0, api_contract_1.apiNumber)({ integer: true, minimum: 0 }),
|
|
578
|
-
status: (0, api_contract_1.apiString)({
|
|
579
|
-
enum: ['completed', 'retry-required'],
|
|
580
|
-
}),
|
|
581
|
-
}),
|
|
582
|
-
status: 200,
|
|
583
|
-
},
|
|
584
|
-
responseProfile: 'ebk-app-v1',
|
|
585
|
-
slice: name,
|
|
586
|
-
summary: `Clean up one expired ${pascalName} record export`,
|
|
587
|
-
});
|
|
588
|
-
const requestRetentionApproval = (0, api_contract_1.defineApiOperation)({
|
|
589
|
-
authentication: 'customer',
|
|
590
|
-
authorizationActions: [`${name}:retention-review`],
|
|
591
|
-
contractVersion: '1.0.0',
|
|
592
|
-
feature: 'data-lifecycle',
|
|
593
|
-
lifecycle: { status: 'active' },
|
|
594
|
-
method: 'POST',
|
|
595
|
-
operationId: `${name}.request-retention-approval`,
|
|
596
|
-
path: '/data-retention/runs/{runId}/approval-requests',
|
|
597
|
-
problems: retentionProblems,
|
|
598
|
-
request: { path: retentionRunPath() },
|
|
599
|
-
response: {
|
|
600
|
-
body: (0, api_contract_1.apiObject)({
|
|
601
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
602
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
603
|
-
requestDigest: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 64 }),
|
|
604
|
-
status: (0, api_contract_1.apiString)({ enum: ['pending'] }),
|
|
605
|
-
}),
|
|
606
|
-
status: 202,
|
|
607
|
-
},
|
|
608
|
-
responseProfile: 'ebk-app-v1',
|
|
609
|
-
slice: name,
|
|
610
|
-
summary: `Request direct-admin review of one ${pascalName} retention report`,
|
|
611
|
-
});
|
|
612
|
-
const decideRetentionApproval = (0, api_contract_1.defineApiOperation)({
|
|
613
|
-
authentication: 'customer',
|
|
614
|
-
authorizationActions: [`${name}:retention-review`],
|
|
615
|
-
contractVersion: '1.0.0',
|
|
616
|
-
feature: 'data-lifecycle',
|
|
617
|
-
lifecycle: { status: 'active' },
|
|
618
|
-
method: 'POST',
|
|
619
|
-
operationId: `${name}.decide-retention-approval`,
|
|
620
|
-
path: '/data-retention/runs/{runId}/approval-requests/{approvalRequestId}/decision',
|
|
621
|
-
problems: retentionProblems,
|
|
622
|
-
request: {
|
|
623
|
-
body: (0, api_contract_1.apiObject)({
|
|
624
|
-
expectedRequestDigest: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 64 }),
|
|
625
|
-
outcome: (0, api_contract_1.apiString)({ enum: ['approved', 'rejected'] }),
|
|
626
|
-
reasonReference: (0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 }),
|
|
627
|
-
}),
|
|
628
|
-
maxBodyBytes: 512,
|
|
629
|
-
path: retentionApprovalPath(),
|
|
630
|
-
},
|
|
631
|
-
response: {
|
|
632
|
-
body: (0, api_contract_1.apiObject)({
|
|
633
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
634
|
-
status: (0, api_contract_1.apiString)({ enum: ['approved', 'rejected'] }),
|
|
635
|
-
}),
|
|
636
|
-
status: 200,
|
|
637
|
-
},
|
|
638
|
-
responseProfile: 'ebk-app-v1',
|
|
639
|
-
slice: name,
|
|
640
|
-
summary: `Decide one ${pascalName} retention approval as a non-author admin`,
|
|
641
|
-
});
|
|
642
|
-
const issueRecordHold = (0, api_contract_1.defineApiOperation)({
|
|
643
|
-
authentication: 'customer',
|
|
644
|
-
authorizationActions: [`${name}:record-hold-manage`],
|
|
645
|
-
contractVersion: '1.0.0',
|
|
646
|
-
feature: 'data-lifecycle',
|
|
647
|
-
lifecycle: { status: 'active' },
|
|
648
|
-
method: 'POST',
|
|
649
|
-
operationId: `${name}.issue-record-hold`,
|
|
650
|
-
path: '/records/{recordId}/holds',
|
|
651
|
-
problems: dataRightsProblems,
|
|
652
|
-
request: {
|
|
653
|
-
body: (0, api_contract_1.apiObject)({
|
|
654
|
-
effects: (0, api_contract_1.apiArray)((0, api_contract_1.apiString)({
|
|
655
|
-
enum: ['block-deletion', 'block-export'],
|
|
656
|
-
}), { maxItems: 2, minItems: 1 }),
|
|
657
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
658
|
-
purpose: (0, api_contract_1.apiString)({
|
|
659
|
-
enum: ['fraud', 'incident', 'legal', 'security', 'support'],
|
|
660
|
-
}),
|
|
661
|
-
reviewAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
662
|
-
}),
|
|
663
|
-
maxBodyBytes: 512,
|
|
664
|
-
path: recordPath(),
|
|
665
|
-
},
|
|
666
|
-
response: { body: holdResponse(), status: 201 },
|
|
667
|
-
responseProfile: 'ebk-app-v1',
|
|
668
|
-
slice: name,
|
|
669
|
-
summary: `Issue one bounded ${pascalName} record hold`,
|
|
670
|
-
});
|
|
671
|
-
const reviewRecordHold = (0, api_contract_1.defineApiOperation)({
|
|
672
|
-
authentication: 'customer',
|
|
673
|
-
authorizationActions: [`${name}:record-hold-manage`],
|
|
674
|
-
contractVersion: '1.0.0',
|
|
675
|
-
feature: 'data-lifecycle',
|
|
676
|
-
lifecycle: { status: 'active' },
|
|
677
|
-
method: 'POST',
|
|
678
|
-
operationId: `${name}.review-record-hold`,
|
|
679
|
-
path: '/records/{recordId}/holds/{holdId}/review',
|
|
680
|
-
problems: dataRightsProblems,
|
|
681
|
-
request: {
|
|
682
|
-
body: (0, api_contract_1.apiObject)({
|
|
683
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
684
|
-
reviewAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
685
|
-
}),
|
|
686
|
-
maxBodyBytes: 256,
|
|
687
|
-
path: holdPath(),
|
|
688
|
-
},
|
|
689
|
-
response: { body: holdResponse(), status: 200 },
|
|
690
|
-
responseProfile: 'ebk-app-v1',
|
|
691
|
-
slice: name,
|
|
692
|
-
summary: `Review one bounded ${pascalName} record hold`,
|
|
693
|
-
});
|
|
694
|
-
const releaseRecordHold = (0, api_contract_1.defineApiOperation)({
|
|
695
|
-
authentication: 'customer',
|
|
696
|
-
authorizationActions: [`${name}:record-hold-manage`],
|
|
697
|
-
contractVersion: '1.0.0',
|
|
698
|
-
feature: 'data-lifecycle',
|
|
699
|
-
lifecycle: { status: 'active' },
|
|
700
|
-
method: 'DELETE',
|
|
701
|
-
operationId: `${name}.release-record-hold`,
|
|
702
|
-
path: '/records/{recordId}/holds/{holdId}',
|
|
703
|
-
problems: dataRightsProblems,
|
|
704
|
-
request: { path: holdPath() },
|
|
705
|
-
response: { body: holdResponse(), status: 200 },
|
|
706
|
-
responseProfile: 'ebk-app-v1',
|
|
707
|
-
slice: name,
|
|
708
|
-
summary: `Release one bounded ${pascalName} record hold`,
|
|
709
|
-
});
|
|
710
|
-
const expireRecordHold = (0, api_contract_1.defineApiOperation)({
|
|
711
|
-
authentication: 'customer',
|
|
712
|
-
authorizationActions: [`${name}:record-hold-manage`],
|
|
713
|
-
contractVersion: '1.0.0',
|
|
714
|
-
feature: 'data-lifecycle',
|
|
715
|
-
lifecycle: { status: 'active' },
|
|
716
|
-
method: 'POST',
|
|
717
|
-
operationId: `${name}.expire-record-hold`,
|
|
718
|
-
path: '/records/{recordId}/holds/{holdId}/expire',
|
|
719
|
-
problems: dataRightsProblems,
|
|
720
|
-
request: { path: holdPath() },
|
|
721
|
-
response: { body: holdResponse(), status: 200 },
|
|
722
|
-
responseProfile: 'ebk-app-v1',
|
|
723
|
-
slice: name,
|
|
724
|
-
summary: `Expire one due ${pascalName} record hold`,
|
|
725
|
-
});
|
|
726
|
-
const protectedExample = (0, api_contract_1.defineApiOperation)({
|
|
727
|
-
authentication: 'customer',
|
|
728
|
-
authorizationActions: [`${name}:protected-read`],
|
|
729
|
-
contractVersion: '1.0.0',
|
|
730
|
-
feature: 'authorization',
|
|
731
|
-
lifecycle: { status: 'active' },
|
|
732
|
-
method: 'GET',
|
|
733
|
-
operationId: `${name}.protected-example`,
|
|
734
|
-
path: '/protected',
|
|
735
|
-
problems: authorizationProblems,
|
|
736
|
-
response: {
|
|
737
|
-
body: (0, api_contract_1.apiObject)({
|
|
738
|
-
message: (0, api_contract_1.apiString)({
|
|
739
|
-
enum: ['Authenticated request accepted.'],
|
|
740
|
-
}),
|
|
741
|
-
}),
|
|
742
|
-
status: 200,
|
|
743
|
-
},
|
|
744
|
-
responseProfile: 'ebk-app-v1',
|
|
745
|
-
slice: name,
|
|
746
|
-
summary: `Read the authenticated ${pascalName} example`,
|
|
747
|
-
});
|
|
748
|
-
const databaseHealth = (0, api_contract_1.defineApiOperation)({
|
|
749
|
-
authentication: 'customer',
|
|
750
|
-
authorizationActions: [`${name}:database-read`],
|
|
751
|
-
contractVersion: '1.0.0',
|
|
752
|
-
feature: 'database',
|
|
753
|
-
lifecycle: { status: 'active' },
|
|
754
|
-
method: 'GET',
|
|
755
|
-
operationId: `${name}.database-health`,
|
|
756
|
-
path: '/database-health',
|
|
757
|
-
problems: authorizationProblems,
|
|
758
|
-
response: {
|
|
759
|
-
body: (0, api_contract_1.apiObject)({
|
|
760
|
-
service: (0, api_contract_1.apiString)({ enum: [name] }),
|
|
761
|
-
status: (0, api_contract_1.apiString)({ enum: ['ok'] }),
|
|
762
|
-
}),
|
|
763
|
-
status: 200,
|
|
764
|
-
},
|
|
765
|
-
responseProfile: 'ebk-app-v1',
|
|
766
|
-
slice: name,
|
|
767
|
-
summary: `Read ${pascalName} database health`,
|
|
768
|
-
});
|
|
769
|
-
const decideRecordDeletion = (0, api_contract_1.defineApiOperation)({
|
|
770
|
-
authentication: 'customer',
|
|
771
|
-
authorizationActions: [`${name}:approval-review`],
|
|
772
|
-
contractVersion: '1.0.0',
|
|
773
|
-
feature: 'data-lifecycle',
|
|
774
|
-
lifecycle: { status: 'active' },
|
|
775
|
-
method: 'POST',
|
|
776
|
-
operationId: `${name}.decide-record-deletion`,
|
|
777
|
-
path: '/records/{recordId}/deletion-requests/{approvalRequestId}/decision',
|
|
778
|
-
problems: deletionProblems,
|
|
779
|
-
request: {
|
|
780
|
-
body: (0, api_contract_1.apiObject)({
|
|
781
|
-
expectedRequestDigest: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 64 }),
|
|
782
|
-
outcome: (0, api_contract_1.apiString)({ enum: ['approved', 'rejected'] }),
|
|
783
|
-
reasonReference: (0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 }),
|
|
784
|
-
}),
|
|
785
|
-
maxBodyBytes: 512,
|
|
786
|
-
path: deletionRequestPath(),
|
|
787
|
-
},
|
|
788
|
-
response: {
|
|
789
|
-
body: (0, api_contract_1.apiObject)({
|
|
790
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
791
|
-
status: (0, api_contract_1.apiString)({ enum: ['approved', 'rejected'] }),
|
|
792
|
-
}),
|
|
793
|
-
status: 200,
|
|
794
|
-
},
|
|
795
|
-
responseProfile: 'ebk-app-v1',
|
|
796
|
-
slice: name,
|
|
797
|
-
summary: `Decide one pending ${pascalName} record deletion`,
|
|
798
|
-
});
|
|
799
|
-
const deleteSyntheticRecord = (0, api_contract_1.defineApiOperation)({
|
|
800
|
-
authentication: 'customer',
|
|
801
|
-
authorizationActions: [`${name}:record-delete`],
|
|
802
|
-
contractVersion: '1.0.0',
|
|
803
|
-
feature: 'database',
|
|
804
|
-
lifecycle: { status: 'active' },
|
|
805
|
-
method: 'DELETE',
|
|
806
|
-
operationId: `${name}.delete-record`,
|
|
807
|
-
path: '/records/{recordId}',
|
|
808
|
-
problems: deletionProblems,
|
|
809
|
-
request: {
|
|
810
|
-
path: recordPath(),
|
|
811
|
-
query: (0, api_contract_1.apiObject)({
|
|
812
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
813
|
-
reasonCode: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 1 }),
|
|
814
|
-
}),
|
|
815
|
-
},
|
|
816
|
-
response: {
|
|
817
|
-
body: (0, api_contract_1.apiObject)({
|
|
818
|
-
deleted: (0, api_contract_1.apiBoolean)(),
|
|
819
|
-
id: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
820
|
-
deliveryPending: (0, api_contract_1.apiOptional)((0, api_contract_1.apiBoolean)()),
|
|
821
|
-
}),
|
|
822
|
-
status: 200,
|
|
823
|
-
},
|
|
824
|
-
responseProfile: 'ebk-app-v1',
|
|
825
|
-
slice: name,
|
|
826
|
-
summary: `Delete one owned ${pascalName} record`,
|
|
827
|
-
});
|
|
828
|
-
const getSyntheticRecord = (0, api_contract_1.defineApiOperation)({
|
|
829
|
-
authentication: 'customer',
|
|
830
|
-
authorizationActions: [`${name}:record-read`],
|
|
831
|
-
contractVersion: '1.0.0',
|
|
832
|
-
feature: 'database',
|
|
833
|
-
lifecycle: { status: 'active' },
|
|
834
|
-
method: 'GET',
|
|
835
|
-
operationId: `${name}.get-record`,
|
|
836
|
-
path: '/records/{recordId}',
|
|
837
|
-
problems: recordNotFoundProblems,
|
|
838
|
-
request: { path: recordPath() },
|
|
839
|
-
response: { body: recordResponse(), status: 200 },
|
|
840
|
-
responseProfile: 'ebk-app-v1',
|
|
841
|
-
slice: name,
|
|
842
|
-
summary: `Read one owned ${pascalName} record`,
|
|
843
|
-
});
|
|
844
|
-
const publishCreated = (0, api_contract_1.defineApiOperation)({
|
|
845
|
-
authentication: 'customer',
|
|
846
|
-
authorizationActions: [`${name}:event-publish`],
|
|
847
|
-
contractVersion: '1.0.0',
|
|
848
|
-
feature: 'events',
|
|
849
|
-
lifecycle: { status: 'active' },
|
|
850
|
-
method: 'POST',
|
|
851
|
-
operationId: `${name}.publish-created`,
|
|
852
|
-
path: '/events/example',
|
|
853
|
-
problems: authorizationProblems,
|
|
854
|
-
response: {
|
|
855
|
-
body: (0, api_contract_1.apiObject)({
|
|
856
|
-
eventId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
857
|
-
}),
|
|
858
|
-
status: 200,
|
|
859
|
-
},
|
|
860
|
-
responseProfile: 'ebk-app-v1',
|
|
861
|
-
slice: name,
|
|
862
|
-
summary: `Publish a ${pascalName} example event`,
|
|
863
|
-
});
|
|
864
|
-
const putSyntheticRecord = (0, api_contract_1.defineApiOperation)({
|
|
865
|
-
authentication: 'customer',
|
|
866
|
-
authorizationActions: [`${name}:record-write`],
|
|
867
|
-
contractVersion: '1.0.0',
|
|
868
|
-
feature: 'database',
|
|
869
|
-
lifecycle: { status: 'active' },
|
|
870
|
-
method: 'PUT',
|
|
871
|
-
operationId: `${name}.put-record`,
|
|
872
|
-
path: '/records/{recordId}',
|
|
873
|
-
problems: recordConflictProblems,
|
|
874
|
-
request: {
|
|
875
|
-
body: (0, api_contract_1.apiObject)({
|
|
876
|
-
name: (0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 }),
|
|
877
|
-
runScope: (0, api_contract_1.apiString)({ maxLength: 128, minLength: 1 }),
|
|
878
|
-
testExpiresAt: (0, api_contract_1.apiOptional)((0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 })),
|
|
879
|
-
}),
|
|
880
|
-
maxBodyBytes: 512,
|
|
881
|
-
path: recordPath(),
|
|
882
|
-
},
|
|
883
|
-
response: { body: recordResponse(), status: 200 },
|
|
884
|
-
responseProfile: 'ebk-app-v1',
|
|
885
|
-
slice: name,
|
|
886
|
-
summary: `Create or replace one owned ${pascalName} record`,
|
|
887
|
-
});
|
|
888
|
-
const requestRecordDeletion = (0, api_contract_1.defineApiOperation)({
|
|
889
|
-
authentication: 'customer',
|
|
890
|
-
authorizationActions: [`${name}:record-delete`],
|
|
891
|
-
contractVersion: '1.0.0',
|
|
892
|
-
feature: 'data-lifecycle',
|
|
893
|
-
lifecycle: { status: 'active' },
|
|
894
|
-
method: 'POST',
|
|
895
|
-
operationId: `${name}.request-record-deletion`,
|
|
896
|
-
path: '/records/{recordId}/deletion-requests',
|
|
897
|
-
problems: recordNotFoundProblems,
|
|
898
|
-
request: {
|
|
899
|
-
body: (0, api_contract_1.apiObject)({
|
|
900
|
-
reasonCode: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 1 }),
|
|
901
|
-
}),
|
|
902
|
-
maxBodyBytes: 256,
|
|
903
|
-
path: recordPath(),
|
|
904
|
-
},
|
|
905
|
-
response: {
|
|
906
|
-
body: (0, api_contract_1.apiObject)({
|
|
907
|
-
approvalRequestId: (0, api_contract_1.apiString)({ format: 'uuid' }),
|
|
908
|
-
expiresAt: (0, api_contract_1.apiString)({ maxLength: 40, minLength: 20 }),
|
|
909
|
-
requestDigest: (0, api_contract_1.apiString)({ maxLength: 64, minLength: 64 }),
|
|
910
|
-
status: (0, api_contract_1.apiString)({ enum: ['pending'] }),
|
|
911
|
-
}),
|
|
912
|
-
status: 202,
|
|
913
|
-
},
|
|
914
|
-
responseProfile: 'ebk-app-v1',
|
|
915
|
-
slice: name,
|
|
916
|
-
summary: `Request approval for one ${pascalName} record deletion`,
|
|
917
|
-
});
|
|
918
|
-
return (0, api_contract_1.defineApiContract)({
|
|
919
|
-
operations: [
|
|
920
|
-
cleanupRecordExport,
|
|
921
|
-
databaseHealth,
|
|
922
|
-
decideRecordExport,
|
|
923
|
-
decideRecordDeletion,
|
|
924
|
-
decideRetentionApproval,
|
|
925
|
-
deliverRecordExport,
|
|
926
|
-
deleteSyntheticRecord,
|
|
927
|
-
executeRecordExport,
|
|
928
|
-
expireRecordHold,
|
|
929
|
-
getSyntheticRecord,
|
|
930
|
-
health,
|
|
931
|
-
issueRecordDelegation,
|
|
932
|
-
issueRecordHold,
|
|
933
|
-
machineAuthorizationProof,
|
|
934
|
-
protectedExample,
|
|
935
|
-
publishCreated,
|
|
936
|
-
putSyntheticRecord,
|
|
937
|
-
requestRecordDeletion,
|
|
938
|
-
requestRecordExport,
|
|
939
|
-
requestRetentionApproval,
|
|
940
|
-
releaseRecordHold,
|
|
941
|
-
reviewRecordHold,
|
|
942
|
-
revokeRecordDelegation,
|
|
943
|
-
useRecordDelegation,
|
|
944
|
-
],
|
|
945
|
-
slice: name,
|
|
946
|
-
title: `${pascalName} API`,
|
|
947
|
-
version: '1.0.0',
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
/** @internal */
|
|
951
|
-
function renderProductApiContractFiles(name, pascalName) {
|
|
952
|
-
const contract = createStandardApiContract(name, pascalName);
|
|
953
|
-
const artifacts = (0, api_contract_1.createApiContractArtifacts)(contract);
|
|
954
|
-
const baseline = (0, index_js_1.canonicalApiContractBaselineJson)((0, index_js_1.createApiContractBaseline)(artifacts.normalized));
|
|
955
|
-
const identifierPrefix = (0, built_in_plan_shared_js_1.lowerCamelIdentifier)(pascalName);
|
|
956
|
-
const contractIdentifier = `${identifierPrefix}ApiContract`;
|
|
957
|
-
return {
|
|
958
|
-
'api/contracts/protected.ts': `import {
|
|
959
|
-
apiArray,
|
|
960
|
-
apiBoolean,
|
|
961
|
-
apiNumber,
|
|
962
|
-
apiObject,
|
|
963
|
-
apiOptional,
|
|
964
|
-
apiString,
|
|
965
|
-
defineApiContract,
|
|
966
|
-
defineApiOperation,
|
|
967
|
-
} from '@empire-builder-kit/runtime/api-contract';
|
|
968
|
-
|
|
969
|
-
const authenticationProblems = [
|
|
970
|
-
{
|
|
971
|
-
code: 'auth_invalid_token',
|
|
972
|
-
message: 'The access token is invalid or expired.',
|
|
973
|
-
retryable: false,
|
|
974
|
-
status: 401,
|
|
975
|
-
type: 'https://empirebuilderkit.dev/problems/auth/invalid-token',
|
|
976
|
-
},
|
|
977
|
-
{
|
|
978
|
-
code: 'auth_unauthenticated',
|
|
979
|
-
message: 'Authentication is required.',
|
|
980
|
-
retryable: false,
|
|
981
|
-
status: 401,
|
|
982
|
-
type: 'https://empirebuilderkit.dev/problems/auth/unauthenticated',
|
|
983
|
-
},
|
|
984
|
-
] as const;
|
|
985
|
-
|
|
986
|
-
const authorizationProblems = [
|
|
987
|
-
...authenticationProblems,
|
|
988
|
-
{
|
|
989
|
-
code: 'authorization_admission_required',
|
|
990
|
-
message: 'Required operation admission is missing.',
|
|
991
|
-
retryable: false,
|
|
992
|
-
status: 403,
|
|
993
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/admission-required',
|
|
994
|
-
},
|
|
995
|
-
{
|
|
996
|
-
code: 'authorization_approval_required',
|
|
997
|
-
message: 'Approval is required.',
|
|
998
|
-
retryable: false,
|
|
999
|
-
status: 409,
|
|
1000
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/approval-required',
|
|
1001
|
-
},
|
|
1002
|
-
{
|
|
1003
|
-
code: 'authorization_denied',
|
|
1004
|
-
message: 'Authorization denied.',
|
|
1005
|
-
retryable: false,
|
|
1006
|
-
status: 403,
|
|
1007
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/denied',
|
|
1008
|
-
},
|
|
1009
|
-
{
|
|
1010
|
-
code: 'authorization_input_invalid',
|
|
1011
|
-
message: 'Authorization input is invalid.',
|
|
1012
|
-
retryable: false,
|
|
1013
|
-
status: 403,
|
|
1014
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/input-invalid',
|
|
1015
|
-
},
|
|
1016
|
-
{
|
|
1017
|
-
code: 'authorization_policy_stale',
|
|
1018
|
-
message: 'Authorization policy is not current.',
|
|
1019
|
-
retryable: true,
|
|
1020
|
-
status: 503,
|
|
1021
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/policy-stale',
|
|
1022
|
-
},
|
|
1023
|
-
{
|
|
1024
|
-
code: 'authorization_unavailable',
|
|
1025
|
-
message: 'Authorization is temporarily unavailable.',
|
|
1026
|
-
retryable: true,
|
|
1027
|
-
status: 503,
|
|
1028
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/unavailable',
|
|
1029
|
-
},
|
|
1030
|
-
] as const;
|
|
1031
|
-
|
|
1032
|
-
const recordConflictProblems = [
|
|
1033
|
-
...authorizationProblems,
|
|
1034
|
-
...${JSON.stringify(KEY_VALUE_RECORD_PROBLEMS, null, 2)},
|
|
1035
|
-
{
|
|
1036
|
-
code: 'record_conflict',
|
|
1037
|
-
message: 'The record identifier is owned by another principal.',
|
|
1038
|
-
retryable: false,
|
|
1039
|
-
status: 409,
|
|
1040
|
-
type: 'https://empirebuilderkit.dev/problems/records/conflict',
|
|
1041
|
-
},
|
|
1042
|
-
{
|
|
1043
|
-
code: 'record_correction_retry_required',
|
|
1044
|
-
message: 'Record correction propagation requires retry.',
|
|
1045
|
-
retryable: true,
|
|
1046
|
-
status: 503,
|
|
1047
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/correction-retry-required',
|
|
1048
|
-
},
|
|
1049
|
-
{
|
|
1050
|
-
code: 'test_data_expiry_invalid',
|
|
1051
|
-
message:
|
|
1052
|
-
'Test data expiry must be a canonical future timestamp within 48 hours.',
|
|
1053
|
-
retryable: false,
|
|
1054
|
-
status: 400,
|
|
1055
|
-
type: 'https://empirebuilderkit.dev/problems/testing/expiry-invalid',
|
|
1056
|
-
},
|
|
1057
|
-
] as const;
|
|
1058
|
-
|
|
1059
|
-
const recordNotFoundProblems = [
|
|
1060
|
-
...authorizationProblems,
|
|
1061
|
-
{
|
|
1062
|
-
code: 'record_not_found',
|
|
1063
|
-
message: 'The record was not found.',
|
|
1064
|
-
retryable: false,
|
|
1065
|
-
status: 404,
|
|
1066
|
-
type: 'https://empirebuilderkit.dev/problems/records/not-found',
|
|
1067
|
-
},
|
|
1068
|
-
] as const;
|
|
1069
|
-
|
|
1070
|
-
const delegationProblems = [
|
|
1071
|
-
...authorizationProblems,
|
|
1072
|
-
{
|
|
1073
|
-
code: 'authorization_delegation_expired',
|
|
1074
|
-
message: 'Delegated authority has expired.',
|
|
1075
|
-
retryable: false,
|
|
1076
|
-
status: 403,
|
|
1077
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/delegation-expired',
|
|
1078
|
-
},
|
|
1079
|
-
{
|
|
1080
|
-
code: 'authorization_delegation_out_of_bounds',
|
|
1081
|
-
message: 'Delegated authority does not cover this request.',
|
|
1082
|
-
retryable: false,
|
|
1083
|
-
status: 403,
|
|
1084
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/delegation-out-of-bounds',
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
code: 'authorization_delegation_rate_limited',
|
|
1088
|
-
message: 'Delegated authority use limit has been reached.',
|
|
1089
|
-
retryable: false,
|
|
1090
|
-
status: 429,
|
|
1091
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/delegation-rate-limited',
|
|
1092
|
-
},
|
|
1093
|
-
{
|
|
1094
|
-
code: 'authorization_delegation_revoked',
|
|
1095
|
-
message: 'Delegated authority has been revoked.',
|
|
1096
|
-
retryable: false,
|
|
1097
|
-
status: 403,
|
|
1098
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/delegation-revoked',
|
|
1099
|
-
},
|
|
1100
|
-
] as const;
|
|
1101
|
-
|
|
1102
|
-
const delegatedRecordProblems = [
|
|
1103
|
-
...delegationProblems,
|
|
1104
|
-
{
|
|
1105
|
-
code: 'record_not_found',
|
|
1106
|
-
message: 'The record was not found.',
|
|
1107
|
-
retryable: false,
|
|
1108
|
-
status: 404,
|
|
1109
|
-
type: 'https://empirebuilderkit.dev/problems/records/not-found',
|
|
1110
|
-
},
|
|
1111
|
-
] as const;
|
|
1112
|
-
|
|
1113
|
-
const deletionProblems = [
|
|
1114
|
-
...recordNotFoundProblems,
|
|
1115
|
-
{
|
|
1116
|
-
code: 'authorization_approval_expired',
|
|
1117
|
-
message: 'Approval has expired.',
|
|
1118
|
-
retryable: false,
|
|
1119
|
-
status: 409,
|
|
1120
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/approval-expired',
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
code: 'authorization_approval_invalid',
|
|
1124
|
-
message: 'Approval is not valid for this request.',
|
|
1125
|
-
retryable: false,
|
|
1126
|
-
status: 409,
|
|
1127
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/approval-invalid',
|
|
1128
|
-
},
|
|
1129
|
-
{
|
|
1130
|
-
code: 'authorization_approval_pending',
|
|
1131
|
-
message: 'Approval is pending.',
|
|
1132
|
-
retryable: false,
|
|
1133
|
-
status: 409,
|
|
1134
|
-
type: 'https://empirebuilderkit.dev/problems/authorization/approval-pending',
|
|
1135
|
-
},
|
|
1136
|
-
{
|
|
1137
|
-
code: 'data_deletion_held',
|
|
1138
|
-
message: 'Deletion is blocked by an active hold.',
|
|
1139
|
-
retryable: false,
|
|
1140
|
-
status: 409,
|
|
1141
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/deletion-held',
|
|
1142
|
-
},
|
|
1143
|
-
{
|
|
1144
|
-
code: 'data_deletion_retry_required',
|
|
1145
|
-
message: 'Deletion propagation requires retry.',
|
|
1146
|
-
retryable: true,
|
|
1147
|
-
status: 503,
|
|
1148
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/deletion-retry-required',
|
|
1149
|
-
},
|
|
1150
|
-
] as const;
|
|
1151
|
-
|
|
1152
|
-
const dataRightsProblems = [
|
|
1153
|
-
...recordNotFoundProblems,
|
|
1154
|
-
{
|
|
1155
|
-
code: 'data_export_expired',
|
|
1156
|
-
message: 'The confidential export has expired.',
|
|
1157
|
-
retryable: false,
|
|
1158
|
-
status: 410,
|
|
1159
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-expired',
|
|
1160
|
-
},
|
|
1161
|
-
{
|
|
1162
|
-
code: 'data_export_held',
|
|
1163
|
-
message: 'An active hold blocks the confidential export.',
|
|
1164
|
-
retryable: false,
|
|
1165
|
-
status: 409,
|
|
1166
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-held',
|
|
1167
|
-
},
|
|
1168
|
-
{
|
|
1169
|
-
code: 'data_export_not_ready',
|
|
1170
|
-
message: 'The confidential export is not ready.',
|
|
1171
|
-
retryable: false,
|
|
1172
|
-
status: 409,
|
|
1173
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-not-ready',
|
|
1174
|
-
},
|
|
1175
|
-
{
|
|
1176
|
-
code: 'data_export_rate_limited',
|
|
1177
|
-
message: 'The bounded confidential export rate was exceeded.',
|
|
1178
|
-
retryable: false,
|
|
1179
|
-
status: 429,
|
|
1180
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-rate-limited',
|
|
1181
|
-
},
|
|
1182
|
-
{
|
|
1183
|
-
code: 'data_export_retry_required',
|
|
1184
|
-
message: 'Confidential export processing requires retry.',
|
|
1185
|
-
retryable: true,
|
|
1186
|
-
status: 503,
|
|
1187
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/export-retry-required',
|
|
1188
|
-
},
|
|
1189
|
-
{
|
|
1190
|
-
code: 'data_rights_input_invalid',
|
|
1191
|
-
message: 'The data-rights request is invalid.',
|
|
1192
|
-
retryable: false,
|
|
1193
|
-
status: 400,
|
|
1194
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/input-invalid',
|
|
1195
|
-
},
|
|
1196
|
-
{
|
|
1197
|
-
code: 'record_hold_invalid',
|
|
1198
|
-
message: 'The record hold cannot make the requested transition.',
|
|
1199
|
-
retryable: false,
|
|
1200
|
-
status: 409,
|
|
1201
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/hold-invalid',
|
|
1202
|
-
},
|
|
1203
|
-
] as const;
|
|
1204
|
-
|
|
1205
|
-
const retentionProblems = [
|
|
1206
|
-
...authorizationProblems,
|
|
1207
|
-
{
|
|
1208
|
-
code: 'data_retention_approval_invalid',
|
|
1209
|
-
message: 'The retention approval is invalid for this report.',
|
|
1210
|
-
retryable: false,
|
|
1211
|
-
status: 409,
|
|
1212
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-approval-invalid',
|
|
1213
|
-
},
|
|
1214
|
-
{
|
|
1215
|
-
code: 'data_retention_input_invalid',
|
|
1216
|
-
message: 'The retention review request is invalid.',
|
|
1217
|
-
retryable: false,
|
|
1218
|
-
status: 400,
|
|
1219
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-input-invalid',
|
|
1220
|
-
},
|
|
1221
|
-
{
|
|
1222
|
-
code: 'data_retention_not_reviewable',
|
|
1223
|
-
message: 'The retention report is no longer reviewable.',
|
|
1224
|
-
retryable: false,
|
|
1225
|
-
status: 409,
|
|
1226
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-not-reviewable',
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
code: 'data_retention_report_not_found',
|
|
1230
|
-
message: 'The retention report was not found.',
|
|
1231
|
-
retryable: false,
|
|
1232
|
-
status: 404,
|
|
1233
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-report-not-found',
|
|
1234
|
-
},
|
|
1235
|
-
{
|
|
1236
|
-
code: 'data_retention_retry_required',
|
|
1237
|
-
message: 'Retention review persistence requires retry.',
|
|
1238
|
-
retryable: true,
|
|
1239
|
-
status: 503,
|
|
1240
|
-
type: 'https://empirebuilderkit.dev/problems/data-lifecycle/retention-retry-required',
|
|
1241
|
-
},
|
|
1242
|
-
] as const;
|
|
1243
|
-
|
|
1244
|
-
const recordPath = () =>
|
|
1245
|
-
apiObject({
|
|
1246
|
-
recordId: apiString({ format: 'uuid' }),
|
|
1247
|
-
});
|
|
1248
|
-
|
|
1249
|
-
const deletionRequestPath = () =>
|
|
1250
|
-
apiObject({
|
|
1251
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1252
|
-
recordId: apiString({ format: 'uuid' }),
|
|
1253
|
-
});
|
|
1254
|
-
|
|
1255
|
-
const delegationPath = () =>
|
|
1256
|
-
apiObject({
|
|
1257
|
-
delegationId: apiString({ format: 'uuid' }),
|
|
1258
|
-
recordId: apiString({ format: 'uuid' }),
|
|
1259
|
-
});
|
|
1260
|
-
|
|
1261
|
-
const exportPath = () =>
|
|
1262
|
-
apiObject({
|
|
1263
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1264
|
-
recordId: apiString({ format: 'uuid' }),
|
|
1265
|
-
});
|
|
1266
|
-
|
|
1267
|
-
const holdPath = () =>
|
|
1268
|
-
apiObject({
|
|
1269
|
-
holdId: apiString({ maxLength: 64, minLength: 1 }),
|
|
1270
|
-
recordId: apiString({ format: 'uuid' }),
|
|
1271
|
-
});
|
|
1272
|
-
|
|
1273
|
-
const retentionApprovalPath = () =>
|
|
1274
|
-
apiObject({
|
|
1275
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1276
|
-
runId: apiString({ format: 'uuid' }),
|
|
1277
|
-
});
|
|
1278
|
-
|
|
1279
|
-
const retentionRunPath = () =>
|
|
1280
|
-
apiObject({
|
|
1281
|
-
runId: apiString({ format: 'uuid' }),
|
|
1282
|
-
});
|
|
1283
|
-
|
|
1284
|
-
const recordResponse = () =>
|
|
1285
|
-
apiObject({
|
|
1286
|
-
id: apiString({ format: 'uuid' }),
|
|
1287
|
-
name: apiString({ maxLength: 128, minLength: 1 }),
|
|
1288
|
-
runScope: apiString({ maxLength: 128, minLength: 1 }),
|
|
1289
|
-
});
|
|
1290
|
-
|
|
1291
|
-
const holdResponse = () =>
|
|
1292
|
-
apiObject({
|
|
1293
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1294
|
-
holdId: apiString({ maxLength: 64, minLength: 1 }),
|
|
1295
|
-
reviewAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1296
|
-
status: apiString({ enum: ['active', 'released'] as const }),
|
|
1297
|
-
});
|
|
1298
|
-
|
|
1299
|
-
export const ${identifierPrefix}Health = defineApiOperation({
|
|
1300
|
-
authentication: 'anonymous',
|
|
1301
|
-
authorizationActions: [],
|
|
1302
|
-
contractVersion: '1.0.0',
|
|
1303
|
-
feature: 'operations',
|
|
1304
|
-
lifecycle: { status: 'active' },
|
|
1305
|
-
method: 'GET',
|
|
1306
|
-
operationId: '${name}.health',
|
|
1307
|
-
path: '/health',
|
|
1308
|
-
problems: [],
|
|
1309
|
-
response: {
|
|
1310
|
-
body: apiObject({
|
|
1311
|
-
service: apiString({ enum: ['${name}'] as const }),
|
|
1312
|
-
sourceCommit: apiString({ maxLength: 64, minLength: 1 }),
|
|
1313
|
-
stage: apiString({ maxLength: 64, minLength: 1 }),
|
|
1314
|
-
status: apiString({ enum: ['ok'] as const }),
|
|
1315
|
-
}),
|
|
1316
|
-
status: 200,
|
|
1317
|
-
},
|
|
1318
|
-
responseProfile: 'ebk-app-v1',
|
|
1319
|
-
slice: '${name}',
|
|
1320
|
-
summary: 'Read ${pascalName} API health',
|
|
1321
|
-
});
|
|
1322
|
-
|
|
1323
|
-
export const ${identifierPrefix}MachineAuthorizationProof = defineApiOperation({
|
|
1324
|
-
authentication: 'customer',
|
|
1325
|
-
authorizationActions: ['${name}:machine-proof-read'],
|
|
1326
|
-
contractVersion: '1.0.0',
|
|
1327
|
-
feature: 'authorization',
|
|
1328
|
-
lifecycle: { status: 'active' },
|
|
1329
|
-
method: 'GET',
|
|
1330
|
-
operationId: '${name}.machine-authorization-proof',
|
|
1331
|
-
path: '/authorization/machine-proof',
|
|
1332
|
-
problems: authorizationProblems,
|
|
1333
|
-
response: {
|
|
1334
|
-
body: apiObject({
|
|
1335
|
-
message: apiString({
|
|
1336
|
-
enum: ['Machine authorization accepted.'] as const,
|
|
1337
|
-
}),
|
|
1338
|
-
}),
|
|
1339
|
-
status: 200,
|
|
1340
|
-
},
|
|
1341
|
-
responseProfile: 'ebk-app-v1',
|
|
1342
|
-
slice: '${name}',
|
|
1343
|
-
summary: 'Prove narrow ${pascalName} machine authorization',
|
|
1344
|
-
});
|
|
1345
|
-
|
|
1346
|
-
export const ${identifierPrefix}IssueRecordDelegation = defineApiOperation({
|
|
1347
|
-
authentication: 'customer',
|
|
1348
|
-
authorizationActions: ['${name}:record-delegation-issue'],
|
|
1349
|
-
contractVersion: '1.0.0',
|
|
1350
|
-
feature: 'authorization',
|
|
1351
|
-
lifecycle: { status: 'active' },
|
|
1352
|
-
method: 'POST',
|
|
1353
|
-
operationId: '${name}.issue-record-delegation',
|
|
1354
|
-
path: '/records/{recordId}/delegations',
|
|
1355
|
-
problems: authorizationProblems,
|
|
1356
|
-
request: {
|
|
1357
|
-
body: apiObject({
|
|
1358
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1359
|
-
purposeReference: apiString({ maxLength: 256, minLength: 1 }),
|
|
1360
|
-
}),
|
|
1361
|
-
maxBodyBytes: 512,
|
|
1362
|
-
path: recordPath(),
|
|
1363
|
-
},
|
|
1364
|
-
response: {
|
|
1365
|
-
body: apiObject({
|
|
1366
|
-
capability: apiString({ maxLength: 43, minLength: 43 }),
|
|
1367
|
-
delegationId: apiString({ format: 'uuid' }),
|
|
1368
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1369
|
-
status: apiString({ enum: ['active'] as const }),
|
|
1370
|
-
}),
|
|
1371
|
-
status: 201,
|
|
1372
|
-
},
|
|
1373
|
-
responseProfile: 'ebk-app-v1',
|
|
1374
|
-
slice: '${name}',
|
|
1375
|
-
summary: 'Issue one attended ${pascalName} record delegation',
|
|
1376
|
-
});
|
|
1377
|
-
|
|
1378
|
-
export const ${identifierPrefix}RevokeRecordDelegation = defineApiOperation({
|
|
1379
|
-
authentication: 'customer',
|
|
1380
|
-
authorizationActions: ['${name}:record-delegation-revoke'],
|
|
1381
|
-
contractVersion: '1.0.0',
|
|
1382
|
-
feature: 'authorization',
|
|
1383
|
-
lifecycle: { status: 'active' },
|
|
1384
|
-
method: 'DELETE',
|
|
1385
|
-
operationId: '${name}.revoke-record-delegation',
|
|
1386
|
-
path: '/records/{recordId}/delegations/{delegationId}',
|
|
1387
|
-
problems: authorizationProblems,
|
|
1388
|
-
request: { path: delegationPath() },
|
|
1389
|
-
response: {
|
|
1390
|
-
body: apiObject({
|
|
1391
|
-
delegationId: apiString({ format: 'uuid' }),
|
|
1392
|
-
status: apiString({ enum: ['revoked'] as const }),
|
|
1393
|
-
}),
|
|
1394
|
-
status: 200,
|
|
1395
|
-
},
|
|
1396
|
-
responseProfile: 'ebk-app-v1',
|
|
1397
|
-
slice: '${name}',
|
|
1398
|
-
summary: 'Revoke one attended ${pascalName} record delegation',
|
|
1399
|
-
});
|
|
1400
|
-
|
|
1401
|
-
export const ${identifierPrefix}UseRecordDelegation = defineApiOperation({
|
|
1402
|
-
authentication: 'customer',
|
|
1403
|
-
authorizationActions: ['${name}:record-delegation-use'],
|
|
1404
|
-
contractVersion: '1.0.0',
|
|
1405
|
-
feature: 'authorization',
|
|
1406
|
-
lifecycle: { status: 'active' },
|
|
1407
|
-
method: 'POST',
|
|
1408
|
-
operationId: '${name}.use-record-delegation',
|
|
1409
|
-
path: '/records/{recordId}/delegations/{delegationId}/use',
|
|
1410
|
-
problems: delegatedRecordProblems,
|
|
1411
|
-
request: {
|
|
1412
|
-
body: apiObject({
|
|
1413
|
-
capability: apiString({ maxLength: 43, minLength: 43 }),
|
|
1414
|
-
}),
|
|
1415
|
-
maxBodyBytes: 256,
|
|
1416
|
-
path: delegationPath(),
|
|
1417
|
-
},
|
|
1418
|
-
response: { body: recordResponse(), status: 200 },
|
|
1419
|
-
responseProfile: 'ebk-app-v1',
|
|
1420
|
-
slice: '${name}',
|
|
1421
|
-
summary: 'Use one attended ${pascalName} record delegation',
|
|
1422
|
-
});
|
|
1423
|
-
|
|
1424
|
-
export const ${identifierPrefix}RequestRecordExport = defineApiOperation({
|
|
1425
|
-
authentication: 'customer',
|
|
1426
|
-
authorizationActions: ['${name}:record-export'],
|
|
1427
|
-
contractVersion: '1.0.0',
|
|
1428
|
-
feature: 'data-lifecycle',
|
|
1429
|
-
lifecycle: { status: 'active' },
|
|
1430
|
-
method: 'POST',
|
|
1431
|
-
operationId: '${name}.request-record-export',
|
|
1432
|
-
path: '/records/{recordId}/exports',
|
|
1433
|
-
problems: dataRightsProblems,
|
|
1434
|
-
request: { path: recordPath() },
|
|
1435
|
-
response: {
|
|
1436
|
-
body: apiObject({
|
|
1437
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1438
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1439
|
-
requestDigest: apiString({ maxLength: 64, minLength: 64 }),
|
|
1440
|
-
status: apiString({ enum: ['pending'] as const }),
|
|
1441
|
-
}),
|
|
1442
|
-
status: 202,
|
|
1443
|
-
},
|
|
1444
|
-
responseProfile: 'ebk-app-v1',
|
|
1445
|
-
slice: '${name}',
|
|
1446
|
-
summary: 'Request one subject-bound ${pascalName} record export',
|
|
1447
|
-
});
|
|
1448
|
-
|
|
1449
|
-
export const ${identifierPrefix}DecideRecordExport = defineApiOperation({
|
|
1450
|
-
authentication: 'customer',
|
|
1451
|
-
authorizationActions: ['${name}:approval-review'],
|
|
1452
|
-
contractVersion: '1.0.0',
|
|
1453
|
-
feature: 'data-lifecycle',
|
|
1454
|
-
lifecycle: { status: 'active' },
|
|
1455
|
-
method: 'POST',
|
|
1456
|
-
operationId: '${name}.decide-record-export',
|
|
1457
|
-
path: '/records/{recordId}/exports/{approvalRequestId}/decision',
|
|
1458
|
-
problems: dataRightsProblems,
|
|
1459
|
-
request: {
|
|
1460
|
-
body: apiObject({
|
|
1461
|
-
expectedRequestDigest: apiString({ maxLength: 64, minLength: 64 }),
|
|
1462
|
-
outcome: apiString({ enum: ['approved', 'rejected'] as const }),
|
|
1463
|
-
reasonReference: apiString({ maxLength: 128, minLength: 1 }),
|
|
1464
|
-
}),
|
|
1465
|
-
maxBodyBytes: 512,
|
|
1466
|
-
path: exportPath(),
|
|
1467
|
-
},
|
|
1468
|
-
response: {
|
|
1469
|
-
body: apiObject({
|
|
1470
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1471
|
-
status: apiString({ enum: ['approved', 'rejected'] as const }),
|
|
1472
|
-
}),
|
|
1473
|
-
status: 200,
|
|
1474
|
-
},
|
|
1475
|
-
responseProfile: 'ebk-app-v1',
|
|
1476
|
-
slice: '${name}',
|
|
1477
|
-
summary: 'Decide one ${pascalName} record export',
|
|
1478
|
-
});
|
|
1479
|
-
|
|
1480
|
-
export const ${identifierPrefix}ExecuteRecordExport = defineApiOperation({
|
|
1481
|
-
authentication: 'customer',
|
|
1482
|
-
authorizationActions: ['${name}:record-export'],
|
|
1483
|
-
contractVersion: '1.0.0',
|
|
1484
|
-
feature: 'data-lifecycle',
|
|
1485
|
-
lifecycle: { status: 'active' },
|
|
1486
|
-
method: 'POST',
|
|
1487
|
-
operationId: '${name}.execute-record-export',
|
|
1488
|
-
path: '/records/{recordId}/exports/{approvalRequestId}/execute',
|
|
1489
|
-
problems: dataRightsProblems,
|
|
1490
|
-
request: { path: exportPath() },
|
|
1491
|
-
response: {
|
|
1492
|
-
body: apiObject({
|
|
1493
|
-
artifactRef: apiOptional(
|
|
1494
|
-
apiString({ maxLength: 128, minLength: 1 }),
|
|
1495
|
-
),
|
|
1496
|
-
expiresAt: apiOptional(
|
|
1497
|
-
apiString({ maxLength: 40, minLength: 20 }),
|
|
1498
|
-
),
|
|
1499
|
-
status: apiString({ enum: ['held', 'ready'] as const }),
|
|
1500
|
-
}),
|
|
1501
|
-
status: 200,
|
|
1502
|
-
},
|
|
1503
|
-
responseProfile: 'ebk-app-v1',
|
|
1504
|
-
slice: '${name}',
|
|
1505
|
-
summary: 'Execute one approved ${pascalName} record export',
|
|
1506
|
-
});
|
|
1507
|
-
|
|
1508
|
-
export const ${identifierPrefix}DeliverRecordExport = defineApiOperation({
|
|
1509
|
-
authentication: 'customer',
|
|
1510
|
-
authorizationActions: ['${name}:record-export'],
|
|
1511
|
-
contractVersion: '1.0.0',
|
|
1512
|
-
feature: 'data-lifecycle',
|
|
1513
|
-
lifecycle: { status: 'active' },
|
|
1514
|
-
method: 'GET',
|
|
1515
|
-
operationId: '${name}.deliver-record-export',
|
|
1516
|
-
path: '/records/{recordId}/exports/{approvalRequestId}/delivery',
|
|
1517
|
-
problems: dataRightsProblems,
|
|
1518
|
-
request: { path: exportPath() },
|
|
1519
|
-
response: {
|
|
1520
|
-
body: apiObject({
|
|
1521
|
-
artifactRef: apiString({ maxLength: 128, minLength: 1 }),
|
|
1522
|
-
deliveredAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1523
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1524
|
-
record: recordResponse(),
|
|
1525
|
-
}),
|
|
1526
|
-
status: 200,
|
|
1527
|
-
},
|
|
1528
|
-
responseProfile: 'ebk-app-v1',
|
|
1529
|
-
slice: '${name}',
|
|
1530
|
-
summary: 'Deliver one unexpired ${pascalName} record export',
|
|
1531
|
-
});
|
|
1532
|
-
|
|
1533
|
-
export const ${identifierPrefix}CleanupRecordExport = defineApiOperation({
|
|
1534
|
-
authentication: 'customer',
|
|
1535
|
-
authorizationActions: ['${name}:record-export-cleanup'],
|
|
1536
|
-
contractVersion: '1.0.0',
|
|
1537
|
-
feature: 'data-lifecycle',
|
|
1538
|
-
lifecycle: { status: 'active' },
|
|
1539
|
-
method: 'DELETE',
|
|
1540
|
-
operationId: '${name}.cleanup-record-export',
|
|
1541
|
-
path: '/records/{recordId}/exports/{approvalRequestId}',
|
|
1542
|
-
problems: dataRightsProblems,
|
|
1543
|
-
request: { path: exportPath() },
|
|
1544
|
-
response: {
|
|
1545
|
-
body: apiObject({
|
|
1546
|
-
deletedVersions: apiNumber({ integer: true, minimum: 0 }),
|
|
1547
|
-
status: apiString({
|
|
1548
|
-
enum: ['completed', 'retry-required'] as const,
|
|
1549
|
-
}),
|
|
1550
|
-
}),
|
|
1551
|
-
status: 200,
|
|
1552
|
-
},
|
|
1553
|
-
responseProfile: 'ebk-app-v1',
|
|
1554
|
-
slice: '${name}',
|
|
1555
|
-
summary: 'Clean up one expired ${pascalName} record export',
|
|
1556
|
-
});
|
|
1557
|
-
|
|
1558
|
-
export const ${identifierPrefix}RequestRetentionApproval =
|
|
1559
|
-
defineApiOperation({
|
|
1560
|
-
authentication: 'customer',
|
|
1561
|
-
authorizationActions: ['${name}:retention-review'],
|
|
1562
|
-
contractVersion: '1.0.0',
|
|
1563
|
-
feature: 'data-lifecycle',
|
|
1564
|
-
lifecycle: { status: 'active' },
|
|
1565
|
-
method: 'POST',
|
|
1566
|
-
operationId: '${name}.request-retention-approval',
|
|
1567
|
-
path: '/data-retention/runs/{runId}/approval-requests',
|
|
1568
|
-
problems: retentionProblems,
|
|
1569
|
-
request: { path: retentionRunPath() },
|
|
1570
|
-
response: {
|
|
1571
|
-
body: apiObject({
|
|
1572
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1573
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1574
|
-
requestDigest: apiString({ maxLength: 64, minLength: 64 }),
|
|
1575
|
-
status: apiString({ enum: ['pending'] as const }),
|
|
1576
|
-
}),
|
|
1577
|
-
status: 202,
|
|
1578
|
-
},
|
|
1579
|
-
responseProfile: 'ebk-app-v1',
|
|
1580
|
-
slice: '${name}',
|
|
1581
|
-
summary:
|
|
1582
|
-
'Request direct-admin review of one ${pascalName} retention report',
|
|
1583
|
-
});
|
|
1584
|
-
|
|
1585
|
-
export const ${identifierPrefix}DecideRetentionApproval =
|
|
1586
|
-
defineApiOperation({
|
|
1587
|
-
authentication: 'customer',
|
|
1588
|
-
authorizationActions: ['${name}:retention-review'],
|
|
1589
|
-
contractVersion: '1.0.0',
|
|
1590
|
-
feature: 'data-lifecycle',
|
|
1591
|
-
lifecycle: { status: 'active' },
|
|
1592
|
-
method: 'POST',
|
|
1593
|
-
operationId: '${name}.decide-retention-approval',
|
|
1594
|
-
path:
|
|
1595
|
-
'/data-retention/runs/{runId}/approval-requests/{approvalRequestId}/decision',
|
|
1596
|
-
problems: retentionProblems,
|
|
1597
|
-
request: {
|
|
1598
|
-
body: apiObject({
|
|
1599
|
-
expectedRequestDigest: apiString({ maxLength: 64, minLength: 64 }),
|
|
1600
|
-
outcome: apiString({ enum: ['approved', 'rejected'] as const }),
|
|
1601
|
-
reasonReference: apiString({ maxLength: 128, minLength: 1 }),
|
|
1602
|
-
}),
|
|
1603
|
-
maxBodyBytes: 512,
|
|
1604
|
-
path: retentionApprovalPath(),
|
|
1605
|
-
},
|
|
1606
|
-
response: {
|
|
1607
|
-
body: apiObject({
|
|
1608
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1609
|
-
status: apiString({ enum: ['approved', 'rejected'] as const }),
|
|
1610
|
-
}),
|
|
1611
|
-
status: 200,
|
|
1612
|
-
},
|
|
1613
|
-
responseProfile: 'ebk-app-v1',
|
|
1614
|
-
slice: '${name}',
|
|
1615
|
-
summary:
|
|
1616
|
-
'Decide one ${pascalName} retention approval as a non-author admin',
|
|
1617
|
-
});
|
|
1618
|
-
|
|
1619
|
-
export const ${identifierPrefix}IssueRecordHold = defineApiOperation({
|
|
1620
|
-
authentication: 'customer',
|
|
1621
|
-
authorizationActions: ['${name}:record-hold-manage'],
|
|
1622
|
-
contractVersion: '1.0.0',
|
|
1623
|
-
feature: 'data-lifecycle',
|
|
1624
|
-
lifecycle: { status: 'active' },
|
|
1625
|
-
method: 'POST',
|
|
1626
|
-
operationId: '${name}.issue-record-hold',
|
|
1627
|
-
path: '/records/{recordId}/holds',
|
|
1628
|
-
problems: dataRightsProblems,
|
|
1629
|
-
request: {
|
|
1630
|
-
body: apiObject({
|
|
1631
|
-
effects: apiArray(
|
|
1632
|
-
apiString({
|
|
1633
|
-
enum: ['block-deletion', 'block-export'] as const,
|
|
1634
|
-
}),
|
|
1635
|
-
{ maxItems: 2, minItems: 1 },
|
|
1636
|
-
),
|
|
1637
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1638
|
-
purpose: apiString({
|
|
1639
|
-
enum: ['fraud', 'incident', 'legal', 'security', 'support'] as const,
|
|
1640
|
-
}),
|
|
1641
|
-
reviewAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1642
|
-
}),
|
|
1643
|
-
maxBodyBytes: 512,
|
|
1644
|
-
path: recordPath(),
|
|
1645
|
-
},
|
|
1646
|
-
response: { body: holdResponse(), status: 201 },
|
|
1647
|
-
responseProfile: 'ebk-app-v1',
|
|
1648
|
-
slice: '${name}',
|
|
1649
|
-
summary: 'Issue one bounded ${pascalName} record hold',
|
|
1650
|
-
});
|
|
1651
|
-
|
|
1652
|
-
export const ${identifierPrefix}ReviewRecordHold = defineApiOperation({
|
|
1653
|
-
authentication: 'customer',
|
|
1654
|
-
authorizationActions: ['${name}:record-hold-manage'],
|
|
1655
|
-
contractVersion: '1.0.0',
|
|
1656
|
-
feature: 'data-lifecycle',
|
|
1657
|
-
lifecycle: { status: 'active' },
|
|
1658
|
-
method: 'POST',
|
|
1659
|
-
operationId: '${name}.review-record-hold',
|
|
1660
|
-
path: '/records/{recordId}/holds/{holdId}/review',
|
|
1661
|
-
problems: dataRightsProblems,
|
|
1662
|
-
request: {
|
|
1663
|
-
body: apiObject({
|
|
1664
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1665
|
-
reviewAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1666
|
-
}),
|
|
1667
|
-
maxBodyBytes: 256,
|
|
1668
|
-
path: holdPath(),
|
|
1669
|
-
},
|
|
1670
|
-
response: { body: holdResponse(), status: 200 },
|
|
1671
|
-
responseProfile: 'ebk-app-v1',
|
|
1672
|
-
slice: '${name}',
|
|
1673
|
-
summary: 'Review one bounded ${pascalName} record hold',
|
|
1674
|
-
});
|
|
1675
|
-
|
|
1676
|
-
export const ${identifierPrefix}ReleaseRecordHold = defineApiOperation({
|
|
1677
|
-
authentication: 'customer',
|
|
1678
|
-
authorizationActions: ['${name}:record-hold-manage'],
|
|
1679
|
-
contractVersion: '1.0.0',
|
|
1680
|
-
feature: 'data-lifecycle',
|
|
1681
|
-
lifecycle: { status: 'active' },
|
|
1682
|
-
method: 'DELETE',
|
|
1683
|
-
operationId: '${name}.release-record-hold',
|
|
1684
|
-
path: '/records/{recordId}/holds/{holdId}',
|
|
1685
|
-
problems: dataRightsProblems,
|
|
1686
|
-
request: { path: holdPath() },
|
|
1687
|
-
response: { body: holdResponse(), status: 200 },
|
|
1688
|
-
responseProfile: 'ebk-app-v1',
|
|
1689
|
-
slice: '${name}',
|
|
1690
|
-
summary: 'Release one bounded ${pascalName} record hold',
|
|
1691
|
-
});
|
|
1692
|
-
|
|
1693
|
-
export const ${identifierPrefix}ExpireRecordHold = defineApiOperation({
|
|
1694
|
-
authentication: 'customer',
|
|
1695
|
-
authorizationActions: ['${name}:record-hold-manage'],
|
|
1696
|
-
contractVersion: '1.0.0',
|
|
1697
|
-
feature: 'data-lifecycle',
|
|
1698
|
-
lifecycle: { status: 'active' },
|
|
1699
|
-
method: 'POST',
|
|
1700
|
-
operationId: '${name}.expire-record-hold',
|
|
1701
|
-
path: '/records/{recordId}/holds/{holdId}/expire',
|
|
1702
|
-
problems: dataRightsProblems,
|
|
1703
|
-
request: { path: holdPath() },
|
|
1704
|
-
response: { body: holdResponse(), status: 200 },
|
|
1705
|
-
responseProfile: 'ebk-app-v1',
|
|
1706
|
-
slice: '${name}',
|
|
1707
|
-
summary: 'Expire one due ${pascalName} record hold',
|
|
1708
|
-
});
|
|
1709
|
-
|
|
1710
|
-
export const ${identifierPrefix}ProtectedExample = defineApiOperation({
|
|
1711
|
-
authentication: 'customer',
|
|
1712
|
-
authorizationActions: ['${name}:protected-read'],
|
|
1713
|
-
contractVersion: '1.0.0',
|
|
1714
|
-
feature: 'authorization',
|
|
1715
|
-
lifecycle: { status: 'active' },
|
|
1716
|
-
method: 'GET',
|
|
1717
|
-
operationId: '${name}.protected-example',
|
|
1718
|
-
path: '/protected',
|
|
1719
|
-
problems: authorizationProblems,
|
|
1720
|
-
response: {
|
|
1721
|
-
body: apiObject({
|
|
1722
|
-
message: apiString({
|
|
1723
|
-
enum: ['Authenticated request accepted.'] as const,
|
|
1724
|
-
}),
|
|
1725
|
-
}),
|
|
1726
|
-
status: 200,
|
|
1727
|
-
},
|
|
1728
|
-
responseProfile: 'ebk-app-v1',
|
|
1729
|
-
slice: '${name}',
|
|
1730
|
-
summary: 'Read the authenticated ${pascalName} example',
|
|
1731
|
-
});
|
|
1732
|
-
|
|
1733
|
-
export const ${identifierPrefix}DatabaseHealth = defineApiOperation({
|
|
1734
|
-
authentication: 'customer',
|
|
1735
|
-
authorizationActions: ['${name}:database-read'],
|
|
1736
|
-
contractVersion: '1.0.0',
|
|
1737
|
-
feature: 'database',
|
|
1738
|
-
lifecycle: { status: 'active' },
|
|
1739
|
-
method: 'GET',
|
|
1740
|
-
operationId: '${name}.database-health',
|
|
1741
|
-
path: '/database-health',
|
|
1742
|
-
problems: authorizationProblems,
|
|
1743
|
-
response: {
|
|
1744
|
-
body: apiObject({
|
|
1745
|
-
service: apiString({ enum: ['${name}'] as const }),
|
|
1746
|
-
status: apiString({ enum: ['ok'] as const }),
|
|
1747
|
-
}),
|
|
1748
|
-
status: 200,
|
|
1749
|
-
},
|
|
1750
|
-
responseProfile: 'ebk-app-v1',
|
|
1751
|
-
slice: '${name}',
|
|
1752
|
-
summary: 'Read ${pascalName} database health',
|
|
1753
|
-
});
|
|
1754
|
-
|
|
1755
|
-
export const ${identifierPrefix}DecideRecordDeletion = defineApiOperation({
|
|
1756
|
-
authentication: 'customer',
|
|
1757
|
-
authorizationActions: ['${name}:approval-review'],
|
|
1758
|
-
contractVersion: '1.0.0',
|
|
1759
|
-
feature: 'data-lifecycle',
|
|
1760
|
-
lifecycle: { status: 'active' },
|
|
1761
|
-
method: 'POST',
|
|
1762
|
-
operationId: '${name}.decide-record-deletion',
|
|
1763
|
-
path: '/records/{recordId}/deletion-requests/{approvalRequestId}/decision',
|
|
1764
|
-
problems: deletionProblems,
|
|
1765
|
-
request: {
|
|
1766
|
-
body: apiObject({
|
|
1767
|
-
expectedRequestDigest: apiString({ maxLength: 64, minLength: 64 }),
|
|
1768
|
-
outcome: apiString({ enum: ['approved', 'rejected'] as const }),
|
|
1769
|
-
reasonReference: apiString({ maxLength: 128, minLength: 1 }),
|
|
1770
|
-
}),
|
|
1771
|
-
maxBodyBytes: 512,
|
|
1772
|
-
path: deletionRequestPath(),
|
|
1773
|
-
},
|
|
1774
|
-
response: {
|
|
1775
|
-
body: apiObject({
|
|
1776
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1777
|
-
status: apiString({ enum: ['approved', 'rejected'] as const }),
|
|
1778
|
-
}),
|
|
1779
|
-
status: 200,
|
|
1780
|
-
},
|
|
1781
|
-
responseProfile: 'ebk-app-v1',
|
|
1782
|
-
slice: '${name}',
|
|
1783
|
-
summary: 'Decide one pending ${pascalName} record deletion',
|
|
1784
|
-
});
|
|
1785
|
-
|
|
1786
|
-
export const ${identifierPrefix}DeleteRecord = defineApiOperation({
|
|
1787
|
-
authentication: 'customer',
|
|
1788
|
-
authorizationActions: ['${name}:record-delete'],
|
|
1789
|
-
contractVersion: '1.0.0',
|
|
1790
|
-
feature: 'database',
|
|
1791
|
-
lifecycle: { status: 'active' },
|
|
1792
|
-
method: 'DELETE',
|
|
1793
|
-
operationId: '${name}.delete-record',
|
|
1794
|
-
path: '/records/{recordId}',
|
|
1795
|
-
problems: deletionProblems,
|
|
1796
|
-
request: {
|
|
1797
|
-
path: recordPath(),
|
|
1798
|
-
query: apiObject({
|
|
1799
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1800
|
-
reasonCode: apiString({ maxLength: 64, minLength: 1 }),
|
|
1801
|
-
}),
|
|
1802
|
-
},
|
|
1803
|
-
response: {
|
|
1804
|
-
body: apiObject({
|
|
1805
|
-
deleted: apiBoolean(),
|
|
1806
|
-
id: apiString({ format: 'uuid' }),
|
|
1807
|
-
deliveryPending: apiOptional(apiBoolean()),
|
|
1808
|
-
}),
|
|
1809
|
-
status: 200,
|
|
1810
|
-
},
|
|
1811
|
-
responseProfile: 'ebk-app-v1',
|
|
1812
|
-
slice: '${name}',
|
|
1813
|
-
summary: 'Delete one owned ${pascalName} record',
|
|
1814
|
-
});
|
|
1815
|
-
|
|
1816
|
-
export const ${identifierPrefix}GetRecord = defineApiOperation({
|
|
1817
|
-
authentication: 'customer',
|
|
1818
|
-
authorizationActions: ['${name}:record-read'],
|
|
1819
|
-
contractVersion: '1.0.0',
|
|
1820
|
-
feature: 'database',
|
|
1821
|
-
lifecycle: { status: 'active' },
|
|
1822
|
-
method: 'GET',
|
|
1823
|
-
operationId: '${name}.get-record',
|
|
1824
|
-
path: '/records/{recordId}',
|
|
1825
|
-
problems: recordNotFoundProblems,
|
|
1826
|
-
request: { path: recordPath() },
|
|
1827
|
-
response: { body: recordResponse(), status: 200 },
|
|
1828
|
-
responseProfile: 'ebk-app-v1',
|
|
1829
|
-
slice: '${name}',
|
|
1830
|
-
summary: 'Read one owned ${pascalName} record',
|
|
1831
|
-
});
|
|
1832
|
-
|
|
1833
|
-
export const ${identifierPrefix}PublishCreated = defineApiOperation({
|
|
1834
|
-
authentication: 'customer',
|
|
1835
|
-
authorizationActions: ['${name}:event-publish'],
|
|
1836
|
-
contractVersion: '1.0.0',
|
|
1837
|
-
feature: 'events',
|
|
1838
|
-
lifecycle: { status: 'active' },
|
|
1839
|
-
method: 'POST',
|
|
1840
|
-
operationId: '${name}.publish-created',
|
|
1841
|
-
path: '/events/example',
|
|
1842
|
-
problems: authorizationProblems,
|
|
1843
|
-
response: {
|
|
1844
|
-
body: apiObject({
|
|
1845
|
-
eventId: apiString({ format: 'uuid' }),
|
|
1846
|
-
}),
|
|
1847
|
-
status: 200,
|
|
1848
|
-
},
|
|
1849
|
-
responseProfile: 'ebk-app-v1',
|
|
1850
|
-
slice: '${name}',
|
|
1851
|
-
summary: 'Publish a ${pascalName} example event',
|
|
1852
|
-
});
|
|
1853
|
-
|
|
1854
|
-
export const ${identifierPrefix}PutRecord = defineApiOperation({
|
|
1855
|
-
authentication: 'customer',
|
|
1856
|
-
authorizationActions: ['${name}:record-write'],
|
|
1857
|
-
contractVersion: '1.0.0',
|
|
1858
|
-
feature: 'database',
|
|
1859
|
-
lifecycle: { status: 'active' },
|
|
1860
|
-
method: 'PUT',
|
|
1861
|
-
operationId: '${name}.put-record',
|
|
1862
|
-
path: '/records/{recordId}',
|
|
1863
|
-
problems: recordConflictProblems,
|
|
1864
|
-
request: {
|
|
1865
|
-
body: apiObject({
|
|
1866
|
-
name: apiString({ maxLength: 128, minLength: 1 }),
|
|
1867
|
-
runScope: apiString({ maxLength: 128, minLength: 1 }),
|
|
1868
|
-
testExpiresAt: apiOptional(
|
|
1869
|
-
apiString({ maxLength: 40, minLength: 20 }),
|
|
1870
|
-
),
|
|
1871
|
-
}),
|
|
1872
|
-
maxBodyBytes: 512,
|
|
1873
|
-
path: recordPath(),
|
|
1874
|
-
},
|
|
1875
|
-
response: { body: recordResponse(), status: 200 },
|
|
1876
|
-
responseProfile: 'ebk-app-v1',
|
|
1877
|
-
slice: '${name}',
|
|
1878
|
-
summary: 'Create or replace one owned ${pascalName} record',
|
|
1879
|
-
});
|
|
1880
|
-
|
|
1881
|
-
export const ${identifierPrefix}RequestRecordDeletion = defineApiOperation({
|
|
1882
|
-
authentication: 'customer',
|
|
1883
|
-
authorizationActions: ['${name}:record-delete'],
|
|
1884
|
-
contractVersion: '1.0.0',
|
|
1885
|
-
feature: 'data-lifecycle',
|
|
1886
|
-
lifecycle: { status: 'active' },
|
|
1887
|
-
method: 'POST',
|
|
1888
|
-
operationId: '${name}.request-record-deletion',
|
|
1889
|
-
path: '/records/{recordId}/deletion-requests',
|
|
1890
|
-
problems: recordNotFoundProblems,
|
|
1891
|
-
request: {
|
|
1892
|
-
body: apiObject({
|
|
1893
|
-
reasonCode: apiString({ maxLength: 64, minLength: 1 }),
|
|
1894
|
-
}),
|
|
1895
|
-
maxBodyBytes: 256,
|
|
1896
|
-
path: recordPath(),
|
|
1897
|
-
},
|
|
1898
|
-
response: {
|
|
1899
|
-
body: apiObject({
|
|
1900
|
-
approvalRequestId: apiString({ format: 'uuid' }),
|
|
1901
|
-
expiresAt: apiString({ maxLength: 40, minLength: 20 }),
|
|
1902
|
-
requestDigest: apiString({ maxLength: 64, minLength: 64 }),
|
|
1903
|
-
status: apiString({ enum: ['pending'] as const }),
|
|
1904
|
-
}),
|
|
1905
|
-
status: 202,
|
|
1906
|
-
},
|
|
1907
|
-
responseProfile: 'ebk-app-v1',
|
|
1908
|
-
slice: '${name}',
|
|
1909
|
-
summary: 'Request approval for one ${pascalName} record deletion',
|
|
1910
|
-
});
|
|
1911
|
-
|
|
1912
|
-
export const ${contractIdentifier} = defineApiContract({
|
|
1913
|
-
operations: [
|
|
1914
|
-
${identifierPrefix}CleanupRecordExport,
|
|
1915
|
-
${identifierPrefix}DatabaseHealth,
|
|
1916
|
-
${identifierPrefix}DecideRecordExport,
|
|
1917
|
-
${identifierPrefix}DecideRecordDeletion,
|
|
1918
|
-
${identifierPrefix}DecideRetentionApproval,
|
|
1919
|
-
${identifierPrefix}DeliverRecordExport,
|
|
1920
|
-
${identifierPrefix}DeleteRecord,
|
|
1921
|
-
${identifierPrefix}ExecuteRecordExport,
|
|
1922
|
-
${identifierPrefix}ExpireRecordHold,
|
|
1923
|
-
${identifierPrefix}GetRecord,
|
|
1924
|
-
${identifierPrefix}Health,
|
|
1925
|
-
${identifierPrefix}IssueRecordDelegation,
|
|
1926
|
-
${identifierPrefix}IssueRecordHold,
|
|
1927
|
-
${identifierPrefix}MachineAuthorizationProof,
|
|
1928
|
-
${identifierPrefix}ProtectedExample,
|
|
1929
|
-
${identifierPrefix}PublishCreated,
|
|
1930
|
-
${identifierPrefix}PutRecord,
|
|
1931
|
-
${identifierPrefix}RequestRecordDeletion,
|
|
1932
|
-
${identifierPrefix}RequestRecordExport,
|
|
1933
|
-
${identifierPrefix}RequestRetentionApproval,
|
|
1934
|
-
${identifierPrefix}ReleaseRecordHold,
|
|
1935
|
-
${identifierPrefix}ReviewRecordHold,
|
|
1936
|
-
${identifierPrefix}RevokeRecordDelegation,
|
|
1937
|
-
${identifierPrefix}UseRecordDelegation,
|
|
1938
|
-
] as const,
|
|
1939
|
-
slice: '${name}',
|
|
1940
|
-
title: '${pascalName} API',
|
|
1941
|
-
version: '1.0.0',
|
|
1942
|
-
});
|
|
1943
|
-
`,
|
|
1944
|
-
'api/contracts/index.ts': `export {
|
|
1945
|
-
${contractIdentifier},
|
|
1946
|
-
${identifierPrefix}CleanupRecordExport,
|
|
1947
|
-
${identifierPrefix}DatabaseHealth,
|
|
1948
|
-
${identifierPrefix}DecideRecordExport,
|
|
1949
|
-
${identifierPrefix}DecideRecordDeletion,
|
|
1950
|
-
${identifierPrefix}DecideRetentionApproval,
|
|
1951
|
-
${identifierPrefix}DeliverRecordExport,
|
|
1952
|
-
${identifierPrefix}DeleteRecord,
|
|
1953
|
-
${identifierPrefix}ExecuteRecordExport,
|
|
1954
|
-
${identifierPrefix}ExpireRecordHold,
|
|
1955
|
-
${identifierPrefix}GetRecord,
|
|
1956
|
-
${identifierPrefix}Health,
|
|
1957
|
-
${identifierPrefix}IssueRecordDelegation,
|
|
1958
|
-
${identifierPrefix}IssueRecordHold,
|
|
1959
|
-
${identifierPrefix}MachineAuthorizationProof,
|
|
1960
|
-
${identifierPrefix}ProtectedExample,
|
|
1961
|
-
${identifierPrefix}PublishCreated,
|
|
1962
|
-
${identifierPrefix}PutRecord,
|
|
1963
|
-
${identifierPrefix}RequestRecordDeletion,
|
|
1964
|
-
${identifierPrefix}RequestRecordExport,
|
|
1965
|
-
${identifierPrefix}RequestRetentionApproval,
|
|
1966
|
-
${identifierPrefix}ReleaseRecordHold,
|
|
1967
|
-
${identifierPrefix}ReviewRecordHold,
|
|
1968
|
-
${identifierPrefix}RevokeRecordDelegation,
|
|
1969
|
-
${identifierPrefix}UseRecordDelegation,
|
|
1970
|
-
} from './protected.js';
|
|
1971
|
-
`,
|
|
1972
|
-
'api/generated/client.ts': `import {
|
|
1973
|
-
createApiContractClient,
|
|
1974
|
-
type ApiContractClient,
|
|
1975
|
-
type CreateApiClientOptions,
|
|
1976
|
-
} from '@empire-builder-kit/runtime/api-client';
|
|
1977
|
-
import { ${contractIdentifier} } from '../contracts/index.js';
|
|
1978
|
-
|
|
1979
|
-
export type ${pascalName}ApiClient = ApiContractClient<
|
|
1980
|
-
typeof ${contractIdentifier}
|
|
1981
|
-
>;
|
|
1982
|
-
|
|
1983
|
-
export function create${pascalName}ApiClient(
|
|
1984
|
-
options: CreateApiClientOptions,
|
|
1985
|
-
): ${pascalName}ApiClient {
|
|
1986
|
-
return createApiContractClient(${contractIdentifier}, options);
|
|
1987
|
-
}
|
|
1988
|
-
`,
|
|
1989
|
-
'api/generated/contract.json': artifacts.normalizedJson,
|
|
1990
|
-
'api/generated/openapi.json': artifacts.openApiJson,
|
|
1991
|
-
'api/generated/baseline.json': baseline,
|
|
1992
|
-
'docs/api-contracts.md': `# ${name} synchronous API
|
|
1993
|
-
|
|
1994
|
-
Author operation behavior in \`api/contracts/\`. The TypeScript contract is the
|
|
1995
|
-
source of truth. The normalized contract, OpenAPI document, and browser-safe
|
|
1996
|
-
client under \`api/generated/\` are managed output. The seeded compatibility
|
|
1997
|
-
baseline is reviewed product state and is never restamped by regeneration.
|
|
1998
|
-
|
|
1999
|
-
Transport declarations must be lossless on the wire. String request headers
|
|
2000
|
-
use \`apiString({ format: 'ebk-http-header-value' })\`: visible ASCII only,
|
|
2001
|
-
at most 8 KiB, with no empty value, leading or trailing whitespace, controls,
|
|
2002
|
-
DEL, or non-ASCII. Path strings must exclude the empty value, and repeated
|
|
2003
|
-
query arrays must require at least one item.
|
|
2004
|
-
|
|
2005
|
-
Every actionable authentication or authorization failure must be declared by
|
|
2006
|
-
the operation contract. An undeclared or inconsistent failure is treated as a
|
|
2007
|
-
contract defect and returned as a sanitized 500 response, never improvised as
|
|
2008
|
-
a new wire-visible 401 or 403 response.
|
|
2009
|
-
|
|
2010
|
-
Run \`pnpm nx run ${name}:api-contract-generate\` after changing an operation,
|
|
2011
|
-
then inspect the generated diff and run
|
|
2012
|
-
\`pnpm nx run ${name}:api-contract-check\`. The check is report-first and never
|
|
2013
|
-
updates the accepted baseline.
|
|
2014
|
-
|
|
2015
|
-
An intentional baseline update requires a reviewed JSON approval:
|
|
2016
|
-
|
|
2017
|
-
\`\`\`sh
|
|
2018
|
-
pnpm nx run ${name}:api-contract-baseline -- --approval=path/to/approval.json
|
|
2019
|
-
\`\`\`
|
|
2020
|
-
|
|
2021
|
-
An agent may author the approval file. Compatible approvals pin the exact
|
|
2022
|
-
candidate digest and reason, and the agent may apply them directly during
|
|
2023
|
-
development. Conditional approvals also require semantic-review evidence, and
|
|
2024
|
-
breaking approvals require consumer evidence, rollout evidence, and an exact
|
|
2025
|
-
rollout-plan identity and digest; a human reviews those two classes before the
|
|
2026
|
-
baseline command runs. Baseline updates never occur during generation or
|
|
2027
|
-
verification.
|
|
2028
|
-
|
|
2029
|
-
Other Slices may import only \`@<workspace>/${name}/api-contract\`,
|
|
2030
|
-
\`@<workspace>/${name}/api-client\`, or the transport-neutral
|
|
2031
|
-
\`@<workspace>/${name}/contracts\` surface. They may not import handlers,
|
|
2032
|
-
database code, or other implementation paths.
|
|
2033
|
-
`,
|
|
2034
|
-
'scripts/contract-dependencies.mjs': `import {
|
|
2035
|
-
existsSync,
|
|
2036
|
-
readFileSync,
|
|
2037
|
-
realpathSync,
|
|
2038
|
-
readdirSync,
|
|
2039
|
-
statSync,
|
|
2040
|
-
writeFileSync,
|
|
2041
|
-
} from 'node:fs';
|
|
2042
|
-
import { createRequire } from 'node:module';
|
|
2043
|
-
import { isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
2044
|
-
import ts from 'typescript';
|
|
2045
|
-
|
|
2046
|
-
const require = createRequire(import.meta.url);
|
|
2047
|
-
const {
|
|
2048
|
-
normalizeApiContractProjectDeclarations,
|
|
2049
|
-
resolveApiContractDependencies,
|
|
2050
|
-
} = require('@empire-builder-kit/nx/api-contract');
|
|
2051
|
-
const {
|
|
2052
|
-
validateGeneratedOwnershipRecord,
|
|
2053
|
-
validateSiteOwnershipRecord,
|
|
2054
|
-
} = require('@empire-builder-kit/nx/ownership');
|
|
2055
|
-
|
|
2056
|
-
const projectRoot = process.cwd();
|
|
2057
|
-
const workspaceRoot = resolve(projectRoot, '../..');
|
|
2058
|
-
const action = process.argv[2] ?? 'check';
|
|
2059
|
-
if (action !== 'check' && action !== 'sync') {
|
|
2060
|
-
throw new Error(
|
|
2061
|
-
'Usage: node scripts/contract-dependencies.mjs <check|sync>',
|
|
2062
|
-
);
|
|
2063
|
-
}
|
|
2064
|
-
const readJson = (path) => {
|
|
2065
|
-
const contents = readFileSync(path, 'utf8');
|
|
2066
|
-
try {
|
|
2067
|
-
return JSON.parse(contents);
|
|
2068
|
-
} catch (error) {
|
|
2069
|
-
const qualifiedPath = relative(workspaceRoot, path)
|
|
2070
|
-
.split(sep)
|
|
2071
|
-
.join('/');
|
|
2072
|
-
throw new Error(
|
|
2073
|
-
qualifiedPath +
|
|
2074
|
-
' contains malformed JSON: ' +
|
|
2075
|
-
(error instanceof Error ? error.message : String(error)),
|
|
2076
|
-
);
|
|
2077
|
-
}
|
|
2078
|
-
};
|
|
2079
|
-
const declarationPath = join(
|
|
2080
|
-
projectRoot,
|
|
2081
|
-
'contracts',
|
|
2082
|
-
'dependencies.json',
|
|
2083
|
-
);
|
|
2084
|
-
const ownershipPath = join(projectRoot, '.ebk', 'ownership.json');
|
|
2085
|
-
const allowedContractExports = new Map([
|
|
2086
|
-
['./api-client', { exact: 'api/generated/client.ts' }],
|
|
2087
|
-
['./api-contract', { surface: 'api/contracts' }],
|
|
2088
|
-
['./contracts', { exact: 'contracts/index.ts' }],
|
|
2089
|
-
]);
|
|
2090
|
-
|
|
2091
|
-
function isContained(root, candidate) {
|
|
2092
|
-
const pathFromRoot = relative(root, candidate);
|
|
2093
|
-
return (
|
|
2094
|
-
pathFromRoot !== '..' &&
|
|
2095
|
-
!pathFromRoot.startsWith('..' + sep) &&
|
|
2096
|
-
!isAbsolute(pathFromRoot)
|
|
2097
|
-
);
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
function declaredExportTargets(declaration, packageName, exportName) {
|
|
2101
|
-
if (typeof declaration === 'string') return [declaration];
|
|
2102
|
-
if (
|
|
2103
|
-
!declaration ||
|
|
2104
|
-
typeof declaration !== 'object' ||
|
|
2105
|
-
Array.isArray(declaration) ||
|
|
2106
|
-
Object.keys(declaration).length === 0 ||
|
|
2107
|
-
Object.values(declaration).some((target) => typeof target !== 'string')
|
|
2108
|
-
) {
|
|
2109
|
-
throw new Error(
|
|
2110
|
-
'Package ' +
|
|
2111
|
-
packageName +
|
|
2112
|
-
' has an invalid conditional export for ' +
|
|
2113
|
-
exportName +
|
|
2114
|
-
'.',
|
|
2115
|
-
);
|
|
2116
|
-
}
|
|
2117
|
-
return Object.values(declaration);
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
function validateContractExports(root, packageJson, publications) {
|
|
2121
|
-
const exports = packageJson.exports;
|
|
2122
|
-
const packagePrefix = packageJson.name + '/';
|
|
2123
|
-
const requiredExports = new Set();
|
|
2124
|
-
for (const publication of publications) {
|
|
2125
|
-
if (publication === packagePrefix + 'api-contract') {
|
|
2126
|
-
requiredExports.add('./api-client');
|
|
2127
|
-
requiredExports.add('./api-contract');
|
|
2128
|
-
} else if (publication === packagePrefix + 'contracts') {
|
|
2129
|
-
requiredExports.add('./contracts');
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
for (const exportName of [...requiredExports].sort()) {
|
|
2133
|
-
const expected = allowedContractExports.get(exportName);
|
|
2134
|
-
if (!expected) {
|
|
2135
|
-
throw new Error(
|
|
2136
|
-
'Package ' +
|
|
2137
|
-
packageJson.name +
|
|
2138
|
-
' requires an unsupported contract export ' +
|
|
2139
|
-
exportName +
|
|
2140
|
-
'.',
|
|
2141
|
-
);
|
|
2142
|
-
}
|
|
2143
|
-
if (!exports || !Object.hasOwn(exports, exportName)) {
|
|
2144
|
-
throw new Error(
|
|
2145
|
-
'Package ' +
|
|
2146
|
-
packageJson.name +
|
|
2147
|
-
' is missing contract export ' +
|
|
2148
|
-
exportName +
|
|
2149
|
-
'.',
|
|
2150
|
-
);
|
|
2151
|
-
}
|
|
2152
|
-
for (const target of declaredExportTargets(
|
|
2153
|
-
exports[exportName],
|
|
2154
|
-
packageJson.name,
|
|
2155
|
-
exportName,
|
|
2156
|
-
)) {
|
|
2157
|
-
if (!target.startsWith('./')) {
|
|
2158
|
-
throw new Error(
|
|
2159
|
-
'Package ' +
|
|
2160
|
-
packageJson.name +
|
|
2161
|
-
' contract export ' +
|
|
2162
|
-
exportName +
|
|
2163
|
-
' must use a relative package target.',
|
|
2164
|
-
);
|
|
2165
|
-
}
|
|
2166
|
-
const absoluteTarget = resolve(root, target);
|
|
2167
|
-
if (
|
|
2168
|
-
!isContained(workspaceRoot, absoluteTarget) ||
|
|
2169
|
-
!isContained(root, absoluteTarget) ||
|
|
2170
|
-
!existsSync(absoluteTarget) ||
|
|
2171
|
-
!statSync(absoluteTarget).isFile()
|
|
2172
|
-
) {
|
|
2173
|
-
throw new Error(
|
|
2174
|
-
'Package ' +
|
|
2175
|
-
packageJson.name +
|
|
2176
|
-
' contract export ' +
|
|
2177
|
-
exportName +
|
|
2178
|
-
' points outside its package or to a missing file.',
|
|
2179
|
-
);
|
|
2180
|
-
}
|
|
2181
|
-
const realTarget = realpathSync(absoluteTarget);
|
|
2182
|
-
if (
|
|
2183
|
-
!isContained(realpathSync(workspaceRoot), realTarget) ||
|
|
2184
|
-
!isContained(realpathSync(root), realTarget)
|
|
2185
|
-
) {
|
|
2186
|
-
throw new Error(
|
|
2187
|
-
'Package ' +
|
|
2188
|
-
packageJson.name +
|
|
2189
|
-
' contract export ' +
|
|
2190
|
-
exportName +
|
|
2191
|
-
' escapes the repository through an aliased target.',
|
|
2192
|
-
);
|
|
2193
|
-
}
|
|
2194
|
-
const targetFromPackage = relative(root, absoluteTarget)
|
|
2195
|
-
.split(sep)
|
|
2196
|
-
.join('/');
|
|
2197
|
-
const expectedSurface = expected.exact ?? expected.surface;
|
|
2198
|
-
const mapsToSurface =
|
|
2199
|
-
expected.exact !== undefined
|
|
2200
|
-
? targetFromPackage === expected.exact
|
|
2201
|
-
: targetFromPackage.endsWith('.ts') &&
|
|
2202
|
-
isContained(join(root, expectedSurface), absoluteTarget) &&
|
|
2203
|
-
absoluteTarget !== join(root, expectedSurface);
|
|
2204
|
-
if (!mapsToSurface) {
|
|
2205
|
-
throw new Error(
|
|
2206
|
-
'Package ' +
|
|
2207
|
-
packageJson.name +
|
|
2208
|
-
' contract export ' +
|
|
2209
|
-
exportName +
|
|
2210
|
-
' is remapped outside its corresponding contract surface.',
|
|
2211
|
-
);
|
|
2212
|
-
}
|
|
2213
|
-
}
|
|
2214
|
-
}
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
${built_in_plan_event_contract_literal_js_1.EVENT_CONTRACT_LITERAL_SOURCE}
|
|
2218
|
-
function producerEventContract(producer, slice) {
|
|
2219
|
-
const path = join(producer.root, 'contracts', 'events.ts');
|
|
2220
|
-
if (!existsSync(path)) {
|
|
2221
|
-
throw new Error(
|
|
2222
|
-
'Producer ' + slice + ' publishes no contracts/events.ts EventContractSchema.',
|
|
2223
|
-
);
|
|
2224
|
-
}
|
|
2225
|
-
const file = ts.createSourceFile(
|
|
2226
|
-
path,
|
|
2227
|
-
readFileSync(path, 'utf8'),
|
|
2228
|
-
ts.ScriptTarget.ESNext,
|
|
2229
|
-
true,
|
|
2230
|
-
ts.ScriptKind.TS,
|
|
2231
|
-
);
|
|
2232
|
-
let schema;
|
|
2233
|
-
for (const statement of file.statements) {
|
|
2234
|
-
if (!ts.isVariableStatement(statement)) continue;
|
|
2235
|
-
for (const variable of statement.declarationList.declarations) {
|
|
2236
|
-
if (
|
|
2237
|
-
ts.isIdentifier(variable.name) &&
|
|
2238
|
-
variable.name.text === 'EventContractSchema' &&
|
|
2239
|
-
variable.initializer
|
|
2240
|
-
) {
|
|
2241
|
-
if (schema !== undefined) {
|
|
2242
|
-
throw new Error(
|
|
2243
|
-
'Producer ' + slice + ' EventContractSchema export is ambiguous.',
|
|
2244
|
-
);
|
|
2245
|
-
}
|
|
2246
|
-
schema = eventLiteral(variable.initializer);
|
|
2247
|
-
}
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
if (
|
|
2251
|
-
schema?.kind !== 'ebk-event-contract-schema' ||
|
|
2252
|
-
schema.schemaVersion !== 1 ||
|
|
2253
|
-
schema.slice !== slice ||
|
|
2254
|
-
!Array.isArray(schema.events)
|
|
2255
|
-
) {
|
|
2256
|
-
throw new Error(
|
|
2257
|
-
'Producer ' +
|
|
2258
|
-
slice +
|
|
2259
|
-
' contracts/events.ts must export one canonical v1 EventContractSchema.',
|
|
2260
|
-
);
|
|
2261
|
-
}
|
|
2262
|
-
return schema;
|
|
2263
|
-
}
|
|
2264
|
-
|
|
2265
|
-
// Bind each declared cross-Slice subscription to the producer's published
|
|
2266
|
-
// EventContractSchema, so a removed, renamed or re-versioned event fails here
|
|
2267
|
-
// instead of silently stopping delivery.
|
|
2268
|
-
async function checkEventSubscriptions(dependencies, projects) {
|
|
2269
|
-
const subscriptionPath = join(
|
|
2270
|
-
projectRoot,
|
|
2271
|
-
'contracts',
|
|
2272
|
-
'event-subscriptions.json',
|
|
2273
|
-
);
|
|
2274
|
-
if (!existsSync(subscriptionPath)) {
|
|
2275
|
-
throw new Error(
|
|
2276
|
-
'contracts/event-subscriptions.json is missing. Restore the seeded ' +
|
|
2277
|
-
'declaration with schemaVersion 1 and an empty subscriptions list.',
|
|
2278
|
-
);
|
|
2279
|
-
}
|
|
2280
|
-
// The managed infrastructure validator is the one authority for the
|
|
2281
|
-
// declaration shape; this check runs it exactly as deployment does.
|
|
2282
|
-
const validator = await import(
|
|
2283
|
-
'data:text/javascript;base64,' +
|
|
2284
|
-
Buffer.from(
|
|
2285
|
-
ts.transpileModule(
|
|
2286
|
-
readFileSync(
|
|
2287
|
-
join(projectRoot, 'infra', 'event-subscriptions.ts'),
|
|
2288
|
-
'utf8',
|
|
2289
|
-
),
|
|
2290
|
-
{
|
|
2291
|
-
compilerOptions: {
|
|
2292
|
-
module: ts.ModuleKind.ESNext,
|
|
2293
|
-
target: ts.ScriptTarget.ES2022,
|
|
2294
|
-
},
|
|
2295
|
-
},
|
|
2296
|
-
).outputText,
|
|
2297
|
-
).toString('base64')
|
|
2298
|
-
);
|
|
2299
|
-
const subscriptions = validator.crossSliceEventSubscriptions(
|
|
2300
|
-
readJson(subscriptionPath),
|
|
2301
|
-
dependencies,
|
|
2302
|
-
);
|
|
2303
|
-
for (const subscription of subscriptions) {
|
|
2304
|
-
const producer = projects.get(subscription.source);
|
|
2305
|
-
if (
|
|
2306
|
-
!producer ||
|
|
2307
|
-
!dependencies.consumes.includes(producer.packageJson.name + '/contracts')
|
|
2308
|
-
) {
|
|
2309
|
-
throw new Error(
|
|
2310
|
-
'Subscribed source ' +
|
|
2311
|
-
subscription.source +
|
|
2312
|
-
' is not a consumed Product Slice contracts package.',
|
|
2313
|
-
);
|
|
2314
|
-
}
|
|
2315
|
-
const schema = producerEventContract(producer, subscription.source);
|
|
2316
|
-
for (const detailType of subscription.detailTypes) {
|
|
2317
|
-
const published = schema.events.filter(
|
|
2318
|
-
(event) => event?.detailType === detailType,
|
|
2319
|
-
);
|
|
2320
|
-
if (
|
|
2321
|
-
published.length !== 1 ||
|
|
2322
|
-
published[0].source !== subscription.source
|
|
2323
|
-
) {
|
|
2324
|
-
throw new Error(
|
|
2325
|
-
'Producer ' +
|
|
2326
|
-
subscription.source +
|
|
2327
|
-
' does not publish ' +
|
|
2328
|
-
detailType +
|
|
2329
|
-
' in its EventContractSchema. Restore the producer event or ' +
|
|
2330
|
-
'remove the subscription from contracts/event-subscriptions.json.',
|
|
2331
|
-
);
|
|
2332
|
-
}
|
|
2333
|
-
if (!subscription.schemaVersions.includes(published[0].schemaVersion)) {
|
|
2334
|
-
throw new Error(
|
|
2335
|
-
'Producer ' +
|
|
2336
|
-
subscription.source +
|
|
2337
|
-
' publishes ' +
|
|
2338
|
-
detailType +
|
|
2339
|
-
' schemaVersion ' +
|
|
2340
|
-
published[0].schemaVersion +
|
|
2341
|
-
', which ${name} does not subscribe to. Accept that version ' +
|
|
2342
|
-
'in api/event-consumer.ts, then declare it in ' +
|
|
2343
|
-
'contracts/event-subscriptions.json.',
|
|
2344
|
-
);
|
|
2345
|
-
}
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
const declaration = readJson(declarationPath);
|
|
2351
|
-
if (
|
|
2352
|
-
!declaration ||
|
|
2353
|
-
typeof declaration !== 'object' ||
|
|
2354
|
-
Array.isArray(declaration) ||
|
|
2355
|
-
declaration.schemaVersion !== 1 ||
|
|
2356
|
-
!Array.isArray(declaration.consumes) ||
|
|
2357
|
-
Object.keys(declaration).some(
|
|
2358
|
-
(key) => !['consumes', 'schemaVersion'].includes(key),
|
|
2359
|
-
)
|
|
2360
|
-
) {
|
|
2361
|
-
throw new Error(
|
|
2362
|
-
'contracts/dependencies.json must be a v1 consumes declaration.',
|
|
2363
|
-
);
|
|
2364
|
-
}
|
|
2365
|
-
const ownership = readJson(ownershipPath);
|
|
2366
|
-
const [normalized] = normalizeApiContractProjectDeclarations([
|
|
2367
|
-
{
|
|
2368
|
-
contracts: {
|
|
2369
|
-
consumes: declaration.consumes,
|
|
2370
|
-
publishes: ownership.contracts?.publishes ?? [],
|
|
2371
|
-
},
|
|
2372
|
-
project: '${name}',
|
|
2373
|
-
},
|
|
2374
|
-
]);
|
|
2375
|
-
if (!normalized) {
|
|
2376
|
-
throw new Error('The contract dependency declaration did not normalize.');
|
|
2377
|
-
}
|
|
2378
|
-
|
|
2379
|
-
const packagesRoot = join(workspaceRoot, 'packages');
|
|
2380
|
-
const projects = new Map();
|
|
2381
|
-
const packageNames = new Set();
|
|
2382
|
-
const declarations = [];
|
|
2383
|
-
for (const entry of readdirSync(packagesRoot, { withFileTypes: true })) {
|
|
2384
|
-
if (!entry.isDirectory() || entry.name === 'foundation') continue;
|
|
2385
|
-
const root = join(packagesRoot, entry.name);
|
|
2386
|
-
const candidateOwnershipPath = join(root, '.ebk', 'ownership.json');
|
|
2387
|
-
if (!existsSync(candidateOwnershipPath)) continue;
|
|
2388
|
-
const candidateOwnership =
|
|
2389
|
-
root === projectRoot
|
|
2390
|
-
? {
|
|
2391
|
-
...ownership,
|
|
2392
|
-
contracts: {
|
|
2393
|
-
...ownership.contracts,
|
|
2394
|
-
consumes: normalized.contracts.consumes,
|
|
2395
|
-
},
|
|
2396
|
-
}
|
|
2397
|
-
: readJson(candidateOwnershipPath);
|
|
2398
|
-
// The root site publishes no contracts. packages/site holds only its
|
|
2399
|
-
// record, and its record belongs only there.
|
|
2400
|
-
if (entry.name === 'site' || candidateOwnership?.kind === 'site') {
|
|
2401
|
-
if (
|
|
2402
|
-
entry.name === 'site' &&
|
|
2403
|
-
validateSiteOwnershipRecord(candidateOwnership).valid
|
|
2404
|
-
) {
|
|
2405
|
-
continue;
|
|
2406
|
-
}
|
|
2407
|
-
throw new Error(
|
|
2408
|
-
entry.name === 'site'
|
|
2409
|
-
? 'packages/site is reserved for the workspace root site and must hold valid root site ownership.'
|
|
2410
|
-
: 'Root site ownership belongs only in packages/site, not packages/' +
|
|
2411
|
-
entry.name +
|
|
2412
|
-
'.',
|
|
2413
|
-
);
|
|
2414
|
-
}
|
|
2415
|
-
const validation = validateGeneratedOwnershipRecord(candidateOwnership);
|
|
2416
|
-
if (!validation.valid) {
|
|
2417
|
-
throw new Error(
|
|
2418
|
-
'Product Slice ' +
|
|
2419
|
-
entry.name +
|
|
2420
|
-
' has invalid ownership metadata: ' +
|
|
2421
|
-
JSON.stringify(validation.issues),
|
|
2422
|
-
);
|
|
2423
|
-
}
|
|
2424
|
-
const project = validation.value.slice;
|
|
2425
|
-
const packageJson = readJson(join(root, 'package.json'));
|
|
2426
|
-
if (
|
|
2427
|
-
typeof packageJson.name !== 'string' ||
|
|
2428
|
-
packageJson.name.length === 0 ||
|
|
2429
|
-
projects.has(project) ||
|
|
2430
|
-
packageNames.has(packageJson.name)
|
|
2431
|
-
) {
|
|
2432
|
-
throw new Error(
|
|
2433
|
-
'Product Slice projects and package names must be unique and explicit.',
|
|
2434
|
-
);
|
|
2435
|
-
}
|
|
2436
|
-
packageNames.add(packageJson.name);
|
|
2437
|
-
validateContractExports(
|
|
2438
|
-
root,
|
|
2439
|
-
packageJson,
|
|
2440
|
-
validation.value.contracts.publishes,
|
|
2441
|
-
);
|
|
2442
|
-
projects.set(project, { packageJson, root });
|
|
2443
|
-
declarations.push({
|
|
2444
|
-
contracts: validation.value.contracts,
|
|
2445
|
-
project,
|
|
2446
|
-
});
|
|
2447
|
-
}
|
|
2448
|
-
if (!projects.has('${name}')) {
|
|
2449
|
-
throw new Error(
|
|
2450
|
-
'The current Product Slice is absent from workspace ownership.',
|
|
2451
|
-
);
|
|
2452
|
-
}
|
|
2453
|
-
const resolution = resolveApiContractDependencies(declarations);
|
|
2454
|
-
for (const publication of resolution.contracts) {
|
|
2455
|
-
const producer = projects.get(publication.producer);
|
|
2456
|
-
if (!producer) {
|
|
2457
|
-
throw new Error(
|
|
2458
|
-
'Resolved contract producer ' + publication.producer + ' is absent.',
|
|
2459
|
-
);
|
|
2460
|
-
}
|
|
2461
|
-
const prefix = producer.packageJson.name + '/';
|
|
2462
|
-
if (!publication.contract.startsWith(prefix)) {
|
|
2463
|
-
throw new Error(
|
|
2464
|
-
'Published contract ' +
|
|
2465
|
-
publication.contract +
|
|
2466
|
-
' is outside producer package ' +
|
|
2467
|
-
producer.packageJson.name +
|
|
2468
|
-
'.',
|
|
2469
|
-
);
|
|
2470
|
-
}
|
|
2471
|
-
const exportName = './' + publication.contract.slice(prefix.length);
|
|
2472
|
-
if (!allowedContractExports.has(exportName)) {
|
|
2473
|
-
throw new Error(
|
|
2474
|
-
'Published contract ' +
|
|
2475
|
-
publication.contract +
|
|
2476
|
-
' does not use an allowed package export ' +
|
|
2477
|
-
exportName +
|
|
2478
|
-
'.',
|
|
2479
|
-
);
|
|
2480
|
-
}
|
|
2481
|
-
for (const consumerName of publication.consumers) {
|
|
2482
|
-
const consumer = projects.get(consumerName);
|
|
2483
|
-
const version =
|
|
2484
|
-
consumer?.packageJson.dependencies?.[producer.packageJson.name];
|
|
2485
|
-
if (typeof version !== 'string' || !version.startsWith('workspace:')) {
|
|
2486
|
-
throw new Error(
|
|
2487
|
-
'Consumed contract ' +
|
|
2488
|
-
publication.contract +
|
|
2489
|
-
' requires ' +
|
|
2490
|
-
consumerName +
|
|
2491
|
-
' to declare a workspace dependency on ' +
|
|
2492
|
-
producer.packageJson.name +
|
|
2493
|
-
'.',
|
|
2494
|
-
);
|
|
2495
|
-
}
|
|
2496
|
-
}
|
|
2497
|
-
}
|
|
2498
|
-
const current = [...(ownership.contracts?.consumes ?? [])].sort();
|
|
2499
|
-
const expected = [...normalized.contracts.consumes];
|
|
2500
|
-
if (action === 'check') {
|
|
2501
|
-
await checkEventSubscriptions(declaration, projects);
|
|
2502
|
-
if (JSON.stringify(current) !== JSON.stringify(expected)) {
|
|
2503
|
-
throw new Error(
|
|
2504
|
-
'Contract declarations are out of sync. Run ' +
|
|
2505
|
-
'pnpm nx run ${name}:contract-dependencies-sync.',
|
|
2506
|
-
);
|
|
2507
|
-
}
|
|
2508
|
-
process.stdout.write(
|
|
2509
|
-
JSON.stringify({
|
|
2510
|
-
action,
|
|
2511
|
-
consumes: expected,
|
|
2512
|
-
project: '${name}',
|
|
2513
|
-
schemaVersion: 1,
|
|
2514
|
-
}) + '\\n',
|
|
2515
|
-
);
|
|
2516
|
-
} else {
|
|
2517
|
-
const candidate = {
|
|
2518
|
-
...ownership,
|
|
2519
|
-
contracts: {
|
|
2520
|
-
...ownership.contracts,
|
|
2521
|
-
consumes: expected,
|
|
2522
|
-
},
|
|
2523
|
-
};
|
|
2524
|
-
const validation = validateGeneratedOwnershipRecord(candidate);
|
|
2525
|
-
if (!validation.valid) {
|
|
2526
|
-
throw new Error(
|
|
2527
|
-
'Contract dependency sync produced invalid ownership: ' +
|
|
2528
|
-
JSON.stringify(validation.issues),
|
|
2529
|
-
);
|
|
2530
|
-
}
|
|
2531
|
-
writeFileSync(
|
|
2532
|
-
ownershipPath,
|
|
2533
|
-
JSON.stringify(validation.value, null, 2) + '\\n',
|
|
2534
|
-
'utf8',
|
|
2535
|
-
);
|
|
2536
|
-
process.stdout.write(
|
|
2537
|
-
JSON.stringify({
|
|
2538
|
-
action,
|
|
2539
|
-
consumes: expected,
|
|
2540
|
-
project: '${name}',
|
|
2541
|
-
schemaVersion: 1,
|
|
2542
|
-
}) + '\\n',
|
|
2543
|
-
);
|
|
2544
|
-
}
|
|
2545
|
-
`,
|
|
2546
|
-
'scripts/api-contract.mjs': `import { createHash } from 'node:crypto';
|
|
2547
|
-
import { spawnSync } from 'node:child_process';
|
|
2548
|
-
import {
|
|
2549
|
-
mkdirSync,
|
|
2550
|
-
readFileSync,
|
|
2551
|
-
rmSync,
|
|
2552
|
-
writeFileSync,
|
|
2553
|
-
} from 'node:fs';
|
|
2554
|
-
import { createRequire } from 'node:module';
|
|
2555
|
-
import { join, resolve } from 'node:path';
|
|
2556
|
-
import { createApiContractArtifacts } from '@empire-builder-kit/runtime/api-contract';
|
|
2557
|
-
import { ${contractIdentifier} } from '../api/contracts/protected.ts';
|
|
2558
|
-
|
|
2559
|
-
const require = createRequire(import.meta.url);
|
|
2560
|
-
const {
|
|
2561
|
-
authorizeApiContractBaselineUpdate,
|
|
2562
|
-
compareApiContracts,
|
|
2563
|
-
createApiContractCompatibilityEvidence,
|
|
2564
|
-
planApiContractBaselineUpdate,
|
|
2565
|
-
} = require('@empire-builder-kit/nx/api-contract');
|
|
2566
|
-
const {
|
|
2567
|
-
createTestingEvidenceFromRunnerAttempts,
|
|
2568
|
-
inspectTestingEvidenceArtifact,
|
|
2569
|
-
normalizeVitestEvidenceAttempt,
|
|
2570
|
-
} = require('@empire-builder-kit/nx/testing-evidence');
|
|
2571
|
-
const {
|
|
2572
|
-
validateGeneratedOwnershipRecord,
|
|
2573
|
-
} = require('@empire-builder-kit/nx/ownership');
|
|
2574
|
-
|
|
2575
|
-
const projectRoot = process.cwd();
|
|
2576
|
-
const workspaceRoot = resolve(projectRoot, '../..');
|
|
2577
|
-
const generatedRoot = join(projectRoot, 'api', 'generated');
|
|
2578
|
-
const evidenceRoot = join(projectRoot, '.ebk', 'evidence');
|
|
2579
|
-
const ownershipPath = join(projectRoot, '.ebk', 'ownership.json');
|
|
2580
|
-
const normalizedPath = join(generatedRoot, 'contract.json');
|
|
2581
|
-
const openApiPath = join(generatedRoot, 'openapi.json');
|
|
2582
|
-
const baselinePath = join(generatedRoot, 'baseline.json');
|
|
2583
|
-
const reportPath = join(evidenceRoot, 'api-contract-compatibility.json');
|
|
2584
|
-
const resultPath = join(evidenceRoot, 'api-contract.json');
|
|
2585
|
-
const readJson = (path) => JSON.parse(readFileSync(path, 'utf8'));
|
|
2586
|
-
const workspacePackage = readJson(join(workspaceRoot, 'package.json'));
|
|
2587
|
-
const ownership = readJson(ownershipPath);
|
|
2588
|
-
const artifacts = createApiContractArtifacts(${contractIdentifier});
|
|
2589
|
-
const action = process.argv[2] ?? 'check';
|
|
2590
|
-
const digest = (contents) =>
|
|
2591
|
-
'sha256:' + createHash('sha256').update(contents).digest('hex');
|
|
2592
|
-
|
|
2593
|
-
${local_source_identity_js_1.localSourceCommitFunction}
|
|
2594
|
-
|
|
2595
|
-
function sourceIdentity() {
|
|
2596
|
-
const commit = localSourceCommit();
|
|
2597
|
-
const frameworkCandidate =
|
|
2598
|
-
workspacePackage.dependencies?.['@empire-builder-kit/runtime'];
|
|
2599
|
-
if (typeof frameworkCandidate !== 'string' || !frameworkCandidate) {
|
|
2600
|
-
throw new Error('The workspace runtime candidate is unavailable.');
|
|
2601
|
-
}
|
|
2602
|
-
return {
|
|
2603
|
-
blueprintCandidates: [
|
|
2604
|
-
ownership.blueprint.name + '@' + ownership.blueprint.version,
|
|
2605
|
-
],
|
|
2606
|
-
commit,
|
|
2607
|
-
frameworkCandidate,
|
|
2608
|
-
};
|
|
2609
|
-
}
|
|
2610
|
-
|
|
2611
|
-
function writeManagedArtifacts() {
|
|
2612
|
-
mkdirSync(generatedRoot, { recursive: true });
|
|
2613
|
-
writeFileSync(normalizedPath, artifacts.normalizedJson, 'utf8');
|
|
2614
|
-
writeFileSync(openApiPath, artifacts.openApiJson, 'utf8');
|
|
2615
|
-
}
|
|
2616
|
-
|
|
2617
|
-
function restampManagedArtifacts() {
|
|
2618
|
-
const managedArtifacts = new Map([
|
|
2619
|
-
['api/generated/contract.json', artifacts.normalizedJson],
|
|
2620
|
-
['api/generated/openapi.json', artifacts.openApiJson],
|
|
2621
|
-
]);
|
|
2622
|
-
const restamped = new Set();
|
|
2623
|
-
const candidate = {
|
|
2624
|
-
...ownership,
|
|
2625
|
-
paths: ownership.paths.map((entry) => {
|
|
2626
|
-
const contents = managedArtifacts.get(entry.path);
|
|
2627
|
-
if (contents === undefined) return entry;
|
|
2628
|
-
if (entry.mode !== 'managed' || entry.managedJsonPointers !== undefined) {
|
|
2629
|
-
throw new Error(
|
|
2630
|
-
'API contract generation can restamp only whole-file managed artifacts.',
|
|
2631
|
-
);
|
|
2632
|
-
}
|
|
2633
|
-
restamped.add(entry.path);
|
|
2634
|
-
return {
|
|
2635
|
-
...entry,
|
|
2636
|
-
sha256: createHash('sha256').update(contents).digest('hex'),
|
|
2637
|
-
};
|
|
2638
|
-
}),
|
|
2639
|
-
};
|
|
2640
|
-
if (restamped.size !== managedArtifacts.size) {
|
|
2641
|
-
throw new Error(
|
|
2642
|
-
'API contract generation could not find every managed artifact in ownership metadata.',
|
|
2643
|
-
);
|
|
2644
|
-
}
|
|
2645
|
-
const validation = validateGeneratedOwnershipRecord(candidate);
|
|
2646
|
-
if (!validation.valid) {
|
|
2647
|
-
throw new Error(
|
|
2648
|
-
'API contract generation produced invalid ownership metadata: ' +
|
|
2649
|
-
JSON.stringify(validation.issues),
|
|
2650
|
-
);
|
|
2651
|
-
}
|
|
2652
|
-
writeFileSync(
|
|
2653
|
-
ownershipPath,
|
|
2654
|
-
JSON.stringify(validation.value, null, 2) + '\\n',
|
|
2655
|
-
'utf8',
|
|
2656
|
-
);
|
|
2657
|
-
}
|
|
2658
|
-
|
|
2659
|
-
function approvalPath() {
|
|
2660
|
-
const inline = process.argv.find((value) => value.startsWith('--approval='));
|
|
2661
|
-
if (inline) return inline.slice('--approval='.length);
|
|
2662
|
-
const index = process.argv.indexOf('--approval');
|
|
2663
|
-
return index >= 0 ? process.argv[index + 1] : undefined;
|
|
2664
|
-
}
|
|
2665
|
-
|
|
2666
|
-
if (action === 'generate') {
|
|
2667
|
-
writeManagedArtifacts();
|
|
2668
|
-
restampManagedArtifacts();
|
|
2669
|
-
process.stdout.write(
|
|
2670
|
-
JSON.stringify({
|
|
2671
|
-
action,
|
|
2672
|
-
baselineUpdated: false,
|
|
2673
|
-
normalizedDigest: digest(artifacts.normalizedJson),
|
|
2674
|
-
openApiDigest: digest(artifacts.openApiJson),
|
|
2675
|
-
}) + '\\n',
|
|
2676
|
-
);
|
|
2677
|
-
} else if (action === 'baseline') {
|
|
2678
|
-
const currentBaseline = readJson(baselinePath);
|
|
2679
|
-
const plan = planApiContractBaselineUpdate(
|
|
2680
|
-
currentBaseline,
|
|
2681
|
-
artifacts.normalized,
|
|
2682
|
-
);
|
|
2683
|
-
if (plan.disposition === 'no-change') {
|
|
2684
|
-
process.stdout.write(
|
|
2685
|
-
JSON.stringify({
|
|
2686
|
-
action,
|
|
2687
|
-
baselineUpdated: false,
|
|
2688
|
-
candidateDigest: plan.candidate.digest,
|
|
2689
|
-
disposition: plan.disposition,
|
|
2690
|
-
}) + '\\n',
|
|
2691
|
-
);
|
|
2692
|
-
} else {
|
|
2693
|
-
const path = approvalPath();
|
|
2694
|
-
if (!path) {
|
|
2695
|
-
throw new Error(
|
|
2696
|
-
'A baseline update requires --approval=<reviewed-json-path>.',
|
|
2697
|
-
);
|
|
2698
|
-
}
|
|
2699
|
-
const authorization = authorizeApiContractBaselineUpdate(
|
|
2700
|
-
plan,
|
|
2701
|
-
readJson(resolve(projectRoot, path)),
|
|
2702
|
-
);
|
|
2703
|
-
writeFileSync(baselinePath, authorization.candidateJson, 'utf8');
|
|
2704
|
-
process.stdout.write(
|
|
2705
|
-
JSON.stringify({
|
|
2706
|
-
acceptedClassification: authorization.acceptedClassification,
|
|
2707
|
-
action,
|
|
2708
|
-
baselineDigest: authorization.baselineDigest,
|
|
2709
|
-
baselineUpdated: true,
|
|
2710
|
-
candidateDigest: authorization.candidateDigest,
|
|
2711
|
-
}) + '\\n',
|
|
2712
|
-
);
|
|
2713
|
-
}
|
|
2714
|
-
} else if (action === 'check') {
|
|
2715
|
-
const startedAt = new Date().toISOString();
|
|
2716
|
-
mkdirSync(evidenceRoot, { recursive: true });
|
|
2717
|
-
rmSync(reportPath, { force: true });
|
|
2718
|
-
rmSync(resultPath, { force: true });
|
|
2719
|
-
try {
|
|
2720
|
-
const baseline = readJson(baselinePath);
|
|
2721
|
-
const report = compareApiContracts(baseline, artifacts.normalized);
|
|
2722
|
-
const reportJson = JSON.stringify(report, null, 2) + '\\n';
|
|
2723
|
-
const reportInspection = inspectTestingEvidenceArtifact({
|
|
2724
|
-
contents: reportJson,
|
|
2725
|
-
});
|
|
2726
|
-
const generatedDrift =
|
|
2727
|
-
readFileSync(normalizedPath, 'utf8') !== artifacts.normalizedJson ||
|
|
2728
|
-
readFileSync(openApiPath, 'utf8') !== artifacts.openApiJson;
|
|
2729
|
-
const completedAt = new Date().toISOString();
|
|
2730
|
-
const retainedArtifacts = [];
|
|
2731
|
-
if (reportInspection.safe) {
|
|
2732
|
-
writeFileSync(reportPath, reportJson, 'utf8');
|
|
2733
|
-
retainedArtifacts.push({
|
|
2734
|
-
digest: digest(reportJson),
|
|
2735
|
-
name: '.ebk/evidence/api-contract-compatibility.json',
|
|
2736
|
-
retentionClass: 'source-result',
|
|
2737
|
-
});
|
|
2738
|
-
}
|
|
2739
|
-
const evidenceOptions = {
|
|
2740
|
-
artifacts: retainedArtifacts,
|
|
2741
|
-
commandVersion: '1',
|
|
2742
|
-
completedAt,
|
|
2743
|
-
project: '${name}',
|
|
2744
|
-
report,
|
|
2745
|
-
source: sourceIdentity(),
|
|
2746
|
-
startedAt,
|
|
2747
|
-
target: 'api-contract-check',
|
|
2748
|
-
workspace: workspacePackage.name,
|
|
2749
|
-
};
|
|
2750
|
-
const result =
|
|
2751
|
-
generatedDrift || !reportInspection.safe
|
|
2752
|
-
? createTestingEvidenceFromRunnerAttempts({
|
|
2753
|
-
artifacts: retainedArtifacts,
|
|
2754
|
-
attempts: [
|
|
2755
|
-
normalizeVitestEvidenceAttempt({
|
|
2756
|
-
attempt: 1,
|
|
2757
|
-
completedAt,
|
|
2758
|
-
failed: 1,
|
|
2759
|
-
findings: [
|
|
2760
|
-
{
|
|
2761
|
-
classification: generatedDrift
|
|
2762
|
-
? 'environment-drift'
|
|
2763
|
-
: 'sensitive-artifact',
|
|
2764
|
-
summary: generatedDrift
|
|
2765
|
-
? 'Managed API artifacts differ from the authoritative contract.'
|
|
2766
|
-
: 'The API compatibility report matched protected artifact data and was not retained.',
|
|
2767
|
-
},
|
|
2768
|
-
],
|
|
2769
|
-
passed: 0,
|
|
2770
|
-
skipped: 0,
|
|
2771
|
-
startedAt,
|
|
2772
|
-
}),
|
|
2773
|
-
],
|
|
2774
|
-
cleanup: { outcome: 'not-required' },
|
|
2775
|
-
environment: { class: 'source', deployed: false },
|
|
2776
|
-
operation: {
|
|
2777
|
-
commandVersion: '1',
|
|
2778
|
-
project: '${name}',
|
|
2779
|
-
proofLayer: 'contract-compatibility',
|
|
2780
|
-
target: 'api-contract-check',
|
|
2781
|
-
},
|
|
2782
|
-
proofStarted: true,
|
|
2783
|
-
slice: '${name}',
|
|
2784
|
-
source: evidenceOptions.source,
|
|
2785
|
-
workspace: workspacePackage.name,
|
|
2786
|
-
})
|
|
2787
|
-
: createApiContractCompatibilityEvidence(evidenceOptions);
|
|
2788
|
-
writeFileSync(
|
|
2789
|
-
resultPath,
|
|
2790
|
-
JSON.stringify(result, null, 2) + '\\n',
|
|
2791
|
-
'utf8',
|
|
2792
|
-
);
|
|
2793
|
-
process.stdout.write(JSON.stringify(result) + '\\n');
|
|
2794
|
-
if (result.outcome !== 'passed') process.exitCode = 1;
|
|
2795
|
-
} catch (error) {
|
|
2796
|
-
const completedAt = new Date().toISOString();
|
|
2797
|
-
const missing =
|
|
2798
|
-
error &&
|
|
2799
|
-
typeof error === 'object' &&
|
|
2800
|
-
'code' in error &&
|
|
2801
|
-
error.code === 'ENOENT';
|
|
2802
|
-
const result = createTestingEvidenceFromRunnerAttempts({
|
|
2803
|
-
artifacts: [],
|
|
2804
|
-
attempts: [],
|
|
2805
|
-
cleanup: { outcome: 'not-required' },
|
|
2806
|
-
environment: { class: 'source', deployed: false },
|
|
2807
|
-
operation: {
|
|
2808
|
-
commandVersion: '1',
|
|
2809
|
-
project: '${name}',
|
|
2810
|
-
proofLayer: 'contract-compatibility',
|
|
2811
|
-
target: 'api-contract-check',
|
|
2812
|
-
},
|
|
2813
|
-
preflight: {
|
|
2814
|
-
completedAt,
|
|
2815
|
-
findings: [
|
|
2816
|
-
{
|
|
2817
|
-
classification: missing
|
|
2818
|
-
? 'prerequisite-missing'
|
|
2819
|
-
: 'environment-drift',
|
|
2820
|
-
summary: missing
|
|
2821
|
-
? 'A required API contract artifact or baseline is missing.'
|
|
2822
|
-
: 'A required API contract artifact or baseline is invalid.',
|
|
2823
|
-
},
|
|
2824
|
-
],
|
|
2825
|
-
startedAt,
|
|
2826
|
-
},
|
|
2827
|
-
proofStarted: false,
|
|
2828
|
-
slice: '${name}',
|
|
2829
|
-
source: sourceIdentity(),
|
|
2830
|
-
workspace: workspacePackage.name,
|
|
2831
|
-
});
|
|
2832
|
-
writeFileSync(
|
|
2833
|
-
resultPath,
|
|
2834
|
-
JSON.stringify(result, null, 2) + '\\n',
|
|
2835
|
-
'utf8',
|
|
2836
|
-
);
|
|
2837
|
-
process.stdout.write(JSON.stringify(result) + '\\n');
|
|
2838
|
-
process.exitCode = 1;
|
|
2839
|
-
}
|
|
2840
|
-
} else {
|
|
2841
|
-
throw new Error(
|
|
2842
|
-
'Usage: node scripts/api-contract.mjs <check|generate|baseline>',
|
|
2843
|
-
);
|
|
2844
|
-
}
|
|
2845
|
-
`,
|
|
2846
|
-
};
|
|
2847
|
-
}
|
|
2848
|
-
//# sourceMappingURL=built-in-plan-api-contract-files.js.map
|