@xyo-network/sdk 7.4.1 → 7.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/api-location-diviner.mjs.map +2 -2
- package/dist/neutral/archivist-abstract.mjs +4 -3
- package/dist/neutral/archivist-abstract.mjs.map +2 -2
- package/dist/neutral/archivist-generic.mjs +1 -1
- package/dist/neutral/archivist-generic.mjs.map +2 -2
- package/dist/neutral/archivist-memory.mjs +1 -1
- package/dist/neutral/archivist-memory.mjs.map +2 -2
- package/dist/neutral/archivist-model.mjs +4 -2
- package/dist/neutral/archivist-model.mjs.map +2 -2
- package/dist/neutral/archivist-wrapper.mjs +22 -4
- package/dist/neutral/archivist-wrapper.mjs.map +2 -2
- package/dist/neutral/boundwitness-loader.mjs +2 -1
- package/dist/neutral/boundwitness-loader.mjs.map +2 -2
- package/dist/neutral/bridge-abstract.mjs +4 -3
- package/dist/neutral/bridge-abstract.mjs.map +2 -2
- package/dist/neutral/bridge-http.mjs +4 -5
- package/dist/neutral/bridge-http.mjs.map +2 -2
- package/dist/neutral/bridge-model.mjs +4 -2
- package/dist/neutral/bridge-model.mjs.map +2 -2
- package/dist/neutral/bridge-wrapper.mjs +18 -3
- package/dist/neutral/bridge-wrapper.mjs.map +2 -2
- package/dist/neutral/bridge.mjs.map +2 -2
- package/dist/neutral/diviner-abstract.mjs +2 -1
- package/dist/neutral/diviner-abstract.mjs.map +2 -2
- package/dist/neutral/diviner-model.mjs +4 -2
- package/dist/neutral/diviner-model.mjs.map +2 -2
- package/dist/neutral/diviner-payload-generic.mjs +1 -2
- package/dist/neutral/diviner-payload-generic.mjs.map +2 -2
- package/dist/neutral/diviner-wrapper.mjs +22 -4
- package/dist/neutral/diviner-wrapper.mjs.map +2 -2
- package/dist/neutral/module-abstract.mjs +57 -60
- package/dist/neutral/module-abstract.mjs.map +2 -2
- package/dist/neutral/module-factory-locator.mjs +4 -2
- package/dist/neutral/module-factory-locator.mjs.map +2 -2
- package/dist/neutral/module-resolver.mjs +30 -31
- package/dist/neutral/module-resolver.mjs.map +2 -2
- package/dist/neutral/module-wrapper.mjs +7 -4
- package/dist/neutral/module-wrapper.mjs.map +2 -2
- package/dist/neutral/modules/api-location-diviner/LocationDiviner/LocationDivinerApi.d.ts +5 -3
- package/dist/neutral/modules/api-location-diviner/LocationDiviner/LocationDivinerApi.d.ts.map +1 -1
- package/dist/neutral/modules/api-location-diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +7 -3
- package/dist/neutral/modules/api-location-diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts.map +1 -1
- package/dist/neutral/modules/api-location-diviner/RemoteDivinerConfig.d.ts +1 -2
- package/dist/neutral/modules/api-location-diviner/RemoteDivinerConfig.d.ts.map +1 -1
- package/dist/neutral/modules/archivist-abstract/payloadAdmission.d.ts.map +1 -1
- package/dist/neutral/modules/archivist-model/typeChecks.d.ts.map +1 -1
- package/dist/neutral/modules/archivist-wrapper/ArchivistWrapper.d.ts.map +1 -1
- package/dist/neutral/modules/boundwitness-loader/Loader.d.ts.map +1 -1
- package/dist/neutral/modules/bridge/index.d.ts +3 -0
- package/dist/neutral/modules/bridge/index.d.ts.map +1 -1
- package/dist/neutral/modules/bridge/model.d.ts +1 -0
- package/dist/neutral/modules/bridge/model.d.ts.map +1 -1
- package/dist/neutral/modules/bridge/wrapper.d.ts +1 -0
- package/dist/neutral/modules/bridge/wrapper.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-abstract/AbstractBridge.d.ts +1 -0
- package/dist/neutral/modules/bridge-abstract/AbstractBridge.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-abstract/AbstractBridgeModuleResolver.d.ts +2 -0
- package/dist/neutral/modules/bridge-abstract/AbstractBridgeModuleResolver.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-abstract/AbstractModuleProxy/AbstractModuleProxy.d.ts +2 -0
- package/dist/neutral/modules/bridge-abstract/AbstractModuleProxy/AbstractModuleProxy.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-abstract/AbstractModuleProxy/ModuleProxyResolver.d.ts +2 -0
- package/dist/neutral/modules/bridge-abstract/AbstractModuleProxy/ModuleProxyResolver.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-abstract/index.d.ts +4 -0
- package/dist/neutral/modules/bridge-abstract/index.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-abstract/wrapModuleWithType.d.ts +1 -0
- package/dist/neutral/modules/bridge-abstract/wrapModuleWithType.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-http/HttpBridge.d.ts +2 -0
- package/dist/neutral/modules/bridge-http/HttpBridge.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-http/HttpBridgeConfig.d.ts +8 -0
- package/dist/neutral/modules/bridge-http/HttpBridgeConfig.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-http/HttpBridgeModuleResolver.d.ts +4 -2
- package/dist/neutral/modules/bridge-http/HttpBridgeModuleResolver.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-http/ModuleProxy/ModuleProxy.d.ts +3 -0
- package/dist/neutral/modules/bridge-http/ModuleProxy/ModuleProxy.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-http/ModuleProxy/index.d.ts +1 -0
- package/dist/neutral/modules/bridge-http/ModuleProxy/index.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-http/index.d.ts +2 -0
- package/dist/neutral/modules/bridge-http/index.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Config.d.ts +10 -0
- package/dist/neutral/modules/bridge-model/Config.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/EventData.d.ts +1 -0
- package/dist/neutral/modules/bridge-model/EventData.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Events/Exposed.d.ts +2 -0
- package/dist/neutral/modules/bridge-model/Events/Exposed.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Events/QueryFulfillFinished.d.ts +2 -0
- package/dist/neutral/modules/bridge-model/Events/QueryFulfillFinished.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Events/QueryFulfillStarted.d.ts +2 -0
- package/dist/neutral/modules/bridge-model/Events/QueryFulfillStarted.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Events/QuerySendFinished.d.ts +2 -0
- package/dist/neutral/modules/bridge-model/Events/QuerySendFinished.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Events/QuerySendStarted.d.ts +2 -0
- package/dist/neutral/modules/bridge-model/Events/QuerySendStarted.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Events/Unexposed.d.ts +2 -0
- package/dist/neutral/modules/bridge-model/Events/Unexposed.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Instance.d.ts +1 -0
- package/dist/neutral/modules/bridge-model/Instance.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Module.d.ts +1 -0
- package/dist/neutral/modules/bridge-model/Module.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Params.d.ts +1 -0
- package/dist/neutral/modules/bridge-model/Params.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Queries/Connect.d.ts +7 -0
- package/dist/neutral/modules/bridge-model/Queries/Connect.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Queries/Disconnect.d.ts +7 -0
- package/dist/neutral/modules/bridge-model/Queries/Disconnect.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Queries/Expose.d.ts +15 -0
- package/dist/neutral/modules/bridge-model/Queries/Expose.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Queries/Unexpose.d.ts +8 -0
- package/dist/neutral/modules/bridge-model/Queries/Unexpose.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/Queries/index.d.ts +2 -0
- package/dist/neutral/modules/bridge-model/Queries/index.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/QueryFunctions.d.ts +1 -0
- package/dist/neutral/modules/bridge-model/QueryFunctions.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/RawQueryFunctions.d.ts +1 -0
- package/dist/neutral/modules/bridge-model/RawQueryFunctions.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/attachable/AttachableInstance.d.ts +3 -0
- package/dist/neutral/modules/bridge-model/attachable/AttachableInstance.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/attachable/asAttachableInstance.d.ts +1 -0
- package/dist/neutral/modules/bridge-model/attachable/asAttachableInstance.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/attachable/isAttachableInstance.d.ts +2 -0
- package/dist/neutral/modules/bridge-model/attachable/isAttachableInstance.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/index.d.ts +1 -0
- package/dist/neutral/modules/bridge-model/index.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-model/typeChecks.d.ts +12 -2
- package/dist/neutral/modules/bridge-model/typeChecks.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-wrapper/BridgeWrapper.d.ts +1 -0
- package/dist/neutral/modules/bridge-wrapper/BridgeWrapper.d.ts.map +1 -1
- package/dist/neutral/modules/bridge-wrapper/index.d.ts +1 -0
- package/dist/neutral/modules/bridge-wrapper/index.d.ts.map +1 -1
- package/dist/neutral/modules/diviner-abstract/AbstractDiviner.d.ts.map +1 -1
- package/dist/neutral/modules/diviner-model/typeChecks.d.ts.map +1 -1
- package/dist/neutral/modules/diviner-payload-generic/Diviner.d.ts.map +1 -1
- package/dist/neutral/modules/diviner-wrapper/DivinerWrapper.d.ts.map +1 -1
- package/dist/neutral/modules/module-abstract/AbstractModule.d.ts +1 -3
- package/dist/neutral/modules/module-abstract/AbstractModule.d.ts.map +1 -1
- package/dist/neutral/modules/module-abstract/AbstractModuleInstance.d.ts.map +1 -1
- package/dist/neutral/modules/module-abstract/Error.d.ts +1 -4
- package/dist/neutral/modules/module-abstract/Error.d.ts.map +1 -1
- package/dist/neutral/modules/module-factory-locator/ModuleFactoryLocator.d.ts.map +1 -1
- package/dist/neutral/modules/module-factory-locator/standardCreatableFactories.d.ts.map +1 -1
- package/dist/neutral/modules/module-resolver/ResolveHelper/ResolveHelper.d.ts.map +1 -1
- package/dist/neutral/modules/module-resolver/SimpleModuleResolver.d.ts.map +1 -1
- package/dist/neutral/modules/module-wrapper/ModuleWrapper.d.ts +7 -1
- package/dist/neutral/modules/module-wrapper/ModuleWrapper.d.ts.map +1 -1
- package/dist/neutral/modules/modules/index.d.ts +1 -0
- package/dist/neutral/modules/modules/index.d.ts.map +1 -1
- package/dist/neutral/modules/node-abstract/AbstractNode.d.ts.map +1 -1
- package/dist/neutral/modules/node-memory/NodeHelper/attachToExistingNode.d.ts.map +1 -1
- package/dist/neutral/modules/node-model/typeChecks.d.ts.map +1 -1
- package/dist/neutral/modules/node-view/ViewNode.d.ts.map +1 -1
- package/dist/neutral/modules/node-wrapper/NodeWrapper.d.ts.map +1 -1
- package/dist/neutral/modules/sentinel-memory/MemorySentinel.d.ts.map +1 -1
- package/dist/neutral/modules/sentinel-memory/SentinelRunner.d.ts.map +1 -1
- package/dist/neutral/modules/sentinel-model/typeChecks.d.ts.map +1 -1
- package/dist/neutral/modules/sentinel-wrapper/Wrapper.d.ts.map +1 -1
- package/dist/neutral/modules/witness-model/typeChecks.d.ts.map +1 -1
- package/dist/neutral/modules/witness-wrapper/WitnessWrapper.d.ts.map +1 -1
- package/dist/neutral/modules.mjs.map +2 -2
- package/dist/neutral/node-abstract.mjs +14 -6
- package/dist/neutral/node-abstract.mjs.map +2 -2
- package/dist/neutral/node-memory.mjs +8 -9
- package/dist/neutral/node-memory.mjs.map +2 -2
- package/dist/neutral/node-model.mjs +2 -1
- package/dist/neutral/node-model.mjs.map +2 -2
- package/dist/neutral/node-view.mjs +11 -10
- package/dist/neutral/node-view.mjs.map +2 -2
- package/dist/neutral/node-wrapper.mjs +19 -4
- package/dist/neutral/node-wrapper.mjs.map +2 -2
- package/dist/neutral/sentinel-abstract.mjs +4 -4
- package/dist/neutral/sentinel-abstract.mjs.map +2 -2
- package/dist/neutral/sentinel-memory.mjs +17 -16
- package/dist/neutral/sentinel-memory.mjs.map +2 -2
- package/dist/neutral/sentinel-model.mjs +4 -2
- package/dist/neutral/sentinel-model.mjs.map +2 -2
- package/dist/neutral/sentinel-wrapper.mjs +22 -4
- package/dist/neutral/sentinel-wrapper.mjs.map +2 -2
- package/dist/neutral/witness-model.mjs +4 -2
- package/dist/neutral/witness-model.mjs.map +2 -2
- package/dist/neutral/witness-wrapper.mjs +22 -4
- package/dist/neutral/witness-wrapper.mjs.map +2 -2
- package/dist/node/modules/api-location-diviner/LocationDiviner/LocationDivinerApi.d.ts +5 -3
- package/dist/node/modules/api-location-diviner/LocationDiviner/LocationDivinerApi.d.ts.map +1 -1
- package/dist/node/modules/api-location-diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +7 -3
- package/dist/node/modules/api-location-diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts.map +1 -1
- package/dist/node/modules/api-location-diviner/RemoteDivinerConfig.d.ts +1 -2
- package/dist/node/modules/api-location-diviner/RemoteDivinerConfig.d.ts.map +1 -1
- package/dist/node/modules/archivist-abstract/payloadAdmission.d.ts.map +1 -1
- package/dist/node/modules/archivist-model/typeChecks.d.ts.map +1 -1
- package/dist/node/modules/archivist-wrapper/ArchivistWrapper.d.ts.map +1 -1
- package/dist/node/modules/boundwitness-loader/Loader.d.ts.map +1 -1
- package/dist/node/modules/bridge/index.d.ts +3 -0
- package/dist/node/modules/bridge/index.d.ts.map +1 -1
- package/dist/node/modules/bridge/model.d.ts +1 -0
- package/dist/node/modules/bridge/model.d.ts.map +1 -1
- package/dist/node/modules/bridge/wrapper.d.ts +1 -0
- package/dist/node/modules/bridge/wrapper.d.ts.map +1 -1
- package/dist/node/modules/bridge-abstract/AbstractBridge.d.ts +1 -0
- package/dist/node/modules/bridge-abstract/AbstractBridge.d.ts.map +1 -1
- package/dist/node/modules/bridge-abstract/AbstractBridgeModuleResolver.d.ts +2 -0
- package/dist/node/modules/bridge-abstract/AbstractBridgeModuleResolver.d.ts.map +1 -1
- package/dist/node/modules/bridge-abstract/AbstractModuleProxy/AbstractModuleProxy.d.ts +2 -0
- package/dist/node/modules/bridge-abstract/AbstractModuleProxy/AbstractModuleProxy.d.ts.map +1 -1
- package/dist/node/modules/bridge-abstract/AbstractModuleProxy/ModuleProxyResolver.d.ts +2 -0
- package/dist/node/modules/bridge-abstract/AbstractModuleProxy/ModuleProxyResolver.d.ts.map +1 -1
- package/dist/node/modules/bridge-abstract/index.d.ts +4 -0
- package/dist/node/modules/bridge-abstract/index.d.ts.map +1 -1
- package/dist/node/modules/bridge-abstract/wrapModuleWithType.d.ts +1 -0
- package/dist/node/modules/bridge-abstract/wrapModuleWithType.d.ts.map +1 -1
- package/dist/node/modules/bridge-http/HttpBridge.d.ts +2 -0
- package/dist/node/modules/bridge-http/HttpBridge.d.ts.map +1 -1
- package/dist/node/modules/bridge-http/HttpBridgeConfig.d.ts +8 -0
- package/dist/node/modules/bridge-http/HttpBridgeConfig.d.ts.map +1 -1
- package/dist/node/modules/bridge-http/HttpBridgeModuleResolver.d.ts +4 -2
- package/dist/node/modules/bridge-http/HttpBridgeModuleResolver.d.ts.map +1 -1
- package/dist/node/modules/bridge-http/ModuleProxy/ModuleProxy.d.ts +3 -0
- package/dist/node/modules/bridge-http/ModuleProxy/ModuleProxy.d.ts.map +1 -1
- package/dist/node/modules/bridge-http/ModuleProxy/index.d.ts +1 -0
- package/dist/node/modules/bridge-http/ModuleProxy/index.d.ts.map +1 -1
- package/dist/node/modules/bridge-http/index.d.ts +2 -0
- package/dist/node/modules/bridge-http/index.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Config.d.ts +10 -0
- package/dist/node/modules/bridge-model/Config.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/EventData.d.ts +1 -0
- package/dist/node/modules/bridge-model/EventData.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Events/Exposed.d.ts +2 -0
- package/dist/node/modules/bridge-model/Events/Exposed.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Events/QueryFulfillFinished.d.ts +2 -0
- package/dist/node/modules/bridge-model/Events/QueryFulfillFinished.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Events/QueryFulfillStarted.d.ts +2 -0
- package/dist/node/modules/bridge-model/Events/QueryFulfillStarted.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Events/QuerySendFinished.d.ts +2 -0
- package/dist/node/modules/bridge-model/Events/QuerySendFinished.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Events/QuerySendStarted.d.ts +2 -0
- package/dist/node/modules/bridge-model/Events/QuerySendStarted.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Events/Unexposed.d.ts +2 -0
- package/dist/node/modules/bridge-model/Events/Unexposed.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Instance.d.ts +1 -0
- package/dist/node/modules/bridge-model/Instance.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Module.d.ts +1 -0
- package/dist/node/modules/bridge-model/Module.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Params.d.ts +1 -0
- package/dist/node/modules/bridge-model/Params.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Queries/Connect.d.ts +7 -0
- package/dist/node/modules/bridge-model/Queries/Connect.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Queries/Disconnect.d.ts +7 -0
- package/dist/node/modules/bridge-model/Queries/Disconnect.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Queries/Expose.d.ts +15 -0
- package/dist/node/modules/bridge-model/Queries/Expose.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Queries/Unexpose.d.ts +8 -0
- package/dist/node/modules/bridge-model/Queries/Unexpose.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/Queries/index.d.ts +2 -0
- package/dist/node/modules/bridge-model/Queries/index.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/QueryFunctions.d.ts +1 -0
- package/dist/node/modules/bridge-model/QueryFunctions.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/RawQueryFunctions.d.ts +1 -0
- package/dist/node/modules/bridge-model/RawQueryFunctions.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/attachable/AttachableInstance.d.ts +3 -0
- package/dist/node/modules/bridge-model/attachable/AttachableInstance.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/attachable/asAttachableInstance.d.ts +1 -0
- package/dist/node/modules/bridge-model/attachable/asAttachableInstance.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/attachable/isAttachableInstance.d.ts +2 -0
- package/dist/node/modules/bridge-model/attachable/isAttachableInstance.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/index.d.ts +1 -0
- package/dist/node/modules/bridge-model/index.d.ts.map +1 -1
- package/dist/node/modules/bridge-model/typeChecks.d.ts +12 -2
- package/dist/node/modules/bridge-model/typeChecks.d.ts.map +1 -1
- package/dist/node/modules/bridge-wrapper/BridgeWrapper.d.ts +1 -0
- package/dist/node/modules/bridge-wrapper/BridgeWrapper.d.ts.map +1 -1
- package/dist/node/modules/bridge-wrapper/index.d.ts +1 -0
- package/dist/node/modules/bridge-wrapper/index.d.ts.map +1 -1
- package/dist/node/modules/diviner-abstract/AbstractDiviner.d.ts.map +1 -1
- package/dist/node/modules/diviner-model/typeChecks.d.ts.map +1 -1
- package/dist/node/modules/diviner-payload-generic/Diviner.d.ts.map +1 -1
- package/dist/node/modules/diviner-wrapper/DivinerWrapper.d.ts.map +1 -1
- package/dist/node/modules/module-abstract/AbstractModule.d.ts +1 -3
- package/dist/node/modules/module-abstract/AbstractModule.d.ts.map +1 -1
- package/dist/node/modules/module-abstract/AbstractModuleInstance.d.ts.map +1 -1
- package/dist/node/modules/module-abstract/Error.d.ts +1 -4
- package/dist/node/modules/module-abstract/Error.d.ts.map +1 -1
- package/dist/node/modules/module-factory-locator/ModuleFactoryLocator.d.ts.map +1 -1
- package/dist/node/modules/module-factory-locator/standardCreatableFactories.d.ts.map +1 -1
- package/dist/node/modules/module-resolver/ResolveHelper/ResolveHelper.d.ts.map +1 -1
- package/dist/node/modules/module-resolver/SimpleModuleResolver.d.ts.map +1 -1
- package/dist/node/modules/module-wrapper/ModuleWrapper.d.ts +7 -1
- package/dist/node/modules/module-wrapper/ModuleWrapper.d.ts.map +1 -1
- package/dist/node/modules/modules/index.d.ts +1 -0
- package/dist/node/modules/modules/index.d.ts.map +1 -1
- package/dist/node/modules/node-abstract/AbstractNode.d.ts.map +1 -1
- package/dist/node/modules/node-memory/NodeHelper/attachToExistingNode.d.ts.map +1 -1
- package/dist/node/modules/node-model/typeChecks.d.ts.map +1 -1
- package/dist/node/modules/node-view/ViewNode.d.ts.map +1 -1
- package/dist/node/modules/node-wrapper/NodeWrapper.d.ts.map +1 -1
- package/dist/node/modules/sentinel-memory/MemorySentinel.d.ts.map +1 -1
- package/dist/node/modules/sentinel-memory/SentinelRunner.d.ts.map +1 -1
- package/dist/node/modules/sentinel-model/typeChecks.d.ts.map +1 -1
- package/dist/node/modules/sentinel-wrapper/Wrapper.d.ts.map +1 -1
- package/dist/node/modules/witness-model/typeChecks.d.ts.map +1 -1
- package/dist/node/modules/witness-wrapper/WitnessWrapper.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -27,7 +27,7 @@ var SentinelIntervalAutomationWrapper = class extends PayloadWrapper {
|
|
|
27
27
|
}
|
|
28
28
|
get frequencyMillis() {
|
|
29
29
|
const frequency = this.payload.frequency;
|
|
30
|
-
if (frequency === void 0) return
|
|
30
|
+
if (frequency === void 0) return Infinity;
|
|
31
31
|
const frequencyUnits = this.payload.frequencyUnits;
|
|
32
32
|
switch (frequencyUnits ?? "hour") {
|
|
33
33
|
case "millis": {
|
|
@@ -46,12 +46,12 @@ var SentinelIntervalAutomationWrapper = class extends PayloadWrapper {
|
|
|
46
46
|
return frequency * 24 * 60 * 60 * 1e3;
|
|
47
47
|
}
|
|
48
48
|
default: {
|
|
49
|
-
return
|
|
49
|
+
return Infinity;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
get remaining() {
|
|
54
|
-
return this.payload.remaining ??
|
|
54
|
+
return this.payload.remaining ?? Infinity;
|
|
55
55
|
}
|
|
56
56
|
next() {
|
|
57
57
|
const now = Date.now();
|
|
@@ -64,15 +64,15 @@ var SentinelIntervalAutomationWrapper = class extends PayloadWrapper {
|
|
|
64
64
|
return this;
|
|
65
65
|
}
|
|
66
66
|
checkEnd() {
|
|
67
|
-
if ((this.payload.start ?? 0) > (this.payload.end ??
|
|
68
|
-
this.setStart(
|
|
67
|
+
if ((this.payload.start ?? 0) > (this.payload.end ?? Infinity)) {
|
|
68
|
+
this.setStart(Infinity);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
consumeRemaining(count = 1) {
|
|
72
72
|
if (this.payload.remaining === void 0) return;
|
|
73
73
|
const remaining = Math.max(this.remaining - count, 0);
|
|
74
74
|
this.setRemaining(remaining);
|
|
75
|
-
if (remaining <= 0) this.setStart(
|
|
75
|
+
if (remaining <= 0) this.setStart(Infinity);
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Sets the remaining of the wrapped automation
|
|
@@ -108,7 +108,7 @@ var SentinelRunner = class extends Base {
|
|
|
108
108
|
get next() {
|
|
109
109
|
return Object.values(this._automations).reduce((previous, current) => {
|
|
110
110
|
if (isSentinelIntervalAutomation(current) && isSentinelIntervalAutomation(previous)) {
|
|
111
|
-
return (current.start ??
|
|
111
|
+
return (current.start ?? Infinity) < (previous?.start ?? Infinity) ? current : previous;
|
|
112
112
|
}
|
|
113
113
|
return current;
|
|
114
114
|
}, void 0);
|
|
@@ -144,7 +144,7 @@ var SentinelRunner = class extends Base {
|
|
|
144
144
|
const now = Date.now();
|
|
145
145
|
const start = Math.max(automation.start ?? now, now);
|
|
146
146
|
const delay = Math.max(start - now, 0);
|
|
147
|
-
if (delay <
|
|
147
|
+
if (delay < Infinity) {
|
|
148
148
|
this.timeoutId = setTimeout(async () => {
|
|
149
149
|
this.timeoutId = void 0;
|
|
150
150
|
return await spanRootAsync("start.setTimeout", async () => {
|
|
@@ -160,15 +160,16 @@ var SentinelRunner = class extends Base {
|
|
|
160
160
|
}, { tracer: this.tracer });
|
|
161
161
|
}, delay);
|
|
162
162
|
}
|
|
163
|
-
} else if (isDefined(automation) && automation.type === "interval" && automation.start !==
|
|
163
|
+
} else if (isDefined(automation) && automation.type === "interval" && automation.start !== Infinity) {
|
|
164
164
|
this.logger?.warn(`Unschedulable interval automation; runner stopped [${JSON.stringify(automation)}]`);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
stop() {
|
|
168
|
-
if (isDefined(this.timeoutId)) {
|
|
169
|
-
|
|
170
|
-
this.timeoutId = void 0;
|
|
168
|
+
if (!isDefined(this.timeoutId)) {
|
|
169
|
+
return;
|
|
171
170
|
}
|
|
171
|
+
clearTimeout(this.timeoutId);
|
|
172
|
+
this.timeoutId = void 0;
|
|
172
173
|
}
|
|
173
174
|
async update(hash, automation, restart = true) {
|
|
174
175
|
this.remove(hash, false);
|
|
@@ -228,10 +229,9 @@ var MemorySentinel = class extends AbstractSentinel {
|
|
|
228
229
|
async inputAddresses(input) {
|
|
229
230
|
if (Array.isArray(input)) {
|
|
230
231
|
return (await Promise.all(input.map(async (inputItem) => await this.inputAddresses(inputItem)))).flat();
|
|
231
|
-
} else {
|
|
232
|
-
const resolved = await this.resolve(input);
|
|
233
|
-
return resolved ? [resolved.address] : [];
|
|
234
232
|
}
|
|
233
|
+
const resolved = await this.resolve(input);
|
|
234
|
+
return resolved ? [resolved.address] : [];
|
|
235
235
|
}
|
|
236
236
|
processPreviousResults(payloads, inputs) {
|
|
237
237
|
return inputs.flatMap((input) => payloads[input] ?? []);
|
|
@@ -300,7 +300,8 @@ var MemorySentinel = class extends AbstractSentinel {
|
|
|
300
300
|
})
|
|
301
301
|
);
|
|
302
302
|
const finalResult = {};
|
|
303
|
-
|
|
303
|
+
const fulfilledResults = results.filter(fulfilled);
|
|
304
|
+
for (const result of fulfilledResults) {
|
|
304
305
|
const [address, payloads] = result.value;
|
|
305
306
|
finalResult[address] = finalResult[address] ?? [];
|
|
306
307
|
finalResult[address].push(...payloads);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/modules/sentinel-memory/MemorySentinel.ts", "../../src/modules/sentinel-memory/SentinelRunner.ts", "../../src/modules/sentinel-memory/SentinelIntervalAutomationWrapper.ts"],
|
|
4
|
-
"sourcesContent": ["import { fulfilled, rejected } from '@ariestools/sdk'\nimport type {\n Payload, Schema, XyoAddress,\n} from '@xyo-network/sdk-protocol'\n\nimport { asDivinerInstance } from '#diviner-model'\nimport { type AnyConfigSchema, type ModuleIdentifier } from '#module-model'\nimport { AbstractSentinel } from '#sentinel-abstract'\nimport type {\n ResolvedTask,\n SentinelConfig,\n SentinelInstance,\n SentinelModuleEventData,\n SentinelParams,\n} from '#sentinel-model'\nimport {\n asSentinelInstance,\n SentinelConfigSchema,\n} from '#sentinel-model'\nimport { asWitnessInstance } from '#witness-model'\n\nimport { SentinelRunner } from './SentinelRunner.ts'\n\nexport type MemorySentinelParams<TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>> = SentinelParams<TConfig>\n\nexport class MemorySentinel<\n TParams extends MemorySentinelParams = MemorySentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, SentinelConfigSchema]\n static override readonly defaultConfigSchema: Schema = SentinelConfigSchema\n\n private runner?: SentinelRunner\n\n async reportHandler(inPayloads: Payload[] = []): Promise<Payload[]> {\n await this.startedAsync('throw')\n this.logger?.debug(`reportHandler:in: ${JSON.stringify(inPayloads)}`)\n const job = await this.jobPromise\n\n let index = 0\n let previousResults: Record<XyoAddress, Payload[]> = {}\n while (index < job.tasks.length) {\n const generatedPayloads = await this.runJob(job.tasks[index], previousResults, inPayloads)\n previousResults = generatedPayloads\n index++\n }\n const result = Object.values(previousResults).flat()\n this.logger?.debug(`reportHandler:out: ${JSON.stringify(result)}`)\n return result\n }\n\n override async startHandler(): Promise<void> {\n await super.startHandler()\n if ((this.config.automations?.length ?? 0) > 0) {\n this.runner = new SentinelRunner({\n sentinel: this, automations: this.config.automations, traceProvider: this.params.traceProvider,\n })\n this.runner.start()\n }\n }\n\n override async stopHandler(): Promise<void> {\n if (this.runner) {\n this.runner.stop()\n this.runner = undefined\n }\n await super.stopHandler()\n }\n\n private async inputAddresses(input: ModuleIdentifier | ModuleIdentifier[]): Promise<XyoAddress[]> {\n if (Array.isArray(input)) {\n return (await Promise.all(input.map(async inputItem => await this.inputAddresses(inputItem)))).flat()\n } else {\n const resolved = await this.resolve(input)\n return resolved ? [resolved.address] : []\n }\n }\n\n private processPreviousResults(payloads: Record<string, Payload[]>, inputs: string[]) {\n return inputs.flatMap(input => payloads[input] ?? [])\n }\n\n private async runJob(\n tasks: ResolvedTask[],\n previousResults: Record<XyoAddress, Payload[]>,\n inPayloads?: Payload[],\n ): Promise<Record<XyoAddress, Payload[]>> {\n await this.emit('jobStart', { inPayloads, mod: this })\n this.logger?.debug(`runJob:tasks: ${JSON.stringify(tasks.length)}`)\n this.logger?.debug(`runJob:previous: ${JSON.stringify(previousResults)}`)\n this.logger?.debug(`runJob:in: ${JSON.stringify(inPayloads)}`)\n const results: PromiseSettledResult<[XyoAddress, Payload[]]>[] = await Promise.allSettled(\n tasks?.map(async (task) => {\n const input = task.input ?? false\n const inPayloadsFound\n = input === true\n ? inPayloads\n : input === false\n ? []\n : this.processPreviousResults(previousResults, await this.inputAddresses(input))\n const witness = asWitnessInstance(task.mod)\n if (witness) {\n await this.emit('taskStart', {\n address: witness.address, inPayloads: inPayloadsFound, mod: this,\n })\n const observed = await witness.observe(inPayloadsFound)\n this.logger?.debug(`observed [${witness.id}]: ${JSON.stringify(observed)}`)\n await this.emit('taskEnd', {\n address: witness.address, inPayloads: inPayloadsFound, mod: this, outPayloads: observed,\n })\n return [witness.address, observed]\n }\n const diviner = asDivinerInstance(task.mod)\n if (diviner) {\n await this.emit('taskStart', {\n address: diviner.address, inPayloads: inPayloadsFound, mod: this,\n })\n const divined = await diviner.divine(inPayloadsFound)\n this.logger?.debug(`divined [${diviner.id}]: ${JSON.stringify(divined)}`)\n await this.emit('taskEnd', {\n address: diviner.address, inPayloads: inPayloadsFound, mod: this, outPayloads: divined,\n })\n return [diviner.address, divined]\n }\n const sentinel = asSentinelInstance(task.mod)\n if (sentinel) {\n await this.emit('taskStart', {\n address: sentinel.address, inPayloads: inPayloadsFound, mod: this,\n })\n const reported = await sentinel.report(inPayloadsFound)\n this.logger?.debug(`reported [${sentinel.id}]: ${JSON.stringify(reported)}`)\n await this.emit('taskEnd', {\n address: sentinel.address, inPayloads: inPayloadsFound, mod: this, outPayloads: reported,\n })\n return [sentinel.address, reported]\n }\n throw new Error('Unsupported module type')\n }),\n )\n const finalResult: Record<XyoAddress, Payload[]> = {}\n for (const result of results.filter(fulfilled)) {\n const [address, payloads] = result.value\n finalResult[address] = finalResult[address] ?? []\n finalResult[address].push(...payloads)\n }\n if (this.throwErrors) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n const errors = results.filter(rejected).map(result => result.reason)\n if (errors.length > 0) {\n throw new Error('At least one module failed')\n }\n }\n this.logger?.debug(`generateResults:out: ${JSON.stringify(finalResult)}`)\n await this.emit('jobEnd', {\n finalResult, inPayloads, mod: this,\n })\n return finalResult\n }\n}\n", "import type { BaseParams, BrandedHash } from '@ariestools/sdk'\nimport {\n assertEx, Base, forget,\n isDefined, spanRootAsync,\n} from '@ariestools/sdk'\nimport type { Payload } from '@xyo-network/sdk-protocol'\nimport { PayloadBuilder } from '@xyo-network/sdk-protocol'\n\nimport type {\n SentinelAutomationPayload,\n SentinelInstance,\n SentinelIntervalAutomationPayload,\n} from '#sentinel-model'\nimport { isSentinelIntervalAutomation } from '#sentinel-model'\n\nimport { SentinelIntervalAutomationWrapper } from './SentinelIntervalAutomationWrapper.ts'\n\nexport type OnSentinelRunnerTriggerResult = (result: Payload[]) => void\n\nexport interface SentinelRunnerParams extends BaseParams {\n automations?: SentinelAutomationPayload[]\n onTriggerResult?: OnSentinelRunnerTriggerResult\n sentinel: SentinelInstance\n}\n\nexport class SentinelRunner extends Base {\n protected _automations: Record<string, SentinelAutomationPayload> = {}\n protected onTriggerResult: OnSentinelRunnerTriggerResult | undefined\n protected sentinel: SentinelInstance\n protected timeoutId?: ReturnType<typeof setTimeout> | string | number\n\n constructor(params: SentinelRunnerParams) {\n super(params)\n this.sentinel = params.sentinel\n this.onTriggerResult = params.onTriggerResult\n\n if (params.automations) for (const automation of params.automations) forget(this.add(automation))\n }\n\n get automations(): Record<string, SentinelAutomationPayload> {\n return this._automations\n }\n\n private get next() {\n return Object.values(this._automations).reduce<SentinelAutomationPayload | undefined>((previous, current) => {\n if (isSentinelIntervalAutomation(current) && isSentinelIntervalAutomation(previous)) {\n return (current.start ?? Number.POSITIVE_INFINITY) < (previous?.start ?? Number.POSITIVE_INFINITY) ? current : previous\n }\n return current\n }, undefined)\n }\n\n async add(automation: SentinelAutomationPayload, restart = true): Promise<BrandedHash> {\n const hash = await PayloadBuilder.dataHash(automation)\n this._automations[hash] = automation\n if (restart) this.restart()\n return hash\n }\n\n find(hash: string): [string, SentinelAutomationPayload] | undefined {\n return Object.entries(this._automations).find(([key]) => key === hash)\n }\n\n remove(hash: string, restart = true): void {\n delete this._automations[hash]\n if (restart) this.restart()\n }\n\n removeAll(): void {\n this.stop()\n this._automations = {}\n }\n\n restart(): void {\n this.stop()\n this.start()\n }\n\n start(): void {\n this.startHandler()\n }\n\n startHandler(): void {\n assertEx(this.timeoutId === undefined, () => 'Already started')\n const automation = this.next\n if (isSentinelIntervalAutomation(automation)) {\n const now = Date.now()\n const start = Math.max(automation.start ?? now, now)\n const delay = Math.max(start - now, 0)\n if (delay < Number.POSITIVE_INFINITY) {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.timeoutId = setTimeout(async () => {\n this.timeoutId = undefined\n return await spanRootAsync('start.setTimeout', async () => {\n try {\n // Run the automation\n await this.trigger(automation)\n this.stop()\n } catch (ex) {\n this.logger?.error('Error running automation', { error: ex })\n this.stop()\n } finally {\n // No matter what start the next automation\n this.start()\n }\n }, { tracer: this.tracer })\n }, delay)\n }\n } else if (isDefined(automation) && automation.type === 'interval' && automation.start !== Number.POSITIVE_INFINITY) {\n // A start of POSITIVE_INFINITY means the automation has intentionally completed\n // (remaining exhausted or past end). Anything else failing validation here would\n // otherwise silently stop the runner, so surface it.\n this.logger?.warn(`Unschedulable interval automation; runner stopped [${JSON.stringify(automation)}]`)\n }\n }\n\n stop(): void {\n if (isDefined(this.timeoutId)) {\n clearTimeout(this.timeoutId)\n this.timeoutId = undefined\n }\n }\n\n async update(hash: string, automation: SentinelAutomationPayload, restart = true): Promise<void> {\n this.remove(hash, false)\n await this.add(automation, false)\n if (restart) this.restart()\n }\n\n private async trigger(automation: SentinelIntervalAutomationPayload) {\n return await spanRootAsync('trigger', async () => {\n const wrapper = new SentinelIntervalAutomationWrapper(automation)\n this.remove(await wrapper.dataHash(), false)\n wrapper.next()\n await this.add(wrapper.payload, false)\n const triggerResult = await this.sentinel.report()\n this.onTriggerResult?.(triggerResult)\n }, { tracer: this.tracer })\n }\n}\n", "import { PayloadWrapper } from '@xyo-network/sdk-protocol'\n\nimport type { SentinelIntervalAutomationPayload } from '#sentinel-model'\n\nexport class SentinelIntervalAutomationWrapper<\n T extends SentinelIntervalAutomationPayload = SentinelIntervalAutomationPayload,\n> extends PayloadWrapper<T> {\n constructor(payload: T) {\n super(payload)\n }\n\n protected get frequencyMillis(): number {\n const frequency = this.payload.frequency\n if (frequency === undefined) return Number.POSITIVE_INFINITY\n const frequencyUnits = this.payload.frequencyUnits\n switch (frequencyUnits ?? 'hour') {\n case 'millis': {\n return frequency\n }\n case 'second': {\n return frequency * 1000\n }\n case 'minute': {\n return frequency * 60 * 1000\n }\n case 'hour': {\n return frequency * 60 * 60 * 1000\n }\n case 'day': {\n return frequency * 24 * 60 * 60 * 1000\n }\n default: {\n return Number.POSITIVE_INFINITY\n }\n }\n }\n\n protected get remaining(): number {\n return this.payload.remaining ?? Number.POSITIVE_INFINITY\n }\n\n next(): this {\n const now = Date.now()\n const previousStart = this.payload?.start ?? now\n const start = Math.max(previousStart, now)\n const nextStart = start + this.frequencyMillis\n this.setStart(nextStart)\n this.consumeRemaining()\n this.checkEnd()\n return this\n }\n\n protected checkEnd(): void {\n if ((this.payload.start ?? 0) > (this.payload.end ?? Number.POSITIVE_INFINITY)) {\n this.setStart(Number.POSITIVE_INFINITY)\n }\n }\n\n protected consumeRemaining(count = 1): void {\n // Infinite reruns are represented by an absent remaining field. Leave the field\n // absent since a non-finite value is not a valid payload field value and would\n // cause the automation to fail schema validation on subsequent scheduling.\n if (this.payload.remaining === undefined) return\n const remaining = Math.max(this.remaining - count, 0)\n this.setRemaining(remaining)\n if (remaining <= 0) this.setStart(Number.POSITIVE_INFINITY)\n }\n\n /**\n * Sets the remaining of the wrapped automation\n * @param remaining The remaining time in milliseconds\n */\n protected setRemaining(remaining: number): void {\n this.payload.remaining = remaining\n }\n\n /**\n * Sets the start of the wrapped automation\n * @param start The start time in milliseconds\n */\n protected setStart(start: number): void {\n this.payload.start = start\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,WAAW,gBAAgB;AAKpC,SAAS,yBAAyB;AAElC,SAAS,wBAAwB;AAQjC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;;;AClBlC;AAAA,EACE;AAAA,EAAU;AAAA,EAAM;AAAA,EAChB;AAAA,EAAW;AAAA,OACN;AAEP,SAAS,sBAAsB;AAO/B,SAAS,oCAAoC;;;ACb7C,SAAS,sBAAsB;AAIxB,IAAM,oCAAN,cAEG,eAAkB;AAAA,EAC1B,YAAY,SAAY;AACtB,UAAM,OAAO;AAAA,EACf;AAAA,EAEA,IAAc,kBAA0B;AACtC,UAAM,YAAY,KAAK,QAAQ;AAC/B,QAAI,cAAc,OAAW,QAAO
|
|
4
|
+
"sourcesContent": ["import { fulfilled, rejected } from '@ariestools/sdk'\nimport type {\n Payload, Schema, XyoAddress,\n} from '@xyo-network/sdk-protocol'\n\nimport { asDivinerInstance } from '#diviner-model'\nimport { type AnyConfigSchema, type ModuleIdentifier } from '#module-model'\nimport { AbstractSentinel } from '#sentinel-abstract'\nimport type {\n ResolvedTask,\n SentinelConfig,\n SentinelInstance,\n SentinelModuleEventData,\n SentinelParams,\n} from '#sentinel-model'\nimport {\n asSentinelInstance,\n SentinelConfigSchema,\n} from '#sentinel-model'\nimport { asWitnessInstance } from '#witness-model'\n\nimport { SentinelRunner } from './SentinelRunner.ts'\n\nexport type MemorySentinelParams<TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>> = SentinelParams<TConfig>\n\nexport class MemorySentinel<\n TParams extends MemorySentinelParams = MemorySentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, SentinelConfigSchema]\n static override readonly defaultConfigSchema: Schema = SentinelConfigSchema\n\n private runner?: SentinelRunner\n\n async reportHandler(inPayloads: Payload[] = []): Promise<Payload[]> {\n await this.startedAsync('throw')\n this.logger?.debug(`reportHandler:in: ${JSON.stringify(inPayloads)}`)\n const job = await this.jobPromise\n\n let index = 0\n let previousResults: Record<XyoAddress, Payload[]> = {}\n while (index < job.tasks.length) {\n const generatedPayloads = await this.runJob(job.tasks[index], previousResults, inPayloads)\n previousResults = generatedPayloads\n index++\n }\n const result = Object.values(previousResults).flat()\n this.logger?.debug(`reportHandler:out: ${JSON.stringify(result)}`)\n return result\n }\n\n override async startHandler(): Promise<void> {\n await super.startHandler()\n if ((this.config.automations?.length ?? 0) > 0) {\n this.runner = new SentinelRunner({\n sentinel: this, automations: this.config.automations, traceProvider: this.params.traceProvider,\n })\n this.runner.start()\n }\n }\n\n override async stopHandler(): Promise<void> {\n if (this.runner) {\n this.runner.stop()\n this.runner = undefined\n }\n await super.stopHandler()\n }\n\n private async inputAddresses(input: ModuleIdentifier | ModuleIdentifier[]): Promise<XyoAddress[]> {\n if (Array.isArray(input)) {\n return (await Promise.all(input.map(async inputItem => await this.inputAddresses(inputItem)))).flat()\n }\n const resolved = await this.resolve(input)\n return resolved ? [resolved.address] : []\n }\n\n private processPreviousResults(payloads: Record<string, Payload[]>, inputs: string[]) {\n return inputs.flatMap(input => payloads[input] ?? [])\n }\n\n private async runJob(\n tasks: ResolvedTask[],\n previousResults: Record<XyoAddress, Payload[]>,\n inPayloads?: Payload[],\n ): Promise<Record<XyoAddress, Payload[]>> {\n await this.emit('jobStart', { inPayloads, mod: this })\n this.logger?.debug(`runJob:tasks: ${JSON.stringify(tasks.length)}`)\n this.logger?.debug(`runJob:previous: ${JSON.stringify(previousResults)}`)\n this.logger?.debug(`runJob:in: ${JSON.stringify(inPayloads)}`)\n const results: PromiseSettledResult<[XyoAddress, Payload[]]>[] = await Promise.allSettled(\n tasks?.map(async (task) => {\n const input = task.input ?? false\n const inPayloadsFound\n = input === true\n ? inPayloads\n : input === false\n ? []\n : this.processPreviousResults(previousResults, await this.inputAddresses(input))\n const witness = asWitnessInstance(task.mod)\n if (witness) {\n await this.emit('taskStart', {\n address: witness.address, inPayloads: inPayloadsFound, mod: this,\n })\n const observed = await witness.observe(inPayloadsFound)\n this.logger?.debug(`observed [${witness.id}]: ${JSON.stringify(observed)}`)\n await this.emit('taskEnd', {\n address: witness.address, inPayloads: inPayloadsFound, mod: this, outPayloads: observed,\n })\n return [witness.address, observed]\n }\n const diviner = asDivinerInstance(task.mod)\n if (diviner) {\n await this.emit('taskStart', {\n address: diviner.address, inPayloads: inPayloadsFound, mod: this,\n })\n const divined = await diviner.divine(inPayloadsFound)\n this.logger?.debug(`divined [${diviner.id}]: ${JSON.stringify(divined)}`)\n await this.emit('taskEnd', {\n address: diviner.address, inPayloads: inPayloadsFound, mod: this, outPayloads: divined,\n })\n return [diviner.address, divined]\n }\n const sentinel = asSentinelInstance(task.mod)\n if (sentinel) {\n await this.emit('taskStart', {\n address: sentinel.address, inPayloads: inPayloadsFound, mod: this,\n })\n const reported = await sentinel.report(inPayloadsFound)\n this.logger?.debug(`reported [${sentinel.id}]: ${JSON.stringify(reported)}`)\n await this.emit('taskEnd', {\n address: sentinel.address, inPayloads: inPayloadsFound, mod: this, outPayloads: reported,\n })\n return [sentinel.address, reported]\n }\n throw new Error('Unsupported module type')\n }),\n )\n const finalResult: Record<XyoAddress, Payload[]> = {}\n const fulfilledResults = results.filter(fulfilled)\n for (const result of fulfilledResults) {\n const [address, payloads] = result.value\n finalResult[address] = finalResult[address] ?? []\n finalResult[address].push(...payloads)\n }\n if (this.throwErrors) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n const errors = results.filter(rejected).map(result => result.reason)\n if (errors.length > 0) {\n throw new Error('At least one module failed')\n }\n }\n this.logger?.debug(`generateResults:out: ${JSON.stringify(finalResult)}`)\n await this.emit('jobEnd', {\n finalResult, inPayloads, mod: this,\n })\n return finalResult\n }\n}\n", "import type { BaseParams, BrandedHash } from '@ariestools/sdk'\nimport {\n assertEx, Base, forget,\n isDefined, spanRootAsync,\n} from '@ariestools/sdk'\nimport type { Payload } from '@xyo-network/sdk-protocol'\nimport { PayloadBuilder } from '@xyo-network/sdk-protocol'\n\nimport type {\n SentinelAutomationPayload,\n SentinelInstance,\n SentinelIntervalAutomationPayload,\n} from '#sentinel-model'\nimport { isSentinelIntervalAutomation } from '#sentinel-model'\n\nimport { SentinelIntervalAutomationWrapper } from './SentinelIntervalAutomationWrapper.ts'\n\nexport type OnSentinelRunnerTriggerResult = (result: Payload[]) => void\n\nexport interface SentinelRunnerParams extends BaseParams {\n automations?: SentinelAutomationPayload[]\n onTriggerResult?: OnSentinelRunnerTriggerResult\n sentinel: SentinelInstance\n}\n\nexport class SentinelRunner extends Base {\n protected _automations: Record<string, SentinelAutomationPayload> = {}\n protected onTriggerResult: OnSentinelRunnerTriggerResult | undefined\n protected sentinel: SentinelInstance\n protected timeoutId?: ReturnType<typeof setTimeout> | string | number\n\n constructor(params: SentinelRunnerParams) {\n super(params)\n this.sentinel = params.sentinel\n this.onTriggerResult = params.onTriggerResult\n\n if (params.automations) for (const automation of params.automations) forget(this.add(automation))\n }\n\n get automations(): Record<string, SentinelAutomationPayload> {\n return this._automations\n }\n\n private get next() {\n return Object.values(this._automations).reduce<SentinelAutomationPayload | undefined>((previous, current) => {\n if (isSentinelIntervalAutomation(current) && isSentinelIntervalAutomation(previous)) {\n return (current.start ?? Infinity) < (previous?.start ?? Infinity) ? current : previous\n }\n return current\n }, undefined)\n }\n\n async add(automation: SentinelAutomationPayload, restart = true): Promise<BrandedHash> {\n const hash = await PayloadBuilder.dataHash(automation)\n this._automations[hash] = automation\n if (restart) this.restart()\n return hash\n }\n\n find(hash: string): [string, SentinelAutomationPayload] | undefined {\n return Object.entries(this._automations).find(([key]) => key === hash)\n }\n\n remove(hash: string, restart = true): void {\n delete this._automations[hash]\n if (restart) this.restart()\n }\n\n removeAll(): void {\n this.stop()\n this._automations = {}\n }\n\n restart(): void {\n this.stop()\n this.start()\n }\n\n start(): void {\n this.startHandler()\n }\n\n startHandler(): void {\n assertEx(this.timeoutId === undefined, () => 'Already started')\n const automation = this.next\n if (isSentinelIntervalAutomation(automation)) {\n const now = Date.now()\n const start = Math.max(automation.start ?? now, now)\n const delay = Math.max(start - now, 0)\n if (delay < Infinity) {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.timeoutId = setTimeout(async () => {\n this.timeoutId = undefined\n return await spanRootAsync('start.setTimeout', async () => {\n try {\n // Run the automation\n await this.trigger(automation)\n this.stop()\n } catch (ex) {\n this.logger?.error('Error running automation', { error: ex })\n this.stop()\n } finally {\n // No matter what start the next automation\n this.start()\n }\n }, { tracer: this.tracer })\n }, delay)\n }\n } else if (isDefined(automation) && automation.type === 'interval' && automation.start !== Infinity) {\n // A start of POSITIVE_INFINITY means the automation has intentionally completed\n // (remaining exhausted or past end). Anything else failing validation here would\n // otherwise silently stop the runner, so surface it.\n this.logger?.warn(`Unschedulable interval automation; runner stopped [${JSON.stringify(automation)}]`)\n }\n }\n\n stop(): void {\n if (!isDefined(this.timeoutId)) {\n return\n }\n\n clearTimeout(this.timeoutId)\n this.timeoutId = undefined\n }\n\n async update(hash: string, automation: SentinelAutomationPayload, restart = true): Promise<void> {\n this.remove(hash, false)\n await this.add(automation, false)\n if (restart) this.restart()\n }\n\n private async trigger(automation: SentinelIntervalAutomationPayload) {\n return await spanRootAsync('trigger', async () => {\n const wrapper = new SentinelIntervalAutomationWrapper(automation)\n this.remove(await wrapper.dataHash(), false)\n wrapper.next()\n await this.add(wrapper.payload, false)\n const triggerResult = await this.sentinel.report()\n this.onTriggerResult?.(triggerResult)\n }, { tracer: this.tracer })\n }\n}\n", "import { PayloadWrapper } from '@xyo-network/sdk-protocol'\n\nimport type { SentinelIntervalAutomationPayload } from '#sentinel-model'\n\nexport class SentinelIntervalAutomationWrapper<\n T extends SentinelIntervalAutomationPayload = SentinelIntervalAutomationPayload,\n> extends PayloadWrapper<T> {\n constructor(payload: T) {\n super(payload)\n }\n\n protected get frequencyMillis(): number {\n const frequency = this.payload.frequency\n if (frequency === undefined) return Infinity\n const frequencyUnits = this.payload.frequencyUnits\n switch (frequencyUnits ?? 'hour') {\n case 'millis': {\n return frequency\n }\n case 'second': {\n return frequency * 1000\n }\n case 'minute': {\n return frequency * 60 * 1000\n }\n case 'hour': {\n return frequency * 60 * 60 * 1000\n }\n case 'day': {\n return frequency * 24 * 60 * 60 * 1000\n }\n default: {\n return Infinity\n }\n }\n }\n\n protected get remaining(): number {\n return this.payload.remaining ?? Infinity\n }\n\n next(): this {\n const now = Date.now()\n const previousStart = this.payload?.start ?? now\n const start = Math.max(previousStart, now)\n const nextStart = start + this.frequencyMillis\n this.setStart(nextStart)\n this.consumeRemaining()\n this.checkEnd()\n return this\n }\n\n protected checkEnd(): void {\n if ((this.payload.start ?? 0) > (this.payload.end ?? Infinity)) {\n this.setStart(Infinity)\n }\n }\n\n protected consumeRemaining(count = 1): void {\n // Infinite reruns are represented by an absent remaining field. Leave the field\n // absent since a non-finite value is not a valid payload field value and would\n // cause the automation to fail schema validation on subsequent scheduling.\n if (this.payload.remaining === undefined) return\n const remaining = Math.max(this.remaining - count, 0)\n this.setRemaining(remaining)\n if (remaining <= 0) this.setStart(Infinity)\n }\n\n /**\n * Sets the remaining of the wrapped automation\n * @param remaining The remaining time in milliseconds\n */\n protected setRemaining(remaining: number): void {\n this.payload.remaining = remaining\n }\n\n /**\n * Sets the start of the wrapped automation\n * @param start The start time in milliseconds\n */\n protected setStart(start: number): void {\n this.payload.start = start\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,WAAW,gBAAgB;AAKpC,SAAS,yBAAyB;AAElC,SAAS,wBAAwB;AAQjC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;;;AClBlC;AAAA,EACE;AAAA,EAAU;AAAA,EAAM;AAAA,EAChB;AAAA,EAAW;AAAA,OACN;AAEP,SAAS,sBAAsB;AAO/B,SAAS,oCAAoC;;;ACb7C,SAAS,sBAAsB;AAIxB,IAAM,oCAAN,cAEG,eAAkB;AAAA,EAC1B,YAAY,SAAY;AACtB,UAAM,OAAO;AAAA,EACf;AAAA,EAEA,IAAc,kBAA0B;AACtC,UAAM,YAAY,KAAK,QAAQ;AAC/B,QAAI,cAAc,OAAW,QAAO;AACpC,UAAM,iBAAiB,KAAK,QAAQ;AACpC,YAAQ,kBAAkB,QAAQ;AAAA,MAChC,KAAK,UAAU;AACb,eAAO;AAAA,MACT;AAAA,MACA,KAAK,UAAU;AACb,eAAO,YAAY;AAAA,M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CAAC;AAChD,kBAAY,OAAO,EAAE,KAAK,GAAG,QAAQ;AAAA,IACvC;AACA,QAAI,KAAK,aAAa;AAEpB,YAAM,SAAS,QAAQ,OAAO,QAAQ,EAAE,IAAI,YAAU,OAAO,MAAM;AACnE,UAAI,OAAO,SAAS,GAAG;AACrB,cAAM,IAAI,MAAM,4BAA4B;AAAA,MAC9C;AAAA,IACF;AACA,SAAK,QAAQ,MAAM,wBAAwB,KAAK,UAAU,WAAW,CAAC,EAAE;AACxE,UAAM,KAAK,KAAK,UAAU;AAAA,MACxB;AAAA,MAAa;AAAA,MAAY,KAAK;AAAA,IAChC,CAAC;AACD,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,8 +33,10 @@ var asSentinelReportQuery = zodAsFactory(SentinelReportQueryZod, "asSentinelRepo
|
|
|
33
33
|
var toSentinelReportQuery = zodToFactory(SentinelReportQueryZod, "toSentinelReportQuery");
|
|
34
34
|
|
|
35
35
|
// src/modules/sentinel-model/typeChecks.ts
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var isInstanceFactory = new IsInstanceFactory();
|
|
37
|
+
var isSentinelInstance = isInstanceFactory.create({ report: "function" }, [isModuleInstance]);
|
|
38
|
+
var isQueryableModuleFactory = new IsQueryableModuleFactory();
|
|
39
|
+
var isSentinelModule = isQueryableModuleFactory.create([SentinelReportQuerySchema]);
|
|
38
40
|
var asSentinelModule = AsObjectFactory.create(isSentinelModule);
|
|
39
41
|
var asSentinelInstance = AsObjectFactory.create(isSentinelInstance);
|
|
40
42
|
var withSentinelModule = WithFactory.create(isSentinelModule);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/modules/sentinel-model/attachable/asAttachableInstance.ts", "../../src/modules/sentinel-model/attachable/isAttachableInstance.ts", "../../src/modules/sentinel-model/typeChecks.ts", "../../src/modules/sentinel-model/Queries/Report.ts", "../../src/modules/sentinel-model/attachable/AttachableInstance.ts", "../../src/modules/sentinel-model/Automation.ts", "../../src/modules/sentinel-model/Config.ts"],
|
|
4
|
-
"sourcesContent": ["import { AsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableSentinelInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableSentinelInstance = AsObjectFactory.create(isAttachableSentinelInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableModuleInstance } from '#module-model'\n\nimport { isSentinelInstance } from '../typeChecks.ts'\nimport type { AttachableSentinelInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableSentinelInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableSentinelInstance>()\n\nexport const isAttachableSentinelInstance: TypeCheck<AttachableSentinelInstance> = factory.create(requiredAttachableSentinelInstanceFunctions, [\n isSentinelInstance,\n isAttachableModuleInstance,\n])\n", "import { AsObjectFactory } from '@ariestools/sdk'\n\nimport {\n IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,\n} from '#module-model'\n\nimport type { SentinelInstance } from './Instance.ts'\nimport type { SentinelModule } from './Module.ts'\nimport { SentinelReportQuerySchema } from './Queries/index.ts'\n\nexport const isSentinelInstance = new IsInstanceFactory<SentinelInstance>().create({ report: 'function' }, [isModuleInstance])\nexport const isSentinelModule = new IsQueryableModuleFactory<SentinelModule>().create([SentinelReportQuerySchema])\n\nexport const asSentinelModule = AsObjectFactory.create(isSentinelModule)\nexport const asSentinelInstance = AsObjectFactory.create(isSentinelInstance)\n\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelModule = WithFactory.create(isSentinelModule)\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelInstance = WithFactory.create(isSentinelInstance)\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const SentinelReportQuerySchema: 'network.xyo.query.sentinel.report' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.sentinel.report', true)\nexport type SentinelReportQuerySchema = typeof SentinelReportQuerySchema\n\nexport const SentinelReportQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<SentinelReportQuerySchema> }\n & (typeof QueryFieldsZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(SentinelReportQuerySchema), { ...QueryFieldsZod.shape })\n\nexport type SentinelReportQuery = z.infer<typeof SentinelReportQueryZod>\n\nexport const isSentinelReportQuery: ReturnType<typeof zodIsFactory<SentinelReportQuery>> = zodIsFactory(SentinelReportQueryZod)\nexport const asSentinelReportQuery: ReturnType<typeof zodAsFactory<SentinelReportQuery>> = zodAsFactory(SentinelReportQueryZod, 'asSentinelReportQuery')\nexport const toSentinelReportQuery: ReturnType<typeof zodToFactory<SentinelReportQuery>> = zodToFactory(SentinelReportQueryZod, 'toSentinelReportQuery')\n", "import type { TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\n\nimport type { AttachableModuleInstance } from '#module-model'\n\nimport type { SentinelModuleEventData } from '../EventData.ts'\nimport type { SentinelInstance } from '../Instance.ts'\nimport type { SentinelModule } from '../Module.ts'\nimport type { SentinelParams } from '../Params.ts'\n\nexport interface AttachableSentinelInstance<\n TParams extends SentinelParams = SentinelParams,\n TEventData extends SentinelModuleEventData = SentinelModuleEventData,\n> extends SentinelModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n SentinelInstance<TParams, TEventData> {}\n\nexport type AttachableSentinelInstanceTypeCheck<T extends AttachableSentinelInstance = AttachableSentinelInstance> = TypeCheck<T>\n\nexport class IsAttachableSentinelInstanceFactory<T extends AttachableSentinelInstance = AttachableSentinelInstance> extends IsObjectFactory<T> {}\n", "import type { EventName } from '@ariestools/sdk'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport type { Payload } from '@xyo-network/sdk-protocol'\nimport { asSchema, PayloadZodOfSchema } from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleIdentifier } from '#module-model'\n\nexport const SentinelAutomationSchema: 'network.xyo.automation' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation', true)\nexport type SentinelAutomationSchema = typeof SentinelAutomationSchema\n\nexport const SentinelIntervalAutomationSchema: 'network.xyo.automation.interval' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation.interval', true)\nexport type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema\n\nexport const SentinelModuleEventAutomationSchema: 'network.xyo.automation.event.module' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation.event.module', true)\nexport type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema\n\nexport type SentinelBaseAutomationPayload<T extends Payload> = Payload<\n {\n type?: 'interval' | 'event'\n } & T\n>\n\n/** Settings for an Interval Automation */\nexport const SentinelIntervalAutomationZod: z.ZodMiniObject<{\n end: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n frequency: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n frequencyUnits: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<'second'>, z.ZodMiniLiteral<'minute'>, z.ZodMiniLiteral<'hour'>, z.ZodMiniLiteral<'day'>, z.ZodMiniLiteral<'millis'>]>>\n remaining: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n schema: z.ZodMiniLiteral<SentinelIntervalAutomationSchema>\n start: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n type: z.ZodMiniLiteral<'interval'>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(SentinelIntervalAutomationSchema), {\n /** Epoch after which any reoccurrence stops */\n end: z.optional(z.number()),\n /** Time between triggers [non-repeating if undefined] */\n frequency: z.optional(z.number()),\n /** Units for frequency field [hour if undefined] */\n frequencyUnits: z.optional(z.union([z.literal('second'), z.literal('minute'), z.literal('hour'), z.literal('day'), z.literal('millis')])),\n /** Remaining triggers [infinite if undefined] */\n remaining: z.optional(z.number()),\n /** Epoch of the next trigger */\n start: z.optional(z.number()),\n /** The type of automation */\n type: z.literal('interval'),\n})\n\nexport type SentinelIntervalAutomationPayload = z.infer<typeof SentinelIntervalAutomationZod>\n\nexport const isSentinelIntervalAutomation: ReturnType<typeof zodIsFactory<SentinelIntervalAutomationPayload>> = zodIsFactory(SentinelIntervalAutomationZod)\nexport const asSentinelIntervalAutomation: ReturnType<typeof zodAsFactory<SentinelIntervalAutomationPayload>> = zodAsFactory(SentinelIntervalAutomationZod, 'asSentinelIntervalAutomation')\nexport const toSentinelIntervalAutomation: ReturnType<typeof zodToFactory<SentinelIntervalAutomationPayload>> = zodToFactory(SentinelIntervalAutomationZod, 'toSentinelIntervalAutomation')\n\n/** Settings for an Module Event Automation */\nexport const SentinelModuleEventAutomationZod: z.ZodMiniObject<{\n eventName: z.ZodMiniCustom<EventName, EventName>\n schema: z.ZodMiniLiteral<SentinelModuleEventAutomationSchema>\n source: z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>\n type: z.ZodMiniLiteral<'event'>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(SentinelModuleEventAutomationSchema), {\n eventName: z.custom<EventName>(),\n source: z.custom<ModuleIdentifier>(),\n type: z.literal('event'),\n})\n\nexport type SentinelModuleEventAutomationPayload = z.infer<typeof SentinelModuleEventAutomationZod>\n\nexport const isSentinelModuleEventAutomation: ReturnType<typeof zodIsFactory<SentinelModuleEventAutomationPayload>> = zodIsFactory(SentinelModuleEventAutomationZod)\nexport const asSentinelModuleEventAutomation: ReturnType<typeof zodAsFactory<SentinelModuleEventAutomationPayload>> = zodAsFactory(SentinelModuleEventAutomationZod, 'asSentinelModuleEventAutomation')\nexport const toSentinelModuleEventAutomation: ReturnType<typeof zodToFactory<SentinelModuleEventAutomationPayload>> = zodToFactory(SentinelModuleEventAutomationZod, 'toSentinelModuleEventAutomation')\n\n/** Settings for an Automation */\nexport type SentinelAutomationPayload = Payload<\n SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload,\n SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema\n>\n", "import type { WithAdditional } from '@ariestools/sdk'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport {\n asSchema, type Payload, type Schema,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleConfig } from '#module-model'\nimport { ModuleConfigZod } from '#module-model'\n\nimport type { SentinelAutomationPayload } from './Automation.ts'\nimport type { Task } from './Task.ts'\n\nexport const SentinelConfigSchema: 'network.xyo.sentinel.config' & {\n readonly __schema: true\n} = asSchema('network.xyo.sentinel.config', true)\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport const SentinelConfigZod: z.ZodMiniObject<\n & Omit<(typeof ModuleConfigZod)['shape'], 'schema'>\n & { schema: z.ZodMiniLiteral<SentinelConfigSchema> }\n & {\n automations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<SentinelAutomationPayload, SentinelAutomationPayload>>>\n synchronous: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n tasks: z.ZodMiniArray<z.ZodMiniCustom<Task, Task>>\n throwErrors: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n },\n z.core.$strip\n> = z.extend(ModuleConfigZod, {\n schema: z.literal(SentinelConfigSchema),\n automations: z.optional(z.array(z.custom<SentinelAutomationPayload>())),\n synchronous: z.optional(z.boolean()),\n tasks: z.array(z.custom<Task>()),\n throwErrors: z.optional(z.boolean()),\n})\n\nexport type SentinelConfigBase = z.infer<typeof SentinelConfigZod>\n\nexport const isSentinelConfig: ReturnType<typeof zodIsFactory<SentinelConfigBase>> = zodIsFactory(SentinelConfigZod)\nexport const asSentinelConfig: ReturnType<typeof zodAsFactory<SentinelConfigBase>> = zodAsFactory(SentinelConfigZod, 'asSentinelConfig')\nexport const toSentinelConfig: ReturnType<typeof zodToFactory<SentinelConfigBase>> = zodToFactory(SentinelConfigZod, 'toSentinelConfig')\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAkB;AAAA,EAA0B;AAAA,OAC1D;;;ACJP;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP;AAAA,EACE;AAAA,EAAU;AAAA,EAAoB;AAAA,OACzB;AACP,YAAY,OAAO;AAEZ,IAAM,4BAET,SAAS,qCAAqC,IAAI;AAG/C,IAAM,yBAIP,SAAO,mBAAmB,yBAAyB,GAAG,EAAE,GAAG,eAAe,MAAM,CAAC;AAIhF,IAAM,wBAA8E,aAAa,sBAAsB;AACvH,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;AAChJ,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;;;
|
|
4
|
+
"sourcesContent": ["import { AsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableSentinelInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableSentinelInstance = AsObjectFactory.create(isAttachableSentinelInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableModuleInstance } from '#module-model'\n\nimport { isSentinelInstance } from '../typeChecks.ts'\nimport type { AttachableSentinelInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableSentinelInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableSentinelInstance>()\n\nexport const isAttachableSentinelInstance: TypeCheck<AttachableSentinelInstance> = factory.create(requiredAttachableSentinelInstanceFunctions, [\n isSentinelInstance,\n isAttachableModuleInstance,\n])\n", "import { AsObjectFactory } from '@ariestools/sdk'\n\nimport {\n IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,\n} from '#module-model'\n\nimport type { SentinelInstance } from './Instance.ts'\nimport type { SentinelModule } from './Module.ts'\nimport { SentinelReportQuerySchema } from './Queries/index.ts'\n\nconst isInstanceFactory = new IsInstanceFactory<SentinelInstance>()\nexport const isSentinelInstance = isInstanceFactory.create({ report: 'function' }, [isModuleInstance])\nconst isQueryableModuleFactory = new IsQueryableModuleFactory<SentinelModule>()\nexport const isSentinelModule = isQueryableModuleFactory.create([SentinelReportQuerySchema])\n\nexport const asSentinelModule = AsObjectFactory.create(isSentinelModule)\nexport const asSentinelInstance = AsObjectFactory.create(isSentinelInstance)\n\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelModule = WithFactory.create(isSentinelModule)\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelInstance = WithFactory.create(isSentinelInstance)\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const SentinelReportQuerySchema: 'network.xyo.query.sentinel.report' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.sentinel.report', true)\nexport type SentinelReportQuerySchema = typeof SentinelReportQuerySchema\n\nexport const SentinelReportQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<SentinelReportQuerySchema> }\n & (typeof QueryFieldsZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(SentinelReportQuerySchema), { ...QueryFieldsZod.shape })\n\nexport type SentinelReportQuery = z.infer<typeof SentinelReportQueryZod>\n\nexport const isSentinelReportQuery: ReturnType<typeof zodIsFactory<SentinelReportQuery>> = zodIsFactory(SentinelReportQueryZod)\nexport const asSentinelReportQuery: ReturnType<typeof zodAsFactory<SentinelReportQuery>> = zodAsFactory(SentinelReportQueryZod, 'asSentinelReportQuery')\nexport const toSentinelReportQuery: ReturnType<typeof zodToFactory<SentinelReportQuery>> = zodToFactory(SentinelReportQueryZod, 'toSentinelReportQuery')\n", "import type { TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\n\nimport type { AttachableModuleInstance } from '#module-model'\n\nimport type { SentinelModuleEventData } from '../EventData.ts'\nimport type { SentinelInstance } from '../Instance.ts'\nimport type { SentinelModule } from '../Module.ts'\nimport type { SentinelParams } from '../Params.ts'\n\nexport interface AttachableSentinelInstance<\n TParams extends SentinelParams = SentinelParams,\n TEventData extends SentinelModuleEventData = SentinelModuleEventData,\n> extends SentinelModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n SentinelInstance<TParams, TEventData> {}\n\nexport type AttachableSentinelInstanceTypeCheck<T extends AttachableSentinelInstance = AttachableSentinelInstance> = TypeCheck<T>\n\nexport class IsAttachableSentinelInstanceFactory<T extends AttachableSentinelInstance = AttachableSentinelInstance> extends IsObjectFactory<T> {}\n", "import type { EventName } from '@ariestools/sdk'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport type { Payload } from '@xyo-network/sdk-protocol'\nimport { asSchema, PayloadZodOfSchema } from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleIdentifier } from '#module-model'\n\nexport const SentinelAutomationSchema: 'network.xyo.automation' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation', true)\nexport type SentinelAutomationSchema = typeof SentinelAutomationSchema\n\nexport const SentinelIntervalAutomationSchema: 'network.xyo.automation.interval' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation.interval', true)\nexport type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema\n\nexport const SentinelModuleEventAutomationSchema: 'network.xyo.automation.event.module' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation.event.module', true)\nexport type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema\n\nexport type SentinelBaseAutomationPayload<T extends Payload> = Payload<\n {\n type?: 'interval' | 'event'\n } & T\n>\n\n/** Settings for an Interval Automation */\nexport const SentinelIntervalAutomationZod: z.ZodMiniObject<{\n end: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n frequency: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n frequencyUnits: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<'second'>, z.ZodMiniLiteral<'minute'>, z.ZodMiniLiteral<'hour'>, z.ZodMiniLiteral<'day'>, z.ZodMiniLiteral<'millis'>]>>\n remaining: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n schema: z.ZodMiniLiteral<SentinelIntervalAutomationSchema>\n start: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n type: z.ZodMiniLiteral<'interval'>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(SentinelIntervalAutomationSchema), {\n /** Epoch after which any reoccurrence stops */\n end: z.optional(z.number()),\n /** Time between triggers [non-repeating if undefined] */\n frequency: z.optional(z.number()),\n /** Units for frequency field [hour if undefined] */\n frequencyUnits: z.optional(z.union([z.literal('second'), z.literal('minute'), z.literal('hour'), z.literal('day'), z.literal('millis')])),\n /** Remaining triggers [infinite if undefined] */\n remaining: z.optional(z.number()),\n /** Epoch of the next trigger */\n start: z.optional(z.number()),\n /** The type of automation */\n type: z.literal('interval'),\n})\n\nexport type SentinelIntervalAutomationPayload = z.infer<typeof SentinelIntervalAutomationZod>\n\nexport const isSentinelIntervalAutomation: ReturnType<typeof zodIsFactory<SentinelIntervalAutomationPayload>> = zodIsFactory(SentinelIntervalAutomationZod)\nexport const asSentinelIntervalAutomation: ReturnType<typeof zodAsFactory<SentinelIntervalAutomationPayload>> = zodAsFactory(SentinelIntervalAutomationZod, 'asSentinelIntervalAutomation')\nexport const toSentinelIntervalAutomation: ReturnType<typeof zodToFactory<SentinelIntervalAutomationPayload>> = zodToFactory(SentinelIntervalAutomationZod, 'toSentinelIntervalAutomation')\n\n/** Settings for an Module Event Automation */\nexport const SentinelModuleEventAutomationZod: z.ZodMiniObject<{\n eventName: z.ZodMiniCustom<EventName, EventName>\n schema: z.ZodMiniLiteral<SentinelModuleEventAutomationSchema>\n source: z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>\n type: z.ZodMiniLiteral<'event'>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(SentinelModuleEventAutomationSchema), {\n eventName: z.custom<EventName>(),\n source: z.custom<ModuleIdentifier>(),\n type: z.literal('event'),\n})\n\nexport type SentinelModuleEventAutomationPayload = z.infer<typeof SentinelModuleEventAutomationZod>\n\nexport const isSentinelModuleEventAutomation: ReturnType<typeof zodIsFactory<SentinelModuleEventAutomationPayload>> = zodIsFactory(SentinelModuleEventAutomationZod)\nexport const asSentinelModuleEventAutomation: ReturnType<typeof zodAsFactory<SentinelModuleEventAutomationPayload>> = zodAsFactory(SentinelModuleEventAutomationZod, 'asSentinelModuleEventAutomation')\nexport const toSentinelModuleEventAutomation: ReturnType<typeof zodToFactory<SentinelModuleEventAutomationPayload>> = zodToFactory(SentinelModuleEventAutomationZod, 'toSentinelModuleEventAutomation')\n\n/** Settings for an Automation */\nexport type SentinelAutomationPayload = Payload<\n SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload,\n SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema\n>\n", "import type { WithAdditional } from '@ariestools/sdk'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport {\n asSchema, type Payload, type Schema,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleConfig } from '#module-model'\nimport { ModuleConfigZod } from '#module-model'\n\nimport type { SentinelAutomationPayload } from './Automation.ts'\nimport type { Task } from './Task.ts'\n\nexport const SentinelConfigSchema: 'network.xyo.sentinel.config' & {\n readonly __schema: true\n} = asSchema('network.xyo.sentinel.config', true)\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport const SentinelConfigZod: z.ZodMiniObject<\n & Omit<(typeof ModuleConfigZod)['shape'], 'schema'>\n & { schema: z.ZodMiniLiteral<SentinelConfigSchema> }\n & {\n automations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<SentinelAutomationPayload, SentinelAutomationPayload>>>\n synchronous: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n tasks: z.ZodMiniArray<z.ZodMiniCustom<Task, Task>>\n throwErrors: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n },\n z.core.$strip\n> = z.extend(ModuleConfigZod, {\n schema: z.literal(SentinelConfigSchema),\n automations: z.optional(z.array(z.custom<SentinelAutomationPayload>())),\n synchronous: z.optional(z.boolean()),\n tasks: z.array(z.custom<Task>()),\n throwErrors: z.optional(z.boolean()),\n})\n\nexport type SentinelConfigBase = z.infer<typeof SentinelConfigZod>\n\nexport const isSentinelConfig: ReturnType<typeof zodIsFactory<SentinelConfigBase>> = zodIsFactory(SentinelConfigZod)\nexport const asSentinelConfig: ReturnType<typeof zodAsFactory<SentinelConfigBase>> = zodAsFactory(SentinelConfigZod, 'asSentinelConfig')\nexport const toSentinelConfig: ReturnType<typeof zodToFactory<SentinelConfigBase>> = zodToFactory(SentinelConfigZod, 'toSentinelConfig')\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAkB;AAAA,EAA0B;AAAA,OAC1D;;;ACJP;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP;AAAA,EACE;AAAA,EAAU;AAAA,EAAoB;AAAA,OACzB;AACP,YAAY,OAAO;AAEZ,IAAM,4BAET,SAAS,qCAAqC,IAAI;AAG/C,IAAM,yBAIP,SAAO,mBAAmB,yBAAyB,GAAG,EAAE,GAAG,eAAe,MAAM,CAAC;AAIhF,IAAM,wBAA8E,aAAa,sBAAsB;AACvH,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;AAChJ,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;;;ADbvJ,IAAM,oBAAoB,IAAI,kBAAoC;AAC3D,IAAM,qBAAqB,kBAAkB,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACrG,IAAM,2BAA2B,IAAI,yBAAyC;AACvE,IAAM,mBAAmB,yBAAyB,OAAO,CAAC,yBAAyB,CAAC;AAEpF,IAAM,mBAAmB,gBAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,gBAAgB,OAAO,kBAAkB;AAIpE,IAAM,qBAAqB,YAAY,OAAO,gBAAgB;AAG9D,IAAM,uBAAuB,YAAY,OAAO,kBAAkB;;;ADflE,IAAM,8CAA+D,CAAC;AAG7E,IAAM,UAAU,IAAI,gBAA4C;AAEzD,IAAM,+BAAsE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AAiC;AAC/L,IAAM,kCAAyGE,cAAa,kCAAkC,iCAAiC;;;AC5EtM;AAAA,EACE,gBAAAI;AAAA,EAAc,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,OACvB;AACP;AAAA,EACE,YAAAC;AAAA,OACK;AACP,YAAYC,QAAO;AAGnB,SAAS,uBAAuB;AAKzB,IAAM,uBAETD,UAAS,+BAA+B,IAAI;AAGzC,IAAM,oBAUP,UAAO,iBAAiB;AAAA,EAC5B,QAAU,WAAQ,oBAAoB;AAAA,EACtC,aAAe,YAAW,SAAQ,UAAkC,CAAC,CAAC;AAAA,EACtE,aAAe,YAAW,WAAQ,CAAC;AAAA,EACnC,OAAS,SAAQ,UAAa,CAAC;AAAA,EAC/B,aAAe,YAAW,WAAQ,CAAC;AACrC,CAAC;AAIM,IAAM,mBAAwEF,cAAa,iBAAiB;AAC5G,IAAM,mBAAwED,cAAa,mBAAmB,kBAAkB;AAChI,IAAM,mBAAwEE,cAAa,mBAAmB,kBAAkB;",
|
|
6
6
|
"names": ["AsObjectFactory", "AsObjectFactory", "IsObjectFactory", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "z"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __reflectGet = Reflect.get;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
8
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
+
if (decorator = decorators[i])
|
|
10
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11
|
+
if (kind && result) __defProp(target, key, result);
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15
|
+
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
16
|
+
|
|
1
17
|
// src/modules/sentinel-wrapper/Wrapper.ts
|
|
2
18
|
import { constructableModuleWrapper, ModuleWrapper } from "#module-wrapper";
|
|
3
19
|
import {
|
|
@@ -5,11 +21,7 @@ import {
|
|
|
5
21
|
isSentinelModule,
|
|
6
22
|
SentinelReportQuerySchema
|
|
7
23
|
} from "#sentinel-model";
|
|
8
|
-
constructableModuleWrapper();
|
|
9
24
|
var SentinelWrapper = class extends ModuleWrapper {
|
|
10
|
-
static instanceIdentityCheck = isSentinelInstance;
|
|
11
|
-
static moduleIdentityCheck = isSentinelModule;
|
|
12
|
-
static requiredQueries = [SentinelReportQuerySchema, ...super.requiredQueries];
|
|
13
25
|
archivists() {
|
|
14
26
|
throw new Error("Not supported");
|
|
15
27
|
}
|
|
@@ -25,6 +37,12 @@ var SentinelWrapper = class extends ModuleWrapper {
|
|
|
25
37
|
throw new Error("Not supported");
|
|
26
38
|
}
|
|
27
39
|
};
|
|
40
|
+
__publicField(SentinelWrapper, "instanceIdentityCheck", isSentinelInstance);
|
|
41
|
+
__publicField(SentinelWrapper, "moduleIdentityCheck", isSentinelModule);
|
|
42
|
+
__publicField(SentinelWrapper, "requiredQueries", [SentinelReportQuerySchema, ...__superGet(SentinelWrapper, SentinelWrapper, "requiredQueries")]);
|
|
43
|
+
SentinelWrapper = __decorateClass([
|
|
44
|
+
constructableModuleWrapper()
|
|
45
|
+
], SentinelWrapper);
|
|
28
46
|
export {
|
|
29
47
|
SentinelWrapper
|
|
30
48
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/modules/sentinel-wrapper/Wrapper.ts"],
|
|
4
|
-
"sourcesContent": ["import type { TypeCheck } from '@ariestools/sdk'\nimport type { AccountInstance, Payload } from '@xyo-network/sdk-protocol'\n\nimport type { ArchivistInstance } from '#archivist-model'\nimport type { ModuleQueryResult, QueryableModuleTypeCheck } from '#module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '#module-wrapper'\nimport type {\n SentinelInstance,\n SentinelModule,\n SentinelReportQuery,\n} from '#sentinel-model'\nimport {\n isSentinelInstance,\n isSentinelModule,\n SentinelReportQuerySchema,\n} from '#sentinel-model'\nimport type { WitnessInstance } from '#witness-model'\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { TypeCheck } from '@ariestools/sdk'\nimport type { AccountInstance, Payload } from '@xyo-network/sdk-protocol'\n\nimport type { ArchivistInstance } from '#archivist-model'\nimport type { ModuleQueryResult, QueryableModuleTypeCheck } from '#module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '#module-wrapper'\nimport type {\n SentinelInstance,\n SentinelModule,\n SentinelReportQuery,\n} from '#sentinel-model'\nimport {\n isSentinelInstance,\n isSentinelModule,\n SentinelReportQuerySchema,\n} from '#sentinel-model'\nimport type { WitnessInstance } from '#witness-model'\n\n@constructableModuleWrapper()\nexport class SentinelWrapper<TModule extends SentinelModule = SentinelModule>\n extends ModuleWrapper<TModule>\n implements SentinelInstance<TModule['params']> {\n static override readonly instanceIdentityCheck: TypeCheck<SentinelInstance> = isSentinelInstance\n static override readonly moduleIdentityCheck: QueryableModuleTypeCheck<SentinelModule> = isSentinelModule\n static override readonly requiredQueries: string[] = [SentinelReportQuerySchema, ...super.requiredQueries]\n\n archivists(): Promise<ArchivistInstance[]> {\n throw new Error('Not supported')\n }\n\n async report(payloads?: Payload[]): Promise<Payload[]> {\n const queryPayload: SentinelReportQuery = { schema: SentinelReportQuerySchema }\n return await this.sendQuery(queryPayload, payloads)\n }\n\n async reportQuery(payloads?: Payload[], account?: AccountInstance): Promise<ModuleQueryResult> {\n const queryPayload: SentinelReportQuery = { schema: SentinelReportQuerySchema }\n return await this.sendQueryRaw(queryPayload, payloads, account)\n }\n\n witnesses(): Promise<WitnessInstance[]> {\n throw new Error('Not supported')\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAKA,SAAS,4BAA4B,qBAAqB;AAM1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIA,IAAM,kBAAN,cACG,cACuC;AAAA,EAK/C,aAA2C;AACzC,UAAM,IAAI,MAAM,eAAe;AAAA,EACjC;AAAA,EAEA,MAAM,OAAO,UAA0C;AACrD,UAAM,eAAoC,EAAE,QAAQ,0BAA0B;AAC9E,WAAO,MAAM,KAAK,UAAU,cAAc,QAAQ;AAAA,EACpD;AAAA,EAEA,MAAM,YAAY,UAAsB,SAAuD;AAC7F,UAAM,eAAoC,EAAE,QAAQ,0BAA0B;AAC9E,WAAO,MAAM,KAAK,aAAa,cAAc,UAAU,OAAO;AAAA,EAChE;AAAA,EAEA,YAAwC;AACtC,UAAM,IAAI,MAAM,eAAe;AAAA,EACjC;AACF;AArBE,cAHW,iBAGc,yBAAqD;AAC9E,cAJW,iBAIc,uBAAgE;AACzF,cALW,iBAKc,mBAA4B,CAAC,2BAA2B,GAAG,6CAAM,kBAAe;AAL9F,kBAAN;AAAA,EADN,2BAA2B;AAAA,GACf;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,8 +36,10 @@ var asWitnessObserveQuery = zodAsFactory(WitnessObserveQueryZod, "asWitnessObser
|
|
|
36
36
|
var toWitnessObserveQuery = zodToFactory(WitnessObserveQueryZod, "toWitnessObserveQuery");
|
|
37
37
|
|
|
38
38
|
// src/modules/witness-model/typeChecks.ts
|
|
39
|
-
var
|
|
40
|
-
var
|
|
39
|
+
var isInstanceFactory = new IsInstanceFactory();
|
|
40
|
+
var isWitnessInstance = isInstanceFactory.create({ observe: "function" }, [isModuleInstance]);
|
|
41
|
+
var isQueryableModuleFactory = new IsQueryableModuleFactory();
|
|
42
|
+
var isWitnessModule = isQueryableModuleFactory.create([WitnessObserveQuerySchema]);
|
|
41
43
|
var asWitnessModule = AsObjectFactory.create(isWitnessModule);
|
|
42
44
|
var asWitnessInstance = AsObjectFactory.create(isWitnessInstance);
|
|
43
45
|
var withWitnessModule = WithFactory.create(isWitnessModule);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/modules/witness-model/attachable/asAttachableInstance.ts", "../../src/modules/witness-model/attachable/isAttachableInstance.ts", "../../src/modules/witness-model/typeChecks.ts", "../../src/modules/witness-model/Queries/Observe.ts", "../../src/modules/witness-model/attachable/AttachableInstance.ts", "../../src/modules/witness-model/Config.ts"],
|
|
4
|
-
"sourcesContent": ["import { AsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableWitnessInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableWitnessInstance = AsObjectFactory.create(isAttachableWitnessInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableModuleInstance } from '#module-model'\n\nimport { isWitnessInstance } from '../typeChecks.ts'\nimport type { AttachableWitnessInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableWitnessInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableWitnessInstance>()\n\nexport const isAttachableWitnessInstance: TypeCheck<AttachableWitnessInstance> = factory.create(requiredAttachableWitnessInstanceFunctions, [\n isWitnessInstance,\n isAttachableModuleInstance,\n])\n", "import type { TypeCheck } from '@ariestools/sdk'\nimport { AsObjectFactory } from '@ariestools/sdk'\n\nimport {\n IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,\n} from '#module-model'\n\nimport type { WitnessInstance } from './Instance.ts'\nimport type { WitnessModule } from './Module.ts'\nimport { WitnessObserveQuerySchema } from './Queries/index.ts'\n\nexport const isWitnessInstance: TypeCheck<WitnessInstance> =
|
|
5
|
-
"mappings": ";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACF3C,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAkB;AAAA,EAA0B;AAAA,OAC1D;;;ACLP;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP;AAAA,EACE;AAAA,EAAU;AAAA,EAAoB;AAAA,OACzB;AACP,YAAY,OAAO;AAEZ,IAAM,4BAET,SAAS,qCAAqC,IAAI;AAG/C,IAAM,yBAKP,SAAO,mBAAmB,yBAAyB,GAAG;AAAA,EAC1D,GAAG,eAAe;AAAA,EAClB,UAAY,WAAW,QAAQ,SAAO,CAAC,CAAC;AAC1C,CAAC;AAIM,IAAM,wBAA8E,aAAa,sBAAsB;AACvH,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;AAChJ,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;;;
|
|
4
|
+
"sourcesContent": ["import { AsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableWitnessInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableWitnessInstance = AsObjectFactory.create(isAttachableWitnessInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableModuleInstance } from '#module-model'\n\nimport { isWitnessInstance } from '../typeChecks.ts'\nimport type { AttachableWitnessInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableWitnessInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableWitnessInstance>()\n\nexport const isAttachableWitnessInstance: TypeCheck<AttachableWitnessInstance> = factory.create(requiredAttachableWitnessInstanceFunctions, [\n isWitnessInstance,\n isAttachableModuleInstance,\n])\n", "import type { TypeCheck } from '@ariestools/sdk'\nimport { AsObjectFactory } from '@ariestools/sdk'\n\nimport {\n IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,\n} from '#module-model'\n\nimport type { WitnessInstance } from './Instance.ts'\nimport type { WitnessModule } from './Module.ts'\nimport { WitnessObserveQuerySchema } from './Queries/index.ts'\n\nconst isInstanceFactory = new IsInstanceFactory<WitnessInstance>()\nexport const isWitnessInstance: TypeCheck<WitnessInstance> = isInstanceFactory.create({ observe: 'function' }, [isModuleInstance])\nconst isQueryableModuleFactory = new IsQueryableModuleFactory<WitnessModule>()\nexport const isWitnessModule: TypeCheck<WitnessModule> = isQueryableModuleFactory.create([WitnessObserveQuerySchema])\n\nexport const asWitnessModule = AsObjectFactory.create(isWitnessModule)\nexport const asWitnessInstance = AsObjectFactory.create(isWitnessInstance)\n\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withWitnessModule = WithFactory.create(isWitnessModule)\n\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withWitnessInstance = WithFactory.create(isWitnessInstance)\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const WitnessObserveQuerySchema: 'network.xyo.query.witness.observe' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.witness.observe', true)\nexport type WitnessObserveQuerySchema = typeof WitnessObserveQuerySchema\n\nexport const WitnessObserveQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<WitnessObserveQuerySchema> }\n & (typeof QueryFieldsZod)['shape']\n & { payloads: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>> },\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(WitnessObserveQuerySchema), {\n ...QueryFieldsZod.shape,\n payloads: z.optional(z.array(z.string())),\n})\n\nexport type WitnessObserveQuery = z.infer<typeof WitnessObserveQueryZod>\n\nexport const isWitnessObserveQuery: ReturnType<typeof zodIsFactory<WitnessObserveQuery>> = zodIsFactory(WitnessObserveQueryZod)\nexport const asWitnessObserveQuery: ReturnType<typeof zodAsFactory<WitnessObserveQuery>> = zodAsFactory(WitnessObserveQueryZod, 'asWitnessObserveQuery')\nexport const toWitnessObserveQuery: ReturnType<typeof zodToFactory<WitnessObserveQuery>> = zodToFactory(WitnessObserveQueryZod, 'toWitnessObserveQuery')\n", "import type { TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\nimport type { Payload } from '@xyo-network/sdk-protocol'\n\nimport type { AttachableModuleInstance } from '#module-model'\n\nimport type { WitnessModuleEventData } from '../EventData.ts'\nimport type { WitnessInstance } from '../Instance.ts'\nimport type { WitnessParams } from '../Params.ts'\n\nexport interface AttachableWitnessInstance<\n TParams extends WitnessParams = WitnessParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends WitnessModuleEventData = WitnessModuleEventData,\n> extends WitnessInstance<TParams, TIn, TOut, TEventData>,\n AttachableModuleInstance<TParams, TEventData> {}\n\nexport type AttachableWitnessInstanceTypeCheck<T extends AttachableWitnessInstance = AttachableWitnessInstance> = TypeCheck<T>\n\nexport class IsAttachableWitnessInstanceFactory<T extends AttachableWitnessInstance = AttachableWitnessInstance> extends IsObjectFactory<T> {}\n", "import type { EmptyObject, WithAdditional } from '@ariestools/sdk'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport type {\n Payload,\n Schema,\n} from '@xyo-network/sdk-protocol'\nimport { asSchema } from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleConfig } from '#module-model'\nimport { ModuleConfigZod } from '#module-model'\n\nexport const WitnessConfigSchema: 'network.xyo.witness.config' & {\n readonly __schema: true\n} = asSchema('network.xyo.witness.config', true)\nexport type WitnessConfigSchema = typeof WitnessConfigSchema\n\nexport const WitnessConfigZod: z.ZodMiniObject<\n Omit<(typeof ModuleConfigZod)['shape'], 'schema'> & { schema: z.ZodMiniLiteral<WitnessConfigSchema> },\n z.core.$strip\n> = z.extend(ModuleConfigZod, { schema: z.literal(WitnessConfigSchema) })\n\nexport type WitnessConfigBase = z.infer<typeof WitnessConfigZod>\n\nexport const isWitnessConfig: ReturnType<typeof zodIsFactory<WitnessConfigBase>> = zodIsFactory(WitnessConfigZod)\nexport const asWitnessConfig: ReturnType<typeof zodAsFactory<WitnessConfigBase>> = zodAsFactory(WitnessConfigZod, 'asWitnessConfig')\nexport const toWitnessConfig: ReturnType<typeof zodToFactory<WitnessConfigBase>> = zodToFactory(WitnessConfigZod, 'toWitnessConfig')\n\nexport type WitnessConfig<TConfig extends EmptyObject | Payload | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : WitnessConfigSchema\n },\n TConfig\n >,\n TSchema\n>\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACF3C,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAkB;AAAA,EAA0B;AAAA,OAC1D;;;ACLP;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP;AAAA,EACE;AAAA,EAAU;AAAA,EAAoB;AAAA,OACzB;AACP,YAAY,OAAO;AAEZ,IAAM,4BAET,SAAS,qCAAqC,IAAI;AAG/C,IAAM,yBAKP,SAAO,mBAAmB,yBAAyB,GAAG;AAAA,EAC1D,GAAG,eAAe;AAAA,EAClB,UAAY,WAAW,QAAQ,SAAO,CAAC,CAAC;AAC1C,CAAC;AAIM,IAAM,wBAA8E,a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ema", "z"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __reflectGet = Reflect.get;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
8
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
+
if (decorator = decorators[i])
|
|
10
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11
|
+
if (kind && result) __defProp(target, key, result);
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15
|
+
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
16
|
+
|
|
1
17
|
// src/modules/witness-wrapper/WitnessWrapper.ts
|
|
2
18
|
import { constructableModuleWrapper, ModuleWrapper } from "#module-wrapper";
|
|
3
19
|
import {
|
|
@@ -5,11 +21,7 @@ import {
|
|
|
5
21
|
isWitnessModule,
|
|
6
22
|
WitnessObserveQuerySchema
|
|
7
23
|
} from "#witness-model";
|
|
8
|
-
constructableModuleWrapper();
|
|
9
24
|
var WitnessWrapper = class extends ModuleWrapper {
|
|
10
|
-
static instanceIdentityCheck = isWitnessInstance;
|
|
11
|
-
static moduleIdentityCheck = isWitnessModule;
|
|
12
|
-
static requiredQueries = [WitnessObserveQuerySchema, ...super.requiredQueries];
|
|
13
25
|
async observe(payloads) {
|
|
14
26
|
const queryPayload = { schema: WitnessObserveQuerySchema };
|
|
15
27
|
return await this.sendQuery(queryPayload, [queryPayload, ...payloads ?? []]);
|
|
@@ -19,6 +31,12 @@ var WitnessWrapper = class extends ModuleWrapper {
|
|
|
19
31
|
return await this.sendQueryRaw(queryPayload, payloads, account);
|
|
20
32
|
}
|
|
21
33
|
};
|
|
34
|
+
__publicField(WitnessWrapper, "instanceIdentityCheck", isWitnessInstance);
|
|
35
|
+
__publicField(WitnessWrapper, "moduleIdentityCheck", isWitnessModule);
|
|
36
|
+
__publicField(WitnessWrapper, "requiredQueries", [WitnessObserveQuerySchema, ...__superGet(WitnessWrapper, WitnessWrapper, "requiredQueries")]);
|
|
37
|
+
WitnessWrapper = __decorateClass([
|
|
38
|
+
constructableModuleWrapper()
|
|
39
|
+
], WitnessWrapper);
|
|
22
40
|
export {
|
|
23
41
|
WitnessWrapper
|
|
24
42
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/modules/witness-wrapper/WitnessWrapper.ts"],
|
|
4
|
-
"sourcesContent": ["import type { TypeCheck } from '@ariestools/sdk'\nimport type { AccountInstance, Payload } from '@xyo-network/sdk-protocol'\n\nimport type { AnyConfigSchema, ModuleQueryResult } from '#module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '#module-wrapper'\nimport type {\n WitnessConfig,\n WitnessInstance,\n WitnessModule,\n WitnessModuleEventData,\n WitnessObserveQuery,\n WitnessParams,\n} from '#witness-model'\nimport {\n isWitnessInstance,\n isWitnessModule,\n WitnessObserveQuerySchema,\n} from '#witness-model'\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { TypeCheck } from '@ariestools/sdk'\nimport type { AccountInstance, Payload } from '@xyo-network/sdk-protocol'\n\nimport type { AnyConfigSchema, ModuleQueryResult } from '#module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '#module-wrapper'\nimport type {\n WitnessConfig,\n WitnessInstance,\n WitnessModule,\n WitnessModuleEventData,\n WitnessObserveQuery,\n WitnessParams,\n} from '#witness-model'\nimport {\n isWitnessInstance,\n isWitnessModule,\n WitnessObserveQuerySchema,\n} from '#witness-model'\n\n@constructableModuleWrapper()\nexport class WitnessWrapper<TModule extends WitnessModule = WitnessModule>\n extends ModuleWrapper<TModule>\n implements WitnessInstance<TModule['params']> {\n static override readonly instanceIdentityCheck: TypeCheck<WitnessInstance<WitnessParams<AnyConfigSchema<WitnessConfig>>, Payload, Payload, WitnessModuleEventData>> = isWitnessInstance\n static override readonly moduleIdentityCheck: TypeCheck<WitnessModule<WitnessParams<AnyConfigSchema<WitnessConfig>>, WitnessModuleEventData>> = isWitnessModule\n static override readonly requiredQueries: string[] = [WitnessObserveQuerySchema, ...super.requiredQueries]\n\n async observe(payloads?: Payload[]): Promise<Payload[]> {\n const queryPayload: WitnessObserveQuery = { schema: WitnessObserveQuerySchema }\n return await this.sendQuery(queryPayload, [queryPayload, ...(payloads ?? [])])\n }\n\n async observeQuery(payloads?: Payload[], account?: AccountInstance): Promise<ModuleQueryResult> {\n const queryPayload: WitnessObserveQuery = { schema: WitnessObserveQuerySchema }\n return await this.sendQueryRaw(queryPayload, payloads, account)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAIA,SAAS,4BAA4B,qBAAqB;AAS1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,IAAM,iBAAN,cACG,cACsC;AAAA,EAK9C,MAAM,QAAQ,UAA0C;AACtD,UAAM,eAAoC,EAAE,QAAQ,0BAA0B;AAC9E,WAAO,MAAM,KAAK,UAAU,cAAc,CAAC,cAAc,GAAI,YAAY,CAAC,CAAE,CAAC;AAAA,EAC/E;AAAA,EAEA,MAAM,aAAa,UAAsB,SAAuD;AAC9F,UAAM,eAAoC,EAAE,QAAQ,0BAA0B;AAC9E,WAAO,MAAM,KAAK,aAAa,cAAc,UAAU,OAAO;AAAA,EAChE;AACF;AAbE,cAHW,gBAGc,yBAA6I;AACtK,cAJW,gBAIc,uBAAuH;AAChJ,cALW,gBAKc,mBAA4B,CAAC,2BAA2B,GAAG,2CAAM,kBAAe;AAL9F,iBAAN;AAAA,EADN,2BAA2B;AAAA,GACf;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { ApiConfig } from '@xyo-network/sdk-protocol';
|
|
2
1
|
import type { GetLocationQueryResponse } from './models.js';
|
|
3
2
|
import type { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries/index.js';
|
|
3
|
+
interface LocationDivinerApiConfig {
|
|
4
|
+
apiDomain: string;
|
|
5
|
+
}
|
|
4
6
|
declare class LocationDivinerApi {
|
|
5
|
-
config:
|
|
6
|
-
constructor(config:
|
|
7
|
+
config: LocationDivinerApiConfig;
|
|
8
|
+
constructor(config: LocationDivinerApiConfig);
|
|
7
9
|
getLocationQuery(hash: string): Promise<GetLocationQueryResponse>;
|
|
8
10
|
postLocationQuery(request: SupportedLocationQueryCreationRequest): Promise<LocationQueryCreationResponse>;
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationDivinerApi.d.ts","sourceRoot":"","sources":["../../../../../src/modules/api-location-diviner/LocationDiviner/LocationDivinerApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocationDivinerApi.d.ts","sourceRoot":"","sources":["../../../../../src/modules/api-location-diviner/LocationDiviner/LocationDivinerApi.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,6BAA6B,EAAE,qCAAqC,EAAE,MAAM,oBAAoB,CAAA;AAE9G,UAAU,wBAAwB;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAMD,cAAM,kBAAkB;IACtB,MAAM,EAAE,wBAAwB,CAAA;gBACpB,MAAM,EAAE,wBAAwB;IAItC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAKjE,iBAAiB,CAAC,OAAO,EAAE,qCAAqC,GAAG,OAAO,CAAC,6BAA6B,CAAC;CAIhH;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import type { ApiConfig } from '@xyo-network/sdk-protocol';
|
|
2
1
|
import type { LocationHeatmapQuery, LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.js';
|
|
3
2
|
import type { LocationQuadkeyHeatmapQuery, LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.js';
|
|
4
3
|
import type { LocationQuerySchema } from './LocationQuerySchema.js';
|
|
5
4
|
import type { LocationTimeRangeQuery, LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.js';
|
|
5
|
+
export interface LocationArchivistEndpoint {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
apiDomain: string;
|
|
8
|
+
root?: string;
|
|
9
|
+
}
|
|
6
10
|
export interface LocationQueryCreationRequest<TSchema extends LocationQuerySchema = LocationQuerySchema, TQuery extends object = object> {
|
|
7
11
|
query: TQuery;
|
|
8
12
|
resultArchive: string;
|
|
9
|
-
resultArchivist:
|
|
13
|
+
resultArchivist: LocationArchivistEndpoint;
|
|
10
14
|
schema: TSchema;
|
|
11
15
|
sourceArchive: string;
|
|
12
|
-
sourceArchivist:
|
|
16
|
+
sourceArchivist: LocationArchivistEndpoint;
|
|
13
17
|
}
|
|
14
18
|
export type LocationTimeRangeQueryCreationRequest = LocationQueryCreationRequest<LocationTimeRangeQuerySchema, LocationTimeRangeQuery>;
|
|
15
19
|
export type LocationHeatmapQueryCreationRequest = LocationQueryCreationRequest<LocationHeatmapQuerySchema, LocationHeatmapQuery>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationQueryCreationRequest.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/api-location-diviner/LocationDiviner/Queries/LocationQueryCreationRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"LocationQueryCreationRequest.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/api-location-diviner/LocationDiviner/Queries/LocationQueryCreationRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AACvG,OAAO,KAAK,EAAE,2BAA2B,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAA;AAC5H,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAE7G,MAAM,WAAW,yBAAyB;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,4BAA4B,CAC3C,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,EACzD,MAAM,SAAS,MAAM,GAAG,MAAM;IAE9B,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,yBAAyB,CAAA;IAC1C,MAAM,EAAE,OAAO,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,yBAAyB,CAAA;CAC3C;AAED,MAAM,MAAM,qCAAqC,GAAG,4BAA4B,CAAC,4BAA4B,EAAE,sBAAsB,CAAC,CAAA;AACtI,MAAM,MAAM,mCAAmC,GAAG,4BAA4B,CAAC,0BAA0B,EAAE,oBAAoB,CAAC,CAAA;AAEhI,MAAM,MAAM,0CAA0C,GAAG,4BAA4B,CAAC,iCAAiC,EAAE,2BAA2B,CAAC,CAAA;AAErJ,MAAM,MAAM,qCAAqC,GAC3C,qCAAqC,GACrC,mCAAmC,GACnC,0CAA0C,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { zodAsFactory, zodIsFactory, zodToFactory } from '@ariestools/sdk';
|
|
2
|
-
import type { ArchivistApi } from '@xyo-network/sdk-protocol';
|
|
3
2
|
import * as z from 'zod/mini';
|
|
4
3
|
import { DivinerConfigZod } from '../diviner-model/index.js';
|
|
5
4
|
export declare const RemoteDivinerConfigSchema: 'network.xyo.diviner.remote.config' & {
|
|
@@ -8,7 +7,7 @@ export declare const RemoteDivinerConfigSchema: 'network.xyo.diviner.remote.conf
|
|
|
8
7
|
export type RemoteDivinerConfigSchema = typeof RemoteDivinerConfigSchema;
|
|
9
8
|
export declare const RemoteDivinerConfigZod: z.ZodMiniObject<Omit<(typeof DivinerConfigZod)['shape'], 'schema'> & {
|
|
10
9
|
/** @deprecated use in params instead */
|
|
11
|
-
api: z.ZodMiniOptional<z.ZodMiniCustom<
|
|
10
|
+
api: z.ZodMiniOptional<z.ZodMiniCustom<object, object>>;
|
|
12
11
|
archive: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
13
12
|
schema: z.ZodMiniLiteral<RemoteDivinerConfigSchema>;
|
|
14
13
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteDivinerConfig.d.ts","sourceRoot":"","sources":["../../../../src/modules/api-location-diviner/RemoteDivinerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAAE,YAAY,EAAE,YAAY,EACzC,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"RemoteDivinerConfig.d.ts","sourceRoot":"","sources":["../../../../src/modules/api-location-diviner/RemoteDivinerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAAE,YAAY,EAAE,YAAY,EACzC,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,eAAO,MAAM,yBAAyB,E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AAe,EAAE,MAAM,CAAA;IACvB,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/C;AAMD,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAgBnF;AAED,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,sBAAsB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"payloadAdmission.d.ts","sourceRoot":"","sources":["../../../../src/modules/archivist-abstract/payloadAdmission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAGxD,gFAAgF;AAChF,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/C;AAMD,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAgBnF;AAED,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAelG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../../../../src/modules/archivist-model/typeChecks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAOhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../../../../src/modules/archivist-model/typeChecks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAOhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAIlE,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,iBAAiB,CAAqE,CAAA;AAElI,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,uBAAuB,CAA8D,CAAA;AAE/H,eAAO,MAAM,iBAAiB,qPAA4C,CAAA;AAC1E,eAAO,MAAM,mBAAmB,sRAA8C,CAAA;AAE9E,mDAAmD;AAEnD,eAAO,MAAM,mBAAmB,gQAAwC,CAAA;AACxE,mDAAmD;AAEnD,eAAO,MAAM,qBAAqB,iSAA0C,CAAA"}
|