@innovatorstack/harness 0.0.0-stage → 0.1.1
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 +106 -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,153 @@
|
|
|
1
|
+
import { spendContext } from "../../core/context.js";
|
|
2
|
+
import { dataNodesMax } from "../../core/limits.js";
|
|
3
|
+
import { PlatformError } from "../errors.js";
|
|
4
|
+
export function recordKey(record) {
|
|
5
|
+
return JSON.stringify([record.type.toLowerCase(), record.id.toLowerCase()]);
|
|
6
|
+
}
|
|
7
|
+
export class ReferenceCatalog {
|
|
8
|
+
storage;
|
|
9
|
+
constructor(storage) {
|
|
10
|
+
this.storage = storage;
|
|
11
|
+
}
|
|
12
|
+
dependent(definition) {
|
|
13
|
+
const value = this.storage.getCatalogEntry("ItemType", definition.id)?.properties
|
|
14
|
+
.is_dependent;
|
|
15
|
+
if (value !== undefined && value !== null && !["0", "1"].includes(String(value))) {
|
|
16
|
+
throw new PlatformError("InvalidDependency", `Invalid is_dependent on '${definition.name}'.`);
|
|
17
|
+
}
|
|
18
|
+
return String(value ?? "0") === "1";
|
|
19
|
+
}
|
|
20
|
+
relationship(definition) {
|
|
21
|
+
const candidates = this.storage
|
|
22
|
+
.listCatalogEntries("RelationshipType")
|
|
23
|
+
.filter((entry) => String(entry.properties.relationship_id).toLowerCase() ===
|
|
24
|
+
definition.id.toLowerCase());
|
|
25
|
+
if (candidates.length > 1) {
|
|
26
|
+
throw new PlatformError("AmbiguousRelationship", `Multiple RelationshipTypes own '${definition.name}'.`);
|
|
27
|
+
}
|
|
28
|
+
return candidates[0];
|
|
29
|
+
}
|
|
30
|
+
target(property) {
|
|
31
|
+
if (property.dataType !== "item" || !property.dataSource) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
return this.storage
|
|
35
|
+
.listItemTypes()
|
|
36
|
+
.find((definition) => definition.id.toLowerCase() === property.dataSource?.toLowerCase());
|
|
37
|
+
}
|
|
38
|
+
*incoming(target, context, ids = new Set([target.id.toLowerCase()])) {
|
|
39
|
+
const definition = this.storage.getItemType(target.type);
|
|
40
|
+
if (!definition) {
|
|
41
|
+
throw new PlatformError("MissingItemType", `Reference target '${target.type}' has no schema.`);
|
|
42
|
+
}
|
|
43
|
+
for (const source of this.storage.listItemTypes()) {
|
|
44
|
+
spendContext(context, source.properties.length + 1);
|
|
45
|
+
const properties = source.properties.filter((property) => property.dataType === "item" &&
|
|
46
|
+
property.name !== "config_id" &&
|
|
47
|
+
property.dataSource?.toLowerCase() === definition.id.toLowerCase());
|
|
48
|
+
if (properties.length === 0) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
for (const record of this.storage.listItems(source.name)) {
|
|
52
|
+
spendContext(context, properties.length + 1);
|
|
53
|
+
for (const property of properties) {
|
|
54
|
+
if (ids.has(String(record.properties[property.name]).toLowerCase())) {
|
|
55
|
+
yield { definition: source, property, record };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
*owned(parent, context) {
|
|
62
|
+
const definition = this.storage.getItemType(parent.type);
|
|
63
|
+
if (!definition) {
|
|
64
|
+
throw new PlatformError("MissingItemType", `Relationship owner '${parent.type}' has no schema.`);
|
|
65
|
+
}
|
|
66
|
+
for (const incoming of this.incoming(parent, context)) {
|
|
67
|
+
if (incoming.definition.isRelationship && incoming.property.name === "source_id") {
|
|
68
|
+
yield incoming.record;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
hasOwner(record, context) {
|
|
73
|
+
const pending = [...this.family(record)];
|
|
74
|
+
const visited = new Set();
|
|
75
|
+
while (pending.length > 0) {
|
|
76
|
+
const target = pending.pop();
|
|
77
|
+
if (!target || visited.size >= dataNodesMax) {
|
|
78
|
+
throw new PlatformError("ProtocolLimit", "Dependent ownership exceeds its graph budget.");
|
|
79
|
+
}
|
|
80
|
+
const key = recordKey(target);
|
|
81
|
+
if (visited.has(key)) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
visited.add(key);
|
|
85
|
+
spendContext(context);
|
|
86
|
+
for (const owner of this.owners(target, context)) {
|
|
87
|
+
const type = this.storage.getItemType(owner.type);
|
|
88
|
+
if (!type) {
|
|
89
|
+
throw new PlatformError("MissingItemType", `Reference owner '${owner.type}' has no schema.`);
|
|
90
|
+
}
|
|
91
|
+
if (!this.dependent(type) && !type.isRelationship) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
pending.push(...this.family(owner));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
family(record) {
|
|
100
|
+
const definition = this.storage.getItemType(record.type);
|
|
101
|
+
if (!definition?.isVersionable) {
|
|
102
|
+
return [record];
|
|
103
|
+
}
|
|
104
|
+
const configId = String(record.properties.config_id ?? record.id).toLowerCase();
|
|
105
|
+
return this.storage
|
|
106
|
+
.listItems(record.type)
|
|
107
|
+
.filter((candidate) => String(candidate.properties.config_id ?? candidate.id).toLowerCase() ===
|
|
108
|
+
configId);
|
|
109
|
+
}
|
|
110
|
+
current(record) {
|
|
111
|
+
const definition = this.storage.getItemType(record.type);
|
|
112
|
+
if (!definition?.isVersionable) {
|
|
113
|
+
const current = this.storage.getItem(record.type, record.id);
|
|
114
|
+
if (!current) {
|
|
115
|
+
throw new PlatformError("MissingItem", `Reference target '${record.type}:${record.id}' disappeared.`);
|
|
116
|
+
}
|
|
117
|
+
return current;
|
|
118
|
+
}
|
|
119
|
+
const current = this.family(record).filter((candidate) => String(candidate.properties.is_current) === "1");
|
|
120
|
+
const result = current[0];
|
|
121
|
+
if (current.length !== 1 || !result) {
|
|
122
|
+
throw new PlatformError("InvalidGeneration", `Reference family '${record.type}:${record.properties.config_id}' needs one current generation.`);
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
*owners(record, context) {
|
|
127
|
+
const definition = this.storage.getItemType(record.type);
|
|
128
|
+
if (definition?.isRelationship) {
|
|
129
|
+
const parent = this.parent(definition, record);
|
|
130
|
+
if (parent) {
|
|
131
|
+
yield parent;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
for (const incoming of this.incoming(record, context)) {
|
|
135
|
+
if (incoming.definition.isRelationship && incoming.property.name === "source_id") {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
const owner = incoming.definition.isRelationship
|
|
139
|
+
? this.parent(incoming.definition, incoming.record)
|
|
140
|
+
: incoming.record;
|
|
141
|
+
if (owner) {
|
|
142
|
+
yield owner;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
parent(definition, record) {
|
|
147
|
+
const source = definition.properties.find((property) => property.name === "source_id");
|
|
148
|
+
const type = source ? this.target(source) : undefined;
|
|
149
|
+
const id = record.properties.source_id;
|
|
150
|
+
return type && typeof id === "string" ? this.storage.getItem(type.name, id) : undefined;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/platform/references/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AASpD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ7C,MAAM,UAAU,SAAS,CAAC,MAAuC;IAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,OAAO,gBAAgB;IACI,OAAO;IAApC,YAA6B,OAAuB;uBAAvB,OAAO;IAAmB,CAAC;IAExD,SAAS,CAAC,UAA8B;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC,EAAE,UAAU;aAC5E,YAAY,CAAC;QAElB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CA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IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBAC/E,SAAS;YACb,CAAC;YAED,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,cAAc;gBAC5C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC;gBACnD,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAEtB,IAAI,KAAK,EAAE,CAAC;gBACR,MAAM,KAAK,CAAC;YAChB,CAAC;QACL,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,UAA8B,EAAE,MAAkB;QAC7D,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;QACvF,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACtD,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;QAEvC,OAAO,IAAI,IAAI,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5F,CAAC;CACJ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExecutionContext } from "../../core/types.js";
|
|
2
|
+
import { Item } from "../../items/item.js";
|
|
3
|
+
import type { HarnessStorage, StoredItem } from "../../storage/types.js";
|
|
4
|
+
import type { ApplyQueryItem } from "../queries/planner.js";
|
|
5
|
+
import type { ReferenceCatalog } from "./catalog.js";
|
|
6
|
+
import type { ReferenceSessions } from "./sessions.js";
|
|
7
|
+
export declare class DependentDeletion {
|
|
8
|
+
private readonly storage;
|
|
9
|
+
private readonly catalog;
|
|
10
|
+
private readonly sessions;
|
|
11
|
+
private readonly apply;
|
|
12
|
+
private readonly removeOwned;
|
|
13
|
+
constructor(storage: HarnessStorage, catalog: ReferenceCatalog, sessions: ReferenceSessions, apply: ApplyQueryItem, removeOwned: (parent: StoredItem, child: StoredItem, enabled: boolean, context: ExecutionContext) => Promise<Item>);
|
|
14
|
+
prepare(records: readonly StoredItem[], context: ExecutionContext): void;
|
|
15
|
+
children(record: StoredItem, enabled: boolean, context: ExecutionContext): Promise<void>;
|
|
16
|
+
assertRemovable(record: StoredItem, context: ExecutionContext): void;
|
|
17
|
+
changed(before: StoredItem, after: StoredItem | undefined, enabled: boolean, context: ExecutionContext): Promise<void>;
|
|
18
|
+
private remove;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=deletion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletion.d.ts","sourceRoot":"","sources":["../../../src/platform/references/deletion.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,qBAAa,iBAAiB;IAEtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW;IALhC,YACqB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,cAAc,EACrB,WAAW,EAAE,CAC1B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,gBAAgB,KACxB,OAAO,CAAC,IAAI,CAAC,EAClB;IAEJ,OAAO,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAsBvE;IAEK,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAM7F;IAED,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAYnE;IAEK,OAAO,CACT,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,gBAAgB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAqCf;YAEa,MAAM;CAcvB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { spendContext } from "../../core/context.js";
|
|
2
|
+
import { dataNodesMax } from "../../core/limits.js";
|
|
3
|
+
import { Item } from "../../items/item.js";
|
|
4
|
+
import { ApplicationError, PlatformError, requireSuccess } from "../errors.js";
|
|
5
|
+
import { recordKey } from "./catalog.js";
|
|
6
|
+
export class DependentDeletion {
|
|
7
|
+
storage;
|
|
8
|
+
catalog;
|
|
9
|
+
sessions;
|
|
10
|
+
apply;
|
|
11
|
+
removeOwned;
|
|
12
|
+
constructor(storage, catalog, sessions, apply, removeOwned) {
|
|
13
|
+
this.storage = storage;
|
|
14
|
+
this.catalog = catalog;
|
|
15
|
+
this.sessions = sessions;
|
|
16
|
+
this.apply = apply;
|
|
17
|
+
this.removeOwned = removeOwned;
|
|
18
|
+
}
|
|
19
|
+
prepare(records, context) {
|
|
20
|
+
const pending = [...records];
|
|
21
|
+
const visited = new Set();
|
|
22
|
+
while (pending.length > 0) {
|
|
23
|
+
const record = pending.pop();
|
|
24
|
+
if (!record || visited.size >= dataNodesMax) {
|
|
25
|
+
throw new PlatformError("ProtocolLimit", "Deletion exceeds its graph budget.");
|
|
26
|
+
}
|
|
27
|
+
spendContext(context);
|
|
28
|
+
const key = recordKey(record);
|
|
29
|
+
if (visited.has(key)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
visited.add(key);
|
|
33
|
+
this.sessions.schedule(record, context);
|
|
34
|
+
pending.push(...this.catalog.owned(record, context));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async children(record, enabled, context) {
|
|
38
|
+
for (const child of this.catalog.owned(record, context)) {
|
|
39
|
+
if (this.storage.getItem(child.type, child.id)) {
|
|
40
|
+
requireSuccess(await this.removeOwned(record, child, enabled, context));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
assertRemovable(record, context) {
|
|
45
|
+
for (const incoming of this.catalog.incoming(record, context)) {
|
|
46
|
+
if (!this.sessions.scheduled(incoming.record, context)) {
|
|
47
|
+
throw new ApplicationError(Item.error(`Cannot delete '${record.type}:${record.id}': referenced by ` +
|
|
48
|
+
`'${incoming.definition.name}.${incoming.property.name}'.`, "ReferencedItem"));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async changed(before, after, enabled, context) {
|
|
53
|
+
const definition = this.storage.getItemType(before.type);
|
|
54
|
+
if (!definition) {
|
|
55
|
+
throw new PlatformError("MissingItemType", `Changed reference source '${before.type}' has no schema.`);
|
|
56
|
+
}
|
|
57
|
+
for (const property of definition.properties) {
|
|
58
|
+
if (property.name === "config_id" || property.name === "source_id") {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const previous = before.properties[property.name];
|
|
62
|
+
const target = this.catalog.target(property);
|
|
63
|
+
if (!target ||
|
|
64
|
+
!this.catalog.dependent(target) ||
|
|
65
|
+
typeof previous !== "string" ||
|
|
66
|
+
after?.properties[property.name] === previous) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const orphan = this.storage.getItem(target.name, previous);
|
|
70
|
+
if (orphan &&
|
|
71
|
+
!this.sessions.active(orphan, context) &&
|
|
72
|
+
!this.catalog.hasOwner(orphan, context)) {
|
|
73
|
+
await this.remove(orphan, enabled, context);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async remove(record, enabled, context) {
|
|
78
|
+
const request = Item.create(record.type, "delete");
|
|
79
|
+
request.setProperty("id", record.id);
|
|
80
|
+
if (!enabled) {
|
|
81
|
+
request.setAttribute("serverEvents", "0");
|
|
82
|
+
}
|
|
83
|
+
requireSuccess(await this.apply(request, context));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=deletion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletion.js","sourceRoot":"","sources":["../../../src/platform/references/deletion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,MAAM,OAAO,iBAAiB;IAEL,OAAO;IACP,OAAO;IACP,QAAQ;IACR,KAAK;IACL,WAAW;IALhC,YACqB,OAAuB,EACvB,OAAyB,EACzB,QAA2B,EAC3B,KAAqB,EACrB,WAKC;uBATD,OAAO;uBACP,OAAO;wBACP,QAAQ;qBACR,KAAK;2BACL,WAAW;IAM7B,CAAC;IAEJ,OAAO,CAAC,OAA8B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M,CAAC;gBAC/B,OAAO,QAAQ,KAAK,QAAQ;gBAC5B,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,QAAQ,EAC/C,CAAC;gBACC,SAAS;YACb,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAE3D,IACI,MAAM;gBACN,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBACtC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,EACzC,CAAC;gBACC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAChD,CAAC;QACL,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,MAAM,CAChB,MAAkB,EAClB,OAAgB,EAChB,OAAyB;QAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACnD,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;QAED,cAAc,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,CAAC;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExecutionContext } from "../../core/types.js";
|
|
2
|
+
import type { HarnessStorage, ItemTypeDefinition, StorageValue, StoredItem } from "../../storage/types.js";
|
|
3
|
+
import type { PlatformTrace } from "../trace.js";
|
|
4
|
+
import { ReferenceCatalog } from "./catalog.js";
|
|
5
|
+
import { ReferencePolicies } from "./policy.js";
|
|
6
|
+
import { ReferenceSessions } from "./sessions.js";
|
|
7
|
+
/** Reference maintenance is a platform write, sharing its caller's transaction and trace. */
|
|
8
|
+
export declare class ReferenceMaintenance {
|
|
9
|
+
private readonly storage;
|
|
10
|
+
private readonly trace;
|
|
11
|
+
readonly catalog: ReferenceCatalog;
|
|
12
|
+
readonly policies: ReferencePolicies;
|
|
13
|
+
readonly sessions: ReferenceSessions;
|
|
14
|
+
constructor(storage: HarnessStorage, trace: PlatformTrace);
|
|
15
|
+
initialize(definition: ItemTypeDefinition, record: StoredItem): StoredItem;
|
|
16
|
+
versioned(previous: StoredItem, current: StoredItem, context: ExecutionContext): void;
|
|
17
|
+
copied(definition: ItemTypeDefinition, record: StoredItem, parentId: string, resetBehavior?: boolean): Readonly<Record<string, StorageValue>>;
|
|
18
|
+
freeze(record: StoredItem, context: ExecutionContext): void;
|
|
19
|
+
promoted(parent: StoredItem, context: ExecutionContext): void;
|
|
20
|
+
private change;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=maintenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintenance.d.ts","sourceRoot":"","sources":["../../../src/platform/references/maintenance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EACR,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,6FAA6F;AAC7F,qBAAa,oBAAoB;IAMzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAN1B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC,YACqB,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,aAAa,EAKxC;IAED,UAAU,CAAC,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAYzE;IAED,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAuBpF;IAED,MAAM,CACF,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,EAChB,aAAa,UAAQ,GACtB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CA4BxC;IAED,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAE1D;IAED,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAmC5D;IAED,OAAO,CAAC,MAAM;CA6BjB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { assertActiveContext, spendContext } from "../../core/context.js";
|
|
2
|
+
import { PlatformError } from "../errors.js";
|
|
3
|
+
import { ReferenceBehavior, floats } from "./behavior.js";
|
|
4
|
+
import { ReferenceCatalog } from "./catalog.js";
|
|
5
|
+
import { ReferencePolicies } from "./policy.js";
|
|
6
|
+
import { ReferenceSessions } from "./sessions.js";
|
|
7
|
+
/** Reference maintenance is a platform write, sharing its caller's transaction and trace. */
|
|
8
|
+
export class ReferenceMaintenance {
|
|
9
|
+
storage;
|
|
10
|
+
trace;
|
|
11
|
+
catalog;
|
|
12
|
+
policies;
|
|
13
|
+
sessions;
|
|
14
|
+
constructor(storage, trace) {
|
|
15
|
+
this.storage = storage;
|
|
16
|
+
this.trace = trace;
|
|
17
|
+
this.catalog = new ReferenceCatalog(storage);
|
|
18
|
+
this.policies = new ReferencePolicies(storage, this.catalog);
|
|
19
|
+
this.sessions = new ReferenceSessions(storage, this.catalog);
|
|
20
|
+
}
|
|
21
|
+
initialize(definition, record) {
|
|
22
|
+
if (!definition.isRelationship) {
|
|
23
|
+
return record;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
...record,
|
|
27
|
+
properties: {
|
|
28
|
+
...record.properties,
|
|
29
|
+
behavior: this.policies.relationship(definition, record),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
versioned(previous, current, context) {
|
|
34
|
+
if (this.storage.getItemType(previous.type)?.isRelationship) {
|
|
35
|
+
this.freeze(previous, context);
|
|
36
|
+
}
|
|
37
|
+
const ids = new Set(this.catalog.family(previous).map((record) => record.id.toLowerCase()));
|
|
38
|
+
for (const incoming of this.catalog.incoming(previous, context, ids)) {
|
|
39
|
+
const { definition, property, record } = incoming;
|
|
40
|
+
if (this.policies.historical(definition, record) || property.name === "source_id") {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const behavior = definition.isRelationship && property.name === "related_id"
|
|
44
|
+
? this.policies.relationship(definition, record)
|
|
45
|
+
: this.policies.property(property);
|
|
46
|
+
if (floats(behavior)) {
|
|
47
|
+
this.change(record, { [property.name]: current.id }, "float", context);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
copied(definition, record, parentId, resetBehavior = false) {
|
|
52
|
+
const properties = {
|
|
53
|
+
...record.properties,
|
|
54
|
+
source_id: parentId,
|
|
55
|
+
};
|
|
56
|
+
if (resetBehavior) {
|
|
57
|
+
properties.behavior = null;
|
|
58
|
+
}
|
|
59
|
+
const related = definition.properties.find((property) => property.name === "related_id");
|
|
60
|
+
const target = related ? this.catalog.target(related) : undefined;
|
|
61
|
+
const id = properties.related_id;
|
|
62
|
+
if (target && typeof id === "string" && id !== "") {
|
|
63
|
+
const existing = this.storage.getItem(target.name, id);
|
|
64
|
+
if (!existing) {
|
|
65
|
+
throw new PlatformError("MissingReference", `Copied relationship '${record.type}:${record.id}' points to missing '${target.name}:${id}'.`);
|
|
66
|
+
}
|
|
67
|
+
properties.related_id = this.catalog.current(existing).id;
|
|
68
|
+
}
|
|
69
|
+
return this.initialize(definition, { ...record, properties }).properties;
|
|
70
|
+
}
|
|
71
|
+
freeze(record, context) {
|
|
72
|
+
this.change(record, { behavior: ReferenceBehavior.HardFixed }, "freeze", context);
|
|
73
|
+
}
|
|
74
|
+
promoted(parent, context) {
|
|
75
|
+
for (const record of this.catalog.owned(parent, context)) {
|
|
76
|
+
spendContext(context);
|
|
77
|
+
const definition = this.storage.getItemType(record.type);
|
|
78
|
+
if (!definition) {
|
|
79
|
+
throw new PlatformError("MissingItemType", `Relationship '${record.type}' has no schema.`);
|
|
80
|
+
}
|
|
81
|
+
const behavior = this.policies.relationship(definition, record);
|
|
82
|
+
const changes = { behavior };
|
|
83
|
+
const property = definition.properties.find((property) => property.name === "related_id");
|
|
84
|
+
const target = property ? this.catalog.target(property) : undefined;
|
|
85
|
+
const id = record.properties.related_id;
|
|
86
|
+
if (floats(behavior) && target && typeof id === "string" && id !== "") {
|
|
87
|
+
const referenced = this.storage.getItem(target.name, id);
|
|
88
|
+
if (!referenced) {
|
|
89
|
+
throw new PlatformError("MissingReference", `Relationship '${record.type}:${record.id}' has a missing related Item.`);
|
|
90
|
+
}
|
|
91
|
+
changes.related_id = this.catalog.current(referenced).id;
|
|
92
|
+
}
|
|
93
|
+
this.change(record, changes, "reference-policy", context);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
change(record, values, name, context) {
|
|
97
|
+
const before = this.storage.getItem(record.type, record.id);
|
|
98
|
+
if (!before) {
|
|
99
|
+
throw new PlatformError("MissingItem", `Reference source '${record.type}:${record.id}' disappeared.`);
|
|
100
|
+
}
|
|
101
|
+
if (Object.entries(values).every(([name, value]) => before.properties[name] === value)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
assertActiveContext(context);
|
|
105
|
+
this.storage.updateItem(record.type, record.id, values);
|
|
106
|
+
const after = this.storage.getItem(record.type, record.id);
|
|
107
|
+
if (!after) {
|
|
108
|
+
throw new Error("Reference maintenance must retain its source record.");
|
|
109
|
+
}
|
|
110
|
+
this.trace.record(context, { kind: "mutation", name, before, after });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=maintenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintenance.js","sourceRoot":"","sources":["../../../src/platform/references/maintenance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQ1E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,6FAA6F;AAC7F,MAAM,OAAO,oBAAoB;IAMR,OAAO;IACP,KAAK;IANjB,OAAO,CAAmB;IAC1B,QAAQ,CAAoB;IAC5B,QAAQ,CAAoB;IAErC,YACqB,OAAuB,EACvB,KAAoB;uBADpB,OAAO;qBACP,KAAK;QAEtB,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAED,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,CAAC,OAAO,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QAE3D,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAC5E,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;CACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HarnessStorage, ItemTypeDefinition, PropertyDefinition, StoredItem } from "../../storage/types.js";
|
|
2
|
+
import { ReferenceBehavior } from "./behavior.js";
|
|
3
|
+
import type { ReferenceCatalog } from "./catalog.js";
|
|
4
|
+
/** Metadata controls reference behavior; no consumer policy configuration is required. */
|
|
5
|
+
export declare class ReferencePolicies {
|
|
6
|
+
private readonly storage;
|
|
7
|
+
private readonly catalog;
|
|
8
|
+
constructor(storage: HarnessStorage, catalog: ReferenceCatalog);
|
|
9
|
+
property(property: PropertyDefinition): ReferenceBehavior;
|
|
10
|
+
relationship(definition: ItemTypeDefinition, record: StoredItem): ReferenceBehavior;
|
|
11
|
+
historical(definition: ItemTypeDefinition, record: StoredItem): boolean;
|
|
12
|
+
private source;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../src/platform/references/policy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAmC,MAAM,eAAe,CAAC;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,0FAA0F;AAC1F,qBAAa,iBAAiB;IAEtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF5B,YACqB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,gBAAgB,EAC1C;IAEJ,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,iBAAiB,CAiBxD;IAED,YAAY,CAAC,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,CAsBlF;IAED,UAAU,CAAC,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CA8BtE;IAED,OAAO,CAAC,MAAM;CAoBjB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { dataDepthMax } from "../../core/limits.js";
|
|
2
|
+
import { PlatformError } from "../errors.js";
|
|
3
|
+
import { ReferenceBehavior, hardBehavior, referenceBehavior } from "./behavior.js";
|
|
4
|
+
import { recordKey } from "./catalog.js";
|
|
5
|
+
/** Metadata controls reference behavior; no consumer policy configuration is required. */
|
|
6
|
+
export class ReferencePolicies {
|
|
7
|
+
storage;
|
|
8
|
+
catalog;
|
|
9
|
+
constructor(storage, catalog) {
|
|
10
|
+
this.storage = storage;
|
|
11
|
+
this.catalog = catalog;
|
|
12
|
+
}
|
|
13
|
+
property(property) {
|
|
14
|
+
if (property.name === "config_id" || property.name === "source_id" || !property.id) {
|
|
15
|
+
return ReferenceBehavior.Fixed;
|
|
16
|
+
}
|
|
17
|
+
const metadata = this.storage.getCatalogEntry("Property", property.id);
|
|
18
|
+
const configured = referenceBehavior(metadata?.properties.item_behavior);
|
|
19
|
+
if (configured !== undefined) {
|
|
20
|
+
return configured;
|
|
21
|
+
}
|
|
22
|
+
const defaults = this.storage
|
|
23
|
+
.getItemType("Property")
|
|
24
|
+
?.properties.find((property) => property.name === "item_behavior")?.defaultValue;
|
|
25
|
+
return referenceBehavior(defaults) ?? ReferenceBehavior.Float;
|
|
26
|
+
}
|
|
27
|
+
relationship(definition, record) {
|
|
28
|
+
const template = referenceBehavior(this.catalog.relationship(definition)?.properties.behavior);
|
|
29
|
+
const instance = referenceBehavior(record.properties.behavior);
|
|
30
|
+
if (template !== undefined && hardBehavior(template)) {
|
|
31
|
+
return template;
|
|
32
|
+
}
|
|
33
|
+
if (instance !== undefined && hardBehavior(instance)) {
|
|
34
|
+
return instance;
|
|
35
|
+
}
|
|
36
|
+
const source = this.source(definition, record);
|
|
37
|
+
const state = this.storage.getCatalogEntry("Life Cycle State", String(source?.properties.current_state ?? ""));
|
|
38
|
+
const configured = referenceBehavior(state?.properties.item_behavior);
|
|
39
|
+
return configured ?? instance ?? template ?? ReferenceBehavior.Fixed;
|
|
40
|
+
}
|
|
41
|
+
historical(definition, record) {
|
|
42
|
+
const visited = new Set();
|
|
43
|
+
let current = record;
|
|
44
|
+
let type = definition;
|
|
45
|
+
while (current && type) {
|
|
46
|
+
const key = recordKey(current);
|
|
47
|
+
if (visited.has(key) || visited.size >= dataDepthMax) {
|
|
48
|
+
throw new PlatformError("RelationshipCycle", "Reference ownership is cyclic or too deep.");
|
|
49
|
+
}
|
|
50
|
+
visited.add(key);
|
|
51
|
+
if (type.isVersionable && String(current.properties.is_current) === "0") {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (!type.isRelationship) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
current = this.source(type, current);
|
|
58
|
+
type = current ? this.storage.getItemType(current.type) : undefined;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
source(definition, record) {
|
|
63
|
+
const property = definition.properties.find((property) => property.name === "source_id");
|
|
64
|
+
const target = property ? this.catalog.target(property) : undefined;
|
|
65
|
+
const id = record.properties.source_id;
|
|
66
|
+
if (typeof id !== "string" || !target) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
const source = this.storage.getItem(target.name, id);
|
|
70
|
+
if (!source) {
|
|
71
|
+
throw new PlatformError("MissingReference", `Relationship '${record.type}:${record.id}' has no source '${id}'.`);
|
|
72
|
+
}
|
|
73
|
+
return source;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../src/platform/references/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOpD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,0FAA0F;AAC1F,MAAM,OAAO,iBAAiB;IAEL,OAAO;IACP,OAAO;IAF5B,YACqB,OAAuB,EACvB,OAAyB;uBADzB,OAAO;uBACP,OAAO;IACzB,CAAC;IAEJ,QAAQ,CAAC,QAA4B;QACjC,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjF,OAAO,iBAAiB,CAAC,KAAK,CAAC;QACnC,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;QAEzE,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,UAAU,CAAC;QACtB,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C,SAAS,CAAC;QAEvC,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YACpC,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAErD,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,aAAa,CACnB,kBAAkB,EAClB,iBAAiB,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE,oBAAoB,EAAE,IAAI,CACtE,CAAC;QACN,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExecutionContext } from "../../core/types.js";
|
|
2
|
+
import type { HarnessStorage, StoredItem } from "../../storage/types.js";
|
|
3
|
+
import type { ReferenceCatalog } from "./catalog.js";
|
|
4
|
+
/** A Method or AML batch may construct several linked Items before the transaction is checked. */
|
|
5
|
+
export declare class ReferenceSessions {
|
|
6
|
+
private readonly storage;
|
|
7
|
+
private readonly catalog;
|
|
8
|
+
private readonly sessions;
|
|
9
|
+
constructor(storage: HarnessStorage, catalog: ReferenceCatalog);
|
|
10
|
+
run<T>(context: ExecutionContext, work: () => Promise<T>): Promise<T>;
|
|
11
|
+
created(record: StoredItem, context: ExecutionContext): void;
|
|
12
|
+
schedule(record: StoredItem, context: ExecutionContext): void;
|
|
13
|
+
scheduled(record: StoredItem, context: ExecutionContext): boolean;
|
|
14
|
+
active(record: StoredItem, context: ExecutionContext): boolean;
|
|
15
|
+
deleting<T>(record: StoredItem, context: ExecutionContext, work: () => Promise<T>): Promise<T>;
|
|
16
|
+
deleted(record: StoredItem, context: ExecutionContext): void;
|
|
17
|
+
private session;
|
|
18
|
+
private validate;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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