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
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildAuth = buildAuth;
4
- const cookie_auth_1 = require("./cookie-auth");
5
- const doover_token_auth_1 = require("./doover-token-auth");
6
- const errors_1 = require("./errors");
4
+ const cookie_auth_js_1 = require("./cookie-auth.js");
5
+ const doover_token_auth_js_1 = require("./doover-token-auth.js");
6
+ const errors_js_1 = require("./errors.js");
7
7
  const TOKEN_FIELDS = [
8
8
  "token",
9
9
  "tokenExpires",
@@ -43,7 +43,7 @@ function buildAuth(options) {
43
43
  // Validate mutual exclusivity.
44
44
  const hasRaw = TOKEN_FIELDS.some((k) => options[k] !== undefined);
45
45
  if (hasRaw || options.profile !== undefined || options.configManager !== undefined) {
46
- throw new errors_1.DooverAuthError("Cannot combine 'auth' with raw auth config fields (token, profile, configManager, etc.)");
46
+ throw new errors_js_1.DooverAuthError("Cannot combine 'auth' with raw auth config fields (token, profile, configManager, etc.)");
47
47
  }
48
48
  return options.auth;
49
49
  }
@@ -51,12 +51,12 @@ function buildAuth(options) {
51
51
  let resolvedProfile = null;
52
52
  if (typeof options.profile === "string") {
53
53
  if (!options.configManager) {
54
- throw new errors_1.DooverAuthError("A 'configManager' (AuthProfileStore) is required when 'profile' is a string. " +
54
+ throw new errors_js_1.DooverAuthError("A 'configManager' (AuthProfileStore) is required when 'profile' is a string. " +
55
55
  "Use the doover-js/node subpath to import ConfigManager, or provide an AuthProfile directly.");
56
56
  }
57
57
  resolvedProfile = options.configManager.get(options.profile) ?? null;
58
58
  if (!resolvedProfile) {
59
- throw new errors_1.DooverAuthError(`Profile '${options.profile}' not found in the config manager`);
59
+ throw new errors_js_1.DooverAuthError(`Profile '${options.profile}' not found in the config manager`);
60
60
  }
61
61
  }
62
62
  else if (options.profile instanceof Object && "profile" in options.profile) {
@@ -69,7 +69,7 @@ function buildAuth(options) {
69
69
  if (!hasTokenInput && !profileHasToken) {
70
70
  // No token data at all — fall back to cookie auth, which can still renew
71
71
  // the session when the app has told us where its auth server lives.
72
- const auth = new cookie_auth_1.CookieAuth({
72
+ const auth = new cookie_auth_js_1.CookieAuth({
73
73
  authServerUrl: options.authServerUrl ?? resolvedProfile?.authServerUrl ?? null,
74
74
  fetchImpl: options.fetchImpl,
75
75
  });
@@ -79,7 +79,7 @@ function buildAuth(options) {
79
79
  return auth;
80
80
  }
81
81
  // Build DooverTokenAuth with explicit fields overriding profile values.
82
- const auth = new doover_token_auth_1.DooverTokenAuth({
82
+ const auth = new doover_token_auth_js_1.DooverTokenAuth({
83
83
  token: options.token ?? undefined,
84
84
  tokenExpires: options.tokenExpires ?? undefined,
85
85
  refreshToken: options.refreshToken ?? undefined,
@@ -1,4 +1,4 @@
1
- import { DooverAuth } from "./doover-auth";
1
+ import { DooverAuth } from "./doover-auth.js";
2
2
  export interface CookieAuthOptions {
3
3
  /**
4
4
  * Base URL of the auth server that serves the hosted-backend refresh
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CookieAuth = void 0;
4
- const doover_auth_1 = require("./doover-auth");
4
+ const doover_auth_js_1 = require("./doover-auth.js");
5
5
  /** Default FusionAuth hosted-backend refresh endpoint. */
6
6
  const DEFAULT_REFRESH_PATH = "/app/refresh/";
7
7
  /** Default name of the cookie holding the access token's expiry (Unix seconds). */
@@ -33,7 +33,7 @@ const ATTEMPT_TTL_MS = 5000;
33
33
  * reconnects, since `GatewayClient` awaits it before opening a socket), and
34
34
  * `handleUnauthorized` lets `RestClient` replay a 401 once after a renewal.
35
35
  */
36
- class CookieAuth extends doover_auth_1.DooverAuth {
36
+ class CookieAuth extends doover_auth_js_1.DooverAuth {
37
37
  constructor(options = {}) {
38
38
  super();
39
39
  this.refreshInFlight = null;
@@ -1,5 +1,5 @@
1
- import type { AuthProfile } from "./auth-profile";
2
- import type { AuthProfileStore } from "./auth-store";
1
+ import type { AuthProfile } from "./auth-profile.js";
2
+ import type { AuthProfileStore } from "./auth-store.js";
3
3
  /**
4
4
  * Abstract base class shared by cookie and token auth strategies.
5
5
  *
@@ -1,6 +1,6 @@
1
- import { DooverAuth } from "./doover-auth";
2
- import type { AuthProfile } from "./auth-profile";
3
- import type { AuthProfileStore } from "./auth-store";
1
+ import { DooverAuth } from "./doover-auth.js";
2
+ import type { AuthProfile } from "./auth-profile.js";
3
+ import type { AuthProfileStore } from "./auth-store.js";
4
4
  export declare class DooverTokenAuth extends DooverAuth {
5
5
  private token;
6
6
  private tokenExpires;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DooverTokenAuth = void 0;
4
- const doover_auth_1 = require("./doover-auth");
5
- const errors_1 = require("./errors");
6
- const jwt_1 = require("./jwt");
4
+ const doover_auth_js_1 = require("./doover-auth.js");
5
+ const errors_js_1 = require("./errors.js");
6
+ const jwt_js_1 = require("./jwt.js");
7
7
  /** Buffer in milliseconds before expiry at which we trigger a refresh (30 s). */
8
8
  const REFRESH_BUFFER_MS = 30000;
9
- class DooverTokenAuth extends doover_auth_1.DooverAuth {
9
+ class DooverTokenAuth extends doover_auth_js_1.DooverAuth {
10
10
  constructor(options) {
11
11
  super();
12
12
  this.refreshInFlight = null;
@@ -63,7 +63,7 @@ class DooverTokenAuth extends doover_auth_1.DooverAuth {
63
63
  }
64
64
  async ensureReady() {
65
65
  if (this.authInvalid) {
66
- throw new errors_1.DooverAuthError("Authentication is invalid; sign in again");
66
+ throw new errors_js_1.DooverAuthError("Authentication is invalid; sign in again");
67
67
  }
68
68
  if (!this.needsRefresh()) {
69
69
  return;
@@ -106,7 +106,7 @@ class DooverTokenAuth extends doover_auth_1.DooverAuth {
106
106
  this.tokenExpires = new Date(profile.tokenExpires);
107
107
  }
108
108
  if (!this.tokenExpires && this.token) {
109
- this.tokenExpires = (0, jwt_1.decodeTokenExpiry)(this.token);
109
+ this.tokenExpires = (0, jwt_js_1.decodeTokenExpiry)(this.token);
110
110
  }
111
111
  if (!this.refreshToken && profile.refreshToken) {
112
112
  this.refreshToken = profile.refreshToken;
@@ -138,7 +138,7 @@ class DooverTokenAuth extends doover_auth_1.DooverAuth {
138
138
  !this.refreshToken ||
139
139
  !this.authServerClientId) {
140
140
  this.markAuthInvalid();
141
- throw new errors_1.DooverAuthError("Cannot refresh token: missing authServerUrl, refreshToken, or authServerClientId");
141
+ throw new errors_js_1.DooverAuthError("Cannot refresh token: missing authServerUrl, refreshToken, or authServerClientId");
142
142
  }
143
143
  const url = new URL(`${this.authServerUrl}/oauth2/token`);
144
144
  url.searchParams.set("grant_type", "refresh_token");
@@ -154,25 +154,25 @@ class DooverTokenAuth extends doover_auth_1.DooverAuth {
154
154
  });
155
155
  }
156
156
  catch (err) {
157
- throw new errors_1.DooverAuthError(`Token refresh request failed: ${err instanceof Error ? err.message : String(err)}`);
157
+ throw new errors_js_1.DooverAuthError(`Token refresh request failed: ${err instanceof Error ? err.message : String(err)}`);
158
158
  }
159
159
  if (!response.ok) {
160
160
  if (response.status >= 400 && response.status < 500) {
161
161
  this.markAuthInvalid();
162
162
  }
163
- throw new errors_1.DooverAuthError(`Token refresh failed with status ${response.status}`);
163
+ throw new errors_js_1.DooverAuthError(`Token refresh failed with status ${response.status}`);
164
164
  }
165
165
  const body = (await response.json());
166
166
  if (!body.access_token) {
167
167
  this.markAuthInvalid();
168
- throw new errors_1.DooverAuthError("Token refresh response did not contain an access_token");
168
+ throw new errors_js_1.DooverAuthError("Token refresh response did not contain an access_token");
169
169
  }
170
170
  this.authInvalid = false;
171
171
  this.token = body.access_token;
172
172
  this.tokenExpires =
173
173
  typeof body.expires_in === "number"
174
174
  ? new Date(Date.now() + body.expires_in * 1000)
175
- : (0, jwt_1.decodeTokenExpiry)(body.access_token);
175
+ : (0, jwt_js_1.decodeTokenExpiry)(body.access_token);
176
176
  if (body.refresh_token) {
177
177
  this.refreshToken = body.refresh_token;
178
178
  }
@@ -194,7 +194,7 @@ class DooverTokenAuth extends doover_auth_1.DooverAuth {
194
194
  this.configManager.write();
195
195
  }
196
196
  catch (err) {
197
- throw new errors_1.DooverAuthError(`Failed to persist refreshed token: ${err instanceof Error ? err.message : String(err)}`);
197
+ throw new errors_js_1.DooverAuthError(`Failed to persist refreshed token: ${err instanceof Error ? err.message : String(err)}`);
198
198
  }
199
199
  }
200
200
  }
@@ -213,7 +213,7 @@ class DooverTokenAuth extends doover_auth_1.DooverAuth {
213
213
  return new Date(explicit);
214
214
  }
215
215
  if (token) {
216
- return (0, jwt_1.decodeTokenExpiry)(token);
216
+ return (0, jwt_js_1.decodeTokenExpiry)(token);
217
217
  }
218
218
  return null;
219
219
  }
@@ -0,0 +1,10 @@
1
+ export { DooverAuth } from "./doover-auth.js";
2
+ export { CookieAuth } from "./cookie-auth.js";
3
+ export type { CookieAuthOptions } from "./cookie-auth.js";
4
+ export { DooverTokenAuth } from "./doover-token-auth.js";
5
+ export { AuthProfile } from "./auth-profile.js";
6
+ export type { AuthProfileData } from "./auth-profile.js";
7
+ export type { AuthProfileStore } from "./auth-store.js";
8
+ export { DooverAuthError } from "./errors.js";
9
+ export { buildAuth } from "./build-auth.js";
10
+ export type { AuthConfig } from "./build-auth.js";
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildAuth = exports.DooverAuthError = exports.AuthProfile = exports.DooverTokenAuth = exports.CookieAuth = exports.DooverAuth = void 0;
4
+ var doover_auth_js_1 = require("./doover-auth.js");
5
+ Object.defineProperty(exports, "DooverAuth", { enumerable: true, get: function () { return doover_auth_js_1.DooverAuth; } });
6
+ var cookie_auth_js_1 = require("./cookie-auth.js");
7
+ Object.defineProperty(exports, "CookieAuth", { enumerable: true, get: function () { return cookie_auth_js_1.CookieAuth; } });
8
+ var doover_token_auth_js_1 = require("./doover-token-auth.js");
9
+ Object.defineProperty(exports, "DooverTokenAuth", { enumerable: true, get: function () { return doover_token_auth_js_1.DooverTokenAuth; } });
10
+ var auth_profile_js_1 = require("./auth-profile.js");
11
+ Object.defineProperty(exports, "AuthProfile", { enumerable: true, get: function () { return auth_profile_js_1.AuthProfile; } });
12
+ var errors_js_1 = require("./errors.js");
13
+ Object.defineProperty(exports, "DooverAuthError", { enumerable: true, get: function () { return errors_js_1.DooverAuthError; } });
14
+ var build_auth_js_1 = require("./build-auth.js");
15
+ Object.defineProperty(exports, "buildAuth", { enumerable: true, get: function () { return build_auth_js_1.buildAuth; } });
@@ -1,17 +1,18 @@
1
- import type { AgentsApi } from "../apis/agents-api";
2
- import type { AggregatesApi } from "../apis/aggregates-api";
3
- import type { AlarmsApi } from "../apis/alarms-api";
4
- import type { ChannelsApi } from "../apis/channels-api";
5
- import type { ConnectionsApi } from "../apis/connections-api";
6
- import type { MessagesApi } from "../apis/messages-api";
7
- import type { NotificationsApi } from "../apis/notifications-api";
8
- import type { PermissionsApi } from "../apis/permissions-api";
9
- import type { ProcessorsApi } from "../apis/processors-api";
10
- import type { TurnApi } from "../apis/turn-api";
11
- import type { UsersApi } from "../apis/users-api";
12
- import type { GatewayClient } from "../gateway/gateway-client";
13
- import type { RpcDispatcher } from "../rpc/rpc-dispatcher";
14
- import type { Capability } from "./capabilities";
1
+ import type { NetworkStatusSource } from "./network-status.js";
2
+ import type { AgentsApi } from "../apis/agents-api.js";
3
+ import type { AggregatesApi } from "../apis/aggregates-api.js";
4
+ import type { AlarmsApi } from "../apis/alarms-api.js";
5
+ import type { ChannelsApi } from "../apis/channels-api.js";
6
+ import type { ConnectionsApi } from "../apis/connections-api.js";
7
+ import type { MessagesApi } from "../apis/messages-api.js";
8
+ import type { NotificationsApi } from "../apis/notifications-api.js";
9
+ import type { PermissionsApi } from "../apis/permissions-api.js";
10
+ import type { ProcessorsApi } from "../apis/processors-api.js";
11
+ import type { TurnApi } from "../apis/turn-api.js";
12
+ import type { UsersApi } from "../apis/users-api.js";
13
+ import type { GatewayClient } from "../gateway/gateway-client.js";
14
+ import type { RpcDispatcher } from "../rpc/rpc-dispatcher.js";
15
+ import type { Capability } from "./capabilities.js";
15
16
  /**
16
17
  * Public structural shape of each concrete subclient — `Pick<Class, keyof Class>`
17
18
  * yields just the public members as a plain object type (no nominal/private-member
@@ -76,6 +77,8 @@ export interface DataClientStatus {
76
77
  * later; the invariant is that `DooverClient` always satisfies it.
77
78
  */
78
79
  export interface DataClient {
80
+ /** Optional platform source; React hooks otherwise use browser network status. */
81
+ readonly networkStatus?: NetworkStatusSource;
79
82
  readonly agents: AgentsApiLike;
80
83
  readonly channels: ChannelsApiLike;
81
84
  readonly messages: MessagesApiLike;
@@ -1,11 +1,13 @@
1
- import { OrganisationsApi } from "../apis/organisations-api";
2
- import type { DooverAuth } from "../auth/doover-auth";
3
- import { RestClient, type DooverClientConfig } from "../http/rest-client";
4
- import { DooverDataProvider } from "../viewer/doover-data-provider";
5
- import { type Capability } from "./capabilities";
6
- import type { AgentsApiLike, AggregatesApiLike, AlarmsApiLike, ChannelsApiLike, ConnectionsApiLike, DataClient, DataClientStatus, AgentScope, GatewayClientLike, MessagesApiLike, NotificationsApiLike, PermissionsApiLike, ProcessorsApiLike, RpcDispatcherLike, TurnApiLike, UsersApiLike } from "./data-client";
7
- import { DooverStatsCollector, type DooverStatsSnapshot } from "./stats";
1
+ import { type NetworkStatusSource } from "./network-status.js";
2
+ import { OrganisationsApi } from "../apis/organisations-api.js";
3
+ import type { DooverAuth } from "../auth/doover-auth.js";
4
+ import { RestClient, type DooverClientConfig } from "../http/rest-client.js";
5
+ import { DooverDataProvider } from "../viewer/doover-data-provider.js";
6
+ import { type Capability } from "./capabilities.js";
7
+ import type { AgentsApiLike, AggregatesApiLike, AlarmsApiLike, ChannelsApiLike, ConnectionsApiLike, DataClient, DataClientStatus, AgentScope, GatewayClientLike, MessagesApiLike, NotificationsApiLike, PermissionsApiLike, ProcessorsApiLike, RpcDispatcherLike, TurnApiLike, UsersApiLike } from "./data-client.js";
8
+ import { DooverStatsCollector, type DooverStatsSnapshot } from "./stats.js";
8
9
  export declare class DooverClient implements DataClient {
10
+ readonly networkStatus: NetworkStatusSource;
9
11
  readonly auth: DooverAuth;
10
12
  readonly rest: RestClient;
11
13
  readonly viewer: DooverDataProvider;
@@ -1,31 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DooverClient = void 0;
4
- const agents_api_1 = require("../apis/agents-api");
5
- const aggregates_api_1 = require("../apis/aggregates-api");
6
- const alarms_api_1 = require("../apis/alarms-api");
7
- const channels_api_1 = require("../apis/channels-api");
8
- const connections_api_1 = require("../apis/connections-api");
9
- const messages_api_1 = require("../apis/messages-api");
10
- const notifications_api_1 = require("../apis/notifications-api");
11
- const organisations_api_1 = require("../apis/organisations-api");
12
- const permissions_api_1 = require("../apis/permissions-api");
13
- const processors_api_1 = require("../apis/processors-api");
14
- const turn_api_1 = require("../apis/turn-api");
15
- const users_api_1 = require("../apis/users-api");
16
- const build_auth_1 = require("../auth/build-auth");
17
- const gateway_client_1 = require("../gateway/gateway-client");
18
- const rest_client_1 = require("../http/rest-client");
19
- const rpc_dispatcher_1 = require("../rpc/rpc-dispatcher");
20
- const doover_data_provider_1 = require("../viewer/doover-data-provider");
21
- const capabilities_1 = require("./capabilities");
22
- const provenance_1 = require("./provenance");
23
- const status_tracker_1 = require("./status-tracker");
24
- const stats_1 = require("./stats");
25
- const ALL_CAPS_SET = new Set(capabilities_1.ALL_CAPABILITIES);
4
+ const network_status_js_1 = require("./network-status.js");
5
+ const agents_api_js_1 = require("../apis/agents-api.js");
6
+ const aggregates_api_js_1 = require("../apis/aggregates-api.js");
7
+ const alarms_api_js_1 = require("../apis/alarms-api.js");
8
+ const channels_api_js_1 = require("../apis/channels-api.js");
9
+ const connections_api_js_1 = require("../apis/connections-api.js");
10
+ const messages_api_js_1 = require("../apis/messages-api.js");
11
+ const notifications_api_js_1 = require("../apis/notifications-api.js");
12
+ const organisations_api_js_1 = require("../apis/organisations-api.js");
13
+ const permissions_api_js_1 = require("../apis/permissions-api.js");
14
+ const processors_api_js_1 = require("../apis/processors-api.js");
15
+ const turn_api_js_1 = require("../apis/turn-api.js");
16
+ const users_api_js_1 = require("../apis/users-api.js");
17
+ const build_auth_js_1 = require("../auth/build-auth.js");
18
+ const gateway_client_js_1 = require("../gateway/gateway-client.js");
19
+ const rest_client_js_1 = require("../http/rest-client.js");
20
+ const rpc_dispatcher_js_1 = require("../rpc/rpc-dispatcher.js");
21
+ const doover_data_provider_js_1 = require("../viewer/doover-data-provider.js");
22
+ const capabilities_js_1 = require("./capabilities.js");
23
+ const provenance_js_1 = require("./provenance.js");
24
+ const status_tracker_js_1 = require("./status-tracker.js");
25
+ const stats_js_1 = require("./stats.js");
26
+ const ALL_CAPS_SET = new Set(capabilities_js_1.ALL_CAPABILITIES);
26
27
  class DooverClient {
27
28
  constructor(config) {
28
- this.auth = (0, build_auth_1.buildAuth)({
29
+ this.networkStatus = config.networkStatus ?? network_status_js_1.browserNetworkStatus;
30
+ this.auth = (0, build_auth_js_1.buildAuth)({
29
31
  auth: config.auth,
30
32
  profile: config.profile,
31
33
  configManager: config.configManager,
@@ -47,37 +49,37 @@ class DooverClient {
47
49
  ...(config.organisationId ? { organisationId: config.organisationId } : {}),
48
50
  },
49
51
  };
50
- const stamper = new provenance_1.ProvenanceStamper(this.identity);
51
- this.rest = new rest_client_1.RestClient(config, this.auth);
52
- this.gatewayImpl = new gateway_client_1.GatewayClient(config, this.auth);
52
+ const stamper = new provenance_js_1.ProvenanceStamper(this.identity);
53
+ this.rest = new rest_client_js_1.RestClient(config, this.auth);
54
+ this.gatewayImpl = new gateway_client_js_1.GatewayClient(config, this.auth);
53
55
  this.gatewayImpl.setProvenanceHook((value, ctx) => stamper.stampGatewayEvent(value, ctx));
54
56
  this.gateway = this.gatewayImpl;
55
- this.viewer = new doover_data_provider_1.DooverDataProvider({
57
+ this.viewer = new doover_data_provider_js_1.DooverDataProvider({
56
58
  rest: this.rest,
57
59
  gateway: this.gatewayImpl,
58
60
  controlApiUrl: config.controlApiUrl,
59
61
  });
60
- this.users = (0, provenance_1.wrapSubclient)(new users_api_1.UsersApi(this.rest, config.controlApiUrl), "users", stamper);
61
- this.channels = (0, provenance_1.wrapSubclient)(new channels_api_1.ChannelsApi(this.rest), "channels", stamper);
62
- this.messages = (0, provenance_1.wrapSubclient)(new messages_api_1.MessagesApi(this.rest), "messages", stamper);
63
- this.aggregates = (0, provenance_1.wrapSubclient)(new aggregates_api_1.AggregatesApi(this.rest), "aggregates", stamper);
64
- this.alarms = (0, provenance_1.wrapSubclient)(new alarms_api_1.AlarmsApi(this.rest), "alarms", stamper);
65
- this.connections = (0, provenance_1.wrapSubclient)(new connections_api_1.ConnectionsApi(this.rest), "connections", stamper);
66
- this.notifications = (0, provenance_1.wrapSubclient)(new notifications_api_1.NotificationsApi(this.rest), "notifications", stamper);
67
- this.organisations = (0, provenance_1.wrapSubclient)(new organisations_api_1.OrganisationsApi(this.rest, config.controlApiUrl), "organisations", stamper);
68
- this.permissions = (0, provenance_1.wrapSubclient)(new permissions_api_1.PermissionsApi(this.rest), "permissions", stamper);
69
- this.processors = (0, provenance_1.wrapSubclient)(new processors_api_1.ProcessorsApi(this.rest), "processors", stamper);
70
- this.turn = (0, provenance_1.wrapSubclient)(new turn_api_1.TurnApi(this.rest), "turn", stamper);
71
- this.agents = (0, provenance_1.wrapSubclient)(new agents_api_1.AgentsApi(this.rest, config.controlApiUrl), "agents", stamper);
62
+ this.users = (0, provenance_js_1.wrapSubclient)(new users_api_js_1.UsersApi(this.rest, config.controlApiUrl), "users", stamper);
63
+ this.channels = (0, provenance_js_1.wrapSubclient)(new channels_api_js_1.ChannelsApi(this.rest), "channels", stamper);
64
+ this.messages = (0, provenance_js_1.wrapSubclient)(new messages_api_js_1.MessagesApi(this.rest), "messages", stamper);
65
+ this.aggregates = (0, provenance_js_1.wrapSubclient)(new aggregates_api_js_1.AggregatesApi(this.rest), "aggregates", stamper);
66
+ this.alarms = (0, provenance_js_1.wrapSubclient)(new alarms_api_js_1.AlarmsApi(this.rest), "alarms", stamper);
67
+ this.connections = (0, provenance_js_1.wrapSubclient)(new connections_api_js_1.ConnectionsApi(this.rest), "connections", stamper);
68
+ this.notifications = (0, provenance_js_1.wrapSubclient)(new notifications_api_js_1.NotificationsApi(this.rest), "notifications", stamper);
69
+ this.organisations = (0, provenance_js_1.wrapSubclient)(new organisations_api_js_1.OrganisationsApi(this.rest, config.controlApiUrl), "organisations", stamper);
70
+ this.permissions = (0, provenance_js_1.wrapSubclient)(new permissions_api_js_1.PermissionsApi(this.rest), "permissions", stamper);
71
+ this.processors = (0, provenance_js_1.wrapSubclient)(new processors_api_js_1.ProcessorsApi(this.rest), "processors", stamper);
72
+ this.turn = (0, provenance_js_1.wrapSubclient)(new turn_api_js_1.TurnApi(this.rest), "turn", stamper);
73
+ this.agents = (0, provenance_js_1.wrapSubclient)(new agents_api_js_1.AgentsApi(this.rest, config.controlApiUrl), "agents", stamper);
72
74
  // RpcDispatcher needs the concrete MessagesApi (it calls postMessage internally);
73
75
  // give it an *unwrapped* one so stamping happens once at the public boundary.
74
- this.rpcImpl = new rpc_dispatcher_1.RpcDispatcher(this.gatewayImpl, new messages_api_1.MessagesApi(this.rest));
76
+ this.rpcImpl = new rpc_dispatcher_js_1.RpcDispatcher(this.gatewayImpl, new messages_api_js_1.MessagesApi(this.rest));
75
77
  this.rpc = this.rpcImpl;
76
- this.stats = new stats_1.DooverStatsCollector();
78
+ this.stats = new stats_js_1.DooverStatsCollector();
77
79
  this.rest.setStats(this.stats);
78
80
  this.gatewayImpl.setStats(this.stats);
79
81
  this.rpcImpl.setStats(this.stats);
80
- this.statusTracker = new status_tracker_1.ClientStatusTracker(this.identity.id, this.gateway, () => this.getKnownAgentScope());
82
+ this.statusTracker = new status_tracker_js_1.ClientStatusTracker(this.identity.id, this.gateway, () => this.getKnownAgentScope());
81
83
  }
82
84
  enableStats() { this.stats.setEnabled(true); }
83
85
  disableStats() { this.stats.setEnabled(false); }
@@ -1,5 +1,5 @@
1
- import type { Capability } from "./capabilities";
2
- import { DooverApiError } from "../http/errors";
1
+ import type { Capability } from "./capabilities.js";
2
+ import { DooverApiError } from "../http/errors.js";
3
3
  /**
4
4
  * Thrown when a `DataClient` method is called whose backing capability the
5
5
  * client does not advertise. Extends `DooverApiError` so existing
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DooverOfflineError = exports.AmbiguousWriteError = exports.UnsupportedCapabilityError = void 0;
4
- const errors_1 = require("../http/errors");
4
+ const errors_js_1 = require("../http/errors.js");
5
5
  /**
6
6
  * Thrown when a `DataClient` method is called whose backing capability the
7
7
  * client does not advertise. Extends `DooverApiError` so existing
8
8
  * `instanceof DooverApiError` error handling catches it; the HTTP-ish fields
9
9
  * are placeholders since no request was made.
10
10
  */
11
- class UnsupportedCapabilityError extends errors_1.DooverApiError {
11
+ class UnsupportedCapabilityError extends errors_js_1.DooverApiError {
12
12
  constructor(capability, clientId) {
13
13
  super({
14
14
  status: 0,
@@ -30,7 +30,7 @@ exports.UnsupportedCapabilityError = UnsupportedCapabilityError;
30
30
  * member — more than one enabled member owns the targeted agent and has the
31
31
  * write capability, and the call was not `sources`-scoped to one of them.
32
32
  */
33
- class AmbiguousWriteError extends errors_1.DooverApiError {
33
+ class AmbiguousWriteError extends errors_js_1.DooverApiError {
34
34
  constructor(capability, candidateSourceIds) {
35
35
  super({
36
36
  status: 0,
@@ -52,7 +52,7 @@ exports.AmbiguousWriteError = AmbiguousWriteError;
52
52
  * Thrown by offline-aware clients when a network-only operation is attempted
53
53
  * while offline, or when an offline read has no usable cached value.
54
54
  */
55
- class DooverOfflineError extends errors_1.DooverApiError {
55
+ class DooverOfflineError extends errors_js_1.DooverApiError {
56
56
  constructor(operation, message, cacheKey) {
57
57
  super({
58
58
  status: 0,
@@ -0,0 +1,6 @@
1
+ export { DooverClient } from "./doover-client.js";
2
+ export { getDooverClient, peekDooverClient, resetDooverClient } from "./singleton.js";
3
+ export type { DooverClientConfig } from "../http/rest-client.js";
4
+ export type * from "./data-client.js";
5
+ export { browserNetworkStatus, createNetworkStatusStore } from "./network-status.js";
6
+ export type { NetworkStatusSource, NetworkStatusSnapshot } from "./network-status.js";
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createNetworkStatusStore = exports.browserNetworkStatus = exports.resetDooverClient = exports.peekDooverClient = exports.getDooverClient = exports.DooverClient = void 0;
4
+ var doover_client_js_1 = require("./doover-client.js");
5
+ Object.defineProperty(exports, "DooverClient", { enumerable: true, get: function () { return doover_client_js_1.DooverClient; } });
6
+ var singleton_js_1 = require("./singleton.js");
7
+ Object.defineProperty(exports, "getDooverClient", { enumerable: true, get: function () { return singleton_js_1.getDooverClient; } });
8
+ Object.defineProperty(exports, "peekDooverClient", { enumerable: true, get: function () { return singleton_js_1.peekDooverClient; } });
9
+ Object.defineProperty(exports, "resetDooverClient", { enumerable: true, get: function () { return singleton_js_1.resetDooverClient; } });
10
+ var network_status_js_1 = require("./network-status.js");
11
+ Object.defineProperty(exports, "browserNetworkStatus", { enumerable: true, get: function () { return network_status_js_1.browserNetworkStatus; } });
12
+ Object.defineProperty(exports, "createNetworkStatusStore", { enumerable: true, get: function () { return network_status_js_1.createNetworkStatusStore; } });
@@ -1,6 +1,6 @@
1
- import { type DooverClientConfig } from "../http/rest-client";
2
- import type { Capability } from "./capabilities";
3
- import type { AgentScope, AgentsApiLike, AggregatesApiLike, AlarmsApiLike, ChannelsApiLike, ConnectionsApiLike, DataClient, DataClientStatus, GatewayClientLike, MessagesApiLike, NotificationsApiLike, PermissionsApiLike, ProcessorsApiLike, RpcDispatcherLike, TurnApiLike, UsersApiLike } from "./data-client";
1
+ import { type DooverClientConfig } from "../http/rest-client.js";
2
+ import type { Capability } from "./capabilities.js";
3
+ import type { AgentScope, AgentsApiLike, AggregatesApiLike, AlarmsApiLike, ChannelsApiLike, ConnectionsApiLike, DataClient, DataClientStatus, GatewayClientLike, MessagesApiLike, NotificationsApiLike, PermissionsApiLike, ProcessorsApiLike, RpcDispatcherLike, TurnApiLike, UsersApiLike } from "./data-client.js";
4
4
  export interface LocalAgentClientConfig {
5
5
  /** Base URL of the local agent's REST API, e.g. "http://192.168.0.7:49100". */
6
6
  baseUrl: string;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LocalAgentClient = 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 messages_api_1 = require("../apis/messages-api");
8
- const gateway_client_1 = require("../gateway/gateway-client");
9
- const rest_client_1 = require("../http/rest-client");
10
- const errors_1 = require("./errors");
11
- const provenance_1 = require("./provenance");
12
- const status_tracker_1 = require("./status-tracker");
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 messages_api_js_1 = require("../apis/messages-api.js");
8
+ const gateway_client_js_1 = require("../gateway/gateway-client.js");
9
+ const rest_client_js_1 = require("../http/rest-client.js");
10
+ const errors_js_1 = require("./errors.js");
11
+ const provenance_js_1 = require("./provenance.js");
12
+ const status_tracker_js_1 = require("./status-tracker.js");
13
13
  const LOCAL_CAPABILITIES = [
14
14
  "agents.list",
15
15
  "channels.list",
@@ -49,7 +49,7 @@ class LocalAgentClient {
49
49
  meta: { baseUrl: config.baseUrl },
50
50
  };
51
51
  this.capSet = new Set(LOCAL_CAPABILITIES);
52
- const stamper = new provenance_1.ProvenanceStamper(this.identity);
52
+ const stamper = new provenance_js_1.ProvenanceStamper(this.identity);
53
53
  // RestClient / GatewayClient expect a DooverClientConfig — give them one
54
54
  // with the local URLs, no auth, no org/sharing headers.
55
55
  const restConfig = {
@@ -63,16 +63,16 @@ class LocalAgentClient {
63
63
  webSocketFactory: config.webSocketFactory,
64
64
  disableBrowserLifecycleHooks: config.disableBrowserLifecycleHooks,
65
65
  };
66
- this.rest = new rest_client_1.RestClient(restConfig); // no auth arg
67
- this.gatewayImpl = new gateway_client_1.GatewayClient(restConfig); // no auth arg
66
+ this.rest = new rest_client_js_1.RestClient(restConfig); // no auth arg
67
+ this.gatewayImpl = new gateway_client_js_1.GatewayClient(restConfig); // no auth arg
68
68
  this.gatewayImpl.setProvenanceHook((value, ctx) => stamper.stampGatewayEvent(value, ctx));
69
69
  this.gateway = this.gatewayImpl;
70
70
  // Real subclients for advertised methods, gated so only allowed methods pass;
71
71
  // all others throw UnsupportedCapabilityError.
72
- const realAgents = (0, provenance_1.wrapSubclient)(new agents_api_1.AgentsApi(this.rest, config.baseUrl), "agents", stamper);
73
- const realChannels = (0, provenance_1.wrapSubclient)(new channels_api_1.ChannelsApi(this.rest), "channels", stamper);
74
- const realMessages = (0, provenance_1.wrapSubclient)(new messages_api_1.MessagesApi(this.rest), "messages", stamper);
75
- const realAggregates = (0, provenance_1.wrapSubclient)(new aggregates_api_1.AggregatesApi(this.rest), "aggregates", stamper);
72
+ const realAgents = (0, provenance_js_1.wrapSubclient)(new agents_api_js_1.AgentsApi(this.rest, config.baseUrl), "agents", stamper);
73
+ const realChannels = (0, provenance_js_1.wrapSubclient)(new channels_api_js_1.ChannelsApi(this.rest), "channels", stamper);
74
+ const realMessages = (0, provenance_js_1.wrapSubclient)(new messages_api_js_1.MessagesApi(this.rest), "messages", stamper);
75
+ const realAggregates = (0, provenance_js_1.wrapSubclient)(new aggregates_api_js_1.AggregatesApi(this.rest), "aggregates", stamper);
76
76
  this.agents = this.gatedSubclient("agents", realAgents, ["listAgents"]);
77
77
  this.channels = this.gatedSubclient("channels", realChannels, ["listChannels", "getChannel"]);
78
78
  this.aggregates = this.gatedSubclient("aggregates", realAggregates, ["getAggregate", "putAggregate", "patchAggregate"]);
@@ -86,7 +86,7 @@ class LocalAgentClient {
86
86
  this.turn = this.unsupportedSubclient("turn");
87
87
  this.users = this.unsupportedSubclient("users");
88
88
  this.rpc = this.unsupportedSubclient("rpc");
89
- this.statusTracker = new status_tracker_1.ClientStatusTracker(this.identity.id, this.gateway, () => this.getKnownAgentScope());
89
+ this.statusTracker = new status_tracker_js_1.ClientStatusTracker(this.identity.id, this.gateway, () => this.getKnownAgentScope());
90
90
  // Resolve the device id on (re)connect so routing is precise before the
91
91
  // first agent-scoped request; invalidate the cache on each new session.
92
92
  this.gatewayImpl.on("ready", () => {
@@ -154,7 +154,7 @@ class LocalAgentClient {
154
154
  return Reflect.get(target, prop, receiver);
155
155
  return () => {
156
156
  const cap = METHOD_TO_CAPABILITY[`${name}.${prop}`] ?? guessCapability(name);
157
- return Promise.reject(new errors_1.UnsupportedCapabilityError(cap, clientId));
157
+ return Promise.reject(new errors_js_1.UnsupportedCapabilityError(cap, clientId));
158
158
  };
159
159
  },
160
160
  });
@@ -172,7 +172,7 @@ class LocalAgentClient {
172
172
  return undefined;
173
173
  return () => {
174
174
  const cap = METHOD_TO_CAPABILITY[`${name}.${prop}`] ?? guessCapability(name);
175
- return Promise.reject(new errors_1.UnsupportedCapabilityError(cap, clientId));
175
+ return Promise.reject(new errors_js_1.UnsupportedCapabilityError(cap, clientId));
176
176
  };
177
177
  },
178
178
  });
@@ -1,8 +1,8 @@
1
- import type { Capability } from "./capabilities";
2
- import type { AgentScope, AgentsApiLike, AggregatesApiLike, AlarmsApiLike, ChannelsApiLike, ConnectionsApiLike, DataClient, DataClientStatus, GatewayClientLike, MessagesApiLike, NotificationsApiLike, PermissionsApiLike, ProcessorsApiLike, RpcDispatcherLike, TurnApiLike, UsersApiLike } from "./data-client";
3
- export type { DataClient } from "./data-client";
4
- export type { AgentScope } from "./data-client";
5
- export type { DataClientStatus } from "./data-client";
1
+ import type { Capability } from "./capabilities.js";
2
+ import type { AgentScope, AgentsApiLike, AggregatesApiLike, AlarmsApiLike, ChannelsApiLike, ConnectionsApiLike, DataClient, DataClientStatus, GatewayClientLike, MessagesApiLike, NotificationsApiLike, PermissionsApiLike, ProcessorsApiLike, RpcDispatcherLike, TurnApiLike, UsersApiLike } from "./data-client.js";
3
+ export type { DataClient } from "./data-client.js";
4
+ export type { AgentScope } from "./data-client.js";
5
+ export type { DataClientStatus } from "./data-client.js";
6
6
  export interface MultiplexConflict {
7
7
  method: string;
8
8
  agentId: string;