hypha-rpc 0.20.98 → 0.21.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/dist/hypha-rpc-websocket.js +6 -202
- package/dist/hypha-rpc-websocket.js.map +1 -0
- package/dist/hypha-rpc-websocket.min.js +1 -1
- package/dist/hypha-rpc-websocket.min.js.map +1 -0
- package/dist/hypha-rpc-websocket.min.mjs +1 -1
- package/dist/hypha-rpc-websocket.min.mjs.map +1 -0
- package/dist/hypha-rpc-websocket.mjs +6 -178
- package/dist/hypha-rpc-websocket.mjs.map +1 -0
- package/package.json +1 -1
- package/src/http-client.js +2 -3
- package/src/rpc.js +1 -1
- package/src/utils/index.js +1 -1
- package/dist/116.hypha-rpc-websocket.min.js +0 -1
- package/dist/116.hypha-rpc-websocket.min.mjs +0 -1
- package/dist/node_modules_msgpack_msgpack_dist_es5_esm_index_mjs.hypha-rpc-websocket.js +0 -273
- package/dist/node_modules_msgpack_msgpack_dist_es5_esm_index_mjs.hypha-rpc-websocket.mjs +0 -272
|
@@ -29,7 +29,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29
29
|
/* harmony import */ var _rpc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rpc.js */ "./src/rpc.js");
|
|
30
30
|
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/index.js */ "./src/utils/index.js");
|
|
31
31
|
/* harmony import */ var _utils_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/schema.js */ "./src/utils/schema.js");
|
|
32
|
-
/* harmony import */ var _msgpack_msgpack__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @msgpack/msgpack */ "./node_modules/@msgpack/msgpack/dist.es5+esm/
|
|
32
|
+
/* harmony import */ var _msgpack_msgpack__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @msgpack/msgpack */ "./node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs");
|
|
33
|
+
/* harmony import */ var _msgpack_msgpack__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @msgpack/msgpack */ "./node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs");
|
|
33
34
|
/**
|
|
34
35
|
* HTTP Streaming RPC Client for Hypha.
|
|
35
36
|
*
|
|
@@ -279,8 +280,7 @@ class HTTPStreamingRPCConnection {
|
|
|
279
280
|
try {
|
|
280
281
|
const ws = this._workspace || "public";
|
|
281
282
|
const url = `${this._server_url}/${ws}/rpc?client_id=${this._client_id}`;
|
|
282
|
-
const
|
|
283
|
-
const body = encode({ type: "refresh_token" });
|
|
283
|
+
const body = (0,_msgpack_msgpack__WEBPACK_IMPORTED_MODULE_3__.encode)({ type: "refresh_token" });
|
|
284
284
|
const response = await fetch(url, {
|
|
285
285
|
method: "POST",
|
|
286
286
|
headers: this._get_headers(false),
|
|
@@ -387,7 +387,7 @@ class HTTPStreamingRPCConnection {
|
|
|
387
387
|
_tryDecodeControlMessage(frame_data) {
|
|
388
388
|
try {
|
|
389
389
|
// Decode the first msgpack object in the frame
|
|
390
|
-
const decoded = (0,
|
|
390
|
+
const decoded = (0,_msgpack_msgpack__WEBPACK_IMPORTED_MODULE_4__.decode)(frame_data);
|
|
391
391
|
|
|
392
392
|
// Control messages are simple objects with a "type" field
|
|
393
393
|
if (typeof decoded === "object" && decoded !== null && decoded.type) {
|
|
@@ -1777,7 +1777,7 @@ class RPC extends _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
|
|
|
1777
1777
|
if (session.heartbeat_task) {
|
|
1778
1778
|
try { clearInterval(session.heartbeat_task); } catch (e) { /* ignore */ }
|
|
1779
1779
|
}
|
|
1780
|
-
if (session.timer && typeof session.timer.clear === "function") {
|
|
1780
|
+
if (session.timer && session.timer.started && typeof session.timer.clear === "function") {
|
|
1781
1781
|
try { session.timer.clear(); } catch (e) { /* ignore */ }
|
|
1782
1782
|
}
|
|
1783
1783
|
}
|
|
@@ -4148,7 +4148,7 @@ async function loadRequirementsInWindow(requirements) {
|
|
|
4148
4148
|
if (requirements[i].startsWith("mjs:")) {
|
|
4149
4149
|
requirements[i] = requirements[i].slice(4);
|
|
4150
4150
|
}
|
|
4151
|
-
await
|
|
4151
|
+
await new Function("url", "return import(url)")(requirements[i]);
|
|
4152
4152
|
} else if (
|
|
4153
4153
|
requirements[i].toLowerCase().endsWith(".js") ||
|
|
4154
4154
|
requirements[i].startsWith("js:")
|
|
@@ -6884,9 +6884,6 @@ function utf8DecodeTD(bytes, inputOffset, byteLength) {
|
|
|
6884
6884
|
/******/ return module.exports;
|
|
6885
6885
|
/******/ }
|
|
6886
6886
|
/******/
|
|
6887
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
6888
|
-
/******/ __webpack_require__.m = __webpack_modules__;
|
|
6889
|
-
/******/
|
|
6890
6887
|
/************************************************************************/
|
|
6891
6888
|
/******/ /* webpack/runtime/define property getters */
|
|
6892
6889
|
/******/ (() => {
|
|
@@ -6900,91 +6897,11 @@ function utf8DecodeTD(bytes, inputOffset, byteLength) {
|
|
|
6900
6897
|
/******/ };
|
|
6901
6898
|
/******/ })();
|
|
6902
6899
|
/******/
|
|
6903
|
-
/******/ /* webpack/runtime/ensure chunk */
|
|
6904
|
-
/******/ (() => {
|
|
6905
|
-
/******/ __webpack_require__.f = {};
|
|
6906
|
-
/******/ // This file contains only the entry chunk.
|
|
6907
|
-
/******/ // The chunk loading function for additional chunks
|
|
6908
|
-
/******/ __webpack_require__.e = (chunkId) => {
|
|
6909
|
-
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
6910
|
-
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
6911
|
-
/******/ return promises;
|
|
6912
|
-
/******/ }, []));
|
|
6913
|
-
/******/ };
|
|
6914
|
-
/******/ })();
|
|
6915
|
-
/******/
|
|
6916
|
-
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
6917
|
-
/******/ (() => {
|
|
6918
|
-
/******/ // This function allow to reference async chunks
|
|
6919
|
-
/******/ __webpack_require__.u = (chunkId) => {
|
|
6920
|
-
/******/ // return url for filenames based on template
|
|
6921
|
-
/******/ return "" + chunkId + ".hypha-rpc-websocket.js";
|
|
6922
|
-
/******/ };
|
|
6923
|
-
/******/ })();
|
|
6924
|
-
/******/
|
|
6925
|
-
/******/ /* webpack/runtime/global */
|
|
6926
|
-
/******/ (() => {
|
|
6927
|
-
/******/ __webpack_require__.g = (function() {
|
|
6928
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
6929
|
-
/******/ try {
|
|
6930
|
-
/******/ return this || new Function('return this')();
|
|
6931
|
-
/******/ } catch (e) {
|
|
6932
|
-
/******/ if (typeof window === 'object') return window;
|
|
6933
|
-
/******/ }
|
|
6934
|
-
/******/ })();
|
|
6935
|
-
/******/ })();
|
|
6936
|
-
/******/
|
|
6937
6900
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
6938
6901
|
/******/ (() => {
|
|
6939
6902
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
6940
6903
|
/******/ })();
|
|
6941
6904
|
/******/
|
|
6942
|
-
/******/ /* webpack/runtime/load script */
|
|
6943
|
-
/******/ (() => {
|
|
6944
|
-
/******/ var inProgress = {};
|
|
6945
|
-
/******/ var dataWebpackPrefix = "hyphaWebsocketClient:";
|
|
6946
|
-
/******/ // loadScript function to load a script via script tag
|
|
6947
|
-
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
6948
|
-
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
6949
|
-
/******/ var script, needAttach;
|
|
6950
|
-
/******/ if(key !== undefined) {
|
|
6951
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
6952
|
-
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
6953
|
-
/******/ var s = scripts[i];
|
|
6954
|
-
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
6955
|
-
/******/ }
|
|
6956
|
-
/******/ }
|
|
6957
|
-
/******/ if(!script) {
|
|
6958
|
-
/******/ needAttach = true;
|
|
6959
|
-
/******/ script = document.createElement('script');
|
|
6960
|
-
/******/
|
|
6961
|
-
/******/ script.charset = 'utf-8';
|
|
6962
|
-
/******/ script.timeout = 120;
|
|
6963
|
-
/******/ if (__webpack_require__.nc) {
|
|
6964
|
-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
6965
|
-
/******/ }
|
|
6966
|
-
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
6967
|
-
/******/
|
|
6968
|
-
/******/ script.src = url;
|
|
6969
|
-
/******/ }
|
|
6970
|
-
/******/ inProgress[url] = [done];
|
|
6971
|
-
/******/ var onScriptComplete = (prev, event) => {
|
|
6972
|
-
/******/ // avoid mem leaks in IE.
|
|
6973
|
-
/******/ script.onerror = script.onload = null;
|
|
6974
|
-
/******/ clearTimeout(timeout);
|
|
6975
|
-
/******/ var doneFns = inProgress[url];
|
|
6976
|
-
/******/ delete inProgress[url];
|
|
6977
|
-
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
6978
|
-
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
6979
|
-
/******/ if(prev) return prev(event);
|
|
6980
|
-
/******/ }
|
|
6981
|
-
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
6982
|
-
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
6983
|
-
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
6984
|
-
/******/ needAttach && document.head.appendChild(script);
|
|
6985
|
-
/******/ };
|
|
6986
|
-
/******/ })();
|
|
6987
|
-
/******/
|
|
6988
6905
|
/******/ /* webpack/runtime/make namespace object */
|
|
6989
6906
|
/******/ (() => {
|
|
6990
6907
|
/******/ // define __esModule on exports
|
|
@@ -6996,119 +6913,6 @@ function utf8DecodeTD(bytes, inputOffset, byteLength) {
|
|
|
6996
6913
|
/******/ };
|
|
6997
6914
|
/******/ })();
|
|
6998
6915
|
/******/
|
|
6999
|
-
/******/ /* webpack/runtime/publicPath */
|
|
7000
|
-
/******/ (() => {
|
|
7001
|
-
/******/ var scriptUrl;
|
|
7002
|
-
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
7003
|
-
/******/ var document = __webpack_require__.g.document;
|
|
7004
|
-
/******/ if (!scriptUrl && document) {
|
|
7005
|
-
/******/ if (document.currentScript)
|
|
7006
|
-
/******/ scriptUrl = document.currentScript.src;
|
|
7007
|
-
/******/ if (!scriptUrl) {
|
|
7008
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
7009
|
-
/******/ if(scripts.length) {
|
|
7010
|
-
/******/ var i = scripts.length - 1;
|
|
7011
|
-
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
|
|
7012
|
-
/******/ }
|
|
7013
|
-
/******/ }
|
|
7014
|
-
/******/ }
|
|
7015
|
-
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
7016
|
-
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
7017
|
-
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
7018
|
-
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
7019
|
-
/******/ __webpack_require__.p = scriptUrl;
|
|
7020
|
-
/******/ })();
|
|
7021
|
-
/******/
|
|
7022
|
-
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
7023
|
-
/******/ (() => {
|
|
7024
|
-
/******/ // no baseURI
|
|
7025
|
-
/******/
|
|
7026
|
-
/******/ // object to store loaded and loading chunks
|
|
7027
|
-
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
7028
|
-
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
7029
|
-
/******/ var installedChunks = {
|
|
7030
|
-
/******/ "hyphaWebsocketClient": 0
|
|
7031
|
-
/******/ };
|
|
7032
|
-
/******/
|
|
7033
|
-
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
7034
|
-
/******/ // JSONP chunk loading for javascript
|
|
7035
|
-
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
7036
|
-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
7037
|
-
/******/
|
|
7038
|
-
/******/ // a Promise means "currently loading".
|
|
7039
|
-
/******/ if(installedChunkData) {
|
|
7040
|
-
/******/ promises.push(installedChunkData[2]);
|
|
7041
|
-
/******/ } else {
|
|
7042
|
-
/******/ if(true) { // all chunks have JS
|
|
7043
|
-
/******/ // setup Promise in chunk cache
|
|
7044
|
-
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
7045
|
-
/******/ promises.push(installedChunkData[2] = promise);
|
|
7046
|
-
/******/
|
|
7047
|
-
/******/ // start chunk loading
|
|
7048
|
-
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
7049
|
-
/******/ // create error before stack unwound to get useful stacktrace later
|
|
7050
|
-
/******/ var error = new Error();
|
|
7051
|
-
/******/ var loadingEnded = (event) => {
|
|
7052
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
7053
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
7054
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
7055
|
-
/******/ if(installedChunkData) {
|
|
7056
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
7057
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
7058
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
7059
|
-
/******/ error.name = 'ChunkLoadError';
|
|
7060
|
-
/******/ error.type = errorType;
|
|
7061
|
-
/******/ error.request = realSrc;
|
|
7062
|
-
/******/ installedChunkData[1](error);
|
|
7063
|
-
/******/ }
|
|
7064
|
-
/******/ }
|
|
7065
|
-
/******/ };
|
|
7066
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
7067
|
-
/******/ }
|
|
7068
|
-
/******/ }
|
|
7069
|
-
/******/ }
|
|
7070
|
-
/******/ };
|
|
7071
|
-
/******/
|
|
7072
|
-
/******/ // no prefetching
|
|
7073
|
-
/******/
|
|
7074
|
-
/******/ // no preloaded
|
|
7075
|
-
/******/
|
|
7076
|
-
/******/ // no HMR
|
|
7077
|
-
/******/
|
|
7078
|
-
/******/ // no HMR manifest
|
|
7079
|
-
/******/
|
|
7080
|
-
/******/ // no on chunks loaded
|
|
7081
|
-
/******/
|
|
7082
|
-
/******/ // install a JSONP callback for chunk loading
|
|
7083
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
7084
|
-
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
7085
|
-
/******/ // add "moreModules" to the modules object,
|
|
7086
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
7087
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
7088
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
7089
|
-
/******/ for(moduleId in moreModules) {
|
|
7090
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
7091
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
7092
|
-
/******/ }
|
|
7093
|
-
/******/ }
|
|
7094
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
7095
|
-
/******/ }
|
|
7096
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
7097
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
7098
|
-
/******/ chunkId = chunkIds[i];
|
|
7099
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
7100
|
-
/******/ installedChunks[chunkId][0]();
|
|
7101
|
-
/******/ }
|
|
7102
|
-
/******/ installedChunks[chunkId] = 0;
|
|
7103
|
-
/******/ }
|
|
7104
|
-
/******/
|
|
7105
|
-
/******/ }
|
|
7106
|
-
/******/
|
|
7107
|
-
/******/ var chunkLoadingGlobal = this["webpackChunkhyphaWebsocketClient"] = this["webpackChunkhyphaWebsocketClient"] || [];
|
|
7108
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
7109
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
7110
|
-
/******/ })();
|
|
7111
|
-
/******/
|
|
7112
6916
|
/************************************************************************/
|
|
7113
6917
|
var __webpack_exports__ = {};
|
|
7114
6918
|
/*!*********************************!*\
|