refactor: Impose import/order linting rule across nodes packages (no-changelog) (#12314)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-12-19 18:46:14 +01:00
committed by GitHub
parent 8c635993bd
commit bafac73eb5
1120 changed files with 2677 additions and 2827 deletions

View File

@@ -1,5 +1,6 @@
import { mock } from 'jest-mock-extended';
import type { IExecuteFunctions } from 'n8n-workflow';
import * as alert from '../../../v2/actions/alert';
import * as transport from '../../../v2/transport';

View File

@@ -1,8 +1,9 @@
import { mock } from 'jest-mock-extended';
import type { IExecuteFunctions } from 'n8n-workflow';
import { SPLUNK } from '../../../v1/types';
import * as report from '../../../v2/actions/report';
import * as transport from '../../../v2/transport';
import { SPLUNK } from '../../../v1/types';
jest.mock('../../../v2/transport', () => ({
splunkApiJsonRequest: jest.fn(),

View File

@@ -1,5 +1,6 @@
import { mock } from 'jest-mock-extended';
import type { IExecuteFunctions } from 'n8n-workflow';
import * as search from '../../../v2/actions/search';
import * as transport from '../../../v2/transport';

View File

@@ -1,8 +1,9 @@
import { mock } from 'jest-mock-extended';
import type { IExecuteFunctions } from 'n8n-workflow';
import { SPLUNK } from '../../../v1/types';
import * as user from '../../../v2/actions/user';
import * as transport from '../../../v2/transport';
import { SPLUNK } from '../../../v1/types';
jest.mock('../../../v2/transport', () => ({
splunkApiJsonRequest: jest.fn(),

View File

@@ -1,5 +1,7 @@
import { mock } from 'jest-mock-extended';
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';
import { SPLUNK } from '../../v1/types';
import {
formatEntry,
extractErrorDescription,
@@ -9,7 +11,6 @@ import {
setReturnAllOrLimit,
parseXml,
} from '../../v2/helpers/utils';
import { SPLUNK } from '../../v1/types';
describe('Splunk, formatEntry', () => {
test('should format the entry correctly when doNotFormatContent is false', () => {

View File

@@ -7,7 +7,6 @@ import type {
IHttpRequestMethods,
} from 'n8n-workflow';
import { NodeApiError, NodeOperationError, sleep } from 'n8n-workflow';
import { parseString } from 'xml2js';
import {

View File

@@ -1,3 +1,4 @@
import set from 'lodash/set';
import type {
IExecuteFunctions,
IDataObject,
@@ -9,19 +10,6 @@ import type {
} from 'n8n-workflow';
import { NodeApiError, NodeConnectionType, NodeOperationError } from 'n8n-workflow';
import set from 'lodash/set';
import { oldVersionNotice } from '../../../utils/descriptions';
import {
formatFeed,
formatResults,
formatSearch,
getId,
populate,
setCount,
splunkApiRequest,
toUnixEpoch,
} from './GenericFunctions';
import {
firedAlertOperations,
searchConfigurationFields,
@@ -33,8 +21,18 @@ import {
userFields,
userOperations,
} from './descriptions';
import {
formatFeed,
formatResults,
formatSearch,
getId,
populate,
setCount,
splunkApiRequest,
toUnixEpoch,
} from './GenericFunctions';
import type { SplunkFeedResponse } from './types';
import { oldVersionNotice } from '../../../utils/descriptions';
const versionDescription: INodeTypeDescription = {
displayName: 'Splunk',

View File

@@ -1,4 +1,5 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest } from '../../transport';

View File

@@ -1,4 +1,5 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest } from '../../transport';

View File

@@ -1,7 +1,7 @@
import type { INodeProperties } from 'n8n-workflow';
import * as getReport from './getReport.operation';
import * as getMetrics from './getMetrics.operation';
import * as getReport from './getReport.operation';
export { getReport, getMetrics };

View File

@@ -1,8 +1,9 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest, splunkApiRequest } from '../../transport';
import { searchJobRLC } from '../../helpers/descriptions';
import { formatFeed } from '../../helpers/utils';
import { splunkApiJsonRequest, splunkApiRequest } from '../../transport';
const properties: INodeProperties[] = [
searchJobRLC,

View File

@@ -1,7 +1,8 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiRequest } from '../../transport';
import { reportRLC } from '../../helpers/descriptions';
import { splunkApiRequest } from '../../transport';
const properties: INodeProperties[] = [reportRLC];

View File

@@ -1,7 +1,8 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest } from '../../transport';
import { reportRLC } from '../../helpers/descriptions';
import { splunkApiJsonRequest } from '../../transport';
const properties: INodeProperties[] = [reportRLC];

View File

@@ -1,4 +1,5 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { populate, setReturnAllOrLimit } from '../../helpers/utils';
import { splunkApiJsonRequest } from '../../transport';

View File

@@ -1,14 +1,13 @@
import set from 'lodash/set';
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import set from 'lodash/set';
import * as alert from './alert';
import type { SplunkType } from './node.type';
import * as report from './report';
import * as search from './search';
import * as user from './user';
import type { SplunkType } from './node.type';
export async function router(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
let returnData: INodeExecutionData[] = [];

View File

@@ -1,4 +1,5 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { populate, toUnixEpoch } from '../../helpers/utils';
import { splunkApiJsonRequest, splunkApiRequest } from '../../transport';

View File

@@ -1,7 +1,8 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiRequest } from '../../transport';
import { searchJobRLC } from '../../helpers/descriptions';
import { splunkApiRequest } from '../../transport';
const properties: INodeProperties[] = [searchJobRLC];

View File

@@ -1,7 +1,8 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest } from '../../transport';
import { searchJobRLC } from '../../helpers/descriptions';
import { splunkApiJsonRequest } from '../../transport';
const properties: INodeProperties[] = [searchJobRLC];

View File

@@ -1,4 +1,5 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { populate, setReturnAllOrLimit } from '../../helpers/utils';
import { splunkApiJsonRequest } from '../../transport';

View File

@@ -1,8 +1,9 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest } from '../../transport';
import { populate, setReturnAllOrLimit } from '../../helpers/utils';
import { searchJobRLC } from '../../helpers/descriptions';
import { populate, setReturnAllOrLimit } from '../../helpers/utils';
import { splunkApiJsonRequest } from '../../transport';
const properties: INodeProperties[] = [
searchJobRLC,

View File

@@ -1,8 +1,9 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import type { SplunkFeedResponse } from '../../helpers/interfaces';
import { formatFeed, populate } from '../../helpers/utils';
import { splunkApiRequest } from '../../transport';
import type { SplunkFeedResponse } from '../../helpers/interfaces';
const properties: INodeProperties[] = [
{

View File

@@ -1,7 +1,8 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiRequest } from '../../transport';
import { userRLC } from '../../helpers/descriptions';
import { splunkApiRequest } from '../../transport';
const properties: INodeProperties[] = [userRLC];

View File

@@ -1,7 +1,8 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest } from '../../transport';
import { userRLC } from '../../helpers/descriptions';
import { splunkApiJsonRequest } from '../../transport';
const properties: INodeProperties[] = [userRLC];

View File

@@ -1,7 +1,8 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest } from '../../transport';
import { setReturnAllOrLimit } from '../../helpers/utils';
import { splunkApiJsonRequest } from '../../transport';
const properties: INodeProperties[] = [
{

View File

@@ -1,8 +1,9 @@
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { userRLC } from '../../helpers/descriptions';
import { formatFeed, populate } from '../../helpers/utils';
import { splunkApiRequest } from '../../transport';
import { userRLC } from '../../helpers/descriptions';
const properties: INodeProperties[] = [
userRLC,

View File

@@ -1,9 +1,8 @@
import type { IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { parseString } from 'xml2js';
import { SPLUNK } from '../../v1/types';
import type { SplunkError, SplunkFeedResponse } from './interfaces';
import { SPLUNK } from '../../v1/types';
function compactEntryContent(splunkObject: any): any {
if (typeof splunkObject !== 'object') {

View File

@@ -1,4 +1,5 @@
import type { IDataObject, ILoadOptionsFunctions, INodeListSearchResult } from 'n8n-workflow';
import { splunkApiJsonRequest } from '../transport';
export async function searchReports(

View File

@@ -19,9 +19,8 @@ export async function splunkApiRequest(
body: IDataObject = {},
qs: IDataObject = {},
): Promise<any> {
const { baseUrl, allowUnauthorizedCerts } = (await this.getCredentials(
'splunkApi',
)) as SplunkCredentials;
const { baseUrl, allowUnauthorizedCerts } =
await this.getCredentials<SplunkCredentials>('splunkApi');
const options: IRequestOptions = {
headers: {
@@ -95,9 +94,8 @@ export async function splunkApiJsonRequest(
body: IDataObject = {},
qs: IDataObject = {},
) {
const { baseUrl, allowUnauthorizedCerts } = (await this.getCredentials(
'splunkApi',
)) as SplunkCredentials;
const { baseUrl, allowUnauthorizedCerts } =
await this.getCredentials<SplunkCredentials>('splunkApi');
qs.output_mode = 'json';