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
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
export declare class NotificationsApi {
|
|
4
|
+
private readonly rest;
|
|
5
|
+
constructor(rest: RestClient);
|
|
6
|
+
getAgentNotifications(agentId: string): Promise<NotificationDataResponse>;
|
|
7
|
+
getAgentNotifications(identifier: {
|
|
8
|
+
agentId: string;
|
|
9
|
+
}): Promise<NotificationDataResponse>;
|
|
10
|
+
private _getAgentNotifications;
|
|
11
|
+
getAgentNotificationEndpoints(agentId: string, name?: string): Promise<NotificationEndpointsResponse>;
|
|
12
|
+
getAgentNotificationEndpoints(identifier: {
|
|
13
|
+
agentId: string;
|
|
14
|
+
}, name?: string): Promise<NotificationEndpointsResponse>;
|
|
15
|
+
private _getAgentNotificationEndpoints;
|
|
16
|
+
/**
|
|
17
|
+
* Delivery readiness for each endpoint, without addresses or credentials.
|
|
18
|
+
* Readable with either notification-read or manage-subscriptions rights, so
|
|
19
|
+
* a delegated subscription manager can list endpoints it can't otherwise see.
|
|
20
|
+
*/
|
|
21
|
+
getAgentNotificationEndpointSummaries(agentId: string): Promise<NotificationEndpointSummariesResponse>;
|
|
22
|
+
getAgentNotificationEndpointSummaries(identifier: {
|
|
23
|
+
agentId: string;
|
|
24
|
+
}): Promise<NotificationEndpointSummariesResponse>;
|
|
25
|
+
private _getAgentNotificationEndpointSummaries;
|
|
26
|
+
createNotificationEndpoint(agentId: string, body: CreateEndpointRequest): Promise<NotificationEndpoint>;
|
|
27
|
+
createNotificationEndpoint(identifier: {
|
|
28
|
+
agentId: string;
|
|
29
|
+
}, body: CreateEndpointRequest): Promise<NotificationEndpoint>;
|
|
30
|
+
private _createNotificationEndpoint;
|
|
31
|
+
updateNotificationEndpoint(agentId: string, endpointId: string, body: UpdateEndpointRequest): Promise<NotificationEndpoint>;
|
|
32
|
+
updateNotificationEndpoint(identifier: {
|
|
33
|
+
agentId: string;
|
|
34
|
+
}, endpointId: string, body: UpdateEndpointRequest): Promise<NotificationEndpoint>;
|
|
35
|
+
private _updateNotificationEndpoint;
|
|
36
|
+
deleteNotificationEndpoint(agentId: string, endpointId: string): Promise<unknown>;
|
|
37
|
+
deleteNotificationEndpoint(identifier: {
|
|
38
|
+
agentId: string;
|
|
39
|
+
}, endpointId: string): Promise<unknown>;
|
|
40
|
+
private _deleteNotificationEndpoint;
|
|
41
|
+
testNotificationEndpoint(agentId: string, endpointId: string): Promise<unknown>;
|
|
42
|
+
testNotificationEndpoint(identifier: {
|
|
43
|
+
agentId: string;
|
|
44
|
+
}, endpointId: string): Promise<unknown>;
|
|
45
|
+
private _testNotificationEndpoint;
|
|
46
|
+
getAgentNotificationSubscriptions(agentId: string, subscribed_to?: string): Promise<NotificationSubscriptionsResponse>;
|
|
47
|
+
getAgentNotificationSubscriptions(identifier: {
|
|
48
|
+
agentId: string;
|
|
49
|
+
}, subscribed_to?: string): Promise<NotificationSubscriptionsResponse>;
|
|
50
|
+
private _getAgentNotificationSubscriptions;
|
|
51
|
+
createNotificationSubscription(agentId: string, body: CreateNotificationSubscriptionRequest): Promise<NotificationSubscriptionCreateResponse>;
|
|
52
|
+
createNotificationSubscription(identifier: {
|
|
53
|
+
agentId: string;
|
|
54
|
+
}, body: CreateNotificationSubscriptionRequest): Promise<NotificationSubscriptionCreateResponse>;
|
|
55
|
+
private _createNotificationSubscription;
|
|
56
|
+
getAgentDefaultNotificationSubscriptions(agentId: string, subscribed_to?: string): Promise<NotificationSubscriptionsResponse>;
|
|
57
|
+
getAgentDefaultNotificationSubscriptions(identifier: {
|
|
58
|
+
agentId: string;
|
|
59
|
+
}, subscribed_to?: string): Promise<NotificationSubscriptionsResponse>;
|
|
60
|
+
private _getAgentDefaultNotificationSubscriptions;
|
|
61
|
+
/**
|
|
62
|
+
* Update every default subscription this subscriber holds on `subscribedTo`
|
|
63
|
+
* at once. Omitted fields keep their current value.
|
|
64
|
+
*/
|
|
65
|
+
updateDefaultNotificationSubscription(agentId: string, subscribedTo: string, body: UpdateNotificationSubscriptionRequest): Promise<unknown>;
|
|
66
|
+
updateDefaultNotificationSubscription(identifier: {
|
|
67
|
+
agentId: string;
|
|
68
|
+
}, subscribedTo: string, body: UpdateNotificationSubscriptionRequest): Promise<unknown>;
|
|
69
|
+
private _updateDefaultNotificationSubscription;
|
|
70
|
+
deleteDefaultNotificationSubscription(agentId: string, subscribedTo: string): Promise<unknown>;
|
|
71
|
+
deleteDefaultNotificationSubscription(identifier: {
|
|
72
|
+
agentId: string;
|
|
73
|
+
}, subscribedTo: string): Promise<unknown>;
|
|
74
|
+
private _deleteDefaultNotificationSubscription;
|
|
75
|
+
updateNotificationSubscription(agentId: string, subscriptionId: string, body: UpdateNotificationSubscriptionRequest): Promise<unknown>;
|
|
76
|
+
updateNotificationSubscription(identifier: {
|
|
77
|
+
agentId: string;
|
|
78
|
+
}, subscriptionId: string, body: UpdateNotificationSubscriptionRequest): Promise<unknown>;
|
|
79
|
+
private _updateNotificationSubscription;
|
|
80
|
+
deleteNotificationSubscription(agentId: string, subscriptionId: string): Promise<unknown>;
|
|
81
|
+
deleteNotificationSubscription(identifier: {
|
|
82
|
+
agentId: string;
|
|
83
|
+
}, subscriptionId: string): Promise<unknown>;
|
|
84
|
+
private _deleteNotificationSubscription;
|
|
85
|
+
getAgentNotificationSubscribers(agentId: string): Promise<NotificationSubscribersResponse>;
|
|
86
|
+
getAgentNotificationSubscribers(identifier: {
|
|
87
|
+
agentId: string;
|
|
88
|
+
}): Promise<NotificationSubscribersResponse>;
|
|
89
|
+
private _getAgentNotificationSubscribers;
|
|
90
|
+
updateMeWebPushEndpoint(body: UpdateMeWebPushEndpointRequest): Promise<unknown>;
|
|
91
|
+
getWebPushPublicKey(): Promise<{
|
|
92
|
+
key: string;
|
|
93
|
+
}>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { resolveAgentArgs } from "./_args.js";
|
|
2
|
+
export class NotificationsApi {
|
|
3
|
+
constructor(rest) {
|
|
4
|
+
this.rest = rest;
|
|
5
|
+
}
|
|
6
|
+
getAgentNotifications(...args) {
|
|
7
|
+
const { agentId } = resolveAgentArgs(args);
|
|
8
|
+
return this._getAgentNotifications(agentId);
|
|
9
|
+
}
|
|
10
|
+
_getAgentNotifications(agentId) {
|
|
11
|
+
return this.rest.get(`/agents/${agentId}/notifications`);
|
|
12
|
+
}
|
|
13
|
+
getAgentNotificationEndpoints(...args) {
|
|
14
|
+
if (typeof args[0] === "string") {
|
|
15
|
+
return this._getAgentNotificationEndpoints(args[0], args[1]);
|
|
16
|
+
}
|
|
17
|
+
const id = args[0];
|
|
18
|
+
return this._getAgentNotificationEndpoints(id.agentId, args[1]);
|
|
19
|
+
}
|
|
20
|
+
_getAgentNotificationEndpoints(agentId, name) {
|
|
21
|
+
return this.rest.get(`/agents/${agentId}/notifications/endpoints`, { name });
|
|
22
|
+
}
|
|
23
|
+
getAgentNotificationEndpointSummaries(...args) {
|
|
24
|
+
const { agentId } = resolveAgentArgs(args);
|
|
25
|
+
return this._getAgentNotificationEndpointSummaries(agentId);
|
|
26
|
+
}
|
|
27
|
+
_getAgentNotificationEndpointSummaries(agentId) {
|
|
28
|
+
return this.rest.get(`/agents/${agentId}/notifications/endpoints/summary`);
|
|
29
|
+
}
|
|
30
|
+
createNotificationEndpoint(...args) {
|
|
31
|
+
if (typeof args[0] === "string") {
|
|
32
|
+
return this._createNotificationEndpoint(args[0], args[1]);
|
|
33
|
+
}
|
|
34
|
+
const id = args[0];
|
|
35
|
+
return this._createNotificationEndpoint(id.agentId, args[1]);
|
|
36
|
+
}
|
|
37
|
+
_createNotificationEndpoint(agentId, body) {
|
|
38
|
+
return this.rest.post(`/agents/${agentId}/notifications/endpoints`, body);
|
|
39
|
+
}
|
|
40
|
+
updateNotificationEndpoint(...args) {
|
|
41
|
+
if (typeof args[0] === "string") {
|
|
42
|
+
return this._updateNotificationEndpoint(args[0], args[1], args[2]);
|
|
43
|
+
}
|
|
44
|
+
const id = args[0];
|
|
45
|
+
return this._updateNotificationEndpoint(id.agentId, args[1], args[2]);
|
|
46
|
+
}
|
|
47
|
+
_updateNotificationEndpoint(agentId, endpointId, body) {
|
|
48
|
+
return this.rest.patch(`/agents/${agentId}/notifications/endpoints/${endpointId}`, body);
|
|
49
|
+
}
|
|
50
|
+
deleteNotificationEndpoint(...args) {
|
|
51
|
+
if (typeof args[0] === "string") {
|
|
52
|
+
return this._deleteNotificationEndpoint(args[0], args[1]);
|
|
53
|
+
}
|
|
54
|
+
const id = args[0];
|
|
55
|
+
return this._deleteNotificationEndpoint(id.agentId, args[1]);
|
|
56
|
+
}
|
|
57
|
+
_deleteNotificationEndpoint(agentId, endpointId) {
|
|
58
|
+
return this.rest.delete(`/agents/${agentId}/notifications/endpoints/${endpointId}`);
|
|
59
|
+
}
|
|
60
|
+
testNotificationEndpoint(...args) {
|
|
61
|
+
if (typeof args[0] === "string") {
|
|
62
|
+
return this._testNotificationEndpoint(args[0], args[1]);
|
|
63
|
+
}
|
|
64
|
+
const id = args[0];
|
|
65
|
+
return this._testNotificationEndpoint(id.agentId, args[1]);
|
|
66
|
+
}
|
|
67
|
+
_testNotificationEndpoint(agentId, endpointId) {
|
|
68
|
+
return this.rest.post(`/agents/${agentId}/notifications/endpoints/${endpointId}/test`, {});
|
|
69
|
+
}
|
|
70
|
+
getAgentNotificationSubscriptions(...args) {
|
|
71
|
+
if (typeof args[0] === "string") {
|
|
72
|
+
return this._getAgentNotificationSubscriptions(args[0], args[1]);
|
|
73
|
+
}
|
|
74
|
+
const id = args[0];
|
|
75
|
+
return this._getAgentNotificationSubscriptions(id.agentId, args[1]);
|
|
76
|
+
}
|
|
77
|
+
_getAgentNotificationSubscriptions(agentId, subscribed_to) {
|
|
78
|
+
return this.rest.get(`/agents/${agentId}/notifications/subscriptions`, { subscribed_to });
|
|
79
|
+
}
|
|
80
|
+
createNotificationSubscription(...args) {
|
|
81
|
+
if (typeof args[0] === "string") {
|
|
82
|
+
return this._createNotificationSubscription(args[0], args[1]);
|
|
83
|
+
}
|
|
84
|
+
const id = args[0];
|
|
85
|
+
return this._createNotificationSubscription(id.agentId, args[1]);
|
|
86
|
+
}
|
|
87
|
+
_createNotificationSubscription(agentId, body) {
|
|
88
|
+
return this.rest.post(`/agents/${agentId}/notifications/subscriptions`, body);
|
|
89
|
+
}
|
|
90
|
+
getAgentDefaultNotificationSubscriptions(...args) {
|
|
91
|
+
if (typeof args[0] === "string") {
|
|
92
|
+
return this._getAgentDefaultNotificationSubscriptions(args[0], args[1]);
|
|
93
|
+
}
|
|
94
|
+
const id = args[0];
|
|
95
|
+
return this._getAgentDefaultNotificationSubscriptions(id.agentId, args[1]);
|
|
96
|
+
}
|
|
97
|
+
_getAgentDefaultNotificationSubscriptions(agentId, subscribed_to) {
|
|
98
|
+
return this.rest.get(`/agents/${agentId}/notifications/subscriptions/default`, { subscribed_to });
|
|
99
|
+
}
|
|
100
|
+
updateDefaultNotificationSubscription(...args) {
|
|
101
|
+
if (typeof args[0] === "string") {
|
|
102
|
+
return this._updateDefaultNotificationSubscription(args[0], args[1], args[2]);
|
|
103
|
+
}
|
|
104
|
+
const id = args[0];
|
|
105
|
+
return this._updateDefaultNotificationSubscription(id.agentId, args[1], args[2]);
|
|
106
|
+
}
|
|
107
|
+
_updateDefaultNotificationSubscription(agentId, subscribedTo, body) {
|
|
108
|
+
return this.rest.patch(`/agents/${agentId}/notifications/subscriptions/default/${subscribedTo}`, body);
|
|
109
|
+
}
|
|
110
|
+
deleteDefaultNotificationSubscription(...args) {
|
|
111
|
+
if (typeof args[0] === "string") {
|
|
112
|
+
return this._deleteDefaultNotificationSubscription(args[0], args[1]);
|
|
113
|
+
}
|
|
114
|
+
const id = args[0];
|
|
115
|
+
return this._deleteDefaultNotificationSubscription(id.agentId, args[1]);
|
|
116
|
+
}
|
|
117
|
+
_deleteDefaultNotificationSubscription(agentId, subscribedTo) {
|
|
118
|
+
return this.rest.delete(`/agents/${agentId}/notifications/subscriptions/default/${subscribedTo}`);
|
|
119
|
+
}
|
|
120
|
+
updateNotificationSubscription(...args) {
|
|
121
|
+
if (typeof args[0] === "string") {
|
|
122
|
+
return this._updateNotificationSubscription(args[0], args[1], args[2]);
|
|
123
|
+
}
|
|
124
|
+
const id = args[0];
|
|
125
|
+
return this._updateNotificationSubscription(id.agentId, args[1], args[2]);
|
|
126
|
+
}
|
|
127
|
+
_updateNotificationSubscription(agentId, subscriptionId, body) {
|
|
128
|
+
return this.rest.patch(`/agents/${agentId}/notifications/subscriptions/${subscriptionId}`, body);
|
|
129
|
+
}
|
|
130
|
+
deleteNotificationSubscription(...args) {
|
|
131
|
+
if (typeof args[0] === "string") {
|
|
132
|
+
return this._deleteNotificationSubscription(args[0], args[1]);
|
|
133
|
+
}
|
|
134
|
+
const id = args[0];
|
|
135
|
+
return this._deleteNotificationSubscription(id.agentId, args[1]);
|
|
136
|
+
}
|
|
137
|
+
_deleteNotificationSubscription(agentId, subscriptionId) {
|
|
138
|
+
return this.rest.delete(`/agents/${agentId}/notifications/subscriptions/${subscriptionId}`);
|
|
139
|
+
}
|
|
140
|
+
getAgentNotificationSubscribers(...args) {
|
|
141
|
+
const { agentId } = resolveAgentArgs(args);
|
|
142
|
+
return this._getAgentNotificationSubscribers(agentId);
|
|
143
|
+
}
|
|
144
|
+
_getAgentNotificationSubscribers(agentId) {
|
|
145
|
+
return this.rest.get(`/agents/${agentId}/notifications/subscribers`);
|
|
146
|
+
}
|
|
147
|
+
updateMeWebPushEndpoint(body) {
|
|
148
|
+
return this.rest.post("/agents/me/notifications/update_web_push", body);
|
|
149
|
+
}
|
|
150
|
+
getWebPushPublicKey() {
|
|
151
|
+
return this.rest.get("/notifications/webpush-public-key");
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { CustomerSite, Organisation, PaginatedResponse } from "../types/viewer.js";
|
|
3
|
+
export interface ListOrganisationsOptions {
|
|
4
|
+
page?: number;
|
|
5
|
+
perPage?: number;
|
|
6
|
+
search?: string;
|
|
7
|
+
archived?: boolean | "";
|
|
8
|
+
ordering?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
name__contains?: string;
|
|
11
|
+
name__icontains?: string;
|
|
12
|
+
id?: string | number;
|
|
13
|
+
[key: string]: string | number | boolean | "" | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare class OrganisationsApi {
|
|
16
|
+
private readonly rest;
|
|
17
|
+
private readonly controlApiUrl?;
|
|
18
|
+
constructor(rest: RestClient, controlApiUrl?: string | undefined);
|
|
19
|
+
listOrganisations(options?: ListOrganisationsOptions): Promise<PaginatedResponse<Organisation>>;
|
|
20
|
+
getOrganisation(id: string): Promise<Organisation>;
|
|
21
|
+
/**
|
|
22
|
+
* Convert an organisation record from `/organisations/` into the smaller
|
|
23
|
+
* customer-site bootstrap shape returned by `/site/`.
|
|
24
|
+
*/
|
|
25
|
+
toCustomerSite(organisation: Organisation): CustomerSite;
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export class OrganisationsApi {
|
|
2
|
+
constructor(rest, controlApiUrl) {
|
|
3
|
+
this.rest = rest;
|
|
4
|
+
this.controlApiUrl = controlApiUrl;
|
|
5
|
+
}
|
|
6
|
+
listOrganisations(options) {
|
|
7
|
+
return this.rest.get("/organisations/", buildListQuery(options), this.controlApiUrl);
|
|
8
|
+
}
|
|
9
|
+
getOrganisation(id) {
|
|
10
|
+
return this.rest.get(`/organisations/${id}/`, undefined, this.controlApiUrl);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Convert an organisation record from `/organisations/` into the smaller
|
|
14
|
+
* customer-site bootstrap shape returned by `/site/`.
|
|
15
|
+
*/
|
|
16
|
+
toCustomerSite(organisation) {
|
|
17
|
+
return {
|
|
18
|
+
id: organisation.id,
|
|
19
|
+
name: organisation.name,
|
|
20
|
+
application_id: organisation.application_id,
|
|
21
|
+
archived: organisation.archived,
|
|
22
|
+
theme: organisation.theme ?? {},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function buildListQuery(options) {
|
|
27
|
+
if (!options)
|
|
28
|
+
return undefined;
|
|
29
|
+
const { page, perPage, ...rest } = options;
|
|
30
|
+
const query = {};
|
|
31
|
+
if (page !== undefined)
|
|
32
|
+
query.page = page;
|
|
33
|
+
if (perPage !== undefined)
|
|
34
|
+
query.per_page = perPage;
|
|
35
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
36
|
+
if (value === undefined)
|
|
37
|
+
continue;
|
|
38
|
+
query[key] = value;
|
|
39
|
+
}
|
|
40
|
+
return query;
|
|
41
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { AgentPermission, PermissionDebugResponse, SuccessListResponse, SyncPermissionRequest } from "../types/openapi.js";
|
|
3
|
+
export declare class PermissionsApi {
|
|
4
|
+
private readonly rest;
|
|
5
|
+
constructor(rest: RestClient);
|
|
6
|
+
getAgentPermission(agentId: string): Promise<AgentPermission>;
|
|
7
|
+
getAgentPermission(identifier: {
|
|
8
|
+
agentId: string;
|
|
9
|
+
}): Promise<AgentPermission>;
|
|
10
|
+
private _getAgentPermission;
|
|
11
|
+
getAgentPermissionDebug(agentId: string): Promise<PermissionDebugResponse>;
|
|
12
|
+
getAgentPermissionDebug(identifier: {
|
|
13
|
+
agentId: string;
|
|
14
|
+
}): Promise<PermissionDebugResponse>;
|
|
15
|
+
private _getAgentPermissionDebug;
|
|
16
|
+
syncPermissions(body: SyncPermissionRequest): Promise<SuccessListResponse<string>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { resolveAgentArgs } from "./_args.js";
|
|
2
|
+
export class PermissionsApi {
|
|
3
|
+
constructor(rest) {
|
|
4
|
+
this.rest = rest;
|
|
5
|
+
}
|
|
6
|
+
getAgentPermission(...args) {
|
|
7
|
+
const { agentId } = resolveAgentArgs(args);
|
|
8
|
+
return this._getAgentPermission(agentId);
|
|
9
|
+
}
|
|
10
|
+
_getAgentPermission(agentId) {
|
|
11
|
+
return this.rest.get(`/agents/${agentId}/permissions`);
|
|
12
|
+
}
|
|
13
|
+
getAgentPermissionDebug(...args) {
|
|
14
|
+
const { agentId } = resolveAgentArgs(args);
|
|
15
|
+
return this._getAgentPermissionDebug(agentId);
|
|
16
|
+
}
|
|
17
|
+
_getAgentPermissionDebug(agentId) {
|
|
18
|
+
return this.rest.get(`/agents/${agentId}/permissions/debug`);
|
|
19
|
+
}
|
|
20
|
+
syncPermissions(body) {
|
|
21
|
+
return this.rest.post("/permissions/sync", body);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { CreateIngestionRequest, PutScheduleRequest, PutSubscriptionRequest, ScheduleInfo, SubscriptionInfo } from "../types/openapi.js";
|
|
3
|
+
export declare class ProcessorsApi {
|
|
4
|
+
private readonly rest;
|
|
5
|
+
constructor(rest: RestClient);
|
|
6
|
+
createProcessorSchedule(agentId: string, scheduleId: string, body: PutScheduleRequest): Promise<unknown>;
|
|
7
|
+
createProcessorSchedule(identifier: {
|
|
8
|
+
agentId: string;
|
|
9
|
+
}, scheduleId: string, body: PutScheduleRequest): Promise<unknown>;
|
|
10
|
+
private _createProcessorSchedule;
|
|
11
|
+
deleteProcessorSchedule(agentId: string, scheduleId: string): Promise<unknown>;
|
|
12
|
+
deleteProcessorSchedule(identifier: {
|
|
13
|
+
agentId: string;
|
|
14
|
+
}, scheduleId: string): Promise<unknown>;
|
|
15
|
+
private _deleteProcessorSchedule;
|
|
16
|
+
regenerateScheduleToken(agentId: string, scheduleId: string): Promise<unknown>;
|
|
17
|
+
regenerateScheduleToken(identifier: {
|
|
18
|
+
agentId: string;
|
|
19
|
+
}, scheduleId: string): Promise<unknown>;
|
|
20
|
+
private _regenerateScheduleToken;
|
|
21
|
+
getScheduleInfo(scheduleId: string): Promise<ScheduleInfo>;
|
|
22
|
+
getScheduleInfoAlias(scheduleId: string): Promise<ScheduleInfo>;
|
|
23
|
+
createProcessorSubscription(agentId: string, subscriptionId: string, body: PutSubscriptionRequest): Promise<unknown>;
|
|
24
|
+
createProcessorSubscription(identifier: {
|
|
25
|
+
agentId: string;
|
|
26
|
+
}, subscriptionId: string, body: PutSubscriptionRequest): Promise<unknown>;
|
|
27
|
+
private _createProcessorSubscription;
|
|
28
|
+
deleteProcessorSubscription(agentId: string, subscriptionId: string): Promise<unknown>;
|
|
29
|
+
deleteProcessorSubscription(identifier: {
|
|
30
|
+
agentId: string;
|
|
31
|
+
}, subscriptionId: string): Promise<unknown>;
|
|
32
|
+
private _deleteProcessorSubscription;
|
|
33
|
+
getProcessorSubscriptionInfo(subscriptionName: string): Promise<SubscriptionInfo>;
|
|
34
|
+
getProcessorSubscriptionInfoAlias(subscriptionArn: string): Promise<SubscriptionInfo>;
|
|
35
|
+
createIngestionEndpoint(agentId: string, ingestionId: string, body: CreateIngestionRequest): Promise<unknown>;
|
|
36
|
+
createIngestionEndpoint(identifier: {
|
|
37
|
+
agentId: string;
|
|
38
|
+
}, ingestionId: string, body: CreateIngestionRequest): Promise<unknown>;
|
|
39
|
+
private _createIngestionEndpoint;
|
|
40
|
+
deleteIngestionEndpoint(agentId: string, ingestionId: string): Promise<unknown>;
|
|
41
|
+
deleteIngestionEndpoint(identifier: {
|
|
42
|
+
agentId: string;
|
|
43
|
+
}, ingestionId: string): Promise<unknown>;
|
|
44
|
+
private _deleteIngestionEndpoint;
|
|
45
|
+
invokeIngestionEndpoint(agentId: string, ingestionId: string, body: unknown, params?: {
|
|
46
|
+
wait?: boolean;
|
|
47
|
+
json_response?: boolean;
|
|
48
|
+
}): Promise<unknown>;
|
|
49
|
+
invokeIngestionEndpoint(identifier: {
|
|
50
|
+
agentId: string;
|
|
51
|
+
}, ingestionId: string, body: unknown, params?: {
|
|
52
|
+
wait?: boolean;
|
|
53
|
+
json_response?: boolean;
|
|
54
|
+
}): Promise<unknown>;
|
|
55
|
+
private _invokeIngestionEndpoint;
|
|
56
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export class ProcessorsApi {
|
|
2
|
+
constructor(rest) {
|
|
3
|
+
this.rest = rest;
|
|
4
|
+
}
|
|
5
|
+
createProcessorSchedule(...args) {
|
|
6
|
+
if (typeof args[0] === "string") {
|
|
7
|
+
return this._createProcessorSchedule(args[0], args[1], args[2]);
|
|
8
|
+
}
|
|
9
|
+
const id = args[0];
|
|
10
|
+
return this._createProcessorSchedule(id.agentId, args[1], args[2]);
|
|
11
|
+
}
|
|
12
|
+
_createProcessorSchedule(agentId, scheduleId, body) {
|
|
13
|
+
return this.rest.put(`/agents/${agentId}/processors/schedules/${scheduleId}`, body);
|
|
14
|
+
}
|
|
15
|
+
deleteProcessorSchedule(...args) {
|
|
16
|
+
if (typeof args[0] === "string") {
|
|
17
|
+
return this._deleteProcessorSchedule(args[0], args[1]);
|
|
18
|
+
}
|
|
19
|
+
const id = args[0];
|
|
20
|
+
return this._deleteProcessorSchedule(id.agentId, args[1]);
|
|
21
|
+
}
|
|
22
|
+
_deleteProcessorSchedule(agentId, scheduleId) {
|
|
23
|
+
return this.rest.delete(`/agents/${agentId}/processors/schedules/${scheduleId}`);
|
|
24
|
+
}
|
|
25
|
+
regenerateScheduleToken(...args) {
|
|
26
|
+
if (typeof args[0] === "string") {
|
|
27
|
+
return this._regenerateScheduleToken(args[0], args[1]);
|
|
28
|
+
}
|
|
29
|
+
const id = args[0];
|
|
30
|
+
return this._regenerateScheduleToken(id.agentId, args[1]);
|
|
31
|
+
}
|
|
32
|
+
_regenerateScheduleToken(agentId, scheduleId) {
|
|
33
|
+
return this.rest.post(`/agents/${agentId}/processors/schedules/${scheduleId}/token`, {});
|
|
34
|
+
}
|
|
35
|
+
getScheduleInfo(scheduleId) {
|
|
36
|
+
return this.rest.get(`/processors/schedules/${scheduleId}`);
|
|
37
|
+
}
|
|
38
|
+
getScheduleInfoAlias(scheduleId) {
|
|
39
|
+
return this.rest.get(`/processors/schedules/${scheduleId}/info`);
|
|
40
|
+
}
|
|
41
|
+
createProcessorSubscription(...args) {
|
|
42
|
+
if (typeof args[0] === "string") {
|
|
43
|
+
return this._createProcessorSubscription(args[0], args[1], args[2]);
|
|
44
|
+
}
|
|
45
|
+
const id = args[0];
|
|
46
|
+
return this._createProcessorSubscription(id.agentId, args[1], args[2]);
|
|
47
|
+
}
|
|
48
|
+
_createProcessorSubscription(agentId, subscriptionId, body) {
|
|
49
|
+
return this.rest.put(`/agents/${agentId}/processors/subscriptions/${subscriptionId}`, body);
|
|
50
|
+
}
|
|
51
|
+
deleteProcessorSubscription(...args) {
|
|
52
|
+
if (typeof args[0] === "string") {
|
|
53
|
+
return this._deleteProcessorSubscription(args[0], args[1]);
|
|
54
|
+
}
|
|
55
|
+
const id = args[0];
|
|
56
|
+
return this._deleteProcessorSubscription(id.agentId, args[1]);
|
|
57
|
+
}
|
|
58
|
+
_deleteProcessorSubscription(agentId, subscriptionId) {
|
|
59
|
+
return this.rest.delete(`/agents/${agentId}/processors/subscriptions/${subscriptionId}`);
|
|
60
|
+
}
|
|
61
|
+
getProcessorSubscriptionInfo(subscriptionName) {
|
|
62
|
+
return this.rest.get(`/processors/subscriptions/${subscriptionName}`);
|
|
63
|
+
}
|
|
64
|
+
getProcessorSubscriptionInfoAlias(subscriptionArn) {
|
|
65
|
+
return this.rest.get(`/processors/subscriptions/${subscriptionArn}/info`);
|
|
66
|
+
}
|
|
67
|
+
createIngestionEndpoint(...args) {
|
|
68
|
+
if (typeof args[0] === "string") {
|
|
69
|
+
return this._createIngestionEndpoint(args[0], args[1], args[2]);
|
|
70
|
+
}
|
|
71
|
+
const id = args[0];
|
|
72
|
+
return this._createIngestionEndpoint(id.agentId, args[1], args[2]);
|
|
73
|
+
}
|
|
74
|
+
_createIngestionEndpoint(agentId, ingestionId, body) {
|
|
75
|
+
return this.rest.put(`/agents/${agentId}/processors/ingestions/${ingestionId}`, body);
|
|
76
|
+
}
|
|
77
|
+
deleteIngestionEndpoint(...args) {
|
|
78
|
+
if (typeof args[0] === "string") {
|
|
79
|
+
return this._deleteIngestionEndpoint(args[0], args[1]);
|
|
80
|
+
}
|
|
81
|
+
const id = args[0];
|
|
82
|
+
return this._deleteIngestionEndpoint(id.agentId, args[1]);
|
|
83
|
+
}
|
|
84
|
+
_deleteIngestionEndpoint(agentId, ingestionId) {
|
|
85
|
+
return this.rest.delete(`/agents/${agentId}/processors/ingestions/${ingestionId}`);
|
|
86
|
+
}
|
|
87
|
+
invokeIngestionEndpoint(...args) {
|
|
88
|
+
if (typeof args[0] === "string") {
|
|
89
|
+
return this._invokeIngestionEndpoint(args[0], args[1], args[2], args[3]);
|
|
90
|
+
}
|
|
91
|
+
const id = args[0];
|
|
92
|
+
return this._invokeIngestionEndpoint(id.agentId, args[1], args[2], args[3]);
|
|
93
|
+
}
|
|
94
|
+
_invokeIngestionEndpoint(agentId, ingestionId, body, params) {
|
|
95
|
+
return this.rest.post(`/agents/${agentId}/processors/ingestions/${ingestionId}/invoke`, body, params);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { TurnCredential, TurnTokenRequest } from "../types/openapi.js";
|
|
3
|
+
export declare class TurnApi {
|
|
4
|
+
private readonly rest;
|
|
5
|
+
constructor(rest: RestClient);
|
|
6
|
+
createTurnToken(body: TurnTokenRequest): Promise<TurnCredential>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RestClient } from "../http/rest-client.js";
|
|
2
|
+
import type { User } from "../types/viewer.js";
|
|
3
|
+
export declare class UsersApi {
|
|
4
|
+
private readonly rest;
|
|
5
|
+
private readonly controlApiUrl?;
|
|
6
|
+
constructor(rest: RestClient, controlApiUrl?: string | undefined);
|
|
7
|
+
getMe(): Promise<User>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe value object representing a single Doover auth profile.
|
|
3
|
+
*
|
|
4
|
+
* Property names use camelCase JS conventions. The static helpers `parse` and
|
|
5
|
+
* `dump` translate to/from the on-disk format shared with pydoover.
|
|
6
|
+
*/
|
|
7
|
+
export interface AuthProfileData {
|
|
8
|
+
profile?: string;
|
|
9
|
+
token?: string | null;
|
|
10
|
+
tokenExpires?: string | null;
|
|
11
|
+
agentId?: string | null;
|
|
12
|
+
controlBaseUrl?: string | null;
|
|
13
|
+
dataBaseUrl?: string | null;
|
|
14
|
+
refreshToken?: string | null;
|
|
15
|
+
refreshTokenId?: string | null;
|
|
16
|
+
authServerUrl?: string | null;
|
|
17
|
+
authServerClientId?: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare class AuthProfile {
|
|
20
|
+
profile: string;
|
|
21
|
+
token: string | null;
|
|
22
|
+
tokenExpires: string | null;
|
|
23
|
+
agentId: string | null;
|
|
24
|
+
controlBaseUrl: string | null;
|
|
25
|
+
dataBaseUrl: string | null;
|
|
26
|
+
refreshToken: string | null;
|
|
27
|
+
refreshTokenId: string | null;
|
|
28
|
+
authServerUrl: string | null;
|
|
29
|
+
authServerClientId: string | null;
|
|
30
|
+
constructor(data: AuthProfileData & {
|
|
31
|
+
profile: string;
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Parse a block of lines (excluding the `[profile=...]` header) into an
|
|
35
|
+
* `AuthProfile`. The profile name must be provided separately.
|
|
36
|
+
*/
|
|
37
|
+
static parse(profileName: string, lines: string[]): AuthProfile;
|
|
38
|
+
/**
|
|
39
|
+
* Serialise to the on-disk reduced format (without the `[profile=...]`
|
|
40
|
+
* header line, which the caller is responsible for).
|
|
41
|
+
*/
|
|
42
|
+
dump(): string;
|
|
43
|
+
/** Full block including the header line. */
|
|
44
|
+
dumpBlock(): string;
|
|
45
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** On-disk key → JS property mapping (pydoover reduced-format Doover2). */
|
|
2
|
+
const DISK_KEY_MAP = {
|
|
3
|
+
TOKEN: "token",
|
|
4
|
+
TOKEN_EXPIRES: "tokenExpires",
|
|
5
|
+
AGENT_ID: "agentId",
|
|
6
|
+
BASE_URL: "controlBaseUrl",
|
|
7
|
+
BASE_DATA_URL: "dataBaseUrl",
|
|
8
|
+
REFRESH_TOKEN: "refreshToken",
|
|
9
|
+
REFRESH_TOKEN_ID: "refreshTokenId",
|
|
10
|
+
AUTH_SERVER_URL: "authServerUrl",
|
|
11
|
+
AUTH_SERVER_CLIENT_ID: "authServerClientId",
|
|
12
|
+
};
|
|
13
|
+
/** JS property → on-disk key mapping. */
|
|
14
|
+
const JS_KEY_MAP = Object.fromEntries(Object.entries(DISK_KEY_MAP).map(([disk, js]) => [js, disk]));
|
|
15
|
+
export class AuthProfile {
|
|
16
|
+
constructor(data) {
|
|
17
|
+
this.profile = data.profile;
|
|
18
|
+
this.token = data.token ?? null;
|
|
19
|
+
this.tokenExpires = data.tokenExpires ?? null;
|
|
20
|
+
this.agentId = data.agentId ?? null;
|
|
21
|
+
this.controlBaseUrl = data.controlBaseUrl ?? null;
|
|
22
|
+
this.dataBaseUrl = data.dataBaseUrl ?? null;
|
|
23
|
+
this.refreshToken = data.refreshToken ?? null;
|
|
24
|
+
this.refreshTokenId = data.refreshTokenId ?? null;
|
|
25
|
+
this.authServerUrl = data.authServerUrl ?? null;
|
|
26
|
+
this.authServerClientId = data.authServerClientId ?? null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Parse a block of lines (excluding the `[profile=...]` header) into an
|
|
30
|
+
* `AuthProfile`. The profile name must be provided separately.
|
|
31
|
+
*/
|
|
32
|
+
static parse(profileName, lines) {
|
|
33
|
+
const data = { profile: profileName };
|
|
34
|
+
for (const line of lines) {
|
|
35
|
+
const trimmed = line.trim();
|
|
36
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
37
|
+
continue;
|
|
38
|
+
const eqIdx = trimmed.indexOf("=");
|
|
39
|
+
if (eqIdx === -1)
|
|
40
|
+
continue;
|
|
41
|
+
const key = trimmed.slice(0, eqIdx).trim();
|
|
42
|
+
const value = trimmed.slice(eqIdx + 1).trim();
|
|
43
|
+
const jsProp = DISK_KEY_MAP[key];
|
|
44
|
+
if (jsProp) {
|
|
45
|
+
data[jsProp] = value || null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return new AuthProfile(data);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Serialise to the on-disk reduced format (without the `[profile=...]`
|
|
52
|
+
* header line, which the caller is responsible for).
|
|
53
|
+
*/
|
|
54
|
+
dump() {
|
|
55
|
+
const lines = [];
|
|
56
|
+
for (const jsProp of Object.keys(JS_KEY_MAP)) {
|
|
57
|
+
const value = this[jsProp];
|
|
58
|
+
if (value !== null && value !== undefined) {
|
|
59
|
+
lines.push(`${JS_KEY_MAP[jsProp]}=${value}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return lines.join("\n");
|
|
63
|
+
}
|
|
64
|
+
/** Full block including the header line. */
|
|
65
|
+
dumpBlock() {
|
|
66
|
+
return `[profile=${this.profile}]\n${this.dump()}`;
|
|
67
|
+
}
|
|
68
|
+
}
|