@osdk/generator-converters.ontologyir 2.3.0-beta.5

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.
@@ -0,0 +1,774 @@
1
+ 'use strict';
2
+
3
+ var crypto = require('crypto');
4
+
5
+ // src/OntologyIrToFullMetadataConverter.ts
6
+ var OntologyIrToFullMetadataConverter = class {
7
+ /**
8
+ * Main entry point - converts IR to full metadata
9
+ */
10
+ static getFullMetadataFromIr(ir) {
11
+ const interfaceTypes = this.getOsdkInterfaceTypes(Object.values(ir.interfaceTypes));
12
+ const sharedPropertyTypes = this.getOsdkSharedPropertyTypes(Object.values(ir.sharedPropertyTypes));
13
+ const objectTypes = this.getOsdkObjectTypes(Object.values(ir.objectTypes), Object.values(ir.linkTypes));
14
+ const actionTypes = this.getOsdkActionTypes(Object.values(ir.actionTypes));
15
+ return {
16
+ interfaceTypes,
17
+ sharedPropertyTypes,
18
+ objectTypes,
19
+ queryTypes: {},
20
+ actionTypes,
21
+ ontology: {
22
+ apiName: "ontology",
23
+ rid: `ri.00000`,
24
+ displayName: "ontology",
25
+ description: ""
26
+ }
27
+ };
28
+ }
29
+ /**
30
+ * Convert IR object types to OSDK format
31
+ */
32
+ static getOsdkObjectTypes(objects, links) {
33
+ const linkMappings = this.getLinkMappings(links);
34
+ const result = {};
35
+ for (const fullObject of objects) {
36
+ const object = fullObject.objectType;
37
+ const icon = object.displayMetadata.icon;
38
+ if (icon.type !== "blueprint") {
39
+ throw new Error("Only blueprint icons are supported");
40
+ }
41
+ if (object.primaryKeys.length !== 1) {
42
+ throw new Error("Object must have exactly 1 primary key");
43
+ }
44
+ const primaryKey = object.primaryKeys[0];
45
+ const titleProperty = object.titlePropertyTypeRid;
46
+ const properties = {};
47
+ for (const [propKey, prop] of Object.entries(object.propertyTypes)) {
48
+ const visibility = prop.displayMetadata.visibility;
49
+ let visibilityEnum = "NORMAL";
50
+ if (!visibility) {
51
+ visibilityEnum = "NORMAL";
52
+ } else {
53
+ switch (visibility) {
54
+ case "PROMINENT":
55
+ visibilityEnum = "PROMINENT";
56
+ break;
57
+ case "NORMAL":
58
+ visibilityEnum = "NORMAL";
59
+ break;
60
+ case "HIDDEN":
61
+ visibilityEnum = "HIDDEN";
62
+ break;
63
+ default:
64
+ visibilityEnum = "NORMAL";
65
+ }
66
+ }
67
+ const dataType = this.getOsdkPropertyType(prop.type);
68
+ if (dataType) {
69
+ const status = {
70
+ type: prop.status.type,
71
+ ...prop.status[prop.status.type] ?? {}
72
+ };
73
+ properties[propKey] = {
74
+ displayName: prop.displayMetadata.displayName,
75
+ rid: `ri.${object.apiName}.${propKey}`,
76
+ status,
77
+ description: prop.displayMetadata.description ?? void 0,
78
+ visibility: visibilityEnum,
79
+ dataType
80
+ };
81
+ }
82
+ }
83
+ const objectTypeV2 = {
84
+ apiName: object.apiName,
85
+ description: object.displayMetadata.description ?? void 0,
86
+ displayName: object.displayMetadata.displayName,
87
+ pluralDisplayName: "",
88
+ // Not available in IR
89
+ primaryKey,
90
+ titleProperty,
91
+ icon: {
92
+ type: "blueprint",
93
+ color: icon.blueprint.color,
94
+ name: icon.blueprint.locator
95
+ },
96
+ status: this.convertObjectTypeStatus(object.status),
97
+ properties,
98
+ rid: `ri.${object.apiName}`
99
+ };
100
+ const sharedPropertyTypeMappings = {};
101
+ const implementsInterfaces2 = {};
102
+ for (const ii of object.implementsInterfaces2) {
103
+ const interfaceApiName = ii.interfaceTypeApiName;
104
+ const propertyMappings = {};
105
+ for (const [sharedPropKey, propMapping] of Object.entries(ii.properties)) {
106
+ const propertyApiName = propMapping.propertyTypeRid;
107
+ propertyMappings[sharedPropKey] = propertyApiName;
108
+ sharedPropertyTypeMappings[sharedPropKey] = propertyApiName;
109
+ }
110
+ implementsInterfaces2[interfaceApiName] = {
111
+ properties: propertyMappings
112
+ };
113
+ }
114
+ const objectApiName = object.apiName;
115
+ result[objectApiName] = {
116
+ objectType: objectTypeV2,
117
+ implementsInterfaces: [],
118
+ // Empty for now - legacy field
119
+ implementsInterfaces2,
120
+ sharedPropertyTypeMapping: sharedPropertyTypeMappings,
121
+ linkTypes: linkMappings[objectApiName] || []
122
+ };
123
+ }
124
+ return result;
125
+ }
126
+ /**
127
+ * Create link mappings from IR link types
128
+ */
129
+ static getLinkMappings(links) {
130
+ const result = {};
131
+ for (const link of links) {
132
+ const linkType = link.linkType;
133
+ const linkApiName = linkType.id;
134
+ const linkStatus = this.convertLinkTypeStatus(linkType.status);
135
+ let mappings;
136
+ switch (linkType.definition.type) {
137
+ case "manyToMany": {
138
+ const linkDef = linkType.definition.manyToMany;
139
+ const sideA = {
140
+ apiName: linkApiName,
141
+ displayName: linkApiName,
142
+ cardinality: "MANY",
143
+ objectTypeApiName: linkDef.objectTypeRidA,
144
+ linkTypeRid: `ri.${linkDef.objectTypeRidA}.${linkApiName}.${linkDef.objectTypeRidB}`,
145
+ status: linkStatus
146
+ };
147
+ const sideB = {
148
+ ...sideA,
149
+ objectTypeApiName: linkDef.objectTypeRidB
150
+ };
151
+ mappings = {
152
+ [linkDef.objectTypeRidA]: sideA,
153
+ [linkDef.objectTypeRidB]: sideB
154
+ };
155
+ break;
156
+ }
157
+ case "oneToMany": {
158
+ const linkDef = linkType.definition.oneToMany;
159
+ const sideOne = {
160
+ apiName: linkApiName,
161
+ displayName: linkApiName,
162
+ objectTypeApiName: linkDef.objectTypeRidOneSide,
163
+ cardinality: "ONE",
164
+ linkTypeRid: `ri.${linkDef.objectTypeRidOneSide}.${linkApiName}.${linkDef.objectTypeRidManySide}`,
165
+ status: linkStatus
166
+ };
167
+ const sideMany = {
168
+ ...sideOne,
169
+ cardinality: "MANY",
170
+ objectTypeApiName: linkDef.objectTypeRidManySide
171
+ };
172
+ mappings = {
173
+ [linkDef.objectTypeRidOneSide]: sideOne,
174
+ [linkDef.objectTypeRidManySide]: sideMany
175
+ };
176
+ break;
177
+ }
178
+ default:
179
+ throw new Error("Unknown link definition type");
180
+ }
181
+ for (const [objectTypeApiName, linkSide] of Object.entries(mappings)) {
182
+ if (!result[objectTypeApiName]) {
183
+ result[objectTypeApiName] = [];
184
+ }
185
+ result[objectTypeApiName].push(linkSide);
186
+ }
187
+ }
188
+ return result;
189
+ }
190
+ /**
191
+ * Convert IR action types to OSDK format
192
+ */
193
+ static getOsdkActionTypes(actions) {
194
+ const result = {};
195
+ for (const action of actions) {
196
+ const metadata = action.actionType.metadata;
197
+ const actionType = {
198
+ rid: `ri.action.${metadata.apiName}`,
199
+ apiName: metadata.apiName,
200
+ displayName: metadata.displayMetadata.displayName,
201
+ description: metadata.displayMetadata.description,
202
+ parameters: this.getOsdkActionParameters(action),
203
+ operations: this.getOsdkActionOperations(action),
204
+ status: this.convertActionTypeStatus(metadata.status)
205
+ };
206
+ result[actionType.apiName] = actionType;
207
+ }
208
+ return result;
209
+ }
210
+ /**
211
+ * Convert action operations from IR
212
+ */
213
+ static getOsdkActionOperations(action) {
214
+ return action.actionType.actionTypeLogic.logic.rules.map((irLogic) => {
215
+ switch (irLogic.type) {
216
+ case "addInterfaceRule": {
217
+ const r = irLogic.addInterfaceRule;
218
+ return {
219
+ type: "createInterfaceObject",
220
+ interfaceTypeApiName: r.interfaceApiName
221
+ };
222
+ }
223
+ case "addLinkRule":
224
+ throw new Error("Add link rule not supported");
225
+ case "addObjectRule": {
226
+ const r = irLogic.addObjectRule;
227
+ return {
228
+ type: "createObject",
229
+ objectTypeApiName: r.objectTypeId
230
+ };
231
+ }
232
+ case "addOrModifyObjectRuleV2": {
233
+ const r = irLogic.addOrModifyObjectRuleV2;
234
+ return {
235
+ type: "modifyObject",
236
+ objectTypeApiName: r.objectToModify
237
+ };
238
+ }
239
+ case "deleteLinkRule":
240
+ throw new Error("Delete link rule not supported");
241
+ case "deleteObjectRule": {
242
+ const r = irLogic.deleteObjectRule;
243
+ return {
244
+ type: "deleteObject",
245
+ objectTypeApiName: r.objectToDelete
246
+ };
247
+ }
248
+ case "modifyInterfaceRule": {
249
+ const r = irLogic.modifyInterfaceRule;
250
+ const parameter = action.actionType.metadata.parameters[r.interfaceObjectToModifyParameter];
251
+ if (!parameter) {
252
+ throw new Error("Could not find interface type api name");
253
+ }
254
+ let interfaceTypeApiName = null;
255
+ switch (parameter.type.type) {
256
+ case "interfaceReference":
257
+ interfaceTypeApiName = parameter.type.interfaceReference.interfaceTypeRid;
258
+ break;
259
+ case "interfaceReferenceList":
260
+ interfaceTypeApiName = parameter.type.interfaceReferenceList.interfaceTypeRid;
261
+ break;
262
+ default:
263
+ interfaceTypeApiName = null;
264
+ }
265
+ if (!interfaceTypeApiName) {
266
+ throw new Error("Could not find interface type api name");
267
+ }
268
+ return {
269
+ type: "modifyInterfaceObject",
270
+ interfaceTypeApiName
271
+ };
272
+ }
273
+ case "modifyObjectRule": {
274
+ const r = irLogic.modifyObjectRule;
275
+ return {
276
+ type: "modifyObject",
277
+ objectTypeApiName: r.objectToModify
278
+ };
279
+ }
280
+ default:
281
+ throw new Error("Unknown logic rule type");
282
+ }
283
+ });
284
+ }
285
+ /**
286
+ * Convert action parameters from IR
287
+ */
288
+ static getOsdkActionParameters(action) {
289
+ const result = {};
290
+ for (const [paramKey, irParameter] of Object.entries(action.actionType.metadata.parameters)) {
291
+ let dataType;
292
+ switch (irParameter.type.type) {
293
+ case "attachment":
294
+ dataType = {
295
+ type: "attachment"
296
+ };
297
+ break;
298
+ case "attachmentList":
299
+ dataType = {
300
+ type: "array",
301
+ subType: {
302
+ type: "attachment"
303
+ }
304
+ };
305
+ break;
306
+ case "boolean":
307
+ dataType = {
308
+ type: "boolean"
309
+ };
310
+ break;
311
+ case "booleanList":
312
+ dataType = {
313
+ type: "array",
314
+ subType: {
315
+ type: "boolean"
316
+ }
317
+ };
318
+ break;
319
+ case "date":
320
+ dataType = {
321
+ type: "date"
322
+ };
323
+ break;
324
+ case "dateList":
325
+ dataType = {
326
+ type: "array",
327
+ subType: {
328
+ type: "date"
329
+ }
330
+ };
331
+ break;
332
+ case "decimal":
333
+ throw new Error("Decimal type not supported");
334
+ case "decimalList":
335
+ throw new Error("Decimal list type not supported");
336
+ case "double":
337
+ dataType = {
338
+ type: "double"
339
+ };
340
+ break;
341
+ case "doubleList":
342
+ dataType = {
343
+ type: "array",
344
+ subType: {
345
+ type: "double"
346
+ }
347
+ };
348
+ break;
349
+ case "geohash":
350
+ dataType = {
351
+ type: "geohash"
352
+ };
353
+ break;
354
+ case "geohashList":
355
+ dataType = {
356
+ type: "array",
357
+ subType: {
358
+ type: "geohash"
359
+ }
360
+ };
361
+ break;
362
+ case "geoshape":
363
+ dataType = {
364
+ type: "geoshape"
365
+ };
366
+ break;
367
+ case "geoshapeList":
368
+ dataType = {
369
+ type: "array",
370
+ subType: {
371
+ type: "geoshape"
372
+ }
373
+ };
374
+ break;
375
+ case "geotimeSeriesReference":
376
+ throw new Error("Geotime series reference type not supported");
377
+ case "geotimeSeriesReferenceList":
378
+ throw new Error("Geotime series reference list type not supported");
379
+ case "integer":
380
+ dataType = {
381
+ type: "integer"
382
+ };
383
+ break;
384
+ case "integerList":
385
+ dataType = {
386
+ type: "array",
387
+ subType: {
388
+ type: "integer"
389
+ }
390
+ };
391
+ break;
392
+ case "interfaceReference":
393
+ throw new Error("Interface reference type not supported");
394
+ case "interfaceReferenceList":
395
+ throw new Error("Interface reference list type not supported");
396
+ case "long":
397
+ dataType = {
398
+ type: "long"
399
+ };
400
+ break;
401
+ case "longList":
402
+ dataType = {
403
+ type: "array",
404
+ subType: {
405
+ type: "long"
406
+ }
407
+ };
408
+ break;
409
+ case "marking":
410
+ dataType = {
411
+ type: "marking"
412
+ };
413
+ break;
414
+ case "markingList":
415
+ dataType = {
416
+ type: "array",
417
+ subType: {
418
+ type: "marking"
419
+ }
420
+ };
421
+ break;
422
+ case "mediaReference":
423
+ dataType = {
424
+ type: "mediaReference"
425
+ };
426
+ break;
427
+ case "mediaReferenceList":
428
+ dataType = {
429
+ type: "array",
430
+ subType: {
431
+ type: "mediaReference"
432
+ }
433
+ };
434
+ break;
435
+ case "objectReference": {
436
+ const t = irParameter.type.objectReference;
437
+ dataType = {
438
+ type: "object",
439
+ objectTypeApiName: t.objectTypeId,
440
+ objectApiName: t.objectTypeId
441
+ };
442
+ break;
443
+ }
444
+ case "objectReferenceList": {
445
+ const t = irParameter.type.objectReferenceList;
446
+ dataType = {
447
+ type: "array",
448
+ subType: {
449
+ type: "object",
450
+ objectTypeApiName: t.objectTypeId,
451
+ objectApiName: t.objectTypeId
452
+ }
453
+ };
454
+ break;
455
+ }
456
+ case "objectSetRid":
457
+ dataType = {
458
+ type: "objectSet"
459
+ };
460
+ break;
461
+ case "objectTypeReference":
462
+ dataType = {
463
+ type: "objectType"
464
+ };
465
+ break;
466
+ case "string":
467
+ dataType = {
468
+ type: "string"
469
+ };
470
+ break;
471
+ case "stringList":
472
+ dataType = {
473
+ type: "array",
474
+ subType: {
475
+ type: "string"
476
+ }
477
+ };
478
+ break;
479
+ case "struct":
480
+ throw new Error("Struct type not supported (lazy implementation)");
481
+ case "structList":
482
+ throw new Error("Struct list type not supported");
483
+ case "timeSeriesReference":
484
+ throw new Error("Time series reference type not supported");
485
+ case "timestamp":
486
+ dataType = {
487
+ type: "timestamp"
488
+ };
489
+ break;
490
+ case "timestampList":
491
+ dataType = {
492
+ type: "array",
493
+ subType: {
494
+ type: "timestamp"
495
+ }
496
+ };
497
+ break;
498
+ default:
499
+ throw new Error("Unknown parameter type");
500
+ }
501
+ result[paramKey] = {
502
+ displayName: irParameter.displayMetadata.displayName,
503
+ description: irParameter.displayMetadata.description,
504
+ required: true,
505
+ dataType
506
+ };
507
+ }
508
+ return result;
509
+ }
510
+ /**
511
+ * Convert interface types from IR
512
+ */
513
+ static getOsdkInterfaceTypes(interfaces) {
514
+ const result = {};
515
+ for (const interfaceData of interfaces) {
516
+ const interfaceType = interfaceData.interfaceType;
517
+ const properties = {};
518
+ for (const [propKey, propValue] of Object.entries(interfaceType.propertiesV2)) {
519
+ const spt = propValue.sharedPropertyType;
520
+ const dataType = this.getOsdkPropertyType(spt.type);
521
+ if (dataType) {
522
+ properties[propKey] = {
523
+ rid: `ri.interface.${interfaceType.apiName}.${spt.apiName}`,
524
+ apiName: spt.apiName,
525
+ displayName: spt.displayMetadata.displayName,
526
+ description: spt.displayMetadata.description ?? void 0,
527
+ dataType,
528
+ required: false
529
+ // Default to false for now - this should come from IR if available
530
+ };
531
+ }
532
+ }
533
+ const result_interfaceType = {
534
+ apiName: interfaceType.apiName,
535
+ rid: `ri.interface.${interfaceType.apiName}`,
536
+ properties,
537
+ allProperties: properties,
538
+ // Same as properties for now
539
+ extendsInterfaces: interfaceType.extendsInterfaces.map((val) => val),
540
+ allExtendsInterfaces: interfaceType.extendsInterfaces.map((val) => val),
541
+ // Same as extendsInterfaces for now
542
+ implementedByObjectTypes: [],
543
+ // Empty for now
544
+ displayName: interfaceType.displayMetadata.displayName,
545
+ description: interfaceType.displayMetadata.description ?? void 0,
546
+ links: this.getOsdkInterfaceLinkTypes(interfaceType.links),
547
+ allLinks: this.getOsdkInterfaceLinkTypes(interfaceType.links)
548
+ // Same as links for now
549
+ };
550
+ result[result_interfaceType.apiName] = result_interfaceType;
551
+ }
552
+ return result;
553
+ }
554
+ /**
555
+ * Convert interface link types from IR
556
+ */
557
+ static getOsdkInterfaceLinkTypes(ilts) {
558
+ const result = {};
559
+ for (const ilt of ilts) {
560
+ let linkedEntityApiName;
561
+ switch (ilt.linkedEntityTypeId.type) {
562
+ case "interfaceType": {
563
+ const interfaceType = ilt.linkedEntityTypeId.interfaceType;
564
+ linkedEntityApiName = {
565
+ type: "interfaceTypeApiName",
566
+ apiName: interfaceType
567
+ };
568
+ break;
569
+ }
570
+ case "objectType":
571
+ throw new Error("Interface links to object types should not be possible in ontology as code yet");
572
+ default:
573
+ throw new Error("Unknown linked entity type");
574
+ }
575
+ let cardinality;
576
+ switch (ilt.cardinality) {
577
+ case "SINGLE":
578
+ cardinality = "ONE";
579
+ break;
580
+ case "MANY":
581
+ cardinality = "MANY";
582
+ break;
583
+ default:
584
+ throw new Error("Unknown cardinality type");
585
+ }
586
+ const interfaceLinkType = {
587
+ rid: `ri.interfacelink.${linkedEntityApiName.apiName}.${ilt.metadata.apiName}`,
588
+ apiName: ilt.metadata.apiName,
589
+ displayName: ilt.metadata.displayName,
590
+ description: ilt.metadata.description,
591
+ linkedEntityApiName,
592
+ cardinality,
593
+ required: ilt.required
594
+ };
595
+ result[interfaceLinkType.apiName] = interfaceLinkType;
596
+ }
597
+ return result;
598
+ }
599
+ /**
600
+ * Convert shared property types from IR
601
+ */
602
+ static getOsdkSharedPropertyTypes(spts) {
603
+ const result = {};
604
+ for (const spt of spts) {
605
+ const dataType = this.getOsdkPropertyType(spt.sharedPropertyType.type);
606
+ if (dataType) {
607
+ const sharedPropertyType = {
608
+ rid: `ri.spt.${spt.sharedPropertyType.apiName}`,
609
+ apiName: spt.sharedPropertyType.apiName,
610
+ displayName: spt.sharedPropertyType.displayMetadata.displayName,
611
+ description: spt.sharedPropertyType.displayMetadata.description ?? void 0,
612
+ dataType
613
+ };
614
+ result[sharedPropertyType.apiName] = sharedPropertyType;
615
+ } else {
616
+ throw new Error(`Unsupported property type '${JSON.stringify(spt.sharedPropertyType.type)}' for spt '${spt.sharedPropertyType.apiName}'`);
617
+ }
618
+ }
619
+ return result;
620
+ }
621
+ /**
622
+ * Convert property types from IR to OSDK format
623
+ */
624
+ static getOsdkPropertyType(type) {
625
+ switch (type.type) {
626
+ case "array": {
627
+ const value = type.array;
628
+ const subType = this.getOsdkPropertyType(value.subtype);
629
+ return subType ? {
630
+ type: "array",
631
+ subType
632
+ } : null;
633
+ }
634
+ case "boolean":
635
+ return {
636
+ type: "boolean"
637
+ };
638
+ case "byte":
639
+ return {
640
+ type: "byte"
641
+ };
642
+ case "date":
643
+ return {
644
+ type: "date"
645
+ };
646
+ case "decimal":
647
+ return {
648
+ type: "decimal"
649
+ };
650
+ case "double":
651
+ return {
652
+ type: "double"
653
+ };
654
+ case "float":
655
+ return {
656
+ type: "float"
657
+ };
658
+ case "geohash":
659
+ return {
660
+ type: "geopoint"
661
+ };
662
+ case "geoshape":
663
+ return {
664
+ type: "geoshape"
665
+ };
666
+ case "integer":
667
+ return {
668
+ type: "integer"
669
+ };
670
+ case "long":
671
+ return {
672
+ type: "long"
673
+ };
674
+ case "short":
675
+ return {
676
+ type: "short"
677
+ };
678
+ case "string":
679
+ return {
680
+ type: "string"
681
+ };
682
+ case "experimentalTimeDependentV1":
683
+ return null;
684
+ case "timestamp":
685
+ return {
686
+ type: "timestamp"
687
+ };
688
+ case "attachment":
689
+ return {
690
+ type: "attachment"
691
+ };
692
+ case "marking":
693
+ return {
694
+ type: "marking"
695
+ };
696
+ case "cipherText":
697
+ return null;
698
+ case "mediaReference":
699
+ return null;
700
+ case "vector":
701
+ return null;
702
+ case "geotimeSeriesReference":
703
+ return null;
704
+ case "struct": {
705
+ const value = type.struct;
706
+ const ridBase = `ri.struct.${crypto.hash("sha256", JSON.stringify(type)).slice(0, 10)}`;
707
+ return {
708
+ type: "struct",
709
+ structFieldTypes: value.structFields.map((field) => {
710
+ const fieldDataType = this.getOsdkPropertyType(field.fieldType);
711
+ if (!fieldDataType) {
712
+ throw new Error(`Unsupported field type in struct: ${field.apiName}`);
713
+ }
714
+ return {
715
+ apiName: field.apiName,
716
+ rid: `${ridBase}.${field.apiName}`,
717
+ dataType: fieldDataType
718
+ };
719
+ })
720
+ };
721
+ }
722
+ default:
723
+ return null;
724
+ }
725
+ }
726
+ static convertObjectTypeStatus(status) {
727
+ switch (status.type) {
728
+ case "active":
729
+ return "ACTIVE";
730
+ case "deprecated":
731
+ return "DEPRECATED";
732
+ case "endorsed":
733
+ throw new Error("Endorsed status is not supported yet");
734
+ case "example":
735
+ throw new Error("Example status has no mapping");
736
+ case "experimental":
737
+ return "EXPERIMENTAL";
738
+ default:
739
+ throw new Error(`Unknown object type status: ${status}`);
740
+ }
741
+ }
742
+ static convertActionTypeStatus(status) {
743
+ switch (status.type) {
744
+ case "active":
745
+ return "ACTIVE";
746
+ case "deprecated":
747
+ return "DEPRECATED";
748
+ case "example":
749
+ throw new Error("Example status has no mapping");
750
+ case "experimental":
751
+ return "EXPERIMENTAL";
752
+ default:
753
+ throw new Error(`Unknown action type status: ${status}`);
754
+ }
755
+ }
756
+ static convertLinkTypeStatus(status) {
757
+ switch (status.type) {
758
+ case "active":
759
+ return "ACTIVE";
760
+ case "deprecated":
761
+ return "DEPRECATED";
762
+ case "example":
763
+ throw new Error("Example status has no mapping");
764
+ case "experimental":
765
+ return "EXPERIMENTAL";
766
+ default:
767
+ throw new Error(`Unknown link type status: ${status}`);
768
+ }
769
+ }
770
+ };
771
+
772
+ exports.OntologyIrToFullMetadataConverter = OntologyIrToFullMetadataConverter;
773
+ //# sourceMappingURL=index.cjs.map
774
+ //# sourceMappingURL=index.cjs.map