@osdk/maker 0.14.0-beta.7 → 0.14.0-beta.9

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/browser/api/code-snippets/createCodeSnippets.js +91 -0
  3. package/build/browser/api/code-snippets/createCodeSnippets.js.map +1 -0
  4. package/build/browser/api/code-snippets/snippetTypes.js +60 -0
  5. package/build/browser/api/code-snippets/snippetTypes.js.map +1 -0
  6. package/build/browser/api/defineDeleteInterfaceObjectAction.js +2 -2
  7. package/build/browser/api/defineDeleteInterfaceObjectAction.js.map +1 -1
  8. package/build/browser/api/defineOntology.js +5 -1
  9. package/build/browser/api/defineOntology.js.map +1 -1
  10. package/build/browser/api/test/actions.test.js +9 -9
  11. package/build/browser/api/test/actions.test.js.map +1 -1
  12. package/build/browser/cli/main.js +23 -4
  13. package/build/browser/cli/main.js.map +1 -1
  14. package/build/cjs/index.cjs +1300 -40
  15. package/build/cjs/index.cjs.map +1 -1
  16. package/build/cjs/index.d.cts +1 -1
  17. package/build/esm/api/code-snippets/createCodeSnippets.js +91 -0
  18. package/build/esm/api/code-snippets/createCodeSnippets.js.map +1 -0
  19. package/build/esm/api/code-snippets/snippetTypes.js +60 -0
  20. package/build/esm/api/code-snippets/snippetTypes.js.map +1 -0
  21. package/build/esm/api/defineDeleteInterfaceObjectAction.js +2 -2
  22. package/build/esm/api/defineDeleteInterfaceObjectAction.js.map +1 -1
  23. package/build/esm/api/defineOntology.js +5 -1
  24. package/build/esm/api/defineOntology.js.map +1 -1
  25. package/build/esm/api/test/actions.test.js +9 -9
  26. package/build/esm/api/test/actions.test.js.map +1 -1
  27. package/build/esm/cli/main.js +23 -4
  28. package/build/esm/cli/main.js.map +1 -1
  29. package/build/types/api/code-snippets/createCodeSnippets.d.ts +2 -0
  30. package/build/types/api/code-snippets/createCodeSnippets.d.ts.map +1 -0
  31. package/build/types/api/code-snippets/snippetTypes.d.ts +23 -0
  32. package/build/types/api/code-snippets/snippetTypes.d.ts.map +1 -0
  33. package/build/types/api/defineOntology.d.ts +1 -1
  34. package/build/types/api/defineOntology.d.ts.map +1 -1
  35. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/conversion/toMarketplace/convertActionParameters.ts","../../src/api/common/OntologyEntityTypeEnum.ts","../../src/conversion/toMarketplace/convertCardinality.ts","../../src/conversion/toMarketplace/convertLink.ts","../../src/api/interface/getFlattenedInterfaceProperties.ts","../../src/api/properties/PropertyTypeType.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/conversion/toMarketplace/convertNullabilityToDataConstraint.ts","../../src/conversion/toConjure/distributeTypeHelper.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts","../../src/conversion/toMarketplace/convertSpt.ts","../../src/conversion/toMarketplace/convertInterface.ts","../../src/conversion/toMarketplace/convertDatasourceDefinition.ts","../../src/api/propertyConversionUtils.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/defineOntology.ts","../../src/cli/main.ts","../../src/api/addDependency.ts","../../src/api/action/ActionParameterType.ts","../../src/api/defineAction.ts","../../src/conversion/toMarketplace/convertMappingValue.ts","../../src/api/defineCreateInterfaceObjectAction.ts","../../src/api/defineCreateObjectAction.ts","../../src/api/defineCreateOrModifyObjectAction.ts","../../src/api/defineDeleteInterfaceObjectAction.ts","../../src/api/defineDeleteObjectAction.ts","../../src/api/defineSpt.ts","../../src/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.ts","../../src/api/namespace/combineApiNamespaceIfMissing.ts","../../src/api/defineInterface.ts","../../src/api/defineInterfaceLinkConstraint.ts","../../src/api/defineLink.ts","../../src/api/defineModifyInterfaceObjectAction.ts","../../src/api/defineModifyObjectAction.ts","../../src/api/defineValueType.ts","../../src/api/importOntologyEntity.ts","../../src/api/importSharedPropertyType.ts","../../src/api/wrapWithProxy.ts"],"names":["OntologyEntityTypeEnum","invariant","apiName","path","fs","yargs","hideBin","path2","consola","fs2","path3","fs3","randomUUID","namespace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,SAAS,wBAAwB,MAAQ,EAAA;AAC9C,EAAO,OAAA,MAAA,CAAO,WAAa,CAAA,CAAA,MAAA,CAAO,UAAc,IAAA,IAAI,GAAI,CAAA,CAAA,CAAA,KAAK,CAAC,CAAA,CAAE,EAAI,EAAA;AAAA,IAClE,IAAI,CAAE,CAAA,EAAA;AAAA,IACN,IAAM,EAAA,OAAO,CAAE,CAAA,IAAA,KAAS,QAAW,GAAA;AAAA,MACjC,MAAM,CAAE,CAAA,IAAA;AAAA,MACR,CAAC,CAAA,CAAE,IAAI,GAAG;AAAC,QACT,CAAE,CAAA,IAAA;AAAA,IACN,eAAiB,EAAA;AAAA,MACf,aAAa,CAAE,CAAA,WAAA;AAAA,MACf,WAAA,EAAa,EAAE,WAAe,IAAA,EAAA;AAAA,MAC9B,aAAa;AAAC;AAChB,GACD,CAAC,CAAC,CAAA;AACL;;;ACbW,IAAA,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AA,oBAAA,CAAqB,GAAG,CAAA;AACxB,EAAO,OAAA,GAAA;AACT;;;ACnBO,SAAS,cAAc,MAAQ,EAAA;AACpC,EAAO,OAAA,IAAI,MAAM,MAAQ,EAAA;AAAA,IACvB,GAAA,CAAI,MAAQ,EAAA,IAAA,EAAM,QAAU,EAAA;AAC1B,MAAA,oBAAA,CAAqB,MAAM,CAAA;AAC3B,MAAA,OAAO,OAAQ,CAAA,GAAA,CAAI,MAAQ,EAAA,IAAA,EAAM,QAAQ,CAAA;AAAA;AAC3C,GACD,CAAA;AACH","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\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: []\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, ontologyDefinition } from \"../../api/defineOntology.js\";\nimport { convertCardinality } from \"./convertCardinality.js\";\nexport function convertLink(linkType) {\n validateLink(linkType);\n let definition;\n let datasource = undefined;\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 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: manyObject.primaryKeyPropertyApiName\n }],\n objectTypeBPrimaryKeyMapping: [{\n property: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName\n },\n column: toManyObject.primaryKeyPropertyApiName\n }]\n }\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: linkType.redacted\n };\n }\n return {\n linkType: {\n definition: definition,\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: linkType.status ?? {\n type: \"active\",\n active: {}\n },\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\\\\-]*)/.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];\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}","/*\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 getFlattenedInterfaceProperties(interfaceType) {\n let properties = interfaceType.propertiesV2;\n interfaceType.extendsInterfaces.forEach(ext => {\n properties = {\n ...properties,\n ...getFlattenedInterfaceProperties(ext)\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\";\n }\n return false;\n}\nexport function isStruct(type) {\n return typeof type === \"object\" && type.type === \"struct\";\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 { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { isExotic } from \"./properties/PropertyTypeType.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))$/;\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})?)?$/;\nconst API_NAME_PATTERN = /^([a-zA-Z][a-zA-Z0-9\\\\-]*)$/;\nexport function defineObject(objectDef) {\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 !API_NAME_PATTERN.test(objectDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${objectDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`) : invariant(false) : void 0;\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 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 that if object status is experimental, no property can have a status of active\n if (objectDef.status === \"experimental\") {\n const activeProperties = [];\n Object.entries(objectDef.properties ?? {}).forEach(([apiName, property]) => {\n if (property.status === \"active\") {\n activeProperties.push(apiName);\n }\n });\n !(activeProperties.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `When object \"${objectDef.apiName}\" has experimental status, no properties can have \"active\" status, but found active properties: ${activeProperties.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 !!isExotic(objectDef.properties?.[objectDef.titlePropertyApiName]?.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).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 => [addNamespaceIfNone(mapping.interfaceProperty), mapping.mapsTo]));\n const validateProperty = interfaceProp => {\n if (interfaceProp[1].sharedPropertyType.apiName in interfaceToObjectProperties) {\n return validateInterfaceImplProperty(interfaceProp[1].sharedPropertyType, interfaceToObjectProperties[interfaceProp[0]], objectDef);\n }\n return {\n type: \"invalid\",\n reason: `Interface property ${interfaceProp[1].sharedPropertyType.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(property.apiName ?? apiName, property));\n const finalObject = {\n ...objectDef,\n apiName: apiName,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n properties: flattenedProperties\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(spt, 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 if (JSON.stringify(spt.type) !== 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: ${spt.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.apiName = apiName;\n property.displayName = property.displayName ?? uppercaseFirstLetter(apiName);\n return {\n ...property,\n apiName: 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}\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 finalObject = getObject(datasource.linkDefinition.at(-1).linkType.toMany.object).object;\n foreignProperties.forEach(prop => {\n !(finalObject.properties?.find(p => p.apiName === prop) !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${prop}' on object '${finalObject.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 finalObject = getObject(datasource.linkDefinition.at(-1).linkType.toMany.object).object;\n !(finalObject.properties?.find(p => p.apiName === foreignProperty) !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${foreignProperty}' on object '${finalObject.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}","/*\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 parameterBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: validation.defaultVisibility === \"editable\" ? {\n type: \"hidden\",\n hidden: {}\n } : {\n type: \"editable\",\n editable: {}\n }\n }\n };\n break;\n case \"disabled\":\n parameterBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: validation.defaultVisibility === \"editable\" ? {\n type: \"disabled\",\n disabled: {}\n } : {\n type: \"editable\",\n editable: {}\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: renderHintFromBaseType(p),\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 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 noEmptyCollections: true,\n noNulls: true\n }\n };\n }\n !prop.nullability?.noNulls ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Marking property type has noNulls set to false, marking properties must not be nullable\") : invariant(false) : void 0;\n return {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability\n };\n }\n return prop.nullability === undefined ? undefined : {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function distributeTypeHelper(type) {\n return {\n type,\n [type]: {}\n }; // any cast to match conditional return type\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\nexport function propertyTypeTypeToOntologyIrType(type) {\n switch (true) {\n case typeof type === \"object\" && \"markingType\" in type:\n return {\n \"type\": \"marking\",\n marking: {\n markingType: type.markingType\n }\n };\n case typeof type === \"object\" && \"structDefinition\" in type:\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 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 }\n };\n case typeof type === \"object\" && \"isLongText\" in type:\n return {\n \"type\": \"string\",\n \"string\": {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: type.isLongText,\n supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard,\n supportsExactMatching: type.supportsExactMatching\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: 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 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 { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertSpt({\n type,\n array,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n valueType,\n nullability\n}) {\n const dataConstraint = convertNullabilityToDataConstraint({\n type,\n nullability\n });\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)\n }\n } : propertyTypeTypeToOntologyIrType(type),\n aliases: [],\n baseFormatter: undefined,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: true,\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 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 { convertSpt } from \"./convertSpt.js\";\nexport function convertInterface(interfaceType) {\n const {\n __type,\n ...other\n } = interfaceType;\n return {\n ...other,\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 // TODO(mwalther): Support propertiesV3\n propertiesV3: {}\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 convertDatasourceDefinition(objectType, properties) {\n const baseDatasource = objectType.datasources?.find(ds => [\"dataset\", \"stream\", \"restrictedView\"].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 \"dataset\":\n default:\n return {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties)\n }\n };\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 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\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\", \"mediaReference\", \"geotimeSeries\"].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}","/*\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 { dataConstraintToPropertyTypeDataConstraint } from \"./dataConstraintToPropertyTypeDataConstraint.js\";\nexport function convertValueTypeDataConstraints(dataConstraints) {\n if (dataConstraints.length === 0) {\n return undefined;\n }\n const propertyTypeConstraints = dataConstraints.map(constraint => ({\n constraints: dataConstraintToPropertyTypeDataConstraint(constraint.constraint.constraint),\n failureMessage: constraint.constraint.failureMessage\n }));\n return {\n propertyTypeConstraints\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport invariant from \"tiny-invariant\";\nimport { convertObjectStatus, namespace } from \"../../api/defineOntology.js\";\nimport { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldNotHaveRenderHints } from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.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 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 ?? true,\n ruleSetBinding: undefined,\n baseFormatter: property.baseFormatter,\n type: property.array ? {\n type: \"array\",\n array: {\n subtype: propertyTypeTypeToOntologyIrType(property.type)\n }\n } : propertyTypeTypeToOntologyIrType(property.type),\n typeClasses: property.typeClasses ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),\n status: convertObjectStatus(property.status),\n inlineAction: undefined,\n dataConstraints: property.valueType ? convertValueTypeDataConstraints(property.valueType.constraints) : convertNullabilityToDataConstraint(property),\n 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 { addNamespaceIfNone, 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 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 interfaceTypeApiName: impl.implements.apiName,\n linksV2: {},\n propertiesV2: {},\n properties: Object.fromEntries(impl.propertyMapping.map(mapping => [addNamespaceIfNone(mapping.interfaceProperty), {\n propertyTypeRid: mapping.mapsTo\n }]))\n })),\n allImplementsInterfaces: {}\n },\n datasources: [...propertyDatasources, ...derivedDatasources, objectDatasource],\n entityMetadata: {\n arePatchesEnabled: objectType.editsEnabled ?? false\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 mediaSetViewLocator: identifier,\n properties: [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 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}","/*\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 { convertLink } from \"./convertLink.js\";\nimport { convertObject } from \"./convertObject.js\";\nimport { convertSpt } from \"./convertSpt.js\";\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 return [apiName, {\n interfaceType: convertInterface(interfaceType)\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(([apiName, action]) => action.validation).map(([apiName, action]) => {\n return [apiName, {\n restrictionStatus: {\n hasRolesApplied: true,\n ontologyPackageRid: null,\n publicProject: false\n }\n }];\n })),\n linkTypes: {},\n objectTypes: {}\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 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 { 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 { 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, randomnessKey) {\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 // eslint-disable-next-line no-console\n console.error(\"Unexpected error while processing the body of the ontology\", e);\n throw e;\n }\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\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(entity, null, 2).replace(/(\"__type\"\\s*:\\s*)\"([^\"]*)\"/g, (_, 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 cleanAndValidateLinkTypeId(apiName) {\n // Insert a dash before any uppercase letter that follows a lowercase letter or digit\n const step1 = apiName.replace(/([a-z0-9])([A-Z])/g, \"$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])/g, \"$1-$2\").toLowerCase();\n const VALIDATION_PATTERN = /^([a-z][a-z0-9\\-]*)$/;\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 (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 ...(action.submissionMetadata?.submitButtonDisplayMetadata && {\n submitButtonDisplayMetadata: action.submissionMetadata.submitButtonDisplayMetadata\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration && {\n undoButtonConfiguration: action.submissionMetadata.undoButtonConfiguration\n })\n },\n parameterOrdering: 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: minLength\n }),\n ...(maxLength === undefined ? {} : {\n maxLength: maxLength\n }),\n ...(regex === undefined ? {} : {\n regex: {\n regex: 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 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) {\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 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 throw new Error(\"Structs are not supported yet\");\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(/[-_]+(.)?/g, (_, 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}\nfunction 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}","/*\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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineOntology } from \"../api/defineOntology.js\";\nconst apiNamespaceRegex = /^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$/;\nconst uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\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 randomnessKey: {\n describe: \"Value used to assure uniqueness of entities\",\n type: \"string\",\n coerce: path.resolve\n }\n }).parseAsync();\n let apiNamespace = \"\";\n if (commandLineOpts.apiNamespace.length !== 0) {\n apiNamespace = commandLineOpts.apiNamespace.slice(-1) !== \".\" ? commandLineOpts.apiNamespace + \".\" : commandLineOpts.apiNamespace;\n !(apiNamespace.length < 1024) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is too long.\") : invariant(false) : void 0;\n !apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$\") : invariant(false) : void 0;\n }\n consola.info(`Loading ontology from ${commandLineOpts.input}`);\n if (commandLineOpts.randomnessKey !== undefined) {\n !uuidRegex.test(commandLineOpts.randomnessKey) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Supplied randomness key is not a uuid and shouldn't be used as a uniqueness guarantee\") : invariant(false) : void 0;\n }\n const ontologyIr = await loadOntology(commandLineOpts.input, apiNamespace, commandLineOpts.outputDir, commandLineOpts.dependencies, commandLineOpts.randomnessKey);\n consola.info(`Saving ontology to ${commandLineOpts.output}`);\n await fs.writeFile(commandLineOpts.output, JSON.stringify(ontologyIr, null, 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}\nasync function loadOntology(input, apiNamespace, outputDir, dependencyFile, randomnessKey) {\n const q = await defineOntology(apiNamespace, async () => await import(input), outputDir, dependencyFile, randomnessKey);\n return q;\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// 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\nimport invariant from \"tiny-invariant\";\nimport { convertConditionDefinition } from \"../conversion/toMarketplace/convertConditionDefinition.js\";\nimport { isActionParameterTypePrimitive } from \"./action/ActionParameterType.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { uppercaseFirstLetter } from \"./defineObject.js\";\nimport { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\nexport const MODIFY_OBJECT_PARAMETER = \"objectToModifyParameter\";\nexport const CREATE_OR_MODIFY_OBJECT_PARAMETER = \"objectToCreateOrModifyParameter\";\nexport const CREATE_INTERFACE_OBJECT_PARAMETER = \"objectTypeParameter\";\nexport const MODIFY_INTERFACE_OBJECT_PARAMETER = \"interfaceObjectToModifyParameter\";\nexport function defineAction(actionDef) {\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]+)*$/.test(actionDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action type apiName \"${actionDef.apiName}\" must be alphanumeric, lowercase, and kebab-case`) : 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 });\n const fullAction = {\n ...actionDef,\n apiName: apiName,\n entities: actionDef.entities ?? {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n __type: OntologyEntityTypeEnum.ACTION_TYPE\n };\n validateActionConfiguration(fullAction);\n updateOntology(fullAction);\n return fullAction;\n}\nexport function isPropertyParameter(def, name, type) {\n return !Object.keys(def.nonParameterMappings ?? {}).includes(name) && !isStruct(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 id,\n displayName: def.parameterConfiguration?.[id]?.displayName ?? propertyMap[id]?.displayName ?? uppercaseFirstLetter(id),\n type: def.parameterConfiguration?.[id]?.customParameterType ?? extractActionParameterType(propertyMap[id]),\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(propertyMap[id]?.type)),\n required: def.parameterConfiguration?.[id].required ?? propertyMap[id]?.nullability?.noNulls ?? false\n } : {\n required: propertyMap[id]?.array ?? false ? {\n listLength: propertyMap[id]?.nullability?.noEmptyCollections ? {\n min: 1\n } : {}\n } : requiredMap?.[id] ?? propertyMap[id]?.nullability?.noNulls ?? false,\n allowedValues: extractAllowedValuesFromPropertyType(propertyMap[id]?.type)\n },\n defaultValue: def.parameterConfiguration?.[id]?.defaultValue,\n description: def.parameterConfiguration?.[id]?.description\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: {\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 === 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: {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: [def.interfaceType.apiName]\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n 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: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n 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 });\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 }\n });\n return parameterIds;\n}\nfunction 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 \"struct\":\n case \"structList\":\n throw new Error(\"Structs are not supported yet\");\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 default:\n switch (type.type) {\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 throw new Error(\"Structs are not supported 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 \"marking\":\n return maybeAddList(\"marking\", pt);\n case \"string\":\n return maybeAddList(\"string\", pt);\n case \"struct\":\n throw new Error(\"Structs are not supported 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 maybeAddList(type, pt) {\n return pt.array ?? false ? type + \"List\" : type;\n}\nexport function kebab(s) {\n return s.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/([A-Z])([A-Z][a-z])/g, \"$1-$2\").replace(/\\./g, \"-\").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))) ? 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 return isTargetParameter(parameter) || !Object.keys(def.interfaceType.propertiesV2).includes(addNamespaceIfNone(parameter)) ? parameter : addNamespaceIfNone(parameter);\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 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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { addNamespaceToActionDefinition, convertValidationRule, CREATE_INTERFACE_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nexport function defineCreateInterfaceObjectAction(def) {\n addNamespaceToActionDefinition(def);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);\n const propertyParameters = Object.keys(allProperties).filter(apiName => isPropertyParameter(def, apiName, allProperties[apiName].sharedPropertyType.type));\n const parameterNames = new Set(propertyParameters);\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, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.sharedPropertyType])), parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required])));\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.interfaceType.displayMetadata.displayName}`,\n parameters: 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(propertyParameters.map(id => [id, {\n type: \"parameterId\",\n parameterId: id\n }])),\n ...mappings\n }\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(allProperties), 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 });\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 { convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\nexport function defineCreateObjectAction(def) {\n validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);\n const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter(ds => ds.type === \"derived\").flatMap(ds => Object.keys(ds.propertyMapping));\n const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter(id => isPropertyParameter(def, id, def.objectType.properties?.[id].type) && !isStruct(def.objectType.properties?.[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, def.objectType.properties ?? {}, 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 parameters: 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 ...Object.fromEntries(propertyParameters.map(p => [p, {\n type: \"parameterId\",\n parameterId: p\n }])),\n ...mappings\n },\n structFieldValues: {}\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(def.objectType.properties ?? {}), 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 });\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 { convertValidationRule, CREATE_OR_MODIFY_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, defineAction, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\nexport function defineCreateOrModifyObjectAction(def) {\n validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);\n const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter(ds => ds.type === \"derived\").flatMap(ds => Object.keys(ds.propertyMapping));\n const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter(id => !Object.keys(def.nonParameterMappings ?? {}).includes(id) && !def.excludedProperties?.includes(id) && !isStruct(def.objectType.properties?.[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, def.objectType.properties ?? {}, parameterNames);\n parameters.forEach(p => {\n if (p.id !== CREATE_OR_MODIFY_OBJECT_PARAMETER && 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 parameters: parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"addOrModifyObjectRuleV2\",\n addOrModifyObjectRuleV2: {\n objectToModify: CREATE_OR_MODIFY_OBJECT_PARAMETER,\n propertyValues: {\n ...Object.fromEntries(propertyParameters.map(p => [p, {\n type: \"parameterId\",\n parameterId: p\n }])),\n ...mappings\n },\n structFieldValues: {}\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(def.objectType.properties ?? {}), 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 });\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 { defineAction, kebab } from \"./defineAction.js\";\nexport function defineDeleteInterfaceObjectAction(def) {\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 parameters: [{\n id: \"objectToDeleteParameter\",\n displayName: \"Delete object\",\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 status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: \"objectToDeleteParameter\"\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.interfaceType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\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 { convertValidationRule, defineAction, kebab } from \"./defineAction.js\";\nexport function defineDeleteObjectAction(def) {\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 parameters: [{\n id: \"objectToDeleteParameter\",\n displayName: \"Delete object\",\n type: {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: def.objectType.apiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"objectQuery\"\n }\n }\n }],\n status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: \"objectToDeleteParameter\"\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 });\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 { namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldNotHaveRenderHints } from \"./propertyConversionUtils.js\";\nexport function defineSharedPropertyType(sptDef) {\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 updateOntology(fullSpt);\n return fullSpt;\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 default:\n throw new Error(`Invalid status type: ${status.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\nexport function combineApiNamespaceIfMissing(namespace, apiName) {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\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 { namespace, ontologyDefinition, updateOntology, withoutNamespace } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nimport { mapSimplifiedStatusToInterfaceTypeStatus } from \"./interface/mapSimplifiedStatusToInterfaceTypeStatus.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nimport { isPropertyTypeType } from \"./properties/PropertyTypeType.js\";\nexport function defineInterface(interfaceDef) {\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 const properties = Object.fromEntries(Object.entries(interfaceDef.properties ?? {}).map(([unNamespacedPropApiName, type]) => {\n if (typeof type === \"object\" && \"propertyDefinition\" in type) {\n // If the property is an imported SPT, use the SPT's apiName\n const apiName = combineApiNamespaceIfMissing(namespace, typeof type.propertyDefinition === \"object\" && \"apiName\" in type.propertyDefinition ? type.propertyDefinition.apiName : unNamespacedPropApiName);\n return [apiName, {\n required: type.required,\n sharedPropertyType: unifyBasePropertyDefinition(namespace, unNamespacedPropApiName, type.propertyDefinition)\n }];\n }\n\n // If the property is an imported SPT, use the SPT's apiName\n const apiName = combineApiNamespaceIfMissing(namespace, typeof type === \"object\" && \"apiName\" in type ? type.apiName : unNamespacedPropApiName);\n return [apiName, {\n required: true,\n sharedPropertyType: unifyBasePropertyDefinition(namespace, unNamespacedPropApiName, type)\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 links: [],\n status,\n propertiesV2: properties,\n searchable: interfaceDef.searchable ?? true,\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE\n };\n updateOntology(fullInterface);\n return fullInterface;\n}\nfunction unifyBasePropertyDefinition(namespace, apiName, type) {\n if (typeof type === \"string\" || typeof type === \"object\" && !(\"apiName\" in type)) {\n !isPropertyTypeType(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 const spt = defineSharedPropertyType({\n apiName,\n displayName: apiName,\n type,\n array: false\n });\n return spt;\n } else {\n const unNamespacedTypeApiName = withoutNamespace(type.apiName);\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}","/*\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 { namespace, withoutNamespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nexport function defineInterfaceLinkConstraint(linkDef) {\n const fromLinkMeta = getLinkMeta(linkDef);\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 linkDef.from.links.push({\n cardinality: linkDef.toMany ? \"MANY\" : \"SINGLE\",\n linkedEntityTypeId: getLinkedType(linkDef.toMany ?? linkDef.toOne),\n metadata: fromLinkMeta,\n required: linkDef.required ?? true\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 { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { convertToPluralDisplayName, uppercaseFirstLetter } from \"./defineObject.js\";\nimport { updateOntology } from \"./defineOntology.js\";\nexport function defineLink(linkDefinition) {\n // NOTE: we would normally do validation here, but because of circular dependencies\n // we have to wait to validate until everything has been defined. The code for validation\n // was moved to convertLink.ts.\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 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 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: []\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 { addNamespaceToActionDefinition, convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, isPropertyParameter, kebab, MODIFY_INTERFACE_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nexport function defineModifyInterfaceObjectAction(def) {\n addNamespaceToActionDefinition(def);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);\n const propertyParameters = Object.keys(allProperties).filter(apiName => isPropertyParameter(def, apiName, allProperties[apiName].sharedPropertyType.type));\n const parameterNames = new Set(propertyParameters);\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, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.sharedPropertyType])), parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required])));\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.interfaceType.displayMetadata.displayName}`,\n parameters: 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 interfaceObjectToModifyParameter: \"interfaceObjectToModifyParameter\",\n sharedPropertyValues: {\n ...Object.fromEntries(propertyParameters.map(id => [id, {\n type: \"parameterId\",\n parameterId: id\n }])),\n ...mappings\n }\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(allProperties), 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 });\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 { convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, isPropertyParameter, kebab, MODIFY_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nexport function defineModifyObjectAction(def) {\n validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);\n const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter(id => isPropertyParameter(def, id, def.objectType.properties?.[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, def.objectType.properties ?? {}, parameterNames);\n parameters.forEach(p => {\n if (p.id !== MODIFY_OBJECT_PARAMETER && 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 parameters: parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"modifyObjectRule\",\n modifyObjectRule: {\n objectToModify: MODIFY_OBJECT_PARAMETER,\n propertyValues: {\n ...Object.fromEntries(propertyParameters.map(p => [p, {\n type: \"parameterId\",\n parameterId: p\n }])),\n ...mappings\n },\n structFieldValues: {}\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(def.objectType.properties ?? {}), 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 });\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 { namespace, updateOntology } from \"./defineOntology.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(valueTypeDef) {\n const {\n apiName,\n displayName,\n description,\n type,\n version\n } = valueTypeDef;\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-]+)*))?)$/;\n !semverValidation.test(version) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Version is not a valid semver\") : 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: {\n type: \"active\",\n active: {}\n },\n version: version,\n baseType: baseType,\n constraints: constraints,\n exampleValues: [],\n __type: OntologyEntityTypeEnum.VALUE_TYPE\n };\n updateOntology(vt);\n return vt;\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 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}"]}
1
+ {"version":3,"sources":["../../src/conversion/toMarketplace/convertActionParameters.ts","../../src/api/common/OntologyEntityTypeEnum.ts","../../src/conversion/toMarketplace/convertCardinality.ts","../../src/conversion/toMarketplace/convertLink.ts","../../src/api/interface/getFlattenedInterfaceProperties.ts","../../src/api/properties/PropertyTypeType.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/conversion/toMarketplace/convertNullabilityToDataConstraint.ts","../../src/conversion/toConjure/distributeTypeHelper.ts","../../src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts","../../src/conversion/toMarketplace/convertSpt.ts","../../src/conversion/toMarketplace/convertInterface.ts","../../src/conversion/toMarketplace/convertDatasourceDefinition.ts","../../src/api/propertyConversionUtils.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","../../../../node_modules/.pnpm/outdent@0.8.0/node_modules/outdent/lib-module/index.js","../../../../node_modules/.pnpm/@osdk+typescript-sdk-docs@0.2.0/node_modules/@osdk/typescript-sdk-docs/build/esm/generatedNoCheck/docsNoComputedVariables.js","../../../../node_modules/.pnpm/@osdk+typescript-sdk-docs@0.2.0/node_modules/@osdk/typescript-sdk-docs/build/esm/docs.js","../../../../node_modules/.pnpm/mustache@4.2.0/node_modules/mustache/mustache.mjs","../../src/api/code-snippets/snippetTypes.ts","../../src/api/code-snippets/createCodeSnippets.ts","../../src/api/defineOntology.ts","../../src/cli/main.ts","../../src/api/addDependency.ts","../../src/api/action/ActionParameterType.ts","../../src/api/defineAction.ts","../../src/conversion/toMarketplace/convertMappingValue.ts","../../src/api/defineCreateInterfaceObjectAction.ts","../../src/api/defineCreateObjectAction.ts","../../src/api/defineCreateOrModifyObjectAction.ts","../../src/api/defineDeleteInterfaceObjectAction.ts","../../src/api/defineDeleteObjectAction.ts","../../src/api/defineSpt.ts","../../src/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.ts","../../src/api/namespace/combineApiNamespaceIfMissing.ts","../../src/api/defineInterface.ts","../../src/api/defineInterfaceLinkConstraint.ts","../../src/api/defineLink.ts","../../src/api/defineModifyInterfaceObjectAction.ts","../../src/api/defineModifyObjectAction.ts","../../src/api/defineValueType.ts","../../src/api/importOntologyEntity.ts","../../src/api/importSharedPropertyType.ts","../../src/api/wrapWithProxy.ts"],"names":["OntologyEntityTypeEnum","invariant","apiName","clearCache","parse","render","interfaceSnippets","actionSnippets","objectSnippets","fs","consola","path","path2","fs2","yargs","hideBin","path3","fs3","path4","fs4","randomUUID","namespace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,SAAS,wBAAwB,MAAQ,EAAA;AAC9C,EAAO,OAAA,MAAA,CAAO,WAAa,CAAA,CAAA,MAAA,CAAO,UAAc,IAAA,IAAI,GAAI,CAAA,CAAA,CAAA,KAAK,CAAC,CAAA,CAAE,EAAI,EAAA;AAAA,IAClE,IAAI,CAAE,CAAA,EAAA;AAAA,IACN,IAAM,EAAA,OAAO,CAAE,CAAA,IAAA,KAAS,QAAW,GAAA;AAAA,MACjC,MAAM,CAAE,CAAA,IAAA;AAAA,MACR,CAAC,CAAA,CAAE,IAAI,GAAG;AAAC,QACT,CAAE,CAAA,IAAA;AAAA,IACN,eAAiB,EAAA;AAAA,MACf,aAAa,CAAE,CAAA,WAAA;AAAA,MACf,WAAA,EAAa,EAAE,WAAe,IAAA,EAAA;AAAA,MAC9B,aAAa;AAAC;AAChB,GACD,CAAC,CAAC,CAAA;AACL;;;ACbW,IAAA,sBAAA,6BAAgDA,uBAAwB,EAAA;AACjF,EAAAA,uBAAAA,CAAuB,aAAa,CAAI,GAAA,aAAA;AACxC,EAAAA,uBAAAA,CAAuB,WAAW,CAAI,GAAA,WAAA;AACtC,EAAAA,uBAAAA,CAAuB,gBAAgB,CAAI,GAAA,gBAAA;AAC3C,EAAAA,uBAAAA,CAAuB,sBAAsB,CAAI,GAAA,sBAAA;AACjD,EAA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,QAAU,EAAA;AAC1B,MAAA,oBAAA,CAAqB,MAAM,CAAA;AAC3B,MAAA,OAAO,OAAQ,CAAA,GAAA,CAAI,MAAQ,EAAA,IAAA,EAAM,QAAQ,CAAA;AAAA;AAC3C,GACD,CAAA;AACH","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\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: []\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, ontologyDefinition } from \"../../api/defineOntology.js\";\nimport { convertCardinality } from \"./convertCardinality.js\";\nexport function convertLink(linkType) {\n validateLink(linkType);\n let definition;\n let datasource = undefined;\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 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: manyObject.primaryKeyPropertyApiName\n }],\n objectTypeBPrimaryKeyMapping: [{\n property: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName\n },\n column: toManyObject.primaryKeyPropertyApiName\n }]\n }\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: linkType.redacted\n };\n }\n return {\n linkType: {\n definition: definition,\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: linkType.status ?? {\n type: \"active\",\n active: {}\n },\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\\\\-]*)/.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];\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}","/*\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 getFlattenedInterfaceProperties(interfaceType) {\n let properties = interfaceType.propertiesV2;\n interfaceType.extendsInterfaces.forEach(ext => {\n properties = {\n ...properties,\n ...getFlattenedInterfaceProperties(ext)\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\";\n }\n return false;\n}\nexport function isStruct(type) {\n return typeof type === \"object\" && type.type === \"struct\";\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 { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { isExotic } from \"./properties/PropertyTypeType.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))$/;\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})?)?$/;\nconst API_NAME_PATTERN = /^([a-zA-Z][a-zA-Z0-9\\\\-]*)$/;\nexport function defineObject(objectDef) {\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 !API_NAME_PATTERN.test(objectDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid API name ${objectDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`) : invariant(false) : void 0;\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 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 that if object status is experimental, no property can have a status of active\n if (objectDef.status === \"experimental\") {\n const activeProperties = [];\n Object.entries(objectDef.properties ?? {}).forEach(([apiName, property]) => {\n if (property.status === \"active\") {\n activeProperties.push(apiName);\n }\n });\n !(activeProperties.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `When object \"${objectDef.apiName}\" has experimental status, no properties can have \"active\" status, but found active properties: ${activeProperties.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 !!isExotic(objectDef.properties?.[objectDef.titlePropertyApiName]?.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).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 => [addNamespaceIfNone(mapping.interfaceProperty), mapping.mapsTo]));\n const validateProperty = interfaceProp => {\n if (interfaceProp[1].sharedPropertyType.apiName in interfaceToObjectProperties) {\n return validateInterfaceImplProperty(interfaceProp[1].sharedPropertyType, interfaceToObjectProperties[interfaceProp[0]], objectDef);\n }\n return {\n type: \"invalid\",\n reason: `Interface property ${interfaceProp[1].sharedPropertyType.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(property.apiName ?? apiName, property));\n const finalObject = {\n ...objectDef,\n apiName: apiName,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n properties: flattenedProperties\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(spt, 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 if (JSON.stringify(spt.type) !== 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: ${spt.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.apiName = apiName;\n property.displayName = property.displayName ?? uppercaseFirstLetter(apiName);\n return {\n ...property,\n apiName: 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}\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 finalObject = getObject(datasource.linkDefinition.at(-1).linkType.toMany.object).object;\n foreignProperties.forEach(prop => {\n !(finalObject.properties?.find(p => p.apiName === prop) !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${prop}' on object '${finalObject.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 finalObject = getObject(datasource.linkDefinition.at(-1).linkType.toMany.object).object;\n !(finalObject.properties?.find(p => p.apiName === foreignProperty) !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Property '${foreignProperty}' on object '${finalObject.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}","/*\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 parameterBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: validation.defaultVisibility === \"editable\" ? {\n type: \"hidden\",\n hidden: {}\n } : {\n type: \"editable\",\n editable: {}\n }\n }\n };\n break;\n case \"disabled\":\n parameterBlockOverride = {\n type: \"visibility\",\n visibility: {\n visibility: validation.defaultVisibility === \"editable\" ? {\n type: \"disabled\",\n disabled: {}\n } : {\n type: \"editable\",\n editable: {}\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: renderHintFromBaseType(p),\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 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 noEmptyCollections: true,\n noNulls: true\n }\n };\n }\n !prop.nullability?.noNulls ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Marking property type has noNulls set to false, marking properties must not be nullable\") : invariant(false) : void 0;\n return {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability\n };\n }\n return prop.nullability === undefined ? undefined : {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function distributeTypeHelper(type) {\n return {\n type,\n [type]: {}\n }; // any cast to match conditional return type\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\nexport function propertyTypeTypeToOntologyIrType(type) {\n switch (true) {\n case typeof type === \"object\" && \"markingType\" in type:\n return {\n \"type\": \"marking\",\n marking: {\n markingType: type.markingType\n }\n };\n case typeof type === \"object\" && \"structDefinition\" in type:\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 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 }\n };\n case typeof type === \"object\" && \"isLongText\" in type:\n return {\n \"type\": \"string\",\n \"string\": {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: type.isLongText,\n supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard,\n supportsExactMatching: type.supportsExactMatching\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: 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 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 { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\nexport function convertSpt({\n type,\n array,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n valueType,\n nullability\n}) {\n const dataConstraint = convertNullabilityToDataConstraint({\n type,\n nullability\n });\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)\n }\n } : propertyTypeTypeToOntologyIrType(type),\n aliases: [],\n baseFormatter: undefined,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: true,\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 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 { convertSpt } from \"./convertSpt.js\";\nexport function convertInterface(interfaceType) {\n const {\n __type,\n ...other\n } = interfaceType;\n return {\n ...other,\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 // TODO(mwalther): Support propertiesV3\n propertiesV3: {}\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 convertDatasourceDefinition(objectType, properties) {\n const baseDatasource = objectType.datasources?.find(ds => [\"dataset\", \"stream\", \"restrictedView\"].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 \"dataset\":\n default:\n return {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: objectType.apiName,\n propertyMapping: buildPropertyMapping(properties)\n }\n };\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 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\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\", \"mediaReference\", \"geotimeSeries\"].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}","/*\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 { dataConstraintToPropertyTypeDataConstraint } from \"./dataConstraintToPropertyTypeDataConstraint.js\";\nexport function convertValueTypeDataConstraints(dataConstraints) {\n if (dataConstraints.length === 0) {\n return undefined;\n }\n const propertyTypeConstraints = dataConstraints.map(constraint => ({\n constraints: dataConstraintToPropertyTypeDataConstraint(constraint.constraint.constraint),\n failureMessage: constraint.constraint.failureMessage\n }));\n return {\n propertyTypeConstraints\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport invariant from \"tiny-invariant\";\nimport { convertObjectStatus, namespace } from \"../../api/defineOntology.js\";\nimport { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldNotHaveRenderHints } from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.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 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 ?? true,\n ruleSetBinding: undefined,\n baseFormatter: property.baseFormatter,\n type: property.array ? {\n type: \"array\",\n array: {\n subtype: propertyTypeTypeToOntologyIrType(property.type)\n }\n } : propertyTypeTypeToOntologyIrType(property.type),\n typeClasses: property.typeClasses ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),\n status: convertObjectStatus(property.status),\n inlineAction: undefined,\n dataConstraints: property.valueType ? convertValueTypeDataConstraints(property.valueType.constraints) : convertNullabilityToDataConstraint(property),\n 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 { addNamespaceIfNone, 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 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 interfaceTypeApiName: impl.implements.apiName,\n linksV2: {},\n propertiesV2: {},\n properties: Object.fromEntries(impl.propertyMapping.map(mapping => [addNamespaceIfNone(mapping.interfaceProperty), {\n propertyTypeRid: mapping.mapsTo\n }]))\n })),\n allImplementsInterfaces: {}\n },\n datasources: [...propertyDatasources, ...derivedDatasources, objectDatasource],\n entityMetadata: {\n arePatchesEnabled: objectType.editsEnabled ?? false\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 mediaSetViewLocator: identifier,\n properties: [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 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}","/*\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 { convertLink } from \"./convertLink.js\";\nimport { convertObject } from \"./convertObject.js\";\nimport { convertSpt } from \"./convertSpt.js\";\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 return [apiName, {\n interfaceType: convertInterface(interfaceType)\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(([apiName, action]) => action.validation).map(([apiName, action]) => {\n return [apiName, {\n restrictionStatus: {\n hasRolesApplied: true,\n ontologyPackageRid: null,\n publicProject: false\n }\n }];\n })),\n linkTypes: {},\n objectTypes: {}\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}","// In the absence of a WeakSet or WeakMap implementation, don't break, but don't cache either.\nfunction noop() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n}\nfunction createWeakMap() {\n if (typeof WeakMap !== \"undefined\") {\n return new WeakMap();\n } else {\n return fakeSetOrMap();\n }\n}\n/**\n * Creates and returns a no-op implementation of a WeakMap / WeakSet that never stores anything.\n */\nfunction fakeSetOrMap() {\n return {\n add: noop,\n delete: noop,\n get: noop,\n set: noop,\n has: function (k) {\n return false;\n }\n };\n}\n// Safe hasOwnProperty\nvar hop = Object.prototype.hasOwnProperty;\nvar has = function (obj, prop) {\n return hop.call(obj, prop);\n};\n// Copy all own enumerable properties from source to target\nfunction extend(target, source) {\n for (var prop in source) {\n if (has(source, prop)) {\n target[prop] = source[prop];\n }\n }\n return target;\n}\nvar reLeadingNewline = /^[ \\t]*(?:\\r\\n|\\r|\\n)/;\nvar reTrailingNewline = /(?:\\r\\n|\\r|\\n)[ \\t]*$/;\nvar reStartsWithNewlineOrIsEmpty = /^(?:[\\r\\n]|$)/;\nvar reDetectIndentation = /(?:\\r\\n|\\r|\\n)([ \\t]*)(?:[^ \\t\\r\\n]|$)/;\nvar reOnlyWhitespaceWithAtLeastOneNewline = /^[ \\t]*[\\r\\n][ \\t\\r\\n]*$/;\nfunction _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {\n // If first interpolated value is a reference to outdent,\n // determine indentation level from the indentation of the interpolated value.\n var indentationLevel = 0;\n var match = strings[0].match(reDetectIndentation);\n if (match) {\n indentationLevel = match[1].length;\n }\n var reSource = \"(\\\\r\\\\n|\\\\r|\\\\n).{0,\" + indentationLevel + \"}\";\n var reMatchIndent = new RegExp(reSource, \"g\");\n if (firstInterpolatedValueSetsIndentationLevel) {\n strings = strings.slice(1);\n }\n var newline = options.newline,\n trimLeadingNewline = options.trimLeadingNewline,\n trimTrailingNewline = options.trimTrailingNewline;\n var normalizeNewlines = typeof newline === \"string\";\n var l = strings.length;\n var outdentedStrings = strings.map(function (v, i) {\n // Remove leading indentation from all lines\n v = v.replace(reMatchIndent, \"$1\");\n // Trim a leading newline from the first string\n if (i === 0 && trimLeadingNewline) {\n v = v.replace(reLeadingNewline, \"\");\n }\n // Trim a trailing newline from the last string\n if (i === l - 1 && trimTrailingNewline) {\n v = v.replace(reTrailingNewline, \"\");\n }\n // Normalize newlines\n if (normalizeNewlines) {\n v = v.replace(/\\r\\n|\\n|\\r/g, function (_) {\n return newline;\n });\n }\n return v;\n });\n return outdentedStrings;\n}\nfunction concatStringsAndValues(strings, values) {\n var ret = \"\";\n for (var i = 0, l = strings.length; i < l; i++) {\n ret += strings[i];\n if (i < l - 1) {\n ret += values[i];\n }\n }\n return ret;\n}\nfunction isTemplateStringsArray(v) {\n return has(v, \"raw\") && has(v, \"length\");\n}\n/**\n * It is assumed that opts will not change. If this is a problem, clone your options object and pass the clone to\n * makeInstance\n * @param options\n * @return {outdent}\n */\nfunction createInstance(options) {\n /** Cache of pre-processed template literal arrays */\n var arrayAutoIndentCache = createWeakMap();\n /**\n * Cache of pre-processed template literal arrays, where first interpolated value is a reference to outdent,\n * before interpolated values are injected.\n */\n var arrayFirstInterpSetsIndentCache = createWeakMap();\n function outdent(stringsOrOptions) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n /* tslint:enable:no-shadowed-variable */\n if (isTemplateStringsArray(stringsOrOptions)) {\n var strings = stringsOrOptions;\n // Is first interpolated value a reference to outdent, alone on its own line, without any preceding non-whitespace?\n var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);\n // Perform outdentation\n var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;\n var renderedArray = cache.get(strings);\n if (!renderedArray) {\n renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);\n cache.set(strings, renderedArray);\n }\n /** If no interpolated values, skip concatenation step */\n if (values.length === 0) {\n return renderedArray[0];\n }\n /** Concatenate string literals with interpolated values */\n var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);\n return rendered;\n } else {\n // Create and return a new instance of outdent with the given options\n return createInstance(extend(extend({}, options), stringsOrOptions || {}));\n }\n }\n var fullOutdent = extend(outdent, {\n string: function (str) {\n return _outdentArray([str], false, options)[0];\n }\n });\n return fullOutdent;\n}\nvar defaultOutdent = createInstance({\n trimLeadingNewline: true,\n trimTrailingNewline: true\n});\n// Named exports. Simple and preferred.\n// import outdent from 'outdent';\nexport default defaultOutdent;\n// import {outdent} from 'outdent';\nexport { defaultOutdent as outdent };\nif (typeof module !== \"undefined\") {\n // In webpack harmony-modules environments, module.exports is read-only,\n // so we fail gracefully.\n try {\n module.exports = defaultOutdent;\n Object.defineProperty(defaultOutdent, \"__esModule\", {\n value: true\n });\n defaultOutdent.default = defaultOutdent;\n defaultOutdent.outdent = defaultOutdent;\n } catch (e) {}\n}","// THIS FILE IS GENERATED. DO NOT MODIFY.\n// You probably want to modify ../../../codegen.mjs instead.\n\nexport const snippets = {\n \"kind\": \"sdk\",\n \"versions\": {\n \"1.0.0\": {\n \"snippets\": {\n \"loadSingleObjectGuide\": [{\n \"template\": \"import { type GetObjectError, isOk, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst result: Result<{{objectType}}, GetObjectError> = await client.ontology.objects.{{objectType}}.get(\\\"primaryKey\\\");\\nif (isOk(result)) {\\n const object: {{objectType}} = result.value;\\n} else {\\n console.error(result.error.errorType);\\n}\"\n }],\n \"loadObjectPageGuide\": [{\n \"template\": \"import { isOk, type LoadObjectSetError, Page, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst firstPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}.page({ pageSize: 30 });\\n\\nif (isOk(firstPage)) {\\n const secondPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\\n .page({ pageSize: 30, pageToken: firstPage.value.nextPageToken });\\n\\n const objects = isOk(secondPage) ? [...firstPage.value.data, ...secondPage.value.data] : firstPage.value.data;\\n const object = objects[0];\\n}\"\n }],\n \"orderObjectsGuide\": [{\n \"template\": \"import { isOk, Page, type Result, type SearchObjectsError } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst page: Result<Page<{{objectType}}>, SearchObjectsError> = await client.ontology.objects.{{objectType}}\\n .orderBy(sortBy => sortBy.{{titleProperty}}.asc())\\n .page({ pageSize: 30 });\\n\\nif (isOk(page)) {\\n const objects = page.value.data;\\n const object = objects[0];\\n}\"\n }],\n \"searchObjectsGuide\": [{\n \"template\": \"import { isOk, type LoadObjectSetError, Page, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst page: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\\n .where(query => query.{{titleProperty}}.isNull())\\n .page({ pageSize: 30 });\\n\\nif (isOk(page)) {\\n const objects = page.value.data;\\n const object = objects[0];\\n}\"\n }],\n \"loadSingleObjectReference\": [{\n \"template\": \"import { type GetObjectError, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst response: Result<{{objectType}}, GetObjectError> = await client.ontology.objects.{{objectType}}.get(\\\"primaryKey\\\");\"\n }],\n \"loadObjectsReference\": [{\n \"template\": \"import { type LoadObjectSetError, Page, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst response: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\\n .page({ pageSize: 30 });\"\n }],\n \"loadAllObjectsReference\": [{\n \"template\": \"import { isOk, type LoadObjectSetError, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst objects: Result<{{objectType}}[], LoadObjectSetError> = await client.ontology.objects.{{objectType}}.all();\\n\\nif (isOk(objects)) {\\n const object = objects.value[0];\\n}\"\n }],\n \"loadLinkedObjectReference\": [{\n \"template\": \"import { type GetLinkedObjectError, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{sourceObjectType}}, {{linkedObjectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getLinked{{linkedObjectType}}(source: {{sourceObjectType}}, linkedObjectPrimaryKey: {{linkedPrimaryKeyPropertyV1.type}}) {\\n return source.{{linkApiName}}.get(linkedObjectPrimaryKey);\\n}\",\n \"computedVariables\": [\"linkedPrimaryKeyPropertyV1\"]\n }],\n \"loadLinkedObjectsReference\": [{\n \"template\": \"import { type GetLinkedObjectError, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{sourceObjectType}}, {{linkedObjectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getLinked{{linkedObjectType}}(source: {{sourceObjectType}}) {\\n {{#isLinkManySided}}\\n return source.{{linkApiName}}.page({ pageSize: 30 });\\n {{/isLinkManySided}}\\n {{^isLinkManySided}}\\n return source.{{linkApiName}}.get();\\n {{/isLinkManySided}}\\n}\"\n }],\n \"aggregationTemplate\": [{\n \"template\": \"import { Op } from \\\"{{{packageName}}}\\\";\\n\\nconst num{{objectType}} = await client.ontology.objects.{{objectType}}\\n .where(query => Op.not(query.{{property}}.isNull()))\\n .groupBy(property => property.{{property}}.exact())\\n .count()\\n .compute()\"\n }],\n \"countAggregationTemplate\": [{\n \"template\": \"const num{{objectType}} = await client.ontology.objects.{{objectType}}\\n .count()\\n .compute()\"\n }],\n \"approximateDistinctAggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nconst distinct{{objectType}} = await client.ontology.objects.{{objectType}}\\n .approximateDistinct(obj => obj.{{property}})\\n .compute()\\n\\n// This is equivalent to the above, but uses metricName as the metric name instead of the default \\\"distinctCount\\\"\\nconst distinct{{objectType}}CustomName = await client.ontology.objects.{{objectType}}\\n .aggregate(obj => ({\\n metricName: obj.{{property}}.approximateDistinct(),\\n }))\\n .compute()\"\n }],\n \"exactDistinctAggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nconst distinct{{objectType}} = await client.ontology.objects.{{objectType}}\\n .exactDistinct(obj => obj.{{property}})\\n .compute()\\n\\n// This is equivalent to the above, but uses metricName as the metric name instead of the default \\\"exactDistinctCount\\\"\\nconst distinct{{objectType}}CustomName = await client.ontology.objects.{{objectType}}\\n .aggregate(obj => ({\\n metricName: obj.{{property}}.exactDistinct(),\\n }))\\n .compute()\"\n }],\n \"numericAggregationTemplate\": [{\n \"template\": \"const {{operation}}{{objectType}} = await client.ontology.objects.{{objectType}}\\n .{{operation}}(obj => obj.{{property}})\\n .compute()\\n\\n// This is equivalent to the above, but uses \\\"metricName\\\" as the metric name instead of the default \\\"{{operation}}\\\"\\nconst {{operation}}{{objectType}}CustomName = await client.ontology.objects.{{objectType}}\\n .aggregate(obj => ({\\n metricName: obj.{{property}}.{{operation}}(),\\n }))\\n .compute()\"\n }],\n \"fixedWidthGroupByTemplate\": [{\n \"template\": \"const grouped{{objectType}} = await client.ontology.objects.{{objectType}}\\n .groupBy(obj => obj.{{property}}.fixedWidth(10))\\n .count()\\n .compute()\"\n }],\n \"durationGroupByTemplate\": [{\n \"template\": \"const grouped{{objectType}} = await client.ontology.objects.{{objectType}}\\n .groupBy(obj => obj.{{property}}.by{{duration}}({{#durationText}}{{arg}}{{/durationText}}))\\n .count()\\n .compute()\"\n }],\n \"exactGroupByTemplate\": [{\n \"template\": \"const grouped{{objectType}} = await client.ontology.objects.{{objectType}}\\n .groupBy(obj => obj.{{property}}.exact())\\n .count()\\n .compute()\"\n }],\n \"rangeGroupByTemplate\": [{\n \"template\": \"{{#isDateProperty}}\\nimport { LocalDate } from \\\"{{{packageName}}}\\\";\\n\\n{{/isDateProperty}}\\n{{#isTimestampProperty}}\\nimport { Timestamp } from \\\"{{{packageName}}}\\\";\\n\\n{{/isTimestampProperty}}\\nconst grouped{{objectType}} = await client.ontology.objects.{{objectType}}\\n .groupBy(obj => obj.{{property}}.ranges([{\\n startValue: {{propertyValueV1}},\\n endValue: {{propertyValueIncrementedV1}}\\n }]))\\n .count()\\n .compute()\",\n \"computedVariables\": [\"propertyValueV1\", \"propertyValueIncrementedV1\"]\n }],\n \"applyAction\": [{\n \"template\": \"import { ActionValidationResult, ActionExecutionMode, ReturnEditsMode{{#hasAttachmentImports}}, Attachment{{/hasAttachmentImports}}{{#hasDateInputs}}, LocalDate{{#hasTimestampInputs}}, {{/hasTimestampInputs}}{{/hasDateInputs}}{{#hasTimestampInputs}}, Timestamp{{/hasTimestampInputs}} } from \\\"{{{packageName}}}\\\";\\n\\n{{#hasAttachmentUpload}}\\nconst attachment: Attachment = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\nconst result = await client.ontology.actions.{{actionApiName}}({{^hasParameters}}{},{{/hasParameters}}{{#hasParameters}}{\\n {{#actionParameterSampleValuesV1}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV1}}\\n},{{/hasParameters}} {\\n mode: ActionExecutionMode.VALIDATE_AND_EXECUTE,\\n returnEdits: ReturnEditsMode.ALL,\\n }\\n);\\n// Check if http request was successful\\nif (!isOk(result)) {\\n throw result.error;\\n}\\n// Check if the validation was successful\\nconsole.log(result.value.validation);\\nif (result.value.validation.result === ActionValidationResult.VALID) {\\n // If ReturnEditsMode.ALL is used, new and updated objects edits will contain the primary key of the object\\n if (result.value.edits.type === \\\"edits\\\") {\\n console.log(result.value.edits);\\n }\\n}\",\n \"computedVariables\": [\"actionParameterSampleValuesV1\"]\n }],\n \"batchApplyAction\": [{\n \"template\": \"import { ActionExecutionMode, ReturnEditsMode{{#hasAttachmentImports}}, Attachment{{/hasAttachmentImports}}{{#hasDateInputs}}, LocalDate{{#hasTimestampInputs}}, {{/hasTimestampInputs}}{{/hasDateInputs}}{{#hasTimestampInputs}}, Timestamp{{/hasTimestampInputs}} } from \\\"{{{packageName}}}\\\";\\n\\n{{#hasAttachmentUpload}}\\nconst attachment: Attachment = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\nconst result = await client.ontology.bulkActions.{{actionApiName}}(\\n [\\n {{^hasParameters}}{},{}{{/hasParameters}}{{#hasParameters}}{\\n {{#actionParameterSampleValuesV1}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV1}}\\n },\\n {\\n {{#actionParameterSampleValuesV1}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV1}}\\n },{{/hasParameters}}\\n ],\\n {\\n returnEdits: ReturnEditsMode.NONE,\\n }\\n);\",\n \"computedVariables\": [\"actionParameterSampleValuesV1\"]\n }],\n \"uploadAttachment\": [{\n \"template\": \"import { type Result, isOk, Attachment, type AttachmentsError } from \\\"{{{packageName}}}\\\";\\n\\nasync function uploadMyFile() {\\n const file = await fetch(\\\"file.json\\\");\\n const blob = await file.blob();\\n return client.ontology.attachments.upload(\\\"myFile\\\", blob);\\n}\\n\\nconst result: Result<Attachment, AttachmentsError> = await uploadMyFile();\\n\\nif (isOk(result)) {\\n const attachment = result.value;\\n console.log(attachment);\\n} else {\\n console.error(result.error.errorType);\\n}\"\n }],\n \"executeFunction\": [{\n \"template\": \"{{#needsImports}}\\nimport { {{#hasAttachmentImports}}Attachment{{#hasDateInputs}},{{/hasDateInputs}}{{^hasDateInputs}}{{#hasTimestampInputs}},{{/hasTimestampInputs}}{{/hasDateInputs}}{{/hasAttachmentImports}}{{#hasDateInputs}}LocalDate{{#hasTimestampInputs}}, {{/hasTimestampInputs}}{{/hasDateInputs}}{{#hasTimestampInputs}}Timestamp{{/hasTimestampInputs}} } from \\\"{{{packageName}}}\\\";\\n\\n{{/needsImports}}\\n{{#hasAttachmentUpload}}\\nconst attachment: Attachment = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\nconst result = await client.ontology.queries.{{funcApiName}}({{{functionInputValuesV1}}});\",\n \"computedVariables\": [\"functionInputValuesV1\"]\n }],\n \"stringStartsWithTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.startsWith(\\\"foo\\\"));\"\n }],\n \"containsAllTermsInOrderTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.containsAllTermsInOrder(\\\"foo bar\\\"));\"\n }],\n \"containsAnyTermTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.containsAnyTerm(\\\"foo bar\\\"));\"\n }],\n \"containsAllTermsTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.containsAllTerms(\\\"foo bar\\\"));\"\n }],\n \"equalityTemplate\": [{\n \"template\": \"{{#isDateProperty}}\\nimport { LocalDate } from \\\"{{{packageName}}}\\\";\\n\\n{{/isDateProperty}}\\n{{#isTimestampProperty}}\\nimport { Timestamp } from \\\"{{{packageName}}}\\\";\\n\\n{{/isTimestampProperty}}\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.eq({{{propertyValueV1}}}));\",\n \"computedVariables\": [\"propertyValueV1\"]\n }],\n \"inFilterTemplate\": [{\n \"template\": \"// Not supported\"\n }],\n \"nullTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.isNull());\"\n }],\n \"rangeTemplate\": [{\n \"template\": \"{{#isDateProperty}}\\nimport { LocalDate } from \\\"{{{packageName}}}\\\";\\n\\n{{/isDateProperty}}\\n{{#isTimestampProperty}}\\nimport { Timestamp } from \\\"{{{packageName}}}\\\";\\n\\n{{/isTimestampProperty}}\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.{{operation}}({{{propertyValueV1}}}));\",\n \"computedVariables\": [\"propertyValueV1\"]\n }],\n \"withinDistanceTemplate\": [{\n \"template\": \"import { GeoPoint } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.within{{distanceUnitText}}(\\n // New York City\\n GeoPoint.fromCoordinates({ latitude: 40.7128, longitude: -74.0060 }),\\n 100.0,\\n ));\"\n }],\n \"withinBoundingBoxTemplate\": [{\n \"template\": \"import { GeoPoint } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.withinBoundingBox({\\n topLeft: GeoPoint.fromCoordinates({ latitude: 40.7128, longitude: -74.0060 }),\\n bottomRight: GeoPoint.fromCoordinates({ latitude: 25.123, longitude: 80.4231 }),\\n });\"\n }],\n \"withinPolygonTemplate\": [{\n \"template\": \"import { Polygon } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.withinPolygon(Polygon.fromGeoJson({\\n type: \\\"Polygon\\\",\\n coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]],\\n }));\"\n }],\n \"intersectsPolygonTemplate\": [{\n \"template\": \"import { Polygon } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.{{intersects}}Polygon(Polygon.fromGeoJson({\\n type: \\\"Polygon\\\",\\n coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]],\\n }));\"\n }],\n \"intersectsBboxTemplate\": [{\n \"template\": \"import { GeoPoint } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.{{intersects}}BoundingBox({\\n topLeft: GeoPoint.fromCoordinates({ latitude: 40.7128, longitude: -74.0060 }),\\n bottomRight: GeoPoint.fromCoordinates({ latitude: 25.123, longitude: 80.4231 }),\\n });\"\n }],\n \"notTemplate\": [{\n \"template\": \"import { Op } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => Op.not(query.{{primaryKeyPropertyV1.apiName}}.isNull()));\",\n \"computedVariables\": [\"primaryKeyPropertyV1\"]\n }],\n \"andTemplate\": [{\n \"template\": \"import { Op } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => Op.and(\\n Op.not(query.{{primaryKeyPropertyV1.apiName}}.isNull()),\\n query.{{primaryKeyPropertyV1.apiName}}.eq(\\\"primaryKey\\\"),\\n ));\",\n \"computedVariables\": [\"primaryKeyPropertyV1\"]\n }],\n \"orTemplate\": [{\n \"template\": \"import { Op } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => Op.or(\\n query.{{primaryKeyPropertyV1.apiName}}.isNull(),\\n query.{{primaryKeyPropertyV1.apiName}}.eq(\\\"primaryKey\\\"),\\n ));\",\n \"computedVariables\": [\"primaryKeyPropertyV1\"]\n }],\n \"loadTimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.points.all();\\n}\"\n }],\n \"loadRelativeTimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\n// Only supports ranges in the past\\nfunction getRelativeTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.from{{timeUnitValue}}Ago(1).all();\\n}\"\n }],\n \"loadAbsoluteTimeSeriesPointsSnippet\": [{\n \"template\": \"import { Timestamp } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getRelativeTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.range({\\n startTime: Timestamp.fromISOString(\\\"2022-08-13T12:34:56Z\\\"),\\n endTime: Timestamp.fromISOString(\\\"2022-08-14T12:34:56Z\\\"),\\n });\\n}\"\n }],\n \"loadTimeSeriesFirstPointSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getFirstPoint();\\n}\"\n }],\n \"loadTimeSeriesLastPointSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getLastPoint();\\n}\"\n }],\n \"loadObjectMetadataSnippet\": [{\n \"template\": \"// Not supported.\"\n }],\n \"subscribeToObjectSetInstructions\": [{\n \"template\": \"// Subscribing to object sets is only supported in 2.x versions of the SDK.\"\n }]\n }\n },\n \"1.1.0\": {\n \"snippets\": {\n \"loadSingleObjectGuide\": [{\n \"template\": \"import { type GetObjectError, isOk, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst result: Result<{{objectType}}, GetObjectError> = await client.ontology.objects.{{objectType}}.fetchOneWithErrors(\\\"primaryKey\\\");\\nif (isOk(result)) {\\n const object: {{objectType}} = result.value;\\n} else {\\n console.error(result.error.errorType);\\n}\\n// You can also fetch a single object without the Result wrapper\\ntry {\\n const object: {{objectType}} = await client.ontology.objects.{{objectType}}.fetchOne(\\\"primaryKey\\\");\\n}\\ncatch(e) {\\n console.error(e);\\n}\"\n }],\n \"loadObjectPageGuide\": [{\n \"template\": \"import { isOk, type LoadObjectSetError, Page, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst firstPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}.fetchPageWithErrors({ pageSize: 30 });\\n\\nif (isOk(firstPage)) {\\n const secondPage: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\\n .fetchPageWithErrors({ pageSize: 30, pageToken: firstPage.value.nextPageToken });\\n\\n const objects = isOk(secondPage) ? [...firstPage.value.data, ...secondPage.value.data] : firstPage.value.data;\\n const object = objects[0];\\n}\\n\\n// To fetch a page without a result wrapper, use fetchPage with a try/catch instead\\ntry {\\n const firstPage: Page<{{objectType}}> = await client.ontology.objects.{{objectType}}.fetchPage({ pageSize: 30 });\\n const secondPage: Page<{{objectType}}> = await client.ontology.objects.{{objectType}}\\n .fetchPage({ pageSize: 30, pageToken: firstPage.value.nextPageToken });\\n const objects = [...firstPage.data, ...secondPage.data];\\n const object = objects[0];\\n}\\ncatch (e) {\\n console.error(e);\\n}\"\n }],\n \"orderObjectsGuide\": [{\n \"template\": \"import { isOk, Page, type Result, type SearchObjectsError } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst page: Result<Page<{{objectType}}>, SearchObjectsError> = await client.ontology.objects.{{objectType}}\\n .orderBy(sortBy => sortBy.{{titleProperty}}.asc())\\n .fetchPageWithErrors({ pageSize: 30 });\\n\\nif (isOk(page)) {\\n const objects = page.value.data;\\n const object = objects[0];\\n}\"\n }],\n \"searchObjectsGuide\": [{\n \"template\": \"import { isOk, type LoadObjectSetError, Page, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst page: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\\n .where(query => query.{{titleProperty}}.isNull())\\n .fetchPageWithErrors({ pageSize: 30 });\\n\\nif (isOk(page)) {\\n const objects = page.value.data;\\n const object = objects[0];\\n}\"\n }],\n \"loadSingleObjectReference\": [{\n \"template\": \"import { type GetObjectError, type Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst response: Result<{{objectType}}, GetObjectError> = await client.ontology.objects.{{objectType}}.fetchOneWithErrors(\\\"primaryKey\\\");\\n\\n// You can also fetch a single object without the result wrapper\\nconst responseNoWrapper: {{objectType}} = await client.ontology.objects.{{objectType}}.fetchOne(\\\"primaryKey\\\");\\n\"\n }],\n \"loadObjectsReference\": [{\n \"template\": \"import type { LoadObjectSetError, Page, Result } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst response: Result<Page<{{objectType}}>, LoadObjectSetError> = await client.ontology.objects.{{objectType}}\\n .fetchPageWithErrors({ pageSize: 30 });\\n\\n// To fetch a page without a result wrapper, use fetchPage instead\\nconst responseNoErrorWrapper: Page<{{objectType}}> = await client.ontology.objects.{{objectType}}\\n .fetchPage({ pageSize: 30 });\"\n }],\n \"loadAllObjectsReference\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst objects: {{objectType}}[]= [];\\n\\nfor await(const obj of client.ontology.objects.{{objectType}}.asyncIter()) {\\n objects.push(obj);\\n}\\nconst object = objects.value[0];\"\n }],\n \"loadLinkedObjectReference\": [{\n \"template\": \"import type { GetLinkedObjectError, Result } from \\\"{{{packageName}}}\\\";\\nimport { {{sourceObjectType}}, {{linkedObjectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getLinked{{linkedObjectType}}(source: {{sourceObjectType}}, linkedObjectPrimaryKey: {{linkedPrimaryKeyPropertyV1.type}}): Result<{{linkedObjectType}}, GetLinkedObjectError>\\n{\\n return source.{{linkApiName}}.fetchOneWithErrors(linkedObjectPrimaryKey);\\n}\\n\\n// You can also get a linked object without the result wrapper\\nfunction getLinkedNoWrapper{{linkedObjectType}}(source: {{sourceObjectType}}, linkedObjectPrimaryKey: {{linkedPrimaryKeyPropertyV1.type}}): {{linkedObjectType}} {\\n return source.{{linkApiName}}.fetchOne(linkedObjectPrimaryKey);\\n}\",\n \"computedVariables\": [\"linkedPrimaryKeyPropertyV1\"]\n }],\n \"loadLinkedObjectsReference\": [{\n \"template\": \"import type { GetLinkedObjectError, Result } from \\\"{{{packageName}}}\\\";\\nimport { {{sourceObjectType}}, {{linkedObjectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getLinked{{linkedObjectType}}(source: {{sourceObjectType}}) {\\n {{#isLinkManySided}}\\n return source.{{linkApiName}}.fetchPageWithErrors({ pageSize: 30 });\\n {{/isLinkManySided}}\\n {{^isLinkManySided}}\\n return source.{{linkApiName}}.fetchOneWithErrors();\\n {{/isLinkManySided}}\\n}\"\n }],\n \"aggregationTemplate\": [{\n \"template\": \"import { Op } from \\\"{{{packageName}}}\\\";\\n\\nconst num{{objectType}} = await client.ontology.objects.{{objectType}}\\n .where(query => Op.not(query.{{property}}.isNull()))\\n .groupBy(property => property.{{property}}.exact())\\n .count()\\n .compute()\"\n }],\n \"countAggregationTemplate\": [{\n \"template\": \"const num{{objectType}} = await client.ontology.objects.{{objectType}}\\n .count()\\n .compute()\"\n }],\n \"approximateDistinctAggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nconst distinct{{objectType}} = await client.ontology.objects.{{objectType}}\\n .approximateDistinct(obj => obj.{{property}})\\n .compute()\\n\\n// This is equivalent to the above, but uses metricName as the metric name instead of the default \\\"distinctCount\\\"\\nconst distinct{{objectType}}CustomName = await client.ontology.objects.{{objectType}}\\n .aggregate(obj => ({\\n metricName: obj.{{property}}.approximateDistinct(),\\n }))\\n .compute()\"\n }],\n \"exactDistinctAggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nconst distinct{{objectType}} = await client.ontology.objects.{{objectType}}\\n .exactDistinct(obj => obj.{{property}})\\n .compute()\\n\\n// This is equivalent to the above, but uses metricName as the metric name instead of the default \\\"exactDistinctCount\\\"\\nconst distinct{{objectType}}CustomName = await client.ontology.objects.{{objectType}}\\n .aggregate(obj => ({\\n metricName: obj.{{property}}.exactDistinct(),\\n }))\\n .compute()\"\n }],\n \"numericAggregationTemplate\": [{\n \"template\": \"const {{operation}}{{objectType}} = await client.ontology.objects.{{objectType}}\\n .{{operation}}(obj => obj.{{property}})\\n .compute()\\n\\n// This is equivalent to the above, but uses \\\"metricName\\\" as the metric name instead of the default \\\"{{operation}}\\\"\\nconst {{operation}}{{objectType}}CustomName = await client.ontology.objects.{{objectType}}\\n .aggregate(obj => ({\\n metricName: obj.{{property}}.{{operation}}(),\\n }))\\n .compute()\"\n }],\n \"fixedWidthGroupByTemplate\": [{\n \"template\": \"const grouped{{objectType}} = await client.ontology.objects.{{objectType}}\\n .groupBy(obj => obj.{{property}}.fixedWidth(10))\\n .count()\\n .compute()\"\n }],\n \"durationGroupByTemplate\": [{\n \"template\": \"const grouped{{objectType}} = await client.ontology.objects.{{objectType}}\\n .groupBy(obj => obj.{{property}}.by{{duration}}({{#durationText}}{{arg}}{{/durationText}}))\\n .count()\\n .compute()\"\n }],\n \"exactGroupByTemplate\": [{\n \"template\": \"const grouped{{objectType}} = await client.ontology.objects.{{objectType}}\\n .groupBy(obj => obj.{{property}}.exact())\\n .count()\\n .compute()\"\n }],\n \"rangeGroupByTemplate\": [{\n \"template\": \"{{#isDateProperty}}\\nimport { LocalDate } from \\\"{{{packageName}}}\\\";\\n\\n{{/isDateProperty}}\\n{{#isTimestampProperty}}\\nimport { Timestamp } from \\\"{{{packageName}}}\\\";\\n\\n{{/isTimestampProperty}}\\nconst grouped{{objectType}} = await client.ontology.objects.{{objectType}}\\n .groupBy(obj => obj.{{property}}.ranges([{\\n startValue: {{propertyValueV1}},\\n endValue: {{propertyValueIncrementedV1}}\\n }]))\\n .count()\\n .compute()\",\n \"computedVariables\": [\"propertyValueV1\", \"propertyValueIncrementedV1\"]\n }],\n \"applyAction\": [{\n \"template\": \"import { ActionValidationResult, ActionExecutionMode, ReturnEditsMode{{#hasAttachmentImports}}, Attachment{{/hasAttachmentImports}}{{#hasDateInputs}}, LocalDate{{#hasTimestampInputs}}, {{/hasTimestampInputs}}{{/hasDateInputs}}{{#hasTimestampInputs}}, Timestamp{{/hasTimestampInputs}} } from \\\"{{{packageName}}}\\\";\\n\\n{{#hasAttachmentUpload}}\\nconst attachment: Attachment = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\nconst result = await client.ontology.actions.{{actionApiName}}({{^hasParameters}}{},{{/hasParameters}}{{#hasParameters}}{\\n {{#actionParameterSampleValuesV1}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV1}}\\n},{{/hasParameters}} {\\n mode: ActionExecutionMode.VALIDATE_AND_EXECUTE,\\n returnEdits: ReturnEditsMode.ALL,\\n }\\n);\\n// Check if http request was successful\\nif (!isOk(result)) {\\n throw result.error;\\n}\\n// Check if the validation was successful\\nconsole.log(result.value.validation);\\nif (result.value.validation.result === ActionValidationResult.VALID) {\\n // If ReturnEditsMode.ALL is used, new and updated objects edits will contain the primary key of the object\\n if (result.value.edits.type === \\\"edits\\\") {\\n console.log(result.value.edits);\\n }\\n}\",\n \"computedVariables\": [\"actionParameterSampleValuesV1\"]\n }],\n \"batchApplyAction\": [{\n \"template\": \"import { ActionExecutionMode, ReturnEditsMode{{#hasAttachmentImports}}, Attachment{{/hasAttachmentImports}}{{#hasDateInputs}}, LocalDate{{#hasTimestampInputs}}, {{/hasTimestampInputs}}{{/hasDateInputs}}{{#hasTimestampInputs}}, Timestamp{{/hasTimestampInputs}} } from \\\"{{{packageName}}}\\\";\\n\\n{{#hasAttachmentUpload}}\\nconst attachment: Attachment = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\nconst result = await client.ontology.batchActions.{{actionApiName}}(\\n [\\n {{^hasParameters}}{},{}{{/hasParameters}}{{#hasParameters}}{\\n {{#actionParameterSampleValuesV1}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV1}}\\n },\\n {\\n {{#actionParameterSampleValuesV1}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV1}}\\n },{{/hasParameters}}\\n ],\\n {\\n returnEdits: ReturnEditsMode.NONE,\\n }\\n);\",\n \"computedVariables\": [\"actionParameterSampleValuesV1\"]\n }],\n \"uploadAttachment\": [{\n \"template\": \"import { type Result, isOk, type Attachment, type AttachmentsError } from \\\"{{{packageName}}}\\\";\\n\\nasync function uploadMyFile() {\\n const file = await fetch(\\\"file.json\\\");\\n const blob = await file.blob();\\n return client.ontology.attachments.upload(\\\"myFile\\\", blob);\\n}\\n\\nconst result: Result<Attachment, AttachmentsError> = await uploadMyFile();\\n\\nif (isOk(result)) {\\n const attachment = result.value;\\n console.log(attachment);\\n} else {\\n console.error(result.error.errorType);\\n}\"\n }],\n \"executeFunction\": [{\n \"template\": \"{{#needsImports}}\\nimport { {{#hasAttachmentImports}}Attachment{{#hasDateInputs}},{{/hasDateInputs}}{{^hasDateInputs}}{{#hasTimestampInputs}},{{/hasTimestampInputs}}{{/hasDateInputs}}{{/hasAttachmentImports}}{{#hasDateInputs}}LocalDate{{#hasTimestampInputs}}, {{/hasTimestampInputs}}{{/hasDateInputs}}{{#hasTimestampInputs}}Timestamp{{/hasTimestampInputs}} } from \\\"{{{packageName}}}\\\";\\n\\n{{/needsImports}}\\n{{#hasAttachmentUpload}}\\nconst attachment: Attachment = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\nconst result = await client.ontology.queries.{{funcApiName}}({{{functionInputValuesV1}}});\",\n \"computedVariables\": [\"functionInputValuesV1\"]\n }],\n \"stringStartsWithTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.startsWith(\\\"foo\\\"));\"\n }],\n \"containsAllTermsInOrderTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.containsAllTermsInOrder(\\\"foo bar\\\"));\"\n }],\n \"containsAnyTermTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.containsAnyTerm(\\\"foo bar\\\"));\"\n }],\n \"containsAllTermsTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.containsAllTerms(\\\"foo bar\\\"));\"\n }],\n \"equalityTemplate\": [{\n \"template\": \"{{#isDateProperty}}\\nimport { LocalDate } from \\\"{{{packageName}}}\\\";\\n\\n{{/isDateProperty}}\\n{{#isTimestampProperty}}\\nimport { Timestamp } from \\\"{{{packageName}}}\\\";\\n\\n{{/isTimestampProperty}}\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.eq({{{propertyValueV1}}}));\",\n \"computedVariables\": [\"propertyValueV1\"]\n }],\n \"inFilterTemplate\": [{\n \"template\": \"// Not supported\"\n }],\n \"nullTemplate\": [{\n \"template\": \"const {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.isNull());\"\n }],\n \"rangeTemplate\": [{\n \"template\": \"{{#isDateProperty}}\\nimport { LocalDate } from \\\"{{{packageName}}}\\\";\\n\\n{{/isDateProperty}}\\n{{#isTimestampProperty}}\\nimport { Timestamp } from \\\"{{{packageName}}}\\\";\\n\\n{{/isTimestampProperty}}\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.{{operation}}({{{propertyValueV1}}}));\",\n \"computedVariables\": [\"propertyValueV1\"]\n }],\n \"withinDistanceTemplate\": [{\n \"template\": \"import { GeoPoint } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.within{{distanceUnitText}}(\\n // New York City\\n GeoPoint.fromCoordinates({ latitude: 40.7128, longitude: -74.0060 }),\\n 100.0,\\n ));\"\n }],\n \"withinBoundingBoxTemplate\": [{\n \"template\": \"import { GeoPoint } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.withinBoundingBox({\\n topLeft: GeoPoint.fromCoordinates({ latitude: 40.7128, longitude: -74.0060 }),\\n bottomRight: GeoPoint.fromCoordinates({ latitude: 25.123, longitude: 80.4231 }),\\n });\"\n }],\n \"withinPolygonTemplate\": [{\n \"template\": \"import { Polygon } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.withinPolygon(Polygon.fromGeoJson({\\n type: \\\"Polygon\\\",\\n coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]],\\n }));\"\n }],\n \"intersectsPolygonTemplate\": [{\n \"template\": \"import { Polygon } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.{{intersects}}Polygon(Polygon.fromGeoJson({\\n type: \\\"Polygon\\\",\\n coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]],\\n }));\"\n }],\n \"intersectsBboxTemplate\": [{\n \"template\": \"import { GeoPoint } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => query.{{property}}.{{intersects}}BoundingBox({\\n topLeft: GeoPoint.fromCoordinates({ latitude: 40.7128, longitude: -74.0060 }),\\n bottomRight: GeoPoint.fromCoordinates({ latitude: 25.123, longitude: 80.4231 }),\\n });\"\n }],\n \"notTemplate\": [{\n \"template\": \"import { Op } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => Op.not(query.{{primaryKeyPropertyV1.apiName}}.isNull()));\",\n \"computedVariables\": [\"primaryKeyPropertyV1\"]\n }],\n \"andTemplate\": [{\n \"template\": \"import { Op } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => Op.and(\\n Op.not(query.{{primaryKeyPropertyV1.apiName}}.isNull()),\\n query.{{primaryKeyPropertyV1.apiName}}.eq(\\\"primaryKey\\\"),\\n ));\",\n \"computedVariables\": [\"primaryKeyPropertyV1\"]\n }],\n \"orTemplate\": [{\n \"template\": \"import { Op } from \\\"{{{packageName}}}\\\";\\n\\nconst {{objectType}}ObjectSet = client.ontology.objects.{{objectType}}\\n .where(query => Op.or(\\n query.{{primaryKeyPropertyV1.apiName}}.isNull(),\\n query.{{primaryKeyPropertyV1.apiName}}.eq(\\\"primaryKey\\\"),\\n ));\",\n \"computedVariables\": [\"primaryKeyPropertyV1\"]\n }],\n \"loadTimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.points.all();\\n}\"\n }],\n \"loadRelativeTimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\n// Only supports ranges in the past\\nfunction getRelativeTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.from{{timeUnitValue}}Ago(1).all();\\n}\"\n }],\n \"loadAbsoluteTimeSeriesPointsSnippet\": [{\n \"template\": \"import { Timestamp } from \\\"{{{packageName}}}\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getRelativeTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.range({\\n startTime: Timestamp.fromISOString(\\\"2022-08-13T12:34:56Z\\\"),\\n endTime: Timestamp.fromISOString(\\\"2022-08-14T12:34:56Z\\\"),\\n });\\n}\"\n }],\n \"loadTimeSeriesFirstPointSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getFirstPoint();\\n}\"\n }],\n \"loadTimeSeriesLastPointSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getLastPoint();\\n}\"\n }],\n \"loadObjectMetadataSnippet\": [{\n \"template\": \"// Not supported.\"\n }],\n \"subscribeToObjectSetInstructions\": [{\n \"template\": \"// Subscribing to object sets is only supported in 2.x versions of the SDK.\"\n }]\n }\n },\n \"2.0.0\": {\n \"snippets\": {\n \"loadSingleObjectGuide\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { isOk, type Osdk, type Result } from \\\"@osdk/client\\\";\\n\\nconst result: Result<Osdk.Instance<{{objectType}}>> = await client({{objectType}}).fetchOneWithErrors(\\\"<primaryKey>\\\");\\nif (isOk(result)) {\\n const object: Osdk.Instance<{{objectType}}> = result.value;\\n} else {\\n console.error(result.error.message);\\n}\\n// You can also fetch a single object without the Result wrapper\\ntry {\\n const object: Osdk.Instance<{{objectType}}> = await client({{objectType}}).fetchOne(\\\"<primaryKey>\\\");\\n}\\ncatch(e) {\\n console.error(e);\\n}\"\n }],\n \"loadObjectPageGuide\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { isOk, type Osdk, type PageResult, type Result } from \\\"@osdk/client\\\";\\n\\nconst firstPage: Result<PageResult<Osdk.Instance<{{objectType}}>>>\\n = await client({{objectType}}).fetchPageWithErrors({ $pageSize: 30 });\\n\\nif (isOk(firstPage)) {\\n const secondPage: Result<PageResult<Osdk.Instance<{{objectType}}, never, \\\"{{titleProperty}}\\\">>>\\n // You can also down select properties to only get the properties you need from the object\\n = await client({{objectType}}).fetchPageWithErrors({ $select: [\\\"{{titleProperty}}\\\"], $pageSize: 30, $nextPageToken: firstPage.value.nextPageToken });\\n\\n const objects = isOk(secondPage) ? [...firstPage.value.data, ...secondPage.value.data] : firstPage.value.data;\\n const object = objects[0];\\n}\\n\\n // If you want to get rids, you need to add a flag to specifically request for it. Note how the return type now includes $rid rather than never\\nconst secondPageWithRids: Result<PageResult<Osdk.Instance<{{objectType}}, \\\"$rid\\\", \\\"{{titleProperty}}\\\">>>\\n = await client({{objectType}}).fetchPageWithErrors({ $select: [\\\"{{titleProperty}}\\\"], $includeRid:true, $pageSize: 30, $nextPageToken: firstPage.value.nextPageToken });\\n\\n// To fetch a page without a result wrapper, use fetchPage with a try/catch instead\\ntry {\\n const firstPage: PageResult<Osdk.Instance<{{objectType}}>>\\n = await client({{objectType}}).fetchPage({ $pageSize: 30 });\\n const secondPage: PageResult<Osdk.Instance<{{objectType}}>>\\n = await client({{objectType}}).fetchPage({ $pageSize: 30, $nextPageToken: firstPage.nextPageToken });\\n const objects = [...firstPage.data, ...secondPage.data];\\n const object = objects[0];\\n}\\ncatch (e) {\\n console.error(e);\\n}\"\n }],\n \"orderObjectsGuide\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { isOk, type Osdk, type PageResult, type Result } from \\\"@osdk/client\\\";\\n\\nconst page: Result<PageResult<Osdk.Instance<{{objectType}}>>> = await client({{objectType}})\\n .fetchPageWithErrors({\\n $orderBy: {\\\"{{titleProperty}}\\\": \\\"asc\\\"},\\n $pageSize: 30\\n });\\n\\nif (isOk(page)) {\\n const objects = page.value.data;\\n const object = objects[0];\\n}\"\n }],\n \"searchObjectsGuide\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { isOk, type Osdk, type PageResult, type Result } from \\\"@osdk/client\\\";\\n\\nconst page: Result<PageResult<Osdk.Instance<{{objectType}}>>> = await client({{objectType}})\\n .where({\\n {{titleProperty}}: {$isNull: true}\\n })\\n .fetchPageWithErrors({\\n $pageSize: 30\\n });\\n\\nif (isOk(page)) {\\n const objects = page.value.data;\\n const object = objects[0];\\n}\"\n }],\n \"loadSingleObjectReference\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport type { Osdk, Result } from \\\"@osdk/client\\\";\\n\\nconst response: Result<Osdk.Instance<{{objectType}}>> = await client({{objectType}}).fetchOneWithErrors(\\\"<primaryKey>\\\");\\n\\n// You can also fetch a single object without the Result wrapper\\n\\nconst responseNoErrorWrapper: Osdk.Instance<{{objectType}}> = await client({{objectType}}).fetchOne(\\\"<primaryKey>\\\");\\n\\n\"\n }],\n \"loadObjectsReference\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport type { Osdk, PageResult, Result } from \\\"@osdk/client\\\";\\n\\nconst response: Result<PageResult<Osdk.Instance<{{objectType}}>>>\\n = await client({{objectType}}).fetchPageWithErrors({ $pageSize: 30 });\\n\\n// To fetch a page without a result wrapper, use fetchPage instead\\nconst responseNoErrorWrapper: PageResult<Osdk.Instance<{{objectType}}>>\\n = await client({{objectType}}).fetchPage({ $pageSize: 30 });\\n\"\n }],\n \"loadAllObjectsReference\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport type { Osdk } from \\\"@osdk/client\\\";\\n\\nconst objects: Osdk.Instance<{{objectType}}>[]= [];\\n\\nfor await(const obj of client({{objectType}}).asyncIter()) {\\n objects.push(obj);\\n}\\nconst object = objects[0];\"\n }],\n \"loadLinkedObjectReference\": [{\n \"template\": \"import { {{sourceObjectType}}, {{linkedObjectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { type Osdk, type Result } from \\\"@osdk/client\\\";\\n\\nfunction getLinked{{linkedObjectType}}(source: Osdk.Instance<{{sourceObjectType}}>, linkedObjectPrimaryKey: {{linkedPrimaryKeyPropertyV2.type}}): Result<Osdk.Instance<{{linkedObjectType}}>>\\n{\\n return source.$link.{{linkApiName}}.fetchOneWithErrors(linkedObjectPrimaryKey);\\n}\\n\\n// You can also get a linked object without the result wrapper\\nfunction getLinkedNoWrapper{{linkedObjectType}}(source: Osdk.Instance<{{sourceObjectType}}>, linkedObjectPrimaryKey: {{linkedPrimaryKeyPropertyV2.type}}): Osdk.Instance<{{linkedObjectType}}> {\\n return source.$link.{{linkApiName}}.fetchOne(linkedObjectPrimaryKey);\\n}\",\n \"computedVariables\": [\"linkedPrimaryKeyPropertyV2\"]\n }],\n \"loadLinkedObjectsReference\": [{\n \"template\": \"import { {{linkedObjectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction getLinked{{linkedObjectType}}(source: Osdk.Instance<{{sourceObjectType}}>) {\\n {{#isLinkManySided}}\\n return source.$link.{{linkApiName}}.fetchPageWithErrors({ $pageSize: 30 });\\n {{/isLinkManySided}}\\n {{^isLinkManySided}}\\n return source.$link.{{linkApiName}}.fetchOneWithErrors();\\n {{/isLinkManySided}}\\n}\"\n }],\n \"aggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst num{{objectType}} = await client({{objectType}})\\n .where({{property}}: { $isNull : false })\\n .aggregate({\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { name: \\\"exact\\\" },\\n });\"\n }],\n \"countAggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst num{{objectType}} = await client({{objectType}})\\n .aggregate({\\n $select: {$count: \\\"unordered\\\"},\\n });\"\n }],\n \"approximateDistinctAggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst distinct{{objectType}} = await client({{objectType}})\\n .aggregate({\\n $select: { \\\"{{property}}:approximateDistinct\\\" : \\\"unordered\\\" },\\n });\"\n }],\n \"exactDistinctAggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst distinct{{objectType}} = await client({{objectType}})\\n .aggregate({\\n $select: { \\\"{{property}}:exactDistinct\\\" : \\\"unordered\\\" },\\n });\"\n }],\n \"numericAggregationTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{operation}}{{objectType}} = await client({{objectType}})\\n .aggregation({\\n $select: { \\\"{{property}}:{{operation}}\\\" : \\\"unordered\\\" }\\n });\"\n }],\n \"fixedWidthGroupByTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst grouped{{objectType}} = await client({{objectType}})\\n .aggregate({\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}} : { $fixedWidth: 10 } }\\n });\"\n }],\n \"durationGroupByTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst grouped{{objectType}} = await client({{objectType}})\\n .aggregate({\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}} : $duration: [ {{#durationText}}{{arg}}{{/durationText}}, \\\"{{#durationText}}{{unit}}{{/durationText}}\\\"] }\\n })\"\n }],\n \"exactGroupByTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst grouped{{objectType}} = await client({{objectType}})\\n .aggregate({\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}} : \\\"exact\\\" }\\n })\"\n }],\n \"rangeGroupByTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst grouped{{objectType}} = await client({{objectType}})\\n .aggregate({\\n $select: { $count: \\\"unordered\\\" },\\n $groupBy: { {{property}} : { $ranges: [[{{{propertyValueV2}}}, {{{propertyValueIncrementedV2}}} ]]} }\\n });\",\n \"computedVariables\": [\"propertyValueV2\", \"propertyValueIncrementedV2\"]\n }],\n \"applyAction\": [{\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n{{#hasAttachmentImports}}import type { AttachmentUpload } from \\\"@osdk/api\\\";{{/hasAttachmentImports}}{{#hasMediaParameter}}import type { MediaReference } from \\\"@osdk/api\\\";{{/hasMediaParameter}}\\n\\n\\n{{#hasAttachmentUpload}}\\nconst attachment: AttachmentUpload = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\n{{#hasMediaParameter}}\\nconst mediaReference: MediaReference = uploadMedia();\\n{{/hasMediaParameter}}\\nconst result = await client({{actionApiName}}).applyAction(\\n{{^hasParameters}}{},\\n{{/hasParameters}}{{#hasParameters}}\\n {\\n {{#actionParameterSampleValuesV2}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV2}}\\n },{{/hasParameters}}\\n {\\n $returnEdits: true,\\n }\\n);\\n\\nif (result.type === \\\"edits\\\") {\\n // for new objects and updated objects edits will contain the primary key of the object\\n const updatedObject = result.editedObjectTypes[0];\\n console.log(\\\"Updated object\\\", updatedObject);\\n}\",\n \"computedVariables\": [\"actionParameterSampleValuesV2\"]\n }],\n \"batchApplyAction\": [{\n \"template\": \"import { {{actionApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n{{#hasAttachmentImports}}\\nimport type { AttachmentUpload } from \\\"@osdk/api\\\";\\n{{/hasAttachmentImports}}{{#hasMediaParameter}}import type { MediaReference } from \\\"@osdk/api\\\";{{/hasMediaParameter}}\\n\\n\\n{{#hasAttachmentUpload}}\\nconst attachment: AttachmentUpload = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\n{{#hasMediaParameter}}\\nconst mediaReference: MediaReference = uploadMedia();\\n{{/hasMediaParameter}}\\nconst result = await client({{actionApiName}}).batchApplyAction(\\n [\\n {{^hasParameters}}{},{}{{/hasParameters}}{{#hasParameters}}\\n {\\n {{#actionParameterSampleValuesV2}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV2}}\\n },\\n {\\n {{#actionParameterSampleValuesV2}}\\n \\\"{{key}}\\\": {{{value}}}{{^last}}, {{/last}}\\n {{/actionParameterSampleValuesV2}}\\n },{{/hasParameters}}\\n ],\\n {\\n $returnEdits: false,\\n }\\n);\",\n \"computedVariables\": [\"actionParameterSampleValuesV2\"]\n }],\n \"uploadAttachment\": [{\n \"template\": \"// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { type Result, isOk } from \\\"@osdk/client\\\";\\nimport type { AttachmentUpload } from \\\"@osdk/api\\\";\\n\\n// To upload an attachment with 2.0, it has to be linked to an action call\\n\\nasync function uploadMyFile() {\\n const file = await fetch(\\\"file.json\\\");\\n const blob = await file.blob();\\n return createAttachmentUpload(blob, \\\"myFile\\\");\\n}\\n\\nconst myAttachmentUpload: AttachmentUpload = await uploadMyFile();\\n\\nconst actionResult = client(attachmentUploadingAction).applyAction({ attachment: myAttachmentUpload });\\n\"\n }],\n \"castInterfaceToObjectReference\": [{\n \"template\": \"import { {{objectTypeApiName}}, {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { isOk, type Osdk } from \\\"@osdk/client\\\";\\n\\nconst page = await client({{interfaceApiName}}).fetchPageWithErrors();\\n\\nif (isOk(page)) {\\n const interfaces = page.value.data;\\n const {{interfaceApiNameCamelCase}}: Osdk<{{interfaceApiName}}> = interfaces[0];\\n\\n // Cast from interface to object type\\n const {{objectTypeApiNameCamelCase}}: Osdk<{{objectTypeApiName}}> = {{interfaceApiNameCamelCase}}.$as({{objectTypeApiName}});\\n // Or from object type back to interface\\n const {{interfaceApiNameCamelCase}}2: Osdk<{{interfaceApiName}}> = {{objectTypeApiNameCamelCase}}.$as({{interfaceApiName}});\\n}\"\n }],\n \"executeFunction\": [{\n \"template\": \"{{#needsImports}}\\nimport { {{funcApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n{{#hasAttachmentImports}}import type { AttachmentUpload } from \\\"@osdk/api\\\";{{/hasAttachmentImports}}\\n\\n{{/needsImports}}\\n{{#hasAttachmentUpload}}\\nconst attachment: AttachmentUpload = uploadMyFile();\\n{{/hasAttachmentUpload}}\\n{{#attachmentProperty}}\\nconst attachment: Attachment = {{{attachmentProperty}}};\\n{{/attachmentProperty}}\\nconst result = await client({{funcApiName}}).executeFunction({{{functionInputValuesV2}}});\",\n \"computedVariables\": [\"functionInputValuesV2\"]\n }],\n \"stringStartsWithTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $startsWith: \\\"foo\\\" }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}} : { $startsWith: \\\"foo\\\" }\\n {{/structSubPropertyApiName}}\\n })\"\n }],\n \"containsAllTermsInOrderTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $containsAllTermsInOrder: \\\"foo bar\\\" }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}} : { $containsAllTermsInOrder: \\\"foo bar\\\" }\\n {{/structSubPropertyApiName}}\\n })\"\n }],\n \"containsAnyTermTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $containsAnyTerm: \\\"foo bar\\\" }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}} : { $containsAnyTerm: \\\"foo bar\\\" }\\n {{/structSubPropertyApiName}}\\n })\"\n }],\n \"containsAllTermsTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $containsAllTerms: \\\"foo bar\\\" }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}} : { $containsAllTerms: \\\"foo bar\\\" }\\n {{/structSubPropertyApiName}}\\n })\"\n }],\n \"equalityTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $eq: {{{propertyValueV2}}} }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}}: { $eq: {{{propertyValueV2}}} }\\n {{/structSubPropertyApiName}}\\n });\",\n \"computedVariables\": [\"propertyValueV2\"]\n }],\n \"inFilterTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $in: [{{{propertyValueV2}}}] }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}}: { $in: [{{{propertyValueV2}}}] }\\n {{/structSubPropertyApiName}}\\n });\",\n \"computedVariables\": [\"propertyValueV2\"]\n }],\n \"nullTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $isNull: true }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}}: { $isNull: true }\\n {{/structSubPropertyApiName}}\\n });\"\n }],\n \"rangeTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { ${{operation}}: {{{propertyValueV2}}} }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}}: { ${{operation}}: {{{propertyValueV2}}} }\\n {{/structSubPropertyApiName}}\\n });\",\n \"computedVariables\": [\"propertyValueV2\"]\n }],\n \"withinDistanceTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $within: { $distance: [100, \\\"{{distanceUnit}}\\\"], $of: [-74.0060, 40.7128]} }}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}}: { $within: { $distance: [100, \\\"{{distanceUnit}}\\\"], $of: [-74.0060, 40.7128]}}\\n {{/structSubPropertyApiName}}\\n })\"\n }],\n \"withinBoundingBoxTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $within: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}}: { $within: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}\\n {{/structSubPropertyApiName}}\\n\\n });\"\n }],\n \"withinPolygonTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $within: { type: \\\"Polygon\\\", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]]}}}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}}: { $within: { type: \\\"Polygon\\\", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]]}}\\n {{/structSubPropertyApiName}}\\n });\"\n }],\n \"intersectsPolygonTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}}: { $intersects: { type: \\\"Polygon\\\", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]}}}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}}: { $intersects: { type: \\\"Polygon\\\", coordinates: [[[10.0, 40.0], [20.0, 50.0], [20.0, 30.0], [10.0, 40.0]]}}\\n {{/structSubPropertyApiName}}\\n });\"\n }],\n \"intersectsBboxTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({\\n {{#structSubPropertyApiName}}\\n {{property}}: { {{structSubPropertyApiName}} : { $intersects: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}}\\n {{/structSubPropertyApiName}}\\n {{^structSubPropertyApiName}}\\n {{property}} : { $intersects: { $bbox: [-74.0060, 25.123, 80.4231, 40.7128]}}\\n {{/structSubPropertyApiName}}\\n });\"\n }],\n \"notTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({ $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true }}});\",\n \"computedVariables\": [\"primaryKeyPropertyV2\"]\n }],\n \"andTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({ $and:[\\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true }}},\\n { {{primaryKeyPropertyV2.apiName}}: { $eq: \\\"<primaryKey>\\\" }}\\n ]});\",\n \"computedVariables\": [\"primaryKeyPropertyV2\"]\n }],\n \"orTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst {{objectType}}ObjectSet = client({{objectType}})\\n .where({ $or:[\\n { $not: { {{primaryKeyPropertyV2.apiName}}: { $isNull: true }}},\\n { {{primaryKeyPropertyV2.apiName}}: { $eq: \\\"<primaryKey>\\\" }}\\n ]});\",\n \"computedVariables\": [\"primaryKeyPropertyV2\"]\n }],\n \"containsTemplate\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst filteredObjects = client({{objectType}})\\n .where({\\n {{property}} : { $contains: {{{arrayElementValue}}} }\\n })\",\n \"computedVariables\": [\"arrayElementValue\"]\n }],\n \"loadInterfacesReference\": [{\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { type Osdk, type PageResult, type Result } from \\\"@osdk/client\\\";\\n\\nconst response: Result<PageResult<Osdk<{{interfaceApiName}}>>>\\n = await client({{interfaceApiName}}).fetchPageWithErrors({ $pageSize: 30 });\\n\\n// To fetch a page without a result wrapper, use fetchPage instead\\nconst responseNoErrorWrapper: PageResult<Osdk<{{interfaceApiName}}>>\\n = await client({{interfaceApiName}}).fetchPage({ $pageSize: 30 });\"\n }],\n \"loadAllInterfacesReference\": [{\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport type { Osdk } from \\\"@osdk/client\\\";\\n\\nconst interfaces: Osdk<{{interfaceApiName}}>[] = [];\\n\\nfor await(const int of client({{interfaceApiName}}).asyncIter()) {\\n interfaces.push(int);\\n}\\nconst interface1 = interfaces[0];\"\n }],\n \"loadOrderedInterfacesReference\": [{\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { isOk, type Osdk, type PageResult, type Result } from \\\"@osdk/client\\\";\\n\\nconst page: Result<PageResult<Osdk<{{interfaceApiName}}>>> = await client({{interfaceApiName}})\\n .fetchPageWithErrors({\\n $orderBy: {\\\"someProperty\\\": \\\"asc\\\"},\\n $pageSize: 30\\n });\\n\\nif (isOk(page)) {\\n const interfaces = page.value.data;\\n const interface1 = interfaces[0];\\n}\"\n }],\n \"searchInterfacesReference\": [{\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { isOk, type Osdk, type PageResult, type Result } from \\\"@osdk/client\\\";\\n\\nconst page: Result<PageResult<Osdk<{{interfaceApiName}}>>> = await client({{interfaceApiName}})\\n .where({\\n $and:[\\n { $not: { someProperty: { $isNull: true }}},\\n { someProperty: { $eq: \\\"foo\\\" }}\\n ]\\n })\\n .fetchPageWithErrors({\\n $pageSize: 30\\n });\\n\\nif (isOk(page)) {\\n const interfaces = page.value.data;\\n const interface1 = interfaces[0];\\n}\"\n }],\n \"loadTimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getAllPoints();\\n}\"\n }],\n \"loadRelativeTimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\n// Only supports ranges in the past\\nfunction getRelativeTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getAllPoints({\\n $before: 1,\\n $unit: \\\"{{timeUnit}}\\\",\\n })\\n}\"\n }],\n \"loadAbsoluteTimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction getAbsoluteTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getAllPoints({\\n $startTime: \\\"2022-08-13T12:34:56Z\\\",\\n $endTime: \\\"2022-08-14T12:34:56Z\\\",\\n });\\n}\"\n }],\n \"loadTimeSeriesFirstPointSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction getFirstTimeSeriesPoint(obj: {{objectType}}) {\\n return obj.{{property}}.getFirstPoint();\\n}\"\n }],\n \"loadTimeSeriesLastPointSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction getLastTimeSeriesPoint(obj: {{objectType}}) {\\n return obj.{{property}}.getLastPoint();\\n}\"\n }],\n \"loadGeotimeSeriesPointsSnippet\": [{\n \"template\": \"// Upgrade to 2.1 for official support\"\n }],\n \"loadRelativeGeotimeSeriesPointsSnippet\": [{\n \"template\": \"// Upgrade to 2.1 for official support\"\n }],\n \"loadAbsoluteGeotimeSeriesPointsSnippet\": [{\n \"template\": \"// Upgrade to 2.1 for official support\"\n }],\n \"loadGeotimeSeriesLastPointSnippet\": [{\n \"template\": \"// Upgrade to 2.1 for official support\"\n }],\n \"loadObjectMetadataSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst objectTypeMetadata = await client.fetchMetadata({{objectType}});\\n\\nif (objectTypeMetadata.icon.type === \\\"blueprint\\\") {\\n const blueprintIconName = objectTypeMetadata.icon.name;\\n}\\nconst currentVisibility = objectTypeMetadata.visibility;\\nconst currentDescription = objectTypeMetadata.description;\"\n }],\n \"loadInterfaceMetadataSnippet\": [{\n \"template\": \"import { {{interfaceApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst interfaceTypeMetadata = await client.fetchMetadata({{interfaceApiName}});\\n\\nconst implementingObjectTypes = interfaceTypeMetadata.implementedBy;\\nconst interfaceRid = interfaceTypeMetadata.rid;\"\n }],\n \"subscribeToObjectSetInstructions\": [{\n \"template\": \"// Upgrade to 2.1 for official support\"\n }],\n \"uploadMedia\": [{\n \"template\": \"// Upgrade to 2.1 for official support\"\n }],\n \"readMedia\": [{\n \"template\": \"// Upgrade to 2.1 for official support\"\n }],\n \"derivedPropertyBaseExample\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"fooLink\\\").pivotTo(\\\"barLink\\\").selectProperty(\\\"foo\\\")\\n })\\n .where({\\n \\\"newPropertyName\\\": { $gt: 10 }\\n })\\n .aggregate({\\n $select: { \\\"newPropertyName:max\\\": \\\"unordered\\\" }\\n });\"\n }],\n \"derivedPropertyApproximateDistinctAggregation\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkName}}\\\").aggregate(\\\"{{property}}:approximateDistinct\\\")\\n })\"\n }],\n \"derivedPropertyExactDistinctAggregation\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkName}}\\\").aggregate(\\\"{{property}}:exactDistinct\\\")\\n })\"\n }],\n \"derivedPropertyCollectToListAggregation\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkName}}\\\").aggregate(\\\"{{property}}:collectToList\\\", 75)\\n })\"\n }],\n \"derivedPropertyCollectToSetAggregation\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkName}}\\\").aggregate(\\\"{{property}}:collectToSet\\\", 75)\\n })\"\n }],\n \"derivedPropertyCountAggregation\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkName}}\\\").aggregate(\\\"$count\\\")\\n })\"\n }],\n \"derivedPropertySelectPropertyAggregation\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkName}}\\\").selectProperty(\\\"{{property}}\\\")\\n })\"\n }],\n \"derivedPropertyApproximatePercentileAggregation\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkName}}\\\").aggregate(\\\"{{property}}:approximatePercentile\\\", 0.5)\\n })\"\n }],\n \"derivedPropertyNumericAggregation\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\nconst sum{{objectType}} = await client({{objectType}})\\n .withProperties({\\n \\\"newPropertyName\\\": (baseObjectSet) =>\\n baseObjectSet.pivotTo(\\\"{{linkName}}\\\").aggregate(\\\"{{property}}:{{operation}}\\\")\\n })\"\n }],\n \"objectSetOperationsGuide\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\"}})\\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\"}})\\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\"}})\\n\\n// Object set operations can be chained. e.g. To find all objects in objectSetA \\n// that are present in objectSetB but do not exist in objectSetC:\\nconst result = objectSetA\\n .intersect(objectSetB)\\n .subtract(objectSetC);\"\n }],\n \"objectSetOperationsUnion\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\"}})\\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\"}})\\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\"}})\\n\\n// Combine objectSetA, objectSetB and objectSetC\\nconst result = objectSetA\\n .union(objectSetB)\\n .union(objectSetC); // alternatively: objectSetA.union(objectSetB, objectSetC)\"\n }],\n \"objectSetOperationsSubtract\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\"}})\\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\"}})\\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\"}})\\n\\n\\n// Return objects in objectSetA that are not present in either objectSetB or objectSetC\\nconst result = objectSetA\\n .subtract(objectSetB)\\n .subtract(objectSetC); // alternatively: objectSetA.subtract(objectSetB, objectSetC)\"\n }],\n \"objectSetOperationsIntersect\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}/ontology/objects\\\";\\n\\nconst objectSetA = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"a\\\"}})\\nconst objectSetB = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"b\\\"}})\\nconst objectSetC = client({{objectType}}).where({ {{titleProperty}}: { $containsAnyTerm: \\\"c\\\"}})\\n\\n\\n// Return all objects common to objectSetA, objectSetB and objectSetC\\nconst result = objectSetA\\n .intersect(objectSetB)\\n .intersect(objectSetC); // alternatively: objectSetA.intersect(objectSetB, objectSetC)\"\n }],\n \"searchAround\": [{\n \"template\": \"import { {{sourceObjectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\n// Object set containing objects a, b and c\\nconst objects = client({{sourceObjectType}})\\n .where({ {{rawLinkedPrimaryKeyProperty.apiName}}: { $in: [\\\"a\\\", \\\"b\\\", \\\"c\\\"]}});\\n\\n// Traverse the selected link type to find all objects of type\\n// {{linkedObjectType}} linked to objects a, b and c\\nconst linkedObjects = await objects.pivotTo(\\\"{{linkApiName}}\\\");\"\n }]\n }\n },\n \"2.1.0\": {\n \"snippets\": {\n \"loadGeotimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction getAllTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getAllValues();\\n}\"\n }],\n \"loadRelativeGeotimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\n// Only supports ranges in the past\\nfunction getRelativeTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getAllValues({\\n $before: 1,\\n $unit: \\\"{{timeUnit}}\\\",\\n })\\n}\"\n }],\n \"loadAbsoluteGeotimeSeriesPointsSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction getAbsoluteTimeSeriesPoints(obj: {{objectType}}) {\\n return obj.{{property}}.getAllValues({\\n $startTime: \\\"2022-08-13T12:34:56Z\\\",\\n $endTime: \\\"2022-08-14T12:34:56Z\\\",\\n });\\n}\"\n }],\n \"loadGeotimeSeriesLastPointSnippet\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n\\nfunction getLastTimeSeriesPoint(obj: {{objectType}}) {\\n return obj.{{property}}.getLatestValue();\\n}\"\n }],\n \"subscribeToObjectSetInstructions\": [{\n \"template\": \"import { {{objectOrInterfaceApiName}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\n\\n// A map of primary keys to objects loaded through the SDK\\nconst objects: { [key: string]: {{objectOrInterfaceApiName}}.OsdkInstance } = ...\\n\\nconst subscription = client({{objectOrInterfaceApiName}}).subscribe( {\\n onChange(update) {\\n if (update.state === \\\"ADDED_OR_UPDATED\\\") {\\n // An object has received an update or an object was added to the object set\\n const currentObject = objects[update.object.$primaryKey];\\n if (currentObject !== undefined) {\\n currentObject[\\\"<propertyName>\\\"] = update.object[\\\"<propertyName>\\\"] ?? currentObject[\\\"<propertyName>\\\"];\\n }\\n }\\n else if (update.state === \\\"REMOVED\\\") {\\n // The object was removed from the object set, which could mean it was deleted or no longer meets the filter criteria\\n delete objects[update.object.$primaryKey];\\n }\\n },\\n onSuccessfulSubscription() {\\n // The subscription was successful and you can expect to receive updates\\n },\\n onError(err) {\\n // There was an error with the subscription and you will not receive any more updates\\n console.error(err);\\n },\\n onOutOfDate() {\\n // We could not keep track of all changes. Please reload the objects in your set.\\n },\\n },\\n { properties: [ {{#propertyNames}}\\\"{{.}}\\\", {{/propertyNames}}\\b\\b]}\\n );\\n\\nsubscription.unsubscribe();\"\n }],\n \"uploadMedia\": [{\n \"template\": \"import { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \\\"@osdk/api/unstable\\\";\\nimport { {{objectType}} } from \\\"{{{packageName}}}\\\"\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport { Result, isOk } from \\\"@osdk/client\\\";\\nimport type { MediaReference } from \\\"@osdk/api\\\";\\n\\n// To upload media with 2.x, it has to be linked to an Action call\\nasync function uploadMedia() {\\n const file = await fetch(\\\"file.json\\\");\\n const data = await file.blob();\\n\\n // Upload media to an object type with a media property. This returns a media reference that can passed to\\n // a media parameter in an Action.\\n return await client(\\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\\n ).createMediaReference({\\n data,\\n fileName: \\\"myFile\\\",\\n objectType: {{objectType}},\\n propertyType: \\\"MediaPropertyApi\\\",\\n });\\n}\\n\\nconst mediaReference: MediaReference = await uploadMedia();\\nconst actionResult = client(mediaUploadingAction).applyAction({ media_parameter: mediaReference });\"\n }],\n \"readMedia\": [{\n \"template\": \"import { {{objectType}} } from \\\"{{{packageName}}}\\\";\\n// Edit this import if your client location differs\\nimport { client } from \\\"./client\\\";\\nimport type { MediaMetadata, MediaReference } from \\\"@osdk/api\\\";\\nimport { Osdk, Result } from \\\"@osdk/client\\\";\\n\\nconst result = await client({{objectType}}).fetchOne(\\\"<primaryKey>\\\");\\n\\n// Fetch metadata of a media property\\nconst mediaMetadata = await result.{{property}}?.fetchMetadata();\\n\\n// Fetch contents of a media property\\nconst response = await result.{{property}}?.fetchContents();\\n\\nif (response.ok) {\\n const data = await response.blob();\\n ...\\n}\"\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 { outdent } from \"outdent\";\nimport { snippets } from \"./generatedNoCheck/docsNoComputedVariables.js\";\nconst indentedNewLine = spacesCount => `\\n${\" \".repeat(spacesCount)}`;\nexport const TYPESCRIPT_OSDK_SNIPPETS = {\n ...snippets,\n computedVariables: {\n functionInputValuesV1: handleFunctionInputValuesV1,\n functionInputValuesV2: handleFunctionInputValuesV2,\n actionParameterSampleValuesV1: handleActionParameterSampleValuesV1,\n actionParameterSampleValuesV2: handleActionParameterSampleValuesV2,\n propertyValueV1: handlePropertyValueV1,\n propertyValueV2: handlePropertyValueV2,\n propertyValueIncrementedV1: handlePropertyValueIncrementedV1,\n propertyValueIncrementedV2: handlePropertyValueIncrementedV2,\n propertiesV1: handlePropertiesV1,\n propertiesV2: handlePropertiesV2,\n primaryKeyPropertyV1: handlePrimaryKeyPropertyV1,\n primaryKeyPropertyV2: handlePrimaryKeyPropertyV2,\n linkedPropertiesV1: handleLinkedPropertiesV1,\n linkedPropertiesV2: handleLinkedPropertiesV2,\n linkedPrimaryKeyPropertyV1: handleLinkedPrimaryKeyPropertyV1,\n linkedPrimaryKeyPropertyV2: handleLinkedPrimaryKeyPropertyV2,\n arrayElementValue: handleArrayElementValue\n }\n};\n\n// SDK major version enum\nvar SdkMajorVersion = /*#__PURE__*/function (SdkMajorVersion) {\n SdkMajorVersion[SdkMajorVersion[\"V1\"] = 1] = \"V1\";\n SdkMajorVersion[SdkMajorVersion[\"V2\"] = 2] = \"V2\";\n return SdkMajorVersion;\n}(SdkMajorVersion || {}); // Helper functions for properties\nfunction handleFunctionInputValuesV1({\n rawFunctionInputValues\n}) {\n return renderFunctionInputValues(rawFunctionInputValues, SdkMajorVersion.V1);\n}\nfunction handleFunctionInputValuesV2({\n rawFunctionInputValues\n}) {\n return renderFunctionInputValues(rawFunctionInputValues, SdkMajorVersion.V2);\n}\nfunction handleActionParameterSampleValuesV1({\n rawActionTypeParameterValues\n}) {\n return renderActionParameterValues(rawActionTypeParameterValues, SdkMajorVersion.V1);\n}\nfunction handleActionParameterSampleValuesV2({\n rawActionTypeParameterValues\n}) {\n return renderActionParameterValues(rawActionTypeParameterValues, SdkMajorVersion.V2);\n}\nfunction handlePropertyValueV1({\n rawPropertyValue\n}) {\n return renderPropertyValue(rawPropertyValue, SdkMajorVersion.V1);\n}\nfunction handlePropertyValueV2({\n rawPropertyValue\n}) {\n return renderPropertyValue(rawPropertyValue, SdkMajorVersion.V2);\n}\nfunction handlePropertyValueIncrementedV1({\n rawPropertyValueIncremented\n}) {\n return renderPropertyValue(rawPropertyValueIncremented, SdkMajorVersion.V1);\n}\nfunction handlePropertyValueIncrementedV2({\n rawPropertyValueIncremented\n}) {\n return renderPropertyValue(rawPropertyValueIncremented, SdkMajorVersion.V2);\n}\nfunction handleArrayElementValue({\n rawPropertyValue\n}) {\n return renderArrayElementPropertyValue(rawPropertyValue, SdkMajorVersion.V2);\n}\nfunction renderArrayElementPropertyValue(propertyValue, majorVersion) {\n if (propertyValue == null) {\n throw new Error(\"Cannot render a null property value\");\n }\n return renderType(propertyValue, majorVersion, \"arraySubType\");\n}\nfunction handlePropertiesV1({\n rawProperties\n}) {\n if (rawProperties == null) {\n throw new Error(\"Cannot render with null rawProperties\");\n }\n return rawProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V1)\n }));\n}\nfunction handlePropertiesV2({\n rawProperties\n}) {\n if (rawProperties == null) {\n throw new Error(\"Cannot render with null rawProperties\");\n }\n return rawProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V2)\n }));\n}\nfunction handlePrimaryKeyPropertyV1({\n rawPrimaryKeyProperty\n}) {\n if (rawPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawPrimaryKeyProperty\");\n }\n return {\n apiName: rawPrimaryKeyProperty.apiName,\n value: renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V1)\n };\n}\nfunction handlePrimaryKeyPropertyV2({\n rawPrimaryKeyProperty\n}) {\n if (rawPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawPrimaryKeyProperty\");\n }\n return {\n apiName: rawPrimaryKeyProperty.apiName,\n value: renderPropertyValue(rawPrimaryKeyProperty.value, SdkMajorVersion.V2)\n };\n}\nfunction handleLinkedPropertiesV1({\n rawLinkedProperties\n}) {\n if (rawLinkedProperties == null) {\n throw new Error(\"Cannot render with null rawLinkedProperties\");\n }\n return rawLinkedProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V1)\n }));\n}\nfunction handleLinkedPropertiesV2({\n rawLinkedProperties\n}) {\n if (rawLinkedProperties == null) {\n throw new Error(\"Cannot render with null rawLinkedProperties\");\n }\n return rawLinkedProperties.map(prop => ({\n apiName: prop.apiName,\n value: renderPropertyValue(prop.value, SdkMajorVersion.V2)\n }));\n}\nfunction handleLinkedPrimaryKeyPropertyV1({\n rawLinkedPrimaryKeyProperty\n}) {\n if (rawLinkedPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawLinkedPrimaryKeyProperty\");\n }\n return {\n apiName: rawLinkedPrimaryKeyProperty.apiName,\n value: renderPropertyValue(rawLinkedPrimaryKeyProperty.value, SdkMajorVersion.V1),\n type: rawLinkedPrimaryKeyProperty.type\n };\n}\nfunction handleLinkedPrimaryKeyPropertyV2({\n rawLinkedPrimaryKeyProperty\n}) {\n if (rawLinkedPrimaryKeyProperty == null) {\n throw new Error(\"Cannot render with null rawLinkedPrimaryKeyProperty\");\n }\n return {\n apiName: rawLinkedPrimaryKeyProperty.apiName,\n value: renderPropertyValue(rawLinkedPrimaryKeyProperty.value, SdkMajorVersion.V2),\n type: rawLinkedPrimaryKeyProperty.type\n };\n}\n\n// Common function to render function input values for any version\nfunction renderFunctionInputValues(rawFunctionInputValues, majorVersion) {\n if (rawFunctionInputValues == null) {\n throw new Error(\"Cannot render a null rawFunctionInputValues\");\n }\n if (Object.keys(rawFunctionInputValues.parameters).length === 0) {\n return \"\";\n }\n return outdent`\n {\n ${Object.entries(rawFunctionInputValues.parameters).map(([key, value]) => `\"${key}\": ${renderType(value, majorVersion, \"functionInput\")}`).join(`,${indentedNewLine(4)}`)}\n }`;\n}\n\n// Common function to render action parameter values for any version\nfunction renderActionParameterValues(rawActionTypeParameterValues, majorVersion) {\n if (rawActionTypeParameterValues == null) {\n throw new Error(\"Cannot render a null rawActionTypeParameterValues\");\n }\n return rawActionTypeParameterValues.map((param, index, array) => ({\n key: param.key,\n value: renderType(param.value, majorVersion, \"actionParameter\"),\n last: index === array.length - 1\n }));\n}\n\n// Function to render property values\nfunction renderPropertyValue(propertyValue, majorVersion) {\n if (propertyValue == null) {\n throw new Error(\"Cannot render a null property value\");\n }\n return renderType(propertyValue, majorVersion, \"property\");\n}\n\n// Unified render function for all types\nfunction renderType(type, majorVersion, context) {\n if (type == null) {\n throw new Error(\"Cannot render a null type value\");\n }\n switch (type.type) {\n case \"array\":\n case \"set\":\n case \"list\":\n const arraySubType = renderType(type.subtype, majorVersion, context);\n return context === \"arraySubType\" ? arraySubType : `[${arraySubType}]`;\n case \"boolean\":\n return type.value ? \"true\" : \"false\";\n case \"byte\":\n case \"integer\":\n case \"long\":\n case \"short\":\n return type.value.toString();\n case \"decimal\":\n case \"double\":\n case \"float\":\n if (context === \"actionParameter\") {\n return `\"${type.value.toString()}\"`;\n }\n return type.value.toString();\n case \"date\":\n return getDateParameter(majorVersion, type.daysOffset);\n case \"timestamp\":\n return getTimestampParameter(majorVersion, type.daysOffset);\n case \"object\":\n const primaryKeyValue = type.primaryKeyType === \"string\" ? \"\\\"primaryKeyValue\\\"\" : \"primaryKeyValue\";\n if (context === \"actionParameter\") {\n return majorVersion >= SdkMajorVersion.V2 ? `{ $primaryKey: ${primaryKeyValue}, /* other properties */ }` : `{ __primaryKey: ${primaryKeyValue}, /* other properties */ }`;\n }\n return primaryKeyValue;\n case \"anonymousCustomType\":\n case \"customType\":\n return \"{}\";\n case \"attachment\":\n return type.hasAttachments ? \"attachment\" : \"{}\";\n case \"interface\":\n case \"marking\":\n return \"{}\";\n case \"mediaReference\":\n return context === \"actionParameter\" ? \"mediaReference\" : \"mediaReferenceRid\";\n case \"objectType\":\n return `\"${type.objectTypeApiName}\"`;\n case \"map\":\n if (type.keyType.type === \"object\") {\n return `{[${getMapKeyObjectName(type.keyType.apiName)}.$objectSpecifier]: ${renderType(type.valueType, majorVersion, context)}}`;\n }\n return `{${renderType(type.valueType, majorVersion, context)}: ${renderType(type.valueType, majorVersion, context)}}`;\n case \"string\":\n case \"unknown\":\n default:\n return `\"${type.value ?? \"value\"}\"`;\n }\n}\nfunction getMapKeyObjectName(apiName) {\n if (apiName == null) {\n return \"osdkObject\";\n }\n return `${getDisplayName(processObjectApiName(apiName))}OsdkObject`;\n}\nfunction getDisplayName(input) {\n const tokens = input.split(/[_-]|(?<=[a-z])(?=[A-Z])/);\n const result = tokens.map(token => titleCase(token.toLowerCase())).join(\"\");\n return result.charAt(0).toLowerCase() + result.slice(1);\n}\nfunction titleCase(token) {\n return (token[0] ?? \"\").toUpperCase() + token.slice(1);\n}\n\n// For objects that have namespaces prefixed to their api name, we remove it and only return the last portion\n// As that is what the TS OSDK uses to generate identifiers for objects\nfunction processObjectApiName(objectApiName) {\n const last = objectApiName.lastIndexOf(\".\");\n if (last === -1) {\n return objectApiName;\n }\n return objectApiName.slice(last + 1);\n}\n\n// Generic helper functions for date and timestamp\nfunction getDateParameter(majorVersion, daysOffset = 0) {\n const offsetDate = new Date();\n offsetDate.setDate(offsetDate.getDate() + daysOffset);\n if (majorVersion >= SdkMajorVersion.V2) {\n return `\"${offsetDate.toISOString().split(\"T\")[0]}\"`;\n }\n return daysOffset !== 0 ? `LocalDate.now().plusDays(${daysOffset})` : \"LocalDate.now()\";\n}\nfunction getTimestampParameter(majorVersion, daysOffset = 0) {\n const offsetDate = new Date();\n offsetDate.setDate(offsetDate.getDate() + daysOffset);\n if (majorVersion >= SdkMajorVersion.V2) {\n return `\"${offsetDate.toISOString()}\"`;\n }\n return daysOffset !== 0 ? `Timestamp.now().plusDays(${daysOffset})` : \"Timestamp.now()\";\n}","/*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\nvar objectToString = Object.prototype.toString;\nvar isArray = Array.isArray || function isArrayPolyfill(object) {\n return objectToString.call(object) === '[object Array]';\n};\nfunction isFunction(object) {\n return typeof object === 'function';\n}\n\n/**\n * More correct typeof string handling array\n * which normally returns typeof 'object'\n */\nfunction typeStr(obj) {\n return isArray(obj) ? 'array' : typeof obj;\n}\nfunction escapeRegExp(string) {\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\n}\n\n/**\n * Null safe way of checking whether or not an object,\n * including its prototype, has a given property\n */\nfunction hasProperty(obj, propName) {\n return obj != null && typeof obj === 'object' && propName in obj;\n}\n\n/**\n * Safe way of detecting whether or not the given thing is a primitive and\n * whether it has the given property\n */\nfunction primitiveHasOwnProperty(primitive, propName) {\n return primitive != null && typeof primitive !== 'object' && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);\n}\n\n// Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n// See https://github.com/janl/mustache.js/issues/189\nvar regExpTest = RegExp.prototype.test;\nfunction testRegExp(re, string) {\n return regExpTest.call(re, string);\n}\nvar nonSpaceRe = /\\S/;\nfunction isWhitespace(string) {\n return !testRegExp(nonSpaceRe, string);\n}\nvar entityMap = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#39;',\n '/': '&#x2F;',\n '`': '&#x60;',\n '=': '&#x3D;'\n};\nfunction escapeHtml(string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap(s) {\n return entityMap[s];\n });\n}\nvar whiteRe = /\\s*/;\nvar spaceRe = /\\s+/;\nvar equalsRe = /\\s*=/;\nvar curlyRe = /\\s*\\}/;\nvar tagRe = /#|\\^|\\/|>|\\{|&|=|!/;\n\n/**\n * Breaks up the given `template` string into a tree of tokens. If the `tags`\n * argument is given here it must be an array with two string values: the\n * opening and closing tags used in the template (e.g. [ \"<%\", \"%>\" ]). Of\n * course, the default is to use mustaches (i.e. mustache.tags).\n *\n * A token is an array with at least 4 elements. The first element is the\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n * all text that appears outside a symbol this element is \"text\".\n *\n * The second element of a token is its \"value\". For mustache tags this is\n * whatever else was inside the tag besides the opening symbol. For text tokens\n * this is the text itself.\n *\n * The third and fourth elements of the token are the start and end indices,\n * respectively, of the token in the original template.\n *\n * Tokens that are the root node of a subtree contain two more elements: 1) an\n * array of tokens in the subtree and 2) the index in the original template at\n * which the closing tag for that section begins.\n *\n * Tokens for partials also contain two more elements: 1) a string value of\n * indendation prior to that tag and 2) the index of that tag on that line -\n * eg a value of 2 indicates the partial is the third tag on this line.\n */\nfunction parseTemplate(template, tags) {\n if (!template) return [];\n var lineHasNonSpace = false;\n var sections = []; // Stack to hold section tokens\n var tokens = []; // Buffer to hold the tokens\n var spaces = []; // Indices of whitespace tokens on the current line\n var hasTag = false; // Is there a {{tag}} on the current line?\n var nonSpace = false; // Is there a non-space char on the current line?\n var indentation = ''; // Tracks indentation for tags that use it\n var tagIndex = 0; // Stores a count of number of tags encountered on a line\n\n // Strips all whitespace tokens array for the current line\n // if there was a {{#tag}} on it and otherwise only space.\n function stripSpace() {\n if (hasTag && !nonSpace) {\n while (spaces.length) delete tokens[spaces.pop()];\n } else {\n spaces = [];\n }\n hasTag = false;\n nonSpace = false;\n }\n var openingTagRe, closingTagRe, closingCurlyRe;\n function compileTags(tagsToCompile) {\n if (typeof tagsToCompile === 'string') tagsToCompile = tagsToCompile.split(spaceRe, 2);\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2) throw new Error('Invalid tags: ' + tagsToCompile);\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\n }\n compileTags(tags || mustache.tags);\n var scanner = new Scanner(template);\n var start, type, value, chr, token, openSection;\n while (!scanner.eos()) {\n start = scanner.pos;\n\n // Match any text between tags.\n value = scanner.scanUntil(openingTagRe);\n if (value) {\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\n chr = value.charAt(i);\n if (isWhitespace(chr)) {\n spaces.push(tokens.length);\n indentation += chr;\n } else {\n nonSpace = true;\n lineHasNonSpace = true;\n indentation += ' ';\n }\n tokens.push(['text', chr, start, start + 1]);\n start += 1;\n\n // Check for whitespace on the current line.\n if (chr === '\\n') {\n stripSpace();\n indentation = '';\n tagIndex = 0;\n lineHasNonSpace = false;\n }\n }\n }\n\n // Match the opening tag.\n if (!scanner.scan(openingTagRe)) break;\n hasTag = true;\n\n // Get the tag type.\n type = scanner.scan(tagRe) || 'name';\n scanner.scan(whiteRe);\n\n // Get the tag value.\n if (type === '=') {\n value = scanner.scanUntil(equalsRe);\n scanner.scan(equalsRe);\n scanner.scanUntil(closingTagRe);\n } else if (type === '{') {\n value = scanner.scanUntil(closingCurlyRe);\n scanner.scan(curlyRe);\n scanner.scanUntil(closingTagRe);\n type = '&';\n } else {\n value = scanner.scanUntil(closingTagRe);\n }\n\n // Match the closing tag.\n if (!scanner.scan(closingTagRe)) throw new Error('Unclosed tag at ' + scanner.pos);\n if (type == '>') {\n token = [type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];\n } else {\n token = [type, value, start, scanner.pos];\n }\n tagIndex++;\n tokens.push(token);\n if (type === '#' || type === '^') {\n sections.push(token);\n } else if (type === '/') {\n // Check section nesting.\n openSection = sections.pop();\n if (!openSection) throw new Error('Unopened section \"' + value + '\" at ' + start);\n if (openSection[1] !== value) throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n } else if (type === 'name' || type === '{' || type === '&') {\n nonSpace = true;\n } else if (type === '=') {\n // Set the tags for the next time around.\n compileTags(value);\n }\n }\n stripSpace();\n\n // Make sure there are no open sections when we're done.\n openSection = sections.pop();\n if (openSection) throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n return nestTokens(squashTokens(tokens));\n}\n\n/**\n * Combines the values of consecutive text tokens in the given `tokens` array\n * to a single token.\n */\nfunction squashTokens(tokens) {\n var squashedTokens = [];\n var token, lastToken;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n if (token) {\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n lastToken[1] += token[1];\n lastToken[3] = token[3];\n } else {\n squashedTokens.push(token);\n lastToken = token;\n }\n }\n }\n return squashedTokens;\n}\n\n/**\n * Forms the given array of `tokens` into a nested tree structure where\n * tokens that represent a section have two additional items: 1) an array of\n * all tokens that appear in that section and 2) the index in the original\n * template that represents the end of that section.\n */\nfunction nestTokens(tokens) {\n var nestedTokens = [];\n var collector = nestedTokens;\n var sections = [];\n var token, section;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n switch (token[0]) {\n case '#':\n case '^':\n collector.push(token);\n sections.push(token);\n collector = token[4] = [];\n break;\n case '/':\n section = sections.pop();\n section[5] = token[2];\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n break;\n default:\n collector.push(token);\n }\n }\n return nestedTokens;\n}\n\n/**\n * A simple string scanner that is used by the template parser to find\n * tokens in template strings.\n */\nfunction Scanner(string) {\n this.string = string;\n this.tail = string;\n this.pos = 0;\n}\n\n/**\n * Returns `true` if the tail is empty (end of string).\n */\nScanner.prototype.eos = function eos() {\n return this.tail === '';\n};\n\n/**\n * Tries to match the given regular expression at the current position.\n * Returns the matched text if it can match, the empty string otherwise.\n */\nScanner.prototype.scan = function scan(re) {\n var match = this.tail.match(re);\n if (!match || match.index !== 0) return '';\n var string = match[0];\n this.tail = this.tail.substring(string.length);\n this.pos += string.length;\n return string;\n};\n\n/**\n * Skips all text until the given regular expression can be matched. Returns\n * the skipped string, which is the entire tail if no match can be made.\n */\nScanner.prototype.scanUntil = function scanUntil(re) {\n var index = this.tail.search(re),\n match;\n switch (index) {\n case -1:\n match = this.tail;\n this.tail = '';\n break;\n case 0:\n match = '';\n break;\n default:\n match = this.tail.substring(0, index);\n this.tail = this.tail.substring(index);\n }\n this.pos += match.length;\n return match;\n};\n\n/**\n * Represents a rendering context by wrapping a view object and\n * maintaining a reference to the parent context.\n */\nfunction Context(view, parentContext) {\n this.view = view;\n this.cache = {\n '.': this.view\n };\n this.parent = parentContext;\n}\n\n/**\n * Creates a new context using the given view with this context\n * as the parent.\n */\nContext.prototype.push = function push(view) {\n return new Context(view, this);\n};\n\n/**\n * Returns the value of the given name in this context, traversing\n * up the context hierarchy if the value is absent in this context's view.\n */\nContext.prototype.lookup = function lookup(name) {\n var cache = this.cache;\n var value;\n if (cache.hasOwnProperty(name)) {\n value = cache[name];\n } else {\n var context = this,\n intermediateValue,\n names,\n index,\n lookupHit = false;\n while (context) {\n if (name.indexOf('.') > 0) {\n intermediateValue = context.view;\n names = name.split('.');\n index = 0;\n\n /**\n * Using the dot notion path in `name`, we descend through the\n * nested objects.\n *\n * To be certain that the lookup has been successful, we have to\n * check if the last object in the path actually has the property\n * we are looking for. We store the result in `lookupHit`.\n *\n * This is specially necessary for when the value has been set to\n * `undefined` and we want to avoid looking up parent contexts.\n *\n * In the case where dot notation is used, we consider the lookup\n * to be successful even if the last \"object\" in the path is\n * not actually an object but a primitive (e.g., a string, or an\n * integer), because it is sometimes useful to access a property\n * of an autoboxed primitive, such as the length of a string.\n **/\n while (intermediateValue != null && index < names.length) {\n if (index === names.length - 1) lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);\n intermediateValue = intermediateValue[names[index++]];\n }\n } else {\n intermediateValue = context.view[name];\n\n /**\n * Only checking against `hasProperty`, which always returns `false` if\n * `context.view` is not an object. Deliberately omitting the check\n * against `primitiveHasOwnProperty` if dot notation is not used.\n *\n * Consider this example:\n * ```\n * Mustache.render(\"The length of a football field is {{#length}}{{length}}{{/length}}.\", {length: \"100 yards\"})\n * ```\n *\n * If we were to check also against `primitiveHasOwnProperty`, as we do\n * in the dot notation case, then render call would return:\n *\n * \"The length of a football field is 9.\"\n *\n * rather than the expected:\n *\n * \"The length of a football field is 100 yards.\"\n **/\n lookupHit = hasProperty(context.view, name);\n }\n if (lookupHit) {\n value = intermediateValue;\n break;\n }\n context = context.parent;\n }\n cache[name] = value;\n }\n if (isFunction(value)) value = value.call(this.view);\n return value;\n};\n\n/**\n * A Writer knows how to take a stream of tokens and render them to a\n * string, given a context. It also maintains a cache of templates to\n * avoid the need to parse the same template twice.\n */\nfunction Writer() {\n this.templateCache = {\n _cache: {},\n set: function set(key, value) {\n this._cache[key] = value;\n },\n get: function get(key) {\n return this._cache[key];\n },\n clear: function clear() {\n this._cache = {};\n }\n };\n}\n\n/**\n * Clears all cached templates in this writer.\n */\nWriter.prototype.clearCache = function clearCache() {\n if (typeof this.templateCache !== 'undefined') {\n this.templateCache.clear();\n }\n};\n\n/**\n * Parses and caches the given `template` according to the given `tags` or\n * `mustache.tags` if `tags` is omitted, and returns the array of tokens\n * that is generated from the parse.\n */\nWriter.prototype.parse = function parse(template, tags) {\n var cache = this.templateCache;\n var cacheKey = template + ':' + (tags || mustache.tags).join(':');\n var isCacheEnabled = typeof cache !== 'undefined';\n var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined;\n if (tokens == undefined) {\n tokens = parseTemplate(template, tags);\n isCacheEnabled && cache.set(cacheKey, tokens);\n }\n return tokens;\n};\n\n/**\n * High-level method that is used to render the given `template` with\n * the given `view`.\n *\n * The optional `partials` argument may be an object that contains the\n * names and templates of partials that are used in the template. It may\n * also be a function that is used to load partial templates on the fly\n * that takes a single argument: the name of the partial.\n *\n * If the optional `config` argument is given here, then it should be an\n * object with a `tags` attribute or an `escape` attribute or both.\n * If an array is passed, then it will be interpreted the same way as\n * a `tags` attribute on a `config` object.\n *\n * The `tags` attribute of a `config` object must be an array with two\n * string values: the opening and closing tags used in the template (e.g.\n * [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n *\n * The `escape` attribute of a `config` object must be a function which\n * accepts a string as input and outputs a safely escaped string.\n * If an `escape` function is not provided, then an HTML-safe string\n * escaping function is used as the default.\n */\nWriter.prototype.render = function render(template, view, partials, config) {\n var tags = this.getConfigTags(config);\n var tokens = this.parse(template, tags);\n var context = view instanceof Context ? view : new Context(view, undefined);\n return this.renderTokens(tokens, context, partials, template, config);\n};\n\n/**\n * Low-level method that renders the given array of `tokens` using\n * the given `context` and `partials`.\n *\n * Note: The `originalTemplate` is only ever used to extract the portion\n * of the original template that was contained in a higher-order section.\n * If the template doesn't use higher-order sections, this argument may\n * be omitted.\n */\nWriter.prototype.renderTokens = function renderTokens(tokens, context, partials, originalTemplate, config) {\n var buffer = '';\n var token, symbol, value;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n value = undefined;\n token = tokens[i];\n symbol = token[0];\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate, config);else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate, config);else if (symbol === '>') value = this.renderPartial(token, context, partials, config);else if (symbol === '&') value = this.unescapedValue(token, context);else if (symbol === 'name') value = this.escapedValue(token, context, config);else if (symbol === 'text') value = this.rawValue(token);\n if (value !== undefined) buffer += value;\n }\n return buffer;\n};\nWriter.prototype.renderSection = function renderSection(token, context, partials, originalTemplate, config) {\n var self = this;\n var buffer = '';\n var value = context.lookup(token[1]);\n\n // This function is used to render an arbitrary template\n // in the current context by higher-order sections.\n function subRender(template) {\n return self.render(template, context, partials, config);\n }\n if (!value) return;\n if (isArray(value)) {\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);\n }\n } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);\n } else if (isFunction(value)) {\n if (typeof originalTemplate !== 'string') throw new Error('Cannot use higher-order sections without the original template');\n\n // Extract the portion of the original template that the section contains.\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n if (value != null) buffer += value;\n } else {\n buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);\n }\n return buffer;\n};\nWriter.prototype.renderInverted = function renderInverted(token, context, partials, originalTemplate, config) {\n var value = context.lookup(token[1]);\n\n // Use JavaScript's definition of falsy. Include empty arrays.\n // See https://github.com/janl/mustache.js/issues/186\n if (!value || isArray(value) && value.length === 0) return this.renderTokens(token[4], context, partials, originalTemplate, config);\n};\nWriter.prototype.indentPartial = function indentPartial(partial, indentation, lineHasNonSpace) {\n var filteredIndentation = indentation.replace(/[^ \\t]/g, '');\n var partialByNl = partial.split('\\n');\n for (var i = 0; i < partialByNl.length; i++) {\n if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {\n partialByNl[i] = filteredIndentation + partialByNl[i];\n }\n }\n return partialByNl.join('\\n');\n};\nWriter.prototype.renderPartial = function renderPartial(token, context, partials, config) {\n if (!partials) return;\n var tags = this.getConfigTags(config);\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null) {\n var lineHasNonSpace = token[6];\n var tagIndex = token[5];\n var indentation = token[4];\n var indentedValue = value;\n if (tagIndex == 0 && indentation) {\n indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);\n }\n var tokens = this.parse(indentedValue, tags);\n return this.renderTokens(tokens, context, partials, indentedValue, config);\n }\n};\nWriter.prototype.unescapedValue = function unescapedValue(token, context) {\n var value = context.lookup(token[1]);\n if (value != null) return value;\n};\nWriter.prototype.escapedValue = function escapedValue(token, context, config) {\n var escape = this.getConfigEscape(config) || mustache.escape;\n var value = context.lookup(token[1]);\n if (value != null) return typeof value === 'number' && escape === mustache.escape ? String(value) : escape(value);\n};\nWriter.prototype.rawValue = function rawValue(token) {\n return token[1];\n};\nWriter.prototype.getConfigTags = function getConfigTags(config) {\n if (isArray(config)) {\n return config;\n } else if (config && typeof config === 'object') {\n return config.tags;\n } else {\n return undefined;\n }\n};\nWriter.prototype.getConfigEscape = function getConfigEscape(config) {\n if (config && typeof config === 'object' && !isArray(config)) {\n return config.escape;\n } else {\n return undefined;\n }\n};\nvar mustache = {\n name: 'mustache.js',\n version: '4.2.0',\n tags: ['{{', '}}'],\n clearCache: undefined,\n escape: undefined,\n parse: undefined,\n render: undefined,\n Scanner: undefined,\n Context: undefined,\n Writer: undefined,\n /**\n * Allows a user to override the default caching strategy, by providing an\n * object with set, get and clear methods. This can also be used to disable\n * the cache by setting it to the literal `undefined`.\n */\n set templateCache(cache) {\n defaultWriter.templateCache = cache;\n },\n /**\n * Gets the default or overridden caching object from the default writer.\n */\n get templateCache() {\n return defaultWriter.templateCache;\n }\n};\n\n// All high-level mustache.* functions use this writer.\nvar defaultWriter = new Writer();\n\n/**\n * Clears all cached templates in the default writer.\n */\nmustache.clearCache = function clearCache() {\n return defaultWriter.clearCache();\n};\n\n/**\n * Parses and caches the given template in the default writer and returns the\n * array of tokens it contains. Doing this ahead of time avoids the need to\n * parse templates on the fly as they are rendered.\n */\nmustache.parse = function parse(template, tags) {\n return defaultWriter.parse(template, tags);\n};\n\n/**\n * Renders the `template` with the given `view`, `partials`, and `config`\n * using the default writer.\n */\nmustache.render = function render(template, view, partials, config) {\n if (typeof template !== 'string') {\n throw new TypeError('Invalid template! Template should be a \"string\" ' + 'but \"' + typeStr(template) + '\" was given as the first ' + 'argument for mustache#render(template, view, partials)');\n }\n return defaultWriter.render(template, view, partials, config);\n};\n\n// Export the escaping function so that the user may override it.\n// See https://github.com/janl/mustache.js/issues/244\nmustache.escape = escapeHtml;\n\n// Export these mainly for testing, but also for advanced usage.\nmustache.Scanner = Scanner;\nmustache.Context = Context;\nmustache.Writer = Writer;\nexport default mustache;","/*\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}({});","/*\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 { TYPESCRIPT_OSDK_SNIPPETS } from \"@osdk/typescript-sdk-docs\";\nimport { consola } from \"consola\";\nimport * as fs from \"fs\";\nimport Mustache from \"mustache\";\nimport * as path from \"path\";\nimport { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport { actionSnippets, interfaceSnippets, objectSnippets } 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.propertiesV2)\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 latestTemplate = Object.values(TYPESCRIPT_OSDK_SNIPPETS.versions).find(v => v.snippets[templateName])?.snippets[templateName][0].template ?? \"\";\n const renderedTemplate = Mustache.render(latestTemplate, context);\n allSnippets[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 { 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) {\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 // eslint-disable-next-line no-console\n console.error(\"Unexpected error while processing the body of the ontology\", e);\n throw e;\n }\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(entity, null, 2).replace(/(\"__type\"\\s*:\\s*)\"([^\"]*)\"/g, (_, 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 cleanAndValidateLinkTypeId(apiName) {\n // Insert a dash before any uppercase letter that follows a lowercase letter or digit\n const step1 = apiName.replace(/([a-z0-9])([A-Z])/g, \"$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])/g, \"$1-$2\").toLowerCase();\n const VALIDATION_PATTERN = /^([a-z][a-z0-9\\-]*)$/;\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 (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 ...(action.submissionMetadata?.submitButtonDisplayMetadata && {\n submitButtonDisplayMetadata: action.submissionMetadata.submitButtonDisplayMetadata\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration && {\n undoButtonConfiguration: action.submissionMetadata.undoButtonConfiguration\n })\n },\n parameterOrdering: 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: minLength\n }),\n ...(maxLength === undefined ? {} : {\n maxLength: maxLength\n }),\n ...(regex === undefined ? {} : {\n regex: {\n regex: 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 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) {\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 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 throw new Error(\"Structs are not supported yet\");\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(/[-_]+(.)?/g, (_, 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}\nfunction 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}","/*\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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineOntology } from \"../api/defineOntology.js\";\nconst apiNamespaceRegex = /^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$/;\nconst uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\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 coerce: path.resolve\n }\n }).parseAsync();\n let apiNamespace = \"\";\n if (commandLineOpts.apiNamespace.length !== 0) {\n apiNamespace = commandLineOpts.apiNamespace.slice(-1) !== \".\" ? commandLineOpts.apiNamespace + \".\" : commandLineOpts.apiNamespace;\n !(apiNamespace.length < 1024) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is too long.\") : invariant(false) : void 0;\n !apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$\") : invariant(false) : void 0;\n }\n consola.info(`Loading ontology from ${commandLineOpts.input}`);\n if (!commandLineOpts.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 const ontologyIr = await loadOntology(commandLineOpts.input, apiNamespace, commandLineOpts.outputDir, commandLineOpts.dependencies, commandLineOpts.generateCodeSnippets, commandLineOpts.codeSnippetPackageName, commandLineOpts.codeSnippetDir, commandLineOpts.randomnessKey);\n consola.info(`Saving ontology to ${commandLineOpts.output}`);\n await fs.writeFile(commandLineOpts.output, JSON.stringify(ontologyIr, null, 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}\nasync function loadOntology(input, apiNamespace, outputDir, dependencyFile, generateCodeSnippets, snippetPackageName, codeSnippetDir, randomnessKey) {\n const q = await defineOntology(apiNamespace, async () => await import(input), outputDir, dependencyFile, generateCodeSnippets, snippetPackageName, codeSnippetDir, randomnessKey);\n return q;\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// 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\nimport invariant from \"tiny-invariant\";\nimport { convertConditionDefinition } from \"../conversion/toMarketplace/convertConditionDefinition.js\";\nimport { isActionParameterTypePrimitive } from \"./action/ActionParameterType.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { uppercaseFirstLetter } from \"./defineObject.js\";\nimport { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\nexport const MODIFY_OBJECT_PARAMETER = \"objectToModifyParameter\";\nexport const CREATE_OR_MODIFY_OBJECT_PARAMETER = \"objectToCreateOrModifyParameter\";\nexport const CREATE_INTERFACE_OBJECT_PARAMETER = \"objectTypeParameter\";\nexport const MODIFY_INTERFACE_OBJECT_PARAMETER = \"interfaceObjectToModifyParameter\";\nexport function defineAction(actionDef) {\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]+)*$/.test(actionDef.apiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Action type apiName \"${actionDef.apiName}\" must be alphanumeric, lowercase, and kebab-case`) : 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 });\n const fullAction = {\n ...actionDef,\n apiName: apiName,\n entities: actionDef.entities ?? {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\n },\n __type: OntologyEntityTypeEnum.ACTION_TYPE\n };\n validateActionConfiguration(fullAction);\n updateOntology(fullAction);\n return fullAction;\n}\nexport function isPropertyParameter(def, name, type) {\n return !Object.keys(def.nonParameterMappings ?? {}).includes(name) && !isStruct(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 id,\n displayName: def.parameterConfiguration?.[id]?.displayName ?? propertyMap[id]?.displayName ?? uppercaseFirstLetter(id),\n type: def.parameterConfiguration?.[id]?.customParameterType ?? extractActionParameterType(propertyMap[id]),\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(propertyMap[id]?.type)),\n required: def.parameterConfiguration?.[id].required ?? propertyMap[id]?.nullability?.noNulls ?? false\n } : {\n required: propertyMap[id]?.array ?? false ? {\n listLength: propertyMap[id]?.nullability?.noEmptyCollections ? {\n min: 1\n } : {}\n } : requiredMap?.[id] ?? propertyMap[id]?.nullability?.noNulls ?? false,\n allowedValues: extractAllowedValuesFromPropertyType(propertyMap[id]?.type)\n },\n defaultValue: def.parameterConfiguration?.[id]?.defaultValue,\n description: def.parameterConfiguration?.[id]?.description\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: {\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 === 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: {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: [def.interfaceType.apiName]\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n 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: {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: def.interfaceType.apiName\n }\n },\n validation: {\n ...def.parameterConfiguration?.[name],\n 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 });\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 }\n });\n return parameterIds;\n}\nfunction 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 \"struct\":\n case \"structList\":\n throw new Error(\"Structs are not supported yet\");\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 default:\n switch (type.type) {\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 throw new Error(\"Structs are not supported 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 \"marking\":\n return maybeAddList(\"marking\", pt);\n case \"string\":\n return maybeAddList(\"string\", pt);\n case \"struct\":\n throw new Error(\"Structs are not supported 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 maybeAddList(type, pt) {\n return pt.array ?? false ? type + \"List\" : type;\n}\nexport function kebab(s) {\n return s.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/([A-Z])([A-Z][a-z])/g, \"$1-$2\").replace(/\\./g, \"-\").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))) ? 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 return isTargetParameter(parameter) || !Object.keys(def.interfaceType.propertiesV2).includes(addNamespaceIfNone(parameter)) ? parameter : addNamespaceIfNone(parameter);\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 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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { addNamespaceToActionDefinition, convertValidationRule, CREATE_INTERFACE_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nexport function defineCreateInterfaceObjectAction(def) {\n addNamespaceToActionDefinition(def);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);\n const propertyParameters = Object.keys(allProperties).filter(apiName => isPropertyParameter(def, apiName, allProperties[apiName].sharedPropertyType.type));\n const parameterNames = new Set(propertyParameters);\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, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.sharedPropertyType])), parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required])));\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.interfaceType.displayMetadata.displayName}`,\n parameters: 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(propertyParameters.map(id => [id, {\n type: \"parameterId\",\n parameterId: id\n }])),\n ...mappings\n }\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(allProperties), 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 });\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 { convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\nexport function defineCreateObjectAction(def) {\n validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);\n const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter(ds => ds.type === \"derived\").flatMap(ds => Object.keys(ds.propertyMapping));\n const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter(id => isPropertyParameter(def, id, def.objectType.properties?.[id].type) && !isStruct(def.objectType.properties?.[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, def.objectType.properties ?? {}, 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 parameters: 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 ...Object.fromEntries(propertyParameters.map(p => [p, {\n type: \"parameterId\",\n parameterId: p\n }])),\n ...mappings\n },\n structFieldValues: {}\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(def.objectType.properties ?? {}), 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 });\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 { convertValidationRule, CREATE_OR_MODIFY_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, defineAction, kebab, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { isStruct } from \"./properties/PropertyTypeType.js\";\nexport function defineCreateOrModifyObjectAction(def) {\n validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);\n const propertiesWithDerivedDatasources = (def.objectType.datasources ?? []).filter(ds => ds.type === \"derived\").flatMap(ds => Object.keys(ds.propertyMapping));\n const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter(id => !Object.keys(def.nonParameterMappings ?? {}).includes(id) && !def.excludedProperties?.includes(id) && !isStruct(def.objectType.properties?.[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, def.objectType.properties ?? {}, parameterNames);\n parameters.forEach(p => {\n if (p.id !== CREATE_OR_MODIFY_OBJECT_PARAMETER && 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 parameters: parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"addOrModifyObjectRuleV2\",\n addOrModifyObjectRuleV2: {\n objectToModify: CREATE_OR_MODIFY_OBJECT_PARAMETER,\n propertyValues: {\n ...Object.fromEntries(propertyParameters.map(p => [p, {\n type: \"parameterId\",\n parameterId: p\n }])),\n ...mappings\n },\n structFieldValues: {}\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(def.objectType.properties ?? {}), 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 });\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 { defineAction, kebab } from \"./defineAction.js\";\nexport function defineDeleteInterfaceObjectAction(def) {\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 parameters: [{\n id: \"objectToDeleteParameter\",\n displayName: \"Delete object\",\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 status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: \"objectToDeleteParameter\"\n }\n }],\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: []\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 { convertValidationRule, defineAction, kebab } from \"./defineAction.js\";\nexport function defineDeleteObjectAction(def) {\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 parameters: [{\n id: \"objectToDeleteParameter\",\n displayName: \"Delete object\",\n type: {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: def.objectType.apiName\n }\n },\n validation: {\n required: true,\n allowedValues: {\n type: \"objectQuery\"\n }\n }\n }],\n status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: \"objectToDeleteParameter\"\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 });\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 { namespace, ontologyDefinition, updateOntology } from \"./defineOntology.js\";\nimport { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldNotHaveRenderHints } from \"./propertyConversionUtils.js\";\nexport function defineSharedPropertyType(sptDef) {\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 updateOntology(fullSpt);\n return fullSpt;\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 default:\n throw new Error(`Invalid status type: ${status.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\nexport function combineApiNamespaceIfMissing(namespace, apiName) {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\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 { namespace, ontologyDefinition, updateOntology, withoutNamespace } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nimport { mapSimplifiedStatusToInterfaceTypeStatus } from \"./interface/mapSimplifiedStatusToInterfaceTypeStatus.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nimport { isPropertyTypeType } from \"./properties/PropertyTypeType.js\";\nexport function defineInterface(interfaceDef) {\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 const properties = Object.fromEntries(Object.entries(interfaceDef.properties ?? {}).map(([unNamespacedPropApiName, type]) => {\n if (typeof type === \"object\" && \"propertyDefinition\" in type) {\n // If the property is an imported SPT, use the SPT's apiName\n const apiName = combineApiNamespaceIfMissing(namespace, typeof type.propertyDefinition === \"object\" && \"apiName\" in type.propertyDefinition ? type.propertyDefinition.apiName : unNamespacedPropApiName);\n return [apiName, {\n required: type.required,\n sharedPropertyType: unifyBasePropertyDefinition(namespace, unNamespacedPropApiName, type.propertyDefinition)\n }];\n }\n\n // If the property is an imported SPT, use the SPT's apiName\n const apiName = combineApiNamespaceIfMissing(namespace, typeof type === \"object\" && \"apiName\" in type ? type.apiName : unNamespacedPropApiName);\n return [apiName, {\n required: true,\n sharedPropertyType: unifyBasePropertyDefinition(namespace, unNamespacedPropApiName, type)\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 links: [],\n status,\n propertiesV2: properties,\n searchable: interfaceDef.searchable ?? true,\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE\n };\n updateOntology(fullInterface);\n return fullInterface;\n}\nfunction unifyBasePropertyDefinition(namespace, apiName, type) {\n if (typeof type === \"string\" || typeof type === \"object\" && !(\"apiName\" in type)) {\n !isPropertyTypeType(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 const spt = defineSharedPropertyType({\n apiName,\n displayName: apiName,\n type,\n array: false\n });\n return spt;\n } else {\n const unNamespacedTypeApiName = withoutNamespace(type.apiName);\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}","/*\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 { namespace, withoutNamespace } from \"./defineOntology.js\";\nimport { combineApiNamespaceIfMissing } from \"./namespace/combineApiNamespaceIfMissing.js\";\nexport function defineInterfaceLinkConstraint(linkDef) {\n const fromLinkMeta = getLinkMeta(linkDef);\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 linkDef.from.links.push({\n cardinality: linkDef.toMany ? \"MANY\" : \"SINGLE\",\n linkedEntityTypeId: getLinkedType(linkDef.toMany ?? linkDef.toOne),\n metadata: fromLinkMeta,\n required: linkDef.required ?? true\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 { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { convertToPluralDisplayName, uppercaseFirstLetter } from \"./defineObject.js\";\nimport { updateOntology } from \"./defineOntology.js\";\nexport function defineLink(linkDefinition) {\n // NOTE: we would normally do validation here, but because of circular dependencies\n // we have to wait to validate until everything has been defined. The code for validation\n // was moved to convertLink.ts.\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 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 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: []\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 { addNamespaceToActionDefinition, convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, isPropertyParameter, kebab, MODIFY_INTERFACE_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nexport function defineModifyInterfaceObjectAction(def) {\n addNamespaceToActionDefinition(def);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);\n const propertyParameters = Object.keys(allProperties).filter(apiName => isPropertyParameter(def, apiName, allProperties[apiName].sharedPropertyType.type));\n const parameterNames = new Set(propertyParameters);\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, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.sharedPropertyType])), parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required])));\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.interfaceType.displayMetadata.displayName}`,\n parameters: 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 interfaceObjectToModifyParameter: \"interfaceObjectToModifyParameter\",\n sharedPropertyValues: {\n ...Object.fromEntries(propertyParameters.map(id => [id, {\n type: \"parameterId\",\n parameterId: id\n }])),\n ...mappings\n }\n }\n }],\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(allProperties), 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 });\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 { convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, isPropertyParameter, kebab, MODIFY_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from \"./defineAction.js\";\nexport function defineModifyObjectAction(def) {\n validateActionParameters(def, Object.keys(def.objectType.properties ?? {}), def.objectType.apiName);\n const propertyParameters = Object.keys(def.objectType.properties ?? {}).filter(id => isPropertyParameter(def, id, def.objectType.properties?.[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, def.objectType.properties ?? {}, parameterNames);\n parameters.forEach(p => {\n if (p.id !== MODIFY_OBJECT_PARAMETER && 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 parameters: parameters,\n status: def.status ?? \"active\",\n rules: [{\n type: \"modifyObjectRule\",\n modifyObjectRule: {\n objectToModify: MODIFY_OBJECT_PARAMETER,\n propertyValues: {\n ...Object.fromEntries(propertyParameters.map(p => [p, {\n type: \"parameterId\",\n parameterId: p\n }])),\n ...mappings\n },\n structFieldValues: {}\n }\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.objectType.apiName],\n affectedLinkTypes: [],\n typeGroups: []\n },\n parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(def.objectType.properties ?? {}), 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 });\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 { namespace, updateOntology } from \"./defineOntology.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(valueTypeDef) {\n const {\n apiName,\n displayName,\n description,\n type,\n version\n } = valueTypeDef;\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-]+)*))?)$/;\n !semverValidation.test(version) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Version is not a valid semver\") : 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: {\n type: \"active\",\n active: {}\n },\n version: version,\n baseType: baseType,\n constraints: constraints,\n exampleValues: [],\n __type: OntologyEntityTypeEnum.VALUE_TYPE\n };\n updateOntology(vt);\n return vt;\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 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}"]}