diff --git a/.env.example b/.env.example index 9d40dd199a..e9fe8d1f4b 100644 --- a/.env.example +++ b/.env.example @@ -55,21 +55,6 @@ FEATURE_TOGGLE_RELEASE_ENVIRONMENT= # [Optional] Enable Mudita Center prerelease feature. Disabled by default, set "1" to enable MUDITA_CENTER_PRERELEASE_ENABLED= -# [Optional] Path to your Google service account key file. Required for authentication with the Google Sheets API. -MATOMO_TO_GSHEET_KEYFILEPATH= - -# [Optional] The ID of the Google Sheet where Matomo data will be written. Found in the URL of your Google Sheet. -MATOMO_TO_GSHEET_SPREADSHEET_ID= - -# [Optional] The base URL for the Matomo API. This is where API requests will be sent to fetch analytics data. -MATOMO_TO_GSHEET_API_URL= - -# [Optional] Your Matomo API token. Required for accessing data from your Matomo account through the API. -MATOMO_TO_GSHEET_TOKEN= - -# [Optional] The site ID for your website as registered in Matomo. Used to specify which site's data to fetch. -MATOMO_TO_GSHEET_SITE_ID= - # [Optional] Set 1 run application with mock server MOCK_SERVICE_ENABLED= diff --git a/libs/external-tools/matomo-to-gsheet/.babelrc b/libs/external-tools/matomo-to-gsheet/.babelrc deleted file mode 100644 index 1ea870ead4..0000000000 --- a/libs/external-tools/matomo-to-gsheet/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": [ - [ - "@nx/react/babel", - { - "runtime": "automatic", - "useBuiltIns": "usage" - } - ] - ], - "plugins": [] -} diff --git a/libs/external-tools/matomo-to-gsheet/.eslintrc.json b/libs/external-tools/matomo-to-gsheet/.eslintrc.json deleted file mode 100644 index cacbe26215..0000000000 --- a/libs/external-tools/matomo-to-gsheet/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../../.eslintrc.js"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/libs/external-tools/matomo-to-gsheet/README.md b/libs/external-tools/matomo-to-gsheet/README.md deleted file mode 100644 index 812047fb8f..0000000000 --- a/libs/external-tools/matomo-to-gsheet/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Matomo Data to Google Sheets Script - -This script is designed to fetch data from the Matomo API and update it in a Google Sheets spreadsheet. - -## Requirements - -1. Node.js -2. Matomo API key and access to a Google Sheets account. - -## Configuration - -1. Copy the `.env.example` file and rename it to `.env`. -2. Fill in the required environment variables in the `.env` file: - - `MATOMO_TO_GSHEET_KEYFILEPATH`: Path to the Google service key. - - `MATOMO_TO_GSHEET_SPREADSHEET_ID`: Google Sheets spreadsheet ID where the data will be saved. - - `MATOMO_TO_GSHEET_API_URL`: Matomo API URL. - - `MATOMO_TO_GSHEET_SITE_ID`: Matomo website ID. - - `MATOMO_TO_GSHEET_TOKEN`: Matomo authentication token. - -### Note on Authentication - -For the `MATOMO_TO_GSHEET_KEYFILEPATH` variable, it represents the path to the Google service account key file, which is required for authentication with the Google Sheets API. You can obtain this key file by following these steps: - -1. Navigate to the Google Cloud Console. -2. Select the project associated with your Google Sheets account. -3. In the left sidebar, click on "IAM & admin" and then "Service accounts". -4. Find the service account you want to use or create a new one. -5. Click on the service account and then navigate to the "Keys" tab. -6. Click on "Add key" and select "JSON" format. -7. Save the downloaded JSON file securely to your local machine. -8. Set the `MATOMO_TO_GSHEET_KEYFILEPATH` variable in the `.env` file to the path of the downloaded JSON file. - -Ensure that the service account has the necessary permissions to access the Google Sheets API and edit the specified spreadsheet. - -## Installation - -3. Run `npm install` to install all required dependencies. - -## Running the Script - -1. Run `npm run matomo-to-gsheet:run` to execute the script from the project's root directory. -2. The script will fetch data from the Matomo API and update the Google Sheets spreadsheet. - -## Architecture - -The project consists of several main components: - -1. **Matomo Service**: Responsible for communicating with the Matomo API and fetching data according to specified parameters. Handles various types of queries, such as fetching action events, category events, etc. - -2. **Google Sheet Service**: Manages the update of the Google Sheets spreadsheet. Retrieves data from the Matomo Service and updates the appropriate cells in the Google Sheets spreadsheet. - -3. **Utils**: Set of utility functions, such as generating date ranges, validating date formats, etc. - -4. **Environment Configuration**: The `.env` file where environment variables necessary for configuring the script are stored, such as API keys and Google Sheets identifiers. - -### Enhancing Automation - -For enhanced automation, consider transferring the script to GitHub Actions as a scheduled cron job. This will allow for periodic execution of the script without the need for manual intervention. diff --git a/libs/external-tools/matomo-to-gsheet/jest.config.ts b/libs/external-tools/matomo-to-gsheet/jest.config.ts deleted file mode 100644 index dcbf778f66..0000000000 --- a/libs/external-tools/matomo-to-gsheet/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: "external-tools-matomo-to-gsheet", - preset: "../../../jest.preset.js", - transform: { - "^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nx/react/plugins/jest", - "^.+\\.[tj]sx?$": ["babel-jest", { presets: ["@nx/react/babel"] }], - }, - moduleFileExtensions: ["ts", "tsx", "js", "jsx"], - coverageDirectory: "../../../coverage/libs/external-tools/matomo-to-gsheet", -} diff --git a/libs/external-tools/matomo-to-gsheet/project.json b/libs/external-tools/matomo-to-gsheet/project.json deleted file mode 100644 index 36bbcc6856..0000000000 --- a/libs/external-tools/matomo-to-gsheet/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "external-tools-matomo-to-gsheet", - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "libs/external-tools/matomo-to-gsheet/src", - "projectType": "library", - "tags": [], - "targets": { - "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "libs/external-tools/matomo-to-gsheet/jest.config.ts" - } - } - } -} diff --git a/libs/external-tools/matomo-to-gsheet/src/lib/google-sheet/google-sheet.factory.ts b/libs/external-tools/matomo-to-gsheet/src/lib/google-sheet/google-sheet.factory.ts deleted file mode 100644 index 0fb677c967..0000000000 --- a/libs/external-tools/matomo-to-gsheet/src/lib/google-sheet/google-sheet.factory.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) Mudita sp. z o.o. All rights reserved. - * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md - */ - -import { google, sheets_v4 } from "googleapis" - -const KEYFILEPATH = process.env.MATOMO_TO_GSHEET_KEYFILEPATH! - -class GoogleSheetFactory { - static makeGoogleSheet(): sheets_v4.Sheets{ - // @ts-ignore - return google.sheets({ - version: "v4", - auth: new google.auth.GoogleAuth({ - keyFile: KEYFILEPATH, - scopes: ["https://www.googleapis.com/auth/spreadsheets"], - }), - }) - } -} - -export default GoogleSheetFactory diff --git a/libs/external-tools/matomo-to-gsheet/src/lib/google-sheet/stats-sheet.service.ts b/libs/external-tools/matomo-to-gsheet/src/lib/google-sheet/stats-sheet.service.ts deleted file mode 100644 index 20ea31f968..0000000000 --- a/libs/external-tools/matomo-to-gsheet/src/lib/google-sheet/stats-sheet.service.ts +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) Mudita sp. z o.o. All rights reserved. - * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md - */ - -import { sheets_v4 } from "googleapis" -import isValidDateFormat from "../utils/is-valid-date-format" - -type MatomoData = { [date: string]: { label: string; nb_events: number }[] } - -const SPREADSHEET_ID = process.env.MATOMO_TO_GSHEET_SPREADSHEET_ID! -const defaultStartDate = "2023-07-30" - -export default class StatsSheetService { - constructor(private sheets: sheets_v4.Sheets) {} - - public async getLastDate(sheetName: string): Promise { - const response = await this.sheets.spreadsheets.values.get({ - spreadsheetId: SPREADSHEET_ID, - range: `${sheetName}!A:A`, - }) - const rows: string[][] = response.data.values ?? [] - - if (rows.length === 0) { - return defaultStartDate - } - - const date = rows[rows.length - 1][0] - - if (!isValidDateFormat(date)) { - throw new Error( - "dateString is in another format than YYYY-MM-DD while retrieving data from the sheet" - ) - } - - return date - } - - public async updateStats(data: MatomoData, sheetName: string): Promise { - const response = await this.sheets.spreadsheets.values.get({ - spreadsheetId: SPREADSHEET_ID, - range: `${sheetName}!A2:ZZ`, - }) - - const existingData = response.data.values || [] - - const existingHeaders = existingData.length > 0 ? existingData[0] : [] - const allVersions = new Set(existingHeaders.slice(1)) // Removing "Dzień" from the headers - - // Adding new versions from current data - Object.values(data).forEach((events) => - events.forEach((event) => - allVersions.add(event.label.replace("latest - ", "")) - ) - ) - - const updatedHeaders = ["Dzień", ...Array.from(allVersions)] - const headersToUpdate = - existingHeaders.length < updatedHeaders.length || - !updatedHeaders.every( - (header, index) => existingHeaders[index] === header - ) - - // Updating headers if necessary - if (headersToUpdate) { - await this.sheets.spreadsheets.values.update({ - spreadsheetId: SPREADSHEET_ID, - range: `${sheetName}!A2`, - valueInputOption: "USER_ENTERED", - requestBody: { values: [updatedHeaders] }, - }) - } - - // Preparing new data rows according to current headers - const rows = Object.entries(data).map(([date, events]) => { - const row = new Array(updatedHeaders.length).fill(0) - row[0] = date // Date set - - events.forEach((event) => { - const versionIndex = updatedHeaders.indexOf( - event.label.replace("latest - ", "") - ) - if (versionIndex !== -1) { - row[versionIndex] = event.nb_events // Setting the number of events for the respective version - } - }) - - // eslint-disable-next-line @typescript-eslint/no-unsafe-return - return row - }) - - // Finding the first empty row after existing data - const startRow = existingData.length + 2 // +2 because headers are in the second row - - // Adding new data - await this.sheets.spreadsheets.values.append({ - spreadsheetId: SPREADSHEET_ID, - range: `${sheetName}!A${startRow}`, - valueInputOption: "USER_ENTERED", - requestBody: { values: rows }, - }) - } -} diff --git a/libs/external-tools/matomo-to-gsheet/src/lib/matomo/matomo-data.interface.ts b/libs/external-tools/matomo-to-gsheet/src/lib/matomo/matomo-data.interface.ts deleted file mode 100644 index 98474a9b6c..0000000000 --- a/libs/external-tools/matomo-to-gsheet/src/lib/matomo/matomo-data.interface.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) Mudita sp. z o.o. All rights reserved. - * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md - */ - -export interface MatomoEvent { - label: string; - nb_uniq_visitors: number; - nb_visits: number; - nb_events: number; - nb_events_with_value: number; - sum_event_value: number; - min_event_value: boolean | number; - max_event_value: number; - avg_event_value: number; - segment: string; - idsubdatatable?: string; -} - - export type MatomoData = { [date: string]: MatomoEvent[] }; - -export interface FetchDataOptions { - label: string - startDate: string - endDate: string -} - -export interface GetActionEventsOptions { - date: string - label: string -} - -export interface GetCategoryEventByLabelOptions { - date: string - label: string -} - -export interface GetActionEventsByCategoryIdOptions { - date: string - id: string -} diff --git a/libs/external-tools/matomo-to-gsheet/src/lib/matomo/matomo.service.ts b/libs/external-tools/matomo-to-gsheet/src/lib/matomo/matomo.service.ts deleted file mode 100644 index fe018624e5..0000000000 --- a/libs/external-tools/matomo-to-gsheet/src/lib/matomo/matomo.service.ts +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (c) Mudita sp. z o.o. All rights reserved. - * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md - */ - -import axios from "axios" -import { - FetchDataOptions, - GetActionEventsByCategoryIdOptions, - GetActionEventsOptions, - GetCategoryEventByLabelOptions, - MatomoData, - MatomoEvent, -} from "../matomo/matomo-data.interface" -import generateDateRange from "../utils/generate-date-range" - -const MATOMO_API_URL: string = process.env.MATOMO_TO_GSHEET_API_URL! -const MATOMO_SITE_ID: string = process.env.MATOMO_TO_GSHEET_SITE_ID! -const MATOMO_TOKEN: string = process.env.MATOMO_TO_GSHEET_TOKEN! - -class MatomoService { - public async fetchMatomoData({ - startDate, - endDate, - label, - }: FetchDataOptions): Promise { - const data: MatomoData = {} - const dateRange = generateDateRange(startDate, endDate) - - for (const date of dateRange) { - data[date] = await this.getActionEvents({ date, label }) - } - - return data - } - - private async getActionEvents({ - date, - label, - }: GetActionEventsOptions): Promise { - const categoryEvent = await this.getCategoryEventByLabel({ date, label }) - - const id = categoryEvent?.idsubdatatable - if (id === undefined) { - return [] - } - - const actionEvents = await this.getActionEventsByCategoryId({ - date, - id, - }) - return actionEvents.filter((event) => event.label.includes("latest")) - } - - private async getCategoryEventByLabel({ - date, - label, - }: GetCategoryEventByLabelOptions): Promise { - try { - const url = this.buildUrl({ - method: "Events.getCategory", - period: "day", - date: date, - }) - const response = await axios.get(url) - - // @ts-ignore - if (response.data.result === "error") { - console.error( - "Error while retrieving getCategoryEventByLabel:", - response.data - ) - return undefined - } - - return response.data.find((event) => event.label === label) - } catch (error) { - console.error("Error while retrieving getCategoryEventByLabel:", error) - - return undefined - } - } - - private async getActionEventsByCategoryId({ - date, - id, - }: GetActionEventsByCategoryIdOptions): Promise { - try { - const url = this.buildUrl({ - method: "Events.getActionFromCategoryId", - period: "day", - date: date, - idSubtable: id, - }) - const response = await axios.get(url) - - // @ts-ignore - if (response.data.result === "error") { - console.error( - "Error while retrieving getActionEventsByCategoryId:", - response.data - ) - return [] - } - - return response.data as MatomoEvent[] - } catch (error) { - console.error( - "Error while retrieving getActionEventsByCategoryId:", - error - ) - return [] - } - } - - private buildUrl(params: Record): string { - const url = new URL(MATOMO_API_URL) - url.search = new URLSearchParams({ - module: "API", - format: "JSON", - idSite: MATOMO_SITE_ID, - token_auth: MATOMO_TOKEN, - ...params, - }).toString() - return url.toString() - } -} - -export default MatomoService diff --git a/libs/external-tools/matomo-to-gsheet/src/lib/script.ts b/libs/external-tools/matomo-to-gsheet/src/lib/script.ts deleted file mode 100644 index 36116549b2..0000000000 --- a/libs/external-tools/matomo-to-gsheet/src/lib/script.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) Mudita sp. z o.o. All rights reserved. - * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md - */ - -import 'dotenv/config'; -import MatomoService from "./matomo/matomo.service" -import GoogleSheetFactory from "./google-sheet/google-sheet.factory" -import StatsSheetService from "./google-sheet/stats-sheet.service" -import getYesterdayDateString from "./utils/get-yesterday-date" - -const matomoService = new MatomoService() -const statsSheetService = new StatsSheetService( - GoogleSheetFactory.makeGoogleSheet() -) - -const endDate = getYesterdayDateString() - -async function script() { - try { - const muditaHarmonySheetLastDate = await statsSheetService.getLastDate( - "Mudita Harmony - MD" - ) - - const muditaHarmonyMatomoData = await matomoService.fetchMatomoData({ - label: "Harmony Update - download", - startDate: muditaHarmonySheetLastDate, - endDate, - }) - - await statsSheetService.updateStats( - muditaHarmonyMatomoData, - "Mudita Harmony - MD" - ) - - const muditaPureSheetLastDate = await statsSheetService.getLastDate( - "Mudita Pure - MD" - ) - - const muditaPureMatomoData = await matomoService.fetchMatomoData({ - label: "Pure Update - download", - startDate: muditaPureSheetLastDate, - endDate, - }) - - await statsSheetService.updateStats( - muditaPureMatomoData, - "Mudita Pure - MD" - ) - - } catch (error) { - console.error(error) - return - } -} - -void script() diff --git a/libs/external-tools/matomo-to-gsheet/src/lib/utils/generate-date-range.ts b/libs/external-tools/matomo-to-gsheet/src/lib/utils/generate-date-range.ts deleted file mode 100644 index d75f275c77..0000000000 --- a/libs/external-tools/matomo-to-gsheet/src/lib/utils/generate-date-range.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) Mudita sp. z o.o. All rights reserved. - * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md - */ - -/** - * Generates an array of date strings between two specified dates. - * - * @param startDate The start date in `YYYY-MM-DD` format. - * @param endDate The end date in `YYYY-MM-DD` format. - * @returns An array of dates (inclusive) between `startDate` and `endDate`, formatted as `YYYY-MM-DD`. - */ -function generateDateRange(startDate: string, endDate: string): string[] { - const start = new Date(startDate) - start.setDate(start.getDate() + 1) - const end = new Date(endDate) - const currentDate = new Date(start) - const dateRange: string[] = [] - - while (currentDate <= end) { - dateRange.push(currentDate.toISOString().split("T")[0]) - currentDate.setDate(currentDate.getDate() + 1) - } - - return dateRange -} - -export default generateDateRange diff --git a/libs/external-tools/matomo-to-gsheet/src/lib/utils/get-yesterday-date.ts b/libs/external-tools/matomo-to-gsheet/src/lib/utils/get-yesterday-date.ts deleted file mode 100644 index 08d9b2cea8..0000000000 --- a/libs/external-tools/matomo-to-gsheet/src/lib/utils/get-yesterday-date.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Mudita sp. z o.o. All rights reserved. - * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md - */ - -/** - * Returns yesterday's date as a string in 'YYYY-MM-DD' format. - * - * Utilizes the Date object to subtract one day from the current date, - * then formats it to ISO string, extracting only the date part. - * - * @returns {string} Yesterday's date in 'YYYY-MM-DD'. - */ -function getYesterdayDateString(): string { - const date: Date = new Date() - date.setDate(date.getDate() - 1) - - return date.toISOString().split("T")[0] -} - -export default getYesterdayDateString diff --git a/libs/external-tools/matomo-to-gsheet/src/lib/utils/is-valid-date-format.ts b/libs/external-tools/matomo-to-gsheet/src/lib/utils/is-valid-date-format.ts deleted file mode 100644 index a8c3678283..0000000000 --- a/libs/external-tools/matomo-to-gsheet/src/lib/utils/is-valid-date-format.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) Mudita sp. z o.o. All rights reserved. - * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md - */ - -/** - * Validates if a given date string is in the format YYYY-MM-DD. - * @param dateString The date string to validate. - * @returns true if the dateString is in the format YYYY-MM-DD, otherwise false. - */ -function isValidDateFormat(dateString: string): boolean { - // Regular expression to match the YYYY-MM-DD format - const regex = /^\d{4}-\d{2}-\d{2}$/; - - // Check if the dateString matches the regular expression - if (!regex.test(dateString)) { - return false; - } - - // Further validation to ensure the date is valid (e.g., not 2022-02-30) - const date = new Date(dateString); - const dateNum = date.getTime(); - - // Check if date is Invalid Date or the dateString does not match the date's toISOString() substring - if (!dateNum && dateNum !== 0 || dateString !== date.toISOString().substring(0, 10)) { - return false; - } - - return true; -} - -export default isValidDateFormat diff --git a/libs/external-tools/matomo-to-gsheet/tsconfig.json b/libs/external-tools/matomo-to-gsheet/tsconfig.json deleted file mode 100644 index 4daaf45cd3..0000000000 --- a/libs/external-tools/matomo-to-gsheet/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "allowJs": false, - "esModuleInterop": false, - "allowSyntheticDefaultImports": true, - "strict": true - }, - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - } - ], - "extends": "../../../tsconfig.base.json" -} diff --git a/libs/external-tools/matomo-to-gsheet/tsconfig.lib.json b/libs/external-tools/matomo-to-gsheet/tsconfig.lib.json deleted file mode 100644 index 21799b3e6b..0000000000 --- a/libs/external-tools/matomo-to-gsheet/tsconfig.lib.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../../dist/out-tsc", - "types": [ - "node", - - "@nx/react/typings/cssmodule.d.ts", - "@nx/react/typings/image.d.ts" - ] - }, - "exclude": [ - "jest.config.ts", - "src/**/*.spec.ts", - "src/**/*.test.ts", - "src/**/*.spec.tsx", - "src/**/*.test.tsx", - "src/**/*.spec.js", - "src/**/*.test.js", - "src/**/*.spec.jsx", - "src/**/*.test.jsx" - ], - "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] -} diff --git a/libs/external-tools/matomo-to-gsheet/tsconfig.spec.json b/libs/external-tools/matomo-to-gsheet/tsconfig.spec.json deleted file mode 100644 index 25b7af8f6d..0000000000 --- a/libs/external-tools/matomo-to-gsheet/tsconfig.spec.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.test.tsx", - "src/**/*.spec.tsx", - "src/**/*.test.js", - "src/**/*.spec.js", - "src/**/*.test.jsx", - "src/**/*.spec.jsx", - "src/**/*.d.ts" - ] -} diff --git a/package-lock.json b/package-lock.json index 6138c33674..431050d66f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,6 @@ "@electron/notarize": "^2.3.0", "@electron/remote": "^2.1.2", "@faker-js/faker": "^7.5.0", - "@googleapis/sheets": "^5.0.5", "@mudita/stylelint-config": "^1.0.4", "@nx/eslint": "^17.2.6", "@nx/jest": "17.2.6", @@ -157,7 +156,6 @@ "fork-ts-checker-webpack-plugin": "^7.2.13", "fs-extra": "^10.1.0", "getmac": "^5.21.0", - "googleapis": "^133.0.0", "history": "^4.10.1", "html-webpack-plugin": "^5.5.0", "husky": "^7.0.4", @@ -3617,18 +3615,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@googleapis/sheets": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@googleapis/sheets/-/sheets-5.0.5.tgz", - "integrity": "sha512-XMoONmgAJm2jYeTYHX4054VcEkElxlgqmnHvt0wAurzEHoGJLdUHhTAJXGPLgSs4WVMPtgU8HLrmk7/U+Qlw7A==", - "dev": true, - "dependencies": { - "googleapis-common": "^7.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", @@ -18553,15 +18539,6 @@ "node": "*" } }, - "node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -18965,12 +18942,6 @@ "node": ">=0.4.0" } }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "dev": true - }, "node_modules/buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", @@ -22237,15 +22208,6 @@ "wcwidth": "^1.0.1" } }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, "node_modules/edge-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/edge-paths/-/edge-paths-2.2.1.tgz", @@ -26283,46 +26245,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gaxios": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.3.0.tgz", - "integrity": "sha512-p+ggrQw3fBwH2F5N/PAI4k/G/y1art5OxKpb2J2chwNNHM4hHuAOtivjPuirMF4KNKwTTUal/lPfL2+7h2mEcg==", - "dev": true, - "dependencies": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/gaxios/node_modules/agent-base": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", - "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", - "dev": true, - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/gaxios/node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", - "dev": true, - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/gaze": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", @@ -26335,19 +26257,6 @@ "node": ">= 4.0.0" } }, - "node_modules/gcp-metadata": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", - "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", - "dev": true, - "dependencies": { - "gaxios": "^6.0.0", - "json-bigint": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/geckodriver": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-4.4.1.tgz", @@ -27038,53 +26947,6 @@ "node": ">=0.6.0" } }, - "node_modules/google-auth-library": { - "version": "9.6.3", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.6.3.tgz", - "integrity": "sha512-4CacM29MLC2eT9Cey5GDVK4Q8t+MMp8+OEdOaqD9MG6b0dOyLORaaeJMPQ7EESVgm/+z5EKYyFLxgzBJlJgyHQ==", - "dev": true, - "dependencies": { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^6.1.1", - "gcp-metadata": "^6.1.0", - "gtoken": "^7.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/googleapis": { - "version": "133.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-133.0.0.tgz", - "integrity": "sha512-6xyc49j+x7N4smawJs/q1i7mbSkt6SYUWWd9RbsmmDW7gRv+mhwZ4xT+XkPihZcNyo/diF//543WZq4szdS74w==", - "dev": true, - "dependencies": { - "google-auth-library": "^9.0.0", - "googleapis-common": "^7.0.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/googleapis-common": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-7.0.1.tgz", - "integrity": "sha512-mgt5zsd7zj5t5QXvDanjWguMdHAcJmmDrF9RkInCecNsyV7S7YtGqm5v2IWONNID88osb7zmx5FtrAP12JfD0w==", - "dev": true, - "dependencies": { - "extend": "^3.0.2", - "gaxios": "^6.0.3", - "google-auth-library": "^9.0.0", - "qs": "^6.7.0", - "url-template": "^2.0.8", - "uuid": "^9.0.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -27154,19 +27016,6 @@ "optional": true, "peer": true }, - "node_modules/gtoken": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", - "dev": true, - "dependencies": { - "gaxios": "^6.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/gunzip-maybe": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/gunzip-maybe/-/gunzip-maybe-1.4.2.tgz", @@ -32805,15 +32654,6 @@ "node": ">=4" } }, - "node_modules/json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "dev": true, - "dependencies": { - "bignumber.js": "^9.0.0" - } - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -32943,27 +32783,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", - "dev": true, - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "dev": true, - "dependencies": { - "jwa": "^2.0.0", - "safe-buffer": "^5.0.1" - } - }, "node_modules/keyboardevent-from-electron-accelerator": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/keyboardevent-from-electron-accelerator/-/keyboardevent-from-electron-accelerator-2.0.0.tgz", @@ -45801,12 +45620,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/url-template": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", - "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==", - "dev": true - }, "node_modules/url/node_modules/punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", diff --git a/package.json b/package.json index 1d713a7d10..4a34e7aea4 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,7 @@ "app:storybook:serve": "nx storybook:serve mudita-center", "app:storybook:build": "nx storybook:build mudita-center", "e2e:test": "nx e2e:test mudita-center-e2e", - "e2e:test:linux": "xvfb-run --auto-servernum --server-args='-screen 0 1024x768x24' nx e2e:test:cicd mudita-center-e2e", - "matomo-to-gsheet:run": "ts-node libs/external-tools/matomo-to-gsheet/src/lib/script.ts" + "e2e:test:linux": "xvfb-run --auto-servernum --server-args='-screen 0 1024x768x24' nx e2e:test:cicd mudita-center-e2e" }, "repository": { "type": "git", @@ -67,7 +66,6 @@ "@electron/notarize": "^2.3.0", "@electron/remote": "^2.1.2", "@faker-js/faker": "^7.5.0", - "@googleapis/sheets": "^5.0.5", "@mudita/stylelint-config": "^1.0.4", "@nx/eslint": "^17.2.6", "@nx/jest": "17.2.6", @@ -183,7 +181,6 @@ "fork-ts-checker-webpack-plugin": "^7.2.13", "fs-extra": "^10.1.0", "getmac": "^5.21.0", - "googleapis": "^133.0.0", "history": "^4.10.1", "html-webpack-plugin": "^5.5.0", "husky": "^7.0.4", diff --git a/tsconfig.base.json b/tsconfig.base.json index 08cfa6bfc4..60cdfb3236 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -49,9 +49,6 @@ "electron/application-updater": [ "libs/electron/application-updater/src/index.ts" ], - "external-tools/matomo-to-gsheet": [ - "libs/external-tools/matomo-to-gsheet/src/index.ts" - ], "generic-view/feature": ["libs/generic-view/feature/src/index.ts"], "generic-view/models": ["libs/generic-view/models/src/index.ts"], "generic-view/store": ["libs/generic-view/store/src/index.ts"],