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
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Shared types for the bounded batch mutation endpoints.
3
+ *
4
+ * The data API exposes cross-agent batch mutations at `/agents/aggregates`
5
+ * and `/agents/messages`. Every item carries its own `agent_id` and
6
+ * `channel_name`, each is authorised independently, and the batch can
7
+ * partially succeed — results come back in request order and callers should
8
+ * retry only the failed entries.
9
+ *
10
+ * See `docs/batch-aggregate-updates.md` in channels-rest for the contract.
11
+ */
12
+ /**
13
+ * Server-enforced ceiling on items per batch request. Exceeding it is a 400,
14
+ * so callers must chunk. `chunkBatchItems` does this for you.
15
+ */
16
+ export const MAX_BATCH_ITEMS = 50;
17
+ /**
18
+ * Split `items` into server-acceptable chunks. Returns `[]` for an empty
19
+ * input, since an empty batch is a 400 rather than a no-op.
20
+ */
21
+ export function chunkBatchItems(items, size = MAX_BATCH_ITEMS) {
22
+ if (size < 1)
23
+ throw new RangeError("chunk size must be at least 1");
24
+ const out = [];
25
+ for (let i = 0; i < items.length; i += size) {
26
+ out.push(items.slice(i, i + size));
27
+ }
28
+ return out;
29
+ }
30
+ /**
31
+ * Merge several batch responses into one, as if the whole set had been sent
32
+ * in a single request. Useful after chunking.
33
+ */
34
+ export function mergeBatchResponses(responses) {
35
+ const items = responses.flatMap((r) => r.items);
36
+ return {
37
+ items,
38
+ count: items.length,
39
+ succeeded: items.filter((i) => i.success).length,
40
+ failed: items.filter((i) => !i.success).length,
41
+ };
42
+ }
@@ -0,0 +1,250 @@
1
+ import type { SourceProvenance } from "./provenance.js";
2
+ export type JSONPrimitive = null | boolean | number | string;
3
+ export type JSONValue = JSONPrimitive | JSONValue[] | {
4
+ [key: string]: JSONValue;
5
+ };
6
+ export interface Attachment {
7
+ url: string;
8
+ content_type: string | null;
9
+ filename: string;
10
+ size: number;
11
+ }
12
+ export interface ChannelRef {
13
+ agent_id: string;
14
+ name: string;
15
+ }
16
+ export interface Aggregate<TData = Record<string, JSONValue>> {
17
+ data: TData;
18
+ attachments: Attachment[];
19
+ last_updated?: number | null;
20
+ __source?: SourceProvenance;
21
+ }
22
+ export interface MessageAttachment extends Attachment {
23
+ }
24
+ export interface MessageStructure<TData = JSONValue> {
25
+ data: TData;
26
+ attachments: MessageAttachment[];
27
+ id: string;
28
+ author_id: string;
29
+ channel: ChannelRef;
30
+ timestamp: number;
31
+ record_log?: boolean;
32
+ __source?: SourceProvenance;
33
+ }
34
+ export interface Channel<TAgg = Record<string, JSONValue>> {
35
+ aggregate?: Aggregate<TAgg>;
36
+ is_private: boolean;
37
+ id?: string;
38
+ name: string;
39
+ owner_id: string;
40
+ alarms_enabled?: boolean;
41
+ aggregate_schema?: Record<string, JSONValue> | null;
42
+ message_schema?: Record<string, JSONValue> | null;
43
+ daily_message_summaries?: unknown[];
44
+ alarms?: Alarm[];
45
+ __source?: SourceProvenance;
46
+ }
47
+ export interface Alarm {
48
+ id: string;
49
+ name: string;
50
+ description: string;
51
+ /** Channel the alarm lives on — set on every alarm the REST API returns. */
52
+ channel_name?: string;
53
+ topic_name?: string;
54
+ notification_policy?: "default" | "opt-in";
55
+ enabled: boolean;
56
+ key: string;
57
+ operator: AlarmOperator;
58
+ value: JSONValue;
59
+ state: AlarmState;
60
+ expiry_mins: number | null;
61
+ entered_state_ts: number;
62
+ alarm_pending_ms: number | null;
63
+ rate_threshold?: number | null;
64
+ rate_window_ms?: number | null;
65
+ rate_baseline_value?: number | null;
66
+ rate_baseline_ts?: number | null;
67
+ messages?: AlarmMessages | null;
68
+ __source?: SourceProvenance;
69
+ }
70
+ /**
71
+ * Per-transition notification override. `notify` and `text` are independent:
72
+ * turning notifications off keeps whatever wording was set, and `text: null`
73
+ * means "use the auto-generated message".
74
+ */
75
+ export interface AlarmStateMessage {
76
+ notify?: boolean;
77
+ text?: string | null;
78
+ }
79
+ /** Notification overrides keyed by the state being entered. */
80
+ export interface AlarmMessages {
81
+ alarm?: AlarmStateMessage;
82
+ ok?: AlarmStateMessage;
83
+ pending?: AlarmStateMessage;
84
+ no_data?: AlarmStateMessage;
85
+ }
86
+ export type AlarmOperator = "eq" | "ge" | "gt" | "le" | "lt";
87
+ export type AlarmState = "NoData" | "OK" | "Alarm" | "AlarmPending";
88
+ export interface ConnectionSubscription {
89
+ channel: ChannelRef;
90
+ subscribed_at: number;
91
+ connection_id: string;
92
+ __source?: SourceProvenance;
93
+ }
94
+ export interface ConnectionSubscriptionLog {
95
+ channel: ChannelRef;
96
+ subscribed_at?: number | null;
97
+ unsubscribed_at?: number | null;
98
+ connection_id: string;
99
+ __source?: SourceProvenance;
100
+ }
101
+ export interface ConnectionDetails {
102
+ address: string;
103
+ agent_id: string;
104
+ default_session: boolean;
105
+ session_id: string;
106
+ last_ping?: number | null;
107
+ latency?: number | null;
108
+ status: number;
109
+ subscriptions: ConnectionSubscription[];
110
+ __source?: SourceProvenance;
111
+ }
112
+ /**
113
+ * How a subscription's `topic_filter` entries are matched. `exact` is literal
114
+ * (and the server's default when the field is absent); `regex` matches each
115
+ * expression against the whole canonical topic. Entries are ORed either way.
116
+ */
117
+ export type NotificationTopicFilterMode = "exact" | "regex";
118
+ export interface NotificationSubscriptionEndpoint {
119
+ id: string;
120
+ name: string;
121
+ default: boolean;
122
+ }
123
+ export interface NotificationSubscription {
124
+ id: string;
125
+ subscriber: string;
126
+ subscribed_to: string;
127
+ severity: number;
128
+ topic_filter: string[];
129
+ topic_filter_mode: NotificationTopicFilterMode;
130
+ endpoints: NotificationSubscriptionEndpoint[];
131
+ __source?: SourceProvenance;
132
+ }
133
+ export interface NotificationEndpoint {
134
+ id: string;
135
+ agent_id: string;
136
+ type: number;
137
+ priority: number | null;
138
+ extra_data: Record<string, JSONValue>;
139
+ name: string;
140
+ default: boolean;
141
+ __source?: SourceProvenance;
142
+ }
143
+ /**
144
+ * Delivery readiness for an endpoint, without its destination address or
145
+ * `extra_data` — the one endpoint listing a delegated subscription manager is
146
+ * allowed to see.
147
+ */
148
+ export interface NotificationEndpointSummary {
149
+ id: string;
150
+ type: number;
151
+ priority: number | null;
152
+ name: string;
153
+ display_name: string | null;
154
+ default: boolean;
155
+ ready: boolean;
156
+ __source?: SourceProvenance;
157
+ }
158
+ export interface ResourcePermission {
159
+ permission_id: string;
160
+ permission: string;
161
+ }
162
+ export interface AgentPermission {
163
+ agent_id: string;
164
+ is_superuser: boolean;
165
+ resources: ResourcePermission[];
166
+ last_updated?: number | null;
167
+ __source?: SourceProvenance;
168
+ }
169
+ export interface TurnCredential {
170
+ username: string;
171
+ credential: string;
172
+ ttl: number;
173
+ expires_at: number;
174
+ uris: string[];
175
+ __source?: SourceProvenance;
176
+ }
177
+ export interface AgentAggregate<TData = Record<string, JSONValue>> {
178
+ agent_id: string;
179
+ data: TData;
180
+ attachments: Attachment[];
181
+ last_updated?: number | null;
182
+ __source?: SourceProvenance;
183
+ }
184
+ export interface DataSeriesResult {
185
+ value: JSONValue;
186
+ message_id: string;
187
+ __source?: SourceProvenance;
188
+ }
189
+ export interface DataSeries {
190
+ count: number;
191
+ results: DataSeriesResult[];
192
+ next?: string | null;
193
+ __source?: SourceProvenance;
194
+ }
195
+ /**
196
+ * Lifecycle status for an RPC.
197
+ *
198
+ * `sent` is written by the sender; the other non-terminal codes come from the
199
+ * device handling the request. `acknowledged` means it has picked the request
200
+ * up, and `pending` carries arbitrary intermediate payloads (progress updates)
201
+ * it emits while still working — by convention a `{ text }` summary, plus
202
+ * whatever structured fields the handler wants alongside it. Both prove the
203
+ * device is alive, so consumers should treat either as a reason to extend how
204
+ * long they are willing to wait (see `SendRpcOptions.pendingTimeoutMs`), never
205
+ * as a completion.
206
+ *
207
+ * `success` and `error` are the only terminal codes.
208
+ */
209
+ export type RpcStatus<TPending = undefined> = {
210
+ code: "awaiting_confirmation";
211
+ } | {
212
+ code: "sent";
213
+ } | {
214
+ code: "acknowledged";
215
+ message: {
216
+ timestamp: number;
217
+ };
218
+ } | {
219
+ code: "error";
220
+ message: string | object;
221
+ } | {
222
+ code: "deferred";
223
+ message: {
224
+ until: number;
225
+ at: number;
226
+ };
227
+ } | {
228
+ code: "pending";
229
+ message: TPending;
230
+ } | {
231
+ code: "success";
232
+ };
233
+ export interface RpcActor {
234
+ id: string;
235
+ name: string;
236
+ email: string;
237
+ }
238
+ /** Shape a consumer posts to initiate an RPC. */
239
+ export interface RpcRequest<TRequest = object> {
240
+ app_key?: string;
241
+ method: string;
242
+ request: TRequest;
243
+ actor?: RpcActor;
244
+ }
245
+ /** Shape of the message the server maintains as the RPC progresses. */
246
+ export interface RpcMessageData<TRequest = object, TResponse = object, TPending = undefined> extends RpcRequest<TRequest> {
247
+ status: RpcStatus<TPending>;
248
+ response: TResponse;
249
+ __source?: SourceProvenance;
250
+ }
@@ -0,0 +1,72 @@
1
+ /** Platform's binary "is this device currently online?" verdict. */
2
+ export type ConnectionDetermination = "Online" | "Offline";
3
+ /**
4
+ * Transport mode the device negotiates.
5
+ * - `Continuous` keeps a long-lived websocket.
6
+ * - `Periodic` checks in on a schedule and disconnects between.
7
+ * - `PeriodicContinuous` holds a websocket while awake but lets it drop
8
+ * during scheduled sleep windows.
9
+ */
10
+ export type ConnectionType = "Continuous" | "Periodic" | "PeriodicContinuous";
11
+ /**
12
+ * Fine-grained transport status code. `…Online…` and `…Pending…` mean the
13
+ * device is up; `…Offline` means down; `…Unknown` / `PeriodicUnknown` means
14
+ * the platform hasn't determined either way yet (e.g. a Periodic device
15
+ * outside its expected check-in window).
16
+ */
17
+ export type ConnectionStatusCode = "ContinuousOnline" | "ContinuousOnlineNoPing" | "ContinuousOffline" | "ContinuousPending" | "PeriodicUnknown" | "Unknown";
18
+ /**
19
+ * Per-app preference for how this device's connection state should surface in
20
+ * user-facing UIs. The platform stores it but doesn't act on it itself — apps
21
+ * render accordingly.
22
+ */
23
+ export type ConnectionDisplay = "Always" | "OnlineOnly" | "OfflineOnly" | "Never";
24
+ /**
25
+ * The connection config block on a `doover_connection` aggregate. Mirrors
26
+ * pydoover's `ConnectionConfig`. All durations are in seconds (the project's
27
+ * convention only switches to ms for absolute timestamps); `next_wake_time`
28
+ * is an absolute timestamp and is therefore epoch ms.
29
+ */
30
+ export interface ConnectionConfig {
31
+ connection_type?: ConnectionType | null;
32
+ /** Expected interval between pings, in seconds (set by the device agent). */
33
+ expected_interval?: number | null;
34
+ /**
35
+ * Seconds of silence after which the platform marks the device offline.
36
+ * When unset the platform applies its defaults (120 s for `Continuous`,
37
+ * `expected_interval × 2` otherwise, 1 h fallback) — the resolved value
38
+ * may also be populated server-side.
39
+ */
40
+ offline_after?: number | null;
41
+ /** For `PeriodicContinuous` devices: how long the device sleeps between connections, in seconds. */
42
+ sleep_time?: number | null;
43
+ /** Epoch ms of the device's next scheduled wake (Periodic / PeriodicContinuous). */
44
+ next_wake_time?: number | null;
45
+ display?: ConnectionDisplay | null;
46
+ }
47
+ /**
48
+ * The status block on a `doover_connection` aggregate — the device's most
49
+ * recent transport observation. Timestamps are epoch ms.
50
+ */
51
+ export interface ConnectionStatusBlock {
52
+ status?: ConnectionStatusCode | null;
53
+ last_online?: number | null;
54
+ last_ping?: number | null;
55
+ user_agent?: string | null;
56
+ ip?: string | null;
57
+ /** Round-trip latency to the platform in ms (`Continuous` transports). */
58
+ latency_ms?: number | null;
59
+ }
60
+ /**
61
+ * Data shape of a device's `doover_connection` aggregate. Use as the generic
62
+ * to `useAgentChannel` for a typed read:
63
+ *
64
+ * ```ts
65
+ * const { data } = useAgentChannel<ConnectionAggregate>(agentId, "doover_connection");
66
+ * ```
67
+ */
68
+ export interface ConnectionAggregate {
69
+ status?: ConnectionStatusBlock | null;
70
+ determination?: ConnectionDetermination | null;
71
+ config?: ConnectionConfig | null;
72
+ }
@@ -0,0 +1,7 @@
1
+ // Types for the `doover_connection` channel — the platform-maintained
2
+ // per-device aggregate that summarises each device agent's transport status,
3
+ // keepalive timing, and connection config. Populated server-side from the
4
+ // device agent's pings (see channels-rest `connection_sync.rs`) and mirrored
5
+ // in pydoover's `ConnectionStatus` / `ConnectionDetermination` /
6
+ // `ConnectionType` / `ConnectionDisplay` / `ConnectionConfig`.
7
+ export {};
@@ -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,195 @@
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
+ export type { AgentAggregate, AgentPermission, Alarm, AlarmMessages, AlarmStateMessage, Aggregate, Channel, ConnectionDetails, ConnectionSubscription, ConnectionSubscriptionLog, DataSeries, MessageStructure, NotificationEndpoint, NotificationEndpointSummary, NotificationSubscription, NotificationTopicFilterMode, ResourcePermission, TurnCredential, };
3
+ export interface BatchMessagesResponse {
4
+ results: MessageStructure[];
5
+ count: number;
6
+ /**
7
+ * Per-agent resume cursors. Any agent whose fetch hit the per-agent
8
+ * limit before draining the window maps to the oldest snowflake we
9
+ * did return for it. Pass these back as `agent_before` (parallel to
10
+ * `agent_id`) on the next call to continue paginating each agent
11
+ * independently. Empty (or missing, on older servers) when the
12
+ * window is fully drained.
13
+ *
14
+ * This is the canonical pagination signal — `next` and
15
+ * `at_limit_agent_ids` are kept populated for back-compat with
16
+ * pre-`next_cursors` clients.
17
+ */
18
+ next_cursors?: Record<string, string>;
19
+ /**
20
+ * Legacy single-cursor pagination signal — the most-recent (highest
21
+ * snowflake id) oldest-cursor across at-limit agents. Clients
22
+ * paginating with a single global `before` should pass this back;
23
+ * prefer `next_cursors` + `agent_before` for new code.
24
+ */
25
+ next?: string | null;
26
+ /**
27
+ * Legacy: agent ids with possibly-more older messages — equivalent to
28
+ * `Object.keys(next_cursors)`. Prefer `next_cursors` for new code.
29
+ */
30
+ at_limit_agent_ids?: string[];
31
+ }
32
+ export interface BatchAggregatesResponse {
33
+ results: AgentAggregate[];
34
+ count: number;
35
+ }
36
+ export interface NotificationDataResponse {
37
+ subscriptions: NotificationSubscription[];
38
+ subscribers: NotificationSubscription[];
39
+ endpoints: NotificationEndpoint[];
40
+ }
41
+ export interface NotificationEndpointsResponse {
42
+ endpoints: NotificationEndpoint[];
43
+ }
44
+ export interface NotificationEndpointSummariesResponse {
45
+ endpoints: NotificationEndpointSummary[];
46
+ }
47
+ export interface NotificationSubscriptionsResponse {
48
+ subscriptions: NotificationSubscription[];
49
+ }
50
+ export interface NotificationSubscribersResponse {
51
+ subscribers: NotificationSubscription[];
52
+ }
53
+ export interface NotificationSubscriptionCreateResponse {
54
+ subscriptions: Array<{
55
+ id: string;
56
+ endpoint_id: string;
57
+ }>;
58
+ }
59
+ export interface PermissionDebugResponse {
60
+ cache?: AgentPermission | null;
61
+ db: AgentPermission;
62
+ }
63
+ export interface ScheduleInfo {
64
+ [key: string]: unknown;
65
+ }
66
+ export interface ProcessorSubscriptionInfo {
67
+ [key: string]: unknown;
68
+ }
69
+ export interface IngestionEndpointInfo {
70
+ [key: string]: unknown;
71
+ }
72
+ export interface SubscriptionInfo {
73
+ agent_id: string;
74
+ organisation_id: string;
75
+ app_key: string;
76
+ deployment_config: Record<string, unknown>;
77
+ ui_state: Record<string, unknown>;
78
+ ui_cmds: Record<string, unknown>;
79
+ tag_values: Record<string, unknown>;
80
+ connection_data: Record<string, unknown>;
81
+ token: string;
82
+ }
83
+ export interface SuccessListResponse<T = string> {
84
+ success: T[];
85
+ }
86
+ export interface CreateChannelRequest {
87
+ is_private?: boolean;
88
+ message_schema?: Record<string, unknown> | null;
89
+ aggregate_schema?: Record<string, unknown> | null;
90
+ }
91
+ export interface PutChannelRequest extends CreateChannelRequest {
92
+ is_private: boolean;
93
+ }
94
+ export interface CreateMessageRequest {
95
+ data: Record<string, unknown>;
96
+ ts?: number;
97
+ }
98
+ export interface UpdateMessageRequest {
99
+ data: Record<string, unknown>;
100
+ }
101
+ export interface CreateAlarmRequest {
102
+ name: string;
103
+ description?: string;
104
+ enabled?: boolean;
105
+ key: string;
106
+ operator: Alarm["operator"];
107
+ /**
108
+ * The threshold to compare against. Required for a threshold alarm, and
109
+ * must be left out entirely for a rate alarm — which states its condition
110
+ * with `rate_threshold` instead.
111
+ */
112
+ value?: unknown;
113
+ expiry_mins?: number | null;
114
+ alarm_pending_ms?: number | null;
115
+ /** Stable slug used in notification topics. Derived from `name` if absent. */
116
+ topic_name?: string;
117
+ notification_policy?: Alarm["notification_policy"];
118
+ /**
119
+ * Units per second, judged over at least `rate_window_ms`. Setting the pair
120
+ * makes this a rate-of-change alarm; they must be set together.
121
+ */
122
+ rate_threshold?: number | null;
123
+ rate_window_ms?: number | null;
124
+ messages?: AlarmMessages | null;
125
+ }
126
+ /**
127
+ * Every field is optional; each is merged rather than replaced. `messages` is
128
+ * merged state by state and field by field, so `{messages: {ok: {notify:
129
+ * false}}}` leaves the stored text alone, and an explicit `null` clears.
130
+ */
131
+ export interface PatchAlarmRequest extends Partial<CreateAlarmRequest> {
132
+ }
133
+ export interface CreateEndpointRequest {
134
+ name: string;
135
+ priority?: number | null;
136
+ type: number;
137
+ extra_data: Record<string, unknown>;
138
+ default: boolean;
139
+ }
140
+ export interface UpdateEndpointRequest {
141
+ extra_data?: Record<string, unknown> | null;
142
+ priority?: number | null;
143
+ name?: string;
144
+ }
145
+ export interface CreateNotificationSubscriptionRequest {
146
+ subscribe_to: string;
147
+ endpoint_id?: string | null;
148
+ severity: number;
149
+ topic_filter: string[];
150
+ /** Defaults to `exact` server-side when absent. */
151
+ topic_filter_mode?: NotificationTopicFilterMode;
152
+ }
153
+ export interface UpdateNotificationSubscriptionRequest {
154
+ severity?: number;
155
+ topic_filter?: string[];
156
+ topic_filter_mode?: NotificationTopicFilterMode;
157
+ }
158
+ export interface UpdateMeWebPushEndpointRequest {
159
+ old_endpoint: string;
160
+ endpoint: string;
161
+ key_p256dh: string;
162
+ key_auth: string;
163
+ expires_at: number;
164
+ }
165
+ export interface SyncPermissionRequest {
166
+ agent_permissions: AgentPermission[];
167
+ }
168
+ export interface PutScheduleRequest {
169
+ app_key: string;
170
+ is_org?: boolean | null;
171
+ permissions: ResourcePermission[];
172
+ }
173
+ export interface PutSubscriptionRequest {
174
+ subscription_arn: string;
175
+ app_key: string;
176
+ is_org?: boolean | null;
177
+ permissions: ResourcePermission[];
178
+ }
179
+ export interface CreateIngestionRequest {
180
+ lambda_arn: string;
181
+ cidr_ranges: string[];
182
+ signing_key?: string | null;
183
+ signing_key_hash_header?: string | null;
184
+ throttle_limit: number;
185
+ never_replace_token?: boolean;
186
+ mini_token?: boolean;
187
+ is_org?: boolean | null;
188
+ app_key: string;
189
+ permissions: ResourcePermission[];
190
+ }
191
+ export interface TurnTokenRequest {
192
+ role: "client" | "device";
193
+ device_id?: string;
194
+ camera_name: string;
195
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Provenance envelope stamped on every datum a `DataClient` returns —
3
+ * describing which client produced it, when, and how (REST request with
4
+ * params/timing, or gateway event with name/receipt time).
5
+ *
6
+ * Purely additive: every data shape gains `__source?: SourceProvenance`.
7
+ * Nothing existing is removed/renamed/modified.
8
+ */
9
+ export interface SourceProvenance {
10
+ /** Which DataClient produced this datum. For a stand-alone client this is
11
+ * its own id; for an item via a MultiplexClient it is the originating
12
+ * member's id. */
13
+ client: {
14
+ id: string;
15
+ /** "cloud" | "local" | … */
16
+ kind: string;
17
+ label?: string;
18
+ /** Arbitrary client/source metadata (base URL, org id, device id, …). */
19
+ meta?: Record<string, unknown>;
20
+ };
21
+ /** When the client obtained this datum (epoch ms). */
22
+ retrievedAt: number;
23
+ via: SourceProvenanceViaRest | SourceProvenanceViaGateway;
24
+ }
25
+ export interface SourceProvenanceViaRest {
26
+ transport: "rest";
27
+ /** The DataClient method that produced it, e.g. "messages.listMessages". */
28
+ method: string;
29
+ /** The input the caller passed (agentId, channelName, params, body summary). */
30
+ request: Record<string, unknown>;
31
+ /** When the request was dispatched (epoch ms). */
32
+ startedAt: number;
33
+ /** Time from dispatch to response completion (ms). */
34
+ durationMs: number;
35
+ /** HTTP status, when known. */
36
+ status?: number;
37
+ }
38
+ export interface SourceProvenanceViaGateway {
39
+ transport: "gateway";
40
+ /** The gateway event that carried it, e.g. "messageCreate", "aggregateUpdate". */
41
+ event: string;
42
+ sessionId?: string;
43
+ /** When the event was received (epoch ms). */
44
+ receivedAt: number;
45
+ }