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.
- package/README.md +106 -0
- package/dist/apis/_args.js +5 -5
- package/dist/apis/agents-api.d.ts +4 -4
- package/dist/apis/agents-api.js +2 -2
- package/dist/apis/aggregates-api.d.ts +4 -4
- package/dist/apis/aggregates-api.js +5 -5
- package/dist/apis/alarms-api.d.ts +2 -2
- package/dist/apis/alarms-api.js +3 -3
- package/dist/apis/channels-api.d.ts +3 -3
- package/dist/apis/channels-api.js +6 -6
- package/dist/apis/connections-api.d.ts +2 -2
- package/dist/apis/connections-api.js +6 -6
- package/dist/apis/messages-api.d.ts +4 -4
- package/dist/apis/messages-api.js +11 -11
- package/dist/apis/notifications-api.d.ts +2 -2
- package/dist/apis/notifications-api.js +4 -4
- package/dist/apis/organisations-api.d.ts +2 -2
- package/dist/apis/permissions-api.d.ts +2 -2
- package/dist/apis/permissions-api.js +3 -3
- package/dist/apis/processors-api.d.ts +2 -2
- package/dist/apis/turn-api.d.ts +2 -2
- package/dist/apis/users-api.d.ts +2 -2
- package/dist/auth/auth-store.d.ts +1 -1
- package/dist/auth/build-auth.d.ts +3 -3
- package/dist/auth/build-auth.js +8 -8
- package/dist/auth/cookie-auth.d.ts +1 -1
- package/dist/auth/cookie-auth.js +2 -2
- package/dist/auth/doover-auth.d.ts +2 -2
- package/dist/auth/doover-token-auth.d.ts +3 -3
- package/dist/auth/doover-token-auth.js +13 -13
- package/dist/auth/index.d.ts +10 -0
- package/dist/auth/index.js +15 -0
- package/dist/client/data-client.d.ts +17 -14
- package/dist/client/doover-client.d.ts +9 -7
- package/dist/client/doover-client.js +44 -42
- package/dist/client/errors.d.ts +2 -2
- package/dist/client/errors.js +4 -4
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +12 -0
- package/dist/client/local-agent-client.d.ts +3 -3
- package/dist/client/local-agent-client.js +19 -19
- package/dist/client/multiplex-client.d.ts +5 -5
- package/dist/client/multiplex-client.js +25 -25
- package/dist/client/multiplex-gateway.d.ts +3 -3
- package/dist/client/multiplex-merge.d.ts +1 -1
- package/dist/client/network-status.d.ts +17 -0
- package/dist/client/network-status.js +70 -0
- package/dist/client/offline-cache.d.ts +9 -4
- package/dist/client/offline-cache.js +34 -22
- package/dist/client/provenance.d.ts +1 -1
- package/dist/client/request-options.d.ts +1 -1
- package/dist/client/singleton.d.ts +2 -2
- package/dist/client/singleton.js +2 -2
- package/dist/client/status-tracker.d.ts +1 -1
- package/dist/esm/apis/_args.d.ts +16 -0
- package/dist/esm/apis/_args.js +27 -0
- package/dist/esm/apis/agents-api.d.ts +196 -0
- package/dist/esm/apis/agents-api.js +327 -0
- package/dist/esm/apis/aggregates-api.d.ts +67 -0
- package/dist/esm/apis/aggregates-api.js +64 -0
- package/dist/esm/apis/alarms-api.d.ts +48 -0
- package/dist/esm/apis/alarms-api.js +75 -0
- package/dist/esm/apis/channels-api.d.ts +83 -0
- package/dist/esm/apis/channels-api.js +65 -0
- package/dist/esm/apis/connections-api.d.ts +45 -0
- package/dist/esm/apis/connections-api.js +44 -0
- package/dist/esm/apis/messages-api.d.ts +128 -0
- package/dist/esm/apis/messages-api.js +179 -0
- package/dist/esm/apis/notifications-api.d.ts +94 -0
- package/dist/esm/apis/notifications-api.js +153 -0
- package/dist/esm/apis/organisations-api.d.ts +26 -0
- package/dist/esm/apis/organisations-api.js +41 -0
- package/dist/esm/apis/permissions-api.d.ts +17 -0
- package/dist/esm/apis/permissions-api.js +23 -0
- package/dist/esm/apis/processors-api.d.ts +56 -0
- package/dist/esm/apis/processors-api.js +97 -0
- package/dist/esm/apis/turn-api.d.ts +7 -0
- package/dist/esm/apis/turn-api.js +8 -0
- package/dist/esm/apis/users-api.d.ts +8 -0
- package/dist/esm/apis/users-api.js +9 -0
- package/dist/esm/auth/auth-profile.d.ts +45 -0
- package/dist/esm/auth/auth-profile.js +68 -0
- package/dist/esm/auth/auth-store.d.ts +14 -0
- package/dist/esm/auth/build-auth.d.ts +38 -0
- package/dist/esm/auth/build-auth.js +92 -0
- package/dist/esm/auth/cookie-auth.d.ts +91 -0
- package/dist/esm/auth/cookie-auth.js +196 -0
- package/dist/esm/auth/doover-auth.d.ts +52 -0
- package/dist/esm/auth/doover-auth.js +28 -0
- package/dist/esm/auth/doover-token-auth.d.ts +39 -0
- package/dist/esm/auth/doover-token-auth.js +217 -0
- package/dist/esm/auth/errors.d.ts +3 -0
- package/dist/esm/auth/errors.js +6 -0
- package/dist/esm/auth/index.d.ts +10 -0
- package/dist/esm/auth/index.js +6 -0
- package/dist/esm/auth/jwt.d.ts +6 -0
- package/dist/esm/auth/jwt.js +26 -0
- package/dist/esm/client/capabilities.d.ts +10 -0
- package/dist/esm/client/capabilities.js +42 -0
- package/dist/esm/client/data-client.d.ts +107 -0
- package/dist/esm/client/doover-client.d.ts +48 -0
- package/dist/esm/client/doover-client.js +96 -0
- package/dist/esm/client/errors.d.ts +32 -0
- package/dist/esm/client/errors.js +64 -0
- package/dist/esm/client/index.d.ts +6 -0
- package/dist/esm/client/index.js +3 -0
- package/dist/esm/client/local-agent-client.d.ts +65 -0
- package/dist/esm/client/local-agent-client.js +225 -0
- package/dist/esm/client/multiplex-client.d.ts +165 -0
- package/dist/esm/client/multiplex-client.js +842 -0
- package/dist/esm/client/multiplex-gateway.d.ts +49 -0
- package/dist/esm/client/multiplex-gateway.js +110 -0
- package/dist/esm/client/multiplex-merge.d.ts +12 -0
- package/dist/esm/client/multiplex-merge.js +38 -0
- package/dist/esm/client/network-status.d.ts +17 -0
- package/dist/esm/client/network-status.js +66 -0
- package/dist/esm/client/offline-cache.d.ts +167 -0
- package/dist/esm/client/offline-cache.js +769 -0
- package/dist/esm/client/provenance.d.ts +60 -0
- package/dist/esm/client/provenance.js +108 -0
- package/dist/esm/client/request-options.d.ts +23 -0
- package/dist/esm/client/request-options.js +23 -0
- package/dist/esm/client/singleton.d.ts +26 -0
- package/dist/esm/client/singleton.js +54 -0
- package/dist/esm/client/stats.d.ts +79 -0
- package/dist/esm/client/stats.js +155 -0
- package/dist/esm/client/status-tracker.d.ts +24 -0
- package/dist/esm/client/status-tracker.js +86 -0
- package/dist/esm/gateway/gateway-client.d.ts +86 -0
- package/dist/esm/gateway/gateway-client.js +463 -0
- package/dist/esm/gateway/index.d.ts +3 -0
- package/dist/esm/gateway/index.js +1 -0
- package/dist/esm/gateway/types.d.ts +142 -0
- package/dist/esm/http/errors.d.ts +19 -0
- package/dist/esm/http/errors.js +22 -0
- package/dist/esm/http/index.d.ts +3 -0
- package/dist/esm/http/index.js +2 -0
- package/dist/esm/http/rest-client.d.ts +64 -0
- package/dist/esm/http/rest-client.js +181 -0
- package/dist/esm/index.d.ts +64 -0
- package/dist/esm/index.js +38 -0
- package/dist/esm/node/config-manager.d.ts +34 -0
- package/dist/esm/node/config-manager.js +140 -0
- package/dist/esm/node/index.d.ts +1 -0
- package/dist/esm/node/index.js +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/react/context.d.ts +23 -0
- package/dist/esm/react/context.js +28 -0
- package/dist/esm/react/index.d.ts +38 -0
- package/dist/esm/react/index.js +21 -0
- package/dist/esm/react/messageRangeStore.d.ts +93 -0
- package/dist/esm/react/messageRangeStore.js +140 -0
- package/dist/esm/react/sharedQueryClient.d.ts +21 -0
- package/dist/esm/react/sharedQueryClient.js +35 -0
- package/dist/esm/react/useAgentChannel.d.ts +8 -0
- package/dist/esm/react/useAgentChannel.js +9 -0
- package/dist/esm/react/useAgentConnections.d.ts +8 -0
- package/dist/esm/react/useAgentConnections.js +20 -0
- package/dist/esm/react/useAgentTokenState.d.ts +70 -0
- package/dist/esm/react/useAgentTokenState.js +127 -0
- package/dist/esm/react/useChannelAggregate.d.ts +64 -0
- package/dist/esm/react/useChannelAggregate.js +77 -0
- package/dist/esm/react/useChannelMessage.d.ts +45 -0
- package/dist/esm/react/useChannelMessage.js +79 -0
- package/dist/esm/react/useChannelMessages.d.ts +83 -0
- package/dist/esm/react/useChannelMessages.js +214 -0
- package/dist/esm/react/useChannelSubscription.d.ts +27 -0
- package/dist/esm/react/useChannelSubscription.js +30 -0
- package/dist/esm/react/useClientStatus.d.ts +10 -0
- package/dist/esm/react/useClientStatus.js +19 -0
- package/dist/esm/react/useConnectionState.d.ts +26 -0
- package/dist/esm/react/useConnectionState.js +45 -0
- package/dist/esm/react/useDeviceMap.d.ts +109 -0
- package/dist/esm/react/useDeviceMap.js +59 -0
- package/dist/esm/react/useInvocationLogs.d.ts +23 -0
- package/dist/esm/react/useInvocationLogs.js +37 -0
- package/dist/esm/react/useMultiAgentAggregates.d.ts +38 -0
- package/dist/esm/react/useMultiAgentAggregates.js +104 -0
- package/dist/esm/react/useMultiAgentChannelMessages.d.ts +79 -0
- package/dist/esm/react/useMultiAgentChannelMessages.js +169 -0
- package/dist/esm/react/useOfflineStatus.d.ts +8 -0
- package/dist/esm/react/useOfflineStatus.js +37 -0
- package/dist/esm/react/useSendMessage.d.ts +16 -0
- package/dist/esm/react/useSendMessage.js +26 -0
- package/dist/esm/react/useSendRpc.d.ts +68 -0
- package/dist/esm/react/useSendRpc.js +164 -0
- package/dist/esm/react/useTurnCredentials.d.ts +12 -0
- package/dist/esm/react/useTurnCredentials.js +22 -0
- package/dist/esm/react/useUpdateAggregate.d.ts +27 -0
- package/dist/esm/react/useUpdateAggregate.js +39 -0
- package/dist/esm/react/useUpdateMessage.d.ts +38 -0
- package/dist/esm/react/useUpdateMessage.js +36 -0
- package/dist/esm/refine/index.d.ts +72 -0
- package/dist/esm/refine/index.js +215 -0
- package/dist/esm/rpc/errors.d.ts +10 -0
- package/dist/esm/rpc/errors.js +19 -0
- package/dist/esm/rpc/index.d.ts +3 -0
- package/dist/esm/rpc/index.js +2 -0
- package/dist/esm/rpc/rpc-dispatcher.d.ts +41 -0
- package/dist/esm/rpc/rpc-dispatcher.js +141 -0
- package/dist/esm/types/audit.d.ts +53 -0
- package/dist/esm/types/audit.js +11 -0
- package/dist/esm/types/batch.d.ts +85 -0
- package/dist/esm/types/batch.js +42 -0
- package/dist/esm/types/common.d.ts +250 -0
- package/dist/esm/types/connection.d.ts +72 -0
- package/dist/esm/types/connection.js +7 -0
- package/dist/esm/types/index.d.ts +9 -0
- package/dist/esm/types/openapi.d.ts +195 -0
- package/dist/esm/types/provenance.d.ts +45 -0
- package/dist/esm/types/viewer.d.ts +122 -0
- package/dist/esm/utils/snowflake.d.ts +21 -0
- package/dist/esm/utils/snowflake.js +33 -0
- package/dist/esm/viewer/doover-data-provider.d.ts +90 -0
- package/dist/esm/viewer/doover-data-provider.js +189 -0
- package/dist/esm/viewer/path-parsing.d.ts +5 -0
- package/dist/esm/viewer/path-parsing.js +35 -0
- package/dist/gateway/gateway-client.d.ts +5 -5
- package/dist/gateway/gateway-client.js +5 -5
- package/dist/gateway/index.d.ts +3 -0
- package/dist/gateway/index.js +5 -0
- package/dist/gateway/types.d.ts +1 -1
- package/dist/http/index.d.ts +3 -0
- package/dist/http/index.js +9 -0
- package/dist/http/rest-client.d.ts +5 -3
- package/dist/http/rest-client.js +2 -2
- package/dist/index.d.ts +64 -62
- package/dist/index.js +92 -89
- package/dist/node/config-manager.d.ts +2 -2
- package/dist/node/config-manager.js +5 -5
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +2 -2
- package/dist/react/context.d.ts +1 -1
- package/dist/react/index.d.ts +38 -38
- package/dist/react/index.js +59 -59
- package/dist/react/messageRangeStore.d.ts +1 -1
- package/dist/react/useAgentChannel.d.ts +3 -3
- package/dist/react/useAgentChannel.js +2 -2
- package/dist/react/useAgentConnections.d.ts +1 -1
- package/dist/react/useAgentConnections.js +2 -2
- package/dist/react/useAgentTokenState.d.ts +3 -3
- package/dist/react/useAgentTokenState.js +8 -8
- package/dist/react/useChannelAggregate.d.ts +3 -3
- package/dist/react/useChannelAggregate.js +8 -8
- package/dist/react/useChannelMessage.d.ts +2 -2
- package/dist/react/useChannelMessage.js +4 -4
- package/dist/react/useChannelMessages.d.ts +3 -3
- package/dist/react/useChannelMessages.js +10 -10
- package/dist/react/useChannelSubscription.d.ts +2 -2
- package/dist/react/useChannelSubscription.js +2 -2
- package/dist/react/useClientStatus.d.ts +1 -1
- package/dist/react/useClientStatus.js +2 -2
- package/dist/react/useConnectionState.js +2 -2
- package/dist/react/useDeviceMap.js +2 -2
- package/dist/react/useInvocationLogs.d.ts +1 -1
- package/dist/react/useInvocationLogs.js +2 -2
- package/dist/react/useMultiAgentAggregates.d.ts +1 -1
- package/dist/react/useMultiAgentAggregates.js +5 -5
- package/dist/react/useMultiAgentChannelMessages.d.ts +1 -1
- package/dist/react/useMultiAgentChannelMessages.js +2 -2
- package/dist/react/useOfflineStatus.d.ts +2 -2
- package/dist/react/useOfflineStatus.js +31 -17
- package/dist/react/useSendMessage.d.ts +2 -2
- package/dist/react/useSendMessage.js +2 -2
- package/dist/react/useSendRpc.d.ts +2 -2
- package/dist/react/useSendRpc.js +2 -2
- package/dist/react/useTurnCredentials.d.ts +2 -2
- package/dist/react/useTurnCredentials.js +2 -2
- package/dist/react/useUpdateAggregate.d.ts +3 -3
- package/dist/react/useUpdateAggregate.js +4 -4
- package/dist/react/useUpdateMessage.d.ts +2 -2
- package/dist/react/useUpdateMessage.js +2 -2
- package/dist/refine/index.d.ts +1 -1
- package/dist/rpc/errors.d.ts +1 -1
- package/dist/rpc/index.d.ts +3 -0
- package/dist/rpc/index.js +7 -0
- package/dist/rpc/rpc-dispatcher.d.ts +4 -4
- package/dist/rpc/rpc-dispatcher.js +2 -2
- package/dist/types/common.d.ts +1 -1
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +2 -0
- package/dist/types/openapi.d.ts +1 -1
- package/dist/types/viewer.d.ts +2 -2
- package/dist/viewer/doover-data-provider.d.ts +10 -10
- package/dist/viewer/doover-data-provider.js +25 -25
- package/dist/viewer/path-parsing.d.ts +1 -1
- package/package.json +795 -8
- package/dist/test/api-args.test.js +0 -48
- package/dist/test/api-overloads.test.d.ts +0 -9
- package/dist/test/api-overloads.test.js +0 -330
- package/dist/test/apis.test.js +0 -408
- package/dist/test/auth.test.js +0 -708
- package/dist/test/batch-apis.test.js +0 -183
- package/dist/test/capabilities.test.js +0 -27
- package/dist/test/config-manager.test.js +0 -160
- package/dist/test/data-client-errors.test.js +0 -24
- package/dist/test/data-client-shape.test.js +0 -28
- package/dist/test/doover-client-dataclient.test.d.ts +0 -1
- package/dist/test/doover-client-dataclient.test.js +0 -58
- package/dist/test/doover-client-provenance.test.d.ts +0 -1
- package/dist/test/doover-client-provenance.test.js +0 -32
- package/dist/test/doover-client.test.d.ts +0 -1
- package/dist/test/doover-client.test.js +0 -42
- package/dist/test/doover-data-provider.test.d.ts +0 -1
- package/dist/test/doover-data-provider.test.js +0 -657
- package/dist/test/exports.test.d.ts +0 -1
- package/dist/test/exports.test.js +0 -80
- package/dist/test/gateway-client.test.d.ts +0 -1
- package/dist/test/gateway-client.test.js +0 -474
- package/dist/test/gateway-provenance.test.d.ts +0 -1
- package/dist/test/gateway-provenance.test.js +0 -29
- package/dist/test/gateway-subscriptions.test.d.ts +0 -1
- package/dist/test/gateway-subscriptions.test.js +0 -95
- package/dist/test/helpers.d.ts +0 -32
- package/dist/test/helpers.js +0 -115
- package/dist/test/local-agent-client.test.d.ts +0 -1
- package/dist/test/local-agent-client.test.js +0 -202
- package/dist/test/message-range-store.test.d.ts +0 -1
- package/dist/test/message-range-store.test.js +0 -183
- package/dist/test/multiplex-capabilities.test.d.ts +0 -1
- package/dist/test/multiplex-capabilities.test.js +0 -37
- package/dist/test/multiplex-conflicts.test.d.ts +0 -1
- package/dist/test/multiplex-conflicts.test.js +0 -35
- package/dist/test/multiplex-gateway.test.d.ts +0 -1
- package/dist/test/multiplex-gateway.test.js +0 -103
- package/dist/test/multiplex-merge.test.d.ts +0 -1
- package/dist/test/multiplex-merge.test.js +0 -19
- package/dist/test/multiplex-noncore.test.d.ts +0 -1
- package/dist/test/multiplex-noncore.test.js +0 -82
- package/dist/test/multiplex-passthrough.test.d.ts +0 -1
- package/dist/test/multiplex-passthrough.test.js +0 -35
- package/dist/test/multiplex-reads.test.d.ts +0 -1
- package/dist/test/multiplex-reads.test.js +0 -87
- package/dist/test/multiplex-registry.test.d.ts +0 -1
- package/dist/test/multiplex-registry.test.js +0 -81
- package/dist/test/multiplex-routing.test.d.ts +0 -1
- package/dist/test/multiplex-routing.test.js +0 -45
- package/dist/test/multiplex-status.test.d.ts +0 -1
- package/dist/test/multiplex-status.test.js +0 -63
- package/dist/test/multiplex-writes.test.d.ts +0 -1
- package/dist/test/multiplex-writes.test.js +0 -93
- package/dist/test/offline-cache.test.d.ts +0 -1
- package/dist/test/offline-cache.test.js +0 -289
- package/dist/test/provenance-regression.test.d.ts +0 -1
- package/dist/test/provenance-regression.test.js +0 -45
- package/dist/test/provenance-stamper.test.d.ts +0 -1
- package/dist/test/provenance-stamper.test.js +0 -41
- package/dist/test/provenance-type.test.d.ts +0 -1
- package/dist/test/provenance-type.test.js +0 -15
- package/dist/test/react-channel-messages-forward.test.d.ts +0 -1
- package/dist/test/react-channel-messages-forward.test.js +0 -139
- package/dist/test/react-channel-messages-range.test.d.ts +0 -1
- package/dist/test/react-channel-messages-range.test.js +0 -109
- package/dist/test/react-client-status.test.d.ts +0 -1
- package/dist/test/react-client-status.test.js +0 -35
- package/dist/test/react-dataclient.test.d.ts +0 -1
- package/dist/test/react-dataclient.test.js +0 -28
- package/dist/test/react-exports.test.d.ts +0 -1
- package/dist/test/react-exports.test.js +0 -46
- package/dist/test/react-multiagent-messages.test.d.ts +0 -1
- package/dist/test/react-multiagent-messages.test.js +0 -113
- package/dist/test/react-sources-option.test.d.ts +0 -1
- package/dist/test/react-sources-option.test.js +0 -41
- package/dist/test/react.test.d.ts +0 -1
- package/dist/test/react.test.js +0 -482
- package/dist/test/refine.test.d.ts +0 -1
- package/dist/test/refine.test.js +0 -71
- package/dist/test/rest-client.test.d.ts +0 -1
- package/dist/test/rest-client.test.js +0 -197
- package/dist/test/rpc-dispatcher.test.d.ts +0 -1
- package/dist/test/rpc-dispatcher.test.js +0 -251
- package/dist/test/singleton.test.d.ts +0 -1
- package/dist/test/singleton.test.js +0 -62
- package/dist/test/stats-rpc.test.d.ts +0 -1
- package/dist/test/stats-rpc.test.js +0 -69
- package/dist/test/status-tracker.test.d.ts +0 -1
- package/dist/test/status-tracker.test.js +0 -85
- package/dist/test/users-api.test.d.ts +0 -1
- package/dist/test/users-api.test.js +0 -19
- package/dist/test/utils.test.d.ts +0 -1
- package/dist/test/utils.test.js +0 -64
- /package/dist/{test/api-args.test.d.ts → esm/auth/auth-store.js} +0 -0
- /package/dist/{test/apis.test.d.ts → esm/client/data-client.js} +0 -0
- /package/dist/{test/auth.test.d.ts → esm/gateway/types.js} +0 -0
- /package/dist/{test/batch-apis.test.d.ts → esm/types/common.js} +0 -0
- /package/dist/{test/capabilities.test.d.ts → esm/types/index.js} +0 -0
- /package/dist/{test/config-manager.test.d.ts → esm/types/openapi.js} +0 -0
- /package/dist/{test/data-client-errors.test.d.ts → esm/types/provenance.js} +0 -0
- /package/dist/{test/data-client-shape.test.d.ts → esm/types/viewer.js} +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,85 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript client for Doover.
|
|
4
4
|
|
|
5
|
+
## Tree shaking and smaller imports
|
|
6
|
+
|
|
7
|
+
The package publishes native ES modules for `import` and CommonJS for `require`.
|
|
8
|
+
Production bundlers can remove unused exports from the ESM build. Keep your
|
|
9
|
+
application's imports as ESM until bundling, and enable the bundler's production
|
|
10
|
+
optimisations. CommonJS consumers retain compatibility and can use the focused
|
|
11
|
+
entry points to load less code.
|
|
12
|
+
|
|
13
|
+
Applications that use the shared cloud client can keep their startup pattern:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { getDooverClient } from "doover-js/client";
|
|
17
|
+
|
|
18
|
+
const client = getDooverClient(config);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This entry point shares the root entry's singleton and excludes offline, local,
|
|
22
|
+
multiplex, and React implementations from the cloud startup bundle.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { extractSnowflakeId } from "doover-js/utils";
|
|
26
|
+
import { RestClient } from "doover-js/http";
|
|
27
|
+
import { ChannelsApi } from "doover-js/apis/channels";
|
|
28
|
+
|
|
29
|
+
const rest = new RestClient({
|
|
30
|
+
dataRestUrl: "https://example.com/api",
|
|
31
|
+
controlApiUrl: "https://example.com/control",
|
|
32
|
+
dataWssUrl: "wss://example.com/gateway",
|
|
33
|
+
});
|
|
34
|
+
const channels = new ChannelsApi(rest);
|
|
35
|
+
const items = await channels.listChannels("my-agent");
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This composition uses ambient cookies. For token auth or cookie refresh, pass an
|
|
39
|
+
auth instance from `doover-js/auth` as the second argument to `RestClient`.
|
|
40
|
+
`RestClient` does not build auth from token fields in its configuration.
|
|
41
|
+
The low-level API classes return server data directly. They do not add the
|
|
42
|
+
`DataClient` provenance, status, or capability behaviour supplied by `DooverClient`.
|
|
43
|
+
|
|
44
|
+
| Import path | Use |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `doover-js/client` | Cloud `DooverClient`, singleton helpers, and client types |
|
|
47
|
+
| `doover-js/local` | `LocalAgentClient` |
|
|
48
|
+
| `doover-js/multiplex` | `MultiplexClient` |
|
|
49
|
+
| `doover-js/offline` | Offline wrapper and storage adapter |
|
|
50
|
+
| `doover-js/http`, `doover-js/auth`, `doover-js/gateway`, `doover-js/rpc` | Individual transports and auth |
|
|
51
|
+
| `doover-js/apis/<resource>` | `agents`, `aggregates`, `alarms`, `channels`, `connections`, `messages`, `notifications`, `organisations`, `permissions`, `processors`, `turn`, or `users` |
|
|
52
|
+
| `doover-js/utils`, `doover-js/batch` | Snowflake and batch helpers |
|
|
53
|
+
| `doover-js/types` | Shared types, used with `import type` |
|
|
54
|
+
| `doover-js/capabilities`, `doover-js/errors`, `doover-js/request-options`, `doover-js/stats` | Shared client helpers |
|
|
55
|
+
| `doover-js/viewer` | Legacy `DooverDataProvider` |
|
|
56
|
+
| `doover-js/react/context` | `DooverProvider` and `useDooverClient`, without React Query |
|
|
57
|
+
| `doover-js/react/<hook>` | Each exported hook module, such as `useClientStatus` or `useChannelMessages` |
|
|
58
|
+
| `doover-js/react/sharedQueryClient` | Shared query client helpers |
|
|
59
|
+
| `doover-js/node`, `doover-js/react`, `doover-js/refine` | Existing integration entry points |
|
|
60
|
+
|
|
61
|
+
Related token mutation hooks share `doover-js/react/useAgentTokenState`.
|
|
62
|
+
All existing root exports remain available. A named ESM import from the root can
|
|
63
|
+
be as small as the equivalent focused import. Importing `DooverClient` still
|
|
64
|
+
includes its APIs, gateway, RPC, stats, and legacy viewer because its constructor
|
|
65
|
+
uses them. Choosing `doover-js/client` does not remove those features.
|
|
66
|
+
|
|
67
|
+
The `module` export condition directs supporting bundlers to one ESM copy even
|
|
68
|
+
when dependencies mix `import` and `require`. In native Node.js, or with bundlers
|
|
69
|
+
that disable this condition, use one module format throughout each application
|
|
70
|
+
runtime. Loading both builds creates separate class identities and React contexts,
|
|
71
|
+
although the existing global client and query-client helpers still share their caches.
|
|
72
|
+
The native ESM build has named exports. Replace an implicit CommonJS default import
|
|
73
|
+
such as `import doover from "doover-js"` with named imports or
|
|
74
|
+
`import * as doover from "doover-js"` when migrating to ESM.
|
|
75
|
+
Use TypeScript's `node16`, `nodenext`, or `bundler` module resolution for conditional
|
|
76
|
+
declarations. `typesVersions` also supports legacy `node` resolution.
|
|
77
|
+
|
|
78
|
+
The [HTML optimisation plan](docs/optimisation-plan.html) contains the size
|
|
79
|
+
comparison, remaining costs, and proposed API changes. Run `npm run size` to build
|
|
80
|
+
the package, check its published entry points, and write current bundle measurements
|
|
81
|
+
to `docs/optimisation-sizes.json`. Run `npm test` for type checking, the existing
|
|
82
|
+
tests, and package compatibility and size checks.
|
|
83
|
+
|
|
5
84
|
## Exports
|
|
6
85
|
|
|
7
86
|
### Root (`doover-js`)
|
|
@@ -310,3 +389,30 @@ const statuses = useClientStatus();
|
|
|
310
389
|
`*Api` resource methods accept either positional arguments or a `ChannelIdentifier` / `{ agentId }` object on every call form.
|
|
311
390
|
|
|
312
391
|
`client.rpc.send` adds optional `signal: AbortSignal` and `timeoutMs: number` and rejects with `DooverRpcError` (with `.status` and `.request`) instead of the bare status string.
|
|
392
|
+
|
|
393
|
+
## Network availability and offline cache status
|
|
394
|
+
|
|
395
|
+
`useOfflineStatus()` reports browser network changes for every client, including
|
|
396
|
+
`DooverClient` without an offline cache. It updates on initial offline load and
|
|
397
|
+
online/offline events even when no requests run. `online` describes the platform's
|
|
398
|
+
network signal; it does not prove that the Doover server is reachable.
|
|
399
|
+
`useClientStatus()` separately reports the gateway connection.
|
|
400
|
+
|
|
401
|
+
`OfflineDataClient` adds cache metadata such as `isOfflineFallback` and `cachedAt`.
|
|
402
|
+
These fields describe the last cache operation, not every item on the page. Its
|
|
403
|
+
snapshots retain object identity between changes for React external-store hooks.
|
|
404
|
+
Network transitions preserve cache metadata until another operation updates it.
|
|
405
|
+
|
|
406
|
+
Both clients accept `networkStatus`, a `NetworkStatusSource` with `getSnapshot()`
|
|
407
|
+
and `subscribe(listener)`. The offline wrapper inherits its underlying client's
|
|
408
|
+
source unless overridden. Sources return a stable `{ online, at }` snapshot and
|
|
409
|
+
notify subscribers when it changes. The exported `browserNetworkStatus` is the
|
|
410
|
+
default; it attaches browser listeners while subscribed and releases them after
|
|
411
|
+
the last unsubscribe. Outside a browser it assumes online when no platform
|
|
412
|
+
signal exists.
|
|
413
|
+
|
|
414
|
+
Native applications can pass `createNetworkStatusStore(initialOnline)` and call
|
|
415
|
+
its `setOnline(online)` method from platform network callbacks. Gateway failures
|
|
416
|
+
must not update this source. The legacy `OfflineDataClient.isOnline` callback
|
|
417
|
+
remains supported for request-time checks; a reactive source also updates the UI
|
|
418
|
+
between requests.
|
package/dist/apis/_args.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveChannelArgs = resolveChannelArgs;
|
|
4
4
|
exports.resolveAgentArgs = resolveAgentArgs;
|
|
5
|
-
const
|
|
5
|
+
const request_options_js_1 = require("../client/request-options.js");
|
|
6
6
|
function resolveChannelArgs(args) {
|
|
7
7
|
if (typeof args[0] === "string") {
|
|
8
|
-
const options = (0,
|
|
8
|
+
const options = (0, request_options_js_1.isDooverRequestOptions)(args[2]) ? undefined : args[2];
|
|
9
9
|
return {
|
|
10
10
|
agentId: args[0],
|
|
11
11
|
channelName: args[1],
|
|
@@ -13,7 +13,7 @@ function resolveChannelArgs(args) {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
const id = args[0];
|
|
16
|
-
const options = (0,
|
|
16
|
+
const options = (0, request_options_js_1.isDooverRequestOptions)(args[1]) ? undefined : args[1];
|
|
17
17
|
return {
|
|
18
18
|
agentId: id.agentId,
|
|
19
19
|
channelName: id.channelName,
|
|
@@ -22,10 +22,10 @@ function resolveChannelArgs(args) {
|
|
|
22
22
|
}
|
|
23
23
|
function resolveAgentArgs(args) {
|
|
24
24
|
if (typeof args[0] === "string") {
|
|
25
|
-
const options = (0,
|
|
25
|
+
const options = (0, request_options_js_1.isDooverRequestOptions)(args[1]) ? undefined : args[1];
|
|
26
26
|
return { agentId: args[0], options: options };
|
|
27
27
|
}
|
|
28
28
|
const id = args[0];
|
|
29
|
-
const options = (0,
|
|
29
|
+
const options = (0, request_options_js_1.isDooverRequestOptions)(args[1]) ? undefined : args[1];
|
|
30
30
|
return { agentId: id.agentId, options: options };
|
|
31
31
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AgentAggregate, BatchMessagesResponse } from "../types/openapi";
|
|
2
|
-
import type { AgentsResponse, GetAgentsOptions } from "../types/viewer";
|
|
3
|
-
import type { RestClient } from "../http/rest-client";
|
|
4
|
-
import type { DooverRequestOptions } from "../client/request-options";
|
|
1
|
+
import type { AgentAggregate, BatchMessagesResponse } from "../types/openapi.js";
|
|
2
|
+
import type { AgentsResponse, GetAgentsOptions } from "../types/viewer.js";
|
|
3
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
4
|
+
import type { DooverRequestOptions } from "../client/request-options.js";
|
|
5
5
|
export interface MultiAgentMessagesParams {
|
|
6
6
|
agent_id: string[];
|
|
7
7
|
/**
|
package/dist/apis/agents-api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgentsApi = void 0;
|
|
4
|
-
const
|
|
4
|
+
const snowflake_js_1 = require("../utils/snowflake.js");
|
|
5
5
|
function isPlainObject(value) {
|
|
6
6
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
7
|
}
|
|
@@ -158,7 +158,7 @@ class AgentsApi {
|
|
|
158
158
|
const { agent_id, agent_before, ...rest } = params;
|
|
159
159
|
const stampTimestamps = (response) => ({
|
|
160
160
|
...response,
|
|
161
|
-
results: response.results.map((message) => "timestamp" in message ? message : (0,
|
|
161
|
+
results: response.results.map((message) => "timestamp" in message ? message : (0, snowflake_js_1.addTimestampToMessage)(message)),
|
|
162
162
|
});
|
|
163
163
|
if (agent_id.length <= MULTI_AGENT_CHUNK_SIZE) {
|
|
164
164
|
const response = await this.rest.get(path, params);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { Aggregate } from "../types/openapi";
|
|
3
|
-
import type { DooverRequestOptions } from "../client/request-options";
|
|
4
|
-
import { type BatchAggregateResponse, type BatchAggregateUpdateItem } from "../types/batch";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { Aggregate } from "../types/openapi.js";
|
|
3
|
+
import type { DooverRequestOptions } from "../client/request-options.js";
|
|
4
|
+
import { type BatchAggregateResponse, type BatchAggregateUpdateItem } from "../types/batch.js";
|
|
5
5
|
export interface AggregateMutationParams {
|
|
6
6
|
suppress_response?: boolean;
|
|
7
7
|
clear_attachments?: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AggregatesApi = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const _args_js_1 = require("./_args.js");
|
|
5
|
+
const batch_js_1 = require("../types/batch.js");
|
|
6
6
|
class AggregatesApi {
|
|
7
7
|
constructor(rest) {
|
|
8
8
|
this.rest = rest;
|
|
@@ -17,15 +17,15 @@ class AggregatesApi {
|
|
|
17
17
|
const responses = [];
|
|
18
18
|
// Sequential: the point of batching is to stop hammering the write path,
|
|
19
19
|
// so firing every chunk at once would defeat it.
|
|
20
|
-
for (const chunk of (0,
|
|
20
|
+
for (const chunk of (0, batch_js_1.chunkBatchItems)(items)) {
|
|
21
21
|
responses.push(await this.rest.patch("/agents/aggregates", {
|
|
22
22
|
items: chunk,
|
|
23
23
|
}));
|
|
24
24
|
}
|
|
25
|
-
return (0,
|
|
25
|
+
return (0, batch_js_1.mergeBatchResponses)(responses);
|
|
26
26
|
}
|
|
27
27
|
getAggregate(...args) {
|
|
28
|
-
const { agentId, channelName } = (0,
|
|
28
|
+
const { agentId, channelName } = (0, _args_js_1.resolveChannelArgs)(args);
|
|
29
29
|
return this._getAggregate(agentId, channelName);
|
|
30
30
|
}
|
|
31
31
|
_getAggregate(agentId, channelName) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { Alarm, CreateAlarmRequest, PatchAlarmRequest } from "../types/openapi";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { Alarm, CreateAlarmRequest, PatchAlarmRequest } from "../types/openapi.js";
|
|
3
3
|
export declare class AlarmsApi {
|
|
4
4
|
private readonly rest;
|
|
5
5
|
constructor(rest: RestClient);
|
package/dist/apis/alarms-api.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AlarmsApi = void 0;
|
|
4
|
-
const
|
|
4
|
+
const _args_js_1 = require("./_args.js");
|
|
5
5
|
class AlarmsApi {
|
|
6
6
|
constructor(rest) {
|
|
7
7
|
this.rest = rest;
|
|
8
8
|
}
|
|
9
9
|
listAgentAlarms(...args) {
|
|
10
|
-
const { agentId } = (0,
|
|
10
|
+
const { agentId } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
11
11
|
return this._listAgentAlarms(agentId);
|
|
12
12
|
}
|
|
13
13
|
_listAgentAlarms(agentId) {
|
|
14
14
|
return this.rest.get(`/agents/${agentId}/alarms`);
|
|
15
15
|
}
|
|
16
16
|
listAlarms(...args) {
|
|
17
|
-
const { agentId, channelName } = (0,
|
|
17
|
+
const { agentId, channelName } = (0, _args_js_1.resolveChannelArgs)(args);
|
|
18
18
|
return this._listAlarms(agentId, channelName);
|
|
19
19
|
}
|
|
20
20
|
_listAlarms(agentId, channelName) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { Channel, CreateChannelRequest, DataSeries, PutChannelRequest } from "../types/openapi";
|
|
3
|
-
import type { DooverRequestOptions } from "../client/request-options";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { Channel, CreateChannelRequest, DataSeries, PutChannelRequest } from "../types/openapi.js";
|
|
3
|
+
import type { DooverRequestOptions } from "../client/request-options.js";
|
|
4
4
|
export interface ListChannelsOptions {
|
|
5
5
|
include_aggregate?: boolean;
|
|
6
6
|
include_daily_summaries?: boolean;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChannelsApi = void 0;
|
|
4
|
-
const
|
|
4
|
+
const _args_js_1 = require("./_args.js");
|
|
5
5
|
class ChannelsApi {
|
|
6
6
|
constructor(rest) {
|
|
7
7
|
this.rest = rest;
|
|
8
8
|
}
|
|
9
9
|
listChannels(...args) {
|
|
10
|
-
const { agentId, options } = (0,
|
|
10
|
+
const { agentId, options } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
11
11
|
return this._listChannels(agentId, options);
|
|
12
12
|
}
|
|
13
13
|
_listChannels(agentId, options) {
|
|
14
14
|
return this.rest.get(`/agents/${agentId}/channels`, options);
|
|
15
15
|
}
|
|
16
16
|
getChannel(...args) {
|
|
17
|
-
const { agentId, channelName, options } = (0,
|
|
17
|
+
const { agentId, channelName, options } = (0, _args_js_1.resolveChannelArgs)(args);
|
|
18
18
|
return this._getChannel(agentId, channelName, options);
|
|
19
19
|
}
|
|
20
20
|
_getChannel(agentId, channelName, options) {
|
|
@@ -45,21 +45,21 @@ class ChannelsApi {
|
|
|
45
45
|
return this.rest.put(`/agents/${agentId}/channels/${channelName}`, body);
|
|
46
46
|
}
|
|
47
47
|
archiveChannel(...args) {
|
|
48
|
-
const { agentId, channelName } = (0,
|
|
48
|
+
const { agentId, channelName } = (0, _args_js_1.resolveChannelArgs)(args);
|
|
49
49
|
return this._archiveChannel(agentId, channelName);
|
|
50
50
|
}
|
|
51
51
|
_archiveChannel(agentId, channelName) {
|
|
52
52
|
return this.rest.post(`/agents/${agentId}/channels/${channelName}/archive`, {});
|
|
53
53
|
}
|
|
54
54
|
unarchiveChannel(...args) {
|
|
55
|
-
const { agentId, channelName } = (0,
|
|
55
|
+
const { agentId, channelName } = (0, _args_js_1.resolveChannelArgs)(args);
|
|
56
56
|
return this._unarchiveChannel(agentId, channelName);
|
|
57
57
|
}
|
|
58
58
|
_unarchiveChannel(agentId, channelName) {
|
|
59
59
|
return this.rest.post(`/agents/${agentId}/channels/${channelName}/unarchive`, {});
|
|
60
60
|
}
|
|
61
61
|
listDataSeries(...args) {
|
|
62
|
-
const { agentId, options } = (0,
|
|
62
|
+
const { agentId, options } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
63
63
|
return this._listDataSeries(agentId, options);
|
|
64
64
|
}
|
|
65
65
|
_listDataSeries(agentId, params) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { ConnectionDetails, ConnectionSubscription, ConnectionSubscriptionLog } from "../types/openapi";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { ConnectionDetails, ConnectionSubscription, ConnectionSubscriptionLog } from "../types/openapi.js";
|
|
3
3
|
export interface ConnectionHistoryParams {
|
|
4
4
|
before?: string;
|
|
5
5
|
after?: string;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConnectionsApi = void 0;
|
|
4
|
-
const
|
|
4
|
+
const _args_js_1 = require("./_args.js");
|
|
5
5
|
class ConnectionsApi {
|
|
6
6
|
constructor(rest) {
|
|
7
7
|
this.rest = rest;
|
|
8
8
|
}
|
|
9
9
|
getAgentConnections(...args) {
|
|
10
|
-
const { agentId } = (0,
|
|
10
|
+
const { agentId } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
11
11
|
return this._getAgentConnections(agentId);
|
|
12
12
|
}
|
|
13
13
|
_getAgentConnections(agentId) {
|
|
14
14
|
return this.rest.get(`/agents/${agentId}/wss_connections`);
|
|
15
15
|
}
|
|
16
16
|
getAgentConnectionHistory(...args) {
|
|
17
|
-
const { agentId, options } = (0,
|
|
17
|
+
const { agentId, options } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
18
18
|
return this._getAgentConnectionHistory(agentId, options);
|
|
19
19
|
}
|
|
20
20
|
_getAgentConnectionHistory(agentId, params) {
|
|
21
21
|
return this.rest.get(`/agents/${agentId}/wss_connections/history`, params);
|
|
22
22
|
}
|
|
23
23
|
getAgentSubscriptionHistory(...args) {
|
|
24
|
-
const { agentId, options } = (0,
|
|
24
|
+
const { agentId, options } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
25
25
|
return this._getAgentSubscriptionHistory(agentId, options);
|
|
26
26
|
}
|
|
27
27
|
_getAgentSubscriptionHistory(agentId, params) {
|
|
@@ -31,14 +31,14 @@ class ConnectionsApi {
|
|
|
31
31
|
return this.rest.get(`/connections/${connectionId}`);
|
|
32
32
|
}
|
|
33
33
|
getChannelSubscriptions(...args) {
|
|
34
|
-
const { agentId, channelName } = (0,
|
|
34
|
+
const { agentId, channelName } = (0, _args_js_1.resolveChannelArgs)(args);
|
|
35
35
|
return this._getChannelSubscriptions(agentId, channelName);
|
|
36
36
|
}
|
|
37
37
|
_getChannelSubscriptions(agentId, channelName) {
|
|
38
38
|
return this.rest.get(`/agents/${agentId}/channels/${channelName}/subscriptions`);
|
|
39
39
|
}
|
|
40
40
|
syncConnection(...args) {
|
|
41
|
-
const { agentId } = (0,
|
|
41
|
+
const { agentId } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
42
42
|
return this._syncConnection(agentId);
|
|
43
43
|
}
|
|
44
44
|
_syncConnection(agentId) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { CreateMessageRequest, DataSeries, MessageStructure, UpdateMessageRequest } from "../types/openapi";
|
|
3
|
-
import type { DooverRequestOptions } from "../client/request-options";
|
|
4
|
-
import { type BatchCreateMessageItem, type BatchDeleteMessageItem, type BatchMessageResponse, type BatchUpdateMessageItem } from "../types/batch";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { CreateMessageRequest, DataSeries, MessageStructure, UpdateMessageRequest } from "../types/openapi.js";
|
|
3
|
+
import type { DooverRequestOptions } from "../client/request-options.js";
|
|
4
|
+
import { type BatchCreateMessageItem, type BatchDeleteMessageItem, type BatchMessageResponse, type BatchUpdateMessageItem } from "../types/batch.js";
|
|
5
5
|
export interface ListMessagesParams {
|
|
6
6
|
before?: string;
|
|
7
7
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MessagesApi = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const snowflake_js_1 = require("../utils/snowflake.js");
|
|
5
|
+
const _args_js_1 = require("./_args.js");
|
|
6
|
+
const batch_js_1 = require("../types/batch.js");
|
|
7
7
|
function resolveListMessagesParams(params) {
|
|
8
8
|
const order = params?.order ?? "desc";
|
|
9
9
|
const hasAfter = params?.after !== undefined;
|
|
@@ -23,7 +23,7 @@ function resolveListMessagesParams(params) {
|
|
|
23
23
|
return { query, order, serverAscending: true };
|
|
24
24
|
}
|
|
25
25
|
const query = {
|
|
26
|
-
before: params?.before ?? (0,
|
|
26
|
+
before: params?.before ?? (0, snowflake_js_1.generateSnowflakeIdAtTime)(new Date()),
|
|
27
27
|
limit: params?.limit ?? 10,
|
|
28
28
|
};
|
|
29
29
|
if (hasAfter)
|
|
@@ -37,13 +37,13 @@ class MessagesApi {
|
|
|
37
37
|
this.rest = rest;
|
|
38
38
|
}
|
|
39
39
|
async listMessages(...args) {
|
|
40
|
-
const { agentId, channelName, options } = (0,
|
|
40
|
+
const { agentId, channelName, options } = (0, _args_js_1.resolveChannelArgs)(args);
|
|
41
41
|
return this._listMessages(agentId, channelName, options);
|
|
42
42
|
}
|
|
43
43
|
async _listMessages(agentId, channelName, params) {
|
|
44
44
|
const { query, order, serverAscending } = resolveListMessagesParams(params);
|
|
45
45
|
const response = await this.rest.get(`/agents/${agentId}/channels/${channelName}/messages`, query);
|
|
46
|
-
const stamped = response.map(
|
|
46
|
+
const stamped = response.map(snowflake_js_1.addTimestampToMessage);
|
|
47
47
|
// The server returns newest-first for `before` and oldest-first for a bare
|
|
48
48
|
// `after`; reverse only when that native order differs from what was asked.
|
|
49
49
|
const wantAscending = order === "asc";
|
|
@@ -60,10 +60,10 @@ class MessagesApi {
|
|
|
60
60
|
}
|
|
61
61
|
async _postMessage(agentId, channelName, body) {
|
|
62
62
|
const response = await this.rest.post(`/agents/${agentId}/channels/${channelName}/messages`, body);
|
|
63
|
-
return (0,
|
|
63
|
+
return (0, snowflake_js_1.addTimestampToMessage)(response);
|
|
64
64
|
}
|
|
65
65
|
getTimeseries(...args) {
|
|
66
|
-
const { agentId, channelName, options } = (0,
|
|
66
|
+
const { agentId, channelName, options } = (0, _args_js_1.resolveChannelArgs)(args);
|
|
67
67
|
return this._getTimeseries(agentId, channelName, options);
|
|
68
68
|
}
|
|
69
69
|
_getTimeseries(agentId, channelName, params) {
|
|
@@ -81,7 +81,7 @@ class MessagesApi {
|
|
|
81
81
|
}
|
|
82
82
|
async _getMessage(agentId, channelName, messageId) {
|
|
83
83
|
const response = await this.rest.get(`/agents/${agentId}/channels/${channelName}/messages/${messageId}`);
|
|
84
|
-
return (0,
|
|
84
|
+
return (0, snowflake_js_1.addTimestampToMessage)(response);
|
|
85
85
|
}
|
|
86
86
|
putMessage(...args) {
|
|
87
87
|
if (typeof args[0] === "string") {
|
|
@@ -160,7 +160,7 @@ class MessagesApi {
|
|
|
160
160
|
return { items: [], count: 0, succeeded: 0, failed: 0 };
|
|
161
161
|
}
|
|
162
162
|
const responses = [];
|
|
163
|
-
for (const chunk of (0,
|
|
163
|
+
for (const chunk of (0, batch_js_1.chunkBatchItems)(items)) {
|
|
164
164
|
// Goes through `request` rather than the verb helpers because DELETE
|
|
165
165
|
// needs a body, which `rest.delete` does not accept.
|
|
166
166
|
responses.push(await this.rest.request({
|
|
@@ -169,7 +169,7 @@ class MessagesApi {
|
|
|
169
169
|
body: { items: chunk },
|
|
170
170
|
}));
|
|
171
171
|
}
|
|
172
|
-
return (0,
|
|
172
|
+
return (0, batch_js_1.mergeBatchResponses)(responses);
|
|
173
173
|
}
|
|
174
174
|
createMultipartPayload(jsonPayload, attachments) {
|
|
175
175
|
const formData = new FormData();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { CreateEndpointRequest, CreateNotificationSubscriptionRequest, NotificationDataResponse, NotificationEndpoint, NotificationEndpointSummariesResponse, NotificationEndpointsResponse, NotificationSubscribersResponse, NotificationSubscriptionCreateResponse, NotificationSubscriptionsResponse, UpdateEndpointRequest, UpdateMeWebPushEndpointRequest, UpdateNotificationSubscriptionRequest } from "../types/openapi";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { CreateEndpointRequest, CreateNotificationSubscriptionRequest, NotificationDataResponse, NotificationEndpoint, NotificationEndpointSummariesResponse, NotificationEndpointsResponse, NotificationSubscribersResponse, NotificationSubscriptionCreateResponse, NotificationSubscriptionsResponse, UpdateEndpointRequest, UpdateMeWebPushEndpointRequest, UpdateNotificationSubscriptionRequest } from "../types/openapi.js";
|
|
3
3
|
export declare class NotificationsApi {
|
|
4
4
|
private readonly rest;
|
|
5
5
|
constructor(rest: RestClient);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotificationsApi = void 0;
|
|
4
|
-
const
|
|
4
|
+
const _args_js_1 = require("./_args.js");
|
|
5
5
|
class NotificationsApi {
|
|
6
6
|
constructor(rest) {
|
|
7
7
|
this.rest = rest;
|
|
8
8
|
}
|
|
9
9
|
getAgentNotifications(...args) {
|
|
10
|
-
const { agentId } = (0,
|
|
10
|
+
const { agentId } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
11
11
|
return this._getAgentNotifications(agentId);
|
|
12
12
|
}
|
|
13
13
|
_getAgentNotifications(agentId) {
|
|
@@ -24,7 +24,7 @@ class NotificationsApi {
|
|
|
24
24
|
return this.rest.get(`/agents/${agentId}/notifications/endpoints`, { name });
|
|
25
25
|
}
|
|
26
26
|
getAgentNotificationEndpointSummaries(...args) {
|
|
27
|
-
const { agentId } = (0,
|
|
27
|
+
const { agentId } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
28
28
|
return this._getAgentNotificationEndpointSummaries(agentId);
|
|
29
29
|
}
|
|
30
30
|
_getAgentNotificationEndpointSummaries(agentId) {
|
|
@@ -141,7 +141,7 @@ class NotificationsApi {
|
|
|
141
141
|
return this.rest.delete(`/agents/${agentId}/notifications/subscriptions/${subscriptionId}`);
|
|
142
142
|
}
|
|
143
143
|
getAgentNotificationSubscribers(...args) {
|
|
144
|
-
const { agentId } = (0,
|
|
144
|
+
const { agentId } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
145
145
|
return this._getAgentNotificationSubscribers(agentId);
|
|
146
146
|
}
|
|
147
147
|
_getAgentNotificationSubscribers(agentId) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { CustomerSite, Organisation, PaginatedResponse } from "../types/viewer";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { CustomerSite, Organisation, PaginatedResponse } from "../types/viewer.js";
|
|
3
3
|
export interface ListOrganisationsOptions {
|
|
4
4
|
page?: number;
|
|
5
5
|
perPage?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { AgentPermission, PermissionDebugResponse, SuccessListResponse, SyncPermissionRequest } from "../types/openapi";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { AgentPermission, PermissionDebugResponse, SuccessListResponse, SyncPermissionRequest } from "../types/openapi.js";
|
|
3
3
|
export declare class PermissionsApi {
|
|
4
4
|
private readonly rest;
|
|
5
5
|
constructor(rest: RestClient);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PermissionsApi = void 0;
|
|
4
|
-
const
|
|
4
|
+
const _args_js_1 = require("./_args.js");
|
|
5
5
|
class PermissionsApi {
|
|
6
6
|
constructor(rest) {
|
|
7
7
|
this.rest = rest;
|
|
8
8
|
}
|
|
9
9
|
getAgentPermission(...args) {
|
|
10
|
-
const { agentId } = (0,
|
|
10
|
+
const { agentId } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
11
11
|
return this._getAgentPermission(agentId);
|
|
12
12
|
}
|
|
13
13
|
_getAgentPermission(agentId) {
|
|
14
14
|
return this.rest.get(`/agents/${agentId}/permissions`);
|
|
15
15
|
}
|
|
16
16
|
getAgentPermissionDebug(...args) {
|
|
17
|
-
const { agentId } = (0,
|
|
17
|
+
const { agentId } = (0, _args_js_1.resolveAgentArgs)(args);
|
|
18
18
|
return this._getAgentPermissionDebug(agentId);
|
|
19
19
|
}
|
|
20
20
|
_getAgentPermissionDebug(agentId) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { CreateIngestionRequest, PutScheduleRequest, PutSubscriptionRequest, ScheduleInfo, SubscriptionInfo } from "../types/openapi";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { CreateIngestionRequest, PutScheduleRequest, PutSubscriptionRequest, ScheduleInfo, SubscriptionInfo } from "../types/openapi.js";
|
|
3
3
|
export declare class ProcessorsApi {
|
|
4
4
|
private readonly rest;
|
|
5
5
|
constructor(rest: RestClient);
|
package/dist/apis/turn-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { TurnCredential, TurnTokenRequest } from "../types/openapi";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { TurnCredential, TurnTokenRequest } from "../types/openapi.js";
|
|
3
3
|
export declare class TurnApi {
|
|
4
4
|
private readonly rest;
|
|
5
5
|
constructor(rest: RestClient);
|
package/dist/apis/users-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestClient } from "../http/rest-client";
|
|
2
|
-
import type { User } from "../types/viewer";
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { User } from "../types/viewer.js";
|
|
3
3
|
export declare class UsersApi {
|
|
4
4
|
private readonly rest;
|
|
5
5
|
private readonly controlApiUrl?;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AuthProfile } from "./auth-profile";
|
|
2
|
-
import type { AuthProfileStore } from "./auth-store";
|
|
3
|
-
import { DooverAuth } from "./doover-auth";
|
|
1
|
+
import type { AuthProfile } from "./auth-profile.js";
|
|
2
|
+
import type { AuthProfileStore } from "./auth-store.js";
|
|
3
|
+
import { DooverAuth } from "./doover-auth.js";
|
|
4
4
|
/**
|
|
5
5
|
* Raw auth inputs that can be provided in client configs.
|
|
6
6
|
*
|