Skip to content

Commit

Permalink
chore: Update typescript to 5.6 (#33665)
Browse files Browse the repository at this point in the history
Co-authored-by: Tasso <[email protected]>
  • Loading branch information
KevLehman and tassoevan authored Oct 19, 2024
1 parent 429d000 commit 085fa5e
Show file tree
Hide file tree
Showing 72 changed files with 254 additions and 258 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/app/meteor-accounts-saml/server/lib/SAML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ export class SAML {
throw new Meteor.Error('Unable to process Logout Request: missing request data.');
}

let timeoutHandler: NodeJS.Timer | null = null;
let timeoutHandler: NodeJS.Timeout | undefined = undefined;
const redirect = (url?: string | undefined): void => {
if (!timeoutHandler) {
// If the handler is null, then we already ended the response;
return;
}

clearTimeout(timeoutHandler);
timeoutHandler = null;
timeoutHandler = undefined;

res.writeHead(302, {
Location: url || Meteor.absoluteUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const useVideoConfMenuOptions = () => {
const user = useUser();
const federated = isRoomFederated(room);

const ownUser = room.uids?.length === 1 ?? false;
const ownUser = room.uids?.length === 1 || false;

const permittedToPostReadonly = usePermission('post-readonly', room._id);
const permittedToCallManagement = usePermission('call-management', room._id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const getInitialValues = (triggerData: Serialized<ILivechatTrigger> | undefined)
name: triggerData?.name ?? '',
description: triggerData?.description || '',
enabled: triggerData?.enabled ?? true,
runOnce: !!triggerData?.runOnce ?? false,
runOnce: !!triggerData?.runOnce || false,
conditions: triggerData?.conditions.map(({ name, value }) => ({ name: name || 'page-url', value: value || '' })) ?? [
DEFAULT_PAGE_URL_CONDITION,
],
Expand Down
15 changes: 15 additions & 0 deletions apps/meteor/ee/app/api-enterprise/server/lib/canned-responses.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ export async function findAllCannedResponses({ userId }) {
return cannedResponses;
}

/**
* @param {Object} param0
* @param {String} param0.userId
* @param {String} [param0.shortcut]
* @param {String} [param0.text]
* @param {String} [param0.departmentId]
* @param {String} [param0.scope]
* @param {String} [param0.createdBy]
* @param {String[]} [param0.tags]
* @param {Object} param0.options
* @param {Number} param0.options.offset
* @param {Number} param0.options.count
* @param {Object} param0.options.sort
* @param {Object} param0.options.fields
*/
export async function findAllCannedResponsesFilter({ userId, shortcut, text, departmentId, scope, createdBy, tags = [], options = {} }) {
let extraFilter = [];
// if user cannot see all, filter to private + public + departments user is in
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/ee/server/services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
"@types/ejson": "^2.2.2",
"@types/express": "^4.17.21",
"@types/fibers": "^3.1.4",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"@types/ws": "^8.5.12",
"npm-run-all": "^4.1.5",
"pino-pretty": "^7.6.1",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"volta": {
"extends": "../../../package.json"
Expand Down
8 changes: 4 additions & 4 deletions apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"@types/mkdirp": "^1.0.2",
"@types/mocha": "github:whitecolor/mocha-types",
"@types/moment-timezone": "^0.5.30",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"@types/node-gcm": "^1.0.5",
"@types/node-rsa": "^1.1.4",
"@types/nodemailer": "^6.4.15",
Expand All @@ -149,7 +149,7 @@
"@types/speakeasy": "^2.0.10",
"@types/strict-uri-encode": "^2.0.2",
"@types/string-strip-html": "^5.0.1",
"@types/supertest": "^2.0.16",
"@types/supertest": "^6.0.2",
"@types/supports-color": "~7.2.1",
"@types/textarea-caret": "^3.0.3",
"@types/ua-parser-js": "^0.7.39",
Expand Down Expand Up @@ -208,11 +208,11 @@
"storybook": "^8.3.5",
"stylelint": "^14.9.1",
"stylelint-order": "^5.0.0",
"supertest": "^6.2.3",
"supertest": "^7.0.0",
"supports-color": "~7.2.0",
"template-file": "^6.0.1",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"dependencies": {
"@babel/runtime": "~7.25.7",
Expand Down
5 changes: 3 additions & 2 deletions apps/meteor/server/email/IMAPInterceptor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EventEmitter } from 'events';
import { Readable } from 'stream';

import { EmailInbox } from '@rocket.chat/models';
import type { ImapMessage, ImapMessageBodyInfo } from 'imap';
Expand Down Expand Up @@ -164,7 +165,7 @@ export class IMAPInterceptor extends EventEmitter {
resolve(mail);
}
};
simpleParser(stream, cb);
simpleParser(new Readable().wrap(stream), cb);
});
}

Expand All @@ -174,7 +175,7 @@ export class IMAPInterceptor extends EventEmitter {
const messagecb = (msg: ImapMessage, seqno: number) => {
out.push(seqno);
const bodycb = (stream: NodeJS.ReadableStream, _info: ImapMessageBodyInfo): void => {
simpleParser(stream, (_err, email) => {
simpleParser(new Readable().wrap(stream), (_err, email) => {
if (this.options.rejectBeforeTS && email.date && email.date < this.options.rejectBeforeTS) {
logger.error({ msg: `Rejecting email on inbox ${this.config.user}`, subject: email.subject });
return;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/tests/end-to-end/api/custom-sounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('[CustomSounds]', () => {
const fileName = `test-file-${randomUUID()}`;
let fileId: string;
let fileId2: string;
let uploadDate: unknown;
let uploadDate: string | undefined;

before((done) => getCredentials(done));

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/tests/end-to-end/api/emoji-custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ describe('[EmojiCustom]', () => {
});

describe('Accessing custom emojis', () => {
let uploadDate: unknown;
let uploadDate: string | undefined;

it('should return forbidden if the there is no fileId on the url', (done) => {
void request
Expand Down
8 changes: 1 addition & 7 deletions apps/meteor/tests/end-to-end/api/rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2693,13 +2693,7 @@ describe('[Rooms]', () => {
testUserCreds = await login(user.username, password);
});

const uploadFile = async ({
roomId,
file,
}: {
roomId: IRoom['_id'];
file: Blob | Buffer | fs.ReadStream | string | boolean | number;
}) => {
const uploadFile = async ({ roomId, file }: { roomId: IRoom['_id']; file: Buffer | fs.ReadStream | string | boolean | number }) => {
const { body } = await request
.post(api(`rooms.upload/${roomId}`))
.set(credentials)
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/tests/end-to-end/teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ let lastResponse: Response;

methods.forEach((method) => {
const original = request[method];
request[method] = function (url, fn) {
request[method] = function (url) {
lastUrl = url;
lastMethod = method;
return original(url, fn).expect((res) => {
return original(url).expect((res) => {
lastResponse = res;
});
};
Expand Down
2 changes: 1 addition & 1 deletion apps/uikit-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"eslint": "~8.45.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.12",
"typescript": "~5.5.4",
"typescript": "~5.6.3",
"vite": "^4.5.5"
},
"volta": {
Expand Down
4 changes: 2 additions & 2 deletions ee/apps/account-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tools": "workspace:^",
"@rocket.chat/tracing": "workspace:^",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"bcrypt": "^5.0.1",
"ejson": "^2.2.3",
"event-loop-stats": "^1.4.1",
Expand All @@ -46,7 +46,7 @@
"@types/polka": "^0.5.7",
"eslint": "~8.45.0",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"main": "./dist/ee/apps/account-service/src/service.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions ee/apps/authorization-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@rocket.chat/rest-typings": "workspace:^",
"@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tracing": "workspace:^",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"ejson": "^2.2.3",
"event-loop-stats": "^1.4.1",
"eventemitter3": "^4.0.7",
Expand All @@ -42,7 +42,7 @@
"@types/polka": "^0.5.7",
"eslint": "~8.45.0",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"main": "./dist/ee/apps/authorization-service/src/service.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions ee/apps/ddp-streamer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
"@types/ejson": "^2.2.2",
"@types/gc-stats": "^1.4.3",
"@types/meteor": "^2.9.8",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"@types/polka": "^0.5.7",
"@types/sharp": "^0.30.5",
"@types/uuid": "^8.3.4",
"@types/ws": "^8.5.12",
"eslint": "~8.45.0",
"pino-pretty": "^7.6.1",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"main": "./dist/service.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions ee/apps/omnichannel-transcript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@rocket.chat/pdf-worker": "workspace:^",
"@rocket.chat/tools": "workspace:^",
"@rocket.chat/tracing": "workspace:^",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"ejson": "^2.2.3",
"emoji-toolkit": "^7.0.1",
"event-loop-stats": "^1.4.1",
Expand All @@ -48,7 +48,7 @@
"@types/polka": "^0.5.7",
"eslint": "~8.45.0",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"main": "./dist/ee/apps/omnichannel-transcript/src/service.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions ee/apps/presence-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@rocket.chat/presence": "workspace:^",
"@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tracing": "workspace:^",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"ejson": "^2.2.3",
"event-loop-stats": "^1.4.1",
"eventemitter3": "^4.0.7",
Expand All @@ -42,7 +42,7 @@
"@types/polka": "^0.5.7",
"eslint": "~8.45.0",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"main": "./dist/ee/apps/presence-service/src/service.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions ee/apps/queue-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@rocket.chat/network-broker": "workspace:^",
"@rocket.chat/omnichannel-services": "workspace:^",
"@rocket.chat/tracing": "workspace:^",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"ejson": "^2.2.3",
"emoji-toolkit": "^7.0.1",
"event-loop-stats": "^1.4.1",
Expand All @@ -45,7 +45,7 @@
"@types/polka": "^0.5.7",
"eslint": "~8.45.0",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"main": "./dist/ee/apps/queue-worker/src/service.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions ee/apps/stream-hub-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@rocket.chat/network-broker": "workspace:^",
"@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tracing": "workspace:^",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"ejson": "^2.2.3",
"event-loop-stats": "^1.4.1",
"eventemitter3": "^4.0.7",
Expand All @@ -44,7 +44,7 @@
"@types/polka": "^0.5.7",
"eslint": "~8.45.0",
"ts-node": "^10.9.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"main": "./dist/ee/apps/stream-hub-service/src/service.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion ee/packages/license/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"eslint": "~8.45.0",
"jest": "~29.7.0",
"jest-websocket-mock": "~2.5.0",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"scripts": {
"build": "tsc",
Expand Down
4 changes: 2 additions & 2 deletions ee/packages/network-broker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"@rocket.chat/eslint-config": "workspace:^",
"@types/chai": "~4.3.19",
"@types/ejson": "^2.2.2",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"@types/sinon": "^10.0.20",
"chai": "^4.3.10",
"eslint": "~8.45.0",
"jest": "~29.7.0",
"sinon": "^19.0.2",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"scripts": {
"lint": "eslint src",
Expand Down
4 changes: 2 additions & 2 deletions ee/packages/omnichannel-services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@types/jest": "~29.5.13",
"eslint": "~8.45.0",
"jest": "~29.7.0",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"dependencies": {
"@rocket.chat/core-services": "workspace:^",
Expand All @@ -21,7 +21,7 @@
"@rocket.chat/rest-typings": "workspace:^",
"@rocket.chat/string-helpers": "~0.31.25",
"@rocket.chat/tools": "workspace:^",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"date-fns": "^2.28.0",
"ejson": "^2.2.3",
"emoji-toolkit": "^7.0.1",
Expand Down
2 changes: 1 addition & 1 deletion ee/packages/pdf-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"jest": "~29.7.0",
"react-dom": "~18.3.1",
"storybook": "^8.3.5",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"volta": {
"extends": "../../../package.json"
Expand Down
4 changes: 2 additions & 2 deletions ee/packages/presence/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"@rocket.chat/apps-engine": "workspace:^",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/rest-typings": "workspace:^",
"@types/node": "^14.18.63",
"@types/node": "~20.16.12",
"babel-jest": "^29.0.3",
"eslint": "~8.45.0",
"jest": "~29.7.0",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"scripts": {
"lint": "eslint src",
Expand Down
2 changes: 1 addition & 1 deletion ee/packages/ui-theming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"eslint-plugin-testing-library": "^5.11.1",
"react": "~17.0.2",
"react-docgen-typescript-plugin": "~1.0.8",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"scripts": {
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
Expand Down
2 changes: 1 addition & 1 deletion packages/account-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"devDependencies": {
"eslint": "~8.45.0",
"typescript": "~5.5.4"
"typescript": "~5.6.3"
},
"scripts": {
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
Expand Down
Loading

0 comments on commit 085fa5e

Please sign in to comment.