@osdk/client 2.1.0-beta.9 → 2.1.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 (1167) hide show
  1. package/CHANGELOG.md +529 -0
  2. package/build/browser/Client.js +7 -0
  3. package/build/browser/Client.js.map +1 -1
  4. package/build/browser/Definitions.test.js +1 -0
  5. package/build/browser/Definitions.test.js.map +1 -1
  6. package/build/browser/Logger.js +0 -15
  7. package/build/browser/Logger.js.map +1 -1
  8. package/build/browser/MinimalClientContext.js +0 -15
  9. package/build/browser/MinimalClientContext.js.map +1 -1
  10. package/build/browser/ResultOrError.js +1 -0
  11. package/build/browser/ResultOrError.js.map +1 -1
  12. package/build/browser/SatisfiesSemver.js +0 -15
  13. package/build/browser/SatisfiesSemver.js.map +1 -1
  14. package/build/browser/SatisfiesSemver.test.js +1 -0
  15. package/build/browser/SatisfiesSemver.test.js.map +1 -1
  16. package/build/browser/__unstable/ConjureSupport.js +8 -2
  17. package/build/browser/__unstable/ConjureSupport.js.map +1 -1
  18. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js +5 -1
  19. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -1
  20. package/build/browser/actions/ActionValidationError.js +1 -1
  21. package/build/browser/actions/ActionValidationError.js.map +1 -1
  22. package/build/browser/actions/actions.test.js +85 -4
  23. package/build/browser/actions/actions.test.js.map +1 -1
  24. package/build/browser/actions/applyAction.js +2 -1
  25. package/build/browser/actions/applyAction.js.map +1 -1
  26. package/build/browser/createClient.js +37 -26
  27. package/build/browser/createClient.js.map +1 -1
  28. package/build/browser/createClient.test.js +25 -0
  29. package/build/browser/createClient.test.js.map +1 -1
  30. package/build/browser/createGeotimeSeriesProperty.js +5 -3
  31. package/build/browser/createGeotimeSeriesProperty.js.map +1 -1
  32. package/build/browser/createMediaReferenceProperty.js +47 -0
  33. package/build/browser/createMediaReferenceProperty.js.map +1 -0
  34. package/build/browser/createMinimalClient.js +8 -1
  35. package/build/browser/createMinimalClient.js.map +1 -1
  36. package/build/browser/createPlatformClient.js +1 -0
  37. package/build/browser/createPlatformClient.js.map +1 -1
  38. package/build/browser/createTimeseriesProperty.js +2 -1
  39. package/build/browser/createTimeseriesProperty.js.map +1 -1
  40. package/build/browser/definitions/LinkDefinitions.test.js +4 -0
  41. package/build/browser/definitions/LinkDefinitions.test.js.map +1 -1
  42. package/build/browser/fetchMetadata.js +2 -0
  43. package/build/browser/fetchMetadata.js.map +1 -1
  44. package/build/browser/fetchMetadata.test.js +19 -0
  45. package/build/browser/fetchMetadata.test.js.map +1 -1
  46. package/build/browser/index.js +2 -0
  47. package/build/browser/index.js.map +1 -1
  48. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js +3 -1
  49. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -1
  50. package/build/browser/intellisense.test.js +4 -1
  51. package/build/browser/intellisense.test.js.map +1 -1
  52. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js +2 -0
  53. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -1
  54. package/build/browser/internal/conversions/modernToLegacyAggregationClause.js +2 -0
  55. package/build/browser/internal/conversions/modernToLegacyAggregationClause.js.map +1 -1
  56. package/build/browser/internal/conversions/modernToLegacyGroupByClause.js +1 -0
  57. package/build/browser/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
  58. package/build/browser/internal/conversions/modernToLegacyWhereClause.js +67 -18
  59. package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  60. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +402 -14
  61. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
  62. package/build/browser/object/AttachmentUpload.js +6 -13
  63. package/build/browser/object/AttachmentUpload.js.map +1 -1
  64. package/build/browser/object/Cache.js +27 -0
  65. package/build/browser/object/Cache.js.map +1 -1
  66. package/build/browser/object/Cache.test.js +10 -3
  67. package/build/browser/object/Cache.test.js.map +1 -1
  68. package/build/browser/object/SimpleCache.js +20 -0
  69. package/build/browser/object/SimpleCache.js.map +1 -1
  70. package/build/browser/object/aggregate.js +7 -9
  71. package/build/browser/object/aggregate.js.map +1 -1
  72. package/build/browser/object/aggregate.test.js +11 -9
  73. package/build/browser/object/aggregate.test.js.map +1 -1
  74. package/build/browser/object/attachment.test.js +1 -0
  75. package/build/browser/object/attachment.test.js.map +1 -1
  76. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js +0 -15
  77. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
  78. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js +4 -5
  79. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -1
  80. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js +0 -15
  81. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -1
  82. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +4 -1
  83. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
  84. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +0 -15
  85. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -1
  86. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +42 -85
  87. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  88. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.js +1 -6
  89. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.js.map +1 -1
  90. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +88 -88
  91. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  92. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +9 -3
  93. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
  94. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +15 -38
  95. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
  96. package/build/browser/object/convertWireToOsdkObjects.js +51 -4
  97. package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
  98. package/build/browser/object/convertWireToOsdkObjects.test.js +197 -44
  99. package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
  100. package/build/browser/object/fetchPage.js +42 -24
  101. package/build/browser/object/fetchPage.js.map +1 -1
  102. package/build/browser/object/fetchPage.test.js +80 -1
  103. package/build/browser/object/fetchPage.test.js.map +1 -1
  104. package/build/browser/object/fetchSingle.js +3 -0
  105. package/build/browser/object/fetchSingle.js.map +1 -1
  106. package/build/browser/object/geotimeseriesreference.test.js +2 -0
  107. package/build/browser/object/geotimeseriesreference.test.js.map +1 -1
  108. package/build/browser/object/media.test.js +55 -0
  109. package/build/browser/object/media.test.js.map +1 -0
  110. package/build/browser/object/mediaUpload.js +20 -0
  111. package/build/browser/object/mediaUpload.js.map +1 -0
  112. package/build/browser/object/object.test.js +203 -10
  113. package/build/browser/object/object.test.js.map +1 -1
  114. package/build/browser/object/timeseries.test.js +11 -0
  115. package/build/browser/object/timeseries.test.js.map +1 -1
  116. package/build/browser/objectSet/InterfaceObjectSet.test.js +65 -0
  117. package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -0
  118. package/build/browser/objectSet/ObjectSet.test.js +140 -28
  119. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  120. package/build/browser/objectSet/ObjectSetFactory.js +0 -15
  121. package/build/browser/objectSet/ObjectSetFactory.js.map +1 -1
  122. package/build/browser/objectSet/ObjectSetListenerWebsocket.js +117 -37
  123. package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  124. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +53 -26
  125. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
  126. package/build/browser/objectSet/conjureUnionType.js +1 -0
  127. package/build/browser/objectSet/conjureUnionType.js.map +1 -1
  128. package/build/browser/objectSet/createObjectSet.js +9 -6
  129. package/build/browser/objectSet/createObjectSet.js.map +1 -1
  130. package/build/browser/observable/DebugFlags.js +19 -0
  131. package/build/browser/observable/DebugFlags.js.map +1 -0
  132. package/build/browser/observable/ListPayload.js +2 -0
  133. package/build/browser/observable/ListPayload.js.map +1 -0
  134. package/build/browser/observable/ObjectPayload.js +2 -0
  135. package/build/browser/observable/ObjectPayload.js.map +1 -0
  136. package/build/browser/observable/ObservableClient.js +23 -0
  137. package/build/browser/observable/ObservableClient.js.map +1 -0
  138. package/build/browser/observable/OptimisticBuilder.js +2 -0
  139. package/build/browser/observable/OptimisticBuilder.js.map +1 -0
  140. package/build/browser/observable/internal/CacheKey.js +2 -0
  141. package/build/browser/observable/internal/CacheKey.js.map +1 -0
  142. package/build/browser/observable/internal/CacheKeys.js +60 -0
  143. package/build/browser/observable/internal/CacheKeys.js.map +1 -0
  144. package/build/browser/observable/internal/Canonical.js +2 -0
  145. package/build/browser/observable/internal/Canonical.js.map +1 -0
  146. package/build/browser/observable/internal/ChangedObjects.js +24 -0
  147. package/build/browser/observable/internal/ChangedObjects.js.map +1 -0
  148. package/build/browser/observable/internal/Layer.js +76 -0
  149. package/build/browser/observable/internal/Layer.js.map +1 -0
  150. package/build/browser/observable/internal/ListQuery.js +250 -0
  151. package/build/browser/observable/internal/ListQuery.js.map +1 -0
  152. package/build/browser/observable/internal/ObjectQuery.js +71 -0
  153. package/build/browser/observable/internal/ObjectQuery.js.map +1 -0
  154. package/build/browser/observable/internal/ObservableClientImpl.js +38 -0
  155. package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -0
  156. package/build/browser/observable/internal/OptimisticId.js +30 -0
  157. package/build/browser/observable/internal/OptimisticId.js.map +1 -0
  158. package/build/browser/observable/internal/OptimisticJob.js +91 -0
  159. package/build/browser/observable/internal/OptimisticJob.js.map +1 -0
  160. package/build/browser/observable/internal/Query.js +70 -0
  161. package/build/browser/observable/internal/Query.js.map +1 -0
  162. package/build/browser/observable/internal/RefCounts.js +77 -0
  163. package/build/browser/observable/internal/RefCounts.js.map +1 -0
  164. package/build/browser/observable/internal/Store.js +464 -0
  165. package/build/browser/observable/internal/Store.js.map +1 -0
  166. package/build/browser/observable/internal/Store.test.js +765 -0
  167. package/build/browser/observable/internal/Store.test.js.map +1 -0
  168. package/build/browser/observable/internal/WeakMapWithEntries.js +124 -0
  169. package/build/browser/observable/internal/WeakMapWithEntries.js.map +1 -0
  170. package/build/browser/observable/internal/WhereClauseCanonicalizer.js +83 -0
  171. package/build/browser/observable/internal/WhereClauseCanonicalizer.js.map +1 -0
  172. package/build/browser/observable/internal/WhereClauseCanonicalizer.test.js +131 -0
  173. package/build/browser/observable/internal/WhereClauseCanonicalizer.test.js.map +1 -0
  174. package/build/browser/observable/internal/objectMatchesWhereClause.js +112 -0
  175. package/build/browser/observable/internal/objectMatchesWhereClause.js.map +1 -0
  176. package/build/browser/observable/internal/objectMatchesWhereClause.test.js +121 -0
  177. package/build/browser/observable/internal/objectMatchesWhereClause.test.js.map +1 -0
  178. package/build/browser/observable/internal/testUtils.js +178 -0
  179. package/build/browser/observable/internal/testUtils.js.map +1 -0
  180. package/build/browser/observable/types.js +2 -0
  181. package/build/browser/observable/types.js.map +1 -0
  182. package/build/browser/ontology/OntologyProvider.js +1 -0
  183. package/build/browser/ontology/OntologyProvider.js.map +1 -1
  184. package/build/browser/ontology/StandardOntologyProvider.js +2 -0
  185. package/build/browser/ontology/StandardOntologyProvider.js.map +1 -1
  186. package/build/browser/ontology/StandardOntologyProvider.test.js +2 -0
  187. package/build/browser/ontology/StandardOntologyProvider.test.js.map +1 -1
  188. package/build/browser/ontology/loadActionMetadata.js +2 -1
  189. package/build/browser/ontology/loadActionMetadata.js.map +1 -1
  190. package/build/browser/ontology/loadFullObjectMetadata.js +2 -1
  191. package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -1
  192. package/build/browser/ontology/loadInterfaceMetadata.js +2 -1
  193. package/build/browser/ontology/loadInterfaceMetadata.js.map +1 -1
  194. package/build/browser/ontology/loadQueryMetadata.js +2 -1
  195. package/build/browser/ontology/loadQueryMetadata.js.map +1 -1
  196. package/build/browser/ontology/makeConjureContext.js +1 -0
  197. package/build/browser/ontology/makeConjureContext.js.map +1 -1
  198. package/build/browser/pageRequestAsAsyncIter.js +1 -0
  199. package/build/browser/pageRequestAsAsyncIter.js.map +1 -1
  200. package/build/browser/public/internal.js +20 -0
  201. package/build/browser/public/internal.js.map +1 -0
  202. package/build/browser/public/unstable-do-not-use.js +5 -0
  203. package/build/browser/public/unstable-do-not-use.js.map +1 -1
  204. package/build/browser/public-utils/createAndFetchTempObjectSetRid.js +34 -0
  205. package/build/browser/public-utils/createAndFetchTempObjectSetRid.js.map +1 -0
  206. package/build/browser/public-utils/hydrateAttachmentFromRid.js +45 -0
  207. package/build/browser/public-utils/hydrateAttachmentFromRid.js.map +1 -0
  208. package/build/browser/public-utils/hydrateObjectSetFromRid.js +39 -0
  209. package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -0
  210. package/build/browser/queries/applyQuery.js +5 -5
  211. package/build/browser/queries/applyQuery.js.map +1 -1
  212. package/build/browser/queries/queries.test.js +9 -0
  213. package/build/browser/queries/queries.test.js.map +1 -1
  214. package/build/browser/queries/types.js +0 -15
  215. package/build/browser/queries/types.js.map +1 -1
  216. package/build/browser/tsserver.js +1 -0
  217. package/build/browser/tsserver.js.map +1 -1
  218. package/build/browser/util/ArrayElement.js +0 -15
  219. package/build/browser/util/ArrayElement.js.map +1 -1
  220. package/build/browser/util/NOOP.js +0 -15
  221. package/build/browser/util/NOOP.js.map +1 -1
  222. package/build/browser/util/NullableProps.js +0 -15
  223. package/build/browser/util/NullableProps.js.map +1 -1
  224. package/build/browser/util/UserAgent.js +2 -1
  225. package/build/browser/util/UserAgent.js.map +1 -1
  226. package/build/browser/util/WireObjectSet.js +2 -0
  227. package/build/browser/util/WireObjectSet.js.map +1 -1
  228. package/build/browser/util/addUserAgentAndRequestContextHeaders.js +1 -0
  229. package/build/browser/util/addUserAgentAndRequestContextHeaders.js.map +1 -1
  230. package/build/browser/util/augmentRequestContext.js +1 -0
  231. package/build/browser/util/augmentRequestContext.js.map +1 -1
  232. package/build/browser/util/datetimeConverters.js +60 -0
  233. package/build/browser/util/datetimeConverters.js.map +1 -0
  234. package/build/browser/util/datetimeConverters.test.js +76 -0
  235. package/build/browser/util/datetimeConverters.test.js.map +1 -0
  236. package/build/browser/util/interfaceUtils.js +21 -0
  237. package/build/browser/util/interfaceUtils.js.map +1 -0
  238. package/build/browser/util/isOntologyObjectV2.js +1 -0
  239. package/build/browser/util/isOntologyObjectV2.js.map +1 -1
  240. package/build/browser/util/isOsdkBaseObject.js +1 -0
  241. package/build/browser/util/isOsdkBaseObject.js.map +1 -1
  242. package/build/browser/util/isOsdkObject.js +1 -0
  243. package/build/browser/util/isOsdkObject.js.map +1 -1
  244. package/build/browser/util/objectSetUtils.js +26 -0
  245. package/build/browser/util/objectSetUtils.js.map +1 -0
  246. package/build/browser/util/partialBy.js +0 -15
  247. package/build/browser/util/partialBy.js.map +1 -1
  248. package/build/browser/util/streamutils.js +7 -0
  249. package/build/browser/util/streamutils.js.map +1 -1
  250. package/build/browser/util/timeseriesUtils.js +2 -1
  251. package/build/browser/util/timeseriesUtils.js.map +1 -1
  252. package/build/browser/util/toDataValue.js +28 -2
  253. package/build/browser/util/toDataValue.js.map +1 -1
  254. package/build/browser/util/toDataValue.test.js +14 -1
  255. package/build/browser/util/toDataValue.test.js.map +1 -1
  256. package/build/browser/util/toDataValueQueries.js +10 -1
  257. package/build/browser/util/toDataValueQueries.js.map +1 -1
  258. package/build/cjs/Client-C8K3E1vH.d.cts +67 -0
  259. package/build/cjs/chunk-65QQ6SME.cjs +922 -0
  260. package/build/cjs/chunk-65QQ6SME.cjs.map +1 -0
  261. package/build/cjs/chunk-FEUFIE6T.cjs +465 -0
  262. package/build/cjs/chunk-FEUFIE6T.cjs.map +1 -0
  263. package/build/cjs/chunk-Q7SFCCGT.cjs +11 -0
  264. package/build/cjs/chunk-Q7SFCCGT.cjs.map +1 -0
  265. package/build/cjs/graphql-JJX5MZPQ.cjs +10491 -0
  266. package/build/cjs/graphql-JJX5MZPQ.cjs.map +1 -0
  267. package/build/cjs/index.cjs +1665 -0
  268. package/build/cjs/index.cjs.map +1 -0
  269. package/build/cjs/index.d.cts +85 -0
  270. package/build/cjs/public/internal.cjs +36 -0
  271. package/build/cjs/public/internal.cjs.map +1 -0
  272. package/build/cjs/public/internal.d.cts +33 -0
  273. package/build/cjs/public/unstable-do-not-use.cjs +1248 -0
  274. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -0
  275. package/build/cjs/public/unstable-do-not-use.d.cts +62 -0
  276. package/build/esm/Client.js +7 -0
  277. package/build/esm/Client.js.map +1 -1
  278. package/build/esm/Definitions.test.js +1 -0
  279. package/build/esm/Definitions.test.js.map +1 -1
  280. package/build/esm/Logger.js +0 -15
  281. package/build/esm/Logger.js.map +1 -1
  282. package/build/esm/MinimalClientContext.js +0 -15
  283. package/build/esm/MinimalClientContext.js.map +1 -1
  284. package/build/esm/ResultOrError.js +1 -0
  285. package/build/esm/ResultOrError.js.map +1 -1
  286. package/build/esm/SatisfiesSemver.js +0 -15
  287. package/build/esm/SatisfiesSemver.js.map +1 -1
  288. package/build/esm/SatisfiesSemver.test.js +1 -0
  289. package/build/esm/SatisfiesSemver.test.js.map +1 -1
  290. package/build/esm/__unstable/ConjureSupport.js +8 -2
  291. package/build/esm/__unstable/ConjureSupport.js.map +1 -1
  292. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js +5 -1
  293. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -1
  294. package/build/esm/actions/ActionValidationError.js +1 -1
  295. package/build/esm/actions/ActionValidationError.js.map +1 -1
  296. package/build/esm/actions/actions.test.js +85 -4
  297. package/build/esm/actions/actions.test.js.map +1 -1
  298. package/build/esm/actions/applyAction.js +2 -1
  299. package/build/esm/actions/applyAction.js.map +1 -1
  300. package/build/esm/createClient.js +37 -26
  301. package/build/esm/createClient.js.map +1 -1
  302. package/build/esm/createClient.test.js +25 -0
  303. package/build/esm/createClient.test.js.map +1 -1
  304. package/build/esm/createGeotimeSeriesProperty.js +5 -3
  305. package/build/esm/createGeotimeSeriesProperty.js.map +1 -1
  306. package/build/esm/createMediaReferenceProperty.js +47 -0
  307. package/build/esm/createMediaReferenceProperty.js.map +1 -0
  308. package/build/esm/createMinimalClient.js +8 -1
  309. package/build/esm/createMinimalClient.js.map +1 -1
  310. package/build/esm/createPlatformClient.js +1 -0
  311. package/build/esm/createPlatformClient.js.map +1 -1
  312. package/build/esm/createTimeseriesProperty.js +2 -1
  313. package/build/esm/createTimeseriesProperty.js.map +1 -1
  314. package/build/esm/definitions/LinkDefinitions.test.js +4 -0
  315. package/build/esm/definitions/LinkDefinitions.test.js.map +1 -1
  316. package/build/esm/fetchMetadata.js +2 -0
  317. package/build/esm/fetchMetadata.js.map +1 -1
  318. package/build/esm/fetchMetadata.test.js +19 -0
  319. package/build/esm/fetchMetadata.test.js.map +1 -1
  320. package/build/esm/index.js +2 -0
  321. package/build/esm/index.js.map +1 -1
  322. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js +3 -1
  323. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -1
  324. package/build/esm/intellisense.test.js +4 -1
  325. package/build/esm/intellisense.test.js.map +1 -1
  326. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js +2 -0
  327. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -1
  328. package/build/esm/internal/conversions/modernToLegacyAggregationClause.js +2 -0
  329. package/build/esm/internal/conversions/modernToLegacyAggregationClause.js.map +1 -1
  330. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +1 -0
  331. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
  332. package/build/esm/internal/conversions/modernToLegacyWhereClause.js +67 -18
  333. package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  334. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +402 -14
  335. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
  336. package/build/esm/object/AttachmentUpload.js +6 -13
  337. package/build/esm/object/AttachmentUpload.js.map +1 -1
  338. package/build/esm/object/Cache.js +27 -0
  339. package/build/esm/object/Cache.js.map +1 -1
  340. package/build/esm/object/Cache.test.js +10 -3
  341. package/build/esm/object/Cache.test.js.map +1 -1
  342. package/build/esm/object/SimpleCache.js +20 -0
  343. package/build/esm/object/SimpleCache.js.map +1 -1
  344. package/build/esm/object/aggregate.js +7 -9
  345. package/build/esm/object/aggregate.js.map +1 -1
  346. package/build/esm/object/aggregate.test.js +11 -9
  347. package/build/esm/object/aggregate.test.js.map +1 -1
  348. package/build/esm/object/attachment.test.js +1 -0
  349. package/build/esm/object/attachment.test.js.map +1 -1
  350. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js +0 -15
  351. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
  352. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js +4 -5
  353. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -1
  354. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js +0 -15
  355. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -1
  356. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +4 -1
  357. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
  358. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +0 -15
  359. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -1
  360. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +42 -85
  361. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  362. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.js +1 -6
  363. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.js.map +1 -1
  364. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +88 -88
  365. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  366. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +9 -3
  367. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
  368. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +15 -38
  369. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
  370. package/build/esm/object/convertWireToOsdkObjects.js +51 -4
  371. package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
  372. package/build/esm/object/convertWireToOsdkObjects.test.js +197 -44
  373. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
  374. package/build/esm/object/fetchPage.js +42 -24
  375. package/build/esm/object/fetchPage.js.map +1 -1
  376. package/build/esm/object/fetchPage.test.js +80 -1
  377. package/build/esm/object/fetchPage.test.js.map +1 -1
  378. package/build/esm/object/fetchSingle.js +3 -0
  379. package/build/esm/object/fetchSingle.js.map +1 -1
  380. package/build/esm/object/geotimeseriesreference.test.js +2 -0
  381. package/build/esm/object/geotimeseriesreference.test.js.map +1 -1
  382. package/build/esm/object/media.test.js +55 -0
  383. package/build/esm/object/media.test.js.map +1 -0
  384. package/build/esm/object/mediaUpload.js +20 -0
  385. package/build/esm/object/mediaUpload.js.map +1 -0
  386. package/build/esm/object/object.test.js +203 -10
  387. package/build/esm/object/object.test.js.map +1 -1
  388. package/build/esm/object/timeseries.test.js +11 -0
  389. package/build/esm/object/timeseries.test.js.map +1 -1
  390. package/build/esm/objectSet/InterfaceObjectSet.test.js +65 -0
  391. package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -0
  392. package/build/esm/objectSet/ObjectSet.test.js +140 -28
  393. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  394. package/build/esm/objectSet/ObjectSetFactory.js +0 -15
  395. package/build/esm/objectSet/ObjectSetFactory.js.map +1 -1
  396. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +117 -40
  397. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  398. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +53 -26
  399. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
  400. package/build/esm/objectSet/conjureUnionType.js +1 -0
  401. package/build/esm/objectSet/conjureUnionType.js.map +1 -1
  402. package/build/esm/objectSet/createObjectSet.js +9 -6
  403. package/build/esm/objectSet/createObjectSet.js.map +1 -1
  404. package/build/esm/observable/DebugFlags.js +19 -0
  405. package/build/esm/observable/DebugFlags.js.map +1 -0
  406. package/build/esm/observable/ListPayload.js +2 -0
  407. package/build/esm/observable/ListPayload.js.map +1 -0
  408. package/build/esm/observable/ObjectPayload.js +2 -0
  409. package/build/esm/observable/ObjectPayload.js.map +1 -0
  410. package/build/esm/observable/ObservableClient.js +23 -0
  411. package/build/esm/observable/ObservableClient.js.map +1 -0
  412. package/build/esm/observable/OptimisticBuilder.js +2 -0
  413. package/build/esm/observable/OptimisticBuilder.js.map +1 -0
  414. package/build/esm/observable/internal/CacheKey.js +2 -0
  415. package/build/esm/observable/internal/CacheKey.js.map +1 -0
  416. package/build/esm/observable/internal/CacheKeys.js +60 -0
  417. package/build/esm/observable/internal/CacheKeys.js.map +1 -0
  418. package/build/esm/observable/internal/Canonical.js +2 -0
  419. package/build/esm/observable/internal/Canonical.js.map +1 -0
  420. package/build/esm/observable/internal/ChangedObjects.js +24 -0
  421. package/build/esm/observable/internal/ChangedObjects.js.map +1 -0
  422. package/build/esm/observable/internal/Layer.js +76 -0
  423. package/build/esm/observable/internal/Layer.js.map +1 -0
  424. package/build/esm/observable/internal/ListQuery.js +250 -0
  425. package/build/esm/observable/internal/ListQuery.js.map +1 -0
  426. package/build/esm/observable/internal/ObjectQuery.js +71 -0
  427. package/build/esm/observable/internal/ObjectQuery.js.map +1 -0
  428. package/build/esm/observable/internal/ObservableClientImpl.js +38 -0
  429. package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -0
  430. package/build/esm/observable/internal/OptimisticId.js +30 -0
  431. package/build/esm/observable/internal/OptimisticId.js.map +1 -0
  432. package/build/esm/observable/internal/OptimisticJob.js +91 -0
  433. package/build/esm/observable/internal/OptimisticJob.js.map +1 -0
  434. package/build/esm/observable/internal/Query.js +70 -0
  435. package/build/esm/observable/internal/Query.js.map +1 -0
  436. package/build/esm/observable/internal/RefCounts.js +77 -0
  437. package/build/esm/observable/internal/RefCounts.js.map +1 -0
  438. package/build/esm/observable/internal/Store.js +464 -0
  439. package/build/esm/observable/internal/Store.js.map +1 -0
  440. package/build/esm/observable/internal/Store.test.js +765 -0
  441. package/build/esm/observable/internal/Store.test.js.map +1 -0
  442. package/build/esm/observable/internal/WeakMapWithEntries.js +124 -0
  443. package/build/esm/observable/internal/WeakMapWithEntries.js.map +1 -0
  444. package/build/esm/observable/internal/WhereClauseCanonicalizer.js +83 -0
  445. package/build/esm/observable/internal/WhereClauseCanonicalizer.js.map +1 -0
  446. package/build/esm/observable/internal/WhereClauseCanonicalizer.test.js +131 -0
  447. package/build/esm/observable/internal/WhereClauseCanonicalizer.test.js.map +1 -0
  448. package/build/esm/observable/internal/objectMatchesWhereClause.js +112 -0
  449. package/build/esm/observable/internal/objectMatchesWhereClause.js.map +1 -0
  450. package/build/esm/observable/internal/objectMatchesWhereClause.test.js +121 -0
  451. package/build/esm/observable/internal/objectMatchesWhereClause.test.js.map +1 -0
  452. package/build/esm/observable/internal/testUtils.js +178 -0
  453. package/build/esm/observable/internal/testUtils.js.map +1 -0
  454. package/build/esm/observable/types.js +2 -0
  455. package/build/esm/observable/types.js.map +1 -0
  456. package/build/esm/ontology/OntologyProvider.js +1 -0
  457. package/build/esm/ontology/OntologyProvider.js.map +1 -1
  458. package/build/esm/ontology/StandardOntologyProvider.js +2 -0
  459. package/build/esm/ontology/StandardOntologyProvider.js.map +1 -1
  460. package/build/esm/ontology/StandardOntologyProvider.test.js +2 -0
  461. package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -1
  462. package/build/esm/ontology/loadActionMetadata.js +2 -1
  463. package/build/esm/ontology/loadActionMetadata.js.map +1 -1
  464. package/build/esm/ontology/loadFullObjectMetadata.js +2 -1
  465. package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -1
  466. package/build/esm/ontology/loadInterfaceMetadata.js +2 -1
  467. package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -1
  468. package/build/esm/ontology/loadQueryMetadata.js +2 -1
  469. package/build/esm/ontology/loadQueryMetadata.js.map +1 -1
  470. package/build/esm/ontology/makeConjureContext.js +1 -0
  471. package/build/esm/ontology/makeConjureContext.js.map +1 -1
  472. package/build/esm/pageRequestAsAsyncIter.js +1 -0
  473. package/build/esm/pageRequestAsAsyncIter.js.map +1 -1
  474. package/build/esm/public/internal.js +20 -0
  475. package/build/esm/public/internal.js.map +1 -0
  476. package/build/esm/public/unstable-do-not-use.js +5 -0
  477. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  478. package/build/esm/public-utils/createAndFetchTempObjectSetRid.js +34 -0
  479. package/build/esm/public-utils/createAndFetchTempObjectSetRid.js.map +1 -0
  480. package/build/esm/public-utils/hydrateAttachmentFromRid.js +45 -0
  481. package/build/esm/public-utils/hydrateAttachmentFromRid.js.map +1 -0
  482. package/build/esm/public-utils/hydrateObjectSetFromRid.js +39 -0
  483. package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -0
  484. package/build/esm/queries/applyQuery.js +5 -5
  485. package/build/esm/queries/applyQuery.js.map +1 -1
  486. package/build/esm/queries/queries.test.js +9 -0
  487. package/build/esm/queries/queries.test.js.map +1 -1
  488. package/build/esm/queries/types.js +0 -15
  489. package/build/esm/queries/types.js.map +1 -1
  490. package/build/esm/tsserver.js +1 -0
  491. package/build/esm/tsserver.js.map +1 -1
  492. package/build/esm/util/ArrayElement.js +0 -15
  493. package/build/esm/util/ArrayElement.js.map +1 -1
  494. package/build/esm/util/NOOP.js +0 -15
  495. package/build/esm/util/NOOP.js.map +1 -1
  496. package/build/esm/util/NullableProps.js +0 -15
  497. package/build/esm/util/NullableProps.js.map +1 -1
  498. package/build/esm/util/UserAgent.js +2 -1
  499. package/build/esm/util/UserAgent.js.map +1 -1
  500. package/build/esm/util/WireObjectSet.js +2 -0
  501. package/build/esm/util/WireObjectSet.js.map +1 -1
  502. package/build/esm/util/addUserAgentAndRequestContextHeaders.js +1 -0
  503. package/build/esm/util/addUserAgentAndRequestContextHeaders.js.map +1 -1
  504. package/build/esm/util/augmentRequestContext.js +1 -0
  505. package/build/esm/util/augmentRequestContext.js.map +1 -1
  506. package/build/esm/util/datetimeConverters.js +60 -0
  507. package/build/esm/util/datetimeConverters.js.map +1 -0
  508. package/build/esm/util/datetimeConverters.test.js +76 -0
  509. package/build/esm/util/datetimeConverters.test.js.map +1 -0
  510. package/build/esm/util/interfaceUtils.js +21 -0
  511. package/build/esm/util/interfaceUtils.js.map +1 -0
  512. package/build/esm/util/isOntologyObjectV2.js +1 -0
  513. package/build/esm/util/isOntologyObjectV2.js.map +1 -1
  514. package/build/esm/util/isOsdkBaseObject.js +1 -0
  515. package/build/esm/util/isOsdkBaseObject.js.map +1 -1
  516. package/build/esm/util/isOsdkObject.js +1 -0
  517. package/build/esm/util/isOsdkObject.js.map +1 -1
  518. package/build/esm/util/objectSetUtils.js +26 -0
  519. package/build/esm/util/objectSetUtils.js.map +1 -0
  520. package/build/esm/util/partialBy.js +0 -15
  521. package/build/esm/util/partialBy.js.map +1 -1
  522. package/build/esm/util/streamutils.js +7 -0
  523. package/build/esm/util/streamutils.js.map +1 -1
  524. package/build/esm/util/timeseriesUtils.js +2 -1
  525. package/build/esm/util/timeseriesUtils.js.map +1 -1
  526. package/build/esm/util/toDataValue.js +28 -2
  527. package/build/esm/util/toDataValue.js.map +1 -1
  528. package/build/esm/util/toDataValue.test.js +14 -1
  529. package/build/esm/util/toDataValue.test.js.map +1 -1
  530. package/build/esm/util/toDataValueQueries.js +10 -1
  531. package/build/esm/util/toDataValueQueries.js.map +1 -1
  532. package/build/types/Client.d.ts +22 -0
  533. package/build/types/Client.d.ts.map +1 -0
  534. package/build/types/Definitions.test.d.ts +1 -0
  535. package/build/types/Definitions.test.d.ts.map +1 -0
  536. package/build/types/Logger.d.ts +18 -0
  537. package/build/types/Logger.d.ts.map +1 -0
  538. package/build/types/MinimalClientContext.d.ts +25 -0
  539. package/build/types/MinimalClientContext.d.ts.map +1 -0
  540. package/build/types/ResultOrError.d.ts +11 -0
  541. package/build/types/ResultOrError.d.ts.map +1 -0
  542. package/build/types/SatisfiesSemver.d.ts +10 -0
  543. package/build/types/SatisfiesSemver.d.ts.map +1 -0
  544. package/build/types/SatisfiesSemver.test.d.ts +1 -0
  545. package/build/types/SatisfiesSemver.test.d.ts.map +1 -0
  546. package/build/types/__unstable/ConjureSupport.d.ts +37 -0
  547. package/build/types/__unstable/ConjureSupport.d.ts.map +1 -0
  548. package/build/types/__unstable/createBulkLinksAsyncIterFactory.d.ts +4 -0
  549. package/build/types/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -0
  550. package/build/types/actions/ActionValidationError.d.ts +5 -0
  551. package/build/types/actions/ActionValidationError.d.ts.map +1 -0
  552. package/build/types/actions/actions.test.d.ts +1 -0
  553. package/build/types/actions/actions.test.d.ts.map +1 -0
  554. package/build/types/actions/applyAction.d.ts +31 -0
  555. package/build/types/actions/applyAction.d.ts.map +1 -0
  556. package/build/types/createClient.d.ts +5 -0
  557. package/build/types/createClient.d.ts.map +1 -0
  558. package/build/types/createClient.test.d.ts +1 -0
  559. package/build/types/createClient.test.d.ts.map +1 -0
  560. package/build/types/createGeotimeSeriesProperty.d.ts +13 -0
  561. package/build/types/createGeotimeSeriesProperty.d.ts.map +1 -0
  562. package/build/types/createMediaReferenceProperty.d.ts +13 -0
  563. package/build/types/createMediaReferenceProperty.d.ts.map +1 -0
  564. package/build/types/createMinimalClient.d.ts +1 -0
  565. package/build/types/createMinimalClient.d.ts.map +1 -0
  566. package/build/types/createPlatformClient.d.ts +15 -0
  567. package/build/types/createPlatformClient.d.ts.map +1 -0
  568. package/build/types/createTimeseriesProperty.d.ts +13 -0
  569. package/build/types/createTimeseriesProperty.d.ts.map +1 -0
  570. package/build/types/definitions/LinkDefinitions.test.d.ts +1 -0
  571. package/build/types/definitions/LinkDefinitions.test.d.ts.map +1 -0
  572. package/build/types/fetchMetadata.d.ts +1 -0
  573. package/build/types/fetchMetadata.d.ts.map +1 -0
  574. package/build/types/fetchMetadata.test.d.ts +1 -0
  575. package/build/types/fetchMetadata.test.d.ts.map +1 -0
  576. package/build/types/index.d.ts +12 -0
  577. package/build/types/index.d.ts.map +1 -0
  578. package/build/types/intellisense.test.d.ts +1 -0
  579. package/build/types/intellisense.test.d.ts.map +1 -0
  580. package/build/types/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +1 -0
  581. package/build/types/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +1 -0
  582. package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +1 -0
  583. package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +1 -0
  584. package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts +1 -0
  585. package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts.map +1 -0
  586. package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts +1 -0
  587. package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts.map +1 -0
  588. package/build/types/internal/conversions/modernToLegacyWhereClause.d.ts +1 -0
  589. package/build/types/internal/conversions/modernToLegacyWhereClause.d.ts.map +1 -0
  590. package/build/types/internal/conversions/modernToLegacyWhereClause.test.d.ts +1 -0
  591. package/build/types/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +1 -0
  592. package/build/types/object/AttachmentUpload.d.ts +3 -0
  593. package/build/types/object/AttachmentUpload.d.ts.map +1 -0
  594. package/build/types/object/Cache.d.ts +17 -0
  595. package/build/types/object/Cache.d.ts.map +1 -0
  596. package/build/types/object/Cache.test.d.ts +1 -0
  597. package/build/types/object/Cache.test.d.ts.map +1 -0
  598. package/build/types/object/SimpleCache.d.ts +52 -0
  599. package/build/types/object/SimpleCache.d.ts.map +1 -0
  600. package/build/types/object/aggregate.d.ts +1 -0
  601. package/build/types/object/aggregate.d.ts.map +1 -0
  602. package/build/types/object/aggregate.test.d.ts +1 -0
  603. package/build/types/object/aggregate.test.d.ts.map +1 -0
  604. package/build/types/object/attachment.test.d.ts +1 -0
  605. package/build/types/object/attachment.test.d.ts.map +1 -0
  606. package/build/types/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +1 -0
  607. package/build/types/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -0
  608. package/build/types/object/convertWireToOsdkObjects/InternalSymbols.d.ts +6 -0
  609. package/build/types/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -0
  610. package/build/types/object/convertWireToOsdkObjects/ObjectHolder.d.ts +1 -0
  611. package/build/types/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +1 -0
  612. package/build/types/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +17 -0
  613. package/build/types/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -0
  614. package/build/types/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +5 -0
  615. package/build/types/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +1 -0
  616. package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +1 -0
  617. package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +1 -0
  618. package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts +1 -0
  619. package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts.map +1 -0
  620. package/build/types/object/convertWireToOsdkObjects/createOsdkObject.d.ts +1 -0
  621. package/build/types/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +1 -0
  622. package/build/types/object/convertWireToOsdkObjects/getDollarAs.d.ts +2 -0
  623. package/build/types/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -0
  624. package/build/types/object/convertWireToOsdkObjects/getDollarLink.d.ts +1 -0
  625. package/build/types/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +1 -0
  626. package/build/types/object/convertWireToOsdkObjects.d.ts +1 -0
  627. package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -0
  628. package/build/types/object/convertWireToOsdkObjects.test.d.ts +1 -0
  629. package/build/types/object/convertWireToOsdkObjects.test.d.ts.map +1 -0
  630. package/build/types/object/fetchPage.d.ts +5 -0
  631. package/build/types/object/fetchPage.d.ts.map +1 -0
  632. package/build/types/object/fetchPage.test.d.ts +1 -0
  633. package/build/types/object/fetchPage.test.d.ts.map +1 -0
  634. package/build/types/object/fetchSingle.d.ts +1 -0
  635. package/build/types/object/fetchSingle.d.ts.map +1 -0
  636. package/build/types/object/geotimeseriesreference.test.d.ts +1 -0
  637. package/build/types/object/geotimeseriesreference.test.d.ts.map +1 -0
  638. package/build/types/object/media.test.d.ts +1 -0
  639. package/build/types/object/media.test.d.ts.map +1 -0
  640. package/build/types/object/mediaUpload.d.ts +2 -0
  641. package/build/types/object/mediaUpload.d.ts.map +1 -0
  642. package/build/types/object/object.test.d.ts +11 -0
  643. package/build/types/object/object.test.d.ts.map +1 -0
  644. package/build/types/object/timeseries.test.d.ts +1 -0
  645. package/build/types/object/timeseries.test.d.ts.map +1 -0
  646. package/build/types/objectSet/InterfaceObjectSet.test.d.ts +1 -0
  647. package/build/types/objectSet/InterfaceObjectSet.test.d.ts.map +1 -0
  648. package/build/types/objectSet/ObjectSet.test.d.ts +7 -0
  649. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -0
  650. package/build/types/objectSet/ObjectSetFactory.d.ts +1 -0
  651. package/build/types/objectSet/ObjectSetFactory.d.ts.map +1 -0
  652. package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +1 -0
  653. package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -0
  654. package/build/types/objectSet/ObjectSetListenerWebsocket.test.d.ts +1 -0
  655. package/build/types/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +1 -0
  656. package/build/types/objectSet/conjureUnionType.d.ts +13 -0
  657. package/build/types/objectSet/conjureUnionType.d.ts.map +1 -0
  658. package/build/types/objectSet/createObjectSet.d.ts +1 -0
  659. package/build/types/objectSet/createObjectSet.d.ts.map +1 -0
  660. package/build/types/observable/DebugFlags.d.ts +2 -0
  661. package/build/types/observable/DebugFlags.d.ts.map +1 -0
  662. package/build/types/observable/ListPayload.d.ts +10 -0
  663. package/build/types/observable/ListPayload.d.ts.map +1 -0
  664. package/build/types/observable/ObjectPayload.d.ts +8 -0
  665. package/build/types/observable/ObjectPayload.d.ts.map +1 -0
  666. package/build/types/observable/ObservableClient.d.ts +36 -0
  667. package/build/types/observable/ObservableClient.d.ts.map +1 -0
  668. package/build/types/observable/OptimisticBuilder.d.ts +5 -0
  669. package/build/types/observable/OptimisticBuilder.d.ts.map +1 -0
  670. package/build/types/observable/internal/CacheKey.d.ts +15 -0
  671. package/build/types/observable/internal/CacheKey.d.ts.map +1 -0
  672. package/build/types/observable/internal/CacheKeys.d.ts +8 -0
  673. package/build/types/observable/internal/CacheKeys.d.ts.map +1 -0
  674. package/build/types/observable/internal/Canonical.d.ts +3 -0
  675. package/build/types/observable/internal/Canonical.d.ts.map +1 -0
  676. package/build/types/observable/internal/ChangedObjects.d.ts +7 -0
  677. package/build/types/observable/internal/ChangedObjects.d.ts.map +1 -0
  678. package/build/types/observable/internal/Layer.d.ts +19 -0
  679. package/build/types/observable/internal/Layer.d.ts.map +1 -0
  680. package/build/types/observable/internal/ListQuery.d.ts +42 -0
  681. package/build/types/observable/internal/ListQuery.d.ts.map +1 -0
  682. package/build/types/observable/internal/ObjectQuery.d.ts +19 -0
  683. package/build/types/observable/internal/ObjectQuery.d.ts.map +1 -0
  684. package/build/types/observable/internal/ObservableClientImpl.d.ts +1 -0
  685. package/build/types/observable/internal/ObservableClientImpl.d.ts.map +1 -0
  686. package/build/types/observable/internal/OptimisticId.d.ts +4 -0
  687. package/build/types/observable/internal/OptimisticId.d.ts.map +1 -0
  688. package/build/types/observable/internal/OptimisticJob.d.ts +11 -0
  689. package/build/types/observable/internal/OptimisticJob.d.ts.map +1 -0
  690. package/build/types/observable/internal/Query.d.ts +29 -0
  691. package/build/types/observable/internal/Query.d.ts.map +1 -0
  692. package/build/types/observable/internal/RefCounts.d.ts +12 -0
  693. package/build/types/observable/internal/RefCounts.d.ts.map +1 -0
  694. package/build/types/observable/internal/Store.d.ts +73 -0
  695. package/build/types/observable/internal/Store.d.ts.map +1 -0
  696. package/build/types/observable/internal/Store.test.d.ts +1 -0
  697. package/build/types/observable/internal/Store.test.d.ts.map +1 -0
  698. package/build/types/observable/internal/WeakMapWithEntries.d.ts +50 -0
  699. package/build/types/observable/internal/WeakMapWithEntries.d.ts.map +1 -0
  700. package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts +6 -0
  701. package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts.map +1 -0
  702. package/build/types/observable/internal/WhereClauseCanonicalizer.test.d.ts +1 -0
  703. package/build/types/observable/internal/WhereClauseCanonicalizer.test.d.ts.map +1 -0
  704. package/build/types/observable/internal/objectMatchesWhereClause.d.ts +2 -0
  705. package/build/types/observable/internal/objectMatchesWhereClause.d.ts.map +1 -0
  706. package/build/types/observable/internal/objectMatchesWhereClause.test.d.ts +1 -0
  707. package/build/types/observable/internal/objectMatchesWhereClause.test.d.ts.map +1 -0
  708. package/build/types/observable/internal/testUtils.d.ts +40 -0
  709. package/build/types/observable/internal/testUtils.d.ts.map +1 -0
  710. package/build/types/observable/types.d.ts +1 -0
  711. package/build/types/observable/types.d.ts.map +1 -0
  712. package/build/types/ontology/OntologyProvider.d.ts +31 -0
  713. package/build/types/ontology/OntologyProvider.d.ts.map +1 -0
  714. package/build/types/ontology/StandardOntologyProvider.d.ts +3 -0
  715. package/build/types/ontology/StandardOntologyProvider.d.ts.map +1 -0
  716. package/build/types/ontology/StandardOntologyProvider.test.d.ts +1 -0
  717. package/build/types/ontology/StandardOntologyProvider.test.d.ts.map +1 -0
  718. package/build/types/ontology/loadActionMetadata.d.ts +3 -0
  719. package/build/types/ontology/loadActionMetadata.d.ts.map +1 -0
  720. package/build/types/ontology/loadFullObjectMetadata.d.ts +5 -0
  721. package/build/types/ontology/loadFullObjectMetadata.d.ts.map +1 -0
  722. package/build/types/ontology/loadInterfaceMetadata.d.ts +3 -0
  723. package/build/types/ontology/loadInterfaceMetadata.d.ts.map +1 -0
  724. package/build/types/ontology/loadQueryMetadata.d.ts +3 -0
  725. package/build/types/ontology/loadQueryMetadata.d.ts.map +1 -0
  726. package/build/types/ontology/makeConjureContext.d.ts +3 -0
  727. package/build/types/ontology/makeConjureContext.d.ts.map +1 -0
  728. package/build/types/pageRequestAsAsyncIter.d.ts +16 -0
  729. package/build/types/pageRequestAsAsyncIter.d.ts.map +1 -0
  730. package/build/types/public/internal.d.ts +3 -0
  731. package/build/types/public/internal.d.ts.map +1 -0
  732. package/build/types/public/unstable-do-not-use.d.ts +7 -0
  733. package/build/types/public/unstable-do-not-use.d.ts.map +1 -0
  734. package/build/types/public-utils/createAndFetchTempObjectSetRid.d.ts +10 -0
  735. package/build/types/public-utils/createAndFetchTempObjectSetRid.d.ts.map +1 -0
  736. package/build/types/public-utils/hydrateAttachmentFromRid.d.ts +9 -0
  737. package/build/types/public-utils/hydrateAttachmentFromRid.d.ts.map +1 -0
  738. package/build/types/public-utils/hydrateObjectSetFromRid.d.ts +10 -0
  739. package/build/types/public-utils/hydrateObjectSetFromRid.d.ts.map +1 -0
  740. package/build/types/queries/applyQuery.d.ts +8 -0
  741. package/build/types/queries/applyQuery.d.ts.map +1 -0
  742. package/build/types/queries/queries.test.d.ts +1 -0
  743. package/build/types/queries/queries.test.d.ts.map +1 -0
  744. package/build/types/queries/types.d.ts +15 -0
  745. package/build/types/queries/types.d.ts.map +1 -0
  746. package/build/types/tsserver.d.ts +34 -0
  747. package/build/types/tsserver.d.ts.map +1 -0
  748. package/build/types/util/ArrayElement.d.ts +1 -0
  749. package/build/types/util/ArrayElement.d.ts.map +1 -0
  750. package/build/types/util/NOOP.d.ts +1 -0
  751. package/build/types/util/NOOP.d.ts.map +1 -0
  752. package/build/types/util/NullableProps.d.ts +3 -0
  753. package/build/types/util/NullableProps.d.ts.map +1 -0
  754. package/build/types/util/UserAgent.d.ts +1 -0
  755. package/build/types/util/UserAgent.d.ts.map +1 -0
  756. package/build/types/util/WireObjectSet.d.ts +1 -0
  757. package/build/types/util/WireObjectSet.d.ts.map +1 -0
  758. package/build/types/util/addUserAgentAndRequestContextHeaders.d.ts +3 -0
  759. package/build/types/util/addUserAgentAndRequestContextHeaders.d.ts.map +1 -0
  760. package/build/types/util/augmentRequestContext.d.ts +31 -0
  761. package/build/types/util/augmentRequestContext.d.ts.map +1 -0
  762. package/build/types/util/datetimeConverters.d.ts +21 -0
  763. package/build/types/util/datetimeConverters.d.ts.map +1 -0
  764. package/build/types/util/datetimeConverters.test.d.ts +1 -0
  765. package/build/types/util/datetimeConverters.test.d.ts.map +1 -0
  766. package/build/types/util/interfaceUtils.d.ts +1 -0
  767. package/build/types/util/interfaceUtils.d.ts.map +1 -0
  768. package/build/types/util/isOntologyObjectV2.d.ts +1 -0
  769. package/build/types/util/isOntologyObjectV2.d.ts.map +1 -0
  770. package/build/types/util/isOsdkBaseObject.d.ts +2 -0
  771. package/build/types/util/isOsdkBaseObject.d.ts.map +1 -0
  772. package/build/types/util/isOsdkObject.d.ts +2 -0
  773. package/build/types/util/isOsdkObject.d.ts.map +1 -0
  774. package/build/types/util/objectSetUtils.d.ts +3 -0
  775. package/build/types/util/objectSetUtils.d.ts.map +1 -0
  776. package/build/types/util/partialBy.d.ts +8 -0
  777. package/build/types/util/partialBy.d.ts.map +1 -0
  778. package/build/types/util/streamutils.d.ts +2 -0
  779. package/build/types/util/streamutils.d.ts.map +1 -0
  780. package/build/types/util/timeseriesUtils.d.ts +7 -0
  781. package/build/types/util/timeseriesUtils.d.ts.map +1 -0
  782. package/build/types/util/toDataValue.d.ts +1 -0
  783. package/build/types/util/toDataValue.d.ts.map +1 -0
  784. package/build/types/util/toDataValue.test.d.ts +1 -0
  785. package/build/types/util/toDataValue.test.d.ts.map +1 -0
  786. package/build/types/util/toDataValueQueries.d.ts +1 -0
  787. package/build/types/util/toDataValueQueries.d.ts.map +1 -0
  788. package/index.d.ts +17 -0
  789. package/internal.d.ts +17 -0
  790. package/package.json +57 -23
  791. package/unstable-do-not-use.d.ts +1 -1
  792. package/build/browser/Client.d.ts +0 -26
  793. package/build/browser/Client.d.ts.map +0 -1
  794. package/build/browser/Definitions.test.d.ts +0 -2
  795. package/build/browser/Definitions.test.d.ts.map +0 -1
  796. package/build/browser/Logger.d.ts +0 -19
  797. package/build/browser/Logger.d.ts.map +0 -1
  798. package/build/browser/MinimalClientContext.d.ts +0 -26
  799. package/build/browser/MinimalClientContext.d.ts.map +0 -1
  800. package/build/browser/ResultOrError.d.ts +0 -12
  801. package/build/browser/ResultOrError.d.ts.map +0 -1
  802. package/build/browser/SatisfiesSemver.d.ts +0 -4
  803. package/build/browser/SatisfiesSemver.d.ts.map +0 -1
  804. package/build/browser/SatisfiesSemver.test.d.ts +0 -2
  805. package/build/browser/SatisfiesSemver.test.d.ts.map +0 -1
  806. package/build/browser/__unstable/ConjureSupport.d.ts +0 -55
  807. package/build/browser/__unstable/ConjureSupport.d.ts.map +0 -1
  808. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts +0 -5
  809. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +0 -1
  810. package/build/browser/actions/ActionValidationError.d.ts +0 -6
  811. package/build/browser/actions/ActionValidationError.d.ts.map +0 -1
  812. package/build/browser/actions/actions.test.d.ts +0 -2
  813. package/build/browser/actions/actions.test.d.ts.map +0 -1
  814. package/build/browser/actions/applyAction.d.ts +0 -30
  815. package/build/browser/actions/applyAction.d.ts.map +0 -1
  816. package/build/browser/createAttachmentFromRid.d.ts +0 -10
  817. package/build/browser/createAttachmentFromRid.d.ts.map +0 -1
  818. package/build/browser/createAttachmentFromRid.js +0 -38
  819. package/build/browser/createAttachmentFromRid.js.map +0 -1
  820. package/build/browser/createClient.d.ts +0 -6
  821. package/build/browser/createClient.d.ts.map +0 -1
  822. package/build/browser/createClient.test.d.ts +0 -2
  823. package/build/browser/createClient.test.d.ts.map +0 -1
  824. package/build/browser/createGeotimeSeriesProperty.d.ts +0 -14
  825. package/build/browser/createGeotimeSeriesProperty.d.ts.map +0 -1
  826. package/build/browser/createMinimalClient.d.ts +0 -2
  827. package/build/browser/createMinimalClient.d.ts.map +0 -1
  828. package/build/browser/createPlatformClient.d.ts +0 -17
  829. package/build/browser/createPlatformClient.d.ts.map +0 -1
  830. package/build/browser/createTimeseriesProperty.d.ts +0 -14
  831. package/build/browser/createTimeseriesProperty.d.ts.map +0 -1
  832. package/build/browser/definitions/LinkDefinitions.test.d.ts +0 -2
  833. package/build/browser/definitions/LinkDefinitions.test.d.ts.map +0 -1
  834. package/build/browser/fetchMetadata.d.ts +0 -2
  835. package/build/browser/fetchMetadata.d.ts.map +0 -1
  836. package/build/browser/fetchMetadata.test.d.ts +0 -2
  837. package/build/browser/fetchMetadata.test.d.ts.map +0 -1
  838. package/build/browser/index.d.ts +0 -12
  839. package/build/browser/index.d.ts.map +0 -1
  840. package/build/browser/intellisense.test.d.ts +0 -2
  841. package/build/browser/intellisense.test.d.ts.map +0 -1
  842. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +0 -2
  843. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +0 -1
  844. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts +0 -2
  845. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +0 -1
  846. package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts +0 -2
  847. package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts.map +0 -1
  848. package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts +0 -2
  849. package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts.map +0 -1
  850. package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts +0 -2
  851. package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts.map +0 -1
  852. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts +0 -2
  853. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +0 -1
  854. package/build/browser/object/AttachmentUpload.d.ts +0 -4
  855. package/build/browser/object/AttachmentUpload.d.ts.map +0 -1
  856. package/build/browser/object/Cache.d.ts +0 -2
  857. package/build/browser/object/Cache.d.ts.map +0 -1
  858. package/build/browser/object/Cache.test.d.ts +0 -11
  859. package/build/browser/object/Cache.test.d.ts.map +0 -1
  860. package/build/browser/object/SimpleCache.d.ts +0 -38
  861. package/build/browser/object/SimpleCache.d.ts.map +0 -1
  862. package/build/browser/object/aggregate.d.ts +0 -2
  863. package/build/browser/object/aggregate.d.ts.map +0 -1
  864. package/build/browser/object/aggregate.test.d.ts +0 -2
  865. package/build/browser/object/aggregate.test.d.ts.map +0 -1
  866. package/build/browser/object/attachment.test.d.ts +0 -2
  867. package/build/browser/object/attachment.test.d.ts.map +0 -1
  868. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +0 -2
  869. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +0 -1
  870. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts +0 -7
  871. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +0 -1
  872. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts +0 -2
  873. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +0 -1
  874. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +0 -2
  875. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +0 -1
  876. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +0 -8
  877. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +0 -1
  878. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +0 -2
  879. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +0 -1
  880. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts +0 -2
  881. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts.map +0 -1
  882. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts +0 -2
  883. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +0 -1
  884. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts +0 -3
  885. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +0 -1
  886. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts +0 -2
  887. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +0 -1
  888. package/build/browser/object/convertWireToOsdkObjects.d.ts +0 -2
  889. package/build/browser/object/convertWireToOsdkObjects.d.ts.map +0 -1
  890. package/build/browser/object/convertWireToOsdkObjects.test.d.ts +0 -2
  891. package/build/browser/object/convertWireToOsdkObjects.test.d.ts.map +0 -1
  892. package/build/browser/object/fetchPage.d.ts +0 -3
  893. package/build/browser/object/fetchPage.d.ts.map +0 -1
  894. package/build/browser/object/fetchPage.test.d.ts +0 -2
  895. package/build/browser/object/fetchPage.test.d.ts.map +0 -1
  896. package/build/browser/object/fetchSingle.d.ts +0 -2
  897. package/build/browser/object/fetchSingle.d.ts.map +0 -1
  898. package/build/browser/object/geotimeseriesreference.test.d.ts +0 -2
  899. package/build/browser/object/geotimeseriesreference.test.d.ts.map +0 -1
  900. package/build/browser/object/object.test.d.ts +0 -12
  901. package/build/browser/object/object.test.d.ts.map +0 -1
  902. package/build/browser/object/timeseries.test.d.ts +0 -2
  903. package/build/browser/object/timeseries.test.d.ts.map +0 -1
  904. package/build/browser/objectSet/ObjectSet.test.d.ts +0 -2
  905. package/build/browser/objectSet/ObjectSet.test.d.ts.map +0 -1
  906. package/build/browser/objectSet/ObjectSetFactory.d.ts +0 -2
  907. package/build/browser/objectSet/ObjectSetFactory.d.ts.map +0 -1
  908. package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts +0 -2
  909. package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts.map +0 -1
  910. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts +0 -2
  911. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +0 -1
  912. package/build/browser/objectSet/conjureUnionType.d.ts +0 -13
  913. package/build/browser/objectSet/conjureUnionType.d.ts.map +0 -1
  914. package/build/browser/objectSet/createObjectSet.d.ts +0 -2
  915. package/build/browser/objectSet/createObjectSet.d.ts.map +0 -1
  916. package/build/browser/objectSet/toConjureObjectSet.d.ts +0 -2
  917. package/build/browser/objectSet/toConjureObjectSet.d.ts.map +0 -1
  918. package/build/browser/objectSet/toConjureObjectSet.js +0 -165
  919. package/build/browser/objectSet/toConjureObjectSet.js.map +0 -1
  920. package/build/browser/ontology/OntologyProvider.d.ts +0 -32
  921. package/build/browser/ontology/OntologyProvider.d.ts.map +0 -1
  922. package/build/browser/ontology/StandardOntologyProvider.d.ts +0 -5
  923. package/build/browser/ontology/StandardOntologyProvider.d.ts.map +0 -1
  924. package/build/browser/ontology/StandardOntologyProvider.test.d.ts +0 -2
  925. package/build/browser/ontology/StandardOntologyProvider.test.d.ts.map +0 -1
  926. package/build/browser/ontology/loadActionMetadata.d.ts +0 -4
  927. package/build/browser/ontology/loadActionMetadata.d.ts.map +0 -1
  928. package/build/browser/ontology/loadFullObjectMetadata.d.ts +0 -6
  929. package/build/browser/ontology/loadFullObjectMetadata.d.ts.map +0 -1
  930. package/build/browser/ontology/loadInterfaceMetadata.d.ts +0 -4
  931. package/build/browser/ontology/loadInterfaceMetadata.d.ts.map +0 -1
  932. package/build/browser/ontology/loadQueryMetadata.d.ts +0 -4
  933. package/build/browser/ontology/loadQueryMetadata.d.ts.map +0 -1
  934. package/build/browser/ontology/makeConjureContext.d.ts +0 -4
  935. package/build/browser/ontology/makeConjureContext.d.ts.map +0 -1
  936. package/build/browser/pageRequestAsAsyncIter.d.ts +0 -10
  937. package/build/browser/pageRequestAsAsyncIter.d.ts.map +0 -1
  938. package/build/browser/public/unstable-do-not-use.d.ts +0 -2
  939. package/build/browser/public/unstable-do-not-use.d.ts.map +0 -1
  940. package/build/browser/queries/applyQuery.d.ts +0 -6
  941. package/build/browser/queries/applyQuery.d.ts.map +0 -1
  942. package/build/browser/queries/queries.test.d.ts +0 -2
  943. package/build/browser/queries/queries.test.d.ts.map +0 -1
  944. package/build/browser/queries/types.d.ts +0 -20
  945. package/build/browser/queries/types.d.ts.map +0 -1
  946. package/build/browser/tsserver.d.ts +0 -34
  947. package/build/browser/tsserver.d.ts.map +0 -1
  948. package/build/browser/util/ArrayElement.d.ts +0 -2
  949. package/build/browser/util/ArrayElement.d.ts.map +0 -1
  950. package/build/browser/util/NOOP.d.ts +0 -4
  951. package/build/browser/util/NOOP.d.ts.map +0 -1
  952. package/build/browser/util/NullableProps.d.ts +0 -6
  953. package/build/browser/util/NullableProps.d.ts.map +0 -1
  954. package/build/browser/util/UserAgent.d.ts +0 -2
  955. package/build/browser/util/UserAgent.d.ts.map +0 -1
  956. package/build/browser/util/WireObjectSet.d.ts +0 -2
  957. package/build/browser/util/WireObjectSet.d.ts.map +0 -1
  958. package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts +0 -4
  959. package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts.map +0 -1
  960. package/build/browser/util/augmentRequestContext.d.ts +0 -32
  961. package/build/browser/util/augmentRequestContext.d.ts.map +0 -1
  962. package/build/browser/util/isOntologyObjectV2.d.ts +0 -2
  963. package/build/browser/util/isOntologyObjectV2.d.ts.map +0 -1
  964. package/build/browser/util/isOsdkBaseObject.d.ts +0 -3
  965. package/build/browser/util/isOsdkBaseObject.d.ts.map +0 -1
  966. package/build/browser/util/isOsdkObject.d.ts +0 -3
  967. package/build/browser/util/isOsdkObject.d.ts.map +0 -1
  968. package/build/browser/util/partialBy.d.ts +0 -3
  969. package/build/browser/util/partialBy.d.ts.map +0 -1
  970. package/build/browser/util/streamutils.d.ts +0 -3
  971. package/build/browser/util/streamutils.d.ts.map +0 -1
  972. package/build/browser/util/timeseriesUtils.d.ts +0 -8
  973. package/build/browser/util/timeseriesUtils.d.ts.map +0 -1
  974. package/build/browser/util/toDataValue.d.ts +0 -2
  975. package/build/browser/util/toDataValue.d.ts.map +0 -1
  976. package/build/browser/util/toDataValue.test.d.ts +0 -2
  977. package/build/browser/util/toDataValue.test.d.ts.map +0 -1
  978. package/build/browser/util/toDataValueQueries.d.ts +0 -2
  979. package/build/browser/util/toDataValueQueries.d.ts.map +0 -1
  980. package/build/esm/Client.d.ts +0 -26
  981. package/build/esm/Client.d.ts.map +0 -1
  982. package/build/esm/Definitions.test.d.ts +0 -2
  983. package/build/esm/Definitions.test.d.ts.map +0 -1
  984. package/build/esm/Logger.d.ts +0 -19
  985. package/build/esm/Logger.d.ts.map +0 -1
  986. package/build/esm/MinimalClientContext.d.ts +0 -26
  987. package/build/esm/MinimalClientContext.d.ts.map +0 -1
  988. package/build/esm/ResultOrError.d.ts +0 -12
  989. package/build/esm/ResultOrError.d.ts.map +0 -1
  990. package/build/esm/SatisfiesSemver.d.ts +0 -4
  991. package/build/esm/SatisfiesSemver.d.ts.map +0 -1
  992. package/build/esm/SatisfiesSemver.test.d.ts +0 -2
  993. package/build/esm/SatisfiesSemver.test.d.ts.map +0 -1
  994. package/build/esm/__unstable/ConjureSupport.d.ts +0 -55
  995. package/build/esm/__unstable/ConjureSupport.d.ts.map +0 -1
  996. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts +0 -5
  997. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +0 -1
  998. package/build/esm/actions/ActionValidationError.d.ts +0 -6
  999. package/build/esm/actions/ActionValidationError.d.ts.map +0 -1
  1000. package/build/esm/actions/actions.test.d.ts +0 -2
  1001. package/build/esm/actions/actions.test.d.ts.map +0 -1
  1002. package/build/esm/actions/applyAction.d.ts +0 -30
  1003. package/build/esm/actions/applyAction.d.ts.map +0 -1
  1004. package/build/esm/createAttachmentFromRid.d.ts +0 -10
  1005. package/build/esm/createAttachmentFromRid.d.ts.map +0 -1
  1006. package/build/esm/createAttachmentFromRid.js +0 -38
  1007. package/build/esm/createAttachmentFromRid.js.map +0 -1
  1008. package/build/esm/createClient.d.ts +0 -6
  1009. package/build/esm/createClient.d.ts.map +0 -1
  1010. package/build/esm/createClient.test.d.ts +0 -2
  1011. package/build/esm/createClient.test.d.ts.map +0 -1
  1012. package/build/esm/createGeotimeSeriesProperty.d.ts +0 -14
  1013. package/build/esm/createGeotimeSeriesProperty.d.ts.map +0 -1
  1014. package/build/esm/createMinimalClient.d.ts +0 -2
  1015. package/build/esm/createMinimalClient.d.ts.map +0 -1
  1016. package/build/esm/createPlatformClient.d.ts +0 -17
  1017. package/build/esm/createPlatformClient.d.ts.map +0 -1
  1018. package/build/esm/createTimeseriesProperty.d.ts +0 -14
  1019. package/build/esm/createTimeseriesProperty.d.ts.map +0 -1
  1020. package/build/esm/definitions/LinkDefinitions.test.d.ts +0 -2
  1021. package/build/esm/definitions/LinkDefinitions.test.d.ts.map +0 -1
  1022. package/build/esm/fetchMetadata.d.ts +0 -2
  1023. package/build/esm/fetchMetadata.d.ts.map +0 -1
  1024. package/build/esm/fetchMetadata.test.d.ts +0 -2
  1025. package/build/esm/fetchMetadata.test.d.ts.map +0 -1
  1026. package/build/esm/index.d.ts +0 -12
  1027. package/build/esm/index.d.ts.map +0 -1
  1028. package/build/esm/intellisense.test.d.ts +0 -2
  1029. package/build/esm/intellisense.test.d.ts.map +0 -1
  1030. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +0 -2
  1031. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +0 -1
  1032. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.d.ts +0 -2
  1033. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +0 -1
  1034. package/build/esm/internal/conversions/modernToLegacyAggregationClause.d.ts +0 -2
  1035. package/build/esm/internal/conversions/modernToLegacyAggregationClause.d.ts.map +0 -1
  1036. package/build/esm/internal/conversions/modernToLegacyGroupByClause.d.ts +0 -2
  1037. package/build/esm/internal/conversions/modernToLegacyGroupByClause.d.ts.map +0 -1
  1038. package/build/esm/internal/conversions/modernToLegacyWhereClause.d.ts +0 -2
  1039. package/build/esm/internal/conversions/modernToLegacyWhereClause.d.ts.map +0 -1
  1040. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.d.ts +0 -2
  1041. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +0 -1
  1042. package/build/esm/object/AttachmentUpload.d.ts +0 -4
  1043. package/build/esm/object/AttachmentUpload.d.ts.map +0 -1
  1044. package/build/esm/object/Cache.d.ts +0 -2
  1045. package/build/esm/object/Cache.d.ts.map +0 -1
  1046. package/build/esm/object/Cache.test.d.ts +0 -11
  1047. package/build/esm/object/Cache.test.d.ts.map +0 -1
  1048. package/build/esm/object/SimpleCache.d.ts +0 -38
  1049. package/build/esm/object/SimpleCache.d.ts.map +0 -1
  1050. package/build/esm/object/aggregate.d.ts +0 -2
  1051. package/build/esm/object/aggregate.d.ts.map +0 -1
  1052. package/build/esm/object/aggregate.test.d.ts +0 -2
  1053. package/build/esm/object/aggregate.test.d.ts.map +0 -1
  1054. package/build/esm/object/attachment.test.d.ts +0 -2
  1055. package/build/esm/object/attachment.test.d.ts.map +0 -1
  1056. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +0 -2
  1057. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +0 -1
  1058. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts +0 -7
  1059. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +0 -1
  1060. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.d.ts +0 -2
  1061. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +0 -1
  1062. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +0 -2
  1063. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +0 -1
  1064. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +0 -8
  1065. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +0 -1
  1066. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +0 -2
  1067. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +0 -1
  1068. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts +0 -2
  1069. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts.map +0 -1
  1070. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.d.ts +0 -2
  1071. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +0 -1
  1072. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts +0 -3
  1073. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +0 -1
  1074. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.d.ts +0 -2
  1075. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +0 -1
  1076. package/build/esm/object/convertWireToOsdkObjects.d.ts +0 -2
  1077. package/build/esm/object/convertWireToOsdkObjects.d.ts.map +0 -1
  1078. package/build/esm/object/convertWireToOsdkObjects.test.d.ts +0 -2
  1079. package/build/esm/object/convertWireToOsdkObjects.test.d.ts.map +0 -1
  1080. package/build/esm/object/fetchPage.d.ts +0 -3
  1081. package/build/esm/object/fetchPage.d.ts.map +0 -1
  1082. package/build/esm/object/fetchPage.test.d.ts +0 -2
  1083. package/build/esm/object/fetchPage.test.d.ts.map +0 -1
  1084. package/build/esm/object/fetchSingle.d.ts +0 -2
  1085. package/build/esm/object/fetchSingle.d.ts.map +0 -1
  1086. package/build/esm/object/geotimeseriesreference.test.d.ts +0 -2
  1087. package/build/esm/object/geotimeseriesreference.test.d.ts.map +0 -1
  1088. package/build/esm/object/object.test.d.ts +0 -12
  1089. package/build/esm/object/object.test.d.ts.map +0 -1
  1090. package/build/esm/object/timeseries.test.d.ts +0 -2
  1091. package/build/esm/object/timeseries.test.d.ts.map +0 -1
  1092. package/build/esm/objectSet/ObjectSet.test.d.ts +0 -2
  1093. package/build/esm/objectSet/ObjectSet.test.d.ts.map +0 -1
  1094. package/build/esm/objectSet/ObjectSetFactory.d.ts +0 -2
  1095. package/build/esm/objectSet/ObjectSetFactory.d.ts.map +0 -1
  1096. package/build/esm/objectSet/ObjectSetListenerWebsocket.d.ts +0 -2
  1097. package/build/esm/objectSet/ObjectSetListenerWebsocket.d.ts.map +0 -1
  1098. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.d.ts +0 -2
  1099. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +0 -1
  1100. package/build/esm/objectSet/conjureUnionType.d.ts +0 -13
  1101. package/build/esm/objectSet/conjureUnionType.d.ts.map +0 -1
  1102. package/build/esm/objectSet/createObjectSet.d.ts +0 -2
  1103. package/build/esm/objectSet/createObjectSet.d.ts.map +0 -1
  1104. package/build/esm/objectSet/toConjureObjectSet.d.ts +0 -2
  1105. package/build/esm/objectSet/toConjureObjectSet.d.ts.map +0 -1
  1106. package/build/esm/objectSet/toConjureObjectSet.js +0 -165
  1107. package/build/esm/objectSet/toConjureObjectSet.js.map +0 -1
  1108. package/build/esm/ontology/OntologyProvider.d.ts +0 -32
  1109. package/build/esm/ontology/OntologyProvider.d.ts.map +0 -1
  1110. package/build/esm/ontology/StandardOntologyProvider.d.ts +0 -5
  1111. package/build/esm/ontology/StandardOntologyProvider.d.ts.map +0 -1
  1112. package/build/esm/ontology/StandardOntologyProvider.test.d.ts +0 -2
  1113. package/build/esm/ontology/StandardOntologyProvider.test.d.ts.map +0 -1
  1114. package/build/esm/ontology/loadActionMetadata.d.ts +0 -4
  1115. package/build/esm/ontology/loadActionMetadata.d.ts.map +0 -1
  1116. package/build/esm/ontology/loadFullObjectMetadata.d.ts +0 -6
  1117. package/build/esm/ontology/loadFullObjectMetadata.d.ts.map +0 -1
  1118. package/build/esm/ontology/loadInterfaceMetadata.d.ts +0 -4
  1119. package/build/esm/ontology/loadInterfaceMetadata.d.ts.map +0 -1
  1120. package/build/esm/ontology/loadQueryMetadata.d.ts +0 -4
  1121. package/build/esm/ontology/loadQueryMetadata.d.ts.map +0 -1
  1122. package/build/esm/ontology/makeConjureContext.d.ts +0 -4
  1123. package/build/esm/ontology/makeConjureContext.d.ts.map +0 -1
  1124. package/build/esm/pageRequestAsAsyncIter.d.ts +0 -10
  1125. package/build/esm/pageRequestAsAsyncIter.d.ts.map +0 -1
  1126. package/build/esm/public/unstable-do-not-use.d.ts +0 -2
  1127. package/build/esm/public/unstable-do-not-use.d.ts.map +0 -1
  1128. package/build/esm/queries/applyQuery.d.ts +0 -6
  1129. package/build/esm/queries/applyQuery.d.ts.map +0 -1
  1130. package/build/esm/queries/queries.test.d.ts +0 -2
  1131. package/build/esm/queries/queries.test.d.ts.map +0 -1
  1132. package/build/esm/queries/types.d.ts +0 -20
  1133. package/build/esm/queries/types.d.ts.map +0 -1
  1134. package/build/esm/tsserver.d.ts +0 -34
  1135. package/build/esm/tsserver.d.ts.map +0 -1
  1136. package/build/esm/util/ArrayElement.d.ts +0 -2
  1137. package/build/esm/util/ArrayElement.d.ts.map +0 -1
  1138. package/build/esm/util/NOOP.d.ts +0 -4
  1139. package/build/esm/util/NOOP.d.ts.map +0 -1
  1140. package/build/esm/util/NullableProps.d.ts +0 -6
  1141. package/build/esm/util/NullableProps.d.ts.map +0 -1
  1142. package/build/esm/util/UserAgent.d.ts +0 -2
  1143. package/build/esm/util/UserAgent.d.ts.map +0 -1
  1144. package/build/esm/util/WireObjectSet.d.ts +0 -2
  1145. package/build/esm/util/WireObjectSet.d.ts.map +0 -1
  1146. package/build/esm/util/addUserAgentAndRequestContextHeaders.d.ts +0 -4
  1147. package/build/esm/util/addUserAgentAndRequestContextHeaders.d.ts.map +0 -1
  1148. package/build/esm/util/augmentRequestContext.d.ts +0 -32
  1149. package/build/esm/util/augmentRequestContext.d.ts.map +0 -1
  1150. package/build/esm/util/isOntologyObjectV2.d.ts +0 -2
  1151. package/build/esm/util/isOntologyObjectV2.d.ts.map +0 -1
  1152. package/build/esm/util/isOsdkBaseObject.d.ts +0 -3
  1153. package/build/esm/util/isOsdkBaseObject.d.ts.map +0 -1
  1154. package/build/esm/util/isOsdkObject.d.ts +0 -3
  1155. package/build/esm/util/isOsdkObject.d.ts.map +0 -1
  1156. package/build/esm/util/partialBy.d.ts +0 -3
  1157. package/build/esm/util/partialBy.d.ts.map +0 -1
  1158. package/build/esm/util/streamutils.d.ts +0 -3
  1159. package/build/esm/util/streamutils.d.ts.map +0 -1
  1160. package/build/esm/util/timeseriesUtils.d.ts +0 -8
  1161. package/build/esm/util/timeseriesUtils.d.ts.map +0 -1
  1162. package/build/esm/util/toDataValue.d.ts +0 -2
  1163. package/build/esm/util/toDataValue.d.ts.map +0 -1
  1164. package/build/esm/util/toDataValue.test.d.ts +0 -2
  1165. package/build/esm/util/toDataValue.test.d.ts.map +0 -1
  1166. package/build/esm/util/toDataValueQueries.d.ts +0 -2
  1167. package/build/esm/util/toDataValueQueries.d.ts.map +0 -1
@@ -13,12 +13,14 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import WebSocket from "isomorphic-ws";
17
18
  import invariant from "tiny-invariant";
18
- import { convertWireToOsdkObjects } from "../object/convertWireToOsdkObjects.js";
19
19
  const MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;
20
+
20
21
  /** Noop function to reduce conditional checks */
21
22
  function doNothing() {}
23
+
22
24
  /**
23
25
  * Converts an ObjectSetListener to one where all the functions are defined.
24
26
  */
@@ -41,10 +43,10 @@ function isReady(sub) {
41
43
  function subscriptionIsDone(sub) {
42
44
  return sub.status === "done" || sub.status === "error";
43
45
  }
46
+
44
47
  /** @internal */
45
48
  export class ObjectSetListenerWebsocket {
46
49
  static #instances = new WeakMap();
47
- MINIMUM_RECONNECT_DELAY_MS;
48
50
  // FIXME
49
51
  static getInstance(client) {
50
52
  let instance = ObjectSetListenerWebsocket.#instances.get(client.clientCacheKey);
@@ -58,16 +60,20 @@ export class ObjectSetListenerWebsocket {
58
60
  #lastWsConnect = 0;
59
61
  #client;
60
62
  #logger;
63
+
61
64
  /**
62
65
  * map of requestId to all active subscriptions at the time of the request
63
66
  */
64
67
  #pendingSubscriptions = new Map();
68
+
65
69
  /**
66
70
  * Map of subscriptionId to Subscription. Note: the subscriptionId may be
67
71
  * temporary and not the actual subscriptionId from the server.
68
72
  */
69
73
  #subscriptions = new Map();
74
+ #endedSubscriptions = new Set();
70
75
  #maybeDisconnectTimeout;
76
+
71
77
  // DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM
72
78
  constructor(client, {
73
79
  minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS
@@ -79,29 +85,37 @@ export class ObjectSetListenerWebsocket {
79
85
  });
80
86
  !(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ? invariant(false, "Stack must be a URL") : invariant(false) : void 0;
81
87
  }
82
- async subscribe(objectType, objectSet, listener, properties) {
83
- const objDef = await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName);
84
- const objectProperties = properties.filter(p => objDef.properties[p].type !== "geotimeSeriesReference");
85
- const referenceProperties = properties.filter(p => objDef.properties[p].type === "geotimeSeriesReference");
88
+ async subscribe(objectType, objectSet, listener, properties = []) {
89
+ const objOrInterfaceDef = objectType.type === "object" ? await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName) : await this.#client.ontologyProvider.getInterfaceDefinition(objectType.apiName);
90
+ let objectProperties = [];
91
+ let referenceProperties = [];
92
+ if (properties.length === 0) {
93
+ properties = Object.keys(objOrInterfaceDef.properties);
94
+ }
95
+ objectProperties = properties.filter(p => objOrInterfaceDef.properties[p].type !== "geotimeSeriesReference");
96
+ referenceProperties = properties.filter(p => objOrInterfaceDef.properties[p].type === "geotimeSeriesReference");
86
97
  const sub = {
87
98
  listener: fillOutListener(listener),
88
99
  objectSet,
89
- primaryKeyPropertyName: objDef.primaryKeyApiName,
100
+ primaryKeyPropertyName: objOrInterfaceDef.type === "interface" ? undefined : objOrInterfaceDef.primaryKeyApiName,
90
101
  requestedProperties: objectProperties,
91
102
  requestedReferenceProperties: referenceProperties,
92
103
  status: "preparing",
93
104
  // Since we don't have a real subscription id yet but we need to keep
94
105
  // track of this reference, we can just use a random uuid.
95
- subscriptionId: `TMP-${crypto.randomUUID()}`
106
+ subscriptionId: `TMP-${nextUuid()}}`,
107
+ interfaceApiName: objOrInterfaceDef.type === "object" ? undefined : objOrInterfaceDef.apiName
96
108
  };
97
109
  this.#subscriptions.set(sub.subscriptionId, sub);
110
+
98
111
  // actually prepares the subscription, ensures the ws is ready, and sends
99
112
  // a subscribe message. We don't want to block on this.
100
- this.#initiateSubscribe(sub);
113
+ void this.#initiateSubscribe(sub);
101
114
  return () => {
102
115
  this.#unsubscribe(sub);
103
116
  };
104
117
  }
118
+
105
119
  /**
106
120
  * Called at least once for every subscription.
107
121
  *
@@ -117,6 +131,7 @@ export class ObjectSetListenerWebsocket {
117
131
  }
118
132
  try {
119
133
  await this.#ensureWebsocket();
134
+
120
135
  // the consumer may have already unsubscribed before we are ready to request a subscription
121
136
  // so we have to acquire the pendingSubscription after the await.
122
137
  if (subscriptionIsDone(sub)) {
@@ -129,7 +144,7 @@ export class ObjectSetListenerWebsocket {
129
144
  }
130
145
  } catch (error) {
131
146
  this.#logger?.error(error, "Error in #initiateSubscribe");
132
- sub.listener.onError([error]);
147
+ this.#tryCatchOnError(sub, true, error);
133
148
  }
134
149
  }
135
150
  #sendSubscribeMessage() {
@@ -140,16 +155,10 @@ export class ObjectSetListenerWebsocket {
140
155
  // we may have multiple subscriptions that don't have a subscriptionId yet,
141
156
  // so we filter those out.
142
157
  const readySubs = [...this.#subscriptions.values()].filter(isReady);
143
- if (readySubs.length === 0) {
144
- if (process.env.NODE_ENV !== "production") {
145
- this.#logger?.trace("#sendSubscribeMessage(): aborting due to no ready subscriptions");
146
- }
147
- return;
148
- }
149
- // Assumes the node 18 crypto fallback to globalThis in `subscribe` has happened.
150
- const id = crypto.randomUUID();
158
+ const id = nextUuid();
151
159
  // responses come back as an array of subIds, so we need to know the sources
152
160
  this.#pendingSubscriptions.set(id, readySubs);
161
+
153
162
  // every subscribe message "overwrites" the previous ones that are not
154
163
  // re-included, so we have to reconstitute the entire list of subscriptions
155
164
  const subscribe = {
@@ -157,7 +166,8 @@ export class ObjectSetListenerWebsocket {
157
166
  requests: readySubs.map(({
158
167
  objectSet,
159
168
  requestedProperties,
160
- requestedReferenceProperties
169
+ requestedReferenceProperties,
170
+ interfaceApiName
161
171
  }) => {
162
172
  return {
163
173
  objectSet: objectSet,
@@ -179,10 +189,13 @@ export class ObjectSetListenerWebsocket {
179
189
  return;
180
190
  }
181
191
  sub.status = newStatus;
192
+
182
193
  // make sure listeners do nothing now
183
194
  sub.listener = fillOutListener({});
184
195
  this.#subscriptions.delete(sub.subscriptionId);
196
+ this.#endedSubscriptions.add(sub.subscriptionId);
185
197
  this.#sendSubscribeMessage();
198
+
186
199
  // If we have no more subscriptions, we can disconnect the websocket
187
200
  // however we should wait a bit to see if we get any more subscriptions.
188
201
  // For example, when switching between react views, you may unsubscribe
@@ -212,9 +225,9 @@ export class ObjectSetListenerWebsocket {
212
225
  baseUrl,
213
226
  tokenProvider
214
227
  } = this.#client;
215
- const base = new URL(baseUrl);
216
- const url = `wss://${base.host}/api/v2/ontologySubscriptions/ontologies/${this.#client.ontologyRid}/streamSubscriptions`;
228
+ const url = constructWebsocketUrl(baseUrl, await this.#client.ontologyRid);
217
229
  const token = await tokenProvider();
230
+
218
231
  // tokenProvider is async, there could potentially be a race to create the websocket.
219
232
  // Only the first call to reach here will find a null this.#ws, the rest will bail out
220
233
  if (this.#ws == null) {
@@ -227,6 +240,7 @@ export class ObjectSetListenerWebsocket {
227
240
  });
228
241
  }
229
242
  this.#lastWsConnect = Date.now();
243
+
230
244
  // we again may have lost the race after our minimum backoff time
231
245
  if (this.#ws == null) {
232
246
  if (process.env.NODE_ENV !== "production") {
@@ -276,14 +290,14 @@ export class ObjectSetListenerWebsocket {
276
290
  }
277
291
  switch (data.type) {
278
292
  case "objectSetChanged":
279
- return this.#handleMessage_objectSetChanged(data);
293
+ return void this.#handleMessage_objectSetChanged(data);
280
294
  case "refreshObjectSet":
281
- return this.#handleMessage_refreshObjectSet(data);
295
+ return void this.#handleMessage_refreshObjectSet(data);
282
296
  case "subscribeResponses":
283
- return this.#handleMessage_subscribeResponses(data);
297
+ return void this.#handleMessage_subscribeResponses(data);
284
298
  case "subscriptionClosed":
285
299
  {
286
- return this.#handleMessage_subscriptionClosed(data);
300
+ return void this.#handleMessage_subscriptionClosed(data);
287
301
  }
288
302
  default:
289
303
  process.env.NODE_ENV !== "production" ? invariant(false, "Unexpected message type") : invariant(false);
@@ -295,12 +309,12 @@ export class ObjectSetListenerWebsocket {
295
309
  const objectUpdates = payload.updates.filter(update => update.type === "object");
296
310
  const referenceUpdates = payload.updates.filter(update => update.type === "reference");
297
311
  const osdkObjectsWithReferenceUpdates = await Promise.all(referenceUpdates.map(async o => {
298
- const osdkObjectArray = await convertWireToOsdkObjects(this.#client, [{
312
+ const osdkObjectArray = await this.#client.objectFactory2(this.#client, [{
299
313
  __apiName: o.objectType,
300
- __primaryKey: o.primaryKey[sub.primaryKeyPropertyName],
314
+ __primaryKey: sub.primaryKeyPropertyName != null ? o.primaryKey[sub.primaryKeyPropertyName] : undefined,
301
315
  ...o.primaryKey,
302
316
  [o.property]: o.value
303
- }], undefined);
317
+ }], sub.interfaceApiName, false, undefined, false, await this.#fetchInterfaceMapping(o.objectType, sub.interfaceApiName));
304
318
  const singleOsdkObject = osdkObjectArray[0] ?? undefined;
305
319
  return singleOsdkObject != null ? {
306
320
  object: singleOsdkObject,
@@ -309,7 +323,12 @@ export class ObjectSetListenerWebsocket {
309
323
  }));
310
324
  for (const osdkObject of osdkObjectsWithReferenceUpdates) {
311
325
  if (osdkObject != null) {
312
- sub.listener.onChange?.(osdkObject);
326
+ try {
327
+ sub.listener.onChange?.(osdkObject);
328
+ } catch (error) {
329
+ this.#logger?.error(error, "Error in onChange callback");
330
+ this.#tryCatchOnError(sub, false, error);
331
+ }
313
332
  }
314
333
  }
315
334
  const osdkObjects = await Promise.all(objectUpdates.map(async o => {
@@ -317,7 +336,7 @@ export class ObjectSetListenerWebsocket {
317
336
  for (const key of keysToDelete) {
318
337
  delete o.object[key];
319
338
  }
320
- const osdkObjectArray = await convertWireToOsdkObjects(this.#client, [o.object], undefined);
339
+ const osdkObjectArray = await this.#client.objectFactory2(this.#client, [o.object], sub.interfaceApiName, false, undefined, false, await this.#fetchInterfaceMapping(o.object.__apiName, sub.interfaceApiName));
321
340
  const singleOsdkObject = osdkObjectArray[0] ?? undefined;
322
341
  return singleOsdkObject != null ? {
323
342
  object: singleOsdkObject,
@@ -326,14 +345,33 @@ export class ObjectSetListenerWebsocket {
326
345
  }));
327
346
  for (const osdkObject of osdkObjects) {
328
347
  if (osdkObject != null) {
329
- sub.listener.onChange?.(osdkObject);
348
+ try {
349
+ sub.listener.onChange?.(osdkObject);
350
+ } catch (error) {
351
+ this.#logger?.error(error, "Error in onChange callback");
352
+ this.#tryCatchOnError(sub, false, error);
353
+ }
330
354
  }
331
355
  }
332
356
  };
357
+ async #fetchInterfaceMapping(objectTypeApiName, interfaceApiName) {
358
+ if (interfaceApiName == null) return {};
359
+ const interfaceMap = (await this.#client.ontologyProvider.getObjectDefinition(objectTypeApiName)).interfaceMap;
360
+ return {
361
+ [interfaceApiName]: {
362
+ [objectTypeApiName]: interfaceMap[interfaceApiName]
363
+ }
364
+ };
365
+ }
333
366
  #handleMessage_refreshObjectSet = payload => {
334
367
  const sub = this.#subscriptions.get(payload.id);
335
368
  !sub ? process.env.NODE_ENV !== "production" ? invariant(false, `Expected subscription id ${payload.id}`) : invariant(false) : void 0;
336
- sub.listener.onOutOfDate();
369
+ try {
370
+ sub.listener.onOutOfDate();
371
+ } catch (error) {
372
+ this.#logger?.error(error, "Error in onOutOfDate callback");
373
+ this.#tryCatchOnError(sub, false, error);
374
+ }
337
375
  };
338
376
  #handleMessage_subscribeResponses = payload => {
339
377
  const {
@@ -348,7 +386,7 @@ export class ObjectSetListenerWebsocket {
348
386
  const response = responses[i];
349
387
  switch (response.type) {
350
388
  case "error":
351
- sub.listener.onError(response.errors);
389
+ this.#tryCatchOnError(sub, true, response.errors);
352
390
  this.#unsubscribe(sub, "error");
353
391
  break;
354
392
  case "qos":
@@ -370,17 +408,23 @@ export class ObjectSetListenerWebsocket {
370
408
  sub.subscriptionId = response.id;
371
409
  this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId
372
410
  }
373
- if (shouldFireOutOfDate) sub.listener.onOutOfDate();else sub.listener.onSuccessfulSubscription();
411
+ try {
412
+ if (shouldFireOutOfDate) sub.listener.onOutOfDate();else sub.listener.onSuccessfulSubscription();
413
+ } catch (error) {
414
+ this.#logger?.error(error, "Error in onOutOfDate or onSuccessfulSubscription callback");
415
+ this.#tryCatchOnError(sub, false, error);
416
+ }
374
417
  break;
375
418
  default:
376
- sub.listener.onError(response);
419
+ this.#tryCatchOnError(sub, true, response);
377
420
  }
378
421
  }
379
422
  };
380
423
  #handleMessage_subscriptionClosed(payload) {
381
424
  const sub = this.#subscriptions.get(payload.id);
425
+ if (sub == null && this.#endedSubscriptions.has(payload.id)) return;
382
426
  !sub ? process.env.NODE_ENV !== "production" ? invariant(false, `Expected subscription id ${payload.id}`) : invariant(false) : void 0;
383
- sub.listener.onError([payload.cause]);
427
+ this.#tryCatchOnError(sub, true, payload.cause);
384
428
  this.#unsubscribe(sub, "error");
385
429
  }
386
430
  #onClose = event => {
@@ -402,6 +446,7 @@ export class ObjectSetListenerWebsocket {
402
446
  }
403
447
  this.#ws = undefined;
404
448
  }
449
+
405
450
  // if we have any listeners that are still depending on us, go ahead and reopen the websocket
406
451
  if (this.#subscriptions.size > 0) {
407
452
  if (process.env.NODE_ENV !== "production") {
@@ -412,8 +457,43 @@ export class ObjectSetListenerWebsocket {
412
457
  for (const s of this.#subscriptions.values()) {
413
458
  if (s.status === "subscribed") s.status = "reconnecting";
414
459
  }
415
- this.#ensureWebsocket();
460
+
461
+ // we don't care about the result of this (we want cycleWebsocket to be fire and forget)
462
+ // just that it happens
463
+ void this.#ensureWebsocket();
464
+ }
465
+ };
466
+ #tryCatchOnError = (sub, subscriptionClosed, error) => {
467
+ try {
468
+ sub.listener.onError({
469
+ subscriptionClosed: subscriptionClosed,
470
+ error
471
+ });
472
+ } catch (onErrorError) {
473
+ // eslint-disable-next-line no-console
474
+ console.error(`Error encountered in an onError callback for an OSDK subscription`, onErrorError);
475
+ // eslint-disable-next-line no-console
476
+ console.error(`This onError call was triggered by an error in another callback`, error);
477
+ // eslint-disable-next-line no-console
478
+ console.error(`The subscription has been closed.`, error);
479
+ if (!subscriptionClosed) {
480
+ this.#logger?.error(error, "Error in onError callback");
481
+ this.#unsubscribe(sub, "error");
482
+ this.#tryCatchOnError(sub, true, onErrorError);
483
+ }
416
484
  }
417
485
  };
418
486
  }
487
+
488
+ /** @internal */
489
+ export function constructWebsocketUrl(baseUrl, ontologyRid) {
490
+ const base = new URL(baseUrl);
491
+ const url = new URL(`api/v2/ontologySubscriptions/ontologies/${ontologyRid}/streamSubscriptions`, base);
492
+ url.protocol = url.protocol.replace("https", "wss");
493
+ return url;
494
+ }
495
+ let uuidCounter = 0;
496
+ function nextUuid() {
497
+ return `00000000-0000-0000-0000-${(uuidCounter++).toString().padStart(12, "0")}`;
498
+ }
419
499
  //# sourceMappingURL=ObjectSetListenerWebsocket.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectSetListenerWebsocket.js","names":["WebSocket","invariant","convertWireToOsdkObjects","MINIMUM_RECONNECT_DELAY_MS","doNothing","fillOutListener","onChange","onError","onOutOfDate","onSuccessfulSubscription","isReady","sub","subscriptionIsDone","status","ObjectSetListenerWebsocket","instances","WeakMap","getInstance","client","instance","get","clientCacheKey","set","ws","lastWsConnect","logger","pendingSubscriptions","Map","subscriptions","maybeDisconnectTimeout","constructor","minimumReconnectDelayMs","child","msgPrefix","baseUrl","startsWith","process","env","NODE_ENV","subscribe","objectType","objectSet","listener","properties","objDef","ontologyProvider","getObjectDefinition","apiName","objectProperties","filter","p","type","referenceProperties","primaryKeyPropertyName","primaryKeyApiName","requestedProperties","requestedReferenceProperties","subscriptionId","crypto","randomUUID","initiateSubscribe","unsubscribe","#initiateSubscribe","trace","ensureWebsocket","readyState","OPEN","sendSubscribeMessage","error","#sendSubscribeMessage","readySubs","values","length","id","requests","map","propertySet","referenceSet","payload","send","JSON","stringify","#unsubscribe","newStatus","delete","clearTimeout","setTimeout","undefined","size","cycleWebsocket","#ensureWebsocket","tokenProvider","base","URL","url","host","ontologyRid","token","nextConnectTime","Date","now","Promise","resolve","addEventListener","onClose","onMessage","onOpen","CONNECTING","reject","cleanup","removeEventListener","open","evt","#onOpen","message","data","parse","toString","handleMessage_objectSetChanged","handleMessage_refreshObjectSet","handleMessage_subscribeResponses","handleMessage_subscriptionClosed","objectUpdates","updates","update","referenceUpdates","osdkObjectsWithReferenceUpdates","all","o","osdkObjectArray","__apiName","__primaryKey","primaryKey","property","value","singleOsdkObject","object","state","osdkObject","osdkObjects","keysToDelete","Object","keys","key","includes","responses","subs","i","response","errors","shouldFireOutOfDate","#handleMessage_subscriptionClosed","cause","event","#cycleWebsocket","CLOSING","CLOSED","close","s"],"sources":["ObjectSetListenerWebsocket.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 WebSocket from \"isomorphic-ws\";\nimport invariant from \"tiny-invariant\";\nimport { convertWireToOsdkObjects } from \"../object/convertWireToOsdkObjects.js\";\nconst MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;\n/** Noop function to reduce conditional checks */\nfunction doNothing() { }\n/**\n * Converts an ObjectSetListener to one where all the functions are defined.\n */\nfunction fillOutListener({ onChange = doNothing, onError = doNothing, onOutOfDate = doNothing, onSuccessfulSubscription = doNothing, }) {\n return { onChange, onError, onOutOfDate, onSuccessfulSubscription };\n}\nfunction isReady(sub) {\n return sub.isReady != null;\n}\nfunction subscriptionIsDone(sub) {\n return sub.status === \"done\" || sub.status === \"error\";\n}\n/** @internal */\nexport class ObjectSetListenerWebsocket {\n static #instances = new WeakMap();\n MINIMUM_RECONNECT_DELAY_MS;\n // FIXME\n static getInstance(client) {\n let instance = ObjectSetListenerWebsocket.#instances.get(client.clientCacheKey);\n if (instance == null) {\n instance = new ObjectSetListenerWebsocket(client);\n ObjectSetListenerWebsocket.#instances.set(client.clientCacheKey, instance);\n }\n return instance;\n }\n #ws;\n #lastWsConnect = 0;\n #client;\n #logger;\n /**\n * map of requestId to all active subscriptions at the time of the request\n */\n #pendingSubscriptions = new Map();\n /**\n * Map of subscriptionId to Subscription. Note: the subscriptionId may be\n * temporary and not the actual subscriptionId from the server.\n */\n #subscriptions = new Map();\n #maybeDisconnectTimeout;\n // DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM\n constructor(client, { minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS, } = {}) {\n this.MINIMUM_RECONNECT_DELAY_MS = minimumReconnectDelayMs;\n this.#client = client;\n this.#logger = client.logger?.child({}, {\n msgPrefix: \"<OSW> \",\n });\n invariant(client.baseUrl.startsWith(\"https://\")\n || client.baseUrl.startsWith(\"http://\"), \"Stack must be a URL\");\n }\n async subscribe(objectType, objectSet, listener, properties) {\n if (process.env.TARGET !== \"browser\") {\n // Node 18 does not expose 'crypto' on globalThis, so we need to do it ourselves. This\n // will not be needed after our minimum version is 19 or greater.\n globalThis.crypto ??= (await import(\"node:crypto\")).webcrypto;\n }\n const objDef = await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName);\n const objectProperties = properties.filter((p) => objDef.properties[p].type !== \"geotimeSeriesReference\");\n const referenceProperties = properties.filter((p) => objDef.properties[p].type === \"geotimeSeriesReference\");\n const sub = {\n listener: fillOutListener(listener),\n objectSet,\n primaryKeyPropertyName: objDef.primaryKeyApiName,\n requestedProperties: objectProperties,\n requestedReferenceProperties: referenceProperties,\n status: \"preparing\",\n // Since we don't have a real subscription id yet but we need to keep\n // track of this reference, we can just use a random uuid.\n subscriptionId: `TMP-${crypto.randomUUID()}`,\n };\n this.#subscriptions.set(sub.subscriptionId, sub);\n // actually prepares the subscription, ensures the ws is ready, and sends\n // a subscribe message. We don't want to block on this.\n this.#initiateSubscribe(sub);\n return () => {\n this.#unsubscribe(sub);\n };\n }\n /**\n * Called at least once for every subscription.\n *\n * - Resets pending expiry\n * - Recreates temporary object set\n * - Triggers a full subscribe message\n *\n * @returns\n */\n async #initiateSubscribe(sub) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#initiateSubscribe()\");\n }\n try {\n await this.#ensureWebsocket();\n // the consumer may have already unsubscribed before we are ready to request a subscription\n // so we have to acquire the pendingSubscription after the await.\n if (subscriptionIsDone(sub)) {\n return;\n }\n sub.isReady = true;\n // if we aren't open, then this happens after we #onConnect\n if (this.#ws?.readyState === WebSocket.OPEN) {\n this.#sendSubscribeMessage();\n }\n }\n catch (error) {\n this.#logger?.error(error, \"Error in #initiateSubscribe\");\n sub.listener.onError([error]);\n }\n }\n #sendSubscribeMessage() {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#sendSubscribeMessage()\");\n }\n // If two calls to `.subscribe()` happen at once (or if the connection is reset),\n // we may have multiple subscriptions that don't have a subscriptionId yet,\n // so we filter those out.\n const readySubs = [...this.#subscriptions.values()].filter(isReady);\n if (readySubs.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#sendSubscribeMessage(): aborting due to no ready subscriptions\");\n }\n return;\n }\n // Assumes the node 18 crypto fallback to globalThis in `subscribe` has happened.\n const id = crypto.randomUUID();\n // responses come back as an array of subIds, so we need to know the sources\n this.#pendingSubscriptions.set(id, readySubs);\n // every subscribe message \"overwrites\" the previous ones that are not\n // re-included, so we have to reconstitute the entire list of subscriptions\n const subscribe = {\n id,\n requests: readySubs.map(({ objectSet, requestedProperties, requestedReferenceProperties }) => {\n return {\n objectSet: objectSet,\n propertySet: requestedProperties,\n referenceSet: requestedReferenceProperties,\n };\n }),\n };\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ payload: subscribe }, \"sending subscribe message\");\n }\n this.#ws?.send(JSON.stringify(subscribe));\n }\n #unsubscribe(sub, newStatus = \"done\") {\n if (subscriptionIsDone(sub)) {\n // if we are already done, we don't need to do anything\n return;\n }\n sub.status = newStatus;\n // make sure listeners do nothing now\n sub.listener = fillOutListener({});\n this.#subscriptions.delete(sub.subscriptionId);\n this.#sendSubscribeMessage();\n // If we have no more subscriptions, we can disconnect the websocket\n // however we should wait a bit to see if we get any more subscriptions.\n // For example, when switching between react views, you may unsubscribe\n // in the old view and subscribe in the new view. We don't need to re-establish\n // the websocket connection in that case.\n if (this.#maybeDisconnectTimeout) {\n // We reset the timeout on every unsubscribe so its always at least 15s from\n // the last time we are empty. E.g.:\n // - 0s: Subscribe(A)\n // - 10s: Unsubscribe(A)\n // - 11s: Subscribe(B)\n // - 20s: Unsubscribe(B)\n // If we do not clear out the timeout we would disconnect at 25s but that would only be\n // 5s after the last subscription was removed instead of at 35s for the desired 15s.\n clearTimeout(this.#maybeDisconnectTimeout);\n }\n this.#maybeDisconnectTimeout = setTimeout(() => {\n this.#maybeDisconnectTimeout = undefined;\n if (this.#subscriptions.size === 0) {\n this.#cycleWebsocket();\n }\n }, 15_000 /* ms */);\n }\n async #ensureWebsocket() {\n if (this.#ws == null) {\n const { baseUrl, tokenProvider } = this.#client;\n const base = new URL(baseUrl);\n const url = `wss://${base.host}/api/v2/ontologySubscriptions/ontologies/${this.#client.ontologyRid}/streamSubscriptions`;\n const token = await tokenProvider();\n // tokenProvider is async, there could potentially be a race to create the websocket.\n // Only the first call to reach here will find a null this.#ws, the rest will bail out\n if (this.#ws == null) {\n // TODO this can probably be exponential backoff with jitter\n // don't reconnect more quickly than MINIMUM_RECONNECT_DELAY\n const nextConnectTime = (this.#lastWsConnect ?? 0)\n + this.MINIMUM_RECONNECT_DELAY_MS;\n if (nextConnectTime > Date.now()) {\n await new Promise((resolve) => {\n setTimeout(resolve, nextConnectTime - Date.now());\n });\n }\n this.#lastWsConnect = Date.now();\n // we again may have lost the race after our minimum backoff time\n if (this.#ws == null) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"Creating websocket\");\n }\n this.#ws = new WebSocket(url, [`Bearer-${token}`]);\n this.#ws.addEventListener(\"close\", this.#onClose);\n this.#ws.addEventListener(\"message\", this.#onMessage);\n this.#ws.addEventListener(\"open\", this.#onOpen);\n }\n }\n // Allow await-ing the websocket open event if it isn't open already.\n // This needs to happen even for callers that didn't just create this.#ws\n if (this.#ws.readyState === WebSocket.CONNECTING) {\n const ws = this.#ws;\n return new Promise((resolve, reject) => {\n function cleanup() {\n ws.removeEventListener(\"open\", open);\n ws.removeEventListener(\"error\", error);\n ws.removeEventListener(\"close\", cleanup);\n }\n function open() {\n cleanup();\n resolve();\n }\n function error(evt) {\n cleanup();\n reject(evt);\n }\n ws.addEventListener(\"open\", open);\n ws.addEventListener(\"error\", error);\n ws.addEventListener(\"close\", cleanup);\n });\n }\n }\n }\n #onOpen = () => {\n // resubscribe all of the listeners\n this.#sendSubscribeMessage();\n };\n #onMessage = async (message) => {\n const data = JSON.parse(message.data.toString());\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ payload: data }, \"received message from ws\");\n }\n switch (data.type) {\n case \"objectSetChanged\":\n return this.#handleMessage_objectSetChanged(data);\n case \"refreshObjectSet\":\n return this.#handleMessage_refreshObjectSet(data);\n case \"subscribeResponses\":\n return this.#handleMessage_subscribeResponses(data);\n case \"subscriptionClosed\": {\n return this.#handleMessage_subscriptionClosed(data);\n }\n default:\n const _ = data;\n invariant(false, \"Unexpected message type\");\n }\n };\n #handleMessage_objectSetChanged = async (payload) => {\n const sub = this.#subscriptions.get(payload.id);\n if (sub == null)\n return;\n const objectUpdates = payload.updates.filter((update) => update.type === \"object\");\n const referenceUpdates = payload.updates.filter((update) => update.type === \"reference\");\n const osdkObjectsWithReferenceUpdates = await Promise.all(referenceUpdates.map(async (o) => {\n const osdkObjectArray = await convertWireToOsdkObjects(this.#client, [{\n __apiName: o.objectType,\n __primaryKey: o.primaryKey[sub.primaryKeyPropertyName],\n ...o.primaryKey,\n [o.property]: o.value,\n }], undefined);\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null\n ? {\n object: singleOsdkObject,\n state: \"ADDED_OR_UPDATED\",\n }\n : undefined;\n }));\n for (const osdkObject of osdkObjectsWithReferenceUpdates) {\n if (osdkObject != null) {\n sub.listener.onChange?.(osdkObject);\n }\n }\n const osdkObjects = await Promise.all(objectUpdates.map(async (o) => {\n const keysToDelete = Object.keys(o.object).filter((key) => sub.requestedReferenceProperties.includes(key));\n for (const key of keysToDelete) {\n delete o.object[key];\n }\n const osdkObjectArray = await convertWireToOsdkObjects(this.#client, [o.object], undefined);\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null\n ? {\n object: singleOsdkObject,\n state: o.state,\n }\n : undefined;\n }));\n for (const osdkObject of osdkObjects) {\n if (osdkObject != null) {\n sub.listener.onChange?.(osdkObject);\n }\n }\n };\n #handleMessage_refreshObjectSet = (payload) => {\n const sub = this.#subscriptions.get(payload.id);\n invariant(sub, `Expected subscription id ${payload.id}`);\n sub.listener.onOutOfDate();\n };\n #handleMessage_subscribeResponses = (payload) => {\n const { id, responses } = payload;\n const subs = this.#pendingSubscriptions.get(id);\n invariant(subs, `should have a pending subscription for ${id}`);\n this.#pendingSubscriptions.delete(id);\n for (let i = 0; i < responses.length; i++) {\n const sub = subs[i];\n const response = responses[i];\n switch (response.type) {\n case \"error\":\n sub.listener.onError(response.errors);\n this.#unsubscribe(sub, \"error\");\n break;\n case \"qos\":\n // the server has requested that we tear down our websocket and reconnect to help load balance\n this.#cycleWebsocket();\n break;\n case \"success\":\n // `\"preparing\"` should only be the status on an initial subscribe.\n const shouldFireOutOfDate = sub.status === \"expired\"\n || sub.status === \"reconnecting\";\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ shouldFireOutOfDate }, \"success\");\n }\n sub.status = \"subscribed\";\n if (sub.subscriptionId !== response.id) {\n // might be the temporary one\n this.#subscriptions.delete(sub.subscriptionId);\n sub.subscriptionId = response.id;\n this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId\n }\n if (shouldFireOutOfDate)\n sub.listener.onOutOfDate();\n else\n sub.listener.onSuccessfulSubscription();\n break;\n default:\n const _ = response;\n sub.listener.onError(response);\n }\n }\n };\n #handleMessage_subscriptionClosed(payload) {\n const sub = this.#subscriptions.get(payload.id);\n invariant(sub, `Expected subscription id ${payload.id}`);\n sub.listener.onError([payload.cause]);\n this.#unsubscribe(sub, \"error\");\n }\n #onClose = (event) => {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ event }, \"Received close event from ws\", event);\n }\n // TODO we should probably throttle this so we don't abuse the backend\n this.#cycleWebsocket();\n };\n #cycleWebsocket = () => {\n if (this.#ws) {\n this.#ws.removeEventListener(\"open\", this.#onOpen);\n this.#ws.removeEventListener(\"message\", this.#onMessage);\n this.#ws.removeEventListener(\"close\", this.#onClose);\n if (this.#ws.readyState !== WebSocket.CLOSING\n && this.#ws.readyState !== WebSocket.CLOSED) {\n this.#ws.close();\n }\n this.#ws = undefined;\n }\n // if we have any listeners that are still depending on us, go ahead and reopen the websocket\n if (this.#subscriptions.size > 0) {\n if (process.env.NODE_ENV !== \"production\") {\n for (const s of this.#subscriptions.values()) {\n invariant(s.status !== \"done\" && s.status !== \"error\", \"should not have done/error subscriptions still\");\n }\n }\n for (const s of this.#subscriptions.values()) {\n if (s.status === \"subscribed\")\n s.status = \"reconnecting\";\n }\n this.#ensureWebsocket();\n }\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,eAAe;AACrC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,wBAAwB,QAAQ,uCAAuC;AAChF,MAAMC,0BAA0B,GAAG,CAAC,GAAG,IAAI;AAC3C;AACA,SAASC,SAASA,CAAA,EAAG,CAAE;AACvB;AACA;AACA;AACA,SAASC,eAAeA,CAAC;EAAEC,QAAQ,GAAGF,SAAS;EAAEG,OAAO,GAAGH,SAAS;EAAEI,WAAW,GAAGJ,SAAS;EAAEK,wBAAwB,GAAGL;AAAW,CAAC,EAAE;EACpI,OAAO;IAAEE,QAAQ;IAAEC,OAAO;IAAEC,WAAW;IAAEC;EAAy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AS,EAAE,IAAI,CAAC,CAACL,SAAS,CAAC;MACxD,IAAI,CAAC,CAAClF,EAAE,CAACuF,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAACN,OAAO,CAAC;MACpD,IAAI,IAAI,CAAC,CAACjF,EAAE,CAAC0C,UAAU,KAAKjE,SAAS,CAAC2J,OAAO,IACtC,IAAI,CAAC,CAACpI,EAAE,CAAC0C,UAAU,KAAKjE,SAAS,CAAC4J,MAAM,EAAE;QAC7C,IAAI,CAAC,CAACrI,EAAE,CAACsI,KAAK,CAAC,CAAC;MACpB;MACA,IAAI,CAAC,CAACtI,EAAE,GAAGgE,SAAS;IACxB;IACA;IACA,IAAI,IAAI,CAAC,CAAC3D,aAAa,CAAC4D,IAAI,GAAG,CAAC,EAAE;MAC9B,IAAIpD,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;QACvC,KAAK,MAAMwH,CAAC,IAAI,IAAI,CAAC,CAAClI,aAAa,CAAC2C,MAAM,CAAC,CAAC,EAAE;UAC1C,EAAUuF,CAAC,CAACjJ,MAAM,KAAK,MAAM,IAAIiJ,CAAC,CAACjJ,MAAM,KAAK,OAAO,IAAAuB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAArDrC,SAAS,QAA8C,gDAAgD,IAAvGA,SAAS;QACb;MACJ;MACA,KAAK,MAAM6J,CAAC,IAAI,IAAI,CAAC,CAAClI,aAAa,CAAC2C,MAAM,CAAC,CAAC,EAAE;QAC1C,IAAIuF,CAAC,CAACjJ,MAAM,KAAK,YAAY,EACzBiJ,CAAC,CAACjJ,MAAM,GAAG,cAAc;MACjC;MACA,IAAI,CAAC,CAACmD,eAAe,CAAC,CAAC;IAC3B;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"ObjectSetListenerWebsocket.js","names":["WebSocket","invariant","MINIMUM_RECONNECT_DELAY_MS","doNothing","fillOutListener","onChange","onError","onOutOfDate","onSuccessfulSubscription","isReady","sub","subscriptionIsDone","status","ObjectSetListenerWebsocket","instances","WeakMap","getInstance","client","instance","get","clientCacheKey","set","ws","lastWsConnect","logger","pendingSubscriptions","Map","subscriptions","endedSubscriptions","Set","maybeDisconnectTimeout","constructor","minimumReconnectDelayMs","child","msgPrefix","baseUrl","startsWith","process","env","NODE_ENV","subscribe","objectType","objectSet","listener","properties","objOrInterfaceDef","type","ontologyProvider","getObjectDefinition","apiName","getInterfaceDefinition","objectProperties","referenceProperties","length","Object","keys","filter","p","primaryKeyPropertyName","undefined","primaryKeyApiName","requestedProperties","requestedReferenceProperties","subscriptionId","nextUuid","interfaceApiName","initiateSubscribe","unsubscribe","#initiateSubscribe","trace","ensureWebsocket","readyState","OPEN","sendSubscribeMessage","error","tryCatchOnError","#sendSubscribeMessage","readySubs","values","id","requests","map","propertySet","referenceSet","payload","send","JSON","stringify","#unsubscribe","newStatus","delete","add","clearTimeout","setTimeout","size","cycleWebsocket","#ensureWebsocket","tokenProvider","url","constructWebsocketUrl","ontologyRid","token","nextConnectTime","Date","now","Promise","resolve","addEventListener","onClose","onMessage","onOpen","CONNECTING","reject","cleanup","removeEventListener","open","evt","#onOpen","message","data","parse","toString","handleMessage_objectSetChanged","handleMessage_refreshObjectSet","handleMessage_subscribeResponses","handleMessage_subscriptionClosed","objectUpdates","updates","update","referenceUpdates","osdkObjectsWithReferenceUpdates","all","o","osdkObjectArray","objectFactory2","__apiName","__primaryKey","primaryKey","property","value","fetchInterfaceMapping","singleOsdkObject","object","state","osdkObject","osdkObjects","keysToDelete","key","includes","#fetchInterfaceMapping","objectTypeApiName","interfaceMap","responses","subs","i","response","errors","shouldFireOutOfDate","#handleMessage_subscriptionClosed","has","cause","event","#cycleWebsocket","CLOSING","CLOSED","close","s","#tryCatchOnError","subscriptionClosed","onErrorError","console","base","URL","protocol","replace","uuidCounter","padStart"],"sources":["ObjectSetListenerWebsocket.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n ObjectSetSubscription,\n Osdk,\n PropertyKeys,\n} from \"@osdk/api\";\nimport type {\n ObjectSet,\n ObjectSetStreamSubscribeRequest,\n ObjectSetStreamSubscribeRequests,\n ObjectSetSubscribeResponses,\n ObjectSetUpdates,\n ObjectState,\n RefreshObjectSet,\n StreamMessage,\n SubscriptionClosed,\n} from \"@osdk/foundry.ontologies\";\nimport WebSocket from \"isomorphic-ws\";\nimport invariant from \"tiny-invariant\";\nimport type { Logger } from \"../Logger.js\";\nimport type { ClientCacheKey, MinimalClient } from \"../MinimalClientContext.js\";\n\nconst MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;\n\n/** Noop function to reduce conditional checks */\nfunction doNothing() {}\n\n/**\n * Converts an ObjectSetListener to one where all the functions are defined.\n */\nfunction fillOutListener<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n>(\n {\n onChange = doNothing,\n onError = doNothing,\n onOutOfDate = doNothing,\n onSuccessfulSubscription = doNothing,\n }: ObjectSetSubscription.Listener<Q, P>,\n): Required<ObjectSetSubscription.Listener<Q, P>> {\n return { onChange, onError, onOutOfDate, onSuccessfulSubscription };\n}\n\ninterface Subscription<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n> {\n listener: Required<ObjectSetSubscription.Listener<Q, P>>;\n requestedProperties: Array<P>;\n requestedReferenceProperties: Array<P>;\n objectSet: ObjectSet;\n\n subscriptionId: string;\n isReady?: boolean;\n status:\n | \"preparing\"\n | \"subscribed\"\n | \"done\"\n | \"expired\"\n | \"error\"\n | \"reconnecting\";\n\n interfaceApiName?: string;\n primaryKeyPropertyName?: string;\n}\n\nfunction isReady<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n>(\n sub: Subscription<Q, P>,\n): sub is Subscription<Q, P> & { temporaryObjectSetId: string } {\n return sub.isReady != null;\n}\n\nfunction subscriptionIsDone(sub: Subscription<any, any>) {\n return sub.status === \"done\" || sub.status === \"error\";\n}\n\n/** @internal */\nexport class ObjectSetListenerWebsocket {\n static #instances = new WeakMap<\n ClientCacheKey,\n ObjectSetListenerWebsocket\n >();\n readonly MINIMUM_RECONNECT_DELAY_MS: number;\n\n // FIXME\n static getInstance(client: MinimalClient): ObjectSetListenerWebsocket {\n let instance = ObjectSetListenerWebsocket.#instances.get(\n client.clientCacheKey,\n );\n if (instance == null) {\n instance = new ObjectSetListenerWebsocket(client);\n ObjectSetListenerWebsocket.#instances.set(\n client.clientCacheKey,\n instance,\n );\n }\n return instance;\n }\n\n #ws: WebSocket | undefined;\n #lastWsConnect = 0;\n #client: MinimalClient;\n\n #logger?: Logger;\n\n /**\n * map of requestId to all active subscriptions at the time of the request\n */\n #pendingSubscriptions = new Map<\n string,\n Subscription<any, any>[]\n >();\n\n /**\n * Map of subscriptionId to Subscription. Note: the subscriptionId may be\n * temporary and not the actual subscriptionId from the server.\n */\n #subscriptions = new Map<\n string,\n Subscription<any, any>\n >();\n\n #endedSubscriptions = new Set<\n string\n >();\n\n #maybeDisconnectTimeout: ReturnType<typeof setTimeout> | undefined;\n\n // DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM\n constructor(\n client: MinimalClient,\n {\n minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS,\n } = {},\n ) {\n this.MINIMUM_RECONNECT_DELAY_MS = minimumReconnectDelayMs;\n this.#client = client;\n this.#logger = client.logger?.child({}, {\n msgPrefix: \"<OSW> \",\n });\n invariant(\n client.baseUrl.startsWith(\"https://\")\n || client.baseUrl.startsWith(\"http://\"),\n \"Stack must be a URL\",\n );\n }\n\n async subscribe<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n >(\n objectType: ObjectOrInterfaceDefinition,\n objectSet: ObjectSet,\n listener: ObjectSetSubscription.Listener<Q, P>,\n properties: Array<P> = [],\n ): Promise<() => void> {\n const objOrInterfaceDef = objectType.type === \"object\"\n ? await this.#client.ontologyProvider.getObjectDefinition(\n objectType.apiName,\n )\n : await this.#client.ontologyProvider.getInterfaceDefinition(\n objectType.apiName,\n );\n\n let objectProperties: Array<P> = [];\n let referenceProperties: Array<P> = [];\n\n if (properties.length === 0) {\n properties = Object.keys(objOrInterfaceDef.properties) as Array<P>;\n }\n\n objectProperties = properties.filter((p) =>\n objOrInterfaceDef.properties[p].type !== \"geotimeSeriesReference\"\n );\n\n referenceProperties = properties.filter((p) =>\n objOrInterfaceDef.properties[p].type === \"geotimeSeriesReference\"\n );\n\n const sub: Subscription<Q, P> = {\n listener: fillOutListener<Q, P>(listener),\n objectSet,\n primaryKeyPropertyName: objOrInterfaceDef.type === \"interface\"\n ? undefined\n : objOrInterfaceDef.primaryKeyApiName,\n requestedProperties: objectProperties,\n requestedReferenceProperties: referenceProperties,\n status: \"preparing\",\n // Since we don't have a real subscription id yet but we need to keep\n // track of this reference, we can just use a random uuid.\n subscriptionId: `TMP-${nextUuid()}}`,\n interfaceApiName: objOrInterfaceDef.type === \"object\"\n ? undefined\n : objOrInterfaceDef.apiName,\n };\n\n this.#subscriptions.set(sub.subscriptionId, sub);\n\n // actually prepares the subscription, ensures the ws is ready, and sends\n // a subscribe message. We don't want to block on this.\n void this.#initiateSubscribe(sub);\n\n return () => {\n this.#unsubscribe(sub);\n };\n }\n\n /**\n * Called at least once for every subscription.\n *\n * - Resets pending expiry\n * - Recreates temporary object set\n * - Triggers a full subscribe message\n *\n * @returns\n */\n async #initiateSubscribe(sub: Subscription<any, any>) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#initiateSubscribe()\");\n }\n\n try {\n await this.#ensureWebsocket();\n\n // the consumer may have already unsubscribed before we are ready to request a subscription\n // so we have to acquire the pendingSubscription after the await.\n if (subscriptionIsDone(sub)) {\n return;\n }\n sub.isReady = true;\n // if we aren't open, then this happens after we #onConnect\n if (this.#ws?.readyState === WebSocket.OPEN) {\n this.#sendSubscribeMessage();\n }\n } catch (error) {\n this.#logger?.error(error, \"Error in #initiateSubscribe\");\n this.#tryCatchOnError(sub, true, error);\n }\n }\n\n #sendSubscribeMessage() {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#sendSubscribeMessage()\");\n }\n // If two calls to `.subscribe()` happen at once (or if the connection is reset),\n // we may have multiple subscriptions that don't have a subscriptionId yet,\n // so we filter those out.\n const readySubs = [...this.#subscriptions.values()].filter(isReady);\n\n const id = nextUuid();\n // responses come back as an array of subIds, so we need to know the sources\n this.#pendingSubscriptions.set(id, readySubs);\n\n // every subscribe message \"overwrites\" the previous ones that are not\n // re-included, so we have to reconstitute the entire list of subscriptions\n const subscribe: ObjectSetStreamSubscribeRequests = {\n id,\n requests: readySubs.map<ObjectSetStreamSubscribeRequest>((\n {\n objectSet,\n requestedProperties,\n requestedReferenceProperties,\n interfaceApiName,\n },\n ) => {\n return {\n objectSet: objectSet,\n propertySet: requestedProperties,\n referenceSet: requestedReferenceProperties,\n };\n }),\n };\n\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\n { payload: subscribe },\n \"sending subscribe message\",\n );\n }\n this.#ws?.send(JSON.stringify(subscribe));\n }\n\n #unsubscribe<Q extends ObjectOrInterfaceDefinition>(\n sub: Subscription<Q, any>,\n newStatus: \"done\" | \"error\" = \"done\",\n ) {\n if (subscriptionIsDone(sub)) {\n // if we are already done, we don't need to do anything\n return;\n }\n\n sub.status = newStatus;\n\n // make sure listeners do nothing now\n sub.listener = fillOutListener<Q, any>({});\n\n this.#subscriptions.delete(sub.subscriptionId);\n this.#endedSubscriptions.add(sub.subscriptionId);\n this.#sendSubscribeMessage();\n\n // If we have no more subscriptions, we can disconnect the websocket\n // however we should wait a bit to see if we get any more subscriptions.\n // For example, when switching between react views, you may unsubscribe\n // in the old view and subscribe in the new view. We don't need to re-establish\n // the websocket connection in that case.\n if (this.#maybeDisconnectTimeout) {\n // We reset the timeout on every unsubscribe so its always at least 15s from\n // the last time we are empty. E.g.:\n // - 0s: Subscribe(A)\n // - 10s: Unsubscribe(A)\n // - 11s: Subscribe(B)\n // - 20s: Unsubscribe(B)\n // If we do not clear out the timeout we would disconnect at 25s but that would only be\n // 5s after the last subscription was removed instead of at 35s for the desired 15s.\n clearTimeout(this.#maybeDisconnectTimeout);\n }\n this.#maybeDisconnectTimeout = setTimeout(() => {\n this.#maybeDisconnectTimeout = undefined;\n if (this.#subscriptions.size === 0) {\n this.#cycleWebsocket();\n }\n }, 15_000 /* ms */);\n }\n\n async #ensureWebsocket() {\n if (this.#ws == null) {\n const { baseUrl, tokenProvider } = this.#client;\n const url = constructWebsocketUrl(\n baseUrl,\n await this.#client.ontologyRid,\n );\n\n const token = await tokenProvider();\n\n // tokenProvider is async, there could potentially be a race to create the websocket.\n // Only the first call to reach here will find a null this.#ws, the rest will bail out\n if (this.#ws == null) {\n // TODO this can probably be exponential backoff with jitter\n // don't reconnect more quickly than MINIMUM_RECONNECT_DELAY\n const nextConnectTime = (this.#lastWsConnect ?? 0)\n + this.MINIMUM_RECONNECT_DELAY_MS;\n if (nextConnectTime > Date.now()) {\n await new Promise((resolve) => {\n setTimeout(resolve, nextConnectTime - Date.now());\n });\n }\n\n this.#lastWsConnect = Date.now();\n\n // we again may have lost the race after our minimum backoff time\n if (this.#ws == null) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"Creating websocket\");\n }\n this.#ws = new WebSocket(url, [`Bearer-${token}`]);\n this.#ws.addEventListener(\"close\", this.#onClose);\n this.#ws.addEventListener(\"message\", this.#onMessage);\n this.#ws.addEventListener(\"open\", this.#onOpen);\n }\n }\n // Allow await-ing the websocket open event if it isn't open already.\n // This needs to happen even for callers that didn't just create this.#ws\n if (this.#ws.readyState === WebSocket.CONNECTING) {\n const ws = this.#ws;\n return new Promise<void>((resolve, reject) => {\n function cleanup() {\n ws.removeEventListener(\"open\", open);\n ws.removeEventListener(\"error\", error);\n ws.removeEventListener(\"close\", cleanup);\n }\n function open() {\n cleanup();\n resolve();\n }\n function error(evt: unknown) {\n cleanup();\n reject(evt);\n }\n ws.addEventListener(\"open\", open);\n ws.addEventListener(\"error\", error);\n ws.addEventListener(\"close\", cleanup);\n });\n }\n }\n }\n\n #onOpen = () => {\n // resubscribe all of the listeners\n this.#sendSubscribeMessage();\n };\n\n #onMessage = async (message: WebSocket.MessageEvent) => {\n const data = JSON.parse(message.data.toString()) as StreamMessage;\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ payload: data }, \"received message from ws\");\n }\n switch (data.type) {\n case \"objectSetChanged\":\n return void this.#handleMessage_objectSetChanged(data);\n\n case \"refreshObjectSet\":\n return void this.#handleMessage_refreshObjectSet(data);\n\n case \"subscribeResponses\":\n return void this.#handleMessage_subscribeResponses(data);\n\n case \"subscriptionClosed\": {\n return void this.#handleMessage_subscriptionClosed(data);\n }\n\n default:\n const _: never = data;\n invariant(false, \"Unexpected message type\");\n }\n };\n\n #handleMessage_objectSetChanged = async (\n payload: ObjectSetUpdates,\n ) => {\n const sub = this.#subscriptions.get(payload.id);\n if (sub == null) return;\n\n const objectUpdates = payload.updates.filter((update) =>\n update.type === \"object\"\n );\n const referenceUpdates = payload.updates.filter((update) =>\n update.type === \"reference\"\n );\n const osdkObjectsWithReferenceUpdates = await Promise.all(\n referenceUpdates.map(async (o) => {\n const osdkObjectArray = await this.#client.objectFactory2(\n this.#client,\n [{\n __apiName: o.objectType,\n __primaryKey: sub.primaryKeyPropertyName != null\n ? o.primaryKey[sub.primaryKeyPropertyName]\n : undefined,\n ...o.primaryKey,\n [o.property]: o.value,\n }],\n sub.interfaceApiName,\n false,\n undefined,\n false,\n await this.#fetchInterfaceMapping(\n o.objectType,\n sub.interfaceApiName,\n ),\n ) as Array<Osdk.Instance<any, never, any>>;\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null\n ? {\n object: singleOsdkObject,\n state: \"ADDED_OR_UPDATED\" as ObjectState,\n }\n : undefined;\n }),\n );\n\n for (const osdkObject of osdkObjectsWithReferenceUpdates) {\n if (osdkObject != null) {\n try {\n sub.listener.onChange?.(osdkObject);\n } catch (error) {\n this.#logger?.error(error, \"Error in onChange callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n }\n }\n\n const osdkObjects = await Promise.all(objectUpdates.map(async (o) => {\n const keysToDelete = Object.keys(o.object).filter((key) =>\n sub.requestedReferenceProperties.includes(key)\n );\n for (const key of keysToDelete) {\n delete o.object[key];\n }\n\n const osdkObjectArray = await this.#client.objectFactory2(\n this.#client,\n [o.object],\n sub.interfaceApiName,\n false,\n undefined,\n false,\n await this.#fetchInterfaceMapping(\n o.object.__apiName,\n sub.interfaceApiName,\n ),\n ) as Array<Osdk.Instance<any, never, any>>;\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null\n ? {\n object: singleOsdkObject,\n state: o.state,\n }\n : undefined;\n }));\n\n for (const osdkObject of osdkObjects) {\n if (osdkObject != null) {\n try {\n sub.listener.onChange?.(osdkObject);\n } catch (error) {\n this.#logger?.error(error, \"Error in onChange callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n }\n }\n };\n\n async #fetchInterfaceMapping(\n objectTypeApiName: string,\n interfaceApiName: string | undefined,\n ): Promise<Record<string, Record<string, Record<string, string>>>> {\n if (interfaceApiName == null) return {};\n const interfaceMap = (await this.#client.ontologyProvider\n .getObjectDefinition(objectTypeApiName)).interfaceMap;\n return {\n [interfaceApiName]: {\n [objectTypeApiName]: interfaceMap[interfaceApiName],\n },\n };\n }\n\n #handleMessage_refreshObjectSet = (payload: RefreshObjectSet) => {\n const sub = this.#subscriptions.get(payload.id);\n invariant(sub, `Expected subscription id ${payload.id}`);\n try {\n sub.listener.onOutOfDate();\n } catch (error) {\n this.#logger?.error(error, \"Error in onOutOfDate callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n };\n\n #handleMessage_subscribeResponses = (\n payload: ObjectSetSubscribeResponses,\n ) => {\n const { id, responses } = payload;\n\n const subs = this.#pendingSubscriptions.get(id);\n invariant(subs, `should have a pending subscription for ${id}`);\n this.#pendingSubscriptions.delete(id);\n\n for (let i = 0; i < responses.length; i++) {\n const sub = subs[i];\n const response = responses[i];\n\n switch (response.type) {\n case \"error\":\n this.#tryCatchOnError(sub, true, response.errors);\n this.#unsubscribe(sub, \"error\");\n break;\n\n case \"qos\":\n // the server has requested that we tear down our websocket and reconnect to help load balance\n this.#cycleWebsocket();\n break;\n\n case \"success\":\n // `\"preparing\"` should only be the status on an initial subscribe.\n const shouldFireOutOfDate = sub.status === \"expired\"\n || sub.status === \"reconnecting\";\n\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ shouldFireOutOfDate }, \"success\");\n }\n sub.status = \"subscribed\";\n if (sub.subscriptionId !== response.id) {\n // might be the temporary one\n this.#subscriptions.delete(sub.subscriptionId);\n sub.subscriptionId = response.id;\n this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId\n }\n try {\n if (shouldFireOutOfDate) sub.listener.onOutOfDate();\n else sub.listener.onSuccessfulSubscription();\n } catch (error) {\n this.#logger?.error(\n error,\n \"Error in onOutOfDate or onSuccessfulSubscription callback\",\n );\n this.#tryCatchOnError(sub, false, error);\n }\n break;\n default:\n this.#tryCatchOnError(sub, true, response);\n }\n }\n };\n\n #handleMessage_subscriptionClosed(payload: SubscriptionClosed) {\n const sub = this.#subscriptions.get(payload.id);\n if (sub == null && this.#endedSubscriptions.has(payload.id)) return;\n invariant(sub, `Expected subscription id ${payload.id}`);\n this.#tryCatchOnError(sub, true, payload.cause);\n this.#unsubscribe(sub, \"error\");\n }\n\n #onClose = (event: WebSocket.CloseEvent) => {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ event }, \"Received close event from ws\", event);\n }\n // TODO we should probably throttle this so we don't abuse the backend\n this.#cycleWebsocket();\n };\n\n #cycleWebsocket = () => {\n if (this.#ws) {\n this.#ws.removeEventListener(\"open\", this.#onOpen);\n this.#ws.removeEventListener(\"message\", this.#onMessage);\n this.#ws.removeEventListener(\"close\", this.#onClose);\n\n if (\n this.#ws.readyState !== WebSocket.CLOSING\n && this.#ws.readyState !== WebSocket.CLOSED\n ) {\n this.#ws.close();\n }\n this.#ws = undefined;\n }\n\n // if we have any listeners that are still depending on us, go ahead and reopen the websocket\n if (this.#subscriptions.size > 0) {\n if (process.env.NODE_ENV !== \"production\") {\n for (const s of this.#subscriptions.values()) {\n invariant(\n s.status !== \"done\" && s.status !== \"error\",\n \"should not have done/error subscriptions still\",\n );\n }\n }\n\n for (const s of this.#subscriptions.values()) {\n if (s.status === \"subscribed\") s.status = \"reconnecting\";\n }\n\n // we don't care about the result of this (we want cycleWebsocket to be fire and forget)\n // just that it happens\n void this.#ensureWebsocket();\n }\n };\n\n #tryCatchOnError = (\n sub: Subscription<any, any>,\n subscriptionClosed: boolean,\n error: any,\n ) => {\n try {\n sub.listener.onError({ subscriptionClosed: subscriptionClosed, error });\n } catch (onErrorError) {\n // eslint-disable-next-line no-console\n console.error(\n `Error encountered in an onError callback for an OSDK subscription`,\n onErrorError,\n );\n // eslint-disable-next-line no-console\n console.error(\n `This onError call was triggered by an error in another callback`,\n error,\n );\n // eslint-disable-next-line no-console\n console.error(\n `The subscription has been closed.`,\n error,\n );\n\n if (!subscriptionClosed) {\n this.#logger?.error(error, \"Error in onError callback\");\n this.#unsubscribe(sub, \"error\");\n this.#tryCatchOnError(sub, true, onErrorError);\n }\n }\n };\n}\n\n/** @internal */\nexport function constructWebsocketUrl(\n baseUrl: string,\n ontologyRid: string,\n) {\n const base = new URL(baseUrl);\n const url = new URL(\n `api/v2/ontologySubscriptions/ontologies/${ontologyRid}/streamSubscriptions`,\n base,\n );\n url.protocol = url.protocol.replace(\"https\", \"wss\");\n return url;\n}\n\nlet uuidCounter = 0;\n\nfunction nextUuid() {\n return `00000000-0000-0000-0000-${\n (uuidCounter++).toString().padStart(12, \"0\")\n }`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA,OAAOA,SAAS,MAAM,eAAe;AACrC,OAAOC,SAAS,MAAM,gBAAgB;AAItC,MAAMC,0BAA0B,GAAG,CAAC,GAAG,IAAI;;AAE3C;AACA,SAASC,SAASA,CAAA,EAAG,CAAC;;AAEtB;AACA;AACA;AACA,SAASC,eAAeA,CAItB;EACEC,QAAQ,GAAGF,SAAS;EACpBG,OAAO,GAAGH,SAAS;EACnBI,WAAW,GAAGJ,SAAS;EACvBK,wBAAwB,GAAGL;AACS,CAAC,EACS;EAChD,OAAO;IAAEE,QAAQ;IAAEC,OAAO;IAAEC,WAAW;IAAEC;EAAyB,CAAC;AACrE;AAyBA,SAASC,OAAOA,CAIdC,GAAuB,EACuC;EAC9D,OAAOA,GAAG,CAACD,OAAO,IAAI,IAAI;AAC5B;AAEA,SAASE,kBAAkBA,CAACD,GAA2B,EAAE;EACvD,OAAOA,GAAG,CAACE,MAAM,KAAK,MAAM,IAAIF,GAAG,CAACE,MAAM,KAAK,OAAO;AACxD;;AAEA;AACA,OAAO,MAAMC,0BAA0B,CAAC;EACtC,OAAO,CAACC,SAAS,GAAG,IAAIC,OAAO,CAG7B,CAAC;EAGH;EACA,OAAOC,WAAWA,CAACC,MAAqB,EAA8B;IACpE,IAAIC,QAAQ,GAAGL,0BAA0B,CAAC,CAACC,SAAS,CAACK,GAAG,CACtDF,MAAM,CAACG,cACT,CAAC;IACD,IAAIF,QAAQ,IAAI,IAAI,EAAE;MACpBA,QAAQ,GAAG,IAAIL,0BAA0B,CAACI,MAAM,CAAC;MACjDJ,0BAA0B,CAAC,C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