@api-client/core 0.16.0 → 0.17.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/build/src/modeling/Semantics.d.ts +52 -0
- package/build/src/modeling/Semantics.d.ts.map +1 -1
- package/build/src/modeling/Semantics.js +206 -97
- package/build/src/modeling/Semantics.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/modeling/Semantics.ts +226 -101
- package/tests/unit/modeling/semantics.spec.ts +73 -1
|
@@ -202,6 +202,43 @@ export declare enum SemanticScope {
|
|
|
202
202
|
*/
|
|
203
203
|
Association = "Association"
|
|
204
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Defines categories for organizing semantics in the UI.
|
|
207
|
+
*/
|
|
208
|
+
export declare enum SemanticCategory {
|
|
209
|
+
/**
|
|
210
|
+
* User management, authentication, and access control
|
|
211
|
+
*/
|
|
212
|
+
Identity = "Identity & Authentication",
|
|
213
|
+
/**
|
|
214
|
+
* Timestamps, versioning, and record lifecycle
|
|
215
|
+
*/
|
|
216
|
+
Lifecycle = "Timestamps & Versioning",
|
|
217
|
+
/**
|
|
218
|
+
* Text content, media, and rich content types
|
|
219
|
+
*/
|
|
220
|
+
Content = "Content & Media",
|
|
221
|
+
/**
|
|
222
|
+
* Business-specific data like pricing, inventory, status
|
|
223
|
+
*/
|
|
224
|
+
Business = "Business Data",
|
|
225
|
+
/**
|
|
226
|
+
* Contact information and communication
|
|
227
|
+
*/
|
|
228
|
+
Contact = "Contact Information",
|
|
229
|
+
/**
|
|
230
|
+
* Organization, categorization, and tagging
|
|
231
|
+
*/
|
|
232
|
+
Organization = "Classification & Organization",
|
|
233
|
+
/**
|
|
234
|
+
* Location and geographical data
|
|
235
|
+
*/
|
|
236
|
+
Location = "Location & Geography",
|
|
237
|
+
/**
|
|
238
|
+
* Calculated and derived values
|
|
239
|
+
*/
|
|
240
|
+
Computed = "Computed Values"
|
|
241
|
+
}
|
|
205
242
|
/**
|
|
206
243
|
* A base interface for all Data Semantics, containing common properties.
|
|
207
244
|
* A semantic is an annotation applied to a Data Entity, Property, or Association
|
|
@@ -225,6 +262,10 @@ interface BaseDataSemantic {
|
|
|
225
262
|
* Specifies whether the semantic applies to an Entity, Property, or Association.
|
|
226
263
|
*/
|
|
227
264
|
scope: SemanticScope;
|
|
265
|
+
/**
|
|
266
|
+
* The category this semantic belongs to for UI organization.
|
|
267
|
+
*/
|
|
268
|
+
category: SemanticCategory;
|
|
228
269
|
}
|
|
229
270
|
/**
|
|
230
271
|
* Represents a semantic that can be applied to an entire Data Entity.
|
|
@@ -270,6 +311,17 @@ export type DataSemantic = EntitySemantic | PropertySemantic | AssociationSemant
|
|
|
270
311
|
* This acts as a central registry for the application.
|
|
271
312
|
*/
|
|
272
313
|
export declare const DataSemantics: Record<SemanticType, DataSemantic>;
|
|
314
|
+
/**
|
|
315
|
+
* Helper function to get all semantics grouped by category.
|
|
316
|
+
* Useful for organizing semantics in UI dropdowns and forms.
|
|
317
|
+
*/
|
|
318
|
+
export declare const getSemanticsByCategory: () => Record<SemanticCategory, DataSemantic[]>;
|
|
319
|
+
/**
|
|
320
|
+
* Helper function to get semantics for a specific category.
|
|
321
|
+
* @param category The category to filter by
|
|
322
|
+
* @returns Array of semantics in the specified category
|
|
323
|
+
*/
|
|
324
|
+
export declare const getSemanticsByCategoryType: (category: SemanticCategory) => DataSemantic[];
|
|
273
325
|
/**
|
|
274
326
|
* Represents the application of a data semantic to a specific
|
|
275
327
|
* entity or property within a user's data model.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Semantics.d.ts","sourceRoot":"","sources":["../../../src/modeling/Semantics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzD;;;GAGG;AACH,oBAAY,YAAY;IAKtB;;OAEG;IACH,IAAI,kBAAkB;IAMtB;;;;OAIG;IACH,QAAQ,sBAAsB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AM,kBAAkB,GAAI,UAAU,YAAY,KAAG,QAAQ,IAAI,gBAC7B,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,YAAY,KAAG,QAAQ,IAAI,mBAC7B,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,gBAAgB,GAAG,mBAAmB,CAAA;AAElF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE,YAAY,CAoQ5D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAO,MAAM,CAAC,gBAAgB,EAAE,YAAY,EAAE,CAiBhF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,UAAU,gBAAgB,KAAG,YAAY,EAEnF,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,EAAE,YAAY,CAAA;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC"}
|
|
@@ -212,6 +212,44 @@ export var SemanticScope;
|
|
|
212
212
|
*/
|
|
213
213
|
SemanticScope["Association"] = "Association";
|
|
214
214
|
})(SemanticScope || (SemanticScope = {}));
|
|
215
|
+
/**
|
|
216
|
+
* Defines categories for organizing semantics in the UI.
|
|
217
|
+
*/
|
|
218
|
+
export var SemanticCategory;
|
|
219
|
+
(function (SemanticCategory) {
|
|
220
|
+
/**
|
|
221
|
+
* User management, authentication, and access control
|
|
222
|
+
*/
|
|
223
|
+
SemanticCategory["Identity"] = "Identity & Authentication";
|
|
224
|
+
/**
|
|
225
|
+
* Timestamps, versioning, and record lifecycle
|
|
226
|
+
*/
|
|
227
|
+
SemanticCategory["Lifecycle"] = "Timestamps & Versioning";
|
|
228
|
+
/**
|
|
229
|
+
* Text content, media, and rich content types
|
|
230
|
+
*/
|
|
231
|
+
SemanticCategory["Content"] = "Content & Media";
|
|
232
|
+
/**
|
|
233
|
+
* Business-specific data like pricing, inventory, status
|
|
234
|
+
*/
|
|
235
|
+
SemanticCategory["Business"] = "Business Data";
|
|
236
|
+
/**
|
|
237
|
+
* Contact information and communication
|
|
238
|
+
*/
|
|
239
|
+
SemanticCategory["Contact"] = "Contact Information";
|
|
240
|
+
/**
|
|
241
|
+
* Organization, categorization, and tagging
|
|
242
|
+
*/
|
|
243
|
+
SemanticCategory["Organization"] = "Classification & Organization";
|
|
244
|
+
/**
|
|
245
|
+
* Location and geographical data
|
|
246
|
+
*/
|
|
247
|
+
SemanticCategory["Location"] = "Location & Geography";
|
|
248
|
+
/**
|
|
249
|
+
* Calculated and derived values
|
|
250
|
+
*/
|
|
251
|
+
SemanticCategory["Computed"] = "Computed Values";
|
|
252
|
+
})(SemanticCategory || (SemanticCategory = {}));
|
|
215
253
|
/**
|
|
216
254
|
* A type guard to check if a semantic is an EntitySemantic.
|
|
217
255
|
*/
|
|
@@ -230,205 +268,276 @@ export const isAssociationSemantic = (semantic) => semantic.scope === SemanticSc
|
|
|
230
268
|
*/
|
|
231
269
|
export const DataSemantics = {
|
|
232
270
|
//
|
|
233
|
-
//
|
|
271
|
+
// Identity & Authentication
|
|
234
272
|
//
|
|
235
273
|
[SemanticType.User]: {
|
|
236
274
|
id: SemanticType.User,
|
|
237
275
|
displayName: 'User Entity',
|
|
238
276
|
scope: SemanticScope.Entity,
|
|
239
|
-
description: '
|
|
277
|
+
description: 'System users and accounts',
|
|
278
|
+
category: SemanticCategory.Identity,
|
|
240
279
|
},
|
|
241
|
-
//
|
|
242
|
-
// Property-Level Definitions
|
|
243
|
-
//
|
|
244
280
|
[SemanticType.Password]: {
|
|
245
281
|
id: SemanticType.Password,
|
|
246
282
|
displayName: 'User Password',
|
|
247
283
|
scope: SemanticScope.Property,
|
|
248
|
-
description: '
|
|
284
|
+
description: 'Secure password field',
|
|
285
|
+
category: SemanticCategory.Identity,
|
|
286
|
+
applicableDataTypes: ['string'],
|
|
287
|
+
},
|
|
288
|
+
[SemanticType.UserRole]: {
|
|
289
|
+
id: SemanticType.UserRole,
|
|
290
|
+
displayName: 'User Role Field',
|
|
291
|
+
scope: SemanticScope.Property,
|
|
292
|
+
description: 'User permissions and access level',
|
|
293
|
+
category: SemanticCategory.Identity,
|
|
249
294
|
applicableDataTypes: ['string'],
|
|
250
295
|
},
|
|
296
|
+
[SemanticType.ResourceOwnerIdentifier]: {
|
|
297
|
+
id: SemanticType.ResourceOwnerIdentifier,
|
|
298
|
+
displayName: 'Resource Owner Identifier',
|
|
299
|
+
scope: SemanticScope.Association,
|
|
300
|
+
description: 'Links record to owner user',
|
|
301
|
+
category: SemanticCategory.Identity,
|
|
302
|
+
},
|
|
303
|
+
//
|
|
304
|
+
// Timestamps & Versioning
|
|
305
|
+
//
|
|
251
306
|
[SemanticType.CreatedTimestamp]: {
|
|
252
307
|
id: SemanticType.CreatedTimestamp,
|
|
253
308
|
displayName: 'Creation Timestamp',
|
|
254
309
|
scope: SemanticScope.Property,
|
|
255
|
-
description:
|
|
310
|
+
description: 'When record was created',
|
|
311
|
+
category: SemanticCategory.Lifecycle,
|
|
256
312
|
applicableDataTypes: ['datetime'],
|
|
257
313
|
},
|
|
258
314
|
[SemanticType.UpdatedTimestamp]: {
|
|
259
315
|
id: SemanticType.UpdatedTimestamp,
|
|
260
316
|
displayName: 'Update Timestamp',
|
|
261
317
|
scope: SemanticScope.Property,
|
|
262
|
-
description:
|
|
318
|
+
description: 'When record was last modified',
|
|
319
|
+
category: SemanticCategory.Lifecycle,
|
|
263
320
|
applicableDataTypes: ['datetime'],
|
|
264
321
|
},
|
|
265
322
|
[SemanticType.DeletedTimestamp]: {
|
|
266
323
|
id: SemanticType.DeletedTimestamp,
|
|
267
324
|
displayName: 'Soft Delete Timestamp',
|
|
268
325
|
scope: SemanticScope.Property,
|
|
269
|
-
description:
|
|
326
|
+
description: 'When record was marked deleted',
|
|
327
|
+
category: SemanticCategory.Lifecycle,
|
|
270
328
|
applicableDataTypes: ['datetime'],
|
|
271
329
|
},
|
|
272
|
-
[SemanticType.
|
|
273
|
-
id: SemanticType.
|
|
274
|
-
displayName: '
|
|
330
|
+
[SemanticType.DeletedFlag]: {
|
|
331
|
+
id: SemanticType.DeletedFlag,
|
|
332
|
+
displayName: 'Soft Delete Flag',
|
|
275
333
|
scope: SemanticScope.Property,
|
|
276
|
-
description: '
|
|
277
|
-
|
|
334
|
+
description: 'Mark record as deleted',
|
|
335
|
+
category: SemanticCategory.Lifecycle,
|
|
336
|
+
applicableDataTypes: ['boolean'],
|
|
278
337
|
},
|
|
338
|
+
[SemanticType.Version]: {
|
|
339
|
+
id: SemanticType.Version,
|
|
340
|
+
displayName: 'Version Number',
|
|
341
|
+
scope: SemanticScope.Property,
|
|
342
|
+
description: 'Auto-incrementing version counter',
|
|
343
|
+
category: SemanticCategory.Lifecycle,
|
|
344
|
+
applicableDataTypes: ['number'],
|
|
345
|
+
},
|
|
346
|
+
//
|
|
347
|
+
// Content & Media
|
|
348
|
+
//
|
|
279
349
|
[SemanticType.Title]: {
|
|
280
350
|
id: SemanticType.Title,
|
|
281
351
|
displayName: 'Record Title',
|
|
282
352
|
scope: SemanticScope.Property,
|
|
283
|
-
description: '
|
|
353
|
+
description: 'Main title or heading',
|
|
354
|
+
category: SemanticCategory.Content,
|
|
284
355
|
applicableDataTypes: ['string'],
|
|
285
356
|
},
|
|
286
|
-
[SemanticType.
|
|
287
|
-
id: SemanticType.
|
|
288
|
-
displayName: '
|
|
357
|
+
[SemanticType.Description]: {
|
|
358
|
+
id: SemanticType.Description,
|
|
359
|
+
displayName: 'Description',
|
|
289
360
|
scope: SemanticScope.Property,
|
|
290
|
-
description:
|
|
361
|
+
description: 'Detailed description text',
|
|
362
|
+
category: SemanticCategory.Content,
|
|
291
363
|
applicableDataTypes: ['string'],
|
|
292
364
|
},
|
|
293
|
-
[SemanticType.
|
|
294
|
-
id: SemanticType.
|
|
295
|
-
displayName: '
|
|
365
|
+
[SemanticType.Summary]: {
|
|
366
|
+
id: SemanticType.Summary,
|
|
367
|
+
displayName: 'Summary',
|
|
296
368
|
scope: SemanticScope.Property,
|
|
297
|
-
description: '
|
|
369
|
+
description: 'Brief summary text',
|
|
370
|
+
category: SemanticCategory.Content,
|
|
298
371
|
applicableDataTypes: ['string'],
|
|
299
372
|
},
|
|
300
|
-
[SemanticType.
|
|
301
|
-
id: SemanticType.
|
|
302
|
-
displayName: '
|
|
373
|
+
[SemanticType.Markdown]: {
|
|
374
|
+
id: SemanticType.Markdown,
|
|
375
|
+
displayName: 'Markdown Content',
|
|
303
376
|
scope: SemanticScope.Property,
|
|
304
|
-
description: '
|
|
305
|
-
|
|
377
|
+
description: 'Formatted text content',
|
|
378
|
+
category: SemanticCategory.Content,
|
|
379
|
+
applicableDataTypes: ['string'],
|
|
380
|
+
},
|
|
381
|
+
[SemanticType.HTML]: {
|
|
382
|
+
id: SemanticType.HTML,
|
|
383
|
+
displayName: 'HTML Content',
|
|
384
|
+
scope: SemanticScope.Property,
|
|
385
|
+
description: 'Rich HTML content',
|
|
386
|
+
category: SemanticCategory.Content,
|
|
387
|
+
applicableDataTypes: ['string'],
|
|
306
388
|
},
|
|
307
389
|
[SemanticType.ImageURL]: {
|
|
308
390
|
id: SemanticType.ImageURL,
|
|
309
391
|
displayName: 'Image URL',
|
|
310
392
|
scope: SemanticScope.Property,
|
|
311
|
-
description: '
|
|
393
|
+
description: 'Link to image file',
|
|
394
|
+
category: SemanticCategory.Content,
|
|
312
395
|
applicableDataTypes: ['string'],
|
|
313
396
|
},
|
|
314
397
|
[SemanticType.FileURL]: {
|
|
315
398
|
id: SemanticType.FileURL,
|
|
316
399
|
displayName: 'File URL',
|
|
317
400
|
scope: SemanticScope.Property,
|
|
318
|
-
description: '
|
|
401
|
+
description: 'Link to file attachment',
|
|
402
|
+
category: SemanticCategory.Content,
|
|
319
403
|
applicableDataTypes: ['string'],
|
|
320
404
|
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
[SemanticType.Markdown]: {
|
|
329
|
-
id: SemanticType.Markdown,
|
|
330
|
-
displayName: 'Markdown Content',
|
|
405
|
+
//
|
|
406
|
+
// Business Data
|
|
407
|
+
//
|
|
408
|
+
[SemanticType.Status]: {
|
|
409
|
+
id: SemanticType.Status,
|
|
410
|
+
displayName: 'Record Status',
|
|
331
411
|
scope: SemanticScope.Property,
|
|
332
|
-
description: '
|
|
412
|
+
description: 'Current state of record',
|
|
413
|
+
category: SemanticCategory.Business,
|
|
333
414
|
applicableDataTypes: ['string'],
|
|
334
415
|
},
|
|
335
|
-
[SemanticType.
|
|
336
|
-
id: SemanticType.
|
|
337
|
-
displayName: '
|
|
416
|
+
[SemanticType.Price]: {
|
|
417
|
+
id: SemanticType.Price,
|
|
418
|
+
displayName: 'Price',
|
|
338
419
|
scope: SemanticScope.Property,
|
|
339
|
-
description: '
|
|
340
|
-
|
|
420
|
+
description: 'Monetary value with currency',
|
|
421
|
+
category: SemanticCategory.Business,
|
|
422
|
+
applicableDataTypes: ['number', 'string'],
|
|
341
423
|
},
|
|
342
|
-
[SemanticType.
|
|
343
|
-
id: SemanticType.
|
|
344
|
-
displayName: '
|
|
424
|
+
[SemanticType.SKU]: {
|
|
425
|
+
id: SemanticType.SKU,
|
|
426
|
+
displayName: 'SKU',
|
|
345
427
|
scope: SemanticScope.Property,
|
|
346
|
-
description: '
|
|
428
|
+
description: 'Product identification code',
|
|
429
|
+
category: SemanticCategory.Business,
|
|
347
430
|
applicableDataTypes: ['string'],
|
|
348
431
|
},
|
|
432
|
+
//
|
|
433
|
+
// Contact Information
|
|
434
|
+
//
|
|
349
435
|
[SemanticType.Email]: {
|
|
350
436
|
id: SemanticType.Email,
|
|
351
437
|
displayName: 'Email',
|
|
352
438
|
scope: SemanticScope.Property,
|
|
353
|
-
description: '
|
|
439
|
+
description: 'Email address',
|
|
440
|
+
category: SemanticCategory.Contact,
|
|
354
441
|
applicableDataTypes: ['string'],
|
|
355
442
|
},
|
|
356
443
|
[SemanticType.Phone]: {
|
|
357
444
|
id: SemanticType.Phone,
|
|
358
445
|
displayName: 'Phone',
|
|
359
446
|
scope: SemanticScope.Property,
|
|
360
|
-
description: '
|
|
447
|
+
description: 'Phone number',
|
|
448
|
+
category: SemanticCategory.Contact,
|
|
361
449
|
applicableDataTypes: ['string'],
|
|
362
450
|
},
|
|
363
|
-
[SemanticType.Price]: {
|
|
364
|
-
id: SemanticType.Price,
|
|
365
|
-
displayName: 'Price',
|
|
366
|
-
scope: SemanticScope.Property,
|
|
367
|
-
description: 'Annotates a field as a monetary value with currency support and precision control.',
|
|
368
|
-
applicableDataTypes: ['number', 'string'],
|
|
369
|
-
},
|
|
370
451
|
[SemanticType.URL]: {
|
|
371
452
|
id: SemanticType.URL,
|
|
372
453
|
displayName: 'URL',
|
|
373
454
|
scope: SemanticScope.Property,
|
|
374
|
-
description: '
|
|
455
|
+
description: 'Web address or link',
|
|
456
|
+
category: SemanticCategory.Contact,
|
|
375
457
|
applicableDataTypes: ['string'],
|
|
376
458
|
},
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
459
|
+
//
|
|
460
|
+
// Classification & Organization
|
|
461
|
+
//
|
|
462
|
+
[SemanticType.PublicUniqueName]: {
|
|
463
|
+
id: SemanticType.PublicUniqueName,
|
|
464
|
+
displayName: 'Public Unique Name (Slug)',
|
|
380
465
|
scope: SemanticScope.Property,
|
|
381
|
-
description: '
|
|
466
|
+
description: 'URL-friendly unique identifier',
|
|
467
|
+
category: SemanticCategory.Organization,
|
|
382
468
|
applicableDataTypes: ['string'],
|
|
383
469
|
},
|
|
384
|
-
[SemanticType.
|
|
385
|
-
id: SemanticType.
|
|
386
|
-
displayName: '
|
|
387
|
-
scope: SemanticScope.
|
|
388
|
-
description: '
|
|
389
|
-
|
|
470
|
+
[SemanticType.Tags]: {
|
|
471
|
+
id: SemanticType.Tags,
|
|
472
|
+
displayName: 'Tags',
|
|
473
|
+
scope: SemanticScope.Association,
|
|
474
|
+
description: 'Enable tagging functionality',
|
|
475
|
+
category: SemanticCategory.Organization,
|
|
390
476
|
},
|
|
391
|
-
[SemanticType.
|
|
392
|
-
id: SemanticType.
|
|
393
|
-
displayName: '
|
|
477
|
+
[SemanticType.Categories]: {
|
|
478
|
+
id: SemanticType.Categories,
|
|
479
|
+
displayName: 'Categories',
|
|
480
|
+
scope: SemanticScope.Association,
|
|
481
|
+
description: 'Enable categorization functionality',
|
|
482
|
+
category: SemanticCategory.Organization,
|
|
483
|
+
},
|
|
484
|
+
//
|
|
485
|
+
// Location & Geography
|
|
486
|
+
//
|
|
487
|
+
[SemanticType.GeospatialCoordinates]: {
|
|
488
|
+
id: SemanticType.GeospatialCoordinates,
|
|
489
|
+
displayName: 'Geospatial Coordinates',
|
|
394
490
|
scope: SemanticScope.Property,
|
|
395
|
-
description: '
|
|
491
|
+
description: 'Location coordinates',
|
|
492
|
+
category: SemanticCategory.Location,
|
|
396
493
|
applicableDataTypes: ['string'],
|
|
397
494
|
},
|
|
495
|
+
//
|
|
496
|
+
// Computed Values
|
|
497
|
+
//
|
|
398
498
|
[SemanticType.Calculated]: {
|
|
399
499
|
id: SemanticType.Calculated,
|
|
400
500
|
displayName: 'Calculated',
|
|
401
501
|
scope: SemanticScope.Property,
|
|
402
|
-
description: '
|
|
502
|
+
description: 'Auto-calculated field value',
|
|
503
|
+
category: SemanticCategory.Computed,
|
|
403
504
|
applicableDataTypes: ['string'],
|
|
404
505
|
},
|
|
405
506
|
[SemanticType.Derived]: {
|
|
406
507
|
id: SemanticType.Derived,
|
|
407
508
|
displayName: 'Derived',
|
|
408
509
|
scope: SemanticScope.Property,
|
|
409
|
-
description: '
|
|
510
|
+
description: 'Value derived from other fields',
|
|
511
|
+
category: SemanticCategory.Computed,
|
|
410
512
|
applicableDataTypes: ['string'],
|
|
411
513
|
},
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
514
|
+
};
|
|
515
|
+
/**
|
|
516
|
+
* Helper function to get all semantics grouped by category.
|
|
517
|
+
* Useful for organizing semantics in UI dropdowns and forms.
|
|
518
|
+
*/
|
|
519
|
+
export const getSemanticsByCategory = () => {
|
|
520
|
+
const result = {
|
|
521
|
+
[SemanticCategory.Identity]: [],
|
|
522
|
+
[SemanticCategory.Lifecycle]: [],
|
|
523
|
+
[SemanticCategory.Content]: [],
|
|
524
|
+
[SemanticCategory.Business]: [],
|
|
525
|
+
[SemanticCategory.Contact]: [],
|
|
526
|
+
[SemanticCategory.Organization]: [],
|
|
527
|
+
[SemanticCategory.Location]: [],
|
|
528
|
+
[SemanticCategory.Computed]: [],
|
|
529
|
+
};
|
|
530
|
+
Object.values(DataSemantics).forEach((semantic) => {
|
|
531
|
+
result[semantic.category].push(semantic);
|
|
532
|
+
});
|
|
533
|
+
return result;
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* Helper function to get semantics for a specific category.
|
|
537
|
+
* @param category The category to filter by
|
|
538
|
+
* @returns Array of semantics in the specified category
|
|
539
|
+
*/
|
|
540
|
+
export const getSemanticsByCategoryType = (category) => {
|
|
541
|
+
return Object.values(DataSemantics).filter((semantic) => semantic.category === category);
|
|
433
542
|
};
|
|
434
543
|
//# sourceMappingURL=Semantics.js.map
|