@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,196 @@
|
|
|
1
|
+
// Shared builder helpers used by both Plugin_Builder and Platform_Admin.
|
|
2
|
+
// Extracted from Plugin_Helpers to eliminate duplication.
|
|
3
|
+
|
|
4
|
+
// Captured read model data — stores extracted values instead of module+component
|
|
5
|
+
// so that Builder_Helpers can work with abstract spec-level component types.
|
|
6
|
+
type readModel = {
|
|
7
|
+
outputs: ReadModel.outputs,
|
|
8
|
+
operations: Pulumi.Output.t<ReadModel.operations>,
|
|
9
|
+
finish: unit => unit,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let addEventMapperFns = Dict.make()
|
|
13
|
+
let aggregateResources = Dict.make()
|
|
14
|
+
let publishToAggregates = Dict.make()
|
|
15
|
+
// Finish functions captured from aggregate modules during createAggregatesWithoutEventMappers.
|
|
16
|
+
let aggregateFinishFns = Dict.make()
|
|
17
|
+
|
|
18
|
+
let createAggregatesWithoutEventMappers = (
|
|
19
|
+
type a,
|
|
20
|
+
aggregates: array<module(ReventlessInfra.Aggregate.T with type api = a)>,
|
|
21
|
+
~api: a,
|
|
22
|
+
opts,
|
|
23
|
+
) =>
|
|
24
|
+
aggregates
|
|
25
|
+
->Array.map((module(SpecificAggregate: ReventlessInfra.Aggregate.T with type api = a)) => {
|
|
26
|
+
let aggregate = SpecificAggregate.make(~api, ~opts)
|
|
27
|
+
let aggOutputs = SpecificAggregate.outputs(aggregate)
|
|
28
|
+
addEventMapperFns->Dict.set(
|
|
29
|
+
SpecificAggregate.Spec.name,
|
|
30
|
+
aggOutputs.addEventMapper,
|
|
31
|
+
)
|
|
32
|
+
let resources =
|
|
33
|
+
aggOutputs.commandTopic->Pulumi.Output.apply(commandTopic =>
|
|
34
|
+
commandTopic.resources
|
|
35
|
+
)
|
|
36
|
+
aggregateResources->Dict.set(SpecificAggregate.Spec.name, resources)
|
|
37
|
+
let publishJsons =
|
|
38
|
+
SpecificAggregate.operations(aggregate)->Pulumi.Output.apply(({publishJsons}) => publishJsons)
|
|
39
|
+
publishToAggregates->Dict.set(SpecificAggregate.Spec.name, publishJsons)
|
|
40
|
+
aggregateFinishFns->Dict.set(SpecificAggregate.Spec.name, SpecificAggregate.finish)
|
|
41
|
+
aggOutputs
|
|
42
|
+
})
|
|
43
|
+
->Array.map(aggregate => {(aggregate.name, aggregate)})
|
|
44
|
+
->Dict.fromArray
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
let finishAggregates = (
|
|
48
|
+
aggregatesOutputs: dict<Aggregate.outputs>,
|
|
49
|
+
) => {
|
|
50
|
+
let allOutputs = aggregatesOutputs->Dict.valuesToArray
|
|
51
|
+
|
|
52
|
+
// Wait for ALL commandTopicOutputs (not just those with event mappers)
|
|
53
|
+
// to ensure forCommandTopic has registered specs before finish() runs.
|
|
54
|
+
let allCommandTopicOutputs =
|
|
55
|
+
allOutputs->Array.map(aggregateOutputs => aggregateOutputs.commandTopic)
|
|
56
|
+
let eventMapperOutputs =
|
|
57
|
+
allOutputs
|
|
58
|
+
->Array.map(aggregateOutputs => aggregateOutputs.eventMapper)
|
|
59
|
+
->Array.keepSome
|
|
60
|
+
|
|
61
|
+
let _ =
|
|
62
|
+
(eventMapperOutputs->Pulumi.Output.all, allCommandTopicOutputs->Pulumi.Output.all)
|
|
63
|
+
->Pulumi.Output.all2
|
|
64
|
+
->Pulumi.Output.apply(((eventMapperOutputs, _)) =>
|
|
65
|
+
eventMapperOutputs
|
|
66
|
+
->Array.map(eventMapperOutput => eventMapperOutput.eventCollector)
|
|
67
|
+
->Pulumi.Output.all
|
|
68
|
+
->Pulumi.Output.apply(_ =>
|
|
69
|
+
aggregateFinishFns->Dict.valuesToArray->Array.forEach(finishFn => finishFn())
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let addEventMappers = (
|
|
75
|
+
allEventTopics,
|
|
76
|
+
queryEngine,
|
|
77
|
+
) => {
|
|
78
|
+
let aggregatesOutputs =
|
|
79
|
+
addEventMapperFns->Dict.mapValues(addEventMapperFn =>
|
|
80
|
+
addEventMapperFn(allEventTopics, queryEngine)
|
|
81
|
+
)
|
|
82
|
+
finishAggregates(aggregatesOutputs)
|
|
83
|
+
|
|
84
|
+
aggregatesOutputs
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
let readModelNamesForSourceName = Dict.make()
|
|
88
|
+
let publishToReadModels = Dict.make()
|
|
89
|
+
|
|
90
|
+
let finishReadModels = readModels => {
|
|
91
|
+
let _ =
|
|
92
|
+
readModels
|
|
93
|
+
->Array.map(((_, {operations})) => operations)
|
|
94
|
+
->Pulumi.Output.all
|
|
95
|
+
->Pulumi.Output.apply(_ =>
|
|
96
|
+
readModels->Array.forEach(((_, {finish})) => {
|
|
97
|
+
finish()
|
|
98
|
+
})
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let extractReadModelsOutputs = readModels =>
|
|
103
|
+
readModels
|
|
104
|
+
->Dict.fromArray
|
|
105
|
+
->Dict.toArray
|
|
106
|
+
->Array.map(((name, {outputs})) => (name, outputs))
|
|
107
|
+
->Dict.fromArray
|
|
108
|
+
|
|
109
|
+
let createReadModels = (
|
|
110
|
+
type a,
|
|
111
|
+
type r,
|
|
112
|
+
readModels: array<module(ReventlessInfra.ReadModel.T with type api = a and type role = r)>,
|
|
113
|
+
~api: a,
|
|
114
|
+
~apiRole: r,
|
|
115
|
+
allEventTopics,
|
|
116
|
+
opts,
|
|
117
|
+
) => {
|
|
118
|
+
let readModels = readModels->Array.map((module(SpecificReadModel: ReventlessInfra.ReadModel.T with type api = a and type role = r)) => {
|
|
119
|
+
let readModel = SpecificReadModel.make(~api, ~apiRole, ~allEventTopics, ~opts)
|
|
120
|
+
let rmOutputs = SpecificReadModel.outputs(readModel)
|
|
121
|
+
let rmOperations = SpecificReadModel.operations(readModel)
|
|
122
|
+
rmOutputs.sourceNames->Array.forEach(sourceName =>
|
|
123
|
+
switch readModelNamesForSourceName->Dict.get(sourceName) {
|
|
124
|
+
| Some(readModelNames) =>
|
|
125
|
+
readModelNamesForSourceName->Dict.set(
|
|
126
|
+
sourceName,
|
|
127
|
+
readModelNames->Array.concat([SpecificReadModel.Spec.name]),
|
|
128
|
+
)
|
|
129
|
+
| None => Dict.set(readModelNamesForSourceName, sourceName, [SpecificReadModel.Spec.name])
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
publishToReadModels->Dict.set(
|
|
133
|
+
SpecificReadModel.Spec.name,
|
|
134
|
+
rmOperations->Pulumi.Output.apply(({enqueueEvent}) => enqueueEvent),
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
(SpecificReadModel.Spec.name, {outputs: rmOutputs, operations: rmOperations, finish: SpecificReadModel.finish})
|
|
138
|
+
})
|
|
139
|
+
readModels->finishReadModels
|
|
140
|
+
readModels->extractReadModelsOutputs
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Per-extension-point registry data the EventCollector entry point needs at
|
|
144
|
+
// runtime to publish outgoing events. Lives next to the existing
|
|
145
|
+
// `extensionPointsOutputs` / `extensionPointsHandlers` arrays — same indexing.
|
|
146
|
+
type extensionPointRegistryInfo = {
|
|
147
|
+
specModule: string,
|
|
148
|
+
mappingsModule: string,
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
let createExtensionPoints = (
|
|
152
|
+
extensionPoints,
|
|
153
|
+
~aggregateResources,
|
|
154
|
+
~publishToAggregates,
|
|
155
|
+
~scheduler,
|
|
156
|
+
~queryEngine,
|
|
157
|
+
~resourceNaming,
|
|
158
|
+
~opts,
|
|
159
|
+
) => {
|
|
160
|
+
let triples =
|
|
161
|
+
extensionPoints
|
|
162
|
+
->Array.map((module(SpecificExtensionPoint: ReventlessInfra.ExtensionPoint.T)) => {
|
|
163
|
+
let extensionPoint = SpecificExtensionPoint.make(
|
|
164
|
+
~aggregateResources,
|
|
165
|
+
~publishToAggregates,
|
|
166
|
+
~scheduler,
|
|
167
|
+
~queryEngine,
|
|
168
|
+
~resourceNaming,
|
|
169
|
+
~opts=Some(opts),
|
|
170
|
+
)
|
|
171
|
+
// operations() returns abstract type from ReventlessInfra.ExtensionPoint.T;
|
|
172
|
+
// coerce to the concrete ExtensionPoint.operations (always identical at runtime).
|
|
173
|
+
let ops: Pulumi.Output.t<ExtensionPoint.operations> =
|
|
174
|
+
SpecificExtensionPoint.operations(extensionPoint)->Obj.magic
|
|
175
|
+
let outputs = SpecificExtensionPoint.outputs(extensionPoint)
|
|
176
|
+
let registryInfo: extensionPointRegistryInfo = {
|
|
177
|
+
specModule: outputs.specModule,
|
|
178
|
+
mappingsModule: outputs.mappingsModule,
|
|
179
|
+
}
|
|
180
|
+
(
|
|
181
|
+
outputs,
|
|
182
|
+
ops->Pulumi.Output.apply(({outgoingJsonEventsHandler}) => outgoingJsonEventsHandler),
|
|
183
|
+
registryInfo,
|
|
184
|
+
)
|
|
185
|
+
})
|
|
186
|
+
let outputs = triples->Array.map(((o, _, _)) => o)
|
|
187
|
+
let handlers = triples->Array.map(((_, h, _)) => h)
|
|
188
|
+
let registryInfos = triples->Array.map(((_, _, r)) => r)
|
|
189
|
+
(outputs, handlers, registryInfos)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
let createResolvers = allQueryDbs =>
|
|
193
|
+
allQueryDbs
|
|
194
|
+
->QueryDb.allResolversMakers
|
|
195
|
+
->Array.map(resolverMaker => resolverMaker(allQueryDbs))
|
|
196
|
+
->Array.flat
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
|
|
4
|
+
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
5
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
6
|
+
import * as QueryDb$ReventlessCore from "./QueryDb/QueryDb.res.mjs";
|
|
7
|
+
|
|
8
|
+
let addEventMapperFns = {};
|
|
9
|
+
|
|
10
|
+
let aggregateResources = {};
|
|
11
|
+
|
|
12
|
+
let publishToAggregates = {};
|
|
13
|
+
|
|
14
|
+
let aggregateFinishFns = {};
|
|
15
|
+
|
|
16
|
+
function createAggregatesWithoutEventMappers(aggregates, api, opts) {
|
|
17
|
+
return Object.fromEntries(aggregates.map(SpecificAggregate => {
|
|
18
|
+
let aggregate = SpecificAggregate.make(api, opts);
|
|
19
|
+
let aggOutputs = SpecificAggregate.outputs(aggregate);
|
|
20
|
+
addEventMapperFns[SpecificAggregate.Spec.name] = aggOutputs.addEventMapper;
|
|
21
|
+
let resources = aggOutputs.commandTopic.apply(commandTopic => commandTopic.resources);
|
|
22
|
+
aggregateResources[SpecificAggregate.Spec.name] = resources;
|
|
23
|
+
let publishJsons = SpecificAggregate.operations(aggregate).apply(param => param.publishJsons);
|
|
24
|
+
publishToAggregates[SpecificAggregate.Spec.name] = publishJsons;
|
|
25
|
+
aggregateFinishFns[SpecificAggregate.Spec.name] = SpecificAggregate.finish;
|
|
26
|
+
return aggOutputs;
|
|
27
|
+
}).map(aggregate => [
|
|
28
|
+
aggregate.name,
|
|
29
|
+
aggregate
|
|
30
|
+
]));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function finishAggregates(aggregatesOutputs) {
|
|
34
|
+
let allOutputs = Object.values(aggregatesOutputs);
|
|
35
|
+
let allCommandTopicOutputs = allOutputs.map(aggregateOutputs => aggregateOutputs.commandTopic);
|
|
36
|
+
let eventMapperOutputs = Stdlib_Array.keepSome(allOutputs.map(aggregateOutputs => aggregateOutputs.eventMapper));
|
|
37
|
+
Pulumi.all([
|
|
38
|
+
Pulumi.all(eventMapperOutputs),
|
|
39
|
+
Pulumi.all(allCommandTopicOutputs)
|
|
40
|
+
]).apply(param => Pulumi.all(param[0].map(eventMapperOutput => eventMapperOutput.eventCollector)).apply(param => {
|
|
41
|
+
Object.values(aggregateFinishFns).forEach(finishFn => finishFn());
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function addEventMappers(allEventTopics, queryEngine) {
|
|
46
|
+
let aggregatesOutputs = Stdlib_Dict.mapValues(addEventMapperFns, addEventMapperFn => addEventMapperFn(allEventTopics, queryEngine));
|
|
47
|
+
finishAggregates(aggregatesOutputs);
|
|
48
|
+
return aggregatesOutputs;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let readModelNamesForSourceName = {};
|
|
52
|
+
|
|
53
|
+
let publishToReadModels = {};
|
|
54
|
+
|
|
55
|
+
function finishReadModels(readModels) {
|
|
56
|
+
Pulumi.all(readModels.map(param => param[1].operations)).apply(param => {
|
|
57
|
+
readModels.forEach(param => param[1].finish());
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function extractReadModelsOutputs(readModels) {
|
|
62
|
+
return Object.fromEntries(Object.entries(Object.fromEntries(readModels)).map(param => [
|
|
63
|
+
param[0],
|
|
64
|
+
param[1].outputs
|
|
65
|
+
]));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function createReadModels(readModels, api, apiRole, allEventTopics, opts) {
|
|
69
|
+
let readModels$1 = readModels.map(SpecificReadModel => {
|
|
70
|
+
let readModel = SpecificReadModel.make(api, apiRole, allEventTopics, opts);
|
|
71
|
+
let rmOutputs = SpecificReadModel.outputs(readModel);
|
|
72
|
+
let rmOperations = SpecificReadModel.operations(readModel);
|
|
73
|
+
rmOutputs.sourceNames.forEach(sourceName => {
|
|
74
|
+
let readModelNames = readModelNamesForSourceName[sourceName];
|
|
75
|
+
if (readModelNames !== undefined) {
|
|
76
|
+
readModelNamesForSourceName[sourceName] = readModelNames.concat([SpecificReadModel.Spec.name]);
|
|
77
|
+
} else {
|
|
78
|
+
readModelNamesForSourceName[sourceName] = [SpecificReadModel.Spec.name];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
publishToReadModels[SpecificReadModel.Spec.name] = rmOperations.apply(param => param.enqueueEvent);
|
|
82
|
+
return [
|
|
83
|
+
SpecificReadModel.Spec.name,
|
|
84
|
+
{
|
|
85
|
+
outputs: rmOutputs,
|
|
86
|
+
operations: rmOperations,
|
|
87
|
+
finish: SpecificReadModel.finish
|
|
88
|
+
}
|
|
89
|
+
];
|
|
90
|
+
});
|
|
91
|
+
finishReadModels(readModels$1);
|
|
92
|
+
return extractReadModelsOutputs(readModels$1);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function createExtensionPoints(extensionPoints, aggregateResources, publishToAggregates, scheduler, queryEngine, resourceNaming, opts) {
|
|
96
|
+
let triples = extensionPoints.map(SpecificExtensionPoint => {
|
|
97
|
+
let extensionPoint = SpecificExtensionPoint.make(aggregateResources, publishToAggregates, scheduler, queryEngine, resourceNaming, opts);
|
|
98
|
+
let ops = SpecificExtensionPoint.operations(extensionPoint);
|
|
99
|
+
let outputs = SpecificExtensionPoint.outputs(extensionPoint);
|
|
100
|
+
let registryInfo_specModule = outputs.specModule;
|
|
101
|
+
let registryInfo_mappingsModule = outputs.mappingsModule;
|
|
102
|
+
let registryInfo = {
|
|
103
|
+
specModule: registryInfo_specModule,
|
|
104
|
+
mappingsModule: registryInfo_mappingsModule
|
|
105
|
+
};
|
|
106
|
+
return [
|
|
107
|
+
outputs,
|
|
108
|
+
ops.apply(param => param.outgoingJsonEventsHandler),
|
|
109
|
+
registryInfo
|
|
110
|
+
];
|
|
111
|
+
});
|
|
112
|
+
let outputs = triples.map(param => param[0]);
|
|
113
|
+
let handlers = triples.map(param => param[1]);
|
|
114
|
+
let registryInfos = triples.map(param => param[2]);
|
|
115
|
+
return [
|
|
116
|
+
outputs,
|
|
117
|
+
handlers,
|
|
118
|
+
registryInfos
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function createResolvers(allQueryDbs) {
|
|
123
|
+
return QueryDb$ReventlessCore.allResolversMakers(allQueryDbs).map(resolverMaker => resolverMaker(allQueryDbs)).flat();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
addEventMapperFns,
|
|
128
|
+
aggregateResources,
|
|
129
|
+
publishToAggregates,
|
|
130
|
+
aggregateFinishFns,
|
|
131
|
+
createAggregatesWithoutEventMappers,
|
|
132
|
+
finishAggregates,
|
|
133
|
+
addEventMappers,
|
|
134
|
+
readModelNamesForSourceName,
|
|
135
|
+
publishToReadModels,
|
|
136
|
+
finishReadModels,
|
|
137
|
+
extractReadModelsOutputs,
|
|
138
|
+
createReadModels,
|
|
139
|
+
createExtensionPoints,
|
|
140
|
+
createResolvers,
|
|
141
|
+
}
|
|
142
|
+
/* @pulumi/pulumi Not a pure module */
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
let log = Logger.fromEnv()
|
|
2
|
+
|
|
3
|
+
let componentType = ComponentType.Cloner
|
|
4
|
+
|
|
5
|
+
type outputs = {resources: Pulumi.Output.t<array<ReventlessInfra.Adapter.resource>>}
|
|
6
|
+
|
|
7
|
+
type fullQualifiedStackName = {
|
|
8
|
+
organization: string,
|
|
9
|
+
project: string,
|
|
10
|
+
stack: string,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type t
|
|
14
|
+
type component = Component.t<t, outputs, unit>
|
|
15
|
+
|
|
16
|
+
module type T = {
|
|
17
|
+
type api
|
|
18
|
+
let make: (~api: api, ~opts: Pulumi.ComponentResource.options=?) => component
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module Adapter = {
|
|
22
|
+
type runner = {resources: Pulumi.Output.t<array<ReventlessInfra.Adapter.resource>>}
|
|
23
|
+
type runnerMaker<'api> = (
|
|
24
|
+
~name: string,
|
|
25
|
+
~api: 'api,
|
|
26
|
+
~fullQualifiedStackName: fullQualifiedStackName,
|
|
27
|
+
~reventlessCiSecretUrn: string,
|
|
28
|
+
~secretUrns: array<string>,
|
|
29
|
+
~opts: Pulumi.CustomResourceOptions.t=?,
|
|
30
|
+
) => runner
|
|
31
|
+
|
|
32
|
+
module type Runner = {
|
|
33
|
+
type api
|
|
34
|
+
|
|
35
|
+
let make: runnerMaker<api>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let noRunner = {resources: []->Pulumi.Output.make}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module Make = (Runner: Adapter.Runner): (T with type api = Runner.api) => {
|
|
42
|
+
type api = Runner.api
|
|
43
|
+
let construct = (~api: Runner.api, self, name) => {
|
|
44
|
+
let opts = {Pulumi.CustomResourceOptions.parent: self->Component.toPulumiResource}
|
|
45
|
+
|
|
46
|
+
let fullQualifiedStackName = {
|
|
47
|
+
organization: Env.pulumiOrganization->Option.getOr("NO_ORGANIZATION"),
|
|
48
|
+
project: Pulumi.Pulumi.getProjectName(),
|
|
49
|
+
stack: Pulumi.Pulumi.getStackName(),
|
|
50
|
+
}
|
|
51
|
+
let secretsConfig = Pulumi.Config.make(Some("secrets"))
|
|
52
|
+
let secretUrns =
|
|
53
|
+
["aws", "pulumi", "repository"]->Array.map(str => Pulumi.Config.get(secretsConfig, str))
|
|
54
|
+
let reventlessCiSecretUrn = secretsConfig->Pulumi.Config.get("reventless-ci")
|
|
55
|
+
|
|
56
|
+
let runner = switch (secretUrns, reventlessCiSecretUrn) {
|
|
57
|
+
| ([Some(aws), Some(pulumi), Some(repository)], Some(reventlessCiSecretUrn)) =>
|
|
58
|
+
Runner.make(
|
|
59
|
+
~name,
|
|
60
|
+
~api,
|
|
61
|
+
~fullQualifiedStackName,
|
|
62
|
+
~reventlessCiSecretUrn,
|
|
63
|
+
~secretUrns=[aws, pulumi, repository],
|
|
64
|
+
~opts,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
| _ =>
|
|
68
|
+
log.info(
|
|
69
|
+
~comp="Cloner",
|
|
70
|
+
"No ClonerRunner created because no secrets are configured in Pulumi config !",
|
|
71
|
+
)
|
|
72
|
+
Adapter.noRunner
|
|
73
|
+
}
|
|
74
|
+
self->Component.setOutputs({resources: runner.resources})
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let make = (~api: Runner.api, ~opts=?) =>
|
|
78
|
+
Component.make(
|
|
79
|
+
~componentType=componentType->ComponentType.toString,
|
|
80
|
+
~name=componentType->ComponentType.toString,
|
|
81
|
+
~construct=construct(~api, ...),
|
|
82
|
+
~opts,
|
|
83
|
+
)
|
|
84
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
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 Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
6
|
+
import * as Logger$ReventlessCore from "../util/Logger.res.mjs";
|
|
7
|
+
import * as Component$ReventlessCore from "./Component.res.mjs";
|
|
8
|
+
import * as ComponentType$ReventlessCore from "../ComponentType.res.mjs";
|
|
9
|
+
|
|
10
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
11
|
+
|
|
12
|
+
let noRunner = {
|
|
13
|
+
resources: Pulumi.output([])
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
let Adapter = {
|
|
17
|
+
noRunner: noRunner
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function Make(Runner) {
|
|
21
|
+
let make = (api, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString("Cloner"), ComponentType$ReventlessCore.toString("Cloner"), (extra, extra$1) => {
|
|
22
|
+
let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
|
|
23
|
+
let opts = {
|
|
24
|
+
parent: opts_parent
|
|
25
|
+
};
|
|
26
|
+
let fullQualifiedStackName_organization = Stdlib_Option.getOr(process.env.PULUMI_ORGANIZATION, "NO_ORGANIZATION");
|
|
27
|
+
let fullQualifiedStackName_project = Pulumi.getProject();
|
|
28
|
+
let fullQualifiedStackName_stack = Pulumi.getStack();
|
|
29
|
+
let fullQualifiedStackName = {
|
|
30
|
+
organization: fullQualifiedStackName_organization,
|
|
31
|
+
project: fullQualifiedStackName_project,
|
|
32
|
+
stack: fullQualifiedStackName_stack
|
|
33
|
+
};
|
|
34
|
+
let secretsConfig = new Pulumi.Config("secrets");
|
|
35
|
+
let secretUrns = [
|
|
36
|
+
"aws",
|
|
37
|
+
"pulumi",
|
|
38
|
+
"repository"
|
|
39
|
+
].map(str => secretsConfig.get(str));
|
|
40
|
+
let reventlessCiSecretUrn = secretsConfig.get("reventless-ci");
|
|
41
|
+
let runner;
|
|
42
|
+
let exit = 0;
|
|
43
|
+
if (secretUrns.length !== 3) {
|
|
44
|
+
exit = 1;
|
|
45
|
+
} else {
|
|
46
|
+
let aws = secretUrns[0];
|
|
47
|
+
if (aws !== undefined) {
|
|
48
|
+
let pulumi = secretUrns[1];
|
|
49
|
+
if (pulumi !== undefined) {
|
|
50
|
+
let repository = secretUrns[2];
|
|
51
|
+
if (repository !== undefined && reventlessCiSecretUrn !== undefined) {
|
|
52
|
+
runner = Runner.make(extra$1, api, fullQualifiedStackName, Primitive_option.valFromOption(reventlessCiSecretUrn), [
|
|
53
|
+
aws,
|
|
54
|
+
pulumi,
|
|
55
|
+
repository
|
|
56
|
+
], opts);
|
|
57
|
+
} else {
|
|
58
|
+
exit = 1;
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
exit = 1;
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
exit = 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (exit === 1) {
|
|
68
|
+
log.info("Cloner", undefined, "No ClonerRunner created because no secrets are configured in Pulumi config !");
|
|
69
|
+
runner = noRunner;
|
|
70
|
+
}
|
|
71
|
+
return Component$ReventlessCore.setOutputs(extra, {
|
|
72
|
+
resources: runner.resources
|
|
73
|
+
});
|
|
74
|
+
}, opts);
|
|
75
|
+
return {
|
|
76
|
+
make: make
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let componentType = "Cloner";
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
log,
|
|
84
|
+
componentType,
|
|
85
|
+
Adapter,
|
|
86
|
+
Make,
|
|
87
|
+
}
|
|
88
|
+
/* log Not a pure module */
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
let componentType = ComponentType.CommandGenerator
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
Resolver-supplied arguments for a command invocation.
|
|
5
|
+
|
|
6
|
+
The `id` field is the envelope id for the produced command message:
|
|
7
|
+
- For **Aggregates**, it is required — the resolver populates it from the
|
|
8
|
+
GraphQL `id: ID!` argument injected into the mutation SDL.
|
|
9
|
+
- For **DCB StateChangeSlices**, it is optional. When the resolver does not
|
|
10
|
+
supply one, `makeGenerateCommand` derives the envelope id from the command's
|
|
11
|
+
`@partitionTag` / `@compositePartitionTag` field(s) using the same helpers
|
|
12
|
+
the slice itself uses for its decision-model partition key, so envelope id
|
|
13
|
+
and slice partition key share one source of truth.
|
|
14
|
+
*/
|
|
15
|
+
type arguments = {id: string}
|
|
16
|
+
type meta = {ip: array<string>, user: string, info: string}
|
|
17
|
+
type payload = {
|
|
18
|
+
command: string,
|
|
19
|
+
arguments: arguments,
|
|
20
|
+
meta: meta,
|
|
21
|
+
identity: Reventless.Identity.t,
|
|
22
|
+
}
|
|
23
|
+
external asPayload: 'a => payload = "%identity"
|
|
24
|
+
type event = {meta?: meta}
|
|
25
|
+
external asEvent: 'a => event = "%identity"
|
|
26
|
+
|
|
27
|
+
let metaInfo = event => (event->asEvent).meta->Option.map(({info}) => info)
|
|
28
|
+
|
|
29
|
+
type commandGenerator = payload => Effect.t<CommandTopic.commandOutcome, unit, unit>
|
|
30
|
+
type effectEventHandler<'context> = Runtime.effectHandler<payload, 'context, CommandTopic.commandOutcome, unit>
|
|
31
|
+
|
|
32
|
+
type publishJsons = CommandTopic.publishJsons
|
|
33
|
+
|
|
34
|
+
type t
|
|
35
|
+
type outputs = ReventlessInfra.CommandGenerator.outputs
|
|
36
|
+
type component = Component.t<t, outputs, unit>
|
|
37
|
+
|
|
38
|
+
module type T = {
|
|
39
|
+
type api
|
|
40
|
+
type runtimeParts
|
|
41
|
+
let connect: (
|
|
42
|
+
~api: api,
|
|
43
|
+
~resources: array<ReventlessInfra.Adapter.resource>,
|
|
44
|
+
~runtime: Runtime.environment<runtimeParts>,
|
|
45
|
+
component,
|
|
46
|
+
) => unit
|
|
47
|
+
|
|
48
|
+
let makeHandler: (
|
|
49
|
+
~publishJsons: publishJsons,
|
|
50
|
+
~publishJsonsAndWait: option<CommandTopic.publishJsonsAndWait>,
|
|
51
|
+
) => Pulumi.Output.t<effectEventHandler<'context>>
|
|
52
|
+
|
|
53
|
+
let make: (~name: string, ~opts: Pulumi.ComponentResource.options=?) => component
|
|
54
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
|
+
|
|
5
|
+
function metaInfo(event) {
|
|
6
|
+
return Stdlib_Option.map(event.meta, param => param.info);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let componentType = "CommandGenerator";
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
componentType,
|
|
13
|
+
metaInfo,
|
|
14
|
+
}
|
|
15
|
+
/* No side effect */
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type resolvers = {resources: array<ReventlessInfra.Adapter.resource>}
|
|
2
|
+
|
|
3
|
+
type resolversMaker<'api, 'runtimeParts> = (
|
|
4
|
+
~name: string,
|
|
5
|
+
~api: 'api,
|
|
6
|
+
~fields: array<string>,
|
|
7
|
+
~commandSchema: S.t<unknown>,
|
|
8
|
+
~runtime: Runtime.environment<'runtimeParts>,
|
|
9
|
+
~resources: array<ReventlessInfra.Adapter.resource>,
|
|
10
|
+
~opts: Pulumi.ComponentResource.options,
|
|
11
|
+
) => resolvers
|
|
12
|
+
|
|
13
|
+
module type Resolvers = {
|
|
14
|
+
type api
|
|
15
|
+
type runtimeParts
|
|
16
|
+
|
|
17
|
+
let handleResolversEvent: CommandGenerator.commandGenerator => Pulumi.Output.t<
|
|
18
|
+
Runtime.effectHandler<CommandGenerator.payload, 'context, CommandTopic.commandOutcome, unit>,
|
|
19
|
+
>
|
|
20
|
+
|
|
21
|
+
let make: resolversMaker<api, runtimeParts>
|
|
22
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
module Make = (
|
|
2
|
+
Spec: Reventless.Aggregate.Spec,
|
|
3
|
+
Resolvers: CommandGenerator_Adapter.Resolvers,
|
|
4
|
+
): (
|
|
5
|
+
CommandGenerator.T with type runtimeParts := Resolvers.runtimeParts and type api := Resolvers.api
|
|
6
|
+
) => {
|
|
7
|
+
let construct = (self, _name) => {
|
|
8
|
+
let resources = Plugin_Helpers.aggregateMutationFieldsRegistry->Dict.get(Spec.name)->Option.getOr([])->Array.map(field => {
|
|
9
|
+
let r: ReventlessInfra.Adapter.resource = {
|
|
10
|
+
id: ""->Pulumi.Output.make,
|
|
11
|
+
resourceInfo: ReventlessInfra.Adapter.ApiResolver({typeName: "Mutation", fieldName: field})->Pulumi.Output.make,
|
|
12
|
+
name: ""->Pulumi.Output.make,
|
|
13
|
+
urn: ""->Pulumi.Output.make,
|
|
14
|
+
service: ""->Pulumi.Output.make,
|
|
15
|
+
role: "commandGenerator"->Pulumi.Output.make,
|
|
16
|
+
region: ""->Pulumi.Output.make,
|
|
17
|
+
resourceType: ""->Pulumi.Output.make,
|
|
18
|
+
configuration: Dict.make()->Pulumi.Output.make,
|
|
19
|
+
tags: Dict.make()->Pulumi.Output.make,
|
|
20
|
+
}
|
|
21
|
+
r
|
|
22
|
+
})
|
|
23
|
+
let outputs: CommandGenerator.outputs = {resources: resources}
|
|
24
|
+
let _ = self->Component.setOutputs(outputs)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let connect = (~api: Resolvers.api, ~resources, ~runtime, commandGenerator) => {
|
|
28
|
+
let commandGeneratorResource = commandGenerator->Component.toPulumiResource
|
|
29
|
+
let name =
|
|
30
|
+
commandGeneratorResource.name
|
|
31
|
+
->Option.getOr("Unnamed")
|
|
32
|
+
->ComponentType.name(CommandGenerator.componentType)
|
|
33
|
+
let opts = {Pulumi.ComponentResource.parent: commandGeneratorResource}
|
|
34
|
+
|
|
35
|
+
let fields = Plugin_Helpers.aggregateMutationFieldsRegistry->Dict.get(Spec.name)->Option.getOr([])
|
|
36
|
+
|
|
37
|
+
let resolvers = Resolvers.make(
|
|
38
|
+
~name,
|
|
39
|
+
~api,
|
|
40
|
+
~fields,
|
|
41
|
+
~commandSchema=Spec.commandSchema->S.castToUnknown,
|
|
42
|
+
~runtime,
|
|
43
|
+
~resources,
|
|
44
|
+
~opts,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
let cgOutputs: CommandGenerator.outputs = {resources: resolvers.resources}
|
|
48
|
+
let _ = commandGenerator->Component.setOutputs(cgOutputs)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let makeHandler = (~publishJsons, ~publishJsonsAndWait: option<CommandTopic.publishJsonsAndWait>) => {
|
|
52
|
+
module Callback = CommandGenerator_Callback.Make(
|
|
53
|
+
{
|
|
54
|
+
let publishJsons = publishJsons
|
|
55
|
+
let publishJsonsAndWait = publishJsonsAndWait
|
|
56
|
+
},
|
|
57
|
+
Spec,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
Resolvers.handleResolversEvent(Callback.generateCommand)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let make = (~name, ~opts=?): CommandGenerator.component =>
|
|
64
|
+
Component.make(
|
|
65
|
+
~componentType=CommandGenerator.componentType->ComponentType.toString,
|
|
66
|
+
~name,
|
|
67
|
+
~construct,
|
|
68
|
+
~opts,
|
|
69
|
+
)
|
|
70
|
+
}
|