@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,21 @@
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
+ // These are the shape of the errors that come back from the API.
18
+ export function isBaseApiError(error) {
19
+ return error && typeof error === "object" && "errorCode" in error && "errorName" in error && "errorInstanceId" in error;
20
+ }
21
+ //# sourceMappingURL=BaseError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseError.js","names":["isBaseApiError","error"],"sources":["BaseError.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\nexport interface BaseAPIError {\n errorCode: string;\n errorName: string;\n errorInstanceId: string;\n parameters: Record<string, any>;\n}\n\n// These are the shape of the errors that come back from the API.\nexport function isBaseApiError(error: any): error is BaseAPIError {\n return (\n error && typeof error === \"object\" && \"errorCode\" in error\n && \"errorName\" in error && \"errorInstanceId\" in error\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA,OAAO,SAASA,cAAcA,CAACC,KAAU,EAAyB;EAChE,OACEA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,WAAW,IAAIA,KAAK,IACvD,WAAW,IAAIA,KAAK,IAAI,iBAAiB,IAAIA,KAAK;AAEzD","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BaseOsdkObjectType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseOsdkObjectType.js","names":[],"sources":["BaseOsdkObjectType.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 interface BaseOsdkObjectType {\n $apiName: string;\n $primaryKey: string | number | boolean;\n\n [key: string]: string | number | boolean | undefined;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,30 @@
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
+ * A simplified type safe version of `OntologyObjectV2` that adds a tiny bit
19
+ * more strictness in that it declares the meaning of values for the `__` prefix
20
+ * props.
21
+ */
22
+
23
+ /**
24
+ * Helpful for distinguishing between an object that looks like it is for the server (__apiName)
25
+ * vs one that is for the client ($apiName).
26
+ */
27
+ export function isBaseServerObject(obj) {
28
+ return typeof obj === "object" && obj != null && "__primaryKey" in obj && "__apiName" in obj && !("$apiName" in obj) && !("$primaryKey" in obj);
29
+ }
30
+ //# sourceMappingURL=BaseServerObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseServerObject.js","names":["isBaseServerObject","obj"],"sources":["BaseServerObject.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\";\n\n/**\n * A simplified type safe version of `OntologyObjectV2` that adds a tiny bit\n * more strictness in that it declares the meaning of values for the `__` prefix\n * props.\n */\nexport interface BaseServerObject extends OntologiesV2.OntologyObjectV2 {\n __rid?: string;\n __primaryKey: string | number | boolean;\n __apiName: OntologiesV2.ObjectTypeApiName;\n __title?: string;\n\n [key: string]: unknown;\n}\n\n/**\n * Helpful for distinguishing between an object that looks like it is for the server (__apiName)\n * vs one that is for the client ($apiName).\n */\nexport function isBaseServerObject(obj: unknown): obj is BaseServerObject {\n return (\n typeof obj === \"object\"\n && obj != null\n && \"__primaryKey\" in obj\n && \"__apiName\" in obj\n && !(\"$apiName\" in obj)\n && !(\"$primaryKey\" in obj)\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA,OAAO,SAASA,kBAAkBA,CAACC,GAAY,EAA2B;EACxE,OACE,OAAOA,GAAG,KAAK,QAAQ,IACpBA,GAAG,IAAI,IAAI,IACX,cAAc,IAAIA,GAAG,IACrB,WAAW,IAAIA,GAAG,IAClB,EAAE,UAAU,IAAIA,GAAG,CAAC,IACpB,EAAE,aAAa,IAAIA,GAAG,CAAC;AAE9B","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FauxActionImpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FauxActionImpl.js","names":[],"sources":["FauxActionImpl.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 type { FauxAttachmentStore } from \"./FauxAttachmentStore.js\";\nimport type { FauxDataStoreBatch } from \"./FauxDataStoreBatch.js\";\nimport type { TH_ApplyActionRequestV2 } from \"./typeHelpers/TH_ApplyActionRequestV2.js\";\n\nexport type FauxActionImpl<\n Q extends OntologiesV2.ActionTypeV2 = OntologiesV2.ActionTypeV2,\n> = (\n batch: FauxDataStoreBatch,\n payload: TH_ApplyActionRequestV2<Q>,\n ctx: {\n def: Q;\n attachments: FauxAttachmentStore;\n },\n) => unknown;\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,60 @@
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 { OpenApiCallError } from "../handlers/util/handleOpenApiCall.js";
18
+ export class FauxAttachmentStore {
19
+ #attachments = new Map();
20
+ registerAttachment(attachment) {
21
+ this.#attachments.set(attachment.rid, attachment);
22
+ return this.getAttachmentMetadataByRid(attachment.rid);
23
+ }
24
+ getAttachmentMetadataByRid(attachmentRid) {
25
+ const attachment = this.#attachments.get(attachmentRid);
26
+ if (!attachment) {
27
+ throw new OpenApiCallError(404, {
28
+ errorCode: "NOT_FOUND",
29
+ errorName: "AttachmentNotFound",
30
+ errorInstanceId: "internal",
31
+ parameters: {
32
+ attachmentRid
33
+ }
34
+ });
35
+ }
36
+ const {
37
+ buffer,
38
+ ...metadata
39
+ } = attachment;
40
+ return {
41
+ ...metadata,
42
+ sizeBytes: String(buffer.byteLength)
43
+ };
44
+ }
45
+ getAttachmentBuffer(attachmentRid) {
46
+ const attachment = this.#attachments.get(attachmentRid);
47
+ if (!attachment) {
48
+ throw new OpenApiCallError(404, {
49
+ errorCode: "NOT_FOUND",
50
+ errorName: "AttachmentNotFound",
51
+ errorInstanceId: "internal",
52
+ parameters: {
53
+ attachmentRid
54
+ }
55
+ });
56
+ }
57
+ return attachment.buffer;
58
+ }
59
+ }
60
+ //# sourceMappingURL=FauxAttachmentStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FauxAttachmentStore.js","names":["OpenApiCallError","FauxAttachmentStore","attachments","Map","registerAttachment","attachment","set","rid","getAttachmentMetadataByRid","attachmentRid","get","errorCode","errorName","errorInstanceId","parameters","buffer","metadata","sizeBytes","String","byteLength","getAttachmentBuffer"],"sources":["FauxAttachmentStore.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 * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport { OpenApiCallError } from \"../handlers/util/handleOpenApiCall.js\";\n\nexport interface FauxAttachmentInfo\n extends Omit<OntologiesV2.AttachmentV2, \"sizeBytes\">\n{\n buffer: ArrayBuffer;\n}\n\nexport class FauxAttachmentStore {\n #attachments = new Map<string, FauxAttachmentInfo>();\n\n registerAttachment(\n attachment: FauxAttachmentInfo,\n ): OntologiesV2.AttachmentV2 {\n this.#attachments.set(attachment.rid, attachment);\n return this.getAttachmentMetadataByRid(attachment.rid);\n }\n\n getAttachmentMetadataByRid(attachmentRid: string): OntologiesV2.AttachmentV2 {\n const attachment = this.#attachments.get(attachmentRid);\n if (!attachment) {\n throw new OpenApiCallError(\n 404,\n {\n errorCode: \"NOT_FOUND\",\n errorName: \"AttachmentNotFound\",\n errorInstanceId: \"internal\",\n parameters: { attachmentRid },\n } satisfies OntologiesV2.AttachmentNotFound,\n );\n }\n\n const { buffer, ...metadata } = attachment;\n\n return {\n ...metadata,\n sizeBytes: String(buffer.byteLength),\n };\n }\n\n getAttachmentBuffer(attachmentRid: string): ArrayBuffer {\n const attachment = this.#attachments.get(attachmentRid);\n if (!attachment) {\n throw new OpenApiCallError(\n 404,\n {\n errorCode: \"NOT_FOUND\",\n errorName: \"AttachmentNotFound\",\n errorInstanceId: \"internal\",\n parameters: { attachmentRid },\n } satisfies OntologiesV2.AttachmentNotFound,\n );\n }\n return attachment.buffer;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,gBAAgB,QAAQ,uCAAuC;AAQxE,OAAO,MAAMC,mBAAmB,CAAC;EAC/B,CAACC,WAAW,GAAG,IAAIC,GAAG,CAA6B,CAAC;EAEpDC,kBAAkBA,CAChBC,UAA8B,EACH;IAC3B,IAAI,CAAC,CAACH,WAAW,CAACI,GAAG,CAACD,UAAU,CAACE,GAAG,EAAEF,UAAU,CAAC;IACjD,OAAO,IAAI,CAACG,0BAA0B,CAACH,UAAU,CAACE,GAAG,CAAC;EACxD;EAEAC,0BAA0BA,CAACC,aAAqB,EAA6B;IAC3E,MAAMJ,UAAU,GAAG,IAAI,CAAC,CAACH,WAAW,CAACQ,GAAG,CAACD,aAAa,CAAC;IACvD,IAAI,CAACJ,UAAU,EAAE;MACf,MAAM,IAAIL,gBAAgB,CACxB,GAAG,EACH;QACEW,SAAS,EAAE,WAAW;QACtBC,SAAS,EAAE,oBAAoB;QAC/BC,eAAe,EAAE,UAAU;QAC3BC,UAAU,EAAE;UAAEL;QAAc;MAC9B,CACF,CAAC;IACH;IAEA,MAAM;MAAEM,MAAM;MAAE,GAAGC;IAAS,CAAC,GAAGX,UAAU;IAE1C,OAAO;MACL,GAAGW,QAAQ;MACXC,SAAS,EAAEC,MAAM,CAACH,MAAM,CAACI,UAAU;IACrC,CAAC;EACH;EAEAC,mBAAmBA,CAACX,aAAqB,EAAe;IACtD,MAAMJ,UAAU,GAAG,IAAI,CAAC,CAACH,WAAW,CAACQ,GAAG,CAACD,aAAa,CAAC;IACvD,IAAI,CAACJ,UAAU,EAAE;MACf,MAAM,IAAIL,gBAAgB,CACxB,GAAG,EACH;QACEW,SAAS,EAAE,WAAW;QACtBC,SAAS,EAAE,oBAAoB;QAC/BC,eAAe,EAAE,UAAU;QAC3BC,UAAU,EAAE;UAAEL;QAAc;MAC9B,CACF,CAAC;IACH;IACA,OAAOJ,UAAU,CAACU,MAAM;EAC1B;AACF","ignoreList":[]}
@@ -0,0 +1,470 @@
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 { DefaultMap, MultiMap } from "mnemonist";
18
+ import { randomUUID } from "node:crypto";
19
+ import * as crypto from "node:crypto";
20
+ import invariant from "tiny-invariant";
21
+ import { InvalidRequest, ObjectNotFoundError } from "../errors.js";
22
+ import { subSelectProperties } from "../filterObjects.js";
23
+ import { getPaginationParamsFromRequest } from "../handlers/util/getPaginationParams.js";
24
+ import { OpenApiCallError } from "../handlers/util/handleOpenApiCall.js";
25
+ import { pageThroughResponseSearchParams } from "../handlers/util/pageThroughResponseSearchParams.js";
26
+ import { isBaseServerObject } from "./BaseServerObject.js";
27
+ import { FauxDataStoreBatch } from "./FauxDataStoreBatch.js";
28
+ import { filterTimeSeriesData } from "./filterTimeSeriesData.js";
29
+ import { createOrderBySortFn, getObjectsFromSet } from "./getObjectsFromSet.js";
30
+ import { objectLocator, parseLocator } from "./ObjectLocator.js";
31
+ import { validateAction } from "./validateAction.js";
32
+
33
+ /**
34
+ * Represents the properties needed to create an object, specifically,
35
+ * the properties of the object and the $apiName
36
+ */
37
+
38
+ /**
39
+ * Helper type for converting `foo: string | undefined` into `foo?: string`
40
+ */
41
+
42
+ /**
43
+ * Type safe object for representing "client" side objects.
44
+ */
45
+
46
+ export class FauxDataStore {
47
+ #objects = new DefaultMap(() => new Map());
48
+ #singleLinks = new DefaultMap(() => new Map());
49
+ #manyLinks = new DefaultMap(() => new MultiMap(Set));
50
+ #fauxOntology;
51
+ #attachments;
52
+ #timeSeriesData = new DefaultMap(() => new DefaultMap(() => new DefaultMap(() => [])));
53
+ #media = new DefaultMap(() => new DefaultMap(() => {
54
+ return new Map();
55
+ }));
56
+ constructor(fauxOntology, attachments) {
57
+ this.#fauxOntology = fauxOntology;
58
+ this.#attachments = attachments;
59
+ }
60
+
61
+ /**
62
+ * Removes all data that is associated with a namespace/ontology.
63
+ *
64
+ * Note: does not clear `attachments` nor does it clear the ontology itself.
65
+ */
66
+ clear() {
67
+ this.#media.clear();
68
+ this.#timeSeriesData.clear();
69
+ this.#manyLinks.clear();
70
+ this.#singleLinks.clear();
71
+ this.#objects.clear();
72
+ }
73
+ get ontology() {
74
+ return this.#fauxOntology;
75
+ }
76
+ #assertObjectExists(objectType, primaryKey) {
77
+ if (!this.getObject(objectType, primaryKey)) {
78
+ throw new OpenApiCallError(404, ObjectNotFoundError(objectType, String(primaryKey)));
79
+ }
80
+ }
81
+ #assertObjectDoesNotExist(objectType, primaryKey) {
82
+ if (this.getObject(objectType, primaryKey)) {
83
+ throw new OpenApiCallError(500, {
84
+ errorCode: "CONFLICT",
85
+ errorName: "ObjectAlreadyExists",
86
+ errorInstanceId: "faux-foundry",
87
+ parameters: {
88
+ objectType,
89
+ primaryKey: String(primaryKey)
90
+ }
91
+ });
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Version for use in places like @osdk/client.
97
+ *
98
+ * @param obj An `Osdk.Instance` like object for the ObjectType in the generics
99
+ */
100
+
101
+ /**
102
+ * Version of register object generally used in shared.test
103
+ * @param obj A raw server side representation of an object
104
+ *
105
+ * Don't use, its too easy to end up with an any.
106
+ */
107
+
108
+ registerObject(objectType, anyObj) {
109
+ let bso;
110
+ // obj = { ...obj }; // make a copy so we can mutate it
111
+
112
+ if (isBaseServerObject(objectType)) {
113
+ !(anyObj == null) ? process.env.NODE_ENV !== "production" ? invariant(false, "Internal overload should only pass one argument") : invariant(false) : void 0;
114
+ !!Object.keys(objectType).some(s => s.startsWith("$")) ? process.env.NODE_ENV !== "production" ? invariant(false, "Object should not have any keys starting with $ if it has __apiName") : invariant(false) : void 0;
115
+ bso = objectType;
116
+ } else if (anyObj == null) {
117
+ process.env.NODE_ENV !== "production" ? invariant(false, "should not be possible due to overloads") : invariant(false);
118
+ } else if (isBaseServerObject(anyObj)) {
119
+ !!Object.keys(anyObj).some(s => s.startsWith("$")) ? process.env.NODE_ENV !== "production" ? invariant(false, "Object should not have any keys starting with $ if it has __apiName") : invariant(false) : void 0;
120
+ bso = anyObj;
121
+ } else {
122
+ bso = this.#osdkCreatableToBso(objectType, anyObj);
123
+ }
124
+ const apiName = bso.__apiName || bso.$apiName;
125
+ !apiName ? process.env.NODE_ENV !== "production" ? invariant(false, "Object should have an __apiName or $apiName") : invariant(false) : void 0;
126
+ this.#assertObjectDoesNotExist(apiName, bso.__primaryKey);
127
+ if (!("__apiName" in bso && "__primaryKey" in bso)) {
128
+ !("$apiName" in bso && "$primaryKey" in bso) ? process.env.NODE_ENV !== "production" ? invariant(false, "Object should have (__apiName and __primaryKey) or ($apiName and $primaryKey)") : invariant(false) : void 0;
129
+ const {
130
+ $apiName,
131
+ $primaryKey,
132
+ ...others
133
+ } = bso;
134
+ bso = {
135
+ __apiName: $apiName,
136
+ __primaryKey: $primaryKey,
137
+ ...others
138
+ };
139
+ }
140
+ this.#assertObjectDoesNotExist(bso.__apiName, bso.__primaryKey);
141
+ this.#objects.get(bso.__apiName).set(String(bso.__primaryKey), Object.freeze({
142
+ ...bso
143
+ }));
144
+ }
145
+ #osdkCreatableToBso(objectType, anyObj) {
146
+ objectType = typeof objectType === "string" ? objectType : objectType.apiName;
147
+ if ("$apiName" in anyObj) {
148
+ !(anyObj.$apiName === objectType) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
149
+ }
150
+ const {
151
+ $apiName,
152
+ $primaryKey,
153
+ ...others
154
+ } = anyObj;
155
+ const meta = this.ontology.getObjectTypeFullMetadataOrThrow(objectType);
156
+ const realPrimaryKey = anyObj[meta.objectType.primaryKey];
157
+ const maybeTitle = anyObj[meta.objectType.titleProperty];
158
+ const rid = anyObj.$rid ?? `ri.phonograph2-objects.main.object.${crypto.randomUUID()}`;
159
+ !(realPrimaryKey != null) ? process.env.NODE_ENV !== "production" ? invariant(false, `Object should have a primary key. ${JSON.stringify(anyObj)}`) : invariant(false) : void 0;
160
+ !($primaryKey == null || $primaryKey === realPrimaryKey) ? process.env.NODE_ENV !== "production" ? invariant(false, "Primary key mismatch") : invariant(false) : void 0;
161
+ return {
162
+ __apiName: objectType,
163
+ __primaryKey: realPrimaryKey,
164
+ __title: maybeTitle ? String(maybeTitle) : undefined,
165
+ __rid: rid,
166
+ ...others
167
+ };
168
+ }
169
+ replaceObjectOrThrow(x) {
170
+ this.#assertObjectExists(x.__apiName, x.__primaryKey);
171
+ this.#objects.get(x.__apiName).set(String(x.__primaryKey), x);
172
+ }
173
+
174
+ /** Throws if the object does not already exist */
175
+ unregisterObjectOrThrow(objectType, primaryKey) {
176
+ this.#assertObjectExists(objectType, primaryKey);
177
+ this.#objects.get(objectType).delete(String(primaryKey));
178
+ }
179
+ registerLink(src, srcLinkName, dst, destLinkName) {
180
+ const srcLocator = objectLocator(src);
181
+ const dstLocator = objectLocator(dst);
182
+ const [srcSide, dstSide] = this.#fauxOntology.getBothLinkTypeSides(src.__apiName, srcLinkName, dst.__apiName);
183
+ !(srcSide.linkTypeRid === dstSide.linkTypeRid) ? process.env.NODE_ENV !== "production" ? invariant(false, `Expected both sides of the link to have the same rid, but got ${srcSide.linkTypeRid} and ${dstSide.linkTypeRid}`) : invariant(false) : void 0;
184
+ !(dstSide.apiName === destLinkName) ? process.env.NODE_ENV !== "production" ? invariant(false, `Link name mismatch on dst side. Expected ${destLinkName} but found ${dstSide.apiName}`) : invariant(false) : void 0;
185
+ this.#updateSingleLinkSide(srcSide, srcLocator, dstSide, dstLocator);
186
+ this.#updateSingleLinkSide(dstSide, dstLocator, srcSide, srcLocator);
187
+ }
188
+ unregisterLink(src, srcLinkName, dst, dstLinkName) {
189
+ const srcLocator = objectLocator(src);
190
+ const dstLocator = objectLocator(dst);
191
+ const [srcSide, dstSide] = this.#fauxOntology.getBothLinkTypeSides(src.__apiName, srcLinkName, dst.__apiName);
192
+ !(dstSide.apiName === dstLinkName) ? process.env.NODE_ENV !== "production" ? invariant(false, `Link name mismatch on dst side. Expected ${dstLinkName} but found ${dstSide.apiName}`) : invariant(false) : void 0;
193
+ this.#removeSingleSideOfLink(srcLocator, srcSide, dstLocator);
194
+ this.#removeSingleSideOfLink(dstLocator, dstSide, srcLocator);
195
+ }
196
+ registerTimeSeriesData(objectType, primaryKey, property, data) {
197
+ this.getObjectOrThrow(objectType, primaryKey);
198
+ const def = this.ontology.getObjectTypeFullMetadataOrThrow(objectType);
199
+ !(def.objectType.properties[property].dataType.type === "timeseries" || def.objectType.properties[property].dataType.type === "geotimeSeriesReference") ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
200
+ this.#timeSeriesData.get(objectType).get(String(primaryKey)).set(property, data);
201
+ }
202
+ getTimeSeriesData(objectType, primaryKey, property, filter) {
203
+ this.getObjectOrThrow(objectType, primaryKey);
204
+ const allData = this.#timeSeriesData.get(objectType).get(String(primaryKey)).get(property);
205
+ if (!filter) return allData;
206
+ return filterTimeSeriesData(allData, filter);
207
+ }
208
+ #updateSingleLinkSide(srcSide, srcLocator, dstSide, dstLocator) {
209
+ const srcLinkName = srcSide.apiName;
210
+ if (srcSide.cardinality === "ONE") {
211
+ const linkNameToObj = this.#singleLinks.get(srcLocator);
212
+ const oldLocator = linkNameToObj.get(srcLinkName);
213
+ if (oldLocator && oldLocator !== dstLocator) {
214
+ // we need to remove the other side's old value
215
+ this.#removeSingleSideOfLink(oldLocator, dstSide, srcLocator);
216
+ }
217
+ linkNameToObj.set(srcLinkName, dstLocator);
218
+ } else if (srcSide.cardinality === "MANY") {
219
+ const linkNameToObj = this.#manyLinks.get(srcLocator);
220
+ linkNameToObj.set(srcLinkName, dstLocator);
221
+ } else {
222
+ // "never" case
223
+ throw new Error("unexpected cardinality: " + srcSide.cardinality);
224
+ }
225
+ }
226
+ registerMedia(objectType, property, content, mediaType, path,
227
+ // This should be the correct prefix, per
228
+ // https://github.com/palantir/osdk-ts/pull/1303#discussion_r2001989395
229
+ mediaItemRid = `ri.mio.main.media-item.${randomUUID()}`) {
230
+ const mediaRef = Object.freeze({
231
+ mimeType: mediaType,
232
+ reference: Object.freeze({
233
+ type: "mediaSetViewItem",
234
+ mediaSetViewItem: Object.freeze({
235
+ mediaItemRid,
236
+ mediaSetRid: "ri.unimplemented.in.shared.test",
237
+ mediaSetViewRid: "ri.unimplemented.in.shared.test"
238
+ })
239
+ })
240
+ });
241
+ this.#media.get(objectType).get(property).set(mediaItemRid, Object.freeze({
242
+ content,
243
+ mediaRef,
244
+ metaData: Object.freeze({
245
+ mediaType,
246
+ path,
247
+ sizeBytes: String(content.byteLength)
248
+ })
249
+ }));
250
+ return mediaRef;
251
+ }
252
+ getMediaOrThrow(objectType, primaryKey, property) {
253
+ const obj = this.getObjectOrThrow(objectType, primaryKey);
254
+ const propertyDef = this.ontology.getObjectTypeFullMetadataOrThrow(objectType).objectType.properties[property];
255
+ if (!propertyDef) {
256
+ // This should be the correct error, per
257
+ // https://github.com/palantir/osdk-ts/pull/1303#discussion_r2001968959
258
+ throw new OpenApiCallError(400, {
259
+ errorCode: "NOT_FOUND",
260
+ errorName: "PropertiesNotFound",
261
+ errorInstanceId: "faux-foundry",
262
+ parameters: {
263
+ objectType,
264
+ properties: [property]
265
+ }
266
+ });
267
+ }
268
+ if (propertyDef.dataType.type !== "mediaReference") {
269
+ // FIXME: what would the backend do here?
270
+ throw new OpenApiCallError(400, {
271
+ errorCode: "INVALID_ARGUMENT",
272
+ errorName: "InvalidPropertyType",
273
+ errorInstanceId: "faux-foundry",
274
+ parameters: {
275
+ property,
276
+ propertyBaseType: propertyDef.dataType.type
277
+ }
278
+ });
279
+ }
280
+ const rid = obj[property].reference.mediaSetViewItem.mediaItemRid;
281
+ if (!rid || !rid.startsWith("ri.")) {
282
+ throw new OpenApiCallError(400, {
283
+ errorCode: "INVALID_ARGUMENT",
284
+ errorName: "InvalidPropertyValue",
285
+ errorInstanceId: "faux-foundry",
286
+ parameters: {
287
+ property,
288
+ propertyBaseType: propertyDef.dataType.type,
289
+ propertyValue: rid
290
+ }
291
+ });
292
+ }
293
+ const ret = this.#media.get(objectType).get(property).get(rid);
294
+ if (!ret) {
295
+ throw new OpenApiCallError(400, InvalidRequest("Invalid parameters"));
296
+ }
297
+ return ret;
298
+ }
299
+ #removeSingleSideOfLink(locator, linkSide, expectedPriorValue) {
300
+ const destLinkName = linkSide.apiName;
301
+ if (linkSide.cardinality === "ONE") {
302
+ const links = this.#singleLinks.get(locator);
303
+ !(links.get(destLinkName) === expectedPriorValue) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
304
+ links.delete(destLinkName);
305
+ } else {
306
+ const links = this.#manyLinks.get(locator);
307
+ !links.get(destLinkName)?.has(expectedPriorValue) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
308
+ links.remove(destLinkName, expectedPriorValue);
309
+ }
310
+ }
311
+ getObject(apiName, primaryKey) {
312
+ return this.#objects.get(apiName).get(String(primaryKey));
313
+ }
314
+ getObjectOrThrow(apiName, primaryKey) {
315
+ const object = this.getObject(apiName, primaryKey);
316
+ if (!object) {
317
+ throw new OpenApiCallError(404, ObjectNotFoundError(apiName, String(primaryKey)));
318
+ }
319
+ return object;
320
+ }
321
+ getObjectByRid(rid) {
322
+ for (const [, pkToObjects] of this.#objects) {
323
+ for (const [, obj] of pkToObjects) {
324
+ if (obj.__rid === rid) {
325
+ return obj;
326
+ }
327
+ }
328
+ }
329
+ }
330
+ getLinksOrThrow(apiName, primaryKey, linkApiName) {
331
+ const object = this.getObjectOrThrow(apiName, primaryKey);
332
+ const linkTypeSide = this.#fauxOntology.getLinkTypeSideV2(apiName, linkApiName);
333
+ if (linkTypeSide.cardinality === "ONE") {
334
+ const locator = this.#singleLinks.get(objectLocator(object)).get(linkApiName);
335
+ if (locator === undefined) {
336
+ return [];
337
+ }
338
+ const {
339
+ objectType,
340
+ primaryKey
341
+ } = parseLocator(locator);
342
+ return [this.getObjectOrThrow(objectType, primaryKey)]; // will throw if not found
343
+ } else {
344
+ const locators = this.#manyLinks.get(objectLocator(object)).get(linkApiName);
345
+ return Array.from(locators ?? []).map(a => {
346
+ const [objectType, primaryKey] = a.split(":") ?? [];
347
+ !(objectType && primaryKey) ? process.env.NODE_ENV !== "production" ? invariant(false, "Invalid locator format") : invariant(false) : void 0;
348
+ return this.getObjectOrThrow(objectType, primaryKey);
349
+ });
350
+ }
351
+ }
352
+ getLinkOrThrow(objectType, primaryKey, linkType, targetPrimaryKey) {
353
+ const allLinks = this.getLinksOrThrow(objectType, primaryKey, linkType);
354
+ const object = allLinks.filter(l => String(l.__primaryKey) === targetPrimaryKey)[0];
355
+ if (!object) {
356
+ throw new OpenApiCallError(404, ObjectNotFoundError(`${objectType} -> ${linkType}`, String(targetPrimaryKey)));
357
+ }
358
+ return object;
359
+ }
360
+ getObjectsOfType(apiName) {
361
+ return this.#objects.get(apiName).values();
362
+ }
363
+ getObjectsFromObjectSet(parsedBody) {
364
+ const selected = parsedBody.select;
365
+ // when we have interfaces in here, we have a little trick for
366
+ // caching off the important properties
367
+ let objects = getObjectsFromSet(this, parsedBody.objectSet, undefined);
368
+ if (!objects) {
369
+ return {
370
+ data: [],
371
+ totalCount: "0",
372
+ nextPageToken: undefined
373
+ };
374
+ }
375
+ if (parsedBody.orderBy) {
376
+ objects = objects.sort(createOrderBySortFn(parsedBody.orderBy));
377
+ }
378
+
379
+ // finally, if we got interfaces, the objects have names like the interface and we need
380
+ // to return them like the object.
381
+
382
+ const page = pageThroughResponseSearchParams(objects, getPaginationParamsFromRequest(parsedBody), false);
383
+ if (!page) {
384
+ throw new OpenApiCallError(404, InvalidRequest(`No objects found for ${JSON.stringify(parsedBody)}`));
385
+ }
386
+ const ret = subSelectProperties(page, [...selected], true, parsedBody.excludeRid);
387
+ return ret;
388
+ }
389
+ getAttachmentMetadata(objectType, primaryKey, propertyName) {
390
+ const rid = this.getObjectOrThrow(objectType, primaryKey)[propertyName];
391
+ return this.#attachments.getAttachmentMetadataByRid(rid);
392
+ }
393
+ getAttachmentBuffer(objectType, primaryKey, propertyName) {
394
+ const rid = this.getObjectOrThrow(objectType, primaryKey)[propertyName];
395
+ return this.#attachments.getAttachmentBuffer(rid);
396
+ }
397
+ applyAction(actionTypeApiName, req) {
398
+ const actionDef = this.#fauxOntology.getActionDef(actionTypeApiName);
399
+ const actionImpl = this.#fauxOntology.getActionImpl(actionTypeApiName);
400
+ const validation = validateAction(req, actionDef, this);
401
+ if (validation.result === "INVALID") {
402
+ return {
403
+ validation
404
+ };
405
+ }
406
+ const batch = new FauxDataStoreBatch(this);
407
+ const r = actionImpl(batch, req, {
408
+ def: actionDef,
409
+ attachments: this.#attachments
410
+ });
411
+
412
+ // The legacy actions return the full payload
413
+ // they want to return, so we need to do that
414
+ // but the future is for the actionImpl's to
415
+ // return void and to do validation details here
416
+ if (r) return r;
417
+ return {
418
+ validation: {
419
+ parameters: {},
420
+ result: "VALID",
421
+ submissionCriteria: []
422
+ },
423
+ edits: req.options?.mode === "VALIDATE_AND_EXECUTE" && (req.options.returnEdits === "ALL" || req.options.returnEdits === "ALL_V2_WITH_DELETIONS") ? {
424
+ type: "edits",
425
+ ...batch.objectEdits
426
+ } : undefined
427
+ };
428
+ }
429
+ batchApplyAction(actionTypeApiName, batchReq) {
430
+ const actionDef = this.#fauxOntology.getActionDef(actionTypeApiName);
431
+ const actionImpl = this.#fauxOntology.getActionImpl(actionTypeApiName);
432
+ for (const req of batchReq.requests) {
433
+ const result = validateAction(req, actionDef, this);
434
+ if (result.result === "INVALID") {
435
+ throw new OpenApiCallError(500, {
436
+ errorCode: "INVALID_ARGUMENT",
437
+ errorName: "ActionValidationFailed",
438
+ errorInstanceId: "faux-foundry",
439
+ parameters: {
440
+ actionType: actionTypeApiName
441
+ }
442
+ });
443
+ }
444
+ }
445
+ const batch = new FauxDataStoreBatch(this);
446
+ for (const item of batchReq.requests) {
447
+ actionImpl(batch, {
448
+ ...item,
449
+ options: {
450
+ mode: "VALIDATE_AND_EXECUTE",
451
+ returnEdits: batchReq.options?.returnEdits
452
+ }
453
+ }, {
454
+ def: actionDef,
455
+ attachments: this.#attachments
456
+ });
457
+ }
458
+ if (batchReq.options?.returnEdits === "NONE") {
459
+ return {};
460
+ }
461
+ return {
462
+ edits: {
463
+ type: "edits",
464
+ ...batch.objectEdits,
465
+ edits: batch.objectEdits.edits.filter(x => x.type !== "deleteObject" && x.type !== "deleteLink")
466
+ }
467
+ };
468
+ }
469
+ }
470
+ //# sourceMappingURL=FauxDataStore.js.map