@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,263 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Aws from "@pulumi/aws";
|
|
4
|
+
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
5
|
+
import * as Output$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Output.res.mjs";
|
|
6
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
7
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
8
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
9
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
10
|
+
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
11
|
+
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
12
|
+
import * as ClientCloudfront from "@aws-sdk/client-cloudfront";
|
|
13
|
+
import * as Util_StaticBundle$ReventlessAws from "../../util/Util_StaticBundle.res.mjs";
|
|
14
|
+
|
|
15
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
16
|
+
|
|
17
|
+
let cachingOptimizedPolicyId = "658327ea-f89d-4fab-a63d-7e88639e58f6";
|
|
18
|
+
|
|
19
|
+
let cachingDisabledPolicyId = "4135ea2d-6df8-44a3-9df3-4b5a84be39ad";
|
|
20
|
+
|
|
21
|
+
let cloudFrontAliasZoneId = "Z2FDTNDATAQYW2";
|
|
22
|
+
|
|
23
|
+
let _usEast1Provider = {
|
|
24
|
+
contents: undefined
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function _getUsEast1Provider() {
|
|
28
|
+
let p = _usEast1Provider.contents;
|
|
29
|
+
if (p !== undefined) {
|
|
30
|
+
return Primitive_option.valFromOption(p);
|
|
31
|
+
}
|
|
32
|
+
let p$1 = new Aws.Provider("us-east-1", {
|
|
33
|
+
region: "us-east-1"
|
|
34
|
+
});
|
|
35
|
+
_usEast1Provider.contents = Primitive_option.some(p$1);
|
|
36
|
+
return p$1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function cacheControlFor(relativePath) {
|
|
40
|
+
if (relativePath.startsWith("assets/")) {
|
|
41
|
+
return "public, max-age=31536000, immutable";
|
|
42
|
+
} else {
|
|
43
|
+
return "no-cache";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function invalidateDistribution(distributionId, paths) {
|
|
48
|
+
try {
|
|
49
|
+
let client = new ClientCloudfront.CloudFrontClient();
|
|
50
|
+
let input_InvalidationBatch = {
|
|
51
|
+
CallerReference: "reventless-" + Date.now().toString(),
|
|
52
|
+
Paths: {
|
|
53
|
+
Quantity: paths.length,
|
|
54
|
+
Items: paths
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
let input = {
|
|
58
|
+
DistributionId: distributionId,
|
|
59
|
+
InvalidationBatch: input_InvalidationBatch
|
|
60
|
+
};
|
|
61
|
+
await client.send(new ClientCloudfront.CreateInvalidationCommand(input));
|
|
62
|
+
return log.info("makeUiBundleDistribution", undefined, `CloudFront invalidation submitted for ` + distributionId);
|
|
63
|
+
} catch (raw_exn) {
|
|
64
|
+
let exn = Primitive_exceptions.internalToException(raw_exn);
|
|
65
|
+
let msg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(exn), Stdlib_JsExn.message), "unknown");
|
|
66
|
+
return log.info("makeUiBundleDistribution", undefined, `CloudFront invalidation skipped (` + msg + `)`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function makeUiBundleDistribution(pluginId, bundleVersion, assetsDir, spaFallbackOpt, indexDocumentOpt, stableNameOpt, excludeFilesOpt, customDomain) {
|
|
71
|
+
let spaFallback = spaFallbackOpt !== undefined ? spaFallbackOpt : false;
|
|
72
|
+
let indexDocument = indexDocumentOpt !== undefined ? indexDocumentOpt : "index.html";
|
|
73
|
+
let stableName = stableNameOpt !== undefined ? stableNameOpt : false;
|
|
74
|
+
let excludeFiles = excludeFilesOpt !== undefined ? excludeFilesOpt : [];
|
|
75
|
+
let name = stableName ? pluginId : pluginId + "-" + bundleVersion;
|
|
76
|
+
let bucket = new (Aws.s3.Bucket)(name + "-bundle");
|
|
77
|
+
new (Aws.s3.BucketPublicAccessBlock)(name + "-bundle-pab", {
|
|
78
|
+
bucket: bucket.id,
|
|
79
|
+
blockPublicAcls: true,
|
|
80
|
+
blockPublicPolicy: true,
|
|
81
|
+
ignorePublicAcls: true,
|
|
82
|
+
restrictPublicBuckets: true
|
|
83
|
+
});
|
|
84
|
+
let oac = new (Aws.cloudfront.OriginAccessControl)(name + "-oac", {
|
|
85
|
+
originAccessControlOriginType: "s3",
|
|
86
|
+
signingBehavior: "always",
|
|
87
|
+
signingProtocol: "sigv4"
|
|
88
|
+
});
|
|
89
|
+
let originId = pluginId + "-s3";
|
|
90
|
+
let customErrorResponses = spaFallback ? [
|
|
91
|
+
{
|
|
92
|
+
errorCode: 403,
|
|
93
|
+
responseCode: 200,
|
|
94
|
+
responsePagePath: "/" + indexDocument,
|
|
95
|
+
errorCachingMinTtl: 0
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
errorCode: 404,
|
|
99
|
+
responseCode: 200,
|
|
100
|
+
responsePagePath: "/" + indexDocument,
|
|
101
|
+
errorCachingMinTtl: 0
|
|
102
|
+
}
|
|
103
|
+
] : [];
|
|
104
|
+
let noCacheBehavior = pattern => ({
|
|
105
|
+
pathPattern: pattern,
|
|
106
|
+
targetOriginId: originId,
|
|
107
|
+
viewerProtocolPolicy: "redirect-to-https",
|
|
108
|
+
allowedMethods: [
|
|
109
|
+
"GET",
|
|
110
|
+
"HEAD"
|
|
111
|
+
],
|
|
112
|
+
cachedMethods: [
|
|
113
|
+
"GET",
|
|
114
|
+
"HEAD"
|
|
115
|
+
],
|
|
116
|
+
cachePolicyId: cachingDisabledPolicyId
|
|
117
|
+
});
|
|
118
|
+
let orderedCacheBehaviors = [noCacheBehavior("/remoteEntry.js")].concat(spaFallback ? [
|
|
119
|
+
noCacheBehavior("/" + indexDocument),
|
|
120
|
+
noCacheBehavior("/config.json")
|
|
121
|
+
] : []);
|
|
122
|
+
let viewerCertificate;
|
|
123
|
+
if (customDomain !== undefined) {
|
|
124
|
+
let usEast1 = _getUsEast1Provider();
|
|
125
|
+
let cert = new (Aws.acm.Certificate)(pluginId + "-domain-cert", {
|
|
126
|
+
domainName: customDomain.fqdn,
|
|
127
|
+
validationMethod: "DNS"
|
|
128
|
+
}, {
|
|
129
|
+
provider: Primitive_option.some(usEast1)
|
|
130
|
+
});
|
|
131
|
+
let firstValidationOption = cert.domainValidationOptions.apply(opts => opts[0]);
|
|
132
|
+
let validationRecord = new (Aws.route53.Record)(pluginId + "-domain-validation-record", {
|
|
133
|
+
zoneId: customDomain.hostedZoneId,
|
|
134
|
+
name: firstValidationOption.apply(o => o.resourceRecordName),
|
|
135
|
+
type: firstValidationOption.apply(o => o.resourceRecordType),
|
|
136
|
+
ttl: 60,
|
|
137
|
+
records: firstValidationOption.apply(o => [o.resourceRecordValue]),
|
|
138
|
+
allowOverwrite: true
|
|
139
|
+
});
|
|
140
|
+
let validated = new (Aws.acm.CertificateValidation)(pluginId + "-domain-cert-validation", {
|
|
141
|
+
certificateArn: cert.arn,
|
|
142
|
+
validationRecordFqdns: Pulumi.all([validationRecord.fqdn])
|
|
143
|
+
}, {
|
|
144
|
+
provider: Primitive_option.some(usEast1)
|
|
145
|
+
});
|
|
146
|
+
viewerCertificate = {
|
|
147
|
+
acmCertificateArn: validated.certificateArn,
|
|
148
|
+
sslSupportMethod: "sni-only",
|
|
149
|
+
minimumProtocolVersion: "TLSv1.2_2021"
|
|
150
|
+
};
|
|
151
|
+
} else {
|
|
152
|
+
viewerCertificate = {
|
|
153
|
+
cloudfrontDefaultCertificate: true
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
let distribution = new (Aws.cloudfront.Distribution)(name + "-cdn", {
|
|
157
|
+
enabled: true,
|
|
158
|
+
aliases: customDomain !== undefined ? [customDomain.fqdn] : undefined,
|
|
159
|
+
origins: Pulumi.all([
|
|
160
|
+
bucket.bucketRegionalDomainName,
|
|
161
|
+
oac.id
|
|
162
|
+
]).apply(param => [{
|
|
163
|
+
domainName: param[0],
|
|
164
|
+
originId: originId,
|
|
165
|
+
originAccessControlId: param[1]
|
|
166
|
+
}]),
|
|
167
|
+
defaultCacheBehavior: {
|
|
168
|
+
targetOriginId: originId,
|
|
169
|
+
viewerProtocolPolicy: "redirect-to-https",
|
|
170
|
+
allowedMethods: [
|
|
171
|
+
"GET",
|
|
172
|
+
"HEAD"
|
|
173
|
+
],
|
|
174
|
+
cachedMethods: [
|
|
175
|
+
"GET",
|
|
176
|
+
"HEAD"
|
|
177
|
+
],
|
|
178
|
+
cachePolicyId: cachingOptimizedPolicyId
|
|
179
|
+
},
|
|
180
|
+
orderedCacheBehaviors: orderedCacheBehaviors,
|
|
181
|
+
restrictions: {
|
|
182
|
+
geoRestriction: {
|
|
183
|
+
restrictionType: "none"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
viewerCertificate: viewerCertificate,
|
|
187
|
+
comment: pluginId + " UI bundle CDN",
|
|
188
|
+
customErrorResponses: customErrorResponses,
|
|
189
|
+
defaultRootObject: indexDocument
|
|
190
|
+
});
|
|
191
|
+
if (customDomain !== undefined) {
|
|
192
|
+
new (Aws.route53.Record)(pluginId + "-domain-alias", {
|
|
193
|
+
zoneId: customDomain.hostedZoneId,
|
|
194
|
+
name: customDomain.fqdn,
|
|
195
|
+
type: "A",
|
|
196
|
+
aliases: [{
|
|
197
|
+
name: distribution.domainName,
|
|
198
|
+
zoneId: cloudFrontAliasZoneId,
|
|
199
|
+
evaluateTargetHealth: false
|
|
200
|
+
}]
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
new (Aws.s3.BucketPolicy)(name + "-bundle-policy", {
|
|
204
|
+
bucket: bucket.id,
|
|
205
|
+
policy: Pulumi.all([
|
|
206
|
+
bucket.arn,
|
|
207
|
+
distribution.arn
|
|
208
|
+
]).apply(param => JSON.stringify({
|
|
209
|
+
Version: "2012-10-17",
|
|
210
|
+
Statement: [{
|
|
211
|
+
Sid: "AllowCloudFrontServicePrincipal",
|
|
212
|
+
Effect: "Allow",
|
|
213
|
+
Principal: {
|
|
214
|
+
Service: "cloudfront.amazonaws.com"
|
|
215
|
+
},
|
|
216
|
+
Action: "s3:GetObject",
|
|
217
|
+
Resource: param[0] + "/*",
|
|
218
|
+
Condition: {
|
|
219
|
+
StringEquals: {
|
|
220
|
+
"AWS:SourceArn": param[1]
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}]
|
|
224
|
+
}))
|
|
225
|
+
});
|
|
226
|
+
if (assetsDir !== undefined) {
|
|
227
|
+
let allEntries = Util_StaticBundle$ReventlessAws.walk(assetsDir);
|
|
228
|
+
if (allEntries.length === 0) {
|
|
229
|
+
Stdlib_JsError.throwWithMessage(`Plugin_Stack.makeUiBundleDistribution: assetsDir is empty: ` + assetsDir);
|
|
230
|
+
}
|
|
231
|
+
let entries = allEntries.filter(entry => !excludeFiles.includes(entry.relativePath));
|
|
232
|
+
let objectEtags = entries.map(entry => new (Aws.s3.BucketObject)(name + "-asset-" + Util_StaticBundle$ReventlessAws.sanitizeName(entry.relativePath), {
|
|
233
|
+
bucket: bucket.id,
|
|
234
|
+
key: entry.relativePath,
|
|
235
|
+
source: entry.fileAsset,
|
|
236
|
+
contentType: Util_StaticBundle$ReventlessAws.contentTypeFor(entry.relativePath),
|
|
237
|
+
cacheControl: cacheControlFor(entry.relativePath),
|
|
238
|
+
etag: entry.contentHash
|
|
239
|
+
}).etag);
|
|
240
|
+
Output$Pulumi.flatMap(Pulumi.all([
|
|
241
|
+
distribution.id,
|
|
242
|
+
Pulumi.all(objectEtags)
|
|
243
|
+
]), param => invalidateDistribution(param[0], ["/*"]));
|
|
244
|
+
}
|
|
245
|
+
let distributionUrl = customDomain !== undefined ? Pulumi.output("https://" + customDomain.fqdn) : distribution.domainName.apply(d => "https://" + d);
|
|
246
|
+
return {
|
|
247
|
+
distributionUrl: distributionUrl,
|
|
248
|
+
bucketName: bucket.bucket
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export {
|
|
253
|
+
log,
|
|
254
|
+
cachingOptimizedPolicyId,
|
|
255
|
+
cachingDisabledPolicyId,
|
|
256
|
+
cloudFrontAliasZoneId,
|
|
257
|
+
_usEast1Provider,
|
|
258
|
+
_getUsEast1Provider,
|
|
259
|
+
cacheControlFor,
|
|
260
|
+
invalidateDistribution,
|
|
261
|
+
makeUiBundleDistribution,
|
|
262
|
+
}
|
|
263
|
+
/* log Not a pure module */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module AppSync = Util_AppSync
|
|
2
|
+
module Cloudwatch = Util_Cloudwatch
|
|
3
|
+
module Cognito_Runtime = Util_Cognito_Runtime
|
|
4
|
+
module CognitoGroupUser = Util_CognitoGroupUser
|
|
5
|
+
module CognitoGroupUser_Runtime = Util_CognitoGroupUser_Runtime
|
|
6
|
+
module DeadLetterQueue = Util_DeadLetterQueue
|
|
7
|
+
module DynamoDb = Util_DynamoDb
|
|
8
|
+
module DynamoDb_Runtime = Util_DynamoDb_Runtime
|
|
9
|
+
module DynamoDb_TableManager = Util_DynamoDb_TableManager
|
|
10
|
+
module DynamoDbStream = Util_DynamoDbStream
|
|
11
|
+
module DynamoDbStream_Runtime = Util_DynamoDbStream_Runtime
|
|
12
|
+
module Env = Util_Env
|
|
13
|
+
module EventSourceMapping = Util_EventSourceMapping
|
|
14
|
+
module IAM_Role = Util_IAM_Role
|
|
15
|
+
module Kinesis_Runtime = Util_Kinesis_Runtime
|
|
16
|
+
module Lambda = Util_Lambda
|
|
17
|
+
module PluginMessage_Runtime = Util_PluginMessage_Runtime
|
|
18
|
+
module ResourceNaming = Util_ResourceNaming
|
|
19
|
+
module S3 = Util_S3
|
|
20
|
+
module S3_Runtime = Util_S3_Runtime
|
|
21
|
+
module StaticBundle = Util_StaticBundle
|
|
22
|
+
module SesPolicy_Runtime = Util_SesPolicy_Runtime
|
|
23
|
+
module SNS = Util_SNS
|
|
24
|
+
module SNS_FIFO = Util_SNS_FIFO
|
|
25
|
+
module SNS_Runtime = Util_SNS_Runtime
|
|
26
|
+
module SQS = Util_SQS
|
|
27
|
+
module SQS_FIFO = Util_SQS_FIFO
|
|
28
|
+
module SQS_Runtime = Util_SQS_Runtime
|
|
29
|
+
module Vpc = Util_Vpc
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
let AppSync;
|
|
5
|
+
|
|
6
|
+
let Cloudwatch;
|
|
7
|
+
|
|
8
|
+
let Cognito_Runtime;
|
|
9
|
+
|
|
10
|
+
let CognitoGroupUser;
|
|
11
|
+
|
|
12
|
+
let CognitoGroupUser_Runtime;
|
|
13
|
+
|
|
14
|
+
let DeadLetterQueue;
|
|
15
|
+
|
|
16
|
+
let DynamoDb;
|
|
17
|
+
|
|
18
|
+
let DynamoDb_Runtime;
|
|
19
|
+
|
|
20
|
+
let DynamoDb_TableManager;
|
|
21
|
+
|
|
22
|
+
let DynamoDbStream;
|
|
23
|
+
|
|
24
|
+
let DynamoDbStream_Runtime;
|
|
25
|
+
|
|
26
|
+
let Env;
|
|
27
|
+
|
|
28
|
+
let EventSourceMapping;
|
|
29
|
+
|
|
30
|
+
let IAM_Role;
|
|
31
|
+
|
|
32
|
+
let Kinesis_Runtime;
|
|
33
|
+
|
|
34
|
+
let Lambda;
|
|
35
|
+
|
|
36
|
+
let PluginMessage_Runtime;
|
|
37
|
+
|
|
38
|
+
let ResourceNaming;
|
|
39
|
+
|
|
40
|
+
let S3;
|
|
41
|
+
|
|
42
|
+
let S3_Runtime;
|
|
43
|
+
|
|
44
|
+
let StaticBundle;
|
|
45
|
+
|
|
46
|
+
let SesPolicy_Runtime;
|
|
47
|
+
|
|
48
|
+
let SNS;
|
|
49
|
+
|
|
50
|
+
let SNS_FIFO;
|
|
51
|
+
|
|
52
|
+
let SNS_Runtime;
|
|
53
|
+
|
|
54
|
+
let SQS;
|
|
55
|
+
|
|
56
|
+
let SQS_FIFO;
|
|
57
|
+
|
|
58
|
+
let SQS_Runtime;
|
|
59
|
+
|
|
60
|
+
let Vpc;
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
AppSync,
|
|
64
|
+
Cloudwatch,
|
|
65
|
+
Cognito_Runtime,
|
|
66
|
+
CognitoGroupUser,
|
|
67
|
+
CognitoGroupUser_Runtime,
|
|
68
|
+
DeadLetterQueue,
|
|
69
|
+
DynamoDb,
|
|
70
|
+
DynamoDb_Runtime,
|
|
71
|
+
DynamoDb_TableManager,
|
|
72
|
+
DynamoDbStream,
|
|
73
|
+
DynamoDbStream_Runtime,
|
|
74
|
+
Env,
|
|
75
|
+
EventSourceMapping,
|
|
76
|
+
IAM_Role,
|
|
77
|
+
Kinesis_Runtime,
|
|
78
|
+
Lambda,
|
|
79
|
+
PluginMessage_Runtime,
|
|
80
|
+
ResourceNaming,
|
|
81
|
+
S3,
|
|
82
|
+
S3_Runtime,
|
|
83
|
+
StaticBundle,
|
|
84
|
+
SesPolicy_Runtime,
|
|
85
|
+
SNS,
|
|
86
|
+
SNS_FIFO,
|
|
87
|
+
SNS_Runtime,
|
|
88
|
+
SQS,
|
|
89
|
+
SQS_FIFO,
|
|
90
|
+
SQS_Runtime,
|
|
91
|
+
Vpc,
|
|
92
|
+
}
|
|
93
|
+
/* No side effect */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
let toResource: Types.AppSync.resolver => ReventlessInfra.Adapter.resource = ({
|
|
2
|
+
id,
|
|
3
|
+
arn,
|
|
4
|
+
type_,
|
|
5
|
+
field,
|
|
6
|
+
}) =>
|
|
7
|
+
ReventlessInfra.Adapter.make(
|
|
8
|
+
~name=id,
|
|
9
|
+
~id,
|
|
10
|
+
~urn=arn,
|
|
11
|
+
~service=id->Pulumi.Output.apply(_ => AWS.AppSync.service),
|
|
12
|
+
~resourceInfo=(type_, field)
|
|
13
|
+
->Pulumi.Output.all2
|
|
14
|
+
->Pulumi.Output.apply(((type_, field)) => ReventlessInfra.Adapter.ApiResolver({typeName: type_, fieldName: field})),
|
|
15
|
+
~resourceType="aws:appsync:Resolver"->Pulumi.Output.make,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
/** Variant for aws-native.appsync.Resolver (different field names: resolverArn
|
|
19
|
+
vs arn, typeName vs type_, fieldName vs field). Emits the same
|
|
20
|
+
ReventlessInfra.Adapter.resource shape as the classic variant. */
|
|
21
|
+
let toResourceNative: PulumiAws.AwsNative.AppSync.Resolver.t => ReventlessInfra.Adapter.resource = ({
|
|
22
|
+
id,
|
|
23
|
+
resolverArn,
|
|
24
|
+
typeName,
|
|
25
|
+
fieldName,
|
|
26
|
+
}) =>
|
|
27
|
+
ReventlessInfra.Adapter.make(
|
|
28
|
+
~name=id,
|
|
29
|
+
~id,
|
|
30
|
+
~urn=resolverArn,
|
|
31
|
+
~service=id->Pulumi.Output.apply(_ => AWS.AppSync.service),
|
|
32
|
+
~resourceInfo=(typeName, fieldName)
|
|
33
|
+
->Pulumi.Output.all2
|
|
34
|
+
->Pulumi.Output.apply(((t, f)) => ReventlessInfra.Adapter.ApiResolver({typeName: t, fieldName: f})),
|
|
35
|
+
~resourceType="aws-native:appsync:Resolver"->Pulumi.Output.make,
|
|
36
|
+
)
|
|
@@ -0,0 +1,35 @@
|
|
|
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.AppSync.service), Pulumi.all([
|
|
10
|
+
param.type,
|
|
11
|
+
param.field
|
|
12
|
+
]).apply(param => ({
|
|
13
|
+
TAG: "ApiResolver",
|
|
14
|
+
typeName: param[0],
|
|
15
|
+
fieldName: param[1]
|
|
16
|
+
})), undefined, undefined, Pulumi.output("aws:appsync:Resolver"), undefined, undefined);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toResourceNative(param) {
|
|
20
|
+
let id = param.id;
|
|
21
|
+
return Adapter$ReventlessInfra.make(id, id, param.resolverArn, id.apply(param => AWS$ReventlessAws.AppSync.service), Pulumi.all([
|
|
22
|
+
param.typeName,
|
|
23
|
+
param.fieldName
|
|
24
|
+
]).apply(param => ({
|
|
25
|
+
TAG: "ApiResolver",
|
|
26
|
+
typeName: param[0],
|
|
27
|
+
fieldName: param[1]
|
|
28
|
+
})), undefined, undefined, Pulumi.output("aws-native:appsync:Resolver"), undefined, undefined);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
toResource,
|
|
33
|
+
toResourceNative,
|
|
34
|
+
}
|
|
35
|
+
/* @pulumi/pulumi Not a pure module */
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// IAM-signed AppSync HTTP mutation sender for deploy-time dispatch.
|
|
2
|
+
//
|
|
3
|
+
// Uses @smithy/signature-v4 + @aws-sdk/credential-provider-node to sign
|
|
4
|
+
// requests with the ambient AWS credentials available in the Pulumi deploy
|
|
5
|
+
// process (developer machine, CI role, or EC2/ECS instance profile).
|
|
6
|
+
//
|
|
7
|
+
// The signed request is sent via the Node 18+ global fetch.
|
|
8
|
+
// Arguments are serialised as inline GraphQL literals — no variable-type
|
|
9
|
+
// declarations required, so any mutation can be called generically.
|
|
10
|
+
|
|
11
|
+
let log = ReventlessCore.Logger.fromEnv()
|
|
12
|
+
|
|
13
|
+
// ── AWS credential provider ────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
type awsCredentials = {
|
|
16
|
+
accessKeyId: string,
|
|
17
|
+
secretAccessKey: string,
|
|
18
|
+
sessionToken?: string,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// defaultProvider() returns a credential-provider function.
|
|
22
|
+
// It resolves credentials from env vars → SSO → ini files → IMDSv2.
|
|
23
|
+
@module("@aws-sdk/credential-provider-node")
|
|
24
|
+
external defaultProvider: unit => (unit => promise<awsCredentials>) = "defaultProvider"
|
|
25
|
+
|
|
26
|
+
// ── SigV4 signer ──────────────────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
// Hash constructor type used as sha256 option for SignatureV4
|
|
29
|
+
type hashCtor
|
|
30
|
+
|
|
31
|
+
// Hash class from @smithy/hash-node; used as Hash.bind(null, "sha256")
|
|
32
|
+
@module("@smithy/hash-node") external _hashClass: hashCtor = "Hash"
|
|
33
|
+
|
|
34
|
+
// Hash.bind(null, "sha256") yields a zero-argument constructor that
|
|
35
|
+
// SignatureV4 calls internally to create SHA-256 hash instances.
|
|
36
|
+
@send external bindCtor: (hashCtor, @as(json`null`) _, string) => hashCtor = "bind"
|
|
37
|
+
let sha256: hashCtor = _hashClass->bindCtor("sha256")
|
|
38
|
+
|
|
39
|
+
type signerOptions = {
|
|
40
|
+
service: string,
|
|
41
|
+
region: string,
|
|
42
|
+
credentials: unit => promise<awsCredentials>,
|
|
43
|
+
sha256: hashCtor,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type httpHeaders = dict<string>
|
|
47
|
+
|
|
48
|
+
type httpRequest = {
|
|
49
|
+
method: string,
|
|
50
|
+
hostname: string,
|
|
51
|
+
path: string,
|
|
52
|
+
headers: httpHeaders,
|
|
53
|
+
body: string,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type signer
|
|
57
|
+
|
|
58
|
+
@module("@smithy/signature-v4") @new
|
|
59
|
+
external makeSigner: signerOptions => signer = "SignatureV4"
|
|
60
|
+
|
|
61
|
+
@send external signRequest: (signer, httpRequest) => promise<httpRequest> = "sign"
|
|
62
|
+
|
|
63
|
+
// ── Node 18+ global fetch ──────────────────────────────────────────────────
|
|
64
|
+
|
|
65
|
+
type fetchInit = {
|
|
66
|
+
method: string,
|
|
67
|
+
headers: httpHeaders,
|
|
68
|
+
body: string,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@val external fetch: (string, fetchInit) => promise<{..}> = "fetch"
|
|
72
|
+
@send external responseJson: {..} => promise<JSON.t> = "json"
|
|
73
|
+
|
|
74
|
+
// ── URL parser ─────────────────────────────────────────────────────────────
|
|
75
|
+
|
|
76
|
+
@new external parseUrl: string => {..} = "URL"
|
|
77
|
+
|
|
78
|
+
// ── GraphQL inline-arg serialiser ──────────────────────────────────────────
|
|
79
|
+
//
|
|
80
|
+
// Converts a JSON.t value to a GraphQL literal string.
|
|
81
|
+
// GraphQL accepts the same literals as JSON for scalars and arrays;
|
|
82
|
+
// input-object fields use unquoted keys (same as JS object shorthand).
|
|
83
|
+
// This lets us call any mutation without declaring variable types.
|
|
84
|
+
//
|
|
85
|
+
// graphqlEnum wraps a string so jsonToLiteral renders it without quotes,
|
|
86
|
+
// which is required for GraphQL enum arguments (e.g. kind: Domain, not
|
|
87
|
+
// kind: "Domain").
|
|
88
|
+
let graphqlEnum = (name: string): JSON.t =>
|
|
89
|
+
JSON.Encode.object(Dict.fromArray([("__enum", JSON.Encode.string(name))]))
|
|
90
|
+
|
|
91
|
+
let rec jsonToLiteral = (value: JSON.t): string =>
|
|
92
|
+
switch value {
|
|
93
|
+
| String(s) =>
|
|
94
|
+
let escaped = s->String.replaceAll("\\", "\\\\")->String.replaceAll("\"", "\\\"")
|
|
95
|
+
`"${escaped}"`
|
|
96
|
+
| Boolean(b) => b ? "true" : "false"
|
|
97
|
+
| Number(n) => n->Float.toString
|
|
98
|
+
| Null => "null"
|
|
99
|
+
| Array(arr) => `[${arr->Array.map(jsonToLiteral)->Array.join(", ")}]`
|
|
100
|
+
| Object(obj) =>
|
|
101
|
+
// {__enum: "Value"} encodes a GraphQL enum literal (rendered without quotes).
|
|
102
|
+
switch obj->Dict.get("__enum") {
|
|
103
|
+
| Some(String(enumVal)) => enumVal
|
|
104
|
+
| _ =>
|
|
105
|
+
let pairs = obj->Dict.toArray->Array.map(((k, v)) => `${k}: ${jsonToLiteral(v)}`)
|
|
106
|
+
`{${pairs->Array.join(", ")}}`
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
let buildQuery = (~mutation: string, ~variablesDict: dict<JSON.t>): string => {
|
|
111
|
+
let args =
|
|
112
|
+
variablesDict
|
|
113
|
+
->Dict.toArray
|
|
114
|
+
->Array.map(((k, v)) => `${k}: ${jsonToLiteral(v)}`)
|
|
115
|
+
->Array.join(", ")
|
|
116
|
+
`mutation { ${mutation}(${args}) }`
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ── sendMutation ────────────────────────────────────────────────────────────
|
|
120
|
+
//
|
|
121
|
+
// Signs and sends a single GraphQL mutation to an AppSync endpoint via IAM.
|
|
122
|
+
// ~variables accepts any value; undefined/optional fields are omitted by
|
|
123
|
+
// JSON.stringifyAny (mirrors how JSON.stringify drops undefined object keys).
|
|
124
|
+
// Returns a promise — callers fire-and-forget with `let _ = sendMutation(...)`.
|
|
125
|
+
|
|
126
|
+
// Signs and sends a GraphQL query; returns the `data` object or None on error.
|
|
127
|
+
// ~queryString must be a complete "query { field(...) { ... } }" string.
|
|
128
|
+
let sendQuery = async (~endpoint: string, ~region: string, ~queryString: string): option<JSON.t> => {
|
|
129
|
+
let url = parseUrl(endpoint)
|
|
130
|
+
let hostname: string = (url)["hostname"]
|
|
131
|
+
let path: string = (url)["pathname"]
|
|
132
|
+
|
|
133
|
+
let body =
|
|
134
|
+
Dict.fromArray([("query", queryString->JSON.Encode.string)])
|
|
135
|
+
->JSON.Encode.object
|
|
136
|
+
->JSON.stringify
|
|
137
|
+
|
|
138
|
+
let credProvider = defaultProvider()
|
|
139
|
+
let signer = makeSigner({
|
|
140
|
+
service: "appsync",
|
|
141
|
+
region,
|
|
142
|
+
credentials: credProvider,
|
|
143
|
+
sha256,
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
let headers: dict<string> = Dict.fromArray([
|
|
147
|
+
("content-type", "application/json"),
|
|
148
|
+
("host", hostname),
|
|
149
|
+
])
|
|
150
|
+
|
|
151
|
+
let request: httpRequest = {method: "POST", hostname, path, headers, body}
|
|
152
|
+
let signed = await signer->signRequest(request)
|
|
153
|
+
let response = await fetch(endpoint, {method: "POST", headers: signed.headers, body: signed.body})
|
|
154
|
+
let json = await response->responseJson
|
|
155
|
+
switch json->JSON.Decode.object {
|
|
156
|
+
| Some(d) =>
|
|
157
|
+
switch d->Dict.get("errors") {
|
|
158
|
+
| Some(errors) =>
|
|
159
|
+
log.error(~comp="Util_AppSync_Caller", ~data=errors, "query errors")
|
|
160
|
+
None
|
|
161
|
+
| None => d->Dict.get("data")
|
|
162
|
+
}
|
|
163
|
+
| None => None
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
let sendMutation = async (~endpoint: string, ~region: string, ~mutation: string, ~variables: 'a) => {
|
|
168
|
+
let url = parseUrl(endpoint)
|
|
169
|
+
let hostname: string = (url)["hostname"]
|
|
170
|
+
let path: string = (url)["pathname"]
|
|
171
|
+
|
|
172
|
+
// Normalise variables to a JSON.t dict (strips undefined optional fields)
|
|
173
|
+
let variablesDict: dict<JSON.t> =
|
|
174
|
+
switch variables->JSON.stringifyAny {
|
|
175
|
+
| Some(str) =>
|
|
176
|
+
switch str->JSON.parseOrThrow {
|
|
177
|
+
| Object(d) => d
|
|
178
|
+
| _ => Dict.make()
|
|
179
|
+
}
|
|
180
|
+
| None => Dict.make()
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let query = buildQuery(~mutation, ~variablesDict)
|
|
184
|
+
let body =
|
|
185
|
+
Dict.fromArray([("query", query->JSON.Encode.string)])
|
|
186
|
+
->JSON.Encode.object
|
|
187
|
+
->JSON.stringify
|
|
188
|
+
|
|
189
|
+
let credProvider = defaultProvider()
|
|
190
|
+
let signer = makeSigner({
|
|
191
|
+
service: "appsync",
|
|
192
|
+
region,
|
|
193
|
+
credentials: credProvider,
|
|
194
|
+
sha256,
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
let headers: dict<string> = Dict.fromArray([
|
|
198
|
+
("content-type", "application/json"),
|
|
199
|
+
("host", hostname),
|
|
200
|
+
])
|
|
201
|
+
|
|
202
|
+
let request: httpRequest = {method: "POST", hostname, path, headers, body}
|
|
203
|
+
let signed = await signer->signRequest(request)
|
|
204
|
+
|
|
205
|
+
let response = await fetch(endpoint, {method: "POST", headers: signed.headers, body: signed.body})
|
|
206
|
+
|
|
207
|
+
let json = await response->responseJson
|
|
208
|
+
switch json->JSON.Decode.object->Option.flatMap(d => d->Dict.get("errors")) {
|
|
209
|
+
| Some(errors) =>
|
|
210
|
+
log.error(~comp="Util_AppSync_Caller", ~data=errors, `${mutation} errors`)
|
|
211
|
+
| None => ()
|
|
212
|
+
}
|
|
213
|
+
}
|