@reventlessdev/reventless-core 3.0.0-alpha.238 → 3.0.0-alpha.240

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.
Files changed (178) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/package.json +12 -12
  3. package/src/Message.res +11 -11
  4. package/src/Message.res.mjs +15 -14
  5. package/src/Projection.res +2 -2
  6. package/src/Projection.res.mjs +5 -4
  7. package/src/adapter/Monitoring/Monitoring.res +24 -2
  8. package/src/adapter/Monitoring/Monitoring.res.mjs +3 -3
  9. package/src/admin/Platform_AdminApi.res.mjs +3 -3
  10. package/src/admin/Platform_Admin_Structure.res +33 -112
  11. package/src/admin/Platform_Admin_Structure.res.mjs +8 -138
  12. package/src/admin/Platform_ComponentDefinitionsApi.res +2 -1
  13. package/src/admin/Platform_ComponentDefinitionsApi.res.mjs +5 -1
  14. package/src/admin/UiFragmentRegistry/StateChangeSlice/UiFragmentRegistry.res.mjs +12 -12
  15. package/src/admin/UiFragmentRegistry/StateViewSlice/UiFragments.res.mjs +14 -14
  16. package/src/components/Aggregate/Aggregate_Callback.res +2 -2
  17. package/src/components/Aggregate/Aggregate_Callback.res.mjs +4 -4
  18. package/src/components/Api/ApiAllowedStatesHelpers.res.mjs +3 -3
  19. package/src/components/Api/ApiNoApiHelpers.res.mjs +5 -5
  20. package/src/components/Api/ApiTargetStateHelpers.res.mjs +3 -3
  21. package/src/components/Api/GraphQL_FragmentGenerator.res +140 -24
  22. package/src/components/Api/GraphQL_FragmentGenerator.res.mjs +48 -21
  23. package/src/components/Api/GraphQL_SchemaInspector.res +1 -1
  24. package/src/components/Api/GraphQL_SchemaInspector.res.mjs +1 -1
  25. package/src/components/Api/MCP_SchemaGenerator.res +1 -1
  26. package/src/components/Api/MCP_SchemaGenerator.res.mjs +1 -1
  27. package/src/components/Api/SchemaType.res +6 -10
  28. package/src/components/Api/SchemaType.res.mjs +4 -4
  29. package/src/components/Api/StorageRefFields.res +1 -1
  30. package/src/components/Api/StorageRefFields.res.mjs +1 -1
  31. package/src/components/Api/SuryToJsonSchema.res +19 -0
  32. package/src/components/Api/SuryToJsonSchema.res.mjs +10 -5
  33. package/src/components/AutomationSlice/AutomationSlice_Callback.res +3 -4
  34. package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +22 -23
  35. package/src/components/CommandTopic/CommandTopic_Callback.res +1 -2
  36. package/src/components/CommandTopic/CommandTopic_Callback.res.mjs +3 -4
  37. package/src/components/CommandTopic/CommandTopic_Helpers.res +1 -1
  38. package/src/components/CommandTopic/CommandTopic_Helpers.res.mjs +3 -3
  39. package/src/components/Counter/Counter.res.mjs +2 -2
  40. package/src/components/Counter/Counter_Callback.res.mjs +4 -4
  41. package/src/components/Counter/Counter_Operations.res.mjs +4 -4
  42. package/src/components/Dcb/Dcb_Builder.res +1 -1
  43. package/src/components/Dcb/Dcb_Builder.res.mjs +8 -6
  44. package/src/components/DcbEventLog/DcbEventLog_Builder.res.mjs +4 -3
  45. package/src/components/EventCollector/EventCollector_Builder.res +1 -1
  46. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +1 -2
  47. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +11 -12
  48. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +3 -4
  49. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +24 -25
  50. package/src/components/SideEffectHandler/SideEffectHandler_Callback.res +1 -1
  51. package/src/components/SideEffectHandler/SideEffectHandler_Callback.res.mjs +3 -3
  52. package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +2 -2
  53. package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +4 -4
  54. package/src/components/StateViewSlice/StateViewSlice_Builder.res +1 -1
  55. package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +3 -3
  56. package/src/plugin/api/PluginBaseFragment.res +12 -29
  57. package/src/plugin/api/PluginBaseFragment.res.mjs +3 -22
  58. package/src/plugin/component/Capability_Inference.res +118 -1
  59. package/src/plugin/component/Capability_Inference.res.mjs +128 -1
  60. package/src/plugin/component/Plugin_Builder.res +9 -2
  61. package/src/plugin/component/Plugin_Builder.res.mjs +5 -2
  62. package/src/plugin/component/Plugin_Helpers.res +11 -11
  63. package/src/plugin/component/Plugin_Helpers.res.mjs +11 -10
  64. package/src/plugin/component/Plugin_Structure.res +458 -296
  65. package/src/plugin/component/Plugin_Structure.res.mjs +259 -182
  66. package/src/plugin/component/Plugin_SubscriptionSchema.res +1 -1
  67. package/src/plugin/component/Plugin_SubscriptionSchema.res.mjs +1 -1
  68. package/src/plugin/component/SchemaWalker.res +11 -11
  69. package/src/plugin/component/SchemaWalker.res.mjs +8 -9
  70. package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +15 -15
  71. package/src/plugin/lifecycle/PluginBehavior.res.mjs +55 -55
  72. package/src/plugin/lifecycle/PluginSpec.res +22 -7
  73. package/src/plugin/lifecycle/PluginSpec.res.mjs +91 -36
  74. package/src/plugin/lifecycle/PluginsReadModelSpec.res +36 -9
  75. package/src/plugin/lifecycle/PluginsReadModelSpec.res.mjs +33 -22
  76. package/src/util/Interstack.res +3 -3
  77. package/src/util/LogFormat.res +1 -2
  78. package/src/util/LogFormat.res.mjs +2 -2
  79. package/tests/IdentityTest.res +6 -7
  80. package/tests/IdentityTest.res.mjs +7 -9
  81. package/tests/adapter/MonitoringTest.res +30 -3
  82. package/tests/adapter/MonitoringTest.res.mjs +31 -12
  83. package/tests/adapter/RuntimeExtensionHookReachTest.res +0 -1
  84. package/tests/adapter/RuntimeExtensionHookReachTest.res.mjs +5 -7
  85. package/tests/admin/Platform_Admin_StructureTest.res +254 -0
  86. package/tests/admin/Platform_Admin_StructureTest.res.mjs +219 -0
  87. package/tests/admin/Platform_BakedManifestTest.res +1 -0
  88. package/tests/admin/Platform_BakedManifestTest.res.mjs +1 -0
  89. package/tests/admin/Platform_ComponentDefinitionsApiTest.res +3 -0
  90. package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +6 -0
  91. package/tests/admin/Platform_PluginStructuresApiTest.res +1 -0
  92. package/tests/admin/Platform_PluginStructuresApiTest.res.mjs +2 -0
  93. package/tests/aggregate/AggregateCacheTest.res +0 -1
  94. package/tests/aggregate/AggregateCacheTest.res.mjs +13 -15
  95. package/tests/aggregate/AggregateConflictTest.res +0 -1
  96. package/tests/aggregate/AggregateConflictTest.res.mjs +7 -9
  97. package/tests/aggregate/AggregateFixtures.res +0 -1
  98. package/tests/aggregate/AggregateFixtures.res.mjs +19 -21
  99. package/tests/aggregate/AggregateSnapshotTest.res +1 -2
  100. package/tests/aggregate/AggregateSnapshotTest.res.mjs +15 -16
  101. package/tests/api/ApiNoApiTest.res.mjs +17 -9
  102. package/tests/api/GraphQL_FragmentGeneratorTest.res +232 -0
  103. package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +207 -55
  104. package/tests/api/PsInternalFieldsReadModel.res +21 -0
  105. package/tests/api/PsInternalFieldsReadModel.res.mjs +74 -0
  106. package/tests/api/StorageRefFieldsTest.res.mjs +13 -13
  107. package/tests/api/SuryToJsonSchemaTest.res +73 -3
  108. package/tests/api/SuryToJsonSchemaTest.res.mjs +364 -816
  109. package/tests/commandgenerator/CommandGeneratorFixtures.res +0 -1
  110. package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +19 -21
  111. package/tests/commandgenerator/OwnerStampingTest.res +0 -1
  112. package/tests/commandgenerator/OwnerStampingTest.res.mjs +9 -11
  113. package/tests/commandtopic/CommandTopicCallbackFixtures.res +0 -1
  114. package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +7 -9
  115. package/tests/counter/CounterFixtures.res +0 -1
  116. package/tests/counter/CounterFixtures.res.mjs +1 -4
  117. package/tests/dcb/DcbDecodeTest.res.mjs +24 -24
  118. package/tests/dcb/DcbEventLogOperationsTest.res +2 -2
  119. package/tests/dcb/DcbEventLogOperationsTest.res.mjs +3 -3
  120. package/tests/dcb/DcbEventLogSchemaTest.res.mjs +7 -7
  121. package/tests/dcb/DcbFixtures.res +0 -1
  122. package/tests/dcb/DcbFixtures.res.mjs +87 -89
  123. package/tests/dcb/DcbTagTest.res.mjs +6 -6
  124. package/tests/dcb/DcbValidationTest.res.mjs +52 -52
  125. package/tests/eventlog/EventLogFixtures.res +0 -1
  126. package/tests/eventlog/EventLogFixtures.res.mjs +7 -9
  127. package/tests/eventmapper/EventMapperFixtures.res +0 -1
  128. package/tests/eventmapper/EventMapperFixtures.res.mjs +24 -26
  129. package/tests/eventtopic/EventTopicFixtures.res +0 -1
  130. package/tests/eventtopic/EventTopicFixtures.res.mjs +7 -9
  131. package/tests/extensionpoint/ExtensionPointFixtures.res +0 -1
  132. package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +10 -12
  133. package/tests/extensionpoint/ExtensionPointOperationsTest.res +1 -2
  134. package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +9 -10
  135. package/tests/logger/LogFormatTest.res +3 -2
  136. package/tests/logger/LogFormatTest.res.mjs +7 -9
  137. package/tests/message/MessageTest.res +2 -2
  138. package/tests/message/MessageTest.res.mjs +8 -7
  139. package/tests/message/MetaEnvelopeTest.res +5 -5
  140. package/tests/message/MetaEnvelopeTest.res.mjs +12 -11
  141. package/tests/plugin/ManifestVisibilityTest.res.mjs +7 -7
  142. package/tests/plugin/PluginDefinitionScalars.res +5 -3
  143. package/tests/plugin/PluginDefinitionScalars.res.mjs +2 -2
  144. package/tests/plugin/PluginLifecycleCorpusTest.res +4 -3
  145. package/tests/plugin/PluginLifecycleCorpusTest.res.mjs +3 -6
  146. package/tests/plugin/PluginSpecExperiment.res +0 -1
  147. package/tests/plugin/PluginSpecExperiment.res.mjs +12 -14
  148. package/tests/plugin/PluginStructureTest.res +292 -2
  149. package/tests/plugin/PluginStructureTest.res.mjs +391 -88
  150. package/tests/plugin/Plugin_EventQuerySchemaTest.res.mjs +3 -3
  151. package/tests/plugin/SchemaWalkerTest.res +0 -1
  152. package/tests/plugin/SchemaWalkerTest.res.mjs +17 -19
  153. package/tests/plugin/StateChangeSlice/PsAttachInvoice.res.mjs +5 -5
  154. package/tests/plugin/StateChangeSlice/PsChangePhoto.res.mjs +8 -8
  155. package/tests/plugin/StateChangeSlice/PsDispatchShipment.res.mjs +5 -5
  156. package/tests/plugin/StateChangeSlice/PsGatedCommands.res.mjs +9 -9
  157. package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +5 -5
  158. package/tests/plugin/StateChangeSlice/PsReserveStock.res.mjs +8 -8
  159. package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +15 -15
  160. package/tests/plugin/StateChangeSlice/PsTypoStore.res +31 -0
  161. package/tests/plugin/StateChangeSlice/PsTypoStore.res.mjs +62 -0
  162. package/tests/plugin/StateChangeSlice/PsUploadAvatar.res.mjs +8 -8
  163. package/tests/plugin/StateChangeSlice/PsUploadImages.res +40 -0
  164. package/tests/plugin/StateChangeSlice/PsUploadImages.res.mjs +66 -0
  165. package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +13 -12
  166. package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +8 -8
  167. package/tests/plugin/StateViewSlice/PsCategoriesView.res.mjs +6 -6
  168. package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +10 -10
  169. package/tests/plugin/StateViewSlice/PsGatedView.res.mjs +6 -6
  170. package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +9 -9
  171. package/tests/plugin/StateViewSlice/PsShipmentsView.res.mjs +11 -10
  172. package/tests/plugin/pluginDefinitionRequiredScalars.txt +15 -0
  173. package/tests/querydb/QueryDbFixtures.res +0 -1
  174. package/tests/querydb/QueryDbFixtures.res.mjs +5 -7
  175. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res +0 -1
  176. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +4 -6
  177. package/tests/util/CommandPublisherTest.res +0 -1
  178. package/tests/util/CommandPublisherTest.res.mjs +4 -6
@@ -1,9 +1,9 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
4
- import * as Stdlib_Exn from "@rescript/runtime/lib/es6/Stdlib_Exn.js";
3
+ import * as Sury from "sury";
5
4
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
6
5
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
6
+ import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
7
7
  import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
8
8
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
9
9
  import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
@@ -14,6 +14,7 @@ import * as Reference$Reventless from "@reventlessdev/reventless-spec/src/compon
14
14
  import * as StorageRef$Reventless from "@reventlessdev/reventless-spec/src/semantic/StorageRef.res.mjs";
15
15
  import * as Api_Naming$ReventlessCore from "../../src/components/Api/Api_Naming.res.mjs";
16
16
  import * as PsShipOrder$ReventlessCore from "./StateChangeSlice/PsShipOrder.res.mjs";
17
+ import * as PsTypoStore$ReventlessCore from "./StateChangeSlice/PsTypoStore.res.mjs";
17
18
  import * as PsOrdersView$ReventlessCore from "./StateViewSlice/PsOrdersView.res.mjs";
18
19
  import * as PsPlaceOrder$ReventlessCore from "./StateChangeSlice/PsPlaceOrder.res.mjs";
19
20
  import * as StateAnnotations$Reventless from "@reventlessdev/reventless-spec/src/components/StateAnnotations.res.mjs";
@@ -21,6 +22,7 @@ import * as PsChangePhoto$ReventlessCore from "./StateChangeSlice/PsChangePhoto.
21
22
  import * as CapabilityManifest$Reventless from "@reventlessdev/reventless-spec/src/components/CapabilityManifest.res.mjs";
22
23
  import * as PsReserveStock$ReventlessCore from "./StateChangeSlice/PsReserveStock.res.mjs";
23
24
  import * as PsUploadAvatar$ReventlessCore from "./StateChangeSlice/PsUploadAvatar.res.mjs";
25
+ import * as PsUploadImages$ReventlessCore from "./StateChangeSlice/PsUploadImages.res.mjs";
24
26
  import * as PsAnnotatedView$ReventlessCore from "./StateViewSlice/PsAnnotatedView.res.mjs";
25
27
  import * as PsAttachInvoice$ReventlessCore from "./StateChangeSlice/PsAttachInvoice.res.mjs";
26
28
  import * as PsCustomersView$ReventlessCore from "./StateViewSlice/PsCustomersView.res.mjs";
@@ -282,13 +284,73 @@ let PsUploadAvatarSlice = {
282
284
  };
283
285
 
284
286
  let Behavior$4 = {
287
+ initialState: false,
288
+ evolve: PsUploadImages$ReventlessCore.evolve,
289
+ decide: PsUploadImages$ReventlessCore.decide,
290
+ moduleUrl: PsUploadImages$ReventlessCore.moduleUrl
291
+ };
292
+
293
+ function make$9(param, param$1, param$2, param$3, param$4, param$5) {
294
+ return 0;
295
+ }
296
+
297
+ let PsUploadImagesSlice_Spec = {
298
+ name: PsUploadImages$ReventlessCore.name,
299
+ moduleUrl: PsUploadImages$ReventlessCore.moduleUrl,
300
+ Id: Id$Reventless.$$String,
301
+ consumedEventSchema: PsUploadImages$ReventlessCore.consumedEventSchema,
302
+ errorSchema: PsUploadImages$ReventlessCore.errorSchema,
303
+ eventSchema: PsUploadImages$ReventlessCore.eventSchema,
304
+ commandSchema: PsUploadImages$ReventlessCore.commandSchema,
305
+ commandAuthorization: PsUploadImages$ReventlessCore.commandAuthorization,
306
+ readConsistency: PsUploadImages$ReventlessCore.readConsistency
307
+ };
308
+
309
+ let PsUploadImagesSlice = {
310
+ Spec: PsUploadImagesSlice_Spec,
311
+ Behavior: Behavior$4,
312
+ isAsync: false,
313
+ make: make$9
314
+ };
315
+
316
+ let Behavior$5 = {
317
+ initialState: false,
318
+ evolve: PsTypoStore$ReventlessCore.evolve,
319
+ decide: PsTypoStore$ReventlessCore.decide,
320
+ moduleUrl: PsTypoStore$ReventlessCore.moduleUrl
321
+ };
322
+
323
+ function make$10(param, param$1, param$2, param$3, param$4, param$5) {
324
+ return 0;
325
+ }
326
+
327
+ let PsTypoStoreSlice_Spec = {
328
+ name: PsTypoStore$ReventlessCore.name,
329
+ moduleUrl: PsTypoStore$ReventlessCore.moduleUrl,
330
+ Id: Id$Reventless.$$String,
331
+ consumedEventSchema: PsTypoStore$ReventlessCore.consumedEventSchema,
332
+ errorSchema: PsTypoStore$ReventlessCore.errorSchema,
333
+ eventSchema: PsTypoStore$ReventlessCore.eventSchema,
334
+ commandSchema: PsTypoStore$ReventlessCore.commandSchema,
335
+ commandAuthorization: PsTypoStore$ReventlessCore.commandAuthorization,
336
+ readConsistency: PsTypoStore$ReventlessCore.readConsistency
337
+ };
338
+
339
+ let PsTypoStoreSlice = {
340
+ Spec: PsTypoStoreSlice_Spec,
341
+ Behavior: Behavior$5,
342
+ isAsync: false,
343
+ make: make$10
344
+ };
345
+
346
+ let Behavior$6 = {
285
347
  initialState: false,
286
348
  evolve: PsChangePhoto$ReventlessCore.evolve,
287
349
  decide: PsChangePhoto$ReventlessCore.decide,
288
350
  moduleUrl: PsChangePhoto$ReventlessCore.moduleUrl
289
351
  };
290
352
 
291
- function make$9(param, param$1, param$2, param$3, param$4, param$5) {
353
+ function make$11(param, param$1, param$2, param$3, param$4, param$5) {
292
354
  return 0;
293
355
  }
294
356
 
@@ -306,19 +368,19 @@ let PsChangePhotoSlice_Spec = {
306
368
 
307
369
  let PsChangePhotoSlice = {
308
370
  Spec: PsChangePhotoSlice_Spec,
309
- Behavior: Behavior$4,
371
+ Behavior: Behavior$6,
310
372
  isAsync: false,
311
- make: make$9
373
+ make: make$11
312
374
  };
313
375
 
314
- let Behavior$5 = {
376
+ let Behavior$7 = {
315
377
  initialState: false,
316
378
  evolve: PsReserveStock$ReventlessCore.evolve,
317
379
  decide: PsReserveStock$ReventlessCore.decide,
318
380
  moduleUrl: PsReserveStock$ReventlessCore.moduleUrl
319
381
  };
320
382
 
321
- function make$10(param, param$1, param$2, param$3, param$4, param$5) {
383
+ function make$12(param, param$1, param$2, param$3, param$4, param$5) {
322
384
  return 0;
323
385
  }
324
386
 
@@ -336,19 +398,19 @@ let PsReserveStockSlice_Spec = {
336
398
 
337
399
  let PsReserveStockSlice = {
338
400
  Spec: PsReserveStockSlice_Spec,
339
- Behavior: Behavior$5,
401
+ Behavior: Behavior$7,
340
402
  isAsync: false,
341
- make: make$10
403
+ make: make$12
342
404
  };
343
405
 
344
- let Behavior$6 = {
406
+ let Behavior$8 = {
345
407
  initialState: false,
346
408
  evolve: PsDispatchShipment$ReventlessCore.evolve,
347
409
  decide: PsDispatchShipment$ReventlessCore.decide,
348
410
  moduleUrl: PsDispatchShipment$ReventlessCore.moduleUrl
349
411
  };
350
412
 
351
- function make$11(param, param$1, param$2, param$3, param$4, param$5) {
413
+ function make$13(param, param$1, param$2, param$3, param$4, param$5) {
352
414
  return 0;
353
415
  }
354
416
 
@@ -366,9 +428,9 @@ let PsDispatchShipmentSlice_Spec = {
366
428
 
367
429
  let PsDispatchShipmentSlice = {
368
430
  Spec: PsDispatchShipmentSlice_Spec,
369
- Behavior: Behavior$6,
431
+ Behavior: Behavior$8,
370
432
  isAsync: false,
371
- make: make$11
433
+ make: make$13
372
434
  };
373
435
 
374
436
  let Projection$5 = {
@@ -376,7 +438,7 @@ let Projection$5 = {
376
438
  moduleUrl: PsShipmentsView$ReventlessCore.moduleUrl
377
439
  };
378
440
 
379
- function make$12(param, param$1, param$2) {
441
+ function make$14(param, param$1, param$2) {
380
442
  return 0;
381
443
  }
382
444
 
@@ -394,7 +456,7 @@ let PsShipmentsViewSlice_Spec = {
394
456
  let PsShipmentsViewSlice = {
395
457
  Spec: PsShipmentsViewSlice_Spec,
396
458
  Projection: Projection$5,
397
- make: make$12
459
+ make: make$14
398
460
  };
399
461
 
400
462
  let structure = Plugin_Structure$ReventlessCore.make("TestPlugin", undefined, undefined, [
@@ -474,8 +536,8 @@ globalThis.describe("@transition cross-check", () => {
474
536
  return;
475
537
  } catch (raw_e) {
476
538
  let e = Primitive_exceptions.internalToException(raw_e);
477
- if (e.RE_EXN_ID === Stdlib_Exn.$$Error) {
478
- return Stdlib_Option.getOr(e._1.message, "");
539
+ if (e.RE_EXN_ID === "JsExn") {
540
+ return Stdlib_Option.getOr(Stdlib_JsExn.message(e._1), "");
479
541
  } else {
480
542
  return "";
481
543
  }
@@ -740,7 +802,7 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
740
802
  ];
741
803
  };
742
804
  globalThis.test("a DateTime is not a name — a state whose only string is one falls to id", () => {
743
- let schema = S.schema(s => ({
805
+ let schema = Sury.$schema(s => ({
744
806
  orderId: s.m(Reference$Reventless.to_(undefined, undefined, "Order")),
745
807
  placedAt: s.m(DateTime$Reventless.string),
746
808
  shippedAt: s.m(DateTime$Reventless.string)
@@ -751,9 +813,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
751
813
  ]);
752
814
  });
753
815
  globalThis.test("a DateTime is skipped, not fatal — a later plain string still wins", () => {
754
- let schema = S.schema(s => ({
816
+ let schema = Sury.$schema(s => ({
755
817
  placedAt: s.m(DateTime$Reventless.string),
756
- reference: s.m(S.string)
818
+ reference: s.m(Sury.string)
757
819
  }));
758
820
  globalThis.expect(labelOf(undefined, schema)).toEqual([
759
821
  "reference",
@@ -761,8 +823,8 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
761
823
  ]);
762
824
  });
763
825
  globalThis.test("an optional string is still the entity's name", () => {
764
- let schema = S.schema(s => ({
765
- nickname: s.m(S.option(S.string))
826
+ let schema = Sury.$schema(s => ({
827
+ nickname: s.m(Sury.$option(Sury.string))
766
828
  }));
767
829
  globalThis.expect(labelOf(undefined, schema)).toEqual([
768
830
  "nickname",
@@ -770,9 +832,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
770
832
  ]);
771
833
  });
772
834
  globalThis.test("a reference is not a name even when its field is not called `*Id`", () => {
773
- let schema = S.schema(s => ({
835
+ let schema = Sury.$schema(s => ({
774
836
  customer: s.m(Reference$Reventless.to_(undefined, undefined, "Customer")),
775
- note: s.m(S.string)
837
+ note: s.m(Sury.string)
776
838
  }));
777
839
  globalThis.expect(labelOf(undefined, schema)).toEqual([
778
840
  "note",
@@ -780,9 +842,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
780
842
  ]);
781
843
  });
782
844
  globalThis.test("a DCB-tagged string is not a name", () => {
783
- let schema = S.schema(s => ({
845
+ let schema = Sury.$schema(s => ({
784
846
  partition: s.m(DcbTag$Reventless.string),
785
- note: s.m(S.string)
847
+ note: s.m(Sury.string)
786
848
  }));
787
849
  globalThis.expect(labelOf(undefined, schema)).toEqual([
788
850
  "note",
@@ -790,9 +852,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
790
852
  ]);
791
853
  });
792
854
  globalThis.test("the `*Id` test is case-insensitive — `productID` is a reference", () => {
793
- let schema = S.schema(s => ({
794
- productID: s.m(S.string),
795
- note: s.m(S.string)
855
+ let schema = Sury.$schema(s => ({
856
+ productID: s.m(Sury.string),
857
+ note: s.m(Sury.string)
796
858
  }));
797
859
  globalThis.expect(labelOf(undefined, schema)).toEqual([
798
860
  "note",
@@ -800,9 +862,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
800
862
  ]);
801
863
  });
802
864
  globalThis.test("a semantic-carrying string is a value, not a name", () => {
803
- let schema = S.schema(s => ({
865
+ let schema = Sury.$schema(s => ({
804
866
  imageUrl: s.m(StorageRef$Reventless.forStore(undefined, "productImages")),
805
- note: s.m(S.string)
867
+ note: s.m(Sury.string)
806
868
  }));
807
869
  globalThis.expect(labelOf(undefined, schema)).toEqual([
808
870
  "note",
@@ -810,7 +872,7 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
810
872
  ]);
811
873
  });
812
874
  globalThis.test("a state whose only string is a semantic falls to id", () => {
813
- let schema = S.schema(s => ({
875
+ let schema = Sury.$schema(s => ({
814
876
  imageUrl: s.m(StorageRef$Reventless.forStore(undefined, "productImages"))
815
877
  }));
816
878
  globalThis.expect(labelOf(undefined, schema)).toEqual([
@@ -819,9 +881,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
819
881
  ]);
820
882
  });
821
883
  globalThis.test("`id` itself is still excluded by name", () => {
822
- let schema = S.schema(s => ({
823
- id: s.m(S.string),
824
- note: s.m(S.string)
884
+ let schema = Sury.$schema(s => ({
885
+ id: s.m(Sury.string),
886
+ note: s.m(Sury.string)
825
887
  }));
826
888
  globalThis.expect(labelOf(undefined, schema)).toEqual([
827
889
  "note",
@@ -838,9 +900,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
838
900
  ];
839
901
  };
840
902
  globalThis.test("a field named `name` beats an earlier string", () => {
841
- let schema = S.schema(s => ({
842
- sku: s.m(S.string),
843
- name: s.m(S.string)
903
+ let schema = Sury.$schema(s => ({
904
+ sku: s.m(Sury.string),
905
+ name: s.m(Sury.string)
844
906
  }));
845
907
  globalThis.expect(labelOf(schema)).toEqual([
846
908
  "name",
@@ -848,9 +910,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
848
910
  ]);
849
911
  });
850
912
  globalThis.test("`title` counts too, case-insensitively", () => {
851
- let schema = S.schema(s => ({
852
- body: s.m(S.string),
853
- Title: s.m(S.string)
913
+ let schema = Sury.$schema(s => ({
914
+ body: s.m(Sury.string),
915
+ Title: s.m(Sury.string)
854
916
  }));
855
917
  globalThis.expect(labelOf(schema)).toEqual([
856
918
  "Title",
@@ -858,9 +920,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
858
920
  ]);
859
921
  });
860
922
  globalThis.test("the match is exact — `customerName` is a customer's name, not this record's", () => {
861
- let schema = S.schema(s => ({
862
- customerName: s.m(S.string),
863
- note: s.m(S.string)
923
+ let schema = Sury.$schema(s => ({
924
+ customerName: s.m(Sury.string),
925
+ note: s.m(Sury.string)
864
926
  }));
865
927
  globalThis.expect(labelOf(schema)).toEqual([
866
928
  "customerName",
@@ -868,9 +930,9 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
868
930
  ]);
869
931
  });
870
932
  globalThis.test("an optional `name` still outranks an earlier string", () => {
871
- let schema = S.schema(s => ({
872
- sku: s.m(S.string),
873
- name: s.m(S.option(S.string))
933
+ let schema = Sury.$schema(s => ({
934
+ sku: s.m(Sury.string),
935
+ name: s.m(Sury.$option(Sury.string))
874
936
  }));
875
937
  globalThis.expect(labelOf(schema)).toEqual([
876
938
  "name",
@@ -891,21 +953,21 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
891
953
  ]);
892
954
  });
893
955
  globalThis.test("a field named `name` is a guess the consumer can also make", () => {
894
- let schema = S.schema(s => ({
895
- sku: s.m(S.string),
896
- name: s.m(S.string)
956
+ let schema = Sury.$schema(s => ({
957
+ sku: s.m(Sury.string),
958
+ name: s.m(Sury.string)
897
959
  }));
898
960
  globalThis.expect(sourceOf(schema)).toEqual("convention");
899
961
  });
900
962
  globalThis.test("declaration order is a guess only this side can make", () => {
901
- let schema = S.schema(s => ({
902
- customerName: s.m(S.string),
903
- note: s.m(S.string)
963
+ let schema = Sury.$schema(s => ({
964
+ customerName: s.m(Sury.string),
965
+ note: s.m(Sury.string)
904
966
  }));
905
967
  globalThis.expect(sourceOf(schema)).toEqual("position");
906
968
  });
907
969
  globalThis.test("no candidate at all is the state saying it has no human field", () => {
908
- let schema = S.schema(s => ({
970
+ let schema = Sury.$schema(s => ({
909
971
  orderId: s.m(Reference$Reventless.to_(undefined, undefined, "Order")),
910
972
  placedAt: s.m(DateTime$Reventless.string)
911
973
  }));
@@ -965,7 +1027,7 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
965
1027
  });
966
1028
  });
967
1029
  globalThis.describe("lifecycleField — the name rule and the shape rule", () => {
968
- let withLifecycle = (schema, field) => S.Metadata.set(schema, StateAnnotations$Reventless.stateAnnotationsId, {
1030
+ let withLifecycle = (schema, field) => Sury.$Metadata_set(schema, StateAnnotations$Reventless.stateAnnotationsId, {
969
1031
  ids: [],
970
1032
  compositeIds: [],
971
1033
  subIds: [],
@@ -987,50 +1049,50 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
987
1049
  retired: undefined
988
1050
  });
989
1051
  globalThis.test("a `lifecycle` field holding a closed set of values is the lifecycle field", () => {
990
- let schema = S.schema(s => ({
991
- lifecycle: s.m(S.union([
992
- S.literal("Placed"),
993
- S.literal("Shipped")
1052
+ let schema = Sury.$schema(s => ({
1053
+ lifecycle: s.m(Sury.union([
1054
+ Sury.literal("Placed"),
1055
+ Sury.literal("Shipped")
994
1056
  ]))
995
1057
  }));
996
1058
  globalThis.expect(Plugin_Structure$ReventlessCore.lifecycleFieldFromStateSchema("Test", schema)).toEqual("lifecycle");
997
1059
  });
998
1060
  globalThis.test("an optional one counts too", () => {
999
- let schema = S.schema(s => ({
1000
- lifecycle: s.m(S.option(S.union([
1001
- S.literal("Placed"),
1002
- S.literal("Shipped")
1061
+ let schema = Sury.$schema(s => ({
1062
+ lifecycle: s.m(Sury.$option(Sury.union([
1063
+ Sury.literal("Placed"),
1064
+ Sury.literal("Shipped")
1003
1065
  ])))
1004
1066
  }));
1005
1067
  globalThis.expect(Plugin_Structure$ReventlessCore.lifecycleFieldFromStateSchema("Test", schema)).toEqual("lifecycle");
1006
1068
  });
1007
1069
  globalThis.test("free text named `lifecycle` is not a lifecycle", () => {
1008
- let schema = S.schema(s => ({
1009
- lifecycle: s.m(S.string)
1070
+ let schema = Sury.$schema(s => ({
1071
+ lifecycle: s.m(Sury.string)
1010
1072
  }));
1011
1073
  globalThis.expect(Plugin_Structure$ReventlessCore.lifecycleFieldFromStateSchema("Test", schema)).toEqual(undefined);
1012
1074
  });
1013
1075
  globalThis.test("an unannotated field named `status` resolves to None", () => {
1014
- let schema = S.schema(s => ({
1015
- status: s.m(S.union([
1016
- S.literal("Placed"),
1017
- S.literal("Shipped")
1076
+ let schema = Sury.$schema(s => ({
1077
+ status: s.m(Sury.union([
1078
+ Sury.literal("Placed"),
1079
+ Sury.literal("Shipped")
1018
1080
  ]))
1019
1081
  }));
1020
1082
  globalThis.expect(Plugin_Structure$ReventlessCore.lifecycleFieldFromStateSchema("Test", schema)).toEqual(undefined);
1021
1083
  });
1022
1084
  globalThis.test("the annotation names a field the convention would never reach", () => {
1023
- let schema = S.schema(s => ({
1024
- locationStatus: s.m(S.union([
1025
- S.literal("Pending"),
1026
- S.literal("Located")
1085
+ let schema = Sury.$schema(s => ({
1086
+ locationStatus: s.m(Sury.union([
1087
+ Sury.literal("Pending"),
1088
+ Sury.literal("Located")
1027
1089
  ]))
1028
1090
  }));
1029
1091
  globalThis.expect(Plugin_Structure$ReventlessCore.lifecycleFieldFromStateSchema("Test", withLifecycle(schema, "locationStatus"))).toEqual("locationStatus");
1030
1092
  });
1031
1093
  });
1032
1094
  globalThis.describe("retiredField — annotation and nothing else", () => {
1033
- let withRetired = (schema, field) => S.Metadata.set(schema, StateAnnotations$Reventless.stateAnnotationsId, {
1095
+ let withRetired = (schema, field) => Sury.$Metadata_set(schema, StateAnnotations$Reventless.stateAnnotationsId, {
1034
1096
  ids: [],
1035
1097
  compositeIds: [],
1036
1098
  subIds: [],
@@ -1053,11 +1115,12 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
1053
1115
  field: field,
1054
1116
  label: "",
1055
1117
  showWhenFalse: false,
1056
- values: undefined
1118
+ values: undefined,
1119
+ namedWhenRetired: false
1057
1120
  }
1058
1121
  });
1059
1122
  globalThis.test("publishes the retirement state beside the field", () => {
1060
- let withState = schema => S.Metadata.set(schema, StateAnnotations$Reventless.stateAnnotationsId, {
1123
+ let withState = schema => Sury.$Metadata_set(schema, StateAnnotations$Reventless.stateAnnotationsId, {
1061
1124
  ids: [],
1062
1125
  compositeIds: [],
1063
1126
  subIds: [],
@@ -1083,11 +1146,12 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
1083
1146
  values: [
1084
1147
  "Deactivated",
1085
1148
  "Closed"
1086
- ]
1149
+ ],
1150
+ namedWhenRetired: false
1087
1151
  }
1088
1152
  });
1089
- let schema = withState(S.schema(s => ({
1090
- accountStatus: s.m(S.string)
1153
+ let schema = withState(Sury.$schema(s => ({
1154
+ accountStatus: s.m(Sury.string)
1091
1155
  })));
1092
1156
  globalThis.expect([
1093
1157
  Plugin_Structure$ReventlessCore.retiredFieldFromStateSchema(schema),
@@ -1101,31 +1165,141 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
1101
1165
  ]);
1102
1166
  });
1103
1167
  globalThis.test("publishes no states on the boolean form", () => {
1104
- let schema = S.schema(s => ({
1105
- archived: s.m(S.bool)
1168
+ let schema = Sury.$schema(s => ({
1169
+ archived: s.m(Sury.bool)
1106
1170
  }));
1107
1171
  globalThis.expect(Plugin_Structure$ReventlessCore.retiredValuesFromStateSchema(withRetired(schema, "archived"))).toEqual(undefined);
1108
1172
  });
1109
1173
  globalThis.test("names the annotated field", () => {
1110
- let schema = S.schema(s => ({
1111
- archived: s.m(S.bool)
1174
+ let schema = Sury.$schema(s => ({
1175
+ archived: s.m(Sury.bool)
1112
1176
  }));
1113
1177
  globalThis.expect(Plugin_Structure$ReventlessCore.retiredFieldFromStateSchema(withRetired(schema, "archived"))).toEqual("archived");
1114
1178
  });
1115
1179
  globalThis.test("declines a conventionally-named boolean nobody annotated", () => {
1116
- let schema = S.schema(s => ({
1117
- archived: s.m(S.bool),
1118
- deactivated: s.m(S.bool)
1180
+ let schema = Sury.$schema(s => ({
1181
+ archived: s.m(Sury.bool),
1182
+ deactivated: s.m(Sury.bool)
1119
1183
  }));
1120
1184
  globalThis.expect(Plugin_Structure$ReventlessCore.retiredFieldFromStateSchema(schema)).toEqual(undefined);
1121
1185
  });
1122
1186
  globalThis.test("declines a schema carrying no annotation spec at all", () => {
1123
- let schema = S.schema(s => ({
1124
- id: s.m(S.string)
1187
+ let schema = Sury.$schema(s => ({
1188
+ id: s.m(Sury.string)
1125
1189
  }));
1126
1190
  globalThis.expect(Plugin_Structure$ReventlessCore.retiredFieldFromStateSchema(schema)).toEqual(undefined);
1127
1191
  });
1128
1192
  });
1193
+ globalThis.describe("@retired state names are checked against the field's own enum", () => {
1194
+ let withRetiredStates = (schema, field, lifecycle, values) => Sury.$Metadata_set(schema, StateAnnotations$Reventless.stateAnnotationsId, {
1195
+ ids: [],
1196
+ compositeIds: [],
1197
+ subIds: [],
1198
+ compositeSubIds: [],
1199
+ indexes: [],
1200
+ hidden: [],
1201
+ summary: [],
1202
+ drillTargets: [],
1203
+ drillTargetKeys: [],
1204
+ collapsed: [],
1205
+ scan: [],
1206
+ scanSort: [],
1207
+ semantic: [],
1208
+ metric: [],
1209
+ lifecycle: lifecycle,
1210
+ groupBy: undefined,
1211
+ visibility: undefined,
1212
+ live: undefined,
1213
+ retired: {
1214
+ field: field,
1215
+ label: "",
1216
+ showWhenFalse: false,
1217
+ values: values,
1218
+ namedWhenRetired: false
1219
+ }
1220
+ });
1221
+ let shelf = values => withRetiredStates(Sury.$schema(s => ({
1222
+ shelf: s.m(Sury.union([
1223
+ Sury.literal("Listed"),
1224
+ Sury.literal("Archived")
1225
+ ]))
1226
+ })), "shelf", "shelf", values);
1227
+ globalThis.test("a declared state passes", () => {
1228
+ globalThis.expect(Plugin_Structure$ReventlessCore.checkRetiredValue("Products", shelf(["Archived"]))).toEqual({
1229
+ TAG: "Checked",
1230
+ _0: []
1231
+ });
1232
+ });
1233
+ globalThis.test("each undeclared state is reported on its own", () => {
1234
+ let failures = Plugin_Structure$ReventlessCore.checkRetiredValue("Products", shelf([
1235
+ "Archived",
1236
+ "Discontinud",
1237
+ "Withdrawn"
1238
+ ]));
1239
+ if (typeof failures !== "object") {
1240
+ globalThis.expect(failures).toEqual({
1241
+ TAG: "Checked",
1242
+ _0: []
1243
+ });
1244
+ return;
1245
+ }
1246
+ if (failures.TAG === "Unchecked") {
1247
+ globalThis.expect(failures).toEqual({
1248
+ TAG: "Checked",
1249
+ _0: []
1250
+ });
1251
+ return;
1252
+ }
1253
+ let failures$1 = failures._0;
1254
+ globalThis.expect(failures$1.length).toBe(2);
1255
+ globalThis.expect(failures$1.some(f => f.includes("Discontinud"))).toBe(true);
1256
+ globalThis.expect(failures$1.some(f => f.includes("Withdrawn"))).toBe(true);
1257
+ globalThis.expect(failures$1.every(f => f.includes("Listed, Archived"))).toBe(true);
1258
+ });
1259
+ globalThis.test("a field with no cases to compare against says so instead of passing", () => {
1260
+ let schema = withRetiredStates(Sury.$schema(s => ({
1261
+ shelf: s.m(Sury.string)
1262
+ })), "shelf", "shelf", ["Archived"]);
1263
+ let why = Plugin_Structure$ReventlessCore.checkRetiredValue("Products", schema);
1264
+ if (typeof why !== "object") {
1265
+ globalThis.expect(why).toEqual({
1266
+ TAG: "Unchecked",
1267
+ _0: ""
1268
+ });
1269
+ return;
1270
+ }
1271
+ if (why.TAG === "Unchecked") {
1272
+ globalThis.expect(why._0.includes("no cases")).toBe(true);
1273
+ return;
1274
+ }
1275
+ globalThis.expect(why).toEqual({
1276
+ TAG: "Unchecked",
1277
+ _0: ""
1278
+ });
1279
+ });
1280
+ globalThis.test("the boolean form is not a skip", () => {
1281
+ let schema = withRetiredStates(Sury.$schema(s => ({
1282
+ archived: s.m(Sury.bool)
1283
+ })), "archived", undefined, undefined);
1284
+ globalThis.expect(Plugin_Structure$ReventlessCore.checkRetiredValue("Products", schema)).toEqual("NotDeclared");
1285
+ });
1286
+ globalThis.test("a state on a non-lifecycle field is not a failure", () => {
1287
+ let schema = withRetiredStates(Sury.$schema(s => ({
1288
+ shelf: s.m(Sury.union([
1289
+ Sury.literal("Listed"),
1290
+ Sury.literal("Archived")
1291
+ ])),
1292
+ lifecycle: s.m(Sury.union([
1293
+ Sury.literal("Draft"),
1294
+ Sury.literal("Live")
1295
+ ]))
1296
+ })), "shelf", "lifecycle", ["Archived"]);
1297
+ globalThis.expect(Plugin_Structure$ReventlessCore.checkRetiredValue("Products", schema)).toEqual({
1298
+ TAG: "Checked",
1299
+ _0: []
1300
+ });
1301
+ });
1302
+ });
1129
1303
  let getProperty = (json, key) => {
1130
1304
  let obj = Stdlib_JSON.Decode.object(json);
1131
1305
  if (obj !== undefined) {
@@ -1306,6 +1480,133 @@ globalThis.describe("Plugin_Structure.make — Phase 2 graph fields", () => {
1306
1480
  });
1307
1481
  });
1308
1482
  });
1483
+ globalThis.describe("uploadable types derive their store from the field name", () => {
1484
+ let withUploads = Plugin_Structure$ReventlessCore.make("TestPlugin", undefined, undefined, undefined, [PsUploadImagesSlice], undefined, undefined, undefined, undefined, undefined, undefined);
1485
+ let stores = Stdlib_Option.getOr(withUploads.requiredStores, []);
1486
+ globalThis.test("the derived store is the field name, pluralised", () => {
1487
+ globalThis.expect(stores.includes("TestPlugin.productImages")).toBe(true);
1488
+ });
1489
+ globalThis.test("an optional field still declares its store", () => {
1490
+ globalThis.expect(stores.includes("TestPlugin.categoryImages")).toBe(true);
1491
+ });
1492
+ globalThis.test("an array field declares through its element", () => {
1493
+ globalThis.expect(stores.includes("TestPlugin.datasheets")).toBe(true);
1494
+ });
1495
+ globalThis.test("an explicit @storageRef overrides the derived name", () => {
1496
+ globalThis.expect(stores.includes("branding.logos")).toBe(true);
1497
+ });
1498
+ globalThis.test("nothing else is collected", () => {
1499
+ globalThis.expect(stores.length).toBe(4);
1500
+ });
1501
+ globalThis.test("each requirement keeps its declaring sites", () => {
1502
+ let expected = [
1503
+ {
1504
+ store: "TestPlugin.categoryImages",
1505
+ component: "UploadImages",
1506
+ field: "categoryImage",
1507
+ annotation: "categoryImages"
1508
+ },
1509
+ {
1510
+ store: "TestPlugin.datasheets",
1511
+ component: "UploadImages",
1512
+ field: "datasheets",
1513
+ annotation: "datasheets"
1514
+ },
1515
+ {
1516
+ store: "TestPlugin.productImages",
1517
+ component: "UploadImages",
1518
+ field: "productImage",
1519
+ annotation: "productImages"
1520
+ },
1521
+ {
1522
+ store: "branding.logos",
1523
+ component: "UploadImages",
1524
+ field: "logo",
1525
+ annotation: "branding.logos"
1526
+ }
1527
+ ];
1528
+ globalThis.expect(withUploads.requiredStoreDeclarations).toEqual(expected);
1529
+ });
1530
+ let commandJson = JSON.parse(withUploads.stateChangeSlices[0].commands[0].schema);
1531
+ let semanticOf = field => Stdlib_Option.flatMap(Stdlib_Option.flatMap(getPropertyOf(commandJson, field), s => getProperty(s, "x-reventless-semantic")), Stdlib_JSON.Decode.string);
1532
+ globalThis.test("the wire carries the content half, not just the store", () => {
1533
+ globalThis.expect(semanticOf("productImage")).toBe("uploadableImage");
1534
+ });
1535
+ globalThis.test("an overridden field keeps its uploadable semantic", () => {
1536
+ globalThis.expect(semanticOf("logo")).toBe("uploadableImage");
1537
+ });
1538
+ globalThis.test("the non-image arm carries its own id, on the element", () => {
1539
+ globalThis.expect(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap(getPropertyOf(commandJson, "datasheets"), s => getProperty(s, "items")), s => getProperty(s, "x-reventless-semantic")), Stdlib_JSON.Decode.string)).toBe("uploadableFile");
1540
+ });
1541
+ });
1542
+ globalThis.describe("near-duplicate stores are refused", () => {
1543
+ let failureText = () => {
1544
+ try {
1545
+ Plugin_Structure$ReventlessCore.make("TestPlugin", undefined, undefined, undefined, [PsTypoStoreSlice], undefined, undefined, undefined, undefined, undefined, undefined);
1546
+ return "";
1547
+ } catch (raw_e) {
1548
+ let e = Primitive_exceptions.internalToException(raw_e);
1549
+ if (e.RE_EXN_ID === "JsExn") {
1550
+ return Stdlib_Option.getOr(Stdlib_JsExn.message(e._1), "(no message)");
1551
+ } else {
1552
+ return "(not a JS error)";
1553
+ }
1554
+ }
1555
+ };
1556
+ globalThis.test("two stores one transposition apart fail the build", () => {
1557
+ globalThis.expect(failureText() !== "").toBe(true);
1558
+ });
1559
+ globalThis.test("the failure names both stores and both fields", () => {
1560
+ let text = failureText();
1561
+ globalThis.expect([
1562
+ text.includes("TestPlugin.productImages"),
1563
+ text.includes("TestPlugin.productImgaes"),
1564
+ text.includes("TypoStore.productImage"),
1565
+ text.includes("@storageRef")
1566
+ ]).toEqual([
1567
+ true,
1568
+ true,
1569
+ true,
1570
+ true
1571
+ ]);
1572
+ });
1573
+ globalThis.test("the four stores of the uploadable fixture do not collide", () => {
1574
+ globalThis.expect(Capability_Inference$ReventlessCore.collisions(Stdlib_Option.getOr(Plugin_Structure$ReventlessCore.make("TestPlugin", undefined, undefined, undefined, [PsUploadImagesSlice], undefined, undefined, undefined, undefined, undefined, undefined).requiredStoreDeclarations, []))).toEqual([]);
1575
+ });
1576
+ globalThis.test("one edit, transpositions included; two edits not", () => {
1577
+ globalThis.expect([
1578
+ [
1579
+ "productImages",
1580
+ "productImgaes"
1581
+ ],
1582
+ [
1583
+ "productImages",
1584
+ "productImage"
1585
+ ],
1586
+ [
1587
+ "logos",
1588
+ "logo"
1589
+ ],
1590
+ [
1591
+ "documents",
1592
+ "logos"
1593
+ ],
1594
+ [
1595
+ "productImages",
1596
+ "productImgeas"
1597
+ ]
1598
+ ].map(param => Capability_Inference$ReventlessCore.withinOneEdit(param[0], param[1]))).toEqual([
1599
+ true,
1600
+ true,
1601
+ true,
1602
+ false,
1603
+ false
1604
+ ]);
1605
+ });
1606
+ globalThis.test("a singular/plural pair collides even at two edits apart", () => {
1607
+ globalThis.expect(Capability_Inference$ReventlessCore.sameStem("productImage", "productImages")).toBe(true);
1608
+ });
1609
+ });
1309
1610
  globalThis.describe("optional carriers keep their declarations", () => {
1310
1611
  let withOptional = Plugin_Structure$ReventlessCore.make("TestPlugin", undefined, undefined, undefined, [PsUploadAvatarSlice], undefined, undefined, undefined, undefined, undefined, undefined);
1311
1612
  globalThis.test("an optional storage ref still requires its store", () => {
@@ -1440,6 +1741,8 @@ export {
1440
1741
  PsCategoriesViewSlice,
1441
1742
  PsAttachInvoiceSlice,
1442
1743
  PsUploadAvatarSlice,
1744
+ PsUploadImagesSlice,
1745
+ PsTypoStoreSlice,
1443
1746
  PsChangePhotoSlice,
1444
1747
  PsReserveStockSlice,
1445
1748
  PsDispatchShipmentSlice,