@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,42 @@
|
|
|
1
|
+
// Provider-agnostic authentication adapter contract.
|
|
2
|
+
//
|
|
3
|
+
// `Provider` is implemented once per identity provider (in-memory headers,
|
|
4
|
+
// AWS Cognito, future Auth0/AzureAD/ApiKey…). The runtime path —
|
|
5
|
+
// `authenticate` — runs on every request and turns transport headers into
|
|
6
|
+
// an `Identity.authResult`. The deploy-time path — `make` — provisions
|
|
7
|
+
// whatever infrastructure the provider needs (a Cognito UserPool, a YAML
|
|
8
|
+
// store path, an API-key table, …) and returns a provider-specific
|
|
9
|
+
// `authConfig` for the rest of the platform stack to consume.
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
Minimal transport-agnostic envelope handed to `authenticate`. Both GraphQL
|
|
13
|
+
(graphql-yoga on the in-memory platform and AppSync resolver context on
|
|
14
|
+
AWS) and MCP Streamable HTTP requests collapse into this shape so a single
|
|
15
|
+
`Provider` implementation serves every entry point.
|
|
16
|
+
*/
|
|
17
|
+
type requestContext = {
|
|
18
|
+
headers: dict<string>,
|
|
19
|
+
sourceIp?: string,
|
|
20
|
+
correlationId?: string,
|
|
21
|
+
userAgent?: string,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module type Provider = {
|
|
25
|
+
/** Provider-specific deploy-time output (e.g. `{userPoolId, clientId}`
|
|
26
|
+
for Cognito, `{usersFilePath}` for in-memory). Consumed by the platform
|
|
27
|
+
stack to wire downstream resources such as the AppSync auth config. */
|
|
28
|
+
type authConfig
|
|
29
|
+
|
|
30
|
+
/** Read an identity (or anonymous / error) from a request. Pure
|
|
31
|
+
function from the provider's perspective: no side effects beyond
|
|
32
|
+
whatever HTTP fetches the provider issues (JWKS, etc.). */
|
|
33
|
+
let authenticate: requestContext => promise<Reventless.Identity.authResult>
|
|
34
|
+
|
|
35
|
+
/** Deploy-time: provision any infrastructure the provider depends on
|
|
36
|
+
and return its config. In-memory implementations return a constant
|
|
37
|
+
Output. */
|
|
38
|
+
let make: (
|
|
39
|
+
~name: string,
|
|
40
|
+
~opts: Pulumi.ComponentResource.options=?,
|
|
41
|
+
) => Pulumi.Output.t<authConfig>
|
|
42
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module type T = {
|
|
2
|
+
type context
|
|
3
|
+
type runtimeParts
|
|
4
|
+
module CommandTopicChannel: CommandTopic_Adapter.Channel
|
|
5
|
+
module EventCollectorChannel: EventCollector_Adapter.Channel
|
|
6
|
+
|
|
7
|
+
let forCommandGenerator: Runtime.forComponent<
|
|
8
|
+
CommandGenerator.effectEventHandler<context>,
|
|
9
|
+
runtimeParts,
|
|
10
|
+
CommandGenerator.component,
|
|
11
|
+
>
|
|
12
|
+
let forCommandTopic: Runtime.forComponent<
|
|
13
|
+
Runtime.effectHandler<CommandTopicChannel.callbackEvent, context, unit, string>,
|
|
14
|
+
runtimeParts,
|
|
15
|
+
CommandTopic.component<'op>,
|
|
16
|
+
>
|
|
17
|
+
let forEventCollector: Runtime.forEventCollector<
|
|
18
|
+
Runtime.effectHandler<EventCollectorChannel.callbackEvent, context, unit, string>,
|
|
19
|
+
EventCollector.component,
|
|
20
|
+
>
|
|
21
|
+
let finish: unit => unit
|
|
22
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
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
|
+
let log = Logger.fromEnv()
|
|
9
|
+
type context = RuntimeEnvironment.context
|
|
10
|
+
type runtimeParts = RuntimeEnvironment.parts
|
|
11
|
+
module CommandTopicChannel = CommandTopicChannel
|
|
12
|
+
module EventCollectorChannel = EventCollectorChannel
|
|
13
|
+
|
|
14
|
+
type runtimeSpec = {
|
|
15
|
+
aggregate: Pulumi.Resource.t,
|
|
16
|
+
connects: array<Runtime.connect<runtimeParts>>,
|
|
17
|
+
eventCollectorChannelSpec: option<
|
|
18
|
+
EventCollector_Adapter.channelSpec<
|
|
19
|
+
EventCollectorChannel.callbackEvent,
|
|
20
|
+
context,
|
|
21
|
+
EventCollectorChannel.channelParts,
|
|
22
|
+
>,
|
|
23
|
+
>,
|
|
24
|
+
memorySize: int,
|
|
25
|
+
timeout: int,
|
|
26
|
+
}
|
|
27
|
+
type effectHandler = Runtime.effectHandler<RuntimeEnvironment.event, context, unit, string>
|
|
28
|
+
|
|
29
|
+
let runtimeSpecs: dict<runtimeSpec> = Dict.make()
|
|
30
|
+
let commandGeneratorHandlers: dict<CommandGenerator.effectEventHandler<context>> = Dict.make()
|
|
31
|
+
let commandTopicHandlers: dict<effectHandler> = Dict.make()
|
|
32
|
+
let eventCollectorHandlers: dict<array<effectHandler>> = Dict.make()
|
|
33
|
+
|
|
34
|
+
let runEffect = (~correlationId=?, effect) => {
|
|
35
|
+
let cid = correlationId->Option.getOr("unknown")
|
|
36
|
+
effect
|
|
37
|
+
// Annotate the request scope so every EffectLogger call inside the handler
|
|
38
|
+
// carries correlationId as a top-level JSON field (decoded in install()).
|
|
39
|
+
->Effect.annotateLogs("correlationId", cid)
|
|
40
|
+
->Effect.provideService(RequestContext.tag, RequestContext.test(~correlationId=cid))
|
|
41
|
+
->Effect.runPromise
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let aggregateHandler = aggregateName =>
|
|
45
|
+
async (event: RuntimeEnvironment.event, context) => {
|
|
46
|
+
let correlationId = event->RuntimeEnvironment.extractCorrelationId
|
|
47
|
+
let comp = `AggregateRuntime(${aggregateName})`
|
|
48
|
+
switch event->CommandGenerator.metaInfo {
|
|
49
|
+
| Some(info) =>
|
|
50
|
+
switch commandGeneratorHandlers->Dict.get(info) {
|
|
51
|
+
| Some(handler) =>
|
|
52
|
+
EffectLogger.logDebug(~comp, `found CommandGenerator handler for ${info}`)->Effect.runSync
|
|
53
|
+
let _ = await runEffect(~correlationId?, handler(event->CommandGenerator.asPayload, context))
|
|
54
|
+
| None =>
|
|
55
|
+
let available = commandGeneratorHandlers->Dict.keysToArray->Array.join(",")
|
|
56
|
+
EffectLogger.logWarn(
|
|
57
|
+
~comp,
|
|
58
|
+
`no handler found: ${info} available=[${available}]`,
|
|
59
|
+
)->Effect.runSync
|
|
60
|
+
}
|
|
61
|
+
| _ =>
|
|
62
|
+
let _ = await event
|
|
63
|
+
->RuntimeEnvironment.groupBySource
|
|
64
|
+
->Dict.toArray
|
|
65
|
+
->Array.map(async ((urn, event)) => {
|
|
66
|
+
switch commandTopicHandlers->Dict.get(urn) {
|
|
67
|
+
| Some(handler) =>
|
|
68
|
+
EffectLogger.logDebug(~comp, `found CommandTopic handler for ${urn}`)->Effect.runSync
|
|
69
|
+
await runEffect(~correlationId?, handler(event, context))
|
|
70
|
+
| None =>
|
|
71
|
+
switch eventCollectorHandlers->Dict.get(urn) {
|
|
72
|
+
| Some(handlers) =>
|
|
73
|
+
let count = handlers->Array.length->Int.toString
|
|
74
|
+
EffectLogger.logDebug(
|
|
75
|
+
~comp,
|
|
76
|
+
`found ${count} EventCollector handler(s) for ${urn}`,
|
|
77
|
+
)->Effect.runSync
|
|
78
|
+
let _ = await handlers
|
|
79
|
+
->Array.map(handler => runEffect(~correlationId?, handler(event, context)))
|
|
80
|
+
->Promise.all
|
|
81
|
+
| None =>
|
|
82
|
+
let available =
|
|
83
|
+
Array.concat(
|
|
84
|
+
commandTopicHandlers->Dict.keysToArray,
|
|
85
|
+
eventCollectorHandlers->Dict.keysToArray,
|
|
86
|
+
)->Array.join(",")
|
|
87
|
+
EffectLogger.logWarn(
|
|
88
|
+
~comp,
|
|
89
|
+
`no handler found: ${urn} available=[${available}]`,
|
|
90
|
+
)->Effect.runSync
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
->Promise.all
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
let getRuntimeSpec = (aggregate: Pulumi.Resource.t) =>
|
|
99
|
+
runtimeSpecs
|
|
100
|
+
->Dict.get(aggregate.name->Option.getOr("Unnamed"))
|
|
101
|
+
->Option.getOr({
|
|
102
|
+
aggregate,
|
|
103
|
+
connects: [],
|
|
104
|
+
eventCollectorChannelSpec: None,
|
|
105
|
+
memorySize: 0,
|
|
106
|
+
timeout: 0,
|
|
107
|
+
})
|
|
108
|
+
let setRuntimeSpec = (aggregate: Pulumi.Resource.t, runtimeSpec) =>
|
|
109
|
+
runtimeSpecs->Dict.set(aggregate.name->Option.getOr("Unnamed"), runtimeSpec)
|
|
110
|
+
|
|
111
|
+
let registerRuntimeSpec = (~connect, ~memorySize, ~timeout, aggregate: Pulumi.Resource.t) => {
|
|
112
|
+
let spec = aggregate->getRuntimeSpec
|
|
113
|
+
aggregate->setRuntimeSpec({
|
|
114
|
+
...spec,
|
|
115
|
+
connects: spec.connects->Array.concat([connect]),
|
|
116
|
+
memorySize: Math.Int.max(spec.memorySize, memorySize),
|
|
117
|
+
timeout: Math.Int.max(spec.timeout, timeout),
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let registerEventCollectorRuntimeSpec = (
|
|
122
|
+
~channel,
|
|
123
|
+
~eventTopics,
|
|
124
|
+
~resources,
|
|
125
|
+
~memorySize,
|
|
126
|
+
~timeout,
|
|
127
|
+
aggregate: Pulumi.Resource.t,
|
|
128
|
+
) => {
|
|
129
|
+
let spec = aggregate->getRuntimeSpec
|
|
130
|
+
aggregate->setRuntimeSpec({
|
|
131
|
+
...spec,
|
|
132
|
+
eventCollectorChannelSpec: Some({
|
|
133
|
+
channel,
|
|
134
|
+
eventTopics,
|
|
135
|
+
resources,
|
|
136
|
+
}),
|
|
137
|
+
memorySize: Math.Int.max(spec.memorySize, memorySize),
|
|
138
|
+
timeout: Math.Int.max(spec.timeout, timeout),
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
let forCommandGenerator = (
|
|
143
|
+
~handler: Pulumi.Output.t<CommandGenerator.effectEventHandler<context>>,
|
|
144
|
+
~connect,
|
|
145
|
+
~memorySize=1024,
|
|
146
|
+
~timeout=30,
|
|
147
|
+
commandGenerator: CommandGenerator.component,
|
|
148
|
+
) => {
|
|
149
|
+
let commandGeneratorResource = commandGenerator->Component.toPulumiResource
|
|
150
|
+
let commandGeneratorName = commandGeneratorResource.name->Option.getOr("Unnamed")
|
|
151
|
+
switch commandGeneratorResource.parent {
|
|
152
|
+
| Some(aggregateResource) =>
|
|
153
|
+
aggregateResource->registerRuntimeSpec(~connect, ~memorySize, ~timeout)
|
|
154
|
+
let infos =
|
|
155
|
+
(commandGenerator->Component.outputs).resources
|
|
156
|
+
->Array.map(resource => resource.resourceInfo)
|
|
157
|
+
->Pulumi.Output.all
|
|
158
|
+
let _ =
|
|
159
|
+
(infos, handler)
|
|
160
|
+
->Pulumi.Output.all2
|
|
161
|
+
->Pulumi.Output.apply(((infos, handler)) => {
|
|
162
|
+
let infoStrs = infos->Array.filterMap(ri => switch ri {
|
|
163
|
+
| ReventlessInfra.Adapter.ApiResolver({typeName, fieldName}) => Some(`${typeName}.${fieldName}`)
|
|
164
|
+
| _ => None
|
|
165
|
+
})
|
|
166
|
+
log.debug(
|
|
167
|
+
~comp="AggregateRuntime",
|
|
168
|
+
`forCommandGenerator ${commandGeneratorName}: set handler for ${infoStrs->Array.join(", ")}`,
|
|
169
|
+
)
|
|
170
|
+
infoStrs->Array.map(info => commandGeneratorHandlers->Dict.set(info, handler))
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
| None =>
|
|
174
|
+
JsError.throwWithMessage(
|
|
175
|
+
`forCommandGenerator: commandGenerator ${commandGeneratorName} has no Aggregate parent`,
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let forCommandTopic = (
|
|
181
|
+
~handler: Pulumi.Output.t<
|
|
182
|
+
Runtime.effectHandler<CommandTopicChannel.callbackEvent, context, unit, string>,
|
|
183
|
+
>,
|
|
184
|
+
~connect,
|
|
185
|
+
~memorySize=1024,
|
|
186
|
+
~timeout=30,
|
|
187
|
+
commandTopic: CommandTopic.component<'op>,
|
|
188
|
+
) => {
|
|
189
|
+
let commandTopicResource = commandTopic->Component.toPulumiResource
|
|
190
|
+
let commandTopicName = commandTopicResource.name->Option.getOr("Unnamed")
|
|
191
|
+
switch commandTopicResource.parent {
|
|
192
|
+
| Some(aggregateResource) =>
|
|
193
|
+
aggregateResource->registerRuntimeSpec(~connect, ~memorySize, ~timeout)
|
|
194
|
+
let urn = ((commandTopic->Component.outputs).resources->Array.getUnsafe(0)).urn
|
|
195
|
+
let _ =
|
|
196
|
+
(urn, handler)
|
|
197
|
+
->Pulumi.Output.all2
|
|
198
|
+
->Pulumi.Output.apply(((urn, handler)) => {
|
|
199
|
+
log.debug(
|
|
200
|
+
~comp="AggregateRuntime",
|
|
201
|
+
`forCommandTopic ${commandTopicName}: set handler for ${urn}`,
|
|
202
|
+
)
|
|
203
|
+
commandTopicHandlers->Dict.set(urn, handler->RuntimeEnvironment.asEffectHandler)
|
|
204
|
+
})
|
|
205
|
+
| None =>
|
|
206
|
+
JsError.throwWithMessage(
|
|
207
|
+
`forCommandTopic: commandTopic ${commandTopicName} has no Aggregate parent`,
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
let forEventCollector = (
|
|
212
|
+
~handler: Pulumi.Output.t<
|
|
213
|
+
Runtime.effectHandler<EventCollectorChannel.callbackEvent, context, unit, string>,
|
|
214
|
+
>,
|
|
215
|
+
~eventTopics: EventTopic.allOutputs,
|
|
216
|
+
~resources: array<ReventlessInfra.Adapter.resource>,
|
|
217
|
+
~memorySize=1024,
|
|
218
|
+
~timeout=30,
|
|
219
|
+
eventCollector: EventCollector.component,
|
|
220
|
+
) => {
|
|
221
|
+
let eventCollectorResource = eventCollector->Component.toPulumiResource
|
|
222
|
+
let eventCollectorName = eventCollectorResource.name->Option.getOr("Unnamed")
|
|
223
|
+
let channel = eventCollector->EventCollector_Adapter.channel
|
|
224
|
+
switch eventCollectorResource.parent->Option.flatMap(parent => parent.parent) {
|
|
225
|
+
| Some(aggregateResource) =>
|
|
226
|
+
aggregateResource->registerEventCollectorRuntimeSpec(
|
|
227
|
+
~channel,
|
|
228
|
+
~eventTopics,
|
|
229
|
+
~resources,
|
|
230
|
+
~memorySize,
|
|
231
|
+
~timeout,
|
|
232
|
+
)
|
|
233
|
+
let urns =
|
|
234
|
+
(eventCollector->Component.outputs).resources
|
|
235
|
+
->Array.map(({urn}) => urn)
|
|
236
|
+
->Pulumi.Output.all
|
|
237
|
+
let _ =
|
|
238
|
+
(urns, handler)
|
|
239
|
+
->Pulumi.Output.all2
|
|
240
|
+
->Pulumi.Output.apply(((urns, handler)) => {
|
|
241
|
+
log.debug(
|
|
242
|
+
~comp="AggregateRuntime",
|
|
243
|
+
`forEventCollector ${eventCollectorName}: set handler for ${urns->Array.join(", ")}`,
|
|
244
|
+
)
|
|
245
|
+
urns->Array.map(urn => {
|
|
246
|
+
let handlers = eventCollectorHandlers->Dict.get(urn)->Option.getOr([])
|
|
247
|
+
eventCollectorHandlers->Dict.set(
|
|
248
|
+
urn,
|
|
249
|
+
handlers->Array.concat([handler->RuntimeEnvironment.asEffectHandler]),
|
|
250
|
+
)
|
|
251
|
+
})
|
|
252
|
+
})
|
|
253
|
+
| None =>
|
|
254
|
+
JsError.throwWithMessage(
|
|
255
|
+
`forEventCollector: eventCollector ${eventCollectorName} has no Aggregate parent`,
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
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 Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
7
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.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
|
+
import * as CommandGenerator$ReventlessCore from "../../components/CommandGenerator/CommandGenerator.res.mjs";
|
|
13
|
+
|
|
14
|
+
function Make(RuntimeEnvironment) {
|
|
15
|
+
return CommandTopicChannel => (EventCollectorChannel => {
|
|
16
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
17
|
+
let runtimeSpecs = {};
|
|
18
|
+
let commandGeneratorHandlers = {};
|
|
19
|
+
let commandTopicHandlers = {};
|
|
20
|
+
let eventCollectorHandlers = {};
|
|
21
|
+
let runEffect = (correlationId, effect) => {
|
|
22
|
+
let cid = Stdlib_Option.getOr(correlationId, "unknown");
|
|
23
|
+
return Effect.runPromise(Effect.provideService(Effect.annotateLogs(effect, "correlationId", cid), RequestContext$ReventlessCore.tag, RequestContext$ReventlessCore.test(cid, undefined, undefined)));
|
|
24
|
+
};
|
|
25
|
+
let aggregateHandler = aggregateName => (async (event, context) => {
|
|
26
|
+
let correlationId = RuntimeEnvironment.extractCorrelationId(event);
|
|
27
|
+
let comp = `AggregateRuntime(` + aggregateName + `)`;
|
|
28
|
+
let info = CommandGenerator$ReventlessCore.metaInfo(event);
|
|
29
|
+
if (info !== undefined) {
|
|
30
|
+
let handler = commandGeneratorHandlers[info];
|
|
31
|
+
if (handler !== undefined) {
|
|
32
|
+
Effect.runSync(EffectLogger$ReventlessCore.logDebug(comp, undefined, `found CommandGenerator handler for ` + info));
|
|
33
|
+
await runEffect(correlationId, handler(event, context));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
let available = Object.keys(commandGeneratorHandlers).join(",");
|
|
37
|
+
return Effect.runSync(EffectLogger$ReventlessCore.logWarn(comp, undefined, `no handler found: ` + info + ` available=[` + available + `]`));
|
|
38
|
+
}
|
|
39
|
+
await Promise.all(Object.entries(RuntimeEnvironment.groupBySource(event)).map(async param => {
|
|
40
|
+
let event = param[1];
|
|
41
|
+
let urn = param[0];
|
|
42
|
+
let handler = commandTopicHandlers[urn];
|
|
43
|
+
if (handler !== undefined) {
|
|
44
|
+
Effect.runSync(EffectLogger$ReventlessCore.logDebug(comp, undefined, `found CommandTopic handler for ` + urn));
|
|
45
|
+
return await runEffect(correlationId, handler(event, context));
|
|
46
|
+
}
|
|
47
|
+
let handlers = eventCollectorHandlers[urn];
|
|
48
|
+
if (handlers !== undefined) {
|
|
49
|
+
let count = handlers.length.toString();
|
|
50
|
+
Effect.runSync(EffectLogger$ReventlessCore.logDebug(comp, undefined, `found ` + count + ` EventCollector handler(s) for ` + urn));
|
|
51
|
+
await Promise.all(handlers.map(handler => runEffect(correlationId, handler(event, context))));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
let available = Object.keys(commandTopicHandlers).concat(Object.keys(eventCollectorHandlers)).join(",");
|
|
55
|
+
return Effect.runSync(EffectLogger$ReventlessCore.logWarn(comp, undefined, `no handler found: ` + urn + ` available=[` + available + `]`));
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
58
|
+
let getRuntimeSpec = aggregate => Stdlib_Option.getOr(runtimeSpecs[Stdlib_Option.getOr(aggregate.__name, "Unnamed")], {
|
|
59
|
+
aggregate: aggregate,
|
|
60
|
+
connects: [],
|
|
61
|
+
eventCollectorChannelSpec: undefined,
|
|
62
|
+
memorySize: 0,
|
|
63
|
+
timeout: 0
|
|
64
|
+
});
|
|
65
|
+
let setRuntimeSpec = (aggregate, runtimeSpec) => {
|
|
66
|
+
runtimeSpecs[Stdlib_Option.getOr(aggregate.__name, "Unnamed")] = runtimeSpec;
|
|
67
|
+
};
|
|
68
|
+
let registerRuntimeSpec = (connect, memorySize, timeout, aggregate) => {
|
|
69
|
+
let spec = getRuntimeSpec(aggregate);
|
|
70
|
+
setRuntimeSpec(aggregate, {
|
|
71
|
+
aggregate: spec.aggregate,
|
|
72
|
+
connects: spec.connects.concat([connect]),
|
|
73
|
+
eventCollectorChannelSpec: spec.eventCollectorChannelSpec,
|
|
74
|
+
memorySize: Math.max(spec.memorySize, memorySize),
|
|
75
|
+
timeout: Math.max(spec.timeout, timeout)
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
let registerEventCollectorRuntimeSpec = (channel, eventTopics, resources, memorySize, timeout, aggregate) => {
|
|
79
|
+
let spec = getRuntimeSpec(aggregate);
|
|
80
|
+
setRuntimeSpec(aggregate, {
|
|
81
|
+
aggregate: spec.aggregate,
|
|
82
|
+
connects: spec.connects,
|
|
83
|
+
eventCollectorChannelSpec: {
|
|
84
|
+
channel: channel,
|
|
85
|
+
eventTopics: eventTopics,
|
|
86
|
+
resources: resources
|
|
87
|
+
},
|
|
88
|
+
memorySize: Math.max(spec.memorySize, memorySize),
|
|
89
|
+
timeout: Math.max(spec.timeout, timeout)
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
let forCommandGenerator = (handler, connect, memorySizeOpt, timeoutOpt, commandGenerator) => {
|
|
93
|
+
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
94
|
+
let timeout = timeoutOpt !== undefined ? timeoutOpt : 30;
|
|
95
|
+
let commandGeneratorResource = Component$ReventlessCore.toPulumiResource(commandGenerator);
|
|
96
|
+
let commandGeneratorName = Stdlib_Option.getOr(commandGeneratorResource.__name, "Unnamed");
|
|
97
|
+
let aggregateResource = commandGeneratorResource.__parentResource;
|
|
98
|
+
if (aggregateResource === undefined) {
|
|
99
|
+
return Stdlib_JsError.throwWithMessage(`forCommandGenerator: commandGenerator ` + commandGeneratorName + ` has no Aggregate parent`);
|
|
100
|
+
}
|
|
101
|
+
registerRuntimeSpec(connect, memorySize, timeout, aggregateResource);
|
|
102
|
+
let infos = Pulumi.all(Component$ReventlessCore.outputs(commandGenerator).resources.map(resource => resource.resourceInfo));
|
|
103
|
+
Pulumi.all([
|
|
104
|
+
infos,
|
|
105
|
+
handler
|
|
106
|
+
]).apply(param => {
|
|
107
|
+
let handler = param[1];
|
|
108
|
+
let infoStrs = Stdlib_Array.filterMap(param[0], ri => {
|
|
109
|
+
if (typeof ri !== "object" || ri.TAG !== "ApiResolver") {
|
|
110
|
+
return;
|
|
111
|
+
} else {
|
|
112
|
+
return ri.typeName + `.` + ri.fieldName;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
log.debug("AggregateRuntime", undefined, `forCommandGenerator ` + commandGeneratorName + `: set handler for ` + infoStrs.join(", "));
|
|
116
|
+
return infoStrs.map(info => {
|
|
117
|
+
commandGeneratorHandlers[info] = handler;
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
let forCommandTopic = (handler, connect, memorySizeOpt, timeoutOpt, commandTopic) => {
|
|
122
|
+
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
123
|
+
let timeout = timeoutOpt !== undefined ? timeoutOpt : 30;
|
|
124
|
+
let commandTopicResource = Component$ReventlessCore.toPulumiResource(commandTopic);
|
|
125
|
+
let commandTopicName = Stdlib_Option.getOr(commandTopicResource.__name, "Unnamed");
|
|
126
|
+
let aggregateResource = commandTopicResource.__parentResource;
|
|
127
|
+
if (aggregateResource === undefined) {
|
|
128
|
+
return Stdlib_JsError.throwWithMessage(`forCommandTopic: commandTopic ` + commandTopicName + ` has no Aggregate parent`);
|
|
129
|
+
}
|
|
130
|
+
registerRuntimeSpec(connect, memorySize, timeout, aggregateResource);
|
|
131
|
+
let urn = Component$ReventlessCore.outputs(commandTopic).resources[0].urn;
|
|
132
|
+
Pulumi.all([
|
|
133
|
+
urn,
|
|
134
|
+
handler
|
|
135
|
+
]).apply(param => {
|
|
136
|
+
let urn = param[0];
|
|
137
|
+
log.debug("AggregateRuntime", undefined, `forCommandTopic ` + commandTopicName + `: set handler for ` + urn);
|
|
138
|
+
commandTopicHandlers[urn] = RuntimeEnvironment.asEffectHandler(param[1]);
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
let forEventCollector = (handler, eventTopics, resources, memorySizeOpt, timeoutOpt, eventCollector) => {
|
|
142
|
+
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
143
|
+
let timeout = timeoutOpt !== undefined ? timeoutOpt : 30;
|
|
144
|
+
let eventCollectorResource = Component$ReventlessCore.toPulumiResource(eventCollector);
|
|
145
|
+
let eventCollectorName = Stdlib_Option.getOr(eventCollectorResource.__name, "Unnamed");
|
|
146
|
+
let channel = eventCollector.channel;
|
|
147
|
+
let aggregateResource = Stdlib_Option.flatMap(eventCollectorResource.__parentResource, parent => parent.__parentResource);
|
|
148
|
+
if (aggregateResource === undefined) {
|
|
149
|
+
return Stdlib_JsError.throwWithMessage(`forEventCollector: eventCollector ` + eventCollectorName + ` has no Aggregate parent`);
|
|
150
|
+
}
|
|
151
|
+
registerEventCollectorRuntimeSpec(channel, eventTopics, resources, memorySize, timeout, aggregateResource);
|
|
152
|
+
let urns = Pulumi.all(Component$ReventlessCore.outputs(eventCollector).resources.map(param => param.urn));
|
|
153
|
+
Pulumi.all([
|
|
154
|
+
urns,
|
|
155
|
+
handler
|
|
156
|
+
]).apply(param => {
|
|
157
|
+
let handler = param[1];
|
|
158
|
+
let urns = param[0];
|
|
159
|
+
log.debug("AggregateRuntime", undefined, `forEventCollector ` + eventCollectorName + `: set handler for ` + urns.join(", "));
|
|
160
|
+
return urns.map(urn => {
|
|
161
|
+
let handlers = Stdlib_Option.getOr(eventCollectorHandlers[urn], []);
|
|
162
|
+
eventCollectorHandlers[urn] = handlers.concat([RuntimeEnvironment.asEffectHandler(handler)]);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
return {
|
|
167
|
+
log: log,
|
|
168
|
+
CommandTopicChannel: CommandTopicChannel,
|
|
169
|
+
EventCollectorChannel: EventCollectorChannel,
|
|
170
|
+
runtimeSpecs: runtimeSpecs,
|
|
171
|
+
commandGeneratorHandlers: commandGeneratorHandlers,
|
|
172
|
+
commandTopicHandlers: commandTopicHandlers,
|
|
173
|
+
eventCollectorHandlers: eventCollectorHandlers,
|
|
174
|
+
runEffect: runEffect,
|
|
175
|
+
aggregateHandler: aggregateHandler,
|
|
176
|
+
getRuntimeSpec: getRuntimeSpec,
|
|
177
|
+
setRuntimeSpec: setRuntimeSpec,
|
|
178
|
+
registerRuntimeSpec: registerRuntimeSpec,
|
|
179
|
+
registerEventCollectorRuntimeSpec: registerEventCollectorRuntimeSpec,
|
|
180
|
+
forCommandGenerator: forCommandGenerator,
|
|
181
|
+
forCommandTopic: forCommandTopic,
|
|
182
|
+
forEventCollector: forEventCollector
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export {
|
|
188
|
+
Make,
|
|
189
|
+
}
|
|
190
|
+
/* effect/Effect Not a pure module */
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
module Make = (
|
|
2
|
+
RuntimeEnvironment: Runtime.Environment,
|
|
3
|
+
CommandTopicChannel: CommandTopic_Adapter.Channel,
|
|
4
|
+
EventCollectorChannel: EventCollector_Adapter.Channel
|
|
5
|
+
with type runtimeParts = RuntimeEnvironment.parts,
|
|
6
|
+
): (
|
|
7
|
+
AggregateRuntime_Builder.T
|
|
8
|
+
with type context = RuntimeEnvironment.context
|
|
9
|
+
and type runtimeParts = RuntimeEnvironment.parts
|
|
10
|
+
and module CommandTopicChannel = CommandTopicChannel
|
|
11
|
+
and module EventCollectorChannel = EventCollectorChannel
|
|
12
|
+
) => {
|
|
13
|
+
type context = RuntimeEnvironment.context
|
|
14
|
+
type runtimeParts = RuntimeEnvironment.parts
|
|
15
|
+
module CommandTopicChannel = CommandTopicChannel
|
|
16
|
+
module EventCollectorChannel = EventCollectorChannel
|
|
17
|
+
|
|
18
|
+
let forCommandGenerator = (
|
|
19
|
+
~handler: Pulumi.Output.t<CommandGenerator.effectEventHandler<context>>,
|
|
20
|
+
~connect,
|
|
21
|
+
~memorySize=1024,
|
|
22
|
+
~timeout=30,
|
|
23
|
+
commandGenerator,
|
|
24
|
+
) => {
|
|
25
|
+
let resource = commandGenerator->Component.toPulumiResource
|
|
26
|
+
let runtime = RuntimeEnvironment.make(
|
|
27
|
+
~name=resource.name->ComponentType.nameOpt(CommandGenerator.componentType),
|
|
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
|
+
connect(~runtime)
|
|
36
|
+
}
|
|
37
|
+
let forCommandTopic = (
|
|
38
|
+
~handler: Pulumi.Output.t<
|
|
39
|
+
Runtime.effectHandler<CommandTopicChannel.callbackEvent, context, unit, string>,
|
|
40
|
+
>,
|
|
41
|
+
~connect,
|
|
42
|
+
~memorySize=1024,
|
|
43
|
+
~timeout=30,
|
|
44
|
+
commandTopic,
|
|
45
|
+
) => {
|
|
46
|
+
let resource = commandTopic->Component.toPulumiResource
|
|
47
|
+
let runtime = RuntimeEnvironment.make(
|
|
48
|
+
~name=resource.name->ComponentType.nameOpt(CommandTopic.componentType),
|
|
49
|
+
~handler=handler->Pulumi.Output.apply(handler =>
|
|
50
|
+
handler->RuntimeEnvironment.asEffectHandler->Runtime.runEffectHandler
|
|
51
|
+
),
|
|
52
|
+
~memorySize,
|
|
53
|
+
~timeout,
|
|
54
|
+
~opts={Pulumi.ComponentResource.parent: resource},
|
|
55
|
+
)
|
|
56
|
+
connect(~runtime)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let forEventCollector = (
|
|
60
|
+
~handler: Pulumi.Output.t<
|
|
61
|
+
Runtime.effectHandler<EventCollectorChannel.callbackEvent, context, unit, string>,
|
|
62
|
+
>,
|
|
63
|
+
~eventTopics: EventTopic.allOutputs,
|
|
64
|
+
~resources: array<ReventlessInfra.Adapter.resource>,
|
|
65
|
+
~memorySize=1024,
|
|
66
|
+
~timeout=30,
|
|
67
|
+
eventCollector,
|
|
68
|
+
) => {
|
|
69
|
+
let resource = eventCollector->Component.toPulumiResource
|
|
70
|
+
let name = resource.name->ComponentType.nameOpt(EventCollector.componentType)
|
|
71
|
+
let opts = {Pulumi.ComponentResource.parent: resource}
|
|
72
|
+
let runtime = RuntimeEnvironment.make(
|
|
73
|
+
~name,
|
|
74
|
+
~handler=handler->Pulumi.Output.apply(handler =>
|
|
75
|
+
handler->RuntimeEnvironment.asEffectHandler->Runtime.runEffectHandler
|
|
76
|
+
),
|
|
77
|
+
~memorySize,
|
|
78
|
+
~timeout,
|
|
79
|
+
~opts,
|
|
80
|
+
)
|
|
81
|
+
let _connectResources = EventCollectorChannel.connect(
|
|
82
|
+
~name,
|
|
83
|
+
~channelSpecs=[
|
|
84
|
+
{channel: eventCollector->EventCollector_Adapter.channel, eventTopics, resources},
|
|
85
|
+
],
|
|
86
|
+
~runtime,
|
|
87
|
+
~opts,
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let finish = () => ()
|
|
92
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 CommandTopic$ReventlessCore from "../../components/CommandTopic/CommandTopic.res.mjs";
|
|
6
|
+
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
7
|
+
import * as EventCollector$ReventlessCore from "../../components/EventCollector/EventCollector.res.mjs";
|
|
8
|
+
import * as CommandGenerator$ReventlessCore from "../../components/CommandGenerator/CommandGenerator.res.mjs";
|
|
9
|
+
|
|
10
|
+
function Make(RuntimeEnvironment) {
|
|
11
|
+
return CommandTopicChannel => (EventCollectorChannel => {
|
|
12
|
+
let forCommandGenerator = (handler, connect, memorySizeOpt, timeoutOpt, commandGenerator) => {
|
|
13
|
+
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
14
|
+
let timeout = timeoutOpt !== undefined ? timeoutOpt : 30;
|
|
15
|
+
let resource = Component$ReventlessCore.toPulumiResource(commandGenerator);
|
|
16
|
+
return connect(RuntimeEnvironment.make(ComponentType$ReventlessCore.nameOpt(resource.__name, CommandGenerator$ReventlessCore.componentType), handler.apply(handler => Runtime$ReventlessCore.runEffectHandler(RuntimeEnvironment.asEffectHandler(handler))), memorySize, timeout, {
|
|
17
|
+
parent: resource
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
let forCommandTopic = (handler, connect, memorySizeOpt, timeoutOpt, commandTopic) => {
|
|
21
|
+
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
22
|
+
let timeout = timeoutOpt !== undefined ? timeoutOpt : 30;
|
|
23
|
+
let resource = Component$ReventlessCore.toPulumiResource(commandTopic);
|
|
24
|
+
return connect(RuntimeEnvironment.make(ComponentType$ReventlessCore.nameOpt(resource.__name, CommandTopic$ReventlessCore.componentType), handler.apply(handler => Runtime$ReventlessCore.runEffectHandler(RuntimeEnvironment.asEffectHandler(handler))), memorySize, timeout, {
|
|
25
|
+
parent: resource
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
let forEventCollector = (handler, eventTopics, resources, memorySizeOpt, timeoutOpt, eventCollector) => {
|
|
29
|
+
let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
|
|
30
|
+
let timeout = timeoutOpt !== undefined ? timeoutOpt : 30;
|
|
31
|
+
let resource = Component$ReventlessCore.toPulumiResource(eventCollector);
|
|
32
|
+
let name = ComponentType$ReventlessCore.nameOpt(resource.__name, EventCollector$ReventlessCore.componentType);
|
|
33
|
+
let opts_parent = resource;
|
|
34
|
+
let opts = {
|
|
35
|
+
parent: opts_parent
|
|
36
|
+
};
|
|
37
|
+
let runtime = RuntimeEnvironment.make(name, handler.apply(handler => Runtime$ReventlessCore.runEffectHandler(RuntimeEnvironment.asEffectHandler(handler))), memorySize, timeout, opts);
|
|
38
|
+
EventCollectorChannel.connect(name, [{
|
|
39
|
+
channel: eventCollector.channel,
|
|
40
|
+
eventTopics: eventTopics,
|
|
41
|
+
resources: resources
|
|
42
|
+
}], runtime, opts);
|
|
43
|
+
};
|
|
44
|
+
let finish = () => {};
|
|
45
|
+
return {
|
|
46
|
+
CommandTopicChannel: CommandTopicChannel,
|
|
47
|
+
EventCollectorChannel: EventCollectorChannel,
|
|
48
|
+
forCommandGenerator: forCommandGenerator,
|
|
49
|
+
forCommandTopic: forCommandTopic,
|
|
50
|
+
forEventCollector: forEventCollector,
|
|
51
|
+
finish: finish
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
Make,
|
|
58
|
+
}
|
|
59
|
+
/* Runtime-ReventlessCore Not a pure module */
|