@osdk/maker 0.15.0-beta.6 → 0.15.0-beta.8

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 (188) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +26 -22
  3. package/build/browser/api/action/ActionParameter.js.map +1 -1
  4. package/build/browser/api/action/ActionParameterConfiguration.js.map +1 -1
  5. package/build/browser/api/defineAction.js +65 -22
  6. package/build/browser/api/defineAction.js.map +1 -1
  7. package/build/browser/api/defineCreateInterfaceObjectAction.js +28 -8
  8. package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
  9. package/build/browser/api/defineInterface.js +40 -34
  10. package/build/browser/api/defineInterface.js.map +1 -1
  11. package/build/browser/api/defineModifyInterfaceObjectAction.js +31 -8
  12. package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
  13. package/build/browser/api/defineObject.js +13 -9
  14. package/build/browser/api/defineObject.js.map +1 -1
  15. package/build/browser/api/defineOntology.js +6 -0
  16. package/build/browser/api/defineOntology.js.map +1 -1
  17. package/build/browser/api/defineSpt.js.map +1 -1
  18. package/build/browser/api/defineValueType.js +17 -4
  19. package/build/browser/api/defineValueType.js.map +1 -1
  20. package/build/browser/api/interface/InterfacePropertyType.js +22 -1
  21. package/build/browser/api/interface/InterfacePropertyType.js.map +1 -1
  22. package/build/browser/api/interface/InterfaceType.js.map +1 -1
  23. package/build/browser/api/interface/getFlattenedInterfaceProperties.js +9 -3
  24. package/build/browser/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
  25. package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
  26. package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
  27. package/build/browser/api/links/LinkType.js.map +1 -1
  28. package/build/browser/api/object/ObjectType.js.map +1 -1
  29. package/build/browser/api/object/ObjectTypeDefinition.js.map +1 -1
  30. package/build/browser/api/object/ObjectTypeStatus.js.map +1 -1
  31. package/build/browser/api/properties/PropertyTypeType.js +1 -1
  32. package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
  33. package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
  34. package/build/browser/api/test/actions.test.js +6105 -5850
  35. package/build/browser/api/test/actions.test.js.map +1 -1
  36. package/build/browser/api/test/interfaces.test.js +757 -492
  37. package/build/browser/api/test/interfaces.test.js.map +1 -1
  38. package/build/browser/api/test/links.test.js +1334 -1325
  39. package/build/browser/api/test/links.test.js.map +1 -1
  40. package/build/browser/api/test/misc.test.js +262 -11
  41. package/build/browser/api/test/misc.test.js.map +1 -1
  42. package/build/browser/api/test/objects.test.js +1019 -960
  43. package/build/browser/api/test/objects.test.js.map +1 -1
  44. package/build/browser/api/test/spt.test.js +250 -103
  45. package/build/browser/api/test/spt.test.js.map +1 -1
  46. package/build/browser/api/test/valueTypes.test.js +69 -0
  47. package/build/browser/api/test/valueTypes.test.js.map +1 -1
  48. package/build/browser/cli/main.js +1 -1
  49. package/build/browser/conversion/toMarketplace/convertActionValidation.js +1 -1
  50. package/build/browser/conversion/toMarketplace/convertActionValidation.js.map +1 -1
  51. package/build/browser/conversion/toMarketplace/convertInterface.js +2 -2
  52. package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
  53. package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
  54. package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
  55. package/build/browser/conversion/toMarketplace/convertLink.js +30 -4
  56. package/build/browser/conversion/toMarketplace/convertLink.js.map +1 -1
  57. package/build/browser/conversion/toMarketplace/convertMappingValue.js +35 -0
  58. package/build/browser/conversion/toMarketplace/convertMappingValue.js.map +1 -1
  59. package/build/browser/conversion/toMarketplace/convertObject.js +4 -2
  60. package/build/browser/conversion/toMarketplace/convertObject.js.map +1 -1
  61. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
  62. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  63. package/build/browser/conversion/toMarketplace/convertSpt.js +4 -2
  64. package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
  65. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
  66. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
  67. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
  68. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  69. package/build/browser/index.js.map +1 -1
  70. package/build/cjs/index.cjs +444 -117
  71. package/build/cjs/index.cjs.map +1 -1
  72. package/build/cjs/index.d.cts +53 -17
  73. package/build/esm/api/action/ActionParameter.js.map +1 -1
  74. package/build/esm/api/action/ActionParameterConfiguration.js.map +1 -1
  75. package/build/esm/api/defineAction.js +65 -22
  76. package/build/esm/api/defineAction.js.map +1 -1
  77. package/build/esm/api/defineCreateInterfaceObjectAction.js +28 -8
  78. package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
  79. package/build/esm/api/defineInterface.js +40 -34
  80. package/build/esm/api/defineInterface.js.map +1 -1
  81. package/build/esm/api/defineModifyInterfaceObjectAction.js +31 -8
  82. package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
  83. package/build/esm/api/defineObject.js +13 -9
  84. package/build/esm/api/defineObject.js.map +1 -1
  85. package/build/esm/api/defineOntology.js +6 -0
  86. package/build/esm/api/defineOntology.js.map +1 -1
  87. package/build/esm/api/defineSpt.js.map +1 -1
  88. package/build/esm/api/defineValueType.js +17 -4
  89. package/build/esm/api/defineValueType.js.map +1 -1
  90. package/build/esm/api/interface/InterfacePropertyType.js +22 -1
  91. package/build/esm/api/interface/InterfacePropertyType.js.map +1 -1
  92. package/build/esm/api/interface/InterfaceType.js.map +1 -1
  93. package/build/esm/api/interface/getFlattenedInterfaceProperties.js +9 -3
  94. package/build/esm/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
  95. package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
  96. package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
  97. package/build/esm/api/links/LinkType.js.map +1 -1
  98. package/build/esm/api/object/ObjectType.js.map +1 -1
  99. package/build/esm/api/object/ObjectTypeDefinition.js.map +1 -1
  100. package/build/esm/api/object/ObjectTypeStatus.js.map +1 -1
  101. package/build/esm/api/properties/PropertyTypeType.js +1 -1
  102. package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
  103. package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
  104. package/build/esm/api/test/actions.test.js +6105 -5850
  105. package/build/esm/api/test/actions.test.js.map +1 -1
  106. package/build/esm/api/test/interfaces.test.js +757 -492
  107. package/build/esm/api/test/interfaces.test.js.map +1 -1
  108. package/build/esm/api/test/links.test.js +1334 -1325
  109. package/build/esm/api/test/links.test.js.map +1 -1
  110. package/build/esm/api/test/misc.test.js +262 -11
  111. package/build/esm/api/test/misc.test.js.map +1 -1
  112. package/build/esm/api/test/objects.test.js +1019 -960
  113. package/build/esm/api/test/objects.test.js.map +1 -1
  114. package/build/esm/api/test/spt.test.js +250 -103
  115. package/build/esm/api/test/spt.test.js.map +1 -1
  116. package/build/esm/api/test/valueTypes.test.js +69 -0
  117. package/build/esm/api/test/valueTypes.test.js.map +1 -1
  118. package/build/esm/cli/main.js +1 -1
  119. package/build/esm/conversion/toMarketplace/convertActionValidation.js +1 -1
  120. package/build/esm/conversion/toMarketplace/convertActionValidation.js.map +1 -1
  121. package/build/esm/conversion/toMarketplace/convertInterface.js +2 -2
  122. package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
  123. package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
  124. package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
  125. package/build/esm/conversion/toMarketplace/convertLink.js +30 -4
  126. package/build/esm/conversion/toMarketplace/convertLink.js.map +1 -1
  127. package/build/esm/conversion/toMarketplace/convertMappingValue.js +35 -0
  128. package/build/esm/conversion/toMarketplace/convertMappingValue.js.map +1 -1
  129. package/build/esm/conversion/toMarketplace/convertObject.js +4 -2
  130. package/build/esm/conversion/toMarketplace/convertObject.js.map +1 -1
  131. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
  132. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  133. package/build/esm/conversion/toMarketplace/convertSpt.js +4 -2
  134. package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
  135. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
  136. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
  137. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
  138. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  139. package/build/esm/index.js.map +1 -1
  140. package/build/types/api/action/ActionParameter.d.ts +2 -1
  141. package/build/types/api/action/ActionParameter.d.ts.map +1 -1
  142. package/build/types/api/action/ActionParameterConfiguration.d.ts +2 -1
  143. package/build/types/api/action/ActionParameterConfiguration.d.ts.map +1 -1
  144. package/build/types/api/defineAction.d.ts +4 -3
  145. package/build/types/api/defineAction.d.ts.map +1 -1
  146. package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
  147. package/build/types/api/defineInterface.d.ts +7 -5
  148. package/build/types/api/defineInterface.d.ts.map +1 -1
  149. package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
  150. package/build/types/api/defineObject.d.ts.map +1 -1
  151. package/build/types/api/defineOntology.d.ts.map +1 -1
  152. package/build/types/api/defineSpt.d.ts +3 -0
  153. package/build/types/api/defineSpt.d.ts.map +1 -1
  154. package/build/types/api/defineValueType.d.ts +9 -0
  155. package/build/types/api/defineValueType.d.ts.map +1 -1
  156. package/build/types/api/interface/InterfacePropertyType.d.ts +12 -2
  157. package/build/types/api/interface/InterfacePropertyType.d.ts.map +1 -1
  158. package/build/types/api/interface/InterfaceType.d.ts +3 -2
  159. package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
  160. package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts +1 -1
  161. package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts.map +1 -1
  162. package/build/types/api/links/LinkType.d.ts +16 -4
  163. package/build/types/api/links/LinkType.d.ts.map +1 -1
  164. package/build/types/api/object/ObjectType.d.ts +1 -0
  165. package/build/types/api/object/ObjectType.d.ts.map +1 -1
  166. package/build/types/api/object/ObjectTypeDefinition.d.ts +1 -0
  167. package/build/types/api/object/ObjectTypeDefinition.d.ts.map +1 -1
  168. package/build/types/api/object/ObjectTypeStatus.d.ts +1 -1
  169. package/build/types/api/object/ObjectTypeStatus.d.ts.map +1 -1
  170. package/build/types/api/properties/PropertyTypeType.d.ts +1 -0
  171. package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
  172. package/build/types/api/properties/SharedPropertyType.d.ts +1 -0
  173. package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
  174. package/build/types/conversion/toMarketplace/convertInterface.d.ts.map +1 -1
  175. package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts +3 -0
  176. package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts.map +1 -0
  177. package/build/types/conversion/toMarketplace/convertLink.d.ts +3 -2
  178. package/build/types/conversion/toMarketplace/convertLink.d.ts.map +1 -1
  179. package/build/types/conversion/toMarketplace/convertMappingValue.d.ts +2 -1
  180. package/build/types/conversion/toMarketplace/convertMappingValue.d.ts.map +1 -1
  181. package/build/types/conversion/toMarketplace/convertObject.d.ts.map +1 -1
  182. package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
  183. package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
  184. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts +3 -0
  185. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts.map +1 -0
  186. package/build/types/index.d.ts +1 -0
  187. package/build/types/index.d.ts.map +1 -1
  188. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"defineOntology.js","names":["fs","path","convertActionParameters","convertActionSections","convertActionValidation","convertOntologyDefinition","convertOntologyToValueTypeIr","getFormContentOrdering","createCodeSnippets","OntologyEntityTypeEnum","ontologyDefinition","importedTypes","dependencies","namespace","updateOntology","entity","__type","VALUE_TYPE","apiName","undefined","push","defineOntology","ns","body","outputDir","dependencyFile","codeSnippetFiles","snippetPackageName","snippetFileOutputDir","randomnessKey","OBJECT_TYPE","ACTION_TYPE","LINK_TYPE","INTERFACE_TYPE","SHARED_PROPERTY_TYPE","e","console","error","writeStaticObjects","writeDependencyFile","codegenDir","resolve","typeDirs","existsSync","mkdirSync","recursive","Object","values","forEach","typeDirNameFromMap","currentTypeDirPath","join","rmSync","force","topLevelExportStatements","entries","ontologyTypeEnumKey","entities","typeDirName","typeDirPath","entityModuleNames","entityFileNameBase","camel","withoutNamespace","filePath","entityTypeName","getEntityTypeName","entityJSON","JSON","stringify","replace","_","prefix","value","content","slice","writeFileSync","flag","entityModuleName","length","mainIndexContent","dependencyInjectionString","mainIndexFilePath","buildDatasource","definition","classificationMarkingGroupName","mandatoryMarkingGroupName","needsSecurity","securityConfig","classificationConstraint","markingGroupName","markingConstraint","datasourceName","datasource","editsConfiguration","onlyAllowPrivilegedEdits","redacted","dataSecurity","cleanAndValidateLinkTypeId","step1","linkTypeId","toLowerCase","test","Error","dumpOntologyFullMetadata","dumpValueTypeWireType","convertObjectStatus","status","type","active","experimental","deprecated","message","deadline","replacedBy","convertAction","action","actionValidation","actionParameters","actionSections","parameterOrdering","parameters","map","p","id","actionType","actionTypeLogic","logic","rules","validation","metadata","displayMetadata","configuration","defaultLayout","defaultFormat","displayAndFormat","table","columnWidthByParameterRid","enableFileImport","fitHorizontally","frozenColumnCount","rowHeightInLines","enableLayoutUserSwitch","enableLayoutSwitch","description","displayName","icon","blueprint","locator","color","successMessage","submissionMetadata","typeClasses","submitButtonDisplayMetadata","undoButtonConfiguration","formContentOrdering","sections","extractAllowedValues","allowedValues","oneOf","labelledValues","otherValueAllowed","allowed","min","max","range","minimum","inclusive","maximum","minLength","maxLength","regex","text","failureMessage","datetime","objectTypeReference","interfaceTypeRids","interfaceTypes","geotimeSeriesReference","geotimeSeries","user","filter","fromGroups","group","groupFilter","groupId","staticValue","string","name","parameterId","parameter","multipassGroup","k","renderHintFromBaseType","checkbox","numericInput","userDropdown","textInput","dateTimePicker","filePicker","mandatoryMarkingPicker","cbacMarkingPicker","dropdown","extractNamespace","substring","lastIndexOf","lastDot","str","result","c","toUpperCase","charAt","namespaceNoDot","endsWith","addNamespaceIfNone","includes"],"sources":["defineOntology.ts"],"sourcesContent":["/*\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 type {\n ActionTypeStatus,\n OntologyIr,\n OntologyIrActionTypeBlockDataV2,\n OntologyIrAllowedParameterValues,\n OntologyIrObjectTypeDatasource,\n OntologyIrObjectTypeDatasourceDefinition,\n OntologyIrParameter,\n OntologyIrSection,\n OntologyIrValueTypeBlockData,\n ParameterId,\n ParameterRenderHint,\n SectionId,\n} from \"@osdk/client.unstable\";\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 type {\n ActionParameter,\n ActionParameterValidation,\n} from \"./action/ActionParameter.js\";\nimport type { ActionParameterAllowedValues } from \"./action/ActionParameterAllowedValues.js\";\nimport type { ActionType } from \"./action/ActionType.js\";\nimport { createCodeSnippets } from \"./code-snippets/createCodeSnippets.js\";\nimport type { OntologyDefinition } from \"./common/OntologyDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport type { OntologyEntityType } from \"./common/OntologyEntityTypeMapping.js\";\n\n// type -> apiName -> entity\n/** @internal */\nexport let ontologyDefinition: OntologyDefinition;\n\n// type -> apiName -> entity\n/** @internal */\nexport let importedTypes: OntologyDefinition;\n\n// namespace -> version\n/** @internal */\nexport let dependencies: Record<string, string>;\n\n/** @internal */\nexport let namespace: string;\n\nexport function updateOntology<\n T extends OntologyEntityType,\n>(\n entity: T,\n): void {\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 (\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName]\n === undefined\n ) {\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName] = [];\n }\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName]\n .push(entity);\n}\n\nexport async function defineOntology(\n ns: string,\n body: () => void | Promise<void>,\n outputDir: string | undefined,\n dependencyFile?: string,\n codeSnippetFiles?: boolean,\n snippetPackageName?: string,\n snippetFileOutputDir?: string,\n randomnessKey?: string,\n): Promise<OntologyIr> {\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(\n \"Unexpected error while processing the body of the ontology\",\n e,\n );\n throw e;\n }\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\n }\n if (codeSnippetFiles) {\n createCodeSnippets(\n ontologyDefinition,\n snippetPackageName,\n snippetFileOutputDir,\n );\n }\n\n return convertOntologyDefinition(ontologyDefinition, randomnessKey);\n}\n\nexport function writeStaticObjects(outputDir: string): void {\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\n if (!fs.existsSync(codegenDir)) {\n fs.mkdirSync(codegenDir, { 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, { recursive: true, force: true });\n }\n fs.mkdirSync(currentTypeDirPath, { recursive: true });\n });\n\n const topLevelExportStatements: string[] = [];\n\n Object.entries(ontologyDefinition).forEach(\n ([ontologyTypeEnumKey, entities]) => {\n const typeDirName =\n typeDirs[ontologyTypeEnumKey as OntologyEntityTypeEnum];\n\n const typeDirPath = path.join(codegenDir, typeDirName);\n const entityModuleNames: string[] = [];\n\n Object.entries(entities).forEach(\n ([apiName, entity]: [string, OntologyEntityType]) => {\n const entityFileNameBase = camel(withoutNamespace(apiName))\n + (ontologyTypeEnumKey as OntologyEntityTypeEnum\n === OntologyEntityTypeEnum.VALUE_TYPE\n ? \"ValueType\"\n : \"\");\n const filePath = path.join(typeDirPath, `${entityFileNameBase}.ts`);\n const entityTypeName = getEntityTypeName(ontologyTypeEnumKey);\n const entityJSON = JSON.stringify(entity, null, 2).replace(\n /(\"__type\"\\s*:\\s*)\"([^\"]*)\"/g,\n (_, prefix, value) => `${prefix}OntologyEntityTypeEnum.${value}`,\n );\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} = ${\n ontologyTypeEnumKey === \"VALUE_TYPE\"\n ? entityJSON.slice(1, -2)\n : entityJSON\n } as unknown as ${entityTypeName};\n \nexport const ${entityFileNameBase}: ${entityTypeName} = wrapWithProxy(${entityFileNameBase}_base);\n `;\n fs.writeFileSync(filePath, content, { flag: \"w\" });\n entityModuleNames.push(entityFileNameBase);\n },\n );\n\n for (const entityModuleName of entityModuleNames) {\n topLevelExportStatements.push(\n `export { ${entityModuleName} } from \"./codegen/${typeDirName}/${entityModuleName}.js\";`,\n );\n }\n },\n );\n\n if (topLevelExportStatements.length > 0) {\n const mainIndexContent = dependencyInjectionString()\n + topLevelExportStatements.join(\"\\n\") + \"\\n\";\n const mainIndexFilePath = path.join(outputDir, \"index.ts\");\n fs.writeFileSync(mainIndexFilePath, mainIndexContent, { flag: \"w\" });\n }\n}\n\nexport function buildDatasource(\n apiName: string,\n definition: OntologyIrObjectTypeDatasourceDefinition,\n classificationMarkingGroupName?: string,\n mandatoryMarkingGroupName?: string,\n): OntologyIrObjectTypeDatasource {\n const needsSecurity = classificationMarkingGroupName !== undefined\n || mandatoryMarkingGroupName !== undefined;\n\n const securityConfig = needsSecurity\n ? {\n classificationConstraint: classificationMarkingGroupName\n ? {\n markingGroupName: classificationMarkingGroupName,\n }\n : undefined,\n markingConstraint: mandatoryMarkingGroupName\n ? {\n markingGroupName: mandatoryMarkingGroupName,\n }\n : undefined,\n }\n : undefined;\n return ({\n datasourceName: apiName,\n datasource: definition,\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false,\n },\n redacted: false,\n ...((securityConfig !== undefined) && { dataSecurity: securityConfig }),\n });\n}\n\nexport function cleanAndValidateLinkTypeId(apiName: string): string {\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\")\n .toLowerCase();\n\n const VALIDATION_PATTERN = /^([a-z][a-z0-9\\-]*)$/;\n if (!VALIDATION_PATTERN.test(linkTypeId)) {\n throw new Error(\n `LinkType id '${linkTypeId}' must be lower case with dashes.`,\n );\n }\n return linkTypeId;\n}\n\nexport function dumpOntologyFullMetadata(): OntologyIr {\n return convertOntologyDefinition(ontologyDefinition);\n}\n\nexport function dumpValueTypeWireType(): OntologyIrValueTypeBlockData {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\n\nexport function convertObjectStatus(status: any): any {\n if (status === undefined) {\n return {\n type: \"active\",\n active: {},\n };\n }\n\n if (status === \"active\") {\n return {\n type: \"active\",\n active: {},\n };\n }\n\n if (status === \"experimental\") {\n return {\n type: \"experimental\",\n experimental: {},\n };\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\n return status;\n}\n\nexport function convertAction(\n action: ActionType,\n): OntologyIrActionTypeBlockDataV2 {\n const actionValidation = convertActionValidation(action);\n const actionParameters: Record<ParameterId, OntologyIrParameter> =\n convertActionParameters(action);\n const actionSections: Record<SectionId, OntologyIrSection> =\n convertActionSections(action);\n const parameterOrdering = action.parameterOrdering\n ?? (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 ?? { locator: \"edit\", color: \"#000000\" },\n },\n successMessage: action.submissionMetadata?.successMessage\n ? [{\n type: \"message\",\n message: action.submissionMetadata.successMessage,\n }]\n : [],\n typeClasses: action.typeClasses ?? [],\n ...(action.submissionMetadata?.submitButtonDisplayMetadata\n && {\n submitButtonDisplayMetadata:\n action.submissionMetadata.submitButtonDisplayMetadata,\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration\n && {\n undoButtonConfiguration:\n 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 ? {\n type: action.status,\n [action.status]: {},\n } as unknown as ActionTypeStatus\n : action.status,\n entities: action.entities,\n },\n },\n };\n}\n\nexport function extractAllowedValues(\n allowedValues: ActionParameterAllowedValues,\n): OntologyIrAllowedParameterValues {\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\n ?? false,\n },\n },\n },\n };\n case \"range\":\n const { min, max } = allowedValues;\n return {\n type: \"range\",\n range: {\n type: \"range\",\n range: {\n ...(min === undefined\n ? {}\n : { minimum: { inclusive: true, value: min } }),\n ...(max === undefined\n ? {}\n : { maximum: { inclusive: true, value: max } }),\n },\n },\n };\n case \"text\":\n const { minLength, maxLength, regex } = allowedValues;\n return {\n type: \"text\",\n text: {\n type: \"text\",\n text: {\n ...(minLength === undefined\n ? {}\n : { minLength: minLength }),\n ...(maxLength === undefined\n ? {}\n : { maxLength: maxLength }),\n ...(regex === undefined\n ? {}\n : { regex: { regex: regex, failureMessage: \"Invalid input\" } }),\n },\n },\n };\n case \"datetime\":\n const { minimum, maximum } = allowedValues;\n return {\n type: \"datetime\",\n datetime: {\n type: \"datetime\",\n datetime: {\n minimum,\n maximum,\n },\n },\n };\n case \"objectTypeReference\":\n return {\n type: \"objectTypeReference\",\n objectTypeReference: {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: allowedValues.interfaceTypes,\n },\n },\n };\n case \"redacted\":\n return {\n type: \"redacted\",\n redacted: {},\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {\n type: \"geotimeSeries\",\n geotimeSeries: {},\n },\n };\n case \"user\":\n return {\n type: \"user\",\n user: {\n type: \"user\",\n user: {\n filter: (allowedValues.fromGroups ?? []).map(group => {\n return {\n type: \"groupFilter\",\n groupFilter: {\n groupId: group.type === \"static\"\n ? {\n type: \"staticValue\",\n staticValue: {\n type: \"string\",\n string: group.name,\n },\n }\n : {\n type: \"parameterId\",\n parameterId: group.parameter,\n },\n },\n };\n }),\n },\n },\n };\n case \"multipassGroup\":\n return {\n type: \"multipassGroup\",\n multipassGroup: {\n type: \"group\",\n group: {},\n },\n };\n default:\n const k: Partial<OntologyIrAllowedParameterValues[\"type\"]> =\n allowedValues.type;\n return {\n type: k,\n [k]: {\n type: k,\n [k]: {},\n },\n } as unknown as OntologyIrAllowedParameterValues;\n // TODO(dpaquin): there's probably a TS clean way to do this\n }\n}\n\nexport function renderHintFromBaseType(\n parameter: ActionParameter,\n validation?: ActionParameterValidation,\n): ParameterRenderHint {\n // TODO(dpaquin): these are just guesses, we should find where they're actually defined\n const type = typeof parameter.type === \"string\"\n ? parameter.type\n : parameter.type.type;\n switch (type) {\n case \"boolean\":\n case \"booleanList\":\n return { type: \"checkbox\", checkbox: {} };\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 { type: \"numericInput\", numericInput: {} };\n case \"string\":\n if (\n validation?.allowedValues?.type === \"user\"\n || validation?.allowedValues?.type === \"multipassGroup\"\n ) {\n return { type: \"userDropdown\", userDropdown: {} };\n }\n case \"stringList\":\n case \"geohash\":\n case \"geohashList\":\n case \"geoshape\":\n case \"geoshapeList\":\n case \"objectSetRid\":\n return { type: \"textInput\", textInput: {} };\n case \"timestamp\":\n case \"timestampList\":\n case \"date\":\n case \"dateList\":\n return { type: \"dateTimePicker\", dateTimePicker: {} };\n case \"attachment\":\n case \"attachmentList\":\n return { type: \"filePicker\", filePicker: {} };\n case \"marking\":\n case \"markingList\":\n if (parameter.validation.allowedValues?.type === \"mandatoryMarking\") {\n return { type: \"mandatoryMarkingPicker\", mandatoryMarkingPicker: {} };\n } else if (parameter.validation.allowedValues?.type === \"cbacMarking\") {\n return { type: \"cbacMarkingPicker\", cbacMarkingPicker: {} };\n } else {\n throw new Error(\n `The allowed values for \"${parameter.displayName}\" are not compatible with the base parameter type`,\n );\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 { type: \"dropdown\", dropdown: {} };\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}\n\nexport function extractNamespace(apiName: string): string {\n return apiName.substring(0, apiName.lastIndexOf(\".\") + 1);\n}\n\nexport function withoutNamespace(apiName: string): string {\n const lastDot = apiName.lastIndexOf(\".\");\n if (lastDot === -1) {\n return apiName;\n }\n return apiName.substring(lastDot + 1);\n}\n\nfunction camel(str: string): string {\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: string): string {\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}\n\nfunction writeDependencyFile(dependencyFile: string): void {\n fs.writeFileSync(dependencyFile, JSON.stringify(dependencies, null, 2));\n}\n\nfunction dependencyInjectionString(): string {\n const namespaceNoDot: string = namespace.endsWith(\".\")\n ? namespace.slice(0, -1)\n : namespace;\n\n return `import { addDependency } from \"@osdk/maker\";\n// @ts-ignore\naddDependency(\"${namespaceNoDot}\", new URL(import.meta.url).pathname);\n`;\n}\n\nexport function addNamespaceIfNone(apiName: string): string {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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,GAAGL,SAAS,GAAGK,OAAO;AAC9D","ignoreList":[]}
1
+ {"version":3,"file":"defineOntology.js","names":["fs","path","convertActionParameters","convertActionSections","convertActionValidation","convertOntologyDefinition","convertOntologyToValueTypeIr","getFormContentOrdering","createCodeSnippets","OntologyEntityTypeEnum","ontologyDefinition","importedTypes","dependencies","namespace","updateOntology","entity","__type","VALUE_TYPE","apiName","undefined","push","defineOntology","ns","body","outputDir","dependencyFile","codeSnippetFiles","snippetPackageName","snippetFileOutputDir","randomnessKey","OBJECT_TYPE","ACTION_TYPE","LINK_TYPE","INTERFACE_TYPE","SHARED_PROPERTY_TYPE","e","console","error","writeStaticObjects","writeDependencyFile","codegenDir","resolve","typeDirs","existsSync","mkdirSync","recursive","Object","values","forEach","typeDirNameFromMap","currentTypeDirPath","join","rmSync","force","topLevelExportStatements","entries","ontologyTypeEnumKey","entities","typeDirName","typeDirPath","entityModuleNames","entityFileNameBase","camel","withoutNamespace","filePath","entityTypeName","getEntityTypeName","entityJSON","JSON","stringify","replace","_","prefix","value","content","slice","writeFileSync","flag","entityModuleName","length","mainIndexContent","dependencyInjectionString","mainIndexFilePath","buildDatasource","definition","classificationMarkingGroupName","mandatoryMarkingGroupName","needsSecurity","securityConfig","classificationConstraint","markingGroupName","markingConstraint","datasourceName","datasource","editsConfiguration","onlyAllowPrivilegedEdits","redacted","dataSecurity","cleanAndValidateLinkTypeId","step1","linkTypeId","toLowerCase","test","Error","dumpOntologyFullMetadata","dumpValueTypeWireType","convertObjectStatus","status","type","active","experimental","example","deprecated","message","deadline","replacedBy","convertAction","action","actionValidation","actionParameters","actionSections","parameterOrdering","parameters","map","p","id","actionType","actionTypeLogic","logic","rules","validation","metadata","displayMetadata","configuration","defaultLayout","defaultFormat","displayAndFormat","table","columnWidthByParameterRid","enableFileImport","fitHorizontally","frozenColumnCount","rowHeightInLines","enableLayoutUserSwitch","enableLayoutSwitch","description","displayName","icon","blueprint","locator","color","successMessage","submissionMetadata","typeClasses","submitButtonDisplayMetadata","undoButtonConfiguration","formContentOrdering","sections","extractAllowedValues","allowedValues","oneOf","labelledValues","otherValueAllowed","allowed","min","max","range","minimum","inclusive","maximum","minLength","maxLength","regex","text","failureMessage","datetime","objectTypeReference","interfaceTypeRids","interfaceTypes","geotimeSeriesReference","geotimeSeries","user","filter","fromGroups","group","groupFilter","groupId","staticValue","string","name","parameterId","parameter","multipassGroup","k","renderHintFromBaseType","checkbox","numericInput","userDropdown","textInput","dateTimePicker","filePicker","mandatoryMarkingPicker","cbacMarkingPicker","dropdown","extractNamespace","substring","lastIndexOf","lastDot","str","result","c","toUpperCase","charAt","namespaceNoDot","endsWith","addNamespaceIfNone","includes"],"sources":["defineOntology.ts"],"sourcesContent":["/*\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 type {\n ActionTypeStatus,\n OntologyIr,\n OntologyIrActionTypeBlockDataV2,\n OntologyIrAllowedParameterValues,\n OntologyIrObjectTypeDatasource,\n OntologyIrObjectTypeDatasourceDefinition,\n OntologyIrParameter,\n OntologyIrSection,\n OntologyIrValueTypeBlockData,\n ParameterId,\n ParameterRenderHint,\n SectionId,\n} from \"@osdk/client.unstable\";\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 type {\n ActionParameter,\n ActionParameterValidation,\n} from \"./action/ActionParameter.js\";\nimport type { ActionParameterAllowedValues } from \"./action/ActionParameterAllowedValues.js\";\nimport type { ActionType } from \"./action/ActionType.js\";\nimport { createCodeSnippets } from \"./code-snippets/createCodeSnippets.js\";\nimport type { OntologyDefinition } from \"./common/OntologyDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport type { OntologyEntityType } from \"./common/OntologyEntityTypeMapping.js\";\n\n// type -> apiName -> entity\n/** @internal */\nexport let ontologyDefinition: OntologyDefinition;\n\n// type -> apiName -> entity\n/** @internal */\nexport let importedTypes: OntologyDefinition;\n\n// namespace -> version\n/** @internal */\nexport let dependencies: Record<string, string>;\n\n/** @internal */\nexport let namespace: string;\n\nexport function updateOntology<\n T extends OntologyEntityType,\n>(\n entity: T,\n): void {\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 (\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName]\n === undefined\n ) {\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName] = [];\n }\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName]\n .push(entity);\n}\n\nexport async function defineOntology(\n ns: string,\n body: () => void | Promise<void>,\n outputDir: string | undefined,\n dependencyFile?: string,\n codeSnippetFiles?: boolean,\n snippetPackageName?: string,\n snippetFileOutputDir?: string,\n randomnessKey?: string,\n): Promise<OntologyIr> {\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(\n \"Unexpected error while processing the body of the ontology\",\n e,\n );\n throw e;\n }\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\n }\n if (codeSnippetFiles) {\n createCodeSnippets(\n ontologyDefinition,\n snippetPackageName,\n snippetFileOutputDir,\n );\n }\n\n return convertOntologyDefinition(ontologyDefinition, randomnessKey);\n}\n\nexport function writeStaticObjects(outputDir: string): void {\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\n if (!fs.existsSync(codegenDir)) {\n fs.mkdirSync(codegenDir, { 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, { recursive: true, force: true });\n }\n fs.mkdirSync(currentTypeDirPath, { recursive: true });\n });\n\n const topLevelExportStatements: string[] = [];\n\n Object.entries(ontologyDefinition).forEach(\n ([ontologyTypeEnumKey, entities]) => {\n const typeDirName =\n typeDirs[ontologyTypeEnumKey as OntologyEntityTypeEnum];\n\n const typeDirPath = path.join(codegenDir, typeDirName);\n const entityModuleNames: string[] = [];\n\n Object.entries(entities).forEach(\n ([apiName, entity]: [string, OntologyEntityType]) => {\n const entityFileNameBase = camel(withoutNamespace(apiName))\n + (ontologyTypeEnumKey as OntologyEntityTypeEnum\n === OntologyEntityTypeEnum.VALUE_TYPE\n ? \"ValueType\"\n : \"\");\n const filePath = path.join(typeDirPath, `${entityFileNameBase}.ts`);\n const entityTypeName = getEntityTypeName(ontologyTypeEnumKey);\n const entityJSON = JSON.stringify(entity, null, 2).replace(\n /(\"__type\"\\s*:\\s*)\"([^\"]*)\"/g,\n (_, prefix, value) => `${prefix}OntologyEntityTypeEnum.${value}`,\n );\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} = ${\n ontologyTypeEnumKey === \"VALUE_TYPE\"\n ? entityJSON.slice(1, -2)\n : entityJSON\n } as unknown as ${entityTypeName};\n \nexport const ${entityFileNameBase}: ${entityTypeName} = wrapWithProxy(${entityFileNameBase}_base);\n `;\n fs.writeFileSync(filePath, content, { flag: \"w\" });\n entityModuleNames.push(entityFileNameBase);\n },\n );\n\n for (const entityModuleName of entityModuleNames) {\n topLevelExportStatements.push(\n `export { ${entityModuleName} } from \"./codegen/${typeDirName}/${entityModuleName}.js\";`,\n );\n }\n },\n );\n\n if (topLevelExportStatements.length > 0) {\n const mainIndexContent = dependencyInjectionString()\n + topLevelExportStatements.join(\"\\n\") + \"\\n\";\n const mainIndexFilePath = path.join(outputDir, \"index.ts\");\n fs.writeFileSync(mainIndexFilePath, mainIndexContent, { flag: \"w\" });\n }\n}\n\nexport function buildDatasource(\n apiName: string,\n definition: OntologyIrObjectTypeDatasourceDefinition,\n classificationMarkingGroupName?: string,\n mandatoryMarkingGroupName?: string,\n): OntologyIrObjectTypeDatasource {\n const needsSecurity = classificationMarkingGroupName !== undefined\n || mandatoryMarkingGroupName !== undefined;\n\n const securityConfig = needsSecurity\n ? {\n classificationConstraint: classificationMarkingGroupName\n ? {\n markingGroupName: classificationMarkingGroupName,\n }\n : undefined,\n markingConstraint: mandatoryMarkingGroupName\n ? {\n markingGroupName: mandatoryMarkingGroupName,\n }\n : undefined,\n }\n : undefined;\n return ({\n datasourceName: apiName,\n datasource: definition,\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false,\n },\n redacted: false,\n ...((securityConfig !== undefined) && { dataSecurity: securityConfig }),\n });\n}\n\nexport function cleanAndValidateLinkTypeId(apiName: string): string {\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\")\n .toLowerCase();\n\n const VALIDATION_PATTERN = /^([a-z][a-z0-9\\-]*)$/;\n if (!VALIDATION_PATTERN.test(linkTypeId)) {\n throw new Error(\n `LinkType id '${linkTypeId}' must be lower case with dashes.`,\n );\n }\n return linkTypeId;\n}\n\nexport function dumpOntologyFullMetadata(): OntologyIr {\n return convertOntologyDefinition(ontologyDefinition);\n}\n\nexport function dumpValueTypeWireType(): OntologyIrValueTypeBlockData {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\n\nexport function convertObjectStatus(status: any): any {\n if (status === undefined) {\n return {\n type: \"active\",\n active: {},\n };\n }\n\n if (status === \"active\") {\n return {\n type: \"active\",\n active: {},\n };\n }\n\n if (status === \"experimental\") {\n return {\n type: \"experimental\",\n experimental: {},\n };\n }\n\n if (status === \"example\") {\n return {\n type: \"example\",\n example: {},\n };\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\n return status;\n}\n\nexport function convertAction(\n action: ActionType,\n): OntologyIrActionTypeBlockDataV2 {\n const actionValidation = convertActionValidation(action);\n const actionParameters: Record<ParameterId, OntologyIrParameter> =\n convertActionParameters(action);\n const actionSections: Record<SectionId, OntologyIrSection> =\n convertActionSections(action);\n const parameterOrdering = action.parameterOrdering\n ?? (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 ?? { locator: \"edit\", color: \"#000000\" },\n },\n successMessage: action.submissionMetadata?.successMessage\n ? [{\n type: \"message\",\n message: action.submissionMetadata.successMessage,\n }]\n : [],\n typeClasses: action.typeClasses ?? [],\n ...(action.submissionMetadata?.submitButtonDisplayMetadata\n && {\n submitButtonDisplayMetadata:\n action.submissionMetadata.submitButtonDisplayMetadata,\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration\n && {\n undoButtonConfiguration:\n 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 ? {\n type: action.status,\n [action.status]: {},\n } as unknown as ActionTypeStatus\n : action.status,\n entities: action.entities,\n },\n },\n };\n}\n\nexport function extractAllowedValues(\n allowedValues: ActionParameterAllowedValues,\n): OntologyIrAllowedParameterValues {\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\n ?? false,\n },\n },\n },\n };\n case \"range\":\n const { min, max } = allowedValues;\n return {\n type: \"range\",\n range: {\n type: \"range\",\n range: {\n ...(min === undefined\n ? {}\n : { minimum: { inclusive: true, value: min } }),\n ...(max === undefined\n ? {}\n : { maximum: { inclusive: true, value: max } }),\n },\n },\n };\n case \"text\":\n const { minLength, maxLength, regex } = allowedValues;\n return {\n type: \"text\",\n text: {\n type: \"text\",\n text: {\n ...(minLength === undefined\n ? {}\n : { minLength: minLength }),\n ...(maxLength === undefined\n ? {}\n : { maxLength: maxLength }),\n ...(regex === undefined\n ? {}\n : { regex: { regex: regex, failureMessage: \"Invalid input\" } }),\n },\n },\n };\n case \"datetime\":\n const { minimum, maximum } = allowedValues;\n return {\n type: \"datetime\",\n datetime: {\n type: \"datetime\",\n datetime: {\n minimum,\n maximum,\n },\n },\n };\n case \"objectTypeReference\":\n return {\n type: \"objectTypeReference\",\n objectTypeReference: {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: allowedValues.interfaceTypes,\n },\n },\n };\n case \"redacted\":\n return {\n type: \"redacted\",\n redacted: {},\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {\n type: \"geotimeSeries\",\n geotimeSeries: {},\n },\n };\n case \"user\":\n return {\n type: \"user\",\n user: {\n type: \"user\",\n user: {\n filter: (allowedValues.fromGroups ?? []).map(group => {\n return {\n type: \"groupFilter\",\n groupFilter: {\n groupId: group.type === \"static\"\n ? {\n type: \"staticValue\",\n staticValue: {\n type: \"string\",\n string: group.name,\n },\n }\n : {\n type: \"parameterId\",\n parameterId: group.parameter,\n },\n },\n };\n }),\n },\n },\n };\n case \"multipassGroup\":\n return {\n type: \"multipassGroup\",\n multipassGroup: {\n type: \"group\",\n group: {},\n },\n };\n default:\n const k: Partial<OntologyIrAllowedParameterValues[\"type\"]> =\n allowedValues.type;\n return {\n type: k,\n [k]: {\n type: k,\n [k]: {},\n },\n } as unknown as OntologyIrAllowedParameterValues;\n // TODO(dpaquin): there's probably a TS clean way to do this\n }\n}\n\nexport function renderHintFromBaseType(\n parameter: ActionParameter,\n validation?: ActionParameterValidation,\n): ParameterRenderHint {\n // TODO(dpaquin): these are just guesses, we should find where they're actually defined\n const type = typeof parameter.type === \"string\"\n ? parameter.type\n : parameter.type.type;\n switch (type) {\n case \"boolean\":\n case \"booleanList\":\n return { type: \"checkbox\", checkbox: {} };\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 { type: \"numericInput\", numericInput: {} };\n case \"string\":\n if (\n validation?.allowedValues?.type === \"user\"\n || validation?.allowedValues?.type === \"multipassGroup\"\n ) {\n return { type: \"userDropdown\", userDropdown: {} };\n }\n case \"stringList\":\n case \"geohash\":\n case \"geohashList\":\n case \"geoshape\":\n case \"geoshapeList\":\n case \"objectSetRid\":\n return { type: \"textInput\", textInput: {} };\n case \"timestamp\":\n case \"timestampList\":\n case \"date\":\n case \"dateList\":\n return { type: \"dateTimePicker\", dateTimePicker: {} };\n case \"attachment\":\n case \"attachmentList\":\n return { type: \"filePicker\", filePicker: {} };\n case \"marking\":\n case \"markingList\":\n if (parameter.validation.allowedValues?.type === \"mandatoryMarking\") {\n return { type: \"mandatoryMarkingPicker\", mandatoryMarkingPicker: {} };\n } else if (parameter.validation.allowedValues?.type === \"cbacMarking\") {\n return { type: \"cbacMarkingPicker\", cbacMarkingPicker: {} };\n } else {\n throw new Error(\n `The allowed values for \"${parameter.displayName}\" are not compatible with the base parameter type`,\n );\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 { type: \"dropdown\", dropdown: {} };\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}\n\nexport function extractNamespace(apiName: string): string {\n return apiName.substring(0, apiName.lastIndexOf(\".\") + 1);\n}\n\nexport function withoutNamespace(apiName: string): string {\n const lastDot = apiName.lastIndexOf(\".\");\n if (lastDot === -1) {\n return apiName;\n }\n return apiName.substring(lastDot + 1);\n}\n\nfunction camel(str: string): string {\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: string): string {\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}\n\nfunction writeDependencyFile(dependencyFile: string): void {\n fs.writeFileSync(dependencyFile, JSON.stringify(dependencies, null, 2));\n}\n\nfunction dependencyInjectionString(): string {\n const namespaceNoDot: string = namespace.endsWith(\".\")\n ? namespace.slice(0, -1)\n : namespace;\n\n return `import { addDependency } from \"@osdk/maker\";\n// @ts-ignore\naddDependency(\"${namespaceNoDot}\", new URL(import.meta.url).pathname);\n`;\n}\n\nexport function addNamespaceIfNone(apiName: string): string {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAO,KAAKA,EAAE,MAAM,I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AAO,CAACsM,QAAQ,CAAC,GAAG,CAAC,GAAGtM,OAAO,GAAGL,SAAS,GAAGK,OAAO;AAC9D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"defineSpt.js","names":["invariant","OntologyEntityTypeEnum","namespace","ontologyDefinition","updateOntology","defaultTypeClasses","getPropertyTypeName","hasRenderHints","shouldNotHaveRenderHints","defineSharedPropertyType","sptDef","apiName","SHARED_PROPERTY_TYPE","undefined","process","env","NODE_ENV","type","typeClasses","fullSpt","nonNameSpacedApiName","displayName","__type"],"sources":["defineSpt.ts"],"sourcesContent":["/*\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 type {\n OntologyIrBaseFormatter,\n OntologyIrValueTypeReferenceWithMetadata,\n SharedPropertyTypeGothamMapping,\n Visibility,\n} from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport {\n namespace,\n ontologyDefinition,\n updateOntology,\n} from \"./defineOntology.js\";\nimport { type PropertyTypeType } from \"./properties/PropertyTypeType.js\";\nimport { type SharedPropertyType } from \"./properties/SharedPropertyType.js\";\nimport {\n defaultTypeClasses,\n getPropertyTypeName,\n hasRenderHints,\n shouldNotHaveRenderHints,\n} from \"./propertyConversionUtils.js\";\n\nexport interface SharedPropertyTypeDefinition {\n apiName: string;\n type: PropertyTypeType;\n array?: boolean;\n description?: string;\n displayName?: string;\n valueType?: OntologyIrValueTypeReferenceWithMetadata;\n visibility?: Visibility;\n typeClasses?: SharedPropertyType[\"typeClasses\"];\n gothamMapping?: SharedPropertyTypeGothamMapping;\n baseFormatter?: OntologyIrBaseFormatter;\n}\n\nexport function defineSharedPropertyType(\n sptDef: SharedPropertyTypeDefinition,\n): SharedPropertyType {\n const apiName = namespace + sptDef.apiName;\n invariant(\n ontologyDefinition[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE][apiName]\n === undefined,\n `Shared property type ${apiName} already exists`,\n );\n\n invariant(\n !shouldNotHaveRenderHints(sptDef.type)\n || !hasRenderHints(sptDef.typeClasses),\n `Shared property type ${apiName} of type '${\n getPropertyTypeName(sptDef.type)\n }' should not have render hints`,\n );\n\n const fullSpt: SharedPropertyType = {\n ...sptDef,\n apiName,\n nonNameSpacedApiName: sptDef.apiName,\n displayName: sptDef.displayName ?? sptDef.apiName, // This way the non-namespaced api name is the display name (maybe not ideal)\n typeClasses: sptDef.typeClasses\n ?? (shouldNotHaveRenderHints(sptDef.type) ? [] : defaultTypeClasses),\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE,\n };\n updateOntology(fullSpt);\n return fullSpt;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SACEC,SAAS,EACTC,kBAAkB,EAClBC,cAAc,QACT,qBAAqB;AAG5B,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,wBAAwB,QACnB,8BAA8B;AAerC,OAAO,SAASC,wBAAwBA,CACtCC,MAAoC,EAChB;EACpB,MAAMC,OAAO,GAAGT,SAAS,GAAGQ,MAAM,CAACC,OAAO;EAC1C,EACER,kBAAkB,CAACF,sBAAsB,CAACW,oBAAoB,CAAC,CAACD,OAAO,CAAC,KAClEE,SAAS,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAFjBhB,SAAS,QAGP,wBAAwBW,OAAO,iBAAiB,IAHlDX,SAAS;EAMT,EACE,CAACQ,wBAAwB,CAACE,MAAM,CAACO,IAAI,CAAC,IACjC,CAACV,cAAc,CAACG,MAAM,CAACQ,WAAW,CAAC,IAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAF1ChB,SAAS,QAGP,wBAAwBW,OAAO,aAC7BL,mBAAmB,CAACI,MAAM,CAACO,IAAI,CAAC,gCACF,IALlCjB,SAAS;EAQT,MAAMmB,OAA2B,GAAG;IAClC,GAAGT,MAAM;IACTC,OAAO;IACPS,oBAAoB,EAAEV,MAAM,CAACC,OAAO;IACpCU,WAAW,EAAEX,MAAM,CAACW,WAAW,IAAIX,MAAM,CAACC,OAAO;IAAE;IACnDO,WAAW,EAAER,MAAM,CAACQ,WAAW,KACzBV,wBAAwB,CAACE,MAAM,CAACO,IAAI,CAAC,GAAG,EAAE,GAAGZ,kBAAkB,CAAC;IACtEiB,MAAM,EAAErB,sBAAsB,CAACW;EACjC,CAAC;EACDR,cAAc,CAACe,OAAO,CAAC;EACvB,OAAOA,OAAO;AAChB","ignoreList":[]}
1
+ {"version":3,"file":"defineSpt.js","names":["invariant","OntologyEntityTypeEnum","namespace","ontologyDefinition","updateOntology","defaultTypeClasses","getPropertyTypeName","hasRenderHints","shouldNotHaveRenderHints","defineSharedPropertyType","sptDef","apiName","SHARED_PROPERTY_TYPE","undefined","process","env","NODE_ENV","type","typeClasses","fullSpt","nonNameSpacedApiName","displayName","__type"],"sources":["defineSpt.ts"],"sourcesContent":["/*\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 type {\n OntologyIrBaseFormatter,\n OntologyIrValueTypeReferenceWithMetadata,\n SharedPropertyTypeGothamMapping,\n Visibility,\n} from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport {\n namespace,\n ontologyDefinition,\n updateOntology,\n} from \"./defineOntology.js\";\nimport type { Nullability } from \"./properties/Nullability.js\";\nimport { type PropertyTypeType } from \"./properties/PropertyTypeType.js\";\nimport { type SharedPropertyType } from \"./properties/SharedPropertyType.js\";\nimport {\n defaultTypeClasses,\n getPropertyTypeName,\n hasRenderHints,\n shouldNotHaveRenderHints,\n} from \"./propertyConversionUtils.js\";\n\nexport interface SharedPropertyTypeDefinition {\n apiName: string;\n type: PropertyTypeType;\n array?: boolean;\n description?: string;\n displayName?: string;\n valueType?: OntologyIrValueTypeReferenceWithMetadata;\n visibility?: Visibility;\n nullability?: Nullability;\n typeClasses?: SharedPropertyType[\"typeClasses\"];\n aliases?: Array<string>;\n gothamMapping?: SharedPropertyTypeGothamMapping;\n baseFormatter?: OntologyIrBaseFormatter;\n}\n\nexport function defineSharedPropertyType(\n sptDef: SharedPropertyTypeDefinition,\n): SharedPropertyType {\n const apiName = namespace + sptDef.apiName;\n invariant(\n ontologyDefinition[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE][apiName]\n === undefined,\n `Shared property type ${apiName} already exists`,\n );\n\n invariant(\n !shouldNotHaveRenderHints(sptDef.type)\n || !hasRenderHints(sptDef.typeClasses),\n `Shared property type ${apiName} of type '${\n getPropertyTypeName(sptDef.type)\n }' should not have render hints`,\n );\n\n const fullSpt: SharedPropertyType = {\n ...sptDef,\n apiName,\n nonNameSpacedApiName: sptDef.apiName,\n displayName: sptDef.displayName ?? sptDef.apiName, // This way the non-namespaced api name is the display name (maybe not ideal)\n typeClasses: sptDef.typeClasses\n ?? (shouldNotHaveRenderHints(sptDef.type) ? [] : defaultTypeClasses),\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE,\n };\n updateOntology(fullSpt);\n return fullSpt;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SACEC,SAAS,EACTC,kBAAkB,EAClBC,cAAc,QACT,qBAAqB;AAI5B,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,wBAAwB,QACnB,8BAA8B;AAiBrC,OAAO,SAASC,wBAAwBA,CACtCC,MAAoC,EAChB;EACpB,MAAMC,OAAO,GAAGT,SAAS,GAAGQ,MAAM,CAACC,OAAO;EAC1C,EACER,kBAAkB,CAACF,sBAAsB,CAACW,oBAAoB,CAAC,CAACD,OAAO,CAAC,KAClEE,SAAS,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAFjBhB,SAAS,QAGP,wBAAwBW,OAAO,iBAAiB,IAHlDX,SAAS;EAMT,EACE,CAACQ,wBAAwB,CAACE,MAAM,CAACO,IAAI,CAAC,IACjC,CAACV,cAAc,CAACG,MAAM,CAACQ,WAAW,CAAC,IAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAF1ChB,SAAS,QAGP,wBAAwBW,OAAO,aAC7BL,mBAAmB,CAACI,MAAM,CAACO,IAAI,CAAC,gCACF,IALlCjB,SAAS;EAQT,MAAMmB,OAA2B,GAAG;IAClC,GAAGT,MAAM;IACTC,OAAO;IACPS,oBAAoB,EAAEV,MAAM,CAACC,OAAO;IACpCU,WAAW,EAAEX,MAAM,CAACW,WAAW,IAAIX,MAAM,CAACC,OAAO;IAAE;IACnDO,WAAW,EAAER,MAAM,CAACQ,WAAW,KACzBV,wBAAwB,CAACE,MAAM,CAACO,IAAI,CAAC,GAAG,EAAE,GAAGZ,kBAAkB,CAAC;IACtEiB,MAAM,EAAErB,sBAAsB,CAACW;EACjC,CAAC;EACDR,cAAc,CAACe,OAAO,CAAC;EACvB,OAAOA,OAAO;AAChB","ignoreList":[]}
@@ -92,10 +92,7 @@ export function defineValueType(valueTypeDef) {
92
92
  displayName: displayName,
93
93
  description: description ?? ""
94
94
  },
95
- status: {
96
- type: "active",
97
- active: {}
98
- },
95
+ status: convertUserValueTypeStatusToValueTypeStatus(valueTypeDef.status),
99
96
  version: version,
100
97
  baseType: baseType,
101
98
  constraints: constraints,
@@ -105,4 +102,20 @@ export function defineValueType(valueTypeDef) {
105
102
  updateOntology(vt);
106
103
  return vt;
107
104
  }
105
+ export function convertUserValueTypeStatusToValueTypeStatus(status) {
106
+ if (typeof status === "object" && status.type === "deprecated") {
107
+ return {
108
+ type: "deprecated",
109
+ deprecated: {
110
+ message: status.message,
111
+ deadline: status.deadline,
112
+ replacedBy: status.replacedBy
113
+ }
114
+ };
115
+ }
116
+ return {
117
+ type: "active",
118
+ active: {}
119
+ };
120
+ }
108
121
  //# sourceMappingURL=defineValueType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defineValueType.js","names":["invariant","OntologyEntityTypeEnum","namespace","updateOntology","convertValueTypeTypeToBaseType","valueType","type","array","elementType","structV2","fields","map","field","identifier","baseType","keyType","optional","wrappedType","Error","defineValueType","valueTypeDef","apiName","displayName","description","version","test","process","env","NODE_ENV","typeName","constraints","constraint","output","failureMessage","vt","packageNamespace","substring","length","displayMetadata","status","active","exampleValues","__type","VALUE_TYPE"],"sources":["defineValueType.ts"],"sourcesContent":["/*\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 type {\n BaseType,\n DataConstraint,\n DataConstraintWrapper,\n FailureMessage,\n ValueTypeDataConstraint,\n} from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { namespace, updateOntology } from \"./defineOntology.js\";\nimport { type ValueTypeDefinitionVersion } from \"./values/ValueTypeDefinitionVersion.js\";\nimport { type ValueTypeType } from \"./values/ValueTypeType.js\";\n\ntype ZipBaseAndConstraint<Base, Constraint> = {\n [PropertyType in (BaseType[\"type\"] & DataConstraint[\"type\"])]: Base extends\n { type: PropertyType } ? {\n baseType: Omit<Base, \"type\">;\n constraints?: Constraint extends { type: PropertyType } ? {\n constraint: Omit<Constraint, \"type\">;\n failureMessage?: FailureMessage;\n }[]\n : undefined;\n }\n : never;\n};\n\ntype MappedZip = ZipBaseAndConstraint<BaseType, DataConstraint>;\n\ntype TypeNames = ValueTypeType[\"type\"];\n\ntype ValueTypeDefinitionBacking = {\n [Type in ValueTypeType[\"type\"] & DataConstraint[\"type\"]]: {\n baseType: { \"type\": Extract<ValueTypeType, { type: Type }>[\"value\"] } & {\n constraints: {\n constraint: Extract<\n DataConstraint,\n { type: Type }\n >[keyof Omit<Extract<DataConstraint, { type: Type }>, \"type\">];\n failureMessage?: FailureMessage;\n }[];\n };\n };\n};\n\ntype NewValueTypeDefinitionBacking = {\n [Type in ValueTypeType as Type[\"type\"]]: {\n type: Type[\"value\"];\n constraints?: Type[\"constraints\"];\n };\n};\ntype NewValueTypeDefinition =\n NewValueTypeDefinitionBacking[keyof NewValueTypeDefinitionBacking];\n\nfunction convertValueTypeTypeToBaseType(\n valueType: ValueTypeType[\"value\"],\n): BaseType {\n if (typeof valueType === \"string\") {\n }\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 { type: valueType, [valueType]: {} } as any;\n default:\n throw new Error(\"Invalid ValueTypeType\");\n }\n}\n\nexport type ValueTypeDefinition = {\n apiName: string;\n displayName: string;\n description?: string;\n type: NewValueTypeDefinition;\n version: string;\n};\n\nexport function defineValueType(\n valueTypeDef: ValueTypeDefinition,\n): ValueTypeDefinitionVersion {\n const { apiName, displayName, description, type, version } = valueTypeDef;\n const semverValidation =\n /^((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)$/;\n invariant(semverValidation.test(version), \"Version is not a valid semver\");\n\n const typeName: TypeNames = typeof type.type === \"string\"\n ? type.type\n : type.type.type === \"struct\"\n ? \"structV2\"\n : 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\n ? type.constraints.map<ValueTypeDataConstraint>(constraint => {\n const output: any = {\n constraint: { type: typeName, [typeName]: constraint.constraint },\n failureMessage: constraint.failureMessage,\n };\n return { constraint: output as DataConstraintWrapper };\n })\n : [];\n\n const baseType: BaseType = convertValueTypeTypeToBaseType(type.type);\n\n const vt: ValueTypeDefinitionVersion = {\n apiName,\n packageNamespace: namespace.substring(0, namespace.length - 1),\n displayMetadata: {\n displayName: displayName,\n description: description ?? \"\",\n },\n status: { type: \"active\", active: {} },\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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,SAAS,EAAEC,cAAc,QAAQ,qBAAqB;AA4C/D,SAASC,8BAA8BA,CACrCC,SAAiC,EACvB;EACV,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE,CACnC;EACA,QAAQ,IAAI;IACV,KAAM,OAAOA,SAAS,KAAK,QAAQ,IAAIA,SAAS,CAACC,IAAI,KAAK,OAAO;MAC/D,OAAO;QACLA,IAAI,EAAE,OAAO;QACbC,KAAK,EAAE;UACLC,WAAW,EAAEJ,8BAA8B,CAACC,SAAS,CAACG,WAAW;QACnE;MACF,CAAC;IACH,KAAM,OAAOH,SAAS,KAAK,QAAQ,IAAIA,SAAS,CAACC,IAAI,KAAK,QAAQ;MAChE,OAAO;QACLA,IAAI,EAAE,UAAU;QAChBG,QAAQ,EAAE;UACRC,MAAM,EAAEL,SAAS,CAACK,MAAM,CAACC,GAAG,CAACC,KAAK,KAAK;YACrCC,UAAU,EAAED,KAAK,CAACC,UAAU;YAC5BC,QAAQ,EAAEV,8BAA8B,CAACQ,KAAK,CAACE,QAAQ;UACzD,CAAC,CAAC;QACJ;MACF,CAAC;IACH,KAAM,OAAOT,SAAS,KAAK,QAAQ,IAAIA,SAAS,CAACC,IAAI,KAAK,KAAK;MAC7D,OAAO;QACLA,IAAI,EAAE,KAAK;QACXK,GAAG,EAAE;UACHI,OAAO,EAAEX,8BAA8B,CAACC,SAAS,CAACU,OAAO,CAAC;UAC1DV,SAAS,EAAED,8BAA8B,CAACC,SAAS,CAACA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AC,GACA,EAAE;EAEN,MAAMlB,QAAkB,GAAGV,8BAA8B,CAACE,IAAI,CAACA,IAAI,CAAC;EAEpE,MAAM4B,EAA8B,GAAG;IACrCb,OAAO;IACPc,gBAAgB,EAAEjC,SAAS,CAACkC,SAAS,CAAC,CAAC,EAAElC,SAAS,CAACmC,MAAM,GAAG,CAAC,CAAC;IAC9DC,eAAe,EAAE;MACfhB,WAAW,EAAEA,WAAW;MACxBC,WAAW,EAAEA,WAAW,IAAI;IAC9B,CAAC;IACDgB,MAAM,EAAE;MAAEjC,IAAI,EAAE,QAAQ;MAAEkC,MAAM,EAAE,CAAC;IAAE,CAAC;IACtChB,OAAO,EAAEA,OAAO;IAChBV,QAAQ,EAAEA,QAAQ;IAClBgB,WAAW,EAAEA,WAAW;IACxBW,aAAa,EAAE,EAAE;IACjBC,MAAM,EAAEzC,sBAAsB,CAAC0C;EACjC,CAAC;EACDxC,cAAc,CAAC+B,EAAE,CAAC;EAClB,OAAOA,EAAE;AACX","ignoreList":[]}
1
+ {"version":3,"file":"defineValueType.js","names":["invariant","OntologyEntityTypeEnum","namespace","updateOntology","convertValueTypeTypeToBaseType","valueType","type","array","elementType","structV2","fields","map","field","identifier","baseType","keyType","optional","wrappedType","Error","defineValueType","valueTypeDef","apiName","displayName","description","version","test","process","env","NODE_ENV","typeName","constraints","constraint","output","failureMessage","vt","packageNamespace","substring","length","displayMetadata","status","convertUserValueTypeStatusToValueTypeStatus","exampleValues","__type","VALUE_TYPE","deprecated","message","deadline","replacedBy","active"],"sources":["defineValueType.ts"],"sourcesContent":["/*\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 type {\n BaseType,\n DataConstraint,\n DataConstraintWrapper,\n FailureMessage,\n ValueTypeDataConstraint,\n ValueTypeRid,\n ValueTypeStatus,\n} from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport { namespace, updateOntology } from \"./defineOntology.js\";\nimport { type ValueTypeDefinitionVersion } from \"./values/ValueTypeDefinitionVersion.js\";\nimport { type ValueTypeType } from \"./values/ValueTypeType.js\";\n\ntype ZipBaseAndConstraint<Base, Constraint> = {\n [PropertyType in (BaseType[\"type\"] & DataConstraint[\"type\"])]: Base extends\n { type: PropertyType } ? {\n baseType: Omit<Base, \"type\">;\n constraints?: Constraint extends { type: PropertyType } ? {\n constraint: Omit<Constraint, \"type\">;\n failureMessage?: FailureMessage;\n }[]\n : undefined;\n }\n : never;\n};\n\ntype MappedZip = ZipBaseAndConstraint<BaseType, DataConstraint>;\n\ntype TypeNames = ValueTypeType[\"type\"];\n\ntype ValueTypeDefinitionBacking = {\n [Type in ValueTypeType[\"type\"] & DataConstraint[\"type\"]]: {\n baseType: { \"type\": Extract<ValueTypeType, { type: Type }>[\"value\"] } & {\n constraints: {\n constraint: Extract<\n DataConstraint,\n { type: Type }\n >[keyof Omit<Extract<DataConstraint, { type: Type }>, \"type\">];\n failureMessage?: FailureMessage;\n }[];\n };\n };\n};\n\ntype NewValueTypeDefinitionBacking = {\n [Type in ValueTypeType as Type[\"type\"]]: {\n type: Type[\"value\"];\n constraints?: Type[\"constraints\"];\n };\n};\ntype NewValueTypeDefinition =\n NewValueTypeDefinitionBacking[keyof NewValueTypeDefinitionBacking];\n\nfunction convertValueTypeTypeToBaseType(\n valueType: ValueTypeType[\"value\"],\n): BaseType {\n if (typeof valueType === \"string\") {\n }\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 { type: valueType, [valueType]: {} } as any;\n default:\n throw new Error(\"Invalid ValueTypeType\");\n }\n}\n\nexport type ValueTypeDefinition = {\n apiName: string;\n displayName: string;\n description?: string;\n type: NewValueTypeDefinition;\n version: string;\n status?: UserValueTypeStatus;\n};\n\nexport type UserValueTypeStatus = \"active\" | {\n type: \"deprecated\";\n message: string;\n deadline: string;\n replacedBy?: ValueTypeRid;\n};\n\nexport function defineValueType(\n valueTypeDef: ValueTypeDefinition,\n): ValueTypeDefinitionVersion {\n const { apiName, displayName, description, type, version } = valueTypeDef;\n const semverValidation =\n /^((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)$/;\n invariant(semverValidation.test(version), \"Version is not a valid semver\");\n\n const typeName: TypeNames = typeof type.type === \"string\"\n ? type.type\n : type.type.type === \"struct\"\n ? \"structV2\"\n : 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\n ? type.constraints.map<ValueTypeDataConstraint>(constraint => {\n const output: any = {\n constraint: { type: typeName, [typeName]: constraint.constraint },\n failureMessage: constraint.failureMessage,\n };\n return { constraint: output as DataConstraintWrapper };\n })\n : [];\n\n const baseType: BaseType = convertValueTypeTypeToBaseType(type.type);\n\n const vt: ValueTypeDefinitionVersion = {\n apiName,\n packageNamespace: namespace.substring(0, namespace.length - 1),\n displayMetadata: {\n displayName: displayName,\n description: description ?? \"\",\n },\n status: convertUserValueTypeStatusToValueTypeStatus(valueTypeDef.status),\n version: version,\n baseType: baseType,\n constraints: constraints,\n exampleValues: [],\n __type: OntologyEntityTypeEnum.VALUE_TYPE,\n };\n updateOntology(vt);\n return vt;\n}\n\nexport function convertUserValueTypeStatusToValueTypeStatus(\n status: UserValueTypeStatus | undefined,\n): ValueTypeStatus {\n if (typeof status === \"object\" && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: status.replacedBy,\n },\n };\n }\n return { type: \"active\", active: {} };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,SAAS,EAAEC,cAAc,QAAQ,qBAAqB;AA4C/D,SAASC,8BAA8BA,CACrCC,SAAiC,EACvB;EACV,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE,CACnC;EACA,QAAQ,IAAI;IACV,KAAM,OAAOA,SAAS,KAAK,QAAQ,IAAIA,SAAS,CAACC,IAAI,KAAK,OAAO;MAC/D,OAAO;QACLA,IAAI,EAAE,OAAO;QACbC,KAAK,EAAE;UACLC,WAAW,EAAEJ,8BAA8B,CAACC,SAAS,CAACG,WAAW;QACnE;MACF,CAAC;IACH,KAAM,OAAOH,SAAS,KAAK,QAAQ,IAAIA,SAAS,CAACC,IAAI,KAAK,QAAQ;MAChE,OAAO;QACLA,IAAI,EAAE,UAAU;QAChBG,QAAQ,EAAE;UACRC,MAAM,EAAEL,SAAS,CAACK,MAAM,CAACC,G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M,CAACO,QAAQ;QACzBC,UAAU,EAAER,MAAM,CAACQ;MACrB;IACF,CAAC;EACH;EACA,OAAO;IAAEzC,IAAI,EAAE,QAAQ;IAAE0C,MAAM,EAAE,CAAC;EAAE,CAAC;AACvC","ignoreList":[]}
@@ -1,2 +1,23 @@
1
- export {};
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export function isInterfaceSharedPropertyType(interfacePropertyType) {
18
+ return "sharedPropertyType" in interfacePropertyType;
19
+ }
20
+ export function getInterfacePropertyTypeType(interfacePropertyType) {
21
+ return isInterfaceSharedPropertyType(interfacePropertyType) ? interfacePropertyType.sharedPropertyType.type : interfacePropertyType.type;
22
+ }
2
23
  //# sourceMappingURL=InterfacePropertyType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InterfacePropertyType.js","names":[],"sources":["InterfacePropertyType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SharedPropertyType } from \"../properties/SharedPropertyType.js\";\n\nexport interface InterfacePropertyType {\n sharedPropertyType: SharedPropertyType;\n required: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"InterfacePropertyType.js","names":["isInterfaceSharedPropertyType","interfacePropertyType","getInterfacePropertyTypeType","sharedPropertyType","type"],"sources":["InterfacePropertyType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OntologyIrBaseFormatter } from \"@osdk/client.unstable\";\nimport type { PropertyTypeType } from \"../properties/PropertyTypeType.js\";\nimport type {\n PropertyType,\n SharedPropertyType,\n} from \"../properties/SharedPropertyType.js\";\n\nexport type InterfacePropertyType =\n | InterfaceSharedPropertyType\n | InterfaceDefinedProperty;\n\nexport interface InterfaceDefinedProperty extends PropertyType {\n required?: boolean;\n primaryKeyConstraint?: \"MUST_BE_PK\" | \"CANNOT_BE_PK\" | \"NO_RESTRICTION\";\n baseFormatter?: OntologyIrBaseFormatter;\n}\n\nexport interface InterfaceSharedPropertyType {\n sharedPropertyType: SharedPropertyType;\n required: boolean;\n}\n\nexport function isInterfaceSharedPropertyType(\n interfacePropertyType: InterfacePropertyType,\n): interfacePropertyType is InterfaceSharedPropertyType {\n return \"sharedPropertyType\" in interfacePropertyType;\n}\n\nexport function getInterfacePropertyTypeType(\n interfacePropertyType: InterfacePropertyType,\n): PropertyTypeType {\n return isInterfaceSharedPropertyType(interfacePropertyType)\n ? interfacePropertyType.sharedPropertyType.type\n : interfacePropertyType.type;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA,OAAO,SAASA,6BAA6BA,CAC3CC,qBAA4C,EACU;EACtD,OAAO,oBAAoB,IAAIA,qBAAqB;AACtD;AAEA,OAAO,SAASC,4BAA4BA,CAC1CD,qBAA4C,EAC1B;EAClB,OAAOD,6BAA6B,CAACC,qBAAqB,CAAC,GACvDA,qBAAqB,CAACE,kBAAkB,CAACC,IAAI,GAC7CH,qBAAqB,CAACG,IAAI;AAChC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"InterfaceType.js","names":[],"sources":["InterfaceType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n InterfaceTypeStatus,\n OntologyIrMarketplaceInterfaceType,\n} from \"@osdk/client.unstable\";\nimport type { OntologyEntityBase } from \"../common/OntologyEntityBase.js\";\nimport type { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { InterfacePropertyType } from \"./InterfacePropertyType.js\";\n\nexport interface InterfaceType extends\n OntologyEntityBase,\n Omit<\n OntologyIrMarketplaceInterfaceType,\n // we want our simplified representation\n | \"properties\"\n // these things don't need to exist as the system works fine without them (I'm told)\n | \"propertiesV2\"\n | \"propertiesV3\"\n | \"extendsInterfaces\"\n >\n{\n propertiesV2: Record<string, InterfacePropertyType>;\n extendsInterfaces: Array<InterfaceType>;\n status: InterfaceTypeStatus;\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"InterfaceType.js","names":[],"sources":["InterfaceType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n InterfaceTypeStatus,\n OntologyIrMarketplaceInterfaceType,\n} from \"@osdk/client.unstable\";\nimport type { OntologyEntityBase } from \"../common/OntologyEntityBase.js\";\nimport type { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type {\n InterfacePropertyType,\n InterfaceSharedPropertyType,\n} from \"./InterfacePropertyType.js\";\n\nexport interface InterfaceType extends\n OntologyEntityBase,\n Omit<\n OntologyIrMarketplaceInterfaceType,\n // we want our simplified representation\n | \"properties\"\n // these things don't need to exist as the system works fine without them (I'm told)\n | \"propertiesV2\"\n | \"propertiesV3\"\n | \"extendsInterfaces\"\n >\n{\n propertiesV2: Record<string, InterfaceSharedPropertyType>;\n propertiesV3: Record<string, InterfacePropertyType>;\n extendsInterfaces: Array<InterfaceType>;\n status: InterfaceTypeStatus;\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE;\n}\n"],"mappings":"","ignoreList":[]}
@@ -14,12 +14,18 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { isInterfaceSharedPropertyType } from "./InterfacePropertyType.js";
17
18
  export function getFlattenedInterfaceProperties(interfaceType) {
18
- let properties = interfaceType.propertiesV2;
19
+ let properties = Object.fromEntries(Object.entries(interfaceType.propertiesV3).map(([key, value]) => [isInterfaceSharedPropertyType(value) ? value.sharedPropertyType.apiName : key, value]));
20
+ Object.entries(interfaceType.propertiesV2).forEach(([apiName, spt]) => {
21
+ if (!(apiName in properties)) {
22
+ properties[apiName] = spt;
23
+ }
24
+ });
19
25
  interfaceType.extendsInterfaces.forEach(ext => {
20
26
  properties = {
21
- ...properties,
22
- ...getFlattenedInterfaceProperties(ext)
27
+ ...getFlattenedInterfaceProperties(ext),
28
+ ...properties
23
29
  };
24
30
  });
25
31
  return properties;
@@ -1 +1 @@
1
- {"version":3,"file":"getFlattenedInterfaceProperties.js","names":["getFlattenedInterfaceProperties","interfaceType","properties","propertiesV2","extendsInterfaces","forEach","ext"],"sources":["getFlattenedInterfaceProperties.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { InterfacePropertyType } from \"./InterfacePropertyType.js\";\nimport type { InterfaceType } from \"./InterfaceType.js\";\n\nexport function getFlattenedInterfaceProperties(\n interfaceType: InterfaceType,\n): Record<string, InterfacePropertyType> {\n let properties = interfaceType.propertiesV2;\n interfaceType.extendsInterfaces.forEach(ext => {\n properties = { ...properties, ...getFlattenedInterfaceProperties(ext) };\n });\n return properties;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,+BAA+BA,CAC7CC,aAA4B,EACW;EACvC,IAAIC,UAAU,GAAGD,aAAa,CAACE,YAAY;EAC3CF,aAAa,CAACG,iBAAiB,CAACC,OAAO,CAACC,GAAG,IAAI;IAC7CJ,UAAU,GAAG;MAAE,GAAGA,UAAU;MAAE,GAAGF,+BAA+B,CAACM,GAAG;IAAE,CAAC;EACzE,CAAC,CAAC;EACF,OAAOJ,UAAU;AACnB","ignoreList":[]}
1
+ {"version":3,"file":"getFlattenedInterfaceProperties.js","names":["isInterfaceSharedPropertyType","getFlattenedInterfaceProperties","interfaceType","properties","Object","fromEntries","entries","propertiesV3","map","key","value","sharedPropertyType","apiName","propertiesV2","forEach","spt","extendsInterfaces","ext"],"sources":["getFlattenedInterfaceProperties.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type InterfacePropertyType,\n isInterfaceSharedPropertyType,\n} from \"./InterfacePropertyType.js\";\nimport type { InterfaceType } from \"./InterfaceType.js\";\n\nexport function getFlattenedInterfaceProperties(\n interfaceType: InterfaceType,\n): Record<string, InterfacePropertyType> {\n let properties: Record<string, InterfacePropertyType> = Object.fromEntries(\n Object.entries(interfaceType.propertiesV3).map(([key, value]) => [\n isInterfaceSharedPropertyType(value)\n ? value.sharedPropertyType.apiName\n : key,\n value,\n ]),\n );\n Object.entries(interfaceType.propertiesV2).forEach(([apiName, spt]) => {\n if (!(apiName in properties)) {\n properties[apiName] = spt;\n }\n });\n interfaceType.extendsInterfaces.forEach(ext => {\n properties = {\n ...getFlattenedInterfaceProperties(ext),\n ...properties,\n };\n });\n return properties;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAEEA,6BAA6B,QACxB,4BAA4B;AAGnC,OAAO,SAASC,+BAA+BA,CAC7CC,aAA4B,EACW;EACvC,IAAIC,UAAiD,GAAGC,MAAM,CAACC,WAAW,CACxED,MAAM,CAACE,OAAO,CAACJ,aAAa,CAACK,YAAY,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,CAC/DV,6BAA6B,CAACU,KAAK,CAAC,GAChCA,KAAK,CAACC,kBAAkB,CAACC,OAAO,GAChCH,GAAG,EACPC,KAAK,CACN,CACH,CAAC;EACDN,MAAM,CAACE,OAAO,CAACJ,aAAa,CAACW,YAAY,CAAC,CAACC,OAAO,CAAC,CAAC,CAACF,OAAO,EAAEG,GAAG,CAAC,KAAK;IACrE,IAAI,EAAEH,OAAO,IAAIT,UAAU,CAAC,EAAE;MAC5BA,UAAU,CAACS,OAAO,CAAC,GAAGG,GAAG;IAC3B;EACF,CAAC,CAAC;EACFb,aAAa,CAACc,iBAAiB,CAACF,OAAO,CAACG,GAAG,IAAI;IAC7Cd,UAAU,GAAG;MACX,GAAGF,+BAA+B,CAACgB,GAAG,CAAC;MACvC,GAAGd;IACL,CAAC;EACH,CAAC,CAAC;EACF,OAAOA,UAAU;AACnB","ignoreList":[]}
@@ -35,6 +35,11 @@ export function mapSimplifiedStatusToInterfaceTypeStatus(status) {
35
35
  type: "experimental",
36
36
  experimental: {}
37
37
  };
38
+ case "example":
39
+ return {
40
+ type: "example",
41
+ example: {}
42
+ };
38
43
  default:
39
44
  throw new Error(`Invalid status type: ${status.type}`);
40
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mapSimplifiedStatusToInterfaceTypeStatus.js","names":["mapSimplifiedStatusToInterfaceTypeStatus","status","type","deprecated","message","deadline","replacedBy","undefined","active","experimental","Error"],"sources":["mapSimplifiedStatusToInterfaceTypeStatus.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { InterfaceTypeStatus } from \"@osdk/client.unstable\";\nimport type { SimplifiedInterfaceTypeStatus } from \"../defineInterface.js\";\n\nexport function mapSimplifiedStatusToInterfaceTypeStatus(\n status: SimplifiedInterfaceTypeStatus,\n): InterfaceTypeStatus {\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 as any).type}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,wCAAwCA,CACtDC,MAAqC,EAChB;EACrB,QAAQA,MAAM,CAACC,IAAI;IACjB,KAAK,YAAY;MACf,OAAO;QACLA,IAAI,EAAE,YAAY;QAClBC,UAAU,EAAE;UACVC,OAAO,EAAEH,MAAM,CAACG,OAAO;UACvBC,QAAQ,EAAEJ,MAAM,CAACI,QAAQ;UACzBC,UAAU,EAAEC;QACd;MACF,CAAC;IACH,KAAK,QAAQ;MACX,OAAO;QACLL,IAAI,EAAE,QAAQ;QACdM,MAAM,EAAE,CAAC;MACX,CAAC;IACH,KAAK,cAAc;MACjB,OAAO;QACLN,IAAI,EAAE,cAAc;QACpBO,YAAY,EAAE,CAAC;MACjB,CAAC;IACH;MACE,MAAM,IAAIC,KAAK,CAAC,wBAAyBT,MAAM,CAASC,IAAI,EAAE,CAAC;EACnE;AACF","ignoreList":[]}
1
+ {"version":3,"file":"mapSimplifiedStatusToInterfaceTypeStatus.js","names":["mapSimplifiedStatusToInterfaceTypeStatus","status","type","deprecated","message","deadline","replacedBy","undefined","active","experimental","example","Error"],"sources":["mapSimplifiedStatusToInterfaceTypeStatus.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { InterfaceTypeStatus } from \"@osdk/client.unstable\";\nimport type { SimplifiedInterfaceTypeStatus } from \"../defineInterface.js\";\n\nexport function mapSimplifiedStatusToInterfaceTypeStatus(\n status: SimplifiedInterfaceTypeStatus,\n): InterfaceTypeStatus {\n switch (status.type) {\n case \"deprecated\":\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined,\n },\n };\n case \"active\":\n return {\n type: \"active\",\n active: {},\n };\n case \"experimental\":\n return {\n type: \"experimental\",\n experimental: {},\n };\n case \"example\":\n return {\n type: \"example\",\n example: {},\n };\n default:\n throw new Error(`Invalid status type: ${(status as any).type}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,wCAAwCA,CACtDC,MAAqC,EAChB;EACrB,QAAQA,MAAM,CAACC,IAAI;IACjB,KAAK,YAAY;MACf,OAAO;QACLA,IAAI,EAAE,YAAY;QAClBC,UAAU,EAAE;UACVC,OAAO,EAAEH,MAAM,CAACG,OAAO;UACvBC,QAAQ,EAAEJ,MAAM,CAACI,QAAQ;UACzBC,UAAU,EAAEC;QACd;MACF,CAAC;IACH,KAAK,QAAQ;MACX,OAAO;QACLL,IAAI,EAAE,QAAQ;QACdM,MAAM,EAAE,CAAC;MACX,CAAC;IACH,KAAK,cAAc;MACjB,OAAO;QACLN,IAAI,EAAE,cAAc;QACpBO,YAAY,EAAE,CAAC;MACjB,CAAC;IACH,KAAK,SAAS;MACZ,OAAO;QACLP,IAAI,EAAE,SAAS;QACfQ,OAAO,EAAE,CAAC;MACZ,CAAC;IACH;MACE,MAAM,IAAIC,KAAK,CAAC,wBAAyBV,MAAM,CAASC,IAAI,EAAE,CAAC;EACnE;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkType.js","names":[],"sources":["LinkType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n LinkTypeDisplayMetadata,\n LinkTypeMetadata,\n OntologyIrLinkTypeStatus,\n Visibility,\n} from \"@osdk/client.unstable\";\nimport type { OptionalFields } from \"../../util/OptionalFields.js\";\nimport type { RequiredFields } from \"../../util/RequiredFields.js\";\nimport type { OntologyEntityBase } from \"../common/OntologyEntityBase.js\";\nimport type { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { ObjectTypeDefinition } from \"../object/ObjectTypeDefinition.js\";\n\nexport type LinkType =\n | (OntologyEntityBase & OneToManyLinkTypeDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n })\n | (OntologyEntityBase & ManyToManyLinkTypeDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n })\n | (OntologyEntityBase & IntermediaryLinkTypeDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n });\n\nexport type LinkTypeDefinition =\n | Omit<\n OntologyEntityBase & OneToManyLinkTypeUserDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n },\n \"__type\"\n >\n | Omit<\n OntologyEntityBase & ManyToManyLinkTypeUserDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n },\n \"__type\"\n >\n | Omit<\n OntologyEntityBase & IntermediaryLinkTypeUserDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n },\n \"__type\"\n >;\n\nexport type ObjectTypePropertyApiName = string;\n\nexport interface OneToManyLinkTypeDefinition {\n apiName: string;\n one: OneToManyObjectLinkReference;\n toMany: OneToManyObjectLinkReference;\n manyForeignKeyProperty: ObjectTypePropertyApiName;\n cardinality: \"OneToMany\" | \"OneToOne\" | undefined;\n editsEnabled?: boolean;\n status?: OntologyIrLinkTypeStatus;\n redacted?: boolean;\n}\n\nexport interface OneToManyObjectLinkReference {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadata;\n}\n\nexport interface OneToManyLinkTypeUserDefinition {\n apiName: string;\n one: OneToManyObjectLinkReferenceUserDefinition;\n toMany: OneToManyObjectLinkReferenceUserDefinition;\n manyForeignKeyProperty: ObjectTypePropertyApiName;\n cardinality?: \"OneToMany\" | \"OneToOne\" | undefined;\n}\n\nexport interface OneToManyObjectLinkReferenceUserDefinition {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadataUserDefinition;\n}\n\nexport interface ManyToManyLinkTypeDefinition {\n apiName: string;\n many: ManyToManyObjectLinkReference;\n toMany: ManyToManyObjectLinkReference;\n editsEnabled?: boolean;\n status?: OntologyIrLinkTypeStatus;\n redacted?: boolean;\n}\n\nexport interface ManyToManyObjectLinkReference {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadata;\n}\n\nexport interface ManyToManyLinkTypeUserDefinition {\n apiName: string;\n many: ManyToManyObjectLinkReferenceUserDefinition;\n toMany: ManyToManyObjectLinkReferenceUserDefinition;\n}\n\nexport interface ManyToManyObjectLinkReferenceUserDefinition {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadataUserDefinition;\n}\n\nexport interface IntermediaryLinkTypeDefinition {\n apiName: string;\n many: IntermediaryObjectLinkReference;\n toMany: IntermediaryObjectLinkReference;\n intermediaryObjectType: ObjectTypeDefinition;\n editsEnabled?: boolean;\n status?: OntologyIrLinkTypeStatus;\n redacted?: boolean;\n}\n\nexport interface IntermediaryObjectLinkReference {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadata;\n linkToIntermediary: LinkType;\n}\n\nexport interface IntermediaryLinkTypeUserDefinition {\n apiName: string;\n many: IntermediaryObjectLinkReferenceUserDefinition;\n toMany: IntermediaryObjectLinkReferenceUserDefinition;\n intermediaryObjectType: ObjectTypeDefinition | string;\n}\n\nexport interface IntermediaryObjectLinkReferenceUserDefinition {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadataUserDefinition;\n linkToIntermediary: LinkType;\n}\n\nexport interface LinkTypeMetadataUserDefinition {\n apiName: string;\n displayName?: string;\n pluralDisplayName?: string;\n visibility?: Visibility;\n groupDisplayName?: string;\n}\n\nexport type LinkSideMetadata = OptionalFields<\n RequiredFields<\n Omit<LinkTypeMetadata, \"displayMetadata\"> & LinkTypeDisplayMetadata,\n \"apiName\"\n >,\n \"visibility\" | \"typeClasses\"\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"LinkType.js","names":[],"sources":["LinkType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n LinkTypeDisplayMetadata,\n LinkTypeId,\n LinkTypeMetadata,\n Visibility,\n} from \"@osdk/client.unstable\";\nimport type { OptionalFields } from \"../../util/OptionalFields.js\";\nimport type { RequiredFields } from \"../../util/RequiredFields.js\";\nimport type { OntologyEntityBase } from \"../common/OntologyEntityBase.js\";\nimport type { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { ObjectTypeDefinition } from \"../object/ObjectTypeDefinition.js\";\n\nexport type LinkType =\n | (OntologyEntityBase & OneToManyLinkTypeDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n })\n | (OntologyEntityBase & ManyToManyLinkTypeDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n })\n | (OntologyEntityBase & IntermediaryLinkTypeDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n });\n\nexport type LinkTypeDefinition =\n | Omit<\n OntologyEntityBase & OneToManyLinkTypeUserDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n },\n \"__type\"\n >\n | Omit<\n OntologyEntityBase & ManyToManyLinkTypeUserDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n },\n \"__type\"\n >\n | Omit<\n OntologyEntityBase & IntermediaryLinkTypeUserDefinition & {\n __type: OntologyEntityTypeEnum.LINK_TYPE;\n },\n \"__type\"\n >;\n\nexport type ObjectTypePropertyApiName = string;\n\nexport interface OneToManyLinkTypeDefinition {\n apiName: string;\n one: OneToManyObjectLinkReference;\n toMany: OneToManyObjectLinkReference;\n manyForeignKeyProperty: ObjectTypePropertyApiName;\n cardinality: \"OneToMany\" | \"OneToOne\" | undefined;\n editsEnabled?: boolean;\n status?: UserLinkTypeStatus;\n redacted?: boolean;\n}\n\nexport interface OneToManyObjectLinkReference {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadata;\n}\n\nexport interface OneToManyLinkTypeUserDefinition {\n apiName: string;\n one: OneToManyObjectLinkReferenceUserDefinition;\n toMany: OneToManyObjectLinkReferenceUserDefinition;\n manyForeignKeyProperty: ObjectTypePropertyApiName;\n editsEnabled?: boolean;\n status?: UserLinkTypeStatus;\n cardinality?: \"OneToMany\" | \"OneToOne\" | undefined;\n}\n\nexport interface OneToManyObjectLinkReferenceUserDefinition {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadataUserDefinition;\n}\n\nexport interface ManyToManyLinkTypeDefinition {\n apiName: string;\n many: ManyToManyObjectLinkReference;\n toMany: ManyToManyObjectLinkReference;\n editsEnabled?: boolean;\n status?: UserLinkTypeStatus;\n redacted?: boolean;\n}\n\nexport interface ManyToManyObjectLinkReference {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadata;\n}\n\nexport interface ManyToManyLinkTypeUserDefinition {\n apiName: string;\n many: ManyToManyObjectLinkReferenceUserDefinition;\n toMany: ManyToManyObjectLinkReferenceUserDefinition;\n editsEnabled?: boolean;\n status?: UserLinkTypeStatus;\n}\n\nexport interface ManyToManyObjectLinkReferenceUserDefinition {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadataUserDefinition;\n}\n\nexport interface IntermediaryLinkTypeDefinition {\n apiName: string;\n many: IntermediaryObjectLinkReference;\n toMany: IntermediaryObjectLinkReference;\n intermediaryObjectType: ObjectTypeDefinition;\n editsEnabled?: boolean;\n status?: UserLinkTypeStatus;\n redacted?: boolean;\n}\n\nexport interface IntermediaryObjectLinkReference {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadata;\n linkToIntermediary: LinkType;\n}\n\nexport interface IntermediaryLinkTypeUserDefinition {\n apiName: string;\n many: IntermediaryObjectLinkReferenceUserDefinition;\n toMany: IntermediaryObjectLinkReferenceUserDefinition;\n intermediaryObjectType: ObjectTypeDefinition | string;\n editsEnabled?: boolean;\n status?: UserLinkTypeStatus;\n}\n\nexport interface IntermediaryObjectLinkReferenceUserDefinition {\n object: ObjectTypeDefinition | string;\n metadata: LinkTypeMetadataUserDefinition;\n linkToIntermediary: LinkType;\n}\n\nexport interface LinkTypeMetadataUserDefinition {\n apiName: string;\n displayName?: string;\n pluralDisplayName?: string;\n visibility?: Visibility;\n groupDisplayName?: string;\n}\n\nexport type LinkSideMetadata = OptionalFields<\n RequiredFields<\n Omit<LinkTypeMetadata, \"displayMetadata\"> & LinkTypeDisplayMetadata,\n \"apiName\"\n >,\n \"visibility\" | \"typeClasses\"\n>;\n\nexport type UserLinkTypeStatus =\n | \"active\"\n | \"experimental\"\n | \"example\"\n | {\n type: \"deprecated\";\n message: string;\n deadline: string;\n replacedBy?: LinkTypeId;\n };\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectType.js","names":[],"sources":["ObjectType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OntologyIrObjectType, Visibility } from \"@osdk/client.unstable\";\nimport type { RequiredFields } from \"../../util/RequiredFields.js\";\nimport type { BlueprintIcon } from \"../common/BlueprintIcons.js\";\nimport type { OntologyEntityBase } from \"../common/OntologyEntityBase.js\";\nimport type { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { InterfaceImplementation } from \"./InterfaceImplementation.js\";\nimport type { ObjectPropertyType } from \"./ObjectPropertyType.js\";\nimport type { ObjectTypeDatasourceDefinition } from \"./ObjectTypeDatasourceDefinition.js\";\nimport type { ObjectTypeStatus } from \"./ObjectTypeStatus.js\";\n\nexport type ObjectType =\n & OntologyEntityBase\n & RequiredFields<\n Partial<ObjectTypeInner>,\n | \"apiName\"\n | \"primaryKeyPropertyApiName\"\n | \"displayName\"\n | \"pluralDisplayName\"\n | \"titlePropertyApiName\"\n >\n & {\n datasources?: Array<ObjectTypeDatasourceDefinition>;\n __type: OntologyEntityTypeEnum.OBJECT_TYPE;\n };\n\nexport interface ObjectTypeInner extends\n Omit<\n OntologyIrObjectType,\n | \"titlePropertyTypeRid\"\n | \"propertyTypes\"\n | \"allImplementsInterfaces\"\n | \"implementsInterfaces2\"\n | \"displayMetadata\"\n | \"primaryKeys\"\n | \"status\"\n >\n{\n primaryKeyPropertyApiName: string;\n properties: Array<ObjectPropertyType>;\n titlePropertyApiName: string;\n implementsInterfaces: Array<InterfaceImplementation>;\n description: string | undefined;\n icon: { locator: BlueprintIcon; color: string } | undefined;\n displayName: string;\n pluralDisplayName: string;\n visibility: Visibility;\n editsEnabled: boolean;\n status?: ObjectTypeStatus;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"ObjectType.js","names":[],"sources":["ObjectType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OntologyIrObjectType, Visibility } from \"@osdk/client.unstable\";\nimport type { RequiredFields } from \"../../util/RequiredFields.js\";\nimport type { BlueprintIcon } from \"../common/BlueprintIcons.js\";\nimport type { OntologyEntityBase } from \"../common/OntologyEntityBase.js\";\nimport type { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { InterfaceImplementation } from \"./InterfaceImplementation.js\";\nimport type { ObjectPropertyType } from \"./ObjectPropertyType.js\";\nimport type { ObjectTypeDatasourceDefinition } from \"./ObjectTypeDatasourceDefinition.js\";\nimport type { ObjectTypeStatus } from \"./ObjectTypeStatus.js\";\n\nexport type ObjectType =\n & OntologyEntityBase\n & RequiredFields<\n Partial<ObjectTypeInner>,\n | \"apiName\"\n | \"primaryKeyPropertyApiName\"\n | \"displayName\"\n | \"pluralDisplayName\"\n | \"titlePropertyApiName\"\n >\n & {\n datasources?: Array<ObjectTypeDatasourceDefinition>;\n __type: OntologyEntityTypeEnum.OBJECT_TYPE;\n };\n\nexport interface ObjectTypeInner extends\n Omit<\n OntologyIrObjectType,\n | \"titlePropertyTypeRid\"\n | \"propertyTypes\"\n | \"allImplementsInterfaces\"\n | \"implementsInterfaces2\"\n | \"displayMetadata\"\n | \"primaryKeys\"\n | \"status\"\n >\n{\n primaryKeyPropertyApiName: string;\n properties: Array<ObjectPropertyType>;\n titlePropertyApiName: string;\n implementsInterfaces: Array<InterfaceImplementation>;\n description: string | undefined;\n icon: { locator: BlueprintIcon; color: string } | undefined;\n displayName: string;\n pluralDisplayName: string;\n visibility: Visibility;\n editsEnabled: boolean;\n status?: ObjectTypeStatus;\n aliases?: Array<string>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectTypeDefinition.js","names":[],"sources":["ObjectTypeDefinition.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Visibility } from \"@osdk/client.unstable\";\nimport type { BlueprintIcon } from \"../common/BlueprintIcons.js\";\nimport type { InterfaceImplementation } from \"./InterfaceImplementation.js\";\nimport type { ObjectPropertyTypeUserDefinition } from \"./ObjectPropertyTypeUserDefinition.js\";\nimport type { ObjectTypeDatasourceDefinition } from \"./ObjectTypeDatasourceDefinition.js\";\nimport type { ObjectTypeStatus } from \"./ObjectTypeStatus.js\";\n\nexport type ObjectTypeDefinition = {\n apiName: string;\n primaryKeyPropertyApiName: string;\n displayName: string;\n pluralDisplayName: string;\n titlePropertyApiName: string;\n properties?: { [key: string]: ObjectPropertyTypeUserDefinition };\n implementsInterfaces?: Array<InterfaceImplementation>;\n description?: string;\n icon?: { locator: BlueprintIcon; color: string };\n visibility?: Visibility;\n editsEnabled?: boolean;\n status?: ObjectTypeStatus;\n datasources?: Array<ObjectTypeDatasourceDefinition>;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"ObjectTypeDefinition.js","names":[],"sources":["ObjectTypeDefinition.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Visibility } from \"@osdk/client.unstable\";\nimport type { BlueprintIcon } from \"../common/BlueprintIcons.js\";\nimport type { InterfaceImplementation } from \"./InterfaceImplementation.js\";\nimport type { ObjectPropertyTypeUserDefinition } from \"./ObjectPropertyTypeUserDefinition.js\";\nimport type { ObjectTypeDatasourceDefinition } from \"./ObjectTypeDatasourceDefinition.js\";\nimport type { ObjectTypeStatus } from \"./ObjectTypeStatus.js\";\n\nexport type ObjectTypeDefinition = {\n apiName: string;\n primaryKeyPropertyApiName: string;\n displayName: string;\n pluralDisplayName: string;\n titlePropertyApiName: string;\n properties?: { [key: string]: ObjectPropertyTypeUserDefinition };\n implementsInterfaces?: Array<InterfaceImplementation>;\n description?: string;\n icon?: { locator: BlueprintIcon; color: string };\n visibility?: Visibility;\n editsEnabled?: boolean;\n status?: ObjectTypeStatus;\n datasources?: Array<ObjectTypeDatasourceDefinition>;\n aliases?: Array<string>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectTypeStatus.js","names":[],"sources":["ObjectTypeStatus.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type ObjectTypeStatus =\n | \"active\"\n | \"experimental\"\n | {\n type: \"deprecated\";\n message: string;\n deadline: string;\n };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"ObjectTypeStatus.js","names":[],"sources":["ObjectTypeStatus.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type ObjectTypeStatus =\n | \"active\"\n | \"experimental\"\n | \"example\"\n | {\n type: \"deprecated\";\n message: string;\n deadline: string;\n };\n"],"mappings":"","ignoreList":[]}
@@ -24,7 +24,7 @@ export function isExotic(type) {
24
24
  if (typeof type === "string") {
25
25
  return ["geopoint", "geoshape", "mediaReference", "geotimeSeries"].includes(type);
26
26
  } else if (typeof type === "object" && type != null) {
27
- return type.type === "marking" || type.type === "struct";
27
+ return type.type === "marking" || type.type === "struct" || type.type === "string" || type.type === "decimal";
28
28
  }
29
29
  return false;
30
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyTypeType.js","names":["isPropertyTypeType","v","type","isExotic","undefined","includes","isStruct"],"sources":["PropertyTypeType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { StructFieldType } from \"@osdk/client.unstable\";\n\nexport type PropertyTypeType =\n | PropertyTypeTypePrimitive\n | PropertyTypeTypeExotic;\n\nexport type PropertyTypeTypePrimitive =\n | \"boolean\"\n | \"byte\"\n | \"date\"\n | \"decimal\"\n | \"double\"\n | \"float\"\n | \"integer\"\n | \"long\"\n | \"short\"\n | \"string\"\n | \"timestamp\";\n\nexport type PropertyTypeTypeExotic =\n | \"geopoint\"\n | \"geoshape\"\n | \"mediaReference\"\n | \"geotimeSeries\"\n | PropertyTypeTypeMarking\n | PropertyTypeTypeStruct\n | PropertyTypeTypeString\n | PropertyTypeTypeDecimal;\n\ntype PropertyTypeTypeMarking = {\n type: \"marking\";\n markingType: \"MANDATORY\" | \"CBAC\";\n markingInputGroupName: string;\n};\n\nexport type PropertyTypeTypeStruct = {\n type: \"struct\";\n structDefinition: {\n [api_name: string]:\n | StructPropertyType\n | Exclude<PropertyTypeTypesWithoutStruct, PropertyTypeTypeMarking>;\n };\n};\n\ntype PropertyTypeTypeString = {\n type: \"string\";\n isLongText?: boolean;\n supportsEfficientLeadingWildcard?: boolean;\n supportsExactMatching?: boolean;\n supportsFullTextRegex?: boolean;\n enableAsciiFolding?: boolean;\n};\n\ntype PropertyTypeTypeDecimal = {\n type: \"decimal\";\n precision?: number;\n scale?: number;\n};\n\nexport type PropertyTypeTypesWithoutStruct = Exclude<\n PropertyTypeType,\n PropertyTypeTypeStruct\n>;\nexport function isPropertyTypeType(\n v: PropertyTypeType,\n): v is PropertyTypeType {\n return v === \"boolean\" || v === \"byte\"\n || v === \"date\" || v === \"decimal\" || v === \"double\"\n || v === \"float\" || v === \"geopoint\" || v === \"geoshape\"\n || v === \"integer\" || v === \"long\"\n || (typeof v === \"object\" && v.type === \"marking\")\n || v === \"short\" || v === \"string\"\n || v === \"timestamp\";\n}\nexport function isExotic(\n type: PropertyTypeType | undefined,\n): type is PropertyTypeTypeExotic {\n if (type === undefined) {\n return false;\n }\n if (typeof type === \"string\") {\n return [\"geopoint\", \"geoshape\", \"mediaReference\", \"geotimeSeries\"].includes(\n type,\n );\n } else if (typeof type === \"object\" && type != null) {\n return type.type === \"marking\" || type.type === \"struct\";\n }\n return false;\n}\nexport function isStruct(\n type: PropertyTypeType,\n): type is PropertyTypeTypeStruct {\n return typeof type === \"object\" && type.type === \"struct\";\n}\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport interface StructPropertyType extends\n Optional<\n Omit<\n StructFieldType,\n \"fieldType\" | \"structFieldRid\" | \"apiName\"\n >,\n \"typeClasses\" | \"aliases\"\n >\n{\n fieldType: PropertyTypeTypesWithoutStruct;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiEA,OAAO,SAASA,kBAAkBA,CAChCC,CAAmB,EACI;EACvB,OAAOA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IACjCA,CAAC,KAAK,MAAM,IAAIA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,QAAQ,IACjDA,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,UAAU,IAAIA,CAAC,KAAK,UAAU,IACrDA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC9B,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,CAACC,IAAI,KAAK,SAAU,IAC/CD,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,QAAQ,IAC/BA,CAAC,KAAK,WAAW;AACxB;AACA,OAAO,SAASE,QAAQA,CACtBD,IAAkC,EACF;EAChC,IAAIA,IAAI,KAAKE,SAAS,EAAE;IACtB,OAAO,KAAK;EACd;EACA,IAAI,OAAOF,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAACG,QAAQ,CACzEH,IACF,CAAC;EACH,CAAC,MAAM,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,IAAI,IAAI,EAAE;IACnD,OAAOA,IAAI,CAACA,IAAI,KAAK,SAAS,IAAIA,IAAI,CAACA,IAAI,KAAK,QAAQ;EAC1D;EACA,OAAO,KAAK;AACd;AACA,OAAO,SAASI,QAAQA,CACtBJ,IAAsB,EACU;EAChC,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACA,IAAI,KAAK,QAAQ;AAC3D","ignoreList":[]}
1
+ {"version":3,"file":"PropertyTypeType.js","names":["isPropertyTypeType","v","type","isExotic","undefined","includes","isStruct"],"sources":["PropertyTypeType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { StructFieldType } from \"@osdk/client.unstable\";\n\nexport type PropertyTypeType =\n | PropertyTypeTypePrimitive\n | PropertyTypeTypeExotic;\n\nexport type PropertyTypeTypePrimitive =\n | \"boolean\"\n | \"byte\"\n | \"date\"\n | \"decimal\"\n | \"double\"\n | \"float\"\n | \"integer\"\n | \"long\"\n | \"short\"\n | \"string\"\n | \"timestamp\";\n\nexport type PropertyTypeTypeExotic =\n | \"geopoint\"\n | \"geoshape\"\n | \"mediaReference\"\n | \"geotimeSeries\"\n | PropertyTypeTypeMarking\n | PropertyTypeTypeStruct\n | PropertyTypeTypeString\n | PropertyTypeTypeDecimal;\n\ntype PropertyTypeTypeMarking = {\n type: \"marking\";\n markingType: \"MANDATORY\" | \"CBAC\";\n markingInputGroupName: string;\n};\n\nexport type PropertyTypeTypeStruct = {\n type: \"struct\";\n structDefinition: {\n [api_name: string]:\n | StructPropertyType\n | Exclude<PropertyTypeTypesWithoutStruct, PropertyTypeTypeMarking>;\n };\n};\n\ntype PropertyTypeTypeString = {\n type: \"string\";\n isLongText?: boolean;\n supportsEfficientLeadingWildcard?: boolean;\n supportsExactMatching?: boolean;\n supportsFullTextRegex?: boolean;\n enableAsciiFolding?: boolean;\n};\n\ntype PropertyTypeTypeDecimal = {\n type: \"decimal\";\n precision?: number;\n scale?: number;\n};\n\nexport type PropertyTypeTypesWithoutStruct = Exclude<\n PropertyTypeType,\n PropertyTypeTypeStruct\n>;\nexport function isPropertyTypeType(\n v: PropertyTypeType,\n): v is PropertyTypeType {\n return v === \"boolean\" || v === \"byte\"\n || v === \"date\" || v === \"decimal\" || v === \"double\"\n || v === \"float\" || v === \"geopoint\" || v === \"geoshape\"\n || v === \"integer\" || v === \"long\"\n || (typeof v === \"object\" && v.type === \"marking\")\n || v === \"short\" || v === \"string\"\n || v === \"timestamp\";\n}\nexport function isExotic(\n type: PropertyTypeType | undefined,\n): type is PropertyTypeTypeExotic {\n if (type === undefined) {\n return false;\n }\n if (typeof type === \"string\") {\n return [\"geopoint\", \"geoshape\", \"mediaReference\", \"geotimeSeries\"].includes(\n type,\n );\n } else if (typeof type === \"object\" && type != null) {\n return type.type === \"marking\" || type.type === \"struct\"\n || type.type === \"string\"\n || type.type === \"decimal\";\n }\n return false;\n}\nexport function isStruct(\n type: PropertyTypeType,\n): type is PropertyTypeTypeStruct {\n return typeof type === \"object\" && type.type === \"struct\";\n}\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport interface StructPropertyType extends\n Optional<\n Omit<\n StructFieldType,\n \"fieldType\" | \"structFieldRid\" | \"apiName\"\n >,\n \"typeClasses\" | \"aliases\"\n >\n{\n fieldType: PropertyTypeTypesWithoutStruct;\n requireImplementation?: boolean;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiEA,OAAO,SAASA,kBAAkBA,CAChCC,CAAmB,EACI;EACvB,OAAOA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IACjCA,CAAC,KAAK,MAAM,IAAIA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,QAAQ,IACjDA,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,UAAU,IAAIA,CAAC,KAAK,UAAU,IACrDA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC9B,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,CAACC,IAAI,KAAK,SAAU,IAC/CD,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,QAAQ,IAC/BA,CAAC,KAAK,WAAW;AACxB;AACA,OAAO,SAASE,QAAQA,CACtBD,IAAkC,EACF;EAChC,IAAIA,IAAI,KAAKE,SAAS,EAAE;IACtB,OAAO,KAAK;EACd;EACA,IAAI,OAAOF,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAACG,QAAQ,CACzEH,IACF,CAAC;EACH,CAAC,MAAM,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,IAAI,IAAI,EAAE;IACnD,OAAOA,IAAI,CAACA,IAAI,KAAK,SAAS,IAAIA,IAAI,CAACA,IAAI,KAAK,QAAQ,IACnDA,IAAI,CAACA,IAAI,KAAK,QAAQ,IACtBA,IAAI,CAACA,IAAI,KAAK,SAAS;EAC9B;EACA,OAAO,KAAK;AACd;AACA,OAAO,SAASI,QAAQA,CACtBJ,IAAsB,EACU;EAChC,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACA,IAAI,KAAK,QAAQ;AAC3D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"SharedPropertyType.js","names":[],"sources":["SharedPropertyType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrBaseFormatter,\n OntologyIrValueTypeReferenceWithMetadata,\n SharedPropertyTypeGothamMapping,\n Visibility,\n} from \"@osdk/client.unstable\";\nimport type { OntologyEntityBase } from \"../common/OntologyEntityBase.js\";\nimport type { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { TypeClass } from \"../common/TypeClass.js\";\nimport type { Nullability } from \"./Nullability.js\";\nimport type { PropertyTypeType } from \"./PropertyTypeType.js\";\n\nexport interface SharedPropertyType extends OntologyEntityBase, PropertyType {\n apiName: string;\n nonNameSpacedApiName: string;\n gothamMapping?: SharedPropertyTypeGothamMapping;\n baseFormatter?: OntologyIrBaseFormatter;\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE;\n}\nexport interface PropertyType {\n type: PropertyTypeType;\n array?: boolean;\n description?: string;\n displayName?: string;\n valueType?: OntologyIrValueTypeReferenceWithMetadata;\n visibility?: Visibility;\n typeClasses?: TypeClass[];\n nullability?: Nullability;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"SharedPropertyType.js","names":[],"sources":["SharedPropertyType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrBaseFormatter,\n OntologyIrValueTypeReferenceWithMetadata,\n SharedPropertyTypeGothamMapping,\n Visibility,\n} from \"@osdk/client.unstable\";\nimport type { OntologyEntityBase } from \"../common/OntologyEntityBase.js\";\nimport type { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { TypeClass } from \"../common/TypeClass.js\";\nimport type { Nullability } from \"./Nullability.js\";\nimport type { PropertyTypeType } from \"./PropertyTypeType.js\";\n\nexport interface SharedPropertyType extends OntologyEntityBase, PropertyType {\n apiName: string;\n nonNameSpacedApiName: string;\n aliases?: Array<string>;\n gothamMapping?: SharedPropertyTypeGothamMapping;\n baseFormatter?: OntologyIrBaseFormatter;\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE;\n}\nexport interface PropertyType {\n type: PropertyTypeType;\n array?: boolean;\n description?: string;\n displayName?: string;\n valueType?: OntologyIrValueTypeReferenceWithMetadata;\n visibility?: Visibility;\n typeClasses?: TypeClass[];\n nullability?: Nullability;\n}\n"],"mappings":"","ignoreList":[]}