doover-js 0.11.0 → 0.13.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 (389) hide show
  1. package/README.md +106 -0
  2. package/dist/apis/_args.js +5 -5
  3. package/dist/apis/agents-api.d.ts +4 -4
  4. package/dist/apis/agents-api.js +2 -2
  5. package/dist/apis/aggregates-api.d.ts +4 -4
  6. package/dist/apis/aggregates-api.js +5 -5
  7. package/dist/apis/alarms-api.d.ts +2 -2
  8. package/dist/apis/alarms-api.js +3 -3
  9. package/dist/apis/channels-api.d.ts +3 -3
  10. package/dist/apis/channels-api.js +6 -6
  11. package/dist/apis/connections-api.d.ts +2 -2
  12. package/dist/apis/connections-api.js +6 -6
  13. package/dist/apis/messages-api.d.ts +4 -4
  14. package/dist/apis/messages-api.js +11 -11
  15. package/dist/apis/notifications-api.d.ts +2 -2
  16. package/dist/apis/notifications-api.js +4 -4
  17. package/dist/apis/organisations-api.d.ts +2 -2
  18. package/dist/apis/permissions-api.d.ts +2 -2
  19. package/dist/apis/permissions-api.js +3 -3
  20. package/dist/apis/processors-api.d.ts +2 -2
  21. package/dist/apis/turn-api.d.ts +2 -2
  22. package/dist/apis/users-api.d.ts +2 -2
  23. package/dist/auth/auth-store.d.ts +1 -1
  24. package/dist/auth/build-auth.d.ts +3 -3
  25. package/dist/auth/build-auth.js +8 -8
  26. package/dist/auth/cookie-auth.d.ts +1 -1
  27. package/dist/auth/cookie-auth.js +2 -2
  28. package/dist/auth/doover-auth.d.ts +2 -2
  29. package/dist/auth/doover-token-auth.d.ts +3 -3
  30. package/dist/auth/doover-token-auth.js +13 -13
  31. package/dist/auth/index.d.ts +10 -0
  32. package/dist/auth/index.js +15 -0
  33. package/dist/client/data-client.d.ts +17 -14
  34. package/dist/client/doover-client.d.ts +9 -7
  35. package/dist/client/doover-client.js +44 -42
  36. package/dist/client/errors.d.ts +2 -2
  37. package/dist/client/errors.js +4 -4
  38. package/dist/client/index.d.ts +6 -0
  39. package/dist/client/index.js +12 -0
  40. package/dist/client/local-agent-client.d.ts +3 -3
  41. package/dist/client/local-agent-client.js +19 -19
  42. package/dist/client/multiplex-client.d.ts +5 -5
  43. package/dist/client/multiplex-client.js +25 -25
  44. package/dist/client/multiplex-gateway.d.ts +3 -3
  45. package/dist/client/multiplex-merge.d.ts +1 -1
  46. package/dist/client/network-status.d.ts +17 -0
  47. package/dist/client/network-status.js +70 -0
  48. package/dist/client/offline-cache.d.ts +9 -4
  49. package/dist/client/offline-cache.js +34 -22
  50. package/dist/client/provenance.d.ts +1 -1
  51. package/dist/client/request-options.d.ts +1 -1
  52. package/dist/client/singleton.d.ts +2 -2
  53. package/dist/client/singleton.js +2 -2
  54. package/dist/client/status-tracker.d.ts +1 -1
  55. package/dist/esm/apis/_args.d.ts +16 -0
  56. package/dist/esm/apis/_args.js +27 -0
  57. package/dist/esm/apis/agents-api.d.ts +196 -0
  58. package/dist/esm/apis/agents-api.js +327 -0
  59. package/dist/esm/apis/aggregates-api.d.ts +67 -0
  60. package/dist/esm/apis/aggregates-api.js +64 -0
  61. package/dist/esm/apis/alarms-api.d.ts +48 -0
  62. package/dist/esm/apis/alarms-api.js +75 -0
  63. package/dist/esm/apis/channels-api.d.ts +83 -0
  64. package/dist/esm/apis/channels-api.js +65 -0
  65. package/dist/esm/apis/connections-api.d.ts +45 -0
  66. package/dist/esm/apis/connections-api.js +44 -0
  67. package/dist/esm/apis/messages-api.d.ts +128 -0
  68. package/dist/esm/apis/messages-api.js +179 -0
  69. package/dist/esm/apis/notifications-api.d.ts +94 -0
  70. package/dist/esm/apis/notifications-api.js +153 -0
  71. package/dist/esm/apis/organisations-api.d.ts +26 -0
  72. package/dist/esm/apis/organisations-api.js +41 -0
  73. package/dist/esm/apis/permissions-api.d.ts +17 -0
  74. package/dist/esm/apis/permissions-api.js +23 -0
  75. package/dist/esm/apis/processors-api.d.ts +56 -0
  76. package/dist/esm/apis/processors-api.js +97 -0
  77. package/dist/esm/apis/turn-api.d.ts +7 -0
  78. package/dist/esm/apis/turn-api.js +8 -0
  79. package/dist/esm/apis/users-api.d.ts +8 -0
  80. package/dist/esm/apis/users-api.js +9 -0
  81. package/dist/esm/auth/auth-profile.d.ts +45 -0
  82. package/dist/esm/auth/auth-profile.js +68 -0
  83. package/dist/esm/auth/auth-store.d.ts +14 -0
  84. package/dist/esm/auth/build-auth.d.ts +38 -0
  85. package/dist/esm/auth/build-auth.js +92 -0
  86. package/dist/esm/auth/cookie-auth.d.ts +91 -0
  87. package/dist/esm/auth/cookie-auth.js +196 -0
  88. package/dist/esm/auth/doover-auth.d.ts +52 -0
  89. package/dist/esm/auth/doover-auth.js +28 -0
  90. package/dist/esm/auth/doover-token-auth.d.ts +39 -0
  91. package/dist/esm/auth/doover-token-auth.js +217 -0
  92. package/dist/esm/auth/errors.d.ts +3 -0
  93. package/dist/esm/auth/errors.js +6 -0
  94. package/dist/esm/auth/index.d.ts +10 -0
  95. package/dist/esm/auth/index.js +6 -0
  96. package/dist/esm/auth/jwt.d.ts +6 -0
  97. package/dist/esm/auth/jwt.js +26 -0
  98. package/dist/esm/client/capabilities.d.ts +10 -0
  99. package/dist/esm/client/capabilities.js +42 -0
  100. package/dist/esm/client/data-client.d.ts +107 -0
  101. package/dist/esm/client/doover-client.d.ts +48 -0
  102. package/dist/esm/client/doover-client.js +96 -0
  103. package/dist/esm/client/errors.d.ts +32 -0
  104. package/dist/esm/client/errors.js +64 -0
  105. package/dist/esm/client/index.d.ts +6 -0
  106. package/dist/esm/client/index.js +3 -0
  107. package/dist/esm/client/local-agent-client.d.ts +65 -0
  108. package/dist/esm/client/local-agent-client.js +225 -0
  109. package/dist/esm/client/multiplex-client.d.ts +165 -0
  110. package/dist/esm/client/multiplex-client.js +842 -0
  111. package/dist/esm/client/multiplex-gateway.d.ts +49 -0
  112. package/dist/esm/client/multiplex-gateway.js +110 -0
  113. package/dist/esm/client/multiplex-merge.d.ts +12 -0
  114. package/dist/esm/client/multiplex-merge.js +38 -0
  115. package/dist/esm/client/network-status.d.ts +17 -0
  116. package/dist/esm/client/network-status.js +66 -0
  117. package/dist/esm/client/offline-cache.d.ts +167 -0
  118. package/dist/esm/client/offline-cache.js +769 -0
  119. package/dist/esm/client/provenance.d.ts +60 -0
  120. package/dist/esm/client/provenance.js +108 -0
  121. package/dist/esm/client/request-options.d.ts +23 -0
  122. package/dist/esm/client/request-options.js +23 -0
  123. package/dist/esm/client/singleton.d.ts +26 -0
  124. package/dist/esm/client/singleton.js +54 -0
  125. package/dist/esm/client/stats.d.ts +79 -0
  126. package/dist/esm/client/stats.js +155 -0
  127. package/dist/esm/client/status-tracker.d.ts +24 -0
  128. package/dist/esm/client/status-tracker.js +86 -0
  129. package/dist/esm/gateway/gateway-client.d.ts +86 -0
  130. package/dist/esm/gateway/gateway-client.js +463 -0
  131. package/dist/esm/gateway/index.d.ts +3 -0
  132. package/dist/esm/gateway/index.js +1 -0
  133. package/dist/esm/gateway/types.d.ts +142 -0
  134. package/dist/esm/http/errors.d.ts +19 -0
  135. package/dist/esm/http/errors.js +22 -0
  136. package/dist/esm/http/index.d.ts +3 -0
  137. package/dist/esm/http/index.js +2 -0
  138. package/dist/esm/http/rest-client.d.ts +64 -0
  139. package/dist/esm/http/rest-client.js +181 -0
  140. package/dist/esm/index.d.ts +64 -0
  141. package/dist/esm/index.js +38 -0
  142. package/dist/esm/node/config-manager.d.ts +34 -0
  143. package/dist/esm/node/config-manager.js +140 -0
  144. package/dist/esm/node/index.d.ts +1 -0
  145. package/dist/esm/node/index.js +1 -0
  146. package/dist/esm/package.json +1 -0
  147. package/dist/esm/react/context.d.ts +23 -0
  148. package/dist/esm/react/context.js +28 -0
  149. package/dist/esm/react/index.d.ts +38 -0
  150. package/dist/esm/react/index.js +21 -0
  151. package/dist/esm/react/messageRangeStore.d.ts +93 -0
  152. package/dist/esm/react/messageRangeStore.js +140 -0
  153. package/dist/esm/react/sharedQueryClient.d.ts +21 -0
  154. package/dist/esm/react/sharedQueryClient.js +35 -0
  155. package/dist/esm/react/useAgentChannel.d.ts +8 -0
  156. package/dist/esm/react/useAgentChannel.js +9 -0
  157. package/dist/esm/react/useAgentConnections.d.ts +8 -0
  158. package/dist/esm/react/useAgentConnections.js +20 -0
  159. package/dist/esm/react/useAgentTokenState.d.ts +70 -0
  160. package/dist/esm/react/useAgentTokenState.js +127 -0
  161. package/dist/esm/react/useChannelAggregate.d.ts +64 -0
  162. package/dist/esm/react/useChannelAggregate.js +77 -0
  163. package/dist/esm/react/useChannelMessage.d.ts +45 -0
  164. package/dist/esm/react/useChannelMessage.js +79 -0
  165. package/dist/esm/react/useChannelMessages.d.ts +83 -0
  166. package/dist/esm/react/useChannelMessages.js +214 -0
  167. package/dist/esm/react/useChannelSubscription.d.ts +27 -0
  168. package/dist/esm/react/useChannelSubscription.js +30 -0
  169. package/dist/esm/react/useClientStatus.d.ts +10 -0
  170. package/dist/esm/react/useClientStatus.js +19 -0
  171. package/dist/esm/react/useConnectionState.d.ts +26 -0
  172. package/dist/esm/react/useConnectionState.js +45 -0
  173. package/dist/esm/react/useDeviceMap.d.ts +109 -0
  174. package/dist/esm/react/useDeviceMap.js +59 -0
  175. package/dist/esm/react/useInvocationLogs.d.ts +23 -0
  176. package/dist/esm/react/useInvocationLogs.js +37 -0
  177. package/dist/esm/react/useMultiAgentAggregates.d.ts +38 -0
  178. package/dist/esm/react/useMultiAgentAggregates.js +104 -0
  179. package/dist/esm/react/useMultiAgentChannelMessages.d.ts +79 -0
  180. package/dist/esm/react/useMultiAgentChannelMessages.js +169 -0
  181. package/dist/esm/react/useOfflineStatus.d.ts +8 -0
  182. package/dist/esm/react/useOfflineStatus.js +37 -0
  183. package/dist/esm/react/useSendMessage.d.ts +16 -0
  184. package/dist/esm/react/useSendMessage.js +26 -0
  185. package/dist/esm/react/useSendRpc.d.ts +68 -0
  186. package/dist/esm/react/useSendRpc.js +164 -0
  187. package/dist/esm/react/useTurnCredentials.d.ts +12 -0
  188. package/dist/esm/react/useTurnCredentials.js +22 -0
  189. package/dist/esm/react/useUpdateAggregate.d.ts +27 -0
  190. package/dist/esm/react/useUpdateAggregate.js +39 -0
  191. package/dist/esm/react/useUpdateMessage.d.ts +38 -0
  192. package/dist/esm/react/useUpdateMessage.js +36 -0
  193. package/dist/esm/refine/index.d.ts +72 -0
  194. package/dist/esm/refine/index.js +215 -0
  195. package/dist/esm/rpc/errors.d.ts +10 -0
  196. package/dist/esm/rpc/errors.js +19 -0
  197. package/dist/esm/rpc/index.d.ts +3 -0
  198. package/dist/esm/rpc/index.js +2 -0
  199. package/dist/esm/rpc/rpc-dispatcher.d.ts +41 -0
  200. package/dist/esm/rpc/rpc-dispatcher.js +141 -0
  201. package/dist/esm/types/audit.d.ts +53 -0
  202. package/dist/esm/types/audit.js +11 -0
  203. package/dist/esm/types/batch.d.ts +85 -0
  204. package/dist/esm/types/batch.js +42 -0
  205. package/dist/esm/types/common.d.ts +250 -0
  206. package/dist/esm/types/connection.d.ts +72 -0
  207. package/dist/esm/types/connection.js +7 -0
  208. package/dist/esm/types/index.d.ts +9 -0
  209. package/dist/esm/types/openapi.d.ts +195 -0
  210. package/dist/esm/types/provenance.d.ts +45 -0
  211. package/dist/esm/types/viewer.d.ts +122 -0
  212. package/dist/esm/utils/snowflake.d.ts +21 -0
  213. package/dist/esm/utils/snowflake.js +33 -0
  214. package/dist/esm/viewer/doover-data-provider.d.ts +90 -0
  215. package/dist/esm/viewer/doover-data-provider.js +189 -0
  216. package/dist/esm/viewer/path-parsing.d.ts +5 -0
  217. package/dist/esm/viewer/path-parsing.js +35 -0
  218. package/dist/gateway/gateway-client.d.ts +5 -5
  219. package/dist/gateway/gateway-client.js +5 -5
  220. package/dist/gateway/index.d.ts +3 -0
  221. package/dist/gateway/index.js +5 -0
  222. package/dist/gateway/types.d.ts +1 -1
  223. package/dist/http/index.d.ts +3 -0
  224. package/dist/http/index.js +9 -0
  225. package/dist/http/rest-client.d.ts +5 -3
  226. package/dist/http/rest-client.js +2 -2
  227. package/dist/index.d.ts +64 -62
  228. package/dist/index.js +92 -89
  229. package/dist/node/config-manager.d.ts +2 -2
  230. package/dist/node/config-manager.js +5 -5
  231. package/dist/node/index.d.ts +1 -1
  232. package/dist/node/index.js +2 -2
  233. package/dist/react/context.d.ts +1 -1
  234. package/dist/react/index.d.ts +38 -38
  235. package/dist/react/index.js +59 -59
  236. package/dist/react/messageRangeStore.d.ts +1 -1
  237. package/dist/react/useAgentChannel.d.ts +3 -3
  238. package/dist/react/useAgentChannel.js +2 -2
  239. package/dist/react/useAgentConnections.d.ts +1 -1
  240. package/dist/react/useAgentConnections.js +2 -2
  241. package/dist/react/useAgentTokenState.d.ts +3 -3
  242. package/dist/react/useAgentTokenState.js +8 -8
  243. package/dist/react/useChannelAggregate.d.ts +3 -3
  244. package/dist/react/useChannelAggregate.js +8 -8
  245. package/dist/react/useChannelMessage.d.ts +2 -2
  246. package/dist/react/useChannelMessage.js +4 -4
  247. package/dist/react/useChannelMessages.d.ts +3 -3
  248. package/dist/react/useChannelMessages.js +10 -10
  249. package/dist/react/useChannelSubscription.d.ts +2 -2
  250. package/dist/react/useChannelSubscription.js +2 -2
  251. package/dist/react/useClientStatus.d.ts +1 -1
  252. package/dist/react/useClientStatus.js +2 -2
  253. package/dist/react/useConnectionState.js +2 -2
  254. package/dist/react/useDeviceMap.js +2 -2
  255. package/dist/react/useInvocationLogs.d.ts +1 -1
  256. package/dist/react/useInvocationLogs.js +2 -2
  257. package/dist/react/useMultiAgentAggregates.d.ts +1 -1
  258. package/dist/react/useMultiAgentAggregates.js +5 -5
  259. package/dist/react/useMultiAgentChannelMessages.d.ts +1 -1
  260. package/dist/react/useMultiAgentChannelMessages.js +2 -2
  261. package/dist/react/useOfflineStatus.d.ts +2 -2
  262. package/dist/react/useOfflineStatus.js +31 -17
  263. package/dist/react/useSendMessage.d.ts +2 -2
  264. package/dist/react/useSendMessage.js +2 -2
  265. package/dist/react/useSendRpc.d.ts +2 -2
  266. package/dist/react/useSendRpc.js +2 -2
  267. package/dist/react/useTurnCredentials.d.ts +2 -2
  268. package/dist/react/useTurnCredentials.js +2 -2
  269. package/dist/react/useUpdateAggregate.d.ts +3 -3
  270. package/dist/react/useUpdateAggregate.js +4 -4
  271. package/dist/react/useUpdateMessage.d.ts +2 -2
  272. package/dist/react/useUpdateMessage.js +2 -2
  273. package/dist/refine/index.d.ts +1 -1
  274. package/dist/rpc/errors.d.ts +1 -1
  275. package/dist/rpc/index.d.ts +3 -0
  276. package/dist/rpc/index.js +7 -0
  277. package/dist/rpc/rpc-dispatcher.d.ts +4 -4
  278. package/dist/rpc/rpc-dispatcher.js +2 -2
  279. package/dist/types/common.d.ts +1 -1
  280. package/dist/types/index.d.ts +9 -0
  281. package/dist/types/index.js +2 -0
  282. package/dist/types/openapi.d.ts +1 -1
  283. package/dist/types/viewer.d.ts +2 -2
  284. package/dist/viewer/doover-data-provider.d.ts +10 -10
  285. package/dist/viewer/doover-data-provider.js +25 -25
  286. package/dist/viewer/path-parsing.d.ts +1 -1
  287. package/package.json +795 -8
  288. package/dist/test/api-args.test.js +0 -48
  289. package/dist/test/api-overloads.test.d.ts +0 -9
  290. package/dist/test/api-overloads.test.js +0 -330
  291. package/dist/test/apis.test.js +0 -408
  292. package/dist/test/auth.test.js +0 -708
  293. package/dist/test/batch-apis.test.js +0 -183
  294. package/dist/test/capabilities.test.js +0 -27
  295. package/dist/test/config-manager.test.js +0 -160
  296. package/dist/test/data-client-errors.test.js +0 -24
  297. package/dist/test/data-client-shape.test.js +0 -28
  298. package/dist/test/doover-client-dataclient.test.d.ts +0 -1
  299. package/dist/test/doover-client-dataclient.test.js +0 -58
  300. package/dist/test/doover-client-provenance.test.d.ts +0 -1
  301. package/dist/test/doover-client-provenance.test.js +0 -32
  302. package/dist/test/doover-client.test.d.ts +0 -1
  303. package/dist/test/doover-client.test.js +0 -42
  304. package/dist/test/doover-data-provider.test.d.ts +0 -1
  305. package/dist/test/doover-data-provider.test.js +0 -657
  306. package/dist/test/exports.test.d.ts +0 -1
  307. package/dist/test/exports.test.js +0 -80
  308. package/dist/test/gateway-client.test.d.ts +0 -1
  309. package/dist/test/gateway-client.test.js +0 -474
  310. package/dist/test/gateway-provenance.test.d.ts +0 -1
  311. package/dist/test/gateway-provenance.test.js +0 -29
  312. package/dist/test/gateway-subscriptions.test.d.ts +0 -1
  313. package/dist/test/gateway-subscriptions.test.js +0 -95
  314. package/dist/test/helpers.d.ts +0 -32
  315. package/dist/test/helpers.js +0 -115
  316. package/dist/test/local-agent-client.test.d.ts +0 -1
  317. package/dist/test/local-agent-client.test.js +0 -202
  318. package/dist/test/message-range-store.test.d.ts +0 -1
  319. package/dist/test/message-range-store.test.js +0 -183
  320. package/dist/test/multiplex-capabilities.test.d.ts +0 -1
  321. package/dist/test/multiplex-capabilities.test.js +0 -37
  322. package/dist/test/multiplex-conflicts.test.d.ts +0 -1
  323. package/dist/test/multiplex-conflicts.test.js +0 -35
  324. package/dist/test/multiplex-gateway.test.d.ts +0 -1
  325. package/dist/test/multiplex-gateway.test.js +0 -103
  326. package/dist/test/multiplex-merge.test.d.ts +0 -1
  327. package/dist/test/multiplex-merge.test.js +0 -19
  328. package/dist/test/multiplex-noncore.test.d.ts +0 -1
  329. package/dist/test/multiplex-noncore.test.js +0 -82
  330. package/dist/test/multiplex-passthrough.test.d.ts +0 -1
  331. package/dist/test/multiplex-passthrough.test.js +0 -35
  332. package/dist/test/multiplex-reads.test.d.ts +0 -1
  333. package/dist/test/multiplex-reads.test.js +0 -87
  334. package/dist/test/multiplex-registry.test.d.ts +0 -1
  335. package/dist/test/multiplex-registry.test.js +0 -81
  336. package/dist/test/multiplex-routing.test.d.ts +0 -1
  337. package/dist/test/multiplex-routing.test.js +0 -45
  338. package/dist/test/multiplex-status.test.d.ts +0 -1
  339. package/dist/test/multiplex-status.test.js +0 -63
  340. package/dist/test/multiplex-writes.test.d.ts +0 -1
  341. package/dist/test/multiplex-writes.test.js +0 -93
  342. package/dist/test/offline-cache.test.d.ts +0 -1
  343. package/dist/test/offline-cache.test.js +0 -289
  344. package/dist/test/provenance-regression.test.d.ts +0 -1
  345. package/dist/test/provenance-regression.test.js +0 -45
  346. package/dist/test/provenance-stamper.test.d.ts +0 -1
  347. package/dist/test/provenance-stamper.test.js +0 -41
  348. package/dist/test/provenance-type.test.d.ts +0 -1
  349. package/dist/test/provenance-type.test.js +0 -15
  350. package/dist/test/react-channel-messages-forward.test.d.ts +0 -1
  351. package/dist/test/react-channel-messages-forward.test.js +0 -139
  352. package/dist/test/react-channel-messages-range.test.d.ts +0 -1
  353. package/dist/test/react-channel-messages-range.test.js +0 -109
  354. package/dist/test/react-client-status.test.d.ts +0 -1
  355. package/dist/test/react-client-status.test.js +0 -35
  356. package/dist/test/react-dataclient.test.d.ts +0 -1
  357. package/dist/test/react-dataclient.test.js +0 -28
  358. package/dist/test/react-exports.test.d.ts +0 -1
  359. package/dist/test/react-exports.test.js +0 -46
  360. package/dist/test/react-multiagent-messages.test.d.ts +0 -1
  361. package/dist/test/react-multiagent-messages.test.js +0 -113
  362. package/dist/test/react-sources-option.test.d.ts +0 -1
  363. package/dist/test/react-sources-option.test.js +0 -41
  364. package/dist/test/react.test.d.ts +0 -1
  365. package/dist/test/react.test.js +0 -482
  366. package/dist/test/refine.test.d.ts +0 -1
  367. package/dist/test/refine.test.js +0 -71
  368. package/dist/test/rest-client.test.d.ts +0 -1
  369. package/dist/test/rest-client.test.js +0 -197
  370. package/dist/test/rpc-dispatcher.test.d.ts +0 -1
  371. package/dist/test/rpc-dispatcher.test.js +0 -251
  372. package/dist/test/singleton.test.d.ts +0 -1
  373. package/dist/test/singleton.test.js +0 -62
  374. package/dist/test/stats-rpc.test.d.ts +0 -1
  375. package/dist/test/stats-rpc.test.js +0 -69
  376. package/dist/test/status-tracker.test.d.ts +0 -1
  377. package/dist/test/status-tracker.test.js +0 -85
  378. package/dist/test/users-api.test.d.ts +0 -1
  379. package/dist/test/users-api.test.js +0 -19
  380. package/dist/test/utils.test.d.ts +0 -1
  381. package/dist/test/utils.test.js +0 -64
  382. /package/dist/{test/api-args.test.d.ts → esm/auth/auth-store.js} +0 -0
  383. /package/dist/{test/apis.test.d.ts → esm/client/data-client.js} +0 -0
  384. /package/dist/{test/auth.test.d.ts → esm/gateway/types.js} +0 -0
  385. /package/dist/{test/batch-apis.test.d.ts → esm/types/common.js} +0 -0
  386. /package/dist/{test/capabilities.test.d.ts → esm/types/index.js} +0 -0
  387. /package/dist/{test/config-manager.test.d.ts → esm/types/openapi.js} +0 -0
  388. /package/dist/{test/data-client-errors.test.d.ts → esm/types/provenance.js} +0 -0
  389. /package/dist/{test/data-client-shape.test.d.ts → esm/types/viewer.js} +0 -0
@@ -4,8 +4,8 @@ exports.multiAgentAggregatesQueryKey = multiAgentAggregatesQueryKey;
4
4
  exports.useMultiAgentAggregates = useMultiAgentAggregates;
5
5
  const react_1 = require("react");
6
6
  const react_query_1 = require("@tanstack/react-query");
7
- const context_1 = require("./context");
8
- const useChannelAggregate_1 = require("./useChannelAggregate");
7
+ const context_js_1 = require("./context.js");
8
+ const useChannelAggregate_js_1 = require("./useChannelAggregate.js");
9
9
  function multiAgentAggregatesQueryKey(channelName, agentIds, fields, sources) {
10
10
  const sourceDim = sources && sources.length ? [...sources].sort().join(",") : "*";
11
11
  const base = [
@@ -27,7 +27,7 @@ function multiAgentAggregatesQueryKey(channelName, agentIds, fields, sources) {
27
27
  * `channelSync`/`aggregateUpdate` events into the batched query cache.
28
28
  */
29
29
  function useMultiAgentAggregates(channelName, agentIds, options) {
30
- const client = (0, context_1.useDooverClient)();
30
+ const client = (0, context_js_1.useDooverClient)();
31
31
  const queryClient = (0, react_query_1.useQueryClient)();
32
32
  const liveUpdates = options?.liveUpdates ?? true;
33
33
  const sources = options?.sources;
@@ -54,7 +54,7 @@ function useMultiAgentAggregates(channelName, agentIds, options) {
54
54
  // a second fetch for data we already have.
55
55
  for (const result of response.results) {
56
56
  const { agent_id, ...aggregate } = result;
57
- queryClient.setQueryData((0, useChannelAggregate_1.channelAggregateQueryKey)(agent_id, channelName, sources), aggregate);
57
+ queryClient.setQueryData((0, useChannelAggregate_js_1.channelAggregateQueryKey)(agent_id, channelName, sources), aggregate);
58
58
  }
59
59
  return response;
60
60
  },
@@ -75,7 +75,7 @@ function useMultiAgentAggregates(channelName, agentIds, options) {
75
75
  });
76
76
  // Mirror live updates into the per-agent cache so sibling
77
77
  // `useChannelAggregate` consumers see them too.
78
- queryClient.setQueryData((0, useChannelAggregate_1.channelAggregateQueryKey)(agentId, channelName, sources), aggregate);
78
+ queryClient.setQueryData((0, useChannelAggregate_js_1.channelAggregateQueryKey)(agentId, channelName, sources), aggregate);
79
79
  },
80
80
  // eslint-disable-next-line react-hooks/exhaustive-deps
81
81
  [queryClient, channelName, agentIds.join(","), sources?.join(",")]);
@@ -1,5 +1,5 @@
1
1
  import { type InfiniteData, type UseInfiniteQueryResult } from "@tanstack/react-query";
2
- import type { MessageStructure } from "../types/common";
2
+ import type { MessageStructure } from "../types/common.js";
3
3
  export declare function multiAgentChannelMessagesQueryKey(channelName: string, agentIds: string[], sources?: string[], scope?: {
4
4
  after?: string;
5
5
  fields?: readonly string[];
@@ -4,7 +4,7 @@ exports.multiAgentChannelMessagesQueryKey = multiAgentChannelMessagesQueryKey;
4
4
  exports.useMultiAgentChannelMessages = useMultiAgentChannelMessages;
5
5
  const react_1 = require("react");
6
6
  const react_query_1 = require("@tanstack/react-query");
7
- const context_1 = require("./context");
7
+ const context_js_1 = require("./context.js");
8
8
  function multiAgentChannelMessagesQueryKey(channelName, agentIds, sources, scope) {
9
9
  const sourceDim = sources && sources.length ? [...sources].sort().join(",") : "*";
10
10
  const base = [
@@ -58,7 +58,7 @@ function nextPageParam(lastPage) {
58
58
  return undefined;
59
59
  }
60
60
  function useMultiAgentChannelMessages(channelName, agentIds, options) {
61
- const client = (0, context_1.useDooverClient)();
61
+ const client = (0, context_js_1.useDooverClient)();
62
62
  const queryClient = (0, react_query_1.useQueryClient)();
63
63
  const limit = options?.limit;
64
64
  const agentMessageLimit = options?.agentMessageLimit;
@@ -1,5 +1,5 @@
1
- import type { OfflineStatusSnapshot } from "../client/offline-cache";
2
- export type { OfflineStatusSnapshot } from "../client/offline-cache";
1
+ import type { OfflineStatusSnapshot } from "../client/offline-cache.js";
2
+ export type { OfflineStatusSnapshot } from "../client/offline-cache.js";
3
3
  export interface OfflineStatusClient {
4
4
  getOfflineStatus(): OfflineStatusSnapshot;
5
5
  onOfflineStatusChange(listener: (status: OfflineStatusSnapshot) => void): () => void;
@@ -3,25 +3,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hasOfflineStatus = hasOfflineStatus;
4
4
  exports.useOfflineStatus = useOfflineStatus;
5
5
  const react_1 = require("react");
6
- const context_1 = require("./context");
6
+ const network_status_js_1 = require("../client/network-status.js");
7
+ const context_js_1 = require("./context.js");
7
8
  function hasOfflineStatus(client) {
8
- return (!!client &&
9
- typeof client === "object" &&
10
- typeof client.getOfflineStatus === "function" &&
11
- typeof client.onOfflineStatusChange === "function");
9
+ return !!client && typeof client === "object" &&
10
+ "getOfflineStatus" in client && typeof client.getOfflineStatus === "function" &&
11
+ "onOfflineStatusChange" in client && typeof client.onOfflineStatusChange === "function";
12
12
  }
13
- const UNAVAILABLE_OFFLINE_STATUS = {
14
- online: true,
15
- state: "online",
16
- isOfflineFallback: false,
17
- isExpired: false,
18
- at: 0,
13
+ const SERVER_OFFLINE_STATUS = {
14
+ online: true, state: "online", isOfflineFallback: false, isExpired: false, at: 0,
19
15
  };
20
16
  function useOfflineStatus() {
21
- const client = (0, context_1.useDooverClient)();
22
- return (0, react_1.useSyncExternalStore)((listener) => hasOfflineStatus(client)
23
- ? client.onOfflineStatusChange(listener)
24
- : () => undefined, () => hasOfflineStatus(client)
25
- ? client.getOfflineStatus()
26
- : UNAVAILABLE_OFFLINE_STATUS, () => UNAVAILABLE_OFFLINE_STATUS);
17
+ const client = (0, context_js_1.useDooverClient)();
18
+ const store = (0, react_1.useMemo)(() => {
19
+ if (hasOfflineStatus(client)) {
20
+ return {
21
+ subscribe: (listener) => client.onOfflineStatusChange(listener),
22
+ getSnapshot: () => client.getOfflineStatus(),
23
+ };
24
+ }
25
+ const network = client.networkStatus ?? network_status_js_1.browserNetworkStatus;
26
+ let previous = network.getSnapshot();
27
+ let snapshot = { ...SERVER_OFFLINE_STATUS, ...previous };
28
+ return {
29
+ subscribe: (listener) => network.subscribe(listener),
30
+ getSnapshot: () => {
31
+ const next = network.getSnapshot();
32
+ if (next !== previous) {
33
+ previous = next;
34
+ snapshot = { ...SERVER_OFFLINE_STATUS, ...next };
35
+ }
36
+ return snapshot;
37
+ },
38
+ };
39
+ }, [client]);
40
+ return (0, react_1.useSyncExternalStore)(store.subscribe, store.getSnapshot, () => SERVER_OFFLINE_STATUS);
27
41
  }
@@ -1,6 +1,6 @@
1
1
  import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { MessageStructure } from "../types/common";
3
- import type { ChannelIdentifier } from "../types/viewer";
2
+ import type { MessageStructure } from "../types/common.js";
3
+ import type { ChannelIdentifier } from "../types/viewer.js";
4
4
  export interface UseSendMessageOptions {
5
5
  /**
6
6
  * Restrict the write to these source ids on a `MultiplexClient`. Ignored
@@ -2,14 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useSendMessage = useSendMessage;
4
4
  const react_query_1 = require("@tanstack/react-query");
5
- const context_1 = require("./context");
5
+ const context_js_1 = require("./context.js");
6
6
  /**
7
7
  * Mutation wrapping `DooverDataProvider.sendMessage`. Posts a JSON message
8
8
  * to the channel and resolves with the created `MessageStructure` (including
9
9
  * its server-assigned `id` and `timestamp`).
10
10
  */
11
11
  function useSendMessage(identifier, options) {
12
- const client = (0, context_1.useDooverClient)();
12
+ const client = (0, context_js_1.useDooverClient)();
13
13
  const sources = options?.sources;
14
14
  return (0, react_query_1.useMutation)({
15
15
  mutationFn: (data) => {
@@ -1,6 +1,6 @@
1
1
  import { type UseMutateAsyncFunction, type UseMutateFunction, type UseMutationResult } from "@tanstack/react-query";
2
- import type { RpcStatus } from "../types/common";
3
- import type { ChannelIdentifier } from "../types/viewer";
2
+ import type { RpcStatus } from "../types/common.js";
3
+ import type { ChannelIdentifier } from "../types/viewer.js";
4
4
  export type RpcCommandId = string;
5
5
  export interface RpcStatusEvent<TPending = undefined> {
6
6
  commandId: RpcCommandId;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useSendRpc = useSendRpc;
4
4
  const react_1 = require("react");
5
5
  const react_query_1 = require("@tanstack/react-query");
6
- const context_1 = require("./context");
6
+ const context_js_1 = require("./context.js");
7
7
  const SENT_STATUS = { code: "sent" };
8
8
  function isTerminal(status) {
9
9
  return status?.code === "success" || status?.code === "error";
@@ -32,7 +32,7 @@ function toErrorStatus(error) {
32
32
  * persisted and don't flow through this hook.
33
33
  */
34
34
  function useSendRpc(identifier, options) {
35
- const client = (0, context_1.useDooverClient)();
35
+ const client = (0, context_js_1.useDooverClient)();
36
36
  const [commandStatuses, setCommandStatuses] = (0, react_1.useState)({});
37
37
  const mutationKey = options.mutationKey ??
38
38
  [
@@ -1,6 +1,6 @@
1
1
  import { type UseQueryResult } from "@tanstack/react-query";
2
- import type { TurnCredential } from "../types/common";
3
- import type { TurnTokenRequest } from "../types/openapi";
2
+ import type { TurnCredential } from "../types/common.js";
3
+ import type { TurnTokenRequest } from "../types/openapi.js";
4
4
  /**
5
5
  * Fetch TURN (relay) credentials for a camera stream. Cached for 10 minutes
6
6
  * by default since the token has a server-controlled TTL; consumers that
@@ -2,14 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useTurnCredentials = useTurnCredentials;
4
4
  const react_query_1 = require("@tanstack/react-query");
5
- const context_1 = require("./context");
5
+ const context_js_1 = require("./context.js");
6
6
  /**
7
7
  * Fetch TURN (relay) credentials for a camera stream. Cached for 10 minutes
8
8
  * by default since the token has a server-controlled TTL; consumers that
9
9
  * need refresh-on-expiry should do so at the call site.
10
10
  */
11
11
  function useTurnCredentials(request, options) {
12
- const client = (0, context_1.useDooverClient)();
12
+ const client = (0, context_js_1.useDooverClient)();
13
13
  return (0, react_query_1.useQuery)({
14
14
  queryKey: [
15
15
  "doover",
@@ -1,7 +1,7 @@
1
1
  import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { AggregateMutationParams } from "../apis/aggregates-api";
3
- import type { Aggregate } from "../types/common";
4
- import type { ChannelIdentifier } from "../types/viewer";
2
+ import type { AggregateMutationParams } from "../apis/aggregates-api.js";
3
+ import type { Aggregate } from "../types/common.js";
4
+ import type { ChannelIdentifier } from "../types/viewer.js";
5
5
  export interface UseUpdateAggregateOptions {
6
6
  /** If true, use PUT semantics (replace) instead of PATCH (merge). */
7
7
  replace?: boolean;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useUpdateAggregate = useUpdateAggregate;
4
4
  const react_query_1 = require("@tanstack/react-query");
5
- const context_1 = require("./context");
6
- const useChannelAggregate_1 = require("./useChannelAggregate");
5
+ const context_js_1 = require("./context.js");
6
+ const useChannelAggregate_js_1 = require("./useChannelAggregate.js");
7
7
  /**
8
8
  * Mutation wrapping `DooverDataProvider.updateAggregate` (PATCH) or
9
9
  * `putAggregate` (PUT when `replace: true`). Also writes the returned
@@ -11,7 +11,7 @@ const useChannelAggregate_1 = require("./useChannelAggregate");
11
11
  * `useChannelAggregate` see the change immediately.
12
12
  */
13
13
  function useUpdateAggregate(identifier, options) {
14
- const client = (0, context_1.useDooverClient)();
14
+ const client = (0, context_js_1.useDooverClient)();
15
15
  const queryClient = (0, react_query_1.useQueryClient)();
16
16
  const replace = options?.replace ?? false;
17
17
  const params = options?.params;
@@ -36,7 +36,7 @@ function useUpdateAggregate(identifier, options) {
36
36
  : client.aggregates.patchAggregate(id, body, params));
37
37
  },
38
38
  onSuccess: (aggregate) => {
39
- queryClient.setQueryData((0, useChannelAggregate_1.channelAggregateQueryKey)(identifier.agentId, identifier.channelName, sources), aggregate);
39
+ queryClient.setQueryData((0, useChannelAggregate_js_1.channelAggregateQueryKey)(identifier.agentId, identifier.channelName, sources), aggregate);
40
40
  },
41
41
  });
42
42
  }
@@ -1,6 +1,6 @@
1
1
  import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { MessageBody, MessageMutationParams } from "../apis/messages-api";
3
- import type { ChannelIdentifier } from "../types/viewer";
2
+ import type { MessageBody, MessageMutationParams } from "../apis/messages-api.js";
3
+ import type { ChannelIdentifier } from "../types/viewer.js";
4
4
  export interface UpdateMessageCallOptions {
5
5
  /**
6
6
  * If true, use PUT (replace) instead of PATCH (merge). Falls back to
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useUpdateMessage = useUpdateMessage;
4
4
  const react_query_1 = require("@tanstack/react-query");
5
- const context_1 = require("./context");
5
+ const context_js_1 = require("./context.js");
6
6
  /**
7
7
  * Mutation wrapping `MessagesApi.patchMessage` or `putMessage`. Bound to a
8
8
  * single channel; the message id and body are passed per-call. Each
@@ -10,7 +10,7 @@ const context_1 = require("./context");
10
10
  * mutation sites that sometimes PUT and sometimes PATCH the same channel.
11
11
  */
12
12
  function useUpdateMessage(identifier, options) {
13
- const client = (0, context_1.useDooverClient)();
13
+ const client = (0, context_js_1.useDooverClient)();
14
14
  const defaultReplace = options?.replace ?? false;
15
15
  const defaultParams = options?.params;
16
16
  const sources = options?.sources;
@@ -1,4 +1,4 @@
1
- import type { RestClient } from "../http/rest-client";
1
+ import type { RestClient } from "../http/rest-client.js";
2
2
  export type RefineRecord = Record<string, unknown> & {
3
3
  id?: string | number;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { RpcRequest, RpcStatus } from "../types/common";
1
+ import type { RpcRequest, RpcStatus } from "../types/common.js";
2
2
  export declare class DooverRpcError extends Error {
3
3
  readonly status: RpcStatus<unknown> & {
4
4
  code: "error";
@@ -0,0 +1,3 @@
1
+ export { RpcDispatcher } from "./rpc-dispatcher.js";
2
+ export type { SendRpcOptions } from "./rpc-dispatcher.js";
3
+ export { DooverRpcError } from "./errors.js";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DooverRpcError = exports.RpcDispatcher = void 0;
4
+ var rpc_dispatcher_js_1 = require("./rpc-dispatcher.js");
5
+ Object.defineProperty(exports, "RpcDispatcher", { enumerable: true, get: function () { return rpc_dispatcher_js_1.RpcDispatcher; } });
6
+ var errors_js_1 = require("./errors.js");
7
+ Object.defineProperty(exports, "DooverRpcError", { enumerable: true, get: function () { return errors_js_1.DooverRpcError; } });
@@ -1,7 +1,7 @@
1
- import type { MessagesApi } from "../apis/messages-api";
2
- import type { DooverStatsCollector } from "../client/stats";
3
- import type { GatewayClient } from "../gateway/gateway-client";
4
- import type { RpcRequest, RpcStatus } from "../types/common";
1
+ import type { MessagesApi } from "../apis/messages-api.js";
2
+ import type { DooverStatsCollector } from "../client/stats.js";
3
+ import type { GatewayClient } from "../gateway/gateway-client.js";
4
+ import type { RpcRequest, RpcStatus } from "../types/common.js";
5
5
  export interface SendRpcOptions<TPending = undefined> {
6
6
  onStatus?: (status: RpcStatus<TPending>) => void;
7
7
  signal?: AbortSignal;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpcDispatcher = void 0;
4
- const errors_1 = require("./errors");
4
+ const errors_js_1 = require("./errors.js");
5
5
  /** Whether the device has answered this command, rather than only received it. */
6
6
  function hasDeviceAnswered(status) {
7
7
  return status.code === "acknowledged" || status.code === "pending";
@@ -112,7 +112,7 @@ class RpcDispatcher {
112
112
  this.settle(msg.id, "success", msg.data.response);
113
113
  }
114
114
  else if (status.code === "error") {
115
- this.settle(msg.id, "error", undefined, new errors_1.DooverRpcError(status, pending.request));
115
+ this.settle(msg.id, "error", undefined, new errors_js_1.DooverRpcError(status, pending.request));
116
116
  }
117
117
  else if (hasDeviceAnswered(status) && pending.pendingTimeoutMs !== undefined) {
118
118
  // The device is alive and working: swap the "no response" deadline for
@@ -1,4 +1,4 @@
1
- import type { SourceProvenance } from "./provenance";
1
+ import type { SourceProvenance } from "./provenance.js";
2
2
  export type JSONPrimitive = null | boolean | number | string;
3
3
  export type JSONValue = JSONPrimitive | JSONValue[] | {
4
4
  [key: string]: JSONValue;
@@ -0,0 +1,9 @@
1
+ export type * from "./common.js";
2
+ export type * from "./connection.js";
3
+ export type * from "./openapi.js";
4
+ export type * from "./viewer.js";
5
+ export type * from "./audit.js";
6
+ export type * from "./provenance.js";
7
+ export type * from "./batch.js";
8
+ export type * from "../client/data-client.js";
9
+ export type * from "../gateway/types.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import type { AgentAggregate, AgentPermission, Alarm, AlarmMessages, AlarmStateMessage, Aggregate, Channel, ConnectionDetails, ConnectionSubscription, ConnectionSubscriptionLog, DataSeries, MessageStructure, NotificationEndpoint, NotificationEndpointSummary, NotificationSubscription, NotificationTopicFilterMode, ResourcePermission, TurnCredential } from "./common";
1
+ import type { AgentAggregate, AgentPermission, Alarm, AlarmMessages, AlarmStateMessage, Aggregate, Channel, ConnectionDetails, ConnectionSubscription, ConnectionSubscriptionLog, DataSeries, MessageStructure, NotificationEndpoint, NotificationEndpointSummary, NotificationSubscription, NotificationTopicFilterMode, ResourcePermission, TurnCredential } from "./common.js";
2
2
  export type { AgentAggregate, AgentPermission, Alarm, AlarmMessages, AlarmStateMessage, Aggregate, Channel, ConnectionDetails, ConnectionSubscription, ConnectionSubscriptionLog, DataSeries, MessageStructure, NotificationEndpoint, NotificationEndpointSummary, NotificationSubscription, NotificationTopicFilterMode, ResourcePermission, TurnCredential, };
3
3
  export interface BatchMessagesResponse {
4
4
  results: MessageStructure[];
@@ -1,5 +1,5 @@
1
- import type { SourceProvenance } from "./provenance";
2
- import type { Aggregate, Channel, ConnectionDetails, MessageStructure } from "./common";
1
+ import type { SourceProvenance } from "./provenance.js";
2
+ import type { Aggregate, Channel, ConnectionDetails, MessageStructure } from "./common.js";
3
3
  export interface ChannelIdentifier {
4
4
  agentId?: string;
5
5
  channelName?: string;
@@ -1,13 +1,13 @@
1
- import { AgentsApi } from "../apis/agents-api";
2
- import { AggregatesApi, type AggregateMutationParams } from "../apis/aggregates-api";
3
- import { ChannelsApi } from "../apis/channels-api";
4
- import { ConnectionsApi } from "../apis/connections-api";
5
- import { MessagesApi, type ListMessagesParams } from "../apis/messages-api";
6
- import type { DooverAuth } from "../auth/doover-auth";
7
- import { GatewayClient } from "../gateway/gateway-client";
8
- import { RestClient, type DooverClientConfig } from "../http/rest-client";
9
- import type { Aggregate, Channel, ConnectionDetails, JSONValue, MessageStructure, RpcRequest, RpcStatus } from "../types/common";
10
- import type { Agent, AgentsResponse, ChannelIdentifier, ChannelsDataProvider, GetAgentsOptions, SubscriptionDetails, User } from "../types/viewer";
1
+ import { AgentsApi } from "../apis/agents-api.js";
2
+ import { AggregatesApi, type AggregateMutationParams } from "../apis/aggregates-api.js";
3
+ import { ChannelsApi } from "../apis/channels-api.js";
4
+ import { ConnectionsApi } from "../apis/connections-api.js";
5
+ import { MessagesApi, type ListMessagesParams } from "../apis/messages-api.js";
6
+ import type { DooverAuth } from "../auth/doover-auth.js";
7
+ import { GatewayClient } from "../gateway/gateway-client.js";
8
+ import { RestClient, type DooverClientConfig } from "../http/rest-client.js";
9
+ import type { Aggregate, Channel, ConnectionDetails, JSONValue, MessageStructure, RpcRequest, RpcStatus } from "../types/common.js";
10
+ import type { Agent, AgentsResponse, ChannelIdentifier, ChannelsDataProvider, GetAgentsOptions, SubscriptionDetails, User } from "../types/viewer.js";
11
11
  interface SubscriptionEntry {
12
12
  messageCallback: (identifier: ChannelIdentifier, message: MessageStructure) => void;
13
13
  aggregateCallback: (identifier: ChannelIdentifier, aggregate: Aggregate) => void;
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DooverDataProvider = void 0;
4
- const agents_api_1 = require("../apis/agents-api");
5
- const aggregates_api_1 = require("../apis/aggregates-api");
6
- const channels_api_1 = require("../apis/channels-api");
7
- const connections_api_1 = require("../apis/connections-api");
8
- const messages_api_1 = require("../apis/messages-api");
9
- const users_api_1 = require("../apis/users-api");
10
- const gateway_client_1 = require("../gateway/gateway-client");
11
- const errors_1 = require("../http/errors");
12
- const rest_client_1 = require("../http/rest-client");
13
- const rpc_dispatcher_1 = require("../rpc/rpc-dispatcher");
14
- const path_parsing_1 = require("./path-parsing");
4
+ const agents_api_js_1 = require("../apis/agents-api.js");
5
+ const aggregates_api_js_1 = require("../apis/aggregates-api.js");
6
+ const channels_api_js_1 = require("../apis/channels-api.js");
7
+ const connections_api_js_1 = require("../apis/connections-api.js");
8
+ const messages_api_js_1 = require("../apis/messages-api.js");
9
+ const users_api_js_1 = require("../apis/users-api.js");
10
+ const gateway_client_js_1 = require("../gateway/gateway-client.js");
11
+ const errors_js_1 = require("../http/errors.js");
12
+ const rest_client_js_1 = require("../http/rest-client.js");
13
+ const rpc_dispatcher_js_1 = require("../rpc/rpc-dispatcher.js");
14
+ const path_parsing_js_1 = require("./path-parsing.js");
15
15
  /** @deprecated Use DooverClient subclients directly. Removed in 0.6.0. */
16
16
  class DooverDataProvider {
17
17
  // implementation
@@ -23,19 +23,19 @@ class DooverDataProvider {
23
23
  this.controlApiUrl = configOrInjected.controlApiUrl;
24
24
  }
25
25
  else {
26
- this.rest = new rest_client_1.RestClient(configOrInjected, auth);
27
- this.gateway = new gateway_client_1.GatewayClient(configOrInjected, auth);
26
+ this.rest = new rest_client_js_1.RestClient(configOrInjected, auth);
27
+ this.gateway = new gateway_client_js_1.GatewayClient(configOrInjected, auth);
28
28
  this.controlApiUrl = configOrInjected.controlApiUrl;
29
29
  }
30
- this.agentsApi = new agents_api_1.AgentsApi(this.rest, this.controlApiUrl);
31
- this.channelsApi = new channels_api_1.ChannelsApi(this.rest);
32
- this.messagesApi = new messages_api_1.MessagesApi(this.rest);
33
- this.aggregatesApi = new aggregates_api_1.AggregatesApi(this.rest);
34
- this.connectionsApi = new connections_api_1.ConnectionsApi(this.rest);
30
+ this.agentsApi = new agents_api_js_1.AgentsApi(this.rest, this.controlApiUrl);
31
+ this.channelsApi = new channels_api_js_1.ChannelsApi(this.rest);
32
+ this.messagesApi = new messages_api_js_1.MessagesApi(this.rest);
33
+ this.aggregatesApi = new aggregates_api_js_1.AggregatesApi(this.rest);
34
+ this.connectionsApi = new connections_api_js_1.ConnectionsApi(this.rest);
35
35
  }
36
36
  /** @deprecated Use `client.users.getMe()` instead. Removed in 0.6.0. */
37
37
  getMe() {
38
- return new users_api_1.UsersApi(this.rest, this.controlApiUrl).getMe();
38
+ return new users_api_js_1.UsersApi(this.rest, this.controlApiUrl).getMe();
39
39
  }
40
40
  /** @deprecated Use `client.agents.listAgents(opts)` instead. Removed in 0.6.0. */
41
41
  async getAgents(options) {
@@ -52,7 +52,7 @@ class DooverDataProvider {
52
52
  /** @deprecated Use `client.channels.putChannel(id, name, body)` instead. Removed in 0.6.0. */
53
53
  createChannel(identifier, channelName, options) {
54
54
  if (!identifier.agentId) {
55
- throw new errors_1.DooverValidationError("Identifier must contain agentId");
55
+ throw new errors_js_1.DooverValidationError("Identifier must contain agentId");
56
56
  }
57
57
  return this.channelsApi.putChannel(identifier.agentId, channelName, {
58
58
  is_private: options?.is_private ?? false,
@@ -93,7 +93,7 @@ class DooverDataProvider {
93
93
  async unsubscribeFromChannel(_identifier, callback) {
94
94
  const off = this.bridges.get(callback);
95
95
  if (!off) {
96
- throw new errors_1.DooverValidationError("Not Currently Subscribed to Channel");
96
+ throw new errors_js_1.DooverValidationError("Not Currently Subscribed to Channel");
97
97
  }
98
98
  off();
99
99
  this.bridges.delete(callback);
@@ -135,7 +135,7 @@ class DooverDataProvider {
135
135
  sendRPC(identifier, rpcRequest, options) {
136
136
  const v = this.requireChannel(identifier);
137
137
  if (!this.dispatcher) {
138
- this.dispatcher = new rpc_dispatcher_1.RpcDispatcher(this.gateway, this.messagesApi);
138
+ this.dispatcher = new rpc_dispatcher_js_1.RpcDispatcher(this.gateway, this.messagesApi);
139
139
  }
140
140
  return this.dispatcher.send({ agentId: v.agentId, channelName: v.channelName }, rpcRequest, options);
141
141
  }
@@ -157,13 +157,13 @@ class DooverDataProvider {
157
157
  /** @deprecated Use `client.connections.getAgentConnections(id)` instead. Removed in 0.6.0. */
158
158
  getAgentConnections(identifier) {
159
159
  if (!identifier.agentId) {
160
- return Promise.reject(new errors_1.DooverValidationError("Invalid Identifier"));
160
+ return Promise.reject(new errors_js_1.DooverValidationError("Invalid Identifier"));
161
161
  }
162
162
  return this.connectionsApi.getAgentConnections(identifier.agentId);
163
163
  }
164
164
  /** @deprecated Use the free function `getIdentifierFromPath(path, search)` instead. Removed in 0.6.0. */
165
165
  getIdentifierFromPath(path, searchParams) {
166
- return (0, path_parsing_1.getIdentifierFromPath)(path, searchParams);
166
+ return (0, path_parsing_js_1.getIdentifierFromPath)(path, searchParams);
167
167
  }
168
168
  /** @deprecated No replacement — this was a synthesized stub. Removed in 0.6.0. */
169
169
  getAgentInfo(agentId) {
@@ -182,7 +182,7 @@ class DooverDataProvider {
182
182
  }
183
183
  requireChannel(identifier) {
184
184
  if (!identifier.agentId || !identifier.channelName) {
185
- throw new errors_1.DooverValidationError("Identifier must contain agentId and channelName");
185
+ throw new errors_js_1.DooverValidationError("Identifier must contain agentId and channelName");
186
186
  }
187
187
  return {
188
188
  agentId: identifier.agentId,
@@ -1,4 +1,4 @@
1
- import type { ChannelIdentifier } from "../types/viewer";
1
+ import type { ChannelIdentifier } from "../types/viewer.js";
2
2
  export declare function getIdentifierFromPath<TIdentifier extends ChannelIdentifier>(path: string, _searchParams: URLSearchParams): {
3
3
  identifier: TIdentifier;
4
4
  aggregatePath?: string;