mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +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
@@ -1,3 +1,7 @@
|
||||
import { capitalCase } from 'change-case';
|
||||
import omit from 'lodash/omit';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
@@ -9,15 +13,8 @@ import type {
|
||||
IRequestOptions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import { capitalCase } from 'change-case';
|
||||
|
||||
import omit from 'lodash/omit';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
|
||||
import type { CustomField, GeneralAddress, Ref } from './descriptions/Shared.interface';
|
||||
|
||||
import type { DateFieldsUi, Option, QuickBooksOAuth2Credentials, TransactionReport } from './types';
|
||||
|
||||
/**
|
||||
@@ -43,9 +40,7 @@ export async function quickBooksApiRequest(
|
||||
const productionUrl = 'https://quickbooks.api.intuit.com';
|
||||
const sandboxUrl = 'https://sandbox-quickbooks.api.intuit.com';
|
||||
|
||||
const credentials = (await this.getCredentials(
|
||||
'quickBooksOAuth2Api',
|
||||
)) as QuickBooksOAuth2Credentials;
|
||||
const credentials = await this.getCredentials<QuickBooksOAuth2Credentials>('quickBooksOAuth2Api');
|
||||
|
||||
const options: IRequestOptions = {
|
||||
headers: {
|
||||
@@ -236,9 +231,9 @@ export async function handleBinaryData(
|
||||
const data = await quickBooksApiRequest.call(this, 'GET', endpoint, {}, {}, { encoding: null });
|
||||
|
||||
items[i].binary = items[i].binary ?? {};
|
||||
items[i].binary![binaryProperty] = await this.helpers.prepareBinaryData(data as Buffer);
|
||||
items[i].binary![binaryProperty].fileName = fileName;
|
||||
items[i].binary![binaryProperty].fileExtension = 'pdf';
|
||||
items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data as Buffer);
|
||||
items[i].binary[binaryProperty].fileName = fileName;
|
||||
items[i].binary[binaryProperty].fileExtension = 'pdf';
|
||||
|
||||
return items;
|
||||
}
|
||||
@@ -254,9 +249,7 @@ export async function loadResource(this: ILoadOptionsFunctions, resource: string
|
||||
oauthTokenData: {
|
||||
callbackQueryString: { realmId },
|
||||
},
|
||||
} = await this.getCredentials<{
|
||||
oauthTokenData: { callbackQueryString: { realmId: string } };
|
||||
}>('quickBooksOAuth2Api');
|
||||
} = await this.getCredentials<QuickBooksOAuth2Credentials>('quickBooksOAuth2Api');
|
||||
const endpoint = `/v3/company/${realmId}/query`;
|
||||
|
||||
const resourceItems = await quickBooksApiRequestAllItems.call(
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import { capitalCase } from 'change-case';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IDataObject,
|
||||
@@ -9,8 +11,6 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { capitalCase } from 'change-case';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import {
|
||||
billFields,
|
||||
billOperations,
|
||||
@@ -33,7 +33,6 @@ import {
|
||||
vendorFields,
|
||||
vendorOperations,
|
||||
} from './descriptions';
|
||||
|
||||
import {
|
||||
adjustTransactionDates,
|
||||
getRefAndSyncToken,
|
||||
@@ -46,7 +45,6 @@ import {
|
||||
quickBooksApiRequest,
|
||||
simplifyTransactionReport,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import type { QuickBooksOAuth2Credentials, TransactionFields, TransactionReport } from './types';
|
||||
|
||||
export class QuickBooks implements INodeType {
|
||||
@@ -191,9 +189,8 @@ export class QuickBooks implements INodeType {
|
||||
let responseData;
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
|
||||
const { oauthTokenData } = (await this.getCredentials(
|
||||
'quickBooksOAuth2Api',
|
||||
)) as QuickBooksOAuth2Credentials;
|
||||
const { oauthTokenData } =
|
||||
await this.getCredentials<QuickBooksOAuth2Credentials>('quickBooksOAuth2Api');
|
||||
const companyId = oauthTokenData.callbackQueryString.realmId;
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { toDisplayName, toOptions } from '../../GenericFunctions';
|
||||
|
||||
import {
|
||||
GROUP_BY_OPTIONS,
|
||||
PAYMENT_METHODS,
|
||||
@@ -10,6 +8,7 @@ import {
|
||||
TRANSACTION_REPORT_COLUMNS,
|
||||
TRANSACTION_TYPES,
|
||||
} from './constants';
|
||||
import { toDisplayName, toOptions } from '../../GenericFunctions';
|
||||
|
||||
export const transactionOperations: INodeProperties[] = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user