@blitznocode/blitz-orm 0.7.4 → 0.8.0

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/dist/index.d.mts CHANGED
@@ -84,6 +84,191 @@ type DataFilter = RequireAtLeastOne<{
84
84
  $ge?: number | string;
85
85
  }>;
86
86
 
87
+ type BormField = {
88
+ path: string;
89
+ cardinality: CardinalityType;
90
+ ordered?: boolean;
91
+ embedded?: boolean;
92
+ rights?: readonly RightType[];
93
+ };
94
+ type RoleField = {
95
+ cardinality: CardinalityType;
96
+ dbConnector?: DBConnector;
97
+ };
98
+ type LinkField = BormField & {
99
+ relation: string;
100
+ plays: string;
101
+ } & ({
102
+ target: 'role';
103
+ filter?: Filter | Filter[];
104
+ } | {
105
+ target: 'relation';
106
+ });
107
+ type LinkedFieldWithThing = LinkField & {
108
+ thing: string;
109
+ thingType: ThingType;
110
+ };
111
+ type StringField = BormField & {
112
+ contentType: 'ID' | 'COLOR' | 'DATE' | 'FILE' | 'EMAIL' | 'PHONE' | 'URL' | 'PASSWORD' | 'LANGUAGE_TEXT' | 'RICH_TEXT' | 'TEXT';
113
+ default?: {
114
+ type: 'fn';
115
+ fn: (currentNode: BQLMutationBlock) => string;
116
+ } | {
117
+ type: 'value';
118
+ value: string;
119
+ };
120
+ validations?: {
121
+ enum?: string[];
122
+ unique?: boolean;
123
+ fn?: (value: string) => boolean;
124
+ };
125
+ };
126
+ type NumberField = BormField & {
127
+ contentType: 'DURATION' | 'HOUR' | 'RATING' | 'CURRENCY' | 'PERCENTAGE' | 'NUMBER_DECIMAL' | 'NUMBER';
128
+ default?: {
129
+ type: 'fn';
130
+ fn: (currentNode: BQLMutationBlock) => number;
131
+ } | {
132
+ type: 'value';
133
+ value: number;
134
+ };
135
+ validations?: {
136
+ enum?: number[];
137
+ unique?: boolean;
138
+ fn?: (value: number) => boolean;
139
+ };
140
+ };
141
+ type DateField = BormField & {
142
+ contentType: 'TIME';
143
+ default?: {
144
+ type: 'fn';
145
+ fn: (currentNode: BQLMutationBlock) => Date;
146
+ } | {
147
+ type: 'value';
148
+ value: Date;
149
+ };
150
+ validations?: {
151
+ enum: Date[];
152
+ fn?: (value: Date) => boolean;
153
+ };
154
+ };
155
+ type BooleanField = BormField & {
156
+ contentType: 'BOOLEAN';
157
+ default?: {
158
+ type: 'fn';
159
+ fn: (currentNode: BQLMutationBlock) => boolean;
160
+ } | {
161
+ type: 'value';
162
+ value: boolean;
163
+ };
164
+ validations?: {
165
+ enum?: boolean[];
166
+ fn?: (value: boolean) => boolean;
167
+ };
168
+ };
169
+ type AllDataField = StringField | NumberField | DateField | BooleanField;
170
+ type DataField = BormField & {
171
+ shared?: boolean;
172
+ validations?: {
173
+ required?: boolean;
174
+ unique?: boolean;
175
+ };
176
+ isVirtual?: boolean;
177
+ dbConnectors?: [DBConnector, ...DBConnector[]];
178
+ } & AllDataField;
179
+ type ContentType = keyof ContentTypeMapping;
180
+ type ContentTypeMapping = {
181
+ ID: string;
182
+ JSON: unknown;
183
+ COLOR: string;
184
+ BOOLEAN: boolean;
185
+ POINT: {
186
+ x: number;
187
+ y: number;
188
+ };
189
+ FILE: string;
190
+ EMAIL: string;
191
+ PHONE: string;
192
+ WEEK_DAY: 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday';
193
+ DURATION: number;
194
+ HOUR: number;
195
+ TIME: Date;
196
+ DATE: string;
197
+ RATING: number;
198
+ CURRENCY: number;
199
+ PERCENTAGE: number;
200
+ NUMBER_DECIMAL: number;
201
+ NUMBER: number;
202
+ URL: string;
203
+ PASSWORD: string;
204
+ LANGUAGE_TEXT: string;
205
+ RICH_TEXT: string;
206
+ TEXT: string;
207
+ };
208
+ type CardinalityType = 'ONE' | 'MANY' | 'INTERVAL';
209
+ type RightType = 'CREATE' | 'DELETE' | 'UPDATE' | 'LINK' | 'UNLINK';
210
+ type BQLFieldObj = {
211
+ $path: string;
212
+ $as?: string;
213
+ } & Omit<RawBQLQuery, '$entity' | '$relation' | '$thing' | '$thingType'>;
214
+ type BQLField = string | BQLFieldObj;
215
+
216
+ type EnrichedBormSchema = {
217
+ entities: {
218
+ [s: string]: EnrichedBormEntity;
219
+ };
220
+ relations: {
221
+ [s: string]: EnrichedBormRelation;
222
+ };
223
+ };
224
+ type EnrichedBormEntity = Omit<BormEntity, 'linkFields' | 'idFields' | 'dataFields'> & {
225
+ extends?: string;
226
+ allExtends?: string[];
227
+ idFields: string[];
228
+ thingType: 'entity';
229
+ name: string;
230
+ computedFields: string[];
231
+ virtualFields: string[];
232
+ requiredFields: string[];
233
+ enumFields: string[];
234
+ linkFields?: EnrichedLinkField[];
235
+ dataFields?: EnrichedDataField[];
236
+ };
237
+ type EnrichedBormRelation = Omit<BormRelation, 'linkFields' | 'dataFields'> & {
238
+ thingType: 'relation';
239
+ name: string;
240
+ computedFields: string[];
241
+ virtualFields: string[];
242
+ requiredFields: string[];
243
+ enumFields: string[];
244
+ linkFields?: EnrichedLinkField[];
245
+ dataFields?: EnrichedDataField[];
246
+ roles: {
247
+ [key: string]: EnrichedRoleField;
248
+ };
249
+ };
250
+ type EnrichedRoleField = RoleField & {
251
+ playedBy?: LinkedFieldWithThing[];
252
+ name: string;
253
+ };
254
+ type EnrichedDataField = DataField & {
255
+ dbPath: string;
256
+ };
257
+ type EnrichedLinkField = BormField & {
258
+ name: string;
259
+ relation: string;
260
+ plays: string;
261
+ } & ({
262
+ target: 'role';
263
+ filter?: Filter | Filter[];
264
+ oppositeLinkFieldsPlayedBy: LinkedFieldWithThing[];
265
+ } | {
266
+ target: 'relation';
267
+ oppositeLinkFieldsPlayedBy: Pick<LinkedFieldWithThing, 'thing' | 'thingType' | 'plays'>[];
268
+ });
269
+
270
+ declare const Schema: unique symbol;
271
+
87
272
  type RequiredKey<T, K extends keyof T> = T & {
88
273
  [P in K]-?: T[P];
89
274
  };
@@ -102,7 +287,10 @@ type BQLMutationBlock = {
102
287
  $thing: string;
103
288
  $thingType: 'entity' | 'relation';
104
289
  });
105
- type FilledBQLMutationBlock = WithRequired<BQLMutationBlock, '$tempId' | '$op'>;
290
+ type FilledBQLMutationBlock = WithRequired<BQLMutationBlock, '$tempId' | '$op'> & {
291
+ $entity?: string;
292
+ [Schema]: EnrichedBormEntity | EnrichedBormRelation;
293
+ };
106
294
  type RawBQLMutation<T extends Record<string, any> = Record<string, any>> = ({
107
295
  $id?: string;
108
296
  $op?: 'create' | 'delete' | 'update';
@@ -216,125 +404,6 @@ type Action = {
216
404
  fn: (entity: FilledBQLMutationBlock) => Partial<FilledBQLMutationBlock>;
217
405
  };
218
406
 
219
- type BormField = {
220
- path: string;
221
- cardinality: CardinalityType;
222
- ordered?: boolean;
223
- embedded?: boolean;
224
- rights?: readonly RightType[];
225
- };
226
- type RoleField = {
227
- cardinality: CardinalityType;
228
- dbConnector?: DBConnector;
229
- };
230
- type LinkField = BormField & {
231
- relation: string;
232
- plays: string;
233
- } & ({
234
- target: 'role';
235
- filter?: Filter | Filter[];
236
- } | {
237
- target: 'relation';
238
- });
239
- type LinkedFieldWithThing = LinkField & {
240
- thing: string;
241
- thingType: ThingType;
242
- };
243
- type DataField = BormField & {
244
- shared?: boolean;
245
- default?: any;
246
- contentType: ContentType;
247
- validations?: any;
248
- isVirtual?: boolean;
249
- dbConnectors?: [DBConnector, ...DBConnector[]];
250
- };
251
- type ContentType = 'ID' | 'JSON' | 'COLOR' | 'BOOLEAN' | 'POINT' | 'FILE' | 'EMAIL' | 'PHONE' | 'WEEK_DAY' | 'DURATION' | 'HOUR' | 'TIME' | 'DATE' | 'RATING' | 'CURRENCY' | 'PERCENTAGE' | 'NUMBER_DECIMAL' | 'NUMBER' | 'URL' | 'PASSWORD' | 'LANGUAGE_TEXT' | 'RICH_TEXT' | 'TEXT';
252
- type ContentTypeMapping = {
253
- ID: string;
254
- JSON: any;
255
- COLOR: string;
256
- BOOLEAN: boolean;
257
- POINT: {
258
- x: number;
259
- y: number;
260
- };
261
- FILE: string;
262
- EMAIL: string;
263
- PHONE: string;
264
- WEEK_DAY: 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday';
265
- DURATION: number;
266
- HOUR: number;
267
- TIME: Date;
268
- DATE: Date;
269
- RATING: number;
270
- CURRENCY: number;
271
- PERCENTAGE: number;
272
- NUMBER_DECIMAL: number;
273
- NUMBER: number;
274
- URL: string;
275
- PASSWORD: string;
276
- LANGUAGE_TEXT: string;
277
- RICH_TEXT: string;
278
- TEXT: string;
279
- };
280
- type CardinalityType = 'ONE' | 'MANY' | 'INTERVAL';
281
- type RightType = 'CREATE' | 'DELETE' | 'UPDATE' | 'LINK' | 'UNLINK';
282
- type BQLFieldObj = {
283
- $path: string;
284
- $as?: string;
285
- } & Omit<RawBQLQuery, '$entity' | '$relation' | '$thing' | '$thingType'>;
286
- type BQLField = string | BQLFieldObj;
287
-
288
- type EnrichedBormSchema = {
289
- entities: {
290
- [s: string]: EnrichedBormEntity;
291
- };
292
- relations: {
293
- [s: string]: EnrichedBormRelation;
294
- };
295
- };
296
- type EnrichedBormEntity = Omit<BormEntity, 'linkFields' | 'idFields' | 'dataFields'> & {
297
- extends?: string;
298
- allExtends?: string[];
299
- idFields: string[];
300
- thingType: 'entity';
301
- name: string;
302
- computedFields: string[];
303
- virtualFields: string[];
304
- linkFields?: EnrichedLinkField[];
305
- dataFields?: EnrichedDataField[];
306
- };
307
- type EnrichedBormRelation = Omit<BormRelation, 'linkFields' | 'dataFields'> & {
308
- thingType: 'relation';
309
- name: string;
310
- computedFields: string[];
311
- virtualFields: string[];
312
- linkFields?: EnrichedLinkField[];
313
- dataFields?: EnrichedDataField[];
314
- roles: {
315
- [key: string]: EnrichedRoleField;
316
- };
317
- };
318
- type EnrichedRoleField = RoleField & {
319
- playedBy?: LinkedFieldWithThing[];
320
- name: string;
321
- };
322
- type EnrichedDataField = DataField & {
323
- dbPath: string;
324
- };
325
- type EnrichedLinkField = BormField & {
326
- name: string;
327
- relation: string;
328
- plays: string;
329
- } & ({
330
- target: 'role';
331
- filter?: Filter | Filter[];
332
- oppositeLinkFieldsPlayedBy: LinkedFieldWithThing[];
333
- } | {
334
- target: 'relation';
335
- oppositeLinkFieldsPlayedBy: Pick<LinkedFieldWithThing, 'thing' | 'thingType' | 'plays'>[];
336
- });
337
-
338
407
  type ContentTypeToType<C extends keyof ContentTypeMapping> = ContentTypeMapping[C];
339
408
  type HandleCardinality<T, C extends 'ONE' | 'MANY'> = C extends 'MANY' ? T[] : T;
340
409
  type ContentTypeAndCardinality = {
package/dist/index.d.ts CHANGED
@@ -84,6 +84,191 @@ type DataFilter = RequireAtLeastOne<{
84
84
  $ge?: number | string;
85
85
  }>;
86
86
 
87
+ type BormField = {
88
+ path: string;
89
+ cardinality: CardinalityType;
90
+ ordered?: boolean;
91
+ embedded?: boolean;
92
+ rights?: readonly RightType[];
93
+ };
94
+ type RoleField = {
95
+ cardinality: CardinalityType;
96
+ dbConnector?: DBConnector;
97
+ };
98
+ type LinkField = BormField & {
99
+ relation: string;
100
+ plays: string;
101
+ } & ({
102
+ target: 'role';
103
+ filter?: Filter | Filter[];
104
+ } | {
105
+ target: 'relation';
106
+ });
107
+ type LinkedFieldWithThing = LinkField & {
108
+ thing: string;
109
+ thingType: ThingType;
110
+ };
111
+ type StringField = BormField & {
112
+ contentType: 'ID' | 'COLOR' | 'DATE' | 'FILE' | 'EMAIL' | 'PHONE' | 'URL' | 'PASSWORD' | 'LANGUAGE_TEXT' | 'RICH_TEXT' | 'TEXT';
113
+ default?: {
114
+ type: 'fn';
115
+ fn: (currentNode: BQLMutationBlock) => string;
116
+ } | {
117
+ type: 'value';
118
+ value: string;
119
+ };
120
+ validations?: {
121
+ enum?: string[];
122
+ unique?: boolean;
123
+ fn?: (value: string) => boolean;
124
+ };
125
+ };
126
+ type NumberField = BormField & {
127
+ contentType: 'DURATION' | 'HOUR' | 'RATING' | 'CURRENCY' | 'PERCENTAGE' | 'NUMBER_DECIMAL' | 'NUMBER';
128
+ default?: {
129
+ type: 'fn';
130
+ fn: (currentNode: BQLMutationBlock) => number;
131
+ } | {
132
+ type: 'value';
133
+ value: number;
134
+ };
135
+ validations?: {
136
+ enum?: number[];
137
+ unique?: boolean;
138
+ fn?: (value: number) => boolean;
139
+ };
140
+ };
141
+ type DateField = BormField & {
142
+ contentType: 'TIME';
143
+ default?: {
144
+ type: 'fn';
145
+ fn: (currentNode: BQLMutationBlock) => Date;
146
+ } | {
147
+ type: 'value';
148
+ value: Date;
149
+ };
150
+ validations?: {
151
+ enum: Date[];
152
+ fn?: (value: Date) => boolean;
153
+ };
154
+ };
155
+ type BooleanField = BormField & {
156
+ contentType: 'BOOLEAN';
157
+ default?: {
158
+ type: 'fn';
159
+ fn: (currentNode: BQLMutationBlock) => boolean;
160
+ } | {
161
+ type: 'value';
162
+ value: boolean;
163
+ };
164
+ validations?: {
165
+ enum?: boolean[];
166
+ fn?: (value: boolean) => boolean;
167
+ };
168
+ };
169
+ type AllDataField = StringField | NumberField | DateField | BooleanField;
170
+ type DataField = BormField & {
171
+ shared?: boolean;
172
+ validations?: {
173
+ required?: boolean;
174
+ unique?: boolean;
175
+ };
176
+ isVirtual?: boolean;
177
+ dbConnectors?: [DBConnector, ...DBConnector[]];
178
+ } & AllDataField;
179
+ type ContentType = keyof ContentTypeMapping;
180
+ type ContentTypeMapping = {
181
+ ID: string;
182
+ JSON: unknown;
183
+ COLOR: string;
184
+ BOOLEAN: boolean;
185
+ POINT: {
186
+ x: number;
187
+ y: number;
188
+ };
189
+ FILE: string;
190
+ EMAIL: string;
191
+ PHONE: string;
192
+ WEEK_DAY: 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday';
193
+ DURATION: number;
194
+ HOUR: number;
195
+ TIME: Date;
196
+ DATE: string;
197
+ RATING: number;
198
+ CURRENCY: number;
199
+ PERCENTAGE: number;
200
+ NUMBER_DECIMAL: number;
201
+ NUMBER: number;
202
+ URL: string;
203
+ PASSWORD: string;
204
+ LANGUAGE_TEXT: string;
205
+ RICH_TEXT: string;
206
+ TEXT: string;
207
+ };
208
+ type CardinalityType = 'ONE' | 'MANY' | 'INTERVAL';
209
+ type RightType = 'CREATE' | 'DELETE' | 'UPDATE' | 'LINK' | 'UNLINK';
210
+ type BQLFieldObj = {
211
+ $path: string;
212
+ $as?: string;
213
+ } & Omit<RawBQLQuery, '$entity' | '$relation' | '$thing' | '$thingType'>;
214
+ type BQLField = string | BQLFieldObj;
215
+
216
+ type EnrichedBormSchema = {
217
+ entities: {
218
+ [s: string]: EnrichedBormEntity;
219
+ };
220
+ relations: {
221
+ [s: string]: EnrichedBormRelation;
222
+ };
223
+ };
224
+ type EnrichedBormEntity = Omit<BormEntity, 'linkFields' | 'idFields' | 'dataFields'> & {
225
+ extends?: string;
226
+ allExtends?: string[];
227
+ idFields: string[];
228
+ thingType: 'entity';
229
+ name: string;
230
+ computedFields: string[];
231
+ virtualFields: string[];
232
+ requiredFields: string[];
233
+ enumFields: string[];
234
+ linkFields?: EnrichedLinkField[];
235
+ dataFields?: EnrichedDataField[];
236
+ };
237
+ type EnrichedBormRelation = Omit<BormRelation, 'linkFields' | 'dataFields'> & {
238
+ thingType: 'relation';
239
+ name: string;
240
+ computedFields: string[];
241
+ virtualFields: string[];
242
+ requiredFields: string[];
243
+ enumFields: string[];
244
+ linkFields?: EnrichedLinkField[];
245
+ dataFields?: EnrichedDataField[];
246
+ roles: {
247
+ [key: string]: EnrichedRoleField;
248
+ };
249
+ };
250
+ type EnrichedRoleField = RoleField & {
251
+ playedBy?: LinkedFieldWithThing[];
252
+ name: string;
253
+ };
254
+ type EnrichedDataField = DataField & {
255
+ dbPath: string;
256
+ };
257
+ type EnrichedLinkField = BormField & {
258
+ name: string;
259
+ relation: string;
260
+ plays: string;
261
+ } & ({
262
+ target: 'role';
263
+ filter?: Filter | Filter[];
264
+ oppositeLinkFieldsPlayedBy: LinkedFieldWithThing[];
265
+ } | {
266
+ target: 'relation';
267
+ oppositeLinkFieldsPlayedBy: Pick<LinkedFieldWithThing, 'thing' | 'thingType' | 'plays'>[];
268
+ });
269
+
270
+ declare const Schema: unique symbol;
271
+
87
272
  type RequiredKey<T, K extends keyof T> = T & {
88
273
  [P in K]-?: T[P];
89
274
  };
@@ -102,7 +287,10 @@ type BQLMutationBlock = {
102
287
  $thing: string;
103
288
  $thingType: 'entity' | 'relation';
104
289
  });
105
- type FilledBQLMutationBlock = WithRequired<BQLMutationBlock, '$tempId' | '$op'>;
290
+ type FilledBQLMutationBlock = WithRequired<BQLMutationBlock, '$tempId' | '$op'> & {
291
+ $entity?: string;
292
+ [Schema]: EnrichedBormEntity | EnrichedBormRelation;
293
+ };
106
294
  type RawBQLMutation<T extends Record<string, any> = Record<string, any>> = ({
107
295
  $id?: string;
108
296
  $op?: 'create' | 'delete' | 'update';
@@ -216,125 +404,6 @@ type Action = {
216
404
  fn: (entity: FilledBQLMutationBlock) => Partial<FilledBQLMutationBlock>;
217
405
  };
218
406
 
219
- type BormField = {
220
- path: string;
221
- cardinality: CardinalityType;
222
- ordered?: boolean;
223
- embedded?: boolean;
224
- rights?: readonly RightType[];
225
- };
226
- type RoleField = {
227
- cardinality: CardinalityType;
228
- dbConnector?: DBConnector;
229
- };
230
- type LinkField = BormField & {
231
- relation: string;
232
- plays: string;
233
- } & ({
234
- target: 'role';
235
- filter?: Filter | Filter[];
236
- } | {
237
- target: 'relation';
238
- });
239
- type LinkedFieldWithThing = LinkField & {
240
- thing: string;
241
- thingType: ThingType;
242
- };
243
- type DataField = BormField & {
244
- shared?: boolean;
245
- default?: any;
246
- contentType: ContentType;
247
- validations?: any;
248
- isVirtual?: boolean;
249
- dbConnectors?: [DBConnector, ...DBConnector[]];
250
- };
251
- type ContentType = 'ID' | 'JSON' | 'COLOR' | 'BOOLEAN' | 'POINT' | 'FILE' | 'EMAIL' | 'PHONE' | 'WEEK_DAY' | 'DURATION' | 'HOUR' | 'TIME' | 'DATE' | 'RATING' | 'CURRENCY' | 'PERCENTAGE' | 'NUMBER_DECIMAL' | 'NUMBER' | 'URL' | 'PASSWORD' | 'LANGUAGE_TEXT' | 'RICH_TEXT' | 'TEXT';
252
- type ContentTypeMapping = {
253
- ID: string;
254
- JSON: any;
255
- COLOR: string;
256
- BOOLEAN: boolean;
257
- POINT: {
258
- x: number;
259
- y: number;
260
- };
261
- FILE: string;
262
- EMAIL: string;
263
- PHONE: string;
264
- WEEK_DAY: 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday';
265
- DURATION: number;
266
- HOUR: number;
267
- TIME: Date;
268
- DATE: Date;
269
- RATING: number;
270
- CURRENCY: number;
271
- PERCENTAGE: number;
272
- NUMBER_DECIMAL: number;
273
- NUMBER: number;
274
- URL: string;
275
- PASSWORD: string;
276
- LANGUAGE_TEXT: string;
277
- RICH_TEXT: string;
278
- TEXT: string;
279
- };
280
- type CardinalityType = 'ONE' | 'MANY' | 'INTERVAL';
281
- type RightType = 'CREATE' | 'DELETE' | 'UPDATE' | 'LINK' | 'UNLINK';
282
- type BQLFieldObj = {
283
- $path: string;
284
- $as?: string;
285
- } & Omit<RawBQLQuery, '$entity' | '$relation' | '$thing' | '$thingType'>;
286
- type BQLField = string | BQLFieldObj;
287
-
288
- type EnrichedBormSchema = {
289
- entities: {
290
- [s: string]: EnrichedBormEntity;
291
- };
292
- relations: {
293
- [s: string]: EnrichedBormRelation;
294
- };
295
- };
296
- type EnrichedBormEntity = Omit<BormEntity, 'linkFields' | 'idFields' | 'dataFields'> & {
297
- extends?: string;
298
- allExtends?: string[];
299
- idFields: string[];
300
- thingType: 'entity';
301
- name: string;
302
- computedFields: string[];
303
- virtualFields: string[];
304
- linkFields?: EnrichedLinkField[];
305
- dataFields?: EnrichedDataField[];
306
- };
307
- type EnrichedBormRelation = Omit<BormRelation, 'linkFields' | 'dataFields'> & {
308
- thingType: 'relation';
309
- name: string;
310
- computedFields: string[];
311
- virtualFields: string[];
312
- linkFields?: EnrichedLinkField[];
313
- dataFields?: EnrichedDataField[];
314
- roles: {
315
- [key: string]: EnrichedRoleField;
316
- };
317
- };
318
- type EnrichedRoleField = RoleField & {
319
- playedBy?: LinkedFieldWithThing[];
320
- name: string;
321
- };
322
- type EnrichedDataField = DataField & {
323
- dbPath: string;
324
- };
325
- type EnrichedLinkField = BormField & {
326
- name: string;
327
- relation: string;
328
- plays: string;
329
- } & ({
330
- target: 'role';
331
- filter?: Filter | Filter[];
332
- oppositeLinkFieldsPlayedBy: LinkedFieldWithThing[];
333
- } | {
334
- target: 'relation';
335
- oppositeLinkFieldsPlayedBy: Pick<LinkedFieldWithThing, 'thing' | 'thingType' | 'plays'>[];
336
- });
337
-
338
407
  type ContentTypeToType<C extends keyof ContentTypeMapping> = ContentTypeMapping[C];
339
408
  type HandleCardinality<T, C extends 'ONE' | 'MANY'> = C extends 'MANY' ? T[] : T;
340
409
  type ContentTypeAndCardinality = {