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/dist/test/apis.test.js
DELETED
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const chai_1 = require("chai");
|
|
4
|
-
const mocha_1 = require("mocha");
|
|
5
|
-
const agents_api_1 = require("../apis/agents-api");
|
|
6
|
-
const aggregates_api_1 = require("../apis/aggregates-api");
|
|
7
|
-
const alarms_api_1 = require("../apis/alarms-api");
|
|
8
|
-
const channels_api_1 = require("../apis/channels-api");
|
|
9
|
-
const connections_api_1 = require("../apis/connections-api");
|
|
10
|
-
const messages_api_1 = require("../apis/messages-api");
|
|
11
|
-
const notifications_api_1 = require("../apis/notifications-api");
|
|
12
|
-
const permissions_api_1 = require("../apis/permissions-api");
|
|
13
|
-
const processors_api_1 = require("../apis/processors-api");
|
|
14
|
-
const turn_api_1 = require("../apis/turn-api");
|
|
15
|
-
const rest_client_1 = require("../http/rest-client");
|
|
16
|
-
const snowflake_1 = require("../utils/snowflake");
|
|
17
|
-
const helpers_1 = require("./helpers");
|
|
18
|
-
function setupRest(responseFactory) {
|
|
19
|
-
const fetchMock = (0, helpers_1.createFetchMock)(responseFactory);
|
|
20
|
-
const rest = new rest_client_1.RestClient({
|
|
21
|
-
dataRestUrl: "https://api.example.com",
|
|
22
|
-
controlApiUrl: "https://control.example.com",
|
|
23
|
-
dataWssUrl: "wss://ws.example.com",
|
|
24
|
-
fetchImpl: fetchMock,
|
|
25
|
-
});
|
|
26
|
-
return { rest, fetchMock };
|
|
27
|
-
}
|
|
28
|
-
(0, mocha_1.describe)("API clients", () => {
|
|
29
|
-
(0, mocha_1.it)("covers agents batch methods", async () => {
|
|
30
|
-
const id = (0, snowflake_1.generateSnowflakeIdAtTime)(new Date("2026-01-01T00:00:00Z"));
|
|
31
|
-
const { rest, fetchMock } = setupRest((url) => {
|
|
32
|
-
if (url.includes("/messages")) {
|
|
33
|
-
return (0, helpers_1.createJsonResponse)({
|
|
34
|
-
results: [
|
|
35
|
-
{
|
|
36
|
-
id,
|
|
37
|
-
author_id: "u",
|
|
38
|
-
channel: { agent_id: "a1", name: "c1" },
|
|
39
|
-
data: {},
|
|
40
|
-
attachments: [],
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
count: 1,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return (0, helpers_1.createJsonResponse)({
|
|
47
|
-
results: [{ agent_id: "a1", data: {}, attachments: [] }],
|
|
48
|
-
count: 1,
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
const api = new agents_api_1.AgentsApi(rest);
|
|
52
|
-
const messages = await api.getMultiAgentMessages("c1", {
|
|
53
|
-
agent_id: ["a1", "a2"],
|
|
54
|
-
limit: 5,
|
|
55
|
-
});
|
|
56
|
-
const aggregates = await api.getMultiAgentAggregates("c1", {
|
|
57
|
-
agent_id: ["a1"],
|
|
58
|
-
});
|
|
59
|
-
(0, chai_1.expect)(messages.results[0].timestamp).to.be.greaterThan(0);
|
|
60
|
-
(0, chai_1.expect)(aggregates.results).to.have.length(1);
|
|
61
|
-
(0, chai_1.expect)(fetchMock.getCall(0).args[0]).to.equal("https://api.example.com/agents/channels/c1/messages?agent_id=a1&agent_id=a2&limit=5");
|
|
62
|
-
(0, chai_1.expect)(fetchMock.getCall(1).args[0]).to.equal("https://api.example.com/agents/channels/c1/aggregates?agent_id=a1");
|
|
63
|
-
});
|
|
64
|
-
(0, mocha_1.it)("chunks getMultiAgentAggregates over the per-request agent cap", async () => {
|
|
65
|
-
const { rest, fetchMock } = setupRest((url) => {
|
|
66
|
-
const ids = [...new URL(url).searchParams.getAll("agent_id")];
|
|
67
|
-
return (0, helpers_1.createJsonResponse)({
|
|
68
|
-
results: ids.map((id) => ({ agent_id: id, data: {}, attachments: [] })),
|
|
69
|
-
count: ids.length,
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
const api = new agents_api_1.AgentsApi(rest);
|
|
73
|
-
// 600 agents → 3 chunks of 250/250/100.
|
|
74
|
-
const agentIds = Array.from({ length: 600 }, (_, i) => `a${i}`);
|
|
75
|
-
const aggregates = await api.getMultiAgentAggregates("c1", {
|
|
76
|
-
agent_id: agentIds,
|
|
77
|
-
});
|
|
78
|
-
(0, chai_1.expect)(fetchMock.callCount).to.equal(3);
|
|
79
|
-
(0, chai_1.expect)(aggregates.results).to.have.length(600);
|
|
80
|
-
(0, chai_1.expect)(aggregates.count).to.equal(600);
|
|
81
|
-
// Every agent is represented exactly once across the merged chunks.
|
|
82
|
-
const returnedIds = aggregates.results.map((r) => r.agent_id).sort();
|
|
83
|
-
(0, chai_1.expect)(returnedIds).to.deep.equal([...agentIds].sort());
|
|
84
|
-
});
|
|
85
|
-
(0, mocha_1.it)("chunks getMultiAgentMessages over the per-request agent cap", async () => {
|
|
86
|
-
const baseTs = new Date("2026-01-01T00:00:00Z");
|
|
87
|
-
const { rest, fetchMock } = setupRest((url) => {
|
|
88
|
-
const ids = [...new URL(url).searchParams.getAll("agent_id")];
|
|
89
|
-
return (0, helpers_1.createJsonResponse)({
|
|
90
|
-
results: ids.map((id, i) => ({
|
|
91
|
-
id: (0, snowflake_1.generateSnowflakeIdAtTime)(new Date(baseTs.getTime() + i)),
|
|
92
|
-
author_id: "u",
|
|
93
|
-
channel: { agent_id: id, name: "c1" },
|
|
94
|
-
data: {},
|
|
95
|
-
attachments: [],
|
|
96
|
-
})),
|
|
97
|
-
count: ids.length,
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
const api = new agents_api_1.AgentsApi(rest);
|
|
101
|
-
// 600 agents → 3 chunks of 250/250/100.
|
|
102
|
-
const agentIds = Array.from({ length: 600 }, (_, i) => `a${i}`);
|
|
103
|
-
const messages = await api.getMultiAgentMessages("c1", {
|
|
104
|
-
agent_id: agentIds,
|
|
105
|
-
agent_message_limit: 50,
|
|
106
|
-
});
|
|
107
|
-
(0, chai_1.expect)(fetchMock.callCount).to.equal(3);
|
|
108
|
-
(0, chai_1.expect)(messages.results).to.have.length(600);
|
|
109
|
-
(0, chai_1.expect)(messages.count).to.equal(600);
|
|
110
|
-
const returnedIds = messages.results
|
|
111
|
-
.map((m) => m.channel.agent_id)
|
|
112
|
-
.sort();
|
|
113
|
-
(0, chai_1.expect)(returnedIds).to.deep.equal([...agentIds].sort());
|
|
114
|
-
// Per-request param survives chunking.
|
|
115
|
-
for (let i = 0; i < 3; i++) {
|
|
116
|
-
const url = fetchMock.getCall(i).args[0];
|
|
117
|
-
(0, chai_1.expect)(url).to.include("agent_message_limit=50");
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
(0, mocha_1.it)("merges next_cursors and at_limit_agent_ids across chunks", async () => {
|
|
121
|
-
let call = 0;
|
|
122
|
-
const cursors = [
|
|
123
|
-
{ "a0": "100", "a1": "200" },
|
|
124
|
-
{ "a250": "150" },
|
|
125
|
-
];
|
|
126
|
-
const atLimit = [["a0", "a1"], ["a250"]];
|
|
127
|
-
const { rest } = setupRest((url) => {
|
|
128
|
-
const idx = call++;
|
|
129
|
-
const ids = [...new URL(url).searchParams.getAll("agent_id")];
|
|
130
|
-
return (0, helpers_1.createJsonResponse)({
|
|
131
|
-
results: ids.map((id) => ({
|
|
132
|
-
id: (0, snowflake_1.generateSnowflakeIdAtTime)(new Date("2026-01-01T00:00:00Z")),
|
|
133
|
-
author_id: "u",
|
|
134
|
-
channel: { agent_id: id, name: "c1" },
|
|
135
|
-
data: {},
|
|
136
|
-
attachments: [],
|
|
137
|
-
})),
|
|
138
|
-
count: ids.length,
|
|
139
|
-
next: idx === 0 ? "200" : "150",
|
|
140
|
-
next_cursors: cursors[idx],
|
|
141
|
-
at_limit_agent_ids: atLimit[idx],
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
const api = new agents_api_1.AgentsApi(rest);
|
|
145
|
-
const agentIds = Array.from({ length: 300 }, (_, i) => `a${i}`);
|
|
146
|
-
const messages = await api.getMultiAgentMessages("c1", {
|
|
147
|
-
agent_id: agentIds,
|
|
148
|
-
});
|
|
149
|
-
(0, chai_1.expect)(messages.next).to.equal("200"); // max across chunks
|
|
150
|
-
(0, chai_1.expect)(messages.next_cursors).to.deep.equal({
|
|
151
|
-
a0: "100",
|
|
152
|
-
a1: "200",
|
|
153
|
-
a250: "150",
|
|
154
|
-
});
|
|
155
|
-
(0, chai_1.expect)(messages.at_limit_agent_ids?.sort()).to.deep.equal([
|
|
156
|
-
"a0",
|
|
157
|
-
"a1",
|
|
158
|
-
"a250",
|
|
159
|
-
]);
|
|
160
|
-
});
|
|
161
|
-
(0, mocha_1.it)("covers channels methods", async () => {
|
|
162
|
-
const { rest, fetchMock } = setupRest(() => (0, helpers_1.createJsonResponse)([]));
|
|
163
|
-
const api = new channels_api_1.ChannelsApi(rest);
|
|
164
|
-
await api.listChannels("a1", { include_archived: true });
|
|
165
|
-
await api.getChannel("a1", "c1", { include_aggregate: true });
|
|
166
|
-
await api.createChannel("a1", "c1", { is_private: true });
|
|
167
|
-
await api.putChannel("a1", "c1", { is_private: false });
|
|
168
|
-
await api.listDataSeries("a1", { field_name: ["temp"] });
|
|
169
|
-
(0, chai_1.expect)(fetchMock.getCalls().map((call) => [call.args[0], call.args[1]?.method ?? "GET"])).to.deep.equal([
|
|
170
|
-
["https://api.example.com/agents/a1/channels?include_archived=true", "GET"],
|
|
171
|
-
["https://api.example.com/agents/a1/channels/c1?include_aggregate=true", "GET"],
|
|
172
|
-
["https://api.example.com/agents/a1/channels/c1", "POST"],
|
|
173
|
-
["https://api.example.com/agents/a1/channels/c1", "PUT"],
|
|
174
|
-
["https://api.example.com/agents/a1/data_series?field_name=temp", "GET"],
|
|
175
|
-
]);
|
|
176
|
-
});
|
|
177
|
-
(0, mocha_1.it)("covers messages methods and multipart helper", async () => {
|
|
178
|
-
const id = (0, snowflake_1.generateSnowflakeIdAtTime)(new Date("2026-01-01T00:00:00Z"));
|
|
179
|
-
const { rest, fetchMock } = setupRest((url) => {
|
|
180
|
-
if (url.includes("/attachments/")) {
|
|
181
|
-
return (0, helpers_1.createBlobResponse)("data");
|
|
182
|
-
}
|
|
183
|
-
if (url.includes("/timeseries")) {
|
|
184
|
-
return (0, helpers_1.createJsonResponse)({ count: 1, results: [{ value: 1, message_id: id }] });
|
|
185
|
-
}
|
|
186
|
-
if (url.endsWith(`/messages/${id}`)) {
|
|
187
|
-
return (0, helpers_1.createJsonResponse)({
|
|
188
|
-
id,
|
|
189
|
-
author_id: "u",
|
|
190
|
-
channel: { agent_id: "a1", name: "c1" },
|
|
191
|
-
data: {},
|
|
192
|
-
attachments: [],
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
if (url.endsWith("/messages")) {
|
|
196
|
-
return (0, helpers_1.createJsonResponse)({
|
|
197
|
-
id,
|
|
198
|
-
author_id: "u",
|
|
199
|
-
channel: { agent_id: "a1", name: "c1" },
|
|
200
|
-
data: {},
|
|
201
|
-
attachments: [],
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
return (0, helpers_1.createJsonResponse)([
|
|
205
|
-
{
|
|
206
|
-
id,
|
|
207
|
-
author_id: "u",
|
|
208
|
-
channel: { agent_id: "a1", name: "c1" },
|
|
209
|
-
data: {},
|
|
210
|
-
attachments: [],
|
|
211
|
-
},
|
|
212
|
-
]);
|
|
213
|
-
});
|
|
214
|
-
const api = new messages_api_1.MessagesApi(rest);
|
|
215
|
-
const list = await api.listMessages("a1", "c1", { limit: 2 });
|
|
216
|
-
const posted = await api.postMessage("a1", "c1", { data: { x: 1 } });
|
|
217
|
-
const series = await api.getTimeseries("a1", "c1", { field_name: ["x"] });
|
|
218
|
-
const message = await api.getMessage("a1", "c1", id);
|
|
219
|
-
await api.putMessage("a1", "c1", id, { data: { x: 2 } }, { suppress_response: true });
|
|
220
|
-
await api.patchMessage("a1", "c1", id, { data: { x: 3 } }, { clear_attachments: true });
|
|
221
|
-
await api.deleteMessage("a1", "c1", id);
|
|
222
|
-
const blob = await api.getMessageAttachment("a1", "c1", id, "att-1");
|
|
223
|
-
const formData = api.createMultipartPayload({ data: { x: 1 } }, [new Blob(["a"])]);
|
|
224
|
-
(0, chai_1.expect)(list[0].timestamp).to.be.greaterThan(0);
|
|
225
|
-
(0, chai_1.expect)(posted.timestamp).to.be.greaterThan(0);
|
|
226
|
-
(0, chai_1.expect)(series.count).to.equal(1);
|
|
227
|
-
(0, chai_1.expect)(message.id).to.equal(id);
|
|
228
|
-
(0, chai_1.expect)(await blob.text()).to.equal("data");
|
|
229
|
-
(0, chai_1.expect)(formData.get("json_payload")).to.equal(JSON.stringify({ data: { x: 1 } }));
|
|
230
|
-
(0, chai_1.expect)(formData.get("attachment-0")).to.be.instanceOf(Blob);
|
|
231
|
-
});
|
|
232
|
-
(0, mocha_1.it)("pages forward with a bare `after`: sends no `before`, keeps oldest-first", async () => {
|
|
233
|
-
const older = (0, snowflake_1.generateSnowflakeIdAtTime)(new Date("2026-01-01T00:00:00Z"));
|
|
234
|
-
const newer = (0, snowflake_1.generateSnowflakeIdAtTime)(new Date("2026-01-02T00:00:00Z"));
|
|
235
|
-
// The `after`-only route returns oldest-first natively (scan_index_forward).
|
|
236
|
-
const nativeAsc = [
|
|
237
|
-
{ id: older, author_id: "u", channel: { agent_id: "a1", name: "c1" }, data: {}, attachments: [] },
|
|
238
|
-
{ id: newer, author_id: "u", channel: { agent_id: "a1", name: "c1" }, data: {}, attachments: [] },
|
|
239
|
-
];
|
|
240
|
-
let lastQuery;
|
|
241
|
-
const { rest } = setupRest((url) => {
|
|
242
|
-
if (url.endsWith("/messages") || url.includes("/messages?")) {
|
|
243
|
-
lastQuery = new URL(url).searchParams;
|
|
244
|
-
return (0, helpers_1.createJsonResponse)(nativeAsc);
|
|
245
|
-
}
|
|
246
|
-
return (0, helpers_1.createJsonResponse)([]);
|
|
247
|
-
});
|
|
248
|
-
const api = new messages_api_1.MessagesApi(rest);
|
|
249
|
-
// asc: server order already matches → no reversal, no `before` sent.
|
|
250
|
-
const asc = await api.listMessages("a1", "c1", { after: older, limit: 5, order: "asc" });
|
|
251
|
-
(0, chai_1.expect)(lastQuery?.get("after")).to.equal(older);
|
|
252
|
-
(0, chai_1.expect)(lastQuery?.has("before"), "bare `after` must not send `before`").to.equal(false);
|
|
253
|
-
(0, chai_1.expect)(asc.map((m) => m.id)).to.deep.equal([older, newer]);
|
|
254
|
-
// desc over the same forward route reverses the native ascending page.
|
|
255
|
-
const desc = await api.listMessages("a1", "c1", { after: older, limit: 5, order: "desc" });
|
|
256
|
-
(0, chai_1.expect)(desc.map((m) => m.id)).to.deep.equal([newer, older]);
|
|
257
|
-
// With `before` present, `after` is only a floor and both bounds are sent.
|
|
258
|
-
await api.listMessages("a1", "c1", { before: newer, after: older, limit: 5, order: "asc" });
|
|
259
|
-
(0, chai_1.expect)(lastQuery?.get("before")).to.equal(newer);
|
|
260
|
-
(0, chai_1.expect)(lastQuery?.get("after")).to.equal(older);
|
|
261
|
-
});
|
|
262
|
-
(0, mocha_1.it)("covers aggregates and alarms methods", async () => {
|
|
263
|
-
const { rest, fetchMock } = setupRest((url) => {
|
|
264
|
-
if (url.includes("/attachments/")) {
|
|
265
|
-
return (0, helpers_1.createBlobResponse)("agg");
|
|
266
|
-
}
|
|
267
|
-
if (url.includes("/alarms")) {
|
|
268
|
-
return (0, helpers_1.createJsonResponse)({
|
|
269
|
-
id: "alarm",
|
|
270
|
-
name: "a",
|
|
271
|
-
description: "",
|
|
272
|
-
enabled: true,
|
|
273
|
-
key: "x",
|
|
274
|
-
operator: "gt",
|
|
275
|
-
value: 1,
|
|
276
|
-
state: "OK",
|
|
277
|
-
expiry_mins: null,
|
|
278
|
-
entered_state_ts: 1,
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
return (0, helpers_1.createJsonResponse)({ data: {}, attachments: [] });
|
|
282
|
-
});
|
|
283
|
-
const aggregates = new aggregates_api_1.AggregatesApi(rest);
|
|
284
|
-
const alarms = new alarms_api_1.AlarmsApi(rest);
|
|
285
|
-
await aggregates.getAggregate("a1", "c1");
|
|
286
|
-
await aggregates.putAggregate("a1", "c1", { data: 1 }, { log_update: true });
|
|
287
|
-
await aggregates.patchAggregate("a1", "c1", { data: 2 }, { clear_attachments: true });
|
|
288
|
-
const aggregateBlob = await aggregates.getAggregateAttachment("a1", "c1", "att-1");
|
|
289
|
-
await alarms.listAlarms("a1", "c1");
|
|
290
|
-
await alarms.createAlarm("a1", "c1", { name: "a", key: "x", operator: "gt", value: 1 });
|
|
291
|
-
await alarms.getAlarm("a1", "c1", "alarm");
|
|
292
|
-
await alarms.putAlarm("a1", "c1", "alarm", { name: "a", key: "x", operator: "gt", value: 1 });
|
|
293
|
-
// A rate alarm states its condition with rate_threshold/rate_window_ms and
|
|
294
|
-
// must leave `value` unset.
|
|
295
|
-
await alarms.createAlarm("a1", "c1", {
|
|
296
|
-
name: "rising",
|
|
297
|
-
key: "level",
|
|
298
|
-
operator: "gt",
|
|
299
|
-
rate_threshold: 0.05,
|
|
300
|
-
rate_window_ms: 600000,
|
|
301
|
-
topic_name: "level-rising",
|
|
302
|
-
notification_policy: "opt-in",
|
|
303
|
-
messages: { alarm: { notify: true, text: "Level rising fast" } },
|
|
304
|
-
});
|
|
305
|
-
await alarms.patchAlarm("a1", "c1", "alarm", { enabled: false });
|
|
306
|
-
await alarms.patchAlarm("a1", "c1", "alarm", { messages: { ok: { notify: false } } });
|
|
307
|
-
await alarms.deleteAlarm("a1", "c1", "alarm");
|
|
308
|
-
(0, chai_1.expect)(await aggregateBlob.text()).to.equal("agg");
|
|
309
|
-
(0, chai_1.expect)(fetchMock.callCount).to.equal(12);
|
|
310
|
-
});
|
|
311
|
-
(0, mocha_1.it)("covers connections and notifications methods", async () => {
|
|
312
|
-
const { rest, fetchMock } = setupRest(() => (0, helpers_1.createJsonResponse)({ subscriptions: [], endpoints: [], subscribers: [] }));
|
|
313
|
-
const connections = new connections_api_1.ConnectionsApi(rest);
|
|
314
|
-
const notifications = new notifications_api_1.NotificationsApi(rest);
|
|
315
|
-
await connections.getAgentConnections("a1");
|
|
316
|
-
await connections.getAgentConnectionHistory("a1", { default_connection: true });
|
|
317
|
-
await connections.getAgentSubscriptionHistory("a1", { channel: "{\"agent_id\":\"a1\",\"name\":\"c1\"}" });
|
|
318
|
-
await connections.getConnection("conn");
|
|
319
|
-
await connections.getChannelSubscriptions("a1", "c1");
|
|
320
|
-
await connections.syncConnection("a1");
|
|
321
|
-
const syncCall = fetchMock
|
|
322
|
-
.getCalls()
|
|
323
|
-
.find((call) => call.args[0].endsWith("/agents/a1/connection_sync"));
|
|
324
|
-
(0, chai_1.expect)(syncCall).to.not.equal(undefined);
|
|
325
|
-
(0, chai_1.expect)(syncCall.args[1].method).to.equal("POST");
|
|
326
|
-
await notifications.getAgentNotifications("a1");
|
|
327
|
-
await notifications.getAgentNotificationEndpoints("a1", "browser");
|
|
328
|
-
await notifications.getAgentNotificationEndpointSummaries("a1");
|
|
329
|
-
await notifications.createNotificationEndpoint("a1", {
|
|
330
|
-
name: "browser",
|
|
331
|
-
type: 3,
|
|
332
|
-
extra_data: {},
|
|
333
|
-
default: true,
|
|
334
|
-
});
|
|
335
|
-
await notifications.updateNotificationEndpoint("a1", "e1", { name: "browser-2" });
|
|
336
|
-
await notifications.deleteNotificationEndpoint("a1", "e1");
|
|
337
|
-
await notifications.testNotificationEndpoint("a1", "e1");
|
|
338
|
-
await notifications.getAgentNotificationSubscriptions("a1", "a2");
|
|
339
|
-
await notifications.createNotificationSubscription("a1", {
|
|
340
|
-
subscribe_to: "a2",
|
|
341
|
-
severity: 3,
|
|
342
|
-
topic_filter: ["*"],
|
|
343
|
-
});
|
|
344
|
-
await notifications.getAgentDefaultNotificationSubscriptions("a1", "a2");
|
|
345
|
-
await notifications.updateDefaultNotificationSubscription("a1", "a2", {
|
|
346
|
-
severity: 5,
|
|
347
|
-
topic_filter: ["^dev/alarms/default/[^/]+/triggered$"],
|
|
348
|
-
topic_filter_mode: "regex",
|
|
349
|
-
});
|
|
350
|
-
await notifications.deleteDefaultNotificationSubscription("a1", "a2");
|
|
351
|
-
await notifications.updateNotificationSubscription("a1", "s1", { severity: 4 });
|
|
352
|
-
await notifications.deleteNotificationSubscription("a1", "s1");
|
|
353
|
-
await notifications.getAgentNotificationSubscribers("a1");
|
|
354
|
-
await notifications.updateMeWebPushEndpoint({
|
|
355
|
-
old_endpoint: "old",
|
|
356
|
-
endpoint: "new",
|
|
357
|
-
key_p256dh: "p",
|
|
358
|
-
key_auth: "a",
|
|
359
|
-
expires_at: 1,
|
|
360
|
-
});
|
|
361
|
-
await notifications.getWebPushPublicKey();
|
|
362
|
-
const summaryCall = fetchMock
|
|
363
|
-
.getCalls()
|
|
364
|
-
.find((call) => call.args[0].endsWith("/agents/a1/notifications/endpoints/summary"));
|
|
365
|
-
(0, chai_1.expect)(summaryCall).to.not.equal(undefined);
|
|
366
|
-
const defaultPatch = fetchMock
|
|
367
|
-
.getCalls()
|
|
368
|
-
.find((call) => call.args[0].endsWith("/agents/a1/notifications/subscriptions/default/a2") && call.args[1].method === "PATCH");
|
|
369
|
-
(0, chai_1.expect)(defaultPatch).to.not.equal(undefined);
|
|
370
|
-
(0, chai_1.expect)(fetchMock.callCount).to.equal(23);
|
|
371
|
-
});
|
|
372
|
-
(0, mocha_1.it)("covers permissions, processors, and turn methods", async () => {
|
|
373
|
-
const { rest, fetchMock } = setupRest(() => (0, helpers_1.createJsonResponse)({ db: { agent_id: "a1", is_superuser: false, resources: [] } }));
|
|
374
|
-
const permissions = new permissions_api_1.PermissionsApi(rest);
|
|
375
|
-
const processors = new processors_api_1.ProcessorsApi(rest);
|
|
376
|
-
const turn = new turn_api_1.TurnApi(rest);
|
|
377
|
-
await permissions.getAgentPermission("a1");
|
|
378
|
-
await permissions.getAgentPermissionDebug("a1");
|
|
379
|
-
await permissions.syncPermissions({ agent_permissions: [] });
|
|
380
|
-
await processors.createProcessorSchedule("a1", "sched", {
|
|
381
|
-
app_key: "app",
|
|
382
|
-
permissions: [],
|
|
383
|
-
});
|
|
384
|
-
await processors.deleteProcessorSchedule("a1", "sched");
|
|
385
|
-
await processors.regenerateScheduleToken("a1", "sched");
|
|
386
|
-
await processors.getScheduleInfo("sched");
|
|
387
|
-
await processors.getScheduleInfoAlias("sched");
|
|
388
|
-
await processors.createProcessorSubscription("a1", "sub", {
|
|
389
|
-
subscription_arn: "arn",
|
|
390
|
-
app_key: "app",
|
|
391
|
-
permissions: [],
|
|
392
|
-
});
|
|
393
|
-
await processors.deleteProcessorSubscription("a1", "sub");
|
|
394
|
-
await processors.getProcessorSubscriptionInfo("arn");
|
|
395
|
-
await processors.getProcessorSubscriptionInfoAlias("arn");
|
|
396
|
-
await processors.createIngestionEndpoint("a1", "ing", {
|
|
397
|
-
lambda_arn: "arn",
|
|
398
|
-
cidr_ranges: [],
|
|
399
|
-
throttle_limit: 1,
|
|
400
|
-
app_key: "app",
|
|
401
|
-
permissions: [],
|
|
402
|
-
});
|
|
403
|
-
await processors.deleteIngestionEndpoint("a1", "ing");
|
|
404
|
-
await processors.invokeIngestionEndpoint("a1", "ing", { hello: "world" }, { wait: true });
|
|
405
|
-
await turn.createTurnToken({ role: "client", camera_name: "cam", device_id: "a1" });
|
|
406
|
-
(0, chai_1.expect)(fetchMock.callCount).to.equal(16);
|
|
407
|
-
});
|
|
408
|
-
});
|