@osdk/maker-experimental 0.52.0 → 0.53.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 +6 -0
- package/build/browser/cli/main.js +1 -1
- package/build/browser/conversion/toMarketplace/shapeExtractors/ImportedShapeExtractor.js +19 -37
- package/build/browser/conversion/toMarketplace/shapeExtractors/ImportedShapeExtractor.js.map +1 -1
- package/build/cjs/index.cjs +18 -37
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/cli/main.js +1 -1
- package/build/esm/conversion/toMarketplace/shapeExtractors/ImportedShapeExtractor.js +19 -37
- package/build/esm/conversion/toMarketplace/shapeExtractors/ImportedShapeExtractor.js.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/conversion/toMarketplace/structActionParameterUtils.ts","../../src/conversion/toMarketplace/convertActionParameters.ts","../../src/conversion/toMarketplace/convertActionSections.ts","../../src/conversion/toMarketplace/convertConditionDefinition.ts","../../src/conversion/toMarketplace/convertActionParameterConditionalOverride.ts","../../src/conversion/toMarketplace/convertActionVisibility.ts","../../src/conversion/toMarketplace/convertSectionConditionalOverride.ts","../../src/conversion/toMarketplace/convertActionValidation.ts","../../src/conversion/toMarketplace/convertDatasourceDefinition.ts","../../src/conversion/toMarketplace/convertNullabilityToDataConstraint.ts","../../src/conversion/toMarketplace/convertValueType.ts","../../src/conversion/toMarketplace/convertDataConstraintToDataConstraints.ts","../../src/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.ts","../../src/conversion/toMarketplace/convertValueTypeDataConstraints.ts","../../src/conversion/toConjure/distributeTypeHelper.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts","../../src/conversion/toMarketplace/convertObjectPropertyType.ts","../../src/conversion/toMarketplace/convertObject.ts","../../src/conversion/toMarketplace/getFormContentOrdering.ts","../../src/conversion/toMarketplace/convertActionHelpers.ts","../../src/conversion/toMarketplace/convertSpt.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.ts","../../src/conversion/toMarketplace/convertInterfacePropertyType.ts","../../src/conversion/toMarketplace/convertInterface.ts","../../src/conversion/toMarketplace/convertCardinality.ts","../../src/conversion/toMarketplace/convertLink.ts","../../src/conversion/toMarketplace/typeVisitors.ts","../../src/conversion/toMarketplace/shapeExtractors/LinkTypeShapeExtractor.ts","../../src/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.ts","../../src/conversion/toMarketplace/shapeExtractors/IrShapeExtractor.ts","../../src/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.ts","../../src/conversion/toMarketplace/convertValueTypeToWireBlockData.ts","../../src/conversion/toMarketplace/convertOntologyDefinition.ts","../../src/conversion/toMarketplace/shapeExtractors/ImportedShapeExtractor.ts","../../src/api/defineOntologyV2.ts","../../src/conversion/toMarketplace/RecommendationUtils.ts","../../src/cli/generateBackingDataset.ts","../../src/cli/generateDirectDatasource.ts","../../src/cli/generateValueTypeBlockResults.ts","../../src/cli/main.ts","../../src/api/importObjectType.ts","../../src/api/defineFunctionBackedAction.ts"],"names":["convertToDisplayName","uppercaseFirstLetter","invariant","ReadableIdGenerator","extractAllowedValuesFromActionParameterType","getNamespace","shouldNotHaveRenderHints","hasRenderHints","getPropertyTypeName","shouldBeIndexedForSearch","defaultTypeClasses","convertObjectStatus","isInterfaceSharedPropertyType","withoutNamespace","isExotic","cleanAndValidateLinkTypeId","consola","getOntologyDefinition","isActionParameterTypePrimitive","OntologyEntityTypeEnum","getImportedTypes","shape","createLocalizedAbout","OntologyRidGeneratorImpl","initializeOntologyState","fs","writeStaticObjects","writeDependencyFile","toBlockShapeId","path","fs2","path2","fs3","path3","fs4","yargs","hideBin","path4","fs5","PreviewOntologyIrConverter","OntologyIrToFullMetadataConverter","OntologyBlockDataToFullMetadataConverter","pathToFileURL","convertToPluralDisplayName","importOntologyEntity","keb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ies, 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\nexport function getStructFieldTypes(parameter) {\n if (typeof parameter.type === \"string\") {\n return undefined;\n }\n switch (parameter.type.type) {\n case \"struct\":\n return parameter.type.struct.structFieldTypes;\n case \"structList\":\n return parameter.type.structList.structFieldTypes;\n default:\n return undefined;\n }\n}\nexport function getStructFieldActionParameterType(fieldType) {\n return fieldType.type === \"objectReference\" ? fieldType : fieldType.type;\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 { convertToDisplayName } from \"@osdk/maker\";\nimport { getStructFieldTypes } from \"./structActionParameterUtils.js\";\nconst FUNCTIONS_IR_INTERFACE_TYPE_RID_REGEX = /^ri\\.ontology-metadata\\.temp\\.interface-type\\.[0-9a-f]+$/u;\nexport function convertActionParameters(action, ridGenerator) {\n return Object.fromEntries((action.parameters ?? []).map(parameter => {\n let convertedType;\n if (typeof parameter.type === \"string\") {\n // Simple string types like \"string\", \"integer\", etc.\n convertedType = {\n type: parameter.type,\n [parameter.type]: {}\n };\n } else {\n // Complex types that need ObjectTypeId conversion\n switch (parameter.type.type) {\n case \"objectReference\":\n convertedType = {\n type: \"objectReference\",\n objectReference: {\n ...parameter.type.objectReference,\n objectTypeId: ridGenerator.generateObjectTypeId(parameter.type.objectReference.objectTypeId)\n }\n };\n break;\n case \"objectReferenceList\":\n convertedType = {\n type: \"objectReferenceList\",\n objectReferenceList: {\n ...parameter.type.objectReferenceList,\n objectTypeId: ridGenerator.generateObjectTypeId(parameter.type.objectReferenceList.objectTypeId)\n }\n };\n break;\n case \"interfaceReference\":\n convertedType = {\n type: \"interfaceReference\",\n interfaceReference: {\n // the functionsIR uses resolved rids over the wire, so function-backed action\n // interface parameters should be unconverted\n interfaceTypeRid: resolveInterfaceTypeRid(parameter.type.interfaceReference.interfaceTypeRid, ridGenerator)\n }\n };\n break;\n case \"interfaceReferenceList\":\n convertedType = {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: resolveInterfaceTypeRid(parameter.type.interfaceReferenceList.interfaceTypeRid, ridGenerator)\n }\n };\n break;\n case \"objectSetRid\":\n convertedType = {\n type: \"objectSetRid\",\n objectSetRid: {\n objectTypeId: ridGenerator.generateObjectTypeId(parameter.type.objectSetRid.objectTypeId)\n }\n };\n break;\n case \"objectTypeReference\":\n convertedType = {\n type: \"objectTypeReference\",\n objectTypeReference: {}\n };\n break;\n default:\n // Pass through other types unchanged\n convertedType = parameter.type;\n }\n }\n const structFieldsV2 = Object.keys(getStructFieldTypes(parameter) ?? {}).map(apiName => ({\n apiName,\n displayName: parameter.validation.structFieldValidations?.[apiName]?.displayName ?? convertToDisplayName(apiName)\n }));\n return [parameter.id, {\n id: parameter.id,\n rid: ridGenerator.generateRidForParameter(action.apiName, parameter.id),\n type: convertedType,\n displayMetadata: {\n displayName: parameter.displayName,\n description: parameter.description ?? \"\",\n typeClasses: [],\n structFields: {},\n structFieldsV2\n }\n }];\n }));\n}\nexport function resolveInterfaceTypeRid(interfaceTypeRidOrApiName, ridGenerator) {\n return FUNCTIONS_IR_INTERFACE_TYPE_RID_REGEX.test(interfaceTypeRidOrApiName) ? interfaceTypeRidOrApiName : ridGenerator.generateRidForInterface(interfaceTypeRidOrApiName);\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 { uppercaseFirstLetter } from \"@osdk/maker\";\nexport function convertActionSections(action, ridGenerator) {\n return Object.fromEntries(Object.entries(action.sections ?? {}).map(([sectionId, section]) => [sectionId, {\n id: sectionId,\n // TODO: Generate proper RID for section\n rid: ridGenerator.generateSectionRid(sectionId),\n content: section.parameters.map(p => ({\n type: \"parameterId\",\n parameterId: p\n })),\n displayMetadata: {\n collapsedByDefault: section.collapsedByDefault ?? false,\n columnCount: section.columnCount ?? 1,\n description: section.description ?? \"\",\n displayName: section.displayName ?? uppercaseFirstLetter(sectionId),\n showTitleBar: section.showTitleBar ?? true,\n ...(section.style && {\n style: section.style === \"box\" ? {\n type: \"box\",\n box: {}\n } : {\n type: \"minimal\",\n minimal: {}\n }\n })\n }\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 invariant from \"tiny-invariant\";\nexport function convertConditionDefinition(condition, actionParameters) {\n switch (condition.type) {\n case \"and\":\n if (\"conditions\" in condition) {\n return {\n type: \"and\",\n and: {\n conditions: condition.conditions.map(c => convertConditionDefinition(c, actionParameters))\n }\n };\n } else {\n return condition;\n }\n case \"or\":\n if (\"conditions\" in condition) {\n return {\n type: \"or\",\n or: {\n conditions: condition.conditions.map(c => convertConditionDefinition(c, actionParameters))\n }\n };\n } else {\n return condition;\n }\n case \"group\":\n return {\n type: \"comparison\",\n comparison: {\n operator: \"INTERSECTS\",\n left: {\n type: \"userProperty\",\n userProperty: {\n userId: {\n type: \"currentUser\",\n currentUser: {}\n },\n propertyValue: {\n type: \"groupIds\",\n groupIds: {}\n }\n }\n },\n right: {\n type: \"staticValue\",\n staticValue: {\n type: \"stringList\",\n stringList: {\n strings: [condition.name]\n }\n }\n }\n }\n };\n case \"parameter\":\n !actionParameters?.some(param => param.id === condition.parameterId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action parameter condition references unknown parameter ${condition.parameterId}`) : invariant(false) : void 0;\n return {\n type: \"comparison\",\n comparison: {\n operator: \"EQUALS\",\n left: {\n type: \"parameterId\",\n parameterId: condition.parameterId\n },\n right: condition.matches\n }\n };\n default:\n return condition;\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 { extractAllowedValues } from \"./convertActionHelpers.js\";\nimport { convertConditionDefinition } from \"./convertConditionDefinition.js\";\nexport function convertActionParameterConditionalOverride(override, validation, ridGenerator, actionParameters) {\n let parameterBlockOverride;\n switch (override.type) {\n case \"required\":\n parameterBlockOverride = {\n type: \"parameterRequired\",\n parameterRequired: {\n required: validation.required ? {\n type: \"notRequired\",\n notRequired: {}\n } : {\n type: \"required\",\n required: {}\n }\n }\n };\n break;\n case \"visibility\":\n let overrideType = override.then ?? (validation.defaultVisibility === \"editable\" ? \"hidden\" : \"editable\");\n parameterBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: overrideType === \"editable\" ? {\n type: \"editable\",\n editable: {}\n } : overrideType === \"hidden\" ? {\n type: \"hidden\",\n hidden: {}\n } : {\n type: \"disabled\",\n disabled: {}\n }\n }\n };\n break;\n case \"disabled\":\n overrideType = override.then ?? (validation.defaultVisibility === \"editable\" ? \"disabled\" : \"editable\");\n parameterBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: overrideType === \"editable\" ? {\n type: \"editable\",\n editable: {}\n } : overrideType === \"hidden\" ? {\n type: \"hidden\",\n hidden: {}\n } : {\n type: \"disabled\",\n disabled: {}\n }\n }\n };\n break;\n case \"defaultValue\":\n parameterBlockOverride = {\n type: \"prefill\",\n prefill: {\n prefill: override.defaultValue\n }\n };\n break;\n case \"constraint\":\n parameterBlockOverride = {\n type: \"allowedValues\",\n allowedValues: {\n allowedValues: extractAllowedValues(override.constraint, ridGenerator)\n }\n };\n break;\n default:\n throw new Error(`Unknown parameter override type`);\n }\n return {\n condition: convertConditionDefinition(override.condition, actionParameters),\n parameterBlockOverrides: [parameterBlockOverride]\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\nexport function convertActionVisibility(visibility) {\n switch (visibility) {\n case \"editable\":\n return {\n type: \"editable\",\n editable: {}\n };\n case \"disabled\":\n return {\n type: \"disabled\",\n disabled: {}\n };\n case \"hidden\":\n return {\n type: \"hidden\",\n hidden: {}\n };\n default:\n return {\n type: \"editable\",\n editable: {}\n };\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 { convertConditionDefinition } from \"./convertConditionDefinition.js\";\nexport function convertSectionConditionalOverride(override, defaultVisibility, actionParameters) {\n return {\n condition: convertConditionDefinition(override.condition, actionParameters),\n sectionBlockOverrides: [{\n type: \"visibility\",\n visibility: {\n visibility: defaultVisibility === \"visible\" ? {\n type: \"hidden\",\n hidden: {}\n } : {\n type: \"visible\",\n visible: {}\n }\n }\n }]\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 { extractAllowedValuesFromActionParameterType } from \"@osdk/maker\";\nimport { ReadableIdGenerator } from \"../../util/generateRid.js\";\nimport { extractAllowedValues, renderHintFromActionParameterType, renderHintFromBaseType } from \"./convertActionHelpers.js\";\nimport { convertActionParameterConditionalOverride } from \"./convertActionParameterConditionalOverride.js\";\nimport { convertActionVisibility } from \"./convertActionVisibility.js\";\nimport { convertConditionDefinition } from \"./convertConditionDefinition.js\";\nimport { convertSectionConditionalOverride } from \"./convertSectionConditionalOverride.js\";\nimport { getStructFieldActionParameterType, getStructFieldTypes } from \"./structActionParameterUtils.js\";\nconst STRUCT_FIELD_TYPES_SUPPORTING_ONE_OF = new Set([\"boolean\", \"integer\", \"long\", \"double\", \"string\", \"date\", \"timestamp\"]);\n\n// Helper function to recursively scan conditions and register groups\nfunction registerGroupsFromCondition(condition, ridGenerator) {\n if (!condition) return;\n switch (condition.type) {\n case \"group\":\n // Original format (parameter/section conditional overrides)\n if (condition.name) {\n ridGenerator.getGroupIds().put(ReadableIdGenerator.getForGroup(condition.name), condition.name);\n }\n break;\n case \"comparison\":\n // Converted format (action-level validations)\n // Check if this is a group comparison by looking at the left side\n if (condition.comparison?.left?.type === \"userProperty\" && condition.comparison?.left?.userProperty?.propertyValue?.type === \"groupIds\") {\n // Extract group names from the right side\n const strings = condition.comparison?.right?.staticValue?.stringList?.strings;\n if (Array.isArray(strings)) {\n strings.forEach(groupName => {\n ridGenerator.getGroupIds().put(ReadableIdGenerator.getForGroup(groupName), groupName);\n });\n }\n }\n break;\n case \"and\":\n case \"or\":\n // Recursively process nested conditions\n if (condition.conditions) {\n condition.conditions.forEach(c => registerGroupsFromCondition(c, ridGenerator));\n }\n // Handle converted and/or format\n if (condition.and?.conditions) {\n condition.and.conditions.forEach(c => registerGroupsFromCondition(c, ridGenerator));\n }\n if (condition.or?.conditions) {\n condition.or.conditions.forEach(c => registerGroupsFromCondition(c, ridGenerator));\n }\n break;\n\n // Other condition types don't have groups\n }\n}\nexport function convertActionValidation(action, ridGenerator) {\n const validationRules = action.validation ?? [{\n condition: {\n type: \"true\",\n true: {}\n },\n displayMetadata: {\n failureMessage: \"\",\n typeClasses: []\n }\n }];\n const ruleRids = validationRules.map((_, idx) => ridGenerator.generateValidationRuleRid(action.apiName, idx));\n\n // Register groups from action-level validation conditions\n validationRules.forEach(rule => {\n registerGroupsFromCondition(rule.condition, ridGenerator);\n });\n\n // Register groups from parameter conditional overrides\n (action.parameters ?? []).forEach(p => {\n p.validation.conditionalOverrides?.forEach(override => {\n registerGroupsFromCondition(override.condition, ridGenerator);\n });\n Object.values(p.validation.structFieldValidations ?? {}).forEach(structFieldValidation => {\n structFieldValidation.conditionalOverrides?.forEach(override => {\n registerGroupsFromCondition(override.condition, ridGenerator);\n });\n });\n });\n\n // Register groups from section conditional overrides\n Object.values(action.sections ?? {}).forEach(section => {\n section.conditionalOverrides?.forEach(override => {\n registerGroupsFromCondition(override.condition, ridGenerator);\n });\n });\n return {\n actionTypeLevelValidation: {\n // TODO: Add proper ordering of validation rule RIDs\n ordering: ruleRids,\n rules: Object.fromEntries(validationRules.map((rule, idx) => [ruleRids[idx], rule]))\n },\n parameterValidations: Object.fromEntries((action.parameters ?? []).map(p => {\n return [p.id, {\n defaultValidation: {\n display: {\n renderHint: p.renderHint ?? renderHintFromBaseType(p, p.validation),\n visibility: convertActionVisibility(p.validation.defaultVisibility),\n ...(p.defaultValue && {\n prefill: p.defaultValue\n })\n },\n validation: {\n allowedValues: extractAllowedValues(p.validation.allowedValues, ridGenerator),\n required: convertParameterRequirementConstraint(p.validation.required)\n }\n },\n conditionalOverrides: p.validation.conditionalOverrides?.map(override => convertActionParameterConditionalOverride(override, p.validation, ridGenerator, action.parameters)) ?? [],\n structFieldValidations: convertStructFieldValidations(p, ridGenerator, action.parameters)\n }];\n })),\n sectionValidations: {\n ...Object.fromEntries(Object.entries(action.sections ?? {}).map(([sectionId, section]) => [section.id, {\n defaultDisplayMetadata: section.defaultVisibility === \"hidden\" ? {\n visibility: {\n type: \"hidden\",\n hidden: {}\n }\n } : {\n visibility: {\n type: \"visible\",\n visible: {}\n }\n },\n conditionalOverrides: section.conditionalOverrides?.map(override => convertSectionConditionalOverride(override, section.defaultVisibility ?? \"visible\", action.parameters)) ?? []\n }]))\n }\n };\n}\nfunction convertStructFieldValidations(parameter, ridGenerator, actionParameters) {\n const configuredValidations = parameter.validation.structFieldValidations ?? {};\n const structFieldTypes = getStructFieldTypes(parameter);\n if (structFieldTypes === undefined) {\n if (Object.keys(configuredValidations).length > 0) {\n throw new Error(`Parameter ${parameter.id} defines struct field validations but is not a struct parameter`);\n }\n return {};\n }\n validateStructParameterConfiguration(parameter);\n for (const fieldApiName of Object.keys(configuredValidations)) {\n if (structFieldTypes[fieldApiName] === undefined) {\n throw new Error(`Struct field validation ${fieldApiName} does not match a field on parameter ${parameter.id}`);\n }\n }\n return Object.fromEntries(Object.entries(structFieldTypes).map(([fieldApiName, fieldType]) => {\n const configuration = configuredValidations[fieldApiName] ?? {};\n const actionParameterType = getStructFieldActionParameterType(fieldType);\n const allowedValues = configuration.allowedValues ?? extractAllowedValuesFromActionParameterType(actionParameterType);\n validateStructFieldAllowedValues(parameter.id, fieldApiName, fieldType, allowedValues);\n return [fieldApiName, {\n conditionalOverrides: configuration.conditionalOverrides?.map(override => convertStructFieldConditionalOverride(override, configuration, parameter.id, fieldApiName, fieldType, ridGenerator, actionParameters)) ?? [],\n defaultValidation: {\n display: {\n renderHint: configuration.renderHint ?? (allowedValues.type === \"oneOf\" || fieldType.type === \"boolean\" ? {\n type: \"dropdown\",\n dropdown: {}\n } : renderHintFromActionParameterType(actionParameterType, allowedValues, fieldApiName)),\n visibility: convertActionVisibility(configuration.defaultVisibility)\n },\n validation: {\n allowedValues: extractAllowedStructFieldValues(allowedValues, ridGenerator),\n required: convertParameterRequirementConstraint(configuration.required ?? false)\n }\n }\n }];\n }));\n}\nfunction validateStructParameterConfiguration(parameter) {\n if (parameter.validation.allowedValues?.type !== \"struct\") {\n throw new Error(`Struct parameter ${parameter.id} must use struct allowed values`);\n }\n if (parameter.defaultValue !== undefined) {\n throw new Error(`Struct parameter ${parameter.id} cannot define a top-level default value; configure prefills on individual struct fields instead`);\n }\n if (parameter.validation.conditionalOverrides?.some(override => override.type === \"defaultValue\")) {\n throw new Error(`Struct parameter ${parameter.id} cannot define a top-level default value override; configure prefills on individual struct fields instead`);\n }\n}\nfunction validateStructFieldAllowedValues(parameterId, fieldApiName, fieldType, allowedValues) {\n const inferredAllowedValues = extractAllowedValuesFromActionParameterType(getStructFieldActionParameterType(fieldType));\n const isCompatible = allowedValues.type === inferredAllowedValues.type || allowedValues.type === \"oneOf\" && STRUCT_FIELD_TYPES_SUPPORTING_ONE_OF.has(fieldType.type);\n if (!isCompatible) {\n throw new Error(`Allowed values ${allowedValues.type} are not compatible with struct field ${parameterId}.${fieldApiName} of type ${fieldType.type}`);\n }\n}\nfunction extractAllowedStructFieldValues(allowedValues, ridGenerator) {\n const converted = extractAllowedValues(allowedValues, ridGenerator);\n switch (converted.type) {\n case \"oneOf\":\n case \"range\":\n case \"text\":\n case \"datetime\":\n case \"boolean\":\n case \"geohash\":\n case \"geoshape\":\n case \"objectQuery\":\n return converted;\n default:\n throw new Error(`Allowed values ${converted.type} are not supported for struct fields`);\n }\n}\nfunction convertStructFieldConditionalOverride(override, configuration, parameterId, fieldApiName, fieldType, ridGenerator, actionParameters) {\n let structFieldBlockOverride;\n switch (override.type) {\n case \"required\":\n structFieldBlockOverride = {\n type: \"parameterRequired\",\n parameterRequired: {\n required: convertParameterRequirementConstraint(configuration.required !== true)\n }\n };\n break;\n case \"visibility\":\n case \"disabled\":\n structFieldBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: convertActionVisibility(override.then ?? (configuration.defaultVisibility === \"editable\" ? override.type === \"disabled\" ? \"disabled\" : \"hidden\" : \"editable\"))\n }\n };\n break;\n case \"constraint\":\n validateStructFieldAllowedValues(parameterId, fieldApiName, fieldType, override.constraint);\n structFieldBlockOverride = {\n type: \"allowedValues\",\n allowedValues: {\n allowedValues: extractAllowedStructFieldValues(override.constraint, ridGenerator)\n }\n };\n break;\n }\n return {\n condition: convertConditionDefinition(override.condition, actionParameters),\n structFieldBlockOverrides: [structFieldBlockOverride]\n };\n}\nfunction convertParameterRequirementConstraint(required) {\n if (typeof required === \"boolean\") {\n return required ? {\n type: \"required\",\n required: {}\n } : {\n type: \"notRequired\",\n notRequired: {}\n };\n }\n const {\n min,\n max\n } = required.listLength;\n return {\n type: \"listLengthValidation\",\n listLengthValidation: {\n minLength: min,\n maxLength: max\n }\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 invariant from \"tiny-invariant\";\nimport { ReadableIdGenerator } from \"../../util/generateRid.js\";\nexport function convertDatasourceDefinition(objectType, properties, ridGenerator) {\n const baseDatasource = objectType.datasources?.find(ds => [\"dataset\", \"stream\", \"restrictedView\", \"direct\"].includes(ds.type));\n\n // Helper to get column names from properties\n const getColumnNames = props => {\n return new Set(props.map(p => p.apiName));\n };\n switch (baseDatasource?.type) {\n case \"stream\":\n const window = baseDatasource.retentionPeriod ? convertToJavaDurationFormat(baseDatasource.retentionPeriod) : undefined;\n const retentionPolicy = window ? {\n type: \"time\",\n time: {\n window\n }\n } : {\n type: \"none\",\n none: {}\n };\n\n // Use generateStreamLocator instead of generateRid\n const streamLocator = ridGenerator.generateStreamLocator(objectType.apiName, getColumnNames(properties));\n const propertyMapping = Object.fromEntries(properties.map(prop => [ridGenerator.generatePropertyRid(prop.apiName, objectType.apiName), prop.apiName]));\n return {\n type: \"streamV2\",\n streamV2: {\n streamLocator: {\n branchId: streamLocator.branchId,\n streamLocatorRid: streamLocator.streamLocatorRid\n },\n propertyMapping,\n retentionPolicy,\n propertySecurityGroups: undefined\n }\n };\n case \"restrictedView\":\n // Use generateRestrictedViewLocator instead of generateRid\n const restrictedViewLocator = ridGenerator.generateRestrictedViewLocator(objectType.apiName, getColumnNames(properties));\n return {\n type: \"restrictedViewV2\",\n restrictedViewV2: {\n restrictedViewRid: restrictedViewLocator.rid,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator)\n }\n };\n case \"derived\":\n // Use generateLocator for dataset datasources\n const derivedDatasetLocator = ridGenerator.generateDatasetLocator(objectType.apiName, getColumnNames(properties));\n return {\n type: \"datasetV2\",\n datasetV2: {\n branchId: derivedDatasetLocator.branchId,\n datasetRid: derivedDatasetLocator.rid,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator)\n }\n };\n case \"direct\":\n const directDatasourceLocator = ridGenerator.generateDirectDatasourceLocator(objectType.apiName, getColumnNames(properties), \"master\");\n return {\n type: \"direct\",\n direct: {\n directSourceRid: directDatasourceLocator.rid,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator),\n propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName, objectType.apiName, ridGenerator)\n }\n };\n case \"dataset\":\n default:\n // Use generateLocator for dataset datasources\n const datasetLocator = ridGenerator.generateDatasetLocator(objectType.apiName, getColumnNames(properties));\n if (objectType.properties?.some(prop => typeof prop.type === \"object\" && prop.type.type === \"marking\") || baseDatasource?.objectSecurityPolicy || baseDatasource?.propertySecurityGroups) {\n return {\n type: \"datasetV3\",\n datasetV3: {\n datasetRid: datasetLocator.rid,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator),\n branchId: datasetLocator.branchId,\n propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName, objectType.apiName, ridGenerator)\n }\n };\n }\n return {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: datasetLocator.rid,\n branchId: datasetLocator.branchId,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator)\n }\n };\n }\n}\nfunction convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName, objectTypeApiName, ridGenerator) {\n if (!ds || !(\"objectSecurityPolicy\" in ds) && !(\"propertySecurityGroups\" in ds)) {\n // Default security group - use property RIDs\n const propertyRids = properties.map(prop => ridGenerator.generatePropertyRid(prop.apiName, objectTypeApiName));\n return {\n groups: [{\n properties: propertyRids,\n rid: ridGenerator.generatePropertySecurityGroupRid(\"defaultObjectSecurityPolicy\"),\n security: {\n type: \"granular\",\n granular: {\n viewPolicy: {\n granularPolicyCondition: {\n type: \"and\",\n and: {\n conditions: []\n }\n },\n additionalMandatory: {\n markings: [],\n assumedMarkings: []\n }\n }\n }\n },\n type: {\n type: \"primaryKey\",\n primaryKey: {}\n }\n }]\n };\n }\n const validPropertyNames = new Set(properties.map(prop => prop.apiName));\n const usedPropertyApiNames = new Set();\n\n // Collect and register group IDs (matching Java's collectSecurityGroupIds)\n const collectGroupIds = granularPolicy => {\n if (!granularPolicy) return;\n const collectFromCondition = condition => {\n switch (condition.type) {\n case \"group\":\n // Register group ID with the ridGenerator\n const groupId = condition.name;\n ridGenerator.getGroupIds().put(ReadableIdGenerator.getForGroup(groupId), groupId);\n break;\n case \"and\":\n case \"or\":\n if (\"conditions\" in condition) {\n condition.conditions.forEach(collectFromCondition);\n }\n break;\n }\n };\n collectFromCondition(granularPolicy);\n };\n\n // Collect group IDs from object security policy\n if (ds.objectSecurityPolicy?.granularPolicy) {\n collectGroupIds(ds.objectSecurityPolicy.granularPolicy);\n }\n\n // Validate and collect property security groups\n ds.propertySecurityGroups?.forEach(psg => {\n // Collect group IDs from property security groups\n if (psg.granularPolicy) {\n collectGroupIds(psg.granularPolicy);\n }\n psg.properties.forEach(propertyName => {\n !validPropertyNames.has(propertyName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property \"${propertyName}\" in property security group ${psg.name} does not exist in the properties list`) : invariant(false) : void 0;\n !!usedPropertyApiNames.has(propertyName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property \"${propertyName}\" is used in multiple property security groups`) : invariant(false) : void 0;\n !(propertyName !== primaryKeyPropertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property \"${propertyName}\" in property security group ${psg.name} cannot be the primary key`) : invariant(false) : void 0;\n usedPropertyApiNames.add(propertyName);\n });\n });\n\n // Build property RID mapping\n const propertyApiNameToRid = new Map();\n properties.forEach(prop => {\n propertyApiNameToRid.set(prop.apiName, ridGenerator.generatePropertyRid(prop.apiName, objectTypeApiName));\n });\n const objectSecurityPolicyGroup = {\n rid: ridGenerator.generatePropertySecurityGroupRid(ds.objectSecurityPolicy?.name || \"defaultObjectSecurityPolicy\"),\n security: {\n type: \"granular\",\n granular: convertGranularPolicy(ds.objectSecurityPolicy?.granularPolicy, ds.objectSecurityPolicy?.appliedMarkings, ds.objectSecurityPolicy?.assumedMarkings, ridGenerator, objectTypeApiName)\n },\n type: {\n type: \"primaryKey\",\n primaryKey: {}\n },\n properties: properties.filter(prop => !usedPropertyApiNames.has(prop.apiName)).map(prop => propertyApiNameToRid.get(prop.apiName))\n };\n return {\n groups: [...(ds.propertySecurityGroups?.map(psg => ({\n rid: ridGenerator.generatePropertySecurityGroupRid(psg.name),\n security: {\n type: \"granular\",\n granular: convertGranularPolicy(psg.granularPolicy, psg.appliedMarkings, psg.assumedMarkings, ridGenerator, objectTypeApiName)\n },\n type: {\n type: \"property\",\n property: {\n name: psg.name\n }\n },\n properties: psg.properties.map(apiName => propertyApiNameToRid.get(apiName))\n })) ?? []), objectSecurityPolicyGroup]\n };\n}\nfunction convertGranularPolicy(granularPolicy, appliedMarkings, assumedMarkings, ridGenerator, objectTypeApiName) {\n return {\n viewPolicy: {\n granularPolicyCondition: granularPolicy ? convertSecurityCondition(granularPolicy, ridGenerator, objectTypeApiName) : {\n type: \"and\",\n and: {\n conditions: []\n }\n },\n additionalMandatory: {\n markings: Object.keys(appliedMarkings ?? {}),\n assumedMarkings: Object.keys(assumedMarkings ?? {})\n }\n }\n };\n}\nfunction convertSecurityCondition(condition, ridGenerator, objectTypeApiName) {\n switch (condition.type) {\n case \"and\":\n if (\"conditions\" in condition) {\n return {\n type: \"and\",\n and: {\n conditions: condition.conditions.map(c => convertSecurityCondition(c, ridGenerator, objectTypeApiName))\n }\n };\n }\n return {\n type: \"and\",\n and: {\n conditions: condition.and.conditions.map(c => convertSecurityCondition(c, ridGenerator, objectTypeApiName))\n }\n };\n case \"or\":\n if (\"conditions\" in condition) {\n return {\n type: \"or\",\n or: {\n conditions: condition.conditions.map(c => convertSecurityCondition(c, ridGenerator, objectTypeApiName))\n }\n };\n }\n return {\n type: \"or\",\n or: {\n conditions: condition.or.conditions.map(c => convertSecurityCondition(c, ridGenerator, objectTypeApiName))\n }\n };\n case \"not\":\n return {\n type: \"not\",\n not: {\n condition: convertSecurityCondition(condition.not.condition, ridGenerator, objectTypeApiName)\n }\n };\n case \"markings\":\n return {\n type: \"markings\",\n markings: {\n property: convertSecurityProperty(condition.markings.property, ridGenerator, objectTypeApiName)\n }\n };\n case \"comparison\":\n return {\n type: \"comparison\",\n comparison: {\n ...condition.comparison,\n left: convertSecurityComparisonValue(condition.comparison.left, ridGenerator, objectTypeApiName),\n right: convertSecurityComparisonValue(condition.comparison.right, ridGenerator, objectTypeApiName)\n }\n };\n case \"markingProperty\":\n return {\n type: \"markings\",\n markings: {\n property: convertSecurityProperty(condition.property, ridGenerator, objectTypeApiName)\n }\n };\n case \"groupProperty\":\n return {\n type: \"comparison\",\n comparison: {\n operator: \"INTERSECTS\",\n left: {\n type: \"userProperty\",\n userProperty: {\n type: \"groupIds\",\n groupIds: {}\n }\n },\n right: {\n type: \"property\",\n property: convertSecurityProperty(condition.property, ridGenerator, objectTypeApiName)\n }\n }\n };\n case \"group\":\n return {\n type: \"comparison\",\n comparison: {\n operator: \"INTERSECTS\",\n left: {\n type: \"userProperty\",\n userProperty: {\n type: \"groupIds\",\n groupIds: {}\n }\n },\n right: {\n type: \"constant\",\n constant: {\n type: \"strings\",\n strings: [condition.name]\n }\n }\n }\n };\n default:\n return condition;\n }\n}\nfunction convertSecurityComparisonValue(value, ridGenerator, objectTypeApiName) {\n if (value.type !== \"property\") {\n return value;\n }\n return {\n type: \"property\",\n property: convertSecurityProperty(value.property, ridGenerator, objectTypeApiName)\n };\n}\nfunction convertSecurityProperty(property, ridGenerator, objectTypeApiName) {\n return ridGenerator && objectTypeApiName ? ridGenerator.generatePropertyRid(property, objectTypeApiName) : property;\n}\n\n/**\n * Converts ISO 8601 duration to Java Duration format (hours/minutes/seconds only).\n * Java's Duration class doesn't support days/weeks/months/years natively,\n * so P90D becomes PT2160H, P1W becomes PT168H, etc.\n */\nfunction convertToJavaDurationFormat(iso8601) {\n const match = iso8601.match(/^P(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?)?$/u);\n if (!match) return iso8601;\n const weeks = parseInt(match[1] || \"0\", 10);\n const days = parseInt(match[2] || \"0\", 10);\n const hours = parseInt(match[3] || \"0\", 10);\n const minutes = parseInt(match[4] || \"0\", 10);\n const seconds = parseInt(match[5] || \"0\", 10);\n const totalHours = (weeks * 7 + days) * 24 + hours;\n const parts = [];\n if (totalHours > 0) parts.push(`${totalHours}H`);\n if (minutes > 0) parts.push(`${minutes}M`);\n if (seconds > 0) parts.push(`${seconds}S`);\n return parts.length > 0 ? `PT${parts.join(\"\")}` : \"PT0S\";\n}\nfunction buildPropertyMapping(properties, objectTypeApiName, ridGenerator) {\n // TODO: Convert property mappings to use RIDs as keys\n return Object.fromEntries(properties.map(prop => {\n const propertyRid = ridGenerator.generatePropertyRid(prop.apiName, objectTypeApiName);\n // editOnly\n if (prop.editOnly) {\n return [propertyRid, {\n type: \"editOnly\",\n editOnly: {}\n }];\n }\n // structs\n if (typeof prop.type === \"object\" && prop.type?.type === \"struct\") {\n const structMapping = {\n type: \"struct\",\n struct: {\n column: prop.apiName,\n mapping: Object.fromEntries(Object.keys(prop.type.structDefinition).map(fieldName => [fieldName, {\n apiName: fieldName,\n mappings: {}\n }]))\n }\n };\n return [propertyRid, structMapping];\n }\n // default: column mapping\n return [propertyRid, {\n type: \"column\",\n column: prop.apiName\n }];\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 invariant from \"tiny-invariant\";\nexport function convertNullabilityToDataConstraint(prop) {\n if (typeof prop.type === \"object\" && prop.type.type === \"marking\") {\n if (prop.nullability === undefined) {\n return {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: {\n noNulls: true,\n noEmptyCollections: true\n }\n };\n }\n !prop.nullability?.noNulls ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Marking property type has noNulls set to false, marking properties must not be nullable\") : invariant(false) : void 0;\n return {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability\n };\n }\n return prop.nullability === undefined ? undefined : {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability\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\nexport function convertValueType(valueType, ridGenerator) {\n return ridGenerator.generateRidForValueType(valueType.apiName, valueType.version);\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 { dataConstraintToPropertyTypeDataConstraint } from \"./dataConstraintToPropertyTypeDataConstraint.js\";\nexport function convertDataConstraintToDataConstraints(dc) {\n return {\n propertyTypeConstraints: [{\n constraints: dataConstraintToPropertyTypeDataConstraint(dc)\n // known limitation: structs don't carry field-level data constraint failure messages\n }]\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 { convertDataConstraintToDataConstraints } from \"./convertDataConstraintToDataConstraints.js\";\nexport function dataConstraintToPropertyTypeDataConstraint(dc) {\n switch (dc.type) {\n case \"array\":\n return {\n ...dc\n };\n case \"boolean\":\n return {\n ...dc\n };\n case \"binary\":\n throw new Error(\"Binary type constraints are not supported\");\n case \"date\":\n return {\n ...dc\n };\n case \"decimal\":\n return {\n ...dc\n };\n case \"double\":\n return {\n ...dc\n };\n case \"float\":\n return {\n ...dc\n };\n case \"integer\":\n return {\n ...dc\n };\n case \"long\":\n return {\n ...dc\n };\n case \"map\":\n throw new Error(\"Map type constraints are not supported\");\n case \"nullable\":\n throw new Error(\"Nullable constraints are not supported\");\n case \"short\":\n return {\n ...dc\n };\n case \"string\":\n return {\n ...dc\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: {\n elementConstraints: Object.fromEntries(Object.entries(dc.struct.elementConstraints).map(([field, constraint]) => [field, convertDataConstraintToDataConstraints(constraint)]))\n }\n };\n case \"structV2\":\n throw new Error(\"StructV2 constraints are not supported\");\n case \"timestamp\":\n return {\n ...dc\n };\n default:\n throw new Error(`Unknown DataConstraint type: ${dc.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 { dataConstraintToPropertyTypeDataConstraint } from \"./dataConstraintToPropertyTypeDataConstraint.js\";\nexport function convertValueTypeDataConstraints(dataConstraints) {\n if (dataConstraints.length === 0) {\n return undefined;\n }\n const propertyTypeConstraints = dataConstraints.map(constraint => ({\n constraints: dataConstraintToPropertyTypeDataConstraint(constraint.constraint.constraint),\n failureMessage: constraint.constraint.failureMessage\n }));\n return {\n propertyTypeConstraints\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\nexport function distributeTypeHelper(type) {\n return {\n type,\n [type]: {}\n }; // any cast to match conditional return type\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 { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\nexport function propertyTypeTypeToOntologyIrType(type, ridGenerator, propertyApiName) {\n switch (true) {\n case typeof type === \"object\" && type.type === \"marking\":\n return {\n type: \"marking\",\n marking: {\n markingType: type.markingType\n }\n };\n case typeof type === \"object\" && type.type === \"struct\":\n const structFields = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n structFieldRid: propertyApiName ? ridGenerator.generateStructFieldRid(propertyApiName, key) : ridGenerator.generateRid(`structfield.${key}`),\n apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition, ridGenerator, propertyApiName)\n };\n } else {\n // If it is a full form type definition then process it as such\n if (\"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n structFieldRid: propertyApiName ? ridGenerator.generateStructFieldRid(propertyApiName, key) : ridGenerator.generateRid(`structfield.${key}`),\n apiName: key,\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition.fieldType, ridGenerator, propertyApiName),\n displayMetadata: fieldTypeDefinition.displayMetadata ?? {\n displayName: key,\n description: undefined\n },\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? []\n };\n } else {\n field = {\n structFieldRid: propertyApiName ? ridGenerator.generateStructFieldRid(propertyApiName, key) : ridGenerator.generateRid(`structfield.${key}`),\n apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition, ridGenerator, propertyApiName)\n };\n }\n }\n structFields.push(field);\n }\n const mainValue = type.mainValue ? {\n type: propertyTypeTypeToOntologyIrType(type.mainValue.type, ridGenerator, propertyApiName),\n fields: (Array.isArray(type.mainValue.fields) ? type.mainValue.fields : [type.mainValue.fields]).map(fieldApiName => propertyApiName ? ridGenerator.generateStructFieldRid(propertyApiName, fieldApiName) : ridGenerator.generateRid(`structfield.${fieldApiName}`))\n } : undefined;\n return {\n type: \"struct\",\n struct: {\n structFields,\n mainValue\n }\n };\n case typeof type === \"object\" && type.type === \"string\":\n return {\n type: \"string\",\n string: {\n analyzerOverride: type.analyzerOverride,\n enableAsciiFolding: type.enableAsciiFolding,\n isLongText: type.isLongText ?? false,\n supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard ?? false,\n supportsExactMatching: type.supportsExactMatching ?? true,\n supportsFullTextRegex: type.supportsFullTextRegex\n }\n };\n case typeof type === \"object\" && type.type === \"decimal\":\n return {\n type: \"decimal\",\n decimal: {\n precision: type.precision,\n scale: type.scale\n }\n };\n case type === \"geopoint\":\n return {\n type: \"geohash\",\n geohash: {}\n };\n case type === \"decimal\":\n return {\n type,\n [type]: {\n precision: undefined,\n scale: undefined\n }\n };\n case type === \"string\":\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsEfficientLeadingWildcard: false,\n supportsExactMatching: true\n }\n };\n case type === \"mediaReference\":\n return {\n type,\n mediaReference: {}\n };\n case type === \"geotimeSeries\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {}\n };\n case type === \"attachment\":\n return {\n type: \"attachment\",\n attachment: {}\n };\n default:\n // use helper function to distribute `type` properly\n if (typeof type === \"object\") {\n throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);\n }\n return distributeTypeHelper(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 { convertObjectStatus, defaultTypeClasses, getNamespace, getPropertyTypeName, hasRenderHints, shouldBeIndexedForSearch, shouldNotHaveRenderHints } from \"@osdk/maker\";\nimport invariant from \"tiny-invariant\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertValueType } from \"./convertValueType.js\";\nimport { convertValueTypeDataConstraints } from \"./convertValueTypeDataConstraints.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertObjectPropertyType(property, objectTypeApiName, ridGenerator) {\n const apiName = getNamespace() + property.apiName;\n !(!shouldNotHaveRenderHints(property.type) || !hasRenderHints(property.typeClasses)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property type ${apiName} of type '${getPropertyTypeName(property.type)}' should not have render hints`) : invariant(false) : void 0;\n // TODO: Generate proper RID and ID based on object type and property API name\n const propertyRid = ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName);\n const output = {\n apiName: property.apiName,\n id: property.apiName,\n // TODO: Should this be different from apiName?\n rid: propertyRid,\n sharedPropertyTypeApiName: property.sharedPropertyType?.apiName,\n displayMetadata: {\n displayName: property.displayName,\n description: property.description,\n visibility: property.visibility ?? \"NORMAL\"\n },\n indexedForSearch: property.indexedForSearch ?? shouldBeIndexedForSearch(property.type),\n ruleSetBinding: undefined,\n baseFormatter: property.baseFormatter,\n type: property.array ? {\n type: \"array\",\n array: {\n subtype: propertyTypeTypeToOntologyIrType(property.type, ridGenerator, property.apiName),\n reducers: []\n }\n } : propertyTypeTypeToOntologyIrType(property.type, ridGenerator, property.apiName),\n typeClasses: property.typeClasses ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),\n status: convertObjectStatus(property.status),\n inlineAction: undefined,\n dataConstraints: property.valueType ? convertValueTypeDataConstraints(property.valueType.constraints) : convertNullabilityToDataConstraint(property),\n // TODO: Convert sharedPropertyTypeRid from API name to RID\n sharedPropertyTypeRid: property.sharedPropertyType ? ridGenerator.generateSptRid(property.sharedPropertyType.apiName) : undefined,\n valueType: property.valueType ? convertValueType(property.valueType, ridGenerator) : undefined\n };\n return output;\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 { cleanAndValidateLinkTypeId, convertObjectStatus, isExotic, isInterfaceSharedPropertyType, withoutNamespace } from \"@osdk/maker\";\nimport invariant from \"tiny-invariant\";\nimport { buildDatasource } from \"./convertActionHelpers.js\";\nimport { convertDatasourceDefinition } from \"./convertDatasourceDefinition.js\";\nimport { convertObjectPropertyType } from \"./convertObjectPropertyType.js\";\nexport function convertObject(objectType, ridGenerator) {\n const {\n derivedDatasources,\n derivedPropertyNames\n } = extractDerivedDatasources(objectType, ridGenerator);\n const propertyDatasources = (objectType.properties ?? []).filter(prop => !derivedPropertyNames.includes(prop.apiName)).flatMap(prop => extractPropertyDatasource(prop, objectType.apiName, ridGenerator));\n const classificationGroupMarkingNames = extractMarkingGroups(objectType.properties ?? [], \"CBAC\");\n const mandatoryMarkingNames = extractMarkingGroups(objectType.properties ?? [], \"MANDATORY\");\n const classificationInputGroup = classificationGroupMarkingNames.length > 0 ? classificationGroupMarkingNames.reduce((l, r) => l + \"/\" + r) : undefined;\n const mandatoryInputGroup = mandatoryMarkingNames.length > 0 ? mandatoryMarkingNames.reduce((l, r) => l + \"/\" + r) : undefined;\n const objectDatasource = buildDatasource(objectType.apiName, convertDatasourceDefinition(objectType, (objectType.properties ?? []).filter(prop => !derivedPropertyNames.includes(prop.apiName)), ridGenerator), ridGenerator, classificationInputGroup, mandatoryInputGroup);\n const implementations = objectType.implementsInterfaces ?? [];\n const objectTypeRid = ridGenerator.generateRidForObjectType(objectType.apiName);\n\n // Convert propertyTypes to use RIDs as keys\n const propertyTypesWithRids = Object.fromEntries(objectType.properties?.map(val => {\n const convertedProp = convertObjectPropertyType(val, objectType.apiName, ridGenerator);\n return [convertedProp.rid, convertedProp];\n }) ?? []);\n const titlePropertyRid = ridGenerator.generatePropertyRid(objectType.titlePropertyApiName, objectType.apiName);\n return {\n objectType: {\n displayMetadata: {\n description: objectType.description,\n displayName: objectType.displayName,\n groupDisplayName: undefined,\n icon: {\n type: \"blueprint\",\n blueprint: objectType.icon ?? {\n locator: \"cube\",\n color: \"#2D72D2\"\n }\n },\n pluralDisplayName: objectType.pluralDisplayName,\n visibility: objectType.visibility ?? \"NORMAL\"\n },\n primaryKeys: [ridGenerator.generatePropertyRid(objectType.primaryKeyPropertyApiName, objectType.apiName)],\n propertyTypes: propertyTypesWithRids,\n titlePropertyTypeRid: titlePropertyRid,\n apiName: objectType.apiName,\n rid: objectTypeRid,\n id: ridGenerator.generateObjectTypeId(objectType.apiName),\n status: convertObjectStatus(objectType.status),\n redacted: false,\n implementsInterfaces: implementations.map(impl => ridGenerator.generateRidForInterface(impl.implements.apiName)),\n implementsInterfaces2: implementations.map(impl => {\n const allParents = flattenInterface(impl.implements, new Set());\n return {\n interfaceTypeRid: ridGenerator.generateRidForInterface(impl.implements.apiName),\n interfaceTypeApiName: impl.implements.apiName,\n links: {},\n linksV2: {},\n propertiesV2: Object.fromEntries(impl.propertyMapping.map(mappings => {\n const resolvedProperty = resolveInterfaceProperty(allParents, mappings.interfaceProperty);\n !(resolvedProperty !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface property '${mappings.interfaceProperty}' not found on interface '${impl.implements.apiName}'`) : invariant(false) : void 0;\n const interfacePropertyTypeRid = isInterfaceSharedPropertyType(resolvedProperty.property) ? ridGenerator.generateIptRidFromSptRid(ridGenerator.generateSptRid(resolvedProperty.property.sharedPropertyType.apiName)) : ridGenerator.generateInterfacePropertyTypeRid(resolvedProperty.apiName, resolvedProperty.interfaceType.apiName);\n return [interfacePropertyTypeRid, {\n type: \"propertyTypeRid\",\n propertyTypeRid: ridGenerator.generatePropertyRid(mappings.mapsTo, objectType.apiName)\n }];\n })),\n properties: {},\n actionTypes: {}\n };\n }),\n allImplementsInterfaces: {},\n traits: {\n workflowObjectTypeTraits: {}\n },\n typeGroups: []\n },\n datasources: [...propertyDatasources, ...derivedDatasources, objectDatasource],\n entityMetadata: buildEntityMetadata(objectType, ridGenerator),\n propertySecurityGroupPackagingVersion: {\n type: \"v2\",\n v2: {}\n },\n schemaMigrations: undefined,\n writebackDatasets: []\n };\n}\nfunction resolveInterfaceProperty(interfaceTypes, mappedApiName) {\n const properties = interfaceTypes.flatMap(interfaceType => Object.entries(interfaceType.propertiesV3).map(([apiName, property]) => ({\n apiName,\n interfaceType,\n property,\n mappedApiName: isInterfaceSharedPropertyType(property) ? property.sharedPropertyType.apiName : apiName\n })));\n const resolvedProperty = properties.find(property => property.mappedApiName === mappedApiName) ?? properties.find(property => withoutNamespace(property.mappedApiName) === withoutNamespace(mappedApiName));\n if (resolvedProperty === undefined) {\n return undefined;\n }\n return {\n apiName: resolvedProperty.apiName,\n interfaceType: resolvedProperty.interfaceType,\n property: resolvedProperty.property\n };\n}\n\n/**\n * Extracts marking group names of a specific type from object properties\n */\nexport function extractMarkingGroups(properties, markingType) {\n return properties.map(prop => {\n if (typeof prop.type === \"object\" && prop.type.type === \"marking\" && prop.type.markingType === markingType) {\n return prop.type.markingInputGroupName;\n }\n return undefined;\n }).filter(val => val !== undefined);\n}\nexport function extractPropertyDatasource(property, objectTypeApiName, ridGenerator) {\n if (!isExotic(property.type)) {\n return [];\n }\n const identifier = objectTypeApiName + \".\" + property.apiName;\n switch (property.type) {\n case \"geotimeSeries\":\n const geotimeDefinition = {\n type: \"geotimeSeries\",\n geotimeSeries: {\n geotimeSeriesIntegrationRid: ridGenerator.generateRidForGeotimeSeriesIntegration(identifier),\n properties: [ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName)]\n }\n };\n return [buildDatasource(property.apiName, geotimeDefinition, ridGenerator)];\n case \"mediaReference\":\n const mediaSetDefinition = {\n type: \"mediaSetView\",\n mediaSetView: {\n assumedMarkings: [],\n clearOnDeleteProperties: [],\n mediaSetViewLocator: ridGenerator.generateMediaSetViewLocator(identifier),\n properties: [ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName)],\n uploadProperties: []\n }\n };\n return [buildDatasource(property.apiName, mediaSetDefinition, ridGenerator)];\n default:\n return [];\n }\n}\nfunction extractDerivedDatasources(objectType, ridGenerator) {\n const inputDerivedDatasources = (objectType.datasources ?? []).filter(ds => ds.type === \"derived\");\n const propertyApiNames = new Set((objectType.properties ?? []).map(prop => prop.apiName));\n inputDerivedDatasources.forEach(ds => Object.keys(ds.propertyMapping).forEach(prop => !propertyApiNames.has(prop) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${prop}' used in derived datasource for object '${objectType.apiName}' is not defined.`) : invariant(false) : void 0));\n const derivedDatasources = inputDerivedDatasources.map((ds, i) => buildDerivedDatasource(ds, i, objectType.apiName, ridGenerator));\n const derivedPropertyNames = inputDerivedDatasources.flatMap(ds => Object.keys(ds.propertyMapping));\n return {\n derivedDatasources,\n derivedPropertyNames\n };\n}\nfunction buildDerivedDatasource(datasource, index, objectTypeApiName, ridGenerator) {\n // TODO: Convert linkType from API name to RID\n const linkDefinition = {\n type: \"multiHopLink\",\n multiHopLink: {\n steps: datasource.linkDefinition.map(step => ({\n type: \"searchAround\",\n searchAround: {\n linkTypeIdentifier: {\n type: \"linkType\",\n linkType: ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(step.linkType.apiName))\n },\n linkTypeSide: step.side ?? \"SOURCE\"\n }\n }))\n }\n };\n const isLinkedProperties = typeof Object.values(datasource.propertyMapping)[0] === \"string\";\n const derivedDefinition = isLinkedProperties ? {\n type: \"linkedProperties\",\n linkedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(Object.entries(datasource.propertyMapping).map(([sourceProp, targetProp]) => [ridGenerator.generatePropertyRid(sourceProp, objectTypeApiName), {\n type: \"propertyType\",\n propertyType: ridGenerator.generatePropertyRid(targetProp, objectTypeApiName)\n }]))\n }\n } : {\n type: \"aggregatedProperties\",\n aggregatedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(Object.entries(datasource.propertyMapping).map(([sourceProp, agg]) => [ridGenerator.generatePropertyRid(sourceProp, objectTypeApiName), buildAggregation(agg, ridGenerator)]))\n }\n };\n const fullDefinition = {\n type: \"derived\",\n derived: {\n definition: derivedDefinition\n }\n };\n return buildDatasource(objectTypeApiName + \".derived.\" + index.toString(), fullDefinition, ridGenerator);\n}\nfunction buildAggregation(agg, ridGenerator) {\n const type = agg.type;\n const limit = \"limit\" in agg ? agg.limit : undefined;\n const foreignProperty = \"property\" in agg ? agg.property : undefined;\n const innerDef = {};\n // TODO: Convert property references in aggregations to RIDs\n if (type !== \"count\") {\n if ([\"collectList\", \"collectSet\"].includes(type)) {\n innerDef.linkedProperty = {\n type: \"propertyType\",\n propertyType: foreignProperty ? ridGenerator.generateRid(`property.unknown.${foreignProperty}`) : undefined\n };\n innerDef.limit = limit;\n } else {\n innerDef.property = {\n type: \"propertyType\",\n propertyType: foreignProperty ? ridGenerator.generateRid(`property.unknown.${foreignProperty}`) : undefined\n };\n }\n }\n return {\n type,\n [type]: innerDef\n };\n}\n\n/**\n * Build entity metadata with fields that match Java's output.\n * Some fields (highbury, editsResolutionStrategies, propertySecurityGroupPackagingVersion)\n * aren't in the TS type definitions yet but are required by the Java converter output.\n */\nfunction buildEntityMetadata(objectType, ridGenerator) {\n const metadata = {\n arePatchesEnabled: objectType.editsEnabled ?? false,\n aliases: objectType.aliases ?? [],\n diffEdits: false,\n entityConfig: {\n objectDbTypeConfigs: {\n highbury: {\n objectDbConfigs: {\n \"ri.highbury.main.cluster.1\": {\n configValue: \"{}\"\n }\n }\n }\n }\n },\n editsResolutionStrategies: {\n strategies: {}\n },\n targetStorageBackend: {\n type: \"objectStorageV2\",\n objectStorageV2: {}\n },\n editsHistory: convertEditsHistory(ridGenerator, objectType.apiName, objectType.editsHistoryConfig)\n };\n return metadata;\n}\nfunction convertEditsHistory(ridGenerator, apiName, config) {\n if (config) {\n return config.enabled ? {\n type: \"config\",\n config: {\n store: ridGenerator.generateRidForObjectType(apiName),\n storeAllPreviousProperties: config.storeAllPreviousProperties\n }\n } : {\n type: \"none\",\n none: {}\n };\n }\n return undefined;\n}\nexport function flattenInterface(interfaceType, seen) {\n if (seen.has(interfaceType.apiName)) {\n return [];\n }\n seen.add(interfaceType.apiName);\n if (interfaceType.extendsInterfaces.length === 0) {\n return [interfaceType];\n }\n const parents = interfaceType.extendsInterfaces.flatMap(parent => flattenInterface(parent, seen));\n return [interfaceType, ...parents];\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\nexport function getFormContentOrdering(action, parameterOrdering) {\n if (!action.sections) return [];\n const parametersToSection = Object.fromEntries(Object.entries(action.sections).flatMap(([sectionId, section]) => section.parameters.map(param => [param, sectionId])));\n const seenIds = new Set();\n const formContentOrdering = [];\n parameterOrdering.forEach(param => {\n if (param in parametersToSection && !seenIds.has(parametersToSection[param])) {\n formContentOrdering.push({\n type: \"sectionId\",\n sectionId: parametersToSection[param]\n });\n seenIds.add(parametersToSection[param]);\n } else if (!(param in parametersToSection)) {\n formContentOrdering.push({\n type: \"parameterId\",\n parameterId: param\n });\n seenIds.add(param);\n }\n });\n return formContentOrdering;\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 { extractAllowedValuesFromActionParameterType, getOntologyDefinition, isActionParameterTypePrimitive, uppercaseFirstLetter } from \"@osdk/maker\";\nimport consola from \"consola\";\nimport invariant from \"tiny-invariant\";\nimport { ReadableIdGenerator } from \"../../util/generateRid.js\";\nimport { convertActionParameters, resolveInterfaceTypeRid } from \"./convertActionParameters.js\";\nimport { convertActionSections } from \"./convertActionSections.js\";\nimport { convertActionValidation } from \"./convertActionValidation.js\";\nimport { flattenInterface } from \"./convertObject.js\";\nimport { getFormContentOrdering } from \"./getFormContentOrdering.js\";\nexport function buildDatasource(apiName, definition, ridGenerator, classificationMarkingGroupName, mandatoryMarkingGroupName) {\n const needsSecurity = classificationMarkingGroupName !== undefined || mandatoryMarkingGroupName !== undefined;\n const securityConfig = needsSecurity ? {\n classificationConstraint: classificationMarkingGroupName ? {\n markings: [classificationMarkingGroupName]\n } : undefined,\n markingConstraint: mandatoryMarkingGroupName ? {\n markingIds: [mandatoryMarkingGroupName]\n } : undefined\n } : undefined;\n return {\n rid: ridGenerator.generateDatasourceRid(apiName),\n datasource: definition,\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: false,\n ...(securityConfig !== undefined && {\n dataSecurity: securityConfig\n })\n };\n}\nexport function convertAction(action, ridGenerator, functionsIr) {\n if (action.rules.map(rule => rule.type === \"functionRule\").some(v => v)) {\n if (!functionsIr) {\n consola.info(\"No functions IR file found, skipping some function-backed actions\");\n return undefined;\n }\n return convertFunctionBackedAction(action, ridGenerator, functionsIr);\n }\n const actionValidation = convertActionValidation(action, ridGenerator);\n const actionParameters = convertActionParameters(action, ridGenerator);\n const actionSections = convertActionSections(action, ridGenerator);\n const parameterOrdering = action.parameterOrdering ?? (action.parameters ?? []).map(p => p.id);\n\n // Build parameterIds mapping: UUID (BlockInternalId) -> ParameterId (API name)\n const parameterIds = {};\n (action.parameters ?? []).forEach(p => {\n const readableId = ReadableIdGenerator.getForParameter(action.apiName, p.id);\n const uuid = ridGenerator.toBlockInternalId(readableId);\n parameterIds[uuid] = p.id;\n });\n const ontologyDefinition = getOntologyDefinition();\n\n // Helper function to convert interface property values from API names to RIDs\n const convertInterfacePropertyValuesToRids = (interfacePropertyValues, allParentInterfaces) => {\n const result = {};\n for (const [apiName, value] of Object.entries(interfacePropertyValues)) {\n const parentInterface = allParentInterfaces.find(maybeSourceParent => maybeSourceParent.propertiesV3[apiName] !== undefined);\n if (parentInterface) {\n // check for IDP first\n const rid = ridGenerator.generateInterfacePropertyTypeRid(apiName, parentInterface.apiName);\n result[rid] = value;\n } else {\n // fall back to SPT\n const sptReadableId = ReadableIdGenerator.getForSpt(apiName);\n const sptRid = ridGenerator.getSharedPropertyTypeRids().get(sptReadableId);\n !sptRid ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Could not find SPT RID for property \"${apiName}\" used in action logic rule`) : invariant(false) : void 0;\n const iptRid = sptRid.replace(\"shared-property-type\", \"interface-property-type\");\n result[iptRid] = value;\n }\n }\n return result;\n };\n\n // Helper function to convert shared property values from API names to RIDs\n const convertSharedPropertyValuesToRids = sharedPropertyValues => {\n const result = {};\n for (const [apiName, value] of Object.entries(sharedPropertyValues)) {\n const rid = ridGenerator.generateSptRid(apiName);\n result[rid] = value;\n }\n return result;\n };\n const convertStructFieldValues = structFieldValues => Object.fromEntries(Object.entries(structFieldValues).map(([propertyApiName, fieldValues]) => [propertyApiName, Object.fromEntries(Object.entries(fieldValues).map(([fieldApiName, value]) => [ridGenerator.generateStructFieldRid(propertyApiName, fieldApiName), value]))]));\n return {\n actionType: {\n actionTypeLogic: {\n logic: {\n // Convert logic rules with proper RID mappings\n rules: action.rules.map(rule => {\n if (rule.type === \"addInterfaceRule\") {\n const interfaceAndParents = flattenInterface(ontologyDefinition.INTERFACE_TYPE[rule.addInterfaceRule.interfaceApiName], new Set());\n return {\n type: \"addInterfaceRule\",\n addInterfaceRule: {\n interfaceTypeRid: ridGenerator.generateRidForInterface(rule.addInterfaceRule.interfaceApiName),\n objectType: rule.addInterfaceRule.objectTypeParameter,\n interfacePropertyValues: convertInterfacePropertyValuesToRids(rule.addInterfaceRule.interfacePropertyValues, interfaceAndParents),\n sharedPropertyValues: convertSharedPropertyValuesToRids(rule.addInterfaceRule.sharedPropertyValues),\n structFieldValues: {},\n logicRuleRid: rule.addInterfaceRule.logicRuleRid\n }\n };\n } else if (rule.type === \"modifyInterfaceRule\") {\n const interfaceAndParents = flattenInterface(ontologyDefinition.INTERFACE_TYPE[rule.modifyInterfaceRule.interfaceApiName], new Set());\n return {\n type: \"modifyInterfaceRule\",\n modifyInterfaceRule: {\n interfaceObjectToModify: rule.modifyInterfaceRule.interfaceObjectToModifyParameter,\n interfacePropertyValues: convertInterfacePropertyValuesToRids(rule.modifyInterfaceRule.interfacePropertyValues, interfaceAndParents),\n sharedPropertyValues: convertSharedPropertyValuesToRids(rule.modifyInterfaceRule.sharedPropertyValues),\n structFieldValues: {}\n }\n };\n } else if (rule.type === \"addObjectRule\") {\n return {\n type: \"addObjectRule\",\n addObjectRule: {\n objectTypeId: ridGenerator.generateObjectTypeId(rule.addObjectRule.objectTypeId),\n propertyValues: rule.addObjectRule.propertyValues,\n structFieldValues: convertStructFieldValues(rule.addObjectRule.structFieldValues),\n logicRuleRid: rule.addObjectRule.logicRuleRid\n }\n };\n } else if (rule.type === \"addOrModifyObjectRuleV2\") {\n return {\n type: \"addOrModifyObjectRuleV2\",\n addOrModifyObjectRuleV2: {\n ...rule.addOrModifyObjectRuleV2,\n structFieldValues: convertStructFieldValues(rule.addOrModifyObjectRuleV2.structFieldValues)\n }\n };\n } else if (rule.type === \"modifyObjectRule\") {\n return {\n type: \"modifyObjectRule\",\n modifyObjectRule: {\n ...rule.modifyObjectRule,\n structFieldValues: convertStructFieldValues(rule.modifyObjectRule.structFieldValues)\n }\n };\n } else if (rule.type === \"addInterfaceLinkRuleV2\") {\n return {\n type: \"addInterfaceLinkRuleV2\",\n addInterfaceLinkRuleV2: {\n interfaceTypeRid: ridGenerator.generateRidForInterface(rule.addInterfaceLinkRuleV2.interfaceTypeRid),\n interfaceLinkTypeRid: ridGenerator.generateRidForInterfaceLinkType(rule.addInterfaceLinkRuleV2.interfaceLinkTypeRid, rule.addInterfaceLinkRuleV2.interfaceTypeRid),\n sourceObjects: rule.addInterfaceLinkRuleV2.sourceObjects,\n targetObjects: rule.addInterfaceLinkRuleV2.targetObjects\n }\n };\n } else if (rule.type === \"deleteInterfaceLinkRule\") {\n return {\n type: \"deleteInterfaceLinkRule\",\n deleteInterfaceLinkRule: {\n interfaceTypeRid: ridGenerator.generateRidForInterface(rule.deleteInterfaceLinkRule.interfaceTypeRid),\n interfaceLinkTypeRid: ridGenerator.generateRidForInterfaceLinkType(rule.deleteInterfaceLinkRule.interfaceLinkTypeRid, rule.deleteInterfaceLinkRule.interfaceTypeRid),\n sourceObject: rule.deleteInterfaceLinkRule.sourceObject,\n targetObject: rule.deleteInterfaceLinkRule.targetObject\n }\n };\n }\n // Pass through other rule types unchanged\n return rule;\n })\n },\n validation: actionValidation,\n notifications: []\n },\n metadata: buildActionMetadata(action, ridGenerator, parameterOrdering, actionParameters, actionSections)\n },\n parameterIds\n };\n}\nfunction convertFunctionBackedAction(actionInput, ridGenerator, functionsIr) {\n let action = actionInput;\n\n // The placeholder functionRid holds the function's API name\n const rule = action.rules[0];\n !(rule.type === \"functionRule\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Function-backed action must have a functionRule\") : invariant(false) : void 0;\n const functionName = rule.functionRule.functionRid;\n const discoveredFunction = functionsIr.discoveredFunctions.find(f => f.locator.typescript?.functionName === functionName);\n !(discoveredFunction != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Function \"${functionName}\" not found in functions IR`) : invariant(false) : void 0;\n const functionInputValues = {};\n const parameterOrdering = [];\n const syntheticParameters = [];\n for (const input of discoveredFunction.inputs) {\n if (input.dataType.type === \"ontologyEdit\" || input.dataType.type === \"client\") continue;\n const paramId = input.name;\n parameterOrdering.push(paramId);\n functionInputValues[paramId] = {\n type: \"parameterId\",\n parameterId: paramId\n };\n const paramType = dataTypeToActionParameterType(input.dataType);\n const listTypes = [...Object.values(PRIMITIVE_LIST_TYPES), \"objectReferenceList\", \"interfaceReferenceList\", \"structList\"];\n syntheticParameters.push({\n id: paramId,\n displayName: uppercaseFirstLetter(paramId),\n type: paramType,\n validation: {\n required: typeof paramType === \"object\" && listTypes.includes(paramType.type) ? {\n listLength: {}\n } : input.required,\n defaultVisibility: \"editable\",\n allowedValues: extractAllowedValuesFromActionParameterType(paramType)\n }\n });\n }\n action = {\n ...action,\n parameters: syntheticParameters,\n entities: {\n affectedObjectTypes: Object.keys(discoveredFunction.ontologyProvenance?.editedObjects ?? {}),\n affectedLinkTypes: [],\n affectedInterfaceTypes: Object.keys(discoveredFunction.ontologyProvenance?.editedInterfaces ?? {}),\n typeGroups: []\n }\n };\n const actionParameters = convertActionParameters(action, ridGenerator);\n const functionRid = `ri.function-registry.main.function.${functionName}`;\n return {\n actionType: {\n actionTypeLogic: {\n logic: {\n rules: [{\n type: \"functionRule\",\n functionRule: {\n functionRid,\n functionVersion: \"0.1.0\",\n functionInputValues,\n customExecutionMode: null,\n experimentalDeclarativeEditInformation: null\n }\n }],\n actionLogRule: null\n },\n validation: convertActionValidation(action, ridGenerator),\n revert: {\n enabledFor: [{\n type: \"actionApplier\",\n actionApplier: {\n withinDuration: {\n value: 24,\n unit: \"HOUR\"\n }\n }\n }]\n },\n webhooks: null,\n notifications: [],\n effects: null\n },\n metadata: buildActionMetadata(action, ridGenerator, parameterOrdering, actionParameters, {})\n },\n parameterIds: {}\n };\n}\nfunction dataTypeToActionParameterType(dataType) {\n switch (dataType.type) {\n case \"object\":\n {\n const objectData = dataType;\n return {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: objectData.object.objectTypeId,\n maybeCreateObjectOption: null\n }\n };\n }\n case \"objectSet\":\n {\n const objectSetData = dataType;\n return {\n type: \"objectSetRid\",\n objectSetRid: {\n objectTypeId: objectSetData.objectSet.objectTypeId\n }\n };\n }\n case \"interface\":\n {\n const interfaceData = dataType;\n return {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: interfaceData.interface.interfaceTypeRid\n }\n };\n }\n case \"interfaceObjectSet\":\n {\n const interfaceData = dataType;\n return {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: interfaceData.interfaceObjectSet.interfaceTypeRid\n }\n };\n }\n case \"list\":\n {\n const listData = dataType;\n return dataTypeToActionParameterListType(listData.list.elementsType);\n }\n case \"set\":\n {\n const setData = dataType;\n return dataTypeToActionParameterListType(setData.set.elementsType);\n }\n case \"optionalType\":\n {\n const optionalData = dataType;\n return dataTypeToActionParameterType(optionalData.optionalType.wrappedType);\n }\n default:\n {\n if (isActionParameterTypePrimitive(dataType.type)) {\n return dataType.type;\n }\n throw new Error(`Unsupported function input data type for action parameter: ${dataType.type}`);\n }\n }\n}\nconst PRIMITIVE_LIST_TYPES = {\n string: \"stringList\",\n boolean: \"booleanList\",\n integer: \"integerList\",\n long: \"longList\",\n double: \"doubleList\",\n date: \"dateList\",\n timestamp: \"timestampList\",\n attachment: \"attachmentList\",\n decimal: \"decimalList\",\n geoshape: \"geoshapeList\",\n mediaReference: \"mediaReferenceList\",\n marking: \"markingList\"\n};\nfunction dataTypeToActionParameterListType(elementType) {\n if (elementType.type === \"object\") {\n const objectData = elementType;\n return {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: objectData.object.objectTypeId\n }\n };\n }\n if (elementType.type === \"interface\") {\n const interfaceData = elementType;\n return {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: interfaceData.interface.interfaceTypeRid\n }\n };\n }\n const listType = PRIMITIVE_LIST_TYPES[elementType.type];\n if (listType != null) {\n return listType;\n }\n throw new Error(`Unsupported list element data type for action parameter: ${elementType.type}`);\n}\n\n/**\n * Build action type metadata with all fields that Java produces.\n * Uses an intermediate variable to allow extra fields beyond the TS type definition\n * (notificationSettings, applyingMessage) without casting to any.\n */\nfunction buildActionMetadata(action, ridGenerator, parameterOrdering, actionParameters, actionSections) {\n const displayMetadata = {\n configuration: {\n defaultLayout: action.defaultFormat ?? \"FORM\",\n displayAndFormat: action.displayAndFormat ?? {\n table: {\n columnWidthByParameterRid: {},\n enableFileImport: true,\n fitHorizontally: false,\n frozenColumnCount: 0,\n rowHeightInLines: 1\n }\n },\n enableLayoutUserSwitch: action.enableLayoutSwitch ?? false\n },\n description: action.description ?? \"\",\n displayName: action.displayName,\n icon: {\n type: \"blueprint\",\n blueprint: action.icon ?? {\n locator: \"edit\",\n color: \"#000000\"\n }\n },\n applyingMessage: [],\n successMessage: action.submissionMetadata?.successMessage ? [{\n type: \"message\",\n message: action.submissionMetadata.successMessage\n }] : [],\n typeClasses: action.typeClasses ?? [],\n ...(action.submissionMetadata?.submitButtonDisplayMetadata && {\n submitButtonDisplayMetadata: action.submissionMetadata.submitButtonDisplayMetadata\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration && {\n undoButtonConfiguration: action.submissionMetadata.undoButtonConfiguration\n })\n };\n const metadata = {\n rid: ridGenerator.generateRidForActionType(action.apiName),\n version: \"\",\n apiName: action.apiName,\n notificationSettings: {\n renderingSettings: {\n type: \"anyNotificationRenderingCanFail\",\n anyNotificationRenderingCanFail: {}\n },\n redactionOverride: null\n },\n displayMetadata,\n parameterOrdering,\n formContentOrdering: getFormContentOrdering(action, parameterOrdering),\n parameters: actionParameters,\n sections: actionSections,\n status: typeof action.status === \"string\" ? {\n type: action.status,\n [action.status]: {}\n } : action.status,\n entities: action.entities ? {\n // affectedInterfaceTypes may hold either API names (interface-link\n // actions) or already-resolved RIDs (function-backed actions)\n affectedInterfaceTypes: action.entities.affectedInterfaceTypes.map(apiNameOrRid => resolveInterfaceTypeRid(apiNameOrRid, ridGenerator)),\n affectedLinkTypes: action.entities.affectedLinkTypes,\n affectedObjectTypes: action.entities.affectedObjectTypes.map(apiName => ridGenerator.generateObjectTypeId(apiName)),\n typeGroups: action.entities.typeGroups\n } : {\n affectedInterfaceTypes: [],\n affectedLinkTypes: [],\n affectedObjectTypes: [],\n typeGroups: []\n }\n };\n return metadata;\n}\n\n// Helper function to convert allowed value option values with ObjectTypeId conversion\nfunction convertAllowedValueOptionValue(value, ridGenerator) {\n if (value?.type === \"objectType\") {\n return {\n type: \"objectType\",\n objectType: {\n objectTypeId: ridGenerator.generateObjectTypeId(value.objectType.objectTypeId)\n }\n };\n }\n // Pass through other value types unchanged (staticValue, parameterValue, etc.)\n return value;\n}\nexport function extractAllowedValues(allowedValues, ridGenerator) {\n switch (allowedValues.type) {\n case \"struct\":\n return {\n type: \"struct\",\n struct: {\n type: \"delegateToAllowedStructFieldValues\",\n delegateToAllowedStructFieldValues: {}\n }\n };\n case \"oneOf\":\n return {\n type: \"oneOf\",\n oneOf: {\n type: \"oneOf\",\n oneOf: {\n labelledValues: allowedValues.oneOf.map(option => ({\n ...option,\n value: convertAllowedValueOptionValue(option.value, ridGenerator)\n })),\n otherValueAllowed: {\n allowed: allowedValues.otherValueAllowed ?? false\n }\n }\n }\n };\n case \"range\":\n const {\n min,\n max\n } = allowedValues;\n return {\n type: \"range\",\n range: {\n type: \"range\",\n range: {\n ...(min === undefined ? {} : {\n minimum: {\n inclusive: true,\n value: min\n }\n }),\n ...(max === undefined ? {} : {\n maximum: {\n inclusive: true,\n value: max\n }\n })\n }\n }\n };\n case \"text\":\n const {\n minLength,\n maxLength,\n regex\n } = allowedValues;\n return {\n type: \"text\",\n text: {\n type: \"text\",\n text: {\n ...(minLength === undefined ? {} : {\n minLength\n }),\n ...(maxLength === undefined ? {} : {\n maxLength\n }),\n ...(regex === undefined ? {} : {\n regex: {\n regex,\n failureMessage: \"Invalid input\"\n }\n })\n }\n }\n };\n case \"datetime\":\n const {\n minimum,\n maximum\n } = allowedValues;\n return {\n type: \"datetime\",\n datetime: {\n type: \"datetime\",\n datetime: {\n minimum,\n maximum\n }\n }\n };\n case \"objectTypeReference\":\n return {\n type: \"objectTypeReference\",\n objectTypeReference: {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: allowedValues.interfaceTypes.map(apiName => ridGenerator.generateRidForInterface(apiName))\n }\n }\n };\n case \"redacted\":\n return {\n type: \"redacted\",\n redacted: {}\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {\n type: \"geotimeSeries\",\n geotimeSeries: {}\n }\n };\n case \"user\":\n return {\n type: \"user\",\n user: {\n type: \"user\",\n user: {\n filter: (allowedValues.fromGroups ?? []).map(group => {\n // Register static group IDs with ridGenerator\n if (group.type === \"static\") {\n ridGenerator.getGroupIds().put(ReadableIdGenerator.getForGroup(group.name), group.name);\n }\n return {\n type: \"groupFilter\",\n groupFilter: {\n groupId: group.type === \"static\" ? {\n type: \"staticValue\",\n staticValue: {\n type: \"string\",\n string: group.name\n }\n } : {\n type: \"parameterId\",\n parameterId: group.parameter\n }\n }\n };\n })\n }\n }\n };\n case \"multipassGroup\":\n return {\n type: \"multipassGroup\",\n multipassGroup: {\n type: \"group\",\n group: {}\n }\n };\n default:\n const k = allowedValues.type;\n return {\n type: k,\n [k]: {\n type: k,\n [k]: {}\n }\n };\n }\n}\nexport function renderHintFromBaseType(parameter, validation) {\n return renderHintFromActionParameterType(parameter.type, validation?.allowedValues ?? parameter.validation.allowedValues, parameter.displayName);\n}\nexport function renderHintFromActionParameterType(parameterType, allowedValues, displayName) {\n const type = typeof parameterType === \"string\" ? parameterType : parameterType.type;\n switch (type) {\n case \"boolean\":\n case \"booleanList\":\n return {\n type: \"checkbox\",\n checkbox: {}\n };\n case \"integer\":\n case \"integerList\":\n case \"long\":\n case \"longList\":\n case \"double\":\n case \"doubleList\":\n case \"decimal\":\n case \"decimalList\":\n return {\n type: \"numericInput\",\n numericInput: {}\n };\n case \"string\":\n if (allowedValues?.type === \"user\" || allowedValues?.type === \"multipassGroup\") {\n return {\n type: \"userDropdown\",\n userDropdown: {}\n };\n }\n case \"stringList\":\n case \"geohash\":\n case \"geohashList\":\n case \"geoshape\":\n case \"geoshapeList\":\n case \"objectSetRid\":\n return {\n type: \"textInput\",\n textInput: {}\n };\n case \"timestamp\":\n case \"timestampList\":\n case \"date\":\n case \"dateList\":\n return {\n type: \"dateTimePicker\",\n dateTimePicker: {}\n };\n case \"attachment\":\n case \"attachmentList\":\n return {\n type: \"filePicker\",\n filePicker: {}\n };\n case \"marking\":\n case \"markingList\":\n if (allowedValues?.type === \"mandatoryMarking\") {\n return {\n type: \"mandatoryMarkingPicker\",\n mandatoryMarkingPicker: {}\n };\n } else if (allowedValues?.type === \"cbacMarking\") {\n return {\n type: \"cbacMarkingPicker\",\n cbacMarkingPicker: {}\n };\n } else {\n throw new Error(`The allowed values for \"${displayName}\" are not compatible with the base parameter type`);\n }\n case \"timeSeriesReference\":\n case \"objectReference\":\n case \"objectReferenceList\":\n case \"interfaceReference\":\n case \"interfaceReferenceList\":\n case \"objectTypeReference\":\n case \"mediaReference\":\n case \"mediaReferenceList\":\n case \"geotimeSeriesReference\":\n case \"geotimeSeriesReferenceList\":\n return {\n type: \"dropdown\",\n dropdown: {}\n };\n case \"struct\":\n case \"structList\":\n return {\n type: \"textInput\",\n textInput: {}\n };\n default:\n throw new Error(`Unknown type ${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 { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertSpt({\n type,\n array,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n aliases,\n valueType,\n nullability,\n baseFormatter\n}, ridGenerator) {\n const dataConstraint = convertNullabilityToDataConstraint({\n type,\n nullability\n });\n return {\n apiName,\n // TODO: Generate proper RID based on apiName\n rid: ridGenerator.generateSptRid(apiName),\n displayMetadata: {\n displayName: displayName ?? apiName,\n visibility: visibility ?? \"NORMAL\",\n description\n },\n type: array ? {\n type: \"array\",\n array: {\n subtype: propertyTypeTypeToOntologyIrType(type, ridGenerator, apiName),\n reducers: []\n }\n } : propertyTypeTypeToOntologyIrType(type, ridGenerator, apiName),\n aliases: aliases ?? [],\n baseFormatter,\n dataConstraints: dataConstraint,\n gothamMapping,\n indexedForSearch: true,\n typeClasses: typeClasses ?? [],\n valueType: valueType === undefined ? undefined : ridGenerator.generateRidForValueType(valueType.apiName, valueType.version)\n };\n}","/*\n * Copyright 2026 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 { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\nexport function propertyTypeTypeToOntologyIrInterfaceType(type, propertyApiName, ridGenerator) {\n switch (true) {\n case typeof type === \"object\" && type.type === \"marking\":\n return {\n type: \"marking\",\n marking: {\n markingType: type.markingType\n }\n };\n case typeof type === \"object\" && type.type === \"struct\":\n const structFields = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n structFieldRid: ridGenerator.generateStructFieldRid(propertyApiName, key),\n apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition, propertyApiName, ridGenerator),\n requireImplementation: true\n };\n } else {\n // If it is a full form type definition then process it as such\n if (typeof fieldTypeDefinition === \"object\" && \"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n apiName: key,\n structFieldRid: ridGenerator.generateStructFieldRid(propertyApiName, key),\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition.fieldType, propertyApiName, ridGenerator),\n displayMetadata: fieldTypeDefinition.displayMetadata ?? {\n displayName: key,\n description: undefined\n },\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? [],\n requireImplementation: fieldTypeDefinition.requireImplementation ?? true\n };\n } else {\n field = {\n apiName: key,\n structFieldRid: ridGenerator.generateStructFieldRid(propertyApiName, key),\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition, propertyApiName, ridGenerator),\n requireImplementation: true\n };\n }\n }\n structFields.push(field);\n }\n return {\n type: \"struct\",\n struct: {\n structFields\n }\n };\n case typeof type === \"object\" && type.type === \"string\":\n return {\n type: \"string\",\n string: {\n analyzerOverride: type.analyzerOverride,\n enableAsciiFolding: type.enableAsciiFolding,\n isLongText: type.isLongText ?? false,\n supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard ?? false,\n supportsExactMatching: type.supportsExactMatching ?? true,\n supportsFullTextRegex: type.supportsFullTextRegex\n }\n };\n case typeof type === \"object\" && type.type === \"decimal\":\n return {\n type: \"decimal\",\n decimal: {\n precision: type.precision,\n scale: type.scale\n }\n };\n case type === \"geopoint\":\n return {\n type: \"geohash\",\n geohash: {}\n };\n case type === \"decimal\":\n return {\n type,\n [type]: {\n precision: undefined,\n scale: undefined\n }\n };\n case type === \"string\":\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsEfficientLeadingWildcard: false,\n supportsExactMatching: true\n }\n };\n case type === \"mediaReference\":\n return {\n type,\n mediaReference: {}\n };\n case type === \"geotimeSeries\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {}\n };\n default:\n // use helper function to distribute `type` properly\n if (typeof type === \"object\") {\n throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);\n }\n return distributeTypeHelper(type);\n }\n}","/*\n * Copyright 2026 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 { isInterfaceSharedPropertyType } from \"@osdk/maker\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nimport { propertyTypeTypeToOntologyIrInterfaceType } from \"./propertyTypeTypeToOntologyIrInterfaceType.js\";\nexport function convertInterfaceProperty(prop, apiName, interfaceApiName, ridGenerator) {\n if (isInterfaceSharedPropertyType(prop)) {\n const convertedSpt = convertSpt(prop.sharedPropertyType, ridGenerator);\n return [ridGenerator.generateIptRidFromSptRid(convertedSpt.rid), {\n type: \"sharedPropertyBasedPropertyType\",\n sharedPropertyBasedPropertyType: {\n requireImplementation: prop.required,\n sharedPropertyType: convertedSpt\n }\n }];\n } else {\n return [ridGenerator.generateInterfacePropertyTypeRid(apiName, interfaceApiName), {\n type: \"interfaceDefinedPropertyType\",\n interfaceDefinedPropertyType: {\n apiName,\n displayMetadata: {\n displayName: prop.displayName ?? apiName,\n visibility: prop.visibility ?? \"NORMAL\",\n description: prop.description\n },\n type: prop.array ? {\n type: \"array\",\n array: {\n subtype: propertyTypeTypeToOntologyIrInterfaceType(prop.type, apiName, ridGenerator)\n }\n } : propertyTypeTypeToOntologyIrInterfaceType(prop.type, apiName, ridGenerator),\n constraints: {\n primaryKeyConstraint: prop.primaryKeyConstraint ?? \"NO_RESTRICTION\",\n requireImplementation: prop.required ?? true,\n indexedForSearch: true,\n typeClasses: prop.typeClasses ?? [],\n dataConstraints: convertNullabilityToDataConstraint({\n type: prop.type,\n nullability: prop.nullability\n }),\n valueType: prop.valueType ? ridGenerator.generateRidForValueType(prop.valueType.apiName, prop.valueType.version) : undefined\n },\n rid: ridGenerator.generateInterfacePropertyTypeRid(apiName, interfaceApiName)\n }\n }];\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 { convertInterfaceProperty } from \"./convertInterfacePropertyType.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nexport function convertInterface(interfaceType, ridGenerator) {\n const {\n __type,\n status,\n linkedInterfaces: _linkedInterfaces,\n ...other\n } = interfaceType;\n // Normalize deprecated deadline format to match Java (strip .000 milliseconds)\n const normalizedStatus = status?.type === \"deprecated\" ? {\n ...status,\n deprecated: {\n ...status.deprecated,\n deadline: status.deprecated.deadline?.replace(/\\.000Z$/u, \"Z\")\n }\n } : status;\n return {\n ...other,\n status: normalizedStatus,\n // TODO: Generate proper RID based on apiName\n rid: ridGenerator.generateRidForInterface(interfaceType.apiName),\n propertiesV2: Object.fromEntries(Object.values(interfaceType.propertiesV2).map(spt => {\n const convertedSpt = convertSpt(spt.sharedPropertyType, ridGenerator);\n return [convertedSpt.rid, {\n required: spt.required,\n sharedPropertyType: convertedSpt\n }];\n })),\n displayMetadata: {\n displayName: interfaceType.displayMetadata.displayName,\n description: interfaceType.displayMetadata.description,\n icon: interfaceType.displayMetadata.icon ?? {\n type: \"blueprint\",\n blueprint: {\n color: \"#4C90F0\",\n locator: \"layout-hierarchy\"\n }\n }\n },\n // TODO: Convert extendsInterfaces from API names to RIDs\n extendsInterfaces: interfaceType.extendsInterfaces.map(i => ridGenerator.generateRidForInterface(i.apiName)),\n // TODO: Convert links to add RIDs\n links: interfaceType.links.map(link => ({\n ...link,\n linkedEntityTypeId: link.linkedEntityTypeId.type === \"interfaceType\" ? {\n type: \"interfaceType\",\n interfaceType: ridGenerator.generateRidForInterface(link.linkedEntityTypeId.interfaceType)\n } : {\n type: \"objectType\",\n objectType: ridGenerator.generateObjectTypeId(link.linkedEntityTypeId.objectType)\n },\n rid: ridGenerator.generateRidForInterfaceLinkType(link.metadata.apiName, interfaceType.apiName)\n })),\n actionTypeConstraints: (interfaceType.actionTypeConstraints ?? []).map(constraint => ({\n ...constraint,\n rid: ridGenerator.generateRidForInterfaceActionTypeConstraint(constraint.metadata.apiName, interfaceType.apiName),\n parameters: Object.fromEntries(Object.entries(constraint.parameters ?? {}).map(([paramApiName, paramConstraint]) => {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName;\n return [ridGenerator.generateRidForInterfaceParameterConstraint(constraint.metadata.apiName, interfaceType.apiName, paramDisplayApiName), paramConstraint];\n }))\n })),\n // these are omitted from our internal types but we need to re-add them for the final json\n properties: [],\n propertiesV3: Object.fromEntries(Object.entries(interfaceType.propertiesV3).map(([apiName, prop]) => convertInterfaceProperty(prop, apiName, interfaceType.apiName, ridGenerator)))\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\nexport function convertCardinality(cardinality) {\n if (cardinality === \"OneToMany\" || cardinality === undefined) {\n return \"ONE_TO_MANY\";\n }\n return \"ONE_TO_ONE\";\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 { cleanAndValidateLinkTypeId, getImportedTypes, getOntologyDefinition, OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport invariant from \"tiny-invariant\";\nimport { convertCardinality } from \"./convertCardinality.js\";\nexport function convertLink(linkType, ridGenerator) {\n validateLink(linkType);\n let definition;\n let datasource;\n if (\"one\" in linkType) {\n const {\n apiName: oneObjectApiName,\n object: oneObject\n } = getObject(linkType.one.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkType.toMany.object);\n const oneObjectRid = ridGenerator.generateRidForObjectType(oneObjectApiName);\n const toManyObjectRid = ridGenerator.generateRidForObjectType(toManyObjectApiName);\n const onePkRid = ridGenerator.generatePropertyRid(oneObject.primaryKeyPropertyApiName, oneObjectApiName);\n const manyFkRid = ridGenerator.generatePropertyRid(linkType.manyForeignKeyProperty, toManyObjectApiName);\n definition = {\n type: \"oneToMany\",\n oneToMany: {\n cardinalityHint: convertCardinality(linkType.cardinality),\n manyToOneLinkMetadata: linkType.toMany.metadata,\n objectTypeRidManySide: toManyObjectRid,\n objectTypeRidOneSide: oneObjectRid,\n oneToManyLinkMetadata: linkType.one.metadata,\n // TODO: Convert property mappings to use RIDs as keys and values\n oneSidePrimaryKeyToManySidePropertyMapping: {\n [onePkRid]: manyFkRid\n }\n }\n };\n } else if (\"intermediaryObjectType\" in linkType) {\n const {\n apiName: manyObjectApiName,\n object: manyObject\n } = getObject(linkType.many.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkType.toMany.object);\n const {\n apiName: intermediaryObjectApiName\n } = getObject(linkType.intermediaryObjectType);\n definition = {\n type: \"intermediary\",\n intermediary: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: ridGenerator.generateRidForObjectType(manyObjectApiName),\n objectTypeRidB: ridGenerator.generateRidForObjectType(toManyObjectApiName),\n intermediaryObjectTypeRid: ridGenerator.generateRidForObjectType(intermediaryObjectApiName),\n aToIntermediaryLinkTypeRid: ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(linkType.many.linkToIntermediary.apiName)),\n intermediaryToBLinkTypeRid: ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(linkType.toMany.linkToIntermediary.apiName))\n }\n };\n } else {\n const {\n apiName: manyObjectApiName,\n object: manyObject\n } = getObject(linkType.many.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkType.toMany.object);\n const manyObjectRidA = ridGenerator.generateRidForObjectType(manyObjectApiName);\n const manyObjectRidB = ridGenerator.generateRidForObjectType(toManyObjectApiName);\n const manyPkRidA = ridGenerator.generatePropertyRid(manyObject.primaryKeyPropertyApiName, manyObjectApiName);\n const manyPkRidB = ridGenerator.generatePropertyRid(toManyObject.primaryKeyPropertyApiName, toManyObjectApiName);\n const columnA = manyObject.primaryKeyPropertyApiName;\n const columnB = toManyObject.primaryKeyPropertyApiName;\n const hasCollision = columnA === columnB;\n const resolvedColumnA = hasCollision ? `${columnA}_from` : columnA;\n const resolvedColumnB = hasCollision ? `${columnB}_to` : columnB;\n definition = {\n type: \"manyToMany\",\n manyToMany: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectRidA,\n objectTypeRidB: manyObjectRidB,\n peeringMetadata: undefined,\n // TODO: Convert property mappings to use RIDs as keys and values\n objectTypeAPrimaryKeyPropertyMapping: {\n [manyPkRidA]: manyPkRidA\n },\n objectTypeBPrimaryKeyPropertyMapping: {\n [manyPkRidB]: manyPkRidB\n }\n }\n };\n const datasetLocator = ridGenerator.generateDatasetLocator(`link.${linkType.apiName}`, new Set([resolvedColumnA, resolvedColumnB]));\n datasource = {\n rid: ridGenerator.generateDatasourceRid(linkType.apiName),\n datasource: {\n type: \"dataset\",\n dataset: {\n // TODO: Add proper branchId from link configuration\n branchId: datasetLocator.branchId,\n datasetRid: datasetLocator.rid,\n writebackDatasetRid: undefined,\n // TODO: Convert property mappings to use property RIDs as keys\n objectTypeAPrimaryKeyMapping: {\n [manyPkRidA]: resolvedColumnA\n },\n objectTypeBPrimaryKeyMapping: {\n [manyPkRidB]: resolvedColumnB\n }\n }\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: linkType.redacted\n };\n }\n const linkTypeId = cleanAndValidateLinkTypeId(linkType.apiName);\n return {\n linkType: {\n definition,\n ...(linkType.description !== undefined && {\n description: linkType.description\n }),\n rid: ridGenerator.generateRidForLinkType(linkTypeId),\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: convertLinkStatus(linkType.status, ridGenerator),\n redacted: linkType.redacted ?? false\n },\n datasources: datasource !== undefined ? [datasource] : [],\n entityMetadata: {\n arePatchesEnabled: linkType.editsEnabled ?? false,\n entityConfig: {\n objectDbTypeConfigs: {\n highbury: {\n objectDbConfigs: {\n \"ri.highbury.main.cluster.1\": {\n configValue: \"{}\"\n }\n }\n }\n }\n },\n targetStorageBackend: {\n type: \"objectStorageV2\",\n objectStorageV2: {}\n }\n }\n };\n}\nfunction validateLink(linkDefinition) {\n if (\"one\" in linkDefinition) {\n const {\n apiName: oneObjectApiName,\n object: oneObject\n } = getObject(linkDefinition.one.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkDefinition.toMany.object);\n const foreignKey = toManyObject.properties?.find(p => p.apiName === linkDefinition.manyForeignKeyProperty);\n !(foreignKey !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Foreign key ${linkDefinition.manyForeignKeyProperty} on link ${linkDefinition.apiName} does not exist on object ${toManyObjectApiName}`) : invariant(false) : void 0;\n !/([a-z][a-z0-9\\\\-]*)/u.test(linkDefinition.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Top level link api names are expected to match the regex pattern ([a-z][a-z0-9\\\\-]*) ${linkDefinition.apiName} does not match`) : invariant(false) : void 0;\n const typesMatch = foreignKey.type === oneObject.properties?.find(p => p.apiName === oneObject.primaryKeyPropertyApiName)?.type;\n !typesMatch ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Link ${linkDefinition.apiName} has type mismatch between the one side's primary key and the foreign key on the many side`) : invariant(false) : void 0;\n }\n if (\"intermediaryObjectType\" in linkDefinition) {\n const {\n apiName: intermediaryObjectTypeApiName,\n object: intermediaryObjectType\n } = getObject(linkDefinition.intermediaryObjectType);\n const {\n apiName: manyObjectApiName,\n object: manyObject\n } = getObject(linkDefinition.many.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkDefinition.toMany.object);\n const {\n apiName: manyIntermediaryOneObjectApiName,\n object: manyIntermediaryOneObject\n } = getObject(linkDefinition.many.linkToIntermediary.one.object);\n const {\n apiName: manyIntermediaryToManyObjectApiName,\n object: manyIntermediaryToManyObject\n } = getObject(linkDefinition.many.linkToIntermediary.toMany.object);\n !(\"one\" in linkDefinition.many.linkToIntermediary && manyIntermediaryOneObjectApiName === manyObject.apiName && manyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `LinkTypeA ${linkDefinition.many.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectA ${manyObjectApiName}`) : invariant(false) : void 0;\n const {\n apiName: toManyIntermediaryOneObjectApiName,\n object: toManyIntermediaryOneObject\n } = getObject(linkDefinition.toMany.linkToIntermediary.one.object);\n const {\n apiName: toManyIntermediaryToManyObjectApiName,\n object: toManyIntermediaryToManyObject\n } = getObject(linkDefinition.toMany.linkToIntermediary.toMany.object);\n !(\"one\" in linkDefinition.toMany.linkToIntermediary && toManyIntermediaryOneObjectApiName === toManyObjectApiName && toManyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `LinkTypeB ${linkDefinition.toMany.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectB ${toManyObjectApiName}`) : invariant(false) : void 0;\n }\n}\nexport function getObject(object) {\n const objectApiName = typeof object === \"string\" ? object : object.apiName;\n const fullObject = getOntologyDefinition()[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName] ?? getImportedTypes()[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName];\n !(fullObject !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object ${objectApiName} is not defined`) : invariant(false) : void 0;\n return {\n apiName: objectApiName,\n object: fullObject\n };\n}\nexport function convertLinkStatus(status, ridGenerator) {\n if (typeof status === \"object\" && \"type\" in status && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: status.replacedBy ? ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(status.replacedBy)) : undefined\n }\n };\n }\n switch (status) {\n case \"experimental\":\n return {\n type: \"experimental\",\n experimental: {}\n };\n case \"example\":\n return {\n type: \"example\",\n example: {}\n };\n case \"active\":\n default:\n return {\n type: \"active\",\n active: {}\n };\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\nconst VOID = {};\nconst DEFAULT_DECIMAL_PRECISION = 38;\nconst DEFAULT_DECIMAL_SCALE = 0;\n\n/**\n * Convert Type to ObjectPropertyType for marketplace shapes\n * TypeScript port of TypeToMarketplaceShapeObjectPropertyTypeVisitor\n */\nexport function typeToMarketplaceObjectPropertyType(type) {\n switch (type.type) {\n case \"array\":\n const arraySubtype = typeToMarketplaceObjectPropertyType(type.array.subtype);\n if (arraySubtype.type === \"array\") {\n throw new Error(\"Nested array property types are not supported in marketplace\");\n }\n if (arraySubtype.type !== \"primitive\") {\n throw new Error(\"Array subtype must be primitive\");\n }\n return {\n type: \"array\",\n array: {\n elementType: arraySubtype.primitive\n }\n };\n case \"boolean\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"booleanType\",\n booleanType: VOID\n }\n };\n case \"byte\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"byteType\",\n byteType: VOID\n }\n };\n case \"date\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"dateType\",\n dateType: VOID\n }\n };\n case \"decimal\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"decimalType\",\n decimalType: VOID\n }\n };\n case \"double\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"doubleType\",\n doubleType: VOID\n }\n };\n case \"float\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"floatType\",\n floatType: VOID\n }\n };\n case \"geohash\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"geohashType\",\n geohashType: VOID\n }\n };\n case \"geoshape\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"geoshapeType\",\n geoshapeType: VOID\n }\n };\n case \"integer\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"integerType\",\n integerType: VOID\n }\n };\n case \"long\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"longType\",\n longType: VOID\n }\n };\n case \"short\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"shortType\",\n shortType: VOID\n }\n };\n case \"string\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"stringType\",\n stringType: VOID\n }\n };\n case \"experimentalTimeDependentV1\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"timeDependentType\",\n timeDependentType: VOID\n }\n };\n case \"timestamp\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"timestampType\",\n timestampType: VOID\n }\n };\n case \"attachment\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"attachmentType\",\n attachmentType: VOID\n }\n };\n case \"marking\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"markingType\",\n markingType: VOID\n }\n };\n case \"cipherText\":\n {\n const plainTextType = typeToMarketplaceObjectPropertyType(type.cipherText.plainTextType);\n if (plainTextType.type === \"array\") {\n throw new Error(\"Nested array property types are not supported in marketplace\");\n }\n if (plainTextType.type !== \"primitive\") {\n throw new Error(\"CipherText plaintext type must be primitive\");\n }\n return {\n type: \"primitive\",\n primitive: {\n type: \"cipherTextType\",\n cipherTextType: {\n plainTextType: plainTextType.primitive\n }\n }\n };\n }\n case \"mediaReference\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"mediaReferenceType\",\n mediaReferenceType: VOID\n }\n };\n case \"vector\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"vectorType\",\n vectorType: {\n dimension: type.vector.dimension,\n supportsSearchWith: type.vector.supportsSearchWith?.map(fn => {\n switch (fn) {\n case \"COSINE_SIMILARITY\":\n return \"COSINE_SIMILARITY\";\n case \"DOT_PRODUCT\":\n return \"DOT_PRODUCT\";\n case \"EUCLIDEAN_DISTANCE\":\n return \"EUCLIDEAN_DISTANCE\";\n default:\n throw new Error(`Unknown vector similarity function: ${fn}`);\n }\n }) ?? []\n }\n }\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"geotimeSeriesReferenceType\",\n geotimeSeriesReferenceType: VOID\n }\n };\n case \"struct\":\n {\n const structFieldTypes = type.struct.structFields.map(field => typeToMarketplaceObjectPropertyType(field.fieldType));\n return {\n type: \"primitive\",\n primitive: {\n type: \"structType\",\n structType: {\n structFieldTypes\n }\n }\n };\n }\n default:\n throw new Error(`Unknown property type: ${type.type}`);\n }\n}\n\n/**\n * Convert Type to ConcreteDataType for datasource columns\n * TypeScript port of TypeToConcreteDataTypeVisitor\n */\nexport function typeToConcreteDataType(type) {\n switch (type.type) {\n case \"array\":\n {\n const elementType = typeToConcreteDataType(type.array.subtype);\n return {\n type: \"array\",\n array: {\n elementType\n }\n };\n }\n case \"boolean\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"boolean\",\n boolean: VOID\n }\n };\n case \"byte\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"byte\",\n byte: VOID\n }\n };\n case \"date\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"date\",\n date: VOID\n }\n };\n case \"decimal\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"decimal\",\n decimal: {\n precision: type.decimal.precision ?? DEFAULT_DECIMAL_PRECISION,\n scale: type.decimal.scale ?? DEFAULT_DECIMAL_SCALE\n }\n }\n };\n case \"double\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"double\",\n double: VOID\n }\n };\n case \"float\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"float\",\n float: VOID\n }\n };\n case \"geohash\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"geoshape\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"integer\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"integer\",\n integer: VOID\n }\n };\n case \"long\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"long\",\n long: VOID\n }\n };\n case \"short\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"short\",\n short: VOID\n }\n };\n case \"string\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"experimentalTimeDependentV1\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"timestamp\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"timestamp\",\n timestamp: VOID\n }\n };\n case \"attachment\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"marking\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"cipherText\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"mediaReference\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"vector\":\n {\n const floatType = {\n type: \"primitive\",\n primitive: {\n type: \"float\",\n float: VOID\n }\n };\n return {\n type: \"array\",\n array: {\n elementType: floatType\n }\n };\n }\n case \"geotimeSeriesReference\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"struct\":\n {\n const fields = type.struct.structFields.map(field => ({\n name: field.apiName,\n type: typeToConcreteDataType(field.fieldType)\n }));\n return {\n type: \"struct\",\n struct: {\n fields\n }\n };\n }\n default:\n throw new Error(`Unknown property type: ${type.type}`);\n }\n}\n\n/**\n * Convert Type to BaseType for value type input shapes\n * TypeScript port of TypeToMarketplaceShapeBaseTypeVisitor\n */\nexport function typeToMarketplaceBaseType(type) {\n switch (type.type) {\n case \"array\":\n {\n const arr = type.array;\n const subItem = \"subtype\" in arr ? arr.subtype : arr.elementType;\n const itemBaseType = typeToMarketplaceBaseType(subItem);\n if (itemBaseType.type === \"array\") {\n throw new Error(\"Nested array property types are not supported in marketplace\");\n }\n if (itemBaseType.type === \"structV2\") {\n throw new Error(\"Invalid base type: array of struct\");\n }\n if (itemBaseType.type !== \"primitive\") {\n throw new Error(\"Array item must be primitive base type\");\n }\n return {\n type: \"array\",\n array: {\n elementType: itemBaseType.primitive\n }\n };\n }\n case \"binary\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"binary\",\n binary: VOID\n }\n };\n case \"boolean\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"boolean\",\n boolean: VOID\n }\n };\n case \"byte\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"byte\",\n byte: VOID\n }\n };\n case \"date\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"date\",\n date: VOID\n }\n };\n case \"decimal\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"decimal\",\n decimal: VOID\n }\n };\n case \"double\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"double\",\n double: VOID\n }\n };\n case \"float\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"float\",\n float: VOID\n }\n };\n case \"geohash\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"geoshape\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"integer\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"integer\",\n integer: VOID\n }\n };\n case \"long\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"long\",\n long: VOID\n }\n };\n case \"map\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"map\",\n map: VOID\n }\n };\n case \"optional\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"optional\",\n optional: VOID\n }\n };\n case \"short\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"short\",\n short: VOID\n }\n };\n case \"string\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"experimentalTimeDependentV1\":\n throw new Error(\"Unsupported type: timeDependent\");\n case \"timestamp\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"timestamp\",\n timestamp: VOID\n }\n };\n case \"attachment\":\n throw new Error(\"Unsupported type: attachment\");\n case \"marking\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"cipherText\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"mediaReference\":\n throw new Error(\"Unsupported type: mediaReference\");\n case \"vector\":\n throw new Error(\"Unsupported type: vector\");\n case \"geotimeSeriesReference\":\n throw new Error(\"Unsupported type: geotimeSeriesReference\");\n case \"struct\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"struct\",\n struct: VOID\n }\n };\n case \"structV2\":\n {\n const sv2 = type;\n return {\n type: \"structV2\",\n structV2: {\n structFieldTypes: sv2.structV2.fields.map(field => typeToMarketplaceBaseType(field.baseType))\n }\n };\n }\n case \"referenced\":\n throw new Error(\"Referenced types are not supported in marketplace\");\n case \"union\":\n throw new Error(\"Union types are not supported in marketplace\");\n default:\n throw new Error(`Unknown property type: ${type.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\n/**\n * Helper to create LocalizedTitleAndDescription with empty localizations\n */\nfunction createLocalizedAbout(fallbackTitle, fallbackDescription = \"\") {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {}\n };\n}\n\n/**\n * TypeScript port of Java's LinkTypeShapeExtractor class\n */\nexport class LinkTypeShapeExtractor {\n /**\n * Extract shapes from a LinkType\n */\n extract(linkReadableId, link, ridGenerator) {\n const editsEnabled = link.entityMetadata?.arePatchesEnabled ?? false;\n const definition = link.linkType.definition;\n switch (definition.type) {\n case \"intermediary\":\n return this.extractIntermediary(linkReadableId, definition.intermediary, ridGenerator);\n case \"manyToMany\":\n return this.extractManyToMany(linkReadableId, definition.manyToMany, ridGenerator, link.datasources, editsEnabled);\n case \"oneToMany\":\n return this.extractOneToMany(linkReadableId, definition.oneToMany, ridGenerator);\n default:\n throw new Error(`Unknown link definition type: ${definition.type}`);\n }\n }\n\n /**\n * Extract one-to-many link shape\n */\n extractOneToMany(linkReadableId, linkDefinition, ridGenerator) {\n const outputShape = {\n about: createLocalizedAbout(linkDefinition.oneToManyLinkMetadata.displayMetadata.displayName),\n objectTypeShapeIdOneSide: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidOneSide),\n objectTypeShapeIdManySide: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidManySide),\n manyToOneLinkMetadata: createLocalizedAbout(linkDefinition.manyToOneLinkMetadata.displayMetadata.displayName),\n oneToManyLinkMetadata: createLocalizedAbout(linkDefinition.oneToManyLinkMetadata.displayMetadata.displayName),\n cardinalityHint: linkDefinition.cardinalityHint === \"ONE_TO_ONE\" ? \"ONE_TO_ONE\" : \"ONE_TO_MANY\"\n };\n return {\n inputShapes: new Map(),\n outputShapes: new Map([[linkReadableId, {\n type: \"linkType\",\n linkType: {\n type: \"oneToMany\",\n oneToMany: outputShape\n }\n }]]),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n }\n\n /**\n * Extract many-to-many link shape\n */\n extractManyToMany(linkReadableId, linkDefinition, ridGenerator, dataSources, editsEnabled) {\n const linkTypeName = linkDefinition.objectTypeAToBLinkMetadata.displayMetadata.displayName;\n const outputShape = {\n about: createLocalizedAbout(linkTypeName),\n objectTypeAToBLinkMetadata: createLocalizedAbout(linkDefinition.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeBToALinkMetadata: createLocalizedAbout(linkDefinition.objectTypeBToALinkMetadata.displayMetadata.displayName),\n objectTypeShapeIdA: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidA),\n objectTypeShapeIdB: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidB),\n editsSupport: editsEnabled ? \"EDITS_ENABLED\" : \"EDITS_DISABLED\",\n objectsBackendVersion: \"V2\"\n };\n const datasetShapes = new Map();\n for (const datasource of dataSources) {\n const datasourceDefinition = datasource.datasource;\n let datasourceLocator;\n let columns;\n let datasourceType;\n if (datasourceDefinition.type === \"dataset\") {\n datasourceLocator = {\n type: \"dataset\",\n dataset: {\n rid: datasourceDefinition.dataset.datasetRid,\n branch: datasourceDefinition.dataset.branchId\n }\n };\n columns = new Set([...Object.values(datasourceDefinition.dataset.objectTypeAPrimaryKeyMapping).map(String), ...Object.values(datasourceDefinition.dataset.objectTypeBPrimaryKeyMapping).map(String)]);\n datasourceType = \"DATASET\";\n } else if (datasourceDefinition.type === \"stream\") {\n datasourceLocator = {\n type: \"stream\",\n stream: {\n rid: datasourceDefinition.stream.streamLocator.streamLocatorRid,\n branch: datasourceDefinition.stream.streamLocator.branchId\n }\n };\n columns = new Set([...Object.values(datasourceDefinition.stream.objectTypeAPrimaryKeyMapping).map(String), ...Object.values(datasourceDefinition.stream.objectTypeBPrimaryKeyMapping).map(String)]);\n datasourceType = \"STREAM\";\n } else {\n continue;\n }\n\n // Find datasource readable ID\n let datasourceReadableId;\n for (const [id, loc] of ridGenerator.getDatasourceLocators().entries()) {\n if (this.datasourceLocatorsMatch(loc, datasourceLocator)) {\n datasourceReadableId = id;\n break;\n }\n }\n if (!datasourceReadableId) continue;\n\n // Create column shapes\n const columnShapes = this.getColumnInputShapesForManyToManyDatasets(ridGenerator, columns, datasourceLocator, datasourceReadableId);\n for (const [id, shape] of columnShapes.entries()) {\n datasetShapes.set(id, shape);\n }\n\n // Create datasource shape\n const datasourceShape = this.getInputShapeForManyToManyDatasource(ridGenerator, linkTypeName, columns, datasourceLocator, datasourceType);\n datasetShapes.set(datasourceReadableId, datasourceShape);\n }\n return {\n inputShapes: datasetShapes,\n outputShapes: new Map([[linkReadableId, {\n type: \"linkType\",\n linkType: {\n type: \"manyToMany\",\n manyToMany: outputShape\n }\n }]]),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n }\n\n /**\n * Extract intermediary link shape\n */\n extractIntermediary(linkReadableId, linkDefinition, ridGenerator) {\n const outputShape = {\n about: createLocalizedAbout(linkDefinition.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeAToBLinkMetadata: createLocalizedAbout(linkDefinition.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeBToALinkMetadata: createLocalizedAbout(linkDefinition.objectTypeBToALinkMetadata.displayMetadata.displayName),\n objectTypeAShapeId: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidA),\n objectTypeBShapeId: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidB),\n intermediaryObjectTypeShapeId: this.getObjectTypeShapeId(ridGenerator, linkDefinition.intermediaryObjectTypeRid),\n aToIntermediaryLinkTypeShapeId: this.getLinkTypeShapeId(ridGenerator, linkDefinition.aToIntermediaryLinkTypeRid),\n intermediaryToBLinkTypeShapeId: this.getLinkTypeShapeId(ridGenerator, linkDefinition.intermediaryToBLinkTypeRid)\n };\n return {\n inputShapes: new Map(),\n outputShapes: new Map([[linkReadableId, {\n type: \"linkType\",\n linkType: {\n type: \"intermediary\",\n intermediary: outputShape\n }\n }]]),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n }\n\n /**\n * Get object type shape ID reference\n */\n getObjectTypeShapeId(ridGenerator, objectTypeRid) {\n const readableId = ridGenerator.getObjectTypeRids().inverse().get(objectTypeRid);\n if (!readableId) {\n throw new Error(`Object type RID not found: ${objectTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n }\n\n /**\n * Get link type shape ID reference\n */\n getLinkTypeShapeId(ridGenerator, linkTypeRid) {\n const readableId = ridGenerator.getLinkTypeRids().inverse().get(linkTypeRid);\n if (!readableId) {\n throw new Error(`Object type RID not found: ${linkTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n }\n\n /**\n * Get input shape for many-to-many datasource\n */\n getInputShapeForManyToManyDatasource(ridGenerator, linkTypeName, columns, datasourceLocator, datasourceType) {\n const columnReferences = [];\n for (const column of columns) {\n for (const [id, shape] of ridGenerator.getColumnShapes().entries()) {\n if (this.datasourceLocatorsMatch(shape.datasource, datasourceLocator) && shape.name === column) {\n columnReferences.push(ridGenerator.toBlockInternalId(id));\n break;\n }\n }\n }\n const shape = {\n about: createLocalizedAbout(linkTypeName),\n schema: columnReferences,\n supportedTypes: [datasourceType]\n };\n return {\n type: \"tabularDatasource\",\n tabularDatasource: shape\n };\n }\n\n /**\n * Get column input shapes for many-to-many datasets\n */\n getColumnInputShapesForManyToManyDatasets(ridGenerator, columns, datasourceLocator, datasourceReadableId) {\n const columnShapes = new Map();\n for (const column of columns) {\n for (const [id, shape] of ridGenerator.getColumnShapes().entries()) {\n if (this.datasourceLocatorsMatch(shape.datasource, datasourceLocator) && shape.name === column) {\n const columnShape = {\n about: createLocalizedAbout(column),\n type: {\n type: \"generic\",\n generic: {\n type: \"any\",\n any: {}\n }\n },\n datasource: ridGenerator.toBlockInternalId(datasourceReadableId),\n typeclasses: []\n };\n columnShapes.set(id, {\n type: \"datasourceColumn\",\n datasourceColumn: columnShape\n });\n break;\n }\n }\n }\n return columnShapes;\n }\n\n /**\n * Helper to compare datasource locators\n */\n datasourceLocatorsMatch(a, b) {\n if (a.type !== b.type) return false;\n if (a.type === \"dataset\" && b.type === \"dataset\") {\n return a.dataset.rid === b.dataset.rid && a.dataset.branch === b.dataset.branch;\n }\n if (a.type === \"stream\" && b.type === \"stream\") {\n return a.stream.rid === b.stream.rid && a.stream.branch === b.stream.branch;\n }\n if (a.type === \"restrictedView\" && b.type === \"restrictedView\") {\n return a.restrictedView.rid === b.restrictedView.rid;\n }\n return false;\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 { typeToConcreteDataType, typeToMarketplaceBaseType, typeToMarketplaceObjectPropertyType } from \"../typeVisitors.js\";\n\n/**\n * Helper to create LocalizedTitleAndDescription with empty localizations\n */\nfunction createLocalizedAbout(fallbackTitle, fallbackDescription) {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {}\n };\n}\n\n/**\n * TypeScript port of Java's ObjectTypeShapeExtractor class\n */\nexport class ObjectTypeShapeExtractor {\n constructor(randomnessKey) {\n this.randomnessKey = randomnessKey;\n }\n\n /**\n * Extract shapes from an ObjectType\n */\n extract(objectReadableId, objectType, ridGenerator) {\n // BiMap inverse() returns BiMap<V,K> so we convert to Map<K,V>\n const propertyReadableIdsByRid = ridGenerator.getPropertyTypeRids().inverse();\n const readableIdsForSptRid = ridGenerator.getSharedPropertyTypeRids().inverse();\n\n // Build property output shapes\n const propertyOutputShapeMap = new Map();\n for (const [propertyRid, propertyType] of Object.entries(objectType.objectType.propertyTypes)) {\n const readableId = propertyReadableIdsByRid.get(propertyRid);\n if (readableId) {\n propertyOutputShapeMap.set(readableId, this.getShapeForProperty(objectReadableId, propertyType, readableIdsForSptRid.asMap(), ridGenerator));\n }\n }\n const datasourcesByReadableId = ridGenerator.getDatasourceLocators().asMap();\n const directDatasourcesByReadableId = ridGenerator.getDirectDatasourceLocators().asMap();\n const filesDatasourcesByReadableId = ridGenerator.getFilesDatasourceLocators();\n const geotimeSeriesIntegrationRidByReadableId = new Map(Array.from(ridGenerator.getGeotimeSeriesIntegrationRids().entries()));\n const timeSeriesSyncRidByReadableId = ridGenerator.getTimeSeriesSyncs();\n const propertyTypes = new Map();\n for (const [rid, propertyType] of Object.entries(objectType.objectType.propertyTypes)) {\n propertyTypes.set(rid, propertyType.type);\n }\n const columnShapes = ridGenerator.getColumnShapes().asMap();\n const directDatasourceColumnShapes = ridGenerator.getDirectDatasourceColumnShapes().asMap();\n\n // Build object type output shape\n const objectTypeOutputShape = {\n about: createLocalizedAbout(objectType.objectType.displayMetadata.displayName, objectType.objectType.displayMetadata.description ?? \"\"),\n editsSupport: objectType.entityMetadata?.arePatchesEnabled ? \"EDITS_ENABLED\" : \"EDITS_DISABLED\",\n objectsBackendVersion: \"V2\",\n propertyTypes: Array.from(propertyOutputShapeMap.keys()).map(val => ridGenerator.toBlockInternalId(val))\n };\n const blockShapes = {\n inputShapes: new Map(),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n\n // Add property output shapes\n for (const [readableId, propertyShape] of Array.from(propertyOutputShapeMap.entries())) {\n blockShapes.outputShapes.set(readableId, {\n type: \"property\",\n property: propertyShape\n });\n }\n\n // Add object type output shape\n blockShapes.outputShapes.set(objectReadableId, {\n type: \"objectType\",\n objectType: objectTypeOutputShape\n });\n\n // Extract shapes from datasources\n for (const ds of objectType.datasources) {\n const dsShapes = this.getShapesFromDatasource(ds, datasourcesByReadableId, directDatasourcesByReadableId, filesDatasourcesByReadableId, geotimeSeriesIntegrationRidByReadableId, propertyTypes, propertyReadableIdsByRid.asMap(), propertyOutputShapeMap, timeSeriesSyncRidByReadableId, columnShapes, directDatasourceColumnShapes, ridGenerator);\n for (const [id, shape] of Array.from(dsShapes.entries())) {\n blockShapes.inputShapes.set(id, shape);\n }\n }\n\n // Extract value type input shapes if present\n for (const propertyType of Object.values(objectType.objectType.propertyTypes)) {\n this.extractValueTypeInputShapeIfPresent(propertyType.valueType, propertyType.displayMetadata.displayName, propertyType.type, blockShapes, ridGenerator);\n }\n return blockShapes;\n }\n getShapeForProperty(objectBlockShapeId, propertyType, readableIdsForSptRid, ridGenerator) {\n const shape = {\n about: createLocalizedAbout(propertyType.displayMetadata.displayName, propertyType.displayMetadata.description ?? \"\"),\n type: this.convertPropertyTypeToMarketplaceType(propertyType.type),\n objectType: ridGenerator.toBlockInternalId(objectBlockShapeId)\n };\n if (propertyType.sharedPropertyTypeRid) {\n const sptReadableId = readableIdsForSptRid.get(propertyType.sharedPropertyTypeRid);\n if (sptReadableId) {\n shape.sharedPropertyType = ridGenerator.toBlockInternalId(sptReadableId);\n }\n }\n return shape;\n }\n getShapesFromDatasource(datasource, datasourcesByReadableId, directDatasourcesByReadableId, filesDatasourcesByReadableId, geotimeSeriesIntegrationRidByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, timeSeriesSyncRidByReadableId, columnReadableIds, directDatasourceColumnReadableIds, ridGenerator) {\n const dsDefinition = datasource.datasource;\n switch (dsDefinition.type) {\n case \"dataset\":\n return new Map();\n // Not implemented in original\n case \"datasetV2\":\n return this.getShapesFromDataset(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.datasetV2.datasetRid, dsDefinition.datasetV2.branchId, this.filterToRelevantColumnMappings(dsDefinition.datasetV2.propertyMapping), ridGenerator);\n case \"datasetV3\":\n return this.getShapesFromDataset(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.datasetV3.datasetRid, dsDefinition.datasetV3.branchId, this.filterToRelevantColumnMappings(dsDefinition.datasetV3.propertyMapping), ridGenerator);\n case \"derived\":\n return new Map();\n // Empty per original\n case \"direct\":\n return this.getShapesFromDataset(directDatasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, directDatasourceColumnReadableIds, dsDefinition.direct.directSourceRid, \"master\", this.filterToRelevantColumnMappings(dsDefinition.direct.propertyMapping), ridGenerator, [\"DATASET\", \"RESTRICTED_VIEW\", \"VIRTUAL_TABLE\"]);\n case \"editsOnly\":\n return new Map();\n case \"geotimeSeries\":\n return this.getShapesFromGeotimeSeriesIntegration(geotimeSeriesIntegrationRidByReadableId, dsDefinition.geotimeSeries.geotimeSeriesIntegrationRid);\n case \"media\":\n return new Map();\n case \"mediaSetView\":\n return this.getShapesFromMediaSetView(filesDatasourcesByReadableId, dsDefinition.mediaSetView.mediaSetViewLocator);\n case \"restrictedStream\":\n return new Map();\n case \"restrictedView\":\n return new Map();\n case \"restrictedViewV2\":\n return this.getShapesFromRestrictedView(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.restrictedViewV2.restrictedViewRid, this.filterToRelevantColumnMappings(dsDefinition.restrictedViewV2.propertyMapping), ridGenerator);\n case \"stream\":\n return this.getShapesFromStream(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.stream.streamLocator.streamLocatorRid, dsDefinition.stream.streamLocator.branchId, dsDefinition.stream.propertyMapping, ridGenerator);\n case \"streamV2\":\n return this.getShapesFromStream(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.streamV2.streamLocator.streamLocatorRid, dsDefinition.streamV2.streamLocator.branchId, dsDefinition.streamV2.propertyMapping, ridGenerator);\n case \"streamV3\":\n const mapping = new Map();\n for (const [rid, info] of Object.entries(dsDefinition.streamV3.propertyMapping)) {\n mapping.set(rid, this.getColumnNameFromPropertyTypeMappingInfo(info));\n }\n return this.getShapesFromStream(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.streamV3.streamLocator.streamLocatorRid, dsDefinition.streamV3.streamLocator.branchId, mapping, ridGenerator);\n case \"table\":\n return new Map();\n case \"timeSeries\":\n return this.getShapesFromTimeSeriesSync(timeSeriesSyncRidByReadableId, propertyTypes, dsDefinition.timeSeries.properties, dsDefinition.timeSeries.timeSeriesSyncRid);\n default:\n return new Map();\n }\n }\n filterToRelevantColumnMappings(propertyMappings) {\n return Object.fromEntries(Object.entries(propertyMappings).filter(([, mapping]) => mapping.type === \"column\" || mapping.type === \"struct\"));\n }\n getShapesFromGeotimeSeriesIntegration(geotimeSeriesIntegrationRidByReadableId, geotimeSeriesIntegrationRid) {\n let readableId;\n for (const [id, rid] of geotimeSeriesIntegrationRidByReadableId.entries()) {\n if (rid === geotimeSeriesIntegrationRid) {\n readableId = id;\n break;\n }\n }\n if (!readableId) return new Map();\n const shape = {\n about: createLocalizedAbout(readableId, \"\")\n };\n return new Map([[readableId, {\n type: \"geotimeSeriesIntegration\",\n geotimeSeriesIntegration: shape\n }]]);\n }\n getShapesFromMediaSetView(filesDatasourcesByReadableId, mediaSetViewLocator // MediaSetViewLocator from OMS types\n ) {\n // Find the matching files datasource by comparing mediaSetRid\n let readableId;\n for (const [id, locator] of filesDatasourcesByReadableId.entries()) {\n if (locator.type === \"mediaSet\" && locator.mediaSet.rid === mediaSetViewLocator.mediaSetRid) {\n readableId = id;\n break;\n }\n }\n if (!readableId) return new Map();\n const shape = {\n about: createLocalizedAbout(readableId, \"\"),\n supportedTypes: [{\n type: \"mediaSet\",\n mediaSet: {\n pathPolicy: {\n type: \"any\",\n any: {}\n },\n mediaSchema: {\n type: \"any\",\n any: {}\n }\n }\n }]\n };\n return new Map([[readableId, {\n type: \"filesDatasource\",\n filesDatasource: shape\n }]]);\n }\n getShapesFromTimeSeriesSync(timeSeriesSyncRidByReadableId, propertyTypes, propertyTypeRids, timeSeriesSyncRid) {\n const readableId = timeSeriesSyncRidByReadableId.inverse().get(timeSeriesSyncRid);\n if (!readableId) return new Map();\n const timeSeriesSyncTypes = new Set(propertyTypeRids.map(rid => {\n const type = propertyTypes.get(rid);\n return type ? this.getTimeSeriesSyncType(type) : undefined;\n }).filter(t => t !== undefined));\n if (timeSeriesSyncTypes.size !== 1) {\n throw new Error(\"Invalid time series types\");\n }\n const syncType = Array.from(timeSeriesSyncTypes)[0];\n const shape = {\n about: createLocalizedAbout(readableId, \"\"),\n type: syncType\n };\n return new Map([[readableId, {\n type: \"timeSeriesSync\",\n timeSeriesSync: shape\n }]]);\n }\n getShapesFromStream(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, streamLocatorRid, branchId, propertyMapping, ridGenerator) {\n const streamLocator = {\n type: \"stream\",\n stream: {\n rid: streamLocatorRid,\n branch: branchId\n }\n };\n let datasourceReadableId;\n for (const [id, loc] of datasourcesByReadableId.entries()) {\n if (loc.type === \"stream\" && loc.stream.rid === streamLocator.stream.rid) {\n datasourceReadableId = id;\n break;\n }\n }\n if (!datasourceReadableId) return new Map();\n const propertyMappingMap = propertyMapping instanceof Map ? propertyMapping : new Map(Object.entries(propertyMapping));\n const columnShapes = this.getColumnShapes(streamLocator, columnReadableIds, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, datasourceReadableId, propertyMappingMap, ridGenerator, val => typeof val === \"string\" ? val : val);\n const datasourceInputShape = {\n about: createLocalizedAbout(datasourceReadableId, \"\"),\n supportedTypes: [\"STREAM\"],\n schema: Array.from(columnShapes.keys()).map(id => ridGenerator.toBlockInternalId(id))\n };\n const result = new Map([[datasourceReadableId, {\n type: \"tabularDatasource\",\n tabularDatasource: datasourceInputShape\n }]]);\n for (const [id, colShape] of columnShapes.entries()) {\n result.set(id, {\n type: \"datasourceColumn\",\n datasourceColumn: colShape\n });\n }\n return result;\n }\n getShapesFromDataset(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, datasetRid, branchId, propertyMapping, ridGenerator, supportedTypes = [\"DATASET\", \"RESTRICTED_VIEW\"]) {\n const datasourceLocator = {\n type: \"dataset\",\n dataset: {\n rid: datasetRid,\n branch: branchId\n }\n };\n let datasourceReadableId;\n for (const [id, loc] of datasourcesByReadableId.entries()) {\n if (loc.type === \"dataset\" && loc.dataset.rid === datasourceLocator.dataset.rid) {\n datasourceReadableId = id;\n break;\n }\n }\n if (!datasourceReadableId) return new Map();\n const propertyMappingMap = new Map(Object.entries(propertyMapping));\n const columnShapes = this.getColumnShapes(datasourceLocator, columnReadableIds, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, datasourceReadableId, propertyMappingMap, ridGenerator, val => {\n if (val.type === \"column\") return val.column;\n if (val.type === \"struct\") return val.struct.column;\n throw new Error(\"Error extracting column shapes\");\n });\n const datasourceInputShape = {\n about: createLocalizedAbout(datasourceReadableId, \"\"),\n supportedTypes,\n schema: Array.from(columnShapes.keys()).map(id => ridGenerator.toBlockInternalId(id))\n };\n const result = new Map([[datasourceReadableId, {\n type: \"tabularDatasource\",\n tabularDatasource: datasourceInputShape\n }]]);\n for (const [id, colShape] of Array.from(columnShapes.entries())) {\n result.set(id, {\n type: \"datasourceColumn\",\n datasourceColumn: colShape\n });\n }\n return result;\n }\n getShapesFromRestrictedView(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, restrictedViewRid, propertyMapping, ridGenerator) {\n const datasourceLocator = {\n type: \"restrictedView\",\n restrictedView: {\n rid: restrictedViewRid\n }\n };\n let datasourceReadableId;\n for (const [id, loc] of datasourcesByReadableId.entries()) {\n if (loc.type === \"restrictedView\" && loc.restrictedView.rid === datasourceLocator.restrictedView.rid) {\n datasourceReadableId = id;\n break;\n }\n }\n if (!datasourceReadableId) return new Map();\n const propertyMappingMap = new Map(Object.entries(propertyMapping));\n const columnShapes = this.getColumnShapes(datasourceLocator, columnReadableIds, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, datasourceReadableId, propertyMappingMap, ridGenerator, val => {\n if (val.type === \"column\") return val.column;\n if (val.type === \"struct\") return val.struct.column;\n throw new Error(\"Error extracting column shapes\");\n });\n const datasourceInputShape = {\n about: createLocalizedAbout(datasourceReadableId, \"\"),\n supportedTypes: [\"RESTRICTED_VIEW\"],\n schema: Array.from(columnShapes.keys()).map(id => ridGenerator.toBlockInternalId(id))\n };\n const result = new Map([[datasourceReadableId, {\n type: \"tabularDatasource\",\n tabularDatasource: datasourceInputShape\n }]]);\n for (const [id, colShape] of Array.from(columnShapes.entries())) {\n result.set(id, {\n type: \"datasourceColumn\",\n datasourceColumn: colShape\n });\n }\n return result;\n }\n getColumnShapes(datasourceLocator, columnReadableIds, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, datasourceReadableId, columns, ridGenerator, columnNameGetter) {\n const result = new Map();\n for (const [propertyTypeRid, value] of Array.from(columns.entries())) {\n const propertyReadableId = propertyReadableIdsByRid.get(propertyTypeRid);\n if (!propertyReadableId) continue;\n const propertyOutputShape = propertyOutputShapeMap.get(propertyReadableId);\n if (!propertyOutputShape) continue;\n const resolvedShape = {\n datasource: datasourceLocator,\n name: columnNameGetter(value)\n };\n let columnReadableId;\n for (const [id, shape] of columnReadableIds.entries()) {\n if (shape.name === resolvedShape.name && this.datasourceLocatorsMatch(shape.datasource, resolvedShape.datasource)) {\n columnReadableId = id;\n break;\n }\n }\n if (!columnReadableId) continue;\n const propertyType = propertyTypes.get(propertyTypeRid);\n if (!propertyType) continue;\n const columnShape = {\n about: createLocalizedAbout(propertyOutputShape.about.fallbackTitle, \"\"),\n type: {\n type: \"concrete\",\n concrete: this.typeToConcreteDataType(propertyType)\n },\n datasource: ridGenerator.toBlockInternalId(datasourceReadableId),\n typeclasses: []\n };\n result.set(columnReadableId, columnShape);\n }\n return result;\n }\n getColumnNameFromPropertyTypeMappingInfo(info) {\n if (info.type === \"column\") return info.column;\n if (info.type === \"struct\") return info.struct.column;\n throw new Error(\"Edits not supported yet\");\n }\n extractValueTypeInputShapeIfPresent(valueTypeReference, displayName, type, blockShapes, ridGenerator) {\n if (!valueTypeReference) return;\n const valueTypeInput = {\n type: \"valueType\",\n valueType: {\n about: createLocalizedAbout(`Value Type Input for ${displayName}`, \"\"),\n baseType: typeToMarketplaceBaseType(type)\n }\n };\n const mappingEntry = ridGenerator.valueTypeMappingForReference(valueTypeReference);\n blockShapes.inputShapes.set(mappingEntry.input, valueTypeInput);\n }\n getTimeSeriesSyncType(type) {\n if (type.type !== \"experimentalTimeDependentV1\") return undefined;\n const metadata = type.experimentalTimeDependentV1.seriesValueMetadata;\n const isNumeric = metadata.type === \"numeric\";\n return isNumeric ? \"NUMERIC\" : \"CATEGORICAL\";\n }\n convertPropertyTypeToMarketplaceType(type) {\n return typeToMarketplaceObjectPropertyType(type);\n }\n typeToConcreteDataType(type) {\n return typeToConcreteDataType(type);\n }\n datasourceLocatorsMatch(a, b) {\n if (a.type !== b.type) return false;\n switch (a.type) {\n case \"dataset\":\n return b.type === \"dataset\" && a.dataset.rid === b.dataset.rid && a.dataset.branch === b.dataset.branch;\n case \"stream\":\n return b.type === \"stream\" && a.stream.rid === b.stream.rid && a.stream.branch === b.stream.branch;\n case \"restrictedView\":\n return b.type === \"restrictedView\" && a.restrictedView.rid === b.restrictedView.rid;\n default:\n return false;\n }\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 { ReadableIdGenerator } from \"../../../util/generateRid.js\";\nimport { typeToMarketplaceBaseType, typeToMarketplaceObjectPropertyType } from \"../typeVisitors.js\";\nimport { LinkTypeShapeExtractor } from \"./LinkTypeShapeExtractor.js\";\nimport { ObjectTypeShapeExtractor } from \"./ObjectTypeShapeExtractor.js\";\nexport const MIGRATION_SHAPE_READABLE_ID = \"migration-input\";\nconst SPT_INPUT_SHAPE_METADATA = {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n};\n\n/**\n * Helper to create LocalizedTitleAndDescription with empty localizations\n */\nfunction createLocalizedAbout(fallbackTitle, fallbackDescription) {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {}\n };\n}\n\n/**\n * Main entry point for extracting all shapes from an ontology\n */\nexport async function getShapes(ontologyBlockDataV2, ridGenerator, functionsIr, randomnessKey) {\n const allBlockShapes = {\n inputShapes: new Map(),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n const outputSharedPropertyTypeRids = new Set(Object.keys(ontologyBlockDataV2.sharedPropertyTypes));\n const multiInterfaceSptApiNames = getMultiInterfaceSptApiNames(ontologyBlockDataV2.interfaceTypes);\n\n // Interfaces\n for (const [_rid, interfaceType] of Object.entries(ontologyBlockDataV2.interfaceTypes)) {\n extractInterfaceType(allBlockShapes.outputShapes, allBlockShapes.inputShapes, allBlockShapes.inputShapeMetadata, ontologyBlockDataV2.knownIdentifiers, outputSharedPropertyTypeRids, multiInterfaceSptApiNames, interfaceType.interfaceType, ridGenerator);\n }\n // Shared Property Types\n for (const [_rid, sharedPropertyTypeBlock] of Object.entries(ontologyBlockDataV2.sharedPropertyTypes)) {\n extractSharedPropertyType(allBlockShapes, sharedPropertyTypeBlock.sharedPropertyType, ridGenerator);\n }\n\n // Objects\n const objectReadableIds = ridGenerator.getObjectTypeRids().inverse();\n for (const [rid, objectType] of Object.entries(ontologyBlockDataV2.objectTypes)) {\n const readableId = objectReadableIds.get(rid);\n if (readableId) {\n const objectExtractor = new ObjectTypeShapeExtractor(randomnessKey);\n const objectShapes = objectExtractor.extract(readableId, objectType, ridGenerator);\n consumeBlockShapes(allBlockShapes, objectShapes);\n }\n }\n\n // Marking shapes\n const markingShapes = getMarkingShapes(ontologyBlockDataV2, ridGenerator);\n consumeBlockShapes(allBlockShapes, markingShapes);\n\n // Links\n const linkReadableIds = ridGenerator.getLinkTypeRids().inverse();\n for (const [rid, linkType] of Object.entries(ontologyBlockDataV2.linkTypes)) {\n const readableId = linkReadableIds.get(rid);\n if (readableId) {\n const linkExtractor = new LinkTypeShapeExtractor();\n const linkShapes = linkExtractor.extract(readableId, linkType, ridGenerator);\n consumeBlockShapes(allBlockShapes, linkShapes);\n }\n }\n\n // Actions\n const {\n ActionTypeShapeExtractor\n } = await import(\"./ActionTypeShapeExtractor.js\");\n for (const [_rid, actionType] of Object.entries(ontologyBlockDataV2.actionTypes || {})) {\n const actionExtractor = new ActionTypeShapeExtractor();\n const actionShapes = actionExtractor.extract(actionType, ridGenerator, ontologyBlockDataV2.knownIdentifiers, functionsIr);\n consumeBlockShapes(allBlockShapes, actionShapes);\n }\n\n // Multipass groups\n for (const [readableId, groupId] of ridGenerator.getGroupIds().entries()) {\n const groupShapes = extractMultipassGroup(groupId, readableId);\n consumeBlockShapes(allBlockShapes, groupShapes);\n }\n\n // Migration shape\n const migrationShapes = getMigrationShape();\n consumeBlockShapes(allBlockShapes, migrationShapes);\n\n // Direct datasource blocks publish the same shapes under produced-* IDs.\n // Recommend those outputs for the ontology block's direct datasource inputs.\n const directDatasourceReadableIds = new Set([...Array.from(ridGenerator.getDirectDatasourceLocators().entries()).map(([readableId]) => readableId), ...Array.from(ridGenerator.getDirectDatasourceColumnShapes().entries()).map(([readableId]) => readableId)]);\n for (const readableId of directDatasourceReadableIds) {\n if (allBlockShapes.inputShapes.has(readableId)) {\n allBlockShapes.inputMappings.push({\n input: readableId,\n output: ReadableIdGenerator.getProducedReadableId(readableId)\n });\n }\n }\n return allBlockShapes;\n}\n\n/**\n * Extract interface type shapes\n */\nfunction extractInterfaceType(outputShapeMap, inputShapeMap, inputShapeMetadataMap, knownMarketplaceIdentifiers, outputSharedPropertyTypeRids, multiInterfaceSptApiNames, interfaceType, ridGenerator) {\n const interfaceReadableId = getReadableIdForInterface(interfaceType.apiName);\n // SPT-backed properties must be present in both the legacy SPT reference list\n // and the modern IPT reference list. Marketplace follows the legacy edge to\n // resolve the SPT backing an IPT when wiring producer and consumer shapes.\n const propertiesV3 = Object.values(interfaceType.propertiesV3 ?? {});\n const sharedPropertyTypes = propertiesV3.length > 0 ? propertiesV3.flatMap(property => property.type === \"sharedPropertyBasedPropertyType\" ? [property.sharedPropertyBasedPropertyType.sharedPropertyType] : []) : Object.values(interfaceType.propertiesV2 ?? {}).length > 0 ? Object.values(interfaceType.propertiesV2).map(property => property.sharedPropertyType) : interfaceType.properties ?? [];\n const properties = sharedPropertyTypes.map(spt => {\n const sptId = knownMarketplaceIdentifiers.sharedPropertyTypes?.[spt.rid];\n return sptId ?? spt.rid;\n });\n // Build propertiesV2 from propertiesV3 entries using knownMarketplaceIdentifiers\n const propertiesV2 = [];\n for (const iptRid of Object.keys(interfaceType.propertiesV3 ?? {})) {\n const blockInternalId = knownMarketplaceIdentifiers.interfacePropertyTypes?.[iptRid];\n if (blockInternalId) {\n propertiesV2.push(blockInternalId);\n }\n }\n\n // Build interface type output shape\n const interfaceTypeOutputShape = {\n about: createLocalizedAbout(interfaceType.displayMetadata.displayName, interfaceType.displayMetadata.description ?? \"\"),\n properties,\n propertiesV2,\n links: (interfaceType.links ?? []).map(ilt => {\n const iltId = knownMarketplaceIdentifiers.interfaceLinkTypes?.[ilt.rid];\n return iltId ?? ilt.rid;\n }),\n extendsInterfaces: (interfaceType.extendsInterfaces ?? []).map(it => {\n const itId = knownMarketplaceIdentifiers.interfaceTypes?.[it];\n return itId ?? it;\n }),\n actionTypeConstraints: (interfaceType.actionTypeConstraints ?? []).map(constraint => {\n const constraintId = knownMarketplaceIdentifiers.interfaceActionTypeConstraints?.[constraint.rid];\n return constraintId ?? constraint.rid;\n })\n };\n\n // Add shared property type input shapes for properties not in output,\n // and extract value type input shapes for interface-defined properties\n const blockShapesRef = {\n inputShapes: inputShapeMap,\n outputShapes: outputShapeMap,\n inputShapeMetadata: inputShapeMetadataMap,\n inputMappings: []\n };\n for (const [_propertyRid, property] of Object.entries(interfaceType.propertiesV3) ?? []) {\n if (property.type === \"sharedPropertyBasedPropertyType\" && !outputSharedPropertyTypeRids.has(property.sharedPropertyBasedPropertyType.sharedPropertyType.rid)) {\n const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;\n const sptReadableId = getReadableIdForSpt(spt.apiName);\n const sharedPropInputShape = {\n about: getTitleAndDescriptionForSharedPropertyType(spt),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)\n }\n };\n inputShapeMap.set(sptReadableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: sharedPropInputShape\n });\n inputShapeMetadataMap.set(sptReadableId, SPT_INPUT_SHAPE_METADATA);\n } else if (property.type === \"interfaceDefinedPropertyType\") {\n // TODO: once we have published output shapes for a while, add IPT input shapes\n const idp = property.interfaceDefinedPropertyType;\n extractValueTypeInputShapeIfPresent(idp.constraints.valueType ?? undefined, idp.displayMetadata.displayName, idp.type, blockShapesRef, ridGenerator);\n }\n }\n\n // For every property directly defined on the interface, generate an IPT output shape.\n // IDPs can only be defined on a single interface so they are guaranteed to only be added once here.\n // SPT-backed properties may be added multiple times here with the latest winning out, however,\n // this is not an issue as the only thing that will change is the interfaceTypeReference which is unused\n for (const [_propertyRid, property] of Object.entries(interfaceType.propertiesV3) ?? []) {\n const outputShapeEntry = getInterfacePropertyTypeOutputShape(knownMarketplaceIdentifiers, interfaceType, multiInterfaceSptApiNames, property, interfaceReadableId, ridGenerator);\n outputShapeMap.set(outputShapeEntry.id, outputShapeEntry.outputShape);\n }\n\n // Add interface link type output shapes\n for (const interfaceLinkType of interfaceType.links ?? []) {\n const outputShape = getInterfaceLinkTypeOutputShape(knownMarketplaceIdentifiers, interfaceType, interfaceLinkType, ridGenerator);\n outputShapeMap.set(outputShape.id, outputShape.outputShape);\n }\n\n // Add action type constraint and parameter constraint output shapes\n for (const actionTypeConstraint of interfaceType.actionTypeConstraints ?? []) {\n const constraintOutputShape = getInterfaceActionTypeConstraintOutputShape(knownMarketplaceIdentifiers, interfaceType, actionTypeConstraint, ridGenerator);\n outputShapeMap.set(constraintOutputShape.id, constraintOutputShape.outputShape);\n for (const [paramRid, paramConstraint] of Object.entries(actionTypeConstraint.parameters ?? {})) {\n const paramOutputShape = getInterfaceParameterConstraintOutputShape(knownMarketplaceIdentifiers, actionTypeConstraint, paramRid, paramConstraint, ridGenerator);\n outputShapeMap.set(paramOutputShape.id, paramOutputShape.outputShape);\n }\n }\n\n // Add interface type output shape\n outputShapeMap.set(interfaceReadableId, {\n type: \"interfaceType\",\n interfaceType: interfaceTypeOutputShape\n });\n}\n\n/**\n * Get interface property type output shape for either interface-defined or SPT-backed properties.\n */\nfunction getInterfacePropertyTypeOutputShape(knownMarketplaceIdentifiers, interfaceType, multiInterfaceSptApiNames, property, interfaceReadableId, ridGenerator) {\n const interfaceTypeRef = ridGenerator.toBlockInternalId(interfaceReadableId);\n if (property.type === \"interfaceDefinedPropertyType\") {\n const idp = property.interfaceDefinedPropertyType;\n const readableId = ReadableIdGenerator.getForInterfaceProperty(interfaceType.apiName, idp.apiName);\n const shape = {\n about: createLocalizedAbout(idp.displayMetadata.displayName, idp.displayMetadata.description ?? idp.displayMetadata.displayName),\n interfaceType: interfaceTypeRef,\n type: typeToMarketplaceObjectPropertyType(idp.type),\n requireImplementation: idp.constraints.requireImplementation\n };\n return {\n id: readableId,\n outputShape: {\n type: \"interfacePropertyType\",\n interfacePropertyType: shape\n }\n };\n } else {\n const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;\n const sptApiName = spt.apiName;\n const readableId = multiInterfaceSptApiNames.has(sptApiName) ? ReadableIdGenerator.getForSptBackedInterfaceProperty(sptApiName) : ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, sptApiName);\n const sptBlockInternalId = knownMarketplaceIdentifiers.sharedPropertyTypes?.[spt.rid];\n const shape = {\n about: getTitleAndDescriptionForSharedPropertyType(spt),\n interfaceType: interfaceTypeRef,\n type: typeToMarketplaceObjectPropertyType(spt.type),\n requireImplementation: property.sharedPropertyBasedPropertyType.requireImplementation,\n sharedPropertyType: sptBlockInternalId\n };\n return {\n id: readableId,\n outputShape: {\n type: \"interfacePropertyType\",\n interfacePropertyType: shape\n }\n };\n }\n}\n\n/**\n * Returns the set of SPT api names that are used by more than one interface type.\n * For these SPTs, the shape ID must not include the interface api name to avoid RID collisions.\n */\nexport function getMultiInterfaceSptApiNames(interfaces) {\n const seen = new Set();\n const shared = new Set();\n for (const interfaceBlock of Object.values(interfaces)) {\n for (const property of Object.values(interfaceBlock.interfaceType.propertiesV3 ?? {})) {\n if (property.type === \"sharedPropertyBasedPropertyType\") {\n const apiName = property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName;\n if (seen.has(apiName)) {\n shared.add(apiName);\n }\n seen.add(apiName);\n }\n }\n }\n return shared;\n}\n\n/**\n * Get interface link type output shape\n */\nfunction getInterfaceLinkTypeOutputShape(knownMarketplaceIdentifiers, interfaceType, interfaceLinkType, ridGenerator) {\n // Build linked entity type reference\n const interfaceRidOrUndefined = interfaceLinkType.linkedEntityTypeId.type === \"interfaceType\" ? interfaceLinkType.linkedEntityTypeId.interfaceType : undefined;\n if (!interfaceRidOrUndefined) {\n throw new Error(\"Object link references not implemented\");\n }\n const linkedEntityTypeRef = ridGenerator.toBlockInternalId(ridGenerator.getInterfaceRids().inverse().get(interfaceRidOrUndefined));\n\n // Map cardinality\n const cardinality = interfaceLinkType.cardinality === \"SINGLE\" ? \"SINGLE\" : \"MANY\";\n const shape = {\n about: createLocalizedAbout(interfaceLinkType.metadata.displayName, interfaceLinkType.metadata.description),\n interfaceType: knownMarketplaceIdentifiers.interfaceTypes?.[interfaceType.rid] ?? interfaceType.rid,\n linkedEntityType: {\n type: \"interfaceType\",\n interfaceType: linkedEntityTypeRef\n },\n cardinality,\n required: interfaceLinkType.required\n };\n const readableId = getReadableIdForInterfaceLink(interfaceType.apiName, interfaceLinkType.metadata.apiName);\n return {\n id: readableId,\n outputShape: {\n type: \"interfaceLinkType\",\n interfaceLinkType: shape\n }\n };\n}\n\n/**\n * Get interface action type constraint output shape\n */\nfunction getInterfaceActionTypeConstraintOutputShape(knownMarketplaceIdentifiers, interfaceType, actionTypeConstraint, ridGenerator) {\n const interfaceReadableId = getReadableIdForInterface(interfaceType.apiName);\n const interfaceTypeRef = ridGenerator.toBlockInternalId(interfaceReadableId);\n const parameterConstraintRefs = Object.keys(actionTypeConstraint.parameters ?? {}).map(paramRid => {\n const paramId = knownMarketplaceIdentifiers.interfaceParameterConstraints?.[paramRid];\n return paramId ?? paramRid;\n });\n const shape = {\n about: createLocalizedAbout(actionTypeConstraint.metadata.displayName, actionTypeConstraint.metadata.description ?? actionTypeConstraint.metadata.displayName),\n interfaceType: interfaceTypeRef,\n parameterConstraints: parameterConstraintRefs,\n requireImplementation: actionTypeConstraint.requireImplementation\n };\n const readableId = ReadableIdGenerator.getForInterfaceActionTypeConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName);\n return {\n id: readableId,\n outputShape: {\n type: \"interfaceActionTypeConstraint\",\n interfaceActionTypeConstraint: shape\n }\n };\n}\n\n/**\n * Get interface parameter constraint output shape\n */\nfunction getInterfaceParameterConstraintOutputShape(knownMarketplaceIdentifiers, actionTypeConstraint, paramRid, paramConstraint, ridGenerator) {\n const actionTypeConstraintId = knownMarketplaceIdentifiers.interfaceActionTypeConstraints?.[actionTypeConstraint.rid];\n const actionTypeConstraintRef = actionTypeConstraintId ?? actionTypeConstraint.rid;\n const shape = {\n about: createLocalizedAbout(paramConstraint.displayMetadata.displayName, paramConstraint.displayMetadata.displayName),\n actionTypeConstraint: actionTypeConstraintRef,\n requireImplementation: paramConstraint.requireImplementation,\n type: paramConstraint.type\n };\n const paramReadableId = ridGenerator.getInterfaceParameterConstraintRids().inverse().get(paramRid);\n if (!paramReadableId) {\n throw new Error(`Missing readable ID for interface parameter constraint RID ${paramRid}`);\n }\n return {\n id: paramReadableId,\n outputShape: {\n type: \"interfaceParameterConstraint\",\n interfaceParameterConstraint: shape\n }\n };\n}\n\n/**\n * Extract shared property type shapes\n */\nfunction extractSharedPropertyType(blockShapes, sharedPropertyType, ridGenerator) {\n const readableId = getReadableIdForSpt(sharedPropertyType.apiName);\n const propertyType = typeToMarketplaceObjectPropertyType(sharedPropertyType.type);\n const outputShape = {\n about: getTitleAndDescriptionForSharedPropertyType(sharedPropertyType),\n type: propertyType\n };\n blockShapes.outputShapes.set(readableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: outputShape\n });\n extractValueTypeInputShapeIfPresent(sharedPropertyType.valueType ?? undefined, sharedPropertyType.displayMetadata.displayName, sharedPropertyType.type, blockShapes, ridGenerator);\n}\n\n/**\n * Extract value type input shape if present\n */\nexport function extractValueTypeInputShapeIfPresent(maybeValueTypeReference, displayName, type, blockShapes, ridGenerator) {\n if (!maybeValueTypeReference) return;\n const valueTypeInput = {\n type: \"valueType\",\n valueType: {\n about: createLocalizedAbout(`Value Type Input for ${displayName}`, \"\"),\n baseType: typeToMarketplaceBaseType(type)\n }\n };\n const mappingEntry = ridGenerator.valueTypeMappingForReference(maybeValueTypeReference);\n blockShapes.inputShapes.set(mappingEntry.input, valueTypeInput);\n}\n\n/**\n * Get title and description for shared property type\n */\nfunction getTitleAndDescriptionForSharedPropertyType(sharedPropertyType) {\n return createLocalizedAbout(sharedPropertyType.displayMetadata.displayName, sharedPropertyType.displayMetadata.description ?? sharedPropertyType.displayMetadata.displayName);\n}\n\n/**\n * Extract multipass group shape\n */\nfunction extractMultipassGroup(groupId, readableId) {\n const multipassGroup = {\n about: createLocalizedAbout(`Group ${groupId}`, \"\")\n };\n return {\n inputShapes: new Map([[readableId, {\n type: \"multipassGroup\",\n multipassGroup\n }]]),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n}\n\n/**\n * Get migration shape\n */\nfunction getMigrationShape() {\n const migrationShape = {\n about: createLocalizedAbout(\"Allow Ontology schema migrations\", \"Required user acknowledgement for any breaking schema change that requires an Ontology schema migration.\")\n };\n return {\n inputShapes: new Map([[MIGRATION_SHAPE_READABLE_ID, {\n type: \"allowOntologySchemaMigrations\",\n allowOntologySchemaMigrations: migrationShape\n }]]),\n outputShapes: new Map(),\n inputShapeMetadata: new Map([[MIGRATION_SHAPE_READABLE_ID, {\n isOptional: true,\n isAccessedInReconcile: false\n }]]),\n inputMappings: []\n };\n}\nconst MAX_CLASS_DESC = \"The maximum classification for data under mandatory control property types and/or the max classification\" + \" allowed on an action type classification parameter.\";\n\n/**\n * Get properties for a datasource definition (keys of propertyMapping).\n */\nfunction getPropertiesForDatasource(datasourceDef) {\n const dsType = datasourceDef.type;\n let propertyMapping;\n switch (dsType) {\n case \"dataset\":\n propertyMapping = datasourceDef.dataset?.propertyMapping;\n break;\n case \"datasetV2\":\n propertyMapping = datasourceDef.datasetV2?.propertyMapping;\n break;\n case \"datasetV3\":\n propertyMapping = datasourceDef.datasetV3?.propertyMapping;\n break;\n case \"direct\":\n propertyMapping = datasourceDef.direct?.propertyMapping;\n break;\n case \"restrictedView\":\n propertyMapping = datasourceDef.restrictedView?.propertyMapping;\n break;\n case \"restrictedViewV2\":\n propertyMapping = datasourceDef.restrictedViewV2?.propertyMapping;\n break;\n case \"stream\":\n propertyMapping = datasourceDef.stream?.propertyMapping;\n break;\n case \"streamV2\":\n propertyMapping = datasourceDef.streamV2?.propertyMapping;\n break;\n case \"streamV3\":\n propertyMapping = datasourceDef.streamV3?.propertyMapping;\n break;\n default:\n return new Set();\n }\n return new Set(propertyMapping ? Object.keys(propertyMapping) : []);\n}\nfunction getMarkingType(type) {\n if (type.type === \"array\") {\n return getMarkingType(type.array.subtype);\n }\n return type.type === \"marking\" ? type.marking.markingType : undefined;\n}\n\n/**\n * Extract marking shapes from the ontology block data.\n * Port of Java's MarkingShapeExtractor.getMarkingShapes().\n */\nfunction getMarkingShapes(ontologyBlockDataV2, ridGenerator) {\n // Collect CBAC and mandatory marking constraints across all object types\n const cbacMarkingsAndAffectedProps = new Map();\n const mandatoryMarkingsAndAffectedProps = new Map();\n // CBAC markings from additionalMandatory.markings in property security groups\n const additionalCbacMarkingsAndAffectedProps = new Map();\n for (const objectType of Object.values(ontologyBlockDataV2.objectTypes)) {\n const objectApiName = objectType.objectType.apiName ?? \"\";\n\n // Identify CBAC and mandatory marking properties by PropertyTypeRid\n const cbacReadableIdsByRid = new Map();\n const mandatoryReadableIdsByRid = new Map();\n for (const [propertyRid, propertyType] of Object.entries(objectType.objectType.propertyTypes)) {\n const markingType = getMarkingType(propertyType.type);\n if (markingType) {\n const propertyApiName = propertyType.apiName ?? propertyType.displayMetadata?.displayName;\n if (propertyApiName) {\n const readableId = ReadableIdGenerator.getForObjectProperty(objectApiName, propertyApiName);\n if (markingType === \"CBAC\") {\n cbacReadableIdsByRid.set(propertyRid, readableId);\n } else if (markingType === \"MANDATORY\") {\n mandatoryReadableIdsByRid.set(propertyRid, readableId);\n }\n }\n }\n }\n\n // For each datasource, extract marking constraints\n for (const ds of objectType.datasources) {\n const propertiesForDs = getPropertiesForDatasource(ds.datasource);\n\n // Find CBAC and mandatory props affected by this datasource\n const cbacPropsAffected = new Set();\n for (const rid of cbacReadableIdsByRid.keys()) {\n if (propertiesForDs.has(rid)) {\n cbacPropsAffected.add(rid);\n }\n }\n const mandatoryPropsAffected = new Set();\n for (const rid of mandatoryReadableIdsByRid.keys()) {\n if (propertiesForDs.has(rid)) {\n mandatoryPropsAffected.add(rid);\n }\n }\n if (cbacPropsAffected.size === 0 && mandatoryPropsAffected.size === 0) {\n continue;\n }\n const dataSecurity = ds.dataSecurity;\n if (!dataSecurity) continue;\n if (cbacPropsAffected.size > 0 && dataSecurity.classificationConstraint) {\n const markings = dataSecurity.classificationConstraint.markings ?? [];\n const markingId = markings[0];\n if (markingId) {\n const existing = cbacMarkingsAndAffectedProps.get(markingId) ?? new Set();\n for (const rid of cbacPropsAffected) {\n const readableId = cbacReadableIdsByRid.get(rid);\n if (readableId) existing.add(readableId);\n }\n cbacMarkingsAndAffectedProps.set(markingId, existing);\n }\n }\n if (mandatoryPropsAffected.size > 0 && dataSecurity.markingConstraint) {\n const markingIds = dataSecurity.markingConstraint.markingIds ?? [];\n const markingId = markingIds[0];\n if (markingId) {\n const existing = mandatoryMarkingsAndAffectedProps.get(markingId) ?? new Set();\n for (const rid of mandatoryPropsAffected) {\n const readableId = mandatoryReadableIdsByRid.get(rid);\n if (readableId) existing.add(readableId);\n }\n mandatoryMarkingsAndAffectedProps.set(markingId, existing);\n }\n }\n\n // Extract CBAC markings from additionalMandatory.markings in property security groups\n const dsDef = ds.datasource;\n const innerDef = dsDef[dsDef.type];\n const groups = innerDef?.propertySecurityGroups?.groups ?? [];\n for (const group of groups) {\n const additionalMarkings = group.security?.granular?.viewPolicy?.additionalMandatory?.markings ?? [];\n if (additionalMarkings.length === 0) continue;\n const groupPropertyRids = group.properties ?? [];\n for (const markingId of additionalMarkings) {\n const existing = additionalCbacMarkingsAndAffectedProps.get(markingId) ?? new Set();\n for (const propRid of groupPropertyRids) {\n // Look up the property apiName from the object type's propertyTypes\n const propType = objectType.objectType.propertyTypes[propRid];\n if (propType) {\n const propApiName = propType.apiName ?? propType.displayMetadata?.displayName;\n if (propApiName) {\n existing.add(ReadableIdGenerator.getForObjectProperty(objectApiName, propApiName));\n }\n }\n }\n additionalCbacMarkingsAndAffectedProps.set(markingId, existing);\n }\n }\n }\n }\n\n // Build marking shapes\n const inputShapes = new Map();\n for (const [markingId, props] of cbacMarkingsAndAffectedProps) {\n const readableId = ReadableIdGenerator.getForMarking(markingId, \"CBAC\");\n const shape = {\n about: createLocalizedAbout(`Max Classification ${markingId}`, MAX_CLASS_DESC),\n operation: \"USE\",\n affectedShapes: Array.from(props).map(p => ridGenerator.toBlockInternalId(p)),\n supportedMarkingsType: \"CBAC\",\n stableId: markingId\n };\n inputShapes.set(readableId, {\n type: \"markings\",\n markings: shape\n });\n }\n for (const [markingId, props] of additionalCbacMarkingsAndAffectedProps) {\n const readableId = ReadableIdGenerator.getForMarking(markingId, \"CBAC\");\n const shape = {\n about: createLocalizedAbout(`Marking ${markingId}`, \"Marking\"),\n operation: \"USE\",\n affectedShapes: Array.from(props).map(p => ridGenerator.toBlockInternalId(p)),\n supportedMarkingsType: \"CBAC\",\n stableId: markingId\n };\n inputShapes.set(readableId, {\n type: \"markings\",\n markings: shape\n });\n }\n for (const [markingId, props] of mandatoryMarkingsAndAffectedProps) {\n const readableId = ReadableIdGenerator.getForMarking(markingId, \"MANDATORY\");\n const shape = {\n about: createLocalizedAbout(`Max Marking ${markingId}`, \"Max Marking\"),\n operation: \"USE\",\n affectedShapes: Array.from(props).map(p => ridGenerator.toBlockInternalId(p)),\n supportedMarkingsType: \"MANDATORY\",\n stableId: markingId\n };\n inputShapes.set(readableId, {\n type: \"markings\",\n markings: shape\n });\n }\n return {\n inputShapes,\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n}\n\n/**\n * Consume (merge) block shapes into the target\n */\nfunction consumeBlockShapes(target, source) {\n for (const [key, value] of source.inputShapes.entries()) {\n target.inputShapes.set(key, value);\n }\n for (const [key, value] of source.outputShapes.entries()) {\n target.outputShapes.set(key, value);\n }\n for (const [key, value] of source.inputShapeMetadata.entries()) {\n target.inputShapeMetadata.set(key, value);\n }\n for (const mapping of source.inputMappings) {\n target.inputMappings.push(mapping);\n }\n}\n\n// Placeholder functions for readable ID generation\n// These should match the Java ReadableIdGenerator patterns\n\nfunction getReadableIdForSpt(apiName) {\n return ReadableIdGenerator.getForSpt(apiName);\n}\nfunction getReadableIdForInterface(apiName) {\n return ReadableIdGenerator.getForInterface(apiName);\n}\nfunction getReadableIdForInterfaceLink(interfaceApiName, linkApiName) {\n return ReadableIdGenerator.getForInterfaceLinkType(interfaceApiName, linkApiName);\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 { cleanAndValidateLinkTypeId, isInterfaceSharedPropertyType, OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { ReadableIdGenerator } from \"../../util/generateRid.js\";\nimport { convertAction } from \"./convertActionHelpers.js\";\nimport { convertInterface } from \"./convertInterface.js\";\nimport { convertLink } from \"./convertLink.js\";\nimport { convertObject } from \"./convertObject.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nimport { getMultiInterfaceSptApiNames, MIGRATION_SHAPE_READABLE_ID } from \"./shapeExtractors/IrShapeExtractor.js\";\nfunction toActionTypeRestrictionStatus(p) {\n return {\n hasRolesApplied: true,\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nfunction toObjectTypeRestrictionStatus(p) {\n return {\n restrictedByDatasources: false,\n editRestrictedByDatasources: false,\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nfunction toLinkTypeRestrictionStatus(p) {\n return {\n restrictedByDatasources: false,\n editRestrictedByDatasources: false,\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nfunction toInterfaceTypeRestrictionStatus(p) {\n return {\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nfunction toSharedPropertyTypeRestrictionStatus(p) {\n return {\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nexport function convertOntologyDefinitionToWireBlockData(ontology, ridGenerator, allOntologies, functionsIr) {\n const ontologiesToScan = allOntologies ?? [ontology];\n\n // Convert all entity types first to populate ridGenerator's BiMaps\n const objectTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).map(([apiName, objectType]) => {\n return [ridGenerator.generateRidForObjectType(apiName), convertObject(objectType, ridGenerator)];\n }));\n const sharedPropertyTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]).map(([apiName, spt]) => [ridGenerator.generateSptRid(apiName), {\n sharedPropertyType: convertSpt(spt, ridGenerator)\n }]));\n const interfaceTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).map(([apiName, interfaceType]) => {\n return [ridGenerator.generateRidForInterface(apiName), {\n interfaceType: convertInterface(interfaceType, ridGenerator)\n }];\n }));\n const linkTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.LINK_TYPE]).map(([id, link]) => {\n return [ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(id)), convertLink(link, ridGenerator)];\n }));\n const actionTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.ACTION_TYPE]).map(([apiName, action]) => {\n const converted = convertAction(action, ridGenerator, functionsIr);\n if (converted === undefined) return undefined;\n return [ridGenerator.generateRidForActionType(apiName), converted];\n }).filter(entry => entry !== undefined));\n const interfacePropertyMappings = {\n ...getImportedInterfacePropertyMappings(ontologiesToScan.filter(candidate => candidate !== ontology), ridGenerator),\n ...getInterfacePropertyMappings(interfaceTypes, ridGenerator)\n };\n\n // Build knownIdentifiers from ridGenerator's BiMaps\n const knownIdentifiers = buildKnownIdentifiers(ontology, ridGenerator, ontologiesToScan, interfacePropertyMappings);\n return {\n objectTypes,\n sharedPropertyTypes,\n interfaceTypes,\n linkTypes,\n actionTypes,\n // TODO: Add proper blockOutputCompassLocations mapping\n blockOutputCompassLocations: {},\n knownIdentifiers,\n ruleSets: {},\n blockPermissionInformation: {\n actionTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.ACTION_TYPE]).filter(([_, action]) => action.validation || action.permission).map(([apiName, action]) => {\n return [ridGenerator.generateRidForActionType(apiName), {\n restrictionStatus: toActionTypeRestrictionStatus(action.permission ?? \"roles\")\n }];\n }))),\n objectTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).filter(([_, objectType]) => objectType.permission != null).map(([apiName, objectType]) => {\n return [ridGenerator.generateRidForObjectType(apiName), {\n restrictionStatus: toObjectTypeRestrictionStatus(objectType.permission)\n }];\n }))),\n linkTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.LINK_TYPE]).filter(([_, link]) => link.permission != null).map(([id, link]) => {\n return [ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(id)), {\n restrictionStatus: toLinkTypeRestrictionStatus(link.permission)\n }];\n }))),\n interfaceTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).filter(([_, iface]) => iface.permission != null).map(([apiName, iface]) => {\n return [ridGenerator.generateRidForInterface(apiName), {\n restrictionStatus: toInterfaceTypeRestrictionStatus(iface.permission)\n }];\n }))),\n sharedPropertyTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]).filter(([_, spt]) => spt.permission != null).map(([apiName, spt]) => {\n return [ridGenerator.generateSptRid(apiName), {\n restrictionStatus: toSharedPropertyTypeRestrictionStatus(spt.permission)\n }];\n })))\n }\n };\n}\nfunction buildKnownIdentifiers(ontology, ridGenerator, ontologiesToScan, interfacePropertyMappings) {\n // Interface types: InterfaceTypeRid -> BlockInternalId\n const interfaceMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Shared property types: SharedPropertyTypeRid -> BlockInternalId\n const sharedPropertyMappings = Object.fromEntries(Array.from(ridGenerator.getSharedPropertyTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Interface link types: InterfaceLinkTypeRid -> BlockInternalId\n const interfaceLinkMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceLinkTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Interface action type constraints: InterfaceActionTypeConstraintRid -> BlockInternalId\n const interfaceActionTypeConstraintMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceActionTypeConstraintRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Interface parameter constraints: InterfaceParameterConstraintRid -> BlockInternalId\n const interfaceParameterConstraintMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceParameterConstraintRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Datasources: BlockInternalId -> DatasourceLocator\n const backingDatasourceMappings = Object.fromEntries([...ridGenerator.getDatasourceLocators().entries(), ...ridGenerator.getDirectDatasourceLocators().entries()].map(([readableId, locator]) => [ridGenerator.toBlockInternalId(readableId), locator]));\n\n // Files datasources: BlockInternalId -> FilesDatasourceLocator\n const filesDatasourceMappings = Object.fromEntries(Array.from(ridGenerator.getFilesDatasourceLocators().entries()).map(([readableId, locator]) => [ridGenerator.toBlockInternalId(readableId), locator]));\n\n // Object type RIDs: ObjectTypeRid -> BlockInternalId\n const objectTypeRids = Object.fromEntries(Array.from(ridGenerator.getObjectTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Object type IDs: ObjectTypeId -> BlockInternalId\n // Scan all ontologies so cross-references to imported objects resolve.\n const objectTypeIds = Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ont[OntologyEntityTypeEnum.OBJECT_TYPE]).map(([objectTypeApiName, objectType]) => [ridGenerator.getObjectTypeIds().get(ReadableIdGenerator.getForObjectType(objectTypeApiName)), ridGenerator.toBlockInternalId(ReadableIdGenerator.getForObjectType(objectTypeApiName))])));\n\n // Property type IDs: ObjectTypeId -> (PropertyTypeId -> BlockInternalId)\n // Scan all ontologies so imported object properties are included.\n const propertyTypeIds = {};\n const objectPropertyTypeIdsToRids = {};\n const structFieldRidsToApiNames = {};\n ontologiesToScan.forEach(ont => {\n Object.entries(ont[OntologyEntityTypeEnum.OBJECT_TYPE]).forEach(([objectTypeApiName, objectType]) => {\n const propMap = {};\n const propertyTypeIdsToRids = {};\n (objectType.properties ?? []).forEach(property => {\n const propertyTypeRid = ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName);\n propMap[property.apiName] = ridGenerator.toBlockInternalId(ReadableIdGenerator.getForObjectProperty(objectTypeApiName, property.apiName));\n propertyTypeIdsToRids[property.apiName] = propertyTypeRid;\n if (typeof property.type === \"object\" && property.type.type === \"struct\") {\n structFieldRidsToApiNames[propertyTypeRid] = Object.fromEntries(Object.keys(property.type.structDefinition).map(structFieldApiName => [ridGenerator.generateStructFieldRid(property.apiName, structFieldApiName), structFieldApiName]));\n }\n });\n const objTypeId = ridGenerator.getObjectTypeIds().get(ReadableIdGenerator.getForObjectType(objectTypeApiName));\n propertyTypeIds[objTypeId] = propMap;\n objectPropertyTypeIdsToRids[objTypeId] = propertyTypeIdsToRids;\n });\n });\n\n // Property type RIDs: PropertyTypeRid -> BlockInternalId\n const propertyRids = Object.fromEntries(Array.from(ridGenerator.getPropertyTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Datasource columns: BlockInternalId -> ResolvedDatasourceColumnShape\n const datasourceColumns = Object.fromEntries([...ridGenerator.getColumnShapes().entries(), ...ridGenerator.getDirectDatasourceColumnShapes().entries()].map(([readableId, shape]) => [ridGenerator.toBlockInternalId(readableId), shape]));\n\n // Time series syncs: TimeSeriesSyncRid -> BlockInternalId\n const timeSeriesSyncs = Object.fromEntries(Array.from(ridGenerator.getTimeSeriesSyncs().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Geotime series syncs: GeotimeSeriesIntegrationRid -> BlockInternalId\n const geotimeSeriesSyncs = Object.fromEntries(Array.from(ridGenerator.getGeotimeSeriesIntegrationRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Link type IDs: LinkTypeId -> BlockInternalId\n // Scan all ontologies so imported link types are included.\n const linkTypeIds = Object.fromEntries(ontologiesToScan.flatMap(ont => Object.keys(ont[OntologyEntityTypeEnum.LINK_TYPE]).map(linkTypeId => [cleanAndValidateLinkTypeId(linkTypeId), ridGenerator.toBlockInternalId(ReadableIdGenerator.getForLinkType(cleanAndValidateLinkTypeId(linkTypeId)))])));\n\n // Link type RIDs: LinkTypeRid -> BlockInternalId\n const linkTypeRids = Object.fromEntries(Array.from(ridGenerator.getLinkTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Action types: ActionTypeRid -> BlockInternalId\n const actionTypeMappings = Object.fromEntries(Array.from(ridGenerator.getActionTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Action parameters: ParameterRid -> BlockInternalId\n const actionParameterMappings = {};\n ridGenerator.getParameterRidAndIds().forEach((biMap, _actionApiName) => {\n Array.from(biMap.entries()).forEach(([readableId, ridAndId]) => {\n actionParameterMappings[ridAndId.rid] = ridGenerator.toBlockInternalId(readableId);\n });\n });\n\n // Action parameter IDs: ActionTypeRid -> (ParameterId -> BlockInternalId)\n const actionParameterIdMappings = {};\n Array.from(ridGenerator.getActionTypeRids().inverse().entries()).forEach(([actionTypeRid, actionReadableId]) => {\n // Extract action type API name from readable ID\n const actionTypeApiName = actionReadableId.replace(/^action-type-/u, \"\");\n const paramBiMap = ridGenerator.getParameterRidAndIds().get(actionTypeApiName);\n if (paramBiMap) {\n const paramMap = {};\n Array.from(paramBiMap.entries()).forEach(([paramReadableId, ridAndId]) => {\n paramMap[ridAndId.id] = ridGenerator.toBlockInternalId(paramReadableId);\n });\n actionParameterIdMappings[actionTypeRid] = paramMap;\n }\n });\n\n // Group IDs: GroupId -> BlockInternalId\n const groupMappings = Object.fromEntries(Array.from(ridGenerator.getGroupIds().inverse().entries()).map(([groupId, readableId]) => [groupId, ridGenerator.toBlockInternalId(readableId)]));\n\n // Value types: ValueTypeRid -> (ValueTypeVersionId -> BlockInternalId)\n const valueTypeMappings = {};\n ridGenerator.getConsumedValueTypeReferences().asMap().forEach((valueTypeRef, readableId) => {\n if (!valueTypeMappings[valueTypeRef.rid]) {\n valueTypeMappings[valueTypeRef.rid] = {};\n }\n valueTypeMappings[valueTypeRef.rid][valueTypeRef.versionId] = ridGenerator.toBlockInternalId(readableId);\n });\n\n // Build markings mapping: BlockInternalId -> [markingId]\n // Collect marking shapes from object type marking properties and additionalMandatoryMarkings\n const markingEntries = [];\n Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).forEach(([objectTypeApiName, objectType]) => {\n // Marking properties\n (objectType.properties ?? []).forEach(prop => {\n if (typeof prop.type === \"object\" && prop.type.type === \"marking\" && prop.type.markingInputGroupName) {\n markingEntries.push({\n markingId: prop.type.markingInputGroupName,\n markingType: prop.type.markingType\n });\n }\n });\n // additionalMandatoryMarkings from property security groups\n (objectType.datasources ?? []).forEach(ds => {\n if (\"propertySecurityGroups\" in ds && ds.propertySecurityGroups) {\n ds.propertySecurityGroups.forEach(psg => {\n if (psg.appliedMarkings) {\n Object.entries(psg.appliedMarkings).forEach(([markingId, markingType]) => {\n markingEntries.push({\n markingId,\n markingType: markingType\n });\n });\n }\n });\n }\n });\n });\n\n // Deduplicate and build mapping\n const markingsMappings = {};\n const seenMarkings = new Set();\n markingEntries.forEach(({\n markingId,\n markingType\n }) => {\n const key = `${markingId}-${markingType}`;\n if (seenMarkings.has(key)) return;\n seenMarkings.add(key);\n const readableId = ReadableIdGenerator.getForMarking(markingId, markingType);\n const blockInternalId = ridGenerator.toBlockInternalId(readableId);\n markingsMappings[blockInternalId] = [markingId];\n });\n return {\n actionParameterIds: actionParameterIdMappings,\n actionParameters: actionParameterMappings,\n actionTypes: actionTypeMappings,\n datasourceColumns,\n datasources: backingDatasourceMappings,\n filesDatasources: filesDatasourceMappings,\n functions: {},\n geotimeSeriesSyncs,\n groupIds: groupMappings,\n interfaceActionTypeConstraints: interfaceActionTypeConstraintMappings,\n interfaceLinkTypes: interfaceLinkMappings,\n interfaceParameterConstraints: interfaceParameterConstraintMappings,\n interfacePropertyTypes: interfacePropertyMappings,\n interfaceTypes: interfaceMappings,\n linkTypeIds,\n linkTypes: linkTypeRids,\n markings: markingsMappings,\n objectTypeIds,\n objectTypes: objectTypeRids,\n objectPropertyTypeIdsToRids,\n propertyTypeIds,\n propertyTypes: propertyRids,\n sharedPropertyTypes: sharedPropertyMappings,\n shapeIdForOntologyAllowSchemaMigrations: ridGenerator.toBlockInternalId(MIGRATION_SHAPE_READABLE_ID),\n shapeIdForInstallPrefix: null,\n structFieldRidsToApiNames,\n timeSeriesSyncs,\n valueTypes: valueTypeMappings,\n webhooks: {},\n workshopModules: {}\n };\n}\n\n/**\n * Port of Java's OntologyAsCodeBlockGenerator.getInterfacePropertyMappings().\n */\nfunction getInterfacePropertyMappings(interfaces, ridGenerator) {\n const multiInterfaceSptApiNames = getMultiInterfaceSptApiNames(interfaces);\n const mappings = {};\n for (const interfaceBlock of Object.values(interfaces)) {\n const iface = interfaceBlock.interfaceType;\n for (const [iptRid, property] of Object.entries(iface.propertiesV3)) {\n let readableId;\n if (property.type === \"interfaceDefinedPropertyType\") {\n readableId = ReadableIdGenerator.getForInterfaceProperty(iface.apiName, property.interfaceDefinedPropertyType.apiName);\n } else {\n const sptApiName = property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName;\n readableId = multiInterfaceSptApiNames.has(sptApiName) ? ReadableIdGenerator.getForSptBackedInterfaceProperty(sptApiName) : ReadableIdGenerator.getForSptBackedInterfaceProperty(iface.apiName, sptApiName);\n }\n mappings[iptRid] = ridGenerator.toBlockInternalId(readableId);\n }\n }\n return mappings;\n}\n\n/**\n * Port of Java's OntologyAsCodeBlockGenerator.getImportedInterfacePropertyMappings().\n */\nfunction getImportedInterfacePropertyMappings(importedOntologies, ridGenerator) {\n const mappings = {};\n for (const ontology of importedOntologies) {\n for (const [interfaceApiName, interfaceType] of Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE])) {\n for (const [propertyApiName, property] of Object.entries(interfaceType.propertiesV3)) {\n if (isInterfaceSharedPropertyType(property)) continue;\n const readableId = ReadableIdGenerator.getForInterfaceProperty(interfaceApiName, propertyApiName);\n const interfacePropertyTypeRid = ridGenerator.generateInterfacePropertyTypeRid(propertyApiName, interfaceApiName);\n mappings[interfacePropertyTypeRid] = ridGenerator.toBlockInternalId(readableId);\n }\n }\n }\n return mappings;\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nexport function convertValueTypeToWireBlockData(ontology) {\n return Object.values(ontology[OntologyEntityTypeEnum.VALUE_TYPE]).map(definitions => {\n const version = getLatestVersion(definitions);\n return {\n metadata: {\n apiName: definitions[0].apiName,\n baseType: version.baseType,\n displayMetadata: definitions[0].displayMetadata,\n status: definitions[0].status\n },\n versions: Array.from(new Map(definitions.map(definition => [definition.version, definition])).values()).map(definition => ({\n version: definition.version,\n baseType: definition.baseType,\n constraints: definition.constraints,\n exampleValues: definition.exampleValues\n }))\n };\n });\n}\nfunction getLatestVersion(versions) {\n if (versions.length === 0) {\n throw new Error(\"Value type must have at least one version\");\n }\n return versions.reduce((latest, current) => {\n return compareSlsVersions(current.version, latest.version) > 0 ? current : latest;\n });\n}\nfunction compareSlsVersions(a, b) {\n const partsA = a.split(\".\").map(Number);\n const partsB = b.split(\".\").map(Number);\n const maxLen = Math.max(partsA.length, partsB.length);\n for (let i = 0; i < maxLen; i++) {\n const segA = partsA[i] ?? 0;\n const segB = partsB[i] ?? 0;\n if (segA !== segB) return segA - segB;\n }\n return 0;\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 { getImportedTypes } from \"@osdk/maker\";\nimport { OntologyRidGeneratorImpl } from \"../../util/generateRid.js\";\nimport { convertOntologyDefinitionToWireBlockData } from \"./convertOntologyDefinitionToWireBlockData.js\";\nimport { convertValueTypeToWireBlockData } from \"./convertValueTypeToWireBlockData.js\";\nexport function convertOntologyDefinition(ontology, ridGenerator, functionsIr, randomnessKey) {\n const importedTypes = getImportedTypes();\n const allOntologies = [ontology, importedTypes];\n const mainOntology = convertOntologyDefinitionToWireBlockData(ontology, ridGenerator, allOntologies, functionsIr);\n const importedOntology = convertOntologyDefinitionToWireBlockData(importedTypes, ridGenerator);\n const importedInterfaceApiNames = new Set(Object.keys(importedTypes.INTERFACE_TYPE));\n const relatedInterfaces = iface => [...(iface.linkedInterfaces ?? []), ...iface.extendsInterfaces].filter(related => typeof related !== \"string\");\n const fullImportedInterfaces = new Map();\n const queue = Object.values(importedTypes.INTERFACE_TYPE);\n while (queue.length > 0) {\n const iface = queue.pop();\n if (iface === undefined) continue;\n const related = relatedInterfaces(iface);\n const existing = fullImportedInterfaces.get(iface.apiName);\n // Register on first sight, or replace a truncated stub with a full copy\n if (existing === undefined || relatedInterfaces(existing).length === 0 && related.length > 0) {\n fullImportedInterfaces.set(iface.apiName, iface);\n queue.push(...related);\n }\n }\n const transitiveInterfaces = {};\n for (const [apiName, iface] of fullImportedInterfaces) {\n if (!importedInterfaceApiNames.has(apiName)) {\n transitiveInterfaces[apiName] = iface;\n }\n }\n const transitiveOntology = {\n INTERFACE_TYPE: transitiveInterfaces,\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n SHARED_PROPERTY_TYPE: {},\n VALUE_TYPE: {}\n };\n const throwawayRidGenerator = new OntologyRidGeneratorImpl(getImportedTypes(), randomnessKey);\n const transitiveImportedOntology = convertOntologyDefinitionToWireBlockData(transitiveOntology, throwawayRidGenerator);\n return {\n ontology: mainOntology,\n importedOntology,\n transitiveImportedOntology,\n valueTypes: convertValueTypeToWireBlockData(ontology),\n importedValueTypes: convertValueTypeToWireBlockData(importedTypes),\n randomnessKey\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 { ReadableIdGenerator } from \"../../../util/generateRid.js\";\nimport { typeToMarketplaceObjectPropertyType } from \"../typeVisitors.js\";\nimport { extractValueTypeInputShapeIfPresent } from \"./IrShapeExtractor.js\";\nfunction createLocalizedAbout(fallbackTitle, fallbackDescription = \"\") {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {}\n };\n}\n\n/**\n * Extracts INPUT shapes from imported ontology block data.\n * Each imported entity becomes an input shape so the marketplace can wire it\n * from the block that originally defined it.\n */\nexport function getImportedShapes(importedBlockData, ridGenerator, linkTypeIdsByApiName = {}) {\n const blockShapes = {\n inputShapes: new Map(),\n inputPresets: new Map(),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n extractImportedObjectTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedLinkTypes(importedBlockData, ridGenerator, blockShapes, linkTypeIdsByApiName);\n extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedSharedPropertyTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedActionTypes(importedBlockData, ridGenerator, blockShapes);\n return blockShapes;\n}\nfunction extractImportedObjectTypes(importedBlockData, ridGenerator, blockShapes) {\n const objectReadableIds = ridGenerator.getObjectTypeRids().inverse();\n const propertyReadableIds = ridGenerator.getPropertyTypeRids().inverse();\n for (const [rid, objectType] of Object.entries(importedBlockData.objectTypes)) {\n const readableId = objectReadableIds.get(rid);\n if (!readableId) continue;\n const propertyBlockIds = [];\n for (const propertyRid of Object.keys(objectType.objectType.propertyTypes)) {\n const propReadableId = propertyReadableIds.get(propertyRid);\n if (propReadableId) {\n propertyBlockIds.push(ridGenerator.toBlockInternalId(propReadableId));\n }\n }\n const inputShape = {\n about: createLocalizedAbout(objectType.objectType.displayMetadata.displayName, objectType.objectType.displayMetadata.description ?? \"\"),\n editsSupport: \"ANY\",\n objectsBackendVersion: \"V2\",\n propertyTypes: propertyBlockIds\n };\n blockShapes.inputShapes.set(readableId, {\n type: \"objectType\",\n objectType: inputShape\n });\n addApiNamePreset(blockShapes, readableId, objectType.objectType.apiName);\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n\n // Generate property input shapes\n for (const [propertyRid, propertyType] of Object.entries(objectType.objectType.propertyTypes)) {\n const propReadableId = propertyReadableIds.get(propertyRid);\n if (!propReadableId) continue;\n const sptReadableId = propertyType.sharedPropertyTypeRid ? ridGenerator.getSharedPropertyTypeRids().inverse().get(propertyType.sharedPropertyTypeRid) : undefined;\n const propInputShape = {\n about: createLocalizedAbout(propertyType.displayMetadata.displayName, propertyType.displayMetadata.description ?? \"\"),\n objectType: ridGenerator.toBlockInternalId(readableId),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(propertyType.type)\n },\n sharedPropertyType: sptReadableId ? ridGenerator.toBlockInternalId(sptReadableId) : undefined\n };\n blockShapes.inputShapes.set(propReadableId, {\n type: \"property\",\n property: propInputShape\n });\n addApiNamePreset(blockShapes, propReadableId, propertyType.apiName);\n blockShapes.inputShapeMetadata.set(propReadableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n }\n }\n}\nfunction extractImportedLinkTypes(importedBlockData, ridGenerator, blockShapes, linkTypeIdsByApiName) {\n const linkReadableIds = ridGenerator.getLinkTypeRids().inverse();\n for (const [rid, linkType] of Object.entries(importedBlockData.linkTypes)) {\n const readableId = linkReadableIds.get(rid);\n if (!readableId) continue;\n const definition = linkType.linkType.definition;\n let linkInputShape;\n switch (definition.type) {\n case \"oneToMany\":\n {\n const def = definition.oneToMany;\n const shape = {\n about: createLocalizedAbout(def.oneToManyLinkMetadata.displayMetadata.displayName),\n objectTypeShapeIdOneSide: getObjectTypeBlockId(ridGenerator, def.objectTypeRidOneSide),\n objectTypeShapeIdManySide: getObjectTypeBlockId(ridGenerator, def.objectTypeRidManySide),\n manyToOneLinkMetadata: createLocalizedAbout(def.manyToOneLinkMetadata.displayMetadata.displayName),\n oneToManyLinkMetadata: createLocalizedAbout(def.oneToManyLinkMetadata.displayMetadata.displayName),\n cardinalityHint: def.cardinalityHint === \"ONE_TO_ONE\" ? \"ONE_TO_ONE\" : \"ONE_TO_MANY\"\n };\n linkInputShape = {\n type: \"oneToMany\",\n oneToMany: shape\n };\n break;\n }\n case \"manyToMany\":\n {\n const def = definition.manyToMany;\n const shape = {\n about: createLocalizedAbout(def.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeShapeIdA: getObjectTypeBlockId(ridGenerator, def.objectTypeRidA),\n objectTypeShapeIdB: getObjectTypeBlockId(ridGenerator, def.objectTypeRidB),\n objectTypeAToBLinkMetadata: createLocalizedAbout(def.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeBToALinkMetadata: createLocalizedAbout(def.objectTypeBToALinkMetadata.displayMetadata.displayName),\n editsSupport: \"ANY\",\n objectsBackendVersion: \"V2\"\n };\n linkInputShape = {\n type: \"manyToMany\",\n manyToMany: shape\n };\n break;\n }\n case \"intermediary\":\n {\n const def = definition.intermediary;\n const shape = {\n about: createLocalizedAbout(def.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeAToBLinkMetadata: createLocalizedAbout(def.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeBToALinkMetadata: createLocalizedAbout(def.objectTypeBToALinkMetadata.displayMetadata.displayName),\n objectTypeAShapeId: getObjectTypeBlockId(ridGenerator, def.objectTypeRidA),\n objectTypeBShapeId: getObjectTypeBlockId(ridGenerator, def.objectTypeRidB),\n intermediaryObjectTypeShapeId: getObjectTypeBlockId(ridGenerator, def.intermediaryObjectTypeRid),\n aToIntermediaryLinkTypeShapeId: getLinkTypeBlockId(ridGenerator, def.aToIntermediaryLinkTypeRid),\n intermediaryToBLinkTypeShapeId: getLinkTypeBlockId(ridGenerator, def.intermediaryToBLinkTypeRid)\n };\n linkInputShape = {\n type: \"intermediary\",\n intermediary: shape\n };\n break;\n }\n default:\n continue;\n }\n blockShapes.inputShapes.set(readableId, {\n type: \"linkType\",\n linkType: linkInputShape\n });\n const linkTypeId = linkTypeIdsByApiName[linkType.linkType.id];\n if (linkTypeId !== undefined) {\n addPreset(blockShapes, readableId, {\n type: \"linkTypeIdResolver\",\n linkTypeIdResolver: {\n linkTypeIdWithoutOntologyPrefix: linkTypeId\n }\n });\n }\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n }\n}\nfunction extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockShapes) {\n const knownIdentifiers = importedBlockData.knownIdentifiers;\n for (const [_rid, interfaceTypeBlock] of Object.entries(importedBlockData.interfaceTypes)) {\n const interfaceType = interfaceTypeBlock.interfaceType;\n const interfaceReadableId = ReadableIdGenerator.getForInterface(interfaceType.apiName);\n\n // Build properties list from propertiesV2 (SPT references as BlockInternalIds)\n const properties = Object.values(interfaceType.propertiesV2 ?? {}).map(propEntry => ridGenerator.toBlockInternalId(ReadableIdGenerator.getForSpt(propEntry.sharedPropertyType.apiName)));\n const propertiesV2 = [];\n for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {\n const propReadableId = property.type === \"sharedPropertyBasedPropertyType\" ? ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName) : ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);\n if (!propReadableId) {\n throw new Error(`Missing readable ID for interface property RID ${propertyRid} on interface ${interfaceType.apiName}`);\n }\n propertiesV2.push(ridGenerator.toBlockInternalId(propReadableId));\n }\n\n // Build links list\n const links = (interfaceType.links ?? []).map(ilt => {\n const iltId = knownIdentifiers.interfaceLinkTypes?.[ilt.rid];\n return iltId ?? ilt.rid;\n });\n\n // Build actionTypeConstraints list\n const actionTypeConstraints = (interfaceType.actionTypeConstraints ?? []).map(constraint => {\n const constraintId = knownIdentifiers.interfaceActionTypeConstraints?.[constraint.rid];\n return constraintId ?? constraint.rid;\n });\n const inputShape = {\n about: createLocalizedAbout(interfaceType.displayMetadata.displayName, interfaceType.displayMetadata.description ?? \"\"),\n actionTypeConstraints,\n properties,\n propertiesV2,\n links\n };\n blockShapes.inputShapes.set(interfaceReadableId, {\n type: \"interfaceType\",\n interfaceType: inputShape\n });\n addApiNamePreset(blockShapes, interfaceReadableId, interfaceType.apiName);\n\n // Generate SPT input shapes\n for (const [_sptRid, propEntry] of Object.entries(interfaceType.propertiesV2 ?? {})) {\n const spt = propEntry.sharedPropertyType;\n const sptReadableId = ReadableIdGenerator.getForSpt(spt.apiName);\n if (blockShapes.inputShapes.has(sptReadableId)) continue;\n blockShapes.inputShapes.set(sptReadableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: {\n about: createLocalizedAbout(spt.displayMetadata.displayName, spt.displayMetadata.description ?? \"\"),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)\n }\n }\n });\n addApiNamePreset(blockShapes, sptReadableId, spt.apiName);\n blockShapes.inputShapeMetadata.set(sptReadableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n }\n\n // Generate interface property type input shapes\n for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {\n let propReadableId;\n let propApiName;\n let propInputShape;\n if (property.type === \"interfaceDefinedPropertyType\") {\n const registeredReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);\n if (!registeredReadableId) {\n throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);\n }\n propReadableId = registeredReadableId;\n propApiName = property.interfaceDefinedPropertyType.apiName;\n propInputShape = {\n about: createLocalizedAbout(property.interfaceDefinedPropertyType.displayMetadata.displayName, property.interfaceDefinedPropertyType.displayMetadata.description ?? \"\"),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(property.interfaceDefinedPropertyType.type)\n },\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n requireImplementation: property.interfaceDefinedPropertyType.constraints.requireImplementation\n };\n } else {\n const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;\n propReadableId = ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, spt.apiName);\n propApiName = spt.apiName;\n propInputShape = {\n about: createLocalizedAbout(spt.displayMetadata.displayName, spt.displayMetadata.description ?? \"\"),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)\n },\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n requireImplementation: property.sharedPropertyBasedPropertyType.requireImplementation,\n sharedPropertyType: ridGenerator.toBlockInternalId(ReadableIdGenerator.getForSpt(spt.apiName))\n };\n }\n blockShapes.inputShapes.set(propReadableId, {\n type: \"interfacePropertyType\",\n interfacePropertyType: propInputShape\n });\n addApiNamePreset(blockShapes, propReadableId, propApiName);\n }\n\n // Generate interface link type input shapes\n for (const interfaceLinkType of interfaceType.links ?? []) {\n const linkReadableId = ReadableIdGenerator.getForInterfaceLinkType(interfaceType.apiName, interfaceLinkType.metadata.apiName);\n const linkedInterfaceRid = interfaceLinkType.linkedEntityTypeId.type === \"interfaceType\" ? interfaceLinkType.linkedEntityTypeId.interfaceType : undefined;\n const linkedReadableId = linkedInterfaceRid ? ridGenerator.getInterfaceRids().inverse().get(linkedInterfaceRid) : undefined;\n const linkedEntityTypeRef = linkedReadableId ? {\n type: \"interfaceType\",\n interfaceType: ridGenerator.toBlockInternalId(linkedReadableId)\n } : undefined;\n if (!linkedEntityTypeRef) continue;\n const linkInputShape = {\n about: createLocalizedAbout(interfaceLinkType.metadata.displayName, interfaceLinkType.metadata.description),\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n linkedEntityType: linkedEntityTypeRef,\n cardinality: interfaceLinkType.cardinality === \"SINGLE\" ? \"SINGLE\" : \"MANY\",\n required: interfaceLinkType.required\n };\n blockShapes.inputShapes.set(linkReadableId, {\n type: \"interfaceLinkType\",\n interfaceLinkType: linkInputShape\n });\n addApiNamePreset(blockShapes, linkReadableId, interfaceLinkType.metadata.apiName);\n }\n\n // Generate interface action type constraint input shapes\n for (const actionTypeConstraint of interfaceType.actionTypeConstraints ?? []) {\n const constraintReadableId = ReadableIdGenerator.getForInterfaceActionTypeConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName);\n const parameterConstraintRefs = Object.entries(actionTypeConstraint.parameters ?? {}).map(([paramRid, paramConstraint]) => {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName;\n return ridGenerator.toBlockInternalId(ReadableIdGenerator.getForInterfaceParameterConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName, paramDisplayApiName));\n });\n const constraintInputShape = {\n about: createLocalizedAbout(actionTypeConstraint.metadata.displayName, actionTypeConstraint.metadata.description ?? actionTypeConstraint.metadata.displayName),\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n parameterConstraints: parameterConstraintRefs,\n requireImplementation: actionTypeConstraint.requireImplementation\n };\n blockShapes.inputShapes.set(constraintReadableId, {\n type: \"interfaceActionTypeConstraint\",\n interfaceActionTypeConstraint: constraintInputShape\n });\n addApiNamePreset(blockShapes, constraintReadableId, actionTypeConstraint.metadata.apiName);\n\n // Generate interface parameter constraint input shapes\n for (const [paramRid, paramConstraint] of Object.entries(actionTypeConstraint.parameters ?? {})) {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName;\n const paramReadableId = ReadableIdGenerator.getForInterfaceParameterConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName, paramDisplayApiName);\n const paramInputShape = {\n about: createLocalizedAbout(paramConstraint.displayMetadata.displayName, paramConstraint.displayMetadata.displayName),\n actionTypeConstraint: ridGenerator.toBlockInternalId(constraintReadableId),\n requireImplementation: paramConstraint.requireImplementation,\n type: paramConstraint.type\n };\n blockShapes.inputShapes.set(paramReadableId, {\n type: \"interfaceParameterConstraint\",\n interfaceParameterConstraint: paramInputShape\n });\n addApiNamePreset(blockShapes, paramReadableId, paramDisplayApiName);\n }\n }\n }\n}\nfunction extractImportedSharedPropertyTypes(importedBlockData, ridGenerator, blockShapes) {\n for (const [_rid, sptBlock] of Object.entries(importedBlockData.sharedPropertyTypes)) {\n const spt = sptBlock.sharedPropertyType;\n const readableId = ReadableIdGenerator.getForSpt(spt.apiName);\n const inputShape = {\n about: createLocalizedAbout(spt.displayMetadata.displayName, spt.displayMetadata.description ?? \"\"),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)\n }\n };\n blockShapes.inputShapes.set(readableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: inputShape\n });\n addApiNamePreset(blockShapes, readableId, spt.apiName);\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n extractValueTypeInputShapeIfPresent(spt.valueType ?? undefined, spt.displayMetadata.displayName, spt.type, blockShapes, ridGenerator);\n }\n}\nfunction extractImportedActionTypes(importedBlockData, ridGenerator, blockShapes) {\n for (const [_rid, actionTypeBlock] of Object.entries(importedBlockData.actionTypes ?? {})) {\n const actionApiName = actionTypeBlock.actionType.metadata.apiName;\n const actionReadableId = ReadableIdGenerator.getForActionType(actionApiName);\n const parametersV2 = Object.entries(actionTypeBlock.parameterIds ?? {}).map(([_key, parameterId]) => {\n const paramReadableId = ReadableIdGenerator.getForParameter(actionApiName, parameterId);\n return ridGenerator.toBlockInternalId(paramReadableId);\n });\n const actionShape = {\n about: createLocalizedAbout(actionTypeBlock.actionType.metadata.displayMetadata.displayName, actionTypeBlock.actionType.metadata.displayMetadata.description),\n parameters: {},\n parametersV2\n };\n blockShapes.inputShapes.set(actionReadableId, {\n type: \"action\",\n action: actionShape\n });\n addApiNamePreset(blockShapes, actionReadableId, actionApiName);\n\n // Generate parameter input shapes\n const parameters = actionTypeBlock.actionType.metadata.parameters;\n if (parameters) {\n const converter = new ImportedBaseParameterTypeConverter(importedBlockData.knownIdentifiers.objectTypeIds, importedBlockData.knownIdentifiers.interfaceTypes);\n for (const [parameterId, parameter] of Object.entries(parameters)) {\n const paramReadableId = ReadableIdGenerator.getForParameter(actionApiName, parameterId);\n const parameterShape = {\n about: createLocalizedAbout(parameter.displayMetadata.displayName, parameter.displayMetadata.description),\n type: converter.convert(parameter.type),\n actionType: ridGenerator.toBlockInternalId(actionReadableId)\n };\n blockShapes.inputShapes.set(paramReadableId, {\n type: \"actionParameter\",\n actionParameter: parameterShape\n });\n addApiNamePreset(blockShapes, paramReadableId, parameterId);\n }\n }\n }\n}\nfunction addApiNamePreset(blockShapes, readableId, apiName) {\n addPreset(blockShapes, readableId, {\n type: \"apiNameResolver\",\n apiNameResolver: {\n apiName\n }\n });\n}\nfunction addPreset(blockShapes, readableId, resolver) {\n blockShapes.inputPresets.set(readableId, {\n value: {\n type: \"fromSource\",\n fromSource: {\n resolver\n }\n },\n exportCompatibility: \"COMPATIBLE\",\n enforcement: \"SUGGESTED\",\n isDefault: false\n });\n}\nfunction getObjectTypeBlockId(ridGenerator, objectTypeRid) {\n const readableId = ridGenerator.getObjectTypeRids().inverse().get(objectTypeRid);\n if (!readableId) {\n throw new Error(`Object type RID not found: ${objectTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n}\nfunction getLinkTypeBlockId(ridGenerator, linkTypeRid) {\n const readableId = ridGenerator.getLinkTypeRids().inverse().get(linkTypeRid);\n if (!readableId) {\n throw new Error(`Link type RID not found: ${linkTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n}\n\n/**\n * Simplified parameter type converter for imported action types.\n * Mirrors BaseParameterTypeConverter from ActionTypeShapeExtractor.\n */\nclass ImportedBaseParameterTypeConverter {\n constructor(objectTypeIds, interfaceTypes) {\n this.objectTypeIds = objectTypeIds ?? {};\n this.interfaceTypes = interfaceTypes ?? {};\n }\n convert(parameterType) {\n const pt = parameterType;\n const t = pt.type;\n\n // Simple types\n const simpleTypes = [\"boolean\", \"booleanList\", \"integer\", \"integerList\", \"long\", \"longList\", \"double\", \"doubleList\", \"string\", \"stringList\", \"geohash\", \"geohashList\", \"geoshape\", \"geoshapeList\", \"timeSeriesReference\", \"timestamp\", \"timestampList\", \"date\", \"dateList\", \"attachment\", \"attachmentList\", \"marking\", \"markingList\", \"mediaReference\", \"objectTypeReference\", \"geotimeSeriesReference\", \"geotimeSeriesReferenceList\"];\n if (simpleTypes.includes(t)) {\n return {\n type: t,\n [t]: {}\n };\n }\n\n // Object reference types\n if (t === \"objectReference\" || t === \"objectReferenceList\" || t === \"objectSetRid\") {\n const objRef = pt[t];\n const blockId = objRef ? this.objectTypeIds[objRef.objectTypeId] : undefined;\n return {\n type: t,\n [t]: {\n objectTypeId: blockId ?? \"\"\n }\n };\n }\n\n // Interface reference types\n if (t === \"interfaceReference\" || t === \"interfaceReferenceList\" || t === \"interfaceObjectSetRid\") {\n const ifRef = pt[t];\n const blockId = ifRef ? this.interfaceTypes[ifRef.interfaceTypeRid] : undefined;\n return {\n type: t,\n [t]: {\n interfaceTypeRid: blockId ?? \"\"\n }\n };\n }\n\n // Decimal types\n if (t === \"decimal\" || t === \"decimalList\") {\n const dec = pt[t];\n return {\n type: t,\n [t]: {\n precision: dec?.precision,\n scale: dec?.scale\n }\n };\n }\n return {\n type: t,\n [t]: {}\n };\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 * as fs from \"fs\";\nimport { getImportedTypes, getOntologyDefinition, initializeOntologyState, OntologyEntityTypeEnum, writeDependencyFile, writeStaticObjects } from \"@osdk/maker\";\nimport { convertOntologyDefinition } from \"../conversion/toMarketplace/convertOntologyDefinition.js\";\nimport { getImportedShapes } from \"../conversion/toMarketplace/shapeExtractors/ImportedShapeExtractor.js\";\nimport { getShapes } from \"../conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js\";\nimport { OntologyRidGeneratorImpl } from \"../util/generateRid.js\";\nexport async function defineOntologyV2(ns, body, outputDir, dependencyFile, functionsIrFile, randomnessKey, importedLinkTypeIdsByApiName) {\n initializeOntologyState(ns);\n try {\n await body();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Unexpected error while processing the body of the ontology\", e);\n throw e;\n }\n const ontologyDefinition = getOntologyDefinition();\n let functionsIr;\n if (functionsIrFile) {\n functionsIr = JSON.parse(fs.readFileSync(functionsIrFile, \"utf-8\"));\n }\n const ridGenerator = new OntologyRidGeneratorImpl(getImportedTypes(), randomnessKey);\n const ontDef = convertOntologyDefinition(ontologyDefinition, ridGenerator, functionsIr, randomnessKey);\n const shapes = await getShapes(ontDef.ontology, ridGenerator, functionsIr, randomnessKey);\n\n // Generate input shapes for imported entities and merge into main shapes\n const importedShapes = getImportedShapes(ontDef.importedOntology, ridGenerator, importedLinkTypeIdsByApiName);\n for (const [key, value] of importedShapes.inputShapes) {\n shapes.inputShapes.set(key, value);\n }\n for (const [key, value] of importedShapes.inputShapeMetadata) {\n shapes.inputShapeMetadata.set(key, value);\n }\n const backingDatasourceApiNames = Object.entries(ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE]).filter(([_, obj]) => obj.includeEmptyBackingDatasource === true).map(([apiName]) => apiName);\n const backingDatasourceLinkApiNames = Object.entries(ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE]).filter(([_, link]) => {\n const lt = link;\n return \"many\" in lt && !(\"intermediaryObjectType\" in lt) && lt.includeEmptyBackingDatasource === true;\n }).map(([apiName]) => apiName);\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\n }\n return {\n ontologyIr: ontDef,\n shapes,\n importedInputPresets: importedShapes.inputPresets,\n backingDatasourceApiNames,\n backingDatasourceLinkApiNames\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 { ReadableIdGenerator } from \"../../util/generateRid.js\";\nconst DEFAULT_VERSION_RANGE = {\n from: \"0.0.0\",\n until: \"x.x.x\"\n};\n\n/**\n * Extract the package namespace from a dotted api name.\n * E.g. \"com.palantir.MyType\" -> \"com.palantir\"\n * If there's no dot, returns the full name.\n */\nfunction getPackage(fullApiName) {\n const lastDotIndex = fullApiName.lastIndexOf(\".\");\n if (lastDotIndex === -1) {\n return fullApiName;\n }\n return fullApiName.substring(0, lastDotIndex);\n}\n\n/**\n * Generic helper to build external recommendations grouped by package.\n * For non-value-type entities, the targetInputReadableId and upstreamOutputReadableId\n * are the same (the entity's readable ID).\n */\nfunction getExternalRecommendationsForType(items, getApiName, getReadableId, packageNameOverride) {\n const groups = new Map();\n for (const item of items) {\n const apiName = getApiName(item);\n const packageName = packageNameOverride ?? getPackage(apiName);\n const readableId = getReadableId(apiName);\n const pair = {\n targetInputReadableId: readableId,\n upstreamOutputReadableId: readableId\n };\n const existing = groups.get(packageName);\n if (existing) {\n existing.push(pair);\n } else {\n groups.set(packageName, [pair]);\n }\n }\n return Array.from(groups.entries()).map(([packageName, mappings]) => ({\n upstreamPackageName: packageName,\n upstreamVersionCompatibility: DEFAULT_VERSION_RANGE,\n mappings\n }));\n}\nfunction externalRecsForInterfaces(importedOntology) {\n return getExternalRecommendationsForType(Object.values(importedOntology.interfaceTypes), i => i.interfaceType.apiName, apiName => ReadableIdGenerator.getForInterface(apiName));\n}\nfunction externalRecsForInterfaceProperties(importedOntology) {\n const results = [];\n for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {\n const interfaceApiName = interfaceBlock.interfaceType.apiName;\n const interfaceDefinedProperties = Object.values(interfaceBlock.interfaceType.propertiesV3 ?? {}).filter(property => property.type === \"interfaceDefinedPropertyType\");\n results.push(...getExternalRecommendationsForType(interfaceDefinedProperties, property => property.interfaceDefinedPropertyType.apiName, propertyApiName => ReadableIdGenerator.getForInterfaceProperty(interfaceApiName, propertyApiName), getPackage(interfaceApiName)));\n }\n return results;\n}\nfunction externalRecsForInterfaceLinks(importedOntology) {\n const results = [];\n for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {\n const interfaceApiName = interfaceBlock.interfaceType.apiName;\n const links = interfaceBlock.interfaceType.links ?? [];\n results.push(...getExternalRecommendationsForType(links, link => link.metadata.apiName, linkApiName => ReadableIdGenerator.getForInterfaceLinkType(interfaceApiName, linkApiName), getPackage(interfaceApiName)));\n }\n return results;\n}\nfunction externalRecsForSpts(importedOntology) {\n // Collect SPTs from standalone shared property types\n const sptApiNames = [];\n for (const sptBlock of Object.values(importedOntology.sharedPropertyTypes)) {\n sptApiNames.push(sptBlock.sharedPropertyType.apiName);\n }\n\n // Collect SPTs embedded in interface propertiesV3\n for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {\n for (const property of Object.values(interfaceBlock.interfaceType.propertiesV3 ?? {})) {\n if (property.type === \"sharedPropertyBasedPropertyType\") {\n sptApiNames.push(property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName);\n }\n }\n }\n return getExternalRecommendationsForType(sptApiNames, apiName => apiName, apiName => ReadableIdGenerator.getForSpt(apiName));\n}\nfunction externalRecsForObjects(importedOntology) {\n return getExternalRecommendationsForType(Object.values(importedOntology.objectTypes).filter(o => o.objectType.apiName != null), o => o.objectType.apiName, apiName => ReadableIdGenerator.getForObjectType(apiName));\n}\nfunction externalRecsForProperties(importedOntology) {\n const results = [];\n for (const objectBlock of Object.values(importedOntology.objectTypes)) {\n const objectApiName = objectBlock.objectType.apiName;\n if (objectApiName == null) continue;\n const properties = Object.values(objectBlock.objectType.propertyTypes).filter(p => p.apiName != null);\n results.push(...getExternalRecommendationsForType(properties, p => p.apiName, propApiName => ReadableIdGenerator.getForObjectProperty(objectApiName, propApiName), getPackage(objectApiName)));\n }\n return results;\n}\nfunction externalRecsForLinks(importedOntology) {\n return getExternalRecommendationsForType(Object.values(importedOntology.linkTypes), l => l.linkType.id, id => ReadableIdGenerator.getForLinkType(id));\n}\nfunction externalRecsForActions(importedOntology) {\n return getExternalRecommendationsForType(Object.values(importedOntology.actionTypes), a => a.actionType.metadata.apiName, apiName => ReadableIdGenerator.getForActionType(apiName));\n}\nfunction externalRecsForActionParams(importedOntology) {\n const results = [];\n for (const actionBlock of Object.values(importedOntology.actionTypes)) {\n const actionApiName = actionBlock.actionType.metadata.apiName;\n const parameters = actionBlock.actionType.metadata.parameters;\n if (!parameters) continue;\n results.push(...getExternalRecommendationsForType(Object.keys(parameters), paramId => paramId, paramId => ReadableIdGenerator.getForParameter(actionApiName, paramId), getPackage(actionApiName)));\n }\n return results;\n}\n\n/**\n * Build consumed value type references grouped by apiName.\n * Sources:\n * 1. Value type entries (produced + imported) that have consumed input shapes\n * 2. Imported SPT value type references\n * 3. Imported property value type references\n */\nfunction getConsumedValueTypes(producedValueTypes, importedValueTypes, inputShapes) {\n const consumed = new Map();\n function addConsumed(apiName, version, packageNamespace) {\n const existing = consumed.get(apiName);\n if (existing) {\n existing.push({\n version,\n packageNamespace\n });\n } else {\n consumed.set(apiName, [{\n version,\n packageNamespace\n }]);\n }\n }\n for (const entry of [...producedValueTypes, ...importedValueTypes]) {\n if (entry.versions.length === 0) continue;\n const apiName = entry.metadata.apiName;\n const firstVersion = entry.versions[0].version;\n const consumedId = ReadableIdGenerator.getForConsumedValueType(apiName, firstVersion);\n if (inputShapes.has(consumedId)) {\n const packageNamespace = getPackage(apiName);\n for (const version of entry.versions) {\n addConsumed(apiName, version.version, packageNamespace);\n }\n }\n }\n return consumed;\n}\nfunction externalRecsForValueTypes(producedValueTypes, importedValueTypes, inputShapes) {\n const producedApiNames = new Set(producedValueTypes.map(vt => vt.metadata.apiName));\n const consumed = getConsumedValueTypes(producedValueTypes, importedValueTypes, inputShapes);\n const results = [];\n for (const [apiName, versions] of consumed) {\n if (producedApiNames.has(apiName)) continue;\n const mappings = versions.map(v => ({\n targetInputReadableId: ReadableIdGenerator.getForConsumedValueType(apiName, v.version),\n upstreamOutputReadableId: ReadableIdGenerator.getForProducedValueType(apiName, v.version)\n }));\n results.push({\n upstreamPackageName: versions[0].packageNamespace,\n upstreamVersionCompatibility: DEFAULT_VERSION_RANGE,\n mappings\n });\n }\n return results;\n}\n\n/**\n * Generate external recommendations for all imported/consumed entities.\n * Port of Java's RecommendationUtils.getRecommendations() (external portion).\n */\nexport function getExternalRecommendations(importedOntology, producedValueTypes, importedValueTypes, inputShapes) {\n return [...externalRecsForInterfaces(importedOntology), ...externalRecsForInterfaceProperties(importedOntology), ...externalRecsForInterfaceLinks(importedOntology), ...externalRecsForSpts(importedOntology), ...externalRecsForObjects(importedOntology), ...externalRecsForProperties(importedOntology), ...externalRecsForLinks(importedOntology), ...externalRecsForActions(importedOntology), ...externalRecsForActionParams(importedOntology), ...externalRecsForValueTypes(producedValueTypes, importedValueTypes, inputShapes)];\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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { typeToConcreteDataType } from \"../conversion/toMarketplace/typeVisitors.js\";\nimport { ReadableIdGenerator } from \"../util/generateRid.js\";\nimport { toBlockShapeId } from \"./marketplaceSerialization/CodeBlockSpec.js\";\n\n/**\n * Map from maker property type to Foundry schema field type\n */\nexport function propertyTypeToSchemaType(propType) {\n const typeStr = typeof propType === \"string\" ? propType : propType.type;\n switch (typeStr) {\n case \"string\":\n return \"STRING\";\n case \"boolean\":\n return \"BOOLEAN\";\n case \"integer\":\n return \"INTEGER\";\n case \"long\":\n return \"LONG\";\n case \"double\":\n return \"DOUBLE\";\n case \"float\":\n return \"FLOAT\";\n case \"byte\":\n return \"BYTE\";\n case \"short\":\n return \"SHORT\";\n case \"date\":\n return \"DATE\";\n case \"timestamp\":\n return \"TIMESTAMP\";\n case \"array\":\n return \"ARRAY\";\n case \"decimal\":\n return \"DECIMAL\";\n case \"struct\":\n return \"STRUCT\";\n default:\n throw new Error(`Unsupported property type \"${typeStr}\" for empty backing datasource. ` + `If using a property type that doesn't support empty backing datasources please make the property an edit only property.`);\n }\n}\n\n/**\n * A single field entry in a Foundry dataset schema.json `fieldSchemaList`.\n */\n\n/**\n * Build a Foundry schema field object for a column type.\n */\nexport function typeToFieldSchema(type, name) {\n return {\n type: propertyTypeToSchemaType(type),\n name: name ?? null,\n nullable: null,\n userDefinedTypeClass: null,\n customMetadata: {},\n arraySubtype: type.type === \"array\" ? typeToFieldSchema(type.array.subtype) : null,\n precision: type.type === \"decimal\" ? type.decimal.precision ?? null : null,\n scale: type.type === \"decimal\" ? type.decimal.scale ?? null : null,\n mapKeyType: null,\n mapValueType: null,\n subSchemas: type.type === \"struct\" ? type.struct.structFields.map(f => typeToFieldSchema(f.fieldType, f.apiName)) : null\n };\n}\n\n/**\n * Extract the set of edit-only property RIDs from the wire format datasources.\n */\nfunction getEditOnlyPropertyRids(datasources) {\n const editOnlyRids = new Set();\n for (const ds of datasources) {\n const def = ds.datasource;\n let propertyMapping;\n if (def.type === \"datasetV2\") {\n propertyMapping = def.datasetV2.propertyMapping;\n } else if (def.type === \"datasetV3\") {\n propertyMapping = def.datasetV3.propertyMapping;\n }\n if (propertyMapping) {\n for (const [rid, mapping] of Object.entries(propertyMapping)) {\n if (mapping.type === \"editOnly\") {\n editOnlyRids.add(rid);\n }\n }\n }\n }\n return editOnlyRids;\n}\n\n/**\n * Extract non-edit-only properties from ObjectTypeBlockDataV2.\n */\nexport function getNonEditOnlyProperties(objectTypeBlockData) {\n const editOnlyRids = getEditOnlyPropertyRids(objectTypeBlockData.datasources);\n return Object.entries(objectTypeBlockData.objectType.propertyTypes).filter(([rid]) => !editOnlyRids.has(rid)).map(([_, prop]) => prop);\n}\n/**\n * Shared logic to generate a STATIC_DATASET BlockGeneratorResult from a list of columns.\n * Used by both object type and link type backing dataset generators.\n */\nasync function generateBackingDatasetBlock(datasetName, blockIdentifier, dirSuffix, columns, buildDir, randomnessKey) {\n // Build output shapes\n const outputs = {};\n const datasourceReadableId = ReadableIdGenerator.getForDatasetOutput(datasetName);\n const columnReadableIds = columns.map(col => ReadableIdGenerator.getForDatasetColumnOutput(datasetName, col.name));\n const datasourceBlockInternalId = toBlockShapeId(datasourceReadableId, randomnessKey);\n\n // tabularDatasource output shape\n outputs[datasourceReadableId] = {\n type: \"tabularDatasource\",\n tabularDatasource: {\n about: {\n fallbackTitle: blockIdentifier,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n schema: columnReadableIds.map(id => toBlockShapeId(id, randomnessKey)),\n type: \"DATASET\",\n buildRequirements: {\n isBuildable: false\n }\n }\n };\n\n // datasourceColumn output shapes\n for (let i = 0; i < columns.length; i++) {\n const col = columns[i];\n const colReadableId = columnReadableIds[i];\n outputs[colReadableId] = {\n type: \"datasourceColumn\",\n datasourceColumn: {\n about: {\n fallbackTitle: col.name,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n type: {\n type: \"concrete\",\n concrete: typeToConcreteDataType(col.type)\n },\n datasource: datasourceBlockInternalId,\n typeclasses: []\n }\n };\n }\n\n // Generate internal IDs for block-data.json columns.\n // These are distinct from the block shape IDs that appear in the manifest outputs.\n // The add-on maps these internal IDs -> block shape IDs.\n const columnInternalIds = columns.map(col => toBlockShapeId(`column-internal-${datasetName}-${col.name}`, randomnessKey));\n const compassReadableId = `${blockIdentifier}-compass-resource`;\n const compassBlockShapeId = toBlockShapeId(compassReadableId, randomnessKey);\n const datasourceInternalId = toBlockShapeId(`datasource-internal-${datasetName}`, randomnessKey);\n const locationInternalId = toBlockShapeId(`location-internal-${datasetName}`, randomnessKey);\n const addOnOverride = {\n idToBlockShapeId: {\n \"dataset-internal-shape-id\": datasourceBlockInternalId,\n [datasourceInternalId]: datasourceBlockInternalId,\n [locationInternalId]: compassBlockShapeId,\n ...Object.fromEntries(columnInternalIds.map((internalId, i) => [internalId, toBlockShapeId(columnReadableIds[i], randomnessKey)]))\n },\n idToInputGroupId: {},\n outputToLocationInput: {\n [datasourceBlockInternalId]: compassBlockShapeId\n }\n };\n\n // Create block data directory\n const dsBlockDataDir = path.join(buildDir, `temp_block_data_${dirSuffix}`);\n await fs.promises.mkdir(dsBlockDataDir, {\n recursive: true\n });\n\n // Write schema.json\n const schemaJson = {\n fieldSchemaList: columns.map(col => typeToFieldSchema(col.type, col.name)),\n primaryKey: null,\n dataFrameReaderClass: \"com.palantir.foundry.spark.input.ParquetDataFrameReader\",\n customMetadata: {\n format: \"parquet\",\n options: {}\n }\n };\n await fs.promises.writeFile(path.join(dsBlockDataDir, \"schema.json\"), JSON.stringify(schemaJson, null, 2));\n\n // Write block-data.json — column keys are the internal IDs mapped in the add-on\n const blockDataJson = {\n type: \"v1\",\n v1: {\n columns: Object.fromEntries(columns.map((col, i) => [columnInternalIds[i], col.name])),\n hasSchema: true\n }\n };\n await fs.promises.writeFile(path.join(dsBlockDataDir, \"block-data.json\"), JSON.stringify(blockDataJson, null, 2));\n\n // Write VERSION\n await fs.promises.writeFile(path.join(dsBlockDataDir, \"VERSION\"), '\"1\"');\n\n // Write empty files.zip\n // An empty zip file is just the end-of-central-directory record (22 bytes)\n const emptyZip = Buffer.from([0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);\n await fs.promises.writeFile(path.join(dsBlockDataDir, \"files.zip\"), emptyZip);\n\n // Build inputs (compassResource for install location)\n const inputs = {};\n const input_shape_metadata = {};\n inputs[compassReadableId] = {\n type: \"compassResource\",\n compassResource: {\n about: {\n fallbackTitle: blockIdentifier,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n allowedTypes: [],\n typeConstraints: [{\n type: \"compassFolderTypeConstraints\",\n compassFolderTypeConstraints: {\n constraints: [\"INSTALL_LOCATION\"]\n }\n }]\n }\n };\n input_shape_metadata[compassReadableId] = {\n isOptional: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n isAccessedInReconcile: true\n };\n return {\n block_identifier: blockIdentifier,\n block_data_directory: dsBlockDataDir,\n oci_block_data_metadata: undefined,\n maven_block_data_metadata: undefined,\n inputs,\n outputs,\n input_mapping_entries: [],\n external_recommendations: [],\n add_on_override: addOnOverride,\n input_shape_metadata,\n block_type: \"STATIC_DATASET\"\n };\n}\n\n/**\n * Generate a backing datasource BlockGeneratorResult for an object type.\n */\n// TODO(oxc type-aware): the type-aware typescript/require-await rule does not flag this (it returns a Promise); remove this disable once type-aware linting is enabled.\n// oxlint-disable-next-line require-await -- intentionally async: returns a Promise to satisfy its declared/contract type; no await needed\nexport async function generateBackingDatasetBlockResult(objectTypeBlockData, buildDir, randomnessKey) {\n const apiName = objectTypeBlockData.objectType.apiName;\n const nonEditOnlyProps = getNonEditOnlyProperties(objectTypeBlockData);\n const columns = nonEditOnlyProps.map(prop => ({\n name: prop.apiName,\n type: prop.type\n }));\n return generateBackingDatasetBlock(apiName, `${apiName}-backing-ds`, `${apiName}_backing_ds`, columns, buildDir, randomnessKey);\n}\n\n/**\n * Generate a backing datasource BlockGeneratorResult for a many-to-many link type.\n */\n// TODO(oxc type-aware): the type-aware typescript/require-await rule does not flag this (it returns a Promise); remove this disable once type-aware linting is enabled.\n// oxlint-disable-next-line require-await -- intentionally async: returns a Promise to satisfy its declared/contract type; no await needed\nexport async function generateBackingDatasetBlockResultForLink(linkTypeBlockData, linkApiName, objectTypes, buildDir, randomnessKey) {\n const definition = linkTypeBlockData.linkType.definition;\n if (definition.type !== \"manyToMany\") {\n throw new Error(`Link type \"${linkApiName}\" is not a many-to-many link type`);\n }\n const m2m = definition.manyToMany;\n const datasource = linkTypeBlockData.datasources[0]?.datasource;\n if (!datasource || datasource.type !== \"dataset\") {\n throw new Error(`Link type \"${linkApiName}\" does not have a dataset datasource`);\n }\n const ds = datasource.dataset;\n\n // Extract column names and PK RIDs from the datasource mappings\n const pkRidA = Object.keys(ds.objectTypeAPrimaryKeyMapping)[0];\n const columnA = Object.values(ds.objectTypeAPrimaryKeyMapping)[0];\n const pkRidB = Object.keys(ds.objectTypeBPrimaryKeyMapping)[0];\n const columnB = Object.values(ds.objectTypeBPrimaryKeyMapping)[0];\n\n // Resolve column types from the referenced object types\n const objectTypeA = objectTypes[m2m.objectTypeRidA];\n const objectTypeB = objectTypes[m2m.objectTypeRidB];\n if (!objectTypeA || !objectTypeB) {\n throw new Error(`Could not find object types for link \"${linkApiName}\"`);\n }\n const propTypeA = objectTypeA.objectType.propertyTypes[pkRidA]?.type;\n const propTypeB = objectTypeB.objectType.propertyTypes[pkRidB]?.type;\n if (!propTypeA || !propTypeB) {\n throw new Error(`Could not find primary key property types for link \"${linkApiName}\"`);\n }\n\n // Dataset name must match what convertLink.ts registered with generateDatasetLocator\n return generateBackingDatasetBlock(`link.${linkApiName}`, `${linkApiName}-link-backing-ds`, `${linkApiName}_link_backing_ds`, [{\n name: columnA,\n type: propTypeA\n }, {\n name: columnB,\n type: propTypeB\n }], buildDir, randomnessKey);\n}","/*\n * Copyright 2026 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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { typeToConcreteDataType } from \"../conversion/toMarketplace/typeVisitors.js\";\nimport { ReadableIdGenerator } from \"../util/generateRid.js\";\nimport { toBlockShapeId } from \"./marketplaceSerialization/CodeBlockSpec.js\";\nconst DIRECT_SOURCE_INTERNAL_SHAPE_ID = \"direct-source-internal-shape-id\";\nfunction getColumnName(mapping) {\n if (mapping.type === \"column\") return mapping.column;\n if (mapping.type === \"struct\") return mapping.struct.column;\n throw new Error(\"Error extracting column shapes\");\n}\nfunction getDirectDatasource(objectType) {\n for (const datasource of objectType.datasources) {\n if (datasource.datasource.type === \"direct\") {\n return datasource.datasource.direct;\n }\n }\n return undefined;\n}\n\n/**\n * Generate the DIRECT_DATASOURCE block paired with an ontology object's\n * direct datasource input shapes.\n */\nexport async function generateDirectDatasourceBlockResult(objectType, buildDir, randomnessKey) {\n const directDatasource = getDirectDatasource(objectType);\n if (directDatasource === undefined) return undefined;\n const objectTypeApiName = objectType.objectType.apiName;\n if (objectTypeApiName == null) {\n throw new Error(\"Direct datasource object type is missing an API name\");\n }\n const consumedDatasourceReadableId = ReadableIdGenerator.getForDataset(objectTypeApiName);\n const producedDatasourceReadableId = ReadableIdGenerator.getProducedReadableId(consumedDatasourceReadableId);\n const producedDatasourceBlockShapeId = toBlockShapeId(producedDatasourceReadableId, randomnessKey);\n const columnOutputs = {};\n const blockData = {};\n const producedColumnReadableIds = [];\n const seenColumnNames = new Set();\n for (const [propertyTypeRid, mapping] of Object.entries(directDatasource.propertyMapping)) {\n const columnName = getColumnName(mapping);\n if (seenColumnNames.has(columnName)) {\n throw new Error(`Duplicate direct datasource column '${columnName}'`);\n }\n seenColumnNames.add(columnName);\n const propertyType = objectType.objectType.propertyTypes[propertyTypeRid];\n if (propertyType === undefined) {\n throw new Error(`No property type found for direct datasource mapping '${propertyTypeRid}'`);\n }\n const consumedColumnReadableId = ReadableIdGenerator.getForDatasetColumn(objectTypeApiName, columnName);\n const producedColumnReadableId = ReadableIdGenerator.getProducedReadableId(consumedColumnReadableId);\n producedColumnReadableIds.push(producedColumnReadableId);\n blockData[producedColumnReadableId] = columnName;\n columnOutputs[producedColumnReadableId] = {\n type: \"datasourceColumn\",\n datasourceColumn: {\n about: {\n fallbackTitle: propertyType.displayMetadata.displayName,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n type: {\n type: \"concrete\",\n concrete: typeToConcreteDataType(propertyType.type)\n },\n datasource: producedDatasourceBlockShapeId,\n typeclasses: []\n }\n };\n }\n const outputs = {\n [producedDatasourceReadableId]: {\n type: \"tabularDatasource\",\n tabularDatasource: {\n about: {\n fallbackTitle: producedDatasourceReadableId,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n type: \"DATASET\",\n schema: producedColumnReadableIds.map(readableId => toBlockShapeId(readableId, randomnessKey))\n }\n },\n ...columnOutputs\n };\n const idToBlockShapeId = Object.fromEntries(Object.keys(outputs).map(readableId => [readableId, toBlockShapeId(readableId, randomnessKey)]));\n idToBlockShapeId[DIRECT_SOURCE_INTERNAL_SHAPE_ID] = producedDatasourceBlockShapeId;\n const blockDataDirectory = path.join(buildDir, `temp_direct_datasource_${objectType.objectType.id}`);\n await fs.promises.mkdir(blockDataDirectory, {\n recursive: true\n });\n await fs.promises.writeFile(path.join(blockDataDirectory, \"block-data.json\"), JSON.stringify(blockData, null, 2));\n await fs.promises.writeFile(path.join(blockDataDirectory, \"VERSION\"), JSON.stringify(\"1.0\"));\n return {\n block_identifier: `direct-datasource-${objectType.objectType.rid}`,\n block_data_directory: blockDataDirectory,\n inputs: {},\n outputs,\n input_mapping_entries: [],\n external_recommendations: [],\n add_on_override: {\n idToBlockShapeId,\n idToInputGroupId: {},\n outputToLocationInput: {}\n },\n input_shape_metadata: {},\n block_type: \"DIRECT_DATASOURCE\"\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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { typeToMarketplaceBaseType } from \"../conversion/toMarketplace/typeVisitors.js\";\nimport { ReadableIdGenerator } from \"../util/generateRid.js\";\n/**\n * Generates a BlockGeneratorResult for each value type entry in the IR.\n * Port of Java's ValueTypesBlockGenerator.\n */\nexport async function generateValueTypeBlockResults(bulkValueTypeBlockData, buildDir) {\n const results = [];\n for (const entry of bulkValueTypeBlockData) {\n const blockIdentifier = \"value-type-\" + entry.metadata.apiName;\n const outputDir = path.join(buildDir, blockIdentifier);\n if (!fs.existsSync(outputDir)) {\n await fs.promises.mkdir(outputDir, {\n recursive: true\n });\n }\n await fs.promises.writeFile(path.join(outputDir, \"value-types.json\"), JSON.stringify(entry, null, 2));\n const outputs = buildOutputShapes(entry);\n results.push({\n block_identifier: blockIdentifier,\n block_data_directory: outputDir,\n oci_block_data_metadata: undefined,\n maven_block_data_metadata: undefined,\n inputs: {},\n outputs: Object.fromEntries(outputs),\n input_mapping_entries: [],\n external_recommendations: [],\n add_on_override: undefined,\n input_shape_metadata: {},\n block_type: \"VALUE_TYPE\"\n });\n }\n return results;\n}\nfunction buildOutputShapes(entry) {\n const outputs = new Map();\n for (const version of entry.versions) {\n const readableId = ReadableIdGenerator.getForProducedValueType(entry.metadata.apiName, version.version);\n outputs.set(readableId, {\n type: \"valueType\",\n valueType: {\n about: {\n fallbackTitle: entry.metadata.displayMetadata.displayName,\n fallbackDescription: entry.metadata.displayMetadata.description ?? \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n baseType: typeToMarketplaceBaseType(version.baseType)\n }\n });\n }\n return outputs;\n}\n\n/**\n * Compute internal value type recommendations.\n */\nexport function getValueTypeInternalMappings(producedValueTypes, inputShapes) {\n const mappings = [];\n for (const entry of producedValueTypes) {\n for (const version of entry.versions) {\n const consumedId = ReadableIdGenerator.getForConsumedValueType(entry.metadata.apiName, version.version);\n if (inputShapes.has(consumedId)) {\n const producedId = ReadableIdGenerator.getForProducedValueType(entry.metadata.apiName, version.version);\n mappings.push({\n input: consumedId,\n output: producedId\n });\n }\n }\n }\n return mappings;\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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { OntologyBlockDataToFullMetadataConverter, OntologyIrToFullMetadataConverter } from \"@osdk/generator-converters.ontologyir\";\nimport { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\nimport { cleanAndValidateLinkTypeId } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineOntologyV2 } from \"../api/defineOntologyV2.js\";\nimport { getExternalRecommendations } from \"../conversion/toMarketplace/RecommendationUtils.js\";\nimport { ReadableIdGenerator } from \"../util/generateRid.js\";\nimport { generateBackingDatasetBlockResult, generateBackingDatasetBlockResultForLink, getNonEditOnlyProperties } from \"./generateBackingDataset.js\";\nimport { generateDirectDatasourceBlockResult } from \"./generateDirectDatasource.js\";\nimport { generateValueTypeBlockResults, getValueTypeInternalMappings } from \"./generateValueTypeBlockResults.js\";\nconst apiNamespaceRegex = /^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$/u;\nconst uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;\nexport default async function main(args = process.argv) {\n consola.log(\"Generating BlockGeneratorResult for ontology...\");\n const commandLineOpts = await yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({\n input: {\n alias: \"i\",\n describe: \"Input file\",\n type: \"string\",\n default: \".ontology/ontology.ts\",\n coerce: path.resolve\n },\n output: {\n alias: \"o\",\n describe: \"Output file for ontology BlockGeneratorResult JSON\",\n type: \"string\",\n default: \"build/block_generator_result.json\",\n coerce: path.resolve\n },\n valueTypesOutput: {\n describe: \"Output file for value types BlockGeneratorResult JSON\",\n type: \"string\",\n default: \"build/value_types_block_generator_result.json\",\n coerce: path.resolve\n },\n apiNamespace: {\n describe: \"Api name prefix for namespaced ontology types\",\n type: \"string\",\n default: \"\"\n },\n buildDir: {\n alias: \"b\",\n describe: \"Directory for build files\",\n type: \"string\",\n default: \"build/\",\n coerce: path.resolve\n },\n codegenDir: {\n alias: \"c\",\n describe: \"Output directory for generated TypeScript files (defaults to the parent of the input file's directory)\",\n type: \"string\",\n coerce: path.resolve\n },\n temporaryBlockDataFile: {\n alias: \"f\",\n describe: \"Path to a previously generated block data file. Supplying this field indicates that function backed actions should be generated\",\n type: \"string\",\n coerce: path.resolve\n },\n functionsDir: {\n type: \"string\",\n coerce: path.resolve\n },\n nodeModulesDir: {\n type: \"string\",\n coerce: path.resolve\n },\n functionsIrOutputFile: {\n type: \"string\",\n coerce: path.resolve\n },\n randomnessKey: {\n describe: \"Value used to assure uniqueness of entities\",\n type: \"string\"\n },\n \"import-json\": {\n describe: \"Path to imported ontology metadata produced by 'foundry import ontology'\",\n type: \"string\",\n coerce: path.resolve\n }\n }).parseAsync();\n let apiNamespace = \"\";\n if (commandLineOpts.apiNamespace.length !== 0) {\n apiNamespace = commandLineOpts.apiNamespace.slice(-1) !== \".\" ? commandLineOpts.apiNamespace + \".\" : commandLineOpts.apiNamespace;\n !(apiNamespace.length < 1024) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is too long.\") : invariant(false) : void 0;\n !apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$\") : invariant(false) : void 0;\n }\n consola.info(`Loading ontology from ${commandLineOpts.input}`);\n if (commandLineOpts.randomnessKey !== undefined) {\n !uuidRegex.test(commandLineOpts.randomnessKey) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Supplied randomness key is not a uuid and shouldn't be used as a uniqueness guarantee\") : invariant(false) : void 0;\n }\n let functionsIrFile;\n if (commandLineOpts.temporaryBlockDataFile) {\n consola.info(`Loading temporary block data from ${commandLineOpts.temporaryBlockDataFile}`);\n const fileContent = await fs.promises.readFile(commandLineOpts.temporaryBlockDataFile, \"utf-8\");\n let blockDataJson;\n try {\n blockDataJson = JSON.parse(fileContent);\n } catch {\n consola.error(`Failed to parse JSON from ${commandLineOpts.temporaryBlockDataFile}`);\n process.exit(1);\n }\n const previewMetadata = PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData(blockDataJson);\n !(commandLineOpts.functionsDir && commandLineOpts.nodeModulesDir) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"functionsDir and nodeModulesDir must be supplied when using temporaryBlockDataFile\") : invariant(false) : void 0;\n await OntologyIrToFullMetadataConverter.discoverTypeScriptFunctions(commandLineOpts.functionsDir, commandLineOpts.nodeModulesDir, commandLineOpts.functionsIrOutputFile, previewMetadata);\n functionsIrFile = commandLineOpts.functionsIrOutputFile;\n consola.info(`Discovered functions during block data generation at ${commandLineOpts.functionsIrOutputFile}`);\n }\n\n // Default the codegen output directory to the parent of the input file's directory.\n const codegenDir = commandLineOpts.codegenDir ?? path.dirname(path.dirname(commandLineOpts.input));\n const dependencyFile = path.join(commandLineOpts.buildDir, \"dependencies.json\");\n if (!fs.existsSync(dependencyFile)) {\n await fs.promises.mkdir(commandLineOpts.buildDir, {\n recursive: true\n });\n }\n const importedLinkTypeIdsByApiName = commandLineOpts.importJson && fs.existsSync(commandLineOpts.importJson) ? getImportedLinkTypeIdsByApiName(JSON.parse(await fs.promises.readFile(commandLineOpts.importJson, \"utf-8\"))) : undefined;\n const {\n ontologyIr,\n shapes,\n importedInputPresets,\n backingDatasourceApiNames,\n backingDatasourceLinkApiNames\n } = await loadOntology(commandLineOpts.input, apiNamespace, codegenDir, dependencyFile, functionsIrFile, commandLineOpts.randomnessKey, importedLinkTypeIdsByApiName);\n\n // Create temp directory for block data\n const blockDataDir = path.join(commandLineOpts.buildDir, \"temp_block_data\");\n if (!fs.existsSync(blockDataDir)) {\n await fs.promises.mkdir(blockDataDir, {\n recursive: true\n });\n }\n\n // Write ontology.json to the block data directory\n const ontologyJsonPath = path.join(blockDataDir, \"ontology.json\");\n const ontologyJson = JSON.stringify(ontologyIr.ontology, null, 2);\n await fs.promises.writeFile(ontologyJsonPath, ontologyJson);\n consola.info(`Wrote ontology.json to ${ontologyJsonPath}`);\n const importedMetadata = OntologyBlockDataToFullMetadataConverter.getFullMetadataFromBlockData(ontologyIr.importedOntology, undefined, ontologyIr.transitiveImportedOntology);\n const directlyImportedInterfaceTypes = Object.values(ontologyIr.importedOntology.interfaceTypes).map(({\n interfaceType\n }) => interfaceType.apiName);\n const importedMetadataPath = path.join(commandLineOpts.buildDir, \"oac-imported-metadata.json\");\n await fs.promises.writeFile(importedMetadataPath, JSON.stringify({\n ...importedMetadata,\n directlyImportedInterfaceTypes\n }, null, 2));\n consola.info(`Wrote oac-imported-metadata.json to ${importedMetadataPath}`);\n let valueTypeResults = [];\n if (ontologyIr.valueTypes.length > 0) {\n valueTypeResults = await generateValueTypeBlockResults(ontologyIr.valueTypes, commandLineOpts.buildDir);\n }\n const directDatasourceGeneratorResults = (await Promise.all(Object.values(ontologyIr.ontology.objectTypes).map(objectType => generateDirectDatasourceBlockResult(objectType, commandLineOpts.buildDir, commandLineOpts.randomnessKey)))).filter(result => result !== undefined);\n\n // Collect input_mapping_entries for the ontology block\n // These map ontology inputs to datasource block outputs for objects with includeEmptyBackingDatasource\n const ontologyInputMappingEntries = shapes.inputMappings;\n for (const apiName of backingDatasourceApiNames) {\n const objectTypeBlockData = findObjectTypeByApiName(ontologyIr.ontology.objectTypes, apiName);\n if (!objectTypeBlockData) continue;\n const nonEditOnlyProps = getNonEditOnlyProperties(objectTypeBlockData);\n\n // The ontology block has inputs with these readable IDs (from shape extraction)\n // Map them to the datasource block's outputs (which use the same readable IDs)\n const inputDatasetReadableId = ReadableIdGenerator.getForDataset(apiName);\n const outputDatasetReadableId = ReadableIdGenerator.getForDatasetOutput(apiName);\n if (shapes.inputShapes.has(inputDatasetReadableId)) {\n ontologyInputMappingEntries.push({\n input: inputDatasetReadableId,\n output: outputDatasetReadableId\n });\n }\n for (const prop of nonEditOnlyProps) {\n const colInputReadableId = ReadableIdGenerator.getForDatasetColumn(apiName, prop.apiName);\n const getForDatasetColumnOutput = ReadableIdGenerator.getForDatasetColumnOutput(apiName, prop.apiName);\n if (shapes.inputShapes.has(colInputReadableId)) {\n ontologyInputMappingEntries.push({\n input: colInputReadableId,\n output: getForDatasetColumnOutput\n });\n }\n }\n }\n\n // Collect input_mapping_entries for link types with includeEmptyBackingDatasource\n for (const linkApiName of backingDatasourceLinkApiNames) {\n const linkTypeBlockData = findLinkTypeByApiName(ontologyIr.ontology.linkTypes, linkApiName);\n if (!linkTypeBlockData) continue;\n const datasetName = `link.${linkApiName}`;\n\n // Map tabularDatasource\n const inputDsId = ReadableIdGenerator.getForDataset(datasetName);\n const outputDsId = ReadableIdGenerator.getForDatasetOutput(datasetName);\n if (shapes.inputShapes.has(inputDsId)) {\n ontologyInputMappingEntries.push({\n input: inputDsId,\n output: outputDsId\n });\n }\n\n // Map columns from the datasource\n const ds = linkTypeBlockData.datasources[0]?.datasource;\n if (ds?.type === \"dataset\") {\n const columnNames = [...Object.values(ds.dataset.objectTypeAPrimaryKeyMapping).map(String), ...Object.values(ds.dataset.objectTypeBPrimaryKeyMapping).map(String)];\n for (const colName of columnNames) {\n const colInputId = ReadableIdGenerator.getForDatasetColumn(datasetName, colName);\n const colOutputId = ReadableIdGenerator.getForDatasetColumnOutput(datasetName, colName);\n if (shapes.inputShapes.has(colInputId)) {\n ontologyInputMappingEntries.push({\n input: colInputId,\n output: colOutputId\n });\n }\n }\n }\n }\n ontologyInputMappingEntries.push(...getValueTypeInternalMappings(ontologyIr.valueTypes, shapes.inputShapes));\n\n // Generate backing datasource BlockGeneratorResults for objects with includeEmptyBackingDatasource\n const backingDsGeneratorResults = await Promise.all(backingDatasourceApiNames.filter(apiName => {\n const objectTypeBlockData = findObjectTypeByApiName(ontologyIr.ontology.objectTypes, apiName);\n return objectTypeBlockData !== undefined;\n }).map(async apiName => {\n const objectTypeBlockData = findObjectTypeByApiName(ontologyIr.ontology.objectTypes, apiName);\n consola.info(`Generating backing datasource BlockGeneratorResult for ${apiName}...`);\n return await generateBackingDatasetBlockResult(objectTypeBlockData, commandLineOpts.buildDir, commandLineOpts.randomnessKey);\n }));\n\n // Generate backing datasource BlockGeneratorResults for link types with includeEmptyBackingDatasource\n const backingDsLinkGeneratorResults = await Promise.all(backingDatasourceLinkApiNames.map(linkApiName => {\n const linkTypeBlockData = findLinkTypeByApiName(ontologyIr.ontology.linkTypes, linkApiName);\n if (!linkTypeBlockData) return undefined;\n consola.info(`Generating backing datasource BlockGeneratorResult for link ${linkApiName}...`);\n return generateBackingDatasetBlockResultForLink(linkTypeBlockData, linkApiName, ontologyIr.ontology.objectTypes, commandLineOpts.buildDir, commandLineOpts.randomnessKey);\n }).filter(p => p !== undefined));\n\n // Create BlockGeneratorResult\n const blockGeneratorResult = {\n block_identifier: \"ontology\",\n block_data_directory: blockDataDir,\n oci_block_data_metadata: undefined,\n maven_block_data_metadata: undefined,\n inputs: Object.fromEntries(shapes.inputShapes),\n input_presets: Object.fromEntries(importedInputPresets),\n outputs: Object.fromEntries(shapes.outputShapes),\n input_mapping_entries: ontologyInputMappingEntries,\n external_recommendations: getExternalRecommendations(ontologyIr.importedOntology, ontologyIr.valueTypes, ontologyIr.importedValueTypes, shapes.inputShapes),\n add_on_override: undefined,\n input_shape_metadata: Object.fromEntries(shapes.inputShapeMetadata),\n block_type: \"ONTOLOGY\"\n };\n\n // Write BlockGeneratorResult to output file\n const blockGeneratorResultJson = JSON.stringify([blockGeneratorResult, ...directDatasourceGeneratorResults, ...backingDsGeneratorResults, ...backingDsLinkGeneratorResults, ...valueTypeResults], null, 2);\n await fs.promises.writeFile(commandLineOpts.output, blockGeneratorResultJson);\n consola.success(`BlockGeneratorResult written to ${commandLineOpts.output}`);\n consola.info(`Block data directory: ${blockDataDir}`);\n if (valueTypeResults.length > 0) {\n const valueTypeResultsJson = JSON.stringify(valueTypeResults, null, 2);\n await fs.promises.writeFile(commandLineOpts.valueTypesOutput, valueTypeResultsJson);\n consola.success(`Value type BlockGeneratorResult written to ${commandLineOpts.valueTypesOutput}`);\n }\n}\nasync function loadOntology(input, apiNamespace, outputDir, dependencyFile, functionsIrFile, randomnessKey, importedLinkTypeIdsByApiName) {\n const result = await defineOntologyV2(apiNamespace, async () => await import(pathToFileURL(input).href), outputDir, dependencyFile, functionsIrFile, randomnessKey, importedLinkTypeIdsByApiName);\n return result;\n}\nfunction getImportedLinkTypeIdsByApiName(metadata) {\n const result = {};\n for (const objectType of Object.values(metadata.objectTypes)) {\n for (const linkType of objectType.linkTypes) {\n const linkTypeId = metadata.linkTypeIdsByRid?.[linkType.linkTypeRid];\n if (linkTypeId !== undefined) {\n result[cleanAndValidateLinkTypeId(linkType.apiName)] = linkTypeId;\n }\n }\n }\n return result;\n}\n\n/**\n * Find an ObjectTypeBlockDataV2 by apiName within the ontology block data.\n */\nfunction findObjectTypeByApiName(objectTypes, apiName) {\n return Object.values(objectTypes).find(objectTypeBlockData => objectTypeBlockData.objectType.apiName === apiName);\n}\n\n/**\n * Find a LinkTypeBlockDataV2 by apiName within the ontology block data.\n */\nfunction findLinkTypeByApiName(linkTypes, apiName) {\n const linkTypeId = cleanAndValidateLinkTypeId(apiName);\n return Object.values(linkTypes).find(lt => lt.linkType.id === linkTypeId);\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 { convertToDisplayName, convertToPluralDisplayName, importOntologyEntity, OntologyEntityTypeEnum } from \"@osdk/maker\";\n/*\n * Takes in the minimal object definition to create an input shape.\n * First converts it to fake block data to call importOntologyEntity,\n * then converts it to an OntologyIrImportedObjectType that is safe to use elsewhere.\n */\nexport function defineImportObject(objectDef) {\n const properties = Object.entries(objectDef.properties ?? {}).map(([apiName, type]) => ({\n apiName: apiName,\n displayName: type.displayName ?? convertToDisplayName(apiName),\n description: type.description,\n type: type.type\n }));\n const finalObject = {\n apiName: objectDef.apiName,\n properties: properties,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n // the rest don't matter for now\n displayName: objectDef.displayName ?? convertToDisplayName(objectDef.apiName),\n description: objectDef.description,\n pluralDisplayName: convertToPluralDisplayName(objectDef.apiName),\n primaryKeyPropertyApiName: properties[0]?.apiName,\n titlePropertyApiName: properties[0]?.apiName\n };\n importOntologyEntity(finalObject);\n return finalObject;\n}","/*\n * Copyright 2026 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 { defineAction, kebab } from \"@osdk/maker\";\nexport function defineFunctionBackedAction(def) {\n const actionApiName = def.apiName ?? `function-action-${kebab(def.functionApiName)}`;\n return defineAction({\n apiName: def.apiName ?? `${def.functionApiName.toLowerCase()}-action`,\n displayName: def.displayName ?? `Function action ${def.functionApiName}`,\n description: def.description,\n rules: [{\n type: \"functionRule\",\n functionRule: {\n // delegate this to conversion step\n functionRid: def.functionApiName,\n functionInputValues: {},\n functionVersion: \"0.1.0\"\n }\n }],\n status: def.status ?? \"active\",\n ...{\n validation: [{\n condition: {\n type: \"true\",\n true: {}\n },\n displayMetadata: {\n failureMessage: \"Validation failed\",\n typeClasses: []\n }\n }]\n }\n });\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/conversion/toMarketplace/structActionParameterUtils.ts","../../src/conversion/toMarketplace/convertActionParameters.ts","../../src/conversion/toMarketplace/convertActionSections.ts","../../src/conversion/toMarketplace/convertConditionDefinition.ts","../../src/conversion/toMarketplace/convertActionParameterConditionalOverride.ts","../../src/conversion/toMarketplace/convertActionVisibility.ts","../../src/conversion/toMarketplace/convertSectionConditionalOverride.ts","../../src/conversion/toMarketplace/convertActionValidation.ts","../../src/conversion/toMarketplace/convertDatasourceDefinition.ts","../../src/conversion/toMarketplace/convertNullabilityToDataConstraint.ts","../../src/conversion/toMarketplace/convertValueType.ts","../../src/conversion/toMarketplace/convertDataConstraintToDataConstraints.ts","../../src/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.ts","../../src/conversion/toMarketplace/convertValueTypeDataConstraints.ts","../../src/conversion/toConjure/distributeTypeHelper.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts","../../src/conversion/toMarketplace/convertObjectPropertyType.ts","../../src/conversion/toMarketplace/convertObject.ts","../../src/conversion/toMarketplace/getFormContentOrdering.ts","../../src/conversion/toMarketplace/convertActionHelpers.ts","../../src/conversion/toMarketplace/convertSpt.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.ts","../../src/conversion/toMarketplace/convertInterfacePropertyType.ts","../../src/conversion/toMarketplace/convertInterface.ts","../../src/conversion/toMarketplace/convertCardinality.ts","../../src/conversion/toMarketplace/convertLink.ts","../../src/conversion/toMarketplace/typeVisitors.ts","../../src/conversion/toMarketplace/shapeExtractors/LinkTypeShapeExtractor.ts","../../src/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.ts","../../src/conversion/toMarketplace/shapeExtractors/IrShapeExtractor.ts","../../src/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.ts","../../src/conversion/toMarketplace/convertValueTypeToWireBlockData.ts","../../src/conversion/toMarketplace/convertOntologyDefinition.ts","../../src/conversion/toMarketplace/shapeExtractors/ImportedShapeExtractor.ts","../../src/api/defineOntologyV2.ts","../../src/conversion/toMarketplace/RecommendationUtils.ts","../../src/cli/generateBackingDataset.ts","../../src/cli/generateDirectDatasource.ts","../../src/cli/generateValueTypeBlockResults.ts","../../src/cli/main.ts","../../src/api/importObjectType.ts","../../src/api/defineFunctionBackedAction.ts"],"names":["convertToDisplayName","uppercaseFirstLetter","invariant","ReadableIdGenerator","extractAllowedValuesFromActionParameterType","getNamespace","shouldNotHaveRenderHints","hasRenderHints","getPropertyTypeName","shouldBeIndexedForSearch","defaultTypeClasses","convertObjectStatus","isInterfaceSharedPropertyType","withoutNamespace","isExotic","cleanAndValidateLinkTypeId","consola","getOntologyDefinition","isActionParameterTypePrimitive","OntologyEntityTypeEnum","getImportedTypes","shape","createLocalizedAbout","OntologyRidGeneratorImpl","initializeOntologyState","fs","writeStaticObjects","writeDependencyFile","toBlockShapeId","path","fs2","path2","fs3","path3","fs4","yargs","hideBin","path4","fs5","PreviewOntologyIrConverter","OntologyIrToFullMetadataConverter","OntologyBlockDataToFullMetadataConverter","pathToF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AAiB;AAAA;AACnB,KACD,CAAA;AAAA,IACD,MAAA,EAAQ,IAAI,MAAA,IAAU,QAAA;AAAA,IACtB,GAAG;AAAA,MACD,YAAY,CAAC;AAAA,QACX,SAAA,EAAW;AAAA,UACT,IAAA,EAAM,MAAA;AAAA,UACN,MAAM;AAAC,SACT;AAAA,QACA,eAAA,EAAiB;AAAA,UACf,cAAA,EAAgB,mBAAA;AAAA,UAChB,aAAa;AAAC;AAChB,OACD;AAAA;AACH,GACD,CAAA;AACH","file":"index.cjs","sourcesContent":["/*\n * Copyright 2026 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\nexport function getStructFieldTypes(parameter) {\n if (typeof parameter.type === \"string\") {\n return undefined;\n }\n switch (parameter.type.type) {\n case \"struct\":\n return parameter.type.struct.structFieldTypes;\n case \"structList\":\n return parameter.type.structList.structFieldTypes;\n default:\n return undefined;\n }\n}\nexport function getStructFieldActionParameterType(fieldType) {\n return fieldType.type === \"objectReference\" ? fieldType : fieldType.type;\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 { convertToDisplayName } from \"@osdk/maker\";\nimport { getStructFieldTypes } from \"./structActionParameterUtils.js\";\nconst FUNCTIONS_IR_INTERFACE_TYPE_RID_REGEX = /^ri\\.ontology-metadata\\.temp\\.interface-type\\.[0-9a-f]+$/u;\nexport function convertActionParameters(action, ridGenerator) {\n return Object.fromEntries((action.parameters ?? []).map(parameter => {\n let convertedType;\n if (typeof parameter.type === \"string\") {\n // Simple string types like \"string\", \"integer\", etc.\n convertedType = {\n type: parameter.type,\n [parameter.type]: {}\n };\n } else {\n // Complex types that need ObjectTypeId conversion\n switch (parameter.type.type) {\n case \"objectReference\":\n convertedType = {\n type: \"objectReference\",\n objectReference: {\n ...parameter.type.objectReference,\n objectTypeId: ridGenerator.generateObjectTypeId(parameter.type.objectReference.objectTypeId)\n }\n };\n break;\n case \"objectReferenceList\":\n convertedType = {\n type: \"objectReferenceList\",\n objectReferenceList: {\n ...parameter.type.objectReferenceList,\n objectTypeId: ridGenerator.generateObjectTypeId(parameter.type.objectReferenceList.objectTypeId)\n }\n };\n break;\n case \"interfaceReference\":\n convertedType = {\n type: \"interfaceReference\",\n interfaceReference: {\n // the functionsIR uses resolved rids over the wire, so function-backed action\n // interface parameters should be unconverted\n interfaceTypeRid: resolveInterfaceTypeRid(parameter.type.interfaceReference.interfaceTypeRid, ridGenerator)\n }\n };\n break;\n case \"interfaceReferenceList\":\n convertedType = {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: resolveInterfaceTypeRid(parameter.type.interfaceReferenceList.interfaceTypeRid, ridGenerator)\n }\n };\n break;\n case \"objectSetRid\":\n convertedType = {\n type: \"objectSetRid\",\n objectSetRid: {\n objectTypeId: ridGenerator.generateObjectTypeId(parameter.type.objectSetRid.objectTypeId)\n }\n };\n break;\n case \"objectTypeReference\":\n convertedType = {\n type: \"objectTypeReference\",\n objectTypeReference: {}\n };\n break;\n default:\n // Pass through other types unchanged\n convertedType = parameter.type;\n }\n }\n const structFieldsV2 = Object.keys(getStructFieldTypes(parameter) ?? {}).map(apiName => ({\n apiName,\n displayName: parameter.validation.structFieldValidations?.[apiName]?.displayName ?? convertToDisplayName(apiName)\n }));\n return [parameter.id, {\n id: parameter.id,\n rid: ridGenerator.generateRidForParameter(action.apiName, parameter.id),\n type: convertedType,\n displayMetadata: {\n displayName: parameter.displayName,\n description: parameter.description ?? \"\",\n typeClasses: [],\n structFields: {},\n structFieldsV2\n }\n }];\n }));\n}\nexport function resolveInterfaceTypeRid(interfaceTypeRidOrApiName, ridGenerator) {\n return FUNCTIONS_IR_INTERFACE_TYPE_RID_REGEX.test(interfaceTypeRidOrApiName) ? interfaceTypeRidOrApiName : ridGenerator.generateRidForInterface(interfaceTypeRidOrApiName);\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 { uppercaseFirstLetter } from \"@osdk/maker\";\nexport function convertActionSections(action, ridGenerator) {\n return Object.fromEntries(Object.entries(action.sections ?? {}).map(([sectionId, section]) => [sectionId, {\n id: sectionId,\n // TODO: Generate proper RID for section\n rid: ridGenerator.generateSectionRid(sectionId),\n content: section.parameters.map(p => ({\n type: \"parameterId\",\n parameterId: p\n })),\n displayMetadata: {\n collapsedByDefault: section.collapsedByDefault ?? false,\n columnCount: section.columnCount ?? 1,\n description: section.description ?? \"\",\n displayName: section.displayName ?? uppercaseFirstLetter(sectionId),\n showTitleBar: section.showTitleBar ?? true,\n ...(section.style && {\n style: section.style === \"box\" ? {\n type: \"box\",\n box: {}\n } : {\n type: \"minimal\",\n minimal: {}\n }\n })\n }\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 invariant from \"tiny-invariant\";\nexport function convertConditionDefinition(condition, actionParameters) {\n switch (condition.type) {\n case \"and\":\n if (\"conditions\" in condition) {\n return {\n type: \"and\",\n and: {\n conditions: condition.conditions.map(c => convertConditionDefinition(c, actionParameters))\n }\n };\n } else {\n return condition;\n }\n case \"or\":\n if (\"conditions\" in condition) {\n return {\n type: \"or\",\n or: {\n conditions: condition.conditions.map(c => convertConditionDefinition(c, actionParameters))\n }\n };\n } else {\n return condition;\n }\n case \"group\":\n return {\n type: \"comparison\",\n comparison: {\n operator: \"INTERSECTS\",\n left: {\n type: \"userProperty\",\n userProperty: {\n userId: {\n type: \"currentUser\",\n currentUser: {}\n },\n propertyValue: {\n type: \"groupIds\",\n groupIds: {}\n }\n }\n },\n right: {\n type: \"staticValue\",\n staticValue: {\n type: \"stringList\",\n stringList: {\n strings: [condition.name]\n }\n }\n }\n }\n };\n case \"parameter\":\n !actionParameters?.some(param => param.id === condition.parameterId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action parameter condition references unknown parameter ${condition.parameterId}`) : invariant(false) : void 0;\n return {\n type: \"comparison\",\n comparison: {\n operator: \"EQUALS\",\n left: {\n type: \"parameterId\",\n parameterId: condition.parameterId\n },\n right: condition.matches\n }\n };\n default:\n return condition;\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 { extractAllowedValues } from \"./convertActionHelpers.js\";\nimport { convertConditionDefinition } from \"./convertConditionDefinition.js\";\nexport function convertActionParameterConditionalOverride(override, validation, ridGenerator, actionParameters) {\n let parameterBlockOverride;\n switch (override.type) {\n case \"required\":\n parameterBlockOverride = {\n type: \"parameterRequired\",\n parameterRequired: {\n required: validation.required ? {\n type: \"notRequired\",\n notRequired: {}\n } : {\n type: \"required\",\n required: {}\n }\n }\n };\n break;\n case \"visibility\":\n let overrideType = override.then ?? (validation.defaultVisibility === \"editable\" ? \"hidden\" : \"editable\");\n parameterBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: overrideType === \"editable\" ? {\n type: \"editable\",\n editable: {}\n } : overrideType === \"hidden\" ? {\n type: \"hidden\",\n hidden: {}\n } : {\n type: \"disabled\",\n disabled: {}\n }\n }\n };\n break;\n case \"disabled\":\n overrideType = override.then ?? (validation.defaultVisibility === \"editable\" ? \"disabled\" : \"editable\");\n parameterBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: overrideType === \"editable\" ? {\n type: \"editable\",\n editable: {}\n } : overrideType === \"hidden\" ? {\n type: \"hidden\",\n hidden: {}\n } : {\n type: \"disabled\",\n disabled: {}\n }\n }\n };\n break;\n case \"defaultValue\":\n parameterBlockOverride = {\n type: \"prefill\",\n prefill: {\n prefill: override.defaultValue\n }\n };\n break;\n case \"constraint\":\n parameterBlockOverride = {\n type: \"allowedValues\",\n allowedValues: {\n allowedValues: extractAllowedValues(override.constraint, ridGenerator)\n }\n };\n break;\n default:\n throw new Error(`Unknown parameter override type`);\n }\n return {\n condition: convertConditionDefinition(override.condition, actionParameters),\n parameterBlockOverrides: [parameterBlockOverride]\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\nexport function convertActionVisibility(visibility) {\n switch (visibility) {\n case \"editable\":\n return {\n type: \"editable\",\n editable: {}\n };\n case \"disabled\":\n return {\n type: \"disabled\",\n disabled: {}\n };\n case \"hidden\":\n return {\n type: \"hidden\",\n hidden: {}\n };\n default:\n return {\n type: \"editable\",\n editable: {}\n };\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 { convertConditionDefinition } from \"./convertConditionDefinition.js\";\nexport function convertSectionConditionalOverride(override, defaultVisibility, actionParameters) {\n return {\n condition: convertConditionDefinition(override.condition, actionParameters),\n sectionBlockOverrides: [{\n type: \"visibility\",\n visibility: {\n visibility: defaultVisibility === \"visible\" ? {\n type: \"hidden\",\n hidden: {}\n } : {\n type: \"visible\",\n visible: {}\n }\n }\n }]\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 { extractAllowedValuesFromActionParameterType } from \"@osdk/maker\";\nimport { ReadableIdGenerator } from \"../../util/generateRid.js\";\nimport { extractAllowedValues, renderHintFromActionParameterType, renderHintFromBaseType } from \"./convertActionHelpers.js\";\nimport { convertActionParameterConditionalOverride } from \"./convertActionParameterConditionalOverride.js\";\nimport { convertActionVisibility } from \"./convertActionVisibility.js\";\nimport { convertConditionDefinition } from \"./convertConditionDefinition.js\";\nimport { convertSectionConditionalOverride } from \"./convertSectionConditionalOverride.js\";\nimport { getStructFieldActionParameterType, getStructFieldTypes } from \"./structActionParameterUtils.js\";\nconst STRUCT_FIELD_TYPES_SUPPORTING_ONE_OF = new Set([\"boolean\", \"integer\", \"long\", \"double\", \"string\", \"date\", \"timestamp\"]);\n\n// Helper function to recursively scan conditions and register groups\nfunction registerGroupsFromCondition(condition, ridGenerator) {\n if (!condition) return;\n switch (condition.type) {\n case \"group\":\n // Original format (parameter/section conditional overrides)\n if (condition.name) {\n ridGenerator.getGroupIds().put(ReadableIdGenerator.getForGroup(condition.name), condition.name);\n }\n break;\n case \"comparison\":\n // Converted format (action-level validations)\n // Check if this is a group comparison by looking at the left side\n if (condition.comparison?.left?.type === \"userProperty\" && condition.comparison?.left?.userProperty?.propertyValue?.type === \"groupIds\") {\n // Extract group names from the right side\n const strings = condition.comparison?.right?.staticValue?.stringList?.strings;\n if (Array.isArray(strings)) {\n strings.forEach(groupName => {\n ridGenerator.getGroupIds().put(ReadableIdGenerator.getForGroup(groupName), groupName);\n });\n }\n }\n break;\n case \"and\":\n case \"or\":\n // Recursively process nested conditions\n if (condition.conditions) {\n condition.conditions.forEach(c => registerGroupsFromCondition(c, ridGenerator));\n }\n // Handle converted and/or format\n if (condition.and?.conditions) {\n condition.and.conditions.forEach(c => registerGroupsFromCondition(c, ridGenerator));\n }\n if (condition.or?.conditions) {\n condition.or.conditions.forEach(c => registerGroupsFromCondition(c, ridGenerator));\n }\n break;\n\n // Other condition types don't have groups\n }\n}\nexport function convertActionValidation(action, ridGenerator) {\n const validationRules = action.validation ?? [{\n condition: {\n type: \"true\",\n true: {}\n },\n displayMetadata: {\n failureMessage: \"\",\n typeClasses: []\n }\n }];\n const ruleRids = validationRules.map((_, idx) => ridGenerator.generateValidationRuleRid(action.apiName, idx));\n\n // Register groups from action-level validation conditions\n validationRules.forEach(rule => {\n registerGroupsFromCondition(rule.condition, ridGenerator);\n });\n\n // Register groups from parameter conditional overrides\n (action.parameters ?? []).forEach(p => {\n p.validation.conditionalOverrides?.forEach(override => {\n registerGroupsFromCondition(override.condition, ridGenerator);\n });\n Object.values(p.validation.structFieldValidations ?? {}).forEach(structFieldValidation => {\n structFieldValidation.conditionalOverrides?.forEach(override => {\n registerGroupsFromCondition(override.condition, ridGenerator);\n });\n });\n });\n\n // Register groups from section conditional overrides\n Object.values(action.sections ?? {}).forEach(section => {\n section.conditionalOverrides?.forEach(override => {\n registerGroupsFromCondition(override.condition, ridGenerator);\n });\n });\n return {\n actionTypeLevelValidation: {\n // TODO: Add proper ordering of validation rule RIDs\n ordering: ruleRids,\n rules: Object.fromEntries(validationRules.map((rule, idx) => [ruleRids[idx], rule]))\n },\n parameterValidations: Object.fromEntries((action.parameters ?? []).map(p => {\n return [p.id, {\n defaultValidation: {\n display: {\n renderHint: p.renderHint ?? renderHintFromBaseType(p, p.validation),\n visibility: convertActionVisibility(p.validation.defaultVisibility),\n ...(p.defaultValue && {\n prefill: p.defaultValue\n })\n },\n validation: {\n allowedValues: extractAllowedValues(p.validation.allowedValues, ridGenerator),\n required: convertParameterRequirementConstraint(p.validation.required)\n }\n },\n conditionalOverrides: p.validation.conditionalOverrides?.map(override => convertActionParameterConditionalOverride(override, p.validation, ridGenerator, action.parameters)) ?? [],\n structFieldValidations: convertStructFieldValidations(p, ridGenerator, action.parameters)\n }];\n })),\n sectionValidations: {\n ...Object.fromEntries(Object.entries(action.sections ?? {}).map(([sectionId, section]) => [section.id, {\n defaultDisplayMetadata: section.defaultVisibility === \"hidden\" ? {\n visibility: {\n type: \"hidden\",\n hidden: {}\n }\n } : {\n visibility: {\n type: \"visible\",\n visible: {}\n }\n },\n conditionalOverrides: section.conditionalOverrides?.map(override => convertSectionConditionalOverride(override, section.defaultVisibility ?? \"visible\", action.parameters)) ?? []\n }]))\n }\n };\n}\nfunction convertStructFieldValidations(parameter, ridGenerator, actionParameters) {\n const configuredValidations = parameter.validation.structFieldValidations ?? {};\n const structFieldTypes = getStructFieldTypes(parameter);\n if (structFieldTypes === undefined) {\n if (Object.keys(configuredValidations).length > 0) {\n throw new Error(`Parameter ${parameter.id} defines struct field validations but is not a struct parameter`);\n }\n return {};\n }\n validateStructParameterConfiguration(parameter);\n for (const fieldApiName of Object.keys(configuredValidations)) {\n if (structFieldTypes[fieldApiName] === undefined) {\n throw new Error(`Struct field validation ${fieldApiName} does not match a field on parameter ${parameter.id}`);\n }\n }\n return Object.fromEntries(Object.entries(structFieldTypes).map(([fieldApiName, fieldType]) => {\n const configuration = configuredValidations[fieldApiName] ?? {};\n const actionParameterType = getStructFieldActionParameterType(fieldType);\n const allowedValues = configuration.allowedValues ?? extractAllowedValuesFromActionParameterType(actionParameterType);\n validateStructFieldAllowedValues(parameter.id, fieldApiName, fieldType, allowedValues);\n return [fieldApiName, {\n conditionalOverrides: configuration.conditionalOverrides?.map(override => convertStructFieldConditionalOverride(override, configuration, parameter.id, fieldApiName, fieldType, ridGenerator, actionParameters)) ?? [],\n defaultValidation: {\n display: {\n renderHint: configuration.renderHint ?? (allowedValues.type === \"oneOf\" || fieldType.type === \"boolean\" ? {\n type: \"dropdown\",\n dropdown: {}\n } : renderHintFromActionParameterType(actionParameterType, allowedValues, fieldApiName)),\n visibility: convertActionVisibility(configuration.defaultVisibility)\n },\n validation: {\n allowedValues: extractAllowedStructFieldValues(allowedValues, ridGenerator),\n required: convertParameterRequirementConstraint(configuration.required ?? false)\n }\n }\n }];\n }));\n}\nfunction validateStructParameterConfiguration(parameter) {\n if (parameter.validation.allowedValues?.type !== \"struct\") {\n throw new Error(`Struct parameter ${parameter.id} must use struct allowed values`);\n }\n if (parameter.defaultValue !== undefined) {\n throw new Error(`Struct parameter ${parameter.id} cannot define a top-level default value; configure prefills on individual struct fields instead`);\n }\n if (parameter.validation.conditionalOverrides?.some(override => override.type === \"defaultValue\")) {\n throw new Error(`Struct parameter ${parameter.id} cannot define a top-level default value override; configure prefills on individual struct fields instead`);\n }\n}\nfunction validateStructFieldAllowedValues(parameterId, fieldApiName, fieldType, allowedValues) {\n const inferredAllowedValues = extractAllowedValuesFromActionParameterType(getStructFieldActionParameterType(fieldType));\n const isCompatible = allowedValues.type === inferredAllowedValues.type || allowedValues.type === \"oneOf\" && STRUCT_FIELD_TYPES_SUPPORTING_ONE_OF.has(fieldType.type);\n if (!isCompatible) {\n throw new Error(`Allowed values ${allowedValues.type} are not compatible with struct field ${parameterId}.${fieldApiName} of type ${fieldType.type}`);\n }\n}\nfunction extractAllowedStructFieldValues(allowedValues, ridGenerator) {\n const converted = extractAllowedValues(allowedValues, ridGenerator);\n switch (converted.type) {\n case \"oneOf\":\n case \"range\":\n case \"text\":\n case \"datetime\":\n case \"boolean\":\n case \"geohash\":\n case \"geoshape\":\n case \"objectQuery\":\n return converted;\n default:\n throw new Error(`Allowed values ${converted.type} are not supported for struct fields`);\n }\n}\nfunction convertStructFieldConditionalOverride(override, configuration, parameterId, fieldApiName, fieldType, ridGenerator, actionParameters) {\n let structFieldBlockOverride;\n switch (override.type) {\n case \"required\":\n structFieldBlockOverride = {\n type: \"parameterRequired\",\n parameterRequired: {\n required: convertParameterRequirementConstraint(configuration.required !== true)\n }\n };\n break;\n case \"visibility\":\n case \"disabled\":\n structFieldBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: convertActionVisibility(override.then ?? (configuration.defaultVisibility === \"editable\" ? override.type === \"disabled\" ? \"disabled\" : \"hidden\" : \"editable\"))\n }\n };\n break;\n case \"constraint\":\n validateStructFieldAllowedValues(parameterId, fieldApiName, fieldType, override.constraint);\n structFieldBlockOverride = {\n type: \"allowedValues\",\n allowedValues: {\n allowedValues: extractAllowedStructFieldValues(override.constraint, ridGenerator)\n }\n };\n break;\n }\n return {\n condition: convertConditionDefinition(override.condition, actionParameters),\n structFieldBlockOverrides: [structFieldBlockOverride]\n };\n}\nfunction convertParameterRequirementConstraint(required) {\n if (typeof required === \"boolean\") {\n return required ? {\n type: \"required\",\n required: {}\n } : {\n type: \"notRequired\",\n notRequired: {}\n };\n }\n const {\n min,\n max\n } = required.listLength;\n return {\n type: \"listLengthValidation\",\n listLengthValidation: {\n minLength: min,\n maxLength: max\n }\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 invariant from \"tiny-invariant\";\nimport { ReadableIdGenerator } from \"../../util/generateRid.js\";\nexport function convertDatasourceDefinition(objectType, properties, ridGenerator) {\n const baseDatasource = objectType.datasources?.find(ds => [\"dataset\", \"stream\", \"restrictedView\", \"direct\"].includes(ds.type));\n\n // Helper to get column names from properties\n const getColumnNames = props => {\n return new Set(props.map(p => p.apiName));\n };\n switch (baseDatasource?.type) {\n case \"stream\":\n const window = baseDatasource.retentionPeriod ? convertToJavaDurationFormat(baseDatasource.retentionPeriod) : undefined;\n const retentionPolicy = window ? {\n type: \"time\",\n time: {\n window\n }\n } : {\n type: \"none\",\n none: {}\n };\n\n // Use generateStreamLocator instead of generateRid\n const streamLocator = ridGenerator.generateStreamLocator(objectType.apiName, getColumnNames(properties));\n const propertyMapping = Object.fromEntries(properties.map(prop => [ridGenerator.generatePropertyRid(prop.apiName, objectType.apiName), prop.apiName]));\n return {\n type: \"streamV2\",\n streamV2: {\n streamLocator: {\n branchId: streamLocator.branchId,\n streamLocatorRid: streamLocator.streamLocatorRid\n },\n propertyMapping,\n retentionPolicy,\n propertySecurityGroups: undefined\n }\n };\n case \"restrictedView\":\n // Use generateRestrictedViewLocator instead of generateRid\n const restrictedViewLocator = ridGenerator.generateRestrictedViewLocator(objectType.apiName, getColumnNames(properties));\n return {\n type: \"restrictedViewV2\",\n restrictedViewV2: {\n restrictedViewRid: restrictedViewLocator.rid,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator)\n }\n };\n case \"derived\":\n // Use generateLocator for dataset datasources\n const derivedDatasetLocator = ridGenerator.generateDatasetLocator(objectType.apiName, getColumnNames(properties));\n return {\n type: \"datasetV2\",\n datasetV2: {\n branchId: derivedDatasetLocator.branchId,\n datasetRid: derivedDatasetLocator.rid,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator)\n }\n };\n case \"direct\":\n const directDatasourceLocator = ridGenerator.generateDirectDatasourceLocator(objectType.apiName, getColumnNames(properties), \"master\");\n return {\n type: \"direct\",\n direct: {\n directSourceRid: directDatasourceLocator.rid,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator),\n propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName, objectType.apiName, ridGenerator)\n }\n };\n case \"dataset\":\n default:\n // Use generateLocator for dataset datasources\n const datasetLocator = ridGenerator.generateDatasetLocator(objectType.apiName, getColumnNames(properties));\n if (objectType.properties?.some(prop => typeof prop.type === \"object\" && prop.type.type === \"marking\") || baseDatasource?.objectSecurityPolicy || baseDatasource?.propertySecurityGroups) {\n return {\n type: \"datasetV3\",\n datasetV3: {\n datasetRid: datasetLocator.rid,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator),\n branchId: datasetLocator.branchId,\n propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName, objectType.apiName, ridGenerator)\n }\n };\n }\n return {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: datasetLocator.rid,\n branchId: datasetLocator.branchId,\n propertyMapping: buildPropertyMapping(properties, objectType.apiName, ridGenerator)\n }\n };\n }\n}\nfunction convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName, objectTypeApiName, ridGenerator) {\n if (!ds || !(\"objectSecurityPolicy\" in ds) && !(\"propertySecurityGroups\" in ds)) {\n // Default security group - use property RIDs\n const propertyRids = properties.map(prop => ridGenerator.generatePropertyRid(prop.apiName, objectTypeApiName));\n return {\n groups: [{\n properties: propertyRids,\n rid: ridGenerator.generatePropertySecurityGroupRid(\"defaultObjectSecurityPolicy\"),\n security: {\n type: \"granular\",\n granular: {\n viewPolicy: {\n granularPolicyCondition: {\n type: \"and\",\n and: {\n conditions: []\n }\n },\n additionalMandatory: {\n markings: [],\n assumedMarkings: []\n }\n }\n }\n },\n type: {\n type: \"primaryKey\",\n primaryKey: {}\n }\n }]\n };\n }\n const validPropertyNames = new Set(properties.map(prop => prop.apiName));\n const usedPropertyApiNames = new Set();\n\n // Collect and register group IDs (matching Java's collectSecurityGroupIds)\n const collectGroupIds = granularPolicy => {\n if (!granularPolicy) return;\n const collectFromCondition = condition => {\n switch (condition.type) {\n case \"group\":\n // Register group ID with the ridGenerator\n const groupId = condition.name;\n ridGenerator.getGroupIds().put(ReadableIdGenerator.getForGroup(groupId), groupId);\n break;\n case \"and\":\n case \"or\":\n if (\"conditions\" in condition) {\n condition.conditions.forEach(collectFromCondition);\n }\n break;\n }\n };\n collectFromCondition(granularPolicy);\n };\n\n // Collect group IDs from object security policy\n if (ds.objectSecurityPolicy?.granularPolicy) {\n collectGroupIds(ds.objectSecurityPolicy.granularPolicy);\n }\n\n // Validate and collect property security groups\n ds.propertySecurityGroups?.forEach(psg => {\n // Collect group IDs from property security groups\n if (psg.granularPolicy) {\n collectGroupIds(psg.granularPolicy);\n }\n psg.properties.forEach(propertyName => {\n !validPropertyNames.has(propertyName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property \"${propertyName}\" in property security group ${psg.name} does not exist in the properties list`) : invariant(false) : void 0;\n !!usedPropertyApiNames.has(propertyName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property \"${propertyName}\" is used in multiple property security groups`) : invariant(false) : void 0;\n !(propertyName !== primaryKeyPropertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property \"${propertyName}\" in property security group ${psg.name} cannot be the primary key`) : invariant(false) : void 0;\n usedPropertyApiNames.add(propertyName);\n });\n });\n\n // Build property RID mapping\n const propertyApiNameToRid = new Map();\n properties.forEach(prop => {\n propertyApiNameToRid.set(prop.apiName, ridGenerator.generatePropertyRid(prop.apiName, objectTypeApiName));\n });\n const objectSecurityPolicyGroup = {\n rid: ridGenerator.generatePropertySecurityGroupRid(ds.objectSecurityPolicy?.name || \"defaultObjectSecurityPolicy\"),\n security: {\n type: \"granular\",\n granular: convertGranularPolicy(ds.objectSecurityPolicy?.granularPolicy, ds.objectSecurityPolicy?.appliedMarkings, ds.objectSecurityPolicy?.assumedMarkings, ridGenerator, objectTypeApiName)\n },\n type: {\n type: \"primaryKey\",\n primaryKey: {}\n },\n properties: properties.filter(prop => !usedPropertyApiNames.has(prop.apiName)).map(prop => propertyApiNameToRid.get(prop.apiName))\n };\n return {\n groups: [...(ds.propertySecurityGroups?.map(psg => ({\n rid: ridGenerator.generatePropertySecurityGroupRid(psg.name),\n security: {\n type: \"granular\",\n granular: convertGranularPolicy(psg.granularPolicy, psg.appliedMarkings, psg.assumedMarkings, ridGenerator, objectTypeApiName)\n },\n type: {\n type: \"property\",\n property: {\n name: psg.name\n }\n },\n properties: psg.properties.map(apiName => propertyApiNameToRid.get(apiName))\n })) ?? []), objectSecurityPolicyGroup]\n };\n}\nfunction convertGranularPolicy(granularPolicy, appliedMarkings, assumedMarkings, ridGenerator, objectTypeApiName) {\n return {\n viewPolicy: {\n granularPolicyCondition: granularPolicy ? convertSecurityCondition(granularPolicy, ridGenerator, objectTypeApiName) : {\n type: \"and\",\n and: {\n conditions: []\n }\n },\n additionalMandatory: {\n markings: Object.keys(appliedMarkings ?? {}),\n assumedMarkings: Object.keys(assumedMarkings ?? {})\n }\n }\n };\n}\nfunction convertSecurityCondition(condition, ridGenerator, objectTypeApiName) {\n switch (condition.type) {\n case \"and\":\n if (\"conditions\" in condition) {\n return {\n type: \"and\",\n and: {\n conditions: condition.conditions.map(c => convertSecurityCondition(c, ridGenerator, objectTypeApiName))\n }\n };\n }\n return {\n type: \"and\",\n and: {\n conditions: condition.and.conditions.map(c => convertSecurityCondition(c, ridGenerator, objectTypeApiName))\n }\n };\n case \"or\":\n if (\"conditions\" in condition) {\n return {\n type: \"or\",\n or: {\n conditions: condition.conditions.map(c => convertSecurityCondition(c, ridGenerator, objectTypeApiName))\n }\n };\n }\n return {\n type: \"or\",\n or: {\n conditions: condition.or.conditions.map(c => convertSecurityCondition(c, ridGenerator, objectTypeApiName))\n }\n };\n case \"not\":\n return {\n type: \"not\",\n not: {\n condition: convertSecurityCondition(condition.not.condition, ridGenerator, objectTypeApiName)\n }\n };\n case \"markings\":\n return {\n type: \"markings\",\n markings: {\n property: convertSecurityProperty(condition.markings.property, ridGenerator, objectTypeApiName)\n }\n };\n case \"comparison\":\n return {\n type: \"comparison\",\n comparison: {\n ...condition.comparison,\n left: convertSecurityComparisonValue(condition.comparison.left, ridGenerator, objectTypeApiName),\n right: convertSecurityComparisonValue(condition.comparison.right, ridGenerator, objectTypeApiName)\n }\n };\n case \"markingProperty\":\n return {\n type: \"markings\",\n markings: {\n property: convertSecurityProperty(condition.property, ridGenerator, objectTypeApiName)\n }\n };\n case \"groupProperty\":\n return {\n type: \"comparison\",\n comparison: {\n operator: \"INTERSECTS\",\n left: {\n type: \"userProperty\",\n userProperty: {\n type: \"groupIds\",\n groupIds: {}\n }\n },\n right: {\n type: \"property\",\n property: convertSecurityProperty(condition.property, ridGenerator, objectTypeApiName)\n }\n }\n };\n case \"group\":\n return {\n type: \"comparison\",\n comparison: {\n operator: \"INTERSECTS\",\n left: {\n type: \"userProperty\",\n userProperty: {\n type: \"groupIds\",\n groupIds: {}\n }\n },\n right: {\n type: \"constant\",\n constant: {\n type: \"strings\",\n strings: [condition.name]\n }\n }\n }\n };\n default:\n return condition;\n }\n}\nfunction convertSecurityComparisonValue(value, ridGenerator, objectTypeApiName) {\n if (value.type !== \"property\") {\n return value;\n }\n return {\n type: \"property\",\n property: convertSecurityProperty(value.property, ridGenerator, objectTypeApiName)\n };\n}\nfunction convertSecurityProperty(property, ridGenerator, objectTypeApiName) {\n return ridGenerator && objectTypeApiName ? ridGenerator.generatePropertyRid(property, objectTypeApiName) : property;\n}\n\n/**\n * Converts ISO 8601 duration to Java Duration format (hours/minutes/seconds only).\n * Java's Duration class doesn't support days/weeks/months/years natively,\n * so P90D becomes PT2160H, P1W becomes PT168H, etc.\n */\nfunction convertToJavaDurationFormat(iso8601) {\n const match = iso8601.match(/^P(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?)?$/u);\n if (!match) return iso8601;\n const weeks = parseInt(match[1] || \"0\", 10);\n const days = parseInt(match[2] || \"0\", 10);\n const hours = parseInt(match[3] || \"0\", 10);\n const minutes = parseInt(match[4] || \"0\", 10);\n const seconds = parseInt(match[5] || \"0\", 10);\n const totalHours = (weeks * 7 + days) * 24 + hours;\n const parts = [];\n if (totalHours > 0) parts.push(`${totalHours}H`);\n if (minutes > 0) parts.push(`${minutes}M`);\n if (seconds > 0) parts.push(`${seconds}S`);\n return parts.length > 0 ? `PT${parts.join(\"\")}` : \"PT0S\";\n}\nfunction buildPropertyMapping(properties, objectTypeApiName, ridGenerator) {\n // TODO: Convert property mappings to use RIDs as keys\n return Object.fromEntries(properties.map(prop => {\n const propertyRid = ridGenerator.generatePropertyRid(prop.apiName, objectTypeApiName);\n // editOnly\n if (prop.editOnly) {\n return [propertyRid, {\n type: \"editOnly\",\n editOnly: {}\n }];\n }\n // structs\n if (typeof prop.type === \"object\" && prop.type?.type === \"struct\") {\n const structMapping = {\n type: \"struct\",\n struct: {\n column: prop.apiName,\n mapping: Object.fromEntries(Object.keys(prop.type.structDefinition).map(fieldName => [fieldName, {\n apiName: fieldName,\n mappings: {}\n }]))\n }\n };\n return [propertyRid, structMapping];\n }\n // default: column mapping\n return [propertyRid, {\n type: \"column\",\n column: prop.apiName\n }];\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 invariant from \"tiny-invariant\";\nexport function convertNullabilityToDataConstraint(prop) {\n if (typeof prop.type === \"object\" && prop.type.type === \"marking\") {\n if (prop.nullability === undefined) {\n return {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: {\n noNulls: true,\n noEmptyCollections: true\n }\n };\n }\n !prop.nullability?.noNulls ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Marking property type has noNulls set to false, marking properties must not be nullable\") : invariant(false) : void 0;\n return {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability\n };\n }\n return prop.nullability === undefined ? undefined : {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability\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\nexport function convertValueType(valueType, ridGenerator) {\n return ridGenerator.generateRidForValueType(valueType.apiName, valueType.version);\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 { dataConstraintToPropertyTypeDataConstraint } from \"./dataConstraintToPropertyTypeDataConstraint.js\";\nexport function convertDataConstraintToDataConstraints(dc) {\n return {\n propertyTypeConstraints: [{\n constraints: dataConstraintToPropertyTypeDataConstraint(dc)\n // known limitation: structs don't carry field-level data constraint failure messages\n }]\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 { convertDataConstraintToDataConstraints } from \"./convertDataConstraintToDataConstraints.js\";\nexport function dataConstraintToPropertyTypeDataConstraint(dc) {\n switch (dc.type) {\n case \"array\":\n return {\n ...dc\n };\n case \"boolean\":\n return {\n ...dc\n };\n case \"binary\":\n throw new Error(\"Binary type constraints are not supported\");\n case \"date\":\n return {\n ...dc\n };\n case \"decimal\":\n return {\n ...dc\n };\n case \"double\":\n return {\n ...dc\n };\n case \"float\":\n return {\n ...dc\n };\n case \"integer\":\n return {\n ...dc\n };\n case \"long\":\n return {\n ...dc\n };\n case \"map\":\n throw new Error(\"Map type constraints are not supported\");\n case \"nullable\":\n throw new Error(\"Nullable constraints are not supported\");\n case \"short\":\n return {\n ...dc\n };\n case \"string\":\n return {\n ...dc\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: {\n elementConstraints: Object.fromEntries(Object.entries(dc.struct.elementConstraints).map(([field, constraint]) => [field, convertDataConstraintToDataConstraints(constraint)]))\n }\n };\n case \"structV2\":\n throw new Error(\"StructV2 constraints are not supported\");\n case \"timestamp\":\n return {\n ...dc\n };\n default:\n throw new Error(`Unknown DataConstraint type: ${dc.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 { dataConstraintToPropertyTypeDataConstraint } from \"./dataConstraintToPropertyTypeDataConstraint.js\";\nexport function convertValueTypeDataConstraints(dataConstraints) {\n if (dataConstraints.length === 0) {\n return undefined;\n }\n const propertyTypeConstraints = dataConstraints.map(constraint => ({\n constraints: dataConstraintToPropertyTypeDataConstraint(constraint.constraint.constraint),\n failureMessage: constraint.constraint.failureMessage\n }));\n return {\n propertyTypeConstraints\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\nexport function distributeTypeHelper(type) {\n return {\n type,\n [type]: {}\n }; // any cast to match conditional return type\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 { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\nexport function propertyTypeTypeToOntologyIrType(type, ridGenerator, propertyApiName) {\n switch (true) {\n case typeof type === \"object\" && type.type === \"marking\":\n return {\n type: \"marking\",\n marking: {\n markingType: type.markingType\n }\n };\n case typeof type === \"object\" && type.type === \"struct\":\n const structFields = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n structFieldRid: propertyApiName ? ridGenerator.generateStructFieldRid(propertyApiName, key) : ridGenerator.generateRid(`structfield.${key}`),\n apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition, ridGenerator, propertyApiName)\n };\n } else {\n // If it is a full form type definition then process it as such\n if (\"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n structFieldRid: propertyApiName ? ridGenerator.generateStructFieldRid(propertyApiName, key) : ridGenerator.generateRid(`structfield.${key}`),\n apiName: key,\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition.fieldType, ridGenerator, propertyApiName),\n displayMetadata: fieldTypeDefinition.displayMetadata ?? {\n displayName: key,\n description: undefined\n },\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? []\n };\n } else {\n field = {\n structFieldRid: propertyApiName ? ridGenerator.generateStructFieldRid(propertyApiName, key) : ridGenerator.generateRid(`structfield.${key}`),\n apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition, ridGenerator, propertyApiName)\n };\n }\n }\n structFields.push(field);\n }\n const mainValue = type.mainValue ? {\n type: propertyTypeTypeToOntologyIrType(type.mainValue.type, ridGenerator, propertyApiName),\n fields: (Array.isArray(type.mainValue.fields) ? type.mainValue.fields : [type.mainValue.fields]).map(fieldApiName => propertyApiName ? ridGenerator.generateStructFieldRid(propertyApiName, fieldApiName) : ridGenerator.generateRid(`structfield.${fieldApiName}`))\n } : undefined;\n return {\n type: \"struct\",\n struct: {\n structFields,\n mainValue\n }\n };\n case typeof type === \"object\" && type.type === \"string\":\n return {\n type: \"string\",\n string: {\n analyzerOverride: type.analyzerOverride,\n enableAsciiFolding: type.enableAsciiFolding,\n isLongText: type.isLongText ?? false,\n supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard ?? false,\n supportsExactMatching: type.supportsExactMatching ?? true,\n supportsFullTextRegex: type.supportsFullTextRegex\n }\n };\n case typeof type === \"object\" && type.type === \"decimal\":\n return {\n type: \"decimal\",\n decimal: {\n precision: type.precision,\n scale: type.scale\n }\n };\n case type === \"geopoint\":\n return {\n type: \"geohash\",\n geohash: {}\n };\n case type === \"decimal\":\n return {\n type,\n [type]: {\n precision: undefined,\n scale: undefined\n }\n };\n case type === \"string\":\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsEfficientLeadingWildcard: false,\n supportsExactMatching: true\n }\n };\n case type === \"mediaReference\":\n return {\n type,\n mediaReference: {}\n };\n case type === \"geotimeSeries\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {}\n };\n case type === \"attachment\":\n return {\n type: \"attachment\",\n attachment: {}\n };\n default:\n // use helper function to distribute `type` properly\n if (typeof type === \"object\") {\n throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);\n }\n return distributeTypeHelper(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 { convertObjectStatus, defaultTypeClasses, getNamespace, getPropertyTypeName, hasRenderHints, shouldBeIndexedForSearch, shouldNotHaveRenderHints } from \"@osdk/maker\";\nimport invariant from \"tiny-invariant\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertValueType } from \"./convertValueType.js\";\nimport { convertValueTypeDataConstraints } from \"./convertValueTypeDataConstraints.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertObjectPropertyType(property, objectTypeApiName, ridGenerator) {\n const apiName = getNamespace() + property.apiName;\n !(!shouldNotHaveRenderHints(property.type) || !hasRenderHints(property.typeClasses)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property type ${apiName} of type '${getPropertyTypeName(property.type)}' should not have render hints`) : invariant(false) : void 0;\n // TODO: Generate proper RID and ID based on object type and property API name\n const propertyRid = ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName);\n const output = {\n apiName: property.apiName,\n id: property.apiName,\n // TODO: Should this be different from apiName?\n rid: propertyRid,\n sharedPropertyTypeApiName: property.sharedPropertyType?.apiName,\n displayMetadata: {\n displayName: property.displayName,\n description: property.description,\n visibility: property.visibility ?? \"NORMAL\"\n },\n indexedForSearch: property.indexedForSearch ?? shouldBeIndexedForSearch(property.type),\n ruleSetBinding: undefined,\n baseFormatter: property.baseFormatter,\n type: property.array ? {\n type: \"array\",\n array: {\n subtype: propertyTypeTypeToOntologyIrType(property.type, ridGenerator, property.apiName),\n reducers: []\n }\n } : propertyTypeTypeToOntologyIrType(property.type, ridGenerator, property.apiName),\n typeClasses: property.typeClasses ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),\n status: convertObjectStatus(property.status),\n inlineAction: undefined,\n dataConstraints: property.valueType ? convertValueTypeDataConstraints(property.valueType.constraints) : convertNullabilityToDataConstraint(property),\n // TODO: Convert sharedPropertyTypeRid from API name to RID\n sharedPropertyTypeRid: property.sharedPropertyType ? ridGenerator.generateSptRid(property.sharedPropertyType.apiName) : undefined,\n valueType: property.valueType ? convertValueType(property.valueType, ridGenerator) : undefined\n };\n return output;\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 { cleanAndValidateLinkTypeId, convertObjectStatus, isExotic, isInterfaceSharedPropertyType, withoutNamespace } from \"@osdk/maker\";\nimport invariant from \"tiny-invariant\";\nimport { buildDatasource } from \"./convertActionHelpers.js\";\nimport { convertDatasourceDefinition } from \"./convertDatasourceDefinition.js\";\nimport { convertObjectPropertyType } from \"./convertObjectPropertyType.js\";\nexport function convertObject(objectType, ridGenerator) {\n const {\n derivedDatasources,\n derivedPropertyNames\n } = extractDerivedDatasources(objectType, ridGenerator);\n const propertyDatasources = (objectType.properties ?? []).filter(prop => !derivedPropertyNames.includes(prop.apiName)).flatMap(prop => extractPropertyDatasource(prop, objectType.apiName, ridGenerator));\n const classificationGroupMarkingNames = extractMarkingGroups(objectType.properties ?? [], \"CBAC\");\n const mandatoryMarkingNames = extractMarkingGroups(objectType.properties ?? [], \"MANDATORY\");\n const classificationInputGroup = classificationGroupMarkingNames.length > 0 ? classificationGroupMarkingNames.reduce((l, r) => l + \"/\" + r) : undefined;\n const mandatoryInputGroup = mandatoryMarkingNames.length > 0 ? mandatoryMarkingNames.reduce((l, r) => l + \"/\" + r) : undefined;\n const objectDatasource = buildDatasource(objectType.apiName, convertDatasourceDefinition(objectType, (objectType.properties ?? []).filter(prop => !derivedPropertyNames.includes(prop.apiName)), ridGenerator), ridGenerator, classificationInputGroup, mandatoryInputGroup);\n const implementations = objectType.implementsInterfaces ?? [];\n const objectTypeRid = ridGenerator.generateRidForObjectType(objectType.apiName);\n\n // Convert propertyTypes to use RIDs as keys\n const propertyTypesWithRids = Object.fromEntries(objectType.properties?.map(val => {\n const convertedProp = convertObjectPropertyType(val, objectType.apiName, ridGenerator);\n return [convertedProp.rid, convertedProp];\n }) ?? []);\n const titlePropertyRid = ridGenerator.generatePropertyRid(objectType.titlePropertyApiName, objectType.apiName);\n return {\n objectType: {\n displayMetadata: {\n description: objectType.description,\n displayName: objectType.displayName,\n groupDisplayName: undefined,\n icon: {\n type: \"blueprint\",\n blueprint: objectType.icon ?? {\n locator: \"cube\",\n color: \"#2D72D2\"\n }\n },\n pluralDisplayName: objectType.pluralDisplayName,\n visibility: objectType.visibility ?? \"NORMAL\"\n },\n primaryKeys: [ridGenerator.generatePropertyRid(objectType.primaryKeyPropertyApiName, objectType.apiName)],\n propertyTypes: propertyTypesWithRids,\n titlePropertyTypeRid: titlePropertyRid,\n apiName: objectType.apiName,\n rid: objectTypeRid,\n id: ridGenerator.generateObjectTypeId(objectType.apiName),\n status: convertObjectStatus(objectType.status),\n redacted: false,\n implementsInterfaces: implementations.map(impl => ridGenerator.generateRidForInterface(impl.implements.apiName)),\n implementsInterfaces2: implementations.map(impl => {\n const allParents = flattenInterface(impl.implements, new Set());\n return {\n interfaceTypeRid: ridGenerator.generateRidForInterface(impl.implements.apiName),\n interfaceTypeApiName: impl.implements.apiName,\n links: {},\n linksV2: {},\n propertiesV2: Object.fromEntries(impl.propertyMapping.map(mappings => {\n const resolvedProperty = resolveInterfaceProperty(allParents, mappings.interfaceProperty);\n !(resolvedProperty !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface property '${mappings.interfaceProperty}' not found on interface '${impl.implements.apiName}'`) : invariant(false) : void 0;\n const interfacePropertyTypeRid = isInterfaceSharedPropertyType(resolvedProperty.property) ? ridGenerator.generateIptRidFromSptRid(ridGenerator.generateSptRid(resolvedProperty.property.sharedPropertyType.apiName)) : ridGenerator.generateInterfacePropertyTypeRid(resolvedProperty.apiName, resolvedProperty.interfaceType.apiName);\n return [interfacePropertyTypeRid, {\n type: \"propertyTypeRid\",\n propertyTypeRid: ridGenerator.generatePropertyRid(mappings.mapsTo, objectType.apiName)\n }];\n })),\n properties: {},\n actionTypes: {}\n };\n }),\n allImplementsInterfaces: {},\n traits: {\n workflowObjectTypeTraits: {}\n },\n typeGroups: []\n },\n datasources: [...propertyDatasources, ...derivedDatasources, objectDatasource],\n entityMetadata: buildEntityMetadata(objectType, ridGenerator),\n propertySecurityGroupPackagingVersion: {\n type: \"v2\",\n v2: {}\n },\n schemaMigrations: undefined,\n writebackDatasets: []\n };\n}\nfunction resolveInterfaceProperty(interfaceTypes, mappedApiName) {\n const properties = interfaceTypes.flatMap(interfaceType => Object.entries(interfaceType.propertiesV3).map(([apiName, property]) => ({\n apiName,\n interfaceType,\n property,\n mappedApiName: isInterfaceSharedPropertyType(property) ? property.sharedPropertyType.apiName : apiName\n })));\n const resolvedProperty = properties.find(property => property.mappedApiName === mappedApiName) ?? properties.find(property => withoutNamespace(property.mappedApiName) === withoutNamespace(mappedApiName));\n if (resolvedProperty === undefined) {\n return undefined;\n }\n return {\n apiName: resolvedProperty.apiName,\n interfaceType: resolvedProperty.interfaceType,\n property: resolvedProperty.property\n };\n}\n\n/**\n * Extracts marking group names of a specific type from object properties\n */\nexport function extractMarkingGroups(properties, markingType) {\n return properties.map(prop => {\n if (typeof prop.type === \"object\" && prop.type.type === \"marking\" && prop.type.markingType === markingType) {\n return prop.type.markingInputGroupName;\n }\n return undefined;\n }).filter(val => val !== undefined);\n}\nexport function extractPropertyDatasource(property, objectTypeApiName, ridGenerator) {\n if (!isExotic(property.type)) {\n return [];\n }\n const identifier = objectTypeApiName + \".\" + property.apiName;\n switch (property.type) {\n case \"geotimeSeries\":\n const geotimeDefinition = {\n type: \"geotimeSeries\",\n geotimeSeries: {\n geotimeSeriesIntegrationRid: ridGenerator.generateRidForGeotimeSeriesIntegration(identifier),\n properties: [ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName)]\n }\n };\n return [buildDatasource(property.apiName, geotimeDefinition, ridGenerator)];\n case \"mediaReference\":\n const mediaSetDefinition = {\n type: \"mediaSetView\",\n mediaSetView: {\n assumedMarkings: [],\n clearOnDeleteProperties: [],\n mediaSetViewLocator: ridGenerator.generateMediaSetViewLocator(identifier),\n properties: [ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName)],\n uploadProperties: []\n }\n };\n return [buildDatasource(property.apiName, mediaSetDefinition, ridGenerator)];\n default:\n return [];\n }\n}\nfunction extractDerivedDatasources(objectType, ridGenerator) {\n const inputDerivedDatasources = (objectType.datasources ?? []).filter(ds => ds.type === \"derived\");\n const propertyApiNames = new Set((objectType.properties ?? []).map(prop => prop.apiName));\n inputDerivedDatasources.forEach(ds => Object.keys(ds.propertyMapping).forEach(prop => !propertyApiNames.has(prop) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${prop}' used in derived datasource for object '${objectType.apiName}' is not defined.`) : invariant(false) : void 0));\n const derivedDatasources = inputDerivedDatasources.map((ds, i) => buildDerivedDatasource(ds, i, objectType.apiName, ridGenerator));\n const derivedPropertyNames = inputDerivedDatasources.flatMap(ds => Object.keys(ds.propertyMapping));\n return {\n derivedDatasources,\n derivedPropertyNames\n };\n}\nfunction buildDerivedDatasource(datasource, index, objectTypeApiName, ridGenerator) {\n // TODO: Convert linkType from API name to RID\n const linkDefinition = {\n type: \"multiHopLink\",\n multiHopLink: {\n steps: datasource.linkDefinition.map(step => ({\n type: \"searchAround\",\n searchAround: {\n linkTypeIdentifier: {\n type: \"linkType\",\n linkType: ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(step.linkType.apiName))\n },\n linkTypeSide: step.side ?? \"SOURCE\"\n }\n }))\n }\n };\n const isLinkedProperties = typeof Object.values(datasource.propertyMapping)[0] === \"string\";\n const derivedDefinition = isLinkedProperties ? {\n type: \"linkedProperties\",\n linkedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(Object.entries(datasource.propertyMapping).map(([sourceProp, targetProp]) => [ridGenerator.generatePropertyRid(sourceProp, objectTypeApiName), {\n type: \"propertyType\",\n propertyType: ridGenerator.generatePropertyRid(targetProp, objectTypeApiName)\n }]))\n }\n } : {\n type: \"aggregatedProperties\",\n aggregatedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(Object.entries(datasource.propertyMapping).map(([sourceProp, agg]) => [ridGenerator.generatePropertyRid(sourceProp, objectTypeApiName), buildAggregation(agg, ridGenerator)]))\n }\n };\n const fullDefinition = {\n type: \"derived\",\n derived: {\n definition: derivedDefinition\n }\n };\n return buildDatasource(objectTypeApiName + \".derived.\" + index.toString(), fullDefinition, ridGenerator);\n}\nfunction buildAggregation(agg, ridGenerator) {\n const type = agg.type;\n const limit = \"limit\" in agg ? agg.limit : undefined;\n const foreignProperty = \"property\" in agg ? agg.property : undefined;\n const innerDef = {};\n // TODO: Convert property references in aggregations to RIDs\n if (type !== \"count\") {\n if ([\"collectList\", \"collectSet\"].includes(type)) {\n innerDef.linkedProperty = {\n type: \"propertyType\",\n propertyType: foreignProperty ? ridGenerator.generateRid(`property.unknown.${foreignProperty}`) : undefined\n };\n innerDef.limit = limit;\n } else {\n innerDef.property = {\n type: \"propertyType\",\n propertyType: foreignProperty ? ridGenerator.generateRid(`property.unknown.${foreignProperty}`) : undefined\n };\n }\n }\n return {\n type,\n [type]: innerDef\n };\n}\n\n/**\n * Build entity metadata with fields that match Java's output.\n * Some fields (highbury, editsResolutionStrategies, propertySecurityGroupPackagingVersion)\n * aren't in the TS type definitions yet but are required by the Java converter output.\n */\nfunction buildEntityMetadata(objectType, ridGenerator) {\n const metadata = {\n arePatchesEnabled: objectType.editsEnabled ?? false,\n aliases: objectType.aliases ?? [],\n diffEdits: false,\n entityConfig: {\n objectDbTypeConfigs: {\n highbury: {\n objectDbConfigs: {\n \"ri.highbury.main.cluster.1\": {\n configValue: \"{}\"\n }\n }\n }\n }\n },\n editsResolutionStrategies: {\n strategies: {}\n },\n targetStorageBackend: {\n type: \"objectStorageV2\",\n objectStorageV2: {}\n },\n editsHistory: convertEditsHistory(ridGenerator, objectType.apiName, objectType.editsHistoryConfig)\n };\n return metadata;\n}\nfunction convertEditsHistory(ridGenerator, apiName, config) {\n if (config) {\n return config.enabled ? {\n type: \"config\",\n config: {\n store: ridGenerator.generateRidForObjectType(apiName),\n storeAllPreviousProperties: config.storeAllPreviousProperties\n }\n } : {\n type: \"none\",\n none: {}\n };\n }\n return undefined;\n}\nexport function flattenInterface(interfaceType, seen) {\n if (seen.has(interfaceType.apiName)) {\n return [];\n }\n seen.add(interfaceType.apiName);\n if (interfaceType.extendsInterfaces.length === 0) {\n return [interfaceType];\n }\n const parents = interfaceType.extendsInterfaces.flatMap(parent => flattenInterface(parent, seen));\n return [interfaceType, ...parents];\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\nexport function getFormContentOrdering(action, parameterOrdering) {\n if (!action.sections) return [];\n const parametersToSection = Object.fromEntries(Object.entries(action.sections).flatMap(([sectionId, section]) => section.parameters.map(param => [param, sectionId])));\n const seenIds = new Set();\n const formContentOrdering = [];\n parameterOrdering.forEach(param => {\n if (param in parametersToSection && !seenIds.has(parametersToSection[param])) {\n formContentOrdering.push({\n type: \"sectionId\",\n sectionId: parametersToSection[param]\n });\n seenIds.add(parametersToSection[param]);\n } else if (!(param in parametersToSection)) {\n formContentOrdering.push({\n type: \"parameterId\",\n parameterId: param\n });\n seenIds.add(param);\n }\n });\n return formContentOrdering;\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 { extractAllowedValuesFromActionParameterType, getOntologyDefinition, isActionParameterTypePrimitive, uppercaseFirstLetter } from \"@osdk/maker\";\nimport consola from \"consola\";\nimport invariant from \"tiny-invariant\";\nimport { ReadableIdGenerator } from \"../../util/generateRid.js\";\nimport { convertActionParameters, resolveInterfaceTypeRid } from \"./convertActionParameters.js\";\nimport { convertActionSections } from \"./convertActionSections.js\";\nimport { convertActionValidation } from \"./convertActionValidation.js\";\nimport { flattenInterface } from \"./convertObject.js\";\nimport { getFormContentOrdering } from \"./getFormContentOrdering.js\";\nexport function buildDatasource(apiName, definition, ridGenerator, classificationMarkingGroupName, mandatoryMarkingGroupName) {\n const needsSecurity = classificationMarkingGroupName !== undefined || mandatoryMarkingGroupName !== undefined;\n const securityConfig = needsSecurity ? {\n classificationConstraint: classificationMarkingGroupName ? {\n markings: [classificationMarkingGroupName]\n } : undefined,\n markingConstraint: mandatoryMarkingGroupName ? {\n markingIds: [mandatoryMarkingGroupName]\n } : undefined\n } : undefined;\n return {\n rid: ridGenerator.generateDatasourceRid(apiName),\n datasource: definition,\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: false,\n ...(securityConfig !== undefined && {\n dataSecurity: securityConfig\n })\n };\n}\nexport function convertAction(action, ridGenerator, functionsIr) {\n if (action.rules.map(rule => rule.type === \"functionRule\").some(v => v)) {\n if (!functionsIr) {\n consola.info(\"No functions IR file found, skipping some function-backed actions\");\n return undefined;\n }\n return convertFunctionBackedAction(action, ridGenerator, functionsIr);\n }\n const actionValidation = convertActionValidation(action, ridGenerator);\n const actionParameters = convertActionParameters(action, ridGenerator);\n const actionSections = convertActionSections(action, ridGenerator);\n const parameterOrdering = action.parameterOrdering ?? (action.parameters ?? []).map(p => p.id);\n\n // Build parameterIds mapping: UUID (BlockInternalId) -> ParameterId (API name)\n const parameterIds = {};\n (action.parameters ?? []).forEach(p => {\n const readableId = ReadableIdGenerator.getForParameter(action.apiName, p.id);\n const uuid = ridGenerator.toBlockInternalId(readableId);\n parameterIds[uuid] = p.id;\n });\n const ontologyDefinition = getOntologyDefinition();\n\n // Helper function to convert interface property values from API names to RIDs\n const convertInterfacePropertyValuesToRids = (interfacePropertyValues, allParentInterfaces) => {\n const result = {};\n for (const [apiName, value] of Object.entries(interfacePropertyValues)) {\n const parentInterface = allParentInterfaces.find(maybeSourceParent => maybeSourceParent.propertiesV3[apiName] !== undefined);\n if (parentInterface) {\n // check for IDP first\n const rid = ridGenerator.generateInterfacePropertyTypeRid(apiName, parentInterface.apiName);\n result[rid] = value;\n } else {\n // fall back to SPT\n const sptReadableId = ReadableIdGenerator.getForSpt(apiName);\n const sptRid = ridGenerator.getSharedPropertyTypeRids().get(sptReadableId);\n !sptRid ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Could not find SPT RID for property \"${apiName}\" used in action logic rule`) : invariant(false) : void 0;\n const iptRid = sptRid.replace(\"shared-property-type\", \"interface-property-type\");\n result[iptRid] = value;\n }\n }\n return result;\n };\n\n // Helper function to convert shared property values from API names to RIDs\n const convertSharedPropertyValuesToRids = sharedPropertyValues => {\n const result = {};\n for (const [apiName, value] of Object.entries(sharedPropertyValues)) {\n const rid = ridGenerator.generateSptRid(apiName);\n result[rid] = value;\n }\n return result;\n };\n const convertStructFieldValues = structFieldValues => Object.fromEntries(Object.entries(structFieldValues).map(([propertyApiName, fieldValues]) => [propertyApiName, Object.fromEntries(Object.entries(fieldValues).map(([fieldApiName, value]) => [ridGenerator.generateStructFieldRid(propertyApiName, fieldApiName), value]))]));\n return {\n actionType: {\n actionTypeLogic: {\n logic: {\n // Convert logic rules with proper RID mappings\n rules: action.rules.map(rule => {\n if (rule.type === \"addInterfaceRule\") {\n const interfaceAndParents = flattenInterface(ontologyDefinition.INTERFACE_TYPE[rule.addInterfaceRule.interfaceApiName], new Set());\n return {\n type: \"addInterfaceRule\",\n addInterfaceRule: {\n interfaceTypeRid: ridGenerator.generateRidForInterface(rule.addInterfaceRule.interfaceApiName),\n objectType: rule.addInterfaceRule.objectTypeParameter,\n interfacePropertyValues: convertInterfacePropertyValuesToRids(rule.addInterfaceRule.interfacePropertyValues, interfaceAndParents),\n sharedPropertyValues: convertSharedPropertyValuesToRids(rule.addInterfaceRule.sharedPropertyValues),\n structFieldValues: {},\n logicRuleRid: rule.addInterfaceRule.logicRuleRid\n }\n };\n } else if (rule.type === \"modifyInterfaceRule\") {\n const interfaceAndParents = flattenInterface(ontologyDefinition.INTERFACE_TYPE[rule.modifyInterfaceRule.interfaceApiName], new Set());\n return {\n type: \"modifyInterfaceRule\",\n modifyInterfaceRule: {\n interfaceObjectToModify: rule.modifyInterfaceRule.interfaceObjectToModifyParameter,\n interfacePropertyValues: convertInterfacePropertyValuesToRids(rule.modifyInterfaceRule.interfacePropertyValues, interfaceAndParents),\n sharedPropertyValues: convertSharedPropertyValuesToRids(rule.modifyInterfaceRule.sharedPropertyValues),\n structFieldValues: {}\n }\n };\n } else if (rule.type === \"addObjectRule\") {\n return {\n type: \"addObjectRule\",\n addObjectRule: {\n objectTypeId: ridGenerator.generateObjectTypeId(rule.addObjectRule.objectTypeId),\n propertyValues: rule.addObjectRule.propertyValues,\n structFieldValues: convertStructFieldValues(rule.addObjectRule.structFieldValues),\n logicRuleRid: rule.addObjectRule.logicRuleRid\n }\n };\n } else if (rule.type === \"addOrModifyObjectRuleV2\") {\n return {\n type: \"addOrModifyObjectRuleV2\",\n addOrModifyObjectRuleV2: {\n ...rule.addOrModifyObjectRuleV2,\n structFieldValues: convertStructFieldValues(rule.addOrModifyObjectRuleV2.structFieldValues)\n }\n };\n } else if (rule.type === \"modifyObjectRule\") {\n return {\n type: \"modifyObjectRule\",\n modifyObjectRule: {\n ...rule.modifyObjectRule,\n structFieldValues: convertStructFieldValues(rule.modifyObjectRule.structFieldValues)\n }\n };\n } else if (rule.type === \"addInterfaceLinkRuleV2\") {\n return {\n type: \"addInterfaceLinkRuleV2\",\n addInterfaceLinkRuleV2: {\n interfaceTypeRid: ridGenerator.generateRidForInterface(rule.addInterfaceLinkRuleV2.interfaceTypeRid),\n interfaceLinkTypeRid: ridGenerator.generateRidForInterfaceLinkType(rule.addInterfaceLinkRuleV2.interfaceLinkTypeRid, rule.addInterfaceLinkRuleV2.interfaceTypeRid),\n sourceObjects: rule.addInterfaceLinkRuleV2.sourceObjects,\n targetObjects: rule.addInterfaceLinkRuleV2.targetObjects\n }\n };\n } else if (rule.type === \"deleteInterfaceLinkRule\") {\n return {\n type: \"deleteInterfaceLinkRule\",\n deleteInterfaceLinkRule: {\n interfaceTypeRid: ridGenerator.generateRidForInterface(rule.deleteInterfaceLinkRule.interfaceTypeRid),\n interfaceLinkTypeRid: ridGenerator.generateRidForInterfaceLinkType(rule.deleteInterfaceLinkRule.interfaceLinkTypeRid, rule.deleteInterfaceLinkRule.interfaceTypeRid),\n sourceObject: rule.deleteInterfaceLinkRule.sourceObject,\n targetObject: rule.deleteInterfaceLinkRule.targetObject\n }\n };\n }\n // Pass through other rule types unchanged\n return rule;\n })\n },\n validation: actionValidation,\n notifications: []\n },\n metadata: buildActionMetadata(action, ridGenerator, parameterOrdering, actionParameters, actionSections)\n },\n parameterIds\n };\n}\nfunction convertFunctionBackedAction(actionInput, ridGenerator, functionsIr) {\n let action = actionInput;\n\n // The placeholder functionRid holds the function's API name\n const rule = action.rules[0];\n !(rule.type === \"functionRule\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Function-backed action must have a functionRule\") : invariant(false) : void 0;\n const functionName = rule.functionRule.functionRid;\n const discoveredFunction = functionsIr.discoveredFunctions.find(f => f.locator.typescript?.functionName === functionName);\n !(discoveredFunction != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Function \"${functionName}\" not found in functions IR`) : invariant(false) : void 0;\n const functionInputValues = {};\n const parameterOrdering = [];\n const syntheticParameters = [];\n for (const input of discoveredFunction.inputs) {\n if (input.dataType.type === \"ontologyEdit\" || input.dataType.type === \"client\") continue;\n const paramId = input.name;\n parameterOrdering.push(paramId);\n functionInputValues[paramId] = {\n type: \"parameterId\",\n parameterId: paramId\n };\n const paramType = dataTypeToActionParameterType(input.dataType);\n const listTypes = [...Object.values(PRIMITIVE_LIST_TYPES), \"objectReferenceList\", \"interfaceReferenceList\", \"structList\"];\n syntheticParameters.push({\n id: paramId,\n displayName: uppercaseFirstLetter(paramId),\n type: paramType,\n validation: {\n required: typeof paramType === \"object\" && listTypes.includes(paramType.type) ? {\n listLength: {}\n } : input.required,\n defaultVisibility: \"editable\",\n allowedValues: extractAllowedValuesFromActionParameterType(paramType)\n }\n });\n }\n action = {\n ...action,\n parameters: syntheticParameters,\n entities: {\n affectedObjectTypes: Object.keys(discoveredFunction.ontologyProvenance?.editedObjects ?? {}),\n affectedLinkTypes: [],\n affectedInterfaceTypes: Object.keys(discoveredFunction.ontologyProvenance?.editedInterfaces ?? {}),\n typeGroups: []\n }\n };\n const actionParameters = convertActionParameters(action, ridGenerator);\n const functionRid = `ri.function-registry.main.function.${functionName}`;\n return {\n actionType: {\n actionTypeLogic: {\n logic: {\n rules: [{\n type: \"functionRule\",\n functionRule: {\n functionRid,\n functionVersion: \"0.1.0\",\n functionInputValues,\n customExecutionMode: null,\n experimentalDeclarativeEditInformation: null\n }\n }],\n actionLogRule: null\n },\n validation: convertActionValidation(action, ridGenerator),\n revert: {\n enabledFor: [{\n type: \"actionApplier\",\n actionApplier: {\n withinDuration: {\n value: 24,\n unit: \"HOUR\"\n }\n }\n }]\n },\n webhooks: null,\n notifications: [],\n effects: null\n },\n metadata: buildActionMetadata(action, ridGenerator, parameterOrdering, actionParameters, {})\n },\n parameterIds: {}\n };\n}\nfunction dataTypeToActionParameterType(dataType) {\n switch (dataType.type) {\n case \"object\":\n {\n const objectData = dataType;\n return {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: objectData.object.objectTypeId,\n maybeCreateObjectOption: null\n }\n };\n }\n case \"objectSet\":\n {\n const objectSetData = dataType;\n return {\n type: \"objectSetRid\",\n objectSetRid: {\n objectTypeId: objectSetData.objectSet.objectTypeId\n }\n };\n }\n case \"interface\":\n {\n const interfaceData = dataType;\n return {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: interfaceData.interface.interfaceTypeRid\n }\n };\n }\n case \"interfaceObjectSet\":\n {\n const interfaceData = dataType;\n return {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: interfaceData.interfaceObjectSet.interfaceTypeRid\n }\n };\n }\n case \"list\":\n {\n const listData = dataType;\n return dataTypeToActionParameterListType(listData.list.elementsType);\n }\n case \"set\":\n {\n const setData = dataType;\n return dataTypeToActionParameterListType(setData.set.elementsType);\n }\n case \"optionalType\":\n {\n const optionalData = dataType;\n return dataTypeToActionParameterType(optionalData.optionalType.wrappedType);\n }\n default:\n {\n if (isActionParameterTypePrimitive(dataType.type)) {\n return dataType.type;\n }\n throw new Error(`Unsupported function input data type for action parameter: ${dataType.type}`);\n }\n }\n}\nconst PRIMITIVE_LIST_TYPES = {\n string: \"stringList\",\n boolean: \"booleanList\",\n integer: \"integerList\",\n long: \"longList\",\n double: \"doubleList\",\n date: \"dateList\",\n timestamp: \"timestampList\",\n attachment: \"attachmentList\",\n decimal: \"decimalList\",\n geoshape: \"geoshapeList\",\n mediaReference: \"mediaReferenceList\",\n marking: \"markingList\"\n};\nfunction dataTypeToActionParameterListType(elementType) {\n if (elementType.type === \"object\") {\n const objectData = elementType;\n return {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: objectData.object.objectTypeId\n }\n };\n }\n if (elementType.type === \"interface\") {\n const interfaceData = elementType;\n return {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: interfaceData.interface.interfaceTypeRid\n }\n };\n }\n const listType = PRIMITIVE_LIST_TYPES[elementType.type];\n if (listType != null) {\n return listType;\n }\n throw new Error(`Unsupported list element data type for action parameter: ${elementType.type}`);\n}\n\n/**\n * Build action type metadata with all fields that Java produces.\n * Uses an intermediate variable to allow extra fields beyond the TS type definition\n * (notificationSettings, applyingMessage) without casting to any.\n */\nfunction buildActionMetadata(action, ridGenerator, parameterOrdering, actionParameters, actionSections) {\n const displayMetadata = {\n configuration: {\n defaultLayout: action.defaultFormat ?? \"FORM\",\n displayAndFormat: action.displayAndFormat ?? {\n table: {\n columnWidthByParameterRid: {},\n enableFileImport: true,\n fitHorizontally: false,\n frozenColumnCount: 0,\n rowHeightInLines: 1\n }\n },\n enableLayoutUserSwitch: action.enableLayoutSwitch ?? false\n },\n description: action.description ?? \"\",\n displayName: action.displayName,\n icon: {\n type: \"blueprint\",\n blueprint: action.icon ?? {\n locator: \"edit\",\n color: \"#000000\"\n }\n },\n applyingMessage: [],\n successMessage: action.submissionMetadata?.successMessage ? [{\n type: \"message\",\n message: action.submissionMetadata.successMessage\n }] : [],\n typeClasses: action.typeClasses ?? [],\n ...(action.submissionMetadata?.submitButtonDisplayMetadata && {\n submitButtonDisplayMetadata: action.submissionMetadata.submitButtonDisplayMetadata\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration && {\n undoButtonConfiguration: action.submissionMetadata.undoButtonConfiguration\n })\n };\n const metadata = {\n rid: ridGenerator.generateRidForActionType(action.apiName),\n version: \"\",\n apiName: action.apiName,\n notificationSettings: {\n renderingSettings: {\n type: \"anyNotificationRenderingCanFail\",\n anyNotificationRenderingCanFail: {}\n },\n redactionOverride: null\n },\n displayMetadata,\n parameterOrdering,\n formContentOrdering: getFormContentOrdering(action, parameterOrdering),\n parameters: actionParameters,\n sections: actionSections,\n status: typeof action.status === \"string\" ? {\n type: action.status,\n [action.status]: {}\n } : action.status,\n entities: action.entities ? {\n // affectedInterfaceTypes may hold either API names (interface-link\n // actions) or already-resolved RIDs (function-backed actions)\n affectedInterfaceTypes: action.entities.affectedInterfaceTypes.map(apiNameOrRid => resolveInterfaceTypeRid(apiNameOrRid, ridGenerator)),\n affectedLinkTypes: action.entities.affectedLinkTypes,\n affectedObjectTypes: action.entities.affectedObjectTypes.map(apiName => ridGenerator.generateObjectTypeId(apiName)),\n typeGroups: action.entities.typeGroups\n } : {\n affectedInterfaceTypes: [],\n affectedLinkTypes: [],\n affectedObjectTypes: [],\n typeGroups: []\n }\n };\n return metadata;\n}\n\n// Helper function to convert allowed value option values with ObjectTypeId conversion\nfunction convertAllowedValueOptionValue(value, ridGenerator) {\n if (value?.type === \"objectType\") {\n return {\n type: \"objectType\",\n objectType: {\n objectTypeId: ridGenerator.generateObjectTypeId(value.objectType.objectTypeId)\n }\n };\n }\n // Pass through other value types unchanged (staticValue, parameterValue, etc.)\n return value;\n}\nexport function extractAllowedValues(allowedValues, ridGenerator) {\n switch (allowedValues.type) {\n case \"struct\":\n return {\n type: \"struct\",\n struct: {\n type: \"delegateToAllowedStructFieldValues\",\n delegateToAllowedStructFieldValues: {}\n }\n };\n case \"oneOf\":\n return {\n type: \"oneOf\",\n oneOf: {\n type: \"oneOf\",\n oneOf: {\n labelledValues: allowedValues.oneOf.map(option => ({\n ...option,\n value: convertAllowedValueOptionValue(option.value, ridGenerator)\n })),\n otherValueAllowed: {\n allowed: allowedValues.otherValueAllowed ?? false\n }\n }\n }\n };\n case \"range\":\n const {\n min,\n max\n } = allowedValues;\n return {\n type: \"range\",\n range: {\n type: \"range\",\n range: {\n ...(min === undefined ? {} : {\n minimum: {\n inclusive: true,\n value: min\n }\n }),\n ...(max === undefined ? {} : {\n maximum: {\n inclusive: true,\n value: max\n }\n })\n }\n }\n };\n case \"text\":\n const {\n minLength,\n maxLength,\n regex\n } = allowedValues;\n return {\n type: \"text\",\n text: {\n type: \"text\",\n text: {\n ...(minLength === undefined ? {} : {\n minLength\n }),\n ...(maxLength === undefined ? {} : {\n maxLength\n }),\n ...(regex === undefined ? {} : {\n regex: {\n regex,\n failureMessage: \"Invalid input\"\n }\n })\n }\n }\n };\n case \"datetime\":\n const {\n minimum,\n maximum\n } = allowedValues;\n return {\n type: \"datetime\",\n datetime: {\n type: \"datetime\",\n datetime: {\n minimum,\n maximum\n }\n }\n };\n case \"objectTypeReference\":\n return {\n type: \"objectTypeReference\",\n objectTypeReference: {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: allowedValues.interfaceTypes.map(apiName => ridGenerator.generateRidForInterface(apiName))\n }\n }\n };\n case \"redacted\":\n return {\n type: \"redacted\",\n redacted: {}\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {\n type: \"geotimeSeries\",\n geotimeSeries: {}\n }\n };\n case \"user\":\n return {\n type: \"user\",\n user: {\n type: \"user\",\n user: {\n filter: (allowedValues.fromGroups ?? []).map(group => {\n // Register static group IDs with ridGenerator\n if (group.type === \"static\") {\n ridGenerator.getGroupIds().put(ReadableIdGenerator.getForGroup(group.name), group.name);\n }\n return {\n type: \"groupFilter\",\n groupFilter: {\n groupId: group.type === \"static\" ? {\n type: \"staticValue\",\n staticValue: {\n type: \"string\",\n string: group.name\n }\n } : {\n type: \"parameterId\",\n parameterId: group.parameter\n }\n }\n };\n })\n }\n }\n };\n case \"multipassGroup\":\n return {\n type: \"multipassGroup\",\n multipassGroup: {\n type: \"group\",\n group: {}\n }\n };\n default:\n const k = allowedValues.type;\n return {\n type: k,\n [k]: {\n type: k,\n [k]: {}\n }\n };\n }\n}\nexport function renderHintFromBaseType(parameter, validation) {\n return renderHintFromActionParameterType(parameter.type, validation?.allowedValues ?? parameter.validation.allowedValues, parameter.displayName);\n}\nexport function renderHintFromActionParameterType(parameterType, allowedValues, displayName) {\n const type = typeof parameterType === \"string\" ? parameterType : parameterType.type;\n switch (type) {\n case \"boolean\":\n case \"booleanList\":\n return {\n type: \"checkbox\",\n checkbox: {}\n };\n case \"integer\":\n case \"integerList\":\n case \"long\":\n case \"longList\":\n case \"double\":\n case \"doubleList\":\n case \"decimal\":\n case \"decimalList\":\n return {\n type: \"numericInput\",\n numericInput: {}\n };\n case \"string\":\n if (allowedValues?.type === \"user\" || allowedValues?.type === \"multipassGroup\") {\n return {\n type: \"userDropdown\",\n userDropdown: {}\n };\n }\n case \"stringList\":\n case \"geohash\":\n case \"geohashList\":\n case \"geoshape\":\n case \"geoshapeList\":\n case \"objectSetRid\":\n return {\n type: \"textInput\",\n textInput: {}\n };\n case \"timestamp\":\n case \"timestampList\":\n case \"date\":\n case \"dateList\":\n return {\n type: \"dateTimePicker\",\n dateTimePicker: {}\n };\n case \"attachment\":\n case \"attachmentList\":\n return {\n type: \"filePicker\",\n filePicker: {}\n };\n case \"marking\":\n case \"markingList\":\n if (allowedValues?.type === \"mandatoryMarking\") {\n return {\n type: \"mandatoryMarkingPicker\",\n mandatoryMarkingPicker: {}\n };\n } else if (allowedValues?.type === \"cbacMarking\") {\n return {\n type: \"cbacMarkingPicker\",\n cbacMarkingPicker: {}\n };\n } else {\n throw new Error(`The allowed values for \"${displayName}\" are not compatible with the base parameter type`);\n }\n case \"timeSeriesReference\":\n case \"objectReference\":\n case \"objectReferenceList\":\n case \"interfaceReference\":\n case \"interfaceReferenceList\":\n case \"objectTypeReference\":\n case \"mediaReference\":\n case \"mediaReferenceList\":\n case \"geotimeSeriesReference\":\n case \"geotimeSeriesReferenceList\":\n return {\n type: \"dropdown\",\n dropdown: {}\n };\n case \"struct\":\n case \"structList\":\n return {\n type: \"textInput\",\n textInput: {}\n };\n default:\n throw new Error(`Unknown type ${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 { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertSpt({\n type,\n array,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n aliases,\n valueType,\n nullability,\n baseFormatter\n}, ridGenerator) {\n const dataConstraint = convertNullabilityToDataConstraint({\n type,\n nullability\n });\n return {\n apiName,\n // TODO: Generate proper RID based on apiName\n rid: ridGenerator.generateSptRid(apiName),\n displayMetadata: {\n displayName: displayName ?? apiName,\n visibility: visibility ?? \"NORMAL\",\n description\n },\n type: array ? {\n type: \"array\",\n array: {\n subtype: propertyTypeTypeToOntologyIrType(type, ridGenerator, apiName),\n reducers: []\n }\n } : propertyTypeTypeToOntologyIrType(type, ridGenerator, apiName),\n aliases: aliases ?? [],\n baseFormatter,\n dataConstraints: dataConstraint,\n gothamMapping,\n indexedForSearch: true,\n typeClasses: typeClasses ?? [],\n valueType: valueType === undefined ? undefined : ridGenerator.generateRidForValueType(valueType.apiName, valueType.version)\n };\n}","/*\n * Copyright 2026 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 { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\nexport function propertyTypeTypeToOntologyIrInterfaceType(type, propertyApiName, ridGenerator) {\n switch (true) {\n case typeof type === \"object\" && type.type === \"marking\":\n return {\n type: \"marking\",\n marking: {\n markingType: type.markingType\n }\n };\n case typeof type === \"object\" && type.type === \"struct\":\n const structFields = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n structFieldRid: ridGenerator.generateStructFieldRid(propertyApiName, key),\n apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition, propertyApiName, ridGenerator),\n requireImplementation: true\n };\n } else {\n // If it is a full form type definition then process it as such\n if (typeof fieldTypeDefinition === \"object\" && \"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n apiName: key,\n structFieldRid: ridGenerator.generateStructFieldRid(propertyApiName, key),\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition.fieldType, propertyApiName, ridGenerator),\n displayMetadata: fieldTypeDefinition.displayMetadata ?? {\n displayName: key,\n description: undefined\n },\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? [],\n requireImplementation: fieldTypeDefinition.requireImplementation ?? true\n };\n } else {\n field = {\n apiName: key,\n structFieldRid: ridGenerator.generateStructFieldRid(propertyApiName, key),\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition, propertyApiName, ridGenerator),\n requireImplementation: true\n };\n }\n }\n structFields.push(field);\n }\n return {\n type: \"struct\",\n struct: {\n structFields\n }\n };\n case typeof type === \"object\" && type.type === \"string\":\n return {\n type: \"string\",\n string: {\n analyzerOverride: type.analyzerOverride,\n enableAsciiFolding: type.enableAsciiFolding,\n isLongText: type.isLongText ?? false,\n supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard ?? false,\n supportsExactMatching: type.supportsExactMatching ?? true,\n supportsFullTextRegex: type.supportsFullTextRegex\n }\n };\n case typeof type === \"object\" && type.type === \"decimal\":\n return {\n type: \"decimal\",\n decimal: {\n precision: type.precision,\n scale: type.scale\n }\n };\n case type === \"geopoint\":\n return {\n type: \"geohash\",\n geohash: {}\n };\n case type === \"decimal\":\n return {\n type,\n [type]: {\n precision: undefined,\n scale: undefined\n }\n };\n case type === \"string\":\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsEfficientLeadingWildcard: false,\n supportsExactMatching: true\n }\n };\n case type === \"mediaReference\":\n return {\n type,\n mediaReference: {}\n };\n case type === \"geotimeSeries\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {}\n };\n default:\n // use helper function to distribute `type` properly\n if (typeof type === \"object\") {\n throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);\n }\n return distributeTypeHelper(type);\n }\n}","/*\n * Copyright 2026 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 { isInterfaceSharedPropertyType } from \"@osdk/maker\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nimport { propertyTypeTypeToOntologyIrInterfaceType } from \"./propertyTypeTypeToOntologyIrInterfaceType.js\";\nexport function convertInterfaceProperty(prop, apiName, interfaceApiName, ridGenerator) {\n if (isInterfaceSharedPropertyType(prop)) {\n const convertedSpt = convertSpt(prop.sharedPropertyType, ridGenerator);\n return [ridGenerator.generateIptRidFromSptRid(convertedSpt.rid), {\n type: \"sharedPropertyBasedPropertyType\",\n sharedPropertyBasedPropertyType: {\n requireImplementation: prop.required,\n sharedPropertyType: convertedSpt\n }\n }];\n } else {\n return [ridGenerator.generateInterfacePropertyTypeRid(apiName, interfaceApiName), {\n type: \"interfaceDefinedPropertyType\",\n interfaceDefinedPropertyType: {\n apiName,\n displayMetadata: {\n displayName: prop.displayName ?? apiName,\n visibility: prop.visibility ?? \"NORMAL\",\n description: prop.description\n },\n type: prop.array ? {\n type: \"array\",\n array: {\n subtype: propertyTypeTypeToOntologyIrInterfaceType(prop.type, apiName, ridGenerator)\n }\n } : propertyTypeTypeToOntologyIrInterfaceType(prop.type, apiName, ridGenerator),\n constraints: {\n primaryKeyConstraint: prop.primaryKeyConstraint ?? \"NO_RESTRICTION\",\n requireImplementation: prop.required ?? true,\n indexedForSearch: true,\n typeClasses: prop.typeClasses ?? [],\n dataConstraints: convertNullabilityToDataConstraint({\n type: prop.type,\n nullability: prop.nullability\n }),\n valueType: prop.valueType ? ridGenerator.generateRidForValueType(prop.valueType.apiName, prop.valueType.version) : undefined\n },\n rid: ridGenerator.generateInterfacePropertyTypeRid(apiName, interfaceApiName)\n }\n }];\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 { convertInterfaceProperty } from \"./convertInterfacePropertyType.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nexport function convertInterface(interfaceType, ridGenerator) {\n const {\n __type,\n status,\n linkedInterfaces: _linkedInterfaces,\n ...other\n } = interfaceType;\n // Normalize deprecated deadline format to match Java (strip .000 milliseconds)\n const normalizedStatus = status?.type === \"deprecated\" ? {\n ...status,\n deprecated: {\n ...status.deprecated,\n deadline: status.deprecated.deadline?.replace(/\\.000Z$/u, \"Z\")\n }\n } : status;\n return {\n ...other,\n status: normalizedStatus,\n // TODO: Generate proper RID based on apiName\n rid: ridGenerator.generateRidForInterface(interfaceType.apiName),\n propertiesV2: Object.fromEntries(Object.values(interfaceType.propertiesV2).map(spt => {\n const convertedSpt = convertSpt(spt.sharedPropertyType, ridGenerator);\n return [convertedSpt.rid, {\n required: spt.required,\n sharedPropertyType: convertedSpt\n }];\n })),\n displayMetadata: {\n displayName: interfaceType.displayMetadata.displayName,\n description: interfaceType.displayMetadata.description,\n icon: interfaceType.displayMetadata.icon ?? {\n type: \"blueprint\",\n blueprint: {\n color: \"#4C90F0\",\n locator: \"layout-hierarchy\"\n }\n }\n },\n // TODO: Convert extendsInterfaces from API names to RIDs\n extendsInterfaces: interfaceType.extendsInterfaces.map(i => ridGenerator.generateRidForInterface(i.apiName)),\n // TODO: Convert links to add RIDs\n links: interfaceType.links.map(link => ({\n ...link,\n linkedEntityTypeId: link.linkedEntityTypeId.type === \"interfaceType\" ? {\n type: \"interfaceType\",\n interfaceType: ridGenerator.generateRidForInterface(link.linkedEntityTypeId.interfaceType)\n } : {\n type: \"objectType\",\n objectType: ridGenerator.generateObjectTypeId(link.linkedEntityTypeId.objectType)\n },\n rid: ridGenerator.generateRidForInterfaceLinkType(link.metadata.apiName, interfaceType.apiName)\n })),\n actionTypeConstraints: (interfaceType.actionTypeConstraints ?? []).map(constraint => ({\n ...constraint,\n rid: ridGenerator.generateRidForInterfaceActionTypeConstraint(constraint.metadata.apiName, interfaceType.apiName),\n parameters: Object.fromEntries(Object.entries(constraint.parameters ?? {}).map(([paramApiName, paramConstraint]) => {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName;\n return [ridGenerator.generateRidForInterfaceParameterConstraint(constraint.metadata.apiName, interfaceType.apiName, paramDisplayApiName), paramConstraint];\n }))\n })),\n // these are omitted from our internal types but we need to re-add them for the final json\n properties: [],\n propertiesV3: Object.fromEntries(Object.entries(interfaceType.propertiesV3).map(([apiName, prop]) => convertInterfaceProperty(prop, apiName, interfaceType.apiName, ridGenerator)))\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\nexport function convertCardinality(cardinality) {\n if (cardinality === \"OneToMany\" || cardinality === undefined) {\n return \"ONE_TO_MANY\";\n }\n return \"ONE_TO_ONE\";\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 { cleanAndValidateLinkTypeId, getImportedTypes, getOntologyDefinition, OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport invariant from \"tiny-invariant\";\nimport { convertCardinality } from \"./convertCardinality.js\";\nexport function convertLink(linkType, ridGenerator) {\n validateLink(linkType);\n let definition;\n let datasource;\n if (\"one\" in linkType) {\n const {\n apiName: oneObjectApiName,\n object: oneObject\n } = getObject(linkType.one.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkType.toMany.object);\n const oneObjectRid = ridGenerator.generateRidForObjectType(oneObjectApiName);\n const toManyObjectRid = ridGenerator.generateRidForObjectType(toManyObjectApiName);\n const onePkRid = ridGenerator.generatePropertyRid(oneObject.primaryKeyPropertyApiName, oneObjectApiName);\n const manyFkRid = ridGenerator.generatePropertyRid(linkType.manyForeignKeyProperty, toManyObjectApiName);\n definition = {\n type: \"oneToMany\",\n oneToMany: {\n cardinalityHint: convertCardinality(linkType.cardinality),\n manyToOneLinkMetadata: linkType.toMany.metadata,\n objectTypeRidManySide: toManyObjectRid,\n objectTypeRidOneSide: oneObjectRid,\n oneToManyLinkMetadata: linkType.one.metadata,\n // TODO: Convert property mappings to use RIDs as keys and values\n oneSidePrimaryKeyToManySidePropertyMapping: {\n [onePkRid]: manyFkRid\n }\n }\n };\n } else if (\"intermediaryObjectType\" in linkType) {\n const {\n apiName: manyObjectApiName,\n object: manyObject\n } = getObject(linkType.many.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkType.toMany.object);\n const {\n apiName: intermediaryObjectApiName\n } = getObject(linkType.intermediaryObjectType);\n definition = {\n type: \"intermediary\",\n intermediary: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: ridGenerator.generateRidForObjectType(manyObjectApiName),\n objectTypeRidB: ridGenerator.generateRidForObjectType(toManyObjectApiName),\n intermediaryObjectTypeRid: ridGenerator.generateRidForObjectType(intermediaryObjectApiName),\n aToIntermediaryLinkTypeRid: ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(linkType.many.linkToIntermediary.apiName)),\n intermediaryToBLinkTypeRid: ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(linkType.toMany.linkToIntermediary.apiName))\n }\n };\n } else {\n const {\n apiName: manyObjectApiName,\n object: manyObject\n } = getObject(linkType.many.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkType.toMany.object);\n const manyObjectRidA = ridGenerator.generateRidForObjectType(manyObjectApiName);\n const manyObjectRidB = ridGenerator.generateRidForObjectType(toManyObjectApiName);\n const manyPkRidA = ridGenerator.generatePropertyRid(manyObject.primaryKeyPropertyApiName, manyObjectApiName);\n const manyPkRidB = ridGenerator.generatePropertyRid(toManyObject.primaryKeyPropertyApiName, toManyObjectApiName);\n const columnA = manyObject.primaryKeyPropertyApiName;\n const columnB = toManyObject.primaryKeyPropertyApiName;\n const hasCollision = columnA === columnB;\n const resolvedColumnA = hasCollision ? `${columnA}_from` : columnA;\n const resolvedColumnB = hasCollision ? `${columnB}_to` : columnB;\n definition = {\n type: \"manyToMany\",\n manyToMany: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectRidA,\n objectTypeRidB: manyObjectRidB,\n peeringMetadata: undefined,\n // TODO: Convert property mappings to use RIDs as keys and values\n objectTypeAPrimaryKeyPropertyMapping: {\n [manyPkRidA]: manyPkRidA\n },\n objectTypeBPrimaryKeyPropertyMapping: {\n [manyPkRidB]: manyPkRidB\n }\n }\n };\n const datasetLocator = ridGenerator.generateDatasetLocator(`link.${linkType.apiName}`, new Set([resolvedColumnA, resolvedColumnB]));\n datasource = {\n rid: ridGenerator.generateDatasourceRid(linkType.apiName),\n datasource: {\n type: \"dataset\",\n dataset: {\n // TODO: Add proper branchId from link configuration\n branchId: datasetLocator.branchId,\n datasetRid: datasetLocator.rid,\n writebackDatasetRid: undefined,\n // TODO: Convert property mappings to use property RIDs as keys\n objectTypeAPrimaryKeyMapping: {\n [manyPkRidA]: resolvedColumnA\n },\n objectTypeBPrimaryKeyMapping: {\n [manyPkRidB]: resolvedColumnB\n }\n }\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: linkType.redacted\n };\n }\n const linkTypeId = cleanAndValidateLinkTypeId(linkType.apiName);\n return {\n linkType: {\n definition,\n ...(linkType.description !== undefined && {\n description: linkType.description\n }),\n rid: ridGenerator.generateRidForLinkType(linkTypeId),\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: convertLinkStatus(linkType.status, ridGenerator),\n redacted: linkType.redacted ?? false\n },\n datasources: datasource !== undefined ? [datasource] : [],\n entityMetadata: {\n arePatchesEnabled: linkType.editsEnabled ?? false,\n entityConfig: {\n objectDbTypeConfigs: {\n highbury: {\n objectDbConfigs: {\n \"ri.highbury.main.cluster.1\": {\n configValue: \"{}\"\n }\n }\n }\n }\n },\n targetStorageBackend: {\n type: \"objectStorageV2\",\n objectStorageV2: {}\n }\n }\n };\n}\nfunction validateLink(linkDefinition) {\n if (\"one\" in linkDefinition) {\n const {\n apiName: oneObjectApiName,\n object: oneObject\n } = getObject(linkDefinition.one.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkDefinition.toMany.object);\n const foreignKey = toManyObject.properties?.find(p => p.apiName === linkDefinition.manyForeignKeyProperty);\n !(foreignKey !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Foreign key ${linkDefinition.manyForeignKeyProperty} on link ${linkDefinition.apiName} does not exist on object ${toManyObjectApiName}`) : invariant(false) : void 0;\n !/([a-z][a-z0-9\\\\-]*)/u.test(linkDefinition.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Top level link api names are expected to match the regex pattern ([a-z][a-z0-9\\\\-]*) ${linkDefinition.apiName} does not match`) : invariant(false) : void 0;\n const typesMatch = foreignKey.type === oneObject.properties?.find(p => p.apiName === oneObject.primaryKeyPropertyApiName)?.type;\n !typesMatch ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Link ${linkDefinition.apiName} has type mismatch between the one side's primary key and the foreign key on the many side`) : invariant(false) : void 0;\n }\n if (\"intermediaryObjectType\" in linkDefinition) {\n const {\n apiName: intermediaryObjectTypeApiName,\n object: intermediaryObjectType\n } = getObject(linkDefinition.intermediaryObjectType);\n const {\n apiName: manyObjectApiName,\n object: manyObject\n } = getObject(linkDefinition.many.object);\n const {\n apiName: toManyObjectApiName,\n object: toManyObject\n } = getObject(linkDefinition.toMany.object);\n const {\n apiName: manyIntermediaryOneObjectApiName,\n object: manyIntermediaryOneObject\n } = getObject(linkDefinition.many.linkToIntermediary.one.object);\n const {\n apiName: manyIntermediaryToManyObjectApiName,\n object: manyIntermediaryToManyObject\n } = getObject(linkDefinition.many.linkToIntermediary.toMany.object);\n !(\"one\" in linkDefinition.many.linkToIntermediary && manyIntermediaryOneObjectApiName === manyObject.apiName && manyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `LinkTypeA ${linkDefinition.many.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectA ${manyObjectApiName}`) : invariant(false) : void 0;\n const {\n apiName: toManyIntermediaryOneObjectApiName,\n object: toManyIntermediaryOneObject\n } = getObject(linkDefinition.toMany.linkToIntermediary.one.object);\n const {\n apiName: toManyIntermediaryToManyObjectApiName,\n object: toManyIntermediaryToManyObject\n } = getObject(linkDefinition.toMany.linkToIntermediary.toMany.object);\n !(\"one\" in linkDefinition.toMany.linkToIntermediary && toManyIntermediaryOneObjectApiName === toManyObjectApiName && toManyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `LinkTypeB ${linkDefinition.toMany.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectB ${toManyObjectApiName}`) : invariant(false) : void 0;\n }\n}\nexport function getObject(object) {\n const objectApiName = typeof object === \"string\" ? object : object.apiName;\n const fullObject = getOntologyDefinition()[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName] ?? getImportedTypes()[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName];\n !(fullObject !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object ${objectApiName} is not defined`) : invariant(false) : void 0;\n return {\n apiName: objectApiName,\n object: fullObject\n };\n}\nexport function convertLinkStatus(status, ridGenerator) {\n if (typeof status === \"object\" && \"type\" in status && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: status.replacedBy ? ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(status.replacedBy)) : undefined\n }\n };\n }\n switch (status) {\n case \"experimental\":\n return {\n type: \"experimental\",\n experimental: {}\n };\n case \"example\":\n return {\n type: \"example\",\n example: {}\n };\n case \"active\":\n default:\n return {\n type: \"active\",\n active: {}\n };\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\nconst VOID = {};\nconst DEFAULT_DECIMAL_PRECISION = 38;\nconst DEFAULT_DECIMAL_SCALE = 0;\n\n/**\n * Convert Type to ObjectPropertyType for marketplace shapes\n * TypeScript port of TypeToMarketplaceShapeObjectPropertyTypeVisitor\n */\nexport function typeToMarketplaceObjectPropertyType(type) {\n switch (type.type) {\n case \"array\":\n const arraySubtype = typeToMarketplaceObjectPropertyType(type.array.subtype);\n if (arraySubtype.type === \"array\") {\n throw new Error(\"Nested array property types are not supported in marketplace\");\n }\n if (arraySubtype.type !== \"primitive\") {\n throw new Error(\"Array subtype must be primitive\");\n }\n return {\n type: \"array\",\n array: {\n elementType: arraySubtype.primitive\n }\n };\n case \"boolean\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"booleanType\",\n booleanType: VOID\n }\n };\n case \"byte\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"byteType\",\n byteType: VOID\n }\n };\n case \"date\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"dateType\",\n dateType: VOID\n }\n };\n case \"decimal\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"decimalType\",\n decimalType: VOID\n }\n };\n case \"double\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"doubleType\",\n doubleType: VOID\n }\n };\n case \"float\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"floatType\",\n floatType: VOID\n }\n };\n case \"geohash\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"geohashType\",\n geohashType: VOID\n }\n };\n case \"geoshape\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"geoshapeType\",\n geoshapeType: VOID\n }\n };\n case \"integer\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"integerType\",\n integerType: VOID\n }\n };\n case \"long\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"longType\",\n longType: VOID\n }\n };\n case \"short\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"shortType\",\n shortType: VOID\n }\n };\n case \"string\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"stringType\",\n stringType: VOID\n }\n };\n case \"experimentalTimeDependentV1\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"timeDependentType\",\n timeDependentType: VOID\n }\n };\n case \"timestamp\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"timestampType\",\n timestampType: VOID\n }\n };\n case \"attachment\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"attachmentType\",\n attachmentType: VOID\n }\n };\n case \"marking\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"markingType\",\n markingType: VOID\n }\n };\n case \"cipherText\":\n {\n const plainTextType = typeToMarketplaceObjectPropertyType(type.cipherText.plainTextType);\n if (plainTextType.type === \"array\") {\n throw new Error(\"Nested array property types are not supported in marketplace\");\n }\n if (plainTextType.type !== \"primitive\") {\n throw new Error(\"CipherText plaintext type must be primitive\");\n }\n return {\n type: \"primitive\",\n primitive: {\n type: \"cipherTextType\",\n cipherTextType: {\n plainTextType: plainTextType.primitive\n }\n }\n };\n }\n case \"mediaReference\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"mediaReferenceType\",\n mediaReferenceType: VOID\n }\n };\n case \"vector\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"vectorType\",\n vectorType: {\n dimension: type.vector.dimension,\n supportsSearchWith: type.vector.supportsSearchWith?.map(fn => {\n switch (fn) {\n case \"COSINE_SIMILARITY\":\n return \"COSINE_SIMILARITY\";\n case \"DOT_PRODUCT\":\n return \"DOT_PRODUCT\";\n case \"EUCLIDEAN_DISTANCE\":\n return \"EUCLIDEAN_DISTANCE\";\n default:\n throw new Error(`Unknown vector similarity function: ${fn}`);\n }\n }) ?? []\n }\n }\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"geotimeSeriesReferenceType\",\n geotimeSeriesReferenceType: VOID\n }\n };\n case \"struct\":\n {\n const structFieldTypes = type.struct.structFields.map(field => typeToMarketplaceObjectPropertyType(field.fieldType));\n return {\n type: \"primitive\",\n primitive: {\n type: \"structType\",\n structType: {\n structFieldTypes\n }\n }\n };\n }\n default:\n throw new Error(`Unknown property type: ${type.type}`);\n }\n}\n\n/**\n * Convert Type to ConcreteDataType for datasource columns\n * TypeScript port of TypeToConcreteDataTypeVisitor\n */\nexport function typeToConcreteDataType(type) {\n switch (type.type) {\n case \"array\":\n {\n const elementType = typeToConcreteDataType(type.array.subtype);\n return {\n type: \"array\",\n array: {\n elementType\n }\n };\n }\n case \"boolean\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"boolean\",\n boolean: VOID\n }\n };\n case \"byte\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"byte\",\n byte: VOID\n }\n };\n case \"date\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"date\",\n date: VOID\n }\n };\n case \"decimal\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"decimal\",\n decimal: {\n precision: type.decimal.precision ?? DEFAULT_DECIMAL_PRECISION,\n scale: type.decimal.scale ?? DEFAULT_DECIMAL_SCALE\n }\n }\n };\n case \"double\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"double\",\n double: VOID\n }\n };\n case \"float\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"float\",\n float: VOID\n }\n };\n case \"geohash\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"geoshape\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"integer\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"integer\",\n integer: VOID\n }\n };\n case \"long\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"long\",\n long: VOID\n }\n };\n case \"short\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"short\",\n short: VOID\n }\n };\n case \"string\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"experimentalTimeDependentV1\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"timestamp\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"timestamp\",\n timestamp: VOID\n }\n };\n case \"attachment\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"marking\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"cipherText\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"mediaReference\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"vector\":\n {\n const floatType = {\n type: \"primitive\",\n primitive: {\n type: \"float\",\n float: VOID\n }\n };\n return {\n type: \"array\",\n array: {\n elementType: floatType\n }\n };\n }\n case \"geotimeSeriesReference\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"struct\":\n {\n const fields = type.struct.structFields.map(field => ({\n name: field.apiName,\n type: typeToConcreteDataType(field.fieldType)\n }));\n return {\n type: \"struct\",\n struct: {\n fields\n }\n };\n }\n default:\n throw new Error(`Unknown property type: ${type.type}`);\n }\n}\n\n/**\n * Convert Type to BaseType for value type input shapes\n * TypeScript port of TypeToMarketplaceShapeBaseTypeVisitor\n */\nexport function typeToMarketplaceBaseType(type) {\n switch (type.type) {\n case \"array\":\n {\n const arr = type.array;\n const subItem = \"subtype\" in arr ? arr.subtype : arr.elementType;\n const itemBaseType = typeToMarketplaceBaseType(subItem);\n if (itemBaseType.type === \"array\") {\n throw new Error(\"Nested array property types are not supported in marketplace\");\n }\n if (itemBaseType.type === \"structV2\") {\n throw new Error(\"Invalid base type: array of struct\");\n }\n if (itemBaseType.type !== \"primitive\") {\n throw new Error(\"Array item must be primitive base type\");\n }\n return {\n type: \"array\",\n array: {\n elementType: itemBaseType.primitive\n }\n };\n }\n case \"binary\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"binary\",\n binary: VOID\n }\n };\n case \"boolean\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"boolean\",\n boolean: VOID\n }\n };\n case \"byte\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"byte\",\n byte: VOID\n }\n };\n case \"date\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"date\",\n date: VOID\n }\n };\n case \"decimal\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"decimal\",\n decimal: VOID\n }\n };\n case \"double\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"double\",\n double: VOID\n }\n };\n case \"float\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"float\",\n float: VOID\n }\n };\n case \"geohash\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"geoshape\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"integer\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"integer\",\n integer: VOID\n }\n };\n case \"long\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"long\",\n long: VOID\n }\n };\n case \"map\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"map\",\n map: VOID\n }\n };\n case \"optional\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"optional\",\n optional: VOID\n }\n };\n case \"short\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"short\",\n short: VOID\n }\n };\n case \"string\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"experimentalTimeDependentV1\":\n throw new Error(\"Unsupported type: timeDependent\");\n case \"timestamp\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"timestamp\",\n timestamp: VOID\n }\n };\n case \"attachment\":\n throw new Error(\"Unsupported type: attachment\");\n case \"marking\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"cipherText\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"string\",\n string: VOID\n }\n };\n case \"mediaReference\":\n throw new Error(\"Unsupported type: mediaReference\");\n case \"vector\":\n throw new Error(\"Unsupported type: vector\");\n case \"geotimeSeriesReference\":\n throw new Error(\"Unsupported type: geotimeSeriesReference\");\n case \"struct\":\n return {\n type: \"primitive\",\n primitive: {\n type: \"struct\",\n struct: VOID\n }\n };\n case \"structV2\":\n {\n const sv2 = type;\n return {\n type: \"structV2\",\n structV2: {\n structFieldTypes: sv2.structV2.fields.map(field => typeToMarketplaceBaseType(field.baseType))\n }\n };\n }\n case \"referenced\":\n throw new Error(\"Referenced types are not supported in marketplace\");\n case \"union\":\n throw new Error(\"Union types are not supported in marketplace\");\n default:\n throw new Error(`Unknown property type: ${type.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\n/**\n * Helper to create LocalizedTitleAndDescription with empty localizations\n */\nfunction createLocalizedAbout(fallbackTitle, fallbackDescription = \"\") {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {}\n };\n}\n\n/**\n * TypeScript port of Java's LinkTypeShapeExtractor class\n */\nexport class LinkTypeShapeExtractor {\n /**\n * Extract shapes from a LinkType\n */\n extract(linkReadableId, link, ridGenerator) {\n const editsEnabled = link.entityMetadata?.arePatchesEnabled ?? false;\n const definition = link.linkType.definition;\n switch (definition.type) {\n case \"intermediary\":\n return this.extractIntermediary(linkReadableId, definition.intermediary, ridGenerator);\n case \"manyToMany\":\n return this.extractManyToMany(linkReadableId, definition.manyToMany, ridGenerator, link.datasources, editsEnabled);\n case \"oneToMany\":\n return this.extractOneToMany(linkReadableId, definition.oneToMany, ridGenerator);\n default:\n throw new Error(`Unknown link definition type: ${definition.type}`);\n }\n }\n\n /**\n * Extract one-to-many link shape\n */\n extractOneToMany(linkReadableId, linkDefinition, ridGenerator) {\n const outputShape = {\n about: createLocalizedAbout(linkDefinition.oneToManyLinkMetadata.displayMetadata.displayName),\n objectTypeShapeIdOneSide: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidOneSide),\n objectTypeShapeIdManySide: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidManySide),\n manyToOneLinkMetadata: createLocalizedAbout(linkDefinition.manyToOneLinkMetadata.displayMetadata.displayName),\n oneToManyLinkMetadata: createLocalizedAbout(linkDefinition.oneToManyLinkMetadata.displayMetadata.displayName),\n cardinalityHint: linkDefinition.cardinalityHint === \"ONE_TO_ONE\" ? \"ONE_TO_ONE\" : \"ONE_TO_MANY\"\n };\n return {\n inputShapes: new Map(),\n outputShapes: new Map([[linkReadableId, {\n type: \"linkType\",\n linkType: {\n type: \"oneToMany\",\n oneToMany: outputShape\n }\n }]]),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n }\n\n /**\n * Extract many-to-many link shape\n */\n extractManyToMany(linkReadableId, linkDefinition, ridGenerator, dataSources, editsEnabled) {\n const linkTypeName = linkDefinition.objectTypeAToBLinkMetadata.displayMetadata.displayName;\n const outputShape = {\n about: createLocalizedAbout(linkTypeName),\n objectTypeAToBLinkMetadata: createLocalizedAbout(linkDefinition.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeBToALinkMetadata: createLocalizedAbout(linkDefinition.objectTypeBToALinkMetadata.displayMetadata.displayName),\n objectTypeShapeIdA: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidA),\n objectTypeShapeIdB: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidB),\n editsSupport: editsEnabled ? \"EDITS_ENABLED\" : \"EDITS_DISABLED\",\n objectsBackendVersion: \"V2\"\n };\n const datasetShapes = new Map();\n for (const datasource of dataSources) {\n const datasourceDefinition = datasource.datasource;\n let datasourceLocator;\n let columns;\n let datasourceType;\n if (datasourceDefinition.type === \"dataset\") {\n datasourceLocator = {\n type: \"dataset\",\n dataset: {\n rid: datasourceDefinition.dataset.datasetRid,\n branch: datasourceDefinition.dataset.branchId\n }\n };\n columns = new Set([...Object.values(datasourceDefinition.dataset.objectTypeAPrimaryKeyMapping).map(String), ...Object.values(datasourceDefinition.dataset.objectTypeBPrimaryKeyMapping).map(String)]);\n datasourceType = \"DATASET\";\n } else if (datasourceDefinition.type === \"stream\") {\n datasourceLocator = {\n type: \"stream\",\n stream: {\n rid: datasourceDefinition.stream.streamLocator.streamLocatorRid,\n branch: datasourceDefinition.stream.streamLocator.branchId\n }\n };\n columns = new Set([...Object.values(datasourceDefinition.stream.objectTypeAPrimaryKeyMapping).map(String), ...Object.values(datasourceDefinition.stream.objectTypeBPrimaryKeyMapping).map(String)]);\n datasourceType = \"STREAM\";\n } else {\n continue;\n }\n\n // Find datasource readable ID\n let datasourceReadableId;\n for (const [id, loc] of ridGenerator.getDatasourceLocators().entries()) {\n if (this.datasourceLocatorsMatch(loc, datasourceLocator)) {\n datasourceReadableId = id;\n break;\n }\n }\n if (!datasourceReadableId) continue;\n\n // Create column shapes\n const columnShapes = this.getColumnInputShapesForManyToManyDatasets(ridGenerator, columns, datasourceLocator, datasourceReadableId);\n for (const [id, shape] of columnShapes.entries()) {\n datasetShapes.set(id, shape);\n }\n\n // Create datasource shape\n const datasourceShape = this.getInputShapeForManyToManyDatasource(ridGenerator, linkTypeName, columns, datasourceLocator, datasourceType);\n datasetShapes.set(datasourceReadableId, datasourceShape);\n }\n return {\n inputShapes: datasetShapes,\n outputShapes: new Map([[linkReadableId, {\n type: \"linkType\",\n linkType: {\n type: \"manyToMany\",\n manyToMany: outputShape\n }\n }]]),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n }\n\n /**\n * Extract intermediary link shape\n */\n extractIntermediary(linkReadableId, linkDefinition, ridGenerator) {\n const outputShape = {\n about: createLocalizedAbout(linkDefinition.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeAToBLinkMetadata: createLocalizedAbout(linkDefinition.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeBToALinkMetadata: createLocalizedAbout(linkDefinition.objectTypeBToALinkMetadata.displayMetadata.displayName),\n objectTypeAShapeId: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidA),\n objectTypeBShapeId: this.getObjectTypeShapeId(ridGenerator, linkDefinition.objectTypeRidB),\n intermediaryObjectTypeShapeId: this.getObjectTypeShapeId(ridGenerator, linkDefinition.intermediaryObjectTypeRid),\n aToIntermediaryLinkTypeShapeId: this.getLinkTypeShapeId(ridGenerator, linkDefinition.aToIntermediaryLinkTypeRid),\n intermediaryToBLinkTypeShapeId: this.getLinkTypeShapeId(ridGenerator, linkDefinition.intermediaryToBLinkTypeRid)\n };\n return {\n inputShapes: new Map(),\n outputShapes: new Map([[linkReadableId, {\n type: \"linkType\",\n linkType: {\n type: \"intermediary\",\n intermediary: outputShape\n }\n }]]),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n }\n\n /**\n * Get object type shape ID reference\n */\n getObjectTypeShapeId(ridGenerator, objectTypeRid) {\n const readableId = ridGenerator.getObjectTypeRids().inverse().get(objectTypeRid);\n if (!readableId) {\n throw new Error(`Object type RID not found: ${objectTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n }\n\n /**\n * Get link type shape ID reference\n */\n getLinkTypeShapeId(ridGenerator, linkTypeRid) {\n const readableId = ridGenerator.getLinkTypeRids().inverse().get(linkTypeRid);\n if (!readableId) {\n throw new Error(`Object type RID not found: ${linkTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n }\n\n /**\n * Get input shape for many-to-many datasource\n */\n getInputShapeForManyToManyDatasource(ridGenerator, linkTypeName, columns, datasourceLocator, datasourceType) {\n const columnReferences = [];\n for (const column of columns) {\n for (const [id, shape] of ridGenerator.getColumnShapes().entries()) {\n if (this.datasourceLocatorsMatch(shape.datasource, datasourceLocator) && shape.name === column) {\n columnReferences.push(ridGenerator.toBlockInternalId(id));\n break;\n }\n }\n }\n const shape = {\n about: createLocalizedAbout(linkTypeName),\n schema: columnReferences,\n supportedTypes: [datasourceType]\n };\n return {\n type: \"tabularDatasource\",\n tabularDatasource: shape\n };\n }\n\n /**\n * Get column input shapes for many-to-many datasets\n */\n getColumnInputShapesForManyToManyDatasets(ridGenerator, columns, datasourceLocator, datasourceReadableId) {\n const columnShapes = new Map();\n for (const column of columns) {\n for (const [id, shape] of ridGenerator.getColumnShapes().entries()) {\n if (this.datasourceLocatorsMatch(shape.datasource, datasourceLocator) && shape.name === column) {\n const columnShape = {\n about: createLocalizedAbout(column),\n type: {\n type: \"generic\",\n generic: {\n type: \"any\",\n any: {}\n }\n },\n datasource: ridGenerator.toBlockInternalId(datasourceReadableId),\n typeclasses: []\n };\n columnShapes.set(id, {\n type: \"datasourceColumn\",\n datasourceColumn: columnShape\n });\n break;\n }\n }\n }\n return columnShapes;\n }\n\n /**\n * Helper to compare datasource locators\n */\n datasourceLocatorsMatch(a, b) {\n if (a.type !== b.type) return false;\n if (a.type === \"dataset\" && b.type === \"dataset\") {\n return a.dataset.rid === b.dataset.rid && a.dataset.branch === b.dataset.branch;\n }\n if (a.type === \"stream\" && b.type === \"stream\") {\n return a.stream.rid === b.stream.rid && a.stream.branch === b.stream.branch;\n }\n if (a.type === \"restrictedView\" && b.type === \"restrictedView\") {\n return a.restrictedView.rid === b.restrictedView.rid;\n }\n return false;\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 { typeToConcreteDataType, typeToMarketplaceBaseType, typeToMarketplaceObjectPropertyType } from \"../typeVisitors.js\";\n\n/**\n * Helper to create LocalizedTitleAndDescription with empty localizations\n */\nfunction createLocalizedAbout(fallbackTitle, fallbackDescription) {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {}\n };\n}\n\n/**\n * TypeScript port of Java's ObjectTypeShapeExtractor class\n */\nexport class ObjectTypeShapeExtractor {\n constructor(randomnessKey) {\n this.randomnessKey = randomnessKey;\n }\n\n /**\n * Extract shapes from an ObjectType\n */\n extract(objectReadableId, objectType, ridGenerator) {\n // BiMap inverse() returns BiMap<V,K> so we convert to Map<K,V>\n const propertyReadableIdsByRid = ridGenerator.getPropertyTypeRids().inverse();\n const readableIdsForSptRid = ridGenerator.getSharedPropertyTypeRids().inverse();\n\n // Build property output shapes\n const propertyOutputShapeMap = new Map();\n for (const [propertyRid, propertyType] of Object.entries(objectType.objectType.propertyTypes)) {\n const readableId = propertyReadableIdsByRid.get(propertyRid);\n if (readableId) {\n propertyOutputShapeMap.set(readableId, this.getShapeForProperty(objectReadableId, propertyType, readableIdsForSptRid.asMap(), ridGenerator));\n }\n }\n const datasourcesByReadableId = ridGenerator.getDatasourceLocators().asMap();\n const directDatasourcesByReadableId = ridGenerator.getDirectDatasourceLocators().asMap();\n const filesDatasourcesByReadableId = ridGenerator.getFilesDatasourceLocators();\n const geotimeSeriesIntegrationRidByReadableId = new Map(Array.from(ridGenerator.getGeotimeSeriesIntegrationRids().entries()));\n const timeSeriesSyncRidByReadableId = ridGenerator.getTimeSeriesSyncs();\n const propertyTypes = new Map();\n for (const [rid, propertyType] of Object.entries(objectType.objectType.propertyTypes)) {\n propertyTypes.set(rid, propertyType.type);\n }\n const columnShapes = ridGenerator.getColumnShapes().asMap();\n const directDatasourceColumnShapes = ridGenerator.getDirectDatasourceColumnShapes().asMap();\n\n // Build object type output shape\n const objectTypeOutputShape = {\n about: createLocalizedAbout(objectType.objectType.displayMetadata.displayName, objectType.objectType.displayMetadata.description ?? \"\"),\n editsSupport: objectType.entityMetadata?.arePatchesEnabled ? \"EDITS_ENABLED\" : \"EDITS_DISABLED\",\n objectsBackendVersion: \"V2\",\n propertyTypes: Array.from(propertyOutputShapeMap.keys()).map(val => ridGenerator.toBlockInternalId(val))\n };\n const blockShapes = {\n inputShapes: new Map(),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n\n // Add property output shapes\n for (const [readableId, propertyShape] of Array.from(propertyOutputShapeMap.entries())) {\n blockShapes.outputShapes.set(readableId, {\n type: \"property\",\n property: propertyShape\n });\n }\n\n // Add object type output shape\n blockShapes.outputShapes.set(objectReadableId, {\n type: \"objectType\",\n objectType: objectTypeOutputShape\n });\n\n // Extract shapes from datasources\n for (const ds of objectType.datasources) {\n const dsShapes = this.getShapesFromDatasource(ds, datasourcesByReadableId, directDatasourcesByReadableId, filesDatasourcesByReadableId, geotimeSeriesIntegrationRidByReadableId, propertyTypes, propertyReadableIdsByRid.asMap(), propertyOutputShapeMap, timeSeriesSyncRidByReadableId, columnShapes, directDatasourceColumnShapes, ridGenerator);\n for (const [id, shape] of Array.from(dsShapes.entries())) {\n blockShapes.inputShapes.set(id, shape);\n }\n }\n\n // Extract value type input shapes if present\n for (const propertyType of Object.values(objectType.objectType.propertyTypes)) {\n this.extractValueTypeInputShapeIfPresent(propertyType.valueType, propertyType.displayMetadata.displayName, propertyType.type, blockShapes, ridGenerator);\n }\n return blockShapes;\n }\n getShapeForProperty(objectBlockShapeId, propertyType, readableIdsForSptRid, ridGenerator) {\n const shape = {\n about: createLocalizedAbout(propertyType.displayMetadata.displayName, propertyType.displayMetadata.description ?? \"\"),\n type: this.convertPropertyTypeToMarketplaceType(propertyType.type),\n objectType: ridGenerator.toBlockInternalId(objectBlockShapeId)\n };\n if (propertyType.sharedPropertyTypeRid) {\n const sptReadableId = readableIdsForSptRid.get(propertyType.sharedPropertyTypeRid);\n if (sptReadableId) {\n shape.sharedPropertyType = ridGenerator.toBlockInternalId(sptReadableId);\n }\n }\n return shape;\n }\n getShapesFromDatasource(datasource, datasourcesByReadableId, directDatasourcesByReadableId, filesDatasourcesByReadableId, geotimeSeriesIntegrationRidByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, timeSeriesSyncRidByReadableId, columnReadableIds, directDatasourceColumnReadableIds, ridGenerator) {\n const dsDefinition = datasource.datasource;\n switch (dsDefinition.type) {\n case \"dataset\":\n return new Map();\n // Not implemented in original\n case \"datasetV2\":\n return this.getShapesFromDataset(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.datasetV2.datasetRid, dsDefinition.datasetV2.branchId, this.filterToRelevantColumnMappings(dsDefinition.datasetV2.propertyMapping), ridGenerator);\n case \"datasetV3\":\n return this.getShapesFromDataset(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.datasetV3.datasetRid, dsDefinition.datasetV3.branchId, this.filterToRelevantColumnMappings(dsDefinition.datasetV3.propertyMapping), ridGenerator);\n case \"derived\":\n return new Map();\n // Empty per original\n case \"direct\":\n return this.getShapesFromDataset(directDatasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, directDatasourceColumnReadableIds, dsDefinition.direct.directSourceRid, \"master\", this.filterToRelevantColumnMappings(dsDefinition.direct.propertyMapping), ridGenerator, [\"DATASET\", \"RESTRICTED_VIEW\", \"VIRTUAL_TABLE\"]);\n case \"editsOnly\":\n return new Map();\n case \"geotimeSeries\":\n return this.getShapesFromGeotimeSeriesIntegration(geotimeSeriesIntegrationRidByReadableId, dsDefinition.geotimeSeries.geotimeSeriesIntegrationRid);\n case \"media\":\n return new Map();\n case \"mediaSetView\":\n return this.getShapesFromMediaSetView(filesDatasourcesByReadableId, dsDefinition.mediaSetView.mediaSetViewLocator);\n case \"restrictedStream\":\n return new Map();\n case \"restrictedView\":\n return new Map();\n case \"restrictedViewV2\":\n return this.getShapesFromRestrictedView(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.restrictedViewV2.restrictedViewRid, this.filterToRelevantColumnMappings(dsDefinition.restrictedViewV2.propertyMapping), ridGenerator);\n case \"stream\":\n return this.getShapesFromStream(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.stream.streamLocator.streamLocatorRid, dsDefinition.stream.streamLocator.branchId, dsDefinition.stream.propertyMapping, ridGenerator);\n case \"streamV2\":\n return this.getShapesFromStream(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.streamV2.streamLocator.streamLocatorRid, dsDefinition.streamV2.streamLocator.branchId, dsDefinition.streamV2.propertyMapping, ridGenerator);\n case \"streamV3\":\n const mapping = new Map();\n for (const [rid, info] of Object.entries(dsDefinition.streamV3.propertyMapping)) {\n mapping.set(rid, this.getColumnNameFromPropertyTypeMappingInfo(info));\n }\n return this.getShapesFromStream(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, dsDefinition.streamV3.streamLocator.streamLocatorRid, dsDefinition.streamV3.streamLocator.branchId, mapping, ridGenerator);\n case \"table\":\n return new Map();\n case \"timeSeries\":\n return this.getShapesFromTimeSeriesSync(timeSeriesSyncRidByReadableId, propertyTypes, dsDefinition.timeSeries.properties, dsDefinition.timeSeries.timeSeriesSyncRid);\n default:\n return new Map();\n }\n }\n filterToRelevantColumnMappings(propertyMappings) {\n return Object.fromEntries(Object.entries(propertyMappings).filter(([, mapping]) => mapping.type === \"column\" || mapping.type === \"struct\"));\n }\n getShapesFromGeotimeSeriesIntegration(geotimeSeriesIntegrationRidByReadableId, geotimeSeriesIntegrationRid) {\n let readableId;\n for (const [id, rid] of geotimeSeriesIntegrationRidByReadableId.entries()) {\n if (rid === geotimeSeriesIntegrationRid) {\n readableId = id;\n break;\n }\n }\n if (!readableId) return new Map();\n const shape = {\n about: createLocalizedAbout(readableId, \"\")\n };\n return new Map([[readableId, {\n type: \"geotimeSeriesIntegration\",\n geotimeSeriesIntegration: shape\n }]]);\n }\n getShapesFromMediaSetView(filesDatasourcesByReadableId, mediaSetViewLocator // MediaSetViewLocator from OMS types\n ) {\n // Find the matching files datasource by comparing mediaSetRid\n let readableId;\n for (const [id, locator] of filesDatasourcesByReadableId.entries()) {\n if (locator.type === \"mediaSet\" && locator.mediaSet.rid === mediaSetViewLocator.mediaSetRid) {\n readableId = id;\n break;\n }\n }\n if (!readableId) return new Map();\n const shape = {\n about: createLocalizedAbout(readableId, \"\"),\n supportedTypes: [{\n type: \"mediaSet\",\n mediaSet: {\n pathPolicy: {\n type: \"any\",\n any: {}\n },\n mediaSchema: {\n type: \"any\",\n any: {}\n }\n }\n }]\n };\n return new Map([[readableId, {\n type: \"filesDatasource\",\n filesDatasource: shape\n }]]);\n }\n getShapesFromTimeSeriesSync(timeSeriesSyncRidByReadableId, propertyTypes, propertyTypeRids, timeSeriesSyncRid) {\n const readableId = timeSeriesSyncRidByReadableId.inverse().get(timeSeriesSyncRid);\n if (!readableId) return new Map();\n const timeSeriesSyncTypes = new Set(propertyTypeRids.map(rid => {\n const type = propertyTypes.get(rid);\n return type ? this.getTimeSeriesSyncType(type) : undefined;\n }).filter(t => t !== undefined));\n if (timeSeriesSyncTypes.size !== 1) {\n throw new Error(\"Invalid time series types\");\n }\n const syncType = Array.from(timeSeriesSyncTypes)[0];\n const shape = {\n about: createLocalizedAbout(readableId, \"\"),\n type: syncType\n };\n return new Map([[readableId, {\n type: \"timeSeriesSync\",\n timeSeriesSync: shape\n }]]);\n }\n getShapesFromStream(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, streamLocatorRid, branchId, propertyMapping, ridGenerator) {\n const streamLocator = {\n type: \"stream\",\n stream: {\n rid: streamLocatorRid,\n branch: branchId\n }\n };\n let datasourceReadableId;\n for (const [id, loc] of datasourcesByReadableId.entries()) {\n if (loc.type === \"stream\" && loc.stream.rid === streamLocator.stream.rid) {\n datasourceReadableId = id;\n break;\n }\n }\n if (!datasourceReadableId) return new Map();\n const propertyMappingMap = propertyMapping instanceof Map ? propertyMapping : new Map(Object.entries(propertyMapping));\n const columnShapes = this.getColumnShapes(streamLocator, columnReadableIds, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, datasourceReadableId, propertyMappingMap, ridGenerator, val => typeof val === \"string\" ? val : val);\n const datasourceInputShape = {\n about: createLocalizedAbout(datasourceReadableId, \"\"),\n supportedTypes: [\"STREAM\"],\n schema: Array.from(columnShapes.keys()).map(id => ridGenerator.toBlockInternalId(id))\n };\n const result = new Map([[datasourceReadableId, {\n type: \"tabularDatasource\",\n tabularDatasource: datasourceInputShape\n }]]);\n for (const [id, colShape] of columnShapes.entries()) {\n result.set(id, {\n type: \"datasourceColumn\",\n datasourceColumn: colShape\n });\n }\n return result;\n }\n getShapesFromDataset(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, datasetRid, branchId, propertyMapping, ridGenerator, supportedTypes = [\"DATASET\", \"RESTRICTED_VIEW\"]) {\n const datasourceLocator = {\n type: \"dataset\",\n dataset: {\n rid: datasetRid,\n branch: branchId\n }\n };\n let datasourceReadableId;\n for (const [id, loc] of datasourcesByReadableId.entries()) {\n if (loc.type === \"dataset\" && loc.dataset.rid === datasourceLocator.dataset.rid) {\n datasourceReadableId = id;\n break;\n }\n }\n if (!datasourceReadableId) return new Map();\n const propertyMappingMap = new Map(Object.entries(propertyMapping));\n const columnShapes = this.getColumnShapes(datasourceLocator, columnReadableIds, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, datasourceReadableId, propertyMappingMap, ridGenerator, val => {\n if (val.type === \"column\") return val.column;\n if (val.type === \"struct\") return val.struct.column;\n throw new Error(\"Error extracting column shapes\");\n });\n const datasourceInputShape = {\n about: createLocalizedAbout(datasourceReadableId, \"\"),\n supportedTypes,\n schema: Array.from(columnShapes.keys()).map(id => ridGenerator.toBlockInternalId(id))\n };\n const result = new Map([[datasourceReadableId, {\n type: \"tabularDatasource\",\n tabularDatasource: datasourceInputShape\n }]]);\n for (const [id, colShape] of Array.from(columnShapes.entries())) {\n result.set(id, {\n type: \"datasourceColumn\",\n datasourceColumn: colShape\n });\n }\n return result;\n }\n getShapesFromRestrictedView(datasourcesByReadableId, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, columnReadableIds, restrictedViewRid, propertyMapping, ridGenerator) {\n const datasourceLocator = {\n type: \"restrictedView\",\n restrictedView: {\n rid: restrictedViewRid\n }\n };\n let datasourceReadableId;\n for (const [id, loc] of datasourcesByReadableId.entries()) {\n if (loc.type === \"restrictedView\" && loc.restrictedView.rid === datasourceLocator.restrictedView.rid) {\n datasourceReadableId = id;\n break;\n }\n }\n if (!datasourceReadableId) return new Map();\n const propertyMappingMap = new Map(Object.entries(propertyMapping));\n const columnShapes = this.getColumnShapes(datasourceLocator, columnReadableIds, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, datasourceReadableId, propertyMappingMap, ridGenerator, val => {\n if (val.type === \"column\") return val.column;\n if (val.type === \"struct\") return val.struct.column;\n throw new Error(\"Error extracting column shapes\");\n });\n const datasourceInputShape = {\n about: createLocalizedAbout(datasourceReadableId, \"\"),\n supportedTypes: [\"RESTRICTED_VIEW\"],\n schema: Array.from(columnShapes.keys()).map(id => ridGenerator.toBlockInternalId(id))\n };\n const result = new Map([[datasourceReadableId, {\n type: \"tabularDatasource\",\n tabularDatasource: datasourceInputShape\n }]]);\n for (const [id, colShape] of Array.from(columnShapes.entries())) {\n result.set(id, {\n type: \"datasourceColumn\",\n datasourceColumn: colShape\n });\n }\n return result;\n }\n getColumnShapes(datasourceLocator, columnReadableIds, propertyTypes, propertyReadableIdsByRid, propertyOutputShapeMap, datasourceReadableId, columns, ridGenerator, columnNameGetter) {\n const result = new Map();\n for (const [propertyTypeRid, value] of Array.from(columns.entries())) {\n const propertyReadableId = propertyReadableIdsByRid.get(propertyTypeRid);\n if (!propertyReadableId) continue;\n const propertyOutputShape = propertyOutputShapeMap.get(propertyReadableId);\n if (!propertyOutputShape) continue;\n const resolvedShape = {\n datasource: datasourceLocator,\n name: columnNameGetter(value)\n };\n let columnReadableId;\n for (const [id, shape] of columnReadableIds.entries()) {\n if (shape.name === resolvedShape.name && this.datasourceLocatorsMatch(shape.datasource, resolvedShape.datasource)) {\n columnReadableId = id;\n break;\n }\n }\n if (!columnReadableId) continue;\n const propertyType = propertyTypes.get(propertyTypeRid);\n if (!propertyType) continue;\n const columnShape = {\n about: createLocalizedAbout(propertyOutputShape.about.fallbackTitle, \"\"),\n type: {\n type: \"concrete\",\n concrete: this.typeToConcreteDataType(propertyType)\n },\n datasource: ridGenerator.toBlockInternalId(datasourceReadableId),\n typeclasses: []\n };\n result.set(columnReadableId, columnShape);\n }\n return result;\n }\n getColumnNameFromPropertyTypeMappingInfo(info) {\n if (info.type === \"column\") return info.column;\n if (info.type === \"struct\") return info.struct.column;\n throw new Error(\"Edits not supported yet\");\n }\n extractValueTypeInputShapeIfPresent(valueTypeReference, displayName, type, blockShapes, ridGenerator) {\n if (!valueTypeReference) return;\n const valueTypeInput = {\n type: \"valueType\",\n valueType: {\n about: createLocalizedAbout(`Value Type Input for ${displayName}`, \"\"),\n baseType: typeToMarketplaceBaseType(type)\n }\n };\n const mappingEntry = ridGenerator.valueTypeMappingForReference(valueTypeReference);\n blockShapes.inputShapes.set(mappingEntry.input, valueTypeInput);\n }\n getTimeSeriesSyncType(type) {\n if (type.type !== \"experimentalTimeDependentV1\") return undefined;\n const metadata = type.experimentalTimeDependentV1.seriesValueMetadata;\n const isNumeric = metadata.type === \"numeric\";\n return isNumeric ? \"NUMERIC\" : \"CATEGORICAL\";\n }\n convertPropertyTypeToMarketplaceType(type) {\n return typeToMarketplaceObjectPropertyType(type);\n }\n typeToConcreteDataType(type) {\n return typeToConcreteDataType(type);\n }\n datasourceLocatorsMatch(a, b) {\n if (a.type !== b.type) return false;\n switch (a.type) {\n case \"dataset\":\n return b.type === \"dataset\" && a.dataset.rid === b.dataset.rid && a.dataset.branch === b.dataset.branch;\n case \"stream\":\n return b.type === \"stream\" && a.stream.rid === b.stream.rid && a.stream.branch === b.stream.branch;\n case \"restrictedView\":\n return b.type === \"restrictedView\" && a.restrictedView.rid === b.restrictedView.rid;\n default:\n return false;\n }\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 { ReadableIdGenerator } from \"../../../util/generateRid.js\";\nimport { typeToMarketplaceBaseType, typeToMarketplaceObjectPropertyType } from \"../typeVisitors.js\";\nimport { LinkTypeShapeExtractor } from \"./LinkTypeShapeExtractor.js\";\nimport { ObjectTypeShapeExtractor } from \"./ObjectTypeShapeExtractor.js\";\nexport const MIGRATION_SHAPE_READABLE_ID = \"migration-input\";\nconst SPT_INPUT_SHAPE_METADATA = {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n};\n\n/**\n * Helper to create LocalizedTitleAndDescription with empty localizations\n */\nfunction createLocalizedAbout(fallbackTitle, fallbackDescription) {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {}\n };\n}\n\n/**\n * Main entry point for extracting all shapes from an ontology\n */\nexport async function getShapes(ontologyBlockDataV2, ridGenerator, functionsIr, randomnessKey) {\n const allBlockShapes = {\n inputShapes: new Map(),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n const outputSharedPropertyTypeRids = new Set(Object.keys(ontologyBlockDataV2.sharedPropertyTypes));\n const multiInterfaceSptApiNames = getMultiInterfaceSptApiNames(ontologyBlockDataV2.interfaceTypes);\n\n // Interfaces\n for (const [_rid, interfaceType] of Object.entries(ontologyBlockDataV2.interfaceTypes)) {\n extractInterfaceType(allBlockShapes.outputShapes, allBlockShapes.inputShapes, allBlockShapes.inputShapeMetadata, ontologyBlockDataV2.knownIdentifiers, outputSharedPropertyTypeRids, multiInterfaceSptApiNames, interfaceType.interfaceType, ridGenerator);\n }\n // Shared Property Types\n for (const [_rid, sharedPropertyTypeBlock] of Object.entries(ontologyBlockDataV2.sharedPropertyTypes)) {\n extractSharedPropertyType(allBlockShapes, sharedPropertyTypeBlock.sharedPropertyType, ridGenerator);\n }\n\n // Objects\n const objectReadableIds = ridGenerator.getObjectTypeRids().inverse();\n for (const [rid, objectType] of Object.entries(ontologyBlockDataV2.objectTypes)) {\n const readableId = objectReadableIds.get(rid);\n if (readableId) {\n const objectExtractor = new ObjectTypeShapeExtractor(randomnessKey);\n const objectShapes = objectExtractor.extract(readableId, objectType, ridGenerator);\n consumeBlockShapes(allBlockShapes, objectShapes);\n }\n }\n\n // Marking shapes\n const markingShapes = getMarkingShapes(ontologyBlockDataV2, ridGenerator);\n consumeBlockShapes(allBlockShapes, markingShapes);\n\n // Links\n const linkReadableIds = ridGenerator.getLinkTypeRids().inverse();\n for (const [rid, linkType] of Object.entries(ontologyBlockDataV2.linkTypes)) {\n const readableId = linkReadableIds.get(rid);\n if (readableId) {\n const linkExtractor = new LinkTypeShapeExtractor();\n const linkShapes = linkExtractor.extract(readableId, linkType, ridGenerator);\n consumeBlockShapes(allBlockShapes, linkShapes);\n }\n }\n\n // Actions\n const {\n ActionTypeShapeExtractor\n } = await import(\"./ActionTypeShapeExtractor.js\");\n for (const [_rid, actionType] of Object.entries(ontologyBlockDataV2.actionTypes || {})) {\n const actionExtractor = new ActionTypeShapeExtractor();\n const actionShapes = actionExtractor.extract(actionType, ridGenerator, ontologyBlockDataV2.knownIdentifiers, functionsIr);\n consumeBlockShapes(allBlockShapes, actionShapes);\n }\n\n // Multipass groups\n for (const [readableId, groupId] of ridGenerator.getGroupIds().entries()) {\n const groupShapes = extractMultipassGroup(groupId, readableId);\n consumeBlockShapes(allBlockShapes, groupShapes);\n }\n\n // Migration shape\n const migrationShapes = getMigrationShape();\n consumeBlockShapes(allBlockShapes, migrationShapes);\n\n // Direct datasource blocks publish the same shapes under produced-* IDs.\n // Recommend those outputs for the ontology block's direct datasource inputs.\n const directDatasourceReadableIds = new Set([...Array.from(ridGenerator.getDirectDatasourceLocators().entries()).map(([readableId]) => readableId), ...Array.from(ridGenerator.getDirectDatasourceColumnShapes().entries()).map(([readableId]) => readableId)]);\n for (const readableId of directDatasourceReadableIds) {\n if (allBlockShapes.inputShapes.has(readableId)) {\n allBlockShapes.inputMappings.push({\n input: readableId,\n output: ReadableIdGenerator.getProducedReadableId(readableId)\n });\n }\n }\n return allBlockShapes;\n}\n\n/**\n * Extract interface type shapes\n */\nfunction extractInterfaceType(outputShapeMap, inputShapeMap, inputShapeMetadataMap, knownMarketplaceIdentifiers, outputSharedPropertyTypeRids, multiInterfaceSptApiNames, interfaceType, ridGenerator) {\n const interfaceReadableId = getReadableIdForInterface(interfaceType.apiName);\n // SPT-backed properties must be present in both the legacy SPT reference list\n // and the modern IPT reference list. Marketplace follows the legacy edge to\n // resolve the SPT backing an IPT when wiring producer and consumer shapes.\n const propertiesV3 = Object.values(interfaceType.propertiesV3 ?? {});\n const sharedPropertyTypes = propertiesV3.length > 0 ? propertiesV3.flatMap(property => property.type === \"sharedPropertyBasedPropertyType\" ? [property.sharedPropertyBasedPropertyType.sharedPropertyType] : []) : Object.values(interfaceType.propertiesV2 ?? {}).length > 0 ? Object.values(interfaceType.propertiesV2).map(property => property.sharedPropertyType) : interfaceType.properties ?? [];\n const properties = sharedPropertyTypes.map(spt => {\n const sptId = knownMarketplaceIdentifiers.sharedPropertyTypes?.[spt.rid];\n return sptId ?? spt.rid;\n });\n // Build propertiesV2 from propertiesV3 entries using knownMarketplaceIdentifiers\n const propertiesV2 = [];\n for (const iptRid of Object.keys(interfaceType.propertiesV3 ?? {})) {\n const blockInternalId = knownMarketplaceIdentifiers.interfacePropertyTypes?.[iptRid];\n if (blockInternalId) {\n propertiesV2.push(blockInternalId);\n }\n }\n\n // Build interface type output shape\n const interfaceTypeOutputShape = {\n about: createLocalizedAbout(interfaceType.displayMetadata.displayName, interfaceType.displayMetadata.description ?? \"\"),\n properties,\n propertiesV2,\n links: (interfaceType.links ?? []).map(ilt => {\n const iltId = knownMarketplaceIdentifiers.interfaceLinkTypes?.[ilt.rid];\n return iltId ?? ilt.rid;\n }),\n extendsInterfaces: (interfaceType.extendsInterfaces ?? []).map(it => {\n const itId = knownMarketplaceIdentifiers.interfaceTypes?.[it];\n return itId ?? it;\n }),\n actionTypeConstraints: (interfaceType.actionTypeConstraints ?? []).map(constraint => {\n const constraintId = knownMarketplaceIdentifiers.interfaceActionTypeConstraints?.[constraint.rid];\n return constraintId ?? constraint.rid;\n })\n };\n\n // Add shared property type input shapes for properties not in output,\n // and extract value type input shapes for interface-defined properties\n const blockShapesRef = {\n inputShapes: inputShapeMap,\n outputShapes: outputShapeMap,\n inputShapeMetadata: inputShapeMetadataMap,\n inputMappings: []\n };\n for (const [_propertyRid, property] of Object.entries(interfaceType.propertiesV3) ?? []) {\n if (property.type === \"sharedPropertyBasedPropertyType\" && !outputSharedPropertyTypeRids.has(property.sharedPropertyBasedPropertyType.sharedPropertyType.rid)) {\n const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;\n const sptReadableId = getReadableIdForSpt(spt.apiName);\n const sharedPropInputShape = {\n about: getTitleAndDescriptionForSharedPropertyType(spt),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)\n }\n };\n inputShapeMap.set(sptReadableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: sharedPropInputShape\n });\n inputShapeMetadataMap.set(sptReadableId, SPT_INPUT_SHAPE_METADATA);\n } else if (property.type === \"interfaceDefinedPropertyType\") {\n // TODO: once we have published output shapes for a while, add IPT input shapes\n const idp = property.interfaceDefinedPropertyType;\n extractValueTypeInputShapeIfPresent(idp.constraints.valueType ?? undefined, idp.displayMetadata.displayName, idp.type, blockShapesRef, ridGenerator);\n }\n }\n\n // For every property directly defined on the interface, generate an IPT output shape.\n // IDPs can only be defined on a single interface so they are guaranteed to only be added once here.\n // SPT-backed properties may be added multiple times here with the latest winning out, however,\n // this is not an issue as the only thing that will change is the interfaceTypeReference which is unused\n for (const [_propertyRid, property] of Object.entries(interfaceType.propertiesV3) ?? []) {\n const outputShapeEntry = getInterfacePropertyTypeOutputShape(knownMarketplaceIdentifiers, interfaceType, multiInterfaceSptApiNames, property, interfaceReadableId, ridGenerator);\n outputShapeMap.set(outputShapeEntry.id, outputShapeEntry.outputShape);\n }\n\n // Add interface link type output shapes\n for (const interfaceLinkType of interfaceType.links ?? []) {\n const outputShape = getInterfaceLinkTypeOutputShape(knownMarketplaceIdentifiers, interfaceType, interfaceLinkType, ridGenerator);\n outputShapeMap.set(outputShape.id, outputShape.outputShape);\n }\n\n // Add action type constraint and parameter constraint output shapes\n for (const actionTypeConstraint of interfaceType.actionTypeConstraints ?? []) {\n const constraintOutputShape = getInterfaceActionTypeConstraintOutputShape(knownMarketplaceIdentifiers, interfaceType, actionTypeConstraint, ridGenerator);\n outputShapeMap.set(constraintOutputShape.id, constraintOutputShape.outputShape);\n for (const [paramRid, paramConstraint] of Object.entries(actionTypeConstraint.parameters ?? {})) {\n const paramOutputShape = getInterfaceParameterConstraintOutputShape(knownMarketplaceIdentifiers, actionTypeConstraint, paramRid, paramConstraint, ridGenerator);\n outputShapeMap.set(paramOutputShape.id, paramOutputShape.outputShape);\n }\n }\n\n // Add interface type output shape\n outputShapeMap.set(interfaceReadableId, {\n type: \"interfaceType\",\n interfaceType: interfaceTypeOutputShape\n });\n}\n\n/**\n * Get interface property type output shape for either interface-defined or SPT-backed properties.\n */\nfunction getInterfacePropertyTypeOutputShape(knownMarketplaceIdentifiers, interfaceType, multiInterfaceSptApiNames, property, interfaceReadableId, ridGenerator) {\n const interfaceTypeRef = ridGenerator.toBlockInternalId(interfaceReadableId);\n if (property.type === \"interfaceDefinedPropertyType\") {\n const idp = property.interfaceDefinedPropertyType;\n const readableId = ReadableIdGenerator.getForInterfaceProperty(interfaceType.apiName, idp.apiName);\n const shape = {\n about: createLocalizedAbout(idp.displayMetadata.displayName, idp.displayMetadata.description ?? idp.displayMetadata.displayName),\n interfaceType: interfaceTypeRef,\n type: typeToMarketplaceObjectPropertyType(idp.type),\n requireImplementation: idp.constraints.requireImplementation\n };\n return {\n id: readableId,\n outputShape: {\n type: \"interfacePropertyType\",\n interfacePropertyType: shape\n }\n };\n } else {\n const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;\n const sptApiName = spt.apiName;\n const readableId = multiInterfaceSptApiNames.has(sptApiName) ? ReadableIdGenerator.getForSptBackedInterfaceProperty(sptApiName) : ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, sptApiName);\n const sptBlockInternalId = knownMarketplaceIdentifiers.sharedPropertyTypes?.[spt.rid];\n const shape = {\n about: getTitleAndDescriptionForSharedPropertyType(spt),\n interfaceType: interfaceTypeRef,\n type: typeToMarketplaceObjectPropertyType(spt.type),\n requireImplementation: property.sharedPropertyBasedPropertyType.requireImplementation,\n sharedPropertyType: sptBlockInternalId\n };\n return {\n id: readableId,\n outputShape: {\n type: \"interfacePropertyType\",\n interfacePropertyType: shape\n }\n };\n }\n}\n\n/**\n * Returns the set of SPT api names that are used by more than one interface type.\n * For these SPTs, the shape ID must not include the interface api name to avoid RID collisions.\n */\nexport function getMultiInterfaceSptApiNames(interfaces) {\n const seen = new Set();\n const shared = new Set();\n for (const interfaceBlock of Object.values(interfaces)) {\n for (const property of Object.values(interfaceBlock.interfaceType.propertiesV3 ?? {})) {\n if (property.type === \"sharedPropertyBasedPropertyType\") {\n const apiName = property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName;\n if (seen.has(apiName)) {\n shared.add(apiName);\n }\n seen.add(apiName);\n }\n }\n }\n return shared;\n}\n\n/**\n * Get interface link type output shape\n */\nfunction getInterfaceLinkTypeOutputShape(knownMarketplaceIdentifiers, interfaceType, interfaceLinkType, ridGenerator) {\n // Build linked entity type reference\n const interfaceRidOrUndefined = interfaceLinkType.linkedEntityTypeId.type === \"interfaceType\" ? interfaceLinkType.linkedEntityTypeId.interfaceType : undefined;\n if (!interfaceRidOrUndefined) {\n throw new Error(\"Object link references not implemented\");\n }\n const linkedEntityTypeRef = ridGenerator.toBlockInternalId(ridGenerator.getInterfaceRids().inverse().get(interfaceRidOrUndefined));\n\n // Map cardinality\n const cardinality = interfaceLinkType.cardinality === \"SINGLE\" ? \"SINGLE\" : \"MANY\";\n const shape = {\n about: createLocalizedAbout(interfaceLinkType.metadata.displayName, interfaceLinkType.metadata.description),\n interfaceType: knownMarketplaceIdentifiers.interfaceTypes?.[interfaceType.rid] ?? interfaceType.rid,\n linkedEntityType: {\n type: \"interfaceType\",\n interfaceType: linkedEntityTypeRef\n },\n cardinality,\n required: interfaceLinkType.required\n };\n const readableId = getReadableIdForInterfaceLink(interfaceType.apiName, interfaceLinkType.metadata.apiName);\n return {\n id: readableId,\n outputShape: {\n type: \"interfaceLinkType\",\n interfaceLinkType: shape\n }\n };\n}\n\n/**\n * Get interface action type constraint output shape\n */\nfunction getInterfaceActionTypeConstraintOutputShape(knownMarketplaceIdentifiers, interfaceType, actionTypeConstraint, ridGenerator) {\n const interfaceReadableId = getReadableIdForInterface(interfaceType.apiName);\n const interfaceTypeRef = ridGenerator.toBlockInternalId(interfaceReadableId);\n const parameterConstraintRefs = Object.keys(actionTypeConstraint.parameters ?? {}).map(paramRid => {\n const paramId = knownMarketplaceIdentifiers.interfaceParameterConstraints?.[paramRid];\n return paramId ?? paramRid;\n });\n const shape = {\n about: createLocalizedAbout(actionTypeConstraint.metadata.displayName, actionTypeConstraint.metadata.description ?? actionTypeConstraint.metadata.displayName),\n interfaceType: interfaceTypeRef,\n parameterConstraints: parameterConstraintRefs,\n requireImplementation: actionTypeConstraint.requireImplementation\n };\n const readableId = ReadableIdGenerator.getForInterfaceActionTypeConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName);\n return {\n id: readableId,\n outputShape: {\n type: \"interfaceActionTypeConstraint\",\n interfaceActionTypeConstraint: shape\n }\n };\n}\n\n/**\n * Get interface parameter constraint output shape\n */\nfunction getInterfaceParameterConstraintOutputShape(knownMarketplaceIdentifiers, actionTypeConstraint, paramRid, paramConstraint, ridGenerator) {\n const actionTypeConstraintId = knownMarketplaceIdentifiers.interfaceActionTypeConstraints?.[actionTypeConstraint.rid];\n const actionTypeConstraintRef = actionTypeConstraintId ?? actionTypeConstraint.rid;\n const shape = {\n about: createLocalizedAbout(paramConstraint.displayMetadata.displayName, paramConstraint.displayMetadata.displayName),\n actionTypeConstraint: actionTypeConstraintRef,\n requireImplementation: paramConstraint.requireImplementation,\n type: paramConstraint.type\n };\n const paramReadableId = ridGenerator.getInterfaceParameterConstraintRids().inverse().get(paramRid);\n if (!paramReadableId) {\n throw new Error(`Missing readable ID for interface parameter constraint RID ${paramRid}`);\n }\n return {\n id: paramReadableId,\n outputShape: {\n type: \"interfaceParameterConstraint\",\n interfaceParameterConstraint: shape\n }\n };\n}\n\n/**\n * Extract shared property type shapes\n */\nfunction extractSharedPropertyType(blockShapes, sharedPropertyType, ridGenerator) {\n const readableId = getReadableIdForSpt(sharedPropertyType.apiName);\n const propertyType = typeToMarketplaceObjectPropertyType(sharedPropertyType.type);\n const outputShape = {\n about: getTitleAndDescriptionForSharedPropertyType(sharedPropertyType),\n type: propertyType\n };\n blockShapes.outputShapes.set(readableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: outputShape\n });\n extractValueTypeInputShapeIfPresent(sharedPropertyType.valueType ?? undefined, sharedPropertyType.displayMetadata.displayName, sharedPropertyType.type, blockShapes, ridGenerator);\n}\n\n/**\n * Extract value type input shape if present\n */\nexport function extractValueTypeInputShapeIfPresent(maybeValueTypeReference, displayName, type, blockShapes, ridGenerator) {\n if (!maybeValueTypeReference) return;\n const valueTypeInput = {\n type: \"valueType\",\n valueType: {\n about: createLocalizedAbout(`Value Type Input for ${displayName}`, \"\"),\n baseType: typeToMarketplaceBaseType(type)\n }\n };\n const mappingEntry = ridGenerator.valueTypeMappingForReference(maybeValueTypeReference);\n blockShapes.inputShapes.set(mappingEntry.input, valueTypeInput);\n}\n\n/**\n * Get title and description for shared property type\n */\nfunction getTitleAndDescriptionForSharedPropertyType(sharedPropertyType) {\n return createLocalizedAbout(sharedPropertyType.displayMetadata.displayName, sharedPropertyType.displayMetadata.description ?? sharedPropertyType.displayMetadata.displayName);\n}\n\n/**\n * Extract multipass group shape\n */\nfunction extractMultipassGroup(groupId, readableId) {\n const multipassGroup = {\n about: createLocalizedAbout(`Group ${groupId}`, \"\")\n };\n return {\n inputShapes: new Map([[readableId, {\n type: \"multipassGroup\",\n multipassGroup\n }]]),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n}\n\n/**\n * Get migration shape\n */\nfunction getMigrationShape() {\n const migrationShape = {\n about: createLocalizedAbout(\"Allow Ontology schema migrations\", \"Required user acknowledgement for any breaking schema change that requires an Ontology schema migration.\")\n };\n return {\n inputShapes: new Map([[MIGRATION_SHAPE_READABLE_ID, {\n type: \"allowOntologySchemaMigrations\",\n allowOntologySchemaMigrations: migrationShape\n }]]),\n outputShapes: new Map(),\n inputShapeMetadata: new Map([[MIGRATION_SHAPE_READABLE_ID, {\n isOptional: true,\n isAccessedInReconcile: false\n }]]),\n inputMappings: []\n };\n}\nconst MAX_CLASS_DESC = \"The maximum classification for data under mandatory control property types and/or the max classification\" + \" allowed on an action type classification parameter.\";\n\n/**\n * Get properties for a datasource definition (keys of propertyMapping).\n */\nfunction getPropertiesForDatasource(datasourceDef) {\n const dsType = datasourceDef.type;\n let propertyMapping;\n switch (dsType) {\n case \"dataset\":\n propertyMapping = datasourceDef.dataset?.propertyMapping;\n break;\n case \"datasetV2\":\n propertyMapping = datasourceDef.datasetV2?.propertyMapping;\n break;\n case \"datasetV3\":\n propertyMapping = datasourceDef.datasetV3?.propertyMapping;\n break;\n case \"direct\":\n propertyMapping = datasourceDef.direct?.propertyMapping;\n break;\n case \"restrictedView\":\n propertyMapping = datasourceDef.restrictedView?.propertyMapping;\n break;\n case \"restrictedViewV2\":\n propertyMapping = datasourceDef.restrictedViewV2?.propertyMapping;\n break;\n case \"stream\":\n propertyMapping = datasourceDef.stream?.propertyMapping;\n break;\n case \"streamV2\":\n propertyMapping = datasourceDef.streamV2?.propertyMapping;\n break;\n case \"streamV3\":\n propertyMapping = datasourceDef.streamV3?.propertyMapping;\n break;\n default:\n return new Set();\n }\n return new Set(propertyMapping ? Object.keys(propertyMapping) : []);\n}\nfunction getMarkingType(type) {\n if (type.type === \"array\") {\n return getMarkingType(type.array.subtype);\n }\n return type.type === \"marking\" ? type.marking.markingType : undefined;\n}\n\n/**\n * Extract marking shapes from the ontology block data.\n * Port of Java's MarkingShapeExtractor.getMarkingShapes().\n */\nfunction getMarkingShapes(ontologyBlockDataV2, ridGenerator) {\n // Collect CBAC and mandatory marking constraints across all object types\n const cbacMarkingsAndAffectedProps = new Map();\n const mandatoryMarkingsAndAffectedProps = new Map();\n // CBAC markings from additionalMandatory.markings in property security groups\n const additionalCbacMarkingsAndAffectedProps = new Map();\n for (const objectType of Object.values(ontologyBlockDataV2.objectTypes)) {\n const objectApiName = objectType.objectType.apiName ?? \"\";\n\n // Identify CBAC and mandatory marking properties by PropertyTypeRid\n const cbacReadableIdsByRid = new Map();\n const mandatoryReadableIdsByRid = new Map();\n for (const [propertyRid, propertyType] of Object.entries(objectType.objectType.propertyTypes)) {\n const markingType = getMarkingType(propertyType.type);\n if (markingType) {\n const propertyApiName = propertyType.apiName ?? propertyType.displayMetadata?.displayName;\n if (propertyApiName) {\n const readableId = ReadableIdGenerator.getForObjectProperty(objectApiName, propertyApiName);\n if (markingType === \"CBAC\") {\n cbacReadableIdsByRid.set(propertyRid, readableId);\n } else if (markingType === \"MANDATORY\") {\n mandatoryReadableIdsByRid.set(propertyRid, readableId);\n }\n }\n }\n }\n\n // For each datasource, extract marking constraints\n for (const ds of objectType.datasources) {\n const propertiesForDs = getPropertiesForDatasource(ds.datasource);\n\n // Find CBAC and mandatory props affected by this datasource\n const cbacPropsAffected = new Set();\n for (const rid of cbacReadableIdsByRid.keys()) {\n if (propertiesForDs.has(rid)) {\n cbacPropsAffected.add(rid);\n }\n }\n const mandatoryPropsAffected = new Set();\n for (const rid of mandatoryReadableIdsByRid.keys()) {\n if (propertiesForDs.has(rid)) {\n mandatoryPropsAffected.add(rid);\n }\n }\n if (cbacPropsAffected.size === 0 && mandatoryPropsAffected.size === 0) {\n continue;\n }\n const dataSecurity = ds.dataSecurity;\n if (!dataSecurity) continue;\n if (cbacPropsAffected.size > 0 && dataSecurity.classificationConstraint) {\n const markings = dataSecurity.classificationConstraint.markings ?? [];\n const markingId = markings[0];\n if (markingId) {\n const existing = cbacMarkingsAndAffectedProps.get(markingId) ?? new Set();\n for (const rid of cbacPropsAffected) {\n const readableId = cbacReadableIdsByRid.get(rid);\n if (readableId) existing.add(readableId);\n }\n cbacMarkingsAndAffectedProps.set(markingId, existing);\n }\n }\n if (mandatoryPropsAffected.size > 0 && dataSecurity.markingConstraint) {\n const markingIds = dataSecurity.markingConstraint.markingIds ?? [];\n const markingId = markingIds[0];\n if (markingId) {\n const existing = mandatoryMarkingsAndAffectedProps.get(markingId) ?? new Set();\n for (const rid of mandatoryPropsAffected) {\n const readableId = mandatoryReadableIdsByRid.get(rid);\n if (readableId) existing.add(readableId);\n }\n mandatoryMarkingsAndAffectedProps.set(markingId, existing);\n }\n }\n\n // Extract CBAC markings from additionalMandatory.markings in property security groups\n const dsDef = ds.datasource;\n const innerDef = dsDef[dsDef.type];\n const groups = innerDef?.propertySecurityGroups?.groups ?? [];\n for (const group of groups) {\n const additionalMarkings = group.security?.granular?.viewPolicy?.additionalMandatory?.markings ?? [];\n if (additionalMarkings.length === 0) continue;\n const groupPropertyRids = group.properties ?? [];\n for (const markingId of additionalMarkings) {\n const existing = additionalCbacMarkingsAndAffectedProps.get(markingId) ?? new Set();\n for (const propRid of groupPropertyRids) {\n // Look up the property apiName from the object type's propertyTypes\n const propType = objectType.objectType.propertyTypes[propRid];\n if (propType) {\n const propApiName = propType.apiName ?? propType.displayMetadata?.displayName;\n if (propApiName) {\n existing.add(ReadableIdGenerator.getForObjectProperty(objectApiName, propApiName));\n }\n }\n }\n additionalCbacMarkingsAndAffectedProps.set(markingId, existing);\n }\n }\n }\n }\n\n // Build marking shapes\n const inputShapes = new Map();\n for (const [markingId, props] of cbacMarkingsAndAffectedProps) {\n const readableId = ReadableIdGenerator.getForMarking(markingId, \"CBAC\");\n const shape = {\n about: createLocalizedAbout(`Max Classification ${markingId}`, MAX_CLASS_DESC),\n operation: \"USE\",\n affectedShapes: Array.from(props).map(p => ridGenerator.toBlockInternalId(p)),\n supportedMarkingsType: \"CBAC\",\n stableId: markingId\n };\n inputShapes.set(readableId, {\n type: \"markings\",\n markings: shape\n });\n }\n for (const [markingId, props] of additionalCbacMarkingsAndAffectedProps) {\n const readableId = ReadableIdGenerator.getForMarking(markingId, \"CBAC\");\n const shape = {\n about: createLocalizedAbout(`Marking ${markingId}`, \"Marking\"),\n operation: \"USE\",\n affectedShapes: Array.from(props).map(p => ridGenerator.toBlockInternalId(p)),\n supportedMarkingsType: \"CBAC\",\n stableId: markingId\n };\n inputShapes.set(readableId, {\n type: \"markings\",\n markings: shape\n });\n }\n for (const [markingId, props] of mandatoryMarkingsAndAffectedProps) {\n const readableId = ReadableIdGenerator.getForMarking(markingId, \"MANDATORY\");\n const shape = {\n about: createLocalizedAbout(`Max Marking ${markingId}`, \"Max Marking\"),\n operation: \"USE\",\n affectedShapes: Array.from(props).map(p => ridGenerator.toBlockInternalId(p)),\n supportedMarkingsType: \"MANDATORY\",\n stableId: markingId\n };\n inputShapes.set(readableId, {\n type: \"markings\",\n markings: shape\n });\n }\n return {\n inputShapes,\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n}\n\n/**\n * Consume (merge) block shapes into the target\n */\nfunction consumeBlockShapes(target, source) {\n for (const [key, value] of source.inputShapes.entries()) {\n target.inputShapes.set(key, value);\n }\n for (const [key, value] of source.outputShapes.entries()) {\n target.outputShapes.set(key, value);\n }\n for (const [key, value] of source.inputShapeMetadata.entries()) {\n target.inputShapeMetadata.set(key, value);\n }\n for (const mapping of source.inputMappings) {\n target.inputMappings.push(mapping);\n }\n}\n\n// Placeholder functions for readable ID generation\n// These should match the Java ReadableIdGenerator patterns\n\nfunction getReadableIdForSpt(apiName) {\n return ReadableIdGenerator.getForSpt(apiName);\n}\nfunction getReadableIdForInterface(apiName) {\n return ReadableIdGenerator.getForInterface(apiName);\n}\nfunction getReadableIdForInterfaceLink(interfaceApiName, linkApiName) {\n return ReadableIdGenerator.getForInterfaceLinkType(interfaceApiName, linkApiName);\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 { cleanAndValidateLinkTypeId, isInterfaceSharedPropertyType, OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { ReadableIdGenerator } from \"../../util/generateRid.js\";\nimport { convertAction } from \"./convertActionHelpers.js\";\nimport { convertInterface } from \"./convertInterface.js\";\nimport { convertLink } from \"./convertLink.js\";\nimport { convertObject } from \"./convertObject.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nimport { getMultiInterfaceSptApiNames, MIGRATION_SHAPE_READABLE_ID } from \"./shapeExtractors/IrShapeExtractor.js\";\nfunction toActionTypeRestrictionStatus(p) {\n return {\n hasRolesApplied: true,\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nfunction toObjectTypeRestrictionStatus(p) {\n return {\n restrictedByDatasources: false,\n editRestrictedByDatasources: false,\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nfunction toLinkTypeRestrictionStatus(p) {\n return {\n restrictedByDatasources: false,\n editRestrictedByDatasources: false,\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nfunction toInterfaceTypeRestrictionStatus(p) {\n return {\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nfunction toSharedPropertyTypeRestrictionStatus(p) {\n return {\n publicProject: p === \"publicProject\",\n ontologyPackageRid: typeof p === \"object\" ? p.ontologyPackageRid : null\n };\n}\nexport function convertOntologyDefinitionToWireBlockData(ontology, ridGenerator, allOntologies, functionsIr) {\n const ontologiesToScan = allOntologies ?? [ontology];\n\n // Convert all entity types first to populate ridGenerator's BiMaps\n const objectTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).map(([apiName, objectType]) => {\n return [ridGenerator.generateRidForObjectType(apiName), convertObject(objectType, ridGenerator)];\n }));\n const sharedPropertyTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]).map(([apiName, spt]) => [ridGenerator.generateSptRid(apiName), {\n sharedPropertyType: convertSpt(spt, ridGenerator)\n }]));\n const interfaceTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).map(([apiName, interfaceType]) => {\n return [ridGenerator.generateRidForInterface(apiName), {\n interfaceType: convertInterface(interfaceType, ridGenerator)\n }];\n }));\n const linkTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.LINK_TYPE]).map(([id, link]) => {\n return [ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(id)), convertLink(link, ridGenerator)];\n }));\n const actionTypes = Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.ACTION_TYPE]).map(([apiName, action]) => {\n const converted = convertAction(action, ridGenerator, functionsIr);\n if (converted === undefined) return undefined;\n return [ridGenerator.generateRidForActionType(apiName), converted];\n }).filter(entry => entry !== undefined));\n const interfacePropertyMappings = {\n ...getImportedInterfacePropertyMappings(ontologiesToScan.filter(candidate => candidate !== ontology), ridGenerator),\n ...getInterfacePropertyMappings(interfaceTypes, ridGenerator)\n };\n\n // Build knownIdentifiers from ridGenerator's BiMaps\n const knownIdentifiers = buildKnownIdentifiers(ontology, ridGenerator, ontologiesToScan, interfacePropertyMappings);\n return {\n objectTypes,\n sharedPropertyTypes,\n interfaceTypes,\n linkTypes,\n actionTypes,\n // TODO: Add proper blockOutputCompassLocations mapping\n blockOutputCompassLocations: {},\n knownIdentifiers,\n ruleSets: {},\n blockPermissionInformation: {\n actionTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.ACTION_TYPE]).filter(([_, action]) => action.validation || action.permission).map(([apiName, action]) => {\n return [ridGenerator.generateRidForActionType(apiName), {\n restrictionStatus: toActionTypeRestrictionStatus(action.permission ?? \"roles\")\n }];\n }))),\n objectTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).filter(([_, objectType]) => objectType.permission != null).map(([apiName, objectType]) => {\n return [ridGenerator.generateRidForObjectType(apiName), {\n restrictionStatus: toObjectTypeRestrictionStatus(objectType.permission)\n }];\n }))),\n linkTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.LINK_TYPE]).filter(([_, link]) => link.permission != null).map(([id, link]) => {\n return [ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(id)), {\n restrictionStatus: toLinkTypeRestrictionStatus(link.permission)\n }];\n }))),\n interfaceTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).filter(([_, iface]) => iface.permission != null).map(([apiName, iface]) => {\n return [ridGenerator.generateRidForInterface(apiName), {\n restrictionStatus: toInterfaceTypeRestrictionStatus(iface.permission)\n }];\n }))),\n sharedPropertyTypes: Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ontology[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]).filter(([_, spt]) => spt.permission != null).map(([apiName, spt]) => {\n return [ridGenerator.generateSptRid(apiName), {\n restrictionStatus: toSharedPropertyTypeRestrictionStatus(spt.permission)\n }];\n })))\n }\n };\n}\nfunction buildKnownIdentifiers(ontology, ridGenerator, ontologiesToScan, interfacePropertyMappings) {\n // Interface types: InterfaceTypeRid -> BlockInternalId\n const interfaceMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Shared property types: SharedPropertyTypeRid -> BlockInternalId\n const sharedPropertyMappings = Object.fromEntries(Array.from(ridGenerator.getSharedPropertyTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Interface link types: InterfaceLinkTypeRid -> BlockInternalId\n const interfaceLinkMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceLinkTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Interface action type constraints: InterfaceActionTypeConstraintRid -> BlockInternalId\n const interfaceActionTypeConstraintMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceActionTypeConstraintRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Interface parameter constraints: InterfaceParameterConstraintRid -> BlockInternalId\n const interfaceParameterConstraintMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceParameterConstraintRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Datasources: BlockInternalId -> DatasourceLocator\n const backingDatasourceMappings = Object.fromEntries([...ridGenerator.getDatasourceLocators().entries(), ...ridGenerator.getDirectDatasourceLocators().entries()].map(([readableId, locator]) => [ridGenerator.toBlockInternalId(readableId), locator]));\n\n // Files datasources: BlockInternalId -> FilesDatasourceLocator\n const filesDatasourceMappings = Object.fromEntries(Array.from(ridGenerator.getFilesDatasourceLocators().entries()).map(([readableId, locator]) => [ridGenerator.toBlockInternalId(readableId), locator]));\n\n // Object type RIDs: ObjectTypeRid -> BlockInternalId\n const objectTypeRids = Object.fromEntries(Array.from(ridGenerator.getObjectTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Object type IDs: ObjectTypeId -> BlockInternalId\n // Scan all ontologies so cross-references to imported objects resolve.\n const objectTypeIds = Object.fromEntries(ontologiesToScan.flatMap(ont => Object.entries(ont[OntologyEntityTypeEnum.OBJECT_TYPE]).map(([objectTypeApiName, objectType]) => [ridGenerator.getObjectTypeIds().get(ReadableIdGenerator.getForObjectType(objectTypeApiName)), ridGenerator.toBlockInternalId(ReadableIdGenerator.getForObjectType(objectTypeApiName))])));\n\n // Property type IDs: ObjectTypeId -> (PropertyTypeId -> BlockInternalId)\n // Scan all ontologies so imported object properties are included.\n const propertyTypeIds = {};\n const objectPropertyTypeIdsToRids = {};\n const structFieldRidsToApiNames = {};\n ontologiesToScan.forEach(ont => {\n Object.entries(ont[OntologyEntityTypeEnum.OBJECT_TYPE]).forEach(([objectTypeApiName, objectType]) => {\n const propMap = {};\n const propertyTypeIdsToRids = {};\n (objectType.properties ?? []).forEach(property => {\n const propertyTypeRid = ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName);\n propMap[property.apiName] = ridGenerator.toBlockInternalId(ReadableIdGenerator.getForObjectProperty(objectTypeApiName, property.apiName));\n propertyTypeIdsToRids[property.apiName] = propertyTypeRid;\n if (typeof property.type === \"object\" && property.type.type === \"struct\") {\n structFieldRidsToApiNames[propertyTypeRid] = Object.fromEntries(Object.keys(property.type.structDefinition).map(structFieldApiName => [ridGenerator.generateStructFieldRid(property.apiName, structFieldApiName), structFieldApiName]));\n }\n });\n const objTypeId = ridGenerator.getObjectTypeIds().get(ReadableIdGenerator.getForObjectType(objectTypeApiName));\n propertyTypeIds[objTypeId] = propMap;\n objectPropertyTypeIdsToRids[objTypeId] = propertyTypeIdsToRids;\n });\n });\n\n // Property type RIDs: PropertyTypeRid -> BlockInternalId\n const propertyRids = Object.fromEntries(Array.from(ridGenerator.getPropertyTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Datasource columns: BlockInternalId -> ResolvedDatasourceColumnShape\n const datasourceColumns = Object.fromEntries([...ridGenerator.getColumnShapes().entries(), ...ridGenerator.getDirectDatasourceColumnShapes().entries()].map(([readableId, shape]) => [ridGenerator.toBlockInternalId(readableId), shape]));\n\n // Time series syncs: TimeSeriesSyncRid -> BlockInternalId\n const timeSeriesSyncs = Object.fromEntries(Array.from(ridGenerator.getTimeSeriesSyncs().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Geotime series syncs: GeotimeSeriesIntegrationRid -> BlockInternalId\n const geotimeSeriesSyncs = Object.fromEntries(Array.from(ridGenerator.getGeotimeSeriesIntegrationRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Link type IDs: LinkTypeId -> BlockInternalId\n // Scan all ontologies so imported link types are included.\n const linkTypeIds = Object.fromEntries(ontologiesToScan.flatMap(ont => Object.keys(ont[OntologyEntityTypeEnum.LINK_TYPE]).map(linkTypeId => [cleanAndValidateLinkTypeId(linkTypeId), ridGenerator.toBlockInternalId(ReadableIdGenerator.getForLinkType(cleanAndValidateLinkTypeId(linkTypeId)))])));\n\n // Link type RIDs: LinkTypeRid -> BlockInternalId\n const linkTypeRids = Object.fromEntries(Array.from(ridGenerator.getLinkTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Action types: ActionTypeRid -> BlockInternalId\n const actionTypeMappings = Object.fromEntries(Array.from(ridGenerator.getActionTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));\n\n // Action parameters: ParameterRid -> BlockInternalId\n const actionParameterMappings = {};\n ridGenerator.getParameterRidAndIds().forEach((biMap, _actionApiName) => {\n Array.from(biMap.entries()).forEach(([readableId, ridAndId]) => {\n actionParameterMappings[ridAndId.rid] = ridGenerator.toBlockInternalId(readableId);\n });\n });\n\n // Action parameter IDs: ActionTypeRid -> (ParameterId -> BlockInternalId)\n const actionParameterIdMappings = {};\n Array.from(ridGenerator.getActionTypeRids().inverse().entries()).forEach(([actionTypeRid, actionReadableId]) => {\n // Extract action type API name from readable ID\n const actionTypeApiName = actionReadableId.replace(/^action-type-/u, \"\");\n const paramBiMap = ridGenerator.getParameterRidAndIds().get(actionTypeApiName);\n if (paramBiMap) {\n const paramMap = {};\n Array.from(paramBiMap.entries()).forEach(([paramReadableId, ridAndId]) => {\n paramMap[ridAndId.id] = ridGenerator.toBlockInternalId(paramReadableId);\n });\n actionParameterIdMappings[actionTypeRid] = paramMap;\n }\n });\n\n // Group IDs: GroupId -> BlockInternalId\n const groupMappings = Object.fromEntries(Array.from(ridGenerator.getGroupIds().inverse().entries()).map(([groupId, readableId]) => [groupId, ridGenerator.toBlockInternalId(readableId)]));\n\n // Value types: ValueTypeRid -> (ValueTypeVersionId -> BlockInternalId)\n const valueTypeMappings = {};\n ridGenerator.getConsumedValueTypeReferences().asMap().forEach((valueTypeRef, readableId) => {\n if (!valueTypeMappings[valueTypeRef.rid]) {\n valueTypeMappings[valueTypeRef.rid] = {};\n }\n valueTypeMappings[valueTypeRef.rid][valueTypeRef.versionId] = ridGenerator.toBlockInternalId(readableId);\n });\n\n // Build markings mapping: BlockInternalId -> [markingId]\n // Collect marking shapes from object type marking properties and additionalMandatoryMarkings\n const markingEntries = [];\n Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).forEach(([objectTypeApiName, objectType]) => {\n // Marking properties\n (objectType.properties ?? []).forEach(prop => {\n if (typeof prop.type === \"object\" && prop.type.type === \"marking\" && prop.type.markingInputGroupName) {\n markingEntries.push({\n markingId: prop.type.markingInputGroupName,\n markingType: prop.type.markingType\n });\n }\n });\n // additionalMandatoryMarkings from property security groups\n (objectType.datasources ?? []).forEach(ds => {\n if (\"propertySecurityGroups\" in ds && ds.propertySecurityGroups) {\n ds.propertySecurityGroups.forEach(psg => {\n if (psg.appliedMarkings) {\n Object.entries(psg.appliedMarkings).forEach(([markingId, markingType]) => {\n markingEntries.push({\n markingId,\n markingType: markingType\n });\n });\n }\n });\n }\n });\n });\n\n // Deduplicate and build mapping\n const markingsMappings = {};\n const seenMarkings = new Set();\n markingEntries.forEach(({\n markingId,\n markingType\n }) => {\n const key = `${markingId}-${markingType}`;\n if (seenMarkings.has(key)) return;\n seenMarkings.add(key);\n const readableId = ReadableIdGenerator.getForMarking(markingId, markingType);\n const blockInternalId = ridGenerator.toBlockInternalId(readableId);\n markingsMappings[blockInternalId] = [markingId];\n });\n return {\n actionParameterIds: actionParameterIdMappings,\n actionParameters: actionParameterMappings,\n actionTypes: actionTypeMappings,\n datasourceColumns,\n datasources: backingDatasourceMappings,\n filesDatasources: filesDatasourceMappings,\n functions: {},\n geotimeSeriesSyncs,\n groupIds: groupMappings,\n interfaceActionTypeConstraints: interfaceActionTypeConstraintMappings,\n interfaceLinkTypes: interfaceLinkMappings,\n interfaceParameterConstraints: interfaceParameterConstraintMappings,\n interfacePropertyTypes: interfacePropertyMappings,\n interfaceTypes: interfaceMappings,\n linkTypeIds,\n linkTypes: linkTypeRids,\n markings: markingsMappings,\n objectTypeIds,\n objectTypes: objectTypeRids,\n objectPropertyTypeIdsToRids,\n propertyTypeIds,\n propertyTypes: propertyRids,\n sharedPropertyTypes: sharedPropertyMappings,\n shapeIdForOntologyAllowSchemaMigrations: ridGenerator.toBlockInternalId(MIGRATION_SHAPE_READABLE_ID),\n shapeIdForInstallPrefix: null,\n structFieldRidsToApiNames,\n timeSeriesSyncs,\n valueTypes: valueTypeMappings,\n webhooks: {},\n workshopModules: {}\n };\n}\n\n/**\n * Port of Java's OntologyAsCodeBlockGenerator.getInterfacePropertyMappings().\n */\nfunction getInterfacePropertyMappings(interfaces, ridGenerator) {\n const multiInterfaceSptApiNames = getMultiInterfaceSptApiNames(interfaces);\n const mappings = {};\n for (const interfaceBlock of Object.values(interfaces)) {\n const iface = interfaceBlock.interfaceType;\n for (const [iptRid, property] of Object.entries(iface.propertiesV3)) {\n let readableId;\n if (property.type === \"interfaceDefinedPropertyType\") {\n readableId = ReadableIdGenerator.getForInterfaceProperty(iface.apiName, property.interfaceDefinedPropertyType.apiName);\n } else {\n const sptApiName = property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName;\n readableId = multiInterfaceSptApiNames.has(sptApiName) ? ReadableIdGenerator.getForSptBackedInterfaceProperty(sptApiName) : ReadableIdGenerator.getForSptBackedInterfaceProperty(iface.apiName, sptApiName);\n }\n mappings[iptRid] = ridGenerator.toBlockInternalId(readableId);\n }\n }\n return mappings;\n}\n\n/**\n * Port of Java's OntologyAsCodeBlockGenerator.getImportedInterfacePropertyMappings().\n */\nfunction getImportedInterfacePropertyMappings(importedOntologies, ridGenerator) {\n const mappings = {};\n for (const ontology of importedOntologies) {\n for (const [interfaceApiName, interfaceType] of Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE])) {\n for (const [propertyApiName, property] of Object.entries(interfaceType.propertiesV3)) {\n if (isInterfaceSharedPropertyType(property)) continue;\n const readableId = ReadableIdGenerator.getForInterfaceProperty(interfaceApiName, propertyApiName);\n const interfacePropertyTypeRid = ridGenerator.generateInterfacePropertyTypeRid(propertyApiName, interfaceApiName);\n mappings[interfacePropertyTypeRid] = ridGenerator.toBlockInternalId(readableId);\n }\n }\n }\n return mappings;\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nexport function convertValueTypeToWireBlockData(ontology) {\n return Object.values(ontology[OntologyEntityTypeEnum.VALUE_TYPE]).map(definitions => {\n const version = getLatestVersion(definitions);\n return {\n metadata: {\n apiName: definitions[0].apiName,\n baseType: version.baseType,\n displayMetadata: definitions[0].displayMetadata,\n status: definitions[0].status\n },\n versions: Array.from(new Map(definitions.map(definition => [definition.version, definition])).values()).map(definition => ({\n version: definition.version,\n baseType: definition.baseType,\n constraints: definition.constraints,\n exampleValues: definition.exampleValues\n }))\n };\n });\n}\nfunction getLatestVersion(versions) {\n if (versions.length === 0) {\n throw new Error(\"Value type must have at least one version\");\n }\n return versions.reduce((latest, current) => {\n return compareSlsVersions(current.version, latest.version) > 0 ? current : latest;\n });\n}\nfunction compareSlsVersions(a, b) {\n const partsA = a.split(\".\").map(Number);\n const partsB = b.split(\".\").map(Number);\n const maxLen = Math.max(partsA.length, partsB.length);\n for (let i = 0; i < maxLen; i++) {\n const segA = partsA[i] ?? 0;\n const segB = partsB[i] ?? 0;\n if (segA !== segB) return segA - segB;\n }\n return 0;\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 { getImportedTypes } from \"@osdk/maker\";\nimport { OntologyRidGeneratorImpl } from \"../../util/generateRid.js\";\nimport { convertOntologyDefinitionToWireBlockData } from \"./convertOntologyDefinitionToWireBlockData.js\";\nimport { convertValueTypeToWireBlockData } from \"./convertValueTypeToWireBlockData.js\";\nexport function convertOntologyDefinition(ontology, ridGenerator, functionsIr, randomnessKey) {\n const importedTypes = getImportedTypes();\n const allOntologies = [ontology, importedTypes];\n const mainOntology = convertOntologyDefinitionToWireBlockData(ontology, ridGenerator, allOntologies, functionsIr);\n const importedOntology = convertOntologyDefinitionToWireBlockData(importedTypes, ridGenerator);\n const importedInterfaceApiNames = new Set(Object.keys(importedTypes.INTERFACE_TYPE));\n const relatedInterfaces = iface => [...(iface.linkedInterfaces ?? []), ...iface.extendsInterfaces].filter(related => typeof related !== \"string\");\n const fullImportedInterfaces = new Map();\n const queue = Object.values(importedTypes.INTERFACE_TYPE);\n while (queue.length > 0) {\n const iface = queue.pop();\n if (iface === undefined) continue;\n const related = relatedInterfaces(iface);\n const existing = fullImportedInterfaces.get(iface.apiName);\n // Register on first sight, or replace a truncated stub with a full copy\n if (existing === undefined || relatedInterfaces(existing).length === 0 && related.length > 0) {\n fullImportedInterfaces.set(iface.apiName, iface);\n queue.push(...related);\n }\n }\n const transitiveInterfaces = {};\n for (const [apiName, iface] of fullImportedInterfaces) {\n if (!importedInterfaceApiNames.has(apiName)) {\n transitiveInterfaces[apiName] = iface;\n }\n }\n const transitiveOntology = {\n INTERFACE_TYPE: transitiveInterfaces,\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n SHARED_PROPERTY_TYPE: {},\n VALUE_TYPE: {}\n };\n const throwawayRidGenerator = new OntologyRidGeneratorImpl(getImportedTypes(), randomnessKey);\n const transitiveImportedOntology = convertOntologyDefinitionToWireBlockData(transitiveOntology, throwawayRidGenerator);\n return {\n ontology: mainOntology,\n importedOntology,\n transitiveImportedOntology,\n valueTypes: convertValueTypeToWireBlockData(ontology),\n importedValueTypes: convertValueTypeToWireBlockData(importedTypes),\n randomnessKey\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 { ReadableIdGenerator } from \"../../../util/generateRid.js\";\nimport { typeToMarketplaceObjectPropertyType } from \"../typeVisitors.js\";\nimport { extractValueTypeInputShapeIfPresent } from \"./IrShapeExtractor.js\";\nfunction createLocalizedAbout(fallbackTitle, fallbackDescription = \"\") {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {}\n };\n}\n\n/**\n * Extracts INPUT shapes from imported ontology block data.\n * Each imported entity becomes an input shape so the marketplace can wire it\n * from the block that originally defined it.\n */\nexport function getImportedShapes(importedBlockData, ridGenerator, linkTypeIdsByApiName = {}) {\n const blockShapes = {\n inputShapes: new Map(),\n inputPresets: new Map(),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: []\n };\n extractImportedObjectTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedLinkTypes(importedBlockData, ridGenerator, blockShapes, linkTypeIdsByApiName);\n extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedSharedPropertyTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedActionTypes(importedBlockData, ridGenerator, blockShapes);\n return blockShapes;\n}\nfunction extractImportedObjectTypes(importedBlockData, ridGenerator, blockShapes) {\n const objectReadableIds = ridGenerator.getObjectTypeRids().inverse();\n const propertyReadableIds = ridGenerator.getPropertyTypeRids().inverse();\n for (const [rid, objectType] of Object.entries(importedBlockData.objectTypes)) {\n const readableId = objectReadableIds.get(rid);\n if (!readableId) continue;\n const propertyBlockIds = [];\n for (const propertyRid of Object.keys(objectType.objectType.propertyTypes)) {\n const propReadableId = propertyReadableIds.get(propertyRid);\n if (propReadableId) {\n propertyBlockIds.push(ridGenerator.toBlockInternalId(propReadableId));\n }\n }\n const inputShape = {\n about: createLocalizedAbout(objectType.objectType.displayMetadata.displayName, objectType.objectType.displayMetadata.description ?? \"\"),\n editsSupport: \"ANY\",\n objectsBackendVersion: \"V2\",\n propertyTypes: propertyBlockIds\n };\n blockShapes.inputShapes.set(readableId, {\n type: \"objectType\",\n objectType: inputShape\n });\n addApiNamePreset(blockShapes, readableId, objectType.objectType.apiName);\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n\n // Generate property input shapes\n for (const [propertyRid, propertyType] of Object.entries(objectType.objectType.propertyTypes)) {\n const propReadableId = propertyReadableIds.get(propertyRid);\n if (!propReadableId) continue;\n const sptReadableId = propertyType.sharedPropertyTypeRid ? ridGenerator.getSharedPropertyTypeRids().inverse().get(propertyType.sharedPropertyTypeRid) : undefined;\n const propInputShape = {\n about: createLocalizedAbout(propertyType.displayMetadata.displayName, propertyType.displayMetadata.description ?? \"\"),\n objectType: ridGenerator.toBlockInternalId(readableId),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(propertyType.type)\n },\n sharedPropertyType: sptReadableId ? ridGenerator.toBlockInternalId(sptReadableId) : undefined\n };\n blockShapes.inputShapes.set(propReadableId, {\n type: \"property\",\n property: propInputShape\n });\n addApiNamePreset(blockShapes, propReadableId, propertyType.apiName);\n blockShapes.inputShapeMetadata.set(propReadableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n }\n }\n}\nfunction extractImportedLinkTypes(importedBlockData, ridGenerator, blockShapes, linkTypeIdsByApiName) {\n const linkReadableIds = ridGenerator.getLinkTypeRids().inverse();\n for (const [rid, linkType] of Object.entries(importedBlockData.linkTypes)) {\n const readableId = linkReadableIds.get(rid);\n if (!readableId) continue;\n const definition = linkType.linkType.definition;\n let linkInputShape;\n switch (definition.type) {\n case \"oneToMany\":\n {\n const def = definition.oneToMany;\n const shape = {\n about: createLocalizedAbout(def.oneToManyLinkMetadata.displayMetadata.displayName),\n objectTypeShapeIdOneSide: getObjectTypeBlockId(ridGenerator, def.objectTypeRidOneSide),\n objectTypeShapeIdManySide: getObjectTypeBlockId(ridGenerator, def.objectTypeRidManySide),\n manyToOneLinkMetadata: createLocalizedAbout(def.manyToOneLinkMetadata.displayMetadata.displayName),\n oneToManyLinkMetadata: createLocalizedAbout(def.oneToManyLinkMetadata.displayMetadata.displayName),\n cardinalityHint: def.cardinalityHint === \"ONE_TO_ONE\" ? \"ONE_TO_ONE\" : \"ONE_TO_MANY\"\n };\n linkInputShape = {\n type: \"oneToMany\",\n oneToMany: shape\n };\n break;\n }\n case \"manyToMany\":\n {\n const def = definition.manyToMany;\n const shape = {\n about: createLocalizedAbout(def.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeShapeIdA: getObjectTypeBlockId(ridGenerator, def.objectTypeRidA),\n objectTypeShapeIdB: getObjectTypeBlockId(ridGenerator, def.objectTypeRidB),\n objectTypeAToBLinkMetadata: createLocalizedAbout(def.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeBToALinkMetadata: createLocalizedAbout(def.objectTypeBToALinkMetadata.displayMetadata.displayName),\n editsSupport: \"ANY\",\n objectsBackendVersion: \"V2\"\n };\n linkInputShape = {\n type: \"manyToMany\",\n manyToMany: shape\n };\n break;\n }\n case \"intermediary\":\n {\n const def = definition.intermediary;\n const shape = {\n about: createLocalizedAbout(def.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeAToBLinkMetadata: createLocalizedAbout(def.objectTypeAToBLinkMetadata.displayMetadata.displayName),\n objectTypeBToALinkMetadata: createLocalizedAbout(def.objectTypeBToALinkMetadata.displayMetadata.displayName),\n objectTypeAShapeId: getObjectTypeBlockId(ridGenerator, def.objectTypeRidA),\n objectTypeBShapeId: getObjectTypeBlockId(ridGenerator, def.objectTypeRidB),\n intermediaryObjectTypeShapeId: getObjectTypeBlockId(ridGenerator, def.intermediaryObjectTypeRid),\n aToIntermediaryLinkTypeShapeId: getLinkTypeBlockId(ridGenerator, def.aToIntermediaryLinkTypeRid),\n intermediaryToBLinkTypeShapeId: getLinkTypeBlockId(ridGenerator, def.intermediaryToBLinkTypeRid)\n };\n linkInputShape = {\n type: \"intermediary\",\n intermediary: shape\n };\n break;\n }\n default:\n continue;\n }\n blockShapes.inputShapes.set(readableId, {\n type: \"linkType\",\n linkType: linkInputShape\n });\n const linkTypeId = linkTypeIdsByApiName[linkType.linkType.id];\n if (linkTypeId !== undefined) {\n addPreset(blockShapes, readableId, {\n type: \"linkTypeIdResolver\",\n linkTypeIdResolver: {\n linkTypeIdWithoutOntologyPrefix: linkTypeId\n }\n });\n }\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n }\n}\nfunction extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockShapes) {\n const knownIdentifiers = importedBlockData.knownIdentifiers;\n for (const [_rid, interfaceTypeBlock] of Object.entries(importedBlockData.interfaceTypes)) {\n const interfaceType = interfaceTypeBlock.interfaceType;\n const interfaceReadableId = ReadableIdGenerator.getForInterface(interfaceType.apiName);\n\n // Build properties list from propertiesV2 (SPT references as BlockInternalIds)\n const properties = Object.values(interfaceType.propertiesV2 ?? {}).map(propEntry => ridGenerator.toBlockInternalId(ReadableIdGenerator.getForSpt(propEntry.sharedPropertyType.apiName)));\n const propertiesV2 = [];\n for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {\n if (property.type !== \"interfaceDefinedPropertyType\") continue;\n const propReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);\n if (!propReadableId) {\n throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);\n }\n propertiesV2.push(ridGenerator.toBlockInternalId(propReadableId));\n }\n\n // Build links list\n const links = (interfaceType.links ?? []).map(ilt => {\n const iltId = knownIdentifiers.interfaceLinkTypes?.[ilt.rid];\n return iltId ?? ilt.rid;\n });\n\n // Build actionTypeConstraints list\n const actionTypeConstraints = (interfaceType.actionTypeConstraints ?? []).map(constraint => {\n const constraintId = knownIdentifiers.interfaceActionTypeConstraints?.[constraint.rid];\n return constraintId ?? constraint.rid;\n });\n const inputShape = {\n about: createLocalizedAbout(interfaceType.displayMetadata.displayName, interfaceType.displayMetadata.description ?? \"\"),\n actionTypeConstraints,\n properties,\n propertiesV2,\n links\n };\n blockShapes.inputShapes.set(interfaceReadableId, {\n type: \"interfaceType\",\n interfaceType: inputShape\n });\n addApiNamePreset(blockShapes, interfaceReadableId, interfaceType.apiName);\n\n // Generate SPT input shapes\n for (const [_sptRid, propEntry] of Object.entries(interfaceType.propertiesV2 ?? {})) {\n const spt = propEntry.sharedPropertyType;\n const sptReadableId = ReadableIdGenerator.getForSpt(spt.apiName);\n if (blockShapes.inputShapes.has(sptReadableId)) continue;\n blockShapes.inputShapes.set(sptReadableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: {\n about: createLocalizedAbout(spt.displayMetadata.displayName, spt.displayMetadata.description ?? \"\"),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)\n }\n }\n });\n addApiNamePreset(blockShapes, sptReadableId, spt.apiName);\n blockShapes.inputShapeMetadata.set(sptReadableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n }\n\n // Generate interface-defined property type input shapes. SPT-backed\n // properties are represented by their shared property type input shapes.\n for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {\n if (property.type !== \"interfaceDefinedPropertyType\") continue;\n const propReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);\n if (!propReadableId) {\n throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);\n }\n const propInputShape = {\n about: createLocalizedAbout(property.interfaceDefinedPropertyType.displayMetadata.displayName, property.interfaceDefinedPropertyType.displayMetadata.description ?? \"\"),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(property.interfaceDefinedPropertyType.type)\n },\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n requireImplementation: property.interfaceDefinedPropertyType.constraints.requireImplementation\n };\n blockShapes.inputShapes.set(propReadableId, {\n type: \"interfacePropertyType\",\n interfacePropertyType: propInputShape\n });\n addApiNamePreset(blockShapes, propReadableId, property.interfaceDefinedPropertyType.apiName);\n }\n\n // Generate interface link type input shapes\n for (const interfaceLinkType of interfaceType.links ?? []) {\n const linkReadableId = ReadableIdGenerator.getForInterfaceLinkType(interfaceType.apiName, interfaceLinkType.metadata.apiName);\n const linkedInterfaceRid = interfaceLinkType.linkedEntityTypeId.type === \"interfaceType\" ? interfaceLinkType.linkedEntityTypeId.interfaceType : undefined;\n const linkedReadableId = linkedInterfaceRid ? ridGenerator.getInterfaceRids().inverse().get(linkedInterfaceRid) : undefined;\n const linkedEntityTypeRef = linkedReadableId ? {\n type: \"interfaceType\",\n interfaceType: ridGenerator.toBlockInternalId(linkedReadableId)\n } : undefined;\n if (!linkedEntityTypeRef) continue;\n const linkInputShape = {\n about: createLocalizedAbout(interfaceLinkType.metadata.displayName, interfaceLinkType.metadata.description),\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n linkedEntityType: linkedEntityTypeRef,\n cardinality: interfaceLinkType.cardinality === \"SINGLE\" ? \"SINGLE\" : \"MANY\",\n required: interfaceLinkType.required\n };\n blockShapes.inputShapes.set(linkReadableId, {\n type: \"interfaceLinkType\",\n interfaceLinkType: linkInputShape\n });\n addApiNamePreset(blockShapes, linkReadableId, interfaceLinkType.metadata.apiName);\n }\n\n // Generate interface action type constraint input shapes\n for (const actionTypeConstraint of interfaceType.actionTypeConstraints ?? []) {\n const constraintReadableId = ReadableIdGenerator.getForInterfaceActionTypeConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName);\n const parameterConstraintRefs = Object.entries(actionTypeConstraint.parameters ?? {}).map(([paramRid, paramConstraint]) => {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName;\n return ridGenerator.toBlockInternalId(ReadableIdGenerator.getForInterfaceParameterConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName, paramDisplayApiName));\n });\n const constraintInputShape = {\n about: createLocalizedAbout(actionTypeConstraint.metadata.displayName, actionTypeConstraint.metadata.description ?? actionTypeConstraint.metadata.displayName),\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n parameterConstraints: parameterConstraintRefs,\n requireImplementation: actionTypeConstraint.requireImplementation\n };\n blockShapes.inputShapes.set(constraintReadableId, {\n type: \"interfaceActionTypeConstraint\",\n interfaceActionTypeConstraint: constraintInputShape\n });\n addApiNamePreset(blockShapes, constraintReadableId, actionTypeConstraint.metadata.apiName);\n\n // Generate interface parameter constraint input shapes\n for (const [paramRid, paramConstraint] of Object.entries(actionTypeConstraint.parameters ?? {})) {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName;\n const paramReadableId = ReadableIdGenerator.getForInterfaceParameterConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName, paramDisplayApiName);\n const paramInputShape = {\n about: createLocalizedAbout(paramConstraint.displayMetadata.displayName, paramConstraint.displayMetadata.displayName),\n actionTypeConstraint: ridGenerator.toBlockInternalId(constraintReadableId),\n requireImplementation: paramConstraint.requireImplementation,\n type: paramConstraint.type\n };\n blockShapes.inputShapes.set(paramReadableId, {\n type: \"interfaceParameterConstraint\",\n interfaceParameterConstraint: paramInputShape\n });\n addApiNamePreset(blockShapes, paramReadableId, paramDisplayApiName);\n }\n }\n }\n}\nfunction extractImportedSharedPropertyTypes(importedBlockData, ridGenerator, blockShapes) {\n for (const [_rid, sptBlock] of Object.entries(importedBlockData.sharedPropertyTypes)) {\n const spt = sptBlock.sharedPropertyType;\n const readableId = ReadableIdGenerator.getForSpt(spt.apiName);\n const inputShape = {\n about: createLocalizedAbout(spt.displayMetadata.displayName, spt.displayMetadata.description ?? \"\"),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)\n }\n };\n blockShapes.inputShapes.set(readableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: inputShape\n });\n addApiNamePreset(blockShapes, readableId, spt.apiName);\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\"\n });\n extractValueTypeInputShapeIfPresent(spt.valueType ?? undefined, spt.displayMetadata.displayName, spt.type, blockShapes, ridGenerator);\n }\n}\nfunction extractImportedActionTypes(importedBlockData, ridGenerator, blockShapes) {\n for (const [_rid, actionTypeBlock] of Object.entries(importedBlockData.actionTypes ?? {})) {\n const actionApiName = actionTypeBlock.actionType.metadata.apiName;\n const actionReadableId = ReadableIdGenerator.getForActionType(actionApiName);\n const parametersV2 = Object.entries(actionTypeBlock.parameterIds ?? {}).map(([_key, parameterId]) => {\n const paramReadableId = ReadableIdGenerator.getForParameter(actionApiName, parameterId);\n return ridGenerator.toBlockInternalId(paramReadableId);\n });\n const actionShape = {\n about: createLocalizedAbout(actionTypeBlock.actionType.metadata.displayMetadata.displayName, actionTypeBlock.actionType.metadata.displayMetadata.description),\n parameters: {},\n parametersV2\n };\n blockShapes.inputShapes.set(actionReadableId, {\n type: \"action\",\n action: actionShape\n });\n addApiNamePreset(blockShapes, actionReadableId, actionApiName);\n\n // Generate parameter input shapes\n const parameters = actionTypeBlock.actionType.metadata.parameters;\n if (parameters) {\n const converter = new ImportedBaseParameterTypeConverter(importedBlockData.knownIdentifiers.objectTypeIds, importedBlockData.knownIdentifiers.interfaceTypes);\n for (const [parameterId, parameter] of Object.entries(parameters)) {\n const paramReadableId = ReadableIdGenerator.getForParameter(actionApiName, parameterId);\n const parameterShape = {\n about: createLocalizedAbout(parameter.displayMetadata.displayName, parameter.displayMetadata.description),\n type: converter.convert(parameter.type),\n actionType: ridGenerator.toBlockInternalId(actionReadableId)\n };\n blockShapes.inputShapes.set(paramReadableId, {\n type: \"actionParameter\",\n actionParameter: parameterShape\n });\n addApiNamePreset(blockShapes, paramReadableId, parameterId);\n }\n }\n }\n}\nfunction addApiNamePreset(blockShapes, readableId, apiName) {\n addPreset(blockShapes, readableId, {\n type: \"apiNameResolver\",\n apiNameResolver: {\n apiName\n }\n });\n}\nfunction addPreset(blockShapes, readableId, resolver) {\n blockShapes.inputPresets.set(readableId, {\n value: {\n type: \"fromSource\",\n fromSource: {\n resolver\n }\n },\n exportCompatibility: \"COMPATIBLE\",\n enforcement: \"SUGGESTED\",\n isDefault: false\n });\n}\nfunction getObjectTypeBlockId(ridGenerator, objectTypeRid) {\n const readableId = ridGenerator.getObjectTypeRids().inverse().get(objectTypeRid);\n if (!readableId) {\n throw new Error(`Object type RID not found: ${objectTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n}\nfunction getLinkTypeBlockId(ridGenerator, linkTypeRid) {\n const readableId = ridGenerator.getLinkTypeRids().inverse().get(linkTypeRid);\n if (!readableId) {\n throw new Error(`Link type RID not found: ${linkTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n}\n\n/**\n * Simplified parameter type converter for imported action types.\n * Mirrors BaseParameterTypeConverter from ActionTypeShapeExtractor.\n */\nclass ImportedBaseParameterTypeConverter {\n constructor(objectTypeIds, interfaceTypes) {\n this.objectTypeIds = objectTypeIds ?? {};\n this.interfaceTypes = interfaceTypes ?? {};\n }\n convert(parameterType) {\n const pt = parameterType;\n const t = pt.type;\n\n // Simple types\n const simpleTypes = [\"boolean\", \"booleanList\", \"integer\", \"integerList\", \"long\", \"longList\", \"double\", \"doubleList\", \"string\", \"stringList\", \"geohash\", \"geohashList\", \"geoshape\", \"geoshapeList\", \"timeSeriesReference\", \"timestamp\", \"timestampList\", \"date\", \"dateList\", \"attachment\", \"attachmentList\", \"marking\", \"markingList\", \"mediaReference\", \"objectTypeReference\", \"geotimeSeriesReference\", \"geotimeSeriesReferenceList\"];\n if (simpleTypes.includes(t)) {\n return {\n type: t,\n [t]: {}\n };\n }\n\n // Object reference types\n if (t === \"objectReference\" || t === \"objectReferenceList\" || t === \"objectSetRid\") {\n const objRef = pt[t];\n const blockId = objRef ? this.objectTypeIds[objRef.objectTypeId] : undefined;\n return {\n type: t,\n [t]: {\n objectTypeId: blockId ?? \"\"\n }\n };\n }\n\n // Interface reference types\n if (t === \"interfaceReference\" || t === \"interfaceReferenceList\" || t === \"interfaceObjectSetRid\") {\n const ifRef = pt[t];\n const blockId = ifRef ? this.interfaceTypes[ifRef.interfaceTypeRid] : undefined;\n return {\n type: t,\n [t]: {\n interfaceTypeRid: blockId ?? \"\"\n }\n };\n }\n\n // Decimal types\n if (t === \"decimal\" || t === \"decimalList\") {\n const dec = pt[t];\n return {\n type: t,\n [t]: {\n precision: dec?.precision,\n scale: dec?.scale\n }\n };\n }\n return {\n type: t,\n [t]: {}\n };\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 * as fs from \"fs\";\nimport { getImportedTypes, getOntologyDefinition, initializeOntologyState, OntologyEntityTypeEnum, writeDependencyFile, writeStaticObjects } from \"@osdk/maker\";\nimport { convertOntologyDefinition } from \"../conversion/toMarketplace/convertOntologyDefinition.js\";\nimport { getImportedShapes } from \"../conversion/toMarketplace/shapeExtractors/ImportedShapeExtractor.js\";\nimport { getShapes } from \"../conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js\";\nimport { OntologyRidGeneratorImpl } from \"../util/generateRid.js\";\nexport async function defineOntologyV2(ns, body, outputDir, dependencyFile, functionsIrFile, randomnessKey, importedLinkTypeIdsByApiName) {\n initializeOntologyState(ns);\n try {\n await body();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Unexpected error while processing the body of the ontology\", e);\n throw e;\n }\n const ontologyDefinition = getOntologyDefinition();\n let functionsIr;\n if (functionsIrFile) {\n functionsIr = JSON.parse(fs.readFileSync(functionsIrFile, \"utf-8\"));\n }\n const ridGenerator = new OntologyRidGeneratorImpl(getImportedTypes(), randomnessKey);\n const ontDef = convertOntologyDefinition(ontologyDefinition, ridGenerator, functionsIr, randomnessKey);\n const shapes = await getShapes(ontDef.ontology, ridGenerator, functionsIr, randomnessKey);\n\n // Generate input shapes for imported entities and merge into main shapes\n const importedShapes = getImportedShapes(ontDef.importedOntology, ridGenerator, importedLinkTypeIdsByApiName);\n for (const [key, value] of importedShapes.inputShapes) {\n shapes.inputShapes.set(key, value);\n }\n for (const [key, value] of importedShapes.inputShapeMetadata) {\n shapes.inputShapeMetadata.set(key, value);\n }\n const backingDatasourceApiNames = Object.entries(ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE]).filter(([_, obj]) => obj.includeEmptyBackingDatasource === true).map(([apiName]) => apiName);\n const backingDatasourceLinkApiNames = Object.entries(ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE]).filter(([_, link]) => {\n const lt = link;\n return \"many\" in lt && !(\"intermediaryObjectType\" in lt) && lt.includeEmptyBackingDatasource === true;\n }).map(([apiName]) => apiName);\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\n }\n return {\n ontologyIr: ontDef,\n shapes,\n importedInputPresets: importedShapes.inputPresets,\n backingDatasourceApiNames,\n backingDatasourceLinkApiNames\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 { ReadableIdGenerator } from \"../../util/generateRid.js\";\nconst DEFAULT_VERSION_RANGE = {\n from: \"0.0.0\",\n until: \"x.x.x\"\n};\n\n/**\n * Extract the package namespace from a dotted api name.\n * E.g. \"com.palantir.MyType\" -> \"com.palantir\"\n * If there's no dot, returns the full name.\n */\nfunction getPackage(fullApiName) {\n const lastDotIndex = fullApiName.lastIndexOf(\".\");\n if (lastDotIndex === -1) {\n return fullApiName;\n }\n return fullApiName.substring(0, lastDotIndex);\n}\n\n/**\n * Generic helper to build external recommendations grouped by package.\n * For non-value-type entities, the targetInputReadableId and upstreamOutputReadableId\n * are the same (the entity's readable ID).\n */\nfunction getExternalRecommendationsForType(items, getApiName, getReadableId, packageNameOverride) {\n const groups = new Map();\n for (const item of items) {\n const apiName = getApiName(item);\n const packageName = packageNameOverride ?? getPackage(apiName);\n const readableId = getReadableId(apiName);\n const pair = {\n targetInputReadableId: readableId,\n upstreamOutputReadableId: readableId\n };\n const existing = groups.get(packageName);\n if (existing) {\n existing.push(pair);\n } else {\n groups.set(packageName, [pair]);\n }\n }\n return Array.from(groups.entries()).map(([packageName, mappings]) => ({\n upstreamPackageName: packageName,\n upstreamVersionCompatibility: DEFAULT_VERSION_RANGE,\n mappings\n }));\n}\nfunction externalRecsForInterfaces(importedOntology) {\n return getExternalRecommendationsForType(Object.values(importedOntology.interfaceTypes), i => i.interfaceType.apiName, apiName => ReadableIdGenerator.getForInterface(apiName));\n}\nfunction externalRecsForInterfaceProperties(importedOntology) {\n const results = [];\n for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {\n const interfaceApiName = interfaceBlock.interfaceType.apiName;\n const interfaceDefinedProperties = Object.values(interfaceBlock.interfaceType.propertiesV3 ?? {}).filter(property => property.type === \"interfaceDefinedPropertyType\");\n results.push(...getExternalRecommendationsForType(interfaceDefinedProperties, property => property.interfaceDefinedPropertyType.apiName, propertyApiName => ReadableIdGenerator.getForInterfaceProperty(interfaceApiName, propertyApiName), getPackage(interfaceApiName)));\n }\n return results;\n}\nfunction externalRecsForInterfaceLinks(importedOntology) {\n const results = [];\n for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {\n const interfaceApiName = interfaceBlock.interfaceType.apiName;\n const links = interfaceBlock.interfaceType.links ?? [];\n results.push(...getExternalRecommendationsForType(links, link => link.metadata.apiName, linkApiName => ReadableIdGenerator.getForInterfaceLinkType(interfaceApiName, linkApiName), getPackage(interfaceApiName)));\n }\n return results;\n}\nfunction externalRecsForSpts(importedOntology) {\n // Collect SPTs from standalone shared property types\n const sptApiNames = [];\n for (const sptBlock of Object.values(importedOntology.sharedPropertyTypes)) {\n sptApiNames.push(sptBlock.sharedPropertyType.apiName);\n }\n\n // Collect SPTs embedded in interface propertiesV3\n for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {\n for (const property of Object.values(interfaceBlock.interfaceType.propertiesV3 ?? {})) {\n if (property.type === \"sharedPropertyBasedPropertyType\") {\n sptApiNames.push(property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName);\n }\n }\n }\n return getExternalRecommendationsForType(sptApiNames, apiName => apiName, apiName => ReadableIdGenerator.getForSpt(apiName));\n}\nfunction externalRecsForObjects(importedOntology) {\n return getExternalRecommendationsForType(Object.values(importedOntology.objectTypes).filter(o => o.objectType.apiName != null), o => o.objectType.apiName, apiName => ReadableIdGenerator.getForObjectType(apiName));\n}\nfunction externalRecsForProperties(importedOntology) {\n const results = [];\n for (const objectBlock of Object.values(importedOntology.objectTypes)) {\n const objectApiName = objectBlock.objectType.apiName;\n if (objectApiName == null) continue;\n const properties = Object.values(objectBlock.objectType.propertyTypes).filter(p => p.apiName != null);\n results.push(...getExternalRecommendationsForType(properties, p => p.apiName, propApiName => ReadableIdGenerator.getForObjectProperty(objectApiName, propApiName), getPackage(objectApiName)));\n }\n return results;\n}\nfunction externalRecsForLinks(importedOntology) {\n return getExternalRecommendationsForType(Object.values(importedOntology.linkTypes), l => l.linkType.id, id => ReadableIdGenerator.getForLinkType(id));\n}\nfunction externalRecsForActions(importedOntology) {\n return getExternalRecommendationsForType(Object.values(importedOntology.actionTypes), a => a.actionType.metadata.apiName, apiName => ReadableIdGenerator.getForActionType(apiName));\n}\nfunction externalRecsForActionParams(importedOntology) {\n const results = [];\n for (const actionBlock of Object.values(importedOntology.actionTypes)) {\n const actionApiName = actionBlock.actionType.metadata.apiName;\n const parameters = actionBlock.actionType.metadata.parameters;\n if (!parameters) continue;\n results.push(...getExternalRecommendationsForType(Object.keys(parameters), paramId => paramId, paramId => ReadableIdGenerator.getForParameter(actionApiName, paramId), getPackage(actionApiName)));\n }\n return results;\n}\n\n/**\n * Build consumed value type references grouped by apiName.\n * Sources:\n * 1. Value type entries (produced + imported) that have consumed input shapes\n * 2. Imported SPT value type references\n * 3. Imported property value type references\n */\nfunction getConsumedValueTypes(producedValueTypes, importedValueTypes, inputShapes) {\n const consumed = new Map();\n function addConsumed(apiName, version, packageNamespace) {\n const existing = consumed.get(apiName);\n if (existing) {\n existing.push({\n version,\n packageNamespace\n });\n } else {\n consumed.set(apiName, [{\n version,\n packageNamespace\n }]);\n }\n }\n for (const entry of [...producedValueTypes, ...importedValueTypes]) {\n if (entry.versions.length === 0) continue;\n const apiName = entry.metadata.apiName;\n const firstVersion = entry.versions[0].version;\n const consumedId = ReadableIdGenerator.getForConsumedValueType(apiName, firstVersion);\n if (inputShapes.has(consumedId)) {\n const packageNamespace = getPackage(apiName);\n for (const version of entry.versions) {\n addConsumed(apiName, version.version, packageNamespace);\n }\n }\n }\n return consumed;\n}\nfunction externalRecsForValueTypes(producedValueTypes, importedValueTypes, inputShapes) {\n const producedApiNames = new Set(producedValueTypes.map(vt => vt.metadata.apiName));\n const consumed = getConsumedValueTypes(producedValueTypes, importedValueTypes, inputShapes);\n const results = [];\n for (const [apiName, versions] of consumed) {\n if (producedApiNames.has(apiName)) continue;\n const mappings = versions.map(v => ({\n targetInputReadableId: ReadableIdGenerator.getForConsumedValueType(apiName, v.version),\n upstreamOutputReadableId: ReadableIdGenerator.getForProducedValueType(apiName, v.version)\n }));\n results.push({\n upstreamPackageName: versions[0].packageNamespace,\n upstreamVersionCompatibility: DEFAULT_VERSION_RANGE,\n mappings\n });\n }\n return results;\n}\n\n/**\n * Generate external recommendations for all imported/consumed entities.\n * Port of Java's RecommendationUtils.getRecommendations() (external portion).\n */\nexport function getExternalRecommendations(importedOntology, producedValueTypes, importedValueTypes, inputShapes) {\n return [...externalRecsForInterfaces(importedOntology), ...externalRecsForInterfaceProperties(importedOntology), ...externalRecsForInterfaceLinks(importedOntology), ...externalRecsForSpts(importedOntology), ...externalRecsForObjects(importedOntology), ...externalRecsForProperties(importedOntology), ...externalRecsForLinks(importedOntology), ...externalRecsForActions(importedOntology), ...externalRecsForActionParams(importedOntology), ...externalRecsForValueTypes(producedValueTypes, importedValueTypes, inputShapes)];\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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { typeToConcreteDataType } from \"../conversion/toMarketplace/typeVisitors.js\";\nimport { ReadableIdGenerator } from \"../util/generateRid.js\";\nimport { toBlockShapeId } from \"./marketplaceSerialization/CodeBlockSpec.js\";\n\n/**\n * Map from maker property type to Foundry schema field type\n */\nexport function propertyTypeToSchemaType(propType) {\n const typeStr = typeof propType === \"string\" ? propType : propType.type;\n switch (typeStr) {\n case \"string\":\n return \"STRING\";\n case \"boolean\":\n return \"BOOLEAN\";\n case \"integer\":\n return \"INTEGER\";\n case \"long\":\n return \"LONG\";\n case \"double\":\n return \"DOUBLE\";\n case \"float\":\n return \"FLOAT\";\n case \"byte\":\n return \"BYTE\";\n case \"short\":\n return \"SHORT\";\n case \"date\":\n return \"DATE\";\n case \"timestamp\":\n return \"TIMESTAMP\";\n case \"array\":\n return \"ARRAY\";\n case \"decimal\":\n return \"DECIMAL\";\n case \"struct\":\n return \"STRUCT\";\n default:\n throw new Error(`Unsupported property type \"${typeStr}\" for empty backing datasource. ` + `If using a property type that doesn't support empty backing datasources please make the property an edit only property.`);\n }\n}\n\n/**\n * A single field entry in a Foundry dataset schema.json `fieldSchemaList`.\n */\n\n/**\n * Build a Foundry schema field object for a column type.\n */\nexport function typeToFieldSchema(type, name) {\n return {\n type: propertyTypeToSchemaType(type),\n name: name ?? null,\n nullable: null,\n userDefinedTypeClass: null,\n customMetadata: {},\n arraySubtype: type.type === \"array\" ? typeToFieldSchema(type.array.subtype) : null,\n precision: type.type === \"decimal\" ? type.decimal.precision ?? null : null,\n scale: type.type === \"decimal\" ? type.decimal.scale ?? null : null,\n mapKeyType: null,\n mapValueType: null,\n subSchemas: type.type === \"struct\" ? type.struct.structFields.map(f => typeToFieldSchema(f.fieldType, f.apiName)) : null\n };\n}\n\n/**\n * Extract the set of edit-only property RIDs from the wire format datasources.\n */\nfunction getEditOnlyPropertyRids(datasources) {\n const editOnlyRids = new Set();\n for (const ds of datasources) {\n const def = ds.datasource;\n let propertyMapping;\n if (def.type === \"datasetV2\") {\n propertyMapping = def.datasetV2.propertyMapping;\n } else if (def.type === \"datasetV3\") {\n propertyMapping = def.datasetV3.propertyMapping;\n }\n if (propertyMapping) {\n for (const [rid, mapping] of Object.entries(propertyMapping)) {\n if (mapping.type === \"editOnly\") {\n editOnlyRids.add(rid);\n }\n }\n }\n }\n return editOnlyRids;\n}\n\n/**\n * Extract non-edit-only properties from ObjectTypeBlockDataV2.\n */\nexport function getNonEditOnlyProperties(objectTypeBlockData) {\n const editOnlyRids = getEditOnlyPropertyRids(objectTypeBlockData.datasources);\n return Object.entries(objectTypeBlockData.objectType.propertyTypes).filter(([rid]) => !editOnlyRids.has(rid)).map(([_, prop]) => prop);\n}\n/**\n * Shared logic to generate a STATIC_DATASET BlockGeneratorResult from a list of columns.\n * Used by both object type and link type backing dataset generators.\n */\nasync function generateBackingDatasetBlock(datasetName, blockIdentifier, dirSuffix, columns, buildDir, randomnessKey) {\n // Build output shapes\n const outputs = {};\n const datasourceReadableId = ReadableIdGenerator.getForDatasetOutput(datasetName);\n const columnReadableIds = columns.map(col => ReadableIdGenerator.getForDatasetColumnOutput(datasetName, col.name));\n const datasourceBlockInternalId = toBlockShapeId(datasourceReadableId, randomnessKey);\n\n // tabularDatasource output shape\n outputs[datasourceReadableId] = {\n type: \"tabularDatasource\",\n tabularDatasource: {\n about: {\n fallbackTitle: blockIdentifier,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n schema: columnReadableIds.map(id => toBlockShapeId(id, randomnessKey)),\n type: \"DATASET\",\n buildRequirements: {\n isBuildable: false\n }\n }\n };\n\n // datasourceColumn output shapes\n for (let i = 0; i < columns.length; i++) {\n const col = columns[i];\n const colReadableId = columnReadableIds[i];\n outputs[colReadableId] = {\n type: \"datasourceColumn\",\n datasourceColumn: {\n about: {\n fallbackTitle: col.name,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n type: {\n type: \"concrete\",\n concrete: typeToConcreteDataType(col.type)\n },\n datasource: datasourceBlockInternalId,\n typeclasses: []\n }\n };\n }\n\n // Generate internal IDs for block-data.json columns.\n // These are distinct from the block shape IDs that appear in the manifest outputs.\n // The add-on maps these internal IDs -> block shape IDs.\n const columnInternalIds = columns.map(col => toBlockShapeId(`column-internal-${datasetName}-${col.name}`, randomnessKey));\n const compassReadableId = `${blockIdentifier}-compass-resource`;\n const compassBlockShapeId = toBlockShapeId(compassReadableId, randomnessKey);\n const datasourceInternalId = toBlockShapeId(`datasource-internal-${datasetName}`, randomnessKey);\n const locationInternalId = toBlockShapeId(`location-internal-${datasetName}`, randomnessKey);\n const addOnOverride = {\n idToBlockShapeId: {\n \"dataset-internal-shape-id\": datasourceBlockInternalId,\n [datasourceInternalId]: datasourceBlockInternalId,\n [locationInternalId]: compassBlockShapeId,\n ...Object.fromEntries(columnInternalIds.map((internalId, i) => [internalId, toBlockShapeId(columnReadableIds[i], randomnessKey)]))\n },\n idToInputGroupId: {},\n outputToLocationInput: {\n [datasourceBlockInternalId]: compassBlockShapeId\n }\n };\n\n // Create block data directory\n const dsBlockDataDir = path.join(buildDir, `temp_block_data_${dirSuffix}`);\n await fs.promises.mkdir(dsBlockDataDir, {\n recursive: true\n });\n\n // Write schema.json\n const schemaJson = {\n fieldSchemaList: columns.map(col => typeToFieldSchema(col.type, col.name)),\n primaryKey: null,\n dataFrameReaderClass: \"com.palantir.foundry.spark.input.ParquetDataFrameReader\",\n customMetadata: {\n format: \"parquet\",\n options: {}\n }\n };\n await fs.promises.writeFile(path.join(dsBlockDataDir, \"schema.json\"), JSON.stringify(schemaJson, null, 2));\n\n // Write block-data.json — column keys are the internal IDs mapped in the add-on\n const blockDataJson = {\n type: \"v1\",\n v1: {\n columns: Object.fromEntries(columns.map((col, i) => [columnInternalIds[i], col.name])),\n hasSchema: true\n }\n };\n await fs.promises.writeFile(path.join(dsBlockDataDir, \"block-data.json\"), JSON.stringify(blockDataJson, null, 2));\n\n // Write VERSION\n await fs.promises.writeFile(path.join(dsBlockDataDir, \"VERSION\"), '\"1\"');\n\n // Write empty files.zip\n // An empty zip file is just the end-of-central-directory record (22 bytes)\n const emptyZip = Buffer.from([0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);\n await fs.promises.writeFile(path.join(dsBlockDataDir, \"files.zip\"), emptyZip);\n\n // Build inputs (compassResource for install location)\n const inputs = {};\n const input_shape_metadata = {};\n inputs[compassReadableId] = {\n type: \"compassResource\",\n compassResource: {\n about: {\n fallbackTitle: blockIdentifier,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n allowedTypes: [],\n typeConstraints: [{\n type: \"compassFolderTypeConstraints\",\n compassFolderTypeConstraints: {\n constraints: [\"INSTALL_LOCATION\"]\n }\n }]\n }\n };\n input_shape_metadata[compassReadableId] = {\n isOptional: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n isAccessedInReconcile: true\n };\n return {\n block_identifier: blockIdentifier,\n block_data_directory: dsBlockDataDir,\n oci_block_data_metadata: undefined,\n maven_block_data_metadata: undefined,\n inputs,\n outputs,\n input_mapping_entries: [],\n external_recommendations: [],\n add_on_override: addOnOverride,\n input_shape_metadata,\n block_type: \"STATIC_DATASET\"\n };\n}\n\n/**\n * Generate a backing datasource BlockGeneratorResult for an object type.\n */\n// TODO(oxc type-aware): the type-aware typescript/require-await rule does not flag this (it returns a Promise); remove this disable once type-aware linting is enabled.\n// oxlint-disable-next-line require-await -- intentionally async: returns a Promise to satisfy its declared/contract type; no await needed\nexport async function generateBackingDatasetBlockResult(objectTypeBlockData, buildDir, randomnessKey) {\n const apiName = objectTypeBlockData.objectType.apiName;\n const nonEditOnlyProps = getNonEditOnlyProperties(objectTypeBlockData);\n const columns = nonEditOnlyProps.map(prop => ({\n name: prop.apiName,\n type: prop.type\n }));\n return generateBackingDatasetBlock(apiName, `${apiName}-backing-ds`, `${apiName}_backing_ds`, columns, buildDir, randomnessKey);\n}\n\n/**\n * Generate a backing datasource BlockGeneratorResult for a many-to-many link type.\n */\n// TODO(oxc type-aware): the type-aware typescript/require-await rule does not flag this (it returns a Promise); remove this disable once type-aware linting is enabled.\n// oxlint-disable-next-line require-await -- intentionally async: returns a Promise to satisfy its declared/contract type; no await needed\nexport async function generateBackingDatasetBlockResultForLink(linkTypeBlockData, linkApiName, objectTypes, buildDir, randomnessKey) {\n const definition = linkTypeBlockData.linkType.definition;\n if (definition.type !== \"manyToMany\") {\n throw new Error(`Link type \"${linkApiName}\" is not a many-to-many link type`);\n }\n const m2m = definition.manyToMany;\n const datasource = linkTypeBlockData.datasources[0]?.datasource;\n if (!datasource || datasource.type !== \"dataset\") {\n throw new Error(`Link type \"${linkApiName}\" does not have a dataset datasource`);\n }\n const ds = datasource.dataset;\n\n // Extract column names and PK RIDs from the datasource mappings\n const pkRidA = Object.keys(ds.objectTypeAPrimaryKeyMapping)[0];\n const columnA = Object.values(ds.objectTypeAPrimaryKeyMapping)[0];\n const pkRidB = Object.keys(ds.objectTypeBPrimaryKeyMapping)[0];\n const columnB = Object.values(ds.objectTypeBPrimaryKeyMapping)[0];\n\n // Resolve column types from the referenced object types\n const objectTypeA = objectTypes[m2m.objectTypeRidA];\n const objectTypeB = objectTypes[m2m.objectTypeRidB];\n if (!objectTypeA || !objectTypeB) {\n throw new Error(`Could not find object types for link \"${linkApiName}\"`);\n }\n const propTypeA = objectTypeA.objectType.propertyTypes[pkRidA]?.type;\n const propTypeB = objectTypeB.objectType.propertyTypes[pkRidB]?.type;\n if (!propTypeA || !propTypeB) {\n throw new Error(`Could not find primary key property types for link \"${linkApiName}\"`);\n }\n\n // Dataset name must match what convertLink.ts registered with generateDatasetLocator\n return generateBackingDatasetBlock(`link.${linkApiName}`, `${linkApiName}-link-backing-ds`, `${linkApiName}_link_backing_ds`, [{\n name: columnA,\n type: propTypeA\n }, {\n name: columnB,\n type: propTypeB\n }], buildDir, randomnessKey);\n}","/*\n * Copyright 2026 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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { typeToConcreteDataType } from \"../conversion/toMarketplace/typeVisitors.js\";\nimport { ReadableIdGenerator } from \"../util/generateRid.js\";\nimport { toBlockShapeId } from \"./marketplaceSerialization/CodeBlockSpec.js\";\nconst DIRECT_SOURCE_INTERNAL_SHAPE_ID = \"direct-source-internal-shape-id\";\nfunction getColumnName(mapping) {\n if (mapping.type === \"column\") return mapping.column;\n if (mapping.type === \"struct\") return mapping.struct.column;\n throw new Error(\"Error extracting column shapes\");\n}\nfunction getDirectDatasource(objectType) {\n for (const datasource of objectType.datasources) {\n if (datasource.datasource.type === \"direct\") {\n return datasource.datasource.direct;\n }\n }\n return undefined;\n}\n\n/**\n * Generate the DIRECT_DATASOURCE block paired with an ontology object's\n * direct datasource input shapes.\n */\nexport async function generateDirectDatasourceBlockResult(objectType, buildDir, randomnessKey) {\n const directDatasource = getDirectDatasource(objectType);\n if (directDatasource === undefined) return undefined;\n const objectTypeApiName = objectType.objectType.apiName;\n if (objectTypeApiName == null) {\n throw new Error(\"Direct datasource object type is missing an API name\");\n }\n const consumedDatasourceReadableId = ReadableIdGenerator.getForDataset(objectTypeApiName);\n const producedDatasourceReadableId = ReadableIdGenerator.getProducedReadableId(consumedDatasourceReadableId);\n const producedDatasourceBlockShapeId = toBlockShapeId(producedDatasourceReadableId, randomnessKey);\n const columnOutputs = {};\n const blockData = {};\n const producedColumnReadableIds = [];\n const seenColumnNames = new Set();\n for (const [propertyTypeRid, mapping] of Object.entries(directDatasource.propertyMapping)) {\n const columnName = getColumnName(mapping);\n if (seenColumnNames.has(columnName)) {\n throw new Error(`Duplicate direct datasource column '${columnName}'`);\n }\n seenColumnNames.add(columnName);\n const propertyType = objectType.objectType.propertyTypes[propertyTypeRid];\n if (propertyType === undefined) {\n throw new Error(`No property type found for direct datasource mapping '${propertyTypeRid}'`);\n }\n const consumedColumnReadableId = ReadableIdGenerator.getForDatasetColumn(objectTypeApiName, columnName);\n const producedColumnReadableId = ReadableIdGenerator.getProducedReadableId(consumedColumnReadableId);\n producedColumnReadableIds.push(producedColumnReadableId);\n blockData[producedColumnReadableId] = columnName;\n columnOutputs[producedColumnReadableId] = {\n type: \"datasourceColumn\",\n datasourceColumn: {\n about: {\n fallbackTitle: propertyType.displayMetadata.displayName,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n type: {\n type: \"concrete\",\n concrete: typeToConcreteDataType(propertyType.type)\n },\n datasource: producedDatasourceBlockShapeId,\n typeclasses: []\n }\n };\n }\n const outputs = {\n [producedDatasourceReadableId]: {\n type: \"tabularDatasource\",\n tabularDatasource: {\n about: {\n fallbackTitle: producedDatasourceReadableId,\n fallbackDescription: \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n type: \"DATASET\",\n schema: producedColumnReadableIds.map(readableId => toBlockShapeId(readableId, randomnessKey))\n }\n },\n ...columnOutputs\n };\n const idToBlockShapeId = Object.fromEntries(Object.keys(outputs).map(readableId => [readableId, toBlockShapeId(readableId, randomnessKey)]));\n idToBlockShapeId[DIRECT_SOURCE_INTERNAL_SHAPE_ID] = producedDatasourceBlockShapeId;\n const blockDataDirectory = path.join(buildDir, `temp_direct_datasource_${objectType.objectType.id}`);\n await fs.promises.mkdir(blockDataDirectory, {\n recursive: true\n });\n await fs.promises.writeFile(path.join(blockDataDirectory, \"block-data.json\"), JSON.stringify(blockData, null, 2));\n await fs.promises.writeFile(path.join(blockDataDirectory, \"VERSION\"), JSON.stringify(\"1.0\"));\n return {\n block_identifier: `direct-datasource-${objectType.objectType.rid}`,\n block_data_directory: blockDataDirectory,\n inputs: {},\n outputs,\n input_mapping_entries: [],\n external_recommendations: [],\n add_on_override: {\n idToBlockShapeId,\n idToInputGroupId: {},\n outputToLocationInput: {}\n },\n input_shape_metadata: {},\n block_type: \"DIRECT_DATASOURCE\"\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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { typeToMarketplaceBaseType } from \"../conversion/toMarketplace/typeVisitors.js\";\nimport { ReadableIdGenerator } from \"../util/generateRid.js\";\n/**\n * Generates a BlockGeneratorResult for each value type entry in the IR.\n * Port of Java's ValueTypesBlockGenerator.\n */\nexport async function generateValueTypeBlockResults(bulkValueTypeBlockData, buildDir) {\n const results = [];\n for (const entry of bulkValueTypeBlockData) {\n const blockIdentifier = \"value-type-\" + entry.metadata.apiName;\n const outputDir = path.join(buildDir, blockIdentifier);\n if (!fs.existsSync(outputDir)) {\n await fs.promises.mkdir(outputDir, {\n recursive: true\n });\n }\n await fs.promises.writeFile(path.join(outputDir, \"value-types.json\"), JSON.stringify(entry, null, 2));\n const outputs = buildOutputShapes(entry);\n results.push({\n block_identifier: blockIdentifier,\n block_data_directory: outputDir,\n oci_block_data_metadata: undefined,\n maven_block_data_metadata: undefined,\n inputs: {},\n outputs: Object.fromEntries(outputs),\n input_mapping_entries: [],\n external_recommendations: [],\n add_on_override: undefined,\n input_shape_metadata: {},\n block_type: \"VALUE_TYPE\"\n });\n }\n return results;\n}\nfunction buildOutputShapes(entry) {\n const outputs = new Map();\n for (const version of entry.versions) {\n const readableId = ReadableIdGenerator.getForProducedValueType(entry.metadata.apiName, version.version);\n outputs.set(readableId, {\n type: \"valueType\",\n valueType: {\n about: {\n fallbackTitle: entry.metadata.displayMetadata.displayName,\n fallbackDescription: entry.metadata.displayMetadata.description ?? \"\",\n localizedTitle: {},\n localizedDescription: {}\n },\n baseType: typeToMarketplaceBaseType(version.baseType)\n }\n });\n }\n return outputs;\n}\n\n/**\n * Compute internal value type recommendations.\n */\nexport function getValueTypeInternalMappings(producedValueTypes, inputShapes) {\n const mappings = [];\n for (const entry of producedValueTypes) {\n for (const version of entry.versions) {\n const consumedId = ReadableIdGenerator.getForConsumedValueType(entry.metadata.apiName, version.version);\n if (inputShapes.has(consumedId)) {\n const producedId = ReadableIdGenerator.getForProducedValueType(entry.metadata.apiName, version.version);\n mappings.push({\n input: consumedId,\n output: producedId\n });\n }\n }\n }\n return mappings;\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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { OntologyBlockDataToFullMetadataConverter, OntologyIrToFullMetadataConverter } from \"@osdk/generator-converters.ontologyir\";\nimport { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\nimport { cleanAndValidateLinkTypeId } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineOntologyV2 } from \"../api/defineOntologyV2.js\";\nimport { getExternalRecommendations } from \"../conversion/toMarketplace/RecommendationUtils.js\";\nimport { ReadableIdGenerator } from \"../util/generateRid.js\";\nimport { generateBackingDatasetBlockResult, generateBackingDatasetBlockResultForLink, getNonEditOnlyProperties } from \"./generateBackingDataset.js\";\nimport { generateDirectDatasourceBlockResult } from \"./generateDirectDatasource.js\";\nimport { generateValueTypeBlockResults, getValueTypeInternalMappings } from \"./generateValueTypeBlockResults.js\";\nconst apiNamespaceRegex = /^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$/u;\nconst uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;\nexport default async function main(args = process.argv) {\n consola.log(\"Generating BlockGeneratorResult for ontology...\");\n const commandLineOpts = await yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({\n input: {\n alias: \"i\",\n describe: \"Input file\",\n type: \"string\",\n default: \".ontology/ontology.ts\",\n coerce: path.resolve\n },\n output: {\n alias: \"o\",\n describe: \"Output file for ontology BlockGeneratorResult JSON\",\n type: \"string\",\n default: \"build/block_generator_result.json\",\n coerce: path.resolve\n },\n valueTypesOutput: {\n describe: \"Output file for value types BlockGeneratorResult JSON\",\n type: \"string\",\n default: \"build/value_types_block_generator_result.json\",\n coerce: path.resolve\n },\n apiNamespace: {\n describe: \"Api name prefix for namespaced ontology types\",\n type: \"string\",\n default: \"\"\n },\n buildDir: {\n alias: \"b\",\n describe: \"Directory for build files\",\n type: \"string\",\n default: \"build/\",\n coerce: path.resolve\n },\n codegenDir: {\n alias: \"c\",\n describe: \"Output directory for generated TypeScript files (defaults to the parent of the input file's directory)\",\n type: \"string\",\n coerce: path.resolve\n },\n temporaryBlockDataFile: {\n alias: \"f\",\n describe: \"Path to a previously generated block data file. Supplying this field indicates that function backed actions should be generated\",\n type: \"string\",\n coerce: path.resolve\n },\n functionsDir: {\n type: \"string\",\n coerce: path.resolve\n },\n nodeModulesDir: {\n type: \"string\",\n coerce: path.resolve\n },\n functionsIrOutputFile: {\n type: \"string\",\n coerce: path.resolve\n },\n randomnessKey: {\n describe: \"Value used to assure uniqueness of entities\",\n type: \"string\"\n },\n \"import-json\": {\n describe: \"Path to imported ontology metadata produced by 'foundry import ontology'\",\n type: \"string\",\n coerce: path.resolve\n }\n }).parseAsync();\n let apiNamespace = \"\";\n if (commandLineOpts.apiNamespace.length !== 0) {\n apiNamespace = commandLineOpts.apiNamespace.slice(-1) !== \".\" ? commandLineOpts.apiNamespace + \".\" : commandLineOpts.apiNamespace;\n !(apiNamespace.length < 1024) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is too long.\") : invariant(false) : void 0;\n !apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$\") : invariant(false) : void 0;\n }\n consola.info(`Loading ontology from ${commandLineOpts.input}`);\n if (commandLineOpts.randomnessKey !== undefined) {\n !uuidRegex.test(commandLineOpts.randomnessKey) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Supplied randomness key is not a uuid and shouldn't be used as a uniqueness guarantee\") : invariant(false) : void 0;\n }\n let functionsIrFile;\n if (commandLineOpts.temporaryBlockDataFile) {\n consola.info(`Loading temporary block data from ${commandLineOpts.temporaryBlockDataFile}`);\n const fileContent = await fs.promises.readFile(commandLineOpts.temporaryBlockDataFile, \"utf-8\");\n let blockDataJson;\n try {\n blockDataJson = JSON.parse(fileContent);\n } catch {\n consola.error(`Failed to parse JSON from ${commandLineOpts.temporaryBlockDataFile}`);\n process.exit(1);\n }\n const previewMetadata = PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData(blockDataJson);\n !(commandLineOpts.functionsDir && commandLineOpts.nodeModulesDir) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"functionsDir and nodeModulesDir must be supplied when using temporaryBlockDataFile\") : invariant(false) : void 0;\n await OntologyIrToFullMetadataConverter.discoverTypeScriptFunctions(commandLineOpts.functionsDir, commandLineOpts.nodeModulesDir, commandLineOpts.functionsIrOutputFile, previewMetadata);\n functionsIrFile = commandLineOpts.functionsIrOutputFile;\n consola.info(`Discovered functions during block data generation at ${commandLineOpts.functionsIrOutputFile}`);\n }\n\n // Default the codegen output directory to the parent of the input file's directory.\n const codegenDir = commandLineOpts.codegenDir ?? path.dirname(path.dirname(commandLineOpts.input));\n const dependencyFile = path.join(commandLineOpts.buildDir, \"dependencies.json\");\n if (!fs.existsSync(dependencyFile)) {\n await fs.promises.mkdir(commandLineOpts.buildDir, {\n recursive: true\n });\n }\n const importedLinkTypeIdsByApiName = commandLineOpts.importJson && fs.existsSync(commandLineOpts.importJson) ? getImportedLinkTypeIdsByApiName(JSON.parse(await fs.promises.readFile(commandLineOpts.importJson, \"utf-8\"))) : undefined;\n const {\n ontologyIr,\n shapes,\n importedInputPresets,\n backingDatasourceApiNames,\n backingDatasourceLinkApiNames\n } = await loadOntology(commandLineOpts.input, apiNamespace, codegenDir, dependencyFile, functionsIrFile, commandLineOpts.randomnessKey, importedLinkTypeIdsByApiName);\n\n // Create temp directory for block data\n const blockDataDir = path.join(commandLineOpts.buildDir, \"temp_block_data\");\n if (!fs.existsSync(blockDataDir)) {\n await fs.promises.mkdir(blockDataDir, {\n recursive: true\n });\n }\n\n // Write ontology.json to the block data directory\n const ontologyJsonPath = path.join(blockDataDir, \"ontology.json\");\n const ontologyJson = JSON.stringify(ontologyIr.ontology, null, 2);\n await fs.promises.writeFile(ontologyJsonPath, ontologyJson);\n consola.info(`Wrote ontology.json to ${ontologyJsonPath}`);\n const importedMetadata = OntologyBlockDataToFullMetadataConverter.getFullMetadataFromBlockData(ontologyIr.importedOntology, undefined, ontologyIr.transitiveImportedOntology);\n const directlyImportedInterfaceTypes = Object.values(ontologyIr.importedOntology.interfaceTypes).map(({\n interfaceType\n }) => interfaceType.apiName);\n const importedMetadataPath = path.join(commandLineOpts.buildDir, \"oac-imported-metadata.json\");\n await fs.promises.writeFile(importedMetadataPath, JSON.stringify({\n ...importedMetadata,\n directlyImportedInterfaceTypes\n }, null, 2));\n consola.info(`Wrote oac-imported-metadata.json to ${importedMetadataPath}`);\n let valueTypeResults = [];\n if (ontologyIr.valueTypes.length > 0) {\n valueTypeResults = await generateValueTypeBlockResults(ontologyIr.valueTypes, commandLineOpts.buildDir);\n }\n const directDatasourceGeneratorResults = (await Promise.all(Object.values(ontologyIr.ontology.objectTypes).map(objectType => generateDirectDatasourceBlockResult(objectType, commandLineOpts.buildDir, commandLineOpts.randomnessKey)))).filter(result => result !== undefined);\n\n // Collect input_mapping_entries for the ontology block\n // These map ontology inputs to datasource block outputs for objects with includeEmptyBackingDatasource\n const ontologyInputMappingEntries = shapes.inputMappings;\n for (const apiName of backingDatasourceApiNames) {\n const objectTypeBlockData = findObjectTypeByApiName(ontologyIr.ontology.objectTypes, apiName);\n if (!objectTypeBlockData) continue;\n const nonEditOnlyProps = getNonEditOnlyProperties(objectTypeBlockData);\n\n // The ontology block has inputs with these readable IDs (from shape extraction)\n // Map them to the datasource block's outputs (which use the same readable IDs)\n const inputDatasetReadableId = ReadableIdGenerator.getForDataset(apiName);\n const outputDatasetReadableId = ReadableIdGenerator.getForDatasetOutput(apiName);\n if (shapes.inputShapes.has(inputDatasetReadableId)) {\n ontologyInputMappingEntries.push({\n input: inputDatasetReadableId,\n output: outputDatasetReadableId\n });\n }\n for (const prop of nonEditOnlyProps) {\n const colInputReadableId = ReadableIdGenerator.getForDatasetColumn(apiName, prop.apiName);\n const getForDatasetColumnOutput = ReadableIdGenerator.getForDatasetColumnOutput(apiName, prop.apiName);\n if (shapes.inputShapes.has(colInputReadableId)) {\n ontologyInputMappingEntries.push({\n input: colInputReadableId,\n output: getForDatasetColumnOutput\n });\n }\n }\n }\n\n // Collect input_mapping_entries for link types with includeEmptyBackingDatasource\n for (const linkApiName of backingDatasourceLinkApiNames) {\n const linkTypeBlockData = findLinkTypeByApiName(ontologyIr.ontology.linkTypes, linkApiName);\n if (!linkTypeBlockData) continue;\n const datasetName = `link.${linkApiName}`;\n\n // Map tabularDatasource\n const inputDsId = ReadableIdGenerator.getForDataset(datasetName);\n const outputDsId = ReadableIdGenerator.getForDatasetOutput(datasetName);\n if (shapes.inputShapes.has(inputDsId)) {\n ontologyInputMappingEntries.push({\n input: inputDsId,\n output: outputDsId\n });\n }\n\n // Map columns from the datasource\n const ds = linkTypeBlockData.datasources[0]?.datasource;\n if (ds?.type === \"dataset\") {\n const columnNames = [...Object.values(ds.dataset.objectTypeAPrimaryKeyMapping).map(String), ...Object.values(ds.dataset.objectTypeBPrimaryKeyMapping).map(String)];\n for (const colName of columnNames) {\n const colInputId = ReadableIdGenerator.getForDatasetColumn(datasetName, colName);\n const colOutputId = ReadableIdGenerator.getForDatasetColumnOutput(datasetName, colName);\n if (shapes.inputShapes.has(colInputId)) {\n ontologyInputMappingEntries.push({\n input: colInputId,\n output: colOutputId\n });\n }\n }\n }\n }\n ontologyInputMappingEntries.push(...getValueTypeInternalMappings(ontologyIr.valueTypes, shapes.inputShapes));\n\n // Generate backing datasource BlockGeneratorResults for objects with includeEmptyBackingDatasource\n const backingDsGeneratorResults = await Promise.all(backingDatasourceApiNames.filter(apiName => {\n const objectTypeBlockData = findObjectTypeByApiName(ontologyIr.ontology.objectTypes, apiName);\n return objectTypeBlockData !== undefined;\n }).map(async apiName => {\n const objectTypeBlockData = findObjectTypeByApiName(ontologyIr.ontology.objectTypes, apiName);\n consola.info(`Generating backing datasource BlockGeneratorResult for ${apiName}...`);\n return await generateBackingDatasetBlockResult(objectTypeBlockData, commandLineOpts.buildDir, commandLineOpts.randomnessKey);\n }));\n\n // Generate backing datasource BlockGeneratorResults for link types with includeEmptyBackingDatasource\n const backingDsLinkGeneratorResults = await Promise.all(backingDatasourceLinkApiNames.map(linkApiName => {\n const linkTypeBlockData = findLinkTypeByApiName(ontologyIr.ontology.linkTypes, linkApiName);\n if (!linkTypeBlockData) return undefined;\n consola.info(`Generating backing datasource BlockGeneratorResult for link ${linkApiName}...`);\n return generateBackingDatasetBlockResultForLink(linkTypeBlockData, linkApiName, ontologyIr.ontology.objectTypes, commandLineOpts.buildDir, commandLineOpts.randomnessKey);\n }).filter(p => p !== undefined));\n\n // Create BlockGeneratorResult\n const blockGeneratorResult = {\n block_identifier: \"ontology\",\n block_data_directory: blockDataDir,\n oci_block_data_metadata: undefined,\n maven_block_data_metadata: undefined,\n inputs: Object.fromEntries(shapes.inputShapes),\n input_presets: Object.fromEntries(importedInputPresets),\n outputs: Object.fromEntries(shapes.outputShapes),\n input_mapping_entries: ontologyInputMappingEntries,\n external_recommendations: getExternalRecommendations(ontologyIr.importedOntology, ontologyIr.valueTypes, ontologyIr.importedValueTypes, shapes.inputShapes),\n add_on_override: undefined,\n input_shape_metadata: Object.fromEntries(shapes.inputShapeMetadata),\n block_type: \"ONTOLOGY\"\n };\n\n // Write BlockGeneratorResult to output file\n const blockGeneratorResultJson = JSON.stringify([blockGeneratorResult, ...directDatasourceGeneratorResults, ...backingDsGeneratorResults, ...backingDsLinkGeneratorResults, ...valueTypeResults], null, 2);\n await fs.promises.writeFile(commandLineOpts.output, blockGeneratorResultJson);\n consola.success(`BlockGeneratorResult written to ${commandLineOpts.output}`);\n consola.info(`Block data directory: ${blockDataDir}`);\n if (valueTypeResults.length > 0) {\n const valueTypeResultsJson = JSON.stringify(valueTypeResults, null, 2);\n await fs.promises.writeFile(commandLineOpts.valueTypesOutput, valueTypeResultsJson);\n consola.success(`Value type BlockGeneratorResult written to ${commandLineOpts.valueTypesOutput}`);\n }\n}\nasync function loadOntology(input, apiNamespace, outputDir, dependencyFile, functionsIrFile, randomnessKey, importedLinkTypeIdsByApiName) {\n const result = await defineOntologyV2(apiNamespace, async () => await import(pathToFileURL(input).href), outputDir, dependencyFile, functionsIrFile, randomnessKey, importedLinkTypeIdsByApiName);\n return result;\n}\nfunction getImportedLinkTypeIdsByApiName(metadata) {\n const result = {};\n for (const objectType of Object.values(metadata.objectTypes)) {\n for (const linkType of objectType.linkTypes) {\n const linkTypeId = metadata.linkTypeIdsByRid?.[linkType.linkTypeRid];\n if (linkTypeId !== undefined) {\n result[cleanAndValidateLinkTypeId(linkType.apiName)] = linkTypeId;\n }\n }\n }\n return result;\n}\n\n/**\n * Find an ObjectTypeBlockDataV2 by apiName within the ontology block data.\n */\nfunction findObjectTypeByApiName(objectTypes, apiName) {\n return Object.values(objectTypes).find(objectTypeBlockData => objectTypeBlockData.objectType.apiName === apiName);\n}\n\n/**\n * Find a LinkTypeBlockDataV2 by apiName within the ontology block data.\n */\nfunction findLinkTypeByApiName(linkTypes, apiName) {\n const linkTypeId = cleanAndValidateLinkTypeId(apiName);\n return Object.values(linkTypes).find(lt => lt.linkType.id === linkTypeId);\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 { convertToDisplayName, convertToPluralDisplayName, importOntologyEntity, OntologyEntityTypeEnum } from \"@osdk/maker\";\n/*\n * Takes in the minimal object definition to create an input shape.\n * First converts it to fake block data to call importOntologyEntity,\n * then converts it to an OntologyIrImportedObjectType that is safe to use elsewhere.\n */\nexport function defineImportObject(objectDef) {\n const properties = Object.entries(objectDef.properties ?? {}).map(([apiName, type]) => ({\n apiName: apiName,\n displayName: type.displayName ?? convertToDisplayName(apiName),\n description: type.description,\n type: type.type\n }));\n const finalObject = {\n apiName: objectDef.apiName,\n properties: properties,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n // the rest don't matter for now\n displayName: objectDef.displayName ?? convertToDisplayName(objectDef.apiName),\n description: objectDef.description,\n pluralDisplayName: convertToPluralDisplayName(objectDef.apiName),\n primaryKeyPropertyApiName: properties[0]?.apiName,\n titlePropertyApiName: properties[0]?.apiName\n };\n importOntologyEntity(finalObject);\n return finalObject;\n}","/*\n * Copyright 2026 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 { defineAction, kebab } from \"@osdk/maker\";\nexport function defineFunctionBackedAction(def) {\n const actionApiName = def.apiName ?? `function-action-${kebab(def.functionApiName)}`;\n return defineAction({\n apiName: def.apiName ?? `${def.functionApiName.toLowerCase()}-action`,\n displayName: def.displayName ?? `Function action ${def.functionApiName}`,\n description: def.description,\n rules: [{\n type: \"functionRule\",\n functionRule: {\n // delegate this to conversion step\n functionRid: def.functionApiName,\n functionInputValues: {},\n functionVersion: \"0.1.0\"\n }\n }],\n status: def.status ?? \"active\",\n ...{\n validation: [{\n condition: {\n type: \"true\",\n true: {}\n },\n displayMetadata: {\n failureMessage: \"Validation failed\",\n typeClasses: []\n }\n }]\n }\n });\n}"]}
|