doover-js 0.1.2 → 0.2.0-alpha.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 +104 -10
- package/dist/auth/auth-profile.d.ts +45 -0
- package/dist/auth/auth-profile.js +72 -0
- package/dist/auth/auth-store.d.ts +14 -0
- package/dist/auth/auth-store.js +2 -0
- package/dist/auth/build-auth.d.ts +37 -0
- package/dist/auth/build-auth.js +75 -0
- package/dist/auth/cookie-auth.d.ts +17 -0
- package/dist/auth/cookie-auth.js +29 -0
- package/dist/auth/doover-auth.d.ts +41 -0
- package/dist/auth/doover-auth.js +24 -0
- package/dist/auth/doover-token-auth.d.ts +35 -0
- package/dist/auth/doover-token-auth.js +178 -0
- package/dist/auth/errors.d.ts +3 -0
- package/dist/auth/errors.js +10 -0
- package/dist/auth/jwt.d.ts +6 -0
- package/dist/auth/jwt.js +29 -0
- package/dist/client/doover-client.d.ts +2 -0
- package/dist/client/doover-client.js +16 -3
- package/dist/gateway/gateway-client.d.ts +4 -2
- package/dist/gateway/gateway-client.js +24 -8
- package/dist/http/rest-client.d.ts +10 -3
- package/dist/http/rest-client.js +16 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.js +17 -5
- package/dist/node/config-manager.d.ts +34 -0
- package/dist/node/config-manager.js +177 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +5 -0
- package/dist/test/auth.test.d.ts +1 -0
- package/dist/test/auth.test.js +502 -0
- package/dist/test/config-manager.test.d.ts +1 -0
- package/dist/test/config-manager.test.js +160 -0
- package/dist/viewer/doover-data-provider.d.ts +2 -1
- package/dist/viewer/doover-data-provider.js +4 -4
- package/package.json +6 -1
|
@@ -3,6 +3,7 @@ import { AggregatesApi } from "../apis/aggregates-api";
|
|
|
3
3
|
import { ChannelsApi } from "../apis/channels-api";
|
|
4
4
|
import { ConnectionsApi } from "../apis/connections-api";
|
|
5
5
|
import { MessagesApi } from "../apis/messages-api";
|
|
6
|
+
import type { DooverAuth } from "../auth/doover-auth";
|
|
6
7
|
import { GatewayClient } from "../gateway/gateway-client";
|
|
7
8
|
import { RestClient, type DooverClientConfig } from "../http/rest-client";
|
|
8
9
|
import type { Aggregate, Channel, ConnectionDetails, MessageStructure } from "../types/common";
|
|
@@ -21,7 +22,7 @@ export declare class DooverDataProvider implements ChannelsDataProvider<ChannelI
|
|
|
21
22
|
readonly aggregatesApi: AggregatesApi;
|
|
22
23
|
readonly connectionsApi: ConnectionsApi;
|
|
23
24
|
private readonly subscriptions;
|
|
24
|
-
constructor(config: DooverClientConfig);
|
|
25
|
+
constructor(config: DooverClientConfig, auth?: DooverAuth);
|
|
25
26
|
getMe(): Promise<User>;
|
|
26
27
|
getAgents(): Promise<AgentsResponse>;
|
|
27
28
|
getChannels(identifier: ChannelIdentifier, options?: {
|
|
@@ -12,11 +12,11 @@ const rest_client_1 = require("../http/rest-client");
|
|
|
12
12
|
const snowflake_1 = require("../utils/snowflake");
|
|
13
13
|
const path_parsing_1 = require("./path-parsing");
|
|
14
14
|
class DooverDataProvider {
|
|
15
|
-
constructor(config) {
|
|
15
|
+
constructor(config, auth) {
|
|
16
16
|
this.config = config;
|
|
17
17
|
this.subscriptions = new Map();
|
|
18
|
-
this.rest = new rest_client_1.RestClient(config);
|
|
19
|
-
this.gateway = new gateway_client_1.GatewayClient(config);
|
|
18
|
+
this.rest = new rest_client_1.RestClient(config, auth);
|
|
19
|
+
this.gateway = new gateway_client_1.GatewayClient(config, auth);
|
|
20
20
|
this.agentsApi = new agents_api_1.AgentsApi(this.rest);
|
|
21
21
|
this.channelsApi = new channels_api_1.ChannelsApi(this.rest);
|
|
22
22
|
this.messagesApi = new messages_api_1.MessagesApi(this.rest);
|
|
@@ -84,7 +84,7 @@ class DooverDataProvider {
|
|
|
84
84
|
const entries = this.subscriptions.get(key) ?? [];
|
|
85
85
|
entries.push({ messageCallback: callback, aggregateCallback });
|
|
86
86
|
this.subscriptions.set(key, entries);
|
|
87
|
-
this.gateway.connect();
|
|
87
|
+
await this.gateway.connect();
|
|
88
88
|
this.gateway.subscribe({
|
|
89
89
|
agent_id: validated.agentId,
|
|
90
90
|
name: validated.channelName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doover-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
4
4
|
"description": "TypeScript client for Doover.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./node": {
|
|
13
|
+
"types": "./dist/node/index.d.ts",
|
|
14
|
+
"default": "./dist/node/index.js"
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
"repository": {
|
|
@@ -35,6 +39,7 @@
|
|
|
35
39
|
"@types/chai": "^5.2.2",
|
|
36
40
|
"@types/chai-as-promised": "^7.1.8",
|
|
37
41
|
"@types/mocha": "^10.0.10",
|
|
42
|
+
"@types/node": "^25.6.0",
|
|
38
43
|
"@types/sinon": "^17.0.4",
|
|
39
44
|
"chai": "^5.2.1",
|
|
40
45
|
"chai-as-promised": "^8.0.2",
|