@osdk/maker 0.76.0 → 0.77.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/api/action/ActionParameterType.ts","../../src/conversion/toMarketplace/convertActionParameters.ts","../../src/api/common/OntologyEntityTypeEnum.ts","../../src/conversion/toMarketplace/convertCardinality.ts","../../src/conversion/toMarketplace/convertLink.ts","../../src/util/ApiNameValidator.ts","../../src/api/cloneDefinition.ts","../../src/api/interface/InterfacePropertyType.ts","../../src/api/interface/getFlattenedInterfaceProperties.ts","../../src/api/properties/PropertyTypeType.ts","../../src/api/validateMetadataLengths.ts","../../src/api/defineObject.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/api/propertyConversionUtils.ts","../../src/conversion/toMarketplace/convertNullabilityToDataConstraint.ts","../../src/conversion/toMarketplace/convertReducers.ts","../../src/conversion/toConjure/distributeTypeHelper.ts","../../src/conversion/toMarketplace/convertMainValue.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts","../../src/conversion/toMarketplace/convertSpt.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.ts","../../src/conversion/toMarketplace/convertInterfacePropertyType.ts","../../src/conversion/toMarketplace/convertInterface.ts","../../src/conversion/toMarketplace/convertInterfaceSchemaMigrations.ts","../../src/conversion/toMarketplace/convertDatasourceDefinition.ts","../../src/conversion/toMarketplace/convertValueType.ts","../../src/conversion/toMarketplace/convertDataConstraintToDataConstraints.ts","../../src/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.ts","../../src/conversion/toMarketplace/convertValueTypeDataConstraints.ts","../../src/conversion/toMarketplace/convertObjectPropertyType.ts","../../src/conversion/toMarketplace/convertObject.ts","../../src/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.ts","../../src/conversion/toMarketplace/convertValueTypesToIr.ts","../../src/conversion/toMarketplace/convertOntologyToValueTypeIr.ts","../../src/conversion/toMarketplace/convertOntologyDefinition.ts","../../src/conversion/toMarketplace/getFormContentOrdering.ts","../../src/api/code-snippets/snippetTypes.ts","../../src/api/code-snippets/createCodeSnippets.ts","../../src/api/defineOntology.ts","../../src/api/addDependency.ts","../../src/api/object/objectPropertyHelpers.ts","../../src/api/defineAction.ts","../../src/api/namespace/combineApiNamespaceIfMissing.ts","../../src/api/defineCreateInterfaceLinkAction.ts","../../src/conversion/toMarketplace/convertMappingValue.ts","../../src/api/defineCreateInterfaceObjectAction.ts","../../src/api/defineCreateObjectAction.ts","../../src/api/defineCreateOrModifyObjectAction.ts","../../src/api/defineDeleteInterfaceLinkAction.ts","../../src/api/defineDeleteInterfaceObjectAction.ts","../../src/api/defineDeleteObjectAction.ts","../../src/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.ts","../../src/api/interface/describeInterfaceSchemaMigrationInstruction.ts","../../src/api/interface/validateInterfaceSchemaMigrations.ts","../../src/api/interface/validateSchemaMigrationsFamilyOptIn.ts","../../src/api/defineInterface.ts","../../src/api/defineInterfaceActionTypeConstraint.ts","../../src/api/defineInterfaceLinkConstraint.ts","../../src/api/defineLink.ts","../../src/api/defineModifyInterfaceObjectAction.ts","../../src/api/defineModifyObjectAction.ts","../../src/api/defineSpt.ts","../../src/api/defineValueType.ts","../../src/api/importOntologyEntity.ts","../../src/api/importSharedPropertyType.ts","../../src/api/wrapWithProxy.ts","../../src/lockfile/OntologySchemaLockfile.ts","../../src/lockfile/LockedPropertyType.ts","../../src/lockfile/describeLockfileChange.ts","../../src/lockfile/generateOntologySchemaLockfile.ts","../../src/lockfile/parseOntologySchemaLockfile.ts","../../src/lockfile/applyInterfaceSchemaTransition.ts","../../src/lockfile/validateOntologySchemaLockfile.ts","../../src/lockfile/reconcileOntologySchemaLockfile.ts","../../src/cli/main.ts"],"names":["OntologyEntityTypeEnum","invariant","apiName","interfaceSnippets","actionSnippets","objectSnippets","fs","consola","path","TYPESCRIPT_OSDK_SNIPPETS","Mustache","path2","fs2","path3","fs3","namespace","randomUUID","vt","isDeepStrictEqual","z","fs4","yargs","hideBin","path4","fs5","LogLevels","pathToFileURL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,SAAS,+BAA+B,IAAA,EAAM;AACnD,EAAA,OAAO,CAAC,SAAA,EAAW,aAAA,EAAe,SAAA,EAAW,eAAe,MAAA,EAAQ,UAAA,EAAY,QAAA,EAAU,YAAA,EAAc,UAAU,YAAA,EAAc,SAAA,EAAW,aAAA,EAAe,WAAA,EAAa,iBAAiB,SAAA,EAAW,aAAA,EAAe,UAAA,EAAY,cAAA,EAAgB,qBAAA,EAAuB,MAAA,EAAQ,UAAA,EAAY,qBAAA,EAAuB,mBAAmB,YAAA,EAAc,gBAAA,EAAkB,SAAA,EAAW,aAAA,EAAe,kBAAkB,oBAAA,EAAsB,wBAAA,EAA0B,4BAA4B,CAAA,CAAE,SAAS,IAAI,CAAA;AAC5e;;;ACJO,SAAS,wBAAwB,MAAA,EAAQ;AAC9C,EAAA,OAAO,MAAA,CAAO,WAAA,CAAA,CAAa,MAAA,CAAO,UAAA,IAAc,IAAI,GAAA,CAAI,CAAA,CAAA,KAAK,CAAC,CAAA,CAAE,EAAA,EAAI;AAAA,IAClE,IAAI,CAAA,CAAE,EAAA;AAAA,IACN,IAAA,EAAM,OAAO,CAAA,CAAE,IAAA,KAAS,QAAA,GAAW;AAAA,MACjC,MAAM,CAAA,CAAE,IAAA;AAAA,MACR,CAAC,CAAA,CAAE,IAAI,GAAG;AAAC,QACT,CAAA,CAAE,IAAA;AAAA,IACN,eAAA,EAAiB;AAAA,MACf,aAAa,CAAA,CAAE,WAAA;AAAA,M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UAAA,CAAW,kBAAA,CAAmB,UAAA,CAAW,MAAA,GAAS,CAAA,EAAG;AACtG,IAAA,MAASA,cAAA,CAAA,SAAA,CAAU,gBAAgB,gBAAA,EAAkB,IAAA,CAAK,UAAU,UAAA,CAAW,UAAA,EAAY,IAAA,EAAM,CAAC,CAAC,CAAA;AAAA,EACrG;AACF;AACA,SAAS,YAAY,SAAA,EAAW;AAC9B,EAAA,IAAI,SAAA,KAAc,CAAA,EAAG,OAAOC,iBAAA,CAAU,IAAA;AACtC,EAAA,IAAI,SAAA,KAAc,CAAA,EAAG,OAAOA,iBAAA,CAAU,KAAA;AACtC,EAAA,OAAOA,iBAAA,CAAU,KAAA;AACnB;AACA,eAAe,YAAA,CAAa,OAAO,YAAA,EAAc,SAAA,EAAW,gBAAgB,oBAAA,EAAsB,kBAAA,EAAoB,cAAA,EAAgB,aAAA,EAAe,WAAA,EAAa;AAChK,EAAA,MAAM,IAAI,MAAM,cAAA,CAAe,YAAA,EAAc,YAAY,MAAM,OAAOC,iBAAA,CAAc,KAAK,CAAA,CAAE,OAAO,SAAA,EAAW,cAAA,EAAgB,sBAAsB,kBAAA,EAAoB,cAAA,EAAgB,eAAe,WAAW,CAAA;AACjN,EAAA,OAAO,CAAA;AACT","file":"index.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// FIXME: these should not use conjure types\n\nexport function isActionParameterTypePrimitive(type) {\n return [\"boolean\", \"booleanList\", \"integer\", \"integerList\", \"long\", \"longList\", \"double\", \"doubleList\", \"string\", \"stringList\", \"decimal\", \"decimalList\", \"timestamp\", \"timestampList\", \"geohash\", \"geohashList\", \"geoshape\", \"geoshapeList\", \"timeSeriesReference\", \"date\", \"dateList\", \"objectTypeReference\", \"objectReference\", \"attachment\", \"attachmentList\", \"marking\", \"markingList\", \"mediaReference\", \"mediaReferenceList\", \"geotimeSeriesReference\", \"geotimeSeriesReferenceList\"].includes(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\nexport function convertActionParameters(action) {\n return Object.fromEntries((action.parameters ?? []).map(p => [p.id, {\n id: p.id,\n type: typeof p.type === \"string\" ? {\n type: p.type,\n [p.type]: {}\n } : p.type,\n displayMetadata: {\n displayName: p.displayName,\n description: p.description ?? \"\",\n typeClasses: p.typeClasses ?? []\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\nexport let OntologyEntityTypeEnum = /*#__PURE__*/function (OntologyEntityTypeEnum) {\n OntologyEntityTypeEnum[\"OBJECT_TYPE\"] = \"OBJECT_TYPE\";\n OntologyEntityTypeEnum[\"LINK_TYPE\"] = \"LINK_TYPE\";\n OntologyEntityTypeEnum[\"INTERFACE_TYPE\"] = \"INTERFACE_TYPE\";\n OntologyEntityTypeEnum[\"SHARED_PROPERTY_TYPE\"] = \"SHARED_PROPERTY_TYPE\";\n OntologyEntityTypeEnum[\"ACTION_TYPE\"] = \"ACTION_TYPE\";\n OntologyEntityTypeEnum[\"VALUE_TYPE\"] = \"VALUE_TYPE\";\n return OntologyEntityTypeEnum;\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 invariant from \"tiny-invariant\";\nimport { OntologyEntityTypeEnum } from \"../../api/common/OntologyEntityTypeEnum.js\";\nimport { cleanAndValidateLinkTypeId, importedTypes, ontologyDefinition } from \"../../api/defineOntology.js\";\nimport { convertCardinality } from \"./convertCardinality.js\";\nexport function convertLink(linkType) {\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 definition = {\n type: \"oneToMany\",\n oneToMany: {\n cardinalityHint: convertCardinality(linkType.cardinality),\n manyToOneLinkMetadata: linkType.toMany.metadata,\n objectTypeRidManySide: toManyObjectApiName,\n objectTypeRidOneSide: oneObjectApiName,\n oneToManyLinkMetadata: linkType.one.metadata,\n oneSidePrimaryKeyToManySidePropertyMapping: [{\n from: {\n apiName: oneObject.primaryKeyPropertyApiName,\n object: oneObjectApiName\n },\n to: {\n apiName: linkType.manyForeignKeyProperty,\n object: toManyObjectApiName\n }\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 definition = {\n type: \"intermediary\",\n intermediary: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectApiName,\n objectTypeRidB: toManyObjectApiName,\n intermediaryObjectTypeRid: linkType.intermediaryObjectType.apiName,\n aToIntermediaryLinkTypeRid: cleanAndValidateLinkTypeId(linkType.many.linkToIntermediary.apiName),\n intermediaryToBLinkTypeRid: 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 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: manyObjectApiName,\n objectTypeRidB: toManyObjectApiName,\n peeringMetadata: undefined,\n objectTypeAPrimaryKeyPropertyMapping: [{\n from: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName\n },\n to: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName\n }\n }],\n objectTypeBPrimaryKeyPropertyMapping: [{\n from: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName\n },\n to: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName\n }\n }]\n }\n };\n datasource = {\n datasourceName: linkType.apiName,\n datasource: {\n type: \"dataset\",\n dataset: {\n datasetRid: \"link-\".concat(linkType.apiName),\n writebackDatasetRid: undefined,\n objectTypeAPrimaryKeyMapping: [{\n property: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName\n },\n column: resolvedColumnA\n }],\n objectTypeBPrimaryKeyMapping: [{\n property: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName\n },\n column: resolvedColumnB\n }]\n }\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: linkType.redacted\n };\n }\n return {\n linkType: {\n definition,\n ...(linkType.description !== undefined && {\n description: linkType.description\n }),\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: convertLinkStatus(linkType.status),\n redacted: linkType.redacted ?? false\n },\n datasources: datasource !== undefined ? [datasource] : [],\n entityMetadata: {\n arePatchesEnabled: linkType.editsEnabled ?? false\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 = ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName] ?? importedTypes[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) {\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 }\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 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\nconst RESERVED_KEYWORDS = new Set([\"ontology\", \"object\", \"property\", \"link\", \"relation\", \"rid\", \"primarykey\", \"typeid\", \"ontologyobject\"]);\nexport const OBJECT_API_NAME_PATTERN = /^(?=.{1,100}$)[a-zA-Z][a-zA-Z0-9]*(?:\\.[a-zA-Z0-9]+)*$/u;\nexport const API_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{0,99}$/u;\nexport const NAMESPACED_API_NAME_PATTERN = /^(?=.{1,100}$)[a-zA-Z][a-zA-Z0-9_]*(?:\\.[a-zA-Z0-9_]+)*$/u;\nexport function isValidApiName(apiName) {\n return API_NAME_PATTERN.test(apiName) && !RESERVED_KEYWORDS.has(apiName.toLowerCase());\n}\nexport function isValidObjectApiName(apiName) {\n return OBJECT_API_NAME_PATTERN.test(apiName) && !RESERVED_KEYWORDS.has(apiName.toLowerCase());\n}\nexport function isValidNamespacedApiName(apiName) {\n return NAMESPACED_API_NAME_PATTERN.test(apiName) && !RESERVED_KEYWORDS.has(apiName.toLowerCase());\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 * Shallow-clones a definition object, copying any array-valued properties\n * to prevent shared-array mutation bugs (e.g. when users pass the same\n * datasources constant to multiple defineObject calls).\n *\n * Does NOT deep-clone nested objects so that entity references (interfaces,\n * link types, etc.) preserve their identity for registry lookups.\n */\nexport function cloneDefinition(input) {\n const clone = {\n ...input\n };\n for (const key in clone) {\n if (Object.prototype.hasOwnProperty.call(clone, key) && Array.isArray(clone[key])) {\n clone[key] = [...clone[key]];\n }\n }\n return clone;\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 isInterfaceSharedPropertyType(interfacePropertyType) {\n return \"sharedPropertyType\" in interfacePropertyType;\n}\nexport function getInterfacePropertyTypeType(interfacePropertyType) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType.type : interfacePropertyType.type;\n}\n\n/**\n * Whether this property holds a list of its declared type rather than a single value.\n */\nexport function isInterfacePropertyArray(interfacePropertyType) {\n const {\n array\n } = isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType : interfacePropertyType;\n return array ?? false;\n}\n\n/**\n * The type classes this property carries, or `undefined` if it declares none.\n *\n * Type classes drive render hints like sorting and filtering, so they are part of what an\n * implementing object type has to satisfy rather than presentation-only metadata.\n */\nexport function interfacePropertyTypeClasses(interfacePropertyType) {\n const {\n typeClasses\n } = isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType : interfacePropertyType;\n return typeClasses;\n}\n\n/**\n * The value type this property is an instance of, or `undefined` if it is not.\n *\n * A value type carries its own constraints, which an implementing object type's data has to\n * satisfy, so the reference is part of the contract rather than metadata about it.\n */\nexport function interfacePropertyValueType(interfacePropertyType) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType.valueType : interfacePropertyType.valueType;\n}\n\n/** The nullability requirements for a marking property. */\nconst MARKING_NULLABILITY = {\n noNulls: true,\n noEmptyCollections: true\n};\n\n/** What this property constrains about nulls and empty collections, or `undefined` if it declares nothing. */\nexport function interfacePropertyNullability(interfacePropertyType) {\n const source = isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType : interfacePropertyType;\n if (typeof source.type === \"object\" && source.type.type === \"marking\") {\n return source.nullability ?? MARKING_NULLABILITY;\n }\n return source.nullability;\n}\nexport function interfacePropertyPrimaryKeyConstraint(interfacePropertyType) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? \"NO_RESTRICTION\" : interfacePropertyType.primaryKeyConstraint ?? \"NO_RESTRICTION\";\n}\n\n/**\n * Whether implementing object types must provide this property.\n */\nexport function isInterfacePropertyRequired(interfacePropertyType) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.required : interfacePropertyType.required ?? true;\n}\n\n/**\n * The name a property is keyed by on the wire.\n */\nexport function interfacePropertyWireApiName(interfacePropertyType, authoredApiName) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType.apiName : authoredApiName;\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 { interfacePropertyWireApiName } from \"./InterfacePropertyType.js\";\nexport function getFlattenedInterfaceProperties(interfaceType) {\n let properties = Object.fromEntries(Object.entries(interfaceType.propertiesV3).map(([key, value]) => [interfacePropertyWireApiName(value, key), value]));\n Object.entries(interfaceType.propertiesV2).forEach(([apiName, spt]) => {\n if (!(apiName in properties)) {\n properties[apiName] = spt;\n }\n });\n interfaceType.extendsInterfaces.forEach(ext => {\n properties = {\n ...getFlattenedInterfaceProperties(ext),\n ...properties\n };\n });\n return properties;\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 isPropertyTypeType(v) {\n return v === \"boolean\" || v === \"byte\" || v === \"date\" || v === \"decimal\" || v === \"double\" || v === \"float\" || v === \"geopoint\" || v === \"geoshape\" || v === \"integer\" || v === \"long\" || typeof v === \"object\" && v.type === \"marking\" || v === \"short\" || v === \"string\" || v === \"timestamp\";\n}\nexport function isExotic(type) {\n if (type === undefined) {\n return false;\n }\n if (typeof type === \"string\") {\n return [\"geopoint\", \"geoshape\", \"mediaReference\", \"geotimeSeries\"].includes(type);\n } else if (typeof type === \"object\" && type != null) {\n return type.type === \"marking\" || type.type === \"struct\" || type.type === \"string\" || type.type === \"decimal\" || type.type === \"vector\";\n }\n return false;\n}\nexport function isStruct(type) {\n return typeof type === \"object\" && type.type === \"struct\";\n}\nexport function isVector(type) {\n return typeof type === \"object\" && type.type === \"vector\";\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 invariant from \"tiny-invariant\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\n\n// Standard ontology metadata limits count UTF-8 bytes.\nconst ONTOLOGY_DISPLAY_NAME_LIMIT = 1_000;\nexport const OBJECT_PROPERTY_DISPLAY_NAME_LIMIT = 1_500;\nconst ONTOLOGY_DESCRIPTION_LIMIT = 10_000;\nexport const ACTION_DISPLAY_NAME_LIMIT = 2_000;\nexport const ACTION_DESCRIPTION_LIMIT = 15_000;\n\n// Value type limits count UTF-16 code units, like JavaScript String.length.\nexport const VALUE_TYPE_DISPLAY_NAME_LIMIT = 100;\nexport const VALUE_TYPE_DESCRIPTION_LIMIT = 500;\nconst encoder = new TextEncoder();\nexport function validateMetadataLength(value, field, context, limit, unit = \"UTF-8 bytes\") {\n if (value == null) {\n return;\n }\n const length = unit === \"UTF-8 bytes\" ? encoder.encode(value).length : value.length;\n !(length <= limit) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${context}: ${field} must be at most ${limit} ${unit} (got ${length})`) : invariant(false) : void 0;\n}\nexport function validateDisplayMetadataLengths(metadata, context, nameLimit = ONTOLOGY_DISPLAY_NAME_LIMIT, descriptionLimit = ONTOLOGY_DESCRIPTION_LIMIT) {\n for (const field of [\"displayName\", \"pluralDisplayName\", \"groupDisplayName\"]) {\n validateMetadataLength(metadata[field], field, context, nameLimit);\n }\n validateMetadataLength(metadata.description, \"description\", context, descriptionLimit);\n}\nexport function validateStructFieldMetadata(type, context) {\n if (!isStruct(type)) {\n return;\n }\n for (const [apiName, field] of Object.entries(type.structDefinition)) {\n const metadata = typeof field === \"object\" && \"fieldType\" in field ? field.displayMetadata : undefined;\n validateDisplayMetadataLengths(metadata ?? {\n displayName: apiName\n }, `${context}, struct field \"${apiName}\"`, OBJECT_PROPERTY_DISPLAY_NAME_LIMIT);\n }\n}","/*\n * Copyright 2024 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 { getObject } from \"../conversion/toMarketplace/convertLink.js\";\nimport { API_NAME_PATTERN, isValidApiName, isValidObjectApiName, OBJECT_API_NAME_PATTERN } from \"../util/ApiNameValidator.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology, withoutNamespace } from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { getInterfacePropertyTypeType, isInterfacePropertyRequired, isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nimport { isExotic, isStruct } from \"./properties/PropertyTypeType.js\";\nimport { OBJECT_PROPERTY_DISPLAY_NAME_LIMIT, validateDisplayMetadataLengths, validateStructFieldMetadata } from \"./validateMetadataLengths.js\";\n// From https://stackoverflow.com/a/79288714\nconst ISO_8601_DURATION = /^P(?!$)(?:(?:((?:\\d+Y)|(?:\\d+(?:\\.|,)\\d+Y$))?((?:\\d+M)|(?:\\d+(?:\\.|,)\\d+M$))?((?:\\d+D)|(?:\\d+(?:\\.|,)\\d+D$))?(T((?:\\d+H)|(?:\\d+(?:\\.|,)\\d+H$))?((?:\\d+M)|(?:\\d+(?:\\.|,)\\d+M$))?((?:\\d+S)|(?:\\d+(?:\\.|,)\\d+S$))?)?)|(?:\\d+(?:(?:\\.|,)\\d+)?W))$/u;\n\n// ISO 8601 date and time format (YYYY-MM-DDThh:mm:ss.sssZ)\nconst ISO_8601_DATETIME = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})?)?$/u;\nexport function defineObject(objectDefInput) {\n const objectDef = cloneDefinition(objectDefInput);\n const apiName = namespace + objectDef.apiName;\n const propertyApiNames = objectDef.properties ? Object.keys(objectDef.properties) : [];\n if (ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][apiName] !== undefined) {\n throw new Error(`Object type with apiName ${objectDef.apiName} is already defined`);\n }\n !isValidObjectApiName(objectDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${objectDef.apiName}. API names must match the regex ${OBJECT_API_NAME_PATTERN}.`) : invariant(false) : void 0;\n const propertyBySharedPropertyType = new Map();\n propertyApiNames.forEach(apiName => {\n !isValidApiName(apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${apiName} for property on object ${objectDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`) : invariant(false) : void 0;\n !(objectDef.properties?.[apiName]?.includeEmptyBackingMediaSet !== true || objectDef.properties[apiName].type === \"mediaReference\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property ${apiName} on object ${objectDef.apiName} can only use includeEmptyBackingMediaSet when its type is mediaReference`) : invariant(false) : void 0;\n const sharedPropertyType = objectDef.properties?.[apiName]?.sharedPropertyType;\n if (sharedPropertyType !== undefined) {\n const previousProperty = propertyBySharedPropertyType.get(sharedPropertyType.apiName);\n !(previousProperty === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type \"${sharedPropertyType.apiName}\" cannot back both \"${previousProperty}\" and \"${apiName}\" on object \"${objectDef.apiName}\". A shared property type can only back one property per object.`) : invariant(false) : void 0;\n propertyBySharedPropertyType.set(sharedPropertyType.apiName, apiName);\n }\n });\n !propertyApiNames.includes(objectDef.titlePropertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Title property ${objectDef.titlePropertyApiName} is not defined on object ${objectDef.apiName}`) : invariant(false) : void 0;\n !propertyApiNames.includes(objectDef.primaryKeyPropertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} does not exist on object ${objectDef.apiName}`) : invariant(false) : void 0;\n !!objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.editOnly ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} on object ${objectDef.apiName} cannot be edit-only`) : invariant(false) : void 0;\n if (objectDef.includeEmptyBackingDatasource && objectDef.datasources) {\n const nonDatasetDatasources = objectDef.datasources.filter(ds => ds.type !== \"dataset\");\n !(nonDatasetDatasources.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object type \"${objectDef.apiName}\" has non-dataset datasources (${nonDatasetDatasources.map(ds => ds.type).join(\", \")}) and cannot use includeEmptyBackingDatasource. ` + `Empty backing datasources are only supported for object types with dataset datasources.`) : invariant(false) : void 0;\n }\n const retentionPeriods = (objectDef.datasources ?? []).filter(ds => ds.type === \"stream\").map(ds => ds.retentionPeriod);\n retentionPeriods.forEach(retentionPeriod => {\n !(retentionPeriod === undefined || ISO_8601_DURATION.test(retentionPeriod)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Retention period \"${retentionPeriod}\" on object \"${objectDef.apiName}\" is not a valid ISO 8601 duration string`) : invariant(false) : void 0;\n });\n const baseDatasources = (objectDef.datasources ?? []).filter(ds => [\"dataset\", \"stream\", \"restrictedView\"].includes(ds.type));\n !(baseDatasources.length <= 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object ${objectDef.apiName} has more than one base datasource (got: [${baseDatasources.map(ds => ds.type).join(\", \")}])`) : invariant(false) : void 0;\n const derivedDatasources = (objectDef.datasources ?? []).filter(ds => ds.type === \"derived\");\n if (derivedDatasources.length > 0) {\n derivedDatasources.forEach(ds => validateDerivedDatasource(objectDef, ds));\n }\n\n // Validate property statuses match the object status.\n // An experimental object can only have experimental properties.\n // A deprecated object can only have deprecated properties.\n // An example object can only have example properties.\n // There is no restriction on property statuses of an active object.\n const objectStatusType = getStatusType(objectDef.status);\n if (objectStatusType === \"experimental\" || objectStatusType === \"deprecated\" || objectStatusType === \"example\") {\n const mismatchedProperties = [];\n Object.entries(objectDef.properties ?? {}).forEach(([apiName, property]) => {\n if (property.status !== undefined) {\n const propertyStatusType = getStatusType(property.status);\n if (propertyStatusType !== objectStatusType) {\n mismatchedProperties.push(apiName);\n }\n }\n });\n !(mismatchedProperties.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object \"${objectDef.apiName}\" has \"${objectStatusType}\" status, but the following properties have a different status: ${mismatchedProperties.join(\", \")}`) : invariant(false) : void 0;\n }\n\n // Validate deprecated status deadline is in ISO 8601 format\n if (objectDef.status && typeof objectDef.status === \"object\" && objectDef.status.type === \"deprecated\") {\n const deadline = objectDef.status.deadline;\n !(deadline !== undefined && ISO_8601_DATETIME.test(deadline)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Deprecated status deadline \"${deadline}\" on object \"${objectDef.apiName}\" is not a valid ISO 8601 datetime string`) : invariant(false) : void 0;\n }\n const titleProp = objectDef.properties?.[objectDef.titlePropertyApiName]?.type;\n !(!isExotic(titleProp) || isStruct(titleProp) && titleProp.mainValue && !isExotic(titleProp.mainValue.type)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Title property ${objectDef.titlePropertyApiName} must be a primitive type`) : invariant(false) : void 0;\n !!isExotic(objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} can only be primitive types`) : invariant(false) : void 0;\n objectDef.implementsInterfaces?.forEach(interfaceImpl => {\n const allInterfaceProperties = getFlattenedInterfaceProperties(interfaceImpl.implements);\n const nonExistentInterfaceProperties = interfaceImpl.propertyMapping.map(val => val.interfaceProperty).filter(interfaceProperty => allInterfaceProperties[addNamespaceIfNone(interfaceProperty)] === undefined && allInterfaceProperties[withoutNamespace(interfaceProperty)] === undefined).map(interfaceProp => ({\n type: \"invalid\",\n reason: `Interface property ${interfaceProp} referenced in ${objectDef.apiName} object does not exist`\n }));\n const interfaceToObjectProperties = Object.fromEntries(interfaceImpl.propertyMapping.map(mapping => {\n const namespacedInterfaceProperty = addNamespaceIfNone(mapping.interfaceProperty);\n const interfaceProperty = allInterfaceProperties[namespacedInterfaceProperty] !== undefined ? namespacedInterfaceProperty : withoutNamespace(mapping.interfaceProperty);\n return [interfaceProperty, mapping.mapsTo];\n }));\n const validateProperty = interfaceProp => {\n const apiName = isInterfaceSharedPropertyType(interfaceProp[1]) ? interfaceProp[1].sharedPropertyType.apiName : interfaceProp[0];\n if (apiName in interfaceToObjectProperties) {\n return validateInterfaceImplProperty(interfaceProp[1], apiName, interfaceToObjectProperties[apiName], objectDef);\n }\n if (!isInterfacePropertyRequired(interfaceProp[1])) {\n return {\n type: \"valid\"\n };\n }\n return {\n type: \"invalid\",\n reason: `Interface spt ${apiName} not implemented by ${objectDef.apiName} object definition`\n };\n };\n const validations = Object.entries(getFlattenedInterfaceProperties(interfaceImpl.implements)).map(validateProperty);\n const allFailedValidations = validations.concat(nonExistentInterfaceProperties).filter(val => val.type === \"invalid\");\n !(allFailedValidations.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"\\n\" + allFailedValidations.map(formatValidationErrors).join(\"\\n\")) : invariant(false) : void 0;\n });\n const flattenedProperties = Object.entries(objectDef.properties ?? {}).map(([apiName, property]) => convertUserObjectPropertyType(apiName, property));\n const finalObject = {\n ...objectDef,\n apiName,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n properties: flattenedProperties\n };\n const context = `Object type \"${apiName}\"`;\n validateDisplayMetadataLengths(finalObject, context);\n for (const property of flattenedProperties) {\n const propertyContext = `${context}, property \"${property.apiName}\"`;\n validateDisplayMetadataLengths(property, propertyContext, OBJECT_PROPERTY_DISPLAY_NAME_LIMIT);\n validateStructFieldMetadata(property.type, propertyContext);\n }\n updateOntology(finalObject);\n objectDef.apiName = apiName;\n return objectDef;\n}\nfunction formatValidationErrors(error) {\n return `Ontology Definition Error: ${error.reason}\\n`;\n}\n\n// Validate that the object and the interface property match up\nfunction validateInterfaceImplProperty(type, apiName, mappedObjectProp, object) {\n const objProp = object.properties?.[mappedObjectProp];\n if (objProp === undefined) {\n return {\n type: \"invalid\",\n reason: `Object property mapped to interface does not exist. Object Property Mapped: ${mappedObjectProp}`\n };\n }\n const propertyType = getInterfacePropertyTypeType(type);\n if (JSON.stringify(propertyType) !== JSON.stringify(objProp?.type)) {\n return {\n type: \"invalid\",\n reason: `Object property type does not match the interface property it is mapped to. Interface Property: ${apiName}, objectProperty: ${mappedObjectProp}`\n };\n }\n return {\n type: \"valid\"\n };\n}\nexport function uppercaseFirstLetter(s) {\n return s === undefined || s == null ? \"\" : s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n// TODO: edge cases\nexport function convertToPluralDisplayName(s) {\n return s === undefined || s == null ? \"\" : s.endsWith(\"s\") ? uppercaseFirstLetter(s) : uppercaseFirstLetter(s) + \"s\";\n}\nfunction convertUserObjectPropertyType(apiName, property) {\n // fill in missing fields to be used by actions\n property.displayName = property.displayName ?? uppercaseFirstLetter(apiName);\n return {\n ...property,\n apiName,\n displayName: property.displayName ?? uppercaseFirstLetter(apiName),\n type: property.type\n };\n}\nfunction validateDerivedDatasource(objectDef, datasource) {\n // there should be at least one link\n !(datasource.linkDefinition.length > 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Derived datasource for object '${objectDef.apiName}' must have at least one link.`) : invariant(false) : void 0;\n\n // all of the links references should exist\n datasource.linkDefinition.forEach(link => {\n const linkApiName = link.linkType.apiName;\n !(ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE][linkApiName] !== undefined || importedTypes[OntologyEntityTypeEnum.LINK_TYPE][linkApiName] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Link type '${linkApiName}' used in derived datasource for object '${objectDef.apiName}' is not defined.`) : invariant(false) : void 0;\n });\n\n // all of the properties references on the source object should exist\n Object.keys(datasource.propertyMapping).forEach(prop => {\n !(objectDef.properties?.[prop] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${prop}' used in derived datasource for object '${objectDef.apiName}' is not defined.`) : invariant(false) : void 0;\n });\n const isLinkedProperties = typeof Object.values(datasource.propertyMapping)[0] === \"string\";\n if (isLinkedProperties) {\n validateLinkedProperties(datasource, objectDef);\n } else {\n validateAggregations(datasource, objectDef);\n }\n}\n\n/**\n * Gets properties for validation, handling self-referential links where\n * the target object is the same as the object being defined (not yet in registry).\n */\nfunction getPropertiesForValidation(linkObject, objectDef) {\n const targetApiName = typeof linkObject === \"string\" ? linkObject : linkObject.apiName;\n const selfApiName = namespace + objectDef.apiName;\n\n // Self-referential: use objectDef directly (not yet in registry)\n if (targetApiName === selfApiName) {\n return {\n apiName: selfApiName,\n hasProperty: propName => objectDef.properties?.[propName] !== undefined\n };\n }\n\n // Non-self-referential: look up from registry\n const {\n apiName,\n object\n } = getObject(linkObject);\n return {\n apiName,\n hasProperty: propName => object.properties?.find(p => p.apiName === propName) !== undefined\n };\n}\nfunction validateLinkedProperties(datasource, objectDef) {\n const foreignProperties = Object.values(datasource.propertyMapping);\n // the foreign property must exist in the final object in the link chain\n const targetObject = datasource.linkDefinition.at(-1).linkType.toMany.object;\n const {\n apiName,\n hasProperty\n } = getPropertiesForValidation(targetObject, objectDef);\n foreignProperties.forEach(prop => {\n !hasProperty(prop) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${prop}' on object '${apiName}' is not defined`) : invariant(false) : void 0;\n });\n}\nfunction validateAggregations(datasource, objectDef) {\n const props = datasource.propertyMapping;\n Object.entries(props).forEach(([propName, agg]) => {\n // TODO(dpaquin): check that the property type matches the foreign property type,\n // for collectList/collectSet and maybe min/max too?\n const property = objectDef.properties[propName];\n switch (agg.type) {\n case \"collectList\":\n case \"collectSet\":\n // property's type is collectible\n !isCollectible(property) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${propName}' on object '${objectDef.apiName}' is not collectible`) : invariant(false) : void 0;\n // limit <= 100\n !(agg.limit <= 100) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `[Error] Limit for collection '${propName}' on object '${objectDef.apiName}' is greater than 100`) : invariant(false) : void 0;\n break;\n case \"avg\":\n case \"sum\":\n // property's type is numeric\n !isNumeric(property.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${propName}' on object '${objectDef.apiName}' is not numeric`) : invariant(false) : void 0;\n break;\n case \"min\":\n case \"max\":\n case \"approximateCardinality\":\n case \"exactCardinality\":\n // property's type is primitive\n !isPrimitive(property.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${propName}' on object '${objectDef.apiName}' is not primitive`) : invariant(false) : void 0;\n break;\n default:\n break;\n }\n\n // if a foreign property is referenced, it must exist in the final object\n if (agg.type !== \"count\") {\n const foreignProperty = agg.property;\n const targetObject = datasource.linkDefinition.at(-1).linkType.toMany.object;\n const {\n apiName,\n hasProperty\n } = getPropertiesForValidation(targetObject, objectDef);\n !hasProperty(foreignProperty) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${foreignProperty}' on object '${apiName}' is not defined`) : invariant(false) : void 0;\n }\n });\n}\nfunction isCollectible(property) {\n if (!(property.array ?? false)) {\n return false;\n }\n const typeType = typeof property.type === \"string\" ? property.type : property.type.type;\n return [\"boolean\", \"byte\", \"date\", \"double\", \"float\", \"geohash\", \"geoshape\", \"integer\", \"long\", \"mediaReference\", \"short\", \"string\", \"struct\", \"timestamp\"].includes(typeType);\n}\nfunction isNumeric(type) {\n const typeType = typeof type === \"string\" ? type : type.type;\n return [\"byte\", \"double\", \"float\", \"integer\", \"long\", \"short\"].includes(typeType);\n}\nfunction isPrimitive(type) {\n const typeType = typeof type === \"string\" ? type : type.type;\n return [\"boolean\", \"byte\", \"date\", \"double\", \"float\", \"integer\", \"long\", \"short\", \"string\", \"timestamp\"].includes(typeType);\n}\nfunction getStatusType(status) {\n if (status === undefined) {\n return \"active\";\n }\n if (typeof status === \"string\") {\n return status;\n }\n return status.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 { uppercaseFirstLetter } from \"../../api/defineObject.js\";\nexport function convertActionSections(action) {\n return Object.fromEntries(Object.entries(action.sections ?? {}).map(([sectionId, section]) => [sectionId, {\n id: 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 \"../../api/defineOntology.js\";\nimport { convertConditionDefinition } from \"./convertConditionDefinition.js\";\nexport function convertActionParameterConditionalOverride(override, validation, 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)\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 { extractAllowedValues, renderHintFromBaseType } from \"../../api/defineOntology.js\";\nimport { convertActionParameterConditionalOverride } from \"./convertActionParameterConditionalOverride.js\";\nimport { convertActionVisibility } from \"./convertActionVisibility.js\";\nimport { convertSectionConditionalOverride } from \"./convertSectionConditionalOverride.js\";\nexport function convertActionValidation(action) {\n return {\n actionTypeLevelValidation: {\n rules: Object.fromEntries((action.validation ?? [{\n condition: {\n type: \"true\",\n true: {}\n },\n displayMetadata: {\n failureMessage: \"\",\n typeClasses: []\n }\n }]).map((rule, idx) => [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),\n required: convertParameterRequirementConstraint(p.validation.required)\n }\n },\n conditionalOverrides: p.validation.conditionalOverrides?.map(override => convertActionParameterConditionalOverride(override, p.validation, 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 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 2024 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 { isVector } from \"./properties/PropertyTypeType.js\";\nexport const defaultTypeClasses = [{\n kind: \"render_hint\",\n name: \"SELECTABLE\"\n}, {\n kind: \"render_hint\",\n name: \"SORTABLE\"\n}];\n\n// ExperimentalTimeDependentV1 and Attachment types should be included here once supported\nexport function shouldNotHaveRenderHints(type) {\n return [\"struct\", \"geoshape\", \"mediaReference\", \"geotimeSeries\", \"attachment\", \"vector\"].includes(getPropertyTypeName(type));\n}\nexport function hasRenderHints(typeClasses) {\n return (typeClasses ?? []).some(tc => tc.kind.toLowerCase() === \"render_hint\");\n}\nexport function getPropertyTypeName(type) {\n return typeof type === \"object\" ? type.type : type;\n}\nexport function validateVectorProperty(apiName, type, array) {\n if (!isVector(type)) {\n return;\n }\n !!array ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Vector property '${apiName}' cannot be an array`) : invariant(false) : void 0;\n !(Number.isInteger(type.dimension) && type.dimension >= 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Vector property '${apiName}' must have an integer 'dimension' of at least 1, but got ${type.dimension}`) : invariant(false) : void 0;\n}\nexport function shouldBeIndexedForSearch(type) {\n const typeName = getPropertyTypeName(type);\n return ![\"attachment\"].includes(getPropertyTypeName(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 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 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 invariant from \"tiny-invariant\";\nimport { isStruct } from \"../../api/properties/PropertyTypeType.js\";\nexport function convertReducers(type, apiName, reducers, sharedPropertyType) {\n reducers?.forEach(reducer => {\n if (reducer.structField) {\n !(isStruct(type) && Object.keys(type.structDefinition).includes(reducer.structField)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Reducer structField ${reducer.structField} does not exist in struct definition`) : invariant(false) : void 0;\n }\n });\n if (sharedPropertyType) {\n return mapReducers(sharedPropertyType.apiName, sharedPropertyType.reducers);\n } else {\n return mapReducers(apiName, reducers);\n }\n}\nexport function mapReducers(apiName, reducers) {\n return reducers?.map(reducer => {\n switch (reducer.direction) {\n case \"ascending\":\n return {\n direction: \"ASCENDING_NULLS_LAST\",\n structApiName: reducer.structField ? apiName : undefined,\n fieldApiName: reducer.structField\n };\n case \"descending\":\n return {\n direction: \"DESCENDING_NULLS_LAST\",\n structApiName: reducer.structField ? apiName : undefined,\n fieldApiName: reducer.structField\n };\n default:\n {\n throw new Error(`Unsupported reducer direction: ${reducer.direction}`);\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\nexport function distributeTypeHelper(type) {\n return {\n type,\n [type]: {}\n }; // any cast to match conditional return type\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 { isStruct } from \"../../api/properties/PropertyTypeType.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertMainValue(type, apiName, sharedPropertyType) {\n if (sharedPropertyType && isStruct(sharedPropertyType.type) && sharedPropertyType.type.mainValue) {\n return {\n fieldApiNames: Array.isArray(sharedPropertyType.type.mainValue.fields) ? sharedPropertyType.type.mainValue.fields : [sharedPropertyType.type.mainValue.fields],\n structApiName: sharedPropertyType.apiName,\n type: propertyTypeTypeToOntologyIrType(sharedPropertyType.type.mainValue.type)\n };\n }\n if (isStruct(type) && type.mainValue) {\n return {\n fieldApiNames: Array.isArray(type.mainValue.fields) ? type.mainValue.fields : [type.mainValue.fields],\n structApiName: apiName,\n type: propertyTypeTypeToOntologyIrType(type.mainValue.type)\n };\n }\n return undefined;\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\";\nimport { convertMainValue } from \"./convertMainValue.js\";\nexport function propertyTypeTypeToOntologyIrType(type, apiName, sharedPropertyType) {\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 apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition)\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 apiName: key,\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition.fieldType),\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 apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition)\n };\n }\n }\n structFields.push(field);\n }\n return {\n type: \"struct\",\n struct: {\n structFields,\n mainValue: convertMainValue(type, apiName, sharedPropertyType)\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 typeof type === \"object\" && type.type === \"vector\":\n return {\n type: \"vector\",\n vector: {\n dimension: type.dimension,\n supportsSearchWith: [type.supportsSearchWith],\n embeddingModel: type.embeddingModel,\n quantization: type.quantization\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 { shouldBeIndexedForSearch, validateVectorProperty } from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertReducers } from \"./convertReducers.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertSpt({\n type,\n array,\n reducers,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n aliases,\n valueType,\n nullability,\n baseFormatter\n}) {\n const dataConstraint = convertNullabilityToDataConstraint({\n type,\n nullability\n });\n validateVectorProperty(apiName, type, array);\n return {\n 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, apiName),\n reducers: convertReducers(type, apiName, reducers)\n }\n } : propertyTypeTypeToOntologyIrType(type, apiName),\n aliases: aliases ?? [],\n baseFormatter,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: shouldBeIndexedForSearch(type),\n typeClasses: typeClasses ?? [],\n valueType: valueType === undefined ? undefined : {\n apiName: valueType.apiName,\n version: valueType.version,\n packageNamespace: valueType.packageNamespace,\n displayMetadata: valueType.displayMetadata\n }\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) {\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 apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition),\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 fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition.fieldType),\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 displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition),\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 typeof type === \"object\" && type.type === \"vector\":\n return {\n type: \"vector\",\n vector: {\n dimension: type.dimension,\n supportsSearchWith: [type.supportsSearchWith],\n embeddingModel: type.embeddingModel,\n quantization: type.quantization\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 { interfacePropertyWireApiName, isInterfacePropertyRequired, isInterfaceSharedPropertyType } from \"../../api/interface/InterfacePropertyType.js\";\nimport { shouldBeIndexedForSearch, validateVectorProperty } from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nimport { propertyTypeTypeToOntologyIrInterfaceType } from \"./propertyTypeTypeToOntologyIrInterfaceType.js\";\nexport function convertInterfaceProperty(prop, apiName) {\n if (isInterfaceSharedPropertyType(prop)) {\n return [interfacePropertyWireApiName(prop, apiName), {\n type: \"sharedPropertyBasedPropertyType\",\n sharedPropertyBasedPropertyType: {\n requireImplementation: isInterfacePropertyRequired(prop),\n sharedPropertyType: convertSpt(prop.sharedPropertyType)\n }\n }];\n } else {\n validateVectorProperty(apiName, prop.type, prop.array);\n return [apiName, {\n type: \"interfaceDefinedPropertyType\",\n interfaceDefinedPropertyType: {\n apiName: 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)\n }\n } : propertyTypeTypeToOntologyIrInterfaceType(prop.type),\n constraints: {\n primaryKeyConstraint: prop.primaryKeyConstraint ?? \"NO_RESTRICTION\",\n requireImplementation: isInterfacePropertyRequired(prop),\n indexedForSearch: shouldBeIndexedForSearch(prop.type),\n typeClasses: prop.typeClasses ?? [],\n dataConstraints: convertNullabilityToDataConstraint({\n type: prop.type,\n nullability: prop.nullability\n }),\n valueType: prop.valueType ? {\n apiName: prop.valueType.apiName,\n version: prop.valueType.version,\n packageNamespace: prop.valueType.packageNamespace,\n displayMetadata: prop.valueType.displayMetadata\n } : undefined\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 { convertInterfaceProperty } from \"./convertInterfacePropertyType.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nexport function convertInterface(interfaceType) {\n const {\n __type,\n schemaMigrations,\n ...other\n } = interfaceType;\n return {\n ...other,\n // schema migrations travel in their own block data section rather than on the interface type\n // directly; we only use the declared object to determine if the IT is opted in,\n // but exclude the migrations themselves from the IT definition\n ...(schemaMigrations !== undefined ? {\n schemaMigrationsEnabled: true\n } : {}),\n propertiesV2: Object.fromEntries(Object.values(interfaceType.propertiesV2).map(spt => [spt.sharedPropertyType.apiName, {\n required: spt.required,\n sharedPropertyType: convertSpt(spt.sharedPropertyType)\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 extendsInterfaces: interfaceType.extendsInterfaces.map(i => i.apiName),\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))),\n extendsInterfacesMetadata: interfaceType.extendsInterfaces.map(i => convertInterface(i))\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 { interfacePropertyWireApiName } from \"../../api/interface/InterfacePropertyType.js\";\nexport function convertInterfaceSchemaMigrations(interfaceType) {\n const {\n schemaMigrations,\n propertiesV3\n } = interfaceType;\n if (schemaMigrations === undefined) {\n return undefined;\n }\n const schemaTransitions = Object.fromEntries(schemaMigrations.transitions.map(transition => [transition.id, {\n id: transition.id,\n title: transition.title,\n description: transition.description,\n gracePeriod: convertInterfaceSchemaGracePeriod(transition.gracePeriod),\n migrations: transition.instructions.map(instruction => convertInstruction(instruction, propertiesV3))\n }]));\n return {\n schemaTransitions\n };\n}\nexport function convertInterfaceSchemaGracePeriod(gracePeriod) {\n switch (gracePeriod.type) {\n case \"afterInstall\":\n return {\n type: \"daysAfterActivation\",\n daysAfterActivation: gracePeriod.days\n };\n case \"deadline\":\n // Normalize deadline format to match Java (strip .000 milliseconds)\n return {\n type: \"deadline\",\n deadline: gracePeriod.deadline.replace(/\\.000Z$/u, \"Z\")\n };\n default:\n {\n const unhandled = gracePeriod;\n throw new Error(`Unknown schema migration grace period type: ${unhandled.type}`);\n }\n }\n}\nfunction convertInstruction(instruction, propertiesV3) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n return {\n type: \"addRequiredProperty\",\n addRequiredProperty: {\n // Ontology-ir types this as an API name despite the field name\n propertyTypeRid: interfacePropertyWireApiName(propertiesV3[instruction.property], instruction.property)\n }\n };\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.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 invariant from \"tiny-invariant\";\nexport function convertDatasourceDefinition(objectType, properties) {\n const baseDatasource = objectType.datasources?.find(ds => [\"dataset\", \"stream\", \"restrictedView\", \"direct\"].includes(ds.type));\n switch (baseDatasource?.type) {\n case \"stream\":\n const window = baseDatasource.retentionPeriod;\n const retentionPolicy = window ? {\n type: \"time\",\n time: {\n window\n }\n } : {\n type: \"none\",\n none: {}\n };\n const propertyMapping = Object.fromEntries(properties.map(prop => [prop.apiName, prop.apiName]));\n return {\n type: \"streamV2\",\n streamV2: {\n streamLocator: objectType.apiName,\n propertyMapping,\n retentionPolicy,\n propertySecurityGroups: undefined\n }\n };\n case \"restrictedView\":\n return {\n type: \"restrictedViewV2\",\n restrictedViewV2: {\n restrictedViewRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties)\n }\n };\n case \"derived\":\n return {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties)\n }\n };\n case \"direct\":\n return {\n type: \"direct\",\n direct: {\n directSourceRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties),\n propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName)\n }\n };\n case \"dataset\":\n default:\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: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties),\n branchId: \"master\",\n propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName)\n }\n };\n }\n return {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties)\n }\n };\n }\n}\nfunction convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName) {\n if (!ds || !(\"objectSecurityPolicy\" in ds) && !(\"propertySecurityGroups\" in ds)) {\n return {\n groups: [{\n properties: properties.map(prop => prop.apiName),\n rid: \"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 assumedMarkingsV2: {},\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 usedProperties = new Set();\n ds.propertySecurityGroups?.forEach(psg => {\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 !!usedProperties.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 usedProperties.add(propertyName);\n });\n });\n const objectSecurityPolicyGroup = {\n rid: ds.objectSecurityPolicy?.name || \"defaultObjectSecurityPolicy\",\n security: {\n type: \"granular\",\n granular: convertGranularPolicy(ds.objectSecurityPolicy?.granularPolicy, ds.objectSecurityPolicy?.appliedMarkings, ds.objectSecurityPolicy?.assumedMarkings)\n },\n type: {\n type: \"primaryKey\",\n primaryKey: {}\n },\n properties: properties.filter(prop => !usedProperties.has(prop.apiName)).map(prop => prop.apiName)\n };\n return {\n groups: [objectSecurityPolicyGroup, ...(ds.propertySecurityGroups?.map(psg => ({\n rid: psg.name,\n security: {\n type: \"granular\",\n granular: convertGranularPolicy(psg.granularPolicy, psg.appliedMarkings, psg.assumedMarkings)\n },\n type: {\n type: \"property\",\n property: {\n name: psg.name\n }\n },\n properties: psg.properties ?? []\n })) ?? [])]\n };\n}\nfunction convertGranularPolicy(granularPolicy, appliedMarkings, assumedMarkings) {\n return {\n viewPolicy: {\n granularPolicyCondition: granularPolicy ? convertSecurityCondition(granularPolicy) : {\n type: \"and\",\n and: {\n conditions: []\n }\n },\n additionalMandatory: {\n markings: appliedMarkings ?? {},\n assumedMarkings: [],\n assumedMarkingsV2: assumedMarkings ?? {}\n }\n }\n };\n}\nfunction convertSecurityCondition(condition) {\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))\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 => convertSecurityCondition(c))\n }\n };\n } else {\n return condition;\n }\n case \"markingProperty\":\n return {\n type: \"markings\",\n markings: {\n property: condition.property\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: condition.property\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 buildPropertyMapping(properties) {\n return Object.fromEntries(properties.map(prop => {\n // editOnly\n if (prop.editOnly) {\n return [prop.apiName, {\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 [prop.apiName, structMapping];\n }\n // default: column mapping\n return [prop.apiName, {\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\nexport function convertValueType(valueType) {\n return {\n apiName: valueType.apiName,\n version: valueType.version,\n packageNamespace: valueType.packageNamespace,\n displayMetadata: valueType.displayMetadata\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 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 { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { dataConstraintToPropertyTypeDataConstraint } from \"./dataConstraintToPropertyTypeDataConstraint.js\";\nexport function convertValueTypeDataConstraints(property, dataConstraints) {\n const nullabilityDataConstraints = convertNullabilityToDataConstraint(property);\n if (dataConstraints.length === 0) {\n return nullabilityDataConstraints;\n }\n const propertyTypeConstraints = dataConstraints.map(constraint => ({\n constraints: dataConstraintToPropertyTypeDataConstraint(constraint.constraint.constraint),\n failureMessage: constraint.constraint.failureMessage\n }));\n return {\n ...nullabilityDataConstraints,\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\nimport invariant from \"tiny-invariant\";\nimport { convertObjectStatus, namespace } from \"../../api/defineOntology.js\";\nimport { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldBeIndexedForSearch, shouldNotHaveRenderHints, validateVectorProperty } from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertReducers } from \"./convertReducers.js\";\nimport { convertValueType } from \"./convertValueType.js\";\nimport { convertValueTypeDataConstraints } from \"./convertValueTypeDataConstraints.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertObjectPropertyType(property) {\n const apiName = namespace + 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 validateVectorProperty(apiName, property.type, property.array);\n const output = {\n apiName: property.apiName,\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, property.apiName, property.sharedPropertyType),\n reducers: convertReducers(property.type, property.apiName, property.reducers ?? [], property.sharedPropertyType)\n }\n } : propertyTypeTypeToOntologyIrType(property.type, property.apiName),\n typeClasses: property.typeClasses ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),\n status: convertObjectStatus(property.status),\n inlineAction: undefined,\n dataConstraints: property.valueType ? convertValueTypeDataConstraints(property, property.valueType.constraints) : convertNullabilityToDataConstraint(property),\n sharedPropertyTypeRid: property.sharedPropertyType?.apiName,\n valueType: property.valueType ? convertValueType(property.valueType) : 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 invariant from \"tiny-invariant\";\nimport { buildDatasource, cleanAndValidateLinkTypeId, convertObjectStatus } from \"../../api/defineOntology.js\";\nimport { isExotic } from \"../../api/properties/PropertyTypeType.js\";\nimport { convertDatasourceDefinition } from \"./convertDatasourceDefinition.js\";\nimport { convertObjectPropertyType } from \"./convertObjectPropertyType.js\";\nexport function convertObject(objectType) {\n const {\n derivedDatasources,\n derivedPropertyNames\n } = extractDerivedDatasources(objectType);\n const propertyDatasources = (objectType.properties ?? []).filter(prop => !derivedPropertyNames.includes(prop.apiName)).flatMap(prop => extractPropertyDatasource(prop, objectType.apiName));\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))), classificationInputGroup, mandatoryInputGroup);\n const implementations = objectType.implementsInterfaces ?? [];\n for (const impl of implementations) {\n const requiredConstraints = (impl.implements.actionTypeConstraints ?? []).filter(constraint => constraint.requireImplementation);\n !(requiredConstraints.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object \"${objectType.apiName}\" implements interface \"${impl.implements.apiName}\" which has required action type constraints: ${requiredConstraints.map(constraint => constraint.metadata.apiName).join(\", \")}. Action type constraint implementation is not yet supported in OAC. Set requireImplementation to false and manually implement the constraint after installation.`) : invariant(false) : void 0;\n }\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: [objectType.primaryKeyPropertyApiName],\n propertyTypes: Object.fromEntries(objectType.properties?.map(val => [val.apiName, convertObjectPropertyType(val)]) ?? []),\n titlePropertyTypeRid: objectType.titlePropertyApiName,\n apiName: objectType.apiName,\n status: convertObjectStatus(objectType.status),\n redacted: false,\n implementsInterfaces2: implementations.map(impl => ({\n actionTypes: {},\n interfaceTypeApiName: impl.implements.apiName,\n linksV2: {},\n propertiesV2: Object.fromEntries(impl.propertyMapping.map(mappings => [mappings.interfaceProperty, {\n type: \"propertyTypeRid\",\n propertyTypeRid: mappings.mapsTo\n }])),\n properties: {}\n })),\n allImplementsInterfaces: {}\n },\n datasources: [...propertyDatasources, ...derivedDatasources, objectDatasource],\n entityMetadata: {\n arePatchesEnabled: objectType.editsEnabled ?? false,\n aliases: objectType.aliases ?? [],\n editsHistory: convertEditsHistory(objectType.apiName, objectType.editsHistoryConfig)\n },\n propertySecurityGroupPackagingVersion: {\n type: \"v2\",\n v2: {}\n }\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) {\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: identifier,\n properties: [property.apiName]\n }\n };\n return [buildDatasource(property.apiName, geotimeDefinition)];\n case \"mediaReference\":\n const mediaSetDefinition = {\n type: \"mediaSetView\",\n mediaSetView: {\n assumedMarkings: [],\n clearOnDeleteProperties: [],\n mediaSetViewLocator: identifier,\n properties: [property.apiName],\n uploadProperties: property.includeEmptyBackingMediaSet ? [property.apiName] : []\n }\n };\n return [buildDatasource(property.apiName, mediaSetDefinition)];\n default:\n return [];\n }\n}\nfunction extractDerivedDatasources(objectType) {\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));\n const derivedPropertyNames = inputDerivedDatasources.flatMap(ds => Object.keys(ds.propertyMapping));\n return {\n derivedDatasources,\n derivedPropertyNames\n };\n}\nfunction buildDerivedDatasource(datasource, index, objectTypeApiName) {\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: 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]) => [sourceProp, {\n type: \"propertyType\",\n propertyType: targetProp\n }]))\n }\n } : {\n type: \"aggregatedProperties\",\n aggregatedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(Object.entries(datasource.propertyMapping).map(([sourceProp, agg]) => [sourceProp, buildAggregation(agg)]))\n }\n };\n const fullDefinition = {\n type: \"derived\",\n derived: {\n definition: derivedDefinition\n }\n };\n return buildDatasource(objectTypeApiName + \".derived.\" + index.toString(), fullDefinition);\n}\nfunction buildAggregation(agg) {\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 if (type !== \"count\") {\n if ([\"collectList\", \"collectSet\"].includes(type)) {\n innerDef.linkedProperty = {\n type: \"propertyType\",\n propertyType: foreignProperty\n };\n innerDef.limit = limit;\n } else {\n innerDef.property = {\n type: \"propertyType\",\n propertyType: foreignProperty\n };\n }\n }\n return {\n type,\n [type]: innerDef\n };\n}\nfunction convertEditsHistory(apiName, config) {\n if (config) {\n return config.enabled ? {\n type: \"config\",\n config: {\n store: apiName,\n storeAllPreviousProperties: config.storeAllPreviousProperties\n }\n } : {\n type: \"none\",\n none: {}\n };\n }\n return undefined;\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 \"../../api/common/OntologyEntityTypeEnum.js\";\nimport { cleanAndValidateLinkTypeId, convertAction } from \"../../api/defineOntology.js\";\nimport { convertInterface } from \"./convertInterface.js\";\nimport { convertInterfaceSchemaMigrations } from \"./convertInterfaceSchemaMigrations.js\";\nimport { convertLink } from \"./convertLink.js\";\nimport { convertObject } from \"./convertObject.js\";\nimport { convertSpt } from \"./convertSpt.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) {\n return {\n objectTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).map(([apiName, objectType]) => {\n return [apiName, convertObject(objectType)];\n })),\n sharedPropertyTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]).map(([apiName, spt]) => [apiName, {\n sharedPropertyType: convertSpt(spt)\n }])),\n interfaceTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).map(([apiName, interfaceType]) => {\n const schemaMigrations = convertInterfaceSchemaMigrations(interfaceType);\n return [apiName, {\n interfaceType: convertInterface(interfaceType),\n ...(schemaMigrations !== undefined ? {\n schemaMigrations\n } : {})\n }];\n })),\n linkTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.LINK_TYPE]).map(([id, link]) => {\n return [cleanAndValidateLinkTypeId(id), convertLink(link)];\n })),\n actionTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.ACTION_TYPE]).map(([apiName, action]) => {\n return [apiName, convertAction(action)];\n })),\n blockPermissionInformation: {\n actionTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.ACTION_TYPE]).filter(([_, action]) => action.validation || action.permission).map(([apiName, action]) => {\n return [apiName, {\n restrictionStatus: toActionTypeRestrictionStatus(action.permission ?? \"roles\")\n }];\n })),\n objectTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).filter(([_, objectType]) => objectType.permission != null).map(([apiName, objectType]) => {\n return [apiName, {\n restrictionStatus: toObjectTypeRestrictionStatus(objectType.permission)\n }];\n })),\n linkTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.LINK_TYPE]).filter(([_, link]) => link.permission != null).map(([id, link]) => {\n return [cleanAndValidateLinkTypeId(id), {\n restrictionStatus: toLinkTypeRestrictionStatus(link.permission)\n }];\n })),\n interfaceTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).filter(([_, iface]) => iface.permission != null).map(([apiName, iface]) => {\n return [apiName, {\n restrictionStatus: toInterfaceTypeRestrictionStatus(iface.permission)\n }];\n })),\n sharedPropertyTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]).filter(([_, spt]) => spt.permission != null).map(([apiName, spt]) => {\n return [apiName, {\n restrictionStatus: toSharedPropertyTypeRestrictionStatus(spt.permission)\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\nexport function convertValueTypesToIr(valueTypes) {\n return Object.values(valueTypes).map(definitions => ({\n metadata: {\n apiName: definitions[0].apiName,\n packageNamespace: definitions[0].packageNamespace,\n displayMetadata: definitions[0].displayMetadata,\n status: definitions[0].status\n },\n // TODO(dpaquin): instead of deduping here, we should refactor the value type types from arrays to maps\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 * 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 \"../../api/common/OntologyEntityTypeEnum.js\";\nimport { convertValueTypesToIr } from \"./convertValueTypesToIr.js\";\nexport function convertOntologyToValueTypeIr(ontology) {\n return {\n valueTypes: convertValueTypesToIr(ontology[OntologyEntityTypeEnum.VALUE_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 { importedTypes } from \"../../api/defineOntology.js\";\nimport { convertOntologyDefinitionToWireBlockData } from \"./convertOntologyDefinitionToWireBlockData.js\";\nimport { convertOntologyToValueTypeIr } from \"./convertOntologyToValueTypeIr.js\";\nexport function convertOntologyDefinition(ontology, randomnessKey) {\n return {\n ontology: convertOntologyDefinitionToWireBlockData(ontology),\n importedOntology: convertOntologyDefinitionToWireBlockData(importedTypes),\n valueTypes: convertOntologyToValueTypeIr(ontology),\n importedValueTypes: convertOntologyToValueTypeIr(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\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\nexport let interfaceSnippets = /*#__PURE__*/function (interfaceSnippets) {\n interfaceSnippets[interfaceSnippets[\"loadInterfacesReference\"] = 0] = \"loadInterfacesReference\";\n interfaceSnippets[interfaceSnippets[\"loadAllInterfacesReference\"] = 1] = \"loadAllInterfacesReference\";\n interfaceSnippets[interfaceSnippets[\"loadOrderedInterfacesReference\"] = 2] = \"loadOrderedInterfacesReference\";\n interfaceSnippets[interfaceSnippets[\"searchInterfacesReference\"] = 3] = \"searchInterfacesReference\";\n interfaceSnippets[interfaceSnippets[\"loadInterfaceMetadataSnippet\"] = 4] = \"loadInterfaceMetadataSnippet\";\n interfaceSnippets[interfaceSnippets[\"subscribeToObjectSetInstructions\"] = 5] = \"subscribeToObjectSetInstructions\";\n return interfaceSnippets;\n}({});\nexport let actionSnippets = /*#__PURE__*/function (actionSnippets) {\n actionSnippets[actionSnippets[\"applyAction\"] = 0] = \"applyAction\";\n actionSnippets[actionSnippets[\"batchApplyAction\"] = 1] = \"batchApplyAction\";\n return actionSnippets;\n}({});\nexport let objectSnippets = /*#__PURE__*/function (objectSnippets) {\n objectSnippets[objectSnippets[\"loadSingleObjectGuide\"] = 0] = \"loadSingleObjectGuide\";\n objectSnippets[objectSnippets[\"loadObjectsReference\"] = 1] = \"loadObjectsReference\";\n objectSnippets[objectSnippets[\"loadAllObjectsReference\"] = 2] = \"loadAllObjectsReference\";\n objectSnippets[objectSnippets[\"loadOrderedInterfacesReference\"] = 3] = \"loadOrderedInterfacesReference\";\n // what\n objectSnippets[objectSnippets[\"searchObjectsGuide\"] = 4] = \"searchObjectsGuide\";\n // There's specific search queries under this one too, but a little verbose\n objectSnippets[objectSnippets[\"aggregationTemplate\"] = 5] = \"aggregationTemplate\";\n /* Types of aggregation + group bys\n approximateDistinctAggregationTemplate,\n exactDistinctAggregationTemplate,\n numericAggregationTemplate,\n countAggregationTemplate,\n fixedWidthGroupByTemplate,\n durationGroupByTemplate,\n exactGroupByTemplate,\n rangeGroupByTemplate,\n */\n objectSnippets[objectSnippets[\"objectSetOperationsGuide\"] = 6] = \"objectSetOperationsGuide\";\n /* Types of set operations\n objectSetOperationsUnion,\n objectSetOperationsSubtract,\n objectSetOperationsIntersect,\n */\n objectSnippets[objectSnippets[\"loadObjectMetadataSnippet\"] = 7] = \"loadObjectMetadataSnippet\";\n objectSnippets[objectSnippets[\"subscribeToObjectSetInstructions\"] = 8] = \"subscribeToObjectSetInstructions\";\n return objectSnippets;\n}({});\nexport const snippetNameMapping = new Map([[\"loadInterfaceMetadataSnippet\", \"Load {{interfaceName}} metadata\"], [\"loadInterfacesReference\", \"Load pages of {{interfaceName}}\"], [\"loadAllInterfacesReference\", \"Load all {{interfaceName}}\"], [\"loadOrderedInterfacesReference\", \"Load ordered {{interfaceName}}\"], [\"searchInterfacesReference\", \"Filtering\"], [\"subscribeToObjectSetInstructions\", \"Subscribe to object sets\"]]);","/*\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 * as path from \"path\";\nimport { TYPESCRIPT_OSDK_SNIPPETS } from \"@osdk/typescript-sdk-docs\";\nimport { consola } from \"consola\";\nimport Mustache from \"mustache\";\nimport { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport { actionSnippets, interfaceSnippets, objectSnippets, snippetNameMapping } from \"./snippetTypes.js\";\nexport function createCodeSnippets(ontology, packageName, outputDir) {\n if (outputDir === undefined) {\n outputDir = \"./code-snippets\";\n }\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, {\n recursive: true\n });\n }\n if (packageName === undefined) {\n packageName = \"\";\n }\n consola.info(\"Generating code snippets to \", outputDir);\n for (const type of Object.values(OntologyEntityTypeEnum)) {\n for (const object of Object.values(ontology[type])) {\n let snippet = {};\n switch (type) {\n case OntologyEntityTypeEnum.OBJECT_TYPE:\n snippet = generateObjectSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.ACTION_TYPE:\n snippet = generateActionSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.INTERFACE_TYPE:\n snippet = generateInterfaceSnippet(object, packageName);\n break;\n default:\n continue;\n }\n fs.writeFileSync(path.join(outputDir, object.apiName), JSON.stringify(snippet));\n }\n }\n consola.info(\"Finished Code Snippet Generation\");\n}\nfunction generateInterfaceSnippet(interfaceType, packageName) {\n const interfaceContext = {\n interfaceApiName: interfaceType.apiName,\n packageName: packageName,\n objectOrInterfaceApiName: interfaceType.apiName,\n propertyNames: Object.keys(interfaceType.propertiesV3),\n interfaceName: interfaceType.displayMetadata.displayName\n };\n return getSnippets(interfaceSnippets, interfaceContext);\n}\nfunction generateObjectSnippet(objectType, packageName) {\n const objectContext = {\n objectType: objectType.apiName,\n packageName: packageName,\n objectOrInterfaceApiName: objectType.apiName\n };\n return getSnippets(objectSnippets, objectContext);\n}\nfunction generateActionSnippet(actionType, packageName) {\n const actionContext = {\n actionApiName: actionType.apiName,\n packageName: packageName\n };\n return getSnippets(actionSnippets, actionContext);\n}\nfunction getSnippets(snippetType, context) {\n const allSnippets = {};\n for (const templateName of Object.keys(snippetType).filter(key => isNaN(Number(key)))) {\n const versions = Object.values(TYPESCRIPT_OSDK_SNIPPETS.versions);\n const latestTemplate = versions.slice().reverse().find(v => v.snippets[templateName])?.snippets[templateName].at(-1)?.template ?? \"\";\n const renderedTemplate = Mustache.render(latestTemplate, context);\n const snippetName = snippetNameMapping.get(templateName);\n allSnippets[snippetName !== undefined ? Mustache.render(snippetName, context) : templateName] = renderedTemplate;\n }\n return allSnippets;\n}","/*\n * Copyright 2024 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 * as path from \"path\";\nimport { consola } from \"consola\";\nimport { convertActionParameters } from \"../conversion/toMarketplace/convertActionParameters.js\";\nimport { convertActionSections } from \"../conversion/toMarketplace/convertActionSections.js\";\nimport { convertActionValidation } from \"../conversion/toMarketplace/convertActionValidation.js\";\nimport { convertOntologyDefinition } from \"../conversion/toMarketplace/convertOntologyDefinition.js\";\nimport { convertOntologyToValueTypeIr } from \"../conversion/toMarketplace/convertOntologyToValueTypeIr.js\";\nimport { getFormContentOrdering } from \"../conversion/toMarketplace/getFormContentOrdering.js\";\nimport { createCodeSnippets } from \"./code-snippets/createCodeSnippets.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\n// type -> apiName -> entity\n/** @internal */\nexport let ontologyDefinition;\n\n// type -> apiName -> entity\n/** @internal */\nexport let importedTypes;\n\n// namespace -> version\n/** @internal */\nexport let dependencies;\n\n/** @internal */\nexport let namespace;\nexport function updateOntology(entity) {\n if (entity.__type !== OntologyEntityTypeEnum.VALUE_TYPE) {\n ontologyDefinition[entity.__type][entity.apiName] = entity;\n return;\n }\n // value types are a special case\n if (ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName] === undefined) {\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName] = [];\n }\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName].push(entity);\n}\nexport async function defineOntology(ns, body, outputDir, dependencyFile, codeSnippetFiles, snippetPackageName, snippetFileOutputDir, randomnessKey, /** Runs once the ontology is fully registered, but before anything is written to disk. */\nbeforeWrite) {\n namespace = ns;\n dependencies = {};\n ontologyDefinition = {\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n SHARED_PROPERTY_TYPE: {},\n VALUE_TYPE: {}\n };\n importedTypes = {\n SHARED_PROPERTY_TYPE: {},\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n VALUE_TYPE: {}\n };\n try {\n await body();\n } catch (e) {\n // The CLI entrypoint prints what is thrown; this only adds where it came from, under -v.\n consola.debug(\"Unexpected error while processing the body of the ontology\");\n throw e;\n }\n await beforeWrite?.(ontologyDefinition);\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\n }\n if (codeSnippetFiles) {\n createCodeSnippets(ontologyDefinition, snippetPackageName, snippetFileOutputDir);\n }\n return convertOntologyDefinition(ontologyDefinition, randomnessKey);\n}\nexport function writeStaticObjects(outputDir) {\n const codegenDir = path.resolve(outputDir, \"codegen\");\n const typeDirs = {\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"shared-property-types\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"action-types\",\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"object-types\",\n [OntologyEntityTypeEnum.LINK_TYPE]: \"link-types\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"interface-types\",\n [OntologyEntityTypeEnum.VALUE_TYPE]: \"value-types\"\n };\n if (!fs.existsSync(codegenDir)) {\n fs.mkdirSync(codegenDir, {\n recursive: true\n });\n }\n Object.values(typeDirs).forEach(typeDirNameFromMap => {\n const currentTypeDirPath = path.join(codegenDir, typeDirNameFromMap);\n if (fs.existsSync(currentTypeDirPath)) {\n fs.rmSync(currentTypeDirPath, {\n recursive: true,\n force: true\n });\n }\n fs.mkdirSync(currentTypeDirPath, {\n recursive: true\n });\n });\n const topLevelExportStatements = [];\n Object.entries(ontologyDefinition).forEach(([ontologyTypeEnumKey, entities]) => {\n const typeDirName = typeDirs[ontologyTypeEnumKey];\n const typeDirPath = path.join(codegenDir, typeDirName);\n const entityModuleNames = [];\n Object.entries(entities).forEach(([apiName, entity]) => {\n const entityFileNameBase = camel(withoutNamespace(apiName)) + (ontologyTypeEnumKey === OntologyEntityTypeEnum.VALUE_TYPE ? \"ValueType\" : \"\");\n const filePath = path.join(typeDirPath, `${entityFileNameBase}.ts`);\n const entityTypeName = getEntityTypeName(ontologyTypeEnumKey);\n const entityJSON = JSON.stringify(sanitizeTypes(entity), null, 2).replace(/(\"__type\"\\s*:\\s*)\"([^\"]*)\"/gu, (_, prefix, value) => `${prefix}OntologyEntityTypeEnum.${value}`);\n const content = `\nimport { wrapWithProxy, OntologyEntityTypeEnum } from '@osdk/maker';\nimport type { ${entityTypeName} } from '@osdk/maker';\n\n/** @type {import('@osdk/maker').${entityTypeName}} */\nconst ${entityFileNameBase}_base: ${entityTypeName} = ${ontologyTypeEnumKey === \"VALUE_TYPE\" ? entityJSON.slice(1, -2) : entityJSON} as unknown as ${entityTypeName};\n \nexport const ${entityFileNameBase}: ${entityTypeName} = wrapWithProxy(${entityFileNameBase}_base);\n `;\n fs.writeFileSync(filePath, content, {\n flag: \"w\"\n });\n entityModuleNames.push(entityFileNameBase);\n });\n for (const entityModuleName of entityModuleNames) {\n topLevelExportStatements.push(`export { ${entityModuleName} } from \"./codegen/${typeDirName}/${entityModuleName}.js\";`);\n }\n });\n if (topLevelExportStatements.length > 0) {\n const mainIndexContent = dependencyInjectionString() + topLevelExportStatements.join(\"\\n\") + \"\\n\";\n const mainIndexFilePath = path.join(outputDir, \"index.ts\");\n fs.writeFileSync(mainIndexFilePath, mainIndexContent, {\n flag: \"w\"\n });\n }\n}\nexport function buildDatasource(apiName, definition, classificationMarkingGroupName, mandatoryMarkingGroupName) {\n const needsSecurity = classificationMarkingGroupName !== undefined || mandatoryMarkingGroupName !== undefined;\n const securityConfig = needsSecurity ? {\n classificationConstraint: classificationMarkingGroupName ? {\n markingGroupName: classificationMarkingGroupName\n } : undefined,\n markingConstraint: mandatoryMarkingGroupName ? {\n markingGroupName: mandatoryMarkingGroupName\n } : undefined\n } : undefined;\n return {\n datasourceName: apiName,\n datasource: definition,\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: false,\n ...(securityConfig !== undefined && {\n dataSecurity: securityConfig\n })\n };\n}\nexport function sanitizeTypes(entity) {\n switch (entity.__type) {\n case OntologyEntityTypeEnum.INTERFACE_TYPE:\n return filterCyclicReferences({\n ...entity,\n linkedInterfaces: (entity.linkedInterfaces ?? []).map(interfaceTypeOrApiName => typeof interfaceTypeOrApiName === \"string\" ? ontologyDefinition[OntologyEntityTypeEnum.INTERFACE_TYPE][interfaceTypeOrApiName] : interfaceTypeOrApiName)\n });\n case OntologyEntityTypeEnum.OBJECT_TYPE:\n return entity.implementsInterfaces === undefined ? entity : {\n ...entity,\n implementsInterfaces: sanitizeImplements(entity.implementsInterfaces)\n };\n case OntologyEntityTypeEnum.LINK_TYPE:\n return sanitizeLinkInterfaces(entity);\n default:\n return entity;\n }\n}\nfunction sanitizeImplements(implementsInterfaces) {\n return implementsInterfaces.map(impl => ({\n ...impl,\n implements: filterCyclicReferences(impl.implements)\n }));\n}\nfunction sanitizeImplementer(object) {\n return object.implementsInterfaces === undefined ? object : {\n ...object,\n implementsInterfaces: sanitizeImplements(object.implementsInterfaces)\n };\n}\nfunction sanitizeLinkSideObject(object) {\n return typeof object === \"string\" ? object : sanitizeImplementer(object);\n}\nfunction sanitizeLinkInterfaces(link) {\n if (\"one\" in link) {\n return {\n ...link,\n one: {\n ...link.one,\n object: sanitizeLinkSideObject(link.one.object)\n },\n toMany: {\n ...link.toMany,\n object: sanitizeLinkSideObject(link.toMany.object)\n }\n };\n }\n if (\"intermediaryObjectType\" in link) {\n return {\n ...link,\n intermediaryObjectType: sanitizeImplementer(link.intermediaryObjectType),\n many: sanitizeIntermediarySide(link.many),\n toMany: sanitizeIntermediarySide(link.toMany)\n };\n }\n return {\n ...link,\n many: {\n ...link.many,\n object: sanitizeLinkSideObject(link.many.object)\n },\n toMany: {\n ...link.toMany,\n object: sanitizeLinkSideObject(link.toMany.object)\n }\n };\n}\nfunction sanitizeIntermediarySide(side) {\n return {\n ...side,\n object: sanitizeLinkSideObject(side.object),\n linkToIntermediary: sanitizeLinkInterfaces(side.linkToIntermediary)\n };\n}\nfunction filterCyclicReferences(iface, ancestors = new Set(), expanded = new Set()) {\n ancestors.add(iface.apiName);\n const processLinked = linked => {\n if (typeof linked === \"string\") return linked;\n if (ancestors.has(linked.apiName)) return linked.apiName;\n if (expanded.has(linked.apiName)) {\n const {\n linkedInterfaces: _,\n extendsInterfaces: __,\n ...shallow\n } = linked;\n return {\n ...shallow,\n linkedInterfaces: [],\n extendsInterfaces: []\n };\n }\n return filterCyclicReferences(linked, new Set(ancestors), expanded);\n };\n expanded.add(iface.apiName);\n return {\n ...iface,\n linkedInterfaces: (iface.linkedInterfaces ?? []).map(processLinked),\n extendsInterfaces: iface.extendsInterfaces.map(parent => processLinked(parent))\n };\n}\nexport function cleanAndValidateLinkTypeId(apiName) {\n // Insert a dash before any uppercase letter that follows a lowercase letter or digit\n // Replace underscores used by legacy link API names with dashes.\n const step1 = apiName.replace(/_/gu, \"-\").replace(/([a-z0-9])([A-Z])/gu, \"$1-$2\");\n // Insert a dash after a sequence of uppercase letters when followed by a lowercase letter\n // then convert the whole string to lowercase\n // e.g., apiName, APIname, and apiNAME will all be converted to api-name\n const linkTypeId = step1.replace(/([A-Z])([A-Z][a-z])/gu, \"$1-$2\").toLowerCase();\n const VALIDATION_PATTERN = /^([a-z][a-z0-9\\-]*)$/u;\n if (!VALIDATION_PATTERN.test(linkTypeId)) {\n throw new Error(`LinkType id '${linkTypeId}' must be lower case with dashes.`);\n }\n return linkTypeId;\n}\nexport function dumpOntologyFullMetadata() {\n return convertOntologyDefinition(ontologyDefinition);\n}\nexport function dumpValueTypeWireType() {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\nexport function convertObjectStatus(status) {\n if (status === undefined) {\n return {\n type: \"active\",\n active: {}\n };\n }\n if (status === \"active\") {\n return {\n type: \"active\",\n active: {}\n };\n }\n if (status === \"experimental\") {\n return {\n type: \"experimental\",\n experimental: {}\n };\n }\n if (status === \"example\") {\n return {\n type: \"example\",\n example: {}\n };\n }\n if (typeof status === \"object\" && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined\n }\n };\n }\n return status;\n}\nexport function convertAction(action) {\n const actionValidation = convertActionValidation(action);\n const actionParameters = convertActionParameters(action);\n const actionSections = convertActionSections(action);\n const parameterOrdering = action.parameterOrdering ?? (action.parameters ?? []).map(p => p.id);\n return {\n actionType: {\n actionTypeLogic: {\n logic: {\n rules: action.rules\n },\n validation: actionValidation\n },\n metadata: {\n apiName: action.apiName,\n 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 successMessage: action.submissionMetadata?.successMessage ? [{\n type: \"message\",\n message: action.submissionMetadata.successMessage\n }] : [],\n typeClasses: action.typeClasses ?? [],\n applyingMessage: [],\n ...(action.submissionMetadata?.submitButtonDisplayMetadata && {\n submitButtonDisplayMetadata: action.submissionMetadata.submitButtonDisplayMetadata\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration && {\n undoButtonConfiguration: action.submissionMetadata.undoButtonConfiguration\n })\n },\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 }\n }\n };\n}\nexport function extractAllowedValues(allowedValues) {\n switch (allowedValues.type) {\n case \"oneOf\":\n return {\n type: \"oneOf\",\n oneOf: {\n type: \"oneOf\",\n oneOf: {\n labelledValues: allowedValues.oneOf,\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\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 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 // TODO(dpaquin): there's probably a TS clean way to do this\n }\n}\nexport function renderHintFromBaseType(parameter, validation) {\n // TODO(dpaquin): these are just guesses, we should find where they're actually defined\n const type = typeof parameter.type === \"string\" ? parameter.type : parameter.type.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 (validation?.allowedValues?.type === \"user\" || validation?.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 (parameter.validation.allowedValues?.type === \"mandatoryMarking\") {\n return {\n type: \"mandatoryMarkingPicker\",\n mandatoryMarkingPicker: {}\n };\n } else if (parameter.validation.allowedValues?.type === \"cbacMarking\") {\n return {\n type: \"cbacMarkingPicker\",\n cbacMarkingPicker: {}\n };\n } else {\n throw new Error(`The allowed values for \"${parameter.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}\nexport function extractNamespace(apiName) {\n return apiName.substring(0, apiName.lastIndexOf(\".\") + 1);\n}\nexport function withoutNamespace(apiName) {\n const lastDot = apiName.lastIndexOf(\".\");\n if (lastDot === -1) {\n return apiName;\n }\n return apiName.substring(lastDot + 1);\n}\nfunction camel(str) {\n if (!str) {\n return str;\n }\n let result = str.replace(/[-_]+(.)?/gu, (_, c) => c ? c.toUpperCase() : \"\");\n result = result.charAt(0).toLowerCase() + result.slice(1);\n return result;\n}\n\n/**\n * Gets the TypeScript type name corresponding to an OntologyEntityTypeEnum value\n */\nfunction getEntityTypeName(type) {\n return {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"ObjectType\",\n [OntologyEntityTypeEnum.LINK_TYPE]: \"LinkType\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"InterfaceType\",\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"SharedPropertyType\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"ActionType\",\n [OntologyEntityTypeEnum.VALUE_TYPE]: \"ValueTypeDefinitionVersion\"\n }[type];\n}\nexport function writeDependencyFile(dependencyFile) {\n fs.writeFileSync(dependencyFile, JSON.stringify(dependencies, null, 2));\n}\nfunction dependencyInjectionString() {\n const namespaceNoDot = namespace.endsWith(\".\") ? namespace.slice(0, -1) : namespace;\n return `import { addDependency } from \"@osdk/maker\";\n// @ts-ignore\naddDependency(\"${namespaceNoDot}\", new URL(import.meta.url).pathname);\n`;\n}\nexport function addNamespaceIfNone(apiName) {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\n}\nexport function initializeOntologyState(ns) {\n namespace = ns;\n dependencies = {};\n ontologyDefinition = {\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n SHARED_PROPERTY_TYPE: {},\n VALUE_TYPE: {}\n };\n importedTypes = {\n SHARED_PROPERTY_TYPE: {},\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n VALUE_TYPE: {}\n };\n}\nexport function getOntologyDefinition() {\n return ontologyDefinition;\n}\nexport function getImportedTypes() {\n return importedTypes;\n}\nexport function getNamespace() {\n return namespace;\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 * as path from \"path\";\nimport { dependencies } from \"./defineOntology.js\";\nconst MAX_SEARCH_DEPTH = 5;\nexport function addDependency(namespaceNoDot, fileInPackage) {\n let dir = path.dirname(fileInPackage);\n let packageJsonPath = null;\n for (let i = 0; i < MAX_SEARCH_DEPTH; i++) {\n const candidate = path.join(dir, \"package.json\");\n if (fs.existsSync(candidate)) {\n packageJsonPath = candidate;\n break;\n }\n const parentDir = path.dirname(dir);\n if (parentDir === dir) break;\n dir = parentDir;\n }\n if (!packageJsonPath) {\n throw new Error(`Could not find a package.json within ${MAX_SEARCH_DEPTH} parent directories of ${fileInPackage}`);\n }\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, \"utf-8\"));\n dependencies[namespaceNoDot] = packageJson.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\n/**\n * Gets a single property by apiName from either ObjectTypeDefinition (Record)\n * or ObjectType (Array) format.\n */\nexport function getProperty(obj, propertyId) {\n const props = obj.properties;\n if (props == null) return undefined;\n if (Array.isArray(props)) {\n return props.find(prop => prop.apiName === propertyId);\n }\n return propertyId in props ? props[propertyId] : undefined;\n}\n\n/**\n * Gets all property apiNames from either format.\n */\nexport function getPropertyKeys(obj) {\n const props = obj.properties;\n if (props == null) return [];\n if (Array.isArray(props)) {\n return props.map(prop => prop.apiName);\n }\n return Object.keys(props);\n}\n\n/**\n * Converts properties from either format to a Record keyed by apiName.\n */\nexport function toPropertyMap(obj) {\n const props = obj.properties;\n if (props == null) return {};\n if (Array.isArray(props)) {\n return Object.fromEntries(props.map(prop => [prop.apiName, prop]));\n }\n return props;\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 { convertConditionDefinition } from \"../conversion/toMarketplace/convertConditionDefinition.js\";\nimport { isActionParameterTypePrimitive } from \"./action/ActionParameterType.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { uppercaseFirstLetter } from \"./defineObject.js\";\nimport { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology, withoutNamespace } from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { getInterfacePropertyTypeType, isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nimport { getProperty, getPropertyKeys } from \"./object/objectPropertyHelpers.js\";\nimport { isStruct, isVector } from \"./properties/PropertyTypeType.js\";\nimport { ACTION_DESCRIPTION_LIMIT, ACTION_DISPLAY_NAME_LIMIT, validateDisplayMetadataLengths } from \"./validateMetadataLengths.js\";\nexport const MODIFY_OBJECT_PARAMETER = \"objectToModifyParameter\";\nexport const CREATE_OR_MODIFY_OBJECT_PARAMETER = \"objectToCreateOrModifyParameter\";\nexport const DELETE_OBJECT_PARAMETER = \"objectToDeleteParameter\";\nexport const CREATE_INTERFACE_OBJECT_PARAMETER = \"objectTypeParameter\";\nexport const MODIFY_INTERFACE_OBJECT_PARAMETER = \"interfaceObjectToModifyParameter\";\nexport function defineAction(actionDefInput) {\n const actionDef = cloneDefinition(actionDefInput);\n const apiName = namespace + actionDef.apiName;\n const parameterIds = (actionDef.parameters ?? []).map(p => p.id);\n if (ontologyDefinition[OntologyEntityTypeEnum.ACTION_TYPE][apiName] !== undefined) {\n throw new Error(`Action type with apiName ${actionDef.apiName} is already defined`);\n }\n !/^[a-z0-9]+(?:[-.][a-z0-9]+)*$/u.test(actionDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action type apiName \"${actionDef.apiName}\" must contain lowercase alphanumeric segments separated by hyphens or dots`) : invariant(false) : void 0;\n const parameterIdsSet = new Set(parameterIds);\n !(parameterIdsSet.size === parameterIds.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter ids must be unique`) : invariant(false) : void 0;\n const parameterIdsNotFound = Array.from(referencedParameterIds(actionDef)).filter(p => !parameterIdsSet.has(p));\n !(parameterIdsNotFound.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameters ${JSON.stringify(parameterIdsNotFound)} were referenced but not defined`) : invariant(false) : void 0;\n const definedSectionIds = new Set(Object.keys(actionDef.sections ?? []));\n const undefinedSectionsInOrdering = (actionDef.formContentOrdering ?? []).flatMap(s => s.type === \"parameterId\" ? [] : [s.sectionId]).filter(sId => !definedSectionIds.has(sId));\n !(undefinedSectionsInOrdering.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Sections [${undefinedSectionsInOrdering}] were referenced in content ordering but not defined`) : invariant(false) : void 0;\n !(actionDef.rules.length > 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action type ${actionDef.apiName} must have at least one logic rule`) : invariant(false) : void 0;\n actionDef.rules.forEach(rule => {\n if (rule.type === \"modifyObjectRule\") {\n !parameterIds.some(id => id === rule.modifyObjectRule.objectToModify) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object to modify parameter must be defined in parameters`) : invariant(false) : void 0;\n }\n if (rule.type === \"deleteObjectRule\") {\n !parameterIds.some(id => id === rule.deleteObjectRule.objectToDelete) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object to delete parameter must be defined in parameters`) : invariant(false) : void 0;\n }\n if (rule.type === \"modifyInterfaceRule\") {\n // The there must be a parameter for the interface, and the interface there must exist\n const interfaceParam = actionDef.parameters.find(p => p.id === rule.modifyInterfaceRule.interfaceObjectToModifyParameter);\n !(interfaceParam !== undefined && typeof interfaceParam.type === \"object\" && (interfaceParam.type.type === \"interfaceReference\" || interfaceParam.type.type === \"interfaceReferenceList\")) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface object to modify parameter must be an interface reference`) : invariant(false) : void 0;\n const interfaceReference = interfaceParam.type.type === \"interfaceReference\" ? interfaceParam.type.interfaceReference.interfaceTypeRid : interfaceParam.type.interfaceReferenceList.interfaceTypeRid;\n !(ontologyDefinition.INTERFACE_TYPE[interfaceReference] !== undefined || importedTypes.INTERFACE_TYPE[interfaceReference] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface type ${interfaceReference} does not exist`) : invariant(false) : void 0;\n\n // All referenced SPTs must exist on the interface\n const interfaceType = ontologyDefinition.INTERFACE_TYPE[interfaceReference];\n Object.keys(rule.modifyInterfaceRule.sharedPropertyValues).forEach(spt => {\n !Object.keys(getFlattenedInterfaceProperties(interfaceType)).includes(spt) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${spt} does not exist in interface type ${interfaceReference}`) : invariant(false) : void 0;\n });\n }\n if (rule.type === \"addInterfaceRule\") {\n // The referenced interface must exist globally\n const interfaceType = ontologyDefinition.INTERFACE_TYPE[rule.addInterfaceRule.interfaceApiName] ?? importedTypes.INTERFACE_TYPE[rule.addInterfaceRule.interfaceApiName];\n !(interfaceType !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface type ${rule.addInterfaceRule.interfaceApiName} does not exist`) : invariant(false) : void 0;\n\n // All referenced SPTs must exist on the interface\n Object.keys(rule.addInterfaceRule.sharedPropertyValues).forEach(spt => {\n !Object.keys(getFlattenedInterfaceProperties(interfaceType)).includes(spt) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${spt} does not exist in interface type ${interfaceType.apiName}`) : invariant(false) : void 0;\n });\n }\n if (rule.type === \"addInterfaceLinkRuleV2\") {\n const ilr = rule.addInterfaceLinkRuleV2;\n const interfaceType = ontologyDefinition.INTERFACE_TYPE[ilr.interfaceTypeRid] ?? importedTypes.INTERFACE_TYPE[ilr.interfaceTypeRid];\n !(interfaceType !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface type ${ilr.interfaceTypeRid} does not exist`) : invariant(false) : void 0;\n !interfaceType.links.some(link => link.metadata.apiName === ilr.interfaceLinkTypeRid) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link type ${ilr.interfaceLinkTypeRid} does not exist on interface ${ilr.interfaceTypeRid}`) : invariant(false) : void 0;\n }\n });\n const fullAction = {\n ...actionDef,\n apiName,\n entities: actionDef.entities ?? {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n __type: OntologyEntityTypeEnum.ACTION_TYPE\n };\n validateActionConfiguration(fullAction);\n const context = `Action type \"${apiName}\"`;\n validateDisplayMetadataLengths(fullAction, context, ACTION_DISPLAY_NAME_LIMIT, ACTION_DESCRIPTION_LIMIT);\n for (const parameter of fullAction.parameters ?? []) {\n validateDisplayMetadataLengths(parameter, `${context}, parameter \"${parameter.id}\"`, ACTION_DISPLAY_NAME_LIMIT, ACTION_DESCRIPTION_LIMIT);\n }\n for (const [id, section] of Object.entries(fullAction.sections ?? {})) {\n validateDisplayMetadataLengths(section, `${context}, section \"${id}\"`, ACTION_DISPLAY_NAME_LIMIT, ACTION_DESCRIPTION_LIMIT);\n }\n updateOntology(fullAction);\n return fullAction;\n}\nexport function isPropertyParameter(def, name, type) {\n if (\"interfaceType\" in def) {\n return Object.keys(getFlattenedInterfaceProperties(def.interfaceType)).includes(name) && !Object.keys(def.nonParameterMappings ?? {}).includes(name) && !isStruct(type) && !isVector(type) && !def.excludedProperties?.includes(name);\n }\n return getPropertyKeys(def.objectType).includes(name) && !Object.keys(def.nonParameterMappings ?? {}).includes(name) && !isVector(type) && !def.excludedProperties?.includes(name);\n}\nexport function createParameters(def, propertyMap, parameterSet, requiredMap) {\n const targetParams = getTargetParameters(def, parameterSet);\n return [...targetParams, ...Array.from(parameterSet).map(id => {\n let propertyMetadata;\n if (id in propertyMap) {\n propertyMetadata = \"sharedPropertyType\" in propertyMap[id] ? propertyMap[id].sharedPropertyType : propertyMap[id];\n }\n return {\n id,\n displayName: def.parameterConfiguration?.[id]?.displayName ?? propertyMetadata?.displayName ?? uppercaseFirstLetter(id),\n type: def.parameterConfiguration?.[id]?.customParameterType ?? extractActionParameterType(propertyMetadata),\n validation: def.parameterConfiguration?.[id] !== undefined ? {\n ...def.parameterConfiguration?.[id],\n allowedValues: def.parameterConfiguration?.[id].allowedValues ?? (def.parameterConfiguration?.[id].customParameterType ? extractAllowedValuesFromActionParameterType(def.parameterConfiguration?.[id].customParameterType) : extractAllowedValuesFromPropertyType(propertyMetadata.type)),\n required: def.parameterConfiguration?.[id].required ?? (propertyMetadata?.array ?? false ? {\n listLength: propertyMetadata?.nullability?.noEmptyCollections ? {\n min: 1\n } : {}\n } : propertyMetadata?.nullability?.noNulls ?? false)\n } : {\n required: propertyMetadata.array ?? false ? {\n listLength: propertyMetadata.nullability?.noEmptyCollections ? {\n min: 1\n } : {}\n } : requiredMap?.[id] ?? propertyMetadata?.nullability?.noNulls ?? false,\n allowedValues: extractAllowedValuesFromPropertyType(propertyMetadata?.type)\n },\n defaultValue: def.parameterConfiguration?.[id]?.defaultValue,\n description: def.parameterConfiguration?.[id]?.description,\n renderHint: def.parameterConfiguration?.[id]?.renderHint\n };\n })];\n}\nexport function createStructFieldValues(def, parameters) {\n return Object.fromEntries(parameters.flatMap(parameter => {\n const property = getProperty(def.objectType, parameter.id);\n if (property === undefined || !isStruct(property.type)) {\n return [];\n }\n !(typeof parameter.type === \"object\" && (parameter.type.type === \"struct\" || parameter.type.type === \"structList\")) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter ${parameter.id} for struct property ${parameter.id} must have a struct parameter type`) : invariant(false) : void 0;\n return [[parameter.id, Object.fromEntries(Object.keys(property.type.structDefinition).map(fieldApiName => [fieldApiName, property.array ? {\n type: \"structListParameterFieldValue\",\n structListParameterFieldValue: {\n parameterId: parameter.id,\n structFieldApiName: fieldApiName\n }\n } : {\n type: \"structParameterFieldValue\",\n structParameterFieldValue: {\n parameterId: parameter.id,\n structFieldApiName: fieldApiName\n }\n }]))]];\n }));\n}\nexport function createPropertyParameterValues(def, parameterIds) {\n return Object.fromEntries(parameterIds.filter(parameterId => {\n const property = getProperty(def.objectType, parameterId);\n return property === undefined || !isStruct(property.type);\n }).map(parameterId => [parameterId, {\n type: \"parameterId\",\n parameterId\n }]));\n}\nfunction getTargetParameters(def, parameterSet) {\n const targetParams = [];\n parameterSet.forEach(name => {\n if (name === MODIFY_OBJECT_PARAMETER) {\n targetParams.push({\n id: MODIFY_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Modify object\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: def.objectType.apiName\n }\n } : {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: def.objectType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n allowedValues: {\n type: \"objectQuery\"\n },\n required: def.parameterConfiguration?.[name]?.required ?? true\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(MODIFY_OBJECT_PARAMETER);\n }\n if (name === CREATE_OR_MODIFY_OBJECT_PARAMETER) {\n targetParams.push({\n id: CREATE_OR_MODIFY_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Create or modify object\",\n type: {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: def.objectType.apiName,\n maybeCreateObjectOption: !(\"primaryKeyOption\" in def) ? {\n type: \"autoGenerated\",\n autoGenerated: {}\n } : def.primaryKeyOption === \"autoGenerated\" ? {\n type: \"autoGenerated\",\n autoGenerated: {}\n } : {\n type: \"userInput\",\n userInput: {}\n }\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n allowedValues: {\n type: \"objectQuery\"\n },\n required: def.parameterConfiguration?.[name]?.required ?? true\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(CREATE_OR_MODIFY_OBJECT_PARAMETER);\n }\n if (name === DELETE_OBJECT_PARAMETER && !(\"interfaceType\" in def)) {\n targetParams.push({\n id: DELETE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Delete object\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: def.objectType.apiName\n }\n } : {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: def.objectType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n allowedValues: {\n type: \"objectQuery\"\n },\n required: def.parameterConfiguration?.[name]?.required ?? true\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(DELETE_OBJECT_PARAMETER);\n }\n if (name === CREATE_INTERFACE_OBJECT_PARAMETER && \"interfaceType\" in def) {\n targetParams.push({\n id: CREATE_INTERFACE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Object type to create\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: def.objectType.apiName\n }\n } : {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: [def.interfaceType.apiName]\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n required: def.parameterConfiguration?.[name]?.required ?? true,\n allowedValues: def.objectType === undefined ? {\n type: \"objectTypeReference\",\n interfaceTypes: [def.interfaceType.apiName]\n } : {\n type: \"oneOf\",\n oneOf: [{\n label: def.objectType.displayName,\n value: {\n type: \"objectType\",\n objectType: {\n objectTypeId: def.objectType.apiName\n }\n }\n }]\n }\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(CREATE_INTERFACE_OBJECT_PARAMETER);\n }\n if (name === MODIFY_INTERFACE_OBJECT_PARAMETER && \"interfaceType\" in def) {\n targetParams.push({\n id: MODIFY_INTERFACE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Object type to modify\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n } : {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n required: def.parameterConfiguration?.[name]?.required ?? true,\n allowedValues: def.objectType === undefined ? {\n type: \"interfaceObjectQuery\"\n } : {\n type: \"oneOf\",\n oneOf: [{\n label: def.objectType.displayName,\n value: {\n type: \"objectType\",\n objectType: {\n objectTypeId: def.objectType.apiName\n }\n }\n }]\n }\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(MODIFY_INTERFACE_OBJECT_PARAMETER);\n }\n if (name === DELETE_OBJECT_PARAMETER && \"interfaceType\" in def) {\n targetParams.push({\n id: DELETE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Delete Object\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n } : {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n required: def.parameterConfiguration?.[name]?.required ?? true,\n allowedValues: def.objectType === undefined ? {\n type: \"interfaceObjectQuery\"\n } : {\n type: \"oneOf\",\n oneOf: [{\n label: def.objectType.displayName,\n value: {\n type: \"objectType\",\n objectType: {\n objectTypeId: def.objectType.apiName\n }\n }\n }]\n }\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(DELETE_OBJECT_PARAMETER);\n }\n });\n return targetParams;\n}\nfunction referencedParameterIds(actionDef) {\n const parameterIds = new Set();\n\n // section definitions\n Object.values(actionDef.sections ?? {}).flatMap(p => p.parameters).forEach(pId => parameterIds.add(pId));\n\n // form content ordering\n (actionDef.formContentOrdering ?? []).forEach(item => {\n if (item.type === \"parameterId\") {\n parameterIds.add(item.parameterId);\n }\n });\n\n // logic rules\n actionDef.rules.forEach(rule => {\n // when visiting each rule, we also do drive-by namespace prefixing\n switch (rule.type) {\n case \"addInterfaceRule\":\n rule.addInterfaceRule.interfaceApiName = sanitize(rule.addInterfaceRule.interfaceApiName);\n parameterIds.add(rule.addInterfaceRule.objectTypeParameter);\n Object.entries(rule.addInterfaceRule.sharedPropertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n delete rule.addInterfaceRule.sharedPropertyValues[k];\n rule.addInterfaceRule.sharedPropertyValues[sanitize(k)] = v;\n });\n break;\n case \"modifyInterfaceRule\":\n parameterIds.add(rule.modifyInterfaceRule.interfaceObjectToModifyParameter);\n Object.entries(rule.modifyInterfaceRule.sharedPropertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n delete rule.modifyInterfaceRule.sharedPropertyValues[k];\n rule.modifyInterfaceRule.sharedPropertyValues[sanitize(k)] = v;\n });\n break;\n case \"addObjectRule\":\n Object.entries(rule.addObjectRule.propertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n });\n break;\n case \"modifyObjectRule\":\n Object.entries(rule.modifyObjectRule.propertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n });\n break;\n case \"addOrModifyObjectRuleV2\":\n Object.entries(rule.addOrModifyObjectRuleV2.propertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n });\n break;\n case \"addInterfaceLinkRuleV2\":\n rule.addInterfaceLinkRuleV2.interfaceTypeRid = sanitize(rule.addInterfaceLinkRuleV2.interfaceTypeRid);\n rule.addInterfaceLinkRuleV2.interfaceLinkTypeRid = sanitize(rule.addInterfaceLinkRuleV2.interfaceLinkTypeRid);\n [...rule.addInterfaceLinkRuleV2.sourceObjects, ...rule.addInterfaceLinkRuleV2.targetObjects].forEach(ref => {\n switch (ref.type) {\n case \"existingObject\":\n parameterIds.add(ref.existingObject);\n break;\n case \"createdInterfaceObjectReferenceByPk\":\n parameterIds.add(ref.createdInterfaceObjectReferenceByPk.objectType);\n parameterIds.add(ref.createdInterfaceObjectReferenceByPk.primaryKey);\n break;\n case \"createdInterfaceObjectReferenceByUniqueIdentifier\":\n parameterIds.add(ref.createdInterfaceObjectReferenceByUniqueIdentifier.objectType);\n break;\n case \"createdObjectReference\":\n // references another logic rule by LogicRuleRid, not a parameter\n break;\n }\n });\n break;\n case \"deleteInterfaceLinkRule\":\n rule.deleteInterfaceLinkRule.interfaceTypeRid = sanitize(rule.deleteInterfaceLinkRule.interfaceTypeRid);\n rule.deleteInterfaceLinkRule.interfaceLinkTypeRid = sanitize(rule.deleteInterfaceLinkRule.interfaceLinkTypeRid);\n parameterIds.add(rule.deleteInterfaceLinkRule.sourceObject);\n parameterIds.add(rule.deleteInterfaceLinkRule.targetObject);\n break;\n }\n });\n return parameterIds;\n}\nexport function extractAllowedValuesFromActionParameterType(type) {\n if (typeof type === \"object\") {\n switch (type.type) {\n case \"objectReference\":\n case \"objectReferenceList\":\n return {\n type: \"objectQuery\"\n };\n case \"interfaceReference\":\n case \"interfaceReferenceList\":\n return {\n type: \"interfaceObjectQuery\"\n };\n case \"objectSetRid\":\n return {\n type: \"objectSetRid\"\n };\n case \"struct\":\n case \"structList\":\n return {\n type: \"struct\"\n };\n default:\n throw new Error(`Inferred allowed values for ${type.type} not yet supported. Please explicitly provide allowed values.`);\n }\n }\n switch (type) {\n case \"boolean\":\n case \"booleanList\":\n return {\n type: \"boolean\"\n };\n case \"integer\":\n case \"integerList\":\n case \"decimal\":\n case \"decimalList\":\n case \"double\":\n case \"doubleList\":\n case \"long\":\n case \"longList\":\n return {\n type: \"range\"\n };\n case \"timestamp\":\n case \"timestampList\":\n case \"date\":\n case \"dateList\":\n return {\n type: \"datetime\"\n };\n case \"string\":\n case \"stringList\":\n return {\n type: \"text\"\n };\n case \"geohash\":\n case \"geohashList\":\n return {\n type: \"geohash\"\n };\n case \"geoshape\":\n case \"geoshapeList\":\n return {\n type: \"geoshape\"\n };\n case \"mediaReference\":\n case \"mediaReferenceList\":\n return {\n type: \"mediaReference\"\n };\n case \"geotimeSeriesReference\":\n case \"geotimeSeriesReferenceList\":\n return {\n type: \"geotimeSeriesReference\"\n };\n case \"attachment\":\n case \"attachmentList\":\n return {\n type: \"attachment\"\n };\n default:\n throw new Error(`Inferred allowed values for ${type} not yet supported. Please explicitly provide allowed values.`);\n }\n}\nfunction extractAllowedValuesFromPropertyType(type) {\n switch (type) {\n case \"boolean\":\n return {\n type: \"boolean\"\n };\n case \"byte\":\n return {\n type: \"range\",\n min: {\n type: \"staticValue\",\n staticValue: {\n type: \"integer\",\n integer: 0\n }\n },\n max: {\n type: \"staticValue\",\n staticValue: {\n type: \"integer\",\n integer: 255\n }\n }\n };\n case \"timestamp\":\n case \"date\":\n return {\n type: \"datetime\"\n };\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n return {\n type: \"range\"\n };\n case \"short\":\n return {\n type: \"range\",\n min: {\n type: \"staticValue\",\n staticValue: {\n type: \"integer\",\n integer: 0\n }\n },\n max: {\n type: \"staticValue\",\n staticValue: {\n type: \"integer\",\n integer: 65535\n }\n }\n };\n case \"string\":\n return {\n type: \"text\"\n };\n case \"geopoint\":\n return {\n type: \"geohash\"\n };\n case \"geoshape\":\n return {\n type: \"geoshape\"\n };\n case \"mediaReference\":\n return {\n type: \"mediaReference\"\n };\n case \"geotimeSeries\":\n return {\n type: \"geotimeSeriesReference\"\n };\n case \"attachment\":\n return {\n type: \"attachment\"\n };\n default:\n switch (type.type) {\n case \"decimal\":\n return {\n type: \"range\"\n };\n case \"marking\":\n return type.markingType === \"CBAC\" ? {\n type: \"cbacMarking\"\n } : {\n type: \"mandatoryMarking\"\n };\n case \"string\":\n return {\n type: \"text\"\n };\n case \"struct\":\n return {\n type: \"struct\"\n };\n case \"vector\":\n throw new Error(\"Vectors are not supported as action parameters yet\");\n default:\n throw new Error(\"Unknown type\");\n }\n break;\n }\n}\nfunction extractActionParameterType(pt) {\n const typeType = pt.type;\n if (typeof typeType === \"object\") {\n switch (typeType.type) {\n case \"decimal\":\n return maybeAddList(\"decimal\", pt);\n case \"marking\":\n return maybeAddList(\"marking\", pt);\n case \"string\":\n return maybeAddList(\"string\", pt);\n case \"struct\":\n return extractStructActionParameterType(typeType, pt.array ?? false);\n case \"vector\":\n throw new Error(\"Vectors are not supported as action parameters yet\");\n default:\n throw new Error(`Unknown type`);\n }\n }\n if (typeof typeType === \"string\" && isActionParameterTypePrimitive(typeType)) {\n return maybeAddList(typeType, pt);\n }\n switch (typeType) {\n case \"byte\":\n case \"short\":\n return maybeAddList(\"integer\", pt);\n case \"geopoint\":\n return maybeAddList(\"geohash\", pt);\n case \"float\":\n return maybeAddList(\"double\", pt);\n case \"geotimeSeries\":\n return maybeAddList(\"geotimeSeriesReference\", pt);\n default:\n throw new Error(\"Unknown type\");\n }\n}\nfunction extractStructActionParameterType(type, isList) {\n const structFieldTypes = Object.fromEntries(Object.entries(type.structDefinition).map(([apiName, fieldDefinition]) => [apiName, extractStructFieldParameterType(typeof fieldDefinition === \"object\" && \"fieldType\" in fieldDefinition ? fieldDefinition.fieldType : fieldDefinition)]));\n return isList ? {\n type: \"structList\",\n structList: {\n structFieldTypes\n }\n } : {\n type: \"struct\",\n struct: {\n structFieldTypes\n }\n };\n}\nfunction extractStructFieldParameterType(type) {\n const typeName = typeof type === \"object\" ? type.type : type;\n switch (typeName) {\n case \"boolean\":\n return {\n type: \"boolean\",\n boolean: {}\n };\n case \"byte\":\n case \"integer\":\n case \"short\":\n return {\n type: \"integer\",\n integer: {}\n };\n case \"long\":\n return {\n type: \"long\",\n long: {}\n };\n case \"decimal\":\n case \"double\":\n case \"float\":\n return {\n type: \"double\",\n double: {}\n };\n case \"string\":\n return {\n type: \"string\",\n string: {}\n };\n case \"geopoint\":\n return {\n type: \"geohash\",\n geohash: {}\n };\n case \"geoshape\":\n return {\n type: \"geoshape\",\n geoshape: {}\n };\n case \"timestamp\":\n return {\n type: \"timestamp\",\n timestamp: {}\n };\n case \"date\":\n return {\n type: \"date\",\n date: {}\n };\n default:\n throw new Error(`Property type ${typeName} is not supported for struct action parameter fields`);\n }\n}\nfunction maybeAddList(type, pt) {\n return pt.array ?? false ? type + \"List\" : type;\n}\nexport function kebab(s) {\n return s.replace(/([a-z])([A-Z])/gu, \"$1-$2\").replace(/([A-Z])([A-Z][a-z])/gu, \"$1-$2\").replace(/\\./gu, \"-\").toLowerCase();\n}\nfunction sanitize(s) {\n return s.includes(\".\") ? s : namespace + s;\n}\nexport function convertValidationRule(actionValidation, actionParameters) {\n return actionValidation.map(rule => {\n return {\n condition: convertConditionDefinition(rule.condition, actionParameters),\n displayMetadata: rule.displayMetadata ?? {\n failureMessage: \"Did not satisfy validation\",\n typeClasses: []\n }\n };\n });\n}\nfunction validateActionConfiguration(action) {\n const seenParameterIds = new Set();\n const parameterMap = action.parameters?.reduce((acc, param) => {\n acc[param.id] = param;\n return acc;\n }, {}) ?? {};\n const orderedParameters = action.parameterOrdering?.map(id => parameterMap[id]) ?? action.parameters;\n orderedParameters?.forEach(param => {\n param.validation.conditionalOverrides?.forEach(override => {\n validateParameterCondition(override.condition, param.id, seenParameterIds, action.parameters);\n });\n validateParameterPrefill(param.id, seenParameterIds, action.parameters, param.defaultValue);\n seenParameterIds.add(param.id);\n });\n}\nfunction validateParameterCondition(condition, currentParameterId, seenParameterIds, parameters) {\n switch (condition.type) {\n case \"parameter\":\n const overrideParamId = condition.parameterId;\n !parameters?.some(p => p.id === overrideParamId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter condition on ${currentParameterId} is referencing unknown parameter ${overrideParamId}`) : invariant(false) : void 0;\n !(overrideParamId !== currentParameterId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter condition on ${currentParameterId} is referencing itself`) : invariant(false) : void 0;\n !seenParameterIds.has(overrideParamId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter condition on ${currentParameterId} is referencing later parameter ${overrideParamId}`) : invariant(false) : void 0;\n break;\n case \"and\":\n // this will not catch the niche edge case where users use the full syntax for unions\n if (\"conditions\" in condition) {\n condition.conditions.forEach(c => validateParameterCondition(c, currentParameterId, seenParameterIds, parameters));\n }\n break;\n case \"or\":\n if (\"conditions\" in condition) {\n condition.conditions.forEach(c => validateParameterCondition(c, currentParameterId, seenParameterIds, parameters));\n }\n break;\n case \"comparison\":\n case \"group\":\n case \"not\":\n case \"markings\":\n case \"regex\":\n case \"redacted\":\n case \"true\":\n break;\n default:\n throw new Error(`Unknown condition type on parameter ${currentParameterId}`);\n }\n}\nfunction validateParameterPrefill(currentParameterId, seenParameterIds, parameters, defaultValue) {\n if (!defaultValue) return;\n switch (defaultValue.type) {\n case \"objectParameterPropertyValue\":\n !parameters?.some(p => p.id === defaultValue.objectParameterPropertyValue.parameterId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Default value for parameter ${currentParameterId} is referencing unknown parameter ${defaultValue.objectParameterPropertyValue.parameterId}`) : invariant(false) : void 0;\n !seenParameterIds.has(defaultValue.objectParameterPropertyValue.parameterId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Default value for parameter ${currentParameterId} is referencing later parameter ${defaultValue.objectParameterPropertyValue.parameterId}`) : invariant(false) : void 0;\n break;\n case \"staticValue\":\n !(defaultValue.staticValue.type === parameters?.find(p => p.id === currentParameterId)?.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Default static value for parameter ${currentParameterId} does not match type`) : invariant(false) : void 0;\n break;\n case \"staticObject\":\n case \"interfaceParameterPropertyValue\":\n case \"objectQueryPrefill\":\n case \"objectQueryPropertyValue\":\n case \"objectSetRidPrefill\":\n case \"redacted\":\n break;\n default:\n throw new Error(`Unknown default value type for parameter ${currentParameterId}`);\n }\n}\nexport function validateActionParameters(def, properties, name) {\n // validates that parameters either exist as object properties or have a type defined\n [...Object.keys(def.parameterConfiguration ?? {})].forEach(id => {\n !(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || def.parameterConfiguration?.[id].customParameterType !== undefined || isTargetParameter(id)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter ${id} does not exist as a property on ${name} and its type is not explicitly defined`) : invariant(false) : void 0;\n });\n [...Object.keys(def.nonParameterMappings ?? {}), ...(def.excludedProperties ?? [])].forEach(id => {\n !(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || properties.includes(withoutNamespace(id))) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property ${id} does not exist as a property on ${name}`) : invariant(false) : void 0;\n });\n}\n\n// Parameters with configurations will be ordered first in the order they were defined\n// followed by the rest of the parameters in the order they were defined on the object type.\nexport function createDefaultParameterOrdering(def, properties, parameters, priorityId) {\n return [...(priorityId ? [priorityId] : []), ...Object.keys(def.parameterConfiguration ?? {}).filter(id => id !== priorityId), ...properties.filter(id => !def.parameterConfiguration?.[id] && parameters.some(p => p.id === id))];\n}\nexport function validateParameterOrdering(parameterOrdering, parameterSet, actionApiName) {\n const orderingSet = new Set(parameterOrdering);\n const missingParameters = [...parameterSet].filter(param => !orderingSet.has(param));\n const extraneousParameters = parameterOrdering.filter(param => !parameterSet.has(param));\n !(extraneousParameters.length === 0 && missingParameters.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action parameter ordering for ${actionApiName} does not match expected parameters. Extraneous parameters in ordering: {${extraneousParameters}}, Missing parameters in ordering: {${missingParameters}}`) : invariant(false) : void 0;\n}\nexport function isTargetParameter(parameterId) {\n return parameterId === MODIFY_OBJECT_PARAMETER || parameterId === CREATE_OR_MODIFY_OBJECT_PARAMETER || parameterId === CREATE_INTERFACE_OBJECT_PARAMETER || parameterId === MODIFY_INTERFACE_OBJECT_PARAMETER;\n}\nexport function addNamespaceToActionDefinition(def) {\n def.parameterConfiguration = Object.fromEntries(Object.entries(def.parameterConfiguration ?? {}).map(([id, config]) => [getInterfaceParameterName(def, id), config]));\n def.nonParameterMappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [addNamespaceIfNone(id), value]));\n def.excludedProperties = (def.excludedProperties ?? []).map(id => addNamespaceIfNone(id));\n def.sections = def.sections?.map(section => ({\n ...section,\n parameters: section.parameters.map(p => getInterfaceParameterName(def, p))\n }));\n}\n\n// Adds a namespace to an interface parameter name if it is supposed to be namespaced\nexport function getInterfaceParameterName(def, parameter) {\n if (def.useNonNamespacedParameters) {\n return getNonNamespacedParameterName(def, parameter);\n }\n return isTargetParameter(parameter) || !Object.keys(def.interfaceType.propertiesV2).includes(addNamespaceIfNone(parameter)) ? parameter : addNamespaceIfNone(parameter);\n}\nexport function getNonNamespacedParameterName(def, parameter) {\n return def.conflictingParameterOverrides?.[parameter] ?? (parameter.split(\".\").pop() || parameter);\n}\nexport function createInterfacePropertyLogicRuleValue(id, def, actionDef) {\n const type = getInterfacePropertyTypeType(def);\n const array = isInterfaceSharedPropertyType(def) ? def.sharedPropertyType.array : def.array;\n const parameterId = actionDef.useNonNamespacedParameters ? getNonNamespacedParameterName(actionDef, id) : id;\n if (isStruct(type)) {\n return {\n type: \"structLogicRuleValue\",\n structLogicRuleValue: Object.fromEntries(Object.entries(type.structDefinition).map(([apiName, fieldValue]) => {\n return [apiName, array ? {\n type: \"structListParameterFieldValue\",\n structListParameterFieldValue: {\n parameterId,\n structFieldApiName: apiName\n }\n } : {\n type: \"structParameterFieldValue\",\n structParameterFieldValue: {\n parameterId,\n structFieldApiName: apiName\n }\n }];\n }))\n };\n }\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"parameterId\",\n parameterId\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\nexport function combineApiNamespaceIfMissing(namespace, apiName) {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, defineAction, kebab } from \"./defineAction.js\";\nimport { importedTypes, namespace, ontologyDefinition, withoutNamespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nexport function defineCreateInterfaceLinkAction(defInput) {\n const def = cloneDefinition(defInput);\n const linkConstraint = typeof def.interfaceLink === \"string\" ? undefined : def.interfaceLink;\n !(linkConstraint === undefined || def.from === undefined || def.from.apiName === linkConstraint.from.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"from\" (\"${def.from?.apiName}\") does not match the interface (\"${linkConstraint?.from.apiName}\") that interface link constraint \"${linkConstraint?.apiName}\" was defined on. Omit \"from\" to use the constraint's own interface.`) : invariant(false) : void 0;\n const from = def.from ?? linkConstraint?.from;\n !(from !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"from\" is required when \"interfaceLink\" is provided as a string (the api name).`) : invariant(false) : void 0;\n const interfaceLinkApiName = typeof def.interfaceLink === \"string\" ? def.interfaceLink : def.interfaceLink.apiName;\n const linkApiName = combineApiNamespaceIfMissing(namespace, interfaceLinkApiName);\n const link = from.links.find(l => l.metadata.apiName === linkApiName);\n !(link !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link constraint \"${interfaceLinkApiName}\" not found on interface \"${from.apiName}\". Define it with defineInterfaceLinkConstraint first.`) : invariant(false) : void 0;\n !(link.linkedEntityTypeId.type === \"interfaceType\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link constraint \"${interfaceLinkApiName}\" on \"${from.apiName}\" does not link to an interface type.`) : invariant(false) : void 0;\n const targetApiName = link.linkedEntityTypeId.interfaceType;\n !(ontologyDefinition.INTERFACE_TYPE[targetApiName] !== undefined || importedTypes.INTERFACE_TYPE[targetApiName] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Target interface \"${targetApiName}\" of interface link constraint \"${interfaceLinkApiName}\" is not defined.`) : invariant(false) : void 0;\n const sourceId = def.sourceParameter?.id ?? \"source\";\n const targetId = def.targetParameter?.id ?? \"target\";\n const sourceParam = {\n id: sourceId,\n displayName: def.sourceParameter?.displayName ?? from.displayMetadata.displayName,\n description: def.sourceParameter?.description,\n type: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: from.apiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n };\n const targetParam = {\n id: targetId,\n displayName: def.targetParameter?.displayName ?? withoutNamespace(targetApiName),\n description: def.targetParameter?.description,\n type: link.cardinality === \"MANY\" ? {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: targetApiName\n }\n } : {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: targetApiName\n }\n },\n validation: {\n required: link.cardinality === \"MANY\" ? {\n listLength: link.required ? {\n min: 1\n } : {}\n } : link.required,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n };\n const parameters = [sourceParam, targetParam];\n return defineAction({\n apiName: def.apiName ?? `link-${kebab(withoutNamespace(from.apiName))}-${kebab(withoutNamespace(interfaceLinkApiName))}`,\n displayName: def.displayName ?? `Link ${from.displayMetadata.displayName}`,\n description: def.description,\n status: def.status ?? \"active\",\n entities: {\n affectedInterfaceTypes: [from.apiName, targetApiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameters,\n rules: [{\n type: \"addInterfaceLinkRuleV2\",\n addInterfaceLinkRuleV2: {\n interfaceTypeRid: from.apiName,\n interfaceLinkTypeRid: linkApiName,\n sourceObjects: [{\n type: \"existingObject\",\n existingObject: sourceId\n }],\n targetObjects: [{\n type: \"existingObject\",\n existingObject: targetId\n }]\n }\n }],\n parameterOrdering: [sourceId, targetId],\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(s => [s.id, s]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { randomUUID } from \"crypto\";\nexport function convertInterfacePropertyMappingValue(value) {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID()\n }\n }\n };\n case \"currentTime\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"currentTime\",\n currentTime: {}\n }\n };\n case \"currentUser\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"currentUser\",\n currentUser: {}\n }\n };\n default:\n return {\n type: \"logicRuleValue\",\n logicRuleValue: value\n };\n }\n}\nexport function convertMappingValue(value) {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID()\n }\n };\n case \"currentTime\":\n return {\n type: \"currentTime\",\n currentTime: {}\n };\n case \"currentUser\":\n return {\n type: \"currentUser\",\n currentUser: {}\n };\n default:\n return value;\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 { convertInterfacePropertyMappingValue, convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, CREATE_INTERFACE_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, getNonNamespacedParameterName, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { getInterfacePropertyTypeType, isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nexport function defineCreateInterfaceObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);\n const actionInterfaceProperties = Object.entries(allProperties).filter(([apiName, type]) => isPropertyParameter(def, apiName, getInterfacePropertyTypeType(type)));\n const sptNames = actionInterfaceProperties.filter(([_apiName, type]) => isInterfaceSharedPropertyType(type)).map(([apiName]) => apiName);\n const parameterNames = new Set(actionInterfaceProperties.map(([apiName, _type]) => getInterfaceParameterName(def, apiName)));\n const propertyMap = Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [getInterfaceParameterName(def, id), prop]));\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(getInterfaceParameterName(def, param)));\n parameterNames.add(CREATE_INTERFACE_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `create-${kebab(def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName)}${def.objectType === undefined ? \"\" : `-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`}`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(CREATE_INTERFACE_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(CREATE_INTERFACE_OBJECT_PARAMETER);\n }\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, propertyMap, parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required ?? true])));\n let sptMappings = {};\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => {\n if (sptNames.includes(id)) {\n sptMappings = {\n ...sptMappings,\n [id]: convertMappingValue(value)\n };\n }\n return [id, convertInterfacePropertyMappingValue(value)];\n }));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Create ${def.interfaceType.displayMetadata.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? (def.interfaceType.status.type !== \"deprecated\" ? def.interfaceType.status.type : def.interfaceType.status),\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n rules: [{\n type: \"addInterfaceRule\",\n addInterfaceRule: {\n interfaceApiName: def.interfaceType.apiName,\n objectTypeParameter: CREATE_INTERFACE_OBJECT_PARAMETER,\n sharedPropertyValues: {\n ...Object.fromEntries(sptNames.map(id => [id, {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id\n }])),\n ...sptMappings\n },\n interfacePropertyValues: {\n ...Object.fromEntries(actionInterfaceProperties.map(([id, _type]) => [id, {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id\n }\n }])),\n ...mappings\n }\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Array.from(parameterNames), parameters, CREATE_INTERFACE_OBJECT_PARAMETER),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, createDefaultParameterOrdering, createParameters, createPropertyParameterValues, createStructFieldValues, defineAction, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getProperty, getPropertyKeys, toPropertyMap } from \"./object/objectPropertyHelpers.js\";\nexport function defineCreateObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const propertyKeys = getPropertyKeys(def.objectType);\n validateActionParameters(def, propertyKeys, def.objectType.apiName);\n const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter(ds => ds.type === \"derived\").flatMap(ds => Object.keys(ds.propertyMapping));\n const propertyParameters = propertyKeys.filter(id => isPropertyParameter(def, id, getProperty(def.objectType, id)?.type) && !propertiesWithDerivedDatasources.includes(id));\n const parameterNames = new Set(propertyParameters);\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(param));\n const actionApiName = def.apiName ?? `create-object-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`;\n if (def.parameterOrdering) {\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, toPropertyMap(def.objectType), parameterNames);\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Create ${def.objectType.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? \"active\",\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n rules: [{\n type: \"addObjectRule\",\n addObjectRule: {\n objectTypeId: def.objectType.apiName,\n propertyValues: {\n ...createPropertyParameterValues(def, propertyParameters),\n ...mappings\n },\n structFieldValues: createStructFieldValues(def, parameters)\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, propertyKeys, parameters),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, CREATE_OR_MODIFY_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, createPropertyParameterValues, createStructFieldValues, defineAction, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getProperty, getPropertyKeys, toPropertyMap } from \"./object/objectPropertyHelpers.js\";\nimport { isStruct, isVector } from \"./properties/PropertyTypeType.js\";\nexport function defineCreateOrModifyObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const propertyKeys = getPropertyKeys(def.objectType);\n validateActionParameters(def, propertyKeys, def.objectType.apiName);\n const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter(ds => ds.type === \"derived\").flatMap(ds => Object.keys(ds.propertyMapping));\n const propertyParameters = propertyKeys.filter(id => !Object.keys(def.nonParameterMappings ?? {}).includes(id) && !def.excludedProperties?.includes(id) && !isVector(getProperty(def.objectType, id)?.type) && id !== def.objectType.primaryKeyPropertyApiName && !propertiesWithDerivedDatasources.includes(id));\n const parameterNames = new Set(propertyParameters);\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(param));\n parameterNames.add(CREATE_OR_MODIFY_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `create-or-modify-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(CREATE_OR_MODIFY_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(CREATE_OR_MODIFY_OBJECT_PARAMETER);\n }\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, toPropertyMap(def.objectType), parameterNames);\n parameters.forEach(p => {\n // create prefilled parameters for object type properties unless overridden\n const property = getProperty(def.objectType, p.id);\n if (property && !isStruct(property.type) && p.defaultValue === undefined) {\n p.defaultValue = {\n type: \"objectParameterPropertyValue\",\n objectParameterPropertyValue: {\n parameterId: CREATE_OR_MODIFY_OBJECT_PARAMETER,\n propertyTypeId: p.id\n }\n };\n }\n });\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Create or Modify ${def.objectType.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"addOrModifyObjectRuleV2\",\n addOrModifyObjectRuleV2: {\n objectToModify: CREATE_OR_MODIFY_OBJECT_PARAMETER,\n propertyValues: {\n ...createPropertyParameterValues(def, propertyParameters),\n ...mappings\n },\n structFieldValues: createStructFieldValues(def, parameters)\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, propertyKeys, parameters, CREATE_OR_MODIFY_OBJECT_PARAMETER),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, defineAction, kebab } from \"./defineAction.js\";\nimport { importedTypes, namespace, ontologyDefinition, withoutNamespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nexport function defineDeleteInterfaceLinkAction(defInput) {\n const def = cloneDefinition(defInput);\n const linkConstraint = typeof def.interfaceLink === \"string\" ? undefined : def.interfaceLink;\n !(linkConstraint === undefined || def.from === undefined || def.from.apiName === linkConstraint.from.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"from\" (\"${def.from?.apiName}\") does not match the interface (\"${linkConstraint?.from.apiName}\") that interface link constraint \"${linkConstraint?.apiName}\" was defined on. Omit \"from\" to use the constraint's own interface.`) : invariant(false) : void 0;\n const from = def.from ?? linkConstraint?.from;\n !(from !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"from\" is required when \"interfaceLink\" is provided as a string (the api name).`) : invariant(false) : void 0;\n const interfaceLinkApiName = typeof def.interfaceLink === \"string\" ? def.interfaceLink : def.interfaceLink.apiName;\n const linkApiName = combineApiNamespaceIfMissing(namespace, interfaceLinkApiName);\n const link = from.links.find(l => l.metadata.apiName === linkApiName);\n !(link !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link constraint \"${interfaceLinkApiName}\" not found on interface \"${from.apiName}\". Define it with defineInterfaceLinkConstraint first.`) : invariant(false) : void 0;\n !(link.linkedEntityTypeId.type === \"interfaceType\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link constraint \"${interfaceLinkApiName}\" on \"${from.apiName}\" does not link to an interface type.`) : invariant(false) : void 0;\n const targetApiName = link.linkedEntityTypeId.interfaceType;\n !(ontologyDefinition.INTERFACE_TYPE[targetApiName] !== undefined || importedTypes.INTERFACE_TYPE[targetApiName] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Target interface \"${targetApiName}\" of interface link constraint \"${interfaceLinkApiName}\" is not defined.`) : invariant(false) : void 0;\n const sourceId = def.sourceParameter?.id ?? \"source\";\n const targetId = def.targetParameter?.id ?? \"target\";\n !(sourceId !== targetId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"sourceParameter.id\" and \"targetParameter.id\" must differ, but both resolved to \"${sourceId}\".`) : invariant(false) : void 0;\n\n // A delete operates on a single existing link (one source, one target), so\n // both parameters are singular interface references regardless of the link's\n // cardinality.\n const sourceParam = {\n id: sourceId,\n displayName: def.sourceParameter?.displayName ?? from.displayMetadata.displayName,\n description: def.sourceParameter?.description,\n type: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: from.apiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n };\n const targetParam = {\n id: targetId,\n displayName: def.targetParameter?.displayName ?? withoutNamespace(targetApiName),\n description: def.targetParameter?.description,\n type: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: targetApiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n };\n const parameters = [sourceParam, targetParam];\n return defineAction({\n apiName: def.apiName ?? `delete-interface-link-${kebab(withoutNamespace(from.apiName))}-${kebab(withoutNamespace(interfaceLinkApiName))}`,\n displayName: def.displayName ?? `Delete ${from.displayMetadata.displayName} link`,\n description: def.description,\n status: def.status ?? \"active\",\n entities: {\n affectedInterfaceTypes: [from.apiName, targetApiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameters,\n rules: [{\n type: \"deleteInterfaceLinkRule\",\n deleteInterfaceLinkRule: {\n interfaceTypeRid: from.apiName,\n interfaceLinkTypeRid: linkApiName,\n sourceObject: sourceId,\n targetObject: targetId\n }\n }],\n parameterOrdering: [sourceId, targetId],\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(s => [s.id, s]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, defineAction, DELETE_OBJECT_PARAMETER, kebab } from \"./defineAction.js\";\nexport function defineDeleteInterfaceObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const parameters = [{\n id: DELETE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[DELETE_OBJECT_PARAMETER]?.displayName ?? \"Delete object\",\n description: def.parameterConfiguration?.[DELETE_OBJECT_PARAMETER]?.description,\n type: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n }];\n return defineAction({\n apiName: def.apiName ?? `delete-interface-object-${kebab(def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName)}`,\n displayName: def.displayName ?? `Delete ${def.interfaceType.displayMetadata.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: DELETE_OBJECT_PARAMETER\n }\n }],\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n ...(def.actionLevelValidation && {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, createParameters, defineAction, DELETE_OBJECT_PARAMETER, kebab } from \"./defineAction.js\";\nexport function defineDeleteObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n return defineAction({\n apiName: def.apiName ?? `delete-object-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`,\n displayName: def.displayName ?? `Delete ${def.objectType.displayName}`,\n description: def.description,\n parameters: createParameters(def, {}, new Set([DELETE_OBJECT_PARAMETER])),\n status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: DELETE_OBJECT_PARAMETER\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation)\n } : {}),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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\nexport function mapSimplifiedStatusToInterfaceTypeStatus(status) {\n switch (status.type) {\n case \"deprecated\":\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined\n }\n };\n case \"active\":\n return {\n type: \"active\",\n active: {}\n };\n case \"experimental\":\n return {\n type: \"experimental\",\n experimental: {}\n };\n case \"example\":\n return {\n type: \"example\",\n example: {}\n };\n default:\n throw new Error(`Invalid status type: ${status.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\n/**\n * The instruction with every property it references renamed by `rename`.\n */\nexport function mapPropertyNames(instruction, rename) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n return {\n type: \"addRequiredProperty\",\n property: rename(instruction.property)\n };\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.type}`);\n }\n}\n\n/** How each instruction variant is worded in messages to users. */\nfunction proseFor(instruction) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n {\n const {\n property: propertyApiName\n } = instruction;\n return {\n describe: `addRequiredProperty(\"${propertyApiName}\")`,\n finalization: `set \"${propertyApiName}\" to \\`required: true\\``,\n suggestedTransition: `{ id: \"require-${propertyApiName}\", title: \"Require ${propertyApiName}\", ` + `gracePeriod: { type: \"afterInstall\", days: 30 }, ` + `instructions: [{ type: \"addRequiredProperty\", property: \"${propertyApiName}\" }] }`\n };\n }\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.type}`);\n }\n}\nexport function describeInstruction(instruction) {\n return proseFor(instruction).describe;\n}\nexport function describeFinalization(instruction) {\n return proseFor(instruction).finalization;\n}\nexport function describeSuggestedTransition(instruction) {\n return proseFor(instruction).suggestedTransition;\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 invariant from \"tiny-invariant\";\nimport { describeInstruction } from \"./describeInterfaceSchemaMigrationInstruction.js\";\nimport { isInterfacePropertyRequired } from \"./InterfacePropertyType.js\";\n// Constants enforced by OMS at installation-time.\nconst MAX_TRANSITIONS = 20;\nconst MAX_INSTRUCTIONS = 500;\nconst MAX_ID_LENGTH = 150;\nconst ID_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/u;\nconst MAX_TITLE_LENGTH = 500;\nconst MAX_DESCRIPTION_LENGTH = 2000;\nconst MIN_GRACE_PERIOD_DAYS = 7;\nconst MAX_GRACE_PERIOD_DAYS = 180;\n\n/**\n * Structural validation for authored Interface Type Schema Migrations.\n */\nexport function validateInterfaceSchemaMigrations(interfaceApiName, schemaMigrations,\n// The interface type's locally-defined properties; inherited properties are not included\n// (since migrations for those should occur in the interface that defines them)\npropertiesV3) {\n const {\n transitions\n } = schemaMigrations;\n !(transitions.length <= MAX_TRANSITIONS) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface ${interfaceApiName} has ${transitions.length} schema migration transitions, which exceeds the maximum of ${MAX_TRANSITIONS}.`) : invariant(false) : void 0;\n const seenIds = new Set();\n // Which transition owns a claim, to prevent conflicting migrations.\n const claimedBy = new Map();\n for (const transition of transitions) {\n const {\n id,\n title,\n description,\n gracePeriod,\n instructions\n } = transition;\n !(id.length > 0 && id.length <= MAX_ID_LENGTH) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition id \"${id}\" on interface ${interfaceApiName} must be between 1 and ${MAX_ID_LENGTH} characters, but was ${id.length}.`) : invariant(false) : void 0;\n !ID_PATTERN.test(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition id \"${id}\" on interface ${interfaceApiName} must match ${ID_PATTERN.source}: a letter or digit followed by letters, digits, underscores, or dashes.`) : invariant(false) : void 0;\n !!seenIds.has(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Duplicate schema migration transition id \"${id}\" on interface ${interfaceApiName}.`) : invariant(false) : void 0;\n seenIds.add(id);\n !(title.length > 0 && title.length <= MAX_TITLE_LENGTH) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} must have a title between 1 and ${MAX_TITLE_LENGTH} characters, but was ${title.length}.`) : invariant(false) : void 0;\n if (description !== undefined) {\n !(description.length <= MAX_DESCRIPTION_LENGTH) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} has a description of length ${description.length}, which exceeds the maximum of ${MAX_DESCRIPTION_LENGTH}.`) : invariant(false) : void 0;\n }\n !(instructions.length > 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} must have at least one instruction.`) : invariant(false) : void 0;\n !(instructions.length <= MAX_INSTRUCTIONS) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} has ${instructions.length} instructions, which exceeds the maximum of ${MAX_INSTRUCTIONS}.`) : invariant(false) : void 0;\n validateGracePeriod(interfaceApiName, id, gracePeriod);\n for (const instruction of instructions) {\n const instructionDescription = describeInstruction(instruction);\n for (const claim of getClaims(instruction)) {\n const conflict = claimedBy.get(claim);\n !(conflict === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} declares ${instructionDescription}, which conflicts with ${conflict?.description} already declared by transition \"${conflict?.transitionId}\". A property may be migrated by at most one in-flight transition.`) : invariant(false) : void 0;\n claimedBy.set(claim, {\n transitionId: id,\n description: instructionDescription\n });\n }\n validateInstruction(interfaceApiName, id, instruction, propertiesV3);\n }\n }\n}\nexport function isCanonicalIsoUtcDatetime(value) {\n const asIsoString = Number.isNaN(Date.parse(value)) ? undefined : new Date(value).toISOString();\n return asIsoString !== undefined && (\n // Ensures the declared deadline is actually an ISO string, rather than a bare date-only string\n // (so we don't have to pick whether a bare date means \"done by this day\" or \"done at the end\n // of this day\")\n value === asIsoString || value === asIsoString.replace(/\\.000Z$/u, \"Z\"));\n}\nfunction validateGracePeriod(apiName, transitionId, gracePeriod) {\n switch (gracePeriod.type) {\n case \"afterInstall\":\n {\n const {\n days\n } = gracePeriod;\n !(Number.isInteger(days) && days >= MIN_GRACE_PERIOD_DAYS && days <= MAX_GRACE_PERIOD_DAYS) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${transitionId}\" on interface ${apiName} has an 'afterInstall' grace period of ${days} days, but days must be an integer in [${MIN_GRACE_PERIOD_DAYS}, ${MAX_GRACE_PERIOD_DAYS}] (inclusive).`) : invariant(false) : void 0;\n return;\n }\n case \"deadline\":\n {\n const {\n deadline\n } = gracePeriod;\n !isCanonicalIsoUtcDatetime(deadline) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${transitionId}\" on interface ${apiName} has a 'deadline' grace period of \"${deadline}\", which is not a canonical ISO-8601 UTC datetime (e.g. \"2026-01-31T00:00:00Z\").`) : invariant(false) : void 0;\n return;\n }\n default:\n {\n const unhandled = gracePeriod;\n throw new Error(`Unknown schema migration grace period type: ${unhandled.type}`);\n }\n }\n}\nfunction validateInstruction(interfaceApiName, transitionId, instruction, propertiesV3) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n {\n const {\n property: propertyApiName\n } = instruction;\n !Object.hasOwn(propertiesV3, propertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${transitionId}\" on interface ${interfaceApiName} references property \"${propertyApiName}\" via ${instruction.type}, but interface ${interfaceApiName} does not declare that property. Properties inherited from an extended interface must be migrated by a transition on the interface that declares them.`) : invariant(false) : void 0;\n !!isInterfacePropertyRequired(propertiesV3[propertyApiName]) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${transitionId}\" on interface ${interfaceApiName} targets property \"${propertyApiName}\" via ${instruction.type}, but that property is required. Only properties declared required: false may be targeted.`) : invariant(false) : void 0;\n return;\n }\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.type}`);\n }\n}\n\n/**\n * What an instruction claims exclusive use of for the duration of its transition.\n *\n * Stacked migrations (i.e. those which operate against the same property, etc.) are not allowed today,\n * so we reject any conflicting migrations that try to claim the same thing,\n */\nfunction getClaims(instruction) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n return [`property:${instruction.property}`];\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.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 invariant from \"tiny-invariant\";\n/**\n * Interface schema migrations are opted into by a whole family of interfaces, not by one interface\n * at a time: an object type implementing an interface has to implement everything that interface\n * inherits too, so the inherited half of its schema needs the same backwards-compatibility\n * guarantees as the locally-declared half.\n */\nexport function validateSchemaMigrationsFamilyOptIn(interfaceApiName, optedIn, parents) {\n for (const parent of parents) {\n const parentOptedIn = parent.schemaMigrations !== undefined;\n !(parentOptedIn === optedIn) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${optedIn ? `Interface ${interfaceApiName} declares \\`schemaMigrations\\`, but the interface it extends, ${parent.apiName}, does not.` : `Interface ${interfaceApiName} extends ${parent.apiName}, which declares \\`schemaMigrations\\`, but ${interfaceApiName} does not.`} Interface schema migrations must be enabled for an entire interface hierarchy, since an object type implementing ${interfaceApiName} must implement the properties it inherits from ${parent.apiName} too. Add \\`schemaMigrations\\` to ${optedIn ? parent.apiName : interfaceApiName}, or remove it from ${optedIn ? interfaceApiName : parent.apiName}.`) : invariant(false) : void 0;\n }\n}","/*\n * Copyright 2024 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 { API_NAME_PATTERN, isValidApiName, isValidNamespacedApiName, NAMESPACED_API_NAME_PATTERN } from \"../util/ApiNameValidator.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { namespace, ontologyDefinition, updateOntology, withoutNamespace } from \"./defineOntology.js\";\nimport { isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nimport { mapSimplifiedStatusToInterfaceTypeStatus } from \"./interface/mapSimplifiedStatusToInterfaceTypeStatus.js\";\nimport { validateInterfaceSchemaMigrations } from \"./interface/validateInterfaceSchemaMigrations.js\";\nimport { validateSchemaMigrationsFamilyOptIn } from \"./interface/validateSchemaMigrationsFamilyOptIn.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nimport { isExotic, isPropertyTypeType } from \"./properties/PropertyTypeType.js\";\nimport { validateDisplayMetadataLengths, validateStructFieldMetadata } from \"./validateMetadataLengths.js\";\nexport function defineInterface(interfaceDefInput) {\n const interfaceDef = cloneDefinition(interfaceDefInput);\n const apiName = namespace + interfaceDef.apiName;\n !(ontologyDefinition[OntologyEntityTypeEnum.INTERFACE_TYPE][apiName] === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface ${apiName} already exists`) : invariant(false) : void 0;\n !isValidNamespacedApiName(interfaceDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${interfaceDef.apiName}. API names must match the regex ${NAMESPACED_API_NAME_PATTERN}.`) : invariant(false) : void 0;\n\n // legacy support for propertiesV2 (only SPTs)\n const spts = Object.fromEntries(Object.entries(interfaceDef.properties ?? {}).filter(([_name, prop]) => {\n return isInterfaceSharedPropertyType(prop) || \"apiName\" in prop;\n }).map(([s, spt]) => {\n const required = isInterfaceSharedPropertyType(spt) ? spt.required : true;\n return [s, {\n sharedPropertyType: isInterfaceSharedPropertyType(spt) ? spt.sharedPropertyType : spt,\n required\n }];\n }));\n const propertiesV2 = Object.fromEntries(Object.entries(spts).map(([propName, type]) => {\n const sptApiName = combineApiNamespaceIfMissing(namespace, type.sharedPropertyType.apiName);\n return [sptApiName, {\n required: type.required,\n sharedPropertyType: verifyBasePropertyDefinition(namespace, propName, type.sharedPropertyType)\n }];\n }));\n const propertiesV3 = Object.fromEntries(Object.entries(interfaceDef.properties ?? {}).map(([apiName, prop]) => {\n !isValidApiName(apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${apiName} for property on interface ${interfaceDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`) : invariant(false) : void 0;\n const required = typeof prop === \"object\" && isInterfaceSharedPropertyType(prop) ? prop.required : true;\n const propertyBase = typeof prop === \"object\" && isInterfaceSharedPropertyType(prop) ? prop.sharedPropertyType : prop;\n if (typeof propertyBase === \"object\" && \"nonNameSpacedApiName\" in propertyBase) {\n // SPT\n return [apiName, {\n required,\n sharedPropertyType: propertyBase\n }];\n } else {\n // IDP\n return [apiName, propertyBase];\n }\n }));\n const extendsInterfaces = interfaceDef.extends ? Array.isArray(interfaceDef.extends) ? interfaceDef.extends : [interfaceDef.extends] : [];\n const status = mapSimplifiedStatusToInterfaceTypeStatus(interfaceDef.status ?? {\n type: \"active\"\n });\n !(status.type !== \"deprecated\" || status.deprecated.message && status.deprecated.deadline) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Deprecated status must include message and deadline properties.`) : invariant(false) : void 0;\n const fullInterface = {\n apiName,\n displayMetadata: {\n displayName: interfaceDef.displayName ?? interfaceDef.apiName,\n description: interfaceDef.description ?? interfaceDef.displayName ?? interfaceDef.apiName,\n icon: interfaceDef.icon !== undefined ? {\n type: \"blueprint\",\n blueprint: {\n color: interfaceDef.icon.color,\n locator: interfaceDef.icon.locator\n }\n } : undefined\n },\n extendsInterfaces,\n linkedInterfaces: [],\n links: [],\n actionTypeConstraints: [],\n status,\n propertiesV2,\n propertiesV3,\n permission: interfaceDef.permission,\n searchable: interfaceDef.searchable ?? true,\n schemaMigrations: interfaceDef.schemaMigrations !== undefined ? structuredClone(interfaceDef.schemaMigrations) : undefined,\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE\n };\n const context = `Interface \"${apiName}\"`;\n validateDisplayMetadataLengths(fullInterface.displayMetadata, context);\n for (const [propertyApiName, property] of Object.entries(propertiesV3)) {\n if (isInterfaceSharedPropertyType(property)) {\n continue;\n }\n const propertyContext = `${context}, property \"${propertyApiName}\"`;\n validateDisplayMetadataLengths({\n ...property,\n displayName: property.displayName ?? propertyApiName\n }, propertyContext);\n validateStructFieldMetadata(property.type, propertyContext);\n }\n if (interfaceDef.schemaMigrations !== undefined) {\n validateInterfaceSchemaMigrations(apiName, interfaceDef.schemaMigrations, propertiesV3);\n }\n validateSchemaMigrationsFamilyOptIn(apiName, interfaceDef.schemaMigrations !== undefined, extendsInterfaces.flatMap(parent => ontologyDefinition[OntologyEntityTypeEnum.INTERFACE_TYPE][parent.apiName] ?? []));\n updateOntology(fullInterface);\n return fullInterface;\n}\nfunction verifyBasePropertyDefinition(namespace, apiName, type) {\n const unNamespacedTypeApiName = withoutNamespace(type.apiName);\n !(isPropertyTypeType(type.type) || isExotic(type.type)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid data type ${JSON.stringify(type)} for property ${apiName} on InterfaceType ${apiName}`) : invariant(false) : void 0;\n !(namespace + apiName === type.apiName || apiName === unNamespacedTypeApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `property key and it's apiName must be identical. ${JSON.stringify({\n key: apiName,\n apiName: type.apiName\n })}`) : invariant(false) : void 0;\n 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 invariant from \"tiny-invariant\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { importedTypes, namespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nexport function defineInterfaceActionTypeConstraint(input) {\n const def = cloneDefinition(input);\n !(importedTypes[OntologyEntityTypeEnum.INTERFACE_TYPE][def.interfaceType.apiName] == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot define an action type constraint on imported interface ${def.interfaceType.apiName}. The interface must be locally defined.`) : invariant(false) : void 0;\n const apiNameWithNamespace = combineApiNamespaceIfMissing(namespace, def.apiName);\n !(def.interfaceType.actionTypeConstraints.find(a => a.metadata.apiName === apiNameWithNamespace) == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action type constraint with apiName ${apiNameWithNamespace} already exists on interface ${def.interfaceType.apiName}`) : invariant(false) : void 0;\n const parameters = {};\n const seenParamApiNames = new Set();\n for (const param of def.parameters) {\n !!seenParamApiNames.has(param.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Duplicate parameter constraint apiName \"${param.apiName}\" in action type constraint ${apiNameWithNamespace}`) : invariant(false) : void 0;\n seenParamApiNames.add(param.apiName);\n parameters[param.apiName] = {\n displayMetadata: {\n displayName: param.displayName,\n apiName: param.apiName\n },\n type: param.type,\n requireImplementation: param.requireImplementation\n };\n }\n def.interfaceType.actionTypeConstraints.push({\n metadata: {\n apiName: apiNameWithNamespace,\n displayName: def.displayName,\n description: def.description\n },\n parameters,\n requireImplementation: def.requireImplementation\n });\n}","/*\n * Copyright 2024 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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { importedTypes, namespace, withoutNamespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nimport { validateDisplayMetadataLengths } from \"./validateMetadataLengths.js\";\nexport function defineInterfaceLinkConstraint(linkDefInput) {\n const linkDef = cloneDefinition(linkDefInput);\n !(importedTypes[OntologyEntityTypeEnum.INTERFACE_TYPE][linkDef.from.apiName] == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot define a link constraint from imported interface ${linkDef.from.apiName}. The \"from\" side must be a locally defined interface.`) : invariant(false) : void 0;\n const fromLinkMeta = getLinkMeta(linkDef);\n validateDisplayMetadataLengths(fromLinkMeta, `Interface \"${linkDef.from.apiName}\", link \"${fromLinkMeta.apiName}\"`);\n !(linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName) == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`) : invariant(false) : void 0;\n const cardinality = linkDef.toMany ? \"MANY\" : \"SINGLE\";\n const to = linkDef.toMany ?? linkDef.toOne;\n linkDef.from.links.push({\n cardinality,\n linkedEntityTypeId: getLinkedType(to),\n metadata: fromLinkMeta,\n required: linkDef.required ?? true\n });\n linkDef.from.linkedInterfaces?.push(to);\n return {\n apiName: fromLinkMeta.apiName,\n from: linkDef.from,\n to,\n cardinality\n };\n}\nfunction getLinkedType(t) {\n return {\n type: \"interfaceType\",\n interfaceType: typeof t === \"string\" ? t : t.apiName\n };\n}\nfunction getLinkMeta(meta) {\n const {\n apiName,\n displayName,\n description\n } = meta;\n const apiNameWithNamespace = combineApiNamespaceIfMissing(namespace, apiName);\n const apiNameWithoutNamespace = withoutNamespace(apiNameWithNamespace);\n return {\n apiName: apiNameWithNamespace,\n displayName: displayName ?? apiNameWithoutNamespace,\n description: description ?? displayName ?? apiNameWithoutNamespace\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 { isValidApiName } from \"../util/ApiNameValidator.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { convertToPluralDisplayName, uppercaseFirstLetter } from \"./defineObject.js\";\nimport { ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { validateDisplayMetadataLengths } from \"./validateMetadataLengths.js\";\nexport function defineLink(linkDefinitionInput) {\n const linkDefinition = cloneDefinition(linkDefinitionInput);\n if (ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE][linkDefinition.apiName] !== undefined) {\n throw new Error(`Link type with apiName ${linkDefinition.apiName} is already defined`);\n }\n // Validation involving linked objects is deferred to convertLink.ts because\n // circular dependencies can reference objects that have not been defined yet.\n\n let fullLinkDefinition;\n if (\"one\" in linkDefinition) {\n fullLinkDefinition = {\n ...linkDefinition,\n one: convertUserOneToManyLinkDefinition(linkDefinition.one),\n toMany: convertUserOneToManyLinkDefinition(linkDefinition.toMany)\n };\n } else if (\"intermediaryObjectType\" in linkDefinition) {\n fullLinkDefinition = {\n ...linkDefinition,\n many: convertUserIntermediaryLinkDefinition(linkDefinition.many),\n toMany: convertUserIntermediaryLinkDefinition(linkDefinition.toMany)\n };\n } else {\n fullLinkDefinition = {\n ...linkDefinition,\n many: convertUserManyToManyLinkDefinition(linkDefinition.many),\n toMany: convertUserManyToManyLinkDefinition(linkDefinition.toMany)\n };\n }\n const linkType = {\n cardinality: \"one\" in linkDefinition ? linkDefinition.cardinality : undefined,\n ...fullLinkDefinition,\n apiName: linkDefinition.apiName,\n __type: OntologyEntityTypeEnum.LINK_TYPE\n };\n const sides = \"one\" in linkType ? {\n one: linkType.one,\n toMany: linkType.toMany\n } : {\n many: linkType.many,\n toMany: linkType.toMany\n };\n for (const [side, link] of Object.entries(sides)) {\n validateDisplayMetadataLengths(link.metadata.displayMetadata, `Link type \"${linkType.apiName}\", ${side} \"${link.metadata.apiName}\"`);\n }\n updateOntology(linkType);\n return linkType;\n}\nfunction convertUserOneToManyLinkDefinition(oneToMany) {\n return {\n ...oneToMany,\n metadata: convertLinkTypeMetadata(oneToMany.metadata)\n };\n}\nfunction convertUserManyToManyLinkDefinition(manyToMany) {\n return {\n ...manyToMany,\n metadata: convertLinkTypeMetadata(manyToMany.metadata)\n };\n}\nfunction convertUserIntermediaryLinkDefinition(intermediary) {\n return {\n ...intermediary,\n metadata: convertLinkTypeMetadata(intermediary.metadata)\n };\n}\nfunction convertLinkTypeMetadata(metadata) {\n !isValidApiName(metadata.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name for link: ${metadata.apiName}`) : invariant(false) : void 0;\n return {\n apiName: metadata.apiName,\n displayMetadata: {\n displayName: metadata.displayName ?? uppercaseFirstLetter(metadata.apiName),\n pluralDisplayName: metadata.pluralDisplayName ?? convertToPluralDisplayName(metadata.apiName),\n visibility: metadata.visibility ?? \"NORMAL\",\n groupDisplayName: metadata.groupDisplayName ?? \"\"\n },\n typeClasses: metadata.typeClasses ?? []\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 { convertInterfacePropertyMappingValue, convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, getNonNamespacedParameterName, isPropertyParameter, kebab, MODIFY_INTERFACE_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { getInterfacePropertyTypeType, isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nexport function defineModifyInterfaceObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);\n const actionInterfaceProperties = Object.entries(allProperties).filter(([apiName, type]) => {\n return isPropertyParameter(def, apiName, getInterfacePropertyTypeType(type));\n });\n const sptNames = actionInterfaceProperties.filter(([_apiName, type]) => isInterfaceSharedPropertyType(type)).map(([apiName]) => apiName);\n const parameterNames = new Set(actionInterfaceProperties.map(([apiName, _type]) => getInterfaceParameterName(def, apiName)));\n const propertyMap = Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [getInterfaceParameterName(def, id), prop]));\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(getInterfaceParameterName(def, param)));\n parameterNames.add(MODIFY_INTERFACE_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `modify-${kebab(def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName)}${def.objectType === undefined ? \"\" : `-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`}`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(MODIFY_INTERFACE_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(MODIFY_INTERFACE_OBJECT_PARAMETER);\n }\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, propertyMap, parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required ?? true])));\n let sptMappings = {};\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => {\n if (sptNames.includes(id)) {\n sptMappings = {\n ...sptMappings,\n [id]: convertMappingValue(value)\n };\n }\n return [id, convertInterfacePropertyMappingValue(value)];\n }));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Modify ${def.interfaceType.displayMetadata.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? (def.interfaceType.status.type !== \"deprecated\" ? def.interfaceType.status.type : def.interfaceType.status),\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n rules: [{\n type: \"modifyInterfaceRule\",\n modifyInterfaceRule: {\n interfaceApiName: def.interfaceType.apiName,\n interfaceObjectToModifyParameter: \"interfaceObjectToModifyParameter\",\n sharedPropertyValues: {\n ...Object.fromEntries(sptNames.map(id => [id, {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id\n }])),\n ...sptMappings\n },\n interfacePropertyValues: {\n ...Object.fromEntries(actionInterfaceProperties.map(([id, _type]) => [id, {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id\n }\n }])),\n ...mappings\n }\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Array.from(parameterNames), parameters, MODIFY_INTERFACE_OBJECT_PARAMETER),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, createDefaultParameterOrdering, createParameters, createPropertyParameterValues, createStructFieldValues, defineAction, isPropertyParameter, kebab, MODIFY_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getProperty, getPropertyKeys, toPropertyMap } from \"./object/objectPropertyHelpers.js\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\nexport function defineModifyObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const propertyKeys = getPropertyKeys(def.objectType);\n validateActionParameters(def, propertyKeys, def.objectType.apiName);\n const propertyParameters = propertyKeys.filter(id => isPropertyParameter(def, id, getProperty(def.objectType, id)?.type) && id !== def.objectType.primaryKeyPropertyApiName);\n const parameterNames = new Set(propertyParameters);\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(param));\n parameterNames.add(MODIFY_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `modify-object-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(MODIFY_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(MODIFY_OBJECT_PARAMETER);\n }\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, toPropertyMap(def.objectType), parameterNames);\n parameters.forEach(p => {\n // create prefilled parameters for object type properties unless overridden\n const property = getProperty(def.objectType, p.id);\n if (property && !isStruct(property.type) && p.defaultValue === undefined) {\n p.defaultValue = {\n type: \"objectParameterPropertyValue\",\n objectParameterPropertyValue: {\n parameterId: MODIFY_OBJECT_PARAMETER,\n propertyTypeId: p.id\n }\n };\n }\n });\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Modify ${def.objectType.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"modifyObjectRule\",\n modifyObjectRule: {\n objectToModify: MODIFY_OBJECT_PARAMETER,\n propertyValues: {\n ...createPropertyParameterValues(def, propertyParameters),\n ...mappings\n },\n structFieldValues: createStructFieldValues(def, parameters)\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, propertyKeys, parameters, MODIFY_OBJECT_PARAMETER),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\n })\n });\n}","/*\n * Copyright 2024 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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldNotHaveRenderHints } from \"./propertyConversionUtils.js\";\nimport { validateDisplayMetadataLengths, validateStructFieldMetadata } from \"./validateMetadataLengths.js\";\nexport function defineSharedPropertyType(sptDefInput) {\n const sptDef = cloneDefinition(sptDefInput);\n const apiName = namespace + sptDef.apiName;\n !(ontologyDefinition[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE][apiName] === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${apiName} already exists`) : invariant(false) : void 0;\n !(!shouldNotHaveRenderHints(sptDef.type) || !hasRenderHints(sptDef.typeClasses)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${apiName} of type '${getPropertyTypeName(sptDef.type)}' should not have render hints`) : invariant(false) : void 0;\n const fullSpt = {\n ...sptDef,\n apiName,\n nonNameSpacedApiName: sptDef.apiName,\n displayName: sptDef.displayName ?? sptDef.apiName,\n // This way the non-namespaced api name is the display name (maybe not ideal)\n typeClasses: sptDef.typeClasses ?? (shouldNotHaveRenderHints(sptDef.type) ? [] : defaultTypeClasses),\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE\n };\n const context = `Shared property type \"${apiName}\"`;\n validateDisplayMetadataLengths(fullSpt, context);\n validateStructFieldMetadata(fullSpt.type, context);\n updateOntology(fullSpt);\n return fullSpt;\n}","/*\n * Copyright 2024 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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { validateMetadataLength, VALUE_TYPE_DESCRIPTION_LIMIT, VALUE_TYPE_DISPLAY_NAME_LIMIT } from \"./validateMetadataLengths.js\";\nfunction convertValueTypeTypeToBaseType(valueType) {\n if (typeof valueType === \"string\") {}\n switch (true) {\n case typeof valueType === \"object\" && valueType.type === \"array\":\n return {\n type: \"array\",\n array: {\n elementType: convertValueTypeTypeToBaseType(valueType.elementType)\n }\n };\n case typeof valueType === \"object\" && valueType.type === \"struct\":\n return {\n type: \"structV2\",\n structV2: {\n fields: valueType.fields.map(field => ({\n identifier: field.identifier,\n baseType: convertValueTypeTypeToBaseType(field.baseType)\n }))\n }\n };\n case typeof valueType === \"object\" && valueType.type === \"map\":\n return {\n type: \"map\",\n map: {\n keyType: convertValueTypeTypeToBaseType(valueType.keyType),\n valueType: convertValueTypeTypeToBaseType(valueType.valueType)\n }\n };\n case typeof valueType === \"object\" && valueType.type === \"optional\":\n return {\n type: \"optional\",\n optional: {\n wrappedType: convertValueTypeTypeToBaseType(valueType.wrappedType)\n }\n };\n case typeof valueType === \"string\":\n return {\n type: valueType,\n [valueType]: {}\n };\n default:\n throw new Error(\"Invalid ValueTypeType\");\n }\n}\nexport function defineValueType(valueTypeDefInput) {\n const valueTypeDef = cloneDefinition(valueTypeDefInput);\n const {\n apiName: inputApiName,\n displayName,\n description,\n type,\n version,\n namespacePrefix\n } = valueTypeDef;\n const apiName = namespacePrefix ? namespace + inputApiName : inputApiName;\n const semverValidation = /^((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)$/u;\n !semverValidation.test(version) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Version is not a valid semver\") : invariant(false) : void 0;\n const existingVersions = ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][apiName] ?? [];\n const duplicateVersion = existingVersions.find(vt => vt.version === version);\n !(duplicateVersion === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Value type with apiName ${apiName} and version ${version} is already defined`) : invariant(false) : void 0;\n const typeName = typeof type.type === \"string\" ? type.type : type.type.type === \"struct\" ? \"structV2\" : type.type.type;\n // These suck but TS doesn't understand the relationship from the key of the base type to the type string\n const constraints = type.constraints ? type.constraints.map(constraint => {\n const output = {\n constraint: {\n type: typeName,\n [typeName]: constraint.constraint\n },\n failureMessage: constraint.failureMessage\n };\n return {\n constraint: output\n };\n }) : [];\n const baseType = convertValueTypeTypeToBaseType(type.type);\n const vt = {\n apiName,\n packageNamespace: namespace.substring(0, namespace.length - 1),\n displayMetadata: {\n displayName: displayName,\n description: description ?? \"\"\n },\n status: convertUserValueTypeStatusToValueTypeStatus(valueTypeDef.status),\n version: version,\n baseType: baseType,\n constraints: constraints,\n exampleValues: [],\n __type: OntologyEntityTypeEnum.VALUE_TYPE\n };\n const context = `Value type \"${apiName}\" version \"${version}\"`;\n validateMetadataLength(vt.displayMetadata.displayName, \"displayName\", context, VALUE_TYPE_DISPLAY_NAME_LIMIT, \"UTF-16 code units\");\n validateMetadataLength(vt.displayMetadata.description, \"description\", context, VALUE_TYPE_DESCRIPTION_LIMIT, \"UTF-16 code units\");\n updateOntology(vt);\n return vt;\n}\nexport function convertUserValueTypeStatusToValueTypeStatus(status) {\n if (typeof status === \"object\" && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: status.replacedBy\n }\n };\n }\n return {\n type: \"active\",\n active: {}\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 { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { importedTypes } from \"./defineOntology.js\";\nexport function importOntologyEntity(e) {\n if (e.__type !== OntologyEntityTypeEnum.VALUE_TYPE) {\n importedTypes[e.__type][e.apiName] = e;\n if (e.__type === OntologyEntityTypeEnum.OBJECT_TYPE) {\n const objectType = importedTypes.OBJECT_TYPE[e.apiName];\n for (const property of objectType.properties ?? []) {\n const sharedPropertyType = property.sharedPropertyType;\n if (sharedPropertyType !== undefined && !Object.hasOwn(importedTypes.SHARED_PROPERTY_TYPE, sharedPropertyType.apiName)) {\n importedTypes.SHARED_PROPERTY_TYPE[sharedPropertyType.apiName] = sharedPropertyType;\n }\n }\n }\n return;\n }\n // value types are a special case\n if (importedTypes[OntologyEntityTypeEnum.VALUE_TYPE][e.apiName] === undefined) {\n importedTypes[OntologyEntityTypeEnum.VALUE_TYPE][e.apiName] = [];\n }\n importedTypes[OntologyEntityTypeEnum.VALUE_TYPE][e.apiName].push(e);\n}","/*\n * Copyright 2024 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 { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { importOntologyEntity } from \"./importOntologyEntity.js\";\n/**\n * Defines a foreign shared property type you want to take as an input to your product. The typeHint field is used for OSDK generation\n */\nexport function importSharedPropertyType(opts) {\n const {\n apiName,\n packageName,\n typeHint,\n array\n } = opts;\n const fullApiName = packageName === undefined ? apiName : `${packageName}.${apiName}`;\n if (packageName !== undefined) {\n !!packageName.endsWith(\".\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Package name format invalid ends with period\") : invariant(false) : void 0;\n !(packageName.match(\"[A-Z]\") == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Package name includes upper case characters\") : invariant(false) : void 0;\n }\n const spt = {\n apiName: fullApiName,\n type: typeHint,\n nonNameSpacedApiName: apiName,\n array: array ?? false,\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE\n };\n importOntologyEntity(spt);\n return spt;\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 { importOntologyEntity } from \"./importOntologyEntity.js\";\n\n/**\n * Wraps an OntologyEntityType with a Proxy that calls importOntologyEntity when properties are accessed.\n *\n * @param entity - The OntologyEntityType to wrap with a Proxy\n * @returns A Proxy that imports the entity when properties are accessed\n */\nexport function wrapWithProxy(entity) {\n return new Proxy(entity, {\n get(target, prop, receiver) {\n importOntologyEntity(target);\n return Reflect.get(target, prop, receiver);\n }\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 { isDeepStrictEqual } from \"node:util\";\nimport { withoutNamespace } from \"../api/defineOntology.js\";\nexport const ONTOLOGY_SCHEMA_LOCKFILE_VERSION = 1;\nexport const DEFAULT_ONTOLOGY_SCHEMA_LOCKFILE_NAME = \"ontology-schema-lock.json\";\n\n/**\n * A record of the last-published shape of every interface type enrolled in schema migrations.\n *\n * `@osdk/maker` is a stateless `ontology.ts -> ontology.json` transformer, so it has nothing to\n * diff a new definition against to run backwards-compatibility checks. This lockfile supplies\n * that baseline (as a checked in source file), letting us reject at authoring-time any\n * definitions that would otherwise be rejected at installation-time.\n */\n\n/** Where a property's definition comes from. */\n\nexport function declarationOf(property) {\n return property.declaredBy ?? \"interface\";\n}\nexport function extensionsOf(schema) {\n return schema.extendsInterfaces ?? [];\n}\nexport function primaryKeyConstraintOf(property) {\n return property.primaryKeyConstraint ?? \"NO_RESTRICTION\";\n}\nexport const UNCONSTRAINED_NULLABILITY = {\n noNulls: false,\n noEmptyCollections: false\n};\nexport function nullabilityOf(property) {\n return property.nullability ?? UNCONSTRAINED_NULLABILITY;\n}\n\n/** Whether `next` obliges implementing object types to satisfy something `previous` did not. */\nexport function tightensNullability(previous, next) {\n return !previous.noNulls && next.noNulls || !previous.noEmptyCollections && next.noEmptyCollections;\n}\n\n/**\n * The key the author wrote for a property, given the api name the lockfile records it under.\n */\nexport function authoredKeyOf(wireApiName) {\n return withoutNamespace(wireApiName);\n}\n\n/**\n * `record`'s own value for `key`, or `undefined`.\n *\n * Every record in a lockfile is keyed by an author-chosen api name, and `API_NAME_PATTERN` admits\n * `constructor`, `toString` and friends. A persisted lockfile also arrives from `JSON.parse`, so\n * its records inherit from `Object.prototype`. A bare index read for one of those names would find\n * the inherited function instead of `undefined` and mistake it for a recorded entry.\n */\nexport function own(record, key) {\n return Object.hasOwn(record, key) ? record[key] : undefined;\n}\nexport function isEmptyLockfile(lockfile) {\n return lockedInterfaceCount(lockfile) === 0;\n}\n\n/** How many interfaces the lockfile tracks. */\nexport function lockedInterfaceCount(lockfile) {\n return Object.keys(lockfile.interfaces).length;\n}\n\n/** The api names of every locked interface whose recorded shape no longer matches the source. */\nexport function staleInterfaces(previousLockfile, nextLockfile) {\n const previous = new Map(Object.entries(previousLockfile.interfaces));\n const next = new Map(Object.entries(nextLockfile.interfaces));\n const apiNames = [...new Set([...previous.keys(), ...next.keys()])].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);\n return apiNames.filter(apiName => !isDeepStrictEqual(previous.get(apiName), next.get(apiName)));\n}\n\n// JSON has no comment syntax, but a `\"//\"` key is a conventional stand-in for one.\nexport const LOCKFILE_HEADER_KEY = \"//\";\nconst LOCKFILE_HEADER = [\"This is a generated file, do not modify manually.\", \"Run `maker --write-locks` to regenerate this file.\"];\nexport function serializeLockfile(lockfile) {\n // Insertion order is preserved for non-index keys, so the header serializes first.\n const withHeader = {\n [LOCKFILE_HEADER_KEY]: LOCKFILE_HEADER,\n ...lockfile\n };\n return JSON.stringify(withHeader, undefined, 2) + \"\\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\n/**\n * Keys that carry presentation-only values (e.g. descriptions, etc.). These are dropped wherever\n * they appear as they should not affect backwards-compatibility checks.\n */\nconst PRESENTATION_KEYS = [\"displayMetadata\"];\nfunction isPresentationKey(key) {\n return PRESENTATION_KEYS.includes(key);\n}\n\n/** A property's locked type, without fields that do not affect backwards-compatibility. */\n\n/**\n * Strips the parts of a type that carry no compatibility meaning.\n *\n * @param array whether the property holds a list of `type` rather than a single value\n */\nexport function normalizePropertyType(type, array) {\n const subtype = strip(type);\n return array ? {\n type: \"array\",\n subtype\n } : subtype;\n}\n\n/** How a property's type is named in error messages and in the rendered lockfile diff. */\nexport function describeType(type) {\n return isArrayType(type) ? `${describeType(type.subtype)}[]` : JSON.stringify(type);\n}\nfunction isArrayType(type) {\n return typeof type === \"object\" && type.type === \"array\";\n}\nfunction strip(value) {\n if (Array.isArray(value)) {\n return value.map(strip);\n }\n if (typeof value !== \"object\" || value == null) {\n return value;\n }\n return Object.fromEntries(Object.entries(value).filter(([key, nested]) => nested !== undefined && !isPresentationKey(key)).map(([key, nested]) => [key, strip(nested)]));\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 { isDeepStrictEqual } from \"node:util\";\nimport { describeFinalization, describeInstruction, describeSuggestedTransition, mapPropertyNames } from \"../api/interface/describeInterfaceSchemaMigrationInstruction.js\";\nimport { describeType } from \"./LockedPropertyType.js\";\nimport { authoredKeyOf } from \"./OntologySchemaLockfile.js\";\n/** Renders a breaking change as the report an author reads. */\nexport function describeBreakingChange(breakingChange) {\n const where = `Interface ${breakingChange.interfaceApiName}`;\n switch (breakingChange.code) {\n case \"ambiguousDisappearance\":\n {\n if (breakingChange.targets.length === 0) {\n return `${where}: schema migration \"${breakingChange.transitionId}\" is no longer declared, but ` + `it targets no property, so its disappearance cannot be read as either a ` + `finalization or a deletion. Restore it, or remove it from the lockfile by hand once ` + `the last published release no longer declares it.`;\n }\n const targets = breakingChange.targets.map(({\n propertyApiName\n }) => `\"${authoredKeyOf(propertyApiName)}\"`).join(\", \");\n return `${where}: schema migration \"${breakingChange.transitionId}\" is no longer declared, but ` + `the resulting schema is neither a finalization nor a deletion of it. ` + `${describeTargetDrift(breakingChange.targets)}\\n` + ` To finalize it, ${describeFinalizations(breakingChange.instructions)}.\\n` + ` To delete it, leave ${targets} exactly as the lockfile records it.`;\n }\n case \"instructionsChanged\":\n return `${where}: schema migration \"${breakingChange.transitionId}\" changed its instructions from ` + `${describeInstructions(breakingChange.previousInstructions)} to ` + `${describeInstructions(breakingChange.nextInstructions)}. An in-flight migration's instructions ` + `may not be changed, since stacks may already be part-way through it. Delete this transition and ` + `declare a new one with a different id instead.`;\n case \"interfaceExtensionAdded\":\n {\n const extended = breakingChange.extendedInterfaceApiName;\n return `${where}: now extends \"${extended}\". Implementing object types have to satisfy every ` + `property \"${extended}\" contributes, so those that do not yet are blocked from upgrading, ` + `and no currently-supported interface schema migration can phase that in. Stop extending ` + `\"${extended}\".`;\n }\n case \"propertyRemoved\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" was removed. Removing a property from an ` + `interface is a breaking change, and no currently-supported interface schema migration can ` + `phase it in. Restore \"${property}\" to the interface.`;\n }\n case \"propertyDeclarationChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" moved from ` + `${describeDeclaration(breakingChange.previousDeclaration)} to ` + `${describeDeclaration(breakingChange.nextDeclaration)}. The two are different bindings even ` + `when they resolve to the same type, so implementing object types would have to remap ` + `the property, and no currently-supported interface schema migration can phase that in. ` + `Declare \"${property}\" ${describeDeclaration(breakingChange.previousDeclaration)} again.`;\n }\n case \"propertyNamespaceChanged\":\n {\n const property = authoredKeyOf(breakingChange.previousApiName);\n return `${where}: property \"${property}\" is now backed by shared property type ` + `\"${breakingChange.nextApiName}\" rather than \"${breakingChange.previousApiName}\". A property is ` + `identified by the shared property type behind it, so this removes ` + `\"${breakingChange.previousApiName}\" from the interface rather than renaming it, and ` + `implementing object types would have to take up \"${breakingChange.nextApiName}\" in its place. ` + `No currently-supported interface schema migration can phase that in. Back \"${property}\" ` + `with \"${breakingChange.previousApiName}\" again.`;\n }\n case \"propertyTypeChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" changed type from ` + `${describeType(breakingChange.previousType)} to ${describeType(breakingChange.nextType)}. Changing a ` + `property's type is a breaking change, and no currently-supported interface schema ` + `migration can phase it in. Restore \"${property}\" to ` + `${describeType(breakingChange.previousType)}; to publish the new type, declare it as a new ` + `property under a different api name.`;\n }\n case \"propertyTypeClassesChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" changed type classes from ` + `${describeTypeClasses(breakingChange.previousTypeClasses)} to ` + `${describeTypeClasses(breakingChange.nextTypeClasses)}. Type classes drive render hints like ` + `sorting and filtering, so changing them breaks applications relying on those hints, and ` + `blocks upgrades for implementing object types that lack the new ones. No ` + `currently-supported interface schema migration can phase this in. Restore \"${property}\" ` + `to ${describeTypeClasses(breakingChange.previousTypeClasses)}.`;\n }\n case \"primaryKeyConstraintChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" changed its primary key constraint from ` + `${describeConstraint(breakingChange.previousConstraint)} to ` + `${describeConstraint(breakingChange.nextConstraint)}. Implementing object types that satisfy ` + `the old constraint need not satisfy the new one, so this blocks their upgrade, and no ` + `currently-supported interface schema migration can phase it in. Restore ` + `\"${property}\" to ${describeConstraint(breakingChange.previousConstraint)}.`;\n }\n case \"nullabilityTightened\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" tightened its nullability from ` + `${describeNullability(breakingChange.previousNullability)} to ` + `${describeNullability(breakingChange.nextNullability)}. Implementing object types whose data ` + `does not already satisfy that are blocked from upgrading, and no currently-supported ` + `interface schema migration can phase it in. Restore \"${property}\" to ` + `${describeNullability(breakingChange.previousNullability)}.`;\n }\n case \"valueTypeChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n const previous = breakingChange.previousValueType;\n return `${where}: property \"${property}\" changed its value type from ` + `${previous === undefined ? \"none\" : describeValueType(previous)} to ` + `${describeValueType(breakingChange.nextValueType)}. A value type carries constraints that ` + `implementing object types' data has to satisfy, and no currently-supported interface ` + `schema migration can phase that in. ` + (previous === undefined ? `Drop the reference from \"${property}\".` : `Restore \"${property}\" to ${describeValueType(previous)}.`);\n }\n case \"propertyBecameRequired\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" became required without a schema migration. ` + `Keep it declared \\`required: false\\` and phase it in instead through a migration like:\\n` + ` ${describeSuggestedAddRequiredPropertyTransition(property)}`;\n }\n case \"requiredPropertyAdded\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" was added as required. Existing implementing ` + `object types do not provide it yet, so this is a breaking change. Declare it ` + `\\`required: false\\` and phase it in instead through a migration like:\\n` + ` ${describeSuggestedAddRequiredPropertyTransition(property)}`;\n }\n }\n}\n\n/** Renders a warning as the note an author reads alongside the breaking-change report. */\nexport function describeWarning(warning) {\n switch (warning.code) {\n case \"optedOut\":\n return `Interface ${warning.interfaceApiName} no longer declares \\`schemaMigrations\\`. Its ` + `in-flight migrations are still resolved for this release, but from the next release on ` + `maker will stop checking the interface for breaking schema changes, and a break will ` + `only surface when the ontology is installed. Restore the \\`schemaMigrations\\` block to ` + `keep the interface checked.`;\n case \"requirementRelaxed\":\n {\n const property = authoredKeyOf(warning.property);\n return `Interface ${warning.interfaceApiName}: property \"${property}\" is no longer required. ` + `Implementing object types need not provide it from this release on, so clients that ` + `expect it to always be present will start seeing it absent. Nothing to do if that was ` + `intended; declare it \\`required: true\\` again if it was not.`;\n }\n case \"primaryKeyConstraintRelaxed\":\n {\n const property = authoredKeyOf(warning.property);\n return `Interface ${warning.interfaceApiName}: property \"${property}\" no longer constrains ` + `primary key mapping, having been ` + `${describeConstraint(warning.previousConstraint)}. Implementing object types are free ` + `to map it either way from this release on. Nothing to do if that was intended; declare ` + `the constraint again if it was not.`;\n }\n case \"nullabilityRelaxed\":\n {\n const property = authoredKeyOf(warning.property);\n return `Interface ${warning.interfaceApiName}: property \"${property}\" relaxed its nullability ` + `from ${describeNullability(warning.previousNullability)} to ` + `${describeNullability(warning.nextNullability)}. Implementing object types may supply ` + `values it previously rejected, so clients that relied on the old guarantee will start ` + `seeing them. Nothing to do if that was intended; declare the constraint again if it ` + `was not.`;\n }\n case \"valueTypeRemoved\":\n {\n const property = authoredKeyOf(warning.property);\n return `Interface ${warning.interfaceApiName}: property \"${property}\" no longer references ` + `value type ${describeValueType(warning.previousValueType)}. Implementing object types ` + `are no longer held to that value type's constraints, so clients that relied on them ` + `will start seeing values it rejected. Nothing to do if that was intended; reference it ` + `again if it was not.`;\n }\n case \"interfaceExtensionRemoved\":\n {\n const extended = warning.extendedInterfaceApiName;\n return `Interface ${warning.interfaceApiName} no longer extends \"${extended}\". Every property ` + `\"${extended}\" contributed is dropped from the published schema, so clients reading them ` + `will stop seeing them, and object types that implemented \"${extended}\" only by ` + `inheritance no longer do. Nothing to do if that was intended; extend \"${extended}\" ` + `again if it was not.`;\n }\n }\n}\nfunction describeValueType(valueType) {\n return valueType.packageNamespace === \"\" ? valueType.apiName : `${valueType.packageNamespace}/${valueType.apiName}`;\n}\n\n/** What a nullability forbids, as a noun phrase. */\nfunction describeNullability(nullability) {\n const forbidden = [nullability.noNulls && \"no nulls\", nullability.noEmptyCollections && \"no empty collections\"].filter(clause => clause !== false);\n return forbidden.length === 0 ? \"unconstrained\" : forbidden.join(\", \");\n}\n\n/** A primary key constraint, as it reads mid-sentence. */\nfunction describeConstraint(constraint) {\n switch (constraint) {\n case \"MUST_BE_PK\":\n return \"`MUST_BE_PK`\";\n case \"CANNOT_BE_PK\":\n return \"`CANNOT_BE_PK`\";\n case \"NO_RESTRICTION\":\n return \"unconstrained\";\n }\n}\n\n/** Where a property is declared, as it reads mid-sentence in a report. */\nfunction describeDeclaration(declaration) {\n switch (declaration) {\n case \"interface\":\n return \"defined on the interface\";\n case \"sharedPropertyType\":\n return \"backed by a shared property type\";\n }\n}\nfunction describeTypeClasses(typeClasses) {\n if (typeClasses.length === 0) {\n return \"none\";\n }\n return typeClasses.map(({\n kind,\n name\n }) => `${kind}/${name}`).join(\", \");\n}\n\n/** A transition's instructions, named as the author wrote them. */\nfunction describeInstructions(instructions) {\n return `[${instructions.map(instruction => describeInstruction(mapPropertyNames(instruction, authoredKeyOf))).join(\", \")}]`;\n}\n\n/** Explains what actually happened to a transition's target properties, for the error message. */\nfunction describeTargetDrift(targets) {\n const descriptions = targets.map(({\n propertyApiName,\n previous,\n next\n }) => {\n const authoredPropertyName = authoredKeyOf(propertyApiName);\n if (next === undefined) {\n return `\"${authoredPropertyName}\" was removed from the interface`;\n }\n if (previous !== undefined && !isDeepStrictEqual(previous.type, next.type)) {\n return `\"${authoredPropertyName}\" changed type from ${describeType(previous.type)} to ` + describeType(next.type);\n }\n return `\"${authoredPropertyName}\" is \\`required: ${next.required}\\``;\n });\n return `Instead, ${descriptions.join(\", \")}.`;\n}\n\n/** Everything the author would do to have the transition be finalized instead. */\nfunction describeFinalizations(instructions) {\n return instructions.map(instruction => describeFinalization(mapPropertyNames(instruction, authoredKeyOf))).join(\", and \");\n}\n\n/** The transition an author should have declared to make `property` required. */\nfunction describeSuggestedAddRequiredPropertyTransition(property) {\n return describeSuggestedTransition({\n type: \"addRequiredProperty\",\n property\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 { OntologyEntityTypeEnum } from \"../api/common/OntologyEntityTypeEnum.js\";\nimport { mapPropertyNames } from \"../api/interface/describeInterfaceSchemaMigrationInstruction.js\";\nimport { getInterfacePropertyTypeType, interfacePropertyNullability, interfacePropertyPrimaryKeyConstraint, interfacePropertyTypeClasses, interfacePropertyValueType, interfacePropertyWireApiName, isInterfacePropertyArray, isInterfacePropertyRequired, isInterfaceSharedPropertyType } from \"../api/interface/InterfacePropertyType.js\";\nimport { normalizePropertyType } from \"./LockedPropertyType.js\";\nimport { ONTOLOGY_SCHEMA_LOCKFILE_VERSION } from \"./OntologySchemaLockfile.js\";\n\n/**\n * Every interface the lockfile could track, enrolled or not, with the schema it declares now.\n *\n * This enables disambiguating \"this interface was deleted from source\" vs \"this interface was\n * unenrolled from being locked, but still exists in source\", which may have different consequences.\n */\n\n/**\n * Derives the lockfile that the given ontology *should* have, purely from source.\n *\n * NB: Deliberately does not consult the previously-persisted lockfile, and instead keeps\n * generation a pure function of the source (simpler to reason about, test, etc.).\n * Any history-dependent logic (e.g. backwards-compatibility checking) is only a validation concern.\n */\nexport function generateOntologySchemaLockfile(ontology) {\n const interfaces = {};\n for (const interfaceType of sortedByApiName(Object.values(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]))) {\n if (!shouldLockInterface(interfaceType)) {\n continue;\n }\n interfaces[interfaceType.apiName] = lockInterface(interfaceType);\n }\n return {\n version: ONTOLOGY_SCHEMA_LOCKFILE_VERSION,\n interfaces\n };\n}\nexport function censusOfSource(ontology) {\n return {\n interfaces: new Map(Object.values(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).map(interfaceType => [interfaceType.apiName, lockInterfaceSchema(interfaceType)]))\n };\n}\nexport function shouldLockInterface(interfaceType) {\n return interfaceType.schemaMigrations !== undefined;\n}\nfunction lockInterface(interfaceType) {\n return {\n schema: lockInterfaceSchema(interfaceType),\n transitions: lockInterfaceSchemaMigrationTransitions(interfaceType)\n };\n}\nfunction lockInterfaceSchema(interfaceType) {\n const locked = Object.entries(interfaceType.propertiesV3).map(([propertyApiName, property]) => [interfacePropertyWireApiName(property, propertyApiName), lockProperty(property)]).sort(([a], [b]) => compare(a, b));\n const extendsInterfaces = lockExtensions(interfaceType);\n return {\n properties: Object.fromEntries(locked),\n // NB: spread rather than assigned `undefined` so a lockfile read back from disk (where absents\n // have no key at all) still compare equal.\n ...(extendsInterfaces !== undefined && {\n extendsInterfaces\n })\n };\n}\nfunction lockExtensions(interfaceType) {\n const extended = new Set(interfaceType.extendsInterfaces.map(parent => parent.apiName));\n return extended.size === 0 ? undefined : [...extended].sort(compare);\n}\nfunction lockProperty(property) {\n const typeClasses = lockTypeClasses(interfacePropertyTypeClasses(property));\n const primaryKeyConstraint = interfacePropertyPrimaryKeyConstraint(property);\n const nullability = lockNullability(interfacePropertyNullability(property));\n const valueType = lockValueType(interfacePropertyValueType(property));\n return {\n type: normalizePropertyType(getInterfacePropertyTypeType(property), isInterfacePropertyArray(property)),\n required: isInterfacePropertyRequired(property),\n // NB: spread rather than assigned `undefined` so a lockfile read back from disk (where absents\n // have no key at all) still compare equal.\n ...(typeClasses !== undefined && {\n typeClasses\n }),\n ...(isInterfaceSharedPropertyType(property) && {\n declaredBy: \"sharedPropertyType\"\n }),\n ...(primaryKeyConstraint !== \"NO_RESTRICTION\" && {\n primaryKeyConstraint\n }),\n ...(nullability !== undefined && {\n nullability\n }),\n ...(valueType !== undefined && {\n valueType\n })\n };\n}\nfunction lockValueType(valueType) {\n if (valueType === undefined) {\n return undefined;\n }\n\n // Re-built field-by-field so key order is stable\n return {\n packageNamespace: valueType.packageNamespace,\n apiName: valueType.apiName\n };\n}\nfunction lockNullability(nullability) {\n if (nullability === undefined || !nullability.noNulls && !nullability.noEmptyCollections) {\n return undefined;\n }\n\n // Rebuild to have firm key order\n return {\n noNulls: nullability.noNulls,\n noEmptyCollections: nullability.noEmptyCollections\n };\n}\nfunction lockTypeClasses(typeClasses) {\n if (typeClasses === undefined || typeClasses.length === 0) {\n return undefined;\n }\n return [...typeClasses].sort((a, b) => compare(a.kind, b.kind) || compare(a.name, b.name));\n}\nfunction lockInterfaceSchemaMigrationTransitions(interfaceType) {\n const {\n schemaMigrations,\n propertiesV3\n } = interfaceType;\n if (schemaMigrations === undefined) {\n return [];\n }\n return schemaMigrations.transitions.map(transition => ({\n id: transition.id,\n gracePeriod: transition.gracePeriod,\n instructions: transition.instructions.map(instruction => mapPropertyNames(instruction, propertyApiName => wireApiNameOf(instruction.type, propertyApiName, propertiesV3)))\n // Instructions have no unique stable identifier, so JSON them instead for sort stability\n .sort((a, b) => compare(JSON.stringify(a), JSON.stringify(b)))\n })).sort((a, b) => compare(a.id, b.id));\n}\n\n/**\n * The api name a property the author referenced by key is published under, matching what the\n * ontology-ir carries.\n */\nfunction wireApiNameOf(instructionType, propertyApiName, propertiesV3) {\n const property = propertiesV3[propertyApiName];\n if (property === undefined) {\n throw new Error(`Schema migration instruction ${instructionType} references property \"${propertyApiName}\", which the interface does not declare.`);\n }\n return interfacePropertyWireApiName(property, propertyApiName);\n}\nfunction sortedByApiName(interfaceTypes) {\n return [...interfaceTypes].sort((a, b) => compare(a.apiName, b.apiName));\n}\nfunction compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\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 { z } from \"zod\";\nimport { isCanonicalIsoUtcDatetime } from \"../api/interface/validateInterfaceSchemaMigrations.js\";\nimport { LOCKFILE_HEADER_KEY, ONTOLOGY_SCHEMA_LOCKFILE_VERSION } from \"./OntologySchemaLockfile.js\";\n\n/** Rewrites a lockfile written by the version it is keyed under into the next version's shape. */\n\n/** A lockfile mid-upgrade: known to have a version, not yet known to have anything else. */\n\n/**\n * Upgraders keyed by the version they read, applied in ascending order until the lockfile reaches\n * {@link ONTOLOGY_SCHEMA_LOCKFILE_VERSION}.\n */\nconst UPGRADERS = {};\nconst DEADLINE_MESSAGE = `Expected an ISO-8601 UTC datetime (e.g. \"2026-01-31T00:00:00Z\"). Restore the deadline the last ` + `published release declared.`;\nconst TRANSITION_ID_MESSAGE = `Expected a non-empty transition id. Restore the id the last published release declared.`;\nconst INSTRUCTIONS_MESSAGE = `Expected a non-empty array of instructions. A migration that instructs nothing cannot be ` + `finalized or deleted; remove the migration, or restore the instructions the last published ` + `release declared.`;\n\n/**\n * Appends repair advice to whatever zod would have said. Used where zod's own wording is worth\n * keeping (e.g. a discriminated union names the variants it knows).\n */\nfunction appendRestoreAdviceFor(what) {\n return {\n errorMap: (_issue, ctx) => ({\n message: `${ctx.defaultError}. Restore the ${what} the last published release declared.`\n })\n };\n}\nconst gracePeriodSchema = z.discriminatedUnion(\"type\", [z.object({\n type: z.literal(\"afterInstall\"),\n days: z.number({\n message: `Expected a number of days. Restore the number of days the last published release ` + `declared.`\n })\n}).passthrough(), z.object({\n type: z.literal(\"deadline\"),\n deadline: z.string({\n message: DEADLINE_MESSAGE\n }).refine(isCanonicalIsoUtcDatetime, {\n message: DEADLINE_MESSAGE\n })\n}).passthrough()], appendRestoreAdviceFor(\"grace period\"));\nconst instructionSchema = z.discriminatedUnion(\"type\", [z.object({\n type: z.literal(\"addRequiredProperty\"),\n property: z.string({\n message: \"Expected the api name of the property to require.\"\n })\n}).passthrough()], appendRestoreAdviceFor(\"instruction\"));\nconst transitionSchema = z.object({\n id: z.string({\n message: TRANSITION_ID_MESSAGE\n }).min(1, {\n message: TRANSITION_ID_MESSAGE\n }),\n gracePeriod: gracePeriodSchema,\n instructions: z.array(instructionSchema, {\n message: INSTRUCTIONS_MESSAGE\n }).nonempty({\n message: INSTRUCTIONS_MESSAGE\n })\n}, {\n message: \"Expected an object recording a schema migration.\"\n}).passthrough();\nconst typeClassSchema = z.object({\n kind: z.string({\n message: \"Expected a type class kind.\"\n }),\n name: z.string({\n message: \"Expected a type class name.\"\n })\n}, {\n message: \"Expected an object recording a type class.\"\n}).passthrough();\nconst propertySchema = z.object({\n // `PropertyTypeType` mirrors conjure-generated bindings that are regenerated upstream, so the\n // parser asserts only that a type was recorded.\n type: z.custom(type => type != null, {\n message: `Expected a recorded property type. Restore the type the last published release declared.`\n }),\n required: z.boolean({\n message: \"Expected a boolean.\"\n }),\n typeClasses: z.array(typeClassSchema, {\n message: `Expected an array of type classes. Restore the type classes the last published ` + `release declared.`\n }).optional(),\n // Absent means its an IDP, so we need only expect the SPT variant here\n declaredBy: z.literal(\"sharedPropertyType\", {\n message: `Expected \"sharedPropertyType\", or no value at all for a property the interface ` + `defines itself. Restore what the last published release declared.`\n }).optional(),\n // NO_RESTRICTION is the absent/default case, so we don't record it in the lockfile\n primaryKeyConstraint: z.enum([\"MUST_BE_PK\", \"CANNOT_BE_PK\"], {\n message: `Expected \"MUST_BE_PK\" or \"CANNOT_BE_PK\", or no value at all for a property that ` + `does not constrain primary key mapping. Restore what the last published release ` + `declared.`\n }).optional(),\n nullability: z.object({\n noNulls: z.boolean({\n message: \"Expected a boolean.\"\n }),\n noEmptyCollections: z.boolean({\n message: \"Expected a boolean.\"\n })\n }, {\n message: `Expected an object recording what the property forbids. Restore the nullability ` + `the last published release declared.`\n }).passthrough().refine(({\n noNulls,\n noEmptyCollections\n }) => noNulls || noEmptyCollections, {\n message: `Expected a nullability that forbids something, or no value at all for a property ` + `that constrains neither nulls nor empty collections.`\n }).optional(),\n valueType: z.object({\n packageNamespace: z.string({\n message: \"Expected a value type package namespace.\"\n }),\n apiName: z.string({\n message: \"Expected a value type api name.\"\n })\n }, {\n message: `Expected an object identifying a value type. Restore the value type the last ` + `published release declared.`\n }).passthrough().optional()\n}, {\n message: \"Expected an object recording the property's locked type and whether it is required.\"\n}).passthrough();\nconst interfaceSchema = z.object({\n schema: z.object({\n properties: z.record(z.string(), propertySchema, {\n message: \"Expected an object keyed by property api name.\"\n }),\n extendsInterfaces: z.array(z.string({\n message: \"Expected the api name of an extended interface.\"\n }), {\n message: `Expected an array of extended interface api names. Restore the interfaces ` + `the last published release extended.`\n })\n // Absent means \"extends nothing\", so a committed lockfile should only ever values\n .nonempty({\n message: `Expected a non-empty array of extended interface api names, or no value at ` + `all for an interface that extends none.`\n }).optional()\n }, {\n message: 'Expected an object with a \"properties\" key.'\n }).passthrough(),\n transitions: z.array(transitionSchema, {\n message: \"Expected an array of in-flight schema migrations.\"\n })\n}, {\n message: \"Expected an object recording the interface's locked schema and transitions.\"\n}).passthrough();\n\n/**\n * The shape everything downstream of the parser relies on. Lockfiles are checked in, and therefore\n * hand-editable, so it cannot be assumed.\n *\n * Three things this schema is deliberately not:\n *\n * - **Semantic.** The checks are purely structural, since a newer maker may validate semantics that\n * were not true (or necessary) when this lockfile version was written.\n * - **Strict.** Every object passes unknown keys through. Reconcile decides a lockfile is out of\n * date by comparing it against a freshly generated one, so a key an author added by hand has to\n * survive parsing in order to be reported as a difference rather than silently dropped.\n * - **Silent.** Each node carries the message an author should see when it rejects something, so\n * the wording lives next to the check rather than in a renderer that has to work out where in\n * the file the failure came from.\n */\nconst lockfileSchema = z.object({\n version: z.number().int(),\n interfaces: z.record(z.string(), interfaceSchema, {\n message: \"Expected an object keyed by interface api name.\"\n })\n}).passthrough();\n\n/**\n * `true` when `Parsed` accepts every variant of the union `Declared`, otherwise `never`.\n *\n * Used to ensure our zod discriminated unions are exhaustive over the real types.\n */\n\n// Exhaustiveness checks\nconst _COVERS_EVERY_GRACE_PERIOD = true;\nconst _COVERS_EVERY_INSTRUCTION = true;\nexport function parseLockfile(contents, lockfilePath) {\n let parsed;\n try {\n parsed = JSON.parse(contents);\n } catch (e) {\n throw new Error(`${lockfilePath} is not valid JSON: ${e.message}`, {\n cause: e\n });\n }\n const versioned = requireVersion(parsed, lockfilePath);\n const upgraded = upgradeLockfile(withoutHeader(versioned), ONTOLOGY_SCHEMA_LOCKFILE_VERSION, UPGRADERS, lockfilePath);\n const result = lockfileSchema.safeParse(upgraded);\n if (!result.success) {\n throw new Error(`${lockfilePath} is not a valid ontology schema lockfile:\\n` + result.error.issues.map(issue => ` ${formatPath(issue.path)}: ${issue.message}`).join(\"\\n\"), {\n cause: result.error\n });\n }\n return result.data;\n}\nfunction requireVersion(parsed, lockfilePath) {\n const version = parsed?.version;\n if (typeof version !== \"number\" || !Number.isInteger(version)) {\n throw new Error(`${lockfilePath} is not an ontology schema lockfile: expected an integer \"version\" key.`);\n }\n if (version > ONTOLOGY_SCHEMA_LOCKFILE_VERSION) {\n throw new Error(`${lockfilePath} has version ${version}, but this version of maker only understands ` + `version ${ONTOLOGY_SCHEMA_LOCKFILE_VERSION}. Upgrade @osdk/maker.`);\n }\n return parsed;\n}\n\n/** Drops the header `serializeLockfile` writes. */\nfunction withoutHeader(lockfile) {\n const {\n [LOCKFILE_HEADER_KEY]: _header,\n ...rest\n } = lockfile;\n return rest;\n}\n\n/**\n * Brings an older lockfile up to `targetVersion` by applying each intervening upgrader in turn.\n *\n * @internal\n */\nexport function upgradeLockfile(lockfile, targetVersion, upgraders, lockfilePath) {\n let upgraded = lockfile;\n while (upgraded.version < targetVersion) {\n const upgrade = upgraders[upgraded.version];\n if (upgrade === undefined) {\n throw new Error(`${lockfilePath} has version ${upgraded.version}, which this version of maker cannot ` + `upgrade to version ${targetVersion}. Delete the lockfile and regenerate it.`);\n }\n const next = upgrade(upgraded);\n if (next.version <= upgraded.version) {\n throw new Error(`The lockfile upgrader for version ${upgraded.version} did not advance the version.`);\n }\n upgraded = next;\n }\n return upgraded;\n}\n\n/** `[\"interfaces\", \"Person\", \"transitions\", 0, \"id\"]` -> `interfaces.Person.transitions[0].id`. */\nfunction formatPath(path) {\n return path.map((key, index) => {\n if (typeof key === \"number\") {\n return `[${key}]`;\n }\n return index === 0 ? key : `.${key}`;\n }).join(\"\");\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 { isDeepStrictEqual } from \"node:util\";\nimport { own } from \"./OntologySchemaLockfile.js\";\n\n/**\n * Whether a transition's instructions are being enforced.\n *\n * - `lenient`: the transition is in flight. Implementing object types are not held to it yet.\n * - `strict`: the transition has been finalized. Implementing object types must comply.\n */\n\n/** What an instruction does to a property when applied. */\n\n/** * What an instruction does to one property, in both modes. */\n\n/** The per-property changes an instruction makes, keyed by the property each one applies to. */\nfunction editsOf(instruction) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n return new Map([[instruction.property, {\n lenient: {\n op: \"patch\",\n required: false\n },\n strict: {\n op: \"patch\",\n required: true\n }\n }]]);\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.type}`);\n }\n}\n\n/** A transition applied in one mode. */\n\n/**\n * Applies one edit to `properties` in place, reporting whether it could apply at all.\n *\n * @internal\n */\nexport function applyEdit(properties, propertyApiName, edit) {\n const existing = own(properties, propertyApiName);\n switch (edit.op) {\n case \"patch\":\n {\n if (existing === undefined) {\n return false;\n }\n const {\n op: _op,\n ...attributes\n } = edit;\n properties[propertyApiName] = {\n ...existing,\n ...attributes\n };\n return true;\n }\n case \"add\":\n {\n if (existing !== undefined) {\n return false;\n }\n properties[propertyApiName] = edit.property;\n return true;\n }\n case \"remove\":\n {\n if (existing === undefined) {\n return false;\n }\n delete properties[propertyApiName];\n return true;\n }\n default:\n {\n const unhandled = edit;\n throw new Error(`Unknown property edit: ${JSON.stringify(unhandled)}`);\n }\n }\n}\n\n/**\n * The result of applying `transition` to `schema` in the given mode, or `undefined` if the\n * transition cannot be applied to that schema at all (e.g. it patches a property the schema does\n * not record).\n */\nexport function applyTransition(transition, schema, mode) {\n const properties = {\n ...schema.properties\n };\n const touched = new Set();\n for (const instruction of transition.instructions) {\n for (const [propertyApiName, byMode] of editsOf(instruction)) {\n if (!applyEdit(properties, propertyApiName, byMode[mode])) {\n return undefined;\n }\n touched.add(propertyApiName);\n }\n }\n return {\n schema: {\n ...schema,\n properties\n },\n touched: [...touched]\n };\n}\n\n/** Every property a transition could touch, in either mode. */\nexport function targetPropertiesOf(transition) {\n return transition.instructions.flatMap(instruction => [...editsOf(instruction).keys()]);\n}\n\n/**\n * Whether applying a transition in one mode results in `schema`, comparing only the properties the\n * application asserted something about.\n */\nexport function reproduces(applied, schema) {\n if (applied === undefined || applied.touched.length === 0) {\n return false;\n }\n return applied.touched.every(propertyApiName => isDeepStrictEqual(own(applied.schema.properties, propertyApiName), own(schema.properties, propertyApiName)));\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 { isDeepStrictEqual } from \"node:util\";\nimport { applyTransition, reproduces, targetPropertiesOf } from \"./applyInterfaceSchemaTransition.js\";\nimport { authoredKeyOf, declarationOf, extensionsOf, nullabilityOf, own, primaryKeyConstraintOf, tightensNullability } from \"./OntologySchemaLockfile.js\";\n\n/**\n * NOTE ON CONVENTION: the rest of maker validates with `invariant`, failing on the first problem.\n * This module instead accumulates breaking changes and lets its caller throw one aggregate. An\n * author fixing a batch of them wants to see all of them, not to discover them one build at a\n * time.\n */\n\n/** A transition that the source no longer declares, along with what its disappearance meant. */\n\n/** A property a transition targets, as the lockfile records it and as the source now declares it. */\n\n/** A change that would be rejected at installation-time, in machine-readable form. */\n\n/** Worth telling the author about, but not by itself a reason to reject the ontology. */\n\n/**\n * Diffs a newly-generated lockfile against the persisted one, reporting any change that would\n * be rejected when the ontology is installed.\n *\n * @param previous the persisted lockfile, i.e. the last published state\n * @param next the lockfile generated from the current source\n * @param census every entity the source declares, enrolled or not in locking, with the schema it declares now.\n */\nexport function validateOntologySchemaLockfile(previous, next, census) {\n const result = {\n breakingChanges: [],\n checkpoints: [],\n warnings: []\n };\n for (const [interfaceApiName, previousInterface] of Object.entries(previous.interfaces)) {\n const enrolled = own(next.interfaces, interfaceApiName);\n const nextInterface = enrolled ?? asOptedOut(interfaceApiName, census.interfaces);\n\n // Not a break to remove the IT, existing installations will just continue\n // with what they have\n if (nextInterface === undefined) {\n continue;\n }\n if (enrolled === undefined) {\n result.warnings.push({\n code: \"optedOut\",\n interfaceApiName\n });\n }\n validateInterface(interfaceApiName, previousInterface, nextInterface, result);\n }\n return result;\n}\n\n/**\n * What an interface that dropped its `schemaMigrations` block still amounts to: the schema the\n * source declares, with no transitions left. `undefined` if the source no longer declares it.\n *\n * Opting out ends maker's checking of the interface from the next release on, but not this one. The\n * interface is still published, so whether each in-flight transition landed or was abandoned is\n * still a real difference in the artifact.\n */\nfunction asOptedOut(interfaceApiName, census) {\n const schema = census.get(interfaceApiName);\n return schema === undefined ? undefined : {\n schema,\n transitions: []\n };\n}\nfunction validateInterface(interfaceApiName, previousInterface, nextInterface, result) {\n const {\n breakingChanges,\n checkpoints\n } = result;\n const nextTransitions = new Map(nextInterface.transitions.map(transition => [transition.id, transition]));\n\n // Authored keys whose change is already explained by a finalization or deletion, and so must be\n // exempt from the general breaking-change checks below.\n const propertiesAccountedFor = new Set();\n for (const previousTransition of previousInterface.transitions) {\n const nextTransition = nextTransitions.get(previousTransition.id);\n if (nextTransition === undefined) {\n const disappearance = classifyDisappearance(previousTransition, previousInterface.schema, nextInterface.schema);\n if (disappearance.kind === \"ambiguous\") {\n breakingChanges.push({\n code: \"ambiguousDisappearance\",\n interfaceApiName,\n transitionId: previousTransition.id,\n targets: disappearance.targets,\n instructions: previousTransition.instructions\n });\n } else {\n checkpoints.push({\n interfaceApiName,\n transitionId: previousTransition.id,\n kind: disappearance.kind\n });\n }\n\n // Whether the disappearance was legal or not, its target properties have been reported on;\n // re-reporting them as raw schema breaks would only add noise.\n for (const property of targetPropertiesOf(previousTransition)) {\n propertiesAccountedFor.add(authoredKeyOf(property));\n }\n continue;\n }\n validateSurvivingTransition(interfaceApiName, previousTransition, nextTransition, breakingChanges);\n }\n validateExtensionsDiff(interfaceApiName, previousInterface.schema, nextInterface.schema, result);\n validateSchemaDiff(interfaceApiName, previousInterface.schema, nextInterface.schema, propertiesAccountedFor, result);\n}\nfunction validateExtensionsDiff(interfaceApiName, previousSchema, nextSchema, {\n breakingChanges,\n warnings\n}) {\n const previousExtensions = new Set(extensionsOf(previousSchema));\n const nextExtensions = new Set(extensionsOf(nextSchema));\n for (const extendedInterfaceApiName of nextExtensions) {\n if (!previousExtensions.has(extendedInterfaceApiName)) {\n breakingChanges.push({\n code: \"interfaceExtensionAdded\",\n interfaceApiName,\n extendedInterfaceApiName\n });\n }\n }\n for (const extendedInterfaceApiName of previousExtensions) {\n if (!nextExtensions.has(extendedInterfaceApiName)) {\n warnings.push({\n code: \"interfaceExtensionRemoved\",\n interfaceApiName,\n extendedInterfaceApiName\n });\n }\n }\n}\n\n/** What a transition vanishing from the source turned out to mean. */\n\nfunction classifyDisappearance(transition, previousSchema, nextSchema) {\n const strict = applyTransition(transition, previousSchema, \"strict\");\n if (reproduces(strict, nextSchema)) {\n return {\n kind: \"finalized\"\n };\n }\n const lenient = applyTransition(transition, previousSchema, \"lenient\");\n if (reproduces(lenient, nextSchema)) {\n return {\n kind: \"deleted\"\n };\n }\n return {\n kind: \"ambiguous\",\n targets: targetPropertiesOf(transition).map(propertyApiName => ({\n propertyApiName,\n previous: own(previousSchema.properties, propertyApiName),\n next: own(nextSchema.properties, propertyApiName)\n }))\n };\n}\nfunction validateSurvivingTransition(interfaceApiName, previous, next, breakingChanges) {\n if (!isDeepStrictEqual(previous.instructions, next.instructions)) {\n breakingChanges.push({\n code: \"instructionsChanged\",\n interfaceApiName,\n transitionId: previous.id,\n previousInstructions: previous.instructions,\n nextInstructions: next.instructions\n });\n }\n}\n\n/** A property as the lockfile records it: the api name it publishes under, and its shape. */\n\n/**\n * A schema's properties keyed by the name the author wrote rather than the one they publish under.\n */\nfunction byAuthoredKey(schema) {\n // `Object.entries` yields only own enumerable keys, so unlike an index read this needs no guard\n // against a lockfile parsed from disk inheriting `constructor` and friends from `Object.prototype`.\n return new Map(Object.entries(schema.properties).map(([apiName, property]) => [authoredKeyOf(apiName), {\n apiName,\n property\n }]));\n}\n\n/**\n * Reports every difference between the two schemas that would be rejected at installation-time, skipping\n * the properties already explained by a finalization or deletion.\n */\nfunction validateSchemaDiff(interfaceApiName, previousSchema, nextSchema, accountedFor, {\n breakingChanges,\n warnings\n}) {\n const previousProperties = byAuthoredKey(previousSchema);\n const nextProperties = byAuthoredKey(nextSchema);\n for (const [authoredKey, previous] of previousProperties) {\n if (accountedFor.has(authoredKey)) {\n continue;\n }\n const next = nextProperties.get(authoredKey);\n if (next === undefined) {\n breakingChanges.push({\n code: \"propertyRemoved\",\n interfaceApiName,\n property: previous.apiName\n });\n continue;\n }\n if (previous.property.required && !next.property.required) {\n warnings.push({\n code: \"requirementRelaxed\",\n interfaceApiName,\n property: previous.apiName\n });\n }\n const previousConstraint = primaryKeyConstraintOf(previous.property);\n const nextConstraint = primaryKeyConstraintOf(next.property);\n if (previousConstraint !== nextConstraint && nextConstraint === \"NO_RESTRICTION\") {\n warnings.push({\n code: \"primaryKeyConstraintRelaxed\",\n interfaceApiName,\n property: previous.apiName,\n previousConstraint\n });\n }\n const previousNullability = nullabilityOf(previous.property);\n const nextNullability = nullabilityOf(next.property);\n if (!isDeepStrictEqual(previousNullability, nextNullability) && !tightensNullability(previousNullability, nextNullability)) {\n warnings.push({\n code: \"nullabilityRelaxed\",\n interfaceApiName,\n property: previous.apiName,\n previousNullability,\n nextNullability\n });\n }\n if (previous.property.valueType !== undefined && next.property.valueType === undefined) {\n warnings.push({\n code: \"valueTypeRemoved\",\n interfaceApiName,\n property: previous.apiName,\n previousValueType: previous.property.valueType\n });\n }\n validatePropertyDiff(interfaceApiName, previous, next, breakingChanges);\n }\n for (const [authoredKey, next] of nextProperties) {\n if (accountedFor.has(authoredKey) || previousProperties.has(authoredKey)) {\n continue;\n }\n if (next.property.required) {\n breakingChanges.push({\n code: \"requiredPropertyAdded\",\n interfaceApiName,\n property: next.apiName\n });\n }\n }\n}\n\n/** Reports what changed about a property the author kept. */\nfunction validatePropertyDiff(interfaceApiName, previous, next, breakingChanges) {\n const property = previous.apiName;\n\n // Ahead of the type check: when the binding itself was swapped, the types are incidental, and\n // reporting them would point the author at the wrong thing to restore.\n const previousDeclaration = declarationOf(previous.property);\n const nextDeclaration = declarationOf(next.property);\n if (previousDeclaration !== nextDeclaration) {\n breakingChanges.push({\n code: \"propertyDeclarationChanged\",\n interfaceApiName,\n property,\n previousDeclaration,\n nextDeclaration\n });\n return;\n }\n\n // Same authored key and same binding, but a different published name: the shared property type\n // behind it moved namespace.\n if (previous.apiName !== next.apiName) {\n breakingChanges.push({\n code: \"propertyNamespaceChanged\",\n interfaceApiName,\n previousApiName: previous.apiName,\n nextApiName: next.apiName\n });\n return;\n }\n\n // This is probably too strict; we might need to strip more things from the locked property\n // type to avoid false positives\n if (!isDeepStrictEqual(previous.property.type, next.property.type)) {\n breakingChanges.push({\n code: \"propertyTypeChanged\",\n interfaceApiName,\n property,\n previousType: previous.property.type,\n nextType: next.property.type\n });\n return;\n }\n if (!isDeepStrictEqual(previous.property.typeClasses, next.property.typeClasses)) {\n breakingChanges.push({\n code: \"propertyTypeClassesChanged\",\n interfaceApiName,\n property,\n previousTypeClasses: previous.property.typeClasses ?? [],\n nextTypeClasses: next.property.typeClasses ?? []\n });\n return;\n }\n const previousConstraint = primaryKeyConstraintOf(previous.property);\n const nextConstraint = primaryKeyConstraintOf(next.property);\n if (previousConstraint !== nextConstraint && nextConstraint !== \"NO_RESTRICTION\") {\n breakingChanges.push({\n code: \"primaryKeyConstraintChanged\",\n interfaceApiName,\n property,\n previousConstraint,\n nextConstraint\n });\n return;\n }\n const previousNullability = nullabilityOf(previous.property);\n const nextNullability = nullabilityOf(next.property);\n if (tightensNullability(previousNullability, nextNullability)) {\n breakingChanges.push({\n code: \"nullabilityTightened\",\n interfaceApiName,\n property,\n previousNullability,\n nextNullability\n });\n return;\n }\n const nextValueType = next.property.valueType;\n if (nextValueType !== undefined && !isDeepStrictEqual(previous.property.valueType, nextValueType)) {\n breakingChanges.push({\n code: \"valueTypeChanged\",\n interfaceApiName,\n property,\n previousValueType: previous.property.valueType,\n nextValueType\n });\n return;\n }\n if (!previous.property.required && next.property.required) {\n breakingChanges.push({\n code: \"propertyBecameRequired\",\n interfaceApiName,\n property\n });\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 * as fs from \"node:fs/promises\";\nimport { consola } from \"consola\";\nimport { describeBreakingChange, describeWarning } from \"./describeLockfileChange.js\";\nimport { censusOfSource, generateOntologySchemaLockfile } from \"./generateOntologySchemaLockfile.js\";\nimport { isEmptyLockfile, lockedInterfaceCount, serializeLockfile, staleInterfaces } from \"./OntologySchemaLockfile.js\";\nimport { parseLockfile } from \"./parseOntologySchemaLockfile.js\";\nimport { validateOntologySchemaLockfile } from \"./validateOntologySchemaLockfile.js\";\n/**\n * Checks the ontology's interface schema migrations against the persisted lockfile and brings\n * the lockfile up to date when `writeLocks` is set.\n *\n * Throws if the source contains a change that would be rejected at installation-time, or if the\n * lockfile is out of date and `writeLocks` was not passed.\n */\nexport async function reconcileOntologySchemaLockfile(options) {\n const {\n ontology,\n lockfilePath,\n writeLocks,\n assumeYes\n } = options;\n const expected = generateOntologySchemaLockfile(ontology);\n const census = censusOfSource(ontology);\n const persistedContents = await readIfExists(lockfilePath);\n if (persistedContents === undefined) {\n await reconcileMissingLockfile(expected, lockfilePath, writeLocks);\n return;\n }\n const persisted = parseLockfile(persistedContents, lockfilePath);\n const {\n breakingChanges,\n checkpoints,\n warnings\n } = validateOntologySchemaLockfile(persisted, expected, census);\n for (const warning of warnings) {\n consola.warn(describeWarning(warning));\n }\n if (breakingChanges.length > 0) {\n throw new Error(formatBreakingChanges(breakingChanges, lockfilePath));\n }\n if (!writeLocks) {\n const stale = staleInterfaces(persisted, expected);\n if (stale.length > 0) {\n throw new Error(formatStaleness(stale, lockfilePath));\n }\n consola.success(`Ontology schema lockfile ${lockfilePath} is up to date`);\n return;\n }\n if (checkpoints.length > 0 && !(await confirmCheckpoints(checkpoints, assumeYes))) {\n throw new Error(`Aborted: ${lockfilePath} was not updated, and no ontology was written.`);\n }\n await writeLockfile(lockfilePath, expected, persistedContents);\n}\nasync function reconcileMissingLockfile(expected, lockfilePath, writeLocks) {\n if (isEmptyLockfile(expected)) {\n // Nothing has opted into schema migrations, so there is no baseline worth recording. Creating\n // an empty lockfile here would force it on every consumer of maker.\n return;\n }\n if (!writeLocks) {\n const count = lockedInterfaceCount(expected);\n throw new Error(`${count} ${count === 1 ? \"interface is\" : \"interfaces are\"} opted into schema ` + `migrations, but there is no lockfile at ${lockfilePath} to check them against. Run maker ` + `again with --write-locks to create it, and commit the result.`);\n }\n await writeLockfile(lockfilePath, expected, undefined);\n}\nasync function confirmCheckpoints(checkpoints, assumeYes) {\n consola.warn(`Detected interface schema migration finalizations/deletions:\\n${formatCheckpoints(checkpoints)}`);\n if (assumeYes) {\n return true;\n }\n if (!process.stdin.isTTY) {\n throw new Error(\"Detected interface schema migration finalizations/deletions, but maker is not attached to a \" + \"terminal and cannot prompt. Re-run with --yes to accept them.\");\n }\n return await consola.prompt(\"Accept?\", {\n type: \"confirm\"\n });\n}\nfunction formatCheckpoints(checkpoints) {\n const lines = [];\n let currentInterfaceApiName;\n for (const checkpoint of checkpoints) {\n if (checkpoint.interfaceApiName !== currentInterfaceApiName) {\n currentInterfaceApiName = checkpoint.interfaceApiName;\n lines.push(`${currentInterfaceApiName}:`);\n }\n const verb = checkpoint.kind === \"finalized\" ? \"FINALIZE\" : \"DELETE\";\n lines.push(` ${verb} ${checkpoint.transitionId}`);\n }\n return lines.join(\"\\n\");\n}\nfunction formatStaleness(stale, lockfilePath) {\n return `Ontology schema lockfile ${lockfilePath} is out of date. These interfaces have changed since ` + `it was written:\\n${stale.map(apiName => ` ${apiName}`).join(\"\\n\")}\\n\\n` + `The changes are backwards-compatible, but the lockfile must record them before the ontology ` + `can be published. Run maker again with --write-locks.`;\n}\nfunction formatBreakingChanges(breakingChanges, lockfilePath) {\n return `Interface schema migrations are not backwards compatible with ${lockfilePath}:\\n\\n` + breakingChanges.map(breakingChange => `- ${describeBreakingChange(breakingChange)}`).join(\"\\n\\n\");\n}\nasync function writeLockfile(lockfilePath, lockfile, existingContents) {\n const serialized = serializeLockfile(lockfile);\n if (serialized === existingContents) {\n consola.success(`Ontology schema lockfile ${lockfilePath} is up to date`);\n return;\n }\n await fs.writeFile(lockfilePath, serialized);\n consola.success(`Wrote ontology schema lockfile ${lockfilePath}`);\n}\nasync function readIfExists(path) {\n try {\n return await fs.readFile(path, \"utf-8\");\n } catch (e) {\n if (e.code === \"ENOENT\") {\n return undefined;\n }\n throw e;\n }\n}","/*\n * Copyright 2024 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/promises\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { consola, LogLevels } from \"consola\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineOntology } from \"../api/defineOntology.js\";\nimport { DEFAULT_ONTOLOGY_SCHEMA_LOCKFILE_NAME } from \"../lockfile/OntologySchemaLockfile.js\";\nimport { reconcileOntologySchemaLockfile } from \"../lockfile/reconcileOntologySchemaLockfile.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 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\",\n type: \"string\",\n default: \"ontology.json\",\n coerce: path.resolve\n },\n apiNamespace: {\n describe: \"Api name prefix for namespaced ontology types\",\n type: \"string\",\n default: \"\"\n },\n snapshotDir: {\n alias: \"s\",\n describe: \"Snapshot directory\",\n type: \"string\",\n default: \"snapshots\",\n coerce: path.resolve\n },\n outputDir: {\n alias: \"d\",\n describe: \"Directory for generated ontology entities\",\n type: \"string\",\n coerce: path.resolve\n },\n valueTypesOutput: {\n describe: \"Value Type Output File\",\n type: \"string\",\n default: \"value-types.json\",\n coerce: path.resolve\n },\n dependencies: {\n describe: \"File to write dependencies to\",\n type: \"string\",\n coerce: path.resolve\n },\n generateCodeSnippets: {\n describe: \"Enable code snippet files creation\",\n type: \"boolean\",\n default: false\n },\n codeSnippetPackageName: {\n describe: \"The package name that will be displayed in the code snippets\",\n default: \"\",\n type: \"string\"\n },\n codeSnippetDir: {\n describe: \"Directory for generated code snippet files\",\n type: \"string\",\n default: \"./\",\n coerce: path.resolve\n },\n randomnessKey: {\n describe: \"Value used to assure uniqueness of entities\",\n type: \"string\"\n },\n lockfile: {\n describe: `Ontology schema lockfile path (default: ${DEFAULT_ONTOLOGY_SCHEMA_LOCKFILE_NAME} beside --input)`,\n type: \"string\",\n // No `default`: it depends on --input, which `coerce` cannot see. Resolved after parsing.\n coerce: path.resolve\n },\n writeLocks: {\n describe: \"Update the ontology schema lockfile instead of failing when it is out of date\",\n type: \"boolean\"\n // NB: no default since \"implied\" below\n },\n yes: {\n alias: \"y\",\n describe: \"Accept detected ontology schema migration finalizations/deletions without prompting\",\n type: \"boolean\"\n // NB: no default since \"implied\" below\n },\n verbose: {\n alias: \"v\",\n describe: \"Enable verbose logging: -v for debug, including stack traces on failure, -vv for trace\",\n type: \"boolean\",\n count: true\n }\n }).middleware(({\n verbose\n }) => {\n consola.level = logLevelFor(verbose);\n }, true)\n // --yes only answers the prompt that --write-locks can raise, so on its own it does nothing.\n .implies(\"yes\", \"writeLocks\")\n // Without this, the usage error that `implies` raises calls `process.exit` from inside the\n // library, which takes the whole host process with it.\n .fail((msg, err, usage) => {\n if (err) {\n throw err;\n }\n\n // Registering a failure handler suppresses yargs' showHelpOnFail behavior, so reinstate it.\n usage.showHelp(\"error\");\n throw new Error(msg);\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.generateCodeSnippets && (commandLineOpts.codeSnippetPackageName !== \"\" || commandLineOpts.codeSnippetDir !== path.resolve(\"./\"))) {\n consola.info(\"Package name and/or directory supplied for code snippets, but code snippet generation is false.\");\n }\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\n // The lockfile is a checked-in source artifact describing the ontology definition, not a build artifact\n // like `output`, so it belongs beside the definition rather than wherever maker was invoked.\n const lockfilePath = commandLineOpts.lockfile ?? path.join(path.dirname(commandLineOpts.input), DEFAULT_ONTOLOGY_SCHEMA_LOCKFILE_NAME);\n const ontologyIr = await loadOntology(commandLineOpts.input, apiNamespace, commandLineOpts.outputDir, commandLineOpts.dependencies, commandLineOpts.generateCodeSnippets, commandLineOpts.codeSnippetPackageName, commandLineOpts.codeSnippetDir, commandLineOpts.randomnessKey,\n // An ontology that fails lockfile checks would fail at installation-time, so the ontology-ir\n // should never reach disk at all.\n async ontology => await reconcileOntologySchemaLockfile({\n ontology,\n lockfilePath,\n writeLocks: commandLineOpts.writeLocks ?? false,\n assumeYes: commandLineOpts.yes ?? false\n }));\n consola.info(`Saving ontology to ${commandLineOpts.output}`);\n await fs.writeFile(commandLineOpts.output, JSON.stringify(ontologyIr, (key, value) => key === \"linkedInterfaces\" ? undefined : value, 2));\n // No point in generating block if there aren't any value types\n if (ontologyIr.valueTypes.valueTypes.length > 0 || ontologyIr.importedValueTypes.valueTypes.length > 0) {\n await fs.writeFile(commandLineOpts.valueTypesOutput, JSON.stringify(ontologyIr.valueTypes, null, 2));\n }\n}\nfunction logLevelFor(verbosity) {\n if (verbosity === 0) return LogLevels.info;\n if (verbosity === 1) return LogLevels.debug;\n return LogLevels.trace;\n}\nasync function loadOntology(input, apiNamespace, outputDir, dependencyFile, generateCodeSnippets, snippetPackageName, codeSnippetDir, randomnessKey, beforeWrite) {\n const q = await defineOntology(apiNamespace, async () => await import(pathToFileURL(input).href), outputDir, dependencyFile, generateCodeSnippets, snippetPackageName, codeSnippetDir, randomnessKey, beforeWrite);\n return q;\n}"]}
1
+ {"version":3,"sources":["../../src/api/action/ActionParameterType.ts","../../src/conversion/toMarketplace/convertActionParameters.ts","../../src/api/common/OntologyEntityTypeEnum.ts","../../src/conversion/toMarketplace/convertCardinality.ts","../../src/conversion/toMarketplace/convertLink.ts","../../src/util/ApiNameValidator.ts","../../src/api/cloneDefinition.ts","../../src/api/interface/InterfacePropertyType.ts","../../src/api/interface/getFlattenedInterfaceProperties.ts","../../src/api/properties/PropertyTypeType.ts","../../src/api/validateMetadataLengths.ts","../../src/api/defineObject.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/api/propertyConversionUtils.ts","../../src/conversion/toMarketplace/convertNullabilityToDataConstraint.ts","../../src/conversion/toMarketplace/convertReducers.ts","../../src/conversion/toConjure/distributeTypeHelper.ts","../../src/conversion/toMarketplace/convertMainValue.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts","../../src/conversion/toMarketplace/convertSpt.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.ts","../../src/conversion/toMarketplace/convertInterfacePropertyType.ts","../../src/conversion/toMarketplace/convertInterface.ts","../../src/conversion/toMarketplace/convertInterfaceSchemaMigrations.ts","../../src/conversion/toMarketplace/convertDatasourceDefinition.ts","../../src/conversion/toMarketplace/convertValueType.ts","../../src/conversion/toMarketplace/convertDataConstraintToDataConstraints.ts","../../src/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.ts","../../src/conversion/toMarketplace/convertValueTypeDataConstraints.ts","../../src/conversion/toMarketplace/convertObjectPropertyType.ts","../../src/conversion/toMarketplace/convertObject.ts","../../src/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.ts","../../src/conversion/toMarketplace/convertValueTypesToIr.ts","../../src/conversion/toMarketplace/convertOntologyToValueTypeIr.ts","../../src/conversion/toMarketplace/convertOntologyDefinition.ts","../../src/conversion/toMarketplace/getFormContentOrdering.ts","../../src/api/code-snippets/snippetTypes.ts","../../src/api/code-snippets/createCodeSnippets.ts","../../src/api/defineOntology.ts","../../src/api/addDependency.ts","../../src/api/object/objectPropertyHelpers.ts","../../src/api/defineAction.ts","../../src/api/namespace/combineApiNamespaceIfMissing.ts","../../src/api/defineCreateInterfaceLinkAction.ts","../../src/conversion/toMarketplace/convertMappingValue.ts","../../src/api/defineCreateInterfaceObjectAction.ts","../../src/api/defineCreateObjectAction.ts","../../src/api/defineCreateOrModifyObjectAction.ts","../../src/api/defineDeleteInterfaceLinkAction.ts","../../src/api/defineDeleteInterfaceObjectAction.ts","../../src/api/defineDeleteObjectAction.ts","../../src/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.ts","../../src/api/interface/describeInterfaceSchemaMigrationInstruction.ts","../../src/api/interface/validateInterfaceSchemaMigrations.ts","../../src/api/interface/validateSchemaMigrationsFamilyOptIn.ts","../../src/api/defineInterface.ts","../../src/api/defineInterfaceActionTypeConstraint.ts","../../src/api/defineInterfaceLinkConstraint.ts","../../src/api/defineLink.ts","../../src/api/defineModifyInterfaceObjectAction.ts","../../src/api/defineModifyObjectAction.ts","../../src/api/defineSpt.ts","../../src/api/defineValueType.ts","../../src/api/importOntologyEntity.ts","../../src/api/importSharedPropertyType.ts","../../src/api/wrapWithProxy.ts","../../src/lockfile/OntologySchemaLockfile.ts","../../src/lockfile/LockedPropertyType.ts","../../src/lockfile/describeLockfileChange.ts","../../src/lockfile/generateOntologySchemaLockfile.ts","../../src/lockfile/parseOntologySchemaLockfile.ts","../../src/lockfile/applyInterfaceSchemaTransition.ts","../../src/lockfile/validateOntologySchemaLockfile.ts","../../src/lockfile/reconcileOntologySchemaLockfile.ts","../../src/cli/main.ts"],"names":["OntologyEntityTypeEnum","invariant","apiName","interfaceSnippets","actionSnippets","objectSnippets","fs","consola","path","TYPESCRIPT_OSDK_SNIPPETS","Mustache","path2","fs2","path3","fs3","namespace","randomUUID","vt","isDeepStrictEqual","z","fs4","yargs","hideBin","path4","fs5","LogLevels","pathToFileURL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,SAAS,+BAA+B,IAAA,EAAM;AACnD,EAAA,OAAO,CAAC,SAAA,EAAW,aAAA,EAAe,SAAA,EAAW,eAAe,MAAA,EAAQ,UAAA,EAAY,QAAA,EAAU,YAAA,EAAc,UAAU,YAAA,EAAc,SAAA,EAAW,aAAA,EAAe,WAAA,EAAa,iBAAiB,SAAA,EAAW,aAAA,EAAe,UAAA,EAAY,cAAA,EAAgB,qBAAA,EAAuB,MAAA,EAAQ,UAAA,EAAY,qBAAA,EAAuB,mBAAmB,YAAA,EAAc,gBAAA,EAAkB,SAAA,EAAW,aAAA,EAAe,kBAAkB,oBAAA,EAAsB,wBAAA,EAA0B,4BAA4B,CAAA,CAAE,SAAS,IAAI,CAAA;AAC5e;;;ACJO,SAAS,wBAAwB,MAAA,EAAQ;AAC9C,EAAA,OAAO,MAAA,CAAO,WAAA,CAAA,CAAa,MAAA,CAAO,UAAA,IAAc,IAAI,GAAA,CAAI,CAAA,CAAA,KAAK,CAAC,CAAA,CAAE,EAAA,EAAI;AAAA,IAClE,IAAI,CAAA,CAAE,EAAA;AAAA,IACN,IAAA,EAAM,OAAO,CAAA,CAAE,IAAA,KAAS,QAAA,GAAW;AAAA,MACjC,MAAM,CAAA,CAAE,IAAA;AAAA,MACR,CAAC,CAAA,CAAE,IAAI,GAAG;AAAC,QACT,CAAA,CAAE,IAAA;AAAA,IACN,eAAA,EAAiB;AAAA,MACf,aAAa,CAAA,CAAE,WAAA;AAAA,MACf,WAAA,EAAa,EAAE,W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AA,IAAI,UAAA,CAAW,WAAW,UAAA,CAAW,MAAA,GAAS,KAAK,UAAA,CAAW,kBAAA,CAAmB,UAAA,CAAW,MAAA,GAAS,CAAA,EAAG;AACtG,IAAA,MAASA,cAAA,CAAA,SAAA,CAAU,gBAAgB,gBAAA,EAAkB,IAAA,CAAK,UAAU,UAAA,CAAW,UAAA,EAAY,IAAA,EAAM,CAAC,CAAC,CAAA;AAAA,EACrG;AACF;AACA,SAAS,YAAY,SAAA,EAAW;AAC9B,EAAA,IAAI,SAAA,KAAc,CAAA,EAAG,OAAOC,iBAAA,CAAU,IAAA;AACtC,EAAA,IAAI,SAAA,KAAc,CAAA,EAAG,OAAOA,iBAAA,CAAU,KAAA;AACtC,EAAA,OAAOA,iBAAA,CAAU,KAAA;AACnB;AACA,eAAe,YAAA,CAAa,OAAO,YAAA,EAAc,SAAA,EAAW,gBAAgB,oBAAA,EAAsB,kBAAA,EAAoB,cAAA,EAAgB,aAAA,EAAe,WAAA,EAAa;AAChK,EAAA,MAAM,IAAI,MAAM,cAAA,CAAe,YAAA,EAAc,YAAY,MAAM,OAAOC,iBAAA,CAAc,KAAK,CAAA,CAAE,OAAO,SAAA,EAAW,cAAA,EAAgB,sBAAsB,kBAAA,EAAoB,cAAA,EAAgB,eAAe,WAAW,CAAA;AACjN,EAAA,OAAO,CAAA;AACT","file":"index.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// FIXME: these should not use conjure types\n\nexport function isActionParameterTypePrimitive(type) {\n return [\"boolean\", \"booleanList\", \"integer\", \"integerList\", \"long\", \"longList\", \"double\", \"doubleList\", \"string\", \"stringList\", \"decimal\", \"decimalList\", \"timestamp\", \"timestampList\", \"geohash\", \"geohashList\", \"geoshape\", \"geoshapeList\", \"timeSeriesReference\", \"date\", \"dateList\", \"objectTypeReference\", \"objectReference\", \"attachment\", \"attachmentList\", \"marking\", \"markingList\", \"mediaReference\", \"mediaReferenceList\", \"geotimeSeriesReference\", \"geotimeSeriesReferenceList\"].includes(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\nexport function convertActionParameters(action) {\n return Object.fromEntries((action.parameters ?? []).map(p => [p.id, {\n id: p.id,\n type: typeof p.type === \"string\" ? {\n type: p.type,\n [p.type]: {}\n } : p.type,\n displayMetadata: {\n displayName: p.displayName,\n description: p.description ?? \"\",\n typeClasses: p.typeClasses ?? []\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\nexport let OntologyEntityTypeEnum = /*#__PURE__*/function (OntologyEntityTypeEnum) {\n OntologyEntityTypeEnum[\"OBJECT_TYPE\"] = \"OBJECT_TYPE\";\n OntologyEntityTypeEnum[\"LINK_TYPE\"] = \"LINK_TYPE\";\n OntologyEntityTypeEnum[\"INTERFACE_TYPE\"] = \"INTERFACE_TYPE\";\n OntologyEntityTypeEnum[\"SHARED_PROPERTY_TYPE\"] = \"SHARED_PROPERTY_TYPE\";\n OntologyEntityTypeEnum[\"ACTION_TYPE\"] = \"ACTION_TYPE\";\n OntologyEntityTypeEnum[\"VALUE_TYPE\"] = \"VALUE_TYPE\";\n return OntologyEntityTypeEnum;\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 invariant from \"tiny-invariant\";\nimport { OntologyEntityTypeEnum } from \"../../api/common/OntologyEntityTypeEnum.js\";\nimport { cleanAndValidateLinkTypeId, importedTypes, ontologyDefinition } from \"../../api/defineOntology.js\";\nimport { convertCardinality } from \"./convertCardinality.js\";\nexport function convertLink(linkType) {\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 definition = {\n type: \"oneToMany\",\n oneToMany: {\n cardinalityHint: convertCardinality(linkType.cardinality),\n manyToOneLinkMetadata: linkType.toMany.metadata,\n objectTypeRidManySide: toManyObjectApiName,\n objectTypeRidOneSide: oneObjectApiName,\n oneToManyLinkMetadata: linkType.one.metadata,\n oneSidePrimaryKeyToManySidePropertyMapping: [{\n from: {\n apiName: oneObject.primaryKeyPropertyApiName,\n object: oneObjectApiName\n },\n to: {\n apiName: linkType.manyForeignKeyProperty,\n object: toManyObjectApiName\n }\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 definition = {\n type: \"intermediary\",\n intermediary: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectApiName,\n objectTypeRidB: toManyObjectApiName,\n intermediaryObjectTypeRid: linkType.intermediaryObjectType.apiName,\n aToIntermediaryLinkTypeRid: cleanAndValidateLinkTypeId(linkType.many.linkToIntermediary.apiName),\n intermediaryToBLinkTypeRid: 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 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: manyObjectApiName,\n objectTypeRidB: toManyObjectApiName,\n peeringMetadata: undefined,\n objectTypeAPrimaryKeyPropertyMapping: [{\n from: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName\n },\n to: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName\n }\n }],\n objectTypeBPrimaryKeyPropertyMapping: [{\n from: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName\n },\n to: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName\n }\n }]\n }\n };\n datasource = {\n datasourceName: linkType.apiName,\n datasource: {\n type: \"dataset\",\n dataset: {\n datasetRid: \"link-\".concat(linkType.apiName),\n writebackDatasetRid: undefined,\n objectTypeAPrimaryKeyMapping: [{\n property: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName\n },\n column: resolvedColumnA\n }],\n objectTypeBPrimaryKeyMapping: [{\n property: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName\n },\n column: resolvedColumnB\n }]\n }\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: linkType.redacted\n };\n }\n return {\n linkType: {\n definition,\n ...(linkType.description !== undefined && {\n description: linkType.description\n }),\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: convertLinkStatus(linkType.status),\n redacted: linkType.redacted ?? false\n },\n datasources: datasource !== undefined ? [datasource] : [],\n entityMetadata: {\n arePatchesEnabled: linkType.editsEnabled ?? false\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 = ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName] ?? importedTypes[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) {\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 }\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 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\nconst RESERVED_KEYWORDS = new Set([\"ontology\", \"object\", \"property\", \"link\", \"relation\", \"rid\", \"primarykey\", \"typeid\", \"ontologyobject\"]);\nexport const OBJECT_API_NAME_PATTERN = /^(?=.{1,100}$)[a-zA-Z][a-zA-Z0-9]*(?:\\.[a-zA-Z0-9]+)*$/u;\nexport const API_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{0,99}$/u;\nexport const NAMESPACED_API_NAME_PATTERN = /^(?=.{1,100}$)[a-zA-Z][a-zA-Z0-9_]*(?:\\.[a-zA-Z0-9_]+)*$/u;\nexport function isValidApiName(apiName) {\n return API_NAME_PATTERN.test(apiName) && !RESERVED_KEYWORDS.has(apiName.toLowerCase());\n}\nexport function isValidObjectApiName(apiName) {\n return OBJECT_API_NAME_PATTERN.test(apiName) && !RESERVED_KEYWORDS.has(apiName.toLowerCase());\n}\nexport function isValidNamespacedApiName(apiName) {\n return NAMESPACED_API_NAME_PATTERN.test(apiName) && !RESERVED_KEYWORDS.has(apiName.toLowerCase());\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 * Shallow-clones a definition object, copying any array-valued properties\n * to prevent shared-array mutation bugs (e.g. when users pass the same\n * datasources constant to multiple defineObject calls).\n *\n * Does NOT deep-clone nested objects so that entity references (interfaces,\n * link types, etc.) preserve their identity for registry lookups.\n */\nexport function cloneDefinition(input) {\n const clone = {\n ...input\n };\n for (const key in clone) {\n if (Object.prototype.hasOwnProperty.call(clone, key) && Array.isArray(clone[key])) {\n clone[key] = [...clone[key]];\n }\n }\n return clone;\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 isInterfaceSharedPropertyType(interfacePropertyType) {\n return \"sharedPropertyType\" in interfacePropertyType;\n}\nexport function getInterfacePropertyTypeType(interfacePropertyType) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType.type : interfacePropertyType.type;\n}\n\n/**\n * Whether this property holds a list of its declared type rather than a single value.\n */\nexport function isInterfacePropertyArray(interfacePropertyType) {\n const {\n array\n } = isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType : interfacePropertyType;\n return array ?? false;\n}\n\n/**\n * The type classes this property carries, or `undefined` if it declares none.\n *\n * Type classes drive render hints like sorting and filtering, so they are part of what an\n * implementing object type has to satisfy rather than presentation-only metadata.\n */\nexport function interfacePropertyTypeClasses(interfacePropertyType) {\n const {\n typeClasses\n } = isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType : interfacePropertyType;\n return typeClasses;\n}\n\n/**\n * The value type this property is an instance of, or `undefined` if it is not.\n *\n * A value type carries its own constraints, which an implementing object type's data has to\n * satisfy, so the reference is part of the contract rather than metadata about it.\n */\nexport function interfacePropertyValueType(interfacePropertyType) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType.valueType : interfacePropertyType.valueType;\n}\n\n/** The nullability requirements for a marking property. */\nconst MARKING_NULLABILITY = {\n noNulls: true,\n noEmptyCollections: true\n};\n\n/** What this property constrains about nulls and empty collections, or `undefined` if it declares nothing. */\nexport function interfacePropertyNullability(interfacePropertyType) {\n const source = isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType : interfacePropertyType;\n if (typeof source.type === \"object\" && source.type.type === \"marking\") {\n return source.nullability ?? MARKING_NULLABILITY;\n }\n return source.nullability;\n}\nexport function interfacePropertyPrimaryKeyConstraint(interfacePropertyType) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? \"NO_RESTRICTION\" : interfacePropertyType.primaryKeyConstraint ?? \"NO_RESTRICTION\";\n}\n\n/**\n * Whether implementing object types must provide this property.\n */\nexport function isInterfacePropertyRequired(interfacePropertyType) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.required : interfacePropertyType.required ?? true;\n}\n\n/**\n * The name a property is keyed by on the wire.\n */\nexport function interfacePropertyWireApiName(interfacePropertyType, authoredApiName) {\n return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType.apiName : authoredApiName;\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 { interfacePropertyWireApiName } from \"./InterfacePropertyType.js\";\nexport function getFlattenedInterfaceProperties(interfaceType) {\n let properties = Object.fromEntries(Object.entries(interfaceType.propertiesV3).map(([key, value]) => [interfacePropertyWireApiName(value, key), value]));\n Object.entries(interfaceType.propertiesV2).forEach(([apiName, spt]) => {\n if (!(apiName in properties)) {\n properties[apiName] = spt;\n }\n });\n interfaceType.extendsInterfaces.forEach(ext => {\n properties = {\n ...getFlattenedInterfaceProperties(ext),\n ...properties\n };\n });\n return properties;\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 isPropertyTypeType(v) {\n return v === \"boolean\" || v === \"byte\" || v === \"date\" || v === \"decimal\" || v === \"double\" || v === \"float\" || v === \"geopoint\" || v === \"geoshape\" || v === \"integer\" || v === \"long\" || typeof v === \"object\" && v.type === \"marking\" || v === \"short\" || v === \"string\" || v === \"timestamp\";\n}\nexport function isExotic(type) {\n if (type === undefined) {\n return false;\n }\n if (typeof type === \"string\") {\n return [\"geopoint\", \"geoshape\", \"mediaReference\", \"geotimeSeries\"].includes(type);\n } else if (typeof type === \"object\" && type != null) {\n return type.type === \"marking\" || type.type === \"struct\" || type.type === \"string\" || type.type === \"decimal\" || type.type === \"vector\";\n }\n return false;\n}\nexport function isStruct(type) {\n return typeof type === \"object\" && type.type === \"struct\";\n}\nexport function isVector(type) {\n return typeof type === \"object\" && type.type === \"vector\";\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 invariant from \"tiny-invariant\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\n\n// Standard ontology metadata limits count UTF-8 bytes.\nconst ONTOLOGY_DISPLAY_NAME_LIMIT = 1_000;\nexport const OBJECT_PROPERTY_DISPLAY_NAME_LIMIT = 1_500;\nconst ONTOLOGY_DESCRIPTION_LIMIT = 10_000;\nexport const ACTION_DISPLAY_NAME_LIMIT = 2_000;\nexport const ACTION_DESCRIPTION_LIMIT = 15_000;\n\n// Value type limits count UTF-16 code units, like JavaScript String.length.\nexport const VALUE_TYPE_DISPLAY_NAME_LIMIT = 100;\nexport const VALUE_TYPE_DESCRIPTION_LIMIT = 500;\nconst encoder = new TextEncoder();\nexport function validateMetadataLength(value, field, context, limit, unit = \"UTF-8 bytes\") {\n if (value == null) {\n return;\n }\n const length = unit === \"UTF-8 bytes\" ? encoder.encode(value).length : value.length;\n !(length <= limit) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${context}: ${field} must be at most ${limit} ${unit} (got ${length})`) : invariant(false) : void 0;\n}\nexport function validateDisplayMetadataLengths(metadata, context, nameLimit = ONTOLOGY_DISPLAY_NAME_LIMIT, descriptionLimit = ONTOLOGY_DESCRIPTION_LIMIT) {\n for (const field of [\"displayName\", \"pluralDisplayName\", \"groupDisplayName\"]) {\n validateMetadataLength(metadata[field], field, context, nameLimit);\n }\n validateMetadataLength(metadata.description, \"description\", context, descriptionLimit);\n}\nexport function validateStructFieldMetadata(type, context) {\n if (!isStruct(type)) {\n return;\n }\n for (const [apiName, field] of Object.entries(type.structDefinition)) {\n const metadata = typeof field === \"object\" && \"fieldType\" in field ? field.displayMetadata : undefined;\n validateDisplayMetadataLengths(metadata ?? {\n displayName: apiName\n }, `${context}, struct field \"${apiName}\"`, OBJECT_PROPERTY_DISPLAY_NAME_LIMIT);\n }\n}","/*\n * Copyright 2024 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 { getObject } from \"../conversion/toMarketplace/convertLink.js\";\nimport { API_NAME_PATTERN, isValidApiName, isValidObjectApiName, OBJECT_API_NAME_PATTERN } from \"../util/ApiNameValidator.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology, withoutNamespace } from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { getInterfacePropertyTypeType, isInterfacePropertyRequired, isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nimport { isExotic, isStruct } from \"./properties/PropertyTypeType.js\";\nimport { OBJECT_PROPERTY_DISPLAY_NAME_LIMIT, validateDisplayMetadataLengths, validateStructFieldMetadata } from \"./validateMetadataLengths.js\";\n// From https://stackoverflow.com/a/79288714\nconst ISO_8601_DURATION = /^P(?!$)(?:(?:((?:\\d+Y)|(?:\\d+(?:\\.|,)\\d+Y$))?((?:\\d+M)|(?:\\d+(?:\\.|,)\\d+M$))?((?:\\d+D)|(?:\\d+(?:\\.|,)\\d+D$))?(T((?:\\d+H)|(?:\\d+(?:\\.|,)\\d+H$))?((?:\\d+M)|(?:\\d+(?:\\.|,)\\d+M$))?((?:\\d+S)|(?:\\d+(?:\\.|,)\\d+S$))?)?)|(?:\\d+(?:(?:\\.|,)\\d+)?W))$/u;\n\n// ISO 8601 date and time format (YYYY-MM-DDThh:mm:ss.sssZ)\nconst ISO_8601_DATETIME = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})?)?$/u;\nexport function defineObject(objectDefInput) {\n const objectDef = cloneDefinition(objectDefInput);\n const apiName = namespace + objectDef.apiName;\n const propertyApiNames = objectDef.properties ? Object.keys(objectDef.properties) : [];\n if (ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][apiName] !== undefined) {\n throw new Error(`Object type with apiName ${objectDef.apiName} is already defined`);\n }\n !isValidObjectApiName(objectDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${objectDef.apiName}. API names must match the regex ${OBJECT_API_NAME_PATTERN}.`) : invariant(false) : void 0;\n const propertyBySharedPropertyType = new Map();\n propertyApiNames.forEach(apiName => {\n !isValidApiName(apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${apiName} for property on object ${objectDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`) : invariant(false) : void 0;\n !(objectDef.properties?.[apiName]?.includeEmptyBackingMediaSet !== true || objectDef.properties[apiName].type === \"mediaReference\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property ${apiName} on object ${objectDef.apiName} can only use includeEmptyBackingMediaSet when its type is mediaReference`) : invariant(false) : void 0;\n const sharedPropertyType = objectDef.properties?.[apiName]?.sharedPropertyType;\n if (sharedPropertyType !== undefined) {\n const previousProperty = propertyBySharedPropertyType.get(sharedPropertyType.apiName);\n !(previousProperty === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type \"${sharedPropertyType.apiName}\" cannot back both \"${previousProperty}\" and \"${apiName}\" on object \"${objectDef.apiName}\". A shared property type can only back one property per object.`) : invariant(false) : void 0;\n propertyBySharedPropertyType.set(sharedPropertyType.apiName, apiName);\n }\n });\n !propertyApiNames.includes(objectDef.titlePropertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Title property ${objectDef.titlePropertyApiName} is not defined on object ${objectDef.apiName}`) : invariant(false) : void 0;\n !propertyApiNames.includes(objectDef.primaryKeyPropertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} does not exist on object ${objectDef.apiName}`) : invariant(false) : void 0;\n !!objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.editOnly ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} on object ${objectDef.apiName} cannot be edit-only`) : invariant(false) : void 0;\n if (objectDef.includeEmptyBackingDatasource && objectDef.datasources) {\n const nonDatasetDatasources = objectDef.datasources.filter(ds => ds.type !== \"dataset\");\n !(nonDatasetDatasources.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object type \"${objectDef.apiName}\" has non-dataset datasources (${nonDatasetDatasources.map(ds => ds.type).join(\", \")}) and cannot use includeEmptyBackingDatasource. ` + `Empty backing datasources are only supported for object types with dataset datasources.`) : invariant(false) : void 0;\n }\n const retentionPeriods = (objectDef.datasources ?? []).filter(ds => ds.type === \"stream\").map(ds => ds.retentionPeriod);\n retentionPeriods.forEach(retentionPeriod => {\n !(retentionPeriod === undefined || ISO_8601_DURATION.test(retentionPeriod)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Retention period \"${retentionPeriod}\" on object \"${objectDef.apiName}\" is not a valid ISO 8601 duration string`) : invariant(false) : void 0;\n });\n const baseDatasources = (objectDef.datasources ?? []).filter(ds => [\"dataset\", \"stream\", \"restrictedView\"].includes(ds.type));\n !(baseDatasources.length <= 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object ${objectDef.apiName} has more than one base datasource (got: [${baseDatasources.map(ds => ds.type).join(\", \")}])`) : invariant(false) : void 0;\n const derivedDatasources = (objectDef.datasources ?? []).filter(ds => ds.type === \"derived\");\n if (derivedDatasources.length > 0) {\n derivedDatasources.forEach(ds => validateDerivedDatasource(objectDef, ds));\n }\n\n // Validate property statuses match the object status.\n // An experimental object can only have experimental properties.\n // A deprecated object can only have deprecated properties.\n // An example object can only have example properties.\n // There is no restriction on property statuses of an active object.\n const objectStatusType = getStatusType(objectDef.status);\n if (objectStatusType === \"experimental\" || objectStatusType === \"deprecated\" || objectStatusType === \"example\") {\n const mismatchedProperties = [];\n Object.entries(objectDef.properties ?? {}).forEach(([apiName, property]) => {\n if (property.status !== undefined) {\n const propertyStatusType = getStatusType(property.status);\n if (propertyStatusType !== objectStatusType) {\n mismatchedProperties.push(apiName);\n }\n }\n });\n !(mismatchedProperties.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object \"${objectDef.apiName}\" has \"${objectStatusType}\" status, but the following properties have a different status: ${mismatchedProperties.join(\", \")}`) : invariant(false) : void 0;\n }\n\n // Validate deprecated status deadline is in ISO 8601 format\n if (objectDef.status && typeof objectDef.status === \"object\" && objectDef.status.type === \"deprecated\") {\n const deadline = objectDef.status.deadline;\n !(deadline !== undefined && ISO_8601_DATETIME.test(deadline)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Deprecated status deadline \"${deadline}\" on object \"${objectDef.apiName}\" is not a valid ISO 8601 datetime string`) : invariant(false) : void 0;\n }\n const titleProp = objectDef.properties?.[objectDef.titlePropertyApiName]?.type;\n !(!isExotic(titleProp) || isStruct(titleProp) && titleProp.mainValue && !isExotic(titleProp.mainValue.type)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Title property ${objectDef.titlePropertyApiName} must be a primitive type`) : invariant(false) : void 0;\n !!isExotic(objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Primary key property ${objectDef.primaryKeyPropertyApiName} can only be primitive types`) : invariant(false) : void 0;\n objectDef.implementsInterfaces?.forEach(interfaceImpl => {\n const allInterfaceProperties = getFlattenedInterfaceProperties(interfaceImpl.implements);\n const nonExistentInterfaceProperties = interfaceImpl.propertyMapping.map(val => val.interfaceProperty).filter(interfaceProperty => allInterfaceProperties[addNamespaceIfNone(interfaceProperty)] === undefined && allInterfaceProperties[withoutNamespace(interfaceProperty)] === undefined).map(interfaceProp => ({\n type: \"invalid\",\n reason: `Interface property ${interfaceProp} referenced in ${objectDef.apiName} object does not exist`\n }));\n const interfaceToObjectProperties = Object.fromEntries(interfaceImpl.propertyMapping.map(mapping => {\n const namespacedInterfaceProperty = addNamespaceIfNone(mapping.interfaceProperty);\n const interfaceProperty = allInterfaceProperties[namespacedInterfaceProperty] !== undefined ? namespacedInterfaceProperty : withoutNamespace(mapping.interfaceProperty);\n return [interfaceProperty, mapping.mapsTo];\n }));\n const validateProperty = interfaceProp => {\n const apiName = isInterfaceSharedPropertyType(interfaceProp[1]) ? interfaceProp[1].sharedPropertyType.apiName : interfaceProp[0];\n if (apiName in interfaceToObjectProperties) {\n return validateInterfaceImplProperty(interfaceProp[1], apiName, interfaceToObjectProperties[apiName], objectDef);\n }\n if (!isInterfacePropertyRequired(interfaceProp[1])) {\n return {\n type: \"valid\"\n };\n }\n return {\n type: \"invalid\",\n reason: `Interface spt ${apiName} not implemented by ${objectDef.apiName} object definition`\n };\n };\n const validations = Object.entries(getFlattenedInterfaceProperties(interfaceImpl.implements)).map(validateProperty);\n const allFailedValidations = validations.concat(nonExistentInterfaceProperties).filter(val => val.type === \"invalid\");\n !(allFailedValidations.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"\\n\" + allFailedValidations.map(formatValidationErrors).join(\"\\n\")) : invariant(false) : void 0;\n });\n const flattenedProperties = Object.entries(objectDef.properties ?? {}).map(([apiName, property]) => convertUserObjectPropertyType(apiName, property));\n const finalObject = {\n ...objectDef,\n apiName,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n properties: flattenedProperties\n };\n const context = `Object type \"${apiName}\"`;\n validateDisplayMetadataLengths(finalObject, context);\n for (const property of flattenedProperties) {\n const propertyContext = `${context}, property \"${property.apiName}\"`;\n validateDisplayMetadataLengths(property, propertyContext, OBJECT_PROPERTY_DISPLAY_NAME_LIMIT);\n validateStructFieldMetadata(property.type, propertyContext);\n }\n updateOntology(finalObject);\n objectDef.apiName = apiName;\n return objectDef;\n}\nfunction formatValidationErrors(error) {\n return `Ontology Definition Error: ${error.reason}\\n`;\n}\n\n// Validate that the object and the interface property match up\nfunction validateInterfaceImplProperty(type, apiName, mappedObjectProp, object) {\n const objProp = object.properties?.[mappedObjectProp];\n if (objProp === undefined) {\n return {\n type: \"invalid\",\n reason: `Object property mapped to interface does not exist. Object Property Mapped: ${mappedObjectProp}`\n };\n }\n const propertyType = getInterfacePropertyTypeType(type);\n if (JSON.stringify(propertyType) !== JSON.stringify(objProp?.type)) {\n return {\n type: \"invalid\",\n reason: `Object property type does not match the interface property it is mapped to. Interface Property: ${apiName}, objectProperty: ${mappedObjectProp}`\n };\n }\n return {\n type: \"valid\"\n };\n}\nexport function uppercaseFirstLetter(s) {\n return s === undefined || s == null ? \"\" : s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n// TODO: edge cases\nexport function convertToPluralDisplayName(s) {\n return s === undefined || s == null ? \"\" : s.endsWith(\"s\") ? uppercaseFirstLetter(s) : uppercaseFirstLetter(s) + \"s\";\n}\nfunction convertUserObjectPropertyType(apiName, property) {\n // fill in missing fields to be used by actions\n property.displayName = property.displayName ?? uppercaseFirstLetter(apiName);\n return {\n ...property,\n apiName,\n displayName: property.displayName ?? uppercaseFirstLetter(apiName),\n type: property.type\n };\n}\nfunction validateDerivedDatasource(objectDef, datasource) {\n // there should be at least one link\n !(datasource.linkDefinition.length > 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Derived datasource for object '${objectDef.apiName}' must have at least one link.`) : invariant(false) : void 0;\n\n // all of the links references should exist\n datasource.linkDefinition.forEach(link => {\n const linkApiName = link.linkType.apiName;\n !(ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE][linkApiName] !== undefined || importedTypes[OntologyEntityTypeEnum.LINK_TYPE][linkApiName] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Link type '${linkApiName}' used in derived datasource for object '${objectDef.apiName}' is not defined.`) : invariant(false) : void 0;\n });\n\n // all of the properties references on the source object should exist\n Object.keys(datasource.propertyMapping).forEach(prop => {\n !(objectDef.properties?.[prop] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${prop}' used in derived datasource for object '${objectDef.apiName}' is not defined.`) : invariant(false) : void 0;\n });\n const isLinkedProperties = typeof Object.values(datasource.propertyMapping)[0] === \"string\";\n if (isLinkedProperties) {\n validateLinkedProperties(datasource, objectDef);\n } else {\n validateAggregations(datasource, objectDef);\n }\n}\n\n/**\n * Gets properties for validation, handling self-referential links where\n * the target object is the same as the object being defined (not yet in registry).\n */\nfunction getPropertiesForValidation(linkObject, objectDef) {\n const targetApiName = typeof linkObject === \"string\" ? linkObject : linkObject.apiName;\n const selfApiName = namespace + objectDef.apiName;\n\n // Self-referential: use objectDef directly (not yet in registry)\n if (targetApiName === selfApiName) {\n return {\n apiName: selfApiName,\n hasProperty: propName => objectDef.properties?.[propName] !== undefined\n };\n }\n\n // Non-self-referential: look up from registry\n const {\n apiName,\n object\n } = getObject(linkObject);\n return {\n apiName,\n hasProperty: propName => object.properties?.find(p => p.apiName === propName) !== undefined\n };\n}\nfunction validateLinkedProperties(datasource, objectDef) {\n const foreignProperties = Object.values(datasource.propertyMapping);\n // the foreign property must exist in the final object in the link chain\n const targetObject = datasource.linkDefinition.at(-1).linkType.toMany.object;\n const {\n apiName,\n hasProperty\n } = getPropertiesForValidation(targetObject, objectDef);\n foreignProperties.forEach(prop => {\n !hasProperty(prop) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${prop}' on object '${apiName}' is not defined`) : invariant(false) : void 0;\n });\n}\nfunction validateAggregations(datasource, objectDef) {\n const props = datasource.propertyMapping;\n Object.entries(props).forEach(([propName, agg]) => {\n // TODO(dpaquin): check that the property type matches the foreign property type,\n // for collectList/collectSet and maybe min/max too?\n const property = objectDef.properties[propName];\n switch (agg.type) {\n case \"collectList\":\n case \"collectSet\":\n // property's type is collectible\n !isCollectible(property) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${propName}' on object '${objectDef.apiName}' is not collectible`) : invariant(false) : void 0;\n // limit <= 100\n !(agg.limit <= 100) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `[Error] Limit for collection '${propName}' on object '${objectDef.apiName}' is greater than 100`) : invariant(false) : void 0;\n break;\n case \"avg\":\n case \"sum\":\n // property's type is numeric\n !isNumeric(property.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${propName}' on object '${objectDef.apiName}' is not numeric`) : invariant(false) : void 0;\n break;\n case \"min\":\n case \"max\":\n case \"approximateCardinality\":\n case \"exactCardinality\":\n // property's type is primitive\n !isPrimitive(property.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${propName}' on object '${objectDef.apiName}' is not primitive`) : invariant(false) : void 0;\n break;\n default:\n break;\n }\n\n // if a foreign property is referenced, it must exist in the final object\n if (agg.type !== \"count\") {\n const foreignProperty = agg.property;\n const targetObject = datasource.linkDefinition.at(-1).linkType.toMany.object;\n const {\n apiName,\n hasProperty\n } = getPropertiesForValidation(targetObject, objectDef);\n !hasProperty(foreignProperty) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${foreignProperty}' on object '${apiName}' is not defined`) : invariant(false) : void 0;\n }\n });\n}\nfunction isCollectible(property) {\n if (!(property.array ?? false)) {\n return false;\n }\n const typeType = typeof property.type === \"string\" ? property.type : property.type.type;\n return [\"boolean\", \"byte\", \"date\", \"double\", \"float\", \"geohash\", \"geoshape\", \"integer\", \"long\", \"mediaReference\", \"short\", \"string\", \"struct\", \"timestamp\"].includes(typeType);\n}\nfunction isNumeric(type) {\n const typeType = typeof type === \"string\" ? type : type.type;\n return [\"byte\", \"double\", \"float\", \"integer\", \"long\", \"short\"].includes(typeType);\n}\nfunction isPrimitive(type) {\n const typeType = typeof type === \"string\" ? type : type.type;\n return [\"boolean\", \"byte\", \"date\", \"double\", \"float\", \"integer\", \"long\", \"short\", \"string\", \"timestamp\"].includes(typeType);\n}\nfunction getStatusType(status) {\n if (status === undefined) {\n return \"active\";\n }\n if (typeof status === \"string\") {\n return status;\n }\n return status.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 { uppercaseFirstLetter } from \"../../api/defineObject.js\";\nexport function convertActionSections(action) {\n return Object.fromEntries(Object.entries(action.sections ?? {}).map(([sectionId, section]) => [sectionId, {\n id: 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 \"../../api/defineOntology.js\";\nimport { convertConditionDefinition } from \"./convertConditionDefinition.js\";\nexport function convertActionParameterConditionalOverride(override, validation, 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)\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 { extractAllowedValues, renderHintFromBaseType } from \"../../api/defineOntology.js\";\nimport { convertActionParameterConditionalOverride } from \"./convertActionParameterConditionalOverride.js\";\nimport { convertActionVisibility } from \"./convertActionVisibility.js\";\nimport { convertSectionConditionalOverride } from \"./convertSectionConditionalOverride.js\";\nexport function convertActionValidation(action) {\n return {\n actionTypeLevelValidation: {\n rules: Object.fromEntries((action.validation ?? [{\n condition: {\n type: \"true\",\n true: {}\n },\n displayMetadata: {\n failureMessage: \"\",\n typeClasses: []\n }\n }]).map((rule, idx) => [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),\n required: convertParameterRequirementConstraint(p.validation.required)\n }\n },\n conditionalOverrides: p.validation.conditionalOverrides?.map(override => convertActionParameterConditionalOverride(override, p.validation, 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 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 2024 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 { isVector } from \"./properties/PropertyTypeType.js\";\nexport const defaultTypeClasses = [{\n kind: \"render_hint\",\n name: \"SELECTABLE\"\n}, {\n kind: \"render_hint\",\n name: \"SORTABLE\"\n}];\n\n// ExperimentalTimeDependentV1 and Attachment types should be included here once supported\nexport function shouldNotHaveRenderHints(type) {\n return [\"struct\", \"geoshape\", \"mediaReference\", \"geotimeSeries\", \"attachment\", \"vector\"].includes(getPropertyTypeName(type));\n}\nexport function hasRenderHints(typeClasses) {\n return (typeClasses ?? []).some(tc => tc.kind.toLowerCase() === \"render_hint\");\n}\nexport function getPropertyTypeName(type) {\n return typeof type === \"object\" ? type.type : type;\n}\nexport function validateVectorProperty(apiName, type, array) {\n if (!isVector(type)) {\n return;\n }\n !!array ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Vector property '${apiName}' cannot be an array`) : invariant(false) : void 0;\n !(Number.isInteger(type.dimension) && type.dimension >= 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Vector property '${apiName}' must have an integer 'dimension' of at least 1, but got ${type.dimension}`) : invariant(false) : void 0;\n}\nexport function shouldBeIndexedForSearch(type) {\n const typeName = getPropertyTypeName(type);\n return ![\"attachment\"].includes(getPropertyTypeName(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 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 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 invariant from \"tiny-invariant\";\nimport { isStruct } from \"../../api/properties/PropertyTypeType.js\";\nexport function convertReducers(type, apiName, reducers, sharedPropertyType) {\n reducers?.forEach(reducer => {\n if (reducer.structField) {\n !(isStruct(type) && Object.keys(type.structDefinition).includes(reducer.structField)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Reducer structField ${reducer.structField} does not exist in struct definition`) : invariant(false) : void 0;\n }\n });\n if (sharedPropertyType) {\n return mapReducers(sharedPropertyType.apiName, sharedPropertyType.reducers);\n } else {\n return mapReducers(apiName, reducers);\n }\n}\nexport function mapReducers(apiName, reducers) {\n return reducers?.map(reducer => {\n switch (reducer.direction) {\n case \"ascending\":\n return {\n direction: \"ASCENDING_NULLS_LAST\",\n structApiName: reducer.structField ? apiName : undefined,\n fieldApiName: reducer.structField\n };\n case \"descending\":\n return {\n direction: \"DESCENDING_NULLS_LAST\",\n structApiName: reducer.structField ? apiName : undefined,\n fieldApiName: reducer.structField\n };\n default:\n {\n throw new Error(`Unsupported reducer direction: ${reducer.direction}`);\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\nexport function distributeTypeHelper(type) {\n return {\n type,\n [type]: {}\n }; // any cast to match conditional return type\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 { isStruct } from \"../../api/properties/PropertyTypeType.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertMainValue(type, apiName, sharedPropertyType) {\n if (sharedPropertyType && isStruct(sharedPropertyType.type) && sharedPropertyType.type.mainValue) {\n return {\n fieldApiNames: Array.isArray(sharedPropertyType.type.mainValue.fields) ? sharedPropertyType.type.mainValue.fields : [sharedPropertyType.type.mainValue.fields],\n structApiName: sharedPropertyType.apiName,\n type: propertyTypeTypeToOntologyIrType(sharedPropertyType.type.mainValue.type)\n };\n }\n if (isStruct(type) && type.mainValue) {\n return {\n fieldApiNames: Array.isArray(type.mainValue.fields) ? type.mainValue.fields : [type.mainValue.fields],\n structApiName: apiName,\n type: propertyTypeTypeToOntologyIrType(type.mainValue.type)\n };\n }\n return undefined;\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\";\nimport { convertMainValue } from \"./convertMainValue.js\";\nexport function propertyTypeTypeToOntologyIrType(type, apiName, sharedPropertyType) {\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 apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition)\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 apiName: key,\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition.fieldType),\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 apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition)\n };\n }\n }\n structFields.push(field);\n }\n return {\n type: \"struct\",\n struct: {\n structFields,\n mainValue: convertMainValue(type, apiName, sharedPropertyType)\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 supportsPhonetic: type.supportsPhonetic\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 typeof type === \"object\" && type.type === \"vector\":\n return {\n type: \"vector\",\n vector: {\n dimension: type.dimension,\n supportsSearchWith: [type.supportsSearchWith],\n embeddingModel: type.embeddingModel,\n quantization: type.quantization\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 { shouldBeIndexedForSearch, validateVectorProperty } from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertReducers } from \"./convertReducers.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertSpt({\n type,\n array,\n reducers,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n aliases,\n valueType,\n nullability,\n baseFormatter\n}) {\n const dataConstraint = convertNullabilityToDataConstraint({\n type,\n nullability\n });\n validateVectorProperty(apiName, type, array);\n return {\n 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, apiName),\n reducers: convertReducers(type, apiName, reducers)\n }\n } : propertyTypeTypeToOntologyIrType(type, apiName),\n aliases: aliases ?? [],\n baseFormatter,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: shouldBeIndexedForSearch(type),\n typeClasses: typeClasses ?? [],\n valueType: valueType === undefined ? undefined : {\n apiName: valueType.apiName,\n version: valueType.version,\n packageNamespace: valueType.packageNamespace,\n displayMetadata: valueType.displayMetadata\n }\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) {\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 apiName: key,\n displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition),\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 fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition.fieldType),\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 displayMetadata: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition),\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 supportsPhonetic: type.supportsPhonetic\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 typeof type === \"object\" && type.type === \"vector\":\n return {\n type: \"vector\",\n vector: {\n dimension: type.dimension,\n supportsSearchWith: [type.supportsSearchWith],\n embeddingModel: type.embeddingModel,\n quantization: type.quantization\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 { interfacePropertyWireApiName, isInterfacePropertyRequired, isInterfaceSharedPropertyType } from \"../../api/interface/InterfacePropertyType.js\";\nimport { shouldBeIndexedForSearch, validateVectorProperty } from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nimport { propertyTypeTypeToOntologyIrInterfaceType } from \"./propertyTypeTypeToOntologyIrInterfaceType.js\";\nexport function convertInterfaceProperty(prop, apiName) {\n if (isInterfaceSharedPropertyType(prop)) {\n return [interfacePropertyWireApiName(prop, apiName), {\n type: \"sharedPropertyBasedPropertyType\",\n sharedPropertyBasedPropertyType: {\n requireImplementation: isInterfacePropertyRequired(prop),\n sharedPropertyType: convertSpt(prop.sharedPropertyType)\n }\n }];\n } else {\n validateVectorProperty(apiName, prop.type, prop.array);\n return [apiName, {\n type: \"interfaceDefinedPropertyType\",\n interfaceDefinedPropertyType: {\n apiName: 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)\n }\n } : propertyTypeTypeToOntologyIrInterfaceType(prop.type),\n constraints: {\n primaryKeyConstraint: prop.primaryKeyConstraint ?? \"NO_RESTRICTION\",\n requireImplementation: isInterfacePropertyRequired(prop),\n indexedForSearch: shouldBeIndexedForSearch(prop.type),\n typeClasses: prop.typeClasses ?? [],\n dataConstraints: convertNullabilityToDataConstraint({\n type: prop.type,\n nullability: prop.nullability\n }),\n valueType: prop.valueType ? {\n apiName: prop.valueType.apiName,\n version: prop.valueType.version,\n packageNamespace: prop.valueType.packageNamespace,\n displayMetadata: prop.valueType.displayMetadata\n } : undefined\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 { convertInterfaceProperty } from \"./convertInterfacePropertyType.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nexport function convertInterface(interfaceType) {\n const {\n __type,\n schemaMigrations,\n ...other\n } = interfaceType;\n return {\n ...other,\n // schema migrations travel in their own block data section rather than on the interface type\n // directly; we only use the declared object to determine if the IT is opted in,\n // but exclude the migrations themselves from the IT definition\n ...(schemaMigrations !== undefined ? {\n schemaMigrationsEnabled: true\n } : {}),\n propertiesV2: Object.fromEntries(Object.values(interfaceType.propertiesV2).map(spt => [spt.sharedPropertyType.apiName, {\n required: spt.required,\n sharedPropertyType: convertSpt(spt.sharedPropertyType)\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 extendsInterfaces: interfaceType.extendsInterfaces.map(i => i.apiName),\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))),\n extendsInterfacesMetadata: interfaceType.extendsInterfaces.map(i => convertInterface(i))\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 { interfacePropertyWireApiName } from \"../../api/interface/InterfacePropertyType.js\";\nexport function convertInterfaceSchemaMigrations(interfaceType) {\n const {\n schemaMigrations,\n propertiesV3\n } = interfaceType;\n if (schemaMigrations === undefined) {\n return undefined;\n }\n const schemaTransitions = Object.fromEntries(schemaMigrations.transitions.map(transition => [transition.id, {\n id: transition.id,\n title: transition.title,\n description: transition.description,\n gracePeriod: convertInterfaceSchemaGracePeriod(transition.gracePeriod),\n migrations: transition.instructions.map(instruction => convertInstruction(instruction, propertiesV3))\n }]));\n return {\n schemaTransitions\n };\n}\nexport function convertInterfaceSchemaGracePeriod(gracePeriod) {\n switch (gracePeriod.type) {\n case \"afterInstall\":\n return {\n type: \"daysAfterActivation\",\n daysAfterActivation: gracePeriod.days\n };\n case \"deadline\":\n // Normalize deadline format to match Java (strip .000 milliseconds)\n return {\n type: \"deadline\",\n deadline: gracePeriod.deadline.replace(/\\.000Z$/u, \"Z\")\n };\n default:\n {\n const unhandled = gracePeriod;\n throw new Error(`Unknown schema migration grace period type: ${unhandled.type}`);\n }\n }\n}\nfunction convertInstruction(instruction, propertiesV3) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n return {\n type: \"addRequiredProperty\",\n addRequiredProperty: {\n // Ontology-ir types this as an API name despite the field name\n propertyTypeRid: interfacePropertyWireApiName(propertiesV3[instruction.property], instruction.property)\n }\n };\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.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 invariant from \"tiny-invariant\";\nexport function convertDatasourceDefinition(objectType, properties) {\n const baseDatasource = objectType.datasources?.find(ds => [\"dataset\", \"stream\", \"restrictedView\", \"direct\"].includes(ds.type));\n switch (baseDatasource?.type) {\n case \"stream\":\n const window = baseDatasource.retentionPeriod;\n const retentionPolicy = window ? {\n type: \"time\",\n time: {\n window\n }\n } : {\n type: \"none\",\n none: {}\n };\n const propertyMapping = Object.fromEntries(properties.map(prop => [prop.apiName, prop.apiName]));\n return {\n type: \"streamV2\",\n streamV2: {\n streamLocator: objectType.apiName,\n propertyMapping,\n retentionPolicy,\n propertySecurityGroups: undefined\n }\n };\n case \"restrictedView\":\n return {\n type: \"restrictedViewV2\",\n restrictedViewV2: {\n restrictedViewRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties)\n }\n };\n case \"derived\":\n return {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties)\n }\n };\n case \"direct\":\n return {\n type: \"direct\",\n direct: {\n directSourceRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties),\n propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName)\n }\n };\n case \"dataset\":\n default:\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: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties),\n branchId: \"master\",\n propertySecurityGroups: convertPropertySecurityGroups(baseDatasource, properties, objectType.primaryKeyPropertyApiName)\n }\n };\n }\n return {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties)\n }\n };\n }\n}\nfunction convertPropertySecurityGroups(ds, properties, primaryKeyPropertyApiName) {\n if (!ds || !(\"objectSecurityPolicy\" in ds) && !(\"propertySecurityGroups\" in ds)) {\n return {\n groups: [{\n properties: properties.map(prop => prop.apiName),\n rid: \"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 assumedMarkingsV2: {},\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 usedProperties = new Set();\n ds.propertySecurityGroups?.forEach(psg => {\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 !!usedProperties.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 usedProperties.add(propertyName);\n });\n });\n const objectSecurityPolicyGroup = {\n rid: ds.objectSecurityPolicy?.name || \"defaultObjectSecurityPolicy\",\n security: {\n type: \"granular\",\n granular: convertGranularPolicy(ds.objectSecurityPolicy?.granularPolicy, ds.objectSecurityPolicy?.appliedMarkings, ds.objectSecurityPolicy?.assumedMarkings)\n },\n type: {\n type: \"primaryKey\",\n primaryKey: {}\n },\n properties: properties.filter(prop => !usedProperties.has(prop.apiName)).map(prop => prop.apiName)\n };\n return {\n groups: [objectSecurityPolicyGroup, ...(ds.propertySecurityGroups?.map(psg => ({\n rid: psg.name,\n security: {\n type: \"granular\",\n granular: convertGranularPolicy(psg.granularPolicy, psg.appliedMarkings, psg.assumedMarkings)\n },\n type: {\n type: \"property\",\n property: {\n name: psg.name\n }\n },\n properties: psg.properties ?? []\n })) ?? [])]\n };\n}\nfunction convertGranularPolicy(granularPolicy, appliedMarkings, assumedMarkings) {\n return {\n viewPolicy: {\n granularPolicyCondition: granularPolicy ? convertSecurityCondition(granularPolicy) : {\n type: \"and\",\n and: {\n conditions: []\n }\n },\n additionalMandatory: {\n markings: appliedMarkings ?? {},\n assumedMarkings: [],\n assumedMarkingsV2: assumedMarkings ?? {}\n }\n }\n };\n}\nfunction convertSecurityCondition(condition) {\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))\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 => convertSecurityCondition(c))\n }\n };\n } else {\n return condition;\n }\n case \"markingProperty\":\n return {\n type: \"markings\",\n markings: {\n property: condition.property\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: condition.property\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 buildPropertyMapping(properties) {\n return Object.fromEntries(properties.map(prop => {\n // editOnly\n if (prop.editOnly) {\n return [prop.apiName, {\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 [prop.apiName, structMapping];\n }\n // default: column mapping\n return [prop.apiName, {\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\nexport function convertValueType(valueType) {\n return {\n apiName: valueType.apiName,\n version: valueType.version,\n packageNamespace: valueType.packageNamespace,\n displayMetadata: valueType.displayMetadata\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 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 { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { dataConstraintToPropertyTypeDataConstraint } from \"./dataConstraintToPropertyTypeDataConstraint.js\";\nexport function convertValueTypeDataConstraints(property, dataConstraints) {\n const nullabilityDataConstraints = convertNullabilityToDataConstraint(property);\n if (dataConstraints.length === 0) {\n return nullabilityDataConstraints;\n }\n const propertyTypeConstraints = dataConstraints.map(constraint => ({\n constraints: dataConstraintToPropertyTypeDataConstraint(constraint.constraint.constraint),\n failureMessage: constraint.constraint.failureMessage\n }));\n return {\n ...nullabilityDataConstraints,\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\nimport invariant from \"tiny-invariant\";\nimport { convertObjectStatus, namespace } from \"../../api/defineOntology.js\";\nimport { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldBeIndexedForSearch, shouldNotHaveRenderHints, validateVectorProperty } from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertReducers } from \"./convertReducers.js\";\nimport { convertValueType } from \"./convertValueType.js\";\nimport { convertValueTypeDataConstraints } from \"./convertValueTypeDataConstraints.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertObjectPropertyType(property) {\n const apiName = namespace + 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 validateVectorProperty(apiName, property.type, property.array);\n const output = {\n apiName: property.apiName,\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, property.apiName, property.sharedPropertyType),\n reducers: convertReducers(property.type, property.apiName, property.reducers ?? [], property.sharedPropertyType)\n }\n } : propertyTypeTypeToOntologyIrType(property.type, property.apiName),\n typeClasses: property.typeClasses ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),\n status: convertObjectStatus(property.status),\n inlineAction: undefined,\n dataConstraints: property.valueType ? convertValueTypeDataConstraints(property, property.valueType.constraints) : convertNullabilityToDataConstraint(property),\n sharedPropertyTypeRid: property.sharedPropertyType?.apiName,\n valueType: property.valueType ? convertValueType(property.valueType) : 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 invariant from \"tiny-invariant\";\nimport { buildDatasource, cleanAndValidateLinkTypeId, convertObjectStatus } from \"../../api/defineOntology.js\";\nimport { isExotic } from \"../../api/properties/PropertyTypeType.js\";\nimport { convertDatasourceDefinition } from \"./convertDatasourceDefinition.js\";\nimport { convertObjectPropertyType } from \"./convertObjectPropertyType.js\";\nexport function convertObject(objectType) {\n const {\n derivedDatasources,\n derivedPropertyNames\n } = extractDerivedDatasources(objectType);\n const propertyDatasources = (objectType.properties ?? []).filter(prop => !derivedPropertyNames.includes(prop.apiName)).flatMap(prop => extractPropertyDatasource(prop, objectType.apiName));\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))), classificationInputGroup, mandatoryInputGroup);\n const implementations = objectType.implementsInterfaces ?? [];\n for (const impl of implementations) {\n const requiredConstraints = (impl.implements.actionTypeConstraints ?? []).filter(constraint => constraint.requireImplementation);\n !(requiredConstraints.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object \"${objectType.apiName}\" implements interface \"${impl.implements.apiName}\" which has required action type constraints: ${requiredConstraints.map(constraint => constraint.metadata.apiName).join(\", \")}. Action type constraint implementation is not yet supported in OAC. Set requireImplementation to false and manually implement the constraint after installation.`) : invariant(false) : void 0;\n }\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: [objectType.primaryKeyPropertyApiName],\n propertyTypes: Object.fromEntries(objectType.properties?.map(val => [val.apiName, convertObjectPropertyType(val)]) ?? []),\n titlePropertyTypeRid: objectType.titlePropertyApiName,\n apiName: objectType.apiName,\n status: convertObjectStatus(objectType.status),\n redacted: false,\n implementsInterfaces2: implementations.map(impl => ({\n actionTypes: {},\n interfaceTypeApiName: impl.implements.apiName,\n linksV2: {},\n propertiesV2: Object.fromEntries(impl.propertyMapping.map(mappings => [mappings.interfaceProperty, {\n type: \"propertyTypeRid\",\n propertyTypeRid: mappings.mapsTo\n }])),\n properties: {}\n })),\n allImplementsInterfaces: {}\n },\n datasources: [...propertyDatasources, ...derivedDatasources, objectDatasource],\n entityMetadata: {\n arePatchesEnabled: objectType.editsEnabled ?? false,\n aliases: objectType.aliases ?? [],\n editsHistory: convertEditsHistory(objectType.apiName, objectType.editsHistoryConfig)\n },\n propertySecurityGroupPackagingVersion: {\n type: \"v2\",\n v2: {}\n }\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) {\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: identifier,\n properties: [property.apiName]\n }\n };\n return [buildDatasource(property.apiName, geotimeDefinition)];\n case \"mediaReference\":\n const mediaSetDefinition = {\n type: \"mediaSetView\",\n mediaSetView: {\n assumedMarkings: [],\n clearOnDeleteProperties: [],\n mediaSetViewLocator: identifier,\n properties: [property.apiName],\n uploadProperties: property.includeEmptyBackingMediaSet ? [property.apiName] : []\n }\n };\n return [buildDatasource(property.apiName, mediaSetDefinition)];\n default:\n return [];\n }\n}\nfunction extractDerivedDatasources(objectType) {\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));\n const derivedPropertyNames = inputDerivedDatasources.flatMap(ds => Object.keys(ds.propertyMapping));\n return {\n derivedDatasources,\n derivedPropertyNames\n };\n}\nfunction buildDerivedDatasource(datasource, index, objectTypeApiName) {\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: 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]) => [sourceProp, {\n type: \"propertyType\",\n propertyType: targetProp\n }]))\n }\n } : {\n type: \"aggregatedProperties\",\n aggregatedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(Object.entries(datasource.propertyMapping).map(([sourceProp, agg]) => [sourceProp, buildAggregation(agg)]))\n }\n };\n const fullDefinition = {\n type: \"derived\",\n derived: {\n definition: derivedDefinition\n }\n };\n return buildDatasource(objectTypeApiName + \".derived.\" + index.toString(), fullDefinition);\n}\nfunction buildAggregation(agg) {\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 if (type !== \"count\") {\n if ([\"collectList\", \"collectSet\"].includes(type)) {\n innerDef.linkedProperty = {\n type: \"propertyType\",\n propertyType: foreignProperty\n };\n innerDef.limit = limit;\n } else {\n innerDef.property = {\n type: \"propertyType\",\n propertyType: foreignProperty\n };\n }\n }\n return {\n type,\n [type]: innerDef\n };\n}\nfunction convertEditsHistory(apiName, config) {\n if (config) {\n return config.enabled ? {\n type: \"config\",\n config: {\n store: apiName,\n storeAllPreviousProperties: config.storeAllPreviousProperties\n }\n } : {\n type: \"none\",\n none: {}\n };\n }\n return undefined;\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 \"../../api/common/OntologyEntityTypeEnum.js\";\nimport { cleanAndValidateLinkTypeId, convertAction } from \"../../api/defineOntology.js\";\nimport { convertInterface } from \"./convertInterface.js\";\nimport { convertInterfaceSchemaMigrations } from \"./convertInterfaceSchemaMigrations.js\";\nimport { convertLink } from \"./convertLink.js\";\nimport { convertObject } from \"./convertObject.js\";\nimport { convertSpt } from \"./convertSpt.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) {\n return {\n objectTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).map(([apiName, objectType]) => {\n return [apiName, convertObject(objectType)];\n })),\n sharedPropertyTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]).map(([apiName, spt]) => [apiName, {\n sharedPropertyType: convertSpt(spt)\n }])),\n interfaceTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).map(([apiName, interfaceType]) => {\n const schemaMigrations = convertInterfaceSchemaMigrations(interfaceType);\n return [apiName, {\n interfaceType: convertInterface(interfaceType),\n ...(schemaMigrations !== undefined ? {\n schemaMigrations\n } : {})\n }];\n })),\n linkTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.LINK_TYPE]).map(([id, link]) => {\n return [cleanAndValidateLinkTypeId(id), convertLink(link)];\n })),\n actionTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.ACTION_TYPE]).map(([apiName, action]) => {\n return [apiName, convertAction(action)];\n })),\n blockPermissionInformation: {\n actionTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.ACTION_TYPE]).filter(([_, action]) => action.validation || action.permission).map(([apiName, action]) => {\n return [apiName, {\n restrictionStatus: toActionTypeRestrictionStatus(action.permission ?? \"roles\")\n }];\n })),\n objectTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.OBJECT_TYPE]).filter(([_, objectType]) => objectType.permission != null).map(([apiName, objectType]) => {\n return [apiName, {\n restrictionStatus: toObjectTypeRestrictionStatus(objectType.permission)\n }];\n })),\n linkTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.LINK_TYPE]).filter(([_, link]) => link.permission != null).map(([id, link]) => {\n return [cleanAndValidateLinkTypeId(id), {\n restrictionStatus: toLinkTypeRestrictionStatus(link.permission)\n }];\n })),\n interfaceTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).filter(([_, iface]) => iface.permission != null).map(([apiName, iface]) => {\n return [apiName, {\n restrictionStatus: toInterfaceTypeRestrictionStatus(iface.permission)\n }];\n })),\n sharedPropertyTypes: Object.fromEntries(Object.entries(ontology[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]).filter(([_, spt]) => spt.permission != null).map(([apiName, spt]) => {\n return [apiName, {\n restrictionStatus: toSharedPropertyTypeRestrictionStatus(spt.permission)\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\nexport function convertValueTypesToIr(valueTypes) {\n return Object.values(valueTypes).map(definitions => ({\n metadata: {\n apiName: definitions[0].apiName,\n packageNamespace: definitions[0].packageNamespace,\n displayMetadata: definitions[0].displayMetadata,\n status: definitions[0].status\n },\n // TODO(dpaquin): instead of deduping here, we should refactor the value type types from arrays to maps\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 * 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 \"../../api/common/OntologyEntityTypeEnum.js\";\nimport { convertValueTypesToIr } from \"./convertValueTypesToIr.js\";\nexport function convertOntologyToValueTypeIr(ontology) {\n return {\n valueTypes: convertValueTypesToIr(ontology[OntologyEntityTypeEnum.VALUE_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 { importedTypes } from \"../../api/defineOntology.js\";\nimport { convertOntologyDefinitionToWireBlockData } from \"./convertOntologyDefinitionToWireBlockData.js\";\nimport { convertOntologyToValueTypeIr } from \"./convertOntologyToValueTypeIr.js\";\nexport function convertOntologyDefinition(ontology, randomnessKey) {\n return {\n ontology: convertOntologyDefinitionToWireBlockData(ontology),\n importedOntology: convertOntologyDefinitionToWireBlockData(importedTypes),\n valueTypes: convertOntologyToValueTypeIr(ontology),\n importedValueTypes: convertOntologyToValueTypeIr(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\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\nexport let interfaceSnippets = /*#__PURE__*/function (interfaceSnippets) {\n interfaceSnippets[interfaceSnippets[\"loadInterfacesReference\"] = 0] = \"loadInterfacesReference\";\n interfaceSnippets[interfaceSnippets[\"loadAllInterfacesReference\"] = 1] = \"loadAllInterfacesReference\";\n interfaceSnippets[interfaceSnippets[\"loadOrderedInterfacesReference\"] = 2] = \"loadOrderedInterfacesReference\";\n interfaceSnippets[interfaceSnippets[\"searchInterfacesReference\"] = 3] = \"searchInterfacesReference\";\n interfaceSnippets[interfaceSnippets[\"loadInterfaceMetadataSnippet\"] = 4] = \"loadInterfaceMetadataSnippet\";\n interfaceSnippets[interfaceSnippets[\"subscribeToObjectSetInstructions\"] = 5] = \"subscribeToObjectSetInstructions\";\n return interfaceSnippets;\n}({});\nexport let actionSnippets = /*#__PURE__*/function (actionSnippets) {\n actionSnippets[actionSnippets[\"applyAction\"] = 0] = \"applyAction\";\n actionSnippets[actionSnippets[\"batchApplyAction\"] = 1] = \"batchApplyAction\";\n return actionSnippets;\n}({});\nexport let objectSnippets = /*#__PURE__*/function (objectSnippets) {\n objectSnippets[objectSnippets[\"loadSingleObjectGuide\"] = 0] = \"loadSingleObjectGuide\";\n objectSnippets[objectSnippets[\"loadObjectsReference\"] = 1] = \"loadObjectsReference\";\n objectSnippets[objectSnippets[\"loadAllObjectsReference\"] = 2] = \"loadAllObjectsReference\";\n objectSnippets[objectSnippets[\"loadOrderedInterfacesReference\"] = 3] = \"loadOrderedInterfacesReference\";\n // what\n objectSnippets[objectSnippets[\"searchObjectsGuide\"] = 4] = \"searchObjectsGuide\";\n // There's specific search queries under this one too, but a little verbose\n objectSnippets[objectSnippets[\"aggregationTemplate\"] = 5] = \"aggregationTemplate\";\n /* Types of aggregation + group bys\n approximateDistinctAggregationTemplate,\n exactDistinctAggregationTemplate,\n numericAggregationTemplate,\n countAggregationTemplate,\n fixedWidthGroupByTemplate,\n durationGroupByTemplate,\n exactGroupByTemplate,\n rangeGroupByTemplate,\n */\n objectSnippets[objectSnippets[\"objectSetOperationsGuide\"] = 6] = \"objectSetOperationsGuide\";\n /* Types of set operations\n objectSetOperationsUnion,\n objectSetOperationsSubtract,\n objectSetOperationsIntersect,\n */\n objectSnippets[objectSnippets[\"loadObjectMetadataSnippet\"] = 7] = \"loadObjectMetadataSnippet\";\n objectSnippets[objectSnippets[\"subscribeToObjectSetInstructions\"] = 8] = \"subscribeToObjectSetInstructions\";\n return objectSnippets;\n}({});\nexport const snippetNameMapping = new Map([[\"loadInterfaceMetadataSnippet\", \"Load {{interfaceName}} metadata\"], [\"loadInterfacesReference\", \"Load pages of {{interfaceName}}\"], [\"loadAllInterfacesReference\", \"Load all {{interfaceName}}\"], [\"loadOrderedInterfacesReference\", \"Load ordered {{interfaceName}}\"], [\"searchInterfacesReference\", \"Filtering\"], [\"subscribeToObjectSetInstructions\", \"Subscribe to object sets\"]]);","/*\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 * as path from \"path\";\nimport { TYPESCRIPT_OSDK_SNIPPETS } from \"@osdk/typescript-sdk-docs\";\nimport { consola } from \"consola\";\nimport Mustache from \"mustache\";\nimport { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport { actionSnippets, interfaceSnippets, objectSnippets, snippetNameMapping } from \"./snippetTypes.js\";\nexport function createCodeSnippets(ontology, packageName, outputDir) {\n if (outputDir === undefined) {\n outputDir = \"./code-snippets\";\n }\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, {\n recursive: true\n });\n }\n if (packageName === undefined) {\n packageName = \"\";\n }\n consola.info(\"Generating code snippets to \", outputDir);\n for (const type of Object.values(OntologyEntityTypeEnum)) {\n for (const object of Object.values(ontology[type])) {\n let snippet = {};\n switch (type) {\n case OntologyEntityTypeEnum.OBJECT_TYPE:\n snippet = generateObjectSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.ACTION_TYPE:\n snippet = generateActionSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.INTERFACE_TYPE:\n snippet = generateInterfaceSnippet(object, packageName);\n break;\n default:\n continue;\n }\n fs.writeFileSync(path.join(outputDir, object.apiName), JSON.stringify(snippet));\n }\n }\n consola.info(\"Finished Code Snippet Generation\");\n}\nfunction generateInterfaceSnippet(interfaceType, packageName) {\n const interfaceContext = {\n interfaceApiName: interfaceType.apiName,\n packageName: packageName,\n objectOrInterfaceApiName: interfaceType.apiName,\n propertyNames: Object.keys(interfaceType.propertiesV3),\n interfaceName: interfaceType.displayMetadata.displayName\n };\n return getSnippets(interfaceSnippets, interfaceContext);\n}\nfunction generateObjectSnippet(objectType, packageName) {\n const objectContext = {\n objectType: objectType.apiName,\n packageName: packageName,\n objectOrInterfaceApiName: objectType.apiName\n };\n return getSnippets(objectSnippets, objectContext);\n}\nfunction generateActionSnippet(actionType, packageName) {\n const actionContext = {\n actionApiName: actionType.apiName,\n packageName: packageName\n };\n return getSnippets(actionSnippets, actionContext);\n}\nfunction getSnippets(snippetType, context) {\n const allSnippets = {};\n for (const templateName of Object.keys(snippetType).filter(key => isNaN(Number(key)))) {\n const versions = Object.values(TYPESCRIPT_OSDK_SNIPPETS.versions);\n const latestTemplate = versions.slice().reverse().find(v => v.snippets[templateName])?.snippets[templateName].at(-1)?.template ?? \"\";\n const renderedTemplate = Mustache.render(latestTemplate, context);\n const snippetName = snippetNameMapping.get(templateName);\n allSnippets[snippetName !== undefined ? Mustache.render(snippetName, context) : templateName] = renderedTemplate;\n }\n return allSnippets;\n}","/*\n * Copyright 2024 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 * as path from \"path\";\nimport { consola } from \"consola\";\nimport { convertActionParameters } from \"../conversion/toMarketplace/convertActionParameters.js\";\nimport { convertActionSections } from \"../conversion/toMarketplace/convertActionSections.js\";\nimport { convertActionValidation } from \"../conversion/toMarketplace/convertActionValidation.js\";\nimport { convertOntologyDefinition } from \"../conversion/toMarketplace/convertOntologyDefinition.js\";\nimport { convertOntologyToValueTypeIr } from \"../conversion/toMarketplace/convertOntologyToValueTypeIr.js\";\nimport { getFormContentOrdering } from \"../conversion/toMarketplace/getFormContentOrdering.js\";\nimport { createCodeSnippets } from \"./code-snippets/createCodeSnippets.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\n// type -> apiName -> entity\n/** @internal */\nexport let ontologyDefinition;\n\n// type -> apiName -> entity\n/** @internal */\nexport let importedTypes;\n\n// namespace -> version\n/** @internal */\nexport let dependencies;\n\n/** @internal */\nexport let namespace;\nexport function updateOntology(entity) {\n if (entity.__type !== OntologyEntityTypeEnum.VALUE_TYPE) {\n ontologyDefinition[entity.__type][entity.apiName] = entity;\n return;\n }\n // value types are a special case\n if (ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName] === undefined) {\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName] = [];\n }\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName].push(entity);\n}\nexport async function defineOntology(ns, body, outputDir, dependencyFile, codeSnippetFiles, snippetPackageName, snippetFileOutputDir, randomnessKey, /** Runs once the ontology is fully registered, but before anything is written to disk. */\nbeforeWrite) {\n namespace = ns;\n dependencies = {};\n ontologyDefinition = {\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n SHARED_PROPERTY_TYPE: {},\n VALUE_TYPE: {}\n };\n importedTypes = {\n SHARED_PROPERTY_TYPE: {},\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n VALUE_TYPE: {}\n };\n try {\n await body();\n } catch (e) {\n // The CLI entrypoint prints what is thrown; this only adds where it came from, under -v.\n consola.debug(\"Unexpected error while processing the body of the ontology\");\n throw e;\n }\n await beforeWrite?.(ontologyDefinition);\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\n }\n if (codeSnippetFiles) {\n createCodeSnippets(ontologyDefinition, snippetPackageName, snippetFileOutputDir);\n }\n return convertOntologyDefinition(ontologyDefinition, randomnessKey);\n}\nexport function writeStaticObjects(outputDir) {\n const codegenDir = path.resolve(outputDir, \"codegen\");\n const typeDirs = {\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"shared-property-types\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"action-types\",\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"object-types\",\n [OntologyEntityTypeEnum.LINK_TYPE]: \"link-types\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"interface-types\",\n [OntologyEntityTypeEnum.VALUE_TYPE]: \"value-types\"\n };\n if (!fs.existsSync(codegenDir)) {\n fs.mkdirSync(codegenDir, {\n recursive: true\n });\n }\n Object.values(typeDirs).forEach(typeDirNameFromMap => {\n const currentTypeDirPath = path.join(codegenDir, typeDirNameFromMap);\n if (fs.existsSync(currentTypeDirPath)) {\n fs.rmSync(currentTypeDirPath, {\n recursive: true,\n force: true\n });\n }\n fs.mkdirSync(currentTypeDirPath, {\n recursive: true\n });\n });\n const topLevelExportStatements = [];\n Object.entries(ontologyDefinition).forEach(([ontologyTypeEnumKey, entities]) => {\n const typeDirName = typeDirs[ontologyTypeEnumKey];\n const typeDirPath = path.join(codegenDir, typeDirName);\n const entityModuleNames = [];\n Object.entries(entities).forEach(([apiName, entity]) => {\n const entityFileNameBase = camel(withoutNamespace(apiName)) + (ontologyTypeEnumKey === OntologyEntityTypeEnum.VALUE_TYPE ? \"ValueType\" : \"\");\n const filePath = path.join(typeDirPath, `${entityFileNameBase}.ts`);\n const entityTypeName = getEntityTypeName(ontologyTypeEnumKey);\n const entityJSON = JSON.stringify(sanitizeTypes(entity), null, 2).replace(/(\"__type\"\\s*:\\s*)\"([^\"]*)\"/gu, (_, prefix, value) => `${prefix}OntologyEntityTypeEnum.${value}`);\n const content = `\nimport { wrapWithProxy, OntologyEntityTypeEnum } from '@osdk/maker';\nimport type { ${entityTypeName} } from '@osdk/maker';\n\n/** @type {import('@osdk/maker').${entityTypeName}} */\nconst ${entityFileNameBase}_base: ${entityTypeName} = ${ontologyTypeEnumKey === \"VALUE_TYPE\" ? entityJSON.slice(1, -2) : entityJSON} as unknown as ${entityTypeName};\n \nexport const ${entityFileNameBase}: ${entityTypeName} = wrapWithProxy(${entityFileNameBase}_base);\n `;\n fs.writeFileSync(filePath, content, {\n flag: \"w\"\n });\n entityModuleNames.push(entityFileNameBase);\n });\n for (const entityModuleName of entityModuleNames) {\n topLevelExportStatements.push(`export { ${entityModuleName} } from \"./codegen/${typeDirName}/${entityModuleName}.js\";`);\n }\n });\n if (topLevelExportStatements.length > 0) {\n const mainIndexContent = dependencyInjectionString() + topLevelExportStatements.join(\"\\n\") + \"\\n\";\n const mainIndexFilePath = path.join(outputDir, \"index.ts\");\n fs.writeFileSync(mainIndexFilePath, mainIndexContent, {\n flag: \"w\"\n });\n }\n}\nexport function buildDatasource(apiName, definition, classificationMarkingGroupName, mandatoryMarkingGroupName) {\n const needsSecurity = classificationMarkingGroupName !== undefined || mandatoryMarkingGroupName !== undefined;\n const securityConfig = needsSecurity ? {\n classificationConstraint: classificationMarkingGroupName ? {\n markingGroupName: classificationMarkingGroupName\n } : undefined,\n markingConstraint: mandatoryMarkingGroupName ? {\n markingGroupName: mandatoryMarkingGroupName\n } : undefined\n } : undefined;\n return {\n datasourceName: apiName,\n datasource: definition,\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: false,\n ...(securityConfig !== undefined && {\n dataSecurity: securityConfig\n })\n };\n}\nexport function sanitizeTypes(entity) {\n switch (entity.__type) {\n case OntologyEntityTypeEnum.INTERFACE_TYPE:\n return filterCyclicReferences({\n ...entity,\n linkedInterfaces: (entity.linkedInterfaces ?? []).map(interfaceTypeOrApiName => typeof interfaceTypeOrApiName === \"string\" ? ontologyDefinition[OntologyEntityTypeEnum.INTERFACE_TYPE][interfaceTypeOrApiName] : interfaceTypeOrApiName)\n });\n case OntologyEntityTypeEnum.OBJECT_TYPE:\n return entity.implementsInterfaces === undefined ? entity : {\n ...entity,\n implementsInterfaces: sanitizeImplements(entity.implementsInterfaces)\n };\n case OntologyEntityTypeEnum.LINK_TYPE:\n return sanitizeLinkInterfaces(entity);\n default:\n return entity;\n }\n}\nfunction sanitizeImplements(implementsInterfaces) {\n return implementsInterfaces.map(impl => ({\n ...impl,\n implements: filterCyclicReferences(impl.implements)\n }));\n}\nfunction sanitizeImplementer(object) {\n return object.implementsInterfaces === undefined ? object : {\n ...object,\n implementsInterfaces: sanitizeImplements(object.implementsInterfaces)\n };\n}\nfunction sanitizeLinkSideObject(object) {\n return typeof object === \"string\" ? object : sanitizeImplementer(object);\n}\nfunction sanitizeLinkInterfaces(link) {\n if (\"one\" in link) {\n return {\n ...link,\n one: {\n ...link.one,\n object: sanitizeLinkSideObject(link.one.object)\n },\n toMany: {\n ...link.toMany,\n object: sanitizeLinkSideObject(link.toMany.object)\n }\n };\n }\n if (\"intermediaryObjectType\" in link) {\n return {\n ...link,\n intermediaryObjectType: sanitizeImplementer(link.intermediaryObjectType),\n many: sanitizeIntermediarySide(link.many),\n toMany: sanitizeIntermediarySide(link.toMany)\n };\n }\n return {\n ...link,\n many: {\n ...link.many,\n object: sanitizeLinkSideObject(link.many.object)\n },\n toMany: {\n ...link.toMany,\n object: sanitizeLinkSideObject(link.toMany.object)\n }\n };\n}\nfunction sanitizeIntermediarySide(side) {\n return {\n ...side,\n object: sanitizeLinkSideObject(side.object),\n linkToIntermediary: sanitizeLinkInterfaces(side.linkToIntermediary)\n };\n}\nfunction filterCyclicReferences(iface, ancestors = new Set(), expanded = new Set()) {\n ancestors.add(iface.apiName);\n const processLinked = linked => {\n if (typeof linked === \"string\") return linked;\n if (ancestors.has(linked.apiName)) return linked.apiName;\n if (expanded.has(linked.apiName)) {\n const {\n linkedInterfaces: _,\n extendsInterfaces: __,\n ...shallow\n } = linked;\n return {\n ...shallow,\n linkedInterfaces: [],\n extendsInterfaces: []\n };\n }\n return filterCyclicReferences(linked, new Set(ancestors), expanded);\n };\n expanded.add(iface.apiName);\n return {\n ...iface,\n linkedInterfaces: (iface.linkedInterfaces ?? []).map(processLinked),\n extendsInterfaces: iface.extendsInterfaces.map(parent => processLinked(parent))\n };\n}\nexport function cleanAndValidateLinkTypeId(apiName) {\n // Insert a dash before any uppercase letter that follows a lowercase letter or digit\n // Replace underscores used by legacy link API names with dashes.\n const step1 = apiName.replace(/_/gu, \"-\").replace(/([a-z0-9])([A-Z])/gu, \"$1-$2\");\n // Insert a dash after a sequence of uppercase letters when followed by a lowercase letter\n // then convert the whole string to lowercase\n // e.g., apiName, APIname, and apiNAME will all be converted to api-name\n const linkTypeId = step1.replace(/([A-Z])([A-Z][a-z])/gu, \"$1-$2\").toLowerCase();\n const VALIDATION_PATTERN = /^([a-z][a-z0-9\\-]*)$/u;\n if (!VALIDATION_PATTERN.test(linkTypeId)) {\n throw new Error(`LinkType id '${linkTypeId}' must be lower case with dashes.`);\n }\n return linkTypeId;\n}\nexport function dumpOntologyFullMetadata() {\n return convertOntologyDefinition(ontologyDefinition);\n}\nexport function dumpValueTypeWireType() {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\nexport function convertObjectStatus(status) {\n if (status === undefined) {\n return {\n type: \"active\",\n active: {}\n };\n }\n if (status === \"active\") {\n return {\n type: \"active\",\n active: {}\n };\n }\n if (status === \"experimental\") {\n return {\n type: \"experimental\",\n experimental: {}\n };\n }\n if (status === \"example\") {\n return {\n type: \"example\",\n example: {}\n };\n }\n if (typeof status === \"object\" && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined\n }\n };\n }\n return status;\n}\nexport function convertAction(action) {\n const actionValidation = convertActionValidation(action);\n const actionParameters = convertActionParameters(action);\n const actionSections = convertActionSections(action);\n const parameterOrdering = action.parameterOrdering ?? (action.parameters ?? []).map(p => p.id);\n return {\n actionType: {\n actionTypeLogic: {\n logic: {\n rules: action.rules\n },\n validation: actionValidation\n },\n metadata: {\n apiName: action.apiName,\n 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 successMessage: action.submissionMetadata?.successMessage ? [{\n type: \"message\",\n message: action.submissionMetadata.successMessage\n }] : [],\n typeClasses: action.typeClasses ?? [],\n applyingMessage: [],\n ...(action.submissionMetadata?.submitButtonDisplayMetadata && {\n submitButtonDisplayMetadata: action.submissionMetadata.submitButtonDisplayMetadata\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration && {\n undoButtonConfiguration: action.submissionMetadata.undoButtonConfiguration\n })\n },\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 }\n }\n };\n}\nexport function extractAllowedValues(allowedValues) {\n switch (allowedValues.type) {\n case \"oneOf\":\n return {\n type: \"oneOf\",\n oneOf: {\n type: \"oneOf\",\n oneOf: {\n labelledValues: allowedValues.oneOf,\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\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 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 // TODO(dpaquin): there's probably a TS clean way to do this\n }\n}\nexport function renderHintFromBaseType(parameter, validation) {\n // TODO(dpaquin): these are just guesses, we should find where they're actually defined\n const type = typeof parameter.type === \"string\" ? parameter.type : parameter.type.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 (validation?.allowedValues?.type === \"user\" || validation?.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 (parameter.validation.allowedValues?.type === \"mandatoryMarking\") {\n return {\n type: \"mandatoryMarkingPicker\",\n mandatoryMarkingPicker: {}\n };\n } else if (parameter.validation.allowedValues?.type === \"cbacMarking\") {\n return {\n type: \"cbacMarkingPicker\",\n cbacMarkingPicker: {}\n };\n } else {\n throw new Error(`The allowed values for \"${parameter.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}\nexport function extractNamespace(apiName) {\n return apiName.substring(0, apiName.lastIndexOf(\".\") + 1);\n}\nexport function withoutNamespace(apiName) {\n const lastDot = apiName.lastIndexOf(\".\");\n if (lastDot === -1) {\n return apiName;\n }\n return apiName.substring(lastDot + 1);\n}\nfunction camel(str) {\n if (!str) {\n return str;\n }\n let result = str.replace(/[-_]+(.)?/gu, (_, c) => c ? c.toUpperCase() : \"\");\n result = result.charAt(0).toLowerCase() + result.slice(1);\n return result;\n}\n\n/**\n * Gets the TypeScript type name corresponding to an OntologyEntityTypeEnum value\n */\nfunction getEntityTypeName(type) {\n return {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"ObjectType\",\n [OntologyEntityTypeEnum.LINK_TYPE]: \"LinkType\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"InterfaceType\",\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"SharedPropertyType\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"ActionType\",\n [OntologyEntityTypeEnum.VALUE_TYPE]: \"ValueTypeDefinitionVersion\"\n }[type];\n}\nexport function writeDependencyFile(dependencyFile) {\n fs.writeFileSync(dependencyFile, JSON.stringify(dependencies, null, 2));\n}\nfunction dependencyInjectionString() {\n const namespaceNoDot = namespace.endsWith(\".\") ? namespace.slice(0, -1) : namespace;\n return `import { addDependency } from \"@osdk/maker\";\n// @ts-ignore\naddDependency(\"${namespaceNoDot}\", new URL(import.meta.url).pathname);\n`;\n}\nexport function addNamespaceIfNone(apiName) {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\n}\nexport function initializeOntologyState(ns) {\n namespace = ns;\n dependencies = {};\n ontologyDefinition = {\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n SHARED_PROPERTY_TYPE: {},\n VALUE_TYPE: {}\n };\n importedTypes = {\n SHARED_PROPERTY_TYPE: {},\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n VALUE_TYPE: {}\n };\n}\nexport function getOntologyDefinition() {\n return ontologyDefinition;\n}\nexport function getImportedTypes() {\n return importedTypes;\n}\nexport function getNamespace() {\n return namespace;\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 * as path from \"path\";\nimport { dependencies } from \"./defineOntology.js\";\nconst MAX_SEARCH_DEPTH = 5;\nexport function addDependency(namespaceNoDot, fileInPackage) {\n let dir = path.dirname(fileInPackage);\n let packageJsonPath = null;\n for (let i = 0; i < MAX_SEARCH_DEPTH; i++) {\n const candidate = path.join(dir, \"package.json\");\n if (fs.existsSync(candidate)) {\n packageJsonPath = candidate;\n break;\n }\n const parentDir = path.dirname(dir);\n if (parentDir === dir) break;\n dir = parentDir;\n }\n if (!packageJsonPath) {\n throw new Error(`Could not find a package.json within ${MAX_SEARCH_DEPTH} parent directories of ${fileInPackage}`);\n }\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, \"utf-8\"));\n dependencies[namespaceNoDot] = packageJson.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\n/**\n * Gets a single property by apiName from either ObjectTypeDefinition (Record)\n * or ObjectType (Array) format.\n */\nexport function getProperty(obj, propertyId) {\n const props = obj.properties;\n if (props == null) return undefined;\n if (Array.isArray(props)) {\n return props.find(prop => prop.apiName === propertyId);\n }\n return propertyId in props ? props[propertyId] : undefined;\n}\n\n/**\n * Gets all property apiNames from either format.\n */\nexport function getPropertyKeys(obj) {\n const props = obj.properties;\n if (props == null) return [];\n if (Array.isArray(props)) {\n return props.map(prop => prop.apiName);\n }\n return Object.keys(props);\n}\n\n/**\n * Converts properties from either format to a Record keyed by apiName.\n */\nexport function toPropertyMap(obj) {\n const props = obj.properties;\n if (props == null) return {};\n if (Array.isArray(props)) {\n return Object.fromEntries(props.map(prop => [prop.apiName, prop]));\n }\n return props;\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 { convertConditionDefinition } from \"../conversion/toMarketplace/convertConditionDefinition.js\";\nimport { isActionParameterTypePrimitive } from \"./action/ActionParameterType.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { uppercaseFirstLetter } from \"./defineObject.js\";\nimport { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology, withoutNamespace } from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { getInterfacePropertyTypeType, isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nimport { getProperty, getPropertyKeys } from \"./object/objectPropertyHelpers.js\";\nimport { isStruct, isVector } from \"./properties/PropertyTypeType.js\";\nimport { ACTION_DESCRIPTION_LIMIT, ACTION_DISPLAY_NAME_LIMIT, validateDisplayMetadataLengths } from \"./validateMetadataLengths.js\";\nexport const MODIFY_OBJECT_PARAMETER = \"objectToModifyParameter\";\nexport const CREATE_OR_MODIFY_OBJECT_PARAMETER = \"objectToCreateOrModifyParameter\";\nexport const DELETE_OBJECT_PARAMETER = \"objectToDeleteParameter\";\nexport const CREATE_INTERFACE_OBJECT_PARAMETER = \"objectTypeParameter\";\nexport const MODIFY_INTERFACE_OBJECT_PARAMETER = \"interfaceObjectToModifyParameter\";\nexport function defineAction(actionDefInput) {\n const actionDef = cloneDefinition(actionDefInput);\n const apiName = namespace + actionDef.apiName;\n const parameterIds = (actionDef.parameters ?? []).map(p => p.id);\n if (ontologyDefinition[OntologyEntityTypeEnum.ACTION_TYPE][apiName] !== undefined) {\n throw new Error(`Action type with apiName ${actionDef.apiName} is already defined`);\n }\n !/^[a-z0-9]+(?:[-.][a-z0-9]+)*$/u.test(actionDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action type apiName \"${actionDef.apiName}\" must contain lowercase alphanumeric segments separated by hyphens or dots`) : invariant(false) : void 0;\n const parameterIdsSet = new Set(parameterIds);\n !(parameterIdsSet.size === parameterIds.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter ids must be unique`) : invariant(false) : void 0;\n const parameterIdsNotFound = Array.from(referencedParameterIds(actionDef)).filter(p => !parameterIdsSet.has(p));\n !(parameterIdsNotFound.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameters ${JSON.stringify(parameterIdsNotFound)} were referenced but not defined`) : invariant(false) : void 0;\n const definedSectionIds = new Set(Object.keys(actionDef.sections ?? []));\n const undefinedSectionsInOrdering = (actionDef.formContentOrdering ?? []).flatMap(s => s.type === \"parameterId\" ? [] : [s.sectionId]).filter(sId => !definedSectionIds.has(sId));\n !(undefinedSectionsInOrdering.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Sections [${undefinedSectionsInOrdering}] were referenced in content ordering but not defined`) : invariant(false) : void 0;\n !(actionDef.rules.length > 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action type ${actionDef.apiName} must have at least one logic rule`) : invariant(false) : void 0;\n actionDef.rules.forEach(rule => {\n if (rule.type === \"modifyObjectRule\") {\n !parameterIds.some(id => id === rule.modifyObjectRule.objectToModify) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object to modify parameter must be defined in parameters`) : invariant(false) : void 0;\n }\n if (rule.type === \"deleteObjectRule\") {\n !parameterIds.some(id => id === rule.deleteObjectRule.objectToDelete) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Object to delete parameter must be defined in parameters`) : invariant(false) : void 0;\n }\n if (rule.type === \"modifyInterfaceRule\") {\n // The there must be a parameter for the interface, and the interface there must exist\n const interfaceParam = actionDef.parameters.find(p => p.id === rule.modifyInterfaceRule.interfaceObjectToModifyParameter);\n !(interfaceParam !== undefined && typeof interfaceParam.type === \"object\" && (interfaceParam.type.type === \"interfaceReference\" || interfaceParam.type.type === \"interfaceReferenceList\")) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface object to modify parameter must be an interface reference`) : invariant(false) : void 0;\n const interfaceReference = interfaceParam.type.type === \"interfaceReference\" ? interfaceParam.type.interfaceReference.interfaceTypeRid : interfaceParam.type.interfaceReferenceList.interfaceTypeRid;\n !(ontologyDefinition.INTERFACE_TYPE[interfaceReference] !== undefined || importedTypes.INTERFACE_TYPE[interfaceReference] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface type ${interfaceReference} does not exist`) : invariant(false) : void 0;\n\n // All referenced SPTs must exist on the interface\n const interfaceType = ontologyDefinition.INTERFACE_TYPE[interfaceReference];\n Object.keys(rule.modifyInterfaceRule.sharedPropertyValues).forEach(spt => {\n !Object.keys(getFlattenedInterfaceProperties(interfaceType)).includes(spt) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${spt} does not exist in interface type ${interfaceReference}`) : invariant(false) : void 0;\n });\n }\n if (rule.type === \"addInterfaceRule\") {\n // The referenced interface must exist globally\n const interfaceType = ontologyDefinition.INTERFACE_TYPE[rule.addInterfaceRule.interfaceApiName] ?? importedTypes.INTERFACE_TYPE[rule.addInterfaceRule.interfaceApiName];\n !(interfaceType !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface type ${rule.addInterfaceRule.interfaceApiName} does not exist`) : invariant(false) : void 0;\n\n // All referenced SPTs must exist on the interface\n Object.keys(rule.addInterfaceRule.sharedPropertyValues).forEach(spt => {\n !Object.keys(getFlattenedInterfaceProperties(interfaceType)).includes(spt) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${spt} does not exist in interface type ${interfaceType.apiName}`) : invariant(false) : void 0;\n });\n }\n if (rule.type === \"addInterfaceLinkRuleV2\") {\n const ilr = rule.addInterfaceLinkRuleV2;\n const interfaceType = ontologyDefinition.INTERFACE_TYPE[ilr.interfaceTypeRid] ?? importedTypes.INTERFACE_TYPE[ilr.interfaceTypeRid];\n !(interfaceType !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface type ${ilr.interfaceTypeRid} does not exist`) : invariant(false) : void 0;\n !interfaceType.links.some(link => link.metadata.apiName === ilr.interfaceLinkTypeRid) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link type ${ilr.interfaceLinkTypeRid} does not exist on interface ${ilr.interfaceTypeRid}`) : invariant(false) : void 0;\n }\n });\n const fullAction = {\n ...actionDef,\n apiName,\n entities: actionDef.entities ?? {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n __type: OntologyEntityTypeEnum.ACTION_TYPE\n };\n validateActionConfiguration(fullAction);\n const context = `Action type \"${apiName}\"`;\n validateDisplayMetadataLengths(fullAction, context, ACTION_DISPLAY_NAME_LIMIT, ACTION_DESCRIPTION_LIMIT);\n for (const parameter of fullAction.parameters ?? []) {\n validateDisplayMetadataLengths(parameter, `${context}, parameter \"${parameter.id}\"`, ACTION_DISPLAY_NAME_LIMIT, ACTION_DESCRIPTION_LIMIT);\n }\n for (const [id, section] of Object.entries(fullAction.sections ?? {})) {\n validateDisplayMetadataLengths(section, `${context}, section \"${id}\"`, ACTION_DISPLAY_NAME_LIMIT, ACTION_DESCRIPTION_LIMIT);\n }\n updateOntology(fullAction);\n return fullAction;\n}\nexport function isPropertyParameter(def, name, type) {\n if (\"interfaceType\" in def) {\n return Object.keys(getFlattenedInterfaceProperties(def.interfaceType)).includes(name) && !Object.keys(def.nonParameterMappings ?? {}).includes(name) && !isStruct(type) && !isVector(type) && !def.excludedProperties?.includes(name);\n }\n return getPropertyKeys(def.objectType).includes(name) && !Object.keys(def.nonParameterMappings ?? {}).includes(name) && !isVector(type) && !def.excludedProperties?.includes(name);\n}\nexport function createParameters(def, propertyMap, parameterSet, requiredMap) {\n const targetParams = getTargetParameters(def, parameterSet);\n return [...targetParams, ...Array.from(parameterSet).map(id => {\n let propertyMetadata;\n if (id in propertyMap) {\n propertyMetadata = \"sharedPropertyType\" in propertyMap[id] ? propertyMap[id].sharedPropertyType : propertyMap[id];\n }\n return {\n id,\n displayName: def.parameterConfiguration?.[id]?.displayName ?? propertyMetadata?.displayName ?? uppercaseFirstLetter(id),\n type: def.parameterConfiguration?.[id]?.customParameterType ?? extractActionParameterType(propertyMetadata),\n validation: def.parameterConfiguration?.[id] !== undefined ? {\n ...def.parameterConfiguration?.[id],\n allowedValues: def.parameterConfiguration?.[id].allowedValues ?? (def.parameterConfiguration?.[id].customParameterType ? extractAllowedValuesFromActionParameterType(def.parameterConfiguration?.[id].customParameterType) : extractAllowedValuesFromPropertyType(propertyMetadata.type)),\n required: def.parameterConfiguration?.[id].required ?? (propertyMetadata?.array ?? false ? {\n listLength: propertyMetadata?.nullability?.noEmptyCollections ? {\n min: 1\n } : {}\n } : propertyMetadata?.nullability?.noNulls ?? false)\n } : {\n required: propertyMetadata.array ?? false ? {\n listLength: propertyMetadata.nullability?.noEmptyCollections ? {\n min: 1\n } : {}\n } : requiredMap?.[id] ?? propertyMetadata?.nullability?.noNulls ?? false,\n allowedValues: extractAllowedValuesFromPropertyType(propertyMetadata?.type)\n },\n defaultValue: def.parameterConfiguration?.[id]?.defaultValue,\n description: def.parameterConfiguration?.[id]?.description,\n renderHint: def.parameterConfiguration?.[id]?.renderHint\n };\n })];\n}\nexport function createStructFieldValues(def, parameters) {\n return Object.fromEntries(parameters.flatMap(parameter => {\n const property = getProperty(def.objectType, parameter.id);\n if (property === undefined || !isStruct(property.type)) {\n return [];\n }\n !(typeof parameter.type === \"object\" && (parameter.type.type === \"struct\" || parameter.type.type === \"structList\")) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter ${parameter.id} for struct property ${parameter.id} must have a struct parameter type`) : invariant(false) : void 0;\n return [[parameter.id, Object.fromEntries(Object.keys(property.type.structDefinition).map(fieldApiName => [fieldApiName, property.array ? {\n type: \"structListParameterFieldValue\",\n structListParameterFieldValue: {\n parameterId: parameter.id,\n structFieldApiName: fieldApiName\n }\n } : {\n type: \"structParameterFieldValue\",\n structParameterFieldValue: {\n parameterId: parameter.id,\n structFieldApiName: fieldApiName\n }\n }]))]];\n }));\n}\nexport function createPropertyParameterValues(def, parameterIds) {\n return Object.fromEntries(parameterIds.filter(parameterId => {\n const property = getProperty(def.objectType, parameterId);\n return property === undefined || !isStruct(property.type);\n }).map(parameterId => [parameterId, {\n type: \"parameterId\",\n parameterId\n }]));\n}\nfunction getTargetParameters(def, parameterSet) {\n const targetParams = [];\n parameterSet.forEach(name => {\n if (name === MODIFY_OBJECT_PARAMETER) {\n targetParams.push({\n id: MODIFY_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Modify object\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: def.objectType.apiName\n }\n } : {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: def.objectType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n allowedValues: {\n type: \"objectQuery\"\n },\n required: def.parameterConfiguration?.[name]?.required ?? true\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(MODIFY_OBJECT_PARAMETER);\n }\n if (name === CREATE_OR_MODIFY_OBJECT_PARAMETER) {\n targetParams.push({\n id: CREATE_OR_MODIFY_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Create or modify object\",\n type: {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: def.objectType.apiName,\n maybeCreateObjectOption: !(\"primaryKeyOption\" in def) ? {\n type: \"autoGenerated\",\n autoGenerated: {}\n } : def.primaryKeyOption === \"autoGenerated\" ? {\n type: \"autoGenerated\",\n autoGenerated: {}\n } : {\n type: \"userInput\",\n userInput: {}\n }\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n allowedValues: {\n type: \"objectQuery\"\n },\n required: def.parameterConfiguration?.[name]?.required ?? true\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(CREATE_OR_MODIFY_OBJECT_PARAMETER);\n }\n if (name === DELETE_OBJECT_PARAMETER && !(\"interfaceType\" in def)) {\n targetParams.push({\n id: DELETE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Delete object\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: def.objectType.apiName\n }\n } : {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: def.objectType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n allowedValues: {\n type: \"objectQuery\"\n },\n required: def.parameterConfiguration?.[name]?.required ?? true\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(DELETE_OBJECT_PARAMETER);\n }\n if (name === CREATE_INTERFACE_OBJECT_PARAMETER && \"interfaceType\" in def) {\n targetParams.push({\n id: CREATE_INTERFACE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Object type to create\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: def.objectType.apiName\n }\n } : {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: [def.interfaceType.apiName]\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n required: def.parameterConfiguration?.[name]?.required ?? true,\n allowedValues: def.objectType === undefined ? {\n type: \"objectTypeReference\",\n interfaceTypes: [def.interfaceType.apiName]\n } : {\n type: \"oneOf\",\n oneOf: [{\n label: def.objectType.displayName,\n value: {\n type: \"objectType\",\n objectType: {\n objectTypeId: def.objectType.apiName\n }\n }\n }]\n }\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(CREATE_INTERFACE_OBJECT_PARAMETER);\n }\n if (name === MODIFY_INTERFACE_OBJECT_PARAMETER && \"interfaceType\" in def) {\n targetParams.push({\n id: MODIFY_INTERFACE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Object type to modify\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n } : {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n required: def.parameterConfiguration?.[name]?.required ?? true,\n allowedValues: def.objectType === undefined ? {\n type: \"interfaceObjectQuery\"\n } : {\n type: \"oneOf\",\n oneOf: [{\n label: def.objectType.displayName,\n value: {\n type: \"objectType\",\n objectType: {\n objectTypeId: def.objectType.apiName\n }\n }\n }]\n }\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(MODIFY_INTERFACE_OBJECT_PARAMETER);\n }\n if (name === DELETE_OBJECT_PARAMETER && \"interfaceType\" in def) {\n targetParams.push({\n id: DELETE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[name]?.displayName ?? \"Delete Object\",\n type: typeof def.parameterConfiguration?.[name]?.required === \"object\" && \"listLength\" in def.parameterConfiguration?.[name]?.required ? {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n } : {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n required: def.parameterConfiguration?.[name]?.required ?? true,\n allowedValues: def.objectType === undefined ? {\n type: \"interfaceObjectQuery\"\n } : {\n type: \"oneOf\",\n oneOf: [{\n label: def.objectType.displayName,\n value: {\n type: \"objectType\",\n objectType: {\n objectTypeId: def.objectType.apiName\n }\n }\n }]\n }\n },\n defaultValue: def.parameterConfiguration?.[name]?.defaultValue,\n description: def.parameterConfiguration?.[name]?.description\n });\n parameterSet.delete(DELETE_OBJECT_PARAMETER);\n }\n });\n return targetParams;\n}\nfunction referencedParameterIds(actionDef) {\n const parameterIds = new Set();\n\n // section definitions\n Object.values(actionDef.sections ?? {}).flatMap(p => p.parameters).forEach(pId => parameterIds.add(pId));\n\n // form content ordering\n (actionDef.formContentOrdering ?? []).forEach(item => {\n if (item.type === \"parameterId\") {\n parameterIds.add(item.parameterId);\n }\n });\n\n // logic rules\n actionDef.rules.forEach(rule => {\n // when visiting each rule, we also do drive-by namespace prefixing\n switch (rule.type) {\n case \"addInterfaceRule\":\n rule.addInterfaceRule.interfaceApiName = sanitize(rule.addInterfaceRule.interfaceApiName);\n parameterIds.add(rule.addInterfaceRule.objectTypeParameter);\n Object.entries(rule.addInterfaceRule.sharedPropertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n delete rule.addInterfaceRule.sharedPropertyValues[k];\n rule.addInterfaceRule.sharedPropertyValues[sanitize(k)] = v;\n });\n break;\n case \"modifyInterfaceRule\":\n parameterIds.add(rule.modifyInterfaceRule.interfaceObjectToModifyParameter);\n Object.entries(rule.modifyInterfaceRule.sharedPropertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n delete rule.modifyInterfaceRule.sharedPropertyValues[k];\n rule.modifyInterfaceRule.sharedPropertyValues[sanitize(k)] = v;\n });\n break;\n case \"addObjectRule\":\n Object.entries(rule.addObjectRule.propertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n });\n break;\n case \"modifyObjectRule\":\n Object.entries(rule.modifyObjectRule.propertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n });\n break;\n case \"addOrModifyObjectRuleV2\":\n Object.entries(rule.addOrModifyObjectRuleV2.propertyValues).forEach(([k, v]) => {\n if (v.type === \"parameterId\") {\n parameterIds.add(v.parameterId);\n }\n });\n break;\n case \"addInterfaceLinkRuleV2\":\n rule.addInterfaceLinkRuleV2.interfaceTypeRid = sanitize(rule.addInterfaceLinkRuleV2.interfaceTypeRid);\n rule.addInterfaceLinkRuleV2.interfaceLinkTypeRid = sanitize(rule.addInterfaceLinkRuleV2.interfaceLinkTypeRid);\n [...rule.addInterfaceLinkRuleV2.sourceObjects, ...rule.addInterfaceLinkRuleV2.targetObjects].forEach(ref => {\n switch (ref.type) {\n case \"existingObject\":\n parameterIds.add(ref.existingObject);\n break;\n case \"createdInterfaceObjectReferenceByPk\":\n parameterIds.add(ref.createdInterfaceObjectReferenceByPk.objectType);\n parameterIds.add(ref.createdInterfaceObjectReferenceByPk.primaryKey);\n break;\n case \"createdInterfaceObjectReferenceByUniqueIdentifier\":\n parameterIds.add(ref.createdInterfaceObjectReferenceByUniqueIdentifier.objectType);\n break;\n case \"createdObjectReference\":\n // references another logic rule by LogicRuleRid, not a parameter\n break;\n }\n });\n break;\n case \"deleteInterfaceLinkRule\":\n rule.deleteInterfaceLinkRule.interfaceTypeRid = sanitize(rule.deleteInterfaceLinkRule.interfaceTypeRid);\n rule.deleteInterfaceLinkRule.interfaceLinkTypeRid = sanitize(rule.deleteInterfaceLinkRule.interfaceLinkTypeRid);\n parameterIds.add(rule.deleteInterfaceLinkRule.sourceObject);\n parameterIds.add(rule.deleteInterfaceLinkRule.targetObject);\n break;\n }\n });\n return parameterIds;\n}\nexport function extractAllowedValuesFromActionParameterType(type) {\n if (typeof type === \"object\") {\n switch (type.type) {\n case \"objectReference\":\n case \"objectReferenceList\":\n return {\n type: \"objectQuery\"\n };\n case \"interfaceReference\":\n case \"interfaceReferenceList\":\n return {\n type: \"interfaceObjectQuery\"\n };\n case \"objectSetRid\":\n return {\n type: \"objectSetRid\"\n };\n case \"struct\":\n case \"structList\":\n return {\n type: \"struct\"\n };\n default:\n throw new Error(`Inferred allowed values for ${type.type} not yet supported. Please explicitly provide allowed values.`);\n }\n }\n switch (type) {\n case \"boolean\":\n case \"booleanList\":\n return {\n type: \"boolean\"\n };\n case \"integer\":\n case \"integerList\":\n case \"decimal\":\n case \"decimalList\":\n case \"double\":\n case \"doubleList\":\n case \"long\":\n case \"longList\":\n return {\n type: \"range\"\n };\n case \"timestamp\":\n case \"timestampList\":\n case \"date\":\n case \"dateList\":\n return {\n type: \"datetime\"\n };\n case \"string\":\n case \"stringList\":\n return {\n type: \"text\"\n };\n case \"geohash\":\n case \"geohashList\":\n return {\n type: \"geohash\"\n };\n case \"geoshape\":\n case \"geoshapeList\":\n return {\n type: \"geoshape\"\n };\n case \"mediaReference\":\n case \"mediaReferenceList\":\n return {\n type: \"mediaReference\"\n };\n case \"geotimeSeriesReference\":\n case \"geotimeSeriesReferenceList\":\n return {\n type: \"geotimeSeriesReference\"\n };\n case \"attachment\":\n case \"attachmentList\":\n return {\n type: \"attachment\"\n };\n default:\n throw new Error(`Inferred allowed values for ${type} not yet supported. Please explicitly provide allowed values.`);\n }\n}\nfunction extractAllowedValuesFromPropertyType(type) {\n switch (type) {\n case \"boolean\":\n return {\n type: \"boolean\"\n };\n case \"byte\":\n return {\n type: \"range\",\n min: {\n type: \"staticValue\",\n staticValue: {\n type: \"integer\",\n integer: 0\n }\n },\n max: {\n type: \"staticValue\",\n staticValue: {\n type: \"integer\",\n integer: 255\n }\n }\n };\n case \"timestamp\":\n case \"date\":\n return {\n type: \"datetime\"\n };\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n return {\n type: \"range\"\n };\n case \"short\":\n return {\n type: \"range\",\n min: {\n type: \"staticValue\",\n staticValue: {\n type: \"integer\",\n integer: 0\n }\n },\n max: {\n type: \"staticValue\",\n staticValue: {\n type: \"integer\",\n integer: 65535\n }\n }\n };\n case \"string\":\n return {\n type: \"text\"\n };\n case \"geopoint\":\n return {\n type: \"geohash\"\n };\n case \"geoshape\":\n return {\n type: \"geoshape\"\n };\n case \"mediaReference\":\n return {\n type: \"mediaReference\"\n };\n case \"geotimeSeries\":\n return {\n type: \"geotimeSeriesReference\"\n };\n case \"attachment\":\n return {\n type: \"attachment\"\n };\n default:\n switch (type.type) {\n case \"decimal\":\n return {\n type: \"range\"\n };\n case \"marking\":\n return type.markingType === \"CBAC\" ? {\n type: \"cbacMarking\"\n } : {\n type: \"mandatoryMarking\"\n };\n case \"string\":\n return {\n type: \"text\"\n };\n case \"struct\":\n return {\n type: \"struct\"\n };\n case \"vector\":\n throw new Error(\"Vectors are not supported as action parameters yet\");\n default:\n throw new Error(\"Unknown type\");\n }\n break;\n }\n}\nfunction extractActionParameterType(pt) {\n const typeType = pt.type;\n if (typeof typeType === \"object\") {\n switch (typeType.type) {\n case \"decimal\":\n return maybeAddList(\"decimal\", pt);\n case \"marking\":\n return maybeAddList(\"marking\", pt);\n case \"string\":\n return maybeAddList(\"string\", pt);\n case \"struct\":\n return extractStructActionParameterType(typeType, pt.array ?? false);\n case \"vector\":\n throw new Error(\"Vectors are not supported as action parameters yet\");\n default:\n throw new Error(`Unknown type`);\n }\n }\n if (typeof typeType === \"string\" && isActionParameterTypePrimitive(typeType)) {\n return maybeAddList(typeType, pt);\n }\n switch (typeType) {\n case \"byte\":\n case \"short\":\n return maybeAddList(\"integer\", pt);\n case \"geopoint\":\n return maybeAddList(\"geohash\", pt);\n case \"float\":\n return maybeAddList(\"double\", pt);\n case \"geotimeSeries\":\n return maybeAddList(\"geotimeSeriesReference\", pt);\n default:\n throw new Error(\"Unknown type\");\n }\n}\nfunction extractStructActionParameterType(type, isList) {\n const structFieldTypes = Object.fromEntries(Object.entries(type.structDefinition).map(([apiName, fieldDefinition]) => [apiName, extractStructFieldParameterType(typeof fieldDefinition === \"object\" && \"fieldType\" in fieldDefinition ? fieldDefinition.fieldType : fieldDefinition)]));\n return isList ? {\n type: \"structList\",\n structList: {\n structFieldTypes\n }\n } : {\n type: \"struct\",\n struct: {\n structFieldTypes\n }\n };\n}\nfunction extractStructFieldParameterType(type) {\n const typeName = typeof type === \"object\" ? type.type : type;\n switch (typeName) {\n case \"boolean\":\n return {\n type: \"boolean\",\n boolean: {}\n };\n case \"byte\":\n case \"integer\":\n case \"short\":\n return {\n type: \"integer\",\n integer: {}\n };\n case \"long\":\n return {\n type: \"long\",\n long: {}\n };\n case \"decimal\":\n case \"double\":\n case \"float\":\n return {\n type: \"double\",\n double: {}\n };\n case \"string\":\n return {\n type: \"string\",\n string: {}\n };\n case \"geopoint\":\n return {\n type: \"geohash\",\n geohash: {}\n };\n case \"geoshape\":\n return {\n type: \"geoshape\",\n geoshape: {}\n };\n case \"timestamp\":\n return {\n type: \"timestamp\",\n timestamp: {}\n };\n case \"date\":\n return {\n type: \"date\",\n date: {}\n };\n default:\n throw new Error(`Property type ${typeName} is not supported for struct action parameter fields`);\n }\n}\nfunction maybeAddList(type, pt) {\n return pt.array ?? false ? type + \"List\" : type;\n}\nexport function kebab(s) {\n return s.replace(/([a-z])([A-Z])/gu, \"$1-$2\").replace(/([A-Z])([A-Z][a-z])/gu, \"$1-$2\").replace(/\\./gu, \"-\").toLowerCase();\n}\nfunction sanitize(s) {\n return s.includes(\".\") ? s : namespace + s;\n}\nexport function convertValidationRule(actionValidation, actionParameters) {\n return actionValidation.map(rule => {\n return {\n condition: convertConditionDefinition(rule.condition, actionParameters),\n displayMetadata: rule.displayMetadata ?? {\n failureMessage: \"Did not satisfy validation\",\n typeClasses: []\n }\n };\n });\n}\nfunction validateActionConfiguration(action) {\n const seenParameterIds = new Set();\n const parameterMap = action.parameters?.reduce((acc, param) => {\n acc[param.id] = param;\n return acc;\n }, {}) ?? {};\n const orderedParameters = action.parameterOrdering?.map(id => parameterMap[id]) ?? action.parameters;\n orderedParameters?.forEach(param => {\n param.validation.conditionalOverrides?.forEach(override => {\n validateParameterCondition(override.condition, param.id, seenParameterIds, action.parameters);\n });\n validateParameterPrefill(param.id, seenParameterIds, action.parameters, param.defaultValue);\n seenParameterIds.add(param.id);\n });\n}\nfunction validateParameterCondition(condition, currentParameterId, seenParameterIds, parameters) {\n switch (condition.type) {\n case \"parameter\":\n const overrideParamId = condition.parameterId;\n !parameters?.some(p => p.id === overrideParamId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter condition on ${currentParameterId} is referencing unknown parameter ${overrideParamId}`) : invariant(false) : void 0;\n !(overrideParamId !== currentParameterId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter condition on ${currentParameterId} is referencing itself`) : invariant(false) : void 0;\n !seenParameterIds.has(overrideParamId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter condition on ${currentParameterId} is referencing later parameter ${overrideParamId}`) : invariant(false) : void 0;\n break;\n case \"and\":\n // this will not catch the niche edge case where users use the full syntax for unions\n if (\"conditions\" in condition) {\n condition.conditions.forEach(c => validateParameterCondition(c, currentParameterId, seenParameterIds, parameters));\n }\n break;\n case \"or\":\n if (\"conditions\" in condition) {\n condition.conditions.forEach(c => validateParameterCondition(c, currentParameterId, seenParameterIds, parameters));\n }\n break;\n case \"comparison\":\n case \"group\":\n case \"not\":\n case \"markings\":\n case \"regex\":\n case \"redacted\":\n case \"true\":\n break;\n default:\n throw new Error(`Unknown condition type on parameter ${currentParameterId}`);\n }\n}\nfunction validateParameterPrefill(currentParameterId, seenParameterIds, parameters, defaultValue) {\n if (!defaultValue) return;\n switch (defaultValue.type) {\n case \"objectParameterPropertyValue\":\n !parameters?.some(p => p.id === defaultValue.objectParameterPropertyValue.parameterId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Default value for parameter ${currentParameterId} is referencing unknown parameter ${defaultValue.objectParameterPropertyValue.parameterId}`) : invariant(false) : void 0;\n !seenParameterIds.has(defaultValue.objectParameterPropertyValue.parameterId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Default value for parameter ${currentParameterId} is referencing later parameter ${defaultValue.objectParameterPropertyValue.parameterId}`) : invariant(false) : void 0;\n break;\n case \"staticValue\":\n !(defaultValue.staticValue.type === parameters?.find(p => p.id === currentParameterId)?.type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Default static value for parameter ${currentParameterId} does not match type`) : invariant(false) : void 0;\n break;\n case \"staticObject\":\n case \"interfaceParameterPropertyValue\":\n case \"objectQueryPrefill\":\n case \"objectQueryPropertyValue\":\n case \"objectSetRidPrefill\":\n case \"redacted\":\n break;\n default:\n throw new Error(`Unknown default value type for parameter ${currentParameterId}`);\n }\n}\nexport function validateActionParameters(def, properties, name) {\n // validates that parameters either exist as object properties or have a type defined\n [...Object.keys(def.parameterConfiguration ?? {})].forEach(id => {\n !(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || def.parameterConfiguration?.[id].customParameterType !== undefined || isTargetParameter(id)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Parameter ${id} does not exist as a property on ${name} and its type is not explicitly defined`) : invariant(false) : void 0;\n });\n [...Object.keys(def.nonParameterMappings ?? {}), ...(def.excludedProperties ?? [])].forEach(id => {\n !(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || properties.includes(withoutNamespace(id))) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property ${id} does not exist as a property on ${name}`) : invariant(false) : void 0;\n });\n}\n\n// Parameters with configurations will be ordered first in the order they were defined\n// followed by the rest of the parameters in the order they were defined on the object type.\nexport function createDefaultParameterOrdering(def, properties, parameters, priorityId) {\n return [...(priorityId ? [priorityId] : []), ...Object.keys(def.parameterConfiguration ?? {}).filter(id => id !== priorityId), ...properties.filter(id => !def.parameterConfiguration?.[id] && parameters.some(p => p.id === id))];\n}\nexport function validateParameterOrdering(parameterOrdering, parameterSet, actionApiName) {\n const orderingSet = new Set(parameterOrdering);\n const missingParameters = [...parameterSet].filter(param => !orderingSet.has(param));\n const extraneousParameters = parameterOrdering.filter(param => !parameterSet.has(param));\n !(extraneousParameters.length === 0 && missingParameters.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action parameter ordering for ${actionApiName} does not match expected parameters. Extraneous parameters in ordering: {${extraneousParameters}}, Missing parameters in ordering: {${missingParameters}}`) : invariant(false) : void 0;\n}\nexport function isTargetParameter(parameterId) {\n return parameterId === MODIFY_OBJECT_PARAMETER || parameterId === CREATE_OR_MODIFY_OBJECT_PARAMETER || parameterId === CREATE_INTERFACE_OBJECT_PARAMETER || parameterId === MODIFY_INTERFACE_OBJECT_PARAMETER;\n}\nexport function addNamespaceToActionDefinition(def) {\n def.parameterConfiguration = Object.fromEntries(Object.entries(def.parameterConfiguration ?? {}).map(([id, config]) => [getInterfaceParameterName(def, id), config]));\n def.nonParameterMappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [addNamespaceIfNone(id), value]));\n def.excludedProperties = (def.excludedProperties ?? []).map(id => addNamespaceIfNone(id));\n def.sections = def.sections?.map(section => ({\n ...section,\n parameters: section.parameters.map(p => getInterfaceParameterName(def, p))\n }));\n}\n\n// Adds a namespace to an interface parameter name if it is supposed to be namespaced\nexport function getInterfaceParameterName(def, parameter) {\n if (def.useNonNamespacedParameters) {\n return getNonNamespacedParameterName(def, parameter);\n }\n return isTargetParameter(parameter) || !Object.keys(def.interfaceType.propertiesV2).includes(addNamespaceIfNone(parameter)) ? parameter : addNamespaceIfNone(parameter);\n}\nexport function getNonNamespacedParameterName(def, parameter) {\n return def.conflictingParameterOverrides?.[parameter] ?? (parameter.split(\".\").pop() || parameter);\n}\nexport function createInterfacePropertyLogicRuleValue(id, def, actionDef) {\n const type = getInterfacePropertyTypeType(def);\n const array = isInterfaceSharedPropertyType(def) ? def.sharedPropertyType.array : def.array;\n const parameterId = actionDef.useNonNamespacedParameters ? getNonNamespacedParameterName(actionDef, id) : id;\n if (isStruct(type)) {\n return {\n type: \"structLogicRuleValue\",\n structLogicRuleValue: Object.fromEntries(Object.entries(type.structDefinition).map(([apiName, fieldValue]) => {\n return [apiName, array ? {\n type: \"structListParameterFieldValue\",\n structListParameterFieldValue: {\n parameterId,\n structFieldApiName: apiName\n }\n } : {\n type: \"structParameterFieldValue\",\n structParameterFieldValue: {\n parameterId,\n structFieldApiName: apiName\n }\n }];\n }))\n };\n }\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"parameterId\",\n parameterId\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\nexport function combineApiNamespaceIfMissing(namespace, apiName) {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, defineAction, kebab } from \"./defineAction.js\";\nimport { importedTypes, namespace, ontologyDefinition, withoutNamespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nexport function defineCreateInterfaceLinkAction(defInput) {\n const def = cloneDefinition(defInput);\n const linkConstraint = typeof def.interfaceLink === \"string\" ? undefined : def.interfaceLink;\n !(linkConstraint === undefined || def.from === undefined || def.from.apiName === linkConstraint.from.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"from\" (\"${def.from?.apiName}\") does not match the interface (\"${linkConstraint?.from.apiName}\") that interface link constraint \"${linkConstraint?.apiName}\" was defined on. Omit \"from\" to use the constraint's own interface.`) : invariant(false) : void 0;\n const from = def.from ?? linkConstraint?.from;\n !(from !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"from\" is required when \"interfaceLink\" is provided as a string (the api name).`) : invariant(false) : void 0;\n const interfaceLinkApiName = typeof def.interfaceLink === \"string\" ? def.interfaceLink : def.interfaceLink.apiName;\n const linkApiName = combineApiNamespaceIfMissing(namespace, interfaceLinkApiName);\n const link = from.links.find(l => l.metadata.apiName === linkApiName);\n !(link !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link constraint \"${interfaceLinkApiName}\" not found on interface \"${from.apiName}\". Define it with defineInterfaceLinkConstraint first.`) : invariant(false) : void 0;\n !(link.linkedEntityTypeId.type === \"interfaceType\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link constraint \"${interfaceLinkApiName}\" on \"${from.apiName}\" does not link to an interface type.`) : invariant(false) : void 0;\n const targetApiName = link.linkedEntityTypeId.interfaceType;\n !(ontologyDefinition.INTERFACE_TYPE[targetApiName] !== undefined || importedTypes.INTERFACE_TYPE[targetApiName] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Target interface \"${targetApiName}\" of interface link constraint \"${interfaceLinkApiName}\" is not defined.`) : invariant(false) : void 0;\n const sourceId = def.sourceParameter?.id ?? \"source\";\n const targetId = def.targetParameter?.id ?? \"target\";\n const sourceParam = {\n id: sourceId,\n displayName: def.sourceParameter?.displayName ?? from.displayMetadata.displayName,\n description: def.sourceParameter?.description,\n type: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: from.apiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n };\n const targetParam = {\n id: targetId,\n displayName: def.targetParameter?.displayName ?? withoutNamespace(targetApiName),\n description: def.targetParameter?.description,\n type: link.cardinality === \"MANY\" ? {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: targetApiName\n }\n } : {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: targetApiName\n }\n },\n validation: {\n required: link.cardinality === \"MANY\" ? {\n listLength: link.required ? {\n min: 1\n } : {}\n } : link.required,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n };\n const parameters = [sourceParam, targetParam];\n return defineAction({\n apiName: def.apiName ?? `link-${kebab(withoutNamespace(from.apiName))}-${kebab(withoutNamespace(interfaceLinkApiName))}`,\n displayName: def.displayName ?? `Link ${from.displayMetadata.displayName}`,\n description: def.description,\n status: def.status ?? \"active\",\n entities: {\n affectedInterfaceTypes: [from.apiName, targetApiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameters,\n rules: [{\n type: \"addInterfaceLinkRuleV2\",\n addInterfaceLinkRuleV2: {\n interfaceTypeRid: from.apiName,\n interfaceLinkTypeRid: linkApiName,\n sourceObjects: [{\n type: \"existingObject\",\n existingObject: sourceId\n }],\n targetObjects: [{\n type: \"existingObject\",\n existingObject: targetId\n }]\n }\n }],\n parameterOrdering: [sourceId, targetId],\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(s => [s.id, s]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { randomUUID } from \"crypto\";\nexport function convertInterfacePropertyMappingValue(value) {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID()\n }\n }\n };\n case \"currentTime\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"currentTime\",\n currentTime: {}\n }\n };\n case \"currentUser\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"currentUser\",\n currentUser: {}\n }\n };\n default:\n return {\n type: \"logicRuleValue\",\n logicRuleValue: value\n };\n }\n}\nexport function convertMappingValue(value) {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID()\n }\n };\n case \"currentTime\":\n return {\n type: \"currentTime\",\n currentTime: {}\n };\n case \"currentUser\":\n return {\n type: \"currentUser\",\n currentUser: {}\n };\n default:\n return value;\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 { convertInterfacePropertyMappingValue, convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, CREATE_INTERFACE_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, getNonNamespacedParameterName, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { getInterfacePropertyTypeType, isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nexport function defineCreateInterfaceObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);\n const actionInterfaceProperties = Object.entries(allProperties).filter(([apiName, type]) => isPropertyParameter(def, apiName, getInterfacePropertyTypeType(type)));\n const sptNames = actionInterfaceProperties.filter(([_apiName, type]) => isInterfaceSharedPropertyType(type)).map(([apiName]) => apiName);\n const parameterNames = new Set(actionInterfaceProperties.map(([apiName, _type]) => getInterfaceParameterName(def, apiName)));\n const propertyMap = Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [getInterfaceParameterName(def, id), prop]));\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(getInterfaceParameterName(def, param)));\n parameterNames.add(CREATE_INTERFACE_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `create-${kebab(def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName)}${def.objectType === undefined ? \"\" : `-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`}`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(CREATE_INTERFACE_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(CREATE_INTERFACE_OBJECT_PARAMETER);\n }\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, propertyMap, parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required ?? true])));\n let sptMappings = {};\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => {\n if (sptNames.includes(id)) {\n sptMappings = {\n ...sptMappings,\n [id]: convertMappingValue(value)\n };\n }\n return [id, convertInterfacePropertyMappingValue(value)];\n }));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Create ${def.interfaceType.displayMetadata.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? (def.interfaceType.status.type !== \"deprecated\" ? def.interfaceType.status.type : def.interfaceType.status),\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n rules: [{\n type: \"addInterfaceRule\",\n addInterfaceRule: {\n interfaceApiName: def.interfaceType.apiName,\n objectTypeParameter: CREATE_INTERFACE_OBJECT_PARAMETER,\n sharedPropertyValues: {\n ...Object.fromEntries(sptNames.map(id => [id, {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id\n }])),\n ...sptMappings\n },\n interfacePropertyValues: {\n ...Object.fromEntries(actionInterfaceProperties.map(([id, _type]) => [id, {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id\n }\n }])),\n ...mappings\n }\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Array.from(parameterNames), parameters, CREATE_INTERFACE_OBJECT_PARAMETER),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, createDefaultParameterOrdering, createParameters, createPropertyParameterValues, createStructFieldValues, defineAction, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getProperty, getPropertyKeys, toPropertyMap } from \"./object/objectPropertyHelpers.js\";\nexport function defineCreateObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const propertyKeys = getPropertyKeys(def.objectType);\n validateActionParameters(def, propertyKeys, def.objectType.apiName);\n const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter(ds => ds.type === \"derived\").flatMap(ds => Object.keys(ds.propertyMapping));\n const propertyParameters = propertyKeys.filter(id => isPropertyParameter(def, id, getProperty(def.objectType, id)?.type) && !propertiesWithDerivedDatasources.includes(id));\n const parameterNames = new Set(propertyParameters);\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(param));\n const actionApiName = def.apiName ?? `create-object-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`;\n if (def.parameterOrdering) {\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, toPropertyMap(def.objectType), parameterNames);\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Create ${def.objectType.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? \"active\",\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n rules: [{\n type: \"addObjectRule\",\n addObjectRule: {\n objectTypeId: def.objectType.apiName,\n propertyValues: {\n ...createPropertyParameterValues(def, propertyParameters),\n ...mappings\n },\n structFieldValues: createStructFieldValues(def, parameters)\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, propertyKeys, parameters),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, CREATE_OR_MODIFY_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, createPropertyParameterValues, createStructFieldValues, defineAction, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getProperty, getPropertyKeys, toPropertyMap } from \"./object/objectPropertyHelpers.js\";\nimport { isStruct, isVector } from \"./properties/PropertyTypeType.js\";\nexport function defineCreateOrModifyObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const propertyKeys = getPropertyKeys(def.objectType);\n validateActionParameters(def, propertyKeys, def.objectType.apiName);\n const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter(ds => ds.type === \"derived\").flatMap(ds => Object.keys(ds.propertyMapping));\n const propertyParameters = propertyKeys.filter(id => !Object.keys(def.nonParameterMappings ?? {}).includes(id) && !def.excludedProperties?.includes(id) && !isVector(getProperty(def.objectType, id)?.type) && id !== def.objectType.primaryKeyPropertyApiName && !propertiesWithDerivedDatasources.includes(id));\n const parameterNames = new Set(propertyParameters);\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(param));\n parameterNames.add(CREATE_OR_MODIFY_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `create-or-modify-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(CREATE_OR_MODIFY_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(CREATE_OR_MODIFY_OBJECT_PARAMETER);\n }\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, toPropertyMap(def.objectType), parameterNames);\n parameters.forEach(p => {\n // create prefilled parameters for object type properties unless overridden\n const property = getProperty(def.objectType, p.id);\n if (property && !isStruct(property.type) && p.defaultValue === undefined) {\n p.defaultValue = {\n type: \"objectParameterPropertyValue\",\n objectParameterPropertyValue: {\n parameterId: CREATE_OR_MODIFY_OBJECT_PARAMETER,\n propertyTypeId: p.id\n }\n };\n }\n });\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Create or Modify ${def.objectType.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"addOrModifyObjectRuleV2\",\n addOrModifyObjectRuleV2: {\n objectToModify: CREATE_OR_MODIFY_OBJECT_PARAMETER,\n propertyValues: {\n ...createPropertyParameterValues(def, propertyParameters),\n ...mappings\n },\n structFieldValues: createStructFieldValues(def, parameters)\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, propertyKeys, parameters, CREATE_OR_MODIFY_OBJECT_PARAMETER),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, defineAction, kebab } from \"./defineAction.js\";\nimport { importedTypes, namespace, ontologyDefinition, withoutNamespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nexport function defineDeleteInterfaceLinkAction(defInput) {\n const def = cloneDefinition(defInput);\n const linkConstraint = typeof def.interfaceLink === \"string\" ? undefined : def.interfaceLink;\n !(linkConstraint === undefined || def.from === undefined || def.from.apiName === linkConstraint.from.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"from\" (\"${def.from?.apiName}\") does not match the interface (\"${linkConstraint?.from.apiName}\") that interface link constraint \"${linkConstraint?.apiName}\" was defined on. Omit \"from\" to use the constraint's own interface.`) : invariant(false) : void 0;\n const from = def.from ?? linkConstraint?.from;\n !(from !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"from\" is required when \"interfaceLink\" is provided as a string (the api name).`) : invariant(false) : void 0;\n const interfaceLinkApiName = typeof def.interfaceLink === \"string\" ? def.interfaceLink : def.interfaceLink.apiName;\n const linkApiName = combineApiNamespaceIfMissing(namespace, interfaceLinkApiName);\n const link = from.links.find(l => l.metadata.apiName === linkApiName);\n !(link !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link constraint \"${interfaceLinkApiName}\" not found on interface \"${from.apiName}\". Define it with defineInterfaceLinkConstraint first.`) : invariant(false) : void 0;\n !(link.linkedEntityTypeId.type === \"interfaceType\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface link constraint \"${interfaceLinkApiName}\" on \"${from.apiName}\" does not link to an interface type.`) : invariant(false) : void 0;\n const targetApiName = link.linkedEntityTypeId.interfaceType;\n !(ontologyDefinition.INTERFACE_TYPE[targetApiName] !== undefined || importedTypes.INTERFACE_TYPE[targetApiName] !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Target interface \"${targetApiName}\" of interface link constraint \"${interfaceLinkApiName}\" is not defined.`) : invariant(false) : void 0;\n const sourceId = def.sourceParameter?.id ?? \"source\";\n const targetId = def.targetParameter?.id ?? \"target\";\n !(sourceId !== targetId) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\"sourceParameter.id\" and \"targetParameter.id\" must differ, but both resolved to \"${sourceId}\".`) : invariant(false) : void 0;\n\n // A delete operates on a single existing link (one source, one target), so\n // both parameters are singular interface references regardless of the link's\n // cardinality.\n const sourceParam = {\n id: sourceId,\n displayName: def.sourceParameter?.displayName ?? from.displayMetadata.displayName,\n description: def.sourceParameter?.description,\n type: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: from.apiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n };\n const targetParam = {\n id: targetId,\n displayName: def.targetParameter?.displayName ?? withoutNamespace(targetApiName),\n description: def.targetParameter?.description,\n type: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: targetApiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n };\n const parameters = [sourceParam, targetParam];\n return defineAction({\n apiName: def.apiName ?? `delete-interface-link-${kebab(withoutNamespace(from.apiName))}-${kebab(withoutNamespace(interfaceLinkApiName))}`,\n displayName: def.displayName ?? `Delete ${from.displayMetadata.displayName} link`,\n description: def.description,\n status: def.status ?? \"active\",\n entities: {\n affectedInterfaceTypes: [from.apiName, targetApiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameters,\n rules: [{\n type: \"deleteInterfaceLinkRule\",\n deleteInterfaceLinkRule: {\n interfaceTypeRid: from.apiName,\n interfaceLinkTypeRid: linkApiName,\n sourceObject: sourceId,\n targetObject: targetId\n }\n }],\n parameterOrdering: [sourceId, targetId],\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(s => [s.id, s]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, defineAction, DELETE_OBJECT_PARAMETER, kebab } from \"./defineAction.js\";\nexport function defineDeleteInterfaceObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const parameters = [{\n id: DELETE_OBJECT_PARAMETER,\n displayName: def.parameterConfiguration?.[DELETE_OBJECT_PARAMETER]?.displayName ?? \"Delete object\",\n description: def.parameterConfiguration?.[DELETE_OBJECT_PARAMETER]?.description,\n type: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"interfaceObjectQuery\"\n }\n }\n }];\n return defineAction({\n apiName: def.apiName ?? `delete-interface-object-${kebab(def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName)}`,\n displayName: def.displayName ?? `Delete ${def.interfaceType.displayMetadata.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: DELETE_OBJECT_PARAMETER\n }\n }],\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n ...(def.actionLevelValidation && {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, createParameters, defineAction, DELETE_OBJECT_PARAMETER, kebab } from \"./defineAction.js\";\nexport function defineDeleteObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n return defineAction({\n apiName: def.apiName ?? `delete-object-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`,\n displayName: def.displayName ?? `Delete ${def.objectType.displayName}`,\n description: def.description,\n parameters: createParameters(def, {}, new Set([DELETE_OBJECT_PARAMETER])),\n status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: DELETE_OBJECT_PARAMETER\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation)\n } : {}),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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\nexport function mapSimplifiedStatusToInterfaceTypeStatus(status) {\n switch (status.type) {\n case \"deprecated\":\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined\n }\n };\n case \"active\":\n return {\n type: \"active\",\n active: {}\n };\n case \"experimental\":\n return {\n type: \"experimental\",\n experimental: {}\n };\n case \"example\":\n return {\n type: \"example\",\n example: {}\n };\n default:\n throw new Error(`Invalid status type: ${status.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\n/**\n * The instruction with every property it references renamed by `rename`.\n */\nexport function mapPropertyNames(instruction, rename) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n return {\n type: \"addRequiredProperty\",\n property: rename(instruction.property)\n };\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.type}`);\n }\n}\n\n/** How each instruction variant is worded in messages to users. */\nfunction proseFor(instruction) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n {\n const {\n property: propertyApiName\n } = instruction;\n return {\n describe: `addRequiredProperty(\"${propertyApiName}\")`,\n finalization: `set \"${propertyApiName}\" to \\`required: true\\``,\n suggestedTransition: `{ id: \"require-${propertyApiName}\", title: \"Require ${propertyApiName}\", ` + `gracePeriod: { type: \"afterInstall\", days: 30 }, ` + `instructions: [{ type: \"addRequiredProperty\", property: \"${propertyApiName}\" }] }`\n };\n }\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.type}`);\n }\n}\nexport function describeInstruction(instruction) {\n return proseFor(instruction).describe;\n}\nexport function describeFinalization(instruction) {\n return proseFor(instruction).finalization;\n}\nexport function describeSuggestedTransition(instruction) {\n return proseFor(instruction).suggestedTransition;\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 invariant from \"tiny-invariant\";\nimport { describeInstruction } from \"./describeInterfaceSchemaMigrationInstruction.js\";\nimport { isInterfacePropertyRequired } from \"./InterfacePropertyType.js\";\n// Constants enforced by OMS at installation-time.\nconst MAX_TRANSITIONS = 20;\nconst MAX_INSTRUCTIONS = 500;\nconst MAX_ID_LENGTH = 150;\nconst ID_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/u;\nconst MAX_TITLE_LENGTH = 500;\nconst MAX_DESCRIPTION_LENGTH = 2000;\nconst MIN_GRACE_PERIOD_DAYS = 7;\nconst MAX_GRACE_PERIOD_DAYS = 180;\n\n/**\n * Structural validation for authored Interface Type Schema Migrations.\n */\nexport function validateInterfaceSchemaMigrations(interfaceApiName, schemaMigrations,\n// The interface type's locally-defined properties; inherited properties are not included\n// (since migrations for those should occur in the interface that defines them)\npropertiesV3) {\n const {\n transitions\n } = schemaMigrations;\n !(transitions.length <= MAX_TRANSITIONS) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface ${interfaceApiName} has ${transitions.length} schema migration transitions, which exceeds the maximum of ${MAX_TRANSITIONS}.`) : invariant(false) : void 0;\n const seenIds = new Set();\n // Which transition owns a claim, to prevent conflicting migrations.\n const claimedBy = new Map();\n for (const transition of transitions) {\n const {\n id,\n title,\n description,\n gracePeriod,\n instructions\n } = transition;\n !(id.length > 0 && id.length <= MAX_ID_LENGTH) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition id \"${id}\" on interface ${interfaceApiName} must be between 1 and ${MAX_ID_LENGTH} characters, but was ${id.length}.`) : invariant(false) : void 0;\n !ID_PATTERN.test(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition id \"${id}\" on interface ${interfaceApiName} must match ${ID_PATTERN.source}: a letter or digit followed by letters, digits, underscores, or dashes.`) : invariant(false) : void 0;\n !!seenIds.has(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Duplicate schema migration transition id \"${id}\" on interface ${interfaceApiName}.`) : invariant(false) : void 0;\n seenIds.add(id);\n !(title.length > 0 && title.length <= MAX_TITLE_LENGTH) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} must have a title between 1 and ${MAX_TITLE_LENGTH} characters, but was ${title.length}.`) : invariant(false) : void 0;\n if (description !== undefined) {\n !(description.length <= MAX_DESCRIPTION_LENGTH) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} has a description of length ${description.length}, which exceeds the maximum of ${MAX_DESCRIPTION_LENGTH}.`) : invariant(false) : void 0;\n }\n !(instructions.length > 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} must have at least one instruction.`) : invariant(false) : void 0;\n !(instructions.length <= MAX_INSTRUCTIONS) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} has ${instructions.length} instructions, which exceeds the maximum of ${MAX_INSTRUCTIONS}.`) : invariant(false) : void 0;\n validateGracePeriod(interfaceApiName, id, gracePeriod);\n for (const instruction of instructions) {\n const instructionDescription = describeInstruction(instruction);\n for (const claim of getClaims(instruction)) {\n const conflict = claimedBy.get(claim);\n !(conflict === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${id}\" on interface ${interfaceApiName} declares ${instructionDescription}, which conflicts with ${conflict?.description} already declared by transition \"${conflict?.transitionId}\". A property may be migrated by at most one in-flight transition.`) : invariant(false) : void 0;\n claimedBy.set(claim, {\n transitionId: id,\n description: instructionDescription\n });\n }\n validateInstruction(interfaceApiName, id, instruction, propertiesV3);\n }\n }\n}\nexport function isCanonicalIsoUtcDatetime(value) {\n const asIsoString = Number.isNaN(Date.parse(value)) ? undefined : new Date(value).toISOString();\n return asIsoString !== undefined && (\n // Ensures the declared deadline is actually an ISO string, rather than a bare date-only string\n // (so we don't have to pick whether a bare date means \"done by this day\" or \"done at the end\n // of this day\")\n value === asIsoString || value === asIsoString.replace(/\\.000Z$/u, \"Z\"));\n}\nfunction validateGracePeriod(apiName, transitionId, gracePeriod) {\n switch (gracePeriod.type) {\n case \"afterInstall\":\n {\n const {\n days\n } = gracePeriod;\n !(Number.isInteger(days) && days >= MIN_GRACE_PERIOD_DAYS && days <= MAX_GRACE_PERIOD_DAYS) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${transitionId}\" on interface ${apiName} has an 'afterInstall' grace period of ${days} days, but days must be an integer in [${MIN_GRACE_PERIOD_DAYS}, ${MAX_GRACE_PERIOD_DAYS}] (inclusive).`) : invariant(false) : void 0;\n return;\n }\n case \"deadline\":\n {\n const {\n deadline\n } = gracePeriod;\n !isCanonicalIsoUtcDatetime(deadline) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${transitionId}\" on interface ${apiName} has a 'deadline' grace period of \"${deadline}\", which is not a canonical ISO-8601 UTC datetime (e.g. \"2026-01-31T00:00:00Z\").`) : invariant(false) : void 0;\n return;\n }\n default:\n {\n const unhandled = gracePeriod;\n throw new Error(`Unknown schema migration grace period type: ${unhandled.type}`);\n }\n }\n}\nfunction validateInstruction(interfaceApiName, transitionId, instruction, propertiesV3) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n {\n const {\n property: propertyApiName\n } = instruction;\n !Object.hasOwn(propertiesV3, propertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${transitionId}\" on interface ${interfaceApiName} references property \"${propertyApiName}\" via ${instruction.type}, but interface ${interfaceApiName} does not declare that property. Properties inherited from an extended interface must be migrated by a transition on the interface that declares them.`) : invariant(false) : void 0;\n !!isInterfacePropertyRequired(propertiesV3[propertyApiName]) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Schema migration transition \"${transitionId}\" on interface ${interfaceApiName} targets property \"${propertyApiName}\" via ${instruction.type}, but that property is required. Only properties declared required: false may be targeted.`) : invariant(false) : void 0;\n return;\n }\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.type}`);\n }\n}\n\n/**\n * What an instruction claims exclusive use of for the duration of its transition.\n *\n * Stacked migrations (i.e. those which operate against the same property, etc.) are not allowed today,\n * so we reject any conflicting migrations that try to claim the same thing,\n */\nfunction getClaims(instruction) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n return [`property:${instruction.property}`];\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.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 invariant from \"tiny-invariant\";\n/**\n * Interface schema migrations are opted into by a whole family of interfaces, not by one interface\n * at a time: an object type implementing an interface has to implement everything that interface\n * inherits too, so the inherited half of its schema needs the same backwards-compatibility\n * guarantees as the locally-declared half.\n */\nexport function validateSchemaMigrationsFamilyOptIn(interfaceApiName, optedIn, parents) {\n for (const parent of parents) {\n const parentOptedIn = parent.schemaMigrations !== undefined;\n !(parentOptedIn === optedIn) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${optedIn ? `Interface ${interfaceApiName} declares \\`schemaMigrations\\`, but the interface it extends, ${parent.apiName}, does not.` : `Interface ${interfaceApiName} extends ${parent.apiName}, which declares \\`schemaMigrations\\`, but ${interfaceApiName} does not.`} Interface schema migrations must be enabled for an entire interface hierarchy, since an object type implementing ${interfaceApiName} must implement the properties it inherits from ${parent.apiName} too. Add \\`schemaMigrations\\` to ${optedIn ? parent.apiName : interfaceApiName}, or remove it from ${optedIn ? interfaceApiName : parent.apiName}.`) : invariant(false) : void 0;\n }\n}","/*\n * Copyright 2024 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 { API_NAME_PATTERN, isValidApiName, isValidNamespacedApiName, NAMESPACED_API_NAME_PATTERN } from \"../util/ApiNameValidator.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { namespace, ontologyDefinition, updateOntology, withoutNamespace } from \"./defineOntology.js\";\nimport { isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nimport { mapSimplifiedStatusToInterfaceTypeStatus } from \"./interface/mapSimplifiedStatusToInterfaceTypeStatus.js\";\nimport { validateInterfaceSchemaMigrations } from \"./interface/validateInterfaceSchemaMigrations.js\";\nimport { validateSchemaMigrationsFamilyOptIn } from \"./interface/validateSchemaMigrationsFamilyOptIn.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nimport { isExotic, isPropertyTypeType } from \"./properties/PropertyTypeType.js\";\nimport { validateDisplayMetadataLengths, validateStructFieldMetadata } from \"./validateMetadataLengths.js\";\nexport function defineInterface(interfaceDefInput) {\n const interfaceDef = cloneDefinition(interfaceDefInput);\n const apiName = namespace + interfaceDef.apiName;\n !(ontologyDefinition[OntologyEntityTypeEnum.INTERFACE_TYPE][apiName] === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface ${apiName} already exists`) : invariant(false) : void 0;\n !isValidNamespacedApiName(interfaceDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${interfaceDef.apiName}. API names must match the regex ${NAMESPACED_API_NAME_PATTERN}.`) : invariant(false) : void 0;\n\n // legacy support for propertiesV2 (only SPTs)\n const spts = Object.fromEntries(Object.entries(interfaceDef.properties ?? {}).filter(([_name, prop]) => {\n return isInterfaceSharedPropertyType(prop) || \"apiName\" in prop;\n }).map(([s, spt]) => {\n const required = isInterfaceSharedPropertyType(spt) ? spt.required : true;\n return [s, {\n sharedPropertyType: isInterfaceSharedPropertyType(spt) ? spt.sharedPropertyType : spt,\n required\n }];\n }));\n const propertiesV2 = Object.fromEntries(Object.entries(spts).map(([propName, type]) => {\n const sptApiName = combineApiNamespaceIfMissing(namespace, type.sharedPropertyType.apiName);\n return [sptApiName, {\n required: type.required,\n sharedPropertyType: verifyBasePropertyDefinition(namespace, propName, type.sharedPropertyType)\n }];\n }));\n const propertiesV3 = Object.fromEntries(Object.entries(interfaceDef.properties ?? {}).map(([apiName, prop]) => {\n !isValidApiName(apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${apiName} for property on interface ${interfaceDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`) : invariant(false) : void 0;\n const required = typeof prop === \"object\" && isInterfaceSharedPropertyType(prop) ? prop.required : true;\n const propertyBase = typeof prop === \"object\" && isInterfaceSharedPropertyType(prop) ? prop.sharedPropertyType : prop;\n if (typeof propertyBase === \"object\" && \"nonNameSpacedApiName\" in propertyBase) {\n // SPT\n return [apiName, {\n required,\n sharedPropertyType: propertyBase\n }];\n } else {\n // IDP\n return [apiName, propertyBase];\n }\n }));\n const extendsInterfaces = interfaceDef.extends ? Array.isArray(interfaceDef.extends) ? interfaceDef.extends : [interfaceDef.extends] : [];\n const status = mapSimplifiedStatusToInterfaceTypeStatus(interfaceDef.status ?? {\n type: \"active\"\n });\n !(status.type !== \"deprecated\" || status.deprecated.message && status.deprecated.deadline) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Deprecated status must include message and deadline properties.`) : invariant(false) : void 0;\n const fullInterface = {\n apiName,\n displayMetadata: {\n displayName: interfaceDef.displayName ?? interfaceDef.apiName,\n description: interfaceDef.description ?? interfaceDef.displayName ?? interfaceDef.apiName,\n icon: interfaceDef.icon !== undefined ? {\n type: \"blueprint\",\n blueprint: {\n color: interfaceDef.icon.color,\n locator: interfaceDef.icon.locator\n }\n } : undefined\n },\n extendsInterfaces,\n linkedInterfaces: [],\n links: [],\n actionTypeConstraints: [],\n status,\n propertiesV2,\n propertiesV3,\n permission: interfaceDef.permission,\n searchable: interfaceDef.searchable ?? true,\n schemaMigrations: interfaceDef.schemaMigrations !== undefined ? structuredClone(interfaceDef.schemaMigrations) : undefined,\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE\n };\n const context = `Interface \"${apiName}\"`;\n validateDisplayMetadataLengths(fullInterface.displayMetadata, context);\n for (const [propertyApiName, property] of Object.entries(propertiesV3)) {\n if (isInterfaceSharedPropertyType(property)) {\n continue;\n }\n const propertyContext = `${context}, property \"${propertyApiName}\"`;\n validateDisplayMetadataLengths({\n ...property,\n displayName: property.displayName ?? propertyApiName\n }, propertyContext);\n validateStructFieldMetadata(property.type, propertyContext);\n }\n if (interfaceDef.schemaMigrations !== undefined) {\n validateInterfaceSchemaMigrations(apiName, interfaceDef.schemaMigrations, propertiesV3);\n }\n validateSchemaMigrationsFamilyOptIn(apiName, interfaceDef.schemaMigrations !== undefined, extendsInterfaces.flatMap(parent => ontologyDefinition[OntologyEntityTypeEnum.INTERFACE_TYPE][parent.apiName] ?? []));\n updateOntology(fullInterface);\n return fullInterface;\n}\nfunction verifyBasePropertyDefinition(namespace, apiName, type) {\n const unNamespacedTypeApiName = withoutNamespace(type.apiName);\n !(isPropertyTypeType(type.type) || isExotic(type.type)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid data type ${JSON.stringify(type)} for property ${apiName} on InterfaceType ${apiName}`) : invariant(false) : void 0;\n !(namespace + apiName === type.apiName || apiName === unNamespacedTypeApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `property key and it's apiName must be identical. ${JSON.stringify({\n key: apiName,\n apiName: type.apiName\n })}`) : invariant(false) : void 0;\n 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 invariant from \"tiny-invariant\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { importedTypes, namespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nexport function defineInterfaceActionTypeConstraint(input) {\n const def = cloneDefinition(input);\n !(importedTypes[OntologyEntityTypeEnum.INTERFACE_TYPE][def.interfaceType.apiName] == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot define an action type constraint on imported interface ${def.interfaceType.apiName}. The interface must be locally defined.`) : invariant(false) : void 0;\n const apiNameWithNamespace = combineApiNamespaceIfMissing(namespace, def.apiName);\n !(def.interfaceType.actionTypeConstraints.find(a => a.metadata.apiName === apiNameWithNamespace) == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action type constraint with apiName ${apiNameWithNamespace} already exists on interface ${def.interfaceType.apiName}`) : invariant(false) : void 0;\n const parameters = {};\n const seenParamApiNames = new Set();\n for (const param of def.parameters) {\n !!seenParamApiNames.has(param.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Duplicate parameter constraint apiName \"${param.apiName}\" in action type constraint ${apiNameWithNamespace}`) : invariant(false) : void 0;\n seenParamApiNames.add(param.apiName);\n parameters[param.apiName] = {\n displayMetadata: {\n displayName: param.displayName,\n apiName: param.apiName\n },\n type: param.type,\n requireImplementation: param.requireImplementation\n };\n }\n def.interfaceType.actionTypeConstraints.push({\n metadata: {\n apiName: apiNameWithNamespace,\n displayName: def.displayName,\n description: def.description\n },\n parameters,\n requireImplementation: def.requireImplementation\n });\n}","/*\n * Copyright 2024 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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { importedTypes, namespace, withoutNamespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nimport { validateDisplayMetadataLengths } from \"./validateMetadataLengths.js\";\nexport function defineInterfaceLinkConstraint(linkDefInput) {\n const linkDef = cloneDefinition(linkDefInput);\n !(importedTypes[OntologyEntityTypeEnum.INTERFACE_TYPE][linkDef.from.apiName] == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot define a link constraint from imported interface ${linkDef.from.apiName}. The \"from\" side must be a locally defined interface.`) : invariant(false) : void 0;\n const fromLinkMeta = getLinkMeta(linkDef);\n validateDisplayMetadataLengths(fromLinkMeta, `Interface \"${linkDef.from.apiName}\", link \"${fromLinkMeta.apiName}\"`);\n !(linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName) == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`) : invariant(false) : void 0;\n const cardinality = linkDef.toMany ? \"MANY\" : \"SINGLE\";\n const to = linkDef.toMany ?? linkDef.toOne;\n linkDef.from.links.push({\n cardinality,\n linkedEntityTypeId: getLinkedType(to),\n metadata: fromLinkMeta,\n required: linkDef.required ?? true\n });\n linkDef.from.linkedInterfaces?.push(to);\n return {\n apiName: fromLinkMeta.apiName,\n from: linkDef.from,\n to,\n cardinality\n };\n}\nfunction getLinkedType(t) {\n return {\n type: \"interfaceType\",\n interfaceType: typeof t === \"string\" ? t : t.apiName\n };\n}\nfunction getLinkMeta(meta) {\n const {\n apiName,\n displayName,\n description\n } = meta;\n const apiNameWithNamespace = combineApiNamespaceIfMissing(namespace, apiName);\n const apiNameWithoutNamespace = withoutNamespace(apiNameWithNamespace);\n return {\n apiName: apiNameWithNamespace,\n displayName: displayName ?? apiNameWithoutNamespace,\n description: description ?? displayName ?? apiNameWithoutNamespace\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 { isValidApiName } from \"../util/ApiNameValidator.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { convertToPluralDisplayName, uppercaseFirstLetter } from \"./defineObject.js\";\nimport { ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { validateDisplayMetadataLengths } from \"./validateMetadataLengths.js\";\nexport function defineLink(linkDefinitionInput) {\n const linkDefinition = cloneDefinition(linkDefinitionInput);\n if (ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE][linkDefinition.apiName] !== undefined) {\n throw new Error(`Link type with apiName ${linkDefinition.apiName} is already defined`);\n }\n // Validation involving linked objects is deferred to convertLink.ts because\n // circular dependencies can reference objects that have not been defined yet.\n\n let fullLinkDefinition;\n if (\"one\" in linkDefinition) {\n fullLinkDefinition = {\n ...linkDefinition,\n one: convertUserOneToManyLinkDefinition(linkDefinition.one),\n toMany: convertUserOneToManyLinkDefinition(linkDefinition.toMany)\n };\n } else if (\"intermediaryObjectType\" in linkDefinition) {\n fullLinkDefinition = {\n ...linkDefinition,\n many: convertUserIntermediaryLinkDefinition(linkDefinition.many),\n toMany: convertUserIntermediaryLinkDefinition(linkDefinition.toMany)\n };\n } else {\n fullLinkDefinition = {\n ...linkDefinition,\n many: convertUserManyToManyLinkDefinition(linkDefinition.many),\n toMany: convertUserManyToManyLinkDefinition(linkDefinition.toMany)\n };\n }\n const linkType = {\n cardinality: \"one\" in linkDefinition ? linkDefinition.cardinality : undefined,\n ...fullLinkDefinition,\n apiName: linkDefinition.apiName,\n __type: OntologyEntityTypeEnum.LINK_TYPE\n };\n const sides = \"one\" in linkType ? {\n one: linkType.one,\n toMany: linkType.toMany\n } : {\n many: linkType.many,\n toMany: linkType.toMany\n };\n for (const [side, link] of Object.entries(sides)) {\n validateDisplayMetadataLengths(link.metadata.displayMetadata, `Link type \"${linkType.apiName}\", ${side} \"${link.metadata.apiName}\"`);\n }\n updateOntology(linkType);\n return linkType;\n}\nfunction convertUserOneToManyLinkDefinition(oneToMany) {\n return {\n ...oneToMany,\n metadata: convertLinkTypeMetadata(oneToMany.metadata)\n };\n}\nfunction convertUserManyToManyLinkDefinition(manyToMany) {\n return {\n ...manyToMany,\n metadata: convertLinkTypeMetadata(manyToMany.metadata)\n };\n}\nfunction convertUserIntermediaryLinkDefinition(intermediary) {\n return {\n ...intermediary,\n metadata: convertLinkTypeMetadata(intermediary.metadata)\n };\n}\nfunction convertLinkTypeMetadata(metadata) {\n !isValidApiName(metadata.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name for link: ${metadata.apiName}`) : invariant(false) : void 0;\n return {\n apiName: metadata.apiName,\n displayMetadata: {\n displayName: metadata.displayName ?? uppercaseFirstLetter(metadata.apiName),\n pluralDisplayName: metadata.pluralDisplayName ?? convertToPluralDisplayName(metadata.apiName),\n visibility: metadata.visibility ?? \"NORMAL\",\n groupDisplayName: metadata.groupDisplayName ?? \"\"\n },\n typeClasses: metadata.typeClasses ?? []\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 { convertInterfacePropertyMappingValue, convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, getNonNamespacedParameterName, isPropertyParameter, kebab, MODIFY_INTERFACE_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { getInterfacePropertyTypeType, isInterfaceSharedPropertyType } from \"./interface/InterfacePropertyType.js\";\nexport function defineModifyInterfaceObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);\n const actionInterfaceProperties = Object.entries(allProperties).filter(([apiName, type]) => {\n return isPropertyParameter(def, apiName, getInterfacePropertyTypeType(type));\n });\n const sptNames = actionInterfaceProperties.filter(([_apiName, type]) => isInterfaceSharedPropertyType(type)).map(([apiName]) => apiName);\n const parameterNames = new Set(actionInterfaceProperties.map(([apiName, _type]) => getInterfaceParameterName(def, apiName)));\n const propertyMap = Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [getInterfaceParameterName(def, id), prop]));\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(getInterfaceParameterName(def, param)));\n parameterNames.add(MODIFY_INTERFACE_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `modify-${kebab(def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName)}${def.objectType === undefined ? \"\" : `-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`}`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(MODIFY_INTERFACE_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(MODIFY_INTERFACE_OBJECT_PARAMETER);\n }\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, propertyMap, parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required ?? true])));\n let sptMappings = {};\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => {\n if (sptNames.includes(id)) {\n sptMappings = {\n ...sptMappings,\n [id]: convertMappingValue(value)\n };\n }\n return [id, convertInterfacePropertyMappingValue(value)];\n }));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Modify ${def.interfaceType.displayMetadata.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? (def.interfaceType.status.type !== \"deprecated\" ? def.interfaceType.status.type : def.interfaceType.status),\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n rules: [{\n type: \"modifyInterfaceRule\",\n modifyInterfaceRule: {\n interfaceApiName: def.interfaceType.apiName,\n interfaceObjectToModifyParameter: \"interfaceObjectToModifyParameter\",\n sharedPropertyValues: {\n ...Object.fromEntries(sptNames.map(id => [id, {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id\n }])),\n ...sptMappings\n },\n interfacePropertyValues: {\n ...Object.fromEntries(actionInterfaceProperties.map(([id, _type]) => [id, {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id\n }\n }])),\n ...mappings\n }\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Array.from(parameterNames), parameters, MODIFY_INTERFACE_OBJECT_PARAMETER),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { cloneDefinition } from \"./cloneDefinition.js\";\nimport { convertValidationRule, createDefaultParameterOrdering, createParameters, createPropertyParameterValues, createStructFieldValues, defineAction, isPropertyParameter, kebab, MODIFY_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getProperty, getPropertyKeys, toPropertyMap } from \"./object/objectPropertyHelpers.js\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\nexport function defineModifyObjectAction(defInput) {\n const def = cloneDefinition(defInput);\n const propertyKeys = getPropertyKeys(def.objectType);\n validateActionParameters(def, propertyKeys, def.objectType.apiName);\n const propertyParameters = propertyKeys.filter(id => isPropertyParameter(def, id, getProperty(def.objectType, id)?.type) && id !== def.objectType.primaryKeyPropertyApiName);\n const parameterNames = new Set(propertyParameters);\n Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(param));\n parameterNames.add(MODIFY_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `modify-object-${kebab(def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName)}`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(MODIFY_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(MODIFY_OBJECT_PARAMETER);\n }\n validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);\n }\n const parameters = createParameters(def, toPropertyMap(def.objectType), parameterNames);\n parameters.forEach(p => {\n // create prefilled parameters for object type properties unless overridden\n const property = getProperty(def.objectType, p.id);\n if (property && !isStruct(property.type) && p.defaultValue === undefined) {\n p.defaultValue = {\n type: \"objectParameterPropertyValue\",\n objectParameterPropertyValue: {\n parameterId: MODIFY_OBJECT_PARAMETER,\n propertyTypeId: p.id\n }\n };\n }\n });\n const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName ?? `Modify ${def.objectType.displayName}`,\n description: def.description,\n parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"modifyObjectRule\",\n modifyObjectRule: {\n objectToModify: MODIFY_OBJECT_PARAMETER,\n propertyValues: {\n ...createPropertyParameterValues(def, propertyParameters),\n ...mappings\n },\n structFieldValues: createStructFieldValues(def, parameters)\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, propertyKeys, parameters, MODIFY_OBJECT_PARAMETER),\n ...(def.actionLevelValidation ? {\n validation: convertValidationRule(def.actionLevelValidation, parameters)\n } : {}),\n ...(def.defaultFormat && {\n defaultFormat: def.defaultFormat\n }),\n ...(def.enableLayoutSwitch && {\n enableLayoutSwitch: def.enableLayoutSwitch\n }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration\n }\n }),\n ...(def.sections && {\n sections: Object.fromEntries(def.sections.map(section => [section.id, section]))\n }),\n ...(def.submissionMetadata && {\n submissionMetadata: def.submissionMetadata\n }),\n ...(def.permission && {\n permission: def.permission\n }),\n ...(def.icon && {\n icon: def.icon\n })\n });\n}","/*\n * Copyright 2024 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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldNotHaveRenderHints } from \"./propertyConversionUtils.js\";\nimport { validateDisplayMetadataLengths, validateStructFieldMetadata } from \"./validateMetadataLengths.js\";\nexport function defineSharedPropertyType(sptDefInput) {\n const sptDef = cloneDefinition(sptDefInput);\n const apiName = namespace + sptDef.apiName;\n !(ontologyDefinition[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE][apiName] === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${apiName} already exists`) : invariant(false) : void 0;\n !(!shouldNotHaveRenderHints(sptDef.type) || !hasRenderHints(sptDef.typeClasses)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${apiName} of type '${getPropertyTypeName(sptDef.type)}' should not have render hints`) : invariant(false) : void 0;\n const fullSpt = {\n ...sptDef,\n apiName,\n nonNameSpacedApiName: sptDef.apiName,\n displayName: sptDef.displayName ?? sptDef.apiName,\n // This way the non-namespaced api name is the display name (maybe not ideal)\n typeClasses: sptDef.typeClasses ?? (shouldNotHaveRenderHints(sptDef.type) ? [] : defaultTypeClasses),\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE\n };\n const context = `Shared property type \"${apiName}\"`;\n validateDisplayMetadataLengths(fullSpt, context);\n validateStructFieldMetadata(fullSpt.type, context);\n updateOntology(fullSpt);\n return fullSpt;\n}","/*\n * Copyright 2024 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 { cloneDefinition } from \"./cloneDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { validateMetadataLength, VALUE_TYPE_DESCRIPTION_LIMIT, VALUE_TYPE_DISPLAY_NAME_LIMIT } from \"./validateMetadataLengths.js\";\nfunction convertValueTypeTypeToBaseType(valueType) {\n if (typeof valueType === \"string\") {}\n switch (true) {\n case typeof valueType === \"object\" && valueType.type === \"array\":\n return {\n type: \"array\",\n array: {\n elementType: convertValueTypeTypeToBaseType(valueType.elementType)\n }\n };\n case typeof valueType === \"object\" && valueType.type === \"struct\":\n return {\n type: \"structV2\",\n structV2: {\n fields: valueType.fields.map(field => ({\n identifier: field.identifier,\n baseType: convertValueTypeTypeToBaseType(field.baseType)\n }))\n }\n };\n case typeof valueType === \"object\" && valueType.type === \"map\":\n return {\n type: \"map\",\n map: {\n keyType: convertValueTypeTypeToBaseType(valueType.keyType),\n valueType: convertValueTypeTypeToBaseType(valueType.valueType)\n }\n };\n case typeof valueType === \"object\" && valueType.type === \"optional\":\n return {\n type: \"optional\",\n optional: {\n wrappedType: convertValueTypeTypeToBaseType(valueType.wrappedType)\n }\n };\n case typeof valueType === \"string\":\n return {\n type: valueType,\n [valueType]: {}\n };\n default:\n throw new Error(\"Invalid ValueTypeType\");\n }\n}\nexport function defineValueType(valueTypeDefInput) {\n const valueTypeDef = cloneDefinition(valueTypeDefInput);\n const {\n apiName: inputApiName,\n displayName,\n description,\n type,\n version,\n namespacePrefix\n } = valueTypeDef;\n const apiName = namespacePrefix ? namespace + inputApiName : inputApiName;\n const semverValidation = /^((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)$/u;\n !semverValidation.test(version) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Version is not a valid semver\") : invariant(false) : void 0;\n const existingVersions = ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][apiName] ?? [];\n const duplicateVersion = existingVersions.find(vt => vt.version === version);\n !(duplicateVersion === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Value type with apiName ${apiName} and version ${version} is already defined`) : invariant(false) : void 0;\n const typeName = typeof type.type === \"string\" ? type.type : type.type.type === \"struct\" ? \"structV2\" : type.type.type;\n // These suck but TS doesn't understand the relationship from the key of the base type to the type string\n const constraints = type.constraints ? type.constraints.map(constraint => {\n const output = {\n constraint: {\n type: typeName,\n [typeName]: constraint.constraint\n },\n failureMessage: constraint.failureMessage\n };\n return {\n constraint: output\n };\n }) : [];\n const baseType = convertValueTypeTypeToBaseType(type.type);\n const vt = {\n apiName,\n packageNamespace: namespace.substring(0, namespace.length - 1),\n displayMetadata: {\n displayName: displayName,\n description: description ?? \"\"\n },\n status: convertUserValueTypeStatusToValueTypeStatus(valueTypeDef.status),\n version: version,\n baseType: baseType,\n constraints: constraints,\n exampleValues: [],\n __type: OntologyEntityTypeEnum.VALUE_TYPE\n };\n const context = `Value type \"${apiName}\" version \"${version}\"`;\n validateMetadataLength(vt.displayMetadata.displayName, \"displayName\", context, VALUE_TYPE_DISPLAY_NAME_LIMIT, \"UTF-16 code units\");\n validateMetadataLength(vt.displayMetadata.description, \"description\", context, VALUE_TYPE_DESCRIPTION_LIMIT, \"UTF-16 code units\");\n updateOntology(vt);\n return vt;\n}\nexport function convertUserValueTypeStatusToValueTypeStatus(status) {\n if (typeof status === \"object\" && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: status.replacedBy\n }\n };\n }\n return {\n type: \"active\",\n active: {}\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 { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { importedTypes } from \"./defineOntology.js\";\nexport function importOntologyEntity(e) {\n if (e.__type !== OntologyEntityTypeEnum.VALUE_TYPE) {\n importedTypes[e.__type][e.apiName] = e;\n if (e.__type === OntologyEntityTypeEnum.OBJECT_TYPE) {\n const objectType = importedTypes.OBJECT_TYPE[e.apiName];\n for (const property of objectType.properties ?? []) {\n const sharedPropertyType = property.sharedPropertyType;\n if (sharedPropertyType !== undefined && !Object.hasOwn(importedTypes.SHARED_PROPERTY_TYPE, sharedPropertyType.apiName)) {\n importedTypes.SHARED_PROPERTY_TYPE[sharedPropertyType.apiName] = sharedPropertyType;\n }\n }\n }\n return;\n }\n // value types are a special case\n if (importedTypes[OntologyEntityTypeEnum.VALUE_TYPE][e.apiName] === undefined) {\n importedTypes[OntologyEntityTypeEnum.VALUE_TYPE][e.apiName] = [];\n }\n importedTypes[OntologyEntityTypeEnum.VALUE_TYPE][e.apiName].push(e);\n}","/*\n * Copyright 2024 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 { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { importOntologyEntity } from \"./importOntologyEntity.js\";\n/**\n * Defines a foreign shared property type you want to take as an input to your product. The typeHint field is used for OSDK generation\n */\nexport function importSharedPropertyType(opts) {\n const {\n apiName,\n packageName,\n typeHint,\n array\n } = opts;\n const fullApiName = packageName === undefined ? apiName : `${packageName}.${apiName}`;\n if (packageName !== undefined) {\n !!packageName.endsWith(\".\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Package name format invalid ends with period\") : invariant(false) : void 0;\n !(packageName.match(\"[A-Z]\") == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Package name includes upper case characters\") : invariant(false) : void 0;\n }\n const spt = {\n apiName: fullApiName,\n type: typeHint,\n nonNameSpacedApiName: apiName,\n array: array ?? false,\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE\n };\n importOntologyEntity(spt);\n return spt;\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 { importOntologyEntity } from \"./importOntologyEntity.js\";\n\n/**\n * Wraps an OntologyEntityType with a Proxy that calls importOntologyEntity when properties are accessed.\n *\n * @param entity - The OntologyEntityType to wrap with a Proxy\n * @returns A Proxy that imports the entity when properties are accessed\n */\nexport function wrapWithProxy(entity) {\n return new Proxy(entity, {\n get(target, prop, receiver) {\n importOntologyEntity(target);\n return Reflect.get(target, prop, receiver);\n }\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 { isDeepStrictEqual } from \"node:util\";\nimport { withoutNamespace } from \"../api/defineOntology.js\";\nexport const ONTOLOGY_SCHEMA_LOCKFILE_VERSION = 1;\nexport const DEFAULT_ONTOLOGY_SCHEMA_LOCKFILE_NAME = \"ontology-schema-lock.json\";\n\n/**\n * A record of the last-published shape of every interface type enrolled in schema migrations.\n *\n * `@osdk/maker` is a stateless `ontology.ts -> ontology.json` transformer, so it has nothing to\n * diff a new definition against to run backwards-compatibility checks. This lockfile supplies\n * that baseline (as a checked in source file), letting us reject at authoring-time any\n * definitions that would otherwise be rejected at installation-time.\n */\n\n/** Where a property's definition comes from. */\n\nexport function declarationOf(property) {\n return property.declaredBy ?? \"interface\";\n}\nexport function extensionsOf(schema) {\n return schema.extendsInterfaces ?? [];\n}\nexport function primaryKeyConstraintOf(property) {\n return property.primaryKeyConstraint ?? \"NO_RESTRICTION\";\n}\nexport const UNCONSTRAINED_NULLABILITY = {\n noNulls: false,\n noEmptyCollections: false\n};\nexport function nullabilityOf(property) {\n return property.nullability ?? UNCONSTRAINED_NULLABILITY;\n}\n\n/** Whether `next` obliges implementing object types to satisfy something `previous` did not. */\nexport function tightensNullability(previous, next) {\n return !previous.noNulls && next.noNulls || !previous.noEmptyCollections && next.noEmptyCollections;\n}\n\n/**\n * The key the author wrote for a property, given the api name the lockfile records it under.\n */\nexport function authoredKeyOf(wireApiName) {\n return withoutNamespace(wireApiName);\n}\n\n/**\n * `record`'s own value for `key`, or `undefined`.\n *\n * Every record in a lockfile is keyed by an author-chosen api name, and `API_NAME_PATTERN` admits\n * `constructor`, `toString` and friends. A persisted lockfile also arrives from `JSON.parse`, so\n * its records inherit from `Object.prototype`. A bare index read for one of those names would find\n * the inherited function instead of `undefined` and mistake it for a recorded entry.\n */\nexport function own(record, key) {\n return Object.hasOwn(record, key) ? record[key] : undefined;\n}\nexport function isEmptyLockfile(lockfile) {\n return lockedInterfaceCount(lockfile) === 0;\n}\n\n/** How many interfaces the lockfile tracks. */\nexport function lockedInterfaceCount(lockfile) {\n return Object.keys(lockfile.interfaces).length;\n}\n\n/** The api names of every locked interface whose recorded shape no longer matches the source. */\nexport function staleInterfaces(previousLockfile, nextLockfile) {\n const previous = new Map(Object.entries(previousLockfile.interfaces));\n const next = new Map(Object.entries(nextLockfile.interfaces));\n const apiNames = [...new Set([...previous.keys(), ...next.keys()])].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);\n return apiNames.filter(apiName => !isDeepStrictEqual(previous.get(apiName), next.get(apiName)));\n}\n\n// JSON has no comment syntax, but a `\"//\"` key is a conventional stand-in for one.\nexport const LOCKFILE_HEADER_KEY = \"//\";\nconst LOCKFILE_HEADER = [\"This is a generated file, do not modify manually.\", \"Run `maker --write-locks` to regenerate this file.\"];\nexport function serializeLockfile(lockfile) {\n // Insertion order is preserved for non-index keys, so the header serializes first.\n const withHeader = {\n [LOCKFILE_HEADER_KEY]: LOCKFILE_HEADER,\n ...lockfile\n };\n return JSON.stringify(withHeader, undefined, 2) + \"\\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\n/**\n * Keys that carry presentation-only values (e.g. descriptions, etc.). These are dropped wherever\n * they appear as they should not affect backwards-compatibility checks.\n */\nconst PRESENTATION_KEYS = [\"displayMetadata\"];\nfunction isPresentationKey(key) {\n return PRESENTATION_KEYS.includes(key);\n}\n\n/** A property's locked type, without fields that do not affect backwards-compatibility. */\n\n/**\n * Strips the parts of a type that carry no compatibility meaning.\n *\n * @param array whether the property holds a list of `type` rather than a single value\n */\nexport function normalizePropertyType(type, array) {\n const subtype = strip(type);\n return array ? {\n type: \"array\",\n subtype\n } : subtype;\n}\n\n/** How a property's type is named in error messages and in the rendered lockfile diff. */\nexport function describeType(type) {\n return isArrayType(type) ? `${describeType(type.subtype)}[]` : JSON.stringify(type);\n}\nfunction isArrayType(type) {\n return typeof type === \"object\" && type.type === \"array\";\n}\nfunction strip(value) {\n if (Array.isArray(value)) {\n return value.map(strip);\n }\n if (typeof value !== \"object\" || value == null) {\n return value;\n }\n return Object.fromEntries(Object.entries(value).filter(([key, nested]) => nested !== undefined && !isPresentationKey(key)).map(([key, nested]) => [key, strip(nested)]));\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 { isDeepStrictEqual } from \"node:util\";\nimport { describeFinalization, describeInstruction, describeSuggestedTransition, mapPropertyNames } from \"../api/interface/describeInterfaceSchemaMigrationInstruction.js\";\nimport { describeType } from \"./LockedPropertyType.js\";\nimport { authoredKeyOf } from \"./OntologySchemaLockfile.js\";\n/** Renders a breaking change as the report an author reads. */\nexport function describeBreakingChange(breakingChange) {\n const where = `Interface ${breakingChange.interfaceApiName}`;\n switch (breakingChange.code) {\n case \"ambiguousDisappearance\":\n {\n if (breakingChange.targets.length === 0) {\n return `${where}: schema migration \"${breakingChange.transitionId}\" is no longer declared, but ` + `it targets no property, so its disappearance cannot be read as either a ` + `finalization or a deletion. Restore it, or remove it from the lockfile by hand once ` + `the last published release no longer declares it.`;\n }\n const targets = breakingChange.targets.map(({\n propertyApiName\n }) => `\"${authoredKeyOf(propertyApiName)}\"`).join(\", \");\n return `${where}: schema migration \"${breakingChange.transitionId}\" is no longer declared, but ` + `the resulting schema is neither a finalization nor a deletion of it. ` + `${describeTargetDrift(breakingChange.targets)}\\n` + ` To finalize it, ${describeFinalizations(breakingChange.instructions)}.\\n` + ` To delete it, leave ${targets} exactly as the lockfile records it.`;\n }\n case \"instructionsChanged\":\n return `${where}: schema migration \"${breakingChange.transitionId}\" changed its instructions from ` + `${describeInstructions(breakingChange.previousInstructions)} to ` + `${describeInstructions(breakingChange.nextInstructions)}. An in-flight migration's instructions ` + `may not be changed, since stacks may already be part-way through it. Delete this transition and ` + `declare a new one with a different id instead.`;\n case \"interfaceExtensionAdded\":\n {\n const extended = breakingChange.extendedInterfaceApiName;\n return `${where}: now extends \"${extended}\". Implementing object types have to satisfy every ` + `property \"${extended}\" contributes, so those that do not yet are blocked from upgrading, ` + `and no currently-supported interface schema migration can phase that in. Stop extending ` + `\"${extended}\".`;\n }\n case \"propertyRemoved\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" was removed. Removing a property from an ` + `interface is a breaking change, and no currently-supported interface schema migration can ` + `phase it in. Restore \"${property}\" to the interface.`;\n }\n case \"propertyDeclarationChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" moved from ` + `${describeDeclaration(breakingChange.previousDeclaration)} to ` + `${describeDeclaration(breakingChange.nextDeclaration)}. The two are different bindings even ` + `when they resolve to the same type, so implementing object types would have to remap ` + `the property, and no currently-supported interface schema migration can phase that in. ` + `Declare \"${property}\" ${describeDeclaration(breakingChange.previousDeclaration)} again.`;\n }\n case \"propertyNamespaceChanged\":\n {\n const property = authoredKeyOf(breakingChange.previousApiName);\n return `${where}: property \"${property}\" is now backed by shared property type ` + `\"${breakingChange.nextApiName}\" rather than \"${breakingChange.previousApiName}\". A property is ` + `identified by the shared property type behind it, so this removes ` + `\"${breakingChange.previousApiName}\" from the interface rather than renaming it, and ` + `implementing object types would have to take up \"${breakingChange.nextApiName}\" in its place. ` + `No currently-supported interface schema migration can phase that in. Back \"${property}\" ` + `with \"${breakingChange.previousApiName}\" again.`;\n }\n case \"propertyTypeChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" changed type from ` + `${describeType(breakingChange.previousType)} to ${describeType(breakingChange.nextType)}. Changing a ` + `property's type is a breaking change, and no currently-supported interface schema ` + `migration can phase it in. Restore \"${property}\" to ` + `${describeType(breakingChange.previousType)}; to publish the new type, declare it as a new ` + `property under a different api name.`;\n }\n case \"propertyTypeClassesChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" changed type classes from ` + `${describeTypeClasses(breakingChange.previousTypeClasses)} to ` + `${describeTypeClasses(breakingChange.nextTypeClasses)}. Type classes drive render hints like ` + `sorting and filtering, so changing them breaks applications relying on those hints, and ` + `blocks upgrades for implementing object types that lack the new ones. No ` + `currently-supported interface schema migration can phase this in. Restore \"${property}\" ` + `to ${describeTypeClasses(breakingChange.previousTypeClasses)}.`;\n }\n case \"primaryKeyConstraintChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" changed its primary key constraint from ` + `${describeConstraint(breakingChange.previousConstraint)} to ` + `${describeConstraint(breakingChange.nextConstraint)}. Implementing object types that satisfy ` + `the old constraint need not satisfy the new one, so this blocks their upgrade, and no ` + `currently-supported interface schema migration can phase it in. Restore ` + `\"${property}\" to ${describeConstraint(breakingChange.previousConstraint)}.`;\n }\n case \"nullabilityTightened\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" tightened its nullability from ` + `${describeNullability(breakingChange.previousNullability)} to ` + `${describeNullability(breakingChange.nextNullability)}. Implementing object types whose data ` + `does not already satisfy that are blocked from upgrading, and no currently-supported ` + `interface schema migration can phase it in. Restore \"${property}\" to ` + `${describeNullability(breakingChange.previousNullability)}.`;\n }\n case \"valueTypeChanged\":\n {\n const property = authoredKeyOf(breakingChange.property);\n const previous = breakingChange.previousValueType;\n return `${where}: property \"${property}\" changed its value type from ` + `${previous === undefined ? \"none\" : describeValueType(previous)} to ` + `${describeValueType(breakingChange.nextValueType)}. A value type carries constraints that ` + `implementing object types' data has to satisfy, and no currently-supported interface ` + `schema migration can phase that in. ` + (previous === undefined ? `Drop the reference from \"${property}\".` : `Restore \"${property}\" to ${describeValueType(previous)}.`);\n }\n case \"propertyBecameRequired\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" became required without a schema migration. ` + `Keep it declared \\`required: false\\` and phase it in instead through a migration like:\\n` + ` ${describeSuggestedAddRequiredPropertyTransition(property)}`;\n }\n case \"requiredPropertyAdded\":\n {\n const property = authoredKeyOf(breakingChange.property);\n return `${where}: property \"${property}\" was added as required. Existing implementing ` + `object types do not provide it yet, so this is a breaking change. Declare it ` + `\\`required: false\\` and phase it in instead through a migration like:\\n` + ` ${describeSuggestedAddRequiredPropertyTransition(property)}`;\n }\n }\n}\n\n/** Renders a warning as the note an author reads alongside the breaking-change report. */\nexport function describeWarning(warning) {\n switch (warning.code) {\n case \"optedOut\":\n return `Interface ${warning.interfaceApiName} no longer declares \\`schemaMigrations\\`. Its ` + `in-flight migrations are still resolved for this release, but from the next release on ` + `maker will stop checking the interface for breaking schema changes, and a break will ` + `only surface when the ontology is installed. Restore the \\`schemaMigrations\\` block to ` + `keep the interface checked.`;\n case \"requirementRelaxed\":\n {\n const property = authoredKeyOf(warning.property);\n return `Interface ${warning.interfaceApiName}: property \"${property}\" is no longer required. ` + `Implementing object types need not provide it from this release on, so clients that ` + `expect it to always be present will start seeing it absent. Nothing to do if that was ` + `intended; declare it \\`required: true\\` again if it was not.`;\n }\n case \"primaryKeyConstraintRelaxed\":\n {\n const property = authoredKeyOf(warning.property);\n return `Interface ${warning.interfaceApiName}: property \"${property}\" no longer constrains ` + `primary key mapping, having been ` + `${describeConstraint(warning.previousConstraint)}. Implementing object types are free ` + `to map it either way from this release on. Nothing to do if that was intended; declare ` + `the constraint again if it was not.`;\n }\n case \"nullabilityRelaxed\":\n {\n const property = authoredKeyOf(warning.property);\n return `Interface ${warning.interfaceApiName}: property \"${property}\" relaxed its nullability ` + `from ${describeNullability(warning.previousNullability)} to ` + `${describeNullability(warning.nextNullability)}. Implementing object types may supply ` + `values it previously rejected, so clients that relied on the old guarantee will start ` + `seeing them. Nothing to do if that was intended; declare the constraint again if it ` + `was not.`;\n }\n case \"valueTypeRemoved\":\n {\n const property = authoredKeyOf(warning.property);\n return `Interface ${warning.interfaceApiName}: property \"${property}\" no longer references ` + `value type ${describeValueType(warning.previousValueType)}. Implementing object types ` + `are no longer held to that value type's constraints, so clients that relied on them ` + `will start seeing values it rejected. Nothing to do if that was intended; reference it ` + `again if it was not.`;\n }\n case \"interfaceExtensionRemoved\":\n {\n const extended = warning.extendedInterfaceApiName;\n return `Interface ${warning.interfaceApiName} no longer extends \"${extended}\". Every property ` + `\"${extended}\" contributed is dropped from the published schema, so clients reading them ` + `will stop seeing them, and object types that implemented \"${extended}\" only by ` + `inheritance no longer do. Nothing to do if that was intended; extend \"${extended}\" ` + `again if it was not.`;\n }\n }\n}\nfunction describeValueType(valueType) {\n return valueType.packageNamespace === \"\" ? valueType.apiName : `${valueType.packageNamespace}/${valueType.apiName}`;\n}\n\n/** What a nullability forbids, as a noun phrase. */\nfunction describeNullability(nullability) {\n const forbidden = [nullability.noNulls && \"no nulls\", nullability.noEmptyCollections && \"no empty collections\"].filter(clause => clause !== false);\n return forbidden.length === 0 ? \"unconstrained\" : forbidden.join(\", \");\n}\n\n/** A primary key constraint, as it reads mid-sentence. */\nfunction describeConstraint(constraint) {\n switch (constraint) {\n case \"MUST_BE_PK\":\n return \"`MUST_BE_PK`\";\n case \"CANNOT_BE_PK\":\n return \"`CANNOT_BE_PK`\";\n case \"NO_RESTRICTION\":\n return \"unconstrained\";\n }\n}\n\n/** Where a property is declared, as it reads mid-sentence in a report. */\nfunction describeDeclaration(declaration) {\n switch (declaration) {\n case \"interface\":\n return \"defined on the interface\";\n case \"sharedPropertyType\":\n return \"backed by a shared property type\";\n }\n}\nfunction describeTypeClasses(typeClasses) {\n if (typeClasses.length === 0) {\n return \"none\";\n }\n return typeClasses.map(({\n kind,\n name\n }) => `${kind}/${name}`).join(\", \");\n}\n\n/** A transition's instructions, named as the author wrote them. */\nfunction describeInstructions(instructions) {\n return `[${instructions.map(instruction => describeInstruction(mapPropertyNames(instruction, authoredKeyOf))).join(\", \")}]`;\n}\n\n/** Explains what actually happened to a transition's target properties, for the error message. */\nfunction describeTargetDrift(targets) {\n const descriptions = targets.map(({\n propertyApiName,\n previous,\n next\n }) => {\n const authoredPropertyName = authoredKeyOf(propertyApiName);\n if (next === undefined) {\n return `\"${authoredPropertyName}\" was removed from the interface`;\n }\n if (previous !== undefined && !isDeepStrictEqual(previous.type, next.type)) {\n return `\"${authoredPropertyName}\" changed type from ${describeType(previous.type)} to ` + describeType(next.type);\n }\n return `\"${authoredPropertyName}\" is \\`required: ${next.required}\\``;\n });\n return `Instead, ${descriptions.join(\", \")}.`;\n}\n\n/** Everything the author would do to have the transition be finalized instead. */\nfunction describeFinalizations(instructions) {\n return instructions.map(instruction => describeFinalization(mapPropertyNames(instruction, authoredKeyOf))).join(\", and \");\n}\n\n/** The transition an author should have declared to make `property` required. */\nfunction describeSuggestedAddRequiredPropertyTransition(property) {\n return describeSuggestedTransition({\n type: \"addRequiredProperty\",\n property\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 { OntologyEntityTypeEnum } from \"../api/common/OntologyEntityTypeEnum.js\";\nimport { mapPropertyNames } from \"../api/interface/describeInterfaceSchemaMigrationInstruction.js\";\nimport { getInterfacePropertyTypeType, interfacePropertyNullability, interfacePropertyPrimaryKeyConstraint, interfacePropertyTypeClasses, interfacePropertyValueType, interfacePropertyWireApiName, isInterfacePropertyArray, isInterfacePropertyRequired, isInterfaceSharedPropertyType } from \"../api/interface/InterfacePropertyType.js\";\nimport { normalizePropertyType } from \"./LockedPropertyType.js\";\nimport { ONTOLOGY_SCHEMA_LOCKFILE_VERSION } from \"./OntologySchemaLockfile.js\";\n\n/**\n * Every interface the lockfile could track, enrolled or not, with the schema it declares now.\n *\n * This enables disambiguating \"this interface was deleted from source\" vs \"this interface was\n * unenrolled from being locked, but still exists in source\", which may have different consequences.\n */\n\n/**\n * Derives the lockfile that the given ontology *should* have, purely from source.\n *\n * NB: Deliberately does not consult the previously-persisted lockfile, and instead keeps\n * generation a pure function of the source (simpler to reason about, test, etc.).\n * Any history-dependent logic (e.g. backwards-compatibility checking) is only a validation concern.\n */\nexport function generateOntologySchemaLockfile(ontology) {\n const interfaces = {};\n for (const interfaceType of sortedByApiName(Object.values(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]))) {\n if (!shouldLockInterface(interfaceType)) {\n continue;\n }\n interfaces[interfaceType.apiName] = lockInterface(interfaceType);\n }\n return {\n version: ONTOLOGY_SCHEMA_LOCKFILE_VERSION,\n interfaces\n };\n}\nexport function censusOfSource(ontology) {\n return {\n interfaces: new Map(Object.values(ontology[OntologyEntityTypeEnum.INTERFACE_TYPE]).map(interfaceType => [interfaceType.apiName, lockInterfaceSchema(interfaceType)]))\n };\n}\nexport function shouldLockInterface(interfaceType) {\n return interfaceType.schemaMigrations !== undefined;\n}\nfunction lockInterface(interfaceType) {\n return {\n schema: lockInterfaceSchema(interfaceType),\n transitions: lockInterfaceSchemaMigrationTransitions(interfaceType)\n };\n}\nfunction lockInterfaceSchema(interfaceType) {\n const locked = Object.entries(interfaceType.propertiesV3).map(([propertyApiName, property]) => [interfacePropertyWireApiName(property, propertyApiName), lockProperty(property)]).sort(([a], [b]) => compare(a, b));\n const extendsInterfaces = lockExtensions(interfaceType);\n return {\n properties: Object.fromEntries(locked),\n // NB: spread rather than assigned `undefined` so a lockfile read back from disk (where absents\n // have no key at all) still compare equal.\n ...(extendsInterfaces !== undefined && {\n extendsInterfaces\n })\n };\n}\nfunction lockExtensions(interfaceType) {\n const extended = new Set(interfaceType.extendsInterfaces.map(parent => parent.apiName));\n return extended.size === 0 ? undefined : [...extended].sort(compare);\n}\nfunction lockProperty(property) {\n const typeClasses = lockTypeClasses(interfacePropertyTypeClasses(property));\n const primaryKeyConstraint = interfacePropertyPrimaryKeyConstraint(property);\n const nullability = lockNullability(interfacePropertyNullability(property));\n const valueType = lockValueType(interfacePropertyValueType(property));\n return {\n type: normalizePropertyType(getInterfacePropertyTypeType(property), isInterfacePropertyArray(property)),\n required: isInterfacePropertyRequired(property),\n // NB: spread rather than assigned `undefined` so a lockfile read back from disk (where absents\n // have no key at all) still compare equal.\n ...(typeClasses !== undefined && {\n typeClasses\n }),\n ...(isInterfaceSharedPropertyType(property) && {\n declaredBy: \"sharedPropertyType\"\n }),\n ...(primaryKeyConstraint !== \"NO_RESTRICTION\" && {\n primaryKeyConstraint\n }),\n ...(nullability !== undefined && {\n nullability\n }),\n ...(valueType !== undefined && {\n valueType\n })\n };\n}\nfunction lockValueType(valueType) {\n if (valueType === undefined) {\n return undefined;\n }\n\n // Re-built field-by-field so key order is stable\n return {\n packageNamespace: valueType.packageNamespace,\n apiName: valueType.apiName\n };\n}\nfunction lockNullability(nullability) {\n if (nullability === undefined || !nullability.noNulls && !nullability.noEmptyCollections) {\n return undefined;\n }\n\n // Rebuild to have firm key order\n return {\n noNulls: nullability.noNulls,\n noEmptyCollections: nullability.noEmptyCollections\n };\n}\nfunction lockTypeClasses(typeClasses) {\n if (typeClasses === undefined || typeClasses.length === 0) {\n return undefined;\n }\n return [...typeClasses].sort((a, b) => compare(a.kind, b.kind) || compare(a.name, b.name));\n}\nfunction lockInterfaceSchemaMigrationTransitions(interfaceType) {\n const {\n schemaMigrations,\n propertiesV3\n } = interfaceType;\n if (schemaMigrations === undefined) {\n return [];\n }\n return schemaMigrations.transitions.map(transition => ({\n id: transition.id,\n gracePeriod: transition.gracePeriod,\n instructions: transition.instructions.map(instruction => mapPropertyNames(instruction, propertyApiName => wireApiNameOf(instruction.type, propertyApiName, propertiesV3)))\n // Instructions have no unique stable identifier, so JSON them instead for sort stability\n .sort((a, b) => compare(JSON.stringify(a), JSON.stringify(b)))\n })).sort((a, b) => compare(a.id, b.id));\n}\n\n/**\n * The api name a property the author referenced by key is published under, matching what the\n * ontology-ir carries.\n */\nfunction wireApiNameOf(instructionType, propertyApiName, propertiesV3) {\n const property = propertiesV3[propertyApiName];\n if (property === undefined) {\n throw new Error(`Schema migration instruction ${instructionType} references property \"${propertyApiName}\", which the interface does not declare.`);\n }\n return interfacePropertyWireApiName(property, propertyApiName);\n}\nfunction sortedByApiName(interfaceTypes) {\n return [...interfaceTypes].sort((a, b) => compare(a.apiName, b.apiName));\n}\nfunction compare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\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 { z } from \"zod\";\nimport { isCanonicalIsoUtcDatetime } from \"../api/interface/validateInterfaceSchemaMigrations.js\";\nimport { LOCKFILE_HEADER_KEY, ONTOLOGY_SCHEMA_LOCKFILE_VERSION } from \"./OntologySchemaLockfile.js\";\n\n/** Rewrites a lockfile written by the version it is keyed under into the next version's shape. */\n\n/** A lockfile mid-upgrade: known to have a version, not yet known to have anything else. */\n\n/**\n * Upgraders keyed by the version they read, applied in ascending order until the lockfile reaches\n * {@link ONTOLOGY_SCHEMA_LOCKFILE_VERSION}.\n */\nconst UPGRADERS = {};\nconst DEADLINE_MESSAGE = `Expected an ISO-8601 UTC datetime (e.g. \"2026-01-31T00:00:00Z\"). Restore the deadline the last ` + `published release declared.`;\nconst TRANSITION_ID_MESSAGE = `Expected a non-empty transition id. Restore the id the last published release declared.`;\nconst INSTRUCTIONS_MESSAGE = `Expected a non-empty array of instructions. A migration that instructs nothing cannot be ` + `finalized or deleted; remove the migration, or restore the instructions the last published ` + `release declared.`;\n\n/**\n * Appends repair advice to whatever zod would have said. Used where zod's own wording is worth\n * keeping (e.g. a discriminated union names the variants it knows).\n */\nfunction appendRestoreAdviceFor(what) {\n return {\n errorMap: (_issue, ctx) => ({\n message: `${ctx.defaultError}. Restore the ${what} the last published release declared.`\n })\n };\n}\nconst gracePeriodSchema = z.discriminatedUnion(\"type\", [z.object({\n type: z.literal(\"afterInstall\"),\n days: z.number({\n message: `Expected a number of days. Restore the number of days the last published release ` + `declared.`\n })\n}).passthrough(), z.object({\n type: z.literal(\"deadline\"),\n deadline: z.string({\n message: DEADLINE_MESSAGE\n }).refine(isCanonicalIsoUtcDatetime, {\n message: DEADLINE_MESSAGE\n })\n}).passthrough()], appendRestoreAdviceFor(\"grace period\"));\nconst instructionSchema = z.discriminatedUnion(\"type\", [z.object({\n type: z.literal(\"addRequiredProperty\"),\n property: z.string({\n message: \"Expected the api name of the property to require.\"\n })\n}).passthrough()], appendRestoreAdviceFor(\"instruction\"));\nconst transitionSchema = z.object({\n id: z.string({\n message: TRANSITION_ID_MESSAGE\n }).min(1, {\n message: TRANSITION_ID_MESSAGE\n }),\n gracePeriod: gracePeriodSchema,\n instructions: z.array(instructionSchema, {\n message: INSTRUCTIONS_MESSAGE\n }).nonempty({\n message: INSTRUCTIONS_MESSAGE\n })\n}, {\n message: \"Expected an object recording a schema migration.\"\n}).passthrough();\nconst typeClassSchema = z.object({\n kind: z.string({\n message: \"Expected a type class kind.\"\n }),\n name: z.string({\n message: \"Expected a type class name.\"\n })\n}, {\n message: \"Expected an object recording a type class.\"\n}).passthrough();\nconst propertySchema = z.object({\n // `PropertyTypeType` mirrors conjure-generated bindings that are regenerated upstream, so the\n // parser asserts only that a type was recorded.\n type: z.custom(type => type != null, {\n message: `Expected a recorded property type. Restore the type the last published release declared.`\n }),\n required: z.boolean({\n message: \"Expected a boolean.\"\n }),\n typeClasses: z.array(typeClassSchema, {\n message: `Expected an array of type classes. Restore the type classes the last published ` + `release declared.`\n }).optional(),\n // Absent means its an IDP, so we need only expect the SPT variant here\n declaredBy: z.literal(\"sharedPropertyType\", {\n message: `Expected \"sharedPropertyType\", or no value at all for a property the interface ` + `defines itself. Restore what the last published release declared.`\n }).optional(),\n // NO_RESTRICTION is the absent/default case, so we don't record it in the lockfile\n primaryKeyConstraint: z.enum([\"MUST_BE_PK\", \"CANNOT_BE_PK\"], {\n message: `Expected \"MUST_BE_PK\" or \"CANNOT_BE_PK\", or no value at all for a property that ` + `does not constrain primary key mapping. Restore what the last published release ` + `declared.`\n }).optional(),\n nullability: z.object({\n noNulls: z.boolean({\n message: \"Expected a boolean.\"\n }),\n noEmptyCollections: z.boolean({\n message: \"Expected a boolean.\"\n })\n }, {\n message: `Expected an object recording what the property forbids. Restore the nullability ` + `the last published release declared.`\n }).passthrough().refine(({\n noNulls,\n noEmptyCollections\n }) => noNulls || noEmptyCollections, {\n message: `Expected a nullability that forbids something, or no value at all for a property ` + `that constrains neither nulls nor empty collections.`\n }).optional(),\n valueType: z.object({\n packageNamespace: z.string({\n message: \"Expected a value type package namespace.\"\n }),\n apiName: z.string({\n message: \"Expected a value type api name.\"\n })\n }, {\n message: `Expected an object identifying a value type. Restore the value type the last ` + `published release declared.`\n }).passthrough().optional()\n}, {\n message: \"Expected an object recording the property's locked type and whether it is required.\"\n}).passthrough();\nconst interfaceSchema = z.object({\n schema: z.object({\n properties: z.record(z.string(), propertySchema, {\n message: \"Expected an object keyed by property api name.\"\n }),\n extendsInterfaces: z.array(z.string({\n message: \"Expected the api name of an extended interface.\"\n }), {\n message: `Expected an array of extended interface api names. Restore the interfaces ` + `the last published release extended.`\n })\n // Absent means \"extends nothing\", so a committed lockfile should only ever values\n .nonempty({\n message: `Expected a non-empty array of extended interface api names, or no value at ` + `all for an interface that extends none.`\n }).optional()\n }, {\n message: 'Expected an object with a \"properties\" key.'\n }).passthrough(),\n transitions: z.array(transitionSchema, {\n message: \"Expected an array of in-flight schema migrations.\"\n })\n}, {\n message: \"Expected an object recording the interface's locked schema and transitions.\"\n}).passthrough();\n\n/**\n * The shape everything downstream of the parser relies on. Lockfiles are checked in, and therefore\n * hand-editable, so it cannot be assumed.\n *\n * Three things this schema is deliberately not:\n *\n * - **Semantic.** The checks are purely structural, since a newer maker may validate semantics that\n * were not true (or necessary) when this lockfile version was written.\n * - **Strict.** Every object passes unknown keys through. Reconcile decides a lockfile is out of\n * date by comparing it against a freshly generated one, so a key an author added by hand has to\n * survive parsing in order to be reported as a difference rather than silently dropped.\n * - **Silent.** Each node carries the message an author should see when it rejects something, so\n * the wording lives next to the check rather than in a renderer that has to work out where in\n * the file the failure came from.\n */\nconst lockfileSchema = z.object({\n version: z.number().int(),\n interfaces: z.record(z.string(), interfaceSchema, {\n message: \"Expected an object keyed by interface api name.\"\n })\n}).passthrough();\n\n/**\n * `true` when `Parsed` accepts every variant of the union `Declared`, otherwise `never`.\n *\n * Used to ensure our zod discriminated unions are exhaustive over the real types.\n */\n\n// Exhaustiveness checks\nconst _COVERS_EVERY_GRACE_PERIOD = true;\nconst _COVERS_EVERY_INSTRUCTION = true;\nexport function parseLockfile(contents, lockfilePath) {\n let parsed;\n try {\n parsed = JSON.parse(contents);\n } catch (e) {\n throw new Error(`${lockfilePath} is not valid JSON: ${e.message}`, {\n cause: e\n });\n }\n const versioned = requireVersion(parsed, lockfilePath);\n const upgraded = upgradeLockfile(withoutHeader(versioned), ONTOLOGY_SCHEMA_LOCKFILE_VERSION, UPGRADERS, lockfilePath);\n const result = lockfileSchema.safeParse(upgraded);\n if (!result.success) {\n throw new Error(`${lockfilePath} is not a valid ontology schema lockfile:\\n` + result.error.issues.map(issue => ` ${formatPath(issue.path)}: ${issue.message}`).join(\"\\n\"), {\n cause: result.error\n });\n }\n return result.data;\n}\nfunction requireVersion(parsed, lockfilePath) {\n const version = parsed?.version;\n if (typeof version !== \"number\" || !Number.isInteger(version)) {\n throw new Error(`${lockfilePath} is not an ontology schema lockfile: expected an integer \"version\" key.`);\n }\n if (version > ONTOLOGY_SCHEMA_LOCKFILE_VERSION) {\n throw new Error(`${lockfilePath} has version ${version}, but this version of maker only understands ` + `version ${ONTOLOGY_SCHEMA_LOCKFILE_VERSION}. Upgrade @osdk/maker.`);\n }\n return parsed;\n}\n\n/** Drops the header `serializeLockfile` writes. */\nfunction withoutHeader(lockfile) {\n const {\n [LOCKFILE_HEADER_KEY]: _header,\n ...rest\n } = lockfile;\n return rest;\n}\n\n/**\n * Brings an older lockfile up to `targetVersion` by applying each intervening upgrader in turn.\n *\n * @internal\n */\nexport function upgradeLockfile(lockfile, targetVersion, upgraders, lockfilePath) {\n let upgraded = lockfile;\n while (upgraded.version < targetVersion) {\n const upgrade = upgraders[upgraded.version];\n if (upgrade === undefined) {\n throw new Error(`${lockfilePath} has version ${upgraded.version}, which this version of maker cannot ` + `upgrade to version ${targetVersion}. Delete the lockfile and regenerate it.`);\n }\n const next = upgrade(upgraded);\n if (next.version <= upgraded.version) {\n throw new Error(`The lockfile upgrader for version ${upgraded.version} did not advance the version.`);\n }\n upgraded = next;\n }\n return upgraded;\n}\n\n/** `[\"interfaces\", \"Person\", \"transitions\", 0, \"id\"]` -> `interfaces.Person.transitions[0].id`. */\nfunction formatPath(path) {\n return path.map((key, index) => {\n if (typeof key === \"number\") {\n return `[${key}]`;\n }\n return index === 0 ? key : `.${key}`;\n }).join(\"\");\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 { isDeepStrictEqual } from \"node:util\";\nimport { own } from \"./OntologySchemaLockfile.js\";\n\n/**\n * Whether a transition's instructions are being enforced.\n *\n * - `lenient`: the transition is in flight. Implementing object types are not held to it yet.\n * - `strict`: the transition has been finalized. Implementing object types must comply.\n */\n\n/** What an instruction does to a property when applied. */\n\n/** * What an instruction does to one property, in both modes. */\n\n/** The per-property changes an instruction makes, keyed by the property each one applies to. */\nfunction editsOf(instruction) {\n switch (instruction.type) {\n case \"addRequiredProperty\":\n return new Map([[instruction.property, {\n lenient: {\n op: \"patch\",\n required: false\n },\n strict: {\n op: \"patch\",\n required: true\n }\n }]]);\n default:\n // TODO: add a never exhaustiveness check once there's more than one instruction type\n throw new Error(`Unknown schema migration instruction type: ${instruction.type}`);\n }\n}\n\n/** A transition applied in one mode. */\n\n/**\n * Applies one edit to `properties` in place, reporting whether it could apply at all.\n *\n * @internal\n */\nexport function applyEdit(properties, propertyApiName, edit) {\n const existing = own(properties, propertyApiName);\n switch (edit.op) {\n case \"patch\":\n {\n if (existing === undefined) {\n return false;\n }\n const {\n op: _op,\n ...attributes\n } = edit;\n properties[propertyApiName] = {\n ...existing,\n ...attributes\n };\n return true;\n }\n case \"add\":\n {\n if (existing !== undefined) {\n return false;\n }\n properties[propertyApiName] = edit.property;\n return true;\n }\n case \"remove\":\n {\n if (existing === undefined) {\n return false;\n }\n delete properties[propertyApiName];\n return true;\n }\n default:\n {\n const unhandled = edit;\n throw new Error(`Unknown property edit: ${JSON.stringify(unhandled)}`);\n }\n }\n}\n\n/**\n * The result of applying `transition` to `schema` in the given mode, or `undefined` if the\n * transition cannot be applied to that schema at all (e.g. it patches a property the schema does\n * not record).\n */\nexport function applyTransition(transition, schema, mode) {\n const properties = {\n ...schema.properties\n };\n const touched = new Set();\n for (const instruction of transition.instructions) {\n for (const [propertyApiName, byMode] of editsOf(instruction)) {\n if (!applyEdit(properties, propertyApiName, byMode[mode])) {\n return undefined;\n }\n touched.add(propertyApiName);\n }\n }\n return {\n schema: {\n ...schema,\n properties\n },\n touched: [...touched]\n };\n}\n\n/** Every property a transition could touch, in either mode. */\nexport function targetPropertiesOf(transition) {\n return transition.instructions.flatMap(instruction => [...editsOf(instruction).keys()]);\n}\n\n/**\n * Whether applying a transition in one mode results in `schema`, comparing only the properties the\n * application asserted something about.\n */\nexport function reproduces(applied, schema) {\n if (applied === undefined || applied.touched.length === 0) {\n return false;\n }\n return applied.touched.every(propertyApiName => isDeepStrictEqual(own(applied.schema.properties, propertyApiName), own(schema.properties, propertyApiName)));\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 { isDeepStrictEqual } from \"node:util\";\nimport { applyTransition, reproduces, targetPropertiesOf } from \"./applyInterfaceSchemaTransition.js\";\nimport { authoredKeyOf, declarationOf, extensionsOf, nullabilityOf, own, primaryKeyConstraintOf, tightensNullability } from \"./OntologySchemaLockfile.js\";\n\n/**\n * NOTE ON CONVENTION: the rest of maker validates with `invariant`, failing on the first problem.\n * This module instead accumulates breaking changes and lets its caller throw one aggregate. An\n * author fixing a batch of them wants to see all of them, not to discover them one build at a\n * time.\n */\n\n/** A transition that the source no longer declares, along with what its disappearance meant. */\n\n/** A property a transition targets, as the lockfile records it and as the source now declares it. */\n\n/** A change that would be rejected at installation-time, in machine-readable form. */\n\n/** Worth telling the author about, but not by itself a reason to reject the ontology. */\n\n/**\n * Diffs a newly-generated lockfile against the persisted one, reporting any change that would\n * be rejected when the ontology is installed.\n *\n * @param previous the persisted lockfile, i.e. the last published state\n * @param next the lockfile generated from the current source\n * @param census every entity the source declares, enrolled or not in locking, with the schema it declares now.\n */\nexport function validateOntologySchemaLockfile(previous, next, census) {\n const result = {\n breakingChanges: [],\n checkpoints: [],\n warnings: []\n };\n for (const [interfaceApiName, previousInterface] of Object.entries(previous.interfaces)) {\n const enrolled = own(next.interfaces, interfaceApiName);\n const nextInterface = enrolled ?? asOptedOut(interfaceApiName, census.interfaces);\n\n // Not a break to remove the IT, existing installations will just continue\n // with what they have\n if (nextInterface === undefined) {\n continue;\n }\n if (enrolled === undefined) {\n result.warnings.push({\n code: \"optedOut\",\n interfaceApiName\n });\n }\n validateInterface(interfaceApiName, previousInterface, nextInterface, result);\n }\n return result;\n}\n\n/**\n * What an interface that dropped its `schemaMigrations` block still amounts to: the schema the\n * source declares, with no transitions left. `undefined` if the source no longer declares it.\n *\n * Opting out ends maker's checking of the interface from the next release on, but not this one. The\n * interface is still published, so whether each in-flight transition landed or was abandoned is\n * still a real difference in the artifact.\n */\nfunction asOptedOut(interfaceApiName, census) {\n const schema = census.get(interfaceApiName);\n return schema === undefined ? undefined : {\n schema,\n transitions: []\n };\n}\nfunction validateInterface(interfaceApiName, previousInterface, nextInterface, result) {\n const {\n breakingChanges,\n checkpoints\n } = result;\n const nextTransitions = new Map(nextInterface.transitions.map(transition => [transition.id, transition]));\n\n // Authored keys whose change is already explained by a finalization or deletion, and so must be\n // exempt from the general breaking-change checks below.\n const propertiesAccountedFor = new Set();\n for (const previousTransition of previousInterface.transitions) {\n const nextTransition = nextTransitions.get(previousTransition.id);\n if (nextTransition === undefined) {\n const disappearance = classifyDisappearance(previousTransition, previousInterface.schema, nextInterface.schema);\n if (disappearance.kind === \"ambiguous\") {\n breakingChanges.push({\n code: \"ambiguousDisappearance\",\n interfaceApiName,\n transitionId: previousTransition.id,\n targets: disappearance.targets,\n instructions: previousTransition.instructions\n });\n } else {\n checkpoints.push({\n interfaceApiName,\n transitionId: previousTransition.id,\n kind: disappearance.kind\n });\n }\n\n // Whether the disappearance was legal or not, its target properties have been reported on;\n // re-reporting them as raw schema breaks would only add noise.\n for (const property of targetPropertiesOf(previousTransition)) {\n propertiesAccountedFor.add(authoredKeyOf(property));\n }\n continue;\n }\n validateSurvivingTransition(interfaceApiName, previousTransition, nextTransition, breakingChanges);\n }\n validateExtensionsDiff(interfaceApiName, previousInterface.schema, nextInterface.schema, result);\n validateSchemaDiff(interfaceApiName, previousInterface.schema, nextInterface.schema, propertiesAccountedFor, result);\n}\nfunction validateExtensionsDiff(interfaceApiName, previousSchema, nextSchema, {\n breakingChanges,\n warnings\n}) {\n const previousExtensions = new Set(extensionsOf(previousSchema));\n const nextExtensions = new Set(extensionsOf(nextSchema));\n for (const extendedInterfaceApiName of nextExtensions) {\n if (!previousExtensions.has(extendedInterfaceApiName)) {\n breakingChanges.push({\n code: \"interfaceExtensionAdded\",\n interfaceApiName,\n extendedInterfaceApiName\n });\n }\n }\n for (const extendedInterfaceApiName of previousExtensions) {\n if (!nextExtensions.has(extendedInterfaceApiName)) {\n warnings.push({\n code: \"interfaceExtensionRemoved\",\n interfaceApiName,\n extendedInterfaceApiName\n });\n }\n }\n}\n\n/** What a transition vanishing from the source turned out to mean. */\n\nfunction classifyDisappearance(transition, previousSchema, nextSchema) {\n const strict = applyTransition(transition, previousSchema, \"strict\");\n if (reproduces(strict, nextSchema)) {\n return {\n kind: \"finalized\"\n };\n }\n const lenient = applyTransition(transition, previousSchema, \"lenient\");\n if (reproduces(lenient, nextSchema)) {\n return {\n kind: \"deleted\"\n };\n }\n return {\n kind: \"ambiguous\",\n targets: targetPropertiesOf(transition).map(propertyApiName => ({\n propertyApiName,\n previous: own(previousSchema.properties, propertyApiName),\n next: own(nextSchema.properties, propertyApiName)\n }))\n };\n}\nfunction validateSurvivingTransition(interfaceApiName, previous, next, breakingChanges) {\n if (!isDeepStrictEqual(previous.instructions, next.instructions)) {\n breakingChanges.push({\n code: \"instructionsChanged\",\n interfaceApiName,\n transitionId: previous.id,\n previousInstructions: previous.instructions,\n nextInstructions: next.instructions\n });\n }\n}\n\n/** A property as the lockfile records it: the api name it publishes under, and its shape. */\n\n/**\n * A schema's properties keyed by the name the author wrote rather than the one they publish under.\n */\nfunction byAuthoredKey(schema) {\n // `Object.entries` yields only own enumerable keys, so unlike an index read this needs no guard\n // against a lockfile parsed from disk inheriting `constructor` and friends from `Object.prototype`.\n return new Map(Object.entries(schema.properties).map(([apiName, property]) => [authoredKeyOf(apiName), {\n apiName,\n property\n }]));\n}\n\n/**\n * Reports every difference between the two schemas that would be rejected at installation-time, skipping\n * the properties already explained by a finalization or deletion.\n */\nfunction validateSchemaDiff(interfaceApiName, previousSchema, nextSchema, accountedFor, {\n breakingChanges,\n warnings\n}) {\n const previousProperties = byAuthoredKey(previousSchema);\n const nextProperties = byAuthoredKey(nextSchema);\n for (const [authoredKey, previous] of previousProperties) {\n if (accountedFor.has(authoredKey)) {\n continue;\n }\n const next = nextProperties.get(authoredKey);\n if (next === undefined) {\n breakingChanges.push({\n code: \"propertyRemoved\",\n interfaceApiName,\n property: previous.apiName\n });\n continue;\n }\n if (previous.property.required && !next.property.required) {\n warnings.push({\n code: \"requirementRelaxed\",\n interfaceApiName,\n property: previous.apiName\n });\n }\n const previousConstraint = primaryKeyConstraintOf(previous.property);\n const nextConstraint = primaryKeyConstraintOf(next.property);\n if (previousConstraint !== nextConstraint && nextConstraint === \"NO_RESTRICTION\") {\n warnings.push({\n code: \"primaryKeyConstraintRelaxed\",\n interfaceApiName,\n property: previous.apiName,\n previousConstraint\n });\n }\n const previousNullability = nullabilityOf(previous.property);\n const nextNullability = nullabilityOf(next.property);\n if (!isDeepStrictEqual(previousNullability, nextNullability) && !tightensNullability(previousNullability, nextNullability)) {\n warnings.push({\n code: \"nullabilityRelaxed\",\n interfaceApiName,\n property: previous.apiName,\n previousNullability,\n nextNullability\n });\n }\n if (previous.property.valueType !== undefined && next.property.valueType === undefined) {\n warnings.push({\n code: \"valueTypeRemoved\",\n interfaceApiName,\n property: previous.apiName,\n previousValueType: previous.property.valueType\n });\n }\n validatePropertyDiff(interfaceApiName, previous, next, breakingChanges);\n }\n for (const [authoredKey, next] of nextProperties) {\n if (accountedFor.has(authoredKey) || previousProperties.has(authoredKey)) {\n continue;\n }\n if (next.property.required) {\n breakingChanges.push({\n code: \"requiredPropertyAdded\",\n interfaceApiName,\n property: next.apiName\n });\n }\n }\n}\n\n/** Reports what changed about a property the author kept. */\nfunction validatePropertyDiff(interfaceApiName, previous, next, breakingChanges) {\n const property = previous.apiName;\n\n // Ahead of the type check: when the binding itself was swapped, the types are incidental, and\n // reporting them would point the author at the wrong thing to restore.\n const previousDeclaration = declarationOf(previous.property);\n const nextDeclaration = declarationOf(next.property);\n if (previousDeclaration !== nextDeclaration) {\n breakingChanges.push({\n code: \"propertyDeclarationChanged\",\n interfaceApiName,\n property,\n previousDeclaration,\n nextDeclaration\n });\n return;\n }\n\n // Same authored key and same binding, but a different published name: the shared property type\n // behind it moved namespace.\n if (previous.apiName !== next.apiName) {\n breakingChanges.push({\n code: \"propertyNamespaceChanged\",\n interfaceApiName,\n previousApiName: previous.apiName,\n nextApiName: next.apiName\n });\n return;\n }\n\n // This is probably too strict; we might need to strip more things from the locked property\n // type to avoid false positives\n if (!isDeepStrictEqual(previous.property.type, next.property.type)) {\n breakingChanges.push({\n code: \"propertyTypeChanged\",\n interfaceApiName,\n property,\n previousType: previous.property.type,\n nextType: next.property.type\n });\n return;\n }\n if (!isDeepStrictEqual(previous.property.typeClasses, next.property.typeClasses)) {\n breakingChanges.push({\n code: \"propertyTypeClassesChanged\",\n interfaceApiName,\n property,\n previousTypeClasses: previous.property.typeClasses ?? [],\n nextTypeClasses: next.property.typeClasses ?? []\n });\n return;\n }\n const previousConstraint = primaryKeyConstraintOf(previous.property);\n const nextConstraint = primaryKeyConstraintOf(next.property);\n if (previousConstraint !== nextConstraint && nextConstraint !== \"NO_RESTRICTION\") {\n breakingChanges.push({\n code: \"primaryKeyConstraintChanged\",\n interfaceApiName,\n property,\n previousConstraint,\n nextConstraint\n });\n return;\n }\n const previousNullability = nullabilityOf(previous.property);\n const nextNullability = nullabilityOf(next.property);\n if (tightensNullability(previousNullability, nextNullability)) {\n breakingChanges.push({\n code: \"nullabilityTightened\",\n interfaceApiName,\n property,\n previousNullability,\n nextNullability\n });\n return;\n }\n const nextValueType = next.property.valueType;\n if (nextValueType !== undefined && !isDeepStrictEqual(previous.property.valueType, nextValueType)) {\n breakingChanges.push({\n code: \"valueTypeChanged\",\n interfaceApiName,\n property,\n previousValueType: previous.property.valueType,\n nextValueType\n });\n return;\n }\n if (!previous.property.required && next.property.required) {\n breakingChanges.push({\n code: \"propertyBecameRequired\",\n interfaceApiName,\n property\n });\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 * as fs from \"node:fs/promises\";\nimport { consola } from \"consola\";\nimport { describeBreakingChange, describeWarning } from \"./describeLockfileChange.js\";\nimport { censusOfSource, generateOntologySchemaLockfile } from \"./generateOntologySchemaLockfile.js\";\nimport { isEmptyLockfile, lockedInterfaceCount, serializeLockfile, staleInterfaces } from \"./OntologySchemaLockfile.js\";\nimport { parseLockfile } from \"./parseOntologySchemaLockfile.js\";\nimport { validateOntologySchemaLockfile } from \"./validateOntologySchemaLockfile.js\";\n/**\n * Checks the ontology's interface schema migrations against the persisted lockfile and brings\n * the lockfile up to date when `writeLocks` is set.\n *\n * Throws if the source contains a change that would be rejected at installation-time, or if the\n * lockfile is out of date and `writeLocks` was not passed.\n */\nexport async function reconcileOntologySchemaLockfile(options) {\n const {\n ontology,\n lockfilePath,\n writeLocks,\n assumeYes\n } = options;\n const expected = generateOntologySchemaLockfile(ontology);\n const census = censusOfSource(ontology);\n const persistedContents = await readIfExists(lockfilePath);\n if (persistedContents === undefined) {\n await reconcileMissingLockfile(expected, lockfilePath, writeLocks);\n return;\n }\n const persisted = parseLockfile(persistedContents, lockfilePath);\n const {\n breakingChanges,\n checkpoints,\n warnings\n } = validateOntologySchemaLockfile(persisted, expected, census);\n for (const warning of warnings) {\n consola.warn(describeWarning(warning));\n }\n if (breakingChanges.length > 0) {\n throw new Error(formatBreakingChanges(breakingChanges, lockfilePath));\n }\n if (!writeLocks) {\n const stale = staleInterfaces(persisted, expected);\n if (stale.length > 0) {\n throw new Error(formatStaleness(stale, lockfilePath));\n }\n consola.success(`Ontology schema lockfile ${lockfilePath} is up to date`);\n return;\n }\n if (checkpoints.length > 0 && !(await confirmCheckpoints(checkpoints, assumeYes))) {\n throw new Error(`Aborted: ${lockfilePath} was not updated, and no ontology was written.`);\n }\n await writeLockfile(lockfilePath, expected, persistedContents);\n}\nasync function reconcileMissingLockfile(expected, lockfilePath, writeLocks) {\n if (isEmptyLockfile(expected)) {\n // Nothing has opted into schema migrations, so there is no baseline worth recording. Creating\n // an empty lockfile here would force it on every consumer of maker.\n return;\n }\n if (!writeLocks) {\n const count = lockedInterfaceCount(expected);\n throw new Error(`${count} ${count === 1 ? \"interface is\" : \"interfaces are\"} opted into schema ` + `migrations, but there is no lockfile at ${lockfilePath} to check them against. Run maker ` + `again with --write-locks to create it, and commit the result.`);\n }\n await writeLockfile(lockfilePath, expected, undefined);\n}\nasync function confirmCheckpoints(checkpoints, assumeYes) {\n consola.warn(`Detected interface schema migration finalizations/deletions:\\n${formatCheckpoints(checkpoints)}`);\n if (assumeYes) {\n return true;\n }\n if (!process.stdin.isTTY) {\n throw new Error(\"Detected interface schema migration finalizations/deletions, but maker is not attached to a \" + \"terminal and cannot prompt. Re-run with --yes to accept them.\");\n }\n return await consola.prompt(\"Accept?\", {\n type: \"confirm\"\n });\n}\nfunction formatCheckpoints(checkpoints) {\n const lines = [];\n let currentInterfaceApiName;\n for (const checkpoint of checkpoints) {\n if (checkpoint.interfaceApiName !== currentInterfaceApiName) {\n currentInterfaceApiName = checkpoint.interfaceApiName;\n lines.push(`${currentInterfaceApiName}:`);\n }\n const verb = checkpoint.kind === \"finalized\" ? \"FINALIZE\" : \"DELETE\";\n lines.push(` ${verb} ${checkpoint.transitionId}`);\n }\n return lines.join(\"\\n\");\n}\nfunction formatStaleness(stale, lockfilePath) {\n return `Ontology schema lockfile ${lockfilePath} is out of date. These interfaces have changed since ` + `it was written:\\n${stale.map(apiName => ` ${apiName}`).join(\"\\n\")}\\n\\n` + `The changes are backwards-compatible, but the lockfile must record them before the ontology ` + `can be published. Run maker again with --write-locks.`;\n}\nfunction formatBreakingChanges(breakingChanges, lockfilePath) {\n return `Interface schema migrations are not backwards compatible with ${lockfilePath}:\\n\\n` + breakingChanges.map(breakingChange => `- ${describeBreakingChange(breakingChange)}`).join(\"\\n\\n\");\n}\nasync function writeLockfile(lockfilePath, lockfile, existingContents) {\n const serialized = serializeLockfile(lockfile);\n if (serialized === existingContents) {\n consola.success(`Ontology schema lockfile ${lockfilePath} is up to date`);\n return;\n }\n await fs.writeFile(lockfilePath, serialized);\n consola.success(`Wrote ontology schema lockfile ${lockfilePath}`);\n}\nasync function readIfExists(path) {\n try {\n return await fs.readFile(path, \"utf-8\");\n } catch (e) {\n if (e.code === \"ENOENT\") {\n return undefined;\n }\n throw e;\n }\n}","/*\n * Copyright 2024 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/promises\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { consola, LogLevels } from \"consola\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineOntology } from \"../api/defineOntology.js\";\nimport { DEFAULT_ONTOLOGY_SCHEMA_LOCKFILE_NAME } from \"../lockfile/OntologySchemaLockfile.js\";\nimport { reconcileOntologySchemaLockfile } from \"../lockfile/reconcileOntologySchemaLockfile.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 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\",\n type: \"string\",\n default: \"ontology.json\",\n coerce: path.resolve\n },\n apiNamespace: {\n describe: \"Api name prefix for namespaced ontology types\",\n type: \"string\",\n default: \"\"\n },\n snapshotDir: {\n alias: \"s\",\n describe: \"Snapshot directory\",\n type: \"string\",\n default: \"snapshots\",\n coerce: path.resolve\n },\n outputDir: {\n alias: \"d\",\n describe: \"Directory for generated ontology entities\",\n type: \"string\",\n coerce: path.resolve\n },\n valueTypesOutput: {\n describe: \"Value Type Output File\",\n type: \"string\",\n default: \"value-types.json\",\n coerce: path.resolve\n },\n dependencies: {\n describe: \"File to write dependencies to\",\n type: \"string\",\n coerce: path.resolve\n },\n generateCodeSnippets: {\n describe: \"Enable code snippet files creation\",\n type: \"boolean\",\n default: false\n },\n codeSnippetPackageName: {\n describe: \"The package name that will be displayed in the code snippets\",\n default: \"\",\n type: \"string\"\n },\n codeSnippetDir: {\n describe: \"Directory for generated code snippet files\",\n type: \"string\",\n default: \"./\",\n coerce: path.resolve\n },\n randomnessKey: {\n describe: \"Value used to assure uniqueness of entities\",\n type: \"string\"\n },\n lockfile: {\n describe: `Ontology schema lockfile path (default: ${DEFAULT_ONTOLOGY_SCHEMA_LOCKFILE_NAME} beside --input)`,\n type: \"string\",\n // No `default`: it depends on --input, which `coerce` cannot see. Resolved after parsing.\n coerce: path.resolve\n },\n writeLocks: {\n describe: \"Update the ontology schema lockfile instead of failing when it is out of date\",\n type: \"boolean\"\n // NB: no default since \"implied\" below\n },\n yes: {\n alias: \"y\",\n describe: \"Accept detected ontology schema migration finalizations/deletions without prompting\",\n type: \"boolean\"\n // NB: no default since \"implied\" below\n },\n verbose: {\n alias: \"v\",\n describe: \"Enable verbose logging: -v for debug, including stack traces on failure, -vv for trace\",\n type: \"boolean\",\n count: true\n }\n }).middleware(({\n verbose\n }) => {\n consola.level = logLevelFor(verbose);\n }, true)\n // --yes only answers the prompt that --write-locks can raise, so on its own it does nothing.\n .implies(\"yes\", \"writeLocks\")\n // Without this, the usage error that `implies` raises calls `process.exit` from inside the\n // library, which takes the whole host process with it.\n .fail((msg, err, usage) => {\n if (err) {\n throw err;\n }\n\n // Registering a failure handler suppresses yargs' showHelpOnFail behavior, so reinstate it.\n usage.showHelp(\"error\");\n throw new Error(msg);\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.generateCodeSnippets && (commandLineOpts.codeSnippetPackageName !== \"\" || commandLineOpts.codeSnippetDir !== path.resolve(\"./\"))) {\n consola.info(\"Package name and/or directory supplied for code snippets, but code snippet generation is false.\");\n }\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\n // The lockfile is a checked-in source artifact describing the ontology definition, not a build artifact\n // like `output`, so it belongs beside the definition rather than wherever maker was invoked.\n const lockfilePath = commandLineOpts.lockfile ?? path.join(path.dirname(commandLineOpts.input), DEFAULT_ONTOLOGY_SCHEMA_LOCKFILE_NAME);\n const ontologyIr = await loadOntology(commandLineOpts.input, apiNamespace, commandLineOpts.outputDir, commandLineOpts.dependencies, commandLineOpts.generateCodeSnippets, commandLineOpts.codeSnippetPackageName, commandLineOpts.codeSnippetDir, commandLineOpts.randomnessKey,\n // An ontology that fails lockfile checks would fail at installation-time, so the ontology-ir\n // should never reach disk at all.\n async ontology => await reconcileOntologySchemaLockfile({\n ontology,\n lockfilePath,\n writeLocks: commandLineOpts.writeLocks ?? false,\n assumeYes: commandLineOpts.yes ?? false\n }));\n consola.info(`Saving ontology to ${commandLineOpts.output}`);\n await fs.writeFile(commandLineOpts.output, JSON.stringify(ontologyIr, (key, value) => key === \"linkedInterfaces\" ? undefined : value, 2));\n // No point in generating block if there aren't any value types\n if (ontologyIr.valueTypes.valueTypes.length > 0 || ontologyIr.importedValueTypes.valueTypes.length > 0) {\n await fs.writeFile(commandLineOpts.valueTypesOutput, JSON.stringify(ontologyIr.valueTypes, null, 2));\n }\n}\nfunction logLevelFor(verbosity) {\n if (verbosity === 0) return LogLevels.info;\n if (verbosity === 1) return LogLevels.debug;\n return LogLevels.trace;\n}\nasync function loadOntology(input, apiNamespace, outputDir, dependencyFile, generateCodeSnippets, snippetPackageName, codeSnippetDir, randomnessKey, beforeWrite) {\n const q = await defineOntology(apiNamespace, async () => await import(pathToFileURL(input).href), outputDir, dependencyFile, generateCodeSnippets, snippetPackageName, codeSnippetDir, randomnessKey, beforeWrite);\n return q;\n}"]}