@reventlessdev/reventless-spec 3.0.0-alpha.122 → 3.0.0-alpha.124

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.
@@ -183,18 +183,50 @@ let inboundTranslationSliceDefSchema = Sury.$schema(s => ({
183
183
  chapter: s.m(stringOptionSchema)
184
184
  }));
185
185
 
186
+ let publishedEventDefSchema = Sury.$schema(s => ({
187
+ name: s.m(Sury.string),
188
+ fromEventTypes: s.m(Sury.array(Sury.string))
189
+ }));
190
+
191
+ let publishedEventDefArrayOptionSchema = Sury.$nullAsOption(Sury.array(publishedEventDefSchema));
192
+
193
+ let acceptedCommandDefSchema = Sury.$schema(s => ({
194
+ name: s.m(Sury.string),
195
+ toCommandTypes: s.m(Sury.array(Sury.string))
196
+ }));
197
+
198
+ let acceptedCommandDefArrayOptionSchema = Sury.$nullAsOption(Sury.array(acceptedCommandDefSchema));
199
+
200
+ let handledEventDefSchema = Sury.$schema(s => ({
201
+ name: s.m(Sury.string),
202
+ toCommandTypes: s.m(Sury.array(Sury.string))
203
+ }));
204
+
205
+ let handledEventDefArrayOptionSchema = Sury.$nullAsOption(Sury.array(handledEventDefSchema));
206
+
207
+ let issuedCommandDefSchema = Sury.$schema(s => ({
208
+ name: s.m(Sury.string),
209
+ fromEventTypes: s.m(Sury.array(Sury.string))
210
+ }));
211
+
212
+ let issuedCommandDefArrayOptionSchema = Sury.$nullAsOption(Sury.array(issuedCommandDefSchema));
213
+
186
214
  let extensionDefSchema = Sury.$schema(s => ({
187
215
  name: s.m(Sury.string),
188
216
  delegateNames: s.m(Sury.array(Sury.string)),
189
217
  eventTypes: s.m(Sury.array(Sury.string)),
190
- commandTypes: s.m(Sury.array(Sury.string))
218
+ commandTypes: s.m(Sury.array(Sury.string)),
219
+ handledEvents: s.m(handledEventDefArrayOptionSchema),
220
+ issuedCommands: s.m(issuedCommandDefArrayOptionSchema)
191
221
  }));
192
222
 
193
223
  let extensionPointDefSchema = Sury.$schema(s => ({
194
224
  name: s.m(Sury.string),
195
225
  delegateNames: s.m(Sury.array(Sury.string)),
196
226
  sourceEventTypes: s.m(Sury.array(Sury.string)),
197
- commandTypes: s.m(stringArrayOptionSchema)
227
+ commandTypes: s.m(stringArrayOptionSchema),
228
+ publishedEvents: s.m(publishedEventDefArrayOptionSchema),
229
+ acceptedCommands: s.m(acceptedCommandDefArrayOptionSchema)
198
230
  }));
199
231
 
200
232
  let extensionPointDefArrayOptionSchema = Sury.$nullAsOption(Sury.array(extensionPointDefSchema));
@@ -269,6 +301,14 @@ export {
269
301
  automationSliceDefSchema,
270
302
  outboundTranslationSliceDefSchema,
271
303
  inboundTranslationSliceDefSchema,
304
+ publishedEventDefSchema,
305
+ publishedEventDefArrayOptionSchema,
306
+ acceptedCommandDefSchema,
307
+ acceptedCommandDefArrayOptionSchema,
308
+ handledEventDefSchema,
309
+ handledEventDefArrayOptionSchema,
310
+ issuedCommandDefSchema,
311
+ issuedCommandDefArrayOptionSchema,
272
312
  extensionDefSchema,
273
313
  extensionPointDefSchema,
274
314
  extensionPointDefArrayOptionSchema,
@@ -90,6 +90,10 @@ Configuration for a DynamoDB Global Secondary Index on a read model table.
90
90
  - `pkSep` / `skSep` — separator for composite pk/sk concatenation (default `"/"`)
91
91
  - `projectionType` — which attributes are projected into the index
92
92
  - `authorization` — optional AppSync authorization rule
93
+ - `derived` — the framework wrote this index, not the author. It keys a read the
94
+ generated resolvers already make (`@owner` scoping); no `<single>By<Index>`
95
+ door is emitted for it, since a door named after a key the author never
96
+ declared is noise on every published schema.
93
97
  */
94
98
  type indexConfig = {
95
99
  index: string,
@@ -102,8 +106,13 @@ type indexConfig = {
102
106
  skSep?: string,
103
107
  projectionType: projectionType,
104
108
  authorization?: authorization,
109
+ derived?: bool,
105
110
  }
106
111
 
112
+ /** Does this index carry an SDL door? Derived indexes serve a read the resolvers
113
+ already make and are provisioned without one. */
114
+ let isDerivedIndex = (ic: indexConfig) => ic.derived->Option.getOr(false)
115
+
107
116
  /**
108
117
  Composite-key configuration for a read model that has both a primary ID and a sub-ID.
109
118
 
@@ -1,5 +1,10 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
4
+
5
+ function isDerivedIndex(ic) {
6
+ return Stdlib_Option.getOr(ic.derived, false);
7
+ }
3
8
 
4
9
  function config(idResolversOpt, idsResolversOpt, indexesOpt) {
5
10
  let idResolvers = idResolversOpt !== undefined ? idResolversOpt : [];
@@ -13,6 +18,7 @@ function config(idResolversOpt, idsResolversOpt, indexesOpt) {
13
18
  }
14
19
 
15
20
  export {
21
+ isDerivedIndex,
16
22
  config,
17
23
  }
18
24
  /* No side effect */