hypha-rpc 0.20.12 → 0.20.14
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/hypha-rpc-websocket.js +10 -13
- package/dist/hypha-rpc-websocket.js.map +1 -1
- package/dist/hypha-rpc-websocket.min.js +1 -1
- package/dist/hypha-rpc-websocket.min.js.map +1 -1
- package/package.json +1 -1
- package/src/rpc.js +3 -2
- package/src/websocket-client.js +7 -11
- package/tests/websocket_client_test.js +3 -1
|
@@ -706,12 +706,13 @@ class RPC extends _utils__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
|
|
|
706
706
|
|
|
707
707
|
_extract_service_info(service) {
|
|
708
708
|
const config = service.config || {};
|
|
709
|
-
config.workspace =
|
|
709
|
+
config.workspace =
|
|
710
|
+
config.workspace || this._local_workspace || this._connection.workspace;
|
|
710
711
|
const skipContext = config.require_context;
|
|
711
712
|
const serviceSchema = _get_schema(service, null, skipContext);
|
|
712
713
|
const serviceInfo = {
|
|
713
714
|
config: config,
|
|
714
|
-
id: `${this._client_id}:${service["id"]}`,
|
|
715
|
+
id: `${config.workspace}/${this._client_id}:${service["id"]}`,
|
|
715
716
|
name: service.name || service["id"],
|
|
716
717
|
description: service.description || "",
|
|
717
718
|
type: service.type || "generic",
|
|
@@ -4864,18 +4865,14 @@ async function connectToServer(config) {
|
|
|
4864
4865
|
async function getApp(clientId) {
|
|
4865
4866
|
clientId = clientId || "*";
|
|
4866
4867
|
(0,_utils__WEBPACK_IMPORTED_MODULE_1__.assert)(!clientId.includes(":"), "clientId should not contain ':'");
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
[workspace, clientId] = clientId.split("/");
|
|
4870
|
-
} else {
|
|
4871
|
-
workspace = connection_info.workspace;
|
|
4868
|
+
if (!clientId.includes("/")) {
|
|
4869
|
+
clientId = connection_info.workspace + "/" + clientId;
|
|
4872
4870
|
}
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
};
|
|
4878
|
-
return await wm.getService(query);
|
|
4871
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_1__.assert)(
|
|
4872
|
+
clientId.split("/").length === 2,
|
|
4873
|
+
"clientId should match pattern workspace/clientId",
|
|
4874
|
+
);
|
|
4875
|
+
return await wm.getService(`${clientId}:default`);
|
|
4879
4876
|
}
|
|
4880
4877
|
|
|
4881
4878
|
async function listApps(ws) {
|