@osdk/client 2.0.0-beta.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (605) hide show
  1. package/CHANGELOG.md +284 -0
  2. package/build/browser/Client.d.ts +39 -0
  3. package/build/browser/Client.d.ts.map +1 -0
  4. package/build/browser/Client.js +20 -0
  5. package/build/browser/Client.js.map +1 -0
  6. package/build/browser/Definitions.test.d.ts +2 -0
  7. package/build/browser/Definitions.test.d.ts.map +1 -0
  8. package/build/browser/Definitions.test.js +35 -0
  9. package/build/browser/Definitions.test.js.map +1 -0
  10. package/build/browser/Logger.d.ts +19 -0
  11. package/build/browser/Logger.d.ts.map +1 -0
  12. package/build/browser/Logger.js +17 -0
  13. package/build/browser/Logger.js.map +1 -0
  14. package/build/browser/MinimalClientContext.d.ts +26 -0
  15. package/build/browser/MinimalClientContext.d.ts.map +1 -0
  16. package/build/browser/MinimalClientContext.js +17 -0
  17. package/build/browser/MinimalClientContext.js.map +1 -0
  18. package/build/browser/ResultOrError.d.ts +12 -0
  19. package/build/browser/ResultOrError.d.ts.map +1 -0
  20. package/build/browser/ResultOrError.js +19 -0
  21. package/build/browser/ResultOrError.js.map +1 -0
  22. package/build/browser/SatisfiesSemver.d.ts +4 -0
  23. package/build/browser/SatisfiesSemver.d.ts.map +1 -0
  24. package/build/browser/SatisfiesSemver.js +17 -0
  25. package/build/browser/SatisfiesSemver.js.map +1 -0
  26. package/build/browser/SatisfiesSemver.test.d.ts +2 -0
  27. package/build/browser/SatisfiesSemver.test.d.ts.map +1 -0
  28. package/build/browser/SatisfiesSemver.test.js +69 -0
  29. package/build/browser/SatisfiesSemver.test.js.map +1 -0
  30. package/build/browser/__unstable/ConjureSupport.d.ts +55 -0
  31. package/build/browser/__unstable/ConjureSupport.d.ts.map +1 -0
  32. package/build/browser/__unstable/ConjureSupport.js +174 -0
  33. package/build/browser/__unstable/ConjureSupport.js.map +1 -0
  34. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts +10 -0
  35. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -0
  36. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js +114 -0
  37. package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -0
  38. package/build/browser/actions/ActionValidationError.d.ts +6 -0
  39. package/build/browser/actions/ActionValidationError.d.ts.map +1 -0
  40. package/build/browser/actions/ActionValidationError.js +23 -0
  41. package/build/browser/actions/ActionValidationError.js.map +1 -0
  42. package/build/browser/actions/actions.test.d.ts +2 -0
  43. package/build/browser/actions/actions.test.d.ts.map +1 -0
  44. package/build/browser/actions/actions.test.js +323 -0
  45. package/build/browser/actions/actions.test.js.map +1 -0
  46. package/build/browser/actions/applyAction.d.ts +30 -0
  47. package/build/browser/actions/applyAction.d.ts.map +1 -0
  48. package/build/browser/actions/applyAction.js +114 -0
  49. package/build/browser/actions/applyAction.js.map +1 -0
  50. package/build/browser/createAttachmentFromRid.d.ts +10 -0
  51. package/build/browser/createAttachmentFromRid.d.ts.map +1 -0
  52. package/build/browser/createAttachmentFromRid.js +38 -0
  53. package/build/browser/createAttachmentFromRid.js.map +1 -0
  54. package/build/browser/createClient.d.ts +6 -0
  55. package/build/browser/createClient.d.ts.map +1 -0
  56. package/build/browser/createClient.js +88 -0
  57. package/build/browser/createClient.js.map +1 -0
  58. package/build/browser/createClient.test.d.ts +2 -0
  59. package/build/browser/createClient.test.d.ts.map +1 -0
  60. package/build/browser/createClient.test.js +45 -0
  61. package/build/browser/createClient.test.js.map +1 -0
  62. package/build/browser/createMinimalClient.d.ts +2 -0
  63. package/build/browser/createMinimalClient.d.ts.map +1 -0
  64. package/build/browser/createMinimalClient.js +42 -0
  65. package/build/browser/createMinimalClient.js.map +1 -0
  66. package/build/browser/createPlatformClient.d.ts +17 -0
  67. package/build/browser/createPlatformClient.d.ts.map +1 -0
  68. package/build/browser/createPlatformClient.js +33 -0
  69. package/build/browser/createPlatformClient.js.map +1 -0
  70. package/build/browser/createTimeseriesProperty.d.ts +14 -0
  71. package/build/browser/createTimeseriesProperty.d.ts.map +1 -0
  72. package/build/browser/createTimeseriesProperty.js +79 -0
  73. package/build/browser/createTimeseriesProperty.js.map +1 -0
  74. package/build/browser/definitions/LinkDefinitions.test.d.ts +2 -0
  75. package/build/browser/definitions/LinkDefinitions.test.d.ts.map +1 -0
  76. package/build/browser/definitions/LinkDefinitions.test.js +41 -0
  77. package/build/browser/definitions/LinkDefinitions.test.js.map +1 -0
  78. package/build/browser/fetchMetadata.d.ts +2 -0
  79. package/build/browser/fetchMetadata.d.ts.map +1 -0
  80. package/build/browser/fetchMetadata.js +35 -0
  81. package/build/browser/fetchMetadata.js.map +1 -0
  82. package/build/browser/fetchMetadata.test.d.ts +2 -0
  83. package/build/browser/fetchMetadata.test.d.ts.map +1 -0
  84. package/build/browser/fetchMetadata.test.js +218 -0
  85. package/build/browser/fetchMetadata.test.js.map +1 -0
  86. package/build/browser/index.d.ts +13 -0
  87. package/build/browser/index.d.ts.map +1 -0
  88. package/build/browser/index.js +22 -12
  89. package/build/browser/index.js.map +1 -1
  90. package/build/browser/intellisense.test.d.ts +2 -0
  91. package/build/browser/intellisense.test.d.ts.map +1 -0
  92. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +2 -0
  93. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +1 -0
  94. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js +25 -0
  95. package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -0
  96. package/build/browser/intellisense.test.js +86 -0
  97. package/build/browser/intellisense.test.js.map +1 -0
  98. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts +2 -0
  99. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +1 -0
  100. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js +34 -0
  101. package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -0
  102. package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts +2 -0
  103. package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts.map +1 -0
  104. package/build/browser/internal/conversions/modernToLegacyAggregationClause.js +38 -0
  105. package/build/browser/internal/conversions/modernToLegacyAggregationClause.js.map +1 -0
  106. package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts +2 -0
  107. package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts.map +1 -0
  108. package/build/browser/internal/conversions/modernToLegacyGroupByClause.js +62 -0
  109. package/build/browser/internal/conversions/modernToLegacyGroupByClause.js.map +1 -0
  110. package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts +2 -0
  111. package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts.map +1 -0
  112. package/build/browser/internal/conversions/modernToLegacyWhereClause.js +144 -0
  113. package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -0
  114. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts +2 -0
  115. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +1 -0
  116. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +486 -0
  117. package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -0
  118. package/build/browser/object/AttachmentUpload.d.ts +4 -0
  119. package/build/browser/object/AttachmentUpload.d.ts.map +1 -0
  120. package/build/browser/object/AttachmentUpload.js +27 -0
  121. package/build/browser/object/AttachmentUpload.js.map +1 -0
  122. package/build/browser/object/Cache.d.ts +2 -0
  123. package/build/browser/object/Cache.d.ts.map +1 -0
  124. package/build/browser/object/Cache.js +76 -0
  125. package/build/browser/object/Cache.js.map +1 -0
  126. package/build/browser/object/Cache.test.d.ts +11 -0
  127. package/build/browser/object/Cache.test.d.ts.map +1 -0
  128. package/build/browser/object/Cache.test.js +283 -0
  129. package/build/browser/object/Cache.test.js.map +1 -0
  130. package/build/browser/object/SimpleCache.d.ts +38 -0
  131. package/build/browser/object/SimpleCache.d.ts.map +1 -0
  132. package/build/browser/object/SimpleCache.js +67 -0
  133. package/build/browser/object/SimpleCache.js.map +1 -0
  134. package/build/browser/object/aggregate.d.ts +2 -0
  135. package/build/browser/object/aggregate.d.ts.map +1 -0
  136. package/build/browser/object/aggregate.js +69 -0
  137. package/build/browser/object/aggregate.js.map +1 -0
  138. package/build/browser/object/aggregate.test.d.ts +2 -0
  139. package/build/browser/object/aggregate.test.d.ts.map +1 -0
  140. package/build/browser/object/aggregate.test.js +398 -0
  141. package/build/browser/object/aggregate.test.js.map +1 -0
  142. package/build/browser/object/attachment.test.d.ts +2 -0
  143. package/build/browser/object/attachment.test.d.ts.map +1 -0
  144. package/build/browser/object/attachment.test.js +55 -0
  145. package/build/browser/object/attachment.test.js.map +1 -0
  146. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +11 -0
  147. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -0
  148. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js +17 -0
  149. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -0
  150. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts +13 -0
  151. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -0
  152. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js +22 -0
  153. package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -0
  154. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts +2 -0
  155. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +1 -0
  156. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js +17 -0
  157. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -0
  158. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +2 -0
  159. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -0
  160. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +48 -0
  161. package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -0
  162. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +8 -0
  163. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +1 -0
  164. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +17 -0
  165. package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -0
  166. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +2 -0
  167. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +1 -0
  168. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +82 -0
  169. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -0
  170. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts +2 -0
  171. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +1 -0
  172. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +114 -0
  173. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -0
  174. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts +3 -0
  175. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -0
  176. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +55 -0
  177. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -0
  178. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts +2 -0
  179. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +1 -0
  180. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +60 -0
  181. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -0
  182. package/build/browser/object/convertWireToOsdkObjects.d.ts +2 -0
  183. package/build/browser/object/convertWireToOsdkObjects.d.ts.map +1 -0
  184. package/build/browser/object/convertWireToOsdkObjects.js +150 -0
  185. package/build/browser/object/convertWireToOsdkObjects.js.map +1 -0
  186. package/build/browser/object/convertWireToOsdkObjects.test.d.ts +2 -0
  187. package/build/browser/object/convertWireToOsdkObjects.test.d.ts.map +1 -0
  188. package/build/browser/object/convertWireToOsdkObjects.test.js +254 -0
  189. package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -0
  190. package/build/browser/object/fetchPage.d.ts +3 -0
  191. package/build/browser/object/fetchPage.d.ts.map +1 -0
  192. package/build/browser/object/fetchPage.js +135 -0
  193. package/build/browser/object/fetchPage.js.map +1 -0
  194. package/build/browser/object/fetchPage.test.d.ts +2 -0
  195. package/build/browser/object/fetchPage.test.d.ts.map +1 -0
  196. package/build/browser/object/fetchPage.test.js +106 -0
  197. package/build/browser/object/fetchPage.test.js.map +1 -0
  198. package/build/browser/object/fetchSingle.d.ts +2 -0
  199. package/build/browser/object/fetchSingle.d.ts.map +1 -0
  200. package/build/browser/object/fetchSingle.js +47 -0
  201. package/build/browser/object/fetchSingle.js.map +1 -0
  202. package/build/browser/object/object.test.d.ts +12 -0
  203. package/build/browser/object/object.test.d.ts.map +1 -0
  204. package/build/browser/object/object.test.js +179 -0
  205. package/build/browser/object/object.test.js.map +1 -0
  206. package/build/browser/object/timeseries.test.d.ts +2 -0
  207. package/build/browser/object/timeseries.test.d.ts.map +1 -0
  208. package/build/browser/object/timeseries.test.js +163 -0
  209. package/build/browser/object/timeseries.test.js.map +1 -0
  210. package/build/browser/objectSet/ObjectSet.test.d.ts +2 -0
  211. package/build/browser/objectSet/ObjectSet.test.d.ts.map +1 -0
  212. package/build/browser/objectSet/ObjectSet.test.js +313 -0
  213. package/build/browser/objectSet/ObjectSet.test.js.map +1 -0
  214. package/build/browser/objectSet/ObjectSetFactory.d.ts +2 -0
  215. package/build/browser/objectSet/ObjectSetFactory.d.ts.map +1 -0
  216. package/build/browser/objectSet/ObjectSetFactory.js +17 -0
  217. package/build/browser/objectSet/ObjectSetFactory.js.map +1 -0
  218. package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts +7 -0
  219. package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -0
  220. package/build/browser/objectSet/ObjectSetListenerWebsocket.js +533 -0
  221. package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -0
  222. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts +2 -0
  223. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +1 -0
  224. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +338 -0
  225. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -0
  226. package/build/browser/objectSet/conjureUnionType.d.ts +13 -0
  227. package/build/browser/objectSet/conjureUnionType.d.ts.map +1 -0
  228. package/build/browser/objectSet/conjureUnionType.js +27 -0
  229. package/build/browser/objectSet/conjureUnionType.js.map +1 -0
  230. package/build/browser/objectSet/createObjectSet.d.ts +2 -0
  231. package/build/browser/objectSet/createObjectSet.d.ts.map +1 -0
  232. package/build/browser/objectSet/createObjectSet.js +136 -0
  233. package/build/browser/objectSet/createObjectSet.js.map +1 -0
  234. package/build/browser/objectSet/toConjureObjectSet.d.ts +2 -0
  235. package/build/browser/objectSet/toConjureObjectSet.d.ts.map +1 -0
  236. package/build/browser/objectSet/toConjureObjectSet.js +158 -0
  237. package/build/browser/objectSet/toConjureObjectSet.js.map +1 -0
  238. package/build/browser/ontology/OntologyProvider.d.ts +32 -0
  239. package/build/browser/ontology/OntologyProvider.d.ts.map +1 -0
  240. package/build/browser/ontology/OntologyProvider.js +17 -0
  241. package/build/browser/ontology/OntologyProvider.js.map +1 -0
  242. package/build/browser/ontology/StandardOntologyProvider.d.ts +5 -0
  243. package/build/browser/ontology/StandardOntologyProvider.d.ts.map +1 -0
  244. package/build/browser/ontology/StandardOntologyProvider.js +59 -0
  245. package/build/browser/ontology/StandardOntologyProvider.js.map +1 -0
  246. package/build/browser/ontology/StandardOntologyProvider.test.d.ts +2 -0
  247. package/build/browser/ontology/StandardOntologyProvider.test.d.ts.map +1 -0
  248. package/build/browser/ontology/StandardOntologyProvider.test.js +48 -0
  249. package/build/browser/ontology/StandardOntologyProvider.test.js.map +1 -0
  250. package/build/browser/ontology/loadActionMetadata.d.ts +4 -0
  251. package/build/browser/ontology/loadActionMetadata.d.ts.map +1 -0
  252. package/build/browser/ontology/loadActionMetadata.js +22 -0
  253. package/build/browser/ontology/loadActionMetadata.js.map +1 -0
  254. package/build/browser/ontology/loadFullObjectMetadata.d.ts +6 -0
  255. package/build/browser/ontology/loadFullObjectMetadata.d.ts.map +1 -0
  256. package/build/browser/ontology/loadFullObjectMetadata.js +28 -0
  257. package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -0
  258. package/build/browser/ontology/loadInterfaceMetadata.d.ts +4 -0
  259. package/build/browser/ontology/loadInterfaceMetadata.d.ts.map +1 -0
  260. package/build/browser/ontology/loadInterfaceMetadata.js +24 -0
  261. package/build/browser/ontology/loadInterfaceMetadata.js.map +1 -0
  262. package/build/browser/ontology/loadQueryMetadata.d.ts +4 -0
  263. package/build/browser/ontology/loadQueryMetadata.d.ts.map +1 -0
  264. package/build/browser/ontology/loadQueryMetadata.js +22 -0
  265. package/build/browser/ontology/loadQueryMetadata.js.map +1 -0
  266. package/build/browser/ontology/makeConjureContext.d.ts +4 -0
  267. package/build/browser/ontology/makeConjureContext.d.ts.map +1 -0
  268. package/build/browser/ontology/makeConjureContext.js +28 -0
  269. package/build/browser/ontology/makeConjureContext.js.map +1 -0
  270. package/build/browser/pageRequestAsAsyncIter.d.ts +10 -0
  271. package/build/browser/pageRequestAsAsyncIter.d.ts.map +1 -0
  272. package/build/browser/pageRequestAsAsyncIter.js +37 -0
  273. package/build/browser/pageRequestAsAsyncIter.js.map +1 -0
  274. package/build/browser/public/unstable-do-not-use.d.ts +2 -0
  275. package/build/browser/public/unstable-do-not-use.d.ts.map +1 -0
  276. package/build/browser/public/unstable-do-not-use.js +16 -878
  277. package/build/browser/public/unstable-do-not-use.js.map +1 -1
  278. package/build/browser/queries/applyQuery.d.ts +6 -0
  279. package/build/browser/queries/applyQuery.d.ts.map +1 -0
  280. package/build/browser/queries/applyQuery.js +234 -0
  281. package/build/browser/queries/applyQuery.js.map +1 -0
  282. package/build/browser/queries/queries.test.d.ts +2 -0
  283. package/build/browser/queries/queries.test.d.ts.map +1 -0
  284. package/build/browser/queries/queries.test.js +171 -0
  285. package/build/browser/queries/queries.test.js.map +1 -0
  286. package/build/browser/queries/types.d.ts +20 -0
  287. package/build/browser/queries/types.d.ts.map +1 -0
  288. package/build/browser/queries/types.js +17 -0
  289. package/build/browser/queries/types.js.map +1 -0
  290. package/build/browser/tsserver.d.ts +34 -0
  291. package/build/browser/tsserver.d.ts.map +1 -0
  292. package/build/browser/tsserver.js +133 -0
  293. package/build/browser/tsserver.js.map +1 -0
  294. package/build/browser/util/ArrayElement.d.ts +2 -0
  295. package/build/browser/util/ArrayElement.d.ts.map +1 -0
  296. package/build/browser/util/ArrayElement.js +17 -0
  297. package/build/browser/util/ArrayElement.js.map +1 -0
  298. package/build/browser/util/NOOP.d.ts +4 -0
  299. package/build/browser/util/NOOP.d.ts.map +1 -0
  300. package/build/browser/util/NOOP.js +17 -0
  301. package/build/browser/util/NOOP.js.map +1 -0
  302. package/build/browser/util/NullableProps.d.ts +6 -0
  303. package/build/browser/util/NullableProps.d.ts.map +1 -0
  304. package/build/browser/util/NullableProps.js +17 -0
  305. package/build/browser/util/NullableProps.js.map +1 -0
  306. package/build/browser/util/UserAgent.d.ts +2 -0
  307. package/build/browser/util/UserAgent.d.ts.map +1 -0
  308. package/build/browser/util/UserAgent.js +17 -0
  309. package/build/browser/util/UserAgent.js.map +1 -0
  310. package/build/browser/util/WireObjectSet.d.ts +2 -0
  311. package/build/browser/util/WireObjectSet.d.ts.map +1 -0
  312. package/build/browser/util/WireObjectSet.js +21 -0
  313. package/build/browser/util/WireObjectSet.js.map +1 -0
  314. package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts +4 -0
  315. package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts.map +1 -0
  316. package/build/browser/util/addUserAgentAndRequestContextHeaders.js +27 -0
  317. package/build/browser/util/addUserAgentAndRequestContextHeaders.js.map +1 -0
  318. package/build/browser/util/augmentRequestContext.d.ts +32 -0
  319. package/build/browser/util/augmentRequestContext.d.ts.map +1 -0
  320. package/build/browser/util/augmentRequestContext.js +52 -0
  321. package/build/browser/util/augmentRequestContext.js.map +1 -0
  322. package/build/browser/util/isOntologyObjectV2.d.ts +2 -0
  323. package/build/browser/util/isOntologyObjectV2.d.ts.map +1 -0
  324. package/build/browser/util/isOntologyObjectV2.js +20 -0
  325. package/build/browser/util/isOntologyObjectV2.js.map +1 -0
  326. package/build/browser/util/isOsdkBaseObject.d.ts +3 -0
  327. package/build/browser/util/isOsdkBaseObject.d.ts.map +1 -0
  328. package/build/browser/util/isOsdkBaseObject.js +19 -0
  329. package/build/browser/util/isOsdkBaseObject.js.map +1 -0
  330. package/build/browser/util/isOsdkObject.d.ts +3 -0
  331. package/build/browser/util/isOsdkObject.d.ts.map +1 -0
  332. package/build/browser/util/isOsdkObject.js +19 -0
  333. package/build/browser/util/isOsdkObject.js.map +1 -0
  334. package/build/browser/util/partialBy.d.ts +3 -0
  335. package/build/browser/util/partialBy.d.ts.map +1 -0
  336. package/build/browser/util/partialBy.js +17 -0
  337. package/build/browser/util/partialBy.js.map +1 -0
  338. package/build/browser/util/streamutils.d.ts +3 -0
  339. package/build/browser/util/streamutils.d.ts.map +1 -0
  340. package/build/browser/util/streamutils.js +95 -0
  341. package/build/browser/util/streamutils.js.map +1 -0
  342. package/build/browser/util/toDataValue.d.ts +2 -0
  343. package/build/browser/util/toDataValue.d.ts.map +1 -0
  344. package/build/browser/util/toDataValue.js +73 -0
  345. package/build/browser/util/toDataValue.js.map +1 -0
  346. package/build/browser/util/toDataValue.test.d.ts +2 -0
  347. package/build/browser/util/toDataValue.test.d.ts.map +1 -0
  348. package/build/browser/util/toDataValue.test.js +117 -0
  349. package/build/browser/util/toDataValue.test.js.map +1 -0
  350. package/build/browser/util/toDataValueQueries.d.ts +2 -0
  351. package/build/browser/util/toDataValueQueries.d.ts.map +1 -0
  352. package/build/browser/util/toDataValueQueries.js +107 -0
  353. package/build/browser/util/toDataValueQueries.js.map +1 -0
  354. package/build/esm/Client.d.ts +24 -4
  355. package/build/esm/Client.d.ts.map +1 -1
  356. package/build/esm/Client.js +20 -0
  357. package/build/esm/Client.js.map +1 -0
  358. package/build/esm/Definitions.test.js +35 -0
  359. package/build/esm/Definitions.test.js.map +1 -0
  360. package/build/esm/Logger.d.ts +19 -0
  361. package/build/esm/Logger.d.ts.map +1 -0
  362. package/build/esm/Logger.js +17 -0
  363. package/build/esm/Logger.js.map +1 -0
  364. package/build/esm/MinimalClientContext.d.ts +1 -1
  365. package/build/esm/MinimalClientContext.d.ts.map +1 -1
  366. package/build/esm/MinimalClientContext.js +17 -0
  367. package/build/esm/MinimalClientContext.js.map +1 -0
  368. package/build/esm/ResultOrError.js +19 -0
  369. package/build/esm/ResultOrError.js.map +1 -0
  370. package/build/esm/SatisfiesSemver.js +17 -0
  371. package/build/esm/SatisfiesSemver.js.map +1 -0
  372. package/build/esm/SatisfiesSemver.test.js +69 -0
  373. package/build/esm/SatisfiesSemver.test.js.map +1 -0
  374. package/build/esm/__unstable/ConjureSupport.js +174 -0
  375. package/build/esm/__unstable/ConjureSupport.js.map +1 -0
  376. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts +1 -1
  377. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -1
  378. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js +114 -0
  379. package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -0
  380. package/build/esm/actions/ActionValidationError.d.ts +1 -1
  381. package/build/esm/actions/ActionValidationError.d.ts.map +1 -1
  382. package/build/esm/actions/ActionValidationError.js +23 -0
  383. package/build/esm/actions/ActionValidationError.js.map +1 -0
  384. package/build/esm/actions/actions.test.js +323 -0
  385. package/build/esm/actions/actions.test.js.map +1 -0
  386. package/build/esm/actions/applyAction.d.ts +17 -11
  387. package/build/esm/actions/applyAction.d.ts.map +1 -1
  388. package/build/esm/actions/applyAction.js +114 -0
  389. package/build/esm/actions/applyAction.js.map +1 -0
  390. package/build/esm/createAttachmentFromRid.d.ts +1 -1
  391. package/build/esm/createAttachmentFromRid.d.ts.map +1 -1
  392. package/build/esm/createAttachmentFromRid.js +38 -0
  393. package/build/esm/createAttachmentFromRid.js.map +1 -0
  394. package/build/esm/createClient.d.ts +1 -1
  395. package/build/esm/createClient.d.ts.map +1 -1
  396. package/build/esm/createClient.js +88 -0
  397. package/build/esm/createClient.js.map +1 -0
  398. package/build/esm/createClient.test.js +45 -0
  399. package/build/esm/createClient.test.js.map +1 -0
  400. package/build/esm/createMinimalClient.js +42 -0
  401. package/build/esm/createMinimalClient.js.map +1 -0
  402. package/build/esm/createPlatformClient.js +33 -0
  403. package/build/esm/createPlatformClient.js.map +1 -0
  404. package/build/esm/createTimeseriesProperty.d.ts +12 -2
  405. package/build/esm/createTimeseriesProperty.d.ts.map +1 -1
  406. package/build/esm/createTimeseriesProperty.js +79 -0
  407. package/build/esm/createTimeseriesProperty.js.map +1 -0
  408. package/build/esm/definitions/LinkDefinitions.test.js +41 -0
  409. package/build/esm/definitions/LinkDefinitions.test.js.map +1 -0
  410. package/build/esm/fetchMetadata.d.ts +2 -0
  411. package/build/esm/fetchMetadata.d.ts.map +1 -0
  412. package/build/esm/fetchMetadata.js +35 -0
  413. package/build/esm/fetchMetadata.js.map +1 -0
  414. package/build/esm/fetchMetadata.test.d.ts +2 -0
  415. package/build/esm/fetchMetadata.test.d.ts.map +1 -0
  416. package/build/esm/fetchMetadata.test.js +218 -0
  417. package/build/esm/fetchMetadata.test.js.map +1 -0
  418. package/build/esm/index.d.ts +3 -2
  419. package/build/esm/index.d.ts.map +1 -1
  420. package/build/esm/index.js +22 -12
  421. package/build/esm/index.js.map +1 -1
  422. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js +25 -0
  423. package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -0
  424. package/build/esm/intellisense.test.js +86 -0
  425. package/build/esm/intellisense.test.js.map +1 -0
  426. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js +34 -0
  427. package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -0
  428. package/build/esm/internal/conversions/modernToLegacyAggregationClause.js +38 -0
  429. package/build/esm/internal/conversions/modernToLegacyAggregationClause.js.map +1 -0
  430. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +62 -0
  431. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -0
  432. package/build/esm/internal/conversions/modernToLegacyWhereClause.js +144 -0
  433. package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -0
  434. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +486 -0
  435. package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -0
  436. package/build/esm/object/AttachmentUpload.d.ts +1 -1
  437. package/build/esm/object/AttachmentUpload.d.ts.map +1 -1
  438. package/build/esm/object/AttachmentUpload.js +27 -0
  439. package/build/esm/object/AttachmentUpload.js.map +1 -0
  440. package/build/esm/object/Cache.js +76 -0
  441. package/build/esm/object/Cache.js.map +1 -0
  442. package/build/esm/object/Cache.test.js +283 -0
  443. package/build/esm/object/Cache.test.js.map +1 -0
  444. package/build/esm/object/SimpleCache.js +67 -0
  445. package/build/esm/object/SimpleCache.js.map +1 -0
  446. package/build/esm/object/aggregate.js +69 -0
  447. package/build/esm/object/aggregate.js.map +1 -0
  448. package/build/esm/object/aggregate.test.js +398 -0
  449. package/build/esm/object/aggregate.test.js.map +1 -0
  450. package/build/esm/object/attachment.test.js +55 -0
  451. package/build/esm/object/attachment.test.js.map +1 -0
  452. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +4 -5
  453. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -1
  454. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js +17 -0
  455. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -0
  456. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts +2 -3
  457. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -1
  458. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js +22 -0
  459. package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -0
  460. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js +17 -0
  461. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -0
  462. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -1
  463. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +48 -0
  464. package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -0
  465. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +17 -0
  466. package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -0
  467. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +82 -0
  468. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -0
  469. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +114 -0
  470. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -0
  471. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts +1 -1
  472. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -1
  473. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +55 -0
  474. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -0
  475. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +60 -0
  476. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -0
  477. package/build/esm/object/convertWireToOsdkObjects.js +150 -0
  478. package/build/esm/object/convertWireToOsdkObjects.js.map +1 -0
  479. package/build/esm/object/convertWireToOsdkObjects.test.js +254 -0
  480. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -0
  481. package/build/esm/object/fetchPage.d.ts +2 -3
  482. package/build/esm/object/fetchPage.d.ts.map +1 -1
  483. package/build/esm/object/fetchPage.js +135 -0
  484. package/build/esm/object/fetchPage.js.map +1 -0
  485. package/build/esm/object/fetchPage.test.js +106 -0
  486. package/build/esm/object/fetchPage.test.js.map +1 -0
  487. package/build/esm/object/fetchSingle.js +47 -0
  488. package/build/esm/object/fetchSingle.js.map +1 -0
  489. package/build/esm/object/object.test.d.ts +4 -5
  490. package/build/esm/object/object.test.d.ts.map +1 -1
  491. package/build/esm/object/object.test.js +179 -0
  492. package/build/esm/object/object.test.js.map +1 -0
  493. package/build/esm/object/timeseries.test.js +163 -0
  494. package/build/esm/object/timeseries.test.js.map +1 -0
  495. package/build/esm/objectSet/ObjectSet.test.js +313 -0
  496. package/build/esm/objectSet/ObjectSet.test.js.map +1 -0
  497. package/build/esm/objectSet/ObjectSetFactory.js +17 -0
  498. package/build/esm/objectSet/ObjectSetFactory.js.map +1 -0
  499. package/build/esm/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -1
  500. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +536 -0
  501. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -0
  502. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +338 -0
  503. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -0
  504. package/build/esm/objectSet/conjureUnionType.js +27 -0
  505. package/build/esm/objectSet/conjureUnionType.js.map +1 -0
  506. package/build/esm/objectSet/createObjectSet.js +136 -0
  507. package/build/esm/objectSet/createObjectSet.js.map +1 -0
  508. package/build/esm/objectSet/toConjureObjectSet.js +158 -0
  509. package/build/esm/objectSet/toConjureObjectSet.js.map +1 -0
  510. package/build/esm/ontology/OntologyProvider.d.ts +7 -13
  511. package/build/esm/ontology/OntologyProvider.d.ts.map +1 -1
  512. package/build/esm/ontology/OntologyProvider.js +17 -0
  513. package/build/esm/ontology/OntologyProvider.js.map +1 -0
  514. package/build/esm/ontology/StandardOntologyProvider.d.ts.map +1 -1
  515. package/build/esm/ontology/StandardOntologyProvider.js +59 -0
  516. package/build/esm/ontology/StandardOntologyProvider.js.map +1 -0
  517. package/build/esm/ontology/StandardOntologyProvider.test.js +48 -0
  518. package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -0
  519. package/build/esm/ontology/loadActionMetadata.d.ts +4 -0
  520. package/build/esm/ontology/loadActionMetadata.d.ts.map +1 -0
  521. package/build/esm/ontology/loadActionMetadata.js +22 -0
  522. package/build/esm/ontology/loadActionMetadata.js.map +1 -0
  523. package/build/esm/ontology/loadFullObjectMetadata.d.ts +2 -2
  524. package/build/esm/ontology/loadFullObjectMetadata.d.ts.map +1 -1
  525. package/build/esm/ontology/loadFullObjectMetadata.js +28 -0
  526. package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -0
  527. package/build/esm/ontology/loadInterfaceMetadata.d.ts +4 -0
  528. package/build/esm/ontology/loadInterfaceMetadata.d.ts.map +1 -0
  529. package/build/esm/ontology/loadInterfaceMetadata.js +24 -0
  530. package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -0
  531. package/build/esm/ontology/loadQueryMetadata.d.ts +4 -0
  532. package/build/esm/ontology/loadQueryMetadata.d.ts.map +1 -0
  533. package/build/esm/ontology/loadQueryMetadata.js +22 -0
  534. package/build/esm/ontology/loadQueryMetadata.js.map +1 -0
  535. package/build/esm/ontology/makeConjureContext.js +28 -0
  536. package/build/esm/ontology/makeConjureContext.js.map +1 -0
  537. package/build/esm/pageRequestAsAsyncIter.js +37 -0
  538. package/build/esm/pageRequestAsAsyncIter.js.map +1 -0
  539. package/build/esm/public/unstable-do-not-use.d.ts +0 -4
  540. package/build/esm/public/unstable-do-not-use.d.ts.map +1 -1
  541. package/build/esm/public/unstable-do-not-use.js +16 -881
  542. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  543. package/build/esm/queries/applyQuery.d.ts +3 -4
  544. package/build/esm/queries/applyQuery.d.ts.map +1 -1
  545. package/build/esm/queries/applyQuery.js +234 -0
  546. package/build/esm/queries/applyQuery.js.map +1 -0
  547. package/build/esm/queries/queries.test.js +171 -0
  548. package/build/esm/queries/queries.test.js.map +1 -0
  549. package/build/esm/queries/types.d.ts +10 -11
  550. package/build/esm/queries/types.d.ts.map +1 -1
  551. package/build/esm/queries/types.js +17 -0
  552. package/build/esm/queries/types.js.map +1 -0
  553. package/build/esm/tsserver.d.ts +1 -1
  554. package/build/esm/tsserver.d.ts.map +1 -1
  555. package/build/esm/tsserver.js +133 -0
  556. package/build/esm/tsserver.js.map +1 -0
  557. package/build/esm/util/ArrayElement.js +17 -0
  558. package/build/esm/util/ArrayElement.js.map +1 -0
  559. package/build/esm/util/NOOP.js +17 -0
  560. package/build/esm/util/NOOP.js.map +1 -0
  561. package/build/esm/util/NullableProps.js +17 -0
  562. package/build/esm/util/NullableProps.js.map +1 -0
  563. package/build/esm/util/UserAgent.js +17 -0
  564. package/build/esm/util/UserAgent.js.map +1 -0
  565. package/build/esm/util/WireObjectSet.js +21 -0
  566. package/build/esm/util/WireObjectSet.js.map +1 -0
  567. package/build/esm/util/addUserAgentAndRequestContextHeaders.js +27 -0
  568. package/build/esm/util/addUserAgentAndRequestContextHeaders.js.map +1 -0
  569. package/build/esm/util/augmentRequestContext.js +52 -0
  570. package/build/esm/util/augmentRequestContext.js.map +1 -0
  571. package/build/esm/util/isOntologyObjectV2.js +20 -0
  572. package/build/esm/util/isOntologyObjectV2.js.map +1 -0
  573. package/build/esm/util/isOsdkBaseObject.d.ts +1 -1
  574. package/build/esm/util/isOsdkBaseObject.d.ts.map +1 -1
  575. package/build/esm/util/isOsdkBaseObject.js +19 -0
  576. package/build/esm/util/isOsdkBaseObject.js.map +1 -0
  577. package/build/esm/util/isOsdkObject.d.ts +1 -1
  578. package/build/esm/util/isOsdkObject.d.ts.map +1 -1
  579. package/build/esm/util/isOsdkObject.js +19 -0
  580. package/build/esm/util/isOsdkObject.js.map +1 -0
  581. package/build/esm/util/partialBy.js +17 -0
  582. package/build/esm/util/partialBy.js.map +1 -0
  583. package/build/esm/util/streamutils.js +95 -0
  584. package/build/esm/util/streamutils.js.map +1 -0
  585. package/build/esm/util/toDataValue.js +73 -0
  586. package/build/esm/util/toDataValue.js.map +1 -0
  587. package/build/esm/util/toDataValue.test.js +117 -0
  588. package/build/esm/util/toDataValue.test.js.map +1 -0
  589. package/build/esm/util/toDataValueQueries.js +107 -0
  590. package/build/esm/util/toDataValueQueries.js.map +1 -0
  591. package/package.json +15 -27
  592. package/build/browser/chunk-5HUCUBJX.js +0 -2327
  593. package/build/browser/chunk-5HUCUBJX.js.map +0 -1
  594. package/build/esm/__unstable/UNSTABLE_createClient.d.ts +0 -4
  595. package/build/esm/__unstable/UNSTABLE_createClient.d.ts.map +0 -1
  596. package/build/esm/__unstable/UnstableClient.d.ts +0 -12
  597. package/build/esm/__unstable/UnstableClient.d.ts.map +0 -1
  598. package/build/esm/chunk-5HUCUBJX.js +0 -2327
  599. package/build/esm/chunk-5HUCUBJX.js.map +0 -1
  600. package/build/esm/objectSet/ObjectSetListener.d.ts +0 -18
  601. package/build/esm/objectSet/ObjectSetListener.d.ts.map +0 -1
  602. package/build/esm/objectSet/createUnstableObjectSet.d.ts +0 -8
  603. package/build/esm/objectSet/createUnstableObjectSet.d.ts.map +0 -1
  604. package/build/esm/ontology/loadInterfaceDefinition.d.ts +0 -4
  605. package/build/esm/ontology/loadInterfaceDefinition.d.ts.map +0 -1
@@ -0,0 +1,533 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { bulkLoadOntologyEntities, createTemporaryObjectSet, loadAllOntologies } from "@osdk/client.unstable";
17
+ import { batchEnableWatcher } from "@osdk/client.unstable.osw";
18
+ import * as OntologiesV2 from "@osdk/internal.foundry.ontologiesv2";
19
+ import WebSocket from "isomorphic-ws";
20
+ import invariant from "tiny-invariant";
21
+ import { metadataCacheClient } from "../__unstable/ConjureSupport.js";
22
+ import { convertWireToOsdkObjects } from "../object/convertWireToOsdkObjects.js";
23
+ import { getObjectSetBaseType, toConjureObjectSet } from "./toConjureObjectSet.js";
24
+ const ONE_DAY_MS = 24 * 60 * 60 * 1000;
25
+ const MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;
26
+ /** Noop function to reduce conditional checks */
27
+ function doNothing() {}
28
+ /**
29
+ * Converts an ObjectSetListener to one where all the functions are defined.
30
+ */
31
+ function fillOutListener({
32
+ onChange = doNothing,
33
+ onError = doNothing,
34
+ onOutOfDate = doNothing
35
+ }) {
36
+ return {
37
+ onChange,
38
+ onError,
39
+ onOutOfDate
40
+ };
41
+ }
42
+ function isReady(sub) {
43
+ return sub.temporaryObjectSetId != null;
44
+ }
45
+ function subscriptionIsDone(sub) {
46
+ return sub.status === "done" || sub.status === "error";
47
+ }
48
+ /** @internal */
49
+ export class ObjectSetListenerWebsocket {
50
+ static #instances = new WeakMap();
51
+ OBJECT_SET_EXPIRY_MS;
52
+ MINIMUM_RECONNECT_DELAY_MS;
53
+ // FIXME
54
+ static getInstance(client) {
55
+ let instance = ObjectSetListenerWebsocket.#instances.get(client.clientCacheKey);
56
+ if (instance == null) {
57
+ instance = new ObjectSetListenerWebsocket(client);
58
+ ObjectSetListenerWebsocket.#instances.set(client.clientCacheKey, instance);
59
+ }
60
+ return instance;
61
+ }
62
+ #ws;
63
+ #lastWsConnect = 0;
64
+ #client;
65
+ #logger;
66
+ /**
67
+ * map of requestId to all active subscriptions at the time of the request
68
+ */
69
+ #pendingSubscriptions = new Map();
70
+ /**
71
+ * Map of subscriptionId to Subscription. Note: the subscriptionId may be
72
+ * temporary and not the actual subscriptionId from the server.
73
+ */
74
+ #subscriptions = new Map();
75
+ #oswContext;
76
+ #metadataContext;
77
+ #ossContext;
78
+ #maybeDisconnectTimeout;
79
+ // DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM
80
+ constructor(client, {
81
+ objectSetExpiryMs = ONE_DAY_MS,
82
+ minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS
83
+ } = {}) {
84
+ this.OBJECT_SET_EXPIRY_MS = objectSetExpiryMs;
85
+ this.MINIMUM_RECONNECT_DELAY_MS = minimumReconnectDelayMs;
86
+ this.#client = client;
87
+ this.#logger = client.logger?.child({}, {
88
+ msgPrefix: "<OSW> "
89
+ });
90
+ !(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? invariant(false, "Stack must be a URL") : void 0;
91
+ this.#oswContext = {
92
+ baseUrl: client.baseUrl,
93
+ servicePath: "/object-set-watcher/api",
94
+ fetchFn: client.fetch,
95
+ tokenProvider: async () => await client.tokenProvider()
96
+ };
97
+ this.#ossContext = {
98
+ ...this.#oswContext,
99
+ servicePath: "/object-set-service/api"
100
+ };
101
+ this.#metadataContext = {
102
+ ...this.#oswContext,
103
+ servicePath: "/ontology-metadata/api"
104
+ };
105
+ }
106
+ async subscribe(objectSet, listener) {
107
+ const sub = {
108
+ listener: fillOutListener(listener),
109
+ objectSet,
110
+ status: "preparing",
111
+ // Since we don't have a real subscription id yet but we need to keep
112
+ // track of this reference, we can just use a random uuid.
113
+ subscriptionId: `TMP-${crypto.randomUUID()}`
114
+ };
115
+ this.#subscriptions.set(sub.subscriptionId, sub);
116
+ // actually prepares the subscription, ensures the ws is ready, and sends
117
+ // a subscribe message. We don't want to block on this.
118
+ this.#initiateSubscribe(sub);
119
+ return () => {
120
+ this.#unsubscribe(sub);
121
+ };
122
+ }
123
+ /**
124
+ * Called at least once for every subscription.
125
+ *
126
+ * - Resets pending expiry
127
+ * - Recreates temporary object set
128
+ * - Triggers a full subscribe message
129
+ *
130
+ * @returns
131
+ */
132
+ async #initiateSubscribe(sub) {
133
+ if (process?.env?.NODE_ENV !== "production") {
134
+ this.#logger?.trace("#initiateSubscribe()");
135
+ }
136
+ if (sub.expiry) {
137
+ clearTimeout(sub.expiry);
138
+ }
139
+ // expiry is tied to the temporary object set, which is set to `timeToLive: "ONE_DAY"`
140
+ // in `#createTemporaryObjectSet`. They should be in sync
141
+ sub.expiry = setTimeout(() => this.#expire(sub), this.OBJECT_SET_EXPIRY_MS);
142
+ const ontologyRid = await this.#client.ontologyRid;
143
+ try {
144
+ const [temporaryObjectSet] = await Promise.all([
145
+ // create a time-bounded object set representation for watching
146
+ this.#createTemporaryObjectSet(sub.objectSet), this.#ensureWebsocket(),
147
+ // look up the object type's rid and ensure that we have enabled object set watcher for that rid
148
+ // TODO ???
149
+ getObjectSetBaseType(sub.objectSet).then(baseType => OntologiesV2.ObjectTypesV2.get(this.#client, ontologyRid, baseType)).then(objectType => this.#enableObjectSetsWatcher([objectType.rid]))]);
150
+ // the consumer may have already unsubscribed before we are ready to request a subscription
151
+ // so we have to acquire the pendingSubscription after the await.
152
+ if (subscriptionIsDone(sub)) {
153
+ return;
154
+ }
155
+ // Use new temporary object set id
156
+ sub.temporaryObjectSetId = temporaryObjectSet.objectSetRid;
157
+ // if we aren't open, then this happens after we #onConnect
158
+ if (this.#ws?.readyState === WebSocket.OPEN) {
159
+ this.#sendSubscribeMessage();
160
+ }
161
+ } catch (error) {
162
+ this.#logger?.error(error, "Error in #initiateSubscribe");
163
+ sub.listener.onError(error);
164
+ }
165
+ }
166
+ #sendSubscribeMessage() {
167
+ if (process?.env?.NODE_ENV !== "production") {
168
+ this.#logger?.trace("#sendSubscribeMessage()");
169
+ }
170
+ // If two calls to `.subscribe()` happen at once (or if the connection is reset),
171
+ // we may have multiple subscriptions that don't have a subscriptionId yet,
172
+ // so we filter those out.
173
+ const readySubs = [...this.#subscriptions.values()].filter(isReady);
174
+ if (readySubs.length === 0) {
175
+ if (process?.env?.NODE_ENV !== "production") {
176
+ this.#logger?.trace("#sendSubscribeMessage(): aborting due to no ready subscriptions");
177
+ }
178
+ return;
179
+ }
180
+ // Assumes the node 18 crypto fallback to globalThis in `subscribe` has happened.
181
+ const id = crypto.randomUUID();
182
+ // responses come back as an array of subIds, so we need to know the sources
183
+ this.#pendingSubscriptions.set(id, readySubs);
184
+ // every subscribe message "overwrites" the previous ones that are not
185
+ // re-included, so we have to reconstitute the entire list of subscriptions
186
+ const subscribe = {
187
+ id,
188
+ requests: readySubs.map(({
189
+ temporaryObjectSetId
190
+ }) => ({
191
+ objectSet: temporaryObjectSetId,
192
+ objectSetContext: {
193
+ objectSetFilterContext: {
194
+ parameterOverrides: {}
195
+ }
196
+ },
197
+ watchAllLinks: false
198
+ }))
199
+ };
200
+ if (process?.env?.NODE_ENV !== "production") {
201
+ this.#logger?.trace({
202
+ payload: subscribe
203
+ }, "sending subscribe message");
204
+ }
205
+ this.#ws?.send(JSON.stringify(subscribe));
206
+ }
207
+ #expire(sub) {
208
+ if (process?.env?.NODE_ENV !== "production") {
209
+ this.#logger?.trace({
210
+ subscription: sub
211
+ }, "#expire()");
212
+ }
213
+ // the temporary ObjectSet has expired, we should re-subscribe which will cause the
214
+ // listener to get an onOutOfDate message when it becomes subscribed again
215
+ sub.status = "expired";
216
+ this.#initiateSubscribe(sub);
217
+ }
218
+ #unsubscribe(sub, newStatus = "done") {
219
+ if (subscriptionIsDone(sub)) {
220
+ // if we are already done, we don't need to do anything
221
+ return;
222
+ }
223
+ sub.status = newStatus;
224
+ // make sure listeners do nothing now
225
+ sub.listener = fillOutListener({});
226
+ if (sub.expiry) {
227
+ clearTimeout(sub.expiry);
228
+ sub.expiry = undefined;
229
+ }
230
+ this.#subscriptions.delete(sub.subscriptionId);
231
+ // If we have no more subscriptions, we can disconnect the websocket
232
+ // however we should wait a bit to see if we get any more subscriptions.
233
+ // For example, when switching between react views, you may unsubscribe
234
+ // in the old view and subscribe in the new view. We don't need to re-establish
235
+ // the websocket connection in that case.
236
+ if (this.#maybeDisconnectTimeout) {
237
+ // We reset the timeout on every unsubscribe so its always at least 15s from
238
+ // the last time we are empty. E.g.:
239
+ // - 0s: Subscribe(A)
240
+ // - 10s: Unsubscribe(A)
241
+ // - 11s: Subscribe(B)
242
+ // - 20s: Unsubscribe(B)
243
+ // If we do not clear out the timeout we would disconnect at 25s but that would only be
244
+ // 5s after the last subscription was removed instead of at 35s for the desired 15s.
245
+ clearTimeout(this.#maybeDisconnectTimeout);
246
+ }
247
+ this.#maybeDisconnectTimeout = setTimeout(() => {
248
+ this.#maybeDisconnectTimeout = undefined;
249
+ if (this.#subscriptions.size === 0) {
250
+ this.#cycleWebsocket();
251
+ }
252
+ }, 15_000 /* ms */);
253
+ }
254
+ async #ensureWebsocket() {
255
+ if (this.#ws == null) {
256
+ const {
257
+ baseUrl,
258
+ tokenProvider
259
+ } = this.#client;
260
+ const base = new URL(baseUrl);
261
+ // TODO: This should be a different endpoint
262
+ const url = `wss://${base.host}/object-set-watcher/ws/subscriptions`;
263
+ const token = await tokenProvider();
264
+ // tokenProvider is async, there could potentially be a race to create the websocket.
265
+ // Only the first call to reach here will find a null this.#ws, the rest will bail out
266
+ if (this.#ws == null) {
267
+ // TODO this can probably be exponential backoff with jitter
268
+ // don't reconnect more quickly than MINIMUM_RECONNECT_DELAY
269
+ const nextConnectTime = (this.#lastWsConnect ?? 0) + this.MINIMUM_RECONNECT_DELAY_MS;
270
+ if (nextConnectTime > Date.now()) {
271
+ await new Promise(resolve => {
272
+ setTimeout(resolve, nextConnectTime - Date.now());
273
+ });
274
+ }
275
+ this.#lastWsConnect = Date.now();
276
+ // we again may have lost the race after our minimum backoff time
277
+ if (this.#ws == null) {
278
+ if (process?.env?.NODE_ENV !== "production") {
279
+ this.#logger?.trace("Creating websocket");
280
+ }
281
+ this.#ws = new WebSocket(url, [`Bearer-${token}`]);
282
+ this.#ws.addEventListener("close", this.#onClose);
283
+ this.#ws.addEventListener("message", this.#onMessage);
284
+ this.#ws.addEventListener("open", this.#onOpen);
285
+ }
286
+ }
287
+ // Allow await-ing the websocket open event if it isn't open already.
288
+ // This needs to happen even for callers that didn't just create this.#ws
289
+ if (this.#ws.readyState === WebSocket.CONNECTING) {
290
+ const ws = this.#ws;
291
+ return new Promise((resolve, reject) => {
292
+ function cleanup() {
293
+ ws.removeEventListener("open", open);
294
+ ws.removeEventListener("error", error);
295
+ ws.removeEventListener("close", cleanup);
296
+ }
297
+ function open() {
298
+ cleanup();
299
+ resolve();
300
+ }
301
+ function error(evt) {
302
+ cleanup();
303
+ reject(evt);
304
+ }
305
+ ws.addEventListener("open", open);
306
+ ws.addEventListener("error", error);
307
+ ws.addEventListener("close", cleanup);
308
+ });
309
+ }
310
+ }
311
+ }
312
+ #onOpen = () => {
313
+ // resubscribe all of the listeners
314
+ this.#sendSubscribeMessage();
315
+ };
316
+ #onMessage = async message => {
317
+ const data = JSON.parse(message.data.toString());
318
+ if (process?.env?.NODE_ENV !== "production") {
319
+ this.#logger?.trace({
320
+ payload: data
321
+ }, "received message from ws");
322
+ }
323
+ switch (data.type) {
324
+ case "objectSetChanged":
325
+ return this.#handleMessage_objectSetChanged(data.objectSetChanged);
326
+ case "refreshObjectSet":
327
+ return this.#handleMessage_refreshObjectSet(data.refreshObjectSet);
328
+ case "subscribeResponses":
329
+ return this.#handleMessage_subscribeResponses(data.subscribeResponses);
330
+ case "subscriptionClosed":
331
+ {
332
+ const payload = data.subscriptionClosed;
333
+ return this.#handleMessage_subscriptionClosed(payload);
334
+ }
335
+ default:
336
+ invariant(false, "Unexpected message type");
337
+ }
338
+ };
339
+ #handleMessage_objectSetChanged = async payload => {
340
+ const sub = this.#subscriptions.get(payload.id);
341
+ !sub ? invariant(false, `Expected subscription id ${payload.id}`) : void 0;
342
+ if ("confidenceValue" in payload) {
343
+ sub.listener.onOutOfDate();
344
+ return;
345
+ }
346
+ const objects = payload.updates.filter(function (a) {
347
+ return a.type === "object";
348
+ }).map(a => a.object);
349
+ !(objects.length === payload.updates.length) ? invariant(false, "currently only support full updates not reference updates") : void 0;
350
+ sub.listener.onChange(await convertFoundryToOsdkObjects(this.#client, this.#metadataContext, objects));
351
+ };
352
+ #handleMessage_refreshObjectSet = payload => {
353
+ const sub = this.#subscriptions.get(payload.id);
354
+ !sub ? invariant(false, `Expected subscription id ${payload.id}`) : void 0;
355
+ sub.listener.onOutOfDate();
356
+ };
357
+ #handleMessage_subscribeResponses = payload => {
358
+ const {
359
+ id,
360
+ responses
361
+ } = payload;
362
+ const subs = this.#pendingSubscriptions.get(id);
363
+ !subs ? invariant(false, `should have a pending subscription for ${id}`) : void 0;
364
+ this.#pendingSubscriptions.delete(id);
365
+ for (let i = 0; i < responses.length; i++) {
366
+ const sub = subs[i];
367
+ const response = responses[i];
368
+ switch (response.type) {
369
+ case "error":
370
+ sub.listener.onError(response.error);
371
+ this.#unsubscribe(sub, "error");
372
+ break;
373
+ case "qos":
374
+ // the server has requested that we tear down our websocket and reconnect to help load balance
375
+ this.#cycleWebsocket();
376
+ break;
377
+ case "success":
378
+ // `"preparing"` should only be the status on an initial subscribe.
379
+ const shouldFireOutOfDate = sub.status === "expired" || sub.status === "reconnecting";
380
+ if (process?.env?.NODE_ENV !== "production") {
381
+ this.#logger?.trace({
382
+ shouldFireOutOfDate
383
+ }, "success");
384
+ }
385
+ sub.status = "subscribed";
386
+ if (sub.subscriptionId !== response.success.id) {
387
+ // might be the temporary one
388
+ this.#subscriptions.delete(sub.subscriptionId);
389
+ sub.subscriptionId = response.success.id;
390
+ this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId
391
+ }
392
+ if (shouldFireOutOfDate) sub.listener.onOutOfDate();
393
+ break;
394
+ default:
395
+ sub.listener.onError(response);
396
+ }
397
+ }
398
+ };
399
+ #handleMessage_subscriptionClosed(payload) {
400
+ const sub = this.#subscriptions.get(payload.id);
401
+ !sub ? invariant(false, `Expected subscription id ${payload.id}`) : void 0;
402
+ sub.listener.onError(payload.error);
403
+ this.#unsubscribe(sub, "error");
404
+ }
405
+ #onClose = event => {
406
+ if (process?.env?.NODE_ENV !== "production") {
407
+ this.#logger?.trace({
408
+ event
409
+ }, "Received close event from ws", event);
410
+ }
411
+ // TODO we should probably throttle this so we don't abuse the backend
412
+ this.#cycleWebsocket();
413
+ };
414
+ async #enableObjectSetsWatcher(objectTypeRids) {
415
+ return batchEnableWatcher(this.#oswContext, {
416
+ requests: objectTypeRids
417
+ });
418
+ }
419
+ async #createTemporaryObjectSet(objectSet) {
420
+ const objectSetBaseType = await getObjectSetBaseType(objectSet);
421
+ const mcc = await metadataCacheClient(this.#client);
422
+ const objectInfo = await mcc.forObjectByApiName(objectSetBaseType);
423
+ const propMapping = await objectInfo.getPropertyMapping();
424
+ const temporaryObjectSet = await createTemporaryObjectSet(this.#ossContext, {
425
+ objectSet: toConjureObjectSet(objectSet, propMapping),
426
+ timeToLive: "ONE_DAY",
427
+ // MUST keep in sync with the value for expiry in `#initiateSubscribe`.
428
+ objectSetFilterContext: {
429
+ parameterOverrides: {}
430
+ }
431
+ });
432
+ return {
433
+ objectSetRid: temporaryObjectSet.objectSetRid
434
+ };
435
+ }
436
+ #cycleWebsocket = () => {
437
+ if (this.#ws) {
438
+ this.#ws.removeEventListener("open", this.#onOpen);
439
+ this.#ws.removeEventListener("message", this.#onMessage);
440
+ this.#ws.removeEventListener("close", this.#onClose);
441
+ if (this.#ws.readyState !== WebSocket.CLOSING && this.#ws.readyState !== WebSocket.CLOSED) {
442
+ this.#ws.close();
443
+ }
444
+ this.#ws = undefined;
445
+ }
446
+ // if we have any listeners that are still depending on us, go ahead and reopen the websocket
447
+ if (this.#subscriptions.size > 0) {
448
+ if (process?.env?.NODE_ENV !== "production") {
449
+ for (const s of this.#subscriptions.values()) {
450
+ !(s.status !== "done" && s.status !== "error") ? invariant(false, "should not have done/error subscriptions still") : void 0;
451
+ }
452
+ }
453
+ for (const s of this.#subscriptions.values()) {
454
+ if (s.status === "subscribed") s.status = "reconnecting";
455
+ }
456
+ this.#ensureWebsocket();
457
+ }
458
+ };
459
+ }
460
+ async function convertFoundryToOsdkObjects(client, ctx, objects) {
461
+ const osdkObjects = await Promise.all(objects.map(async object => {
462
+ const propertyMapping = await (await (await metadataCacheClient(client)).forObjectByRid(object.type)).getPropertyMapping();
463
+ const convertedObject = Object.fromEntries([...Object.entries(object.properties).map(([key, value]) => {
464
+ return [propertyMapping?.propertyIdToApiNameMapping[key], value];
465
+ }), [propertyMapping?.propertyIdToApiNameMapping[Object.entries(object.key)[0][0]], Object.entries(object.key)[0][1]], ["__apiName", propertyMapping?.apiName], ["$apiName", propertyMapping?.apiName]]);
466
+ return convertedObject;
467
+ }));
468
+ // doesn't care about interfaces
469
+ return await convertWireToOsdkObjects(client, osdkObjects, undefined);
470
+ }
471
+ // Mapping of ObjectRid to Properties
472
+ const objectTypeMapping = new WeakMap();
473
+ const objectApiNameToRid = new Map();
474
+ async function getOntologyPropertyMappingForApiName(client, ctx, objectApiName) {
475
+ if (objectApiNameToRid.has(objectApiName)) {
476
+ return objectTypeMapping.get(ctx)?.get(objectApiNameToRid.get(objectApiName));
477
+ }
478
+ const ontologyRid = await client.ontologyRid;
479
+ const wireObjectType = await OntologiesV2.ObjectTypesV2.get(client, ontologyRid, objectApiName);
480
+ return getOntologyPropertyMappingForRid(ctx, ontologyRid, wireObjectType.rid);
481
+ }
482
+ let cachedAllOntologies;
483
+ async function getOntologyVersionForRid(ctx, ontologyRid) {
484
+ cachedAllOntologies ??= await loadAllOntologies(ctx, {});
485
+ !cachedAllOntologies.ontologies[ontologyRid] ? invariant(false, "ontology should be loaded") : void 0;
486
+ return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;
487
+ }
488
+ async function getOntologyPropertyMappingForRid(ctx, ontologyRid, objectRid) {
489
+ if (!objectTypeMapping.has(ctx)) {
490
+ objectTypeMapping.set(ctx, new Map());
491
+ }
492
+ if (!objectTypeMapping.get(ctx).has(objectRid)) {
493
+ const ontologyVersion = await getOntologyVersionForRid(ctx, ontologyRid);
494
+ const body = {
495
+ datasourceTypes: [],
496
+ objectTypes: [{
497
+ identifier: {
498
+ type: "objectTypeRid",
499
+ objectTypeRid: objectRid
500
+ },
501
+ versionReference: {
502
+ type: "ontologyVersion",
503
+ ontologyVersion: ontologyVersion
504
+ }
505
+ }],
506
+ linkTypes: [],
507
+ sharedPropertyTypes: [],
508
+ interfaceTypes: [],
509
+ typeGroups: [],
510
+ loadRedacted: false,
511
+ includeObjectTypeCount: undefined,
512
+ includeObjectTypesWithoutSearchableDatasources: true,
513
+ includeEntityMetadata: undefined
514
+ };
515
+ const entities = await bulkLoadOntologyEntities(ctx, undefined, body);
516
+ !entities.objectTypes[0]?.objectType ? invariant(false, "object type should be loaded") : void 0;
517
+ const propertyIdToApiNameMapping = Object.fromEntries(Object.values(entities.objectTypes[0].objectType.propertyTypes).map(property => {
518
+ return [property.id, property.apiName];
519
+ }));
520
+ const propertyApiNameToIdMapping = Object.fromEntries(Object.values(entities.objectTypes[0].objectType.propertyTypes).map(property => {
521
+ return [property.apiName, property.id];
522
+ }));
523
+ objectTypeMapping.get(ctx)?.set(objectRid, {
524
+ apiName: entities.objectTypes[0].objectType.apiName,
525
+ id: entities.objectTypes[0].objectType.id,
526
+ propertyIdToApiNameMapping,
527
+ propertyApiNameToIdMapping
528
+ });
529
+ objectApiNameToRid.set(entities.objectTypes[0].objectType.apiName, objectRid);
530
+ }
531
+ return objectTypeMapping.get(ctx)?.get(objectRid);
532
+ }
533
+ //# sourceMappingURL=ObjectSetListenerWebsocket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectSetListenerWebsocket.js","names":["bulkLoadOntologyEntities","createTemporaryObjectSet","loadAllOntologies","batchEnableWatcher","OntologiesV2","WebSocket","invariant","metadataCacheClient","convertWireToOsdkObjects","getObjectSetBaseType","toConjureObjectSet","ONE_DAY_MS","MINIMUM_RECONNECT_DELAY_MS","doNothing","fillOutListener","onChange","onError","onOutOfDate","isReady","sub","temporaryObjectSetId","subscriptionIsDone","status","ObjectSetListenerWebsocket","instances","WeakMap","OBJECT_SET_EXPIRY_MS","getInstance","client","instance","get","clientCacheKey","set","ws","lastWsConnect","logger","pendingSubscriptions","Map","subscriptions","oswContext","metadataContext","ossContext","maybeDisconnectTimeout","constructor","objectSetExpiryMs","minimumReconnectDelayMs","child","msgPrefix","baseUrl","startsWith","servicePath","fetchFn","fetch","tokenProvider","subscribe","objectSet","listener","subscriptionId","crypto","randomUUID","initiateSubscribe","unsubscribe","#initiateSubscribe","process","env","NODE_ENV","trace","expiry","clearTimeout","setTimeout","expire","ontologyRid","temporaryObjectSet","Promise","all","ensureWebsocket","then","baseType","ObjectTypesV2","objectType","enableObjectSetsWatcher","rid","objectSetRid","readyState","OPEN","sendSubscribeMessage","error","#sendSubscribeMessage","readySubs","values","filter","length","id","requests","map","objectSetContext","objectSetFilterContext","parameterOverrides","watchAllLinks","payload","send","JSON","stringify","#expire","subscription","#unsubscribe","newStatus","undefined","delete","size","cycleWebsocket","#ensureWebsocket","base","URL","url","host","token","nextConnectTime","Date","now","resolve","addEventListener","onClose","onMessage","onOpen","CONNECTING","reject","cleanup","removeEventListener","open","evt","#onOpen","message","data","parse","toString","type","handleMessage_objectSetChanged","objectSetChanged","handleMessage_refreshObjectSet","refreshObjectSet","handleMessage_subscribeResponses","subscribeResponses","subscriptionClosed","handleMessage_subscriptionClosed","objects","updates","a","object","convertFoundryToOsdkObjects","responses","subs","i","response","shouldFireOutOfDate","success","#handleMessage_subscriptionClosed","event","#enableObjectSetsWatcher","objectTypeRids","#createTemporaryObjectSet","objectSetBaseType","mcc","objectInfo","forObjectByApiName","propMapping","getPropertyMapping","timeToLive","#cycleWebsocket","CLOSING","CLOSED","close","s","ctx","osdkObjects","propertyMapping","forObjectByRid","convertedObject","Object","fromEntries","entries","properties","key","value","propertyIdToApiNameMapping","apiName","objectTypeMapping","objectApiNameToRid","getOntologyPropertyMappingForApiName","objectApiName","has","wireObjectType","getOntologyPropertyMappingForRid","cachedAllOntologies","getOntologyVersionForRid","ontologies","currentOntologyVersion","objectRid","ontologyVersion","body","datasourceTypes","objectTypes","identifier","objectTypeRid","versionReference","linkTypes","sharedPropertyTypes","interfaceTypes","typeGroups","loadRedacted","includeObjectTypeCount","includeObjectTypesWithoutSearchableDatasources","includeEntityMetadata","entities","propertyTypes","property","propertyApiNameToIdMapping"],"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 { bulkLoadOntologyEntities, createTemporaryObjectSet, loadAllOntologies, } from \"@osdk/client.unstable\";\nimport { batchEnableWatcher } from \"@osdk/client.unstable.osw\";\nimport * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport WebSocket from \"isomorphic-ws\";\nimport invariant from \"tiny-invariant\";\nimport { metadataCacheClient } from \"../__unstable/ConjureSupport.js\";\nimport { convertWireToOsdkObjects } from \"../object/convertWireToOsdkObjects.js\";\nimport { getObjectSetBaseType, toConjureObjectSet, } from \"./toConjureObjectSet.js\";\nconst ONE_DAY_MS = 24 * 60 * 60 * 1000;\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 }) {\n return { onChange, onError, onOutOfDate };\n}\nfunction isReady(sub) {\n return sub.temporaryObjectSetId != 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 OBJECT_SET_EXPIRY_MS;\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 #oswContext;\n #metadataContext;\n #ossContext;\n #maybeDisconnectTimeout;\n // DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM\n constructor(client, { objectSetExpiryMs = ONE_DAY_MS, minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS, } = {}) {\n this.OBJECT_SET_EXPIRY_MS = objectSetExpiryMs;\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 this.#oswContext = {\n baseUrl: client.baseUrl,\n servicePath: \"/object-set-watcher/api\",\n fetchFn: client.fetch,\n tokenProvider: async () => await client.tokenProvider(),\n };\n this.#ossContext = {\n ...this.#oswContext,\n servicePath: \"/object-set-service/api\",\n };\n this.#metadataContext = {\n ...this.#oswContext,\n servicePath: \"/ontology-metadata/api\",\n };\n }\n async subscribe(objectSet, listener) {\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 sub = {\n listener: fillOutListener(listener),\n objectSet,\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 if (sub.expiry) {\n clearTimeout(sub.expiry);\n }\n // expiry is tied to the temporary object set, which is set to `timeToLive: \"ONE_DAY\"`\n // in `#createTemporaryObjectSet`. They should be in sync\n sub.expiry = setTimeout(() => this.#expire(sub), this.OBJECT_SET_EXPIRY_MS);\n const ontologyRid = await this.#client.ontologyRid;\n try {\n const [temporaryObjectSet] = await Promise.all([\n // create a time-bounded object set representation for watching\n this.#createTemporaryObjectSet(sub.objectSet),\n this.#ensureWebsocket(),\n // look up the object type's rid and ensure that we have enabled object set watcher for that rid\n // TODO ???\n getObjectSetBaseType(sub.objectSet).then(baseType => OntologiesV2.ObjectTypesV2.get(this.#client, ontologyRid, baseType)).then(objectType => this.#enableObjectSetsWatcher([objectType.rid])),\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 // Use new temporary object set id\n sub.temporaryObjectSetId = temporaryObjectSet.objectSetRid;\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(({ temporaryObjectSetId }) => ({\n objectSet: temporaryObjectSetId,\n objectSetContext: {\n objectSetFilterContext: { parameterOverrides: {} },\n },\n watchAllLinks: false,\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 #expire(sub) {\n if (process?.env?.NODE_ENV !== \"production\") {\n this.#logger?.trace({ subscription: sub }, \"#expire()\");\n }\n // the temporary ObjectSet has expired, we should re-subscribe which will cause the\n // listener to get an onOutOfDate message when it becomes subscribed again\n sub.status = \"expired\";\n this.#initiateSubscribe(sub);\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 if (sub.expiry) {\n clearTimeout(sub.expiry);\n sub.expiry = undefined;\n }\n this.#subscriptions.delete(sub.subscriptionId);\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 // TODO: This should be a different endpoint\n const url = `wss://${base.host}/object-set-watcher/ws/subscriptions`;\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.objectSetChanged);\n case \"refreshObjectSet\":\n return this.#handleMessage_refreshObjectSet(data.refreshObjectSet);\n case \"subscribeResponses\":\n return this.#handleMessage_subscribeResponses(data.subscribeResponses);\n case \"subscriptionClosed\": {\n const payload = data.subscriptionClosed;\n return this.#handleMessage_subscriptionClosed(payload);\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 invariant(sub, `Expected subscription id ${payload.id}`);\n if (\"confidenceValue\" in payload) {\n sub.listener.onOutOfDate();\n return;\n }\n const objects = payload.updates.filter(function (a) {\n return a.type === \"object\";\n }).map(a => a.object);\n invariant(objects.length === payload.updates.length, \"currently only support full updates not reference updates\");\n sub.listener.onChange(await convertFoundryToOsdkObjects(this.#client, this.#metadataContext, objects));\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.error);\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.success.id) {\n // might be the temporary one\n this.#subscriptions.delete(sub.subscriptionId);\n sub.subscriptionId = response.success.id;\n this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId\n }\n if (shouldFireOutOfDate)\n sub.listener.onOutOfDate();\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.error);\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 async #enableObjectSetsWatcher(objectTypeRids) {\n return batchEnableWatcher(this.#oswContext, {\n requests: objectTypeRids,\n });\n }\n async #createTemporaryObjectSet(objectSet) {\n const objectSetBaseType = await getObjectSetBaseType(objectSet);\n const mcc = await metadataCacheClient(this.#client);\n const objectInfo = await mcc.forObjectByApiName(objectSetBaseType);\n const propMapping = await objectInfo.getPropertyMapping();\n const temporaryObjectSet = await createTemporaryObjectSet(this.#ossContext, {\n objectSet: toConjureObjectSet(objectSet, propMapping),\n timeToLive: \"ONE_DAY\", // MUST keep in sync with the value for expiry in `#initiateSubscribe`.\n objectSetFilterContext: { parameterOverrides: {} },\n });\n return { objectSetRid: temporaryObjectSet.objectSetRid };\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}\nasync function convertFoundryToOsdkObjects(client, ctx, objects) {\n const osdkObjects = await Promise.all(objects.map(async (object) => {\n const propertyMapping = await (await (await metadataCacheClient(client))\n .forObjectByRid(object.type))\n .getPropertyMapping();\n const convertedObject = Object.fromEntries([\n ...Object.entries(object.properties).map(([key, value]) => {\n return [propertyMapping?.propertyIdToApiNameMapping[key], value];\n }),\n [\n propertyMapping\n ?.propertyIdToApiNameMapping[Object.entries(object.key)[0][0]],\n Object.entries(object.key)[0][1],\n ],\n [\n \"__apiName\",\n propertyMapping?.apiName,\n ],\n [\n \"$apiName\",\n propertyMapping?.apiName,\n ],\n ]);\n return convertedObject;\n }));\n // doesn't care about interfaces\n return await convertWireToOsdkObjects(client, osdkObjects, undefined);\n}\n// Mapping of ObjectRid to Properties\nconst objectTypeMapping = new WeakMap();\nconst objectApiNameToRid = new Map();\nasync function getOntologyPropertyMappingForApiName(client, ctx, objectApiName) {\n if (objectApiNameToRid.has(objectApiName)) {\n return objectTypeMapping.get(ctx)?.get(objectApiNameToRid.get(objectApiName));\n }\n const ontologyRid = await client.ontologyRid;\n const wireObjectType = await OntologiesV2.ObjectTypesV2\n .get(client, ontologyRid, objectApiName);\n return getOntologyPropertyMappingForRid(ctx, ontologyRid, wireObjectType.rid);\n}\nlet cachedAllOntologies;\nasync function getOntologyVersionForRid(ctx, ontologyRid) {\n cachedAllOntologies ??= await loadAllOntologies(ctx, {});\n invariant(cachedAllOntologies.ontologies[ontologyRid], \"ontology should be loaded\");\n return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;\n}\nasync function getOntologyPropertyMappingForRid(ctx, ontologyRid, objectRid) {\n if (!objectTypeMapping.has(ctx)) {\n objectTypeMapping.set(ctx, new Map());\n }\n if (!objectTypeMapping.get(ctx).has(objectRid)) {\n const ontologyVersion = await getOntologyVersionForRid(ctx, ontologyRid);\n const body = {\n datasourceTypes: [],\n objectTypes: [{\n identifier: {\n type: \"objectTypeRid\",\n objectTypeRid: objectRid,\n },\n versionReference: {\n type: \"ontologyVersion\",\n ontologyVersion: ontologyVersion,\n },\n }],\n linkTypes: [],\n sharedPropertyTypes: [],\n interfaceTypes: [],\n typeGroups: [],\n loadRedacted: false,\n includeObjectTypeCount: undefined,\n includeObjectTypesWithoutSearchableDatasources: true,\n includeEntityMetadata: undefined,\n };\n const entities = await bulkLoadOntologyEntities(ctx, undefined, body);\n invariant(entities.objectTypes[0]?.objectType, \"object type should be loaded\");\n const propertyIdToApiNameMapping = Object\n .fromEntries(Object.values(entities.objectTypes[0].objectType.propertyTypes).map(property => {\n return [property.id, property.apiName];\n }));\n const propertyApiNameToIdMapping = Object\n .fromEntries(Object.values(entities.objectTypes[0].objectType.propertyTypes).map(property => {\n return [property.apiName, property.id];\n }));\n objectTypeMapping.get(ctx)?.set(objectRid, {\n apiName: entities.objectTypes[0].objectType.apiName,\n id: entities.objectTypes[0].objectType.id,\n propertyIdToApiNameMapping,\n propertyApiNameToIdMapping,\n });\n objectApiNameToRid.set(entities.objectTypes[0].objectType.apiName, objectRid);\n }\n return objectTypeMapping.get(ctx)?.get(objectRid);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,wBAAwB,EAAEC,wBAAwB,EAAEC,iBAAiB,QAAS,uBAAuB;AAC9G,SAASC,kBAAkB,QAAQ,2BAA2B;AAC9D,OAAO,KAAKC,YAAY,MAAM,qCAAqC;AACnE,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,wBAAwB,QAAQ,uCAAuC;AAChF,SAASC,oBAAoB,EAAEC,kBAAkB,QAAS,yBAAyB;AACnF,MAAMC,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AACtC,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;AAAU,CAAC,EAAE;EAC7F,OAAO;IAAEE,QAAQ;IAAEC,OAAO;IAAEC;EAAY,CAAC;AAC7C;AACA,SAASC,OAAOA,CAACC,GAAG,EAAE;EAClB,OAAOA,GAAG,CAACC,oBAAoB,IAAI,IAAI;AAC3C;AACA,SAASC,kBAAkBA,CAACF,GAAG,EAAE;EAC7B,OAAOA,GAAG,CAACG,MAAM,KAAK,MAAM,IAAIH,GAAG,CAACG,MAAM,KAAK,OAAO;AAC1D;AACA;AAC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,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH8F,iBAAiB,CAAC5J,GAAG,CAAC+I,GAAG,CAAC,EAAE7I,GAAG,CAACqK,SAAS,EAAE;MACvCZ,OAAO,EAAE4B,QAAQ,CAACZ,WAAW,CAAC,CAAC,CAAC,CAAC1H,UAAU,CAAC0G,OAAO;MACnD7F,EAAE,EAAEyH,QAAQ,CAACZ,WAAW,CAAC,CAAC,CAAC,CAAC1H,UAAU,CAACa,EAAE;MACzC4F,0BAA0B;MAC1BgC;IACJ,CAAC,CAAC;IACF7B,kBAAkB,CAAC3J,GAAG,CAACqL,QAAQ,CAACZ,WAAW,CAAC,CAAC,CAAC,CAAC1H,UAAU,CAAC0G,OAAO,EAAEY,SAAS,CAAC;EACjF;EACA,OAAOX,iBAAiB,CAAC5J,GAAG,CAAC+I,GAAG,CAAC,EAAE/I,GAAG,CAACuK,SAAS,CAAC;AACrD","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ObjectSetListenerWebsocket.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectSetListenerWebsocket.test.d.ts","sourceRoot":"","sources":["../../../src/objectSet/ObjectSetListenerWebsocket.test.ts"],"names":[],"mappings":""}