@osdk/client 2.2.0-beta.8 → 2.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/CHANGELOG.md +388 -0
  2. package/build/browser/MinimalClientContext.js.map +1 -1
  3. package/build/browser/__unstable/ConjureSupport.js.map +1 -1
  4. package/build/browser/actions/ActionValidationError.js +1 -1
  5. package/build/browser/actions/ActionValidationError.js.map +1 -1
  6. package/build/browser/actions/actions.test.js +134 -89
  7. package/build/browser/actions/actions.test.js.map +1 -1
  8. package/build/browser/actions/applyAction.js.map +1 -1
  9. package/build/browser/createClient.js +5 -1
  10. package/build/browser/createClient.js.map +1 -1
  11. package/build/browser/createClient.test.js +14 -6
  12. package/build/browser/createClient.test.js.map +1 -1
  13. package/build/browser/createMinimalClient.js +2 -2
  14. package/build/browser/createMinimalClient.js.map +1 -1
  15. package/build/browser/createMinimalClientHelper.js +25 -0
  16. package/build/browser/createMinimalClientHelper.js.map +1 -0
  17. package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +36 -13
  18. package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
  19. package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js +133 -0
  20. package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
  21. package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js +93 -0
  22. package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
  23. package/build/browser/fetchMetadata.js +1 -1
  24. package/build/browser/fetchMetadata.js.map +1 -1
  25. package/build/browser/fetchMetadata.test.js +11 -9
  26. package/build/browser/fetchMetadata.test.js.map +1 -1
  27. package/build/browser/index.js +0 -1
  28. package/build/browser/index.js.map +1 -1
  29. package/build/{esm/util/isOsdkBaseObject.js → browser/intellisense.test.helpers/showsObjectPropertyJsdoc.js} +9 -4
  30. package/build/browser/intellisense.test.helpers/showsObjectPropertyJsdoc.js.map +1 -0
  31. package/build/browser/intellisense.test.js +17 -1
  32. package/build/browser/intellisense.test.js.map +1 -1
  33. package/build/browser/logger/BaseLogger.js +59 -0
  34. package/build/browser/logger/BaseLogger.js.map +1 -0
  35. package/build/browser/logger/BrowserLogger.js +67 -0
  36. package/build/browser/logger/BrowserLogger.js.map +1 -0
  37. package/build/browser/logger/MinimalLogger.js +39 -0
  38. package/build/browser/logger/MinimalLogger.js.map +1 -0
  39. package/build/browser/logger/MinimalLogger.test.js +60 -0
  40. package/build/browser/logger/MinimalLogger.test.js.map +1 -0
  41. package/build/browser/logger/TestLogger.js +56 -0
  42. package/build/browser/logger/TestLogger.js.map +1 -0
  43. package/build/browser/object/SimpleOsdkProperties.js +2 -0
  44. package/build/browser/object/SimpleOsdkProperties.js.map +1 -0
  45. package/build/browser/object/attachment.test.js +20 -7
  46. package/build/browser/object/attachment.test.js.map +1 -1
  47. package/build/browser/object/convertWireToOsdkObjects/BaseHolder.js +2 -0
  48. package/build/browser/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -0
  49. package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
  50. package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -1
  51. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
  52. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  53. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +53 -35
  54. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  55. package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
  56. package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
  57. package/build/browser/object/convertWireToOsdkObjects.js +7 -15
  58. package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
  59. package/build/browser/object/convertWireToOsdkObjects.test.js +39 -33
  60. package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
  61. package/build/browser/object/fetchPage.js +17 -4
  62. package/build/browser/object/fetchPage.js.map +1 -1
  63. package/build/browser/object/fetchPage.test.js +56 -2
  64. package/build/browser/object/fetchPage.test.js.map +1 -1
  65. package/build/browser/object/geotimeseriesreference.test.js +56 -134
  66. package/build/browser/object/geotimeseriesreference.test.js.map +1 -1
  67. package/build/browser/object/media.test.js +19 -14
  68. package/build/browser/object/media.test.js.map +1 -1
  69. package/build/browser/object/object.test.js +96 -89
  70. package/build/browser/object/object.test.js.map +1 -1
  71. package/build/browser/object/timeseries.test.js +119 -85
  72. package/build/browser/object/timeseries.test.js.map +1 -1
  73. package/build/browser/objectSet/InterfaceObjectSet.test.js +37 -17
  74. package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -1
  75. package/build/browser/objectSet/ObjectSet.test.js +200 -116
  76. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  77. package/build/browser/objectSet/ObjectSetListenerWebsocket.js +20 -16
  78. package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  79. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +19 -12
  80. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
  81. package/build/browser/objectSet/createObjectSet.js +2 -1
  82. package/build/browser/objectSet/createObjectSet.js.map +1 -1
  83. package/build/browser/observable/ListPayload.js.map +1 -1
  84. package/build/browser/observable/ObjectPayload.js.map +1 -1
  85. package/build/browser/observable/ObservableClient.js.map +1 -1
  86. package/build/browser/observable/internal/ActionApplication.js +32 -32
  87. package/build/browser/observable/internal/ActionApplication.js.map +1 -1
  88. package/build/browser/observable/internal/BulkObjectLoader.js +93 -0
  89. package/build/browser/observable/internal/BulkObjectLoader.js.map +1 -0
  90. package/build/browser/observable/internal/BulkObjectLoader.test.js +112 -0
  91. package/build/browser/observable/internal/BulkObjectLoader.test.js.map +1 -0
  92. package/build/browser/observable/internal/CacheKey.js +1 -1
  93. package/build/browser/observable/internal/CacheKey.js.map +1 -1
  94. package/build/browser/observable/internal/CacheKeys.js +2 -2
  95. package/build/browser/observable/internal/CacheKeys.js.map +1 -1
  96. package/build/browser/observable/internal/{ChangedObjects.js → Changes.js} +20 -9
  97. package/build/browser/observable/internal/Changes.js.map +1 -0
  98. package/build/browser/observable/internal/Layer.js +3 -0
  99. package/build/browser/observable/internal/Layer.js.map +1 -1
  100. package/build/browser/observable/internal/ListQuery.js +414 -170
  101. package/build/browser/observable/internal/ListQuery.js.map +1 -1
  102. package/build/browser/observable/internal/ObjectQuery.js +34 -21
  103. package/build/browser/observable/internal/ObjectQuery.js.map +1 -1
  104. package/build/browser/observable/internal/ObservableClientImpl.js +4 -12
  105. package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
  106. package/build/browser/observable/internal/OptimisticJob.js +1 -1
  107. package/build/browser/observable/internal/OptimisticJob.js.map +1 -1
  108. package/build/browser/observable/internal/OrderByCanonicalizer.js +73 -0
  109. package/build/browser/observable/internal/OrderByCanonicalizer.js.map +1 -0
  110. package/build/browser/observable/internal/OrderByCanonicalizer.test.js +78 -0
  111. package/build/browser/observable/internal/OrderByCanonicalizer.test.js.map +1 -0
  112. package/build/browser/observable/internal/Query.js +64 -31
  113. package/build/browser/observable/internal/Query.js.map +1 -1
  114. package/build/browser/observable/internal/RefCounts.js +7 -2
  115. package/build/browser/observable/internal/RefCounts.js.map +1 -1
  116. package/build/browser/observable/internal/SimpleWhereClause.js +2 -0
  117. package/build/browser/observable/internal/SimpleWhereClause.js.map +1 -0
  118. package/build/browser/observable/internal/Store.js +86 -269
  119. package/build/browser/observable/internal/Store.js.map +1 -1
  120. package/build/browser/observable/internal/Store.test.js +401 -375
  121. package/build/browser/observable/internal/Store.test.js.map +1 -1
  122. package/build/browser/observable/internal/WhereClauseCanonicalizer.js +11 -3
  123. package/build/browser/observable/internal/WhereClauseCanonicalizer.js.map +1 -1
  124. package/build/browser/observable/internal/objectMatchesWhereClause.js +0 -2
  125. package/build/browser/observable/internal/objectMatchesWhereClause.js.map +1 -1
  126. package/build/browser/observable/internal/objectMatchesWhereClause.test.js.map +1 -1
  127. package/build/browser/observable/internal/testUtils.js +85 -20
  128. package/build/browser/observable/internal/testUtils.js.map +1 -1
  129. package/build/browser/ontology/OntologyProvider.js.map +1 -1
  130. package/build/browser/ontology/StandardOntologyProvider.js +12 -5
  131. package/build/browser/ontology/StandardOntologyProvider.js.map +1 -1
  132. package/build/browser/ontology/StandardOntologyProvider.test.js +17 -16
  133. package/build/browser/ontology/StandardOntologyProvider.test.js.map +1 -1
  134. package/build/browser/ontology/loadFullObjectMetadata.js +0 -1
  135. package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -1
  136. package/build/browser/ontology/loadQueryMetadata.js +5 -2
  137. package/build/browser/ontology/loadQueryMetadata.js.map +1 -1
  138. package/build/browser/public/internal.js +2 -0
  139. package/build/browser/public/internal.js.map +1 -1
  140. package/build/browser/public/unstable-do-not-use.js +1 -0
  141. package/build/browser/public/unstable-do-not-use.js.map +1 -1
  142. package/build/browser/public-utils/osdkConfig.js +49 -0
  143. package/build/browser/public-utils/osdkConfig.js.map +1 -0
  144. package/build/browser/{object/createObjectSpecifierFromPrimaryKey.js → public-utils/vite-env.d.ts} +2 -3
  145. package/build/browser/queries/applyQuery.js +6 -4
  146. package/build/browser/queries/applyQuery.js.map +1 -1
  147. package/build/browser/queries/queries.test.js +93 -27
  148. package/build/browser/queries/queries.test.js.map +1 -1
  149. package/build/browser/queries/types.js.map +1 -1
  150. package/build/browser/tsserver.js.map +1 -1
  151. package/build/browser/util/UserAgent.js +1 -1
  152. package/build/browser/util/extractRdpDefinition.js +140 -0
  153. package/build/browser/util/extractRdpDefinition.js.map +1 -0
  154. package/build/browser/util/extractRdpDefinition.test.js +233 -0
  155. package/build/browser/util/extractRdpDefinition.test.js.map +1 -0
  156. package/build/browser/util/{isOsdkBaseObject.js → isObjectSpecifiersObject.js} +2 -2
  157. package/build/browser/util/isObjectSpecifiersObject.js.map +1 -0
  158. package/build/browser/util/isPoint.js +20 -0
  159. package/build/browser/util/isPoint.js.map +1 -0
  160. package/build/browser/util/objectSpecifierUtils.js +48 -0
  161. package/build/browser/util/objectSpecifierUtils.js.map +1 -0
  162. package/build/browser/util/objectSpecifierUtils.test.js +42 -0
  163. package/build/browser/util/objectSpecifierUtils.test.js.map +1 -0
  164. package/build/browser/util/toDataValue.js +6 -2
  165. package/build/browser/util/toDataValue.js.map +1 -1
  166. package/build/browser/util/toDataValue.test.js +37 -16
  167. package/build/browser/util/toDataValue.test.js.map +1 -1
  168. package/build/browser/util/toDataValueQueries.js +4 -6
  169. package/build/browser/util/toDataValueQueries.js.map +1 -1
  170. package/build/cjs/{Client-DBTcM9gB.d.cts → Client-CgL2LKN9.d.cts} +6 -7
  171. package/build/cjs/{chunk-IU47QMYO.cjs → chunk-FKI2LO2O.cjs} +250 -82
  172. package/build/cjs/chunk-FKI2LO2O.cjs.map +1 -0
  173. package/build/cjs/chunk-T4NIFYZS.cjs +14 -0
  174. package/build/cjs/chunk-T4NIFYZS.cjs.map +1 -0
  175. package/build/cjs/{chunk-JPENHIJB.cjs → chunk-W5PFESFR.cjs} +174 -35
  176. package/build/cjs/chunk-W5PFESFR.cjs.map +1 -0
  177. package/build/cjs/index.cjs +212 -193
  178. package/build/cjs/index.cjs.map +1 -1
  179. package/build/cjs/index.d.cts +4 -24
  180. package/build/cjs/public/internal.cjs +61 -7
  181. package/build/cjs/public/internal.cjs.map +1 -1
  182. package/build/cjs/public/internal.d.cts +50 -3
  183. package/build/cjs/public/unstable-do-not-use.cjs +885 -620
  184. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  185. package/build/cjs/public/unstable-do-not-use.d.cts +35 -25
  186. package/build/esm/MinimalClientContext.js.map +1 -1
  187. package/build/esm/__unstable/ConjureSupport.js.map +1 -1
  188. package/build/esm/actions/ActionValidationError.js +1 -1
  189. package/build/esm/actions/ActionValidationError.js.map +1 -1
  190. package/build/esm/actions/actions.test.js +134 -89
  191. package/build/esm/actions/actions.test.js.map +1 -1
  192. package/build/esm/actions/applyAction.js.map +1 -1
  193. package/build/esm/createClient.js +5 -1
  194. package/build/esm/createClient.js.map +1 -1
  195. package/build/esm/createClient.test.js +14 -6
  196. package/build/esm/createClient.test.js.map +1 -1
  197. package/build/esm/createMinimalClient.js +2 -2
  198. package/build/esm/createMinimalClient.js.map +1 -1
  199. package/build/esm/createMinimalClientHelper.js +25 -0
  200. package/build/esm/createMinimalClientHelper.js.map +1 -0
  201. package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +36 -13
  202. package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
  203. package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js +133 -0
  204. package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
  205. package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js +93 -0
  206. package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
  207. package/build/esm/fetchMetadata.js +1 -1
  208. package/build/esm/fetchMetadata.js.map +1 -1
  209. package/build/esm/fetchMetadata.test.js +11 -9
  210. package/build/esm/fetchMetadata.test.js.map +1 -1
  211. package/build/esm/index.js +0 -1
  212. package/build/esm/index.js.map +1 -1
  213. package/build/esm/{util/isOsdkObject.js → intellisense.test.helpers/showsObjectPropertyJsdoc.js} +9 -4
  214. package/build/esm/intellisense.test.helpers/showsObjectPropertyJsdoc.js.map +1 -0
  215. package/build/esm/intellisense.test.js +17 -1
  216. package/build/esm/intellisense.test.js.map +1 -1
  217. package/build/esm/logger/BaseLogger.js +59 -0
  218. package/build/esm/logger/BaseLogger.js.map +1 -0
  219. package/build/esm/logger/BrowserLogger.js +67 -0
  220. package/build/esm/logger/BrowserLogger.js.map +1 -0
  221. package/build/esm/logger/MinimalLogger.js +39 -0
  222. package/build/esm/logger/MinimalLogger.js.map +1 -0
  223. package/build/esm/logger/MinimalLogger.test.js +60 -0
  224. package/build/esm/logger/MinimalLogger.test.js.map +1 -0
  225. package/build/esm/logger/TestLogger.js +56 -0
  226. package/build/esm/logger/TestLogger.js.map +1 -0
  227. package/build/esm/object/SimpleOsdkProperties.js +2 -0
  228. package/build/esm/object/SimpleOsdkProperties.js.map +1 -0
  229. package/build/esm/object/attachment.test.js +20 -7
  230. package/build/esm/object/attachment.test.js.map +1 -1
  231. package/build/esm/object/convertWireToOsdkObjects/BaseHolder.js +2 -0
  232. package/build/esm/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -0
  233. package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
  234. package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -1
  235. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
  236. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  237. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +53 -35
  238. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  239. package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
  240. package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
  241. package/build/esm/object/convertWireToOsdkObjects.js +7 -15
  242. package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
  243. package/build/esm/object/convertWireToOsdkObjects.test.js +39 -33
  244. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
  245. package/build/esm/object/fetchPage.js +17 -4
  246. package/build/esm/object/fetchPage.js.map +1 -1
  247. package/build/esm/object/fetchPage.test.js +56 -2
  248. package/build/esm/object/fetchPage.test.js.map +1 -1
  249. package/build/esm/object/geotimeseriesreference.test.js +56 -134
  250. package/build/esm/object/geotimeseriesreference.test.js.map +1 -1
  251. package/build/esm/object/media.test.js +19 -14
  252. package/build/esm/object/media.test.js.map +1 -1
  253. package/build/esm/object/object.test.js +96 -89
  254. package/build/esm/object/object.test.js.map +1 -1
  255. package/build/esm/object/timeseries.test.js +119 -85
  256. package/build/esm/object/timeseries.test.js.map +1 -1
  257. package/build/esm/objectSet/InterfaceObjectSet.test.js +37 -17
  258. package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -1
  259. package/build/esm/objectSet/ObjectSet.test.js +200 -116
  260. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  261. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +20 -16
  262. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  263. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +19 -12
  264. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
  265. package/build/esm/objectSet/createObjectSet.js +2 -1
  266. package/build/esm/objectSet/createObjectSet.js.map +1 -1
  267. package/build/esm/observable/ListPayload.js.map +1 -1
  268. package/build/esm/observable/ObjectPayload.js.map +1 -1
  269. package/build/esm/observable/ObservableClient.js.map +1 -1
  270. package/build/esm/observable/internal/ActionApplication.js +32 -32
  271. package/build/esm/observable/internal/ActionApplication.js.map +1 -1
  272. package/build/esm/observable/internal/BulkObjectLoader.js +93 -0
  273. package/build/esm/observable/internal/BulkObjectLoader.js.map +1 -0
  274. package/build/esm/observable/internal/BulkObjectLoader.test.js +112 -0
  275. package/build/esm/observable/internal/BulkObjectLoader.test.js.map +1 -0
  276. package/build/esm/observable/internal/CacheKey.js +1 -1
  277. package/build/esm/observable/internal/CacheKey.js.map +1 -1
  278. package/build/esm/observable/internal/CacheKeys.js +2 -2
  279. package/build/esm/observable/internal/CacheKeys.js.map +1 -1
  280. package/build/esm/observable/internal/{ChangedObjects.js → Changes.js} +20 -9
  281. package/build/esm/observable/internal/Changes.js.map +1 -0
  282. package/build/esm/observable/internal/Layer.js +3 -0
  283. package/build/esm/observable/internal/Layer.js.map +1 -1
  284. package/build/esm/observable/internal/ListQuery.js +414 -170
  285. package/build/esm/observable/internal/ListQuery.js.map +1 -1
  286. package/build/esm/observable/internal/ObjectQuery.js +34 -21
  287. package/build/esm/observable/internal/ObjectQuery.js.map +1 -1
  288. package/build/esm/observable/internal/ObservableClientImpl.js +4 -12
  289. package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
  290. package/build/esm/observable/internal/OptimisticJob.js +1 -1
  291. package/build/esm/observable/internal/OptimisticJob.js.map +1 -1
  292. package/build/esm/observable/internal/OrderByCanonicalizer.js +73 -0
  293. package/build/esm/observable/internal/OrderByCanonicalizer.js.map +1 -0
  294. package/build/esm/observable/internal/OrderByCanonicalizer.test.js +78 -0
  295. package/build/esm/observable/internal/OrderByCanonicalizer.test.js.map +1 -0
  296. package/build/esm/observable/internal/Query.js +64 -31
  297. package/build/esm/observable/internal/Query.js.map +1 -1
  298. package/build/esm/observable/internal/RefCounts.js +7 -2
  299. package/build/esm/observable/internal/RefCounts.js.map +1 -1
  300. package/build/esm/observable/internal/SimpleWhereClause.js +2 -0
  301. package/build/esm/observable/internal/SimpleWhereClause.js.map +1 -0
  302. package/build/esm/observable/internal/Store.js +86 -269
  303. package/build/esm/observable/internal/Store.js.map +1 -1
  304. package/build/esm/observable/internal/Store.test.js +401 -375
  305. package/build/esm/observable/internal/Store.test.js.map +1 -1
  306. package/build/esm/observable/internal/WhereClauseCanonicalizer.js +11 -3
  307. package/build/esm/observable/internal/WhereClauseCanonicalizer.js.map +1 -1
  308. package/build/esm/observable/internal/objectMatchesWhereClause.js +0 -2
  309. package/build/esm/observable/internal/objectMatchesWhereClause.js.map +1 -1
  310. package/build/esm/observable/internal/objectMatchesWhereClause.test.js.map +1 -1
  311. package/build/esm/observable/internal/testUtils.js +85 -20
  312. package/build/esm/observable/internal/testUtils.js.map +1 -1
  313. package/build/esm/ontology/OntologyProvider.js.map +1 -1
  314. package/build/esm/ontology/StandardOntologyProvider.js +12 -5
  315. package/build/esm/ontology/StandardOntologyProvider.js.map +1 -1
  316. package/build/esm/ontology/StandardOntologyProvider.test.js +17 -16
  317. package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -1
  318. package/build/esm/ontology/loadFullObjectMetadata.js +0 -1
  319. package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -1
  320. package/build/esm/ontology/loadQueryMetadata.js +5 -2
  321. package/build/esm/ontology/loadQueryMetadata.js.map +1 -1
  322. package/build/esm/public/internal.js +2 -0
  323. package/build/esm/public/internal.js.map +1 -1
  324. package/build/esm/public/unstable-do-not-use.js +1 -0
  325. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  326. package/build/esm/public-utils/osdkConfig.js +49 -0
  327. package/build/esm/public-utils/osdkConfig.js.map +1 -0
  328. package/build/esm/{object/createObjectSpecifierFromPrimaryKey.js → public-utils/vite-env.d.ts} +2 -3
  329. package/build/esm/queries/applyQuery.js +6 -4
  330. package/build/esm/queries/applyQuery.js.map +1 -1
  331. package/build/esm/queries/queries.test.js +93 -27
  332. package/build/esm/queries/queries.test.js.map +1 -1
  333. package/build/esm/queries/types.js.map +1 -1
  334. package/build/esm/tsserver.js.map +1 -1
  335. package/build/esm/util/UserAgent.js +1 -1
  336. package/build/esm/util/extractRdpDefinition.js +140 -0
  337. package/build/esm/util/extractRdpDefinition.js.map +1 -0
  338. package/build/esm/util/extractRdpDefinition.test.js +233 -0
  339. package/build/esm/util/extractRdpDefinition.test.js.map +1 -0
  340. package/build/{browser/util/isOsdkObject.js → esm/util/isObjectSpecifiersObject.js} +2 -2
  341. package/build/esm/util/isObjectSpecifiersObject.js.map +1 -0
  342. package/build/esm/util/isPoint.js +20 -0
  343. package/build/esm/util/isPoint.js.map +1 -0
  344. package/build/esm/util/objectSpecifierUtils.js +48 -0
  345. package/build/esm/util/objectSpecifierUtils.js.map +1 -0
  346. package/build/esm/util/objectSpecifierUtils.test.js +42 -0
  347. package/build/esm/util/objectSpecifierUtils.test.js.map +1 -0
  348. package/build/esm/util/toDataValue.js +6 -2
  349. package/build/esm/util/toDataValue.js.map +1 -1
  350. package/build/esm/util/toDataValue.test.js +37 -16
  351. package/build/esm/util/toDataValue.test.js.map +1 -1
  352. package/build/esm/util/toDataValueQueries.js +4 -6
  353. package/build/esm/util/toDataValueQueries.js.map +1 -1
  354. package/build/types/MinimalClientContext.d.ts +1 -1
  355. package/build/types/MinimalClientContext.d.ts.map +1 -1
  356. package/build/types/__unstable/ConjureSupport.d.ts +2 -2
  357. package/build/types/actions/applyAction.d.ts +1 -2
  358. package/build/types/actions/applyAction.d.ts.map +1 -1
  359. package/build/types/createClient.d.ts +1 -1
  360. package/build/types/createClient.d.ts.map +1 -1
  361. package/build/types/createClient.test.d.ts +2 -1
  362. package/build/types/createClient.test.d.ts.map +1 -1
  363. package/build/types/createMinimalClientHelper.d.ts +1 -0
  364. package/build/types/createMinimalClientHelper.d.ts.map +1 -0
  365. package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts +1 -0
  366. package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts.map +1 -0
  367. package/build/types/index.d.ts +4 -6
  368. package/build/types/index.d.ts.map +1 -1
  369. package/build/types/intellisense.test.helpers/showsObjectPropertyJsdoc.d.ts +1 -0
  370. package/build/types/intellisense.test.helpers/showsObjectPropertyJsdoc.d.ts.map +1 -0
  371. package/build/types/logger/BaseLogger.d.ts +33 -0
  372. package/build/types/logger/BaseLogger.d.ts.map +1 -0
  373. package/build/types/logger/BrowserLogger.d.ts +9 -0
  374. package/build/types/logger/BrowserLogger.d.ts.map +1 -0
  375. package/build/types/logger/MinimalLogger.d.ts +9 -0
  376. package/build/types/logger/MinimalLogger.d.ts.map +1 -0
  377. package/build/types/logger/MinimalLogger.test.d.ts +1 -0
  378. package/build/types/logger/MinimalLogger.test.d.ts.map +1 -0
  379. package/build/types/logger/TestLogger.d.ts +14 -0
  380. package/build/types/logger/TestLogger.d.ts.map +1 -0
  381. package/build/types/object/SimpleOsdkProperties.d.ts +1 -0
  382. package/build/types/object/SimpleOsdkProperties.d.ts.map +1 -0
  383. package/build/types/object/convertWireToOsdkObjects/BaseHolder.d.ts +1 -0
  384. package/build/types/object/convertWireToOsdkObjects/BaseHolder.d.ts.map +1 -0
  385. package/build/types/object/convertWireToOsdkObjects.d.ts +8 -1
  386. package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -1
  387. package/build/types/object/fetchPage.d.ts.map +1 -1
  388. package/build/types/object/object.test.d.ts.map +1 -1
  389. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
  390. package/build/types/observable/ListPayload.d.ts +5 -9
  391. package/build/types/observable/ListPayload.d.ts.map +1 -1
  392. package/build/types/observable/ObjectPayload.d.ts +4 -7
  393. package/build/types/observable/ObjectPayload.d.ts.map +1 -1
  394. package/build/types/observable/ObservableClient.d.ts +27 -11
  395. package/build/types/observable/ObservableClient.d.ts.map +1 -1
  396. package/build/types/observable/internal/ActionApplication.d.ts +2 -2
  397. package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
  398. package/build/types/observable/internal/BulkObjectLoader.d.ts +8 -0
  399. package/build/types/observable/internal/BulkObjectLoader.d.ts.map +1 -0
  400. package/build/types/observable/internal/BulkObjectLoader.test.d.ts +1 -0
  401. package/build/types/observable/internal/BulkObjectLoader.test.d.ts.map +1 -0
  402. package/build/types/observable/internal/CacheKeys.d.ts +1 -1
  403. package/build/types/observable/internal/CacheKeys.d.ts.map +1 -1
  404. package/build/types/observable/internal/Changes.d.ts +15 -0
  405. package/build/types/observable/internal/Changes.d.ts.map +1 -0
  406. package/build/types/observable/internal/Layer.d.ts +1 -0
  407. package/build/types/observable/internal/Layer.d.ts.map +1 -1
  408. package/build/types/observable/internal/ListQuery.d.ts +59 -14
  409. package/build/types/observable/internal/ListQuery.d.ts.map +1 -1
  410. package/build/types/observable/internal/ObjectQuery.d.ts +5 -6
  411. package/build/types/observable/internal/ObjectQuery.d.ts.map +1 -1
  412. package/build/types/observable/internal/OptimisticJob.d.ts +1 -1
  413. package/build/types/observable/internal/OptimisticJob.d.ts.map +1 -1
  414. package/build/types/observable/internal/OrderByCanonicalizer.d.ts +12 -0
  415. package/build/types/observable/internal/OrderByCanonicalizer.d.ts.map +1 -0
  416. package/build/types/observable/internal/OrderByCanonicalizer.test.d.ts +1 -0
  417. package/build/types/observable/internal/OrderByCanonicalizer.test.d.ts.map +1 -0
  418. package/build/types/observable/internal/Query.d.ts +41 -6
  419. package/build/types/observable/internal/Query.d.ts.map +1 -1
  420. package/build/types/observable/internal/RefCounts.d.ts.map +1 -1
  421. package/build/types/observable/internal/SimpleWhereClause.d.ts +2 -0
  422. package/build/types/observable/internal/SimpleWhereClause.d.ts.map +1 -0
  423. package/build/types/observable/internal/Store.d.ts +20 -44
  424. package/build/types/observable/internal/Store.d.ts.map +1 -1
  425. package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts +2 -1
  426. package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts.map +1 -1
  427. package/build/types/observable/internal/objectMatchesWhereClause.d.ts +4 -2
  428. package/build/types/observable/internal/objectMatchesWhereClause.d.ts.map +1 -1
  429. package/build/types/observable/internal/testUtils.d.ts +39 -10
  430. package/build/types/observable/internal/testUtils.d.ts.map +1 -1
  431. package/build/types/ontology/OntologyProvider.d.ts +1 -1
  432. package/build/types/ontology/OntologyProvider.d.ts.map +1 -1
  433. package/build/types/ontology/loadQueryMetadata.d.ts +1 -1
  434. package/build/types/ontology/loadQueryMetadata.d.ts.map +1 -1
  435. package/build/types/public/internal.d.ts +2 -0
  436. package/build/types/public/internal.d.ts.map +1 -1
  437. package/build/types/public/unstable-do-not-use.d.ts +4 -5
  438. package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
  439. package/build/types/public-utils/osdkConfig.d.ts +8 -0
  440. package/build/types/public-utils/osdkConfig.d.ts.map +1 -0
  441. package/build/types/public-utils/vite-env.d.d.ts +3 -0
  442. package/build/types/public-utils/vite-env.d.d.ts.map +1 -0
  443. package/build/types/queries/applyQuery.d.ts +2 -2
  444. package/build/types/queries/applyQuery.d.ts.map +1 -1
  445. package/build/types/queries/types.d.ts +1 -1
  446. package/build/types/queries/types.d.ts.map +1 -1
  447. package/build/types/tsserver.d.ts +1 -1
  448. package/build/types/tsserver.d.ts.map +1 -1
  449. package/build/types/util/extractRdpDefinition.d.ts +4 -0
  450. package/build/types/util/extractRdpDefinition.d.ts.map +1 -0
  451. package/build/types/util/extractRdpDefinition.test.d.ts +1 -0
  452. package/build/types/util/extractRdpDefinition.test.d.ts.map +1 -0
  453. package/build/types/util/isObjectSpecifiersObject.d.ts +5 -0
  454. package/build/types/util/isObjectSpecifiersObject.d.ts.map +1 -0
  455. package/build/types/util/isPoint.d.ts +1 -0
  456. package/build/types/util/isPoint.d.ts.map +1 -0
  457. package/build/types/util/objectSpecifierUtils.d.ts +24 -0
  458. package/build/types/util/objectSpecifierUtils.d.ts.map +1 -0
  459. package/build/types/util/objectSpecifierUtils.test.d.ts +1 -0
  460. package/build/types/util/objectSpecifierUtils.test.d.ts.map +1 -0
  461. package/package.json +21 -18
  462. package/build/browser/Logger.js +0 -2
  463. package/build/browser/Logger.js.map +0 -1
  464. package/build/browser/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
  465. package/build/browser/observable/internal/ChangedObjects.js.map +0 -1
  466. package/build/browser/util/isOsdkBaseObject.js.map +0 -1
  467. package/build/browser/util/isOsdkObject.js.map +0 -1
  468. package/build/cjs/chunk-IU47QMYO.cjs.map +0 -1
  469. package/build/cjs/chunk-JPENHIJB.cjs.map +0 -1
  470. package/build/cjs/chunk-Q7SFCCGT.cjs +0 -11
  471. package/build/cjs/chunk-Q7SFCCGT.cjs.map +0 -1
  472. package/build/cjs/graphql-RGM5SRWV.cjs +0 -10532
  473. package/build/cjs/graphql-RGM5SRWV.cjs.map +0 -1
  474. package/build/esm/Logger.js +0 -2
  475. package/build/esm/Logger.js.map +0 -1
  476. package/build/esm/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
  477. package/build/esm/observable/internal/ChangedObjects.js.map +0 -1
  478. package/build/esm/util/isOsdkBaseObject.js.map +0 -1
  479. package/build/esm/util/isOsdkObject.js.map +0 -1
  480. package/build/types/Logger.d.ts +0 -17
  481. package/build/types/Logger.d.ts.map +0 -1
  482. package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts +0 -2
  483. package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts.map +0 -1
  484. package/build/types/observable/internal/ChangedObjects.d.ts +0 -11
  485. package/build/types/observable/internal/ChangedObjects.d.ts.map +0 -1
  486. package/build/types/util/isOsdkBaseObject.d.ts +0 -2
  487. package/build/types/util/isOsdkBaseObject.d.ts.map +0 -1
  488. package/build/types/util/isOsdkObject.d.ts +0 -2
  489. package/build/types/util/isOsdkObject.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderByCanonicalizer.test.js","names":["setFlagsFromString","describe","expect","it","vi","runInNewContext","OrderByCanonicalizer","obc","canon1","canonicalize","a","b","canon2","toBe","toEqual","canonShort","canonLong","c","not","callback","fn","args","console","log","f","FinalizationRegistry","register","undefined","gc","waitFor","toHaveBeenCalledExactlyOnceWith"],"sources":["OrderByCanonicalizer.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { setFlagsFromString } from \"v8\";\nimport { describe, expect, it, vi } from \"vitest\";\nimport { runInNewContext } from \"vm\";\nimport { OrderByCanonicalizer } from \"./OrderByCanonicalizer.js\";\n\ndescribe(OrderByCanonicalizer, () => {\n it(\"it canonicalizes\", () => {\n const obc = new OrderByCanonicalizer();\n const canon1 = obc.canonicalize({ a: \"asc\", b: \"desc\" });\n const canon2 = obc.canonicalize({ a: \"asc\", b: \"desc\" });\n\n // Ref equal\n expect(canon1).toBe(canon2);\n\n // Deep equal\n expect(canon1).toEqual({ a: \"asc\", b: \"desc\" });\n\n const canonShort = obc.canonicalize({ a: \"asc\" });\n const canonLong = obc.canonicalize({ a: \"asc\", b: \"desc\", c: \"asc\" });\n\n expect(canonShort).not.toEqual(canon1);\n expect(canonLong).not.toEqual(canon1);\n });\n\n it(\"cleans up\", async () => {\n const callback = vi.fn((...args: any[]) => {\n console.log(\"args\", args);\n });\n const f = new FinalizationRegistry(callback);\n const obc = new OrderByCanonicalizer();\n {\n let canon1 = obc.canonicalize({ a: \"asc\" });\n expect(canon1).toEqual({ a: \"asc\" });\n f.register(canon1, \"hi\");\n canon1 = undefined as any;\n }\n\n // enabling trace-gc\n setFlagsFromString(\"--expose_gc\");\n const gc = runInNewContext(\"gc\");\n\n await vi.waitFor(() => {\n gc();\n expect(callback).toHaveBeenCalledExactlyOnceWith(\"hi\");\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,kBAAkB,QAAQ,IAAI;AACvC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,QAAQ;AACjD,SAASC,eAAe,QAAQ,IAAI;AACpC,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhEL,QAAQ,CAACK,oBAAoB,EAAE,MAAM;EACnCH,EAAE,CAAC,kBAAkB,EAAE,MAAM;IAC3B,MAAMI,GAAG,GAAG,IAAID,oBAAoB,CAAC,CAAC;IACtC,MAAME,MAAM,GAAGD,GAAG,CAACE,YAAY,CAAC;MAAEC,CAAC,EAAE,KAAK;MAAEC,CAAC,EAAE;IAAO,CAAC,CAAC;IACxD,MAAMC,MAAM,GAAGL,GAAG,CAACE,YAAY,CAAC;MAAEC,CAAC,EAAE,KAAK;MAAEC,CAAC,EAAE;IAAO,CAAC,CAAC;;IAExD;IACAT,MAAM,CAACM,MAAM,CAAC,CAACK,IAAI,CAACD,MAAM,CAAC;;IAE3B;IACAV,MAAM,CAACM,MAAM,CAAC,CAACM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,CAACiB,QAAQ,CAAC,CAACW,+BAA+B,CAAC,IAAI,CAAC;IACxD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -37,62 +37,75 @@ export class Query {
37
37
  this.#subscription = this.#connectable.connect();
38
38
  return this.#connectable.subscribe(observer);
39
39
  }
40
- revalidate(force) {
41
- if (process.env.NODE_ENV !== "production") {
42
- this.logger?.info({
43
- methodName: "revalidate"
44
- });
45
- }
40
+
41
+ /**
42
+ * Causes the query to revalidate. This will cause the query to fetch
43
+ * the latest data from the server and update the store if it is deemed
44
+ * "stale" or if `force` is true.
45
+ *
46
+ * @param force
47
+ * @returns
48
+ */
49
+ async revalidate(force) {
50
+ const logger = process.env.NODE_ENV !== "production" ? this.logger?.child({
51
+ methodName: "revalidate"
52
+ }) : this.logger;
46
53
  if (force) {
47
54
  this.abortController?.abort();
48
55
  }
49
56
 
50
- // if we are pending the first page we can just ignore this
57
+ // n.b. I think this isn't quite right since we may require multiple
58
+ // pages to properly "revalidate" for someone. This only really works if you
59
+ // have a single page/object. It needs to be redone. FIXME
60
+
61
+ // if we are pending the first page/object we can just ignore this
51
62
  if (this.pendingFetch) {
52
- return this.pendingFetch;
63
+ if (process.env.NODE_ENV !== "production") {
64
+ logger?.info("Fetch is already pending, using it");
65
+ }
66
+ await this.pendingFetch;
67
+ return;
53
68
  }
54
69
  if ((this.options.dedupeInterval ?? 0) > 0 && this.lastFetchStarted != null && Date.now() - this.lastFetchStarted < (this.options.dedupeInterval ?? 0)) {
55
70
  if (process.env.NODE_ENV !== "production") {
56
- this.logger?.trace({
57
- methodName: "revalidate"
58
- }, "DEDUPE");
71
+ logger?.debug("Within dupeInterval, aborting revalidate");
59
72
  }
60
73
  return Promise.resolve();
61
74
  }
75
+ if (process.env.NODE_ENV !== "production") {
76
+ logger?.debug("Starting actual revalidate");
77
+ }
62
78
  this.store.batch({}, batch => {
79
+ // make sure the truth layer knows we are loading
80
+
81
+ // this will not trigger an update to `changes` so it cannot trigger an
82
+ // update of a list either. This may not be the behavior we want.
63
83
  this.setStatus("loading", batch);
64
84
  });
65
85
  this._preFetch();
66
86
  this.lastFetchStarted = Date.now();
67
87
  if (process.env.NODE_ENV !== "production") {
68
- this.logger?.trace({
69
- methodName: "revalidate"
70
- }, "calling _fetch()");
88
+ logger?.debug("calling _fetchAndStore()");
71
89
  }
72
- this.pendingFetch = this._fetch().catch(e => {
73
- this.logger?.error({
74
- methodName: "revalidate"
75
- }, "_fetch() FAILED", e);
76
- throw e;
77
- }).finally(() => {
78
- this.logger?.info({
79
- methodName: "revalidate"
80
- }, "finally _fetch()");
90
+ this.pendingFetch = this._fetchAndStore().finally(() => {
91
+ logger?.info("finally _fetchAndStore()");
81
92
  this.pendingFetch = undefined;
82
93
  });
83
- if (process.env.NODE_ENV !== "production") {
84
- this.logger?.info({
85
- methodName: "revalidate"
86
- }, "Returning");
87
- }
88
- return this.pendingFetch;
94
+ await this.pendingFetch;
89
95
  }
90
96
  _preFetch() {}
97
+ /**
98
+ * Sets the status of the query in the store (but does not store that in `changes`).
99
+ *
100
+ * @param status
101
+ * @param batch
102
+ * @returns
103
+ */
91
104
  setStatus(status, batch) {
92
105
  if (process.env.NODE_ENV !== "production") {
93
- this.logger?.trace({
106
+ this.logger?.child({
94
107
  methodName: "setStatus"
95
- }, status);
108
+ }).debug(status);
96
109
  }
97
110
  const existing = batch.read(this.cacheKey);
98
111
  if (existing?.status === status) return;
@@ -105,6 +118,26 @@ export class Query {
105
118
  this.#subscription?.unsubscribe();
106
119
  this._dispose();
107
120
  }
121
+
122
+ /**
123
+ * Per query type dispose functionality
124
+ */
108
125
  _dispose() {}
126
+
127
+ /**
128
+ * The purpose of this method is to provide a way for others to write
129
+ * directly into the store for this query.
130
+ *
131
+ * @param data
132
+ * @param status
133
+ * @param batch
134
+ */
135
+
136
+ /**
137
+ * @param changes
138
+ * @param optimisticId
139
+ * @returns If revalidation is needed, a promise that resolves after the
140
+ * revalidation is complete. Otherwise, undefined.
141
+ */
109
142
  }
110
143
  //# sourceMappingURL=Query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Query.js","names":["additionalContext","Query","retainCount","connectable","subscription","subject","constructor","store","observable","opts","cacheKey","logger","options","process","env","NODE_ENV","client","child","msgPrefix","type","otherKeys","map","x","JSON","stringify","join","subscribe","observer","_createConnectable","connect","revalidate","force","info","methodName","abortController","abort","pendingFetch","dedupeInterval","lastFetchStarted","Date","now","trace","Promise","resolve","batch","setStatus","_preFetch","_fetch","catch","e","error","finally","undefined","status","existing","read","write","value","dispose","unsubscribe","_dispose"],"sources":["Query.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n Connectable,\n Observable,\n Observer,\n Subscribable,\n Subscription,\n} from \"rxjs\";\nimport { additionalContext } from \"../../Client.js\";\nimport type { Logger } from \"../../Logger.js\";\nimport type { CommonObserveOptions, Status } from \"../ObservableClient.js\";\nimport type { CacheKey } from \"./CacheKey.js\";\nimport type { Entry } from \"./Layer.js\";\nimport type { BatchContext, Store, SubjectPayload } from \"./Store.js\";\n\nexport abstract class Query<\n KEY extends CacheKey,\n PAYLOAD,\n O extends CommonObserveOptions,\n> implements Subscribable<PAYLOAD> {\n lastFetchStarted?: number;\n pendingFetch?: Promise<unknown>;\n retainCount: number = 0;\n options: O;\n cacheKey: KEY;\n store: Store;\n abortController?: AbortController;\n #connectable?: Connectable<PAYLOAD>;\n #subscription?: Subscription;\n #subject: Observable<SubjectPayload<KEY>>;\n\n /** @internal */\n protected logger: Logger | undefined;\n\n constructor(\n store: Store,\n observable: Observable<SubjectPayload<KEY>>,\n opts: O,\n cacheKey: KEY,\n logger?: Logger,\n ) {\n this.options = opts;\n this.cacheKey = cacheKey;\n this.store = store;\n this.#subject = observable;\n\n this.logger = logger ?? (\n process.env.NODE_ENV === \"production\"\n ? store.client[additionalContext].logger\n : store.client[additionalContext].logger?.child({}, {\n msgPrefix: process.env.NODE_ENV !== \"production\"\n ? (`Query<${cacheKey.type}, ${\n cacheKey.otherKeys.map(x => JSON.stringify(x)).join(\", \")\n }>`)\n : \"Query\",\n })\n );\n }\n\n protected abstract _createConnectable(\n subject: Observable<SubjectPayload<KEY>>,\n ): Connectable<PAYLOAD>;\n\n public subscribe(\n observer: Partial<Observer<PAYLOAD>>,\n ): Subscription {\n this.#connectable ??= this._createConnectable(this.#subject);\n this.#subscription = this.#connectable.connect();\n return this.#connectable.subscribe(observer);\n }\n\n revalidate(force?: boolean): Promise<unknown> {\n if (process.env.NODE_ENV !== \"production\") {\n this.logger?.info({ methodName: \"revalidate\" });\n }\n\n if (force) {\n this.abortController?.abort();\n }\n\n // if we are pending the first page we can just ignore this\n if (this.pendingFetch) {\n return this.pendingFetch;\n }\n\n if (\n (this.options.dedupeInterval ?? 0) > 0 && (\n this.lastFetchStarted != null\n && Date.now() - this.lastFetchStarted < (this.options.dedupeInterval\n ?? 0)\n )\n ) {\n if (process.env.NODE_ENV !== \"production\") {\n this.logger?.trace({ methodName: \"revalidate\" }, \"DEDUPE\");\n }\n\n return Promise.resolve();\n }\n\n this.store.batch({}, (batch) => {\n this.setStatus(\"loading\", batch);\n });\n\n this._preFetch();\n\n this.lastFetchStarted = Date.now();\n\n if (process.env.NODE_ENV !== \"production\") {\n this.logger?.trace({ methodName: \"revalidate\" }, \"calling _fetch()\");\n }\n this.pendingFetch = this._fetch()\n .catch((e) => {\n this.logger?.error({ methodName: \"revalidate\" }, \"_fetch() FAILED\", e);\n throw e;\n })\n .finally(() => {\n this.logger?.info({ methodName: \"revalidate\" }, \"finally _fetch()\");\n this.pendingFetch = undefined;\n });\n\n if (process.env.NODE_ENV !== \"production\") {\n this.logger?.info({ methodName: \"revalidate\" }, \"Returning\");\n }\n\n return this.pendingFetch;\n }\n\n _preFetch(): void {}\n abstract _fetch(): Promise<unknown>;\n\n setStatus(\n status: Status,\n batch: BatchContext,\n ): void {\n if (process.env.NODE_ENV !== \"production\") {\n this.logger?.trace({ methodName: \"setStatus\" }, status);\n }\n const existing = batch.read(this.cacheKey);\n if (existing?.status === status) return;\n\n batch.write(this.cacheKey, existing?.value, status);\n }\n\n dispose(): void {\n if (this.abortController) {\n this.abortController.abort();\n }\n this.#subscription?.unsubscribe();\n this._dispose();\n }\n\n _dispose(): void {}\n\n abstract writeToStore(\n data: KEY[\"__cacheKey\"][\"value\"],\n status: Status,\n batch: BatchContext,\n ): Entry<KEY>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,iBAAiB,QAAQ,iBAAiB;AAOnD,OAAO,MAAeC,KAAK,CAIQ;EAGjCC,WAAW,GAAW,CAAC;EAKvB,CAACC,WAAW;EACZ,CAACC,YAAY;EACb,CAACC,OAAO;;EAER;;EAGAC,WAAWA,CACTC,KAAY,EACZC,UAA2C,EAC3CC,IAAO,EACPC,QAAa,EACbC,MAAe,EACf;IACA,IAAI,CAACC,OAAO,GAAGH,IAAI;IACnB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACH,KAAK,GAAGA,KAAK;IAClB,IAAI,CAAC,CAACF,OAAO,GAAGG,UAAU;IAE1B,IAAI,CAACG,MAAM,GAAGA,MAAM,KAClBE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACjCR,KAAK,CAACS,MAAM,CAAChB,iBAAiB,CAAC,CAACW,MAAM,GACtCJ,KAAK,CAACS,MAAM,CAAChB,iBAAiB,CAAC,CAACW,MAAM,EAAEM,KAAK,C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AASA,CACPQ,MAAc,EACdT,KAAmB,EACb;IACN,IAAI/B,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;MACzC,IAAI,CAACJ,MAAM,EAAE8B,KAAK,CAAC;QAAER,UAAU,EAAE;MAAY,CAAC,EAAEoB,MAAM,CAAC;IACzD;IACA,MAAMC,QAAQ,GAAGV,KAAK,CAACW,IAAI,CAAC,IAAI,CAAC7C,QAAQ,CAAC;IAC1C,IAAI4C,QAAQ,EAAED,MAAM,KAAKA,MAAM,EAAE;IAEjCT,KAAK,CAACY,KAAK,CAAC,IAAI,CAAC9C,QAAQ,EAAE4C,QAAQ,EAAEG,KAAK,EAAEJ,MAAM,CAAC;EACrD;EAEAK,OAAOA,CAAA,EAAS;IACd,IAAI,IAAI,CAACxB,eAAe,EAAE;MACxB,IAAI,CAACA,eAAe,CAACC,KAAK,CAAC,CAAC;IAC9B;IACA,IAAI,CAAC,CAAC/B,YAAY,EAAEuD,WAAW,CAAC,CAAC;IACjC,IAAI,CAACC,QAAQ,CAAC,CAAC;EACjB;EAEAA,QAAQA,CAAA,EAAS,CAAC;AAOpB","ignoreList":[]}
1
+ {"version":3,"file":"Query.js","names":["additionalContext","Query","retainCount","connectable","subscription","subject","constructor","store","observable","opts","cacheKey","logger","options","process","env","NODE_ENV","client","child","msgPrefix","type","otherKeys","map","x","JSON","stringify","join","subscribe","observer","_createConnectable","connect","revalidate","force","methodName","abortController","abort","pendingFetch","info","dedupeInterval","lastFetchStarted","Date","now","debug","Promise","resolve","batch","setStatus","_preFetch","_fetchAndStore","finally","undefined","status","existing","read","write","value","dispose","unsubscribe","_dispose"],"sources":["Query.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Logger } from \"@osdk/api\";\nimport type {\n Connectable,\n Observable,\n Observer,\n Subscribable,\n Subscription,\n} from \"rxjs\";\nimport { additionalContext } from \"../../Client.js\";\nimport type { CommonObserveOptions, Status } from \"../ObservableClient.js\";\nimport type { CacheKey } from \"./CacheKey.js\";\nimport type { Changes } from \"./Changes.js\";\nimport type { Entry } from \"./Layer.js\";\nimport type { OptimisticId } from \"./OptimisticId.js\";\nimport type { BatchContext, Store, SubjectPayload } from \"./Store.js\";\n\nexport abstract class Query<\n KEY extends CacheKey,\n PAYLOAD,\n O extends CommonObserveOptions,\n> implements Subscribable<PAYLOAD> {\n lastFetchStarted?: number;\n pendingFetch?: Promise<unknown>;\n retainCount: number = 0;\n options: O;\n cacheKey: KEY;\n store: Store;\n abortController?: AbortController;\n #connectable?: Connectable<PAYLOAD>;\n #subscription?: Subscription;\n #subject: Observable<SubjectPayload<KEY>>;\n\n /** @internal */\n protected logger: Logger | undefined;\n\n constructor(\n store: Store,\n observable: Observable<SubjectPayload<KEY>>,\n opts: O,\n cacheKey: KEY,\n logger?: Logger,\n ) {\n this.options = opts;\n this.cacheKey = cacheKey;\n this.store = store;\n this.#subject = observable;\n\n this.logger = logger ?? (\n process.env.NODE_ENV === \"production\"\n ? store.client[additionalContext].logger\n : store.client[additionalContext].logger?.child({}, {\n msgPrefix: process.env.NODE_ENV !== \"production\"\n ? (`Query<${cacheKey.type}, ${\n cacheKey.otherKeys.map(x => JSON.stringify(x)).join(\", \")\n }>`)\n : \"Query\",\n })\n );\n }\n\n protected abstract _createConnectable(\n subject: Observable<SubjectPayload<KEY>>,\n ): Connectable<PAYLOAD>;\n\n public subscribe(\n observer: Observer<PAYLOAD>,\n ): Subscription {\n this.#connectable ??= this._createConnectable(this.#subject);\n this.#subscription = this.#connectable.connect();\n return this.#connectable.subscribe(observer);\n }\n\n /**\n * Causes the query to revalidate. This will cause the query to fetch\n * the latest data from the server and update the store if it is deemed\n * \"stale\" or if `force` is true.\n *\n * @param force\n * @returns\n */\n async revalidate(force?: boolean): Promise<void> {\n const logger = process.env.NODE_ENV !== \"production\"\n ? this.logger?.child({ methodName: \"revalidate\" })\n : this.logger;\n\n if (force) {\n this.abortController?.abort();\n }\n\n // n.b. I think this isn't quite right since we may require multiple\n // pages to properly \"revalidate\" for someone. This only really works if you\n // have a single page/object. It needs to be redone. FIXME\n\n // if we are pending the first page/object we can just ignore this\n if (this.pendingFetch) {\n if (process.env.NODE_ENV !== \"production\") {\n logger?.info(\"Fetch is already pending, using it\");\n }\n await this.pendingFetch;\n return;\n }\n\n if (\n (this.options.dedupeInterval ?? 0) > 0 && (\n this.lastFetchStarted != null\n && Date.now() - this.lastFetchStarted < (this.options.dedupeInterval\n ?? 0)\n )\n ) {\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\"Within dupeInterval, aborting revalidate\");\n }\n\n return Promise.resolve();\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\"Starting actual revalidate\");\n }\n\n this.store.batch({}, (batch) => {\n // make sure the truth layer knows we are loading\n\n // this will not trigger an update to `changes` so it cannot trigger an\n // update of a list either. This may not be the behavior we want.\n this.setStatus(\"loading\", batch);\n });\n\n this._preFetch();\n\n this.lastFetchStarted = Date.now();\n\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\"calling _fetchAndStore()\");\n }\n this.pendingFetch = this._fetchAndStore()\n .finally(() => {\n logger?.info(\"finally _fetchAndStore()\");\n this.pendingFetch = undefined;\n });\n\n await this.pendingFetch;\n return;\n }\n\n protected _preFetch(): void {}\n\n protected abstract _fetchAndStore(): Promise<unknown>;\n\n /**\n * Sets the status of the query in the store (but does not store that in `changes`).\n *\n * @param status\n * @param batch\n * @returns\n */\n setStatus(\n status: Status,\n batch: BatchContext,\n ): void {\n if (process.env.NODE_ENV !== \"production\") {\n this.logger?.child({ methodName: \"setStatus\" }).debug(status);\n }\n const existing = batch.read(this.cacheKey);\n if (existing?.status === status) return;\n\n batch.write(this.cacheKey, existing?.value, status);\n }\n\n dispose(): void {\n if (this.abortController) {\n this.abortController.abort();\n }\n this.#subscription?.unsubscribe();\n this._dispose();\n }\n\n /**\n * Per query type dispose functionality\n */\n protected _dispose(): void {}\n\n /**\n * The purpose of this method is to provide a way for others to write\n * directly into the store for this query.\n *\n * @param data\n * @param status\n * @param batch\n */\n abstract writeToStore(\n data: KEY[\"__cacheKey\"][\"value\"],\n status: Status,\n batch: BatchContext,\n ): Entry<KEY>;\n\n /**\n * @param changes\n * @param optimisticId\n * @returns If revalidation is needed, a promise that resolves after the\n * revalidation is complete. Otherwise, undefined.\n */\n maybeUpdateAndRevalidate?: (\n changes: Changes,\n optimisticId: OptimisticId | undefined,\n ) => Promise<void> | undefined;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,iBAAiB,QAAQ,iBAAiB;AAQnD,OAAO,MAAeC,KAAK,CAIQ;EAGjCC,WAAW,GAAW,CAAC;EAKvB,CAACC,WAAW;EACZ,CAACC,YAAY;EACb,CAACC,OAAO;;EAER;;EAGAC,WAAWA,CACTC,KAAY,EACZC,UAA2C,EAC3CC,IAAO,EACPC,QAAa,EACbC,MAAe,EACf;IACA,IAAI,CAACC,OAAO,GAAGH,IAAI;IACnB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACH,KAAK,GAAGA,KAAK;IAClB,IAAI,CAAC,CAACF,OAAO,GAAGG,UAAU;IAE1B,IAAI,CAACG,MAAM,GAAGA,MAAM,KAClBE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACjCR,KAAK,CAACS,MAAM,CAAChB,iBAAiB,CAAC,CAACW,MAAM,GACtCJ,KAAK,CAACS,MAAM,CAAChB,iBAAiB,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,KAAK,YAAY,EAAE;MACzC,IAAI,CAACJ,MAAM,EAAEM,KAAK,CAAC;QAAEe,UAAU,EAAE;MAAY,CAAC,CAAC,CAACS,KAAK,CAACS,MAAM,CAAC;IAC/D;IACA,MAAMC,QAAQ,GAAGP,KAAK,CAACQ,IAAI,CAAC,IAAI,CAAC1C,QAAQ,CAAC;IAC1C,IAAIyC,QAAQ,EAAED,MAAM,KAAKA,MAAM,EAAE;IAEjCN,KAAK,CAACS,KAAK,CAAC,IAAI,CAAC3C,QAAQ,EAAEyC,QAAQ,EAAEG,KAAK,EAAEJ,MAAM,CAAC;EACrD;EAEAK,OAAOA,CAAA,EAAS;IACd,IAAI,IAAI,CAACtB,eAAe,EAAE;MACxB,IAAI,CAACA,eAAe,CAACC,KAAK,CAAC,CAAC;IAC9B;IACA,IAAI,CAAC,CAAC9B,YAAY,EAAEoD,WAAW,CAAC,CAAC;IACjC,IAAI,CAACC,QAAQ,CAAC,CAAC;EACjB;;EAEA;AACF;AACA;EACYA,QAAQA,CAAA,EAAS,CAAC;;EAE5B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAOE;AACF;AACA;AACA;AACA;AACA;AAKA","ignoreList":[]}
@@ -39,8 +39,13 @@ export class RefCounts {
39
39
  }
40
40
  }
41
41
  release(key) {
42
- const count = this.refCounts.get(key) ?? 0;
43
- if (count === 1) {
42
+ const count = this.refCounts.get(key);
43
+ if (count === undefined) {
44
+ // TODO we should trace here if this happens because it likely means
45
+ // someone unsubscribed twice and I don't know if we should treat that as
46
+ // a potential error or not
47
+ // throw new Error("RefCounts.release() - key not found", key);
48
+ } else if (count === 1) {
44
49
  this.refCounts.delete(key);
45
50
  this.gcMap.set(key, Date.now() + this.keepAlive);
46
51
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"RefCounts.js","names":["DEBUG_REFCOUNTS","RefCounts","refCounts","Map","gcMap","constructor","keepAlive","cleanup","register","key","has","set","Date","now","retain","count","get","delete","release","gc","console","debug","JSON","stringify","deathTime"],"sources":["RefCounts.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DEBUG_REFCOUNTS } from \"../DebugFlags.js\";\n\nexport class RefCounts<T extends {}> {\n private refCounts = new Map<T, number>();\n\n // keeps our objects around for some extended duration after they are no longer\n // needed which is good for quick clicks across tabs.\n private gcMap = new Map<T, number /* death time */>();\n\n constructor(private keepAlive: number, private cleanup: (key: T) => void) {\n }\n\n register<X extends T>(key: X): X {\n if (!this.refCounts.has(key)) {\n this.gcMap.set(key, Date.now() + this.keepAlive);\n }\n\n return key;\n }\n\n retain(key: T): void {\n const count = this.refCounts.get(key) ?? 0;\n this.refCounts.set(key, count + 1);\n if (this.gcMap.has(key)) {\n this.gcMap.delete(key);\n }\n }\n\n release(key: T): void {\n const count = this.refCounts.get(key) ?? 0;\n if (count === 1) {\n this.refCounts.delete(key);\n this.gcMap.set(key, Date.now() + this.keepAlive);\n } else {\n this.refCounts.set(key, count - 1);\n }\n }\n\n has(key: T): boolean {\n return this.refCounts.has(key);\n }\n\n gc(): void {\n const now = Date.now();\n\n if (DEBUG_REFCOUNTS) {\n for (const [key, count] of this.refCounts) {\n // eslint-disable-next-line no-console\n console.debug(\"RefCounts.gc() - counts: \", JSON.stringify(key), count);\n }\n }\n\n for (const [key, deathTime] of this.gcMap) {\n if (DEBUG_REFCOUNTS && deathTime >= now) {\n // eslint-disable-next-line no-console\n console.debug(\n \"RefCounts.gc() - ttl \",\n JSON.stringify(key),\n deathTime - now,\n );\n }\n\n if (deathTime < now) {\n if (DEBUG_REFCOUNTS) {\n // eslint-disable-next-line no-console\n console.debug(\n \"RefCounts.gc() - registering cleaning up\",\n JSON.stringify(key),\n );\n }\n this.gcMap.delete(key);\n this.cleanup(key);\n }\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,kBAAkB;AAElD,OAAO,MAAMC,SAAS,CAAe;EAC3BC,SAAS,GAAG,IAAIC,GAAG,CAAY,CAAC;;EAExC;EACA;EACQC,KAAK,GAAG,IAAID,GAAG,CAA6B,CAAC;EAErDE,WAAWA,CAASC,SAAiB,EAAUC,OAAyB,EAAE;IAAA,KAAtDD,SAAiB,GAAjBA,SAAiB;IAAA,KAAUC,OAAyB,GAAzBA,OAAyB;EACxE;EAEAC,QAAQA,CAAcC,GAAM,EAAK;IAC/B,IAAI,CAAC,IAAI,CAACP,SAAS,CAACQ,GAAG,CAACD,GAAG,CAAC,EAAE;MAC5B,IAAI,CAACL,KAAK,CAACO,GAAG,CAACF,GAAG,EAAEG,IAAI,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI,CAACP,SAAS,CAAC;IAClD;IAEA,OAAOG,GAAG;EACZ;EAEAK,MAAMA,CAACL,GAAM,EAAQ;IACnB,MAAMM,KAAK,GAAG,IAAI,CAACb,SAAS,CAACc,GAAG,CAACP,GAAG,CAAC,IAAI,CAAC;IAC1C,IAAI,CAACP,SAAS,CAACS,GAAG,CAACF,GAAG,EAAEM,KAAK,GAAG,CAAC,CAAC;IAClC,IAAI,IAAI,CAACX,KAAK,CAACM,GAAG,CAACD,GAAG,CAAC,EAAE;MACvB,IAAI,CAACL,KAAK,CAACa,MAAM,CAACR,GAAG,CAAC;IACxB;EACF;EAEAS,OAAOA,CAACT,GAAM,EAAQ;IACpB,MAAMM,KAAK,GAAG,IAAI,CAACb,SAAS,CAACc,GAAG,CAACP,GAAG,CAAC,IAAI,CAAC;IAC1C,IAA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B;IACF;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"RefCounts.js","names":["DEBUG_REFCOUNTS","RefCounts","refCounts","Map","gcMap","constructor","keepAlive","cleanup","register","key","has","set","Date","now","retain","count","get","delete","release","undefined","gc","console","debug","JSON","stringify","deathTime"],"sources":["RefCounts.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DEBUG_REFCOUNTS } from \"../DebugFlags.js\";\n\nexport class RefCounts<T extends {}> {\n private refCounts = new Map<T, number>();\n\n // keeps our objects around for some extended duration after they are no longer\n // needed which is good for quick clicks across tabs.\n private gcMap = new Map<T, number /* death time */>();\n\n constructor(private keepAlive: number, private cleanup: (key: T) => void) {\n }\n\n register<X extends T>(key: X): X {\n if (!this.refCounts.has(key)) {\n this.gcMap.set(key, Date.now() + this.keepAlive);\n }\n\n return key;\n }\n\n retain(key: T): void {\n const count = this.refCounts.get(key) ?? 0;\n this.refCounts.set(key, count + 1);\n if (this.gcMap.has(key)) {\n this.gcMap.delete(key);\n }\n }\n\n release(key: T): void {\n const count = this.refCounts.get(key);\n\n if (count === undefined) {\n // TODO we should trace here if this happens because it likely means\n // someone unsubscribed twice and I don't know if we should treat that as\n // a potential error or not\n // throw new Error(\"RefCounts.release() - key not found\", key);\n } else if (count === 1) {\n this.refCounts.delete(key);\n this.gcMap.set(key, Date.now() + this.keepAlive);\n } else {\n this.refCounts.set(key, count - 1);\n }\n }\n\n has(key: T): boolean {\n return this.refCounts.has(key);\n }\n\n gc(): void {\n const now = Date.now();\n\n if (DEBUG_REFCOUNTS) {\n for (const [key, count] of this.refCounts) {\n // eslint-disable-next-line no-console\n console.debug(\"RefCounts.gc() - counts: \", JSON.stringify(key), count);\n }\n }\n\n for (const [key, deathTime] of this.gcMap) {\n if (DEBUG_REFCOUNTS && deathTime >= now) {\n // eslint-disable-next-line no-console\n console.debug(\n \"RefCounts.gc() - ttl \",\n JSON.stringify(key),\n deathTime - now,\n );\n }\n\n if (deathTime < now) {\n if (DEBUG_REFCOUNTS) {\n // eslint-disable-next-line no-console\n console.debug(\n \"RefCounts.gc() - registering cleaning up\",\n JSON.stringify(key),\n );\n }\n this.gcMap.delete(key);\n this.cleanup(key);\n }\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,kBAAkB;AAElD,OAAO,MAAMC,SAAS,CAAe;EAC3BC,SAAS,GAAG,IAAIC,GAAG,CAAY,CAAC;;EAExC;EACA;EACQC,KAAK,GAAG,IAAID,GAAG,CAA6B,CAAC;EAErDE,WAAWA,CAASC,SAAiB,EAAUC,OAAyB,EAAE;IAAA,KAAtDD,SAAiB,GAAjBA,SAAiB;IAAA,KAAUC,OAAyB,GAAzBA,OAAyB;EACxE;EAEAC,QAAQA,CAAcC,GAAM,EAAK;IAC/B,IAAI,CAAC,IAAI,CAACP,SAAS,CAACQ,GAAG,CAACD,GAAG,CAAC,EAAE;MAC5B,IAAI,CAACL,KAAK,CAACO,GAAG,CAACF,GAAG,EAAEG,IAAI,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI,CAACP,SAAS,CAAC;IAClD;IAEA,OAAOG,GAAG;EACZ;EAEAK,MAAMA,CAACL,GAAM,EAAQ;IACnB,MAAMM,KAAK,GAAG,IAAI,CAACb,SAAS,CAACc,GAAG,CAACP,GAAG,CAAC,IAAI,CAAC;IAC1C,IAAI,CAACP,SAAS,CAACS,GAAG,CAACF,GAAG,EAAEM,KAA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B,EACvBC,IAAI,CAACC,SAAS,CAACf,GAAG,CAAC,EACnBgB,SAAS,GAAGZ,GACd,CAAC;MACH;MAEA,IAAIY,SAAS,GAAGZ,GAAG,EAAE;QACnB,IAAIb,eAAe,EAAE;UACnB;UACAqB,OAAO,CAACC,KAAK,CACX,0CAA0C,EAC1CC,IAAI,CAACC,SAAS,CAACf,GAAG,CACpB,CAAC;QACH;QACA,IAAI,CAACL,KAAK,CAACa,MAAM,CAACR,GAAG,CAAC;QACtB,IAAI,CAACF,OAAO,CAACE,GAAG,CAAC;MACnB;IACF;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SimpleWhereClause.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleWhereClause.js","names":[],"sources":["SimpleWhereClause.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { WhereClause } from \"@osdk/api\";\n\nexport type SimpleWhereClause = WhereClause<\n any\n>;\n"],"mappings":"","ignoreList":[]}