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

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 (154) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/browser/api/action/ActionParameter.js.map +1 -1
  3. package/build/browser/api/action/ActionParameterConfiguration.js.map +1 -1
  4. package/build/browser/api/defineAction.js +65 -22
  5. package/build/browser/api/defineAction.js.map +1 -1
  6. package/build/browser/api/defineCreateInterfaceObjectAction.js +28 -8
  7. package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
  8. package/build/browser/api/defineInterface.js +40 -34
  9. package/build/browser/api/defineInterface.js.map +1 -1
  10. package/build/browser/api/defineModifyInterfaceObjectAction.js +31 -8
  11. package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
  12. package/build/browser/api/defineObject.js +13 -9
  13. package/build/browser/api/defineObject.js.map +1 -1
  14. package/build/browser/api/defineSpt.js.map +1 -1
  15. package/build/browser/api/interface/InterfacePropertyType.js +22 -1
  16. package/build/browser/api/interface/InterfacePropertyType.js.map +1 -1
  17. package/build/browser/api/interface/InterfaceType.js.map +1 -1
  18. package/build/browser/api/interface/getFlattenedInterfaceProperties.js +9 -3
  19. package/build/browser/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
  20. package/build/browser/api/object/ObjectType.js.map +1 -1
  21. package/build/browser/api/object/ObjectTypeDefinition.js.map +1 -1
  22. package/build/browser/api/properties/PropertyTypeType.js +1 -1
  23. package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
  24. package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
  25. package/build/browser/api/test/actions.test.js +6105 -5850
  26. package/build/browser/api/test/actions.test.js.map +1 -1
  27. package/build/browser/api/test/interfaces.test.js +723 -470
  28. package/build/browser/api/test/interfaces.test.js.map +1 -1
  29. package/build/browser/api/test/links.test.js +1334 -1325
  30. package/build/browser/api/test/links.test.js.map +1 -1
  31. package/build/browser/api/test/misc.test.js +262 -11
  32. package/build/browser/api/test/misc.test.js.map +1 -1
  33. package/build/browser/api/test/objects.test.js +1019 -960
  34. package/build/browser/api/test/objects.test.js.map +1 -1
  35. package/build/browser/api/test/spt.test.js +250 -103
  36. package/build/browser/api/test/spt.test.js.map +1 -1
  37. package/build/browser/cli/main.js +1 -1
  38. package/build/browser/conversion/toMarketplace/convertActionValidation.js +1 -1
  39. package/build/browser/conversion/toMarketplace/convertActionValidation.js.map +1 -1
  40. package/build/browser/conversion/toMarketplace/convertInterface.js +2 -2
  41. package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
  42. package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
  43. package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
  44. package/build/browser/conversion/toMarketplace/convertMappingValue.js +35 -0
  45. package/build/browser/conversion/toMarketplace/convertMappingValue.js.map +1 -1
  46. package/build/browser/conversion/toMarketplace/convertObject.js +4 -2
  47. package/build/browser/conversion/toMarketplace/convertObject.js.map +1 -1
  48. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
  49. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  50. package/build/browser/conversion/toMarketplace/convertSpt.js +4 -2
  51. package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
  52. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
  53. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
  54. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
  55. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  56. package/build/browser/index.js.map +1 -1
  57. package/build/cjs/index.cjs +386 -109
  58. package/build/cjs/index.cjs.map +1 -1
  59. package/build/cjs/index.d.cts +28 -13
  60. package/build/esm/api/action/ActionParameter.js.map +1 -1
  61. package/build/esm/api/action/ActionParameterConfiguration.js.map +1 -1
  62. package/build/esm/api/defineAction.js +65 -22
  63. package/build/esm/api/defineAction.js.map +1 -1
  64. package/build/esm/api/defineCreateInterfaceObjectAction.js +28 -8
  65. package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
  66. package/build/esm/api/defineInterface.js +40 -34
  67. package/build/esm/api/defineInterface.js.map +1 -1
  68. package/build/esm/api/defineModifyInterfaceObjectAction.js +31 -8
  69. package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
  70. package/build/esm/api/defineObject.js +13 -9
  71. package/build/esm/api/defineObject.js.map +1 -1
  72. package/build/esm/api/defineSpt.js.map +1 -1
  73. package/build/esm/api/interface/InterfacePropertyType.js +22 -1
  74. package/build/esm/api/interface/InterfacePropertyType.js.map +1 -1
  75. package/build/esm/api/interface/InterfaceType.js.map +1 -1
  76. package/build/esm/api/interface/getFlattenedInterfaceProperties.js +9 -3
  77. package/build/esm/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
  78. package/build/esm/api/object/ObjectType.js.map +1 -1
  79. package/build/esm/api/object/ObjectTypeDefinition.js.map +1 -1
  80. package/build/esm/api/properties/PropertyTypeType.js +1 -1
  81. package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
  82. package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
  83. package/build/esm/api/test/actions.test.js +6105 -5850
  84. package/build/esm/api/test/actions.test.js.map +1 -1
  85. package/build/esm/api/test/interfaces.test.js +723 -470
  86. package/build/esm/api/test/interfaces.test.js.map +1 -1
  87. package/build/esm/api/test/links.test.js +1334 -1325
  88. package/build/esm/api/test/links.test.js.map +1 -1
  89. package/build/esm/api/test/misc.test.js +262 -11
  90. package/build/esm/api/test/misc.test.js.map +1 -1
  91. package/build/esm/api/test/objects.test.js +1019 -960
  92. package/build/esm/api/test/objects.test.js.map +1 -1
  93. package/build/esm/api/test/spt.test.js +250 -103
  94. package/build/esm/api/test/spt.test.js.map +1 -1
  95. package/build/esm/cli/main.js +1 -1
  96. package/build/esm/conversion/toMarketplace/convertActionValidation.js +1 -1
  97. package/build/esm/conversion/toMarketplace/convertActionValidation.js.map +1 -1
  98. package/build/esm/conversion/toMarketplace/convertInterface.js +2 -2
  99. package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
  100. package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
  101. package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
  102. package/build/esm/conversion/toMarketplace/convertMappingValue.js +35 -0
  103. package/build/esm/conversion/toMarketplace/convertMappingValue.js.map +1 -1
  104. package/build/esm/conversion/toMarketplace/convertObject.js +4 -2
  105. package/build/esm/conversion/toMarketplace/convertObject.js.map +1 -1
  106. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
  107. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  108. package/build/esm/conversion/toMarketplace/convertSpt.js +4 -2
  109. package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
  110. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
  111. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
  112. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
  113. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  114. package/build/esm/index.js.map +1 -1
  115. package/build/types/api/action/ActionParameter.d.ts +2 -1
  116. package/build/types/api/action/ActionParameter.d.ts.map +1 -1
  117. package/build/types/api/action/ActionParameterConfiguration.d.ts +2 -1
  118. package/build/types/api/action/ActionParameterConfiguration.d.ts.map +1 -1
  119. package/build/types/api/defineAction.d.ts +4 -3
  120. package/build/types/api/defineAction.d.ts.map +1 -1
  121. package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
  122. package/build/types/api/defineInterface.d.ts +5 -5
  123. package/build/types/api/defineInterface.d.ts.map +1 -1
  124. package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
  125. package/build/types/api/defineObject.d.ts.map +1 -1
  126. package/build/types/api/defineSpt.d.ts +3 -0
  127. package/build/types/api/defineSpt.d.ts.map +1 -1
  128. package/build/types/api/interface/InterfacePropertyType.d.ts +12 -2
  129. package/build/types/api/interface/InterfacePropertyType.d.ts.map +1 -1
  130. package/build/types/api/interface/InterfaceType.d.ts +3 -2
  131. package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
  132. package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts +1 -1
  133. package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts.map +1 -1
  134. package/build/types/api/object/ObjectType.d.ts +1 -0
  135. package/build/types/api/object/ObjectType.d.ts.map +1 -1
  136. package/build/types/api/object/ObjectTypeDefinition.d.ts +1 -0
  137. package/build/types/api/object/ObjectTypeDefinition.d.ts.map +1 -1
  138. package/build/types/api/properties/PropertyTypeType.d.ts +1 -0
  139. package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
  140. package/build/types/api/properties/SharedPropertyType.d.ts +1 -0
  141. package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
  142. package/build/types/conversion/toMarketplace/convertInterface.d.ts.map +1 -1
  143. package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts +3 -0
  144. package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts.map +1 -0
  145. package/build/types/conversion/toMarketplace/convertMappingValue.d.ts +2 -1
  146. package/build/types/conversion/toMarketplace/convertMappingValue.d.ts.map +1 -1
  147. package/build/types/conversion/toMarketplace/convertObject.d.ts.map +1 -1
  148. package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
  149. package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
  150. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts +3 -0
  151. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts.map +1 -0
  152. package/build/types/index.d.ts +1 -0
  153. package/build/types/index.d.ts.map +1 -1
  154. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"convertInterface.js","names":["convertSpt","convertInterface","interfaceType","__type","other","propertiesV2","Object","fromEntries","values","map","spt","sharedPropertyType","apiName","required","displayMetadata","displayName","description","icon","type","blueprint","color","locator","extendsInterfaces","i","properties","propertiesV3"],"sources":["convertInterface.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 { OntologyIrMarketplaceInterfaceType } from \"@osdk/client.unstable\";\nimport type { InterfaceType } from \"../../api/interface/InterfaceType.js\";\nimport { convertSpt } from \"./convertSpt.js\";\n\nexport function convertInterface(\n interfaceType: InterfaceType,\n): OntologyIrMarketplaceInterfaceType {\n const { __type, ...other } = interfaceType;\n return {\n ...other,\n propertiesV2: Object.fromEntries(\n Object.values(interfaceType.propertiesV2)\n .map((\n spt,\n ) => [spt.sharedPropertyType.apiName, {\n required: spt.required,\n sharedPropertyType: convertSpt(spt.sharedPropertyType),\n }]),\n ),\n displayMetadata: {\n displayName: interfaceType.displayMetadata.displayName,\n description: interfaceType.displayMetadata.description,\n icon: interfaceType.displayMetadata.icon ?? {\n type: \"blueprint\",\n blueprint: { color: \"#4C90F0\", locator: \"layout-hierarchy\" },\n },\n },\n extendsInterfaces: interfaceType.extendsInterfaces.map(i => i.apiName),\n // these are omitted from our internal types but we need to re-add them for the final json\n properties: [],\n // TODO(mwalther): Support propertiesV3\n propertiesV3: {},\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,UAAU,QAAQ,iBAAiB;AAE5C,OAAO,SAASC,gBAAgBA,CAC9BC,aAA4B,EACQ;EACpC,MAAM;IAAEC,MAAM;IAAE,GAAGC;EAAM,CAAC,GAAGF,aAAa;EAC1C,OAAO;IACL,GAAGE,KAAK;IACRC,YAAY,EAAEC,MAAM,CAACC,WAAW,CAC9BD,MAAM,CAACE,MAAM,CAACN,aAAa,CAACG,YAAY,CAAC,CACtCI,GAAG,CACFC,GAAG,IACA,CAACA,GAAG,CAACC,kBAAkB,CAACC,OAAO,EAAE;MACpCC,QAAQ,EAAEH,GAAG,CAACG,QAAQ;MACtBF,kBAAkB,EAAEX,UAAU,CAACU,GAAG,CAACC,kBAAkB;IACvD,CAAC,CAAC,CACN,CAAC;IACDG,eAAe,EAAE;MACfC,WAAW,EAAEb,aAAa,CAACY,eAAe,CAACC,WAAW;MACtDC,WAAW,EAAEd,aAAa,CAACY,eAAe,CAACE,WAAW;MACtDC,IAAI,EAAEf,aAAa,CAACY,eAAe,CAACG,IAAI,IAAI;QAC1CC,IAAI,EAAE,WAAW;QACjBC,SAAS,EAAE;UAAEC,KAAK,EAAE,SAAS;UAAEC,OAAO,EAAE;QAAmB;MAC7D;IACF,CAAC;IACDC,iBAAiB,EAAEpB,aAAa,CAACoB,iBAAiB,CAACb,GAAG,CAACc,CAAC,IAAIA,CAAC,CAACX,OAAO,CAAC;IACtE;IACAY,UAAU,EAAE,EAAE;IACd;IACAC,YAAY,EAAE,CAAC;EACjB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"convertInterface.js","names":["convertInterfaceProperty","convertSpt","convertInterface","interfaceType","__type","other","propertiesV2","Object","fromEntries","values","map","spt","sharedPropertyType","apiName","required","displayMetadata","displayName","description","icon","type","blueprint","color","locator","extendsInterfaces","i","properties","propertiesV3","entries","prop"],"sources":["convertInterface.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 { OntologyIrMarketplaceInterfaceType } from \"@osdk/client.unstable\";\nimport type { InterfaceType } from \"../../api/interface/InterfaceType.js\";\nimport { convertInterfaceProperty } from \"./convertInterfacePropertyType.js\";\nimport { convertSpt } from \"./convertSpt.js\";\n\nexport function convertInterface(\n interfaceType: InterfaceType,\n): OntologyIrMarketplaceInterfaceType {\n const { __type, ...other } = interfaceType;\n return {\n ...other,\n propertiesV2: Object.fromEntries(\n Object.values(interfaceType.propertiesV2)\n .map((\n spt,\n ) => [spt.sharedPropertyType.apiName, {\n required: spt.required,\n sharedPropertyType: convertSpt(spt.sharedPropertyType),\n }]),\n ),\n displayMetadata: {\n displayName: interfaceType.displayMetadata.displayName,\n description: interfaceType.displayMetadata.description,\n icon: interfaceType.displayMetadata.icon ?? {\n type: \"blueprint\",\n blueprint: { color: \"#4C90F0\", locator: \"layout-hierarchy\" },\n },\n },\n extendsInterfaces: interfaceType.extendsInterfaces.map(i => i.apiName),\n // these are omitted from our internal types but we need to re-add them for the final json\n properties: [],\n propertiesV3: Object.fromEntries(\n Object.entries(interfaceType.propertiesV3).map(([apiName, prop]) =>\n convertInterfaceProperty(prop, apiName)\n ),\n ),\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,wBAAwB,QAAQ,mCAAmC;AAC5E,SAASC,UAAU,QAAQ,iBAAiB;AAE5C,OAAO,SAASC,gBAAgBA,CAC9BC,aAA4B,EACQ;EACpC,MAAM;IAAEC,MAAM;IAAE,GAAGC;EAAM,CAAC,GAAGF,aAAa;EAC1C,OAAO;IACL,GAAGE,KAAK;IACRC,YAAY,EAAEC,MAAM,CAACC,WAAW,CAC9BD,MAAM,CAACE,MAAM,CAACN,aAAa,CAACG,YAAY,CAAC,CACtCI,GAAG,CACFC,GAAG,IACA,CAACA,GAAG,CAACC,kBAAkB,CAACC,OAAO,EAAE;MACpCC,QAAQ,EAAEH,GAAG,CAACG,QAAQ;MACtBF,kBAAkB,EAAEX,UAAU,CAACU,GAAG,CAACC,kBAAkB;IACvD,CAAC,CAAC,CACN,CAAC;IACDG,eAAe,EAAE;MACfC,WAAW,EAAEb,aAAa,CAACY,eAAe,CAACC,WAAW;MACtDC,WAAW,EAAEd,aAAa,CAACY,eAAe,CAACE,WAAW;MACtDC,IAAI,EAAEf,aAAa,CAACY,eAAe,CAACG,IAAI,IAAI;QAC1CC,IAAI,EAAE,WAAW;QACjBC,SAAS,EAAE;UAAEC,KAAK,EAAE,SAAS;UAAEC,OAAO,EAAE;QAAmB;MAC7D;IACF,CAAC;IACDC,iBAAiB,EAAEpB,aAAa,CAACoB,iBAAiB,CAACb,GAAG,CAACc,CAAC,IAAIA,CAAC,CAACX,OAAO,CAAC;IACtE;IACAY,UAAU,EAAE,EAAE;IACdC,YAAY,EAAEnB,MAAM,CAACC,WAAW,CAC9BD,MAAM,CAACoB,OAAO,CAACxB,aAAa,CAACuB,YAAY,CAAC,CAAChB,GAAG,CAAC,CAAC,CAACG,OAAO,EAAEe,IAAI,CAAC,KAC7D5B,wBAAwB,CAAC4B,IAAI,EAAEf,OAAO,CACxC,CACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,66 @@
1
+ /*
2
+ * Copyright 2026 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
+ import { isInterfaceSharedPropertyType } from "../../api/interface/InterfacePropertyType.js";
18
+ import { convertNullabilityToDataConstraint } from "./convertNullabilityToDataConstraint.js";
19
+ import { convertSpt } from "./convertSpt.js";
20
+ import { propertyTypeTypeToOntologyIrInterfaceType } from "./propertyTypeTypeToOntologyIrInterfaceType.js";
21
+ export function convertInterfaceProperty(prop, apiName) {
22
+ if (isInterfaceSharedPropertyType(prop)) {
23
+ return [prop.sharedPropertyType.apiName, {
24
+ type: "sharedPropertyBasedPropertyType",
25
+ sharedPropertyBasedPropertyType: {
26
+ requireImplementation: prop.required,
27
+ sharedPropertyType: convertSpt(prop.sharedPropertyType)
28
+ }
29
+ }];
30
+ } else {
31
+ return [apiName, {
32
+ type: "interfaceDefinedPropertyType",
33
+ interfaceDefinedPropertyType: {
34
+ apiName: apiName,
35
+ displayMetadata: {
36
+ displayName: prop.displayName ?? apiName,
37
+ visibility: prop.visibility ?? "NORMAL",
38
+ description: prop.description
39
+ },
40
+ type: prop.array ? {
41
+ type: "array",
42
+ array: {
43
+ subtype: propertyTypeTypeToOntologyIrInterfaceType(prop.type)
44
+ }
45
+ } : propertyTypeTypeToOntologyIrInterfaceType(prop.type),
46
+ constraints: {
47
+ primaryKeyConstraint: prop.primaryKeyConstraint ?? "NO_RESTRICTION",
48
+ requireImplementation: prop.required ?? true,
49
+ indexedForSearch: true,
50
+ typeClasses: prop.typeClasses ?? [],
51
+ dataConstraints: convertNullabilityToDataConstraint({
52
+ type: prop.type,
53
+ nullability: prop.nullability
54
+ }),
55
+ valueType: prop.valueType ? {
56
+ apiName: prop.valueType.apiName,
57
+ version: prop.valueType.version,
58
+ packageNamespace: prop.valueType.packageNamespace,
59
+ displayMetadata: prop.valueType.displayMetadata
60
+ } : undefined
61
+ }
62
+ }
63
+ }];
64
+ }
65
+ }
66
+ //# sourceMappingURL=convertInterfacePropertyType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertInterfacePropertyType.js","names":["isInterfaceSharedPropertyType","convertNullabilityToDataConstraint","convertSpt","propertyTypeTypeToOntologyIrInterfaceType","convertInterfaceProperty","prop","apiName","sharedPropertyType","type","sharedPropertyBasedPropertyType","requireImplementation","required","interfaceDefinedPropertyType","displayMetadata","displayName","visibility","description","array","subtype","constraints","primaryKeyConstraint","indexedForSearch","typeClasses","dataConstraints","nullability","valueType","version","packageNamespace","undefined"],"sources":["convertInterfacePropertyType.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OntologyIrMarketplaceInterfacePropertyType } from \"@osdk/client.unstable\";\nimport {\n type InterfacePropertyType,\n isInterfaceSharedPropertyType,\n} from \"../../api/interface/InterfacePropertyType.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertSpt } from \"./convertSpt.js\";\nimport { propertyTypeTypeToOntologyIrInterfaceType } from \"./propertyTypeTypeToOntologyIrInterfaceType.js\";\n\nexport function convertInterfaceProperty(\n prop: InterfacePropertyType,\n apiName: string,\n): [string, OntologyIrMarketplaceInterfacePropertyType] {\n if (isInterfaceSharedPropertyType(prop)) {\n return [prop.sharedPropertyType.apiName, {\n type: \"sharedPropertyBasedPropertyType\",\n sharedPropertyBasedPropertyType: {\n requireImplementation: prop.required,\n sharedPropertyType: convertSpt(prop.sharedPropertyType),\n },\n }];\n } else {\n return [apiName, {\n type: \"interfaceDefinedPropertyType\",\n interfaceDefinedPropertyType: {\n apiName: apiName,\n displayMetadata: {\n displayName: prop.displayName ?? apiName,\n visibility: prop.visibility ?? \"NORMAL\",\n description: prop.description,\n },\n type: prop.array\n ? {\n type: \"array\" as const,\n array: {\n subtype: propertyTypeTypeToOntologyIrInterfaceType(prop.type),\n },\n }\n : propertyTypeTypeToOntologyIrInterfaceType(prop.type),\n constraints: {\n primaryKeyConstraint: prop.primaryKeyConstraint ?? \"NO_RESTRICTION\",\n requireImplementation: prop.required ?? true,\n indexedForSearch: true,\n typeClasses: prop.typeClasses ?? [],\n dataConstraints: convertNullabilityToDataConstraint({\n type: prop.type,\n nullability: prop.nullability,\n }),\n valueType: prop.valueType\n ? {\n apiName: prop.valueType.apiName,\n version: prop.valueType.version,\n packageNamespace: prop.valueType.packageNamespace,\n displayMetadata: prop.valueType.displayMetadata,\n }\n : undefined,\n },\n },\n }];\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAEEA,6BAA6B,QACxB,8CAA8C;AACrD,SAASC,kCAAkC,QAAQ,yCAAyC;AAC5F,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,yCAAyC,QAAQ,gDAAgD;AAE1G,OAAO,SAASC,wBAAwBA,CACtCC,IAA2B,EAC3BC,OAAe,EACuC;EACtD,IAAIN,6BAA6B,CAACK,IAAI,CAAC,EAAE;IACvC,OAAO,CAACA,IAAI,CAACE,kBAAkB,CAACD,OAAO,EAAE;MACvCE,IAAI,EAAE,iCAAiC;MACvCC,+BAA+B,EAAE;QAC/BC,qBAAqB,EAAEL,IAAI,CAACM,QAAQ;QACpCJ,kBAAkB,EAAEL,UAAU,CAACG,IAAI,CAACE,kBAAkB;MACxD;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 export function convertInterfacePropertyMappingValue(value) {
19
+ switch (value.type) {
20
+ case "uuid":
21
+ return {
22
+ type: "logicRuleValue",
23
+ logicRuleValue: {
24
+ type: "uniqueIdentifier",
25
+ uniqueIdentifier: {
26
+ linkId: value.linkId ?? randomUUID()
27
+ }
28
+ }
29
+ };
30
+ case "currentTime":
31
+ return {
32
+ type: "logicRuleValue",
33
+ logicRuleValue: {
34
+ type: "currentTime",
35
+ currentTime: {}
36
+ }
37
+ };
38
+ case "currentUser":
39
+ return {
40
+ type: "logicRuleValue",
41
+ logicRuleValue: {
42
+ type: "currentUser",
43
+ currentUser: {}
44
+ }
45
+ };
46
+ default:
47
+ return {
48
+ type: "logicRuleValue",
49
+ logicRuleValue: value
50
+ };
51
+ }
52
+ }
18
53
  export function convertMappingValue(value) {
19
54
  switch (value.type) {
20
55
  case "uuid":
@@ -1 +1 @@
1
- {"version":3,"file":"convertMappingValue.js","names":["randomUUID","convertMappingValue","value","type","uniqueIdentifier","linkId","currentTime","currentUser"],"sources":["convertMappingValue.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 { OntologyIrLogicRuleValue } from \"@osdk/client.unstable\";\nimport { randomUUID } from \"crypto\";\nimport type { MappingValue } from \"../../api/action/MappingValue.js\";\n\nexport function convertMappingValue(\n value: MappingValue,\n): OntologyIrLogicRuleValue {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID(),\n },\n };\n case \"currentTime\":\n return {\n type: \"currentTime\",\n currentTime: {},\n };\n case \"currentUser\":\n return {\n type: \"currentUser\",\n currentUser: {},\n };\n default:\n return value;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,UAAU,QAAQ,QAAQ;AAGnC,OAAO,SAASC,mBAAmBA,CACjCC,KAAmB,EACO;EAC1B,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,MAAM;MACT,OAAO;QACLA,IAAI,EAAE,kBAAkB;QACxBC,gBAAgB,EAAE;UAChBC,MAAM,EAAEH,KAAK,CAACG,MAAM,IAAIL,UAAU,CAAC;QACrC;MACF,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLG,IAAI,EAAE,aAAa;QACnBG,WAAW,EAAE,CAAC;MAChB,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLH,IAAI,EAAE,aAAa;QACnBI,WAAW,EAAE,CAAC;MAChB,CAAC;IACH;MACE,OAAOL,KAAK;EAChB;AACF","ignoreList":[]}
1
+ {"version":3,"file":"convertMappingValue.js","names":["randomUUID","convertInterfacePropertyMappingValue","value","type","logicRuleValue","uniqueIdentifier","linkId","currentTime","currentUser","convertMappingValue"],"sources":["convertMappingValue.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 OntologyIrInterfacePropertyLogicRuleValue,\n OntologyIrLogicRuleValue,\n} from \"@osdk/client.unstable\";\nimport { randomUUID } from \"crypto\";\nimport type { MappingValue } from \"../../api/action/MappingValue.js\";\n\nexport function convertInterfacePropertyMappingValue(\n value: MappingValue,\n): OntologyIrInterfacePropertyLogicRuleValue {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID(),\n },\n },\n };\n case \"currentTime\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"currentTime\",\n currentTime: {},\n },\n };\n case \"currentUser\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"currentUser\",\n currentUser: {},\n },\n };\n default:\n return {\n type: \"logicRuleValue\",\n logicRuleValue: value,\n };\n }\n}\n\nexport function convertMappingValue(\n value: MappingValue,\n): OntologyIrLogicRuleValue {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID(),\n },\n };\n case \"currentTime\":\n return {\n type: \"currentTime\",\n currentTime: {},\n };\n case \"currentUser\":\n return {\n type: \"currentUser\",\n currentUser: {},\n };\n default:\n return value;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASA,UAAU,QAAQ,QAAQ;AAGnC,OAAO,SAASC,oCAAoCA,CAClDC,KAAmB,EACwB;EAC3C,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,MAAM;MACT,OAAO;QACLA,IAAI,EAAE,gBAAgB;QACtBC,cAAc,EAAE;UACdD,IAAI,EAAE,kBAAkB;UACxBE,gBAAgB,EAAE;YAChBC,MAAM,EAAEJ,KAAK,CAACI,MAAM,IAAIN,UAAU,CAAC;UACrC;QACF;MACF,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLG,IAAI,EAAE,gBAAgB;QACtBC,cAAc,EAAE;UACdD,IAAI,EAAE,aAAa;UACnBI,WAAW,EAAE,CAAC;QAChB;MACF,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLJ,IAAI,EAAE,gBAAgB;QACtBC,cAAc,EAAE;UACdD,IAAI,EAAE,aAAa;UACnBK,WAAW,EAAE,CAAC;QAChB;MACF,CAAC;IACH;MACE,OAAO;QACLL,IAAI,EAAE,gBAAgB;QACtBC,cAAc,EAAEF;MAClB,CAAC;EACL;AACF;AAEA,OAAO,SAASO,mBAAmBA,CACjCP,KAAmB,EACO;EAC1B,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,MAAM;MACT,OAAO;QACLA,IAAI,EAAE,kBAAkB;QACxBE,gBAAgB,EAAE;UAChBC,MAAM,EAAEJ,KAAK,CAACI,MAAM,IAAIN,UAAU,CAAC;QACrC;MACF,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLG,IAAI,EAAE,aAAa;QACnBI,WAAW,EAAE,CAAC;MAChB,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLJ,IAAI,EAAE,aAAa;QACnBK,WAAW,EAAE,CAAC;MAChB,CAAC;IACH;MACE,OAAON,KAAK;EAChB;AACF","ignoreList":[]}
@@ -64,7 +64,8 @@ export function convertObject(objectType) {
64
64
  },
65
65
  datasources: [...propertyDatasources, ...derivedDatasources, objectDatasource],
66
66
  entityMetadata: {
67
- arePatchesEnabled: objectType.editsEnabled ?? false
67
+ arePatchesEnabled: objectType.editsEnabled ?? false,
68
+ aliases: objectType.aliases ?? []
68
69
  }
69
70
  };
70
71
  }
@@ -101,7 +102,8 @@ export function extractPropertyDatasource(property, objectTypeApiName) {
101
102
  mediaSetView: {
102
103
  assumedMarkings: [],
103
104
  mediaSetViewLocator: identifier,
104
- properties: [property.apiName]
105
+ properties: [property.apiName],
106
+ uploadProperties: []
105
107
  }
106
108
  };
107
109
  return [buildDatasource(property.apiName, mediaSetDefinition)];
@@ -1 +1 @@
1
- {"version":3,"file":"convertObject.js","names":["addNamespaceIfNone","buildDatasource","cleanAndValidateLinkTypeId","convertObjectStatus","isExotic","convertDatasourceDefinition","convertObjectPropertyType","convertObject","objectType","derivedDatasources","derivedPropertyNames","extractDerivedDatasources","propertyDatasources","properties","filter","prop","includes","apiName","flatMap","extractPropertyDatasource","classificationGroupMarkingNames","extractMarkingGroups","mandatoryMarkingNames","classificationInputGroup","length","reduce","l","r","undefined","mandatoryInputGroup","objectDatasource","implementations","implementsInterfaces","displayMetadata","description","displayName","groupDisplayName","icon","type","blueprint","locator","color","pluralDisplayName","visibility","primaryKeys","primaryKeyPropertyApiName","propertyTypes","Object","fromEntries","map","val","titlePropertyTypeRid","titlePropertyApiName","status","redacted","implementsInterfaces2","impl","interfaceTypeApiName","implements","linksV2","propertiesV2","propertyMapping","mapping","interfaceProperty","propertyTypeRid","mapsTo","allImplementsInterfaces","datasources","entityMetadata","arePatchesEnabled","editsEnabled","markingType","markingInputGroupName","property","objectTypeApiName","identifier","geotimeDefinition","geotimeSeries","geotimeSeriesIntegrationRid","mediaSetDefinition","mediaSetView","assumedMarkings","mediaSetViewLocator","inputDerivedDatasources","ds","i","buildDerivedDatasource","keys","datasource","index","linkDefinition","multiHopLink","steps","step","searchAround","linkTypeIdentifier","linkType","linkTypeSide","side","isLinkedProperties","values","derivedDefinition","linkedProperties","propertyTypeMapping","entries","sourceProp","targetProp","propertyType","aggregatedProperties","agg","buildAggregation","toString","derived","definition","limit","foreignProperty","innerDef"],"sources":["convertObject.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 OntologyIrDerivedPropertiesDefinition,\n OntologyIrDerivedPropertyAggregation,\n OntologyIrObjectTypeBlockDataV2,\n OntologyIrObjectTypeDatasource,\n OntologyIrObjectTypeDatasourceDefinition,\n OntologyIrPropertyType,\n} from \"@osdk/client.unstable\";\nimport {\n addNamespaceIfNone,\n buildDatasource,\n cleanAndValidateLinkTypeId,\n convertObjectStatus,\n} from \"../../api/defineOntology.js\";\nimport type { ObjectPropertyType } from \"../../api/object/ObjectPropertyType.js\";\nimport type { ObjectType } from \"../../api/object/ObjectType.js\";\nimport type {\n DerivedPropertyAggregation,\n ObjectTypeDatasourceDefinition_derived,\n} from \"../../api/object/ObjectTypeDatasourceDefinition.js\";\nimport { isExotic } from \"../../api/properties/PropertyTypeType.js\";\nimport { convertDatasourceDefinition } from \"./convertDatasourceDefinition.js\";\nimport { convertObjectPropertyType } from \"./convertObjectPropertyType.js\";\n\nexport function convertObject(\n objectType: ObjectType,\n): OntologyIrObjectTypeBlockDataV2 {\n const { derivedDatasources, derivedPropertyNames } =\n extractDerivedDatasources(objectType);\n\n const propertyDatasources: OntologyIrObjectTypeDatasource[] =\n (objectType.properties ?? [])\n .filter(prop => !derivedPropertyNames.includes(prop.apiName))\n .flatMap(prop => extractPropertyDatasource(prop, objectType.apiName));\n\n const classificationGroupMarkingNames = extractMarkingGroups(\n objectType.properties ?? [],\n \"CBAC\",\n );\n\n const mandatoryMarkingNames = extractMarkingGroups(\n objectType.properties ?? [],\n \"MANDATORY\",\n );\n\n const classificationInputGroup = classificationGroupMarkingNames.length > 0\n ? classificationGroupMarkingNames.reduce((l, r) => l + \"/\" + r)\n : undefined;\n\n const mandatoryInputGroup = mandatoryMarkingNames.length > 0\n ? mandatoryMarkingNames.reduce((l, r) => l + \"/\" + r)\n : undefined;\n\n const objectDatasource = buildDatasource(\n objectType.apiName,\n convertDatasourceDefinition(\n objectType,\n (objectType.properties ?? []).filter(prop =>\n !derivedPropertyNames.includes(prop.apiName)\n ),\n ),\n classificationInputGroup,\n mandatoryInputGroup,\n );\n\n const implementations = objectType.implementsInterfaces ?? [];\n\n return {\n objectType: {\n displayMetadata: {\n description: objectType.description,\n displayName: objectType.displayName,\n groupDisplayName: undefined,\n icon: {\n type: \"blueprint\",\n blueprint: objectType.icon ?? { locator: \"cube\", color: \"#2D72D2\" },\n },\n pluralDisplayName: objectType.pluralDisplayName,\n visibility: objectType.visibility ?? \"NORMAL\",\n },\n primaryKeys: [objectType.primaryKeyPropertyApiName],\n propertyTypes: Object.fromEntries(\n objectType.properties?.map<[string, OntologyIrPropertyType]>(\n val => [val.apiName, convertObjectPropertyType(val)],\n ) ?? [],\n ),\n titlePropertyTypeRid: objectType.titlePropertyApiName,\n apiName: objectType.apiName,\n status: convertObjectStatus(objectType.status),\n redacted: false,\n implementsInterfaces2: implementations.map(impl => ({\n interfaceTypeApiName: impl.implements.apiName,\n linksV2: {},\n propertiesV2: {},\n properties: Object.fromEntries(\n impl.propertyMapping.map(\n mapping => [addNamespaceIfNone(mapping.interfaceProperty), {\n propertyTypeRid: mapping.mapsTo,\n }],\n ),\n ),\n })),\n allImplementsInterfaces: {},\n },\n datasources: [\n ...propertyDatasources,\n ...derivedDatasources,\n objectDatasource,\n ],\n entityMetadata: { arePatchesEnabled: objectType.editsEnabled ?? false },\n };\n}\n\n/**\n * Extracts marking group names of a specific type from object properties\n */\nexport function extractMarkingGroups(\n properties: ObjectPropertyType[],\n markingType: \"CBAC\" | \"MANDATORY\",\n): string[] {\n return properties\n .map(prop => {\n if (\n typeof prop.type === \"object\"\n && prop.type.type === \"marking\"\n && prop.type.markingType === markingType\n ) {\n return prop.type.markingInputGroupName;\n }\n return undefined;\n })\n .filter((val): val is string => val !== undefined);\n}\nexport function extractPropertyDatasource(\n property: ObjectPropertyType,\n objectTypeApiName: string,\n): OntologyIrObjectTypeDatasource[] {\n if (!isExotic(property.type)) {\n return [];\n }\n const identifier = objectTypeApiName + \".\" + property.apiName;\n switch (property.type as string) {\n case \"geotimeSeries\":\n const geotimeDefinition: OntologyIrObjectTypeDatasourceDefinition = {\n type: \"geotimeSeries\",\n geotimeSeries: {\n geotimeSeriesIntegrationRid: identifier,\n properties: [property.apiName],\n },\n };\n return [buildDatasource(property.apiName, geotimeDefinition)];\n case \"mediaReference\":\n const mediaSetDefinition: OntologyIrObjectTypeDatasourceDefinition = {\n type: \"mediaSetView\",\n mediaSetView: {\n assumedMarkings: [],\n mediaSetViewLocator: identifier,\n properties: [property.apiName],\n },\n };\n return [buildDatasource(property.apiName, mediaSetDefinition)];\n default:\n return [];\n }\n}\n\nfunction extractDerivedDatasources(\n objectType: ObjectType,\n): {\n derivedDatasources: OntologyIrObjectTypeDatasource[];\n derivedPropertyNames: string[];\n} {\n const inputDerivedDatasources = (objectType.datasources ?? []).filter(ds =>\n ds.type === \"derived\"\n );\n const derivedDatasources = inputDerivedDatasources.map((ds, i) =>\n buildDerivedDatasource(ds, i, objectType.apiName)\n );\n const derivedPropertyNames = inputDerivedDatasources.flatMap(ds =>\n Object.keys(ds.propertyMapping)\n );\n return { derivedDatasources, derivedPropertyNames };\n}\n\nfunction buildDerivedDatasource(\n datasource: ObjectTypeDatasourceDefinition_derived,\n index: number,\n objectTypeApiName: string,\n): OntologyIrObjectTypeDatasource {\n const linkDefinition = {\n type: \"multiHopLink\",\n multiHopLink: {\n steps: datasource.linkDefinition.map(step => ({\n type: \"searchAround\",\n searchAround: {\n linkTypeIdentifier: {\n type: \"linkType\",\n linkType: cleanAndValidateLinkTypeId(step.linkType.apiName),\n },\n linkTypeSide: step.side ?? \"SOURCE\",\n },\n })),\n },\n };\n\n const isLinkedProperties =\n typeof Object.values(datasource.propertyMapping)[0] === \"string\";\n const derivedDefinition = isLinkedProperties\n ? {\n type: \"linkedProperties\",\n linkedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(\n Object.entries(datasource.propertyMapping).map((\n [sourceProp, targetProp],\n ) => [sourceProp, {\n type: \"propertyType\",\n propertyType: targetProp,\n }]),\n ),\n },\n }\n : {\n type: \"aggregatedProperties\",\n aggregatedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(\n Object.entries(datasource.propertyMapping).map((\n [sourceProp, agg],\n ) => [sourceProp, buildAggregation(agg)]),\n ),\n },\n };\n const fullDefinition: OntologyIrObjectTypeDatasourceDefinition = {\n type: \"derived\",\n derived: {\n definition: derivedDefinition as OntologyIrDerivedPropertiesDefinition,\n },\n };\n return buildDatasource(\n objectTypeApiName + \".derived.\" + index.toString(),\n fullDefinition,\n );\n}\n\nfunction buildAggregation(\n agg: DerivedPropertyAggregation,\n): OntologyIrDerivedPropertyAggregation {\n const type = agg.type;\n const limit = \"limit\" in agg ? agg.limit : undefined;\n const foreignProperty = \"property\" in agg ? agg.property : undefined;\n const innerDef: any = {};\n if (type !== \"count\") {\n if ([\"collectList\", \"collectSet\"].includes(type)) {\n innerDef[\"linkedProperty\"] = {\n type: \"propertyType\",\n propertyType: foreignProperty,\n };\n innerDef[\"limit\"] = limit;\n } else {\n innerDef[\"property\"] = {\n type: \"propertyType\",\n propertyType: foreignProperty,\n };\n }\n }\n return {\n type,\n [type]: innerDef,\n } as unknown as OntologyIrDerivedPropertyAggregation;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SACEA,kBAAkB,EAClBC,eAAe,EACfC,0BAA0B,EAC1BC,mBAAmB,QACd,6BAA6B;AAOpC,SAASC,QAAQ,QAAQ,0CAA0C;AACnE,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,yBAAyB,QAAQ,gCAAgC;AAE1E,OAAO,SAASC,aAAaA,CAC3BC,UAAsB,EACW;EACjC,MAAM;IAAEC,kBAAkB;IAAEC;EAAqB,CAAC,GAChDC,yBAAyB,CAACH,UAAU,CAAC;EAEvC,MAAMI,mBAAqD,GACzD,CAACJ,UAAU,CAACK,UAAU,IAAI,EAAE,EACzBC,MAAM,CAACC,IAAI,IAAI,CAACL,oBAAoB,CAACM,QAAQ,CAACD,IAAI,CAACE,O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AACtB,QAAQ,CAACsB,IAAI,CAAC,EAAE;MAChD8E,QAAQ,CAAC,gBAAgB,CAAC,GAAG;QAC3B9E,IAAI,EAAE,cAAc;QACpBqE,YAAY,EAAEQ;MAChB,CAAC;MACDC,QAAQ,CAAC,OAAO,CAAC,GAAGF,KAAK;IAC3B,CAAC,MAAM;MACLE,QAAQ,CAAC,UAAU,CAAC,GAAG;QACrB9E,IAAI,EAAE,cAAc;QACpBqE,YAAY,EAAEQ;MAChB,CAAC;IACH;EACF;EACA,OAAO;IACL7E,IAAI;IACJ,CAACA,IAAI,GAAG8E;EACV,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"convertObject.js","names":["addNamespaceIfNone","buildDatasource","cleanAndValidateLinkTypeId","convertObjectStatus","isExotic","convertDatasourceDefinition","convertObjectPropertyType","convertObject","objectType","derivedDatasources","derivedPropertyNames","extractDerivedDatasources","propertyDatasources","properties","filter","prop","includes","apiName","flatMap","extractPropertyDatasource","classificationGroupMarkingNames","extractMarkingGroups","mandatoryMarkingNames","classificationInputGroup","length","reduce","l","r","undefined","mandatoryInputGroup","objectDatasource","implementations","implementsInterfaces","displayMetadata","description","displayName","groupDisplayName","icon","type","blueprint","locator","color","pluralDisplayName","visibility","primaryKeys","primaryKeyPropertyApiName","propertyTypes","Object","fromEntries","map","val","titlePropertyTypeRid","titlePropertyApiName","status","redacted","implementsInterfaces2","impl","interfaceTypeApiName","implements","linksV2","propertiesV2","propertyMapping","mapping","interfaceProperty","propertyTypeRid","mapsTo","allImplementsInterfaces","datasources","entityMetadata","arePatchesEnabled","editsEnabled","aliases","markingType","markingInputGroupName","property","objectTypeApiName","identifier","geotimeDefinition","geotimeSeries","geotimeSeriesIntegrationRid","mediaSetDefinition","mediaSetView","assumedMarkings","mediaSetViewLocator","uploadProperties","inputDerivedDatasources","ds","i","buildDerivedDatasource","keys","datasource","index","linkDefinition","multiHopLink","steps","step","searchAround","linkTypeIdentifier","linkType","linkTypeSide","side","isLinkedProperties","values","derivedDefinition","linkedProperties","propertyTypeMapping","entries","sourceProp","targetProp","propertyType","aggregatedProperties","agg","buildAggregation","toString","derived","definition","limit","foreignProperty","innerDef"],"sources":["convertObject.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 OntologyIrDerivedPropertiesDefinition,\n OntologyIrDerivedPropertyAggregation,\n OntologyIrObjectTypeBlockDataV2,\n OntologyIrObjectTypeDatasource,\n OntologyIrObjectTypeDatasourceDefinition,\n OntologyIrPropertyType,\n} from \"@osdk/client.unstable\";\nimport {\n addNamespaceIfNone,\n buildDatasource,\n cleanAndValidateLinkTypeId,\n convertObjectStatus,\n} from \"../../api/defineOntology.js\";\nimport type { ObjectPropertyType } from \"../../api/object/ObjectPropertyType.js\";\nimport type { ObjectType } from \"../../api/object/ObjectType.js\";\nimport type {\n DerivedPropertyAggregation,\n ObjectTypeDatasourceDefinition_derived,\n} from \"../../api/object/ObjectTypeDatasourceDefinition.js\";\nimport { isExotic } from \"../../api/properties/PropertyTypeType.js\";\nimport { convertDatasourceDefinition } from \"./convertDatasourceDefinition.js\";\nimport { convertObjectPropertyType } from \"./convertObjectPropertyType.js\";\n\nexport function convertObject(\n objectType: ObjectType,\n): OntologyIrObjectTypeBlockDataV2 {\n const { derivedDatasources, derivedPropertyNames } =\n extractDerivedDatasources(objectType);\n\n const propertyDatasources: OntologyIrObjectTypeDatasource[] =\n (objectType.properties ?? [])\n .filter(prop => !derivedPropertyNames.includes(prop.apiName))\n .flatMap(prop => extractPropertyDatasource(prop, objectType.apiName));\n\n const classificationGroupMarkingNames = extractMarkingGroups(\n objectType.properties ?? [],\n \"CBAC\",\n );\n\n const mandatoryMarkingNames = extractMarkingGroups(\n objectType.properties ?? [],\n \"MANDATORY\",\n );\n\n const classificationInputGroup = classificationGroupMarkingNames.length > 0\n ? classificationGroupMarkingNames.reduce((l, r) => l + \"/\" + r)\n : undefined;\n\n const mandatoryInputGroup = mandatoryMarkingNames.length > 0\n ? mandatoryMarkingNames.reduce((l, r) => l + \"/\" + r)\n : undefined;\n\n const objectDatasource = buildDatasource(\n objectType.apiName,\n convertDatasourceDefinition(\n objectType,\n (objectType.properties ?? []).filter(prop =>\n !derivedPropertyNames.includes(prop.apiName)\n ),\n ),\n classificationInputGroup,\n mandatoryInputGroup,\n );\n\n const implementations = objectType.implementsInterfaces ?? [];\n\n return {\n objectType: {\n displayMetadata: {\n description: objectType.description,\n displayName: objectType.displayName,\n groupDisplayName: undefined,\n icon: {\n type: \"blueprint\",\n blueprint: objectType.icon ?? { locator: \"cube\", color: \"#2D72D2\" },\n },\n pluralDisplayName: objectType.pluralDisplayName,\n visibility: objectType.visibility ?? \"NORMAL\",\n },\n primaryKeys: [objectType.primaryKeyPropertyApiName],\n propertyTypes: Object.fromEntries(\n objectType.properties?.map<[string, OntologyIrPropertyType]>(\n val => [val.apiName, convertObjectPropertyType(val)],\n ) ?? [],\n ),\n titlePropertyTypeRid: objectType.titlePropertyApiName,\n apiName: objectType.apiName,\n status: convertObjectStatus(objectType.status),\n redacted: false,\n implementsInterfaces2: implementations.map(impl => ({\n interfaceTypeApiName: impl.implements.apiName,\n linksV2: {},\n propertiesV2: {},\n properties: Object.fromEntries(\n impl.propertyMapping.map(\n mapping => [addNamespaceIfNone(mapping.interfaceProperty), {\n propertyTypeRid: mapping.mapsTo,\n }],\n ),\n ),\n })),\n allImplementsInterfaces: {},\n },\n datasources: [\n ...propertyDatasources,\n ...derivedDatasources,\n objectDatasource,\n ],\n entityMetadata: {\n arePatchesEnabled: objectType.editsEnabled ?? false,\n aliases: objectType.aliases ?? [],\n },\n };\n}\n\n/**\n * Extracts marking group names of a specific type from object properties\n */\nexport function extractMarkingGroups(\n properties: ObjectPropertyType[],\n markingType: \"CBAC\" | \"MANDATORY\",\n): string[] {\n return properties\n .map(prop => {\n if (\n typeof prop.type === \"object\"\n && prop.type.type === \"marking\"\n && prop.type.markingType === markingType\n ) {\n return prop.type.markingInputGroupName;\n }\n return undefined;\n })\n .filter((val): val is string => val !== undefined);\n}\nexport function extractPropertyDatasource(\n property: ObjectPropertyType,\n objectTypeApiName: string,\n): OntologyIrObjectTypeDatasource[] {\n if (!isExotic(property.type)) {\n return [];\n }\n const identifier = objectTypeApiName + \".\" + property.apiName;\n switch (property.type as string) {\n case \"geotimeSeries\":\n const geotimeDefinition: OntologyIrObjectTypeDatasourceDefinition = {\n type: \"geotimeSeries\",\n geotimeSeries: {\n geotimeSeriesIntegrationRid: identifier,\n properties: [property.apiName],\n },\n };\n return [buildDatasource(property.apiName, geotimeDefinition)];\n case \"mediaReference\":\n const mediaSetDefinition: OntologyIrObjectTypeDatasourceDefinition = {\n type: \"mediaSetView\",\n mediaSetView: {\n assumedMarkings: [],\n mediaSetViewLocator: identifier,\n properties: [property.apiName],\n uploadProperties: [],\n },\n };\n return [buildDatasource(property.apiName, mediaSetDefinition)];\n default:\n return [];\n }\n}\n\nfunction extractDerivedDatasources(\n objectType: ObjectType,\n): {\n derivedDatasources: OntologyIrObjectTypeDatasource[];\n derivedPropertyNames: string[];\n} {\n const inputDerivedDatasources = (objectType.datasources ?? []).filter(ds =>\n ds.type === \"derived\"\n );\n const derivedDatasources = inputDerivedDatasources.map((ds, i) =>\n buildDerivedDatasource(ds, i, objectType.apiName)\n );\n const derivedPropertyNames = inputDerivedDatasources.flatMap(ds =>\n Object.keys(ds.propertyMapping)\n );\n return { derivedDatasources, derivedPropertyNames };\n}\n\nfunction buildDerivedDatasource(\n datasource: ObjectTypeDatasourceDefinition_derived,\n index: number,\n objectTypeApiName: string,\n): OntologyIrObjectTypeDatasource {\n const linkDefinition = {\n type: \"multiHopLink\",\n multiHopLink: {\n steps: datasource.linkDefinition.map(step => ({\n type: \"searchAround\",\n searchAround: {\n linkTypeIdentifier: {\n type: \"linkType\",\n linkType: cleanAndValidateLinkTypeId(step.linkType.apiName),\n },\n linkTypeSide: step.side ?? \"SOURCE\",\n },\n })),\n },\n };\n\n const isLinkedProperties =\n typeof Object.values(datasource.propertyMapping)[0] === \"string\";\n const derivedDefinition = isLinkedProperties\n ? {\n type: \"linkedProperties\",\n linkedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(\n Object.entries(datasource.propertyMapping).map((\n [sourceProp, targetProp],\n ) => [sourceProp, {\n type: \"propertyType\",\n propertyType: targetProp,\n }]),\n ),\n },\n }\n : {\n type: \"aggregatedProperties\",\n aggregatedProperties: {\n linkDefinition,\n propertyTypeMapping: Object.fromEntries(\n Object.entries(datasource.propertyMapping).map((\n [sourceProp, agg],\n ) => [sourceProp, buildAggregation(agg)]),\n ),\n },\n };\n const fullDefinition: OntologyIrObjectTypeDatasourceDefinition = {\n type: \"derived\",\n derived: {\n definition: derivedDefinition as OntologyIrDerivedPropertiesDefinition,\n },\n };\n return buildDatasource(\n objectTypeApiName + \".derived.\" + index.toString(),\n fullDefinition,\n );\n}\n\nfunction buildAggregation(\n agg: DerivedPropertyAggregation,\n): OntologyIrDerivedPropertyAggregation {\n const type = agg.type;\n const limit = \"limit\" in agg ? agg.limit : undefined;\n const foreignProperty = \"property\" in agg ? agg.property : undefined;\n const innerDef: any = {};\n if (type !== \"count\") {\n if ([\"collectList\", \"collectSet\"].includes(type)) {\n innerDef[\"linkedProperty\"] = {\n type: \"propertyType\",\n propertyType: foreignProperty,\n };\n innerDef[\"limit\"] = limit;\n } else {\n innerDef[\"property\"] = {\n type: \"propertyType\",\n propertyType: foreignProperty,\n };\n }\n }\n return {\n type,\n [type]: innerDef,\n } as unknown as OntologyIrDerivedPropertyAggregation;\n}\n"],"mappings":"AAAA;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B,CAACD,GAAG,CAAC,CAAC,CAC1C;IACF;EACF,CAAC;EAOH,OAAO9G,eAAe,CACpB0E,iBAAiB,GAAG,WAAW,GAAGgB,KAAK,CAACsB,QAAQ,CAAC,CAAC,EAPa;IAC/D3E,IAAI,EAAE,SAAS;IACf4E,OAAO,EAAE;MACPC,UAAU,EAAEZ;IACd;EACF,CAIA,CAAC;AACH;AAEA,SAASS,gBAAgBA,CACvBD,GAA+B,EACO;EACtC,MAAMzE,IAAI,GAAGyE,GAAG,CAACzE,IAAI;EACrB,MAAM8E,KAAK,GAAG,OAAO,IAAIL,GAAG,GAAGA,GAAG,CAACK,KAAK,GAAGxF,SAAS;EACpD,MAAMyF,eAAe,GAAG,UAAU,IAAIN,GAAG,GAAGA,GAAG,CAACrC,QAAQ,GAAG9C,SAAS;EACpE,MAAM0F,QAAa,GAAG,CAAC,CAAC;EACxB,IAAIhF,IAAI,KAAK,OAAO,EAAE;IACpB,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAACtB,QAAQ,CAACsB,IAAI,CAAC,EAAE;MAChDgF,QAAQ,CAAC,gBAAgB,CAAC,GAAG;QAC3BhF,IAAI,EAAE,cAAc;QACpBuE,YAAY,EAAEQ;MAChB,CAAC;MACDC,QAAQ,CAAC,OAAO,CAAC,GAAGF,KAAK;IAC3B,CAAC,MAAM;MACLE,QAAQ,CAAC,UAAU,CAAC,GAAG;QACrBhF,IAAI,EAAE,cAAc;QACpBuE,YAAY,EAAEQ;MAChB,CAAC;IACH;EACF;EACA,OAAO;IACL/E,IAAI;IACJ,CAACA,IAAI,GAAGgF;EACV,CAAC;AACH","ignoreList":[]}
@@ -38,7 +38,8 @@ export function convertObjectPropertyType(property) {
38
38
  type: property.array ? {
39
39
  type: "array",
40
40
  array: {
41
- subtype: propertyTypeTypeToOntologyIrType(property.type)
41
+ subtype: propertyTypeTypeToOntologyIrType(property.type),
42
+ reducers: []
42
43
  }
43
44
  } : propertyTypeTypeToOntologyIrType(property.type),
44
45
  typeClasses: property.typeClasses ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),
@@ -1 +1 @@
1
- {"version":3,"file":"convertObjectPropertyType.js","names":["invariant","convertObjectStatus","namespace","defaultTypeClasses","getPropertyTypeName","hasRenderHints","shouldNotHaveRenderHints","convertNullabilityToDataConstraint","convertValueType","convertValueTypeDataConstraints","propertyTypeTypeToOntologyIrType","convertObjectPropertyType","property","apiName","type","typeClasses","process","env","NODE_ENV","output","sharedPropertyTypeApiName","sharedPropertyType","displayMetadata","displayName","description","visibility","indexedForSearch","ruleSetBinding","undefined","baseFormatter","array","subtype","status","inlineAction","dataConstraints","valueType","constraints","sharedPropertyTypeRid"],"sources":["convertObjectPropertyType.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 { OntologyIrPropertyType } from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { convertObjectStatus, namespace } from \"../../api/defineOntology.js\";\nimport type { ObjectPropertyType } from \"../../api/object/ObjectPropertyType.js\";\nimport {\n defaultTypeClasses,\n getPropertyTypeName,\n hasRenderHints,\n shouldNotHaveRenderHints,\n} from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertValueType } from \"./convertValueType.js\";\nimport { convertValueTypeDataConstraints } from \"./convertValueTypeDataConstraints.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\n\nexport function convertObjectPropertyType(\n property: ObjectPropertyType,\n): OntologyIrPropertyType {\n const apiName = namespace + property.apiName;\n invariant(\n !shouldNotHaveRenderHints(property.type)\n || !hasRenderHints(property.typeClasses),\n `Property type ${apiName} of type '${\n getPropertyTypeName(property.type)\n }' should not have render hints`,\n );\n const output: OntologyIrPropertyType = {\n apiName: property.apiName,\n sharedPropertyTypeApiName: property.sharedPropertyType?.apiName,\n displayMetadata: {\n displayName: property.displayName,\n description: property.description,\n visibility: property.visibility ?? \"NORMAL\",\n },\n indexedForSearch: property.indexedForSearch ?? true,\n ruleSetBinding: undefined,\n baseFormatter: property.baseFormatter,\n type: property.array\n ? {\n type: \"array\" as const,\n array: {\n subtype: propertyTypeTypeToOntologyIrType(property.type),\n },\n }\n : propertyTypeTypeToOntologyIrType(property.type),\n typeClasses: property.typeClasses\n ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),\n status: convertObjectStatus(property.status),\n inlineAction: undefined,\n dataConstraints: property.valueType\n ? convertValueTypeDataConstraints(property.valueType.constraints)\n : convertNullabilityToDataConstraint(property),\n sharedPropertyTypeRid: property.sharedPropertyType?.apiName,\n valueType: property.valueType\n ? convertValueType(property.valueType)\n : undefined,\n };\n return output;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,mBAAmB,EAAEC,SAAS,QAAQ,6BAA6B;AAE5E,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,wBAAwB,QACnB,sCAAsC;AAC7C,SAASC,kCAAkC,QAAQ,yCAAyC;AAC5F,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,+BAA+B,QAAQ,sCAAsC;AACtF,SAASC,gCAAgC,QAAQ,uCAAuC;AAExF,OAAO,SAASC,yBAAyBA,CACvCC,QAA4B,EACJ;EACxB,MAAMC,OAAO,GAAGX,SAAS,GAAGU,QAAQ,CAACC,OAAO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qBAAqB,EAAEzB,QAAQ,CAACS,kBAAkB,EAAER,OAAO;IAC3DsB,SAAS,EAAEvB,QAAQ,CAACuB,SAAS,GACzB3B,gBAAgB,CAACI,QAAQ,CAACuB,SAAS,CAAC,GACpCP;EACN,CAAC;EACD,OAAOT,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"file":"convertObjectPropertyType.js","names":["invariant","convertObjectStatus","namespace","defaultTypeClasses","getPropertyTypeName","hasRenderHints","shouldNotHaveRenderHints","convertNullabilityToDataConstraint","convertValueType","convertValueTypeDataConstraints","propertyTypeTypeToOntologyIrType","convertObjectPropertyType","property","apiName","type","typeClasses","process","env","NODE_ENV","output","sharedPropertyTypeApiName","sharedPropertyType","displayMetadata","displayName","description","visibility","indexedForSearch","ruleSetBinding","undefined","baseFormatter","array","subtype","reducers","status","inlineAction","dataConstraints","valueType","constraints","sharedPropertyTypeRid"],"sources":["convertObjectPropertyType.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 { OntologyIrPropertyType } from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { convertObjectStatus, namespace } from \"../../api/defineOntology.js\";\nimport type { ObjectPropertyType } from \"../../api/object/ObjectPropertyType.js\";\nimport {\n defaultTypeClasses,\n getPropertyTypeName,\n hasRenderHints,\n shouldNotHaveRenderHints,\n} from \"../../api/propertyConversionUtils.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertValueType } from \"./convertValueType.js\";\nimport { convertValueTypeDataConstraints } from \"./convertValueTypeDataConstraints.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\n\nexport function convertObjectPropertyType(\n property: ObjectPropertyType,\n): OntologyIrPropertyType {\n const apiName = namespace + property.apiName;\n invariant(\n !shouldNotHaveRenderHints(property.type)\n || !hasRenderHints(property.typeClasses),\n `Property type ${apiName} of type '${\n getPropertyTypeName(property.type)\n }' should not have render hints`,\n );\n const output: OntologyIrPropertyType = {\n apiName: property.apiName,\n sharedPropertyTypeApiName: property.sharedPropertyType?.apiName,\n displayMetadata: {\n displayName: property.displayName,\n description: property.description,\n visibility: property.visibility ?? \"NORMAL\",\n },\n indexedForSearch: property.indexedForSearch ?? true,\n ruleSetBinding: undefined,\n baseFormatter: property.baseFormatter,\n type: property.array\n ? {\n type: \"array\" as const,\n array: {\n subtype: propertyTypeTypeToOntologyIrType(property.type),\n reducers: [],\n },\n }\n : propertyTypeTypeToOntologyIrType(property.type),\n typeClasses: property.typeClasses\n ?? (shouldNotHaveRenderHints(property.type) ? [] : defaultTypeClasses),\n status: convertObjectStatus(property.status),\n inlineAction: undefined,\n dataConstraints: property.valueType\n ? convertValueTypeDataConstraints(property.valueType.constraints)\n : convertNullabilityToDataConstraint(property),\n sharedPropertyTypeRid: property.sharedPropertyType?.apiName,\n valueType: property.valueType\n ? convertValueType(property.valueType)\n : undefined,\n };\n return output;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,mBAAmB,EAAEC,SAAS,QAAQ,6BAA6B;AAE5E,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,wBAAwB,QACnB,sCAAsC;AAC7C,SAASC,kCAAkC,QAAQ,yCAAyC;AAC5F,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,+BAA+B,QAAQ,sCAAsC;AACtF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,EAAEN,SAAS;IACvBO,eAAe,EAAEvB,QAAQ,CAACwB,SAAS,GAC/B3B,+BAA+B,CAACG,QAAQ,CAACwB,SAAS,CAACC,WAAW,CAAC,GAC/D9B,kCAAkC,CAACK,QAAQ,CAAC;IAChD0B,qBAAqB,EAAE1B,QAAQ,CAACS,kBAAkB,EAAER,OAAO;IAC3DuB,SAAS,EAAExB,QAAQ,CAACwB,SAAS,GACzB5B,gBAAgB,CAACI,QAAQ,CAACwB,SAAS,CAAC,GACpCR;EACN,CAAC;EACD,OAAOT,MAAM;AACf","ignoreList":[]}
@@ -25,6 +25,7 @@ export function convertSpt({
25
25
  visibility,
26
26
  gothamMapping,
27
27
  typeClasses,
28
+ aliases,
28
29
  valueType,
29
30
  nullability,
30
31
  baseFormatter
@@ -43,10 +44,11 @@ export function convertSpt({
43
44
  type: array ? {
44
45
  type: "array",
45
46
  array: {
46
- subtype: propertyTypeTypeToOntologyIrType(type)
47
+ subtype: propertyTypeTypeToOntologyIrType(type),
48
+ reducers: []
47
49
  }
48
50
  } : propertyTypeTypeToOntologyIrType(type),
49
- aliases: [],
51
+ aliases: aliases ?? [],
50
52
  baseFormatter,
51
53
  dataConstraints: dataConstraint,
52
54
  gothamMapping: gothamMapping,
@@ -1 +1 @@
1
- {"version":3,"file":"convertSpt.js","names":["convertNullabilityToDataConstraint","propertyTypeTypeToOntologyIrType","convertSpt","type","array","description","apiName","displayName","visibility","gothamMapping","typeClasses","valueType","nullability","baseFormatter","dataConstraint","displayMetadata","subtype","aliases","dataConstraints","indexedForSearch","undefined","version","packageNamespace"],"sources":["convertSpt.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 { OntologyIrSharedPropertyType } from \"@osdk/client.unstable\";\nimport type { SharedPropertyType } from \"../../api/properties/SharedPropertyType.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\n\nexport function convertSpt(\n {\n type,\n array,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n valueType,\n nullability,\n baseFormatter,\n }: SharedPropertyType,\n): OntologyIrSharedPropertyType {\n const dataConstraint:\n | OntologyIrSharedPropertyType[\"dataConstraints\"]\n | undefined = convertNullabilityToDataConstraint({ type, nullability });\n return {\n apiName,\n displayMetadata: {\n displayName: displayName ?? apiName,\n visibility: visibility ?? \"NORMAL\",\n description,\n },\n type: array\n ? {\n type: \"array\" as const,\n array: {\n subtype: propertyTypeTypeToOntologyIrType(type),\n },\n }\n : propertyTypeTypeToOntologyIrType(type),\n aliases: [],\n baseFormatter,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: true,\n typeClasses: typeClasses ?? [],\n valueType: valueType === undefined ? undefined : {\n apiName: valueType.apiName,\n version: valueType.version,\n packageNamespace: valueType.packageNamespace,\n displayMetadata: valueType.displayMetadata,\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,kCAAkC,QAAQ,yCAAyC;AAC5F,SAASC,gCAAgC,QAAQ,uCAAuC;AAExF,OAAO,SAASC,UAAUA,CACxB;EACEC,IAAI;EACJC,KAAK;EACLC,WAAW;EACXC,OAAO;EACPC,WAAW;EACXC,UAAU;EACVC,aAAa;EACbC,WAAW;EACXC,SAAS;EACTC,WAAW;EACXC;AACkB,CAAC,EACS;EAC9B,MAAMC,cAEO,GAAGd,kCAAkC,CAAC;IAAEG,IAAI;IAAES;EAAY,CAAC,CAAC;EACzE,OAAO;IACLN,OAAO;IACPS,eAAe,EAAE;MACfR,WAAW,EAAEA,WAAW,IAAID,OAAO;MACnCE,UAAU,EAAEA,UAAU,IAAI,QAAQ;MAClCH;IACF,CAAC;IACDF,IAAI,EAAEC,KAAK,GACP;MACAD,IAAI,EAAE,OAAgB;MACtBC,KAAK,EAAE;QACLY,OAAO,EAAEf,gCAAgC,CAACE,IAAI;MAChD;IACF,CAAC,GACCF,gCAAgC,CAACE,IAAI,CAAC;IAC1Cc,OAAO,EAAE,EAAE;IACXJ,aAAa;IACbK,eAAe,EAAEJ,cAAc;IAC/BL,aAAa,EAAEA,aAAa;IAC5BU,gBAAgB,EAAE,IAAI;IACtBT,WAAW,EAAEA,WAAW,IAAI,EAAE;IAC9BC,SAAS,EAAEA,SAAS,KAAKS,SAAS,GAAGA,SAAS,GAAG;MAC/Cd,OAAO,EAAEK,SAAS,CAACL,OAAO;MAC1Be,OAAO,EAAEV,SAAS,CAACU,OAAO;MAC1BC,gBAAgB,EAAEX,SAAS,CAACW,gBAAgB;MAC5CP,eAAe,EAAEJ,SAAS,CAACI;IAC7B;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"convertSpt.js","names":["convertNullabilityToDataConstraint","propertyTypeTypeToOntologyIrType","convertSpt","type","array","description","apiName","displayName","visibility","gothamMapping","typeClasses","aliases","valueType","nullability","baseFormatter","dataConstraint","displayMetadata","subtype","reducers","dataConstraints","indexedForSearch","undefined","version","packageNamespace"],"sources":["convertSpt.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 { OntologyIrSharedPropertyType } from \"@osdk/client.unstable\";\nimport type { SharedPropertyType } from \"../../api/properties/SharedPropertyType.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\n\nexport function convertSpt(\n {\n type,\n array,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n aliases,\n valueType,\n nullability,\n baseFormatter,\n }: SharedPropertyType,\n): OntologyIrSharedPropertyType {\n const dataConstraint:\n | OntologyIrSharedPropertyType[\"dataConstraints\"]\n | undefined = convertNullabilityToDataConstraint({ type, nullability });\n return {\n apiName,\n displayMetadata: {\n displayName: displayName ?? apiName,\n visibility: visibility ?? \"NORMAL\",\n description,\n },\n type: array\n ? {\n type: \"array\" as const,\n array: {\n subtype: propertyTypeTypeToOntologyIrType(type),\n reducers: [],\n },\n }\n : propertyTypeTypeToOntologyIrType(type),\n aliases: aliases ?? [],\n baseFormatter,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: true,\n typeClasses: typeClasses ?? [],\n valueType: valueType === undefined ? undefined : {\n apiName: valueType.apiName,\n version: valueType.version,\n packageNamespace: valueType.packageNamespace,\n displayMetadata: valueType.displayMetadata,\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,kCAAkC,QAAQ,yCAAyC;AAC5F,SAASC,gCAAgC,QAAQ,uCAAuC;AAExF,OAAO,SAASC,UAAUA,CACxB;EACEC,IAAI;EACJC,KAAK;EACLC,WAAW;EACXC,OAAO;EACPC,WAAW;EACXC,UAAU;EACVC,aAAa;EACbC,WAAW;EACXC,OAAO;EACPC,SAAS;EACTC,WAAW;EACXC;AACkB,CAAC,EACS;EAC9B,MAAMC,cAEO,GAAGf,kCAAkC,CAAC;IAAEG,IAAI;IAAEU;EAAY,CAAC,CAAC;EACzE,OAAO;IACLP,OAAO;IACPU,eAAe,EAAE;MACfT,WAAW,EAAEA,WAAW,IAAID,OAAO;MACnCE,UAAU,EAAEA,UAAU,IAAI,QAAQ;MAClCH;IACF,CAAC;IACDF,IAAI,EAAEC,KAAK,GACP;MACAD,IAAI,EAAE,OAAgB;MACtBC,KAAK,EAAE;QACLa,OAAO,EAAEhB,gCAAgC,CAACE,IAAI,CAAC;QAC/Ce,QAAQ,EAAE;MACZ;IACF,CAAC,GACCjB,gCAAgC,CAACE,IAAI,CAAC;IAC1CQ,OAAO,EAAEA,OAAO,IAAI,EAAE;IACtBG,aAAa;IACbK,eAAe,EAAEJ,cAAc;IAC/BN,aAAa,EAAEA,aAAa;IAC5BW,gBAAgB,EAAE,IAAI;IACtBV,WAAW,EAAEA,WAAW,IAAI,EAAE;IAC9BE,SAAS,EAAEA,SAAS,KAAKS,SAAS,GAAGA,SAAS,GAAG;MAC/Cf,OAAO,EAAEM,SAAS,CAACN,OAAO;MAC1BgB,OAAO,EAAEV,SAAS,CAACU,OAAO;MAC1BC,gBAAgB,EAAEX,SAAS,CAACW,gBAAgB;MAC5CP,eAAe,EAAEJ,SAAS,CAACI;IAC7B;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,143 @@
1
+ /*
2
+ * Copyright 2026 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
+ import { distributeTypeHelper } from "../toConjure/distributeTypeHelper.js";
18
+ export function propertyTypeTypeToOntologyIrInterfaceType(type) {
19
+ switch (true) {
20
+ case typeof type === "object" && type.type === "marking":
21
+ return {
22
+ "type": "marking",
23
+ marking: {
24
+ markingType: type.markingType
25
+ }
26
+ };
27
+ case typeof type === "object" && type.type === "struct":
28
+ const structFields = new Array();
29
+ for (const key in type.structDefinition) {
30
+ const fieldTypeDefinition = type.structDefinition[key];
31
+ let field;
32
+ if (typeof fieldTypeDefinition === "string") {
33
+ field = {
34
+ apiName: key,
35
+ displayMetadata: {
36
+ displayName: key,
37
+ description: undefined
38
+ },
39
+ typeClasses: [],
40
+ aliases: [],
41
+ fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition),
42
+ requireImplementation: true
43
+ };
44
+ } else {
45
+ // If it is a full form type definition then process it as such
46
+ if (typeof fieldTypeDefinition === "object" && "fieldType" in fieldTypeDefinition) {
47
+ field = {
48
+ ...fieldTypeDefinition,
49
+ apiName: key,
50
+ fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition.fieldType),
51
+ displayMetadata: fieldTypeDefinition.displayMetadata ?? {
52
+ displayName: key,
53
+ description: undefined
54
+ },
55
+ typeClasses: fieldTypeDefinition.typeClasses ?? [],
56
+ aliases: fieldTypeDefinition.aliases ?? [],
57
+ requireImplementation: fieldTypeDefinition.requireImplementation ?? true
58
+ };
59
+ } else {
60
+ field = {
61
+ apiName: key,
62
+ displayMetadata: {
63
+ displayName: key,
64
+ description: undefined
65
+ },
66
+ typeClasses: [],
67
+ aliases: [],
68
+ fieldType: propertyTypeTypeToOntologyIrInterfaceType(fieldTypeDefinition),
69
+ requireImplementation: true
70
+ };
71
+ }
72
+ }
73
+ structFields.push(field);
74
+ }
75
+ return {
76
+ type: "struct",
77
+ struct: {
78
+ structFields
79
+ }
80
+ };
81
+ case typeof type === "object" && type.type === "string":
82
+ return {
83
+ "type": "string",
84
+ "string": {
85
+ analyzerOverride: undefined,
86
+ enableAsciiFolding: type.enableAsciiFolding,
87
+ isLongText: type.isLongText ?? false,
88
+ supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard ?? false,
89
+ supportsExactMatching: type.supportsExactMatching ?? true,
90
+ supportsFullTextRegex: type.supportsFullTextRegex
91
+ }
92
+ };
93
+ case typeof type === "object" && type.type === "decimal":
94
+ return {
95
+ "type": "decimal",
96
+ "decimal": {
97
+ precision: type.precision,
98
+ scale: type.scale
99
+ }
100
+ };
101
+ case type === "geopoint":
102
+ return {
103
+ type: "geohash",
104
+ geohash: {}
105
+ };
106
+ case type === "decimal":
107
+ return {
108
+ type,
109
+ [type]: {
110
+ precision: undefined,
111
+ scale: undefined
112
+ }
113
+ };
114
+ case type === "string":
115
+ return {
116
+ type,
117
+ [type]: {
118
+ analyzerOverride: undefined,
119
+ enableAsciiFolding: undefined,
120
+ isLongText: false,
121
+ supportsEfficientLeadingWildcard: false,
122
+ supportsExactMatching: true
123
+ }
124
+ };
125
+ case type === "mediaReference":
126
+ return {
127
+ type: type,
128
+ mediaReference: {}
129
+ };
130
+ case type === "geotimeSeries":
131
+ return {
132
+ type: "geotimeSeriesReference",
133
+ geotimeSeriesReference: {}
134
+ };
135
+ default:
136
+ // use helper function to distribute `type` properly
137
+ if (typeof type === "object") {
138
+ throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);
139
+ }
140
+ return distributeTypeHelper(type);
141
+ }
142
+ }
143
+ //# sourceMappingURL=propertyTypeTypeToOntologyIrInterfaceType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propertyTypeTypeToOntologyIrInterfaceType.js","names":["distributeTypeHelper","propertyTypeTypeToOntologyIrInterfaceType","type","marking","markingType","structFields","Array","key","structDefinition","fieldTypeDefinition","field","apiName","displayMetadata","displayName","description","undefined","typeClasses","aliases","fieldType","requireImplementation","push","struct","analyzerOverride","enableAsciiFolding","isLongText","supportsEfficientLeadingWildcard","supportsExactMatching","supportsFullTextRegex","precision","scale","geohash","mediaReference","geotimeSeriesReference","Error","JSON","stringify"],"sources":["propertyTypeTypeToOntologyIrInterfaceType.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrInterfacePropertyTypeType,\n OntologyIrInterfaceStructFieldType,\n} from \"@osdk/client.unstable\";\nimport type {\n PropertyTypeType,\n} from \"../../api/properties/PropertyTypeType.js\";\nimport { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\n\nexport function propertyTypeTypeToOntologyIrInterfaceType(\n type: PropertyTypeType,\n): OntologyIrInterfacePropertyTypeType {\n switch (true) {\n case (typeof type === \"object\" && type.type === \"marking\"):\n return {\n \"type\": \"marking\",\n marking: { markingType: type.markingType },\n };\n\n case (typeof type === \"object\" && type.type === \"struct\"):\n const structFields: Array<OntologyIrInterfaceStructFieldType> =\n new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field: OntologyIrInterfaceStructFieldType;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(\n fieldTypeDefinition,\n ),\n requireImplementation: true,\n };\n } else {\n // If it is a full form type definition then process it as such\n if (\n typeof fieldTypeDefinition === \"object\"\n && \"fieldType\" in fieldTypeDefinition\n ) {\n field = {\n ...fieldTypeDefinition,\n apiName: key,\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(\n fieldTypeDefinition.fieldType,\n ),\n displayMetadata: fieldTypeDefinition.displayMetadata\n ?? { displayName: key, description: undefined },\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? [],\n requireImplementation: fieldTypeDefinition.requireImplementation\n ?? true,\n };\n } else {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrInterfaceType(\n fieldTypeDefinition,\n ),\n requireImplementation: true,\n };\n }\n }\n\n structFields.push(field);\n }\n\n return {\n type: \"struct\",\n struct: { structFields },\n };\n\n case (typeof type === \"object\" && type.type === \"string\"):\n return {\n \"type\": \"string\",\n \"string\": {\n analyzerOverride: undefined,\n enableAsciiFolding: type.enableAsciiFolding,\n isLongText: type.isLongText ?? false,\n supportsEfficientLeadingWildcard:\n type.supportsEfficientLeadingWildcard ?? false,\n supportsExactMatching: type.supportsExactMatching ?? true,\n supportsFullTextRegex: type.supportsFullTextRegex,\n },\n };\n\n case (typeof type === \"object\" && type.type === \"decimal\"):\n return {\n \"type\": \"decimal\",\n \"decimal\": {\n precision: type.precision,\n scale: type.scale,\n },\n };\n\n case (type === \"geopoint\"):\n return { type: \"geohash\", geohash: {} };\n\n case (type === \"decimal\"):\n return { type, [type]: { precision: undefined, scale: undefined } };\n\n case (type === \"string\"):\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsEfficientLeadingWildcard: false,\n supportsExactMatching: true,\n },\n };\n\n case (type === \"mediaReference\"):\n return {\n type: type,\n mediaReference: {},\n };\n\n case (type === \"geotimeSeries\"):\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {},\n };\n\n default:\n // use helper function to distribute `type` properly\n if (typeof type === \"object\") {\n throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);\n }\n return distributeTypeHelper(type);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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;IAEH,KAAM3B,IAAI,KAAK,UAAU;MACvB,OAAO;QAAEA,IAAI,EAAE,SAAS;QAAE4B,OAAO,EAAE,CAAC;MAAE,CAAC;IAEzC,KAAM5B,IAAI,KAAK,SAAS;MACtB,OAAO;QAAEA,IAAI;QAAE,CAACA,IAAI,GAAG;UAAE0B,SAAS,EAAEb,SAAS;UAAEc,KAAK,EAAEd;QAAU;MAAE,CAAC;IAErE,KAAMb,IAAI,KAAK,QAAQ;MACrB,OAAO;QACLA,IAAI;QACJ,CAACA,IAAI,GAAG;UACNoB,gBAAgB,EAAEP,SAAS;UAC3BQ,kBAAkB,EAAER,SAAS;UAC7BS,UAAU,EAAE,KAAK;UACjBC,gCAAgC,EAAE,KAAK;UACvCC,qBAAqB,EAAE;QACzB;MACF,CAAC;IAEH,KAAMxB,IAAI,KAAK,gBAAgB;MAC7B,OAAO;QACLA,IAAI,EAAEA,IAAI;QACV6B,cAAc,EAAE,CAAC;MACnB,CAAC;IAEH,KAAM7B,IAAI,KAAK,eAAe;MAC5B,OAAO;QACLA,IAAI,EAAE,wBAAwB;QAC9B8B,sBAAsB,EAAE,CAAC;MAC3B,CAAC;IAEH;MACE;MACA,IAAI,OAAO9B,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAI+B,KAAK,CAAC,0BAA0BC,IAAI,CAACC,SAAS,CAACjC,IAAI,CAAC,EAAE,CAAC;MACnE;MACA,OAAOF,oBAAoB,CAACE,IAAI,CAAC;EACrC;AACF","ignoreList":[]}
@@ -47,6 +47,10 @@ export function propertyTypeTypeToOntologyIrType(type) {
47
47
  ...fieldTypeDefinition,
48
48
  apiName: key,
49
49
  fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition.fieldType),
50
+ displayMetadata: fieldTypeDefinition.displayMetadata ?? {
51
+ displayName: key,
52
+ description: undefined
53
+ },
50
54
  typeClasses: fieldTypeDefinition.typeClasses ?? [],
51
55
  aliases: fieldTypeDefinition.aliases ?? []
52
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"propertyTypeTypeToOntologyIrType.js","names":["distributeTypeHelper","propertyTypeTypeToOntologyIrType","type","marking","markingType","structFields","Array","key","structDefinition","fieldTypeDefinition","field","apiName","displayMetadata","displayName","description","undefined","typeClasses","aliases","fieldType","push","struct","analyzerOverride","enableAsciiFolding","isLongText","supportsEfficientLeadingWildcard","supportsExactMatching","supportsFullTextRegex","precision","scale","geohash","mediaReference","geotimeSeriesReference","Error","JSON","stringify"],"sources":["propertyTypeTypeToOntologyIrType.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 OntologyIrStructFieldType,\n OntologyIrType,\n} from \"@osdk/client.unstable\";\nimport type { PropertyTypeType } from \"../../api/properties/PropertyTypeType.js\";\nimport { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\n\nexport function propertyTypeTypeToOntologyIrType(\n type: PropertyTypeType,\n): OntologyIrType {\n switch (true) {\n case (typeof type === \"object\" && type.type === \"marking\"):\n return {\n \"type\": \"marking\",\n marking: { markingType: type.markingType },\n };\n\n case (typeof type === \"object\" && type.type === \"struct\"):\n const structFields: Array<OntologyIrStructFieldType> = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field: OntologyIrStructFieldType;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition),\n };\n } else {\n // If it is a full form type definition then process it as such\n if (\"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n apiName: key,\n fieldType: propertyTypeTypeToOntologyIrType(\n fieldTypeDefinition.fieldType,\n ),\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? [],\n };\n } else {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition),\n };\n }\n }\n\n structFields.push(field);\n }\n\n return {\n type: \"struct\",\n struct: { structFields },\n };\n\n case (typeof type === \"object\" && type.type === \"string\"):\n return {\n \"type\": \"string\",\n \"string\": {\n analyzerOverride: undefined,\n enableAsciiFolding: type.enableAsciiFolding,\n isLongText: type.isLongText ?? false,\n supportsEfficientLeadingWildcard:\n type.supportsEfficientLeadingWildcard ?? false,\n supportsExactMatching: type.supportsExactMatching ?? true,\n supportsFullTextRegex: type.supportsFullTextRegex,\n },\n };\n\n case (typeof type === \"object\" && type.type === \"decimal\"):\n return {\n \"type\": \"decimal\",\n \"decimal\": {\n precision: type.precision,\n scale: type.scale,\n },\n };\n\n case (type === \"geopoint\"):\n return { type: \"geohash\", geohash: {} };\n\n case (type === \"decimal\"):\n return { type, [type]: { precision: undefined, scale: undefined } };\n\n case (type === \"string\"):\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsEfficientLeadingWildcard: false,\n supportsExactMatching: true,\n },\n };\n\n case (type === \"mediaReference\"):\n return {\n type: type,\n mediaReference: {},\n };\n\n case (type === \"geotimeSeries\"):\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {},\n };\n\n default:\n // use helper function to distribute `type` properly\n if (typeof type === \"object\") {\n throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);\n }\n return distributeTypeHelper(type);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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U;MAAE,CAAC;IAErE,KAAMb,IAAI,KAAK,QAAQ;MACrB,OAAO;QACLA,IAAI;QACJ,CAACA,IAAI,GAAG;UACNmB,gBAAgB,EAAEN,SAAS;UAC3BO,kBAAkB,EAAEP,SAAS;UAC7BQ,UAAU,EAAE,KAAK;UACjBC,gCAAgC,EAAE,KAAK;UACvCC,qBAAqB,EAAE;QACzB;MACF,CAAC;IAEH,KAAMvB,IAAI,KAAK,gBAAgB;MAC7B,OAAO;QACLA,IAAI,EAAEA,IAAI;QACV4B,cAAc,EAAE,CAAC;MACnB,CAAC;IAEH,KAAM5B,IAAI,KAAK,eAAe;MAC5B,OAAO;QACLA,IAAI,EAAE,wBAAwB;QAC9B6B,sBAAsB,EAAE,CAAC;MAC3B,CAAC;IAEH;MACE;MACA,IAAI,OAAO7B,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAI8B,KAAK,CAAC,0BAA0BC,IAAI,CAACC,SAAS,CAAChC,IAAI,CAAC,EAAE,CAAC;MACnE;MACA,OAAOF,oBAAoB,CAACE,IAAI,CAAC;EACrC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"propertyTypeTypeToOntologyIrType.js","names":["distributeTypeHelper","propertyTypeTypeToOntologyIrType","type","marking","markingType","structFields","Array","key","structDefinition","fieldTypeDefinition","field","apiName","displayMetadata","displayName","description","undefined","typeClasses","aliases","fieldType","push","struct","analyzerOverride","enableAsciiFolding","isLongText","supportsEfficientLeadingWildcard","supportsExactMatching","supportsFullTextRegex","precision","scale","geohash","mediaReference","geotimeSeriesReference","Error","JSON","stringify"],"sources":["propertyTypeTypeToOntologyIrType.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 OntologyIrStructFieldType,\n OntologyIrType,\n} from \"@osdk/client.unstable\";\nimport type { PropertyTypeType } from \"../../api/properties/PropertyTypeType.js\";\nimport { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\n\nexport function propertyTypeTypeToOntologyIrType(\n type: PropertyTypeType,\n): OntologyIrType {\n switch (true) {\n case (typeof type === \"object\" && type.type === \"marking\"):\n return {\n \"type\": \"marking\",\n marking: { markingType: type.markingType },\n };\n\n case (typeof type === \"object\" && type.type === \"struct\"):\n const structFields: Array<OntologyIrStructFieldType> = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field: OntologyIrStructFieldType;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition),\n };\n } else {\n // If it is a full form type definition then process it as such\n if (\"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n apiName: key,\n fieldType: propertyTypeTypeToOntologyIrType(\n fieldTypeDefinition.fieldType,\n ),\n displayMetadata: fieldTypeDefinition.displayMetadata\n ?? { displayName: key, description: undefined },\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? [],\n };\n } else {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition),\n };\n }\n }\n\n structFields.push(field);\n }\n\n return {\n type: \"struct\",\n struct: { structFields },\n };\n\n case (typeof type === \"object\" && type.type === \"string\"):\n return {\n \"type\": \"string\",\n \"string\": {\n analyzerOverride: undefined,\n enableAsciiFolding: type.enableAsciiFolding,\n isLongText: type.isLongText ?? false,\n supportsEfficientLeadingWildcard:\n type.supportsEfficientLeadingWildcard ?? false,\n supportsExactMatching: type.supportsExactMatching ?? true,\n supportsFullTextRegex: type.supportsFullTextRegex,\n },\n };\n\n case (typeof type === \"object\" && type.type === \"decimal\"):\n return {\n \"type\": \"decimal\",\n \"decimal\": {\n precision: type.precision,\n scale: type.scale,\n },\n };\n\n case (type === \"geopoint\"):\n return { type: \"geohash\", geohash: {} };\n\n case (type === \"decimal\"):\n return { type, [type]: { precision: undefined, scale: undefined } };\n\n case (type === \"string\"):\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsEfficientLeadingWildcard: false,\n supportsExactMatching: true,\n },\n };\n\n case (type === \"mediaReference\"):\n return {\n type: type,\n mediaReference: {},\n };\n\n case (type === \"geotimeSeries\"):\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {},\n };\n\n default:\n // use helper function to distribute `type` properly\n if (typeof type === \"object\") {\n throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);\n }\n return distributeTypeHelper(type);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,SAASA,oBAAoB,QAAQ,sCAAsC;AAE3E,OAAO,SAASC,gCAAgCA,CAC9CC,IAAsB,EACN;EAChB,QAAQ,IAAI;IACV,KAAM,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACA,IAAI,KAAK,SAAS;MACvD,OAAO;QACL,MAAM,EAAE,SAAS;QACjBC,OAAO,EAAE;UAAEC,WAAW,EAAEF,IAAI,CAACE;QAAY;MAC3C,CAAC;IAEH,KAAM,OAAOF,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACA,IAAI,KAAK,QAAQ;MACtD,MAAMG,YAA8C,GAAG,IAAIC,KAAK,CAAC,CAAC;MAClE,KAAK,MAAMC,GAAG,IAAIL,IAAI,CAACM,gBAAg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