@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,106 @@
|
|
|
1
|
+
// Platform_Casts — typed identity coercions used by Platform.MakeWithConfig.
|
|
2
|
+
//
|
|
3
|
+
// Every cast here is a `%identity` external: zero runtime cost, the value passes
|
|
4
|
+
// through unchanged. The coercions are necessary because two independent
|
|
5
|
+
// architectural constraints prevent the type system from expressing the correct
|
|
6
|
+
// concrete type at the boundaries where these values flow.
|
|
7
|
+
//
|
|
8
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
// WHY CASTS ARE NEEDED AT ALL
|
|
10
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
//
|
|
12
|
+
// The Reventless package hierarchy is:
|
|
13
|
+
//
|
|
14
|
+
// reventless-spec
|
|
15
|
+
// └── reventless (core)
|
|
16
|
+
// └── reventless-aws
|
|
17
|
+
//
|
|
18
|
+
// `reventless-core` defines the platform hook interface (`platformHooks`) that
|
|
19
|
+
// AWS, in-memory, and any future provider all implement. Because `reventless-core`
|
|
20
|
+
// sits *below* `reventless-aws` in the dependency graph, it cannot import AWS
|
|
21
|
+
// types such as `Util.Lambda.runtimeParts`, `DcbEventLog.component`, or
|
|
22
|
+
// `Util.SQS.channelParts`. Hook callbacks therefore use `unknown` (or a generic
|
|
23
|
+
// parameter) at the boundary where `reventless-core` hands values to the
|
|
24
|
+
// provider. The AWS platform is the only caller and always passes the right
|
|
25
|
+
// type, but the type system cannot see through the abstraction layer.
|
|
26
|
+
//
|
|
27
|
+
// The alternative — making `platformHooks` fully generic over every AWS-specific
|
|
28
|
+
// type — would thread extra type parameters through Plugin_Builder, Admin, and
|
|
29
|
+
// every functor that touches hooks. The type noise would dwarf the safety gain.
|
|
30
|
+
//
|
|
31
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
32
|
+
// CAST 1 — runtime environment type parameter
|
|
33
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
34
|
+
//
|
|
35
|
+
// `inboundAppSyncResolverParams` and `dcbAppSyncResolverParams` (defined in
|
|
36
|
+
// Plugin_Helpers.res) carry:
|
|
37
|
+
//
|
|
38
|
+
// runtime: Runtime.environment<unknown>
|
|
39
|
+
//
|
|
40
|
+
// The hook boundary erases the concrete parts type to `unknown` because
|
|
41
|
+
// `reventless-core` cannot reference `Util.Lambda.runtimeParts`. At runtime
|
|
42
|
+
// the AWS platform always passes a genuine `Runtime.environment<runtimeParts>`,
|
|
43
|
+
// so narrowing the type parameter is safe.
|
|
44
|
+
//
|
|
45
|
+
// The "proper" fix — `inboundAppSyncResolverParams<'runtimeParts>` — would
|
|
46
|
+
// require propagating `'runtimeParts` through `platformHooks`, `Plugin_Builder`,
|
|
47
|
+
// and `Admin`.
|
|
48
|
+
external asLambdaRuntime: ReventlessCore.Runtime.environment<unknown> => ReventlessCore.Runtime.environment<Util.Lambda.runtimeParts> = "%identity"
|
|
49
|
+
|
|
50
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
51
|
+
// CAST 2 — hook callback arguments (unknown → concrete component types)
|
|
52
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
53
|
+
//
|
|
54
|
+
// The deployment lifecycle hooks in `platformHooks`:
|
|
55
|
+
//
|
|
56
|
+
// onDcbEventLogCreated?: unknown => unit
|
|
57
|
+
// onDcbCommandTopicCreated?: unknown => unit
|
|
58
|
+
// onDcbSlicesCreated?: unknown => unit
|
|
59
|
+
// onHeartbeatEpChannelAvailable?: (unknown, ~pluginId: string) => unit
|
|
60
|
+
//
|
|
61
|
+
// are typed `unknown => unit` for the same dependency-inversion reason as above:
|
|
62
|
+
// `reventless-core` cannot import `DcbEventLog.component`, `CommandTopic.component`,
|
|
63
|
+
// or `CommandTopic_Adapter.remoteChannel`. The AWS platform registers these
|
|
64
|
+
// callbacks and is the only caller, always passing the correct concrete value.
|
|
65
|
+
external asDcbEventLogComponent: unknown => ReventlessCore.Component.t<unit, ReventlessCore.DcbEventLog.outputs, unit> = "%identity"
|
|
66
|
+
external asDcbCommandTopicComponent: unknown => ReventlessCore.CommandTopic.component<unit> = "%identity"
|
|
67
|
+
external asDcbEventLog: unknown => ReventlessCore.DcbEventLog.component = "%identity"
|
|
68
|
+
external asRemoteChannel: unknown => ReventlessCore.CommandTopic_Adapter.remoteChannel = "%identity"
|
|
69
|
+
|
|
70
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
71
|
+
// CAST 3 — generic adapter channel parts
|
|
72
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
73
|
+
//
|
|
74
|
+
// `CommandTopic_Adapter.channel` carries:
|
|
75
|
+
//
|
|
76
|
+
// parts: 'channelParts (generic — provider fills this in)
|
|
77
|
+
//
|
|
78
|
+
// The adapter interface is provider-agnostic so the field is left generic.
|
|
79
|
+
// The AWS adapter always stores a `Util.SQS.channelParts` value there.
|
|
80
|
+
// Threading `'channelParts` through the adapter interface and all its callers
|
|
81
|
+
// would be a large, noisy change for a single specialisation.
|
|
82
|
+
external asSqsChannelParts: 'a => Util.SQS.channelParts = "%identity"
|
|
83
|
+
|
|
84
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
85
|
+
// CAST 4 — Pulumi Output Proxy vs. ReScript option boxing
|
|
86
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
87
|
+
//
|
|
88
|
+
// This cast is categorically different: it is a *runtime hazard*, not a type
|
|
89
|
+
// system limitation.
|
|
90
|
+
//
|
|
91
|
+
// `Pulumi.Output.t<'a>` values are ES6 Proxy objects. ReScript's option encoding
|
|
92
|
+
// uses a sentinel property `BS_PRIVATE_NESTED_SOME_NONE` to distinguish
|
|
93
|
+
// `Some(Some(x))` from `Some(x)`. When a Proxy is placed directly inside
|
|
94
|
+
// `Some(pulumiOutput)`, the Proxy intercepts the sentinel property lookup and
|
|
95
|
+
// can return an unexpected result, silently corrupting the None/Some distinction
|
|
96
|
+
// at runtime.
|
|
97
|
+
//
|
|
98
|
+
// The `{val: x}` wrapper (`hookedValue<unknown>`) avoids this by never placing
|
|
99
|
+
// the Proxy directly in the option slot. The concrete type is recovered via
|
|
100
|
+
// `Obj.magic` in `Plugin_Builder` where the provider-specific type is known.
|
|
101
|
+
//
|
|
102
|
+
// There is no type-level fix because the problem does not exist at the type
|
|
103
|
+
// level — it is a mismatch between ReScript's JS boxing convention and Pulumi's
|
|
104
|
+
// Proxy-based lazy evaluation model.
|
|
105
|
+
external _toUnknown: 'a => unknown = "%identity"
|
|
106
|
+
let wrapHookedValue: 'a => ReventlessCore.Plugin_Helpers.hookedValue<unknown> = x => {val: x->_toUnknown}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// Platform-level stack helpers — for resources that belong to the platform
|
|
2
|
+
// stack (not per-plugin) such as the Cognito UserPool used by every API.
|
|
3
|
+
|
|
4
|
+
type cognitoUserPool = {
|
|
5
|
+
poolId: Pulumi.Output.t<string>,
|
|
6
|
+
clientId: Pulumi.Output.t<string>,
|
|
7
|
+
poolArn: Pulumi.Output.t<string>,
|
|
8
|
+
managed: bool,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the Cognito UserPool used by AppSync auth. Two modes:
|
|
13
|
+
*
|
|
14
|
+
* - **Auto**: no `platform:cognitoUserPoolId` config — create a fresh UserPool
|
|
15
|
+
* with SPA-friendly defaults (email username, 12-char password policy, no
|
|
16
|
+
* MFA, admin-only user creation). Caller is responsible for creating
|
|
17
|
+
* groups (`Admin`, `User`, …) and users via the AWS console / CLI.
|
|
18
|
+
*
|
|
19
|
+
* - **BYO**: pool ID provided — skip pool creation, look up the existing
|
|
20
|
+
* pool via `aws.cognito.getUserPool` for its ARN. Lookup precedence
|
|
21
|
+
* (highest → lowest):
|
|
22
|
+
* 1. `REVENTLESS_COGNITO_USER_POOL_ID` env var (typically a CI secret).
|
|
23
|
+
* 2. `Pulumi.local.yaml` sidecar key `cognitoUserPoolId` (gitignored;
|
|
24
|
+
* per-dev override).
|
|
25
|
+
* 3. `platform:cognitoUserPoolId` in the checked-in `Pulumi.<stack>.yaml`.
|
|
26
|
+
*
|
|
27
|
+
* In both modes the framework owns the `UserPoolClient` (SPA settings would
|
|
28
|
+
* not reliably exist on a pre-existing client; the client is a child resource
|
|
29
|
+
* Pulumi can destroy without touching the parent pool).
|
|
30
|
+
*
|
|
31
|
+
* Always exports `cognitoUserPoolId`, `cognitoUserPoolClientId`,
|
|
32
|
+
* `cognitoUserPoolArn`, `cognitoRegion`, and `cognitoUserPoolManaged` as
|
|
33
|
+
* stack outputs so downstream stacks (and Stage D AppSync wiring) can read
|
|
34
|
+
* them via `StackReference`.
|
|
35
|
+
*/
|
|
36
|
+
let _resolveUncached = (): cognitoUserPool => {
|
|
37
|
+
let cfg = Pulumi.Config.make(Some("platform"))
|
|
38
|
+
let existingPoolId = switch Util_LocalConfig.get("cognitoUserPoolId") {
|
|
39
|
+
| Some(_) as v => v
|
|
40
|
+
| None => cfg->Pulumi.Config.get("cognitoUserPoolId")
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let result = switch existingPoolId {
|
|
44
|
+
| Some(poolId) =>
|
|
45
|
+
let tokenUnits: PulumiAws.Cognito.UserPoolClient.tokenValidityUnits = {
|
|
46
|
+
accessToken: Pulumi.Input.make("minutes"),
|
|
47
|
+
idToken: Pulumi.Input.make("minutes"),
|
|
48
|
+
refreshToken: Pulumi.Input.make("days"),
|
|
49
|
+
}
|
|
50
|
+
let client = PulumiAws.Cognito.UserPoolClient.make(
|
|
51
|
+
~name="HostUiClient",
|
|
52
|
+
~args={
|
|
53
|
+
userPoolId: Pulumi.Input.make(poolId),
|
|
54
|
+
generateSecret: Pulumi.Input.make(false),
|
|
55
|
+
explicitAuthFlows: Pulumi.Input.make([
|
|
56
|
+
Pulumi.Input.make("ALLOW_USER_PASSWORD_AUTH"),
|
|
57
|
+
Pulumi.Input.make("ALLOW_REFRESH_TOKEN_AUTH"),
|
|
58
|
+
]),
|
|
59
|
+
preventUserExistenceErrors: Pulumi.Input.make("ENABLED"),
|
|
60
|
+
idTokenValidity: Pulumi.Input.make(60),
|
|
61
|
+
accessTokenValidity: Pulumi.Input.make(60),
|
|
62
|
+
refreshTokenValidity: Pulumi.Input.make(30),
|
|
63
|
+
tokenValidityUnits: Pulumi.Input.make(tokenUnits),
|
|
64
|
+
},
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
let lookup = PulumiAws.Cognito.UserPool.getUserPoolOutput(~args={userPoolId: poolId})
|
|
68
|
+
|
|
69
|
+
{
|
|
70
|
+
poolId: Pulumi.Output.make(poolId),
|
|
71
|
+
clientId: client.id,
|
|
72
|
+
poolArn: lookup->Pulumi.Output.apply(r => r.arn),
|
|
73
|
+
managed: false,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
| None =>
|
|
77
|
+
let adminConfig: PulumiAws.Cognito.UserPool.adminCreateUserConfig = {
|
|
78
|
+
allowAdminCreateUserOnly: Pulumi.Input.make(true),
|
|
79
|
+
}
|
|
80
|
+
let pwdPolicy: PulumiAws.Cognito.UserPool.passwordPolicy = {
|
|
81
|
+
minimumLength: Pulumi.Input.make(12),
|
|
82
|
+
requireLowercase: Pulumi.Input.make(true),
|
|
83
|
+
requireUppercase: Pulumi.Input.make(true),
|
|
84
|
+
requireNumbers: Pulumi.Input.make(true),
|
|
85
|
+
}
|
|
86
|
+
let pool = PulumiAws.Cognito.UserPool.make(
|
|
87
|
+
~name="HostUiPool",
|
|
88
|
+
~args={
|
|
89
|
+
adminCreateUserConfig: Pulumi.Input.make(adminConfig),
|
|
90
|
+
usernameAttributes: Pulumi.Input.make([Pulumi.Input.make("email")]),
|
|
91
|
+
passwordPolicy: Pulumi.Input.make(pwdPolicy),
|
|
92
|
+
mfaConfiguration: Pulumi.Input.make("OFF"),
|
|
93
|
+
},
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
let tokenUnits2: PulumiAws.Cognito.UserPoolClient.tokenValidityUnits = {
|
|
97
|
+
accessToken: Pulumi.Input.make("minutes"),
|
|
98
|
+
idToken: Pulumi.Input.make("minutes"),
|
|
99
|
+
refreshToken: Pulumi.Input.make("days"),
|
|
100
|
+
}
|
|
101
|
+
let client = PulumiAws.Cognito.UserPoolClient.make(
|
|
102
|
+
~name="HostUiClient",
|
|
103
|
+
~args={
|
|
104
|
+
userPoolId: pool.id->Pulumi.Output.asInput,
|
|
105
|
+
generateSecret: Pulumi.Input.make(false),
|
|
106
|
+
explicitAuthFlows: Pulumi.Input.make([
|
|
107
|
+
Pulumi.Input.make("ALLOW_USER_PASSWORD_AUTH"),
|
|
108
|
+
Pulumi.Input.make("ALLOW_REFRESH_TOKEN_AUTH"),
|
|
109
|
+
]),
|
|
110
|
+
preventUserExistenceErrors: Pulumi.Input.make("ENABLED"),
|
|
111
|
+
idTokenValidity: Pulumi.Input.make(60),
|
|
112
|
+
accessTokenValidity: Pulumi.Input.make(60),
|
|
113
|
+
refreshTokenValidity: Pulumi.Input.make(30),
|
|
114
|
+
tokenValidityUnits: Pulumi.Input.make(tokenUnits2),
|
|
115
|
+
},
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
{
|
|
119
|
+
poolId: pool.id,
|
|
120
|
+
clientId: client.id,
|
|
121
|
+
poolArn: pool.arn,
|
|
122
|
+
managed: true,
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let regionStr =
|
|
127
|
+
Pulumi.Config.make(Some("aws"))->Pulumi.Config.get("region")->Option.getOr("unknown")
|
|
128
|
+
|
|
129
|
+
Pulumi.Pulumi.export("cognitoUserPoolId", result.poolId)
|
|
130
|
+
Pulumi.Pulumi.export("cognitoUserPoolClientId", result.clientId)
|
|
131
|
+
Pulumi.Pulumi.export("cognitoUserPoolArn", result.poolArn)
|
|
132
|
+
Pulumi.Pulumi.export("cognitoRegion", Pulumi.Output.make(regionStr))
|
|
133
|
+
Pulumi.Pulumi.export(
|
|
134
|
+
"cognitoUserPoolManaged",
|
|
135
|
+
Pulumi.Output.make(result.managed ? "true" : "false"),
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
result
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Process-level cache so multiple callers (Main.res + Auth_Cognito.make from
|
|
142
|
+
// inside Platform.MakeWithConfig) converge on the same pool/client and the
|
|
143
|
+
// stack-export calls happen exactly once per Pulumi run.
|
|
144
|
+
let _cached: ref<option<cognitoUserPool>> = ref(None)
|
|
145
|
+
|
|
146
|
+
let resolveCognitoUserPool = (): cognitoUserPool =>
|
|
147
|
+
switch _cached.contents {
|
|
148
|
+
| Some(p) => p
|
|
149
|
+
| None =>
|
|
150
|
+
let p = _resolveUncached()
|
|
151
|
+
_cached := Some(p)
|
|
152
|
+
p
|
|
153
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Aws from "@pulumi/aws";
|
|
4
|
+
import * as Pulumi$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Pulumi.res.mjs";
|
|
5
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
7
|
+
import * as Util_LocalConfig$ReventlessAws from "./util/Util_LocalConfig.res.mjs";
|
|
8
|
+
|
|
9
|
+
function _resolveUncached() {
|
|
10
|
+
let cfg = new Pulumi.Config("platform");
|
|
11
|
+
let v = Util_LocalConfig$ReventlessAws.get("cognitoUserPoolId");
|
|
12
|
+
let existingPoolId = v !== undefined ? v : cfg.get("cognitoUserPoolId");
|
|
13
|
+
let result;
|
|
14
|
+
if (existingPoolId !== undefined) {
|
|
15
|
+
let tokenUnits_accessToken = "minutes";
|
|
16
|
+
let tokenUnits_idToken = "minutes";
|
|
17
|
+
let tokenUnits_refreshToken = "days";
|
|
18
|
+
let tokenUnits = {
|
|
19
|
+
accessToken: tokenUnits_accessToken,
|
|
20
|
+
idToken: tokenUnits_idToken,
|
|
21
|
+
refreshToken: tokenUnits_refreshToken
|
|
22
|
+
};
|
|
23
|
+
let client = new (Aws.cognito.UserPoolClient)("HostUiClient", {
|
|
24
|
+
userPoolId: existingPoolId,
|
|
25
|
+
generateSecret: false,
|
|
26
|
+
explicitAuthFlows: [
|
|
27
|
+
"ALLOW_USER_PASSWORD_AUTH",
|
|
28
|
+
"ALLOW_REFRESH_TOKEN_AUTH"
|
|
29
|
+
],
|
|
30
|
+
preventUserExistenceErrors: "ENABLED",
|
|
31
|
+
idTokenValidity: 60,
|
|
32
|
+
accessTokenValidity: 60,
|
|
33
|
+
refreshTokenValidity: 30,
|
|
34
|
+
tokenValidityUnits: tokenUnits
|
|
35
|
+
});
|
|
36
|
+
let lookup = Aws.cognito.getUserPoolOutput({
|
|
37
|
+
userPoolId: existingPoolId
|
|
38
|
+
});
|
|
39
|
+
result = {
|
|
40
|
+
poolId: Pulumi.output(existingPoolId),
|
|
41
|
+
clientId: client.id,
|
|
42
|
+
poolArn: lookup.apply(r => r.arn),
|
|
43
|
+
managed: false
|
|
44
|
+
};
|
|
45
|
+
} else {
|
|
46
|
+
let adminConfig = {
|
|
47
|
+
allowAdminCreateUserOnly: true
|
|
48
|
+
};
|
|
49
|
+
let pwdPolicy_minimumLength = 12;
|
|
50
|
+
let pwdPolicy_requireLowercase = true;
|
|
51
|
+
let pwdPolicy_requireNumbers = true;
|
|
52
|
+
let pwdPolicy_requireUppercase = true;
|
|
53
|
+
let pwdPolicy = {
|
|
54
|
+
minimumLength: pwdPolicy_minimumLength,
|
|
55
|
+
requireLowercase: pwdPolicy_requireLowercase,
|
|
56
|
+
requireNumbers: pwdPolicy_requireNumbers,
|
|
57
|
+
requireUppercase: pwdPolicy_requireUppercase
|
|
58
|
+
};
|
|
59
|
+
let pool = new (Aws.cognito.UserPool)("HostUiPool", {
|
|
60
|
+
adminCreateUserConfig: adminConfig,
|
|
61
|
+
usernameAttributes: ["email"],
|
|
62
|
+
passwordPolicy: pwdPolicy,
|
|
63
|
+
mfaConfiguration: "OFF"
|
|
64
|
+
});
|
|
65
|
+
let tokenUnits2_accessToken = "minutes";
|
|
66
|
+
let tokenUnits2_idToken = "minutes";
|
|
67
|
+
let tokenUnits2_refreshToken = "days";
|
|
68
|
+
let tokenUnits2 = {
|
|
69
|
+
accessToken: tokenUnits2_accessToken,
|
|
70
|
+
idToken: tokenUnits2_idToken,
|
|
71
|
+
refreshToken: tokenUnits2_refreshToken
|
|
72
|
+
};
|
|
73
|
+
let client$1 = new (Aws.cognito.UserPoolClient)("HostUiClient", {
|
|
74
|
+
userPoolId: pool.id,
|
|
75
|
+
generateSecret: false,
|
|
76
|
+
explicitAuthFlows: [
|
|
77
|
+
"ALLOW_USER_PASSWORD_AUTH",
|
|
78
|
+
"ALLOW_REFRESH_TOKEN_AUTH"
|
|
79
|
+
],
|
|
80
|
+
preventUserExistenceErrors: "ENABLED",
|
|
81
|
+
idTokenValidity: 60,
|
|
82
|
+
accessTokenValidity: 60,
|
|
83
|
+
refreshTokenValidity: 30,
|
|
84
|
+
tokenValidityUnits: tokenUnits2
|
|
85
|
+
});
|
|
86
|
+
result = {
|
|
87
|
+
poolId: pool.id,
|
|
88
|
+
clientId: client$1.id,
|
|
89
|
+
poolArn: pool.arn,
|
|
90
|
+
managed: true
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
let regionStr = Stdlib_Option.getOr(new Pulumi.Config("aws").get("region"), "unknown");
|
|
94
|
+
Pulumi$Pulumi.$$export("cognitoUserPoolId", result.poolId);
|
|
95
|
+
Pulumi$Pulumi.$$export("cognitoUserPoolClientId", result.clientId);
|
|
96
|
+
Pulumi$Pulumi.$$export("cognitoUserPoolArn", result.poolArn);
|
|
97
|
+
Pulumi$Pulumi.$$export("cognitoRegion", Pulumi.output(regionStr));
|
|
98
|
+
Pulumi$Pulumi.$$export("cognitoUserPoolManaged", Pulumi.output(result.managed ? "true" : "false"));
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let _cached = {
|
|
103
|
+
contents: undefined
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
function resolveCognitoUserPool() {
|
|
107
|
+
let p = _cached.contents;
|
|
108
|
+
if (p !== undefined) {
|
|
109
|
+
return p;
|
|
110
|
+
}
|
|
111
|
+
let p$1 = _resolveUncached();
|
|
112
|
+
_cached.contents = p$1;
|
|
113
|
+
return p$1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
_resolveUncached,
|
|
118
|
+
_cached,
|
|
119
|
+
resolveCognitoUserPool,
|
|
120
|
+
}
|
|
121
|
+
/* @pulumi/aws Not a pure module */
|
package/src/Types.res
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Central type definitions for AWS resources used by ReventlessCore.
|
|
2
|
+
*
|
|
3
|
+
* All AWS-specific types should be defined here and imported from
|
|
4
|
+
* this module rather than directly from PulumiAws.
|
|
5
|
+
*
|
|
6
|
+
* Usage: Since we're in the same package, use types directly:
|
|
7
|
+
* type api = Types.AppSync.api
|
|
8
|
+
* type role = Types.AppSync.role
|
|
9
|
+
*/
|
|
10
|
+
open PulumiAws
|
|
11
|
+
|
|
12
|
+
module AppSync = {
|
|
13
|
+
// Base Pulumi types first
|
|
14
|
+
type graphQLApi = AppSync.GraphQLApi.t
|
|
15
|
+
type resolver = AppSync.Resolver.t
|
|
16
|
+
type dataSource = AppSync.DataSource.t
|
|
17
|
+
type function_ = AppSync.Function.t
|
|
18
|
+
|
|
19
|
+
// Then types that use the base types (Output-wrapped)
|
|
20
|
+
type api = Pulumi.Output.t<graphQLApi>
|
|
21
|
+
type role = Pulumi.Output.t<IAM.Role.t>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module DynamoDb = {
|
|
25
|
+
type table = DynamoDb.Table.t
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module SQS = {
|
|
29
|
+
type queue = SQS.Queue.t
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module SNS = {
|
|
33
|
+
type topic = SNS.Topic.t
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module Lambda = {
|
|
37
|
+
type function_ = Lambda.Function.t
|
|
38
|
+
type role = IAM.Role.t
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
let AppSync = {};
|
|
5
|
+
|
|
6
|
+
let DynamoDb = {};
|
|
7
|
+
|
|
8
|
+
let SQS = {};
|
|
9
|
+
|
|
10
|
+
let SNS = {};
|
|
11
|
+
|
|
12
|
+
let Lambda = {};
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
AppSync,
|
|
16
|
+
DynamoDb,
|
|
17
|
+
SQS,
|
|
18
|
+
SNS,
|
|
19
|
+
Lambda,
|
|
20
|
+
}
|
|
21
|
+
/* No side effect */
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
module Tags = AWS_Tags
|
|
2
|
+
|
|
3
|
+
type service =
|
|
4
|
+
| AppSync
|
|
5
|
+
| IAM
|
|
6
|
+
| CloudwatchEventRule
|
|
7
|
+
| DynamoDb
|
|
8
|
+
| DynamoDbStream
|
|
9
|
+
| SQS
|
|
10
|
+
| SQS_FIFO
|
|
11
|
+
| SNS
|
|
12
|
+
| SNS_FIFO
|
|
13
|
+
| Kinesis
|
|
14
|
+
| Lambda
|
|
15
|
+
| S3
|
|
16
|
+
|
|
17
|
+
let toString: service => string = service =>
|
|
18
|
+
switch service {
|
|
19
|
+
| DynamoDb => "aws:DynamoDb"
|
|
20
|
+
| DynamoDbStream => "aws:DynamoDbStream"
|
|
21
|
+
| SQS => "aws:SQS"
|
|
22
|
+
| SQS_FIFO => "aws:SQS_FIFO"
|
|
23
|
+
| SNS => "aws:SNS"
|
|
24
|
+
| SNS_FIFO => "aws:SNS_FIFO"
|
|
25
|
+
| Kinesis => "aws:Kinesis"
|
|
26
|
+
| Lambda => "aws:Lambda"
|
|
27
|
+
| AppSync => "aws:AppSync"
|
|
28
|
+
| IAM => "aws:IAM"
|
|
29
|
+
| CloudwatchEventRule => "aws:CloudwatchEventRule"
|
|
30
|
+
| S3 => "aws:S3"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let toPrincipal: service => string = service =>
|
|
34
|
+
switch service {
|
|
35
|
+
| DynamoDb => "dynamodb.amazonaws.com"
|
|
36
|
+
| DynamoDbStream => "dynamodb.amazonaws.com"
|
|
37
|
+
| SQS => "sqs.amazonaws.com"
|
|
38
|
+
| SQS_FIFO => "sqs.amazonaws.com"
|
|
39
|
+
| SNS => "sns.amazonaws.com"
|
|
40
|
+
| SNS_FIFO => "sns.amazonaws.com"
|
|
41
|
+
| Kinesis => "kinesis.amazonaws.com"
|
|
42
|
+
| Lambda => "lambda.amazonaws.com"
|
|
43
|
+
| AppSync => "appsync.amazonaws.com"
|
|
44
|
+
| IAM => "iam.amazonaws.com"
|
|
45
|
+
| CloudwatchEventRule => "events.amazonaws.com"
|
|
46
|
+
| S3 => "s3.amazonaws.com"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module DynamoDb = {
|
|
50
|
+
let service = DynamoDb->toString
|
|
51
|
+
let principal = DynamoDb->toPrincipal
|
|
52
|
+
}
|
|
53
|
+
module DynamoDbStream = {
|
|
54
|
+
let service = DynamoDbStream->toString
|
|
55
|
+
let principal = DynamoDbStream->toPrincipal
|
|
56
|
+
}
|
|
57
|
+
module Kinesis = {
|
|
58
|
+
let service = Kinesis->toString
|
|
59
|
+
let principal = Kinesis->toPrincipal
|
|
60
|
+
}
|
|
61
|
+
module Lambda = {
|
|
62
|
+
let service = Lambda->toString
|
|
63
|
+
let principal = Lambda->toPrincipal
|
|
64
|
+
}
|
|
65
|
+
module SNS = {
|
|
66
|
+
let service = SNS->toString
|
|
67
|
+
let principal = SNS->toPrincipal
|
|
68
|
+
}
|
|
69
|
+
module SNS_FIFO = {
|
|
70
|
+
let service = SNS_FIFO->toString
|
|
71
|
+
let principal = SNS_FIFO->toPrincipal
|
|
72
|
+
}
|
|
73
|
+
module SQS = {
|
|
74
|
+
let service = SQS->toString
|
|
75
|
+
let principal = SQS->toPrincipal
|
|
76
|
+
}
|
|
77
|
+
module SQS_FIFO = {
|
|
78
|
+
let service = SQS_FIFO->toString
|
|
79
|
+
let principal = SQS_FIFO->toPrincipal
|
|
80
|
+
}
|
|
81
|
+
module AppSync = {
|
|
82
|
+
let service = AppSync->toString
|
|
83
|
+
let principal = AppSync->toPrincipal
|
|
84
|
+
}
|
|
85
|
+
module IAM = {
|
|
86
|
+
let service = IAM->toString
|
|
87
|
+
let principal = IAM->toPrincipal
|
|
88
|
+
}
|
|
89
|
+
module CloudwatchEventRule = {
|
|
90
|
+
let service = CloudwatchEventRule->toString
|
|
91
|
+
let principal = CloudwatchEventRule->toPrincipal
|
|
92
|
+
}
|
|
93
|
+
module S3 = {
|
|
94
|
+
let service = S3->toString
|
|
95
|
+
let principal = S3->toPrincipal
|
|
96
|
+
}
|