Skip to content
Snippets Groups Projects
Unverified Commit bc88ffa9 authored by Tasso Evangelista's avatar Tasso Evangelista Committed by GitHub
Browse files

chore(deps): Upgrade TypeScript (#34064)

parent fd44a8b2
No related branches found
No related tags found
No related merge requests found
Showing
with 40 additions and 38 deletions
import type { X25519SecretKey, CryptographyKey } from 'sodium-plus'; import type { X25519SecretKey, CryptographyKey } from 'sodium-plus';
import { SodiumPlus, X25519PublicKey } from 'sodium-plus'; import { SodiumPlus, X25519PublicKey } from 'sodium-plus';
let sodium: SodiumPlus;
export class Session { export class Session {
// Encoding for the key exchange, no requirements to be small // Encoding for the key exchange, no requirements to be small
protected readonly stringFormatKey: BufferEncoding = 'base64'; protected readonly stringFormatKey: BufferEncoding = 'base64';
...@@ -21,8 +19,14 @@ export class Session { ...@@ -21,8 +19,14 @@ export class Session {
public publicKey: X25519PublicKey; public publicKey: X25519PublicKey;
private static sodium: SodiumPlus | undefined;
async sodium(): Promise<SodiumPlus> { async sodium(): Promise<SodiumPlus> {
return sodium || SodiumPlus.auto(); if (!Session.sodium) {
Session.sodium = await SodiumPlus.auto();
}
return Session.sodium;
} }
get publicKeyString(): string { get publicKeyString(): string {
......
...@@ -149,7 +149,7 @@ export async function setUserAvatar( ...@@ -149,7 +149,7 @@ export async function setUserAvatar(
} }
return { return {
buffer: dataURI instanceof Buffer ? dataURI : Buffer.from(dataURI, 'binary'), buffer: typeof dataURI === 'string' ? Buffer.from(dataURI, 'binary') : dataURI,
type: contentType, type: contentType,
}; };
} }
......
function ab2str(buf: ArrayBuffer): string { function ab2str(buf: ArrayLike<number> | ArrayBuffer): string {
return String.fromCharCode(...new Uint16Array(buf)); return String.fromCharCode(...new Uint16Array(buf));
} }
......
...@@ -398,7 +398,7 @@ export class SAMLUtils { ...@@ -398,7 +398,7 @@ export class SAMLUtils {
return mainValue; return mainValue;
} }
public static convertArrayBufferToString(buffer: ArrayBuffer, encoding: BufferEncoding = 'utf8'): string { public static convertArrayBufferToString(buffer: Buffer<ArrayBufferLike>, encoding: BufferEncoding = 'utf8'): string {
return Buffer.from(buffer).toString(encoding); return Buffer.from(buffer).toString(encoding);
} }
......
...@@ -57,13 +57,11 @@ const SaveToWebdavModal = ({ onClose, data }: SaveToWebdavModalProps): ReactElem ...@@ -57,13 +57,11 @@ const SaveToWebdavModal = ({ onClose, data }: SaveToWebdavModalProps): ReactElem
fileRequest.current.onload = async (): Promise<void> => { fileRequest.current.onload = async (): Promise<void> => {
const arrayBuffer = fileRequest.current?.response; const arrayBuffer = fileRequest.current?.response;
if (arrayBuffer) { if (arrayBuffer) {
const fileData = new Uint8Array(arrayBuffer);
try { try {
if (!title) { if (!title) {
throw new Error('File name is required'); throw new Error('File name is required');
} }
const response = await uploadFileToWebdav(accountId, fileData, title); const response = await uploadFileToWebdav(accountId, arrayBuffer, title);
if (!response.success) { if (!response.success) {
throw new Error(response.message ? t(response.message) : 'Error uploading file'); throw new Error(response.message ? t(response.message) : 'Error uploading file');
} }
......
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
"@types/ejson": "^2.2.2", "@types/ejson": "^2.2.2",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"@types/fibers": "^3.1.4", "@types/fibers": "^3.1.4",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"@types/ws": "^8.5.13", "@types/ws": "^8.5.13",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"pino-pretty": "^7.6.1", "pino-pretty": "^7.6.1",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"volta": { "volta": {
"extends": "../../../package.json" "extends": "../../../package.json"
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
"@types/meteor-collection-hooks": "^0.8.9", "@types/meteor-collection-hooks": "^0.8.9",
"@types/mkdirp": "^1.0.2", "@types/mkdirp": "^1.0.2",
"@types/mocha": "github:whitecolor/mocha-types", "@types/mocha": "github:whitecolor/mocha-types",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"@types/node-gcm": "^1.0.5", "@types/node-gcm": "^1.0.5",
"@types/node-rsa": "^1.1.4", "@types/node-rsa": "^1.1.4",
"@types/nodemailer": "^6.4.16", "@types/nodemailer": "^6.4.16",
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
"supports-color": "~7.2.0", "supports-color": "~7.2.0",
"template-file": "^6.0.1", "template-file": "^6.0.1",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "~7.26.0", "@babel/runtime": "~7.26.0",
...@@ -433,7 +433,7 @@ ...@@ -433,7 +433,7 @@
"tinykeys": "^1.4.0", "tinykeys": "^1.4.0",
"twilio": "^3.84.1", "twilio": "^3.84.1",
"twit": "^2.2.11", "twit": "^2.2.11",
"typia": "~6.11.4", "typia": "~6.12.2",
"ua-parser-js": "^1.0.39", "ua-parser-js": "^1.0.39",
"underscore": "^1.13.7", "underscore": "^1.13.7",
"universal-perf-hooks": "^1.0.1", "universal-perf-hooks": "^1.0.1",
......
...@@ -291,11 +291,11 @@ export class LDAPConnection { ...@@ -291,11 +291,11 @@ export class LDAPConnection {
return value.map((item) => this.extractLdapAttribute(item)); return value.map((item) => this.extractLdapAttribute(item));
} }
if (value instanceof Buffer) { if (typeof value === 'string') {
return value.toString(); return value;
} }
return value; return value.toString();
} }
public extractLdapEntryData(entry: ldapjs.SearchEntry): ILDAPEntry { public extractLdapEntryData(entry: ldapjs.SearchEntry): ILDAPEntry {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
"eslint": "~8.45.0", "eslint": "~8.45.0",
"eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14", "eslint-plugin-react-refresh": "^0.4.14",
"typescript": "~5.6.3", "typescript": "~5.7.2",
"vite": "^5.4.11" "vite": "^5.4.11"
}, },
"volta": { "volta": {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"@rocket.chat/string-helpers": "~0.31.25", "@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tools": "workspace:^", "@rocket.chat/tools": "workspace:^",
"@rocket.chat/tracing": "workspace:^", "@rocket.chat/tracing": "workspace:^",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"bcrypt": "^5.1.1", "bcrypt": "^5.1.1",
"ejson": "^2.2.3", "ejson": "^2.2.3",
"event-loop-stats": "^1.4.1", "event-loop-stats": "^1.4.1",
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
"@types/polka": "^0.5.7", "@types/polka": "^0.5.7",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"main": "./dist/ee/apps/account-service/src/service.js", "main": "./dist/ee/apps/account-service/src/service.js",
"files": [ "files": [
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"@rocket.chat/rest-typings": "workspace:^", "@rocket.chat/rest-typings": "workspace:^",
"@rocket.chat/string-helpers": "~0.31.25", "@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tracing": "workspace:^", "@rocket.chat/tracing": "workspace:^",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"ejson": "^2.2.3", "ejson": "^2.2.3",
"event-loop-stats": "^1.4.1", "event-loop-stats": "^1.4.1",
"eventemitter3": "^5.0.1", "eventemitter3": "^5.0.1",
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
"@types/polka": "^0.5.7", "@types/polka": "^0.5.7",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"main": "./dist/ee/apps/authorization-service/src/service.js", "main": "./dist/ee/apps/authorization-service/src/service.js",
"files": [ "files": [
......
...@@ -50,14 +50,14 @@ ...@@ -50,14 +50,14 @@
"@types/ejson": "^2.2.2", "@types/ejson": "^2.2.2",
"@types/gc-stats": "^1.4.3", "@types/gc-stats": "^1.4.3",
"@types/meteor": "^2.9.8", "@types/meteor": "^2.9.8",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"@types/polka": "^0.5.7", "@types/polka": "^0.5.7",
"@types/uuid": "^10.0.0", "@types/uuid": "^10.0.0",
"@types/ws": "^8.5.13", "@types/ws": "^8.5.13",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"pino-pretty": "^7.6.1", "pino-pretty": "^7.6.1",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"main": "./dist/service.js", "main": "./dist/service.js",
"files": [ "files": [
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"@rocket.chat/pdf-worker": "workspace:^", "@rocket.chat/pdf-worker": "workspace:^",
"@rocket.chat/tools": "workspace:^", "@rocket.chat/tools": "workspace:^",
"@rocket.chat/tracing": "workspace:^", "@rocket.chat/tracing": "workspace:^",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"ejson": "^2.2.3", "ejson": "^2.2.3",
"emoji-toolkit": "^7.0.1", "emoji-toolkit": "^7.0.1",
"event-loop-stats": "^1.4.1", "event-loop-stats": "^1.4.1",
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
"@types/polka": "^0.5.7", "@types/polka": "^0.5.7",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"main": "./dist/ee/apps/omnichannel-transcript/src/service.js", "main": "./dist/ee/apps/omnichannel-transcript/src/service.js",
"files": [ "files": [
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"@rocket.chat/presence": "workspace:^", "@rocket.chat/presence": "workspace:^",
"@rocket.chat/string-helpers": "~0.31.25", "@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tracing": "workspace:^", "@rocket.chat/tracing": "workspace:^",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"ejson": "^2.2.3", "ejson": "^2.2.3",
"event-loop-stats": "^1.4.1", "event-loop-stats": "^1.4.1",
"eventemitter3": "^5.0.1", "eventemitter3": "^5.0.1",
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
"@types/polka": "^0.5.7", "@types/polka": "^0.5.7",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"main": "./dist/ee/apps/presence-service/src/service.js", "main": "./dist/ee/apps/presence-service/src/service.js",
"files": [ "files": [
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"@rocket.chat/network-broker": "workspace:^", "@rocket.chat/network-broker": "workspace:^",
"@rocket.chat/omnichannel-services": "workspace:^", "@rocket.chat/omnichannel-services": "workspace:^",
"@rocket.chat/tracing": "workspace:^", "@rocket.chat/tracing": "workspace:^",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"ejson": "^2.2.3", "ejson": "^2.2.3",
"emoji-toolkit": "^7.0.1", "emoji-toolkit": "^7.0.1",
"event-loop-stats": "^1.4.1", "event-loop-stats": "^1.4.1",
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"@types/polka": "^0.5.7", "@types/polka": "^0.5.7",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"main": "./dist/ee/apps/queue-worker/src/service.js", "main": "./dist/ee/apps/queue-worker/src/service.js",
"files": [ "files": [
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"@rocket.chat/network-broker": "workspace:^", "@rocket.chat/network-broker": "workspace:^",
"@rocket.chat/string-helpers": "~0.31.25", "@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tracing": "workspace:^", "@rocket.chat/tracing": "workspace:^",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"ejson": "^2.2.3", "ejson": "^2.2.3",
"event-loop-stats": "^1.4.1", "event-loop-stats": "^1.4.1",
"eventemitter3": "^5.0.1", "eventemitter3": "^5.0.1",
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
"@types/polka": "^0.5.7", "@types/polka": "^0.5.7",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"main": "./dist/ee/apps/stream-hub-service/src/service.js", "main": "./dist/ee/apps/stream-hub-service/src/service.js",
"files": [ "files": [
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"eslint": "~8.45.0", "eslint": "~8.45.0",
"jest": "~29.7.0", "jest": "~29.7.0",
"jest-websocket-mock": "~2.5.0", "jest-websocket-mock": "~2.5.0",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
"@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/eslint-config": "workspace:^",
"@types/chai": "~4.3.20", "@types/chai": "~4.3.20",
"@types/ejson": "^2.2.2", "@types/ejson": "^2.2.2",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"@types/sinon": "^10.0.20", "@types/sinon": "^10.0.20",
"chai": "^4.5.0", "chai": "^4.5.0",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"jest": "~29.7.0", "jest": "~29.7.0",
"sinon": "^19.0.2", "sinon": "^19.0.2",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"scripts": { "scripts": {
"lint": "eslint src", "lint": "eslint src",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"@types/jest": "~29.5.14", "@types/jest": "~29.5.14",
"eslint": "~8.45.0", "eslint": "~8.45.0",
"jest": "~29.7.0", "jest": "~29.7.0",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"dependencies": { "dependencies": {
"@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-services": "workspace:^",
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"@rocket.chat/rest-typings": "workspace:^", "@rocket.chat/rest-typings": "workspace:^",
"@rocket.chat/string-helpers": "~0.31.25", "@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tools": "workspace:^", "@rocket.chat/tools": "workspace:^",
"@types/node": "~20.16.15", "@types/node": "~20.17.8",
"date-fns": "^2.30.0", "date-fns": "^2.30.0",
"ejson": "^2.2.3", "ejson": "^2.2.3",
"emoji-toolkit": "^7.0.1", "emoji-toolkit": "^7.0.1",
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
"jest": "~29.7.0", "jest": "~29.7.0",
"react-dom": "~18.3.1", "react-dom": "~18.3.1",
"storybook": "^8.4.4", "storybook": "^8.4.4",
"typescript": "~5.6.3" "typescript": "~5.7.2"
}, },
"volta": { "volta": {
"extends": "../../../package.json" "extends": "../../../package.json"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment