@api-client/core 0.17.2 → 0.17.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@api-client/core",
3
3
  "description": "The API Client's core client library. Works in NodeJS and in a ES enabled browser.",
4
- "version": "0.17.2",
4
+ "version": "0.17.4",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  "./browser.js": {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-redeclare */
1
2
  /* eslint-disable max-len */
2
3
  import type { DomainPropertyType } from './DataFormat.js'
3
4
 
@@ -292,6 +293,11 @@ interface BaseDataSemantic {
292
293
  * The category this semantic belongs to for UI organization.
293
294
  */
294
295
  category: SemanticCategory
296
+ /**
297
+ * Whether the semantic has a configuration or additional options.
298
+ * This is used to determine if the semantic requires additional setup or configuration.
299
+ */
300
+ hasConfig: boolean
295
301
  }
296
302
 
297
303
  /**
@@ -358,6 +364,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
358
364
  scope: SemanticScope.Entity,
359
365
  description: 'System users and accounts',
360
366
  category: SemanticCategory.Identity,
367
+ hasConfig: false,
361
368
  },
362
369
  [SemanticType.Password]: {
363
370
  id: SemanticType.Password,
@@ -366,6 +373,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
366
373
  description: 'Secure password field',
367
374
  category: SemanticCategory.Identity,
368
375
  applicableDataTypes: ['string'],
376
+ hasConfig: true,
369
377
  },
370
378
  [SemanticType.UserRole]: {
371
379
  id: SemanticType.UserRole,
@@ -374,6 +382,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
374
382
  description: 'User permissions and access level',
375
383
  category: SemanticCategory.Identity,
376
384
  applicableDataTypes: ['string'],
385
+ hasConfig: false,
377
386
  },
378
387
  [SemanticType.ResourceOwnerIdentifier]: {
379
388
  id: SemanticType.ResourceOwnerIdentifier,
@@ -381,6 +390,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
381
390
  scope: SemanticScope.Association,
382
391
  description: 'Links record to owner user',
383
392
  category: SemanticCategory.Identity,
393
+ hasConfig: false,
384
394
  },
385
395
 
386
396
  //
@@ -394,6 +404,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
394
404
  description: 'When record was created',
395
405
  category: SemanticCategory.Lifecycle,
396
406
  applicableDataTypes: ['datetime'],
407
+ hasConfig: false,
397
408
  },
398
409
  [SemanticType.UpdatedTimestamp]: {
399
410
  id: SemanticType.UpdatedTimestamp,
@@ -402,6 +413,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
402
413
  description: 'When record was last modified',
403
414
  category: SemanticCategory.Lifecycle,
404
415
  applicableDataTypes: ['datetime'],
416
+ hasConfig: false,
405
417
  },
406
418
  [SemanticType.DeletedTimestamp]: {
407
419
  id: SemanticType.DeletedTimestamp,
@@ -410,6 +422,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
410
422
  description: 'When record was marked deleted',
411
423
  category: SemanticCategory.Lifecycle,
412
424
  applicableDataTypes: ['datetime'],
425
+ hasConfig: false,
413
426
  },
414
427
  [SemanticType.DeletedFlag]: {
415
428
  id: SemanticType.DeletedFlag,
@@ -418,6 +431,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
418
431
  description: 'Mark record as deleted',
419
432
  category: SemanticCategory.Lifecycle,
420
433
  applicableDataTypes: ['boolean'],
434
+ hasConfig: false,
421
435
  },
422
436
  [SemanticType.Version]: {
423
437
  id: SemanticType.Version,
@@ -426,6 +440,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
426
440
  description: 'Auto-incrementing version counter',
427
441
  category: SemanticCategory.Lifecycle,
428
442
  applicableDataTypes: ['number'],
443
+ hasConfig: false,
429
444
  },
430
445
 
431
446
  //
@@ -439,6 +454,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
439
454
  description: 'Main title or heading',
440
455
  category: SemanticCategory.Content,
441
456
  applicableDataTypes: ['string'],
457
+ hasConfig: false,
442
458
  },
443
459
  [SemanticType.Description]: {
444
460
  id: SemanticType.Description,
@@ -447,6 +463,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
447
463
  description: 'Detailed description text',
448
464
  category: SemanticCategory.Content,
449
465
  applicableDataTypes: ['string'],
466
+ hasConfig: true,
450
467
  },
451
468
  [SemanticType.Summary]: {
452
469
  id: SemanticType.Summary,
@@ -455,6 +472,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
455
472
  description: 'Brief summary text',
456
473
  category: SemanticCategory.Content,
457
474
  applicableDataTypes: ['string'],
475
+ hasConfig: true,
458
476
  },
459
477
  [SemanticType.Markdown]: {
460
478
  id: SemanticType.Markdown,
@@ -463,6 +481,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
463
481
  description: 'Formatted text content',
464
482
  category: SemanticCategory.Content,
465
483
  applicableDataTypes: ['string'],
484
+ hasConfig: true,
466
485
  },
467
486
  [SemanticType.HTML]: {
468
487
  id: SemanticType.HTML,
@@ -471,6 +490,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
471
490
  description: 'Rich HTML content',
472
491
  category: SemanticCategory.Content,
473
492
  applicableDataTypes: ['string'],
493
+ hasConfig: true,
474
494
  },
475
495
  [SemanticType.ImageURL]: {
476
496
  id: SemanticType.ImageURL,
@@ -479,6 +499,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
479
499
  description: 'Link to image file',
480
500
  category: SemanticCategory.Content,
481
501
  applicableDataTypes: ['string'],
502
+ hasConfig: false,
482
503
  },
483
504
  [SemanticType.FileURL]: {
484
505
  id: SemanticType.FileURL,
@@ -487,6 +508,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
487
508
  description: 'Link to file attachment',
488
509
  category: SemanticCategory.Content,
489
510
  applicableDataTypes: ['string'],
511
+ hasConfig: false,
490
512
  },
491
513
 
492
514
  //
@@ -500,6 +522,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
500
522
  description: 'Current state of record',
501
523
  category: SemanticCategory.Business,
502
524
  applicableDataTypes: ['string'],
525
+ hasConfig: true,
503
526
  },
504
527
  [SemanticType.Price]: {
505
528
  id: SemanticType.Price,
@@ -508,6 +531,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
508
531
  description: 'Monetary value with currency',
509
532
  category: SemanticCategory.Business,
510
533
  applicableDataTypes: ['number', 'string'],
534
+ hasConfig: true,
511
535
  },
512
536
  [SemanticType.SKU]: {
513
537
  id: SemanticType.SKU,
@@ -516,6 +540,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
516
540
  description: 'Product identification code',
517
541
  category: SemanticCategory.Business,
518
542
  applicableDataTypes: ['string'],
543
+ hasConfig: true,
519
544
  },
520
545
 
521
546
  //
@@ -529,6 +554,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
529
554
  description: 'Email address',
530
555
  category: SemanticCategory.Contact,
531
556
  applicableDataTypes: ['string'],
557
+ hasConfig: true,
532
558
  },
533
559
  [SemanticType.Phone]: {
534
560
  id: SemanticType.Phone,
@@ -537,6 +563,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
537
563
  description: 'Phone number',
538
564
  category: SemanticCategory.Contact,
539
565
  applicableDataTypes: ['string'],
566
+ hasConfig: true,
540
567
  },
541
568
  [SemanticType.URL]: {
542
569
  id: SemanticType.URL,
@@ -545,6 +572,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
545
572
  description: 'Web address or link',
546
573
  category: SemanticCategory.Contact,
547
574
  applicableDataTypes: ['string'],
575
+ hasConfig: true,
548
576
  },
549
577
 
550
578
  //
@@ -558,6 +586,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
558
586
  description: 'URL-friendly unique identifier',
559
587
  category: SemanticCategory.Organization,
560
588
  applicableDataTypes: ['string'],
589
+ hasConfig: true,
561
590
  },
562
591
  [SemanticType.Tags]: {
563
592
  id: SemanticType.Tags,
@@ -565,6 +594,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
565
594
  scope: SemanticScope.Association,
566
595
  description: 'Enable tagging functionality',
567
596
  category: SemanticCategory.Organization,
597
+ hasConfig: true,
568
598
  },
569
599
  [SemanticType.Categories]: {
570
600
  id: SemanticType.Categories,
@@ -572,6 +602,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
572
602
  scope: SemanticScope.Association,
573
603
  description: 'Enable categorization functionality',
574
604
  category: SemanticCategory.Organization,
605
+ hasConfig: true,
575
606
  },
576
607
 
577
608
  //
@@ -585,6 +616,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
585
616
  description: 'Location coordinates',
586
617
  category: SemanticCategory.Location,
587
618
  applicableDataTypes: ['string'],
619
+ hasConfig: true,
588
620
  },
589
621
 
590
622
  //
@@ -598,6 +630,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
598
630
  description: 'Auto-calculated field value',
599
631
  category: SemanticCategory.Computed,
600
632
  applicableDataTypes: ['string'],
633
+ hasConfig: true,
601
634
  },
602
635
  [SemanticType.Derived]: {
603
636
  id: SemanticType.Derived,
@@ -606,16 +639,24 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
606
639
  description: 'Value derived from other fields',
607
640
  category: SemanticCategory.Computed,
608
641
  applicableDataTypes: ['string'],
642
+ hasConfig: true,
609
643
  },
610
644
  }
611
645
 
646
+ export function getSemanticsByCategory(): Record<SemanticCategory, DataSemantic[]>
647
+ export function getSemanticsByCategory(scope: SemanticScope.Entity): Record<SemanticCategory, EntitySemantic[]>
648
+ export function getSemanticsByCategory(scope: SemanticScope.Property): Record<SemanticCategory, PropertySemantic[]>
649
+ export function getSemanticsByCategory(
650
+ scope: SemanticScope.Association
651
+ ): Record<SemanticCategory, AssociationSemantic[]>
652
+
612
653
  /**
613
654
  * Helper function to get all semantics grouped by category.
614
655
  * Useful for organizing semantics in UI dropdowns and forms.
615
656
  *
616
657
  * @param scope Optional scope to filter semantics by (Entity, Property, Association)
617
658
  */
618
- export const getSemanticsByCategory = (scope?: SemanticScope): Record<SemanticCategory, DataSemantic[]> => {
659
+ export function getSemanticsByCategory(scope?: SemanticScope): Record<SemanticCategory, DataSemantic[]> {
619
660
  const result: Record<SemanticCategory, DataSemantic[]> = {
620
661
  [SemanticCategory.Identity]: [],
621
662
  [SemanticCategory.Lifecycle]: [],