@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,195 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Stream from "effect/Stream";
|
|
7
|
+
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
8
|
+
import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
|
|
9
|
+
|
|
10
|
+
let acceptedResultChannel = {
|
|
11
|
+
contents: undefined
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
let rejectedResultChannel = {
|
|
15
|
+
contents: undefined
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function reportAccepted(reference, result) {
|
|
19
|
+
Stdlib_Option.forEach(acceptedResultChannel.contents, cb => cb(reference, result));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function reportRejected(reference, result) {
|
|
23
|
+
Stdlib_Option.forEach(rejectedResultChannel.contents, cb => cb(reference, result));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function commandOutcomeToJson(outcome) {
|
|
27
|
+
switch (outcome.TAG) {
|
|
28
|
+
case "Accepted" :
|
|
29
|
+
return Object.fromEntries([
|
|
30
|
+
[
|
|
31
|
+
"__typename",
|
|
32
|
+
"CommandAccepted"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"msgId",
|
|
36
|
+
outcome.msgId
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"entityId",
|
|
40
|
+
Stdlib_Option.getOr(Stdlib_Option.map(outcome.entityId, id => (id)), null)
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"eventCount",
|
|
44
|
+
outcome.eventCount
|
|
45
|
+
]
|
|
46
|
+
]);
|
|
47
|
+
case "Rejected" :
|
|
48
|
+
return Object.fromEntries([
|
|
49
|
+
[
|
|
50
|
+
"__typename",
|
|
51
|
+
"CommandRejected"
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"msgId",
|
|
55
|
+
outcome.msgId
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
"errorCode",
|
|
59
|
+
outcome.errorCode
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
"errorDetail",
|
|
63
|
+
Stdlib_Option.getOr(Stdlib_Option.map(outcome.errorDetail, s => (s)), null)
|
|
64
|
+
]
|
|
65
|
+
]);
|
|
66
|
+
case "Pending" :
|
|
67
|
+
return Object.fromEntries([
|
|
68
|
+
[
|
|
69
|
+
"__typename",
|
|
70
|
+
"CommandPending"
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"msgId",
|
|
74
|
+
outcome.msgId
|
|
75
|
+
]
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function encodeCommandJson(cmdJson) {
|
|
81
|
+
return Object.fromEntries([
|
|
82
|
+
[
|
|
83
|
+
"id",
|
|
84
|
+
cmdJson.id
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
"meta",
|
|
88
|
+
S.reverseConvertToJsonOrThrow(cmdJson.meta, Message$Reventless.metaSchema)
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
"command",
|
|
92
|
+
cmdJson.commandJson
|
|
93
|
+
]
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function runInlineAndCollect(jsons, handleCmds) {
|
|
98
|
+
let items = jsons.map(cmdJson => {
|
|
99
|
+
let reference = cmdJson.meta.msgId;
|
|
100
|
+
return {
|
|
101
|
+
command: encodeCommandJson(cmdJson),
|
|
102
|
+
reference: reference
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
let acceptedResults = {};
|
|
106
|
+
let rejectedResults = {};
|
|
107
|
+
acceptedResultChannel.contents = (reference, result) => {
|
|
108
|
+
acceptedResults[reference] = result;
|
|
109
|
+
};
|
|
110
|
+
rejectedResultChannel.contents = (reference, result) => {
|
|
111
|
+
rejectedResults[reference] = result;
|
|
112
|
+
};
|
|
113
|
+
let results = await Effect.runPromise(handleCmds(Stream.fromIterable(items)));
|
|
114
|
+
acceptedResultChannel.contents = undefined;
|
|
115
|
+
rejectedResultChannel.contents = undefined;
|
|
116
|
+
return jsons.map((cmdJson, i) => {
|
|
117
|
+
let msgId = cmdJson.meta.msgId;
|
|
118
|
+
let match = rejectedResults[msgId];
|
|
119
|
+
if (match !== undefined) {
|
|
120
|
+
let errorDetail = match.errorDetail;
|
|
121
|
+
let detail = errorDetail === "" ? undefined : errorDetail;
|
|
122
|
+
return {
|
|
123
|
+
TAG: "Rejected",
|
|
124
|
+
msgId: msgId,
|
|
125
|
+
errorCode: match.errorCode,
|
|
126
|
+
errorDetail: detail
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
let match$1 = results[i];
|
|
130
|
+
if (match$1 !== undefined && match$1.TAG !== "Ok") {
|
|
131
|
+
return {
|
|
132
|
+
TAG: "Rejected",
|
|
133
|
+
msgId: msgId,
|
|
134
|
+
errorCode: "Conflict",
|
|
135
|
+
errorDetail: match$1._0
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
let ar = Stdlib_Option.getOr(acceptedResults[msgId], {
|
|
139
|
+
eventCount: 0
|
|
140
|
+
});
|
|
141
|
+
let entityId = ar.entityId;
|
|
142
|
+
if (entityId !== undefined) {
|
|
143
|
+
return {
|
|
144
|
+
TAG: "Accepted",
|
|
145
|
+
msgId: msgId,
|
|
146
|
+
entityId: entityId,
|
|
147
|
+
eventCount: ar.eventCount
|
|
148
|
+
};
|
|
149
|
+
} else {
|
|
150
|
+
return {
|
|
151
|
+
TAG: "Accepted",
|
|
152
|
+
msgId: msgId,
|
|
153
|
+
eventCount: ar.eventCount
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function callHandlerWithArray(handler, items) {
|
|
160
|
+
return Effect.runPromise(handler(Stream.fromIterable(items)));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
let extractTypeNamesFromSchema = DcbTag$Reventless.extractAllVariantNames;
|
|
164
|
+
|
|
165
|
+
let globalRegistry = {};
|
|
166
|
+
|
|
167
|
+
function registerHandler(schema, handler, typeNames) {
|
|
168
|
+
typeNames.forEach(typeName => {
|
|
169
|
+
let existing = Stdlib_Option.getOr(globalRegistry[typeName], []);
|
|
170
|
+
globalRegistry[typeName] = existing.concat([{
|
|
171
|
+
schema: schema,
|
|
172
|
+
handler: handler
|
|
173
|
+
}]);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function getHandlers(typeName) {
|
|
178
|
+
return Stdlib_Option.getOr(globalRegistry[typeName], []);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export {
|
|
182
|
+
acceptedResultChannel,
|
|
183
|
+
rejectedResultChannel,
|
|
184
|
+
reportAccepted,
|
|
185
|
+
reportRejected,
|
|
186
|
+
commandOutcomeToJson,
|
|
187
|
+
encodeCommandJson,
|
|
188
|
+
runInlineAndCollect,
|
|
189
|
+
callHandlerWithArray,
|
|
190
|
+
extractTypeNamesFromSchema,
|
|
191
|
+
globalRegistry,
|
|
192
|
+
registerHandler,
|
|
193
|
+
getHandlers,
|
|
194
|
+
}
|
|
195
|
+
/* S Not a pure module */
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module type Ops = {
|
|
2
|
+
let publishJsons: CommandTopic.publishJsons
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
module Make = (Spec: ReventlessInfra.CommandTopic.T, Ops: Ops) => {
|
|
6
|
+
let comp = `CommandTopic(${Spec.name})`
|
|
7
|
+
|
|
8
|
+
let publishJsons = async cmdJsons => {
|
|
9
|
+
let count = cmdJsons->Array.length->Int.toString
|
|
10
|
+
cmdJsons->Array.forEachWithIndex((cmdJson, idx) => {
|
|
11
|
+
let idxStr = (idx + 1)->Int.toString
|
|
12
|
+
EffectLogger.logInfo(
|
|
13
|
+
~comp,
|
|
14
|
+
~detail=cmdJson.Message.commandJson,
|
|
15
|
+
`publishing command ${idxStr}/${count}: ${LogFormat.cmdDetailNoId(cmdJson)}`,
|
|
16
|
+
)->Effect.runSync
|
|
17
|
+
})
|
|
18
|
+
try {await Ops.publishJsons(cmdJsons)} catch {
|
|
19
|
+
| exn =>
|
|
20
|
+
cmdJsons->Array.forEachWithIndex((cmdJson, idx) => {
|
|
21
|
+
let idxStr = (idx + 1)->Int.toString
|
|
22
|
+
EffectLogger.logError(
|
|
23
|
+
~comp,
|
|
24
|
+
~detail=cmdJson.Message.commandJson,
|
|
25
|
+
`publish failed ${idxStr}/${count}: ${LogFormat.cmdDetailNoId(cmdJson)}`,
|
|
26
|
+
)->Effect.runSync
|
|
27
|
+
})
|
|
28
|
+
throw(exn)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let publish = (command': Message.command'<Spec.Id.t, Spec.command>) => {
|
|
33
|
+
let commandJson = {
|
|
34
|
+
Message.id: command'.id->Spec.Id.toString,
|
|
35
|
+
meta: command'.meta,
|
|
36
|
+
commandJson: command'.command->Message.encode(Spec.commandSchema),
|
|
37
|
+
}
|
|
38
|
+
Ops.publishJsons([commandJson])
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Message$ReventlessCore from "../../Message.res.mjs";
|
|
5
|
+
import * as LogFormat$ReventlessCore from "../../util/LogFormat.res.mjs";
|
|
6
|
+
import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
|
|
7
|
+
|
|
8
|
+
function Make(Spec) {
|
|
9
|
+
return Ops => {
|
|
10
|
+
let comp = `CommandTopic(` + Spec.name + `)`;
|
|
11
|
+
let publishJsons = async cmdJsons => {
|
|
12
|
+
let count = cmdJsons.length.toString();
|
|
13
|
+
cmdJsons.forEach((cmdJson, idx) => {
|
|
14
|
+
let idxStr = (idx + 1 | 0).toString();
|
|
15
|
+
Effect.runSync(EffectLogger$ReventlessCore.logInfo(comp, cmdJson.commandJson, `publishing command ` + idxStr + `/` + count + `: ` + LogFormat$ReventlessCore.cmdDetailNoId(cmdJson)));
|
|
16
|
+
});
|
|
17
|
+
try {
|
|
18
|
+
return await Ops.publishJsons(cmdJsons);
|
|
19
|
+
} catch (exn) {
|
|
20
|
+
cmdJsons.forEach((cmdJson, idx) => {
|
|
21
|
+
let idxStr = (idx + 1 | 0).toString();
|
|
22
|
+
Effect.runSync(EffectLogger$ReventlessCore.logError(comp, cmdJson.commandJson, `publish failed ` + idxStr + `/` + count + `: ` + LogFormat$ReventlessCore.cmdDetailNoId(cmdJson)));
|
|
23
|
+
});
|
|
24
|
+
throw exn;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
let publish = command$p => {
|
|
28
|
+
let commandJson_id = Spec.Id.toString(command$p.id);
|
|
29
|
+
let commandJson_meta = command$p.meta;
|
|
30
|
+
let commandJson_commandJson = Message$ReventlessCore.encode(command$p.command, Spec.commandSchema);
|
|
31
|
+
let commandJson = {
|
|
32
|
+
id: commandJson_id,
|
|
33
|
+
meta: commandJson_meta,
|
|
34
|
+
commandJson: commandJson_commandJson
|
|
35
|
+
};
|
|
36
|
+
return Ops.publishJsons([commandJson]);
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
comp: comp,
|
|
40
|
+
publishJsons: publishJsons,
|
|
41
|
+
publish: publish
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
Make,
|
|
48
|
+
}
|
|
49
|
+
/* effect/Effect Not a pure module */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include ReventlessInfra.Component
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Component$ReventlessInfra from "@reventlessdev/reventless-infra/src/components/Component.res.mjs";
|
|
4
|
+
|
|
5
|
+
let registerOutputs = Component$ReventlessInfra.registerOutputs;
|
|
6
|
+
|
|
7
|
+
let setOutputs = Component$ReventlessInfra.setOutputs;
|
|
8
|
+
|
|
9
|
+
let outputs = Component$ReventlessInfra.outputs;
|
|
10
|
+
|
|
11
|
+
let wrappedOutputs = Component$ReventlessInfra.wrappedOutputs;
|
|
12
|
+
|
|
13
|
+
let setOperations = Component$ReventlessInfra.setOperations;
|
|
14
|
+
|
|
15
|
+
let operations = Component$ReventlessInfra.operations;
|
|
16
|
+
|
|
17
|
+
let toPulumiResource = Component$ReventlessInfra.toPulumiResource;
|
|
18
|
+
|
|
19
|
+
let fromPulumiResource = Component$ReventlessInfra.fromPulumiResource;
|
|
20
|
+
|
|
21
|
+
let make = Component$ReventlessInfra.make;
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
registerOutputs,
|
|
25
|
+
setOutputs,
|
|
26
|
+
outputs,
|
|
27
|
+
wrappedOutputs,
|
|
28
|
+
setOperations,
|
|
29
|
+
operations,
|
|
30
|
+
toPulumiResource,
|
|
31
|
+
fromPulumiResource,
|
|
32
|
+
make,
|
|
33
|
+
}
|
|
34
|
+
/* Component-ReventlessInfra Not a pure module */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include module type of ReventlessInfra.Component
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
let componentType = ComponentType.Counter
|
|
2
|
+
|
|
3
|
+
type countItem = ReventlessInfra.Counter.countItem
|
|
4
|
+
type counterTargetRef = ReventlessInfra.Counter.counterTargetRef
|
|
5
|
+
|
|
6
|
+
type count = ReventlessInfra.Counter.count
|
|
7
|
+
type addToCounterTarget = ReventlessInfra.Counter.addToCounterTarget
|
|
8
|
+
|
|
9
|
+
type jsonEventsHandler = Stream.t<JSON.t, string, unit> => Effect.t<unit, string, unit>
|
|
10
|
+
|
|
11
|
+
type t
|
|
12
|
+
type outputs = ReventlessInfra.Counter.outputs
|
|
13
|
+
type operations = ReventlessInfra.Counter.operations
|
|
14
|
+
type component = Component.t<t, outputs, operations>
|
|
15
|
+
|
|
16
|
+
type action =
|
|
17
|
+
| Count(countItem)
|
|
18
|
+
| AddToCounterTarget(counterTargetRef)
|
|
19
|
+
|
|
20
|
+
@schema
|
|
21
|
+
type counterEvent = CountFinished
|
|
22
|
+
|
|
23
|
+
module Source = {
|
|
24
|
+
module Id = Reventless.Id.String
|
|
25
|
+
let name = ComponentType.Counter->ComponentType.toName
|
|
26
|
+
@schema
|
|
27
|
+
type event = counterEvent
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module type T = ReventlessInfra.Counter.T
|
|
31
|
+
|
|
32
|
+
let separator = "#"
|
|
33
|
+
let makeId = ((counterId, reference)) => counterId ++ (separator ++ reference)
|
|
34
|
+
let unmakeId = id =>
|
|
35
|
+
id
|
|
36
|
+
->String.split(separator)
|
|
37
|
+
->(
|
|
38
|
+
x =>
|
|
39
|
+
switch x {
|
|
40
|
+
| [] => ("", "")
|
|
41
|
+
| [counterId] => (counterId, "")
|
|
42
|
+
| parts => (parts->Array.getUnsafe(0), parts->Array.getUnsafe(1))
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
@inline
|
|
47
|
+
let countFieldName = "count"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
5
|
+
|
|
6
|
+
let counterEventSchema = S.literal("CountFinished");
|
|
7
|
+
|
|
8
|
+
let name = ComponentType$ReventlessCore.toName("Counter");
|
|
9
|
+
|
|
10
|
+
let Source = {
|
|
11
|
+
Id: undefined,
|
|
12
|
+
name: name,
|
|
13
|
+
eventSchema: counterEventSchema
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
let separator = "#";
|
|
17
|
+
|
|
18
|
+
function makeId(param) {
|
|
19
|
+
return param[0] + (separator + param[1]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function unmakeId(id) {
|
|
23
|
+
let x = id.split(separator);
|
|
24
|
+
let len = x.length;
|
|
25
|
+
if (len !== 1) {
|
|
26
|
+
if (len !== 0) {
|
|
27
|
+
return [
|
|
28
|
+
x[0],
|
|
29
|
+
x[1]
|
|
30
|
+
];
|
|
31
|
+
} else {
|
|
32
|
+
return [
|
|
33
|
+
"",
|
|
34
|
+
""
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
let counterId = x[0];
|
|
39
|
+
return [
|
|
40
|
+
counterId,
|
|
41
|
+
""
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let componentType = "Counter";
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
componentType,
|
|
49
|
+
counterEventSchema,
|
|
50
|
+
Source,
|
|
51
|
+
separator,
|
|
52
|
+
makeId,
|
|
53
|
+
unmakeId,
|
|
54
|
+
}
|
|
55
|
+
/* counterEventSchema Not a pure module */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type handler = {addToCounterTarget: Counter.addToCounterTarget}
|
|
2
|
+
|
|
3
|
+
type handlerMaker = (
|
|
4
|
+
~name: string,
|
|
5
|
+
~referencesName: string,
|
|
6
|
+
~referencesDb: QueryDb.outputs,
|
|
7
|
+
~countsName: string,
|
|
8
|
+
~countsDb: QueryDb.outputs,
|
|
9
|
+
~counterHandler: Counter_Callback.counterHandler,
|
|
10
|
+
~specModulePath: string,
|
|
11
|
+
~mappingsModulePath: string,
|
|
12
|
+
~publishChannelId: Pulumi.Output.t<string>,
|
|
13
|
+
~opts: Pulumi.CustomResourceOptions.t,
|
|
14
|
+
) => handler
|
|
15
|
+
|
|
16
|
+
module type Handler = {
|
|
17
|
+
let make: handlerMaker
|
|
18
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
module Make = (
|
|
2
|
+
QueryDbStorage: QueryDb_Adapter.Storage,
|
|
3
|
+
Api: {
|
|
4
|
+
let api: unit => QueryDbStorage.api
|
|
5
|
+
let apiRole: unit => QueryDbStorage.role
|
|
6
|
+
},
|
|
7
|
+
Handler: Counter_Adapter.Handler,
|
|
8
|
+
): Counter.T => {
|
|
9
|
+
type component = Counter.component
|
|
10
|
+
|
|
11
|
+
let construct = (
|
|
12
|
+
~jsonEventsHandler: Counter.jsonEventsHandler,
|
|
13
|
+
~ttl: option<int>,
|
|
14
|
+
~specModulePath,
|
|
15
|
+
~mappingsModulePath,
|
|
16
|
+
~publishChannelId,
|
|
17
|
+
self,
|
|
18
|
+
name,
|
|
19
|
+
) => {
|
|
20
|
+
let opts = {Pulumi.ComponentResource.parent: self->Component.toPulumiResource}
|
|
21
|
+
let opts2 = {Pulumi.CustomResourceOptions.parent: self->Component.toPulumiResource}
|
|
22
|
+
|
|
23
|
+
module ReferencesSpec = {
|
|
24
|
+
module Id = Reventless.Id.StringPure
|
|
25
|
+
let name = name ++ "References"
|
|
26
|
+
let moduleUrl: string = %raw(`import.meta.url`)
|
|
27
|
+
@schema
|
|
28
|
+
type state = Counter_Operations.referencesState
|
|
29
|
+
|
|
30
|
+
let subIdConfig = None
|
|
31
|
+
let config = Reventless.ReadModel.config()
|
|
32
|
+
let authorization: Reventless.Authorization.permission = AllowAuthenticated
|
|
33
|
+
let visibility: Reventless.Visibility.t = Public
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module ReferencesDb = QueryDb_Builder.Make(
|
|
37
|
+
ReferencesSpec,
|
|
38
|
+
QueryDbStorage,
|
|
39
|
+
QueryDb_Adapter.NoResolvers(QueryDbStorage),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
module CountsSpec = {
|
|
43
|
+
module Id = Reventless.Id.StringPure
|
|
44
|
+
let name = name ++ "Counts"
|
|
45
|
+
let moduleUrl: string = %raw(`import.meta.url`)
|
|
46
|
+
@schema
|
|
47
|
+
type state = Counter_Callback.countsState
|
|
48
|
+
|
|
49
|
+
let subIdConfig = None
|
|
50
|
+
let config = Reventless.ReadModel.config()
|
|
51
|
+
let authorization: Reventless.Authorization.permission = AllowAuthenticated
|
|
52
|
+
let visibility: Reventless.Visibility.t = Public
|
|
53
|
+
}
|
|
54
|
+
module CountsDb = QueryDb_Builder.Make(
|
|
55
|
+
CountsSpec,
|
|
56
|
+
QueryDbStorage,
|
|
57
|
+
QueryDb_Adapter.NoResolvers(QueryDbStorage),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
let referencesDb = ReferencesDb.make(
|
|
61
|
+
~api=Api.api(),
|
|
62
|
+
~apiRole=Api.apiRole(),
|
|
63
|
+
~ttl?,
|
|
64
|
+
~opts,
|
|
65
|
+
)
|
|
66
|
+
let countsDb = CountsDb.make(~api=Api.api(), ~apiRole=Api.apiRole(), ~ttl?, ~opts)
|
|
67
|
+
|
|
68
|
+
let handler =
|
|
69
|
+
countsDb
|
|
70
|
+
->Component.operations
|
|
71
|
+
->Pulumi.Output.apply(({count}) => {
|
|
72
|
+
module Callback = Counter_Callback.Make({
|
|
73
|
+
let name = name
|
|
74
|
+
let countsDbCount = count
|
|
75
|
+
let jsonEventsHandler = jsonEventsHandler
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
Handler.make(
|
|
79
|
+
~name,
|
|
80
|
+
~referencesName=ReferencesSpec.name,
|
|
81
|
+
~referencesDb=referencesDb->Component.outputs,
|
|
82
|
+
~countsName=CountsSpec.name,
|
|
83
|
+
~countsDb=countsDb->Component.outputs,
|
|
84
|
+
~counterHandler=Callback.counterHandler,
|
|
85
|
+
~specModulePath,
|
|
86
|
+
~mappingsModulePath,
|
|
87
|
+
~publishChannelId,
|
|
88
|
+
~opts=opts2,
|
|
89
|
+
)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
self->Component.setOperations(
|
|
93
|
+
(referencesDb->Component.operations, handler)
|
|
94
|
+
->Pulumi.Output.all2
|
|
95
|
+
->Pulumi.Output.apply((({saveBatch}, handler)) => {
|
|
96
|
+
module Operations = Counter_Operations.Make({
|
|
97
|
+
let ttl = ttl
|
|
98
|
+
let saveBatch = saveBatch
|
|
99
|
+
})
|
|
100
|
+
let ops: Counter.operations = {
|
|
101
|
+
count: Operations.count,
|
|
102
|
+
addToCounterTarget: handler.addToCounterTarget,
|
|
103
|
+
}
|
|
104
|
+
ops
|
|
105
|
+
}),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
let outputs: Counter.outputs = {
|
|
109
|
+
referencesDb: referencesDb->Component.outputs,
|
|
110
|
+
countsDb: countsDb->Component.outputs,
|
|
111
|
+
}
|
|
112
|
+
self->Component.setOutputs(outputs)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
let oneWeek = 60 * 60 * 24 * 7 //604800 sec
|
|
116
|
+
|
|
117
|
+
let make = (
|
|
118
|
+
~name,
|
|
119
|
+
~jsonEventsHandler,
|
|
120
|
+
~ttl=oneWeek,
|
|
121
|
+
~specModulePath="",
|
|
122
|
+
~mappingsModulePath="",
|
|
123
|
+
~publishChannelId=Pulumi.Output.make(""),
|
|
124
|
+
~opts=?,
|
|
125
|
+
) =>
|
|
126
|
+
Component.make(
|
|
127
|
+
~componentType=Counter.componentType->ComponentType.toString,
|
|
128
|
+
~name=name->ComponentType.name(Counter.componentType),
|
|
129
|
+
~construct=construct(
|
|
130
|
+
~jsonEventsHandler,
|
|
131
|
+
~ttl=Some(ttl),
|
|
132
|
+
~specModulePath,
|
|
133
|
+
~mappingsModulePath,
|
|
134
|
+
~publishChannelId,
|
|
135
|
+
...
|
|
136
|
+
),
|
|
137
|
+
~opts,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
let outputs = Component.outputs
|
|
141
|
+
let operations = Component.operations
|
|
142
|
+
}
|