@osdk/maker 0.16.0-beta.1 → 0.16.0-beta.11

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 (254) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/README.md +18 -1
  3. package/build/browser/api/cloneDefinition.js +36 -0
  4. package/build/browser/api/cloneDefinition.js.map +1 -0
  5. package/build/browser/api/code-snippets/createCodeSnippets.js +1 -1
  6. package/build/browser/api/code-snippets/createCodeSnippets.js.map +1 -1
  7. package/build/browser/api/defineAction.js +9 -1
  8. package/build/browser/api/defineAction.js.map +1 -1
  9. package/build/browser/api/defineCreateInterfaceObjectAction.js +3 -1
  10. package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
  11. package/build/browser/api/defineCreateObjectAction.js +3 -1
  12. package/build/browser/api/defineCreateObjectAction.js.map +1 -1
  13. package/build/browser/api/defineCreateOrModifyObjectAction.js +3 -1
  14. package/build/browser/api/defineCreateOrModifyObjectAction.js.map +1 -1
  15. package/build/browser/api/defineDeleteInterfaceObjectAction.js +3 -1
  16. package/build/browser/api/defineDeleteInterfaceObjectAction.js.map +1 -1
  17. package/build/browser/api/defineDeleteObjectAction.js +3 -1
  18. package/build/browser/api/defineDeleteObjectAction.js.map +1 -1
  19. package/build/browser/api/defineFunction.js +62 -0
  20. package/build/browser/api/defineFunction.js.map +1 -0
  21. package/build/browser/api/defineInterface.js +6 -1
  22. package/build/browser/api/defineInterface.js.map +1 -1
  23. package/build/browser/api/defineInterfaceLinkConstraint.js +6 -2
  24. package/build/browser/api/defineInterfaceLinkConstraint.js.map +1 -1
  25. package/build/browser/api/defineLink.js +6 -1
  26. package/build/browser/api/defineLink.js.map +1 -1
  27. package/build/browser/api/defineModifyInterfaceObjectAction.js +3 -1
  28. package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
  29. package/build/browser/api/defineModifyObjectAction.js +3 -1
  30. package/build/browser/api/defineModifyObjectAction.js.map +1 -1
  31. package/build/browser/api/defineObject.js +38 -12
  32. package/build/browser/api/defineObject.js.map +1 -1
  33. package/build/browser/api/defineOntology.js +29 -0
  34. package/build/browser/api/defineOntology.js.map +1 -1
  35. package/build/browser/api/defineSpt.js +3 -1
  36. package/build/browser/api/defineSpt.js.map +1 -1
  37. package/build/browser/api/defineValueType.js +3 -1
  38. package/build/browser/api/defineValueType.js.map +1 -1
  39. package/build/browser/api/interface/InterfaceType.js.map +1 -1
  40. package/build/browser/api/object/ObjectPropertyType.js.map +1 -1
  41. package/build/browser/api/object/ObjectType.js.map +1 -1
  42. package/build/browser/api/object/ObjectTypeDatasourceDefinition.js.map +1 -1
  43. package/build/browser/api/object/ObjectTypeDefinition.js.map +1 -1
  44. package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
  45. package/build/browser/api/properties/ReducerType.js +2 -0
  46. package/build/browser/api/properties/ReducerType.js.map +1 -0
  47. package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
  48. package/build/browser/cli/main.js +1 -1
  49. package/build/browser/cli/main.js.map +1 -1
  50. package/build/browser/conversion/toMarketplace/convertDatasourceDefinition.js +17 -6
  51. package/build/browser/conversion/toMarketplace/convertDatasourceDefinition.js.map +1 -1
  52. package/build/browser/conversion/toMarketplace/convertInterface.js +2 -1
  53. package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
  54. package/build/browser/conversion/toMarketplace/convertMainValue.js +36 -0
  55. package/build/browser/conversion/toMarketplace/convertMainValue.js.map +1 -0
  56. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +4 -3
  57. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  58. package/build/browser/conversion/toMarketplace/convertReducers.js +53 -0
  59. package/build/browser/conversion/toMarketplace/convertReducers.js.map +1 -0
  60. package/build/browser/conversion/toMarketplace/convertSpt.js +5 -3
  61. package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
  62. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -2
  63. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  64. package/build/browser/index.js +5 -2
  65. package/build/browser/index.js.map +1 -1
  66. package/build/browser/util/ApiNameValidator.js +26 -0
  67. package/build/browser/util/ApiNameValidator.js.map +1 -0
  68. package/build/cjs/index.cjs +288 -108
  69. package/build/cjs/index.cjs.map +1 -1
  70. package/build/cjs/index.d.cts +216 -164
  71. package/build/esm/api/cloneDefinition.js +36 -0
  72. package/build/esm/api/cloneDefinition.js.map +1 -0
  73. package/build/esm/api/code-snippets/createCodeSnippets.js +1 -1
  74. package/build/esm/api/code-snippets/createCodeSnippets.js.map +1 -1
  75. package/build/esm/api/defineAction.js +9 -1
  76. package/build/esm/api/defineAction.js.map +1 -1
  77. package/build/esm/api/defineCreateInterfaceObjectAction.js +3 -1
  78. package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
  79. package/build/esm/api/defineCreateObjectAction.js +3 -1
  80. package/build/esm/api/defineCreateObjectAction.js.map +1 -1
  81. package/build/esm/api/defineCreateOrModifyObjectAction.js +3 -1
  82. package/build/esm/api/defineCreateOrModifyObjectAction.js.map +1 -1
  83. package/build/esm/api/defineDeleteInterfaceObjectAction.js +3 -1
  84. package/build/esm/api/defineDeleteInterfaceObjectAction.js.map +1 -1
  85. package/build/esm/api/defineDeleteObjectAction.js +3 -1
  86. package/build/esm/api/defineDeleteObjectAction.js.map +1 -1
  87. package/build/esm/api/defineFunction.js +62 -0
  88. package/build/esm/api/defineFunction.js.map +1 -0
  89. package/build/esm/api/defineInterface.js +6 -1
  90. package/build/esm/api/defineInterface.js.map +1 -1
  91. package/build/esm/api/defineInterfaceLinkConstraint.js +6 -2
  92. package/build/esm/api/defineInterfaceLinkConstraint.js.map +1 -1
  93. package/build/esm/api/defineLink.js +6 -1
  94. package/build/esm/api/defineLink.js.map +1 -1
  95. package/build/esm/api/defineModifyInterfaceObjectAction.js +3 -1
  96. package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
  97. package/build/esm/api/defineModifyObjectAction.js +3 -1
  98. package/build/esm/api/defineModifyObjectAction.js.map +1 -1
  99. package/build/esm/api/defineObject.js +38 -12
  100. package/build/esm/api/defineObject.js.map +1 -1
  101. package/build/esm/api/defineOntology.js +29 -0
  102. package/build/esm/api/defineOntology.js.map +1 -1
  103. package/build/esm/api/defineSpt.js +3 -1
  104. package/build/esm/api/defineSpt.js.map +1 -1
  105. package/build/esm/api/defineValueType.js +3 -1
  106. package/build/esm/api/defineValueType.js.map +1 -1
  107. package/build/esm/api/interface/InterfaceType.js.map +1 -1
  108. package/build/esm/api/object/ObjectPropertyType.js.map +1 -1
  109. package/build/esm/api/object/ObjectType.js.map +1 -1
  110. package/build/esm/api/object/ObjectTypeDatasourceDefinition.js.map +1 -1
  111. package/build/esm/api/object/ObjectTypeDefinition.js.map +1 -1
  112. package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
  113. package/build/esm/api/properties/ReducerType.js +2 -0
  114. package/build/esm/api/properties/ReducerType.js.map +1 -0
  115. package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
  116. package/build/esm/cli/main.js +1 -1
  117. package/build/esm/cli/main.js.map +1 -1
  118. package/build/esm/conversion/toMarketplace/convertDatasourceDefinition.js +17 -6
  119. package/build/esm/conversion/toMarketplace/convertDatasourceDefinition.js.map +1 -1
  120. package/build/esm/conversion/toMarketplace/convertInterface.js +2 -1
  121. package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
  122. package/build/esm/conversion/toMarketplace/convertMainValue.js +36 -0
  123. package/build/esm/conversion/toMarketplace/convertMainValue.js.map +1 -0
  124. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +4 -3
  125. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  126. package/build/esm/conversion/toMarketplace/convertReducers.js +53 -0
  127. package/build/esm/conversion/toMarketplace/convertReducers.js.map +1 -0
  128. package/build/esm/conversion/toMarketplace/convertSpt.js +5 -3
  129. package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
  130. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -2
  131. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  132. package/build/esm/index.js +5 -2
  133. package/build/esm/index.js.map +1 -1
  134. package/build/esm/util/ApiNameValidator.js +26 -0
  135. package/build/esm/util/ApiNameValidator.js.map +1 -0
  136. package/build/types/api/cloneDefinition.d.ts +9 -0
  137. package/build/types/api/cloneDefinition.d.ts.map +1 -0
  138. package/build/types/api/defineAction.d.ts +1 -1
  139. package/build/types/api/defineAction.d.ts.map +1 -1
  140. package/build/types/api/defineCreateInterfaceObjectAction.d.ts +1 -1
  141. package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
  142. package/build/types/api/defineCreateObjectAction.d.ts +1 -1
  143. package/build/types/api/defineCreateObjectAction.d.ts.map +1 -1
  144. package/build/types/api/defineCreateOrModifyObjectAction.d.ts +1 -1
  145. package/build/types/api/defineCreateOrModifyObjectAction.d.ts.map +1 -1
  146. package/build/types/api/defineDeleteInterfaceObjectAction.d.ts +1 -1
  147. package/build/types/api/defineDeleteInterfaceObjectAction.d.ts.map +1 -1
  148. package/build/types/api/defineDeleteObjectAction.d.ts +1 -1
  149. package/build/types/api/defineDeleteObjectAction.d.ts.map +1 -1
  150. package/build/types/api/defineFunction.d.ts +19 -0
  151. package/build/types/api/defineFunction.d.ts.map +1 -0
  152. package/build/types/api/defineInterface.d.ts +1 -1
  153. package/build/types/api/defineInterface.d.ts.map +1 -1
  154. package/build/types/api/defineInterfaceLinkConstraint.d.ts +1 -1
  155. package/build/types/api/defineInterfaceLinkConstraint.d.ts.map +1 -1
  156. package/build/types/api/defineLink.d.ts +1 -1
  157. package/build/types/api/defineLink.d.ts.map +1 -1
  158. package/build/types/api/defineModifyInterfaceObjectAction.d.ts +1 -1
  159. package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
  160. package/build/types/api/defineModifyObjectAction.d.ts +1 -1
  161. package/build/types/api/defineModifyObjectAction.d.ts.map +1 -1
  162. package/build/types/api/defineObject.d.ts +1 -1
  163. package/build/types/api/defineObject.d.ts.map +1 -1
  164. package/build/types/api/defineOntology.d.ts +5 -0
  165. package/build/types/api/defineOntology.d.ts.map +1 -1
  166. package/build/types/api/defineSpt.d.ts +3 -1
  167. package/build/types/api/defineSpt.d.ts.map +1 -1
  168. package/build/types/api/defineValueType.d.ts +1 -1
  169. package/build/types/api/defineValueType.d.ts.map +1 -1
  170. package/build/types/api/interface/InterfaceType.d.ts +1 -1
  171. package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
  172. package/build/types/api/object/ObjectPropertyType.d.ts +2 -0
  173. package/build/types/api/object/ObjectPropertyType.d.ts.map +1 -1
  174. package/build/types/api/object/ObjectType.d.ts +1 -0
  175. package/build/types/api/object/ObjectType.d.ts.map +1 -1
  176. package/build/types/api/object/ObjectTypeDatasourceDefinition.d.ts +10 -3
  177. package/build/types/api/object/ObjectTypeDatasourceDefinition.d.ts.map +1 -1
  178. package/build/types/api/object/ObjectTypeDefinition.d.ts +1 -0
  179. package/build/types/api/object/ObjectTypeDefinition.d.ts.map +1 -1
  180. package/build/types/api/properties/PropertyTypeType.d.ts +4 -0
  181. package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
  182. package/build/types/api/properties/ReducerType.d.ts +4 -0
  183. package/build/types/api/properties/ReducerType.d.ts.map +1 -0
  184. package/build/types/api/properties/SharedPropertyType.d.ts +2 -0
  185. package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
  186. package/build/types/conversion/toMarketplace/convertDatasourceDefinition.d.ts.map +1 -1
  187. package/build/types/conversion/toMarketplace/convertMainValue.d.ts +4 -0
  188. package/build/types/conversion/toMarketplace/convertMainValue.d.ts.map +1 -0
  189. package/build/types/conversion/toMarketplace/convertObjectPropertyType.d.ts.map +1 -1
  190. package/build/types/conversion/toMarketplace/convertReducers.d.ts +6 -0
  191. package/build/types/conversion/toMarketplace/convertReducers.d.ts.map +1 -0
  192. package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
  193. package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
  194. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.d.ts +2 -1
  195. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.d.ts.map +1 -1
  196. package/build/types/index.d.ts +14 -6
  197. package/build/types/index.d.ts.map +1 -1
  198. package/build/types/util/ApiNameValidator.d.ts +4 -0
  199. package/build/types/util/ApiNameValidator.d.ts.map +1 -0
  200. package/package.json +4 -3
  201. package/build/browser/api/test/actions.test.js +0 -14397
  202. package/build/browser/api/test/actions.test.js.map +0 -1
  203. package/build/browser/api/test/interfaces.test.js +0 -1189
  204. package/build/browser/api/test/interfaces.test.js.map +0 -1
  205. package/build/browser/api/test/links.test.js +0 -2019
  206. package/build/browser/api/test/links.test.js.map +0 -1
  207. package/build/browser/api/test/markingconstraint.test.js +0 -134
  208. package/build/browser/api/test/markingconstraint.test.js.map +0 -1
  209. package/build/browser/api/test/misc.test.js +0 -1315
  210. package/build/browser/api/test/misc.test.js.map +0 -1
  211. package/build/browser/api/test/objectStatus.test.js +0 -160
  212. package/build/browser/api/test/objectStatus.test.js.map +0 -1
  213. package/build/browser/api/test/objects.test.js +0 -3856
  214. package/build/browser/api/test/objects.test.js.map +0 -1
  215. package/build/browser/api/test/spt.test.js +0 -722
  216. package/build/browser/api/test/spt.test.js.map +0 -1
  217. package/build/browser/api/test/valueTypes.test.js +0 -307
  218. package/build/browser/api/test/valueTypes.test.js.map +0 -1
  219. package/build/esm/api/test/actions.test.js +0 -14397
  220. package/build/esm/api/test/actions.test.js.map +0 -1
  221. package/build/esm/api/test/interfaces.test.js +0 -1189
  222. package/build/esm/api/test/interfaces.test.js.map +0 -1
  223. package/build/esm/api/test/links.test.js +0 -2019
  224. package/build/esm/api/test/links.test.js.map +0 -1
  225. package/build/esm/api/test/markingconstraint.test.js +0 -134
  226. package/build/esm/api/test/markingconstraint.test.js.map +0 -1
  227. package/build/esm/api/test/misc.test.js +0 -1315
  228. package/build/esm/api/test/misc.test.js.map +0 -1
  229. package/build/esm/api/test/objectStatus.test.js +0 -160
  230. package/build/esm/api/test/objectStatus.test.js.map +0 -1
  231. package/build/esm/api/test/objects.test.js +0 -3856
  232. package/build/esm/api/test/objects.test.js.map +0 -1
  233. package/build/esm/api/test/spt.test.js +0 -722
  234. package/build/esm/api/test/spt.test.js.map +0 -1
  235. package/build/esm/api/test/valueTypes.test.js +0 -307
  236. package/build/esm/api/test/valueTypes.test.js.map +0 -1
  237. package/build/types/api/test/actions.test.d.ts +0 -1
  238. package/build/types/api/test/actions.test.d.ts.map +0 -1
  239. package/build/types/api/test/interfaces.test.d.ts +0 -1
  240. package/build/types/api/test/interfaces.test.d.ts.map +0 -1
  241. package/build/types/api/test/links.test.d.ts +0 -1
  242. package/build/types/api/test/links.test.d.ts.map +0 -1
  243. package/build/types/api/test/markingconstraint.test.d.ts +0 -1
  244. package/build/types/api/test/markingconstraint.test.d.ts.map +0 -1
  245. package/build/types/api/test/misc.test.d.ts +0 -1
  246. package/build/types/api/test/misc.test.d.ts.map +0 -1
  247. package/build/types/api/test/objectStatus.test.d.ts +0 -1
  248. package/build/types/api/test/objectStatus.test.d.ts.map +0 -1
  249. package/build/types/api/test/objects.test.d.ts +0 -1
  250. package/build/types/api/test/objects.test.d.ts.map +0 -1
  251. package/build/types/api/test/spt.test.d.ts +0 -1
  252. package/build/types/api/test/spt.test.d.ts.map +0 -1
  253. package/build/types/api/test/valueTypes.test.d.ts +0 -1
  254. package/build/types/api/test/valueTypes.test.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { OntologyIrLabelledValue, OntologyIrConditionValue, OntologyIrParameterDateRangeValue, InterfaceTypeApiName, OntologyIrCondition, OntologyIrParameterPrefill, OntologyIrBaseParameterType_decimal, OntologyIrBaseParameterType_decimalList, OntologyIrBaseParameterType_timestamp, OntologyIrBaseParameterType_timestampList, OntologyIrBaseParameterType_objectReference, OntologyIrBaseParameterType_objectReferenceList, OntologyIrBaseParameterType_objectSetRid, OntologyIrBaseParameterType_objectTypeReference, OntologyIrBaseParameterType_interfaceReference, OntologyIrBaseParameterType_interfaceReferenceList, OntologyIrBaseParameterType_struct, OntologyIrBaseParameterType_structList, ParameterRenderHint, ParameterId, ActionTypeStatus_deprecated, ButtonDisplayMetadata, ActionTypeApiName, OntologyIrLogicRule, SectionId, OntologyIrActionTypeEntities, OntologyIrFormContent, OntologyIrValidationRule, DisplayMetadataConfigurationDefaultLayout, DisplayMetadataConfigurationDisplayAndFormat, OntologyIrLogicRuleValue_parameterId, OntologyIrLogicRuleValue_staticValue, OntologyIrLogicRuleValue_objectParameterPropertyValue, OntologyIrLogicRuleValue_interfaceParameterPropertyValue, OntologyIrLogicRuleValue_synchronousWebhookOutput, ValidationRuleDisplayMetadata, ParameterRid, StructFieldType, OntologyIrValueTypeReferenceWithMetadata, Visibility, SharedPropertyTypeGothamMapping, OntologyIrBaseFormatter, OntologyIrMarketplaceInterfaceType, InterfaceTypeStatus, ValueTypeApiName, ValueTypeDisplayMetadata, ValueTypeStatus, ValueTypeVersion, BaseType, ValueTypeDataConstraint, ExampleValue, LinkTypeMetadata, LinkTypeId, OntologyIrSecurityGroupGranularCondition, MarkingType, DerivedPropertyLinkTypeSide, ObjectTypeFieldApiName, OntologyIrObjectType, OntologyIr, DataConstraint, FailureMessage, ValueTypeRid, OntologyIrType } from '@osdk/client.unstable';
1
+ import { OntologyIrLabelledValue, OntologyIrConditionValue, OntologyIrParameterDateRangeValue, InterfaceTypeApiName, OntologyIrCondition, OntologyIrParameterPrefill, OntologyIrBaseParameterType_decimal, OntologyIrBaseParameterType_decimalList, OntologyIrBaseParameterType_timestamp, OntologyIrBaseParameterType_timestampList, OntologyIrBaseParameterType_objectReference, OntologyIrBaseParameterType_objectReferenceList, OntologyIrBaseParameterType_objectSetRid, OntologyIrBaseParameterType_objectTypeReference, OntologyIrBaseParameterType_interfaceReference, OntologyIrBaseParameterType_interfaceReferenceList, OntologyIrBaseParameterType_struct, OntologyIrBaseParameterType_structList, ParameterRenderHint, ParameterId, ActionTypeStatus_deprecated, ButtonDisplayMetadata, ActionTypeApiName, OntologyIrLogicRule, SectionId, OntologyIrActionTypeEntities, OntologyIrFormContent, OntologyIrValidationRule, DisplayMetadataConfigurationDefaultLayout, DisplayMetadataConfigurationDisplayAndFormat, OntologyIrLogicRuleValue_parameterId, OntologyIrLogicRuleValue_staticValue, OntologyIrLogicRuleValue_objectParameterPropertyValue, OntologyIrLogicRuleValue_interfaceParameterPropertyValue, OntologyIrLogicRuleValue_synchronousWebhookOutput, ValueTypeApiName, ValueTypeDisplayMetadata, ValueTypeStatus, ValueTypeVersion, BaseType, ValueTypeDataConstraint, ExampleValue, StructFieldType, OntologyIrValueTypeReferenceWithMetadata, Visibility, SharedPropertyTypeGothamMapping, OntologyIrBaseFormatter, OntologyIrMarketplaceInterfaceType, InterfaceTypeStatus, OntologyIrSecurityGroupGranularCondition, MarkingType, DerivedPropertyLinkTypeSide, ObjectTypeFieldApiName, LinkTypeMetadata, LinkTypeId, OntologyIrObjectType, ValidationRuleDisplayMetadata, ParameterRid, OntologyIr, DataConstraint, FailureMessage, ValueTypeRid, OntologyIrType } from '@osdk/client.unstable';
2
2
 
3
3
  declare function main(args?: string[]): Promise<void>;
4
4
 
@@ -228,20 +228,16 @@ type CustomMapping = OntologyIrLogicRuleValue_parameterId | OntologyIrLogicRuleV
228
228
 
229
229
  declare function addDependency(namespaceNoDot: string, fileInPackage: string): void;
230
230
 
231
- type ActionLevelValidationDefinition = Array<ActionLevelValidationRule>;
232
- type ActionLevelValidationRule = {
233
- condition: ConditionDefinition;
234
- displayMetadata?: ValidationRuleDisplayMetadata;
235
- };
236
-
237
- type DefaultFormat = "FORM" | "TABLE";
238
-
239
- type TableConfiguration = {
240
- columnWidthByParameterRid: Record<ParameterRid, number>;
241
- enableFileImport: boolean;
242
- fitHorizontally: boolean;
243
- frozenColumnCount: number;
244
- rowHeightInLines: number;
231
+ type ValueTypeDefinitionVersion = OntologyEntityBase & {
232
+ apiName: ValueTypeApiName;
233
+ packageNamespace: string;
234
+ displayMetadata: ValueTypeDisplayMetadata;
235
+ status: ValueTypeStatus;
236
+ version: ValueTypeVersion;
237
+ baseType: BaseType;
238
+ constraints: ValueTypeDataConstraint[];
239
+ exampleValues: ExampleValue[];
240
+ __type: OntologyEntityTypeEnum.VALUE_TYPE;
245
241
  };
246
242
 
247
243
  type PropertyTypeType = PropertyTypeTypePrimitive | PropertyTypeTypeExotic;
@@ -257,6 +253,10 @@ type PropertyTypeTypeStruct = {
257
253
  structDefinition: {
258
254
  [api_name: string]: StructPropertyType | Exclude<PropertyTypeTypesWithoutStruct, PropertyTypeTypeMarking>;
259
255
  };
256
+ mainValue?: {
257
+ fields: string | Array<string>;
258
+ type: PropertyTypeType;
259
+ };
260
260
  };
261
261
  type PropertyTypeTypeString = {
262
262
  type: "string";
@@ -272,6 +272,7 @@ type PropertyTypeTypeDecimal = {
272
272
  scale?: number;
273
273
  };
274
274
  type PropertyTypeTypesWithoutStruct = Exclude<PropertyTypeType, PropertyTypeTypeStruct>;
275
+ declare function isExotic(type: PropertyTypeType | undefined): type is PropertyTypeTypeExotic;
275
276
  type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
276
277
  interface StructPropertyType extends Optional<Omit<StructFieldType, "fieldType" | "structFieldRid" | "apiName">, "typeClasses" | "aliases"> {
277
278
  fieldType: PropertyTypeTypesWithoutStruct;
@@ -283,6 +284,11 @@ interface Nullability {
283
284
  noNulls: boolean;
284
285
  }
285
286
 
287
+ type ReducerType = {
288
+ direction: "ascending" | "descending";
289
+ structField?: string;
290
+ };
291
+
286
292
  interface SharedPropertyType extends OntologyEntityBase, PropertyType {
287
293
  apiName: string;
288
294
  nonNameSpacedApiName: string;
@@ -294,6 +300,7 @@ interface SharedPropertyType extends OntologyEntityBase, PropertyType {
294
300
  interface PropertyType {
295
301
  type: PropertyTypeType;
296
302
  array?: boolean;
303
+ reducers?: Array<ReducerType>;
297
304
  description?: string;
298
305
  displayName?: string;
299
306
  valueType?: OntologyIrValueTypeReferenceWithMetadata;
@@ -312,8 +319,9 @@ interface InterfaceSharedPropertyType {
312
319
  sharedPropertyType: SharedPropertyType;
313
320
  required: boolean;
314
321
  }
322
+ declare function isInterfaceSharedPropertyType(interfacePropertyType: InterfacePropertyType): interfacePropertyType is InterfaceSharedPropertyType;
315
323
 
316
- interface InterfaceType extends OntologyEntityBase, Omit<OntologyIrMarketplaceInterfaceType, "properties" | "propertiesV2" | "propertiesV3" | "extendsInterfaces"> {
324
+ interface InterfaceType extends OntologyEntityBase, Omit<OntologyIrMarketplaceInterfaceType, "properties" | "propertiesV2" | "propertiesV3" | "extendsInterfaces" | "extendsInterfacesMetadata"> {
317
325
  propertiesV2: Record<string, InterfaceSharedPropertyType>;
318
326
  propertiesV3: Record<string, InterfacePropertyType>;
319
327
  extendsInterfaces: Array<InterfaceType>;
@@ -321,16 +329,12 @@ interface InterfaceType extends OntologyEntityBase, Omit<OntologyIrMarketplaceIn
321
329
  __type: OntologyEntityTypeEnum.INTERFACE_TYPE;
322
330
  }
323
331
 
324
- type ValueTypeDefinitionVersion = OntologyEntityBase & {
325
- apiName: ValueTypeApiName;
326
- packageNamespace: string;
327
- displayMetadata: ValueTypeDisplayMetadata;
328
- status: ValueTypeStatus;
329
- version: ValueTypeVersion;
330
- baseType: BaseType;
331
- constraints: ValueTypeDataConstraint[];
332
- exampleValues: ExampleValue[];
333
- __type: OntologyEntityTypeEnum.VALUE_TYPE;
332
+ type InterfaceImplementation = {
333
+ implements: InterfaceType;
334
+ propertyMapping: {
335
+ interfaceProperty: string;
336
+ mapsTo: string;
337
+ }[];
334
338
  };
335
339
 
336
340
  type ObjectTypeStatus = "active" | "experimental" | "example" | {
@@ -350,6 +354,7 @@ interface ObjectPropertyTypeInner {
350
354
  }>;
351
355
  type: PropertyTypeType;
352
356
  array?: boolean;
357
+ reducers?: Array<ReducerType>;
353
358
  valueType: ValueTypeDefinitionVersion;
354
359
  sharedPropertyType: SharedPropertyType;
355
360
  description: string | undefined;
@@ -362,12 +367,115 @@ interface ObjectPropertyTypeInner {
362
367
 
363
368
  type ObjectPropertyTypeUserDefinition = Omit<RequiredFields<Partial<ObjectPropertyTypeInner>, "type">, "apiName">;
364
369
 
365
- type InterfaceImplementation = {
366
- implements: InterfaceType;
367
- propertyMapping: {
368
- interfaceProperty: string;
369
- mapsTo: string;
370
- }[];
370
+ type SecurityConditionDefinition = SecurityUnionCondition | OntologyIrSecurityGroupGranularCondition | SecurityGroupValidationRule | SecurityGroupPropertyValidationRule | SecurityMarkingPropertyRule;
371
+ type SecurityUnionCondition = {
372
+ type: "and" | "or";
373
+ conditions: Array<SecurityConditionDefinition>;
374
+ };
375
+ type SecurityGroupValidationRule = {
376
+ type: "group";
377
+ name: string;
378
+ };
379
+ type SecurityGroupPropertyValidationRule = {
380
+ type: "groupProperty";
381
+ property: string;
382
+ };
383
+ type SecurityMarkingPropertyRule = {
384
+ type: "markingProperty";
385
+ property: string;
386
+ };
387
+
388
+ type ObjectTypeDatasourceDefinition = ObjectTypeDatasourceDefinition_stream | ObjectTypeDatasourceDefinition_dataset | ObjectTypeDatasourceDefinition_restrictedView | ObjectTypeDatasourceDefinition_derived | ObjectTypeDatasourceDefinition_direct;
389
+ interface ObjectTypeDatasourceDefinition_dataset {
390
+ type: "dataset";
391
+ objectSecurityPolicy?: ObjectSecurityPolicy;
392
+ propertySecurityGroups?: Array<PropertySecurityGroup>;
393
+ }
394
+ interface ObjectSecurityPolicy {
395
+ name: string;
396
+ granularPolicy?: SecurityConditionDefinition;
397
+ appliedMarkings?: Record<string, MarkingType>;
398
+ assumedMarkings?: Record<string, MarkingType>;
399
+ }
400
+ interface PropertySecurityGroup {
401
+ name: string;
402
+ properties: Array<string>;
403
+ granularPolicy?: SecurityConditionDefinition;
404
+ appliedMarkings?: Record<string, MarkingType>;
405
+ assumedMarkings?: Record<string, MarkingType>;
406
+ }
407
+ interface ObjectTypeDatasourceDefinition_stream {
408
+ type: "stream";
409
+ retentionPeriod?: string;
410
+ }
411
+ interface ObjectTypeDatasourceDefinition_restrictedView {
412
+ type: "restrictedView";
413
+ }
414
+ interface ObjectTypeDatasourceDefinition_derived {
415
+ type: "derived";
416
+ linkDefinition: Array<DerivedPropertiesLinkDefinition>;
417
+ propertyMapping: Record<ObjectTypeFieldApiName, ObjectTypeFieldApiName> | Record<ObjectTypeFieldApiName, DerivedPropertyAggregation>;
418
+ }
419
+ interface DerivedPropertiesLinkDefinition {
420
+ linkType: LinkType;
421
+ side?: DerivedPropertyLinkTypeSide;
422
+ }
423
+ type DerivedPropertyAggregation = {
424
+ type: "count";
425
+ } | {
426
+ type: "avg";
427
+ property: ObjectTypeFieldApiName;
428
+ } | {
429
+ type: "sum";
430
+ property: ObjectTypeFieldApiName;
431
+ } | {
432
+ type: "min";
433
+ property: ObjectTypeFieldApiName;
434
+ } | {
435
+ type: "max";
436
+ property: ObjectTypeFieldApiName;
437
+ } | {
438
+ type: "approximateCardinality";
439
+ property: ObjectTypeFieldApiName;
440
+ } | {
441
+ type: "exactCardinality";
442
+ property: ObjectTypeFieldApiName;
443
+ } | {
444
+ type: "collectList";
445
+ property: ObjectTypeFieldApiName;
446
+ limit: number;
447
+ } | {
448
+ type: "collectSet";
449
+ property: ObjectTypeFieldApiName;
450
+ limit: number;
451
+ };
452
+ interface ObjectTypeDatasourceDefinition_direct {
453
+ type: "direct";
454
+ objectSecurityPolicy?: ObjectSecurityPolicy;
455
+ propertySecurityGroups?: Array<PropertySecurityGroup>;
456
+ }
457
+
458
+ type ObjectTypeDefinition = {
459
+ apiName: string;
460
+ primaryKeyPropertyApiName: string;
461
+ displayName: string;
462
+ pluralDisplayName: string;
463
+ titlePropertyApiName: string;
464
+ properties?: {
465
+ [key: string]: ObjectPropertyTypeUserDefinition;
466
+ };
467
+ implementsInterfaces?: Array<InterfaceImplementation>;
468
+ description?: string;
469
+ icon?: {
470
+ locator: BlueprintIcon;
471
+ color: string;
472
+ };
473
+ visibility?: Visibility;
474
+ editsEnabled?: boolean;
475
+ status?: ObjectTypeStatus;
476
+ datasources?: Array<ObjectTypeDatasourceDefinition>;
477
+ aliases?: Array<string>;
478
+ includeEmptyBackingDatasource?: boolean;
371
479
  };
372
480
 
373
481
  type LinkType = (OntologyEntityBase & OneToManyLinkTypeDefinition & {
@@ -476,107 +584,58 @@ type UserLinkTypeStatus = "active" | "experimental" | "example" | {
476
584
  replacedBy?: LinkTypeId;
477
585
  };
478
586
 
479
- type SecurityConditionDefinition = SecurityUnionCondition | OntologyIrSecurityGroupGranularCondition | SecurityGroupValidationRule | SecurityGroupPropertyValidationRule | SecurityMarkingPropertyRule;
480
- type SecurityUnionCondition = {
481
- type: "and" | "or";
482
- conditions: Array<SecurityConditionDefinition>;
483
- };
484
- type SecurityGroupValidationRule = {
485
- type: "group";
486
- name: string;
487
- };
488
- type SecurityGroupPropertyValidationRule = {
489
- type: "groupProperty";
490
- property: string;
491
- };
492
- type SecurityMarkingPropertyRule = {
493
- type: "markingProperty";
494
- property: string;
495
- };
496
-
497
- type ObjectTypeDatasourceDefinition = ObjectTypeDatasourceDefinition_stream | ObjectTypeDatasourceDefinition_dataset | ObjectTypeDatasourceDefinition_restrictedView | ObjectTypeDatasourceDefinition_derived;
498
- interface ObjectTypeDatasourceDefinition_dataset {
499
- type: "dataset";
500
- objectSecurityPolicy?: ObjectSecurityPolicy;
501
- propertySecurityGroups?: Array<PropertySecurityGroup>;
502
- }
503
- interface ObjectSecurityPolicy {
504
- name: string;
505
- granularPolicy?: SecurityConditionDefinition;
506
- additionalMandatoryMarkings?: Record<string, MarkingType>;
507
- }
508
- interface PropertySecurityGroup {
509
- name: string;
510
- properties: Array<string>;
511
- granularPolicy?: SecurityConditionDefinition;
512
- additionalMandatoryMarkings?: Record<string, MarkingType>;
513
- }
514
- interface ObjectTypeDatasourceDefinition_stream {
515
- type: "stream";
516
- retentionPeriod?: string;
517
- }
518
- interface ObjectTypeDatasourceDefinition_restrictedView {
519
- type: "restrictedView";
520
- }
521
- interface ObjectTypeDatasourceDefinition_derived {
522
- type: "derived";
523
- linkDefinition: Array<DerivedPropertiesLinkDefinition>;
524
- propertyMapping: Record<ObjectTypeFieldApiName, ObjectTypeFieldApiName> | Record<ObjectTypeFieldApiName, DerivedPropertyAggregation>;
525
- }
526
- interface DerivedPropertiesLinkDefinition {
527
- linkType: LinkType;
528
- side?: DerivedPropertyLinkTypeSide;
529
- }
530
- type DerivedPropertyAggregation = {
531
- type: "count";
532
- } | {
533
- type: "avg";
534
- property: ObjectTypeFieldApiName;
535
- } | {
536
- type: "sum";
537
- property: ObjectTypeFieldApiName;
538
- } | {
539
- type: "min";
540
- property: ObjectTypeFieldApiName;
541
- } | {
542
- type: "max";
543
- property: ObjectTypeFieldApiName;
544
- } | {
545
- type: "approximateCardinality";
546
- property: ObjectTypeFieldApiName;
547
- } | {
548
- type: "exactCardinality";
549
- property: ObjectTypeFieldApiName;
550
- } | {
551
- type: "collectList";
552
- property: ObjectTypeFieldApiName;
553
- limit: number;
554
- } | {
555
- type: "collectSet";
556
- property: ObjectTypeFieldApiName;
557
- limit: number;
587
+ type ObjectType = OntologyEntityBase & RequiredFields<Partial<ObjectTypeInner>, "apiName" | "primaryKeyPropertyApiName" | "displayName" | "pluralDisplayName" | "titlePropertyApiName"> & {
588
+ datasources?: Array<ObjectTypeDatasourceDefinition>;
589
+ includeEmptyBackingDatasource?: boolean;
590
+ __type: OntologyEntityTypeEnum.OBJECT_TYPE;
558
591
  };
559
-
560
- type ObjectTypeDefinition = {
561
- apiName: string;
592
+ interface ObjectTypeInner extends Omit<OntologyIrObjectType, "titlePropertyTypeRid" | "propertyTypes" | "allImplementsInterfaces" | "implementsInterfaces2" | "displayMetadata" | "primaryKeys" | "status"> {
562
593
  primaryKeyPropertyApiName: string;
563
- displayName: string;
564
- pluralDisplayName: string;
594
+ properties: Array<ObjectPropertyType>;
565
595
  titlePropertyApiName: string;
566
- properties?: {
567
- [key: string]: ObjectPropertyTypeUserDefinition;
568
- };
569
- implementsInterfaces?: Array<InterfaceImplementation>;
570
- description?: string;
571
- icon?: {
596
+ implementsInterfaces: Array<InterfaceImplementation>;
597
+ description: string | undefined;
598
+ icon: {
572
599
  locator: BlueprintIcon;
573
600
  color: string;
574
- };
575
- visibility?: Visibility;
576
- editsEnabled?: boolean;
601
+ } | undefined;
602
+ displayName: string;
603
+ pluralDisplayName: string;
604
+ visibility: Visibility;
605
+ editsEnabled: boolean;
577
606
  status?: ObjectTypeStatus;
578
- datasources?: Array<ObjectTypeDatasourceDefinition>;
579
607
  aliases?: Array<string>;
608
+ }
609
+
610
+ interface OntologyEntityTypeMapping {
611
+ [OntologyEntityTypeEnum.OBJECT_TYPE]: ObjectType;
612
+ [OntologyEntityTypeEnum.ACTION_TYPE]: ActionType;
613
+ [OntologyEntityTypeEnum.LINK_TYPE]: LinkType;
614
+ [OntologyEntityTypeEnum.INTERFACE_TYPE]: InterfaceType;
615
+ [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: SharedPropertyType;
616
+ [OntologyEntityTypeEnum.VALUE_TYPE]: ValueTypeDefinitionVersion;
617
+ }
618
+
619
+ type OntologyDefinition = {
620
+ [K in Exclude<OntologyEntityTypeEnum, "VALUE_TYPE">]: Record<string, OntologyEntityTypeMapping[K]>;
621
+ } & {
622
+ VALUE_TYPE: Record<string, ValueTypeDefinitionVersion[]>;
623
+ };
624
+
625
+ type ActionLevelValidationDefinition = Array<ActionLevelValidationRule>;
626
+ type ActionLevelValidationRule = {
627
+ condition: ConditionDefinition;
628
+ displayMetadata?: ValidationRuleDisplayMetadata;
629
+ };
630
+
631
+ type DefaultFormat = "FORM" | "TABLE";
632
+
633
+ type TableConfiguration = {
634
+ columnWidthByParameterRid: Record<ParameterRid, number>;
635
+ enableFileImport: boolean;
636
+ fitHorizontally: boolean;
637
+ frozenColumnCount: number;
638
+ rowHeightInLines: number;
580
639
  };
581
640
 
582
641
  declare const MODIFY_OBJECT_PARAMETER: string;
@@ -629,17 +688,17 @@ type InterfaceActionTypeUserDefinition = {
629
688
  color: string;
630
689
  };
631
690
  };
632
- declare function defineAction(actionDef: ActionTypeDefinition): ActionType;
691
+ declare function defineAction(actionDefInput: ActionTypeDefinition): ActionType;
633
692
 
634
- declare function defineCreateInterfaceObjectAction(def: InterfaceActionTypeUserDefinition): ActionType;
693
+ declare function defineCreateInterfaceObjectAction(defInput: InterfaceActionTypeUserDefinition): ActionType;
635
694
 
636
- declare function defineCreateObjectAction(def: ActionTypeUserDefinition): ActionType;
695
+ declare function defineCreateObjectAction(defInput: ActionTypeUserDefinition): ActionType;
637
696
 
638
- declare function defineCreateOrModifyObjectAction(def: ActionTypeUserDefinition): ActionType;
697
+ declare function defineCreateOrModifyObjectAction(defInput: ActionTypeUserDefinition): ActionType;
639
698
 
640
- declare function defineDeleteInterfaceObjectAction(def: InterfaceActionTypeUserDefinition): ActionType;
699
+ declare function defineDeleteInterfaceObjectAction(defInput: InterfaceActionTypeUserDefinition): ActionType;
641
700
 
642
- declare function defineDeleteObjectAction(def: ActionTypeUserDefinition): ActionType;
701
+ declare function defineDeleteObjectAction(defInput: ActionTypeUserDefinition): ActionType;
643
702
 
644
703
  type SimplifiedInterfaceTypeStatus = {
645
704
  type: "deprecated";
@@ -670,7 +729,7 @@ type InterfaceTypeDefinition = {
670
729
  extends?: InterfaceType | InterfaceType[];
671
730
  searchable?: boolean;
672
731
  };
673
- declare function defineInterface(interfaceDef: InterfaceTypeDefinition): InterfaceType;
732
+ declare function defineInterface(interfaceDefInput: InterfaceTypeDefinition): InterfaceType;
674
733
 
675
734
  type ApiNameOrInterfaceType = string | InterfaceType;
676
735
  type Many = {
@@ -691,48 +750,35 @@ type One = {
691
750
  description?: string;
692
751
  required?: boolean;
693
752
  };
694
- declare function defineInterfaceLinkConstraint(linkDef: One | Many): void;
753
+ declare function defineInterfaceLinkConstraint(linkDefInput: One | Many): void;
695
754
 
696
- declare function defineLink(linkDefinition: LinkTypeDefinition): LinkType;
755
+ declare function defineLink(linkDefinitionInput: LinkTypeDefinition): LinkType;
697
756
 
698
- declare function defineModifyInterfaceObjectAction(def: InterfaceActionTypeUserDefinition): ActionType;
757
+ declare function defineModifyInterfaceObjectAction(defInput: InterfaceActionTypeUserDefinition): ActionType;
699
758
 
700
- declare function defineModifyObjectAction(def: ActionTypeUserDefinition): ActionType;
759
+ declare function defineModifyObjectAction(defInput: ActionTypeUserDefinition): ActionType;
701
760
 
702
- declare function defineObject(objectDef: ObjectTypeDefinition): ObjectTypeDefinition;
761
+ declare function defineObject(objectDefInput: ObjectTypeDefinition): ObjectTypeDefinition;
703
762
  declare function uppercaseFirstLetter(s: string | undefined | null): string;
704
763
  declare function convertToPluralDisplayName(s: string | undefined | null): string;
705
764
 
706
- type ObjectType = OntologyEntityBase & RequiredFields<Partial<ObjectTypeInner>, "apiName" | "primaryKeyPropertyApiName" | "displayName" | "pluralDisplayName" | "titlePropertyApiName"> & {
707
- datasources?: Array<ObjectTypeDatasourceDefinition>;
708
- __type: OntologyEntityTypeEnum.OBJECT_TYPE;
709
- };
710
- interface ObjectTypeInner extends Omit<OntologyIrObjectType, "titlePropertyTypeRid" | "propertyTypes" | "allImplementsInterfaces" | "implementsInterfaces2" | "displayMetadata" | "primaryKeys" | "status"> {
711
- primaryKeyPropertyApiName: string;
712
- properties: Array<ObjectPropertyType>;
713
- titlePropertyApiName: string;
714
- implementsInterfaces: Array<InterfaceImplementation>;
715
- description: string | undefined;
716
- icon: {
717
- locator: BlueprintIcon;
718
- color: string;
719
- } | undefined;
720
- displayName: string;
721
- pluralDisplayName: string;
722
- visibility: Visibility;
723
- editsEnabled: boolean;
724
- status?: ObjectTypeStatus;
725
- aliases?: Array<string>;
726
- }
727
-
728
765
  declare function defineOntology(ns: string, body: () => void | Promise<void>, outputDir: string | undefined, dependencyFile?: string, codeSnippetFiles?: boolean, snippetPackageName?: string, snippetFileOutputDir?: string, randomnessKey?: string): Promise<OntologyIr>;
766
+ declare function cleanAndValidateLinkTypeId(apiName: string): string;
729
767
  declare function dumpOntologyFullMetadata(): OntologyIr;
768
+ declare function convertObjectStatus(status: any): any;
769
+ declare function extractNamespace(apiName: string): string;
770
+ declare function withoutNamespace(apiName: string): string;
730
771
  declare function addNamespaceIfNone(apiName: string): string;
772
+ declare function initializeOntologyState(ns: string): void;
773
+ declare function getOntologyDefinition(): OntologyDefinition;
774
+ declare function getImportedTypes(): OntologyDefinition;
775
+ declare function getNamespace(): string;
731
776
 
732
777
  interface SharedPropertyTypeDefinition {
733
778
  apiName: string;
734
779
  type: PropertyTypeType;
735
780
  array?: boolean;
781
+ reducers?: Array<ReducerType>;
736
782
  description?: string;
737
783
  displayName?: string;
738
784
  valueType?: OntologyIrValueTypeReferenceWithMetadata;
@@ -743,7 +789,7 @@ interface SharedPropertyTypeDefinition {
743
789
  gothamMapping?: SharedPropertyTypeGothamMapping;
744
790
  baseFormatter?: OntologyIrBaseFormatter;
745
791
  }
746
- declare function defineSharedPropertyType(sptDef: SharedPropertyTypeDefinition): SharedPropertyType;
792
+ declare function defineSharedPropertyType(sptDefInput: SharedPropertyTypeDefinition): SharedPropertyType;
747
793
 
748
794
  type ValueTypeType = ValueTypeType_array | ValueTypeType_boolean | ValueTypeType_binary | ValueTypeType_byte | ValueTypeType_date | ValueTypeType_decimal | ValueTypeType_double | ValueTypeType_float | ValueTypeType_integer | ValueTypeType_long | ValueTypeType_map | ValueTypeType_optional | ValueTypeType_short | ValueTypeType_string | ValueTypeType_structV2 | ValueTypeType_timestamp;
749
795
  interface ValueTypeType_array {
@@ -945,7 +991,7 @@ type UserValueTypeStatus = "active" | {
945
991
  deadline: string;
946
992
  replacedBy?: ValueTypeRid;
947
993
  };
948
- declare function defineValueType(valueTypeDef: ValueTypeDefinition): ValueTypeDefinitionVersion;
994
+ declare function defineValueType(valueTypeDefInput: ValueTypeDefinition): ValueTypeDefinitionVersion;
949
995
 
950
996
  declare function importOntologyEntity<T extends OntologyEntityBase>(e: T): void;
951
997
 
@@ -959,6 +1005,12 @@ declare function importSharedPropertyType(opts: {
959
1005
  array?: boolean;
960
1006
  }): SharedPropertyType;
961
1007
 
1008
+ declare const defaultTypeClasses: TypeClass[];
1009
+ declare function shouldNotHaveRenderHints(type: PropertyTypeType): boolean;
1010
+ declare function hasRenderHints(typeClasses: TypeClass[] | undefined): boolean;
1011
+ declare function getPropertyTypeName(type: PropertyTypeType): string;
1012
+ declare function shouldBeIndexedForSearch(type: PropertyTypeType): boolean;
1013
+
962
1014
  /**
963
1015
  * Wraps an OntologyEntityType with a Proxy that calls importOntologyEntity when properties are accessed.
964
1016
  *
@@ -967,6 +1019,6 @@ declare function importSharedPropertyType(opts: {
967
1019
  */
968
1020
  declare function wrapWithProxy<T extends OntologyEntityBase>(entity: T): T;
969
1021
 
970
- declare function propertyTypeTypeToOntologyIrType(type: PropertyTypeType): OntologyIrType;
1022
+ declare function propertyTypeTypeToOntologyIrType(type: PropertyTypeType, apiName?: string, sharedPropertyType?: SharedPropertyType): OntologyIrType;
971
1023
 
972
- export { type ActionParameterAllowedValues, type ActionParameterConditionalOverride, type ActionParameterConfiguration, type ActionParameterValidation, type ActionSection, type ActionType, CREATE_INTERFACE_OBJECT_PARAMETER, CREATE_OR_MODIFY_OBJECT_PARAMETER, type ConditionDefinition, type CurrentTimeMappingValue, type CurrentUserMappingValue, type CustomMapping, DELETE_OBJECT_PARAMETER, type InterfaceDefinedProperty, type InterfaceType, type LinkType, MODIFY_INTERFACE_OBJECT_PARAMETER, MODIFY_OBJECT_PARAMETER, type MappingValue, type ObjectPropertyType, type ObjectType, OntologyEntityTypeEnum, type PropertyTypeType, type SectionConditionalOverride, type SharedPropertyType, type SubmissionMetadata, type UuidMappingValue, type ValueTypeDefinitionVersion, addDependency, addNamespaceIfNone, uppercaseFirstLetter as convertToDisplayName, convertToPluralDisplayName, propertyTypeTypeToOntologyIrType as convertType, main as default, defineAction, defineCreateInterfaceObjectAction, defineCreateObjectAction, defineCreateOrModifyObjectAction, defineDeleteInterfaceObjectAction, defineDeleteObjectAction, defineInterface, defineInterfaceLinkConstraint, defineLink, defineModifyInterfaceObjectAction, defineModifyObjectAction, defineObject, defineOntology, defineSharedPropertyType, defineValueType, dumpOntologyFullMetadata, importOntologyEntity, importSharedPropertyType, wrapWithProxy };
1024
+ export { type ActionParameter, type ActionParameterAllowedValues, type ActionParameterConditionalOverride, type ActionParameterConfiguration, type ActionParameterRequirementConstraint, type ActionParameterValidation, type ActionSection, type ActionType, CREATE_INTERFACE_OBJECT_PARAMETER, CREATE_OR_MODIFY_OBJECT_PARAMETER, type ConditionDefinition, type CurrentTimeMappingValue, type CurrentUserMappingValue, type CustomMapping, DELETE_OBJECT_PARAMETER, type DerivedPropertyAggregation, type InterfaceDefinedProperty, type InterfacePropertyType, type InterfaceType, type LinkType, MODIFY_INTERFACE_OBJECT_PARAMETER, MODIFY_OBJECT_PARAMETER, type MappingValue, type Nullability, type ObjectPropertyType, type ObjectType, type ObjectTypeDatasourceDefinition_dataset, type ObjectTypeDatasourceDefinition_derived, type ObjectTypeDatasourceDefinition_direct, type ObjectTypeDefinition, type OneToManyLinkTypeDefinition, type OntologyDefinition, OntologyEntityTypeEnum, type PropertyTypeType, type SectionConditionalOverride, type SecurityConditionDefinition, type SharedPropertyType, type SubmissionMetadata, type UserLinkTypeStatus, type UuidMappingValue, type ValueTypeDefinitionVersion, addDependency, addNamespaceIfNone, cleanAndValidateLinkTypeId, convertObjectStatus, uppercaseFirstLetter as convertToDisplayName, convertToPluralDisplayName, propertyTypeTypeToOntologyIrType as convertType, main as default, defaultTypeClasses, defineAction, defineCreateInterfaceObjectAction, defineCreateObjectAction, defineCreateOrModifyObjectAction, defineDeleteInterfaceObjectAction, defineDeleteObjectAction, defineInterface, defineInterfaceLinkConstraint, defineLink, defineModifyInterfaceObjectAction, defineModifyObjectAction, defineObject, defineOntology, defineSharedPropertyType, defineValueType, dumpOntologyFullMetadata, extractNamespace, getImportedTypes, getNamespace, getOntologyDefinition, getPropertyTypeName, hasRenderHints, importOntologyEntity, importSharedPropertyType, initializeOntologyState, isExotic, isInterfaceSharedPropertyType, shouldBeIndexedForSearch, shouldNotHaveRenderHints, uppercaseFirstLetter, withoutNamespace, wrapWithProxy };
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /**
18
+ * Shallow-clones a definition object, copying any array-valued properties
19
+ * to prevent shared-array mutation bugs (e.g. when users pass the same
20
+ * datasources constant to multiple defineObject calls).
21
+ *
22
+ * Does NOT deep-clone nested objects so that entity references (interfaces,
23
+ * link types, etc.) preserve their identity for registry lookups.
24
+ */
25
+ export function cloneDefinition(input) {
26
+ const clone = {
27
+ ...input
28
+ };
29
+ for (const key in clone) {
30
+ if (Object.prototype.hasOwnProperty.call(clone, key) && Array.isArray(clone[key])) {
31
+ clone[key] = [...clone[key]];
32
+ }
33
+ }
34
+ return clone;
35
+ }
36
+ //# sourceMappingURL=cloneDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloneDefinition.js","names":["cloneDefinition","input","clone","key","Object","prototype","hasOwnProperty","call","Array","isArray"],"sources":["cloneDefinition.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\n/**\n * Shallow-clones a definition object, copying any array-valued properties\n * to prevent shared-array mutation bugs (e.g. when users pass the same\n * datasources constant to multiple defineObject calls).\n *\n * Does NOT deep-clone nested objects so that entity references (interfaces,\n * link types, etc.) preserve their identity for registry lookups.\n */\nexport function cloneDefinition<T extends object>(\n input: T,\n): T {\n const clone = { ...input };\n for (const key in clone) {\n if (\n Object.prototype.hasOwnProperty.call(clone, key)\n && Array.isArray(clone[key])\n ) {\n (clone as any)[key] = [...(clone[key] as unknown[])];\n }\n }\n return clone;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAC7BC,KAAQ,EACL;EACH,MAAMC,KAAK,GAAG;IAAE,GAAGD;EAAM,CAAC;EAC1B,KAAK,MAAME,GAAG,IAAID,KAAK,EAAE;IACvB,IACEE,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,KAAK,EAAEC,GAAG,CAAC,IAC7CK,KAAK,CAACC,OAAO,CAACP,KAAK,CAACC,GAAG,CAAC,CAAC,EAC5B;MACCD,KAAK,CAASC,GAAG,CAAC,GAAG,CAAC,GAAID,KAAK,CAACC,GAAG,CAAe,CAAC;IACtD;EACF;EACA,OAAOD,KAAK;AACd","ignoreList":[]}
@@ -60,7 +60,7 @@ function generateInterfaceSnippet(interfaceType, packageName) {
60
60
  "interfaceApiName": interfaceType.apiName,
61
61
  "packageName": packageName,
62
62
  "objectOrInterfaceApiName": interfaceType.apiName,
63
- "propertyNames": Object.keys(interfaceType.propertiesV2),
63
+ "propertyNames": Object.keys(interfaceType.propertiesV3),
64
64
  "interfaceName": interfaceType.displayMetadata.displayName
65
65
  };
66
66
  return getSnippets(interfaceSnippets, interfaceContext);
@@ -1 +1 @@
1
- {"version":3,"file":"createCodeSnippets.js","names":["TYPESCRIPT_OSDK_SNIPPETS","consola","fs","Mustache","path","OntologyEntityTypeEnum","actionSnippets","interfaceSnippets","objectSnippets","snippetNameMapping","createCodeSnippets","ontology","packageName","outputDir","undefined","existsSync","mkdirSync","recursive","info","type","Object","values","object","snippet","OBJECT_TYPE","generateObjectSnippet","ACTION_TYPE","generateActionSnippet","INTERFACE_TYPE","generateInterfaceSnippet","writeFileSync","join","apiName","JSON","stringify","interfaceType","interfaceContext","keys","propertiesV2","displayMetadata","displayName","getSnippets","objectType","objectContext","actionType","actionContext","snippetType","context","allSnippets","templateName","filter","key","isNaN","Number","versions","latestTemplate","slice","reverse","find","v","snippets","at","template","renderedTemplate","render","snippetName","get"],"sources":["createCodeSnippets.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 { TYPESCRIPT_OSDK_SNIPPETS } from \"@osdk/typescript-sdk-docs\";\nimport { consola } from \"consola\";\nimport * as fs from \"fs\";\nimport Mustache from \"mustache\";\nimport * as path from \"path\";\nimport type { ActionType } from \"../action/ActionType.js\";\nimport type { OntologyDefinition } from \"../common/OntologyDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { InterfaceType } from \"../interface/InterfaceType.js\";\nimport type { ObjectType } from \"../object/ObjectType.js\";\nimport {\n actionSnippets,\n interfaceSnippets,\n objectSnippets,\n snippetNameMapping,\n} from \"./snippetTypes.js\";\n\nexport function createCodeSnippets(\n ontology: OntologyDefinition,\n packageName: string | undefined,\n outputDir: string | undefined,\n): void {\n if (outputDir === undefined) {\n outputDir = \"./code-snippets\";\n }\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, { recursive: true });\n }\n if (packageName === undefined) {\n packageName = \"\";\n }\n consola.info(\"Generating code snippets to \", outputDir);\n for (const type of Object.values(OntologyEntityTypeEnum)) {\n for (const object of Object.values(ontology[type])) {\n let snippet = {};\n switch (type) {\n case OntologyEntityTypeEnum.OBJECT_TYPE:\n snippet = generateObjectSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.ACTION_TYPE:\n snippet = generateActionSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.INTERFACE_TYPE:\n snippet = generateInterfaceSnippet(object, packageName);\n break;\n default:\n continue;\n }\n fs.writeFileSync(\n path.join(outputDir, object.apiName),\n JSON.stringify(snippet),\n );\n }\n }\n consola.info(\"Finished Code Snippet Generation\");\n}\n\nfunction generateInterfaceSnippet(\n interfaceType: InterfaceType,\n packageName: string,\n) {\n const interfaceContext = {\n \"interfaceApiName\": interfaceType.apiName,\n \"packageName\": packageName,\n \"objectOrInterfaceApiName\": interfaceType.apiName,\n \"propertyNames\": Object.keys(interfaceType.propertiesV2),\n \"interfaceName\": interfaceType.displayMetadata.displayName,\n };\n\n return getSnippets(interfaceSnippets, interfaceContext);\n}\n\nfunction generateObjectSnippet(objectType: ObjectType, packageName: string) {\n const objectContext = {\n \"objectType\": objectType.apiName,\n \"packageName\": packageName,\n \"objectOrInterfaceApiName\": objectType.apiName,\n };\n return getSnippets(objectSnippets, objectContext);\n}\n\nfunction generateActionSnippet(actionType: ActionType, packageName: string) {\n const actionContext = {\n \"actionApiName\": actionType.apiName,\n \"packageName\": packageName,\n };\n return getSnippets(actionSnippets, actionContext);\n}\n\nfunction getSnippets(\n snippetType:\n | typeof interfaceSnippets\n | typeof actionSnippets\n | typeof objectSnippets,\n context: {},\n) {\n const allSnippets = {};\n for (\n const templateName of Object.keys(snippetType).filter(key =>\n isNaN(Number(key))\n )\n ) {\n const versions = Object.values(TYPESCRIPT_OSDK_SNIPPETS.versions);\n const latestTemplate = versions\n .slice()\n .reverse()\n .find(v => v.snippets[templateName])\n ?.snippets[templateName]\n .at(-1)?.template ?? \"\";\n const renderedTemplate = Mustache.render(latestTemplate, context);\n const snippetName = snippetNameMapping.get(templateName);\n\n (allSnippets as any)[\n snippetName !== undefined\n ? Mustache.render(snippetName, context)\n : templateName\n ] = renderedTemplate;\n }\n return allSnippets;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,wBAAwB,QAAQ,2BAA2B;AACpE,SAASC,OAAO,QAAQ,SAAS;AACjC,OAAO,KAAKC,EAAE,MAAM,IAAI;AACxB,OAAOC,QAAQ,MAAM,UAAU;AAC/B,OAAO,KAAKC,IAAI,MAAM,MAAM;AAG5B,SAASC,sBAAsB,QAAQ,qCAAqC;AAG5E,SACEC,cAAc,EACdC,iBAAiB,EACjBC,cAAc,EACdC,kBAAkB,QACb,mBAAmB;AAE1B,OAAO,SAASC,kBAAkBA,CAChCC,QAA4B,EAC5BC,WAA+B,EAC/BC,SAA6B,EACvB;EACN,IAAIA,SAAS,KAAKC,SAAS,EAAE;IAC3BD,SAAS,GAAG,iBAAiB;EAC/B;EACA,IAAI,CAACX,EAAE,CAACa,UAAU,CAACF,SAAS,CAAC,EAAE;IAC7BX,EAAE,CAACc,SAAS,CAACH,SAAS,EAAE;MAAEI,SAAS,EAAE;IAAK,CAAC,CAAC;EAC9C;EACA,IAAIL,WAAW,KAAKE,SAAS,EAAE;IAC7BF,WAAW,GAAG,EAAE;EAClB;EACAX,OAAO,CAACiB,IAAI,CAAC,8BAA8B,E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,YAAY,CACjB,GAAGc,gBAAgB;EACtB;EACA,OAAOf,WAAW;AACpB","ignoreList":[]}
1
+ {"version":3,"file":"createCodeSnippets.js","names":["TYPESCRIPT_OSDK_SNIPPETS","consola","fs","Mustache","path","OntologyEntityTypeEnum","actionSnippets","interfaceSnippets","objectSnippets","snippetNameMapping","createCodeSnippets","ontology","packageName","outputDir","undefined","existsSync","mkdirSync","recursive","info","type","Object","values","object","snippet","OBJECT_TYPE","generateObjectSnippet","ACTION_TYPE","generateActionSnippet","INTERFACE_TYPE","generateInterfaceSnippet","writeFileSync","join","apiName","JSON","stringify","interfaceType","interfaceContext","keys","propertiesV3","displayMetadata","displayName","getSnippets","objectType","objectContext","actionType","actionContext","snippetType","context","allSnippets","templateName","filter","key","isNaN","Number","versions","latestTemplate","slice","reverse","find","v","snippets","at","template","renderedTemplate","render","snippetName","get"],"sources":["createCodeSnippets.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 { TYPESCRIPT_OSDK_SNIPPETS } from \"@osdk/typescript-sdk-docs\";\nimport { consola } from \"consola\";\nimport * as fs from \"fs\";\nimport Mustache from \"mustache\";\nimport * as path from \"path\";\nimport type { ActionType } from \"../action/ActionType.js\";\nimport type { OntologyDefinition } from \"../common/OntologyDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { InterfaceType } from \"../interface/InterfaceType.js\";\nimport type { ObjectType } from \"../object/ObjectType.js\";\nimport {\n actionSnippets,\n interfaceSnippets,\n objectSnippets,\n snippetNameMapping,\n} from \"./snippetTypes.js\";\n\nexport function createCodeSnippets(\n ontology: OntologyDefinition,\n packageName: string | undefined,\n outputDir: string | undefined,\n): void {\n if (outputDir === undefined) {\n outputDir = \"./code-snippets\";\n }\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, { recursive: true });\n }\n if (packageName === undefined) {\n packageName = \"\";\n }\n consola.info(\"Generating code snippets to \", outputDir);\n for (const type of Object.values(OntologyEntityTypeEnum)) {\n for (const object of Object.values(ontology[type])) {\n let snippet = {};\n switch (type) {\n case OntologyEntityTypeEnum.OBJECT_TYPE:\n snippet = generateObjectSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.ACTION_TYPE:\n snippet = generateActionSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.INTERFACE_TYPE:\n snippet = generateInterfaceSnippet(object, packageName);\n break;\n default:\n continue;\n }\n fs.writeFileSync(\n path.join(outputDir, object.apiName),\n JSON.stringify(snippet),\n );\n }\n }\n consola.info(\"Finished Code Snippet Generation\");\n}\n\nfunction generateInterfaceSnippet(\n interfaceType: InterfaceType,\n packageName: string,\n) {\n const interfaceContext = {\n \"interfaceApiName\": interfaceType.apiName,\n \"packageName\": packageName,\n \"objectOrInterfaceApiName\": interfaceType.apiName,\n \"propertyNames\": Object.keys(interfaceType.propertiesV3),\n \"interfaceName\": interfaceType.displayMetadata.displayName,\n };\n\n return getSnippets(interfaceSnippets, interfaceContext);\n}\n\nfunction generateObjectSnippet(objectType: ObjectType, packageName: string) {\n const objectContext = {\n \"objectType\": objectType.apiName,\n \"packageName\": packageName,\n \"objectOrInterfaceApiName\": objectType.apiName,\n };\n return getSnippets(objectSnippets, objectContext);\n}\n\nfunction generateActionSnippet(actionType: ActionType, packageName: string) {\n const actionContext = {\n \"actionApiName\": actionType.apiName,\n \"packageName\": packageName,\n };\n return getSnippets(actionSnippets, actionContext);\n}\n\nfunction getSnippets(\n snippetType:\n | typeof interfaceSnippets\n | typeof actionSnippets\n | typeof objectSnippets,\n context: {},\n) {\n const allSnippets = {};\n for (\n const templateName of Object.keys(snippetType).filter(key =>\n isNaN(Number(key))\n )\n ) {\n const versions = Object.values(TYPESCRIPT_OSDK_SNIPPETS.versions);\n const latestTemplate = versions\n .slice()\n .reverse()\n .find(v => v.snippets[templateName])\n ?.snippets[templateName]\n .at(-1)?.template ?? \"\";\n const renderedTemplate = Mustache.render(latestTemplate, context);\n const snippetName = snippetNameMapping.get(templateName);\n\n (allSnippets as any)[\n snippetName !== undefined\n ? Mustache.render(snippetName, context)\n : templateName\n ] = renderedTemplate;\n }\n return allSnippets;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,wBAAwB,QAAQ,2BAA2B;AACpE,SAASC,OAAO,QAAQ,SAAS;AACjC,OAAO,KAAKC,EAAE,MAAM,IAAI;AACxB,OAAOC,QAAQ,MAAM,UAAU;AAC/B,OAAO,KAAKC,IAAI,MAAM,MAAM;AAG5B,SAASC,sBAAsB,QAAQ,qCAAqC;AAG5E,SACEC,cAAc,EACdC,iBAAiB,EACjBC,cAAc,EACdC,kBAAkB,QACb,mBAAmB;AAE1B,OAAO,SAASC,kBAAkBA,CAChCC,QAA4B,EAC5BC,WAA+B,EAC/BC,SAA6B,EACvB;EACN,IAAIA,SAAS,KAAKC,SAAS,EAAE;IAC3BD,SAAS,GAAG,iBAAiB;EAC/B;EACA,IAAI,CAACX,EAAE,CAACa,UAAU,CAACF,SAAS,CAAC,EAAE;IAC7BX,EAAE,CAACc,SAAS,CAACH,SAAS,EAAE;MAAEI,SAAS,EAAE;IAAK,CAAC,CAAC;EAC9C;EACA,IAAIL,WAAW,KAAKE,SAAS,EAAE;IAC7BF,WAAW,GAAG,EAAE;EAClB;EACAX,OAAO,CAACiB,IAAI,CAAC,8BAA8B,EAAEL,SAAS,CAAC;EACvD,KAAK,MAAMM,IAAI,IAAIC,MAAM,CAACC,MAAM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