oorja 2.0.1 → 2.0.3

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.
@@ -1,5 +1,5 @@
1
1
  import { URL } from 'url';
2
- export declare const CLI_VERSION = 2;
2
+ export declare const CLI_VERSION = 2.1;
3
3
  import Conf from 'conf';
4
4
  export declare const config: Conf<string>;
5
5
  export type env = 'local' | 'prod';
@@ -1,5 +1,5 @@
1
1
  import chalk from 'chalk';
2
- export const CLI_VERSION = 2.0;
2
+ export const CLI_VERSION = 2.1;
3
3
  import Conf from 'conf';
4
4
  export const config = new Conf({
5
5
  projectName: 'oorja',
@@ -1,7 +1,9 @@
1
1
  // backend api client
2
2
  import https from 'https';
3
3
  import axios, { AxiosError } from 'axios';
4
- import { encode, decode } from '@msgpack/msgpack';
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
- let encodeMessage = (rawdata, callback) => {
100
- if (!rawdata)
101
- return;
102
- return callback(encode(rawdata));
101
+ const encodeMessage = function (rawdata, callback) {
102
+ return callback(encoder.encode(rawdata));
103
103
  };
104
- let decodeMessage = (rawdata, callback) => {
105
- if (!rawdata)
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: 10000,
114
+ heartbeatIntervalMs: 20_000,
118
115
  binaryType: 'arraybuffer',
119
116
  encode: encodeMessage,
120
117
  decode: decodeMessage,
@@ -22,4 +22,5 @@ export const resizeBestFit = (term, userDimensions) => {
22
22
  const minrows = Math.min(...allViewports.map((d) => d.rows));
23
23
  const mincols = Math.min(...allViewports.map((d) => d.cols));
24
24
  term.resize(mincols, minrows);
25
+ term.write("\x0c"); // clear screen
25
26
  };
@@ -85,5 +85,5 @@
85
85
  ]
86
86
  }
87
87
  },
88
- "version": "2.0.1"
88
+ "version": "2.0.3"
89
89
  }
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.1",
4
+ "version": "2.0.3",
5
5
  "keywords": [
6
6
  "teletype",
7
7
  "terminal",
@@ -45,7 +45,7 @@
45
45
  ]
46
46
  },
47
47
  "dependencies": {
48
- "@msgpack/msgpack": "^2.8.0",
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",