@reventlessdev/reventless-core 3.0.0-alpha.169 → 3.0.0-alpha.171

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 (110) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +16 -16
  3. package/src/admin/Platform_Admin.res +5 -2
  4. package/src/admin/Platform_Admin.res.mjs +4 -4
  5. package/src/components/Aggregate/Aggregate.res +5 -1
  6. package/src/components/Aggregate/Aggregate_Builder.res +21 -6
  7. package/src/components/Aggregate/Aggregate_Builder.res.mjs +10 -7
  8. package/src/components/AutomationSlice/AutomationSlice.res +1 -0
  9. package/src/components/AutomationSlice/AutomationSlice_Builder.res +13 -2
  10. package/src/components/AutomationSlice/AutomationSlice_Builder.res.mjs +5 -2
  11. package/src/components/Builder_Helpers.res +16 -2
  12. package/src/components/Builder_Helpers.res.mjs +6 -6
  13. package/src/components/Dcb/Dcb_Builder.res +46 -4
  14. package/src/components/Dcb/Dcb_Builder.res.mjs +13 -9
  15. package/src/components/ExtensionPoint/ExtensionPoint.res +2 -0
  16. package/src/components/ExtensionPoint/ExtensionPoint_Builder.res +10 -0
  17. package/src/components/ExtensionPoint/ExtensionPoint_Builder.res.mjs +6 -4
  18. package/src/components/InboundTranslationSlice/InboundTranslationSlice.res +1 -0
  19. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res +8 -1
  20. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res.mjs +1 -1
  21. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice.res +1 -0
  22. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res +12 -3
  23. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +5 -2
  24. package/src/components/ReadModel/ReadModel.res +1 -0
  25. package/src/components/ReadModel/ReadModel_Builder.res +9 -1
  26. package/src/components/ReadModel/ReadModel_Builder.res.mjs +5 -2
  27. package/src/components/StateChangeSlice/StateChangeSlice.res +1 -0
  28. package/src/components/StateChangeSlice/StateChangeSlice_Builder.res +6 -0
  29. package/src/components/StateChangeSlice/StateChangeSlice_Builder.res.mjs +1 -1
  30. package/src/components/StateViewSlice/StateViewSlice.res +1 -0
  31. package/src/components/StateViewSlice/StateViewSlice_Builder.res +11 -3
  32. package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +5 -2
  33. package/src/components/Task/Task.res +1 -0
  34. package/src/components/Task/Task_Builder.res +11 -2
  35. package/src/components/Task/Task_Builder.res.mjs +7 -4
  36. package/src/plugin/component/Plugin.res +5 -0
  37. package/src/plugin/component/Plugin_Builder.res +10 -2
  38. package/src/plugin/component/Plugin_Builder.res.mjs +7 -6
  39. package/src/plugin/component/Plugin_Helpers.res +2 -0
  40. package/src/plugin/component/Plugin_Helpers.res.mjs +2 -2
  41. package/src/plugin/connect/PluginExtensionPoint_Builder.res +2 -0
  42. package/src/plugin/connect/PluginExtensionPoint_Builder.res.mjs +3 -3
  43. package/tests/plugin/ManifestVisibilityTest.res +2 -2
  44. package/tests/plugin/PluginStructureTest.res +6 -6
  45. package/tests/IdentityTest.res.mjs +0 -174
  46. package/tests/adapter/MonitoringTest.res.mjs +0 -82
  47. package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +0 -356
  48. package/tests/admin/Platform_UIFragmentsApiTest.res.mjs +0 -101
  49. package/tests/aggregate/AggregateCacheTest.res.mjs +0 -433
  50. package/tests/aggregate/AggregateCallbackTest.res.mjs +0 -143
  51. package/tests/aggregate/AggregateCausationTest.res.mjs +0 -47
  52. package/tests/aggregate/AggregateConflictTest.res.mjs +0 -386
  53. package/tests/aggregate/AggregateFixtures.res.mjs +0 -308
  54. package/tests/aggregate/AggregateRejectionTest.res.mjs +0 -166
  55. package/tests/aggregate/AggregateSnapshotTest.res.mjs +0 -645
  56. package/tests/api/ApiNoApiTest.res.mjs +0 -90
  57. package/tests/api/GraphQL_StitcherTest.res.mjs +0 -112
  58. package/tests/api/SimpleTest.res.mjs +0 -10
  59. package/tests/api/SuryToJsonSchemaTest.res.mjs +0 -674
  60. package/tests/commandgenerator/CommandGeneratorCallbackTest.res.mjs +0 -160
  61. package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +0 -197
  62. package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +0 -152
  63. package/tests/commandtopic/CommandTopicCallbackTest.res.mjs +0 -106
  64. package/tests/commandtopic/CommandTopicHelpersRejectionTest.res.mjs +0 -109
  65. package/tests/counter/CounterCallbackTest.res.mjs +0 -140
  66. package/tests/counter/CounterFixtures.res.mjs +0 -67
  67. package/tests/dcb/DcbDecodeTest.res.mjs +0 -194
  68. package/tests/dcb/DcbEventLogOperationsTest.res.mjs +0 -268
  69. package/tests/dcb/DcbFixtures.res.mjs +0 -534
  70. package/tests/dcb/DcbScopeInferenceTest.res.mjs +0 -480
  71. package/tests/dcb/DcbStateChangeSliceTest.res.mjs +0 -540
  72. package/tests/dcb/DcbTagTest.res.mjs +0 -867
  73. package/tests/dcb/DcbValidationTest.res.mjs +0 -476
  74. package/tests/eventlog/EventLogFixtures.res.mjs +0 -196
  75. package/tests/eventlog/EventLogOperationsTest.res.mjs +0 -192
  76. package/tests/eventlog/EventLogRetryTest.res.mjs +0 -195
  77. package/tests/eventmapper/EventMapperCallbackTest.res.mjs +0 -141
  78. package/tests/eventmapper/EventMapperFixtures.res.mjs +0 -440
  79. package/tests/eventmapper/EventMapperTest.res.mjs +0 -83
  80. package/tests/eventtopic/EventTopicFixtures.res.mjs +0 -65
  81. package/tests/eventtopic/EventTopicOperationsTest.res.mjs +0 -71
  82. package/tests/extensionpoint/ExtensionPointCallbackTest.res.mjs +0 -94
  83. package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +0 -205
  84. package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +0 -304
  85. package/tests/ftp/FTPTest.res.mjs +0 -88
  86. package/tests/logger/LogFormatTest.res.mjs +0 -309
  87. package/tests/logger/LoggerLazyTest.res.mjs +0 -40
  88. package/tests/message/MessageTest.res.mjs +0 -218
  89. package/tests/message/MetaEnvelopeTest.res.mjs +0 -188
  90. package/tests/plugin/ManifestVisibilityTest.res.mjs +0 -215
  91. package/tests/plugin/PluginSpecExperiment.res.mjs +0 -31
  92. package/tests/plugin/PluginStructureTest.res.mjs +0 -419
  93. package/tests/plugin/PluginVersionTest.res.mjs +0 -30
  94. package/tests/plugin/SchemaWalkerTest.res.mjs +0 -160
  95. package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +0 -62
  96. package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +0 -69
  97. package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +0 -95
  98. package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +0 -69
  99. package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +0 -69
  100. package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +0 -81
  101. package/tests/poc/StructuralSubtypingPoc.res.mjs +0 -61
  102. package/tests/projection/ProjectionOptimizeTest.res.mjs +0 -75
  103. package/tests/querydb/QueryDbFixtures.res.mjs +0 -135
  104. package/tests/querydb/QueryDbOperationsTest.res.mjs +0 -168
  105. package/tests/sideeffecthandler/SideEffectHandlerCallbackTest.res.mjs +0 -77
  106. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +0 -139
  107. package/tests/util/CommandPublisherTest.res.mjs +0 -78
  108. package/tests/util/CsvStreamTest.res.mjs +0 -51
  109. package/tests/util/LruTest.res.mjs +0 -105
  110. package/tests/util/MetricsTest.res.mjs +0 -53
@@ -1,356 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
-
3
- import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
4
- import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
5
- import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
6
- import * as Platform_ComponentDefinitionsApi$ReventlessCore from "../../src/admin/Platform_ComponentDefinitionsApi.res.mjs";
7
-
8
- let cmd_references = [{
9
- fieldName: "categoryId",
10
- entity: "Category",
11
- plugin: "Catalog"
12
- }];
13
-
14
- let cmd_apiExposed = true;
15
-
16
- let cmd = {
17
- name: "Add",
18
- schema: "{}",
19
- level: "Collection",
20
- aggregateIdField: undefined,
21
- mutationField: "AddProduct",
22
- references: cmd_references,
23
- allowedStates: undefined,
24
- apiExposed: cmd_apiExposed
25
- };
26
-
27
- let qbl_consumedEventTypes = ["ProductAdded"];
28
-
29
- let qbl_linkedWriteSide = ["Product"];
30
-
31
- let qbl_searchableFields = ["displayName"];
32
-
33
- let qbl = {
34
- name: "Products",
35
- queryField: "Catalog_Products",
36
- schema: "{}",
37
- consumedEventTypes: qbl_consumedEventTypes,
38
- linkedWriteSide: qbl_linkedWriteSide,
39
- labelField: "displayName",
40
- searchableFields: qbl_searchableFields,
41
- statusField: undefined,
42
- visibility: undefined,
43
- chapter: undefined
44
- };
45
-
46
- let wbl_commands = [cmd];
47
-
48
- let wbl_producedEventTypes = ["ProductAdded"];
49
-
50
- let wbl_consumedEventTypes = [];
51
-
52
- let wbl_linkedViews = ["Products"];
53
-
54
- let wbl_events = [{
55
- name: "ProductAdded",
56
- schema: "{}",
57
- references: []
58
- }];
59
-
60
- let wbl = {
61
- name: "Product",
62
- commands: wbl_commands,
63
- producedEventTypes: wbl_producedEventTypes,
64
- consumedEventTypes: wbl_consumedEventTypes,
65
- linkedViews: wbl_linkedViews,
66
- consistencyRead: undefined,
67
- events: wbl_events,
68
- chapter: undefined
69
- };
70
-
71
- let structure_readModels = [qbl];
72
-
73
- let structure_stateViewSlices = [];
74
-
75
- let structure_stateChangeSlices = [];
76
-
77
- let structure_aggregates = [wbl];
78
-
79
- let structure_automationSlices = [{
80
- name: "Restocker",
81
- consumedEventTypes: ["StockLow"],
82
- producedCommandTypes: ["Restock"],
83
- targetName: "Product",
84
- chapter: undefined
85
- }];
86
-
87
- let structure_outboundTranslationSlices = [{
88
- name: "ToShipper",
89
- consumedEventTypes: ["OrderPlaced"],
90
- inboundCommandTypes: ["Ship"],
91
- targetName: undefined,
92
- externalSystem: undefined,
93
- chapter: undefined
94
- }];
95
-
96
- let structure_inboundTranslationSlices = [{
97
- name: "FromBilling",
98
- commandTypes: ["RecordPayment"],
99
- targetName: "Order",
100
- externalSystem: undefined,
101
- chapter: undefined
102
- }];
103
-
104
- let structure_extensions = [{
105
- name: "Catalog.Products.Watcher",
106
- delegateNames: ["onAdded"],
107
- eventTypes: ["ProductAdded"],
108
- commandTypes: []
109
- }];
110
-
111
- let structure = {
112
- readModels: structure_readModels,
113
- stateViewSlices: structure_stateViewSlices,
114
- stateChangeSlices: structure_stateChangeSlices,
115
- aggregates: structure_aggregates,
116
- automationSlices: structure_automationSlices,
117
- outboundTranslationSlices: structure_outboundTranslationSlices,
118
- inboundTranslationSlices: structure_inboundTranslationSlices,
119
- extensions: structure_extensions,
120
- extensionPoints: undefined
121
- };
122
-
123
- let encoded = Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Catalog", structure);
124
-
125
- let json = JSON.stringify(encoded);
126
-
127
- globalThis.describe("encodePluginStructureEntry", () => {
128
- globalThis.test("produces a JSON object with the expected top-level keys", () => {
129
- let dict = Stdlib_Option.getOr(Stdlib_JSON.Decode.object(encoded), {});
130
- let keys = Object.keys(dict).toSorted(Primitive_string.compare);
131
- globalThis.expect(keys).toEqual([
132
- "aggregates",
133
- "automationSlices",
134
- "extensions",
135
- "inboundTranslationSlices",
136
- "outboundTranslationSlices",
137
- "pluginId",
138
- "readModels",
139
- "stateChangeSlices",
140
- "stateViewSlices"
141
- ]);
142
- });
143
- globalThis.test("encodes pluginId", () => {
144
- globalThis.expect(json.includes("\"pluginId\":\"Catalog\"")).toEqual(true);
145
- });
146
- globalThis.test("encodes commandLevel as a literal string", () => {
147
- globalThis.expect(json.includes("\"level\":\"Collection\"")).toEqual(true);
148
- });
149
- globalThis.test("encodes None aggregateIdField as null", () => {
150
- globalThis.expect(json.includes("\"aggregateIdField\":null")).toEqual(true);
151
- });
152
- globalThis.test("encodes None consistencyRead as null", () => {
153
- globalThis.expect(json.includes("\"consistencyRead\":null")).toEqual(true);
154
- });
155
- globalThis.test("encodes Some plugin reference as its inner string", () => {
156
- globalThis.expect(json.includes("\"plugin\":\"Catalog\"")).toEqual(true);
157
- });
158
- globalThis.test("includes the queryableDef name", () => {
159
- globalThis.expect(json.includes("\"name\":\"Products\"")).toEqual(true);
160
- });
161
- globalThis.test("includes the automation slice name", () => {
162
- globalThis.expect(json.includes("\"name\":\"Restocker\"")).toEqual(true);
163
- });
164
- globalThis.test("encodes None allowedStates as null", () => {
165
- globalThis.expect(json.includes("\"allowedStates\":null")).toEqual(true);
166
- });
167
- globalThis.test("encodes the command's apiExposed flag (drives the event-graph API badge)", () => {
168
- globalThis.expect(json.includes("\"apiExposed\":true")).toEqual(true);
169
- });
170
- globalThis.test("encodes None statusField as null", () => {
171
- globalThis.expect(json.includes("\"statusField\":null")).toEqual(true);
172
- });
173
- globalThis.test("encodes writableDef events", () => {
174
- globalThis.expect(json.includes("\"events\":[{\"name\":\"ProductAdded\"")).toEqual(true);
175
- });
176
- globalThis.test("encodes None outbound externalSystem as null", () => {
177
- globalThis.expect(json.includes("\"inboundCommandTypes\":[\"Ship\"],\"externalSystem\":null")).toEqual(true);
178
- });
179
- globalThis.test("encodes None inbound externalSystem as null", () => {
180
- globalThis.expect(json.includes("\"commandTypes\":[\"RecordPayment\"],\"externalSystem\":null")).toEqual(true);
181
- });
182
- });
183
-
184
- globalThis.describe("translation-slice externalSystem round-trip", () => {
185
- let externalStructure_readModels = structure_readModels;
186
- let externalStructure_stateViewSlices = structure_stateViewSlices;
187
- let externalStructure_stateChangeSlices = structure_stateChangeSlices;
188
- let externalStructure_aggregates = structure_aggregates;
189
- let externalStructure_automationSlices = structure_automationSlices;
190
- let externalStructure_outboundTranslationSlices = [{
191
- name: "ToShipper",
192
- consumedEventTypes: ["OrderPlaced"],
193
- inboundCommandTypes: ["Ship"],
194
- targetName: undefined,
195
- externalSystem: "ShipperGateway",
196
- chapter: undefined
197
- }];
198
- let externalStructure_inboundTranslationSlices = [{
199
- name: "FromBilling",
200
- commandTypes: ["RecordPayment"],
201
- targetName: "Order",
202
- externalSystem: "BillingProvider",
203
- chapter: undefined
204
- }];
205
- let externalStructure_extensions = structure_extensions;
206
- let externalStructure = {
207
- readModels: externalStructure_readModels,
208
- stateViewSlices: externalStructure_stateViewSlices,
209
- stateChangeSlices: externalStructure_stateChangeSlices,
210
- aggregates: externalStructure_aggregates,
211
- automationSlices: externalStructure_automationSlices,
212
- outboundTranslationSlices: externalStructure_outboundTranslationSlices,
213
- inboundTranslationSlices: externalStructure_inboundTranslationSlices,
214
- extensions: externalStructure_extensions,
215
- extensionPoints: undefined
216
- };
217
- let externalJson = JSON.stringify(Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Catalog", externalStructure));
218
- globalThis.test("surfaces Some outbound externalSystem as its inner string", () => {
219
- globalThis.expect(externalJson.includes("\"externalSystem\":\"ShipperGateway\"")).toEqual(true);
220
- });
221
- globalThis.test("surfaces Some inbound externalSystem as its inner string", () => {
222
- globalThis.expect(externalJson.includes("\"externalSystem\":\"BillingProvider\"")).toEqual(true);
223
- });
224
- });
225
-
226
- globalThis.describe("visibility filtering (deployed AutoUI hides Internal)", () => {
227
- let internalQbl_consumedEventTypes = ["CatalogProductSynced"];
228
- let internalQbl_linkedWriteSide = [];
229
- let internalQbl_searchableFields = ["name"];
230
- let internalQbl_visibility = "Internal";
231
- let internalQbl = {
232
- name: "AvailableProducts",
233
- queryField: "Ordering_AvailableProducts",
234
- schema: "{}",
235
- consumedEventTypes: internalQbl_consumedEventTypes,
236
- linkedWriteSide: internalQbl_linkedWriteSide,
237
- labelField: "name",
238
- searchableFields: internalQbl_searchableFields,
239
- statusField: undefined,
240
- visibility: internalQbl_visibility,
241
- chapter: undefined
242
- };
243
- let mixed_readModels = [
244
- qbl,
245
- internalQbl
246
- ];
247
- let mixed_stateViewSlices = [internalQbl];
248
- let mixed_stateChangeSlices = structure_stateChangeSlices;
249
- let mixed_aggregates = structure_aggregates;
250
- let mixed_automationSlices = structure_automationSlices;
251
- let mixed_outboundTranslationSlices = structure_outboundTranslationSlices;
252
- let mixed_inboundTranslationSlices = structure_inboundTranslationSlices;
253
- let mixed_extensions = structure_extensions;
254
- let mixed = {
255
- readModels: mixed_readModels,
256
- stateViewSlices: mixed_stateViewSlices,
257
- stateChangeSlices: mixed_stateChangeSlices,
258
- aggregates: mixed_aggregates,
259
- automationSlices: mixed_automationSlices,
260
- outboundTranslationSlices: mixed_outboundTranslationSlices,
261
- inboundTranslationSlices: mixed_inboundTranslationSlices,
262
- extensions: mixed_extensions,
263
- extensionPoints: undefined
264
- };
265
- let mixedJson = JSON.stringify(Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Ordering", mixed));
266
- globalThis.test("excludes an Internal queryableDef from the encoded read-side", () => {
267
- globalThis.expect(mixedJson.includes("AvailableProducts")).toEqual(false);
268
- });
269
- globalThis.test("keeps a Public queryableDef", () => {
270
- globalThis.expect(mixedJson.includes("\"name\":\"Products\"")).toEqual(true);
271
- });
272
- });
273
-
274
- globalThis.describe("allowedStates + statusField populated", () => {
275
- let cmdWithStates_aggregateIdField = "id";
276
- let cmdWithStates_references = [];
277
- let cmdWithStates_allowedStates = ["Inactive"];
278
- let cmdWithStates_apiExposed = true;
279
- let cmdWithStates = {
280
- name: "Activate",
281
- schema: "{}",
282
- level: "Instance",
283
- aggregateIdField: cmdWithStates_aggregateIdField,
284
- mutationField: "Platform_Plugin_Activate",
285
- references: cmdWithStates_references,
286
- allowedStates: cmdWithStates_allowedStates,
287
- apiExposed: cmdWithStates_apiExposed
288
- };
289
- let qblWithStatus_consumedEventTypes = [];
290
- let qblWithStatus_linkedWriteSide = ["Plugin"];
291
- let qblWithStatus_searchableFields = ["name"];
292
- let qblWithStatus_statusField = "status";
293
- let qblWithStatus = {
294
- name: "Plugin",
295
- queryField: "Platform_Plugins",
296
- schema: "{}",
297
- consumedEventTypes: qblWithStatus_consumedEventTypes,
298
- linkedWriteSide: qblWithStatus_linkedWriteSide,
299
- labelField: "name",
300
- searchableFields: qblWithStatus_searchableFields,
301
- statusField: qblWithStatus_statusField,
302
- visibility: undefined,
303
- chapter: undefined
304
- };
305
- let wblWithStates_commands = [cmdWithStates];
306
- let wblWithStates_producedEventTypes = [];
307
- let wblWithStates_consumedEventTypes = [];
308
- let wblWithStates_linkedViews = ["Plugin"];
309
- let wblWithStates_events = [];
310
- let wblWithStates = {
311
- name: "Plugin",
312
- commands: wblWithStates_commands,
313
- producedEventTypes: wblWithStates_producedEventTypes,
314
- consumedEventTypes: wblWithStates_consumedEventTypes,
315
- linkedViews: wblWithStates_linkedViews,
316
- consistencyRead: undefined,
317
- events: wblWithStates_events,
318
- chapter: undefined
319
- };
320
- let structureWithStates_readModels = [qblWithStatus];
321
- let structureWithStates_stateViewSlices = [];
322
- let structureWithStates_stateChangeSlices = [];
323
- let structureWithStates_aggregates = [wblWithStates];
324
- let structureWithStates_automationSlices = [];
325
- let structureWithStates_outboundTranslationSlices = [];
326
- let structureWithStates_inboundTranslationSlices = [];
327
- let structureWithStates_extensions = [];
328
- let structureWithStates = {
329
- readModels: structureWithStates_readModels,
330
- stateViewSlices: structureWithStates_stateViewSlices,
331
- stateChangeSlices: structureWithStates_stateChangeSlices,
332
- aggregates: structureWithStates_aggregates,
333
- automationSlices: structureWithStates_automationSlices,
334
- outboundTranslationSlices: structureWithStates_outboundTranslationSlices,
335
- inboundTranslationSlices: structureWithStates_inboundTranslationSlices,
336
- extensions: structureWithStates_extensions,
337
- extensionPoints: undefined
338
- };
339
- let json = JSON.stringify(Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Platform", structureWithStates));
340
- globalThis.test("encodes populated allowedStates as a JSON array", () => {
341
- globalThis.expect(json.includes("\"allowedStates\":[\"Inactive\"]")).toEqual(true);
342
- });
343
- globalThis.test("encodes populated statusField as the field name string", () => {
344
- globalThis.expect(json.includes("\"statusField\":\"status\"")).toEqual(true);
345
- });
346
- });
347
-
348
- export {
349
- cmd,
350
- qbl,
351
- wbl,
352
- structure,
353
- encoded,
354
- json,
355
- }
356
- /* encoded Not a pure module */
@@ -1,101 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
-
3
- import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
4
- import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
5
- import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
6
- import * as Platform_UIFragmentsApi$ReventlessCore from "../../src/admin/Platform_UIFragmentsApi.res.mjs";
7
-
8
- let panel_positions = ["platform-summary"];
9
-
10
- let panel = {
11
- fragmentId: "Catalog.Categories.list",
12
- title: "Categories",
13
- description: "",
14
- positions: panel_positions,
15
- requiredAccess: undefined
16
- };
17
-
18
- let page = {
19
- fragmentId: "Catalog.Categories.list",
20
- title: "Categories",
21
- menuEntry: {
22
- label: "Categories",
23
- icon: undefined,
24
- group: undefined,
25
- sortOrder: 0
26
- },
27
- requiredAccess: "admin"
28
- };
29
-
30
- let state_panels = [panel];
31
-
32
- let state_pages = [page];
33
-
34
- let state = {
35
- pluginId: "Catalog",
36
- remoteEntryUrl: "https://cdn.example.com/catalog@1.0/remoteEntry.js",
37
- panels: state_panels,
38
- pages: state_pages,
39
- registeredAt: "2026-05-14T00:00:00.000Z",
40
- updatedAt: "2026-05-14T00:00:00.000Z"
41
- };
42
-
43
- let encoded = Platform_UIFragmentsApi$ReventlessCore.encodeUIFragmentEntry(state);
44
-
45
- let json = JSON.stringify(encoded);
46
-
47
- globalThis.describe("encodeUIFragmentEntry", () => {
48
- globalThis.test("produces a JSON object with the expected top-level keys", () => {
49
- let dict = Stdlib_Option.getOr(Stdlib_JSON.Decode.object(encoded), {});
50
- let keys = Object.keys(dict).toSorted(Primitive_string.compare);
51
- globalThis.expect(keys).toEqual([
52
- "pages",
53
- "panels",
54
- "pluginId",
55
- "registeredAt",
56
- "remoteEntryUrl",
57
- "updatedAt"
58
- ]);
59
- });
60
- globalThis.test("encodes pluginId", () => {
61
- globalThis.expect(json.includes("\"pluginId\":\"Catalog\"")).toEqual(true);
62
- });
63
- globalThis.test("encodes remoteEntryUrl", () => {
64
- globalThis.expect(json.includes("\"remoteEntryUrl\":\"https://cdn.example.com/catalog@1.0/remoteEntry.js\"")).toEqual(true);
65
- });
66
- globalThis.test("encodes None requiredAccess on panel as null", () => {
67
- globalThis.expect(json.includes("\"requiredAccess\":null")).toEqual(true);
68
- });
69
- globalThis.test("encodes Some requiredAccess on page as its inner string", () => {
70
- globalThis.expect(json.includes("\"requiredAccess\":\"admin\"")).toEqual(true);
71
- });
72
- globalThis.test("encodes nested menuEntry as an object with sortOrder", () => {
73
- globalThis.expect(json.includes("\"sortOrder\":0")).toEqual(true);
74
- });
75
- globalThis.test("encodes panel positions as an array of strings", () => {
76
- globalThis.expect(json.includes("\"positions\":[\"platform-summary\"]")).toEqual(true);
77
- });
78
- });
79
-
80
- globalThis.describe("Platform_UIFragmentsApi.sdl", () => {
81
- globalThis.test("query field declares the list type", () => {
82
- globalThis.expect(Platform_UIFragmentsApi$ReventlessCore.sdlQueryField.includes("[Platform_UIFragmentEntry!]!")).toEqual(true);
83
- });
84
- globalThis.test("sdlTypes includes Platform_UIFragmentEntry", () => {
85
- let allTypes = Platform_UIFragmentsApi$ReventlessCore.sdlTypes.join("\n");
86
- globalThis.expect(allTypes.includes("Platform_UIFragmentEntry")).toEqual(true);
87
- });
88
- globalThis.test("sdlTypes includes Platform_UIPanel with positions field", () => {
89
- let allTypes = Platform_UIFragmentsApi$ReventlessCore.sdlTypes.join("\n");
90
- globalThis.expect(allTypes.includes("positions: [String!]!")).toEqual(true);
91
- });
92
- });
93
-
94
- export {
95
- panel,
96
- page,
97
- state,
98
- encoded,
99
- json,
100
- }
101
- /* encoded Not a pure module */