@osdk/client 2.0.0-beta.13 → 2.0.0-beta.15

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 (579) hide show
  1. package/CHANGELOG.md +40 -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 -725
  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 -2
  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 +6 -7
  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.js +17 -0
  361. package/build/esm/Logger.js.map +1 -0
  362. package/build/esm/MinimalClientContext.js +17 -0
  363. package/build/esm/MinimalClientContext.js.map +1 -0
  364. package/build/esm/ResultOrError.js +19 -0
  365. package/build/esm/ResultOrError.js.map +1 -0
  366. package/build/esm/SatisfiesSemver.js +17 -0
  367. package/build/esm/SatisfiesSemver.js.map +1 -0
  368. package/build/esm/SatisfiesSemver.test.js +69 -0
  369. package/build/esm/SatisfiesSemver.test.js.map +1 -0
  370. package/build/esm/__unstable/ConjureSupport.js +174 -0
  371. package/build/esm/__unstable/ConjureSupport.js.map +1 -0
  372. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts +1 -1
  373. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -1
  374. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js +114 -0
  375. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -0
  376. package/build/esm/actions/ActionValidationError.d.ts +1 -1
  377. package/build/esm/actions/ActionValidationError.d.ts.map +1 -1
  378. package/build/esm/actions/ActionValidationError.js +23 -0
  379. package/build/esm/actions/ActionValidationError.js.map +1 -0
  380. package/build/esm/actions/actions.test.js +323 -0
  381. package/build/esm/actions/actions.test.js.map +1 -0
  382. package/build/esm/actions/applyAction.d.ts +9 -10
  383. package/build/esm/actions/applyAction.d.ts.map +1 -1
  384. package/build/esm/actions/applyAction.js +114 -0
  385. package/build/esm/actions/applyAction.js.map +1 -0
  386. package/build/esm/createAttachmentFromRid.d.ts +1 -1
  387. package/build/esm/createAttachmentFromRid.d.ts.map +1 -1
  388. package/build/esm/createAttachmentFromRid.js +38 -0
  389. package/build/esm/createAttachmentFromRid.js.map +1 -0
  390. package/build/esm/createClient.d.ts.map +1 -1
  391. package/build/esm/createClient.js +88 -0
  392. package/build/esm/createClient.js.map +1 -0
  393. package/build/esm/createClient.test.js +45 -0
  394. package/build/esm/createClient.test.js.map +1 -0
  395. package/build/esm/createMinimalClient.js +42 -0
  396. package/build/esm/createMinimalClient.js.map +1 -0
  397. package/build/esm/createPlatformClient.js +33 -0
  398. package/build/esm/createPlatformClient.js.map +1 -0
  399. package/build/esm/createTimeseriesProperty.d.ts +12 -2
  400. package/build/esm/createTimeseriesProperty.d.ts.map +1 -1
  401. package/build/esm/createTimeseriesProperty.js +79 -0
  402. package/build/esm/createTimeseriesProperty.js.map +1 -0
  403. package/build/esm/definitions/LinkDefinitions.test.js +41 -0
  404. package/build/esm/definitions/LinkDefinitions.test.js.map +1 -0
  405. package/build/esm/fetchMetadata.js +35 -0
  406. package/build/esm/fetchMetadata.js.map +1 -0
  407. package/build/esm/fetchMetadata.test.js +218 -0
  408. package/build/esm/fetchMetadata.test.js.map +1 -0
  409. package/build/esm/index.d.ts +2 -2
  410. package/build/esm/index.d.ts.map +1 -1
  411. package/build/esm/index.js +22 -725
  412. package/build/esm/index.js.map +1 -1
  413. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js +25 -0
  414. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -0
  415. package/build/esm/intellisense.test.js +86 -0
  416. package/build/esm/intellisense.test.js.map +1 -0
  417. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js +34 -0
  418. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -0
  419. package/build/esm/internal/conversions/modernToLegacyAggregationClause.js +38 -0
  420. package/build/esm/internal/conversions/modernToLegacyAggregationClause.js.map +1 -0
  421. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +62 -0
  422. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -0
  423. package/build/esm/internal/conversions/modernToLegacyWhereClause.js +144 -0
  424. package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -0
  425. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +486 -0
  426. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -0
  427. package/build/esm/object/AttachmentUpload.d.ts +1 -1
  428. package/build/esm/object/AttachmentUpload.d.ts.map +1 -1
  429. package/build/esm/object/AttachmentUpload.js +27 -0
  430. package/build/esm/object/AttachmentUpload.js.map +1 -0
  431. package/build/esm/object/Cache.js +76 -0
  432. package/build/esm/object/Cache.js.map +1 -0
  433. package/build/esm/object/Cache.test.js +283 -0
  434. package/build/esm/object/Cache.test.js.map +1 -0
  435. package/build/esm/object/SimpleCache.js +67 -0
  436. package/build/esm/object/SimpleCache.js.map +1 -0
  437. package/build/esm/object/aggregate.js +69 -0
  438. package/build/esm/object/aggregate.js.map +1 -0
  439. package/build/esm/object/aggregate.test.js +398 -0
  440. package/build/esm/object/aggregate.test.js.map +1 -0
  441. package/build/esm/object/attachment.test.js +55 -0
  442. package/build/esm/object/attachment.test.js.map +1 -0
  443. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +4 -5
  444. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -1
  445. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js +17 -0
  446. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -0
  447. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts +2 -3
  448. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -1
  449. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js +22 -0
  450. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -0
  451. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js +17 -0
  452. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -0
  453. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -1
  454. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +48 -0
  455. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -0
  456. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +17 -0
  457. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -0
  458. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +82 -0
  459. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -0
  460. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +114 -0
  461. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -0
  462. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts +1 -1
  463. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -1
  464. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +55 -0
  465. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -0
  466. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +60 -0
  467. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -0
  468. package/build/esm/object/convertWireToOsdkObjects.js +150 -0
  469. package/build/esm/object/convertWireToOsdkObjects.js.map +1 -0
  470. package/build/esm/object/convertWireToOsdkObjects.test.js +254 -0
  471. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -0
  472. package/build/esm/object/fetchPage.d.ts +2 -3
  473. package/build/esm/object/fetchPage.d.ts.map +1 -1
  474. package/build/esm/object/fetchPage.js +135 -0
  475. package/build/esm/object/fetchPage.js.map +1 -0
  476. package/build/esm/object/fetchPage.test.js +106 -0
  477. package/build/esm/object/fetchPage.test.js.map +1 -0
  478. package/build/esm/object/fetchSingle.js +47 -0
  479. package/build/esm/object/fetchSingle.js.map +1 -0
  480. package/build/esm/object/object.test.d.ts +1 -1
  481. package/build/esm/object/object.test.d.ts.map +1 -1
  482. package/build/esm/object/object.test.js +179 -0
  483. package/build/esm/object/object.test.js.map +1 -0
  484. package/build/esm/object/timeseries.test.js +163 -0
  485. package/build/esm/object/timeseries.test.js.map +1 -0
  486. package/build/esm/objectSet/ObjectSet.test.js +313 -0
  487. package/build/esm/objectSet/ObjectSet.test.js.map +1 -0
  488. package/build/esm/objectSet/ObjectSetFactory.js +17 -0
  489. package/build/esm/objectSet/ObjectSetFactory.js.map +1 -0
  490. package/build/esm/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -1
  491. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +536 -0
  492. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -0
  493. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +338 -0
  494. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -0
  495. package/build/esm/objectSet/conjureUnionType.js +27 -0
  496. package/build/esm/objectSet/conjureUnionType.js.map +1 -0
  497. package/build/esm/objectSet/createObjectSet.js +136 -0
  498. package/build/esm/objectSet/createObjectSet.js.map +1 -0
  499. package/build/esm/objectSet/toConjureObjectSet.js +158 -0
  500. package/build/esm/objectSet/toConjureObjectSet.js.map +1 -0
  501. package/build/esm/ontology/OntologyProvider.d.ts +5 -5
  502. package/build/esm/ontology/OntologyProvider.d.ts.map +1 -1
  503. package/build/esm/ontology/OntologyProvider.js +17 -0
  504. package/build/esm/ontology/OntologyProvider.js.map +1 -0
  505. package/build/esm/ontology/StandardOntologyProvider.js +59 -0
  506. package/build/esm/ontology/StandardOntologyProvider.js.map +1 -0
  507. package/build/esm/ontology/StandardOntologyProvider.test.js +48 -0
  508. package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -0
  509. package/build/esm/ontology/loadActionMetadata.d.ts +1 -1
  510. package/build/esm/ontology/loadActionMetadata.d.ts.map +1 -1
  511. package/build/esm/ontology/loadActionMetadata.js +22 -0
  512. package/build/esm/ontology/loadActionMetadata.js.map +1 -0
  513. package/build/esm/ontology/loadFullObjectMetadata.d.ts +1 -1
  514. package/build/esm/ontology/loadFullObjectMetadata.d.ts.map +1 -1
  515. package/build/esm/ontology/loadFullObjectMetadata.js +28 -0
  516. package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -0
  517. package/build/esm/ontology/loadInterfaceMetadata.d.ts +1 -1
  518. package/build/esm/ontology/loadInterfaceMetadata.d.ts.map +1 -1
  519. package/build/esm/ontology/loadInterfaceMetadata.js +24 -0
  520. package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -0
  521. package/build/esm/ontology/loadQueryMetadata.js +22 -0
  522. package/build/esm/ontology/loadQueryMetadata.js.map +1 -0
  523. package/build/esm/ontology/makeConjureContext.js +28 -0
  524. package/build/esm/ontology/makeConjureContext.js.map +1 -0
  525. package/build/esm/pageRequestAsAsyncIter.js +37 -0
  526. package/build/esm/pageRequestAsAsyncIter.js.map +1 -0
  527. package/build/esm/public/unstable-do-not-use.js +16 -2
  528. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  529. package/build/esm/queries/applyQuery.d.ts +1 -2
  530. package/build/esm/queries/applyQuery.d.ts.map +1 -1
  531. package/build/esm/queries/applyQuery.js +234 -0
  532. package/build/esm/queries/applyQuery.js.map +1 -0
  533. package/build/esm/queries/queries.test.js +171 -0
  534. package/build/esm/queries/queries.test.js.map +1 -0
  535. package/build/esm/queries/types.d.ts +1 -2
  536. package/build/esm/queries/types.d.ts.map +1 -1
  537. package/build/esm/queries/types.js +17 -0
  538. package/build/esm/queries/types.js.map +1 -0
  539. package/build/esm/tsserver.js +133 -0
  540. package/build/esm/tsserver.js.map +1 -0
  541. package/build/esm/util/ArrayElement.js +17 -0
  542. package/build/esm/util/ArrayElement.js.map +1 -0
  543. package/build/esm/util/NOOP.js +17 -0
  544. package/build/esm/util/NOOP.js.map +1 -0
  545. package/build/esm/util/NullableProps.js +17 -0
  546. package/build/esm/util/NullableProps.js.map +1 -0
  547. package/build/esm/util/UserAgent.js +17 -0
  548. package/build/esm/util/UserAgent.js.map +1 -0
  549. package/build/esm/util/WireObjectSet.js +21 -0
  550. package/build/esm/util/WireObjectSet.js.map +1 -0
  551. package/build/esm/util/addUserAgentAndRequestContextHeaders.js +27 -0
  552. package/build/esm/util/addUserAgentAndRequestContextHeaders.js.map +1 -0
  553. package/build/esm/util/augmentRequestContext.js +52 -0
  554. package/build/esm/util/augmentRequestContext.js.map +1 -0
  555. package/build/esm/util/isOntologyObjectV2.js +20 -0
  556. package/build/esm/util/isOntologyObjectV2.js.map +1 -0
  557. package/build/esm/util/isOsdkBaseObject.d.ts +1 -1
  558. package/build/esm/util/isOsdkBaseObject.d.ts.map +1 -1
  559. package/build/esm/util/isOsdkBaseObject.js +19 -0
  560. package/build/esm/util/isOsdkBaseObject.js.map +1 -0
  561. package/build/esm/util/isOsdkObject.d.ts +1 -1
  562. package/build/esm/util/isOsdkObject.d.ts.map +1 -1
  563. package/build/esm/util/isOsdkObject.js +19 -0
  564. package/build/esm/util/isOsdkObject.js.map +1 -0
  565. package/build/esm/util/partialBy.js +17 -0
  566. package/build/esm/util/partialBy.js.map +1 -0
  567. package/build/esm/util/streamutils.js +95 -0
  568. package/build/esm/util/streamutils.js.map +1 -0
  569. package/build/esm/util/toDataValue.js +73 -0
  570. package/build/esm/util/toDataValue.js.map +1 -0
  571. package/build/esm/util/toDataValue.test.js +117 -0
  572. package/build/esm/util/toDataValue.test.js.map +1 -0
  573. package/build/esm/util/toDataValueQueries.js +107 -0
  574. package/build/esm/util/toDataValueQueries.js.map +1 -0
  575. package/package.json +14 -18
  576. package/build/browser/chunk-CG25K4WC.js +0 -2502
  577. package/build/browser/chunk-CG25K4WC.js.map +0 -1
  578. package/build/esm/chunk-MQTCPUPF.js +0 -2505
  579. package/build/esm/chunk-MQTCPUPF.js.map +0 -1
@@ -0,0 +1,133 @@
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 { execaNode } from "execa";
17
+ import { findUpMultiple } from "find-up";
18
+ import { EventEmitter } from "node:events";
19
+ import * as fs from "node:fs/promises";
20
+ import * as path from "node:path";
21
+ import pLocate from "p-locate";
22
+ import pMap from "p-map";
23
+ import invariant from "tiny-invariant";
24
+ import { server as s } from "typescript";
25
+ class TsServerImpl extends EventEmitter {
26
+ #tsServerPath;
27
+ #nextSeq = 1;
28
+ #subprocess;
29
+ #logger;
30
+ constructor(tsServerPath, logger) {
31
+ super();
32
+ this.#tsServerPath = tsServerPath;
33
+ this.#logger = logger;
34
+ }
35
+ get subprocess() {
36
+ return this.#subprocess;
37
+ }
38
+ async start() {
39
+ this.#subprocess = execaNode({
40
+ ipc: true,
41
+ serialization: "json"
42
+ })`${this.#tsServerPath} --useNodeIpc`;
43
+ if (this.#logger.isLevelEnabled("trace")) {
44
+ this.#subprocess.on("message", req => {
45
+ this.#logger.trace({
46
+ req
47
+ }, "message received");
48
+ });
49
+ }
50
+ this.#subprocess.on("exit", () => {
51
+ this.#logger.info("tsserver exited");
52
+ this.emit("exit");
53
+ });
54
+ return this;
55
+ }
56
+ stop() {
57
+ if (this.#subprocess?.connected) {
58
+ this.#subprocess?.disconnect();
59
+ }
60
+ }
61
+ async getOneMessage(filter) {
62
+ return await this.subprocess.getOneMessage({
63
+ filter
64
+ });
65
+ }
66
+ #requestFactory = (command, isResponse) => async args => {
67
+ return await this.#makeRequest(command, args, isResponse);
68
+ };
69
+ sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);
70
+ sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);
71
+ async #makeRequest(command, args, isResponse) {
72
+ const seq = this.#nextSeq++;
73
+ const req = {
74
+ type: "request",
75
+ command,
76
+ arguments: args,
77
+ seq
78
+ };
79
+ this.#logger.trace({
80
+ req
81
+ }, "requesting");
82
+ await this.#subprocess?.sendMessage(req);
83
+ if (isResponse) {
84
+ return {
85
+ req,
86
+ resp: await this.#subprocess?.getOneMessage({
87
+ filter: isResponse
88
+ })
89
+ };
90
+ }
91
+ return {
92
+ req,
93
+ resp: undefined
94
+ };
95
+ }
96
+ }
97
+ export async function startTsServer(logger) {
98
+ const tsServerPath = await getTsServerPath();
99
+ !(tsServerPath != null) ? invariant(false) : void 0;
100
+ return new TsServerImpl(tsServerPath, logger).start();
101
+ }
102
+ async function getTsServerPath() {
103
+ const nodeModuleDirs = await findUpMultiple("node_modules", {
104
+ cwd: import.meta.url,
105
+ type: "directory"
106
+ });
107
+ const possibleTsServerPaths = await pMap(nodeModuleDirs, dir => path.join(dir, "typescript", "lib", "tsserver.js"));
108
+ const tsServerPath = await pLocate(["no", ...possibleTsServerPaths], async dir => {
109
+ try {
110
+ const c = await fs.stat(dir);
111
+ return c.isFile();
112
+ } catch (e) {
113
+ return false;
114
+ }
115
+ });
116
+ return tsServerPath;
117
+ }
118
+ export function isEvent(m) {
119
+ return !!(m && typeof m === "object" && "type" in m && m.type === "event");
120
+ }
121
+ export function isResponse(m) {
122
+ return !!(m && typeof m === "object" && "type" in m && m.type === "response");
123
+ }
124
+ export function isProjectLoadingStart(m) {
125
+ return isEvent(m) && m.event === "projectLoadingStart";
126
+ }
127
+ export function isProjectLoadingEnd(m) {
128
+ return isEvent(m) && m.event === "projectLoadingFinish";
129
+ }
130
+ export function isQuickInfoResponse(m, requestSeq) {
131
+ return isResponse(m) && m.command === s.protocol.CommandTypes.Quickinfo && (requestSeq == null || m.request_seq === requestSeq);
132
+ }
133
+ //# sourceMappingURL=tsserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsserver.js","names":["execaNode","findUpMultiple","EventEmitter","fs","path","pLocate","pMap","invariant","server","s","TsServerImpl","tsServerPath","nextSeq","subprocess","logger","constructor","start","ipc","serialization","isLevelEnabled","on","req","trace","info","emit","stop","connected","disconnect","getOneMessage","filter","requestFactory","#requestFactory","command","isResponse","args","makeRequest","sendOpenRequest","protocol","CommandTypes","Open","sendQuickInfoRequest","Quickinfo","isQuickInfoResponse","#makeRequest","seq","type","arguments","sendMessage","resp","undefined","startTsServer","getTsServerPath","nodeModuleDirs","cwd","import","meta","url","possibleTsServerPaths","dir","join","c","stat","isFile","e","isEvent","m","isProjectLoadingStart","event","isProjectLoadingEnd","requestSeq","request_seq"],"sources":["tsserver.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 { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\nclass TsServerImpl extends EventEmitter {\n #tsServerPath;\n #nextSeq = 1;\n #subprocess;\n #logger;\n constructor(tsServerPath, logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n get subprocess() {\n return this.#subprocess;\n }\n async start() {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\",\n }) `${this.#tsServerPath} --useNodeIpc`;\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", (req) => {\n this.#logger.trace({ req }, \"message received\");\n });\n }\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n stop() {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n async getOneMessage(filter) {\n return await this.subprocess.getOneMessage({ filter });\n }\n #requestFactory = (command, isResponse) => async (args) => {\n return await this.#makeRequest(command, args, isResponse);\n };\n sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);\n sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);\n async #makeRequest(command, args, isResponse) {\n const seq = this.#nextSeq++;\n const req = {\n type: \"request\",\n command,\n arguments: args,\n seq,\n };\n this.#logger.trace({ req }, \"requesting\");\n await this.#subprocess?.sendMessage(req);\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse,\n }),\n };\n }\n return { req, resp: undefined };\n }\n}\nexport async function startTsServer(logger) {\n const tsServerPath = await getTsServerPath();\n invariant(tsServerPath != null);\n return new TsServerImpl(tsServerPath, logger).start();\n}\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\",\n });\n const possibleTsServerPaths = await pMap(nodeModuleDirs, (dir) => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"));\n const tsServerPath = await pLocate([\"no\", ...possibleTsServerPaths], async (dir) => {\n try {\n const c = await fs.stat(dir);\n return c.isFile();\n }\n catch (e) {\n return false;\n }\n });\n return tsServerPath;\n}\nexport function isEvent(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"event\");\n}\nexport function isResponse(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"response\");\n}\nexport function isProjectLoadingStart(m) {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(m) {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(m, requestSeq) {\n return isResponse(m) && m.command === s.protocol.CommandTypes.Quickinfo\n && (requestSeq == null || m.request_seq === requestSeq);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,OAAO,MAAM,UAAU;AAC9B,OAAOC,IAAI,MAAM,OAAO;AACxB,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,MAAM,IAAIC,CAAC,QAAQ,YAAY;AACxC,MAAMC,YAAY,SAASR,YAAY,CAAC;EACpC,CAACS,YAAY;EACb,CAACC,OAAO,GAAG,CAAC;EACZ,CAACC,UAAU;EACX,CAACC,MAAM;EACPC,WAAWA,CAACJ,YAAY,EAAEG,MAAM,EAAE;IAC9B,KAAK,CAAC,CAAC;IACP,IAAI,CAAC,CAACH,YAAY,GAAGA,YAAY;IACjC,IAAI,CAAC,CAACG,MAAM,GAAGA,MAAM;EACzB;EACA,IAAID,UAAUA,CAAA,EAAG;IACb,OAAO,IAAI,CAAC,CAACA,UAAU;EAC3B;EACA,MAAMG,KAAKA,CAAA,EAAG;IACV,IAAI,CAAC,CAACH,UAAU,GAAGb,SAAS,CAAC;MACzBiB,GAAG,EAAE,IAAI;MACTC,aAAa,EAAE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ights 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=ArrayElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrayElement.js","names":[],"sources":["ArrayElement.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,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=NOOP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NOOP.js","names":[],"sources":["NOOP.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,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=NullableProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NullableProps.js","names":[],"sources":["NullableProps.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,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 const USER_AGENT = `osdk-client/${"2.0.0-beta.15"}`;
17
+ //# sourceMappingURL=UserAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserAgent.js","names":["USER_AGENT"],"sources":["UserAgent.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 const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gCAA4C","ignoreList":[]}
@@ -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
+ const WIRE_OBJECT_SET_TYPES = new Set(["base", "filter", "intersect", "reference", "searchAround", "static", "subtract", "union"]);
17
+ /** @internal */
18
+ export function isWireObjectSet(o) {
19
+ return o != null && typeof o === "object" && WIRE_OBJECT_SET_TYPES.has(o.type);
20
+ }
21
+ //# sourceMappingURL=WireObjectSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WireObjectSet.js","names":["WIRE_OBJECT_SET_TYPES","Set","isWireObjectSet","o","has","type"],"sources":["WireObjectSet.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 WIRE_OBJECT_SET_TYPES = new Set([\n \"base\",\n \"filter\",\n \"intersect\",\n \"reference\",\n \"searchAround\",\n \"static\",\n \"subtract\",\n \"union\",\n]);\n/** @internal */\nexport function isWireObjectSet(o) {\n return o != null && typeof o === \"object\"\n && WIRE_OBJECT_SET_TYPES.has(o.type);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAAC,CAClC,MAAM,EACN,QAAQ,EACR,WAAW,EACX,WAAW,EACX,cAAc,EACd,QAAQ,EACR,UAAU,EACV,OAAO,CACV,CAAC;AACF;AACA,OAAO,SAASC,eAAeA,CAACC,CAAC,EAAE;EAC/B,OAAOA,CAAC,IAAI,IAAI,IAAI,OAAOA,CAAC,KAAK,QAAQ,IAClCH,qBAAqB,CAACI,GAAG,CAACD,CAAC,CAACE,IAAI,CAAC;AAC5C","ignoreList":[]}
@@ -0,0 +1,27 @@
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 { createFetchHeaderMutator } from "@osdk/shared.net.fetch";
17
+ export const addUserAgentAndRequestContextHeaders = (client, withMetadata) => ({
18
+ ...client,
19
+ fetch: createFetchHeaderMutator(client.fetch, headers => {
20
+ headers.set("X-OSDK-Request-Context", JSON.stringify(client.requestContext));
21
+ if (withMetadata.osdkMetadata) {
22
+ headers.set("Fetch-User-Agent", withMetadata.osdkMetadata.extraUserAgent);
23
+ }
24
+ return headers;
25
+ })
26
+ });
27
+ //# sourceMappingURL=addUserAgentAndRequestContextHeaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addUserAgentAndRequestContextHeaders.js","names":["createFetchHeaderMutator","addUserAgentAndRequestContextHeaders","client","withMetadata","fetch","headers","set","JSON","stringify","requestContext","osdkMetadata","extraUserAgent"],"sources":["addUserAgentAndRequestContextHeaders.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 { createFetchHeaderMutator } from \"@osdk/shared.net.fetch\";\nexport const addUserAgentAndRequestContextHeaders = (client, withMetadata) => ({\n ...client,\n fetch: createFetchHeaderMutator(client.fetch, (headers) => {\n headers.set(\"X-OSDK-Request-Context\", JSON.stringify(client.requestContext));\n if (withMetadata.osdkMetadata) {\n headers.set(\"Fetch-User-Agent\", withMetadata.osdkMetadata.extraUserAgent);\n }\n return headers;\n }),\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,wBAAwB,QAAQ,wBAAwB;AACjE,OAAO,MAAMC,oCAAoC,GAAGA,CAACC,MAAM,EAAEC,YAAY,MAAM;EAC3E,GAAGD,MAAM;EACTE,KAAK,EAAEJ,wBAAwB,CAACE,MAAM,CAACE,KAAK,EAAGC,OAAO,IAAK;IACvDA,OAAO,CAACC,GAAG,CAAC,wBAAwB,EAAEC,IAAI,CAACC,SAAS,CAACN,MAAM,CAACO,cAAc,CAAC,CAAC;IAC5E,IAAIN,YAAY,CAACO,YAAY,EAAE;MAC3BL,OAAO,CAACC,GAAG,CAAC,kBAAkB,EAAEH,YAAY,CAACO,YAAY,CAACC,cAAc,CAAC;IAC7E;IACA,OAAON,OAAO;EAClB,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
@@ -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,GAA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