@reventlessdev/reventless-spec 3.0.0-alpha.75 → 3.0.0-alpha.77

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 CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 3.0.0-alpha.77 (2026-07-15)
7
+
8
+ ### Performance Improvements
9
+
10
+ * **spec:** reverse-convert DcbTag extraction instead of stringify round-trip ([4311c7b](https://github.com/ReventlessDev/reventless-core/commit/4311c7b863f99e582911ced529d77dca7cc36381))
11
+
12
+
13
+ # 3.0.0-alpha.76 (2026-07-12)
14
+
15
+ ### Features
16
+
17
+ * **admin:** make the API fragment registry per-target (Domain | Platform) ([30491a9](https://github.com/ReventlessDev/reventless-core/commit/30491a9e14b4236c98cc756efb6de68ede1e77d7))
18
+ * **admin:** retire the Plugin-aggregate UI-fragment path in favour of the registry slices ([1dbc708](https://github.com/ReventlessDev/reventless-core/commit/1dbc708e7439b34ff970cc3d963d7835a8c6fd48))
19
+
20
+
6
21
  # 3.0.0-alpha.75 (2026-07-11)
7
22
 
8
23
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-spec",
3
- "version": "3.0.0-alpha.75",
3
+ "version": "3.0.0-alpha.77",
4
4
  "description": "Specifications for Reventless",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -399,7 +399,11 @@ let extractTagsFromJson = (schema: S.t<unknown>, json: JSON.t): array<tag> =>
399
399
  /**
400
400
  Extracts DCB tags from a typed event value using its sury schema.
401
401
 
402
- Serializes the value to JSON first, then delegates to `extractTagsFromJson`.
402
+ Reverse-converts the value to JSON through its schema, then delegates to
403
+ `extractTagsFromJson`. Using the schema-aware reverse convert (instead of a
404
+ `JSON.stringifyAny -> parseOrThrow` string round-trip) avoids serializing the
405
+ whole event to a string per message and emits the schema's serialized field
406
+ keys — so `@as`-renamed tagged fields are found by the same-schema walker.
403
407
 
404
408
  @example
405
409
  ```rescript
@@ -410,10 +414,8 @@ let tags = DcbTag.extractTags(
410
414
  // [{key: "categoryId", value: "cat-1"}]
411
415
  ```
412
416
  */
413
- let extractTags = (schema: S.t<'a>, value: 'a): array<tag> => {
414
- let json = value->JSON.stringifyAny->Option.getOrThrow->JSON.parseOrThrow
415
- extractTagsFromJson(schema->toUnknownSchema, json)
416
- }
417
+ let extractTags = (schema: S.t<'a>, value: 'a): array<tag> =>
418
+ extractTagsFromJson(schema->toUnknownSchema, value->S.reverseConvertToJsonOrThrow(schema))
417
419
 
418
420
  // --- Extract variant constructor names from a tagged union schema ---
419
421
  // For a variant type like `type event = ItemCreated({...}) | ItemRenamed({...})`,
@@ -596,10 +598,8 @@ let tags = DcbTag.extractTagsExpanded(
596
598
  // [{key: "orderId", value: "ord-1"}, {key: "productIds", value: "p1"}, {key: "productIds", value: "p2"}]
597
599
  ```
598
600
  */
599
- let extractTagsExpanded = (schema: S.t<'a>, value: 'a): array<tag> => {
600
- let json = value->JSON.stringifyAny->Option.getOrThrow->JSON.parseOrThrow
601
- extractTagsFromJsonExpanded(schema->toUnknownSchema, json)
602
- }
601
+ let extractTagsExpanded = (schema: S.t<'a>, value: 'a): array<tag> =>
602
+ extractTagsFromJsonExpanded(schema->toUnknownSchema, value->S.reverseConvertToJsonOrThrow(schema))
603
603
 
604
604
  // --- Automatic query construction from command schema ---
605
605
 
@@ -202,8 +202,7 @@ function extractTagsFromJson(schema, json) {
202
202
  }
203
203
 
204
204
  function extractTags(schema, value) {
205
- let json = JSON.parse(Stdlib_Option.getOrThrow(JSON.stringify(value), undefined));
206
- return extractTagsFromJson(schema, json);
205
+ return extractTagsFromJson(schema, S.reverseConvertToJsonOrThrow(value, schema));
207
206
  }
208
207
 
209
208
  function extractVariantNames(schema) {
@@ -345,8 +344,7 @@ function extractTagsFromJsonExpanded(schema, json) {
345
344
  }
346
345
 
347
346
  function extractTagsExpanded(schema, value) {
348
- let json = JSON.parse(Stdlib_Option.getOrThrow(JSON.stringify(value), undefined));
349
- return extractTagsFromJsonExpanded(schema, json);
347
+ return extractTagsFromJsonExpanded(schema, S.reverseConvertToJsonOrThrow(value, schema));
350
348
  }
351
349
 
352
350
  function hasTaggedArrayFields(schema) {
@@ -92,6 +92,16 @@ Encoded as JSON for transport; protocol identifies the schema format (e.g. "grap
92
92
  @schema
93
93
  type apiSchemaFragment = {encoded: string, protocol: string}
94
94
 
95
+ /**
96
+ The API a plugin's GraphQL fields are stitched into: the Domain API (the default —
97
+ application plugins) or the Platform API (platform-level plugins such as an inspector,
98
+ which contribute fields alongside the admin base). Serializes as the bare string
99
+ "Domain" / "Platform". Consumed by the schema-fragment registry to maintain one
100
+ cumulative schema per API.
101
+ */
102
+ @schema
103
+ type apiTarget = Domain | Platform
104
+
95
105
  // Sury's nullableAsOption creates T | undefined | null which fails jsonableValidation
96
106
  // inside union variant payloads. js_nullable creates T | null (no undefined) which is
97
107
  // JSON-safe and passes jsonableValidation in all contexts.
@@ -358,23 +368,6 @@ type pluginStructure = {
358
368
 
359
369
  let pluginStructureOptionSchema = _jsNullable(pluginStructureSchema, ())
360
370
 
361
- // ── Event graph types (cross-plugin component graph) ──────────────────────────
362
-
363
- @schema
364
- type graphNode = {pluginName: string, componentName: string, kind: string}
365
-
366
- @schema
367
- type graphEdge = {
368
- source: graphNode,
369
- target: graphNode,
370
- mechanism: string,
371
- viaEvents: array<string>,
372
- implicit: bool,
373
- }
374
-
375
- @schema
376
- type platformEventGraph = {nodes: array<graphNode>, edges: array<graphEdge>}
377
-
378
371
  /**
379
372
  The self-description of a deployed plugin, persisted in the plugin's event store.
380
373
 
@@ -403,8 +396,6 @@ type pluginDefinition = {
403
396
  // Uses @s.matches(stringOptionSchema) — js_nullable creates string | null (not string | undefined),
404
397
  // which passes sury's jsonableValidation inside union variant payloads.
405
398
  apiTarget: @s.matches(stringOptionSchema) option<string>,
406
- // UI fragment manifest contributed by this plugin (optional, absent for pure backend plugins).
407
- uiFragments: @s.matches(uiFragmentManifestOptionSchema) option<uiFragmentManifest>,
408
399
  // Component graph metadata — populated by makePluginDefinition; absent for older protocol versions.
409
400
  structure: @s.matches(pluginStructureOptionSchema) option<pluginStructure>,
410
401
  // DCB EventLog definition for plugins that bundle a DcbEventLog component.
@@ -38,6 +38,11 @@ let apiSchemaFragmentSchema = S.schema(s => ({
38
38
  protocol: s.m(S.string)
39
39
  }));
40
40
 
41
+ let apiTargetSchema = S.union([
42
+ S.literal("Domain"),
43
+ S.literal("Platform")
44
+ ]);
45
+
41
46
  let apiSchemaFragmentOptionSchema = SuryResMjs.js_nullable(apiSchemaFragmentSchema);
42
47
 
43
48
  let dcbEventLogOptionSchema = SuryResMjs.js_nullable(dcbEventLogDefinitionSchema);
@@ -185,25 +190,6 @@ let pluginStructureSchema = S.schema(s => ({
185
190
 
186
191
  let pluginStructureOptionSchema = SuryResMjs.js_nullable(pluginStructureSchema);
187
192
 
188
- let graphNodeSchema = S.schema(s => ({
189
- pluginName: s.m(S.string),
190
- componentName: s.m(S.string),
191
- kind: s.m(S.string)
192
- }));
193
-
194
- let graphEdgeSchema = S.schema(s => ({
195
- source: s.m(graphNodeSchema),
196
- target: s.m(graphNodeSchema),
197
- mechanism: s.m(S.string),
198
- viaEvents: s.m(S.array(S.string)),
199
- implicit: s.m(S.bool)
200
- }));
201
-
202
- let platformEventGraphSchema = S.schema(s => ({
203
- nodes: s.m(S.array(graphNodeSchema)),
204
- edges: s.m(S.array(graphEdgeSchema))
205
- }));
206
-
207
193
  let pluginDefinitionSchema = S.schema(s => ({
208
194
  id: s.m(S.string),
209
195
  name: s.m(S.string),
@@ -214,7 +200,6 @@ let pluginDefinitionSchema = S.schema(s => ({
214
200
  extensionProtocols: s.m(S.array(extensionProtocolSchema)),
215
201
  apiSchemaFragment: s.m(apiSchemaFragmentOptionSchema),
216
202
  apiTarget: s.m(stringOptionSchema),
217
- uiFragments: s.m(uiFragmentManifestOptionSchema),
218
203
  structure: s.m(pluginStructureOptionSchema),
219
204
  dcbEventLog: s.m(dcbEventLogOptionSchema),
220
205
  kind: s.m(pluginKindSchema)
@@ -233,6 +218,7 @@ export {
233
218
  dcbEventLogDefinitionSchema,
234
219
  extensionProtocolSchema,
235
220
  apiSchemaFragmentSchema,
221
+ apiTargetSchema,
236
222
  apiSchemaFragmentOptionSchema,
237
223
  dcbEventLogOptionSchema,
238
224
  stringOptionSchema,
@@ -257,9 +243,6 @@ export {
257
243
  extensionPointDefArrayOptionSchema,
258
244
  pluginStructureSchema,
259
245
  pluginStructureOptionSchema,
260
- graphNodeSchema,
261
- graphEdgeSchema,
262
- platformEventGraphSchema,
263
246
  pluginDefinitionSchema,
264
247
  }
265
248
  /* pluginKindSchema Not a pure module */