From b75b69c3b1311ae455d603f93ce9c58f62869544 Mon Sep 17 00:00:00 2001 From: Carlos Valente Date: Sun, 2 Nov 2025 13:06:33 +0100 Subject: [PATCH] chore: cleanup directory structure --- .../sheets/__tests__/sheet.utils.test.ts} | 2 +- .../sheets}/googleApi.utils.ts | 0 apps/server/src/api-data/sheets/sheets.controller.ts | 5 +++-- .../sheets/sheets.service.ts} | 11 ++++++----- .../sheetUtils.ts => api-data/sheets/sheets.utils.ts} | 1 + 5 files changed, 11 insertions(+), 8 deletions(-) rename apps/server/src/{services/sheet-service/__tests__/sheetUtils.test.ts => api-data/sheets/__tests__/sheet.utils.test.ts} (99%) rename apps/server/src/{services/sheet-service => api-data/sheets}/googleApi.utils.ts (100%) rename apps/server/src/{services/sheet-service/SheetService.ts => api-data/sheets/sheets.service.ts} (97%) rename apps/server/src/{services/sheet-service/sheetUtils.ts => api-data/sheets/sheets.utils.ts} (99%) diff --git a/apps/server/src/services/sheet-service/__tests__/sheetUtils.test.ts b/apps/server/src/api-data/sheets/__tests__/sheet.utils.test.ts similarity index 99% rename from apps/server/src/services/sheet-service/__tests__/sheetUtils.test.ts rename to apps/server/src/api-data/sheets/__tests__/sheet.utils.test.ts index dadd2ebc4..70b417f99 100644 --- a/apps/server/src/services/sheet-service/__tests__/sheetUtils.test.ts +++ b/apps/server/src/api-data/sheets/__tests__/sheet.utils.test.ts @@ -1,7 +1,7 @@ import { EndAction, OntimeEvent, SupportedEntry, TimeStrategy, TimerType } from 'ontime-types'; import { millisToString } from 'ontime-utils'; -import { getA1Notation, cellRequestFromEvent } from '../sheetUtils.js'; +import { getA1Notation, cellRequestFromEvent } from '../sheets.utils.js'; describe('getA1Notation()', () => { test('A1', () => { diff --git a/apps/server/src/services/sheet-service/googleApi.utils.ts b/apps/server/src/api-data/sheets/googleApi.utils.ts similarity index 100% rename from apps/server/src/services/sheet-service/googleApi.utils.ts rename to apps/server/src/api-data/sheets/googleApi.utils.ts diff --git a/apps/server/src/api-data/sheets/sheets.controller.ts b/apps/server/src/api-data/sheets/sheets.controller.ts index faded981e..8ce472f64 100644 --- a/apps/server/src/api-data/sheets/sheets.controller.ts +++ b/apps/server/src/api-data/sheets/sheets.controller.ts @@ -9,6 +9,8 @@ import { getErrorMessage } from 'ontime-utils'; import { Request, Response } from 'express'; import { readFileSync } from 'fs'; +import { deleteFile } from '../../utils/fileManagement.js'; + import { revoke, handleClientSecret, @@ -17,8 +19,7 @@ import { download, upload, getWorksheetOptions, -} from '../../services/sheet-service/SheetService.js'; -import { deleteFile } from '../../utils/fileManagement.js'; +} from './sheets.service.js'; export async function requestConnection( req: Request, diff --git a/apps/server/src/services/sheet-service/SheetService.ts b/apps/server/src/api-data/sheets/sheets.service.ts similarity index 97% rename from apps/server/src/services/sheet-service/SheetService.ts rename to apps/server/src/api-data/sheets/sheets.service.ts index 703e9711a..aa16725d5 100644 --- a/apps/server/src/services/sheet-service/SheetService.ts +++ b/apps/server/src/api-data/sheets/sheets.service.ts @@ -24,13 +24,14 @@ import { sheets, type sheets_v4 } from '@googleapis/sheets'; import { Credentials, OAuth2Client } from 'google-auth-library'; import { logger } from '../../classes/Logger.js'; -import { parseRundowns } from '../../api-data/rundown/rundown.parser.js'; -import { getCurrentRundown, getProjectCustomFields, processRundown } from '../../api-data/rundown/rundown.dao.js'; -import { parseExcel } from '../../api-data/excel/excel.parser.js'; -import { parseCustomFields } from '../../api-data/custom-fields/customFields.parser.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 './sheetUtils.js'; +import { cellRequestFromEvent, type ClientSecret, getA1Notation, isClientSecret } from './sheets.utils.js'; import { catchCommonImportXlsxError } from './googleApi.utils.js'; const sheetScope = 'https://www.googleapis.com/auth/spreadsheets'; diff --git a/apps/server/src/services/sheet-service/sheetUtils.ts b/apps/server/src/api-data/sheets/sheets.utils.ts similarity index 99% rename from apps/server/src/services/sheet-service/sheetUtils.ts rename to apps/server/src/api-data/sheets/sheets.utils.ts index 1b43c360d..44ad69599 100644 --- a/apps/server/src/services/sheet-service/sheetUtils.ts +++ b/apps/server/src/api-data/sheets/sheets.utils.ts @@ -9,6 +9,7 @@ import { import { cssOrHexToColour, isLightColour, millisToString, mixColours } from 'ontime-utils'; import type { sheets_v4 } from '@googleapis/sheets'; + import { is } from '../../utils/is.js'; export type ClientSecret = {