@reventlessdev/reventless-core 3.0.0-alpha.134
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/CHANGELOG.md +1355 -0
- package/LICENSE +202 -0
- package/README.md +173 -0
- package/__mocks__/emptyModule.js +2 -0
- package/jest.setup.cjs +5 -0
- package/package.json +73 -0
- package/rescript.json +41 -0
- package/scripts/deploy.sh +6 -0
- package/scripts/post-deploy.sh +5 -0
- package/scripts/pre-deploy.sh +18 -0
- package/scripts/pulumi-up.sh +30 -0
- package/src/Behavior.res +18 -0
- package/src/Behavior.res.mjs +2 -0
- package/src/ComponentType.res +125 -0
- package/src/ComponentType.res.mjs +199 -0
- package/src/Env.res +5 -0
- package/src/Env.res.mjs +2 -0
- package/src/Mapper.res +36 -0
- package/src/Mapper.res.mjs +18 -0
- package/src/Mapper1toN.res +107 -0
- package/src/Mapper1toN.res.mjs +2 -0
- package/src/MapperNto1.res +78 -0
- package/src/MapperNto1.res.mjs +35 -0
- package/src/Message.res +353 -0
- package/src/Message.res.mjs +418 -0
- package/src/PluginRuntimeOperations.res +15 -0
- package/src/PluginRuntimeOperations.res.mjs +2 -0
- package/src/Projection.res +447 -0
- package/src/Projection.res.mjs +712 -0
- package/src/ProjectionMapper.res +44 -0
- package/src/ProjectionMapper.res.mjs +51 -0
- package/src/RequestContext.res +42 -0
- package/src/RequestContext.res.mjs +39 -0
- package/src/adapter/Adapter.res +178 -0
- package/src/adapter/Adapter.res.mjs +201 -0
- package/src/adapter/AdapterDeploytime.res +56 -0
- package/src/adapter/AdapterDeploytime.res.mjs +42 -0
- package/src/adapter/Auth/Auth_Adapter.res +42 -0
- package/src/adapter/Auth/Auth_Adapter.res.mjs +2 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder.res +22 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Common.res +259 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Common.res.mjs +190 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +92 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res.mjs +59 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +52 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res.mjs +49 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +64 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res.mjs +59 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder.res +11 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +46 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res.mjs +40 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +204 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res.mjs +150 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder.res +18 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +36 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res.mjs +28 -0
- package/src/adapter/Runtime/PluginRuntime_Builder.res +23 -0
- package/src/adapter/Runtime/PluginRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/PluginRuntime_Builder_Micro.res +97 -0
- package/src/adapter/Runtime/PluginRuntime_Builder_Micro.res.mjs +62 -0
- package/src/adapter/Runtime/PluginRuntime_Builder_Single.res +89 -0
- package/src/adapter/Runtime/PluginRuntime_Builder_Single.res.mjs +62 -0
- package/src/adapter/Runtime/Runtime.res +106 -0
- package/src/adapter/Runtime/Runtime.res.mjs +22 -0
- package/src/adapter/Runtime/TaskRuntime_Builder.res +32 -0
- package/src/adapter/Runtime/TaskRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +42 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res.mjs +29 -0
- package/src/admin/AdminApi.res +88 -0
- package/src/admin/AdminApi.res.mjs +89 -0
- package/src/admin/Admin_Callback.res +27 -0
- package/src/admin/Admin_Callback.res.mjs +20 -0
- package/src/admin/Platform_Admin.res +402 -0
- package/src/admin/Platform_Admin.res.mjs +250 -0
- package/src/admin/Platform_Admin_Structure.res +125 -0
- package/src/admin/Platform_Admin_Structure.res.mjs +182 -0
- package/src/admin/Platform_ComponentDefinitionsApi.res +160 -0
- package/src/admin/Platform_ComponentDefinitionsApi.res.mjs +299 -0
- package/src/admin/Platform_UIFragmentsApi.res +55 -0
- package/src/admin/Platform_UIFragmentsApi.res.mjs +124 -0
- package/src/admin/UIFragmentRegistryProjection.res +43 -0
- package/src/admin/UIFragmentRegistryProjection.res.mjs +81 -0
- package/src/admin/UIFragmentRegistryReadModelSpec.res +13 -0
- package/src/admin/UIFragmentRegistryReadModelSpec.res.mjs +40 -0
- package/src/components/Aggregate/Aggregate.res +96 -0
- package/src/components/Aggregate/Aggregate.res.mjs +82 -0
- package/src/components/Aggregate/Aggregate_Builder.res +175 -0
- package/src/components/Aggregate/Aggregate_Builder.res.mjs +119 -0
- package/src/components/Aggregate/Aggregate_Callback.res +273 -0
- package/src/components/Aggregate/Aggregate_Callback.res.mjs +208 -0
- package/src/components/Api/ApiAllowedStatesHelpers.res +19 -0
- package/src/components/Api/ApiAllowedStatesHelpers.res.mjs +16 -0
- package/src/components/Api/ApiNoApiHelpers.res +13 -0
- package/src/components/Api/ApiNoApiHelpers.res.mjs +29 -0
- package/src/components/Api/Api_Builder.res +40 -0
- package/src/components/Api/Api_Builder.res.mjs +33 -0
- package/src/components/Api/Api_Naming.res +92 -0
- package/src/components/Api/Api_Naming.res.mjs +103 -0
- package/src/components/Api/Api_Operations.res +13 -0
- package/src/components/Api/Api_Operations.res.mjs +12 -0
- package/src/components/Api/GraphQL_FragmentGenerator.res +612 -0
- package/src/components/Api/GraphQL_FragmentGenerator.res.mjs +503 -0
- package/src/components/Api/GraphQL_SchemaInspector.res +156 -0
- package/src/components/Api/GraphQL_SchemaInspector.res.mjs +123 -0
- package/src/components/Api/GraphQL_Stitcher.res +271 -0
- package/src/components/Api/GraphQL_Stitcher.res.mjs +229 -0
- package/src/components/Api/MCP_SchemaGenerator.res +185 -0
- package/src/components/Api/MCP_SchemaGenerator.res.mjs +146 -0
- package/src/components/Api/SchemaType.res +126 -0
- package/src/components/Api/SchemaType.res.mjs +143 -0
- package/src/components/Api/SuryToJsonSchema.res +142 -0
- package/src/components/Api/SuryToJsonSchema.res.mjs +210 -0
- package/src/components/AutomationSlice/AutomationSlice.res +39 -0
- package/src/components/AutomationSlice/AutomationSlice.res.mjs +24 -0
- package/src/components/AutomationSlice/AutomationSlice_Builder.res +207 -0
- package/src/components/AutomationSlice/AutomationSlice_Builder.res.mjs +123 -0
- package/src/components/AutomationSlice/AutomationSlice_Callback.res +212 -0
- package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +189 -0
- package/src/components/Builder_Helpers.res +196 -0
- package/src/components/Builder_Helpers.res.mjs +142 -0
- package/src/components/Cloner.res +84 -0
- package/src/components/Cloner.res.mjs +88 -0
- package/src/components/CommandGenerator/CommandGenerator.res +54 -0
- package/src/components/CommandGenerator/CommandGenerator.res.mjs +15 -0
- package/src/components/CommandGenerator/CommandGenerator_Adapter.res +22 -0
- package/src/components/CommandGenerator/CommandGenerator_Adapter.res.mjs +2 -0
- package/src/components/CommandGenerator/CommandGenerator_Builder.res +70 -0
- package/src/components/CommandGenerator/CommandGenerator_Builder.res.mjs +68 -0
- package/src/components/CommandGenerator/CommandGenerator_Callback.res +191 -0
- package/src/components/CommandGenerator/CommandGenerator_Callback.res.mjs +161 -0
- package/src/components/CommandTopic/CommandTopic.res +79 -0
- package/src/components/CommandTopic/CommandTopic.res.mjs +68 -0
- package/src/components/CommandTopic/CommandTopic_Adapter.res +53 -0
- package/src/components/CommandTopic/CommandTopic_Adapter.res.mjs +2 -0
- package/src/components/CommandTopic/CommandTopic_Builder.res +146 -0
- package/src/components/CommandTopic/CommandTopic_Builder.res.mjs +127 -0
- package/src/components/CommandTopic/CommandTopic_Callback.res +38 -0
- package/src/components/CommandTopic/CommandTopic_Callback.res.mjs +49 -0
- package/src/components/CommandTopic/CommandTopic_Helpers.res +176 -0
- package/src/components/CommandTopic/CommandTopic_Helpers.res.mjs +195 -0
- package/src/components/CommandTopic/CommandTopic_Operations.res +40 -0
- package/src/components/CommandTopic/CommandTopic_Operations.res.mjs +49 -0
- package/src/components/Component.res +1 -0
- package/src/components/Component.res.mjs +34 -0
- package/src/components/Component.resi +1 -0
- package/src/components/Counter/Counter.res +47 -0
- package/src/components/Counter/Counter.res.mjs +55 -0
- package/src/components/Counter/Counter_Adapter.res +18 -0
- package/src/components/Counter/Counter_Adapter.res.mjs +2 -0
- package/src/components/Counter/Counter_Builder.res +142 -0
- package/src/components/Counter/Counter_Builder.res.mjs +112 -0
- package/src/components/Counter/Counter_Callback.res +94 -0
- package/src/components/Counter/Counter_Callback.res.mjs +70 -0
- package/src/components/Counter/Counter_Operations.res +70 -0
- package/src/components/Counter/Counter_Operations.res.mjs +91 -0
- package/src/components/Dcb/Dcb_Builder.res +971 -0
- package/src/components/Dcb/Dcb_Builder.res.mjs +572 -0
- package/src/components/DcbEventLog/DcbEventLog.res +43 -0
- package/src/components/DcbEventLog/DcbEventLog.res.mjs +24 -0
- package/src/components/DcbEventLog/DcbEventLog_Adapter.res +57 -0
- package/src/components/DcbEventLog/DcbEventLog_Adapter.res.mjs +2 -0
- package/src/components/DcbEventLog/DcbEventLog_Builder.res +72 -0
- package/src/components/DcbEventLog/DcbEventLog_Builder.res.mjs +67 -0
- package/src/components/DcbEventLog/DcbEventLog_Operations.res +160 -0
- package/src/components/DcbEventLog/DcbEventLog_Operations.res.mjs +121 -0
- package/src/components/EventCollector/EventCollector.res +34 -0
- package/src/components/EventCollector/EventCollector.res.mjs +9 -0
- package/src/components/EventCollector/EventCollector_Adapter.res +45 -0
- package/src/components/EventCollector/EventCollector_Adapter.res.mjs +2 -0
- package/src/components/EventCollector/EventCollector_Builder.res +91 -0
- package/src/components/EventCollector/EventCollector_Builder.res.mjs +64 -0
- package/src/components/EventLog/EventLog.res +27 -0
- package/src/components/EventLog/EventLog.res.mjs +13 -0
- package/src/components/EventLog/EventLog_Adapter.res +15 -0
- package/src/components/EventLog/EventLog_Adapter.res.mjs +2 -0
- package/src/components/EventLog/EventLog_Builder.res +65 -0
- package/src/components/EventLog/EventLog_Builder.res.mjs +57 -0
- package/src/components/EventLog/EventLog_Operations.res +209 -0
- package/src/components/EventLog/EventLog_Operations.res.mjs +202 -0
- package/src/components/EventLog/EventPublish_Callback.res +29 -0
- package/src/components/EventLog/EventPublish_Callback.res.mjs +32 -0
- package/src/components/EventMapper/EventMapper.res +72 -0
- package/src/components/EventMapper/EventMapper.res.mjs +54 -0
- package/src/components/EventMapper/EventMapper_Builder.res +128 -0
- package/src/components/EventMapper/EventMapper_Builder.res.mjs +81 -0
- package/src/components/EventMapper/EventMapper_Callback.res +323 -0
- package/src/components/EventMapper/EventMapper_Callback.res.mjs +231 -0
- package/src/components/EventTopic/EventTopic.res +69 -0
- package/src/components/EventTopic/EventTopic.res.mjs +50 -0
- package/src/components/EventTopic/EventTopic_Adapter.res +15 -0
- package/src/components/EventTopic/EventTopic_Adapter.res.mjs +2 -0
- package/src/components/EventTopic/EventTopic_Builder.res +53 -0
- package/src/components/EventTopic/EventTopic_Builder.res.mjs +46 -0
- package/src/components/EventTopic/EventTopic_Operations.res +37 -0
- package/src/components/EventTopic/EventTopic_Operations.res.mjs +39 -0
- package/src/components/Extension/Extension.res +32 -0
- package/src/components/Extension/Extension.res.mjs +9 -0
- package/src/components/Extension/Extension_Builder.res +82 -0
- package/src/components/Extension/Extension_Builder.res.mjs +57 -0
- package/src/components/Extension/Extension_Operations.res +203 -0
- package/src/components/Extension/Extension_Operations.res.mjs +154 -0
- package/src/components/ExtensionPoint/ExtensionPoint.res +49 -0
- package/src/components/ExtensionPoint/ExtensionPoint.res.mjs +25 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Builder.res +163 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Builder.res.mjs +113 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Callback.res +110 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Callback.res.mjs +76 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Operations.res +146 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Operations.res.mjs +122 -0
- package/src/components/Heartbeat/Heartbeat.res +25 -0
- package/src/components/Heartbeat/Heartbeat.res.mjs +9 -0
- package/src/components/Heartbeat/Heartbeat_Adapter.res +14 -0
- package/src/components/Heartbeat/Heartbeat_Adapter.res.mjs +2 -0
- package/src/components/Heartbeat/Heartbeat_Builder.res +43 -0
- package/src/components/Heartbeat/Heartbeat_Builder.res.mjs +47 -0
- package/src/components/Heartbeat/Heartbeat_Callback.res +32 -0
- package/src/components/Heartbeat/Heartbeat_Callback.res.mjs +40 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice.res +34 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice.res.mjs +24 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res +98 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res.mjs +87 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +191 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +175 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice.res +35 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice.res.mjs +24 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res +181 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +137 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +173 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +173 -0
- package/src/components/QueryDb/QueryDb.res +74 -0
- package/src/components/QueryDb/QueryDb.res.mjs +37 -0
- package/src/components/QueryDb/QueryDb_Adapter.res +78 -0
- package/src/components/QueryDb/QueryDb_Adapter.res.mjs +17 -0
- package/src/components/QueryDb/QueryDb_Builder.res +76 -0
- package/src/components/QueryDb/QueryDb_Builder.res.mjs +53 -0
- package/src/components/QueryDb/QueryDb_Callback.res +18 -0
- package/src/components/QueryDb/QueryDb_Callback.res.mjs +21 -0
- package/src/components/QueryDb/QueryDb_Operations.res +116 -0
- package/src/components/QueryDb/QueryDb_Operations.res.mjs +165 -0
- package/src/components/ReadModel/ReadModel.res +42 -0
- package/src/components/ReadModel/ReadModel.res.mjs +27 -0
- package/src/components/ReadModel/ReadModel_Builder.res +155 -0
- package/src/components/ReadModel/ReadModel_Builder.res.mjs +101 -0
- package/src/components/ReadModel/ReadModel_Callback.res +48 -0
- package/src/components/ReadModel/ReadModel_Callback.res.mjs +48 -0
- package/src/components/Scheduler/Scheduler.res +13 -0
- package/src/components/Scheduler/Scheduler.res.mjs +9 -0
- package/src/components/Scheduler/Scheduler_Adapter.res +13 -0
- package/src/components/Scheduler/Scheduler_Adapter.res.mjs +2 -0
- package/src/components/Scheduler/Scheduler_Builder.res +19 -0
- package/src/components/Scheduler/Scheduler_Builder.res.mjs +29 -0
- package/src/components/SideEffectHandler/SideEffectHandler.res +30 -0
- package/src/components/SideEffectHandler/SideEffectHandler.res.mjs +12 -0
- package/src/components/SideEffectHandler/SideEffectHandler_Builder.res +117 -0
- package/src/components/SideEffectHandler/SideEffectHandler_Builder.res.mjs +64 -0
- package/src/components/SideEffectHandler/SideEffectHandler_Callback.res +116 -0
- package/src/components/SideEffectHandler/SideEffectHandler_Callback.res.mjs +95 -0
- package/src/components/StateChangeSlice/StateChangeSlice.res +38 -0
- package/src/components/StateChangeSlice/StateChangeSlice.res.mjs +17 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res +91 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res.mjs +81 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +412 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +299 -0
- package/src/components/StateTopic.res +91 -0
- package/src/components/StateTopic.res.mjs +41 -0
- package/src/components/StateViewSlice/StateViewSlice.res +33 -0
- package/src/components/StateViewSlice/StateViewSlice.res.mjs +24 -0
- package/src/components/StateViewSlice/StateViewSlice_Builder.res +176 -0
- package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +134 -0
- package/src/components/StateViewSlice/StateViewSlice_Callback.res +64 -0
- package/src/components/StateViewSlice/StateViewSlice_Callback.res.mjs +56 -0
- package/src/components/Task/Task.res +81 -0
- package/src/components/Task/Task.res.mjs +51 -0
- package/src/components/Task/Task_Adapter.res +31 -0
- package/src/components/Task/Task_Adapter.res.mjs +2 -0
- package/src/components/Task/Task_Builder.res +223 -0
- package/src/components/Task/Task_Builder.res.mjs +115 -0
- package/src/plugin/api/PluginBaseFragment.res +104 -0
- package/src/plugin/api/PluginBaseFragment.res.mjs +64 -0
- package/src/plugin/component/Plugin.res +100 -0
- package/src/plugin/component/Plugin.res.mjs +61 -0
- package/src/plugin/component/Plugin_Builder.res +1017 -0
- package/src/plugin/component/Plugin_Builder.res.mjs +608 -0
- package/src/plugin/component/Plugin_BuiltHook.res +141 -0
- package/src/plugin/component/Plugin_BuiltHook.res.mjs +39 -0
- package/src/plugin/component/Plugin_Callback.res +98 -0
- package/src/plugin/component/Plugin_Callback.res.mjs +55 -0
- package/src/plugin/component/Plugin_Helpers.res +1730 -0
- package/src/plugin/component/Plugin_Helpers.res.mjs +1010 -0
- package/src/plugin/component/Plugin_ResolverError.res +27 -0
- package/src/plugin/component/Plugin_ResolverError.res.mjs +21 -0
- package/src/plugin/component/Plugin_Structure.res +570 -0
- package/src/plugin/component/Plugin_Structure.res.mjs +458 -0
- package/src/plugin/component/Plugin_SubscriptionSchema.res +103 -0
- package/src/plugin/component/Plugin_SubscriptionSchema.res.mjs +71 -0
- package/src/plugin/component/SchemaWalker.res +164 -0
- package/src/plugin/component/SchemaWalker.res.mjs +183 -0
- package/src/plugin/connect/PluginConnectExtension_Builder.res +14 -0
- package/src/plugin/connect/PluginConnectExtension_Builder.res.mjs +36 -0
- package/src/plugin/connect/PluginConnectExtension_Mapping.res +76 -0
- package/src/plugin/connect/PluginConnectExtension_Mapping.res.mjs +89 -0
- package/src/plugin/connect/PluginExtensionPoint_Builder.res +39 -0
- package/src/plugin/connect/PluginExtensionPoint_Builder.res.mjs +33 -0
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res +231 -0
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +353 -0
- package/src/plugin/lifecycle/PluginBehavior.res +250 -0
- package/src/plugin/lifecycle/PluginBehavior.res.mjs +391 -0
- package/src/plugin/lifecycle/PluginSpec.res +84 -0
- package/src/plugin/lifecycle/PluginSpec.res.mjs +148 -0
- package/src/plugin/lifecycle/PluginsProjection.res +154 -0
- package/src/plugin/lifecycle/PluginsProjection.res.mjs +230 -0
- package/src/plugin/lifecycle/PluginsReadModelSpec.res +66 -0
- package/src/plugin/lifecycle/PluginsReadModelSpec.res.mjs +58 -0
- package/src/util/AWS.res +7 -0
- package/src/util/AWS.res.mjs +20 -0
- package/src/util/CSV.res +27 -0
- package/src/util/CSV.res.mjs +56 -0
- package/src/util/CommandPublisher.res +133 -0
- package/src/util/CommandPublisher.res.mjs +161 -0
- package/src/util/CsvStream.res +39 -0
- package/src/util/CsvStream.res.mjs +42 -0
- package/src/util/EffectLogger.res +178 -0
- package/src/util/EffectLogger.res.mjs +171 -0
- package/src/util/FTP.res +69 -0
- package/src/util/FTP.res.mjs +101 -0
- package/src/util/FTPHandler.res +142 -0
- package/src/util/FTPHandler.res.mjs +136 -0
- package/src/util/Hash.res +1 -0
- package/src/util/Hash.res.mjs +10 -0
- package/src/util/Interstack.res +74 -0
- package/src/util/Interstack.res.mjs +126 -0
- package/src/util/Interstack.resi +25 -0
- package/src/util/LogFormat.res +222 -0
- package/src/util/LogFormat.res.mjs +257 -0
- package/src/util/Logger.res +196 -0
- package/src/util/Logger.res.mjs +238 -0
- package/src/util/Lru.res +51 -0
- package/src/util/Lru.res.mjs +59 -0
- package/src/util/Lru.resi +32 -0
- package/src/util/Metrics.res +32 -0
- package/src/util/Metrics.res.mjs +42 -0
- package/src/util/OutputFailsafeDeploytime.res +16 -0
- package/src/util/OutputFailsafeDeploytime.res.mjs +20 -0
- package/src/util/OutputFailsafeRuntime.res +6 -0
- package/src/util/OutputFailsafeRuntime.res.mjs +15 -0
- package/src/util/OutputLogger.res +9 -0
- package/src/util/OutputLogger.res.mjs +19 -0
- package/src/util/ResourceQuery.res +14 -0
- package/src/util/ResourceQuery.res.mjs +17 -0
- package/src/util/ResourceQueryRuntime.res +17 -0
- package/src/util/ResourceQueryRuntime.res.mjs +18 -0
- package/src/util/ScheduleOps.res +124 -0
- package/src/util/ScheduleOps.res.mjs +132 -0
- package/src/util/Util.res +12 -0
- package/src/util/Util.res.mjs +42 -0
- package/src/util/Util_Adapter.res +97 -0
- package/src/util/Util_Adapter.res.mjs +82 -0
- package/src/util/Util_AdapterRuntime.res +39 -0
- package/src/util/Util_AdapterRuntime.res.mjs +42 -0
- package/src/util/Util_Array.res +2 -0
- package/src/util/Util_Array.res.mjs +12 -0
- package/src/util/Util_Error.res +16 -0
- package/src/util/Util_Error.res.mjs +19 -0
- package/src/util/Util_Promise.res +67 -0
- package/src/util/Util_Promise.res.mjs +105 -0
- package/src/util/Util_Pulumi.res +35 -0
- package/src/util/Util_Pulumi.res.mjs +55 -0
- package/src/util/Util_Pulumi.resi +21 -0
- package/src/util/Util_QueryDb.res +14 -0
- package/src/util/Util_QueryDb.res.mjs +21 -0
- package/src/util/Util_QueryDbRuntime.res +11 -0
- package/src/util/Util_QueryDbRuntime.res.mjs +19 -0
- package/src/util/Util_ReadModel.res +2 -0
- package/src/util/Util_ReadModel.res.mjs +10 -0
- package/src/util/Util_StackRefs.res +24 -0
- package/src/util/Util_StackRefs.res.mjs +39 -0
- package/src/util/Validation.res +75 -0
- package/src/util/Validation.res.mjs +181 -0
- package/tests/.gitkeep +0 -0
- package/tests/IdentityTest.res +155 -0
- package/tests/IdentityTest.res.mjs +174 -0
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res +237 -0
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +298 -0
- package/tests/admin/Platform_UIFragmentsApiTest.res +96 -0
- package/tests/admin/Platform_UIFragmentsApiTest.res.mjs +101 -0
- package/tests/aggregate/AggregateCallbackTest.res +81 -0
- package/tests/aggregate/AggregateCallbackTest.res.mjs +140 -0
- package/tests/aggregate/AggregateCausationTest.res +49 -0
- package/tests/aggregate/AggregateCausationTest.res.mjs +44 -0
- package/tests/aggregate/AggregateConflictTest.res +212 -0
- package/tests/aggregate/AggregateConflictTest.res.mjs +363 -0
- package/tests/aggregate/AggregateFixtures.res +177 -0
- package/tests/aggregate/AggregateFixtures.res.mjs +285 -0
- package/tests/aggregate/AggregateRejectionTest.res +139 -0
- package/tests/aggregate/AggregateRejectionTest.res.mjs +163 -0
- package/tests/api/ApiNoApiTest.res +62 -0
- package/tests/api/ApiNoApiTest.res.mjs +90 -0
- package/tests/api/GraphQL_StitcherTest.res +107 -0
- package/tests/api/GraphQL_StitcherTest.res.mjs +99 -0
- package/tests/api/SimpleTest.res +7 -0
- package/tests/api/SimpleTest.res.mjs +10 -0
- package/tests/api/SuryToJsonSchemaTest.res +405 -0
- package/tests/api/SuryToJsonSchemaTest.res.mjs +623 -0
- package/tests/commandgenerator/CommandGeneratorCallbackTest.res +128 -0
- package/tests/commandgenerator/CommandGeneratorCallbackTest.res.mjs +160 -0
- package/tests/commandgenerator/CommandGeneratorFixtures.res +139 -0
- package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +197 -0
- package/tests/commandtopic/CommandTopicCallbackFixtures.res +87 -0
- package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +152 -0
- package/tests/commandtopic/CommandTopicCallbackTest.res +66 -0
- package/tests/commandtopic/CommandTopicCallbackTest.res.mjs +106 -0
- package/tests/commandtopic/CommandTopicHelpersRejectionTest.res +83 -0
- package/tests/commandtopic/CommandTopicHelpersRejectionTest.res.mjs +109 -0
- package/tests/counter/CounterCallbackTest.res +83 -0
- package/tests/counter/CounterCallbackTest.res.mjs +140 -0
- package/tests/counter/CounterFixtures.res +57 -0
- package/tests/counter/CounterFixtures.res.mjs +67 -0
- package/tests/dcb/DcbDecodeTest.res +122 -0
- package/tests/dcb/DcbDecodeTest.res.mjs +194 -0
- package/tests/dcb/DcbEventLogOperationsTest.res +195 -0
- package/tests/dcb/DcbEventLogOperationsTest.res.mjs +268 -0
- package/tests/dcb/DcbFixtures.res +422 -0
- package/tests/dcb/DcbFixtures.res.mjs +534 -0
- package/tests/dcb/DcbScopeInferenceTest.res +242 -0
- package/tests/dcb/DcbScopeInferenceTest.res.mjs +480 -0
- package/tests/dcb/DcbStateChangeSliceTest.res +362 -0
- package/tests/dcb/DcbStateChangeSliceTest.res.mjs +546 -0
- package/tests/dcb/DcbTagTest.res +978 -0
- package/tests/dcb/DcbTagTest.res.mjs +867 -0
- package/tests/dcb/DcbValidationTest.res +349 -0
- package/tests/dcb/DcbValidationTest.res.mjs +476 -0
- package/tests/eventlog/EventLogFixtures.res +113 -0
- package/tests/eventlog/EventLogFixtures.res.mjs +166 -0
- package/tests/eventlog/EventLogOperationsTest.res +96 -0
- package/tests/eventlog/EventLogOperationsTest.res.mjs +192 -0
- package/tests/eventlog/EventLogRetryTest.res +121 -0
- package/tests/eventlog/EventLogRetryTest.res.mjs +171 -0
- package/tests/eventmapper/EventMapperCallbackTest.res +134 -0
- package/tests/eventmapper/EventMapperCallbackTest.res.mjs +141 -0
- package/tests/eventmapper/EventMapperFixtures.res +255 -0
- package/tests/eventmapper/EventMapperFixtures.res.mjs +440 -0
- package/tests/eventmapper/EventMapperTest.res +53 -0
- package/tests/eventmapper/EventMapperTest.res.mjs +83 -0
- package/tests/eventtopic/EventTopicFixtures.res +36 -0
- package/tests/eventtopic/EventTopicFixtures.res.mjs +65 -0
- package/tests/eventtopic/EventTopicOperationsTest.res +48 -0
- package/tests/eventtopic/EventTopicOperationsTest.res.mjs +71 -0
- package/tests/extensionpoint/ExtensionPointCallbackTest.res +84 -0
- package/tests/extensionpoint/ExtensionPointCallbackTest.res.mjs +94 -0
- package/tests/extensionpoint/ExtensionPointFixtures.res +173 -0
- package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +205 -0
- package/tests/extensionpoint/ExtensionPointOperationsTest.res +261 -0
- package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +304 -0
- package/tests/ftp/FTPTest.res +64 -0
- package/tests/ftp/FTPTest.res.mjs +88 -0
- package/tests/logger/LogFormatTest.res +348 -0
- package/tests/logger/LogFormatTest.res.mjs +309 -0
- package/tests/message/MessageTest.res +95 -0
- package/tests/message/MessageTest.res.mjs +93 -0
- package/tests/message/MetaEnvelopeTest.res +200 -0
- package/tests/message/MetaEnvelopeTest.res.mjs +188 -0
- package/tests/plugin/ManifestVisibilityTest.res +137 -0
- package/tests/plugin/ManifestVisibilityTest.res.mjs +205 -0
- package/tests/plugin/PluginSpecExperiment.res +13 -0
- package/tests/plugin/PluginSpecExperiment.res.mjs +31 -0
- package/tests/plugin/PluginStructureTest.res +298 -0
- package/tests/plugin/PluginStructureTest.res.mjs +388 -0
- package/tests/plugin/PluginVersionTest.res +34 -0
- package/tests/plugin/PluginVersionTest.res.mjs +30 -0
- package/tests/plugin/SchemaWalkerTest.res +115 -0
- package/tests/plugin/SchemaWalkerTest.res.mjs +160 -0
- package/tests/plugin/StateChangeSlice/PsPlaceOrder.res +24 -0
- package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +62 -0
- package/tests/plugin/StateChangeSlice/PsShipOrder.res +29 -0
- package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +69 -0
- package/tests/plugin/StateViewSlice/PsAnnotatedView.res +24 -0
- package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +94 -0
- package/tests/plugin/StateViewSlice/PsAvailableProductsView.res +18 -0
- package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +69 -0
- package/tests/plugin/StateViewSlice/PsCustomersView.res +22 -0
- package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +69 -0
- package/tests/plugin/StateViewSlice/PsOrdersView.res +20 -0
- package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +81 -0
- package/tests/poc/StructuralSubtypingPoc.res +211 -0
- package/tests/poc/StructuralSubtypingPoc.res.mjs +61 -0
- package/tests/querydb/QueryDbFixtures.res +65 -0
- package/tests/querydb/QueryDbFixtures.res.mjs +135 -0
- package/tests/querydb/QueryDbOperationsTest.res +94 -0
- package/tests/querydb/QueryDbOperationsTest.res.mjs +168 -0
- package/tests/sideeffecthandler/SideEffectHandlerCallbackTest.res +56 -0
- package/tests/sideeffecthandler/SideEffectHandlerCallbackTest.res.mjs +77 -0
- package/tests/sideeffecthandler/SideEffectHandlerFixtures.res +96 -0
- package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +139 -0
- package/tests/util/CsvStreamTest.res +54 -0
- package/tests/util/CsvStreamTest.res.mjs +51 -0
- package/tests/util/LruTest.res +73 -0
- package/tests/util/LruTest.res.mjs +105 -0
- package/tests/util/MetricsTest.res +36 -0
- package/tests/util/MetricsTest.res.mjs +53 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module Make = (
|
|
2
|
+
RuntimeEnvironment: Runtime.Environment,
|
|
3
|
+
CommandTopicChannel: CommandTopic_Adapter.Channel
|
|
4
|
+
with type runtimeParts = RuntimeEnvironment.parts,
|
|
5
|
+
EventCollectorChannel: EventCollector_Adapter.Channel
|
|
6
|
+
with type runtimeParts = RuntimeEnvironment.parts,
|
|
7
|
+
): (
|
|
8
|
+
AggregateRuntime_Builder.T
|
|
9
|
+
with type context = RuntimeEnvironment.context
|
|
10
|
+
and type runtimeParts = RuntimeEnvironment.parts
|
|
11
|
+
and module CommandTopicChannel = CommandTopicChannel
|
|
12
|
+
and module EventCollectorChannel = EventCollectorChannel
|
|
13
|
+
) => {
|
|
14
|
+
include AggregateRuntime_Builder_Common.Make(
|
|
15
|
+
RuntimeEnvironment,
|
|
16
|
+
CommandTopicChannel,
|
|
17
|
+
EventCollectorChannel,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
let finished = ref(false)
|
|
21
|
+
|
|
22
|
+
let finish = () =>
|
|
23
|
+
if !finished.contents {
|
|
24
|
+
let _ =
|
|
25
|
+
runtimeSpecs
|
|
26
|
+
->Dict.toArray
|
|
27
|
+
->Array.map(((
|
|
28
|
+
aggregateName,
|
|
29
|
+
{aggregate, connects, eventCollectorChannelSpec, memorySize, timeout},
|
|
30
|
+
)) => {
|
|
31
|
+
let opts = {Pulumi.ComponentResource.parent: aggregate}
|
|
32
|
+
let runtime = RuntimeEnvironment.make(
|
|
33
|
+
~name=aggregateName->ComponentType.name(Aggregate.componentType),
|
|
34
|
+
~handler=aggregateHandler(aggregateName)->Pulumi.Output.make,
|
|
35
|
+
~memorySize,
|
|
36
|
+
~timeout,
|
|
37
|
+
~opts,
|
|
38
|
+
)
|
|
39
|
+
connects->Array.forEach(connect => connect(~runtime))
|
|
40
|
+
let _connectResources =
|
|
41
|
+
eventCollectorChannelSpec->Option.map(channelSpec =>
|
|
42
|
+
EventCollectorChannel.connect(
|
|
43
|
+
~name="AllReadModels",
|
|
44
|
+
~channelSpecs=[channelSpec],
|
|
45
|
+
~runtime,
|
|
46
|
+
~opts,
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
})
|
|
50
|
+
finished := true
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
5
|
+
import * as Aggregate$ReventlessCore from "../../components/Aggregate/Aggregate.res.mjs";
|
|
6
|
+
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
7
|
+
import * as AggregateRuntime_Builder_Common$ReventlessCore from "./AggregateRuntime_Builder_Common.res.mjs";
|
|
8
|
+
|
|
9
|
+
function Make(RuntimeEnvironment) {
|
|
10
|
+
return CommandTopicChannel => (EventCollectorChannel => {
|
|
11
|
+
let include = AggregateRuntime_Builder_Common$ReventlessCore.Make(RuntimeEnvironment)(CommandTopicChannel)(EventCollectorChannel);
|
|
12
|
+
let EventCollectorChannel$1 = include.EventCollectorChannel;
|
|
13
|
+
let runtimeSpecs = include.runtimeSpecs;
|
|
14
|
+
let aggregateHandler = include.aggregateHandler;
|
|
15
|
+
let finished = {
|
|
16
|
+
contents: false
|
|
17
|
+
};
|
|
18
|
+
let finish = () => {
|
|
19
|
+
if (!finished.contents) {
|
|
20
|
+
Object.entries(runtimeSpecs).map(param => {
|
|
21
|
+
let match = param[1];
|
|
22
|
+
let aggregateName = param[0];
|
|
23
|
+
let opts_parent = match.aggregate;
|
|
24
|
+
let opts = {
|
|
25
|
+
parent: opts_parent
|
|
26
|
+
};
|
|
27
|
+
let runtime = RuntimeEnvironment.make(ComponentType$ReventlessCore.name(aggregateName, Aggregate$ReventlessCore.componentType), Pulumi.output(aggregateHandler(aggregateName)), match.memorySize, match.timeout, opts);
|
|
28
|
+
match.connects.forEach(connect => connect(runtime));
|
|
29
|
+
Stdlib_Option.map(match.eventCollectorChannelSpec, channelSpec => EventCollectorChannel$1.connect("AllReadModels", [channelSpec], runtime, opts));
|
|
30
|
+
});
|
|
31
|
+
finished.contents = true;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
CommandTopicChannel: include.CommandTopicChannel,
|
|
37
|
+
EventCollectorChannel: EventCollectorChannel$1,
|
|
38
|
+
forCommandGenerator: include.forCommandGenerator,
|
|
39
|
+
forCommandTopic: include.forCommandTopic,
|
|
40
|
+
forEventCollector: include.forEventCollector,
|
|
41
|
+
finish: finish
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
Make,
|
|
48
|
+
}
|
|
49
|
+
/* @pulumi/pulumi Not a pure module */
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
module Make = (
|
|
2
|
+
RuntimeEnvironment: Runtime.Environment,
|
|
3
|
+
CommandTopicChannel: CommandTopic_Adapter.Channel
|
|
4
|
+
with type runtimeParts = RuntimeEnvironment.parts,
|
|
5
|
+
EventCollectorChannel: EventCollector_Adapter.Channel
|
|
6
|
+
with type runtimeParts = RuntimeEnvironment.parts,
|
|
7
|
+
): (
|
|
8
|
+
AggregateRuntime_Builder.T
|
|
9
|
+
with type context = RuntimeEnvironment.context
|
|
10
|
+
and type runtimeParts = RuntimeEnvironment.parts
|
|
11
|
+
and module CommandTopicChannel = CommandTopicChannel
|
|
12
|
+
and module EventCollectorChannel = EventCollectorChannel
|
|
13
|
+
) => {
|
|
14
|
+
include AggregateRuntime_Builder_Common.Make(
|
|
15
|
+
RuntimeEnvironment,
|
|
16
|
+
CommandTopicChannel,
|
|
17
|
+
EventCollectorChannel,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
let finished = ref(false)
|
|
21
|
+
|
|
22
|
+
let finish = () =>
|
|
23
|
+
if !finished.contents {
|
|
24
|
+
let specs = runtimeSpecs->Dict.valuesToArray
|
|
25
|
+
let (parent, memorySize, timeout) = specs->Array.reduce((None, 0, 0), (
|
|
26
|
+
(_, accMemorySize, accTimeout),
|
|
27
|
+
{aggregate, memorySize, timeout},
|
|
28
|
+
) => {
|
|
29
|
+
(
|
|
30
|
+
aggregate.parent,
|
|
31
|
+
Math.Int.max(accMemorySize, memorySize),
|
|
32
|
+
Math.Int.max(accTimeout, timeout),
|
|
33
|
+
)
|
|
34
|
+
})
|
|
35
|
+
switch parent {
|
|
36
|
+
| Some(parent) =>
|
|
37
|
+
let opts = {Pulumi.ComponentResource.parent: parent}
|
|
38
|
+
let runtime = RuntimeEnvironment.make(
|
|
39
|
+
~name="AllAggregatesCmdHandler",
|
|
40
|
+
~handler=aggregateHandler("AllAggregatesCmdHandler")->Pulumi.Output.make,
|
|
41
|
+
~memorySize,
|
|
42
|
+
~timeout,
|
|
43
|
+
~opts,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
let _ = specs->Array.map(({connects}) => {
|
|
47
|
+
connects->Array.forEach(connect => connect(~runtime))
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
let channelSpecs =
|
|
51
|
+
specs
|
|
52
|
+
->Array.map(({eventCollectorChannelSpec}) => eventCollectorChannelSpec)
|
|
53
|
+
->Array.keepSome
|
|
54
|
+
let _connectResources = EventCollectorChannel.connect(
|
|
55
|
+
~name="AllAggregates",
|
|
56
|
+
~channelSpecs,
|
|
57
|
+
~runtime,
|
|
58
|
+
~opts,
|
|
59
|
+
)
|
|
60
|
+
| None => ()
|
|
61
|
+
}
|
|
62
|
+
finished := true
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
4
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
5
|
+
import * as AggregateRuntime_Builder_Common$ReventlessCore from "./AggregateRuntime_Builder_Common.res.mjs";
|
|
6
|
+
|
|
7
|
+
function Make(RuntimeEnvironment) {
|
|
8
|
+
return CommandTopicChannel => (EventCollectorChannel => {
|
|
9
|
+
let include = AggregateRuntime_Builder_Common$ReventlessCore.Make(RuntimeEnvironment)(CommandTopicChannel)(EventCollectorChannel);
|
|
10
|
+
let EventCollectorChannel$1 = include.EventCollectorChannel;
|
|
11
|
+
let runtimeSpecs = include.runtimeSpecs;
|
|
12
|
+
let aggregateHandler = include.aggregateHandler;
|
|
13
|
+
let finished = {
|
|
14
|
+
contents: false
|
|
15
|
+
};
|
|
16
|
+
let finish = () => {
|
|
17
|
+
if (finished.contents) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
let specs = Object.values(runtimeSpecs);
|
|
21
|
+
let match = Stdlib_Array.reduce(specs, [
|
|
22
|
+
undefined,
|
|
23
|
+
0,
|
|
24
|
+
0
|
|
25
|
+
], (param, param$1) => [
|
|
26
|
+
param$1.aggregate.__parentResource,
|
|
27
|
+
Math.max(param[1], param$1.memorySize),
|
|
28
|
+
Math.max(param[2], param$1.timeout)
|
|
29
|
+
]);
|
|
30
|
+
let parent = match[0];
|
|
31
|
+
if (parent !== undefined) {
|
|
32
|
+
let opts_parent = parent;
|
|
33
|
+
let opts = {
|
|
34
|
+
parent: opts_parent
|
|
35
|
+
};
|
|
36
|
+
let runtime = RuntimeEnvironment.make("AllAggregatesCmdHandler", Pulumi.output(aggregateHandler("AllAggregatesCmdHandler")), match[1], match[2], opts);
|
|
37
|
+
specs.map(param => {
|
|
38
|
+
param.connects.forEach(connect => connect(runtime));
|
|
39
|
+
});
|
|
40
|
+
let channelSpecs = Stdlib_Array.keepSome(specs.map(param => param.eventCollectorChannelSpec));
|
|
41
|
+
EventCollectorChannel$1.connect("AllAggregates", channelSpecs, runtime, opts);
|
|
42
|
+
}
|
|
43
|
+
finished.contents = true;
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
CommandTopicChannel: include.CommandTopicChannel,
|
|
47
|
+
EventCollectorChannel: EventCollectorChannel$1,
|
|
48
|
+
forCommandGenerator: include.forCommandGenerator,
|
|
49
|
+
forCommandTopic: include.forCommandTopic,
|
|
50
|
+
forEventCollector: include.forEventCollector,
|
|
51
|
+
finish: finish
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
Make,
|
|
58
|
+
}
|
|
59
|
+
/* @pulumi/pulumi Not a pure module */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module type T = {
|
|
2
|
+
type context
|
|
3
|
+
type runtimeParts
|
|
4
|
+
module EventCollectorChannel: EventCollector_Adapter.Channel
|
|
5
|
+
|
|
6
|
+
let forEventCollector: Runtime.forEventCollector<
|
|
7
|
+
Runtime.effectHandler<EventCollectorChannel.callbackEvent, context, unit, string>,
|
|
8
|
+
EventCollector.component,
|
|
9
|
+
>
|
|
10
|
+
let finish: unit => unit
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
module Make = (
|
|
2
|
+
RuntimeEnvironment: Runtime.Environment,
|
|
3
|
+
EventCollectorChannel: EventCollector_Adapter.Channel
|
|
4
|
+
with type runtimeParts = RuntimeEnvironment.parts,
|
|
5
|
+
): (
|
|
6
|
+
EventCollectorRuntime_Builder.T
|
|
7
|
+
with type context = RuntimeEnvironment.context
|
|
8
|
+
and type runtimeParts = RuntimeEnvironment.parts
|
|
9
|
+
and module EventCollectorChannel = EventCollectorChannel
|
|
10
|
+
) => {
|
|
11
|
+
type context = RuntimeEnvironment.context
|
|
12
|
+
type runtimeParts = RuntimeEnvironment.parts
|
|
13
|
+
module EventCollectorChannel = EventCollectorChannel
|
|
14
|
+
|
|
15
|
+
let forEventCollector = (
|
|
16
|
+
~handler,
|
|
17
|
+
~eventTopics: EventTopic.allOutputs,
|
|
18
|
+
~resources: array<ReventlessInfra.Adapter.resource>,
|
|
19
|
+
~memorySize=1024,
|
|
20
|
+
~timeout=30,
|
|
21
|
+
eventCollector,
|
|
22
|
+
) => {
|
|
23
|
+
let resource = eventCollector->Component.toPulumiResource
|
|
24
|
+
let name = resource.name->ComponentType.nameOpt(EventCollector.componentType)
|
|
25
|
+
let opts = {Pulumi.ComponentResource.parent: resource}
|
|
26
|
+
let runtime = RuntimeEnvironment.make(
|
|
27
|
+
~name,
|
|
28
|
+
~handler=handler->Pulumi.Output.apply(handler =>
|
|
29
|
+
handler->RuntimeEnvironment.asEffectHandler->Runtime.runEffectHandler
|
|
30
|
+
),
|
|
31
|
+
~memorySize,
|
|
32
|
+
~timeout,
|
|
33
|
+
~opts={Pulumi.ComponentResource.parent: resource},
|
|
34
|
+
)
|
|
35
|
+
let _connectResources = EventCollectorChannel.connect(
|
|
36
|
+
~name,
|
|
37
|
+
~channelSpecs=[
|
|
38
|
+
{channel: eventCollector->EventCollector_Adapter.channel, eventTopics, resources},
|
|
39
|
+
],
|
|
40
|
+
~runtime,
|
|
41
|
+
~opts,
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let finish = () => ()
|
|
46
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Runtime$ReventlessCore from "./Runtime.res.mjs";
|
|
4
|
+
import * as Component$ReventlessCore from "../../components/Component.res.mjs";
|
|
5
|
+
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
6
|
+
import * as EventCollector$ReventlessCore from "../../components/EventCollector/EventCollector.res.mjs";
|
|
7
|
+
|
|
8
|
+
function Make(RuntimeEnvironment) {
|
|
9
|
+
return EventCollectorChannel => {
|
|
10
|
+
let forEventCollector = (handler, eventTopics, resources, memorySizeOpt, timeoutOpt, eventCollector) => {
|
|
11
|
+
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
12
|
+
let timeout = timeoutOpt !== undefined ? timeoutOpt : 30;
|
|
13
|
+
let resource = Component$ReventlessCore.toPulumiResource(eventCollector);
|
|
14
|
+
let name = ComponentType$ReventlessCore.nameOpt(resource.__name, EventCollector$ReventlessCore.componentType);
|
|
15
|
+
let opts_parent = resource;
|
|
16
|
+
let opts = {
|
|
17
|
+
parent: opts_parent
|
|
18
|
+
};
|
|
19
|
+
let runtime = RuntimeEnvironment.make(name, handler.apply(handler => Runtime$ReventlessCore.runEffectHandler(RuntimeEnvironment.asEffectHandler(handler))), memorySize, timeout, {
|
|
20
|
+
parent: resource
|
|
21
|
+
});
|
|
22
|
+
EventCollectorChannel.connect(name, [{
|
|
23
|
+
channel: eventCollector.channel,
|
|
24
|
+
eventTopics: eventTopics,
|
|
25
|
+
resources: resources
|
|
26
|
+
}], runtime, opts);
|
|
27
|
+
};
|
|
28
|
+
let finish = () => {};
|
|
29
|
+
return {
|
|
30
|
+
EventCollectorChannel: EventCollectorChannel,
|
|
31
|
+
forEventCollector: forEventCollector,
|
|
32
|
+
finish: finish
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
Make,
|
|
39
|
+
}
|
|
40
|
+
/* Runtime-ReventlessCore Not a pure module */
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
module Make = (
|
|
2
|
+
RuntimeEnvironment: Runtime.Environment,
|
|
3
|
+
EventCollectorChannel: EventCollector_Adapter.Channel
|
|
4
|
+
with type runtimeParts = RuntimeEnvironment.parts,
|
|
5
|
+
): (
|
|
6
|
+
EventCollectorRuntime_Builder.T
|
|
7
|
+
with type context = RuntimeEnvironment.context
|
|
8
|
+
and type runtimeParts = RuntimeEnvironment.parts
|
|
9
|
+
and module EventCollectorChannel = EventCollectorChannel
|
|
10
|
+
) => {
|
|
11
|
+
type context = RuntimeEnvironment.context
|
|
12
|
+
type runtimeParts = RuntimeEnvironment.parts
|
|
13
|
+
module EventCollectorChannel = EventCollectorChannel
|
|
14
|
+
|
|
15
|
+
type runtimeSpec = {
|
|
16
|
+
channelSpecs: array<
|
|
17
|
+
EventCollector_Adapter.channelSpec<
|
|
18
|
+
EventCollectorChannel.callbackEvent,
|
|
19
|
+
context,
|
|
20
|
+
EventCollectorChannel.channelParts,
|
|
21
|
+
>,
|
|
22
|
+
>,
|
|
23
|
+
maxMemorySize: int,
|
|
24
|
+
maxTimeout: int,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let log = Logger.fromEnv()
|
|
28
|
+
let grandParent = ref(None)
|
|
29
|
+
let parentType = ref(None)
|
|
30
|
+
|
|
31
|
+
let runtimeSpec = ref({
|
|
32
|
+
channelSpecs: [],
|
|
33
|
+
maxMemorySize: 0,
|
|
34
|
+
maxTimeout: 0,
|
|
35
|
+
})
|
|
36
|
+
type effectHandler = Runtime.effectHandler<RuntimeEnvironment.event, context, unit, string>
|
|
37
|
+
let eventCollectorHandlers: dict<array<effectHandler>> = Dict.make()
|
|
38
|
+
let runEffect = (~correlationId=?, effect) => {
|
|
39
|
+
let cid = correlationId->Option.getOr("unknown")
|
|
40
|
+
effect
|
|
41
|
+
// Annotate the request scope so every EffectLogger call inside the handler
|
|
42
|
+
// carries correlationId as a top-level JSON field (decoded in install()).
|
|
43
|
+
->Effect.annotateLogs("correlationId", cid)
|
|
44
|
+
->Effect.provideService(RequestContext.tag, RequestContext.test(~correlationId=cid))
|
|
45
|
+
->Effect.runPromise
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let eventCollectorHandler = parentName =>
|
|
49
|
+
async (event: RuntimeEnvironment.event, context) => {
|
|
50
|
+
let correlationId = event->RuntimeEnvironment.extractCorrelationId
|
|
51
|
+
let comp = `EventCollectorRuntime(${parentName})`
|
|
52
|
+
let _ = await event
|
|
53
|
+
->RuntimeEnvironment.groupBySource
|
|
54
|
+
->Dict.toArray
|
|
55
|
+
->Array.map(async ((urn, event)) => {
|
|
56
|
+
switch eventCollectorHandlers->Dict.get(urn) {
|
|
57
|
+
| Some(handlers) =>
|
|
58
|
+
let count = handlers->Array.length->Int.toString
|
|
59
|
+
EffectLogger.logDebug(
|
|
60
|
+
~comp,
|
|
61
|
+
`found ${count} handler(s) for ${urn}`,
|
|
62
|
+
)->Effect.runSync
|
|
63
|
+
let _ = await handlers
|
|
64
|
+
->Array.map(handler => runEffect(~correlationId?, handler(event, context)))
|
|
65
|
+
->Promise.all
|
|
66
|
+
| None => EffectLogger.logWarn(~comp, `no handler found: ${urn}`)->Effect.runSync
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
->Promise.all
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let validateParent = (parent: Pulumi.Resource.t) => {
|
|
73
|
+
let parentName = parent.name->Option.getOr("UnnamedParent")
|
|
74
|
+
// Set grandParent synchronously so finish() can create resources
|
|
75
|
+
// during the same build phase. Type validation defers to Output.apply.
|
|
76
|
+
if grandParent.contents == None {
|
|
77
|
+
grandParent := parent.parent
|
|
78
|
+
}
|
|
79
|
+
parent.urn->Pulumi.Output.apply(urn => {
|
|
80
|
+
let pulumiType =
|
|
81
|
+
(urn->String.split("::"))[2]
|
|
82
|
+
->Option.map(fullType => {
|
|
83
|
+
let parts = fullType->String.split(":")
|
|
84
|
+
parts->Array.getUnsafe(parts->Array.length - 1)
|
|
85
|
+
})
|
|
86
|
+
->Option.getOr("Unknown")
|
|
87
|
+
log.debug(~comp="EventCollectorRuntime", `validateParent: parent ${parentName} type: ${pulumiType}`)
|
|
88
|
+
switch (parentType.contents) {
|
|
89
|
+
| None =>
|
|
90
|
+
parentType := Some(pulumiType)
|
|
91
|
+
| Some(existingType) if existingType != pulumiType =>
|
|
92
|
+
JsError.throwWithMessage(
|
|
93
|
+
`registerRuntimeSpec: parent ${parentName} has different type ${pulumiType} than ${existingType}`,
|
|
94
|
+
)
|
|
95
|
+
| _ => ()
|
|
96
|
+
}
|
|
97
|
+
switch grandParent.contents {
|
|
98
|
+
| Some(grandParent) if Some(grandParent) != parent.parent =>
|
|
99
|
+
let grandParentName = grandParent.name->Option.getOr("UnnamedGrandParent")
|
|
100
|
+
JsError.throwWithMessage(
|
|
101
|
+
`registerRuntimeSpec: parent ${parentName} has different parent than ${grandParentName}`,
|
|
102
|
+
)
|
|
103
|
+
| _ => ()
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
let registerRuntimeSpec = (
|
|
109
|
+
~channel,
|
|
110
|
+
~eventTopics,
|
|
111
|
+
~resources,
|
|
112
|
+
~memorySize,
|
|
113
|
+
~timeout,
|
|
114
|
+
parent: Pulumi.Resource.t,
|
|
115
|
+
) => {
|
|
116
|
+
parent
|
|
117
|
+
->validateParent
|
|
118
|
+
->Pulumi.Output.apply(_ => {
|
|
119
|
+
let {channelSpecs, maxMemorySize, maxTimeout} = runtimeSpec.contents
|
|
120
|
+
runtimeSpec := {
|
|
121
|
+
channelSpecs: channelSpecs->Array.concat([{channel, eventTopics, resources}]),
|
|
122
|
+
maxMemorySize: Math.Int.max(maxMemorySize, memorySize),
|
|
123
|
+
maxTimeout: Math.Int.max(maxTimeout, timeout),
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let forEventCollector = (
|
|
129
|
+
~handler: Pulumi.Output.t<
|
|
130
|
+
Runtime.effectHandler<EventCollectorChannel.callbackEvent, context, unit, string>,
|
|
131
|
+
>,
|
|
132
|
+
~eventTopics: EventTopic.allOutputs,
|
|
133
|
+
~resources: array<ReventlessInfra.Adapter.resource>,
|
|
134
|
+
~memorySize=1024,
|
|
135
|
+
~timeout=30,
|
|
136
|
+
eventCollector: EventCollector.component,
|
|
137
|
+
) => {
|
|
138
|
+
let eventCollectorResource = eventCollector->Component.toPulumiResource
|
|
139
|
+
let eventCollectorName = eventCollectorResource.name->Option.getOr("Unnamed")
|
|
140
|
+
let channel = eventCollector->EventCollector_Adapter.channel
|
|
141
|
+
switch eventCollectorResource.parent {
|
|
142
|
+
| Some(parentResource) =>
|
|
143
|
+
let registered =
|
|
144
|
+
parentResource->registerRuntimeSpec(
|
|
145
|
+
~channel,
|
|
146
|
+
~eventTopics,
|
|
147
|
+
~resources,
|
|
148
|
+
~memorySize,
|
|
149
|
+
~timeout,
|
|
150
|
+
)
|
|
151
|
+
let urns =
|
|
152
|
+
(eventCollector->Component.outputs).resources
|
|
153
|
+
->Array.map(({urn}) => urn)
|
|
154
|
+
->Pulumi.Output.all
|
|
155
|
+
let _ =
|
|
156
|
+
(registered, urns, handler)
|
|
157
|
+
->Pulumi.Output.all3
|
|
158
|
+
->Pulumi.Output.apply(((_, urns, handler)) => {
|
|
159
|
+
log.debug(
|
|
160
|
+
~comp="EventCollectorRuntime",
|
|
161
|
+
`forEventCollector ${eventCollectorName}: set handler for ${urns->Array.join(", ")}`,
|
|
162
|
+
)
|
|
163
|
+
urns->Array.map(urn => {
|
|
164
|
+
let handlers = eventCollectorHandlers->Dict.get(urn)->Option.getOr([])
|
|
165
|
+
eventCollectorHandlers->Dict.set(
|
|
166
|
+
urn,
|
|
167
|
+
handlers->Array.concat([handler->RuntimeEnvironment.asEffectHandler]),
|
|
168
|
+
)
|
|
169
|
+
})
|
|
170
|
+
})
|
|
171
|
+
| None =>
|
|
172
|
+
JsError.throwWithMessage(
|
|
173
|
+
`forEventCollector: eventCollector ${eventCollectorName} has no parent`,
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
let finished = ref(false)
|
|
179
|
+
|
|
180
|
+
let finish = () =>
|
|
181
|
+
if !finished.contents {
|
|
182
|
+
switch grandParent.contents {
|
|
183
|
+
| Some(grandParent) =>
|
|
184
|
+
let name = `All${parentType.contents->Option.getOr("EventCollector")}s`
|
|
185
|
+
let {channelSpecs, maxMemorySize, maxTimeout} = runtimeSpec.contents
|
|
186
|
+
let runtime = RuntimeEnvironment.make(
|
|
187
|
+
~name,
|
|
188
|
+
~handler=eventCollectorHandler(name)->Pulumi.Output.make,
|
|
189
|
+
~memorySize=maxMemorySize,
|
|
190
|
+
~timeout=maxTimeout,
|
|
191
|
+
~opts={Pulumi.ComponentResource.parent: grandParent},
|
|
192
|
+
)
|
|
193
|
+
let opts = {Pulumi.ComponentResource.parent: grandParent}
|
|
194
|
+
|
|
195
|
+
let _connectResources = EventCollectorChannel.connect(~name, ~channelSpecs, ~runtime, ~opts)
|
|
196
|
+
| _ =>
|
|
197
|
+
// grandParent/parentType not set — either no handlers were registered
|
|
198
|
+
// (e.g. all StateViewSlices went through Bundled path) or Pulumi outputs
|
|
199
|
+
// haven't resolved yet. Skip silently.
|
|
200
|
+
()
|
|
201
|
+
}
|
|
202
|
+
finished := true
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
6
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
7
|
+
import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
|
|
8
|
+
import * as Logger$ReventlessCore from "../../util/Logger.res.mjs";
|
|
9
|
+
import * as Component$ReventlessCore from "../../components/Component.res.mjs";
|
|
10
|
+
import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
|
|
11
|
+
import * as RequestContext$ReventlessCore from "../../RequestContext.res.mjs";
|
|
12
|
+
|
|
13
|
+
function Make(RuntimeEnvironment) {
|
|
14
|
+
return EventCollectorChannel => {
|
|
15
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
16
|
+
let grandParent = {
|
|
17
|
+
contents: undefined
|
|
18
|
+
};
|
|
19
|
+
let parentType = {
|
|
20
|
+
contents: undefined
|
|
21
|
+
};
|
|
22
|
+
let runtimeSpec = {
|
|
23
|
+
contents: {
|
|
24
|
+
channelSpecs: [],
|
|
25
|
+
maxMemorySize: 0,
|
|
26
|
+
maxTimeout: 0
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
let eventCollectorHandlers = {};
|
|
30
|
+
let eventCollectorHandler = parentName => (async (event, context) => {
|
|
31
|
+
let correlationId = RuntimeEnvironment.extractCorrelationId(event);
|
|
32
|
+
let comp = `EventCollectorRuntime(` + parentName + `)`;
|
|
33
|
+
await Promise.all(Object.entries(RuntimeEnvironment.groupBySource(event)).map(async param => {
|
|
34
|
+
let event = param[1];
|
|
35
|
+
let urn = param[0];
|
|
36
|
+
let handlers = eventCollectorHandlers[urn];
|
|
37
|
+
if (handlers === undefined) {
|
|
38
|
+
return Effect.runSync(EffectLogger$ReventlessCore.logWarn(comp, undefined, `no handler found: ` + urn));
|
|
39
|
+
}
|
|
40
|
+
let count = handlers.length.toString();
|
|
41
|
+
Effect.runSync(EffectLogger$ReventlessCore.logDebug(comp, undefined, `found ` + count + ` handler(s) for ` + urn));
|
|
42
|
+
await Promise.all(handlers.map(handler => {
|
|
43
|
+
let effect = handler(event, context);
|
|
44
|
+
let cid = Stdlib_Option.getOr(correlationId, "unknown");
|
|
45
|
+
return Effect.runPromise(Effect.provideService(Effect.annotateLogs(effect, "correlationId", cid), RequestContext$ReventlessCore.tag, RequestContext$ReventlessCore.test(cid, undefined, undefined)));
|
|
46
|
+
}));
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
let validateParent = parent => {
|
|
50
|
+
let parentName = Stdlib_Option.getOr(parent.__name, "UnnamedParent");
|
|
51
|
+
if (grandParent.contents === undefined) {
|
|
52
|
+
grandParent.contents = parent.__parentResource;
|
|
53
|
+
}
|
|
54
|
+
return parent.urn.apply(urn => {
|
|
55
|
+
let pulumiType = Stdlib_Option.getOr(Stdlib_Option.map(urn.split("::")[2], fullType => {
|
|
56
|
+
let parts = fullType.split(":");
|
|
57
|
+
return parts[parts.length - 1 | 0];
|
|
58
|
+
}), "Unknown");
|
|
59
|
+
log.debug("EventCollectorRuntime", undefined, `validateParent: parent ` + parentName + ` type: ` + pulumiType);
|
|
60
|
+
let existingType = parentType.contents;
|
|
61
|
+
if (existingType !== undefined) {
|
|
62
|
+
if (existingType !== pulumiType) {
|
|
63
|
+
Stdlib_JsError.throwWithMessage(`registerRuntimeSpec: parent ` + parentName + ` has different type ` + pulumiType + ` than ` + existingType);
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
parentType.contents = pulumiType;
|
|
67
|
+
}
|
|
68
|
+
let grandParent$1 = grandParent.contents;
|
|
69
|
+
if (grandParent$1 === undefined) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (!Primitive_object.notequal(grandParent$1, parent.__parentResource)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
let grandParentName = Stdlib_Option.getOr(grandParent$1.__name, "UnnamedGrandParent");
|
|
76
|
+
Stdlib_JsError.throwWithMessage(`registerRuntimeSpec: parent ` + parentName + ` has different parent than ` + grandParentName);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
let registerRuntimeSpec = (channel, eventTopics, resources, memorySize, timeout, parent) => validateParent(parent).apply(() => {
|
|
80
|
+
let match = runtimeSpec.contents;
|
|
81
|
+
runtimeSpec.contents = {
|
|
82
|
+
channelSpecs: match.channelSpecs.concat([{
|
|
83
|
+
channel: channel,
|
|
84
|
+
eventTopics: eventTopics,
|
|
85
|
+
resources: resources
|
|
86
|
+
}]),
|
|
87
|
+
maxMemorySize: Math.max(match.maxMemorySize, memorySize),
|
|
88
|
+
maxTimeout: Math.max(match.maxTimeout, timeout)
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
let forEventCollector = (handler, eventTopics, resources, memorySizeOpt, timeoutOpt, eventCollector) => {
|
|
92
|
+
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
93
|
+
let timeout = timeoutOpt !== undefined ? timeoutOpt : 30;
|
|
94
|
+
let eventCollectorResource = Component$ReventlessCore.toPulumiResource(eventCollector);
|
|
95
|
+
let eventCollectorName = Stdlib_Option.getOr(eventCollectorResource.__name, "Unnamed");
|
|
96
|
+
let channel = eventCollector.channel;
|
|
97
|
+
let parentResource = eventCollectorResource.__parentResource;
|
|
98
|
+
if (parentResource === undefined) {
|
|
99
|
+
return Stdlib_JsError.throwWithMessage(`forEventCollector: eventCollector ` + eventCollectorName + ` has no parent`);
|
|
100
|
+
}
|
|
101
|
+
let registered = registerRuntimeSpec(channel, eventTopics, resources, memorySize, timeout, parentResource);
|
|
102
|
+
let urns = Pulumi.all(Component$ReventlessCore.outputs(eventCollector).resources.map(param => param.urn));
|
|
103
|
+
Pulumi.all([
|
|
104
|
+
registered,
|
|
105
|
+
urns,
|
|
106
|
+
handler
|
|
107
|
+
]).apply(param => {
|
|
108
|
+
let handler = param[2];
|
|
109
|
+
let urns = param[1];
|
|
110
|
+
log.debug("EventCollectorRuntime", undefined, `forEventCollector ` + eventCollectorName + `: set handler for ` + urns.join(", "));
|
|
111
|
+
return urns.map(urn => {
|
|
112
|
+
let handlers = Stdlib_Option.getOr(eventCollectorHandlers[urn], []);
|
|
113
|
+
eventCollectorHandlers[urn] = handlers.concat([RuntimeEnvironment.asEffectHandler(handler)]);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
let finished = {
|
|
118
|
+
contents: false
|
|
119
|
+
};
|
|
120
|
+
let finish = () => {
|
|
121
|
+
if (finished.contents) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
let grandParent$1 = grandParent.contents;
|
|
125
|
+
if (grandParent$1 !== undefined) {
|
|
126
|
+
let name = `All` + Stdlib_Option.getOr(parentType.contents, "EventCollector") + `s`;
|
|
127
|
+
let match = runtimeSpec.contents;
|
|
128
|
+
let runtime = RuntimeEnvironment.make(name, Pulumi.output(eventCollectorHandler(name)), match.maxMemorySize, match.maxTimeout, {
|
|
129
|
+
parent: grandParent$1
|
|
130
|
+
});
|
|
131
|
+
let opts_parent = grandParent$1;
|
|
132
|
+
let opts = {
|
|
133
|
+
parent: opts_parent
|
|
134
|
+
};
|
|
135
|
+
EventCollectorChannel.connect(name, match.channelSpecs, runtime, opts);
|
|
136
|
+
}
|
|
137
|
+
finished.contents = true;
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
EventCollectorChannel: EventCollectorChannel,
|
|
141
|
+
forEventCollector: forEventCollector,
|
|
142
|
+
finish: finish
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export {
|
|
148
|
+
Make,
|
|
149
|
+
}
|
|
150
|
+
/* effect/Effect Not a pure module */
|