@api-client/core 0.18.23 → 0.18.25
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/build/src/modeling/DomainEntity.d.ts +6 -1
- package/build/src/modeling/DomainEntity.d.ts.map +1 -1
- package/build/src/modeling/DomainEntity.js +24 -5
- package/build/src/modeling/DomainEntity.js.map +1 -1
- package/build/src/modeling/Semantics.d.ts +68 -0
- package/build/src/modeling/Semantics.d.ts.map +1 -1
- package/build/src/modeling/Semantics.js +217 -0
- package/build/src/modeling/Semantics.js.map +1 -1
- package/build/src/modeling/definitions/Email.d.ts +0 -4
- package/build/src/modeling/definitions/Email.d.ts.map +1 -1
- package/build/src/modeling/definitions/Email.js +1 -2
- package/build/src/modeling/definitions/Email.js.map +1 -1
- package/build/src/modeling/definitions/Password.d.ts.map +1 -1
- package/build/src/modeling/definitions/Password.js +1 -3
- package/build/src/modeling/definitions/Password.js.map +1 -1
- package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
- package/build/src/modeling/helpers/Intelisense.js +24 -58
- package/build/src/modeling/helpers/Intelisense.js.map +1 -1
- package/build/src/modeling/helpers/database.js +2 -2
- package/build/src/modeling/helpers/database.js.map +1 -1
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js +3 -3
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +1 -1
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js +5 -5
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +20 -20
- package/package.json +1 -1
- package/src/modeling/DomainEntity.ts +27 -5
- package/src/modeling/Semantics.ts +254 -0
- package/src/modeling/definitions/Email.ts +1 -6
- package/src/modeling/definitions/Password.ts +1 -3
- package/src/modeling/helpers/Intelisense.ts +26 -58
- package/src/modeling/helpers/database.ts +2 -2
- package/src/modeling/templates/verticals/business-services/ecommerce-domain.ts +3 -3
- package/src/modeling/templates/verticals/technology-media/blog-domain.ts +5 -5
- package/tests/unit/modeling/definitions/email.spec.ts +0 -1
- package/tests/unit/modeling/definitions/password.spec.ts +0 -2
- package/tests/unit/modeling/domain_entity_parents.spec.ts +243 -0
- package/tests/unit/modeling/semantic-configs.spec.ts +0 -1
- package/tests/unit/modeling/semantic_runtime.spec.ts +113 -0
- package/tests/unit/modeling/semantics.spec.ts +68 -0
|
@@ -254,6 +254,42 @@ export var SemanticCategory;
|
|
|
254
254
|
*/
|
|
255
255
|
SemanticCategory["Computed"] = "Computed Values";
|
|
256
256
|
})(SemanticCategory || (SemanticCategory = {}));
|
|
257
|
+
/**
|
|
258
|
+
* Defines when a semantic should execute in relation to database operations.
|
|
259
|
+
*/
|
|
260
|
+
export var SemanticTiming;
|
|
261
|
+
(function (SemanticTiming) {
|
|
262
|
+
/**
|
|
263
|
+
* Execute before the database operation (validation, preprocessing)
|
|
264
|
+
*/
|
|
265
|
+
SemanticTiming["Before"] = "Before";
|
|
266
|
+
/**
|
|
267
|
+
* Execute after the database operation (cleanup, notifications, derived values)
|
|
268
|
+
*/
|
|
269
|
+
SemanticTiming["After"] = "After";
|
|
270
|
+
/**
|
|
271
|
+
* Execute both before and after the operation
|
|
272
|
+
*/
|
|
273
|
+
SemanticTiming["Both"] = "Both";
|
|
274
|
+
/**
|
|
275
|
+
* No automatic execution (manual/on-demand only)
|
|
276
|
+
*/
|
|
277
|
+
SemanticTiming["None"] = "None";
|
|
278
|
+
})(SemanticTiming || (SemanticTiming = {}));
|
|
279
|
+
/**
|
|
280
|
+
* Defines which database operations can trigger a semantic.
|
|
281
|
+
*/
|
|
282
|
+
export var SemanticOperation;
|
|
283
|
+
(function (SemanticOperation) {
|
|
284
|
+
SemanticOperation["Create"] = "Create";
|
|
285
|
+
SemanticOperation["Read"] = "Read";
|
|
286
|
+
SemanticOperation["Update"] = "Update";
|
|
287
|
+
SemanticOperation["Delete"] = "Delete";
|
|
288
|
+
/**
|
|
289
|
+
* Special operation for list/query operations
|
|
290
|
+
*/
|
|
291
|
+
SemanticOperation["List"] = "List";
|
|
292
|
+
})(SemanticOperation || (SemanticOperation = {}));
|
|
257
293
|
/**
|
|
258
294
|
* A type guard to check if a semantic is an EntitySemantic.
|
|
259
295
|
*/
|
|
@@ -281,6 +317,10 @@ export const DataSemantics = {
|
|
|
281
317
|
description: 'System users and accounts',
|
|
282
318
|
category: SemanticCategory.Identity,
|
|
283
319
|
hasConfig: false,
|
|
320
|
+
runtime: {
|
|
321
|
+
timing: SemanticTiming.None,
|
|
322
|
+
operations: [],
|
|
323
|
+
},
|
|
284
324
|
},
|
|
285
325
|
[SemanticType.Password]: {
|
|
286
326
|
id: SemanticType.Password,
|
|
@@ -290,6 +330,12 @@ export const DataSemantics = {
|
|
|
290
330
|
category: SemanticCategory.Identity,
|
|
291
331
|
applicableDataTypes: ['string'],
|
|
292
332
|
hasConfig: true,
|
|
333
|
+
runtime: {
|
|
334
|
+
timing: SemanticTiming.Before,
|
|
335
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
336
|
+
priority: 10, // High priority for security
|
|
337
|
+
canDisable: false, // Security semantics cannot be disabled
|
|
338
|
+
},
|
|
293
339
|
},
|
|
294
340
|
[SemanticType.UserRole]: {
|
|
295
341
|
id: SemanticType.UserRole,
|
|
@@ -299,6 +345,17 @@ export const DataSemantics = {
|
|
|
299
345
|
category: SemanticCategory.Identity,
|
|
300
346
|
applicableDataTypes: ['string'],
|
|
301
347
|
hasConfig: false,
|
|
348
|
+
runtime: {
|
|
349
|
+
timing: SemanticTiming.Before,
|
|
350
|
+
operations: [
|
|
351
|
+
SemanticOperation.Create,
|
|
352
|
+
SemanticOperation.Read,
|
|
353
|
+
SemanticOperation.Update,
|
|
354
|
+
SemanticOperation.Delete,
|
|
355
|
+
SemanticOperation.List,
|
|
356
|
+
],
|
|
357
|
+
priority: 20,
|
|
358
|
+
},
|
|
302
359
|
},
|
|
303
360
|
[SemanticType.ResourceOwnerIdentifier]: {
|
|
304
361
|
id: SemanticType.ResourceOwnerIdentifier,
|
|
@@ -307,6 +364,18 @@ export const DataSemantics = {
|
|
|
307
364
|
description: 'Links record to owner user',
|
|
308
365
|
category: SemanticCategory.Identity,
|
|
309
366
|
hasConfig: false,
|
|
367
|
+
runtime: {
|
|
368
|
+
timing: SemanticTiming.Before,
|
|
369
|
+
operations: [
|
|
370
|
+
SemanticOperation.Create,
|
|
371
|
+
SemanticOperation.Read,
|
|
372
|
+
SemanticOperation.Update,
|
|
373
|
+
SemanticOperation.Delete,
|
|
374
|
+
SemanticOperation.List,
|
|
375
|
+
],
|
|
376
|
+
priority: 5, // Very high priority for access control
|
|
377
|
+
canDisable: false,
|
|
378
|
+
},
|
|
310
379
|
},
|
|
311
380
|
//
|
|
312
381
|
// Timestamps & Versioning
|
|
@@ -319,6 +388,11 @@ export const DataSemantics = {
|
|
|
319
388
|
category: SemanticCategory.Lifecycle,
|
|
320
389
|
applicableDataTypes: ['datetime'],
|
|
321
390
|
hasConfig: false,
|
|
391
|
+
runtime: {
|
|
392
|
+
timing: SemanticTiming.Before,
|
|
393
|
+
operations: [SemanticOperation.Create],
|
|
394
|
+
priority: 90,
|
|
395
|
+
},
|
|
322
396
|
},
|
|
323
397
|
[SemanticType.UpdatedTimestamp]: {
|
|
324
398
|
id: SemanticType.UpdatedTimestamp,
|
|
@@ -328,6 +402,11 @@ export const DataSemantics = {
|
|
|
328
402
|
category: SemanticCategory.Lifecycle,
|
|
329
403
|
applicableDataTypes: ['datetime'],
|
|
330
404
|
hasConfig: false,
|
|
405
|
+
runtime: {
|
|
406
|
+
timing: SemanticTiming.Before,
|
|
407
|
+
operations: [SemanticOperation.Update],
|
|
408
|
+
priority: 90,
|
|
409
|
+
},
|
|
331
410
|
},
|
|
332
411
|
[SemanticType.DeletedTimestamp]: {
|
|
333
412
|
id: SemanticType.DeletedTimestamp,
|
|
@@ -337,6 +416,11 @@ export const DataSemantics = {
|
|
|
337
416
|
category: SemanticCategory.Lifecycle,
|
|
338
417
|
applicableDataTypes: ['datetime'],
|
|
339
418
|
hasConfig: false,
|
|
419
|
+
runtime: {
|
|
420
|
+
timing: SemanticTiming.Before,
|
|
421
|
+
operations: [SemanticOperation.Delete],
|
|
422
|
+
priority: 80,
|
|
423
|
+
},
|
|
340
424
|
},
|
|
341
425
|
[SemanticType.DeletedFlag]: {
|
|
342
426
|
id: SemanticType.DeletedFlag,
|
|
@@ -346,6 +430,11 @@ export const DataSemantics = {
|
|
|
346
430
|
category: SemanticCategory.Lifecycle,
|
|
347
431
|
applicableDataTypes: ['boolean'],
|
|
348
432
|
hasConfig: false,
|
|
433
|
+
runtime: {
|
|
434
|
+
timing: SemanticTiming.Before,
|
|
435
|
+
operations: [SemanticOperation.Delete, SemanticOperation.Read, SemanticOperation.List],
|
|
436
|
+
priority: 80,
|
|
437
|
+
},
|
|
349
438
|
},
|
|
350
439
|
[SemanticType.Version]: {
|
|
351
440
|
id: SemanticType.Version,
|
|
@@ -355,6 +444,11 @@ export const DataSemantics = {
|
|
|
355
444
|
category: SemanticCategory.Lifecycle,
|
|
356
445
|
applicableDataTypes: ['number'],
|
|
357
446
|
hasConfig: false,
|
|
447
|
+
runtime: {
|
|
448
|
+
timing: SemanticTiming.Before,
|
|
449
|
+
operations: [SemanticOperation.Update],
|
|
450
|
+
priority: 85,
|
|
451
|
+
},
|
|
358
452
|
},
|
|
359
453
|
//
|
|
360
454
|
// Content & Media
|
|
@@ -367,6 +461,10 @@ export const DataSemantics = {
|
|
|
367
461
|
category: SemanticCategory.Content,
|
|
368
462
|
applicableDataTypes: ['string'],
|
|
369
463
|
hasConfig: false,
|
|
464
|
+
runtime: {
|
|
465
|
+
timing: SemanticTiming.None,
|
|
466
|
+
operations: [],
|
|
467
|
+
},
|
|
370
468
|
},
|
|
371
469
|
[SemanticType.Description]: {
|
|
372
470
|
id: SemanticType.Description,
|
|
@@ -376,6 +474,10 @@ export const DataSemantics = {
|
|
|
376
474
|
category: SemanticCategory.Content,
|
|
377
475
|
applicableDataTypes: ['string'],
|
|
378
476
|
hasConfig: false,
|
|
477
|
+
runtime: {
|
|
478
|
+
timing: SemanticTiming.None,
|
|
479
|
+
operations: [],
|
|
480
|
+
},
|
|
379
481
|
},
|
|
380
482
|
[SemanticType.Summary]: {
|
|
381
483
|
id: SemanticType.Summary,
|
|
@@ -385,6 +487,10 @@ export const DataSemantics = {
|
|
|
385
487
|
category: SemanticCategory.Content,
|
|
386
488
|
applicableDataTypes: ['string'],
|
|
387
489
|
hasConfig: false,
|
|
490
|
+
runtime: {
|
|
491
|
+
timing: SemanticTiming.None,
|
|
492
|
+
operations: [],
|
|
493
|
+
},
|
|
388
494
|
},
|
|
389
495
|
[SemanticType.Markdown]: {
|
|
390
496
|
id: SemanticType.Markdown,
|
|
@@ -394,6 +500,11 @@ export const DataSemantics = {
|
|
|
394
500
|
category: SemanticCategory.Content,
|
|
395
501
|
applicableDataTypes: ['string'],
|
|
396
502
|
hasConfig: true,
|
|
503
|
+
runtime: {
|
|
504
|
+
timing: SemanticTiming.Before,
|
|
505
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
506
|
+
priority: 50, // Process before storage
|
|
507
|
+
},
|
|
397
508
|
},
|
|
398
509
|
[SemanticType.HTML]: {
|
|
399
510
|
id: SemanticType.HTML,
|
|
@@ -403,6 +514,11 @@ export const DataSemantics = {
|
|
|
403
514
|
category: SemanticCategory.Content,
|
|
404
515
|
applicableDataTypes: ['string'],
|
|
405
516
|
hasConfig: true,
|
|
517
|
+
runtime: {
|
|
518
|
+
timing: SemanticTiming.Before,
|
|
519
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
520
|
+
priority: 50, // Process before storage for sanitization
|
|
521
|
+
},
|
|
406
522
|
},
|
|
407
523
|
[SemanticType.ImageURL]: {
|
|
408
524
|
id: SemanticType.ImageURL,
|
|
@@ -412,6 +528,11 @@ export const DataSemantics = {
|
|
|
412
528
|
category: SemanticCategory.Content,
|
|
413
529
|
applicableDataTypes: ['string'],
|
|
414
530
|
hasConfig: false,
|
|
531
|
+
runtime: {
|
|
532
|
+
timing: SemanticTiming.Before,
|
|
533
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
534
|
+
priority: 60, // Validate URLs before storage
|
|
535
|
+
},
|
|
415
536
|
},
|
|
416
537
|
[SemanticType.FileURL]: {
|
|
417
538
|
id: SemanticType.FileURL,
|
|
@@ -421,6 +542,11 @@ export const DataSemantics = {
|
|
|
421
542
|
category: SemanticCategory.Content,
|
|
422
543
|
applicableDataTypes: ['string'],
|
|
423
544
|
hasConfig: false,
|
|
545
|
+
runtime: {
|
|
546
|
+
timing: SemanticTiming.Before,
|
|
547
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
548
|
+
priority: 60, // Validate URLs before storage
|
|
549
|
+
},
|
|
424
550
|
},
|
|
425
551
|
//
|
|
426
552
|
// Business Data
|
|
@@ -433,6 +559,11 @@ export const DataSemantics = {
|
|
|
433
559
|
category: SemanticCategory.Business,
|
|
434
560
|
applicableDataTypes: ['string'],
|
|
435
561
|
hasConfig: true,
|
|
562
|
+
runtime: {
|
|
563
|
+
timing: SemanticTiming.Both,
|
|
564
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Read, SemanticOperation.List],
|
|
565
|
+
priority: 30, // Validate state transitions before, filter by state after
|
|
566
|
+
},
|
|
436
567
|
},
|
|
437
568
|
[SemanticType.Currency]: {
|
|
438
569
|
id: SemanticType.Currency,
|
|
@@ -442,6 +573,11 @@ export const DataSemantics = {
|
|
|
442
573
|
category: SemanticCategory.Business,
|
|
443
574
|
applicableDataTypes: ['number', 'string'],
|
|
444
575
|
hasConfig: true,
|
|
576
|
+
runtime: {
|
|
577
|
+
timing: SemanticTiming.Before,
|
|
578
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
579
|
+
priority: 70, // Validate currency format and precision
|
|
580
|
+
},
|
|
445
581
|
},
|
|
446
582
|
[SemanticType.SKU]: {
|
|
447
583
|
id: SemanticType.SKU,
|
|
@@ -451,6 +587,11 @@ export const DataSemantics = {
|
|
|
451
587
|
category: SemanticCategory.Business,
|
|
452
588
|
applicableDataTypes: ['string'],
|
|
453
589
|
hasConfig: true,
|
|
590
|
+
runtime: {
|
|
591
|
+
timing: SemanticTiming.Before,
|
|
592
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
593
|
+
priority: 25, // High priority for uniqueness validation
|
|
594
|
+
},
|
|
454
595
|
},
|
|
455
596
|
//
|
|
456
597
|
// Contact Information
|
|
@@ -463,6 +604,11 @@ export const DataSemantics = {
|
|
|
463
604
|
category: SemanticCategory.Contact,
|
|
464
605
|
applicableDataTypes: ['string'],
|
|
465
606
|
hasConfig: true,
|
|
607
|
+
runtime: {
|
|
608
|
+
timing: SemanticTiming.Before,
|
|
609
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
610
|
+
priority: 40, // Validate email format
|
|
611
|
+
},
|
|
466
612
|
},
|
|
467
613
|
[SemanticType.Phone]: {
|
|
468
614
|
id: SemanticType.Phone,
|
|
@@ -472,6 +618,11 @@ export const DataSemantics = {
|
|
|
472
618
|
category: SemanticCategory.Contact,
|
|
473
619
|
applicableDataTypes: ['string'],
|
|
474
620
|
hasConfig: true,
|
|
621
|
+
runtime: {
|
|
622
|
+
timing: SemanticTiming.Before,
|
|
623
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
624
|
+
priority: 40, // Validate phone format
|
|
625
|
+
},
|
|
475
626
|
},
|
|
476
627
|
[SemanticType.URL]: {
|
|
477
628
|
id: SemanticType.URL,
|
|
@@ -481,6 +632,11 @@ export const DataSemantics = {
|
|
|
481
632
|
category: SemanticCategory.Contact,
|
|
482
633
|
applicableDataTypes: ['string'],
|
|
483
634
|
hasConfig: true,
|
|
635
|
+
runtime: {
|
|
636
|
+
timing: SemanticTiming.Before,
|
|
637
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
638
|
+
priority: 40, // Validate URL format
|
|
639
|
+
},
|
|
484
640
|
},
|
|
485
641
|
//
|
|
486
642
|
// Classification & Organization
|
|
@@ -493,6 +649,11 @@ export const DataSemantics = {
|
|
|
493
649
|
category: SemanticCategory.Organization,
|
|
494
650
|
applicableDataTypes: ['string'],
|
|
495
651
|
hasConfig: true,
|
|
652
|
+
runtime: {
|
|
653
|
+
timing: SemanticTiming.Before,
|
|
654
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
655
|
+
priority: 30, // Generate slug from title, validate uniqueness
|
|
656
|
+
},
|
|
496
657
|
},
|
|
497
658
|
[SemanticType.Tags]: {
|
|
498
659
|
id: SemanticType.Tags,
|
|
@@ -501,6 +662,11 @@ export const DataSemantics = {
|
|
|
501
662
|
description: 'Enable tagging functionality',
|
|
502
663
|
category: SemanticCategory.Organization,
|
|
503
664
|
hasConfig: true,
|
|
665
|
+
runtime: {
|
|
666
|
+
timing: SemanticTiming.After,
|
|
667
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Delete],
|
|
668
|
+
priority: 200, // Process after main operation
|
|
669
|
+
},
|
|
504
670
|
},
|
|
505
671
|
[SemanticType.Categories]: {
|
|
506
672
|
id: SemanticType.Categories,
|
|
@@ -509,6 +675,11 @@ export const DataSemantics = {
|
|
|
509
675
|
description: 'Enable categorization functionality',
|
|
510
676
|
category: SemanticCategory.Organization,
|
|
511
677
|
hasConfig: true,
|
|
678
|
+
runtime: {
|
|
679
|
+
timing: SemanticTiming.After,
|
|
680
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Delete],
|
|
681
|
+
priority: 200, // Process after main operation
|
|
682
|
+
},
|
|
512
683
|
},
|
|
513
684
|
//
|
|
514
685
|
// Location & Geography
|
|
@@ -521,6 +692,11 @@ export const DataSemantics = {
|
|
|
521
692
|
category: SemanticCategory.Location,
|
|
522
693
|
applicableDataTypes: ['string'],
|
|
523
694
|
hasConfig: true,
|
|
695
|
+
runtime: {
|
|
696
|
+
timing: SemanticTiming.Both,
|
|
697
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Read, SemanticOperation.List],
|
|
698
|
+
priority: 60, // Validate coordinates before, enable spatial queries after
|
|
699
|
+
},
|
|
524
700
|
},
|
|
525
701
|
//
|
|
526
702
|
// Computed Values
|
|
@@ -534,6 +710,11 @@ export const DataSemantics = {
|
|
|
534
710
|
category: SemanticCategory.Computed,
|
|
535
711
|
applicableDataTypes: ['string', 'number', 'boolean', 'date', 'datetime', 'time', 'binary'],
|
|
536
712
|
hasConfig: true,
|
|
713
|
+
runtime: {
|
|
714
|
+
timing: SemanticTiming.Both,
|
|
715
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Read],
|
|
716
|
+
priority: 150, // Calculate after other validations, recalculate on read if needed
|
|
717
|
+
},
|
|
537
718
|
},
|
|
538
719
|
[SemanticType.Derived]: {
|
|
539
720
|
id: SemanticType.Derived,
|
|
@@ -543,8 +724,44 @@ export const DataSemantics = {
|
|
|
543
724
|
category: SemanticCategory.Computed,
|
|
544
725
|
applicableDataTypes: ['string'],
|
|
545
726
|
hasConfig: true,
|
|
727
|
+
runtime: {
|
|
728
|
+
timing: SemanticTiming.After,
|
|
729
|
+
operations: [SemanticOperation.Create, SemanticOperation.Update],
|
|
730
|
+
priority: 180, // Derive after all other processing
|
|
731
|
+
},
|
|
546
732
|
},
|
|
547
733
|
};
|
|
734
|
+
/**
|
|
735
|
+
* Get all semantics that should run for a specific operation and timing
|
|
736
|
+
*/
|
|
737
|
+
export function getSemanticsForOperation(semantics, operation, timing) {
|
|
738
|
+
return semantics
|
|
739
|
+
.filter((semantic) => {
|
|
740
|
+
const definition = DataSemantics[semantic.id];
|
|
741
|
+
if (!definition?.runtime) {
|
|
742
|
+
return false;
|
|
743
|
+
}
|
|
744
|
+
const { timing: semanticTiming, operations } = definition.runtime;
|
|
745
|
+
// Check if timing matches
|
|
746
|
+
const timingMatches = semanticTiming === timing || semanticTiming === SemanticTiming.Both;
|
|
747
|
+
// Check if operation is included
|
|
748
|
+
const operationMatches = operations.includes(operation);
|
|
749
|
+
return timingMatches && operationMatches;
|
|
750
|
+
})
|
|
751
|
+
.sort((a, b) => {
|
|
752
|
+
// Sort by priority (lower number = higher priority)
|
|
753
|
+
const priorityA = DataSemantics[a.id]?.runtime?.priority ?? 100;
|
|
754
|
+
const priorityB = DataSemantics[b.id]?.runtime?.priority ?? 100;
|
|
755
|
+
return priorityA - priorityB;
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Check if a specific semantic can be disabled at runtime
|
|
760
|
+
*/
|
|
761
|
+
export function canSemanticBeDisabled(semanticType) {
|
|
762
|
+
const definition = DataSemantics[semanticType];
|
|
763
|
+
return definition?.runtime?.canDisable !== false; // Default to true if not specified
|
|
764
|
+
}
|
|
548
765
|
/**
|
|
549
766
|
* Helper function to get all semantics grouped by category.
|
|
550
767
|
* Useful for organizing semantics in UI dropdowns and forms.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Semantics.js","sourceRoot":"","sources":["../../../src/modeling/Semantics.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAN,IAAY,YA2MX;AA3MD,WAAY,YAAY;IACtB,EAAE;IACF,yBAAyB;IACzB,EAAE;IAEF;;OAEG;IACH,sCAAsB,CAAA;IAEtB,EAAE;IACF,2BAA2B;IAC3B,EAAE;IAEF;;;;OAIG;IACH,8CAA8B,CAAA;IAC9B;;;OAGG;IACH,8DAA8C,CAAA;IAC9C;;;OAGG;IACH,8DAA8C,CAAA;IAC9C;;;;;OAKG;IACH,8DAA8C,CAAA;IAC9C;;;;OAIG;IACH,oDAAoC,CAAA;IACpC;;;;;;;OAOG;IACH,8DAA8C,CAAA;IAC9C;;;;OAIG;IACH,wCAAwB,CAAA;IACxB;;;;;;OAMG;IACH,8CAA8B,CAAA;IAC9B;;;;;;;;;OASG;IACH,0CAA0B,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IAAI;KAChB;CACF,CAAA;AASD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAqB;IAC1D,MAAM,MAAM,GAA6C;QACvD,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC/B,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,EAAE;QAChC,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,EAAE;QAC9B,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC/B,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,EAAE;QAC9B,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,EAAE;QACnC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC/B,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;KAChC,CAAA;IAED,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChD,yDAAyD;QACzD,IAAI,KAAK,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;YACtC,OAAM;QACR,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAA0B,EAAkB,EAAE;IACvF,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAA;AAC1F,CAAC,CAAA","sourcesContent":["/* eslint-disable no-redeclare */\n/* eslint-disable max-len */\nimport type { DomainPropertyType } from './DataFormat.js'\n\n/**\n * Defines the names for all available data semantics.\n * Using a string enum makes it easy to add or remove semantics in a single place.\n */\nexport enum SemanticType {\n //\n // Entity-Level Semantics\n //\n\n /**\n * Designates a Data Entity that represents users of the system.\n */\n User = 'Semantic#User',\n\n //\n // Property-Level Semantics\n //\n\n /**\n * Annotates the field as the user password.\n * The runtime should treat this field with special care,\n * ensuring it is encrypted and not exposed in API responses.\n */\n Password = 'Semantic#Password',\n /**\n * Designates a Data Property as the `createdAt` timestamp of an entity.\n * This is used to track when the entity was first created.\n */\n CreatedTimestamp = 'Semantic#CreatedTimestamp',\n /**\n * Designates a Data Property as the `updatedAt` timestamp of an entity.\n * This is used to track when the entity was last modified.\n */\n UpdatedTimestamp = 'Semantic#UpdatedTimestamp',\n /**\n * Designates a Data Property as the `deletedAt` timestamp of an entity.\n * This is used to track when the entity was soft-deleted.\n * Soft-deletion means the entity is not physically removed from the database,\n * but marked as deleted for logical deletion purposes.\n */\n DeletedTimestamp = 'Semantic#DeletedTimestamp',\n /**\n * Designates a Data Property as a boolean flag indicating whether the entity is deleted.\n * This is used for soft-deletion, where the entity is not physically removed from the database,\n * but marked as deleted.\n */\n DeletedFlag = 'Semantic#DeletedFlag',\n /**\n * Designates a Data Property as a public identifier for a resource (the slug).\n * This is often used in URLs to provide a user-friendly way to access the resource.\n * For example, a blog post might have a public unique name like \"my-first-post\".\n * The runtime automatically generates a URL-safe string from another field (like a title).\n * By default, slugs are generated to be unique, but the configuration allows for duplicates\n * in scenarios where uniqueness is handled by a combination of fields (e.g., year and slug).\n */\n PublicUniqueName = 'Semantic#PublicUniqueName',\n /**\n * A semantic that describes a title of an article, blog post, and so on. This semantic is used with\n * the `PublicUniqueName` to determine which field is responsible for the slug generation. However,\n * we may add more automation related to the `title` property in the future.\n */\n Title = 'Semantic#Title',\n /**\n * Designates a Data Property as the `role` of a user within the system.\n * This is used to define the user's permissions and access levels.\n * For example, a user with the role of \"admin\" would have elevated permissions\n * compared to a user with the role of \"guest\".\n * Roles are defined on the entity as enums, or as a string property with a controlled vocabulary.\n */\n UserRole = 'Semantic#UserRole',\n /**\n * A text or enum field to represent the state of a record (e.g., `draft`, `published`, `pending_review`, `archived`).\n *\n * Defined behaviors:\n * - State-Based Filtering: Automatically prevents public users from seeing records in a draft state.\n * - State Transitions: In principle, the runtime should prevent the user from skipping some states.\n * For example, when the record is in the `draft` state, it cannot be moved to the `archived` state without publishing it first. However,\n * we do not have enough customer feedback to design this functionality correctly right now, so\n * it serves as a placeholder semantic annotation.\n */\n Status = 'Semantic#Status',\n\n /**\n * Annotates an integer field that automatically increments.\n * The runtime automatically increments this number on every update, providing a simple way\n * to track changes and implement optimistic locking to prevent mid-air collisions.\n */\n Version = 'Semantic#Version',\n\n /**\n * Annotates a field that holds a reference to an image data via an URL.\n * The application + runtime should validate that the input is a well-formed URL.\n */\n ImageURL = 'Semantic#ImageURL',\n\n /**\n * Annotates a field that holds a reference to a file object via an URL. Ity is distinct from the\n * `ImageURL` semantic as it implicitly states that the target is non-image, binary data (an attachment, for example).\n */\n FileURL = 'Semantic#FileURL',\n\n /**\n * Annotates the field as a markdown-interpreted field.\n * When an object is created, the runtime performs additional sanitization to prevent XSS attacks.\n *\n * The annotation describes whether the data should be translated to the HTML output when\n * record is read or the original MD content should be returned.\n */\n Markdown = 'Semantic#Markdown',\n\n /**\n * Annotates the field as containing HTML content.\n * The runtime performs sanitization to prevent XSS attacks and validates HTML structure.\n *\n * The annotation describes whether the data should be rendered as HTML output when\n * record is read or the original HTML content should be returned.\n */\n HTML = 'Semantic#HTML',\n\n /**\n * Annotates a field that holds geospatial coordinate data (latitude/longitude).\n * The runtime automatically generates API capabilities for location-based queries,\n * such as \"find all restaurants within a 5-mile radius.\"\n *\n * The field should contain coordinate data in a standard format:\n * - \"40.7128,-74.0060\" (lat,lon)\n * - \"POINT(-74.0060 40.7128)\" (PostGIS format)\n * - \"40.7128°N, 74.0060°W\" (degree format)\n *\n * Defined behaviors:\n * - Spatial Indexing: The runtime automatically creates spatial indexes for efficient location-based queries\n * - Distance Queries: Enables API endpoints for finding records within specified distances\n * - Coordinate Validation: Validates that the input follows proper coordinate format\n * - PostGIS Integration: When using PostgreSQL, automatically maps to PostGIS geometry types\n */\n GeospatialCoordinates = 'Semantic#GeospatialCoordinates',\n\n /**\n * Annotates a field as an email address with validation and verification options.\n */\n Email = 'Semantic#Email',\n /**\n * Annotates a field as a phone number with validation and formatting options.\n */\n Phone = 'Semantic#Phone',\n /**\n * Annotates a field as a monetary value with currency support and precision control.\n * Can store simple decimal amounts or complex objects with amount and currency.\n *\n * As a semantic, it provides flexibility by annotating a base `number` or `string` type,\n * allowing for different storage strategies (e.g., decimal, integer cents, or a JSON object)\n * while maintaining a consistent API for currency operations.\n */\n Currency = 'Semantic#Currency',\n /**\n * Annotates a field as a URL with validation and allowed protocols.\n */\n URL = 'Semantic#URL',\n /**\n * Annotates a field as a Stock Keeping Unit (SKU).\n * Enforces uniqueness at the database level, critical for product catalogs.\n * Provides automatic validation and formatting for product identification codes.\n */\n SKU = 'Semantic#SKU',\n /**\n * Annotates a field as a long-form description.\n */\n Description = 'Semantic#Description',\n /**\n * Annotates a field as a short summary.\n */\n Summary = 'Semantic#Summary',\n /**\n * Annotates a field as a calculated value based on a formula.\n */\n Calculated = 'Semantic#Calculated',\n /**\n * Annotates a field as derived from other fields.\n */\n Derived = 'Semantic#Derived',\n\n //\n // Association-Level Semantics\n //\n\n /**\n * Designates an association that links a resource to a \"User\" entity instance.\n * This is used to indicate ownership of the resource for access control purposes.\n * For example, a blog post might have a resource owner identifier that points to the user who created it.\n *\n * Defined behaviors:\n * - Automatic Ownership: When a new record is created, this field is automatically populated with the ID of the authenticated user. It also creates a foreign relationship to the `User` semantic object.\n * - Scoped Access: The runtime automatically filters list and read operations to show only records where the Owner matches the current user. update and delete operations are similarly restricted.\n */\n ResourceOwnerIdentifier = 'Semantic#ResourceOwnerIdentifier',\n /**\n * Annotates an association as supporting tag functionality.\n * Applied to associations between entities to enable tagging behavior.\n * For example, a Product-Category association with Tags semantic enables product tagging.\n */\n Tags = 'Semantic#Tags',\n /**\n * Annotates an association as supporting category functionality.\n * Applied to associations between entities to enable categorization behavior.\n * For example, a Product-Category association with Categories semantic enables product categorization.\n */\n Categories = 'Semantic#Categories',\n}\n\n/**\n * Defines the scope at which a semantic can be applied.\n */\nexport enum SemanticScope {\n /**\n * The semantic applies to an entire Data Entity.\n * This is used for semantics that provide context or constraints at the entity level.\n */\n Entity = 'Entity',\n /**\n * The semantic applies to a single Data Property.\n * This is used for semantics that provide context or constraints at the property level.\n */\n Property = 'Property',\n /**\n * The semantic applies to an Association between Data Entities.\n * This is used for semantics that provide context or constraints at the association level.\n */\n Association = 'Association',\n}\n\n/**\n * Defines categories for organizing semantics in the UI.\n */\nexport enum SemanticCategory {\n /**\n * User management, authentication, and access control\n */\n Identity = 'Identity & Authentication',\n /**\n * Timestamps, versioning, and record lifecycle\n */\n Lifecycle = 'Timestamps & Versioning',\n /**\n * Text content, media, and rich content types\n */\n Content = 'Content & Media',\n /**\n * Business-specific data like pricing, inventory, status\n */\n Business = 'Business Data',\n /**\n * Contact information and communication\n */\n Contact = 'Contact Information',\n /**\n * Organization, categorization, and tagging\n */\n Organization = 'Classification & Organization',\n /**\n * Location and geographical data\n */\n Location = 'Location & Geography',\n /**\n * Calculated and derived values\n */\n Computed = 'Computed Values',\n}\n\n/**\n * A base interface for all Data Semantics, containing common properties.\n * A semantic is an annotation applied to a Data Entity, Property, or Association\n * to provide additional context or constraints.\n * This interface is extended by more specific semantic types.\n */\ninterface BaseDataSemantic {\n /**\n * A unique identifier for the semantic definition.\n */\n id: SemanticType\n /**\n * A human-readable name for the semantic.\n */\n displayName: string\n /**\n * A description of the semantic's purpose and impact.\n */\n description: string\n /**\n * Specifies whether the semantic applies to an Entity, Property, or Association.\n */\n scope: SemanticScope\n /**\n * The category this semantic belongs to for UI organization.\n */\n category: SemanticCategory\n /**\n * Whether the semantic has a configuration or additional options.\n * This is used to determine if the semantic requires additional setup or configuration.\n */\n hasConfig: boolean\n}\n\n/**\n * Represents a semantic that can be applied to an entire Data Entity.\n */\nexport interface EntitySemantic extends BaseDataSemantic {\n scope: SemanticScope.Entity\n}\n\n/**\n * Represents a semantic that can be applied to a single property.\n */\nexport interface PropertySemantic extends BaseDataSemantic {\n scope: SemanticScope.Property\n /**\n * Optional array of data types this semantic can be applied to.\n * Enforces constraints, e.g., DeletedTimestamp on a DateTime property.\n */\n applicableDataTypes?: DomainPropertyType[]\n}\n\n/**\n * Represents a semantic that can be applied to an association between entities.\n */\nexport interface AssociationSemantic extends BaseDataSemantic {\n scope: SemanticScope.Association\n}\n\n/**\n * A type guard to check if a semantic is an EntitySemantic.\n */\nexport const isEntitySemantic = (semantic: DataSemantic): semantic is EntitySemantic =>\n semantic.scope === SemanticScope.Entity\n\n/**\n * A type guard to check if a semantic is a PropertySemantic.\n */\nexport const isPropertySemantic = (semantic: DataSemantic): semantic is PropertySemantic =>\n semantic.scope === SemanticScope.Property\n\n/**\n * A type guard to check if a semantic is a AssociationSemantic.\n */\nexport const isAssociationSemantic = (semantic: DataSemantic): semantic is AssociationSemantic =>\n semantic.scope === SemanticScope.Association\n\n/**\n * Union type for any kind of data semantic\n */\nexport type DataSemantic = EntitySemantic | PropertySemantic | AssociationSemantic\n\n/**\n * A map to store the definitions of all available data semantics.\n * This acts as a central registry for the application.\n */\nexport const DataSemantics: Record<SemanticType, DataSemantic> = {\n //\n // Identity & Authentication\n //\n\n [SemanticType.User]: {\n id: SemanticType.User,\n displayName: 'User Entity',\n scope: SemanticScope.Entity,\n description: 'System users and accounts',\n category: SemanticCategory.Identity,\n hasConfig: false,\n },\n [SemanticType.Password]: {\n id: SemanticType.Password,\n displayName: 'User Password',\n scope: SemanticScope.Property,\n description: 'Secure password field',\n category: SemanticCategory.Identity,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.UserRole]: {\n id: SemanticType.UserRole,\n displayName: 'User Role Field',\n scope: SemanticScope.Property,\n description: 'User permissions and access level',\n category: SemanticCategory.Identity,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.ResourceOwnerIdentifier]: {\n id: SemanticType.ResourceOwnerIdentifier,\n displayName: 'Resource Owner Identifier',\n scope: SemanticScope.Association,\n description: 'Links record to owner user',\n category: SemanticCategory.Identity,\n hasConfig: false,\n },\n\n //\n // Timestamps & Versioning\n //\n\n [SemanticType.CreatedTimestamp]: {\n id: SemanticType.CreatedTimestamp,\n displayName: 'Creation Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was created',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.UpdatedTimestamp]: {\n id: SemanticType.UpdatedTimestamp,\n displayName: 'Update Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was last modified',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.DeletedTimestamp]: {\n id: SemanticType.DeletedTimestamp,\n displayName: 'Soft Delete Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was marked deleted',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n },\n [SemanticType.DeletedFlag]: {\n id: SemanticType.DeletedFlag,\n displayName: 'Soft Delete Flag',\n scope: SemanticScope.Property,\n description: 'Mark record as deleted',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['boolean'],\n hasConfig: false,\n },\n [SemanticType.Version]: {\n id: SemanticType.Version,\n displayName: 'Version Number',\n scope: SemanticScope.Property,\n description: 'Auto-incrementing version counter',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['number'],\n hasConfig: false,\n },\n\n //\n // Content & Media\n //\n\n [SemanticType.Title]: {\n id: SemanticType.Title,\n displayName: 'Record Title',\n scope: SemanticScope.Property,\n description: 'Main title or heading',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.Description]: {\n id: SemanticType.Description,\n displayName: 'Description',\n scope: SemanticScope.Property,\n description: 'Detailed description text',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.Summary]: {\n id: SemanticType.Summary,\n displayName: 'Summary',\n scope: SemanticScope.Property,\n description: 'Brief summary text',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.Markdown]: {\n id: SemanticType.Markdown,\n displayName: 'Markdown Content',\n scope: SemanticScope.Property,\n description: 'Formatted text content',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.HTML]: {\n id: SemanticType.HTML,\n displayName: 'HTML Content',\n scope: SemanticScope.Property,\n description: 'Rich HTML content',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.ImageURL]: {\n id: SemanticType.ImageURL,\n displayName: 'Image URL',\n scope: SemanticScope.Property,\n description: 'Link to image file',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n [SemanticType.FileURL]: {\n id: SemanticType.FileURL,\n displayName: 'File URL',\n scope: SemanticScope.Property,\n description: 'Link to file attachment',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n },\n\n //\n // Business Data\n //\n\n [SemanticType.Status]: {\n id: SemanticType.Status,\n displayName: 'Record Status',\n scope: SemanticScope.Property,\n description: 'Current state of record',\n category: SemanticCategory.Business,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Currency]: {\n id: SemanticType.Currency,\n displayName: 'Currency',\n scope: SemanticScope.Property,\n description: 'Monetary value with currency',\n category: SemanticCategory.Business,\n applicableDataTypes: ['number', 'string'],\n hasConfig: true,\n },\n [SemanticType.SKU]: {\n id: SemanticType.SKU,\n displayName: 'SKU',\n scope: SemanticScope.Property,\n description: 'Product identification code',\n category: SemanticCategory.Business,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Contact Information\n //\n\n [SemanticType.Email]: {\n id: SemanticType.Email,\n displayName: 'Email',\n scope: SemanticScope.Property,\n description: 'Email address',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Phone]: {\n id: SemanticType.Phone,\n displayName: 'Phone',\n scope: SemanticScope.Property,\n description: 'Phone number',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.URL]: {\n id: SemanticType.URL,\n displayName: 'URL',\n scope: SemanticScope.Property,\n description: 'Web address or link',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Classification & Organization\n //\n\n [SemanticType.PublicUniqueName]: {\n id: SemanticType.PublicUniqueName,\n displayName: 'Public Unique Name (Slug)',\n scope: SemanticScope.Property,\n description: 'URL-friendly unique identifier',\n category: SemanticCategory.Organization,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n [SemanticType.Tags]: {\n id: SemanticType.Tags,\n displayName: 'Tags',\n scope: SemanticScope.Association,\n description: 'Enable tagging functionality',\n category: SemanticCategory.Organization,\n hasConfig: true,\n },\n [SemanticType.Categories]: {\n id: SemanticType.Categories,\n displayName: 'Categories',\n scope: SemanticScope.Association,\n description: 'Enable categorization functionality',\n category: SemanticCategory.Organization,\n hasConfig: true,\n },\n\n //\n // Location & Geography\n //\n\n [SemanticType.GeospatialCoordinates]: {\n id: SemanticType.GeospatialCoordinates,\n displayName: 'Geospatial Coordinates',\n scope: SemanticScope.Property,\n description: 'Location coordinates',\n category: SemanticCategory.Location,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n\n //\n // Computed Values\n //\n\n // Calculated field can be added to any data type as we can compute any value.\n [SemanticType.Calculated]: {\n id: SemanticType.Calculated,\n displayName: 'Calculated',\n scope: SemanticScope.Property,\n description: 'Auto-calculated field value',\n category: SemanticCategory.Computed,\n applicableDataTypes: ['string', 'number', 'boolean', 'date', 'datetime', 'time', 'binary'],\n hasConfig: true,\n },\n [SemanticType.Derived]: {\n id: SemanticType.Derived,\n displayName: 'Derived',\n scope: SemanticScope.Property,\n description: 'Value derived from other fields',\n category: SemanticCategory.Computed,\n applicableDataTypes: ['string'],\n hasConfig: true,\n },\n}\n\nexport function getSemanticsByCategory(): Record<SemanticCategory, DataSemantic[]>\nexport function getSemanticsByCategory(scope: SemanticScope.Entity): Record<SemanticCategory, EntitySemantic[]>\nexport function getSemanticsByCategory(scope: SemanticScope.Property): Record<SemanticCategory, PropertySemantic[]>\nexport function getSemanticsByCategory(\n scope: SemanticScope.Association\n): Record<SemanticCategory, AssociationSemantic[]>\n\n/**\n * Helper function to get all semantics grouped by category.\n * Useful for organizing semantics in UI dropdowns and forms.\n *\n * @param scope Optional scope to filter semantics by (Entity, Property, Association)\n */\nexport function getSemanticsByCategory(scope?: SemanticScope): Record<SemanticCategory, DataSemantic[]> {\n const result: Record<SemanticCategory, DataSemantic[]> = {\n [SemanticCategory.Identity]: [],\n [SemanticCategory.Lifecycle]: [],\n [SemanticCategory.Content]: [],\n [SemanticCategory.Business]: [],\n [SemanticCategory.Contact]: [],\n [SemanticCategory.Organization]: [],\n [SemanticCategory.Location]: [],\n [SemanticCategory.Computed]: [],\n }\n\n Object.values(DataSemantics).forEach((semantic) => {\n // If a scope is provided, filter semantics by that scope\n if (scope && semantic.scope !== scope) {\n return\n }\n result[semantic.category].push(semantic)\n })\n\n return result\n}\n\n/**\n * Helper function to get semantics for a specific category.\n * @param category The category to filter by\n * @returns Array of semantics in the specified category\n */\nexport const getSemanticsByCategoryType = (category: SemanticCategory): DataSemantic[] => {\n return Object.values(DataSemantics).filter((semantic) => semantic.category === category)\n}\n\n/**\n * Represents the application of a data semantic to a specific\n * entity or property within a user's data model.\n */\nexport interface AppliedDataSemantic {\n /**\n * The unique identifier of the semantic being applied.\n */\n id: SemanticType\n\n /**\n * Optional configuration or values specific to this application.\n */\n config?: Record<string, unknown>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Semantics.js","sourceRoot":"","sources":["../../../src/modeling/Semantics.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CAAC,QAAQ,CAAC,EAAE,EAAE;KAChC,CAAA;IAED,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChD,yDAAyD;QACzD,IAAI,KAAK,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;YACtC,OAAM;QACR,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAA0B,EAAkB,EAAE;IACvF,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAA;AAC1F,CAAC,CAAA","sourcesContent":["/* eslint-disable no-redeclare */\n/* eslint-disable max-len */\nimport type { DomainPropertyType } from './DataFormat.js'\n\n/**\n * Defines the names for all available data semantics.\n * Using a string enum makes it easy to add or remove semantics in a single place.\n */\nexport enum SemanticType {\n //\n // Entity-Level Semantics\n //\n\n /**\n * Designates a Data Entity that represents users of the system.\n */\n User = 'Semantic#User',\n\n //\n // Property-Level Semantics\n //\n\n /**\n * Annotates the field as the user password.\n * The runtime should treat this field with special care,\n * ensuring it is encrypted and not exposed in API responses.\n */\n Password = 'Semantic#Password',\n /**\n * Designates a Data Property as the `createdAt` timestamp of an entity.\n * This is used to track when the entity was first created.\n */\n CreatedTimestamp = 'Semantic#CreatedTimestamp',\n /**\n * Designates a Data Property as the `updatedAt` timestamp of an entity.\n * This is used to track when the entity was last modified.\n */\n UpdatedTimestamp = 'Semantic#UpdatedTimestamp',\n /**\n * Designates a Data Property as the `deletedAt` timestamp of an entity.\n * This is used to track when the entity was soft-deleted.\n * Soft-deletion means the entity is not physically removed from the database,\n * but marked as deleted for logical deletion purposes.\n */\n DeletedTimestamp = 'Semantic#DeletedTimestamp',\n /**\n * Designates a Data Property as a boolean flag indicating whether the entity is deleted.\n * This is used for soft-deletion, where the entity is not physically removed from the database,\n * but marked as deleted.\n */\n DeletedFlag = 'Semantic#DeletedFlag',\n /**\n * Designates a Data Property as a public identifier for a resource (the slug).\n * This is often used in URLs to provide a user-friendly way to access the resource.\n * For example, a blog post might have a public unique name like \"my-first-post\".\n * The runtime automatically generates a URL-safe string from another field (like a title).\n * By default, slugs are generated to be unique, but the configuration allows for duplicates\n * in scenarios where uniqueness is handled by a combination of fields (e.g., year and slug).\n */\n PublicUniqueName = 'Semantic#PublicUniqueName',\n /**\n * A semantic that describes a title of an article, blog post, and so on. This semantic is used with\n * the `PublicUniqueName` to determine which field is responsible for the slug generation. However,\n * we may add more automation related to the `title` property in the future.\n */\n Title = 'Semantic#Title',\n /**\n * Designates a Data Property as the `role` of a user within the system.\n * This is used to define the user's permissions and access levels.\n * For example, a user with the role of \"admin\" would have elevated permissions\n * compared to a user with the role of \"guest\".\n * Roles are defined on the entity as enums, or as a string property with a controlled vocabulary.\n */\n UserRole = 'Semantic#UserRole',\n /**\n * A text or enum field to represent the state of a record (e.g., `draft`, `published`, `pending_review`, `archived`).\n *\n * Defined behaviors:\n * - State-Based Filtering: Automatically prevents public users from seeing records in a draft state.\n * - State Transitions: In principle, the runtime should prevent the user from skipping some states.\n * For example, when the record is in the `draft` state, it cannot be moved to the `archived` state without publishing it first. However,\n * we do not have enough customer feedback to design this functionality correctly right now, so\n * it serves as a placeholder semantic annotation.\n */\n Status = 'Semantic#Status',\n\n /**\n * Annotates an integer field that automatically increments.\n * The runtime automatically increments this number on every update, providing a simple way\n * to track changes and implement optimistic locking to prevent mid-air collisions.\n */\n Version = 'Semantic#Version',\n\n /**\n * Annotates a field that holds a reference to an image data via an URL.\n * The application + runtime should validate that the input is a well-formed URL.\n */\n ImageURL = 'Semantic#ImageURL',\n\n /**\n * Annotates a field that holds a reference to a file object via an URL. Ity is distinct from the\n * `ImageURL` semantic as it implicitly states that the target is non-image, binary data (an attachment, for example).\n */\n FileURL = 'Semantic#FileURL',\n\n /**\n * Annotates the field as a markdown-interpreted field.\n * When an object is created, the runtime performs additional sanitization to prevent XSS attacks.\n *\n * The annotation describes whether the data should be translated to the HTML output when\n * record is read or the original MD content should be returned.\n */\n Markdown = 'Semantic#Markdown',\n\n /**\n * Annotates the field as containing HTML content.\n * The runtime performs sanitization to prevent XSS attacks and validates HTML structure.\n *\n * The annotation describes whether the data should be rendered as HTML output when\n * record is read or the original HTML content should be returned.\n */\n HTML = 'Semantic#HTML',\n\n /**\n * Annotates a field that holds geospatial coordinate data (latitude/longitude).\n * The runtime automatically generates API capabilities for location-based queries,\n * such as \"find all restaurants within a 5-mile radius.\"\n *\n * The field should contain coordinate data in a standard format:\n * - \"40.7128,-74.0060\" (lat,lon)\n * - \"POINT(-74.0060 40.7128)\" (PostGIS format)\n * - \"40.7128°N, 74.0060°W\" (degree format)\n *\n * Defined behaviors:\n * - Spatial Indexing: The runtime automatically creates spatial indexes for efficient location-based queries\n * - Distance Queries: Enables API endpoints for finding records within specified distances\n * - Coordinate Validation: Validates that the input follows proper coordinate format\n * - PostGIS Integration: When using PostgreSQL, automatically maps to PostGIS geometry types\n */\n GeospatialCoordinates = 'Semantic#GeospatialCoordinates',\n\n /**\n * Annotates a field as an email address with validation and verification options.\n */\n Email = 'Semantic#Email',\n /**\n * Annotates a field as a phone number with validation and formatting options.\n */\n Phone = 'Semantic#Phone',\n /**\n * Annotates a field as a monetary value with currency support and precision control.\n * Can store simple decimal amounts or complex objects with amount and currency.\n *\n * As a semantic, it provides flexibility by annotating a base `number` or `string` type,\n * allowing for different storage strategies (e.g., decimal, integer cents, or a JSON object)\n * while maintaining a consistent API for currency operations.\n */\n Currency = 'Semantic#Currency',\n /**\n * Annotates a field as a URL with validation and allowed protocols.\n */\n URL = 'Semantic#URL',\n /**\n * Annotates a field as a Stock Keeping Unit (SKU).\n * Enforces uniqueness at the database level, critical for product catalogs.\n * Provides automatic validation and formatting for product identification codes.\n */\n SKU = 'Semantic#SKU',\n /**\n * Annotates a field as a long-form description.\n */\n Description = 'Semantic#Description',\n /**\n * Annotates a field as a short summary.\n */\n Summary = 'Semantic#Summary',\n /**\n * Annotates a field as a calculated value based on a formula.\n */\n Calculated = 'Semantic#Calculated',\n /**\n * Annotates a field as derived from other fields.\n */\n Derived = 'Semantic#Derived',\n\n //\n // Association-Level Semantics\n //\n\n /**\n * Designates an association that links a resource to a \"User\" entity instance.\n * This is used to indicate ownership of the resource for access control purposes.\n * For example, a blog post might have a resource owner identifier that points to the user who created it.\n *\n * Defined behaviors:\n * - Automatic Ownership: When a new record is created, this field is automatically populated with the ID of the authenticated user. It also creates a foreign relationship to the `User` semantic object.\n * - Scoped Access: The runtime automatically filters list and read operations to show only records where the Owner matches the current user. update and delete operations are similarly restricted.\n */\n ResourceOwnerIdentifier = 'Semantic#ResourceOwnerIdentifier',\n /**\n * Annotates an association as supporting tag functionality.\n * Applied to associations between entities to enable tagging behavior.\n * For example, a Product-Category association with Tags semantic enables product tagging.\n */\n Tags = 'Semantic#Tags',\n /**\n * Annotates an association as supporting category functionality.\n * Applied to associations between entities to enable categorization behavior.\n * For example, a Product-Category association with Categories semantic enables product categorization.\n */\n Categories = 'Semantic#Categories',\n}\n\n/**\n * Defines the scope at which a semantic can be applied.\n */\nexport enum SemanticScope {\n /**\n * The semantic applies to an entire Data Entity.\n * This is used for semantics that provide context or constraints at the entity level.\n */\n Entity = 'Entity',\n /**\n * The semantic applies to a single Data Property.\n * This is used for semantics that provide context or constraints at the property level.\n */\n Property = 'Property',\n /**\n * The semantic applies to an Association between Data Entities.\n * This is used for semantics that provide context or constraints at the association level.\n */\n Association = 'Association',\n}\n\n/**\n * Defines categories for organizing semantics in the UI.\n */\nexport enum SemanticCategory {\n /**\n * User management, authentication, and access control\n */\n Identity = 'Identity & Authentication',\n /**\n * Timestamps, versioning, and record lifecycle\n */\n Lifecycle = 'Timestamps & Versioning',\n /**\n * Text content, media, and rich content types\n */\n Content = 'Content & Media',\n /**\n * Business-specific data like pricing, inventory, status\n */\n Business = 'Business Data',\n /**\n * Contact information and communication\n */\n Contact = 'Contact Information',\n /**\n * Organization, categorization, and tagging\n */\n Organization = 'Classification & Organization',\n /**\n * Location and geographical data\n */\n Location = 'Location & Geography',\n /**\n * Calculated and derived values\n */\n Computed = 'Computed Values',\n}\n\n/**\n * Defines when a semantic should execute in relation to database operations.\n */\nexport enum SemanticTiming {\n /**\n * Execute before the database operation (validation, preprocessing)\n */\n Before = 'Before',\n /**\n * Execute after the database operation (cleanup, notifications, derived values)\n */\n After = 'After',\n /**\n * Execute both before and after the operation\n */\n Both = 'Both',\n /**\n * No automatic execution (manual/on-demand only)\n */\n None = 'None',\n}\n\n/**\n * Defines which database operations can trigger a semantic.\n */\nexport enum SemanticOperation {\n Create = 'Create',\n Read = 'Read',\n Update = 'Update',\n Delete = 'Delete',\n /**\n * Special operation for list/query operations\n */\n List = 'List',\n}\n\n/**\n * Configuration for when and how a semantic should execute at runtime.\n */\nexport interface SemanticRuntimeConfig {\n /**\n * When the semantic should execute relative to the database operation.\n */\n timing: SemanticTiming\n /**\n * Which database operations should trigger this semantic.\n */\n operations: SemanticOperation[]\n /**\n * Priority order for execution when multiple semantics apply.\n * Lower numbers execute first. Default is 100.\n */\n priority?: number\n /**\n * Whether this semantic can be disabled at the entity/property level.\n */\n canDisable?: boolean\n}\n\n/**\n * A base interface for all Data Semantics, containing common properties.\n * A semantic is an annotation applied to a Data Entity, Property, or Association\n * to provide additional context or constraints.\n * This interface is extended by more specific semantic types.\n */\ninterface BaseDataSemantic {\n /**\n * A unique identifier for the semantic definition.\n */\n id: SemanticType\n /**\n * A human-readable name for the semantic.\n */\n displayName: string\n /**\n * A description of the semantic's purpose and impact.\n */\n description: string\n /**\n * Specifies whether the semantic applies to an Entity, Property, or Association.\n */\n scope: SemanticScope\n /**\n * The category this semantic belongs to for UI organization.\n */\n category: SemanticCategory\n /**\n * Whether the semantic has a configuration or additional options.\n * This is used to determine if the semantic requires additional setup or configuration.\n */\n hasConfig: boolean\n /**\n * Runtime execution configuration for this semantic.\n */\n runtime: SemanticRuntimeConfig\n}\n\n/**\n * Represents a semantic that can be applied to an entire Data Entity.\n */\nexport interface EntitySemantic extends BaseDataSemantic {\n scope: SemanticScope.Entity\n}\n\n/**\n * Represents a semantic that can be applied to a single property.\n */\nexport interface PropertySemantic extends BaseDataSemantic {\n scope: SemanticScope.Property\n /**\n * Optional array of data types this semantic can be applied to.\n * Enforces constraints, e.g., DeletedTimestamp on a DateTime property.\n */\n applicableDataTypes?: DomainPropertyType[]\n}\n\n/**\n * Represents a semantic that can be applied to an association between entities.\n */\nexport interface AssociationSemantic extends BaseDataSemantic {\n scope: SemanticScope.Association\n}\n\n/**\n * A type guard to check if a semantic is an EntitySemantic.\n */\nexport const isEntitySemantic = (semantic: DataSemantic): semantic is EntitySemantic =>\n semantic.scope === SemanticScope.Entity\n\n/**\n * A type guard to check if a semantic is a PropertySemantic.\n */\nexport const isPropertySemantic = (semantic: DataSemantic): semantic is PropertySemantic =>\n semantic.scope === SemanticScope.Property\n\n/**\n * A type guard to check if a semantic is a AssociationSemantic.\n */\nexport const isAssociationSemantic = (semantic: DataSemantic): semantic is AssociationSemantic =>\n semantic.scope === SemanticScope.Association\n\n/**\n * Union type for any kind of data semantic\n */\nexport type DataSemantic = EntitySemantic | PropertySemantic | AssociationSemantic\n\n/**\n * A map to store the definitions of all available data semantics.\n * This acts as a central registry for the application.\n */\nexport const DataSemantics: Record<SemanticType, DataSemantic> = {\n //\n // Identity & Authentication\n //\n\n [SemanticType.User]: {\n id: SemanticType.User,\n displayName: 'User Entity',\n scope: SemanticScope.Entity,\n description: 'System users and accounts',\n category: SemanticCategory.Identity,\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.None,\n operations: [],\n },\n },\n [SemanticType.Password]: {\n id: SemanticType.Password,\n displayName: 'User Password',\n scope: SemanticScope.Property,\n description: 'Secure password field',\n category: SemanticCategory.Identity,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 10, // High priority for security\n canDisable: false, // Security semantics cannot be disabled\n },\n },\n [SemanticType.UserRole]: {\n id: SemanticType.UserRole,\n displayName: 'User Role Field',\n scope: SemanticScope.Property,\n description: 'User permissions and access level',\n category: SemanticCategory.Identity,\n applicableDataTypes: ['string'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [\n SemanticOperation.Create,\n SemanticOperation.Read,\n SemanticOperation.Update,\n SemanticOperation.Delete,\n SemanticOperation.List,\n ],\n priority: 20,\n },\n },\n [SemanticType.ResourceOwnerIdentifier]: {\n id: SemanticType.ResourceOwnerIdentifier,\n displayName: 'Resource Owner Identifier',\n scope: SemanticScope.Association,\n description: 'Links record to owner user',\n category: SemanticCategory.Identity,\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [\n SemanticOperation.Create,\n SemanticOperation.Read,\n SemanticOperation.Update,\n SemanticOperation.Delete,\n SemanticOperation.List,\n ],\n priority: 5, // Very high priority for access control\n canDisable: false,\n },\n },\n\n //\n // Timestamps & Versioning\n //\n\n [SemanticType.CreatedTimestamp]: {\n id: SemanticType.CreatedTimestamp,\n displayName: 'Creation Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was created',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create],\n priority: 90,\n },\n },\n [SemanticType.UpdatedTimestamp]: {\n id: SemanticType.UpdatedTimestamp,\n displayName: 'Update Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was last modified',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Update],\n priority: 90,\n },\n },\n [SemanticType.DeletedTimestamp]: {\n id: SemanticType.DeletedTimestamp,\n displayName: 'Soft Delete Timestamp',\n scope: SemanticScope.Property,\n description: 'When record was marked deleted',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['datetime'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Delete],\n priority: 80,\n },\n },\n [SemanticType.DeletedFlag]: {\n id: SemanticType.DeletedFlag,\n displayName: 'Soft Delete Flag',\n scope: SemanticScope.Property,\n description: 'Mark record as deleted',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['boolean'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Delete, SemanticOperation.Read, SemanticOperation.List],\n priority: 80,\n },\n },\n [SemanticType.Version]: {\n id: SemanticType.Version,\n displayName: 'Version Number',\n scope: SemanticScope.Property,\n description: 'Auto-incrementing version counter',\n category: SemanticCategory.Lifecycle,\n applicableDataTypes: ['number'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Update],\n priority: 85,\n },\n },\n\n //\n // Content & Media\n //\n\n [SemanticType.Title]: {\n id: SemanticType.Title,\n displayName: 'Record Title',\n scope: SemanticScope.Property,\n description: 'Main title or heading',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.None,\n operations: [],\n },\n },\n [SemanticType.Description]: {\n id: SemanticType.Description,\n displayName: 'Description',\n scope: SemanticScope.Property,\n description: 'Detailed description text',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.None,\n operations: [],\n },\n },\n [SemanticType.Summary]: {\n id: SemanticType.Summary,\n displayName: 'Summary',\n scope: SemanticScope.Property,\n description: 'Brief summary text',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.None,\n operations: [],\n },\n },\n [SemanticType.Markdown]: {\n id: SemanticType.Markdown,\n displayName: 'Markdown Content',\n scope: SemanticScope.Property,\n description: 'Formatted text content',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 50, // Process before storage\n },\n },\n [SemanticType.HTML]: {\n id: SemanticType.HTML,\n displayName: 'HTML Content',\n scope: SemanticScope.Property,\n description: 'Rich HTML content',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 50, // Process before storage for sanitization\n },\n },\n [SemanticType.ImageURL]: {\n id: SemanticType.ImageURL,\n displayName: 'Image URL',\n scope: SemanticScope.Property,\n description: 'Link to image file',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 60, // Validate URLs before storage\n },\n },\n [SemanticType.FileURL]: {\n id: SemanticType.FileURL,\n displayName: 'File URL',\n scope: SemanticScope.Property,\n description: 'Link to file attachment',\n category: SemanticCategory.Content,\n applicableDataTypes: ['string'],\n hasConfig: false,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 60, // Validate URLs before storage\n },\n },\n\n //\n // Business Data\n //\n\n [SemanticType.Status]: {\n id: SemanticType.Status,\n displayName: 'Record Status',\n scope: SemanticScope.Property,\n description: 'Current state of record',\n category: SemanticCategory.Business,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Both,\n operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Read, SemanticOperation.List],\n priority: 30, // Validate state transitions before, filter by state after\n },\n },\n [SemanticType.Currency]: {\n id: SemanticType.Currency,\n displayName: 'Currency',\n scope: SemanticScope.Property,\n description: 'Monetary value with currency',\n category: SemanticCategory.Business,\n applicableDataTypes: ['number', 'string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 70, // Validate currency format and precision\n },\n },\n [SemanticType.SKU]: {\n id: SemanticType.SKU,\n displayName: 'SKU',\n scope: SemanticScope.Property,\n description: 'Product identification code',\n category: SemanticCategory.Business,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 25, // High priority for uniqueness validation\n },\n },\n\n //\n // Contact Information\n //\n\n [SemanticType.Email]: {\n id: SemanticType.Email,\n displayName: 'Email',\n scope: SemanticScope.Property,\n description: 'Email address',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 40, // Validate email format\n },\n },\n [SemanticType.Phone]: {\n id: SemanticType.Phone,\n displayName: 'Phone',\n scope: SemanticScope.Property,\n description: 'Phone number',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 40, // Validate phone format\n },\n },\n [SemanticType.URL]: {\n id: SemanticType.URL,\n displayName: 'URL',\n scope: SemanticScope.Property,\n description: 'Web address or link',\n category: SemanticCategory.Contact,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 40, // Validate URL format\n },\n },\n\n //\n // Classification & Organization\n //\n\n [SemanticType.PublicUniqueName]: {\n id: SemanticType.PublicUniqueName,\n displayName: 'Public Unique Name (Slug)',\n scope: SemanticScope.Property,\n description: 'URL-friendly unique identifier',\n category: SemanticCategory.Organization,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Before,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 30, // Generate slug from title, validate uniqueness\n },\n },\n [SemanticType.Tags]: {\n id: SemanticType.Tags,\n displayName: 'Tags',\n scope: SemanticScope.Association,\n description: 'Enable tagging functionality',\n category: SemanticCategory.Organization,\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.After,\n operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Delete],\n priority: 200, // Process after main operation\n },\n },\n [SemanticType.Categories]: {\n id: SemanticType.Categories,\n displayName: 'Categories',\n scope: SemanticScope.Association,\n description: 'Enable categorization functionality',\n category: SemanticCategory.Organization,\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.After,\n operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Delete],\n priority: 200, // Process after main operation\n },\n },\n\n //\n // Location & Geography\n //\n\n [SemanticType.GeospatialCoordinates]: {\n id: SemanticType.GeospatialCoordinates,\n displayName: 'Geospatial Coordinates',\n scope: SemanticScope.Property,\n description: 'Location coordinates',\n category: SemanticCategory.Location,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Both,\n operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Read, SemanticOperation.List],\n priority: 60, // Validate coordinates before, enable spatial queries after\n },\n },\n\n //\n // Computed Values\n //\n\n // Calculated field can be added to any data type as we can compute any value.\n [SemanticType.Calculated]: {\n id: SemanticType.Calculated,\n displayName: 'Calculated',\n scope: SemanticScope.Property,\n description: 'Auto-calculated field value',\n category: SemanticCategory.Computed,\n applicableDataTypes: ['string', 'number', 'boolean', 'date', 'datetime', 'time', 'binary'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.Both,\n operations: [SemanticOperation.Create, SemanticOperation.Update, SemanticOperation.Read],\n priority: 150, // Calculate after other validations, recalculate on read if needed\n },\n },\n [SemanticType.Derived]: {\n id: SemanticType.Derived,\n displayName: 'Derived',\n scope: SemanticScope.Property,\n description: 'Value derived from other fields',\n category: SemanticCategory.Computed,\n applicableDataTypes: ['string'],\n hasConfig: true,\n runtime: {\n timing: SemanticTiming.After,\n operations: [SemanticOperation.Create, SemanticOperation.Update],\n priority: 180, // Derive after all other processing\n },\n },\n}\n\n/**\n * Get all semantics that should run for a specific operation and timing\n */\nexport function getSemanticsForOperation(\n semantics: AppliedDataSemantic[],\n operation: SemanticOperation,\n timing: SemanticTiming\n): AppliedDataSemantic[] {\n return semantics\n .filter((semantic) => {\n const definition = DataSemantics[semantic.id]\n if (!definition?.runtime) {\n return false\n }\n\n const { timing: semanticTiming, operations } = definition.runtime\n\n // Check if timing matches\n const timingMatches = semanticTiming === timing || semanticTiming === SemanticTiming.Both\n\n // Check if operation is included\n const operationMatches = operations.includes(operation)\n\n return timingMatches && operationMatches\n })\n .sort((a, b) => {\n // Sort by priority (lower number = higher priority)\n const priorityA = DataSemantics[a.id]?.runtime?.priority ?? 100\n const priorityB = DataSemantics[b.id]?.runtime?.priority ?? 100\n return priorityA - priorityB\n })\n}\n\n/**\n * Check if a specific semantic can be disabled at runtime\n */\nexport function canSemanticBeDisabled(semanticType: SemanticType): boolean {\n const definition = DataSemantics[semanticType]\n return definition?.runtime?.canDisable !== false // Default to true if not specified\n}\n\nexport function getSemanticsByCategory(): Record<SemanticCategory, DataSemantic[]>\nexport function getSemanticsByCategory(scope: SemanticScope.Entity): Record<SemanticCategory, EntitySemantic[]>\nexport function getSemanticsByCategory(scope: SemanticScope.Property): Record<SemanticCategory, PropertySemantic[]>\nexport function getSemanticsByCategory(\n scope: SemanticScope.Association\n): Record<SemanticCategory, AssociationSemantic[]>\n\n/**\n * Helper function to get all semantics grouped by category.\n * Useful for organizing semantics in UI dropdowns and forms.\n *\n * @param scope Optional scope to filter semantics by (Entity, Property, Association)\n */\nexport function getSemanticsByCategory(scope?: SemanticScope): Record<SemanticCategory, DataSemantic[]> {\n const result: Record<SemanticCategory, DataSemantic[]> = {\n [SemanticCategory.Identity]: [],\n [SemanticCategory.Lifecycle]: [],\n [SemanticCategory.Content]: [],\n [SemanticCategory.Business]: [],\n [SemanticCategory.Contact]: [],\n [SemanticCategory.Organization]: [],\n [SemanticCategory.Location]: [],\n [SemanticCategory.Computed]: [],\n }\n\n Object.values(DataSemantics).forEach((semantic) => {\n // If a scope is provided, filter semantics by that scope\n if (scope && semantic.scope !== scope) {\n return\n }\n result[semantic.category].push(semantic)\n })\n\n return result\n}\n\n/**\n * Helper function to get semantics for a specific category.\n * @param category The category to filter by\n * @returns Array of semantics in the specified category\n */\nexport const getSemanticsByCategoryType = (category: SemanticCategory): DataSemantic[] => {\n return Object.values(DataSemantics).filter((semantic) => semantic.category === category)\n}\n\n/**\n * Represents the application of a data semantic to a specific\n * entity or property within a user's data model.\n */\nexport interface AppliedDataSemantic {\n /**\n * The unique identifier of the semantic being applied.\n */\n id: SemanticType\n\n /**\n * Optional configuration or values specific to this application.\n */\n config?: Record<string, unknown>\n}\n"]}
|
|
@@ -13,10 +13,6 @@ export interface EmailConfig {
|
|
|
13
13
|
* Whether email verification is required.
|
|
14
14
|
*/
|
|
15
15
|
requireVerification?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Method to use for verification: 'email' or 'sms'.
|
|
18
|
-
*/
|
|
19
|
-
verificationMethod?: 'email' | 'sms';
|
|
20
16
|
/**
|
|
21
17
|
* Whether to allow subaddressing (user+tag@domain.com).
|
|
22
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/Email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,EAAE,EAAE,YAAY,CAAC,KAAK,CAAA;IACtB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,mBAAmB,KAAG,QAAQ,IAAI,oBAE3E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAQ,WAAgB,KAAG,oBAa9D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAIlC,CAAA"}
|
|
@@ -25,8 +25,7 @@ export const createEmailSemantic = (config = {}) => {
|
|
|
25
25
|
* Default configuration for Email semantic.
|
|
26
26
|
*/
|
|
27
27
|
export const DEFAULT_EMAIL_CONFIG = {
|
|
28
|
-
requireVerification:
|
|
29
|
-
verificationMethod: 'email',
|
|
28
|
+
requireVerification: true,
|
|
30
29
|
allowSubaddressing: true,
|
|
31
30
|
allowInternational: true,
|
|
32
31
|
};
|