From c9d5112fcc6522e1035e2a4b8ae559b466329e53 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 14 May 2024 11:35:01 +0200 Subject: [PATCH] Change methods to private --- .../server/src/integrations/googlesheets.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 6d20987ae7..dc945b454a 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -191,7 +191,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { * @param spreadsheetId - the URL or standard spreadsheetId of the google sheet * @returns spreadsheet Id of the google sheet */ - cleanSpreadsheetUrl(spreadsheetId: string) { + private cleanSpreadsheetUrl(spreadsheetId: string) { if (!spreadsheetId) { throw new Error( "You must set a spreadsheet ID in your configuration to fetch tables." @@ -201,7 +201,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { return parts.length > 5 ? parts[5] : spreadsheetId } - async fetchAccessToken( + private async fetchAccessToken( payload: AuthTokenRequest ): Promise { const response = await fetch("https://www.googleapis.com/oauth2/v4/token", { @@ -226,7 +226,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { return json } - async connect() { + private async connect() { try { await setupCreationAuth(this.config) @@ -271,7 +271,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { return sheets.map(s => s.title) } - getTableSchema( + private getTableSchema( title: string, headerValues: string[], datasourceId: string, @@ -385,7 +385,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { } } - buildRowObject( + private buildRowObject( headers: string[], values: Record, rowNumber: number @@ -400,7 +400,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { return rowObject } - async createTable(name?: string) { + private async createTable(name?: string) { if (!name) { throw new Error("Must provide name for new sheet.") } @@ -413,7 +413,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { } } - async updateTable(table: TableRequest) { + private async updateTable(table: TableRequest) { await this.connect() const sheet = this.client.sheetsByTitle[table.name] await sheet.loadHeaderRow() @@ -460,7 +460,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { } } - async deleteTable(sheet: any) { + private async deleteTable(sheet: any) { try { await this.connect() const sheetToDelete = this.client.sheetsByTitle[sheet] @@ -487,7 +487,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { } } - async createBulk(query: { sheet: string; rows: Row[] }) { + private async createBulk(query: { sheet: string; rows: Row[] }) { try { await this.connect() const sheet = this.client.sheetsByTitle[query.sheet]