Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
857 changes: 378 additions & 479 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
"ws": "^8.2.1"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/eslint-scope": "^9.1.0",
"@types/jest": "^30.0.0",
"@types/md5": "^2.1.33",
"@types/node": "^25.0.1",
"@types/ws": "^8.2.0",
"babel-loader": "^10.0.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^9.25.1",
"eslint": "^10.1.0",
"eslint-config-prettier": "^10.1.2",
"filereader": "^0.10.3",
"jest": "^30.0.0",
Expand Down
1 change: 0 additions & 1 deletion src/core/AMTDesktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export class AMTDesktop extends Desktop {
this.onKvmDataPending = []
this.onKvmDataAck = -1
this.kvmDataSupported = false
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
for (const i in this.sparecache) {
delete this.sparecache[i]
}
Expand Down
3 changes: 0 additions & 3 deletions src/core/AMTIDER.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export class AMTIDER {
this.acc += data
console.debug(`IDER-ProcessData: ${this.acc.length}, ${TypeConverter.rstr2hex(this.acc)}`)
// Process as many commands as possible
// eslint-disable-next-line no-constant-condition
while (true) {
// checks if the received data contains at least 8 bytes in the header.
// If not, it returns 0, indicating that there is not enough data to process.
Expand Down Expand Up @@ -407,12 +406,10 @@ export class AMTIDER {
}
if (fr.readAsBinaryString != null) {
if (this.g_media != null) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
fr.readAsBinaryString(this.g_media.slice(lba, lba + len))
}
} else {
if (this.g_media != null) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
fr.readAsArrayBuffer(this.g_media.slice(lba, lba + len))
}
}
Expand Down
1 change: 0 additions & 1 deletion src/core/AMTKvmDataRedirector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { type IKvmDataCommunicator } from './Interfaces'

export class AMTKvmDataRedirector extends AMTRedirector implements IKvmDataCommunicator {
onSendKvmData: (data: string) => void
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor(config: RedirectorConfig) {
super(config)
}
Expand Down
6 changes: 1 addition & 5 deletions src/core/AMTRedirector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export class AMTRedirector implements ICommunicator {
// Using this generic signature allows us to pass the WebSocket type from unit tests or in production from a web browser
this.connectState = 0
// let ws = new c(this.getWsLocation()) // using create function c invokes the constructor WebSocket()
// eslint-disable-next-line new-cap
this.socket = new c(this.getWsLocation(), this.authToken) // The "p=2" indicates to the relay that this is a REDIRECTION session
this.socket.onopen = this.onSocketConnected.bind(this)
this.socket.onmessage = this.onMessage.bind(this)
Expand Down Expand Up @@ -342,15 +341,13 @@ export class AMTRedirector implements ICommunicator {
curptr += noncelen + 1

// QOP
let qoplen = 0
let qop = ''
const cnonce: string = this.generateRandomNonce(32)
const snc = '00000002'
let extra = ''
if (authType === 4) {
qoplen = authDataBuf.charCodeAt(curptr)
const qoplen = authDataBuf.charCodeAt(curptr)
qop = authDataBuf.substring(curptr + 1, curptr + 1 + qoplen)
curptr += qoplen + 1
extra = `${snc}:${cnonce}:${String(qop)} :`
}

Expand Down Expand Up @@ -435,7 +432,6 @@ export class AMTRedirector implements ICommunicator {
TypeConverter.IntToStrX(this.amtSequence++) +
String.fromCharCode(0x00, 0x00, 0x1b, 0x00, 0x00, 0x00)
)
// eslint-disable-next-line @typescript-eslint/no-implied-eval, @typescript-eslint/no-unsafe-argument
if (this.protocol === 1) {
this.amtKeepAliveTimer = setInterval(this.sendAmtKeepAlive.bind(this), 2000)
}
Expand Down
5 changes: 1 addition & 4 deletions src/core/Converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const TypeConverter = {
let r = ''
if (x !== 0 && (!isTruthy(x) || x == null)) return '(Null)'
if (x instanceof Array) {
// eslint-disable-next-line @typescript-eslint/no-for-in-array
for (const i in x) {
r =
r + '<br />' + String(this.gap(c)) + 'Item #' + String(i) + ': ' + String(this.ObjectToStringEx(x[i], c + 1))
Expand All @@ -101,7 +100,6 @@ export const TypeConverter = {
return '(Null)'
}
if (x instanceof Array) {
// eslint-disable-next-line @typescript-eslint/no-for-in-array
for (const i in x) {
r =
r + '\r\n' + String(this.gap2(c)) + 'Item #' + String(i) + ': ' + String(this.ObjectToStringEx2(x[i], c + 1))
Expand Down Expand Up @@ -150,8 +148,7 @@ export const TypeConverter = {
// Convert a raw string to a hex string
rstr2hex(input: string): string {
let r = ''
let i = 0
for (i = 0; i < input.length; i++) {
for (let i = 0; i < input.length; i++) {
r = r + String(this.char2hex(input.charCodeAt(i)))
}
return r
Expand Down
4 changes: 2 additions & 2 deletions src/core/IDERDataProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ export class IDERDataProcessor {
console.debug('SCSI: MODE_SENSE_6', dev)

if (cdb.charCodeAt(2) === 0x3f && cdb.charCodeAt(3) === 0x00) {
let a = 0
let b = 0
let a: number
let b: number
switch (dev) {
case 0xa0: // DEV_FLOPPY
if (this.ider.floppy == null) {
Expand Down
3 changes: 1 addition & 2 deletions src/core/ImageData/DataProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class DataProcessor implements IDataProcessor {
parent: Desktop
constructor(comm: ICommunicator, parent: Desktop) {
this.acc = ''
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
this.stateProcessorFac = new StateProcessorFactory(comm, parent, this.updateRFBState.bind(this))
this.parent = parent
}
Expand All @@ -32,7 +31,7 @@ export class DataProcessor implements IDataProcessor {
processData(data: string): any {
if (!isTruthy(data)) return
this.acc += data
let cmdSize = 0
let cmdSize: number
console.debug(`Process Data ACC length: ${this.acc.length}`)
while (this.acc.length > 0) {
const stateProcessor: IStateProcessor = this.stateProcessorFac.getProcessor(this.parent.state)
Expand Down
4 changes: 2 additions & 2 deletions src/core/ImageData/RLEDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class RLEDecoder implements IRLEDecoder {
let runlengthdecode
const palette: number[] = []
let rlecount = 0
let runlength = 0
let runlength: number
let i: number
// this.parent.Debug("RECT RLE (" + (datalen - 5) + ", " + subencoding + "):" + rstr2hex(data.substring(21, 21 + (datalen - 5))));
if (subencoding === 0) {
Expand All @@ -45,7 +45,7 @@ class RLEDecoder implements IRLEDecoder {
ImageHelper.putImage(this.parent, x, y)
} else if (subencoding === 1) {
// Solid color tile
v = data.charCodeAt(ptr++) + (this.parent.bpp === 2 ? data.charCodeAt(ptr++) << 8 : 0)
v = data.charCodeAt(ptr++) + (this.parent.bpp === 2 ? data.charCodeAt(ptr) << 8 : 0)
this.parent.canvasCtx.fillStyle =
'rgb(' +
(this.parent.bpp === 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FrameBufferBellServerCutText implements IStateProcessor {
processState(acc: string): number {
// acc is the accumulated byte encoded string so far
let cmdsize = 0
let len = 0
let len: number
switch (acc.charCodeAt(0)) {
case 0: // FramebufferUpdate
if (acc.length < 4) return 0
Expand Down
2 changes: 1 addition & 1 deletion src/core/RFBStateProcessors/HandshakeState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HandshakeState implements IStateProcessor {

processState(acc: string): number {
// acc is the accumulated byte encoded string so far
let cmdSize = 0
let cmdSize: number
if (acc.length >= 12) {
// Getting handshake & version
cmdSize = 12
Expand Down
2 changes: 1 addition & 1 deletion src/core/RFBStateProcessors/SecurityOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SecurityOptions implements IStateProcessor {

processState(acc: string): number {
// acc is the accumulated byte encoded string so far
let cmdSize = 0
let cmdSize: number
if (acc.length >= 1) {
// Getting security options
cmdSize = acc.charCodeAt(0) + 1
Expand Down
2 changes: 1 addition & 1 deletion src/core/RFBStateProcessors/SecurityResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SecurityResponse implements IStateProcessor {

processState(acc: string): number {
// acc is the accumulated byte encoded string so far
let cmdSize = 0
let cmdSize: number
if (acc.length >= 4) {
// Getting security response
cmdSize = 4
Expand Down
2 changes: 1 addition & 1 deletion src/core/RFBStateProcessors/ServerInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ServerInit implements IStateProcessor {

processState(acc: string): number {
// acc is the accumulated byte encoded string so far
let cmdSize = 0
let cmdSize: number
if (acc.length >= 24) {
// Getting server init

Expand Down
1 change: 0 additions & 1 deletion src/core/Utilities/AMTKeyCodeConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { isTruthy } from './UtilityMethods'
*/
export const AMTKeyCodeConverter = {
convertAMTKeyCode(e: any): any {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
if (isTruthy(e.code.startsWith('Key')) && e.code.length === 4) {
return e.code.charCodeAt(3) + (e.shiftKey === false ? 32 : 0)
}
Expand Down
1 change: 0 additions & 1 deletion src/test/helper/testAmtDesktop2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ class AmtDesktop2 extends Desktop {
this.onKvmDataPending = []
this.onKvmDataAck = -1
this.kvmDataSupported = false
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
for (const i in this.sparecache) {
delete this.sparecache[i]
}
Expand Down
1 change: 0 additions & 1 deletion src/test/kvmui.test.ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class AmtDesktop extends Desktop {
this.onKvmDataPending = []
this.onKvmDataAck = -1
this.kvmDataSupported = false
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
for (const i in this.sparecache) {
delete this.sparecache[i]
}
Expand Down
Loading