diff --git a/grpc-api/src/main/java/io/deephaven/grpc_api/console/ConsoleServiceGrpcImpl.java b/grpc-api/src/main/java/io/deephaven/grpc_api/console/ConsoleServiceGrpcImpl.java index f8ab2232123..e641e67e0ed 100644 --- a/grpc-api/src/main/java/io/deephaven/grpc_api/console/ConsoleServiceGrpcImpl.java +++ b/grpc-api/src/main/java/io/deephaven/grpc_api/console/ConsoleServiceGrpcImpl.java @@ -120,8 +120,8 @@ public void startConsole(StartConsoleRequest request, StreamObserver { diff --git a/open-api/shared-ide/src/main/java/io/deephaven/web/shared/ide/ConsoleAddress.java b/open-api/shared-ide/src/main/java/io/deephaven/web/shared/ide/ConsoleAddress.java deleted file mode 100644 index d2d19e343a8..00000000000 --- a/open-api/shared-ide/src/main/java/io/deephaven/web/shared/ide/ConsoleAddress.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.deephaven.web.shared.ide; - -import io.deephaven.web.shared.data.ConnectToken; - -import java.io.Serializable; - -/** - * Sent from the server to the client so the client can figure out where to connect to the worker. - */ - -public class ConsoleAddress implements Serializable { - private ConnectToken token; - private String websocketUrl; - private String serviceId; - - public void setToken(ConnectToken token) { - this.token = token; - } - - public ConnectToken getToken() { - return token; - } - - public void setWebsocketUrl(String websocketUrl) { - this.websocketUrl = websocketUrl; - } - - public String getWebsocketUrl() { - return websocketUrl; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public String getServiceId() { - return serviceId; - } -} diff --git a/web/WebDevelopersGuide.md b/web/WebDevelopersGuide.md index 80214a24251..8ea7fdcd4c1 100644 --- a/web/WebDevelopersGuide.md +++ b/web/WebDevelopersGuide.md @@ -1100,6 +1100,9 @@ This enum describes the name of each supported operation/aggregation type when c ##### Class `IdeConnection` +###### Constructor + * `new dh.IdeConnection(String websocketUrl, IdeConnectionOptions options)` - creates a new instance, from which console sessions can be made. `options` are optional. + ###### Methods * `addEventListener(String eventType, Function eventListener)` @@ -1113,6 +1116,11 @@ This enum describes the name of each supported operation/aggregation type when c * `String websocketUrl` - the url used when connecting to the server. Read-only. * `String serviceId` - The name of the service that should be authenticated to on the server. Read-only. +##### Class `IdeConnectionOptions` +###### Properties + * `String authToken` - base 64 encoded auth token + * `String serviceId` - The service ID to use for the connection + ##### Class `IdeSession` ###### Methods diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/JsWorkspaceData.java b/web/client-api/src/main/java/io/deephaven/web/client/api/JsWorkspaceData.java deleted file mode 100644 index f0faf384bae..00000000000 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/JsWorkspaceData.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.deephaven.web.client.api; - -import elemental2.core.JsArray; -import elemental2.core.JsString; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsType; - -@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) -public class JsWorkspaceData { - public String id; - public Double version; - public String name; - public String owner; - public String dataType; - public String status; - public JsArray adminGroups; - public JsArray viewerGroups; - - public String data; - -} diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java b/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java index eb93a41bf14..6f62c76cf44 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/QueryConnectable.java @@ -1,10 +1,13 @@ package io.deephaven.web.client.api; +import elemental2.core.JsArray; import elemental2.core.JsSet; import elemental2.dom.DomGlobal; import elemental2.promise.Promise; import io.deephaven.ide.shared.IdeSession; import io.deephaven.javascript.proto.dhinternal.arrow.flight.protocol.flight_pb.Ticket; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetConsoleTypesRequest; +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.GetConsoleTypesResponse; import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.console_pb.StartConsoleRequest; import io.deephaven.web.client.fu.CancellablePromise; import io.deephaven.web.client.fu.JsLog; @@ -166,6 +169,17 @@ public CancellablePromise startSession(String type) { }, closer); } + @JsMethod + public Promise> getConsoleTypes() { + Promise promise = Callbacks.grpcUnaryPromise(callback -> { + GetConsoleTypesRequest request = new GetConsoleTypesRequest(); + connection.get().consoleServiceClient().getConsoleTypes(request, connection.get().metadata(), callback::apply); + }); + + return promise.then(result -> Promise.resolve(result.getConsoleTypesList())); + } + + public void connected() { if (closed) { JsLog.debug(getClass(), " closed before worker could connect"); diff --git a/web/client-api/src/main/java/io/deephaven/web/public/console.html b/web/client-api/src/main/java/io/deephaven/web/public/console.html index 3610f702bf8..5b5a3d5dfe3 100644 --- a/web/client-api/src/main/java/io/deephaven/web/public/console.html +++ b/web/client-api/src/main/java/io/deephaven/web/public/console.html @@ -13,19 +13,26 @@