@reventlessdev/reventless-aws 3.0.0-alpha.167
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 +1564 -0
- package/README.md +62 -0
- package/__mocks__/emptyModule.js +1 -0
- package/all-licenses.csv +565 -0
- package/docker-compose.dynamodb-local.yml +12 -0
- package/jest.setup.cjs +5 -0
- package/licenses-analysis.ods +0 -0
- package/package.json +73 -0
- package/rescript.json +39 -0
- package/reventless-licenses-analysis.xls +0 -0
- package/scripts/run-integration-tests.sh +43 -0
- package/src/Platform.res +1940 -0
- package/src/Platform.res.mjs +2281 -0
- package/src/Platform_Casts.res +106 -0
- package/src/Platform_Casts.res.mjs +13 -0
- package/src/Platform_Stack.res +153 -0
- package/src/Platform_Stack.res.mjs +121 -0
- package/src/Types.res +39 -0
- package/src/Types.res.mjs +21 -0
- package/src/adapter/AWS.res +96 -0
- package/src/adapter/AWS.res.mjs +186 -0
- package/src/adapter/AWS_Tags.res +16 -0
- package/src/adapter/AWS_Tags.res.mjs +48 -0
- package/src/adapter/Adapter_Helpers.res +19 -0
- package/src/adapter/Adapter_Helpers.res.mjs +37 -0
- package/src/adapter/Api/AppSync_EventsApi.res +172 -0
- package/src/adapter/Api/AppSync_EventsApi.res.mjs +96 -0
- package/src/adapter/Api/AppSync_Resolver_Native.res +93 -0
- package/src/adapter/Api/AppSync_Resolver_Native.res.mjs +67 -0
- package/src/adapter/Api/AppSync_Resolver_Retrying.res +653 -0
- package/src/adapter/Api/AppSync_Resolver_Retrying.res.mjs +462 -0
- package/src/adapter/Api/CommandSubscriptionResolvers_AppSync.res +29 -0
- package/src/adapter/Api/CommandSubscriptionResolvers_AppSync.res.mjs +15 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +238 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res.mjs +179 -0
- package/src/adapter/Api/Platform_UIFragments_Lambda.res +229 -0
- package/src/adapter/Api/Platform_UIFragments_Lambda.res.mjs +245 -0
- package/src/adapter/Auth/Auth_Cognito.res +209 -0
- package/src/adapter/Auth/Auth_Cognito.res.mjs +135 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers.res +2 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers.res.mjs +12 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res +251 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res.mjs +126 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res +20 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res.mjs +23 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_Runtime.res +1 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_Runtime.res.mjs +11 -0
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res +95 -0
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res.mjs +50 -0
- package/src/adapter/CommandTopic/CommandTopicChannel.res +6 -0
- package/src/adapter/CommandTopic/CommandTopicChannel.res.mjs +21 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_Helpers.res +196 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_Helpers.res.mjs +145 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res +91 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res.mjs +74 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res +69 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res.mjs +62 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res +60 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res.mjs +56 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res +73 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res.mjs +65 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res +88 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res.mjs +76 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel.res +1 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel.res.mjs +9 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel_SQS.res +7 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel_SQS.res.mjs +17 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res +103 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res.mjs +68 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream_Runtime.res +107 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream_Runtime.res.mjs +145 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage.res +1 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage.res.mjs +9 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res +84 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res.mjs +52 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +1436 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res.mjs +1143 -0
- package/src/adapter/EventCollector/EventCollectorChannel.res +6 -0
- package/src/adapter/EventCollector/EventCollectorChannel.res.mjs +21 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res +63 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res.mjs +56 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream_Runtime.res +20 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream_Runtime.res.mjs +32 -0
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res +266 -0
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res.mjs +166 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res +81 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res.mjs +54 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res +59 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res.mjs +45 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res +91 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res.mjs +89 -0
- package/src/adapter/EventLog/EventLogStorage.res +3 -0
- package/src/adapter/EventLog/EventLogStorage.res.mjs +15 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb.res +25 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb.res.mjs +34 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res +26 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res.mjs +35 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +121 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res.mjs +137 -0
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +265 -0
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res.mjs +185 -0
- package/src/adapter/EventTopic/EventTopicPublisher.res +6 -0
- package/src/adapter/EventTopic/EventTopicPublisher.res.mjs +21 -0
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res +25 -0
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res.mjs +28 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res +40 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res.mjs +39 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res +39 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res.mjs +38 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res +5 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res.mjs +18 -0
- package/src/adapter/Mcp/MCP_Lambda.res +502 -0
- package/src/adapter/Mcp/MCP_Lambda.res.mjs +289 -0
- package/src/adapter/QueryDb/NodeResolver_AppSync.res +71 -0
- package/src/adapter/QueryDb/NodeResolver_AppSync.res.mjs +44 -0
- package/src/adapter/QueryDb/QueryDbResolvers.res +2 -0
- package/src/adapter/QueryDb/QueryDbResolvers.res.mjs +12 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +434 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res.mjs +243 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync_NoOp.res +21 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync_NoOp.res.mjs +14 -0
- package/src/adapter/QueryDb/QueryDbResolvers_NoOp.res +21 -0
- package/src/adapter/QueryDb/QueryDbResolvers_NoOp.res.mjs +14 -0
- package/src/adapter/QueryDb/QueryDbStorage.res +5 -0
- package/src/adapter/QueryDb/QueryDbStorage.res.mjs +18 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res +115 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res.mjs +100 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res +52 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res.mjs +38 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res +271 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res.mjs +306 -0
- package/src/adapter/QueryDb/QueryInterceptor_Lambda.res +20 -0
- package/src/adapter/QueryDb/QueryInterceptor_Lambda.res.mjs +22 -0
- package/src/adapter/QueryEngine/QueryEngine.res +3 -0
- package/src/adapter/QueryEngine/QueryEngine.res.mjs +12 -0
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res +184 -0
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res.mjs +221 -0
- package/src/adapter/Runtime/AdminEventCollectorEntryPoint.mjs +879 -0
- package/src/adapter/Runtime/AggregateEntryPoint.mjs +313 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +327 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res.mjs +239 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +331 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res.mjs +240 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +247 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res.mjs +185 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +244 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res.mjs +185 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +347 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res.mjs +244 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +285 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res.mjs +212 -0
- package/src/adapter/Runtime/AutomationSliceEntryPoint.mjs +124 -0
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +187 -0
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res.mjs +147 -0
- package/src/adapter/Runtime/CounterEntryPoint.mjs +91 -0
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint.mjs +265 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +122 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res.mjs +89 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +193 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res.mjs +137 -0
- package/src/adapter/Runtime/EventMapperEntryPoint.mjs +97 -0
- package/src/adapter/Runtime/ExtensionPointEntryPoint.mjs +101 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +83 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res.mjs +59 -0
- package/src/adapter/Runtime/HandlerFactoryHelpers.mjs +142 -0
- package/src/adapter/Runtime/HeartbeatEntryPoint.mjs +38 -0
- package/src/adapter/Runtime/PluginExtensionPointEntryPoint.mjs +137 -0
- package/src/adapter/Runtime/ReadModelEntryPoint.mjs +143 -0
- package/src/adapter/Runtime/RuntimeEnvironment.res +1 -0
- package/src/adapter/Runtime/RuntimeEnvironment.res.mjs +9 -0
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +254 -0
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res.mjs +169 -0
- package/src/adapter/Runtime/SideEffectEntryPoint.mjs +81 -0
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +178 -0
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res.mjs +129 -0
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +166 -0
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res.mjs +87 -0
- package/src/adapter/Runtime/StateViewSliceEntryPoint.mjs +136 -0
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +344 -0
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res.mjs +242 -0
- package/src/adapter/Runtime/TaskBucketEntryPoint.mjs +150 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +123 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res.mjs +74 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher.res +2 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher.res.mjs +12 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res +54 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res.mjs +41 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res +97 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res.mjs +85 -0
- package/src/adapter/StateTopic/StateTopic_AppSync.res +418 -0
- package/src/adapter/StateTopic/StateTopic_AppSync.res.mjs +295 -0
- package/src/adapter/Task/TaskBucket.res +1 -0
- package/src/adapter/Task/TaskBucket.res.mjs +9 -0
- package/src/adapter/Task/TaskBucket_S3.res +157 -0
- package/src/adapter/Task/TaskBucket_S3.res.mjs +108 -0
- package/src/adapter/Task/TaskBucket_S3_Runtime.res +11 -0
- package/src/adapter/Task/TaskBucket_S3_Runtime.res.mjs +15 -0
- package/src/components/Aggregate_Builder.res +1 -0
- package/src/components/Aggregate_Builder.res.mjs +25 -0
- package/src/components/Aggregate_Builder_Micro.res +63 -0
- package/src/components/Aggregate_Builder_Micro.res.mjs +80 -0
- package/src/components/Aggregate_Builder_NoResolver.res +61 -0
- package/src/components/Aggregate_Builder_NoResolver.res.mjs +80 -0
- package/src/components/Aggregate_Builder_PerAggregate.res +57 -0
- package/src/components/Aggregate_Builder_PerAggregate.res.mjs +80 -0
- package/src/components/Aggregate_Builder_Single.res +59 -0
- package/src/components/Aggregate_Builder_Single.res.mjs +80 -0
- package/src/components/Aggregate_Builder_Single_Async.res +59 -0
- package/src/components/Aggregate_Builder_Single_Async.res.mjs +80 -0
- package/src/components/Api/AppSync_Adapter.res +500 -0
- package/src/components/Api/AppSync_Adapter.res.mjs +396 -0
- package/src/components/AutomationSlice_Builder.res +52 -0
- package/src/components/AutomationSlice_Builder.res.mjs +72 -0
- package/src/components/AutomationSlice_Builder_Bundled.res.mjs +70 -0
- package/src/components/Counter_Builder.res +10 -0
- package/src/components/Counter_Builder.res.mjs +16 -0
- package/src/components/DataCleaner.res +170 -0
- package/src/components/DataCleaner.res.mjs +2 -0
- package/src/components/DcbEventLog_Builder.res +8 -0
- package/src/components/DcbEventLog_Builder.res.mjs +14 -0
- package/src/components/ExtensionPoint_Builder.res +16 -0
- package/src/components/ExtensionPoint_Builder.res.mjs +37 -0
- package/src/components/ForeignReadModel_Builder.res +19 -0
- package/src/components/ForeignReadModel_Builder.res.mjs +48 -0
- package/src/components/InboundTranslationSlice_Builder.res +25 -0
- package/src/components/InboundTranslationSlice_Builder.res.mjs +31 -0
- package/src/components/OutboundTranslationSlice_Builder.res +60 -0
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +76 -0
- package/src/components/OutboundTranslationSlice_Builder_Bundled.res.mjs +75 -0
- package/src/components/Plugin.res +29 -0
- package/src/components/Plugin.res.mjs +63 -0
- package/src/components/ReadModel_Builder.res +1 -0
- package/src/components/ReadModel_Builder.res.mjs +19 -0
- package/src/components/ReadModel_Builder_NoResolver.res +55 -0
- package/src/components/ReadModel_Builder_NoResolver.res.mjs +64 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res +60 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res.mjs +64 -0
- package/src/components/ReadModel_Builder_PerReadModel.res +53 -0
- package/src/components/ReadModel_Builder_PerReadModel.res.mjs +66 -0
- package/src/components/ReadModel_Builder_Single.res +52 -0
- package/src/components/ReadModel_Builder_Single.res.mjs +66 -0
- package/src/components/ReadModel_Builder_Single_Stream.res +60 -0
- package/src/components/ReadModel_Builder_Single_Stream.res.mjs +66 -0
- package/src/components/Scheduler.res +1 -0
- package/src/components/Scheduler.res.mjs +13 -0
- package/src/components/SideEffectHandler.res +1 -0
- package/src/components/SideEffectHandler.res.mjs +19 -0
- package/src/components/SideEffectHandler_PerSideEffectHandler.res +13 -0
- package/src/components/SideEffectHandler_PerSideEffectHandler.res.mjs +52 -0
- package/src/components/SideEffectHandler_Single.res +54 -0
- package/src/components/SideEffectHandler_Single.res.mjs +60 -0
- package/src/components/StateChangeSlice_Builder.res +17 -0
- package/src/components/StateChangeSlice_Builder.res.mjs +23 -0
- package/src/components/StateViewSlice_Builder.res +46 -0
- package/src/components/StateViewSlice_Builder.res.mjs +68 -0
- package/src/components/StateViewSlice_Builder_Bundled.res.mjs +69 -0
- package/src/components/StateViewSlice_Builder_Stream.res +50 -0
- package/src/components/StateViewSlice_Builder_Stream.res.mjs +68 -0
- package/src/components/Task_Builder.res +1 -0
- package/src/components/Task_Builder.res.mjs +28 -0
- package/src/components/Task_Builder_PerBucket.res +22 -0
- package/src/components/Task_Builder_PerBucket.res.mjs +63 -0
- package/src/components/Vpc.res +214 -0
- package/src/components/Vpc.res.mjs +117 -0
- package/src/components/Vpc.resi +22 -0
- package/src/errors/AppSync_Error.res +36 -0
- package/src/errors/AppSync_Error.res.mjs +38 -0
- package/src/errors/Cognito_Error.res +36 -0
- package/src/errors/Cognito_Error.res.mjs +38 -0
- package/src/errors/DynamoDb_Error.res +75 -0
- package/src/errors/DynamoDb_Error.res.mjs +86 -0
- package/src/errors/Kinesis_Error.res +36 -0
- package/src/errors/Kinesis_Error.res.mjs +38 -0
- package/src/errors/SNS_Error.res +34 -0
- package/src/errors/SNS_Error.res.mjs +38 -0
- package/src/errors/SQS_Error.res +40 -0
- package/src/errors/SQS_Error.res.mjs +41 -0
- package/src/plugin/cloner/ClonerRunner.res +1 -0
- package/src/plugin/cloner/ClonerRunner.res.mjs +9 -0
- package/src/plugin/cloner/ClonerRunner_Fargate.res +362 -0
- package/src/plugin/cloner/ClonerRunner_Fargate.res.mjs +246 -0
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res +42 -0
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res.mjs +45 -0
- package/src/plugin/heartbeat/HeartbeatRunner.res +1 -0
- package/src/plugin/heartbeat/HeartbeatRunner.res.mjs +9 -0
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res +96 -0
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res.mjs +69 -0
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res +115 -0
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res.mjs +88 -0
- package/src/plugin/runtime/PluginRuntimeOperations.res +5 -0
- package/src/plugin/runtime/PluginRuntimeOperations.res.mjs +14 -0
- package/src/plugin/runtime/PluginRuntime_Builder.res +769 -0
- package/src/plugin/runtime/PluginRuntime_Builder.res.mjs +464 -0
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res +13 -0
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res.mjs +19 -0
- package/src/plugin/stack/Plugin_ExtensionPoint_Builder.res +28 -0
- package/src/plugin/stack/Plugin_ExtensionPoint_Builder.res.mjs +67 -0
- package/src/plugin/stack/Plugin_Stack.res +439 -0
- package/src/plugin/stack/Plugin_Stack.res.mjs +263 -0
- package/src/util/Util.res +29 -0
- package/src/util/Util.res.mjs +93 -0
- package/src/util/Util_AppSync.res +36 -0
- package/src/util/Util_AppSync.res.mjs +35 -0
- package/src/util/Util_AppSync_Caller.res +213 -0
- package/src/util/Util_AppSync_Caller.res.mjs +170 -0
- package/src/util/Util_Bundle.res +255 -0
- package/src/util/Util_Bundle.res.mjs +179 -0
- package/src/util/Util_Cloudwatch.res +14 -0
- package/src/util/Util_Cloudwatch.res.mjs +19 -0
- package/src/util/Util_CognitoGroupUser.res +39 -0
- package/src/util/Util_CognitoGroupUser.res.mjs +32 -0
- package/src/util/Util_CognitoGroupUser_Runtime.res +65 -0
- package/src/util/Util_CognitoGroupUser_Runtime.res.mjs +50 -0
- package/src/util/Util_Cognito_Runtime.res +52 -0
- package/src/util/Util_Cognito_Runtime.res.mjs +35 -0
- package/src/util/Util_DeadLetterQueue.res +154 -0
- package/src/util/Util_DeadLetterQueue.res.mjs +158 -0
- package/src/util/Util_DynamoDb.res +210 -0
- package/src/util/Util_DynamoDb.res.mjs +218 -0
- package/src/util/Util_DynamoDbStream.res +138 -0
- package/src/util/Util_DynamoDbStream.res.mjs +134 -0
- package/src/util/Util_DynamoDbStream_Runtime.res +94 -0
- package/src/util/Util_DynamoDbStream_Runtime.res.mjs +131 -0
- package/src/util/Util_DynamoDb_Runtime.res +216 -0
- package/src/util/Util_DynamoDb_Runtime.res.mjs +257 -0
- package/src/util/Util_DynamoDb_TableManager.res +23 -0
- package/src/util/Util_DynamoDb_TableManager.res.mjs +35 -0
- package/src/util/Util_DynamoDb_TableManager.resi +3 -0
- package/src/util/Util_Env.res +5 -0
- package/src/util/Util_Env.res.mjs +2 -0
- package/src/util/Util_EventSourceMapping.res +49 -0
- package/src/util/Util_EventSourceMapping.res.mjs +32 -0
- package/src/util/Util_HostUiDomain.res +28 -0
- package/src/util/Util_HostUiDomain.res.mjs +26 -0
- package/src/util/Util_IAM_Role.res +14 -0
- package/src/util/Util_IAM_Role.res.mjs +28 -0
- package/src/util/Util_Kinesis_Runtime.res +20 -0
- package/src/util/Util_Kinesis_Runtime.res.mjs +24 -0
- package/src/util/Util_Lambda.res +39 -0
- package/src/util/Util_Lambda.res.mjs +45 -0
- package/src/util/Util_LocalConfig.res +119 -0
- package/src/util/Util_LocalConfig.res.mjs +112 -0
- package/src/util/Util_ResourceNaming.res +15 -0
- package/src/util/Util_ResourceNaming.res.mjs +26 -0
- package/src/util/Util_S3.res +17 -0
- package/src/util/Util_S3.res.mjs +30 -0
- package/src/util/Util_S3_Runtime.res +11 -0
- package/src/util/Util_S3_Runtime.res.mjs +15 -0
- package/src/util/Util_SNS.res +33 -0
- package/src/util/Util_SNS.res.mjs +50 -0
- package/src/util/Util_SNS_FIFO.res +21 -0
- package/src/util/Util_SNS_FIFO.res.mjs +27 -0
- package/src/util/Util_SNS_Runtime.res +33 -0
- package/src/util/Util_SNS_Runtime.res.mjs +27 -0
- package/src/util/Util_SQS.res +70 -0
- package/src/util/Util_SQS.res.mjs +83 -0
- package/src/util/Util_SQS_FIFO.res +16 -0
- package/src/util/Util_SQS_FIFO.res.mjs +28 -0
- package/src/util/Util_SQS_Runtime.res +169 -0
- package/src/util/Util_SQS_Runtime.res.mjs +150 -0
- package/src/util/Util_SesPolicy_Runtime.res +54 -0
- package/src/util/Util_SesPolicy_Runtime.res.mjs +55 -0
- package/src/util/Util_StaticBundle.res +124 -0
- package/src/util/Util_StaticBundle.res.mjs +132 -0
- package/src/util/Util_Vpc.res +22 -0
- package/src/util/Util_Vpc.res.mjs +27 -0
- package/tests/AppSync_AdapterTest.res +396 -0
- package/tests/AppSync_AdapterTest.res.mjs +326 -0
- package/tests/AppSync_Resolver_RetryingTest.res +59 -0
- package/tests/AppSync_Resolver_RetryingTest.res.mjs +66 -0
- package/tests/Auth_CognitoTest.res +203 -0
- package/tests/Auth_CognitoTest.res.mjs +248 -0
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +602 -0
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res.mjs +742 -0
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +57 -0
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res.mjs +68 -0
- package/tests/MCP_LambdaTest.res +101 -0
- package/tests/MCP_LambdaTest.res.mjs +56 -0
- package/tests/Util_HostUiDomainTest.res +90 -0
- package/tests/Util_HostUiDomainTest.res.mjs +50 -0
- package/tests/Util_SQS_RuntimeTest.res +46 -0
- package/tests/Util_SQS_RuntimeTest.res.mjs +45 -0
- package/tests/Util_StaticBundleTest.res +136 -0
- package/tests/Util_StaticBundleTest.res.mjs +149 -0
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +101 -0
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res.mjs +91 -0
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +315 -0
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res.mjs +435 -0
- package/tests/integration/DcbIntegrationHarness.res +102 -0
- package/tests/integration/DcbIntegrationHarness.res.mjs +163 -0
- package/tests/integration/EpTestSlice.res +28 -0
- package/tests/integration/EpTestSlice.res.mjs +43 -0
- package/tests/integration/EpTestSliceBehavior.res +18 -0
- package/tests/integration/EpTestSliceBehavior.res.mjs +35 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
let toResource: PulumiAws.S3.Bucket.t => ReventlessInfra.Adapter.resource = ({id, arn}) =>
|
|
2
|
+
ReventlessInfra.Adapter.make(
|
|
3
|
+
~name=id,
|
|
4
|
+
~id,
|
|
5
|
+
~urn=arn,
|
|
6
|
+
~service=id->Pulumi.Output.apply(_ => AWS.S3.service),
|
|
7
|
+
~resourceType="aws:s3:Bucket"->Pulumi.Output.make,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
let toResolvedBucketOutput = ({id, arn}: PulumiAws.S3.Bucket.t) =>
|
|
11
|
+
(id, arn)
|
|
12
|
+
->Pulumi.Output.all2
|
|
13
|
+
->Pulumi.Output.apply(((id, arn)) => {
|
|
14
|
+
Util_S3_Runtime.id,
|
|
15
|
+
name: id,
|
|
16
|
+
arn,
|
|
17
|
+
})
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
4
|
+
import * as AWS$ReventlessAws from "../adapter/AWS.res.mjs";
|
|
5
|
+
import * as Adapter$ReventlessInfra from "@reventlessdev/reventless-infra/src/adapter/Adapter.res.mjs";
|
|
6
|
+
|
|
7
|
+
function toResource(param) {
|
|
8
|
+
let id = param.id;
|
|
9
|
+
return Adapter$ReventlessInfra.make(id, id, param.arn, id.apply(param => AWS$ReventlessAws.S3.service), undefined, undefined, undefined, Pulumi.output("aws:s3:Bucket"), undefined, undefined);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function toResolvedBucketOutput(param) {
|
|
13
|
+
return Pulumi.all([
|
|
14
|
+
param.id,
|
|
15
|
+
param.arn
|
|
16
|
+
]).apply(param => {
|
|
17
|
+
let id = param[0];
|
|
18
|
+
return {
|
|
19
|
+
id: id,
|
|
20
|
+
name: id,
|
|
21
|
+
arn: param[1]
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
toResource,
|
|
28
|
+
toResolvedBucketOutput,
|
|
29
|
+
}
|
|
30
|
+
/* @pulumi/pulumi Not a pure module */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
let toResolvedTopicOutput = ({name, id, arn}: PulumiAws.SNS.Topic.t) =>
|
|
2
|
+
(name, id, arn)
|
|
3
|
+
->Pulumi.Output.all3
|
|
4
|
+
->Pulumi.Output.apply(((name, id, arn)) => {
|
|
5
|
+
Util_SNS_Runtime.id,
|
|
6
|
+
name,
|
|
7
|
+
arn,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
let toResource = (~tags=?, {id, name, arn}: PulumiAws.SNS.Topic.t): ReventlessInfra.Adapter.resource =>
|
|
11
|
+
ReventlessInfra.Adapter.make(
|
|
12
|
+
~name,
|
|
13
|
+
~id,
|
|
14
|
+
~urn=arn,
|
|
15
|
+
~service=name->Pulumi.Output.apply(_ => AWS.SNS.service),
|
|
16
|
+
~resourceType="aws:sns:Topic"->Pulumi.Output.make,
|
|
17
|
+
~tags=?tags,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
let findResolvedResource = resources =>
|
|
21
|
+
resources->ReventlessCore.Util.Adapter.findResolvedResource(AWS.SNS.service)
|
|
22
|
+
|
|
23
|
+
let log = ReventlessCore.Logger.fromEnv()
|
|
24
|
+
|
|
25
|
+
let findTopicInResolvedResources = resources =>
|
|
26
|
+
switch resources->ReventlessCore.Util_Adapter.filterSupportedResolvedResources([AWS.SNS.service]) {
|
|
27
|
+
| [] =>
|
|
28
|
+
let err = "Couldn't find SNS Topic in resources"
|
|
29
|
+
log.error(~comp="SNS", err)
|
|
30
|
+
JsError.throwWithMessage(err)
|
|
31
|
+
|
|
32
|
+
| resources => resources->Array.getUnsafe(0)
|
|
33
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
4
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
5
|
+
import * as AWS$ReventlessAws from "../adapter/AWS.res.mjs";
|
|
6
|
+
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
7
|
+
import * as Adapter$ReventlessInfra from "@reventlessdev/reventless-infra/src/adapter/Adapter.res.mjs";
|
|
8
|
+
import * as Util_Adapter$ReventlessCore from "@reventlessdev/reventless-core/src/util/Util_Adapter.res.mjs";
|
|
9
|
+
|
|
10
|
+
function toResolvedTopicOutput(param) {
|
|
11
|
+
return Pulumi.all([
|
|
12
|
+
param.name,
|
|
13
|
+
param.id,
|
|
14
|
+
param.arn
|
|
15
|
+
]).apply(param => ({
|
|
16
|
+
id: param[1],
|
|
17
|
+
name: param[0],
|
|
18
|
+
arn: param[2]
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function toResource(tags, param) {
|
|
23
|
+
let name = param.name;
|
|
24
|
+
return Adapter$ReventlessInfra.make(name, param.id, param.arn, name.apply(param => AWS$ReventlessAws.SNS.service), undefined, undefined, undefined, Pulumi.output("aws:sns:Topic"), undefined, tags);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function findResolvedResource(resources) {
|
|
28
|
+
return Util_Adapter$ReventlessCore.findResolvedResource(resources, AWS$ReventlessAws.SNS.service);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
32
|
+
|
|
33
|
+
function findTopicInResolvedResources(resources) {
|
|
34
|
+
let resources$1 = Util_Adapter$ReventlessCore.filterSupportedResolvedResources(resources, [AWS$ReventlessAws.SNS.service]);
|
|
35
|
+
if (resources$1.length !== 0) {
|
|
36
|
+
return resources$1[0];
|
|
37
|
+
}
|
|
38
|
+
let err = "Couldn't find SNS Topic in resources";
|
|
39
|
+
log.error("SNS", undefined, err);
|
|
40
|
+
return Stdlib_JsError.throwWithMessage(err);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
toResolvedTopicOutput,
|
|
45
|
+
toResource,
|
|
46
|
+
findResolvedResource,
|
|
47
|
+
log,
|
|
48
|
+
findTopicInResolvedResources,
|
|
49
|
+
}
|
|
50
|
+
/* log Not a pure module */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
let toResource = (~tags=?, {PulumiAws.SNS.Topic.id: id, name, arn}) =>
|
|
2
|
+
ReventlessInfra.Adapter.make(
|
|
3
|
+
~name,
|
|
4
|
+
~id,
|
|
5
|
+
~urn=arn,
|
|
6
|
+
~service=name->Pulumi.Output.apply(_ => AWS.SNS_FIFO.service),
|
|
7
|
+
~resourceType="aws:sns:Topic"->Pulumi.Output.make,
|
|
8
|
+
~tags=?tags,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
let findTopicInResolvedResources = resources =>
|
|
12
|
+
switch resources->ReventlessCore.Util_Adapter.filterSupportedResolvedResources([
|
|
13
|
+
AWS.SNS_FIFO.service,
|
|
14
|
+
]) {
|
|
15
|
+
| [] =>
|
|
16
|
+
JsError.throwWithMessage(
|
|
17
|
+
"Util.SQS_FIFO.findTopicNameInUnwrappedResources: Couldn't find SNS_FIFO Topic in resources",
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
| resources => resources->Array.getUnsafe(0)
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
4
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
5
|
+
import * as AWS$ReventlessAws from "../adapter/AWS.res.mjs";
|
|
6
|
+
import * as Adapter$ReventlessInfra from "@reventlessdev/reventless-infra/src/adapter/Adapter.res.mjs";
|
|
7
|
+
import * as Util_Adapter$ReventlessCore from "@reventlessdev/reventless-core/src/util/Util_Adapter.res.mjs";
|
|
8
|
+
|
|
9
|
+
function toResource(tags, param) {
|
|
10
|
+
let name = param.name;
|
|
11
|
+
return Adapter$ReventlessInfra.make(name, param.id, param.arn, name.apply(param => AWS$ReventlessAws.SNS_FIFO.service), undefined, undefined, undefined, Pulumi.output("aws:sns:Topic"), undefined, tags);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function findTopicInResolvedResources(resources) {
|
|
15
|
+
let resources$1 = Util_Adapter$ReventlessCore.filterSupportedResolvedResources(resources, [AWS$ReventlessAws.SNS_FIFO.service]);
|
|
16
|
+
if (resources$1.length !== 0) {
|
|
17
|
+
return resources$1[0];
|
|
18
|
+
} else {
|
|
19
|
+
return Stdlib_JsError.throwWithMessage("Util.SQS_FIFO.findTopicNameInUnwrappedResources: Couldn't find SNS_FIFO Topic in resources");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
toResource,
|
|
25
|
+
findTopicInResolvedResources,
|
|
26
|
+
}
|
|
27
|
+
/* @pulumi/pulumi Not a pure module */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type resolvedTopic = {
|
|
2
|
+
id: string,
|
|
3
|
+
name: string,
|
|
4
|
+
arn: string,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
let publish = (topic, message) =>
|
|
8
|
+
Effect.tryPromise(
|
|
9
|
+
~catch=SNS_Error.classify,
|
|
10
|
+
() => AwsSdk.SNS_Helpers.publish(~topicArn=topic.arn, message),
|
|
11
|
+
)
|
|
12
|
+
->Effect.map(_ => ())
|
|
13
|
+
->Effect.retry(SNS_Error.retrySchedule)
|
|
14
|
+
->Effect.catchAll(err => {
|
|
15
|
+
let msg = SNS_Error.message(err)
|
|
16
|
+
ReventlessCore.EffectLogger.logError(~comp=__MODULE__, "publish: " ++ msg)
|
|
17
|
+
->Effect.flatMap(_ => Effect.fail(msg))
|
|
18
|
+
})
|
|
19
|
+
->Effect.runPromise
|
|
20
|
+
|
|
21
|
+
let publishFifo = (topic, ~messageGroupId, ~message) =>
|
|
22
|
+
Effect.tryPromise(
|
|
23
|
+
~catch=SNS_Error.classify,
|
|
24
|
+
() => AwsSdk.SNS_Helpers.publish(~topicArn=topic.arn, ~messageGroupId, message),
|
|
25
|
+
)
|
|
26
|
+
->Effect.map(_ => ())
|
|
27
|
+
->Effect.retry(SNS_Error.retrySchedule)
|
|
28
|
+
->Effect.catchAll(err => {
|
|
29
|
+
let msg = SNS_Error.message(err)
|
|
30
|
+
ReventlessCore.EffectLogger.logError(~comp=__MODULE__, "publishFifo: " ++ msg)
|
|
31
|
+
->Effect.flatMap(_ => Effect.fail(msg))
|
|
32
|
+
})
|
|
33
|
+
->Effect.runPromise
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
|
|
4
|
+
import * as Effect$1 from "effect/Effect";
|
|
5
|
+
import * as SNS_Helpers$AwsSdk from "@reventlessdev/rescript-aws-sdk/src/SNS_Helpers.res.mjs";
|
|
6
|
+
import * as SNS_Error$ReventlessAws from "../errors/SNS_Error.res.mjs";
|
|
7
|
+
import * as EffectLogger$ReventlessCore from "@reventlessdev/reventless-core/src/util/EffectLogger.res.mjs";
|
|
8
|
+
|
|
9
|
+
function publish(topic, message) {
|
|
10
|
+
return Effect$1.runPromise(Effect$1.catchAll(Effect$1.retry(Effect$1.map(Effect.tryPromise(SNS_Error$ReventlessAws.classify, () => SNS_Helpers$AwsSdk.publish(topic.arn, undefined, message)), param => {}), SNS_Error$ReventlessAws.retrySchedule), err => {
|
|
11
|
+
let msg = SNS_Error$ReventlessAws.message(err);
|
|
12
|
+
return Effect$1.flatMap(EffectLogger$ReventlessCore.logError("Util_SNS_Runtime-ReventlessAws", undefined, "publish: " + msg), () => Effect$1.fail(msg));
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function publishFifo(topic, messageGroupId, message) {
|
|
17
|
+
return Effect$1.runPromise(Effect$1.catchAll(Effect$1.retry(Effect$1.map(Effect.tryPromise(SNS_Error$ReventlessAws.classify, () => SNS_Helpers$AwsSdk.publish(topic.arn, messageGroupId, message)), param => {}), SNS_Error$ReventlessAws.retrySchedule), err => {
|
|
18
|
+
let msg = SNS_Error$ReventlessAws.message(err);
|
|
19
|
+
return Effect$1.flatMap(EffectLogger$ReventlessCore.logError("Util_SNS_Runtime-ReventlessAws", undefined, "publishFifo: " + msg), () => Effect$1.fail(msg));
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
publish,
|
|
25
|
+
publishFifo,
|
|
26
|
+
}
|
|
27
|
+
/* Effect Not a pure module */
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
open PulumiAws
|
|
2
|
+
|
|
3
|
+
type channelParts = {queue: PulumiAws.SQS.Queue.t}
|
|
4
|
+
|
|
5
|
+
let toResolvedQueueOutput = ({name, id, arn}: PulumiAws.SQS.Queue.t) =>
|
|
6
|
+
(name, id, arn)
|
|
7
|
+
->Pulumi.Output.all3
|
|
8
|
+
->Pulumi.Output.apply(((name, id, arn)) => {
|
|
9
|
+
Util_SQS_Runtime.id,
|
|
10
|
+
name,
|
|
11
|
+
arn,
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
let toResource = (~tags=?, queue: PulumiAws.SQS.Queue.t): ReventlessInfra.Adapter.resource =>
|
|
15
|
+
ReventlessInfra.Adapter.make(
|
|
16
|
+
~name=queue.name,
|
|
17
|
+
~id=queue.id,
|
|
18
|
+
~urn=queue.arn,
|
|
19
|
+
~service=queue.name->Pulumi.Output.apply(_ => AWS.SQS.service),
|
|
20
|
+
~resourceType="aws:sqs:Queue"->Pulumi.Output.make,
|
|
21
|
+
~tags=?tags,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
let fromResource = ({id, name}: ReventlessInfra.Adapter.resource) => {
|
|
25
|
+
name->Pulumi.Output.apply(name => PulumiAws.SQS.Queue.get(~name, ~id=id->Pulumi.Output.asInput))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Example ARN: arn:aws:sqs:eu-west-1:xxxxxx:MarketplaceServiceExtensionPointCommandTopic-0101023
|
|
29
|
+
let arn2Account = arn =>
|
|
30
|
+
switch arn->String.split(":") {
|
|
31
|
+
| [_, _, _, _, account, _] => account
|
|
32
|
+
| _ => ""
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let subscribeToSnsTopic = (
|
|
36
|
+
~queue: PulumiAws.SQS.Queue.t,
|
|
37
|
+
~targetName,
|
|
38
|
+
~sourceName,
|
|
39
|
+
~topic: ReventlessInfra.Adapter.resource,
|
|
40
|
+
~opts,
|
|
41
|
+
) =>
|
|
42
|
+
SNS.TopicSubscription.make(
|
|
43
|
+
~name=sourceName->ReventlessCore.Util.baseName ++ ("2" ++ targetName),
|
|
44
|
+
~args={
|
|
45
|
+
endpoint: queue.arn->Pulumi.Output.asInput,
|
|
46
|
+
protocol: SQS,
|
|
47
|
+
topic: topic.urn->Pulumi.Output.asInput,
|
|
48
|
+
rawMessageDelivery: true->Pulumi.Input.make,
|
|
49
|
+
},
|
|
50
|
+
~opts=Some(opts),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
let findResource = resources => resources->ReventlessCore.Util.Adapter.findResource(AWS.SQS.service)
|
|
54
|
+
|
|
55
|
+
let findResourceInOutput = resourcesOutput =>
|
|
56
|
+
resourcesOutput->ReventlessCore.Util.Adapter.findResourceInOutput(AWS.SQS.service)
|
|
57
|
+
|
|
58
|
+
let findResolvedResource = resources =>
|
|
59
|
+
resources->ReventlessCore.Util.AdapterRuntime.findResolvedResource(AWS.SQS.service)
|
|
60
|
+
|
|
61
|
+
module Subscription = {
|
|
62
|
+
let toResource = ({eventSourceMapping: {id, arn}}: PulumiAws.SQS.Queue.eventSubscription): ReventlessInfra.Adapter.resource =>
|
|
63
|
+
ReventlessInfra.Adapter.make(
|
|
64
|
+
~name=id,
|
|
65
|
+
~id,
|
|
66
|
+
~urn=arn,
|
|
67
|
+
~service=id->Pulumi.Output.apply(_ => AWS.SQS.service),
|
|
68
|
+
~resourceType="aws:sqs:Queue"->Pulumi.Output.make,
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Aws from "@pulumi/aws";
|
|
4
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
5
|
+
import * as AWS$ReventlessAws from "../adapter/AWS.res.mjs";
|
|
6
|
+
import * as Util$ReventlessCore from "@reventlessdev/reventless-core/src/util/Util.res.mjs";
|
|
7
|
+
import * as Adapter$ReventlessInfra from "@reventlessdev/reventless-infra/src/adapter/Adapter.res.mjs";
|
|
8
|
+
import * as Util_Adapter$ReventlessCore from "@reventlessdev/reventless-core/src/util/Util_Adapter.res.mjs";
|
|
9
|
+
import * as Util_AdapterRuntime$ReventlessCore from "@reventlessdev/reventless-core/src/util/Util_AdapterRuntime.res.mjs";
|
|
10
|
+
|
|
11
|
+
function toResolvedQueueOutput(param) {
|
|
12
|
+
return Pulumi.all([
|
|
13
|
+
param.name,
|
|
14
|
+
param.id,
|
|
15
|
+
param.arn
|
|
16
|
+
]).apply(param => ({
|
|
17
|
+
id: param[1],
|
|
18
|
+
name: param[0],
|
|
19
|
+
arn: param[2]
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function toResource(tags, queue) {
|
|
24
|
+
return Adapter$ReventlessInfra.make(queue.name, queue.id, queue.arn, queue.name.apply(param => AWS$ReventlessAws.SQS.service), undefined, undefined, undefined, Pulumi.output("aws:sqs:Queue"), undefined, tags);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function fromResource(param) {
|
|
28
|
+
let id = param.id;
|
|
29
|
+
return param.name.apply(name => Aws.sqs.Queue.get(name, id));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function arn2Account(arn) {
|
|
33
|
+
let match = arn.split(":");
|
|
34
|
+
if (match.length !== 6) {
|
|
35
|
+
return "";
|
|
36
|
+
} else {
|
|
37
|
+
return match[4];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function subscribeToSnsTopic(queue, targetName, sourceName, topic, opts) {
|
|
42
|
+
return new (Aws.sns.TopicSubscription)(Util$ReventlessCore.baseName(sourceName) + ("2" + targetName), {
|
|
43
|
+
endpoint: queue.arn,
|
|
44
|
+
topic: topic.urn,
|
|
45
|
+
protocol: "sqs",
|
|
46
|
+
rawMessageDelivery: true
|
|
47
|
+
}, opts);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function findResource(resources) {
|
|
51
|
+
return Util_Adapter$ReventlessCore.findResource(resources, AWS$ReventlessAws.SQS.service);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function findResourceInOutput(resourcesOutput) {
|
|
55
|
+
return Util_Adapter$ReventlessCore.findResourceInOutput(resourcesOutput, AWS$ReventlessAws.SQS.service);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function findResolvedResource(resources) {
|
|
59
|
+
return Util_AdapterRuntime$ReventlessCore.findResolvedResource(resources, AWS$ReventlessAws.SQS.service);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function toResource$1(param) {
|
|
63
|
+
let match = param.eventSourceMapping;
|
|
64
|
+
let id = match.id;
|
|
65
|
+
return Adapter$ReventlessInfra.make(id, id, match.arn, id.apply(param => AWS$ReventlessAws.SQS.service), undefined, undefined, undefined, Pulumi.output("aws:sqs:Queue"), undefined, undefined);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let Subscription = {
|
|
69
|
+
toResource: toResource$1
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
toResolvedQueueOutput,
|
|
74
|
+
toResource,
|
|
75
|
+
fromResource,
|
|
76
|
+
arn2Account,
|
|
77
|
+
subscribeToSnsTopic,
|
|
78
|
+
findResource,
|
|
79
|
+
findResourceInOutput,
|
|
80
|
+
findResolvedResource,
|
|
81
|
+
Subscription,
|
|
82
|
+
}
|
|
83
|
+
/* @pulumi/aws Not a pure module */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let toResource = (~tags=?, {id, name, arn}: PulumiAws.SQS_Queue.t): ReventlessInfra.Adapter.resource =>
|
|
2
|
+
ReventlessInfra.Adapter.make(
|
|
3
|
+
~name,
|
|
4
|
+
~id,
|
|
5
|
+
~urn=arn,
|
|
6
|
+
~service=name->Pulumi.Output.apply(_ => AWS.SQS_FIFO.service),
|
|
7
|
+
~resourceType="aws:sqs:Queue"->Pulumi.Output.make,
|
|
8
|
+
~tags=?tags,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
let fromResource = ({id, name}: ReventlessInfra.Adapter.resource) => {
|
|
12
|
+
name->Pulumi.Output.apply(name => PulumiAws.SQS.Queue.get(~name, ~id=id->Pulumi.Output.asInput))
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let findResource = resources =>
|
|
16
|
+
resources->ReventlessCore.Util.Adapter.findResource(AWS.SQS_FIFO.service)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Aws from "@pulumi/aws";
|
|
4
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
5
|
+
import * as AWS$ReventlessAws from "../adapter/AWS.res.mjs";
|
|
6
|
+
import * as Adapter$ReventlessInfra from "@reventlessdev/reventless-infra/src/adapter/Adapter.res.mjs";
|
|
7
|
+
import * as Util_Adapter$ReventlessCore from "@reventlessdev/reventless-core/src/util/Util_Adapter.res.mjs";
|
|
8
|
+
|
|
9
|
+
function toResource(tags, param) {
|
|
10
|
+
let name = param.name;
|
|
11
|
+
return Adapter$ReventlessInfra.make(name, param.id, param.arn, name.apply(param => AWS$ReventlessAws.SQS_FIFO.service), undefined, undefined, undefined, Pulumi.output("aws:sqs:Queue"), undefined, tags);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function fromResource(param) {
|
|
15
|
+
let id = param.id;
|
|
16
|
+
return param.name.apply(name => Aws.sqs.Queue.get(name, id));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function findResource(resources) {
|
|
20
|
+
return Util_Adapter$ReventlessCore.findResource(resources, AWS$ReventlessAws.SQS_FIFO.service);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
toResource,
|
|
25
|
+
fromResource,
|
|
26
|
+
findResource,
|
|
27
|
+
}
|
|
28
|
+
/* @pulumi/aws Not a pure module */
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
open ReventlessCore.Message
|
|
2
|
+
open AwsSdk
|
|
3
|
+
|
|
4
|
+
type resolvedQueue = {
|
|
5
|
+
id: string,
|
|
6
|
+
name: string,
|
|
7
|
+
arn: string,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let toResolvedQueue = ({id, name, urn}: ReventlessCore.Adapter.resolvedResource) => {
|
|
11
|
+
id,
|
|
12
|
+
name,
|
|
13
|
+
arn: urn,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@module("node:crypto") external _createHash: string => 'h = "createHash"
|
|
17
|
+
@send external _update: ('h, string) => 'h = "update"
|
|
18
|
+
@send external _digest: ('h, string) => string = "digest"
|
|
19
|
+
|
|
20
|
+
/** Returns `id` unchanged if ≤ 128 chars; otherwise its SHA-256 hex digest (64 chars).
|
|
21
|
+
SQS FIFO MessageGroupId is limited to 128 characters. Using a hash instead of
|
|
22
|
+
truncation avoids false-grouping of distinct keys that share a long prefix. */
|
|
23
|
+
let safeGroupId = (id: string): string =>
|
|
24
|
+
if id->String.length <= 128 {
|
|
25
|
+
id
|
|
26
|
+
} else {
|
|
27
|
+
_createHash("sha256")->_update(id)->_digest("hex")
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let sendMessage = (queue, ~delay=?, messageBody) =>
|
|
31
|
+
SQS_Helpers.sendMessage(~queueId=queue.id, ~messageBody, ~delay?)
|
|
32
|
+
|
|
33
|
+
let sendFifoMessage = (queue, ~delay=?, ~messageGroupId, messageBody) =>
|
|
34
|
+
SQS_Helpers.sendMessage(~queueId=queue.id, ~messageBody, ~messageGroupId, ~delay?)
|
|
35
|
+
|
|
36
|
+
let send = (queue, queueService, commandJson) => {
|
|
37
|
+
let messageBody = commandJson->toMessageBody
|
|
38
|
+
Effect.tryPromise(
|
|
39
|
+
~catch=SQS_Error.classify,
|
|
40
|
+
() =>
|
|
41
|
+
if queueService == AWS.SQS_FIFO {
|
|
42
|
+
queue->sendFifoMessage(
|
|
43
|
+
~messageGroupId=safeGroupId(commandJson.id),
|
|
44
|
+
~delay=?commandJson.delay,
|
|
45
|
+
messageBody,
|
|
46
|
+
)
|
|
47
|
+
} else {
|
|
48
|
+
queue->sendMessage(~delay=?commandJson.delay, messageBody)
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
->Effect.map(_ => ())
|
|
52
|
+
->Effect.retry(SQS_Error.sendRetrySchedule)
|
|
53
|
+
->Effect.catchAll(err => {
|
|
54
|
+
let msg = SQS_Error.message(err)
|
|
55
|
+
ReventlessCore.EffectLogger.logError(~comp=__MODULE__, "send: " ++ msg)
|
|
56
|
+
->Effect.flatMap(_ => Effect.fail(msg))
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let makeEntry = (queueService, commandJson) => {
|
|
61
|
+
let {id, meta: {msgId: messageId}} = commandJson
|
|
62
|
+
let messageBody = commandJson->toMessageBody
|
|
63
|
+
|
|
64
|
+
if queueService == AWS.SQS_FIFO {
|
|
65
|
+
SQS_Helpers.makeBatchEntryFifo(~groupId=safeGroupId(id), ~messageId, ~messageBody, ~delay=?commandJson.delay)
|
|
66
|
+
} else {
|
|
67
|
+
SQS_Helpers.makeBatchEntry(~messageId, ~messageBody, ~delay=?commandJson.delay)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let sendMessagesMaxRetries = 5
|
|
72
|
+
|
|
73
|
+
let sendMessages = (queue, queueService, commandJsons) => {
|
|
74
|
+
let rec attempt = (retry, toSend) =>
|
|
75
|
+
Effect.tryPromise(
|
|
76
|
+
~catch=SQS_Error.classify,
|
|
77
|
+
() =>
|
|
78
|
+
toSend
|
|
79
|
+
->Array.map(commandJson => makeEntry(queueService, commandJson))
|
|
80
|
+
->SQS_Helpers.sendMessagesParallel(~queueId=queue.id),
|
|
81
|
+
)
|
|
82
|
+
->Effect.retry(SQS_Error.retrySchedule)
|
|
83
|
+
->Effect.flatMap(result =>
|
|
84
|
+
switch result {
|
|
85
|
+
| Ok() => Effect.succeed()
|
|
86
|
+
| Error(failedIds) =>
|
|
87
|
+
let commandJsonsToRetry =
|
|
88
|
+
toSend->Array.filter(({meta: {msgId}}) =>
|
|
89
|
+
failedIds->Array.some(failedId => failedId == msgId)
|
|
90
|
+
)
|
|
91
|
+
if retry < sendMessagesMaxRetries {
|
|
92
|
+
ReventlessCore.EffectLogger.logInfo(
|
|
93
|
+
~comp=__MODULE__,
|
|
94
|
+
`sendMessages: ${failedIds->Array.length->Int.toString} failed ids, retrying subset`,
|
|
95
|
+
)
|
|
96
|
+
->Effect.flatMap(_ => attempt(retry + 1, commandJsonsToRetry))
|
|
97
|
+
} else {
|
|
98
|
+
let ids = failedIds->Array.joinUnsafe(", ")
|
|
99
|
+
Effect.fail(SQS_Error.Permanent(`sendMessages failed for ids: ${ids}`))
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
attempt(0, commandJsons)
|
|
104
|
+
->Effect.catchAll(err => {
|
|
105
|
+
let msg = SQS_Error.message(err)
|
|
106
|
+
ReventlessCore.EffectLogger.logError(~comp=__MODULE__, `sendMessages: ${msg}`)
|
|
107
|
+
->Effect.flatMap(_ => Effect.fail(msg))
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
let deleteMessage = async (queue, receiptHandle) => {
|
|
112
|
+
await {
|
|
113
|
+
queueUrl: queue.id,
|
|
114
|
+
receiptHandle,
|
|
115
|
+
}
|
|
116
|
+
->SQS.DeleteMessageCommand.make
|
|
117
|
+
->SQS.DeleteMessageCommand.send
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
let deleteMessagesMaxRetries = 5
|
|
121
|
+
|
|
122
|
+
let deleteMessages = (entries, queue) => {
|
|
123
|
+
let rec attempt = (retry, toDelete) =>
|
|
124
|
+
Effect.tryPromise(
|
|
125
|
+
~catch=SQS_Error.classify,
|
|
126
|
+
() => SQS_Helpers.deleteMessagesParallel(~queueId=queue.id, toDelete),
|
|
127
|
+
)
|
|
128
|
+
->Effect.retry(SQS_Error.retrySchedule)
|
|
129
|
+
->Effect.flatMap(result =>
|
|
130
|
+
switch result {
|
|
131
|
+
| Ok() => Effect.succeed()
|
|
132
|
+
| Error(failedIds) =>
|
|
133
|
+
let entriesToRetry =
|
|
134
|
+
toDelete
|
|
135
|
+
->Array.filterWithIndex((_, idx) => {
|
|
136
|
+
let id = idx->Int.toString
|
|
137
|
+
failedIds->Array.some(failedId => failedId == id)
|
|
138
|
+
})
|
|
139
|
+
->Array.mapWithIndex((entry, idx) => {
|
|
140
|
+
AwsSdk.SQS.DeleteMessageBatchCommand.id: idx->Int.toString,
|
|
141
|
+
receiptHandle: entry.receiptHandle,
|
|
142
|
+
})
|
|
143
|
+
if retry < deleteMessagesMaxRetries {
|
|
144
|
+
ReventlessCore.EffectLogger.logInfo(
|
|
145
|
+
~comp=__MODULE__,
|
|
146
|
+
`deleteMessages: ${failedIds->Array.length->Int.toString} failed ids, retrying subset`,
|
|
147
|
+
)
|
|
148
|
+
->Effect.flatMap(_ => attempt(retry + 1, entriesToRetry))
|
|
149
|
+
} else {
|
|
150
|
+
let ids = failedIds->Array.joinUnsafe(", ")
|
|
151
|
+
Effect.fail(SQS_Error.Permanent(`deleteMessages failed for ids: ${ids}`))
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
attempt(0, entries)
|
|
156
|
+
->Effect.catchAll(err => {
|
|
157
|
+
let msg = SQS_Error.message(err)
|
|
158
|
+
ReventlessCore.EffectLogger.logError(~comp=__MODULE__, `deleteMessages: ${msg}`)
|
|
159
|
+
->Effect.flatMap(_ => Effect.fail(msg))
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
let parseSqsRecord = (record: PulumiAws.SQS.Queue.record) => {
|
|
164
|
+
let eventStr = record.body
|
|
165
|
+
switch eventStr->JSON.parseOrThrow {
|
|
166
|
+
| json => Some(json)
|
|
167
|
+
| exception _err => None
|
|
168
|
+
}
|
|
169
|
+
}
|