@reventlessdev/reventless-spec 3.0.0-alpha.61
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 +625 -0
- package/LICENSE +202 -0
- package/README.md +114 -0
- package/package.json +34 -0
- package/rescript.json +25 -0
- package/run-generator.mjs +2 -0
- package/src/AnsiStyle.res +40 -0
- package/src/AnsiStyle.res.mjs +54 -0
- package/src/LogPrefix.res +168 -0
- package/src/LogPrefix.res.mjs +148 -0
- package/src/PackageVersion.res +73 -0
- package/src/PackageVersion.res.mjs +81 -0
- package/src/components/Aggregate.res +64 -0
- package/src/components/Aggregate.res.mjs +2 -0
- package/src/components/AutomationSlice.res +279 -0
- package/src/components/AutomationSlice.res.mjs +30 -0
- package/src/components/Counter.res +24 -0
- package/src/components/Counter.res.mjs +2 -0
- package/src/components/DcbDecode.res +128 -0
- package/src/components/DcbDecode.res.mjs +117 -0
- package/src/components/DcbTag.res +1256 -0
- package/src/components/DcbTag.res.mjs +869 -0
- package/src/components/DcbValidation.res +362 -0
- package/src/components/DcbValidation.res.mjs +360 -0
- package/src/components/DisplayName.res +40 -0
- package/src/components/DisplayName.res.mjs +26 -0
- package/src/components/ExtensionPoint.res +27 -0
- package/src/components/ExtensionPoint.res.mjs +2 -0
- package/src/components/InboundTranslationSlice.res +79 -0
- package/src/components/InboundTranslationSlice.res.mjs +2 -0
- package/src/components/OutboundTranslationSlice.res +108 -0
- package/src/components/OutboundTranslationSlice.res.mjs +2 -0
- package/src/components/Plugin.res +373 -0
- package/src/components/Plugin.res.mjs +249 -0
- package/src/components/ReadModel.res +199 -0
- package/src/components/ReadModel.res.mjs +18 -0
- package/src/components/Reference.res +51 -0
- package/src/components/Reference.res.mjs +37 -0
- package/src/components/StateAnnotations.res +65 -0
- package/src/components/StateAnnotations.res.mjs +15 -0
- package/src/components/StateChangeSlice.res +131 -0
- package/src/components/StateChangeSlice.res.mjs +2 -0
- package/src/components/StateViewSlice.res +99 -0
- package/src/components/StateViewSlice.res.mjs +2 -0
- package/src/components/Task.res +62 -0
- package/src/components/Task.res.mjs +2 -0
- package/src/generator/Codegen.res +703 -0
- package/src/generator/Codegen.res.mjs +485 -0
- package/src/generator/Config.res +85 -0
- package/src/generator/Config.res.mjs +78 -0
- package/src/generator/Discovery.res +204 -0
- package/src/generator/Discovery.res.mjs +213 -0
- package/src/generator/Generator_Node.res +49 -0
- package/src/generator/Generator_Node.res.mjs +18 -0
- package/src/generator/Pairing.res +386 -0
- package/src/generator/Pairing.res.mjs +353 -0
- package/src/generator/PluginGenerator.res +53 -0
- package/src/generator/PluginGenerator.res.mjs +70 -0
- package/src/types/Authorization.res +23 -0
- package/src/types/Authorization.res.mjs +33 -0
- package/src/types/Behavior.res +78 -0
- package/src/types/Behavior.res.mjs +2 -0
- package/src/types/EventMapping.res +100 -0
- package/src/types/EventMapping.res.mjs +15 -0
- package/src/types/Handler.res +30 -0
- package/src/types/Handler.res.mjs +2 -0
- package/src/types/Id.res +75 -0
- package/src/types/Id.res.mjs +37 -0
- package/src/types/Identity.res +46 -0
- package/src/types/Identity.res.mjs +51 -0
- package/src/types/Message.res +197 -0
- package/src/types/Message.res.mjs +108 -0
- package/src/types/Projection.res +220 -0
- package/src/types/Projection.res.mjs +44 -0
- package/src/types/QueryEngine.res +123 -0
- package/src/types/QueryEngine.res.mjs +12 -0
- package/src/types/ReadConsistency.res +38 -0
- package/src/types/ReadConsistency.res.mjs +29 -0
- package/src/types/Schedule.res +65 -0
- package/src/types/Schedule.res.mjs +68 -0
- package/src/types/SideEffect.res +45 -0
- package/src/types/SideEffect.res.mjs +2 -0
- package/src/types/StoredEvent.res +46 -0
- package/src/types/StoredEvent.res.mjs +32 -0
- package/src/types/Visibility.res +24 -0
- package/src/types/Visibility.res.mjs +25 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
/** The logical name of a plugin (serializable as JSON). */
|
|
2
|
+
@schema
|
|
3
|
+
type name = string
|
|
4
|
+
|
|
5
|
+
/** The semantic version string of a plugin release. */
|
|
6
|
+
@schema
|
|
7
|
+
type version = string
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
Describes an extension point exported by a plugin.
|
|
11
|
+
Included in the plugin's `pluginDefinition` for use by the gateway / host.
|
|
12
|
+
*/
|
|
13
|
+
@schema
|
|
14
|
+
type extensionPointDefinition = {
|
|
15
|
+
name: string,
|
|
16
|
+
commandTopic: string,
|
|
17
|
+
eventTopic: string,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
Describes an extension imported by a plugin (i.e. a connection to a host plugin's
|
|
22
|
+
extension point).
|
|
23
|
+
Included in the plugin's `pluginDefinition` for use by the host.
|
|
24
|
+
*/
|
|
25
|
+
@schema
|
|
26
|
+
type extensionDefinition = {
|
|
27
|
+
name: string,
|
|
28
|
+
extensionPointName: string,
|
|
29
|
+
/**
|
|
30
|
+
DCB EventLog source names this extension consumes. Convention: each entry is
|
|
31
|
+
the `name` field of a peer plugin's `dcbEventLogDefinition` (i.e. `${peer}DcbEventLog`).
|
|
32
|
+
The admin uses these to provision cross-plugin SNS subscriptions from peer DCB
|
|
33
|
+
EventTopics → this plugin's EventCollector. `[]` for extensions that only consume
|
|
34
|
+
ExtensionPoint EventTopics.
|
|
35
|
+
*/
|
|
36
|
+
dcbSources: array<string>,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
Describes a DCB EventLog exposed by a plugin.
|
|
41
|
+
Included in the plugin's `pluginDefinition` so the admin can provision SNS
|
|
42
|
+
subscriptions from this plugin's DCB EventTopic to any peer plugin whose
|
|
43
|
+
extension references the DCB log by name.
|
|
44
|
+
*/
|
|
45
|
+
@schema
|
|
46
|
+
type dcbEventLogDefinition = {
|
|
47
|
+
/** Service name carried in event meta — convention: `${plugin.name}DcbEventLog`. */
|
|
48
|
+
name: string,
|
|
49
|
+
/** SNS topic ARN for the DCB EventLog's EventTopic. */
|
|
50
|
+
eventTopicArn: string,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
Protocol version declaration for a single extension point connection.
|
|
55
|
+
|
|
56
|
+
Carried in the `ConnectPlugin` handshake so the host can validate schema
|
|
57
|
+
compatibility before accepting the extension. Use `[]` when version
|
|
58
|
+
negotiation is not needed.
|
|
59
|
+
*/
|
|
60
|
+
// Protocol version declaration for a single extension point connection.
|
|
61
|
+
// Carried in the ConnectPlugin handshake so the host can validate compatibility.
|
|
62
|
+
@schema
|
|
63
|
+
type extensionProtocol = {
|
|
64
|
+
extensionPointName: string,
|
|
65
|
+
/** SemVer of the command schema the extension was compiled against. */
|
|
66
|
+
commandVersion: string,
|
|
67
|
+
/** SemVer of the event schema the extension was compiled against. */
|
|
68
|
+
eventVersion: string,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
A GraphQL schema fragment contributed by a plugin.
|
|
73
|
+
Encoded as JSON for transport; protocol identifies the schema format (e.g. "graphql").
|
|
74
|
+
*/
|
|
75
|
+
@schema
|
|
76
|
+
type apiSchemaFragment = {encoded: string, protocol: string}
|
|
77
|
+
|
|
78
|
+
// Sury's nullableAsOption creates T | undefined | null which fails jsonableValidation
|
|
79
|
+
// inside union variant payloads. js_nullable creates T | null (no undefined) which is
|
|
80
|
+
// JSON-safe and passes jsonableValidation in all contexts.
|
|
81
|
+
@module("sury/src/Sury.res.mjs") external _jsNullable: (S.t<'a>, unit) => S.t<option<'a>> = "js_nullable"
|
|
82
|
+
let apiSchemaFragmentOptionSchema = _jsNullable(apiSchemaFragmentSchema, ())
|
|
83
|
+
let dcbEventLogOptionSchema = _jsNullable(dcbEventLogDefinitionSchema, ())
|
|
84
|
+
// js_nullable creates T | null which passes sury's jsonableValidation inside union variant payloads.
|
|
85
|
+
let stringOptionSchema = _jsNullable(S.string, ())
|
|
86
|
+
let stringArrayOptionSchema = _jsNullable(S.array(S.string), ())
|
|
87
|
+
let boolOptionSchema = _jsNullable(S.bool, ())
|
|
88
|
+
|
|
89
|
+
// ── UI fragment manifest types ────────────────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
@schema
|
|
92
|
+
type panelManifestEntry = {
|
|
93
|
+
fragmentId: string,
|
|
94
|
+
title: string,
|
|
95
|
+
description: string,
|
|
96
|
+
positions: array<string>,
|
|
97
|
+
requiredAccess: @s.matches(stringOptionSchema) option<string>,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@schema
|
|
101
|
+
type menuEntry = {
|
|
102
|
+
label: string,
|
|
103
|
+
icon: @s.matches(stringOptionSchema) option<string>,
|
|
104
|
+
group: @s.matches(stringOptionSchema) option<string>,
|
|
105
|
+
sortOrder: int,
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@schema
|
|
109
|
+
type pageManifestEntry = {
|
|
110
|
+
fragmentId: string,
|
|
111
|
+
title: string,
|
|
112
|
+
menuEntry: menuEntry,
|
|
113
|
+
requiredAccess: @s.matches(stringOptionSchema) option<string>,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@schema
|
|
117
|
+
type uiFragmentManifest = {
|
|
118
|
+
remoteEntryUrl: string,
|
|
119
|
+
panels: array<panelManifestEntry>,
|
|
120
|
+
pages: array<pageManifestEntry>,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
let uiFragmentManifestOptionSchema = _jsNullable(uiFragmentManifestSchema, ())
|
|
124
|
+
|
|
125
|
+
// ── Plugin structure types (component metadata for Auto UI and event graph) ──
|
|
126
|
+
|
|
127
|
+
@schema
|
|
128
|
+
type commandLevel = Collection | Instance
|
|
129
|
+
|
|
130
|
+
@schema
|
|
131
|
+
type fieldReference = {
|
|
132
|
+
fieldName: string,
|
|
133
|
+
entity: string,
|
|
134
|
+
plugin: @s.matches(stringOptionSchema) option<string>,
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@schema
|
|
138
|
+
type commandDef = {
|
|
139
|
+
name: string,
|
|
140
|
+
schema: string,
|
|
141
|
+
level: commandLevel,
|
|
142
|
+
aggregateIdField: @s.matches(stringOptionSchema) option<string>,
|
|
143
|
+
mutationField: string,
|
|
144
|
+
references: array<fieldReference>,
|
|
145
|
+
/**
|
|
146
|
+
Status values under which this command is meaningful. `None` means the command
|
|
147
|
+
is always available (back-compat default). `Some([…])` lets AutoUI hide the
|
|
148
|
+
command on rows whose status field is not in the set — see `queryableDef.statusField`
|
|
149
|
+
for how the row's status is located. `Some([])` is the defensive "never show" form.
|
|
150
|
+
*/
|
|
151
|
+
allowedStates: @s.matches(stringArrayOptionSchema) option<array<string>>,
|
|
152
|
+
/**
|
|
153
|
+
Whether this command variant is exposed in the generated API (a non-`@noApi`
|
|
154
|
+
variant of a non-`@noApi` command). Dev tooling badges API-exposed commands in
|
|
155
|
+
the event graph. js_nullable (T | null) so it stays JSON-safe inside the
|
|
156
|
+
persisted/lifecycle payloads; absent on defs written before this field existed
|
|
157
|
+
(read as None) — those stores must be reset. See [[sury-optional-field-absent-vs-null]].
|
|
158
|
+
*/
|
|
159
|
+
apiExposed: @s.matches(boolOptionSchema) option<bool>,
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@schema
|
|
163
|
+
type queryableDef = {
|
|
164
|
+
name: string,
|
|
165
|
+
queryField: string,
|
|
166
|
+
schema: string,
|
|
167
|
+
consumedEventTypes: array<string>,
|
|
168
|
+
linkedWriteSide: array<string>,
|
|
169
|
+
/**
|
|
170
|
+
The field on this entity that carries the human-readable label.
|
|
171
|
+
When the entity's state schema declares one or more `@displayName` annotations,
|
|
172
|
+
this resolves to `"displayName"` (the projected column). Otherwise it falls back
|
|
173
|
+
to the first non-`id` string property, or `"id"` as a last resort.
|
|
174
|
+
*/
|
|
175
|
+
labelField: string,
|
|
176
|
+
/**
|
|
177
|
+
Fields appropriate for label-oriented text search.
|
|
178
|
+
Mirrors `labelField` when the entity uses the fallback or single-field label.
|
|
179
|
+
For composite `@displayName` annotations, lists the *raw* underlying source
|
|
180
|
+
fields (so clients with substring indexes can target them directly).
|
|
181
|
+
*/
|
|
182
|
+
searchableFields: array<string>,
|
|
183
|
+
/**
|
|
184
|
+
Name of the state field whose value identifies the row's lifecycle status, used
|
|
185
|
+
by AutoUI together with `commandDef.allowedStates` to filter the per-row command
|
|
186
|
+
menu. Resolution order (codegen): (1) field annotated `@status`; (2) a field
|
|
187
|
+
literally named `"status"`; (3) `None`. Spec authors that hand-roll a
|
|
188
|
+
`queryableDef` set this explicitly.
|
|
189
|
+
*/
|
|
190
|
+
statusField: @s.matches(stringOptionSchema) option<string>,
|
|
191
|
+
/**
|
|
192
|
+
Component visibility hint (`@@reventless.visibility`). `Some("Internal")` marks a
|
|
193
|
+
ReadModel / StateViewSlice that the deployed AutoUI hides from its menu, drill-down
|
|
194
|
+
pages, web event graph and cross-plugin edges. `None` (absent) means Public. Internal
|
|
195
|
+
components are still CARRIED in `pluginStructure` (tagged here) so developer tools — the
|
|
196
|
+
`reventless-gwt` / VSCode domain graph and dead-code analysis — can see them, per
|
|
197
|
+
Visibility.res. Optional for back-compat: definitions persisted before this field
|
|
198
|
+
existed decode as `None` (Public).
|
|
199
|
+
*/
|
|
200
|
+
visibility: @s.matches(stringOptionSchema) option<string>,
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
One emitted event of a write side, with its field schema. Mirrors `commandDef`
|
|
205
|
+
but for the past-tense facts a write side produces: `name` is the event variant
|
|
206
|
+
name (e.g. `OrderPlaced`), `schema` is the JSON Schema of that variant's payload
|
|
207
|
+
(same `S.toJSONSchema` serialization as `commandDef.schema`, incl. `x-reventless-*`
|
|
208
|
+
extensions and the `TAG` const), `references` its cross-entity field links.
|
|
209
|
+
Carried so developer tools (the `reventless-dev` / VSCode domain graph) can show
|
|
210
|
+
event field rows — AutoUI ignores it. */
|
|
211
|
+
@schema
|
|
212
|
+
type eventDef = {
|
|
213
|
+
name: string,
|
|
214
|
+
schema: string,
|
|
215
|
+
references: array<fieldReference>,
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@schema
|
|
219
|
+
type writableDef = {
|
|
220
|
+
name: string,
|
|
221
|
+
commands: array<commandDef>,
|
|
222
|
+
producedEventTypes: array<string>,
|
|
223
|
+
consumedEventTypes: array<string>,
|
|
224
|
+
linkedViews: array<string>,
|
|
225
|
+
consistencyRead: @s.matches(stringOptionSchema) option<string>,
|
|
226
|
+
/** Emitted-event field schemas (Phase 6.3). Required like the other write-side
|
|
227
|
+
arrays; `[]` when there are none. The structure is re-derived on every build/
|
|
228
|
+
deploy, so no persisted-data back-compat shim is needed. */
|
|
229
|
+
events: array<eventDef>,
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@schema
|
|
233
|
+
type automationSliceDef = {
|
|
234
|
+
name: string,
|
|
235
|
+
consumedEventTypes: array<string>,
|
|
236
|
+
producedCommandTypes: array<string>,
|
|
237
|
+
targetName: string,
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@schema
|
|
241
|
+
type outboundTranslationSliceDef = {
|
|
242
|
+
name: string,
|
|
243
|
+
consumedEventTypes: array<string>,
|
|
244
|
+
inboundCommandTypes: array<string>,
|
|
245
|
+
targetName: @s.matches(stringOptionSchema) option<string>,
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@schema
|
|
249
|
+
type inboundTranslationSliceDef = {
|
|
250
|
+
name: string,
|
|
251
|
+
commandTypes: array<string>,
|
|
252
|
+
targetName: string,
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@schema
|
|
256
|
+
type extensionDef = {
|
|
257
|
+
name: string,
|
|
258
|
+
delegateNames: array<string>,
|
|
259
|
+
eventTypes: array<string>,
|
|
260
|
+
commandTypes: array<string>,
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
Describes an extension point owned by a plugin, from the *producer* side.
|
|
265
|
+
|
|
266
|
+
`sourceEventTypes` are the owner-plugin internal events (the `Delegate`'s events)
|
|
267
|
+
that feed this extension point's published protocol — plugin-qualified to match
|
|
268
|
+
`writableDef.producedEventTypes`, so the event graph can link a producing
|
|
269
|
+
write-side to the extension point it ultimately feeds. `delegateNames` are the
|
|
270
|
+
connected targets (one per `ExtensionPointMapping`).
|
|
271
|
+
|
|
272
|
+
`commandTypes` are the EP's *inbound* command protocol (the variants of its
|
|
273
|
+
`command` type). It is empty (None, read as []) when the EP declares
|
|
274
|
+
`command = unit` — a notification-only, events-out boundary that accepts nothing
|
|
275
|
+
inward. The event graph uses this to decide whether the EP routes any command (an
|
|
276
|
+
empty list means no `routesTo` edge: there is nothing for the EP to route).
|
|
277
|
+
|
|
278
|
+
Optional (None for a `command = unit` EP). Uses the `js_nullable` pattern (T | null).
|
|
279
|
+
A sury field cannot be BOTH absent-tolerant on decode AND JSON-encodable (proven:
|
|
280
|
+
S.option = `T|undefined`, nullableAsOption = `T|undefined|null` both decode an absent
|
|
281
|
+
key but fail jsonableValidation; js_nullable = `T|null` is the only JSON-safe form but
|
|
282
|
+
rejects an absent key). This def is nested in the JSON-encoded lifecycle Message union
|
|
283
|
+
(Connect/Heartbeat), so jsonability wins → js_nullable. It always writes the field
|
|
284
|
+
(None → null), so it is present-required on decode; a plugin definition persisted
|
|
285
|
+
before this field existed must be reset/re-emitted. Read with `->Option.getOr([])`.
|
|
286
|
+
*/
|
|
287
|
+
@schema
|
|
288
|
+
type extensionPointDef = {
|
|
289
|
+
name: string,
|
|
290
|
+
delegateNames: array<string>,
|
|
291
|
+
sourceEventTypes: array<string>,
|
|
292
|
+
commandTypes: @s.matches(stringArrayOptionSchema) option<array<string>>,
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// js_nullable creates `array | null` (not `| undefined`), which passes sury's
|
|
296
|
+
// jsonableValidation inside the pluginStructure union variant payload.
|
|
297
|
+
let extensionPointDefArrayOptionSchema = _jsNullable(S.array(extensionPointDefSchema), ())
|
|
298
|
+
|
|
299
|
+
@schema
|
|
300
|
+
type pluginStructure = {
|
|
301
|
+
readModels: array<queryableDef>,
|
|
302
|
+
stateViewSlices: array<queryableDef>,
|
|
303
|
+
stateChangeSlices: array<writableDef>,
|
|
304
|
+
aggregates: array<writableDef>,
|
|
305
|
+
automationSlices: array<automationSliceDef>,
|
|
306
|
+
outboundTranslationSlices: array<outboundTranslationSliceDef>,
|
|
307
|
+
inboundTranslationSlices: array<inboundTranslationSliceDef>,
|
|
308
|
+
extensions: array<extensionDef>,
|
|
309
|
+
// Extension points owned by this plugin (producer side). Optional so plugin
|
|
310
|
+
// definitions persisted before this field existed still decode (absent → None,
|
|
311
|
+
// read as []). js_nullable keeps it JSON-safe inside union variant payloads.
|
|
312
|
+
extensionPoints: @s.matches(extensionPointDefArrayOptionSchema)
|
|
313
|
+
option<array<extensionPointDef>>,
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
let pluginStructureOptionSchema = _jsNullable(pluginStructureSchema, ())
|
|
317
|
+
|
|
318
|
+
// ── Event graph types (cross-plugin component graph) ──────────────────────────
|
|
319
|
+
|
|
320
|
+
@schema
|
|
321
|
+
type graphNode = {pluginName: string, componentName: string, kind: string}
|
|
322
|
+
|
|
323
|
+
@schema
|
|
324
|
+
type graphEdge = {
|
|
325
|
+
source: graphNode,
|
|
326
|
+
target: graphNode,
|
|
327
|
+
mechanism: string,
|
|
328
|
+
viaEvents: array<string>,
|
|
329
|
+
implicit: bool,
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@schema
|
|
333
|
+
type platformEventGraph = {nodes: array<graphNode>, edges: array<graphEdge>}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
The self-description of a deployed plugin, persisted in the plugin's event store.
|
|
337
|
+
|
|
338
|
+
Used by the gateway to discover extension points, extensions, and protocol versions.
|
|
339
|
+
The `eventCollector` field is mutable so it can be set after the heartbeat lambda
|
|
340
|
+
registers its own ARN.
|
|
341
|
+
*/
|
|
342
|
+
@schema
|
|
343
|
+
type pluginDefinition = {
|
|
344
|
+
id: string,
|
|
345
|
+
name: name,
|
|
346
|
+
version: version,
|
|
347
|
+
extensionPoints: array<extensionPointDefinition>,
|
|
348
|
+
extensions: array<extensionDefinition>,
|
|
349
|
+
mutable eventCollector: string,
|
|
350
|
+
// Protocol version declarations for each extension point this plugin connects to.
|
|
351
|
+
// Use [] when the plugin does not need version negotiation.
|
|
352
|
+
extensionProtocols: array<extensionProtocol>,
|
|
353
|
+
// GraphQL schema fragment contributed by this plugin (optional, set at build time).
|
|
354
|
+
// Uses @s.matches(apiSchemaFragmentOptionSchema) — js_nullable creates T | null
|
|
355
|
+
// (not T | undefined | null), which passes sury's jsonableValidation inside union variants.
|
|
356
|
+
apiSchemaFragment: @s.matches(apiSchemaFragmentOptionSchema) option<apiSchemaFragment>,
|
|
357
|
+
// API target for schema routing in split-API mode.
|
|
358
|
+
// None/"Domain" → fragment goes to the DomainApi (default).
|
|
359
|
+
// Some("Platform") → fragment goes to the PlatformApi; excluded from DomainApi runtime schema.
|
|
360
|
+
// Uses @s.matches(stringOptionSchema) — js_nullable creates string | null (not string | undefined),
|
|
361
|
+
// which passes sury's jsonableValidation inside union variant payloads.
|
|
362
|
+
apiTarget: @s.matches(stringOptionSchema) option<string>,
|
|
363
|
+
// UI fragment manifest contributed by this plugin (optional, absent for pure backend plugins).
|
|
364
|
+
uiFragments: @s.matches(uiFragmentManifestOptionSchema) option<uiFragmentManifest>,
|
|
365
|
+
// Component graph metadata — populated by makePluginDefinition; absent for older protocol versions.
|
|
366
|
+
structure: @s.matches(pluginStructureOptionSchema) option<pluginStructure>,
|
|
367
|
+
// DCB EventLog definition for plugins that bundle a DcbEventLog component.
|
|
368
|
+
// Carries the EventTopic ARN so the admin can provision cross-plugin SNS
|
|
369
|
+
// subscriptions from this plugin's DCB topic → peer EventCollectors.
|
|
370
|
+
// None for plugins without a DCB EventLog.
|
|
371
|
+
dcbEventLog: @s.matches(dcbEventLogOptionSchema) option<dcbEventLogDefinition>,
|
|
372
|
+
}
|
|
373
|
+
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as SuryResMjs from "sury/src/Sury.res.mjs";
|
|
5
|
+
|
|
6
|
+
let extensionPointDefinitionSchema = S.schema(s => ({
|
|
7
|
+
name: s.m(S.string),
|
|
8
|
+
commandTopic: s.m(S.string),
|
|
9
|
+
eventTopic: s.m(S.string)
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
let extensionDefinitionSchema = S.schema(s => ({
|
|
13
|
+
name: s.m(S.string),
|
|
14
|
+
extensionPointName: s.m(S.string),
|
|
15
|
+
dcbSources: s.m(S.array(S.string))
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
let dcbEventLogDefinitionSchema = S.schema(s => ({
|
|
19
|
+
name: s.m(S.string),
|
|
20
|
+
eventTopicArn: s.m(S.string)
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
let extensionProtocolSchema = S.schema(s => ({
|
|
24
|
+
extensionPointName: s.m(S.string),
|
|
25
|
+
commandVersion: s.m(S.string),
|
|
26
|
+
eventVersion: s.m(S.string)
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
let apiSchemaFragmentSchema = S.schema(s => ({
|
|
30
|
+
encoded: s.m(S.string),
|
|
31
|
+
protocol: s.m(S.string)
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
let apiSchemaFragmentOptionSchema = SuryResMjs.js_nullable(apiSchemaFragmentSchema);
|
|
35
|
+
|
|
36
|
+
let dcbEventLogOptionSchema = SuryResMjs.js_nullable(dcbEventLogDefinitionSchema);
|
|
37
|
+
|
|
38
|
+
let stringOptionSchema = SuryResMjs.js_nullable(S.string);
|
|
39
|
+
|
|
40
|
+
let stringArrayOptionSchema = SuryResMjs.js_nullable(S.array(S.string));
|
|
41
|
+
|
|
42
|
+
let boolOptionSchema = SuryResMjs.js_nullable(S.bool);
|
|
43
|
+
|
|
44
|
+
let panelManifestEntrySchema = S.schema(s => ({
|
|
45
|
+
fragmentId: s.m(S.string),
|
|
46
|
+
title: s.m(S.string),
|
|
47
|
+
description: s.m(S.string),
|
|
48
|
+
positions: s.m(S.array(S.string)),
|
|
49
|
+
requiredAccess: s.m(stringOptionSchema)
|
|
50
|
+
}));
|
|
51
|
+
|
|
52
|
+
let menuEntrySchema = S.schema(s => ({
|
|
53
|
+
label: s.m(S.string),
|
|
54
|
+
icon: s.m(stringOptionSchema),
|
|
55
|
+
group: s.m(stringOptionSchema),
|
|
56
|
+
sortOrder: s.m(S.int)
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
let pageManifestEntrySchema = S.schema(s => ({
|
|
60
|
+
fragmentId: s.m(S.string),
|
|
61
|
+
title: s.m(S.string),
|
|
62
|
+
menuEntry: s.m(menuEntrySchema),
|
|
63
|
+
requiredAccess: s.m(stringOptionSchema)
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
let uiFragmentManifestSchema = S.schema(s => ({
|
|
67
|
+
remoteEntryUrl: s.m(S.string),
|
|
68
|
+
panels: s.m(S.array(panelManifestEntrySchema)),
|
|
69
|
+
pages: s.m(S.array(pageManifestEntrySchema))
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
let uiFragmentManifestOptionSchema = SuryResMjs.js_nullable(uiFragmentManifestSchema);
|
|
73
|
+
|
|
74
|
+
let commandLevelSchema = S.union([
|
|
75
|
+
S.literal("Collection"),
|
|
76
|
+
S.literal("Instance")
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
let fieldReferenceSchema = S.schema(s => ({
|
|
80
|
+
fieldName: s.m(S.string),
|
|
81
|
+
entity: s.m(S.string),
|
|
82
|
+
plugin: s.m(stringOptionSchema)
|
|
83
|
+
}));
|
|
84
|
+
|
|
85
|
+
let commandDefSchema = S.schema(s => ({
|
|
86
|
+
name: s.m(S.string),
|
|
87
|
+
schema: s.m(S.string),
|
|
88
|
+
level: s.m(commandLevelSchema),
|
|
89
|
+
aggregateIdField: s.m(stringOptionSchema),
|
|
90
|
+
mutationField: s.m(S.string),
|
|
91
|
+
references: s.m(S.array(fieldReferenceSchema)),
|
|
92
|
+
allowedStates: s.m(stringArrayOptionSchema),
|
|
93
|
+
apiExposed: s.m(boolOptionSchema)
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
let queryableDefSchema = S.schema(s => ({
|
|
97
|
+
name: s.m(S.string),
|
|
98
|
+
queryField: s.m(S.string),
|
|
99
|
+
schema: s.m(S.string),
|
|
100
|
+
consumedEventTypes: s.m(S.array(S.string)),
|
|
101
|
+
linkedWriteSide: s.m(S.array(S.string)),
|
|
102
|
+
labelField: s.m(S.string),
|
|
103
|
+
searchableFields: s.m(S.array(S.string)),
|
|
104
|
+
statusField: s.m(stringOptionSchema),
|
|
105
|
+
visibility: s.m(stringOptionSchema)
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
let eventDefSchema = S.schema(s => ({
|
|
109
|
+
name: s.m(S.string),
|
|
110
|
+
schema: s.m(S.string),
|
|
111
|
+
references: s.m(S.array(fieldReferenceSchema))
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
let writableDefSchema = S.schema(s => ({
|
|
115
|
+
name: s.m(S.string),
|
|
116
|
+
commands: s.m(S.array(commandDefSchema)),
|
|
117
|
+
producedEventTypes: s.m(S.array(S.string)),
|
|
118
|
+
consumedEventTypes: s.m(S.array(S.string)),
|
|
119
|
+
linkedViews: s.m(S.array(S.string)),
|
|
120
|
+
consistencyRead: s.m(stringOptionSchema),
|
|
121
|
+
events: s.m(S.array(eventDefSchema))
|
|
122
|
+
}));
|
|
123
|
+
|
|
124
|
+
let automationSliceDefSchema = S.schema(s => ({
|
|
125
|
+
name: s.m(S.string),
|
|
126
|
+
consumedEventTypes: s.m(S.array(S.string)),
|
|
127
|
+
producedCommandTypes: s.m(S.array(S.string)),
|
|
128
|
+
targetName: s.m(S.string)
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
let outboundTranslationSliceDefSchema = S.schema(s => ({
|
|
132
|
+
name: s.m(S.string),
|
|
133
|
+
consumedEventTypes: s.m(S.array(S.string)),
|
|
134
|
+
inboundCommandTypes: s.m(S.array(S.string)),
|
|
135
|
+
targetName: s.m(stringOptionSchema)
|
|
136
|
+
}));
|
|
137
|
+
|
|
138
|
+
let inboundTranslationSliceDefSchema = S.schema(s => ({
|
|
139
|
+
name: s.m(S.string),
|
|
140
|
+
commandTypes: s.m(S.array(S.string)),
|
|
141
|
+
targetName: s.m(S.string)
|
|
142
|
+
}));
|
|
143
|
+
|
|
144
|
+
let extensionDefSchema = S.schema(s => ({
|
|
145
|
+
name: s.m(S.string),
|
|
146
|
+
delegateNames: s.m(S.array(S.string)),
|
|
147
|
+
eventTypes: s.m(S.array(S.string)),
|
|
148
|
+
commandTypes: s.m(S.array(S.string))
|
|
149
|
+
}));
|
|
150
|
+
|
|
151
|
+
let extensionPointDefSchema = S.schema(s => ({
|
|
152
|
+
name: s.m(S.string),
|
|
153
|
+
delegateNames: s.m(S.array(S.string)),
|
|
154
|
+
sourceEventTypes: s.m(S.array(S.string)),
|
|
155
|
+
commandTypes: s.m(stringArrayOptionSchema)
|
|
156
|
+
}));
|
|
157
|
+
|
|
158
|
+
let extensionPointDefArrayOptionSchema = SuryResMjs.js_nullable(S.array(extensionPointDefSchema));
|
|
159
|
+
|
|
160
|
+
let pluginStructureSchema = S.schema(s => ({
|
|
161
|
+
readModels: s.m(S.array(queryableDefSchema)),
|
|
162
|
+
stateViewSlices: s.m(S.array(queryableDefSchema)),
|
|
163
|
+
stateChangeSlices: s.m(S.array(writableDefSchema)),
|
|
164
|
+
aggregates: s.m(S.array(writableDefSchema)),
|
|
165
|
+
automationSlices: s.m(S.array(automationSliceDefSchema)),
|
|
166
|
+
outboundTranslationSlices: s.m(S.array(outboundTranslationSliceDefSchema)),
|
|
167
|
+
inboundTranslationSlices: s.m(S.array(inboundTranslationSliceDefSchema)),
|
|
168
|
+
extensions: s.m(S.array(extensionDefSchema)),
|
|
169
|
+
extensionPoints: s.m(extensionPointDefArrayOptionSchema)
|
|
170
|
+
}));
|
|
171
|
+
|
|
172
|
+
let pluginStructureOptionSchema = SuryResMjs.js_nullable(pluginStructureSchema);
|
|
173
|
+
|
|
174
|
+
let graphNodeSchema = S.schema(s => ({
|
|
175
|
+
pluginName: s.m(S.string),
|
|
176
|
+
componentName: s.m(S.string),
|
|
177
|
+
kind: s.m(S.string)
|
|
178
|
+
}));
|
|
179
|
+
|
|
180
|
+
let graphEdgeSchema = S.schema(s => ({
|
|
181
|
+
source: s.m(graphNodeSchema),
|
|
182
|
+
target: s.m(graphNodeSchema),
|
|
183
|
+
mechanism: s.m(S.string),
|
|
184
|
+
viaEvents: s.m(S.array(S.string)),
|
|
185
|
+
implicit: s.m(S.bool)
|
|
186
|
+
}));
|
|
187
|
+
|
|
188
|
+
let platformEventGraphSchema = S.schema(s => ({
|
|
189
|
+
nodes: s.m(S.array(graphNodeSchema)),
|
|
190
|
+
edges: s.m(S.array(graphEdgeSchema))
|
|
191
|
+
}));
|
|
192
|
+
|
|
193
|
+
let pluginDefinitionSchema = S.schema(s => ({
|
|
194
|
+
id: s.m(S.string),
|
|
195
|
+
name: s.m(S.string),
|
|
196
|
+
version: s.m(S.string),
|
|
197
|
+
extensionPoints: s.m(S.array(extensionPointDefinitionSchema)),
|
|
198
|
+
extensions: s.m(S.array(extensionDefinitionSchema)),
|
|
199
|
+
eventCollector: s.m(S.string),
|
|
200
|
+
extensionProtocols: s.m(S.array(extensionProtocolSchema)),
|
|
201
|
+
apiSchemaFragment: s.m(apiSchemaFragmentOptionSchema),
|
|
202
|
+
apiTarget: s.m(stringOptionSchema),
|
|
203
|
+
uiFragments: s.m(uiFragmentManifestOptionSchema),
|
|
204
|
+
structure: s.m(pluginStructureOptionSchema),
|
|
205
|
+
dcbEventLog: s.m(dcbEventLogOptionSchema)
|
|
206
|
+
}));
|
|
207
|
+
|
|
208
|
+
let nameSchema = S.string;
|
|
209
|
+
|
|
210
|
+
let versionSchema = S.string;
|
|
211
|
+
|
|
212
|
+
export {
|
|
213
|
+
nameSchema,
|
|
214
|
+
versionSchema,
|
|
215
|
+
extensionPointDefinitionSchema,
|
|
216
|
+
extensionDefinitionSchema,
|
|
217
|
+
dcbEventLogDefinitionSchema,
|
|
218
|
+
extensionProtocolSchema,
|
|
219
|
+
apiSchemaFragmentSchema,
|
|
220
|
+
apiSchemaFragmentOptionSchema,
|
|
221
|
+
dcbEventLogOptionSchema,
|
|
222
|
+
stringOptionSchema,
|
|
223
|
+
stringArrayOptionSchema,
|
|
224
|
+
boolOptionSchema,
|
|
225
|
+
panelManifestEntrySchema,
|
|
226
|
+
menuEntrySchema,
|
|
227
|
+
pageManifestEntrySchema,
|
|
228
|
+
uiFragmentManifestSchema,
|
|
229
|
+
uiFragmentManifestOptionSchema,
|
|
230
|
+
commandLevelSchema,
|
|
231
|
+
fieldReferenceSchema,
|
|
232
|
+
commandDefSchema,
|
|
233
|
+
queryableDefSchema,
|
|
234
|
+
eventDefSchema,
|
|
235
|
+
writableDefSchema,
|
|
236
|
+
automationSliceDefSchema,
|
|
237
|
+
outboundTranslationSliceDefSchema,
|
|
238
|
+
inboundTranslationSliceDefSchema,
|
|
239
|
+
extensionDefSchema,
|
|
240
|
+
extensionPointDefSchema,
|
|
241
|
+
extensionPointDefArrayOptionSchema,
|
|
242
|
+
pluginStructureSchema,
|
|
243
|
+
pluginStructureOptionSchema,
|
|
244
|
+
graphNodeSchema,
|
|
245
|
+
graphEdgeSchema,
|
|
246
|
+
platformEventGraphSchema,
|
|
247
|
+
pluginDefinitionSchema,
|
|
248
|
+
}
|
|
249
|
+
/* extensionPointDefinitionSchema Not a pure module */
|