@reventlessdev/reventless-aws 3.0.0-alpha.344 → 3.0.0-alpha.346
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 +36 -0
- package/package.json +15 -12
- package/run-provision-accounts.mjs +3 -0
- package/run-provision-admin.mjs +3 -0
- package/scripts/ProvisionAccounts.res +325 -0
- package/scripts/ProvisionAccounts.res.mjs +337 -0
- package/scripts/ProvisionAdmin.res +275 -0
- package/scripts/ProvisionAdmin.res.mjs +289 -0
- package/scripts/ProvisionCognito.res +149 -0
- package/scripts/ProvisionCognito.res.mjs +98 -0
- package/scripts/ProvisionIdentity.res +84 -14
- package/scripts/ProvisionIdentity.res.mjs +72 -7
- package/scripts/ProvisionProvider.res +104 -0
- package/scripts/ProvisionProvider.res.mjs +123 -0
- package/src/Platform.res +358 -329
- package/src/Platform.res.mjs +24 -12
- package/src/Platform_Casts.res +13 -4
- package/src/Platform_Stack.res +119 -9
- package/src/Platform_Stack.res.mjs +42 -4
- package/src/adapter/Api/AppSyncEventsSigner_Ops.res +8 -4
- package/src/adapter/Api/AppSync_EventsApi.res +12 -14
- package/src/adapter/Api/AppSync_Resolver_Native.res +3 -4
- package/src/adapter/Api/AppSync_Resolver_Retrying.res +78 -70
- package/src/adapter/Api/AppSync_SourceApiAssociation_Retrying.res +11 -8
- package/src/adapter/Api/Platform_AdminScan_Ops.res +15 -14
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +10 -2
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +40 -50
- package/src/adapter/Api/Platform_UIFragments_Lambda.res +39 -32
- package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res +5 -2
- package/src/adapter/Auth/Auth_ActiveRolePoolAttachment.res +0 -1
- package/src/adapter/Auth/Auth_ActiveRoleStore.res +1 -2
- package/src/adapter/Auth/Auth_ActiveRoleStore_Schema.res +1 -4
- package/src/adapter/Auth/Auth_ActiveRoleTrigger_Ops.res +5 -2
- package/src/adapter/Auth/Auth_Cognito.res +3 -9
- package/src/adapter/Auth/Auth_LoginIdentifier.res +66 -0
- package/src/adapter/Auth/Auth_LoginIdentifier.res.mjs +70 -0
- package/src/adapter/Auth/Auth_SignUpMode.res +78 -0
- package/src/adapter/Auth/Auth_SignUpMode.res.mjs +56 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res +1 -4
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res +3 -1
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res +1 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res +7 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res +6 -1
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res +7 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res +24 -18
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res +9 -4
- package/src/adapter/CommandTopic/CommandTopicRegistry.res +1 -4
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res +15 -15
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res +9 -5
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +179 -213
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res +5 -5
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res +6 -2
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res +14 -7
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res +14 -7
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res +6 -3
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res +6 -1
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +13 -17
- package/src/adapter/EventLog/EventLogStorage_Postgres.res +7 -4
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +12 -7
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res +4 -2
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res +3 -2
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res +20 -12
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res +21 -9
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res +5 -3
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res +6 -3
- package/src/adapter/Mcp/MCP_Lambda.res +31 -46
- package/src/adapter/Messaging/Messaging_Ses_Backend.res +11 -7
- package/src/adapter/Messaging/Messaging_Ses_Backend.res.mjs +2 -4
- package/src/adapter/Monitoring/Monitoring_CloudWatch.res +16 -16
- package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res +5 -10
- package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res +4 -2
- package/src/adapter/Postgres/PgConnection.res +6 -5
- package/src/adapter/Postgres/PgMigration_Builder.res +4 -8
- package/src/adapter/Postgres/PgRuntime.res +4 -7
- package/src/adapter/QueryDb/PgQueryResolver_Builder.res +9 -11
- package/src/adapter/QueryDb/PgQueryResolver_Lambda.res +22 -21
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +114 -111
- package/src/adapter/QueryDb/QueryDbResolvers_Lambda.res +1 -7
- package/src/adapter/QueryDb/QueryDbStorage.res +4 -2
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res +23 -24
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res +8 -2
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res +71 -73
- package/src/adapter/QueryDb/QueryDbStorage_Postgres.res +5 -2
- package/src/adapter/QueryDb/QueryInterceptor_Provisioning.res +1 -4
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res +8 -2
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +73 -81
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +72 -78
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +44 -67
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +44 -67
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +53 -82
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +47 -77
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +23 -11
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res.mjs +5 -1
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +80 -97
- package/src/adapter/Runtime/CounterEntryPoint_Ops.res +2 -7
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +16 -10
- package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res +24 -15
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +17 -37
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +31 -57
- package/src/adapter/Runtime/EventMapperEntryPoint_Ops.res +18 -24
- package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res +1 -5
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +4 -3
- package/src/adapter/Runtime/HeartbeatEntryPoint.res +0 -1
- package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res +4 -2
- package/src/adapter/Runtime/PgMigrationEntryPoint.res +0 -1
- package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res +3 -2
- package/src/adapter/Runtime/PluginExtensionPointEntryPoint.res +1 -2
- package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res +4 -5
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +22 -10
- package/src/adapter/Runtime/RuntimeExtensionEntryPoint_Ops.res +8 -2
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +14 -31
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +16 -17
- package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res +10 -9
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +46 -52
- package/src/adapter/Runtime/StreamRoutedEntryPoint_Ops.res +36 -41
- package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res +31 -37
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +6 -7
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res +4 -6
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res +2 -6
- package/src/adapter/StateTopic/StateTopic_AppSync.res +21 -16
- package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +36 -32
- package/src/adapter/Task/TaskBucket_S3.res +6 -1
- package/src/adapter/Upload/Upload_Claim_S3.res +17 -20
- package/src/adapter/Upload/Upload_Claim_S3_Ops.res +5 -2
- package/src/adapter/Upload/Upload_Presign_S3.res +51 -49
- package/src/capability/Capability_Geocoding_AwsLocation.res +4 -1
- package/src/capability/Capability_Messaging.res +4 -5
- package/src/capability/Capability_Messaging_Ses.res +3 -1
- package/src/capability/Capability_ObjectStore_S3.res +1 -7
- package/src/components/Api/AppSync_Adapter.res +80 -109
- package/src/components/Api/AppSync_Adapter.res.mjs +26 -60
- package/src/components/Api/AppSync_SdlDecorate.res +118 -31
- package/src/components/Api/AppSync_SdlDecorate.res.mjs +45 -0
- package/src/components/AutomationSlice_Builder.res +6 -4
- package/src/components/ExtensionPoint_Builder.res +9 -10
- package/src/components/InboundTranslationSlice_Builder.res +7 -8
- package/src/components/OutboundTranslationSlice_Builder.res +14 -8
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +1 -1
- package/src/components/SideEffectHandler_Single.res +4 -4
- package/src/components/StateViewSlice_Builder.res +6 -4
- package/src/components/StateViewSlice_Builder_Stream.res +6 -4
- package/src/components/Task_Builder_PerBucket.res +10 -11
- package/src/plugin/cloner/ClonerRunner_Fargate.res +3 -10
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res +1 -4
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res +5 -5
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res +19 -21
- package/src/plugin/runtime/PluginRuntime_Builder.res +167 -188
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res +6 -5
- package/src/plugin/stack/Plugin_Stack.res +104 -103
- package/src/util/Util_AlarmSpec.res +2 -1
- package/src/util/Util_AppSync.res +8 -2
- package/src/util/Util_AppSync_Caller.res +15 -14
- package/src/util/Util_Bundle.res +46 -42
- package/src/util/Util_CognitoGroupUser_Runtime.res +32 -34
- package/src/util/Util_Cognito_Runtime.res +11 -7
- package/src/util/Util_DeadLetterQueue.res +12 -2
- package/src/util/Util_DynamoDb.res +5 -3
- package/src/util/Util_DynamoDbStream.res +7 -3
- package/src/util/Util_DynamoDbStream_Runtime.res +1 -2
- package/src/util/Util_DynamoDb_Runtime.res +23 -41
- package/src/util/Util_HostUiDomain.res +6 -1
- package/src/util/Util_Kinesis_Runtime.res +10 -11
- package/src/util/Util_Lambda.res +12 -5
- package/src/util/Util_LambdaEnvBudget.res +5 -5
- package/src/util/Util_LambdaLogging.res +1 -2
- package/src/util/Util_LogGroup_Adopting.res +1 -4
- package/src/util/Util_ResourceNaming.res +1 -2
- package/src/util/Util_SNS.res +8 -3
- package/src/util/Util_SNS_FIFO.res +1 -1
- package/src/util/Util_SNS_Runtime.res +11 -10
- package/src/util/Util_SQS.res +4 -2
- package/src/util/Util_SQS_FIFO.res +5 -2
- package/src/util/Util_SQS_Runtime.res +37 -36
- package/src/util/Util_ShellConfig.res +3 -2
- package/src/util/Util_StaticBundle.res +1 -3
- package/src/util/Util_StoreLayout.res +4 -1
- package/tests/AWS_TagsTest.res +16 -5
- package/tests/AppSyncEventsSigner_OpsTest.res +11 -2
- package/tests/AppSync_AdapterTest.res +286 -224
- package/tests/AppSync_AdapterTest.res.mjs +69 -0
- package/tests/AppSync_Resolver_RetryingTest.res +64 -44
- package/tests/AppSync_RetirementNarrowingTest.res +59 -46
- package/tests/AppSync_SdlDecorateTest.res +22 -20
- package/tests/AppSync_SourceApiAssociation_RetryingTest.res +40 -22
- package/tests/Auth_ActiveRolePoolAttachmentTest.res +114 -107
- package/tests/Auth_ActiveRoleStoreTest.res +12 -9
- package/tests/Auth_ActiveRoleStore_SchemaTest.res +2 -1
- package/tests/Auth_ActiveRoleTrigger_OpsTest.res +20 -16
- package/tests/Auth_CognitoTest.res +31 -46
- package/tests/Auth_LoginIdentifierTest.res +51 -0
- package/tests/Auth_LoginIdentifierTest.res.mjs +51 -0
- package/tests/Auth_SignUpModeTest.res +56 -0
- package/tests/Auth_SignUpModeTest.res.mjs +53 -0
- package/tests/AutomationSliceEntryPoint_OpsTest.res +69 -67
- package/tests/BakeConvergenceTest.res +22 -25
- package/tests/Capability_MessagingTest.res +28 -12
- package/tests/CommandTopicQueuePolicyTest.res +1 -2
- package/tests/CounterEntryPoint_OpsTest.res +3 -7
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +306 -210
- package/tests/EventCollectorConnectLambdaPreviewTest.res +14 -7
- package/tests/EventCollectorEntryPoint_OpsTest.res +12 -4
- package/tests/EventCollectorPluginDefinitionAssetTest.res +18 -11
- package/tests/EventCollectorReadyGateTest.res +5 -4
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +1 -2
- package/tests/EventMapperEntryPoint_OpsTest.res +1 -3
- package/tests/ExtensionPointEntryPoint_OpsTest.res +1 -4
- package/tests/HandlerFactoryDispatchTest.res +97 -70
- package/tests/MCP_LambdaTest.res +16 -27
- package/tests/PgChangeFeedRelay_IntegrationTest.res +123 -93
- package/tests/PgChangeFeedRelay_RuntimeTest.res +13 -10
- package/tests/PgMigrationEntryPoint_IntegrationTest.res +0 -1
- package/tests/PgPipeline_IntegrationTest.res +80 -66
- package/tests/PgQueryDbUnion_IntegrationTest.res +1 -2
- package/tests/PgQueryResolverEntryPoint_OpsTest.res +2 -6
- package/tests/PgQueryResolver_LambdaTest.res +41 -24
- package/tests/Platform_AdminScan_OpsTest.res +4 -1
- package/tests/Platform_ComponentDefinitions_Lambda_OpsTest.res +137 -129
- package/tests/ProjectionEntryPoint_DisplayNameTest.res +7 -3
- package/tests/ProjectionEntryPoint_UnionStampTest.res +3 -2
- package/tests/ProvisionAccountsTest.res +142 -0
- package/tests/ProvisionAccountsTest.res.mjs +153 -0
- package/tests/ProvisionAdminTest.res +55 -0
- package/tests/ProvisionAdminTest.res.mjs +66 -0
- package/tests/ProvisionIdentityTest.res +91 -9
- package/tests/ProvisionIdentityTest.res.mjs +66 -1
- package/tests/QueryDbOwnerIndexTableTest.res +6 -4
- package/tests/QueryDbResolvers_AppSyncTest.res +23 -16
- package/tests/QueryInterceptor_LambdaTest.res +11 -13
- package/tests/ReadModelEntryPoint_OpsTest.res +43 -41
- package/tests/RuntimeExtensionEntryPoint_OpsTest.res +4 -3
- package/tests/SideEffectEntryPoint_OpsTest.res +23 -18
- package/tests/StateChangeDescriptorParityTest.res +28 -26
- package/tests/StateTopicKeySchemaTest.res +18 -15
- package/tests/StateViewSliceEntryPoint_OpsTest.res +55 -44
- package/tests/TaskBucketEntryPoint_OpsTest.res +13 -13
- package/tests/Upload_ClaimTest.res +3 -3
- package/tests/Util_AwsErrorTest.res +4 -7
- package/tests/Util_BundleDependencyClosureTest.res +15 -3
- package/tests/Util_BundleEsmLoaderTest.res +3 -3
- package/tests/Util_BundleResolveTest.res +4 -6
- package/tests/Util_BundleRuntimeExtensionTest.res +17 -18
- package/tests/Util_DcbMetricsTest.res +6 -6
- package/tests/Util_DynamoDbStreamTest.res +4 -5
- package/tests/Util_DynamoDbTest.res +3 -2
- package/tests/Util_LambdaEnvBudgetTest.res +22 -18
- package/tests/Util_LambdaLoggingTest.res +9 -8
- package/tests/Util_LogGroup_AdoptingTest.res +10 -5
- package/tests/Util_LogRetentionTest.res +6 -2
- package/tests/Util_OwnerScopeEnvTest.res +35 -8
- package/tests/Util_OwnerScopeEnvTest.res.mjs +13 -0
- package/tests/Util_SQS_RuntimeTest.res +5 -7
- package/tests/Util_ShellConfigTest.res +7 -17
- package/tests/Util_StaticBundleTest.res +3 -8
- package/tests/Util_StoreLayoutTest.res +17 -12
- package/tests/integration/AggregateEntryPoint_IntegrationTest.res +1 -4
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +15 -15
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +296 -232
- package/tests/integration/DcbIntegrationHarness.res +8 -8
- package/tests/integration/EpCompositeSlice.res +16 -8
- package/tests/integration/QueryDbUnion_DynamoDb_IntegrationTest.res +8 -10
- package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res +10 -10
- package/tests/integration/SvsTestSlice_Projection.res +1 -3
- package/tests/util/Util_AlarmSpecTest.res +62 -49
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
+
import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
|
|
3
4
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
|
+
import * as AdminGroup$Reventless from "@reventlessdev/reventless-spec/src/types/AdminGroup.res.mjs";
|
|
4
6
|
import * as OwnerScope$Reventless from "@reventlessdev/reventless-spec/src/types/OwnerScope.res.mjs";
|
|
5
7
|
import * as Util_OwnerScopeEnv$ReventlessAws from "../src/util/Util_OwnerScopeEnv.res.mjs";
|
|
6
8
|
|
|
@@ -54,6 +56,17 @@ globalThis.describe("Util_OwnerScopeEnv — the elevated-groups carrier", () =>
|
|
|
54
56
|
withElevated([], () => Util_OwnerScopeEnv$ReventlessAws.applyElevatedGroupsDefault(variables));
|
|
55
57
|
globalThis.expect(Stdlib_Option.isNone(variables[Util_OwnerScopeEnv$ReventlessAws.key])).toBe(true);
|
|
56
58
|
});
|
|
59
|
+
globalThis.test("the platform's administrator default reaches a composed environment", () => {
|
|
60
|
+
OwnerScope$Reventless.clearElevatedGroups();
|
|
61
|
+
Stdlib_Dict.$$delete(process.env, Util_OwnerScopeEnv$ReventlessAws.key);
|
|
62
|
+
OwnerScope$Reventless.defaultElevatedGroups([AdminGroup$Reventless.name]);
|
|
63
|
+
let variables = {};
|
|
64
|
+
Util_OwnerScopeEnv$ReventlessAws.applyElevatedGroupsDefault(variables);
|
|
65
|
+
let value = variables[Util_OwnerScopeEnv$ReventlessAws.key];
|
|
66
|
+
let encoded = value !== undefined ? value : "";
|
|
67
|
+
OwnerScope$Reventless.clearElevatedGroups();
|
|
68
|
+
globalThis.expect(OwnerScope$Reventless.parseElevatedGroups(encoded)).toEqual([AdminGroup$Reventless.name]);
|
|
69
|
+
});
|
|
57
70
|
});
|
|
58
71
|
|
|
59
72
|
export {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
open JestGlobals
|
|
2
2
|
|
|
3
3
|
let shortId = "environment:alpha#platformName:online-shop#pluginName:Catalog"
|
|
4
|
-
let longId =
|
|
5
|
-
"componentName:DcbEventLog#environment:alpha#platformName:online-shop-platform-aws#pluginName:Catalog#resourceName:CatalogDcbEventLog-428c0a8"
|
|
4
|
+
let longId = "componentName:DcbEventLog#environment:alpha#platformName:online-shop-platform-aws#pluginName:Catalog#resourceName:CatalogDcbEventLog-428c0a8"
|
|
6
5
|
|
|
7
6
|
describe("Util_SQS_Runtime.safeGroupId", () => {
|
|
8
7
|
testSync("returns id unchanged when ≤ 128 chars", () => {
|
|
@@ -19,12 +18,11 @@ describe("Util_SQS_Runtime.safeGroupId", () => {
|
|
|
19
18
|
})
|
|
20
19
|
|
|
21
20
|
testSync("returns different hashes for different long ids", () => {
|
|
22
|
-
let longId2 =
|
|
23
|
-
"componentName:Products#environment:alpha#platformName:online-shop-platform-aws#pluginName:Catalog#resourceName:ProductsTable-abc1234"
|
|
21
|
+
let longId2 = "componentName:Products#environment:alpha#platformName:online-shop-platform-aws#pluginName:Catalog#resourceName:ProductsTable-abc1234"
|
|
24
22
|
expect(longId2->String.length > 128)->toBe(true)
|
|
25
|
-
expect(
|
|
26
|
-
|
|
27
|
-
)
|
|
23
|
+
expect(Util_SQS_Runtime.safeGroupId(longId) == Util_SQS_Runtime.safeGroupId(longId2))->toBe(
|
|
24
|
+
false,
|
|
25
|
+
)
|
|
28
26
|
})
|
|
29
27
|
|
|
30
28
|
testSync("returns same hash for the same long id (deterministic)", () => {
|
|
@@ -33,9 +33,7 @@ describe("Util_ShellConfig.fields — viewModes", () => {
|
|
|
33
33
|
expect(out->get("viewModes"))->toEqual(
|
|
34
34
|
JSON.Encode.array([JSON.Encode.string("map"), JSON.Encode.string("graph")]),
|
|
35
35
|
)
|
|
36
|
-
expect(out->get("mapStyle"))->toEqual(
|
|
37
|
-
JSON.Encode.string("https://tiles.example/style.json"),
|
|
38
|
-
)
|
|
36
|
+
expect(out->get("mapStyle"))->toEqual(JSON.Encode.string("https://tiles.example/style.json"))
|
|
39
37
|
expect(out->get("graphLayout"))->toEqual(JSON.Encode.string("dagre"))
|
|
40
38
|
})
|
|
41
39
|
})
|
|
@@ -43,7 +41,7 @@ describe("Util_ShellConfig.fields — viewModes", () => {
|
|
|
43
41
|
describe("Util_ShellConfig.fields — bakedManifest", () => {
|
|
44
42
|
let bake = (~key: option<string>=?): ReventlessInfra.Platform.bakedManifest => {
|
|
45
43
|
components: [{plugin: "Catalog", views: ["Products"], commands: []}],
|
|
46
|
-
|
|
44
|
+
?key,
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
testSync("unset ⇒ no manifestUrl, so every caller keeps the admin path", () => {
|
|
@@ -202,8 +200,8 @@ describe("Util_ShellConfig.fields — journeys", () => {
|
|
|
202
200
|
->Array.filterMap(JSON.Decode.string),
|
|
203
201
|
)
|
|
204
202
|
expect(published)->toEqual(
|
|
205
|
-
ReventlessCore.Platform_BakedManifest.files(~config=bake)->Array.map(
|
|
206
|
-
"/" ++ key
|
|
203
|
+
ReventlessCore.Platform_BakedManifest.files(~config=bake)->Array.map(
|
|
204
|
+
((key, _)) => "/" ++ key,
|
|
207
205
|
),
|
|
208
206
|
)
|
|
209
207
|
})
|
|
@@ -215,9 +213,7 @@ describe("Util_ShellConfig.fields — journeys", () => {
|
|
|
215
213
|
let _ = Util_ShellConfig.fields(
|
|
216
214
|
~computed,
|
|
217
215
|
~bakedManifest=withJourneys(~journeys=[shopper]),
|
|
218
|
-
~shellConfig=Dict.fromArray([
|
|
219
|
-
("journeyManifestUrls", JSON.Encode.object(Dict.make())),
|
|
220
|
-
]),
|
|
216
|
+
~shellConfig=Dict.fromArray([("journeyManifestUrls", JSON.Encode.object(Dict.make()))]),
|
|
221
217
|
)
|
|
222
218
|
None
|
|
223
219
|
} catch {
|
|
@@ -239,12 +235,7 @@ describe("Util_ShellConfig.fields — shellConfig passthrough", () => {
|
|
|
239
235
|
("accessTiers", JSON.Encode.array([JSON.Encode.string("public")])),
|
|
240
236
|
]),
|
|
241
237
|
)
|
|
242
|
-
expect(out->Dict.keysToArray)->toEqual([
|
|
243
|
-
"apiEndpoint",
|
|
244
|
-
"region",
|
|
245
|
-
"platformName",
|
|
246
|
-
"accessTiers",
|
|
247
|
-
])
|
|
238
|
+
expect(out->Dict.keysToArray)->toEqual(["apiEndpoint", "region", "platformName", "accessTiers"])
|
|
248
239
|
expect(out->get("platformName"))->toEqual(JSON.Encode.string("Online Shop"))
|
|
249
240
|
})
|
|
250
241
|
|
|
@@ -277,8 +268,7 @@ describe("Util_ShellConfig.fields — shellConfig passthrough", () => {
|
|
|
277
268
|
// These assert the property that removes that window, not the spelling.
|
|
278
269
|
describe("Util_ShellConfig.identityFields", () => {
|
|
279
270
|
let fields = Util_ShellConfig.identityFields(~providerId="eu-west-1_x", ~clientId="7cl13nt")
|
|
280
|
-
let get = key =>
|
|
281
|
-
fields->Array.find(((k, _)) => k == key)->Option.map(((_, v)) => v)
|
|
271
|
+
let get = key => fields->Array.find(((k, _)) => k == key)->Option.map(((_, v)) => v)
|
|
282
272
|
|
|
283
273
|
testSync("the new spelling is present", () =>
|
|
284
274
|
expect((get("identityProviderId"), get("identityProviderClientId")))->toEqual((
|
|
@@ -31,13 +31,9 @@ describe("Util_StaticBundle.contentTypeFor", () => {
|
|
|
31
31
|
)
|
|
32
32
|
)
|
|
33
33
|
testSync("json", () =>
|
|
34
|
-
expect(Util_StaticBundle.contentTypeFor("data.json"))->toBe(
|
|
35
|
-
"application/json; charset=utf-8",
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
testSync("svg", () =>
|
|
39
|
-
expect(Util_StaticBundle.contentTypeFor("logo.svg"))->toBe("image/svg+xml")
|
|
34
|
+
expect(Util_StaticBundle.contentTypeFor("data.json"))->toBe("application/json; charset=utf-8")
|
|
40
35
|
)
|
|
36
|
+
testSync("svg", () => expect(Util_StaticBundle.contentTypeFor("logo.svg"))->toBe("image/svg+xml"))
|
|
41
37
|
testSync("woff2", () =>
|
|
42
38
|
expect(Util_StaticBundle.contentTypeFor("font.woff2"))->toBe("font/woff2")
|
|
43
39
|
)
|
|
@@ -92,8 +88,7 @@ describe("Util_StaticBundle.walk", () => {
|
|
|
92
88
|
testSync("identical contents produce identical hashes", () => {
|
|
93
89
|
let dir = makeFixture()
|
|
94
90
|
let entries = Util_StaticBundle.walk(dir)
|
|
95
|
-
let indexEntry =
|
|
96
|
-
entries->Array.find(e => e.relativePath == "index.html")->Option.getUnsafe
|
|
91
|
+
let indexEntry = entries->Array.find(e => e.relativePath == "index.html")->Option.getUnsafe
|
|
97
92
|
let indexHash = indexEntry.contentHash
|
|
98
93
|
let dir2 = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
|
|
99
94
|
NodeFs.writeFileSync(NodePath.join([dir2, "index.html"]), "<html></html>")
|
|
@@ -4,11 +4,15 @@ let prodStacks = Util_HostUiDomain.defaultProdStacks
|
|
|
4
4
|
|
|
5
5
|
describe("Util_StoreLayout.layoutFor", () => {
|
|
6
6
|
testSync("a prod-named stack gets a bucket per store", () =>
|
|
7
|
-
expect(Util_StoreLayout.layoutFor(~stack="prod", ~prodStacks))->toEqual(
|
|
7
|
+
expect(Util_StoreLayout.layoutFor(~stack="prod", ~prodStacks))->toEqual(
|
|
8
|
+
Util_StoreLayout.PerStore,
|
|
9
|
+
)
|
|
8
10
|
)
|
|
9
11
|
|
|
10
12
|
testSync("'main' is production too, by the shared prod list", () =>
|
|
11
|
-
expect(Util_StoreLayout.layoutFor(~stack="main", ~prodStacks))->toEqual(
|
|
13
|
+
expect(Util_StoreLayout.layoutFor(~stack="main", ~prodStacks))->toEqual(
|
|
14
|
+
Util_StoreLayout.PerStore,
|
|
15
|
+
)
|
|
12
16
|
)
|
|
13
17
|
|
|
14
18
|
testSync("alpha shares one bucket", () =>
|
|
@@ -34,9 +38,9 @@ describe("Util_StoreLayout.layoutFor", () => {
|
|
|
34
38
|
)
|
|
35
39
|
|
|
36
40
|
testSync("adding it to the prod list is the fix", () =>
|
|
37
|
-
expect(
|
|
38
|
-
Util_StoreLayout.
|
|
39
|
-
)
|
|
41
|
+
expect(
|
|
42
|
+
Util_StoreLayout.layoutFor(~stack="production", ~prodStacks=["prod", "production"]),
|
|
43
|
+
)->toEqual(Util_StoreLayout.PerStore)
|
|
40
44
|
)
|
|
41
45
|
})
|
|
42
46
|
|
|
@@ -91,18 +95,18 @@ describe("Util_StoreLayout.coverageFor", () => {
|
|
|
91
95
|
)
|
|
92
96
|
|
|
93
97
|
testSync("declaring nothing is covered, whatever the platform provisions", () =>
|
|
94
|
-
expect(
|
|
95
|
-
Util_StoreLayout.
|
|
96
|
-
)
|
|
98
|
+
expect(
|
|
99
|
+
Util_StoreLayout.coverageFor(~required=[], ~provisioned=["Catalog.productImages"]),
|
|
100
|
+
)->toEqual(Util_StoreLayout.Covered)
|
|
97
101
|
)
|
|
98
102
|
|
|
99
103
|
// A platform provisioning nothing has not adopted capability provisioning.
|
|
100
104
|
// Failing it would break deployments that work today, so this is the arm that
|
|
101
105
|
// must NOT be a hard error.
|
|
102
106
|
testSync("a platform provisioning nothing has not adopted, rather than got it wrong", () =>
|
|
103
|
-
expect(
|
|
104
|
-
Util_StoreLayout.
|
|
105
|
-
)
|
|
107
|
+
expect(
|
|
108
|
+
Util_StoreLayout.coverageFor(~required=["Catalog.productImages"], ~provisioned=[]),
|
|
109
|
+
)->toEqual(Util_StoreLayout.NotAdopted(["Catalog.productImages"]))
|
|
106
110
|
)
|
|
107
111
|
|
|
108
112
|
// The case that shipped: the platform declared the store under a lowercased
|
|
@@ -282,7 +286,8 @@ describe("Util_StoreLayout.pendingExpiryFor", () => {
|
|
|
282
286
|
// Guessing at what a typo meant, in the one setting that deletes objects, is
|
|
283
287
|
// not a service — an unreadable entry leaves the store accumulating.
|
|
284
288
|
testSync("a malformed or non-positive entry is ignored, not defaulted", () => {
|
|
285
|
-
let of_ = c =>
|
|
289
|
+
let of_ = c =>
|
|
290
|
+
Util_StoreLayout.pendingExpiryFor(~config=Some(c), ~store="Catalog.productImages")
|
|
286
291
|
expect((
|
|
287
292
|
of_("Catalog.productImages"),
|
|
288
293
|
of_("Catalog.productImages="),
|
|
@@ -73,10 +73,7 @@ let buildAppSyncEvent = (~id, ~name): JSON.t => {
|
|
|
73
73
|
("id", id->JSON.Encode.string),
|
|
74
74
|
("name", name->JSON.Encode.string),
|
|
75
75
|
])
|
|
76
|
-
let meta = Dict.fromArray([
|
|
77
|
-
("user", "agg-test"->JSON.Encode.string),
|
|
78
|
-
("ip", JSON.Encode.null),
|
|
79
|
-
])
|
|
76
|
+
let meta = Dict.fromArray([("user", "agg-test"->JSON.Encode.string), ("ip", JSON.Encode.null)])
|
|
80
77
|
Dict.fromArray([
|
|
81
78
|
("command", "Add"->JSON.Encode.string),
|
|
82
79
|
("arguments", arguments->JSON.Encode.object),
|
|
@@ -126,10 +126,7 @@ let buildAppSyncEvent = (widgetId): JSON.t => {
|
|
|
126
126
|
// template in `DcbCmdHandlerResolver_GraphQL.res`).
|
|
127
127
|
let command = Dict.fromArray([("AddWidget", Dict.make()->JSON.Encode.object)])
|
|
128
128
|
let arguments = Dict.fromArray([("widgetId", widgetId->JSON.Encode.string)])
|
|
129
|
-
let meta = Dict.fromArray([
|
|
130
|
-
("user", "ep-test"->JSON.Encode.string),
|
|
131
|
-
("ip", JSON.Encode.null),
|
|
132
|
-
])
|
|
129
|
+
let meta = Dict.fromArray([("user", "ep-test"->JSON.Encode.string), ("ip", JSON.Encode.null)])
|
|
133
130
|
Dict.fromArray([
|
|
134
131
|
("command", command->JSON.Encode.object),
|
|
135
132
|
("arguments", arguments->JSON.Encode.object),
|
|
@@ -181,25 +178,28 @@ describe("DcbCommandTopicEntryPoint integration", () => {
|
|
|
181
178
|
|
|
182
179
|
// Concurrent burst — simulates the deploy-sync fan-out that surfaced the
|
|
183
180
|
// `retries exhausted` cascade on alpha.
|
|
184
|
-
let outcomes =
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
runOneCompositeEvent(table.name, buildAddResourceEvent(~environment=env, ~resourceName))
|
|
188
|
-
|
|
189
|
-
|
|
181
|
+
let outcomes = await resourceNames
|
|
182
|
+
->Array.map(
|
|
183
|
+
resourceName =>
|
|
184
|
+
runOneCompositeEvent(table.name, buildAddResourceEvent(~environment=env, ~resourceName)),
|
|
185
|
+
)
|
|
186
|
+
->Promise.all
|
|
190
187
|
|
|
191
188
|
// Every distinct composite entity must commit — none may conflict on the
|
|
192
189
|
// shared `environment` prefix.
|
|
193
|
-
outcomes->Array.forEach(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
outcomes->Array.forEach(
|
|
191
|
+
outcomeJson => {
|
|
192
|
+
let s = outcomeJson->JSON.stringifyAny->Option.getOr("<unserializable>")
|
|
193
|
+
expect(s->String.includes("CommandAccepted"))->toBe(true)
|
|
194
|
+
},
|
|
195
|
+
)
|
|
197
196
|
|
|
198
197
|
// Mechanism-level proof: the only fence rows are the synthetic composite
|
|
199
198
|
// fences (`fence#__dcb_composite__:…`) — one per entity — with NO
|
|
200
199
|
// per-member `fence#environment:…` / `fence#resourceName:…` rows.
|
|
201
200
|
let fenceIds = await H.scanFenceIds(table)
|
|
202
|
-
let compositeFencePrefix =
|
|
201
|
+
let compositeFencePrefix =
|
|
202
|
+
"fence#" ++ DcbEventLogStorage_DynamoDb_Runtime.compositeFenceTagKey
|
|
203
203
|
expect(fenceIds->Array.length)->toBe(resourceNames->Array.length)
|
|
204
204
|
fenceIds->Array.forEach(id => expect(id->String.startsWith(compositeFencePrefix))->toBe(true))
|
|
205
205
|
|