Deps migration (#1988)

* chore: migrate eslint to oxlint

* chore: migrate prettier to oxfmt

* chore: migrate typescript

* chore: toThrow should have a expected value

* chore: cast test value as Day

* chore: small title fix

* chore: mocks should be hoisted

* chore: incorrect async useage

* chore: test should be inside description

* chore: test sohuld include an expeced

* chore: oxfmt

---------

Co-authored-by: alex-Arc <omnivox@LAPTOP-RC5SNBVV.localdomain>
This commit is contained in:
Carlos Valente
2026-03-08 16:22:12 +01:00
committed by GitHub
parent 9516ac21bb
commit 1849b4d39f
501 changed files with 2678 additions and 4654 deletions
@@ -1,7 +1,7 @@
import { EndAction, OntimeEvent, SupportedEntry, TimeStrategy, TimerType } from 'ontime-types';
import { type Day, EndAction, OntimeEvent, SupportedEntry, TimeStrategy, TimerType } from 'ontime-types';
import { millisToString } from 'ontime-utils';
import { getA1Notation, cellRequestFromEvent } from '../sheets.utils.js';
import { cellRequestFromEvent, getA1Notation } from '../sheets.utils.js';
describe('getA1Notation()', () => {
test('A1', () => {
@@ -38,7 +38,7 @@ describe('cellRequestFromEvent()', () => {
colour: 'red',
delay: 0,
gap: 0,
dayOffset: 0,
dayOffset: 0 as Day,
parent: null,
revision: 0,
id: '1358',
@@ -89,7 +89,7 @@ describe('cellRequestFromEvent()', () => {
revision: 0,
delay: 0,
gap: 0,
dayOffset: 0,
dayOffset: 0 as Day,
id: '1358',
timeWarning: 0,
timeDanger: 0,
@@ -140,7 +140,7 @@ describe('cellRequestFromEvent()', () => {
revision: 0,
delay: 0,
gap: 0,
dayOffset: 0,
dayOffset: 0 as Day,
id: '1358',
timeWarning: 0,
timeDanger: 0,
@@ -187,7 +187,7 @@ describe('cellRequestFromEvent()', () => {
colour: 'red',
delay: 0,
gap: 0,
dayOffset: 0,
dayOffset: 0 as Day,
parent: null,
revision: 0,
id: '1358',
@@ -226,7 +226,7 @@ describe('cellRequestFromEvent()', () => {
revision: 0,
delay: 0,
gap: 0,
dayOffset: 0,
dayOffset: 0 as Day,
id: '1358',
timeWarning: 0,
timeDanger: 0,
@@ -264,7 +264,7 @@ describe('cellRequestFromEvent()', () => {
revision: 0,
delay: 0,
gap: 0,
dayOffset: 0,
dayOffset: 0 as Day,
id: '1358',
timeWarning: 0,
timeDanger: 0,
@@ -3,22 +3,21 @@
* Google Sheets
*/
import { readFileSync } from 'fs';
import { Request, Response } from 'express';
import type { AuthenticationStatus, CustomFields, ErrorResponse, Rundown, RundownSummary } from 'ontime-types';
import { getErrorMessage } from 'ontime-utils';
import { Request, Response } from 'express';
import { readFileSync } from 'fs';
import { deleteFile } from '../../utils/fileManagement.js';
import {
revoke,
download,
getWorksheetOptions,
handleClientSecret,
handleInitialConnection,
hasAuth,
download,
revoke,
upload,
getWorksheetOptions,
} from './sheets.service.js';
export async function requestConnection(
@@ -4,35 +4,32 @@
* @link https://developers.google.com/identity/protocols/oauth2/limited-input-device
*/
import { sheets, type sheets_v4 } from '@googleapis/sheets';
import { Credentials, OAuth2Client } from 'google-auth-library';
import {
AuthenticationStatus,
CustomFields,
DatabaseModel,
EntryId,
isOntimeEvent,
isOntimeMilestone,
LogOrigin,
MaybeString,
OntimeGroup,
Rundown,
RundownSummary,
SupportedEntry,
isOntimeEvent,
isOntimeMilestone,
} from 'ontime-types';
import { ImportMap, getErrorMessage } from 'ontime-utils';
import { sheets, type sheets_v4 } from '@googleapis/sheets';
import { Credentials, OAuth2Client } from 'google-auth-library';
import { logger } from '../../classes/Logger.js';
import { parseRundowns } from '../rundown/rundown.parser.js';
import { getCurrentRundown, getProjectCustomFields, processRundown } from '../rundown/rundown.dao.js';
import { parseExcel } from '../excel/excel.parser.js';
import { parseCustomFields } from '../custom-fields/customFields.parser.js';
import { consoleSubdued } from '../../utils/console.js';
import { cellRequestFromEvent, type ClientSecret, getA1Notation, isClientSecret } from './sheets.utils.js';
import { parseCustomFields } from '../custom-fields/customFields.parser.js';
import { parseExcel } from '../excel/excel.parser.js';
import { getCurrentRundown, getProjectCustomFields, processRundown } from '../rundown/rundown.dao.js';
import { parseRundowns } from '../rundown/rundown.parser.js';
import { catchCommonImportXlsxError } from './googleApi.utils.js';
import { type ClientSecret, cellRequestFromEvent, getA1Notation, isClientSecret } from './sheets.utils.js';
const sheetScope = 'https://www.googleapis.com/auth/spreadsheets';
const codesUrl = 'https://oauth2.googleapis.com/device/code';
@@ -1,15 +1,14 @@
import type { sheets_v4 } from '@googleapis/sheets';
import {
OntimeEntry,
OntimeEntryCommonKeys,
RGBColour,
isOntimeDelay,
OntimeEntryCommonKeys,
isOntimeGroup,
isOntimeMilestone,
} from 'ontime-types';
import { cssOrHexToColour, isLightColour, millisToString, mixColours } from 'ontime-utils';
import type { sheets_v4 } from '@googleapis/sheets';
import { is } from '../../utils/is.js';
export type ClientSecret = {
@@ -104,6 +103,7 @@ export function cellRequestFromEvent(
const thisCol = e[1].col;
const diff = thisCol - prevCol;
if (diff > 1) {
// TODO: we need to clarify this logic
const fillArr = new Array<(typeof rowData)[0]>(1).fill(['blank', { row: e[1].row, col: prevCol + 1 }]);
rowData.splice(index, 0, ...fillArr);
}
@@ -1,7 +1,7 @@
import { NextFunction, Request, Response } from 'express';
import { body, param, validationResult } from 'express-validator';
import { isImportMap } from 'ontime-utils';
import { body, param, validationResult } from 'express-validator';
import { NextFunction, Request, Response } from 'express';
import { requestValidationFunction } from '../validation-utils/validationFunction.js';
export const validateRequestConnection = [