refactor(core): Google service account remove duplicated functions (no-changelog) (#6368)

This commit is contained in:
Michael Kret
2023-06-06 19:19:24 +03:00
committed by GitHub
parent 3a6af3b2a2
commit 05c4229cd7
14 changed files with 134 additions and 719 deletions

View File

@@ -22,10 +22,10 @@ import type {
} from './GoogleSheet';
import { GoogleSheet } from './GoogleSheet';
import type { IGoogleAuthCredentials } from './GenericFunctions';
import { getAccessToken, googleApiRequest, hexToRgb } from './GenericFunctions';
import { googleApiRequest, hexToRgb } from './GenericFunctions';
import { versionDescription } from './versionDescription';
import { getGoogleAccessToken } from '../../GenericFunctions';
export class GoogleSheetsV1 implements INodeType {
description: INodeTypeDescription;
@@ -71,10 +71,8 @@ export class GoogleSheetsV1 implements INodeType {
credential: ICredentialsDecrypted,
): Promise<INodeCredentialTestResult> {
try {
const tokenRequest = await getAccessToken.call(
this,
credential.data! as unknown as IGoogleAuthCredentials,
);
const tokenRequest = await getGoogleAccessToken.call(this, credential.data!, 'sheetV1');
if (!tokenRequest.access_token) {
return {
status: 'Error',