@innovatorstack/harness 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +59 -2
- package/assets/brand/icon-on-dark.png +0 -0
- package/assets/brand/icon.png +0 -0
- package/assets/brand/mark-on-dark.svg +6 -0
- package/assets/brand/mark.svg +6 -0
- package/assets/brand/social-preview.png +0 -0
- package/assets/brand/social-preview.svg +13 -0
- package/dist/baseline/catalog.d.ts +5 -0
- package/dist/baseline/catalog.d.ts.map +1 -0
- package/dist/baseline/catalog.js +32 -0
- package/dist/baseline/catalog.js.map +1 -0
- package/dist/baseline/data/item-types.json +1062 -0
- package/dist/baseline/data/properties.json +31286 -0
- package/dist/baseline/data/records.json +6666 -0
- package/dist/baseline/data/relationships.json +393 -0
- package/dist/baseline/database.bin +0 -0
- package/dist/baseline/database.d.ts +4 -0
- package/dist/baseline/database.d.ts.map +1 -0
- package/dist/baseline/database.js +33 -0
- package/dist/baseline/database.js.map +1 -0
- package/dist/baseline/source.d.ts +5 -0
- package/dist/baseline/source.d.ts.map +1 -0
- package/dist/baseline/source.js +13 -0
- package/dist/baseline/source.js.map +1 -0
- package/dist/compatibility/capabilities.d.ts +49 -0
- package/dist/compatibility/capabilities.d.ts.map +1 -0
- package/dist/compatibility/capabilities.js +605 -0
- package/dist/compatibility/capabilities.js.map +1 -0
- package/dist/compatibility/check.d.ts +5 -0
- package/dist/compatibility/check.d.ts.map +1 -0
- package/dist/compatibility/check.js +332 -0
- package/dist/compatibility/check.js.map +1 -0
- package/dist/compatibility/executions.d.ts +11 -0
- package/dist/compatibility/executions.d.ts.map +1 -0
- package/dist/compatibility/executions.js +79 -0
- package/dist/compatibility/executions.js.map +1 -0
- package/dist/compatibility/executors.d.ts +21 -0
- package/dist/compatibility/executors.d.ts.map +1 -0
- package/dist/compatibility/executors.js +151 -0
- package/dist/compatibility/executors.js.map +1 -0
- package/dist/compatibility/index.d.ts +6 -0
- package/dist/compatibility/index.d.ts.map +1 -0
- package/dist/compatibility/index.js +4 -0
- package/dist/compatibility/index.js.map +1 -0
- package/dist/compatibility/metadata.d.ts +6 -0
- package/dist/compatibility/metadata.d.ts.map +1 -0
- package/dist/compatibility/metadata.js +137 -0
- package/dist/compatibility/metadata.js.map +1 -0
- package/dist/compatibility/mocks.d.ts +4 -0
- package/dist/compatibility/mocks.d.ts.map +1 -0
- package/dist/compatibility/mocks.js +22 -0
- package/dist/compatibility/mocks.js.map +1 -0
- package/dist/compatibility/revisions.d.ts +5 -0
- package/dist/compatibility/revisions.d.ts.map +1 -0
- package/dist/compatibility/revisions.js +34 -0
- package/dist/compatibility/revisions.js.map +1 -0
- package/dist/compatibility/security.d.ts +6 -0
- package/dist/compatibility/security.d.ts.map +1 -0
- package/dist/compatibility/security.js +74 -0
- package/dist/compatibility/security.js.map +1 -0
- package/dist/compatibility/sources.d.ts +6 -0
- package/dist/compatibility/sources.d.ts.map +1 -0
- package/dist/compatibility/sources.js +20 -0
- package/dist/compatibility/sources.js.map +1 -0
- package/dist/compatibility/types.d.ts +130 -0
- package/dist/compatibility/types.d.ts.map +1 -0
- package/dist/compatibility/types.js +48 -0
- package/dist/compatibility/types.js.map +1 -0
- package/dist/controls/clock.d.ts +23 -0
- package/dist/controls/clock.d.ts.map +1 -0
- package/dist/controls/clock.js +74 -0
- package/dist/controls/clock.js.map +1 -0
- package/dist/controls/execution.d.ts +8 -0
- package/dist/controls/execution.d.ts.map +1 -0
- package/dist/controls/execution.js +36 -0
- package/dist/controls/execution.js.map +1 -0
- package/dist/controls/failure-types.d.ts +52 -0
- package/dist/controls/failure-types.d.ts.map +1 -0
- package/dist/controls/failure-types.js +15 -0
- package/dist/controls/failure-types.js.map +1 -0
- package/dist/controls/failure-validation.d.ts +17 -0
- package/dist/controls/failure-validation.d.ts.map +1 -0
- package/dist/controls/failure-validation.js +63 -0
- package/dist/controls/failure-validation.js.map +1 -0
- package/dist/controls/failures.d.ts +20 -0
- package/dist/controls/failures.d.ts.map +1 -0
- package/dist/controls/failures.js +128 -0
- package/dist/controls/failures.js.map +1 -0
- package/dist/controls/ids.d.ts +24 -0
- package/dist/controls/ids.d.ts.map +1 -0
- package/dist/controls/ids.js +63 -0
- package/dist/controls/ids.js.map +1 -0
- package/dist/controls/observers.d.ts +20 -0
- package/dist/controls/observers.d.ts.map +1 -0
- package/dist/controls/observers.js +80 -0
- package/dist/controls/observers.js.map +1 -0
- package/dist/controls/state.d.ts +10 -0
- package/dist/controls/state.d.ts.map +1 -0
- package/dist/controls/state.js +50 -0
- package/dist/controls/state.js.map +1 -0
- package/dist/controls/targets.d.ts +19 -0
- package/dist/controls/targets.d.ts.map +1 -0
- package/dist/controls/targets.js +82 -0
- package/dist/controls/targets.js.map +1 -0
- package/dist/controls/values.d.ts +23 -0
- package/dist/controls/values.d.ts.map +1 -0
- package/dist/controls/values.js +27 -0
- package/dist/controls/values.js.map +1 -0
- package/dist/controls/world.d.ts +18 -0
- package/dist/controls/world.d.ts.map +1 -0
- package/dist/controls/world.js +26 -0
- package/dist/controls/world.js.map +1 -0
- package/dist/core/budget.d.ts +9 -0
- package/dist/core/budget.d.ts.map +1 -0
- package/dist/core/budget.js +23 -0
- package/dist/core/budget.js.map +1 -0
- package/dist/core/context.d.ts +8 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +38 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/data.d.ts +16 -0
- package/dist/core/data.d.ts.map +1 -0
- package/dist/core/data.js +197 -0
- package/dist/core/data.js.map +1 -0
- package/dist/core/deadline.d.ts +12 -0
- package/dist/core/deadline.d.ts.map +1 -0
- package/dist/core/deadline.js +38 -0
- package/dist/core/deadline.js.map +1 -0
- package/dist/core/errors.d.ts +7 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +15 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/files.d.ts +8 -0
- package/dist/core/files.d.ts.map +1 -0
- package/dist/core/files.js +98 -0
- package/dist/core/files.js.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/limits.d.ts +15 -0
- package/dist/core/limits.d.ts.map +1 -0
- package/dist/core/limits.js +15 -0
- package/dist/core/limits.js.map +1 -0
- package/dist/core/modules.d.ts +3 -0
- package/dist/core/modules.d.ts.map +1 -0
- package/dist/core/modules.js +68 -0
- package/dist/core/modules.js.map +1 -0
- package/dist/core/operation.d.ts +18 -0
- package/dist/core/operation.d.ts.map +1 -0
- package/dist/core/operation.js +21 -0
- package/dist/core/operation.js.map +1 -0
- package/dist/core/process.d.ts +3 -0
- package/dist/core/process.d.ts.map +1 -0
- package/dist/core/process.js +44 -0
- package/dist/core/process.js.map +1 -0
- package/dist/core/resources.d.ts +3 -0
- package/dist/core/resources.d.ts.map +1 -0
- package/dist/core/resources.js +28 -0
- package/dist/core/resources.js.map +1 -0
- package/dist/core/runtime.d.ts +54 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js +565 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/core/types.d.ts +61 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +1 -0
- package/dist/core/types.js.map +1 -0
- package/dist/diagnostics/source-location.d.ts +7 -0
- package/dist/diagnostics/source-location.d.ts.map +1 -0
- package/dist/diagnostics/source-location.js +1 -0
- package/dist/diagnostics/source-location.js.map +1 -0
- package/dist/engine/instance.d.ts +57 -0
- package/dist/engine/instance.d.ts.map +1 -0
- package/dist/engine/instance.js +281 -0
- package/dist/engine/instance.js.map +1 -0
- package/dist/engine.d.ts +5 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +6 -0
- package/dist/engine.js.map +1 -0
- package/dist/fixtures/module.d.ts +5 -0
- package/dist/fixtures/module.d.ts.map +1 -0
- package/dist/fixtures/module.js +112 -0
- package/dist/fixtures/module.js.map +1 -0
- package/dist/fixtures/types.d.ts +7 -0
- package/dist/fixtures/types.d.ts.map +1 -0
- package/dist/fixtures/types.js +1 -0
- package/dist/fixtures/types.js.map +1 -0
- package/dist/harness/configuration.d.ts +53 -0
- package/dist/harness/configuration.d.ts.map +1 -0
- package/dist/harness/configuration.js +279 -0
- package/dist/harness/configuration.js.map +1 -0
- package/dist/harness/create.d.ts +5 -0
- package/dist/harness/create.d.ts.map +1 -0
- package/dist/harness/create.js +156 -0
- package/dist/harness/create.js.map +1 -0
- package/dist/harness/extensions.d.ts +8 -0
- package/dist/harness/extensions.d.ts.map +1 -0
- package/dist/harness/extensions.js +58 -0
- package/dist/harness/extensions.js.map +1 -0
- package/dist/harness/fixtures.d.ts +9 -0
- package/dist/harness/fixtures.d.ts.map +1 -0
- package/dist/harness/fixtures.js +130 -0
- package/dist/harness/fixtures.js.map +1 -0
- package/dist/harness/runtime-identity.d.ts +3 -0
- package/dist/harness/runtime-identity.d.ts.map +1 -0
- package/dist/harness/runtime-identity.js +30 -0
- package/dist/harness/runtime-identity.js.map +1 -0
- package/dist/harness/setup-cache.d.ts +11 -0
- package/dist/harness/setup-cache.d.ts.map +1 -0
- package/dist/harness/setup-cache.js +40 -0
- package/dist/harness/setup-cache.js.map +1 -0
- package/dist/harness/setup-image.d.ts +5 -0
- package/dist/harness/setup-image.d.ts.map +1 -0
- package/dist/harness/setup-image.js +118 -0
- package/dist/harness/setup-image.js.map +1 -0
- package/dist/harness/setup-imports.d.ts +3 -0
- package/dist/harness/setup-imports.d.ts.map +1 -0
- package/dist/harness/setup-imports.js +30 -0
- package/dist/harness/setup-imports.js.map +1 -0
- package/dist/harness/setup-inputs.d.ts +12 -0
- package/dist/harness/setup-inputs.d.ts.map +1 -0
- package/dist/harness/setup-inputs.js +47 -0
- package/dist/harness/setup-inputs.js.map +1 -0
- package/dist/harness/setup-module.d.ts +3 -0
- package/dist/harness/setup-module.d.ts.map +1 -0
- package/dist/harness/setup-module.js +150 -0
- package/dist/harness/setup-module.js.map +1 -0
- package/dist/harness/world.d.ts +36 -0
- package/dist/harness/world.d.ts.map +1 -0
- package/dist/harness/world.js +171 -0
- package/dist/harness/world.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/instrumentation/failures.d.ts +5 -0
- package/dist/instrumentation/failures.d.ts.map +1 -0
- package/dist/instrumentation/failures.js +94 -0
- package/dist/instrumentation/failures.js.map +1 -0
- package/dist/instrumentation/recorder.d.ts +38 -0
- package/dist/instrumentation/recorder.d.ts.map +1 -0
- package/dist/instrumentation/recorder.js +372 -0
- package/dist/instrumentation/recorder.js.map +1 -0
- package/dist/instrumentation/snapshots.d.ts +20 -0
- package/dist/instrumentation/snapshots.d.ts.map +1 -0
- package/dist/instrumentation/snapshots.js +177 -0
- package/dist/instrumentation/snapshots.js.map +1 -0
- package/dist/instrumentation/types.d.ts +107 -0
- package/dist/instrumentation/types.d.ts.map +1 -0
- package/dist/instrumentation/types.js +25 -0
- package/dist/instrumentation/types.js.map +1 -0
- package/dist/items/codec.d.ts +4 -0
- package/dist/items/codec.d.ts.map +1 -0
- package/dist/items/codec.js +137 -0
- package/dist/items/codec.js.map +1 -0
- package/dist/items/item.d.ts +58 -0
- package/dist/items/item.d.ts.map +1 -0
- package/dist/items/item.js +145 -0
- package/dist/items/item.js.map +1 -0
- package/dist/items/logical.d.ts +23 -0
- package/dist/items/logical.d.ts.map +1 -0
- package/dist/items/logical.js +92 -0
- package/dist/items/logical.js.map +1 -0
- package/dist/items/origins.d.ts +7 -0
- package/dist/items/origins.d.ts.map +1 -0
- package/dist/items/origins.js +102 -0
- package/dist/items/origins.js.map +1 -0
- package/dist/items/xml.d.ts +7 -0
- package/dist/items/xml.d.ts.map +1 -0
- package/dist/items/xml.js +134 -0
- package/dist/items/xml.js.map +1 -0
- package/dist/methods/csharp/base-input.d.ts +30 -0
- package/dist/methods/csharp/base-input.d.ts.map +1 -0
- package/dist/methods/csharp/base-input.js +140 -0
- package/dist/methods/csharp/base-input.js.map +1 -0
- package/dist/methods/csharp/cache.d.ts +3 -0
- package/dist/methods/csharp/cache.d.ts.map +1 -0
- package/dist/methods/csharp/cache.js +52 -0
- package/dist/methods/csharp/cache.js.map +1 -0
- package/dist/methods/csharp/callbacks.d.ts +12 -0
- package/dist/methods/csharp/callbacks.d.ts.map +1 -0
- package/dist/methods/csharp/callbacks.js +75 -0
- package/dist/methods/csharp/callbacks.js.map +1 -0
- package/dist/methods/csharp/compiler.d.ts +26 -0
- package/dist/methods/csharp/compiler.d.ts.map +1 -0
- package/dist/methods/csharp/compiler.js +253 -0
- package/dist/methods/csharp/compiler.js.map +1 -0
- package/dist/methods/csharp/context.d.ts +17 -0
- package/dist/methods/csharp/context.d.ts.map +1 -0
- package/dist/methods/csharp/context.js +65 -0
- package/dist/methods/csharp/context.js.map +1 -0
- package/dist/methods/csharp/documents.d.ts +13 -0
- package/dist/methods/csharp/documents.d.ts.map +1 -0
- package/dist/methods/csharp/documents.js +128 -0
- package/dist/methods/csharp/documents.js.map +1 -0
- package/dist/methods/csharp/executor.d.ts +35 -0
- package/dist/methods/csharp/executor.d.ts.map +1 -0
- package/dist/methods/csharp/executor.js +363 -0
- package/dist/methods/csharp/executor.js.map +1 -0
- package/dist/methods/csharp/index.d.ts +4 -0
- package/dist/methods/csharp/index.d.ts.map +1 -0
- package/dist/methods/csharp/index.js +3 -0
- package/dist/methods/csharp/index.js.map +1 -0
- package/dist/methods/csharp/managed/CallContext.cs +21 -0
- package/dist/methods/csharp/managed/Connections.cs +27 -0
- package/dist/methods/csharp/managed/ContextSafety.cs +219 -0
- package/dist/methods/csharp/managed/DomChanges.cs +39 -0
- package/dist/methods/csharp/managed/ErrorLookup.cs +28 -0
- package/dist/methods/csharp/managed/EventMetadata.cs +45 -0
- package/dist/methods/csharp/managed/GlobalUsings.cs.template +9 -0
- package/dist/methods/csharp/managed/Identity.cs +30 -0
- package/dist/methods/csharp/managed/InOut.cs.template +42 -0
- package/dist/methods/csharp/managed/InOutInvocation.cs +41 -0
- package/dist/methods/csharp/managed/Innovator.cs +106 -0
- package/dist/methods/csharp/managed/Item.cs +515 -0
- package/dist/methods/csharp/managed/ItemDocuments.cs +62 -0
- package/dist/methods/csharp/managed/ItemXml.cs +465 -0
- package/dist/methods/csharp/managed/LogicalData.cs +20 -0
- package/dist/methods/csharp/managed/LogicalXml.cs +181 -0
- package/dist/methods/csharp/managed/ManagedDocuments.cs +48 -0
- package/dist/methods/csharp/managed/Method.cs.template +30 -0
- package/dist/methods/csharp/managed/MethodAssemblies.cs +83 -0
- package/dist/methods/csharp/managed/MethodContext.cs +44 -0
- package/dist/methods/csharp/managed/MethodEventArgs.cs +64 -0
- package/dist/methods/csharp/managed/MethodInvocation.cs +201 -0
- package/dist/methods/csharp/managed/NuGet.Config +6 -0
- package/dist/methods/csharp/managed/PayloadXml.cs +38 -0
- package/dist/methods/csharp/managed/Permissions.cs +47 -0
- package/dist/methods/csharp/managed/Program.cs +83 -0
- package/dist/methods/csharp/managed/PropertyItems.cs +46 -0
- package/dist/methods/csharp/managed/Protocol.cs +204 -0
- package/dist/methods/csharp/managed/ProtocolInput.cs +67 -0
- package/dist/methods/csharp/managed/ProtocolJson.cs +13 -0
- package/dist/methods/csharp/managed/RemoteContext.cs +33 -0
- package/dist/methods/csharp/managed/RequestOrigins.cs +207 -0
- package/dist/methods/csharp/managed/RequestRelationships.cs +129 -0
- package/dist/methods/csharp/managed/RequestXml.cs +237 -0
- package/dist/methods/csharp/managed/ResponseXml.cs +114 -0
- package/dist/methods/csharp/managed/ServerEventArgs.cs +223 -0
- package/dist/methods/csharp/managed/WorkLimits.cs +11 -0
- package/dist/methods/csharp/managed/Worker.csproj +23 -0
- package/dist/methods/csharp/managed/XmlProperties.cs +32 -0
- package/dist/methods/csharp/managed/XmlTraversal.cs +138 -0
- package/dist/methods/csharp/method-build.d.ts +11 -0
- package/dist/methods/csharp/method-build.d.ts.map +1 -0
- package/dist/methods/csharp/method-build.js +96 -0
- package/dist/methods/csharp/method-build.js.map +1 -0
- package/dist/methods/csharp/origins.d.ts +17 -0
- package/dist/methods/csharp/origins.d.ts.map +1 -0
- package/dist/methods/csharp/origins.js +78 -0
- package/dist/methods/csharp/origins.js.map +1 -0
- package/dist/methods/csharp/protocol.d.ts +6 -0
- package/dist/methods/csharp/protocol.d.ts.map +1 -0
- package/dist/methods/csharp/protocol.js +78 -0
- package/dist/methods/csharp/protocol.js.map +1 -0
- package/dist/methods/csharp/relationship-order.d.ts +8 -0
- package/dist/methods/csharp/relationship-order.d.ts.map +1 -0
- package/dist/methods/csharp/relationship-order.js +51 -0
- package/dist/methods/csharp/relationship-order.js.map +1 -0
- package/dist/methods/csharp/request-change.d.ts +27 -0
- package/dist/methods/csharp/request-change.d.ts.map +1 -0
- package/dist/methods/csharp/request-change.js +238 -0
- package/dist/methods/csharp/request-change.js.map +1 -0
- package/dist/methods/csharp/retained-items.d.ts +9 -0
- package/dist/methods/csharp/retained-items.d.ts.map +1 -0
- package/dist/methods/csharp/retained-items.js +95 -0
- package/dist/methods/csharp/retained-items.js.map +1 -0
- package/dist/methods/csharp/security.d.ts +13 -0
- package/dist/methods/csharp/security.d.ts.map +1 -0
- package/dist/methods/csharp/security.js +82 -0
- package/dist/methods/csharp/security.js.map +1 -0
- package/dist/methods/csharp/templates.d.ts +5 -0
- package/dist/methods/csharp/templates.d.ts.map +1 -0
- package/dist/methods/csharp/templates.js +66 -0
- package/dist/methods/csharp/templates.js.map +1 -0
- package/dist/methods/csharp/worker.d.ts +31 -0
- package/dist/methods/csharp/worker.d.ts.map +1 -0
- package/dist/methods/csharp/worker.js +172 -0
- package/dist/methods/csharp/worker.js.map +1 -0
- package/dist/methods/event-data.d.ts +31 -0
- package/dist/methods/event-data.d.ts.map +1 -0
- package/dist/methods/event-data.js +8 -0
- package/dist/methods/event-data.js.map +1 -0
- package/dist/methods/types.d.ts +47 -0
- package/dist/methods/types.d.ts.map +1 -0
- package/dist/methods/types.js +2 -0
- package/dist/methods/types.js.map +1 -0
- package/dist/mocks/configuration.d.ts +5 -0
- package/dist/mocks/configuration.d.ts.map +1 -0
- package/dist/mocks/configuration.js +102 -0
- package/dist/mocks/configuration.js.map +1 -0
- package/dist/mocks/parameters.d.ts +3 -0
- package/dist/mocks/parameters.d.ts.map +1 -0
- package/dist/mocks/parameters.js +16 -0
- package/dist/mocks/parameters.js.map +1 -0
- package/dist/mocks/registry.d.ts +39 -0
- package/dist/mocks/registry.d.ts.map +1 -0
- package/dist/mocks/registry.js +129 -0
- package/dist/mocks/registry.js.map +1 -0
- package/dist/mocks/response.d.ts +10 -0
- package/dist/mocks/response.d.ts.map +1 -0
- package/dist/mocks/response.js +94 -0
- package/dist/mocks/response.js.map +1 -0
- package/dist/mocks/types.d.ts +34 -0
- package/dist/mocks/types.d.ts.map +1 -0
- package/dist/mocks/types.js +1 -0
- package/dist/mocks/types.js.map +1 -0
- package/dist/packages/bootstrap.d.ts +10 -0
- package/dist/packages/bootstrap.d.ts.map +1 -0
- package/dist/packages/bootstrap.js +66 -0
- package/dist/packages/bootstrap.js.map +1 -0
- package/dist/packages/candidates.d.ts +13 -0
- package/dist/packages/candidates.d.ts.map +1 -0
- package/dist/packages/candidates.js +43 -0
- package/dist/packages/candidates.js.map +1 -0
- package/dist/packages/defaults.d.ts +11 -0
- package/dist/packages/defaults.d.ts.map +1 -0
- package/dist/packages/defaults.js +104 -0
- package/dist/packages/defaults.js.map +1 -0
- package/dist/packages/diagnostics.d.ts +22 -0
- package/dist/packages/diagnostics.d.ts.map +1 -0
- package/dist/packages/diagnostics.js +25 -0
- package/dist/packages/diagnostics.js.map +1 -0
- package/dist/packages/draft.d.ts +66 -0
- package/dist/packages/draft.d.ts.map +1 -0
- package/dist/packages/draft.js +186 -0
- package/dist/packages/draft.js.map +1 -0
- package/dist/packages/elements.d.ts +11 -0
- package/dist/packages/elements.d.ts.map +1 -0
- package/dist/packages/elements.js +58 -0
- package/dist/packages/elements.js.map +1 -0
- package/dist/packages/evaluation.d.ts +16 -0
- package/dist/packages/evaluation.d.ts.map +1 -0
- package/dist/packages/evaluation.js +71 -0
- package/dist/packages/evaluation.js.map +1 -0
- package/dist/packages/files.d.ts +21 -0
- package/dist/packages/files.d.ts.map +1 -0
- package/dist/packages/files.js +214 -0
- package/dist/packages/files.js.map +1 -0
- package/dist/packages/importer.d.ts +23 -0
- package/dist/packages/importer.d.ts.map +1 -0
- package/dist/packages/importer.js +791 -0
- package/dist/packages/importer.js.map +1 -0
- package/dist/packages/index.d.ts +8 -0
- package/dist/packages/index.d.ts.map +1 -0
- package/dist/packages/index.js +6 -0
- package/dist/packages/index.js.map +1 -0
- package/dist/packages/manifest.d.ts +3 -0
- package/dist/packages/manifest.d.ts.map +1 -0
- package/dist/packages/manifest.js +84 -0
- package/dist/packages/manifest.js.map +1 -0
- package/dist/packages/module.d.ts +11 -0
- package/dist/packages/module.d.ts.map +1 -0
- package/dist/packages/module.js +14 -0
- package/dist/packages/module.js.map +1 -0
- package/dist/packages/parser.d.ts +12 -0
- package/dist/packages/parser.d.ts.map +1 -0
- package/dist/packages/parser.js +258 -0
- package/dist/packages/parser.js.map +1 -0
- package/dist/packages/plan.d.ts +55 -0
- package/dist/packages/plan.d.ts.map +1 -0
- package/dist/packages/plan.js +542 -0
- package/dist/packages/plan.js.map +1 -0
- package/dist/packages/schema.d.ts +9 -0
- package/dist/packages/schema.d.ts.map +1 -0
- package/dist/packages/schema.js +347 -0
- package/dist/packages/schema.js.map +1 -0
- package/dist/packages/selector.d.ts +9 -0
- package/dist/packages/selector.d.ts.map +1 -0
- package/dist/packages/selector.js +61 -0
- package/dist/packages/selector.js.map +1 -0
- package/dist/packages/state.d.ts +6 -0
- package/dist/packages/state.d.ts.map +1 -0
- package/dist/packages/state.js +62 -0
- package/dist/packages/state.js.map +1 -0
- package/dist/packages/types.d.ts +22 -0
- package/dist/packages/types.d.ts.map +1 -0
- package/dist/packages/types.js +1 -0
- package/dist/packages/types.js.map +1 -0
- package/dist/platform/action-responses.d.ts +14 -0
- package/dist/platform/action-responses.d.ts.map +1 -0
- package/dist/platform/action-responses.js +85 -0
- package/dist/platform/action-responses.js.map +1 -0
- package/dist/platform/actions.d.ts +12 -0
- package/dist/platform/actions.d.ts.map +1 -0
- package/dist/platform/actions.js +13 -0
- package/dist/platform/actions.js.map +1 -0
- package/dist/platform/catalog.d.ts +20 -0
- package/dist/platform/catalog.d.ts.map +1 -0
- package/dist/platform/catalog.js +155 -0
- package/dist/platform/catalog.js.map +1 -0
- package/dist/platform/classifications.d.ts +14 -0
- package/dist/platform/classifications.d.ts.map +1 -0
- package/dist/platform/classifications.js +100 -0
- package/dist/platform/classifications.js.map +1 -0
- package/dist/platform/creation.d.ts +4 -0
- package/dist/platform/creation.d.ts.map +1 -0
- package/dist/platform/creation.js +23 -0
- package/dist/platform/creation.js.map +1 -0
- package/dist/platform/engine.d.ts +127 -0
- package/dist/platform/engine.d.ts.map +1 -0
- package/dist/platform/engine.js +1210 -0
- package/dist/platform/engine.js.map +1 -0
- package/dist/platform/errors.d.ts +20 -0
- package/dist/platform/errors.d.ts.map +1 -0
- package/dist/platform/errors.js +28 -0
- package/dist/platform/errors.js.map +1 -0
- package/dist/platform/events/after.d.ts +22 -0
- package/dist/platform/events/after.d.ts.map +1 -0
- package/dist/platform/events/after.js +86 -0
- package/dist/platform/events/after.js.map +1 -0
- package/dist/platform/events/base-updates.d.ts +11 -0
- package/dist/platform/events/base-updates.d.ts.map +1 -0
- package/dist/platform/events/base-updates.js +43 -0
- package/dist/platform/events/base-updates.js.map +1 -0
- package/dist/platform/events/bindings.d.ts +13 -0
- package/dist/platform/events/bindings.d.ts.map +1 -0
- package/dist/platform/events/bindings.js +76 -0
- package/dist/platform/events/bindings.js.map +1 -0
- package/dist/platform/events/data.d.ts +5 -0
- package/dist/platform/events/data.d.ts.map +1 -0
- package/dist/platform/events/data.js +17 -0
- package/dist/platform/events/data.js.map +1 -0
- package/dist/platform/events/inheritance.d.ts +4 -0
- package/dist/platform/events/inheritance.d.ts.map +1 -0
- package/dist/platform/events/inheritance.js +56 -0
- package/dist/platform/events/inheritance.js.map +1 -0
- package/dist/platform/events/input.d.ts +5 -0
- package/dist/platform/events/input.d.ts.map +1 -0
- package/dist/platform/events/input.js +9 -0
- package/dist/platform/events/input.js.map +1 -0
- package/dist/platform/events/replacement.d.ts +14 -0
- package/dist/platform/events/replacement.d.ts.map +1 -0
- package/dist/platform/events/replacement.js +60 -0
- package/dist/platform/events/replacement.js.map +1 -0
- package/dist/platform/events/types.d.ts +31 -0
- package/dist/platform/events/types.d.ts.map +1 -0
- package/dist/platform/events/types.js +6 -0
- package/dist/platform/events/types.js.map +1 -0
- package/dist/platform/events/version.d.ts +5 -0
- package/dist/platform/events/version.d.ts.map +1 -0
- package/dist/platform/events/version.js +22 -0
- package/dist/platform/events/version.js.map +1 -0
- package/dist/platform/graph-actions.d.ts +18 -0
- package/dist/platform/graph-actions.d.ts.map +1 -0
- package/dist/platform/graph-actions.js +109 -0
- package/dist/platform/graph-actions.js.map +1 -0
- package/dist/platform/lifecycle.d.ts +40 -0
- package/dist/platform/lifecycle.d.ts.map +1 -0
- package/dist/platform/lifecycle.js +309 -0
- package/dist/platform/lifecycle.js.map +1 -0
- package/dist/platform/locks.d.ts +29 -0
- package/dist/platform/locks.d.ts.map +1 -0
- package/dist/platform/locks.js +150 -0
- package/dist/platform/locks.js.map +1 -0
- package/dist/platform/projection.d.ts +8 -0
- package/dist/platform/projection.d.ts.map +1 -0
- package/dist/platform/projection.js +165 -0
- package/dist/platform/projection.js.map +1 -0
- package/dist/platform/queries/conditions.d.ts +4 -0
- package/dist/platform/queries/conditions.d.ts.map +1 -0
- package/dist/platform/queries/conditions.js +48 -0
- package/dist/platform/queries/conditions.js.map +1 -0
- package/dist/platform/queries/engine.d.ts +16 -0
- package/dist/platform/queries/engine.d.ts.map +1 -0
- package/dist/platform/queries/engine.js +41 -0
- package/dist/platform/queries/engine.js.map +1 -0
- package/dist/platform/queries/fields.d.ts +7 -0
- package/dist/platform/queries/fields.d.ts.map +1 -0
- package/dist/platform/queries/fields.js +88 -0
- package/dist/platform/queries/fields.js.map +1 -0
- package/dist/platform/queries/order.d.ts +5 -0
- package/dist/platform/queries/order.d.ts.map +1 -0
- package/dist/platform/queries/order.js +69 -0
- package/dist/platform/queries/order.js.map +1 -0
- package/dist/platform/queries/paging.d.ts +9 -0
- package/dist/platform/queries/paging.d.ts.map +1 -0
- package/dist/platform/queries/paging.js +39 -0
- package/dist/platform/queries/paging.js.map +1 -0
- package/dist/platform/queries/planner.d.ts +8 -0
- package/dist/platform/queries/planner.d.ts.map +1 -0
- package/dist/platform/queries/planner.js +145 -0
- package/dist/platform/queries/planner.js.map +1 -0
- package/dist/platform/queries/relationships.d.ts +16 -0
- package/dist/platform/queries/relationships.d.ts.map +1 -0
- package/dist/platform/queries/relationships.js +84 -0
- package/dist/platform/queries/relationships.js.map +1 -0
- package/dist/platform/queries/validation.d.ts +5 -0
- package/dist/platform/queries/validation.d.ts.map +1 -0
- package/dist/platform/queries/validation.js +79 -0
- package/dist/platform/queries/validation.js.map +1 -0
- package/dist/platform/query.d.ts +10 -0
- package/dist/platform/query.d.ts.map +1 -0
- package/dist/platform/query.js +93 -0
- package/dist/platform/query.js.map +1 -0
- package/dist/platform/references/behavior.d.ts +11 -0
- package/dist/platform/references/behavior.d.ts.map +1 -0
- package/dist/platform/references/behavior.js +25 -0
- package/dist/platform/references/behavior.js.map +1 -0
- package/dist/platform/references/catalog.d.ts +23 -0
- package/dist/platform/references/catalog.d.ts.map +1 -0
- package/dist/platform/references/catalog.js +153 -0
- package/dist/platform/references/catalog.js.map +1 -0
- package/dist/platform/references/deletion.d.ts +20 -0
- package/dist/platform/references/deletion.d.ts.map +1 -0
- package/dist/platform/references/deletion.js +86 -0
- package/dist/platform/references/deletion.js.map +1 -0
- package/dist/platform/references/maintenance.d.ts +22 -0
- package/dist/platform/references/maintenance.d.ts.map +1 -0
- package/dist/platform/references/maintenance.js +113 -0
- package/dist/platform/references/maintenance.js.map +1 -0
- package/dist/platform/references/policy.d.ts +14 -0
- package/dist/platform/references/policy.d.ts.map +1 -0
- package/dist/platform/references/policy.js +76 -0
- package/dist/platform/references/policy.js.map +1 -0
- package/dist/platform/references/sessions.d.ts +20 -0
- package/dist/platform/references/sessions.d.ts.map +1 -0
- package/dist/platform/references/sessions.js +98 -0
- package/dist/platform/references/sessions.js.map +1 -0
- package/dist/platform/relationship-copy-policy.d.ts +10 -0
- package/dist/platform/relationship-copy-policy.d.ts.map +1 -0
- package/dist/platform/relationship-copy-policy.js +41 -0
- package/dist/platform/relationship-copy-policy.js.map +1 -0
- package/dist/platform/relationship-copy.d.ts +21 -0
- package/dist/platform/relationship-copy.d.ts.map +1 -0
- package/dist/platform/relationship-copy.js +146 -0
- package/dist/platform/relationship-copy.js.map +1 -0
- package/dist/platform/relationship-type.d.ts +3 -0
- package/dist/platform/relationship-type.d.ts.map +1 -0
- package/dist/platform/relationship-type.js +11 -0
- package/dist/platform/relationship-type.js.map +1 -0
- package/dist/platform/request.d.ts +7 -0
- package/dist/platform/request.d.ts.map +1 -0
- package/dist/platform/request.js +86 -0
- package/dist/platform/request.js.map +1 -0
- package/dist/platform/revisions/policy.d.ts +13 -0
- package/dist/platform/revisions/policy.d.ts.map +1 -0
- package/dist/platform/revisions/policy.js +69 -0
- package/dist/platform/revisions/policy.js.map +1 -0
- package/dist/platform/revisions/sequences.d.ts +12 -0
- package/dist/platform/revisions/sequences.d.ts.map +1 -0
- package/dist/platform/revisions/sequences.js +38 -0
- package/dist/platform/revisions/sequences.js.map +1 -0
- package/dist/platform/security/grants.d.ts +14 -0
- package/dist/platform/security/grants.d.ts.map +1 -0
- package/dist/platform/security/grants.js +83 -0
- package/dist/platform/security/grants.js.map +1 -0
- package/dist/platform/security/identities.d.ts +16 -0
- package/dist/platform/security/identities.d.ts.map +1 -0
- package/dist/platform/security/identities.js +99 -0
- package/dist/platform/security/identities.js.map +1 -0
- package/dist/platform/security/inherited-relationships.d.ts +15 -0
- package/dist/platform/security/inherited-relationships.d.ts.map +1 -0
- package/dist/platform/security/inherited-relationships.js +70 -0
- package/dist/platform/security/inherited-relationships.js.map +1 -0
- package/dist/platform/security/method-execution.d.ts +12 -0
- package/dist/platform/security/method-execution.d.ts.map +1 -0
- package/dist/platform/security/method-execution.js +24 -0
- package/dist/platform/security/method-execution.js.map +1 -0
- package/dist/platform/security/permissions.d.ts +34 -0
- package/dist/platform/security/permissions.d.ts.map +1 -0
- package/dist/platform/security/permissions.js +188 -0
- package/dist/platform/security/permissions.js.map +1 -0
- package/dist/platform/security/policy.d.ts +39 -0
- package/dist/platform/security/policy.d.ts.map +1 -0
- package/dist/platform/security/policy.js +168 -0
- package/dist/platform/security/policy.js.map +1 -0
- package/dist/platform/security/source-access.d.ts +19 -0
- package/dist/platform/security/source-access.d.ts.map +1 -0
- package/dist/platform/security/source-access.js +72 -0
- package/dist/platform/security/source-access.js.map +1 -0
- package/dist/platform/security/source-inheritance.d.ts +19 -0
- package/dist/platform/security/source-inheritance.d.ts.map +1 -0
- package/dist/platform/security/source-inheritance.js +87 -0
- package/dist/platform/security/source-inheritance.js.map +1 -0
- package/dist/platform/security/system-identities.d.ts +4 -0
- package/dist/platform/security/system-identities.d.ts.map +1 -0
- package/dist/platform/security/system-identities.js +12 -0
- package/dist/platform/security/system-identities.js.map +1 -0
- package/dist/platform/security/teams.d.ts +15 -0
- package/dist/platform/security/teams.d.ts.map +1 -0
- package/dist/platform/security/teams.js +68 -0
- package/dist/platform/security/teams.js.map +1 -0
- package/dist/platform/security/time.d.ts +4 -0
- package/dist/platform/security/time.d.ts.map +1 -0
- package/dist/platform/security/time.js +26 -0
- package/dist/platform/security/time.js.map +1 -0
- package/dist/platform/security/types.d.ts +12 -0
- package/dist/platform/security/types.d.ts.map +1 -0
- package/dist/platform/security/types.js +6 -0
- package/dist/platform/security/types.js.map +1 -0
- package/dist/platform/trace.d.ts +41 -0
- package/dist/platform/trace.d.ts.map +1 -0
- package/dist/platform/trace.js +46 -0
- package/dist/platform/trace.js.map +1 -0
- package/dist/platform/unlocking.d.ts +27 -0
- package/dist/platform/unlocking.d.ts.map +1 -0
- package/dist/platform/unlocking.js +192 -0
- package/dist/platform/unlocking.js.map +1 -0
- package/dist/platform/values.d.ts +17 -0
- package/dist/platform/values.d.ts.map +1 -0
- package/dist/platform/values.js +105 -0
- package/dist/platform/values.js.map +1 -0
- package/dist/platform/version-policy.d.ts +4 -0
- package/dist/platform/version-policy.d.ts.map +1 -0
- package/dist/platform/version-policy.js +11 -0
- package/dist/platform/version-policy.js.map +1 -0
- package/dist/platform/versioned-request.d.ts +18 -0
- package/dist/platform/versioned-request.d.ts.map +1 -0
- package/dist/platform/versioned-request.js +95 -0
- package/dist/platform/versioned-request.js.map +1 -0
- package/dist/platform/versioning.d.ts +57 -0
- package/dist/platform/versioning.d.ts.map +1 -0
- package/dist/platform/versioning.js +441 -0
- package/dist/platform/versioning.js.map +1 -0
- package/dist/queries/date.d.ts +3 -0
- package/dist/queries/date.d.ts.map +1 -0
- package/dist/queries/date.js +20 -0
- package/dist/queries/date.js.map +1 -0
- package/dist/queries/decimal.d.ts +9 -0
- package/dist/queries/decimal.d.ts.map +1 -0
- package/dist/queries/decimal.js +42 -0
- package/dist/queries/decimal.js.map +1 -0
- package/dist/queries/evaluate.d.ts +9 -0
- package/dist/queries/evaluate.d.ts.map +1 -0
- package/dist/queries/evaluate.js +122 -0
- package/dist/queries/evaluate.js.map +1 -0
- package/dist/queries/lexer.d.ts +14 -0
- package/dist/queries/lexer.d.ts.map +1 -0
- package/dist/queries/lexer.js +87 -0
- package/dist/queries/lexer.js.map +1 -0
- package/dist/queries/like.d.ts +3 -0
- package/dist/queries/like.d.ts.map +1 -0
- package/dist/queries/like.js +35 -0
- package/dist/queries/like.js.map +1 -0
- package/dist/queries/parser.d.ts +28 -0
- package/dist/queries/parser.d.ts.map +1 -0
- package/dist/queries/parser.js +271 -0
- package/dist/queries/parser.js.map +1 -0
- package/dist/queries/predicates.d.ts +7 -0
- package/dist/queries/predicates.d.ts.map +1 -0
- package/dist/queries/predicates.js +62 -0
- package/dist/queries/predicates.js.map +1 -0
- package/dist/queries/types.d.ts +65 -0
- package/dist/queries/types.d.ts.map +1 -0
- package/dist/queries/types.js +25 -0
- package/dist/queries/types.js.map +1 -0
- package/dist/queries/values.d.ts +5 -0
- package/dist/queries/values.d.ts.map +1 -0
- package/dist/queries/values.js +77 -0
- package/dist/queries/values.js.map +1 -0
- package/dist/storage/documents.d.ts +5 -0
- package/dist/storage/documents.d.ts.map +1 -0
- package/dist/storage/documents.js +12 -0
- package/dist/storage/documents.js.map +1 -0
- package/dist/storage/metadata-epoch.d.ts +6 -0
- package/dist/storage/metadata-epoch.d.ts.map +1 -0
- package/dist/storage/metadata-epoch.js +15 -0
- package/dist/storage/metadata-epoch.js.map +1 -0
- package/dist/storage/package-transaction.d.ts +5 -0
- package/dist/storage/package-transaction.d.ts.map +1 -0
- package/dist/storage/package-transaction.js +12 -0
- package/dist/storage/package-transaction.js.map +1 -0
- package/dist/storage/properties.d.ts +4 -0
- package/dist/storage/properties.d.ts.map +1 -0
- package/dist/storage/properties.js +21 -0
- package/dist/storage/properties.js.map +1 -0
- package/dist/storage/sqlite/catalog.d.ts +19 -0
- package/dist/storage/sqlite/catalog.d.ts.map +1 -0
- package/dist/storage/sqlite/catalog.js +62 -0
- package/dist/storage/sqlite/catalog.js.map +1 -0
- package/dist/storage/sqlite/connections.d.ts +5 -0
- package/dist/storage/sqlite/connections.d.ts.map +1 -0
- package/dist/storage/sqlite/connections.js +36 -0
- package/dist/storage/sqlite/connections.js.map +1 -0
- package/dist/storage/sqlite/errors.d.ts +7 -0
- package/dist/storage/sqlite/errors.d.ts.map +1 -0
- package/dist/storage/sqlite/errors.js +9 -0
- package/dist/storage/sqlite/errors.js.map +1 -0
- package/dist/storage/sqlite/index.d.ts +5 -0
- package/dist/storage/sqlite/index.d.ts.map +1 -0
- package/dist/storage/sqlite/index.js +3 -0
- package/dist/storage/sqlite/index.js.map +1 -0
- package/dist/storage/sqlite/metadata.d.ts +8 -0
- package/dist/storage/sqlite/metadata.d.ts.map +1 -0
- package/dist/storage/sqlite/metadata.js +157 -0
- package/dist/storage/sqlite/metadata.js.map +1 -0
- package/dist/storage/sqlite/predicate.d.ts +9 -0
- package/dist/storage/sqlite/predicate.d.ts.map +1 -0
- package/dist/storage/sqlite/predicate.js +214 -0
- package/dist/storage/sqlite/predicate.js.map +1 -0
- package/dist/storage/sqlite/queries.d.ts +12 -0
- package/dist/storage/sqlite/queries.d.ts.map +1 -0
- package/dist/storage/sqlite/queries.js +30 -0
- package/dist/storage/sqlite/queries.js.map +1 -0
- package/dist/storage/sqlite/schema.d.ts +16 -0
- package/dist/storage/sqlite/schema.d.ts.map +1 -0
- package/dist/storage/sqlite/schema.js +197 -0
- package/dist/storage/sqlite/schema.js.map +1 -0
- package/dist/storage/sqlite/statements.d.ts +13 -0
- package/dist/storage/sqlite/statements.d.ts.map +1 -0
- package/dist/storage/sqlite/statements.js +35 -0
- package/dist/storage/sqlite/statements.js.map +1 -0
- package/dist/storage/sqlite/storage.d.ts +61 -0
- package/dist/storage/sqlite/storage.d.ts.map +1 -0
- package/dist/storage/sqlite/storage.js +644 -0
- package/dist/storage/sqlite/storage.js.map +1 -0
- package/dist/storage/sqlite/transactions.d.ts +23 -0
- package/dist/storage/sqlite/transactions.d.ts.map +1 -0
- package/dist/storage/sqlite/transactions.js +84 -0
- package/dist/storage/sqlite/transactions.js.map +1 -0
- package/dist/storage/types.d.ts +62 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +1 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/verification/diagnostics.d.ts +4 -0
- package/dist/verification/diagnostics.d.ts.map +1 -0
- package/dist/verification/diagnostics.js +106 -0
- package/dist/verification/diagnostics.js.map +1 -0
- package/dist/verification/index.d.ts +4 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +3 -0
- package/dist/verification/index.js.map +1 -0
- package/dist/verification/inspection.d.ts +13 -0
- package/dist/verification/inspection.d.ts.map +1 -0
- package/dist/verification/inspection.js +87 -0
- package/dist/verification/inspection.js.map +1 -0
- package/dist/verification/inventory.d.ts +7 -0
- package/dist/verification/inventory.d.ts.map +1 -0
- package/dist/verification/inventory.js +55 -0
- package/dist/verification/inventory.js.map +1 -0
- package/dist/verification/types.d.ts +53 -0
- package/dist/verification/types.d.ts.map +1 -0
- package/dist/verification/types.js +12 -0
- package/dist/verification/types.js.map +1 -0
- package/dist/verification/verify.d.ts +4 -0
- package/dist/verification/verify.d.ts.map +1 -0
- package/dist/verification/verify.js +69 -0
- package/dist/verification/verify.js.map +1 -0
- package/examples/basic/.harness/fixtures.ts +5 -0
- package/examples/basic/.harness/packages/documents.xml +16 -0
- package/examples/basic/README.md +13 -0
- package/examples/basic/package.json +12 -0
- package/examples/basic/tests/documents.test.ts +19 -0
- package/examples/basic/tsconfig.json +15 -0
- package/examples/server-methods/.harness/fixtures.ts +18 -0
- package/examples/server-methods/.harness/mocks.json +6 -0
- package/examples/server-methods/.harness/packages/review.xml +69 -0
- package/examples/server-methods/README.md +14 -0
- package/examples/server-methods/package.json +12 -0
- package/examples/server-methods/tests/submission.test.ts +60 -0
- package/examples/server-methods/tsconfig.json +15 -0
- package/package.json +90 -5
- package/skills/innovator-harness/SKILL.md +109 -0
- package/skills/innovator-harness/agents/openai.yaml +7 -0
- package/skills/innovator-harness/assets/icon-small.png +0 -0
- package/skills/innovator-harness/assets/icon.png +0 -0
- package/src/baseline/catalog.ts +42 -0
- package/src/baseline/data/item-types.json +1062 -0
- package/src/baseline/data/properties.json +31286 -0
- package/src/baseline/data/records.json +6666 -0
- package/src/baseline/data/relationships.json +393 -0
- package/src/baseline/database.ts +39 -0
- package/src/baseline/source.ts +16 -0
- package/src/compatibility/capabilities.ts +626 -0
- package/src/compatibility/check.ts +483 -0
- package/src/compatibility/executions.ts +120 -0
- package/src/compatibility/executors.ts +180 -0
- package/src/compatibility/index.ts +22 -0
- package/src/compatibility/metadata.ts +219 -0
- package/src/compatibility/mocks.ts +32 -0
- package/src/compatibility/revisions.ts +45 -0
- package/src/compatibility/security.ts +102 -0
- package/src/compatibility/sources.ts +38 -0
- package/src/compatibility/types.ts +153 -0
- package/src/controls/clock.ts +108 -0
- package/src/controls/execution.ts +53 -0
- package/src/controls/failure-types.ts +61 -0
- package/src/controls/failure-validation.ts +99 -0
- package/src/controls/failures.ts +192 -0
- package/src/controls/ids.ts +87 -0
- package/src/controls/observers.ts +107 -0
- package/src/controls/state.ts +91 -0
- package/src/controls/targets.ts +123 -0
- package/src/controls/values.ts +44 -0
- package/src/controls/world.ts +31 -0
- package/src/core/budget.ts +25 -0
- package/src/core/context.ts +68 -0
- package/src/core/data.ts +273 -0
- package/src/core/deadline.ts +47 -0
- package/src/core/errors.ts +32 -0
- package/src/core/files.ts +45 -0
- package/src/core/index.ts +17 -0
- package/src/core/limits.ts +14 -0
- package/src/core/modules.ts +102 -0
- package/src/core/operation.ts +43 -0
- package/src/core/process.ts +55 -0
- package/src/core/resources.ts +34 -0
- package/src/core/runtime.ts +883 -0
- package/src/core/types.ts +80 -0
- package/src/diagnostics/source-location.ts +6 -0
- package/src/engine/instance.ts +428 -0
- package/src/engine.ts +9 -0
- package/src/fixtures/module.ts +182 -0
- package/src/fixtures/types.ts +9 -0
- package/src/harness/configuration.ts +426 -0
- package/src/harness/create.ts +214 -0
- package/src/harness/extensions.ts +86 -0
- package/src/harness/fixtures.ts +186 -0
- package/src/harness/runtime-identity.ts +41 -0
- package/src/harness/setup-cache.ts +56 -0
- package/src/harness/setup-image.ts +155 -0
- package/src/harness/setup-imports.ts +40 -0
- package/src/harness/setup-inputs.ts +80 -0
- package/src/harness/setup-module.ts +118 -0
- package/src/harness/world.ts +248 -0
- package/src/index.ts +84 -0
- package/src/instrumentation/failures.ts +148 -0
- package/src/instrumentation/recorder.ts +547 -0
- package/src/instrumentation/snapshots.ts +247 -0
- package/src/instrumentation/types.ts +126 -0
- package/src/items/codec.ts +198 -0
- package/src/items/item.ts +218 -0
- package/src/items/logical.ts +145 -0
- package/src/items/origins.ts +139 -0
- package/src/items/xml.ts +187 -0
- package/src/methods/csharp/base-input.ts +215 -0
- package/src/methods/csharp/cache.ts +67 -0
- package/src/methods/csharp/callbacks.ts +121 -0
- package/src/methods/csharp/compiler.ts +284 -0
- package/src/methods/csharp/context.ts +88 -0
- package/src/methods/csharp/documents.ts +186 -0
- package/src/methods/csharp/executor.ts +504 -0
- package/src/methods/csharp/index.ts +3 -0
- package/src/methods/csharp/method-build.ts +141 -0
- package/src/methods/csharp/origins.ts +126 -0
- package/src/methods/csharp/protocol.ts +104 -0
- package/src/methods/csharp/relationship-order.ts +76 -0
- package/src/methods/csharp/request-change.ts +349 -0
- package/src/methods/csharp/retained-items.ts +128 -0
- package/src/methods/csharp/security.ts +121 -0
- package/src/methods/csharp/templates.ts +92 -0
- package/src/methods/csharp/worker.ts +234 -0
- package/src/methods/event-data.ts +39 -0
- package/src/methods/types.ts +59 -0
- package/src/mocks/configuration.ts +158 -0
- package/src/mocks/parameters.ts +20 -0
- package/src/mocks/registry.ts +214 -0
- package/src/mocks/response.ts +128 -0
- package/src/mocks/types.ts +56 -0
- package/src/packages/bootstrap.ts +73 -0
- package/src/packages/candidates.ts +55 -0
- package/src/packages/defaults.ts +145 -0
- package/src/packages/diagnostics.ts +47 -0
- package/src/packages/draft.ts +280 -0
- package/src/packages/elements.ts +88 -0
- package/src/packages/evaluation.ts +89 -0
- package/src/packages/files.ts +332 -0
- package/src/packages/importer.ts +1257 -0
- package/src/packages/index.ts +7 -0
- package/src/packages/manifest.ts +158 -0
- package/src/packages/module.ts +36 -0
- package/src/packages/parser.ts +367 -0
- package/src/packages/plan.ts +872 -0
- package/src/packages/schema.ts +617 -0
- package/src/packages/selector.ts +104 -0
- package/src/packages/state.ts +82 -0
- package/src/packages/types.ts +25 -0
- package/src/platform/action-responses.ts +127 -0
- package/src/platform/actions.ts +11 -0
- package/src/platform/catalog.ts +220 -0
- package/src/platform/classifications.ts +165 -0
- package/src/platform/creation.ts +37 -0
- package/src/platform/engine.ts +2055 -0
- package/src/platform/errors.ts +39 -0
- package/src/platform/events/after.ts +149 -0
- package/src/platform/events/base-updates.ts +68 -0
- package/src/platform/events/bindings.ts +129 -0
- package/src/platform/events/data.ts +26 -0
- package/src/platform/events/inheritance.ts +98 -0
- package/src/platform/events/input.ts +12 -0
- package/src/platform/events/replacement.ts +109 -0
- package/src/platform/events/types.ts +56 -0
- package/src/platform/events/version.ts +38 -0
- package/src/platform/graph-actions.ts +198 -0
- package/src/platform/lifecycle.ts +549 -0
- package/src/platform/locks.ts +251 -0
- package/src/platform/projection.ts +262 -0
- package/src/platform/queries/conditions.ts +69 -0
- package/src/platform/queries/engine.ts +69 -0
- package/src/platform/queries/fields.ts +160 -0
- package/src/platform/queries/order.ts +105 -0
- package/src/platform/queries/paging.ts +66 -0
- package/src/platform/queries/planner.ts +244 -0
- package/src/platform/queries/relationships.ts +130 -0
- package/src/platform/queries/validation.ts +105 -0
- package/src/platform/query.ts +178 -0
- package/src/platform/references/behavior.ts +36 -0
- package/src/platform/references/catalog.ts +256 -0
- package/src/platform/references/deletion.ts +130 -0
- package/src/platform/references/maintenance.ts +175 -0
- package/src/platform/references/policy.ts +115 -0
- package/src/platform/references/sessions.ts +148 -0
- package/src/platform/relationship-copy-policy.ts +66 -0
- package/src/platform/relationship-copy.ts +218 -0
- package/src/platform/relationship-type.ts +23 -0
- package/src/platform/request.ts +139 -0
- package/src/platform/revisions/policy.ts +126 -0
- package/src/platform/revisions/sequences.ts +67 -0
- package/src/platform/security/grants.ts +116 -0
- package/src/platform/security/identities.ts +136 -0
- package/src/platform/security/inherited-relationships.ts +103 -0
- package/src/platform/security/method-execution.ts +34 -0
- package/src/platform/security/permissions.ts +337 -0
- package/src/platform/security/policy.ts +286 -0
- package/src/platform/security/source-access.ts +148 -0
- package/src/platform/security/source-inheritance.ts +134 -0
- package/src/platform/security/system-identities.ts +16 -0
- package/src/platform/security/teams.ts +100 -0
- package/src/platform/security/time.ts +30 -0
- package/src/platform/security/types.ts +17 -0
- package/src/platform/trace.ts +111 -0
- package/src/platform/unlocking.ts +295 -0
- package/src/platform/values.ts +217 -0
- package/src/platform/version-policy.ts +17 -0
- package/src/platform/versioned-request.ts +154 -0
- package/src/platform/versioning.ts +798 -0
- package/src/queries/date.ts +28 -0
- package/src/queries/decimal.ts +59 -0
- package/src/queries/evaluate.ts +168 -0
- package/src/queries/lexer.ts +109 -0
- package/src/queries/like.ts +47 -0
- package/src/queries/parser.ts +352 -0
- package/src/queries/predicates.ts +85 -0
- package/src/queries/types.ts +82 -0
- package/src/queries/values.ts +104 -0
- package/src/storage/documents.ts +20 -0
- package/src/storage/metadata-epoch.ts +20 -0
- package/src/storage/package-transaction.ts +25 -0
- package/src/storage/properties.ts +31 -0
- package/src/storage/sqlite/catalog.ts +89 -0
- package/src/storage/sqlite/connections.ts +49 -0
- package/src/storage/sqlite/errors.ts +23 -0
- package/src/storage/sqlite/index.ts +13 -0
- package/src/storage/sqlite/metadata.ts +216 -0
- package/src/storage/sqlite/predicate.ts +301 -0
- package/src/storage/sqlite/queries.ts +48 -0
- package/src/storage/sqlite/schema.ts +288 -0
- package/src/storage/sqlite/statements.ts +51 -0
- package/src/storage/sqlite/storage.ts +949 -0
- package/src/storage/sqlite/transactions.ts +108 -0
- package/src/storage/types.ts +69 -0
- package/src/verification/diagnostics.ts +124 -0
- package/src/verification/index.ts +10 -0
- package/src/verification/inspection.ts +108 -0
- package/src/verification/inventory.ts +76 -0
- package/src/verification/types.ts +61 -0
- package/src/verification/verify.ts +11 -0
|
@@ -0,0 +1,791 @@
|
|
|
1
|
+
import { baselineTypeNames } from "../baseline/catalog.js";
|
|
2
|
+
import { isBaselineSource } from "../baseline/source.js";
|
|
3
|
+
import { getOwn, setOwn } from "../core/data.js";
|
|
4
|
+
import { errorMessage } from "../core/errors.js";
|
|
5
|
+
import { withPackageTransaction } from "../storage/package-transaction.js";
|
|
6
|
+
import { bootstrapSource, presentationTypes, relationshipProperties, stableId, systemProperties, versionableProperties, } from "./bootstrap.js";
|
|
7
|
+
import { PackageDefaults } from "./defaults.js";
|
|
8
|
+
import { PackageImportError, throwImportErrors } from "./diagnostics.js";
|
|
9
|
+
import { ImportDraft, entryKey } from "./draft.js";
|
|
10
|
+
import { childElements, itemProperties, itemType, textContent, walkElements } from "./elements.js";
|
|
11
|
+
import { evaluateImport, ImportTask } from "./evaluation.js";
|
|
12
|
+
import { ImportPlan } from "./plan.js";
|
|
13
|
+
import { compileItemTypes, convertProperties, reusableItemTypes, validateReferences, } from "./schema.js";
|
|
14
|
+
import { matchesImportValue, parseWhere } from "./selector.js";
|
|
15
|
+
import { readImportState } from "./state.js";
|
|
16
|
+
export class PackageImporter {
|
|
17
|
+
storage;
|
|
18
|
+
constructor(storage) {
|
|
19
|
+
this.storage = storage;
|
|
20
|
+
}
|
|
21
|
+
import(documents, fixtureFiles = new Set()) {
|
|
22
|
+
return withPackageTransaction(this.storage, () => new ImportSession(this.storage).import(documents, fixtureFiles));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** All planning state belongs to one import and is read inside its write boundary. */
|
|
26
|
+
class ImportSession {
|
|
27
|
+
storage;
|
|
28
|
+
draft;
|
|
29
|
+
defaults;
|
|
30
|
+
generatedIds = [];
|
|
31
|
+
resolving = new Set();
|
|
32
|
+
documentHashes = new Map();
|
|
33
|
+
addedCount = 0;
|
|
34
|
+
updatedCount = 0;
|
|
35
|
+
fixtureFiles = new Set();
|
|
36
|
+
reads;
|
|
37
|
+
sharedAdditions = new Set();
|
|
38
|
+
constructor(storage) {
|
|
39
|
+
this.storage = storage;
|
|
40
|
+
this.draft = new ImportDraft(readImportState(storage));
|
|
41
|
+
this.defaults = new PackageDefaults(this.draft);
|
|
42
|
+
}
|
|
43
|
+
import(documents, fixtureFiles) {
|
|
44
|
+
this.fixtureFiles = fixtureFiles;
|
|
45
|
+
this.defaults.initialize();
|
|
46
|
+
for (const document of documents) {
|
|
47
|
+
this.documentHashes.set(document.file, document.sha256);
|
|
48
|
+
}
|
|
49
|
+
const initial = this.draft.checkpoint();
|
|
50
|
+
const plan = new ImportPlan(documents, fixtureFiles, initial.entries);
|
|
51
|
+
this.sharedAdditions = plan.sharedAdditions;
|
|
52
|
+
const errors = [
|
|
53
|
+
...plan.execute({
|
|
54
|
+
reset: () => {
|
|
55
|
+
this.draft.restore(initial);
|
|
56
|
+
this.addedCount = 0;
|
|
57
|
+
this.updatedCount = 0;
|
|
58
|
+
this.generatedIds.length = 0;
|
|
59
|
+
},
|
|
60
|
+
attempt: (action) => this.attemptAction(action),
|
|
61
|
+
equal: (left, right) => {
|
|
62
|
+
if (left === undefined || right === undefined) {
|
|
63
|
+
return left === right;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
return this.resolveValue(left) === this.resolveValue(right);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (!(error instanceof PackageImportError)) {
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
];
|
|
77
|
+
const catalog = this.resolveCatalog(errors);
|
|
78
|
+
throwImportErrors(errors);
|
|
79
|
+
this.reconcileSystemProperties(catalog);
|
|
80
|
+
this.completeSystemReferences(catalog);
|
|
81
|
+
const definitions = this.defineItemTypes(catalog);
|
|
82
|
+
this.persistCatalog(catalog);
|
|
83
|
+
validateReferences(catalog, definitions, this.storage);
|
|
84
|
+
return this.loadReport(documents, definitions);
|
|
85
|
+
}
|
|
86
|
+
defineItemTypes(catalog) {
|
|
87
|
+
const reused = reusableItemTypes(catalog, this.draft.changed, this.draft.deleted.values(), this.storage);
|
|
88
|
+
if (reused) {
|
|
89
|
+
return reused;
|
|
90
|
+
}
|
|
91
|
+
const definitions = compileItemTypes(catalog, this.storage);
|
|
92
|
+
for (const definition of definitions) {
|
|
93
|
+
this.withSource(definition.source ?? bootstrapSource("/"), () => this.storage.defineItemType(definition));
|
|
94
|
+
}
|
|
95
|
+
return definitions;
|
|
96
|
+
}
|
|
97
|
+
loadReport(documents, definitions) {
|
|
98
|
+
for (const document of documents) {
|
|
99
|
+
this.storage.putDocument({
|
|
100
|
+
path: document.file,
|
|
101
|
+
sha256: document.sha256,
|
|
102
|
+
xml: document.xml,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return Object.freeze({
|
|
106
|
+
documents: Object.freeze(documents.map(({ file, sha256 }) => Object.freeze({ path: file, sha256 }))),
|
|
107
|
+
added: this.addedCount,
|
|
108
|
+
updated: this.updatedCount,
|
|
109
|
+
deleted: this.draft.deleted.size,
|
|
110
|
+
itemTypes: Object.freeze(definitions.map((definition) => definition.name)),
|
|
111
|
+
generatedIds: Object.freeze(this.generatedIds.map((entry) => Object.freeze(entry))),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
persistCatalog(catalog) {
|
|
115
|
+
for (const entry of this.draft.deleted.values()) {
|
|
116
|
+
if (this.storage.getItemType(entry.type) &&
|
|
117
|
+
this.storage.getItem(entry.type, entry.id)) {
|
|
118
|
+
this.storage.deleteItem(entry.type, entry.id);
|
|
119
|
+
}
|
|
120
|
+
this.storage.deleteCatalogEntry(entry.type, entry.id);
|
|
121
|
+
}
|
|
122
|
+
for (const key of this.draft.changed) {
|
|
123
|
+
const entry = catalog.get(key);
|
|
124
|
+
if (entry) {
|
|
125
|
+
this.persistChangedEntry(entry, catalog);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
persistChangedEntry(entry, catalog) {
|
|
130
|
+
const definition = this.storage.getItemType(entry.type);
|
|
131
|
+
if (!definition) {
|
|
132
|
+
const metadata = [...catalog.values()].find((candidate) => candidate.type === "ItemType" && candidate.properties.name === entry.type);
|
|
133
|
+
if (metadata && metadata.properties.implementation_type !== "table") {
|
|
134
|
+
throw new PackageImportError("UNSUPPORTED_IMPLEMENTATION", `Records of '${entry.type}' use '${metadata.properties.implementation_type}' storage and require an adapter.`, entry.source);
|
|
135
|
+
}
|
|
136
|
+
throw new PackageImportError("MISSING_ITEM_TYPE", `No ItemType definition for '${entry.type}'. Supply its package explicitly.`, entry.source, { reference: { type: "ItemType", name: entry.type } });
|
|
137
|
+
}
|
|
138
|
+
this.withSource(entry.source, () => {
|
|
139
|
+
const properties = convertProperties(entry, definition);
|
|
140
|
+
const existing = this.storage.getItem(entry.type, entry.id);
|
|
141
|
+
if (existing) {
|
|
142
|
+
this.storage.updateItem(entry.type, entry.id, properties);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
if (definition.isVersionable) {
|
|
146
|
+
const defaults = { config_id: entry.id, generation: 1, is_current: 1 };
|
|
147
|
+
for (const [name, value] of Object.entries(defaults)) {
|
|
148
|
+
if (properties[name] === undefined) {
|
|
149
|
+
setOwn(properties, name, value);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
this.storage.insertItem({
|
|
154
|
+
id: entry.id,
|
|
155
|
+
type: entry.type,
|
|
156
|
+
properties,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
this.storage.putCatalogEntry({ ...entry, properties });
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
importAction(element) {
|
|
163
|
+
const type = itemType(element);
|
|
164
|
+
if (textContent(element).trim()) {
|
|
165
|
+
throw new PackageImportError("INVALID_ITEM_TEXT", "An Item may only contain property elements, Relationships, and whitespace.", element.source);
|
|
166
|
+
}
|
|
167
|
+
let action = element.attributes.action ?? "get";
|
|
168
|
+
if (this.fixtureFiles.has(element.source.file)) {
|
|
169
|
+
if ([
|
|
170
|
+
"ItemType",
|
|
171
|
+
"Property",
|
|
172
|
+
"RelationshipType",
|
|
173
|
+
"Server Event",
|
|
174
|
+
"Method",
|
|
175
|
+
"SQL",
|
|
176
|
+
"ItemType Life Cycle",
|
|
177
|
+
"Life Cycle Map",
|
|
178
|
+
"Life Cycle State",
|
|
179
|
+
"Life Cycle Transition",
|
|
180
|
+
].includes(type)) {
|
|
181
|
+
throw new PackageImportError("FIXTURE_DEFINITION", `Fixture files contain starting data. Put '${type}' definitions in packages.`, element.source);
|
|
182
|
+
}
|
|
183
|
+
if (action === "add" &&
|
|
184
|
+
element.attributes.id &&
|
|
185
|
+
this.draft.entries.has(entryKey(type, element.attributes.id))) {
|
|
186
|
+
action = "edit";
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
for (const attribute of ["idlist", "condition", "levels", "queryType"]) {
|
|
190
|
+
if (element.attributes[attribute] !== undefined) {
|
|
191
|
+
throw new PackageImportError("UNSUPPORTED_SELECTOR", `Item attribute '${attribute}' is not supported by package loading.`, element.source);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return action;
|
|
195
|
+
}
|
|
196
|
+
attemptAction(action) {
|
|
197
|
+
const added = this.addedCount;
|
|
198
|
+
const updated = this.updatedCount;
|
|
199
|
+
const generated = this.generatedIds.length;
|
|
200
|
+
const reads = [];
|
|
201
|
+
this.reads = reads;
|
|
202
|
+
this.draft.begin(action.id);
|
|
203
|
+
try {
|
|
204
|
+
evaluateImport(new ImportTask(this.applyItemSteps(action.element)));
|
|
205
|
+
const changes = this.draft.changes();
|
|
206
|
+
this.draft.commit();
|
|
207
|
+
return { reads, changes };
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
const changes = this.draft.changes();
|
|
211
|
+
this.draft.rollback();
|
|
212
|
+
this.addedCount = added;
|
|
213
|
+
this.updatedCount = updated;
|
|
214
|
+
this.generatedIds.length = generated;
|
|
215
|
+
if (!(error instanceof PackageImportError)) {
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
218
|
+
return { reads, changes, error };
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
this.reads = undefined;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
*applyItemSteps(element, parent) {
|
|
225
|
+
const type = itemType(element);
|
|
226
|
+
const action = this.importAction(element);
|
|
227
|
+
if (action === "get") {
|
|
228
|
+
const selected = new ImportTask(this.selectOneSteps(element, true, parent));
|
|
229
|
+
yield selected;
|
|
230
|
+
return selected.value().id;
|
|
231
|
+
}
|
|
232
|
+
if (action === "delete") {
|
|
233
|
+
const deletion = new ImportTask(this.deleteItemSteps(element, type, parent));
|
|
234
|
+
yield deletion;
|
|
235
|
+
return deletion.value();
|
|
236
|
+
}
|
|
237
|
+
if (action !== "add" && action !== "edit") {
|
|
238
|
+
throw new PackageImportError("UNSUPPORTED_IMPORT_ACTION", `Import action '${action}' is not implemented. Package loading never executes Methods or platform events.`, element.source);
|
|
239
|
+
}
|
|
240
|
+
const prepared = new ImportTask(this.prepareEntrySteps(element, type, action, parent));
|
|
241
|
+
yield prepared;
|
|
242
|
+
const { entry, repeatedAddition } = prepared.value();
|
|
243
|
+
yield new ImportTask(this.applyPropertiesSteps(element, entry, repeatedAddition, parent));
|
|
244
|
+
if (type === "Property" && action === "add") {
|
|
245
|
+
this.defaults.replaceProperty(entry);
|
|
246
|
+
this.replaceGeneratedProperty(entry);
|
|
247
|
+
}
|
|
248
|
+
if (type === "ItemType") {
|
|
249
|
+
this.addSystemProperties(entry);
|
|
250
|
+
}
|
|
251
|
+
for (const relationships of childElements(element).filter((child) => child.name === "Relationships")) {
|
|
252
|
+
if (textContent(relationships).trim()) {
|
|
253
|
+
throw new PackageImportError("INVALID_RELATIONSHIPS", "Relationships may only contain Items and whitespace.", relationships.source);
|
|
254
|
+
}
|
|
255
|
+
for (const relationship of childElements(relationships)) {
|
|
256
|
+
yield new ImportTask(this.applyItemSteps(relationship, entry));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return entry.id;
|
|
260
|
+
}
|
|
261
|
+
*deleteItemSteps(element, type, parent) {
|
|
262
|
+
if (childElements(element).length) {
|
|
263
|
+
throw new PackageImportError("UNSUPPORTED_SELECTOR", "Delete actions accept only an ID or where selector; child elements are not implemented.", element.source);
|
|
264
|
+
}
|
|
265
|
+
if (type === "ItemType" || type === "Property") {
|
|
266
|
+
throw new PackageImportError("UNSUPPORTED_SCHEMA_CHANGE", "Deleting ItemTypes or Properties requires a schema migration implementation.", element.source);
|
|
267
|
+
}
|
|
268
|
+
const selection = new ImportTask(this.selectSteps(element, false, parent, "optional"));
|
|
269
|
+
yield selection;
|
|
270
|
+
const matches = selection.value();
|
|
271
|
+
// Export installers also remove generated forms/views that may not exist locally.
|
|
272
|
+
// A declarative delete is satisfied when no matching record remains.
|
|
273
|
+
for (const entry of matches) {
|
|
274
|
+
const key = entryKey(type, entry.id);
|
|
275
|
+
this.draft.remove(key, entry);
|
|
276
|
+
}
|
|
277
|
+
return matches[0]?.id ?? "";
|
|
278
|
+
}
|
|
279
|
+
*prepareEntrySteps(element, type, action, parent) {
|
|
280
|
+
if (action === "add") {
|
|
281
|
+
return this.addEntry(element, type);
|
|
282
|
+
}
|
|
283
|
+
const selection = new ImportTask(this.selectOneSteps(element, false, parent));
|
|
284
|
+
yield selection;
|
|
285
|
+
this.updatedCount += 1;
|
|
286
|
+
return { entry: selection.value(), repeatedAddition: false };
|
|
287
|
+
}
|
|
288
|
+
addEntry(element, type) {
|
|
289
|
+
if (element.attributes.where !== undefined) {
|
|
290
|
+
throw new PackageImportError("UNSUPPORTED_SELECTOR", "An add action cannot contain a where selector.", element.source);
|
|
291
|
+
}
|
|
292
|
+
const suppliedId = element.attributes.id;
|
|
293
|
+
const documentHash = this.documentHashes.get(element.source.file);
|
|
294
|
+
const id = suppliedId ?? stableId(`package-item:${documentHash}:${element.source.path}`);
|
|
295
|
+
if (id.trim().length === 0) {
|
|
296
|
+
throw new PackageImportError("INVALID_ID", "Item ID cannot be empty.", element.source);
|
|
297
|
+
}
|
|
298
|
+
const key = entryKey(type, id);
|
|
299
|
+
const existing = this.draft.entries.get(key);
|
|
300
|
+
const replacingDefault = existing && isBaselineSource(existing.source);
|
|
301
|
+
const repeatedAddition = Boolean(existing &&
|
|
302
|
+
this.sharedAdditions.has(key) &&
|
|
303
|
+
existing.source.file !== element.source.file);
|
|
304
|
+
if (!replacingDefault && !repeatedAddition) {
|
|
305
|
+
this.reads?.push({
|
|
306
|
+
kind: "absent",
|
|
307
|
+
key,
|
|
308
|
+
type,
|
|
309
|
+
source: element.source,
|
|
310
|
+
matchedKeys: existing ? [key] : [],
|
|
311
|
+
matches: (candidate) => entryKey(candidate.type, candidate.id) === key,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
if (existing && !replacingDefault && !repeatedAddition) {
|
|
315
|
+
throw new PackageImportError("DUPLICATE_ITEM", `An item of type '${type}' with ID '${id}' already exists at ${existing.source.file}:${existing.source.line}:${existing.source.column}. Use edit for patches.`, element.source, { relatedSources: [existing.source] });
|
|
316
|
+
}
|
|
317
|
+
const entry = existing && repeatedAddition
|
|
318
|
+
? existing
|
|
319
|
+
: {
|
|
320
|
+
id,
|
|
321
|
+
type,
|
|
322
|
+
attributes: element.attributes,
|
|
323
|
+
properties: replacingDefault ? { ...existing.properties } : {},
|
|
324
|
+
source: element.source,
|
|
325
|
+
};
|
|
326
|
+
this.replaceDefaultItemType(element, type, id);
|
|
327
|
+
this.recordAddition(entry, repeatedAddition, suppliedId === undefined);
|
|
328
|
+
return { entry, repeatedAddition };
|
|
329
|
+
}
|
|
330
|
+
recordAddition(entry, repeatedAddition, generated) {
|
|
331
|
+
if (!repeatedAddition) {
|
|
332
|
+
this.draft.put(entry);
|
|
333
|
+
this.addedCount += 1;
|
|
334
|
+
}
|
|
335
|
+
if (generated) {
|
|
336
|
+
this.generatedIds.push({ id: entry.id, source: entry.source });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
replaceDefaultItemType(element, type, id) {
|
|
340
|
+
if (type === "ItemType") {
|
|
341
|
+
const name = itemProperties(element).find((property) => property.name === "name");
|
|
342
|
+
if (name) {
|
|
343
|
+
this.defaults.replaceItemType(textContent(name), id);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
*applyPropertiesSteps(element, entry, repeatedAddition, parent) {
|
|
348
|
+
const properties = itemProperties(element);
|
|
349
|
+
this.draft.touch(entry, properties.map((property) => property.name));
|
|
350
|
+
for (const property of properties) {
|
|
351
|
+
const task = new ImportTask(this.importPropertySteps(property, entry, repeatedAddition));
|
|
352
|
+
yield task;
|
|
353
|
+
setOwn(entry.properties, property.name, task.value());
|
|
354
|
+
}
|
|
355
|
+
if (parent) {
|
|
356
|
+
this.draft.touch(entry, ["source_id"]);
|
|
357
|
+
const sourceId = getOwn(entry.properties, "source_id");
|
|
358
|
+
if (sourceId !== undefined) {
|
|
359
|
+
const resolved = new ImportTask(this.resolveValueSteps(sourceId));
|
|
360
|
+
yield resolved;
|
|
361
|
+
if (String(resolved.value()).toLowerCase() !== parent.id.toLowerCase()) {
|
|
362
|
+
throw new PackageImportError("RELATIONSHIP_SOURCE_MISMATCH", "A nested relationship's source_id must identify its parent.", element.source);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
entry.properties.source_id = parent.id;
|
|
366
|
+
}
|
|
367
|
+
if (!repeatedAddition) {
|
|
368
|
+
entry.attributes = element.attributes;
|
|
369
|
+
entry.source = element.source;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
*importPropertySteps(property, entry, repeatedAddition) {
|
|
373
|
+
// A family identity does not require the first generation to be present.
|
|
374
|
+
let value;
|
|
375
|
+
if (property.name === "config_id" && childElements(property).length === 0) {
|
|
376
|
+
value = textContent(property).trim() || null;
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
const propertyValue = new ImportTask(this.propertyValueSteps(property, presentationTypes.has(entry.type)));
|
|
380
|
+
yield propertyValue;
|
|
381
|
+
value = propertyValue.value();
|
|
382
|
+
}
|
|
383
|
+
const previous = getOwn(entry.properties, property.name);
|
|
384
|
+
if (repeatedAddition && previous !== undefined) {
|
|
385
|
+
const before = new ImportTask(this.resolveValueSteps(previous));
|
|
386
|
+
yield before;
|
|
387
|
+
const after = new ImportTask(this.resolveValueSteps(value));
|
|
388
|
+
yield after;
|
|
389
|
+
if (before.value() !== after.value()) {
|
|
390
|
+
throw new PackageImportError("DUPLICATE_ITEM", `Repeated addition of '${entry.type}:${entry.id}' conflicts on '${property.name}'.`, property.source, { relatedSources: [entry.source] });
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return value;
|
|
394
|
+
}
|
|
395
|
+
replaceGeneratedProperty(entry) {
|
|
396
|
+
const owner = entry.properties.source_id;
|
|
397
|
+
const name = entry.properties.name;
|
|
398
|
+
if (typeof owner !== "string" || typeof name !== "string") {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
const generatedId = stableId(`system-property-v1:${owner}:${name}`);
|
|
402
|
+
if (entry.id === generatedId) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
const key = entryKey("Property", generatedId);
|
|
406
|
+
if (this.draft.entries.has(key)) {
|
|
407
|
+
const stored = this.storage.getCatalogEntry("Property", generatedId);
|
|
408
|
+
this.draft.remove(key, stored ? { ...stored, properties: { ...stored.properties } } : undefined);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
reconcileSystemProperties(catalog) {
|
|
412
|
+
for (const entry of catalog.values()) {
|
|
413
|
+
const owner = entry.properties.source_id;
|
|
414
|
+
const name = entry.properties.name;
|
|
415
|
+
if (entry.type !== "Property" ||
|
|
416
|
+
typeof owner !== "string" ||
|
|
417
|
+
typeof name !== "string") {
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
const generatedId = stableId(`system-property-v1:${owner}:${name}`);
|
|
421
|
+
if (entry.id === generatedId) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
const key = entryKey("Property", generatedId);
|
|
425
|
+
const generated = catalog.get(key);
|
|
426
|
+
if (generated) {
|
|
427
|
+
catalog.delete(key);
|
|
428
|
+
const stored = this.storage.getCatalogEntry("Property", generatedId);
|
|
429
|
+
this.draft.remove(key, stored ? { ...generated, properties: { ...generated.properties } } : undefined);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
addSystemProperties(entry) {
|
|
434
|
+
const properties = [...systemProperties];
|
|
435
|
+
if (entry.properties.is_versionable === "1" || entry.properties.is_versionable === 1) {
|
|
436
|
+
properties.push(...versionableProperties);
|
|
437
|
+
}
|
|
438
|
+
if (entry.properties.is_relationship === "1") {
|
|
439
|
+
properties.push(...relationshipProperties);
|
|
440
|
+
}
|
|
441
|
+
const existing = new Set([...this.draft.ofType("Property")]
|
|
442
|
+
.filter((candidate) => candidate.properties.source_id === entry.id)
|
|
443
|
+
.map((candidate) => candidate.properties.name));
|
|
444
|
+
for (const property of properties) {
|
|
445
|
+
if (existing.has(property.name)) {
|
|
446
|
+
continue;
|
|
447
|
+
}
|
|
448
|
+
const id = stableId(`system-property-v1:${entry.id}:${property.name}`);
|
|
449
|
+
this.draft.put({
|
|
450
|
+
id,
|
|
451
|
+
type: "Property",
|
|
452
|
+
attributes: {},
|
|
453
|
+
source: entry.source,
|
|
454
|
+
properties: {
|
|
455
|
+
name: property.name,
|
|
456
|
+
data_type: property.dataType,
|
|
457
|
+
source_id: entry.id,
|
|
458
|
+
},
|
|
459
|
+
});
|
|
460
|
+
existing.add(property.name);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
completeSystemReferences(catalog) {
|
|
464
|
+
const user = [...catalog.values()].find((entry) => entry.type === "ItemType" && String(entry.properties.name).toLowerCase() === "user");
|
|
465
|
+
if (!user) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
for (const entry of catalog.values()) {
|
|
469
|
+
const owner = entry.properties.source_id;
|
|
470
|
+
if (entry.type !== "Property" ||
|
|
471
|
+
entry.properties.name !== "locked_by_id" ||
|
|
472
|
+
entry.properties.data_type !== "item" ||
|
|
473
|
+
entry.properties.data_source === user.id ||
|
|
474
|
+
typeof owner !== "string" ||
|
|
475
|
+
entry.id !== stableId(`system-property-v1:${owner}:locked_by_id`)) {
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
const updated = { ...entry, properties: { ...entry.properties, data_source: user.id } };
|
|
479
|
+
this.draft.put({ ...updated, properties: { ...updated.properties } });
|
|
480
|
+
catalog.set(entryKey(entry.type, entry.id), updated);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
*propertyValueSteps(property, opaque = false) {
|
|
484
|
+
const children = childElements(property);
|
|
485
|
+
const value = textContent(property);
|
|
486
|
+
const nullAttribute = validatePropertyAttributes(property);
|
|
487
|
+
if (nullAttribute === "1") {
|
|
488
|
+
if (children.length || value.trim()) {
|
|
489
|
+
throw new PackageImportError("INVALID_NULL", "A null property cannot also contain a value.", property.source);
|
|
490
|
+
}
|
|
491
|
+
return null;
|
|
492
|
+
}
|
|
493
|
+
if (children.length > 0) {
|
|
494
|
+
const child = children[0];
|
|
495
|
+
if (children.length !== 1 || child?.name !== "Item" || value.trim()) {
|
|
496
|
+
throw new PackageImportError("UNSUPPORTED_PROPERTY_MARKUP", "A property may contain text or one nested Item reference.", property.source);
|
|
497
|
+
}
|
|
498
|
+
if ((child.attributes.action ?? "get") === "get") {
|
|
499
|
+
if (opaque && child.attributes.id) {
|
|
500
|
+
return child.attributes.id;
|
|
501
|
+
}
|
|
502
|
+
return { kind: "reference", element: child };
|
|
503
|
+
}
|
|
504
|
+
const nested = new ImportTask(this.applyItemSteps(child));
|
|
505
|
+
yield nested;
|
|
506
|
+
const id = nested.value();
|
|
507
|
+
return {
|
|
508
|
+
kind: "typed-reference",
|
|
509
|
+
type: itemType(child),
|
|
510
|
+
id,
|
|
511
|
+
source: child.source,
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
const referencedType = property.attributes.type;
|
|
515
|
+
if (referencedType && value.trim()) {
|
|
516
|
+
if (opaque || presentationTypes.has(referencedType)) {
|
|
517
|
+
return value.trim();
|
|
518
|
+
}
|
|
519
|
+
return {
|
|
520
|
+
kind: "typed-reference",
|
|
521
|
+
type: referencedType,
|
|
522
|
+
id: value.trim(),
|
|
523
|
+
source: property.source,
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
return value;
|
|
527
|
+
}
|
|
528
|
+
*selectSteps(element, useProperties, parent, kind = "unique") {
|
|
529
|
+
const type = itemType(element);
|
|
530
|
+
this.validateSelector(element, useProperties);
|
|
531
|
+
const id = element.attributes.id;
|
|
532
|
+
const filters = [...parseWhere(element)];
|
|
533
|
+
const properties = useProperties ? itemProperties(element) : [];
|
|
534
|
+
for (const property of properties) {
|
|
535
|
+
const value = new ImportTask(this.selectorValueSteps(property));
|
|
536
|
+
yield value;
|
|
537
|
+
filters.push({ name: property.name, value: value.value() });
|
|
538
|
+
}
|
|
539
|
+
if (id === undefined && filters.length === 0 && properties.length === 0) {
|
|
540
|
+
throw new PackageImportError("UNBOUNDED_SELECTOR", "An import selector needs an ID, equality properties, or a supported where clause.", element.source);
|
|
541
|
+
}
|
|
542
|
+
const dataTypes = new Map(filters.map(({ name }) => [name, this.propertyDataType(type, name)]));
|
|
543
|
+
const matchedKeys = [];
|
|
544
|
+
this.reads?.push({
|
|
545
|
+
kind,
|
|
546
|
+
type,
|
|
547
|
+
...(id !== undefined ? { key: entryKey(type, id) } : {}),
|
|
548
|
+
source: element.source,
|
|
549
|
+
matchedKeys,
|
|
550
|
+
// The planner invokes this later, after the current interpreter has completed.
|
|
551
|
+
matches: (entry) => {
|
|
552
|
+
const result = this.matchEntry(entry, type, id, parent, filters, dataTypes);
|
|
553
|
+
return result instanceof ImportTask ? evaluateImport(result) : result;
|
|
554
|
+
},
|
|
555
|
+
});
|
|
556
|
+
const selected = [];
|
|
557
|
+
const entries = id === undefined
|
|
558
|
+
? this.draft.ofType(type)
|
|
559
|
+
: [this.draft.entries.get(entryKey(type, id))];
|
|
560
|
+
for (const entry of entries) {
|
|
561
|
+
if (!entry) {
|
|
562
|
+
continue;
|
|
563
|
+
}
|
|
564
|
+
const match = this.matchEntry(entry, type, id, parent, filters, dataTypes);
|
|
565
|
+
if (match instanceof ImportTask) {
|
|
566
|
+
yield match;
|
|
567
|
+
}
|
|
568
|
+
if (match instanceof ImportTask ? match.value() : match) {
|
|
569
|
+
selected.push(entry);
|
|
570
|
+
matchedKeys.push(entryKey(entry.type, entry.id));
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return selected;
|
|
574
|
+
}
|
|
575
|
+
matchEntry(entry, type, id, parent, predicates, dataTypes) {
|
|
576
|
+
if (entry.type.toLowerCase() !== type.toLowerCase() ||
|
|
577
|
+
(id !== undefined && entry.id.toLowerCase() !== id.toLowerCase())) {
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
const criteria = parent
|
|
581
|
+
? [{ name: "source_id", value: parent.id }, ...predicates]
|
|
582
|
+
: predicates;
|
|
583
|
+
for (const { name, value } of criteria) {
|
|
584
|
+
const actual = this.lookupProperty(entry, name);
|
|
585
|
+
if (actual !== null && typeof actual === "object") {
|
|
586
|
+
return new ImportTask(this.matchesEntrySteps(entry, type, id, parent, predicates, dataTypes));
|
|
587
|
+
}
|
|
588
|
+
if (parent && name === "source_id" && actual !== parent.id) {
|
|
589
|
+
return false;
|
|
590
|
+
}
|
|
591
|
+
if (!matchesImportValue(actual, value, name, dataTypes.get(name))) {
|
|
592
|
+
return false;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return true;
|
|
596
|
+
}
|
|
597
|
+
*matchesEntrySteps(entry, type, id, parent, predicates, dataTypes) {
|
|
598
|
+
if (entry.type.toLowerCase() !== type.toLowerCase() ||
|
|
599
|
+
(id !== undefined && entry.id.toLowerCase() !== id.toLowerCase())) {
|
|
600
|
+
return false;
|
|
601
|
+
}
|
|
602
|
+
if (parent) {
|
|
603
|
+
const sourceId = new ImportTask(this.lookupPropertySteps(entry, "source_id"));
|
|
604
|
+
yield sourceId;
|
|
605
|
+
if (sourceId.value() !== parent.id) {
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
for (const { name, value } of predicates) {
|
|
610
|
+
const actual = new ImportTask(this.lookupPropertySteps(entry, name));
|
|
611
|
+
yield actual;
|
|
612
|
+
if (!matchesImportValue(actual.value(), value, name, dataTypes.get(name))) {
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return true;
|
|
617
|
+
}
|
|
618
|
+
validateSelector(element, useProperties) {
|
|
619
|
+
for (const attribute of ["idlist", "condition", "levels", "queryType"]) {
|
|
620
|
+
if (element.attributes[attribute] !== undefined) {
|
|
621
|
+
throw new PackageImportError("UNSUPPORTED_SELECTOR", `Item attribute '${attribute}' is not supported by package loading.`, element.source);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
if (useProperties &&
|
|
625
|
+
childElements(element).some((child) => child.name === "Relationships")) {
|
|
626
|
+
throw new PackageImportError("UNSUPPORTED_SELECTOR", "Relationship queries are not implemented in package get selectors.", element.source);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
propertyDataType(type, name) {
|
|
630
|
+
let dataType = this.storage.getItemType(type)?.properties.find((property) => property.name === name)
|
|
631
|
+
?.dataType ?? systemProperties.find((property) => property.name === name)?.dataType;
|
|
632
|
+
const owner = [...this.draft.ofType("ItemType")].find((candidate) => candidate.type === "ItemType" &&
|
|
633
|
+
(typeof candidate.properties.name === "string"
|
|
634
|
+
? candidate.properties.name
|
|
635
|
+
: "").toLowerCase() === type.toLowerCase());
|
|
636
|
+
if (owner) {
|
|
637
|
+
const property = [...this.draft.ofType("Property")].find((candidate) => candidate.type === "Property" &&
|
|
638
|
+
candidate.properties.name === name &&
|
|
639
|
+
typeof candidate.properties.source_id === "string" &&
|
|
640
|
+
candidate.properties.source_id.toLowerCase() === owner.id.toLowerCase());
|
|
641
|
+
if (typeof property?.properties.data_type === "string") {
|
|
642
|
+
dataType = property.properties.data_type;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
return dataType;
|
|
646
|
+
}
|
|
647
|
+
*selectorValueSteps(property) {
|
|
648
|
+
for (const element of walkElements([property])) {
|
|
649
|
+
if (element.name === "Item" && (element.attributes.action ?? "get") !== "get") {
|
|
650
|
+
throw new PackageImportError("UNSUPPORTED_SELECTOR", "Nested Items in selectors must use the get action.", element.source);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
const value = new ImportTask(this.propertyValueSteps(property));
|
|
654
|
+
yield value;
|
|
655
|
+
const resolved = new ImportTask(this.resolveValueSteps(value.value()));
|
|
656
|
+
yield resolved;
|
|
657
|
+
return resolved.value();
|
|
658
|
+
}
|
|
659
|
+
*selectOneSteps(element, useProperties = true, parent) {
|
|
660
|
+
const selection = new ImportTask(this.selectSteps(element, useProperties, parent));
|
|
661
|
+
yield selection;
|
|
662
|
+
const matches = selection.value();
|
|
663
|
+
if (matches.length === 0) {
|
|
664
|
+
return this.noMatch(element);
|
|
665
|
+
}
|
|
666
|
+
if (matches.length !== 1) {
|
|
667
|
+
const candidates = matches
|
|
668
|
+
.map((entry) => `${entry.id} at ${entry.source.file}:${entry.source.line}`)
|
|
669
|
+
.join(", ");
|
|
670
|
+
throw new PackageImportError("AMBIGUOUS_REFERENCE", `Selector for '${itemType(element)}' matched ${matches.length} items; expected one. ` +
|
|
671
|
+
`Candidates: ${candidates}.`, element.source, {
|
|
672
|
+
relatedSources: matches.map((entry) => entry.source),
|
|
673
|
+
reference: { type: itemType(element), selector: element },
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
const match = matches[0];
|
|
677
|
+
if (!match) {
|
|
678
|
+
return this.noMatch(element);
|
|
679
|
+
}
|
|
680
|
+
return match;
|
|
681
|
+
}
|
|
682
|
+
noMatch(element) {
|
|
683
|
+
throw new PackageImportError("MISSING_REFERENCE", `No '${itemType(element)}' matches this selector. Supply the required package or fixture explicitly.`, element.source, { reference: { type: itemType(element), selector: element } });
|
|
684
|
+
}
|
|
685
|
+
*lookupPropertySteps(entry, name) {
|
|
686
|
+
const value = this.lookupProperty(entry, name);
|
|
687
|
+
if (value === undefined || value === null || typeof value !== "object") {
|
|
688
|
+
return value;
|
|
689
|
+
}
|
|
690
|
+
const resolved = new ImportTask(this.resolveValueSteps(value));
|
|
691
|
+
yield resolved;
|
|
692
|
+
return resolved.value();
|
|
693
|
+
}
|
|
694
|
+
lookupProperty(entry, name) {
|
|
695
|
+
if (name === "id") {
|
|
696
|
+
return entry.id;
|
|
697
|
+
}
|
|
698
|
+
let value = getOwn(entry.properties, name);
|
|
699
|
+
if (value === undefined && name === "keyed_name" && baselineTypeNames.has(entry.type)) {
|
|
700
|
+
value = getOwn(entry.properties, "name");
|
|
701
|
+
}
|
|
702
|
+
// Selector matching compares typed IDs before final target-existence validation.
|
|
703
|
+
if (value !== null && typeof value === "object" && value.kind === "typed-reference") {
|
|
704
|
+
return value.id;
|
|
705
|
+
}
|
|
706
|
+
return value;
|
|
707
|
+
}
|
|
708
|
+
resolveValue(value) {
|
|
709
|
+
if (value === null || typeof value !== "object") {
|
|
710
|
+
return value;
|
|
711
|
+
}
|
|
712
|
+
return evaluateImport(new ImportTask(this.resolveValueSteps(value)));
|
|
713
|
+
}
|
|
714
|
+
*resolveValueSteps(value) {
|
|
715
|
+
if (value === null || typeof value !== "object") {
|
|
716
|
+
return value;
|
|
717
|
+
}
|
|
718
|
+
if (value.kind === "typed-reference") {
|
|
719
|
+
const key = entryKey(value.type, value.id);
|
|
720
|
+
this.reads?.push({
|
|
721
|
+
kind: "unique",
|
|
722
|
+
key,
|
|
723
|
+
type: value.type,
|
|
724
|
+
source: value.source,
|
|
725
|
+
matchedKeys: this.draft.entries.has(key) ? [key] : [],
|
|
726
|
+
matches: (entry) => entryKey(entry.type, entry.id) === key,
|
|
727
|
+
});
|
|
728
|
+
if (!this.draft.entries.has(key)) {
|
|
729
|
+
throw new PackageImportError("MISSING_REFERENCE", `Missing '${value.type}' with ID '${value.id}'. Supply the required package or fixture explicitly.`, value.source, { reference: { type: value.type, id: value.id } });
|
|
730
|
+
}
|
|
731
|
+
return value.id;
|
|
732
|
+
}
|
|
733
|
+
if (this.resolving.has(value.element)) {
|
|
734
|
+
throw new PackageImportError("CYCLIC_SELECTOR", "Nested get selectors form an unresolved cycle.", value.element.source);
|
|
735
|
+
}
|
|
736
|
+
this.resolving.add(value.element);
|
|
737
|
+
try {
|
|
738
|
+
const selection = new ImportTask(this.selectOneSteps(value.element));
|
|
739
|
+
yield selection;
|
|
740
|
+
return selection.value().id;
|
|
741
|
+
}
|
|
742
|
+
finally {
|
|
743
|
+
this.resolving.delete(value.element);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
resolveCatalog(errors) {
|
|
747
|
+
const catalog = new Map();
|
|
748
|
+
for (const [key, entry] of this.draft.entries) {
|
|
749
|
+
const properties = {};
|
|
750
|
+
for (const [name, value] of Object.entries(entry.properties)) {
|
|
751
|
+
try {
|
|
752
|
+
setOwn(properties, name, this.resolveValue(value));
|
|
753
|
+
}
|
|
754
|
+
catch (error) {
|
|
755
|
+
if (!(error instanceof PackageImportError)) {
|
|
756
|
+
throw error;
|
|
757
|
+
}
|
|
758
|
+
errors.push(error);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
catalog.set(key, { ...entry, properties });
|
|
762
|
+
}
|
|
763
|
+
return catalog;
|
|
764
|
+
}
|
|
765
|
+
withSource(source, action) {
|
|
766
|
+
try {
|
|
767
|
+
return action();
|
|
768
|
+
}
|
|
769
|
+
catch (error) {
|
|
770
|
+
if (error instanceof PackageImportError) {
|
|
771
|
+
throw error;
|
|
772
|
+
}
|
|
773
|
+
throw new PackageImportError("STORAGE_IMPORT_FAILED", errorMessage(error), source, {
|
|
774
|
+
cause: error,
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
function validatePropertyAttributes(property) {
|
|
780
|
+
const nullAttribute = property.attributes.is_null;
|
|
781
|
+
if (nullAttribute !== undefined && nullAttribute !== "0" && nullAttribute !== "1") {
|
|
782
|
+
throw new PackageImportError("INVALID_NULL", "is_null must be '0' or '1'.", property.source);
|
|
783
|
+
}
|
|
784
|
+
for (const name of ["condition", "date_range", "is_not_null"]) {
|
|
785
|
+
if (property.attributes[name] !== undefined) {
|
|
786
|
+
throw new PackageImportError("UNSUPPORTED_PROPERTY_ATTRIBUTE", `Property attribute '${name}' is not implemented.`, property.source);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return nullAttribute;
|
|
790
|
+
}
|
|
791
|
+
//# sourceMappingURL=importer.js.map
|