@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,245 @@
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 validateAction(payload, def, dataStore) {
18
+ const ret = {
19
+ parameters: {},
20
+ submissionCriteria: [],
21
+ result: "VALID"
22
+ };
23
+ for (const [k, v] of Object.entries(def.parameters)) {
24
+ const value = payload.parameters[k];
25
+ validateActionParameterType(v.dataType, v, value, ret, k, dataStore);
26
+ }
27
+ return ret;
28
+ }
29
+
30
+ // So far these all basically return the same thing
31
+ // and can likely be rewritten as a function that return boolean
32
+ function validateActionParameterType(dataType, paramDef, value, ret, paramKey, dataStore) {
33
+ if (paramDef.required && value == null) {
34
+ ret.result = "INVALID";
35
+ ret.parameters[paramKey] = {
36
+ result: "INVALID",
37
+ evaluatedConstraints: [],
38
+ required: true
39
+ };
40
+ return;
41
+ }
42
+ if (!paramDef.required && value == null) {
43
+ return;
44
+ }
45
+ const baseParam = {
46
+ result: "INVALID",
47
+ evaluatedConstraints: [],
48
+ required: paramDef.required
49
+ };
50
+ switch (dataType.type) {
51
+ case "array":
52
+ {
53
+ if (!Array.isArray(value)) {
54
+ ret.result = "INVALID";
55
+ ret.parameters[paramKey] = {
56
+ ...baseParam
57
+ };
58
+ return;
59
+ }
60
+ for (const item of value) {
61
+ validateActionParameterType(dataType.subType, paramDef, item, ret, paramKey, dataStore);
62
+ }
63
+ return;
64
+ }
65
+ case "attachment":
66
+ {
67
+ if (typeof value !== "string") {
68
+ ret.result = "INVALID";
69
+ ret.parameters[paramKey] = {
70
+ ...baseParam
71
+ };
72
+ }
73
+ return;
74
+ }
75
+ case "boolean":
76
+ case "date":
77
+ case "long":
78
+ case "double":
79
+ case "integer":
80
+ case "marking":
81
+ case "objectSet":
82
+ case "timestamp":
83
+ case "object":
84
+ case "string":
85
+ if (!matchesOntologyDataType(dataType, value)) {
86
+ ret.result = "INVALID";
87
+ ret.parameters[paramKey] = {
88
+ ...baseParam
89
+ };
90
+ }
91
+ return;
92
+ case "geohash":
93
+ if (!(typeof value === "string")) {
94
+ ret.result = "INVALID";
95
+ ret.parameters[paramKey] = {
96
+ ...baseParam
97
+ };
98
+ }
99
+ return;
100
+ case "geoshape":
101
+ if (!(typeof value === "object" && ("coordinates" in value || "geometries" in value || "features" in value))) {
102
+ ret.result = "INVALID";
103
+ ret.parameters[paramKey] = {
104
+ ...baseParam
105
+ };
106
+ }
107
+ return;
108
+ case "interfaceObject":
109
+ {
110
+ if (!isInterfaceActionParam(value)) {
111
+ ret.result = "INVALID";
112
+ ret.parameters[paramKey] = {
113
+ ...baseParam
114
+ };
115
+ } else if (dataStore.getObject(value.objectTypeApiName, value.primaryKeyValue) == null) {
116
+ ret.result = "INVALID";
117
+ ret.parameters[paramKey] = {
118
+ ...baseParam,
119
+ evaluatedConstraints: [{
120
+ type: "objectPropertyValue"
121
+ }]
122
+ };
123
+ }
124
+ return;
125
+ }
126
+ case "mediaReference":
127
+ {
128
+ if (!isMediaReference(value)) {
129
+ ret.result = "INVALID";
130
+ ret.parameters[paramKey] = {
131
+ ...baseParam
132
+ };
133
+ }
134
+ return;
135
+ }
136
+ case "vector":
137
+ {
138
+ ret.result = "INVALID";
139
+ ret.parameters[paramKey] = {
140
+ ...baseParam
141
+ };
142
+ return;
143
+ }
144
+ case "struct":
145
+ {
146
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
147
+ ret.result = "INVALID";
148
+ ret.parameters[paramKey] = {
149
+ ...baseParam
150
+ };
151
+ return;
152
+ }
153
+ for (const {
154
+ name,
155
+ fieldType,
156
+ required
157
+ } of dataType.fields) {
158
+ const fieldValue = value[name];
159
+ if (required && fieldValue == null || !matchesOntologyDataType(fieldType, fieldValue)) {
160
+ ret.result = "INVALID";
161
+ ret.parameters[paramKey] = {
162
+ ...baseParam
163
+ };
164
+ return;
165
+ }
166
+ }
167
+ return;
168
+ }
169
+ case "objectType":
170
+ {
171
+ if (typeof value !== "string" || !dataStore.ontology.getObjectTypeFullMetadata(value)) {
172
+ ret.result = "INVALID";
173
+ ret.parameters[paramKey] = {
174
+ ...baseParam
175
+ };
176
+ return;
177
+ }
178
+ return;
179
+ }
180
+ default:
181
+ {
182
+ throw new Error(`validateDataType: unknown type`);
183
+ }
184
+ }
185
+ }
186
+ function matchesOntologyDataType(odt, value) {
187
+ switch (odt.type) {
188
+ case "any":
189
+ return true;
190
+ case "array":
191
+ return Array.isArray(value) && value.every(v => matchesOntologyDataType(odt.itemType, v));
192
+ case "binary":
193
+ throw new Error(`validateDataType: ${odt.type} not implemented yet.`);
194
+ case "boolean":
195
+ return typeof value === "boolean";
196
+ case "byte":
197
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
198
+ case "cipherText":
199
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
200
+ case "date":
201
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
202
+ case "decimal":
203
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
204
+ case "double":
205
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
206
+ case "float":
207
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
208
+ case "integer":
209
+ return typeof value === "number" && Number.isInteger(value);
210
+ case "long":
211
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
212
+ case "map":
213
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
214
+ case "marking":
215
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
216
+ case "object":
217
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
218
+ case "objectSet":
219
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
220
+ case "set":
221
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
222
+ case "short":
223
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
224
+ case "string":
225
+ return typeof value === "string";
226
+ case "struct":
227
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
228
+ case "timestamp":
229
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
230
+ case "unsupported":
231
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
232
+ default:
233
+ throw new Error(`matchesOntologyDataType: ${odt.type} not implemented yet.`);
234
+ }
235
+ }
236
+ export function isMediaReference(o) {
237
+ return typeof o === `object` && typeof o.mimeType === "string" && "reference" in o && typeof o.reference === "object" && o.reference.type === "mediaSetViewItem" && "mediaSetViewItem" in o.reference && typeof o.reference.mediaSetViewItem === "object" && typeof o.reference.mediaSetViewItem.mediaSetRid === "string" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === "string" && typeof o.reference.mediaSetViewItem.mediaItemRid === "string";
238
+ }
239
+ export function isInterfaceActionParam(value) {
240
+ return typeof value === "object" && "objectTypeApiName" in value && typeof value.objectTypeApiName === "string" && "primaryKeyValue" in value && (typeof value.primaryKeyValue === "string" || typeof value.primaryKeyValue === "number" || typeof value.primaryKeyValue === "boolean");
241
+ }
242
+ function isPoint(obj) {
243
+ return obj.type === "Point" && Array.isArray(obj.coordinates) && obj.coordinates.length === 2 && typeof obj.coordinates[0] === "number" && typeof obj.coordinates[1] === "number";
244
+ }
245
+ //# sourceMappingURL=validateAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateAction.js","names":["validateAction","payload","def","dataStore","ret","parameters","submissionCriteria","result","k","v","Object","entries","value","validateActionParameterType","dataType","paramDef","paramKey","required","evaluatedConstraints","baseParam","type","Array","isArray","item","subType","matchesOntologyDataType","isInterfaceActionParam","getObject","objectTypeApiName","primaryKeyValue","isMediaReference","name","fieldType","fields","fieldValue","ontology","getObjectTypeFullMetadata","Error","odt","every","itemType","Number","isInteger","o","mimeType","reference","mediaSetViewItem","mediaSetRid","mediaSetViewRid","mediaItemRid","isPoint","obj","coordinates","length"],"sources":["validateAction.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 { MediaReference } from \"@osdk/foundry.core\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n ApplyActionRequestV2,\n BatchApplyActionRequestItem,\n OntologyDataType,\n ParameterEvaluationResult,\n ValidateActionResponseV2,\n} from \"@osdk/foundry.ontologies\";\nimport type { FauxDataStore } from \"./FauxDataStore.js\";\n\nexport function validateAction(\n payload: ApplyActionRequestV2 | BatchApplyActionRequestItem,\n def: ActionTypeV2,\n dataStore: FauxDataStore,\n): ValidateActionResponseV2 {\n const ret: ValidateActionResponseV2 = {\n parameters: {},\n submissionCriteria: [],\n result: \"VALID\",\n };\n for (const [k, v] of Object.entries(def.parameters)) {\n const value = payload.parameters[k];\n validateActionParameterType(v.dataType, v, value, ret, k, dataStore);\n }\n\n return ret;\n}\n\n// So far these all basically return the same thing\n// and can likely be rewritten as a function that return boolean\nfunction validateActionParameterType(\n dataType: ActionParameterType,\n paramDef: ActionParameterV2,\n value: unknown,\n ret: ValidateActionResponseV2,\n paramKey: string,\n dataStore: FauxDataStore,\n) {\n if (paramDef.required && value == null) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n result: \"INVALID\",\n evaluatedConstraints: [],\n required: true,\n };\n return;\n }\n if (!paramDef.required && value == null) {\n return;\n }\n\n const baseParam: ParameterEvaluationResult = {\n result: \"INVALID\",\n evaluatedConstraints: [],\n required: paramDef.required,\n };\n\n switch (dataType.type) {\n case \"array\": {\n if (!Array.isArray(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n for (const item of value) {\n validateActionParameterType(\n dataType.subType,\n paramDef,\n item,\n ret,\n paramKey,\n dataStore,\n );\n }\n return;\n }\n\n case \"attachment\": {\n if (typeof value !== \"string\") {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n }\n\n case \"boolean\":\n case \"date\":\n case \"long\":\n case \"double\":\n case \"integer\":\n case \"marking\":\n case \"objectSet\":\n case \"timestamp\":\n case \"object\":\n case \"string\":\n if (!matchesOntologyDataType(dataType, value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n case \"geohash\":\n if (!(typeof value === \"string\")) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n\n case \"geoshape\":\n if (\n !(typeof value === \"object\"\n && (\"coordinates\" in value! || \"geometries\" in value!\n || \"features\" in value!))\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n case \"interfaceObject\": {\n if (!isInterfaceActionParam(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n } else if (\n dataStore.getObject(\n value.objectTypeApiName,\n value.primaryKeyValue,\n ) == null\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n evaluatedConstraints: [{\n type: \"objectPropertyValue\",\n }],\n };\n }\n return;\n }\n\n case \"mediaReference\": {\n if (!isMediaReference(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n }\n return;\n }\n\n case \"vector\": {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n case \"struct\": {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n for (const { name, fieldType, required } of dataType.fields) {\n const fieldValue = (value as Record<string, unknown>)[name];\n if (\n (required && fieldValue == null)\n || !matchesOntologyDataType(fieldType, fieldValue)\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n\n return;\n }\n }\n\n return;\n }\n\n case \"objectType\": {\n if (\n typeof value !== \"string\"\n || !dataStore.ontology.getObjectTypeFullMetadata(value)\n ) {\n ret.result = \"INVALID\";\n ret.parameters[paramKey] = {\n ...baseParam,\n };\n return;\n }\n\n return;\n }\n\n default: {\n const _assertNever: never = dataType;\n throw new Error(\n `validateDataType: unknown type`,\n );\n }\n }\n}\n\nfunction matchesOntologyDataType(\n odt: OntologyDataType,\n value: unknown,\n): boolean {\n switch (odt.type) {\n case \"any\":\n return true;\n case \"array\":\n return Array.isArray(value)\n && value.every((v) => matchesOntologyDataType(odt.itemType, v));\n case \"binary\":\n throw new Error(`validateDataType: ${odt.type} not implemented yet.`);\n case \"boolean\":\n return typeof value === \"boolean\";\n case \"byte\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"cipherText\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"date\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"decimal\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"double\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"float\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"integer\":\n return (typeof value === \"number\" && Number.isInteger(value));\n\n case \"long\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"map\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"marking\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"object\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"objectSet\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"set\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"short\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"string\":\n return (typeof value === \"string\");\n\n case \"struct\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"timestamp\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n case \"unsupported\":\n throw new Error(\n `matchesOntologyDataType: ${odt.type} not implemented yet.`,\n );\n default:\n const _assertNever = odt;\n throw new Error(\n `matchesOntologyDataType: ${(odt as any).type} not implemented yet.`,\n );\n }\n}\n\nexport function isMediaReference(o: any): o is MediaReference {\n return typeof o === `object`\n && typeof o.mimeType === \"string\"\n && \"reference\" in o\n && typeof o.reference === \"object\"\n && o.reference.type === \"mediaSetViewItem\"\n && \"mediaSetViewItem\" in o.reference\n && typeof o.reference.mediaSetViewItem === \"object\"\n && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\n\nexport function isInterfaceActionParam(value: any): value is {\n objectTypeApiName: string;\n primaryKeyValue: string | number | boolean;\n} {\n return (\n typeof value === \"object\"\n && \"objectTypeApiName\" in value\n && typeof value.objectTypeApiName === \"string\"\n && \"primaryKeyValue\" in value\n && (typeof value.primaryKeyValue === \"string\"\n || typeof value.primaryKeyValue === \"number\"\n || typeof value.primaryKeyValue === \"boolean\")\n );\n}\n\nfunction isPoint(obj: any): obj is GeoJSON.Point {\n return obj.type === \"Point\"\n && Array.isArray(obj.coordinates)\n && obj.coordinates.length === 2\n && typeof obj.coordinates[0] === \"number\"\n && typeof obj.coordinates[1] === \"number\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA,OAAO,SAASA,cAAcA,CAC5BC,OAA2D,EAC3DC,GAAiB,EACjBC,SAAwB,EACE;EAC1B,MAAMC,GAA6B,GAAG;IACpCC,UAAU,EAAE,CAAC,CAAC;IACdC,kBAAkB,EAAE,EAAE;IACtBC,MAAM,EAAE;EACV,CAAC;EACD,KAAK,MAAM,CAACC,CAAC,EAAEC,CAAC,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACT,GAAG,CAACG,UAAU,CAAC,EAAE;IACnD,MAAMO,KAAK,GAAGX,OAAO,CAACI,UAAU,CAACG,CAAC,CAAC;IACnCK,2BAA2B,CAACJ,CAAC,CAACK,QAAQ,EAAEL,CAAC,EAAEG,KAAK,EAAER,GAAG,EAAEI,CAAC,EAAEL,SAAS,CAAC;EACtE;EAEA,OAAOC,GAAG;AACZ;;AAEA;AACA;AACA,SAASS,2BAA2BA,CAClCC,QAA6B,EAC7BC,QAA2B,EAC3BH,KAAc,EACdR,GAA6B,EAC7BY,QAAgB,EAChBb,SAAwB,EACxB;EACA,IAAIY,QAAQ,CAACE,QAAQ,IAAIL,KAAK,IAAI,IAAI,EAAE;IACtCR,GAAG,CAACG,MAAM,GAAG,SAAS;IACtBH,GAAG,CAACC,UAAU,CAACW,QAAQ,CAAC,GAAG;MACzBT,MAA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CAACC,gBAAgB,CAACE,eAAe,KAAK,QAAQ,IAChE,OAAOL,CAAC,CAACE,SAAS,CAACC,gBAAgB,CAACG,YAAY,KAAK,QAAQ;AACpE;AAEA,OAAO,SAASvB,sBAAsBA,CAACd,KAAU,EAG/C;EACA,OACE,OAAOA,KAAK,KAAK,QAAQ,IACtB,mBAAmB,IAAIA,KAAK,IAC5B,OAAOA,KAAK,CAACgB,iBAAiB,KAAK,QAAQ,IAC3C,iBAAiB,IAAIhB,KAAK,KACzB,OAAOA,KAAK,CAACiB,eAAe,KAAK,QAAQ,IACxC,OAAOjB,KAAK,CAACiB,eAAe,KAAK,QAAQ,IACzC,OAAOjB,KAAK,CAACiB,eAAe,KAAK,SAAS,CAAC;AAEpD;AAEA,SAASqB,OAAOA,CAACC,GAAQ,EAAwB;EAC/C,OAAOA,GAAG,CAAC/B,IAAI,KAAK,OAAO,IACtBC,KAAK,CAACC,OAAO,CAAC6B,GAAG,CAACC,WAAW,CAAC,IAC9BD,GAAG,CAACC,WAAW,CAACC,MAAM,KAAK,CAAC,IAC5B,OAAOF,GAAG,CAACC,WAAW,CAAC,CAAC,CAAC,KAAK,QAAQ,IACtC,OAAOD,GAAG,CAACC,WAAW,CAAC,CAAC,CAAC,KAAK,QAAQ;AAC7C","ignoreList":[]}
@@ -0,0 +1,25 @@
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 { defaultOntologyMetadata as defaultOntology } from "./defaultOntologyMetadata.js";
18
+ export const defaultOntologyForConjure = {
19
+ apiName: defaultOntology.apiName,
20
+ displayName: defaultOntology.displayName,
21
+ description: defaultOntology.description,
22
+ currentOntologyVersion: "0000000c-aaaa-bbbb-cccc-ddddeeeeffff",
23
+ defaultBranchRid: "ri.ontology.main.branch.99999999-8888-7777-6666-555555555555"
24
+ };
25
+ //# sourceMappingURL=defaultOntologyForConjure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultOntologyForConjure.js","names":["defaultOntologyMetadata","defaultOntology","defaultOntologyForConjure","apiName","displayName","description","currentOntologyVersion","defaultBranchRid"],"sources":["defaultOntologyForConjure.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 { defaultOntologyMetadata as defaultOntology } from \"./defaultOntologyMetadata.js\";\n\nexport const defaultOntologyForConjure = {\n apiName: defaultOntology.apiName as string,\n displayName: defaultOntology.displayName as string,\n description: defaultOntology.description as string,\n currentOntologyVersion: \"0000000c-aaaa-bbbb-cccc-ddddeeeeffff\",\n defaultBranchRid:\n \"ri.ontology.main.branch.99999999-8888-7777-6666-555555555555\",\n} as const;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,uBAAuB,IAAIC,eAAe,QAAQ,8BAA8B;AAEzF,OAAO,MAAMC,yBAAyB,GAAG;EACvCC,OAAO,EAAEF,eAAe,CAACE,OAAiB;EAC1CC,WAAW,EAAEH,eAAe,CAACG,WAAqB;EAClDC,WAAW,EAAEJ,eAAe,CAACI,WAAqB;EAClDC,sBAAsB,EAAE,sCAAsC;EAC9DC,gBAAgB,EACd;AACJ,CAAU","ignoreList":[]}
@@ -0,0 +1,23 @@
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 const defaultOntologyMetadata = {
18
+ apiName: "default-ontology",
19
+ displayName: "Ontology",
20
+ description: "The default ontology",
21
+ rid: "ri.ontology.main.ontology.698267cc-6b48-4d98-beff-29beb24e9361"
22
+ };
23
+ //# sourceMappingURL=defaultOntologyMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultOntologyMetadata.js","names":["defaultOntologyMetadata","apiName","displayName","description","rid"],"sources":["defaultOntologyMetadata.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 { Ontology } from \"@osdk/foundry.ontologies\";\n\nexport const defaultOntologyMetadata: Ontology = {\n apiName: \"default-ontology\",\n displayName: \"Ontology\",\n description: \"The default ontology\",\n rid: \"ri.ontology.main.ontology.698267cc-6b48-4d98-beff-29beb24e9361\",\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,uBAAiC,GAAG;EAC/CC,OAAO,EAAE,kBAAkB;EAC3BC,WAAW,EAAE,UAAU;EACvBC,WAAW,EAAE,sBAAsB;EACnCC,GAAG,EAAE;AACP,CAAC","ignoreList":[]}
@@ -0,0 +1,134 @@
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
+
19
+ const errorInstanceId = "errorInstanceId";
20
+ const objectTypeRid = "ri.foundry.main.objectType.1";
21
+ export function ObjectTypeDoesNotExistError(objectType) {
22
+ return {
23
+ errorCode: "NOT_FOUND",
24
+ errorName: "ObjectTypeNotFound",
25
+ errorInstanceId,
26
+ parameters: {
27
+ objectType,
28
+ objectTypeRid
29
+ }
30
+ };
31
+ }
32
+ export function LinkTypeNotFound(objectType, linkType) {
33
+ return {
34
+ errorCode: "NOT_FOUND",
35
+ errorName: "LinkTypeNotFound",
36
+ errorInstanceId,
37
+ parameters: {
38
+ objectType,
39
+ linkType
40
+ }
41
+ };
42
+ }
43
+ export function OntologyNotFoundError(ontology) {
44
+ return {
45
+ errorCode: "NOT_FOUND",
46
+ errorName: "OntologyNotFound",
47
+ errorInstanceId,
48
+ parameters: {
49
+ ontologyRid: ontology,
50
+ apiName: ontology
51
+ }
52
+ };
53
+ }
54
+ export function ObjectNotFoundError(objectType, primaryKey) {
55
+ return {
56
+ errorCode: "NOT_FOUND",
57
+ errorName: "ObjectNotFound",
58
+ errorInstanceId,
59
+ parameters: {
60
+ objectType,
61
+ primaryKey: {
62
+ employeeId: primaryKey
63
+ }
64
+ }
65
+ };
66
+ }
67
+ export function QueryNotFoundError(queryApiName) {
68
+ return {
69
+ errorCode: "NOT_FOUND",
70
+ errorName: "QueryNotFound",
71
+ errorInstanceId,
72
+ parameters: {
73
+ query: queryApiName
74
+ }
75
+ };
76
+ }
77
+ export function ActionNotFoundError() {
78
+ return {
79
+ errorCode: "NOT_FOUND",
80
+ errorName: "ActionNotFound",
81
+ errorInstanceId,
82
+ parameters: {
83
+ actionRid: ""
84
+ }
85
+ };
86
+ }
87
+ export function InvalidRequest(errorName) {
88
+ return {
89
+ errorCode: "INVALID_REQUEST",
90
+ errorName,
91
+ errorInstanceId,
92
+ parameters: {}
93
+ };
94
+ }
95
+ export const ApplyActionFailedError = {
96
+ errorCode: "INVALID_ARGUMENT",
97
+ errorName: "ApplyActionFailed",
98
+ errorInstanceId,
99
+ parameters: {}
100
+ };
101
+ export const ExecuteQueryFailedError = {
102
+ errorCode: "CONFLICT",
103
+ errorName: "QueryEncounteredUserFacingError",
104
+ errorInstanceId,
105
+ parameters: {
106
+ functionRid: "ri.function-registry.main.function.9b55870a-63c7-4d48-8f06-9627c0805968",
107
+ functionVersion: "0.11.0",
108
+ message: "test failed"
109
+ }
110
+ };
111
+ export const InvalidContentTypeError = {
112
+ errorCode: "INVALID_ARGUMENT",
113
+ errorName: "InvalidContentType",
114
+ errorInstanceId,
115
+ parameters: {}
116
+ };
117
+ export const AttachmentSizeExceededLimitError = {
118
+ errorCode: "INVALID_ARGUMENT",
119
+ errorName: "AttachmentSizeExceededLimit",
120
+ errorInstanceId,
121
+ parameters: {
122
+ fileSizeBytes: "230000",
123
+ fileLimitBytes: "200000"
124
+ }
125
+ };
126
+ export const AttachmentNotFoundError = {
127
+ errorCode: "NOT_FOUND",
128
+ errorName: "AttachmentNotFound",
129
+ errorInstanceId,
130
+ parameters: {
131
+ attachmentRid: "ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a80"
132
+ }
133
+ };
134
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","names":["errorInstanceId","objectTypeRid","ObjectTypeDoesNotExistError","objectType","errorCode","errorName","parameters","LinkTypeNotFound","linkType","OntologyNotFoundError","ontology","ontologyRid","apiName","ObjectNotFoundError","primaryKey","employeeId","QueryNotFoundError","queryApiName","query","ActionNotFoundError","actionRid","InvalidRequest","ApplyActionFailedError","ExecuteQueryFailedError","functionRid","functionVersion","message","InvalidContentTypeError","AttachmentSizeExceededLimitError","fileSizeBytes","fileLimitBytes","AttachmentNotFoundError","attachmentRid"],"sources":["errors.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\nimport type {\n ActionNotFound,\n ApplyActionFailed,\n AttachmentNotFound,\n AttachmentSizeExceededLimit,\n InvalidContentType,\n LinkTypeNotFound as OGLinkTypeNotFound,\n ObjectNotFound,\n ObjectTypeNotFound,\n OntologyNotFound,\n QueryEncounteredUserFacingError,\n QueryNotFound,\n} from \"@osdk/internal.foundry.ontologies\";\nimport type { BaseAPIError } from \"./BaseError.js\";\n\nconst errorInstanceId = \"errorInstanceId\";\nconst objectTypeRid = \"ri.foundry.main.objectType.1\";\n\nexport function ObjectTypeDoesNotExistError(\n objectType: string,\n): ObjectTypeNotFound {\n return {\n errorCode: \"NOT_FOUND\",\n errorName: \"ObjectTypeNotFound\",\n errorInstanceId,\n parameters: {\n objectType,\n objectTypeRid,\n },\n };\n}\n\nexport function LinkTypeNotFound(\n objectType: string,\n linkType: string,\n): OGLinkTypeNotFound {\n return {\n errorCode: \"NOT_FOUND\",\n errorName: \"LinkTypeNotFound\",\n errorInstanceId,\n parameters: {\n objectType,\n linkType,\n },\n };\n}\n\nexport function OntologyNotFoundError(\n ontology: string,\n): OntologyNotFound {\n return {\n errorCode: \"NOT_FOUND\",\n errorName: \"OntologyNotFound\",\n errorInstanceId,\n parameters: {\n ontologyRid: ontology,\n apiName: ontology,\n },\n };\n}\n\nexport function ObjectNotFoundError(\n objectType: string,\n primaryKey: string,\n): ObjectNotFound {\n return {\n errorCode: \"NOT_FOUND\",\n errorName: \"ObjectNotFound\",\n errorInstanceId,\n parameters: {\n objectType,\n primaryKey: {\n employeeId: primaryKey,\n },\n },\n };\n}\n\nexport function QueryNotFoundError(queryApiName: string): QueryNotFound {\n return {\n errorCode: \"NOT_FOUND\",\n errorName: \"QueryNotFound\",\n errorInstanceId,\n parameters: {\n query: queryApiName,\n },\n };\n}\n\nexport function ActionNotFoundError(): ActionNotFound {\n return {\n errorCode: \"NOT_FOUND\",\n errorName: \"ActionNotFound\",\n errorInstanceId,\n parameters: {\n actionRid: \"\",\n },\n };\n}\n\nexport function InvalidRequest(errorName: string): BaseAPIError {\n return {\n errorCode: \"INVALID_REQUEST\",\n errorName,\n errorInstanceId,\n parameters: {},\n };\n}\n\nexport const ApplyActionFailedError: ApplyActionFailed = {\n errorCode: \"INVALID_ARGUMENT\",\n errorName: \"ApplyActionFailed\",\n errorInstanceId,\n parameters: {},\n};\n\nexport const ExecuteQueryFailedError: QueryEncounteredUserFacingError = {\n errorCode: \"CONFLICT\",\n errorName: \"QueryEncounteredUserFacingError\",\n errorInstanceId,\n parameters: {\n functionRid:\n \"ri.function-registry.main.function.9b55870a-63c7-4d48-8f06-9627c0805968\",\n functionVersion: \"0.11.0\",\n message: \"test failed\",\n },\n};\n\nexport const InvalidContentTypeError: InvalidContentType = {\n errorCode: \"INVALID_ARGUMENT\",\n errorName: \"InvalidContentType\",\n errorInstanceId,\n parameters: {},\n};\n\nexport const AttachmentSizeExceededLimitError: AttachmentSizeExceededLimit = {\n errorCode: \"INVALID_ARGUMENT\",\n errorName: \"AttachmentSizeExceededLimit\",\n errorInstanceId,\n parameters: {\n fileSizeBytes: \"230000\",\n fileLimitBytes: \"200000\",\n },\n};\n\nexport const AttachmentNotFoundError: AttachmentNotFound = {\n errorCode: \"NOT_FOUND\",\n errorName: \"AttachmentNotFound\",\n errorInstanceId,\n parameters: {\n attachmentRid:\n \"ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a80\",\n },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAiBA,MAAMA,eAAe,GAAG,iBAAiB;AACzC,MAAMC,aAAa,GAAG,8BAA8B;AAEpD,OAAO,SAASC,2BAA2BA,CACzCC,UAAkB,EACE;EACpB,OAAO;IACLC,SAAS,EAAE,WAAW;IACtBC,SAAS,EAAE,oBAAoB;IAC/BL,eAAe;IACfM,UAAU,EAAE;MACVH,UAAU;MACVF;IACF;EACF,CAAC;AACH;AAEA,OAAO,SAASM,gBAAgBA,CAC9BJ,UAAkB,EAClBK,QAAgB,EACI;EACpB,OAAO;IACLJ,SAAS,EAAE,WAAW;IACtBC,SAAS,EAAE,kBAAkB;IAC7BL,eAAe;IACfM,UAAU,EAAE;MACVH,UAAU;MACVK;IACF;EACF,CAAC;AACH;AAEA,OAAO,SAASC,qBAAqBA,CACnCC,QAAgB,EACE;EAClB,OAAO;IACLN,SAAS,EAAE,WAAW;IACtBC,SAAS,EAAE,kBAAkB;IAC7BL,eAAe;IACfM,UAAU,EAAE;MACVK,WAAW,EAAED,QAAQ;MACrBE,OAAO,EAAEF;IACX;EACF,CAAC;AACH;AAEA,OAAO,SAASG,mBAAmBA,CACjCV,UAAkB,EA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AS,EAAE,kBAAkB;EAC7BC,SAAS,EAAE,6BAA6B;EACxCL,eAAe;EACfM,UAAU,EAAE;IACVuB,aAAa,EAAE,QAAQ;IACvBC,cAAc,EAAE;EAClB;AACF,CAAC;AAED,OAAO,MAAMC,uBAA2C,GAAG;EACzD3B,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,oBAAoB;EAC/BL,eAAe;EACfM,UAAU,EAAE;IACV0B,aAAa,EACX;EACJ;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,86 @@
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
+ export function subSelectPropertiesUrl(object, url) {
18
+ const properties = new Set(url.searchParams.getAll("select"));
19
+ if (properties.size === 0) {
20
+ return object;
21
+ }
22
+ const result = Object.entries(object).reduce((acc, [key, value]) => {
23
+ if (properties.has(key)) {
24
+ acc[key] = value;
25
+ } else if (key === "__primaryKey") {
26
+ acc.__primaryKey = value;
27
+ } else if (key === "__apiName") {
28
+ acc.__apiName = value;
29
+ }
30
+ return acc;
31
+ }, {});
32
+ return result;
33
+ }
34
+ export function subSelectProperties(objects, urlOrProperties, includeCount, excludeRid) {
35
+ let properties;
36
+ if (Array.isArray(urlOrProperties)) {
37
+ properties = new Set(urlOrProperties);
38
+ } else {
39
+ properties = new Set(urlOrProperties.searchParams.getAll("select"));
40
+ }
41
+ const result = objects.data.map(object => {
42
+ // This is set when an object had an interface that was marked to return all properties
43
+ if (object.$propsToReturn) {
44
+ return {
45
+ __apiName: object.__apiName,
46
+ __primaryKey: object.__primaryKey,
47
+ __title: object.__title,
48
+ ...object.$propsToReturn,
49
+ ...(excludeRid ? {} : {
50
+ __rid: object.__rid
51
+ })
52
+ };
53
+ }
54
+
55
+ // no subselect provided, just handle the rid.
56
+ if (properties.size === 0) {
57
+ return excludeRid ? removeRid(object) : object;
58
+ }
59
+
60
+ // do subselect
61
+ properties.add("__primaryKey");
62
+ properties.add("__apiName");
63
+ properties.add("__title");
64
+ if (!excludeRid) properties.add("__rid");
65
+ return Object.entries(object).reduce((acc, [key, value]) => {
66
+ if (properties.has(key)) {
67
+ acc[key] = value;
68
+ }
69
+ return acc;
70
+ }, {});
71
+ });
72
+ const ret = {
73
+ nextPageToken: objects.nextPageToken,
74
+ data: result,
75
+ totalCount: objects.totalCount
76
+ };
77
+ return ret;
78
+ }
79
+ function removeRid(object) {
80
+ const {
81
+ __rid,
82
+ ...rest
83
+ } = object;
84
+ return rest;
85
+ }
86
+ //# sourceMappingURL=filterObjects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterObjects.js","names":["subSelectPropertiesUrl","object","url","properties","Set","searchParams","getAll","size","result","Object","entries","reduce","acc","key","value","has","__primaryKey","__apiName","subSelectProperties","objects","urlOrProperties","includeCount","excludeRid","Array","isArray","data","map","$propsToReturn","__title","__rid","removeRid","add","ret","nextPageToken","totalCount","rest"],"sources":["filterObjects.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 {\n OntologyObject,\n OntologyObjectV2,\n} from \"@osdk/foundry.ontologies\";\nimport type {\n PagedBodyResponse,\n PagedBodyResponseWithTotal,\n} from \"./handlers/util/pageThroughResponseSearchParams.js\";\n\nexport function subSelectPropertiesUrl<\n T extends OntologyObjectV2 | OntologyObject,\n>(\n object: T,\n url: URL,\n): T {\n const properties = new Set(url.searchParams.getAll(\"select\"));\n\n if (properties.size === 0) {\n return object;\n }\n\n const result = Object.entries(object).reduce<{ [key: string]: any }>(\n (acc, [key, value]) => {\n if (properties.has(key)) {\n acc[key] = value;\n } else if (key === \"__primaryKey\") {\n acc.__primaryKey = value;\n } else if (key === \"__apiName\") {\n acc.__apiName = value;\n }\n\n return acc;\n },\n {},\n );\n\n return result as T;\n}\n\nexport function subSelectProperties<\n T extends OntologyObjectV2,\n TResponse extends\n | PagedBodyResponse<T>\n | PagedBodyResponseWithTotal<T>,\n TIncludeCount extends (TResponse extends PagedBodyResponseWithTotal<T> ? true\n : false),\n>(\n objects: PagedBodyResponse<T>,\n urlOrProperties: URL | string[],\n includeCount: TIncludeCount,\n excludeRid?: boolean,\n): TIncludeCount extends true ? PagedBodyResponseWithTotal<T>\n : PagedBodyResponse<T>\n{\n let properties: Set<string>;\n if (Array.isArray(urlOrProperties)) {\n properties = new Set(urlOrProperties);\n } else {\n properties = new Set(urlOrProperties.searchParams.getAll(\"select\"));\n }\n\n const result = objects.data.map(object => {\n // This is set when an object had an interface that was marked to return all properties\n if (object.$propsToReturn) {\n return {\n __apiName: object.__apiName,\n __primaryKey: object.__primaryKey,\n __title: object.__title,\n ...object.$propsToReturn,\n ...(excludeRid ? {} : { __rid: object.__rid }),\n };\n }\n\n // no subselect provided, just handle the rid.\n if (properties.size === 0) {\n return excludeRid ? removeRid(object) : object;\n }\n\n // do subselect\n properties.add(\"__primaryKey\");\n properties.add(\"__apiName\");\n properties.add(\"__title\");\n if (!excludeRid) properties.add(\"__rid\");\n return Object.entries(object).reduce<{ [key: string]: any }>(\n (acc, [key, value]) => {\n if (properties.has(key)) {\n acc[key] = value;\n }\n\n return acc;\n },\n {},\n );\n });\n\n const ret:\n | PagedBodyResponse<T>\n | PagedBodyResponseWithTotal<T> = {\n nextPageToken: objects.nextPageToken,\n data: result as T[],\n totalCount: (objects as PagedBodyResponseWithTotal<T>).totalCount,\n };\n\n return ret as TIncludeCount extends true ? PagedBodyResponseWithTotal<T>\n : PagedBodyResponse<T>;\n}\nfunction removeRid<T extends OntologyObjectV2>(object: T) {\n const { __rid, ...rest } = object as Omit<T, \"__rid\">;\n return rest;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,OAAO,SAASA,sBAAsBA,CAGpCC,MAAS,EACTC,GAAQ,EACL;EACH,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAACF,GAAG,CAACG,YAAY,CAACC,MAAM,CAAC,QAAQ,CAAC,CAAC;EAE7D,IAAIH,UAAU,CAACI,IAAI,KAAK,CAAC,EAAE;IACzB,OAAON,MAAM;EACf;EAEA,MAAMO,MAAM,GAAGC,MAAM,CAACC,OAAO,CAACT,MAAM,CAAC,CAACU,MAAM,CAC1C,CAACC,GAAG,EAAE,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;IACrB,IAAIX,UAAU,CAACY,GAAG,CAACF,GAAG,CAAC,EAAE;MACvBD,GAAG,CAACC,GAAG,CAAC,GAAGC,KAAK;IAClB,CAAC,MAAM,IAAID,GAAG,KAAK,cAAc,EAAE;MACjCD,GAAG,CAACI,YAAY,GAAGF,KAAK;IAC1B,CAAC,MAAM,IAAID,GAAG,KAAK,WAAW,EAAE;MAC9BD,GAAG,CAACK,SAAS,GAAGH,KAAK;IACvB;IAEA,OAAOF,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;EAED,OAAOJ,MAAM;AACf;AAEA,OAAO,SAASU,mBAAmBA,CAQjCC,OAA6B,EAC7BC,eAA+B,EAC/BC,YAA2B,EAC3BC,UAAoB,EAGtB;EACE,IAAInB,UAAuB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,CAAC,EACD,CAAC,CACH,CAAC;EACH,CAAC,CAAC;EAEF,MAAMoB,GAE2B,GAAG;IAChCC,aAAa,EAAEd,OAAO,CAACc,aAAa;IACpCR,IAAI,EAAEjB,MAAa;IACnB0B,UAAU,EAAGf,OAAO,CAAmCe;EACzD,CAAC;EAEH,OAAOF,GAAG;AAEZ;AACA,SAASF,SAASA,CAA6B7B,MAAS,EAAE;EACxD,MAAM;IAAE4B,KAAK;IAAE,GAAGM;EAAK,CAAC,GAAGlC,MAA0B;EACrD,OAAOkC,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,41 @@
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 { HttpResponse } from "msw";
18
+ import { OpenApiCallError } from "./util/handleOpenApiCall.js";
19
+ export function authHandlerMiddleware(handler) {
20
+ return async info => {
21
+ const authHeader = info.request.headers.get("authorization");
22
+ if (!authHeader || authHeader !== `Bearer myAccessToken`) {
23
+ return HttpResponse.json({
24
+ message: "Missing Authorization header"
25
+ }, {
26
+ status: 401
27
+ });
28
+ }
29
+ try {
30
+ return await handler(info);
31
+ } catch (e) {
32
+ if (e instanceof OpenApiCallError) {
33
+ return HttpResponse.json(e.json, {
34
+ status: e.status
35
+ });
36
+ }
37
+ throw e;
38
+ }
39
+ };
40
+ }
41
+ //# sourceMappingURL=authHandlerMiddleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authHandlerMiddleware.js","names":["HttpResponse","OpenApiCallError","authHandlerMiddleware","handler","info","authHeader","request","headers","get","json","message","status","e"],"sources":["authHandlerMiddleware.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 {\n type DefaultBodyType,\n HttpResponse,\n type HttpResponseResolver,\n type PathParams,\n} from \"msw\";\nimport { OpenApiCallError } from \"./util/handleOpenApiCall.js\";\n\nexport function authHandlerMiddleware<\n TReqBody extends DefaultBodyType = DefaultBodyType,\n TPathParams extends PathParams<string> = PathParams<string>,\n>(\n handler: HttpResponseResolver<TPathParams, TReqBody>,\n): HttpResponseResolver<TPathParams, TReqBody> {\n return async (info) => {\n const authHeader = info.request.headers.get(\"authorization\");\n\n if (!authHeader || authHeader !== `Bearer myAccessToken`) {\n return HttpResponse.json({ message: \"Missing Authorization header\" }, {\n status: 401,\n });\n }\n\n try {\n return await handler(info);\n } catch (e) {\n if (e instanceof OpenApiCallError) {\n return HttpResponse.json(e.json, { status: e.status });\n }\n throw e;\n }\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAEEA,YAAY,QAGP,KAAK;AACZ,SAASC,gBAAgB,QAAQ,6BAA6B;AAE9D,OAAO,SAASC,qBAAqBA,CAInCC,OAAoD,EACP;EAC7C,OAAO,MAAOC,IAAI,IAAK;IACrB,MAAMC,UAAU,GAAGD,IAAI,CAACE,OAAO,CAACC,OAAO,CAACC,GAAG,CAAC,eAAe,CAAC;IAE5D,IAAI,CAACH,UAAU,IAAIA,UAAU,KAAK,sBAAsB,EAAE;MACxD,OAAOL,YAAY,CAACS,IAAI,CAAC;QAAEC,OAAO,EAAE;MAA+B,CAAC,EAAE;QACpEC,MAAM,EAAE;MACV,CAAC,CAAC;IACJ;IAEA,IAAI;MACF,OAAO,MAAMR,OAAO,CAACC,IAAI,CAAC;IAC5B,CAAC,CAAC,OAAOQ,CAAC,EAAE;MACV,IAAIA,CAAC,YAAYX,gBAAgB,EAAE;QACjC,OAAOD,YAAY,CAACS,IAAI,CAACG,CAAC,CAACH,IAAI,EAAE;UAAEE,MAAM,EAAEC,CAAC,CAACD;QAAO,CAAC,CAAC;MACxD;MACA,MAAMC,CAAC;IACT;EACF,CAAC;AACH","ignoreList":[]}