oorja 2.0.1 → 2.0.2
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/lib/config.d.ts +1 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/connect/index.js +8 -11
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
package/dist/lib/config.d.ts
CHANGED
package/dist/lib/config.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// backend api client
|
|
2
2
|
import https from 'https';
|
|
3
3
|
import axios, { AxiosError } from 'axios';
|
|
4
|
-
import {
|
|
4
|
+
import { Encoder, Decoder } from "@msgpack/msgpack";
|
|
5
|
+
const encoder = new Encoder({ ignoreUndefined: true });
|
|
6
|
+
const decoder = new Decoder();
|
|
5
7
|
import { defaultParser } from './resources.js';
|
|
6
8
|
import { getConnectConfig } from '../config.js';
|
|
7
9
|
import { Unauthorized, BadRequest } from './errors.js';
|
|
@@ -96,16 +98,11 @@ export class ConnectClient {
|
|
|
96
98
|
establishSocket = async () => {
|
|
97
99
|
const protocolPrefix = `wss://`;
|
|
98
100
|
const host = this.config.host;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return;
|
|
102
|
-
return callback(encode(rawdata));
|
|
101
|
+
const encodeMessage = function (rawdata, callback) {
|
|
102
|
+
return callback(encoder.encode(rawdata));
|
|
103
103
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return;
|
|
107
|
-
const data = new Uint8Array(rawdata);
|
|
108
|
-
return callback(decode(data.buffer));
|
|
104
|
+
const decodeMessage = function (rawdata, callback) {
|
|
105
|
+
return callback(decoder.decode(rawdata));
|
|
109
106
|
};
|
|
110
107
|
return new Promise((resolve, reject) => {
|
|
111
108
|
let initialConnection = false;
|
|
@@ -114,7 +111,7 @@ export class ConnectClient {
|
|
|
114
111
|
access_token: this.config.token,
|
|
115
112
|
},
|
|
116
113
|
transport: WebSocket,
|
|
117
|
-
heartbeatIntervalMs:
|
|
114
|
+
heartbeatIntervalMs: 20_000,
|
|
118
115
|
binaryType: 'arraybuffer',
|
|
119
116
|
encode: encodeMessage,
|
|
120
117
|
decode: decodeMessage,
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oorja",
|
|
3
3
|
"description": "stream terminals to the web and more.",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"teletype",
|
|
7
7
|
"terminal",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@msgpack/msgpack": "
|
|
48
|
+
"@msgpack/msgpack": "3.0.0-beta2",
|
|
49
49
|
"@oclif/core": "^4.2.0",
|
|
50
50
|
"@oclif/plugin-help": "^6.2.20",
|
|
51
51
|
"axios": "^1.7.9",
|