@reventlessdev/reventless-core 3.0.0-alpha.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1355 -0
- package/LICENSE +202 -0
- package/README.md +173 -0
- package/__mocks__/emptyModule.js +2 -0
- package/jest.setup.cjs +5 -0
- package/package.json +73 -0
- package/rescript.json +41 -0
- package/scripts/deploy.sh +6 -0
- package/scripts/post-deploy.sh +5 -0
- package/scripts/pre-deploy.sh +18 -0
- package/scripts/pulumi-up.sh +30 -0
- package/src/Behavior.res +18 -0
- package/src/Behavior.res.mjs +2 -0
- package/src/ComponentType.res +125 -0
- package/src/ComponentType.res.mjs +199 -0
- package/src/Env.res +5 -0
- package/src/Env.res.mjs +2 -0
- package/src/Mapper.res +36 -0
- package/src/Mapper.res.mjs +18 -0
- package/src/Mapper1toN.res +107 -0
- package/src/Mapper1toN.res.mjs +2 -0
- package/src/MapperNto1.res +78 -0
- package/src/MapperNto1.res.mjs +35 -0
- package/src/Message.res +353 -0
- package/src/Message.res.mjs +418 -0
- package/src/PluginRuntimeOperations.res +15 -0
- package/src/PluginRuntimeOperations.res.mjs +2 -0
- package/src/Projection.res +447 -0
- package/src/Projection.res.mjs +712 -0
- package/src/ProjectionMapper.res +44 -0
- package/src/ProjectionMapper.res.mjs +51 -0
- package/src/RequestContext.res +42 -0
- package/src/RequestContext.res.mjs +39 -0
- package/src/adapter/Adapter.res +178 -0
- package/src/adapter/Adapter.res.mjs +201 -0
- package/src/adapter/AdapterDeploytime.res +56 -0
- package/src/adapter/AdapterDeploytime.res.mjs +42 -0
- package/src/adapter/Auth/Auth_Adapter.res +42 -0
- package/src/adapter/Auth/Auth_Adapter.res.mjs +2 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder.res +22 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Common.res +259 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Common.res.mjs +190 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +92 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res.mjs +59 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +52 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res.mjs +49 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +64 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res.mjs +59 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder.res +11 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +46 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res.mjs +40 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +204 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res.mjs +150 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder.res +18 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +36 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res.mjs +28 -0
- package/src/adapter/Runtime/PluginRuntime_Builder.res +23 -0
- package/src/adapter/Runtime/PluginRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/PluginRuntime_Builder_Micro.res +97 -0
- package/src/adapter/Runtime/PluginRuntime_Builder_Micro.res.mjs +62 -0
- package/src/adapter/Runtime/PluginRuntime_Builder_Single.res +89 -0
- package/src/adapter/Runtime/PluginRuntime_Builder_Single.res.mjs +62 -0
- package/src/adapter/Runtime/Runtime.res +106 -0
- package/src/adapter/Runtime/Runtime.res.mjs +22 -0
- package/src/adapter/Runtime/TaskRuntime_Builder.res +32 -0
- package/src/adapter/Runtime/TaskRuntime_Builder.res.mjs +2 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +42 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res.mjs +29 -0
- package/src/admin/AdminApi.res +88 -0
- package/src/admin/AdminApi.res.mjs +89 -0
- package/src/admin/Admin_Callback.res +27 -0
- package/src/admin/Admin_Callback.res.mjs +20 -0
- package/src/admin/Platform_Admin.res +402 -0
- package/src/admin/Platform_Admin.res.mjs +250 -0
- package/src/admin/Platform_Admin_Structure.res +125 -0
- package/src/admin/Platform_Admin_Structure.res.mjs +182 -0
- package/src/admin/Platform_ComponentDefinitionsApi.res +160 -0
- package/src/admin/Platform_ComponentDefinitionsApi.res.mjs +299 -0
- package/src/admin/Platform_UIFragmentsApi.res +55 -0
- package/src/admin/Platform_UIFragmentsApi.res.mjs +124 -0
- package/src/admin/UIFragmentRegistryProjection.res +43 -0
- package/src/admin/UIFragmentRegistryProjection.res.mjs +81 -0
- package/src/admin/UIFragmentRegistryReadModelSpec.res +13 -0
- package/src/admin/UIFragmentRegistryReadModelSpec.res.mjs +40 -0
- package/src/components/Aggregate/Aggregate.res +96 -0
- package/src/components/Aggregate/Aggregate.res.mjs +82 -0
- package/src/components/Aggregate/Aggregate_Builder.res +175 -0
- package/src/components/Aggregate/Aggregate_Builder.res.mjs +119 -0
- package/src/components/Aggregate/Aggregate_Callback.res +273 -0
- package/src/components/Aggregate/Aggregate_Callback.res.mjs +208 -0
- package/src/components/Api/ApiAllowedStatesHelpers.res +19 -0
- package/src/components/Api/ApiAllowedStatesHelpers.res.mjs +16 -0
- package/src/components/Api/ApiNoApiHelpers.res +13 -0
- package/src/components/Api/ApiNoApiHelpers.res.mjs +29 -0
- package/src/components/Api/Api_Builder.res +40 -0
- package/src/components/Api/Api_Builder.res.mjs +33 -0
- package/src/components/Api/Api_Naming.res +92 -0
- package/src/components/Api/Api_Naming.res.mjs +103 -0
- package/src/components/Api/Api_Operations.res +13 -0
- package/src/components/Api/Api_Operations.res.mjs +12 -0
- package/src/components/Api/GraphQL_FragmentGenerator.res +612 -0
- package/src/components/Api/GraphQL_FragmentGenerator.res.mjs +503 -0
- package/src/components/Api/GraphQL_SchemaInspector.res +156 -0
- package/src/components/Api/GraphQL_SchemaInspector.res.mjs +123 -0
- package/src/components/Api/GraphQL_Stitcher.res +271 -0
- package/src/components/Api/GraphQL_Stitcher.res.mjs +229 -0
- package/src/components/Api/MCP_SchemaGenerator.res +185 -0
- package/src/components/Api/MCP_SchemaGenerator.res.mjs +146 -0
- package/src/components/Api/SchemaType.res +126 -0
- package/src/components/Api/SchemaType.res.mjs +143 -0
- package/src/components/Api/SuryToJsonSchema.res +142 -0
- package/src/components/Api/SuryToJsonSchema.res.mjs +210 -0
- package/src/components/AutomationSlice/AutomationSlice.res +39 -0
- package/src/components/AutomationSlice/AutomationSlice.res.mjs +24 -0
- package/src/components/AutomationSlice/AutomationSlice_Builder.res +207 -0
- package/src/components/AutomationSlice/AutomationSlice_Builder.res.mjs +123 -0
- package/src/components/AutomationSlice/AutomationSlice_Callback.res +212 -0
- package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +189 -0
- package/src/components/Builder_Helpers.res +196 -0
- package/src/components/Builder_Helpers.res.mjs +142 -0
- package/src/components/Cloner.res +84 -0
- package/src/components/Cloner.res.mjs +88 -0
- package/src/components/CommandGenerator/CommandGenerator.res +54 -0
- package/src/components/CommandGenerator/CommandGenerator.res.mjs +15 -0
- package/src/components/CommandGenerator/CommandGenerator_Adapter.res +22 -0
- package/src/components/CommandGenerator/CommandGenerator_Adapter.res.mjs +2 -0
- package/src/components/CommandGenerator/CommandGenerator_Builder.res +70 -0
- package/src/components/CommandGenerator/CommandGenerator_Builder.res.mjs +68 -0
- package/src/components/CommandGenerator/CommandGenerator_Callback.res +191 -0
- package/src/components/CommandGenerator/CommandGenerator_Callback.res.mjs +161 -0
- package/src/components/CommandTopic/CommandTopic.res +79 -0
- package/src/components/CommandTopic/CommandTopic.res.mjs +68 -0
- package/src/components/CommandTopic/CommandTopic_Adapter.res +53 -0
- package/src/components/CommandTopic/CommandTopic_Adapter.res.mjs +2 -0
- package/src/components/CommandTopic/CommandTopic_Builder.res +146 -0
- package/src/components/CommandTopic/CommandTopic_Builder.res.mjs +127 -0
- package/src/components/CommandTopic/CommandTopic_Callback.res +38 -0
- package/src/components/CommandTopic/CommandTopic_Callback.res.mjs +49 -0
- package/src/components/CommandTopic/CommandTopic_Helpers.res +176 -0
- package/src/components/CommandTopic/CommandTopic_Helpers.res.mjs +195 -0
- package/src/components/CommandTopic/CommandTopic_Operations.res +40 -0
- package/src/components/CommandTopic/CommandTopic_Operations.res.mjs +49 -0
- package/src/components/Component.res +1 -0
- package/src/components/Component.res.mjs +34 -0
- package/src/components/Component.resi +1 -0
- package/src/components/Counter/Counter.res +47 -0
- package/src/components/Counter/Counter.res.mjs +55 -0
- package/src/components/Counter/Counter_Adapter.res +18 -0
- package/src/components/Counter/Counter_Adapter.res.mjs +2 -0
- package/src/components/Counter/Counter_Builder.res +142 -0
- package/src/components/Counter/Counter_Builder.res.mjs +112 -0
- package/src/components/Counter/Counter_Callback.res +94 -0
- package/src/components/Counter/Counter_Callback.res.mjs +70 -0
- package/src/components/Counter/Counter_Operations.res +70 -0
- package/src/components/Counter/Counter_Operations.res.mjs +91 -0
- package/src/components/Dcb/Dcb_Builder.res +971 -0
- package/src/components/Dcb/Dcb_Builder.res.mjs +572 -0
- package/src/components/DcbEventLog/DcbEventLog.res +43 -0
- package/src/components/DcbEventLog/DcbEventLog.res.mjs +24 -0
- package/src/components/DcbEventLog/DcbEventLog_Adapter.res +57 -0
- package/src/components/DcbEventLog/DcbEventLog_Adapter.res.mjs +2 -0
- package/src/components/DcbEventLog/DcbEventLog_Builder.res +72 -0
- package/src/components/DcbEventLog/DcbEventLog_Builder.res.mjs +67 -0
- package/src/components/DcbEventLog/DcbEventLog_Operations.res +160 -0
- package/src/components/DcbEventLog/DcbEventLog_Operations.res.mjs +121 -0
- package/src/components/EventCollector/EventCollector.res +34 -0
- package/src/components/EventCollector/EventCollector.res.mjs +9 -0
- package/src/components/EventCollector/EventCollector_Adapter.res +45 -0
- package/src/components/EventCollector/EventCollector_Adapter.res.mjs +2 -0
- package/src/components/EventCollector/EventCollector_Builder.res +91 -0
- package/src/components/EventCollector/EventCollector_Builder.res.mjs +64 -0
- package/src/components/EventLog/EventLog.res +27 -0
- package/src/components/EventLog/EventLog.res.mjs +13 -0
- package/src/components/EventLog/EventLog_Adapter.res +15 -0
- package/src/components/EventLog/EventLog_Adapter.res.mjs +2 -0
- package/src/components/EventLog/EventLog_Builder.res +65 -0
- package/src/components/EventLog/EventLog_Builder.res.mjs +57 -0
- package/src/components/EventLog/EventLog_Operations.res +209 -0
- package/src/components/EventLog/EventLog_Operations.res.mjs +202 -0
- package/src/components/EventLog/EventPublish_Callback.res +29 -0
- package/src/components/EventLog/EventPublish_Callback.res.mjs +32 -0
- package/src/components/EventMapper/EventMapper.res +72 -0
- package/src/components/EventMapper/EventMapper.res.mjs +54 -0
- package/src/components/EventMapper/EventMapper_Builder.res +128 -0
- package/src/components/EventMapper/EventMapper_Builder.res.mjs +81 -0
- package/src/components/EventMapper/EventMapper_Callback.res +323 -0
- package/src/components/EventMapper/EventMapper_Callback.res.mjs +231 -0
- package/src/components/EventTopic/EventTopic.res +69 -0
- package/src/components/EventTopic/EventTopic.res.mjs +50 -0
- package/src/components/EventTopic/EventTopic_Adapter.res +15 -0
- package/src/components/EventTopic/EventTopic_Adapter.res.mjs +2 -0
- package/src/components/EventTopic/EventTopic_Builder.res +53 -0
- package/src/components/EventTopic/EventTopic_Builder.res.mjs +46 -0
- package/src/components/EventTopic/EventTopic_Operations.res +37 -0
- package/src/components/EventTopic/EventTopic_Operations.res.mjs +39 -0
- package/src/components/Extension/Extension.res +32 -0
- package/src/components/Extension/Extension.res.mjs +9 -0
- package/src/components/Extension/Extension_Builder.res +82 -0
- package/src/components/Extension/Extension_Builder.res.mjs +57 -0
- package/src/components/Extension/Extension_Operations.res +203 -0
- package/src/components/Extension/Extension_Operations.res.mjs +154 -0
- package/src/components/ExtensionPoint/ExtensionPoint.res +49 -0
- package/src/components/ExtensionPoint/ExtensionPoint.res.mjs +25 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Builder.res +163 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Builder.res.mjs +113 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Callback.res +110 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Callback.res.mjs +76 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Operations.res +146 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Operations.res.mjs +122 -0
- package/src/components/Heartbeat/Heartbeat.res +25 -0
- package/src/components/Heartbeat/Heartbeat.res.mjs +9 -0
- package/src/components/Heartbeat/Heartbeat_Adapter.res +14 -0
- package/src/components/Heartbeat/Heartbeat_Adapter.res.mjs +2 -0
- package/src/components/Heartbeat/Heartbeat_Builder.res +43 -0
- package/src/components/Heartbeat/Heartbeat_Builder.res.mjs +47 -0
- package/src/components/Heartbeat/Heartbeat_Callback.res +32 -0
- package/src/components/Heartbeat/Heartbeat_Callback.res.mjs +40 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice.res +34 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice.res.mjs +24 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res +98 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res.mjs +87 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +191 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +175 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice.res +35 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice.res.mjs +24 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res +181 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +137 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +173 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +173 -0
- package/src/components/QueryDb/QueryDb.res +74 -0
- package/src/components/QueryDb/QueryDb.res.mjs +37 -0
- package/src/components/QueryDb/QueryDb_Adapter.res +78 -0
- package/src/components/QueryDb/QueryDb_Adapter.res.mjs +17 -0
- package/src/components/QueryDb/QueryDb_Builder.res +76 -0
- package/src/components/QueryDb/QueryDb_Builder.res.mjs +53 -0
- package/src/components/QueryDb/QueryDb_Callback.res +18 -0
- package/src/components/QueryDb/QueryDb_Callback.res.mjs +21 -0
- package/src/components/QueryDb/QueryDb_Operations.res +116 -0
- package/src/components/QueryDb/QueryDb_Operations.res.mjs +165 -0
- package/src/components/ReadModel/ReadModel.res +42 -0
- package/src/components/ReadModel/ReadModel.res.mjs +27 -0
- package/src/components/ReadModel/ReadModel_Builder.res +155 -0
- package/src/components/ReadModel/ReadModel_Builder.res.mjs +101 -0
- package/src/components/ReadModel/ReadModel_Callback.res +48 -0
- package/src/components/ReadModel/ReadModel_Callback.res.mjs +48 -0
- package/src/components/Scheduler/Scheduler.res +13 -0
- package/src/components/Scheduler/Scheduler.res.mjs +9 -0
- package/src/components/Scheduler/Scheduler_Adapter.res +13 -0
- package/src/components/Scheduler/Scheduler_Adapter.res.mjs +2 -0
- package/src/components/Scheduler/Scheduler_Builder.res +19 -0
- package/src/components/Scheduler/Scheduler_Builder.res.mjs +29 -0
- package/src/components/SideEffectHandler/SideEffectHandler.res +30 -0
- package/src/components/SideEffectHandler/SideEffectHandler.res.mjs +12 -0
- package/src/components/SideEffectHandler/SideEffectHandler_Builder.res +117 -0
- package/src/components/SideEffectHandler/SideEffectHandler_Builder.res.mjs +64 -0
- package/src/components/SideEffectHandler/SideEffectHandler_Callback.res +116 -0
- package/src/components/SideEffectHandler/SideEffectHandler_Callback.res.mjs +95 -0
- package/src/components/StateChangeSlice/StateChangeSlice.res +38 -0
- package/src/components/StateChangeSlice/StateChangeSlice.res.mjs +17 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res +91 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res.mjs +81 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +412 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +299 -0
- package/src/components/StateTopic.res +91 -0
- package/src/components/StateTopic.res.mjs +41 -0
- package/src/components/StateViewSlice/StateViewSlice.res +33 -0
- package/src/components/StateViewSlice/StateViewSlice.res.mjs +24 -0
- package/src/components/StateViewSlice/StateViewSlice_Builder.res +176 -0
- package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +134 -0
- package/src/components/StateViewSlice/StateViewSlice_Callback.res +64 -0
- package/src/components/StateViewSlice/StateViewSlice_Callback.res.mjs +56 -0
- package/src/components/Task/Task.res +81 -0
- package/src/components/Task/Task.res.mjs +51 -0
- package/src/components/Task/Task_Adapter.res +31 -0
- package/src/components/Task/Task_Adapter.res.mjs +2 -0
- package/src/components/Task/Task_Builder.res +223 -0
- package/src/components/Task/Task_Builder.res.mjs +115 -0
- package/src/plugin/api/PluginBaseFragment.res +104 -0
- package/src/plugin/api/PluginBaseFragment.res.mjs +64 -0
- package/src/plugin/component/Plugin.res +100 -0
- package/src/plugin/component/Plugin.res.mjs +61 -0
- package/src/plugin/component/Plugin_Builder.res +1017 -0
- package/src/plugin/component/Plugin_Builder.res.mjs +608 -0
- package/src/plugin/component/Plugin_BuiltHook.res +141 -0
- package/src/plugin/component/Plugin_BuiltHook.res.mjs +39 -0
- package/src/plugin/component/Plugin_Callback.res +98 -0
- package/src/plugin/component/Plugin_Callback.res.mjs +55 -0
- package/src/plugin/component/Plugin_Helpers.res +1730 -0
- package/src/plugin/component/Plugin_Helpers.res.mjs +1010 -0
- package/src/plugin/component/Plugin_ResolverError.res +27 -0
- package/src/plugin/component/Plugin_ResolverError.res.mjs +21 -0
- package/src/plugin/component/Plugin_Structure.res +570 -0
- package/src/plugin/component/Plugin_Structure.res.mjs +458 -0
- package/src/plugin/component/Plugin_SubscriptionSchema.res +103 -0
- package/src/plugin/component/Plugin_SubscriptionSchema.res.mjs +71 -0
- package/src/plugin/component/SchemaWalker.res +164 -0
- package/src/plugin/component/SchemaWalker.res.mjs +183 -0
- package/src/plugin/connect/PluginConnectExtension_Builder.res +14 -0
- package/src/plugin/connect/PluginConnectExtension_Builder.res.mjs +36 -0
- package/src/plugin/connect/PluginConnectExtension_Mapping.res +76 -0
- package/src/plugin/connect/PluginConnectExtension_Mapping.res.mjs +89 -0
- package/src/plugin/connect/PluginExtensionPoint_Builder.res +39 -0
- package/src/plugin/connect/PluginExtensionPoint_Builder.res.mjs +33 -0
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res +231 -0
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +353 -0
- package/src/plugin/lifecycle/PluginBehavior.res +250 -0
- package/src/plugin/lifecycle/PluginBehavior.res.mjs +391 -0
- package/src/plugin/lifecycle/PluginSpec.res +84 -0
- package/src/plugin/lifecycle/PluginSpec.res.mjs +148 -0
- package/src/plugin/lifecycle/PluginsProjection.res +154 -0
- package/src/plugin/lifecycle/PluginsProjection.res.mjs +230 -0
- package/src/plugin/lifecycle/PluginsReadModelSpec.res +66 -0
- package/src/plugin/lifecycle/PluginsReadModelSpec.res.mjs +58 -0
- package/src/util/AWS.res +7 -0
- package/src/util/AWS.res.mjs +20 -0
- package/src/util/CSV.res +27 -0
- package/src/util/CSV.res.mjs +56 -0
- package/src/util/CommandPublisher.res +133 -0
- package/src/util/CommandPublisher.res.mjs +161 -0
- package/src/util/CsvStream.res +39 -0
- package/src/util/CsvStream.res.mjs +42 -0
- package/src/util/EffectLogger.res +178 -0
- package/src/util/EffectLogger.res.mjs +171 -0
- package/src/util/FTP.res +69 -0
- package/src/util/FTP.res.mjs +101 -0
- package/src/util/FTPHandler.res +142 -0
- package/src/util/FTPHandler.res.mjs +136 -0
- package/src/util/Hash.res +1 -0
- package/src/util/Hash.res.mjs +10 -0
- package/src/util/Interstack.res +74 -0
- package/src/util/Interstack.res.mjs +126 -0
- package/src/util/Interstack.resi +25 -0
- package/src/util/LogFormat.res +222 -0
- package/src/util/LogFormat.res.mjs +257 -0
- package/src/util/Logger.res +196 -0
- package/src/util/Logger.res.mjs +238 -0
- package/src/util/Lru.res +51 -0
- package/src/util/Lru.res.mjs +59 -0
- package/src/util/Lru.resi +32 -0
- package/src/util/Metrics.res +32 -0
- package/src/util/Metrics.res.mjs +42 -0
- package/src/util/OutputFailsafeDeploytime.res +16 -0
- package/src/util/OutputFailsafeDeploytime.res.mjs +20 -0
- package/src/util/OutputFailsafeRuntime.res +6 -0
- package/src/util/OutputFailsafeRuntime.res.mjs +15 -0
- package/src/util/OutputLogger.res +9 -0
- package/src/util/OutputLogger.res.mjs +19 -0
- package/src/util/ResourceQuery.res +14 -0
- package/src/util/ResourceQuery.res.mjs +17 -0
- package/src/util/ResourceQueryRuntime.res +17 -0
- package/src/util/ResourceQueryRuntime.res.mjs +18 -0
- package/src/util/ScheduleOps.res +124 -0
- package/src/util/ScheduleOps.res.mjs +132 -0
- package/src/util/Util.res +12 -0
- package/src/util/Util.res.mjs +42 -0
- package/src/util/Util_Adapter.res +97 -0
- package/src/util/Util_Adapter.res.mjs +82 -0
- package/src/util/Util_AdapterRuntime.res +39 -0
- package/src/util/Util_AdapterRuntime.res.mjs +42 -0
- package/src/util/Util_Array.res +2 -0
- package/src/util/Util_Array.res.mjs +12 -0
- package/src/util/Util_Error.res +16 -0
- package/src/util/Util_Error.res.mjs +19 -0
- package/src/util/Util_Promise.res +67 -0
- package/src/util/Util_Promise.res.mjs +105 -0
- package/src/util/Util_Pulumi.res +35 -0
- package/src/util/Util_Pulumi.res.mjs +55 -0
- package/src/util/Util_Pulumi.resi +21 -0
- package/src/util/Util_QueryDb.res +14 -0
- package/src/util/Util_QueryDb.res.mjs +21 -0
- package/src/util/Util_QueryDbRuntime.res +11 -0
- package/src/util/Util_QueryDbRuntime.res.mjs +19 -0
- package/src/util/Util_ReadModel.res +2 -0
- package/src/util/Util_ReadModel.res.mjs +10 -0
- package/src/util/Util_StackRefs.res +24 -0
- package/src/util/Util_StackRefs.res.mjs +39 -0
- package/src/util/Validation.res +75 -0
- package/src/util/Validation.res.mjs +181 -0
- package/tests/.gitkeep +0 -0
- package/tests/IdentityTest.res +155 -0
- package/tests/IdentityTest.res.mjs +174 -0
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res +237 -0
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +298 -0
- package/tests/admin/Platform_UIFragmentsApiTest.res +96 -0
- package/tests/admin/Platform_UIFragmentsApiTest.res.mjs +101 -0
- package/tests/aggregate/AggregateCallbackTest.res +81 -0
- package/tests/aggregate/AggregateCallbackTest.res.mjs +140 -0
- package/tests/aggregate/AggregateCausationTest.res +49 -0
- package/tests/aggregate/AggregateCausationTest.res.mjs +44 -0
- package/tests/aggregate/AggregateConflictTest.res +212 -0
- package/tests/aggregate/AggregateConflictTest.res.mjs +363 -0
- package/tests/aggregate/AggregateFixtures.res +177 -0
- package/tests/aggregate/AggregateFixtures.res.mjs +285 -0
- package/tests/aggregate/AggregateRejectionTest.res +139 -0
- package/tests/aggregate/AggregateRejectionTest.res.mjs +163 -0
- package/tests/api/ApiNoApiTest.res +62 -0
- package/tests/api/ApiNoApiTest.res.mjs +90 -0
- package/tests/api/GraphQL_StitcherTest.res +107 -0
- package/tests/api/GraphQL_StitcherTest.res.mjs +99 -0
- package/tests/api/SimpleTest.res +7 -0
- package/tests/api/SimpleTest.res.mjs +10 -0
- package/tests/api/SuryToJsonSchemaTest.res +405 -0
- package/tests/api/SuryToJsonSchemaTest.res.mjs +623 -0
- package/tests/commandgenerator/CommandGeneratorCallbackTest.res +128 -0
- package/tests/commandgenerator/CommandGeneratorCallbackTest.res.mjs +160 -0
- package/tests/commandgenerator/CommandGeneratorFixtures.res +139 -0
- package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +197 -0
- package/tests/commandtopic/CommandTopicCallbackFixtures.res +87 -0
- package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +152 -0
- package/tests/commandtopic/CommandTopicCallbackTest.res +66 -0
- package/tests/commandtopic/CommandTopicCallbackTest.res.mjs +106 -0
- package/tests/commandtopic/CommandTopicHelpersRejectionTest.res +83 -0
- package/tests/commandtopic/CommandTopicHelpersRejectionTest.res.mjs +109 -0
- package/tests/counter/CounterCallbackTest.res +83 -0
- package/tests/counter/CounterCallbackTest.res.mjs +140 -0
- package/tests/counter/CounterFixtures.res +57 -0
- package/tests/counter/CounterFixtures.res.mjs +67 -0
- package/tests/dcb/DcbDecodeTest.res +122 -0
- package/tests/dcb/DcbDecodeTest.res.mjs +194 -0
- package/tests/dcb/DcbEventLogOperationsTest.res +195 -0
- package/tests/dcb/DcbEventLogOperationsTest.res.mjs +268 -0
- package/tests/dcb/DcbFixtures.res +422 -0
- package/tests/dcb/DcbFixtures.res.mjs +534 -0
- package/tests/dcb/DcbScopeInferenceTest.res +242 -0
- package/tests/dcb/DcbScopeInferenceTest.res.mjs +480 -0
- package/tests/dcb/DcbStateChangeSliceTest.res +362 -0
- package/tests/dcb/DcbStateChangeSliceTest.res.mjs +546 -0
- package/tests/dcb/DcbTagTest.res +978 -0
- package/tests/dcb/DcbTagTest.res.mjs +867 -0
- package/tests/dcb/DcbValidationTest.res +349 -0
- package/tests/dcb/DcbValidationTest.res.mjs +476 -0
- package/tests/eventlog/EventLogFixtures.res +113 -0
- package/tests/eventlog/EventLogFixtures.res.mjs +166 -0
- package/tests/eventlog/EventLogOperationsTest.res +96 -0
- package/tests/eventlog/EventLogOperationsTest.res.mjs +192 -0
- package/tests/eventlog/EventLogRetryTest.res +121 -0
- package/tests/eventlog/EventLogRetryTest.res.mjs +171 -0
- package/tests/eventmapper/EventMapperCallbackTest.res +134 -0
- package/tests/eventmapper/EventMapperCallbackTest.res.mjs +141 -0
- package/tests/eventmapper/EventMapperFixtures.res +255 -0
- package/tests/eventmapper/EventMapperFixtures.res.mjs +440 -0
- package/tests/eventmapper/EventMapperTest.res +53 -0
- package/tests/eventmapper/EventMapperTest.res.mjs +83 -0
- package/tests/eventtopic/EventTopicFixtures.res +36 -0
- package/tests/eventtopic/EventTopicFixtures.res.mjs +65 -0
- package/tests/eventtopic/EventTopicOperationsTest.res +48 -0
- package/tests/eventtopic/EventTopicOperationsTest.res.mjs +71 -0
- package/tests/extensionpoint/ExtensionPointCallbackTest.res +84 -0
- package/tests/extensionpoint/ExtensionPointCallbackTest.res.mjs +94 -0
- package/tests/extensionpoint/ExtensionPointFixtures.res +173 -0
- package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +205 -0
- package/tests/extensionpoint/ExtensionPointOperationsTest.res +261 -0
- package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +304 -0
- package/tests/ftp/FTPTest.res +64 -0
- package/tests/ftp/FTPTest.res.mjs +88 -0
- package/tests/logger/LogFormatTest.res +348 -0
- package/tests/logger/LogFormatTest.res.mjs +309 -0
- package/tests/message/MessageTest.res +95 -0
- package/tests/message/MessageTest.res.mjs +93 -0
- package/tests/message/MetaEnvelopeTest.res +200 -0
- package/tests/message/MetaEnvelopeTest.res.mjs +188 -0
- package/tests/plugin/ManifestVisibilityTest.res +137 -0
- package/tests/plugin/ManifestVisibilityTest.res.mjs +205 -0
- package/tests/plugin/PluginSpecExperiment.res +13 -0
- package/tests/plugin/PluginSpecExperiment.res.mjs +31 -0
- package/tests/plugin/PluginStructureTest.res +298 -0
- package/tests/plugin/PluginStructureTest.res.mjs +388 -0
- package/tests/plugin/PluginVersionTest.res +34 -0
- package/tests/plugin/PluginVersionTest.res.mjs +30 -0
- package/tests/plugin/SchemaWalkerTest.res +115 -0
- package/tests/plugin/SchemaWalkerTest.res.mjs +160 -0
- package/tests/plugin/StateChangeSlice/PsPlaceOrder.res +24 -0
- package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +62 -0
- package/tests/plugin/StateChangeSlice/PsShipOrder.res +29 -0
- package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +69 -0
- package/tests/plugin/StateViewSlice/PsAnnotatedView.res +24 -0
- package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +94 -0
- package/tests/plugin/StateViewSlice/PsAvailableProductsView.res +18 -0
- package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +69 -0
- package/tests/plugin/StateViewSlice/PsCustomersView.res +22 -0
- package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +69 -0
- package/tests/plugin/StateViewSlice/PsOrdersView.res +20 -0
- package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +81 -0
- package/tests/poc/StructuralSubtypingPoc.res +211 -0
- package/tests/poc/StructuralSubtypingPoc.res.mjs +61 -0
- package/tests/querydb/QueryDbFixtures.res +65 -0
- package/tests/querydb/QueryDbFixtures.res.mjs +135 -0
- package/tests/querydb/QueryDbOperationsTest.res +94 -0
- package/tests/querydb/QueryDbOperationsTest.res.mjs +168 -0
- package/tests/sideeffecthandler/SideEffectHandlerCallbackTest.res +56 -0
- package/tests/sideeffecthandler/SideEffectHandlerCallbackTest.res.mjs +77 -0
- package/tests/sideeffecthandler/SideEffectHandlerFixtures.res +96 -0
- package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +139 -0
- package/tests/util/CsvStreamTest.res +54 -0
- package/tests/util/CsvStreamTest.res.mjs +51 -0
- package/tests/util/LruTest.res +73 -0
- package/tests/util/LruTest.res.mjs +105 -0
- package/tests/util/MetricsTest.res +36 -0
- package/tests/util/MetricsTest.res.mjs +53 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
|
+
|
|
5
|
+
function baseName(name) {
|
|
6
|
+
return Stdlib_Option.getOr(name.split("-")[0], name);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let Adapter;
|
|
10
|
+
|
|
11
|
+
let AdapterRuntime;
|
|
12
|
+
|
|
13
|
+
let $$Array;
|
|
14
|
+
|
|
15
|
+
let $$Error;
|
|
16
|
+
|
|
17
|
+
let LogFormat;
|
|
18
|
+
|
|
19
|
+
let $$Promise;
|
|
20
|
+
|
|
21
|
+
let Pulumi;
|
|
22
|
+
|
|
23
|
+
let QueryDb;
|
|
24
|
+
|
|
25
|
+
let QueryDbRuntime;
|
|
26
|
+
|
|
27
|
+
let ReadModel;
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
baseName,
|
|
31
|
+
Adapter,
|
|
32
|
+
AdapterRuntime,
|
|
33
|
+
$$Array,
|
|
34
|
+
$$Error,
|
|
35
|
+
LogFormat,
|
|
36
|
+
$$Promise,
|
|
37
|
+
Pulumi,
|
|
38
|
+
QueryDb,
|
|
39
|
+
QueryDbRuntime,
|
|
40
|
+
ReadModel,
|
|
41
|
+
}
|
|
42
|
+
/* No side effect */
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
open ReventlessInfra.Adapter
|
|
2
|
+
|
|
3
|
+
let log = Logger.fromEnv()
|
|
4
|
+
|
|
5
|
+
let filterSupportedResources: (
|
|
6
|
+
array<resource>,
|
|
7
|
+
array<string>,
|
|
8
|
+
) => Pulumi.Output.t<array<resource>> = (resources, supportedServices) =>
|
|
9
|
+
resources
|
|
10
|
+
->Array.map(resource => resource.service)
|
|
11
|
+
->Pulumi.Output.all
|
|
12
|
+
->Pulumi.Output.apply(services =>
|
|
13
|
+
resources
|
|
14
|
+
->Array.zip(services)
|
|
15
|
+
->Array.filter(((_resource, service)) =>
|
|
16
|
+
supportedServices->Array.some(supportedService => service == supportedService)
|
|
17
|
+
)
|
|
18
|
+
->Array.map(((resource, _)) => resource)
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
let filterSupportedResolvedResources: (
|
|
22
|
+
array<Adapter.resolvedResource>,
|
|
23
|
+
array<string>,
|
|
24
|
+
) => array<Adapter.resolvedResource> = (resources, supportedServices) =>
|
|
25
|
+
resources->Array.filter(resource =>
|
|
26
|
+
supportedServices->Array.some(supportedService => resource.service == supportedService)
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
let findResource = (resources, service) =>
|
|
30
|
+
resources
|
|
31
|
+
->filterSupportedResources([service])
|
|
32
|
+
->Pulumi.Output.apply(resources =>
|
|
33
|
+
switch resources {
|
|
34
|
+
| [] =>
|
|
35
|
+
let err = `Util.Adapter.findResource: Couldn't find service ${service} in resources`
|
|
36
|
+
let _ =
|
|
37
|
+
resources
|
|
38
|
+
->Array.map(Adapter.resourceToResolvedOutput)
|
|
39
|
+
->Pulumi.Output.all
|
|
40
|
+
->Pulumi.Output.apply(resources => {
|
|
41
|
+
let resourcesStr = resources->Adapter.resolvedToString
|
|
42
|
+
log.error(~comp="Util_Adapter", ~data=JSON.Encode.string(resourcesStr), err)
|
|
43
|
+
})
|
|
44
|
+
JsError.throwWithMessage(err)
|
|
45
|
+
| matching => matching->Array.getUnsafe(0)
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
->Adapter.outputToResource
|
|
49
|
+
|
|
50
|
+
let findResolvedResource = (resources, service) =>
|
|
51
|
+
switch resources->filterSupportedResolvedResources([service]) {
|
|
52
|
+
| [] =>
|
|
53
|
+
let err = `Util.Adapter.findResolvedResource: Couldn't find service ${service} in resources: ${resources->Adapter.resolvedToString}`
|
|
54
|
+
log.error(~comp="Util_Adapter", err)
|
|
55
|
+
JsError.throwWithMessage(err)
|
|
56
|
+
| matching => matching->Array.getUnsafe(0)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let findResourceInOutput = (resourcesOutput, service) =>
|
|
60
|
+
resourcesOutput->Pulumi.Output.apply(resources => resources->findResource(service))
|
|
61
|
+
|
|
62
|
+
let partitionSupportedResources = (allResources, supportedServices) => {
|
|
63
|
+
let (names, resourceOutputs) =
|
|
64
|
+
allResources
|
|
65
|
+
->Dict.toArray
|
|
66
|
+
->Array.map(((name, resources)) => (
|
|
67
|
+
name,
|
|
68
|
+
resources->filterSupportedResources(supportedServices),
|
|
69
|
+
))
|
|
70
|
+
->Array.unzip
|
|
71
|
+
|
|
72
|
+
resourceOutputs // TODO: Avoid waiting for all resourceOutputs, call apply only on needed Outputs
|
|
73
|
+
->Pulumi.Output.all // Outputs are unwrapped within Pulumi.Output.all !
|
|
74
|
+
->Pulumi.Output.apply(resources => {
|
|
75
|
+
let (supported, unsupported) =
|
|
76
|
+
names
|
|
77
|
+
->Array.zip(resources)
|
|
78
|
+
->Array.partition(((_, resources)) => resources->Array.length > 0)
|
|
79
|
+
(
|
|
80
|
+
supported->Array.map(((name, resources)) => (
|
|
81
|
+
name,
|
|
82
|
+
resources->Array.map(AdapterDeploytime.unsafeUnwrapResource),
|
|
83
|
+
)),
|
|
84
|
+
unsupported->Array.map(((name, _)) => name),
|
|
85
|
+
)
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type resolvedResources = array<(string, array<Adapter.resolvedResource>)>
|
|
90
|
+
|
|
91
|
+
let partitionResolvedResourcesByService: (
|
|
92
|
+
resolvedResources,
|
|
93
|
+
string,
|
|
94
|
+
) => (resolvedResources, resolvedResources) = (resources, supportedService) =>
|
|
95
|
+
resources->Array.partition(((_, resources)) =>
|
|
96
|
+
resources->Array.some(resource => resource.service == supportedService)
|
|
97
|
+
)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
4
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
5
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
6
|
+
import * as Logger$ReventlessCore from "./Logger.res.mjs";
|
|
7
|
+
import * as Adapter$ReventlessCore from "../adapter/Adapter.res.mjs";
|
|
8
|
+
|
|
9
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
10
|
+
|
|
11
|
+
function filterSupportedResources(resources, supportedServices) {
|
|
12
|
+
return Pulumi.all(resources.map(resource => resource.service)).apply(services => Stdlib_Array.zip(resources, services).filter(param => {
|
|
13
|
+
let service = param[1];
|
|
14
|
+
return supportedServices.some(supportedService => service === supportedService);
|
|
15
|
+
}).map(param => param[0]));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function filterSupportedResolvedResources(resources, supportedServices) {
|
|
19
|
+
return resources.filter(resource => supportedServices.some(supportedService => resource.service === supportedService));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function findResource(resources, service) {
|
|
23
|
+
return Adapter$ReventlessCore.outputToResource(filterSupportedResources(resources, [service]).apply(resources => {
|
|
24
|
+
if (resources.length !== 0) {
|
|
25
|
+
return resources[0];
|
|
26
|
+
}
|
|
27
|
+
let err = `Util.Adapter.findResource: Couldn't find service ` + service + ` in resources`;
|
|
28
|
+
Pulumi.all(resources.map(Adapter$ReventlessCore.resourceToResolvedOutput)).apply(resources => {
|
|
29
|
+
let resourcesStr = Adapter$ReventlessCore.resolvedToString(resources);
|
|
30
|
+
log.error("Util_Adapter", resourcesStr, err);
|
|
31
|
+
});
|
|
32
|
+
return Stdlib_JsError.throwWithMessage(err);
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function findResolvedResource(resources, service) {
|
|
37
|
+
let matching = filterSupportedResolvedResources(resources, [service]);
|
|
38
|
+
if (matching.length !== 0) {
|
|
39
|
+
return matching[0];
|
|
40
|
+
}
|
|
41
|
+
let err = `Util.Adapter.findResolvedResource: Couldn't find service ` + service + ` in resources: ` + Adapter$ReventlessCore.resolvedToString(resources);
|
|
42
|
+
log.error("Util_Adapter", undefined, err);
|
|
43
|
+
return Stdlib_JsError.throwWithMessage(err);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function findResourceInOutput(resourcesOutput, service) {
|
|
47
|
+
return resourcesOutput.apply(resources => findResource(resources, service));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function partitionSupportedResources(allResources, supportedServices) {
|
|
51
|
+
let match = Stdlib_Array.unzip(Object.entries(allResources).map(param => [
|
|
52
|
+
param[0],
|
|
53
|
+
filterSupportedResources(param[1], supportedServices)
|
|
54
|
+
]));
|
|
55
|
+
let names = match[0];
|
|
56
|
+
return Pulumi.all(match[1]).apply(resources => {
|
|
57
|
+
let match = Stdlib_Array.partition(Stdlib_Array.zip(names, resources), param => param[1].length !== 0);
|
|
58
|
+
return [
|
|
59
|
+
match[0].map(param => [
|
|
60
|
+
param[0],
|
|
61
|
+
param[1].map(prim => prim)
|
|
62
|
+
]),
|
|
63
|
+
match[1].map(param => param[0])
|
|
64
|
+
];
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function partitionResolvedResourcesByService(resources, supportedService) {
|
|
69
|
+
return Stdlib_Array.partition(resources, param => param[1].some(resource => resource.service === supportedService));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
log,
|
|
74
|
+
filterSupportedResources,
|
|
75
|
+
filterSupportedResolvedResources,
|
|
76
|
+
findResource,
|
|
77
|
+
findResolvedResource,
|
|
78
|
+
findResourceInOutput,
|
|
79
|
+
partitionSupportedResources,
|
|
80
|
+
partitionResolvedResourcesByService,
|
|
81
|
+
}
|
|
82
|
+
/* log Not a pure module */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
open Adapter
|
|
2
|
+
|
|
3
|
+
let filterSupportedResources = (resources, supportedServices) =>
|
|
4
|
+
resources->Array.filter((resource: ReventlessInfra.Adapter.resource) =>
|
|
5
|
+
supportedServices->Array.some(supportedService =>
|
|
6
|
+
resource.service->Pulumi.Output.get == supportedService
|
|
7
|
+
)
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
let filterSupportedResolvedResources: (
|
|
11
|
+
array<resolvedResource>,
|
|
12
|
+
array<string>,
|
|
13
|
+
) => array<resolvedResource> = (resources, supportedServices) =>
|
|
14
|
+
resources->Array.filter(resource =>
|
|
15
|
+
supportedServices->Array.some(supportedService => resource.service == supportedService)
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
let findResource = (resources, service) =>
|
|
19
|
+
switch resources->filterSupportedResources([service]) {
|
|
20
|
+
| [] =>
|
|
21
|
+
let err = `Util.Adapter.findResource: Couldn't find service ${service} in resources: ${resources
|
|
22
|
+
->Array.map(res => res->JSON.stringifyAny->Option.getOrThrow)
|
|
23
|
+
->Array.joinUnsafe(", ")}`
|
|
24
|
+
EffectLogger.logError(~comp=__MODULE__, err)->Effect.runSync
|
|
25
|
+
JsError.throwWithMessage(err)
|
|
26
|
+
| matching => matching->Array.getUnsafe(0)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let findResolvedResource = (resources, service) =>
|
|
30
|
+
switch resources->filterSupportedResolvedResources([service]) {
|
|
31
|
+
| [] =>
|
|
32
|
+
let err = `Util.Adapter.findResolvedResource: Couldn't find service ${service} in resources: ${resources
|
|
33
|
+
->Array.map(res => res->JSON.stringifyAny->Option.getOrThrow)
|
|
34
|
+
->Array.joinUnsafe(", ")}`
|
|
35
|
+
EffectLogger.logError(~comp=__MODULE__, err)->Effect.runSync
|
|
36
|
+
JsError.throwWithMessage(err)
|
|
37
|
+
|
|
38
|
+
| resources => resources->Array.getUnsafe(0)
|
|
39
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
6
|
+
import * as EffectLogger$ReventlessCore from "./EffectLogger.res.mjs";
|
|
7
|
+
|
|
8
|
+
function filterSupportedResources(resources, supportedServices) {
|
|
9
|
+
return resources.filter(resource => supportedServices.some(supportedService => resource.service.get() === supportedService));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function filterSupportedResolvedResources(resources, supportedServices) {
|
|
13
|
+
return resources.filter(resource => supportedServices.some(supportedService => resource.service === supportedService));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function findResource(resources, service) {
|
|
17
|
+
let matching = filterSupportedResources(resources, [service]);
|
|
18
|
+
if (matching.length !== 0) {
|
|
19
|
+
return matching[0];
|
|
20
|
+
}
|
|
21
|
+
let err = `Util.Adapter.findResource: Couldn't find service ` + service + ` in resources: ` + resources.map(res => Stdlib_Option.getOrThrow(JSON.stringify(res), undefined)).join(", ");
|
|
22
|
+
Effect.runSync(EffectLogger$ReventlessCore.logError("Util_AdapterRuntime-ReventlessCore", undefined, err));
|
|
23
|
+
return Stdlib_JsError.throwWithMessage(err);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function findResolvedResource(resources, service) {
|
|
27
|
+
let resources$1 = filterSupportedResolvedResources(resources, [service]);
|
|
28
|
+
if (resources$1.length !== 0) {
|
|
29
|
+
return resources$1[0];
|
|
30
|
+
}
|
|
31
|
+
let err = `Util.Adapter.findResolvedResource: Couldn't find service ` + service + ` in resources: ` + resources.map(res => Stdlib_Option.getOrThrow(JSON.stringify(res), undefined)).join(", ");
|
|
32
|
+
Effect.runSync(EffectLogger$ReventlessCore.logError("Util_AdapterRuntime-ReventlessCore", undefined, err));
|
|
33
|
+
return Stdlib_JsError.throwWithMessage(err);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
filterSupportedResources,
|
|
38
|
+
filterSupportedResolvedResources,
|
|
39
|
+
findResource,
|
|
40
|
+
findResolvedResource,
|
|
41
|
+
}
|
|
42
|
+
/* effect/Effect Not a pure module */
|
|
@@ -0,0 +1,12 @@
|
|
|
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 containsByPredicate(arr, predicate) {
|
|
6
|
+
return Stdlib_Option.isNone(arr.find(predicate));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
containsByPredicate,
|
|
11
|
+
}
|
|
12
|
+
/* No side effect */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type t = {code: string, message: string}
|
|
2
|
+
|
|
3
|
+
@deprecated("now supported by standard library")
|
|
4
|
+
external ofPromise: exn => t = "%identity"
|
|
5
|
+
|
|
6
|
+
let message = (~loc=?, exn) =>
|
|
7
|
+
exn->JsExn.message->Option.getOr("unspecified error") ++
|
|
8
|
+
loc->Option.mapOr("", loc => ` at ${loc}`)
|
|
9
|
+
|
|
10
|
+
/** Safely extracts a message string from any caught JS exception-like value. */
|
|
11
|
+
let messageFromUnknown: (unknown, string) => string = %raw(`
|
|
12
|
+
function(err, fallback) {
|
|
13
|
+
if (err != null && typeof err.message === 'string') return err.message;
|
|
14
|
+
return fallback;
|
|
15
|
+
}
|
|
16
|
+
`)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
4
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
|
+
|
|
6
|
+
function message(loc, exn) {
|
|
7
|
+
return Stdlib_Option.getOr(Stdlib_JsExn.message(exn), "unspecified error") + Stdlib_Option.mapOr(loc, "", loc => ` at ` + loc);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let messageFromUnknown = (function(err, fallback) {
|
|
11
|
+
if (err != null && typeof err.message === 'string') return err.message;
|
|
12
|
+
return fallback;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
message,
|
|
17
|
+
messageFromUnknown,
|
|
18
|
+
}
|
|
19
|
+
/* Stdlib_JsExn Not a pure module */
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
type result<'a> = {status: string, value: option<'a>, reason: option<exn>}
|
|
2
|
+
|
|
3
|
+
let filterRejected = results =>
|
|
4
|
+
results
|
|
5
|
+
->Array.mapWithIndex((result, idx) => (idx, result))
|
|
6
|
+
->Array.filter(((_, result)) => result.status == "rejected")
|
|
7
|
+
->Array.map(((idx, result)) => (
|
|
8
|
+
idx,
|
|
9
|
+
result.reason
|
|
10
|
+
->Option.flatMap(reason => reason->JsExn.fromException)
|
|
11
|
+
->Option.flatMap(exn => exn->JsExn.message)
|
|
12
|
+
->Option.getOr("Unknown error"),
|
|
13
|
+
))
|
|
14
|
+
|
|
15
|
+
@ocaml.doc(
|
|
16
|
+
" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled "
|
|
17
|
+
)
|
|
18
|
+
@val
|
|
19
|
+
@scope("Promise")
|
|
20
|
+
external allSettled: array<promise<'a>> => promise<array<result<'a>>> = "allSettled"
|
|
21
|
+
|
|
22
|
+
let map: (promise<'a>, 'a => 'b, exn => 'b) => promise<'b> = async (p, mapOk, mapExn) =>
|
|
23
|
+
switch await p {
|
|
24
|
+
| a => a->mapOk
|
|
25
|
+
| exception e => e->mapExn
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let mapOk: (promise<'a>, 'a => 'b) => promise<'b> = async (p, mapOk) =>
|
|
29
|
+
switch await p {
|
|
30
|
+
| a => a->mapOk
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let mapExn: (promise<'a>, 'exn => 'b) => promise<'b> = async (p, mapExn) =>
|
|
34
|
+
switch await p {
|
|
35
|
+
| a => a
|
|
36
|
+
| exception e => e->mapExn
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let toUnit: promise<'a> => promise<unit> = p => p->mapOk(ignore)
|
|
40
|
+
|
|
41
|
+
let make = () => {
|
|
42
|
+
let res = ref(_result => ())
|
|
43
|
+
let rej = ref(_exn => ())
|
|
44
|
+
let promise = Promise.make((resolve, reject) => {
|
|
45
|
+
res := resolve
|
|
46
|
+
rej := reject
|
|
47
|
+
})
|
|
48
|
+
(promise, res.contents, rej.contents)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let onEndHandler = async (flush, resolve) => {
|
|
52
|
+
let _ = switch await flush() {
|
|
53
|
+
| _res => resolve()
|
|
54
|
+
| exception JsExn(e) =>
|
|
55
|
+
EffectLogger.logError(~comp=__MODULE__, `${__LOC__}: ${e->JsExn.message->Option.getOr("unknown")}`)->Effect.runSync
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let finishTimeout = timeout => {
|
|
60
|
+
let (promise, resolve, _reject) = make()
|
|
61
|
+
let _ = setTimeout(() => resolve(), timeout)
|
|
62
|
+
promise
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let finishRandomTimeout = (min, max) => {
|
|
66
|
+
Math.Int.random(min, max)->finishTimeout
|
|
67
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Math from "@rescript/runtime/lib/es6/Stdlib_Math.js";
|
|
4
|
+
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
5
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
8
|
+
import * as EffectLogger$ReventlessCore from "./EffectLogger.res.mjs";
|
|
9
|
+
|
|
10
|
+
function filterRejected(results) {
|
|
11
|
+
return results.map((result, idx) => [
|
|
12
|
+
idx,
|
|
13
|
+
result
|
|
14
|
+
]).filter(param => param[1].status === "rejected").map(param => [
|
|
15
|
+
param[0],
|
|
16
|
+
Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_Option.flatMap(param[1].reason, Stdlib_JsExn.fromException), exn => Stdlib_JsExn.message(exn)), "Unknown error")
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function map(p, mapOk, mapExn) {
|
|
21
|
+
let a;
|
|
22
|
+
try {
|
|
23
|
+
a = await p;
|
|
24
|
+
} catch (raw_e) {
|
|
25
|
+
return mapExn(Primitive_exceptions.internalToException(raw_e));
|
|
26
|
+
}
|
|
27
|
+
return mapOk(a);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function mapOk(p, mapOk$1) {
|
|
31
|
+
return mapOk$1(await p);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function mapExn(p, mapExn$1) {
|
|
35
|
+
try {
|
|
36
|
+
return await p;
|
|
37
|
+
} catch (raw_e) {
|
|
38
|
+
return mapExn$1(Primitive_exceptions.internalToException(raw_e));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function toUnit(p) {
|
|
43
|
+
return mapOk(p, prim => {});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function make() {
|
|
47
|
+
let res = {
|
|
48
|
+
contents: _result => {}
|
|
49
|
+
};
|
|
50
|
+
let rej = {
|
|
51
|
+
contents: _exn => {}
|
|
52
|
+
};
|
|
53
|
+
let promise = new Promise((resolve, reject) => {
|
|
54
|
+
res.contents = resolve;
|
|
55
|
+
rej.contents = reject;
|
|
56
|
+
});
|
|
57
|
+
return [
|
|
58
|
+
promise,
|
|
59
|
+
res.contents,
|
|
60
|
+
rej.contents
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function onEndHandler(flush, resolve) {
|
|
65
|
+
let exit = 0;
|
|
66
|
+
let _res;
|
|
67
|
+
try {
|
|
68
|
+
_res = await flush();
|
|
69
|
+
exit = 1;
|
|
70
|
+
} catch (raw_e) {
|
|
71
|
+
let e = Primitive_exceptions.internalToException(raw_e);
|
|
72
|
+
if (e.RE_EXN_ID === "JsExn") {
|
|
73
|
+
Effect.runSync(EffectLogger$ReventlessCore.logError("Util_Promise-ReventlessCore", undefined, "File \"Util_Promise.res\", line 55, characters 47-54" + `: ` + Stdlib_Option.getOr(Stdlib_JsExn.message(e._1), "unknown")));
|
|
74
|
+
} else {
|
|
75
|
+
throw e;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (exit === 1) {
|
|
79
|
+
resolve();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function finishTimeout(timeout) {
|
|
84
|
+
let match = make();
|
|
85
|
+
let resolve = match[1];
|
|
86
|
+
setTimeout(() => resolve(), timeout);
|
|
87
|
+
return match[0];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function finishRandomTimeout(min, max) {
|
|
91
|
+
return finishTimeout(Stdlib_Math.Int.random(min, max));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
filterRejected,
|
|
96
|
+
map,
|
|
97
|
+
mapOk,
|
|
98
|
+
mapExn,
|
|
99
|
+
toUnit,
|
|
100
|
+
make,
|
|
101
|
+
onEndHandler,
|
|
102
|
+
finishTimeout,
|
|
103
|
+
finishRandomTimeout,
|
|
104
|
+
}
|
|
105
|
+
/* Stdlib_JsExn Not a pure module */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Output = {
|
|
2
|
+
module Async = {
|
|
3
|
+
type t<'a> = (Pulumi.Output.t<'a>, Pulumi.Output.t<'a> => unit)
|
|
4
|
+
|
|
5
|
+
let make = () => {
|
|
6
|
+
let (set, output) = {
|
|
7
|
+
let set = ref(_eventCollector => ())
|
|
8
|
+
let output =
|
|
9
|
+
Promise.make((resolve, _) => set := resolve)
|
|
10
|
+
->Pulumi.Output.fromPromise
|
|
11
|
+
->Pulumi.Output.unwrap
|
|
12
|
+
(set.contents, output)
|
|
13
|
+
}
|
|
14
|
+
(output, set)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module ComponentResourceOptions = {
|
|
20
|
+
let ofCustomResourceOptions = (customResourceOpts: Pulumi.CustomResourceOptions.t) => {
|
|
21
|
+
Pulumi.ComponentResource.id: ?customResourceOpts.id,
|
|
22
|
+
dependsOn: ?customResourceOpts.dependsOn,
|
|
23
|
+
parent: ?customResourceOpts.parent,
|
|
24
|
+
protect: ?customResourceOpts.protect,
|
|
25
|
+
provider: ?customResourceOpts.provider,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let toCustomResourceOptions = (componentResourceOpts: Pulumi.ComponentResource.options) => {
|
|
29
|
+
Pulumi.CustomResourceOptions.id: ?componentResourceOpts.id,
|
|
30
|
+
dependsOn: ?componentResourceOpts.dependsOn,
|
|
31
|
+
parent: ?componentResourceOpts.parent,
|
|
32
|
+
protect: ?componentResourceOpts.protect,
|
|
33
|
+
provider: ?componentResourceOpts.provider,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function make() {
|
|
5
|
+
let set = {
|
|
6
|
+
contents: _eventCollector => {}
|
|
7
|
+
};
|
|
8
|
+
let output = new Promise((resolve, param) => {
|
|
9
|
+
set.contents = resolve;
|
|
10
|
+
});
|
|
11
|
+
let set$1 = set.contents;
|
|
12
|
+
return [
|
|
13
|
+
output,
|
|
14
|
+
set$1
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let Async = {
|
|
19
|
+
make: make
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
let Output = {
|
|
23
|
+
Async: Async
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function ofCustomResourceOptions(customResourceOpts) {
|
|
27
|
+
return {
|
|
28
|
+
dependsOn: customResourceOpts.dependsOn,
|
|
29
|
+
id: customResourceOpts.id,
|
|
30
|
+
parent: customResourceOpts.parent,
|
|
31
|
+
protect: customResourceOpts.protect,
|
|
32
|
+
provider: customResourceOpts.provider
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function toCustomResourceOptions(componentResourceOpts) {
|
|
37
|
+
return {
|
|
38
|
+
dependsOn: componentResourceOpts.dependsOn,
|
|
39
|
+
id: componentResourceOpts.id,
|
|
40
|
+
parent: componentResourceOpts.parent,
|
|
41
|
+
protect: componentResourceOpts.protect,
|
|
42
|
+
provider: componentResourceOpts.provider
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let ComponentResourceOptions = {
|
|
47
|
+
ofCustomResourceOptions: ofCustomResourceOptions,
|
|
48
|
+
toCustomResourceOptions: toCustomResourceOptions
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
Output,
|
|
53
|
+
ComponentResourceOptions,
|
|
54
|
+
}
|
|
55
|
+
/* No side effect */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Output: {
|
|
2
|
+
module Async: {
|
|
3
|
+
/** Use an Output before you actually know the value.
|
|
4
|
+
*/
|
|
5
|
+
type t<'a> = (Pulumi.Output.t<'a>, Pulumi.Output.t<'a> => unit)
|
|
6
|
+
|
|
7
|
+
/** create a new async output
|
|
8
|
+
*
|
|
9
|
+
* NOTE: The set function needs to be called in deploytime code
|
|
10
|
+
* while the output itself needs to be used in runtime-code.
|
|
11
|
+
* Otherwise, just use Pulumi's Output functions (e.g. all, apply)
|
|
12
|
+
* to prevent possible dependency-cycles.
|
|
13
|
+
*/
|
|
14
|
+
let make: unit => t<'a>
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module ComponentResourceOptions: {
|
|
19
|
+
let ofCustomResourceOptions: Pulumi.CustomResourceOptions.t => Pulumi.ComponentResource.options
|
|
20
|
+
let toCustomResourceOptions: Pulumi.ComponentResource.options => Pulumi.CustomResourceOptions.t
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let log = Logger.fromEnv()
|
|
2
|
+
|
|
3
|
+
let getLocalStorageResources = (allQueryDbs: dict<QueryDb.outputs>, queryDbName): array<
|
|
4
|
+
ReventlessInfra.Adapter.resource,
|
|
5
|
+
> =>
|
|
6
|
+
try (allQueryDbs->Dict.get(queryDbName)->Option.getOrThrow).resources catch {
|
|
7
|
+
| exn =>
|
|
8
|
+
log.error(
|
|
9
|
+
~comp="Util_QueryDb",
|
|
10
|
+
~data=allQueryDbs->JSON.stringifyAny->Option.getOr("")->JSON.Encode.string,
|
|
11
|
+
`getLocalStorageResources: Couldn't find QueryDb ${queryDbName}`,
|
|
12
|
+
)
|
|
13
|
+
throw(exn)
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 Logger$ReventlessCore from "./Logger.res.mjs";
|
|
5
|
+
|
|
6
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
7
|
+
|
|
8
|
+
function getLocalStorageResources(allQueryDbs, queryDbName) {
|
|
9
|
+
try {
|
|
10
|
+
return Stdlib_Option.getOrThrow(allQueryDbs[queryDbName], undefined).resources;
|
|
11
|
+
} catch (exn) {
|
|
12
|
+
log.error("Util_QueryDb", Stdlib_Option.getOr(JSON.stringify(allQueryDbs), ""), `getLocalStorageResources: Couldn't find QueryDb ` + queryDbName);
|
|
13
|
+
throw exn;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
log,
|
|
19
|
+
getLocalStorageResources,
|
|
20
|
+
}
|
|
21
|
+
/* log Not a pure module */
|