@osdk/client 2.0.0-beta.8 → 2.0.0

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 (605) hide show
  1. package/CHANGELOG.md +284 -0
  2. package/build/browser/Client.d.ts +39 -0
  3. package/build/browser/Client.d.ts.map +1 -0
  4. package/build/browser/Client.js +20 -0
  5. package/build/browser/Client.js.map +1 -0
  6. package/build/browser/Definitions.test.d.ts +2 -0
  7. package/build/browser/Definitions.test.d.ts.map +1 -0
  8. package/build/browser/Definitions.test.js +35 -0
  9. package/build/browser/Definitions.test.js.map +1 -0
  10. package/build/browser/Logger.d.ts +19 -0
  11. package/build/browser/Logger.d.ts.map +1 -0
  12. package/build/browser/Logger.js +17 -0
  13. package/build/browser/Logger.js.map +1 -0
  14. package/build/browser/MinimalClientContext.d.ts +26 -0
  15. package/build/browser/MinimalClientContext.d.ts.map +1 -0
  16. package/build/browser/MinimalClientContext.js +17 -0
  17. package/build/browser/MinimalClientContext.js.map +1 -0
  18. package/build/browser/ResultOrError.d.ts +12 -0
  19. package/build/browser/ResultOrError.d.ts.map +1 -0
  20. package/build/browser/ResultOrError.js +19 -0
  21. package/build/browser/ResultOrError.js.map +1 -0
  22. package/build/browser/SatisfiesSemver.d.ts +4 -0
  23. package/build/browser/SatisfiesSemver.d.ts.map +1 -0
  24. package/build/browser/SatisfiesSemver.js +17 -0
  25. package/build/browser/SatisfiesSemver.js.map +1 -0
  26. package/build/browser/SatisfiesSemver.test.d.ts +2 -0
  27. package/build/browser/SatisfiesSemver.test.d.ts.map +1 -0
  28. package/build/browser/SatisfiesSemver.test.js +69 -0
  29. package/build/browser/SatisfiesSemver.test.js.map +1 -0
  30. package/build/browser/__unstable/ConjureSupport.d.ts +55 -0
  31. package/build/browser/__unstable/ConjureSupport.d.ts.map +1 -0
  32. package/build/browser/__unstable/ConjureSupport.js +174 -0
  33. package/build/browser/__unstable/ConjureSupport.js.map +1 -0
  34. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts +10 -0
  35. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -0
  36. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js +114 -0
  37. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -0
  38. package/build/browser/actions/ActionValidationError.d.ts +6 -0
  39. package/build/browser/actions/ActionValidationError.d.ts.map +1 -0
  40. package/build/browser/actions/ActionValidationError.js +23 -0
  41. package/build/browser/actions/ActionValidationError.js.map +1 -0
  42. package/build/browser/actions/actions.test.d.ts +2 -0
  43. package/build/browser/actions/actions.test.d.ts.map +1 -0
  44. package/build/browser/actions/actions.test.js +323 -0
  45. package/build/browser/actions/actions.test.js.map +1 -0
  46. package/build/browser/actions/applyAction.d.ts +30 -0
  47. package/build/browser/actions/applyAction.d.ts.map +1 -0
  48. package/build/browser/actions/applyAction.js +114 -0
  49. package/build/browser/actions/applyAction.js.map +1 -0
  50. package/build/browser/createAttachmentFromRid.d.ts +10 -0
  51. package/build/browser/createAttachmentFromRid.d.ts.map +1 -0
  52. package/build/browser/createAttachmentFromRid.js +38 -0
  53. package/build/browser/createAttachmentFromRid.js.map +1 -0
  54. package/build/browser/createClient.d.ts +6 -0
  55. package/build/browser/createClient.d.ts.map +1 -0
  56. package/build/browser/createClient.js +88 -0
  57. package/build/browser/createClient.js.map +1 -0
  58. package/build/browser/createClient.test.d.ts +2 -0
  59. package/build/browser/createClient.test.d.ts.map +1 -0
  60. package/build/browser/createClient.test.js +45 -0
  61. package/build/browser/createClient.test.js.map +1 -0
  62. package/build/browser/createMinimalClient.d.ts +2 -0
  63. package/build/browser/createMinimalClient.d.ts.map +1 -0
  64. package/build/browser/createMinimalClient.js +42 -0
  65. package/build/browser/createMinimalClient.js.map +1 -0
  66. package/build/browser/createPlatformClient.d.ts +17 -0
  67. package/build/browser/createPlatformClient.d.ts.map +1 -0
  68. package/build/browser/createPlatformClient.js +33 -0
  69. package/build/browser/createPlatformClient.js.map +1 -0
  70. package/build/browser/createTimeseriesProperty.d.ts +14 -0
  71. package/build/browser/createTimeseriesProperty.d.ts.map +1 -0
  72. package/build/browser/createTimeseriesProperty.js +79 -0
  73. package/build/browser/createTimeseriesProperty.js.map +1 -0
  74. package/build/browser/definitions/LinkDefinitions.test.d.ts +2 -0
  75. package/build/browser/definitions/LinkDefinitions.test.d.ts.map +1 -0
  76. package/build/browser/definitions/LinkDefinitions.test.js +41 -0
  77. package/build/browser/definitions/LinkDefinitions.test.js.map +1 -0
  78. package/build/browser/fetchMetadata.d.ts +2 -0
  79. package/build/browser/fetchMetadata.d.ts.map +1 -0
  80. package/build/browser/fetchMetadata.js +35 -0
  81. package/build/browser/fetchMetadata.js.map +1 -0
  82. package/build/browser/fetchMetadata.test.d.ts +2 -0
  83. package/build/browser/fetchMetadata.test.d.ts.map +1 -0
  84. package/build/browser/fetchMetadata.test.js +218 -0
  85. package/build/browser/fetchMetadata.test.js.map +1 -0
  86. package/build/browser/index.d.ts +13 -0
  87. package/build/browser/index.d.ts.map +1 -0
  88. package/build/browser/index.js +22 -12
  89. package/build/browser/index.js.map +1 -1
  90. package/build/browser/intellisense.test.d.ts +2 -0
  91. package/build/browser/intellisense.test.d.ts.map +1 -0
  92. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +2 -0
  93. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +1 -0
  94. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js +25 -0
  95. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -0
  96. package/build/browser/intellisense.test.js +86 -0
  97. package/build/browser/intellisense.test.js.map +1 -0
  98. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts +2 -0
  99. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +1 -0
  100. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js +34 -0
  101. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -0
  102. package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts +2 -0
  103. package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts.map +1 -0
  104. package/build/browser/internal/conversions/modernToLegacyAggregationClause.js +38 -0
  105. package/build/browser/internal/conversions/modernToLegacyAggregationClause.js.map +1 -0
  106. package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts +2 -0
  107. package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts.map +1 -0
  108. package/build/browser/internal/conversions/modernToLegacyGroupByClause.js +62 -0
  109. package/build/browser/internal/conversions/modernToLegacyGroupByClause.js.map +1 -0
  110. package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts +2 -0
  111. package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts.map +1 -0
  112. package/build/browser/internal/conversions/modernToLegacyWhereClause.js +144 -0
  113. package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -0
  114. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts +2 -0
  115. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +1 -0
  116. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +486 -0
  117. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -0
  118. package/build/browser/object/AttachmentUpload.d.ts +4 -0
  119. package/build/browser/object/AttachmentUpload.d.ts.map +1 -0
  120. package/build/browser/object/AttachmentUpload.js +27 -0
  121. package/build/browser/object/AttachmentUpload.js.map +1 -0
  122. package/build/browser/object/Cache.d.ts +2 -0
  123. package/build/browser/object/Cache.d.ts.map +1 -0
  124. package/build/browser/object/Cache.js +76 -0
  125. package/build/browser/object/Cache.js.map +1 -0
  126. package/build/browser/object/Cache.test.d.ts +11 -0
  127. package/build/browser/object/Cache.test.d.ts.map +1 -0
  128. package/build/browser/object/Cache.test.js +283 -0
  129. package/build/browser/object/Cache.test.js.map +1 -0
  130. package/build/browser/object/SimpleCache.d.ts +38 -0
  131. package/build/browser/object/SimpleCache.d.ts.map +1 -0
  132. package/build/browser/object/SimpleCache.js +67 -0
  133. package/build/browser/object/SimpleCache.js.map +1 -0
  134. package/build/browser/object/aggregate.d.ts +2 -0
  135. package/build/browser/object/aggregate.d.ts.map +1 -0
  136. package/build/browser/object/aggregate.js +69 -0
  137. package/build/browser/object/aggregate.js.map +1 -0
  138. package/build/browser/object/aggregate.test.d.ts +2 -0
  139. package/build/browser/object/aggregate.test.d.ts.map +1 -0
  140. package/build/browser/object/aggregate.test.js +398 -0
  141. package/build/browser/object/aggregate.test.js.map +1 -0
  142. package/build/browser/object/attachment.test.d.ts +2 -0
  143. package/build/browser/object/attachment.test.d.ts.map +1 -0
  144. package/build/browser/object/attachment.test.js +55 -0
  145. package/build/browser/object/attachment.test.js.map +1 -0
  146. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +11 -0
  147. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -0
  148. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js +17 -0
  149. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -0
  150. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts +13 -0
  151. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -0
  152. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js +22 -0
  153. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -0
  154. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts +2 -0
  155. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +1 -0
  156. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js +17 -0
  157. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -0
  158. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +2 -0
  159. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -0
  160. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +48 -0
  161. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -0
  162. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +8 -0
  163. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +1 -0
  164. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +17 -0
  165. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -0
  166. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +2 -0
  167. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +1 -0
  168. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +82 -0
  169. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -0
  170. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts +2 -0
  171. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +1 -0
  172. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +114 -0
  173. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -0
  174. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts +3 -0
  175. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -0
  176. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +55 -0
  177. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -0
  178. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts +2 -0
  179. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +1 -0
  180. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +60 -0
  181. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -0
  182. package/build/browser/object/convertWireToOsdkObjects.d.ts +2 -0
  183. package/build/browser/object/convertWireToOsdkObjects.d.ts.map +1 -0
  184. package/build/browser/object/convertWireToOsdkObjects.js +150 -0
  185. package/build/browser/object/convertWireToOsdkObjects.js.map +1 -0
  186. package/build/browser/object/convertWireToOsdkObjects.test.d.ts +2 -0
  187. package/build/browser/object/convertWireToOsdkObjects.test.d.ts.map +1 -0
  188. package/build/browser/object/convertWireToOsdkObjects.test.js +254 -0
  189. package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -0
  190. package/build/browser/object/fetchPage.d.ts +3 -0
  191. package/build/browser/object/fetchPage.d.ts.map +1 -0
  192. package/build/browser/object/fetchPage.js +135 -0
  193. package/build/browser/object/fetchPage.js.map +1 -0
  194. package/build/browser/object/fetchPage.test.d.ts +2 -0
  195. package/build/browser/object/fetchPage.test.d.ts.map +1 -0
  196. package/build/browser/object/fetchPage.test.js +106 -0
  197. package/build/browser/object/fetchPage.test.js.map +1 -0
  198. package/build/browser/object/fetchSingle.d.ts +2 -0
  199. package/build/browser/object/fetchSingle.d.ts.map +1 -0
  200. package/build/browser/object/fetchSingle.js +47 -0
  201. package/build/browser/object/fetchSingle.js.map +1 -0
  202. package/build/browser/object/object.test.d.ts +12 -0
  203. package/build/browser/object/object.test.d.ts.map +1 -0
  204. package/build/browser/object/object.test.js +179 -0
  205. package/build/browser/object/object.test.js.map +1 -0
  206. package/build/browser/object/timeseries.test.d.ts +2 -0
  207. package/build/browser/object/timeseries.test.d.ts.map +1 -0
  208. package/build/browser/object/timeseries.test.js +163 -0
  209. package/build/browser/object/timeseries.test.js.map +1 -0
  210. package/build/browser/objectSet/ObjectSet.test.d.ts +2 -0
  211. package/build/browser/objectSet/ObjectSet.test.d.ts.map +1 -0
  212. package/build/browser/objectSet/ObjectSet.test.js +313 -0
  213. package/build/browser/objectSet/ObjectSet.test.js.map +1 -0
  214. package/build/browser/objectSet/ObjectSetFactory.d.ts +2 -0
  215. package/build/browser/objectSet/ObjectSetFactory.d.ts.map +1 -0
  216. package/build/browser/objectSet/ObjectSetFactory.js +17 -0
  217. package/build/browser/objectSet/ObjectSetFactory.js.map +1 -0
  218. package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts +7 -0
  219. package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -0
  220. package/build/browser/objectSet/ObjectSetListenerWebsocket.js +533 -0
  221. package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -0
  222. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts +2 -0
  223. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +1 -0
  224. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +338 -0
  225. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -0
  226. package/build/browser/objectSet/conjureUnionType.d.ts +13 -0
  227. package/build/browser/objectSet/conjureUnionType.d.ts.map +1 -0
  228. package/build/browser/objectSet/conjureUnionType.js +27 -0
  229. package/build/browser/objectSet/conjureUnionType.js.map +1 -0
  230. package/build/browser/objectSet/createObjectSet.d.ts +2 -0
  231. package/build/browser/objectSet/createObjectSet.d.ts.map +1 -0
  232. package/build/browser/objectSet/createObjectSet.js +136 -0
  233. package/build/browser/objectSet/createObjectSet.js.map +1 -0
  234. package/build/browser/objectSet/toConjureObjectSet.d.ts +2 -0
  235. package/build/browser/objectSet/toConjureObjectSet.d.ts.map +1 -0
  236. package/build/browser/objectSet/toConjureObjectSet.js +158 -0
  237. package/build/browser/objectSet/toConjureObjectSet.js.map +1 -0
  238. package/build/browser/ontology/OntologyProvider.d.ts +32 -0
  239. package/build/browser/ontology/OntologyProvider.d.ts.map +1 -0
  240. package/build/browser/ontology/OntologyProvider.js +17 -0
  241. package/build/browser/ontology/OntologyProvider.js.map +1 -0
  242. package/build/browser/ontology/StandardOntologyProvider.d.ts +5 -0
  243. package/build/browser/ontology/StandardOntologyProvider.d.ts.map +1 -0
  244. package/build/browser/ontology/StandardOntologyProvider.js +59 -0
  245. package/build/browser/ontology/StandardOntologyProvider.js.map +1 -0
  246. package/build/browser/ontology/StandardOntologyProvider.test.d.ts +2 -0
  247. package/build/browser/ontology/StandardOntologyProvider.test.d.ts.map +1 -0
  248. package/build/browser/ontology/StandardOntologyProvider.test.js +48 -0
  249. package/build/browser/ontology/StandardOntologyProvider.test.js.map +1 -0
  250. package/build/browser/ontology/loadActionMetadata.d.ts +4 -0
  251. package/build/browser/ontology/loadActionMetadata.d.ts.map +1 -0
  252. package/build/browser/ontology/loadActionMetadata.js +22 -0
  253. package/build/browser/ontology/loadActionMetadata.js.map +1 -0
  254. package/build/browser/ontology/loadFullObjectMetadata.d.ts +6 -0
  255. package/build/browser/ontology/loadFullObjectMetadata.d.ts.map +1 -0
  256. package/build/browser/ontology/loadFullObjectMetadata.js +28 -0
  257. package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -0
  258. package/build/browser/ontology/loadInterfaceMetadata.d.ts +4 -0
  259. package/build/browser/ontology/loadInterfaceMetadata.d.ts.map +1 -0
  260. package/build/browser/ontology/loadInterfaceMetadata.js +24 -0
  261. package/build/browser/ontology/loadInterfaceMetadata.js.map +1 -0
  262. package/build/browser/ontology/loadQueryMetadata.d.ts +4 -0
  263. package/build/browser/ontology/loadQueryMetadata.d.ts.map +1 -0
  264. package/build/browser/ontology/loadQueryMetadata.js +22 -0
  265. package/build/browser/ontology/loadQueryMetadata.js.map +1 -0
  266. package/build/browser/ontology/makeConjureContext.d.ts +4 -0
  267. package/build/browser/ontology/makeConjureContext.d.ts.map +1 -0
  268. package/build/browser/ontology/makeConjureContext.js +28 -0
  269. package/build/browser/ontology/makeConjureContext.js.map +1 -0
  270. package/build/browser/pageRequestAsAsyncIter.d.ts +10 -0
  271. package/build/browser/pageRequestAsAsyncIter.d.ts.map +1 -0
  272. package/build/browser/pageRequestAsAsyncIter.js +37 -0
  273. package/build/browser/pageRequestAsAsyncIter.js.map +1 -0
  274. package/build/browser/public/unstable-do-not-use.d.ts +2 -0
  275. package/build/browser/public/unstable-do-not-use.d.ts.map +1 -0
  276. package/build/browser/public/unstable-do-not-use.js +16 -878
  277. package/build/browser/public/unstable-do-not-use.js.map +1 -1
  278. package/build/browser/queries/applyQuery.d.ts +6 -0
  279. package/build/browser/queries/applyQuery.d.ts.map +1 -0
  280. package/build/browser/queries/applyQuery.js +234 -0
  281. package/build/browser/queries/applyQuery.js.map +1 -0
  282. package/build/browser/queries/queries.test.d.ts +2 -0
  283. package/build/browser/queries/queries.test.d.ts.map +1 -0
  284. package/build/browser/queries/queries.test.js +171 -0
  285. package/build/browser/queries/queries.test.js.map +1 -0
  286. package/build/browser/queries/types.d.ts +20 -0
  287. package/build/browser/queries/types.d.ts.map +1 -0
  288. package/build/browser/queries/types.js +17 -0
  289. package/build/browser/queries/types.js.map +1 -0
  290. package/build/browser/tsserver.d.ts +34 -0
  291. package/build/browser/tsserver.d.ts.map +1 -0
  292. package/build/browser/tsserver.js +133 -0
  293. package/build/browser/tsserver.js.map +1 -0
  294. package/build/browser/util/ArrayElement.d.ts +2 -0
  295. package/build/browser/util/ArrayElement.d.ts.map +1 -0
  296. package/build/browser/util/ArrayElement.js +17 -0
  297. package/build/browser/util/ArrayElement.js.map +1 -0
  298. package/build/browser/util/NOOP.d.ts +4 -0
  299. package/build/browser/util/NOOP.d.ts.map +1 -0
  300. package/build/browser/util/NOOP.js +17 -0
  301. package/build/browser/util/NOOP.js.map +1 -0
  302. package/build/browser/util/NullableProps.d.ts +6 -0
  303. package/build/browser/util/NullableProps.d.ts.map +1 -0
  304. package/build/browser/util/NullableProps.js +17 -0
  305. package/build/browser/util/NullableProps.js.map +1 -0
  306. package/build/browser/util/UserAgent.d.ts +2 -0
  307. package/build/browser/util/UserAgent.d.ts.map +1 -0
  308. package/build/browser/util/UserAgent.js +17 -0
  309. package/build/browser/util/UserAgent.js.map +1 -0
  310. package/build/browser/util/WireObjectSet.d.ts +2 -0
  311. package/build/browser/util/WireObjectSet.d.ts.map +1 -0
  312. package/build/browser/util/WireObjectSet.js +21 -0
  313. package/build/browser/util/WireObjectSet.js.map +1 -0
  314. package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts +4 -0
  315. package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts.map +1 -0
  316. package/build/browser/util/addUserAgentAndRequestContextHeaders.js +27 -0
  317. package/build/browser/util/addUserAgentAndRequestContextHeaders.js.map +1 -0
  318. package/build/browser/util/augmentRequestContext.d.ts +32 -0
  319. package/build/browser/util/augmentRequestContext.d.ts.map +1 -0
  320. package/build/browser/util/augmentRequestContext.js +52 -0
  321. package/build/browser/util/augmentRequestContext.js.map +1 -0
  322. package/build/browser/util/isOntologyObjectV2.d.ts +2 -0
  323. package/build/browser/util/isOntologyObjectV2.d.ts.map +1 -0
  324. package/build/browser/util/isOntologyObjectV2.js +20 -0
  325. package/build/browser/util/isOntologyObjectV2.js.map +1 -0
  326. package/build/browser/util/isOsdkBaseObject.d.ts +3 -0
  327. package/build/browser/util/isOsdkBaseObject.d.ts.map +1 -0
  328. package/build/browser/util/isOsdkBaseObject.js +19 -0
  329. package/build/browser/util/isOsdkBaseObject.js.map +1 -0
  330. package/build/browser/util/isOsdkObject.d.ts +3 -0
  331. package/build/browser/util/isOsdkObject.d.ts.map +1 -0
  332. package/build/browser/util/isOsdkObject.js +19 -0
  333. package/build/browser/util/isOsdkObject.js.map +1 -0
  334. package/build/browser/util/partialBy.d.ts +3 -0
  335. package/build/browser/util/partialBy.d.ts.map +1 -0
  336. package/build/browser/util/partialBy.js +17 -0
  337. package/build/browser/util/partialBy.js.map +1 -0
  338. package/build/browser/util/streamutils.d.ts +3 -0
  339. package/build/browser/util/streamutils.d.ts.map +1 -0
  340. package/build/browser/util/streamutils.js +95 -0
  341. package/build/browser/util/streamutils.js.map +1 -0
  342. package/build/browser/util/toDataValue.d.ts +2 -0
  343. package/build/browser/util/toDataValue.d.ts.map +1 -0
  344. package/build/browser/util/toDataValue.js +73 -0
  345. package/build/browser/util/toDataValue.js.map +1 -0
  346. package/build/browser/util/toDataValue.test.d.ts +2 -0
  347. package/build/browser/util/toDataValue.test.d.ts.map +1 -0
  348. package/build/browser/util/toDataValue.test.js +117 -0
  349. package/build/browser/util/toDataValue.test.js.map +1 -0
  350. package/build/browser/util/toDataValueQueries.d.ts +2 -0
  351. package/build/browser/util/toDataValueQueries.d.ts.map +1 -0
  352. package/build/browser/util/toDataValueQueries.js +107 -0
  353. package/build/browser/util/toDataValueQueries.js.map +1 -0
  354. package/build/esm/Client.d.ts +24 -4
  355. package/build/esm/Client.d.ts.map +1 -1
  356. package/build/esm/Client.js +20 -0
  357. package/build/esm/Client.js.map +1 -0
  358. package/build/esm/Definitions.test.js +35 -0
  359. package/build/esm/Definitions.test.js.map +1 -0
  360. package/build/esm/Logger.d.ts +19 -0
  361. package/build/esm/Logger.d.ts.map +1 -0
  362. package/build/esm/Logger.js +17 -0
  363. package/build/esm/Logger.js.map +1 -0
  364. package/build/esm/MinimalClientContext.d.ts +1 -1
  365. package/build/esm/MinimalClientContext.d.ts.map +1 -1
  366. package/build/esm/MinimalClientContext.js +17 -0
  367. package/build/esm/MinimalClientContext.js.map +1 -0
  368. package/build/esm/ResultOrError.js +19 -0
  369. package/build/esm/ResultOrError.js.map +1 -0
  370. package/build/esm/SatisfiesSemver.js +17 -0
  371. package/build/esm/SatisfiesSemver.js.map +1 -0
  372. package/build/esm/SatisfiesSemver.test.js +69 -0
  373. package/build/esm/SatisfiesSemver.test.js.map +1 -0
  374. package/build/esm/__unstable/ConjureSupport.js +174 -0
  375. package/build/esm/__unstable/ConjureSupport.js.map +1 -0
  376. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts +1 -1
  377. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -1
  378. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js +114 -0
  379. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -0
  380. package/build/esm/actions/ActionValidationError.d.ts +1 -1
  381. package/build/esm/actions/ActionValidationError.d.ts.map +1 -1
  382. package/build/esm/actions/ActionValidationError.js +23 -0
  383. package/build/esm/actions/ActionValidationError.js.map +1 -0
  384. package/build/esm/actions/actions.test.js +323 -0
  385. package/build/esm/actions/actions.test.js.map +1 -0
  386. package/build/esm/actions/applyAction.d.ts +17 -11
  387. package/build/esm/actions/applyAction.d.ts.map +1 -1
  388. package/build/esm/actions/applyAction.js +114 -0
  389. package/build/esm/actions/applyAction.js.map +1 -0
  390. package/build/esm/createAttachmentFromRid.d.ts +1 -1
  391. package/build/esm/createAttachmentFromRid.d.ts.map +1 -1
  392. package/build/esm/createAttachmentFromRid.js +38 -0
  393. package/build/esm/createAttachmentFromRid.js.map +1 -0
  394. package/build/esm/createClient.d.ts +1 -1
  395. package/build/esm/createClient.d.ts.map +1 -1
  396. package/build/esm/createClient.js +88 -0
  397. package/build/esm/createClient.js.map +1 -0
  398. package/build/esm/createClient.test.js +45 -0
  399. package/build/esm/createClient.test.js.map +1 -0
  400. package/build/esm/createMinimalClient.js +42 -0
  401. package/build/esm/createMinimalClient.js.map +1 -0
  402. package/build/esm/createPlatformClient.js +33 -0
  403. package/build/esm/createPlatformClient.js.map +1 -0
  404. package/build/esm/createTimeseriesProperty.d.ts +12 -2
  405. package/build/esm/createTimeseriesProperty.d.ts.map +1 -1
  406. package/build/esm/createTimeseriesProperty.js +79 -0
  407. package/build/esm/createTimeseriesProperty.js.map +1 -0
  408. package/build/esm/definitions/LinkDefinitions.test.js +41 -0
  409. package/build/esm/definitions/LinkDefinitions.test.js.map +1 -0
  410. package/build/esm/fetchMetadata.d.ts +2 -0
  411. package/build/esm/fetchMetadata.d.ts.map +1 -0
  412. package/build/esm/fetchMetadata.js +35 -0
  413. package/build/esm/fetchMetadata.js.map +1 -0
  414. package/build/esm/fetchMetadata.test.d.ts +2 -0
  415. package/build/esm/fetchMetadata.test.d.ts.map +1 -0
  416. package/build/esm/fetchMetadata.test.js +218 -0
  417. package/build/esm/fetchMetadata.test.js.map +1 -0
  418. package/build/esm/index.d.ts +3 -2
  419. package/build/esm/index.d.ts.map +1 -1
  420. package/build/esm/index.js +22 -12
  421. package/build/esm/index.js.map +1 -1
  422. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js +25 -0
  423. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -0
  424. package/build/esm/intellisense.test.js +86 -0
  425. package/build/esm/intellisense.test.js.map +1 -0
  426. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js +34 -0
  427. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -0
  428. package/build/esm/internal/conversions/modernToLegacyAggregationClause.js +38 -0
  429. package/build/esm/internal/conversions/modernToLegacyAggregationClause.js.map +1 -0
  430. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +62 -0
  431. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -0
  432. package/build/esm/internal/conversions/modernToLegacyWhereClause.js +144 -0
  433. package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -0
  434. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +486 -0
  435. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -0
  436. package/build/esm/object/AttachmentUpload.d.ts +1 -1
  437. package/build/esm/object/AttachmentUpload.d.ts.map +1 -1
  438. package/build/esm/object/AttachmentUpload.js +27 -0
  439. package/build/esm/object/AttachmentUpload.js.map +1 -0
  440. package/build/esm/object/Cache.js +76 -0
  441. package/build/esm/object/Cache.js.map +1 -0
  442. package/build/esm/object/Cache.test.js +283 -0
  443. package/build/esm/object/Cache.test.js.map +1 -0
  444. package/build/esm/object/SimpleCache.js +67 -0
  445. package/build/esm/object/SimpleCache.js.map +1 -0
  446. package/build/esm/object/aggregate.js +69 -0
  447. package/build/esm/object/aggregate.js.map +1 -0
  448. package/build/esm/object/aggregate.test.js +398 -0
  449. package/build/esm/object/aggregate.test.js.map +1 -0
  450. package/build/esm/object/attachment.test.js +55 -0
  451. package/build/esm/object/attachment.test.js.map +1 -0
  452. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +4 -5
  453. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -1
  454. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js +17 -0
  455. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -0
  456. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts +2 -3
  457. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -1
  458. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js +22 -0
  459. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -0
  460. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js +17 -0
  461. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -0
  462. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -1
  463. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +48 -0
  464. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -0
  465. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +17 -0
  466. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -0
  467. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +82 -0
  468. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -0
  469. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +114 -0
  470. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -0
  471. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts +1 -1
  472. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -1
  473. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +55 -0
  474. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -0
  475. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +60 -0
  476. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -0
  477. package/build/esm/object/convertWireToOsdkObjects.js +150 -0
  478. package/build/esm/object/convertWireToOsdkObjects.js.map +1 -0
  479. package/build/esm/object/convertWireToOsdkObjects.test.js +254 -0
  480. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -0
  481. package/build/esm/object/fetchPage.d.ts +2 -3
  482. package/build/esm/object/fetchPage.d.ts.map +1 -1
  483. package/build/esm/object/fetchPage.js +135 -0
  484. package/build/esm/object/fetchPage.js.map +1 -0
  485. package/build/esm/object/fetchPage.test.js +106 -0
  486. package/build/esm/object/fetchPage.test.js.map +1 -0
  487. package/build/esm/object/fetchSingle.js +47 -0
  488. package/build/esm/object/fetchSingle.js.map +1 -0
  489. package/build/esm/object/object.test.d.ts +4 -5
  490. package/build/esm/object/object.test.d.ts.map +1 -1
  491. package/build/esm/object/object.test.js +179 -0
  492. package/build/esm/object/object.test.js.map +1 -0
  493. package/build/esm/object/timeseries.test.js +163 -0
  494. package/build/esm/object/timeseries.test.js.map +1 -0
  495. package/build/esm/objectSet/ObjectSet.test.js +313 -0
  496. package/build/esm/objectSet/ObjectSet.test.js.map +1 -0
  497. package/build/esm/objectSet/ObjectSetFactory.js +17 -0
  498. package/build/esm/objectSet/ObjectSetFactory.js.map +1 -0
  499. package/build/esm/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -1
  500. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +536 -0
  501. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -0
  502. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +338 -0
  503. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -0
  504. package/build/esm/objectSet/conjureUnionType.js +27 -0
  505. package/build/esm/objectSet/conjureUnionType.js.map +1 -0
  506. package/build/esm/objectSet/createObjectSet.js +136 -0
  507. package/build/esm/objectSet/createObjectSet.js.map +1 -0
  508. package/build/esm/objectSet/toConjureObjectSet.js +158 -0
  509. package/build/esm/objectSet/toConjureObjectSet.js.map +1 -0
  510. package/build/esm/ontology/OntologyProvider.d.ts +7 -13
  511. package/build/esm/ontology/OntologyProvider.d.ts.map +1 -1
  512. package/build/esm/ontology/OntologyProvider.js +17 -0
  513. package/build/esm/ontology/OntologyProvider.js.map +1 -0
  514. package/build/esm/ontology/StandardOntologyProvider.d.ts.map +1 -1
  515. package/build/esm/ontology/StandardOntologyProvider.js +59 -0
  516. package/build/esm/ontology/StandardOntologyProvider.js.map +1 -0
  517. package/build/esm/ontology/StandardOntologyProvider.test.js +48 -0
  518. package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -0
  519. package/build/esm/ontology/loadActionMetadata.d.ts +4 -0
  520. package/build/esm/ontology/loadActionMetadata.d.ts.map +1 -0
  521. package/build/esm/ontology/loadActionMetadata.js +22 -0
  522. package/build/esm/ontology/loadActionMetadata.js.map +1 -0
  523. package/build/esm/ontology/loadFullObjectMetadata.d.ts +2 -2
  524. package/build/esm/ontology/loadFullObjectMetadata.d.ts.map +1 -1
  525. package/build/esm/ontology/loadFullObjectMetadata.js +28 -0
  526. package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -0
  527. package/build/esm/ontology/loadInterfaceMetadata.d.ts +4 -0
  528. package/build/esm/ontology/loadInterfaceMetadata.d.ts.map +1 -0
  529. package/build/esm/ontology/loadInterfaceMetadata.js +24 -0
  530. package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -0
  531. package/build/esm/ontology/loadQueryMetadata.d.ts +4 -0
  532. package/build/esm/ontology/loadQueryMetadata.d.ts.map +1 -0
  533. package/build/esm/ontology/loadQueryMetadata.js +22 -0
  534. package/build/esm/ontology/loadQueryMetadata.js.map +1 -0
  535. package/build/esm/ontology/makeConjureContext.js +28 -0
  536. package/build/esm/ontology/makeConjureContext.js.map +1 -0
  537. package/build/esm/pageRequestAsAsyncIter.js +37 -0
  538. package/build/esm/pageRequestAsAsyncIter.js.map +1 -0
  539. package/build/esm/public/unstable-do-not-use.d.ts +0 -4
  540. package/build/esm/public/unstable-do-not-use.d.ts.map +1 -1
  541. package/build/esm/public/unstable-do-not-use.js +16 -881
  542. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  543. package/build/esm/queries/applyQuery.d.ts +3 -4
  544. package/build/esm/queries/applyQuery.d.ts.map +1 -1
  545. package/build/esm/queries/applyQuery.js +234 -0
  546. package/build/esm/queries/applyQuery.js.map +1 -0
  547. package/build/esm/queries/queries.test.js +171 -0
  548. package/build/esm/queries/queries.test.js.map +1 -0
  549. package/build/esm/queries/types.d.ts +10 -11
  550. package/build/esm/queries/types.d.ts.map +1 -1
  551. package/build/esm/queries/types.js +17 -0
  552. package/build/esm/queries/types.js.map +1 -0
  553. package/build/esm/tsserver.d.ts +1 -1
  554. package/build/esm/tsserver.d.ts.map +1 -1
  555. package/build/esm/tsserver.js +133 -0
  556. package/build/esm/tsserver.js.map +1 -0
  557. package/build/esm/util/ArrayElement.js +17 -0
  558. package/build/esm/util/ArrayElement.js.map +1 -0
  559. package/build/esm/util/NOOP.js +17 -0
  560. package/build/esm/util/NOOP.js.map +1 -0
  561. package/build/esm/util/NullableProps.js +17 -0
  562. package/build/esm/util/NullableProps.js.map +1 -0
  563. package/build/esm/util/UserAgent.js +17 -0
  564. package/build/esm/util/UserAgent.js.map +1 -0
  565. package/build/esm/util/WireObjectSet.js +21 -0
  566. package/build/esm/util/WireObjectSet.js.map +1 -0
  567. package/build/esm/util/addUserAgentAndRequestContextHeaders.js +27 -0
  568. package/build/esm/util/addUserAgentAndRequestContextHeaders.js.map +1 -0
  569. package/build/esm/util/augmentRequestContext.js +52 -0
  570. package/build/esm/util/augmentRequestContext.js.map +1 -0
  571. package/build/esm/util/isOntologyObjectV2.js +20 -0
  572. package/build/esm/util/isOntologyObjectV2.js.map +1 -0
  573. package/build/esm/util/isOsdkBaseObject.d.ts +1 -1
  574. package/build/esm/util/isOsdkBaseObject.d.ts.map +1 -1
  575. package/build/esm/util/isOsdkBaseObject.js +19 -0
  576. package/build/esm/util/isOsdkBaseObject.js.map +1 -0
  577. package/build/esm/util/isOsdkObject.d.ts +1 -1
  578. package/build/esm/util/isOsdkObject.d.ts.map +1 -1
  579. package/build/esm/util/isOsdkObject.js +19 -0
  580. package/build/esm/util/isOsdkObject.js.map +1 -0
  581. package/build/esm/util/partialBy.js +17 -0
  582. package/build/esm/util/partialBy.js.map +1 -0
  583. package/build/esm/util/streamutils.js +95 -0
  584. package/build/esm/util/streamutils.js.map +1 -0
  585. package/build/esm/util/toDataValue.js +73 -0
  586. package/build/esm/util/toDataValue.js.map +1 -0
  587. package/build/esm/util/toDataValue.test.js +117 -0
  588. package/build/esm/util/toDataValue.test.js.map +1 -0
  589. package/build/esm/util/toDataValueQueries.js +107 -0
  590. package/build/esm/util/toDataValueQueries.js.map +1 -0
  591. package/package.json +15 -27
  592. package/build/browser/chunk-5HUCUBJX.js +0 -2327
  593. package/build/browser/chunk-5HUCUBJX.js.map +0 -1
  594. package/build/esm/__unstable/UNSTABLE_createClient.d.ts +0 -4
  595. package/build/esm/__unstable/UNSTABLE_createClient.d.ts.map +0 -1
  596. package/build/esm/__unstable/UnstableClient.d.ts +0 -12
  597. package/build/esm/__unstable/UnstableClient.d.ts.map +0 -1
  598. package/build/esm/chunk-5HUCUBJX.js +0 -2327
  599. package/build/esm/chunk-5HUCUBJX.js.map +0 -1
  600. package/build/esm/objectSet/ObjectSetListener.d.ts +0 -18
  601. package/build/esm/objectSet/ObjectSetListener.d.ts.map +0 -1
  602. package/build/esm/objectSet/createUnstableObjectSet.d.ts +0 -8
  603. package/build/esm/objectSet/createUnstableObjectSet.d.ts.map +0 -1
  604. package/build/esm/ontology/loadInterfaceDefinition.d.ts +0 -4
  605. package/build/esm/ontology/loadInterfaceDefinition.d.ts.map +0 -1
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Copyright 2024 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
+ Returns a client with its `requestContext` merged with the result of applying
18
+ `augment` to its `requestContext`.
19
+
20
+ The second argument is an `Partial<RequestContext>`-returning `augment` function
21
+ instead of a `RequestContext` object to make referencing the current request
22
+ context easier. For example, modifying the `fetchPage` function to add its name
23
+ to the object set's called method chain could look like:
24
+ ```
25
+ augmentRequestContext(
26
+ clientContext,
27
+ ctx => ({ methodChain: [...ctx.methodChain, "fetchPage"] })
28
+ )
29
+ ```
30
+ or
31
+ ```
32
+ augmentRequestContext(
33
+ clientContext,
34
+ ({ methodChain }) => ({ methodChain: [...methodChain, "fetchPage"] })
35
+ )
36
+ ```
37
+ instead of
38
+ ```
39
+ augmentRequestContext(
40
+ clientContext,
41
+ { methodChain: [...clientContext.requestContext.methodChain, "fetchPage"] }
42
+ )
43
+ ```
44
+ */
45
+ export const augmentRequestContext = (client, augment) => ({
46
+ ...client,
47
+ requestContext: {
48
+ ...client.requestContext,
49
+ ...augment(client.requestContext)
50
+ }
51
+ });
52
+ //# sourceMappingURL=augmentRequestContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"augmentRequestContext.js","names":["augmentRequestContext","client","augment","requestContext"],"sources":["augmentRequestContext.js"],"sourcesContent":["/*\n * Copyright 2024 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/**\nReturns a client with its `requestContext` merged with the result of applying\n`augment` to its `requestContext`.\n\nThe second argument is an `Partial<RequestContext>`-returning `augment` function\ninstead of a `RequestContext` object to make referencing the current request\ncontext easier. For example, modifying the `fetchPage` function to add its name\nto the object set's called method chain could look like:\n```\naugmentRequestContext(\n clientContext,\n ctx => ({ methodChain: [...ctx.methodChain, \"fetchPage\"] })\n)\n```\nor\n```\naugmentRequestContext(\n clientContext,\n ({ methodChain }) => ({ methodChain: [...methodChain, \"fetchPage\"] })\n)\n```\ninstead of\n```\naugmentRequestContext(\n clientContext,\n { methodChain: [...clientContext.requestContext.methodChain, \"fetchPage\"] }\n)\n```\n*/\nexport const augmentRequestContext = (client, augment) => ({\n ...client,\n requestContext: {\n ...client.requestContext,\n ...augment(client.requestContext),\n },\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAGA,CAACC,MAAM,EAAEC,OAAO,MAAM;EACvD,GAAGD,MAAM;EACTE,cAAc,EAAE;IACZ,GAAGF,MAAM,CAACE,cAAc;IACxB,GAAGD,OAAO,CAACD,MAAM,CAACE,cAAc;EACpC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,20 @@
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
+ /** @internal */
17
+ export function isOntologyObjectV2(o) {
18
+ return o && typeof o === "object" && typeof o.__apiName === "string" && o.__primaryKey != null;
19
+ }
20
+ //# sourceMappingURL=isOntologyObjectV2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isOntologyObjectV2.js","names":["isOntologyObjectV2","o","__apiName","__primaryKey"],"sources":["isOntologyObjectV2.js"],"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/** @internal */\nexport function isOntologyObjectV2(o) {\n return o && typeof o === \"object\" && typeof o.__apiName === \"string\"\n && o.__primaryKey != null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,kBAAkBA,CAACC,CAAC,EAAE;EAClC,OAAOA,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,IAAI,OAAOA,CAAC,CAACC,SAAS,KAAK,QAAQ,IAC7DD,CAAC,CAACE,YAAY,IAAI,IAAI;AACjC","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import type { OsdkBase } from "@osdk/client.api";
1
+ import type { OsdkBase } from "@osdk/api";
2
2
  export declare function isOsdkBaseObject(o: any): o is OsdkBase<any>;
3
3
  //# sourceMappingURL=isOsdkBaseObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isOsdkBaseObject.d.ts","sourceRoot":"","sources":["../../../src/util/isOsdkBaseObject.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAG3D"}
1
+ {"version":3,"file":"isOsdkBaseObject.d.ts","sourceRoot":"","sources":["../../../src/util/isOsdkBaseObject.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAG3D"}
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2024 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
+ export function isOsdkBaseObject(o) {
17
+ return o && typeof o === "object" && typeof o.$apiName === "string" && o.$primaryKey != null;
18
+ }
19
+ //# sourceMappingURL=isOsdkBaseObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isOsdkBaseObject.js","names":["isOsdkBaseObject","o","$apiName","$primaryKey"],"sources":["isOsdkBaseObject.js"],"sourcesContent":["/*\n * Copyright 2024 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 */\nexport function isOsdkBaseObject(o) {\n return o && typeof o === \"object\" && typeof o.$apiName === \"string\"\n && o.$primaryKey != null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAACC,CAAC,EAAE;EAChC,OAAOA,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,IAAI,OAAOA,CAAC,CAACC,QAAQ,KAAK,QAAQ,IAC5DD,CAAC,CAACE,WAAW,IAAI,IAAI;AAChC","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import type { OsdkBase } from "@osdk/client.api";
1
+ import type { OsdkBase } from "@osdk/api";
2
2
  export declare function isOsdkBaseObject(o: any): o is OsdkBase<any>;
3
3
  //# sourceMappingURL=isOsdkObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isOsdkObject.d.ts","sourceRoot":"","sources":["../../../src/util/isOsdkObject.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAG3D"}
1
+ {"version":3,"file":"isOsdkObject.d.ts","sourceRoot":"","sources":["../../../src/util/isOsdkObject.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAG3D"}
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2024 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
+ export function isOsdkBaseObject(o) {
17
+ return o && typeof o === "object" && typeof o.$apiName === "string" && o.$primaryKey != null;
18
+ }
19
+ //# sourceMappingURL=isOsdkObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isOsdkObject.js","names":["isOsdkBaseObject","o","$apiName","$primaryKey"],"sources":["isOsdkObject.js"],"sourcesContent":["/*\n * Copyright 2024 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 */\nexport function isOsdkBaseObject(o) {\n return o && typeof o === \"object\" && typeof o.$apiName === \"string\"\n && o.$primaryKey != null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAACC,CAAC,EAAE;EAChC,OAAOA,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,IAAI,OAAOA,CAAC,CAACC,QAAQ,KAAK,QAAQ,IAC5DD,CAAC,CAACE,WAAW,IAAI,IAAI;AAChC","ignoreList":[]}
@@ -0,0 +1,17 @@
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
+ export {};
17
+ //# sourceMappingURL=partialBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partialBy.js","names":[],"sources":["partialBy.js"],"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 */\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,95 @@
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
+ const START_TOKEN = new Uint8Array([123, 34, 100, 97, 116, 97, 34, 58, 91]); // `{"data":[`
17
+ const OBJECT_OPEN_CHAR_CODE = 123; // '{'
18
+ const OBJECT_CLOSE_CHAR_CODE = 125; // '}'
19
+ export async function* parseStreamedResponse(asyncIterable) {
20
+ const utf8decoder = new TextDecoder("utf-8");
21
+ let parsedStart = false;
22
+ let prevChunks = [];
23
+ let openBracesCount = 0;
24
+ for await (let chunk of asyncIterable) {
25
+ // on the first chunk, skip the expected START_TOKEN if we see it
26
+ let i = 0;
27
+ if (!parsedStart) {
28
+ parsedStart = true;
29
+ if (startsWith(chunk, START_TOKEN)) {
30
+ i = START_TOKEN.length;
31
+ }
32
+ }
33
+ for (; i < chunk.length; i++) {
34
+ // if we aren't currently parsing an object, skip until we find the next object start
35
+ while (openBracesCount === 0 && chunk[i] !== OBJECT_OPEN_CHAR_CODE && i < chunk.length) {
36
+ i++;
37
+ }
38
+ // iterate through the chunk looking for the end of the current top level object
39
+ let j = i;
40
+ for (; j < chunk.length; j++) {
41
+ const c = chunk[j];
42
+ if (c === OBJECT_OPEN_CHAR_CODE) {
43
+ openBracesCount++;
44
+ } else if (c === OBJECT_CLOSE_CHAR_CODE) {
45
+ openBracesCount--;
46
+ // found a complete top level object, emit it
47
+ if (0 === openBracesCount) {
48
+ yield combineAndParse(utf8decoder, prevChunks, chunk.subarray(i, j + 1));
49
+ // if there was a prevChunk, we've consumed it now
50
+ prevChunks = [];
51
+ // advance the start index to the final '}' of the current object,
52
+ // which lets us start seeking the beginning of the next object
53
+ i = j;
54
+ break;
55
+ }
56
+ }
57
+ }
58
+ // if we reached the end of our chunk before finding the end of the object
59
+ // store off the relevant remainder of our current chunk and go grab the next one
60
+ if (j === chunk.length) {
61
+ prevChunks.push(chunk.subarray(i));
62
+ break;
63
+ }
64
+ }
65
+ }
66
+ }
67
+ function startsWith(a, b) {
68
+ if (a.length < b.length) {
69
+ return false;
70
+ }
71
+ for (let i = 0; i < b.length; i++) {
72
+ if (a[i] !== b[i]) {
73
+ return false;
74
+ }
75
+ }
76
+ return true;
77
+ }
78
+ function combineAndParse(utf8decoder, prev, curr) {
79
+ let str = "";
80
+ for (const chunk of prev) {
81
+ str += utf8decoder.decode(chunk, {
82
+ stream: true
83
+ });
84
+ }
85
+ str += utf8decoder.decode(curr);
86
+ return JSON.parse(str);
87
+ }
88
+ export async function* iterateReadableStream(readableStream) {
89
+ let res = await readableStream.read();
90
+ while (!res.done) {
91
+ yield res.value;
92
+ res = await readableStream.read();
93
+ }
94
+ }
95
+ //# sourceMappingURL=streamutils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamutils.js","names":["START_TOKEN","Uint8Array","OBJECT_OPEN_CHAR_CODE","OBJECT_CLOSE_CHAR_CODE","parseStreamedResponse","asyncIterable","utf8decoder","TextDecoder","parsedStart","prevChunks","openBracesCount","chunk","i","startsWith","length","j","c","combineAndParse","subarray","push","a","b","prev","curr","str","decode","stream","JSON","parse","iterateReadableStream","readableStream","res","read","done","value"],"sources":["streamutils.js"],"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 */\nconst START_TOKEN = new Uint8Array([123, 34, 100, 97, 116, 97, 34, 58, 91]); // `{\"data\":[`\nconst OBJECT_OPEN_CHAR_CODE = 123; // '{'\nconst OBJECT_CLOSE_CHAR_CODE = 125; // '}'\nexport async function* parseStreamedResponse(asyncIterable) {\n const utf8decoder = new TextDecoder(\"utf-8\");\n let parsedStart = false;\n let prevChunks = [];\n let openBracesCount = 0;\n for await (let chunk of asyncIterable) {\n // on the first chunk, skip the expected START_TOKEN if we see it\n let i = 0;\n if (!parsedStart) {\n parsedStart = true;\n if (startsWith(chunk, START_TOKEN)) {\n i = START_TOKEN.length;\n }\n }\n for (; i < chunk.length; i++) {\n // if we aren't currently parsing an object, skip until we find the next object start\n while (openBracesCount === 0 && chunk[i] !== OBJECT_OPEN_CHAR_CODE\n && i < chunk.length) {\n i++;\n }\n // iterate through the chunk looking for the end of the current top level object\n let j = i;\n for (; j < chunk.length; j++) {\n const c = chunk[j];\n if (c === OBJECT_OPEN_CHAR_CODE) {\n openBracesCount++;\n }\n else if (c === OBJECT_CLOSE_CHAR_CODE) {\n openBracesCount--;\n // found a complete top level object, emit it\n if (0 === openBracesCount) {\n yield combineAndParse(utf8decoder, prevChunks, chunk.subarray(i, j + 1));\n // if there was a prevChunk, we've consumed it now\n prevChunks = [];\n // advance the start index to the final '}' of the current object,\n // which lets us start seeking the beginning of the next object\n i = j;\n break;\n }\n }\n }\n // if we reached the end of our chunk before finding the end of the object\n // store off the relevant remainder of our current chunk and go grab the next one\n if (j === chunk.length) {\n prevChunks.push(chunk.subarray(i));\n break;\n }\n }\n }\n}\nfunction startsWith(a, b) {\n if (a.length < b.length) {\n return false;\n }\n for (let i = 0; i < b.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\nfunction combineAndParse(utf8decoder, prev, curr) {\n let str = \"\";\n for (const chunk of prev) {\n str += utf8decoder.decode(chunk, { stream: true });\n }\n str += utf8decoder.decode(curr);\n return JSON.parse(str);\n}\nexport async function* iterateReadableStream(readableStream) {\n let res = await readableStream.read();\n while (!res.done) {\n yield res.value;\n res = await readableStream.read();\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,IAAIC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAA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GAAG,MAAMD,cAAc,CAACE,IAAI,CAAC,CAAC;EACrC;AACJ","ignoreList":[]}
@@ -0,0 +1,73 @@
1
+ /*
2
+ * Copyright 2024 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
+ import * as OntologiesV2 from "@osdk/internal.foundry.ontologiesv2";
17
+ import { isAttachmentUpload } from "../object/AttachmentUpload.js";
18
+ import { getWireObjectSet, isObjectSet } from "../objectSet/createObjectSet.js";
19
+ import { isOntologyObjectV2 } from "./isOntologyObjectV2.js";
20
+ import { isOsdkBaseObject } from "./isOsdkObject.js";
21
+ import { isWireObjectSet } from "./WireObjectSet.js";
22
+ /**
23
+ * Marshall user-facing data into the wire DataValue type
24
+ *
25
+ * @see DataValue for the expected payloads
26
+ * @internal
27
+ */
28
+ export async function toDataValue(value, client) {
29
+ if (value == null) {
30
+ // typeof null is 'object' so do this first
31
+ return value;
32
+ }
33
+ // arrays and sets are both sent over the wire as arrays
34
+ if (Array.isArray(value) || value instanceof Set) {
35
+ const promiseArray = Array.from(value, async innerValue => await toDataValue(innerValue, client));
36
+ return Promise.all(promiseArray);
37
+ }
38
+ // For uploads, we need to upload ourselves first to get the RID of the attachment
39
+ if (isAttachmentUpload(value)) {
40
+ const attachment = await OntologiesV2.Attachments.upload(client, value, {
41
+ filename: value.name
42
+ });
43
+ return await toDataValue(attachment.rid, client);
44
+ }
45
+ // objects just send the JSON'd primaryKey
46
+ if (isOntologyObjectV2(value)) {
47
+ return await toDataValue(value.__primaryKey, client);
48
+ }
49
+ if (isOsdkBaseObject(value)) {
50
+ return await toDataValue(value.$primaryKey, client);
51
+ }
52
+ // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)
53
+ if (isWireObjectSet(value)) {
54
+ return value;
55
+ }
56
+ if (isObjectSet(value)) {
57
+ return getWireObjectSet(value);
58
+ }
59
+ // TODO (during queries implementation)
60
+ // two dimensional aggregation
61
+ // three dimensional aggregation
62
+ // struct
63
+ if (typeof value === "object") {
64
+ return Object.entries(value).reduce(async (promisedAcc, [key, structValue]) => {
65
+ const acc = await promisedAcc;
66
+ acc[key] = await toDataValue(structValue, client);
67
+ return acc;
68
+ }, Promise.resolve({}));
69
+ }
70
+ // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp
71
+ return value;
72
+ }
73
+ //# sourceMappingURL=toDataValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toDataValue.js","names":["OntologiesV2","isAttachmentUpload","getWireObjectSet","isObjectSet","isOntologyObjectV2","isOsdkBaseObject","isWireObjectSet","toDataValue","value","client","Array","isArray","Set","promiseArray","from","innerValue","Promise","all","attachment","Attachments","upload","filename","name","rid","__primaryKey","$primaryKey","Object","entries","reduce","promisedAcc","key","structValue","acc","resolve"],"sources":["toDataValue.js"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isOsdkBaseObject } from \"./isOsdkObject.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n * @internal\n */\nexport async function toDataValue(value, client) {\n if (value == null) {\n // typeof null is 'object' so do this first\n return value;\n }\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));\n return Promise.all(promiseArray);\n }\n // For uploads, we need to upload ourselves first to get the RID of the attachment\n if (isAttachmentUpload(value)) {\n const attachment = await OntologiesV2.Attachments.upload(client, value, {\n filename: value.name,\n });\n return await toDataValue(attachment.rid, client);\n }\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return await toDataValue(value.__primaryKey, client);\n }\n if (isOsdkBaseObject(value)) {\n return await toDataValue(value.$primaryKey, client);\n }\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce(async (promisedAcc, [key, structValue]) => {\n const acc = await promisedAcc;\n acc[key] = await toDataValue(structValue, client);\n return acc;\n }, Promise.resolve({}));\n }\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp\n return value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,iCAAiC;AAC/E,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,mBAAmB;AAC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AAO,CAACnB,KAAK,CAAC,CAACoB,MAAM,CAAC,OAAOC,WAAW,EAAE,CAACC,GAAG,EAAEC,WAAW,CAAC,KAAK;MAC3E,MAAMC,GAAG,GAAG,MAAMH,WAAW;MAC7BG,GAAG,CAACF,GAAG,CAAC,GAAG,MAAMvB,WAAW,CAACwB,WAAW,EAAEtB,MAAM,CAAC;MACjD,OAAOuB,GAAG;IACd,CAAC,EAAEhB,OAAO,CAACiB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;EAC3B;EACA;EACA,OAAOzB,KAAK;AAChB","ignoreList":[]}
@@ -0,0 +1,117 @@
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
+ import { $ontologyRid, Employee, Task } from "@osdk/client.test.ontology";
17
+ import { apiServer, MockOntology, stubData } from "@osdk/shared.test";
18
+ import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
19
+ import { createClient } from "../createClient.js";
20
+ import { createMinimalClient } from "../createMinimalClient.js";
21
+ import { createAttachmentUpload } from "../object/AttachmentUpload.js";
22
+ import { getWireObjectSet } from "../objectSet/createObjectSet.js";
23
+ import { toDataValue } from "./toDataValue.js";
24
+ describe(toDataValue, () => {
25
+ let client;
26
+ let clientCtx;
27
+ vi.fn();
28
+ beforeAll(async () => {
29
+ apiServer.listen();
30
+ client = createClient("https://stack.palantir.com", $ontologyRid, async () => "myAccessToken");
31
+ clientCtx = createMinimalClient(MockOntology.metadata, "https://stack.palantir.com", async () => "myAccessToken", {});
32
+ });
33
+ afterAll(() => {
34
+ apiServer.close();
35
+ });
36
+ it("converts passthrough values correctly", async () => {
37
+ // basic pass through types
38
+ const basic = {
39
+ null: undefined,
40
+ boolean: false,
41
+ date: "2024-01-01",
42
+ integer: 0,
43
+ string: "string",
44
+ timestamp: "2024-01-01T00:00:00Z"
45
+ };
46
+ const convertedBasic = await toDataValue(basic, clientCtx);
47
+ expect(convertedBasic).toEqual(basic);
48
+ });
49
+ it("recursively converts arrays and sets into array types", async () => {
50
+ const attachment = "rid";
51
+ const attachmentArray = [attachment];
52
+ const attachmentSet = new Set(attachmentArray);
53
+ const recursiveConversion = await toDataValue({
54
+ attachment,
55
+ attachmentArray,
56
+ attachmentSet
57
+ }, clientCtx);
58
+ expect(recursiveConversion).toEqual({
59
+ attachment: "rid",
60
+ attachmentArray: ["rid"],
61
+ attachmentSet: ["rid"]
62
+ });
63
+ });
64
+ it("recursively handles structs", async () => {
65
+ const recursiveConversion = await toDataValue({
66
+ inner: {
67
+ attachment: "rid"
68
+ }
69
+ }, clientCtx);
70
+ expect(recursiveConversion).toEqual({
71
+ inner: {
72
+ attachment: "rid"
73
+ }
74
+ });
75
+ });
76
+ it("maps an ontology object into just its primary key", async () => {
77
+ const employee = stubData.employee1;
78
+ const ontologyConversion = await toDataValue(employee, clientCtx);
79
+ expect(ontologyConversion).toEqual(stubData.employee1.__primaryKey);
80
+ });
81
+ it("maps an ontology object into just its primary key with osdk wrapper", async () => {
82
+ const task = await client(Employee).fetchOne(50030);
83
+ const ontologyConversion = await toDataValue(task, clientCtx);
84
+ expect(ontologyConversion).toEqual(task.$primaryKey);
85
+ });
86
+ it("passes through object set definitions", async () => {
87
+ const clientObjectSet = client(Task).where({
88
+ id: 0
89
+ });
90
+ const definition = getWireObjectSet(clientObjectSet);
91
+ const expected = `
92
+ {
93
+ "objectSet": {
94
+ "objectType": "Task",
95
+ "type": "base",
96
+ },
97
+ "type": "filter",
98
+ "where": {
99
+ "field": "id",
100
+ "type": "eq",
101
+ "value": 0,
102
+ },
103
+ }
104
+ `;
105
+ const objectSetConversion = await toDataValue(clientObjectSet, clientCtx);
106
+ expect(objectSetConversion).toMatchInlineSnapshot(expected);
107
+ const definitionConversion = await toDataValue(definition, clientCtx);
108
+ expect(definitionConversion).toMatchInlineSnapshot(expected);
109
+ });
110
+ it("converts attachment uploads correctly", async () => {
111
+ const blob = stubData.attachmentUploadRequestBody[stubData.localAttachment1.filename];
112
+ const attachmentUpload = createAttachmentUpload(blob, "file1.txt");
113
+ const converted = await toDataValue(attachmentUpload, clientCtx);
114
+ expect(converted).toEqual("ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a75");
115
+ });
116
+ });
117
+ //# sourceMappingURL=toDataValue.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toDataValue.test.js","names":["$ontologyRid","Employee","Task","apiServer","MockOntology","stubData","afterAll","beforeAll","describe","expect","it","vi","createClient","createMinimalClient","createAttachmentUpload","getWireObjectSet","toDataValue","client","clientCtx","fn","listen","metadata","close","basic","null","undefined","boolean","date","integer","string","timestamp","convertedBasic","toEqual","attachment","attachmentArray","attachmentSet","Set","recursiveConversion","inner","employee","employee1","ontologyConversion","__primaryKey","task","fetchOne","$primaryKey","clientObjectSet","where","id","definition","expected","objectSetConversion","toMatchInlineSnapshot","definitionConversion","blob","attachmentUploadRequestBody","localAttachment1","filename","attachmentUpload","converted"],"sources":["toDataValue.test.js"],"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 */\nimport { $ontologyRid, Employee, Task } from \"@osdk/client.test.ontology\";\nimport { apiServer, MockOntology, stubData } from \"@osdk/shared.test\";\nimport { afterAll, beforeAll, describe, expect, it, vi } from \"vitest\";\nimport { createClient } from \"../createClient.js\";\nimport { createMinimalClient } from \"../createMinimalClient.js\";\nimport { createAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { toDataValue } from \"./toDataValue.js\";\ndescribe(toDataValue, () => {\n let client;\n let clientCtx;\n const mockFetch = vi.fn();\n beforeAll(async () => {\n apiServer.listen();\n client = createClient(\"https://stack.palantir.com\", $ontologyRid, async () => \"myAccessToken\");\n clientCtx = createMinimalClient(MockOntology.metadata, \"https://stack.palantir.com\", async () => \"myAccessToken\", {});\n });\n afterAll(() => {\n apiServer.close();\n });\n it(\"converts passthrough values correctly\", async () => {\n // basic pass through types\n const basic = {\n null: undefined,\n boolean: false,\n date: \"2024-01-01\",\n integer: 0,\n string: \"string\",\n timestamp: \"2024-01-01T00:00:00Z\",\n };\n const convertedBasic = await toDataValue(basic, clientCtx);\n expect(convertedBasic).toEqual(basic);\n });\n it(\"recursively converts arrays and sets into array types\", async () => {\n const attachment = \"rid\";\n const attachmentArray = [attachment];\n const attachmentSet = new Set(attachmentArray);\n const recursiveConversion = await toDataValue({\n attachment,\n attachmentArray,\n attachmentSet,\n }, clientCtx);\n expect(recursiveConversion).toEqual({\n attachment: \"rid\",\n attachmentArray: [\"rid\"],\n attachmentSet: [\"rid\"],\n });\n });\n it(\"recursively handles structs\", async () => {\n const struct = {\n inner: {\n attachment: \"rid\",\n },\n };\n const recursiveConversion = await toDataValue(struct, clientCtx);\n expect(recursiveConversion).toEqual({\n inner: { attachment: \"rid\" },\n });\n });\n it(\"maps an ontology object into just its primary key\", async () => {\n const employee = stubData.employee1;\n const ontologyConversion = await toDataValue(employee, clientCtx);\n expect(ontologyConversion).toEqual(stubData.employee1.__primaryKey);\n });\n it(\"maps an ontology object into just its primary key with osdk wrapper\", async () => {\n const task = await client(Employee).fetchOne(50030);\n const ontologyConversion = await toDataValue(task, clientCtx);\n expect(ontologyConversion).toEqual(task.$primaryKey);\n });\n it(\"passes through object set definitions\", async () => {\n const clientObjectSet = client(Task).where({ id: 0 });\n const definition = getWireObjectSet(clientObjectSet);\n const expected = `\n {\n \"objectSet\": {\n \"objectType\": \"Task\",\n \"type\": \"base\",\n },\n \"type\": \"filter\",\n \"where\": {\n \"field\": \"id\",\n \"type\": \"eq\",\n \"value\": 0,\n },\n }\n `;\n const objectSetConversion = await toDataValue(clientObjectSet, clientCtx);\n expect(objectSetConversion).toMatchInlineSnapshot(expected);\n const definitionConversion = await toDataValue(definition, clientCtx);\n expect(definitionConversion).toMatchInlineSnapshot(expected);\n });\n it(\"converts attachment uploads correctly\", async () => {\n const blob = stubData.attachmentUploadRequestBody[stubData.localAttachment1.filename];\n const attachmentUpload = createAttachmentUpload(blob, \"file1.txt\");\n const converted = await toDataValue(attachmentUpload, clientCtx);\n expect(converted).toEqual(\"ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a75\");\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,4BAA4B;AACzE,SAASC,SAAS,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,mBAAmB;AACrE,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,QAAQ;AACtE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,sBAAsB,QAAQ,+BAA+B;AACtE,SAASC,gBAAgB,QAAQ,iCAAiC;AAClE,SAASC,WAAW,QAAQ,kBAAkB;AAC9CR,QAAQ,CAACQ,WAAW,EAAE,MAAM;EACxB,IAAIC,MAAM;EACV,IAAIC,SAAS;EACKP,EAAE,C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e,EAAE5B,SAAS,CAAC;IACzET,MAAM,CAAC0C,mBAAmB,CAAC,CAACC,qBAAqB,CAACF,QAAQ,CAAC;IAC3D,MAAMG,oBAAoB,GAAG,MAAMrC,WAAW,CAACiC,UAAU,EAAE/B,SAAS,CAAC;IACrET,MAAM,CAAC4C,oBAAoB,CAAC,CAACD,qBAAqB,CAACF,QAAQ,CAAC;EAChE,CAAC,CAAC;EACFxC,EAAE,CAAC,uCAAuC,EAAE,YAAY;IACpD,MAAM4C,IAAI,GAAGjD,QAAQ,CAACkD,2BAA2B,CAAClD,QAAQ,CAACmD,gBAAgB,CAACC,QAAQ,CAAC;IACrF,MAAMC,gBAAgB,GAAG5C,sBAAsB,CAACwC,IAAI,EAAE,WAAW,CAAC;IAClE,MAAMK,SAAS,GAAG,MAAM3C,WAAW,CAAC0C,gBAAgB,EAAExC,SAAS,CAAC;IAChET,MAAM,CAACkD,SAAS,CAAC,CAAC3B,OAAO,CAAC,qEAAqE,CAAC;EACpG,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,107 @@
1
+ /*
2
+ * Copyright 2024 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
+ import * as OntologiesV2 from "@osdk/internal.foundry.ontologiesv2";
17
+ import { isAttachmentUpload } from "../object/AttachmentUpload.js";
18
+ import { getWireObjectSet, isObjectSet } from "../objectSet/createObjectSet.js";
19
+ import { isOsdkBaseObject } from "./isOsdkBaseObject.js";
20
+ import { isWireObjectSet } from "./WireObjectSet.js";
21
+ /**
22
+ * Marshall user-facing data into the wire DataValue type
23
+ *
24
+ * @see DataValue for the expected payloads
25
+ * @internal
26
+ */
27
+ export async function toDataValueQueries(value, client, desiredType) {
28
+ if (value == null) {
29
+ return value;
30
+ }
31
+ if (Array.isArray(value) && desiredType.multiplicity) {
32
+ const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType));
33
+ return Promise.all(promiseArray);
34
+ }
35
+ switch (desiredType.type) {
36
+ case "attachment":
37
+ {
38
+ if (isAttachmentUpload(value)) {
39
+ const attachment = await OntologiesV2.Attachments.upload(client, value, {
40
+ filename: value.name
41
+ });
42
+ return attachment.rid;
43
+ }
44
+ // If it's not an upload, it's just an attachment rid string which we can pass through
45
+ return value;
46
+ }
47
+ case "twoDimensionalAggregation":
48
+ {
49
+ return {
50
+ groups: value
51
+ };
52
+ }
53
+ case "threeDimensionalAggregation":
54
+ {
55
+ return {
56
+ groups: value
57
+ };
58
+ }
59
+ case "set":
60
+ {
61
+ if (value instanceof Set) {
62
+ const promiseArray = Array.from(value, async innerValue => await toDataValueQueries(innerValue, client, desiredType["set"]));
63
+ return Promise.all(promiseArray);
64
+ }
65
+ break;
66
+ }
67
+ case "object":
68
+ {
69
+ if (isOsdkBaseObject(value)) {
70
+ return value.$primaryKey;
71
+ }
72
+ break;
73
+ }
74
+ case "objectSet":
75
+ {
76
+ // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)
77
+ if (isWireObjectSet(value)) {
78
+ return value;
79
+ }
80
+ if (isObjectSet(value)) {
81
+ return getWireObjectSet(value);
82
+ }
83
+ break;
84
+ }
85
+ case "struct":
86
+ {
87
+ if (typeof value === "object") {
88
+ const structMap = {};
89
+ for (const [key, structValue] of Object.entries(value)) {
90
+ structMap[key] = await toDataValueQueries(structValue, client, desiredType["struct"][key]);
91
+ }
92
+ return structMap;
93
+ }
94
+ }
95
+ case "boolean":
96
+ case "date":
97
+ case "double":
98
+ case "float":
99
+ case "integer":
100
+ case "long":
101
+ case "string":
102
+ case "timestamp":
103
+ return value;
104
+ }
105
+ return value;
106
+ }
107
+ //# sourceMappingURL=toDataValueQueries.js.map