@reventlessdev/reventless-local 3.0.0-alpha.113
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 +1197 -0
- package/LICENSE +202 -0
- package/__mocks__/emptyModule.js +2 -0
- package/__mocks__/nodeSqlite.mjs +6 -0
- package/package.json +67 -0
- package/rescript.json +39 -0
- package/src/Platform.res +2162 -0
- package/src/Platform.res.mjs +3389 -0
- package/src/adapter/Api/LocalGraphQL_Adapter.res +29 -0
- package/src/adapter/Api/LocalGraphQL_Adapter.res.mjs +26 -0
- package/src/adapter/Api/LocalGraphQL_SubscriptionResolvers.res +146 -0
- package/src/adapter/Api/LocalGraphQL_SubscriptionResolvers.res.mjs +88 -0
- package/src/adapter/Auth/Auth_GraphqlContext.res +83 -0
- package/src/adapter/Auth/Auth_GraphqlContext.res.mjs +76 -0
- package/src/adapter/Auth/LocalAuth.res +239 -0
- package/src/adapter/Auth/LocalAuth.res.mjs +247 -0
- package/src/adapter/Auth/UserStore.res +134 -0
- package/src/adapter/Auth/UserStore.res.mjs +146 -0
- package/src/adapter/Backend.res +46 -0
- package/src/adapter/Backend.res.mjs +66 -0
- package/src/adapter/BackendState.res +34 -0
- package/src/adapter/BackendState.res.mjs +42 -0
- package/src/adapter/Cloner/LocalClonerRunner.res +13 -0
- package/src/adapter/Cloner/LocalClonerRunner.res.mjs +12 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res +329 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res.mjs +301 -0
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_GraphQL.res +76 -0
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_GraphQL.res.mjs +57 -0
- package/src/adapter/CommandGenerator/LocalCommandGeneratorResolvers.res +19 -0
- package/src/adapter/CommandGenerator/LocalCommandGeneratorResolvers.res.mjs +19 -0
- package/src/adapter/CommandTopic/LocalCommandTopicChannel.res +104 -0
- package/src/adapter/CommandTopic/LocalCommandTopicChannel.res.mjs +82 -0
- package/src/adapter/CommandTopic/LocalCommandTopicRemoteChannel.res +32 -0
- package/src/adapter/CommandTopic/LocalCommandTopicRemoteChannel.res.mjs +38 -0
- package/src/adapter/Counter/LocalCounterHandler.res +42 -0
- package/src/adapter/Counter/LocalCounterHandler.res.mjs +45 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_InMemory.res +131 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_InMemory.res.mjs +140 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_Sqlite.res +334 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_Sqlite.res.mjs +299 -0
- package/src/adapter/DomainGraphQL_Server.res +565 -0
- package/src/adapter/DomainGraphQL_Server.res.mjs +576 -0
- package/src/adapter/DomainMCP_Server.res +369 -0
- package/src/adapter/DomainMCP_Server.res.mjs +358 -0
- package/src/adapter/EventCollector/LocalEventCollectorChannel.res +87 -0
- package/src/adapter/EventCollector/LocalEventCollectorChannel.res.mjs +45 -0
- package/src/adapter/EventLog/EventLogStorage_InMemory.res +105 -0
- package/src/adapter/EventLog/EventLogStorage_InMemory.res.mjs +117 -0
- package/src/adapter/EventLog/EventLogStorage_Sqlite.res +145 -0
- package/src/adapter/EventLog/EventLogStorage_Sqlite.res.mjs +155 -0
- package/src/adapter/EventTopic/LocalEventTopicPublisher.res +36 -0
- package/src/adapter/EventTopic/LocalEventTopicPublisher.res.mjs +31 -0
- package/src/adapter/GraphQL_Server.res +6 -0
- package/src/adapter/GraphQL_Server.res.mjs +154 -0
- package/src/adapter/GraphQL_ServerInstance.res +310 -0
- package/src/adapter/GraphQL_ServerInstance.res.mjs +257 -0
- package/src/adapter/Heartbeat/LocalHeartbeatRunner.res +57 -0
- package/src/adapter/Heartbeat/LocalHeartbeatRunner.res.mjs +34 -0
- package/src/adapter/LocalBus.res +498 -0
- package/src/adapter/LocalBus.res.mjs +1011 -0
- package/src/adapter/LocalPluginSpec.res +16 -0
- package/src/adapter/LocalPluginSpec.res.mjs +33 -0
- package/src/adapter/LocalSideEffectHandler.res +44 -0
- package/src/adapter/LocalSideEffectHandler.res.mjs +34 -0
- package/src/adapter/MCP_Server.res +4 -0
- package/src/adapter/MCP_Server.res.mjs +67 -0
- package/src/adapter/MCP_ServerInstance.res +362 -0
- package/src/adapter/MCP_ServerInstance.res.mjs +313 -0
- package/src/adapter/PlatformGraphQL_Server.res +75 -0
- package/src/adapter/PlatformGraphQL_Server.res.mjs +84 -0
- package/src/adapter/PlatformMCP_Server.res +23 -0
- package/src/adapter/PlatformMCP_Server.res.mjs +46 -0
- package/src/adapter/QueryDb/QueryDbResolvers_GraphQL.res +793 -0
- package/src/adapter/QueryDb/QueryDbResolvers_GraphQL.res.mjs +569 -0
- package/src/adapter/QueryDb/QueryDbStorage_InMemory.res +242 -0
- package/src/adapter/QueryDb/QueryDbStorage_InMemory.res.mjs +241 -0
- package/src/adapter/QueryDb/QueryDbStorage_Sqlite.res +339 -0
- package/src/adapter/QueryDb/QueryDbStorage_Sqlite.res.mjs +318 -0
- package/src/adapter/QueryDb/SortKey_Filter.res +48 -0
- package/src/adapter/QueryDb/SortKey_Filter.res.mjs +46 -0
- package/src/adapter/QueryEngine/LocalQueryEngine.res +57 -0
- package/src/adapter/QueryEngine/LocalQueryEngine.res.mjs +56 -0
- package/src/adapter/Runtime/LocalAggregateRuntime_Builder.res +91 -0
- package/src/adapter/Runtime/LocalAggregateRuntime_Builder.res.mjs +50 -0
- package/src/adapter/Runtime/LocalEventCollectorRuntime_Builder.res +47 -0
- package/src/adapter/Runtime/LocalEventCollectorRuntime_Builder.res.mjs +37 -0
- package/src/adapter/Runtime/LocalPluginRuntime_Builder.res +11 -0
- package/src/adapter/Runtime/LocalPluginRuntime_Builder.res.mjs +30 -0
- package/src/adapter/Runtime/LocalRuntimeEnvironment.res +54 -0
- package/src/adapter/Runtime/LocalRuntimeEnvironment.res.mjs +40 -0
- package/src/adapter/Scheduler/LocalScheduledPublisher.res +102 -0
- package/src/adapter/Scheduler/LocalScheduledPublisher.res.mjs +84 -0
- package/src/adapter/SqliteDriver.res +52 -0
- package/src/adapter/SqliteDriver.res.mjs +76 -0
- package/src/adapter/SqliteDriver.resi +31 -0
- package/src/adapter/Task/LocalTaskBucket.res +75 -0
- package/src/adapter/Task/LocalTaskBucket.res.mjs +48 -0
- package/src/adapter/Task/TaskBucket_Sqlite.res +47 -0
- package/src/adapter/Task/TaskBucket_Sqlite.res.mjs +40 -0
- package/src/components/Aggregate_Builder.res +55 -0
- package/src/components/Aggregate_Builder.res.mjs +140 -0
- package/src/components/AutomationSlice_Builder.res +41 -0
- package/src/components/AutomationSlice_Builder.res.mjs +57 -0
- package/src/components/Counter_Builder.res +14 -0
- package/src/components/Counter_Builder.res.mjs +32 -0
- package/src/components/DcbEventLog_Builder.res +18 -0
- package/src/components/DcbEventLog_Builder.res.mjs +24 -0
- package/src/components/ExtensionPoint_Builder.res +25 -0
- package/src/components/ExtensionPoint_Builder.res.mjs +44 -0
- package/src/components/InboundTranslationSlice_Builder.res +34 -0
- package/src/components/InboundTranslationSlice_Builder.res.mjs +45 -0
- package/src/components/OutboundTranslationSlice_Builder.res +43 -0
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +59 -0
- package/src/components/Plugin_Builder.res +37 -0
- package/src/components/Plugin_Builder.res.mjs +67 -0
- package/src/components/ReadModel_Builder.res +47 -0
- package/src/components/ReadModel_Builder.res.mjs +54 -0
- package/src/components/StateChangeSlice_Builder.res +19 -0
- package/src/components/StateChangeSlice_Builder.res.mjs +21 -0
- package/src/components/StateViewSlice_Builder.res +42 -0
- package/src/components/StateViewSlice_Builder.res.mjs +58 -0
- package/src/components/Task_Builder.res +28 -0
- package/src/components/Task_Builder.res.mjs +41 -0
- package/src/reexport/CommandTopic.res +3 -0
- package/src/reexport/CommandTopic.res.mjs +55 -0
- package/src/test/Mocks/MockDcbEventLogStorage.res +136 -0
- package/src/test/Mocks/MockDcbEventLogStorage.res.mjs +146 -0
- package/src/test/Mocks/MockEventLogStorage.res +57 -0
- package/src/test/Mocks/MockEventLogStorage.res.mjs +65 -0
- package/src/test/Mocks/MockPublisher.res +29 -0
- package/src/test/Mocks/MockPublisher.res.mjs +28 -0
- package/src/test/Mocks/MockQueryDbStorage.res +104 -0
- package/src/test/Mocks/MockQueryDbStorage.res.mjs +136 -0
- package/src/test/TestRunner.res +96 -0
- package/src/test/TestRunner.res.mjs +71 -0
- package/tests/SplitApiFixtures.res +84 -0
- package/tests/SplitApiFixtures.res.mjs +88 -0
- package/tests/SplitApiTest.res +102 -0
- package/tests/SplitApiTest.res.mjs +82 -0
- package/tests/TestFixtures.res +54 -0
- package/tests/TestFixtures.res.mjs +65 -0
- package/tests/adapter/BackendParityTest.res +94 -0
- package/tests/adapter/BackendParityTest.res.mjs +96 -0
- package/tests/adapter/CollectNEventsTest.res +82 -0
- package/tests/adapter/CollectNEventsTest.res.mjs +83 -0
- package/tests/adapter/CommandAuthorizationTest.res +200 -0
- package/tests/adapter/CommandAuthorizationTest.res.mjs +190 -0
- package/tests/adapter/CommandTopicChannelTest.res +174 -0
- package/tests/adapter/CommandTopicChannelTest.res.mjs +170 -0
- package/tests/adapter/CounterHandlerTest.res +113 -0
- package/tests/adapter/CounterHandlerTest.res.mjs +96 -0
- package/tests/adapter/DcbEventLogStorageSqliteTest.res +157 -0
- package/tests/adapter/DcbEventLogStorageSqliteTest.res.mjs +165 -0
- package/tests/adapter/DcbEventLogStorageTest.res +187 -0
- package/tests/adapter/DcbEventLogStorageTest.res.mjs +195 -0
- package/tests/adapter/EventCollectorChannelTest.res +166 -0
- package/tests/adapter/EventCollectorChannelTest.res.mjs +178 -0
- package/tests/adapter/EventLogStorageSqliteTest.res +105 -0
- package/tests/adapter/EventLogStorageSqliteTest.res.mjs +116 -0
- package/tests/adapter/EventTapTest.res +102 -0
- package/tests/adapter/EventTapTest.res.mjs +94 -0
- package/tests/adapter/EventTopicPublisherTest.res +76 -0
- package/tests/adapter/EventTopicPublisherTest.res.mjs +86 -0
- package/tests/adapter/GraphQL_SchemaInspectorTest.res +763 -0
- package/tests/adapter/GraphQL_SchemaInspectorTest.res.mjs +578 -0
- package/tests/adapter/GraphQL_SubscriptionResolversTest.res +161 -0
- package/tests/adapter/GraphQL_SubscriptionResolversTest.res.mjs +134 -0
- package/tests/adapter/HeartbeatRunnerTest.res +136 -0
- package/tests/adapter/HeartbeatRunnerTest.res.mjs +96 -0
- package/tests/adapter/LocalAuthHttpTest.res +224 -0
- package/tests/adapter/LocalAuthHttpTest.res.mjs +237 -0
- package/tests/adapter/LocalAuthLoginTest.res +180 -0
- package/tests/adapter/LocalAuthLoginTest.res.mjs +207 -0
- package/tests/adapter/LocalAuthTest.res +106 -0
- package/tests/adapter/LocalAuthTest.res.mjs +145 -0
- package/tests/adapter/LocalAuthUserStoreTest.res +172 -0
- package/tests/adapter/LocalAuthUserStoreTest.res.mjs +208 -0
- package/tests/adapter/LocalBusBoundedTest.res +157 -0
- package/tests/adapter/LocalBusBoundedTest.res.mjs +168 -0
- package/tests/adapter/LocalBusPubSubTest.res +81 -0
- package/tests/adapter/LocalBusPubSubTest.res.mjs +81 -0
- package/tests/adapter/QueryDbGsiTtlTest.res +268 -0
- package/tests/adapter/QueryDbGsiTtlTest.res.mjs +209 -0
- package/tests/adapter/QueryDbListResolverTest.res +361 -0
- package/tests/adapter/QueryDbListResolverTest.res.mjs +426 -0
- package/tests/adapter/QueryDbStorageSqliteTest.res +159 -0
- package/tests/adapter/QueryDbStorageSqliteTest.res.mjs +126 -0
- package/tests/adapter/QueryDbStorageTest.res +171 -0
- package/tests/adapter/QueryDbStorageTest.res.mjs +170 -0
- package/tests/adapter/QueryEngineTest.res +152 -0
- package/tests/adapter/QueryEngineTest.res.mjs +148 -0
- package/tests/adapter/ScheduledPublisherTest.res +199 -0
- package/tests/adapter/ScheduledPublisherTest.res.mjs +203 -0
- package/tests/adapter/SortKey_FilterTest.res +103 -0
- package/tests/adapter/SortKey_FilterTest.res.mjs +135 -0
- package/tests/adapter/SqliteDriverTest.res +86 -0
- package/tests/adapter/SqliteDriverTest.res.mjs +101 -0
- package/tests/adapter/TaskBucketSqliteTest.res +44 -0
- package/tests/adapter/TaskBucketSqliteTest.res.mjs +40 -0
- package/tests/adapter/TaskBucketTest.res +106 -0
- package/tests/adapter/TaskBucketTest.res.mjs +118 -0
- package/tests/components/aggregate/AggregateFixtures.res +78 -0
- package/tests/components/aggregate/AggregateFixtures.res.mjs +109 -0
- package/tests/components/aggregate/AggregateTest.res +129 -0
- package/tests/components/aggregate/AggregateTest.res.mjs +129 -0
- package/tests/components/automationslice/AutomationSliceCallbackTest.res +212 -0
- package/tests/components/automationslice/AutomationSliceCallbackTest.res.mjs +233 -0
- package/tests/components/automationslice/AutomationSliceFixtures.res +189 -0
- package/tests/components/automationslice/AutomationSliceFixtures.res.mjs +276 -0
- package/tests/components/automationslice/AutomationSliceSelfDeadlockFixtures.res +289 -0
- package/tests/components/automationslice/AutomationSliceSelfDeadlockFixtures.res.mjs +453 -0
- package/tests/components/automationslice/AutomationSliceSelfDeadlockTest.res +47 -0
- package/tests/components/automationslice/AutomationSliceSelfDeadlockTest.res.mjs +31 -0
- package/tests/components/automationslice/MixedSourceAutomationSliceFixtures.res +213 -0
- package/tests/components/automationslice/MixedSourceAutomationSliceFixtures.res.mjs +268 -0
- package/tests/components/automationslice/MixedSourceAutomationSliceTest.res +118 -0
- package/tests/components/automationslice/MixedSourceAutomationSliceTest.res.mjs +99 -0
- package/tests/components/commandgenerator/CommandGeneratorFixtures.res +73 -0
- package/tests/components/commandgenerator/CommandGeneratorFixtures.res.mjs +109 -0
- package/tests/components/commandgenerator/CommandGeneratorTest.res +43 -0
- package/tests/components/commandgenerator/CommandGeneratorTest.res.mjs +46 -0
- package/tests/components/commandtopic/CommandTopicFixtures.res +37 -0
- package/tests/components/commandtopic/CommandTopicFixtures.res.mjs +68 -0
- package/tests/components/commandtopic/CommandTopicStreamFixtures.res +43 -0
- package/tests/components/commandtopic/CommandTopicStreamFixtures.res.mjs +91 -0
- package/tests/components/commandtopic/CommandTopicStreamTest.res +30 -0
- package/tests/components/commandtopic/CommandTopicStreamTest.res.mjs +35 -0
- package/tests/components/commandtopic/CommandTopicTest.res +55 -0
- package/tests/components/commandtopic/CommandTopicTest.res.mjs +62 -0
- package/tests/components/counter/CounterFixtures.res +42 -0
- package/tests/components/counter/CounterFixtures.res.mjs +34 -0
- package/tests/components/counter/CounterTest.res +46 -0
- package/tests/components/counter/CounterTest.res.mjs +61 -0
- package/tests/components/dcb/DcbCrossPartitionFixtures.res +170 -0
- package/tests/components/dcb/DcbCrossPartitionFixtures.res.mjs +276 -0
- package/tests/components/dcb/DcbCrossPartitionReadTest.res +68 -0
- package/tests/components/dcb/DcbCrossPartitionReadTest.res.mjs +78 -0
- package/tests/components/dcb/DcbEventLogAppendStreamTest.res +72 -0
- package/tests/components/dcb/DcbEventLogAppendStreamTest.res.mjs +82 -0
- package/tests/components/dcb/DcbEventLogStreamTest.res +103 -0
- package/tests/components/dcb/DcbEventLogStreamTest.res.mjs +91 -0
- package/tests/components/dcb/DcbFixtures.res +145 -0
- package/tests/components/dcb/DcbFixtures.res.mjs +221 -0
- package/tests/components/dcb/DcbTest.res +55 -0
- package/tests/components/dcb/DcbTest.res.mjs +55 -0
- package/tests/components/eventcollector/EventCollectorFixtures.res +42 -0
- package/tests/components/eventcollector/EventCollectorFixtures.res.mjs +49 -0
- package/tests/components/eventcollector/EventCollectorTest.res +37 -0
- package/tests/components/eventcollector/EventCollectorTest.res.mjs +36 -0
- package/tests/components/eventlog/EventLogAppendStreamTest.res +93 -0
- package/tests/components/eventlog/EventLogAppendStreamTest.res.mjs +113 -0
- package/tests/components/eventlog/EventLogConflictTest.res +86 -0
- package/tests/components/eventlog/EventLogConflictTest.res.mjs +81 -0
- package/tests/components/eventlog/EventLogFixtures.res +52 -0
- package/tests/components/eventlog/EventLogFixtures.res.mjs +80 -0
- package/tests/components/eventlog/EventLogStreamTest.res +98 -0
- package/tests/components/eventlog/EventLogStreamTest.res.mjs +142 -0
- package/tests/components/eventlog/EventLogTest.res +53 -0
- package/tests/components/eventlog/EventLogTest.res.mjs +74 -0
- package/tests/components/eventtopic/EventTopicFixtures.res +47 -0
- package/tests/components/eventtopic/EventTopicFixtures.res.mjs +77 -0
- package/tests/components/eventtopic/EventTopicStreamFixtures.res +27 -0
- package/tests/components/eventtopic/EventTopicStreamFixtures.res.mjs +62 -0
- package/tests/components/eventtopic/EventTopicStreamTest.res +35 -0
- package/tests/components/eventtopic/EventTopicStreamTest.res.mjs +44 -0
- package/tests/components/eventtopic/EventTopicTest.res +35 -0
- package/tests/components/eventtopic/EventTopicTest.res.mjs +43 -0
- package/tests/components/extensionpoint/ExtensionPointFixtures.res +145 -0
- package/tests/components/extensionpoint/ExtensionPointFixtures.res.mjs +188 -0
- package/tests/components/extensionpoint/ExtensionPointTest.res +62 -0
- package/tests/components/extensionpoint/ExtensionPointTest.res.mjs +55 -0
- package/tests/components/heartbeat/HeartbeatFixtures.res +48 -0
- package/tests/components/heartbeat/HeartbeatFixtures.res.mjs +46 -0
- package/tests/components/heartbeat/HeartbeatTest.res +67 -0
- package/tests/components/heartbeat/HeartbeatTest.res.mjs +65 -0
- package/tests/components/inboundtranslationslice/InboundTranslationSliceCallbackTest.res +241 -0
- package/tests/components/inboundtranslationslice/InboundTranslationSliceCallbackTest.res.mjs +239 -0
- package/tests/components/inboundtranslationslice/InboundTranslationSliceFixtures.res +36 -0
- package/tests/components/inboundtranslationslice/InboundTranslationSliceFixtures.res.mjs +73 -0
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceCallbackTest.res +191 -0
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceCallbackTest.res.mjs +297 -0
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceFixtures.res +78 -0
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceFixtures.res.mjs +137 -0
- package/tests/components/querydb/QueryDbFixtures.res +39 -0
- package/tests/components/querydb/QueryDbFixtures.res.mjs +73 -0
- package/tests/components/querydb/QueryDbSubIdFixtures.res +44 -0
- package/tests/components/querydb/QueryDbSubIdFixtures.res.mjs +80 -0
- package/tests/components/querydb/QueryDbSubIdTest.res +104 -0
- package/tests/components/querydb/QueryDbSubIdTest.res.mjs +104 -0
- package/tests/components/querydb/QueryDbTest.res +81 -0
- package/tests/components/querydb/QueryDbTest.res.mjs +126 -0
- package/tests/components/readmodel/DcbReadModelE2EFixtures.res +215 -0
- package/tests/components/readmodel/DcbReadModelE2EFixtures.res.mjs +308 -0
- package/tests/components/readmodel/DcbReadModelE2ETest.res +45 -0
- package/tests/components/readmodel/DcbReadModelE2ETest.res.mjs +37 -0
- package/tests/components/readmodel/DcbReadModelTypoFailFastTest.res +88 -0
- package/tests/components/readmodel/DcbReadModelTypoFailFastTest.res.mjs +152 -0
- package/tests/components/readmodel/MixedSourceReadModelFixtures.res +181 -0
- package/tests/components/readmodel/MixedSourceReadModelFixtures.res.mjs +277 -0
- package/tests/components/readmodel/MixedSourceReadModelTest.res +61 -0
- package/tests/components/readmodel/MixedSourceReadModelTest.res.mjs +68 -0
- package/tests/components/readmodel/ReadModelFixtures.res +138 -0
- package/tests/components/readmodel/ReadModelFixtures.res.mjs +169 -0
- package/tests/components/readmodel/ReadModelTest.res +46 -0
- package/tests/components/readmodel/ReadModelTest.res.mjs +36 -0
- package/tests/components/scheduler/SchedulerFixtures.res +59 -0
- package/tests/components/scheduler/SchedulerFixtures.res.mjs +63 -0
- package/tests/components/scheduler/SchedulerTest.res +76 -0
- package/tests/components/scheduler/SchedulerTest.res.mjs +86 -0
- package/tests/components/sideeffecthandler/SideEffectHandlerFixtures.res +133 -0
- package/tests/components/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +149 -0
- package/tests/components/sideeffecthandler/SideEffectHandlerTest.res +39 -0
- package/tests/components/sideeffecthandler/SideEffectHandlerTest.res.mjs +28 -0
- package/tests/components/stateviewslice/StateViewSliceFixtures.res +117 -0
- package/tests/components/stateviewslice/StateViewSliceFixtures.res.mjs +188 -0
- package/tests/components/stateviewslice/StateViewSliceSubIdFixtures.res +117 -0
- package/tests/components/stateviewslice/StateViewSliceSubIdFixtures.res.mjs +183 -0
- package/tests/components/stateviewslice/StateViewSliceSubIdTest.res +78 -0
- package/tests/components/stateviewslice/StateViewSliceSubIdTest.res.mjs +107 -0
- package/tests/components/stateviewslice/StateViewSliceTest.res +59 -0
- package/tests/components/stateviewslice/StateViewSliceTest.res.mjs +72 -0
- package/tests/components/task/TaskFixtures.res +87 -0
- package/tests/components/task/TaskFixtures.res.mjs +82 -0
- package/tests/components/task/TaskTest.res +98 -0
- package/tests/components/task/TaskTest.res.mjs +46 -0
- package/tests/plugin/PluginBehavior_GWT.res +146 -0
- package/tests/plugin/PluginBehavior_GWT.res.mjs +281 -0
- package/tests/plugin/Plugin_Fixtures.res +61 -0
- package/tests/plugin/Plugin_Fixtures.res.mjs +105 -0
- package/tests/plugin/PluginsProjection_GWT.res +95 -0
- package/tests/plugin/PluginsProjection_GWT.res.mjs +120 -0
- package/tests/plugin/UIFragmentRegistryProjection_GWT.res +72 -0
- package/tests/plugin/UIFragmentRegistryProjection_GWT.res.mjs +117 -0
- package/tests/setup/sqliteGlobal.cjs +12 -0
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
|
+
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
6
|
+
import * as TestRunner$ReventlessLocal from "../../src/test/TestRunner.res.mjs";
|
|
7
|
+
import * as StateAnnotations$Reventless from "@reventlessdev/reventless-spec/src/components/StateAnnotations.res.mjs";
|
|
8
|
+
import * as GraphQL_Server$ReventlessLocal from "../../src/adapter/GraphQL_Server.res.mjs";
|
|
9
|
+
import * as GraphQL_Stitcher$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/GraphQL_Stitcher.res.mjs";
|
|
10
|
+
import * as GraphQL_SchemaInspector$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/GraphQL_SchemaInspector.res.mjs";
|
|
11
|
+
import * as GraphQL_FragmentGenerator$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/GraphQL_FragmentGenerator.res.mjs";
|
|
12
|
+
|
|
13
|
+
TestRunner$ReventlessLocal.setup();
|
|
14
|
+
|
|
15
|
+
let testStateSchema = S.schema(s => ({
|
|
16
|
+
id: s.m(DcbTag$Reventless.string),
|
|
17
|
+
name: s.m(S.string),
|
|
18
|
+
price: s.m(S.float),
|
|
19
|
+
active: s.m(S.bool)
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
let svStateSchema = S.schema(s => ({
|
|
23
|
+
productId: s.m(DcbTag$Reventless.string),
|
|
24
|
+
name: s.m(S.string),
|
|
25
|
+
price: s.m(S.float)
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
let addCommandSchema = S.schema(s => ({
|
|
29
|
+
productId: s.m(DcbTag$Reventless.string),
|
|
30
|
+
name: s.m(S.string)
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
let unionCommandSchema = S.union([
|
|
34
|
+
S.schema(s => ({
|
|
35
|
+
TAG: "Create",
|
|
36
|
+
itemId: s.m(DcbTag$Reventless.string),
|
|
37
|
+
name: s.m(S.string)
|
|
38
|
+
})),
|
|
39
|
+
S.schema(s => ({
|
|
40
|
+
TAG: "Rename",
|
|
41
|
+
itemId: s.m(DcbTag$Reventless.string),
|
|
42
|
+
newName: s.m(S.string)
|
|
43
|
+
}))
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
let plainStateSchema = S.schema(s => ({
|
|
47
|
+
productId: s.m(DcbTag$Reventless.string),
|
|
48
|
+
name: s.m(S.string)
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
let indexedStateSchema = S.schema(s => ({
|
|
52
|
+
productId: s.m(DcbTag$Reventless.string),
|
|
53
|
+
ownerId: s.m(S.string),
|
|
54
|
+
status: s.m(S.string),
|
|
55
|
+
name: s.m(S.string)
|
|
56
|
+
}));
|
|
57
|
+
|
|
58
|
+
let indexedStateSchemaWithAnnotations = S.Metadata.set(indexedStateSchema, StateAnnotations$Reventless.stateAnnotationsId, {
|
|
59
|
+
ids: ["productId"],
|
|
60
|
+
compositeIds: [],
|
|
61
|
+
subIds: [],
|
|
62
|
+
compositeSubIds: [],
|
|
63
|
+
indexes: [[
|
|
64
|
+
"ownerId",
|
|
65
|
+
"byOwner"
|
|
66
|
+
]],
|
|
67
|
+
hidden: [],
|
|
68
|
+
summary: [],
|
|
69
|
+
drillTargets: [],
|
|
70
|
+
drillTargetKeys: [],
|
|
71
|
+
collapsed: [],
|
|
72
|
+
scan: [],
|
|
73
|
+
scanSort: [],
|
|
74
|
+
status: undefined,
|
|
75
|
+
visibility: undefined
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
let orderedStateSchema = S.schema(s => ({
|
|
79
|
+
productId: s.m(DcbTag$Reventless.string),
|
|
80
|
+
createdAt: s.m(S.string),
|
|
81
|
+
name: s.m(S.string)
|
|
82
|
+
}));
|
|
83
|
+
|
|
84
|
+
let orderedStateSchemaWithAnnotations = S.Metadata.set(orderedStateSchema, StateAnnotations$Reventless.stateAnnotationsId, {
|
|
85
|
+
ids: ["productId"],
|
|
86
|
+
compositeIds: [],
|
|
87
|
+
subIds: ["createdAt"],
|
|
88
|
+
compositeSubIds: [],
|
|
89
|
+
indexes: [],
|
|
90
|
+
hidden: [],
|
|
91
|
+
summary: [],
|
|
92
|
+
drillTargets: [],
|
|
93
|
+
drillTargetKeys: [],
|
|
94
|
+
collapsed: [],
|
|
95
|
+
scan: [],
|
|
96
|
+
scanSort: [],
|
|
97
|
+
status: undefined,
|
|
98
|
+
visibility: undefined
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
let scanStateSchema = S.schema(s => ({
|
|
102
|
+
productId: s.m(DcbTag$Reventless.string),
|
|
103
|
+
status: s.m(S.string),
|
|
104
|
+
name: s.m(S.string),
|
|
105
|
+
description: s.m(S.string)
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
let scanStateSchemaWithAnnotations = S.Metadata.set(scanStateSchema, StateAnnotations$Reventless.stateAnnotationsId, {
|
|
109
|
+
ids: ["productId"],
|
|
110
|
+
compositeIds: [],
|
|
111
|
+
subIds: [],
|
|
112
|
+
compositeSubIds: [],
|
|
113
|
+
indexes: [],
|
|
114
|
+
hidden: [],
|
|
115
|
+
summary: [],
|
|
116
|
+
drillTargets: [],
|
|
117
|
+
drillTargetKeys: [],
|
|
118
|
+
collapsed: [],
|
|
119
|
+
scan: ["status"],
|
|
120
|
+
scanSort: ["name"],
|
|
121
|
+
status: undefined,
|
|
122
|
+
visibility: undefined
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
globalThis.describe("GraphQL_SchemaInspector", () => {
|
|
126
|
+
globalThis.describe("inspectScalar", () => {
|
|
127
|
+
globalThis.test("plain string derives to String", async () => {
|
|
128
|
+
globalThis.expect(GraphQL_SchemaInspector$ReventlessCore.inspectScalar(S.string)).toBe("String");
|
|
129
|
+
});
|
|
130
|
+
globalThis.test("tagged string derives to ID", async () => {
|
|
131
|
+
globalThis.expect(GraphQL_SchemaInspector$ReventlessCore.inspectScalar(DcbTag$Reventless.string)).toBe("ID");
|
|
132
|
+
});
|
|
133
|
+
globalThis.test("float derives to Float", async () => {
|
|
134
|
+
globalThis.expect(GraphQL_SchemaInspector$ReventlessCore.inspectScalar(S.float)).toBe("Float");
|
|
135
|
+
});
|
|
136
|
+
globalThis.test("bool derives to Boolean", async () => {
|
|
137
|
+
globalThis.expect(GraphQL_SchemaInspector$ReventlessCore.inspectScalar(S.bool)).toBe("Boolean");
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
globalThis.describe("inspectObjectType", () => {
|
|
141
|
+
globalThis.test("derives type definition from object schema", async () => {
|
|
142
|
+
let result = GraphQL_SchemaInspector$ReventlessCore.inspectObjectType("TestState", testStateSchema);
|
|
143
|
+
globalThis.expect(Stdlib_Option.isSome(result)).toBe(true);
|
|
144
|
+
let sdl = Stdlib_Option.getOrThrow(result, undefined);
|
|
145
|
+
globalThis.expect(sdl.includes("type TestState")).toBe(true);
|
|
146
|
+
globalThis.expect(sdl.includes("id: ID!")).toBe(true);
|
|
147
|
+
globalThis.expect(sdl.includes("name: String")).toBe(true);
|
|
148
|
+
globalThis.expect(sdl.includes("price: Float")).toBe(true);
|
|
149
|
+
globalThis.expect(sdl.includes("active: Boolean")).toBe(true);
|
|
150
|
+
});
|
|
151
|
+
globalThis.test("returns None for non-object schema", async () => {
|
|
152
|
+
let result = GraphQL_SchemaInspector$ReventlessCore.inspectObjectType("Foo", S.string);
|
|
153
|
+
globalThis.expect(Stdlib_Option.isNone(result)).toBe(true);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
globalThis.describe("inspectMutationFields", () => {
|
|
157
|
+
globalThis.test("derives fields from single-variant (DCB slice) command", async () => {
|
|
158
|
+
let fields = GraphQL_SchemaInspector$ReventlessCore.inspectMutationFields("Catalog_AddProduct", addCommandSchema);
|
|
159
|
+
globalThis.expect(fields.length).toBe(1);
|
|
160
|
+
let field = fields[0];
|
|
161
|
+
globalThis.expect(field.includes("Catalog_AddProduct")).toBe(true);
|
|
162
|
+
globalThis.expect(field.includes("productId: ID!")).toBe(true);
|
|
163
|
+
globalThis.expect(field.includes("name: String")).toBe(true);
|
|
164
|
+
});
|
|
165
|
+
globalThis.test("derives fields from union (aggregate) command", async () => {
|
|
166
|
+
let fields = GraphQL_SchemaInspector$ReventlessCore.inspectMutationFields("App_Item", unionCommandSchema);
|
|
167
|
+
globalThis.expect(fields.length).toBe(2);
|
|
168
|
+
let createField = fields[0];
|
|
169
|
+
globalThis.expect(createField.includes("App_Item_Create")).toBe(true);
|
|
170
|
+
globalThis.expect(createField.includes("itemId: ID!")).toBe(true);
|
|
171
|
+
let renameField = fields[1];
|
|
172
|
+
globalThis.expect(renameField.includes("App_Item_Rename")).toBe(true);
|
|
173
|
+
globalThis.expect(renameField.includes("newName: String")).toBe(true);
|
|
174
|
+
});
|
|
175
|
+
globalThis.test("returns empty for non-object/non-union schema", async () => {
|
|
176
|
+
let fields = GraphQL_SchemaInspector$ReventlessCore.inspectMutationFields("Foo", S.string);
|
|
177
|
+
globalThis.expect(fields.length).toBe(0);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
globalThis.describe("inspectQueryFields", () => {
|
|
181
|
+
globalThis.test("derives type def and query fields from state schema", async () => {
|
|
182
|
+
let result = GraphQL_SchemaInspector$ReventlessCore.inspectQueryFields("Catalog_Product", "CatalogProduct", testStateSchema);
|
|
183
|
+
globalThis.expect(Stdlib_Option.isSome(result.typeDef)).toBe(true);
|
|
184
|
+
let typeDef = Stdlib_Option.getOrThrow(result.typeDef, undefined);
|
|
185
|
+
globalThis.expect(typeDef.includes("type CatalogProduct")).toBe(true);
|
|
186
|
+
globalThis.expect(result.singleQuery.includes("Catalog_Product(id: ID!)")).toBe(true);
|
|
187
|
+
globalThis.expect(result.singleQuery.includes("CatalogProduct")).toBe(true);
|
|
188
|
+
globalThis.expect(Stdlib_Option.isSome(result.listQuery)).toBe(true);
|
|
189
|
+
let listQ = Stdlib_Option.getOrThrow(result.listQuery, undefined);
|
|
190
|
+
globalThis.expect(listQ.includes("Catalog_Products")).toBe(true);
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
globalThis.describe("includeIdParam — ReadModel vs StateViewSlice", () => {
|
|
194
|
+
globalThis.test("ReadModel fragment: query has (id: ID!) and type has injected id: ID!", async () => {
|
|
195
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
196
|
+
singleFieldName: "RM_Product",
|
|
197
|
+
listFieldName: "RM_Products",
|
|
198
|
+
returnTypeName: "RMProduct",
|
|
199
|
+
stateSchema: testStateSchema,
|
|
200
|
+
authorization: undefined,
|
|
201
|
+
includeIdParam: true
|
|
202
|
+
}]);
|
|
203
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
204
|
+
let sdl = inspection.sdlPreview;
|
|
205
|
+
globalThis.expect(sdl.includes("RM_Product(id: ID!): RMProduct")).toBe(true);
|
|
206
|
+
globalThis.expect(sdl.includes("type RMProduct")).toBe(true);
|
|
207
|
+
let typeLines = sdl.split("\n");
|
|
208
|
+
let idFieldInType = typeLines.some(line => {
|
|
209
|
+
if (line.trim() === "id: ID!") {
|
|
210
|
+
return !line.includes("(");
|
|
211
|
+
} else {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
globalThis.expect(idFieldInType).toBe(true);
|
|
216
|
+
});
|
|
217
|
+
globalThis.test("StateViewSlice fragment: query has no (id: ID!) and type has no injected id", async () => {
|
|
218
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
219
|
+
singleFieldName: "SV_Item",
|
|
220
|
+
listFieldName: "SV_Items",
|
|
221
|
+
returnTypeName: "SVItem",
|
|
222
|
+
stateSchema: svStateSchema,
|
|
223
|
+
authorization: undefined,
|
|
224
|
+
includeIdParam: false
|
|
225
|
+
}]);
|
|
226
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
227
|
+
let sdl = inspection.sdlPreview;
|
|
228
|
+
globalThis.expect(sdl.includes("SV_Item: SVItem")).toBe(true);
|
|
229
|
+
globalThis.expect(sdl.includes("SV_Item(id: ID!)")).toBe(false);
|
|
230
|
+
globalThis.expect(sdl.includes("type SVItem")).toBe(true);
|
|
231
|
+
globalThis.expect(sdl.includes("productId: ID!")).toBe(true);
|
|
232
|
+
let typeSection = Stdlib_Option.getOr(sdl.split("type SVItem")[1], "");
|
|
233
|
+
let typeEnd = typeSection.indexOf("}");
|
|
234
|
+
let typeEnd$1 = typeEnd >= 0 ? typeEnd : typeSection.length;
|
|
235
|
+
let typeBody = typeSection.slice(0, typeEnd$1);
|
|
236
|
+
let hasInjectedId = typeBody.split("\n").some(line => line.trim() === "id: ID!");
|
|
237
|
+
globalThis.expect(hasInjectedId).toBe(false);
|
|
238
|
+
});
|
|
239
|
+
globalThis.test("default includeIdParam (omitted) behaves like ReadModel", async () => {
|
|
240
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
241
|
+
singleFieldName: "Default_Thing",
|
|
242
|
+
listFieldName: "Default_Things",
|
|
243
|
+
returnTypeName: "DefaultThing",
|
|
244
|
+
stateSchema: testStateSchema,
|
|
245
|
+
authorization: undefined
|
|
246
|
+
}]);
|
|
247
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
248
|
+
let sdl = inspection.sdlPreview;
|
|
249
|
+
globalThis.expect(sdl.includes("Default_Thing(id: ID!): DefaultThing")).toBe(true);
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
globalThis.describe("Relay compliance", () => {
|
|
253
|
+
globalThis.test("entity type includes 'implements Node' when includeIdParam is true", async () => {
|
|
254
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
255
|
+
singleFieldName: "Relay_Product",
|
|
256
|
+
listFieldName: "Relay_Products",
|
|
257
|
+
returnTypeName: "RelayProduct",
|
|
258
|
+
stateSchema: testStateSchema,
|
|
259
|
+
authorization: undefined,
|
|
260
|
+
includeIdParam: true
|
|
261
|
+
}]);
|
|
262
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
263
|
+
let sdl = inspection.sdlPreview;
|
|
264
|
+
globalThis.expect(sdl.includes("type RelayProduct implements Node")).toBe(true);
|
|
265
|
+
globalThis.expect(sdl.includes("id: ID!")).toBe(true);
|
|
266
|
+
});
|
|
267
|
+
globalThis.test("non-entity type does not include 'implements Node'", async () => {
|
|
268
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
269
|
+
singleFieldName: "Relay_View",
|
|
270
|
+
listFieldName: "Relay_Views",
|
|
271
|
+
returnTypeName: "RelayView",
|
|
272
|
+
stateSchema: svStateSchema,
|
|
273
|
+
authorization: undefined,
|
|
274
|
+
includeIdParam: false
|
|
275
|
+
}]);
|
|
276
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
277
|
+
let sdl = inspection.sdlPreview;
|
|
278
|
+
globalThis.expect(sdl.includes("type RelayView implements Node")).toBe(false);
|
|
279
|
+
globalThis.expect(sdl.includes("type RelayView {")).toBe(true);
|
|
280
|
+
});
|
|
281
|
+
globalThis.test("connectionSpec generates Edge and Connection types instead of plural wrapper", async () => {
|
|
282
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
283
|
+
singleFieldName: "Relay_Product",
|
|
284
|
+
listFieldName: "Relay_Products",
|
|
285
|
+
returnTypeName: "RelayProduct",
|
|
286
|
+
stateSchema: testStateSchema,
|
|
287
|
+
authorization: undefined,
|
|
288
|
+
includeIdParam: true,
|
|
289
|
+
connectionSpec: true
|
|
290
|
+
}]);
|
|
291
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
292
|
+
let sdl = inspection.sdlPreview;
|
|
293
|
+
globalThis.expect(sdl.includes("type RelayProductEdge")).toBe(true);
|
|
294
|
+
globalThis.expect(sdl.includes("node: RelayProduct!")).toBe(true);
|
|
295
|
+
globalThis.expect(sdl.includes("cursor: String!")).toBe(true);
|
|
296
|
+
globalThis.expect(sdl.includes("type RelayProductConnection")).toBe(true);
|
|
297
|
+
globalThis.expect(sdl.includes("edges: [RelayProductEdge!]!")).toBe(true);
|
|
298
|
+
globalThis.expect(sdl.includes("pageInfo: PageInfo!")).toBe(true);
|
|
299
|
+
globalThis.expect(sdl.includes("totalCount")).toBe(false);
|
|
300
|
+
globalThis.expect(sdl.includes("Relay_Products(filter: RelayProductFilter, first: Int, after: String, last: Int, before: String): RelayProductConnection!")).toBe(true);
|
|
301
|
+
globalThis.expect(sdl.includes("input RelayProductFilter")).toBe(true);
|
|
302
|
+
globalThis.expect(sdl.includes("search: String")).toBe(true);
|
|
303
|
+
globalThis.expect(sdl.includes("searchPrefix: String")).toBe(true);
|
|
304
|
+
globalThis.expect(sdl.includes("ids: [ID!]")).toBe(true);
|
|
305
|
+
globalThis.expect(sdl.includes("items: [RelayProduct!]!")).toBe(false);
|
|
306
|
+
globalThis.expect(sdl.includes("nextToken:")).toBe(false);
|
|
307
|
+
});
|
|
308
|
+
globalThis.test("subIdField generates ItemsFilter (distinct from connection Filter)", async () => {
|
|
309
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
310
|
+
singleFieldName: "Items_Product",
|
|
311
|
+
listFieldName: "Items_Products",
|
|
312
|
+
returnTypeName: "ItemsProduct",
|
|
313
|
+
stateSchema: testStateSchema,
|
|
314
|
+
authorization: undefined,
|
|
315
|
+
includeIdParam: true,
|
|
316
|
+
connectionSpec: true,
|
|
317
|
+
subIdField: "sku"
|
|
318
|
+
}]);
|
|
319
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
320
|
+
let sdl = inspection.sdlPreview;
|
|
321
|
+
globalThis.expect(sdl.includes("input ItemsProductFilter")).toBe(true);
|
|
322
|
+
globalThis.expect(sdl.includes("input ItemsProductItemsFilter")).toBe(true);
|
|
323
|
+
globalThis.expect(sdl.includes("Items_ProductItems(id: ID!, filter: ItemsProductItemsFilter,")).toBe(true);
|
|
324
|
+
});
|
|
325
|
+
globalThis.test("explicit connectionSpec=false generates legacy plural wrapper (opt-out)", async () => {
|
|
326
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
327
|
+
singleFieldName: "Legacy_Product",
|
|
328
|
+
listFieldName: "Legacy_Products",
|
|
329
|
+
returnTypeName: "LegacyProduct",
|
|
330
|
+
stateSchema: testStateSchema,
|
|
331
|
+
authorization: undefined,
|
|
332
|
+
includeIdParam: true,
|
|
333
|
+
connectionSpec: false
|
|
334
|
+
}]);
|
|
335
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
336
|
+
let sdl = inspection.sdlPreview;
|
|
337
|
+
globalThis.expect(sdl.includes("items: [LegacyProduct!]!")).toBe(true);
|
|
338
|
+
globalThis.expect(sdl.includes("nextToken: String")).toBe(true);
|
|
339
|
+
globalThis.expect(sdl.includes("LegacyProductEdge")).toBe(false);
|
|
340
|
+
globalThis.expect(sdl.includes("LegacyProductConnection")).toBe(false);
|
|
341
|
+
});
|
|
342
|
+
globalThis.test("stitcher injects Node interface and node query", async () => {
|
|
343
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
344
|
+
singleFieldName: "Stitch_Product",
|
|
345
|
+
listFieldName: "Stitch_Products",
|
|
346
|
+
returnTypeName: "StitchProduct",
|
|
347
|
+
stateSchema: testStateSchema,
|
|
348
|
+
authorization: undefined,
|
|
349
|
+
includeIdParam: true
|
|
350
|
+
}]);
|
|
351
|
+
let sdl = GraphQL_Stitcher$ReventlessCore.stitch(fragment, []);
|
|
352
|
+
globalThis.expect(sdl.includes("interface Node")).toBe(true);
|
|
353
|
+
globalThis.expect(sdl.includes("node(id: ID!): Node")).toBe(true);
|
|
354
|
+
globalThis.expect(sdl.includes("type PageInfo")).toBe(true);
|
|
355
|
+
globalThis.expect(sdl.includes("hasNextPage: Boolean!")).toBe(true);
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
globalThis.describe("inspectFragment", () => {
|
|
359
|
+
globalThis.test("decodes and previews a fragment", async () => {
|
|
360
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([{
|
|
361
|
+
fieldNames: ["Test_Add"],
|
|
362
|
+
commandSchema: addCommandSchema
|
|
363
|
+
}], [{
|
|
364
|
+
singleFieldName: "Test_State",
|
|
365
|
+
listFieldName: "Test_States",
|
|
366
|
+
returnTypeName: "TestState",
|
|
367
|
+
stateSchema: testStateSchema,
|
|
368
|
+
authorization: undefined
|
|
369
|
+
}]);
|
|
370
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
371
|
+
globalThis.expect(inspection.types.length).toBe(8);
|
|
372
|
+
globalThis.expect(inspection.mutations.length).toBe(1);
|
|
373
|
+
globalThis.expect(inspection.queries.length).toBe(3);
|
|
374
|
+
globalThis.expect(inspection.sdlPreview.includes("type TestState")).toBe(true);
|
|
375
|
+
globalThis.expect(inspection.sdlPreview.includes("type TestStateEdge")).toBe(true);
|
|
376
|
+
globalThis.expect(inspection.sdlPreview.includes("type TestStateConnection")).toBe(true);
|
|
377
|
+
globalThis.expect(inspection.sdlPreview.includes("input TestStateFilter")).toBe(true);
|
|
378
|
+
globalThis.expect(inspection.sdlPreview.includes("edges: [TestStateEdge!]!")).toBe(true);
|
|
379
|
+
globalThis.expect(inspection.sdlPreview.includes("Test_Add")).toBe(true);
|
|
380
|
+
globalThis.expect(inspection.sdlPreview.includes("Test_State")).toBe(true);
|
|
381
|
+
globalThis.expect(inspection.sdlPreview.includes("TestStateConnection!")).toBe(true);
|
|
382
|
+
globalThis.expect(inspection.sdlPreview.includes("union CommandResult")).toBe(true);
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
globalThis.describe("inspectPluginEntries", () => {
|
|
386
|
+
globalThis.test("formats mutation and query entries", async () => {
|
|
387
|
+
let summary = GraphQL_SchemaInspector$ReventlessCore.inspectPluginEntries([{
|
|
388
|
+
fieldNames: [
|
|
389
|
+
"Plugin_Add",
|
|
390
|
+
"Plugin_Remove"
|
|
391
|
+
],
|
|
392
|
+
commandSchema: unionCommandSchema
|
|
393
|
+
}], [{
|
|
394
|
+
singleFieldName: "Plugin_Item",
|
|
395
|
+
listFieldName: "Plugin_Items",
|
|
396
|
+
returnTypeName: "PluginItem",
|
|
397
|
+
stateSchema: testStateSchema,
|
|
398
|
+
authorization: undefined
|
|
399
|
+
}]);
|
|
400
|
+
globalThis.expect(summary.includes("Mutations (2)")).toBe(true);
|
|
401
|
+
globalThis.expect(summary.includes("Plugin_Add")).toBe(true);
|
|
402
|
+
globalThis.expect(summary.includes("Plugin_Remove")).toBe(true);
|
|
403
|
+
globalThis.expect(summary.includes("Queries (1)")).toBe(true);
|
|
404
|
+
globalThis.expect(summary.includes("Plugin_Item(id) -> PluginItem")).toBe(true);
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
globalThis.describe("server capability — auto-derived Filter / OrderBy", () => {
|
|
408
|
+
globalThis.test("read model with no annotations emits the unchanged search-only Filter", async () => {
|
|
409
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
410
|
+
singleFieldName: "Plain_View",
|
|
411
|
+
listFieldName: "Plain_Views",
|
|
412
|
+
returnTypeName: "PlainView",
|
|
413
|
+
stateSchema: plainStateSchema,
|
|
414
|
+
authorization: undefined,
|
|
415
|
+
includeIdParam: false,
|
|
416
|
+
connectionSpec: true
|
|
417
|
+
}]);
|
|
418
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
419
|
+
let sdl = inspection.sdlPreview;
|
|
420
|
+
globalThis.expect(sdl.includes("input PlainViewFilter")).toBe(true);
|
|
421
|
+
globalThis.expect(sdl.includes("search: String")).toBe(true);
|
|
422
|
+
globalThis.expect(sdl.includes("searchPrefix: String")).toBe(true);
|
|
423
|
+
globalThis.expect(sdl.includes("ids: [ID!]")).toBe(true);
|
|
424
|
+
globalThis.expect(sdl.includes("Eq:")).toBe(false);
|
|
425
|
+
globalThis.expect(sdl.includes("PlainViewOrderBy")).toBe(false);
|
|
426
|
+
globalThis.expect(sdl.includes("PlainViewOrderField")).toBe(false);
|
|
427
|
+
globalThis.expect(sdl.includes("orderBy:")).toBe(false);
|
|
428
|
+
});
|
|
429
|
+
globalThis.test("read model with @id + @index emits Eq filters + OrderBy + orderBy arg", async () => {
|
|
430
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
431
|
+
singleFieldName: "Indexed_Product",
|
|
432
|
+
listFieldName: "Indexed_Products",
|
|
433
|
+
returnTypeName: "IndexedProduct",
|
|
434
|
+
stateSchema: indexedStateSchemaWithAnnotations,
|
|
435
|
+
authorization: undefined,
|
|
436
|
+
includeIdParam: true,
|
|
437
|
+
connectionSpec: true
|
|
438
|
+
}]);
|
|
439
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
440
|
+
let sdl = inspection.sdlPreview;
|
|
441
|
+
globalThis.expect(sdl.includes("input IndexedProductFilter")).toBe(true);
|
|
442
|
+
globalThis.expect(sdl.includes("productIdEq: ID")).toBe(true);
|
|
443
|
+
globalThis.expect(sdl.includes("ownerIdEq: ID")).toBe(true);
|
|
444
|
+
globalThis.expect(sdl.includes("enum IndexedProductOrderField")).toBe(true);
|
|
445
|
+
globalThis.expect(sdl.includes("input IndexedProductOrderBy")).toBe(true);
|
|
446
|
+
globalThis.expect(sdl.includes("direction: SortOrder!")).toBe(true);
|
|
447
|
+
globalThis.expect(sdl.includes("orderBy: IndexedProductOrderBy")).toBe(true);
|
|
448
|
+
});
|
|
449
|
+
globalThis.test("read model with @scan / @scanSort folds opt-in fields into Filter / OrderBy", async () => {
|
|
450
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
451
|
+
singleFieldName: "Scan_Item",
|
|
452
|
+
listFieldName: "Scan_Items",
|
|
453
|
+
returnTypeName: "ScanItem",
|
|
454
|
+
stateSchema: scanStateSchemaWithAnnotations,
|
|
455
|
+
authorization: undefined,
|
|
456
|
+
includeIdParam: true,
|
|
457
|
+
connectionSpec: true
|
|
458
|
+
}]);
|
|
459
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
460
|
+
let sdl = inspection.sdlPreview;
|
|
461
|
+
globalThis.expect(sdl.includes("statusEq: String")).toBe(true);
|
|
462
|
+
globalThis.expect(sdl.includes("enum ScanItemOrderField")).toBe(true);
|
|
463
|
+
globalThis.expect(sdl.includes("name")).toBe(true);
|
|
464
|
+
globalThis.expect(sdl.includes("orderBy: ScanItemOrderBy")).toBe(true);
|
|
465
|
+
globalThis.expect(sdl.includes("nameEq:")).toBe(false);
|
|
466
|
+
globalThis.expect(sdl.includes("statusFrom:")).toBe(false);
|
|
467
|
+
globalThis.expect(sdl.includes("statusTo:")).toBe(false);
|
|
468
|
+
});
|
|
469
|
+
globalThis.test("validateScanSortAlignment warns when @scanSort field is not a sort key", async () => {
|
|
470
|
+
let warnings = GraphQL_FragmentGenerator$ReventlessCore.validateScanSortAlignment(scanStateSchemaWithAnnotations, "ScanItem", []);
|
|
471
|
+
globalThis.expect(warnings.length).toBe(1);
|
|
472
|
+
let msg = warnings[0];
|
|
473
|
+
globalThis.expect(msg.includes("ScanItem")).toBe(true);
|
|
474
|
+
globalThis.expect(msg.includes("name")).toBe(true);
|
|
475
|
+
globalThis.expect(msg.includes("per-page")).toBe(true);
|
|
476
|
+
});
|
|
477
|
+
globalThis.test("validateScanSortAlignment is silent when @scanSort field aligns with a known sort key", async () => {
|
|
478
|
+
let warnings = GraphQL_FragmentGenerator$ReventlessCore.validateScanSortAlignment(scanStateSchemaWithAnnotations, "ScanItem", ["name"]);
|
|
479
|
+
globalThis.expect(warnings).toEqual([]);
|
|
480
|
+
});
|
|
481
|
+
globalThis.test("validateScanSortAlignment is a no-op when there are no @scanSort fields", async () => {
|
|
482
|
+
let warnings = GraphQL_FragmentGenerator$ReventlessCore.validateScanSortAlignment(indexedStateSchemaWithAnnotations, "IndexedProduct", []);
|
|
483
|
+
globalThis.expect(warnings).toEqual([]);
|
|
484
|
+
});
|
|
485
|
+
globalThis.test("read model with @subId emits range filters + OrderBy on the sort key", async () => {
|
|
486
|
+
let fragment = GraphQL_FragmentGenerator$ReventlessCore.generate([], [{
|
|
487
|
+
singleFieldName: "Ordered_Item",
|
|
488
|
+
listFieldName: "Ordered_Items",
|
|
489
|
+
returnTypeName: "OrderedItem",
|
|
490
|
+
stateSchema: orderedStateSchemaWithAnnotations,
|
|
491
|
+
authorization: undefined,
|
|
492
|
+
includeIdParam: true,
|
|
493
|
+
connectionSpec: true
|
|
494
|
+
}]);
|
|
495
|
+
let inspection = GraphQL_SchemaInspector$ReventlessCore.inspectFragment(fragment);
|
|
496
|
+
let sdl = inspection.sdlPreview;
|
|
497
|
+
globalThis.expect(sdl.includes("createdAtEq: String")).toBe(true);
|
|
498
|
+
globalThis.expect(sdl.includes("createdAtFrom: String")).toBe(true);
|
|
499
|
+
globalThis.expect(sdl.includes("createdAtTo: String")).toBe(true);
|
|
500
|
+
globalThis.expect(sdl.includes("enum OrderedItemOrderField")).toBe(true);
|
|
501
|
+
globalThis.expect(sdl.includes("orderBy: OrderedItemOrderBy")).toBe(true);
|
|
502
|
+
});
|
|
503
|
+
});
|
|
504
|
+
globalThis.describe("GraphQL_Server diagnostics", () => {
|
|
505
|
+
globalThis.test("diagnostics detects resolver without SDL field", async () => {
|
|
506
|
+
GraphQL_Server$ReventlessLocal.reset();
|
|
507
|
+
let resolvers = {};
|
|
508
|
+
resolvers["orphanResolver"] = async (_root, _args, _ctx) => "ok";
|
|
509
|
+
GraphQL_Server$ReventlessLocal.registerMutations([], resolvers);
|
|
510
|
+
let d = GraphQL_Server$ReventlessLocal.diagnostics();
|
|
511
|
+
globalThis.expect(d.resolverMutationCount).toBe(1);
|
|
512
|
+
globalThis.expect(d.sdlMutationCount).toBe(0);
|
|
513
|
+
globalThis.expect(d.mismatches.length).toBe(1);
|
|
514
|
+
globalThis.expect(d.mismatches[0].includes("resolver but no SDL field")).toBe(true);
|
|
515
|
+
return GraphQL_Server$ReventlessLocal.reset();
|
|
516
|
+
});
|
|
517
|
+
globalThis.test("diagnostics detects SDL field without resolver", async () => {
|
|
518
|
+
GraphQL_Server$ReventlessLocal.reset();
|
|
519
|
+
GraphQL_Server$ReventlessLocal.registerQueries([" orphanField(id: ID!): String"], {});
|
|
520
|
+
let d = GraphQL_Server$ReventlessLocal.diagnostics();
|
|
521
|
+
globalThis.expect(d.sdlQueryCount).toBe(1);
|
|
522
|
+
globalThis.expect(d.resolverQueryCount).toBe(0);
|
|
523
|
+
globalThis.expect(d.mismatches.length).toBe(1);
|
|
524
|
+
globalThis.expect(d.mismatches[0].includes("SDL field but no resolver")).toBe(true);
|
|
525
|
+
return GraphQL_Server$ReventlessLocal.reset();
|
|
526
|
+
});
|
|
527
|
+
globalThis.test("diagnostics reports no mismatches when fields and resolvers match", async () => {
|
|
528
|
+
GraphQL_Server$ReventlessLocal.reset();
|
|
529
|
+
let resolvers = {};
|
|
530
|
+
resolvers["myQuery"] = async (_root, _args, _ctx) => "ok";
|
|
531
|
+
GraphQL_Server$ReventlessLocal.registerQueries([" myQuery(id: ID!): String"], resolvers);
|
|
532
|
+
let d = GraphQL_Server$ReventlessLocal.diagnostics();
|
|
533
|
+
globalThis.expect(d.mismatches.length).toBe(0);
|
|
534
|
+
globalThis.expect(d.sdlQueryCount).toBe(1);
|
|
535
|
+
globalThis.expect(d.resolverQueryCount).toBe(1);
|
|
536
|
+
return GraphQL_Server$ReventlessLocal.reset();
|
|
537
|
+
});
|
|
538
|
+
globalThis.test("getFullSdl returns None before start", async () => {
|
|
539
|
+
GraphQL_Server$ReventlessLocal.reset();
|
|
540
|
+
globalThis.expect(Stdlib_Option.isNone(GraphQL_Server$ReventlessLocal.getFullSdl())).toBe(true);
|
|
541
|
+
});
|
|
542
|
+
globalThis.test("getRegisteredSdl returns Query/Mutation SDL", async () => {
|
|
543
|
+
GraphQL_Server$ReventlessLocal.reset();
|
|
544
|
+
GraphQL_Server$ReventlessLocal.registerQueries([" hello: String"], {});
|
|
545
|
+
let sdl = GraphQL_Server$ReventlessLocal.getRegisteredSdl();
|
|
546
|
+
globalThis.expect(sdl.includes("hello: String")).toBe(true);
|
|
547
|
+
globalThis.expect(sdl.includes("type Query")).toBe(true);
|
|
548
|
+
return GraphQL_Server$ReventlessLocal.reset();
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
let stringSchema = S.string;
|
|
554
|
+
|
|
555
|
+
let taggedSchema = DcbTag$Reventless.string;
|
|
556
|
+
|
|
557
|
+
let numberSchema = S.float;
|
|
558
|
+
|
|
559
|
+
let boolSchema = S.bool;
|
|
560
|
+
|
|
561
|
+
export {
|
|
562
|
+
stringSchema,
|
|
563
|
+
taggedSchema,
|
|
564
|
+
numberSchema,
|
|
565
|
+
boolSchema,
|
|
566
|
+
testStateSchema,
|
|
567
|
+
svStateSchema,
|
|
568
|
+
addCommandSchema,
|
|
569
|
+
unionCommandSchema,
|
|
570
|
+
plainStateSchema,
|
|
571
|
+
indexedStateSchema,
|
|
572
|
+
indexedStateSchemaWithAnnotations,
|
|
573
|
+
orderedStateSchema,
|
|
574
|
+
orderedStateSchemaWithAnnotations,
|
|
575
|
+
scanStateSchema,
|
|
576
|
+
scanStateSchemaWithAnnotations,
|
|
577
|
+
}
|
|
578
|
+
/* Not a pure module */
|