refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)

This commit is contained in:
Michael Kret
2023-01-13 19:11:56 +02:00
committed by GitHub
parent d7732ea150
commit 6608e69457
254 changed files with 2687 additions and 2675 deletions

View File

@@ -28,7 +28,7 @@ export async function magentoApiRequest(
method,
body,
qs,
uri: uri || `${credentials.host}${resource}`,
uri: uri ?? `${credentials.host}${resource}`,
json: true,
};
@@ -205,6 +205,94 @@ export function adjustAddresses(addresses: [{ street: string; [key: string]: str
return _addresses;
}
function getConditionTypeFields(): INodeProperties {
return {
displayName: 'Condition Type',
name: 'condition_type',
type: 'options',
options: [
{
name: 'Equals',
value: 'eq',
},
{
name: 'Greater than',
value: 'gt',
},
{
name: 'Greater than or equal',
value: 'gteq',
},
{
name: 'In',
value: 'in',
description: 'The value can contain a comma-separated list of values',
},
{
name: 'Less Than',
value: 'lt',
},
{
name: 'Less Than or Equal',
value: 'lte',
},
{
name: 'Like',
value: 'like',
description: 'The value can contain the SQL wildcard characters when like is specified',
},
{
name: 'More or Equal',
value: 'moreq',
},
{
name: 'Not Equal',
value: 'neq',
},
{
name: 'Not In',
value: 'nin',
description: 'The value can contain a comma-separated list of values',
},
{
name: 'Not Null',
value: 'notnull',
},
{
name: 'Null',
value: 'null',
},
],
default: 'eq',
};
}
function getConditions(attributeFunction: string): INodeProperties[] {
return [
{
displayName: 'Field',
name: 'field',
type: 'options',
typeOptions: {
loadOptionsMethod: attributeFunction,
},
default: '',
},
getConditionTypeFields(),
{
displayName: 'Value',
name: 'value',
type: 'string',
displayOptions: {
hide: {
condition_type: ['null', 'notnull'],
},
},
default: '',
},
];
}
export function getSearchFilters(
resource: string,
filterableAttributeFunction: string,
@@ -384,94 +472,6 @@ export function getSearchFilters(
];
}
function getConditionTypeFields(): INodeProperties {
return {
displayName: 'Condition Type',
name: 'condition_type',
type: 'options',
options: [
{
name: 'Equals',
value: 'eq',
},
{
name: 'Greater than',
value: 'gt',
},
{
name: 'Greater than or equal',
value: 'gteq',
},
{
name: 'In',
value: 'in',
description: 'The value can contain a comma-separated list of values',
},
{
name: 'Less Than',
value: 'lt',
},
{
name: 'Less Than or Equal',
value: 'lte',
},
{
name: 'Like',
value: 'like',
description: 'The value can contain the SQL wildcard characters when like is specified',
},
{
name: 'More or Equal',
value: 'moreq',
},
{
name: 'Not Equal',
value: 'neq',
},
{
name: 'Not In',
value: 'nin',
description: 'The value can contain a comma-separated list of values',
},
{
name: 'Not Null',
value: 'notnull',
},
{
name: 'Null',
value: 'null',
},
],
default: 'eq',
};
}
function getConditions(attributeFunction: string): INodeProperties[] {
return [
{
displayName: 'Field',
name: 'field',
type: 'options',
typeOptions: {
loadOptionsMethod: attributeFunction,
},
default: '',
},
getConditionTypeFields(),
{
displayName: 'Value',
name: 'value',
type: 'string',
displayOptions: {
hide: {
condition_type: ['null', 'notnull'],
},
},
default: '',
},
];
}
export function getFilterQuery(data: {
conditions?: Filter[];
matchType: string;