mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 12:19:09 +00:00
refactor: Impose import/order linting rule across nodes packages (no-changelog) (#12314)
This commit is contained in:
committed by
GitHub
parent
8c635993bd
commit
bafac73eb5
@@ -7,13 +7,6 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_SHEETS_SHEET_URL_REGEX } from '../constants';
|
||||
import { apiRequest } from './v2/transport';
|
||||
import { sheetsSearch, spreadSheetsSearch } from './v2/methods/listSearch';
|
||||
import { GoogleSheet } from './v2/helpers/GoogleSheet';
|
||||
import { getSheetHeaderRowAndSkipEmpty } from './v2/methods/loadOptions';
|
||||
import type { ResourceLocator, ValueRenderOption } from './v2/helpers/GoogleSheets.types';
|
||||
|
||||
import {
|
||||
arrayOfArraysToJson,
|
||||
BINARY_MIME_TYPE,
|
||||
@@ -21,6 +14,12 @@ import {
|
||||
getRevisionFile,
|
||||
sheetBinaryToArrayOfArrays,
|
||||
} from './GoogleSheetsTrigger.utils';
|
||||
import { GoogleSheet } from './v2/helpers/GoogleSheet';
|
||||
import type { ResourceLocator, ValueRenderOption } from './v2/helpers/GoogleSheets.types';
|
||||
import { sheetsSearch, spreadSheetsSearch } from './v2/methods/listSearch';
|
||||
import { getSheetHeaderRowAndSkipEmpty } from './v2/methods/loadOptions';
|
||||
import { apiRequest } from './v2/transport';
|
||||
import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_SHEETS_SHEET_URL_REGEX } from '../constants';
|
||||
|
||||
export class GoogleSheetsTrigger implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { IDataObject, IPollFunctions } from 'n8n-workflow';
|
||||
|
||||
import * as XLSX from 'xlsx';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import zip from 'lodash/zip';
|
||||
import type { IDataObject, IPollFunctions } from 'n8n-workflow';
|
||||
import * as XLSX from 'xlsx';
|
||||
|
||||
import type { SheetDataRow, SheetRangeData } from './v2/helpers/GoogleSheets.types';
|
||||
import { apiRequest } from './v2/transport';
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import type {
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import { getGoogleAccessToken } from '../../GenericFunctions';
|
||||
|
||||
export interface IGoogleAuthCredentials {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import get from 'lodash/get';
|
||||
import type { IExecuteFunctions, ILoadOptionsFunctions, IDataObject } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { utils as xlsxUtils } from 'xlsx';
|
||||
|
||||
import get from 'lodash/get';
|
||||
import { googleApiRequest } from './GenericFunctions';
|
||||
|
||||
export interface ISheetOptions {
|
||||
|
||||
@@ -13,8 +13,7 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { getGoogleAccessToken } from '../../GenericFunctions';
|
||||
import { generatePairedItemData } from '../../../../utils/utilities';
|
||||
import { googleApiRequest, hexToRgb } from './GenericFunctions';
|
||||
import type {
|
||||
ILookupValues,
|
||||
ISheetUpdateData,
|
||||
@@ -23,10 +22,9 @@ import type {
|
||||
ValueRenderOption,
|
||||
} from './GoogleSheet';
|
||||
import { GoogleSheet } from './GoogleSheet';
|
||||
|
||||
import { googleApiRequest, hexToRgb } from './GenericFunctions';
|
||||
|
||||
import { versionDescription } from './versionDescription';
|
||||
import { generatePairedItemData } from '../../../../utils/utilities';
|
||||
import { getGoogleAccessToken } from '../../GenericFunctions';
|
||||
|
||||
export class GoogleSheetsV1 implements INodeType {
|
||||
description: INodeTypeDescription;
|
||||
|
||||
@@ -4,9 +4,10 @@ import type {
|
||||
INodeTypeBaseDescription,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { router } from './actions/router';
|
||||
import { versionDescription } from './actions/versionDescription';
|
||||
import { credentialTest, listSearch, loadOptions, resourceMapping } from './methods';
|
||||
import { router } from './actions/router';
|
||||
|
||||
export class GoogleSheetsV2 implements INodeType {
|
||||
description: INodeTypeDescription;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { type IExecuteFunctions, type IDataObject, type INodeExecutionData } from 'n8n-workflow';
|
||||
import { GoogleSheet } from '../helpers/GoogleSheet';
|
||||
import { getSpreadsheetId } from '../helpers/GoogleSheets.utils';
|
||||
import type { GoogleSheets, ResourceLocator } from '../helpers/GoogleSheets.types';
|
||||
import * as spreadsheet from './spreadsheet/SpreadSheet.resource';
|
||||
|
||||
import * as sheet from './sheet/Sheet.resource';
|
||||
import * as spreadsheet from './spreadsheet/SpreadSheet.resource';
|
||||
import { GoogleSheet } from '../helpers/GoogleSheet';
|
||||
import type { GoogleSheets, ResourceLocator } from '../helpers/GoogleSheets.types';
|
||||
import { getSpreadsheetId } from '../helpers/GoogleSheets.utils';
|
||||
|
||||
export async function router(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
let operationResult: INodeExecutionData[] = [];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_SHEETS_SHEET_URL_REGEX } from '../../../../constants';
|
||||
|
||||
import * as append from './append.operation';
|
||||
import * as appendOrUpdate from './appendOrUpdate.operation';
|
||||
import * as clear from './clear.operation';
|
||||
@@ -8,6 +8,7 @@ import * as del from './delete.operation';
|
||||
import * as read from './read.operation';
|
||||
import * as remove from './remove.operation';
|
||||
import * as update from './update.operation';
|
||||
import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_SHEETS_SHEET_URL_REGEX } from '../../../../constants';
|
||||
|
||||
export { append, appendOrUpdate, clear, create, del as delete, read, remove, update };
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@ import {
|
||||
NodeOperationError,
|
||||
type ResourceMapperField,
|
||||
} from 'n8n-workflow';
|
||||
import type { SheetProperties, ValueInputOption } from '../../helpers/GoogleSheets.types';
|
||||
|
||||
import { cellFormat, handlingExtraData, useAppendOption } from './commonDescription';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import type { SheetProperties, ValueInputOption } from '../../helpers/GoogleSheets.types';
|
||||
import {
|
||||
autoMapInputData,
|
||||
cellFormatDefault,
|
||||
@@ -14,7 +16,6 @@ import {
|
||||
mapFields,
|
||||
untilSheetSelected,
|
||||
} from '../../helpers/GoogleSheets.utils';
|
||||
import { cellFormat, handlingExtraData, useAppendOption } from './commonDescription';
|
||||
|
||||
export const description: SheetProperties = [
|
||||
{
|
||||
|
||||
@@ -5,6 +5,14 @@ import type {
|
||||
ResourceMapperField,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
cellFormat,
|
||||
handlingExtraData,
|
||||
locationDefine,
|
||||
useAppendOption,
|
||||
} from './commonDescription';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import {
|
||||
ROW_NUMBER,
|
||||
type ISheetUpdateData,
|
||||
@@ -12,18 +20,11 @@ import {
|
||||
type ValueInputOption,
|
||||
type ValueRenderOption,
|
||||
} from '../../helpers/GoogleSheets.types';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import {
|
||||
cellFormatDefault,
|
||||
checkForSchemaChanges,
|
||||
untilSheetSelected,
|
||||
} from '../../helpers/GoogleSheets.utils';
|
||||
import {
|
||||
cellFormat,
|
||||
handlingExtraData,
|
||||
locationDefine,
|
||||
useAppendOption,
|
||||
} from './commonDescription';
|
||||
|
||||
export const description: SheetProperties = [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import type { SheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import type { SheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
import {
|
||||
getColumnName,
|
||||
getColumnNumber,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import type { SheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
import { apiRequest } from '../../transport';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import { getExistingSheetNames, hexToRgb } from '../../helpers/GoogleSheets.utils';
|
||||
|
||||
import { wrapData } from '../../../../../../utils/utilities';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import type { SheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
import { getExistingSheetNames, hexToRgb } from '../../helpers/GoogleSheets.utils';
|
||||
import { apiRequest } from '../../transport';
|
||||
|
||||
export const description: SheetProperties = [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import type { SheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import { getColumnNumber, untilSheetSelected } from '../../helpers/GoogleSheets.utils';
|
||||
|
||||
import { generatePairedItemData, wrapData } from '../../../../../../utils/utilities';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import type { SheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
import { getColumnNumber, untilSheetSelected } from '../../helpers/GoogleSheets.utils';
|
||||
|
||||
export const description: SheetProperties = [
|
||||
{
|
||||
|
||||
@@ -4,12 +4,9 @@ import type {
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { dataLocationOnSheet, outputFormatting } from './commonDescription';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import {
|
||||
getRangeString,
|
||||
prepareSheetData,
|
||||
untilSheetSelected,
|
||||
} from '../../helpers/GoogleSheets.utils';
|
||||
import type {
|
||||
ILookupValues,
|
||||
RangeDetectionOptions,
|
||||
@@ -17,8 +14,11 @@ import type {
|
||||
SheetRangeData,
|
||||
ValueRenderOption,
|
||||
} from '../../helpers/GoogleSheets.types';
|
||||
|
||||
import { dataLocationOnSheet, outputFormatting } from './commonDescription';
|
||||
import {
|
||||
getRangeString,
|
||||
prepareSheetData,
|
||||
untilSheetSelected,
|
||||
} from '../../helpers/GoogleSheets.utils';
|
||||
|
||||
const combineFiltersOptions: INodeProperties = {
|
||||
displayName: 'Combine Filters',
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import { apiRequest } from '../../transport';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
|
||||
import { wrapData } from '../../../../../../utils/utilities';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import { apiRequest } from '../../transport';
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { cellFormat, handlingExtraData, locationDefine } from './commonDescription';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import {
|
||||
ROW_NUMBER,
|
||||
type ISheetUpdateData,
|
||||
@@ -7,9 +10,7 @@ import {
|
||||
type ValueInputOption,
|
||||
type ValueRenderOption,
|
||||
} from '../../helpers/GoogleSheets.types';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import { cellFormatDefault, untilSheetSelected } from '../../helpers/GoogleSheets.utils';
|
||||
import { cellFormat, handlingExtraData, locationDefine } from './commonDescription';
|
||||
|
||||
export const description: SheetProperties = [
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import * as create from './create.operation';
|
||||
import * as deleteSpreadsheet from './delete.operation';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
|
||||
import { wrapData } from '../../../../../../utils/utilities';
|
||||
import type { SpreadSheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
import { apiRequest } from '../../transport';
|
||||
import { wrapData } from '../../../../../../utils/utilities';
|
||||
|
||||
export const description: SpreadSheetProperties = [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
|
||||
import { wrapData } from '../../../../../../utils/utilities';
|
||||
import { GOOGLE_DRIVE_FILE_URL_REGEX } from '../../../../constants';
|
||||
import type { SpreadSheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
import { apiRequest } from '../../transport';
|
||||
import { GOOGLE_DRIVE_FILE_URL_REGEX } from '../../../../constants';
|
||||
import { wrapData } from '../../../../../../utils/utilities';
|
||||
|
||||
export const description: SpreadSheetProperties = [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { ApplicationError, NodeOperationError } from 'n8n-workflow';
|
||||
import { utils as xlsxUtils } from 'xlsx';
|
||||
import { apiRequest } from '../transport';
|
||||
|
||||
import type {
|
||||
ILookupValues,
|
||||
ISheetUpdateData,
|
||||
@@ -21,6 +21,7 @@ import type {
|
||||
ValueRenderOption,
|
||||
} from './GoogleSheets.types';
|
||||
import { getSheetId, removeEmptyColumns } from './GoogleSheets.utils';
|
||||
import { apiRequest } from '../transport';
|
||||
|
||||
export class GoogleSheet {
|
||||
id: string;
|
||||
|
||||
@@ -8,6 +8,7 @@ import type {
|
||||
ResourceMapperField,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import type { GoogleSheet } from './GoogleSheet';
|
||||
import type {
|
||||
RangeDetectionOptions,
|
||||
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
INodeListSearchResult,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import type { ResourceLocator } from '../helpers/GoogleSheets.types';
|
||||
import { getSpreadsheetId } from '../helpers/GoogleSheets.utils';
|
||||
import { apiRequest } from '../transport';
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { IDataObject, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { GoogleSheet } from '../helpers/GoogleSheet';
|
||||
import { getSpreadsheetId } from '../helpers/GoogleSheets.utils';
|
||||
import type { ResourceLocator } from '../helpers/GoogleSheets.types';
|
||||
import { getSpreadsheetId } from '../helpers/GoogleSheets.utils';
|
||||
|
||||
export async function getSheets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const documentId = this.getNodeParameter('documentId', 0) as IDataObject | null;
|
||||
|
||||
@@ -4,6 +4,7 @@ import type {
|
||||
ResourceMapperField,
|
||||
ResourceMapperFields,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { GoogleSheet } from '../helpers/GoogleSheet';
|
||||
import { ROW_NUMBER, type ResourceLocator } from '../helpers/GoogleSheets.types';
|
||||
import { getSpreadsheetId } from '../helpers/GoogleSheets.utils';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import set from 'lodash/set';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
@@ -8,7 +9,7 @@ import type {
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
import set from 'lodash/set';
|
||||
|
||||
import { getGoogleAccessToken } from '../../../GenericFunctions';
|
||||
|
||||
export async function apiRequest(
|
||||
|
||||
Reference in New Issue
Block a user