@deephaven-enterprise/auth-nodejs 1.20250219.132-beta → 1.20250219.133-beta
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/dist/clientUtils.d.ts +4 -8
- package/dist/clientUtils.js +4 -17
- package/package.json +1 -1
package/dist/clientUtils.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import type { EnterpriseDhType as DheType } from '@deephaven-enterprise/jsapi-types';
|
|
1
|
+
import type { ConnectOptions, EnterpriseDhType as DheType } from '@deephaven-enterprise/jsapi-types';
|
|
2
2
|
import type { UnauthenticatedClient } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Create a connected, unauthenticated DHE client.
|
|
5
5
|
* @param dhe DHE JsApi.
|
|
6
6
|
* @param serverUrl The DHE server URL.
|
|
7
|
+
* @param connectOptions Optional connection options.
|
|
7
8
|
* @returns A connected, unauthenticated DHE client.
|
|
8
9
|
*/
|
|
9
|
-
export declare function createClient(dhe: DheType, serverUrl: URL): Promise<UnauthenticatedClient>;
|
|
10
|
-
|
|
11
|
-
* Get the WebSocket URL for a DHE server URL.
|
|
12
|
-
* @param serverUrl The DHE server URL.
|
|
13
|
-
* @returns The WebSocket URL.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getWsUrl(serverUrl: URL): URL;
|
|
10
|
+
export declare function createClient(dhe: DheType, serverUrl: URL, connectOptions?: ConnectOptions): Promise<UnauthenticatedClient>;
|
|
11
|
+
export default createClient;
|
package/dist/clientUtils.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Create a connected, unauthenticated DHE client.
|
|
3
3
|
* @param dhe DHE JsApi.
|
|
4
4
|
* @param serverUrl The DHE server URL.
|
|
5
|
+
* @param connectOptions Optional connection options.
|
|
5
6
|
* @returns A connected, unauthenticated DHE client.
|
|
6
7
|
*/
|
|
7
|
-
export async function createClient(dhe, serverUrl) {
|
|
8
|
-
const dheClient = new dhe.Client(
|
|
8
|
+
export async function createClient(dhe, serverUrl, connectOptions) {
|
|
9
|
+
const dheClient = new dhe.Client(serverUrl.toString(), connectOptions);
|
|
9
10
|
return new Promise(resolve => {
|
|
10
11
|
const unsubscribe = dheClient.addEventListener(dhe.Client.EVENT_CONNECT, () => {
|
|
11
12
|
unsubscribe();
|
|
@@ -13,18 +14,4 @@ export async function createClient(dhe, serverUrl) {
|
|
|
13
14
|
});
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
* Get the WebSocket URL for a DHE server URL.
|
|
18
|
-
* @param serverUrl The DHE server URL.
|
|
19
|
-
* @returns The WebSocket URL.
|
|
20
|
-
*/
|
|
21
|
-
export function getWsUrl(serverUrl) {
|
|
22
|
-
const url = new URL('/socket', serverUrl);
|
|
23
|
-
if (url.protocol === 'http:') {
|
|
24
|
-
url.protocol = 'ws:';
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
url.protocol = 'wss:';
|
|
28
|
-
}
|
|
29
|
-
return url;
|
|
30
|
-
}
|
|
17
|
+
export default createClient;
|
package/package.json
CHANGED