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,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';
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -7,7 +7,6 @@ import type {
|
||||
IHttpRequestMethods,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError, sleep } from 'n8n-workflow';
|
||||
|
||||
import { parseString } from 'xml2js';
|
||||
|
||||
import {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../utils/utilities';
|
||||
import { splunkApiJsonRequest } from '../../transport';
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
|
||||
|
||||
import { updateDisplayOptions } from '../../../../../utils/utilities';
|
||||
import { splunkApiJsonRequest } from '../../transport';
|
||||
|
||||
|
||||
@@ -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 };
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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[] = [
|
||||
{
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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[] = [
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { IDataObject, ILoadOptionsFunctions, INodeListSearchResult } from 'n8n-workflow';
|
||||
|
||||
import { splunkApiJsonRequest } from '../transport';
|
||||
|
||||
export async function searchReports(
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user