@osdk/faux 0.1.0-beta.1

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 (401) hide show
  1. package/CHANGELOG.md +1047 -0
  2. package/build/browser/BaseError.js +21 -0
  3. package/build/browser/BaseError.js.map +1 -0
  4. package/build/browser/FauxFoundry/BaseOsdkObjectType.js +2 -0
  5. package/build/browser/FauxFoundry/BaseOsdkObjectType.js.map +1 -0
  6. package/build/browser/FauxFoundry/BaseServerObject.js +30 -0
  7. package/build/browser/FauxFoundry/BaseServerObject.js.map +1 -0
  8. package/build/browser/FauxFoundry/FauxActionImpl.js +2 -0
  9. package/build/browser/FauxFoundry/FauxActionImpl.js.map +1 -0
  10. package/build/browser/FauxFoundry/FauxAttachmentStore.js +60 -0
  11. package/build/browser/FauxFoundry/FauxAttachmentStore.js.map +1 -0
  12. package/build/browser/FauxFoundry/FauxDataStore.js +470 -0
  13. package/build/browser/FauxFoundry/FauxDataStore.js.map +1 -0
  14. package/build/browser/FauxFoundry/FauxDataStore.test.js +190 -0
  15. package/build/browser/FauxFoundry/FauxDataStore.test.js.map +1 -0
  16. package/build/browser/FauxFoundry/FauxDataStoreBatch.js +125 -0
  17. package/build/browser/FauxFoundry/FauxDataStoreBatch.js.map +1 -0
  18. package/build/browser/FauxFoundry/FauxFoundry.js +87 -0
  19. package/build/browser/FauxFoundry/FauxFoundry.js.map +1 -0
  20. package/build/browser/FauxFoundry/FauxOntology.js +228 -0
  21. package/build/browser/FauxFoundry/FauxOntology.js.map +1 -0
  22. package/build/browser/FauxFoundry/FauxQueryImpl.js +2 -0
  23. package/build/browser/FauxFoundry/FauxQueryImpl.js.map +1 -0
  24. package/build/browser/FauxFoundry/ObjectLocator.js +29 -0
  25. package/build/browser/FauxFoundry/ObjectLocator.js.map +1 -0
  26. package/build/browser/FauxFoundry/filterObjects.js +122 -0
  27. package/build/browser/FauxFoundry/filterObjects.js.map +1 -0
  28. package/build/browser/FauxFoundry/filterTimeSeriesData.js +70 -0
  29. package/build/browser/FauxFoundry/filterTimeSeriesData.js.map +1 -0
  30. package/build/browser/FauxFoundry/filterTimeSeriesData.test.js +116 -0
  31. package/build/browser/FauxFoundry/filterTimeSeriesData.test.js.map +1 -0
  32. package/build/browser/FauxFoundry/getObjectsFromSet.js +217 -0
  33. package/build/browser/FauxFoundry/getObjectsFromSet.js.map +1 -0
  34. package/build/browser/FauxFoundry/typeHelpers/ActionTypeBuilder.js +64 -0
  35. package/build/browser/FauxFoundry/typeHelpers/ActionTypeBuilder.js.map +1 -0
  36. package/build/browser/FauxFoundry/typeHelpers/JustProps.js +2 -0
  37. package/build/browser/FauxFoundry/typeHelpers/JustProps.js.map +1 -0
  38. package/build/browser/FauxFoundry/typeHelpers/TH_ActionDefinition.js +2 -0
  39. package/build/browser/FauxFoundry/typeHelpers/TH_ActionDefinition.js.map +1 -0
  40. package/build/browser/FauxFoundry/typeHelpers/TH_ActionParameterV2.js +25 -0
  41. package/build/browser/FauxFoundry/typeHelpers/TH_ActionParameterV2.js.map +1 -0
  42. package/build/browser/FauxFoundry/typeHelpers/TH_ActionTypeV2.js +35 -0
  43. package/build/browser/FauxFoundry/typeHelpers/TH_ActionTypeV2.js.map +1 -0
  44. package/build/browser/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.js +2 -0
  45. package/build/browser/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.js.map +1 -0
  46. package/build/browser/FauxFoundry/typeHelpers/TH_ObjectTypeFullMetadata.js +2 -0
  47. package/build/browser/FauxFoundry/typeHelpers/TH_ObjectTypeFullMetadata.js.map +1 -0
  48. package/build/browser/FauxFoundry/typeHelpers/ToObjectTypeDefinition.js +2 -0
  49. package/build/browser/FauxFoundry/typeHelpers/ToObjectTypeDefinition.js.map +1 -0
  50. package/build/browser/FauxFoundry/typeHelpers/index.js +20 -0
  51. package/build/browser/FauxFoundry/typeHelpers/index.js.map +1 -0
  52. package/build/browser/FauxFoundry/validateAction.js +245 -0
  53. package/build/browser/FauxFoundry/validateAction.js.map +1 -0
  54. package/build/browser/defaultOntologyForConjure.js +25 -0
  55. package/build/browser/defaultOntologyForConjure.js.map +1 -0
  56. package/build/browser/defaultOntologyMetadata.js +23 -0
  57. package/build/browser/defaultOntologyMetadata.js.map +1 -0
  58. package/build/browser/errors.js +134 -0
  59. package/build/browser/errors.js.map +1 -0
  60. package/build/browser/filterObjects.js +86 -0
  61. package/build/browser/filterObjects.js.map +1 -0
  62. package/build/browser/handlers/authHandlerMiddleware.js +41 -0
  63. package/build/browser/handlers/authHandlerMiddleware.js.map +1 -0
  64. package/build/browser/handlers/createActionHandlers.js +49 -0
  65. package/build/browser/handlers/createActionHandlers.js.map +1 -0
  66. package/build/browser/handlers/createAttachmentHandlers.js +88 -0
  67. package/build/browser/handlers/createAttachmentHandlers.js.map +1 -0
  68. package/build/browser/handlers/createFauxFoundryHandlers.js +29 -0
  69. package/build/browser/handlers/createFauxFoundryHandlers.js.map +1 -0
  70. package/build/browser/handlers/createLoadObjectsHandlers.js +91 -0
  71. package/build/browser/handlers/createLoadObjectsHandlers.js.map +1 -0
  72. package/build/browser/handlers/createMediaRefHandlers.js +70 -0
  73. package/build/browser/handlers/createMediaRefHandlers.js.map +1 -0
  74. package/build/browser/handlers/createMultipassServerHandlers.js +67 -0
  75. package/build/browser/handlers/createMultipassServerHandlers.js.map +1 -0
  76. package/build/browser/handlers/createObjectSetHandlers.js +50 -0
  77. package/build/browser/handlers/createObjectSetHandlers.js.map +1 -0
  78. package/build/browser/handlers/createOntologyHandlers.js +122 -0
  79. package/build/browser/handlers/createOntologyHandlers.js.map +1 -0
  80. package/build/browser/handlers/createQueryHandlers.js +38 -0
  81. package/build/browser/handlers/createQueryHandlers.js.map +1 -0
  82. package/build/browser/handlers/createTimeseriesAndGeotimeHandlers.js +95 -0
  83. package/build/browser/handlers/createTimeseriesAndGeotimeHandlers.js.map +1 -0
  84. package/build/browser/handlers/util/getPaginationParams.js +33 -0
  85. package/build/browser/handlers/util/getPaginationParams.js.map +1 -0
  86. package/build/browser/handlers/util/handleOpenApiCall.js +85 -0
  87. package/build/browser/handlers/util/handleOpenApiCall.js.map +1 -0
  88. package/build/browser/handlers/util/loadAll.js +24 -0
  89. package/build/browser/handlers/util/loadAll.js.map +1 -0
  90. package/build/browser/handlers/util/pageThroughResponseSearchParams.js +39 -0
  91. package/build/browser/handlers/util/pageThroughResponseSearchParams.js.map +1 -0
  92. package/build/browser/handlers/util/requireParam.js +29 -0
  93. package/build/browser/handlers/util/requireParam.js.map +1 -0
  94. package/build/browser/handlers/util/requireSearchParams.js +29 -0
  95. package/build/browser/handlers/util/requireSearchParams.js.map +1 -0
  96. package/build/browser/index.js +29 -0
  97. package/build/browser/index.js.map +1 -0
  98. package/build/browser/mock/OntologiesV2/ActionTypesV2.js +21 -0
  99. package/build/browser/mock/OntologiesV2/ActionTypesV2.js.map +1 -0
  100. package/build/browser/mock/OntologiesV2/Actions.js +21 -0
  101. package/build/browser/mock/OntologiesV2/Actions.js.map +1 -0
  102. package/build/browser/mock/OntologiesV2/AttachmentPropertiesV2.js +21 -0
  103. package/build/browser/mock/OntologiesV2/AttachmentPropertiesV2.js.map +1 -0
  104. package/build/browser/mock/OntologiesV2/Attachments.js +22 -0
  105. package/build/browser/mock/OntologiesV2/Attachments.js.map +1 -0
  106. package/build/browser/mock/OntologiesV2/LinkedObjectsV2.js +21 -0
  107. package/build/browser/mock/OntologiesV2/LinkedObjectsV2.js.map +1 -0
  108. package/build/browser/mock/OntologiesV2/MediaReferenceProperties.js +22 -0
  109. package/build/browser/mock/OntologiesV2/MediaReferenceProperties.js.map +1 -0
  110. package/build/browser/mock/OntologiesV2/ObjectTypesV2.js +24 -0
  111. package/build/browser/mock/OntologiesV2/ObjectTypesV2.js.map +1 -0
  112. package/build/browser/mock/OntologiesV2/OntologiesV2.js +27 -0
  113. package/build/browser/mock/OntologiesV2/OntologiesV2.js.map +1 -0
  114. package/build/browser/mock/OntologiesV2/OntologyInterfaces.js +21 -0
  115. package/build/browser/mock/OntologiesV2/OntologyInterfaces.js.map +1 -0
  116. package/build/browser/mock/OntologiesV2/OntologyObjectSets.js +22 -0
  117. package/build/browser/mock/OntologiesV2/OntologyObjectSets.js.map +1 -0
  118. package/build/browser/mock/OntologiesV2/OntologyObjectsV2.js +21 -0
  119. package/build/browser/mock/OntologiesV2/OntologyObjectsV2.js.map +1 -0
  120. package/build/browser/mock/OntologiesV2/Queries.js +20 -0
  121. package/build/browser/mock/OntologiesV2/Queries.js.map +1 -0
  122. package/build/browser/mock/OntologiesV2/QueryTypes.js +21 -0
  123. package/build/browser/mock/OntologiesV2/QueryTypes.js.map +1 -0
  124. package/build/browser/mock/OntologiesV2/TimeSeriesPropertiesV2.js +22 -0
  125. package/build/browser/mock/OntologiesV2/TimeSeriesPropertiesV2.js.map +1 -0
  126. package/build/browser/mock/OntologiesV2/TimeSeriesValueBankProperties.js +21 -0
  127. package/build/browser/mock/OntologiesV2/TimeSeriesValueBankProperties.js.map +1 -0
  128. package/build/browser/mock/OntologiesV2/index.js +32 -0
  129. package/build/browser/mock/OntologiesV2/index.js.map +1 -0
  130. package/build/browser/mock/index.js +18 -0
  131. package/build/browser/mock/index.js.map +1 -0
  132. package/build/browser/withoutRid.js +24 -0
  133. package/build/browser/withoutRid.js.map +1 -0
  134. package/build/cjs/index.cjs +2983 -0
  135. package/build/cjs/index.cjs.map +1 -0
  136. package/build/cjs/index.d.cts +562 -0
  137. package/build/esm/BaseError.js +21 -0
  138. package/build/esm/BaseError.js.map +1 -0
  139. package/build/esm/FauxFoundry/BaseOsdkObjectType.js +2 -0
  140. package/build/esm/FauxFoundry/BaseOsdkObjectType.js.map +1 -0
  141. package/build/esm/FauxFoundry/BaseServerObject.js +30 -0
  142. package/build/esm/FauxFoundry/BaseServerObject.js.map +1 -0
  143. package/build/esm/FauxFoundry/FauxActionImpl.js +2 -0
  144. package/build/esm/FauxFoundry/FauxActionImpl.js.map +1 -0
  145. package/build/esm/FauxFoundry/FauxAttachmentStore.js +60 -0
  146. package/build/esm/FauxFoundry/FauxAttachmentStore.js.map +1 -0
  147. package/build/esm/FauxFoundry/FauxDataStore.js +470 -0
  148. package/build/esm/FauxFoundry/FauxDataStore.js.map +1 -0
  149. package/build/esm/FauxFoundry/FauxDataStore.test.js +190 -0
  150. package/build/esm/FauxFoundry/FauxDataStore.test.js.map +1 -0
  151. package/build/esm/FauxFoundry/FauxDataStoreBatch.js +125 -0
  152. package/build/esm/FauxFoundry/FauxDataStoreBatch.js.map +1 -0
  153. package/build/esm/FauxFoundry/FauxFoundry.js +87 -0
  154. package/build/esm/FauxFoundry/FauxFoundry.js.map +1 -0
  155. package/build/esm/FauxFoundry/FauxOntology.js +228 -0
  156. package/build/esm/FauxFoundry/FauxOntology.js.map +1 -0
  157. package/build/esm/FauxFoundry/FauxQueryImpl.js +2 -0
  158. package/build/esm/FauxFoundry/FauxQueryImpl.js.map +1 -0
  159. package/build/esm/FauxFoundry/ObjectLocator.js +29 -0
  160. package/build/esm/FauxFoundry/ObjectLocator.js.map +1 -0
  161. package/build/esm/FauxFoundry/filterObjects.js +122 -0
  162. package/build/esm/FauxFoundry/filterObjects.js.map +1 -0
  163. package/build/esm/FauxFoundry/filterTimeSeriesData.js +70 -0
  164. package/build/esm/FauxFoundry/filterTimeSeriesData.js.map +1 -0
  165. package/build/esm/FauxFoundry/filterTimeSeriesData.test.js +116 -0
  166. package/build/esm/FauxFoundry/filterTimeSeriesData.test.js.map +1 -0
  167. package/build/esm/FauxFoundry/getObjectsFromSet.js +217 -0
  168. package/build/esm/FauxFoundry/getObjectsFromSet.js.map +1 -0
  169. package/build/esm/FauxFoundry/typeHelpers/ActionTypeBuilder.js +64 -0
  170. package/build/esm/FauxFoundry/typeHelpers/ActionTypeBuilder.js.map +1 -0
  171. package/build/esm/FauxFoundry/typeHelpers/JustProps.js +2 -0
  172. package/build/esm/FauxFoundry/typeHelpers/JustProps.js.map +1 -0
  173. package/build/esm/FauxFoundry/typeHelpers/TH_ActionDefinition.js +2 -0
  174. package/build/esm/FauxFoundry/typeHelpers/TH_ActionDefinition.js.map +1 -0
  175. package/build/esm/FauxFoundry/typeHelpers/TH_ActionParameterV2.js +25 -0
  176. package/build/esm/FauxFoundry/typeHelpers/TH_ActionParameterV2.js.map +1 -0
  177. package/build/esm/FauxFoundry/typeHelpers/TH_ActionTypeV2.js +35 -0
  178. package/build/esm/FauxFoundry/typeHelpers/TH_ActionTypeV2.js.map +1 -0
  179. package/build/esm/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.js +2 -0
  180. package/build/esm/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.js.map +1 -0
  181. package/build/esm/FauxFoundry/typeHelpers/TH_ObjectTypeFullMetadata.js +2 -0
  182. package/build/esm/FauxFoundry/typeHelpers/TH_ObjectTypeFullMetadata.js.map +1 -0
  183. package/build/esm/FauxFoundry/typeHelpers/ToObjectTypeDefinition.js +2 -0
  184. package/build/esm/FauxFoundry/typeHelpers/ToObjectTypeDefinition.js.map +1 -0
  185. package/build/esm/FauxFoundry/typeHelpers/index.js +20 -0
  186. package/build/esm/FauxFoundry/typeHelpers/index.js.map +1 -0
  187. package/build/esm/FauxFoundry/validateAction.js +245 -0
  188. package/build/esm/FauxFoundry/validateAction.js.map +1 -0
  189. package/build/esm/defaultOntologyForConjure.js +25 -0
  190. package/build/esm/defaultOntologyForConjure.js.map +1 -0
  191. package/build/esm/defaultOntologyMetadata.js +23 -0
  192. package/build/esm/defaultOntologyMetadata.js.map +1 -0
  193. package/build/esm/errors.js +134 -0
  194. package/build/esm/errors.js.map +1 -0
  195. package/build/esm/filterObjects.js +86 -0
  196. package/build/esm/filterObjects.js.map +1 -0
  197. package/build/esm/handlers/authHandlerMiddleware.js +41 -0
  198. package/build/esm/handlers/authHandlerMiddleware.js.map +1 -0
  199. package/build/esm/handlers/createActionHandlers.js +49 -0
  200. package/build/esm/handlers/createActionHandlers.js.map +1 -0
  201. package/build/esm/handlers/createAttachmentHandlers.js +88 -0
  202. package/build/esm/handlers/createAttachmentHandlers.js.map +1 -0
  203. package/build/esm/handlers/createFauxFoundryHandlers.js +29 -0
  204. package/build/esm/handlers/createFauxFoundryHandlers.js.map +1 -0
  205. package/build/esm/handlers/createLoadObjectsHandlers.js +91 -0
  206. package/build/esm/handlers/createLoadObjectsHandlers.js.map +1 -0
  207. package/build/esm/handlers/createMediaRefHandlers.js +70 -0
  208. package/build/esm/handlers/createMediaRefHandlers.js.map +1 -0
  209. package/build/esm/handlers/createMultipassServerHandlers.js +67 -0
  210. package/build/esm/handlers/createMultipassServerHandlers.js.map +1 -0
  211. package/build/esm/handlers/createObjectSetHandlers.js +50 -0
  212. package/build/esm/handlers/createObjectSetHandlers.js.map +1 -0
  213. package/build/esm/handlers/createOntologyHandlers.js +122 -0
  214. package/build/esm/handlers/createOntologyHandlers.js.map +1 -0
  215. package/build/esm/handlers/createQueryHandlers.js +38 -0
  216. package/build/esm/handlers/createQueryHandlers.js.map +1 -0
  217. package/build/esm/handlers/createTimeseriesAndGeotimeHandlers.js +95 -0
  218. package/build/esm/handlers/createTimeseriesAndGeotimeHandlers.js.map +1 -0
  219. package/build/esm/handlers/util/getPaginationParams.js +33 -0
  220. package/build/esm/handlers/util/getPaginationParams.js.map +1 -0
  221. package/build/esm/handlers/util/handleOpenApiCall.js +85 -0
  222. package/build/esm/handlers/util/handleOpenApiCall.js.map +1 -0
  223. package/build/esm/handlers/util/loadAll.js +24 -0
  224. package/build/esm/handlers/util/loadAll.js.map +1 -0
  225. package/build/esm/handlers/util/pageThroughResponseSearchParams.js +39 -0
  226. package/build/esm/handlers/util/pageThroughResponseSearchParams.js.map +1 -0
  227. package/build/esm/handlers/util/requireParam.js +29 -0
  228. package/build/esm/handlers/util/requireParam.js.map +1 -0
  229. package/build/esm/handlers/util/requireSearchParams.js +29 -0
  230. package/build/esm/handlers/util/requireSearchParams.js.map +1 -0
  231. package/build/esm/index.js +29 -0
  232. package/build/esm/index.js.map +1 -0
  233. package/build/esm/mock/OntologiesV2/ActionTypesV2.js +21 -0
  234. package/build/esm/mock/OntologiesV2/ActionTypesV2.js.map +1 -0
  235. package/build/esm/mock/OntologiesV2/Actions.js +21 -0
  236. package/build/esm/mock/OntologiesV2/Actions.js.map +1 -0
  237. package/build/esm/mock/OntologiesV2/AttachmentPropertiesV2.js +21 -0
  238. package/build/esm/mock/OntologiesV2/AttachmentPropertiesV2.js.map +1 -0
  239. package/build/esm/mock/OntologiesV2/Attachments.js +22 -0
  240. package/build/esm/mock/OntologiesV2/Attachments.js.map +1 -0
  241. package/build/esm/mock/OntologiesV2/LinkedObjectsV2.js +21 -0
  242. package/build/esm/mock/OntologiesV2/LinkedObjectsV2.js.map +1 -0
  243. package/build/esm/mock/OntologiesV2/MediaReferenceProperties.js +22 -0
  244. package/build/esm/mock/OntologiesV2/MediaReferenceProperties.js.map +1 -0
  245. package/build/esm/mock/OntologiesV2/ObjectTypesV2.js +24 -0
  246. package/build/esm/mock/OntologiesV2/ObjectTypesV2.js.map +1 -0
  247. package/build/esm/mock/OntologiesV2/OntologiesV2.js +27 -0
  248. package/build/esm/mock/OntologiesV2/OntologiesV2.js.map +1 -0
  249. package/build/esm/mock/OntologiesV2/OntologyInterfaces.js +21 -0
  250. package/build/esm/mock/OntologiesV2/OntologyInterfaces.js.map +1 -0
  251. package/build/esm/mock/OntologiesV2/OntologyObjectSets.js +22 -0
  252. package/build/esm/mock/OntologiesV2/OntologyObjectSets.js.map +1 -0
  253. package/build/esm/mock/OntologiesV2/OntologyObjectsV2.js +21 -0
  254. package/build/esm/mock/OntologiesV2/OntologyObjectsV2.js.map +1 -0
  255. package/build/esm/mock/OntologiesV2/Queries.js +20 -0
  256. package/build/esm/mock/OntologiesV2/Queries.js.map +1 -0
  257. package/build/esm/mock/OntologiesV2/QueryTypes.js +21 -0
  258. package/build/esm/mock/OntologiesV2/QueryTypes.js.map +1 -0
  259. package/build/esm/mock/OntologiesV2/TimeSeriesPropertiesV2.js +22 -0
  260. package/build/esm/mock/OntologiesV2/TimeSeriesPropertiesV2.js.map +1 -0
  261. package/build/esm/mock/OntologiesV2/TimeSeriesValueBankProperties.js +21 -0
  262. package/build/esm/mock/OntologiesV2/TimeSeriesValueBankProperties.js.map +1 -0
  263. package/build/esm/mock/OntologiesV2/index.js +32 -0
  264. package/build/esm/mock/OntologiesV2/index.js.map +1 -0
  265. package/build/esm/mock/index.js +18 -0
  266. package/build/esm/mock/index.js.map +1 -0
  267. package/build/esm/withoutRid.js +24 -0
  268. package/build/esm/withoutRid.js.map +1 -0
  269. package/build/types/BaseError.d.ts +7 -0
  270. package/build/types/BaseError.d.ts.map +1 -0
  271. package/build/types/FauxFoundry/BaseOsdkObjectType.d.ts +5 -0
  272. package/build/types/FauxFoundry/BaseOsdkObjectType.d.ts.map +1 -0
  273. package/build/types/FauxFoundry/BaseServerObject.d.ts +18 -0
  274. package/build/types/FauxFoundry/BaseServerObject.d.ts.map +1 -0
  275. package/build/types/FauxFoundry/FauxActionImpl.d.ts +8 -0
  276. package/build/types/FauxFoundry/FauxActionImpl.d.ts.map +1 -0
  277. package/build/types/FauxFoundry/FauxAttachmentStore.d.ts +10 -0
  278. package/build/types/FauxFoundry/FauxAttachmentStore.d.ts.map +1 -0
  279. package/build/types/FauxFoundry/FauxDataStore.d.ts +70 -0
  280. package/build/types/FauxFoundry/FauxDataStore.d.ts.map +1 -0
  281. package/build/types/FauxFoundry/FauxDataStore.test.d.ts +1 -0
  282. package/build/types/FauxFoundry/FauxDataStore.test.d.ts.map +1 -0
  283. package/build/types/FauxFoundry/FauxDataStoreBatch.d.ts +22 -0
  284. package/build/types/FauxFoundry/FauxDataStoreBatch.d.ts.map +1 -0
  285. package/build/types/FauxFoundry/FauxFoundry.d.ts +25 -0
  286. package/build/types/FauxFoundry/FauxFoundry.d.ts.map +1 -0
  287. package/build/types/FauxFoundry/FauxOntology.d.ts +39 -0
  288. package/build/types/FauxFoundry/FauxOntology.d.ts.map +1 -0
  289. package/build/types/FauxFoundry/FauxQueryImpl.d.ts +5 -0
  290. package/build/types/FauxFoundry/FauxQueryImpl.d.ts.map +1 -0
  291. package/build/types/FauxFoundry/ObjectLocator.d.ts +11 -0
  292. package/build/types/FauxFoundry/ObjectLocator.d.ts.map +1 -0
  293. package/build/types/FauxFoundry/filterObjects.d.ts +3 -0
  294. package/build/types/FauxFoundry/filterObjects.d.ts.map +1 -0
  295. package/build/types/FauxFoundry/filterTimeSeriesData.d.ts +2 -0
  296. package/build/types/FauxFoundry/filterTimeSeriesData.d.ts.map +1 -0
  297. package/build/types/FauxFoundry/filterTimeSeriesData.test.d.ts +1 -0
  298. package/build/types/FauxFoundry/filterTimeSeriesData.test.d.ts.map +1 -0
  299. package/build/types/FauxFoundry/getObjectsFromSet.d.ts +6 -0
  300. package/build/types/FauxFoundry/getObjectsFromSet.d.ts.map +1 -0
  301. package/build/types/FauxFoundry/typeHelpers/ActionTypeBuilder.d.ts +27 -0
  302. package/build/types/FauxFoundry/typeHelpers/ActionTypeBuilder.d.ts.map +1 -0
  303. package/build/types/FauxFoundry/typeHelpers/JustProps.d.ts +4 -0
  304. package/build/types/FauxFoundry/typeHelpers/JustProps.d.ts.map +1 -0
  305. package/build/types/FauxFoundry/typeHelpers/TH_ActionDefinition.d.ts +43 -0
  306. package/build/types/FauxFoundry/typeHelpers/TH_ActionDefinition.d.ts.map +1 -0
  307. package/build/types/FauxFoundry/typeHelpers/TH_ActionParameterV2.d.ts +15 -0
  308. package/build/types/FauxFoundry/typeHelpers/TH_ActionParameterV2.d.ts.map +1 -0
  309. package/build/types/FauxFoundry/typeHelpers/TH_ActionTypeV2.d.ts +8 -0
  310. package/build/types/FauxFoundry/typeHelpers/TH_ActionTypeV2.d.ts.map +1 -0
  311. package/build/types/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.d.ts +24 -0
  312. package/build/types/FauxFoundry/typeHelpers/TH_ApplyActionRequestV2.d.ts.map +1 -0
  313. package/build/types/FauxFoundry/typeHelpers/TH_ObjectTypeFullMetadata.d.ts +18 -0
  314. package/build/types/FauxFoundry/typeHelpers/TH_ObjectTypeFullMetadata.d.ts.map +1 -0
  315. package/build/types/FauxFoundry/typeHelpers/ToObjectTypeDefinition.d.ts +12 -0
  316. package/build/types/FauxFoundry/typeHelpers/ToObjectTypeDefinition.d.ts.map +1 -0
  317. package/build/types/FauxFoundry/typeHelpers/index.d.ts +10 -0
  318. package/build/types/FauxFoundry/typeHelpers/index.d.ts.map +1 -0
  319. package/build/types/FauxFoundry/validateAction.d.ts +9 -0
  320. package/build/types/FauxFoundry/validateAction.d.ts.map +1 -0
  321. package/build/types/defaultOntologyForConjure.d.ts +7 -0
  322. package/build/types/defaultOntologyForConjure.d.ts.map +1 -0
  323. package/build/types/defaultOntologyMetadata.d.ts +2 -0
  324. package/build/types/defaultOntologyMetadata.d.ts.map +1 -0
  325. package/build/types/errors.d.ts +14 -0
  326. package/build/types/errors.d.ts.map +1 -0
  327. package/build/types/filterObjects.d.ts +8 -0
  328. package/build/types/filterObjects.d.ts.map +1 -0
  329. package/build/types/handlers/authHandlerMiddleware.d.ts +5 -0
  330. package/build/types/handlers/authHandlerMiddleware.d.ts.map +1 -0
  331. package/build/types/handlers/createActionHandlers.d.ts +3 -0
  332. package/build/types/handlers/createActionHandlers.d.ts.map +1 -0
  333. package/build/types/handlers/createAttachmentHandlers.d.ts +2 -0
  334. package/build/types/handlers/createAttachmentHandlers.d.ts.map +1 -0
  335. package/build/types/handlers/createFauxFoundryHandlers.d.ts +4 -0
  336. package/build/types/handlers/createFauxFoundryHandlers.d.ts.map +1 -0
  337. package/build/types/handlers/createLoadObjectsHandlers.d.ts +2 -0
  338. package/build/types/handlers/createLoadObjectsHandlers.d.ts.map +1 -0
  339. package/build/types/handlers/createMediaRefHandlers.d.ts +2 -0
  340. package/build/types/handlers/createMediaRefHandlers.d.ts.map +1 -0
  341. package/build/types/handlers/createMultipassServerHandlers.d.ts +2 -0
  342. package/build/types/handlers/createMultipassServerHandlers.d.ts.map +1 -0
  343. package/build/types/handlers/createObjectSetHandlers.d.ts +3 -0
  344. package/build/types/handlers/createObjectSetHandlers.d.ts.map +1 -0
  345. package/build/types/handlers/createOntologyHandlers.d.ts +4 -0
  346. package/build/types/handlers/createOntologyHandlers.d.ts.map +1 -0
  347. package/build/types/handlers/createQueryHandlers.d.ts +2 -0
  348. package/build/types/handlers/createQueryHandlers.d.ts.map +1 -0
  349. package/build/types/handlers/createTimeseriesAndGeotimeHandlers.d.ts +2 -0
  350. package/build/types/handlers/createTimeseriesAndGeotimeHandlers.d.ts.map +1 -0
  351. package/build/types/handlers/util/getPaginationParams.d.ts +11 -0
  352. package/build/types/handlers/util/getPaginationParams.d.ts.map +1 -0
  353. package/build/types/handlers/util/handleOpenApiCall.d.ts +49 -0
  354. package/build/types/handlers/util/handleOpenApiCall.d.ts.map +1 -0
  355. package/build/types/handlers/util/loadAll.d.ts +1 -0
  356. package/build/types/handlers/util/loadAll.d.ts.map +1 -0
  357. package/build/types/handlers/util/pageThroughResponseSearchParams.d.ts +20 -0
  358. package/build/types/handlers/util/pageThroughResponseSearchParams.d.ts.map +1 -0
  359. package/build/types/handlers/util/requireParam.d.ts +8 -0
  360. package/build/types/handlers/util/requireParam.d.ts.map +1 -0
  361. package/build/types/handlers/util/requireSearchParams.d.ts +2 -0
  362. package/build/types/handlers/util/requireSearchParams.d.ts.map +1 -0
  363. package/build/types/index.d.ts +14 -0
  364. package/build/types/index.d.ts.map +1 -0
  365. package/build/types/mock/OntologiesV2/ActionTypesV2.d.ts +4 -0
  366. package/build/types/mock/OntologiesV2/ActionTypesV2.d.ts.map +1 -0
  367. package/build/types/mock/OntologiesV2/Actions.d.ts +4 -0
  368. package/build/types/mock/OntologiesV2/Actions.d.ts.map +1 -0
  369. package/build/types/mock/OntologiesV2/AttachmentPropertiesV2.d.ts +4 -0
  370. package/build/types/mock/OntologiesV2/AttachmentPropertiesV2.d.ts.map +1 -0
  371. package/build/types/mock/OntologiesV2/Attachments.d.ts +5 -0
  372. package/build/types/mock/OntologiesV2/Attachments.d.ts.map +1 -0
  373. package/build/types/mock/OntologiesV2/LinkedObjectsV2.d.ts +4 -0
  374. package/build/types/mock/OntologiesV2/LinkedObjectsV2.d.ts.map +1 -0
  375. package/build/types/mock/OntologiesV2/MediaReferenceProperties.d.ts +5 -0
  376. package/build/types/mock/OntologiesV2/MediaReferenceProperties.d.ts.map +1 -0
  377. package/build/types/mock/OntologiesV2/ObjectTypesV2.d.ts +7 -0
  378. package/build/types/mock/OntologiesV2/ObjectTypesV2.d.ts.map +1 -0
  379. package/build/types/mock/OntologiesV2/OntologiesV2.d.ts +9 -0
  380. package/build/types/mock/OntologiesV2/OntologiesV2.d.ts.map +1 -0
  381. package/build/types/mock/OntologiesV2/OntologyInterfaces.d.ts +4 -0
  382. package/build/types/mock/OntologiesV2/OntologyInterfaces.d.ts.map +1 -0
  383. package/build/types/mock/OntologiesV2/OntologyObjectSets.d.ts +5 -0
  384. package/build/types/mock/OntologiesV2/OntologyObjectSets.d.ts.map +1 -0
  385. package/build/types/mock/OntologiesV2/OntologyObjectsV2.d.ts +4 -0
  386. package/build/types/mock/OntologiesV2/OntologyObjectsV2.d.ts.map +1 -0
  387. package/build/types/mock/OntologiesV2/Queries.d.ts +3 -0
  388. package/build/types/mock/OntologiesV2/Queries.d.ts.map +1 -0
  389. package/build/types/mock/OntologiesV2/QueryTypes.d.ts +4 -0
  390. package/build/types/mock/OntologiesV2/QueryTypes.d.ts.map +1 -0
  391. package/build/types/mock/OntologiesV2/TimeSeriesPropertiesV2.d.ts +5 -0
  392. package/build/types/mock/OntologiesV2/TimeSeriesPropertiesV2.d.ts.map +1 -0
  393. package/build/types/mock/OntologiesV2/TimeSeriesValueBankProperties.d.ts +4 -0
  394. package/build/types/mock/OntologiesV2/TimeSeriesValueBankProperties.d.ts.map +1 -0
  395. package/build/types/mock/OntologiesV2/index.d.ts +15 -0
  396. package/build/types/mock/OntologiesV2/index.d.ts.map +1 -0
  397. package/build/types/mock/index.d.ts +1 -0
  398. package/build/types/mock/index.d.ts.map +1 -0
  399. package/build/types/withoutRid.d.ts +3 -0
  400. package/build/types/withoutRid.d.ts.map +1 -0
  401. package/package.json +88 -0
@@ -0,0 +1,116 @@
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
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
18
+ import { filterTimeSeriesData } from "./filterTimeSeriesData.js";
19
+
20
+ /*
21
+
22
+ Client code looks like this:
23
+
24
+ return body.$before
25
+ ? {
26
+ type: "relative",
27
+ startTime: {
28
+ when: "BEFORE",
29
+ value: body.$before,
30
+ unit: TimeseriesDurationMapping[body.$unit],
31
+ },
32
+ }
33
+ : {
34
+ type: "relative",
35
+ endTime: {
36
+ when: "AFTER",
37
+ value: body.$after!,
38
+ unit: TimeseriesDurationMapping[body.$unit],
39
+ },
40
+ };
41
+
42
+ and `{ $before: 7, $unit: "DAYS" }` should mean "start time is 7 days ago"
43
+ and `{ $after: 7, $unit: "DAYS" }` should mean "end time is 7 days from now"
44
+ */
45
+
46
+ describe(filterTimeSeriesData, () => {
47
+ beforeEach(() => {
48
+ vi.useFakeTimers({
49
+ now: new Date("2022-01-01T00:00:00Z")
50
+ });
51
+ });
52
+ afterEach(() => {
53
+ vi.useRealTimers();
54
+ });
55
+ it("properly handles $before", () => {
56
+ expect(filterTimeSeriesData([{
57
+ time: "2021-12-01T00:00:00Z",
58
+ value: 1
59
+ }, {
60
+ time: "2021-12-26T00:00:00Z",
61
+ value: 2
62
+ }, {
63
+ time: "2021-12-27T00:00:00Z",
64
+ value: 3
65
+ }], {
66
+ range: {
67
+ type: "relative",
68
+ startTime: {
69
+ when: "BEFORE",
70
+ value: 7,
71
+ unit: "DAYS"
72
+ }
73
+ }
74
+ })).toEqual([{
75
+ time: "2021-12-26T00:00:00Z",
76
+ value: 2
77
+ }, {
78
+ time: "2021-12-27T00:00:00Z",
79
+ value: 3
80
+ }]);
81
+ });
82
+ it("properly handles $after", () => {
83
+ expect(filterTimeSeriesData([{
84
+ time: "2022-01-01T00:00:00Z",
85
+ value: 1
86
+ }, {
87
+ time: "2022-01-02T00:00:00Z",
88
+ value: 2
89
+ }, {
90
+ time: "2022-01-03T00:00:00Z",
91
+ value: 3
92
+ }, {
93
+ time: "2022-02-03T00:00:00Z",
94
+ value: 4
95
+ }], {
96
+ range: {
97
+ type: "relative",
98
+ endTime: {
99
+ when: "AFTER",
100
+ value: 7,
101
+ unit: "DAYS"
102
+ }
103
+ }
104
+ })).toEqual([{
105
+ time: "2022-01-01T00:00:00Z",
106
+ value: 1
107
+ }, {
108
+ time: "2022-01-02T00:00:00Z",
109
+ value: 2
110
+ }, {
111
+ time: "2022-01-03T00:00:00Z",
112
+ value: 3
113
+ }]);
114
+ });
115
+ });
116
+ //# sourceMappingURL=filterTimeSeriesData.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterTimeSeriesData.test.js","names":["afterEach","beforeEach","describe","expect","it","vi","filterTimeSeriesData","useFakeTimers","now","Date","useRealTimers","time","value","range","type","startTime","when","unit","toEqual","endTime"],"sources":["filterTimeSeriesData.test.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 { afterEach, beforeEach, describe, expect, it, vi } from \"vitest\";\nimport { filterTimeSeriesData } from \"./filterTimeSeriesData.js\";\n\n/*\n\nClient code looks like this:\n\n return body.$before\n ? {\n type: \"relative\",\n startTime: {\n when: \"BEFORE\",\n value: body.$before,\n unit: TimeseriesDurationMapping[body.$unit],\n },\n }\n : {\n type: \"relative\",\n endTime: {\n when: \"AFTER\",\n value: body.$after!,\n unit: TimeseriesDurationMapping[body.$unit],\n },\n };\n\nand `{ $before: 7, $unit: \"DAYS\" }` should mean \"start time is 7 days ago\"\nand `{ $after: 7, $unit: \"DAYS\" }` should mean \"end time is 7 days from now\"\n*/\n\ndescribe(filterTimeSeriesData, () => {\n beforeEach(() => {\n vi.useFakeTimers({\n now: new Date(\"2022-01-01T00:00:00Z\"),\n });\n });\n\n afterEach(() => {\n vi.useRealTimers();\n });\n it(\"properly handles $before\", () => {\n expect(filterTimeSeriesData([\n { time: \"2021-12-01T00:00:00Z\", value: 1 },\n { time: \"2021-12-26T00:00:00Z\", value: 2 },\n { time: \"2021-12-27T00:00:00Z\", value: 3 },\n ], {\n range: {\n type: \"relative\",\n startTime: {\n when: \"BEFORE\",\n value: 7,\n unit: \"DAYS\",\n },\n },\n })).toEqual([\n { time: \"2021-12-26T00:00:00Z\", value: 2 },\n { time: \"2021-12-27T00:00:00Z\", value: 3 },\n ]);\n });\n\n it(\"properly handles $after\", () => {\n expect(filterTimeSeriesData([\n { time: \"2022-01-01T00:00:00Z\", value: 1 },\n { time: \"2022-01-02T00:00:00Z\", value: 2 },\n { time: \"2022-01-03T00:00:00Z\", value: 3 },\n { time: \"2022-02-03T00:00:00Z\", value: 4 },\n ], {\n range: {\n type: \"relative\",\n endTime: {\n when: \"AFTER\",\n value: 7,\n unit: \"DAYS\",\n },\n },\n })).toEqual([\n { time: \"2022-01-01T00:00:00Z\", value: 1 },\n { time: \"2022-01-02T00:00:00Z\", value: 2 },\n { time: \"2022-01-03T00:00:00Z\", value: 3 },\n ]);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,QAAQ;AACxE,SAASC,oBAAoB,QAAQ,2BAA2B;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAJ,QAAQ,CAACI,oBAAoB,EAAE,MAAM;EACnCL,UAAU,CAAC,MAAM;IACfI,EAAE,CAACE,aAAa,CAAC;MACfC,GAAG,EAAE,IAAIC,IAAI,CAAC,sBAAsB;IACtC,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFT,SAAS,CAAC,MAAM;IACdK,EAAE,CAACK,aAAa,CAAC,CAAC;EACpB,CAAC,CAAC;EACFN,EAAE,CAAC,0BAA0B,EAAE,MAAM;IACnCD,MAAM,CAACG,oBAAoB,CAAC,CAC1B;MAAEK,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,EAC1C;MAAED,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,EAC1C;MAAED,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,CAC3C,EAAE;MACDC,KAAK,EAAE;QACLC,IAAI,EAAE,UAAU;QAChBC,SAAS,EAAE;UACTC,IAAI,EAAE,QAAQ;UACdJ,KAAK,EAAE,CAAC;UACRK,IAAI,EAAE;QACR;MACF;IACF,CAAC,CAAC,CAAC,CAACC,OAAO,CAAC,CACV;MAAEP,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,EAC1C;MAAED,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,CAC3C,CAAC;EACJ,CAAC,CAAC;EAEFR,EAAE,CAAC,yBAAyB,EAAE,MAAM;IAClCD,MAAM,CAACG,oBAAoB,CAAC,CAC1B;MAAEK,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,EAC1C;MAAED,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,EAC1C;MAAED,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,EAC1C;MAAED,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,CAC3C,EAAE;MACDC,KAAK,EAAE;QACLC,IAAI,EAAE,UAAU;QAChBK,OAAO,EAAE;UACPH,IAAI,EAAE,OAAO;UACbJ,KAAK,EAAE,CAAC;UACRK,IAAI,EAAE;QACR;MACF;IACF,CAAC,CAAC,CAAC,CAACC,OAAO,CAAC,CACV;MAAEP,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,EAC1C;MAAED,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,EAC1C;MAAED,IAAI,EAAE,sBAAsB;MAAEC,KAAK,EAAE;IAAE,CAAC,CAC3C,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,217 @@
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
+ import invariant from "tiny-invariant";
18
+ import { filterObjects } from "./filterObjects.js";
19
+ export function getObjectsFromSet(ds, objectSet, methodInput) {
20
+ switch (objectSet.type) {
21
+ case "base":
22
+ const ret = Array.from(ds.getObjectsOfType(objectSet.objectType));
23
+ return ret;
24
+ case "filter":
25
+ {
26
+ const base = getObjectsFromSet(ds, objectSet.objectSet, methodInput);
27
+ return filterObjects(base, objectSet.where);
28
+ }
29
+ case "union":
30
+ {
31
+ const set = new Set();
32
+ for (const objSet of objectSet.objectSets) {
33
+ const objects = getObjectsFromSet(ds, objSet, methodInput);
34
+ for (const obj of objects) {
35
+ set.add(obj);
36
+ }
37
+ }
38
+ return Array.from(set);
39
+ }
40
+ case "subtract":
41
+ {
42
+ const set = new Set(getObjectsFromSet(ds, objectSet.objectSets[0], methodInput));
43
+ for (let i = 1; i < objectSet.objectSets.length; i++) {
44
+ const toSubtract = getObjectsFromSet(ds, objectSet.objectSets[i], methodInput);
45
+ for (const obj of toSubtract) {
46
+ set.delete(obj);
47
+ }
48
+ }
49
+ return Array.from(set);
50
+ }
51
+ case "intersect":
52
+ {
53
+ const set = new Set(getObjectsFromSet(ds, objectSet.objectSets[0], methodInput));
54
+ for (let i = 1; i < objectSet.objectSets.length; i++) {
55
+ const toIntersect = getObjectsFromSet(ds, objectSet.objectSets[i], methodInput);
56
+ for (const obj of set) {
57
+ const match = toIntersect.find(x => x.__apiName === obj.__apiName && x.__primaryKey === obj.__primaryKey);
58
+ if (!match) {
59
+ set.delete(obj);
60
+ } else if (obj["$propsToReturn"] || match["$propsToReturn"]) {
61
+ obj["$propsToReturn"] = {
62
+ ...obj["$propsToReturn"],
63
+ ...match["$propsToReturn"]
64
+ };
65
+ }
66
+ }
67
+ }
68
+ return Array.from(set);
69
+ }
70
+ case "searchAround":
71
+ {
72
+ const base = getObjectsFromSet(ds, objectSet.objectSet, methodInput);
73
+ return base.flatMap(o => {
74
+ const ret = ds.getLinksOrThrow(o.__apiName, o.__primaryKey, objectSet.link);
75
+ return ret;
76
+ });
77
+ }
78
+ case "static":
79
+ {
80
+ return objectSet.objects.map(x => ds.getObjectByRid(x)).filter(x => x != null);
81
+ }
82
+ case "withProperties":
83
+ {
84
+ const {
85
+ derivedProperties
86
+ } = objectSet;
87
+ const base = getObjectsFromSet(ds, objectSet.objectSet, methodInput);
88
+ return base.map(obj => {
89
+ const extra = Object.fromEntries(Object.entries(derivedProperties).map(([k, v]) => {
90
+ return [k, getDerivedPropertyValue(ds, obj, v)];
91
+ }));
92
+ return {
93
+ ...obj,
94
+ ...extra
95
+ };
96
+ });
97
+ }
98
+ case "methodInput":
99
+ !methodInput ? process.env.NODE_ENV !== "production" ? invariant(false, "expected a methodInput") : invariant(false) : void 0;
100
+ return [methodInput];
101
+ case "asBaseObjectTypes":
102
+ throw new Error(`Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`);
103
+ case "asType":
104
+ throw new Error(`Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`);
105
+ case "interfaceBase":
106
+ const relevantObjectTypes = ds.ontology.getAllObjectTypes().filter(x => objectSet.interfaceType in x.implementsInterfaces2);
107
+
108
+ // const ifaceDef = ds.ontology.getInterfaceType(objectTypeWithAllPropertyTypes);
109
+
110
+ return relevantObjectTypes.flatMap(x => Array.from(ds.getObjectsOfType(x.objectType.apiName))).map(obj => {
111
+ const objDef = ds.ontology.getObjectTypeFullMetadataOrThrow(obj.__apiName);
112
+ const ifaceMap = objDef.implementsInterfaces2[objectSet.interfaceType];
113
+ const $propsToReturn = objectSet.includeAllBaseObjectProperties ? obj : Object.fromEntries(Object.values(ifaceMap.properties).map(propApiName => [propApiName, obj[propApiName]]));
114
+ return {
115
+ ...objToInterface(ds, obj, objectSet.interfaceType),
116
+ $propsToReturn
117
+ };
118
+ });
119
+ case "nearestNeighbors":
120
+ throw new Error(`Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`);
121
+ case "reference":
122
+ throw new Error(`Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`);
123
+ }
124
+ throw new Error(`Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`);
125
+ }
126
+ function objToInterface(ds, o, iface) {
127
+ ds.ontology.getInterfaceType(iface);
128
+ const propMap = ds.ontology.getObjectTypeFullMetadataOrThrow(o.__apiName).implementsInterfaces2[iface].properties;
129
+ const {
130
+ __apiName,
131
+ __primaryKey,
132
+ __rid,
133
+ __title
134
+ } = o;
135
+ const ret = {
136
+ __apiName,
137
+ __primaryKey,
138
+ __rid,
139
+ __title
140
+ };
141
+ for (const [sptApiName, propApiName] of Object.entries(propMap)) {
142
+ ret[sptApiName] = o[propApiName];
143
+ }
144
+ return ret;
145
+ }
146
+ export function getDerivedPropertyValue(ds, obj, def) {
147
+ switch (def.type) {
148
+ case "selection":
149
+ {
150
+ return getDerivedPropertySelection(ds, obj, def);
151
+ }
152
+ }
153
+ throw new Error(`Unhandled derived property type ${def.type} in ${JSON.stringify(def)}`);
154
+ // return obj[property.propertyIdentifier];
155
+ }
156
+ function getDerivedPropertySelection(ds, obj, {
157
+ operation,
158
+ objectSet
159
+ }) {
160
+ switch (operation.type) {
161
+ case "get":
162
+ {
163
+ const objs = getObjectsFromSet(ds, objectSet, obj);
164
+ if (objs.length > 1) {
165
+ throw new Error("Cannot get more than one object from a set");
166
+ }
167
+ return objs[0]?.[operation.selectedPropertyApiName];
168
+ }
169
+ case "collectList":
170
+ {
171
+ const objs = getObjectsFromSet(ds, objectSet, obj);
172
+ return objs.map(o => o[operation.selectedPropertyApiName]);
173
+ }
174
+ case "collectSet":
175
+ {
176
+ const objs = getObjectsFromSet(ds, objectSet, obj);
177
+ return Array.from(new Set(objs.map(o => o[operation.selectedPropertyApiName])));
178
+ }
179
+ case "count":
180
+ {
181
+ const objs = getObjectsFromSet(ds, objectSet, obj);
182
+ return objs.length.toString();
183
+ }
184
+ }
185
+ }
186
+ export function createOrderBySortFn(orderBy) {
187
+ const fns = orderBy.fields.map(({
188
+ field,
189
+ direction
190
+ }) => {
191
+ return (a, b) => {
192
+ const aValue = a?.[field];
193
+ const bValue = b?.[field];
194
+ if (aValue == null && bValue == null) {
195
+ return 0;
196
+ }
197
+ if (aValue == null) {
198
+ return 1;
199
+ }
200
+ if (bValue == null) {
201
+ return -1;
202
+ }
203
+ const m = direction === "asc" ? -1 : 1;
204
+ return aValue < bValue ? m : aValue > bValue ? -m : 0;
205
+ };
206
+ });
207
+ return (a, b) => {
208
+ for (const sortFn of fns) {
209
+ const ret = sortFn(a, b);
210
+ if (ret !== 0) {
211
+ return ret;
212
+ }
213
+ }
214
+ return 0;
215
+ };
216
+ }
217
+ //# sourceMappingURL=getObjectsFromSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getObjectsFromSet.js","names":["invariant","filterObjects","getObjectsFromSet","ds","objectSet","methodInput","type","ret","Array","from","getObjectsOfType","objectType","base","where","set","Set","objSet","objectSets","objects","obj","add","i","length","toSubtract","delete","toIntersect","match","find","x","__apiName","__primaryKey","flatMap","o","getLinksOrThrow","link","map","getObjectByRid","filter","derivedProperties","extra","Object","fromEntries","entries","k","v","getDerivedPropertyValue","process","env","NODE_ENV","Error","JSON","stringify","relevantObjectTypes","ontology","getAllObjectTypes","interfaceType","implementsInterfaces2","apiName","objDef","getObjectTypeFullMetadataOrThrow","ifaceMap","$propsToReturn","includeAllBaseObjectProperties","values","properties","propApiName","objToInterface","iface","getInterfaceType","propMap","__rid","__title","sptApiName","def","getDerivedPropertySelection","operation","objs","selectedPropertyApiName","toString","createOrderBySortFn","orderBy","fns","fields","field","direction","a","b","aValue","bValue","m","sortFn"],"sources":["getObjectsFromSet.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 * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport type { BaseServerObject } from \"./BaseServerObject.js\";\nimport type { FauxDataStore } from \"./FauxDataStore.js\";\nimport { filterObjects } from \"./filterObjects.js\";\n\nexport function getObjectsFromSet(\n ds: FauxDataStore,\n objectSet: OntologiesV2.ObjectSet,\n methodInput: BaseServerObject | undefined,\n): Array<BaseServerObject> {\n switch (objectSet.type) {\n case \"base\":\n const ret = Array.from(ds.getObjectsOfType(objectSet.objectType));\n return ret;\n\n case \"filter\": {\n const base = getObjectsFromSet(ds, objectSet.objectSet, methodInput);\n return filterObjects(\n base,\n objectSet.where,\n );\n }\n\n case \"union\": {\n const set = new Set<BaseServerObject>();\n for (const objSet of objectSet.objectSets) {\n const objects = getObjectsFromSet(ds, objSet, methodInput);\n for (const obj of objects) {\n set.add(obj);\n }\n }\n return Array.from(set);\n }\n\n case \"subtract\": {\n const set = new Set<BaseServerObject>(\n getObjectsFromSet(ds, objectSet.objectSets[0], methodInput),\n );\n for (let i = 1; i < objectSet.objectSets.length; i++) {\n const toSubtract = getObjectsFromSet(\n ds,\n objectSet.objectSets[i],\n methodInput,\n );\n for (const obj of toSubtract) {\n set.delete(obj);\n }\n }\n return Array.from(set);\n }\n\n case \"intersect\": {\n const set = new Set<BaseServerObject>(\n getObjectsFromSet(ds, objectSet.objectSets[0], methodInput),\n );\n for (let i = 1; i < objectSet.objectSets.length; i++) {\n const toIntersect = getObjectsFromSet(\n ds,\n objectSet.objectSets[i],\n methodInput,\n );\n for (const obj of set) {\n const match = toIntersect.find(x =>\n x.__apiName === obj.__apiName\n && x.__primaryKey === obj.__primaryKey\n );\n\n if (!match) {\n set.delete(obj);\n } else if (obj[\"$propsToReturn\"] || match[\"$propsToReturn\"]) {\n obj[\"$propsToReturn\"] = {\n ...obj[\"$propsToReturn\"],\n ...match[\"$propsToReturn\"],\n };\n }\n }\n }\n return Array.from(set);\n }\n\n case \"searchAround\": {\n const base = getObjectsFromSet(ds, objectSet.objectSet, methodInput);\n return base.flatMap(o => {\n const ret = ds.getLinksOrThrow(\n o.__apiName,\n o.__primaryKey,\n objectSet.link,\n );\n return ret;\n });\n }\n\n case \"static\": {\n return objectSet.objects.map(x => ds.getObjectByRid(x)).filter(x =>\n x != null\n );\n }\n\n case \"withProperties\": {\n const { derivedProperties } = objectSet;\n\n const base = getObjectsFromSet(ds, objectSet.objectSet, methodInput);\n return base.map(obj => {\n const extra = Object.fromEntries(\n Object.entries(derivedProperties).map(([k, v]) => {\n return [k, getDerivedPropertyValue(ds, obj, v)];\n }),\n );\n\n return { ...obj, ...extra };\n });\n }\n\n case \"methodInput\":\n invariant(methodInput, \"expected a methodInput\");\n return [methodInput];\n\n case \"asBaseObjectTypes\":\n throw new Error(\n `Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`,\n );\n\n case \"asType\":\n throw new Error(\n `Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`,\n );\n\n case \"interfaceBase\":\n const relevantObjectTypes = ds\n .ontology\n .getAllObjectTypes().filter(x =>\n objectSet.interfaceType in x.implementsInterfaces2\n );\n\n // const ifaceDef = ds.ontology.getInterfaceType(objectTypeWithAllPropertyTypes);\n\n return relevantObjectTypes.flatMap(x =>\n Array.from(ds.getObjectsOfType(x.objectType.apiName))\n ).map(obj => {\n const objDef = ds.ontology.getObjectTypeFullMetadataOrThrow(\n obj.__apiName,\n );\n const ifaceMap = objDef.implementsInterfaces2[objectSet.interfaceType];\n const $propsToReturn = objectSet.includeAllBaseObjectProperties\n ? obj\n : Object.fromEntries(\n Object.values(ifaceMap.properties).map(\n (propApiName) => [propApiName, obj[propApiName]],\n ),\n );\n\n return ({\n ...objToInterface(ds, obj, objectSet.interfaceType),\n $propsToReturn,\n });\n });\n\n case \"nearestNeighbors\":\n throw new Error(\n `Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`,\n );\n\n case \"reference\":\n throw new Error(\n `Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`,\n );\n }\n\n throw new Error(\n `Unhandled objectSet type ${JSON.stringify(objectSet)} in shared.test`,\n );\n}\n\nfunction objToInterface(\n ds: FauxDataStore,\n o: BaseServerObject,\n iface: OntologiesV2.InterfaceTypeApiName,\n): BaseServerObject {\n const ifaceDef = ds.ontology.getInterfaceType(iface);\n const propMap = ds.ontology\n .getObjectTypeFullMetadataOrThrow(o.__apiName)\n .implementsInterfaces2[iface].properties;\n\n const { __apiName, __primaryKey, __rid, __title } = o;\n\n const ret: BaseServerObject = {\n __apiName,\n __primaryKey,\n __rid,\n __title,\n };\n for (const [sptApiName, propApiName] of Object.entries(propMap)) {\n ret[sptApiName] = o[propApiName];\n }\n return ret;\n}\n\nexport function getDerivedPropertyValue(\n ds: FauxDataStore,\n obj: BaseServerObject,\n def: OntologiesV2.DerivedPropertyDefinition,\n): any {\n switch (def.type) {\n case \"selection\": {\n return getDerivedPropertySelection(ds, obj, def);\n }\n }\n throw new Error(\n `Unhandled derived property type ${def.type} in ${JSON.stringify(def)}`,\n );\n // return obj[property.propertyIdentifier];\n}\n\nfunction getDerivedPropertySelection(\n ds: FauxDataStore,\n obj: BaseServerObject,\n { operation, objectSet }: OntologiesV2.SelectedPropertyExpression,\n) {\n switch (operation.type) {\n case \"get\": {\n const objs = getObjectsFromSet(ds, objectSet, obj);\n if (objs.length > 1) {\n throw new Error(\"Cannot get more than one object from a set\");\n }\n return objs[0]?.[operation.selectedPropertyApiName];\n }\n case \"collectList\": {\n const objs = getObjectsFromSet(ds, objectSet, obj);\n return objs.map(o => o[operation.selectedPropertyApiName]);\n }\n case \"collectSet\": {\n const objs = getObjectsFromSet(ds, objectSet, obj);\n return Array.from(\n new Set(objs.map(o => o[operation.selectedPropertyApiName])),\n );\n }\n case \"count\": {\n const objs = getObjectsFromSet(ds, objectSet, obj);\n return objs.length.toString();\n }\n }\n}\n\nexport function createOrderBySortFn(\n orderBy: OntologiesV2.SearchOrderByV2,\n) {\n const fns = orderBy.fields.map(({ field, direction }) => {\n return (\n a: BaseServerObject | undefined,\n b: BaseServerObject | undefined,\n ): number => {\n const aValue = a?.[field];\n const bValue = b?.[field];\n\n if (aValue == null && bValue == null) {\n return 0;\n }\n if (aValue == null) {\n return 1;\n }\n if (bValue == null) {\n return -1;\n }\n const m = direction === \"asc\" ? -1 : 1;\n return aValue < bValue ? m : aValue > bValue ? -m : 0;\n };\n });\n\n return (\n a: BaseServerObject | undefined,\n b: BaseServerObject | undefined,\n ): number => {\n for (const sortFn of fns) {\n const ret = sortFn(a, b);\n if (ret !== 0) {\n return ret;\n }\n }\n return 0;\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,SAAS,MAAM,gBAAgB;AAGtC,SAASC,aAAa,QAAQ,oBAAoB;AAElD,OAAO,SAASC,iBAAiBA,CAC/BC,EAAiB,EACjBC,SAAiC,EACjCC,WAAyC,EAChB;EACzB,QAAQD,SAAS,CAACE,IAAI;IACpB,KAAK,MAAM;MACT,MAAMC,GAAG,GAAGC,KAAK,CAACC,IAAI,CAACN,EAAE,CAACO,gBAAgB,CAACN,SAAS,CAACO,UAAU,CAAC,CAAC;MACjE,OAAOJ,GAAG;IAEZ,KAAK,QAAQ;MAAE;QACb,MAAMK,IAAI,GAAGV,iBAAiB,CAACC,EAAE,EAAEC,SAAS,CAACA,SAAS,EAAEC,WAAW,CAAC;QACpE,OAAOJ,aAAa,CAClBW,IAAI,EACJR,SAAS,CAACS,KACZ,CAAC;MACH;IAEA,KAAK,OAAO;MAAE;QACZ,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAmB,CAAC;QACvC,KAAK,MAAMC,MAAM,IAAIZ,SAAS,CAACa,UAAU,EAAE;UACzC,MAAMC,OAAO,GAAGhB,iBAAiB,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AC,CAAC;MACxB,IAAI/E,GAAG,KAAK,CAAC,EAAE;QACb,OAAOA,GAAG;MACZ;IACF;IACA,OAAO,CAAC;EACV,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,64 @@
1
+ /*
2
+ * Copyright 2023 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 { wireActionTypeV2ToSdkActionMetadata } from "@osdk/generator-converters";
18
+ import * as crypto from "node:crypto";
19
+ import { createActionParameterV2 } from "./TH_ActionParameterV2.js";
20
+ import { createAction } from "./TH_ActionTypeV2.js";
21
+ export function actionTypeBuilder(action) {
22
+ return new ActionTypeBuilder(action);
23
+ }
24
+ export function createActionRid() {
25
+ return `ri.ontology.main.action-type.${crypto.randomUUID()}`;
26
+ }
27
+ export class ActionTypeBuilder {
28
+ constructor(action) {
29
+ if (typeof action === "string") {
30
+ this.action = createAction({
31
+ apiName: action,
32
+ parameters: {}
33
+ });
34
+ } else {
35
+ this.action = action;
36
+ }
37
+ }
38
+ addParameter(paramId, parameter, required = false) {
39
+ const v = typeof parameter === "string" ? createActionParameterV2(parameter, required) : parameter;
40
+ return new ActionTypeBuilder({
41
+ ...this.action,
42
+ parameters: {
43
+ ...this.action.parameters,
44
+ [paramId]: v
45
+ }
46
+ });
47
+ }
48
+ build() {
49
+ const actionTypeV2 = this.action;
50
+ const actionMetadata = wireActionTypeV2ToSdkActionMetadata(actionTypeV2
51
+ // cast below is needed because the compile time type also needs `signatures`
52
+ // which we don't create in the conversion.
53
+ );
54
+ return {
55
+ actionTypeV2: this.action,
56
+ actionDefinition: {
57
+ __DefinitionMetadata: actionMetadata,
58
+ apiName: actionMetadata.apiName,
59
+ type: "action"
60
+ }
61
+ };
62
+ }
63
+ }
64
+ //# sourceMappingURL=ActionTypeBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionTypeBuilder.js","names":["wireActionTypeV2ToSdkActionMetadata","crypto","createActionParameterV2","createAction","actionTypeBuilder","action","ActionTypeBuilder","createActionRid","randomUUID","constructor","apiName","parameters","addParameter","paramId","parameter","required","v","build","actionTypeV2","actionMetadata","actionDefinition","__DefinitionMetadata","type"],"sources":["ActionTypeBuilder.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF 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 { ActionParameterV2, ParameterId } from \"@osdk/foundry.ontologies\";\nimport { wireActionTypeV2ToSdkActionMetadata } from \"@osdk/generator-converters\";\nimport * as crypto from \"node:crypto\";\nimport type { Merge } from \"type-fest\";\nimport type {\n TH_ActionDefinition,\n TH_ActionMetadata,\n} from \"./TH_ActionDefinition.js\";\nimport type {\n SimpleActionParamTypes,\n TH_ActionParameterV2,\n} from \"./TH_ActionParameterV2.js\";\nimport { createActionParameterV2 } from \"./TH_ActionParameterV2.js\";\nimport type { TH_ActionTypeV2 } from \"./TH_ActionTypeV2.js\";\nimport { createAction } from \"./TH_ActionTypeV2.js\";\n\nexport function actionTypeBuilder<\n P extends Record<ParameterId, ActionParameterV2> = {},\n>(action: TH_ActionTypeV2<P> | string): ActionTypeBuilder<P> {\n return new ActionTypeBuilder(action);\n}\n\nexport function createActionRid() {\n return `ri.ontology.main.action-type.${crypto.randomUUID()}`;\n}\n\ntype NEW_P<\n P extends Record<ParameterId, ActionParameterV2>,\n K extends ParameterId,\n V extends ActionParameterV2,\n> = Merge<P, { [KK in K]: V }>;\n\nexport interface ActionTypeBuilderResult<\n P extends Record<ParameterId, ActionParameterV2> = {},\n> {\n actionTypeV2: TH_ActionTypeV2<P>;\n actionDefinition: TH_ActionDefinition<TH_ActionTypeV2<P>>;\n}\n\nexport class ActionTypeBuilder<\n P extends Record<ParameterId, ActionParameterV2> = {},\n> {\n private action: TH_ActionTypeV2<P>;\n\n constructor(action: TH_ActionTypeV2<P> | string) {\n if (typeof action === \"string\") {\n this.action = createAction({\n apiName: action,\n parameters: {},\n }) as TH_ActionTypeV2<P>;\n } else {\n this.action = action;\n }\n }\n\n addParameter<\n K extends ParameterId,\n V extends ActionParameterV2 | SimpleActionParamTypes,\n R extends boolean = false,\n >(\n paramId: K,\n parameter: V,\n required: R | false = false,\n ): ActionTypeBuilder<\n NEW_P<\n P,\n K,\n V extends SimpleActionParamTypes ? TH_ActionParameterV2<V, R> : never\n >\n > {\n const v = (typeof parameter === \"string\")\n ? createActionParameterV2(parameter, required)\n : parameter;\n\n return new ActionTypeBuilder({\n ...this.action,\n parameters: {\n ...this.action.parameters,\n [paramId]: v,\n },\n } as TH_ActionTypeV2<any>) as ActionTypeBuilder<any>;\n }\n\n build(): ActionTypeBuilderResult<P> {\n const actionTypeV2 = this.action;\n const actionMetadata = wireActionTypeV2ToSdkActionMetadata(\n actionTypeV2,\n // cast below is needed because the compile time type also needs `signatures`\n // which we don't create in the conversion.\n ) as TH_ActionMetadata<TH_ActionTypeV2<P>>;\n\n return {\n actionTypeV2: this.action,\n actionDefinition: {\n __DefinitionMetadata: actionMetadata,\n apiName: actionMetadata.apiName,\n type: \"action\",\n },\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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QAChBC,oBAAoB,EAAEF,cAAc;QACpCT,OAAO,EAAES,cAAc,CAACT,OAAO;QAC/BY,IAAI,EAAE;MACR;IACF,CAAC;EACH;AACF","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=JustProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JustProps.js","names":[],"sources":["JustProps.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 { CompileTimeMetadata, ObjectTypeDefinition } from \"@osdk/api\";\nimport type { ObjectTypeV2 } from \"@osdk/foundry.ontologies\";\nimport type { ToObjectTypeDefinition } from \"./ToObjectTypeDefinition.js\";\n\nexport type JustProps<T extends ObjectTypeV2 | ObjectTypeDefinition> =\n CompileTimeMetadata<\n T extends ObjectTypeV2 ? ToObjectTypeDefinition<T> : T\n >[\"props\"];\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TH_ActionDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TH_ActionDefinition.js","names":[],"sources":["TH_ActionDefinition.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 ActionDefinition,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n DataValueClientToWire,\n} from \"@osdk/api\";\nimport type { ActionParameterV2, ParameterId } from \"@osdk/foundry.ontologies\";\nimport type { TH_ActionParameterV2 } from \"./TH_ActionParameterV2.js\";\nimport type { TH_ActionTypeV2 } from \"./TH_ActionTypeV2.js\";\n\n/**\n * Helper type for converting a \"const\" `ActionTypeV2` into a \"const\"\n * `ActionDefinition` for compile time checks\n */\nexport interface TH_ActionDefinition<\n X extends TH_ActionTypeV2<Record<ParameterId, ActionParameterV2>>,\n> extends ActionDefinition<any> {\n __DefinitionMetadata: TH_ActionMetadata<X>;\n}\n\nexport interface TH_ActionMetadata<\n X extends TH_ActionTypeV2<Record<ParameterId, ActionParameterV2>>,\n> extends ActionMetadata {\n parameters: X extends TH_ActionTypeV2<infer P> ? {\n [K in keyof P]: P[K] extends TH_ActionParameterV2<infer APT, infer R>\n ? (APT extends \"string\" | \"integer\" ? {\n multiplicity: false;\n nullable: R extends true ? false : true;\n type: APT;\n }\n : never)\n : never;\n }\n : never;\n\n // not part of ActionMetadata but used for types in @osdk/client\n signatures: Signatures<TH_ActionMetadata<X>[\"parameters\"]>;\n}\ninterface Signatures<X extends Record<any, ActionMetadata.Parameter<any>>> {\n applyAction: ActionSignature<X>;\n\n batchApplyAction: <\n A extends OsdkActionParameters<X>[],\n OP extends ApplyBatchActionOptions,\n >(args: A, options?: OP) => Promise<ActionReturnTypeForOptions<OP>>;\n}\ntype BaseType<APD extends Pick<ActionMetadata.Parameter<any>, \"type\">> =\n APD[\"type\"] extends ActionMetadata.DataType.Object<infer TTargetType>\n ? ActionParam.ObjectType<TTargetType>\n : APD[\"type\"] extends ActionMetadata.DataType.ObjectSet<infer TTargetType>\n ? ActionParam.ObjectSetType<TTargetType>\n : APD[\"type\"] extends ActionMetadata.DataType.Struct<infer TStructType>\n ? ActionParam.StructType<TStructType>\n : APD[\"type\"] extends keyof DataValueClientToWire\n ? ActionParam.PrimitiveType<APD[\"type\"]>\n : never;\ntype ActionSignature<\n X extends Record<any, ActionMetadata.Parameter<any>>,\n> = <\n A extends OsdkActionParameters<X>,\n OP extends ApplyActionOptions,\n>(\n args: A,\n options?: OP,\n) => Promise<\n ActionReturnTypeForOptions<OP>\n>;\ntype ActionParametersDefinition = Record<\n any,\n ActionMetadata.Parameter<any>\n>;\ntype OsdkActionParameters<\n X extends ActionParametersDefinition,\n> = PartialBy<FullParams<X>, NullableParamKeys<X>>;\ntype NullableParamKeys<T extends Record<string, { nullable?: boolean }>> =\n keyof {\n [K in keyof T as T[K][\"nullable\"] extends true ? K : never]: \"\";\n };\ntype FullParams<X extends ActionParametersDefinition> = {\n [P in keyof X]: MaybeArrayType<X[P]>;\n};\ntype PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\ntype MaybeArrayType<APD extends ActionMetadata.Parameter<any>> =\n APD[\"multiplicity\"] extends true ? Array<BaseType<APD>> : BaseType<APD>;\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export function createActionParameterV2(type, required) {
18
+ return {
19
+ dataType: {
20
+ type
21
+ },
22
+ required
23
+ };
24
+ }
25
+ //# sourceMappingURL=TH_ActionParameterV2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TH_ActionParameterV2.js","names":["createActionParameterV2","type","required","dataType"],"sources":["TH_ActionParameterV2.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 { ActionParameterV2 } from \"@osdk/foundry.ontologies\";\n\nexport type SimpleActionParamTypes = \"string\" | \"integer\" | \"boolean\";\n\nexport type TH_ActionParameterV2<\n T extends SimpleActionParamTypes,\n R extends boolean,\n> =\n & {\n dataType: { type: T };\n required: R;\n }\n & ActionParameterV2;\n\nexport function createActionParameterV2<\n T extends SimpleActionParamTypes,\n R extends boolean,\n>(type: T, required: R): TH_ActionParameterV2<T, R> {\n return {\n dataType: { type },\n required,\n } as TH_ActionParameterV2<T, R>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAO,SAASA,uBAAuBA,CAGrCC,IAAO,EAAEC,QAAW,EAA8B;EAClD,OAAO;IACLC,QAAQ,EAAE;MAAEF;IAAK,CAAC;IAClBC;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,35 @@
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
+ import { createActionRid } from "./ActionTypeBuilder.js";
18
+ export function createAction({
19
+ apiName,
20
+ parameters,
21
+ rid = createActionRid(),
22
+ operations = [],
23
+ status = "ACTIVE",
24
+ description
25
+ }) {
26
+ return {
27
+ apiName,
28
+ parameters,
29
+ rid,
30
+ operations,
31
+ status,
32
+ description: description ?? `Action ${apiName}`
33
+ };
34
+ }
35
+ //# sourceMappingURL=TH_ActionTypeV2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TH_ActionTypeV2.js","names":["createActionRid","createAction","apiName","parameters","rid","operations","status","description"],"sources":["TH_ActionTypeV2.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 ActionParameterV2,\n ActionTypeApiName,\n ActionTypeV2,\n ParameterId,\n} from \"@osdk/foundry.ontologies\";\nimport { createActionRid } from \"./ActionTypeBuilder.js\";\n\nexport interface TH_ActionTypeV2<\n P extends Record<ParameterId, ActionParameterV2>,\n> extends ActionTypeV2 {\n parameters: P;\n}\nexport function createAction<P extends Record<ParameterId, ActionParameterV2>>(\n {\n apiName,\n parameters,\n rid = createActionRid(),\n operations = [],\n status = \"ACTIVE\",\n description,\n }: Partial<Omit<ActionTypeV2, \"apiName\" | \"parameters\">> & {\n apiName: ActionTypeApiName;\n parameters: P;\n },\n): TH_ActionTypeV2<P> {\n return {\n apiName,\n parameters,\n rid,\n operations,\n status,\n description: description ?? `Action ${apiName}`,\n } as const;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,eAAe,QAAQ,wBAAwB;AAOxD,OAAO,SAASC,YAAYA,CAC1B;EACEC,OAAO;EACPC,UAAU;EACVC,GAAG,GAAGJ,eAAe,CAAC,CAAC;EACvBK,UAAU,GAAG,EAAE;EACfC,MAAM,GAAG,QAAQ;EACjBC;AAIF,CAAC,EACmB;EACpB,OAAO;IACLL,OAAO;IACPC,UAAU;IACVC,GAAG;IACHC,UAAU;IACVC,MAAM;IACNC,WAAW,EAAEA,WAAW,IAAI,UAAUL,OAAO;EAC/C,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TH_ApplyActionRequestV2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TH_ApplyActionRequestV2.js","names":[],"sources":["TH_ApplyActionRequestV2.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 { ActionParam } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n ApplyActionRequestV2,\n AttachmentRid,\n ParameterId,\n} from \"@osdk/foundry.ontologies\";\n\ntype TH_ActionParameterType_Primitive<X extends ActionParameterType> = X extends\n { type: \"attachment\" } ? AttachmentRid\n : ActionParam.PrimitiveType<\n Exclude<\n X[\"type\"],\n | \"object\"\n | \"array\"\n | \"objectSet\"\n | \"interfaceObject\"\n | \"attachment\"\n | \"vector\"\n >\n >;\n\ntype TH_ActionParameterType<X extends ActionParameterType> = X extends\n { type: \"array\" }\n ? TH_ActionParameterType_Primitive<Extract<X, { type: \"array\" }>[\"subType\"]>[]\n : X extends { type: \"object\" } ? string | number | boolean\n : X extends { type: \"objectSet\" } ? string\n : X extends { type: \"interfaceObject\" }\n ? { objectTypeApiName: string; primaryKeyValue: string }\n : TH_ActionParameterType_Primitive<X>;\n\ntype TH_Parameters<X extends Record<ParameterId, ActionParameterV2>> =\n & {\n [K in keyof X & string as X[K][\"required\"] extends true ? K : never]:\n TH_ActionParameterType<X[K][\"dataType\"]>;\n }\n & {\n [K in keyof X & string as X[K][\"required\"] extends true ? never : K]?:\n TH_ActionParameterType<X[K][\"dataType\"]>;\n };\n\nexport type TH_ApplyActionRequestV2<X extends ActionTypeV2> =\n & Omit<ApplyActionRequestV2, \"parameters\">\n & { parameters: TH_Parameters<X[\"parameters\"]> };\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TH_ObjectTypeFullMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TH_ObjectTypeFullMetadata.js","names":[],"sources":["TH_ObjectTypeFullMetadata.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 CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport type * as OntologiesV2 from \"@osdk/foundry.ontologies\";\n\ninterface TypeHelper_Property<Q extends ObjectMetadata.Property>\n extends OntologiesV2.PropertyV2\n{\n dataType: OntologiesV2.ObjectPropertyType & { type: Q[\"type\"] };\n}\n\ntype TypeHelper_Properties<Q extends ObjectTypeDefinition> = {\n [K in keyof CompileTimeMetadata<Q>[\"properties\"]]: TypeHelper_Property<\n CompileTimeMetadata<Q>[\"properties\"][K]\n >;\n};\n\ninterface TypeHelper_ObjectType<Q extends ObjectTypeDefinition>\n extends OntologiesV2.ObjectTypeV2\n{\n apiName: Q[\"apiName\"];\n primaryKey: CompileTimeMetadata<Q>[\"primaryKeyApiName\"];\n titleProperty: CompileTimeMetadata<Q>[\"titleProperty\"];\n properties: TypeHelper_Properties<Q>;\n}\n\nexport interface TH_ObjectTypeFullMetadata<Q extends ObjectTypeDefinition>\n extends OntologiesV2.ObjectTypeFullMetadata\n{\n objectType: TypeHelper_ObjectType<Q>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ToObjectTypeDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToObjectTypeDefinition.js","names":[],"sources":["ToObjectTypeDefinition.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 ObjectMetadata,\n PropertyDef,\n PropertyValueWireToClient,\n} from \"@osdk/api\";\nimport type { ObjectTypeV2, PropertyV2 } from \"@osdk/foundry.ontologies\";\n\ntype PropertyV2ToWirePropertyTypes<T extends PropertyV2> =\n T[\"dataType\"][\"type\"] extends \"array\" ? never\n : T[\"dataType\"][\"type\"] extends \"date\" ? \"timestamp\"\n : Exclude<\n T[\"dataType\"][\"type\"],\n \"array\" | \"date\" | \"struct\" | \"cipherText\" | \"timeseries\" | \"vector\"\n >;\n\nexport type ToObjectTypeDefinition<T extends ObjectTypeV2> = {\n type: \"object\";\n apiName: T[\"apiName\"];\n __DefinitionMetadata: Omit<ObjectMetadata, \"properties\"> & {\n props:\n & {\n [key in keyof T[\"properties\"] & string]?: PropertyValueWireToClient[\n PropertyV2ToWirePropertyTypes<T[\"properties\"][key]>\n ];\n }\n // setup the primary key to not be optional\n & {\n [key in T[\"primaryKey\"]]: PropertyValueWireToClient[\n PropertyV2ToWirePropertyTypes<T[\"properties\"][key]>\n ];\n };\n properties: {\n [key in keyof T[\"properties\"] & string]: PropertyDef<\n PropertyV2ToWirePropertyTypes<T[\"properties\"][key]>\n >;\n };\n };\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export { actionTypeBuilder, createActionRid } from "./ActionTypeBuilder.js";
18
+ export { createActionParameterV2 } from "./TH_ActionParameterV2.js";
19
+ export { createAction as createActionType } from "./TH_ActionTypeV2.js";
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["actionTypeBuilder","createActionRid","createActionParameterV2","createAction","createActionType"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { actionTypeBuilder, createActionRid } from \"./ActionTypeBuilder.js\";\nexport type { ActionTypeBuilderResult } from \"./ActionTypeBuilder.js\";\nexport type { JustProps } from \"./JustProps.js\";\nexport type {\n TH_ActionDefinition as ActionDefinition,\n TH_ActionMetadata as ActionMetadata,\n} from \"./TH_ActionDefinition.js\";\nexport { createActionParameterV2 } from \"./TH_ActionParameterV2.js\";\nexport type { TH_ActionParameterV2 as ActionParameterV2 } from \"./TH_ActionParameterV2.js\";\nexport { createAction as createActionType } from \"./TH_ActionTypeV2.js\";\nexport type { TH_ActionTypeV2 as ActionTypeV2 } from \"./TH_ActionTypeV2.js\";\nexport type { TH_ApplyActionRequestV2 as ApplyActionRequestV2 } from \"./TH_ApplyActionRequestV2.js\";\nexport type { TH_ObjectTypeFullMetadata as ObjectTypeFullMetadata } from \"./TH_ObjectTypeFullMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,iBAAiB,EAAEC,eAAe,QAAQ,wBAAwB;AAO3E,SAASC,uBAAuB,QAAQ,2BAA2B;AAEnE,SAASC,YAAY,IAAIC,gBAAgB,QAAQ,sBAAsB","ignoreList":[]}