@osdk/generator-converters.preview 0.42.0 → 0.43.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/CHANGELOG.md +13 -0
- package/build/browser/PreviewOntologyIrConverter.js +1 -0
- package/build/browser/PreviewOntologyIrConverter.js.map +1 -1
- package/build/cjs/index.cjs +1 -0
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/PreviewOntologyIrConverter.js +1 -0
- package/build/esm/PreviewOntologyIrConverter.js.map +1 -1
- package/build/types/PreviewOntologyIrConverter.d.ts.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @osdk/generator-converters.preview
|
|
2
2
|
|
|
3
|
+
## 0.43.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e3a381d: Bump the `@osdk/foundry.*` and `@osdk/internal.foundry.*` catalog entries to `2.77.0`. Generated experimental ontology metadata now includes full action type metadata and logic rules.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [e3a381d]
|
|
12
|
+
- @osdk/generator@2.65.0
|
|
13
|
+
- @osdk/generator-converters.ontologyir@2.65.0
|
|
14
|
+
- @osdk/client.unstable@2.65.0
|
|
15
|
+
|
|
3
16
|
## 0.42.0
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewOntologyIrConverter.js","names":["buildBlockDataInterfaceTypeLookup","buildBlockDataObjectTypeLookup","OntologyBlockDataToFullMetadataConverter","toUuid","convertBlockDataLogicRulesToActionLogicRules","PreviewOntologyIrConverter","getPreviewFullMetadataFromBlockData","blockdata","importedTypes","baseMetadata","getFullMetadataFromBlockData","actionTypes","convertActionTypesWithFullLogicRulesFromBlockData","objectTypes","convertObjectTypesWithUuidRids","ontology","apiName","rid","displayName","description","result","fullMetadata","Object","entries","objectType","properties","propKey","prop","linkTypes","map","lt","linkTypeRid","actions","objectTypeLookup","interfaceTypeLookup","baseActionTypes","getOsdkActionTypesFromBlockData","actionsByApiName","Map","values","a","actionType","metadata","baseActionType","action","get","fullLogicRules","actionTypeLogic","logic","rules"],"sources":["PreviewOntologyIrConverter.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionTypeBlockDataV2,\n OntologyBlockDataV2,\n} from \"@osdk/client.unstable\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\nimport {\n buildBlockDataInterfaceTypeLookup,\n buildBlockDataObjectTypeLookup,\n OntologyBlockDataToFullMetadataConverter,\n toUuid,\n} from \"@osdk/generator-converters.ontologyir\";\nimport { convertBlockDataLogicRulesToActionLogicRules } from \"./ActionLogicRuleConverter.js\";\n\n/**\n * Extended return type that uses ActionTypeFullMetadata instead of ActionTypeV2.\n */\nexport interface PreviewOntologyFullMetadata\n extends Omit<Ontologies.OntologyFullMetadata, \"actionTypes\">\n{\n actionTypes: Record<string, Ontologies.ActionTypeFullMetadata>;\n}\n\n/**\n * Preview converter that extends the base OntologyIrToFullMetadataConverter\n * to return ActionTypeFullMetadata with fullLogicRules instead of ActionTypeV2.\n */\nexport class PreviewOntologyIrConverter {\n /**\n * Main entry point - converts IR to full metadata with enhanced action types.\n * Returns ActionTypeFullMetadata which includes fullLogicRules.\n */\n static getPreviewFullMetadataFromBlockData(\n blockdata: OntologyBlockDataV2,\n importedTypes?: Ontologies.OntologyFullMetadata,\n ): PreviewOntologyFullMetadata {\n const baseMetadata = OntologyBlockDataToFullMetadataConverter\n .getFullMetadataFromBlockData(blockdata, importedTypes);\n\n const actionTypes = this.convertActionTypesWithFullLogicRulesFromBlockData(\n blockdata.actionTypes,\n blockdata,\n );\n // Post-process object types to use UUID-based RIDs\n const objectTypes = this.convertObjectTypesWithUuidRids(\n baseMetadata.objectTypes,\n );\n\n return {\n ...baseMetadata,\n objectTypes,\n actionTypes,\n ontology: {\n apiName: \"ontology\",\n rid: \"ri.ontology.main.ontology.0\",\n displayName: \"ontology\",\n description: \"local ontology\",\n },\n };\n }\n\n /**\n * Post-process object types to use UUID-based RIDs for properties and link types.\n */\n private static convertObjectTypesWithUuidRids(\n objectTypes: Record<string, Ontologies.ObjectTypeFullMetadata>,\n ): Record<string, Ontologies.ObjectTypeFullMetadata> {\n const result: Record<string, Ontologies.ObjectTypeFullMetadata> = {};\n\n for (const [apiName, fullMetadata] of Object.entries(objectTypes)) {\n const objectType = fullMetadata.objectType;\n const properties: Record<string, Ontologies.PropertyV2> = {};\n\n for (const [propKey, prop] of Object.entries(objectType.properties)) {\n properties[propKey] = {\n ...prop,\n rid: `ri.ontology.main.property.${toUuid(apiName + \".\" + propKey)}`,\n };\n }\n\n const linkTypes = fullMetadata.linkTypes.map(lt => ({\n ...lt,\n linkTypeRid: `ri.ontology.main.link-type.${\n toUuid(lt.linkTypeRid || lt.apiName)\n }` as Ontologies.LinkTypeRid,\n }));\n\n result[apiName] = {\n ...fullMetadata,\n linkTypes,\n objectType: {\n ...objectType,\n rid: `ri.ontology.main.object-type.${toUuid(apiName)}`,\n properties,\n },\n };\n }\n\n return result;\n }\n\n /**\n * Convert IR action types to ActionTypeFullMetadata format.\n * Reuses base converter for action type conversion, then process\n * RIDs to use UUID-based format and adds fullLogicRules.\n */\n private static convertActionTypesWithFullLogicRulesFromBlockData(\n actions: Record<string, ActionTypeBlockDataV2>,\n blockdata: OntologyBlockDataV2,\n ): Record<string, Ontologies.ActionTypeFullMetadata> {\n const objectTypeLookup = buildBlockDataObjectTypeLookup(blockdata);\n const interfaceTypeLookup = buildBlockDataInterfaceTypeLookup(blockdata);\n const baseActionTypes = OntologyBlockDataToFullMetadataConverter\n .getOsdkActionTypesFromBlockData(\n blockdata,\n objectTypeLookup,\n interfaceTypeLookup,\n );\n\n // Build a lookup from apiName to the original IR action for logic rules\n const actionsByApiName = new Map(\n Object.values(actions).map(a => [a.actionType.metadata.apiName, a]),\n );\n const result: Record<string, Ontologies.ActionTypeFullMetadata> = {};\n for (const [apiName, baseActionType] of Object.entries(baseActionTypes)) {\n const action = actionsByApiName.get(apiName)!;\n result[apiName] = {\n actionType: {\n ...baseActionType,\n },\n fullLogicRules: convertBlockDataLogicRulesToActionLogicRules(\n action.actionType.actionTypeLogic.logic.rules,\n action,\n blockdata,\n ),\n };\n }\n\n return result;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,SACEA,iCAAiC,EACjCC,8BAA8B,EAC9BC,wCAAwC,EACxCC,MAAM,QACD,uCAAuC;AAC9C,SAASC,4CAA4C,QAAQ,+BAA+B;;AAE5F;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,CAAC;EACtC;AACF;AACA;AACA;EACE,OAAOC,mCAAmCA,CACxCC,SAA8B,EAC9BC,aAA+C,EAClB;IAC7B,MAAMC,YAAY,GAAGP,wCAAwC,CAC1DQ,4BAA4B,CAACH,SAAS,EAAEC,aAAa,CAAC;IAEzD,MAAMG,WAAW,GAAG,IAAI,CAACC,iDAAiD,CACxEL,SAAS,CAACI,WAAW,EACrBJ,SACF,CAAC;IACD;IACA,MAAMM,WAAW,GAAG,IAAI,CAACC,8BAA8B,CACrDL,YAAY,CAACI,WACf,CAAC;IAED,OAAO;MACL,GAAGJ,YAAY;MACfI,WAAW;MACXF,WAAW;MACXI,QAAQ,EAAE;QACRC,OAAO,EAAE,UAAU;QACnBC,GAAG,EAAE,6BAA6B;QAClCC,WAAW,EAAE,UAAU;QACvBC,WAAW,EAAE;MACf;IACF,CAAC;EACH;;EAEA;AACF;AACA;EACE,
|
|
1
|
+
{"version":3,"file":"PreviewOntologyIrConverter.js","names":["buildBlockDataInterfaceTypeLookup","buildBlockDataObjectTypeLookup","OntologyBlockDataToFullMetadataConverter","toUuid","convertBlockDataLogicRulesToActionLogicRules","PreviewOntologyIrConverter","getPreviewFullMetadataFromBlockData","blockdata","importedTypes","baseMetadata","getFullMetadataFromBlockData","actionTypes","convertActionTypesWithFullLogicRulesFromBlockData","objectTypes","convertObjectTypesWithUuidRids","actionTypesFullMetadata","ontology","apiName","rid","displayName","description","result","fullMetadata","Object","entries","objectType","properties","propKey","prop","linkTypes","map","lt","linkTypeRid","actions","objectTypeLookup","interfaceTypeLookup","baseActionTypes","getOsdkActionTypesFromBlockData","actionsByApiName","Map","values","a","actionType","metadata","baseActionType","action","get","fullLogicRules","actionTypeLogic","logic","rules"],"sources":["PreviewOntologyIrConverter.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionTypeBlockDataV2,\n OntologyBlockDataV2,\n} from \"@osdk/client.unstable\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\nimport {\n buildBlockDataInterfaceTypeLookup,\n buildBlockDataObjectTypeLookup,\n OntologyBlockDataToFullMetadataConverter,\n toUuid,\n} from \"@osdk/generator-converters.ontologyir\";\nimport { convertBlockDataLogicRulesToActionLogicRules } from \"./ActionLogicRuleConverter.js\";\n\n/**\n * Extended return type that uses ActionTypeFullMetadata instead of ActionTypeV2.\n */\nexport interface PreviewOntologyFullMetadata\n extends Omit<Ontologies.OntologyFullMetadata, \"actionTypes\">\n{\n actionTypes: Record<string, Ontologies.ActionTypeFullMetadata>;\n}\n\n/**\n * Preview converter that extends the base OntologyIrToFullMetadataConverter\n * to return ActionTypeFullMetadata with fullLogicRules instead of ActionTypeV2.\n */\nexport class PreviewOntologyIrConverter {\n /**\n * Main entry point - converts IR to full metadata with enhanced action types.\n * Returns ActionTypeFullMetadata which includes fullLogicRules.\n */\n static getPreviewFullMetadataFromBlockData(\n blockdata: OntologyBlockDataV2,\n importedTypes?: Ontologies.OntologyFullMetadata,\n ): PreviewOntologyFullMetadata {\n const baseMetadata = OntologyBlockDataToFullMetadataConverter\n .getFullMetadataFromBlockData(blockdata, importedTypes);\n\n const actionTypes = this.convertActionTypesWithFullLogicRulesFromBlockData(\n blockdata.actionTypes,\n blockdata,\n );\n // Post-process object types to use UUID-based RIDs\n const objectTypes = this.convertObjectTypesWithUuidRids(\n baseMetadata.objectTypes,\n );\n\n return {\n ...baseMetadata,\n objectTypes,\n actionTypes,\n actionTypesFullMetadata: actionTypes,\n ontology: {\n apiName: \"ontology\",\n rid: \"ri.ontology.main.ontology.0\",\n displayName: \"ontology\",\n description: \"local ontology\",\n },\n };\n }\n\n /**\n * Post-process object types to use UUID-based RIDs for properties and link types.\n */\n private static convertObjectTypesWithUuidRids(\n objectTypes: Record<string, Ontologies.ObjectTypeFullMetadata>,\n ): Record<string, Ontologies.ObjectTypeFullMetadata> {\n const result: Record<string, Ontologies.ObjectTypeFullMetadata> = {};\n\n for (const [apiName, fullMetadata] of Object.entries(objectTypes)) {\n const objectType = fullMetadata.objectType;\n const properties: Record<string, Ontologies.PropertyV2> = {};\n\n for (const [propKey, prop] of Object.entries(objectType.properties)) {\n properties[propKey] = {\n ...prop,\n rid: `ri.ontology.main.property.${toUuid(apiName + \".\" + propKey)}`,\n };\n }\n\n const linkTypes = fullMetadata.linkTypes.map(lt => ({\n ...lt,\n linkTypeRid: `ri.ontology.main.link-type.${\n toUuid(lt.linkTypeRid || lt.apiName)\n }` as Ontologies.LinkTypeRid,\n }));\n\n result[apiName] = {\n ...fullMetadata,\n linkTypes,\n objectType: {\n ...objectType,\n rid: `ri.ontology.main.object-type.${toUuid(apiName)}`,\n properties,\n },\n };\n }\n\n return result;\n }\n\n /**\n * Convert IR action types to ActionTypeFullMetadata format.\n * Reuses base converter for action type conversion, then process\n * RIDs to use UUID-based format and adds fullLogicRules.\n */\n private static convertActionTypesWithFullLogicRulesFromBlockData(\n actions: Record<string, ActionTypeBlockDataV2>,\n blockdata: OntologyBlockDataV2,\n ): Record<string, Ontologies.ActionTypeFullMetadata> {\n const objectTypeLookup = buildBlockDataObjectTypeLookup(blockdata);\n const interfaceTypeLookup = buildBlockDataInterfaceTypeLookup(blockdata);\n const baseActionTypes = OntologyBlockDataToFullMetadataConverter\n .getOsdkActionTypesFromBlockData(\n blockdata,\n objectTypeLookup,\n interfaceTypeLookup,\n );\n\n // Build a lookup from apiName to the original IR action for logic rules\n const actionsByApiName = new Map(\n Object.values(actions).map(a => [a.actionType.metadata.apiName, a]),\n );\n const result: Record<string, Ontologies.ActionTypeFullMetadata> = {};\n for (const [apiName, baseActionType] of Object.entries(baseActionTypes)) {\n const action = actionsByApiName.get(apiName)!;\n result[apiName] = {\n actionType: {\n ...baseActionType,\n },\n fullLogicRules: convertBlockDataLogicRulesToActionLogicRules(\n action.actionType.actionTypeLogic.logic.rules,\n action,\n blockdata,\n ),\n };\n }\n\n return result;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,SACEA,iCAAiC,EACjCC,8BAA8B,EAC9BC,wCAAwC,EACxCC,MAAM,QACD,uCAAuC;AAC9C,SAASC,4CAA4C,QAAQ,+BAA+B;;AAE5F;AACA;AACA;;AAOA;AACA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AAK,EAC7CL,MAAM,EACNtC,SACF;MACF,CAAC;IACH;IAEA,OAAOc,MAAM;EACf;AACF","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ActionLogicRuleConverter.ts","../../src/PreviewOntologyIrConverter.ts"],"names":["buildBlockDataObjectTypeLookup","buildBlockDataInterfaceTypeLookup","buildBlockDataInterfaceLinkTypeLookup","resolveBlockDataApiName","OntologyBlockDataToFullMetadataConverter","toUuid"],"mappings":";;;;;AAiBA,SAAS,0BAA0B,MAAA,EAAQ;AACzC,EAAA,MAAM,SAAS,EAAC;AAChB,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,EAAG;AACjD,IAAA,MAAA,CAAO,GAAG,CAAA,GAAI,wBAAA,CAAyB,KAAK,CAAA;AAAA,EAC9C;AACA,EAAA,OAAO,MAAA;AACT;AACA,SAAS,yBAAyB,KAAA,EAAO;AACvC,EAAA,QAAQ,MAAM,IAAA;AAAM,IAClB,KAAK,aAAA;AACH,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,aAAA;AAAA,QACN,aAAa,KAAA,CAAM;AAAA,OACrB;AAAA,IACF,KAAK,aAAA;AACH,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,aAAA;AAAA,QACN,KAAA,EAAO,kBAAA,CAAmB,KAAA,CAAM,WAAW;AAAA,OAC7C;AAAA,IACF,KAAK,8BAAA;AACH,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,8BAAA;AAAA,QACN,WAAA,EAAa,MAAM,4BAAA,CAA6B,WAAA;AAAA,QAChD,mBAAA,EAAqB,MAAM,4BAAA,CAA6B;AAAA,OAC1D;AAAA,IACF,KAAK,iCAAA;AACH,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,iCAAA;AAAA,QACN,WAAA,EAAa,MAAM,+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AAS,CAAA;AACvE,IAAA,MAAM,eAAA,GAAkBG,uEAAA,CAAyC,+BAAA,CAAgC,SAAA,EAAW,kBAAkB,mBAAmB,CAAA;AAGjJ,IAAA,MAAM,mBAAmB,IAAI,GAAA,CAAI,MAAA,CAAO,MAAA,CAAO,OAAO,CAAA,CAAE,GAAA,CAAI,CAAA,CAAA,KAAK,CAAC,EAAE,UAAA,CAAW,QAAA,CAAS,OAAA,EAAS,CAAC,CAAC,CAAC,CAAA;AACpG,IAAA,MAAM,SAAS,EAAC;AAChB,IAAA,KAAA,MAAW,CAAC,OAAA,EAAS,cAAc,KAAK,MAAA,CAAO,OAAA,CAAQ,eAAe,CAAA,EAAG;AACvE,MAAA,MAAM,MAAA,GAAS,gBAAA,CAAiB,GAAA,CAAI,OAAO,CAAA;AAC3C,MAAA,MAAA,CAAO,OAAO,CAAA,GAAI;AAAA,QAChB,UAAA,EAAY;AAAA,UACV,GAAG;AAAA,SACL;AAAA,QACA,cAAA,EAAgB,6CAA6C,MAAA,CAAO,UAAA,CAAW,gBAAgB,KAAA,CAAM,KAAA,EAAO,QAAQ,SAAS;AAAA,OAC/H;AAAA,IACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACF","file":"index.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { buildBlockDataInterfaceLinkTypeLookup, buildBlockDataInterfaceTypeLookup, buildBlockDataObjectTypeLookup, resolveBlockDataApiName } from \"@osdk/generator-converters.ontologyir\";\nfunction convertLogicRuleArguments(values) {\n const result = {};\n for (const [key, value] of Object.entries(values)) {\n result[key] = convertLogicRuleArgument(value);\n }\n return result;\n}\nfunction convertLogicRuleArgument(value) {\n switch (value.type) {\n case \"parameterId\":\n return {\n type: \"parameterId\",\n parameterId: value.parameterId\n };\n case \"staticValue\":\n return {\n type: \"staticValue\",\n value: convertStaticValue(value.staticValue)\n };\n case \"objectParameterPropertyValue\":\n return {\n type: \"objectParameterPropertyValue\",\n parameterId: value.objectParameterPropertyValue.parameterId,\n propertyTypeApiName: value.objectParameterPropertyValue.propertyTypeId\n };\n case \"interfaceParameterPropertyValue\":\n return {\n type: \"interfaceParameterPropertyValue\",\n parameterId: value.interfaceParameterPropertyValue.parameterId,\n sharedPropertyTypeRid: value.interfaceParameterPropertyValue.sharedPropertyTypeRid\n };\n case \"currentUser\":\n return {\n type: \"currentUser\"\n };\n case \"currentTime\":\n return {\n type: \"currentTime\"\n };\n case \"uniqueIdentifier\":\n return value.uniqueIdentifier.linkId == null ? {\n type: \"uniqueIdentifier\"\n } : {\n type: \"uniqueIdentifier\",\n linkId: value.uniqueIdentifier.linkId\n };\n case \"synchronousWebhookOutput\":\n return {\n type: \"synchronousWebhookOutput\",\n webhookOutputParamName: value.synchronousWebhookOutput\n };\n case \"interfaceParameterPropertyValueV2\":\n case \"mediaReferenceParameterPropertyValue\":\n case \"scheduleRunRid\":\n throw new Error(`Logic rule argument '${value.type}' is not supported by the gateway API`);\n default:\n throw new Error(`Unexpected value: ${JSON.stringify(value)}`);\n }\n}\n\n/**\n * The ontology metadata API models static values as tagged unions, while the\n * gateway API expects the corresponding untagged JSON value.\n */\nfunction convertStaticValue(value) {\n switch (value.type) {\n case \"boolean\":\n return value.boolean;\n case \"booleanList\":\n return value.booleanList.booleans;\n case \"integer\":\n return value.integer;\n case \"integerList\":\n return value.integerList.integers;\n case \"long\":\n return value.long;\n case \"longList\":\n return value.longList.longs;\n case \"double\":\n return value.double;\n case \"doubleList\":\n return value.doubleList.doubles;\n case \"string\":\n return value.string;\n case \"stringList\":\n return value.stringList.strings;\n case \"decimal\":\n return value.decimal.decimalValue;\n case \"decimalList\":\n return value.decimalList.decimals;\n case \"date\":\n return value.date.dateValue;\n case \"dateList\":\n return value.dateList.dates;\n case \"geohash\":\n return value.geohash.geohash;\n case \"geohashList\":\n return value.geohashList.geohashes;\n case \"geoshape\":\n return value.geoshape.geoshape;\n case \"geoshapeList\":\n return value.geoshapeList.geoshapes;\n case \"timeSeriesReference\":\n {\n const reference = value.timeSeriesReference.timeSeriesReference;\n switch (reference.type) {\n case \"seriesId\":\n return reference.seriesId;\n case \"templateRid\":\n return reference.templateRid;\n case \"qualifiedSeriesId\":\n return reference.qualifiedSeriesId;\n default:\n throw new Error(`Unexpected value: ${JSON.stringify(value)}`);\n }\n }\n case \"timestamp\":\n return value.timestamp;\n case \"timestampList\":\n return value.timestampList.timestamps;\n case \"null\":\n return null;\n case \"objectLocator\":\n return convertObjectPrimaryKey(value.objectLocator.primaryKey);\n case \"objectLocatorList\":\n return value.objectLocatorList.objectLocatorList.map(locator => convertObjectPrimaryKey(locator.primaryKey));\n case \"objectType\":\n return value.objectType.objectTypeId;\n case \"attachment\":\n return value.attachment.attachment;\n case \"attachmentList\":\n return value.attachmentList.attachments;\n case \"marking\":\n return value.marking.marking;\n case \"markingList\":\n return value.markingList.markings;\n case \"mediaReference\":\n return {\n mimeType: value.mediaReference.mimeType,\n reference: value.mediaReference.mediaReference\n };\n case \"mediaReferenceList\":\n return value.mediaReferenceList.mediaReferences.map(mediaReference => ({\n mimeType: mediaReference.mimeType,\n reference: mediaReference.mediaReference\n }));\n case \"geotimeSeriesReference\":\n return value.geotimeSeriesReference;\n case \"geotimeSeriesReferenceList\":\n return value.geotimeSeriesReferenceList.geotimeSeriesReferences;\n case \"struct\":\n return Object.fromEntries(value.struct.structFields.map(field => [field.structFieldApiName, convertStaticValue(field.structFieldDataValue)]));\n case \"structList\":\n return value.structList.structs.map(struct => Object.fromEntries(struct.structFields.map(field => [field.structFieldApiName, convertStaticValue(field.structFieldDataValue)])));\n case \"scenarioReference\":\n return value.scenarioReference.scenarioRid;\n default:\n throw new Error(`Unexpected value: ${JSON.stringify(value)}`);\n }\n}\nfunction convertObjectPrimaryKey(primaryKey) {\n const convertedEntries = Object.entries(primaryKey).map(([key, value]) => [key, convertStaticValue(value)]);\n return convertedEntries.length === 1 ? convertedEntries[0][1] : Object.fromEntries(convertedEntries);\n}\nfunction buildObjectTypeLookup(ir) {\n if (!ir?.objectTypes) {\n return undefined;\n }\n const byId = new Map();\n const byHyphenated = new Map();\n for (const [key, value] of Object.entries(ir.objectTypes)) {\n const apiName = value.objectType.apiName;\n byId.set(key, apiName);\n byHyphenated.set(apiName.replace(/\\./g, \"-\"), apiName);\n }\n return {\n byId,\n byHyphenated\n };\n}\nfunction buildInterfaceTypeLookup(ir) {\n if (!ir?.interfaceTypes) {\n return undefined;\n }\n const byId = new Map();\n const byHyphenated = new Map();\n for (const [key, value] of Object.entries(ir.interfaceTypes)) {\n const apiName = value.interfaceType.apiName;\n byId.set(key, apiName);\n byHyphenated.set(apiName.replace(/\\./g, \"-\"), apiName);\n }\n return {\n byId,\n byHyphenated\n };\n}\nfunction resolveApiName(id, lookup) {\n if (!lookup) {\n return id;\n }\n return lookup.byId.get(id) ?? lookup.byHyphenated.get(id) ?? id;\n}\nfunction firstExistingObjectParameterId(refs, field) {\n const first = refs[0];\n if (!first || first.type !== \"existingObject\") {\n throw new Error(`Interface-link rule ${field} must reference exactly one existing object`);\n }\n return first.existingObject;\n}\nfunction getObjectReferenceType(action, paramKey) {\n const param = action.actionType.metadata.parameters[paramKey];\n if (!param || param.type.type !== \"objectReference\") {\n throw new Error(`Parameter '${paramKey}' must be an objectReference type`);\n }\n return param.type.objectReference;\n}\nfunction getObjectReferenceTypeFromBlockData(action, paramKey) {\n const param = action.actionType.metadata.parameters[paramKey];\n if (!param || param.type.type !== \"objectReference\") {\n throw new Error(`Parameter '${paramKey}' must be an objectReference type`);\n }\n return param.type.objectReference;\n}\n\n/**\n * Build lookups once and convert all logic rules for an action.\n * Avoids rebuilding lookup Maps on every rule.\n */\nexport function convertIrLogicRulesToActionLogicRules(rules, action, ir) {\n const objectLookup = buildObjectTypeLookup(ir);\n const interfaceLookup = buildInterfaceTypeLookup(ir);\n return rules.map(irRule => convertSingleRule(irRule, action, objectLookup, interfaceLookup));\n}\nexport function convertBlockDataLogicRulesToActionLogicRules(rules, action, blockdata) {\n const objectLookup = buildBlockDataObjectTypeLookup(blockdata);\n const interfaceLookup = buildBlockDataInterfaceTypeLookup(blockdata);\n const interfaceLinkLookup = buildBlockDataInterfaceLinkTypeLookup(blockdata);\n return rules.map(rule => convertBlockDataSingleRule(rule, action, objectLookup, interfaceLookup, interfaceLinkLookup));\n}\n\n/**\n * Convert a single OntologyIrLogicRule to ActionLogicRule.\n * Kept as a public API for callers that only need a single rule conversion.\n */\nexport function convertIrLogicRuleToActionLogicRule(irRule, action, ir) {\n const objectLookup = buildObjectTypeLookup(ir);\n const interfaceLookup = buildInterfaceTypeLookup(ir);\n return convertSingleRule(irRule, action, objectLookup, interfaceLookup);\n}\nfunction convertSingleRule(irRule, action, objectLookup, interfaceLookup) {\n switch (irRule.type) {\n case \"addObjectRule\":\n {\n const r = irRule.addObjectRule;\n const result = {\n type: \"createObject\",\n objectTypeApiName: resolveApiName(r.objectTypeId, objectLookup),\n propertyArguments: convertLogicRuleArguments(r.propertyValues),\n structPropertyArguments: {}\n };\n return result;\n }\n case \"addOrModifyObjectRuleV2\":\n {\n const r = irRule.addOrModifyObjectRuleV2;\n const objRef = getObjectReferenceType(action, r.objectToModify);\n // propertyArguments left empty: the downstream generator resolves\n // property mappings from the action parameter configuration rather\n // than from the logic rule itself for createOrModify rules.\n const result = {\n type: \"createOrModifyObject\",\n objectTypeApiName: resolveApiName(objRef.objectTypeId, objectLookup),\n propertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"modifyObjectRule\":\n {\n const r = irRule.modifyObjectRule;\n // Validate that the parameter is an objectReference (throws if not)\n getObjectReferenceType(action, r.objectToModify);\n const result = {\n type: \"modifyObject\",\n objectToModify: r.objectToModify,\n propertyArguments: convertLogicRuleArguments(r.propertyValues),\n structPropertyArguments: {}\n };\n return result;\n }\n case \"deleteObjectRule\":\n {\n const r = irRule.deleteObjectRule;\n const result = {\n type: \"deleteObject\",\n objectToDelete: r.objectToDelete\n };\n return result;\n }\n case \"addInterfaceRule\":\n {\n const r = irRule.addInterfaceRule;\n const interfaceApiName = resolveApiName(r.interfaceApiName, interfaceLookup);\n const result = {\n type: \"createInterface\",\n interfaceTypeApiName: interfaceApiName,\n objectType: interfaceApiName,\n sharedPropertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"modifyInterfaceRule\":\n {\n const r = irRule.modifyInterfaceRule;\n const result = {\n type: \"modifyInterface\",\n interfaceObjectToModify: r.interfaceObjectToModifyParameter,\n sharedPropertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"functionRule\":\n {\n const r = irRule.functionRule;\n const result = {\n type: \"function\",\n functionRid: r.functionRid,\n functionInputValues: convertLogicRuleArguments(r.functionInputValues),\n functionVersion: r.functionVersion\n };\n return result;\n }\n case \"addInterfaceLinkRuleV2\":\n {\n const r = irRule.addInterfaceLinkRuleV2;\n const result = {\n type: \"createInterfaceLink\",\n interfaceTypeApiName: resolveApiName(r.interfaceTypeRid, interfaceLookup),\n interfaceLinkTypeApiName: r.interfaceLinkTypeRid,\n sourceObject: firstExistingObjectParameterId(r.sourceObjects, \"sourceObjects\"),\n targetObject: firstExistingObjectParameterId(r.targetObjects, \"targetObjects\")\n };\n return result;\n }\n case \"deleteInterfaceLinkRule\":\n {\n const r = irRule.deleteInterfaceLinkRule;\n const result = {\n type: \"deleteInterfaceLink\",\n interfaceTypeApiName: resolveApiName(r.interfaceTypeRid, interfaceLookup),\n interfaceLinkTypeApiName: r.interfaceLinkTypeRid,\n sourceObject: r.sourceObject,\n targetObject: r.targetObject\n };\n return result;\n }\n case \"addLinkRule\":\n throw new Error(\"addLinkRule is not supported for ActionLogicRule\");\n case \"deleteLinkRule\":\n throw new Error(\"deleteLinkRule is not supported for ActionLogicRule\");\n default:\n throw new Error(`Unsupported logic rule type: ${irRule.type}`);\n }\n}\nfunction convertBlockDataSingleRule(rule, action, objectLookup, interfaceLookup, interfaceLinkLookup) {\n switch (rule.type) {\n case \"addObjectRule\":\n {\n const r = rule.addObjectRule;\n const result = {\n type: \"createObject\",\n objectTypeApiName: resolveBlockDataApiName(r.objectTypeId, objectLookup),\n propertyArguments: convertLogicRuleArguments(r.propertyValues),\n structPropertyArguments: {}\n };\n return result;\n }\n case \"addOrModifyObjectRuleV2\":\n {\n const r = rule.addOrModifyObjectRuleV2;\n const objRef = getObjectReferenceTypeFromBlockData(action, r.objectToModify);\n // propertyArguments left empty: the downstream generator resolves\n // property mappings from the action parameter configuration rather\n // than from the logic rule itself for createOrModify rules.\n const result = {\n type: \"createOrModifyObject\",\n objectTypeApiName: resolveBlockDataApiName(objRef.objectTypeId, objectLookup),\n propertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"modifyObjectRule\":\n {\n const r = rule.modifyObjectRule;\n // Validate that the parameter is an objectReference (throws if not)\n getObjectReferenceTypeFromBlockData(action, r.objectToModify);\n const result = {\n type: \"modifyObject\",\n objectToModify: r.objectToModify,\n propertyArguments: convertLogicRuleArguments(r.propertyValues),\n structPropertyArguments: {}\n };\n return result;\n }\n case \"deleteObjectRule\":\n {\n const r = rule.deleteObjectRule;\n const result = {\n type: \"deleteObject\",\n objectToDelete: r.objectToDelete\n };\n return result;\n }\n case \"addInterfaceRule\":\n {\n const r = rule.addInterfaceRule;\n const interfaceApiName = resolveBlockDataApiName(r.interfaceTypeRid, interfaceLookup);\n const result = {\n type: \"createInterface\",\n interfaceTypeApiName: interfaceApiName,\n objectType: interfaceApiName,\n sharedPropertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"modifyInterfaceRule\":\n {\n const r = rule.modifyInterfaceRule;\n const result = {\n type: \"modifyInterface\",\n interfaceObjectToModify: r.interfaceObjectToModify,\n sharedPropertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"functionRule\":\n {\n const r = rule.functionRule;\n const result = {\n type: \"function\",\n functionRid: r.functionRid,\n functionInputValues: convertLogicRuleArguments(r.functionInputValues),\n functionVersion: r.functionVersion\n };\n return result;\n }\n case \"addInterfaceLinkRuleV2\":\n {\n const r = rule.addInterfaceLinkRuleV2;\n const result = {\n type: \"createInterfaceLink\",\n interfaceTypeApiName: resolveBlockDataApiName(r.interfaceTypeRid, interfaceLookup),\n interfaceLinkTypeApiName: resolveBlockDataApiName(r.interfaceLinkTypeRid, interfaceLinkLookup),\n sourceObject: firstExistingObjectParameterId(r.sourceObjects, \"sourceObjects\"),\n targetObject: firstExistingObjectParameterId(r.targetObjects, \"targetObjects\")\n };\n return result;\n }\n case \"deleteInterfaceLinkRule\":\n {\n const r = rule.deleteInterfaceLinkRule;\n const result = {\n type: \"deleteInterfaceLink\",\n interfaceTypeApiName: resolveBlockDataApiName(r.interfaceTypeRid, interfaceLookup),\n interfaceLinkTypeApiName: resolveBlockDataApiName(r.interfaceLinkTypeRid, interfaceLinkLookup),\n sourceObject: r.sourceObject,\n targetObject: r.targetObject\n };\n return result;\n }\n case \"addLinkRule\":\n throw new Error(\"addLinkRule is not supported for ActionLogicRule\");\n case \"deleteLinkRule\":\n throw new Error(\"deleteLinkRule is not supported for ActionLogicRule\");\n default:\n throw new Error(`Unsupported logic rule type: ${rule.type}`);\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { buildBlockDataInterfaceTypeLookup, buildBlockDataObjectTypeLookup, OntologyBlockDataToFullMetadataConverter, toUuid } from \"@osdk/generator-converters.ontologyir\";\nimport { convertBlockDataLogicRulesToActionLogicRules } from \"./ActionLogicRuleConverter.js\";\n\n/**\n * Extended return type that uses ActionTypeFullMetadata instead of ActionTypeV2.\n */\n\n/**\n * Preview converter that extends the base OntologyIrToFullMetadataConverter\n * to return ActionTypeFullMetadata with fullLogicRules instead of ActionTypeV2.\n */\nexport class PreviewOntologyIrConverter {\n /**\n * Main entry point - converts IR to full metadata with enhanced action types.\n * Returns ActionTypeFullMetadata which includes fullLogicRules.\n */\n static getPreviewFullMetadataFromBlockData(blockdata, importedTypes) {\n const baseMetadata = OntologyBlockDataToFullMetadataConverter.getFullMetadataFromBlockData(blockdata, importedTypes);\n const actionTypes = this.convertActionTypesWithFullLogicRulesFromBlockData(blockdata.actionTypes, blockdata);\n // Post-process object types to use UUID-based RIDs\n const objectTypes = this.convertObjectTypesWithUuidRids(baseMetadata.objectTypes);\n return {\n ...baseMetadata,\n objectTypes,\n actionTypes,\n ontology: {\n apiName: \"ontology\",\n rid: \"ri.ontology.main.ontology.0\",\n displayName: \"ontology\",\n description: \"local ontology\"\n }\n };\n }\n\n /**\n * Post-process object types to use UUID-based RIDs for properties and link types.\n */\n static convertObjectTypesWithUuidRids(objectTypes) {\n const result = {};\n for (const [apiName, fullMetadata] of Object.entries(objectTypes)) {\n const objectType = fullMetadata.objectType;\n const properties = {};\n for (const [propKey, prop] of Object.entries(objectType.properties)) {\n properties[propKey] = {\n ...prop,\n rid: `ri.ontology.main.property.${toUuid(apiName + \".\" + propKey)}`\n };\n }\n const linkTypes = fullMetadata.linkTypes.map(lt => ({\n ...lt,\n linkTypeRid: `ri.ontology.main.link-type.${toUuid(lt.linkTypeRid || lt.apiName)}`\n }));\n result[apiName] = {\n ...fullMetadata,\n linkTypes,\n objectType: {\n ...objectType,\n rid: `ri.ontology.main.object-type.${toUuid(apiName)}`,\n properties\n }\n };\n }\n return result;\n }\n\n /**\n * Convert IR action types to ActionTypeFullMetadata format.\n * Reuses base converter for action type conversion, then process\n * RIDs to use UUID-based format and adds fullLogicRules.\n */\n static convertActionTypesWithFullLogicRulesFromBlockData(actions, blockdata) {\n const objectTypeLookup = buildBlockDataObjectTypeLookup(blockdata);\n const interfaceTypeLookup = buildBlockDataInterfaceTypeLookup(blockdata);\n const baseActionTypes = OntologyBlockDataToFullMetadataConverter.getOsdkActionTypesFromBlockData(blockdata, objectTypeLookup, interfaceTypeLookup);\n\n // Build a lookup from apiName to the original IR action for logic rules\n const actionsByApiName = new Map(Object.values(actions).map(a => [a.actionType.metadata.apiName, a]));\n const result = {};\n for (const [apiName, baseActionType] of Object.entries(baseActionTypes)) {\n const action = actionsByApiName.get(apiName);\n result[apiName] = {\n actionType: {\n ...baseActionType\n },\n fullLogicRules: convertBlockDataLogicRulesToActionLogicRules(action.actionType.actionTypeLogic.logic.rules, action, blockdata)\n };\n }\n return result;\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/ActionLogicRuleConverter.ts","../../src/PreviewOntologyIrConverter.ts"],"names":["buildBlockDataObjectTypeLookup","buildBlockDataInterfaceTypeLookup","buildBlockDataInterfaceLinkTypeLookup","resolveBlockDataApiName","OntologyBlockDataToFullMetadataConverter","toUuid"],"mappings":";;;;;AAiBA,SAAS,0BAA0B,MAAA,EAAQ;AACzC,EAAA,MAAM,SAAS,EAAC;AAChB,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,EAAG;AACjD,IAAA,MAAA,CAAO,GAAG,CAAA,GAAI,wBAAA,CAAyB,KAAK,CAAA;AAAA,EAC9C;AACA,EAAA,OAAO,MAAA;AACT;AACA,SAAS,yBAAyB,KAAA,EAAO;AACvC,EAAA,QAAQ,MAAM,IAAA;AAAM,IAClB,KAAK,aAAA;AACH,MAAA,OAAO;AA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F;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACF","file":"index.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { buildBlockDataInterfaceLinkTypeLookup, buildBlockDataInterfaceTypeLookup, buildBlockDataObjectTypeLookup, resolveBlockDataApiName } from \"@osdk/generator-converters.ontologyir\";\nfunction convertLogicRuleArguments(values) {\n const result = {};\n for (const [key, value] of Object.entries(values)) {\n result[key] = convertLogicRuleArgument(value);\n }\n return result;\n}\nfunction convertLogicRuleArgument(value) {\n switch (value.type) {\n case \"parameterId\":\n return {\n type: \"parameterId\",\n parameterId: value.parameterId\n };\n case \"staticValue\":\n return {\n type: \"staticValue\",\n value: convertStaticValue(value.staticValue)\n };\n case \"objectParameterPropertyValue\":\n return {\n type: \"objectParameterPropertyValue\",\n parameterId: value.objectParameterPropertyValue.parameterId,\n propertyTypeApiName: value.objectParameterPropertyValue.propertyTypeId\n };\n case \"interfaceParameterPropertyValue\":\n return {\n type: \"interfaceParameterPropertyValue\",\n parameterId: value.interfaceParameterPropertyValue.parameterId,\n sharedPropertyTypeRid: value.interfaceParameterPropertyValue.sharedPropertyTypeRid\n };\n case \"currentUser\":\n return {\n type: \"currentUser\"\n };\n case \"currentTime\":\n return {\n type: \"currentTime\"\n };\n case \"uniqueIdentifier\":\n return value.uniqueIdentifier.linkId == null ? {\n type: \"uniqueIdentifier\"\n } : {\n type: \"uniqueIdentifier\",\n linkId: value.uniqueIdentifier.linkId\n };\n case \"synchronousWebhookOutput\":\n return {\n type: \"synchronousWebhookOutput\",\n webhookOutputParamName: value.synchronousWebhookOutput\n };\n case \"interfaceParameterPropertyValueV2\":\n case \"mediaReferenceParameterPropertyValue\":\n case \"scheduleRunRid\":\n throw new Error(`Logic rule argument '${value.type}' is not supported by the gateway API`);\n default:\n throw new Error(`Unexpected value: ${JSON.stringify(value)}`);\n }\n}\n\n/**\n * The ontology metadata API models static values as tagged unions, while the\n * gateway API expects the corresponding untagged JSON value.\n */\nfunction convertStaticValue(value) {\n switch (value.type) {\n case \"boolean\":\n return value.boolean;\n case \"booleanList\":\n return value.booleanList.booleans;\n case \"integer\":\n return value.integer;\n case \"integerList\":\n return value.integerList.integers;\n case \"long\":\n return value.long;\n case \"longList\":\n return value.longList.longs;\n case \"double\":\n return value.double;\n case \"doubleList\":\n return value.doubleList.doubles;\n case \"string\":\n return value.string;\n case \"stringList\":\n return value.stringList.strings;\n case \"decimal\":\n return value.decimal.decimalValue;\n case \"decimalList\":\n return value.decimalList.decimals;\n case \"date\":\n return value.date.dateValue;\n case \"dateList\":\n return value.dateList.dates;\n case \"geohash\":\n return value.geohash.geohash;\n case \"geohashList\":\n return value.geohashList.geohashes;\n case \"geoshape\":\n return value.geoshape.geoshape;\n case \"geoshapeList\":\n return value.geoshapeList.geoshapes;\n case \"timeSeriesReference\":\n {\n const reference = value.timeSeriesReference.timeSeriesReference;\n switch (reference.type) {\n case \"seriesId\":\n return reference.seriesId;\n case \"templateRid\":\n return reference.templateRid;\n case \"qualifiedSeriesId\":\n return reference.qualifiedSeriesId;\n default:\n throw new Error(`Unexpected value: ${JSON.stringify(value)}`);\n }\n }\n case \"timestamp\":\n return value.timestamp;\n case \"timestampList\":\n return value.timestampList.timestamps;\n case \"null\":\n return null;\n case \"objectLocator\":\n return convertObjectPrimaryKey(value.objectLocator.primaryKey);\n case \"objectLocatorList\":\n return value.objectLocatorList.objectLocatorList.map(locator => convertObjectPrimaryKey(locator.primaryKey));\n case \"objectType\":\n return value.objectType.objectTypeId;\n case \"attachment\":\n return value.attachment.attachment;\n case \"attachmentList\":\n return value.attachmentList.attachments;\n case \"marking\":\n return value.marking.marking;\n case \"markingList\":\n return value.markingList.markings;\n case \"mediaReference\":\n return {\n mimeType: value.mediaReference.mimeType,\n reference: value.mediaReference.mediaReference\n };\n case \"mediaReferenceList\":\n return value.mediaReferenceList.mediaReferences.map(mediaReference => ({\n mimeType: mediaReference.mimeType,\n reference: mediaReference.mediaReference\n }));\n case \"geotimeSeriesReference\":\n return value.geotimeSeriesReference;\n case \"geotimeSeriesReferenceList\":\n return value.geotimeSeriesReferenceList.geotimeSeriesReferences;\n case \"struct\":\n return Object.fromEntries(value.struct.structFields.map(field => [field.structFieldApiName, convertStaticValue(field.structFieldDataValue)]));\n case \"structList\":\n return value.structList.structs.map(struct => Object.fromEntries(struct.structFields.map(field => [field.structFieldApiName, convertStaticValue(field.structFieldDataValue)])));\n case \"scenarioReference\":\n return value.scenarioReference.scenarioRid;\n default:\n throw new Error(`Unexpected value: ${JSON.stringify(value)}`);\n }\n}\nfunction convertObjectPrimaryKey(primaryKey) {\n const convertedEntries = Object.entries(primaryKey).map(([key, value]) => [key, convertStaticValue(value)]);\n return convertedEntries.length === 1 ? convertedEntries[0][1] : Object.fromEntries(convertedEntries);\n}\nfunction buildObjectTypeLookup(ir) {\n if (!ir?.objectTypes) {\n return undefined;\n }\n const byId = new Map();\n const byHyphenated = new Map();\n for (const [key, value] of Object.entries(ir.objectTypes)) {\n const apiName = value.objectType.apiName;\n byId.set(key, apiName);\n byHyphenated.set(apiName.replace(/\\./g, \"-\"), apiName);\n }\n return {\n byId,\n byHyphenated\n };\n}\nfunction buildInterfaceTypeLookup(ir) {\n if (!ir?.interfaceTypes) {\n return undefined;\n }\n const byId = new Map();\n const byHyphenated = new Map();\n for (const [key, value] of Object.entries(ir.interfaceTypes)) {\n const apiName = value.interfaceType.apiName;\n byId.set(key, apiName);\n byHyphenated.set(apiName.replace(/\\./g, \"-\"), apiName);\n }\n return {\n byId,\n byHyphenated\n };\n}\nfunction resolveApiName(id, lookup) {\n if (!lookup) {\n return id;\n }\n return lookup.byId.get(id) ?? lookup.byHyphenated.get(id) ?? id;\n}\nfunction firstExistingObjectParameterId(refs, field) {\n const first = refs[0];\n if (!first || first.type !== \"existingObject\") {\n throw new Error(`Interface-link rule ${field} must reference exactly one existing object`);\n }\n return first.existingObject;\n}\nfunction getObjectReferenceType(action, paramKey) {\n const param = action.actionType.metadata.parameters[paramKey];\n if (!param || param.type.type !== \"objectReference\") {\n throw new Error(`Parameter '${paramKey}' must be an objectReference type`);\n }\n return param.type.objectReference;\n}\nfunction getObjectReferenceTypeFromBlockData(action, paramKey) {\n const param = action.actionType.metadata.parameters[paramKey];\n if (!param || param.type.type !== \"objectReference\") {\n throw new Error(`Parameter '${paramKey}' must be an objectReference type`);\n }\n return param.type.objectReference;\n}\n\n/**\n * Build lookups once and convert all logic rules for an action.\n * Avoids rebuilding lookup Maps on every rule.\n */\nexport function convertIrLogicRulesToActionLogicRules(rules, action, ir) {\n const objectLookup = buildObjectTypeLookup(ir);\n const interfaceLookup = buildInterfaceTypeLookup(ir);\n return rules.map(irRule => convertSingleRule(irRule, action, objectLookup, interfaceLookup));\n}\nexport function convertBlockDataLogicRulesToActionLogicRules(rules, action, blockdata) {\n const objectLookup = buildBlockDataObjectTypeLookup(blockdata);\n const interfaceLookup = buildBlockDataInterfaceTypeLookup(blockdata);\n const interfaceLinkLookup = buildBlockDataInterfaceLinkTypeLookup(blockdata);\n return rules.map(rule => convertBlockDataSingleRule(rule, action, objectLookup, interfaceLookup, interfaceLinkLookup));\n}\n\n/**\n * Convert a single OntologyIrLogicRule to ActionLogicRule.\n * Kept as a public API for callers that only need a single rule conversion.\n */\nexport function convertIrLogicRuleToActionLogicRule(irRule, action, ir) {\n const objectLookup = buildObjectTypeLookup(ir);\n const interfaceLookup = buildInterfaceTypeLookup(ir);\n return convertSingleRule(irRule, action, objectLookup, interfaceLookup);\n}\nfunction convertSingleRule(irRule, action, objectLookup, interfaceLookup) {\n switch (irRule.type) {\n case \"addObjectRule\":\n {\n const r = irRule.addObjectRule;\n const result = {\n type: \"createObject\",\n objectTypeApiName: resolveApiName(r.objectTypeId, objectLookup),\n propertyArguments: convertLogicRuleArguments(r.propertyValues),\n structPropertyArguments: {}\n };\n return result;\n }\n case \"addOrModifyObjectRuleV2\":\n {\n const r = irRule.addOrModifyObjectRuleV2;\n const objRef = getObjectReferenceType(action, r.objectToModify);\n // propertyArguments left empty: the downstream generator resolves\n // property mappings from the action parameter configuration rather\n // than from the logic rule itself for createOrModify rules.\n const result = {\n type: \"createOrModifyObject\",\n objectTypeApiName: resolveApiName(objRef.objectTypeId, objectLookup),\n propertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"modifyObjectRule\":\n {\n const r = irRule.modifyObjectRule;\n // Validate that the parameter is an objectReference (throws if not)\n getObjectReferenceType(action, r.objectToModify);\n const result = {\n type: \"modifyObject\",\n objectToModify: r.objectToModify,\n propertyArguments: convertLogicRuleArguments(r.propertyValues),\n structPropertyArguments: {}\n };\n return result;\n }\n case \"deleteObjectRule\":\n {\n const r = irRule.deleteObjectRule;\n const result = {\n type: \"deleteObject\",\n objectToDelete: r.objectToDelete\n };\n return result;\n }\n case \"addInterfaceRule\":\n {\n const r = irRule.addInterfaceRule;\n const interfaceApiName = resolveApiName(r.interfaceApiName, interfaceLookup);\n const result = {\n type: \"createInterface\",\n interfaceTypeApiName: interfaceApiName,\n objectType: interfaceApiName,\n sharedPropertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"modifyInterfaceRule\":\n {\n const r = irRule.modifyInterfaceRule;\n const result = {\n type: \"modifyInterface\",\n interfaceObjectToModify: r.interfaceObjectToModifyParameter,\n sharedPropertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"functionRule\":\n {\n const r = irRule.functionRule;\n const result = {\n type: \"function\",\n functionRid: r.functionRid,\n functionInputValues: convertLogicRuleArguments(r.functionInputValues),\n functionVersion: r.functionVersion\n };\n return result;\n }\n case \"addInterfaceLinkRuleV2\":\n {\n const r = irRule.addInterfaceLinkRuleV2;\n const result = {\n type: \"createInterfaceLink\",\n interfaceTypeApiName: resolveApiName(r.interfaceTypeRid, interfaceLookup),\n interfaceLinkTypeApiName: r.interfaceLinkTypeRid,\n sourceObject: firstExistingObjectParameterId(r.sourceObjects, \"sourceObjects\"),\n targetObject: firstExistingObjectParameterId(r.targetObjects, \"targetObjects\")\n };\n return result;\n }\n case \"deleteInterfaceLinkRule\":\n {\n const r = irRule.deleteInterfaceLinkRule;\n const result = {\n type: \"deleteInterfaceLink\",\n interfaceTypeApiName: resolveApiName(r.interfaceTypeRid, interfaceLookup),\n interfaceLinkTypeApiName: r.interfaceLinkTypeRid,\n sourceObject: r.sourceObject,\n targetObject: r.targetObject\n };\n return result;\n }\n case \"addLinkRule\":\n throw new Error(\"addLinkRule is not supported for ActionLogicRule\");\n case \"deleteLinkRule\":\n throw new Error(\"deleteLinkRule is not supported for ActionLogicRule\");\n default:\n throw new Error(`Unsupported logic rule type: ${irRule.type}`);\n }\n}\nfunction convertBlockDataSingleRule(rule, action, objectLookup, interfaceLookup, interfaceLinkLookup) {\n switch (rule.type) {\n case \"addObjectRule\":\n {\n const r = rule.addObjectRule;\n const result = {\n type: \"createObject\",\n objectTypeApiName: resolveBlockDataApiName(r.objectTypeId, objectLookup),\n propertyArguments: convertLogicRuleArguments(r.propertyValues),\n structPropertyArguments: {}\n };\n return result;\n }\n case \"addOrModifyObjectRuleV2\":\n {\n const r = rule.addOrModifyObjectRuleV2;\n const objRef = getObjectReferenceTypeFromBlockData(action, r.objectToModify);\n // propertyArguments left empty: the downstream generator resolves\n // property mappings from the action parameter configuration rather\n // than from the logic rule itself for createOrModify rules.\n const result = {\n type: \"createOrModifyObject\",\n objectTypeApiName: resolveBlockDataApiName(objRef.objectTypeId, objectLookup),\n propertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"modifyObjectRule\":\n {\n const r = rule.modifyObjectRule;\n // Validate that the parameter is an objectReference (throws if not)\n getObjectReferenceTypeFromBlockData(action, r.objectToModify);\n const result = {\n type: \"modifyObject\",\n objectToModify: r.objectToModify,\n propertyArguments: convertLogicRuleArguments(r.propertyValues),\n structPropertyArguments: {}\n };\n return result;\n }\n case \"deleteObjectRule\":\n {\n const r = rule.deleteObjectRule;\n const result = {\n type: \"deleteObject\",\n objectToDelete: r.objectToDelete\n };\n return result;\n }\n case \"addInterfaceRule\":\n {\n const r = rule.addInterfaceRule;\n const interfaceApiName = resolveBlockDataApiName(r.interfaceTypeRid, interfaceLookup);\n const result = {\n type: \"createInterface\",\n interfaceTypeApiName: interfaceApiName,\n objectType: interfaceApiName,\n sharedPropertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"modifyInterfaceRule\":\n {\n const r = rule.modifyInterfaceRule;\n const result = {\n type: \"modifyInterface\",\n interfaceObjectToModify: r.interfaceObjectToModify,\n sharedPropertyArguments: {},\n structPropertyArguments: {}\n };\n return result;\n }\n case \"functionRule\":\n {\n const r = rule.functionRule;\n const result = {\n type: \"function\",\n functionRid: r.functionRid,\n functionInputValues: convertLogicRuleArguments(r.functionInputValues),\n functionVersion: r.functionVersion\n };\n return result;\n }\n case \"addInterfaceLinkRuleV2\":\n {\n const r = rule.addInterfaceLinkRuleV2;\n const result = {\n type: \"createInterfaceLink\",\n interfaceTypeApiName: resolveBlockDataApiName(r.interfaceTypeRid, interfaceLookup),\n interfaceLinkTypeApiName: resolveBlockDataApiName(r.interfaceLinkTypeRid, interfaceLinkLookup),\n sourceObject: firstExistingObjectParameterId(r.sourceObjects, \"sourceObjects\"),\n targetObject: firstExistingObjectParameterId(r.targetObjects, \"targetObjects\")\n };\n return result;\n }\n case \"deleteInterfaceLinkRule\":\n {\n const r = rule.deleteInterfaceLinkRule;\n const result = {\n type: \"deleteInterfaceLink\",\n interfaceTypeApiName: resolveBlockDataApiName(r.interfaceTypeRid, interfaceLookup),\n interfaceLinkTypeApiName: resolveBlockDataApiName(r.interfaceLinkTypeRid, interfaceLinkLookup),\n sourceObject: r.sourceObject,\n targetObject: r.targetObject\n };\n return result;\n }\n case \"addLinkRule\":\n throw new Error(\"addLinkRule is not supported for ActionLogicRule\");\n case \"deleteLinkRule\":\n throw new Error(\"deleteLinkRule is not supported for ActionLogicRule\");\n default:\n throw new Error(`Unsupported logic rule type: ${rule.type}`);\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { buildBlockDataInterfaceTypeLookup, buildBlockDataObjectTypeLookup, OntologyBlockDataToFullMetadataConverter, toUuid } from \"@osdk/generator-converters.ontologyir\";\nimport { convertBlockDataLogicRulesToActionLogicRules } from \"./ActionLogicRuleConverter.js\";\n\n/**\n * Extended return type that uses ActionTypeFullMetadata instead of ActionTypeV2.\n */\n\n/**\n * Preview converter that extends the base OntologyIrToFullMetadataConverter\n * to return ActionTypeFullMetadata with fullLogicRules instead of ActionTypeV2.\n */\nexport class PreviewOntologyIrConverter {\n /**\n * Main entry point - converts IR to full metadata with enhanced action types.\n * Returns ActionTypeFullMetadata which includes fullLogicRules.\n */\n static getPreviewFullMetadataFromBlockData(blockdata, importedTypes) {\n const baseMetadata = OntologyBlockDataToFullMetadataConverter.getFullMetadataFromBlockData(blockdata, importedTypes);\n const actionTypes = this.convertActionTypesWithFullLogicRulesFromBlockData(blockdata.actionTypes, blockdata);\n // Post-process object types to use UUID-based RIDs\n const objectTypes = this.convertObjectTypesWithUuidRids(baseMetadata.objectTypes);\n return {\n ...baseMetadata,\n objectTypes,\n actionTypes,\n actionTypesFullMetadata: actionTypes,\n ontology: {\n apiName: \"ontology\",\n rid: \"ri.ontology.main.ontology.0\",\n displayName: \"ontology\",\n description: \"local ontology\"\n }\n };\n }\n\n /**\n * Post-process object types to use UUID-based RIDs for properties and link types.\n */\n static convertObjectTypesWithUuidRids(objectTypes) {\n const result = {};\n for (const [apiName, fullMetadata] of Object.entries(objectTypes)) {\n const objectType = fullMetadata.objectType;\n const properties = {};\n for (const [propKey, prop] of Object.entries(objectType.properties)) {\n properties[propKey] = {\n ...prop,\n rid: `ri.ontology.main.property.${toUuid(apiName + \".\" + propKey)}`\n };\n }\n const linkTypes = fullMetadata.linkTypes.map(lt => ({\n ...lt,\n linkTypeRid: `ri.ontology.main.link-type.${toUuid(lt.linkTypeRid || lt.apiName)}`\n }));\n result[apiName] = {\n ...fullMetadata,\n linkTypes,\n objectType: {\n ...objectType,\n rid: `ri.ontology.main.object-type.${toUuid(apiName)}`,\n properties\n }\n };\n }\n return result;\n }\n\n /**\n * Convert IR action types to ActionTypeFullMetadata format.\n * Reuses base converter for action type conversion, then process\n * RIDs to use UUID-based format and adds fullLogicRules.\n */\n static convertActionTypesWithFullLogicRulesFromBlockData(actions, blockdata) {\n const objectTypeLookup = buildBlockDataObjectTypeLookup(blockdata);\n const interfaceTypeLookup = buildBlockDataInterfaceTypeLookup(blockdata);\n const baseActionTypes = OntologyBlockDataToFullMetadataConverter.getOsdkActionTypesFromBlockData(blockdata, objectTypeLookup, interfaceTypeLookup);\n\n // Build a lookup from apiName to the original IR action for logic rules\n const actionsByApiName = new Map(Object.values(actions).map(a => [a.actionType.metadata.apiName, a]));\n const result = {};\n for (const [apiName, baseActionType] of Object.entries(baseActionTypes)) {\n const action = actionsByApiName.get(apiName);\n result[apiName] = {\n actionType: {\n ...baseActionType\n },\n fullLogicRules: convertBlockDataLogicRulesToActionLogicRules(action.actionType.actionTypeLogic.logic.rules, action, blockdata)\n };\n }\n return result;\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewOntologyIrConverter.js","names":["buildBlockDataInterfaceTypeLookup","buildBlockDataObjectTypeLookup","OntologyBlockDataToFullMetadataConverter","toUuid","convertBlockDataLogicRulesToActionLogicRules","PreviewOntologyIrConverter","getPreviewFullMetadataFromBlockData","blockdata","importedTypes","baseMetadata","getFullMetadataFromBlockData","actionTypes","convertActionTypesWithFullLogicRulesFromBlockData","objectTypes","convertObjectTypesWithUuidRids","ontology","apiName","rid","displayName","description","result","fullMetadata","Object","entries","objectType","properties","propKey","prop","linkTypes","map","lt","linkTypeRid","actions","objectTypeLookup","interfaceTypeLookup","baseActionTypes","getOsdkActionTypesFromBlockData","actionsByApiName","Map","values","a","actionType","metadata","baseActionType","action","get","fullLogicRules","actionTypeLogic","logic","rules"],"sources":["PreviewOntologyIrConverter.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionTypeBlockDataV2,\n OntologyBlockDataV2,\n} from \"@osdk/client.unstable\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\nimport {\n buildBlockDataInterfaceTypeLookup,\n buildBlockDataObjectTypeLookup,\n OntologyBlockDataToFullMetadataConverter,\n toUuid,\n} from \"@osdk/generator-converters.ontologyir\";\nimport { convertBlockDataLogicRulesToActionLogicRules } from \"./ActionLogicRuleConverter.js\";\n\n/**\n * Extended return type that uses ActionTypeFullMetadata instead of ActionTypeV2.\n */\nexport interface PreviewOntologyFullMetadata\n extends Omit<Ontologies.OntologyFullMetadata, \"actionTypes\">\n{\n actionTypes: Record<string, Ontologies.ActionTypeFullMetadata>;\n}\n\n/**\n * Preview converter that extends the base OntologyIrToFullMetadataConverter\n * to return ActionTypeFullMetadata with fullLogicRules instead of ActionTypeV2.\n */\nexport class PreviewOntologyIrConverter {\n /**\n * Main entry point - converts IR to full metadata with enhanced action types.\n * Returns ActionTypeFullMetadata which includes fullLogicRules.\n */\n static getPreviewFullMetadataFromBlockData(\n blockdata: OntologyBlockDataV2,\n importedTypes?: Ontologies.OntologyFullMetadata,\n ): PreviewOntologyFullMetadata {\n const baseMetadata = OntologyBlockDataToFullMetadataConverter\n .getFullMetadataFromBlockData(blockdata, importedTypes);\n\n const actionTypes = this.convertActionTypesWithFullLogicRulesFromBlockData(\n blockdata.actionTypes,\n blockdata,\n );\n // Post-process object types to use UUID-based RIDs\n const objectTypes = this.convertObjectTypesWithUuidRids(\n baseMetadata.objectTypes,\n );\n\n return {\n ...baseMetadata,\n objectTypes,\n actionTypes,\n ontology: {\n apiName: \"ontology\",\n rid: \"ri.ontology.main.ontology.0\",\n displayName: \"ontology\",\n description: \"local ontology\",\n },\n };\n }\n\n /**\n * Post-process object types to use UUID-based RIDs for properties and link types.\n */\n private static convertObjectTypesWithUuidRids(\n objectTypes: Record<string, Ontologies.ObjectTypeFullMetadata>,\n ): Record<string, Ontologies.ObjectTypeFullMetadata> {\n const result: Record<string, Ontologies.ObjectTypeFullMetadata> = {};\n\n for (const [apiName, fullMetadata] of Object.entries(objectTypes)) {\n const objectType = fullMetadata.objectType;\n const properties: Record<string, Ontologies.PropertyV2> = {};\n\n for (const [propKey, prop] of Object.entries(objectType.properties)) {\n properties[propKey] = {\n ...prop,\n rid: `ri.ontology.main.property.${toUuid(apiName + \".\" + propKey)}`,\n };\n }\n\n const linkTypes = fullMetadata.linkTypes.map(lt => ({\n ...lt,\n linkTypeRid: `ri.ontology.main.link-type.${\n toUuid(lt.linkTypeRid || lt.apiName)\n }` as Ontologies.LinkTypeRid,\n }));\n\n result[apiName] = {\n ...fullMetadata,\n linkTypes,\n objectType: {\n ...objectType,\n rid: `ri.ontology.main.object-type.${toUuid(apiName)}`,\n properties,\n },\n };\n }\n\n return result;\n }\n\n /**\n * Convert IR action types to ActionTypeFullMetadata format.\n * Reuses base converter for action type conversion, then process\n * RIDs to use UUID-based format and adds fullLogicRules.\n */\n private static convertActionTypesWithFullLogicRulesFromBlockData(\n actions: Record<string, ActionTypeBlockDataV2>,\n blockdata: OntologyBlockDataV2,\n ): Record<string, Ontologies.ActionTypeFullMetadata> {\n const objectTypeLookup = buildBlockDataObjectTypeLookup(blockdata);\n const interfaceTypeLookup = buildBlockDataInterfaceTypeLookup(blockdata);\n const baseActionTypes = OntologyBlockDataToFullMetadataConverter\n .getOsdkActionTypesFromBlockData(\n blockdata,\n objectTypeLookup,\n interfaceTypeLookup,\n );\n\n // Build a lookup from apiName to the original IR action for logic rules\n const actionsByApiName = new Map(\n Object.values(actions).map(a => [a.actionType.metadata.apiName, a]),\n );\n const result: Record<string, Ontologies.ActionTypeFullMetadata> = {};\n for (const [apiName, baseActionType] of Object.entries(baseActionTypes)) {\n const action = actionsByApiName.get(apiName)!;\n result[apiName] = {\n actionType: {\n ...baseActionType,\n },\n fullLogicRules: convertBlockDataLogicRulesToActionLogicRules(\n action.actionType.actionTypeLogic.logic.rules,\n action,\n blockdata,\n ),\n };\n }\n\n return result;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,SACEA,iCAAiC,EACjCC,8BAA8B,EAC9BC,wCAAwC,EACxCC,MAAM,QACD,uCAAuC;AAC9C,SAASC,4CAA4C,QAAQ,+BAA+B;;AAE5F;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,CAAC;EACtC;AACF;AACA;AACA;EACE,OAAOC,mCAAmCA,CACxCC,SAA8B,EAC9BC,aAA+C,EAClB;IAC7B,MAAMC,YAAY,GAAGP,wCAAwC,CAC1DQ,4BAA4B,CAACH,SAAS,EAAEC,aAAa,CAAC;IAEzD,MAAMG,WAAW,GAAG,IAAI,CAACC,iDAAiD,CACxEL,SAAS,CAACI,WAAW,EACrBJ,SACF,CAAC;IACD;IACA,MAAMM,WAAW,GAAG,IAAI,CAACC,8BAA8B,CACrDL,YAAY,CAACI,WACf,CAAC;IAED,OAAO;MACL,GAAGJ,YAAY;MACfI,WAAW;MACXF,WAAW;MACXI,QAAQ,EAAE;QACRC,OAAO,EAAE,UAAU;QACnBC,GAAG,EAAE,6BAA6B;QAClCC,WAAW,EAAE,UAAU;QACvBC,WAAW,EAAE;MACf;IACF,CAAC;EACH;;EAEA;AACF;AACA;EACE,
|
|
1
|
+
{"version":3,"file":"PreviewOntologyIrConverter.js","names":["buildBlockDataInterfaceTypeLookup","buildBlockDataObjectTypeLookup","OntologyBlockDataToFullMetadataConverter","toUuid","convertBlockDataLogicRulesToActionLogicRules","PreviewOntologyIrConverter","getPreviewFullMetadataFromBlockData","blockdata","importedTypes","baseMetadata","getFullMetadataFromBlockData","actionTypes","convertActionTypesWithFullLogicRulesFromBlockData","objectTypes","convertObjectTypesWithUuidRids","actionTypesFullMetadata","ontology","apiName","rid","displayName","description","result","fullMetadata","Object","entries","objectType","properties","propKey","prop","linkTypes","map","lt","linkTypeRid","actions","objectTypeLookup","interfaceTypeLookup","baseActionTypes","getOsdkActionTypesFromBlockData","actionsByApiName","Map","values","a","actionType","metadata","baseActionType","action","get","fullLogicRules","actionTypeLogic","logic","rules"],"sources":["PreviewOntologyIrConverter.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionTypeBlockDataV2,\n OntologyBlockDataV2,\n} from \"@osdk/client.unstable\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\nimport {\n buildBlockDataInterfaceTypeLookup,\n buildBlockDataObjectTypeLookup,\n OntologyBlockDataToFullMetadataConverter,\n toUuid,\n} from \"@osdk/generator-converters.ontologyir\";\nimport { convertBlockDataLogicRulesToActionLogicRules } from \"./ActionLogicRuleConverter.js\";\n\n/**\n * Extended return type that uses ActionTypeFullMetadata instead of ActionTypeV2.\n */\nexport interface PreviewOntologyFullMetadata\n extends Omit<Ontologies.OntologyFullMetadata, \"actionTypes\">\n{\n actionTypes: Record<string, Ontologies.ActionTypeFullMetadata>;\n}\n\n/**\n * Preview converter that extends the base OntologyIrToFullMetadataConverter\n * to return ActionTypeFullMetadata with fullLogicRules instead of ActionTypeV2.\n */\nexport class PreviewOntologyIrConverter {\n /**\n * Main entry point - converts IR to full metadata with enhanced action types.\n * Returns ActionTypeFullMetadata which includes fullLogicRules.\n */\n static getPreviewFullMetadataFromBlockData(\n blockdata: OntologyBlockDataV2,\n importedTypes?: Ontologies.OntologyFullMetadata,\n ): PreviewOntologyFullMetadata {\n const baseMetadata = OntologyBlockDataToFullMetadataConverter\n .getFullMetadataFromBlockData(blockdata, importedTypes);\n\n const actionTypes = this.convertActionTypesWithFullLogicRulesFromBlockData(\n blockdata.actionTypes,\n blockdata,\n );\n // Post-process object types to use UUID-based RIDs\n const objectTypes = this.convertObjectTypesWithUuidRids(\n baseMetadata.objectTypes,\n );\n\n return {\n ...baseMetadata,\n objectTypes,\n actionTypes,\n actionTypesFullMetadata: actionTypes,\n ontology: {\n apiName: \"ontology\",\n rid: \"ri.ontology.main.ontology.0\",\n displayName: \"ontology\",\n description: \"local ontology\",\n },\n };\n }\n\n /**\n * Post-process object types to use UUID-based RIDs for properties and link types.\n */\n private static convertObjectTypesWithUuidRids(\n objectTypes: Record<string, Ontologies.ObjectTypeFullMetadata>,\n ): Record<string, Ontologies.ObjectTypeFullMetadata> {\n const result: Record<string, Ontologies.ObjectTypeFullMetadata> = {};\n\n for (const [apiName, fullMetadata] of Object.entries(objectTypes)) {\n const objectType = fullMetadata.objectType;\n const properties: Record<string, Ontologies.PropertyV2> = {};\n\n for (const [propKey, prop] of Object.entries(objectType.properties)) {\n properties[propKey] = {\n ...prop,\n rid: `ri.ontology.main.property.${toUuid(apiName + \".\" + propKey)}`,\n };\n }\n\n const linkTypes = fullMetadata.linkTypes.map(lt => ({\n ...lt,\n linkTypeRid: `ri.ontology.main.link-type.${\n toUuid(lt.linkTypeRid || lt.apiName)\n }` as Ontologies.LinkTypeRid,\n }));\n\n result[apiName] = {\n ...fullMetadata,\n linkTypes,\n objectType: {\n ...objectType,\n rid: `ri.ontology.main.object-type.${toUuid(apiName)}`,\n properties,\n },\n };\n }\n\n return result;\n }\n\n /**\n * Convert IR action types to ActionTypeFullMetadata format.\n * Reuses base converter for action type conversion, then process\n * RIDs to use UUID-based format and adds fullLogicRules.\n */\n private static convertActionTypesWithFullLogicRulesFromBlockData(\n actions: Record<string, ActionTypeBlockDataV2>,\n blockdata: OntologyBlockDataV2,\n ): Record<string, Ontologies.ActionTypeFullMetadata> {\n const objectTypeLookup = buildBlockDataObjectTypeLookup(blockdata);\n const interfaceTypeLookup = buildBlockDataInterfaceTypeLookup(blockdata);\n const baseActionTypes = OntologyBlockDataToFullMetadataConverter\n .getOsdkActionTypesFromBlockData(\n blockdata,\n objectTypeLookup,\n interfaceTypeLookup,\n );\n\n // Build a lookup from apiName to the original IR action for logic rules\n const actionsByApiName = new Map(\n Object.values(actions).map(a => [a.actionType.metadata.apiName, a]),\n );\n const result: Record<string, Ontologies.ActionTypeFullMetadata> = {};\n for (const [apiName, baseActionType] of Object.entries(baseActionTypes)) {\n const action = actionsByApiName.get(apiName)!;\n result[apiName] = {\n actionType: {\n ...baseActionType,\n },\n fullLogicRules: convertBlockDataLogicRulesToActionLogicRules(\n action.actionType.actionTypeLogic.logic.rules,\n action,\n blockdata,\n ),\n };\n }\n\n return result;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,SACEA,iCAAiC,EACjCC,8BAA8B,EAC9BC,wCAAwC,EACxCC,MAAM,QACD,uCAAuC;AAC9C,SAASC,4CAA4C,QAAQ,+BAA+B;;AAE5F;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,CAAC;EACtC;AACF;AACA;AACA;EACE,OAAOC,mCAAmCA,CACxCC,SAA8B,EAC9BC,aAA+C,EAClB;IAC7B,MAAMC,YAAY,GAAGP,wCAAwC,CAC1DQ,4BAA4B,CAACH,SAAS,EAAEC,aAAa,CAAC;IAEzD,MAAMG,WAAW,GAAG,IAAI,CAACC,iDAAiD,CACxEL,SAAS,CAACI,WAAW,EACrBJ,SACF,CAAC;IACD;IACA,MAAMM,WAAW,GAAG,IAAI,CAACC,8BAA8B,CACrDL,YAAY,CAACI,WACf,CAAC;IAED,OAAO;MACL,GAAGJ,YAAY;MACfI,WAAW;MACXF,WAAW;MACXI,uBAAuB,EAAEJ,WAAW;MACpCK,QAAQ,EAAE;QACRC,OAAO,EAAE,UAAU;QACnBC,GAAG,EAAE,6BAA6B;QAClCC,WAAW,EAAE,UAAU;QACvBC,WAAW,EAAE;MACf;IACF,CAAC;EACH;;EAEA;AACF;AACA;EACE,OAAeN,8BAA8BA,CAC3CD,WAA8D,EACX;IACnD,MAAMQ,MAAyD,GAAG,CAAC,CAAC;IAEpE,KAAK,MAAM,CAACJ,OAAO,EAAEK,YAAY,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACX,WAAW,CAAC,EAAE;MACjE,MAAMY,UAAU,GAAGH,YAAY,CAACG,UAAU;MAC1C,MAAMC,UAAiD,GAAG,CAAC,CAAC;MAE5D,KAAK,MAAM,CAACC,OAAO,EAAEC,IAAI,CAAC,IAAIL,MAAM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AAIrB,MAAM,CAACC,OAAO,CAACY,eAAe,CAAC,EAAE;MACvE,MAAMS,MAAM,GAAGP,gBAAgB,CAACQ,GAAG,CAAC7B,OAAO,CAAE;MAC7CI,MAAM,CAACJ,OAAO,CAAC,GAAG;QAChByB,UAAU,EAAE;UACV,GAAGE;QACL,CAAC;QACDG,cAAc,EAAE3C,4CAA4C,CAC1DyC,MAAM,CAACH,UAAU,CAACM,eAAe,CAACC,KAAK,CAACC,KAAK,EAC7CL,MAAM,EACNtC,SACF;MACF,CAAC;IACH;IAEA,OAAOc,MAAM;EACf;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAEE,2BACK,uBAAwB;AAC/B,iBAAiB,gBAAgB,0BAA2B;;;;AAY5D,iBAAiB,oCACP,KAAK,WAAW,sBAAsB,eAChD;CACE,aAAa,eAAe,WAAW;AACxC;;;;;AAMD,OAAO,cAAM,2BAA2B;;;;;CAKtC,OAAO,oCACLA,WAAW,qBACXC,gBAAgB,WAAW,uBAC1B;;;;
|
|
1
|
+
{"mappings":"AAgBA,cAEE,2BACK,uBAAwB;AAC/B,iBAAiB,gBAAgB,0BAA2B;;;;AAY5D,iBAAiB,oCACP,KAAK,WAAW,sBAAsB,eAChD;CACE,aAAa,eAAe,WAAW;AACxC;;;;;AAMD,OAAO,cAAM,2BAA2B;;;;;CAKtC,OAAO,oCACLA,WAAW,qBACXC,gBAAgB,WAAW,uBAC1B;;;;CA8BH,eAAe;;;;;;CA0Cf,eAAe;AAkChB","names":["blockdata: OntologyBlockDataV2","importedTypes?: Ontologies.OntologyFullMetadata"],"sources":["../../src/PreviewOntologyIrConverter.ts"],"version":3,"file":"PreviewOntologyIrConverter.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/generator-converters.preview",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "OSDK generator with support for Python and TSv2 discovered functions",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@osdk/foundry.ontologies": "2.
|
|
32
|
+
"@osdk/foundry.ontologies": "2.77.0",
|
|
33
33
|
"consola": "^3.4.2",
|
|
34
34
|
"yargs": "17.7.2",
|
|
35
|
-
"@osdk/client.unstable": "~2.
|
|
36
|
-
"@osdk/generator": "~2.
|
|
37
|
-
"@osdk/generator-converters.ontologyir": "~2.
|
|
35
|
+
"@osdk/client.unstable": "~2.65.0",
|
|
36
|
+
"@osdk/generator": "~2.65.0",
|
|
37
|
+
"@osdk/generator-converters.ontologyir": "~2.65.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^24.3.1",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"ts-expect": "^1.3.0",
|
|
43
43
|
"typescript": "~5.5.4",
|
|
44
44
|
"vitest": "^3.2.4",
|
|
45
|
-
"@osdk/monorepo.
|
|
46
|
-
"@osdk/monorepo.
|
|
45
|
+
"@osdk/monorepo.tsconfig": "~0.7.0",
|
|
46
|
+
"@osdk/monorepo.api-extractor": "~0.7.0"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|